import { AfterViewInit, ElementRef, EventEmitter, Injector, OnDestroy, OnInit, QueryList, TemplateRef } from '@angular/core';
import { DomSanitizer } from '@angular/platform-browser';
import { DeviceDetectorService } from 'ngx-device-detector';
import { Subject } from 'rxjs';
import { MenuItem } from 'tn-custom-primeng/api';
import { ContextMenu } from 'tn-custom-primeng/contextmenu';
import { ComponentContextService } from '../../../app-context/component-context.service';
import { ComponentBase } from '../../../classes/base/component-base';
import { FormState } from '../../../classes/constants';
import { AutoCompletePickerControlSchema, ButtonControlSchema, CoCauToChucPickerControlSchema, CrudFormSetting, CrudListSetting, CustomControlSchema, DateTimeControlSchema, DialogModel, DropdownControlSchema, EventData, EventType, FormControlBase, FormControlBaseWithService, FormSchemaBase, MaskControlSchema, RadioButtonListControlSchema, TableSchema, TextControlSchema, UserPickerControlSchema } from '../../../classes/form-schema';
import { KeyValueType } from '../../../models/types';
import { CommonService } from '../../../services/common.service';
import { CrudService } from '../../../services/crud.service';
import { EntityPickerService } from '../../../services/entity-picker.service';
import { MasterDataService } from '../../../services/master-data.service';
import { ModuleConfigService } from '../../../services/module-config.service';
import { NotifierService } from '../../../services/notifier.service';
import { DropdownService } from '../../dropdown/services/dropdown.service';
import { CompareValidator, DateCompareValidator, NumberCompareValidator } from './../../../classes/base/validators';
import { Filter } from './../../../models/grid-info';
import { UserService } from './../../../services/user.service';
export declare class CrudFormComponent extends ComponentBase implements OnInit, OnDestroy, AfterViewInit {
    _injector: Injector;
    _commonService: CommonService;
    _crudService: CrudService;
    _deviceDetectorService: DeviceDetectorService;
    private _dropdownService;
    _sanitizer: DomSanitizer;
    _entityPickerService: EntityPickerService;
    private _moduleConfig;
    formElement: ElementRef;
    contextMenu: ContextMenu;
    children: QueryList<TemplateRef<any>>;
    set templateCongViecForm(value: TemplateRef<any>);
    setting: CrudFormSetting;
    context: ComponentContextService;
    filesUploaded: any[];
    isViewMode: boolean;
    disableKeypressControl: boolean;
    disableCaching: boolean;
    _styleClass: string;
    set styleClass(value: string);
    useGridTemplate: boolean;
    formId: string;
    formClass: string;
    autoFocus: boolean;
    trapFocus: boolean;
    set data(value: any);
    formState: FormState;
    onFormReady: EventEmitter<any>;
    onControlReady: EventEmitter<any>;
    onAllControlReady: EventEmitter<any>;
    onModelChanged: EventEmitter<any>;
    dataChange: EventEmitter<any>;
    onChange: EventEmitter<EventData>;
    onAfterTrinhKy: EventEmitter<any>;
    _rootNode: ControlTreeNode;
    _minimizedData: any;
    _modelData: any;
    _unsubscribeAll: Subject<any>;
    _inValidForm: boolean;
    eventType: typeof EventType;
    limitSize: number;
    formControls: KeyValueType;
    funcCheckUniqueField: any;
    beforeData: any;
    firstDivHolder: any;
    cachedValues: {};
    templates: {
        [key: string]: TemplateRef<any>;
    };
    _prefixCustomHeader: string;
    congViecSetting: CrudListSetting;
    loadedDataEditOld: boolean;
    loadedDataEdit: boolean;
    canPrint: boolean;
    tableFormDialogModel: DialogModel;
    tableFormCurrentRow: number;
    tableFormSchema: FormSchemaBase[];
    tableFormCurrentInfo: any;
    buttonContexts: MenuItem[];
    rowDataCurrent: any;
    controlNeedCheckReady: FormSchemaBase[];
    readyStatus: any;
    fieldParentField: string;
    waitReadyAndPrintTimeout: any;
    _notifierService: NotifierService;
    _masterDataService: MasterDataService;
    _userService: UserService;
    constructor(_injector: Injector, _commonService: CommonService, _crudService: CrudService, _deviceDetectorService: DeviceDetectorService, _dropdownService: DropdownService, _sanitizer: DomSanitizer, _entityPickerService: EntityPickerService, _moduleConfig: ModuleConfigService);
    ngOnInit(): void;
    switchViewMode(readonlyView?: boolean): void;
    reload(): void;
    clean(): void;
    private cleanModel;
    reInitControlModelAndRootNode(): void;
    private getMinimizeData;
    private initLoad;
    private initSchema;
    private initControlModel;
    initControlDefaultValueFromExternal(): void;
    initControlDefaultValue(parentModel: any, control: any, parentPath?: any): void;
    private initPrivateData;
    reInitControlSchema(): void;
    private initControlSchema;
    private disableControlSchema;
    private checkIsTaskControl;
    renderTenCongViec(model: any, schema: CustomControlSchema): void;
    private initBindingControlSchema;
    private bindOnChangeToDropdown;
    private bindOnChangeToDropdownRecursive;
    private addMoreOnChangeEvent;
    private initValidatorAndCorrector;
    createValidatorCompareRevert(validator: DateCompareValidator | NumberCompareValidator | CompareValidator, schema: DateTimeControlSchema | TextControlSchema | MaskControlSchema): void;
    createValidatorCheckDuplicate(schema: FormControlBase, fieldOther: string[], message: string, defaultFilters: Filter[]): void;
    createValidatorRequireds(schema: FormControlBase, fieldOther: string[], message: string): void;
    createSameValueValidators(schema: FormControlBase, fieldOther: string[], message: string): void;
    private setDataDefault;
    private applyCachedValues;
    private setCachedValueToModel;
    private getCachedValuesFromStorage;
    private saveCacheValuesToStorage;
    triggerChange(fieldPath: any): void;
    ngAfterViewInit(): void;
    setIsLoadedDataEdit(value: boolean): void;
    handleRowClick(rowData: any, control: any): void;
    getControlType(control: any): "custom" | "address" | "button" | "label" | "table" | "template" | "textarea" | "title" | "mask" | "switch" | "text" | "datetime" | "spanControl" | "numberrange" | "content" | "money" | "phoneOrfax" | "reference-text" | "datetimerange" | "dropdown" | "editor" | "common-picker" | "autocomplete-picker" | "user-picker" | "entity-picker" | "organization-picker" | "cocautochuc-picker-new" | "cocautochuc-picker" | "cocautochuc" | "autocomplete" | "checkbox" | "checkboxlist" | "radiobuttonlist" | "imageuploader" | "fileUpload" | "serviceFileUpload" | "fileManager" | "colorPicker" | "colorControl" | "container" | "vanban" | "congviec" | "percent" | "chips" | "column";
    getViewModeDataType(control: any): "user" | "address" | "html" | "label" | "table" | "title" | "mask" | "string" | "date" | "boolean" | "datetime" | "content" | "money" | "fileUpload" | "fileManager" | "colorPicker" | "colorControl" | "container" | "hasDataSource" | "fileServiceUpload" | "app-key-value";
    validateForm(setValidateForm?: boolean): Promise<boolean>;
    private validateModel;
    validateFormControl(fieldPath: any): Promise<boolean>;
    handleChangeDropdown(control: DropdownControlSchema, event?: any, eventType?: any, parentModel?: any, parentPath?: any, sourceNode?: any, bubble?: any): Promise<void>;
    /**
     * Để nguyên hàm dạng arrow function vì có 1 số form khác gọi
     */
    handleFieldValueChange: (control: FormControlBase, event?: any, eventType?: any, parentModel?: any, parentPath?: any, sourceNode?: any, bubble?: any) => Promise<void>;
    /**
     * Event khi dropdown điều chỉnh value từ raw value dạng guid | int | ... => object kiểu {value: guid | int | ..., ... [1 số trường khác]}
     * @param control
     * @param parentPath
     */
    handleAdjustValueDropdownEvent(control: DropdownControlSchema | RadioButtonListControlSchema, parentPath?: any): Promise<void>;
    handleDataSourceLoadComplete(control: FormControlBaseWithService, parentPath: any, dataSource: any): Promise<void>;
    handleDataSourceLoaded(control: DropdownControlSchema, parentPath: any, dataFromDropdown: any): Promise<void>;
    handleReadyControlPicker(control: AutoCompletePickerControlSchema | UserPickerControlSchema | CoCauToChucPickerControlSchema, parentPath?: any): Promise<void>;
    handleLoadedControl(_component: any, control: FormControlBase, parentPath?: any): void;
    handleControlReadyEvent(control: FormControlBase, parentPath?: any): Promise<void>;
    checkCanPrint(): void;
    waitReadyAndPrint(): void;
    private getModelTableSchemaByChildSchema;
    private checkReadyAll;
    updateModelFromExternal: () => void;
    fireModelChanged: () => void;
    handleButtonClick(control: ButtonControlSchema, event: any, parentPath: any): void;
    private correctValue;
    private validate;
    private _setError;
    setError(field: string | string[], error: string): void;
    private _removeError;
    removeError(field: string | string[]): void;
    private cacheControlValue;
    getComponentByType(templateName: string): TemplateRef<any>;
    getItemInArrayByValue(array: any, v: any, control: any): any;
    getItemInArrayByTextValue(array: any, v: any): any;
    getAddressDisplayText(selectedValue: any): void;
    getLabelClass(control: any): string;
    private scrollToView;
    /**
     * - Set Focus control
     * @param options
     */
    private focusFirstControl;
    private focusToFirstErrorControl;
    preventBlur(event: any): void;
    isVisible(elem: any): boolean;
    deleteRow(index: any, control: TableSchema, tablePath: any): void;
    addNewRow(control: TableSchema, tablePath: any, eventType?: any, disableOpenDialog?: boolean, initData?: any, fireEventFinish?: boolean): Promise<void>;
    addMultiRow(control: any, length: any, tablePath: any, eventType?: any): void;
    handleSavedTableRow(data: any): Promise<void>;
    saveRow(index: any, control: TableSchema, tablePath: any): void;
    editRow(index: any, control: TableSchema, tablePath: any): void;
    handleRowOrdered(control: TableSchema, evt: any, eventType?: any, parentModel?: any, parentPath?: any, sourceNode?: any, bubble?: any): Promise<void>;
    showContextMenu(evt: any, rowData: any, control: TableSchema): Promise<void>;
    private _showContextMenu;
    messageRow(index: any, control: TableSchema, tablePath: any): void;
    getTableFunctionColumnWidth(control: TableSchema): string;
    getMaskByType(maskType: any): string;
    getTextAlign(textAlign: number): "left" | "right" | "center";
    checkDisabled(data: any, control: FormControlBase): boolean;
    checkHidden(control: FormControlBase, parentModel: any, path: string): boolean;
    getContextTd(control: any, rowData: any, index: any, tablePath: any): {
        control: any;
        data: any;
        index: any;
        tablePath: any;
        parentPath: string;
        path: string;
        showLabel: boolean;
        mdWidth: number;
    };
    isMobileOrTablet(): boolean;
    ngOnDestroy(): void;
    onSettings(event: any): void;
    onTableSchemaOldest(evt: any): void;
    onTableSchemaNewest(evt: any): void;
    onTableSchemaNext(evt: any): void;
    onTableSchemaPrev(evt: any): void;
    refresh(evt: any): void;
    getControlDataSource(control: DropdownControlSchema, data: any): any;
    triggerReload(field: string): void;
}
export declare class ControlTreeNode {
    modelPath: string;
    schemaPath: string;
    field: string;
    parentNode: ControlTreeNode;
    rootNode: ControlTreeNode;
    childNodes: ControlTreeNode[];
    hasSchema: boolean;
    control: FormControlBase;
    _component: any;
    formControls: any;
    keysPlus: string[];
    isRootNode: boolean;
    private _crudForm;
    private childNodeDic;
    private data;
    constructor(model: any, schemas: KeyValueType, field?: any, parentNode?: ControlTreeNode);
    reinitChildNodes(fireEventFinish?: boolean): void;
    private initChildNodes;
    getChildNode(field: any): ControlTreeNode;
    setCrudForm(crudForm: CrudFormComponent): void;
    get crudForm(): CrudFormComponent;
    get parentModel(): any;
    get parentModelPath(): string;
    get parentControl(): FormControlBase;
    get model(): any;
    set model(val: any);
    get value(): any;
    set value(val: any);
    get component(): any;
    set component(val: any);
    setHidden(field: string | string[], hidden?: boolean): void;
    private setHiddenField;
    setDisabled(field: string | string[], disabled?: boolean): void;
    private setDisabledField;
    private setPrivateStatus;
    getNodeByPath(modelPath: any): ControlTreeNode;
    getNodeBySchemaPath(schemaPath: any): ControlTreeNode;
    private findInTree;
    private findSchemaInTree;
    setDataSourceTableSchema(path: string, dataSource: any[]): void;
    setDataSourceInternal(dataSource: any[]): void;
    setValue(value: any): void;
}
//# sourceMappingURL=crud-form.component.d.ts.map