Skip to content

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>) or widget(<path>) slot whose path starts in no field of the form model.
  • A #fields layout that renders no FormModelField while the form model has per-field slots. A plain FieldRenderer does 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 ​

NameTypeRequiredDescription
propsobjectyesThe FormModel props.
formModelobjectyesThe reactive form model.
slotsReadonlyyesThe FormModel's own useSlots() output.

props Properties ​

NameTypeRequiredDefaultDescription
appstring
modelstring

formModel Properties ​

NameTypeRequiredDefaultDescription
appstringThe app name to load form configuration for
baseFieldNamesReadonlySetThe field names that are not expanded.
expandtypeOperatorThe fields to expand, either passed in or from config.
expandDetailsobjectThe merged expandDetails, either passed in, from config or from server info.
expandedFieldNamesReadonlySetThe field names that are expanded and base.
expansionFieldNamesReadonlySetThe field names that are expanded.
fieldComponentsobjectThe field components to use, either passed in or as a result of fieldObject or expandObject.
fieldDetailsobjectThe merged fieldDetails, either passed in, from config or from server info.
fieldstypeOperatorThe fields to display, either passed in or from config.
modelstringThe model name to load form configuration for
viewstringThe view name if wanting to use view specific configuration.
widgetComponentsobjectThe widget components to use, either passed in or as a result of fieldObject or expandObject.

Returns ​

void

Source ​

client/lib/use/useFormModelFieldSlots.js:50