@rjsf/utils 5.22.3 → 5.23.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/dist/index.js +175 -59
- package/dist/index.js.map +2 -2
- package/dist/utils.esm.js +175 -59
- package/dist/utils.esm.js.map +2 -2
- package/dist/utils.umd.js +187 -63
- package/lib/ErrorSchemaBuilder.js +3 -3
- package/lib/ErrorSchemaBuilder.js.map +1 -1
- package/lib/createSchemaUtils.js +7 -7
- package/lib/createSchemaUtils.js.map +1 -1
- package/lib/schema/getClosestMatchingOption.d.ts +5 -3
- package/lib/schema/getClosestMatchingOption.js +11 -7
- package/lib/schema/getClosestMatchingOption.js.map +1 -1
- package/lib/schema/getDefaultFormState.d.ts +1 -1
- package/lib/schema/getDefaultFormState.js +40 -16
- package/lib/schema/getDefaultFormState.js.map +1 -1
- package/lib/schema/getDisplayLabel.d.ts +3 -2
- package/lib/schema/getDisplayLabel.js +4 -3
- package/lib/schema/getDisplayLabel.js.map +1 -1
- package/lib/schema/isFilesArray.d.ts +3 -2
- package/lib/schema/isFilesArray.js +3 -2
- package/lib/schema/isFilesArray.js.map +1 -1
- package/lib/schema/isMultiSelect.d.ts +3 -2
- package/lib/schema/isMultiSelect.js +3 -2
- package/lib/schema/isMultiSelect.js.map +1 -1
- package/lib/schema/isSelect.d.ts +3 -2
- package/lib/schema/isSelect.js +3 -2
- package/lib/schema/isSelect.js.map +1 -1
- package/lib/schema/retrieveSchema.d.ts +2 -1
- package/lib/schema/retrieveSchema.js +5 -4
- package/lib/schema/retrieveSchema.js.map +1 -1
- package/lib/schema/sanitizeDataForNewSchema.d.ts +3 -2
- package/lib/schema/sanitizeDataForNewSchema.js +8 -7
- package/lib/schema/sanitizeDataForNewSchema.js.map +1 -1
- package/lib/schema/toIdSchema.js +1 -1
- package/lib/schema/toIdSchema.js.map +1 -1
- package/lib/schema/toPathSchema.d.ts +3 -2
- package/lib/schema/toPathSchema.js +13 -11
- package/lib/schema/toPathSchema.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types.d.ts +12 -0
- package/package.json +2 -2
- package/src/ErrorSchemaBuilder.ts +3 -3
- package/src/createSchemaUtils.ts +29 -7
- package/src/schema/getClosestMatchingOption.ts +31 -8
- package/src/schema/getDefaultFormState.ts +48 -15
- package/src/schema/getDisplayLabel.ts +6 -3
- package/src/schema/isFilesArray.ts +18 -3
- package/src/schema/isMultiSelect.ts +9 -3
- package/src/schema/isSelect.ts +5 -3
- package/src/schema/retrieveSchema.ts +19 -4
- package/src/schema/sanitizeDataForNewSchema.ts +49 -8
- package/src/schema/toIdSchema.ts +1 -1
- package/src/schema/toPathSchema.ts +45 -12
- package/src/types.ts +12 -0
package/dist/utils.umd.js
CHANGED
|
@@ -513,7 +513,7 @@
|
|
|
513
513
|
}
|
|
514
514
|
return isEqual4(schema, resolvedSchema) ? schema : resolvedSchema;
|
|
515
515
|
}
|
|
516
|
-
function stubExistingAdditionalProperties(validator, theSchema, rootSchema, aFormData) {
|
|
516
|
+
function stubExistingAdditionalProperties(validator, theSchema, rootSchema, aFormData, experimental_customMergeAllOf) {
|
|
517
517
|
const schema = {
|
|
518
518
|
...theSchema,
|
|
519
519
|
properties: { ...theSchema.properties }
|
|
@@ -530,7 +530,8 @@
|
|
|
530
530
|
validator,
|
|
531
531
|
{ $ref: get8(schema.additionalProperties, [REF_KEY]) },
|
|
532
532
|
rootSchema,
|
|
533
|
-
formData
|
|
533
|
+
formData,
|
|
534
|
+
experimental_customMergeAllOf
|
|
534
535
|
);
|
|
535
536
|
} else if ("type" in schema.additionalProperties) {
|
|
536
537
|
additionalProperties = { ...schema.additionalProperties };
|
|
@@ -560,7 +561,8 @@
|
|
|
560
561
|
rootSchema,
|
|
561
562
|
expandAllBranches,
|
|
562
563
|
recurseList,
|
|
563
|
-
rawFormData
|
|
564
|
+
rawFormData,
|
|
565
|
+
experimental_customMergeAllOf
|
|
564
566
|
);
|
|
565
567
|
return resolvedSchemas.flatMap((s) => {
|
|
566
568
|
let resolvedSchema = s;
|
|
@@ -607,7 +609,13 @@
|
|
|
607
609
|
}
|
|
608
610
|
const hasAdditionalProperties = ADDITIONAL_PROPERTIES_KEY in resolvedSchema && resolvedSchema.additionalProperties !== false;
|
|
609
611
|
if (hasAdditionalProperties) {
|
|
610
|
-
return stubExistingAdditionalProperties(
|
|
612
|
+
return stubExistingAdditionalProperties(
|
|
613
|
+
validator,
|
|
614
|
+
resolvedSchema,
|
|
615
|
+
rootSchema,
|
|
616
|
+
rawFormData,
|
|
617
|
+
experimental_customMergeAllOf
|
|
618
|
+
);
|
|
611
619
|
}
|
|
612
620
|
return resolvedSchema;
|
|
613
621
|
});
|
|
@@ -792,7 +800,7 @@
|
|
|
792
800
|
}
|
|
793
801
|
}
|
|
794
802
|
};
|
|
795
|
-
function calculateIndexScore(validator, rootSchema, schema, formData) {
|
|
803
|
+
function calculateIndexScore(validator, rootSchema, schema, formData, experimental_customMergeAllOf) {
|
|
796
804
|
let totalScore = 0;
|
|
797
805
|
if (schema) {
|
|
798
806
|
if (isObject2(schema.properties)) {
|
|
@@ -804,8 +812,20 @@
|
|
|
804
812
|
return score;
|
|
805
813
|
}
|
|
806
814
|
if (has3(value, REF_KEY)) {
|
|
807
|
-
const newSchema = retrieveSchema(
|
|
808
|
-
|
|
815
|
+
const newSchema = retrieveSchema(
|
|
816
|
+
validator,
|
|
817
|
+
value,
|
|
818
|
+
rootSchema,
|
|
819
|
+
formValue,
|
|
820
|
+
experimental_customMergeAllOf
|
|
821
|
+
);
|
|
822
|
+
return score + calculateIndexScore(
|
|
823
|
+
validator,
|
|
824
|
+
rootSchema,
|
|
825
|
+
newSchema,
|
|
826
|
+
formValue || {},
|
|
827
|
+
experimental_customMergeAllOf
|
|
828
|
+
);
|
|
809
829
|
}
|
|
810
830
|
if ((has3(value, ONE_OF_KEY) || has3(value, ANY_OF_KEY)) && formValue) {
|
|
811
831
|
const key2 = has3(value, ONE_OF_KEY) ? ONE_OF_KEY : ANY_OF_KEY;
|
|
@@ -816,14 +836,15 @@
|
|
|
816
836
|
formValue,
|
|
817
837
|
get8(value, key2),
|
|
818
838
|
-1,
|
|
819
|
-
discriminator
|
|
839
|
+
discriminator,
|
|
840
|
+
experimental_customMergeAllOf
|
|
820
841
|
);
|
|
821
842
|
}
|
|
822
843
|
if (value.type === "object") {
|
|
823
844
|
if (isObject2(formValue)) {
|
|
824
845
|
score += 1;
|
|
825
846
|
}
|
|
826
|
-
return score + calculateIndexScore(validator, rootSchema, value, formValue);
|
|
847
|
+
return score + calculateIndexScore(validator, rootSchema, value, formValue, experimental_customMergeAllOf);
|
|
827
848
|
}
|
|
828
849
|
if (value.type === guessType(formValue)) {
|
|
829
850
|
let newScore = score + 1;
|
|
@@ -844,7 +865,7 @@
|
|
|
844
865
|
}
|
|
845
866
|
return totalScore;
|
|
846
867
|
}
|
|
847
|
-
function getClosestMatchingOption(validator, rootSchema, formData, options, selectedOption = -1, discriminatorField) {
|
|
868
|
+
function getClosestMatchingOption(validator, rootSchema, formData, options, selectedOption = -1, discriminatorField, experimental_customMergeAllOf) {
|
|
848
869
|
const resolvedOptions = options.map((option) => {
|
|
849
870
|
return resolveAllReferences(option, rootSchema, []);
|
|
850
871
|
});
|
|
@@ -871,7 +892,7 @@
|
|
|
871
892
|
(scoreData, index) => {
|
|
872
893
|
const { bestScore } = scoreData;
|
|
873
894
|
const option = resolvedOptions[index];
|
|
874
|
-
const score = calculateIndexScore(validator, rootSchema, option, formData);
|
|
895
|
+
const score = calculateIndexScore(validator, rootSchema, option, formData, experimental_customMergeAllOf);
|
|
875
896
|
scoreCount.add(score);
|
|
876
897
|
if (score > bestScore) {
|
|
877
898
|
return { bestIndex: index, bestScore: score };
|
|
@@ -957,8 +978,8 @@
|
|
|
957
978
|
}
|
|
958
979
|
|
|
959
980
|
// src/schema/isSelect.ts
|
|
960
|
-
function isSelect(validator, theSchema, rootSchema = {}) {
|
|
961
|
-
const schema = retrieveSchema(validator, theSchema, rootSchema, void 0);
|
|
981
|
+
function isSelect(validator, theSchema, rootSchema = {}, experimental_customMergeAllOf) {
|
|
982
|
+
const schema = retrieveSchema(validator, theSchema, rootSchema, void 0, experimental_customMergeAllOf);
|
|
962
983
|
const altSchemas = schema.oneOf || schema.anyOf;
|
|
963
984
|
if (Array.isArray(schema.enum)) {
|
|
964
985
|
return true;
|
|
@@ -970,14 +991,15 @@
|
|
|
970
991
|
}
|
|
971
992
|
|
|
972
993
|
// src/schema/isMultiSelect.ts
|
|
973
|
-
function isMultiSelect(validator, schema, rootSchema) {
|
|
994
|
+
function isMultiSelect(validator, schema, rootSchema, experimental_customMergeAllOf) {
|
|
974
995
|
if (!schema.uniqueItems || !schema.items || typeof schema.items === "boolean") {
|
|
975
996
|
return false;
|
|
976
997
|
}
|
|
977
|
-
return isSelect(validator, schema.items, rootSchema);
|
|
998
|
+
return isSelect(validator, schema.items, rootSchema, experimental_customMergeAllOf);
|
|
978
999
|
}
|
|
979
1000
|
|
|
980
1001
|
// src/schema/getDefaultFormState.ts
|
|
1002
|
+
var PRIMITIVE_TYPES = ["string", "number", "integer", "boolean", "null"];
|
|
981
1003
|
function getInnerSchemaForArrayItem(schema, additionalItems = 0 /* Ignore */, idx = -1) {
|
|
982
1004
|
if (idx >= 0) {
|
|
983
1005
|
if (Array.isArray(schema.items) && idx < schema.items.length) {
|
|
@@ -1033,8 +1055,9 @@
|
|
|
1033
1055
|
const schema = isObject(rawSchema) ? rawSchema : {};
|
|
1034
1056
|
let defaults = parentDefaults;
|
|
1035
1057
|
let schemaToCompute = null;
|
|
1058
|
+
let experimental_dfsb_to_compute = experimental_defaultFormStateBehavior;
|
|
1036
1059
|
let updatedRecurseList = _recurseList;
|
|
1037
|
-
if (
|
|
1060
|
+
if (schema[CONST_KEY] && experimental_defaultFormStateBehavior?.constAsDefaults !== "never") {
|
|
1038
1061
|
defaults = schema.const;
|
|
1039
1062
|
} else if (isObject(defaults) && isObject(schema.default)) {
|
|
1040
1063
|
defaults = mergeObjects(defaults, schema.default);
|
|
@@ -1068,6 +1091,7 @@
|
|
|
1068
1091
|
includeUndefinedValues,
|
|
1069
1092
|
_recurseList,
|
|
1070
1093
|
experimental_defaultFormStateBehavior,
|
|
1094
|
+
experimental_customMergeAllOf,
|
|
1071
1095
|
parentDefaults: Array.isArray(parentDefaults) ? parentDefaults[idx] : void 0,
|
|
1072
1096
|
rawFormData: formData,
|
|
1073
1097
|
required
|
|
@@ -1079,13 +1103,18 @@
|
|
|
1079
1103
|
return void 0;
|
|
1080
1104
|
}
|
|
1081
1105
|
const discriminator = getDiscriminatorFieldFromSchema(schema);
|
|
1106
|
+
const { type = "null" } = remaining;
|
|
1107
|
+
if (!Array.isArray(type) && PRIMITIVE_TYPES.includes(type) && experimental_dfsb_to_compute?.constAsDefaults === "skipOneOf") {
|
|
1108
|
+
experimental_dfsb_to_compute = { ...experimental_dfsb_to_compute, constAsDefaults: "never" };
|
|
1109
|
+
}
|
|
1082
1110
|
schemaToCompute = oneOf[getClosestMatchingOption(
|
|
1083
1111
|
validator,
|
|
1084
1112
|
rootSchema,
|
|
1085
1113
|
isEmpty(formData) ? void 0 : formData,
|
|
1086
1114
|
oneOf,
|
|
1087
1115
|
0,
|
|
1088
|
-
discriminator
|
|
1116
|
+
discriminator,
|
|
1117
|
+
experimental_customMergeAllOf
|
|
1089
1118
|
)];
|
|
1090
1119
|
schemaToCompute = mergeSchemas(remaining, schemaToCompute);
|
|
1091
1120
|
} else if (ANY_OF_KEY in schema) {
|
|
@@ -1100,7 +1129,8 @@
|
|
|
1100
1129
|
isEmpty(formData) ? void 0 : formData,
|
|
1101
1130
|
anyOf,
|
|
1102
1131
|
0,
|
|
1103
|
-
discriminator
|
|
1132
|
+
discriminator,
|
|
1133
|
+
experimental_customMergeAllOf
|
|
1104
1134
|
)];
|
|
1105
1135
|
schemaToCompute = mergeSchemas(remaining, schemaToCompute);
|
|
1106
1136
|
}
|
|
@@ -1109,7 +1139,8 @@
|
|
|
1109
1139
|
rootSchema,
|
|
1110
1140
|
includeUndefinedValues,
|
|
1111
1141
|
_recurseList: updatedRecurseList,
|
|
1112
|
-
experimental_defaultFormStateBehavior,
|
|
1142
|
+
experimental_defaultFormStateBehavior: experimental_dfsb_to_compute,
|
|
1143
|
+
experimental_customMergeAllOf,
|
|
1113
1144
|
parentDefaults: defaults,
|
|
1114
1145
|
rawFormData: formData,
|
|
1115
1146
|
required
|
|
@@ -1139,7 +1170,7 @@
|
|
|
1139
1170
|
(acc, key) => {
|
|
1140
1171
|
const propertySchema = get8(retrievedSchema, [PROPERTIES_KEY, key]);
|
|
1141
1172
|
const hasParentConst = isObject(parentConst) && parentConst[key] !== void 0;
|
|
1142
|
-
const hasConst = isObject(propertySchema) && CONST_KEY in propertySchema || hasParentConst;
|
|
1173
|
+
const hasConst = (isObject(propertySchema) && CONST_KEY in propertySchema || hasParentConst) && experimental_defaultFormStateBehavior?.constAsDefaults !== "never";
|
|
1143
1174
|
const computedDefault = computeDefaults(validator, propertySchema, {
|
|
1144
1175
|
rootSchema,
|
|
1145
1176
|
_recurseList,
|
|
@@ -1180,6 +1211,7 @@
|
|
|
1180
1211
|
rootSchema,
|
|
1181
1212
|
_recurseList,
|
|
1182
1213
|
experimental_defaultFormStateBehavior,
|
|
1214
|
+
experimental_customMergeAllOf,
|
|
1183
1215
|
includeUndefinedValues: includeUndefinedValues === true,
|
|
1184
1216
|
parentDefaults: get8(defaults, [key]),
|
|
1185
1217
|
rawFormData: get8(formData, [key]),
|
|
@@ -1203,13 +1235,17 @@
|
|
|
1203
1235
|
rootSchema = {},
|
|
1204
1236
|
_recurseList = [],
|
|
1205
1237
|
experimental_defaultFormStateBehavior = void 0,
|
|
1238
|
+
experimental_customMergeAllOf = void 0,
|
|
1206
1239
|
required
|
|
1207
1240
|
} = {}, defaults) {
|
|
1208
1241
|
const schema = rawSchema;
|
|
1209
|
-
const
|
|
1210
|
-
const
|
|
1242
|
+
const arrayMinItemsStateBehavior = experimental_defaultFormStateBehavior?.arrayMinItems ?? {};
|
|
1243
|
+
const { populate: arrayMinItemsPopulate, mergeExtraDefaults: arrayMergeExtraDefaults } = arrayMinItemsStateBehavior;
|
|
1244
|
+
const neverPopulate = arrayMinItemsPopulate === "never";
|
|
1245
|
+
const ignoreMinItemsFlagSet = arrayMinItemsPopulate === "requiredOnly";
|
|
1246
|
+
const isPopulateAll = arrayMinItemsPopulate === "all" || !neverPopulate && !ignoreMinItemsFlagSet;
|
|
1247
|
+
const computeSkipPopulate = arrayMinItemsStateBehavior?.computeSkipPopulate ?? (() => false);
|
|
1211
1248
|
const isSkipEmptyDefaults = experimental_defaultFormStateBehavior?.emptyObjectFields === "skipEmptyDefaults";
|
|
1212
|
-
const computeSkipPopulate = experimental_defaultFormStateBehavior?.arrayMinItems?.computeSkipPopulate ?? (() => false);
|
|
1213
1249
|
const emptyDefault = isSkipEmptyDefaults ? void 0 : [];
|
|
1214
1250
|
if (Array.isArray(defaults)) {
|
|
1215
1251
|
defaults = defaults.map((item, idx) => {
|
|
@@ -1218,6 +1254,7 @@
|
|
|
1218
1254
|
rootSchema,
|
|
1219
1255
|
_recurseList,
|
|
1220
1256
|
experimental_defaultFormStateBehavior,
|
|
1257
|
+
experimental_customMergeAllOf,
|
|
1221
1258
|
parentDefaults: item,
|
|
1222
1259
|
required
|
|
1223
1260
|
});
|
|
@@ -1228,19 +1265,22 @@
|
|
|
1228
1265
|
if (neverPopulate) {
|
|
1229
1266
|
defaults = rawFormData;
|
|
1230
1267
|
} else {
|
|
1231
|
-
|
|
1268
|
+
const itemDefaults = rawFormData.map((item, idx) => {
|
|
1232
1269
|
return computeDefaults(validator, schemaItem, {
|
|
1233
1270
|
rootSchema,
|
|
1234
1271
|
_recurseList,
|
|
1235
1272
|
experimental_defaultFormStateBehavior,
|
|
1273
|
+
experimental_customMergeAllOf,
|
|
1236
1274
|
rawFormData: item,
|
|
1237
1275
|
parentDefaults: get8(defaults, [idx]),
|
|
1238
1276
|
required
|
|
1239
1277
|
});
|
|
1240
1278
|
});
|
|
1279
|
+
const mergeExtraDefaults = (ignoreMinItemsFlagSet && required || isPopulateAll) && arrayMergeExtraDefaults;
|
|
1280
|
+
defaults = mergeDefaultsWithFormData(defaults, itemDefaults, mergeExtraDefaults);
|
|
1241
1281
|
}
|
|
1242
1282
|
}
|
|
1243
|
-
const hasConst = isObject(schema) && CONST_KEY in schema;
|
|
1283
|
+
const hasConst = isObject(schema) && CONST_KEY in schema && experimental_defaultFormStateBehavior?.constAsDefaults !== "never";
|
|
1244
1284
|
if (hasConst === false) {
|
|
1245
1285
|
if (neverPopulate) {
|
|
1246
1286
|
return defaults ?? emptyDefault;
|
|
@@ -1250,7 +1290,7 @@
|
|
|
1250
1290
|
}
|
|
1251
1291
|
}
|
|
1252
1292
|
const defaultsLength = Array.isArray(defaults) ? defaults.length : 0;
|
|
1253
|
-
if (!schema.minItems || isMultiSelect(validator, schema, rootSchema) || computeSkipPopulate(validator, schema, rootSchema) || schema.minItems <= defaultsLength) {
|
|
1293
|
+
if (!schema.minItems || isMultiSelect(validator, schema, rootSchema, experimental_customMergeAllOf) || computeSkipPopulate(validator, schema, rootSchema) || schema.minItems <= defaultsLength) {
|
|
1254
1294
|
return defaults ? defaults : emptyDefault;
|
|
1255
1295
|
}
|
|
1256
1296
|
const defaultEntries = defaults || [];
|
|
@@ -1262,6 +1302,7 @@
|
|
|
1262
1302
|
rootSchema,
|
|
1263
1303
|
_recurseList,
|
|
1264
1304
|
experimental_defaultFormStateBehavior,
|
|
1305
|
+
experimental_customMergeAllOf,
|
|
1265
1306
|
required
|
|
1266
1307
|
})
|
|
1267
1308
|
);
|
|
@@ -1314,25 +1355,31 @@
|
|
|
1314
1355
|
}
|
|
1315
1356
|
|
|
1316
1357
|
// src/schema/isFilesArray.ts
|
|
1317
|
-
function isFilesArray(validator, schema, uiSchema = {}, rootSchema) {
|
|
1358
|
+
function isFilesArray(validator, schema, uiSchema = {}, rootSchema, experimental_customMergeAllOf) {
|
|
1318
1359
|
if (uiSchema[UI_WIDGET_KEY] === "files") {
|
|
1319
1360
|
return true;
|
|
1320
1361
|
}
|
|
1321
1362
|
if (schema.items) {
|
|
1322
|
-
const itemsSchema = retrieveSchema(
|
|
1363
|
+
const itemsSchema = retrieveSchema(
|
|
1364
|
+
validator,
|
|
1365
|
+
schema.items,
|
|
1366
|
+
rootSchema,
|
|
1367
|
+
void 0,
|
|
1368
|
+
experimental_customMergeAllOf
|
|
1369
|
+
);
|
|
1323
1370
|
return itemsSchema.type === "string" && itemsSchema.format === "data-url";
|
|
1324
1371
|
}
|
|
1325
1372
|
return false;
|
|
1326
1373
|
}
|
|
1327
1374
|
|
|
1328
1375
|
// src/schema/getDisplayLabel.ts
|
|
1329
|
-
function getDisplayLabel(validator, schema, uiSchema = {}, rootSchema, globalOptions) {
|
|
1376
|
+
function getDisplayLabel(validator, schema, uiSchema = {}, rootSchema, globalOptions, experimental_customMergeAllOf) {
|
|
1330
1377
|
const uiOptions = getUiOptions(uiSchema, globalOptions);
|
|
1331
1378
|
const { label = true } = uiOptions;
|
|
1332
1379
|
let displayLabel = !!label;
|
|
1333
1380
|
const schemaType = getSchemaType(schema);
|
|
1334
1381
|
if (schemaType === "array") {
|
|
1335
|
-
displayLabel = isMultiSelect(validator, schema, rootSchema) || isFilesArray(validator, schema, uiSchema, rootSchema) || isCustomWidget(uiSchema);
|
|
1382
|
+
displayLabel = isMultiSelect(validator, schema, rootSchema, experimental_customMergeAllOf) || isFilesArray(validator, schema, uiSchema, rootSchema, experimental_customMergeAllOf) || isCustomWidget(uiSchema);
|
|
1336
1383
|
}
|
|
1337
1384
|
if (schemaType === "object") {
|
|
1338
1385
|
displayLabel = false;
|
|
@@ -1359,7 +1406,7 @@
|
|
|
1359
1406
|
return { errorSchema, errors };
|
|
1360
1407
|
}
|
|
1361
1408
|
var NO_VALUE = Symbol("no Value");
|
|
1362
|
-
function sanitizeDataForNewSchema(validator, rootSchema, newSchema, oldSchema, data = {}) {
|
|
1409
|
+
function sanitizeDataForNewSchema(validator, rootSchema, newSchema, oldSchema, data = {}, experimental_customMergeAllOf) {
|
|
1363
1410
|
let newFormData;
|
|
1364
1411
|
if (has3(newSchema, PROPERTIES_KEY)) {
|
|
1365
1412
|
const removeOldSchemaData = {};
|
|
@@ -1378,10 +1425,22 @@
|
|
|
1378
1425
|
let oldKeyedSchema = get8(oldSchema, [PROPERTIES_KEY, key], {});
|
|
1379
1426
|
let newKeyedSchema = get8(newSchema, [PROPERTIES_KEY, key], {});
|
|
1380
1427
|
if (has3(oldKeyedSchema, REF_KEY)) {
|
|
1381
|
-
oldKeyedSchema = retrieveSchema(
|
|
1428
|
+
oldKeyedSchema = retrieveSchema(
|
|
1429
|
+
validator,
|
|
1430
|
+
oldKeyedSchema,
|
|
1431
|
+
rootSchema,
|
|
1432
|
+
formValue,
|
|
1433
|
+
experimental_customMergeAllOf
|
|
1434
|
+
);
|
|
1382
1435
|
}
|
|
1383
1436
|
if (has3(newKeyedSchema, REF_KEY)) {
|
|
1384
|
-
newKeyedSchema = retrieveSchema(
|
|
1437
|
+
newKeyedSchema = retrieveSchema(
|
|
1438
|
+
validator,
|
|
1439
|
+
newKeyedSchema,
|
|
1440
|
+
rootSchema,
|
|
1441
|
+
formValue,
|
|
1442
|
+
experimental_customMergeAllOf
|
|
1443
|
+
);
|
|
1385
1444
|
}
|
|
1386
1445
|
const oldSchemaTypeForKey = get8(oldKeyedSchema, "type");
|
|
1387
1446
|
const newSchemaTypeForKey = get8(newKeyedSchema, "type");
|
|
@@ -1395,7 +1454,8 @@
|
|
|
1395
1454
|
rootSchema,
|
|
1396
1455
|
newKeyedSchema,
|
|
1397
1456
|
oldKeyedSchema,
|
|
1398
|
-
formValue
|
|
1457
|
+
formValue,
|
|
1458
|
+
experimental_customMergeAllOf
|
|
1399
1459
|
);
|
|
1400
1460
|
if (itemData !== void 0 || newSchemaTypeForKey === "array") {
|
|
1401
1461
|
nestedData[key] = itemData;
|
|
@@ -1428,10 +1488,22 @@
|
|
|
1428
1488
|
let newSchemaItems = get8(newSchema, "items");
|
|
1429
1489
|
if (typeof oldSchemaItems === "object" && typeof newSchemaItems === "object" && !Array.isArray(oldSchemaItems) && !Array.isArray(newSchemaItems)) {
|
|
1430
1490
|
if (has3(oldSchemaItems, REF_KEY)) {
|
|
1431
|
-
oldSchemaItems = retrieveSchema(
|
|
1491
|
+
oldSchemaItems = retrieveSchema(
|
|
1492
|
+
validator,
|
|
1493
|
+
oldSchemaItems,
|
|
1494
|
+
rootSchema,
|
|
1495
|
+
data,
|
|
1496
|
+
experimental_customMergeAllOf
|
|
1497
|
+
);
|
|
1432
1498
|
}
|
|
1433
1499
|
if (has3(newSchemaItems, REF_KEY)) {
|
|
1434
|
-
newSchemaItems = retrieveSchema(
|
|
1500
|
+
newSchemaItems = retrieveSchema(
|
|
1501
|
+
validator,
|
|
1502
|
+
newSchemaItems,
|
|
1503
|
+
rootSchema,
|
|
1504
|
+
data,
|
|
1505
|
+
experimental_customMergeAllOf
|
|
1506
|
+
);
|
|
1435
1507
|
}
|
|
1436
1508
|
const oldSchemaType = get8(oldSchemaItems, "type");
|
|
1437
1509
|
const newSchemaType = get8(newSchemaItems, "type");
|
|
@@ -1444,7 +1516,8 @@
|
|
|
1444
1516
|
rootSchema,
|
|
1445
1517
|
newSchemaItems,
|
|
1446
1518
|
oldSchemaItems,
|
|
1447
|
-
aValue
|
|
1519
|
+
aValue,
|
|
1520
|
+
experimental_customMergeAllOf
|
|
1448
1521
|
);
|
|
1449
1522
|
if (itemValue !== void 0 && (maxItems < 0 || newValue.length < maxItems)) {
|
|
1450
1523
|
newValue.push(itemValue);
|
|
@@ -1463,7 +1536,7 @@
|
|
|
1463
1536
|
}
|
|
1464
1537
|
function toIdSchemaInternal(validator, schema, idPrefix, idSeparator, id, rootSchema, formData, _recurseList = [], experimental_customMergeAllOf) {
|
|
1465
1538
|
if (REF_KEY in schema || DEPENDENCIES_KEY in schema || ALL_OF_KEY in schema) {
|
|
1466
|
-
const _schema = retrieveSchema(validator, schema, rootSchema, formData);
|
|
1539
|
+
const _schema = retrieveSchema(validator, schema, rootSchema, formData, experimental_customMergeAllOf);
|
|
1467
1540
|
const sameSchemaIndex = _recurseList.findIndex((item) => isEqual4(item, _schema));
|
|
1468
1541
|
if (sameSchemaIndex === -1) {
|
|
1469
1542
|
return toIdSchemaInternal(
|
|
@@ -1474,7 +1547,9 @@
|
|
|
1474
1547
|
id,
|
|
1475
1548
|
rootSchema,
|
|
1476
1549
|
formData,
|
|
1477
|
-
_recurseList.concat(_schema)
|
|
1550
|
+
_recurseList.concat(_schema),
|
|
1551
|
+
experimental_customMergeAllOf
|
|
1552
|
+
);
|
|
1478
1553
|
}
|
|
1479
1554
|
}
|
|
1480
1555
|
if (ITEMS_KEY in schema && !get8(schema, [ITEMS_KEY, REF_KEY])) {
|
|
@@ -1486,7 +1561,9 @@
|
|
|
1486
1561
|
id,
|
|
1487
1562
|
rootSchema,
|
|
1488
1563
|
formData,
|
|
1489
|
-
_recurseList
|
|
1564
|
+
_recurseList,
|
|
1565
|
+
experimental_customMergeAllOf
|
|
1566
|
+
);
|
|
1490
1567
|
}
|
|
1491
1568
|
const $id = id || idPrefix;
|
|
1492
1569
|
const idSchema = { $id };
|
|
@@ -1504,7 +1581,9 @@
|
|
|
1504
1581
|
// It's possible that formData is not an object -- this can happen if an
|
|
1505
1582
|
// array item has just been added, but not populated with data yet
|
|
1506
1583
|
get8(formData, [name]),
|
|
1507
|
-
_recurseList
|
|
1584
|
+
_recurseList,
|
|
1585
|
+
experimental_customMergeAllOf
|
|
1586
|
+
);
|
|
1508
1587
|
}
|
|
1509
1588
|
}
|
|
1510
1589
|
return idSchema;
|
|
@@ -1518,11 +1597,13 @@
|
|
|
1518
1597
|
id,
|
|
1519
1598
|
rootSchema,
|
|
1520
1599
|
formData,
|
|
1521
|
-
void 0
|
|
1600
|
+
void 0,
|
|
1601
|
+
experimental_customMergeAllOf
|
|
1602
|
+
);
|
|
1522
1603
|
}
|
|
1523
|
-
function toPathSchemaInternal(validator, schema, name, rootSchema, formData, _recurseList = []) {
|
|
1604
|
+
function toPathSchemaInternal(validator, schema, name, rootSchema, formData, _recurseList = [], experimental_customMergeAllOf) {
|
|
1524
1605
|
if (REF_KEY in schema || DEPENDENCIES_KEY in schema || ALL_OF_KEY in schema) {
|
|
1525
|
-
const _schema = retrieveSchema(validator, schema, rootSchema, formData);
|
|
1606
|
+
const _schema = retrieveSchema(validator, schema, rootSchema, formData, experimental_customMergeAllOf);
|
|
1526
1607
|
const sameSchemaIndex = _recurseList.findIndex((item) => isEqual4(item, _schema));
|
|
1527
1608
|
if (sameSchemaIndex === -1) {
|
|
1528
1609
|
return toPathSchemaInternal(
|
|
@@ -1531,7 +1612,8 @@
|
|
|
1531
1612
|
name,
|
|
1532
1613
|
rootSchema,
|
|
1533
1614
|
formData,
|
|
1534
|
-
_recurseList.concat(_schema)
|
|
1615
|
+
_recurseList.concat(_schema),
|
|
1616
|
+
experimental_customMergeAllOf
|
|
1535
1617
|
);
|
|
1536
1618
|
}
|
|
1537
1619
|
}
|
|
@@ -1541,11 +1623,27 @@
|
|
|
1541
1623
|
if (ONE_OF_KEY in schema || ANY_OF_KEY in schema) {
|
|
1542
1624
|
const xxxOf = ONE_OF_KEY in schema ? schema.oneOf : schema.anyOf;
|
|
1543
1625
|
const discriminator = getDiscriminatorFieldFromSchema(schema);
|
|
1544
|
-
const index = getClosestMatchingOption(
|
|
1626
|
+
const index = getClosestMatchingOption(
|
|
1627
|
+
validator,
|
|
1628
|
+
rootSchema,
|
|
1629
|
+
formData,
|
|
1630
|
+
xxxOf,
|
|
1631
|
+
0,
|
|
1632
|
+
discriminator,
|
|
1633
|
+
experimental_customMergeAllOf
|
|
1634
|
+
);
|
|
1545
1635
|
const _schema = xxxOf[index];
|
|
1546
1636
|
pathSchema = {
|
|
1547
1637
|
...pathSchema,
|
|
1548
|
-
...toPathSchemaInternal(
|
|
1638
|
+
...toPathSchemaInternal(
|
|
1639
|
+
validator,
|
|
1640
|
+
_schema,
|
|
1641
|
+
name,
|
|
1642
|
+
rootSchema,
|
|
1643
|
+
formData,
|
|
1644
|
+
_recurseList,
|
|
1645
|
+
experimental_customMergeAllOf
|
|
1646
|
+
)
|
|
1549
1647
|
};
|
|
1550
1648
|
}
|
|
1551
1649
|
if (ADDITIONAL_PROPERTIES_KEY in schema && schema[ADDITIONAL_PROPERTIES_KEY] !== false) {
|
|
@@ -1562,7 +1660,8 @@
|
|
|
1562
1660
|
`${name}.${i}`,
|
|
1563
1661
|
rootSchema,
|
|
1564
1662
|
element,
|
|
1565
|
-
_recurseList
|
|
1663
|
+
_recurseList,
|
|
1664
|
+
experimental_customMergeAllOf
|
|
1566
1665
|
);
|
|
1567
1666
|
} else if (schemaAdditionalItems) {
|
|
1568
1667
|
pathSchema[i] = toPathSchemaInternal(
|
|
@@ -1571,7 +1670,8 @@
|
|
|
1571
1670
|
`${name}.${i}`,
|
|
1572
1671
|
rootSchema,
|
|
1573
1672
|
element,
|
|
1574
|
-
_recurseList
|
|
1673
|
+
_recurseList,
|
|
1674
|
+
experimental_customMergeAllOf
|
|
1575
1675
|
);
|
|
1576
1676
|
} else {
|
|
1577
1677
|
console.warn(`Unable to generate path schema for "${name}.${i}". No schema defined for it`);
|
|
@@ -1585,7 +1685,8 @@
|
|
|
1585
1685
|
`${name}.${i}`,
|
|
1586
1686
|
rootSchema,
|
|
1587
1687
|
element,
|
|
1588
|
-
_recurseList
|
|
1688
|
+
_recurseList,
|
|
1689
|
+
experimental_customMergeAllOf
|
|
1589
1690
|
);
|
|
1590
1691
|
});
|
|
1591
1692
|
}
|
|
@@ -1600,14 +1701,15 @@
|
|
|
1600
1701
|
// It's possible that formData is not an object -- this can happen if an
|
|
1601
1702
|
// array item has just been added, but not populated with data yet
|
|
1602
1703
|
get8(formData, [property]),
|
|
1603
|
-
_recurseList
|
|
1704
|
+
_recurseList,
|
|
1705
|
+
experimental_customMergeAllOf
|
|
1604
1706
|
);
|
|
1605
1707
|
}
|
|
1606
1708
|
}
|
|
1607
1709
|
return pathSchema;
|
|
1608
1710
|
}
|
|
1609
|
-
function toPathSchema(validator, schema, name = "", rootSchema, formData) {
|
|
1610
|
-
return toPathSchemaInternal(validator, schema, name, rootSchema, formData);
|
|
1711
|
+
function toPathSchema(validator, schema, name = "", rootSchema, formData, experimental_customMergeAllOf) {
|
|
1712
|
+
return toPathSchemaInternal(validator, schema, name, rootSchema, formData, void 0, experimental_customMergeAllOf);
|
|
1611
1713
|
}
|
|
1612
1714
|
|
|
1613
1715
|
// src/createSchemaUtils.ts
|
|
@@ -1678,7 +1780,14 @@
|
|
|
1678
1780
|
* @returns - True if the label should be displayed or false if it should not
|
|
1679
1781
|
*/
|
|
1680
1782
|
getDisplayLabel(schema, uiSchema, globalOptions) {
|
|
1681
|
-
return getDisplayLabel(
|
|
1783
|
+
return getDisplayLabel(
|
|
1784
|
+
this.validator,
|
|
1785
|
+
schema,
|
|
1786
|
+
uiSchema,
|
|
1787
|
+
this.rootSchema,
|
|
1788
|
+
globalOptions,
|
|
1789
|
+
this.experimental_customMergeAllOf
|
|
1790
|
+
);
|
|
1682
1791
|
}
|
|
1683
1792
|
/** Determines which of the given `options` provided most closely matches the `formData`.
|
|
1684
1793
|
* Returns the index of the option that is valid and is the closest match, or 0 if there is no match.
|
|
@@ -1700,7 +1809,8 @@
|
|
|
1700
1809
|
formData,
|
|
1701
1810
|
options,
|
|
1702
1811
|
selectedOption,
|
|
1703
|
-
discriminatorField
|
|
1812
|
+
discriminatorField,
|
|
1813
|
+
this.experimental_customMergeAllOf
|
|
1704
1814
|
);
|
|
1705
1815
|
}
|
|
1706
1816
|
/** Given the `formData` and list of `options`, attempts to find the index of the first option that matches the data.
|
|
@@ -1735,7 +1845,7 @@
|
|
|
1735
1845
|
* @returns - True if schema/uiSchema contains an array of files, otherwise false
|
|
1736
1846
|
*/
|
|
1737
1847
|
isFilesArray(schema, uiSchema) {
|
|
1738
|
-
return isFilesArray(this.validator, schema, uiSchema, this.rootSchema);
|
|
1848
|
+
return isFilesArray(this.validator, schema, uiSchema, this.rootSchema, this.experimental_customMergeAllOf);
|
|
1739
1849
|
}
|
|
1740
1850
|
/** Checks to see if the `schema` combination represents a multi-select
|
|
1741
1851
|
*
|
|
@@ -1743,7 +1853,7 @@
|
|
|
1743
1853
|
* @returns - True if schema contains a multi-select, otherwise false
|
|
1744
1854
|
*/
|
|
1745
1855
|
isMultiSelect(schema) {
|
|
1746
|
-
return isMultiSelect(this.validator, schema, this.rootSchema);
|
|
1856
|
+
return isMultiSelect(this.validator, schema, this.rootSchema, this.experimental_customMergeAllOf);
|
|
1747
1857
|
}
|
|
1748
1858
|
/** Checks to see if the `schema` combination represents a select
|
|
1749
1859
|
*
|
|
@@ -1751,7 +1861,7 @@
|
|
|
1751
1861
|
* @returns - True if schema contains a select, otherwise false
|
|
1752
1862
|
*/
|
|
1753
1863
|
isSelect(schema) {
|
|
1754
|
-
return isSelect(this.validator, schema, this.rootSchema);
|
|
1864
|
+
return isSelect(this.validator, schema, this.rootSchema, this.experimental_customMergeAllOf);
|
|
1755
1865
|
}
|
|
1756
1866
|
/** Merges the errors in `additionalErrorSchema` into the existing `validationData` by combining the hierarchies in
|
|
1757
1867
|
* the two `ErrorSchema`s and then appending the error list from the `additionalErrorSchema` obtained by calling
|
|
@@ -1796,7 +1906,14 @@
|
|
|
1796
1906
|
* to `undefined`. Will return `undefined` if the new schema is not an object containing properties.
|
|
1797
1907
|
*/
|
|
1798
1908
|
sanitizeDataForNewSchema(newSchema, oldSchema, data) {
|
|
1799
|
-
return sanitizeDataForNewSchema(
|
|
1909
|
+
return sanitizeDataForNewSchema(
|
|
1910
|
+
this.validator,
|
|
1911
|
+
this.rootSchema,
|
|
1912
|
+
newSchema,
|
|
1913
|
+
oldSchema,
|
|
1914
|
+
data,
|
|
1915
|
+
this.experimental_customMergeAllOf
|
|
1916
|
+
);
|
|
1800
1917
|
}
|
|
1801
1918
|
/** Generates an `IdSchema` object for the `schema`, recursively
|
|
1802
1919
|
*
|
|
@@ -1827,7 +1944,14 @@
|
|
|
1827
1944
|
* @returns - The `PathSchema` object for the `schema`
|
|
1828
1945
|
*/
|
|
1829
1946
|
toPathSchema(schema, name, formData) {
|
|
1830
|
-
return toPathSchema(
|
|
1947
|
+
return toPathSchema(
|
|
1948
|
+
this.validator,
|
|
1949
|
+
schema,
|
|
1950
|
+
name,
|
|
1951
|
+
this.rootSchema,
|
|
1952
|
+
formData,
|
|
1953
|
+
this.experimental_customMergeAllOf
|
|
1954
|
+
);
|
|
1831
1955
|
}
|
|
1832
1956
|
};
|
|
1833
1957
|
function createSchemaUtils(validator, rootSchema, experimental_defaultFormStateBehavior = {}, experimental_customMergeAllOf) {
|
|
@@ -2019,9 +2143,9 @@
|
|
|
2019
2143
|
errorBlock[ERRORS_KEY] = errorsList;
|
|
2020
2144
|
}
|
|
2021
2145
|
if (Array.isArray(errorOrList)) {
|
|
2022
|
-
|
|
2146
|
+
set3(errorBlock, ERRORS_KEY, [.../* @__PURE__ */ new Set([...errorsList, ...errorOrList])]);
|
|
2023
2147
|
} else {
|
|
2024
|
-
errorsList
|
|
2148
|
+
set3(errorBlock, ERRORS_KEY, [.../* @__PURE__ */ new Set([...errorsList, errorOrList])]);
|
|
2025
2149
|
}
|
|
2026
2150
|
return this;
|
|
2027
2151
|
}
|
|
@@ -2035,7 +2159,7 @@
|
|
|
2035
2159
|
*/
|
|
2036
2160
|
setErrors(errorOrList, pathOfError) {
|
|
2037
2161
|
const errorBlock = this.getOrCreateErrorBlock(pathOfError);
|
|
2038
|
-
const listToAdd = Array.isArray(errorOrList) ? [...errorOrList] : [errorOrList];
|
|
2162
|
+
const listToAdd = Array.isArray(errorOrList) ? [.../* @__PURE__ */ new Set([...errorOrList])] : [errorOrList];
|
|
2039
2163
|
set3(errorBlock, ERRORS_KEY, listToAdd);
|
|
2040
2164
|
return this;
|
|
2041
2165
|
}
|
|
@@ -66,10 +66,10 @@ export default class ErrorSchemaBuilder {
|
|
|
66
66
|
errorBlock[ERRORS_KEY] = errorsList;
|
|
67
67
|
}
|
|
68
68
|
if (Array.isArray(errorOrList)) {
|
|
69
|
-
|
|
69
|
+
set(errorBlock, ERRORS_KEY, [...new Set([...errorsList, ...errorOrList])]);
|
|
70
70
|
}
|
|
71
71
|
else {
|
|
72
|
-
errorsList
|
|
72
|
+
set(errorBlock, ERRORS_KEY, [...new Set([...errorsList, errorOrList])]);
|
|
73
73
|
}
|
|
74
74
|
return this;
|
|
75
75
|
}
|
|
@@ -84,7 +84,7 @@ export default class ErrorSchemaBuilder {
|
|
|
84
84
|
setErrors(errorOrList, pathOfError) {
|
|
85
85
|
const errorBlock = this.getOrCreateErrorBlock(pathOfError);
|
|
86
86
|
// Effectively clone the array being given to prevent accidental outside manipulation of the given list
|
|
87
|
-
const listToAdd = Array.isArray(errorOrList) ? [...errorOrList] : [errorOrList];
|
|
87
|
+
const listToAdd = Array.isArray(errorOrList) ? [...new Set([...errorOrList])] : [errorOrList];
|
|
88
88
|
set(errorBlock, ERRORS_KEY, listToAdd);
|
|
89
89
|
return this;
|
|
90
90
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ErrorSchemaBuilder.js","sourceRoot":"","sources":["../src/ErrorSchemaBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,kBAAkB,CAAC;AACzC,OAAO,GAAG,MAAM,YAAY,CAAC;AAC7B,OAAO,GAAG,MAAM,YAAY,CAAC;AAC7B,OAAO,OAAO,MAAM,gBAAgB,CAAC;AAGrC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,kBAAkB;IAOrC;;;OAGG;IACH,YAAY,aAA8B;QAV1C;;;WAGG;QACK,gBAAW,GAAmB,EAAE,CAAC;QAOvC,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC;IACrC,CAAC;IAED;OACG;IACH,IAAI,WAAW;QACb,OAAO,IAAI,CAAC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