import { __awaiter } from "tslib";
import { DatePipe, DecimalPipe } from '@angular/common';
import { Component, Injector, ViewChild } from '@angular/core';
import { ListComponentBase } from '../../../classes/base/list-component-base';
import { CrudListSetting, EventType } from '../../../classes/form-schema';
import { CommonSearchFormComponent } from '../../common-search-form/common-search-form.component';
export class CrudListComponent extends ListComponentBase {
    constructor(_injector) {
        super(_injector, false);
        this._injector = _injector;
        this.eventType = EventType;
        this.handleFieldValueChange = (control, event, rowData, type) => __awaiter(this, void 0, void 0, function* () {
            const eventData = {
                event,
                rowData,
                type
            };
            switch (type) {
                case EventType.CHANGE: {
                    if (control.onChanged) {
                        try {
                            yield control.onChanged(eventData);
                        }
                        catch (_a) {
                        }
                    }
                    break;
                }
                case EventType.INIT: {
                    if (control.onInit) {
                        try {
                            yield control.onInit(eventData);
                        }
                        catch (_b) {
                        }
                    }
                    break;
                }
                case EventType.DELETED: {
                    if (control.onRemove) {
                        try {
                            yield control.onRemove(eventData);
                        }
                        catch (_c) {
                        }
                    }
                    break;
                }
                case EventType.SELECT: {
                    if (control.onSelected) {
                        try {
                            yield control.onSelected(eventData);
                        }
                        catch (_d) {
                        }
                    }
                    break;
                }
                case EventType.UPLOADED: {
                    if (control.onUploaded) {
                        try {
                            yield control.onUploaded(eventData);
                        }
                        catch (_e) {
                        }
                    }
                    break;
                }
            }
        });
    }
    ngOnInit() {
        var _a;
        const defaultSetting = new CrudListSetting();
        if (this.environment.customizeUi) {
            if (this.setting.showExportWordSelectedItems == defaultSetting.showExportWordSelectedItems
                && this.environment.customizeUi.showExportWordSelectedItems != undefined
                && this.setting.showExportWordSelectedItems != this.environment.customizeUi.showExportWordSelectedItems) {
                this.setting.showExportWordSelectedItems = this.environment.customizeUi.showExportWordSelectedItems;
            }
        }
        if ((_a = this.rootContext.data) === null || _a === void 0 ? void 0 : _a.currentAppMetadata) {
            if (this.rootContext.data.currentAppMetadata.setting) {
                const setting = this.rootContext.data.currentAppMetadata.setting;
                for (const key in setting) {
                    if (defaultSetting[key] == this.setting[key]
                        && setting[key] != undefined
                        && this.setting[key] != setting[key]) {
                        this.setting[key] = setting[key];
                    }
                }
            }
        }
        super.ngOnInit();
    }
    adjustPositionLoadingMask() {
        if (this.interval) {
            clearInterval(this.interval);
        }
        if (!this.model.loading || this.model.adjustedPositionLoading) {
            return;
        }
        this.interval = setInterval(f => {
            const element = this.table.containerViewChild.nativeElement.querySelector('.p-datatable-loading-overlay');
            if (element) {
                const parent = element.closest('p-table');
                if (parent) {
                    const nodeScrollBarContent = parent.parentNode;
                    if (!nodeScrollBarContent.classList.contains('ps-content')) {
                        return;
                    }
                    nodeScrollBarContent.parentNode.prepend(element);
                }
                setTimeout(() => {
                    if (!element.parentNode)
                        return;
                    const firstTh = element.parentNode.querySelector('p-table thead tr:first-child > th');
                    const firstThSize = firstTh.getBoundingClientRect();
                    const loadingIcon = element.querySelector('.p-datatable-loading-icon');
                    const fontSize = parseFloat(getComputedStyle(loadingIcon).fontSize);
                    const top = (firstThSize.height - fontSize) / 2;
                    const left = (firstThSize.width - fontSize) / 2;
                    loadingIcon.style.marginTop = `${top}px`;
                    loadingIcon.style.marginLeft = `${left}px`;
                    this.model.adjustedPositionLoading = true;
                }, 20);
            }
            else {
                this.adjustPositionLoadingMask();
            }
        }, 20);
    }
}
CrudListComponent.decorators = [
    { type: Component, args: [{
                // tslint:disable-next-line: component-selector
                selector: 'crud-list',
                template: "<div #container class=\"custom-card card card-w-title flex-container-fit-child\" [attr.height-type]=\"setting.heightType\"\n    [ngStyle]=\"_style\">\n    <div class=\"ui-helper-clearfix crud-list-header-area\">\n        <div *ngIf=\"!setting.hiddenSearch\">\n            <div *ngIf=\"searchCustom\" class=\"p-grid ui-fluid custom-p-col custom-search-area\">\n                <div class=\"p-col-12 main-container-search\">\n                    <div class=\"p-grid main-container-search-inner\">\n                        <ng-container *ngIf=\"!setting.useCommonSearch\">\n                            <ng-container *ngTemplateOutlet=\"searchCustom; context: {$implicit: this}\"></ng-container>\n                        </ng-container>\n                    </div>\n                </div>\n            </div>\n            <div *ngIf=\"setting.useCommonSearch && !hasTemplate('searchCustom')\"\n                class=\"p-grid ui-fluid custom-p-col custom-search-area\">\n                <div class=\"p-col-12 main-container-search\">\n                    <div class=\"p-grid main-container-search-inner\">\n                        <div style=\"width: 100%;\">\n                            <common-search-form #commonSearch [parentSetting]=\"setting\" [parentModel]=\"model\"\n                                [templateFilter]=\"templateFilter\" [parentContext]=\"context\"\n                                [searchBoxTooltip]=\"setting.toolTipSearhBoxCommon\"\n                                (onClickSearch)=\"handleSearch($event)\"></common-search-form>\n                        </div>\n                    </div>\n                </div>\n            </div>\n        </div>\n        <div *ngIf=\"!setting.hiddenHeader\" class=\"p-grid ui-fluid custom-p-col page-title-area\">\n            <div *ngIf=\"!setting.hiddenPageTitle\" class=\"main-title\">\n                <h1 *ngIf=\"!hasTemplate('customTitle')\">\n                    {{setting.title != null ? setting.title : 'Danh s\u00E1ch ' + setting.objectName}}\n                </h1>\n\n                <ng-container *ngIf=\"hasTemplate('customTitle')\" [ngTemplateOutlet]=\"getTemplate('customTitle')\"\n                    [ngTemplateOutletContext]=\"{\n                        crudList: this,\n                        buttonAdd: buttonAdd, buttonExport: buttonExport, buttonDelete: buttonDelete\n                    }\">\n                </ng-container>\n            </div>\n\n            <div *ngIf=\"!setting.hiddenPageSetting\" class=\"paginator-table\">\n                <ng-container *ngIf=\"!paginationTemplate\">\n                    <paging-next-back-only [model]=\"model\" [setting]=\"setting\" (onChanged)=\"getData()\"\n                        (onChangeLimitPage)=\"savePageSize()\">\n                    </paging-next-back-only>\n                </ng-container>\n                <ng-container *ngIf=\"paginationTemplate\">\n                    <ng-container [ngTemplateOutlet]=\"paginationTemplate\"></ng-container>\n                </ng-container>\n            </div>\n        </div>\n    </div>\n    <div *ngIf=\"hasTemplate('topGrid')\" class=\"extend-content-top-grid\">\n        <ng-container [ngTemplateOutletContext]=\"{selectedItems: model.selectedItems, crudList: this}\"\n            [ngTemplateOutlet]=\"getTemplate('topGrid')\"></ng-container>\n    </div>\n    <div class=\"fit-content crud-list-body-area\">\n        <div class=\"crud-list-body-area-inner\" style=\"overflow: unset;\">\n            <div class=\"flex-container-fit-child\" style=\"overflow: unset;\">\n                <div *ngIf=\"!setting.hiddenToolbar\" class=\"p-grid crudListToolbar\">\n                    <ng-container>\n                        <div *ngIf=\"!setting.hiddenButtons && hasTemplate('toolbar')\"\n                            [ngClass]=\"setting.hiddenAdvanceSearch ? 'p-md-12 p-lg-12' : 'p-md-7 p-lg-8'\"\n                            class=\"p-col-12 button-group function-topbar custom-toolbar\">\n                            <ng-container [ngTemplateOutlet]=\"getTemplate('toolbar')\" [ngTemplateOutletContext]=\"{\n                                    selectedItems: model.selectedItems, crudList: this,\n                                    buttonAdd: buttonAdd, buttonExport: buttonExport, buttonDelete: buttonDelete\n                                }\">\n                            </ng-container>\n                        </div>\n                        <div *ngIf=\"!setting.hiddenButtons && !hasTemplate('toolbar')\"\n                            [ngClass]=\"setting.hiddenAdvanceSearch ? 'p-md-12 p-lg-12' : 'p-md-7 p-lg-8'\"\n                            class=\"p-col-12 button-group function-topbar\">\n                            <ng-container [ngTemplateOutlet]=\"getTemplate('buttonBeforeToolbar')\"\n                                [ngTemplateOutletContext]=\"{crudList: this}\"></ng-container>\n                            <button type=\"button\" pButton label=\"\u0110\u00E1nh STT\" class=\"p-button-text\" style=\"display: none\"\n                                (click)=\"danhSoThuTuGroupLastest()\"></button>\n                            <ng-container *ngIf=\"!hiddenAdd\" [ngTemplateOutlet]=\"buttonAdd\"></ng-container>\n                            <ng-container *ngIf=\"setting.showExportSelectedItems\" [ngTemplateOutlet]=\"buttonExport\">\n                            </ng-container>\n                            <ng-container *ngIf=\"setting.showExportWordSelectedItems\"\n                                [ngTemplateOutlet]=\"buttonExportWord\">\n                            </ng-container>\n                            <ng-container *ngIf=\"!hiddenDelete\" [ngTemplateOutlet]=\"buttonDelete\">\n                            </ng-container>\n                            <ng-container *ngIf=\"!hiddenReorder\" [ngTemplateOutlet]=\"buttonReorder\">\n                            </ng-container>\n                            <button *ngIf=\"!setting.disableShare && model.selectedItems.length > 0\"\n                                label=\"Chia s\u1EBB li\u00EAn k\u1EBFt\" type=\"button\" pButton pRipple\n                                [pTooltip]=\"'Chia s\u1EBB li\u00EAn k\u1EBFt' | translate\" tooltipPosition=\"top\"\n                                class=\"p-button-text p-button-info link-or-action\" icon=\"pi pi-link\"\n                                (click)=\"createShareLinkMultiple()\"></button>\n                            <ng-container [ngTemplateOutlet]=\"getTemplate('buttonAfterToolbar')\"\n                                [ngTemplateOutletContext]=\"{crudList: this}\"></ng-container>\n                        </div>\n                    </ng-container>\n                    <div *ngIf=\"!setting.hiddenAdvanceSearch && !setting.useCommonSearch\"\n                        class=\"p-col-12 advance-search-container\"\n                        [ngClass]=\"setting.hiddenButtons ? 'p-md-12 p-lg-12' : 'p-md-5 p-lg-4'\">\n                        <advance-search #advanceSearch [parentSetting]=\"setting\" [searchInfo]=\"searchInfo\"\n                            [loading]=\"model.loading\" (onSearch)=\"handleSearchAdvs($event)\"\n                            (onInit)=\"handleInitAdvanceSearch($event)\">\n                        </advance-search>\n                    </div>\n                </div>\n                <div *ngIf=\"hasTemplate('topGrid')\" class=\"extend-content-top-grid\">\n                    <ng-container [ngTemplateOutletContext]=\"{selectedItems: model.selectedItems, crudList: this}\"\n                        [ngTemplateOutlet]=\"getTemplate('topGrid')\"></ng-container>\n                </div>\n                <div class=\"container-table fit-content\" [class.--table-responsive]=\"responsive\">\n                    <div class=\"container-table-inner\">\n                        <ng-container *ngIf=\"!_groupField\">\n                            <tn-custom-scrollbar *ngIf=\"showScrollBar\" #scrollbar [config]=\"configScrollBar\"\n                                [showScrollHorizontal]=\"showScrollHorizontal\">\n                                <ng-container *ngTemplateOutlet=\"tableGetGroupFieldFalse\">\n                                </ng-container>\n                                <ng-container *ngIf=\"hasTemplate('afterCrudList')\">\n                                    <ng-container [ngTemplateOutlet]=\"getTemplate('afterCrudList')\"></ng-container>\n                                </ng-container>\n                            </tn-custom-scrollbar>\n                            <div *ngIf=\"!showScrollBar\">\n                                <ng-container *ngTemplateOutlet=\"tableGetGroupFieldFalse\">\n                                </ng-container>\n                            </div>\n                        </ng-container>\n                        <ng-container *ngIf=\"_groupField\">\n                            <tn-custom-scrollbar *ngIf=\"showScrollBar\" #scrollbar [config]=\"configScrollBar\"\n                                [showScrollHorizontal]=\"showScrollHorizontal\">\n                                <ng-container *ngTemplateOutlet=\"tableGetGroupFieldTrue\">\n                                </ng-container>\n                                <ng-container *ngIf=\"hasTemplate('afterCrudList')\">\n                                    <ng-container [ngTemplateOutlet]=\"getTemplate('afterCrudList')\"></ng-container>\n                                </ng-container>\n                            </tn-custom-scrollbar>\n                            <div *ngIf=\"!showScrollBar\">\n                                <ng-container *ngTemplateOutlet=\"tableGetGroupFieldTrue\">\n                                </ng-container>\n                            </div>\n                        </ng-container>\n\n                        <div class=\"table-border-line --top\"></div>\n                        <div class=\"table-border-line --right\"></div>\n                        <div class=\"table-border-line --bottom\"></div>\n                        <div class=\"table-border-line --left\"></div>\n                    </div>\n                </div>\n            </div>\n        </div>\n    </div>\n</div>\n<after-view-checked (loaded)=\"handleReady()\"></after-view-checked>\n<settings *ngIf=\"_showSettings && !setting.hiddenSetting\" [entityMetadataService]=\"entityMetadataService\"\n    [parentContext]=\"context\" [parentSetting]=\"setting\" [parentModel]=\"model\" (onSave)=\"onSaveSettings($event)\"\n    (onDelete)=\"onDeleteSettings()\" (onCancel)=\"_showSettings = false\">\n</settings>\n<settings-row *ngIf=\"_showSettingsRowColor && !setting.hiddenSetting\" [entityMetadataService]=\"entityMetadataService\"\n    [parentContext]=\"context\" [parentSetting]=\"setting\" [parentModel]=\"model\" (onSave)=\"onSaveColorSettings($event)\"\n    (onCancel)=\"_showSettingsRowColor = false\">\n</settings-row>\n<workflow-setting-dialog *ngIf=\"_showSettingsWorkflow && !setting.hiddenSettingWorkflow\" [parentSetting]=\"setting\"\n    [parentContext]=\"context\" [parentModel]=\"model\" (onSaved)=\"onSaveWorkflowSettings($event)\"\n    (onRemoved)=\"onRemoveWorkflowSettings($event)\" (onCancel)=\"_showSettingsWorkflow = false\">\n</workflow-setting-dialog>\n<tn-dialog *ngIf=\"workflowSettingModel.showEditForm\" [header]=\"'C\u1EA5u h\u00ECnh quy tr\u00ECnh nghi\u1EC7p v\u1EE5' | translate\"\n    [popupSize]=\"workflowSettingModel.popupSize\" (onHide)=\"workflowSettingModel.showEditForm = false\">\n    <!-- <workflow-setting-new #formBase [parentSetting]=\"setting\" (onSaved)=\"onSaveWorkflowSettingsNew($event)\"\n        (onCancel)=\"workflowSettingModel.showEditForm = false\"></workflow-setting-new> -->\n    <div #workflowsettingnew></div>\n</tn-dialog>\n<entity-permission *ngIf=\"_showSettingsPermission && !setting.hiddenSettingPermission\" [parentSetting]=\"setting\"\n    [parentContext]=\"context\" [parentModel]=\"model\" [searchInfo]=\"searchInfo\"\n    (onCancel)=\"_showSettingsPermission = false\">\n</entity-permission>\n<p-contextMenu #contextMenu [appendTo]=\"'body'\" [styleClass]=\"'allow-selected'\" [model]=\"buttonContexts\">\n</p-contextMenu>\n<tn-dialog *ngIf=\"processWorkflowModel.showEditForm\" #dialog [header]=\"processWorkflowModel.header | translate\"\n    [popupSize]=\"processWorkflowModel.popupSize\" [scrollBarStyleClass]=\"'fit-content'\"\n    (onHide)=\"processWorkflowModel.showEditForm = false\">\n    <div style=\"height: 100%; padding: 1rem\">\n        <process-workflow-form #formBase [businessSetting]=\"processWorkflowModel.data.setting\" [item]=\"currentItem\"\n            [workflow]=\"processWorkflowModel.data.workflow\" [action]=\"processWorkflowModel.data.action\"\n            (onSaved)=\"handleProcessedWorkflowBase()\" (onCancel)=\"processWorkflowModel.showEditForm = false\">\n        </process-workflow-form>\n    </div>\n</tn-dialog>\n<tn-dialog *ngIf=\"choYKienModel.showEditForm\" #dialog [header]=\"choYKienModel.header | translate\"\n    [popupSize]=\"choYKienModel.popupSize\" [scrollBarStyleClass]=\"'fit-content'\"\n    (onHide)=\"choYKienModel.showEditForm = false\">\n    <div style=\"height: 100%\">\n        <cho-y-kien-form #formBase [bussinessSetting]=\"choYKienModel.data.setting\"\n            [rowItem]=\"choYKienModel.data.rowData\" (onSaved)=\"choYKienModel.showEditForm = false\"\n            (onCancel)=\"choYKienModel.showEditForm = false\">\n        </cho-y-kien-form>\n    </div>\n</tn-dialog>\n<tn-dialog *ngIf=\"workflowHistoryModel.showEditForm\" #dialog [header]=\"workflowHistoryModel.header | translate\"\n    [popupSize]=\"workflowHistoryModel.popupSize\" [scrollBarStyleClass]=\"'fit-content'\"\n    (onHide)=\"workflowHistoryModel.showEditForm = false\">\n    <div style=\"height: 100%\">\n        <workflow-history-new #formBase [businessSetting]=\"workflowHistoryModel.data.setting\"\n            [tableName]=\"workflowHistoryModel.data.tableName\" [item]=\"currentItem\"\n            [workflowSetting]=\"workflowHistoryModel.data.workflowSetting\"\n            (onCancel)=\"workflowHistoryModel.showEditForm = false\">\n        </workflow-history-new>\n    </div>\n</tn-dialog>\n<tn-dialog *ngIf=\"detailTaskModel.showEditForm\" #dialog [header]=\"detailTaskModel.header | translate\"\n    [popupSize]=\"detailTaskModel.popupSize\" [scrollBarStyleClass]=\"'fit-content'\"\n    (onHide)=\"detailTaskModel.showEditForm = false\">\n    <base-congviec-form #formBase [model]=\"detailTaskModel.data.taskFormModel\" [forceOnlyView]=\"true\"\n        (onCancel)=\"detailTaskModel.showEditForm = false\">\n    </base-congviec-form>\n</tn-dialog>\n\n<!-- <tn-dialog *ngIf=\"showDetailForm\" #dialog [styleClass]=\"'congviec-form tn-form-dialog'\"\n    [header]=\"setting.popupHeader | translate\" [popupSize]=\"setting.popupSize\" (onHide)=\"showDetailForm = false\">\n    <base-congviec-form #formBase [parentModel]=\"model\" [parentSetting]=\"setting\" [parentContext]=\"context\"\n        [model]=\"formModel\" [crudList]=\"crudList\" (onSaved)=\"showDetailForm = false;crudList.reload()\"\n        (onCancel)=\"_handleCancel($event)\" (onAfterSaved)=\"onAfterSaved($event)\">\n    </base-congviec-form>\n</tn-dialog> -->\n\n<tn-dialog *ngIf=\"permissionSharingModel.showEditForm\" #dialog [header]=\"permissionSharingModel.header | translate\"\n    [popupSize]=\"permissionSharingModel.popupSize\" [scrollBarStyleClass]=\"'fit-content'\"\n    (onHide)=\"permissionSharingModel.showEditForm = false\">\n    <div style=\"height: 100%\">\n        <permission-sharing #formBase [item]=\"rowDataCurrent\" [baseService]=\"setting.baseService\"\n            (onCancel)=\"permissionSharingModel.showEditForm = false\">\n        </permission-sharing>\n    </div>\n</tn-dialog>\n<tn-dialog *ngIf=\"permissionListModel.showEditForm\" #dialog [header]=\"permissionListModel.header | translate\"\n    [popupSize]=\"permissionListModel.popupSize\" [scrollBarStyleClass]=\"'fit-content'\" [useDefaultScrollBar]=\"true\"\n    (onHide)=\"permissionListModel.showEditForm = false\">\n    <div style=\"height: 100%\">\n        <workflow-permission #formBase [item]=\"rowDataCurrent\" [businessSetting]=\"setting\"\n            (onCancel)=\"permissionListModel.showEditForm = false\">\n        </workflow-permission>\n    </div>\n</tn-dialog>\n<workflow-history-dialog *ngIf=\"showHistoryWorkflow\" [baseService]=\"setting.baseService\" [item]=\"currentItem\"\n    [workflowSetting]=\"setting.workflowSetting\" (onHide)=\"handleHideHistoryWorkflow()\">\n</workflow-history-dialog>\n<tn-dialog *ngIf=\"startWorkflowModel.showEditForm\" #dialog [header]=\"startWorkflowModel.header | translate\"\n    [popupSize]=\"startWorkflowModel.popupSize\" [scrollBarStyleClass]=\"'fit-content'\"\n    (onHide)=\"startWorkflowModel.showEditForm = false\">\n    <div style=\"height: 100%\">\n        <start-workflow #formBase [workflows]=\"startWorkflowModel.data.workflows\"\n            [defaultWorkflow]=\"startWorkflowModel.data.defaultWorkflow\"\n            (onCancel)=\"startWorkflowModel.showEditForm = false\" (onSaved)=\"handleStartWorkflowFromDialog($event)\">\n        </start-workflow>\n    </div>\n</tn-dialog>\n<tn-dialog *ngIf=\"congViecModel.showEditForm\" #dialog [styleClass]=\"'congviec-form tn-form-dialog'\"\n    [header]=\"congViecModel.header | translate\" [popupSize]=\"congViecModel.popupSize\"\n    (onHide)=\"congViecModel.showEditForm = false\">\n    <base-congviec-form #formBase [parentSetting]=\"congViecModel.data.congViecSetting\"\n        [model]=\"congViecModel.data.model\" (onSaved)=\"congViecModel.showEditForm = false;getData()\"\n        (onCancel)=\"congViecModel.showEditForm = false\">\n    </base-congviec-form>\n</tn-dialog>\n<tn-dialog *ngIf=\"shareLinkModel.showEditForm\" #dialog [styleClass]=\"'congviec-form tn-form-dialog'\"\n    [header]=\"shareLinkModel.header | translate\" [popupSize]=\"shareLinkModel.popupSize\" [useDefaultScrollBar]=\"true\"\n    (onHide)=\"shareLinkModel.showEditForm = false\">\n    <share-link-by-permission #formBase [setting]=\"setting\" [lstItem]=\"shareLinkModel.data.lstItem\"\n        (onCancel)=\"congViecModel.showEditForm = false\">\n    </share-link-by-permission>\n</tn-dialog>\n<tn-dialog *ngIf=\"attachedTaskModel.showEditForm\" [header]=\"attachedTaskModel.header | translate\"\n    [popupSize]=\"attachedTaskModel.popupSize\" [useDefaultScrollBar]=\"true\"\n    (onHide)=\"attachedTaskModel.showEditForm = false\">\n    <base-congviec [serviceCode]=\"setting.baseService.serviceCode\" [entity]=\"setting.baseService.entityName\"\n        [itemIdAttach]=\"rowDataCurrent.id\"></base-congviec>\n</tn-dialog>\n<ng-template #tableGetGroupFieldFalse>\n    <p-table #table [dataKey]=\"'id'\" [scrollable]=\"pTableScrollable\" [scrollHeight]=\"pTableScrollHeight\"\n        [columns]=\"setting.cols\" [paginator]=\"false\" [value]=\"_dataSource\" (onSort)=\"onSort($event, table)\"\n        [class]=\"_tableClass\" [responsive]=\"responsive\" [lazy]=\"lazy\" [loading]=\"model.loading\"\n        [expandedRowKeys]=\"model.expandedRowKeys\" [(selection)]=\"model.selectedItems\"\n        (onRowReorder)=\"handleRowOrdered($event)\">\n        <ng-template *ngIf=\"colgroup\" pTemplate=\"colgroup\" let-columns>\n            <ng-container *ngTemplateOutlet=\"colgroup; context: {$implicit: columns}\"></ng-container>\n        </ng-template>\n        <ng-template *ngIf=\"!colgroup\" pTemplate=\"colgroup\" let-columns>\n            <ng-container *ngTemplateOutlet=\"baseColgroup; context: {$implicit: columns}\">\n            </ng-container>\n        </ng-template>\n        <ng-template *ngIf=\"header\" pTemplate=\"header\" let-columns>\n            <ng-container\n                *ngTemplateOutlet=\"header, context: {$implicit: columns, crudList: this, rowHeaderFilter: rowHeaderFilter, contentTh: contentTh, containerSticky: containerSticky, funcCheckAll: handleCheckAll}\">\n            </ng-container>\n        </ng-template>\n        <ng-template *ngIf=\"!header\" pTemplate=\"header\" let-columns>\n            <ng-container *ngTemplateOutlet=\"trHeader; context: {$implicit: columns, funcCheckAll: handleCheckAll}\">\n            </ng-container>\n        </ng-template>\n        <ng-template pTemplate=\"body\" let-rowData let-columns=\"columns\" let-index=\"rowIndex\" let-expanded=\"expanded\">\n            <ng-container\n                *ngTemplateOutlet=\"trBody; context: {$implicit: rowData, columns: columns, index: index, expanded: expanded, eventSelectRow: handleSelectRow, eventChecked: handleCheckRowData}\">\n            </ng-container>\n            <after-view-checked *ngIf=\"index == _dataSource.length - 1\" style=\"display: none;\" [renderKey]=\"_dataSource\"\n                (loaded)=\"handleTableRendered()\">\n            </after-view-checked>\n        </ng-template>\n        <ng-template *ngIf=\"rowExpansion\" pTemplate=\"rowexpansion\" let-rowData let-expanded=\"expanded\">\n            <ng-container\n                *ngTemplateOutlet=\"rowExpansion; context: {$implicit: rowData, expanded: expanded, getColSpanGroup: getColSpanGroup}\">\n            </ng-container>\n        </ng-template>\n        <ng-template *ngIf=\"summary\" pTemplate=\"summary\">\n            <ng-container *ngTemplateOutlet=\"summary\"></ng-container>\n        </ng-template>\n        <ng-template *ngIf=\"footer\" pTemplate=\"footer\" let-columns>\n            <ng-container *ngTemplateOutlet=\"footer; context: {$implicit: columns}\"></ng-container>\n        </ng-template>\n    </p-table>\n</ng-template>\n<ng-template #tableGetGroupFieldTrue>\n    <p-table #tableGroup [scrollable]=\"pTableScrollable\" [scrollHeight]=\"pTableScrollHeight\" [columns]=\"setting.cols\"\n        [paginator]=\"false\" [value]=\"_dataSource\" [metaKeySelection]=\"false\" (onSort)=\"onSort($event, tableGroup)\"\n        [class]=\"_tableClass\" [customSort]=\"true\" [responsive]=\"responsive\" [lazy]=\"true\" [loading]=\"model.loading\"\n        [(selection)]=\"model.selectedItems\" [expandedRowKeys]=\"model.expandedRowKeys\" [dataKey]=\"_groupField\">\n        <ng-template *ngIf=\"colgroup\" pTemplate=\"colgroup\" let-columns>\n            <ng-container *ngTemplateOutlet=\"colgroup; context: {$implicit: columns}\"></ng-container>\n        </ng-template>\n        <ng-template *ngIf=\"!colgroup\" pTemplate=\"colgroup\" let-columns>\n            <ng-container *ngTemplateOutlet=\"baseColgroup; context: {$implicit: columns}\">\n            </ng-container>\n        </ng-template>\n        <ng-template *ngIf=\"header\" pTemplate=\"header\" let-columns>\n            <ng-container\n                *ngTemplateOutlet=\"header, context: {$implicit: columns, crudList: this, rowHeaderFilter: rowHeaderFilter, contentTh: contentTh, containerSticky: containerSticky, funcCheckAll: handleCheckAll_Group}\">\n            </ng-container>\n        </ng-template>\n        <ng-template *ngIf=\"!header\" pTemplate=\"header\" let-columns>\n            <ng-container\n                *ngTemplateOutlet=\"trHeader; context: {$implicit: columns, funcCheckAll: handleCheckAll_Group}\">\n            </ng-container>\n        </ng-template>\n        <ng-template pTemplate=\"body\" let-rowData let-rowIndex=\"rowIndex\" let-expanded=\"expanded\" let-columns=\"columns\">\n            <tr *ngIf=\"rowGroupMetadata[rowData[_groupField]] && rowGroupMetadata[rowData[_groupField]].index == rowIndex\"\n                class=\"p-widget-header group-row\" style=\"border: 0px; border-bottom: 1px solid #eee\">\n                <td *ngIf=\"!setting.hiddenCheckbox\" class=\"center chkbox\" [class.sticky]=\"setting.stickyColumn\">\n                    <p-checkbox [(ngModel)]=\"rowGroupChecked[rowData[_groupField]]\" binary=\"true\"\n                        (onChange)=\"handleCheckRowGroup(rowData)\">\n                    </p-checkbox>\n                    <ng-container *ngTemplateOutlet=\"containerSticky\"></ng-container>\n                </td>\n                <ng-container *ngIf=\"!rowGroup\">\n                    <td [colSpan]=\"getColSpanGroup()\" [class]=\"_classRowGroup\">\n                        <div class=\"container-row-group\">\n                            <a href=\"javascript:;\" [pRowToggler]=\"rowData\" class=\"container-row-group-toggle\"\n                                [class.sticky]=\"setting.stickyColumn\">\n                                <i style=\"margin-right:5px\"\n                                    [ngClass]=\"expanded ? 'fas fa-fw fa-caret-down' : 'fas fa-fw fa-caret-right'\"></i>\n                                <div class=\"content-row-group\">\n                                    <ng-container *ngIf=\"!contentRowGroup\">\n                                        <ng-container [ngTemplateOutlet]=\"_contentRowGroup\"\n                                            [ngTemplateOutletContext]=\"getContextRowGroup(rowData)\">\n                                        </ng-container>\n                                    </ng-container>\n                                    <ng-container *ngIf=\"contentRowGroup\">\n                                        <ng-container [ngTemplateOutlet]=\"contentRowGroup\"\n                                            [ngTemplateOutletContext]=\"getContextRowGroup(rowData)\">\n                                        </ng-container>\n                                    </ng-container>\n                                </div>\n                            </a>\n                        </div>\n                    </td>\n                </ng-container>\n                <ng-container *ngIf=\"rowGroup\">\n                    <ng-container [ngTemplateOutlet]=\"rowGroup\"\n                        [ngTemplateOutletContext]=\"getContextRowGroupRoot(rowData, expanded)\">\n                    </ng-container>\n                </ng-container>\n            </tr>\n        </ng-template>\n        <ng-template pTemplate=\"rowexpansion\" let-columns=\"columns\" let-rowData let-index=\"rowIndex\">\n            <ng-container\n                *ngTemplateOutlet=\"trBody; context: {$implicit: rowData, columns: columns, index: index, expanded: false, eventSelectRow: handleSelectRowGroup, eventChecked: handleCheckRowData_Group}\">\n            </ng-container>\n            <after-view-checked *ngIf=\"index == _dataSource.length - 1\" style=\"display: none;\" [renderKey]=\"_dataSource\"\n                (loaded)=\"handleTableRendered()\">\n            </after-view-checked>\n        </ng-template>\n        <ng-template *ngIf=\"summary\" pTemplate=\"summary\">\n            <ng-container *ngTemplateOutlet=\"summary\"></ng-container>\n        </ng-template>\n        <ng-template *ngIf=\"footer\" pTemplate=\"footer\" let-columns>\n            <ng-container *ngTemplateOutlet=\"footer; context: {$implicit: columns}\"></ng-container>\n        </ng-template>\n    </p-table>\n    <after-view-checked></after-view-checked>\n</ng-template>\n<ng-template #baseColgroup let-columns>\n    <colgroup>\n        <col *ngIf=\"!setting.hiddenCheckbox\" [style.width]=\"widthCheckbox\" />\n        <col *ngIf=\"!setting.hiddenOrderColumn\" [style.width]=\"widthOrderColumn\" />\n        <col *ngIf=\"rowExpansion\" style=\"width: 2.5rem\" />\n        <ng-container *ngFor=\"let col of columns; let i = index\">\n            <col *ngIf=\"col && col.visible && col.field!='function'\" [style.width]=\"col.width\" />\n        </ng-container>\n        <col *ngIf=\"enableReorderRow\" style=\"width: 30px\" />\n        <col *ngIf=\"!setting.hiddenFunctionColumn\" [style.width]=\"widthFunctionColumn || _widthFunctionColumn\" />\n    </colgroup>\n</ng-template>\n<ng-template #buttonAdd>\n    <span [appAuthorize]=\"serviceCode\" [permission]=\"authorizePaths[commonConst.ADD]\"\n        [enableAuthorize]=\"buttonApplyAuthorize[commonConst.ADD]\">\n        <button type=\"button\" pButton pRipple label=\"Th\u00EAm m\u1EDBi\" icon=\"pi pi-plus\" class=\"p-button-text\"\n            [disabled]=\"!model.baseReady\" (click)=\"add()\"></button>\n    </span>\n</ng-template>\n<ng-template #buttonExport>\n    <button *ngIf=\"model.selectedItems.length > 0\" [appAuthorize]=\"serviceCode\"\n        [permission]=\"authorizePaths[commonConst.EXPORT_EXCEL]\"\n        [enableAuthorize]=\"buttonApplyAuthorize[commonConst.EXPORT_EXCEL]\" type=\"button\" pButton pRipple\n        label=\"Xu\u1EA5t c\u00E1c m\u1EE5c \u0111\u00E3 ch\u1ECDn ({{model.selectedItems.length}})\" icon=\"fas fa-file-excel\"\n        class=\"p-button-text p-button-success\" (click)=\"xuatCacMucDaChon()\"></button>\n</ng-template>\n<ng-template #buttonExportWord>\n    <button *ngIf=\"model.selectedItems.length > 0\" [appAuthorize]=\"serviceCode\"\n        [permission]=\"authorizePaths[commonConst.EXPORT_EXCEL]\"\n        [enableAuthorize]=\"buttonApplyAuthorize[commonConst.EXPORT_EXCEL]\" type=\"button\" pButton pRipple\n        label=\"In c\u00E1c m\u1EE5c \u0111\u00E3 ch\u1ECDn ({{model.selectedItems.length}})\" icon=\"fas fa-file-word\"\n        class=\"p-button-text p-button-success\" (click)=\"printByReadingHtml()\"></button>\n</ng-template>\n<ng-template #buttonDelete>\n    <button *ngIf=\"!hiddenDelete && model.selectedItems.length > 0 && !disableMultipleDelete()\"\n        [appAuthorize]=\"serviceCode\" [permission]=\"authorizePaths[commonConst.DELETE_MULTIPLE]\"\n        [enableAuthorize]=\"buttonApplyAuthorize[commonConst.DELETE_MULTIPLE]\" type=\"button\" pButton pRipple\n        [label]=\"'X\u00F3a ' + (model.selectedItems.length) | translate\" icon=\"pi pi-trash\"\n        class=\"p-button-text p-button-danger\" (click)=\"deleteMutiple()\"></button>\n</ng-template>\n<ng-template #buttonReorder>\n    <button\n        *ngIf=\"showSaveReorder && enableReorderRow && (_sortField == setting.columnSetting.sortField || _sortDir == 0)\"\n        [appAuthorize]=\"serviceCode\" [permission]=\"authorizePaths[commonConst.REORDER_SAVE]\"\n        [enableAuthorize]=\"buttonApplyAuthorize[commonConst.REORDER_SAVE]\" type=\"button\" pButton pRipple\n        [label]=\"'L\u01B0u s\u1EAFp x\u1EBFp' | translate\" icon=\"pi pi-save\" class=\"p-button-text p-button-success\"\n        (click)=\"saveReorder()\"></button>\n</ng-template>\n<ng-template #trHeader let-columns let-funcCheckAll=\"funcCheckAll\">\n    <tr class=\"title-row\">\n        <ng-container *ngIf=\"!setting.hiddenCheckbox\">\n            <th class=\"chkbox link-or-action cell-checkbox\" [class.sticky]=\"setting.stickyColumn\">\n                <button *ngIf=\"!hasTemplate('headerCheckbox') && !setting.useCommonSearch\" type=\"button\" pButton pRipple\n                    icon=\"pi pi-refresh\" class=\"p-button-rounded p-button-text btnReload\" pTooltip=\"L\u00E0m m\u1EDBi d\u1EEF li\u1EC7u\"\n                    tooltipPosition=\"top\" [disabled]=\"model.loading\" (click)=\"reload()\"></button>\n                <p-triStateCheckbox *ngIf=\"setting.useCommonSearch\" [(ngModel)]=\"checkedAll\" binary=\"true\"\n                    (onChange)=\"funcCheckAll()\">\n                </p-triStateCheckbox>\n                <ng-container *ngIf=\"hasTemplate('headerCheckbox')\">\n                    <ng-container [ngTemplateOutletContext]=\"{crudList: this}\"\n                        [ngTemplateOutlet]=\"getTemplate('headerCheckbox')\"></ng-container>\n                </ng-container>\n                <ng-container *ngTemplateOutlet=\"containerSticky\"></ng-container>\n            </th>\n        </ng-container>\n        <th *ngIf=\"!setting.hiddenOrderColumn\" class=\"stt nopad center\" [class.sticky]=\"setting.stickyColumn\"\n            (dblclick)=\"reload()\">\n            {{ 'TT' |translate}}\n            <ng-container *ngTemplateOutlet=\"containerSticky\"></ng-container>\n        </th>\n        <th *ngIf=\"rowExpansion\" class=\"nopad row-expansion-toggle center\" style=\"width: 2.5rem\"\n            [class.sticky]=\"setting.stickyColumn\">\n            <ng-container *ngTemplateOutlet=\"containerSticky\"></ng-container>\n        </th>\n        <ng-container *ngIf=\"hasTemplate('trHeaderBefore')\">\n            <ng-container [ngTemplateOutlet]=\"getTemplate('trHeaderBefore')\"\n                [ngTemplateOutletContext]=\"{$implicit: columns}\"></ng-container>\n        </ng-container>\n        <ng-container *ngFor=\"let col of columns; let i = index\">\n            <th *ngIf=\"col && col.visible && col.field!='function'\" [ngStyle]=\"col.extendData.headerStyle\"\n                [style.left]=\"col.isPinned && col.left ? (col.left + 'px') : ''\" [pTooltip]=\"col.fullLabel\"\n                tooltipStyleClass=\"unset-width\" [class]=\"col.extendData.headerClass\"\n                [className]=\"col.isPinned && col.width ? col.class : ''\" [class.first-th]=\"i==0\" [escape]=\"false\"\n                tooltipPosition=\"top\" [tnSortableColumn]=\"col.field\" [tnSortableColumnDisabled]=\"!col.sort\">\n                <ng-container *ngTemplateOutlet=\"contentTh; context: {$implicit: col}\"></ng-container>\n                <ng-container *ngIf=\"col.sort || col.sortClient\">\n                    <ng-container *ngTemplateOutlet=\"sortIcon; context: {field: col.field}\"></ng-container>\n                </ng-container>\n            </th>\n        </ng-container>\n        <ng-container *ngIf=\"hasTemplate('trHeaderAfter')\">\n            <ng-container [ngTemplateOutlet]=\"getTemplate('trHeaderAfter')\"\n                [ngTemplateOutletContext]=\"{$implicit: columns}\"></ng-container>\n        </ng-container>\n        <th *ngIf=\"enableReorderRow\" style=\"width: 30px\">\n            <ng-container *ngTemplateOutlet=\"containerSticky\"></ng-container>\n        </th>\n        <ng-container *ngTemplateOutlet=\"colFunctionHeader\"></ng-container>\n    </tr>\n    <ng-container *ngTemplateOutlet=\"rowHeaderFilter; context: {columns: columns, funcCheckAll: funcCheckAll}\">\n    </ng-container>\n</ng-template>\n<ng-template #rowHeaderFilter let-columns=\"columns\" let-funcCheckAll=\"funcCheckAll\">\n    <tr class=\"filter-row\" *ngIf=\"!setting.hiddenFilterRow\">\n        <th *ngIf=\"!setting.hiddenCheckbox\" class=\"chkbox nopad center\" [class.sticky]=\"setting.stickyColumn\"\n            [class.tricheckbox-custom-false]=\"checkedAll === false\">\n            <p-triStateCheckbox [(ngModel)]=\"checkedAll\" binary=\"true\" (onChange)=\"funcCheckAll()\">\n            </p-triStateCheckbox>\n            <ng-container *ngTemplateOutlet=\"containerSticky\"></ng-container>\n        </th>\n        <th *ngIf=\"!setting.hiddenOrderColumn\" class=\"stt center v-top\" [class.sticky]=\"setting.stickyColumn\">\n            <div *ngIf=\"!setting.hiddenSetting\" class=\"pick-color-row\" pTooltip=\"C\u1EA5u h\u00ECnh hi\u1EC3n th\u1ECB m\u00E0u\"\n                tooltipPosition=\"top\" (click)=\"showSettingRowColor()\">\n                <div></div>\n                <div></div>\n                <div></div>\n                <div></div>\n            </div>\n            <ng-container *ngTemplateOutlet=\"containerSticky\"></ng-container>\n        </th>\n        <th *ngIf=\"rowExpansion\" class=\"nopad center row-expansion-toggle\" [class.sticky]=\"setting.stickyColumn\">\n            <ng-container *ngTemplateOutlet=\"containerSticky\"></ng-container>\n        </th>\n        <ng-container *ngFor=\"let col of columns; let i = index\">\n            <th *ngIf=\"col.visible && col.field != 'function'\" class=\"cell-header-filter center\"\n                [style.left]=\"col.isPinned && col.left ? (col.left + 'px') : ''\"\n                [className]=\"col.isPinned && col.width ? col.class + ' cell-header-filter center': 'cell-header-filter center'\">\n                <ng-container *ngIf=\"col.allowFilter\">\n                    <ng-container *ngIf=\"col.templateFilter\">\n                        <ng-container [ngTemplateOutlet]=\"col.templateFilter\"\n                            [ngTemplateOutletContext]=\"{col: col, filterData: filterData, onSearch: onSearch, onShowFilterDropdownPanel: onShowFilterDropdownPanel, onHideFilterDropdownPanel: onHideFilterDropdownPanel}\">\n                        </ng-container>\n                    </ng-container>\n                    <ng-container *ngIf=\"!col.templateFilter\" [ngSwitch]=\"col.controlType\">\n                        <ng-container *ngSwitchCase=\"'dropdown'\">\n                            <ng-container [ngTemplateOutlet]=\"filterDropdown\"\n                                [ngTemplateOutletContext]=\"{col: col.rawColumn}\">\n                            </ng-container>\n                        </ng-container>\n                        <ng-container *ngSwitchCase=\"'number'\">\n                            <ng-container [ngTemplateOutlet]=\"filterNumber\" [ngTemplateOutletContext]=\"{col: col}\">\n                            </ng-container>\n                        </ng-container>\n                        <ng-container *ngSwitchCase=\"'date'\">\n                            <ng-container [ngTemplateOutlet]=\"filterDate\"\n                                [ngTemplateOutletContext]=\"{col: col, control: filterSchema.dateRange}\">\n                            </ng-container>\n                        </ng-container>\n                        <ng-container *ngSwitchCase=\"'datetime'\">\n                            <ng-container [ngTemplateOutlet]=\"filterDate\"\n                                [ngTemplateOutletContext]=\"{col: col, control: filterSchema.dateTimeRange}\">\n                            </ng-container>\n                        </ng-container>\n                        <ng-container *ngSwitchDefault>\n                            <ng-container [ngSwitch]=\"col.dataType\">\n                                <ng-container *ngSwitchCase=\"'int'\">\n                                    <ng-container [ngTemplateOutlet]=\"filterNumber\"\n                                        [ngTemplateOutletContext]=\"{col: col}\">\n                                    </ng-container>\n                                </ng-container>\n                                <ng-container *ngSwitchCase=\"'intWithoutMask'\">\n                                    <ng-container [ngTemplateOutlet]=\"filterNumber\"\n                                        [ngTemplateOutletContext]=\"{col: col}\">\n                                    </ng-container>\n                                </ng-container>\n                                <ng-container *ngSwitchCase=\"'decimal'\">\n                                    <ng-container [ngTemplateOutlet]=\"filterNumber\"\n                                        [ngTemplateOutletContext]=\"{col: col}\">\n                                    </ng-container>\n                                </ng-container>\n                                <ng-container *ngSwitchCase=\"'currency'\">\n                                    <ng-container [ngTemplateOutlet]=\"filterNumber\"\n                                        [ngTemplateOutletContext]=\"{col: col}\">\n                                    </ng-container>\n                                </ng-container>\n                                <ng-container *ngSwitchCase=\"'date'\">\n                                    <ng-container [ngTemplateOutlet]=\"filterDate\"\n                                        [ngTemplateOutletContext]=\"{col: col, control: filterSchema.dateRange}\">\n                                    </ng-container>\n                                </ng-container>\n                                <ng-container *ngSwitchCase=\"'datetime'\">\n                                    <ng-container [ngTemplateOutlet]=\"filterDate\"\n                                        [ngTemplateOutletContext]=\"{col: col, control: filterSchema.dateTimeRange}\">\n                                    </ng-container>\n                                </ng-container>\n                                <ng-container *ngSwitchCase=\"'boolean'\">\n                                    <ng-container [ngTemplateOutlet]=\"filterBoolean\"\n                                        [ngTemplateOutletContext]=\"{col: col}\">\n                                    </ng-container>\n                                </ng-container>\n                                <ng-container *ngSwitchDefault>\n                                    <ng-container [ngTemplateOutlet]=\"filterText\"\n                                        [ngTemplateOutletContext]=\"{col: col}\">\n                                    </ng-container>\n                                </ng-container>\n                            </ng-container>\n                        </ng-container>\n                    </ng-container>\n                </ng-container>\n                <ng-container *ngTemplateOutlet=\"containerSticky\"></ng-container>\n            </th>\n        </ng-container>\n        <th *ngIf=\"enableReorderRow\" style=\"width: 30px\">\n            <ng-container *ngTemplateOutlet=\"containerSticky\"></ng-container>\n        </th>\n        <ng-container *ngTemplateOutlet=\"buttonBaseSetting\"></ng-container>\n    </tr>\n</ng-template>\n<ng-template #buttonBaseSetting>\n    <ng-container *ngIf=\"!setting.hiddenFunctionColumn\">\n        <th class=\"center setting-cell column-function\" [class.sticky]=\"setting.stickyColumn\">\n            <button *ngIf=\"!setting.hiddenSetting\" type=\"button\" pButton pRipple icon=\"pi pi-cog\"\n                class=\"p-button-rounded p-button-text\" pTooltip=\"C\u1EA5u h\u00ECnh hi\u1EC3n th\u1ECB\" tooltipPosition=\"top\"\n                (click)=\"showSettings()\"></button>\n            <button *ngIf=\"!setting.hiddenSettingPermission\" type=\"button\" pButton pRipple icon=\"pi pi-users\"\n                class=\"p-button-rounded p-button-text\" pTooltip=\"Ph\u00E2n quy\u1EC1n d\u1EEF li\u1EC7u\" tooltipPosition=\"left\"\n                [disabled]=\"!checkPermissionToUseButton(BUTTON_PHAN_QUYEN)\" (click)=\"showSettingsPermission()\"></button>\n            <button *ngIf=\"!setting.hiddenSettingWorkflow\" type=\"button\" pButton pRipple icon=\"pi pi-sitemap\"\n                class=\"p-button-rounded p-button-text\" pTooltip=\"C\u1EA5u h\u00ECnh quy tr\u00ECnh\" tooltipPosition=\"left\"\n                [disabled]=\"!checkPermissionToUseButton(BUTTON_CAU_HINH_QUY_TRINH)\"\n                (click)=\"showSettingsWorkflowNew()\"></button>\n            <div *ngIf=\"setting.hiddenSetting && setting.hiddenSettingPermission && setting.hiddenSettingWorkflow\"\n                class=\"cell-header-function\">\n                <span>{{'GRID.FUNCTION'| translate}}</span>\n            </div>\n            <ng-container *ngTemplateOutlet=\"containerSticky\"></ng-container>\n        </th>\n    </ng-container>\n\n</ng-template>\n<ng-template #colFunctionHeader>\n    <ng-container *ngIf=\"!setting.hiddenFunctionColumn\">\n        <ng-container *ngIf=\"setting.hiddenFilterRow\">\n            <ng-container *ngTemplateOutlet=\"buttonBaseSetting\"></ng-container>\n        </ng-container>\n        <ng-container *ngIf=\"!setting.hiddenFilterRow\">\n            <th class=\"column-function\" [class.sticky]=\"setting.stickyColumn\">\n                <div class=\"cell-header-function\">\n                    <span>{{'GRID.FUNCTION'| translate}}</span>\n                </div>\n                <ng-container *ngTemplateOutlet=\"containerSticky\"></ng-container>\n            </th>\n        </ng-container>\n    </ng-container>\n</ng-template>\n<ng-template #contentTh let-col>\n    <ng-container *ngIf=\"templateHeaderContent[col.field]\">\n        <ng-container *ngTemplateOutlet=\"templateHeaderContent[col.field]\"></ng-container>\n    </ng-container>\n    <ng-container *ngIf=\"!templateHeaderContent[col.field]\">\n        {{col.label}}\n    </ng-container>\n    <ng-container *ngTemplateOutlet=\"containerSticky\"></ng-container>\n</ng-template>\n<ng-template #trBody let-rowData let-columns=\"columns\" let-index=\"index\" let-expanded=\"expanded\"\n    let-eventSelectRow=\"eventSelectRow\" let-eventChecked=\"eventChecked\">\n    <tr *ngIf=\"!rowData.template\" [tnReorderableRow]=\"index\" [attr.rowIndex]=\"index\" [ngClass]=\"rowData.objStyleClass\"\n        [class.ui-state-highlight]=\"rowData._checked\" [pTooltip]=\"rowData.tooltip\" tooltipPosition=\"top\"\n        [tooltipStyleClass]=\"rowData.tooltipClass\" [escape]=\"escape\" (click)=\"eventSelectRow($event, rowData)\">\n        <ng-container *ngIf=\"!setting.hiddenCheckbox && !rowData.hidden[fieldCheckbox]\">\n            <td class=\"chkbox link-or-action cell-checkbox\" [class.sticky]=\"setting.stickyColumn\"\n                [attr.colSpan]=\"rowData.colSpan && rowData.colSpan[fieldCheckbox]\"\n                [attr.rowSpan]=\"rowData.rowSpan && rowData.rowSpan[fieldCheckbox]\">\n                <ng-container *ngIf=\"!rowData.hiddenCheckBox\">\n                    <ng-container *ngIf=\"!hasTemplate('checkbox')\">\n                        <p-checkbox [(ngModel)]=\"rowData._checked\" binary=\"true\" (onChange)=\"eventChecked(rowData)\">\n                        </p-checkbox>\n                    </ng-container>\n                    <ng-container *ngIf=\"hasTemplate('checkbox')\">\n                        <ng-container [ngTemplateOutlet]=\"getTemplate('checkbox')\"\n                            [ngTemplateOutletContext]=\"{rowData: rowData, rowIndex: index}\"></ng-container>\n                    </ng-container>\n                </ng-container>\n                <ng-container *ngTemplateOutlet=\"containerSticky\"></ng-container>\n            </td>\n        </ng-container>\n        <td *ngIf=\"!setting.hiddenOrderColumn && !rowData.hidden[fieldOrder]\" class=\"stt\" style=\"text-align: center;\"\n            [class.sticky]=\"setting.stickyColumn\" [attr.colSpan]=\"rowData.colSpan && rowData.colSpan[fieldOrder]\"\n            [attr.rowSpan]=\"rowData.rowSpan && rowData.rowSpan[fieldOrder]\">\n            <span class=\"row-card\" [ngStyle]=\"rowData.bookmarkStyle\"></span>\n            {{rowData[fieldOrder]}}\n            <ng-container *ngTemplateOutlet=\"containerSticky\"></ng-container>\n        </td>\n        <td *ngIf=\"rowExpansion && !rowData.hidden[fieldColExpand]\" class=\"no-padding center row-expansion-toggle\"\n            [class.sticky]=\"setting.stickyColumn\" [attr.colSpan]=\"rowData.colSpan && rowData.colSpan[fieldColExpand]\"\n            [attr.rowSpan]=\"rowData.rowSpan && rowData.rowSpan[fieldColExpand]\">\n            <ng-container *ngTemplateOutlet=\"iconToggleRowData; context: {rowData: rowData, expanded: expanded}\">\n            </ng-container>\n            <ng-container *ngTemplateOutlet=\"containerSticky\"></ng-container>\n        </td>\n        <ng-container *ngIf=\"!hasTemplate('dynamicColBodys')\">\n            <ng-container *ngIf=\"hasTemplate('dynamicColBodysBefore')\">\n                <ng-container [ngTemplateOutlet]=\"getTemplate('dynamicColBodysBefore')\"\n                    [ngTemplateOutletContext]=\"{$implicit: columns, rowData: rowData, index: index, expanded: expanded}\">\n                </ng-container>\n            </ng-container>\n            <ng-container\n                *ngTemplateOutlet=\"dynamicColBodys; context: {$implicit: columns, rowData: rowData, index: index, expanded: expanded}\">\n            </ng-container>\n            <ng-container *ngIf=\"hasTemplate('dynamicColBodysAfter')\">\n                <ng-container [ngTemplateOutlet]=\"getTemplate('dynamicColBodysAfter')\"\n                    [ngTemplateOutletContext]=\"{$implicit: columns, rowData: rowData, index: index, expanded: expanded}\">\n                </ng-container>\n            </ng-container>\n        </ng-container>\n        <ng-container *ngIf=\"hasTemplate('dynamicColBodys')\">\n            <ng-container [ngTemplateOutlet]=\"getTemplate('dynamicColBodys')\"\n                [ngTemplateOutletContext]=\"{$implicit: columns, rowData: rowData, index: index, expanded: expanded}\">\n            </ng-container>\n        </ng-container>\n        <td *ngIf=\"enableReorderRow && !rowData.hidden[fieldColReorder]\" class=\"no-padding center\"\n            [attr.colSpan]=\"rowData.colSpan && rowData.colSpan[fieldColReorder]\"\n            [attr.rowSpan]=\"rowData.rowSpan && rowData.rowSpan[fieldColReorder]\">\n            <i class=\"fas fa-arrows-alt\" style=\"cursor:pointer; padding: 8px; color: #555;\" pReorderableRowHandle></i>\n            <ng-container *ngTemplateOutlet=\"containerSticky\"></ng-container>\n        </td>\n        <ng-container *ngIf=\"!setting.hiddenFunctionColumn && !rowData.hidden[fieldFunction]\">\n            <td class=\"text-center column-function\" style=\"text-align: center;\" [class.sticky]=\"setting.stickyColumn\"\n                [attr.colSpan]=\"rowData.colSpan && rowData.colSpan[fieldFunction]\"\n                [attr.rowSpan]=\"rowData.rowSpan && rowData.rowSpan[fieldFunction]\">\n                <div *ngIf=\"hasTemplate('function')\" class=\"p-toolbar-group-center button-group\">\n                    <ng-container [ngTemplateOutlet]=\"getTemplate('function')\"\n                        [ngTemplateOutletContext]=\"{rowData: rowData, rowIndex: index}\"></ng-container>\n                    <ng-container *ngTemplateOutlet=\"containerSticky\"></ng-container>\n                </div>\n                <div *ngIf=\"!hasTemplate('function')\" class=\"p-toolbar-group-center button-group\">\n                    <ng-container [ngTemplateOutletContext]=\"{rowData: rowData, rowIndex: index}\"\n                        [ngTemplateOutlet]=\"getTemplate('buttonBefore')\"></ng-container>\n                    <button *ngIf=\"setting.showVersionButton\" type=\"button\" pButton pRipple icon=\"pi pi-calendar\"\n                        class=\"p-button-rounded p-button-text p-button-success link-or-action\"\n                        pTooltip=\"Xem l\u1ECBch s\u1EED phi\u00EAn b\u1EA3n\" tooltipPosition=\"top\"\n                        (click)=\"showListVersion(rowData)\"></button>\n                    <button *ngIf=\"!rowData.hiddenEdit\" [appAuthorize]=\"serviceCode\"\n                        [permission]=\"authorizePaths[commonConst.EDIT]\"\n                        [enableAuthorize]=\"buttonApplyAuthorize[commonConst.EDIT]\" type=\"button\" pButton pRipple\n                        [disabled]=\"disableEdit(rowData)\" [pTooltip]=\"'FORM.EDIT' | translate\" tooltipPosition=\"top\"\n                        class=\"p-button-rounded p-button-text p-button-info link-or-action\" icon=\"pi pi-pencil\"\n                        (click)=\"edit(rowData)\"></button>\n                    <button *ngIf=\"!rowData.hiddenDelete\" [appAuthorize]=\"serviceCode\"\n                        [permission]=\"authorizePaths[commonConst.DELETE]\"\n                        [enableAuthorize]=\"buttonApplyAuthorize[commonConst.DELETE]\" type=\"button\" pButton pRipple\n                        [disabled]=\"disableDelete(rowData)\" [pTooltip]=\"'FORM.DELETE' | translate\" tooltipPosition=\"top\"\n                        class=\"p-button-rounded p-button-text p-button-danger link-or-action\" icon=\"pi pi-trash\"\n                        (click)=\"delete(rowData)\"></button>\n                    <ng-container *ngIf=\"!hiddenBtnFunction\">\n                        <button *ngIf=\"showMenuButtons && menuButtons\" type=\"button\" pButton icon=\"pi pi-ellipsis-v\"\n                            class=\"link-or-action p-button-text p-button-info p-button-rounded\"\n                            pTooltip=\"Ch\u1EE9c n\u0103ng kh\u00E1c\" tooltipPosition=\"top\" [disabled]=\"rowData.disableFunctionRow\"\n                            (click)=\"showContextMenu($event, rowData)\"></button>\n                    </ng-container>\n                    <ng-container [ngTemplateOutletContext]=\"{rowData: rowData, rowIndex: index}\"\n                        [ngTemplateOutlet]=\"getTemplate('buttonAfter')\"></ng-container>\n                </div>\n                <ng-container *ngTemplateOutlet=\"containerSticky\"></ng-container>\n            </td>\n        </ng-container>\n    </tr>\n    <ng-container *ngIf=\"rowData.template\">\n        <ng-container *ngTemplateOutlet=\"rowData.template; context: {\n            $implicit: rowData, columns: columns, index: index, expanded: expanded, eventSelectRow: eventSelectRow, eventChecked: eventChecked\n        }\"></ng-container>\n    </ng-container>\n</ng-template>\n<ng-template #dynamicColBodys let-columns let-rowData=\"rowData\" let-index=\"index\" let-expanded=\"expanded\">\n    <ng-container *ngFor=\"let col of columns; let i = index\">\n        <ng-container\n            *ngTemplateOutlet=\"contentTd; context: {$implicit: rowData, col: col, index: index, i: i, expanded: expanded}\">\n        </ng-container>\n    </ng-container>\n</ng-template>\n<ng-template #contentTd let-rowData let-col=\"col\" let-index=\"index\" let-expanded=\"expanded\" let-i=\"i\">\n    <td *ngIf=\"col && col.visible && col.field != 'function' && !rowData.hidden[col.field]\"\n        [attr.colSpan]=\"rowData.colSpan && rowData.colSpan[col.field]\"\n        [style.left]=\"col.isPinned && col.left ? (col.left + 'px') : ''\"\n        [attr.rowSpan]=\"rowData.rowSpan && rowData.rowSpan[col.field]\" [ngStyle]=\"col.extendData.style\"\n        [class]=\"col.cellClass\" [class.first-td]=\"i == 0\">\n        <span *ngIf=\"col.pipe\">\n            <span class=\"p-column-title\" [pTooltip]=\"col.fullLabel\" [escape]=\"false\"\n                tooltipPosition=\"top\">{{col.label}}</span>\n            {{rowData['pipe__' + col.field]}}\n        </span>\n        <span *ngIf=\"!col.pipe\" class=\"contentTd\">\n            <span class=\"p-column-title\" [pTooltip]=\"col.fullLabel\" [escape]=\"false\"\n                tooltipPosition=\"top\">{{col.label}}</span>\n            <span *ngIf=\"setting.showEditLink && col.showEditLink\" [pTooltip]=\"config.tooltipView\" tooltipPosition=\"top\"\n                class=\"link-or-action\">\n                <ng-container *ngIf=\"col.click\">\n                    <a href=\"javascript:;\" (click)=\"col.click(rowData)\" [pTooltip]=\"config.tooltipView\"\n                        tooltipPosition=\"top\">\n                        <ng-container [ngTemplateOutlet]=\"contentCell\"\n                            [ngTemplateOutletContext]=\"getContextCell(rowData, index, col, expanded, this)\">\n                        </ng-container>\n                    </a>\n                </ng-container>\n                <ng-container *ngIf=\"!col.click\">\n                    <a href=\"javascript:;\" (click)=\"view(rowData)\" [pTooltip]=\"config.tooltipView\"\n                        tooltipPosition=\"top\">\n                        <ng-container [ngTemplateOutlet]=\"contentCell\"\n                            [ngTemplateOutletContext]=\"getContextCell(rowData, index, col, expanded, this)\">\n                        </ng-container>\n                    </a>\n                </ng-container>\n            </span>\n            <span *ngIf=\"!setting.showEditLink || !col.showEditLink\" class=\"\">\n                <ng-container [ngTemplateOutlet]=\"contentCell\"\n                    [ngTemplateOutletContext]=\"getContextCell(rowData, index, col, expanded, this)\">\n                </ng-container>\n            </span>\n        </span>\n        <ng-container *ngTemplateOutlet=\"containerSticky\"></ng-container>\n    </td>\n</ng-template>\n<ng-template #contentCell let-col=\"col\" let-rowData=\"rowData\" let-rowIndex=\"rowIndex\" let-field=\"field\"\n    let-expanded=\"expanded\">\n    <ng-container *ngIf=\"col.template\">\n        <ng-container [ngTemplateOutlet]=\"col.template\"\n            [ngTemplateOutletContext]=\"getContextCell(rowData, rowIndex, col, expanded,this)\">\n        </ng-container>\n    </ng-container>\n    <ng-container *ngIf=\"!col.template\">\n        <ng-container [ngSwitch]=\"col.dataType\">\n            <span *ngSwitchCase=\"'color'\" style=\"display:block;text-align:center;\">\n                <div [pTooltip]=\"rowData[field]\" tooltipPosition=\"top\" [ngStyle]=\"{'background-color':rowData[field]}\"\n                    style=\"width:30px;height:30px;margin:0 auto;\"></div>\n            </span>\n            <span *ngSwitchCase=\"'icon'\" style=\"display:block;text-align:center;\">\n                <i [pTooltip]=\"rowData[field]\" tooltipPosition=\"top\" style=\"text-align: center;\"\n                    [ngClass]=\"rowData[field]\"></i>\n            </span>\n            <span *ngSwitchCase=\"'date'\" [pTooltip]=\"rowData[field] | date:'dd/MM/yyyy'\" tooltipPosition=\"top\">\n                {{rowData[field] | tnDate:col.dataType:col.format}}\n            </span>\n            <span *ngSwitchCase=\"'datetime'\" [pTooltip]=\"rowData[field] | date:'dd/MM/yyyy HH:mm'\"\n                tooltipPosition=\"top\">\n                {{rowData[field] | tnDate:col.dataType:col.format}}\n            </span>\n            <span *ngSwitchCase=\"'int'\">\n                {{rowData[field] | number}}\n            </span>\n            <span *ngSwitchCase=\"'intWithoutMask'\">\n                {{rowData[field]}}\n            </span>\n            <span *ngSwitchCase=\"'currency'\">\n                {{rowData[field] | currency:\"VND\"}}\n            </span>\n            <span *ngSwitchCase=\"'decimal'\">\n                {{rowData[field] | number}}\n            </span>\n            <span *ngSwitchCase=\"'boolean'\">\n                <p-checkbox class=\"boolean-data-type\" [(ngModel)]=\"rowData[field]\" binary=\"true\"\n                    [disabled]=\"col.disableCheckBox\">\n                </p-checkbox>\n            </span>\n            <span *ngSwitchCase=\"'html'\">\n                <div *ngIf=\"rowData[field]==null?'':rowData[field]\" [innerHTML]=\"rowData[field] | safeHtml\"></div>\n            </span>\n            <span *ngSwitchCase=\"'metadataStatus'\">\n                <span *ngIf=\"rowData['rejectReason']\" class=\"label-danger\" [pTooltip]=\"rowData['rejectReason']\"\n                    tooltipStyleClass=\"unset-width\" [escape]=\"false\" tooltipPosition=\"top\">T\u1EEB ch\u1ED1i</span>\n                <span *ngIf=\"rowData[field] == '0' && !rowData['rejectReason']\" class=\"label-secondary\">Ch\u01B0a\n                    duy\u1EC7t</span>\n                <span *ngIf=\"rowData[field] == '1' && !rowData['rejectReason']\" class=\"label-warning\">Ch\u1EDD duy\u1EC7t</span>\n                <span *ngIf=\"rowData[field] == '2'\" class=\"label-primary\">\u0110\u00E3 duy\u1EC7t</span>\n            </span>\n            <ng-container *ngSwitchCase=\"'fileUpload'\">\n                <ng-container\n                    *ngTemplateOutlet=\"fileUploadColumn; context: {$implicit: rowData, field: col.field, fileSetting: col.fileSetting}\">\n                </ng-container>\n            </ng-container>\n            <ng-container *ngSwitchCase=\"'fileManager'\">\n                <ng-container\n                    *ngTemplateOutlet=\"fileManagerColumn; context: {$implicit: rowData, field: col.field, fileSetting: col.fileSetting}\">\n                </ng-container>\n            </ng-container>\n            <ng-container *ngSwitchCase=\"'string'\">\n                <ng-container *ngTemplateOutlet=\"contentCellString; context: {$implicit: rowData, field: col.field}\">\n                </ng-container>\n            </ng-container>\n            <ng-container *ngSwitchCase=\"null\">\n                <ng-container *ngTemplateOutlet=\"contentCellString; context: {$implicit: rowData, field: col.field}\">\n                </ng-container>\n            </ng-container>\n            <ng-container *ngSwitchDefault>\n                <ng-container [ngTemplateOutlet]=\"getComponentByType(col.dataType)\"\n                    [ngTemplateOutletContext]=\"getContextCell(rowData, rowIndex, col, expanded, this)\">\n                </ng-container>\n            </ng-container>\n        </ng-container>\n    </ng-container>\n</ng-template>\n<ng-template #contentCellString let-rowData let-field=\"field\">\n    <span>\n        <!-- __sv: Short Value -->\n        <ng-container *ngIf=\"rowData[field + '__sv']\">\n            <ng-container *ngIf=\"!rowData[field + '__showFull']\">\n                {{rowData[field + '__sv']}}\n                <span class=\"toggle-showfull\" (click)=\"toggleShowFull(rowData, field)\" pTooltip=\"B\u1EA5m \u0111\u1EC3 xem th\u00EAm\"\n                    tooltipPosition=\"top\">[...]</span>\n            </ng-container>\n            <ng-container *ngIf=\"rowData[field + '__showFull']\">\n                {{rowData[field]}}\n                <span class=\"toggle-showfull\" (click)=\"toggleShowFull(rowData, field)\">Thu g\u1ECDn</span>\n            </ng-container>\n        </ng-container>\n        <ng-container *ngIf=\"!rowData[field + '__sv']\">\n            {{rowData[field]}}\n        </ng-container>\n    </span>\n</ng-template>\n<ng-template #iconToggleRowGroup let-rowData=\"rowData\" let-expanded=\"expanded\">\n    <a href=\"javascript:;\" (click)=\"handleToggleRow(rowData, $event)\">\n        <i style=\"margin-right:5px\" [ngClass]=\"expanded ? 'fas fa-fw fa-caret-down' : 'fas fa-fw fa-caret-right'\"></i>\n    </a>\n</ng-template>\n<ng-template #iconToggleRowData let-rowData=\"rowData\" let-expanded=\"expanded\">\n    <button type=\"button\" pButton pRipple class=\"link-or-action p-button-text p-button-rounded p-button-plain\"\n        [icon]=\"expanded ? 'pi pi-chevron-down' : 'pi pi-chevron-right'\"\n        (click)=\"handleToggleRow(rowData, $event)\"></button>\n</ng-template>\n<ng-template #_contentRowGroup let-rowData=\"rowData\" let-groupCol=\"groupCol\" let-groupField=\"_groupField\">\n    <ng-container [ngTemplateOutlet]=\"contentCell\"\n        [ngTemplateOutletContext]=\"{rowData: rowData, col: groupCol, field: _groupField}\">\n    </ng-container>\n    <span *ngIf=\"setting.columnSetting.showGroupSize\">\n        ({{rowGroupMetadata[rowData[_groupField]].size}})</span>\n</ng-template>\n<ng-template #trangThaiV5 let-rowData=\"rowData\">\n    <div class=\"container-text-workflow\">\n        <button *ngIf=\"!rowData.__workflowCode && !rowData.hiddenWorkflowAction && !rowData.hiddenStartWorkflow\" pButton\n            class=\"p-button-text link-or-action\" label=\"B\u1EAFt \u0111\u1EA7u\" style=\"border: 1px solid #7ca9cd;\"\n            pTooltip=\"B\u1EAFt \u0111\u1EA7u ch\u1EA1y quy tr\u00ECnh\" tooltipPosition=\"top\"\n            [disabled]=\"rowData.__startingWorkflow && !rowData.__notReadyForStart\"\n            (click)=\"showFormStartWorkflow(rowData)\"></button>\n        <ng-container *ngIf=\"rowData.__workflowCode\">\n            <span class=\"content\">{{rowData.__textTrangThai}}</span>\n            <button *ngIf=\"!rowData.hiddenWorkflowAction\" type=\"button\" pButton icon=\"pi pi-ellipsis-v\"\n                class=\"link-or-action p-button-text p-button-rounded\" pTooltip=\"H\u00E0nh \u0111\u1ED9ng\" tooltipPosition=\"top\"\n                [disabled]=\"showingActionWorkflow\" (click)=\"showActionWorkflow($event, rowData)\"></button>\n        </ng-container>\n    </div>\n</ng-template>\n<ng-template #viewHistory let-rowData=\"rowData\">\n    <button pButton icon=\"pi pi-calendar\" class=\"p-button-text p-button-rounded link-or-action\" pTooltip=\"Xem l\u1ECBch s\u1EED\"\n        tooltipPosition=\"top\" (click)=\"viewHistoryWorkflow(setting, rowData)\"></button>\n</ng-template>\n<ng-template #containerSticky>\n    <span class=\"fix-sticky top\"></span>\n    <span class=\"fix-sticky right\"></span>\n    <!-- <span class=\"fix-sticky bottom\"></span> -->\n    <span class=\"fix-sticky left\"></span>\n</ng-template>\n<ng-template #sortIcon let-field=\"field\">\n    <i class=\"p-sortable-column-icon pi\" style=\"font-size: 0.8em;\"\n        [ngClass]=\"{'pi-sort-amount-up-alt': field == _sortField && _sortDir === 1, 'pi-sort-amount-down': field == _sortField && _sortDir === -1, 'pi-sort-alt': field != _sortField || _sortDir === 0}\"></i>\n</ng-template>\n<ng-template #filterDropdown let-col=\"col\">\n    <div #filterBox style=\"width: 100%; border-radius: 4px;\">\n        <dropdown *ngIf=\"col && filterSchema.dropdown[col.field]\" [control]=\"filterSchema.dropdown[col.field]\"\n            [dataSource]=\"filterSchema.dropdown[col.field].dataSource\" [(value)]=\"filterData[col.field]\"\n            (onChanged)=\"prepareSearch(col)\" (onHideSmartEvent)=\"onSearch()\"\n            (onShow)=\"onShowFilterDropdownPanel($event)\" (onHide)=\"onHideFilterDropdownPanel($event)\"\n            (mousedown)=\"initFilterBoxFocus(filterBox)\"></dropdown>\n    </div>\n</ng-template>\n<ng-template #filterText let-col=\"col\">\n    <div #filterBox class=\"text-filter filter-box\" tabindex=\"-1\" (mousedown)=\"initFilterBoxFocus(filterBox)\">\n        <div tabindex=\"-1\">\n            <input pInputText type=\"text\" class=\"input-search\" [placeholder]=\"col.label\"\n                [(ngModel)]=\"filterData[col.field]\" (change)=\"onSearch()\"\n                (keyup.esc)=\"onClearSearch(filterBox, col.field)\">\n        </div>\n        <span [ngClass]=\"{'action-clear': true, 'dirty': filterData[col.field] != null && filterData[col.field] !== ''}\"\n            [pTooltip]=\"'B\u1ECF filter'\" tooltipPosition=\"top\" (mousedown)=\"onClearSearch(filterBox, col.field)\"\n            tabindex=\"-1\"><i class=\"pi pi-filter-slash\"></i></span>\n        <after-view-checked style=\"display: none;\" (loaded)=\"initFilterBoxFocus(filterBox)\">\n        </after-view-checked>\n    </div>\n</ng-template>\n<ng-template #filterNumber let-col=\"col\">\n    <div #filterBox class=\"number-picker-range filter-box\" tabindex=\"-1\" (mousedown)=\"initFilterBoxFocus(filterBox)\">\n        <div tabindex=\"-1\">\n            <tn-number-picker-range #numberRange [maskType]=\"col.dataType\" [(ngModel)]=\"filterData[col.field]\"\n                [min]=\"col.min\" [max]=\"col.max\" [placeholder]=\"col.placeholder\" (change)=\"onSearch()\">\n            </tn-number-picker-range>\n        </div>\n        <span\n            [ngClass]=\"{'action-clear': true, 'dirty': filterData[col.field] && ((filterData[col.field][0] != null && filterData[col.field][0] !== '') || (filterData[col.field][1] != null && filterData[col.field][1] !== ''))}\"\n            [pTooltip]=\"'B\u1ECF filter'\" tooltipPosition=\"top\" (mousedown)=\"onClearNumberSearch(filterBox, numberRange)\"\n            tabindex=\"-1\">\n            <i class=\"pi pi-filter-slash\"></i></span>\n        <after-view-checked style=\"display: none;\" (loaded)=\"initFilterBoxFocus(filterBox)\">\n        </after-view-checked>\n    </div>\n</ng-template>\n<ng-template #filterDate let-col=\"col\" let-control=\"control\">\n    <div #filterBox class=\"date-picker-range filter-box\" tabindex=\"-1\" (mousedown)=\"initFilterBoxFocus(filterBox)\">\n        <div tabindex=\"-1\">\n            <tn-datetime-picker-range #dateRange [control]=\"control\" (onChanged)=\"onChangeDateTime($event, col.field)\">\n            </tn-datetime-picker-range>\n        </div>\n        <span\n            [ngClass]=\"{'action-clear': true, 'dirty': filterData[col.field] && ((filterData[col.field][0] != null && filterData[col.field][0] !== '') || (filterData[col.field][1] != null && filterData[col.field][1] !== ''))}\"\n            [pTooltip]=\"'B\u1ECF filter'\" tooltipPosition=\"top\"\n            (mousedown)=\"onClearDateSearch(filterBox, dateRange, col.field)\" tabindex=\"-1\"><i\n                class=\"pi pi-filter-slash\"></i></span>\n        <after-view-checked style=\"display: none;\" (loaded)=\"initFilterBoxFocus(filterBox)\">\n        </after-view-checked>\n    </div>\n</ng-template>\n<ng-template #filterBoolean let-col=\"col\">\n    <div class=\"filter-boolean-box\">\n        <p-selectButton *ngIf=\"!col.minimizeFilter\"\n            [options]=\"[{value: true, label: 'C\u00F3', icon: 'pi pi-check'}, {value: false, label: 'Kh\u00F4ng', icon: 'pi pi-times'}]\"\n            [multiple]=\"true\" [(ngModel)]=\"filterData[col.field]\" (onChange)=\"onChangeBoolean($event, col.field)\">\n            <ng-template let-item>\n                <i style=\"padding: 3px 0;\" [class]=\"item.icon\"></i>\n            </ng-template>\n        </p-selectButton>\n        <ng-container *ngIf=\"col.minimizeFilter\">\n            <button *ngIf=\"!filterData[col.field]\" type=\"button\" pButton icon=\"pi pi-filter-slash\"\n                class=\"btn-filter-boolean\" (click)=\"showCheckBoxFilterMenu($event, col.field)\"></button>\n            <button *ngIf=\"filterData[col.field]\" type=\"button\" pButton icon=\"pi pi-filter\"\n                class=\"btn-filter-boolean p-button-primary\"\n                (click)=\"showCheckBoxFilterMenu($event, col.field)\"></button>\n        </ng-container>\n    </div>\n</ng-template>\n<ng-template #fileUploadColumn let-field=\"field\" let-rowData let-fileSetting=\"fileSetting\">\n    <file-upload *ngIf=\"fileSetting.control.mode == FileUploadMode.usingFileInstanceId\"\n        [sharedFolderType]=\"fileSetting.control.sharedFolderType\" [readonly]=\"fileSetting.control.readonly\"\n        [accept]=\"fileSetting.control.accept\" [(ngModel)]=\"rowData[field]\"\n        (onChanged)=\"handleFieldValueChange(fileSetting, $event, rowData, eventType.CHANGE)\"\n        (onInit)=\"handleFieldValueChange(fileSetting, $event, rowData, eventType.INIT)\"\n        (onSelect)=\"handleFieldValueChange(fileSetting, $event, rowData, eventType.SELECT)\"\n        (onRemove)=\"handleFieldValueChange(fileSetting, $event, rowData, eventType.DELETED)\">\n    </file-upload>\n\n    <service-file-upload *ngIf=\"fileSetting.control.mode == FileUploadMode.usingServiceFile\"\n        [serviceCode]=\"fileSetting.control.serviceCode\" [parentContext]=\"context\" [entity]=\"fileSetting.control.entity\"\n        [entityKey]=\"rowData[fileSetting.control.entityKeyField]\" [control]=\"fileSetting.control\"\n        [fileDataService]=\"fileSetting.control.fileDataService\" [(ngModel)]=\"rowData.field\"\n        (onChanged)=\"handleFieldValueChange(fileSetting, $event, rowData, eventType.CHANGE)\"\n        (onInit)=\"handleFieldValueChange(fileSetting, $event, rowData, eventType.INIT)\"\n        (onSelect)=\"handleFieldValueChange(fileSetting, $event, rowData, eventType.SELECT)\"\n        (onRemove)=\"handleFieldValueChange(fileSetting, $event, rowData, eventType.DELETED)\">\n    </service-file-upload>\n</ng-template>\n<ng-template #fileManagerColumn let-rowData let-fileSetting=\"fileSetting\" let-field=\"field\">\n    <file-manager [control]=\"fileSetting.control\" [serviceCode]=\"fileSetting.control.serviceCode\"\n        [entity]=\"fileSetting.control.entity\" [entityKey]=\"rowData[fileSetting.control.entityKeyField]\"\n        [readonly]=\"fileSetting.control.readonly\" [layout]=\"fileSetting.control.layout\"\n        [fileDataService]=\"fileSetting.control.fileDataService\" [maxFileSize]=\"fileSetting.control.maxFileSize\"\n        [inTaiLieu]=\"fileSetting.control.inTaiLieu\" [(value)]=\"rowData[field]\" [disabled]=\"fileSetting.control.disabled\"\n        (onChanged)=\"handleFieldValueChange(fileSetting, $event, rowData, eventType.CHANGE)\"\n        (onInit)=\"handleFieldValueChange(fileSetting, $event, rowData, eventType.INIT)\"\n        (onSelect)=\"handleFieldValueChange(fileSetting, $event, rowData, eventType.SELECT)\"\n        (onRemove)=\"handleFieldValueChange(fileSetting, $event, rowData, eventType.DELETED)\"\n        (uploaded)=\"handleFieldValueChange(fileSetting, $event, rowData, eventType.UPLOADED)\">\n    </file-manager>\n</ng-template>",
                providers: [DecimalPipe, DatePipe],
                styles: [".container-table{display:flex;overflow:hidden;flex-direction:column}.container-table .container-table-inner{display:flex;position:relative;height:auto;max-height:100%;min-height:60px}.container-table-inner>tn-custom-scrollbar{width:100%}.cell-checkbox{text-align:center}.pick-color-row{top:0;left:0;right:0;bottom:0;margin:auto;position:absolute;display:flex;flex-wrap:wrap;width:1.4em;height:1.4em;border:1px solid #d1d1d1;border-radius:2px;cursor:pointer}.pick-color-row>div{flex:0 0 50%;background:#84d140;border:1px solid #fff}.pick-color-row>div:nth-child(2){background:#fc6868}.pick-color-row>div:nth-child(3){background:#fbc02d}.pick-color-row>div:nth-child(4){background:#7dc5ff}.cell-header-function{display:flex;align-items:center}.cell-header-function>span{text-align:center;flex:1 1}.cell-header-function button{width:24px;height:24px;padding:0;margin:0}.group-icon{font-weight:400;color:#256aa2}.group-icon i{font-size:.8em;margin-right:5px}.center{text-align:center!important}.row-card{position:absolute;left:0;top:0;width:5px;height:100%}.column-function{min-width:100px;padding:0}.custom-search-area{margin:-.5em -1em .5em;padding-left:.5em;padding-right:.5em;background-color:#f2f2f2}.main-title>h1{font-size:1.2em}.filter-row>th:not(.sticky):not(.chkbox){padding:3px!important}.container-text-workflow{display:flex;align-items:center;justify-content:center}.container-text-workflow .link-or-action{color:#2196f3;cursor:pointer}.container-text-workflow .content{flex:1 1}.btnReload{height:2rem!important;width:2rem;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.toggle-showfull{color:#00f;cursor:pointer;font-size:.8rem;white-space:nowrap;font-weight:700}.col-share-permission>div:not(:last-child){margin-bottom:5px}.advance-search-container{display:flex;justify-content:flex-end}.btn-filter-boolean{width:26px;height:26px}.btn-filter-boolean:not(.p-button-primary),.btn-filter-boolean:not(.p-button-primary):hover{background:#f5f6f8;color:#6c757d;border-color:#ced4da}::ng-deep crud-list advance-search{display:block;flex:1;max-width:400px}::ng-deep crud-list .ps__rail-x,::ng-deep crud-list .ps__rail-y{z-index:5}::ng-deep crud-list .main-title>*>h1{font-size:1.2em}::ng-deep crud-list .p-datatable .p-datatable-thead>tr>th.cell-fixed-filter{z-index:999}::ng-deep crud-list .p-datatable .p-datatable-thead>tr>th.cell-fixed-filter .fixed-filter{z-index:10;position:fixed;min-width:200px}::ng-deep crud-list .p-datatable .p-datatable-thead>tr>th .container-icon-loading{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}::ng-deep crud-list .check-all-custom{position:absolute;width:0;height:0}::ng-deep crud-list .cell-header-filter{position:relative}::ng-deep crud-list .cell-header-filter .tn-dropdown{height:32px}::ng-deep crud-list .cell-header-filter tn-mask .p-inputtext{width:100%}::ng-deep crud-list .cell-header-filter .filter-box{display:flex;min-width:0;background-color:#fff;border-radius:3px}::ng-deep crud-list .cell-header-filter .filter-box>div{flex:1;border:1px solid #ced4da;border-right:none;border-radius:3px 0 0 3px;outline:none;overflow:hidden}::ng-deep crud-list .cell-header-filter .filter-box>span{cursor:pointer;min-width:unset;flex-basis:32px;height:32px;display:inline-flex;align-items:center;justify-content:center;background:#f5f6f8;color:#6c757d;border:1px solid #ced4da;outline:none}::ng-deep crud-list .cell-header-filter .filter-box>span.action-clear{border-radius:0 3px 3px 0}::ng-deep crud-list .cell-header-filter .filter-box>span.action-clear.dirty{color:#008eff}::ng-deep crud-list .cell-header-filter .filter-box input{padding-left:5px;padding-right:5px;border:none;box-shadow:none!important}::ng-deep crud-list .cell-header-filter .filter-box:not(.no-transition){transition:min-width .1s}::ng-deep crud-list .cell-header-filter .filter-box.boolean-filter>div{flex:0 0 109px;width:109px}::ng-deep crud-list .cell-header-filter .p-multiselect-label.p-placeholder{padding-left:.5rem;padding-right:.5rem}::ng-deep crud-list .cell-header-filter.focus-within,::ng-deep crud-list .cell-header-filter:focus-within{z-index:10!important}::ng-deep crud-list .cell-header-filter.focus-within .filter-boolean-box .p-button,::ng-deep crud-list .cell-header-filter:focus-within .filter-boolean-box .p-button{z-index:10}::ng-deep crud-list .cell-header-filter.focus-within .filter-box>div,::ng-deep crud-list .cell-header-filter:focus-within .filter-box>div{box-shadow:0 0 0 .2rem #a6d5fa;border-color:#2196f3;z-index:0}::ng-deep crud-list .cell-header-filter.focus-within .short-filter-box,::ng-deep crud-list .cell-header-filter:focus-within .short-filter-box{position:absolute;top:calc(50% - 16px);min-width:250px;z-index:2;box-shadow:5px 0 15px 1px rgba(0,0,0,.27058823529411763)}::ng-deep crud-list .cell-header-filter.focus-within .short-filter-box>div,::ng-deep crud-list .cell-header-filter:focus-within .short-filter-box>div{flex:1;box-shadow:0 0 0 .2rem #a6d5fa;border-color:#2196f3;z-index:0}::ng-deep crud-list .cell-header-filter.focus-within .short-filter-box>span.action-clear,::ng-deep crud-list .cell-header-filter:focus-within .short-filter-box>span.action-clear{display:flex}::ng-deep crud-list .cell-header-filter.focus-within .short-filter-box.boolean-filter,::ng-deep crud-list .cell-header-filter:focus-within .short-filter-box.boolean-filter{min-width:140px}::ng-deep crud-list .cell-header-filter.focus-within .short-filter-box.boolean-filter>div,::ng-deep crud-list .cell-header-filter:focus-within .short-filter-box.boolean-filter>div{flex:0 0 109px;width:109px}::ng-deep crud-list .cell-header-filter.focus-within:nth-last-child(2) .short-filter-box,::ng-deep crud-list .cell-header-filter:focus-within:nth-last-child(2) .short-filter-box{left:50%;transform:translateX(-50%)}::ng-deep crud-list .cell-header-filter:last-child .filter-box{right:3px}::ng-deep crud-list .table-border-line{position:absolute;z-index:5;background-color:#eee}::ng-deep crud-list .table-border-line.--left,::ng-deep crud-list .table-border-line.--right{top:0;bottom:0;width:1px}::ng-deep crud-list .table-border-line.--bottom,::ng-deep crud-list .table-border-line.--top{left:0;right:0;height:1px}::ng-deep crud-list .table-border-line.--left{left:0}::ng-deep crud-list .table-border-line.--right{right:0}::ng-deep crud-list .table-border-line.--top{top:0}::ng-deep crud-list .table-border-line.--bottom{bottom:0}::ng-deep crud-list .filter-boolean-box{text-align:center}::ng-deep crud-list .filter-boolean-box .p-selectbutton{white-space:nowrap}::ng-deep crud-list .custom-search-area crud-form{width:100%}::ng-deep crud-list .custom-search-area .main-container-search-inner .container-control{overflow:hidden;padding-bottom:0}::ng-deep crud-list>p-contextmenu{display:none}::ng-deep crud-list .contentTd{overflow:hidden;display:-webkit-box;-webkit-line-clamp:7;-webkit-box-orient:vertical}@media (max-width:640px){::ng-deep crud-list .--table-responsive .p-datatable-wrapper{padding:1px}}"]
            },] }
];
CrudListComponent.ctorParameters = () => [
    { type: Injector }
];
CrudListComponent.propDecorators = {
    commonSearch: [{ type: ViewChild, args: ['commonSearch',] }]
};
//# sourceMappingURL=data:application/json;base64, 