Interface: Field
@react-form-builder/core.Field
Field with the form data.
Implemented by
Properties
clear
• clear: () => void
Type declaration
▸ (): void
Clears the data in the field.
Returns
void
dispose
• dispose: () => void
Type declaration
▸ (): void
Releases allocated resources, must be used when destroying an object instance.
Returns
void
error
• Optional
error: string
Contains a field validation error if the field data is not valid.
errors
• Optional
errors: Record
<string
, unknown
>
Contains a field validation errors if the field provides multiple errors (i.e. field is template).
getValidationResult
• getValidationResult: () => Promise
<ValidationMessages
>
Type declaration
▸ (): Promise
<ValidationMessages
>
Returns the validation results without triggering an events and changing the state of the form.
Returns
Promise
<ValidationMessages
>
the ValidationMessages validation results.
init
• init: () => void
Type declaration
▸ (): void
Initializes the value of the field.
Returns
void
reset
• reset: () => void
Type declaration
▸ (): void
Sets the field to its default value.
Returns
void
setError
• setError: (error
: unknown
) => void
Type declaration
▸ (error
): void
Sets the error value.
Parameters
Name | Type | Description |
---|---|---|
error | unknown | The error value to be set. |
Returns
void
setTouched
• setTouched: () => void
Type declaration
▸ (): void
Marks the field as touched.
Returns
void
setValue
• setValue: (value
: unknown
) => void
Type declaration
▸ (value
): void
Sets the value of the field.
Parameters
Name | Type | Description |
---|---|---|
value | unknown | the value. |
Returns
void
storeDataInParentForm
• Optional
storeDataInParentForm: boolean
Flag, false if nested form data show as nested object, true otherwise.
touched
• touched: boolean
Flag, true, if the field is marked as touched.
validate
• validate: () => Promise
<void
>
Type declaration
▸ (): Promise
<void
>
Validates the field value.
Returns
Promise
<void
>
value
• value: unknown
Value of the field.
valued
• valued: string
The name of the component property that contains the field value.