use/useFormModelProps
Overview
Builds the props that a view binds on its FormModel, in the documented configuration precedence.
Three layers combine, and each later layer wins for the same key:
- The model config's
formPropsfor the view. - The
formPropsobject that the view received. - The view's own form props, such as
fieldsorfieldProps. A prop the view did not receive isundefined, and it leaves the earlier layers in place.
A later layer replaces an earlier layer's value whole. A fieldProps map passed to the view replaces the model config's fieldProps map, and does not merge with it key by key.
app, model, and view select the configuration that FormModel reads, so the view always sets them. The composable ignores those keys in either formProps layer and logs a console warning once per key.
Properties
FORM_MODEL_SELECTOR_PROPS
Props that select which configuration FormModel reads. A formProps layer cannot set them.
Type: typeOperator
Source: client/lib/use/useFormModelProps.js:21
VIEW_FORM_MODEL_PROPS
View props that a view forwards to FormModel under the same name. A view forwards its formModelVariant prop as variant.
Type: typeOperator
Source: client/lib/use/useFormModelProps.js:27
Methods
- formModelExpand - Returns the relations that a view's
FormModelrenders as inline fieldsets. - pickViewFormModelProps - Picks the form props that a view's options carry, keyed by
FormModelprop name. - useFormModelProps - Returns the props for a view's
FormModel, merged in the documented precedence.
Types
FormModelPropsOptions
Source
client/lib/use/useFormModelProps.js:1