Skip to content

Commit e443e31

Browse files
committed
Bump version to 2.11.1 and update dist files
1 parent 0837e04 commit e443e31

File tree

5 files changed

+23
-11
lines changed

5 files changed

+23
-11
lines changed

dist/react-json-form.cjs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1427,7 +1427,10 @@ class FormTextareaInput extends React__default["default"].Component {
14271427

14281428
delete props.type;
14291429
props.ref = inputRef || this.inputRef;
1430-
props.onChange = this.handleChange;
1430+
props.onChange = this.handleChange; // readonly inputs are automatically marked disabled
1431+
// if this is undesired, explicitly pass disabled=false
1432+
1433+
if (props.readOnly && (props.disabled === undefined || props.disabled === null)) props.disabled = true;
14311434
return /*#__PURE__*/React__default["default"].createElement("div", null, /*#__PURE__*/React__default["default"].createElement(Label, {
14321435
label: label,
14331436
required: props.required
@@ -2695,6 +2698,7 @@ function getArrayFormRow(args) {
26952698
editable: args.editable,
26962699
onEdit: args.onKeyEdit
26972700
}, schema.title) : null;
2701+
let groupDescription = schema.description ? /*#__PURE__*/React__default["default"].createElement(GroupDescription, null, schema.description) : null;
26982702
groups = /*#__PURE__*/React__default["default"].createElement("div", {
26992703
key: 'group_' + name,
27002704
className: "rjf-form-group-wrapper"
@@ -2704,7 +2708,7 @@ function getArrayFormRow(args) {
27042708
className: "rjf-form-group"
27052709
}, /*#__PURE__*/React__default["default"].createElement("div", {
27062710
className: level > 0 ? "rjf-form-group-inner" : ""
2707-
}, groupTitle, groupError && groupError.map((error, i) => /*#__PURE__*/React__default["default"].createElement("div", {
2711+
}, groupTitle, groupDescription, groupError && groupError.map((error, i) => /*#__PURE__*/React__default["default"].createElement("div", {
27082712
className: "rjf-error-text",
27092713
key: i
27102714
}, error)), groups.map((i, index) => /*#__PURE__*/React__default["default"].createElement("div", {
@@ -4071,7 +4075,7 @@ function DataValidator(schema) {
40714075
}
40724076

40734077
if ((schema.minimum || schema.minimum === 0) && data < schema.minimum) this.addError(coords, 'This value must not be less than ' + schema.minimum);
4074-
if ((schema.maximum || schema.maximum === 0) && data > schema.maximum) this.addError(coords, 'This value must not be greater than ' + schema.minimum);
4078+
if ((schema.maximum || schema.maximum === 0) && data > schema.maximum) this.addError(coords, 'This value must not be greater than ' + schema.maximum);
40754079
if ((schema.exclusiveMinimum || schema.exclusiveMinimum === 0) && data <= schema.exclusiveMinimum) this.addError(coords, 'This value must be greater than ' + schema.exclusiveMinimum);
40764080
if ((schema.exclusiveMaximum || schema.exclusiveMaximum === 0) && data >= schema.exclusiveMaximum) this.addError(coords, 'This value must be less than ' + schema.exclusiveMaximum);
40774081
if ((schema.multipleOf || schema.multipleOf === 0) && data * 100 % (schema.multipleOf * 100) / 100) this.addError(coords, 'This value must be a multiple of ' + schema.multipleOf);

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: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1421,7 +1421,10 @@ class FormTextareaInput extends React$1.Component {
14211421

14221422
delete props.type;
14231423
props.ref = inputRef || this.inputRef;
1424-
props.onChange = this.handleChange;
1424+
props.onChange = this.handleChange; // readonly inputs are automatically marked disabled
1425+
// if this is undesired, explicitly pass disabled=false
1426+
1427+
if (props.readOnly && (props.disabled === undefined || props.disabled === null)) props.disabled = true;
14251428
return /*#__PURE__*/React$1.createElement("div", null, /*#__PURE__*/React$1.createElement(Label, {
14261429
label: label,
14271430
required: props.required
@@ -2689,6 +2692,7 @@ function getArrayFormRow(args) {
26892692
editable: args.editable,
26902693
onEdit: args.onKeyEdit
26912694
}, schema.title) : null;
2695+
let groupDescription = schema.description ? /*#__PURE__*/React$1.createElement(GroupDescription, null, schema.description) : null;
26922696
groups = /*#__PURE__*/React$1.createElement("div", {
26932697
key: 'group_' + name,
26942698
className: "rjf-form-group-wrapper"
@@ -2698,7 +2702,7 @@ function getArrayFormRow(args) {
26982702
className: "rjf-form-group"
26992703
}, /*#__PURE__*/React$1.createElement("div", {
27002704
className: level > 0 ? "rjf-form-group-inner" : ""
2701-
}, groupTitle, groupError && groupError.map((error, i) => /*#__PURE__*/React$1.createElement("div", {
2705+
}, groupTitle, groupDescription, groupError && groupError.map((error, i) => /*#__PURE__*/React$1.createElement("div", {
27022706
className: "rjf-error-text",
27032707
key: i
27042708
}, error)), groups.map((i, index) => /*#__PURE__*/React$1.createElement("div", {
@@ -4065,7 +4069,7 @@ function DataValidator(schema) {
40654069
}
40664070

40674071
if ((schema.minimum || schema.minimum === 0) && data < schema.minimum) this.addError(coords, 'This value must not be less than ' + schema.minimum);
4068-
if ((schema.maximum || schema.maximum === 0) && data > schema.maximum) this.addError(coords, 'This value must not be greater than ' + schema.minimum);
4072+
if ((schema.maximum || schema.maximum === 0) && data > schema.maximum) this.addError(coords, 'This value must not be greater than ' + schema.maximum);
40694073
if ((schema.exclusiveMinimum || schema.exclusiveMinimum === 0) && data <= schema.exclusiveMinimum) this.addError(coords, 'This value must be greater than ' + schema.exclusiveMinimum);
40704074
if ((schema.exclusiveMaximum || schema.exclusiveMaximum === 0) && data >= schema.exclusiveMaximum) this.addError(coords, 'This value must be less than ' + schema.exclusiveMaximum);
40714075
if ((schema.multipleOf || schema.multipleOf === 0) && data * 100 % (schema.multipleOf * 100) / 100) this.addError(coords, 'This value must be a multiple of ' + schema.multipleOf);

dist/react-json-form.module.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1421,7 +1421,10 @@ class FormTextareaInput extends React$1.Component {
14211421

14221422
delete props.type;
14231423
props.ref = inputRef || this.inputRef;
1424-
props.onChange = this.handleChange;
1424+
props.onChange = this.handleChange; // readonly inputs are automatically marked disabled
1425+
// if this is undesired, explicitly pass disabled=false
1426+
1427+
if (props.readOnly && (props.disabled === undefined || props.disabled === null)) props.disabled = true;
14251428
return /*#__PURE__*/React$1.createElement("div", null, /*#__PURE__*/React$1.createElement(Label, {
14261429
label: label,
14271430
required: props.required
@@ -2689,6 +2692,7 @@ function getArrayFormRow(args) {
26892692
editable: args.editable,
26902693
onEdit: args.onKeyEdit
26912694
}, schema.title) : null;
2695+
let groupDescription = schema.description ? /*#__PURE__*/React$1.createElement(GroupDescription, null, schema.description) : null;
26922696
groups = /*#__PURE__*/React$1.createElement("div", {
26932697
key: 'group_' + name,
26942698
className: "rjf-form-group-wrapper"
@@ -2698,7 +2702,7 @@ function getArrayFormRow(args) {
26982702
className: "rjf-form-group"
26992703
}, /*#__PURE__*/React$1.createElement("div", {
27002704
className: level > 0 ? "rjf-form-group-inner" : ""
2701-
}, groupTitle, groupError && groupError.map((error, i) => /*#__PURE__*/React$1.createElement("div", {
2705+
}, groupTitle, groupDescription, groupError && groupError.map((error, i) => /*#__PURE__*/React$1.createElement("div", {
27022706
className: "rjf-error-text",
27032707
key: i
27042708
}, error)), groups.map((i, index) => /*#__PURE__*/React$1.createElement("div", {
@@ -4065,7 +4069,7 @@ function DataValidator(schema) {
40654069
}
40664070

40674071
if ((schema.minimum || schema.minimum === 0) && data < schema.minimum) this.addError(coords, 'This value must not be less than ' + schema.minimum);
4068-
if ((schema.maximum || schema.maximum === 0) && data > schema.maximum) this.addError(coords, 'This value must not be greater than ' + schema.minimum);
4072+
if ((schema.maximum || schema.maximum === 0) && data > schema.maximum) this.addError(coords, 'This value must not be greater than ' + schema.maximum);
40694073
if ((schema.exclusiveMinimum || schema.exclusiveMinimum === 0) && data <= schema.exclusiveMinimum) this.addError(coords, 'This value must be greater than ' + schema.exclusiveMinimum);
40704074
if ((schema.exclusiveMaximum || schema.exclusiveMaximum === 0) && data >= schema.exclusiveMaximum) this.addError(coords, 'This value must be less than ' + schema.exclusiveMaximum);
40714075
if ((schema.multipleOf || schema.multipleOf === 0) && data * 100 % (schema.multipleOf * 100) / 100) this.addError(coords, 'This value must be a multiple of ' + schema.multipleOf);

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.11.0",
3+
"version": "2.11.1",
44
"description": "Create forms using JSON Schema",
55
"publishConfig": {
66
"access": "public"

0 commit comments

Comments
 (0)