You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Added new utility functions needed by LayoutGridForm (rjsf-team#4503)
* Added new utility functions needed by LayoutGridForm
Adding new functions to `@rjsf/utils` to support the upcoming `LayoutGridForm`
- Updated `@rjsf/utils` to add new types and functions in support of the `LayoutGridForm`
- Updated the `utility-functions.md` documentation for the new functions
- Updated the `v6.x upgrade guide.md` documentation for the new functions and types
- Updated the `CHANGELOG_V6.md` for the new functions and types
* - Fixed build and removed console.log
* Update packages/utils/src/schema/findSelectedOptionInXxxOf.ts
- Reviewer feedback
- Added a new `buttonId<T>(id: IdSchema<T> | string, btn: 'add' | 'copy' | 'moveDown' | 'moveUp' | 'remove')` used to generate consistent ids for RJSF buttons
71
+
- BREAKING CHANGE: Updated the `SchemaUtilsType` to add new validator-based functions to the interface
72
+
- Added the following new non-validator utility functions:
73
+
-`buttonId<T>(id: IdSchema<T> | string, btn: 'add' | 'copy' | 'moveDown' | 'moveUp' | 'remove')`: used to generate consistent ids for RJSF buttons
74
+
-`getTestIds(): TestIdShape`: Returns an object of test IDs that can only be used in test mode, helpful for writing unit tests for React components
75
+
-`hashObject(object: unknown): string`: Stringifies an `object` and returns the hash of the resulting string
76
+
-`hashString(string: string): string`: Hashes a string into hex format
77
+
-`lookupFromFormContext<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(regOrFc: Registry<T, S, F> | Registry<T, S, F>['formContext'], toLookup: string, fallback?: unknown)`: Given a React JSON Schema Form registry or formContext object, return the value associated with `toLookup`
78
+
- Added the following new validator-based utility functions:
79
+
-`findFieldInSchema<T = undefined, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(validator: ValidatorType<T, S, F>, rootSchema: S, path: string | string[], schema: S, formData?: T, experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>): FoundFieldType<S>`: Finds the field specified by the `path` within the root or recursed `schema`
80
+
-`findSelectedOptionInXxxOf<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(validator: ValidatorType<T, S, F>, rootSchema: S, schema: S, fallbackField: string,xxx: 'anyOf' | 'oneOf', formData?: T, experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>): S | undefined`: Finds the option that matches the selector field in the `schema` or undefined if nothing is selected
81
+
-`getFromSchema<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(validator: ValidatorType<T, S, F>, rootSchema: S, schema: S, path: string | string[], defaultValue: T | S, experimental_customMergeAllOf?: Experimental_CustomMergeAllOf<S>): T | S`: Helper that acts like lodash's `get` but additionally retrieves `$ref`s as needed to get the path for schemas
82
+
83
+
84
+
## @rjsf/validator-ajv6
85
+
86
+
- BREAKING CHANGE: This deprecated validator has been removed
0 commit comments