@rjsf/utils 5.0.0-beta.14 → 5.0.0-beta.16
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/index.d.ts +95 -24
- package/dist/utils.cjs.development.js +503 -379
- package/dist/utils.cjs.development.js.map +1 -1
- package/dist/utils.cjs.production.min.js +1 -1
- package/dist/utils.cjs.production.min.js.map +1 -1
- package/dist/utils.esm.js +502 -380
- package/dist/utils.esm.js.map +1 -1
- package/dist/utils.umd.development.js +506 -383
- package/dist/utils.umd.development.js.map +1 -1
- package/dist/utils.umd.production.min.js +1 -1
- package/dist/utils.umd.production.min.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -388,6 +388,8 @@ declare type ArrayFieldTemplateItemType<T = any, S extends StrictRJSFSchema = RJ
|
|
|
388
388
|
className: string;
|
|
389
389
|
/** A boolean value stating if the array item is disabled */
|
|
390
390
|
disabled: boolean;
|
|
391
|
+
/** A boolean value stating whether new items can be added to the array */
|
|
392
|
+
canAdd: boolean;
|
|
391
393
|
/** A boolean value stating whether the array item can be moved down */
|
|
392
394
|
hasMoveDown: boolean;
|
|
393
395
|
/** A boolean value stating whether the array item can be moved up */
|
|
@@ -398,6 +400,8 @@ declare type ArrayFieldTemplateItemType<T = any, S extends StrictRJSFSchema = RJ
|
|
|
398
400
|
hasToolbar: boolean;
|
|
399
401
|
/** A number stating the index the array item occurs in `items` */
|
|
400
402
|
index: number;
|
|
403
|
+
/** A number stating the total number `items` in the array */
|
|
404
|
+
totalItems: number;
|
|
401
405
|
/** Returns a function that adds a new item at `index` */
|
|
402
406
|
onAddIndexClick: (index: number) => (event?: any) => void;
|
|
403
407
|
/** Returns a function that removes the item at `index` */
|
|
@@ -408,7 +412,9 @@ declare type ArrayFieldTemplateItemType<T = any, S extends StrictRJSFSchema = RJ
|
|
|
408
412
|
readonly: boolean;
|
|
409
413
|
/** A stable, unique key for the array item */
|
|
410
414
|
key: string;
|
|
411
|
-
/** The
|
|
415
|
+
/** The schema object for this array item */
|
|
416
|
+
schema: S;
|
|
417
|
+
/** The uiSchema object for this array item */
|
|
412
418
|
uiSchema?: UiSchema<T, S, F>;
|
|
413
419
|
/** The `registry` object */
|
|
414
420
|
registry: Registry<T, S, F>;
|
|
@@ -524,7 +530,7 @@ interface WidgetProps<T = any, S extends StrictRJSFSchema = RJSFSchema, F extend
|
|
|
524
530
|
*/
|
|
525
531
|
options: NonNullable<UIOptionsType<T, S, F>> & {
|
|
526
532
|
/** The enum options list for a type that supports them */
|
|
527
|
-
enumOptions?: EnumOptionsType[];
|
|
533
|
+
enumOptions?: EnumOptionsType<S>[];
|
|
528
534
|
};
|
|
529
535
|
/** The `formContext` object that you passed to `Form` */
|
|
530
536
|
formContext?: F;
|
|
@@ -549,6 +555,8 @@ declare type Widget<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends
|
|
|
549
555
|
declare type SubmitButtonProps<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any> = {
|
|
550
556
|
/** The uiSchema for this widget */
|
|
551
557
|
uiSchema?: UiSchema<T, S, F>;
|
|
558
|
+
/** The `registry` object */
|
|
559
|
+
registry: Registry<T, S, F>;
|
|
552
560
|
};
|
|
553
561
|
/** The type that defines the props for an Icon button, extending from a basic HTML button attributes */
|
|
554
562
|
declare type IconButtonProps<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any> = React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
@@ -558,6 +566,8 @@ declare type IconButtonProps<T = any, S extends StrictRJSFSchema = RJSFSchema, F
|
|
|
558
566
|
icon?: string | React.ReactElement;
|
|
559
567
|
/** The uiSchema for this widget */
|
|
560
568
|
uiSchema?: UiSchema<T, S, F>;
|
|
569
|
+
/** The `registry` object */
|
|
570
|
+
registry: Registry<T, S, F>;
|
|
561
571
|
};
|
|
562
572
|
/** The type that defines how to change the behavior of the submit button for the form */
|
|
563
573
|
declare type UISchemaSubmitButtonOptions = {
|
|
@@ -661,14 +671,14 @@ declare type UiSchema<T = any, S extends StrictRJSFSchema = RJSFSchema, F extend
|
|
|
661
671
|
/** An object that contains all the potential UI options in a single object */
|
|
662
672
|
"ui:options"?: UIOptionsType<T, S, F>;
|
|
663
673
|
};
|
|
664
|
-
/** A `CustomValidator` function takes in a `formData` and `
|
|
665
|
-
* while potentially adding additional messages to the `errors`
|
|
674
|
+
/** A `CustomValidator` function takes in a `formData`, `errors` and `uiSchema` objects and returns the given `errors`
|
|
675
|
+
* object back, while potentially adding additional messages to the `errors`
|
|
666
676
|
*/
|
|
667
|
-
declare type CustomValidator<T = any> = (formData: T, errors: FormValidation<T>) => FormValidation<T>;
|
|
668
|
-
/** An `ErrorTransformer` function will take in a list of `errors` and potentially return a
|
|
669
|
-
* errors in what ever way it deems necessary
|
|
677
|
+
declare type CustomValidator<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any> = (formData: T, errors: FormValidation<T>, uiSchema?: UiSchema<T, S, F>) => FormValidation<T>;
|
|
678
|
+
/** An `ErrorTransformer` function will take in a list of `errors` & a `uiSchema` and potentially return a
|
|
679
|
+
* transformation of those errors in what ever way it deems necessary
|
|
670
680
|
*/
|
|
671
|
-
declare type ErrorTransformer = (errors: RJSFValidationError[]) => RJSFValidationError[];
|
|
681
|
+
declare type ErrorTransformer<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any> = (errors: RJSFValidationError[], uiSchema?: UiSchema<T, S, F>) => RJSFValidationError[];
|
|
672
682
|
/** The type that describes the data that is returned from the `ValidatorType.validateFormData()` function */
|
|
673
683
|
declare type ValidationData<T> = {
|
|
674
684
|
/** The validation errors as a list of `RJSFValidationError` objects */
|
|
@@ -679,7 +689,7 @@ declare type ValidationData<T> = {
|
|
|
679
689
|
/** The interface that describes the validation functions that are provided by a Validator implementation used by the
|
|
680
690
|
* schema utilities.
|
|
681
691
|
*/
|
|
682
|
-
interface ValidatorType<T = any, S extends StrictRJSFSchema = RJSFSchema> {
|
|
692
|
+
interface ValidatorType<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any> {
|
|
683
693
|
/** This function processes the `formData` with an optional user contributed `customValidate` function, which receives
|
|
684
694
|
* the form data and a `errorHandler` function that will be used to add custom validation errors for each field. Also
|
|
685
695
|
* supports a `transformErrors` function that will take the raw AJV validation errors, prior to custom validation and
|
|
@@ -689,8 +699,9 @@ interface ValidatorType<T = any, S extends StrictRJSFSchema = RJSFSchema> {
|
|
|
689
699
|
* @param schema - The schema against which to validate the form data
|
|
690
700
|
* @param [customValidate] - An optional function that is used to perform custom validation
|
|
691
701
|
* @param [transformErrors] - An optional function that is used to transform errors after AJV validation
|
|
702
|
+
* @param [uiSchema] - An optional uiSchema that is passed to `transformErrors` and `customValidate`
|
|
692
703
|
*/
|
|
693
|
-
validateFormData(formData: T | undefined, schema: S, customValidate?: CustomValidator<T>, transformErrors?: ErrorTransformer): ValidationData<T>;
|
|
704
|
+
validateFormData(formData: T | undefined, schema: S, customValidate?: CustomValidator<T, S, F>, transformErrors?: ErrorTransformer<T, S, F>, uiSchema?: UiSchema<T, S, F>): ValidationData<T>;
|
|
694
705
|
/** Converts an `errorSchema` into a list of `RJSFValidationErrors`
|
|
695
706
|
*
|
|
696
707
|
* @param errorSchema - The `ErrorSchema` instance to convert
|
|
@@ -727,7 +738,7 @@ interface SchemaUtilsType<T = any, S extends StrictRJSFSchema = RJSFSchema, F ex
|
|
|
727
738
|
*
|
|
728
739
|
* @returns - The `ValidatorType`
|
|
729
740
|
*/
|
|
730
|
-
getValidator(): ValidatorType<T, S>;
|
|
741
|
+
getValidator(): ValidatorType<T, S, F>;
|
|
731
742
|
/** Determines whether either the `validator` and `rootSchema` differ from the ones associated with this instance of
|
|
732
743
|
* the `SchemaUtilsType`. If either `validator` or `rootSchema` are falsy, then return false to prevent the creation
|
|
733
744
|
* of a new `SchemaUtilsType` with incomplete properties.
|
|
@@ -736,7 +747,7 @@ interface SchemaUtilsType<T = any, S extends StrictRJSFSchema = RJSFSchema, F ex
|
|
|
736
747
|
* @param rootSchema - The root schema that will be compared against the current one
|
|
737
748
|
* @returns - True if the `SchemaUtilsType` differs from the given `validator` or `rootSchema`
|
|
738
749
|
*/
|
|
739
|
-
doesSchemaUtilsDiffer(validator: ValidatorType<T, S>, rootSchema: S): boolean;
|
|
750
|
+
doesSchemaUtilsDiffer(validator: ValidatorType<T, S, F>, rootSchema: S): boolean;
|
|
740
751
|
/** Returns the superset of `formData` that includes the given set updated to include any missing fields that have
|
|
741
752
|
* computed to have defaults provided in the `schema`.
|
|
742
753
|
*
|
|
@@ -858,7 +869,7 @@ declare function canExpand<T = any, S extends StrictRJSFSchema = RJSFSchema, F e
|
|
|
858
869
|
* @param rootSchema - The root schema that will be forwarded to all the APIs
|
|
859
870
|
* @returns - An implementation of a `SchemaUtilsType` interface
|
|
860
871
|
*/
|
|
861
|
-
declare function createSchemaUtils<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(validator: ValidatorType<T, S>, rootSchema: S): SchemaUtilsType<T, S, F>;
|
|
872
|
+
declare function createSchemaUtils<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(validator: ValidatorType<T, S, F>, rootSchema: S): SchemaUtilsType<T, S, F>;
|
|
862
873
|
|
|
863
874
|
/** Given the `FileReader.readAsDataURL()` based `dataURI` extracts that data into an actual Blob along with the name
|
|
864
875
|
* of that Blob if provided in the URL. If no name is provided, then the name falls back to `unknown`.
|
|
@@ -880,6 +891,66 @@ declare function dataURItoBlob(dataURI: string): {
|
|
|
880
891
|
*/
|
|
881
892
|
declare function deepEquals(a: any, b: any): boolean;
|
|
882
893
|
|
|
894
|
+
/** The `ErrorSchemaBuilder<T>` is used to build an `ErrorSchema<T>` since the definition of the `ErrorSchema` type is
|
|
895
|
+
* designed for reading information rather than writing it. Use this class to add, replace or clear errors in an error
|
|
896
|
+
* schema by using either dotted path or an array of path names. Once you are done building the `ErrorSchema`, you can
|
|
897
|
+
* get the result and/or reset all the errors back to an initial set and start again.
|
|
898
|
+
*/
|
|
899
|
+
declare class ErrorSchemaBuilder<T = any> {
|
|
900
|
+
/** The error schema being built
|
|
901
|
+
*
|
|
902
|
+
* @private
|
|
903
|
+
*/
|
|
904
|
+
private errorSchema;
|
|
905
|
+
/** Construct an `ErrorSchemaBuilder` with an optional initial set of errors in an `ErrorSchema`.
|
|
906
|
+
*
|
|
907
|
+
* @param [initialSchema] - The optional set of initial errors, that will be cloned into the class
|
|
908
|
+
*/
|
|
909
|
+
constructor(initialSchema?: ErrorSchema<T>);
|
|
910
|
+
/** Returns the `ErrorSchema` that has been updated by the methods of the `ErrorSchemaBuilder`
|
|
911
|
+
*/
|
|
912
|
+
get ErrorSchema(): ErrorSchema<T>;
|
|
913
|
+
/** Will get an existing `ErrorSchema` at the specified `pathOfError` or create and return one.
|
|
914
|
+
*
|
|
915
|
+
* @param [pathOfError] - The optional path into the `ErrorSchema` at which to add the error(s)
|
|
916
|
+
* @returns - The error block for the given `pathOfError` or the root if not provided
|
|
917
|
+
* @private
|
|
918
|
+
*/
|
|
919
|
+
private getOrCreateErrorBlock;
|
|
920
|
+
/** Resets all errors in the `ErrorSchemaBuilder` back to the `initialSchema` if provided, otherwise an empty set.
|
|
921
|
+
*
|
|
922
|
+
* @param [initialSchema] - The optional set of initial errors, that will be cloned into the class
|
|
923
|
+
* @returns - The `ErrorSchemaBuilder` object for chaining purposes
|
|
924
|
+
*/
|
|
925
|
+
resetAllErrors(initialSchema?: ErrorSchema<T>): this;
|
|
926
|
+
/** Adds the `errorOrList` to the list of errors in the `ErrorSchema` at either the root level or the location within
|
|
927
|
+
* the schema described by the `pathOfError`. For more information about how to specify the path see the
|
|
928
|
+
* [eslint lodash plugin docs](https://github.com/wix/eslint-plugin-lodash/blob/master/docs/rules/path-style.md).
|
|
929
|
+
*
|
|
930
|
+
* @param errorOrList - The error or list of errors to add into the `ErrorSchema`
|
|
931
|
+
* @param [pathOfError] - The optional path into the `ErrorSchema` at which to add the error(s)
|
|
932
|
+
* @returns - The `ErrorSchemaBuilder` object for chaining purposes
|
|
933
|
+
*/
|
|
934
|
+
addErrors(errorOrList: string | string[], pathOfError?: string | string[]): this;
|
|
935
|
+
/** Sets/replaces the `errorOrList` as the error(s) in the `ErrorSchema` at either the root level or the location
|
|
936
|
+
* within the schema described by the `pathOfError`. For more information about how to specify the path see the
|
|
937
|
+
* [eslint lodash plugin docs](https://github.com/wix/eslint-plugin-lodash/blob/master/docs/rules/path-style.md).
|
|
938
|
+
*
|
|
939
|
+
* @param errorOrList - The error or list of errors to set into the `ErrorSchema`
|
|
940
|
+
* @param [pathOfError] - The optional path into the `ErrorSchema` at which to set the error(s)
|
|
941
|
+
* @returns - The `ErrorSchemaBuilder` object for chaining purposes
|
|
942
|
+
*/
|
|
943
|
+
setErrors(errorOrList: string | string[], pathOfError?: string | string[]): this;
|
|
944
|
+
/** Clears the error(s) in the `ErrorSchema` at either the root level or the location within the schema described by
|
|
945
|
+
* the `pathOfError`. For more information about how to specify the path see the
|
|
946
|
+
* [eslint lodash plugin docs](https://github.com/wix/eslint-plugin-lodash/blob/master/docs/rules/path-style.md).
|
|
947
|
+
*
|
|
948
|
+
* @param [pathOfError] - The optional path into the `ErrorSchema` at which to clear the error(s)
|
|
949
|
+
* @returns - The `ErrorSchemaBuilder` object for chaining purposes
|
|
950
|
+
*/
|
|
951
|
+
clearErrors(pathOfError?: string | string[]): this;
|
|
952
|
+
}
|
|
953
|
+
|
|
883
954
|
/** Given the name of a `$ref` from within a schema, using the `rootSchema`, look up and return the sub-schema using the
|
|
884
955
|
* path provided by that reference. If `#` is not the first character of the reference, or the path does not exist in
|
|
885
956
|
* the schema, then throw an Error. Otherwise return the sub-schema. Also deals with nested `$ref`s in the sub-schema.
|
|
@@ -1189,7 +1260,7 @@ declare const UI_OPTIONS_KEY = "ui:options";
|
|
|
1189
1260
|
* object properties.
|
|
1190
1261
|
* @returns - The resulting `formData` with all the defaults provided
|
|
1191
1262
|
*/
|
|
1192
|
-
declare function getDefaultFormState<T = any, S extends StrictRJSFSchema = RJSFSchema>(validator: ValidatorType<T, S>, theSchema: S, formData?: T, rootSchema?: S, includeUndefinedValues?: boolean | "excludeObjectChildren"): T | T[] | undefined;
|
|
1263
|
+
declare function getDefaultFormState<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(validator: ValidatorType<T, S, F>, theSchema: S, formData?: T, rootSchema?: S, includeUndefinedValues?: boolean | "excludeObjectChildren"): T | T[] | undefined;
|
|
1193
1264
|
|
|
1194
1265
|
/** Determines whether the combination of `schema` and `uiSchema` properties indicates that the label for the `schema`
|
|
1195
1266
|
* should be displayed in a UI.
|
|
@@ -1200,7 +1271,7 @@ declare function getDefaultFormState<T = any, S extends StrictRJSFSchema = RJSFS
|
|
|
1200
1271
|
* @param [rootSchema] - The root schema, used to primarily to look up `$ref`s
|
|
1201
1272
|
* @returns - True if the label should be displayed or false if it should not
|
|
1202
1273
|
*/
|
|
1203
|
-
declare function getDisplayLabel<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(validator: ValidatorType<T, S>, schema: S, uiSchema?: UiSchema<T, S, F>, rootSchema?: S): boolean;
|
|
1274
|
+
declare function getDisplayLabel<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(validator: ValidatorType<T, S, F>, schema: S, uiSchema?: UiSchema<T, S, F>, rootSchema?: S): boolean;
|
|
1204
1275
|
|
|
1205
1276
|
/** Given the `formData` and list of `options`, attempts to find the index of the option that best matches the data.
|
|
1206
1277
|
*
|
|
@@ -1210,7 +1281,7 @@ declare function getDisplayLabel<T = any, S extends StrictRJSFSchema = RJSFSchem
|
|
|
1210
1281
|
* @param rootSchema - The root schema, used to primarily to look up `$ref`s
|
|
1211
1282
|
* @returns - The index of the matched option or 0 if none is available
|
|
1212
1283
|
*/
|
|
1213
|
-
declare function getMatchingOption<T = any, S extends StrictRJSFSchema = RJSFSchema>(validator: ValidatorType<T, S>, formData: T | undefined, options: S[], rootSchema: S): number;
|
|
1284
|
+
declare function getMatchingOption<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(validator: ValidatorType<T, S, F>, formData: T | undefined, options: S[], rootSchema: S): number;
|
|
1214
1285
|
|
|
1215
1286
|
/** Checks to see if the `schema` and `uiSchema` combination represents an array of files
|
|
1216
1287
|
*
|
|
@@ -1220,7 +1291,7 @@ declare function getMatchingOption<T = any, S extends StrictRJSFSchema = RJSFSch
|
|
|
1220
1291
|
* @param [rootSchema] - The root schema, used to primarily to look up `$ref`s
|
|
1221
1292
|
* @returns - True if schema/uiSchema contains an array of files, otherwise false
|
|
1222
1293
|
*/
|
|
1223
|
-
declare function isFilesArray<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(validator: ValidatorType<T, S>, schema: S, uiSchema?: UiSchema<T, S, F>, rootSchema?: S): boolean;
|
|
1294
|
+
declare function isFilesArray<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(validator: ValidatorType<T, S, F>, schema: S, uiSchema?: UiSchema<T, S, F>, rootSchema?: S): boolean;
|
|
1224
1295
|
|
|
1225
1296
|
/** Checks to see if the `schema` combination represents a multi-select
|
|
1226
1297
|
*
|
|
@@ -1229,7 +1300,7 @@ declare function isFilesArray<T = any, S extends StrictRJSFSchema = RJSFSchema,
|
|
|
1229
1300
|
* @param [rootSchema] - The root schema, used to primarily to look up `$ref`s
|
|
1230
1301
|
* @returns - True if schema contains a multi-select, otherwise false
|
|
1231
1302
|
*/
|
|
1232
|
-
declare function isMultiSelect<T = any, S extends StrictRJSFSchema = RJSFSchema>(validator: ValidatorType<T, S>, schema: S, rootSchema?: S): boolean;
|
|
1303
|
+
declare function isMultiSelect<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(validator: ValidatorType<T, S, F>, schema: S, rootSchema?: S): boolean;
|
|
1233
1304
|
|
|
1234
1305
|
/** Checks to see if the `schema` combination represents a select
|
|
1235
1306
|
*
|
|
@@ -1238,7 +1309,7 @@ declare function isMultiSelect<T = any, S extends StrictRJSFSchema = RJSFSchema>
|
|
|
1238
1309
|
* @param [rootSchema] - The root schema, used to primarily to look up `$ref`s
|
|
1239
1310
|
* @returns - True if schema contains a select, otherwise false
|
|
1240
1311
|
*/
|
|
1241
|
-
declare function isSelect<T = any, S extends StrictRJSFSchema = RJSFSchema>(validator: ValidatorType<T, S>, theSchema: S, rootSchema?: S): boolean;
|
|
1312
|
+
declare function isSelect<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(validator: ValidatorType<T, S, F>, theSchema: S, rootSchema?: S): boolean;
|
|
1242
1313
|
|
|
1243
1314
|
/** Merges the errors in `additionalErrorSchema` into the existing `validationData` by combining the hierarchies in the
|
|
1244
1315
|
* two `ErrorSchema`s and then appending the error list from the `additionalErrorSchema` obtained by calling
|
|
@@ -1250,7 +1321,7 @@ declare function isSelect<T = any, S extends StrictRJSFSchema = RJSFSchema>(vali
|
|
|
1250
1321
|
* @param [additionalErrorSchema] - The additional set of errors in an `ErrorSchema`
|
|
1251
1322
|
* @returns - The `validationData` with the additional errors from `additionalErrorSchema` merged into it, if provided.
|
|
1252
1323
|
*/
|
|
1253
|
-
declare function mergeValidationData<T = any, S extends StrictRJSFSchema = RJSFSchema>(validator: ValidatorType<T, S>, validationData: ValidationData<T>, additionalErrorSchema?: ErrorSchema<T>): ValidationData<T>;
|
|
1324
|
+
declare function mergeValidationData<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(validator: ValidatorType<T, S, F>, validationData: ValidationData<T>, additionalErrorSchema?: ErrorSchema<T>): ValidationData<T>;
|
|
1254
1325
|
|
|
1255
1326
|
/** Retrieves an expanded schema that has had all of its conditions, additional properties, references and dependencies
|
|
1256
1327
|
* resolved and merged into the `schema` given a `validator`, `rootSchema` and `rawFormData` that is used to do the
|
|
@@ -1262,7 +1333,7 @@ declare function mergeValidationData<T = any, S extends StrictRJSFSchema = RJSFS
|
|
|
1262
1333
|
* @param [rawFormData] - The current formData, if any, to assist retrieving a schema
|
|
1263
1334
|
* @returns - The schema having its conditions, additional properties, references and dependencies resolved
|
|
1264
1335
|
*/
|
|
1265
|
-
declare function retrieveSchema<T = any, S extends StrictRJSFSchema = RJSFSchema>(validator: ValidatorType<T, S>, schema: S, rootSchema?: S, rawFormData?: T): S;
|
|
1336
|
+
declare function retrieveSchema<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(validator: ValidatorType<T, S, F>, schema: S, rootSchema?: S, rawFormData?: T): S;
|
|
1266
1337
|
|
|
1267
1338
|
/** Generates an `IdSchema` object for the `schema`, recursively
|
|
1268
1339
|
*
|
|
@@ -1275,7 +1346,7 @@ declare function retrieveSchema<T = any, S extends StrictRJSFSchema = RJSFSchema
|
|
|
1275
1346
|
* @param [idSeparator='_'] - The separator to use for the path segments in the id
|
|
1276
1347
|
* @returns - The `IdSchema` object for the `schema`
|
|
1277
1348
|
*/
|
|
1278
|
-
declare function toIdSchema<T = any, S extends StrictRJSFSchema = RJSFSchema>(validator: ValidatorType<T, S>, schema: S, id?: string | null, rootSchema?: S, formData?: T, idPrefix?: string, idSeparator?: string): IdSchema<T>;
|
|
1349
|
+
declare function toIdSchema<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(validator: ValidatorType<T, S, F>, schema: S, id?: string | null, rootSchema?: S, formData?: T, idPrefix?: string, idSeparator?: string): IdSchema<T>;
|
|
1279
1350
|
|
|
1280
1351
|
/** Generates an `PathSchema` object for the `schema`, recursively
|
|
1281
1352
|
*
|
|
@@ -1286,6 +1357,6 @@ declare function toIdSchema<T = any, S extends StrictRJSFSchema = RJSFSchema>(va
|
|
|
1286
1357
|
* @param [formData] - The current formData, if any, to assist retrieving a schema
|
|
1287
1358
|
* @returns - The `PathSchema` object for the `schema`
|
|
1288
1359
|
*/
|
|
1289
|
-
declare function toPathSchema<T = any, S extends StrictRJSFSchema = RJSFSchema>(validator: ValidatorType<T, S>, schema: S, name?: string, rootSchema?: S, formData?: T): PathSchema<T>;
|
|
1360
|
+
declare function toPathSchema<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(validator: ValidatorType<T, S, F>, schema: S, name?: string, rootSchema?: S, formData?: T): PathSchema<T>;
|
|
1290
1361
|
|
|
1291
|
-
export { ADDITIONAL_PROPERTIES_KEY, ADDITIONAL_PROPERTY_FLAG, ALL_OF_KEY, ANY_OF_KEY, ArrayFieldDescriptionProps, ArrayFieldTemplateItemType, ArrayFieldTemplateProps, ArrayFieldTitleProps, CONST_KEY, CustomValidator, DEFAULT_KEY, DEFINITIONS_KEY, DEPENDENCIES_KEY, DateObject, DescriptionFieldProps, ENUM_KEY, ERRORS_KEY, EnumOptionsType, ErrorListProps, ErrorSchema, ErrorTransformer, Field, FieldError, FieldErrorProps, FieldErrors, FieldHelpProps, FieldId, FieldPath, FieldProps, FieldTemplateProps, FieldValidation, FormContextType, FormValidation, GenericObjectType, ID_KEY, ITEMS_KEY, IconButtonProps, IdSchema, InputPropsType, NAME_KEY, ONE_OF_KEY, ObjectFieldTemplatePropertyType, ObjectFieldTemplateProps, PROPERTIES_KEY, PathSchema, REF_KEY, REQUIRED_KEY, RJSFSchema, RJSFValidationError, RJSF_ADDITONAL_PROPERTIES_FLAG, RangeSpecType, Registry, RegistryFieldsType, RegistryWidgetsType, SUBMIT_BTN_OPTIONS_KEY, SchemaUtilsType, StrictRJSFSchema, SubmitButtonProps, TemplatesType, TitleFieldProps, UIOptionsType, UISchemaSubmitButtonOptions, UI_FIELD_KEY, UI_OPTIONS_KEY, UI_WIDGET_KEY, UiSchema, UnsupportedFieldProps, ValidationData, ValidatorType, Widget, WidgetProps, WrapIfAdditionalTemplateProps, allowAdditionalItems, asNumber, canExpand, createSchemaUtils, dataURItoBlob, deepEquals, findSchemaDefinition, getDefaultFormState, getDisplayLabel, getInputProps, getMatchingOption, getSchemaType, getSubmitButtonOptions, getTemplate, getUiOptions, getWidget, guessType, hasWidget, isConstant, isCustomWidget, isFilesArray, isFixedItems, isMultiSelect, isObject, isSelect, localToUTC, mergeDefaultsWithFormData, mergeObjects, mergeSchemas, mergeValidationData, optionsList, orderProperties, pad, parseDateString, processSelectValue, rangeSpec, retrieveSchema, schemaRequiresTrueValue, shouldRender, toConstant, toDateString, toIdSchema, toPathSchema, utcToLocal };
|
|
1362
|
+
export { ADDITIONAL_PROPERTIES_KEY, ADDITIONAL_PROPERTY_FLAG, ALL_OF_KEY, ANY_OF_KEY, ArrayFieldDescriptionProps, ArrayFieldTemplateItemType, ArrayFieldTemplateProps, ArrayFieldTitleProps, CONST_KEY, CustomValidator, DEFAULT_KEY, DEFINITIONS_KEY, DEPENDENCIES_KEY, DateObject, DescriptionFieldProps, ENUM_KEY, ERRORS_KEY, EnumOptionsType, ErrorListProps, ErrorSchema, ErrorSchemaBuilder, ErrorTransformer, Field, FieldError, FieldErrorProps, FieldErrors, FieldHelpProps, FieldId, FieldPath, FieldProps, FieldTemplateProps, FieldValidation, FormContextType, FormValidation, GenericObjectType, ID_KEY, ITEMS_KEY, IconButtonProps, IdSchema, InputPropsType, NAME_KEY, ONE_OF_KEY, ObjectFieldTemplatePropertyType, ObjectFieldTemplateProps, PROPERTIES_KEY, PathSchema, REF_KEY, REQUIRED_KEY, RJSFSchema, RJSFValidationError, RJSF_ADDITONAL_PROPERTIES_FLAG, RangeSpecType, Registry, RegistryFieldsType, RegistryWidgetsType, SUBMIT_BTN_OPTIONS_KEY, SchemaUtilsType, StrictRJSFSchema, SubmitButtonProps, TemplatesType, TitleFieldProps, UIOptionsType, UISchemaSubmitButtonOptions, UI_FIELD_KEY, UI_OPTIONS_KEY, UI_WIDGET_KEY, UiSchema, UnsupportedFieldProps, ValidationData, ValidatorType, Widget, WidgetProps, WrapIfAdditionalTemplateProps, allowAdditionalItems, asNumber, canExpand, createSchemaUtils, dataURItoBlob, deepEquals, findSchemaDefinition, getDefaultFormState, getDisplayLabel, getInputProps, getMatchingOption, getSchemaType, getSubmitButtonOptions, getTemplate, getUiOptions, getWidget, guessType, hasWidget, isConstant, isCustomWidget, isFilesArray, isFixedItems, isMultiSelect, isObject, isSelect, localToUTC, mergeDefaultsWithFormData, mergeObjects, mergeSchemas, mergeValidationData, optionsList, orderProperties, pad, parseDateString, processSelectValue, rangeSpec, retrieveSchema, schemaRequiresTrueValue, shouldRender, toConstant, toDateString, toIdSchema, toPathSchema, utcToLocal };
|