/**
 *
 * @ai-apps/angular v2.147.1-next.0 | sterling-table.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 { Table } from 'carbon-components-angular';
import * as i0 from "@angular/core";
import * as i1 from "carbon-components-angular";
import * as i2 from "@angular/common";
import * as i3 from "./head/sterling-table-head.component";
const _c0 = function () { return { "overflow-y": "scroll" }; };
function SCTableComponent_tbody_2_Template(rf, ctx) { if (rf & 1) {
    const _r7 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "tbody", 6);
    i0.ɵɵlistener("deselectRow", function SCTableComponent_tbody_2_Template_tbody_deselectRow_0_listener($event) { i0.ɵɵrestoreView(_r7); const ctx_r6 = i0.ɵɵnextContext(); return ctx_r6.onSelectRow($event); })("rowClick", function SCTableComponent_tbody_2_Template_tbody_rowClick_0_listener($event) { i0.ɵɵrestoreView(_r7); const ctx_r8 = i0.ɵɵnextContext(); return ctx_r8.onRowClick($event); })("scroll", function SCTableComponent_tbody_2_Template_tbody_scroll_0_listener($event) { i0.ɵɵrestoreView(_r7); const ctx_r9 = i0.ɵɵnextContext(); return ctx_r9.onScroll($event); })("selectRow", function SCTableComponent_tbody_2_Template_tbody_selectRow_0_listener($event) { i0.ɵɵrestoreView(_r7); const ctx_r10 = i0.ɵɵnextContext(); return ctx_r10.onSelectRow($event); });
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r0 = i0.ɵɵnextContext();
    i0.ɵɵproperty("checkboxRowLabel", ctx_r0.getCheckboxRowLabel())("enableSingleSelect", ctx_r0.enableSingleSelect)("expandButtonAriaLabel", ctx_r0.expandButtonAriaLabel)("model", ctx_r0.model)("size", ctx_r0.size)("ngStyle", i0.ɵɵpureFunction0(9, _c0))("selectionLabelColumn", ctx_r0.selectionLabelColumn)("showSelectionColumn", ctx_r0.showSelectionColumn)("skeleton", ctx_r0.skeleton);
} }
function SCTableComponent_ng_template_3_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵprojection(0);
} }
function SCTableComponent_ng_template_6_Template(rf, ctx) { }
function SCTableComponent_tr_7_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "tr");
    i0.ɵɵelementStart(1, "td", 7);
    i0.ɵɵelementStart(2, "div", 8);
    i0.ɵɵnamespaceSVG();
    i0.ɵɵelementStart(3, "svg", 9);
    i0.ɵɵelement(4, "circle", 10);
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
} }
function SCTableComponent_tr_8_Template(rf, ctx) { if (rf & 1) {
    const _r12 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "tr");
    i0.ɵɵelementStart(1, "td", 11);
    i0.ɵɵelementStart(2, "h5");
    i0.ɵɵtext(3);
    i0.ɵɵpipe(4, "async");
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(5, "button", 12);
    i0.ɵɵlistener("click", function SCTableComponent_tr_8_Template_button_click_5_listener($event) { i0.ɵɵrestoreView(_r12); const ctx_r11 = i0.ɵɵnextContext(); return ctx_r11.scrollToTop($event); });
    i0.ɵɵtext(6);
    i0.ɵɵpipe(7, "async");
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r5 = i0.ɵɵnextContext();
    i0.ɵɵadvance(3);
    i0.ɵɵtextInterpolate(i0.ɵɵpipeBind1(4, 2, ctx_r5.getEndOfDataText()));
    i0.ɵɵadvance(3);
    i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(7, 4, ctx_r5.getScrollTopText()), " ");
} }
const _c1 = function (a0) { return { "bx--data-table--sticky-header": a0 }; };
const _c2 = ["*"];
/**
 * Sterling specific table component
 *
 * **Warning:** This component will be deprecated in the future in favour of a spec compliant ai-table component
 *
 * Example:
 * ```
 * <sc-table></sc-table>
 * ```
 */
