import { ElementRef, EventEmitter, Injector, OnDestroy, OnInit } from '@angular/core';
import { ActivatedRoute, Router } from '@angular/router';
import { TranslateService } from '@ngx-translate/core';
import { FileUpload } from 'tn-custom-primeng/fileupload';
import { ControlTreeNode, CrudFormComponent } from '../../components/crud/crud-form/crud-form.component';
import { ResponseResult } from '../../models/response-result';
import { CrudService } from '../../services/crud.service';
import { CustomRouterService } from '../../services/custom-router.service';
import { DomService } from '../../services/dom.service';
import { EntityMetadataService } from '../../services/entity-metadata.service';
import { MasterDataService } from '../../services/master-data.service';
import { NotifierService } from '../../services/notifier.service';
import { UserService } from '../../services/user.service';
import { FormState } from '../constants';
import { CrudFormData, CrudFormSetting, CrudListSetting, EventData, FormControlBase } from '../form-schema';
import { ComponentBaseWithButton } from './component-base-with-button';
export declare abstract class DataFormBase extends ComponentBaseWithButton implements OnInit, OnDestroy {
    crudForm: CrudFormComponent;
    formElement: ElementRef;
    pUpload: FileUpload;
    parentSetting: CrudListSetting;
    model: CrudFormData;
    forceOnlyView: boolean;
    onSave: EventEmitter<any>;
    onSaved: EventEmitter<any>;
    onCancel: EventEmitter<any>;
    onMessage: EventEmitter<any>;
    onFormReady: EventEmitter<any>;
    onDataBinded: EventEmitter<any>;
    doNotCheckBaseService: boolean;
    private notConfigBaseServiceMessage;
    messageInsertSuccess: string;
    messageUpdateSuccess: string;
    setting: CrudFormSetting;
    vi: {
        firstDayOfWeek: number;
        dayNames: string[];
        dayNamesShort: string[];
        dayNamesMin: string[];
        monthNames: string[];
        monthNamesShort: string[];
        today: string;
        clear: string;
    };
    formControls: any;
    formControlsList: {};
    environment: any;
    mdWidthWorkflow: number;
    autoGetDetail: boolean;
    autoSave: boolean;
    isCloseForm: boolean;
    messageConfirmSave: string;
    saving: boolean;
    getDetailPlusUrl: any;
    insertPlusUrl: any;
    dynamicControl: any;
    setValidateForm: boolean;
    haveEntityMetadataAPI: boolean;
    isBaseModel: boolean;
    __isFormView: boolean;
    _notifierService: NotifierService;
    _masterDataService: MasterDataService;
    _router: Router;
    _activatedRoute: ActivatedRoute;
    _translateService: TranslateService;
    _customRouterService: CustomRouterService;
    _crudService: CrudService;
    _domService: DomService;
    _entityMetadataService: EntityMetadataService;
    _userService: UserService;
    constructor(_injector: Injector);
    ngOnInit(): void;
    checkPermission(basePermission: any): void;
    addSchemaBase(): void;
    handleChangeWorkflowCode(evt: EventData): Promise<void>;
    setWorkflowDatasource(evt: EventData, workflowSetting: any): void;
    _handleFormReady(formEvent: EventData): Promise<void>;
    private __handleFormReady;
    _triggerGetDetail(): void;
    onBeforeGetDetail(): Promise<void>;
    getObjectDetail(): Promise<ResponseResult>;
    getDetailCustom(): Promise<ResponseResult>;
    private getDetail;
    initDataAdd(evt: EventData): Promise<void>;
    private initDefaultSettingFileControl;
    /**
     * Phải gọi hàm này khi override getDetail
     */
    _processAfterGetData(data: any): Promise<void>;
    private fixDateValue;
    private disableBuildInField;
    _addRequiredValidator(schema: FormControlBase): void;
    _removeRequiredValidator(schema: FormControlBase): void;
    _setModelValue(field: string, value: any): void;
    _setModelValueByNode(node: ControlTreeNode, value: any): void;
    modifyDetailData(data: any): Promise<void>;
    _triggerSave(): void;
    private save;
    handleManualSave(): void;
    triggerSaveFileUpload(): void;
    _getResultValidate(): Promise<boolean>;
    validateForm(resultValidateBase: boolean): Promise<boolean>;
    private validateFormBase;
    _validateFormControl(fieldPath: any): Promise<boolean>;
    _cleanForm(): void;
    _triggerControlChange(fieldPath: any): void;
    onBeforeSave(): void | Promise<boolean>;
    onAfterSave(response: ResponseResult): void | Promise<boolean>;
    private _onAfterSave;
    onAfterGetDetail(): Promise<void>;
    private onInsert;
    private createConfirmIfRequire;
    private _insert;
    getPromiseActionInsert(): Promise<ResponseResult>;
    handleInsertError(): void;
    private onUpdate;
    handleUpdateError(): void;
    getPromiseActionUpdate(): Promise<ResponseResult>;
    private setDefaultValue;
    private showMessageAfterInsert;
    private showMessageAfterUpdate;
    handleResponseError(error: any): void;
    onFormInitialized(data: EventData): Promise<void>;
    _handleAfterTrinhKy(evt: any): void;
    _handleSave(evt: any): void;
    _handleCancel(evt: any): void;
    _handleMessage(evt: any): void;
    _setDisableControl(uniqueField: any, isDisabled: any): void;
    _setHiddenControl(uniqueField: any, isHidden: any): void;
    _getFormState(): FormState;
    _isFormAddNew(): boolean;
    _isFormEdit(): boolean;
    _isFormView(): boolean;
}
//# sourceMappingURL=data-form-base.d.ts.map