Interface: Fielder<T, FieldName>
forms/types/Fielder.Fielder
Type parameters
Name | Type |
---|---|
T |
T |
FieldName |
extends keyof T |
Properties
attr
• attr: attrName
: AttrName
) => FieldSet
<T
>[FieldName
][AttrName
]
Type declaration
▸ <AttrName
>(attrName
): FieldSet
<T
>[FieldName
][AttrName
]
Grabs a specified attribute from a field's settings, such as its 'value' or its 'validators' array.
Type parameters
Name | Type |
---|---|
AttrName |
extends string |
Parameters
Name | Type |
---|---|
attrName |
AttrName |
Returns
FieldSet
<T
>[FieldName
][AttrName
]
Defined in
src/base/forms/types/Fielder.ts:19
cancelValidation
• cancelValidation: () => void
Type declaration
▸ (): void
Force cancel current validation run. We use this when submitting a form so our validators don't clobber whatever the server sends back.
Returns
void
Defined in
src/base/forms/types/Fielder.ts:65
controller
• controller: FormController
<T
>
Returns the FormController.
Defined in
src/base/forms/types/Fielder.ts:73
debounce
• debounce: FieldSet
<T
>[FieldName
]["debounce"
]
Returns the debounce rate set on the field.
Defined in
src/base/forms/types/Fielder.ts:51
disabled
• disabled: boolean
Returns a flag which indicates if the field should be considered disabled.
Defined in
src/base/forms/types/Fielder.ts:35
errors
• errors: FieldSet
<T
>[FieldName
]["errors"
]
Gets/sets the errors on a field.
Defined in
src/base/forms/types/Fielder.ts:39
fieldName
• fieldName: FieldName
Returns the name of the field
Defined in
src/base/forms/types/Fielder.ts:27
initialValue
• initialValue: T
[FieldName
]
Gets/sets the initial Value for this field. This is what is used to populate the field when the form is reset.
Defined in
src/base/forms/types/Fielder.ts:47
model
• model: T
[FieldName
]
Gets/sets the raw value of the field, triggering validation checks.
Defined in
src/base/forms/types/Fielder.ts:31
moduleType
• moduleType: "fielder"
Returns 'fielder
', the type of 'module' this wrapper handles. Technically fielders aren't modules,
since their state is shared with singles, however this makes it consistent with similarly behaving controllers,
which should have a moduleType
property for easy identification.
Defined in
src/base/forms/types/Fielder.ts:15
rawValue
• rawValue: T
[FieldName
]
Gets/sets the raw value of the field. Unlike model
, this does not trigger validation checks.
Defined in
src/base/forms/types/Fielder.ts:23
reset
• reset: () => void
Type declaration
▸ (): void
Resets this field to its initial value and clears errors.
Returns
void
Defined in
src/base/forms/types/Fielder.ts:69
runValidators
• runValidators: () => void
Type declaration
▸ (): void
Runs the validators on the form. Usually you don't want to call this directly-- instead, try the debounced validate() function.
Returns
void
Defined in
src/base/forms/types/Fielder.ts:56
step
• step: FieldSet
<T
>[FieldName
]["step"
]
Gets/sets the form step this field is on.
Defined in
src/base/forms/types/Fielder.ts:43
toJSON
• Private
toJSON: () => { controller
: string
; fieldName
: FieldName
; moduleType
: "fielder"
; value
: T
[FieldName
] }
Type declaration
▸ (): Object
Custom JSON serializer to prevent infinite loops during serialization.
Returns
Object
Name | Type |
---|---|
controller |
string |
fieldName |
FieldName |
moduleType |
"fielder" |
value |
T [FieldName ] |
Defined in
src/base/forms/types/Fielder.ts:79
validate
• validate: DebouncedFunc
<(...args
: any
) => any
>
Debounced call to runValidators. Especially helpful to avoid annoying users that are still typing.