@rjsf/utils 5.0.0-beta.6 → 5.0.0-beta.8

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 +37 -3
  2. 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 `ErrorList` implementation */
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?: string[];
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 form errors */
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 */
@@ -1218,4 +1252,4 @@ declare function toIdSchema<T = any>(validator: ValidatorType, schema: RJSFSchem
1218
1252
  */
1219
1253
  declare function toPathSchema<T = any>(validator: ValidatorType, schema: RJSFSchema, name?: string, rootSchema?: RJSFSchema, formData?: T): PathSchema<T>;
1220
1254
 
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 };
1255
+ 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.6",
3
+ "version": "5.0.0-beta.8",
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": "dfc8bbca60113fc5a78302b2ed79e3ea9b16241b"
78
+ "gitHead": "8e6a64e6b398f01bf04b1e64a0d4982196bdc05c"
79
79
  }