import { Input, Output, EventEmitter, ViewChild, HostBinding, ElementRef, ChangeDetectorRef, Component, ChangeDetectionStrategy } from '@angular/core';
import { defer, fromEvent, Subject } from 'rxjs';
import { debounceTime, takeUntil, tap } from 'rxjs/operators';
import { isNullOrUndefined, isUndefined } from '@ironsource/fusion-ui/utils';
import { TableService } from '@ironsource/fusion-ui/components/table/common/services';
import { UniqueIdService } from '@ironsource/fusion-ui/services/unique-id';
import { TableColumnTypeEnum, CONFIG_TABLE_BY_UI_STYLE, ROW_CLICK_SUPPRESS_FOR_PARENT_SELECTORS } from '@ironsource/fusion-ui/components/table/common/entities';
import { TableBasicComponent } from './components/table-basic/table-basic.component';
import * as i0 from "@angular/core";
import * as i1 from "@ironsource/fusion-ui/components/table/common/services";
import * as i2 from "@ironsource/fusion-ui/services/unique-id";
import * as i3 from "@angular/common";
import * as i4 from "@ironsource/fusion-ui/components/icon/v1";
import * as i5 from "@ironsource/fusion-ui/components/loader/v1";
import * as i6 from "@ironsource/fusion-ui/components/checkbox/v1";
import * as i7 from "@ironsource/fusion-ui/components/multi-dropdown/v1";
import * as i8 from "@ironsource/fusion-ui/components/tooltip/v1";
import * as i9 from "./components/table-basic/table-basic.component";
import * as i10 from "./components/table-empty/table-empty.component";
import * as i11 from "./components/table-grouped/table-grouped.component";
import * as i12 from "./components/table-loading/table-loading.component";
const _c0 = ["stringCell"];
const _c1 = ["checkboxCell"];
const _c2 = ["templateCell"];
const _c3 = ["table"];
const _c4 = ["tableWrapper"];
const _c5 = ["tableBody"];
function TableComponent_table_2_ng_container_2_thead_1_td_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "td", 16);
    i0.ɵɵelement(1, "span");
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r12 = i0.ɵɵnextContext(4);
    i0.ɵɵclassProp("sticky-left", ctx_r12.options == null ? null : ctx_r12.options.rowsExpandableOptions == null ? null : ctx_r12.options.rowsExpandableOptions.sticky);
} }
function TableComponent_table_2_ng_container_2_thead_1_td_3_ng_container_1_fusion_icon_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "fusion-icon", 22);
} if (rf & 2) {
    const ctx_r20 = i0.ɵɵnextContext(6);
    i0.ɵɵproperty("name", ctx_r20.configIconNames.iconSort);
} }
function TableComponent_table_2_ng_container_2_thead_1_td_3_ng_container_1_fusion_icon_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "fusion-icon", 23);
} if (rf & 2) {
    const column_r14 = i0.ɵɵnextContext(2).$implicit;
    const ctx_r21 = i0.ɵɵnextContext(4);
    i0.ɵɵproperty("name", column_r14.tooltipIcon || ctx_r21.configIconNames.iconInfo)("fusionTooltip", column_r14.tooltip);
} }
function TableComponent_table_2_ng_container_2_thead_1_td_3_ng_container_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵtemplate(1, TableComponent_table_2_ng_container_2_thead_1_td_3_ng_container_1_fusion_icon_1_Template, 1, 1, "fusion-icon", 20);
    i0.ɵɵtext(2);
    i0.ɵɵtemplate(3, TableComponent_table_2_ng_container_2_thead_1_td_3_ng_container_1_fusion_icon_3_Template, 1, 2, "fusion-icon", 21);
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const column_r14 = i0.ɵɵnextContext().$implicit;
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngIf", column_r14.sort);
    i0.ɵɵadvance();
    i0.ɵɵtextInterpolate1(" ", column_r14.title, " ");
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngIf", column_r14.tooltip);
} }
function TableComponent_table_2_ng_container_2_thead_1_td_3_fusion_multi_dropdown_2_Template(rf, ctx) { if (rf & 1) {
    const _r26 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "fusion-multi-dropdown", 24);
    i0.ɵɵlistener("selectedChange", function TableComponent_table_2_ng_container_2_thead_1_td_3_fusion_multi_dropdown_2_Template_fusion_multi_dropdown_selectedChange_0_listener($event) { i0.ɵɵrestoreView(_r26); const column_r14 = i0.ɵɵnextContext().$implicit; const ctx_r24 = i0.ɵɵnextContext(4); return i0.ɵɵresetView(ctx_r24.filterColumn(column_r14, $event)); });
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const column_r14 = i0.ɵɵnextContext().$implicit;
    i0.ɵɵproperty("selected", column_r14.filter.selected)("options", column_r14.filter.options)("confirm", true)("search", true);
} }
function TableComponent_table_2_ng_container_2_thead_1_td_3_fusion_checkbox_3_Template(rf, ctx) { if (rf & 1) {
    const _r29 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "fusion-checkbox", 25);
    i0.ɵɵlistener("changed", function TableComponent_table_2_ng_container_2_thead_1_td_3_fusion_checkbox_3_Template_fusion_checkbox_changed_0_listener($event) { i0.ɵɵrestoreView(_r29); const ctx_r28 = i0.ɵɵnextContext(5); return i0.ɵɵresetView(ctx_r28.tableService.onRowsSelectChanged(ctx_r28.options.isGroupedTable, ctx_r28.rows, $event)); });
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r19 = i0.ɵɵnextContext(5);
    i0.ɵɵproperty("checked", ctx_r19.tableService.isAllRowsSelected(ctx_r19.rows))("isIndeterminate", ctx_r19.tableService.isPartialSelected(ctx_r19.rows))("name", "rows_all");
} }
function TableComponent_table_2_ng_container_2_thead_1_td_3_Template(rf, ctx) { if (rf & 1) {
    const _r31 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "td", 17);
    i0.ɵɵlistener("click", function TableComponent_table_2_ng_container_2_thead_1_td_3_Template_td_click_0_listener() { const restoredCtx = i0.ɵɵrestoreView(_r31); const column_r14 = restoredCtx.$implicit; const ctx_r30 = i0.ɵɵnextContext(4); return i0.ɵɵresetView(ctx_r30.onHeaderClicked(column_r14)); });
    i0.ɵɵtemplate(1, TableComponent_table_2_ng_container_2_thead_1_td_3_ng_container_1_Template, 4, 3, "ng-container", 3)(2, TableComponent_table_2_ng_container_2_thead_1_td_3_fusion_multi_dropdown_2_Template, 1, 4, "fusion-multi-dropdown", 18)(3, TableComponent_table_2_ng_container_2_thead_1_td_3_fusion_checkbox_3_Template, 1, 3, "fusion-checkbox", 19);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const column_r14 = ctx.$implicit;
    const isLast_r15 = ctx.last;
    const isFirst_r16 = ctx.first;
    const ctx_r13 = i0.ɵɵnextContext(4);
    i0.ɵɵstyleProp("width", ctx_r13.tableService.setWidth(isLast_r15, column_r14.width));
    i0.ɵɵproperty("ngClass", ctx_r13.tableService.getColumnClasses(column_r14, true))("ngStyle", ctx_r13.tableService.getColumnStyle(column_r14));
    i0.ɵɵattribute("data-col-key", column_r14.key)("colspan", isFirst_r16 ? ctx_r13.tableService.expandLevels : undefined);
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngIf", ctx_r13.configIconNames);
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngIf", column_r14.filter && column_r14.filter.options);
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngIf", ctx_r13.tableService.isTypeCheckbox(column_r14) && ctx_r13.isAllRowsSelectable && !ctx_r13.isEmpty && ctx_r13.isCheckboxTitleShown);
} }
function TableComponent_table_2_ng_container_2_thead_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "thead", 12)(1, "tr", 13);
    i0.ɵɵtemplate(2, TableComponent_table_2_ng_container_2_thead_1_td_2_Template, 2, 2, "td", 14)(3, TableComponent_table_2_ng_container_2_thead_1_td_3_Template, 4, 9, "td", 15);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const ctx_r8 = i0.ɵɵnextContext(3);
    i0.ɵɵproperty("hidden", (ctx_r8.isEmpty || ctx_r8.loading && !ctx_r8.isLoadingOverlay) && ctx_r8.hideHeaderOnEmpty);
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngStyle", !!ctx_r8.options.rowsOptions && !!ctx_r8.options.rowsOptions.headerRow ? ctx_r8.options.rowsOptions.headerRow.style : null);
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngIf", !!(ctx_r8.options == null ? null : ctx_r8.options.rowsExpandableOptions));
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngForOf", ctx_r8.columns)("ngForTrackBy", ctx_r8.trackByFunc);
} }
function TableComponent_table_2_ng_container_2_tbody_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "tbody", 26);
} if (rf & 2) {
    const ctx_r9 = i0.ɵɵnextContext(3);
    i0.ɵɵproperty("fusionTableLoading", ctx_r9.colsCount);
} }
function TableComponent_table_2_ng_container_2_tbody_3_Template(rf, ctx) { if (rf & 1) {
    const _r34 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "tbody", 27, 28);
    i0.ɵɵlistener("rowSelected", function TableComponent_table_2_ng_container_2_tbody_3_Template_tbody_rowSelected_0_listener($event) { i0.ɵɵrestoreView(_r34); const ctx_r33 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r33.selectionChanged.emit($event)); })("expandRow", function TableComponent_table_2_ng_container_2_tbody_3_Template_tbody_expandRow_0_listener($event) { i0.ɵɵrestoreView(_r34); const ctx_r35 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r35.doExpandRow($event)); })("click", function TableComponent_table_2_ng_container_2_tbody_3_Template_tbody_click_0_listener($event) { i0.ɵɵrestoreView(_r34); const ctx_r36 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r36.onTableBodyClicked($event)); });
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r10 = i0.ɵɵnextContext(3);
    i0.ɵɵproperty("rows", ctx_r10.tableRows)("columns", ctx_r10.columns)("options", ctx_r10.options)("tableClientWidth", ctx_r10.getTableClientWidth())("expandedRows", ctx_r10.expandedRows);
} }
function TableComponent_table_2_ng_container_2_tbody_4_Template(rf, ctx) { if (rf & 1) {
    const _r38 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "tbody", 29);
    i0.ɵɵlistener("rowSelected", function TableComponent_table_2_ng_container_2_tbody_4_Template_tbody_rowSelected_0_listener($event) { i0.ɵɵrestoreView(_r38); const ctx_r37 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r37.selectionChanged.emit($event)); });
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r11 = i0.ɵɵnextContext(3);
    i0.ɵɵproperty("rows", ctx_r11.groupedTableRows)("columns", ctx_r11.columns)("options", ctx_r11.options);
} }
function TableComponent_table_2_ng_container_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵtemplate(1, TableComponent_table_2_ng_container_2_thead_1_Template, 4, 5, "thead", 8)(2, TableComponent_table_2_ng_container_2_tbody_2_Template, 1, 1, "tbody", 9)(3, TableComponent_table_2_ng_container_2_tbody_3_Template, 2, 5, "tbody", 10)(4, TableComponent_table_2_ng_container_2_tbody_4_Template, 1, 3, "tbody", 11);
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const ctx_r5 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngIf", ctx_r5.columns.length);
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngIf", ctx_r5.loading && !ctx_r5.isLoadingOverlay);
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngIf", !ctx_r5.options.isGroupedTable && (!ctx_r5.loading || ctx_r5.isLoadingOverlay) && !ctx_r5.isEmpty);
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngIf", ctx_r5.options.isGroupedTable && (!ctx_r5.loading || ctx_r5.isLoadingOverlay) && !ctx_r5.isEmpty);
} }
function TableComponent_table_2_tbody_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "tbody", 30);
} if (rf & 2) {
    const ctx_r6 = i0.ɵɵnextContext(2);
    i0.ɵɵproperty("fusionTableEmpty", ctx_r6.colsCount)("customContent", ctx_r6.options == null ? null : ctx_r6.options.customNoData)("header", ctx_r6.noDataMessage)("subHeader", ctx_r6.noDataSubMessage)("icon", ctx_r6.options == null ? null : ctx_r6.options.emptyTableIcon);
} }
function TableComponent_table_2_tbody_4_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "tbody", 31);
} if (rf & 2) {
    const ctx_r7 = i0.ɵɵnextContext(2);
    i0.ɵɵproperty("fusionTableEmpty", ctx_r7.colsCount)("showNoDataImage", false);
} }
function TableComponent_table_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "table", 4, 5);
    i0.ɵɵtemplate(2, TableComponent_table_2_ng_container_2_Template, 5, 4, "ng-container", 3)(3, TableComponent_table_2_tbody_3_Template, 1, 5, "tbody", 6)(4, TableComponent_table_2_tbody_4_Template, 1, 2, "tbody", 7);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵproperty("id", ctx_r1.id);
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngIf", ctx_r1.columns && ctx_r1.options);
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngIf", !ctx_r1.loading && ctx_r1.isEmpty);
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngIf", ctx_r1.isEmpty && ctx_r1.loading);
} }
function TableComponent_ng_container_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelementStart(1, "fusion-loader", 32);
    i0.ɵɵtext(2, "Loading Please Wait\u2026");
    i0.ɵɵelementEnd();
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    i0.ɵɵadvance();
    i0.ɵɵproperty("status", true);
} }
function TableComponent_ng_container_4_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelementStart(1, "div", 33)(2, "fusion-loader", 34);
    i0.ɵɵtext(3, "Loading Please Wait\u2026");
    i0.ɵɵelementEnd()();
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("status", true);
} }
export class TableComponent {
    set rows(value) {
        this._rows = value.map(row => ({ ...row })) ?? [];
        this.initRows();
    }
    set expandedRows(value) {
        this.onExternalExpandRowChanged(value);
        this._expandedRows = value;
    }
    get isFixedHeader() {
        return !isNullOrUndefined(this.options) && !isNullOrUndefined(this.options.stickyHeader) && this.options.stickyHeader;
    }
    get isEmpty() {
        return this.tableService.isTableEmpty(this.rows, this.options.isGroupedTable, this.options.hasTotalsRow);
    }
    get isLoading() {
        return this.loading;
    }
    get onVerticalScroll() {
        if (this.tableWrapperElement) {
            return this.tableWrapperElement.nativeElement.scrollTop > 0;
        }
    }
    get isCheckboxTitleShown() {
        return this.columns ? this.columns.some(column => column.type === TableColumnTypeEnum.Checkbox && column.title !== '') : false;
    }
    get isLoadingOverlay() {
        return (isNullOrUndefined(this.options) || // default - true
            isNullOrUndefined(this.options.isLoadingOverlayMode) || // default - true
            this.options.isLoadingOverlayMode // get from options
        );
    }
    get tableRows() {
        return this.rows;
    }
    get groupedTableRows() {
        return this.rows;
    }
    get colsCount() {
        let columnsCount = Array.isArray(this.columns) ? this.columns.length : 1;
        if (!!this.options && this.options.rowsExpandableOptions) {
            columnsCount += !!this.options.rowsExpandableOptions.expandLevels ? this.options.rowsExpandableOptions.expandLevels : 1;
        }
        return columnsCount;
    }
    get expandedRows() {
        return this._expandedRows;
    }
    get rows() {
        return this._rows;
    }
    constructor(tableService, uniqueService, cdr) {
        this.tableService = tableService;
        this.uniqueService = uniqueService;
        this.cdr = cdr;
        this.options = {};
        this.columns = [];
        this.sortTableOnDataChanges = false;
        this.sortChanged = new EventEmitter();
        this.selectionChanged = this.tableService.selectionChanged;
        this.rowModelChange = this.tableService.rowModelChange;
        this.rowClicked = new EventEmitter();
        this.scrollDown = new EventEmitter();
        // on expand icon clicked. No need in case static data and one expand level
        this.expandRow = new EventEmitter();
        // two-way binding for expandedRows map used in case no expandRow subscription in host for sync this value
        this.expandedRowsChange = new EventEmitter();
        this.isRowsInit = false;
        this.tableMainError = false;
        this._expandedRows = {};
        this.currentExpandedMap = {};
        this.onDestroy$ = new Subject();
        this._rows = [];
    }
    ngOnInit() {
        if (!!this.options.rowsExpandableOptions) {
            try {
                this.tableService.setExpandLevelByExpandOptions(this.options.rowsExpandableOptions);
            }
            catch (e) {
                this.tableMainError = true;
                throw new Error(e);
            }
        }
        const uniqueId = this.uniqueService.getUniqueId();
        this.id = this.id || `isTable${uniqueId}`;
        this.noDataMessage = isNullOrUndefined(this.options.noDataMessage) ? 'No Data to Display' : this.options.noDataMessage;
        this.noDataSubMessage = this.options.noDataSubMessage || '';
        this.hideHeaderOnEmpty = !isNullOrUndefined(this.options.hideHeaderOnEmpty) ? this.options.hideHeaderOnEmpty : false;
        this.isAllRowsSelectable = typeof this.options.isAllRowsSelectable === 'undefined' ? true : this.options.isAllRowsSelectable;
        this.tableService.clearSelectedRows();
        this.scrollListeners();
        this.configIconNames = CONFIG_TABLE_BY_UI_STYLE[`style_v1`];
        this.wrapperClasses = this.getWrapperClasses();
        this.ignoredParentSelectorsRowClickEvent = ROW_CLICK_SUPPRESS_FOR_PARENT_SELECTORS.concat(this.options.rowsOptions?.ignoredParentSelectorsRowClickEvent ?? []);
        if (this.sortTableOnDataChanges && this.columns.find(col => !!col.sort)) {
            this.doLocalSorting();
        }
    }
    ngOnDestroy() {
        this.onDestroy$.next();
        this.onDestroy$.complete();
    }
    onHeaderClicked(col) {
        if (!this.tableService.isColumnSortable(col)) {
            return;
        }
        const sortKey = col.key;
        if (!(this.options && this.options.sortingType && this.options.sortingType === 'external')) {
            this.localSorting(sortKey);
        }
        this.sortChanged.emit(sortKey);
    }
    filterColumn(column, filterIn) {
        if (column.filter.changed && column.filter.options) {
            const isAllFiltered = column.filter.options.length === filterIn.length || filterIn.length === 0;
            column.filter.changed.emit(isAllFiltered ? [] : filterIn);
        }
    }
    replaceSelectedRows({ selectedTableRows, iditicationFunc }) {
        this.tableService.replaceSelectedRows({ selectedTableRows, iditicationFunc });
    }
    doExpandRow({ rowIndex, row, isExpanded, successCallback, failedCallback, updateMap }) {
        if (!!this.expandRow.observers.length) {
            // has expandRow event subscription in host
            if (Array.isArray(this.rows)) {
                this.expandRow.emit({ rowIndex, row, isExpanded, successCallback, failedCallback, updateMap });
                this.currentExpandedMap = { ...this.currentExpandedMap, [rowIndex]: isExpanded };
            }
        }
        else {
            successCallback();
            this.updateExpandedRowsMap(rowIndex, isExpanded);
        }
    }
    trackByFunc(index, column) {
        return column && column.key ? column.key : index;
    }
    getTableClientWidth() {
        if (this.tableWrapperElement) {
            return this.tableWrapperElement.nativeElement.clientWidth;
        }
    }
    onTableBodyClicked($event) {
        if (!this.isElementChildOfSuppressed($event.target)) {
            const rowEl = $event.target.closest('tr');
            const rowIndex = rowEl.dataset.rowIdx;
            const rowData = this.rows[rowIndex];
            this.rowClicked.emit({ $event, rowIndex, rowEl, rowData });
        }
    }
    initRows() {
        if (!this.options?.isGroupedTable && this.rows?.length) {
            this.tableService.initSelectedRows(this.rows);
        }
        this.doLocalSorting();
    }
    doLocalSorting() {
        if (Array.isArray(this.rows) && this.columns && this.sortTableOnDataChanges) {
            const sortedColumn = this.columns.find(col => !!col.sort);
            if (sortedColumn) {
                sortedColumn.sort = sortedColumn.sort === 'asc' ? 'desc' : 'asc';
                this.localSorting(sortedColumn.key);
            }
        }
    }
    isElementChildOfSuppressed(element) {
        return this.ignoredParentSelectorsRowClickEvent.some((selector) => {
            return element.closest(selector);
        });
    }
    updateExpandedRowsMap(rowIndex, isExpanded) {
        this._expandedRows = { ...this._expandedRows, [rowIndex]: isExpanded };
        this.expandedRowsChange.emit(this._expandedRows);
    }
    onExternalExpandRowChanged(newValue) {
        const diffMap = this.getRowsToExpandToggle(this.currentExpandedMap, newValue);
        this.currentExpandedMap = newValue;
        if (diffMap.includes('default')) {
            const rowsInTable = this.rows.length;
            [...Array(rowsInTable).keys()].forEach(rowIndex => {
                this.callOnExpandRow({
                    rowIndex: rowIndex,
                    row: this.rows[rowIndex],
                    isExpanded: newValue['default']
                });
            });
        }
        else {
            diffMap.forEach(rowIndex => {
                this.callOnExpandRow({
                    rowIndex: parseInt(rowIndex, 10),
                    row: this.rows[rowIndex],
                    isExpanded: newValue[rowIndex]
                });
            });
        }
    }
    callOnExpandRow({ rowIndex, row, isExpanded }) {
        this.tableBodyComponent.onExpandRow({ rowIndex, row, isExpanded }, false);
    }
    getRowsToExpandToggle(curValue, newValue) {
        return Object.keys(newValue)
            .map(key => {
            if (newValue[key] !== curValue[key]) {
                return key;
            }
            return null;
        })
            .filter(Boolean);
    }
    getWrapperClasses() {
        const classes = [];
        if (!!this.options && !!this.options.rowHeight) {
            classes.push(`is-row-height-${this.options.rowHeight}`);
        }
        return classes;
    }
    scrollListeners() {
        defer(() => fromEvent(this.tableWrapperElement.nativeElement, 'scroll').pipe(takeUntil(this.onDestroy$), tap(_ => {
            const scrollLeft = this.tableWrapperElement.nativeElement.scrollLeft;
            if (this.lastScrollLeftValue !== scrollLeft) {
                this.isScrollRight = scrollLeft > 0;
                this.lastScrollLeftValue = scrollLeft;
                this.cdr.markForCheck();
            }
        }), debounceTime(10))).subscribe(this.onScroll.bind(this));
    }
    localSorting(sortKey) {
        let isAscSort;
        const tableRows = [...this.rows];
        // reset header sort options
        this.columns.forEach(col => {
            if (col.key !== sortKey) {
                if (!isUndefined(col.sort)) {
                    col.sort = '';
                }
            }
            else {
                col.sort = col.sort === '' ? 'asc' : col.sort === 'asc' ? 'desc' : 'asc';
                isAscSort = col.sort === 'asc';
            }
        });
        let totalRow = [];
        let otherRows = [];
        if (!isNullOrUndefined(this.options.hasTotalsRow) && this.options.hasTotalsRow) {
            totalRow = tableRows.slice(0, 1);
            otherRows = tableRows.slice(1);
        }
        else {
            otherRows = tableRows;
        }
        otherRows.sort((a, b) => {
            if (isNullOrUndefined(a[sortKey]) || isNullOrUndefined(b[sortKey])) {
                return 0;
            }
            // if data type - numeric
            if (!Array.isArray(a[sortKey]) && !isNaN(a[sortKey]) && !isNaN(b[sortKey]) && a[sortKey] - parseFloat(a[sortKey]) + 1 >= 0) {
                return isAscSort ? a[sortKey] - b[sortKey] : (a[sortKey] - b[sortKey]) * -1;
            }
            // if it string;
            const strA = a[sortKey].toString().toUpperCase();
            const strB = b[sortKey].toString().toUpperCase();
            if (strA < strB) {
                return isAscSort ? -1 : 1;
            }
            if (strA > strB) {
                return isAscSort ? 1 : -1;
            }
            return 0;
        });
        this._rows = [...totalRow, ...otherRows].filter(Boolean);
    }
    onScroll($event) {
        const target = $event.target || $event;
        if (!this.options.pagination || this.options.pagination.loading || !this.options.pagination.enable) {
            return;
        }
        const top = this.tableWrapperElement.nativeElement.scrollTop;
        if (top >= this.tableElement.nativeElement.offsetHeight - this.tableWrapperElement.nativeElement.offsetHeight - 100) {
            if (!this.options.pagination.handleLoadingFromHost) {
                this.options.pagination.loading = true;
            }
            this.scrollDown.emit(target);
        }
    }
    static { this.ɵfac = function TableComponent_Factory(t) { return new (t || TableComponent)(i0.ɵɵdirectiveInject(i1.TableService), i0.ɵɵdirectiveInject(i2.UniqueIdService), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); }; }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: TableComponent, selectors: [["fusion-table"]], viewQuery: function TableComponent_Query(rf, ctx) { if (rf & 1) {
            i0.ɵɵviewQuery(_c0, 5);
            i0.ɵɵviewQuery(_c1, 5);
            i0.ɵɵviewQuery(_c2, 5);
            i0.ɵɵviewQuery(_c3, 5);
            i0.ɵɵviewQuery(_c4, 7);
            i0.ɵɵviewQuery(_c5, 5);
        } if (rf & 2) {
            let _t;
            i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.stringCell = _t.first);
            i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.checkboxCell = _t.first);
            i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.templateCell = _t.first);
            i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.tableElement = _t.first);
            i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.tableWrapperElement = _t.first);
            i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.tableBodyComponent = _t.first);
        } }, hostVars: 10, hostBindings: function TableComponent_HostBindings(rf, ctx) { if (rf & 2) {
            i0.ɵɵclassProp("fixed-table", ctx.isFixedHeader)("is-empty", ctx.isEmpty)("is-loading", ctx.isLoading)("on-scroll-right", ctx.isScrollRight)("on-vertical-scroll", ctx.onVerticalScroll);
        } }, inputs: { id: "id", options: "options", columns: "columns", rows: "rows", loading: "loading", sortTableOnDataChanges: "sortTableOnDataChanges", expandedRows: "expandedRows" }, outputs: { sortChanged: "sortChanged", selectionChanged: "selectionChanged", rowModelChange: "rowModelChange", rowClicked: "rowClicked", scrollDown: "scrollDown", expandRow: "expandRow", expandedRowsChange: "expandedRowsChange" }, features: [i0.ɵɵProvidersFeature([TableService])], decls: 5, vars: 4, consts: [[1, "tableWrap", "v2", 3, "ngClass"], ["tableWrapper", ""], [3, "id", 4, "ngIf"], [4, "ngIf"], [3, "id"], ["table", ""], [3, "fusionTableEmpty", "customContent", "header", "subHeader", "icon", 4, "ngIf"], [3, "fusionTableEmpty", "showNoDataImage", 4, "ngIf"], [3, "hidden", 4, "ngIf"], [3, "fusionTableLoading", 4, "ngIf"], ["fusionTableBasic", "", 3, "rows", "columns", "options", "tableClientWidth", "expandedRows", "rowSelected", "expandRow", "click", 4, "ngIf"], ["fusionTableGrouped", "", 3, "rows", "columns", "options", "rowSelected", 4, "ngIf"], [3, "hidden"], [3, "ngStyle"], ["class", "expand-column", 3, "sticky-left", 4, "ngIf"], [3, "ngClass", "ngStyle", "width", "click", 4, "ngFor", "ngForOf", "ngForTrackBy"], [1, "expand-column"], [3, "ngClass", "ngStyle", "click"], ["placeholder", "Please Select", "class", "filter", "selectAllLabel", "Select All <span class='grey'>(No Filters)</span>", 3, "selected", "options", "confirm", "search", "selectedChange", 4, "ngIf"], ["class", "is-regular", "title", "select / un-select all", 3, "checked", "isIndeterminate", "name", "changed", 4, "ngIf"], ["class", "icon-sort", 3, "name", 4, "ngIf"], ["class", "icon-tooltip", 3, "name", "fusionTooltip", 4, "ngIf"], [1, "icon-sort", 3, "name"], [1, "icon-tooltip", 3, "name", "fusionTooltip"], ["placeholder", "Please Select", "selectAllLabel", "Select All <span class='grey'>(No Filters)</span>", 1, "filter", 3, "selected", "options", "confirm", "search", "selectedChange"], ["title", "select / un-select all", 1, "is-regular", 3, "checked", "isIndeterminate", "name", "changed"], [3, "fusionTableLoading"], ["fusionTableBasic", "", 3, "rows", "columns", "options", "tableClientWidth", "expandedRows", "rowSelected", "expandRow", "click"], ["tableBody", ""], ["fusionTableGrouped", "", 3, "rows", "columns", "options", "rowSelected"], [3, "fusionTableEmpty", "customContent", "header", "subHeader", "icon"], [3, "fusionTableEmpty", "showNoDataImage"], ["height", "150", 3, "status"], [1, "is-overlay-loader-holder"], [3, "status"]], template: function TableComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "div", 0, 1);
            i0.ɵɵtemplate(2, TableComponent_table_2_Template, 5, 4, "table", 2)(3, TableComponent_ng_container_3_Template, 3, 1, "ng-container", 3);
            i0.ɵɵelementEnd();
            i0.ɵɵtemplate(4, TableComponent_ng_container_4_Template, 4, 1, "ng-container", 3);
        } if (rf & 2) {
            i0.ɵɵproperty("ngClass", ctx.wrapperClasses);
            i0.ɵɵadvance(2);
            i0.ɵɵproperty("ngIf", !ctx.tableMainError);
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngIf", (ctx.options == null ? null : ctx.options.pagination) && ctx.options.pagination.loading);
            i0.ɵɵadvance();
            i0.ɵɵproperty("ngIf", ctx.isLoadingOverlay && ctx.loading);
        } }, dependencies: [i3.NgClass, i3.NgForOf, i3.NgIf, i3.NgStyle, i4.IconComponent, i5.LoaderComponent, i6.CheckboxComponent, i7.MultiDropdownComponent, i8.TooltipDirective, i9.TableBasicComponent, i10.TableEmptyComponent, i11.TableGroupedComponent, i12.TableLoadingComponent], styles: ["[_nghost-%COMP%]   .tableWrap.v1[_ngcontent-%COMP%]   table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]{font-size:12px;font-family:var(--regular-font-family, \"Open Sans\");font-weight:600}[_nghost-%COMP%]   .tableWrap.v2[_ngcontent-%COMP%]   table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%], [_nghost-%COMP%]   table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{font-size:12px;font-family:var(--body-font-family, \"HelveticaNeue\");font-weight:400}[_nghost-%COMP%]   *[_ngcontent-%COMP%]{box-sizing:border-box}[_nghost-%COMP%]{margin:0;padding:0;vertical-align:initial;text-align:initial}.fixed-table[_nghost-%COMP%] > div[_ngcontent-%COMP%]::-webkit-scrollbar-track, [_nghost-%COMP%] > div[_ngcontent-%COMP%]::-webkit-scrollbar-track{border-radius:4px;background-color:#fff}.fixed-table[_nghost-%COMP%] > div[_ngcontent-%COMP%]::-webkit-scrollbar, [_nghost-%COMP%] > div[_ngcontent-%COMP%]::-webkit-scrollbar{width:14px;height:14px;background-color:#fff}.fixed-table[_nghost-%COMP%] > div[_ngcontent-%COMP%]::-webkit-scrollbar-thumb, [_nghost-%COMP%] > div[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{border:5px solid rgba(0,0,0,0);background-clip:padding-box;border-radius:4px;background-color:var(--light-color-600, #C2CDD7)}[_nghost-%COMP%]{width:100%;height:100%}[_nghost-%COMP%] > div[_ngcontent-%COMP%]{overflow-x:auto}[_nghost-%COMP%] > div[_ngcontent-%COMP%]::-webkit-scrollbar-track{margin-top:30px}[_nghost-%COMP%]   table[_ngcontent-%COMP%]{border:none;margin:0;width:calc(100% - 1px);border-collapse:collapse;border-spacing:0}[_nghost-%COMP%]   table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{color:var(--light-color-900, #52677B);white-space:nowrap;position:relative;padding:5px 10px;max-width:350px}[_nghost-%COMP%]   table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]   fusion-icon.filterTitle[_ngcontent-%COMP%]{top:2px;position:relative}[_nghost-%COMP%]   table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]   fusion-icon.info-tooltip[_ngcontent-%COMP%]     svg{width:10px;height:10px}[_nghost-%COMP%]   table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]   fusion-icon.info-tooltip[_ngcontent-%COMP%]     svg *{fill:var(--light-color-700, #95A6B8)}[_nghost-%COMP%]   table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]   fusion-icon.warning[_ngcontent-%COMP%]     svg{width:11px;height:11px}[_nghost-%COMP%]   table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]   fusion-icon.warning[_ngcontent-%COMP%]     svg *{fill:var(--neutral-color-700, #FF9403)}[_nghost-%COMP%]   table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   td.is-select-holder[_ngcontent-%COMP%]{width:35px}[_nghost-%COMP%]   table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   td.is-sort[_ngcontent-%COMP%]{cursor:pointer}[_nghost-%COMP%]   table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   td.is-sort.asc[_ngcontent-%COMP%]   fusion-icon.icon-sort[_ngcontent-%COMP%]{float:left;height:18px;margin-right:3px}[_nghost-%COMP%]   table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   td.is-sort.asc[_ngcontent-%COMP%]   fusion-icon.icon-sort[_ngcontent-%COMP%]     svg{height:18px;width:6px;transform:rotate(180deg)}[_nghost-%COMP%]   table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   td.is-sort.asc[_ngcontent-%COMP%]   fusion-icon.icon-sort[_ngcontent-%COMP%]     svg *{fill:var(--dark-color-300, #172D4C)}[_nghost-%COMP%]   table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   td.is-sort.desc[_ngcontent-%COMP%]   fusion-icon.icon-sort[_ngcontent-%COMP%]{float:left;height:18px;margin-right:3px}[_nghost-%COMP%]   table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   td.is-sort.desc[_ngcontent-%COMP%]   fusion-icon.icon-sort[_ngcontent-%COMP%]     svg{height:18px;width:6px}[_nghost-%COMP%]   table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   td.is-sort.desc[_ngcontent-%COMP%]   fusion-icon.icon-sort[_ngcontent-%COMP%]     svg *{fill:var(--dark-color-300, #172D4C)}[_nghost-%COMP%]   table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   td.is-sort.asc[_ngcontent-%COMP%], [_nghost-%COMP%]   table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   td.is-sort.desc[_ngcontent-%COMP%]{padding-right:16px}[_nghost-%COMP%]   table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   td.expand-column[_ngcontent-%COMP%]{width:20px}[_nghost-%COMP%]   table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   td.expand-column[_ngcontent-%COMP%]   span[_ngcontent-%COMP%]{display:block;width:1px}[_nghost-%COMP%]   table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]     .filter .is-dropdown .options .is-option-label .grey{color:var(--light-color-700, #95A6B8)}[_nghost-%COMP%]   table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   td.is-checkbox-holder[_ngcontent-%COMP%]{text-align:center}[_nghost-%COMP%]   table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]:after{content:\"\";position:absolute;left:0;bottom:-1px;width:100%}[_nghost-%COMP%]   table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]{overflow:auto;border-bottom:1px solid var(--light-color, #E1E6EB)}[_nghost-%COMP%]   table[_ngcontent-%COMP%]   tbody[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{white-space:nowrap}.is-empty[_nghost-%COMP%]   table[_ngcontent-%COMP%]{height:calc(100% - 1px)}.fixed-table[_nghost-%COMP%]{position:relative;display:block}.fixed-table[_nghost-%COMP%] > div[_ngcontent-%COMP%]{overflow:auto}.fixed-table[_nghost-%COMP%]   table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]{border-bottom:none}.fixed-table[_nghost-%COMP%]   table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{height:30px;position:sticky;top:0;z-index:3;background-color:#fff}.fixed-table[_nghost-%COMP%]   table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   td.sticky-left[_ngcontent-%COMP%]{left:0;z-index:4}.fixed-table[_nghost-%COMP%]:after{content:\"\";position:absolute;right:0;top:1px;background-color:#fff;width:15px;height:30px;border-bottom:2px solid var(--light-color-700, #95A6B8)}.fixed-table.is-loading[_nghost-%COMP%]:after, .fixed-table.is-empty[_nghost-%COMP%]:after{display:none}[_nghost-%COMP%]   .tableWrap[_ngcontent-%COMP%]{height:100%}[_nghost-%COMP%]   .tableWrap.v1[_ngcontent-%COMP%]   table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]{border-bottom:2px solid var(--primary-color, #3091F6)}[_nghost-%COMP%]   .tableWrap.v1[_ngcontent-%COMP%]   table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]:after{border-bottom:2px solid var(--primary-color, #3091F6)}[_nghost-%COMP%]   .tableWrap.v2[_ngcontent-%COMP%]   table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]{height:30px}[_nghost-%COMP%]   .tableWrap.v2[_ngcontent-%COMP%]   table[_ngcontent-%COMP%]   thead[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]:after{border-bottom:2px solid var(--light-color-700, #95A6B8)}[_nghost-%COMP%]   .is-overlay-loader-holder[_ngcontent-%COMP%]{position:absolute;z-index:2;width:100%;height:100%;min-height:100px;top:0;background-color:#ffffffe6}.on-scroll-right[_nghost-%COMP%]   .sticky-left.display-shadow-on-scroll[_ngcontent-%COMP%]:before{content:\"\";width:1px;position:absolute;top:0;right:0;height:100%;box-shadow:2px 3px 5px #0009}.on-vertical-scroll[_nghost-%COMP%]   thead[_ngcontent-%COMP%]   td[_ngcontent-%COMP%]:after{box-shadow:2px 3px 5px #0000004d}"], changeDetection: 0 }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TableComponent, [{
        type: Component,
        args: [{ selector: 'fusion-table', changeDetection: ChangeDetectionStrategy.OnPush, providers: [TableService], template: "<div class=\"tableWrap v2\" [ngClass]=\"wrapperClasses\" #tableWrapper>\n    <table [id]=\"id\" #table *ngIf=\"!tableMainError\">\n        <ng-container *ngIf=\"columns && options\">\n            <thead *ngIf=\"columns.length\" [hidden]=\"(isEmpty || (loading && !isLoadingOverlay)) && hideHeaderOnEmpty\">\n            <tr [ngStyle]=\"!!options.rowsOptions && !!options.rowsOptions.headerRow ? options.rowsOptions.headerRow.style : null\">\n                <td\n                    *ngIf=\"!!options?.rowsExpandableOptions\"\n                    class=\"expand-column\"\n                    [class.sticky-left]=\"options?.rowsExpandableOptions?.sticky\"\n                >\n                    <span></span>\n                </td>\n                <td\n                    *ngFor=\"let column of columns; trackBy: trackByFunc; let isLast = last; let isFirst = first\"\n                    [attr.data-col-key]=\"column.key\"\n                    [ngClass]=\"tableService.getColumnClasses(column, true)\"\n                    [ngStyle]=\"tableService.getColumnStyle(column)\"\n                    (click)=\"onHeaderClicked(column)\"\n                    [style.width]=\"tableService.setWidth(isLast, column.width)\"\n                    [attr.colspan]=\"isFirst ? tableService.expandLevels : undefined\"\n                >\n                    <ng-container *ngIf=\"configIconNames\">\n                        <fusion-icon class=\"icon-sort\" [name]=\"configIconNames.iconSort\" *ngIf=\"column.sort\"></fusion-icon>\n                        {{ column.title }}\n                        <fusion-icon\n                            class=\"icon-tooltip\"\n                            [name]=\"column.tooltipIcon || configIconNames.iconInfo\"\n                            *ngIf=\"column.tooltip\"\n                            [fusionTooltip]=\"column.tooltip\"\n                        ></fusion-icon>\n                    </ng-container>\n                    <fusion-multi-dropdown\n                        *ngIf=\"column.filter && column.filter.options\"\n                        placeholder=\"Please Select\"\n                        class=\"filter\"\n                        [selected]=\"column.filter.selected\"\n                        [options]=\"column.filter.options\"\n                        (selectedChange)=\"filterColumn(column, $event)\"\n                        [confirm]=\"true\"\n                        [search]=\"true\"\n                        selectAllLabel=\"Select All <span class='grey'>(No Filters)</span>\"\n                    >\n                    </fusion-multi-dropdown>\n\n                    <fusion-checkbox\n                        class=\"is-regular\"\n                        title=\"select / un-select all\"\n                        *ngIf=\"tableService.isTypeCheckbox(column) && isAllRowsSelectable && !isEmpty && isCheckboxTitleShown\"\n                        [checked]=\"tableService.isAllRowsSelected(rows)\"\n                        [isIndeterminate]=\"tableService.isPartialSelected(rows)\"\n                        (changed)=\"tableService.onRowsSelectChanged(options.isGroupedTable, rows, $event)\"\n                        [name]=\"'rows_all'\"\n                    >\n                    </fusion-checkbox>\n                </td>\n            </tr>\n            </thead>\n\n            <tbody *ngIf=\"loading && !isLoadingOverlay\" [fusionTableLoading]=\"colsCount\"></tbody>\n\n            <tbody\n                *ngIf=\"!options.isGroupedTable && (!loading || isLoadingOverlay) && !isEmpty\"\n                fusionTableBasic\n                [rows]=\"tableRows\"\n                [columns]=\"columns\"\n                [options]=\"options\"\n                [tableClientWidth]=\"getTableClientWidth()\"\n                [expandedRows]=\"expandedRows\"\n                (rowSelected)=\"selectionChanged.emit($event)\"\n                (expandRow)=\"doExpandRow($event)\"\n                (click)=\"onTableBodyClicked($event)\"\n                #tableBody\n            ></tbody>\n\n            <tbody\n                *ngIf=\"options.isGroupedTable && (!loading || isLoadingOverlay) && !isEmpty\"\n                fusionTableGrouped\n                [rows]=\"groupedTableRows\"\n                [columns]=\"columns\"\n                [options]=\"options\"\n                (rowSelected)=\"selectionChanged.emit($event)\"\n            ></tbody>\n        </ng-container>\n        <tbody\n            *ngIf=\"!loading && isEmpty\"\n            [fusionTableEmpty]=\"colsCount\"\n            [customContent]=\"options?.customNoData\"\n            [header]=\"noDataMessage\"\n            [subHeader]=\"noDataSubMessage\"\n            [icon]=\"options?.emptyTableIcon\"\n        ></tbody>\n        <tbody\n            *ngIf=\"isEmpty && loading\"\n            [fusionTableEmpty]=\"colsCount\"\n            [showNoDataImage]=\"false\"\n        ></tbody>\n    </table>\n    <ng-container *ngIf=\"options?.pagination && options.pagination.loading\">\n        <fusion-loader [status]=\"true\" height=\"150\">Loading Please Wait\u2026</fusion-loader>\n    </ng-container>\n</div>\n<ng-container *ngIf=\"isLoadingOverlay && loading\">\n    <div class=\"is-overlay-loader-holder\">\n        <fusion-loader [status]=\"true\">Loading Please Wait\u2026</fusion-loader>\n    </div>\n</ng-container>\n", styles: [":host .tableWrap.v1 table thead{font-size:12px;font-family:var(--regular-font-family, \"Open Sans\");font-weight:600}:host .tableWrap.v2 table thead,:host table thead td{font-size:12px;font-family:var(--body-font-family, \"HelveticaNeue\");font-weight:400}:host *{box-sizing:border-box}:host{margin:0;padding:0;vertical-align:initial;text-align:initial}:host.fixed-table>div::-webkit-scrollbar-track,:host>div::-webkit-scrollbar-track{border-radius:4px;background-color:#fff}:host.fixed-table>div::-webkit-scrollbar,:host>div::-webkit-scrollbar{width:14px;height:14px;background-color:#fff}:host.fixed-table>div::-webkit-scrollbar-thumb,:host>div::-webkit-scrollbar-thumb{border:5px solid rgba(0,0,0,0);background-clip:padding-box;border-radius:4px;background-color:var(--light-color-600, #C2CDD7)}:host{width:100%;height:100%}:host>div{overflow-x:auto}:host>div::-webkit-scrollbar-track{margin-top:30px}:host table{border:none;margin:0;width:calc(100% - 1px);border-collapse:collapse;border-spacing:0}:host table thead td{color:var(--light-color-900, #52677B);white-space:nowrap;position:relative;padding:5px 10px;max-width:350px}:host table thead td fusion-icon.filterTitle{top:2px;position:relative}:host table thead td fusion-icon.info-tooltip ::ng-deep svg{width:10px;height:10px}:host table thead td fusion-icon.info-tooltip ::ng-deep svg *{fill:var(--light-color-700, #95A6B8)}:host table thead td fusion-icon.warning ::ng-deep svg{width:11px;height:11px}:host table thead td fusion-icon.warning ::ng-deep svg *{fill:var(--neutral-color-700, #FF9403)}:host table thead td.is-select-holder{width:35px}:host table thead td.is-sort{cursor:pointer}:host table thead td.is-sort.asc fusion-icon.icon-sort{float:left;height:18px;margin-right:3px}:host table thead td.is-sort.asc fusion-icon.icon-sort ::ng-deep svg{height:18px;width:6px;transform:rotate(180deg)}:host table thead td.is-sort.asc fusion-icon.icon-sort ::ng-deep svg *{fill:var(--dark-color-300, #172D4C)}:host table thead td.is-sort.desc fusion-icon.icon-sort{float:left;height:18px;margin-right:3px}:host table thead td.is-sort.desc fusion-icon.icon-sort ::ng-deep svg{height:18px;width:6px}:host table thead td.is-sort.desc fusion-icon.icon-sort ::ng-deep svg *{fill:var(--dark-color-300, #172D4C)}:host table thead td.is-sort.asc,:host table thead td.is-sort.desc{padding-right:16px}:host table thead td.expand-column{width:20px}:host table thead td.expand-column span{display:block;width:1px}:host table thead td ::ng-deep .filter .is-dropdown .options .is-option-label .grey{color:var(--light-color-700, #95A6B8)}:host table thead td.is-checkbox-holder{text-align:center}:host table thead td:after{content:\"\";position:absolute;left:0;bottom:-1px;width:100%}:host table tbody{overflow:auto;border-bottom:1px solid var(--light-color, #E1E6EB)}:host table tbody td{white-space:nowrap}:host.is-empty table{height:calc(100% - 1px)}:host.fixed-table{position:relative;display:block}:host.fixed-table>div{overflow:auto}:host.fixed-table table thead{border-bottom:none}:host.fixed-table table thead td{height:30px;position:sticky;top:0;z-index:3;background-color:#fff}:host.fixed-table table thead td.sticky-left{left:0;z-index:4}:host.fixed-table:after{content:\"\";position:absolute;right:0;top:1px;background-color:#fff;width:15px;height:30px;border-bottom:2px solid var(--light-color-700, #95A6B8)}:host.fixed-table.is-loading:after,:host.fixed-table.is-empty:after{display:none}:host .tableWrap{height:100%}:host .tableWrap.v1 table thead{border-bottom:2px solid var(--primary-color, #3091F6)}:host .tableWrap.v1 table thead td:after{border-bottom:2px solid var(--primary-color, #3091F6)}:host .tableWrap.v2 table thead td{height:30px}:host .tableWrap.v2 table thead td:after{border-bottom:2px solid var(--light-color-700, #95A6B8)}:host .is-overlay-loader-holder{position:absolute;z-index:2;width:100%;height:100%;min-height:100px;top:0;background-color:#ffffffe6}:host.on-scroll-right .sticky-left.display-shadow-on-scroll:before{content:\"\";width:1px;position:absolute;top:0;right:0;height:100%;box-shadow:2px 3px 5px #0009}:host.on-vertical-scroll thead td:after{box-shadow:2px 3px 5px #0000004d}\n"] }]
    }], () => [{ type: i1.TableService }, { type: i2.UniqueIdService }, { type: i0.ChangeDetectorRef }], { id: [{
            type: Input
        }], options: [{
            type: Input
        }], columns: [{
            type: Input
        }], rows: [{
            type: Input
        }], loading: [{
            type: Input
        }], sortTableOnDataChanges: [{
            type: Input
        }], expandedRows: [{
            type: Input
        }], sortChanged: [{
            type: Output
        }], selectionChanged: [{
            type: Output
        }], rowModelChange: [{
            type: Output
        }], rowClicked: [{
            type: Output
        }], scrollDown: [{
            type: Output
        }], expandRow: [{
            type: Output
        }], expandedRowsChange: [{
            type: Output
        }], stringCell: [{
            type: ViewChild,
            args: ['stringCell']
        }], checkboxCell: [{
            type: ViewChild,
            args: ['checkboxCell']
        }], templateCell: [{
            type: ViewChild,
            args: ['templateCell']
        }], tableElement: [{
            type: ViewChild,
            args: ['table']
        }], tableWrapperElement: [{
            type: ViewChild,
            args: ['tableWrapper', { static: true }]
        }], tableBodyComponent: [{
            type: ViewChild,
            args: ['tableBody']
        }], isFixedHeader: [{
            type: HostBinding,
            args: ['class.fixed-table']
        }], isEmpty: [{
            type: HostBinding,
            args: ['class.is-empty']
        }], isLoading: [{
            type: HostBinding,
            args: ['class.is-loading']
        }], isScrollRight: [{
            type: HostBinding,
            args: ['class.on-scroll-right']
        }], onVerticalScroll: [{
            type: HostBinding,
            args: ['class.on-vertical-scroll']
        }] }); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(TableComponent, { className: "TableComponent", filePath: "table.component.ts", lineNumber: 38 }); })();
//# sourceMappingURL=data:application/json;base64, 