@rjsf/utils 5.0.0-beta.10 → 5.0.0-beta.11

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.
Files changed (2) hide show
  1. package/dist/index.d.ts +14 -6
  2. package/package.json +2 -2
package/dist/index.d.ts CHANGED
@@ -244,7 +244,7 @@ interface FieldProps<T = any, F = any> extends GenericObjectType, Pick<React.HTM
244
244
  /** The tree of errors for this field and its children */
245
245
  errorSchema?: ErrorSchema<T>;
246
246
  /** The field change event handler; called with the updated form data and an optional `ErrorSchema` */
247
- onChange: (newFormData: T, es?: ErrorSchema<T>) => any;
247
+ onChange: (newFormData: T, es?: ErrorSchema<T>, id?: string) => any;
248
248
  /** The input blur event handler; call it with the field id and value */
249
249
  onBlur: (id: string, value: any) => void;
250
250
  /** The input focus event handler; call it with the field id and value */
@@ -317,7 +317,7 @@ declare type FieldTemplateProps<T = any, F = any> = {
317
317
  /** The formData for this field */
318
318
  formData: T;
319
319
  /** The value change event handler; Can be called with a new value to change the value for this field */
320
- onChange: (value: T) => void;
320
+ onChange: FieldProps["onChange"];
321
321
  /** The key change event handler; Called when the key associated with a field is changed for an additionalProperty */
322
322
  onKeyChange: (value: string) => () => void;
323
323
  /** The property drop/removal event handler; Called when a field is removed in an additionalProperty context */
@@ -342,6 +342,8 @@ declare type TitleFieldProps<T = any, F = any> = {
342
342
  id: string;
343
343
  /** The title for the field being rendered */
344
344
  title: string;
345
+ /** The schema object for the field being titled */
346
+ schema: RJSFSchema;
345
347
  /** The uiSchema object for this title field */
346
348
  uiSchema?: UiSchema<T, F>;
347
349
  /** A boolean value stating if the field is required */
@@ -353,22 +355,28 @@ declare type TitleFieldProps<T = any, F = any> = {
353
355
  declare type DescriptionFieldProps<T = any, F = any> = {
354
356
  /** The id of the field description in the hierarchy */
355
357
  id: string;
358
+ /** The schema object for the field being described */
359
+ schema: RJSFSchema;
360
+ /** The uiSchema object for this description field */
361
+ uiSchema?: UiSchema<T, F>;
356
362
  /** The description of the field being rendered */
357
363
  description: string | React.ReactElement;
358
364
  /** The `registry` object */
359
365
  registry: Registry<T, F>;
360
366
  };
361
367
  /** The properties that are passed to a `ArrayFieldTitleTemplate` implementation */
362
- declare type ArrayFieldTitleProps<T = any, F = any> = Pick<TitleFieldProps<T, F>, "title" | "uiSchema" | "required" | "registry"> & {
368
+ declare type ArrayFieldTitleProps<T = any, F = any> = Omit<TitleFieldProps<T, F>, "id" | "title"> & {
369
+ /** The title for the field being rendered */
370
+ title?: string;
363
371
  /** The idSchema of the field in the hierarchy */
364
372
  idSchema: IdSchema<T>;
365
373
  };
366
374
  /** The properties that are passed to a `ArrayFieldDescriptionTemplate` implementation */
367
- declare type ArrayFieldDescriptionProps<T = any, F = any> = Pick<DescriptionFieldProps<T, F>, "description" | "registry"> & {
375
+ declare type ArrayFieldDescriptionProps<T = any, F = any> = Omit<DescriptionFieldProps<T, F>, "id" | "description"> & {
376
+ /** The description of the field being rendered */
377
+ description?: string | React.ReactElement;
368
378
  /** The idSchema of the field in the hierarchy */
369
379
  idSchema: IdSchema<T>;
370
- /** The uiSchema object for this description field */
371
- uiSchema?: UiSchema<T, F>;
372
380
  };
373
381
  /** The properties of each element in the ArrayFieldTemplateProps.items array */
374
382
  declare type ArrayFieldTemplateItemType<T = any, F = any> = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rjsf/utils",
3
- "version": "5.0.0-beta.10",
3
+ "version": "5.0.0-beta.11",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/utils.esm.js",
6
6
  "typings": "dist/index.d.ts",
@@ -75,5 +75,5 @@
75
75
  "url": "git+https://github.com/rjsf-team/react-jsonschema-form.git"
76
76
  },
77
77
  "license": "Apache-2.0",
78
- "gitHead": "0326c281fc057d488cf46b0646a4d48cf1cc04de"
78
+ "gitHead": "40b37e064796e4def11f50500ebaf11839191632"
79
79
  }