@jsonforms/core 3.1.0-alpha.2 → 3.1.0-alpha.3
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/lib/jsonforms-core.cjs.js +11 -6
- package/lib/jsonforms-core.cjs.js.map +1 -1
- package/lib/jsonforms-core.esm.js +9 -5
- package/lib/jsonforms-core.esm.js.map +1 -1
- package/lib/util/schema.d.ts +5 -0
- package/package.json +2 -2
- package/src/reducers/core.ts +8 -3
- package/src/testers/testers.ts +8 -7
- package/src/util/schema.ts +9 -0
|
@@ -659,7 +659,8 @@ var errorsAt = function (instancePath, schema, matchPath) {
|
|
|
659
659
|
return function (errors) {
|
|
660
660
|
var combinatorPaths = filter__default["default"](errors, function (error) { return error.keyword === 'oneOf' || error.keyword === 'anyOf'; }).map(function (error) { return getControlPath(error); });
|
|
661
661
|
return filter__default["default"](errors, function (error) {
|
|
662
|
-
if (filteredErrorKeywords.indexOf(error.keyword) !== -1
|
|
662
|
+
if (filteredErrorKeywords.indexOf(error.keyword) !== -1 &&
|
|
663
|
+
!isOneOfEnumSchema(error.parentSchema)) {
|
|
663
664
|
return false;
|
|
664
665
|
}
|
|
665
666
|
var controlPath = getControlPath(error);
|
|
@@ -667,6 +668,7 @@ var errorsAt = function (instancePath, schema, matchPath) {
|
|
|
667
668
|
var parentSchema = error.parentSchema;
|
|
668
669
|
if (result &&
|
|
669
670
|
!isObjectSchema$1(parentSchema) &&
|
|
671
|
+
!isOneOfEnumSchema(parentSchema) &&
|
|
670
672
|
combinatorPaths.findIndex(function (p) { return instancePath.startsWith(p); }) !== -1) {
|
|
671
673
|
result = result && isEqual__default["default"](parentSchema, schema);
|
|
672
674
|
}
|
|
@@ -1038,10 +1040,7 @@ var isAllOfControl = and(uiTypeIs('Control'), schemaMatches(function (schema) {
|
|
|
1038
1040
|
var isAnyOfControl = and(uiTypeIs('Control'), schemaMatches(function (schema) { return schema.hasOwnProperty('anyOf'); }));
|
|
1039
1041
|
var isOneOfControl = and(uiTypeIs('Control'), schemaMatches(function (schema) { return schema.hasOwnProperty('oneOf'); }));
|
|
1040
1042
|
var isEnumControl = and(uiTypeIs('Control'), or(schemaMatches(function (schema) { return schema.hasOwnProperty('enum'); }), schemaMatches(function (schema) { return schema.hasOwnProperty('const'); })));
|
|
1041
|
-
var isOneOfEnumControl = and(uiTypeIs('Control'), schemaMatches(function (schema) {
|
|
1042
|
-
return schema.hasOwnProperty('oneOf') &&
|
|
1043
|
-
schema.oneOf.every(function (s) { return s.const !== undefined; });
|
|
1044
|
-
}));
|
|
1043
|
+
var isOneOfEnumControl = and(uiTypeIs('Control'), schemaMatches(function (schema) { return isOneOfEnumSchema(schema); }));
|
|
1045
1044
|
var isIntegerControl = and(uiTypeIs('Control'), schemaTypeIs('integer'));
|
|
1046
1045
|
var isNumberControl = and(uiTypeIs('Control'), schemaTypeIs('number'));
|
|
1047
1046
|
var isStringControl = and(uiTypeIs('Control'), schemaTypeIs('string'));
|
|
@@ -1103,7 +1102,7 @@ var isObjectArrayWithNesting = function (uischema, schema, context) {
|
|
|
1103
1102
|
if (val.anyOf || val.allOf) {
|
|
1104
1103
|
return true;
|
|
1105
1104
|
}
|
|
1106
|
-
if (val.oneOf && !
|
|
1105
|
+
if (val.oneOf && !isOneOfEnumSchema(val)) {
|
|
1107
1106
|
return true;
|
|
1108
1107
|
}
|
|
1109
1108
|
if (hasType(val, 'object')) {
|
|
@@ -2164,6 +2163,11 @@ var getFirstPrimitiveProp = function (schema) {
|
|
|
2164
2163
|
}
|
|
2165
2164
|
return undefined;
|
|
2166
2165
|
};
|
|
2166
|
+
var isOneOfEnumSchema = function (schema) {
|
|
2167
|
+
return (schema === null || schema === void 0 ? void 0 : schema.hasOwnProperty('oneOf')) &&
|
|
2168
|
+
(schema === null || schema === void 0 ? void 0 : schema.oneOf) &&
|
|
2169
|
+
schema.oneOf.every(function (s) { return s.const !== undefined; });
|
|
2170
|
+
};
|
|
2167
2171
|
|
|
2168
2172
|
var setReadonlyPropertyValue = function (value) {
|
|
2169
2173
|
return function (child) {
|
|
@@ -2609,6 +2613,7 @@ exports.isObjectArrayWithNesting = isObjectArrayWithNesting;
|
|
|
2609
2613
|
exports.isObjectControl = isObjectControl;
|
|
2610
2614
|
exports.isOneOfControl = isOneOfControl;
|
|
2611
2615
|
exports.isOneOfEnumControl = isOneOfEnumControl;
|
|
2616
|
+
exports.isOneOfEnumSchema = isOneOfEnumSchema;
|
|
2612
2617
|
exports.isPrimitiveArrayControl = isPrimitiveArrayControl;
|
|
2613
2618
|
exports.isRangeControl = isRangeControl;
|
|
2614
2619
|
exports.isScopable = isScopable;
|