Methods
# inner getOpObj(option) → {object}
Helper method to get the option object can either be an object or just the value of the id
Parameters:
Name | Type | Description |
---|---|---|
option |
object
|
the option object
object
# inner Typeahead(props) → {React.ReactElement}
Wrapper of the Mui Autocomplete component
Prevent closing by clicking outside of the dialog by NOT passing in a handleClose prop
We need to forward the ref to the Autocomplete component for use with react-hook-form
https://reactjs.org/docs/forwarding-refs.html
renderSX is styling for the surrounding box
sx is styling for the Autocomplete component
labelSX is styling for the label
textFieldSX is styling for the text field this is another MUI wrapper contains an input and the dropdown icon
inputLabelSX is styling for the input inside the textField
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
props |
object
|
||
label |
string
|
<optional> |
the label to display |
isRequired |
boolean
|
<optional> |
is the field required |
items |
object
|
<optional> |
the items to display in the dropdown |
error |
object
|
<optional> |
the error message to display |
disabled |
boolean
|
<optional> |
is the field disabled |
renderSX |
object
|
<optional> |
the sx styling for the surrounding box |
sx |
object
|
<optional> |
the sx styling for the Autocomplete component |
labelSX |
object
|
<optional> |
the sx styling for the label |
textFieldSX |
object
|
<optional> |
the sx styling for the text field |
iconHelperText |
object
|
<optional> |
the text to display in the info icon |
altHelperText |
object
|
<optional> |
helper text to display above the field |
helperText |
object
|
<optional> |
the helper text to display (below the field) |
multiple |
boolean
|
<optional> |
is the field a multi-select |
fieldOptions |
object
|
<optional> |
the options to pass to the field |
textFieldProps |
object
|
<optional> |
props to pass to the text field |
textFieldProps.inputLabelProps |
object
|
<optional> |
props to pass to the input label |
textFieldProps.inputProps |
object
|
<optional> |
props to pass to the input |
React.ReactElement