/**
 *
 * @ai-apps/angular v2.147.1-next.0 | sterling-table-head-cell.component.js
 *
 * Copyright 2014, 2022 IBM
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0

 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */


import { Component, ViewEncapsulation } from '@angular/core';
import { TableHeadCell } from 'carbon-components-angular';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "carbon-components-angular";
const _c0 = ["scTableHeadCell", ""];
function SCTableHeadCell_ng_container_0_button_1_span_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 12);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r5 = i0.ɵɵnextContext(3);
    i0.ɵɵproperty("title", ctx_r5.column.data);
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate1(" ", ctx_r5.column.data, " ");
} }
function SCTableHeadCell_ng_container_0_button_1_ng_template_3_Template(rf, ctx) { }
const _c1 = function (a0, a1) { return { "bx--table-sort--active": a0, "bx--table-sort--ascending": a1 }; };
const _c2 = function (a0) { return { data: a0 }; };
function SCTableHeadCell_ng_container_0_button_1_Template(rf, ctx) { if (rf & 1) {
    const _r8 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "button", 4);
    i0.ɵɵlistener("click", function SCTableHeadCell_ng_container_0_button_1_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r8); const ctx_r7 = i0.ɵɵnextContext(2); return ctx_r7.onClick(); });
    i0.ɵɵpipe(1, "async");
    i0.ɵɵtemplate(2, SCTableHeadCell_ng_container_0_button_1_span_2_Template, 2, 2, "span", 5);
    i0.ɵɵtemplate(3, SCTableHeadCell_ng_container_0_button_1_ng_template_3_Template, 0, 0, "ng-template", 6);
    i0.ɵɵelementStart(4, "span", 7);
    i0.ɵɵnamespaceSVG();
    i0.ɵɵelementStart(5, "svg", 8);
    i0.ɵɵelement(6, "path", 9);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(7, "svg", 10);
    i0.ɵɵelement(8, "path", 11);
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r2 = i0.ɵɵnextContext(2);
    i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction2(7, _c1, ctx_r2.column.sorted, ctx_r2.column.ascending));
    i0.ɵɵattribute("aria-label", i0.ɵɵpipeBind1(1, 5, ctx_r2.column.sorted && ctx_r2.column.ascending ? ctx_r2.getSortDescendingLabel() : ctx_r2.getSortAscendingLabel()));
    i0.ɵɵadvance(2);
    i0.ɵɵproperty("ngIf", !ctx_r2.column.template);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngTemplateOutlet", ctx_r2.column.template)("ngTemplateOutletContext", i0.ɵɵpureFunction1(10, _c2, ctx_r2.column.data));
} }
function SCTableHeadCell_ng_container_0_span_2_span_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 15);
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r9 = i0.ɵɵnextContext(3);
    i0.ɵɵproperty("title", ctx_r9.column.data);
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate(ctx_r9.column.data);
} }
function SCTableHeadCell_ng_container_0_span_2_ng_template_2_Template(rf, ctx) { }
function SCTableHeadCell_ng_container_0_span_2_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "span", 13);
    i0.ɵɵtemplate(1, SCTableHeadCell_ng_container_0_span_2_span_1_Template, 2, 2, "span", 14);
    i0.ɵɵtemplate(2, SCTableHeadCell_ng_container_0_span_2_ng_template_2_Template, 0, 0, "ng-template", 6);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r3 = i0.ɵɵnextContext(2);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", !ctx_r3.column.template);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngTemplateOutlet", ctx_r3.column.template)("ngTemplateOutletContext", i0.ɵɵpureFunction1(3, _c2, ctx_r3.column.data));
} }
function SCTableHeadCell_ng_container_0_button_3_span_4_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵnamespaceSVG();
    i0.ɵɵnamespaceHTML();
    i0.ɵɵelementStart(0, "span");
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r11 = i0.ɵɵnextContext(3);
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate1(" ", ctx_r11.column.filterCount, " ");
} }
const _c3 = function (a0) { return { active: a0 }; };
function SCTableHeadCell_ng_container_0_button_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "button", 16);
    i0.ɵɵpipe(1, "async");
    i0.ɵɵnamespaceSVG();
    i0.ɵɵelementStart(2, "svg", 17);
    i0.ɵɵelement(3, "path", 18);
    i0.ɵɵelementEnd();
    i0.ɵɵtemplate(4, SCTableHeadCell_ng_container_0_button_3_span_4_Template, 2, 1, "span", 0);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r4 = i0.ɵɵnextContext(2);
    i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(7, _c3, ctx_r4.column.filterCount > 0))("ibmTooltip", ctx_r4.column.filterTemplate)("title", i0.ɵɵpipeBind1(1, 5, ctx_r4.getFilterTitle()))("data", ctx_r4.column.filterData);
    i0.ɵɵadvance(4);
    i0.ɵɵproperty("ngIf", ctx_r4.column.filterCount > 0);
} }
function SCTableHeadCell_ng_container_0_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵtemplate(1, SCTableHeadCell_ng_container_0_button_1_Template, 9, 12, "button", 1);
    i0.ɵɵtemplate(2, SCTableHeadCell_ng_container_0_span_2_Template, 3, 5, "span", 2);
    i0.ɵɵtemplate(3, SCTableHeadCell_ng_container_0_button_3_Template, 5, 9, "button", 3);
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", ctx_r0.sort.observers.length > 0 && ctx_r0.column.sortable);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", ctx_r0.sort.observers.length === 0 || ctx_r0.sort.observers.length > 0 && !ctx_r0.column.sortable);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("ngIf", ctx_r0.column.filterTemplate);
} }
function SCTableHeadCell_ng_container_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelementStart(1, "button", 19);
    i0.ɵɵelement(2, "span", 20);
    i0.ɵɵelementEnd();
    i0.ɵɵelementContainerEnd();
} }
export class SCTableHeadCell extends TableHeadCell {
}
SCTableHeadCell.ɵfac = function SCTableHeadCell_Factory(t) { return ɵSCTableHeadCell_BaseFactory(t || SCTableHeadCell); };
SCTableHeadCell.ɵcmp = i0.ɵɵdefineComponent({ type: SCTableHeadCell, selectors: [["", "scTableHeadCell", ""]], features: [i0.ɵɵInheritDefinitionFeature], attrs: _c0, decls: 2, vars: 2, consts: [[4, "ngIf"], ["class", "bx--table-sort", "aria-live", "polite", 3, "ngClass", "click", 4, "ngIf"], ["class", "bx--table-header-label", 4, "ngIf"], ["type", "button", "aria-expanded", "false", "aria-haspopup", "true", "trigger", "click", "placement", "bottom,top", 3, "ngClass", "ibmTooltip", "title", "data", 4, "ngIf"], ["aria-live", "polite", 1, "bx--table-sort", 3, "ngClass", "click"], ["class", "table-head-cell-text", "tabindex", "-1", 3, "title", 4, "ngIf"], [3, "ngTemplateOutlet", "ngTemplateOutletContext"], [1, "table-head-cell-icons"], ["focusable", "false", "preserveAspectRatio", "xMidYMid meet", "xmlns", "http://www.w3.org/2000/svg", "width", "16", "height", "16", "viewBox", "0 0 16 16", "aria-hidden", "true", 1, "bx--table-sort__icon", 2, "will-change", "transform"], ["d", "M12.3 9.3l-3.8 3.8V1h-1v12.1L3.7 9.3 3 10l5 5 5-5z"], ["focusable", "false", "preserveAspectRatio", "xMidYMid meet", "xmlns", "http://www.w3.org/2000/svg", "width", "16", "height", "16", "viewBox", "0 0 16 16", "aria-hidden", "true", 1, "bx--table-sort__icon-unsorted", 2, "will-change", "transform"], ["d", "M13.8 10.3L12 12.1V2h-1v10.1l-1.8-1.8-.7.7 3 3 3-3zM4.5 2l-3 3 .7.7L4 3.9V14h1V3.9l1.8 1.8.7-.7z"], ["tabindex", "-1", 1, "table-head-cell-text", 3, "title"], [1, "bx--table-header-label"], [3, "title", 4, "ngIf"], [3, "title"], ["type", "button", "aria-expanded", "false", "aria-haspopup", "true", "trigger", "click", "placement", "bottom,top", 3, "ngClass", "ibmTooltip", "title", "data"], ["xmlns", "http://www.w3.org/2000/svg", "width", "16", "height", "16", "viewBox", "0 0 16 16", 1, "icon--sm"], ["d", "M0 0v3l6 8v5h4v-5l6-8V0H0zm9 10.7V15H7v-4.3L1.3 3h13.5L9 10.7z"], [1, "bx--table-sort"], ["tabindex", "-1", 1, "table-head-cell-text"]], template: function SCTableHeadCell_Template(rf, ctx) { if (rf & 1) {
        i0.ɵɵtemplate(0, SCTableHeadCell_ng_container_0_Template, 4, 3, "ng-container", 0);
        i0.ɵɵtemplate(1, SCTableHeadCell_ng_container_1_Template, 3, 0, "ng-container", 0);
    } if (rf & 2) {
        i0.ɵɵproperty("ngIf", !ctx.skeleton);
        i0.ɵɵadvance(1);
        i0.ɵɵproperty("ngIf", ctx.skeleton);
    } }, directives: [i1.NgIf, i1.NgClass, i1.NgTemplateOutlet, i2.TooltipDirective], pipes: [i1.AsyncPipe], styles: [".table-head-cell-icons,.table-head-cell-text{top:0}.bx--data-table--compact .table-head-cell-icons,.bx--data-table--compact .table-head-cell-text{line-height:24px}.bx--data-table--short .table-head-cell-icons,.bx--data-table--short .table-head-cell-text{line-height:32px}.bx--data-table--tall .table-head-cell-icons,.bx--data-table--tall .table-head-cell-text{line-height:64px}.table-head-cell-icons{margin-right:10px;right:0}.bx--table-sort.bx--table-sort--active .bx--table-sort__icon{top:16px}.sc-table .bx--table-header-label,.sc-table .table-head-cell-text{padding-left:16px}"], encapsulation: 2 });
