import { __decorate, __metadata } from "tslib";
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output, ViewEncapsulation } from '@angular/core';
import { coerceBoolean } from '@angular-ru/cdk/coercion';
import { AttributeBoolean } from '@angular-ru/cdk/decorators';
import { TableContentDirective } from '../../directives/table-content.directive';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "@angular/material/icon";
function NgxHeaderComponent_ng_container_3_Template(rf, ctx) { if (rf & 1) {
    const _r2 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelementStart(1, "div", 3)(2, "mat-icon", 4);
    i0.ɵɵlistener("click", function NgxHeaderComponent_ng_container_3_Template_mat_icon_click_2_listener() { i0.ɵɵrestoreView(_r2); const ctx_r1 = i0.ɵɵnextContext(); return ctx_r1.toggleExpand(); });
    i0.ɵɵtext(3, " keyboard_arrow_down ");
    i0.ɵɵelementEnd()();
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵadvance(2);
    i0.ɵɵclassProp("table-grid__header-sticky--expand-button--expanded", ctx_r0.expanded);
} }
const _c0 = ["*"];
export class NgxHeaderComponent extends TableContentDirective {
    constructor() {
        super(...arguments);
        this.expandedChange = new EventEmitter();
        this.expanded = true;
        this.expandablePanel = false;
        this.hideToggle = false;
    }
    toggleExpand() {
        this.expanded = !coerceBoolean(this.expanded);
        this.expandedChange.emit(this.expanded);
    }
}
/** @nocollapse */ NgxHeaderComponent.ɵfac = /** @pureOrBreakMyCode */ function () { let ɵNgxHeaderComponent_BaseFactory; return function NgxHeaderComponent_Factory(t) { return (ɵNgxHeaderComponent_BaseFactory || (ɵNgxHeaderComponent_BaseFactory = i0.ɵɵgetInheritedFactory(NgxHeaderComponent)))(t || NgxHeaderComponent); }; }();
/** @nocollapse */ NgxHeaderComponent.ɵcmp = /** @pureOrBreakMyCode */ i0.ɵɵdefineComponent({ type: NgxHeaderComponent, selectors: [["ngx-header"]], inputs: { expanded: "expanded", expandablePanel: "expandablePanel", hideToggle: "hideToggle" }, outputs: { expandedChange: "expandedChange" }, features: [i0.ɵɵInheritDefinitionFeature], ngContentSelectors: _c0, decls: 4, vars: 14, consts: [[1, "table-grid__table-content-place"], [3, "ngClass"], [4, "ngIf"], [1, "table-grid__header-sticky--expand-button-wrapper"], [1, "table-grid__header-sticky--expand-button", 3, "click"]], template: function NgxHeaderComponent_Template(rf, ctx) { if (rf & 1) {
        i0.ɵɵprojectionDef();
        i0.ɵɵelementStart(0, "div", 0)(1, "div", 1);
        i0.ɵɵprojection(2);
        i0.ɵɵelementEnd();
        i0.ɵɵtemplate(3, NgxHeaderComponent_ng_container_3_Template, 4, 2, "ng-container", 2);
        i0.ɵɵelementEnd();
    } if (rf & 2) {
        i0.ɵɵstyleProp("height", ctx.height, "px");
        i0.ɵɵclassProp("table-grid__header-expandable", ctx.expandablePanel)("table-grid__table-content-place--content-cell", ctx.contentCell !== null)("table-grid__table-content-place--align-center", ctx.alignCenter !== null)("table-grid__table-content-place--bold", ctx.bold !== null);
        i0.ɵɵadvance(1);
        i0.ɵɵclassProp("content-box", ctx.contentCell !== null);
        i0.ɵɵproperty("ngClass", ctx.cssClasses);
        i0.ɵɵadvance(2);
        i0.ɵɵproperty("ngIf", ctx.expandablePanel && !ctx.hideToggle);
    } }, directives: [i1.NgClass, i1.NgIf, i2.MatIcon], encapsulation: 2, changeDetection: 0 });
__decorate([
    AttributeBoolean(),
    __metadata("design:type", Object)
], NgxHeaderComponent.prototype, "expanded", void 0);
__decorate([
    AttributeBoolean(),
    __metadata("design:type", Object)
], NgxHeaderComponent.prototype, "expandablePanel", void 0);
__decorate([
    AttributeBoolean(),
    __metadata("design:type", Object)
], NgxHeaderComponent.prototype, "hideToggle", void 0);
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(NgxHeaderComponent, [{
        type: Component,
        args: [{ selector: 'ngx-header', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div\n    class=\"table-grid__table-content-place\"\n    [class.table-grid__header-expandable]=\"expandablePanel\"\n    [class.table-grid__table-content-place--content-cell]=\"contentCell !== null\"\n    [class.table-grid__table-content-place--align-center]=\"alignCenter !== null\"\n    [class.table-grid__table-content-place--bold]=\"bold !== null\"\n    [style.height.px]=\"height\"\n>\n    <div\n        [ngClass]=\"cssClasses\"\n        [class.content-box]=\"contentCell !== null\"\n    >\n        <ng-content></ng-content>\n    </div>\n    <ng-container *ngIf=\"expandablePanel && !hideToggle\">\n        <div class=\"table-grid__header-sticky--expand-button-wrapper\">\n            <mat-icon\n                class=\"table-grid__header-sticky--expand-button\"\n                [class.table-grid__header-sticky--expand-button--expanded]=\"expanded\"\n                (click)=\"toggleExpand()\"\n            >\n                keyboard_arrow_down\n            </mat-icon>\n        </div>\n    </ng-container>\n</div>\n" }]
    }], null, { expandedChange: [{
            type: Output
        }], expanded: [{
            type: Input
        }], expandablePanel: [{
            type: Input
        }], hideToggle: [{
            type: Input
        }] }); })();
//# sourceMappingURL=data:application/json;base64, 