Module

FormTypes

Type Definitions

object

# FieldRenderProps

Properties:
Name Type Attributes Description
type string field type
label string field label
name string field name
hidden boolean if the field is hidden
required boolean <optional>
if the field is required
disabled boolean if the field is disabled
iconHelperText string icon helper text
helperText string helper text
requiredErrorText string required error text
readOnly boolean if the field is read only
multiple boolean <optional>
if the field is multiple
placeholder string <optional>
placeholder text
linkFormat object link format
choices Array.<object> <optional>
choices for the field
validations YupSchema validations for the field

View Source models/form.js, line 45

object

# FormSection

Properties:
Name Type Description
name string The name of the section
description string The description of the section
fields Array The fields in the section
visible boolean Whether the section is visible

View Source models/form.js, line 96

object

# FormSubmitOptions

Properties:
Name Type Description
enqueueSnackbar function function to enqueue a snackbar
nav function function to navigate to a url
modifying boolean true if the form is currently being modified
setModifying function function to set the modifying state

View Source models/form.js, line 104

object

# ParsedField

Properties:
Name Type Attributes Description
id string field id
label string field label
type string field type
hidden boolean if the field is hidden
conditions Array.<TriggerCondition> if the field is hidden
specialProps object special props for the field
defaultValue object <optional>
default value for the field
modelData object <optional>
model data for the field (found on the model.data)
subFields Array.<ParsedField> <optional>
subFields for the field if its type is FIELD_TYPES.CLUSTER (i.e. 100)
render FieldRenderProps render props for the field

View Source models/form.js, line 31

Object

# ParsedFormLayout

Properties:
Name Type Description
sections Array.<ParsedSection> array of parsed sections
fields Map.<String, Object> map of fieldId to field object
triggerFields Map.<String, Object> map of fieldId to field object

View Source models/form.js, line 7

Object

# ParsedSection

Properties:
Name Type Description
name string section name (title and name are both used for backwards compatibility)
title string section title
fields Array.<ParsedField> array of field objects
editable boolean if the section is editable
enabled Array if the section is enabled
order number order of the section

View Source models/form.js, line 14

object

# ProcessedDynamicFormLayout

Properties:
Name Type Description
defaultValues object The default values for the form
validations object The validation schema for the form
fieldsToWatch object The fields that need to be watched for changes

View Source models/form.js, line 24

object

# RowFields

Properties:
Name Type Description
fields Array.<ParsedField> array of fields in the row
size number column size of the row (12 is full width, 6 is half width, etc)
maxColumns number maximum number of columns in the row
solitary boolean true if the row is a solitary field
isInline boolean true if the row is an inline field

View Source models/form.js, line 112

object

# SubmitOptions

Properties:
Name Type Description
enqueueSnackbar function function to enqueue a snackbar
nav function function to navigate to a url
onSuccess function function to call on successful submit (if provided will NOT call setModifying OR nav)
formatSubmitError function function to format the error message
checkSuccess function function to check if the submit was successful
onError function function to call on error (if provided will NOT call setModifying)
unitLabel string label for the unit being submitted
successUrl string url to navigate to on success
submitUrl string url to submit to
setModifying function function to set the modifying state
formatSubmitMessage function function to format the success message
suppressSuccessToast boolean true to suppress the success toast
suppressErrorToast boolean true to suppress the error toast *

View Source models/form.js, line 64

object

# TriggerCondition

Properties:
Name Type Description
when string trigger field id
is string value to trigger on
then object conditions
isValid boolean if the field is valid

View Source models/form.js, line 81

object

# TriggerField

Properties:
Name Type Description
id string field id
fieldValues Map.<string, string> map of field values
touches Map.<string, string> map of fields that trigger field could influence

View Source models/form.js, line 89