export class SCTableComponent extends Table {
}
SCTableComponent.ɵfac = function SCTableComponent_Factory(t) { return ɵSCTableComponent_BaseFactory(t || SCTableComponent); };
SCTableComponent.ɵcmp = i0.ɵɵdefineComponent({ type: SCTableComponent, selectors: [["sc-table"]], features: [i0.ɵɵInheritDefinitionFeature], ngContentSelectors: _c2, decls: 9, vars: 23, consts: [["ibmTable", "", 1, "sc-table", 3, "sortable", "size", "striped", "skeleton", "ngClass"], ["scTableHead", "", 3, "checkboxHeaderLabel", "filterTitle", "model", "size", "selectAllCheckbox", "selectAllCheckboxSomeSelected", "showSelectionColumn", "skeleton", "sortAscendingLabel", "sortDescendingLabel", "stickyHeader", "deselectAll", "selectAll", "sort"], ["ibmTableBody", "", 3, "checkboxRowLabel", "enableSingleSelect", "expandButtonAriaLabel", "model", "size", "ngStyle", "selectionLabelColumn", "showSelectionColumn", "skeleton", "deselectRow", "rowClick", "scroll", "selectRow", 4, "ngIf", "ngIfElse"], ["noDataTemplate", ""], [3, "ngTemplateOutlet"], [4, "ngIf"], ["ibmTableBody", "", 3, "checkboxRowLabel", "enableSingleSelect", "expandButtonAriaLabel", "model", "size", "ngStyle", "selectionLabelColumn", "showSelectionColumn", "skeleton", "deselectRow", "rowClick", "scroll", "selectRow"], [1, "table_loading-indicator"], [1, "bx--loading", "bx--loading--small"], ["viewBox", "-75 -75 150 150", 1, "bx--loading__svg"], ["cx", "0", "cy", "0", "r", "37.5", 1, "bx--loading__stroke"], [1, "table_end-indicator"], [1, "btn--secondary-sm", 3, "click"]], template: function SCTableComponent_Template(rf, ctx) { if (rf & 1) {
        i0.ɵɵprojectionDef();
        i0.ɵɵelementStart(0, "table", 0);
        i0.ɵɵelementStart(1, "thead", 1);
        i0.ɵɵlistener("deselectAll", function SCTableComponent_Template_thead_deselectAll_1_listener() { return ctx.onDeselectAll(); })("selectAll", function SCTableComponent_Template_thead_selectAll_1_listener() { return ctx.onSelectAll(); })("sort", function SCTableComponent_Template_thead_sort_1_listener($event) { return ctx.sort.emit($event); });
        i0.ɵɵelementEnd();
        i0.ɵɵtemplate(2, SCTableComponent_tbody_2_Template, 1, 10, "tbody", 2);
        i0.ɵɵtemplate(3, SCTableComponent_ng_template_3_Template, 1, 0, "ng-template", null, 3, i0.ɵɵtemplateRefExtractor);
        i0.ɵɵelementStart(5, "tfoot");
        i0.ɵɵtemplate(6, SCTableComponent_ng_template_6_Template, 0, 0, "ng-template", 4);
        i0.ɵɵtemplate(7, SCTableComponent_tr_7_Template, 5, 0, "tr", 5);
        i0.ɵɵtemplate(8, SCTableComponent_tr_8_Template, 8, 6, "tr", 5);
        i0.ɵɵelementEnd();
        i0.ɵɵelementEnd();
    } if (rf & 2) {
        const _r1 = i0.ɵɵreference(4);
        i0.ɵɵproperty("sortable", true)("size", ctx.size)("striped", ctx.striped)("skeleton", ctx.skeleton)("ngClass", i0.ɵɵpureFunction1(21, _c1, ctx.stickyHeader));
        i0.ɵɵadvance(1);
        i0.ɵɵproperty("checkboxHeaderLabel", ctx.getCheckboxHeaderLabel())("filterTitle", ctx.getFilterTitle())("model", ctx.model)("size", ctx.size)("selectAllCheckbox", ctx.selectAllCheckbox)("selectAllCheckboxSomeSelected", ctx.selectAllCheckboxSomeSelected)("showSelectionColumn", ctx.showSelectionColumn)("skeleton", ctx.skeleton)("sortAscendingLabel", ctx.sortAscendingLabel)("sortDescendingLabel", ctx.sortDescendingLabel)("stickyHeader", ctx.stickyHeader);
        i0.ɵɵadvance(1);
        i0.ɵɵproperty("ngIf", !ctx.noData)("ngIfElse", _r1);
        i0.ɵɵadvance(4);
        i0.ɵɵproperty("ngTemplateOutlet", ctx.footerTemplate);
        i0.ɵɵadvance(1);
        i0.ɵɵproperty("ngIf", ctx.model.isLoading);
        i0.ɵɵadvance(1);
        i0.ɵɵproperty("ngIf", ctx.model.isEnd);
    } }, directives: [i1.TableDirective, i2.NgClass, i3.SCTableHeadComponent, i2.NgIf, i2.NgTemplateOutlet, i1.TableBody, i2.NgStyle], pipes: [i2.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}.table-row:not(:first-of-type){border-top:2px solid #fff}th:not(:last-of-type){border-right:2px solid #fff}th:not(:last-of-type).table-selection-column{border-right:none}.sc-table.bx--data-table--sort th:first-of-type .bx--table-sort,.sc-table .bx--table-sort{padding-left:0}.sc-table.bx--data-table th:last-of-type{position:inherit}"], encapsulation: 2 });
const ɵSCTableComponent_BaseFactory = /*@__PURE__*/ i0.ɵɵgetInheritedFactory(SCTableComponent);
(function () { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(SCTableComponent, [{
        type: Component,
        args: [{
                selector: 'sc-table',
                template: `
    <table
      ibmTable
      [sortable]="true"
      [size]="size"
      [striped]="striped"
      [skeleton]="skeleton"
      [ngClass]="{ 'bx--data-table--sticky-header': stickyHeader }"
      class="sc-table"
    >
      <thead
        scTableHead
        (deselectAll)="onDeselectAll()"
        (selectAll)="onSelectAll()"
        (sort)="sort.emit($event)"
        [checkboxHeaderLabel]="getCheckboxHeaderLabel()"
        [filterTitle]="getFilterTitle()"
        [model]="model"
        [size]="size"
        [selectAllCheckbox]="selectAllCheckbox"
        [selectAllCheckboxSomeSelected]="selectAllCheckboxSomeSelected"
        [showSelectionColumn]="showSelectionColumn"
        [skeleton]="skeleton"
        [sortAscendingLabel]="sortAscendingLabel"
        [sortDescendingLabel]="sortDescendingLabel"
        [stickyHeader]="stickyHeader"
      ></thead>
      <tbody
        ibmTableBody
        (deselectRow)="onSelectRow($event)"
        (rowClick)="onRowClick($event)"
        (scroll)="onScroll($event)"
        (selectRow)="onSelectRow($event)"
        [checkboxRowLabel]="getCheckboxRowLabel()"
        [enableSingleSelect]="enableSingleSelect"
        [expandButtonAriaLabel]="expandButtonAriaLabel"
        [model]="model"
        [size]="size"
        [ngStyle]="{ 'overflow-y': 'scroll' }"
        [selectionLabelColumn]="selectionLabelColumn"
        [showSelectionColumn]="showSelectionColumn"
        [skeleton]="skeleton"
        *ngIf="!noData; else noDataTemplate"
      ></tbody>
      <ng-template #noDataTemplate><ng-content></ng-content></ng-template>
      <tfoot>
        <ng-template [ngTemplateOutlet]="footerTemplate"> </ng-template>
        <tr *ngIf="this.model.isLoading">
          <td class="table_loading-indicator">
            <div class="bx--loading bx--loading--small">
              <svg class="bx--loading__svg" viewBox="-75 -75 150 150">
                <circle class="bx--loading__stroke" cx="0" cy="0" r="37.5" />
              </svg>
            </div>
          </td>
        </tr>
        <tr *ngIf="this.model.isEnd">
          <td class="table_end-indicator">
            <h5>{{ getEndOfDataText() | async }}</h5>
            <button (click)="scrollToTop($event)" class="btn--secondary-sm">
              {{ getScrollTopText() | async }}
            </button>
          </td>
        </tr>
      </tfoot>
    </table>
  `,
                styleUrls: ['./sterling-table.scss'],
                encapsulation: ViewEncapsulation.None,
            }]
    }], null, null); })();
//# sourceMappingURL=data:application/json;base64, 