@jsonforms/core 3.1.1-alpha.0 → 3.2.0-alpha.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.
@@ -1350,6 +1350,9 @@ const evaluateCondition = (data, condition, path, ajv) => {
1350
1350
  }
1351
1351
  else if (isSchemaCondition(condition)) {
1352
1352
  const value = resolveData(data, getConditionScope(condition, path));
1353
+ if (condition.failWhenUndefined && value === undefined) {
1354
+ return false;
1355
+ }
1353
1356
  return ajv.validate(condition.schema, value);
1354
1357
  }
1355
1358
  else {
@@ -1744,7 +1747,7 @@ const mapDispatchToArrayControlProps = (dispatch) => ({
1744
1747
  removeItems: (path, toDelete) => () => {
1745
1748
  dispatch(update(path, (array) => {
1746
1749
  toDelete
1747
- .sort()
1750
+ .sort((a, b) => a - b)
1748
1751
  .reverse()
1749
1752
  .forEach((s) => array.splice(s, 1));
1750
1753
  return array;
@@ -2011,22 +2014,15 @@ const defaultMapDispatchToControlProps =
2011
2014
  };
2012
2015
  };
2013
2016
 
2014
- const createLabel = (subSchema, subSchemaIndex, keyword) => {
2015
- if (subSchema.title) {
2016
- return subSchema.title;
2017
- }
2018
- else {
2019
- return keyword + '-' + subSchemaIndex;
2020
- }
2021
- };
2022
2017
  const createCombinatorRenderInfos = (combinatorSubSchemas, rootSchema, keyword, control, path, uischemas) => combinatorSubSchemas.map((subSchema, subSchemaIndex) => {
2023
- const schema = subSchema.$ref
2024
- ? Resolve.schema(rootSchema, subSchema.$ref, rootSchema)
2025
- : subSchema;
2018
+ const resolvedSubSchema = subSchema.$ref && Resolve.schema(rootSchema, subSchema.$ref, rootSchema);
2019
+ const schema = resolvedSubSchema ?? subSchema;
2026
2020
  return {
2027
2021
  schema,
2028
2022
  uischema: findUISchema(uischemas, schema, control.scope, path, undefined, control, rootSchema),
2029
- label: createLabel(subSchema, subSchemaIndex, keyword),
2023
+ label: subSchema.title ??
2024
+ resolvedSubSchema?.title ??
2025
+ `${keyword}-${subSchemaIndex}`,
2030
2026
  };
2031
2027
  });
2032
2028