Skip to content

Commit

Permalink
Bump version to 2.11.1 and update dist files
Browse files Browse the repository at this point in the history
  • Loading branch information
bhch committed Sep 6, 2023
1 parent 0837e04 commit e443e31
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 11 deletions.
10 changes: 7 additions & 3 deletions dist/react-json-form.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -1427,7 +1427,10 @@ class FormTextareaInput extends React__default["default"].Component {

delete props.type;
props.ref = inputRef || this.inputRef;
props.onChange = this.handleChange;
props.onChange = this.handleChange; // readonly inputs are automatically marked disabled
// if this is undesired, explicitly pass disabled=false

if (props.readOnly && (props.disabled === undefined || props.disabled === null)) props.disabled = true;
return /*#__PURE__*/React__default["default"].createElement("div", null, /*#__PURE__*/React__default["default"].createElement(Label, {
label: label,
required: props.required
Expand Down Expand Up @@ -2695,6 +2698,7 @@ function getArrayFormRow(args) {
editable: args.editable,
onEdit: args.onKeyEdit
}, schema.title) : null;
let groupDescription = schema.description ? /*#__PURE__*/React__default["default"].createElement(GroupDescription, null, schema.description) : null;
groups = /*#__PURE__*/React__default["default"].createElement("div", {
key: 'group_' + name,
className: "rjf-form-group-wrapper"
Expand All @@ -2704,7 +2708,7 @@ function getArrayFormRow(args) {
className: "rjf-form-group"
}, /*#__PURE__*/React__default["default"].createElement("div", {
className: level > 0 ? "rjf-form-group-inner" : ""
}, groupTitle, groupError && groupError.map((error, i) => /*#__PURE__*/React__default["default"].createElement("div", {
}, groupTitle, groupDescription, groupError && groupError.map((error, i) => /*#__PURE__*/React__default["default"].createElement("div", {
className: "rjf-error-text",
key: i
}, error)), groups.map((i, index) => /*#__PURE__*/React__default["default"].createElement("div", {
Expand Down Expand Up @@ -4071,7 +4075,7 @@ function DataValidator(schema) {
}

if ((schema.minimum || schema.minimum === 0) && data < schema.minimum) this.addError(coords, 'This value must not be less than ' + schema.minimum);
if ((schema.maximum || schema.maximum === 0) && data > schema.maximum) this.addError(coords, 'This value must not be greater than ' + schema.minimum);
if ((schema.maximum || schema.maximum === 0) && data > schema.maximum) this.addError(coords, 'This value must not be greater than ' + schema.maximum);
if ((schema.exclusiveMinimum || schema.exclusiveMinimum === 0) && data <= schema.exclusiveMinimum) this.addError(coords, 'This value must be greater than ' + schema.exclusiveMinimum);
if ((schema.exclusiveMaximum || schema.exclusiveMaximum === 0) && data >= schema.exclusiveMaximum) this.addError(coords, 'This value must be less than ' + schema.exclusiveMaximum);
if ((schema.multipleOf || schema.multipleOf === 0) && data * 100 % (schema.multipleOf * 100) / 100) this.addError(coords, 'This value must be a multiple of ' + schema.multipleOf);
Expand Down
2 changes: 1 addition & 1 deletion dist/react-json-form.js

Large diffs are not rendered by default.

10 changes: 7 additions & 3 deletions dist/react-json-form.modern.js
Original file line number Diff line number Diff line change
Expand Up @@ -1421,7 +1421,10 @@ class FormTextareaInput extends React$1.Component {

delete props.type;
props.ref = inputRef || this.inputRef;
props.onChange = this.handleChange;
props.onChange = this.handleChange; // readonly inputs are automatically marked disabled
// if this is undesired, explicitly pass disabled=false

if (props.readOnly && (props.disabled === undefined || props.disabled === null)) props.disabled = true;
return /*#__PURE__*/React$1.createElement("div", null, /*#__PURE__*/React$1.createElement(Label, {
label: label,
required: props.required
Expand Down Expand Up @@ -2689,6 +2692,7 @@ function getArrayFormRow(args) {
editable: args.editable,
onEdit: args.onKeyEdit
}, schema.title) : null;
let groupDescription = schema.description ? /*#__PURE__*/React$1.createElement(GroupDescription, null, schema.description) : null;
groups = /*#__PURE__*/React$1.createElement("div", {
key: 'group_' + name,
className: "rjf-form-group-wrapper"
Expand All @@ -2698,7 +2702,7 @@ function getArrayFormRow(args) {
className: "rjf-form-group"
}, /*#__PURE__*/React$1.createElement("div", {
className: level > 0 ? "rjf-form-group-inner" : ""
}, groupTitle, groupError && groupError.map((error, i) => /*#__PURE__*/React$1.createElement("div", {
}, groupTitle, groupDescription, groupError && groupError.map((error, i) => /*#__PURE__*/React$1.createElement("div", {
className: "rjf-error-text",
key: i
}, error)), groups.map((i, index) => /*#__PURE__*/React$1.createElement("div", {
Expand Down Expand Up @@ -4065,7 +4069,7 @@ function DataValidator(schema) {
}

if ((schema.minimum || schema.minimum === 0) && data < schema.minimum) this.addError(coords, 'This value must not be less than ' + schema.minimum);
if ((schema.maximum || schema.maximum === 0) && data > schema.maximum) this.addError(coords, 'This value must not be greater than ' + schema.minimum);
if ((schema.maximum || schema.maximum === 0) && data > schema.maximum) this.addError(coords, 'This value must not be greater than ' + schema.maximum);
if ((schema.exclusiveMinimum || schema.exclusiveMinimum === 0) && data <= schema.exclusiveMinimum) this.addError(coords, 'This value must be greater than ' + schema.exclusiveMinimum);
if ((schema.exclusiveMaximum || schema.exclusiveMaximum === 0) && data >= schema.exclusiveMaximum) this.addError(coords, 'This value must be less than ' + schema.exclusiveMaximum);
if ((schema.multipleOf || schema.multipleOf === 0) && data * 100 % (schema.multipleOf * 100) / 100) this.addError(coords, 'This value must be a multiple of ' + schema.multipleOf);
Expand Down
10 changes: 7 additions & 3 deletions dist/react-json-form.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -1421,7 +1421,10 @@ class FormTextareaInput extends React$1.Component {

delete props.type;
props.ref = inputRef || this.inputRef;
props.onChange = this.handleChange;
props.onChange = this.handleChange; // readonly inputs are automatically marked disabled
// if this is undesired, explicitly pass disabled=false

if (props.readOnly && (props.disabled === undefined || props.disabled === null)) props.disabled = true;
return /*#__PURE__*/React$1.createElement("div", null, /*#__PURE__*/React$1.createElement(Label, {
label: label,
required: props.required
Expand Down Expand Up @@ -2689,6 +2692,7 @@ function getArrayFormRow(args) {
editable: args.editable,
onEdit: args.onKeyEdit
}, schema.title) : null;
let groupDescription = schema.description ? /*#__PURE__*/React$1.createElement(GroupDescription, null, schema.description) : null;
groups = /*#__PURE__*/React$1.createElement("div", {
key: 'group_' + name,
className: "rjf-form-group-wrapper"
Expand All @@ -2698,7 +2702,7 @@ function getArrayFormRow(args) {
className: "rjf-form-group"
}, /*#__PURE__*/React$1.createElement("div", {
className: level > 0 ? "rjf-form-group-inner" : ""
}, groupTitle, groupError && groupError.map((error, i) => /*#__PURE__*/React$1.createElement("div", {
}, groupTitle, groupDescription, groupError && groupError.map((error, i) => /*#__PURE__*/React$1.createElement("div", {
className: "rjf-error-text",
key: i
}, error)), groups.map((i, index) => /*#__PURE__*/React$1.createElement("div", {
Expand Down Expand Up @@ -4065,7 +4069,7 @@ function DataValidator(schema) {
}

if ((schema.minimum || schema.minimum === 0) && data < schema.minimum) this.addError(coords, 'This value must not be less than ' + schema.minimum);
if ((schema.maximum || schema.maximum === 0) && data > schema.maximum) this.addError(coords, 'This value must not be greater than ' + schema.minimum);
if ((schema.maximum || schema.maximum === 0) && data > schema.maximum) this.addError(coords, 'This value must not be greater than ' + schema.maximum);
if ((schema.exclusiveMinimum || schema.exclusiveMinimum === 0) && data <= schema.exclusiveMinimum) this.addError(coords, 'This value must be greater than ' + schema.exclusiveMinimum);
if ((schema.exclusiveMaximum || schema.exclusiveMaximum === 0) && data >= schema.exclusiveMaximum) this.addError(coords, 'This value must be less than ' + schema.exclusiveMaximum);
if ((schema.multipleOf || schema.multipleOf === 0) && data * 100 % (schema.multipleOf * 100) / 100) this.addError(coords, 'This value must be a multiple of ' + schema.multipleOf);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bhch/react-json-form",
"version": "2.11.0",
"version": "2.11.1",
"description": "Create forms using JSON Schema",
"publishConfig": {
"access": "public"
Expand Down

0 comments on commit e443e31

Please sign in to comment.