Skip to content

Commit 1d77970

Browse files
committed
Bump version to 2.9.0 and update dist files
1 parent 1901a5c commit 1d77970

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
@@ -1843,6 +1843,12 @@ function GroupTitle(props) {
18431843
title: "Edit"
18441844
}, "Edit")) : props.children);
18451845
}
1846+
function GroupDescription(props) {
1847+
if (!props.children) return null;
1848+
return /*#__PURE__*/React__default["default"].createElement("div", {
1849+
className: "rjf-form-group-description"
1850+
}, props.children);
1851+
}
18461852

18471853
function animate(e, animation, callback) {
18481854
let el = e.target.parentElement.parentElement;
@@ -1933,12 +1939,12 @@ function FormGroup(props) {
19331939
}, props.level === 0 && /*#__PURE__*/React__default["default"].createElement(GroupTitle, {
19341940
editable: props.editable,
19351941
onEdit: props.onEdit
1936-
}, props.schema.title), /*#__PURE__*/React__default["default"].createElement("div", {
1942+
}, props.schema.title), props.level === 0 && /*#__PURE__*/React__default["default"].createElement(GroupDescription, null, props.schema.description), /*#__PURE__*/React__default["default"].createElement("div", {
19371943
className: innerClassName
19381944
}, props.level > 0 && /*#__PURE__*/React__default["default"].createElement(GroupTitle, {
19391945
editable: props.editable,
19401946
onEdit: props.onEdit
1941-
}, props.schema.title), props.children, props.addable && /*#__PURE__*/React__default["default"].createElement(Button, {
1947+
}, props.schema.title), props.level > 0 && /*#__PURE__*/React__default["default"].createElement(GroupDescription, null, props.schema.description), props.children, props.addable && /*#__PURE__*/React__default["default"].createElement(Button, {
19421948
className: "add",
19431949
onClick: e => props.onAdd(),
19441950
title: props.schema.type === 'object' ? 'Add new key' : 'Add new item'
@@ -2691,6 +2697,7 @@ function getObjectFormRow(args) {
26912697
let value = data[key];
26922698
let childName = joinCoords(name, key);
26932699
let schemaValue = schema_keys.hasOwnProperty(key) ? _extends({}, schema_keys[key]) : undefined;
2700+
let isAdditionalProperty = schema_keys.hasOwnProperty(key) ? false : true;
26942701

26952702
if (typeof schemaValue === 'undefined') {
26962703
// for keys added through additionalProperties
@@ -2702,8 +2709,11 @@ function getObjectFormRow(args) {
27022709
let isRef = schemaValue.hasOwnProperty('$ref');
27032710
if (isRef) schemaValue = args.getRef(schemaValue['$ref']);
27042711
let type = normalizeKeyword(schemaValue.type);
2705-
if (!schemaValue.title || isRef && schema.additionalProperties) // for additionalProperty refs, use the key as the title
2706-
schemaValue.title = getVerboseName(key);
2712+
2713+
if (!schemaValue.title) {
2714+
if (isAdditionalProperty) schemaValue.title = key;else schemaValue.title = getVerboseName(key);
2715+
}
2716+
27072717
let removable = false;
27082718
if (schema_keys[key] === undefined) removable = true;
27092719

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
@@ -1837,6 +1837,12 @@ function GroupTitle(props) {
18371837
title: "Edit"
18381838
}, "Edit")) : props.children);
18391839
}
1840+
function GroupDescription(props) {
1841+
if (!props.children) return null;
1842+
return /*#__PURE__*/React$1.createElement("div", {
1843+
className: "rjf-form-group-description"
1844+
}, props.children);
1845+
}
18401846

18411847
function animate(e, animation, callback) {
18421848
let el = e.target.parentElement.parentElement;
@@ -1927,12 +1933,12 @@ function FormGroup(props) {
19271933
}, props.level === 0 && /*#__PURE__*/React$1.createElement(GroupTitle, {
19281934
editable: props.editable,
19291935
onEdit: props.onEdit
1930-
}, props.schema.title), /*#__PURE__*/React$1.createElement("div", {
1936+
}, props.schema.title), props.level === 0 && /*#__PURE__*/React$1.createElement(GroupDescription, null, props.schema.description), /*#__PURE__*/React$1.createElement("div", {
19311937
className: innerClassName
19321938
}, props.level > 0 && /*#__PURE__*/React$1.createElement(GroupTitle, {
19331939
editable: props.editable,
19341940
onEdit: props.onEdit
1935-
}, props.schema.title), props.children, props.addable && /*#__PURE__*/React$1.createElement(Button, {
1941+
}, props.schema.title), props.level > 0 && /*#__PURE__*/React$1.createElement(GroupDescription, null, props.schema.description), props.children, props.addable && /*#__PURE__*/React$1.createElement(Button, {
19361942
className: "add",
19371943
onClick: e => props.onAdd(),
19381944
title: props.schema.type === 'object' ? 'Add new key' : 'Add new item'
@@ -2685,6 +2691,7 @@ function getObjectFormRow(args) {
26852691
let value = data[key];
26862692
let childName = joinCoords(name, key);
26872693
let schemaValue = schema_keys.hasOwnProperty(key) ? _extends({}, schema_keys[key]) : undefined;
2694+
let isAdditionalProperty = schema_keys.hasOwnProperty(key) ? false : true;
26882695

26892696
if (typeof schemaValue === 'undefined') {
26902697
// for keys added through additionalProperties
@@ -2696,8 +2703,11 @@ function getObjectFormRow(args) {
26962703
let isRef = schemaValue.hasOwnProperty('$ref');
26972704
if (isRef) schemaValue = args.getRef(schemaValue['$ref']);
26982705
let type = normalizeKeyword(schemaValue.type);
2699-
if (!schemaValue.title || isRef && schema.additionalProperties) // for additionalProperty refs, use the key as the title
2700-
schemaValue.title = getVerboseName(key);
2706+
2707+
if (!schemaValue.title) {
2708+
if (isAdditionalProperty) schemaValue.title = key;else schemaValue.title = getVerboseName(key);
2709+
}
2710+
27012711
let removable = false;
27022712
if (schema_keys[key] === undefined) removable = true;
27032713

dist/react-json-form.module.js

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1837,6 +1837,12 @@ function GroupTitle(props) {
18371837
title: "Edit"
18381838
}, "Edit")) : props.children);
18391839
}
1840+
function GroupDescription(props) {
1841+
if (!props.children) return null;
1842+
return /*#__PURE__*/React$1.createElement("div", {
1843+
className: "rjf-form-group-description"
1844+
}, props.children);
1845+
}
18401846

18411847
function animate(e, animation, callback) {
18421848
let el = e.target.parentElement.parentElement;
@@ -1927,12 +1933,12 @@ function FormGroup(props) {
19271933
}, props.level === 0 && /*#__PURE__*/React$1.createElement(GroupTitle, {
19281934
editable: props.editable,
19291935
onEdit: props.onEdit
1930-
}, props.schema.title), /*#__PURE__*/React$1.createElement("div", {
1936+
}, props.schema.title), props.level === 0 && /*#__PURE__*/React$1.createElement(GroupDescription, null, props.schema.description), /*#__PURE__*/React$1.createElement("div", {
19311937
className: innerClassName
19321938
}, props.level > 0 && /*#__PURE__*/React$1.createElement(GroupTitle, {
19331939
editable: props.editable,
19341940
onEdit: props.onEdit
1935-
}, props.schema.title), props.children, props.addable && /*#__PURE__*/React$1.createElement(Button, {
1941+
}, props.schema.title), props.level > 0 && /*#__PURE__*/React$1.createElement(GroupDescription, null, props.schema.description), props.children, props.addable && /*#__PURE__*/React$1.createElement(Button, {
19361942
className: "add",
19371943
onClick: e => props.onAdd(),
19381944
title: props.schema.type === 'object' ? 'Add new key' : 'Add new item'
@@ -2685,6 +2691,7 @@ function getObjectFormRow(args) {
26852691
let value = data[key];
26862692
let childName = joinCoords(name, key);
26872693
let schemaValue = schema_keys.hasOwnProperty(key) ? _extends({}, schema_keys[key]) : undefined;
2694+
let isAdditionalProperty = schema_keys.hasOwnProperty(key) ? false : true;
26882695

26892696
if (typeof schemaValue === 'undefined') {
26902697
// for keys added through additionalProperties
@@ -2696,8 +2703,11 @@ function getObjectFormRow(args) {
26962703
let isRef = schemaValue.hasOwnProperty('$ref');
26972704
if (isRef) schemaValue = args.getRef(schemaValue['$ref']);
26982705
let type = normalizeKeyword(schemaValue.type);
2699-
if (!schemaValue.title || isRef && schema.additionalProperties) // for additionalProperty refs, use the key as the title
2700-
schemaValue.title = getVerboseName(key);
2706+
2707+
if (!schemaValue.title) {
2708+
if (isAdditionalProperty) schemaValue.title = key;else schemaValue.title = getVerboseName(key);
2709+
}
2710+
27012711
let removable = false;
27022712
if (schema_keys[key] === undefined) removable = true;
27032713

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

0 commit comments

Comments
 (0)