@jsonforms/core 3.0.0-rc.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/docs/assets/js/search.json +1 -1
- package/docs/globals.html +14 -14
- package/docs/interfaces/arraylayoutprops.html +2 -2
- package/docs/interfaces/categorization.html +18 -0
- package/docs/interfaces/category.html +18 -0
- package/docs/interfaces/grouplayout.html +18 -0
- package/docs/interfaces/internationalizable.html +9 -0
- package/docs/interfaces/labelprops.html +1 -1
- package/docs/interfaces/statepropsofarraylayout.html +2 -2
- package/docs/interfaces/statepropsoflabel.html +1 -1
- package/lib/jsonforms-core.cjs.js +13 -5
- package/lib/jsonforms-core.cjs.js.map +1 -1
- package/lib/jsonforms-core.esm.js +12 -4
- package/lib/jsonforms-core.esm.js.map +1 -1
- package/lib/models/uischema.d.ts +3 -3
- package/package.json +2 -2
- package/src/models/uischema.ts +5 -5
- package/src/testers/testers.ts +3 -0
- package/src/util/renderer.ts +9 -3
- package/stats.html +1 -1
- package/test/testers.test.ts +55 -0
|
@@ -295,9 +295,9 @@ var RuleEffect;
|
|
|
295
295
|
const isInternationalized = (element) => typeof element === 'object' && element !== null && typeof element.i18n === 'string';
|
|
296
296
|
const isGroup = (layout) => layout.type === 'Group';
|
|
297
297
|
const isLayout = (uischema) => uischema.elements !== undefined;
|
|
298
|
-
const isScopable = (obj) => obj && typeof obj === 'object';
|
|
298
|
+
const isScopable = (obj) => !!obj && typeof obj === 'object';
|
|
299
299
|
const isScoped = (obj) => isScopable(obj) && typeof obj.scope === 'string';
|
|
300
|
-
const isLabelable = (obj) => obj && typeof obj === 'object';
|
|
300
|
+
const isLabelable = (obj) => !!obj && typeof obj === 'object';
|
|
301
301
|
const isLabeled = (obj) => isLabelable(obj) && ['string', 'boolean'].includes(typeof obj.label);
|
|
302
302
|
|
|
303
303
|
const move = (array, index, delta) => {
|
|
@@ -905,6 +905,9 @@ const isObjectArrayWithNesting = (uischema, schema, context) => {
|
|
|
905
905
|
if (val.$ref !== undefined) {
|
|
906
906
|
return false;
|
|
907
907
|
}
|
|
908
|
+
if (val.anyOf || val.oneOf) {
|
|
909
|
+
return true;
|
|
910
|
+
}
|
|
908
911
|
if (hasType(val, 'object')) {
|
|
909
912
|
objectDepth++;
|
|
910
913
|
if (objectDepth === 2) {
|
|
@@ -1699,7 +1702,7 @@ const controlDefaultProps = {
|
|
|
1699
1702
|
errors: []
|
|
1700
1703
|
};
|
|
1701
1704
|
const mapStateToCombinatorRendererProps = (state, ownProps, keyword) => {
|
|
1702
|
-
const { data, schema, ...props } = mapStateToControlProps(state, ownProps);
|
|
1705
|
+
const { data, schema, rootSchema, ...props } = mapStateToControlProps(state, ownProps);
|
|
1703
1706
|
const ajv = state.jsonforms.core.ajv;
|
|
1704
1707
|
const structuralKeywords = [
|
|
1705
1708
|
'required',
|
|
@@ -1716,7 +1719,11 @@ const mapStateToCombinatorRendererProps = (state, ownProps, keyword) => {
|
|
|
1716
1719
|
let indexOfFittingSchema;
|
|
1717
1720
|
for (let i = 0; i < schema[keyword]?.length; i++) {
|
|
1718
1721
|
try {
|
|
1719
|
-
|
|
1722
|
+
let _schema = schema[keyword][i];
|
|
1723
|
+
if (_schema.$ref) {
|
|
1724
|
+
_schema = Resolve.schema(rootSchema, _schema.$ref, rootSchema);
|
|
1725
|
+
}
|
|
1726
|
+
const valFn = ajv.compile(_schema);
|
|
1720
1727
|
valFn(data);
|
|
1721
1728
|
if (dataIsValid(valFn.errors)) {
|
|
1722
1729
|
indexOfFittingSchema = i;
|
|
@@ -1730,6 +1737,7 @@ const mapStateToCombinatorRendererProps = (state, ownProps, keyword) => {
|
|
|
1730
1737
|
return {
|
|
1731
1738
|
data,
|
|
1732
1739
|
schema,
|
|
1740
|
+
rootSchema,
|
|
1733
1741
|
...props,
|
|
1734
1742
|
indexOfFittingSchema,
|
|
1735
1743
|
uischemas: getUISchemas(state)
|