buildForm
Overview
Builds the form configuration by setting up state management for fields, components, and widgets.
Signature
buildForm(props, state, getFieldComponent, getFieldProps, getWidgetComponent, getWidgetProps)
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| props | object | yes | The reactive props object containing form metadata. |
| state | object | yes | The target reactive object to manage for form state. |
| getFieldComponent | (field: FieldInfo) => Component | yes | Function to retrieve the component for a given field. |
| getFieldProps | (field: FieldInfo) => any | yes | Function to retrieve field-specific properties. |
| getWidgetComponent | (field: FieldInfo) => Component | yes | Function to retrieve the widget for a given field. |
| getWidgetProps | (field: FieldInfo) => any | yes | Function to retrieve widget-specific properties. |
props Properties
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| app | string | The app label. | ||
| model | string | The model name. | ||
| view | string | The view name. |
state Properties
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| fieldDetails | object | Details of each field by name. | ||
| fields | string[] | The list of field names. |
Returns
Functions for managing form configuration and updating reactive state.
Source
client/lib/utils/buildForm.js:82