import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, HostBinding, Injector, Input, Output } from '@angular/core';
import { TableService } from '@ironsource/fusion-ui/components/table/common/services';
import { isNullOrUndefined } from '@ironsource/fusion-ui/utils';
import { of } from 'rxjs';
import { CommonModule } from '@angular/common';
import { GenericPipe } from '@ironsource/fusion-ui/pipes/generic';
import { IconModule } from '@ironsource/fusion-ui/components/icon/v1';
import { TableTestIdModifiers } from '@ironsource/fusion-ui/entities';
import { TestIdsService } from '@ironsource/fusion-ui/services/test-ids';
import { TableCellComponent } from '../table-cell/table-cell.component';
import { TooltipDirective } from '@ironsource/fusion-ui/components/tooltip/v4';
import { IconButtonComponent } from '@ironsource/fusion-ui/components/button/v4';
import * as i0 from "@angular/core";
import * as i1 from "@ironsource/fusion-ui/components/table/common/services";
import * as i2 from "@angular/common";
const _c0 = ["fusionTableRow", ""];
const _c1 = (a0, a1) => ({ x: a0, y: a1 });
function TableRowComponent_For_1_Conditional_0_Conditional_2_Template(rf, ctx) { if (rf & 1) {
    const _r1 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "div")(1, "fusion-icon-button", 2);
    i0.ɵɵpipe(2, "generic");
    i0.ɵɵlistener("click", function TableRowComponent_For_1_Conditional_0_Conditional_2_Template_fusion_icon_button_click_1_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.expandRow.emit({ rowIndex: ctx_r1.rowIndex, row: ctx_r1.row, isExpanded: !ctx_r1.isExpanded })); });
    i0.ɵɵelementEnd()();
} if (rf & 2) {
    const ɵ$index_1_r3 = i0.ɵɵnextContext(2).$index;
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵadvance();
    i0.ɵɵproperty("iconName", !ctx_r1.isExpanded ? ctx_r1.expandArrowIconName : ctx_r1.collapseArrowIconName);
    i0.ɵɵattribute("data-testid", i0.ɵɵpipeBind3(2, 2, ctx_r1.testIdsService.getTestAttribute.bind(ctx_r1), ctx_r1.testId, ctx_r1.tableTestIdModifiers.EXPAND_ICON_BUTTON + "-r" + ctx_r1.rowIndex + "-c" + ɵ$index_1_r3));
} }
function TableRowComponent_For_1_Conditional_0_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "td", 1);
    i0.ɵɵpipe(1, "generic");
    i0.ɵɵtemplate(2, TableRowComponent_For_1_Conditional_0_Conditional_2_Template, 3, 6, "div");
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r3 = i0.ɵɵnextContext();
    const ɵ$index_1_r3 = ctx_r3.$index;
    const ɵ$count_1_r5 = ctx_r3.$count;
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵclassProp("total-row", ctx_r1.isRowTotal)("expanded", ctx_r1.isExpanded)("inner-row", ctx_r1.isInnerRow)("sticky-left", ctx_r1.options == null ? null : ctx_r1.options.rowsExpandableOptions == null ? null : ctx_r1.options.rowsExpandableOptions.sticky);
    i0.ɵɵattribute("data-testid", i0.ɵɵpipeBind3(1, 10, ctx_r1.testIdsService.getTestAttribute.bind(ctx_r1), ctx_r1.testId, ctx_r1.tableTestIdModifiers.CELL + "-r" + ctx_r1.rowIndex + "-c" + ɵ$index_1_r3));
    i0.ɵɵadvance(2);
    i0.ɵɵconditional(ɵ$index_1_r3 === ɵ$count_1_r5 - 1 && ctx_r1.showExpandIcon() ? 2 : -1);
} }
function TableRowComponent_For_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵtemplate(0, TableRowComponent_For_1_Conditional_0_Template, 3, 14, "td", 0);
    i0.ɵɵpipe(1, "generic");
} if (rf & 2) {
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵconditional(i0.ɵɵpipeBind2(1, 1, ctx_r1.cellShown, "cell-expand") ? 0 : -1);
} }
function TableRowComponent_For_4_Conditional_0_Template(rf, ctx) { if (rf & 1) {
    const _r6 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "td", 4);
    i0.ɵɵpipe(1, "generic");
    i0.ɵɵlistener("remove", function TableRowComponent_For_4_Conditional_0_Template_td_remove_0_listener() { i0.ɵɵrestoreView(_r6); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.rowRemoved.emit()); })("selectedChange", function TableRowComponent_For_4_Conditional_0_Template_td_selectedChange_0_listener($event) { i0.ɵɵrestoreView(_r6); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.selectedChange.emit($event)); })("dataChange", function TableRowComponent_For_4_Conditional_0_Template_td_dataChange_0_listener($event) { i0.ɵɵrestoreView(_r6); const column_r7 = i0.ɵɵnextContext().$implicit; const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.onDataChange($event, column_r7.key)); });
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r7 = i0.ɵɵnextContext();
    const column_r7 = ctx_r7.$implicit;
    const ɵ$index_14_r9 = ctx_r7.$index;
    const ɵ$count_14_r10 = ctx_r7.$count;
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵclassMap(ctx_r1.columnsData[ɵ$index_14_r9] == null ? null : ctx_r1.columnsData[ɵ$index_14_r9].classes);
    i0.ɵɵstyleProp("width", ctx_r1.columnsData[ɵ$index_14_r9] == null ? null : ctx_r1.columnsData[ɵ$index_14_r9].width)("right", column_r7.stickyRightMargin);
    i0.ɵɵclassProp("cell-tooltip", ctx_r1.columnsData[ɵ$index_14_r9] == null ? null : ctx_r1.columnsData[ɵ$index_14_r9].hasTooltip)("after-sticky", ctx_r1.hasAfterSticky)("inner-row", ctx_r1.isInnerRow)("fu-editable-cell", ctx_r1.tableService.isTypeInputEdit(column_r7))("is-checkbox-holder", ctx_r1.tableService.isTypeCheckbox(column_r7))("sticky-right", column_r7.stickyRight)("fu-sticky-actions", ɵ$index_14_r9 === ɵ$count_14_r10 - 1 && (ctx_r1.options == null ? null : ctx_r1.options.rowActionsMenu == null ? null : ctx_r1.options.rowActionsMenu.stickyActionButton));
    i0.ɵɵproperty("fusionTooltip", ctx_r1.columnsData[ɵ$index_14_r9] == null ? null : ctx_r1.columnsData[ɵ$index_14_r9].tooltip)("data", ctx_r1.row[column_r7.key])("row", ctx_r1.row)("rowIndex", ctx_r1.rowIndex)("rowSpanIndex", ctx_r1.rowSpanIndex)("column", column_r7)("options", ctx_r1.options)("position", i0.ɵɵpureFunction2(41, _c1, ctx_r1.rowIndex, ɵ$index_14_r9))("isRemove", ctx_r1.columnsData[ɵ$index_14_r9] == null ? null : ctx_r1.columnsData[ɵ$index_14_r9].isRemove)("infoIconTooltip", ctx_r1.columnsData[ɵ$index_14_r9] == null ? null : ctx_r1.columnsData[ɵ$index_14_r9].infoIconOnHoverTooltip)("isRowSelected", ctx_r1.isRowSelected)("isLastColumn", ɵ$index_14_r9 === ɵ$count_14_r10 - 1)("isReadOnly", ctx_r1.isRowReadOnly)("customClass", ctx_r1.row["customClass"])("ngStyle", ctx_r1.columnsData[ɵ$index_14_r9] == null ? null : ctx_r1.columnsData[ɵ$index_14_r9].styles);
    i0.ɵɵattribute("colspan", ctx_r1.columnsData[ɵ$index_14_r9] == null ? null : ctx_r1.columnsData[ɵ$index_14_r9].colspan)("data-testid", i0.ɵɵpipeBind3(1, 37, ctx_r1.testIdsService.getTestAttribute.bind(ctx_r1), ctx_r1.testId, ctx_r1.tableTestIdModifiers.CELL + "-r" + ctx_r1.rowIndex + "-c" + ɵ$index_14_r9));
} }
function TableRowComponent_For_4_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵtemplate(0, TableRowComponent_For_4_Conditional_0_Template, 2, 44, "td", 3);
    i0.ɵɵpipe(1, "generic");
} if (rf & 2) {
    const column_r7 = ctx.$implicit;
    const ctx_r1 = i0.ɵɵnextContext();
    i0.ɵɵconditional(i0.ɵɵpipeBind2(1, 1, ctx_r1.cellShown, column_r7.key) ? 0 : -1);
} }
export class TableRowComponent {
    get isRowExpanded() {
        return this.isExpanded;
    }
    get isInnerRowExpandable() {
        return (this.options &&
            this.options.rowsExpandableOptions &&
            this.tableService.expandLevels &&
            this.tableService.getExpandLevelByRowIndex(this.rowIndex) <= this.tableService.expandLevels);
    }
    get isRowTotal() {
        return !isNullOrUndefined(this.options.hasTotalsRow) && this.options.hasTotalsRow && this.rowIndex === 0;
    }
    get isRowReadOnly() {
        return this.tableService.isRowReadOnly(this.row);
    }
    get expandCellCount() {
        if (!!this.options && !!this.options.rowsExpandableOptions && !!this.tableService.expandLevels) {
            const expandLevelsByIndex = this.tableService.getExpandLevelByRowIndex(this.rowIndex);
            const expandLevels = expandLevelsByIndex <= this.tableService.expandLevels ? expandLevelsByIndex : this.tableService.expandLevels;
            return of([...Array(expandLevels).keys()]);
        }
        return of([]);
    }
    hasTooltip(key, row) {
        return !isNullOrUndefined(this.getCellTooltip(key, row));
    }
    getCellTooltip(key, row) {
        // eslint-disable-next-line
        const rowMetaData = row['rowMetaData'];
        return !!rowMetaData && !!rowMetaData.cellToolTip ? rowMetaData.cellToolTip[key] : null;
    }
    infoIconOnHooverToolTip(options, row) {
        return options?.infoIconForRowOnHover ? options?.infoIconForRowOnHover(row) : '';
    }
    rowRemoveIconOptions(options, row) {
        return {
            hideRemoveIcon: options?.remove && options?.isRemoveIconHiddenForRow && options?.isRemoveIconHiddenForRow(row)
        };
    }
    constructor(tableService, cdRef, injector) {
        this.tableService = tableService;
        this.cdRef = cdRef;
        this.injector = injector;
        this.rowRemoved = new EventEmitter();
        this.selectedChange = new EventEmitter();
        this.expandRow = new EventEmitter();
        this.columnsData = [];
        this.cellShown = this.showCell.bind(this);
        /** @internal */
        this.tableTestIdModifiers = TableTestIdModifiers;
        /** @internal */
        this.testIdsService = this.injector.get(TestIdsService);
    }
    ngOnInit() {
        this.dataRowIndex = this.rowIndex;
        this.expandArrowIconName = 'ph/caret-right';
        this.collapseArrowIconName = 'ph/caret-down';
        if (this.isRowTotal) {
            Object.assign(this.row, { isRowTotal: true });
        }
    }
    ngOnChanges({ options, columns, row }) {
        const activeOptions = options?.currentValue || this.options;
        const activeColumns = columns?.currentValue || this.columns;
        const activeRow = row?.currentValue || this.row;
        if (options?.currentValue || columns?.currentValue || row?.currentValue) {
            this.columnsData = this.getColumnsData(activeColumns, activeOptions, activeRow);
        }
    }
    onDataChange(options, rowKey) {
        this.tableService.toggleRowInRequest(this.row, true);
        this.tableService.rowModelChange.emit({
            rowIndex: this.rowIndex,
            rowSpanIndex: this.rowSpanIndex ?? 0,
            rowModel: this.row,
            keyChanged: rowKey,
            newValue: options.newValue,
            prevValue: options.prevValue,
            onRequestDone: (state, error, stayInEditOnCancel = false) => {
                this.tableService.toggleRowInRequest(this.row, false);
                if (options.onCellRequestDone) {
                    options.onCellRequestDone(state, error, stayInEditOnCancel);
                }
                this.cdRef.markForCheck();
            }
        });
    }
    trackByFn(index, item) {
        if (!item) {
            return null;
        }
        return item.key ? item.key : index;
    }
    showExpandIcon() {
        const hasKeyToIgnore = this.options && this.options.rowsExpandableOptions && this.options.rowsExpandableOptions.keyToIgnore;
        if (!hasKeyToIgnore) {
            return this.isInnerRow ? this.isInnerRowExpandable : !this.isRowTotal;
        }
        return !this.isRowTotal && !this.row[this.options.rowsExpandableOptions.keyToIgnore] && this.isInnerRowExpandable;
    }
    getCellColspan(isFirstDataCell, cellColspan, expandLevel) {
        if (isFirstDataCell && expandLevel) {
            if (this.isInnerRow) {
                const colspan = !isNullOrUndefined(cellColspan) ? cellColspan : 0;
                return colspan + (expandLevel + 1 - this.tableService.getExpandLevelByRowIndex(this.rowIndex));
            }
            return expandLevel + 1 - this.tableService.getExpandLevelByRowIndex(this.rowIndex);
        }
        return cellColspan;
    }
    getAttrRowspan(columnKey) {
        let rowSpan = 0;
        const maxRowspan = this.tableService.getMaxRowspanInColumn(this.row);
        if (columnKey === 'cell-expand') {
            rowSpan = maxRowspan;
        }
        else {
            const multiRowsKeys = this.tableService.getRowspanColumnsData(this.row);
            if (!isNullOrUndefined(multiRowsKeys) && isNullOrUndefined(this.rowSpanIndex)) {
                rowSpan = maxRowspan - multiRowsKeys[columnKey];
            }
        }
        return rowSpan > 0 ? rowSpan : null;
    }
    /**
     * Show regular cell "isNullOrUndefined(this.rowSpanIndex)"
     * or if cell has rowspan index "!isNullOrUndefined(this.rowSpanIndex)" and key for multirow
     * @internal
     */
    showCell(columnKey) {
        if (columnKey.startsWith('cell-expand')) {
            return isNullOrUndefined(this.rowSpanIndex);
        }
        const multiRowsKeys = this.tableService.getRowspanColumnsData(this.row);
        return isNullOrUndefined(this.rowSpanIndex) || (!isNullOrUndefined(this.rowSpanIndex) && multiRowsKeys[columnKey] !== 0);
    }
    getColumnsData(columns, options, row) {
        return columns.map((column, index) => {
            const isLast = index === columns.length - 1;
            const isFirst = index === 0;
            return {
                classes: this.tableService.getColumnClasses(column),
                tooltip: this.getCellTooltip(column.key, row),
                hasTooltip: this.hasTooltip(column.key, row),
                isRemove: this.tableService.isRemove(isLast, options, this.rowRemoveIconOptions(options, row)),
                infoIconOnHoverTooltip: isLast ? this.infoIconOnHooverToolTip(options, row) : '',
                styles: this.tableService.getColumnStyle(column),
                colspan: this.getCellColspan(isFirst, column.colspan, this.tableService.expandLevels),
                width: this.tableService.setWidth(isLast, column.width)
            };
        });
    }
    static { this.ɵfac = function TableRowComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TableRowComponent)(i0.ɵɵdirectiveInject(i1.TableService), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(i0.Injector)); }; }
    static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: TableRowComponent, selectors: [["", "fusionTableRow", ""]], hostVars: 9, hostBindings: function TableRowComponent_HostBindings(rf, ctx) { if (rf & 2) {
            i0.ɵɵattribute("data-row-idx", ctx.dataRowIndex);
            i0.ɵɵclassProp("is-row-expanded", ctx.isRowExpanded)("is-inner-row-expandable", ctx.isInnerRowExpandable)("is-with-totals", ctx.isRowTotal)("is-row-readonly", ctx.isRowReadOnly);
        } }, inputs: { rowIndex: "rowIndex", rowSpanIndex: "rowSpanIndex", row: "row", options: "options", columns: "columns", isRemovableOnHover: "isRemovableOnHover", isRowSelected: "isRowSelected", isExpanded: "isExpanded", isInnerRow: "isInnerRow", hasAfterSticky: "hasAfterSticky", testId: "testId" }, outputs: { rowRemoved: "rowRemoved", selectedChange: "selectedChange", expandRow: "expandRow" }, standalone: true, features: [i0.ɵɵNgOnChangesFeature, i0.ɵɵStandaloneFeature], attrs: _c0, decls: 5, vars: 2, consts: [[1, "expand-cell", 3, "total-row", "expanded", "inner-row", "sticky-left"], [1, "expand-cell"], [3, "click", "iconName"], ["fusionTableCell", "", 3, "fusionTooltip", "data", "row", "rowIndex", "rowSpanIndex", "column", "options", "position", "isRemove", "infoIconTooltip", "isRowSelected", "isLastColumn", "isReadOnly", "customClass", "class", "cell-tooltip", "after-sticky", "inner-row", "fu-editable-cell", "is-checkbox-holder", "sticky-right", "fu-sticky-actions", "ngStyle", "width", "right"], ["fusionTableCell", "", 3, "remove", "selectedChange", "dataChange", "fusionTooltip", "data", "row", "rowIndex", "rowSpanIndex", "column", "options", "position", "isRemove", "infoIconTooltip", "isRowSelected", "isLastColumn", "isReadOnly", "customClass", "ngStyle"]], template: function TableRowComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵrepeaterCreate(0, TableRowComponent_For_1_Template, 2, 4, null, null, i0.ɵɵrepeaterTrackByIdentity);
            i0.ɵɵpipe(2, "async");
            i0.ɵɵrepeaterCreate(3, TableRowComponent_For_4_Template, 2, 4, null, null, i0.ɵɵrepeaterTrackByIdentity);
        } if (rf & 2) {
            i0.ɵɵrepeater(i0.ɵɵpipeBind1(2, 0, ctx.expandCellCount));
            i0.ɵɵadvance(3);
            i0.ɵɵrepeater(ctx.columns);
        } }, dependencies: [CommonModule, i2.NgStyle, i2.AsyncPipe, GenericPipe, IconModule, TooltipDirective, TableCellComponent, IconButtonComponent], styles: ["@import\"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap\";.font-v4-bold[_ngcontent-%COMP%], .font-v4-tab-label-2[_ngcontent-%COMP%], .font-v4-chart-2[_ngcontent-%COMP%], .font-v4-chart-1[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-weight:700;-webkit-font-smoothing:antialiased}.font-v4-semibold[_ngcontent-%COMP%], .font-v4-chip-label[_ngcontent-%COMP%], .font-v4-table-label[_ngcontent-%COMP%], .font-v4-button[_ngcontent-%COMP%], .font-v4-heading-6[_ngcontent-%COMP%], .font-v4-heading-5[_ngcontent-%COMP%], .font-v4-heading-4[_ngcontent-%COMP%], .font-v4-heading-3[_ngcontent-%COMP%], .font-v4-heading-2[_ngcontent-%COMP%], .font-v4-heading-1[_ngcontent-%COMP%], .font-v4-title[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-weight:600;-webkit-font-smoothing:antialiased}.font-v4-medium[_ngcontent-%COMP%], .font-v4-tab-label-1[_ngcontent-%COMP%], .font-v4-input-label[_ngcontent-%COMP%], .font-v4-overline[_ngcontent-%COMP%], .font-v4-subtitle-2[_ngcontent-%COMP%], .font-v4-subtitle-1[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-weight:500;-webkit-font-smoothing:antialiased}.font-v4-regular[_ngcontent-%COMP%], .font-v4-caption[_ngcontent-%COMP%], .font-v4-body-2[_ngcontent-%COMP%], .font-v4-body-1[_ngcontent-%COMP%]{font-family:Inter,sans-serif;font-weight:400;-webkit-font-smoothing:antialiased}.font-v4-title[_ngcontent-%COMP%]{font-size:2.5rem;line-height:3rem;letter-spacing:-.055rem}.font-v4-heading-1[_ngcontent-%COMP%]{font-size:1.5rem;line-height:1.75rem;letter-spacing:-.0285rem}.font-v4-heading-2[_ngcontent-%COMP%]{font-size:1.125rem;line-height:1.75rem;letter-spacing:-.01575rem}.font-v4-heading-3[_ngcontent-%COMP%]{font-size:1rem;line-height:1.5rem;letter-spacing:-.011rem}.font-v4-heading-4[_ngcontent-%COMP%]{font-size:.875rem;line-height:1rem;letter-spacing:unset}.font-v4-heading-5[_ngcontent-%COMP%]{font-size:.8125rem;line-height:16px;letter-spacing:unset}.font-v4-heading-6[_ngcontent-%COMP%]{font-size:.75rem;line-height:.75rem;letter-spacing:0}.font-v4-body-1[_ngcontent-%COMP%]{font-size:.875rem;line-height:1.25rem;letter-spacing:-.00525rem}.font-v4-body-2[_ngcontent-%COMP%]{font-size:.8125rem;line-height:1.25rem;letter-spacing:-.00244rem}.font-v4-subtitle-1[_ngcontent-%COMP%]{font-size:.875rem;line-height:1.25rem;letter-spacing:-.00525rem}.font-v4-subtitle-2[_ngcontent-%COMP%]{font-size:.8125rem;line-height:1.25rem;letter-spacing:-.00244rem}.font-v4-chart-1[_ngcontent-%COMP%]{font-size:1.5rem;line-height:1.5rem;letter-spacing:-.015rem}.font-v4-chart-2[_ngcontent-%COMP%]{font-size:1.25rem;line-height:1.25rem;letter-spacing:-.0125rem}.font-v4-button[_ngcontent-%COMP%]{font-size:.875rem;line-height:1.25rem;letter-spacing:.00875rem}.font-v4-overline[_ngcontent-%COMP%]{font-size:.75rem;line-height:1rem;letter-spacing:.045rem;text-transform:uppercase}.font-v4-caption[_ngcontent-%COMP%]{font-size:.75rem;line-height:1rem}.font-v4-table-label[_ngcontent-%COMP%]{font-size:.8125rem;line-height:1.25rem;letter-spacing:.00813rem}.font-v4-input-label[_ngcontent-%COMP%]{font-size:.8125rem;line-height:1rem;letter-spacing:.00813rem}.font-v4-tab-label-1[_ngcontent-%COMP%], .font-v4-tab-label-2[_ngcontent-%COMP%]{font-size:.875rem;line-height:1rem}.font-v4-chip-label[_ngcontent-%COMP%]{font-size:.75rem;line-height:1rem;letter-spacing:normal}@keyframes _ngcontent-%COMP%_rotation{0%{transform:rotate(0)}to{transform:rotate(359deg)}}@keyframes _ngcontent-%COMP%_shineAnimation{0%{background-position:-750px 0}to{background-position:750px 0}}[_nghost-%COMP%]:nth-child(odd){background-color:var(--table-odd-row-background-color)}[_nghost-%COMP%]:nth-child(2n){background-color:var(--table-even-row-background-color)}[_nghost-%COMP%]   td.expand-cell[_ngcontent-%COMP%]{width:var(--table-expand-cell-width);border-bottom:var(--table-border);vertical-align:middle}[_nghost-%COMP%]   td.expand-cell[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{padding-right:4px;display:flex;align-items:center;justify-content:flex-end;width:var(--table-expand-cell-width)}[_nghost-%COMP%]:last-of-type   td[_ngcontent-%COMP%], [_nghost-%COMP%]:last-of-type   td.expand-cell[_ngcontent-%COMP%]{border-bottom:none}"], changeDetection: 0 }); }
}
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TableRowComponent, [{
        type: Component,
        args: [{ selector: '[fusionTableRow]', standalone: true, imports: [CommonModule, GenericPipe, IconModule, TooltipDirective, TableCellComponent, IconButtonComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- region Expand rows Cell -->\n@for (expandCell of (expandCellCount | async); track expandCell; let isLast = $last, idx = $index){\n    @if(cellShown | generic:'cell-expand'){\n        <td class=\"expand-cell\"\n            [class.total-row]=\"isRowTotal\"\n            [class.expanded]=\"isExpanded\"\n            [class.inner-row]=\"isInnerRow\"\n            [class.sticky-left]=\"options?.rowsExpandableOptions?.sticky\"\n            [attr.data-testid]=\"testIdsService.getTestAttribute.bind(this) | generic:testId:(tableTestIdModifiers.CELL+'-r'+rowIndex+'-c'+idx)\"\n        >\n            @if(isLast && showExpandIcon()){\n                <div><fusion-icon-button\n                        [iconName]=\"!isExpanded ? expandArrowIconName : collapseArrowIconName\"\n                        [attr.data-testid]=\"testIdsService.getTestAttribute.bind(this) | generic:testId:(tableTestIdModifiers.EXPAND_ICON_BUTTON+'-r'+rowIndex+'-c'+idx)\"\n                        (click)=\"expandRow.emit({rowIndex: rowIndex, row: row, isExpanded: !isExpanded})\"\n                ></fusion-icon-button></div>\n            }\n        </td>\n    }\n}\n<!-- endregion Expand Cell -->\n@for (column of columns; track column; let columnIndex = $index, isLast = $last){\n    @if (cellShown | generic:column.key){\n        <td fusionTableCell\n            [fusionTooltip]=\"columnsData[columnIndex]?.tooltip\"\n            [data]=\"row[column.key]\"\n            [row]=\"row\"\n            [rowIndex]=\"rowIndex\"\n            [rowSpanIndex]=\"rowSpanIndex\"\n            [column]=\"column\"\n            [options]=\"options\"\n            [position]=\"{x: rowIndex, y: columnIndex}\"\n            [isRemove]=\"columnsData[columnIndex]?.isRemove\"\n            [infoIconTooltip]=\"columnsData[columnIndex]?.infoIconOnHoverTooltip\"\n            [isRowSelected]=\"isRowSelected\"\n            [isLastColumn]=\"isLast\"\n            [isReadOnly]=\"isRowReadOnly\"\n            [customClass]=\"row['customClass']\"\n            [class]=\"columnsData[columnIndex]?.classes\"\n            [class.cell-tooltip]=\"columnsData[columnIndex]?.hasTooltip\"\n            [class.after-sticky]=\"hasAfterSticky\"\n            [class.inner-row]=\"isInnerRow\"\n            [class.fu-editable-cell]=\"tableService.isTypeInputEdit(column)\"\n            [class.is-checkbox-holder]=\"tableService.isTypeCheckbox(column)\"\n            [class.sticky-right]=\"column.stickyRight\"\n            [class.fu-sticky-actions]=\"isLast && options?.rowActionsMenu?.stickyActionButton\"\n            [ngStyle]=\"columnsData[columnIndex]?.styles\"\n            [style.width]=\"columnsData[columnIndex]?.width\"\n            [style.right]=\"column.stickyRightMargin\"\n            [attr.colspan]=\"columnsData[columnIndex]?.colspan\"\n            [attr.data-testid]=\"testIdsService.getTestAttribute.bind(this) | generic:testId:(tableTestIdModifiers.CELL+'-r'+rowIndex+'-c'+columnIndex)\"\n            (remove)=\"rowRemoved.emit()\"\n            (selectedChange)=\"selectedChange.emit($event)\"\n            (dataChange)=\"onDataChange($event, column.key)\"\n        ></td>\n    }\n}\n\n", styles: ["@import\"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap\";.font-v4-bold,.font-v4-tab-label-2,.font-v4-chart-2,.font-v4-chart-1{font-family:Inter,sans-serif;font-weight:700;-webkit-font-smoothing:antialiased}.font-v4-semibold,.font-v4-chip-label,.font-v4-table-label,.font-v4-button,.font-v4-heading-6,.font-v4-heading-5,.font-v4-heading-4,.font-v4-heading-3,.font-v4-heading-2,.font-v4-heading-1,.font-v4-title{font-family:Inter,sans-serif;font-weight:600;-webkit-font-smoothing:antialiased}.font-v4-medium,.font-v4-tab-label-1,.font-v4-input-label,.font-v4-overline,.font-v4-subtitle-2,.font-v4-subtitle-1{font-family:Inter,sans-serif;font-weight:500;-webkit-font-smoothing:antialiased}.font-v4-regular,.font-v4-caption,.font-v4-body-2,.font-v4-body-1{font-family:Inter,sans-serif;font-weight:400;-webkit-font-smoothing:antialiased}.font-v4-title{font-size:2.5rem;line-height:3rem;letter-spacing:-.055rem}.font-v4-heading-1{font-size:1.5rem;line-height:1.75rem;letter-spacing:-.0285rem}.font-v4-heading-2{font-size:1.125rem;line-height:1.75rem;letter-spacing:-.01575rem}.font-v4-heading-3{font-size:1rem;line-height:1.5rem;letter-spacing:-.011rem}.font-v4-heading-4{font-size:.875rem;line-height:1rem;letter-spacing:unset}.font-v4-heading-5{font-size:.8125rem;line-height:16px;letter-spacing:unset}.font-v4-heading-6{font-size:.75rem;line-height:.75rem;letter-spacing:0}.font-v4-body-1{font-size:.875rem;line-height:1.25rem;letter-spacing:-.00525rem}.font-v4-body-2{font-size:.8125rem;line-height:1.25rem;letter-spacing:-.00244rem}.font-v4-subtitle-1{font-size:.875rem;line-height:1.25rem;letter-spacing:-.00525rem}.font-v4-subtitle-2{font-size:.8125rem;line-height:1.25rem;letter-spacing:-.00244rem}.font-v4-chart-1{font-size:1.5rem;line-height:1.5rem;letter-spacing:-.015rem}.font-v4-chart-2{font-size:1.25rem;line-height:1.25rem;letter-spacing:-.0125rem}.font-v4-button{font-size:.875rem;line-height:1.25rem;letter-spacing:.00875rem}.font-v4-overline{font-size:.75rem;line-height:1rem;letter-spacing:.045rem;text-transform:uppercase}.font-v4-caption{font-size:.75rem;line-height:1rem}.font-v4-table-label{font-size:.8125rem;line-height:1.25rem;letter-spacing:.00813rem}.font-v4-input-label{font-size:.8125rem;line-height:1rem;letter-spacing:.00813rem}.font-v4-tab-label-1,.font-v4-tab-label-2{font-size:.875rem;line-height:1rem}.font-v4-chip-label{font-size:.75rem;line-height:1rem;letter-spacing:normal}@keyframes rotation{0%{transform:rotate(0)}to{transform:rotate(359deg)}}@keyframes shineAnimation{0%{background-position:-750px 0}to{background-position:750px 0}}:host:nth-child(odd){background-color:var(--table-odd-row-background-color)}:host:nth-child(2n){background-color:var(--table-even-row-background-color)}:host td.expand-cell{width:var(--table-expand-cell-width);border-bottom:var(--table-border);vertical-align:middle}:host td.expand-cell>div{padding-right:4px;display:flex;align-items:center;justify-content:flex-end;width:var(--table-expand-cell-width)}:host:last-of-type td,:host:last-of-type td.expand-cell{border-bottom:none}\n"] }]
    }], () => [{ type: i1.TableService }, { type: i0.ChangeDetectorRef }, { type: i0.Injector }], { rowIndex: [{
            type: Input
        }], rowSpanIndex: [{
            type: Input
        }], row: [{
            type: Input
        }], options: [{
            type: Input
        }], columns: [{
            type: Input
        }], isRemovableOnHover: [{
            type: Input
        }], isRowSelected: [{
            type: Input
        }], isExpanded: [{
            type: Input
        }], isInnerRow: [{
            type: Input
        }], hasAfterSticky: [{
            type: Input
        }], testId: [{
            type: Input
        }], rowRemoved: [{
            type: Output
        }], selectedChange: [{
            type: Output
        }], expandRow: [{
            type: Output
        }], dataRowIndex: [{
            type: HostBinding,
            args: ['attr.data-row-idx']
        }], isRowExpanded: [{
            type: HostBinding,
            args: ['class.is-row-expanded']
        }], isInnerRowExpandable: [{
            type: HostBinding,
            args: ['class.is-inner-row-expandable']
        }], isRowTotal: [{
            type: HostBinding,
            args: ['class.is-with-totals']
        }], isRowReadOnly: [{
            type: HostBinding,
            args: ['class.is-row-readonly']
        }] }); })();
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(TableRowComponent, { className: "TableRowComponent", filePath: "components/table-row/table-row.component.ts", lineNumber: 37 }); })();
//# sourceMappingURL=data:application/json;base64, 