const ɵSCTableHeadCell_BaseFactory = /*@__PURE__*/ i0.ɵɵgetInheritedFactory(SCTableHeadCell);
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SCTableHeadCell, [{
        type: Component,
        args: [{
                // tslint:disable-next-line: component-selector
                selector: '[scTableHeadCell]',
                template: `
    <ng-container *ngIf="!skeleton">
      <button
        class="bx--table-sort"
        *ngIf="this.sort.observers.length > 0 && column.sortable"
        [attr.aria-label]="
          (column.sorted && column.ascending ? getSortDescendingLabel() : getSortAscendingLabel())
            | async
        "
        aria-live="polite"
        [ngClass]="{
          'bx--table-sort--active': column.sorted,
          'bx--table-sort--ascending': column.ascending
        }"
        (click)="onClick()"
      >
        <span
          *ngIf="!column.template"
          class="table-head-cell-text"
          [title]="column.data"
          tabindex="-1"
        >
          {{ column.data }}
        </span>
        <ng-template
          [ngTemplateOutlet]="column.template"
          [ngTemplateOutletContext]="{ data: column.data }"
        >
        </ng-template>
        <span class="table-head-cell-icons">
          <svg
            focusable="false"
            preserveAspectRatio="xMidYMid meet"
            style="will-change: transform;"
            xmlns="http://www.w3.org/2000/svg"
            class="bx--table-sort__icon"
            width="16"
            height="16"
            viewBox="0 0 16 16"
            aria-hidden="true"
          >
            <path d="M12.3 9.3l-3.8 3.8V1h-1v12.1L3.7 9.3 3 10l5 5 5-5z"></path>
          </svg>
          <svg
            focusable="false"
            preserveAspectRatio="xMidYMid meet"
            style="will-change: transform;"
            xmlns="http://www.w3.org/2000/svg"
            class="bx--table-sort__icon-unsorted"
            width="16"
            height="16"
            viewBox="0 0 16 16"
            aria-hidden="true"
          >
            <path
              d="M13.8 10.3L12 12.1V2h-1v10.1l-1.8-1.8-.7.7 3 3 3-3zM4.5 2l-3 3 .7.7L4 3.9V14h1V3.9l1.8 1.8.7-.7z"
            ></path>
          </svg>
        </span>
      </button>
      <span
        class="bx--table-header-label"
        *ngIf="
          this.sort.observers.length === 0 || (this.sort.observers.length > 0 && !column.sortable)
        "
      >
        <span *ngIf="!column.template" [title]="column.data">{{ column.data }}</span>
        <ng-template
          [ngTemplateOutlet]="column.template"
          [ngTemplateOutletContext]="{ data: column.data }"
        >
        </ng-template>
      </span>
      <button
        [ngClass]="{ active: column.filterCount > 0 }"
        *ngIf="column.filterTemplate"
        type="button"
        aria-expanded="false"
        aria-haspopup="true"
        [ibmTooltip]="column.filterTemplate"
        trigger="click"
        [title]="getFilterTitle() | async"
        placement="bottom,top"
        [data]="column.filterData"
      >
        <svg
          xmlns="http://www.w3.org/2000/svg"
          class="icon--sm"
          width="16"
          height="16"
          viewBox="0 0 16 16"
        >
          <path d="M0 0v3l6 8v5h4v-5l6-8V0H0zm9 10.7V15H7v-4.3L1.3 3h13.5L9 10.7z" />
        </svg>
        <span *ngIf="column.filterCount > 0">
          {{ column.filterCount }}
        </span>
      </button>
    </ng-container>
    <ng-container *ngIf="skeleton">
      <button class="bx--table-sort">
        <span class="table-head-cell-text" tabindex="-1"></span>
      </button>
    </ng-container>
  `,
                styleUrls: ['./sterling-table-head-cell.scss'],
                encapsulation: ViewEncapsulation.None,
            }]
    }], null, null); })();
//# sourceMappingURL=data:application/json;base64, 