import { ControlFor, FieldFor, FieldInfo, ControlType, AWizardModel } from './guig.model'; import { AWizardStep, ValidationError } from './guig.model'; import { FormGroup } from '@angular/forms'; import { BaseModel, EmittedDdlSelection, MultipleChoice, OptionItem } from './guig.model'; import { Observable } from 'rxjs'; import { CdPushEnvelop } from '../cd-push'; import { NotificationService } from '../comm'; import * as i0 from "@angular/core"; interface Rule { minChars?: number; maxChars?: number; mustChars?: Array; isDate?: boolean; isNumerical?: boolean; isEmail?: boolean; isSecurePassword?: boolean; useRegEx?: string; minSelItems?: number; } interface FormField { name: string; type: string; fieldValue: any; rules: Rule; } interface FvOutput { fName: string; valid: boolean; errMsg: string; } export declare class FormsService { fFields: FormField[]; vOutput: FvOutput[]; isValid: boolean; constructor(); init(): boolean; setInput(): void; debounceInput$(elemInput: HTMLInputElement): Observable; getInpuVal(inputID: string): string; validateForm(): void; validateField(field: any): void; runRules(field: any, rule: any): FvOutput; minChars(field: any, rule: any): any; maxChars(field: any, rule: any): { fName: any; valid: boolean; errMsg: string; }; mustChars(field: any): { fName: any; valid: any; errMsg: string; }; minSelItems(field: any, rule: any): { fName: any; valid: boolean; errMsg: string; }; getFrmErr(): string; reset(): void; useSelect(controls: ControlFor[]): boolean; useSearchDropDown(controls: ControlFor[], controlName?: any): boolean; useSelectMultiple(controls: ControlFor[]): boolean; useTextArea(controls: ControlFor[]): boolean; useText(controls: ControlFor[]): boolean; useUpload(controls: ControlFor[]): boolean; useToggleSwitch(controls: ControlFor[]): boolean; useNgToggle(controls: ControlFor[]): boolean; useDualSwitch(controls: ControlFor[]): boolean; useDualRadio(controls: ControlFor[]): boolean; useAction(controls: ControlFor[]): boolean; useDdlCountries(controls: ControlFor[]): boolean; useDdlIcons(controls: ControlFor[]): boolean; useDdlNotifications(controls: ControlFor[]): boolean; canStepBack(index: number, step: AWizardStep): boolean; /** * * @param index * @param steps * @param cb // optional callback that can be used to validate foward movement * @returns */ canStepFoward(index: number, steps: AWizardStep[], cb?: any): boolean; isLastStep(index: number, steps: AWizardStep[]): boolean; getFormValidationErrors(form: FormGroup): ValidationError[]; /** * filter fields: FieldInfo[] by FieldFor * @param model * @param ff * @returns */ filterByFieldFor(model: FieldInfo[], ff: FieldFor): FieldInfo[]; isFieldFor(field: FieldInfo, ff: FieldFor): boolean; filterByAttribute(model: { [key: string]: any; }[], attr: string): any[]; createFormControl(controls: ControlFor[]): ControlType; filterControlsByFieldFor(controls: ControlFor[], ff: FieldFor): ControlType; filterStepsByController(wizardModel: AWizardModel, controllerName: string): AWizardStep[]; /** * Extract formControlConfiguration from fields data * @param model * @returns */ getFormControlConfig(model: FieldInfo[]): { [key: string]: any; }; setDdlData(ddlId: string, data: any, model: FieldInfo[]): void; getDdlData(ddlId: string, model: FieldInfo[]): any[]; setSelectedIcon(emittedDdlSelection: EmittedDdlSelection, baseModel: BaseModel, step: AWizardStep): void; deselectGroupControls(changedElem: HTMLInputElement, multipleChoice: MultipleChoice, baseModel: BaseModel): void; isNotSelectedItem(options: OptionItem, elemId: string): boolean; setReverseValue(changedElemState: boolean, opt: OptionItem, i: number, multipleChoice: MultipleChoice, baseModel: BaseModel): void; saveForm(step: AWizardStep, newObj: any, createObservable: Observable, pushEnvelop: CdPushEnvelop, svNotif: NotificationService): void; isSavableField(fieldName: any, model: FieldInfo[]): boolean; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export {};