@rjsf/utils 6.6.2 → 6.7.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.
- package/LICENSE.md +201 -0
- package/README.md +0 -4
- package/dist/index.cjs +246 -112
- package/dist/index.cjs.map +4 -4
- package/dist/utils.esm.js +246 -112
- package/dist/utils.esm.js.map +4 -4
- package/dist/utils.umd.js +277 -140
- package/lib/SelectedOptionDescription.d.ts +4 -0
- package/lib/SelectedOptionDescription.js +24 -0
- package/lib/SelectedOptionDescription.js.map +1 -0
- package/lib/asNumber.d.ts +6 -5
- package/lib/asNumber.js +14 -9
- package/lib/asNumber.js.map +1 -1
- package/lib/constants.d.ts +8 -5
- package/lib/constants.js +10 -7
- package/lib/constants.js.map +1 -1
- package/lib/createSchemaUtils.js +1 -1
- package/lib/createSchemaUtils.js.map +1 -1
- package/lib/enums.d.ts +4 -0
- package/lib/enums.js +4 -0
- package/lib/enums.js.map +1 -1
- package/lib/getDecimalSeparator.d.ts +8 -0
- package/lib/getDecimalSeparator.js +23 -0
- package/lib/getDecimalSeparator.js.map +1 -0
- package/lib/getSubmitButtonOptions.js +1 -1
- package/lib/getSubmitButtonOptions.js.map +1 -1
- package/lib/getWidget.js +2 -1
- package/lib/getWidget.js.map +1 -1
- package/lib/hashForSchema.d.ts +2 -0
- package/lib/hashForSchema.js +3 -1
- package/lib/hashForSchema.js.map +1 -1
- package/lib/index.d.ts +6 -2
- package/lib/index.js +5 -2
- package/lib/index.js.map +1 -1
- package/lib/isFixedItems.d.ts +2 -2
- package/lib/isFixedItems.js +3 -3
- package/lib/isFixedItems.js.map +1 -1
- package/lib/isRootSchema.js +2 -3
- package/lib/isRootSchema.js.map +1 -1
- package/lib/logUnsupportedDefaultForEnum.d.ts +9 -0
- package/lib/logUnsupportedDefaultForEnum.js +18 -0
- package/lib/logUnsupportedDefaultForEnum.js.map +1 -0
- package/lib/mergeSchemas.js +8 -1
- package/lib/mergeSchemas.js.map +1 -1
- package/lib/optionsList.js +22 -21
- package/lib/optionsList.js.map +1 -1
- package/lib/resolveUiSchema.js.map +1 -1
- package/lib/schema/getDefaultFormState.d.ts +1 -1
- package/lib/schema/getDefaultFormState.js +53 -17
- package/lib/schema/getDefaultFormState.js.map +1 -1
- package/lib/schema/getDisplayLabel.js +2 -3
- package/lib/schema/getDisplayLabel.js.map +1 -1
- package/lib/schema/omitExtraData.js +11 -0
- package/lib/schema/omitExtraData.js.map +1 -1
- package/lib/schema/retrieveSchema.d.ts +5 -1
- package/lib/schema/retrieveSchema.js +49 -14
- package/lib/schema/retrieveSchema.js.map +1 -1
- package/lib/schemaRequiresTrueValue.js +4 -3
- package/lib/schemaRequiresTrueValue.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types.d.ts +24 -0
- package/lib/useAltDateWidgetProps.d.ts +1 -1
- package/lib/useFileWidgetProps.js +2 -2
- package/lib/useFileWidgetProps.js.map +1 -1
- package/package.json +19 -19
- package/src/SelectedOptionDescription.tsx +48 -0
- package/src/asNumber.ts +18 -9
- package/src/constants.ts +10 -7
- package/src/createSchemaUtils.ts +1 -1
- package/src/enums.ts +4 -0
- package/src/getDecimalSeparator.ts +20 -0
- package/src/getSubmitButtonOptions.ts +1 -1
- package/src/getWidget.tsx +1 -1
- package/src/hashForSchema.ts +3 -1
- package/src/index.ts +8 -0
- package/src/isFixedItems.ts +3 -3
- package/src/isRootSchema.ts +2 -4
- package/src/logUnsupportedDefaultForEnum.ts +28 -0
- package/src/mergeSchemas.ts +9 -2
- package/src/optionsList.ts +20 -22
- package/src/resolveUiSchema.ts +12 -4
- package/src/schema/getDefaultFormState.ts +79 -22
- package/src/schema/getDisplayLabel.ts +3 -4
- package/src/schema/omitExtraData.ts +11 -0
- package/src/schema/retrieveSchema.ts +59 -13
- package/src/schemaRequiresTrueValue.ts +3 -3
- package/src/types.ts +31 -0
- package/src/useFileWidgetProps.ts +2 -2
package/dist/utils.esm.js
CHANGED
|
@@ -20,6 +20,20 @@ function allowAdditionalItems(schema) {
|
|
|
20
20
|
return isObject(schema.additionalItems);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
// src/getDecimalSeparator.ts
|
|
24
|
+
function getDecimalSeparator(languages) {
|
|
25
|
+
const locales = languages || (typeof navigator !== "undefined" ? navigator.languages : void 0);
|
|
26
|
+
if (locales) {
|
|
27
|
+
try {
|
|
28
|
+
const formatter = new Intl.NumberFormat(locales);
|
|
29
|
+
const parts = formatter.formatToParts(1.1);
|
|
30
|
+
return parts.find((part) => part.type === "decimal")?.value || ".";
|
|
31
|
+
} catch (e) {
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
return ".";
|
|
35
|
+
}
|
|
36
|
+
|
|
23
37
|
// src/asNumber.ts
|
|
24
38
|
function asNumber(value) {
|
|
25
39
|
if (value === "") {
|
|
@@ -28,22 +42,24 @@ function asNumber(value) {
|
|
|
28
42
|
if (value === null) {
|
|
29
43
|
return null;
|
|
30
44
|
}
|
|
31
|
-
|
|
45
|
+
const separator = getDecimalSeparator();
|
|
46
|
+
const standardValue = typeof value === "string" && separator !== "." ? value.replace(separator, ".") : value;
|
|
47
|
+
if (/\.$/.test(standardValue)) {
|
|
32
48
|
return value;
|
|
33
49
|
}
|
|
34
|
-
if (/\.0$/.test(
|
|
50
|
+
if (/\.0$/.test(standardValue)) {
|
|
35
51
|
return value;
|
|
36
52
|
}
|
|
37
|
-
if (/\.\d*0$/.test(
|
|
53
|
+
if (/\.\d*0$/.test(standardValue)) {
|
|
38
54
|
return value;
|
|
39
55
|
}
|
|
40
|
-
const n = Number(
|
|
56
|
+
const n = Number(standardValue);
|
|
41
57
|
const valid = typeof n === "number" && !Number.isNaN(n);
|
|
42
58
|
return valid ? n : value;
|
|
43
59
|
}
|
|
44
60
|
|
|
45
61
|
// src/constants.ts
|
|
46
|
-
var ADDITIONAL_PROPERTY_FLAG = "__additional_property";
|
|
62
|
+
var ADDITIONAL_PROPERTY_FLAG = /* @__PURE__ */ Symbol("__additional_property");
|
|
47
63
|
var ADDITIONAL_PROPERTIES_KEY = "additionalProperties";
|
|
48
64
|
var ALL_OF_KEY = "allOf";
|
|
49
65
|
var ANY_OF_KEY = "anyOf";
|
|
@@ -65,15 +81,17 @@ var READONLY_KEY = "readonly";
|
|
|
65
81
|
var REQUIRED_KEY = "required";
|
|
66
82
|
var SUBMIT_BTN_OPTIONS_KEY = "submitButtonOptions";
|
|
67
83
|
var REF_KEY = "$ref";
|
|
68
|
-
var RJSF_REF_KEY = "__rjsf_ref";
|
|
84
|
+
var RJSF_REF_KEY = /* @__PURE__ */ Symbol("__rjsf_ref");
|
|
85
|
+
var RJSF_REF_CYCLE_KEY = /* @__PURE__ */ Symbol("__rjsf_ref_cycle");
|
|
69
86
|
var SCHEMA_KEY = "$schema";
|
|
70
87
|
var DEFAULT_ID_PREFIX = "root";
|
|
71
88
|
var DEFAULT_ID_SEPARATOR = "_";
|
|
72
89
|
var DISCRIMINATOR_PATH = ["discriminator", "propertyName"];
|
|
73
90
|
var FORM_CONTEXT_NAME = "formContext";
|
|
74
91
|
var LOOKUP_MAP_NAME = "layoutGridLookupMap";
|
|
75
|
-
var
|
|
76
|
-
var
|
|
92
|
+
var RJSF_PREFIX_KEY = "__rjsf";
|
|
93
|
+
var RJSF_ADDITIONAL_PROPERTIES_FLAG = `${RJSF_PREFIX_KEY}_additionalProperties`;
|
|
94
|
+
var ROOT_SCHEMA_PREFIX = `${RJSF_PREFIX_KEY}_rootSchema`;
|
|
77
95
|
var UI_FIELD_KEY = "ui:field";
|
|
78
96
|
var UI_WIDGET_KEY = "ui:widget";
|
|
79
97
|
var UI_OPTIONS_KEY = "ui:options";
|
|
@@ -144,7 +162,7 @@ function createErrorHandler(formData) {
|
|
|
144
162
|
}
|
|
145
163
|
|
|
146
164
|
// src/createSchemaUtils.ts
|
|
147
|
-
import
|
|
165
|
+
import get16 from "lodash/get";
|
|
148
166
|
|
|
149
167
|
// src/deepEquals.ts
|
|
150
168
|
import { createCustomEqual } from "fast-equals";
|
|
@@ -348,7 +366,7 @@ function getSchemaType(schema) {
|
|
|
348
366
|
// src/mergeSchemas.ts
|
|
349
367
|
function mergeSchemas(obj1, obj2) {
|
|
350
368
|
const acc = { ...obj1 };
|
|
351
|
-
|
|
369
|
+
const result = Object.keys(obj2).reduce((accumulator, key) => {
|
|
352
370
|
const left = obj1 ? obj1[key] : {}, right = obj2[key];
|
|
353
371
|
if (obj1 && key in obj1 && isObject(right)) {
|
|
354
372
|
accumulator[key] = mergeSchemas(left, right);
|
|
@@ -359,6 +377,10 @@ function mergeSchemas(obj1, obj2) {
|
|
|
359
377
|
}
|
|
360
378
|
return accumulator;
|
|
361
379
|
}, acc);
|
|
380
|
+
for (const sym of Object.getOwnPropertySymbols(obj2)) {
|
|
381
|
+
result[sym] = obj2[sym];
|
|
382
|
+
}
|
|
383
|
+
return result;
|
|
362
384
|
}
|
|
363
385
|
|
|
364
386
|
// src/schema/getFirstMatchingOption.ts
|
|
@@ -460,6 +482,12 @@ function retrieveSchema(validator, schema, rootSchema = {}, rawFormData, experim
|
|
|
460
482
|
resolveAnyOfOrOneOfRefs
|
|
461
483
|
)[0];
|
|
462
484
|
}
|
|
485
|
+
function normalizeBooleanSchema(schema) {
|
|
486
|
+
if (typeof schema !== "boolean") {
|
|
487
|
+
return schema;
|
|
488
|
+
}
|
|
489
|
+
return schema ? {} : { not: {} };
|
|
490
|
+
}
|
|
463
491
|
function resolveCondition(validator, schema, rootSchema, expandAllBranches, recurseList, formData, experimental_customMergeAllOf) {
|
|
464
492
|
const { if: expression, then, else: otherwise, ...resolvedSchemaLessConditional } = schema;
|
|
465
493
|
const conditionValue = validator.isValid(expression, formData || {}, rootSchema);
|
|
@@ -467,10 +495,11 @@ function resolveCondition(validator, schema, rootSchema, expandAllBranches, recu
|
|
|
467
495
|
let schemas = [];
|
|
468
496
|
if (expandAllBranches) {
|
|
469
497
|
if (then && typeof then !== "boolean") {
|
|
498
|
+
const thenSchema = then;
|
|
470
499
|
schemas = schemas.concat(
|
|
471
500
|
retrieveSchemaInternal(
|
|
472
501
|
validator,
|
|
473
|
-
|
|
502
|
+
thenSchema,
|
|
474
503
|
rootSchema,
|
|
475
504
|
formData,
|
|
476
505
|
expandAllBranches,
|
|
@@ -480,10 +509,11 @@ function resolveCondition(validator, schema, rootSchema, expandAllBranches, recu
|
|
|
480
509
|
);
|
|
481
510
|
}
|
|
482
511
|
if (otherwise && typeof otherwise !== "boolean") {
|
|
512
|
+
const otherwiseSchema = otherwise;
|
|
483
513
|
schemas = schemas.concat(
|
|
484
514
|
retrieveSchemaInternal(
|
|
485
515
|
validator,
|
|
486
|
-
|
|
516
|
+
otherwiseSchema,
|
|
487
517
|
rootSchema,
|
|
488
518
|
formData,
|
|
489
519
|
expandAllBranches,
|
|
@@ -493,8 +523,9 @@ function resolveCondition(validator, schema, rootSchema, expandAllBranches, recu
|
|
|
493
523
|
);
|
|
494
524
|
}
|
|
495
525
|
} else {
|
|
496
|
-
const
|
|
497
|
-
if (
|
|
526
|
+
const conditionalBranch = conditionValue ? then : otherwise;
|
|
527
|
+
if (conditionalBranch !== void 0) {
|
|
528
|
+
const conditionalSchema = normalizeBooleanSchema(conditionalBranch);
|
|
498
529
|
schemas = schemas.concat(
|
|
499
530
|
retrieveSchemaInternal(
|
|
500
531
|
validator,
|
|
@@ -618,7 +649,7 @@ function resolveReference(validator, schema, rootSchema, expandAllBranches, recu
|
|
|
618
649
|
}
|
|
619
650
|
return [schema];
|
|
620
651
|
}
|
|
621
|
-
function resolveAllReferences(schema, rootSchema, recurseList, baseURI, resolveAnyOfOrOneOfRefs) {
|
|
652
|
+
function resolveAllReferences(schema, rootSchema, recurseList, baseURI, resolveAnyOfOrOneOfRefs, markCycleOnDetection = false) {
|
|
622
653
|
if (!isObject(schema)) {
|
|
623
654
|
return schema;
|
|
624
655
|
}
|
|
@@ -627,7 +658,7 @@ function resolveAllReferences(schema, rootSchema, recurseList, baseURI, resolveA
|
|
|
627
658
|
if (REF_KEY in resolvedSchema) {
|
|
628
659
|
const { $ref, ...localSchema } = resolvedSchema;
|
|
629
660
|
if (recurseList.includes($ref)) {
|
|
630
|
-
return resolvedSchema;
|
|
661
|
+
return markCycleOnDetection ? { ...resolvedSchema, [RJSF_REF_CYCLE_KEY]: true } : resolvedSchema;
|
|
631
662
|
}
|
|
632
663
|
recurseList.push($ref);
|
|
633
664
|
const refSchema = findSchemaDefinition($ref, rootSchema, currentBaseURI);
|
|
@@ -642,7 +673,14 @@ function resolveAllReferences(schema, rootSchema, recurseList, baseURI, resolveA
|
|
|
642
673
|
resolvedSchema[PROPERTIES_KEY],
|
|
643
674
|
(acc, value, key) => {
|
|
644
675
|
const childList = [...recurseList];
|
|
645
|
-
acc[key] = resolveAllReferences(
|
|
676
|
+
acc[key] = resolveAllReferences(
|
|
677
|
+
value,
|
|
678
|
+
rootSchema,
|
|
679
|
+
childList,
|
|
680
|
+
currentBaseURI,
|
|
681
|
+
resolveAnyOfOrOneOfRefs,
|
|
682
|
+
!resolveAnyOfOrOneOfRefs
|
|
683
|
+
);
|
|
646
684
|
childrenLists.push(childList);
|
|
647
685
|
},
|
|
648
686
|
{}
|
|
@@ -653,6 +691,7 @@ function resolveAllReferences(schema, rootSchema, recurseList, baseURI, resolveA
|
|
|
653
691
|
if (ITEMS_KEY in resolvedSchema && !Array.isArray(resolvedSchema.items) && typeof resolvedSchema.items !== "boolean") {
|
|
654
692
|
resolvedSchema = {
|
|
655
693
|
...resolvedSchema,
|
|
694
|
+
// Array items are only rendered when data exists, so a $ref cycle here does NOT cause an infinite render.
|
|
656
695
|
items: resolveAllReferences(
|
|
657
696
|
resolvedSchema.items,
|
|
658
697
|
rootSchema,
|
|
@@ -703,7 +742,7 @@ function stubExistingAdditionalProperties(validator, theSchema, rootSchema, aFor
|
|
|
703
742
|
get5(formData, [key]),
|
|
704
743
|
experimental_customMergeAllOf
|
|
705
744
|
);
|
|
706
|
-
|
|
745
|
+
schema.properties[key][ADDITIONAL_PROPERTY_FLAG] = true;
|
|
707
746
|
return;
|
|
708
747
|
}
|
|
709
748
|
}
|
|
@@ -715,7 +754,7 @@ function stubExistingAdditionalProperties(validator, theSchema, rootSchema, aFor
|
|
|
715
754
|
validator,
|
|
716
755
|
{ [REF_KEY]: get5(schema.additionalProperties, [REF_KEY]) },
|
|
717
756
|
rootSchema,
|
|
718
|
-
formData,
|
|
757
|
+
get5(formData, [key]),
|
|
719
758
|
experimental_customMergeAllOf
|
|
720
759
|
);
|
|
721
760
|
} else if ("type" in schema.additionalProperties) {
|
|
@@ -732,10 +771,10 @@ function stubExistingAdditionalProperties(validator, theSchema, rootSchema, aFor
|
|
|
732
771
|
additionalProperties = { type: guessType(get5(formData, [key])) };
|
|
733
772
|
}
|
|
734
773
|
schema.properties[key] = additionalProperties;
|
|
735
|
-
|
|
774
|
+
schema.properties[key][ADDITIONAL_PROPERTY_FLAG] = true;
|
|
736
775
|
} else {
|
|
737
776
|
schema.properties[key] = { type: "null" };
|
|
738
|
-
|
|
777
|
+
schema.properties[key][ADDITIONAL_PROPERTY_FLAG] = true;
|
|
739
778
|
}
|
|
740
779
|
});
|
|
741
780
|
return schema;
|
|
@@ -778,17 +817,26 @@ function retrieveSchemaInternal(validator, schema, rootSchema, rawFormData, expa
|
|
|
778
817
|
try {
|
|
779
818
|
const withContainsSchemas = [];
|
|
780
819
|
const withoutContainsSchemas = [];
|
|
820
|
+
const allOfSymbols = {};
|
|
781
821
|
resolvedSchema.allOf?.forEach((allOfItem) => {
|
|
782
822
|
if (typeof allOfItem === "object" && allOfItem.contains) {
|
|
783
823
|
withContainsSchemas.push(allOfItem);
|
|
784
824
|
} else {
|
|
785
825
|
withoutContainsSchemas.push(allOfItem);
|
|
826
|
+
for (const sym of Object.getOwnPropertySymbols(allOfItem)) {
|
|
827
|
+
if (!(sym in allOfSymbols)) {
|
|
828
|
+
allOfSymbols[sym] = allOfItem[sym];
|
|
829
|
+
}
|
|
830
|
+
}
|
|
786
831
|
}
|
|
787
832
|
});
|
|
788
833
|
if (withContainsSchemas.length) {
|
|
789
834
|
resolvedSchema = { ...resolvedSchema, allOf: withoutContainsSchemas };
|
|
790
835
|
}
|
|
791
836
|
resolvedSchema = experimental_customMergeAllOf ? experimental_customMergeAllOf(resolvedSchema) : mergeAllOf(resolvedSchema);
|
|
837
|
+
for (const sym of Object.getOwnPropertySymbols(allOfSymbols)) {
|
|
838
|
+
resolvedSchema[sym] = allOfSymbols[sym];
|
|
839
|
+
}
|
|
792
840
|
if (withContainsSchemas.length) {
|
|
793
841
|
resolvedSchema.allOf = withContainsSchemas;
|
|
794
842
|
}
|
|
@@ -857,7 +905,7 @@ function resolveAnyOrOneOfSchemas(validator, schema, rootSchema, expandAllBranch
|
|
|
857
905
|
function relaxOptionsForScoring(options, resolveRefs = false, rootSchema) {
|
|
858
906
|
return options.map((d) => {
|
|
859
907
|
if (!isObject(d)) {
|
|
860
|
-
return d
|
|
908
|
+
return normalizeBooleanSchema(d);
|
|
861
909
|
}
|
|
862
910
|
const schema = resolveRefs && rootSchema ? resolveAllReferences(d, rootSchema, []) : d;
|
|
863
911
|
return schema.additionalProperties === false ? { ...schema, additionalProperties: true } : schema;
|
|
@@ -971,7 +1019,7 @@ function withDependentSchema(validator, schema, rootSchema, dependencyKey, depen
|
|
|
971
1019
|
}
|
|
972
1020
|
function withExactlyOneSubschema(validator, schema, rootSchema, dependencyKey, oneOf, expandAllBranches, recurseList, formData, experimental_customMergeAllOf) {
|
|
973
1021
|
const validSubschemas = oneOf.filter((subschema) => {
|
|
974
|
-
if (typeof subschema === "boolean" || !subschema
|
|
1022
|
+
if (typeof subschema === "boolean" || !subschema?.properties) {
|
|
975
1023
|
return false;
|
|
976
1024
|
}
|
|
977
1025
|
const { [dependencyKey]: conditionPropertySchema } = subschema.properties;
|
|
@@ -1292,7 +1340,7 @@ function isConstant(schema) {
|
|
|
1292
1340
|
|
|
1293
1341
|
// src/isFixedItems.ts
|
|
1294
1342
|
function isFixedItems(schema) {
|
|
1295
|
-
return Array.isArray(schema.items) && schema.items.
|
|
1343
|
+
return Array.isArray(schema.items) && schema.items.every((item) => isObject(item));
|
|
1296
1344
|
}
|
|
1297
1345
|
|
|
1298
1346
|
// src/mergeDefaultsWithFormData.ts
|
|
@@ -1441,7 +1489,7 @@ function optionsList(schema, uiSchema) {
|
|
|
1441
1489
|
const { optionsSchemaSelector = selectorField } = getUiOptions(uiSchema);
|
|
1442
1490
|
selectorField = optionsSchemaSelector;
|
|
1443
1491
|
}
|
|
1444
|
-
return altSchemas
|
|
1492
|
+
return altSchemas?.map((aSchemaDef, index) => {
|
|
1445
1493
|
const { title } = getUiOptions(altUiSchemas?.[index]);
|
|
1446
1494
|
const aSchema = aSchemaDef;
|
|
1447
1495
|
let value;
|
|
@@ -1449,10 +1497,10 @@ function optionsList(schema, uiSchema) {
|
|
|
1449
1497
|
if (selectorField) {
|
|
1450
1498
|
const innerSchema = get11(aSchema, [PROPERTIES_KEY, selectorField], {});
|
|
1451
1499
|
value = get11(innerSchema, DEFAULT_KEY, get11(innerSchema, CONST_KEY));
|
|
1452
|
-
label = label
|
|
1500
|
+
label = label ?? innerSchema?.title ?? aSchema.title ?? String(value);
|
|
1453
1501
|
} else {
|
|
1454
1502
|
value = toConstant(aSchema);
|
|
1455
|
-
label = label
|
|
1503
|
+
label = label ?? aSchema.title ?? String(value);
|
|
1456
1504
|
}
|
|
1457
1505
|
return {
|
|
1458
1506
|
schema: aSchema,
|
|
@@ -1542,8 +1590,8 @@ function computeDefaults(validator, rawSchema, computeDefaultsProps = {}) {
|
|
|
1542
1590
|
rootSchema = {},
|
|
1543
1591
|
includeUndefinedValues = false,
|
|
1544
1592
|
_recurseList = [],
|
|
1545
|
-
experimental_defaultFormStateBehavior
|
|
1546
|
-
experimental_customMergeAllOf
|
|
1593
|
+
experimental_defaultFormStateBehavior,
|
|
1594
|
+
experimental_customMergeAllOf,
|
|
1547
1595
|
required,
|
|
1548
1596
|
shouldMergeDefaultsIntoFormData = false,
|
|
1549
1597
|
initialDefaultsGenerated
|
|
@@ -1551,14 +1599,19 @@ function computeDefaults(validator, rawSchema, computeDefaultsProps = {}) {
|
|
|
1551
1599
|
let formData = isObject(rawFormData) ? rawFormData : {};
|
|
1552
1600
|
const schema = isObject(rawSchema) ? rawSchema : {};
|
|
1553
1601
|
let defaults = parentDefaults;
|
|
1602
|
+
const preferParentDefaults = defaults && experimental_defaultFormStateBehavior?.nestedDefaultsPrecedence === "ancestorWins";
|
|
1554
1603
|
let schemaToCompute = null;
|
|
1555
1604
|
let experimental_dfsb_to_compute = experimental_defaultFormStateBehavior;
|
|
1556
1605
|
let updatedRecurseList = _recurseList;
|
|
1557
1606
|
if (schema[CONST_KEY] !== void 0 && experimental_defaultFormStateBehavior?.constAsDefaults !== "never" && !constIsAjvDataReference(schema)) {
|
|
1558
1607
|
defaults = schema[CONST_KEY];
|
|
1559
1608
|
} else if (isObject(defaults) && isObject(schema.default) && !schema[ANY_OF_KEY] && !schema[ONE_OF_KEY] && !schema[REF_KEY]) {
|
|
1560
|
-
|
|
1561
|
-
|
|
1609
|
+
if (preferParentDefaults) {
|
|
1610
|
+
defaults = mergeObjects(schema.default, defaults);
|
|
1611
|
+
} else {
|
|
1612
|
+
defaults = mergeObjects(defaults, schema.default);
|
|
1613
|
+
}
|
|
1614
|
+
} else if (DEFAULT_KEY in schema && !preferParentDefaults && !schema[ANY_OF_KEY] && !schema[ONE_OF_KEY] && !schema[REF_KEY]) {
|
|
1562
1615
|
defaults = schema.default;
|
|
1563
1616
|
} else if (REF_KEY in schema) {
|
|
1564
1617
|
const refName = schema[REF_KEY];
|
|
@@ -1588,7 +1641,7 @@ function computeDefaults(validator, rawSchema, computeDefaultsProps = {}) {
|
|
|
1588
1641
|
experimental_customMergeAllOf
|
|
1589
1642
|
);
|
|
1590
1643
|
[schemaToCompute] = resolvedSchema;
|
|
1591
|
-
} else if (isFixedItems(schema)) {
|
|
1644
|
+
} else if (isFixedItems(schema) && !preferParentDefaults) {
|
|
1592
1645
|
defaults = schema.items.map(
|
|
1593
1646
|
(itemSchema, idx) => computeDefaults(validator, itemSchema, {
|
|
1594
1647
|
rootSchema,
|
|
@@ -1684,16 +1737,36 @@ function computeDefaults(validator, rawSchema, computeDefaultsProps = {}) {
|
|
|
1684
1737
|
return defaultsWithFormData;
|
|
1685
1738
|
}
|
|
1686
1739
|
function ensureFormDataMatchingSchema(validator, schema, rootSchema, formData, experimental_defaultFormStateBehavior, experimental_customMergeAllOf) {
|
|
1687
|
-
const
|
|
1740
|
+
const shouldRetrieveAllOf = experimental_defaultFormStateBehavior?.allOf === "populateDefaults" && ALL_OF_KEY in schema;
|
|
1741
|
+
const schemaToMatch = shouldRetrieveAllOf ? retrieveSchema(validator, schema, rootSchema, formData, experimental_customMergeAllOf) : schema;
|
|
1742
|
+
const isSelectField = !isConstant(schemaToMatch) && isSelect(validator, schemaToMatch, rootSchema, experimental_customMergeAllOf);
|
|
1688
1743
|
let validFormData = formData;
|
|
1689
1744
|
if (isSelectField) {
|
|
1690
|
-
const getOptionsList = optionsList(
|
|
1745
|
+
const getOptionsList = optionsList(schemaToMatch);
|
|
1691
1746
|
const isValid = getOptionsList?.some((option) => deepEquals_default(option.value, formData));
|
|
1692
1747
|
validFormData = isValid ? formData : void 0;
|
|
1693
1748
|
}
|
|
1694
|
-
const constTakesPrecedence =
|
|
1749
|
+
const constTakesPrecedence = schemaToMatch[CONST_KEY] && experimental_defaultFormStateBehavior?.constAsDefaults === "always";
|
|
1695
1750
|
if (constTakesPrecedence) {
|
|
1696
|
-
validFormData =
|
|
1751
|
+
validFormData = schemaToMatch.const;
|
|
1752
|
+
} else if (isObject(validFormData) && isObject(schemaToMatch.properties)) {
|
|
1753
|
+
validFormData = Object.keys(schemaToMatch.properties).reduce(
|
|
1754
|
+
(acc, key) => {
|
|
1755
|
+
const propertySchema = get12(schemaToMatch, [PROPERTIES_KEY, key], {});
|
|
1756
|
+
if (key in acc && (shouldRetrieveAllOf || isObject(propertySchema) && ALL_OF_KEY in propertySchema)) {
|
|
1757
|
+
acc[key] = ensureFormDataMatchingSchema(
|
|
1758
|
+
validator,
|
|
1759
|
+
propertySchema,
|
|
1760
|
+
rootSchema,
|
|
1761
|
+
get12(acc, key),
|
|
1762
|
+
experimental_defaultFormStateBehavior,
|
|
1763
|
+
experimental_customMergeAllOf
|
|
1764
|
+
);
|
|
1765
|
+
}
|
|
1766
|
+
return acc;
|
|
1767
|
+
},
|
|
1768
|
+
{ ...validFormData }
|
|
1769
|
+
);
|
|
1697
1770
|
}
|
|
1698
1771
|
return validFormData;
|
|
1699
1772
|
}
|
|
@@ -1702,8 +1775,8 @@ function getObjectDefaults(validator, rawSchema, {
|
|
|
1702
1775
|
rootSchema = {},
|
|
1703
1776
|
includeUndefinedValues = false,
|
|
1704
1777
|
_recurseList = [],
|
|
1705
|
-
experimental_defaultFormStateBehavior
|
|
1706
|
-
experimental_customMergeAllOf
|
|
1778
|
+
experimental_defaultFormStateBehavior,
|
|
1779
|
+
experimental_customMergeAllOf,
|
|
1707
1780
|
required,
|
|
1708
1781
|
shouldMergeDefaultsIntoFormData,
|
|
1709
1782
|
initialDefaultsGenerated
|
|
@@ -1787,8 +1860,8 @@ function getArrayDefaults(validator, rawSchema, {
|
|
|
1787
1860
|
rawFormData,
|
|
1788
1861
|
rootSchema = {},
|
|
1789
1862
|
_recurseList = [],
|
|
1790
|
-
experimental_defaultFormStateBehavior
|
|
1791
|
-
experimental_customMergeAllOf
|
|
1863
|
+
experimental_defaultFormStateBehavior,
|
|
1864
|
+
experimental_customMergeAllOf,
|
|
1792
1865
|
required,
|
|
1793
1866
|
requiredAsRoot = false,
|
|
1794
1867
|
shouldMergeDefaultsIntoFormData,
|
|
@@ -1843,14 +1916,17 @@ function getArrayDefaults(validator, rawSchema, {
|
|
|
1843
1916
|
defaults = mergeDefaultsWithFormData(defaults, itemDefaults, mergeExtraDefaults);
|
|
1844
1917
|
}
|
|
1845
1918
|
}
|
|
1919
|
+
const defaultsLength = Array.isArray(defaults) ? defaults.length : 0;
|
|
1846
1920
|
if (neverPopulate) {
|
|
1921
|
+
if (shouldMergeDefaultsIntoFormData && !required) {
|
|
1922
|
+
return defaults;
|
|
1923
|
+
}
|
|
1847
1924
|
return defaults ?? emptyDefault;
|
|
1848
1925
|
}
|
|
1849
1926
|
if (ignoreMinItemsFlagSet && !required) {
|
|
1850
1927
|
return defaults || void 0;
|
|
1851
1928
|
}
|
|
1852
1929
|
let arrayDefault;
|
|
1853
|
-
const defaultsLength = Array.isArray(defaults) ? defaults.length : 0;
|
|
1854
1930
|
if (!schema.minItems || isMultiSelect(validator, schema, rootSchema, experimental_customMergeAllOf) || computeSkipPopulate(validator, schema, rootSchema) || schema.minItems <= defaultsLength) {
|
|
1855
1931
|
arrayDefault = defaults || !required && !requiredAsRoot ? defaults : emptyDefault;
|
|
1856
1932
|
} else {
|
|
@@ -1910,9 +1986,17 @@ function getDefaultFormState(validator, theSchema, formData, rootSchema, include
|
|
|
1910
1986
|
if (isObject(formData) || Array.isArray(formData)) {
|
|
1911
1987
|
const { mergeDefaultsIntoFormData } = experimental_defaultFormStateBehavior || {};
|
|
1912
1988
|
const defaultSupercedesUndefined = mergeDefaultsIntoFormData === "useDefaultIfFormDataUndefined";
|
|
1989
|
+
const matchingFormData = ensureFormDataMatchingSchema(
|
|
1990
|
+
validator,
|
|
1991
|
+
schema,
|
|
1992
|
+
rootSchema ?? schema,
|
|
1993
|
+
formData,
|
|
1994
|
+
experimental_defaultFormStateBehavior,
|
|
1995
|
+
experimental_customMergeAllOf
|
|
1996
|
+
);
|
|
1913
1997
|
const result = mergeDefaultsWithFormData(
|
|
1914
1998
|
defaults,
|
|
1915
|
-
|
|
1999
|
+
matchingFormData,
|
|
1916
2000
|
true,
|
|
1917
2001
|
// set to true to add any additional default array entries.
|
|
1918
2002
|
defaultSupercedesUndefined,
|
|
@@ -1924,9 +2008,6 @@ function getDefaultFormState(validator, theSchema, formData, rootSchema, include
|
|
|
1924
2008
|
return defaults;
|
|
1925
2009
|
}
|
|
1926
2010
|
|
|
1927
|
-
// src/schema/getDisplayLabel.ts
|
|
1928
|
-
import get13 from "lodash/get";
|
|
1929
|
-
|
|
1930
2011
|
// src/isCustomWidget.ts
|
|
1931
2012
|
function isCustomWidget(uiSchema = {}) {
|
|
1932
2013
|
return (
|
|
@@ -1961,7 +2042,7 @@ function getDisplayLabel(validator, schema, uiSchema = {}, rootSchema, globalOpt
|
|
|
1961
2042
|
let displayLabel = Boolean(label);
|
|
1962
2043
|
if (displayLabel) {
|
|
1963
2044
|
const schemaType = getSchemaType(schema);
|
|
1964
|
-
const addedByAdditionalProperty =
|
|
2045
|
+
const addedByAdditionalProperty = Boolean(schema[ADDITIONAL_PROPERTY_FLAG]);
|
|
1965
2046
|
if (schemaType === "array") {
|
|
1966
2047
|
displayLabel = addedByAdditionalProperty || isMultiSelect(validator, schema, rootSchema, experimental_customMergeAllOf) || isFilesArray(validator, schema, uiSchema, rootSchema, experimental_customMergeAllOf) || isCustomWidget(uiSchema);
|
|
1967
2048
|
}
|
|
@@ -1971,7 +2052,7 @@ function getDisplayLabel(validator, schema, uiSchema = {}, rootSchema, globalOpt
|
|
|
1971
2052
|
if (schemaType === "boolean" && uiSchema && !uiSchema[UI_WIDGET_KEY]) {
|
|
1972
2053
|
displayLabel = false;
|
|
1973
2054
|
}
|
|
1974
|
-
if (uiSchema
|
|
2055
|
+
if (uiSchema?.[UI_FIELD_KEY]) {
|
|
1975
2056
|
displayLabel = false;
|
|
1976
2057
|
}
|
|
1977
2058
|
}
|
|
@@ -1979,7 +2060,7 @@ function getDisplayLabel(validator, schema, uiSchema = {}, rootSchema, globalOpt
|
|
|
1979
2060
|
}
|
|
1980
2061
|
|
|
1981
2062
|
// src/schema/omitExtraData.ts
|
|
1982
|
-
import
|
|
2063
|
+
import get13 from "lodash/get";
|
|
1983
2064
|
import isEmpty5 from "lodash/isEmpty";
|
|
1984
2065
|
import isNil2 from "lodash/isNil";
|
|
1985
2066
|
import pick from "lodash/pick";
|
|
@@ -2008,7 +2089,7 @@ function getFieldNames(pathSchema, formData) {
|
|
|
2008
2089
|
}
|
|
2009
2090
|
} else if (key === NAME_KEY && data !== "") {
|
|
2010
2091
|
paths.forEach((path) => {
|
|
2011
|
-
const formValue =
|
|
2092
|
+
const formValue = get13(formData, path);
|
|
2012
2093
|
const isLeaf = objKeys.length === 1;
|
|
2013
2094
|
if (formValueHasData(formValue, isLeaf) || Array.isArray(formValue) && formValue.every((val) => formValueHasData(val, isLeaf))) {
|
|
2014
2095
|
acc.push(path);
|
|
@@ -2046,7 +2127,7 @@ function omitExtraData(validator, schema, rootSchema = {}, formData, experimenta
|
|
|
2046
2127
|
const { properties, additionalProperties, patternProperties, propertyNames } = childSchema;
|
|
2047
2128
|
const requiredSet = new Set(childSchema.required ?? []);
|
|
2048
2129
|
function setProperty(key, schemaDef, value, required = false) {
|
|
2049
|
-
const v =
|
|
2130
|
+
const v = omit2(schemaDef, value, target[key]);
|
|
2050
2131
|
if (!required && isObject(v)) {
|
|
2051
2132
|
let sd = isSchemaObj(schemaDef) ? schemaDef : {};
|
|
2052
2133
|
if (sd.$ref !== void 0) {
|
|
@@ -2115,17 +2196,17 @@ function omitExtraData(validator, schema, rootSchema = {}, formData, experimenta
|
|
|
2115
2196
|
if (items !== void 0) {
|
|
2116
2197
|
if (Array.isArray(items)) {
|
|
2117
2198
|
for (let i = 0; i < items.length; i += 1) {
|
|
2118
|
-
target.push(
|
|
2199
|
+
target.push(omit2(items[i], source[i]));
|
|
2119
2200
|
}
|
|
2120
2201
|
} else {
|
|
2121
2202
|
for (let i = 0; i < source.length; i += 1) {
|
|
2122
|
-
target.push(
|
|
2203
|
+
target.push(omit2(items, source[i]));
|
|
2123
2204
|
}
|
|
2124
2205
|
}
|
|
2125
2206
|
}
|
|
2126
2207
|
if (additionalItems) {
|
|
2127
2208
|
for (let i = target.length; i < source.length; i += 1) {
|
|
2128
|
-
target.push(
|
|
2209
|
+
target.push(omit2(additionalItems, source[i]));
|
|
2129
2210
|
}
|
|
2130
2211
|
}
|
|
2131
2212
|
return target;
|
|
@@ -2137,7 +2218,7 @@ function omitExtraData(validator, schema, rootSchema = {}, formData, experimenta
|
|
|
2137
2218
|
}
|
|
2138
2219
|
const isThenBranch = isSchemaObj(condition) ? validator.isValid(condition, source, rootSchema) : condition;
|
|
2139
2220
|
const branch = isThenBranch ? then : otherwise;
|
|
2140
|
-
return branch === void 0 ? target :
|
|
2221
|
+
return branch === void 0 ? target : omit2(branch, source, target);
|
|
2141
2222
|
}
|
|
2142
2223
|
function handleOneOf(oneOf, childSchema, source, target) {
|
|
2143
2224
|
if (!Array.isArray(oneOf) || isSelect(validator, childSchema, rootSchema, experimental_customMergeAllOf)) {
|
|
@@ -2155,7 +2236,7 @@ function omitExtraData(validator, schema, rootSchema = {}, formData, experimenta
|
|
|
2155
2236
|
);
|
|
2156
2237
|
const winning = oneOf[bestIndex];
|
|
2157
2238
|
const resolved = isObject(winning) ? resolveAllReferences(winning, rootSchema, []) : scoringOptions[bestIndex];
|
|
2158
|
-
return
|
|
2239
|
+
return omit2(resolved, source, target);
|
|
2159
2240
|
}
|
|
2160
2241
|
function handleAnyOf(childSchema, source, target) {
|
|
2161
2242
|
const { anyOf } = childSchema;
|
|
@@ -2165,7 +2246,7 @@ function omitExtraData(validator, schema, rootSchema = {}, formData, experimenta
|
|
|
2165
2246
|
if (source === void 0 || Array.isArray(source) && source.length === 0 || isObject(source) && Object.keys(source).length === 0) {
|
|
2166
2247
|
let result = target;
|
|
2167
2248
|
for (const branch of anyOf) {
|
|
2168
|
-
result =
|
|
2249
|
+
result = omit2(branch, source, result);
|
|
2169
2250
|
}
|
|
2170
2251
|
return result;
|
|
2171
2252
|
}
|
|
@@ -2179,12 +2260,12 @@ function omitExtraData(validator, schema, rootSchema = {}, formData, experimenta
|
|
|
2179
2260
|
let result = target;
|
|
2180
2261
|
for (const [key, deps] of Object.entries(dependencies)) {
|
|
2181
2262
|
if (key in source && !Array.isArray(deps)) {
|
|
2182
|
-
result =
|
|
2263
|
+
result = omit2(deps, source, result);
|
|
2183
2264
|
}
|
|
2184
2265
|
}
|
|
2185
2266
|
return result;
|
|
2186
2267
|
}
|
|
2187
|
-
function
|
|
2268
|
+
function omit2(schemaDef, source, target) {
|
|
2188
2269
|
if (source === void 0 || schemaDef === false) {
|
|
2189
2270
|
return void 0;
|
|
2190
2271
|
}
|
|
@@ -2194,10 +2275,16 @@ function omitExtraData(validator, schema, rootSchema = {}, formData, experimenta
|
|
|
2194
2275
|
let localSchema = schemaDef;
|
|
2195
2276
|
const { $ref: ref, allOf } = localSchema;
|
|
2196
2277
|
if (ref !== void 0) {
|
|
2197
|
-
return
|
|
2278
|
+
return omit2(findSchemaDefinition(ref, rootSchema), source, target);
|
|
2198
2279
|
}
|
|
2199
2280
|
if (allOf) {
|
|
2200
2281
|
localSchema = doMergeAllOf(localSchema, experimental_customMergeAllOf);
|
|
2282
|
+
const remainingAllOf = localSchema.allOf;
|
|
2283
|
+
if (remainingAllOf) {
|
|
2284
|
+
for (let i = 0; i < remainingAllOf.length; i++) {
|
|
2285
|
+
target = omit2(remainingAllOf[i], source, target);
|
|
2286
|
+
}
|
|
2287
|
+
}
|
|
2201
2288
|
}
|
|
2202
2289
|
let filtered = handleAnyOf(localSchema, source, handleOneOf(localSchema.oneOf, localSchema, source, target));
|
|
2203
2290
|
const type = getSchemaType(localSchema);
|
|
@@ -2216,11 +2303,11 @@ function omitExtraData(validator, schema, rootSchema = {}, formData, experimenta
|
|
|
2216
2303
|
}
|
|
2217
2304
|
return handleDependencies(localSchema, source, handleConditions(localSchema, source, filtered));
|
|
2218
2305
|
}
|
|
2219
|
-
return
|
|
2306
|
+
return omit2(schema, formData);
|
|
2220
2307
|
}
|
|
2221
2308
|
|
|
2222
2309
|
// src/schema/sanitizeDataForNewSchema.ts
|
|
2223
|
-
import
|
|
2310
|
+
import get14 from "lodash/get";
|
|
2224
2311
|
import has5 from "lodash/has";
|
|
2225
2312
|
var NO_VALUE = /* @__PURE__ */ Symbol("no Value");
|
|
2226
2313
|
function enumValuesForSchema(schema) {
|
|
@@ -2244,7 +2331,7 @@ function replacementForInvalidEnumValue(schema, formValue) {
|
|
|
2244
2331
|
if (!enumValues || enumValues.some((value) => deepEquals_default(value, formValue))) {
|
|
2245
2332
|
return NO_VALUE;
|
|
2246
2333
|
}
|
|
2247
|
-
const defaultValue =
|
|
2334
|
+
const defaultValue = get14(schema, DEFAULT_KEY, NO_VALUE);
|
|
2248
2335
|
if (defaultValue !== NO_VALUE && enumValues.some((value) => deepEquals_default(value, defaultValue))) {
|
|
2249
2336
|
return defaultValue;
|
|
2250
2337
|
}
|
|
@@ -2255,19 +2342,19 @@ function sanitizeDataForNewSchema(validator, rootSchema, newSchema, oldSchema, d
|
|
|
2255
2342
|
if (has5(newSchema, PROPERTIES_KEY)) {
|
|
2256
2343
|
const removeOldSchemaData = {};
|
|
2257
2344
|
if (has5(oldSchema, PROPERTIES_KEY)) {
|
|
2258
|
-
const properties =
|
|
2345
|
+
const properties = get14(oldSchema, PROPERTIES_KEY, {});
|
|
2259
2346
|
Object.keys(properties).forEach((key) => {
|
|
2260
2347
|
if (has5(data, key)) {
|
|
2261
2348
|
removeOldSchemaData[key] = void 0;
|
|
2262
2349
|
}
|
|
2263
2350
|
});
|
|
2264
2351
|
}
|
|
2265
|
-
const keys2 = Object.keys(
|
|
2352
|
+
const keys2 = Object.keys(get14(newSchema, PROPERTIES_KEY, {}));
|
|
2266
2353
|
const nestedData = {};
|
|
2267
2354
|
keys2.forEach((key) => {
|
|
2268
|
-
const formValue =
|
|
2269
|
-
let oldKeyedSchema =
|
|
2270
|
-
let newKeyedSchema =
|
|
2355
|
+
const formValue = get14(data, key);
|
|
2356
|
+
let oldKeyedSchema = get14(oldSchema, [PROPERTIES_KEY, key], {});
|
|
2357
|
+
let newKeyedSchema = get14(newSchema, [PROPERTIES_KEY, key], {});
|
|
2271
2358
|
if (has5(oldKeyedSchema, REF_KEY)) {
|
|
2272
2359
|
oldKeyedSchema = retrieveSchema(
|
|
2273
2360
|
validator,
|
|
@@ -2286,8 +2373,8 @@ function sanitizeDataForNewSchema(validator, rootSchema, newSchema, oldSchema, d
|
|
|
2286
2373
|
experimental_customMergeAllOf
|
|
2287
2374
|
);
|
|
2288
2375
|
}
|
|
2289
|
-
const oldSchemaTypeForKey =
|
|
2290
|
-
const newSchemaTypeForKey =
|
|
2376
|
+
const oldSchemaTypeForKey = get14(oldKeyedSchema, "type");
|
|
2377
|
+
const newSchemaTypeForKey = get14(newKeyedSchema, "type");
|
|
2291
2378
|
if (!oldSchemaTypeForKey || oldSchemaTypeForKey === newSchemaTypeForKey) {
|
|
2292
2379
|
if (has5(removeOldSchemaData, key)) {
|
|
2293
2380
|
delete removeOldSchemaData[key];
|
|
@@ -2305,17 +2392,17 @@ function sanitizeDataForNewSchema(validator, rootSchema, newSchema, oldSchema, d
|
|
|
2305
2392
|
nestedData[key] = itemData;
|
|
2306
2393
|
}
|
|
2307
2394
|
} else {
|
|
2308
|
-
const newOptionDefault =
|
|
2309
|
-
const oldOptionDefault =
|
|
2395
|
+
const newOptionDefault = get14(newKeyedSchema, DEFAULT_KEY, NO_VALUE);
|
|
2396
|
+
const oldOptionDefault = get14(oldKeyedSchema, DEFAULT_KEY, NO_VALUE);
|
|
2310
2397
|
if (newOptionDefault !== NO_VALUE && newOptionDefault !== formValue) {
|
|
2311
2398
|
if (oldOptionDefault === formValue) {
|
|
2312
2399
|
removeOldSchemaData[key] = newOptionDefault;
|
|
2313
|
-
} else if (
|
|
2400
|
+
} else if (get14(newKeyedSchema, "readOnly") === true) {
|
|
2314
2401
|
removeOldSchemaData[key] = void 0;
|
|
2315
2402
|
}
|
|
2316
2403
|
}
|
|
2317
|
-
const newOptionConst =
|
|
2318
|
-
const oldOptionConst =
|
|
2404
|
+
const newOptionConst = get14(newKeyedSchema, CONST_KEY, NO_VALUE);
|
|
2405
|
+
const oldOptionConst = get14(oldKeyedSchema, CONST_KEY, NO_VALUE);
|
|
2319
2406
|
if (newOptionConst !== NO_VALUE && newOptionConst !== formValue) {
|
|
2320
2407
|
removeOldSchemaData[key] = oldOptionConst === formValue ? newOptionConst : void 0;
|
|
2321
2408
|
}
|
|
@@ -2333,9 +2420,9 @@ function sanitizeDataForNewSchema(validator, rootSchema, newSchema, oldSchema, d
|
|
|
2333
2420
|
...removeOldSchemaData,
|
|
2334
2421
|
...nestedData
|
|
2335
2422
|
};
|
|
2336
|
-
} else if (
|
|
2337
|
-
let oldSchemaItems =
|
|
2338
|
-
let newSchemaItems =
|
|
2423
|
+
} else if (get14(oldSchema, "type") === "array" && get14(newSchema, "type") === "array" && Array.isArray(data)) {
|
|
2424
|
+
let oldSchemaItems = get14(oldSchema, "items");
|
|
2425
|
+
let newSchemaItems = get14(newSchema, "items");
|
|
2339
2426
|
if (typeof oldSchemaItems === "object" && typeof newSchemaItems === "object" && !Array.isArray(oldSchemaItems) && !Array.isArray(newSchemaItems)) {
|
|
2340
2427
|
if (has5(oldSchemaItems, REF_KEY)) {
|
|
2341
2428
|
oldSchemaItems = retrieveSchema(
|
|
@@ -2355,10 +2442,10 @@ function sanitizeDataForNewSchema(validator, rootSchema, newSchema, oldSchema, d
|
|
|
2355
2442
|
experimental_customMergeAllOf
|
|
2356
2443
|
);
|
|
2357
2444
|
}
|
|
2358
|
-
const oldSchemaType =
|
|
2359
|
-
const newSchemaType =
|
|
2445
|
+
const oldSchemaType = get14(oldSchemaItems, "type");
|
|
2446
|
+
const newSchemaType = get14(newSchemaItems, "type");
|
|
2360
2447
|
if (!oldSchemaType || oldSchemaType === newSchemaType) {
|
|
2361
|
-
const maxItems =
|
|
2448
|
+
const maxItems = get14(newSchema, "maxItems", -1);
|
|
2362
2449
|
if (newSchemaType === "object") {
|
|
2363
2450
|
newFormData = data.reduce((newValue, aValue) => {
|
|
2364
2451
|
const itemValue = sanitizeDataForNewSchema(
|
|
@@ -2388,7 +2475,7 @@ function sanitizeDataForNewSchema(validator, rootSchema, newSchema, oldSchema, d
|
|
|
2388
2475
|
}
|
|
2389
2476
|
|
|
2390
2477
|
// src/schema/toPathSchema.ts
|
|
2391
|
-
import
|
|
2478
|
+
import get15 from "lodash/get";
|
|
2392
2479
|
import isObject4 from "lodash/isObject";
|
|
2393
2480
|
import set2 from "lodash/set";
|
|
2394
2481
|
function toPathSchemaInternal(validator, schema, name, rootSchema, formData, _recurseList = [], experimental_customMergeAllOf) {
|
|
@@ -2439,7 +2526,7 @@ function toPathSchemaInternal(validator, schema, name, rootSchema, formData, _re
|
|
|
2439
2526
|
if (ADDITIONAL_PROPERTIES_KEY in schema && schema[ADDITIONAL_PROPERTIES_KEY] !== false) {
|
|
2440
2527
|
set2(pathSchema, RJSF_ADDITIONAL_PROPERTIES_FLAG, true);
|
|
2441
2528
|
const additionalSchema = isObject4(schema[ADDITIONAL_PROPERTIES_KEY]) ? schema[ADDITIONAL_PROPERTIES_KEY] : {};
|
|
2442
|
-
const definedProperties =
|
|
2529
|
+
const definedProperties = get15(schema, PROPERTIES_KEY, {});
|
|
2443
2530
|
for (const key of Object.keys(formData ?? {})) {
|
|
2444
2531
|
if (!(key in definedProperties)) {
|
|
2445
2532
|
pathSchema[key] = toPathSchemaInternal(
|
|
@@ -2447,7 +2534,7 @@ function toPathSchemaInternal(validator, schema, name, rootSchema, formData, _re
|
|
|
2447
2534
|
additionalSchema,
|
|
2448
2535
|
`${name}.${key}`,
|
|
2449
2536
|
rootSchema,
|
|
2450
|
-
|
|
2537
|
+
get15(formData, [key]),
|
|
2451
2538
|
_recurseList,
|
|
2452
2539
|
experimental_customMergeAllOf
|
|
2453
2540
|
);
|
|
@@ -2497,7 +2584,7 @@ function toPathSchemaInternal(validator, schema, name, rootSchema, formData, _re
|
|
|
2497
2584
|
}
|
|
2498
2585
|
} else if (PROPERTIES_KEY in schema) {
|
|
2499
2586
|
for (const property in schema.properties) {
|
|
2500
|
-
const field =
|
|
2587
|
+
const field = get15(schema, [PROPERTIES_KEY, property], {});
|
|
2501
2588
|
pathSchema[property] = toPathSchemaInternal(
|
|
2502
2589
|
validator,
|
|
2503
2590
|
field,
|
|
@@ -2505,7 +2592,7 @@ function toPathSchemaInternal(validator, schema, name, rootSchema, formData, _re
|
|
|
2505
2592
|
rootSchema,
|
|
2506
2593
|
// It's possible that formData is not an object -- this can happen if an
|
|
2507
2594
|
// array item has just been added, but not populated with data yet
|
|
2508
|
-
|
|
2595
|
+
get15(formData, [property]),
|
|
2509
2596
|
_recurseList,
|
|
2510
2597
|
experimental_customMergeAllOf
|
|
2511
2598
|
);
|
|
@@ -2527,8 +2614,8 @@ var SchemaUtils = class {
|
|
|
2527
2614
|
* @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas
|
|
2528
2615
|
*/
|
|
2529
2616
|
constructor(validator, rootSchema, experimental_defaultFormStateBehavior, experimental_customMergeAllOf) {
|
|
2530
|
-
if (rootSchema
|
|
2531
|
-
this.rootSchema = makeAllReferencesAbsolute(rootSchema,
|
|
2617
|
+
if (rootSchema?.[SCHEMA_KEY] === JSON_SCHEMA_DRAFT_2020_12) {
|
|
2618
|
+
this.rootSchema = makeAllReferencesAbsolute(rootSchema, get16(rootSchema, ID_KEY, "#"));
|
|
2532
2619
|
} else {
|
|
2533
2620
|
this.rootSchema = rootSchema;
|
|
2534
2621
|
}
|
|
@@ -2985,7 +3072,7 @@ function enumOptionValueEncoder(value, index, format = "indexed") {
|
|
|
2985
3072
|
|
|
2986
3073
|
// src/ErrorSchemaBuilder.ts
|
|
2987
3074
|
import cloneDeep from "lodash/cloneDeep";
|
|
2988
|
-
import
|
|
3075
|
+
import get17 from "lodash/get";
|
|
2989
3076
|
import set3 from "lodash/set";
|
|
2990
3077
|
import setWith from "lodash/setWith";
|
|
2991
3078
|
var ErrorSchemaBuilder = class {
|
|
@@ -3014,7 +3101,7 @@ var ErrorSchemaBuilder = class {
|
|
|
3014
3101
|
*/
|
|
3015
3102
|
getOrCreateErrorBlock(pathOfError) {
|
|
3016
3103
|
const hasPath = Array.isArray(pathOfError) && pathOfError.length > 0 || typeof pathOfError === "string";
|
|
3017
|
-
let errorBlock = hasPath ?
|
|
3104
|
+
let errorBlock = hasPath ? get17(this.errorSchema, pathOfError) : this.errorSchema;
|
|
3018
3105
|
if (!errorBlock && pathOfError) {
|
|
3019
3106
|
errorBlock = {};
|
|
3020
3107
|
setWith(this.errorSchema, pathOfError, errorBlock, Object);
|
|
@@ -3040,7 +3127,7 @@ var ErrorSchemaBuilder = class {
|
|
|
3040
3127
|
*/
|
|
3041
3128
|
addErrors(errorOrList, pathOfError) {
|
|
3042
3129
|
const errorBlock = this.getOrCreateErrorBlock(pathOfError);
|
|
3043
|
-
let errorsList =
|
|
3130
|
+
let errorsList = get17(errorBlock, ERRORS_KEY);
|
|
3044
3131
|
if (!Array.isArray(errorsList)) {
|
|
3045
3132
|
errorsList = [];
|
|
3046
3133
|
errorBlock[ERRORS_KEY] = errorsList;
|
|
@@ -3082,7 +3169,7 @@ var ErrorSchemaBuilder = class {
|
|
|
3082
3169
|
|
|
3083
3170
|
// src/getChangedFields.ts
|
|
3084
3171
|
import difference from "lodash/difference";
|
|
3085
|
-
import
|
|
3172
|
+
import get18 from "lodash/get";
|
|
3086
3173
|
import isPlainObject2 from "lodash/isPlainObject";
|
|
3087
3174
|
import keys from "lodash/keys";
|
|
3088
3175
|
import pickBy from "lodash/pickBy";
|
|
@@ -3098,7 +3185,7 @@ function getChangedFields(a, b) {
|
|
|
3098
3185
|
if (!aIsPlainObject && bIsPlainObject) {
|
|
3099
3186
|
return keys(b);
|
|
3100
3187
|
}
|
|
3101
|
-
const unequalFields = keys(pickBy(a, (value, key) => !deepEquals_default(value,
|
|
3188
|
+
const unequalFields = keys(pickBy(a, (value, key) => !deepEquals_default(value, get18(b, key))));
|
|
3102
3189
|
const diffFields = difference(keys(b), keys(a));
|
|
3103
3190
|
return [...unequalFields, ...diffFields];
|
|
3104
3191
|
}
|
|
@@ -3199,7 +3286,7 @@ var DEFAULT_OPTIONS = {
|
|
|
3199
3286
|
};
|
|
3200
3287
|
function getSubmitButtonOptions(uiSchema = {}) {
|
|
3201
3288
|
const uiOptions = getUiOptions(uiSchema);
|
|
3202
|
-
if (uiOptions
|
|
3289
|
+
if (uiOptions?.[SUBMIT_BTN_OPTIONS_KEY]) {
|
|
3203
3290
|
const options = uiOptions[SUBMIT_BTN_OPTIONS_KEY];
|
|
3204
3291
|
return { ...DEFAULT_OPTIONS, ...options };
|
|
3205
3292
|
}
|
|
@@ -3224,10 +3311,10 @@ function getTemplate(name, registry, uiOptions = {}) {
|
|
|
3224
3311
|
}
|
|
3225
3312
|
|
|
3226
3313
|
// src/getTestIds.ts
|
|
3227
|
-
import
|
|
3314
|
+
import get19 from "lodash/get";
|
|
3228
3315
|
import uniqueId from "lodash/uniqueId";
|
|
3229
3316
|
function getTestIds() {
|
|
3230
|
-
if (
|
|
3317
|
+
if (get19(globalThis, "process.env.NODE_ENV") !== "test") {
|
|
3231
3318
|
return {};
|
|
3232
3319
|
}
|
|
3233
3320
|
const ids = /* @__PURE__ */ new Map();
|
|
@@ -3246,7 +3333,7 @@ function getTestIds() {
|
|
|
3246
3333
|
|
|
3247
3334
|
// src/getWidget.tsx
|
|
3248
3335
|
import { createElement } from "react";
|
|
3249
|
-
import
|
|
3336
|
+
import get20 from "lodash/get";
|
|
3250
3337
|
import set4 from "lodash/set";
|
|
3251
3338
|
import ReactIs from "react-is";
|
|
3252
3339
|
import { jsx } from "react/jsx-runtime";
|
|
@@ -3303,9 +3390,9 @@ var widgetMap = {
|
|
|
3303
3390
|
}
|
|
3304
3391
|
};
|
|
3305
3392
|
function mergeWidgetOptions(AWidget) {
|
|
3306
|
-
let MergedWidget =
|
|
3393
|
+
let MergedWidget = get20(AWidget, "MergedWidget");
|
|
3307
3394
|
if (!MergedWidget) {
|
|
3308
|
-
const defaultOptions = AWidget.defaultProps
|
|
3395
|
+
const defaultOptions = AWidget.defaultProps?.options || {};
|
|
3309
3396
|
MergedWidget = ({ options, ...props }) => /* @__PURE__ */ jsx(AWidget, { options: { ...defaultOptions, ...options }, ...props });
|
|
3310
3397
|
set4(AWidget, "MergedWidget", MergedWidget);
|
|
3311
3398
|
}
|
|
@@ -3357,7 +3444,7 @@ function hashObject(object) {
|
|
|
3357
3444
|
return hashString(sortedJSONStringify(object));
|
|
3358
3445
|
}
|
|
3359
3446
|
function hashForSchema(schema) {
|
|
3360
|
-
return
|
|
3447
|
+
return hashString(sortedJSONStringify(schema));
|
|
3361
3448
|
}
|
|
3362
3449
|
|
|
3363
3450
|
// src/hasWidget.ts
|
|
@@ -3418,7 +3505,6 @@ function isFormDataAvailable(formData) {
|
|
|
3418
3505
|
}
|
|
3419
3506
|
|
|
3420
3507
|
// src/isRootSchema.ts
|
|
3421
|
-
import omit2 from "lodash/omit";
|
|
3422
3508
|
function isRootSchema(registry, schemaToCompare) {
|
|
3423
3509
|
const { rootSchema, schemaUtils } = registry;
|
|
3424
3510
|
if (deepEquals_default(schemaToCompare, rootSchema)) {
|
|
@@ -3426,7 +3512,7 @@ function isRootSchema(registry, schemaToCompare) {
|
|
|
3426
3512
|
}
|
|
3427
3513
|
if (REF_KEY in rootSchema) {
|
|
3428
3514
|
const resolvedSchema = schemaUtils.retrieveSchema(rootSchema);
|
|
3429
|
-
return deepEquals_default(schemaToCompare,
|
|
3515
|
+
return deepEquals_default(schemaToCompare, resolvedSchema);
|
|
3430
3516
|
}
|
|
3431
3517
|
return false;
|
|
3432
3518
|
}
|
|
@@ -3441,15 +3527,24 @@ function localToUTC(dateString) {
|
|
|
3441
3527
|
return dateString ? new Date(dateString).toJSON() : void 0;
|
|
3442
3528
|
}
|
|
3443
3529
|
|
|
3530
|
+
// src/logUnsupportedDefaultForEnum.ts
|
|
3531
|
+
function logUnsupportedDefaultForEnum(id, schema, enumOptions, multiple = false) {
|
|
3532
|
+
if (!multiple && Array.isArray(enumOptions) && schema.default !== void 0 && enumOptionsIndexForValue(schema.default, enumOptions, multiple) === void 0) {
|
|
3533
|
+
console.error(
|
|
3534
|
+
`The schema default value "${schema.default}" is not one of the values in the enum options for "${id}"`
|
|
3535
|
+
);
|
|
3536
|
+
}
|
|
3537
|
+
}
|
|
3538
|
+
|
|
3444
3539
|
// src/lookupFromFormContext.ts
|
|
3445
|
-
import
|
|
3540
|
+
import get21 from "lodash/get";
|
|
3446
3541
|
import has6 from "lodash/has";
|
|
3447
3542
|
function lookupFromFormContext(regOrFc, toLookup, fallback) {
|
|
3448
3543
|
const lookupPath = [LOOKUP_MAP_NAME];
|
|
3449
3544
|
if (has6(regOrFc, FORM_CONTEXT_NAME)) {
|
|
3450
3545
|
lookupPath.unshift(FORM_CONTEXT_NAME);
|
|
3451
3546
|
}
|
|
3452
|
-
return
|
|
3547
|
+
return get21(regOrFc, [...lookupPath, toLookup], fallback);
|
|
3453
3548
|
}
|
|
3454
3549
|
|
|
3455
3550
|
// src/nameGenerators.ts
|
|
@@ -3638,13 +3733,13 @@ function schemaRequiresTrueValue(schema) {
|
|
|
3638
3733
|
if (schema.const) {
|
|
3639
3734
|
return true;
|
|
3640
3735
|
}
|
|
3641
|
-
if (schema.enum
|
|
3736
|
+
if (schema.enum?.length === 1 && schema.enum[0] === true) {
|
|
3642
3737
|
return true;
|
|
3643
3738
|
}
|
|
3644
|
-
if (schema.anyOf
|
|
3739
|
+
if (schema.anyOf?.length === 1) {
|
|
3645
3740
|
return schemaRequiresTrueValue(schema.anyOf[0]);
|
|
3646
3741
|
}
|
|
3647
|
-
if (schema.oneOf
|
|
3742
|
+
if (schema.oneOf?.length === 1) {
|
|
3648
3743
|
return schemaRequiresTrueValue(schema.oneOf[0]);
|
|
3649
3744
|
}
|
|
3650
3745
|
if (schema.allOf) {
|
|
@@ -3654,6 +3749,38 @@ function schemaRequiresTrueValue(schema) {
|
|
|
3654
3749
|
return false;
|
|
3655
3750
|
}
|
|
3656
3751
|
|
|
3752
|
+
// src/SelectedOptionDescription.tsx
|
|
3753
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
3754
|
+
function SelectedOptionDescription({ hideLabel, id, multiple, options, registry, uiSchema, value }) {
|
|
3755
|
+
if (multiple || hideLabel) {
|
|
3756
|
+
return null;
|
|
3757
|
+
}
|
|
3758
|
+
const { label = true } = getUiOptions(uiSchema, registry.globalUiOptions);
|
|
3759
|
+
if (!label) {
|
|
3760
|
+
return null;
|
|
3761
|
+
}
|
|
3762
|
+
const option = options.enumOptions?.find(({ value: enumValue }) => enumOptionsIsSelected(enumValue, value));
|
|
3763
|
+
const description = option?.schema?.description;
|
|
3764
|
+
if (!description) {
|
|
3765
|
+
return null;
|
|
3766
|
+
}
|
|
3767
|
+
const DescriptionFieldTemplate = getTemplate(
|
|
3768
|
+
"DescriptionFieldTemplate",
|
|
3769
|
+
registry,
|
|
3770
|
+
options
|
|
3771
|
+
);
|
|
3772
|
+
return /* @__PURE__ */ jsx2(
|
|
3773
|
+
DescriptionFieldTemplate,
|
|
3774
|
+
{
|
|
3775
|
+
id: descriptionId(id),
|
|
3776
|
+
description,
|
|
3777
|
+
schema: option.schema,
|
|
3778
|
+
uiSchema,
|
|
3779
|
+
registry
|
|
3780
|
+
}
|
|
3781
|
+
);
|
|
3782
|
+
}
|
|
3783
|
+
|
|
3657
3784
|
// src/shallowEquals.ts
|
|
3658
3785
|
function shallowEquals(a, b) {
|
|
3659
3786
|
if (Object.is(a, b)) {
|
|
@@ -3804,7 +3931,7 @@ function unwrapErrorHandler(errorHandler) {
|
|
|
3804
3931
|
|
|
3805
3932
|
// src/useAltDateWidgetProps.tsx
|
|
3806
3933
|
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
3807
|
-
import { jsx as
|
|
3934
|
+
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
3808
3935
|
function readyForChange(state) {
|
|
3809
3936
|
return Object.values(state).every((value) => value !== -1);
|
|
3810
3937
|
}
|
|
@@ -3827,7 +3954,7 @@ function DateElement(props) {
|
|
|
3827
3954
|
const id = `${rootId}_${type}`;
|
|
3828
3955
|
const { SelectWidget } = registry.widgets;
|
|
3829
3956
|
const onChange = useCallback((newValue) => select(type, newValue), [select, type]);
|
|
3830
|
-
return /* @__PURE__ */
|
|
3957
|
+
return /* @__PURE__ */ jsx3(
|
|
3831
3958
|
SelectWidget,
|
|
3832
3959
|
{
|
|
3833
3960
|
schema: { type: "integer" },
|
|
@@ -3917,7 +4044,7 @@ import { useCallback as useCallback2, useMemo as useMemo2 } from "react";
|
|
|
3917
4044
|
function addNameToDataURL(dataURL, name) {
|
|
3918
4045
|
return dataURL.replace(";base64", `;name=${encodeURIComponent(name)};base64`);
|
|
3919
4046
|
}
|
|
3920
|
-
function processFile(file) {
|
|
4047
|
+
async function processFile(file) {
|
|
3921
4048
|
const { name, size, type } = file;
|
|
3922
4049
|
return new Promise((resolve, reject) => {
|
|
3923
4050
|
const reader = new window.FileReader();
|
|
@@ -3942,7 +4069,7 @@ function processFile(file) {
|
|
|
3942
4069
|
reader.readAsDataURL(file);
|
|
3943
4070
|
});
|
|
3944
4071
|
}
|
|
3945
|
-
function processFiles(files) {
|
|
4072
|
+
async function processFiles(files) {
|
|
3946
4073
|
return Promise.all(Array.from(files).map(processFile));
|
|
3947
4074
|
}
|
|
3948
4075
|
function extractFileInfo(dataURLs) {
|
|
@@ -4081,6 +4208,7 @@ var TranslatableString = /* @__PURE__ */ ((TranslatableString2) => {
|
|
|
4081
4208
|
TranslatableString2["AddButton"] = "Add";
|
|
4082
4209
|
TranslatableString2["AddItemButton"] = "Add Item";
|
|
4083
4210
|
TranslatableString2["CopyButton"] = "Copy";
|
|
4211
|
+
TranslatableString2["ExpandButton"] = "Expand Cycle";
|
|
4084
4212
|
TranslatableString2["MoveDownButton"] = "Move down";
|
|
4085
4213
|
TranslatableString2["MoveUpButton"] = "Move up";
|
|
4086
4214
|
TranslatableString2["RemoveButton"] = "Remove";
|
|
@@ -4101,6 +4229,7 @@ var TranslatableString = /* @__PURE__ */ ((TranslatableString2) => {
|
|
|
4101
4229
|
TranslatableString2["TitleOptionPrefix"] = "%1 option %2";
|
|
4102
4230
|
TranslatableString2["KeyLabel"] = "%1 Key";
|
|
4103
4231
|
TranslatableString2["DeprecatedLabel"] = "%1 (deprecated)";
|
|
4232
|
+
TranslatableString2["CycleDetected"] = 'Circular reference ($ref cycle) detected for field "%1". You may choose to expand to the next cycle break';
|
|
4104
4233
|
TranslatableString2["InvalidObjectField"] = 'Invalid "%1" object field configuration: _%2_.';
|
|
4105
4234
|
TranslatableString2["UnsupportedField"] = "Unsupported field schema.";
|
|
4106
4235
|
TranslatableString2["UnsupportedFieldWithId"] = "Unsupported field schema for field `%1`.";
|
|
@@ -4114,7 +4243,7 @@ var TranslatableString = /* @__PURE__ */ ((TranslatableString2) => {
|
|
|
4114
4243
|
import forEach from "lodash/forEach";
|
|
4115
4244
|
|
|
4116
4245
|
// src/parser/ParserValidator.ts
|
|
4117
|
-
import
|
|
4246
|
+
import get22 from "lodash/get";
|
|
4118
4247
|
var ParserValidator = class {
|
|
4119
4248
|
/** Construct the ParserValidator for the given `rootSchema`. This `rootSchema` will be stashed in the `schemaMap`
|
|
4120
4249
|
* first.
|
|
@@ -4140,7 +4269,7 @@ var ParserValidator = class {
|
|
|
4140
4269
|
* @param hash - The hash value at which to map the schema
|
|
4141
4270
|
*/
|
|
4142
4271
|
addSchema(schema, hash) {
|
|
4143
|
-
const key =
|
|
4272
|
+
const key = get22(schema, ID_KEY, hash);
|
|
4144
4273
|
const identifiedSchema = { ...schema, [ID_KEY]: key };
|
|
4145
4274
|
const existing = this.schemaMap[key];
|
|
4146
4275
|
if (!existing) {
|
|
@@ -4262,10 +4391,13 @@ export {
|
|
|
4262
4391
|
REF_KEY,
|
|
4263
4392
|
REQUIRED_KEY,
|
|
4264
4393
|
RJSF_ADDITIONAL_PROPERTIES_FLAG,
|
|
4394
|
+
RJSF_PREFIX_KEY,
|
|
4395
|
+
RJSF_REF_CYCLE_KEY,
|
|
4265
4396
|
RJSF_REF_KEY,
|
|
4266
4397
|
ROOT_SCHEMA_PREFIX,
|
|
4267
4398
|
SCHEMA_KEY,
|
|
4268
4399
|
SUBMIT_BTN_OPTIONS_KEY,
|
|
4400
|
+
SelectedOptionDescription,
|
|
4269
4401
|
TranslatableString,
|
|
4270
4402
|
UI_DEFINITIONS_KEY,
|
|
4271
4403
|
UI_FIELD_KEY,
|
|
@@ -4302,6 +4434,7 @@ export {
|
|
|
4302
4434
|
getChangedFields,
|
|
4303
4435
|
getClosestMatchingOption,
|
|
4304
4436
|
getDateElementProps,
|
|
4437
|
+
getDecimalSeparator,
|
|
4305
4438
|
getDefaultFormState,
|
|
4306
4439
|
getDiscriminatorFieldFromSchema,
|
|
4307
4440
|
getDisplayLabel,
|
|
@@ -4336,6 +4469,7 @@ export {
|
|
|
4336
4469
|
isValueEmpty,
|
|
4337
4470
|
labelValue,
|
|
4338
4471
|
localToUTC,
|
|
4472
|
+
logUnsupportedDefaultForEnum,
|
|
4339
4473
|
lookupFromFormContext,
|
|
4340
4474
|
mergeDefaultsWithFormData,
|
|
4341
4475
|
mergeObjects,
|