@rjsf/utils 5.24.3 → 5.24.4
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 +4 -3
- package/dist/index.js.map +2 -2
- package/dist/utils.esm.js +4 -3
- package/dist/utils.esm.js.map +2 -2
- package/dist/utils.umd.js +4 -3
- package/lib/schema/getDefaultFormState.d.ts +3 -2
- package/lib/schema/getDefaultFormState.js +5 -4
- package/lib/schema/getDefaultFormState.js.map +1 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +10 -3
- package/src/schema/getDefaultFormState.ts +7 -4
|
@@ -344,7 +344,8 @@ export function computeDefaults<T = any, S extends StrictRJSFSchema = RJSFSchema
|
|
|
344
344
|
schema,
|
|
345
345
|
rootSchema,
|
|
346
346
|
rawFormData,
|
|
347
|
-
experimental_defaultFormStateBehavior
|
|
347
|
+
experimental_defaultFormStateBehavior,
|
|
348
|
+
experimental_customMergeAllOf
|
|
348
349
|
);
|
|
349
350
|
if (!isObject(rawFormData)) {
|
|
350
351
|
defaultsWithFormData = mergeDefaultsWithFormData<T>(
|
|
@@ -366,7 +367,8 @@ export function computeDefaults<T = any, S extends StrictRJSFSchema = RJSFSchema
|
|
|
366
367
|
* @param schema - The schema for which the formData state is desired
|
|
367
368
|
* @param rootSchema - The root schema, used to primarily to look up `$ref`s
|
|
368
369
|
* @param formData - The current formData
|
|
369
|
-
* @param experimental_defaultFormStateBehavior - Optional configuration object, if provided, allows users to override default form state behavior
|
|
370
|
+
* @param [experimental_defaultFormStateBehavior] - Optional configuration object, if provided, allows users to override default form state behavior
|
|
371
|
+
* @param [experimental_customMergeAllOf] - Optional function that allows for custom merging of `allOf` schemas
|
|
370
372
|
* @returns - valid formData that matches schema
|
|
371
373
|
*/
|
|
372
374
|
export function ensureFormDataMatchingSchema<
|
|
@@ -378,9 +380,10 @@ export function ensureFormDataMatchingSchema<
|
|
|
378
380
|
schema: S,
|
|
379
381
|
rootSchema: S,
|
|
380
382
|
formData: T | undefined,
|
|
381
|
-
experimental_defaultFormStateBehavior?: Experimental_DefaultFormStateBehavior
|
|
383
|
+
experimental_defaultFormStateBehavior?: Experimental_DefaultFormStateBehavior,
|
|
384
|
+
experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>
|
|
382
385
|
): T | T[] | undefined {
|
|
383
|
-
const isSelectField = !isConstant(schema) && isSelect(validator, schema, rootSchema);
|
|
386
|
+
const isSelectField = !isConstant(schema) && isSelect(validator, schema, rootSchema, experimental_customMergeAllOf);
|
|
384
387
|
let validFormData: T | T[] | undefined = formData;
|
|
385
388
|
if (isSelectField) {
|
|
386
389
|
const getOptionsList = optionsList(schema);
|