laravel-jstools
Version:
JS tools for building front-side of Laravel applications
79 lines (78 loc) • 3.79 kB
TypeScript
import { Service } from 'laravel-jstools-di';
import { FormContract } from './contracts/FormContract';
import { FormValidateServiceContract } from '../../services/FormValidateService/contracts/FormValidateServiceContract';
import { ValidateErrorListInterface } from '../../services/ValidateService/interfaces/ValidateErrorListInterface';
import { AnyObjInterface } from '../../interfaces/AnyObjInterface';
import { ModalContract } from '../Modal/contracts/ModalContract';
import { ContextTypeEnum } from '../../types/ContextTypeEnum';
import { FormDataInterface } from './interfaces/FormDataInterface';
import { RuleListInterface } from '../../services/ValidateService/interfaces/RuleListInterface';
export declare abstract class Form extends Service implements FormContract {
protected serviceDependsList: string[];
private modal;
protected validateService: FormValidateServiceContract;
protected formId: string;
protected formData: FormDataInterface;
protected showNoty: boolean;
protected componentsOptions: AnyObjInterface;
protected components: AnyObjInterface;
protected ruleList: RuleListInterface;
protected isSending: boolean;
protected defaultValues: AnyObjInterface;
protected defaultAction: string;
protected defaultMethod: string;
protected submitCallback: any;
protected preSubmitCallback: any;
protected afterSubmitCallback: any;
protected extraSpinners: any;
protected initData: AnyObjInterface;
constructor(formId: string, formData: FormDataInterface, showNoty: boolean, componentsOptions: AnyObjInterface, validateService: FormValidateServiceContract);
protected isAjax(): boolean;
protected isNoSubmitBtn(): boolean;
protected isSubmitOnEnter(): boolean;
protected saveDefaultValues(): void;
protected clearInputs(): void;
protected abstract setInputsValues(data: AnyObjInterface): void;
protected abstract disableSubmitOnEnter(): void;
protected abstract enableSubmitOnEnter(): void;
protected abstract showErrors(errorList: ValidateErrorListInterface): void;
protected abstract clearErrors(): void;
protected abstract showAlerts(alertList: string[], contextType: ContextTypeEnum): void;
protected abstract clearAlerts(): void;
protected abstract callFormSubmit(): void;
protected abstract showSubmitBtn(): void;
protected abstract hideSubmitBtn(): void;
protected abstract disableSubmitBtn(): void;
protected abstract enableSubmitBtn(): void;
protected abstract disableFieldsInput(): void;
protected abstract enableFieldsInput(): void;
protected abstract showSpinner(): void;
protected abstract hideSpinner(): void;
abstract serialize(): AnyObjInterface;
abstract setSubmitButton(button: any): void;
abstract setAction(action: string): void;
abstract setMethod(method: string): void;
abstract getMethod(): string;
abstract getAction(): string;
abstract getToken(): string;
abstract hide(): void;
abstract show(): void;
getInitData(): AnyObjInterface;
setInitData(data: AnyObjInterface): void;
setSubmitCallback(callback: any): void;
setPreSubmitCallback(callback: any): void;
setAfterSubmitCallback(callback: any): void;
setExtraSpinners(spinnerList: any): void;
clear(): void;
attachToModal(modal: ModalContract): void;
private preSubmitActions;
private afterSubmitActions;
submit(): void;
validate(): ValidateErrorListInterface | true;
private doSubmit;
setRuleList(ruleList: RuleListInterface): void;
callSubmitCallback(): void;
getId(): string;
getRuleList(): RuleListInterface;
getComponent(type: string): any;
}