The field to use as a template for the new control
Optional
replaceExisting: booleanReplace existing control with the same name when parent is not an array type
Control that was added
Add a new value to array
Value to add to the array
Optional
mustBeUnique: booleanShould the value be unique (default = false)
Optional
setAsDirty: booleanShould the dirty state be set to true
Optional
emitEvent: booleanAdd new control to the form array.
Add new controls to the form array.
Unsubscribe from all subscriptions for current control
Run value through field's dispatcher and set the result as the new value
Find control with identifier. Searches all child controls recursively and returns the first match.
name, index or key of the control. Provide an array of identifiers to get nested control.
The control that was found or added or null if control doesn't exist.
In some cases type of an attribute is not known by the compiler. Use this method to get the attribute with correct type.
Get all active sibling controls as an array
Array of active sibling controls
Get control with identifier
name, index or key of the control. Provide an array of identifiers to get nested control.
The control that was found or added or null if control doesn't exist.
Get all controls that match required states
Get the control's field's value
Get control or add it if it doesn't exist. NOTE: If grouping is array this method might not work as expected as arrays allow multiple controls with the same name!
The field to use as a template for the new control
The control that was found or added
Get sibling control with identifier
name, index or key of the control
The control that was found or added or null if control doesn't exist.
Get all sibling controls as an array
Array of sibling controls
Check if control exists
name, index or key of the control
boolean
Moves a child control to a new index in the array.
name, index or key of the control to move
Move control to another index
Set value of the control group by updating it's childrens values. Unlike setValue, this method will not delete children values if they are not present in the new value.
Optional
setAsDirty: booleanupdate dirty state to true
Optional
emitEvent: booleanFind control where query function returns true. Can search all child controls recursively to get all matches in the tree.
Query function that returns true if control matches
Optional
recursive: booleanShould the query be run recursively
The control that was found or undefined if control doesn't exist.
Register a new resolver
MargaritaFormResolver
Resubscribe to all subscriptions for current control
Remove the control from the parent
Removes a child control from the form group.
name, index or key of the control to remove
Remove a value from array
Value to remove from the array
Optional
setAsDirty: booleanShould the dirty state be set to true
Optional
emitEvent: booleanConnect control to a HTML element.
Set value of the control
value to set
Optional
setAsDirty: booleanupdate dirty state to true
Optional
emitEvent: booleanSubmit the form. If the form is invalid, the invalid submit handler will be called. Define submit handlers in the field's handleSubmit property. You can define a different handler for valid and invalid submits but only valid submit handler is required. If handleSubmit is a function it will be used as the valid handler. If handleSubmit or handleSubmit.valid is a string, it will be used as a url for a POST request.
Toggle a value in array
Value to add or remove from the array
Optional
mustBeUnique: booleanShould the value be unique when adding (default = true)
Optional
setAsDirty: booleanShould the dirty state be set to true
Optional
emitEvent: booleanValidate the control and update state. Mark the control as touched to show errors.
Optional
setAsTouched: booleanSet the touched state to true
Static
configStatic
contextStatic
extensionsStatic
managersStatic
statesStatic
validatorsGet all active controls as an array
Get all controls as an array
Get the control's reference to a HTML element
Check if control's output should be an array
Check if control's output should be an group / object
Check if control's output should be merged to parent
Check if control's output should be an group / object
Get the way how the child controls should be grouped
Check if control has any active child controls
Check if control has any child controls
Check if the control's value is the same as the default value
Check if the control's value is the same as the initial value. Warning: this works properly only in the root level. Use defaultValue and isDefaultValue to add checks for child controls
Get resolvers for the control
Listen to value changes of the control
Get all visible controls as an array
Optional
global: booleanInternal
Optional
params: PARAMSStatic
addStatic
addStatic
addStatic
addRest
...states: ((state: StateManager<MFC>) => BooleanPairState | GeneralState<unknown> | DerivedState<unknown>)[]Static
addStatic
extendStatic
extendStatic
removeStatic
removeStatic
removeStatic
set
Add new control to the form group.