useFormModelFieldSlots
Overview
Provide a FormModel's per-field slots to every FormModelField it contains, and report per-field slots that cannot reach a field.
Two mistakes throw in development and log a console warning in production:
- A
field(<path>)orwidget(<path>)slot whose path starts in no field of the form model. - A
#fieldslayout that renders noFormModelFieldwhile the form model has per-field slots. A plainFieldRendererdoes not receive the form model's slots.
Both checks run when the form model's fields load, after the fields render.
Signature
useFormModelFieldSlots(props, formModel, slots)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| props | object | yes | The FormModel props. |
| formModel | object | yes | The reactive form model. |
| slots | Readonly | yes | The FormModel's own useSlots() output. |
props Properties
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| app | string | |||
| model | string |
formModel Properties
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| app | string | The app name to load form configuration for | ||
| baseFieldNames | ReadonlySet | The field names that are not expanded. | ||
| expand | typeOperator | The fields to expand, either passed in or from config. | ||
| expandDetails | object | The merged expandDetails, either passed in, from config or from server info. | ||
| expandedFieldNames | ReadonlySet | The field names that are expanded and base. | ||
| expansionFieldNames | ReadonlySet | The field names that are expanded. | ||
| fieldComponents | object | The field components to use, either passed in or as a result of fieldObject or expandObject. | ||
| fieldDetails | object | The merged fieldDetails, either passed in, from config or from server info. | ||
| fields | typeOperator | The fields to display, either passed in or from config. | ||
| model | string | The model name to load form configuration for | ||
| view | string | The view name if wanting to use view specific configuration. | ||
| widgetComponents | object | The widget components to use, either passed in or as a result of fieldObject or expandObject. |
Returns
void
Source
client/lib/use/useFormModelFieldSlots.js:50