Skip to content

Commit 12c4b68

Browse files
committed
Bump version to 2.6.0 and update dist files
1 parent 10445df commit 12c4b68

File tree

5 files changed

+44
-14
lines changed

5 files changed

+44
-14
lines changed

dist/react-json-form.cjs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2224,8 +2224,8 @@ function FormField(props) {
22242224
inputProps.type = 'text';
22252225
}
22262226

2227-
if (props.schema.minLength || props.schema.minLength === 0) inputProps.minlength = props.schema.minLength;
2228-
if (props.schema.maxLength || props.schema.maxLength === 0) inputProps.maxlength = props.schema.maxLength;
2227+
if (props.schema.minLength || props.schema.minLength === 0) inputProps.minLength = props.schema.minLength;
2228+
if (props.schema.maxLength || props.schema.maxLength === 0) inputProps.maxLength = props.schema.maxLength;
22292229
break;
22302230

22312231
case 'fileinput':
@@ -2275,8 +2275,8 @@ function FormField(props) {
22752275

22762276
case 'textarea':
22772277
InputField = FormTextareaInput;
2278-
if (props.schema.minLength || props.schema.minLength === 0) inputProps.minlength = props.schema.minLength;
2279-
if (props.schema.maxLength || props.schema.maxLength === 0) inputProps.maxlength = props.schema.maxLength;
2278+
if (props.schema.minLength || props.schema.minLength === 0) inputProps.minLength = props.schema.minLength;
2279+
if (props.schema.maxLength || props.schema.maxLength === 0) inputProps.maxLength = props.schema.maxLength;
22802280
break;
22812281

22822282
default:
@@ -2508,6 +2508,11 @@ function getObjectFormRow(args) {
25082508
schemaValue.title = getVerboseName(key);
25092509
let removable = false;
25102510
if (schema_keys[key] === undefined) removable = true;
2511+
2512+
if (schema.hasOwnProperty('required') && Array.isArray(schema.required)) {
2513+
if (schema.required.indexOf(key) > -1) schemaValue['required'] = true;
2514+
}
2515+
25112516
let nextArgs = {
25122517
data: value,
25132518
schema: schemaValue,
@@ -3580,6 +3585,11 @@ function DataValidator(schema) {
35803585
};
35813586
}
35823587
if (next_schema.hasOwnProperty('$ref')) next_schema = this.getRef(next_schema.$ref);
3588+
3589+
if (schema.hasOwnProperty('required') && Array.isArray(schema.required)) {
3590+
if (schema.required.indexOf(key) > -1) next_schema['required'] = true;
3591+
}
3592+
35833593
let next_type = normalizeKeyword(next_schema.type);
35843594
let next_validator = this.getValidator(next_type);
35853595
if (next_validator) next_validator(next_schema, data[key], this.joinCoords([coords, key]));else {

dist/react-json-form.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/react-json-form.modern.js

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2218,8 +2218,8 @@ function FormField(props) {
22182218
inputProps.type = 'text';
22192219
}
22202220

2221-
if (props.schema.minLength || props.schema.minLength === 0) inputProps.minlength = props.schema.minLength;
2222-
if (props.schema.maxLength || props.schema.maxLength === 0) inputProps.maxlength = props.schema.maxLength;
2221+
if (props.schema.minLength || props.schema.minLength === 0) inputProps.minLength = props.schema.minLength;
2222+
if (props.schema.maxLength || props.schema.maxLength === 0) inputProps.maxLength = props.schema.maxLength;
22232223
break;
22242224

22252225
case 'fileinput':
@@ -2269,8 +2269,8 @@ function FormField(props) {
22692269

22702270
case 'textarea':
22712271
InputField = FormTextareaInput;
2272-
if (props.schema.minLength || props.schema.minLength === 0) inputProps.minlength = props.schema.minLength;
2273-
if (props.schema.maxLength || props.schema.maxLength === 0) inputProps.maxlength = props.schema.maxLength;
2272+
if (props.schema.minLength || props.schema.minLength === 0) inputProps.minLength = props.schema.minLength;
2273+
if (props.schema.maxLength || props.schema.maxLength === 0) inputProps.maxLength = props.schema.maxLength;
22742274
break;
22752275

22762276
default:
@@ -2502,6 +2502,11 @@ function getObjectFormRow(args) {
25022502
schemaValue.title = getVerboseName(key);
25032503
let removable = false;
25042504
if (schema_keys[key] === undefined) removable = true;
2505+
2506+
if (schema.hasOwnProperty('required') && Array.isArray(schema.required)) {
2507+
if (schema.required.indexOf(key) > -1) schemaValue['required'] = true;
2508+
}
2509+
25052510
let nextArgs = {
25062511
data: value,
25072512
schema: schemaValue,
@@ -3574,6 +3579,11 @@ function DataValidator(schema) {
35743579
};
35753580
}
35763581
if (next_schema.hasOwnProperty('$ref')) next_schema = this.getRef(next_schema.$ref);
3582+
3583+
if (schema.hasOwnProperty('required') && Array.isArray(schema.required)) {
3584+
if (schema.required.indexOf(key) > -1) next_schema['required'] = true;
3585+
}
3586+
35773587
let next_type = normalizeKeyword(next_schema.type);
35783588
let next_validator = this.getValidator(next_type);
35793589
if (next_validator) next_validator(next_schema, data[key], this.joinCoords([coords, key]));else {

dist/react-json-form.module.js

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2218,8 +2218,8 @@ function FormField(props) {
22182218
inputProps.type = 'text';
22192219
}
22202220

2221-
if (props.schema.minLength || props.schema.minLength === 0) inputProps.minlength = props.schema.minLength;
2222-
if (props.schema.maxLength || props.schema.maxLength === 0) inputProps.maxlength = props.schema.maxLength;
2221+
if (props.schema.minLength || props.schema.minLength === 0) inputProps.minLength = props.schema.minLength;
2222+
if (props.schema.maxLength || props.schema.maxLength === 0) inputProps.maxLength = props.schema.maxLength;
22232223
break;
22242224

22252225
case 'fileinput':
@@ -2269,8 +2269,8 @@ function FormField(props) {
22692269

22702270
case 'textarea':
22712271
InputField = FormTextareaInput;
2272-
if (props.schema.minLength || props.schema.minLength === 0) inputProps.minlength = props.schema.minLength;
2273-
if (props.schema.maxLength || props.schema.maxLength === 0) inputProps.maxlength = props.schema.maxLength;
2272+
if (props.schema.minLength || props.schema.minLength === 0) inputProps.minLength = props.schema.minLength;
2273+
if (props.schema.maxLength || props.schema.maxLength === 0) inputProps.maxLength = props.schema.maxLength;
22742274
break;
22752275

22762276
default:
@@ -2502,6 +2502,11 @@ function getObjectFormRow(args) {
25022502
schemaValue.title = getVerboseName(key);
25032503
let removable = false;
25042504
if (schema_keys[key] === undefined) removable = true;
2505+
2506+
if (schema.hasOwnProperty('required') && Array.isArray(schema.required)) {
2507+
if (schema.required.indexOf(key) > -1) schemaValue['required'] = true;
2508+
}
2509+
25052510
let nextArgs = {
25062511
data: value,
25072512
schema: schemaValue,
@@ -3574,6 +3579,11 @@ function DataValidator(schema) {
35743579
};
35753580
}
35763581
if (next_schema.hasOwnProperty('$ref')) next_schema = this.getRef(next_schema.$ref);
3582+
3583+
if (schema.hasOwnProperty('required') && Array.isArray(schema.required)) {
3584+
if (schema.required.indexOf(key) > -1) next_schema['required'] = true;
3585+
}
3586+
35773587
let next_type = normalizeKeyword(next_schema.type);
35783588
let next_validator = this.getValidator(next_type);
35793589
if (next_validator) next_validator(next_schema, data[key], this.joinCoords([coords, key]));else {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@bhch/react-json-form",
3-
"version": "2.5.0",
3+
"version": "2.6.0",
44
"description": "Create forms using JSON Schema",
55
"publishConfig": {
66
"access": "public"

0 commit comments

Comments
 (0)