@rjsf/core 6.4.1 → 6.4.2
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/core.umd.js +4 -2
- package/dist/index.cjs +4 -2
- package/dist/index.cjs.map +2 -2
- package/dist/index.esm.js +4 -2
- package/dist/index.esm.js.map +2 -2
- package/lib/components/Form.js +1 -1
- package/lib/components/fields/ArrayField.d.ts.map +1 -1
- package/lib/components/fields/ArrayField.js +5 -1
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/src/components/Form.tsx +1 -1
- package/src/components/fields/ArrayField.tsx +6 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rjsf/core",
|
|
3
|
-
"version": "6.4.
|
|
3
|
+
"version": "6.4.2",
|
|
4
4
|
"description": "A simple React component capable of building HTML forms out of a JSON schema.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"compileReplacer": "tsc -p tsconfig.replacer.json && move-file lodashReplacer.js lodashReplacer.cjs",
|
|
@@ -76,9 +76,9 @@
|
|
|
76
76
|
"prop-types": "^15.8.1"
|
|
77
77
|
},
|
|
78
78
|
"devDependencies": {
|
|
79
|
-
"@rjsf/snapshot-tests": "6.4.
|
|
80
|
-
"@rjsf/utils": "6.4.
|
|
81
|
-
"@rjsf/validator-ajv8": "6.4.
|
|
79
|
+
"@rjsf/snapshot-tests": "6.4.2",
|
|
80
|
+
"@rjsf/utils": "6.4.2",
|
|
81
|
+
"@rjsf/validator-ajv8": "6.4.2",
|
|
82
82
|
"@testing-library/jest-dom": "^6.9.1",
|
|
83
83
|
"@testing-library/react": "^16.3.2",
|
|
84
84
|
"@testing-library/user-event": "^14.6.1",
|
package/src/components/Form.tsx
CHANGED
|
@@ -765,7 +765,7 @@ export default class Form<
|
|
|
765
765
|
errors = merged.errors;
|
|
766
766
|
}
|
|
767
767
|
if (customErrors) {
|
|
768
|
-
const merged = validationDataMerge(
|
|
768
|
+
const merged = validationDataMerge({ errors, errorSchema }, customErrors.ErrorSchema, true);
|
|
769
769
|
errorSchema = merged.errorSchema;
|
|
770
770
|
errors = merged.errors;
|
|
771
771
|
}
|
|
@@ -199,7 +199,9 @@ function ArrayAsMultiSelect<T = any, S extends StrictRJSFSchema = RJSFSchema, F
|
|
|
199
199
|
} = props;
|
|
200
200
|
const { widgets, schemaUtils, globalFormOptions, globalUiOptions } = registry;
|
|
201
201
|
const itemsSchema = schemaUtils.retrieveSchema(schema.items as S, items);
|
|
202
|
-
|
|
202
|
+
// For computing `enumOptions`, fallback to the array property's uiSchema if there is no `items` schema
|
|
203
|
+
// Avoids a breaking change reported in https://github.com/rjsf-team/react-jsonschema-form/issues/4985
|
|
204
|
+
const itemsUiSchema = (uiSchema?.items ?? uiSchema) as UiSchema<T[], S, F>;
|
|
203
205
|
const enumOptions = optionsList<T[], S, F>(itemsSchema, itemsUiSchema);
|
|
204
206
|
const { widget = 'select', title: uiTitle, ...options } = getUiOptions<T[], S, F>(uiSchema, globalUiOptions);
|
|
205
207
|
const Widget = getWidget<T[], S, F>(schema, widget, widgets);
|
|
@@ -356,7 +358,7 @@ function ArrayFieldItem<T = any, S extends StrictRJSFSchema = RJSFSchema, F exte
|
|
|
356
358
|
hideError: boolean;
|
|
357
359
|
registry: Registry<T[], S, F>;
|
|
358
360
|
uiOptions: UIOptionsType<T[], S, F>;
|
|
359
|
-
parentUiSchema
|
|
361
|
+
parentUiSchema: UiSchema<T[], S, F>;
|
|
360
362
|
title: string | undefined;
|
|
361
363
|
canAdd: boolean;
|
|
362
364
|
canRemove?: boolean;
|
|
@@ -608,6 +610,7 @@ function NormalArray<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends
|
|
|
608
610
|
name: name && `${name}-${index}`,
|
|
609
611
|
registry,
|
|
610
612
|
uiOptions,
|
|
613
|
+
parentUiSchema: uiSchema,
|
|
611
614
|
hideError,
|
|
612
615
|
readonly,
|
|
613
616
|
disabled,
|
|
@@ -752,6 +755,7 @@ function FixedArray<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends
|
|
|
752
755
|
name: name && `${name}-${index}`,
|
|
753
756
|
registry,
|
|
754
757
|
uiOptions,
|
|
758
|
+
parentUiSchema: uiSchema,
|
|
755
759
|
hideError,
|
|
756
760
|
readonly,
|
|
757
761
|
disabled,
|