API Reference
- JavaScript Reference
- Classes / FieldApi
- Classes / FormApi
- Functions / formOptions
- Functions / mergeForm
- Interfaces / FieldApiOptions
- Interfaces / FieldOptions
- Interfaces / FieldValidators
- Interfaces / FormOptions
- Interfaces / FormValidators
- Types / DeepKeys
- Types / DeepValue
- Types / AnyFieldMeta
- Types / BaseFormState
- Types / DerivedFormState
- Types / Updater
- Types / UpdaterFn
- Types / ValidationError
- Types / ValidationMeta
- React Reference
- Variables / Field
- Functions / useField
- Functions / useForm
- Types / FieldComponent
- Types / UseField
FormGroupApi
Defined in: packages/form-core/src/FormGroupApi.ts:970
Type Parameters#
TParentData#
TParentData
TName#
TName extends DeepKeys<TParentData>
TData#
TData extends DeepValue<TParentData, TName>
TOnMount#
TOnMount extends undefined | FormGroupValidateOrFn<TParentData, TName, TData>
TOnChange#
TOnChange extends undefined | FormGroupValidateOrFn<TParentData, TName, TData>
TOnChangeAsync#
TOnChangeAsync extends | undefined | FormGroupAsyncValidateOrFn<TParentData, TName, TData>
TOnBlur#
TOnBlur extends undefined | FormGroupValidateOrFn<TParentData, TName, TData>
TOnBlurAsync#
TOnBlurAsync extends | undefined | FormGroupAsyncValidateOrFn<TParentData, TName, TData>
TOnSubmit#
TOnSubmit extends undefined | FormGroupValidateOrFn<TParentData, TName, TData>
TOnSubmitAsync#
TOnSubmitAsync extends | undefined | FormGroupAsyncValidateOrFn<TParentData, TName, TData>
TOnDynamic#
TOnDynamic extends undefined | FormGroupValidateOrFn<TParentData, TName, TData>
TOnDynamicAsync#
TOnDynamicAsync extends | undefined | FormGroupAsyncValidateOrFn<TParentData, TName, TData>
TSubmitMeta#
TSubmitMeta
TFormOnMount#
TFormOnMount extends undefined | FormValidateOrFn<TParentData>
TFormOnChange#
TFormOnChange extends undefined | FormValidateOrFn<TParentData>
TFormOnChangeAsync#
TFormOnChangeAsync extends undefined | FormAsyncValidateOrFn<TParentData>
TFormOnBlur#
TFormOnBlur extends undefined | FormValidateOrFn<TParentData>
TFormOnBlurAsync#
TFormOnBlurAsync extends undefined | FormAsyncValidateOrFn<TParentData>
TFormOnSubmit#
TFormOnSubmit extends undefined | FormValidateOrFn<TParentData>
TFormOnSubmitAsync#
TFormOnSubmitAsync extends undefined | FormAsyncValidateOrFn<TParentData>
TFormOnDynamic#
TFormOnDynamic extends undefined | FormValidateOrFn<TParentData>
TFormOnDynamicAsync#
TFormOnDynamicAsync extends undefined | FormAsyncValidateOrFn<TParentData>
TFormOnServer#
TFormOnServer extends undefined | FormAsyncValidateOrFn<TParentData>
TParentSubmitMeta#
TParentSubmitMeta
Constructors#
Constructor#
new FormGroupApi<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TSubmitMeta, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnDynamic, TFormOnDynamicAsync, TFormOnServer, TParentSubmitMeta>(opts): FormGroupApi<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TSubmitMeta, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnDynamic, TFormOnDynamicAsync, TFormOnServer, TParentSubmitMeta>;Defined in: packages/form-core/src/FormGroupApi.ts:1217
Parameters#
opts#
FormGroupApiOptions<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TSubmitMeta, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnDynamic, TFormOnDynamicAsync, TFormOnServer, TParentSubmitMeta>
Returns#
FormGroupApi<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TSubmitMeta, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnDynamic, TFormOnDynamicAsync, TFormOnServer, TParentSubmitMeta>
Properties#
form#
form: FormApi<TParentData, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnDynamic, TFormOnDynamicAsync, TFormOnServer, TParentSubmitMeta>;Defined in: packages/form-core/src/FormGroupApi.ts:1079
A reference to the form API instance.
Implementation of#
FieldLikeAPI.formname#
name: TName;Defined in: packages/form-core/src/FormGroupApi.ts:1108
The field name.
Implementation of#
FieldLikeAPI.nameoptions#
options: FormGroupApiOptions<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TSubmitMeta, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnDynamic, TFormOnDynamicAsync, TFormOnServer, TParentSubmitMeta>;Defined in: packages/form-core/src/FormGroupApi.ts:1112
The field options.
Implementation of#
FieldLikeAPI.optionsstore#
store: ReadonlyStore<FormGroupStoreState<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnDynamic, TFormOnDynamicAsync>>;Defined in: packages/form-core/src/FormGroupApi.ts:1141
The field state store.
Implementation of#
FieldLikeAPI.storetimeoutIds#
timeoutIds: object;Defined in: packages/form-core/src/FormGroupApi.ts:1199
formListeners#
formListeners: Record<ListenerCause, ReturnType<typeof setTimeout> | null>;listeners#
listeners: Record<ListenerCause, ReturnType<typeof setTimeout> | null>;validations#
validations: Record<ValidationCause, ReturnType<typeof setTimeout> | null>;Accessors#
state#
Get Signature#
get state(): FormGroupStoreState<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnDynamic, TFormOnDynamicAsync>;Defined in: packages/form-core/src/FormGroupApi.ts:1169
The current field state.
Returns#
FormGroupStoreState<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnDynamic, TFormOnDynamicAsync>
Methods#
_handleSubmit()#
_handleSubmit(submitMeta?): Promise<void>;Defined in: packages/form-core/src/FormGroupApi.ts:2404
Handles the form submission, performs validation, and calls the appropriate onSubmit or onSubmitInvalid callbacks.
Parameters#
submitMeta?#
TSubmitMeta
Returns#
Promise<void>
areRelatedFieldsValid()#
areRelatedFieldsValid(): boolean;Defined in: packages/form-core/src/FormGroupApi.ts:2293
Returns#
boolean
clearFieldValues()#
clearFieldValues<TField>(field): void;Defined in: packages/form-core/src/FormGroupApi.ts:2274
Type Parameters#
TField#
TField extends string
Parameters#
field#
TField
Returns#
void
Implementation of#
FormLikeAPI.clearFieldValuesdeleteField()#
deleteField<TField>(field): void;Defined in: packages/form-core/src/FormGroupApi.ts:2229
Type Parameters#
TField#
TField extends string
Parameters#
field#
TField
Returns#
void
Implementation of#
FormLikeAPI.deleteFieldgetFieldMeta()#
getFieldMeta<TField>(field): AnyFieldLikeMeta | undefined;Defined in: packages/form-core/src/FormGroupApi.ts:2209
Type Parameters#
TField#
TField extends string
Parameters#
field#
TField
Returns#
AnyFieldLikeMeta | undefined
Implementation of#
FormLikeAPI.getFieldMetagetFieldValue()#
getFieldValue<TField>(field): DeepValue<TParentData, TField>;Defined in: packages/form-core/src/FormGroupApi.ts:2203
Type Parameters#
TField#
TField extends string
Parameters#
field#
TField
Returns#
DeepValue<TParentData, TField>
Implementation of#
FormLikeAPI.getFieldValuegetInfo()#
getInfo(): FieldInfo<TParentData>;Defined in: packages/form-core/src/FormGroupApi.ts:1636
Gets the field information object.
Returns#
FieldInfo<TParentData>
Implementation of#
FieldLikeAPI.getInfogetMeta()#
getMeta(): FormGroupMeta<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnDynamic, TFormOnDynamicAsync>;Defined in: packages/form-core/src/FormGroupApi.ts:1600
Returns#
FormGroupMeta<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnDynamic, TFormOnDynamicAsync>
Implementation of#
FieldLikeAPI.getMetahandleSubmit()#
Call Signature#
handleSubmit(): Promise<void>;Defined in: packages/form-core/src/FormGroupApi.ts:2395
Handles the form submission, performs validation, and calls the appropriate onSubmit or onSubmitInvalid callbacks.
Returns#
Promise<void>
Implementation of#
FormLikeAPI.handleSubmitCall Signature#
handleSubmit(submitMeta): Promise<void>;Defined in: packages/form-core/src/FormGroupApi.ts:2396
Parameters#
submitMeta#
TSubmitMeta
Returns#
Promise<void>
Implementation of#
FormLikeAPI.handleSubmitinsertFieldValue()#
insertFieldValue<TField>(
field,
index,
value): Promise<void>;Defined in: packages/form-core/src/FormGroupApi.ts:2242
Type Parameters#
TField#
TField extends string
Parameters#
field#
TField
index#
number
value#
any
Returns#
Promise<void>
Implementation of#
FormLikeAPI.insertFieldValuemount()#
mount(): () => void;Defined in: packages/form-core/src/FormGroupApi.ts:1447
Returns#
(): void;Returns#
void
Implementation of#
FieldLikeAPI.mountmoveFieldValues()#
moveFieldValues<TField>(
field,
fromIndex,
toIndex): void;Defined in: packages/form-core/src/FormGroupApi.ts:2266
Type Parameters#
TField#
TField extends string
Parameters#
field#
TField
fromIndex#
number
toIndex#
number
Returns#
void
Implementation of#
FormLikeAPI.moveFieldValuespushFieldValue()#
pushFieldValue<TField>(field, value): void;Defined in: packages/form-core/src/FormGroupApi.ts:2235
Type Parameters#
TField#
TField extends string
Parameters#
field#
TField
value#
any
Returns#
void
Implementation of#
FormLikeAPI.pushFieldValueremoveFieldValue()#
removeFieldValue<TField>(field, index): Promise<void>;Defined in: packages/form-core/src/FormGroupApi.ts:2286
Type Parameters#
TField#
TField extends string
Parameters#
field#
TField
index#
number
Returns#
Promise<void>
Implementation of#
FormLikeAPI.removeFieldValuereplaceFieldValue()#
replaceFieldValue<TField>(
field,
index,
value): Promise<void>;Defined in: packages/form-core/src/FormGroupApi.ts:2250
Type Parameters#
TField#
TField extends string
Parameters#
field#
TField
index#
number
value#
any
Returns#
Promise<void>
Implementation of#
FormLikeAPI.replaceFieldValueresetField()#
resetField<TField>(field): void;Defined in: packages/form-core/src/FormGroupApi.ts:2280
Type Parameters#
TField#
TField extends string
Parameters#
field#
TField
Returns#
void
Implementation of#
FormLikeAPI.resetFieldsetFieldMeta()#
setFieldMeta<TField>(field, updater): void;Defined in: packages/form-core/src/FormGroupApi.ts:2215
Type Parameters#
TField#
TField extends string
Parameters#
field#
TField
updater#
Updater<AnyFieldLikeMetaBase>
Returns#
void
Implementation of#
FormLikeAPI.setFieldMetasetFieldValue()#
setFieldValue<TField>(field, value): void;Defined in: packages/form-core/src/FormGroupApi.ts:2222
Type Parameters#
TField#
TField extends string
Parameters#
field#
TField
value#
any
Returns#
void
Implementation of#
FormLikeAPI.setFieldValuesetMeta()#
setMeta(updater): void;Defined in: packages/form-core/src/FormGroupApi.ts:1605
Sets the field metadata.
Parameters#
updater#
Updater<FieldLikeMetaBase<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnDynamic, TFormOnDynamicAsync>>
Returns#
void
Implementation of#
FieldLikeAPI.setMetasetValue()#
setValue(updater, options?): void;Defined in: packages/form-core/src/FormGroupApi.ts:1584
Sets the field value and run the change validator.
Parameters#
updater#
Updater<TData>
options?#
UpdateMetaOptions
Returns#
void
Implementation of#
FieldLikeAPI.setValueswapFieldValues()#
swapFieldValues<TField>(
field,
index1,
index2): void;Defined in: packages/form-core/src/FormGroupApi.ts:2258
Type Parameters#
TField#
TField extends string
Parameters#
field#
TField
index1#
number
index2#
number
Returns#
void
Implementation of#
FormLikeAPI.swapFieldValuesupdate()#
update(opts): void;Defined in: packages/form-core/src/FormGroupApi.ts:1356
Updates the field instance with new options.
Parameters#
opts#
FormGroupApiOptions<TParentData, TName, TData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TSubmitMeta, TFormOnMount, TFormOnChange, TFormOnChangeAsync, TFormOnBlur, TFormOnBlurAsync, TFormOnSubmit, TFormOnSubmitAsync, TFormOnDynamic, TFormOnDynamicAsync, TFormOnServer, TParentSubmitMeta>
Returns#
void
validate()#
validate(cause, opts?): unknown[] | Promise<unknown[]>;Defined in: packages/form-core/src/FormGroupApi.ts:2302
Validates the form group and all related children.
Parameters#
cause#
ValidationCause
opts?#
skipFormValidation?#
boolean
skipRelatedFieldValidation?#
boolean
Returns#
unknown[] | Promise<unknown[]>
Implementation of#
FieldLikeAPI.validatevalidateAllFields()#
validateAllFields(cause): Promise<unknown[]>;Defined in: packages/form-core/src/FormGroupApi.ts:2158
Validates all fields according to the FIELD level validators. This will ignore FORM level validators, use form.validate({ValidationCause}) for a complete validation
Parameters#
cause#
ValidationCause
Returns#
Promise<unknown[]>
Implementation of#
FormLikeAPI.validateAllFieldsvalidateArrayFieldsStartingFrom()#
validateArrayFieldsStartingFrom<TField>(
field,
index,
cause): Promise<unknown[]>;Defined in: packages/form-core/src/FormGroupApi.ts:2186
Type Parameters#
TField#
TField extends string
Parameters#
field#
TField
index#
number
cause#
ValidationCause
Returns#
Promise<unknown[]>
Implementation of#
FormLikeAPI.validateArrayFieldsStartingFromvalidateField()#
validateField<TField>(field, cause): any[] | Promise<any[]>;Defined in: packages/form-core/src/FormGroupApi.ts:2196
Type Parameters#
TField#
TField extends string
Parameters#
field#
TField
cause#
ValidationCause
Returns#
any[] | Promise<any[]>
Implementation of#
FormLikeAPI.validateField