@rjsf/utils 5.19.3 → 5.20.0

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/src/types.ts CHANGED
@@ -750,7 +750,7 @@ export interface WidgetProps<T = any, S extends StrictRJSFSchema = RJSFSchema, F
750
750
  /** The input blur event handler; call it with the widget id and value */
751
751
  onBlur: (id: string, value: any) => void;
752
752
  /** The value change event handler; call it with the new value every time it changes */
753
- onChange: (value: any) => void;
753
+ onChange: (value: any, es?: ErrorSchema<T>, id?: string) => void;
754
754
  /** The input focus event handler; call it with the widget id and value */
755
755
  onFocus: (id: string, value: any) => void;
756
756
  /** The computed label for this widget, as a string */
@@ -890,6 +890,8 @@ type UIOptionsBaseType<T = any, S extends StrictRJSFSchema = RJSFSchema, F exten
890
890
  * to look up an implementation from the `widgets` list or an actual one-off widget implementation itself
891
891
  */
892
892
  widget?: Widget<T, S, F> | string;
893
+ /** Allows a user to provide a list of labels for enum values in the schema */
894
+ enumNames?: string[];
893
895
  };
894
896
 
895
897
  /** The type that represents the Options potentially provided by `ui:options` */
@@ -1004,6 +1006,10 @@ export interface ValidatorType<T = any, S extends StrictRJSFSchema = RJSFSchema,
1004
1006
  * @param formData - The form data to validate
1005
1007
  */
1006
1008
  rawValidation<Result = any>(schema: S, formData?: T): { errors?: Result[]; validationError?: Error };
1009
+ /** An optional function that can be used to reset validator implementation. Useful for clear schemas in the AJV
1010
+ * instance for tests.
1011
+ */
1012
+ reset?: () => void;
1007
1013
  }
1008
1014
 
1009
1015
  /** The `SchemaUtilsType` interface provides a wrapper around the publicly exported APIs in the `@rjsf/utils/schema`