import { EventSubscription } from "@mongez/events"; import React from "react"; import { FormControl, FormControlValues, FormEventType, FormInterface, FormProps } from "./../types"; export declare class Form extends React.Component implements FormInterface { /** * {@inheritdoc} */ formElement: HTMLFormElement; /** * Form id */ protected formId: string; /** * Form event prefix */ protected formEventPrefix: string; /** * Form Controls */ protected formControls: FormControl[]; /** * Determine whether form validation is valid */ protected isValidForm: boolean; /** * Determine form submission state */ protected _isSubmitting: boolean; /** * Determine if form is disabled */ protected _isDisabled: boolean; /** * List of invalid controls */ protected invalidControls: FormControl[]; /** * List of valid controls */ protected validControls: FormControl[]; /** * {@inheritDoc} */ constructor(props: FormProps); /** * {@inheritDoc} */ change(name: string, value: any): void; /** * {@inheritDoc} */ componentWillUnmount(): void; /** * Mark the given form control as invalid control */ invalidControl(formControl: FormControl): void; /** * Mark the given form control as valid control */ validControl(formControl: FormControl): void; /** * Check and trigger form validation state */ checkIfIsValid: (this: unknown) => void; /** * Check and trigger form validation state */ protected _checkIfIsValid(): (this: unknown) => void; /** * Trigger form submission */ submitting(submitting: boolean): void; /** * Trigger form disable/enable state */ disable(isDisabled?: boolean): this; /** * Enable form */ enable(): this; /** * Determine whether the form is being submitted */ isSubmitting(): boolean; /** * Determine whether the form is valid, can be called after form validation */ isValid(): boolean; /** * Get form id */ get id(): string; /** * Form events method */ on(event: FormEventType, callback: (form: FormInterface) => void): EventSubscription; /** * Trigger form events */ trigger(event: FormEventType, ...values: any[]): any; /** * Trigger all form events */ triggerAll(event: FormEventType, ...values: any[]): import("@mongez/events").EventTriggerResponse; /** * Manually submit form */ submit(): void; /** * Trigger form validation */ validate(controls?: FormControl[]): Promise; /** * Trigger form validation only for visible elements in the dom * If formControlNames is passed, then it will be operated only on these names. */ validateVisible(): Promise; /** * Register form control */ register(formControl: FormControl): void; /** * Unregister form control from the form */ unregister(formControl: FormControl): void; /** * Get input by input value */ control(value: string, getBy?: "name" | "id"): FormControl | null; /** * Reset all form values and properties */ reset(): this; /** * Reset form errors */ resetErrors(): this; /** * Get value from form controls * */ value(FormControlName: string): any; /** * Get all form values */ values(formControlNames?: string[]): any; /** * Determine whether form should ignore empty values */ shouldIgnoreEmptyValues(): boolean; /** * Collect values for the given form control names */ collectValues(formControlNames?: string[]): FormControlValues; /** * Return value in form data format */ formData(): FormData; /** * Get all form controls list */ controls(formControls?: string[]): FormControl[]; /** * The onSubmit method that will be passed to the form element */ protected triggerSubmit(e: React.FormEvent): Promise; /** * {@inheritdoc} */ render(): any; } //# sourceMappingURL=Form.d.ts.map