Module

ConfigForm

Methods

# inner ConfigForm(props) → {React.ReactElement}

Configurable form wrapper. Parses PAM style layout and waits and then wraps the children in a DynamicForm
Parameters:
Name Type Attributes Description
props object
formLayout object the layout of the form. This component should not be rendered until the formLayout is loaded
data object <optional>
the data to populate the form with
parseOptions object <optional>
options to pass to the parser
urlDomain string <optional>
the domain to use for the API calls
renderLoading function <optional>
the function to render while the form is loading
addCustomValidations function <optional>
a function to add custom validations to the form - MUST be a function that returns an object of validation functions
children object the children to render

View Source stories/ConfigForm/ConfigForm.jsx, line 14

- the wrapped children
React.ReactElement
Example
<ConfigForm formLayout={formLayout} data={data} parseOptions={{ choiceFormatter: choiceFormatter2 }}>
 <MyForm />
</ConfigForm>

# inner ConfigFormProvider(props) → {React.ReactElement}

Wraps any children in a FormProvider and sets up the useFormContext values See GenericConfigForm for a complete example of how to implement the the React Hook Form context
Parameters:
Name Type Attributes Description
props object props object
layout object the layout object (a parsed form layout)
data object <optional>
the data to populate the form with
urlDomain string <optional>
the domain to use for the API calls
options object <optional>
options to pass to the parser
children object the children to render
addCustomValidations function <optional>
a function to add custom validations to the form - MUST be a function that returns an object of validation functions

View Source stories/ConfigForm/ConfigForm.jsx, line 68

- the wrapped children
React.ReactElement
Example
<DynamicForm layout={layout} data={data}><MyForm /></DynamicForm>