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_r6 = i0.ɵɵnextContext();
    const row_r1 = ctx_r6.$implicit;
    const rowIndex_r2 = ctx_r6.index;
    const _r5 = i0.ɵɵreference(5);
    const ctx_r3 = i0.ɵɵnextContext();
    i0.ɵɵproperty("ngTemplateOutlet", _r5)("ngTemplateOutletContext", i0.ɵɵpureFunction2(2, _c1, row_r1[ctx_r3.options.rowsExpandableOptions.key], rowIndex_r2));
} }
function TableBasicComponent_ng_container_0_ng_template_4_ng_container_0_ng_container_1_tr_4_Template(rf, ctx) { if (rf & 1) {
    const _r23 = 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(_r23); const loadMore_r13 = i0.ɵɵnextContext(2).loadMore; return i0.ɵɵresetView(loadMore_r13()); });
    i0.ɵɵtext(3, "Load more");
    i0.ɵɵelementEnd()()();
} if (rf & 2) {
    const ctx_r19 = i0.ɵɵnextContext(5);
    i0.ɵɵadvance();
    i0.ɵɵattribute("colspan", ctx_r19.fullCellColspan);
    i0.ɵɵadvance();
    i0.ɵɵstyleProp("margin-left", ctx_r19.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_r24 = ctx.ngIf;
    const innerRowIndex_r17 = i0.ɵɵnextContext().index;
    const parentIndex_r8 = i0.ɵɵnextContext(2).parentIndex;
    i0.ɵɵnextContext();
    const _r5 = i0.ɵɵreference(5);
    i0.ɵɵproperty("ngTemplateOutlet", _r5)("ngTemplateOutletContext", i0.ɵɵpureFunction2(2, _c1, innerRows_r24, parentIndex_r8 + "_" + innerRowIndex_r17));
} }
function TableBasicComponent_ng_container_0_ng_template_4_ng_container_0_ng_container_1_Template(rf, ctx) { if (rf & 1) {
    const _r28 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelementStart(1, "tr", 8);
    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(_r28); const ctx_r27 = i0.ɵɵnextContext(4); return i0.ɵɵresetView(ctx_r27.onExpandRow($event)); });
    i0.ɵɵpipe(2, "generic");
    i0.ɵɵpipe(3, "async");
    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", 2);
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const innerRow_r16 = ctx.$implicit;
    const innerRowIndex_r17 = ctx.index;
    const last_r18 = ctx.last;
    const hasMore$_r14 = i0.ɵɵnextContext().hasMore$;
    const parentIndex_r8 = i0.ɵɵnextContext().parentIndex;
    const ctx_r15 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance();
    i0.ɵɵproperty("rowIndex", parentIndex_r8 + "_" + innerRowIndex_r17)("row", innerRow_r16)("columns", ctx_r15.options.rowsExpandableOptions.columns)("options", ctx_r15.childRowOptions)("isExpanded", ctx_r15.isExpanded(parentIndex_r8 + "_" + innerRowIndex_r17))("isInnerRow", true)("ngClass", i0.ɵɵpipeBind3(2, 11, ctx_r15.getRowClass.bind(ctx_r15), innerRow_r16, innerRowIndex_r17))("hasAfterSticky", ctx_r15.hasAfterSticky(last_r18, i0.ɵɵpipeBind1(3, 15, hasMore$_r14), parentIndex_r8 + "_" + innerRowIndex_r17))("ngStyle", !!ctx_r15.options.rowsOptions && !!ctx_r15.options.rowsOptions.global ? ctx_r15.options.rowsOptions.global.style : null);
    i0.ɵɵadvance(3);
    i0.ɵɵproperty("ngIf", !ctx_r15.loadingChildRows[parentIndex_r8] && i0.ɵɵpipeBind1(5, 17, hasMore$_r14) && last_r18);
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngIf", ctx_r15.displayExpandableRows(parentIndex_r8 + "_" + innerRowIndex_r17) && ctx_r15.getInnerRows(parentIndex_r8 + "_" + innerRowIndex_r17));
} }
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", 0);
    i0.ɵɵpipe(2, "async");
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const displayRows$_r12 = ctx.$implicit;
    const ctx_r9 = i0.ɵɵnextContext(3);
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngForOf", i0.ɵɵpipeBind1(2, 2, displayRows$_r12))("ngForTrackBy", ctx_r9.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_r10 = i0.ɵɵnextContext(3);
    i0.ɵɵadvance();
    i0.ɵɵattribute("colspan", ctx_r10.fullCellColspan);
    i0.ɵɵadvance();
    i0.ɵɵstyleProp("margin-left", ctx_r10.getHalfTableClientWidth, "px");
    i0.ɵɵproperty("status", true);
} }
function TableBasicComponent_ng_container_0_ng_template_4_tr_2_Template(rf, ctx) { if (rf & 1) {
    const _r33 = 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(_r33); const ctx_r32 = i0.ɵɵnextContext(2); const rowIndex_r2 = ctx_r32.index; const row_r1 = ctx_r32.$implicit; const ctx_r31 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r31.onExpandRow({ rowIndex: rowIndex_r2, row: row_r1, isExpanded: true })); });
    i0.ɵɵtext(5, "Try again");
    i0.ɵɵelementEnd()()()();
} if (rf & 2) {
    const ctx_r11 = i0.ɵɵnextContext(3);
    i0.ɵɵadvance();
    i0.ɵɵattribute("colspan", ctx_r11.fullCellColspan);
    i0.ɵɵadvance();
    i0.ɵɵstyleProp("margin-left", ctx_r11.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_r7 = ctx.$implicit;
    const parentIndex_r8 = ctx.parentIndex;
    const ctx_r4 = i0.ɵɵnextContext(2);
    i0.ɵɵproperty("fusionLoadMoreOf", parentRowChildren_r7)("fusionLoadMoreChunkSize", (ctx_r4.options.rowsExpandableOptions == null ? null : ctx_r4.options.rowsExpandableOptions.expendChunkSize) || 10);
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngIf", ctx_r4.loadingChildRows[parentIndex_r8]);
    i0.ɵɵadvance();
    i0.ɵɵproperty("ngIf", ctx_r4.failedChildRows[parentIndex_r8]);
} }
function TableBasicComponent_ng_container_0_Template(rf, ctx) { if (rf & 1) {
    const _r35 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelementStart(1, "tr", 1);
    i0.ɵɵlistener("rowRemoved", function TableBasicComponent_ng_container_0_Template_tr_rowRemoved_1_listener() { const restoredCtx = i0.ɵɵrestoreView(_r35); const rowIndex_r2 = restoredCtx.index; const row_r1 = restoredCtx.$implicit; const ctx_r34 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r34.tableService.removeRow({ rows: ctx_r34.rows, rowIndex: rowIndex_r2, row: row_r1, options: ctx_r34.options })); })("selectedChange", function TableBasicComponent_ng_container_0_Template_tr_selectedChange_1_listener($event) { const restoredCtx = i0.ɵɵrestoreView(_r35); const row_r1 = restoredCtx.$implicit; const ctx_r36 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r36.tableService.onRowSelectChanged($event, row_r1)); })("expandRow", function TableBasicComponent_ng_container_0_Template_tr_expandRow_1_listener($event) { i0.ɵɵrestoreView(_r35); const ctx_r37 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r37.onExpandRow($event)); });
    i0.ɵɵpipe(2, "generic");
    i0.ɵɵelementEnd();
    i0.ɵɵtemplate(3, TableBasicComponent_ng_container_0_ng_container_3_Template, 1, 5, "ng-container", 2)(4, TableBasicComponent_ng_container_0_ng_template_4_Template, 3, 4, "ng-template", null, 3, i0.ɵɵtemplateRefExtractor);
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const row_r1 = ctx.$implicit;
    const rowIndex_r2 = ctx.index;
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵadvance();
    i0.ɵɵproperty("rowIndex", rowIndex_r2)("row", row_r1)("columns", ctx_r0.columns)("options", ctx_r0.options)("isRowSelected", ctx_r0.tableService.isRowSelected(row_r1))("isExpanded", ctx_r0.isExpanded(rowIndex_r2))("isInnerRow", false)("ngClass", i0.ɵɵpipeBind3(2, 10, ctx_r0.getRowClass.bind(ctx_r0), row_r1, rowIndex_r2))("ngStyle", !!ctx_r0.options.rowsOptions && !!ctx_r0.options.rowsOptions.global ? ctx_r0.options.rowsOptions.global.style : null);
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngIf", ctx_r0.displayExpandableRows(rowIndex_r2));
} }
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(t) { return new (t || 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: [[4, "ngFor", "ngForOf", "ngForTrackBy"], ["fusionTableRow", "", 3, "rowIndex", "row", "columns", "options", "isRowSelected", "isExpanded", "isInnerRow", "ngClass", "ngStyle", "rowRemoved", "selectedChange", "expandRow"], [3, "ngTemplateOutlet", "ngTemplateOutletContext", 4, "ngIf"], ["childRowsTemplate", ""], [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, "rowIndex", "row", "columns", "options", "isExpanded", "isInnerRow", "ngClass", "hasAfterSticky", "ngStyle", "expandRow"], ["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", 0);
        } 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, 