var DataTableComponent_1;
import { __decorate } from "tslib";
import { Component, Input, Output, EventEmitter, ViewChild } from "@angular/core";
import { MatSort } from '@angular/material/sort';
import { UntilDestroy, untilDestroyed } from "@ngneat/until-destroy";
import * as i0 from "@angular/core";
import * as i1 from "@angular/flex-layout/flex";
import * as i2 from "@angular/flex-layout/extended";
import * as i3 from "@angular/common";
import * as i4 from "ngx-infinite-scroll";
import * as i5 from "@angular/material/button";
import * as i6 from "@angular/material/checkbox";
import * as i7 from "@angular/material/icon";
import * as i8 from "@angular/material/menu";
import * as i9 from "@angular/material/sort";
import * as i10 from "@angular/material/table";
let DataTableComponent = class DataTableComponent {
    static { DataTableComponent_1 = this; }
    static { this.nextId = 0; }
    constructor() {
        this.action = new EventEmitter();
        this.selctionChange = new EventEmitter();
        this.rowClick = new EventEmitter();
        this.tableScroll = new EventEmitter();
        this.sortChanged = new EventEmitter();
        this.elementId = `data-table-${DataTableComponent_1.nextId++}`;
    }
    ngOnInit() { }
    /**Life cycle hook method */
    ngAfterViewInit() {
        // Emit change in selection
        if (this.selection) {
            this.selection.changed.pipe().subscribe((change) => {
                if (this.selection.selected) {
                    this.selctionChange.emit(this.selection.selected);
                }
            });
        }
        if (this.sort) {
            this.sort.sortChange.pipe(untilDestroyed(this))
                .subscribe((value) => {
                this.sortChanged.emit(value);
            });
        }
    }
    /** Whether the number of selected elements matches the total number of rows. */
    isAllSelected() {
        const numSelected = this.selection.selected.length;
        const numRows = this.data.length;
        return numSelected === numRows;
    }
    /** Selects all rows if they are not all selected; otherwise clear selection. */
    masterToggle() {
        this.isAllSelected()
            ? this.clearSelection()
            : this.data.forEach(row => this.selection.select(row));
    }
    /**clear selection*/
    clearSelection() {
        this.selection.clear();
        this.selctionChange.emit(this.selection.selected);
    }
    ngOnChanges(changes) {
        this.initializeConfig(changes);
        if (changes.data && !changes.data.isFirstChange()) {
            // If not first change
            this.data = changes.data.currentValue;
        }
    }
    initializeConfig(changes) {
        if (changes.config && !changes.config.isFirstChange()) {
            this.config = changes.config.currentValue;
        }
        this.page = this.config.page || 1;
        this.lastPage = this.config.lastPage || this.page;
        this.perPage = this.config.perPage || 20;
    }
    onScroll() {
        if (this.page < this.lastPage) {
            this.page += 1;
            this.tableScroll.emit({ page: this.page, lastPage: this.lastPage, perPage: this.perPage });
        }
    }
    /**Method invokes when edit action icon is clickes */
    editClicked(event, element) {
        this.action.emit({ action: "edit", value: element });
        event.stopPropagation();
    }
    /**Method invokes when view action icon is clickes */
    viewClicked(event, element) {
        this.action.emit({ action: "view", value: element });
        event.stopPropagation();
    }
    /**Method invokes when edit action icon is clickes */
    deactivateClicked(event, element) {
        this.action.emit({ action: "deactivate", value: element });
        event.stopPropagation();
    }
    /**Method invokes when download action icon is clickes */
    downloadClicked(event, element) {
        this.action.emit({ action: "download", value: element });
        event.stopPropagation();
    }
    /**Method invokes when print action icon is clickes */
    printClicked(event, element) {
        this.action.emit({ action: 'print', value: element });
        event.stopPropagation();
    }
    /**Method invokes when a row is clicked */
    rowClicked(event, element) {
        this.rowClick.emit(element);
        event.stopPropagation();
    }
    /**Method invokes when menu action icon is hovered */
    actionMenuClick(event, element, menuValue) {
        this.action.emit({ action: menuValue, value: element });
        this.trigger.closeMenu();
        event.stopPropagation();
    }
    /**Method invokes when menu action icon is hovered and selects for particular action*/
    actionMenuTriggerClick(event, trigger) {
        this.trigger = trigger;
        event.stopPropagation();
    }
    checkEdit(ele) {
        if (this.config.editDisableFunction) {
            return this.config.editDisableFunction(ele);
        }
        return true;
    }
    checkView(ele) {
        if (this.config.viewDisableFunction) {
            return this.config.viewDisableFunction(ele);
        }
        return true;
    }
    checkPrint(ele) {
        if (this.config.printDisableFunction) {
            return this.config.printDisableFunction(ele);
        }
        return true;
    }
    checkActions(ele) {
        if (this.config.actionsMenuFunction) {
            return this.config.actionsMenuFunction(ele);
        }
        return true;
    }
    checkActionButton(ele, value) {
        if (this.config.actionsMenuButtonFunction) {
            return this.config.actionsMenuButtonFunction(ele, value);
        }
        return true;
    }
    getValue(ele, keyString) {
        keyString = keyString.replace(/\[(\w+)\]/g, ".$1"); // convert indexes to properties
        keyString = keyString.replace(/^\./, ""); // strip a leading dot
        const keyList = keyString.split(".");
        for (let i = 0, n = keyList.length; i < n; ++i) {
            const key = keyList[i];
            if (ele && key in ele) {
                ele = ele[key];
            }
            else {
                return;
            }
        }
        return ele;
    }
    ngOnDestroy() {
        //Until Destroy uses it.
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DataTableComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.13", type: DataTableComponent, selector: "app-data-table", inputs: { data: "data", config: "config", selection: "selection", elementId: "elementId" }, outputs: { action: "action", selctionChange: "selctionChange", rowClick: "rowClick", tableScroll: "tableScroll", sortChanged: "sortChanged" }, viewQueries: [{ propertyName: "sort", first: true, predicate: MatSort, descendants: true, static: true }], usesOnChanges: true, ngImport: i0, template: "<div fxLayout=\"column\" [ngClass]=\"{\n    'mat-elevation-z1': !config.disableElevation\n  }\" class=\"scroll-container\" infiniteScroll [infiniteScrollDistance]=\"1\" [infiniteScrollThrottle]=\"50\"\n    (scrolled)=\"onScroll()\" [scrollWindow]=\"false\" [ngStyle]=\"config.style\">\n    <table mat-table [dataSource]=\"data\" matSort [id]=\"elementId\">\n        <!-- Checkbox Column -->\n        <ng-container matColumnDef=\"select\">\n            <th mat-header-cell *matHeaderCellDef style=\"width:60px\">\n                <mat-checkbox *ngIf=\"selection\" (change)=\"$event ? masterToggle() : null\"\n                    [checked]=\"selection.hasValue() && isAllSelected()\"\n                    [indeterminate]=\"selection.hasValue() && !isAllSelected()\">\n                </mat-checkbox>\n            </th>\n            <td mat-cell *matCellDef=\"let row\" style=\"width:60px\">\n                <mat-checkbox *ngIf=\"selection\" (click)=\"$event.stopPropagation()\"\n                    (change)=\"$event ? selection.toggle(row) : null\" [checked]=\"selection.isSelected(row)\">\n                </mat-checkbox>\n            </td>\n        </ng-container>\n\n        <!-- Index Column -->\n        <ng-container matColumnDef=\"index\">\n            <th mat-header-cell *matHeaderCellDef>#</th>\n            <td mat-cell *matCellDef=\"let index = index\">\n                {{ (index + 1) }}\n            </td>\n        </ng-container>\n\n        <ng-container matColumnDef=\"actions\">\n            <th mat-header-cell *matHeaderCellDef class=\"action-width d-print-none\">\n                {{ config.customActionLabel }}\n            </th>\n\n            <td mat-cell *matCellDef=\"let element; let index = index\" class=\"d-print-none\">\n                <div>\n                    <button *ngIf=\"\n              config.actionsConfig.download && element[config.downloadLink]\n            \" type=\"button\" mat-icon-button (click)=\"downloadClicked($event, element)\">\n                        <mat-icon>vertical_align_bottom</mat-icon>\n                    </button>\n\n                    <button *ngIf=\"config.actionsConfig.edit\" [disabled]=\"!this.checkEdit(element)\" type=\"button\"\n                        mat-icon-button (click)=\"editClicked($event, element)\">\n                        <mat-icon>edit</mat-icon>\n                    </button>\n\n                    <button *ngIf=\"config.actionsConfig.print\" [disabled]=\"!this.checkPrint(element)\" type=\"button\"\n                        mat-icon-button (click)=\"printClicked($event,element)\">\n                        <mat-icon>print</mat-icon>\n                    </button>\n\n                    <button *ngIf=\"config.actionsConfig.view\" [disabled]=\"!this.checkView(element)\" type=\"button\"\n                        mat-icon-button (click)=\"viewClicked($event, element)\">\n                        <mat-icon>description</mat-icon>\n                    </button>\n\n                    <button *ngIf=\"config.actionsConfig.deactivate\" type=\"button\" mat-icon-button\n                        (click)=\"deactivateClicked($event, element)\">\n                        <mat-icon>delete</mat-icon>\n                    </button>\n\n                    <button #menuTrigger=\"matMenuTrigger\" *ngIf=\"\n              config.actionsConfig.actionsMenu &&\n              this.checkActions(element) &&\n              config.actionsConfig.actionsMenu.length > 0\n            \" type=\"button\" mat-icon-button [matMenuTriggerFor]=\"actionsMenu\"\n                        (click)=\"actionMenuTriggerClick($event, menuTrigger)\">\n                        <mat-icon>more_vert</mat-icon>\n                    </button>\n                </div>\n\n                <mat-menu #actionsMenu=\"matMenu\">\n                    <div *ngFor=\"let item of config.actionsConfig.actionsMenu\">\n                        <button *ngIf=\"this.checkActionButton(element, item.value)\" mat-menu-item\n                            (click)=\"actionMenuClick($event, element, item.value)\">\n                            <span>{{ item.name }}</span>\n                        </button>\n                    </div>\n                </mat-menu>\n            </td>\n        </ng-container>\n\n        <!-- Actual Columns -->\n        <ng-container matColumnDef=\"{{ column.value }}\" *ngFor=\"let column of config.columnsConfig\">\n            <ng-container *ngIf=\"column?.sort; else noSort\">\n                <th mat-header-cell *matHeaderCellDef mat-sort-header>\n                    {{ column.title }}\n                </th>\n            </ng-container>\n            <ng-template #noSort>\n                <th mat-header-cell *matHeaderCellDef>\n                    {{ column.title }}\n                </th>\n            </ng-template>\n            <ng-container *ngIf=\"column.dateField; else currencyField\">\n                <td mat-cell *matCellDef=\"let element\">\n                    <div class=\"text-truncate\" appToolTip>\n                        {{ getValue(element, column.value) | date:column.format? column.format: 'mediumDate' }}\n                    </div>\n                </td>\n            </ng-container>\n\n            <ng-template #currencyField>\n                <div *ngIf=\"column.currencyField; else normalField\">\n                    <td mat-cell *matCellDef=\"let element\">\n                        <div class=\"text-truncate\" appToolTip>\n                            {{ getValue(element, column.value) | currency: \"$\":'symbol' : '1.0-0' }}\n                        </div>\n                    </td>\n                </div>\n            </ng-template>\n\n            <ng-template #normalField>\n                <td mat-cell *matCellDef=\"let element\">\n                    <div class=\"text-truncate\" appToolTip>\n                        {{ getValue(element, column.value) }}\n                    </div>\n                </td>\n            </ng-template>\n        </ng-container>\n\n        <ng-container *ngIf=\"config.stickyHeader; else normalHeader\">\n            <tr class=\"font-weight-bold\" mat-header-row *matHeaderRowDef=\"config.displayedColumns; sticky:true\"></tr>\n        </ng-container>\n        <ng-template #normalHeader>\n            <tr class=\"font-weight-bold\" mat-header-row *matHeaderRowDef=\"config.displayedColumns;\">\n            </tr>\n        </ng-template>\n\n        <div *ngIf=\"!config.enableRowClick\">\n            <tr mat-row *matRowDef=\"let row; columns: config.displayedColumns\"></tr>\n        </div>\n\n        <div *ngIf=\"config.enableRowClick\">\n            <tr mat-row *matRowDef=\"let row; columns: config.displayedColumns\" (click)=\"rowClicked($event, row)\"\n                class=\"hoverable row-hover\"></tr>\n        </div>\n    </table>\n</div>", styles: ["table{width:100%}.mat-table{background:inherit}.mat-column-select{overflow:initial}td.mat-cell,td.mat-footer-cell,th.mat-header-cell{padding:0 2px}.action-width{min-width:175px;width:175px!important}.noOverFlow{overflow-x:auto;overflow-y:hidden}.scroll-container{max-height:400px;overflow:auto}.mat-header-row{position:sticky;top:0;background-color:inherit}tr.row-hover:hover{background-color:#dcdcdc}td.mat-cell:first-of-type,td.mat-footer-cell:first-of-type,th.mat-header-cell:first-of-type{padding-left:24px!important}\n"], dependencies: [{ kind: "directive", type: i1.DefaultLayoutDirective, selector: "  [fxLayout], [fxLayout.xs], [fxLayout.sm], [fxLayout.md],  [fxLayout.lg], [fxLayout.xl], [fxLayout.lt-sm], [fxLayout.lt-md],  [fxLayout.lt-lg], [fxLayout.lt-xl], [fxLayout.gt-xs], [fxLayout.gt-sm],  [fxLayout.gt-md], [fxLayout.gt-lg]", inputs: ["fxLayout", "fxLayout.xs", "fxLayout.sm", "fxLayout.md", "fxLayout.lg", "fxLayout.xl", "fxLayout.lt-sm", "fxLayout.lt-md", "fxLayout.lt-lg", "fxLayout.lt-xl", "fxLayout.gt-xs", "fxLayout.gt-sm", "fxLayout.gt-md", "fxLayout.gt-lg"] }, { kind: "directive", type: i2.DefaultClassDirective, selector: "  [ngClass], [ngClass.xs], [ngClass.sm], [ngClass.md], [ngClass.lg], [ngClass.xl],  [ngClass.lt-sm], [ngClass.lt-md], [ngClass.lt-lg], [ngClass.lt-xl],  [ngClass.gt-xs], [ngClass.gt-sm], [ngClass.gt-md], [ngClass.gt-lg]", inputs: ["ngClass", "ngClass.xs", "ngClass.sm", "ngClass.md", "ngClass.lg", "ngClass.xl", "ngClass.lt-sm", "ngClass.lt-md", "ngClass.lt-lg", "ngClass.lt-xl", "ngClass.gt-xs", "ngClass.gt-sm", "ngClass.gt-md", "ngClass.gt-lg"] }, { kind: "directive", type: i2.DefaultStyleDirective, selector: "  [ngStyle],  [ngStyle.xs], [ngStyle.sm], [ngStyle.md], [ngStyle.lg], [ngStyle.xl],  [ngStyle.lt-sm], [ngStyle.lt-md], [ngStyle.lt-lg], [ngStyle.lt-xl],  [ngStyle.gt-xs], [ngStyle.gt-sm], [ngStyle.gt-md], [ngStyle.gt-lg]", inputs: ["ngStyle", "ngStyle.xs", "ngStyle.sm", "ngStyle.md", "ngStyle.lg", "ngStyle.xl", "ngStyle.lt-sm", "ngStyle.lt-md", "ngStyle.lt-lg", "ngStyle.lt-xl", "ngStyle.gt-xs", "ngStyle.gt-sm", "ngStyle.gt-md", "ngStyle.gt-lg"] }, { kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i4.InfiniteScrollDirective, selector: "[infiniteScroll], [infinite-scroll], [data-infinite-scroll]", inputs: ["infiniteScrollDistance", "infiniteScrollUpDistance", "infiniteScrollThrottle", "infiniteScrollDisabled", "infiniteScrollContainer", "scrollWindow", "immediateCheck", "horizontal", "alwaysCallback", "fromRoot"], outputs: ["scrolled", "scrolledUp"] }, { kind: "component", type: i5.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: i6.MatCheckbox, selector: "mat-checkbox", inputs: ["aria-label", "aria-labelledby", "aria-describedby", "id", "required", "labelPosition", "name", "value", "disableRipple", "tabIndex", "color", "disabledInteractive", "checked", "disabled", "indeterminate"], outputs: ["change", "indeterminateChange"], exportAs: ["matCheckbox"] }, { kind: "component", type: i7.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: i8.MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: i8.MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: i8.MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "directive", type: i9.MatSort, selector: "[matSort]", inputs: ["matSortActive", "matSortStart", "matSortDirection", "matSortDisableClear", "matSortDisabled"], outputs: ["matSortChange"], exportAs: ["matSort"] }, { kind: "component", type: i9.MatSortHeader, selector: "[mat-sort-header]", inputs: ["mat-sort-header", "arrowPosition", "start", "disabled", "sortActionDescription", "disableClear"], exportAs: ["matSortHeader"] }, { kind: "component", type: i10.MatTable, selector: "mat-table, table[mat-table]", exportAs: ["matTable"] }, { kind: "directive", type: i10.MatHeaderCellDef, selector: "[matHeaderCellDef]" }, { kind: "directive", type: i10.MatHeaderRowDef, selector: "[matHeaderRowDef]", inputs: ["matHeaderRowDef", "matHeaderRowDefSticky"] }, { kind: "directive", type: i10.MatColumnDef, selector: "[matColumnDef]", inputs: ["matColumnDef"] }, { kind: "directive", type: i10.MatCellDef, selector: "[matCellDef]" }, { kind: "directive", type: i10.MatRowDef, selector: "[matRowDef]", inputs: ["matRowDefColumns", "matRowDefWhen"] }, { kind: "directive", type: i10.MatHeaderCell, selector: "mat-header-cell, th[mat-header-cell]" }, { kind: "directive", type: i10.MatCell, selector: "mat-cell, td[mat-cell]" }, { kind: "component", type: i10.MatHeaderRow, selector: "mat-header-row, tr[mat-header-row]", exportAs: ["matHeaderRow"] }, { kind: "component", type: i10.MatRow, selector: "mat-row, tr[mat-row]", exportAs: ["matRow"] }, { kind: "pipe", type: i3.CurrencyPipe, name: "currency" }, { kind: "pipe", type: i3.DatePipe, name: "date" }] }); }
};
DataTableComponent = DataTableComponent_1 = __decorate([
    UntilDestroy()
], DataTableComponent);
export { DataTableComponent };
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: DataTableComponent, decorators: [{
            type: Component,
            args: [{ selector: "app-data-table", template: "<div fxLayout=\"column\" [ngClass]=\"{\n    'mat-elevation-z1': !config.disableElevation\n  }\" class=\"scroll-container\" infiniteScroll [infiniteScrollDistance]=\"1\" [infiniteScrollThrottle]=\"50\"\n    (scrolled)=\"onScroll()\" [scrollWindow]=\"false\" [ngStyle]=\"config.style\">\n    <table mat-table [dataSource]=\"data\" matSort [id]=\"elementId\">\n        <!-- Checkbox Column -->\n        <ng-container matColumnDef=\"select\">\n            <th mat-header-cell *matHeaderCellDef style=\"width:60px\">\n                <mat-checkbox *ngIf=\"selection\" (change)=\"$event ? masterToggle() : null\"\n                    [checked]=\"selection.hasValue() && isAllSelected()\"\n                    [indeterminate]=\"selection.hasValue() && !isAllSelected()\">\n                </mat-checkbox>\n            </th>\n            <td mat-cell *matCellDef=\"let row\" style=\"width:60px\">\n                <mat-checkbox *ngIf=\"selection\" (click)=\"$event.stopPropagation()\"\n                    (change)=\"$event ? selection.toggle(row) : null\" [checked]=\"selection.isSelected(row)\">\n                </mat-checkbox>\n            </td>\n        </ng-container>\n\n        <!-- Index Column -->\n        <ng-container matColumnDef=\"index\">\n            <th mat-header-cell *matHeaderCellDef>#</th>\n            <td mat-cell *matCellDef=\"let index = index\">\n                {{ (index + 1) }}\n            </td>\n        </ng-container>\n\n        <ng-container matColumnDef=\"actions\">\n            <th mat-header-cell *matHeaderCellDef class=\"action-width d-print-none\">\n                {{ config.customActionLabel }}\n            </th>\n\n            <td mat-cell *matCellDef=\"let element; let index = index\" class=\"d-print-none\">\n                <div>\n                    <button *ngIf=\"\n              config.actionsConfig.download && element[config.downloadLink]\n            \" type=\"button\" mat-icon-button (click)=\"downloadClicked($event, element)\">\n                        <mat-icon>vertical_align_bottom</mat-icon>\n                    </button>\n\n                    <button *ngIf=\"config.actionsConfig.edit\" [disabled]=\"!this.checkEdit(element)\" type=\"button\"\n                        mat-icon-button (click)=\"editClicked($event, element)\">\n                        <mat-icon>edit</mat-icon>\n                    </button>\n\n                    <button *ngIf=\"config.actionsConfig.print\" [disabled]=\"!this.checkPrint(element)\" type=\"button\"\n                        mat-icon-button (click)=\"printClicked($event,element)\">\n                        <mat-icon>print</mat-icon>\n                    </button>\n\n                    <button *ngIf=\"config.actionsConfig.view\" [disabled]=\"!this.checkView(element)\" type=\"button\"\n                        mat-icon-button (click)=\"viewClicked($event, element)\">\n                        <mat-icon>description</mat-icon>\n                    </button>\n\n                    <button *ngIf=\"config.actionsConfig.deactivate\" type=\"button\" mat-icon-button\n                        (click)=\"deactivateClicked($event, element)\">\n                        <mat-icon>delete</mat-icon>\n                    </button>\n\n                    <button #menuTrigger=\"matMenuTrigger\" *ngIf=\"\n              config.actionsConfig.actionsMenu &&\n              this.checkActions(element) &&\n              config.actionsConfig.actionsMenu.length > 0\n            \" type=\"button\" mat-icon-button [matMenuTriggerFor]=\"actionsMenu\"\n                        (click)=\"actionMenuTriggerClick($event, menuTrigger)\">\n                        <mat-icon>more_vert</mat-icon>\n                    </button>\n                </div>\n\n                <mat-menu #actionsMenu=\"matMenu\">\n                    <div *ngFor=\"let item of config.actionsConfig.actionsMenu\">\n                        <button *ngIf=\"this.checkActionButton(element, item.value)\" mat-menu-item\n                            (click)=\"actionMenuClick($event, element, item.value)\">\n                            <span>{{ item.name }}</span>\n                        </button>\n                    </div>\n                </mat-menu>\n            </td>\n        </ng-container>\n\n        <!-- Actual Columns -->\n        <ng-container matColumnDef=\"{{ column.value }}\" *ngFor=\"let column of config.columnsConfig\">\n            <ng-container *ngIf=\"column?.sort; else noSort\">\n                <th mat-header-cell *matHeaderCellDef mat-sort-header>\n                    {{ column.title }}\n                </th>\n            </ng-container>\n            <ng-template #noSort>\n                <th mat-header-cell *matHeaderCellDef>\n                    {{ column.title }}\n                </th>\n            </ng-template>\n            <ng-container *ngIf=\"column.dateField; else currencyField\">\n                <td mat-cell *matCellDef=\"let element\">\n                    <div class=\"text-truncate\" appToolTip>\n                        {{ getValue(element, column.value) | date:column.format? column.format: 'mediumDate' }}\n                    </div>\n                </td>\n            </ng-container>\n\n            <ng-template #currencyField>\n                <div *ngIf=\"column.currencyField; else normalField\">\n                    <td mat-cell *matCellDef=\"let element\">\n                        <div class=\"text-truncate\" appToolTip>\n                            {{ getValue(element, column.value) | currency: \"$\":'symbol' : '1.0-0' }}\n                        </div>\n                    </td>\n                </div>\n            </ng-template>\n\n            <ng-template #normalField>\n                <td mat-cell *matCellDef=\"let element\">\n                    <div class=\"text-truncate\" appToolTip>\n                        {{ getValue(element, column.value) }}\n                    </div>\n                </td>\n            </ng-template>\n        </ng-container>\n\n        <ng-container *ngIf=\"config.stickyHeader; else normalHeader\">\n            <tr class=\"font-weight-bold\" mat-header-row *matHeaderRowDef=\"config.displayedColumns; sticky:true\"></tr>\n        </ng-container>\n        <ng-template #normalHeader>\n            <tr class=\"font-weight-bold\" mat-header-row *matHeaderRowDef=\"config.displayedColumns;\">\n            </tr>\n        </ng-template>\n\n        <div *ngIf=\"!config.enableRowClick\">\n            <tr mat-row *matRowDef=\"let row; columns: config.displayedColumns\"></tr>\n        </div>\n\n        <div *ngIf=\"config.enableRowClick\">\n            <tr mat-row *matRowDef=\"let row; columns: config.displayedColumns\" (click)=\"rowClicked($event, row)\"\n                class=\"hoverable row-hover\"></tr>\n        </div>\n    </table>\n</div>", styles: ["table{width:100%}.mat-table{background:inherit}.mat-column-select{overflow:initial}td.mat-cell,td.mat-footer-cell,th.mat-header-cell{padding:0 2px}.action-width{min-width:175px;width:175px!important}.noOverFlow{overflow-x:auto;overflow-y:hidden}.scroll-container{max-height:400px;overflow:auto}.mat-header-row{position:sticky;top:0;background-color:inherit}tr.row-hover:hover{background-color:#dcdcdc}td.mat-cell:first-of-type,td.mat-footer-cell:first-of-type,th.mat-header-cell:first-of-type{padding-left:24px!important}\n"] }]
        }], ctorParameters: () => [], propDecorators: { data: [{
                type: Input
            }], config: [{
                type: Input
            }], selection: [{
                type: Input
            }], action: [{
                type: Output
            }], selctionChange: [{
                type: Output
            }], rowClick: [{
                type: Output
            }], tableScroll: [{
                type: Output
            }], sortChanged: [{
                type: Output
            }], sort: [{
                type: ViewChild,
                args: [MatSort, { static: true }]
            }], elementId: [{
                type: Input
            }] } });
//# sourceMappingURL=data:application/json;base64, 