/**
 * @license
 * Copyright Alibaba.com All Rights Reserved.
 *
 * Use of this source code is governed by an MIT-style license that can be
 * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
 */
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output, ViewEncapsulation } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "ng-zorro-antd/checkbox";
import * as i3 from "@angular/forms";
import * as i4 from "ng-zorro-antd/dropdown";
import * as i5 from "ng-zorro-antd/icon";
import * as i6 from "ng-zorro-antd/menu";
function NzTableSelectionComponent_label_0_Template(rf, ctx) { if (rf & 1) {
    const _r2859 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "label", 2);
    i0.ɵɵlistener("ngModelChange", function NzTableSelectionComponent_label_0_Template_label_ngModelChange_0_listener($event) { i0.ɵɵrestoreView(_r2859); const ctx_r2858 = i0.ɵɵnextContext(); return ctx_r2858.onCheckedChange($event); });
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r2856 = i0.ɵɵnextContext();
    i0.ɵɵclassProp("ant-table-selection-select-all-custom", ctx_r2856.showRowSelection);
    i0.ɵɵproperty("ngModel", ctx_r2856.checked)("nzDisabled", ctx_r2856.disabled)("nzIndeterminate", ctx_r2856.indeterminate);
} }
function NzTableSelectionComponent_div_1_li_6_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "li", 9);
    i0.ɵɵlistener("click", function NzTableSelectionComponent_div_1_li_6_Template_li_click_0_listener() { const selection_r2862 = ctx.$implicit; return selection_r2862.onSelect(); });
    i0.ɵɵtext(1);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const selection_r2862 = ctx.$implicit;
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate1(" ", selection_r2862.text, " ");
} }
function NzTableSelectionComponent_div_1_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementStart(0, "div", 3);
    i0.ɵɵelementStart(1, "span", 4);
    i0.ɵɵelement(2, "i", 5);
    i0.ɵɵelementEnd();
    i0.ɵɵelementStart(3, "nz-dropdown-menu", null, 6);
    i0.ɵɵelementStart(5, "ul", 7);
    i0.ɵɵtemplate(6, NzTableSelectionComponent_div_1_li_6_Template, 2, 1, "li", 8);
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const _r2860 = i0.ɵɵreference(4);
    const ctx_r2857 = i0.ɵɵnextContext();
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("nzDropdownMenu", _r2860);
    i0.ɵɵadvance(5);
    i0.ɵɵproperty("ngForOf", ctx_r2857.listOfSelections);
} }
export class NzTableSelectionComponent {
    constructor() {
        this.listOfSelections = [];
        this.checked = false;
        this.disabled = false;
        this.indeterminate = false;
        this.showCheckbox = false;
        this.showRowSelection = false;
        this.checkedChange = new EventEmitter();
    }
    onCheckedChange(checked) {
        this.checked = checked;
        this.checkedChange.emit(checked);
    }
}
/** @nocollapse */ NzTableSelectionComponent.ɵfac = function NzTableSelectionComponent_Factory(t) { return new (t || NzTableSelectionComponent)(); };
/** @nocollapse */ NzTableSelectionComponent.ɵcmp = i0.ɵɵdefineComponent({ type: NzTableSelectionComponent, selectors: [["nz-table-selection"]], hostVars: 2, hostBindings: function NzTableSelectionComponent_HostBindings(rf, ctx) { if (rf & 2) {
        i0.ɵɵclassProp("ant-table-selection", true);
    } }, inputs: { listOfSelections: "listOfSelections", checked: "checked", disabled: "disabled", indeterminate: "indeterminate", showCheckbox: "showCheckbox", showRowSelection: "showRowSelection" }, outputs: { checkedChange: "checkedChange" }, decls: 2, vars: 2, consts: [["nz-checkbox", "", 3, "ant-table-selection-select-all-custom", "ngModel", "nzDisabled", "nzIndeterminate", "ngModelChange", 4, "ngIf"], ["class", "ant-table-selection-extra", 4, "ngIf"], ["nz-checkbox", "", 3, "ngModel", "nzDisabled", "nzIndeterminate", "ngModelChange"], [1, "ant-table-selection-extra"], ["nz-dropdown", "", "nzPlacement", "bottomLeft", 1, "ant-table-selection-down", 3, "nzDropdownMenu"], ["nz-icon", "", "nzType", "down"], ["selectionMenu", "nzDropdownMenu"], ["nz-menu", "", 1, "ant-table-selection-menu"], ["nz-menu-item", "", 3, "click", 4, "ngFor", "ngForOf"], ["nz-menu-item", "", 3, "click"]], template: function NzTableSelectionComponent_Template(rf, ctx) { if (rf & 1) {
        i0.ɵɵtemplate(0, NzTableSelectionComponent_label_0_Template, 1, 5, "label", 0);
        i0.ɵɵtemplate(1, NzTableSelectionComponent_div_1_Template, 7, 2, "div", 1);
    } if (rf & 2) {
        i0.ɵɵproperty("ngIf", ctx.showCheckbox);
        i0.ɵɵadvance(1);
        i0.ɵɵproperty("ngIf", ctx.showRowSelection);
    } }, directives: [i1.NgIf, i2.NzCheckboxComponent, i3.NgControlStatus, i3.NgModel, i4.NzDropDownDirective, i5.NzIconDirective, i4.NzDropdownMenuComponent, i6.NzMenuDirective, i1.NgForOf, i6.NzMenuItemDirective], encapsulation: 2, changeDetection: 0 });
/*@__PURE__*/ (function () { i0.ɵsetClassMetadata(NzTableSelectionComponent, [{
        type: Component,
        args: [{
                selector: 'nz-table-selection',
                preserveWhitespaces: false,
                changeDetection: ChangeDetectionStrategy.OnPush,
                encapsulation: ViewEncapsulation.None,
                template: `
    <label
      *ngIf="showCheckbox"
      nz-checkbox
      [class.ant-table-selection-select-all-custom]="showRowSelection"
      [ngModel]="checked"
      [nzDisabled]="disabled"
      [nzIndeterminate]="indeterminate"
      (ngModelChange)="onCheckedChange($event)"
    >
    </label>
    <div class="ant-table-selection-extra" *ngIf="showRowSelection">
      <span nz-dropdown class="ant-table-selection-down" nzPlacement="bottomLeft" [nzDropdownMenu]="selectionMenu">
        <i nz-icon nzType="down"></i>
      </span>
      <nz-dropdown-menu #selectionMenu="nzDropdownMenu">
        <ul nz-menu class="ant-table-selection-menu">
          <li nz-menu-item *ngFor="let selection of listOfSelections" (click)="selection.onSelect()">
            {{ selection.text }}
          </li>
        </ul>
      </nz-dropdown-menu>
    </div>
  `,
                host: {
                    '[class.ant-table-selection]': 'true'
                }
            }]
    }], null, { listOfSelections: [{
            type: Input
        }], checked: [{
            type: Input
        }], disabled: [{
            type: Input
        }], indeterminate: [{
            type: Input
        }], showCheckbox: [{
            type: Input
        }], showRowSelection: [{
            type: Input
        }], checkedChange: [{
            type: Output
        }] }); })();
//# sourceMappingURL=data:application/json;base64, 