@rjsf/utils 5.0.0-beta.6 → 5.0.0-beta.9
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 +46 -8
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -109,7 +109,7 @@ declare type FieldValidation = FieldErrors & {
|
|
|
109
109
|
declare type FormValidation<T = any> = FieldValidation & {
|
|
110
110
|
[key in keyof T]?: FormValidation<T[key]>;
|
|
111
111
|
};
|
|
112
|
-
/** The properties that are passed to an `
|
|
112
|
+
/** The properties that are passed to an `ErrorListTemplate` implementation */
|
|
113
113
|
declare type ErrorListProps<T = any, F = any> = {
|
|
114
114
|
/** The errorSchema constructed by `Form` */
|
|
115
115
|
errorSchema: ErrorSchema<T>;
|
|
@@ -122,6 +122,36 @@ declare type ErrorListProps<T = any, F = any> = {
|
|
|
122
122
|
/** The uiSchema that was passed to `Form` */
|
|
123
123
|
uiSchema?: UiSchema<T, F>;
|
|
124
124
|
};
|
|
125
|
+
/** The properties that are passed to an `FieldErrorTemplate` implementation */
|
|
126
|
+
declare type FieldErrorProps<T = any, F = any> = {
|
|
127
|
+
/** The errorSchema constructed by `Form` */
|
|
128
|
+
errorSchema?: ErrorSchema<T>;
|
|
129
|
+
/** An array of the errors */
|
|
130
|
+
errors?: Array<string | React.ReactElement>;
|
|
131
|
+
/** The tree of unique ids for every child field */
|
|
132
|
+
idSchema: IdSchema<T>;
|
|
133
|
+
/** The schema that was passed to field */
|
|
134
|
+
schema: RJSFSchema;
|
|
135
|
+
/** The uiSchema that was passed to field */
|
|
136
|
+
uiSchema?: UiSchema<T, F>;
|
|
137
|
+
/** The `registry` object */
|
|
138
|
+
registry: Registry<T, F>;
|
|
139
|
+
};
|
|
140
|
+
/** The properties that are passed to an `FieldHelpTemplate` implementation */
|
|
141
|
+
declare type FieldHelpProps<T = any, F = any> = {
|
|
142
|
+
/** The help information to be rendered */
|
|
143
|
+
help?: string | React.ReactElement;
|
|
144
|
+
/** The tree of unique ids for every child field */
|
|
145
|
+
idSchema: IdSchema<T>;
|
|
146
|
+
/** The schema that was passed to field */
|
|
147
|
+
schema: RJSFSchema;
|
|
148
|
+
/** The uiSchema that was passed to field */
|
|
149
|
+
uiSchema?: UiSchema<T, F>;
|
|
150
|
+
/** Flag indicating whether there are errors associated with this field */
|
|
151
|
+
hasErrors?: boolean;
|
|
152
|
+
/** The `registry` object */
|
|
153
|
+
registry: Registry<T, F>;
|
|
154
|
+
};
|
|
125
155
|
/** The set of `Fields` stored in the `Registry` */
|
|
126
156
|
declare type RegistryFieldsType<T = any, F = any> = {
|
|
127
157
|
/** A `Field` indexed by `name` */
|
|
@@ -146,8 +176,12 @@ interface TemplatesType<T = any, F = any> {
|
|
|
146
176
|
BaseInputTemplate: React.ComponentType<WidgetProps<T, F>>;
|
|
147
177
|
/** The template to use for rendering the description of a field */
|
|
148
178
|
DescriptionFieldTemplate: React.ComponentType<DescriptionFieldProps<T, F>>;
|
|
149
|
-
/** The template to use while rendering
|
|
179
|
+
/** The template to use while rendering the errors for the whole form */
|
|
150
180
|
ErrorListTemplate: React.ComponentType<ErrorListProps<T, F>>;
|
|
181
|
+
/** The template to use while rendering the errors for a single field */
|
|
182
|
+
FieldErrorTemplate: React.ComponentType<FieldErrorProps<T, F>>;
|
|
183
|
+
/** The template to use while rendering the errors for a single field */
|
|
184
|
+
FieldHelpTemplate: React.ComponentType<FieldHelpProps<T, F>>;
|
|
151
185
|
/** The template to use while rendering a field */
|
|
152
186
|
FieldTemplate: React.ComponentType<FieldTemplateProps<T, F>>;
|
|
153
187
|
/** The template to use while rendering an object */
|
|
@@ -161,13 +195,13 @@ interface TemplatesType<T = any, F = any> {
|
|
|
161
195
|
/** The template to use for the main `Submit` button */
|
|
162
196
|
SubmitButton: React.ComponentType<SubmitButtonProps<T, F>>;
|
|
163
197
|
/** The template to use for the Add button used for AdditionalProperties and Array items */
|
|
164
|
-
AddButton: React.ComponentType<IconButtonProps
|
|
198
|
+
AddButton: React.ComponentType<IconButtonProps<T, F>>;
|
|
165
199
|
/** The template to use for the Move Down button used for Array items */
|
|
166
|
-
MoveDownButton: React.ComponentType<IconButtonProps
|
|
200
|
+
MoveDownButton: React.ComponentType<IconButtonProps<T, F>>;
|
|
167
201
|
/** The template to use for the Move Up button used for Array items */
|
|
168
|
-
MoveUpButton: React.ComponentType<IconButtonProps
|
|
202
|
+
MoveUpButton: React.ComponentType<IconButtonProps<T, F>>;
|
|
169
203
|
/** The template to use for the Remove button used for AdditionalProperties and Array items */
|
|
170
|
-
RemoveButton: React.ComponentType<IconButtonProps
|
|
204
|
+
RemoveButton: React.ComponentType<IconButtonProps<T, F>>;
|
|
171
205
|
};
|
|
172
206
|
}
|
|
173
207
|
/** The object containing the registered core, theme and custom fields and widgets as well as the root schema, form
|
|
@@ -362,6 +396,8 @@ declare type ArrayFieldTemplateItemType<T = any, F = any> = {
|
|
|
362
396
|
readonly: boolean;
|
|
363
397
|
/** A stable, unique key for the array item */
|
|
364
398
|
key: string;
|
|
399
|
+
/** The uiSchema object for this field */
|
|
400
|
+
uiSchema?: UiSchema<T, F>;
|
|
365
401
|
/** The `registry` object */
|
|
366
402
|
registry: Registry<T, F>;
|
|
367
403
|
};
|
|
@@ -498,11 +534,13 @@ declare type SubmitButtonProps<T = any, F = any> = {
|
|
|
498
534
|
uiSchema?: UiSchema<T, F>;
|
|
499
535
|
};
|
|
500
536
|
/** The type that defines the props for an Icon button, extending from a basic HTML button attributes */
|
|
501
|
-
declare type IconButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
537
|
+
declare type IconButtonProps<T = any, F = any> = React.ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
502
538
|
/** An alternative specification for the type of the icon button */
|
|
503
539
|
iconType?: string;
|
|
504
540
|
/** The name representation or actual react element implementation for the icon */
|
|
505
541
|
icon?: string | React.ReactElement;
|
|
542
|
+
/** The uiSchema for this widget */
|
|
543
|
+
uiSchema?: UiSchema<T, F>;
|
|
506
544
|
};
|
|
507
545
|
/** The type that defines how to change the behavior of the submit button for the form */
|
|
508
546
|
declare type UISchemaSubmitButtonOptions = {
|
|
@@ -1218,4 +1256,4 @@ declare function toIdSchema<T = any>(validator: ValidatorType, schema: RJSFSchem
|
|
|
1218
1256
|
*/
|
|
1219
1257
|
declare function toPathSchema<T = any>(validator: ValidatorType, schema: RJSFSchema, name?: string, rootSchema?: RJSFSchema, formData?: T): PathSchema<T>;
|
|
1220
1258
|
|
|
1221
|
-
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, FieldErrors, FieldId, FieldPath, FieldProps, FieldTemplateProps, FieldValidation, FormValidation, GenericObjectType, ID_KEY, ITEMS_KEY, IconButtonProps, IdSchema, InputPropsType, NAME_KEY, ONE_OF_KEY, ObjectFieldTemplatePropertyType, ObjectFieldTemplateProps, PROPERTIES_KEY, PathSchema, REF_KEY, REQUIRED_KEY, RJSFSchema, RJSFSchemaDefinition, RJSFValidationError, RJSF_ADDITONAL_PROPERTIES_FLAG, RangeSpecType, Registry, RegistryFieldsType, RegistryWidgetsType, SUBMIT_BTN_OPTIONS_KEY, SchemaUtilsType, SubmitButtonProps, TemplatesType, TitleFieldProps, UIOptionsType, UISchemaSubmitButtonOptions, UI_FIELD_KEY, UI_OPTIONS_KEY, UI_WIDGET_KEY, UiSchema, UnsupportedFieldProps, ValidationData, ValidatorType, Widget, WidgetProps, 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 };
|
|
1259
|
+
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, FormValidation, GenericObjectType, ID_KEY, ITEMS_KEY, IconButtonProps, IdSchema, InputPropsType, NAME_KEY, ONE_OF_KEY, ObjectFieldTemplatePropertyType, ObjectFieldTemplateProps, PROPERTIES_KEY, PathSchema, REF_KEY, REQUIRED_KEY, RJSFSchema, RJSFSchemaDefinition, RJSFValidationError, RJSF_ADDITONAL_PROPERTIES_FLAG, RangeSpecType, Registry, RegistryFieldsType, RegistryWidgetsType, SUBMIT_BTN_OPTIONS_KEY, SchemaUtilsType, SubmitButtonProps, TemplatesType, TitleFieldProps, UIOptionsType, UISchemaSubmitButtonOptions, UI_FIELD_KEY, UI_OPTIONS_KEY, UI_WIDGET_KEY, UiSchema, UnsupportedFieldProps, ValidationData, ValidatorType, Widget, WidgetProps, 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 };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rjsf/utils",
|
|
3
|
-
"version": "5.0.0-beta.
|
|
3
|
+
"version": "5.0.0-beta.9",
|
|
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": "
|
|
78
|
+
"gitHead": "6a0a58190ff616344d80c558a755cda1835954f6"
|
|
79
79
|
}
|