Methods
# inner AnyField(props) → {React.ReactElement|null}
AnyField is a wrapper around the various field types that implements the react-hook-form Controller
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
props |
object
|
||
control |
object
|
the react-hook-form control object | |
layout |
object
|
the layout object | |
rules |
object
|
<optional> |
the react-hook-form rules object (this is not used if using form level validation) |
disabled |
boolean
|
<optional> |
whether the field is disabled |
nestedName |
string
|
<optional> |
the name of the field if it is nested |
isNested |
boolean
|
<optional> |
whether the field is nested |
options |
FieldOptions
|
<optional> |
various options for the fields |
- the rendered AnyField
React.ReactElement
|
null
# inner checkboxRenderer(layout, fieldOptionsopt) → {React.ReactElement}
This is a custom renderer for MUI Checkboxes to work with react-hook-form
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
layout |
FieldLayout
|
Object containing the layout of the field | |
fieldOptions |
FieldOptions
|
<optional> |
Various options for the field |
A custom renderer for the MUI Checkbox component
React.ReactElement
# inner dateRenderer(layout, fieldOptionsopt) → {React.ReactElement}
This is a custom renderer for the MUI DatePicker component to work with react-hook-form
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
layout |
FieldLayout
|
Object containing the layout of the field | |
fieldOptions |
FieldOptions
|
<optional> |
Various options for the field |
A custom renderer for the MUI DatePicker component
React.ReactElement
# inner renderType(layout, fieldOptionsopt, nestedNameopt) → {React.ReactElement}
Return the correct renderer for the given type
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
layout |
FieldLayout
|
the layout object for the field | |
fieldOptions |
FieldOptions
|
<optional> |
various options for the fields |
nestedName |
string
|
<optional> |
the name of the field if it is nested |
- the rendered field
React.ReactElement
# inner textRenderer(layout, fieldOptionsopt) → {React.ReactElement}
This is a custom renderer for the MUI TextField component to work with react-hook-form
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
layout |
FieldLayout
|
Object containing the layout of the field | |
fieldOptions |
FieldOptions
|
<optional> |
Various options for the field |
A custom renderer for the MUI TextField component
React.ReactElement
# inner typeaheadRenderer(layout, fieldOptionsopt) → {React.ReactElement}
This is a custom renderer for our Typeahead component to work with react-hook-form
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
layout |
FieldLayout
|
Object containing the layout of the field | |
fieldOptions |
FieldOptions
|
<optional> |
Various options for the field |
A custom renderer for the MUI TextField component
React.ReactElement
Type Definitions
Object
# FieldIconOptions
Icons for info icons
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
color |
string
|
<optional> |
the color of the icon |
gap |
string
|
<optional> |
the gap between the label and the icon |
beforeLabel |
boolean
|
<optional> |
whether to display the icon before the label |
iconComponent |
React.Component
|
<optional> |
a component to use instead of the default InfoIcon |
iconText |
string
|
<optional> |
the text to display in the info icon |
Object
# FieldLabelThemeGroup
Theme group for the label
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
anyFieldLabel |
object
|
<optional> |
any theme properties to use for the box containing the label |
helperText |
object
|
<optional> |
any theme properties to use for the helper text |
Object
# FieldLayout
Various options for the fields
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
id |
string
|
the id of the field | |
name |
string
|
the name of the field | |
type |
string
|
the type of the field | |
label |
string
|
the label of the field | |
helperText |
string
|
<optional> |
the helper text of the field |
placeholder |
string
|
<optional> |
the placeholder of the field |
iconHelperText |
string
|
<optional> |
the helper text of the info icon |
altHelperText |
string
|
<optional> |
helper text to display in an alternate location |
required |
boolean
|
<optional> |
whether the field is required |
disabled |
boolean
|
<optional> |
whether the field is disabled |
hidden |
boolean
|
<optional> |
whether the field is hidden |
choices |
array
|
<optional> |
The choices for the field |
multiple |
boolean
|
<optional> |
whether the field is multi select |
isMultiLine |
boolean
|
<optional> |
whether the field is multiline |
Object
# FieldOptions
Various options for the fields
Properties:
Name | Type | Attributes | Description |
---|---|---|---|
icon |
FieldIconOptions
|
<optional> |
the options to pass to the info icon |
labelThemeGroup |
FieldLabelThemeGroup
|
<optional> |
the theme group to use for the label |