import { __decorate } from "tslib";
import { Component, Input, ViewChildren, QueryList, HostBinding, ViewChild, ElementRef, ChangeDetectionStrategy, ChangeDetectorRef, DoCheck } from '@angular/core';
import { IgxSummaryCellComponent } from './summary-cell.component';
import { IgxGridForOfDirective } from '../../directives/for-of/for_of.directive';
import { GridBaseAPIService } from '../api.service';
import { IgxForOfSyncService } from '../../directives/for-of/for_of.sync.service';
var IgxSummaryRowComponent = /** @class */ (function () {
    function IgxSummaryRowComponent(gridAPI, element, cdr) {
        this.gridAPI = gridAPI;
        this.element = element;
        this.cdr = cdr;
        this.firstCellIndentation = -1;
    }
    Object.defineProperty(IgxSummaryRowComponent.prototype, "dataRowIndex", {
        get: function () {
            return this.index;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgxSummaryRowComponent.prototype, "minHeight", {
        get: function () {
            return this.grid.summaryService.calcMaxSummaryHeight() - 1;
        },
        enumerable: true,
        configurable: true
    });
    IgxSummaryRowComponent.prototype.ngDoCheck = function () {
        this.cdr.markForCheck();
    };
    Object.defineProperty(IgxSummaryRowComponent.prototype, "grid", {
        get: function () {
            return this.gridAPI.grid;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgxSummaryRowComponent.prototype, "nativeElement", {
        get: function () {
            return this.element.nativeElement;
        },
        enumerable: true,
        configurable: true
    });
    IgxSummaryRowComponent.prototype.getColumnSummaries = function (columnName) {
        if (!this.summaries.get(columnName)) {
            return [];
        }
        return this.summaries.get(columnName);
    };
    Object.defineProperty(IgxSummaryRowComponent.prototype, "pinnedColumns", {
        /**
         * @hidden
         */
        get: function () {
            return this.grid.pinnedColumns;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgxSummaryRowComponent.prototype, "unpinnedColumns", {
        /**
         * @hidden
         */
        get: function () {
            return this.grid.unpinnedColumns;
        },
        enumerable: true,
        configurable: true
    });
    IgxSummaryRowComponent.ctorParameters = function () { return [
        { type: GridBaseAPIService },
        { type: ElementRef },
        { type: ChangeDetectorRef }
    ]; };
    __decorate([
        Input()
    ], IgxSummaryRowComponent.prototype, "summaries", void 0);
    __decorate([
        Input()
    ], IgxSummaryRowComponent.prototype, "gridID", void 0);
    __decorate([
        Input()
    ], IgxSummaryRowComponent.prototype, "index", void 0);
    __decorate([
        Input()
    ], IgxSummaryRowComponent.prototype, "firstCellIndentation", void 0);
    __decorate([
        HostBinding('attr.data-rowIndex')
    ], IgxSummaryRowComponent.prototype, "dataRowIndex", null);
    __decorate([
        ViewChildren(IgxSummaryCellComponent, { read: IgxSummaryCellComponent })
    ], IgxSummaryRowComponent.prototype, "summaryCells", void 0);
    __decorate([
        ViewChild('igxDirRef', { read: IgxGridForOfDirective })
    ], IgxSummaryRowComponent.prototype, "virtDirRow", void 0);
    IgxSummaryRowComponent = __decorate([
        Component({
            changeDetection: ChangeDetectionStrategy.OnPush,
            preserveWhitespaces: false,
            selector: 'igx-grid-summary-row',
            template: "<ng-container *ngIf=\"summaries.size\">\n    <ng-container *ngIf=\"grid.summariesMargin\">\n        <div\n        class=\"igx-grid__summaries-patch\"\n        [style.min-width.px]=\"grid.summariesMargin\"\n        [style.flex-basis.px]=\"grid.summariesMargin\"\n        ></div>\n    </ng-container>\n    <ng-container *ngIf=\"pinnedColumns.length > 0\">\n        <igx-grid-summary-cell *ngFor=\"let col of pinnedColumns | igxNotGrouped\"\n            class=\"igx-grid-summary igx-grid-summary--fw igx-grid-summary--pinned\"\n            [class.igx-grid-summary--cosy]=\"grid.displayDensity === 'cosy'\"\n            [class.igx-grid-summary--compact]=\"grid.displayDensity === 'compact'\"\n            [class.igx-grid-summary--empty]=\"!col.hasSummary\"\n            [class.igx-grid-summary--pinned-last]=\"col.isLastPinned\"\n            [column]=\"col\"\n            [firstCellIndentation]=\"firstCellIndentation\"\n            [rowIndex]=\"index\"\n            [summaryResults]=\"getColumnSummaries(col.field)\"\n            [hasSummary]=\"col.hasSummary\"\n            [density]=\"grid.displayDensity\"\n            [style.max-height.px]=\"minHeight\"\n            [style.min-height.px]=\"minHeight\"\n            [style.min-width]=\"col.getCellWidth()\"\n            [style.max-width]=\"col.getCellWidth()\"\n            [style.flex-basis]=\"col.getCellWidth()\">\n        </igx-grid-summary-cell>\n    </ng-container>\n    <ng-template igxGridFor let-col [igxGridForOf]=\"unpinnedColumns | igxNotGrouped\" [igxForScrollContainer]=\"grid.parentVirtDir\" let-colIndex=\"index\" [igxForScrollOrientation]=\"'horizontal'\" [igxForContainerSize]=\"grid.unpinnedWidth\" [igxForTrackBy]=\"grid.trackColumnChanges\" [igxForSizePropName]='\"calcPixelWidth\"' #igxDirRef>\n        <igx-grid-summary-cell\n            class=\"igx-grid-summary igx-grid-summary--fw\"\n            [class.igx-grid-summary--cosy]=\"grid.displayDensity === 'cosy'\"\n            [class.igx-grid-summary--compact]=\"grid.displayDensity === 'compact'\"\n            [class.igx-grid-summary--empty]=\"!col.hasSummary\"\n            [column]=\"col\"\n            [rowIndex]=\"index\"\n            [firstCellIndentation]=\"firstCellIndentation\"\n            [summaryResults]=\"getColumnSummaries(col.field)\"\n            [hasSummary]=\"col.hasSummary\"\n            [density]=\"grid.displayDensity\"\n            [style.max-height.px]=\"minHeight\"\n            [style.min-height.px]=\"minHeight\"\n            [style.min-width]=\"col.getCellWidth()\"\n            [style.max-width]=\"col.getCellWidth()\"\n            [style.flex-basis]=\"col.getCellWidth()\">\n        </igx-grid-summary-cell>\n    </ng-template>\n</ng-container>\n",
            providers: [IgxForOfSyncService]
        })
    ], IgxSummaryRowComponent);
    return IgxSummaryRowComponent;
}());
export { IgxSummaryRowComponent };
//# sourceMappingURL=data:application/json;base64, 