import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, Output } from '@angular/core';
import { TableRowClassesEnum } from '@ironsource/fusion-ui/components/table/common/entities';
import { TableService } from '@ironsource/fusion-ui/components/table/common/services';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import * as i0 from "@angular/core";
import * as i1 from "@ironsource/fusion-ui/components/table/common/services";
import * as i2 from "@angular/common";
import * as i3 from "@ironsource/fusion-ui/components/loader-inline/v1";
import * as i4 from "@ironsource/fusion-ui/directives/load-more";
import * as i5 from "../table-row/table-row.component";
import * as i6 from "@ironsource/fusion-ui/pipes/generic";
const _c0 = ["fusionTableBasic", ""];
const _c1 = (a0, a1) => ({ $implicit: a0, parentIndex: a1 });
function TableBasicComponent_ng_container_0_ng_container_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainer(0, 4);
} if (rf & 2) {
    const ctx_r5 = i0.ɵɵnextContext();
    const row_r3 = ctx_r5.$implicit;
    const rowIndex_r4 = ctx_r5.index;
    const childRowsTemplate_r7 = i0.ɵɵreference(5);
    const ctx_r4 = i0.ɵɵnextContext();
    i0.ɵɵproperty("ngTemplateOutlet", childRowsTemplate_r7)("ngTemplateOutletContext", i0.ɵɵpureFunction2(2, _c1, row_r3[ctx_r4.options.rowsExpandableOptions.key], rowIndex_r4));
} }
function TableBasicComponent_ng_container_0_ng_template_4_ng_container_0_ng_container_1_tr_4_Template(rf, ctx) { if (rf & 1) {
    const _r9 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "tr", 10)(1, "td")(2, "a", 11);
    i0.ɵɵlistener("click", function TableBasicComponent_ng_container_0_ng_template_4_ng_container_0_ng_container_1_tr_4_Template_a_click_2_listener() { i0.ɵɵrestoreView(_r9); const loadMore_r10 = i0.ɵɵnextContext(2).loadMore; return i0.ɵɵresetView(loadMore_r10()); });
    i0.ɵɵtext(3, "Load more");
    i0.ɵɵelementEnd()()();
} if (rf & 2) {
    const ctx_r4 = i0.ɵɵnextContext(5);
    i0.ɵɵadvance();
    i0.ɵɵattribute("colspan", ctx_r4.fullCellColspan);
    i0.ɵɵadvance();
    i0.ɵɵstyleProp("margin-left", ctx_r4.getHalfTableClientWidth, "px");
} }
function TableBasicComponent_ng_container_0_ng_template_4_ng_container_0_ng_container_1_ng_container_6_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainer(0, 4);
} if (rf & 2) {
    const innerRows_r11 = ctx.ngIf;
    const innerRowIndex_r12 = i0.ɵɵnextContext().index;
    const parentIndex_r13 = i0.ɵɵnextContext(2).parentIndex;
    i0.ɵɵnextContext();
    const childRowsTemplate_r7 = i0.ɵɵreference(5);
    i0.ɵɵproperty("ngTemplateOutlet", childRowsTemplate_r7)("ngTemplateOutletContext", i0.ɵɵpureFunction2(2, _c1, innerRows_r11, parentIndex_r13 + "_" + innerRowIndex_r12));
} }
function TableBasicComponent_ng_container_0_ng_template_4_ng_container_0_ng_container_1_Template(rf, ctx) { if (rf & 1) {
    const _r8 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelementStart(1, "tr", 8);
    i0.ɵɵpipe(2, "generic");
    i0.ɵɵpipe(3, "async");
    i0.ɵɵlistener("expandRow", function TableBasicComponent_ng_container_0_ng_template_4_ng_container_0_ng_container_1_Template_tr_expandRow_1_listener($event) { i0.ɵɵrestoreView(_r8); const ctx_r4 = i0.ɵɵnextContext(4); return i0.ɵɵresetView(ctx_r4.onExpandRow($event)); });
    i0.ɵɵelementEnd();
    i0.ɵɵtemplate(4, TableBasicComponent_ng_container_0_ng_template_4_ng_container_0_ng_container_1_tr_4_Template, 4, 3, "tr", 9);
    i0.ɵɵpipe(5, "async");
    i0.ɵɵtemplate(6, TableBasicComponent_ng_container_0_ng_template_4_ng_container_0_ng_container_1_ng_container_6_Template, 1, 5, "ng-container", 3);
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const innerRow_r14 = ctx.$implicit;
    const innerRowIndex_r12 = ctx.index;
    const last_r15 = ctx.last;
    const hasMore$_r16 = i0.ɵɵnextContext().hasMore$;
    const parentIndex_r13 = i0.ɵɵnextContext().parentIndex;
    const ctx_r4 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance();
    i0.ɵɵproperty("rowIndex", parentIndex_r13 + "_" + innerRowIndex_r12)("row", innerRow_r14)("columns", ctx_r4.options.rowsExpandableOptions.columns)("options", ctx_r4.childRowOptions)("isExpanded", ctx_r4.isExpanded(parentIndex_r13 + "_" + innerRowIndex_r12))("isInnerRow", true)("ngClass", i0.ɵɵpipeBind3(2, 11, ctx_r4.getRowClass.bind(ctx_r4), innerRow_r14, innerRowIndex_r12))("hasAfterSticky", ctx_r4.hasAfterSticky(last_r15, i0.ɵɵpipeBind1(3, 15, hasMore$_r16), parentIndex_r13 + "_" + innerRowIndex_r12))("ngStyle", !!ctx_r4.options.rowsOptions && !!ctx_r4.options.rowsOptions.global ? ctx_r4.options.rowsOptions.global.style : null);
    i0.ɵɵadvance(3);
    i0.ɵɵproperty("ngIf", !ctx_r4.loadingChildRows[parentIndex_r13] && i0.ɵɵpipeBind1(5, 17, hasMore$_r16) && last_r15);
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngIf", ctx_r4.displayExpandableRows(parentIndex_r13 + "_" + innerRowIndex_r12) && ctx_r4.getInnerRows(parentIndex_r13 + "_" + innerRowIndex_r12));
} }
function TableBasicComponent_ng_container_0_ng_template_4_ng_container_0_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵtemplate(1, TableBasicComponent_ng_container_0_ng_template_4_ng_container_0_ng_container_1_Template, 7, 19, "ng-container", 1);
    i0.ɵɵpipe(2, "async");
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const displayRows$_r17 = ctx.$implicit;
    const ctx_r4 = i0.ɵɵnextContext(3);
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngForOf", i0.ɵɵpipeBind1(2, 2, displayRows$_r17))("ngForTrackBy", ctx_r4.trackByRowInvoke());
} }
function TableBasicComponent_ng_container_0_ng_template_4_tr_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "tr", 12)(1, "td");
    i0.ɵɵelement(2, "fusion-loader-inline", 13);
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const ctx_r4 = i0.ɵɵnextContext(3);
    i0.ɵɵadvance();
    i0.ɵɵattribute("colspan", ctx_r4.fullCellColspan);
    i0.ɵɵadvance();
    i0.ɵɵstyleProp("margin-left", ctx_r4.getHalfTableClientWidth, "px");
    i0.ɵɵproperty("status", true);
} }
function TableBasicComponent_ng_container_0_ng_template_4_tr_2_Template(rf, ctx) { if (rf & 1) {
    const _r18 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "tr", 14)(1, "td")(2, "p");
    i0.ɵɵtext(3, " Failed to load data... ");
    i0.ɵɵelementStart(4, "a", 11);
    i0.ɵɵlistener("click", function TableBasicComponent_ng_container_0_ng_template_4_tr_2_Template_a_click_4_listener() { i0.ɵɵrestoreView(_r18); const ctx_r5 = i0.ɵɵnextContext(2); const row_r3 = ctx_r5.$implicit; const rowIndex_r4 = ctx_r5.index; const ctx_r4 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r4.onExpandRow({ rowIndex: rowIndex_r4, row: row_r3, isExpanded: true })); });
    i0.ɵɵtext(5, "Try again");
    i0.ɵɵelementEnd()()()();
} if (rf & 2) {
    const ctx_r4 = i0.ɵɵnextContext(3);
    i0.ɵɵadvance();
    i0.ɵɵattribute("colspan", ctx_r4.fullCellColspan);
    i0.ɵɵadvance();
    i0.ɵɵstyleProp("margin-left", ctx_r4.getHalfTableClientWidth - 80, "px");
} }
function TableBasicComponent_ng_container_0_ng_template_4_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵtemplate(0, TableBasicComponent_ng_container_0_ng_template_4_ng_container_0_Template, 3, 4, "ng-container", 5)(1, TableBasicComponent_ng_container_0_ng_template_4_tr_1_Template, 3, 4, "tr", 6)(2, TableBasicComponent_ng_container_0_ng_template_4_tr_2_Template, 6, 3, "tr", 7);
} if (rf & 2) {
    const parentRowChildren_r19 = ctx.$implicit;
    const parentIndex_r13 = ctx.parentIndex;
    const ctx_r4 = i0.ɵɵnextContext(2);
    i0.ɵɵproperty("fusionLoadMoreOf", parentRowChildren_r19)("fusionLoadMoreChunkSize", (ctx_r4.options.rowsExpandableOptions == null ? null : ctx_r4.options.rowsExpandableOptions.expendChunkSize) || 10);
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngIf", ctx_r4.loadingChildRows[parentIndex_r13]);
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngIf", ctx_r4.failedChildRows[parentIndex_r13]);
} }
function TableBasicComponent_ng_container_0_Template(rf, ctx) { if (rf & 1) {
    const _r1 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelementStart(1, "tr", 2);
    i0.ɵɵpipe(2, "generic");
    i0.ɵɵlistener("rowRemoved", function TableBasicComponent_ng_container_0_Template_tr_rowRemoved_1_listener() { const ctx_r1 = i0.ɵɵrestoreView(_r1); const row_r3 = ctx_r1.$implicit; const rowIndex_r4 = ctx_r1.index; const ctx_r4 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r4.tableService.removeRow({ rows: ctx_r4.rows, rowIndex: rowIndex_r4, row: row_r3, options: ctx_r4.options })); })("selectedChange", function TableBasicComponent_ng_container_0_Template_tr_selectedChange_1_listener($event) { const row_r3 = i0.ɵɵrestoreView(_r1).$implicit; const ctx_r4 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r4.tableService.onRowSelectChanged($event, row_r3)); })("expandRow", function TableBasicComponent_ng_container_0_Template_tr_expandRow_1_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r4 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r4.onExpandRow($event)); });
    i0.ɵɵelementEnd();
    i0.ɵɵtemplate(3, TableBasicComponent_ng_container_0_ng_container_3_Template, 1, 5, "ng-container", 3)(4, TableBasicComponent_ng_container_0_ng_template_4_Template, 3, 4, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor);
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const row_r3 = ctx.$implicit;
    const rowIndex_r4 = ctx.index;
    const ctx_r4 = i0.ɵɵnextContext();
    i0.ɵɵadvance();
    i0.ɵɵproperty("rowIndex", rowIndex_r4)("row", row_r3)("columns", ctx_r4.columns)("options", ctx_r4.options)("isRowSelected", ctx_r4.tableService.isRowSelected(row_r3))("isExpanded", ctx_r4.isExpanded(rowIndex_r4))("isInnerRow", false)("ngClass", i0.ɵɵpipeBind3(2, 10, ctx_r4.getRowClass.bind(ctx_r4), row_r3, rowIndex_r4))("ngStyle", !!ctx_r4.options.rowsOptions && !!ctx_r4.options.rowsOptions.global ? ctx_r4.options.rowsOptions.global.style : null);
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngIf", ctx_r4.displayExpandableRows(rowIndex_r4));
} }
export class TableBasicComponent {
    set options(value) {
        this.tableOptions = value;
        this.childRowOptions = { ...value, hasTotalsRow: false };
    }
    set tableClientWidth(value) {
        this._halfTableClientWidth = value ? value / 2 : 0;
    }
    get options() {
        return this.tableOptions;
    }
    get fullCellColspan() {
        if (!!this.tableService.expandLevels) {
            return this.columns.length + this.tableService.expandLevels;
        }
        return this.columns.length;
    }
    get getHalfTableClientWidth() {
        return this._halfTableClientWidth;
    }
    constructor(tableService, cdr) {
        this.tableService = tableService;
        this.cdr = cdr;
        this.rowSelected = new EventEmitter();
        this.expandRow = new EventEmitter();
        this.loadingChildRows = {};
        this.failedChildRows = {};
        this._halfTableClientWidth = 0;
        this.onDestroy$ = new Subject();
    }
    ngOnInit() {
        this.tableService.selectionChanged.pipe(takeUntil(this.onDestroy$)).subscribe(val => {
            this.cdr.markForCheck();
        });
    }
    ngOnDestroy() {
        this.onDestroy$.next();
        this.onDestroy$.complete();
    }
    trackByRowInvoke() {
        return this.trackByRow.bind(this);
    }
    trackByRow(index, row) {
        const keyOption = this.options && this.options.rowTrackingOption ? this.options.rowTrackingOption : 'id';
        return row && row[keyOption] ? row[keyOption] : row;
    }
    isRowDisabled(row) {
        return row._options && row._options.some(options => 'disabled');
    }
    getRowClass(row, rowIndex) {
        const rowClasses = this.options.rowsOptions || {};
        const classes = {};
        classes[TableRowClassesEnum.Selected] = this.tableService.isRowSelected(row);
        classes[TableRowClassesEnum.Disabled] = this.isRowDisabled(row);
        return [
            ...Object.keys(classes).filter((item) => !!classes[item]),
            !!rowClasses[rowIndex] && !!rowClasses[rowIndex].class ? rowClasses[rowIndex].class : null
        ].filter(Boolean);
    }
    onExpandRow({ rowIndex, row, isExpanded }, updateMap = true) {
        if (!!row) {
            this.loadingChildRows[rowIndex] = isExpanded;
            delete this.failedChildRows[rowIndex];
            const successCallback = this.onExpendRowSuccess(rowIndex).bind(this);
            const failedCallback = this.onExpendRowFailed(rowIndex).bind(this);
            this.expandRow.emit({ rowIndex, row, isExpanded, successCallback, failedCallback, updateMap: updateMap });
        }
    }
    displayExpandableRows(rowIndex) {
        return !!this.options?.rowsExpandableOptions?.key && this.isExpanded(rowIndex);
    }
    getInnerRows(index) {
        const innerKey = this.options.rowsExpandableOptions.key;
        const indexes = index.split('_').map(Number);
        let retRow = this.rows;
        indexes.forEach((item, idx) => {
            retRow = !!idx ? retRow[innerKey][item] : retRow[item];
        });
        return retRow[innerKey] || [];
    }
    isExpanded(rowIndex) {
        // check if has row index keys in expandedRows / loadingChildRows / failedChildRows;
        if (this.expandedRows?.hasOwnProperty(rowIndex) ||
            this.loadingChildRows.hasOwnProperty(rowIndex) ||
            this.failedChildRows.hasOwnProperty(rowIndex)) {
            return this.expandedRows[rowIndex] || this.loadingChildRows[rowIndex] || this.failedChildRows[rowIndex];
        }
        return this.expandedRows['default'];
    }
    hasAfterSticky(isLast, hasMore, rowIndex) {
        return isLast && (hasMore || this.loadingChildRows[rowIndex] || this.failedChildRows[rowIndex]);
    }
    onExpendRowSuccess(rowIndex) {
        return () => {
            delete this.loadingChildRows[rowIndex];
        };
    }
    onExpendRowFailed(rowIndex) {
        return () => {
            delete this.loadingChildRows[rowIndex];
            this.failedChildRows[rowIndex] = true;
            this.cdr.detectChanges();
        };
    }
    static { this.ɵfac = function TableBasicComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TableBasicComponent)(i0.ɵɵdirectiveInject(i1.TableService), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); }; }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: TableBasicComponent, selectors: [["", "fusionTableBasic", ""]], inputs: { rows: "rows", columns: "columns", expandedRows: "expandedRows", options: "options", tableClientWidth: "tableClientWidth" }, outputs: { rowSelected: "rowSelected", expandRow: "expandRow" }, attrs: _c0, decls: 1, vars: 2, consts: [["childRowsTemplate", ""], [4, "ngFor", "ngForOf", "ngForTrackBy"], ["fusionTableRow", "", 3, "rowRemoved", "selectedChange", "expandRow", "rowIndex", "row", "columns", "options", "isRowSelected", "isExpanded", "isInnerRow", "ngClass", "ngStyle"], [3, "ngTemplateOutlet", "ngTemplateOutletContext", 4, "ngIf"], [3, "ngTemplateOutlet", "ngTemplateOutletContext"], [4, "fusionLoadMore", "fusionLoadMoreOf", "fusionLoadMoreChunkSize"], ["class", "full-cell loader", 4, "ngIf"], ["class", "full-cell failed", 4, "ngIf"], ["fusionTableRow", "", 1, "is-inner-row", 3, "expandRow", "rowIndex", "row", "columns", "options", "isExpanded", "isInnerRow", "ngClass", "hasAfterSticky", "ngStyle"], ["class", "full-cell load-more", 4, "ngIf"], [1, "full-cell", "load-more"], [3, "click"], [1, "full-cell", "loader"], ["text", "Loading...", 3, "status"], [1, "full-cell", "failed"]], template: function TableBasicComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵtemplate(0, TableBasicComponent_ng_container_0_Template, 6, 14, "ng-container", 1);
        } if (rf & 2) {
            i0.ɵɵproperty("ngForOf", ctx.rows)("ngForTrackBy", ctx.trackByRowInvoke());
        } }, dependencies: [i2.NgClass, i2.NgForOf, i2.NgIf, i2.NgTemplateOutlet, i2.NgStyle, i3.LoaderInlineComponent, i4.LoadMoreDirective, i5.TableRowComponent, i2.AsyncPipe, i6.GenericPipe], styles: ["[_nghost-%COMP%]   a[_ngcontent-%COMP%]{font-size:12px;font-family:var(--regular-font-family, \"Open Sans\");font-weight:600}[_nghost-%COMP%]   a[_ngcontent-%COMP%]{text-decoration:none;color:var(--primary-color, #3091F6);cursor:pointer}[_nghost-%COMP%]   a[_ngcontent-%COMP%]:link, [_nghost-%COMP%]   a[_ngcontent-%COMP%]:visited, [_nghost-%COMP%]   a[_ngcontent-%COMP%]:hover, [_nghost-%COMP%]   a[_ngcontent-%COMP%]:active{color:var(--primary-color, #3091F6)}[_nghost-%COMP%]   .full-cell[_ngcontent-%COMP%]{height:41px;background-color:var(--light-color-100, #F9FAFB)}[_nghost-%COMP%]   .full-cell.load-more[_ngcontent-%COMP%], [_nghost-%COMP%]   .full-cell.failed[_ngcontent-%COMP%]{height:27px}[_nghost-%COMP%]   .full-cell.load-more[_ngcontent-%COMP%]   p[_ngcontent-%COMP%], [_nghost-%COMP%]   .full-cell.failed[_ngcontent-%COMP%]   p[_ngcontent-%COMP%]{margin:0}"], changeDetection: 0 }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TableBasicComponent, [{
        type: Component,
        args: [{ selector: '[fusionTableBasic]', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngFor=\"let row of rows; trackBy: trackByRowInvoke(); let rowIndex = index\">\n    <!--First parent row-->\n    <tr\n        fusionTableRow\n        [rowIndex]=\"rowIndex\"\n        [row]=\"row\"\n        [columns]=\"columns\"\n        [options]=\"options\"\n        [isRowSelected]=\"tableService.isRowSelected(row)\"\n        [isExpanded]=\"isExpanded(rowIndex)\"\n        [isInnerRow]=\"false\"\n        (rowRemoved)=\"tableService.removeRow({rows: rows, rowIndex: rowIndex, row: row, options: options})\"\n        (selectedChange)=\"tableService.onRowSelectChanged($event, row)\"\n        (expandRow)=\"onExpandRow($event)\"\n        [ngClass]=\"getRowClass.bind(this) | generic:row:rowIndex\"\n        [ngStyle]=\"!!options.rowsOptions && !!options.rowsOptions.global ? options.rowsOptions.global.style : null\"\n    ></tr>\n    <!--First parent row END-->\n    <!--Child rows-->\n    <ng-container\n        *ngIf=\"displayExpandableRows(rowIndex)\"\n        [ngTemplateOutlet]=\"childRowsTemplate\"\n        [ngTemplateOutletContext]=\"{$implicit: row[options.rowsExpandableOptions.key], parentIndex: rowIndex}\"\n    >\n    </ng-container>\n    <!--Child rows END-->\n    <!--Recursive template for child rows render-->\n    <ng-template #childRowsTemplate let-parentRowChildren let-parentIndex=\"parentIndex\">\n        <ng-container *fusionLoadMore=\"let displayRows$ of parentRowChildren; chunkSize: options.rowsExpandableOptions?.expendChunkSize || 10; let loadMore = loadMore; let hasMore$ = hasMore$;\">\n            <ng-container\n                *ngFor=\"let innerRow of displayRows$ | async; trackBy: trackByRowInvoke(); let innerRowIndex = index; let last = last\"\n            >\n                <tr\n                    fusionTableRow\n                    class=\"is-inner-row\"\n                    [rowIndex]=\"parentIndex + '_' + innerRowIndex\"\n                    [row]=\"innerRow\"\n                    [columns]=\"options.rowsExpandableOptions.columns\"\n                    [options]=\"childRowOptions\"\n                    [isExpanded]=\"isExpanded(parentIndex + '_' + innerRowIndex)\"\n                    [isInnerRow]=\"true\"\n                    [ngClass]=\"getRowClass.bind(this) | generic:innerRow:innerRowIndex\"\n                    [hasAfterSticky]=\"hasAfterSticky(last, hasMore$ | async, parentIndex + '_' + innerRowIndex)\"\n                    [ngStyle]=\"!!options.rowsOptions && !!options.rowsOptions.global ? options.rowsOptions.global.style : null\"\n                    (expandRow)=\"onExpandRow($event)\"\n                ></tr>\n                <tr class=\"full-cell load-more\" *ngIf=\"!loadingChildRows[parentIndex] && (hasMore$ | async) && last\">\n                    <td [attr.colspan]=\"fullCellColspan\">\n                        <a [style.margin-left.px]=\"getHalfTableClientWidth\" (click)=\"loadMore()\">Load more</a>\n                    </td>\n                </tr>\n                <!--recursive template invocation-->\n                <ng-container\n                    *ngIf=\"displayExpandableRows(parentIndex + '_' + innerRowIndex) && getInnerRows(parentIndex + '_' + innerRowIndex) as innerRows\"\n                    [ngTemplateOutlet]=\"childRowsTemplate\"\n                    [ngTemplateOutletContext]=\"{\n                        $implicit: innerRows,\n                        parentIndex: parentIndex + '_' + innerRowIndex\n                    }\"\n                >\n                </ng-container>\n            </ng-container>\n        </ng-container>\n        <tr class=\"full-cell loader\" *ngIf=\"loadingChildRows[parentIndex]\">\n            <td [attr.colspan]=\"fullCellColspan\">\n                <fusion-loader-inline [style.margin-left.px]=\"getHalfTableClientWidth\" [status]=\"true\" text=\"Loading...\">\n                </fusion-loader-inline>\n            </td>\n        </tr>\n        <tr class=\"full-cell failed\" *ngIf=\"failedChildRows[parentIndex]\">\n            <td [attr.colspan]=\"fullCellColspan\">\n                <p [style.margin-left.px]=\"getHalfTableClientWidth - 80\">\n                    Failed to load data...\n                    <a (click)=\"onExpandRow({rowIndex: rowIndex, row: row, isExpanded: true})\">Try again</a>\n                </p>\n            </td>\n        </tr>\n    </ng-template>\n    <!--Recursive template for child rows render END-->\n</ng-container>\n", styles: [":host a{font-size:12px;font-family:var(--regular-font-family, \"Open Sans\");font-weight:600}:host a{text-decoration:none;color:var(--primary-color, #3091F6);cursor:pointer}:host a:link,:host a:visited,:host a:hover,:host a:active{color:var(--primary-color, #3091F6)}:host .full-cell{height:41px;background-color:var(--light-color-100, #F9FAFB)}:host .full-cell.load-more,:host .full-cell.failed{height:27px}:host .full-cell.load-more p,:host .full-cell.failed p{margin:0}\n"] }]
    }], () => [{ type: i1.TableService }, { type: i0.ChangeDetectorRef }], { rows: [{
            type: Input
        }], columns: [{
            type: Input
        }], expandedRows: [{
            type: Input
        }], options: [{
            type: Input
        }], tableClientWidth: [{
            type: Input
        }], rowSelected: [{
            type: Output
        }], expandRow: [{
            type: Output
        }] }); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(TableBasicComponent, { className: "TableBasicComponent", filePath: "components/table-basic/table-basic.component.ts", lineNumber: 19 }); })();
//# sourceMappingURL=data:application/json;base64, 