import { OnDestroy, EventEmitter, SimpleChanges, OnChanges } from '@angular/core'; import { FormGroup, FormControl } from '@angular/forms'; import { Constants } from '../../models/constants'; import { MatDialog } from '@angular/material/dialog'; import { Observable } from 'rxjs'; import { CoreCommonService } from '../../providers/services/common.service'; import { HideShowSchema, AgeCheckParam } from '../../models/interfaces'; import { CoreDataShareService } from '../../providers/services/data-share.service'; export declare class DynamicControlComponent implements OnChanges, OnDestroy { dialog: MatDialog; private coreCommonService; private coreDataShareService; fieldRow: any; form: FormGroup; scope: any; controlReady: EventEmitter; files: any[]; isApplicantListDropdownDisabled: boolean; private eventSubscriptionsList; objectKeys: { (o: object): string[]; (o: {}): string[]; }; CONSTANTS: typeof Constants; hideShowList: {}; currentField: FormControl; thisScope: this; fieldRowCounter: number; constructor(dialog: MatDialog, coreCommonService: CoreCommonService, coreDataShareService: CoreDataShareService); /** * A callback method that is invoked if any data-bound properties change */ ngOnChanges(changes: SimpleChanges): void; /** * Unsubscribe Observables and detach event handlers to avoid memory leaks */ ngOnDestroy(): void; /** * This method will handle the page load */ private handlePageLoad; /** * This method will initialize the variables */ private initVariables; /** * This method will check if the field is valid or not * @param logicalName - logical name of field */ isValid(logicalName: string): boolean; /** * This method will call the function from schema by name */ callFunctionByName(fnName: string, ...params: any): Observable; /** * This method will register any enable or disable events * @param field - field details * @param form - form data */ private registerEnableDisableEvents; /** * This method will register and subscribe to any value change * @param enableDisableSchema - fields from schema * @param form - current form * @param fieldSchema - fields details */ private checkAndSetEnableDisableEvents; /** * This methid will handle all the disable/enable functions calls */ private handleDisableFunctionCall; /** * This method will register for any hide/show events */ private registerHideShowEvent; /** * This method will check and set for any hide/shoe events */ private checkAndSetHideShowEvent; /** * This methid will handle all the hide functions calls */ private handleHideFunctionCall; /** * This method will hide fields if age is greater than specified data */ hideIfAgeGreaterThan(form: FormGroup, fieldSchema: object, hideShowSchema: HideShowSchema, params: AgeCheckParam): void; /** * This method will hide and disable fields based on condition */ private hideAndDisableField; /** * This method will disable and reset control based on condtion * @param control - details */ private disableAndResetControl; /** * This method will enable control based on condition * @param control - details */ private enableControl; /** * This method will show and enable fields based on condition */ private showAndEnableField; /** * This method will handle events and registers them */ private handleEvents; /** * This method will register the events */ private registerEvents; /** * This method will notify when all the controls are ready */ notifyControlReady(): void; /** * This method will register for any text value changes * @param field - fields details * @param form - form data */ private registerTextValueChange; /** * This method will handle all the on click events * @param field - fields details */ handleOnClickEvent(field: object): void; /** * The trackBy function takes the index and the current item as arguments * and needs to return the unique identifier for this item * @param index - item index */ trackByFn(index: number, item: any): number; }