@jsonforms/core 3.1.1-alpha.0 → 3.2.0-alpha.1

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.
@@ -416,7 +416,12 @@ function __spreadArray(to, from, pack) {
416
416
  }
417
417
  }
418
418
  return to.concat(ar || Array.prototype.slice.call(from));
419
- }
419
+ }
420
+
421
+ typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
422
+ var e = new Error(message);
423
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
424
+ };
420
425
 
421
426
  var cellReducer = function (state, _a) {
422
427
  if (state === void 0) { state = []; }
@@ -1382,7 +1387,7 @@ var compose = function (path1, path2) {
1382
1387
  };
1383
1388
  var toDataPathSegments = function (schemaPath) {
1384
1389
  var s = schemaPath
1385
- .replace(/(anyOf|allOf|oneOf)\/[\d]\//g, '')
1390
+ .replace(/(anyOf|allOf|oneOf)\/[\d]+\//g, '')
1386
1391
  .replace(/(then|else)\//g, '');
1387
1392
  var segments = s.split('/');
1388
1393
  var decodedSegments = segments.map(decode);
@@ -1525,6 +1530,9 @@ var evaluateCondition = function (data, condition, path, ajv) {
1525
1530
  }
1526
1531
  else if (isSchemaCondition(condition)) {
1527
1532
  var value = resolveData(data, getConditionScope(condition, path));
1533
+ if (condition.failWhenUndefined && value === undefined) {
1534
+ return false;
1535
+ }
1528
1536
  return ajv.validate(condition.schema, value);
1529
1537
  }
1530
1538
  else {
@@ -1918,7 +1926,7 @@ var mapDispatchToArrayControlProps = function (dispatch) { return ({
1918
1926
  removeItems: function (path, toDelete) { return function () {
1919
1927
  dispatch(update(path, function (array) {
1920
1928
  toDelete
1921
- .sort()
1929
+ .sort(function (a, b) { return a - b; })
1922
1930
  .reverse()
1923
1931
  .forEach(function (s) { return array.splice(s, 1); });
1924
1932
  return array;
@@ -2157,23 +2165,15 @@ function (dispatch, ownProps) {
2157
2165
  };
2158
2166
  };
2159
2167
 
2160
- var createLabel = function (subSchema, subSchemaIndex, keyword) {
2161
- if (subSchema.title) {
2162
- return subSchema.title;
2163
- }
2164
- else {
2165
- return keyword + '-' + subSchemaIndex;
2166
- }
2167
- };
2168
2168
  var createCombinatorRenderInfos = function (combinatorSubSchemas, rootSchema, keyword, control, path, uischemas) {
2169
2169
  return combinatorSubSchemas.map(function (subSchema, subSchemaIndex) {
2170
- var schema = subSchema.$ref
2171
- ? Resolve.schema(rootSchema, subSchema.$ref, rootSchema)
2172
- : subSchema;
2170
+ var _a, _b;
2171
+ var resolvedSubSchema = subSchema.$ref && Resolve.schema(rootSchema, subSchema.$ref, rootSchema);
2172
+ var schema = resolvedSubSchema !== null && resolvedSubSchema !== void 0 ? resolvedSubSchema : subSchema;
2173
2173
  return {
2174
2174
  schema: schema,
2175
2175
  uischema: findUISchema(uischemas, schema, control.scope, path, undefined, control, rootSchema),
2176
- label: createLabel(subSchema, subSchemaIndex, keyword),
2176
+ label: (_b = (_a = subSchema.title) !== null && _a !== void 0 ? _a : resolvedSubSchema === null || resolvedSubSchema === void 0 ? void 0 : resolvedSubSchema.title) !== null && _b !== void 0 ? _b : keyword + "-" + subSchemaIndex,
2177
2177
  };
2178
2178
  });
2179
2179
  };