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
Copy file name to clipboardExpand all lines: packages/docs/docs/advanced-customization/custom-templates.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,7 +14,7 @@ In version 5, all existing `templates` were consolidated into a new `TemplatesTy
14
14
They can also be overloaded globally on the `Form` via the `templates` prop as well as globally or per-field through the `uiSchema`.
15
15
Further, many new templates were added or repurposed from existing `widgets` and `fields` in an effort to simplify the effort needed by theme authors to build new and/or maintain current themes.
16
16
These new templates can also be overridden by individual users to customize the specific needs of their application.
17
-
A special category of templates, `ButtonTemplates`, were also added to support the easy replacement of the `Submit` button on the form, the `Add` and `Remove` buttons associated with `additionalProperties` on objects and elements of arrays, as well as the `Move up` and `Move down` buttons used for reordering arrays.
17
+
A special category of templates, `ButtonTemplates`, were also added to support the easy replacement of the `Submit` button on the form, the `Add` and `Remove` buttons associated with `additionalProperties`and `patternProperties`on objects and elements of arrays, as well as the `Move up` and `Move down` buttons used for reordering arrays.
18
18
This category, unlike the others, can only be overridden globally via the `templates` prop on `Form`.
19
19
20
20
Below is the table that lists all the `templates`, their props interface, their `uiSchema` name and from where they originated in the previous version of RJSF:
@@ -461,7 +461,7 @@ The following props are passed to the `BaseInputTemplate`:
461
461
-`multiple`: A boolean value stating if the widget can accept multiple values;
462
462
-`onChange`: The value change event handler; call it with the new value every time it changes;
463
463
-`onChangeOverride`: A `BaseInputTemplate` implements a default `onChange` handler that it passes to the HTML input component to handle the `ChangeEvent`. Sometimes a widget may need to handle the `ChangeEvent` using custom logic. If that is the case, that widget should provide its own handler via this prop;
464
-
-`onKeyChange`: The key change event handler (only called for fields with `additionalProperties`); pass the new value every time it changes;
464
+
-`onKeyChange`: The key change event handler (only called for fields with `additionalProperties` and `patternProperties`); pass the new value every time it changes;
465
465
-`onBlur`: The input blur event handler; call it with the widget id and value;
466
466
-`onFocus`: The input focus event handler; call it with the widget id and value;
467
467
-`options`: A map of options passed as a prop to the component (see [Custom widget options](./custom-widgets-fields.md#custom-widget-options)).
@@ -807,7 +807,7 @@ The following props are passed to each `ObjectFieldTemplate` as defined by the `
807
807
-`description`: A string value containing the description for the object.
808
808
-`disabled`: A boolean value stating if the object is disabled.
809
809
-`properties`: An array of object representing the properties in the object. Each of the properties represent a child with properties described below.
810
-
-`onAddClick: (schema: RJSFSchema) => () => void`: Returns a function that adds a new property to the object (to be used with additionalProperties)
810
+
-`onAddClick: (schema: RJSFSchema) => () => void`: Returns a function that adds a new property to the object (to be used with additionalProperties and patternProperties)
811
811
-`readonly`: A boolean value stating if the object is read-only.
812
812
-`required`: A boolean value stating if the object is required.
813
813
-`hideError`: A boolean value stating if the field is hiding its errors.
@@ -908,8 +908,8 @@ The following props are passed to each `UnsupportedFieldTemplate`:
908
908
909
909
## WrapIfAdditionalTemplate
910
910
911
-
The `WrapIfAdditionalTemplate` is used by the `FieldTemplate` to conditionally render additional controls if `additionalProperties`is present in the schema.
912
-
You may customize `WrapIfAdditionalTemplate` if you wish to change the layout or behavior of user-controlled `additionalProperties`.
911
+
The `WrapIfAdditionalTemplate` is used by the `FieldTemplate` to conditionally render additional controls if `additionalProperties`or `patternProperties` are present in the schema.
912
+
You may customize `WrapIfAdditionalTemplate` if you wish to change the layout or behavior of user-controlled `additionalProperties` and `patternProperties`.
@@ -987,7 +987,7 @@ Each button template (except for the `SubmitButton`) accepts, as props, the stan
987
987
988
988
### AddButton
989
989
990
-
The `AddButton` is used to render an add action on a `Form` for both a new `additionalProperties` element for an object or a new element in an array.
990
+
The `AddButton` is used to render an add action on a `Form` for both a new `additionalProperties`or `patternProperties`element for an object or a new element in an array.
991
991
You can customize the `AddButton` to render something other than the icon button that is provided by a theme as follows:
992
992
993
993
```tsx
@@ -1077,7 +1077,7 @@ render(
1077
1077
1078
1078
### RemoveButton
1079
1079
1080
-
The `RemoveButton` is used to render a remove action on a `Form` for both a existing `additionalProperties` element for an object or an existing element in an array.
1080
+
The `RemoveButton` is used to render a remove action on a `Form` for both a existing `additionalProperties`or `patternProperties`element for an object or an existing element in an array.
1081
1081
You can customize the `RemoveButton` to render something other than the icon button that is provided by a theme as follows:
Copy file name to clipboardExpand all lines: packages/docs/docs/api-reference/form-props.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -464,7 +464,7 @@ Sometimes you may want to trigger events or modify external state when a field h
464
464
If you plan on being notified every time the form data are updated, you can pass an `onChange` handler, which will receive the same first argument as `onSubmit` any time a value is updated in the form.
465
465
It will also receive, as the second argument, the `id` of the field which experienced the change.
466
466
Generally, this will be the `id` of the field for which input data is modified.
467
-
In the case of adding/removing of new fields in arrays or objects with `additionalProperties` and the rearranging of items in arrays, the `id` will be that of the array or object itself, rather than the item/field being added, removed or moved.
467
+
In the case of adding/removing of new fields in arrays or objects with `additionalProperties`or `patternProperties`and the rearranging of items in arrays, the `id` will be that of the array or object itself, rather than the item/field being added, removed or moved.
0 commit comments