@rjsf/core 6.4.0 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rjsf/core",
3
- "version": "6.4.0",
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",
@@ -66,7 +66,7 @@
66
66
  "node": ">=20"
67
67
  },
68
68
  "peerDependencies": {
69
- "@rjsf/utils": "^6.3.x",
69
+ "@rjsf/utils": "^6.4.x",
70
70
  "react": ">=18"
71
71
  },
72
72
  "dependencies": {
@@ -76,9 +76,9 @@
76
76
  "prop-types": "^15.8.1"
77
77
  },
78
78
  "devDependencies": {
79
- "@rjsf/snapshot-tests": "6.4.0",
80
- "@rjsf/utils": "6.4.0",
81
- "@rjsf/validator-ajv8": "6.4.0",
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",
@@ -765,7 +765,7 @@ export default class Form<
765
765
  errors = merged.errors;
766
766
  }
767
767
  if (customErrors) {
768
- const merged = validationDataMerge(schemaValidation, customErrors.ErrorSchema, true);
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
- const itemsUiSchema = (uiSchema?.items ?? {}) as UiSchema<T[], S, F>;
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?: UiSchema<T[], S, F>;
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,