import { __decorate, __metadata } from "tslib";
/**
 * @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
 */
/* tslint:disable:component-selector */
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output, ViewEncapsulation } from '@angular/core';
import { InputBoolean } from 'ng-zorro-antd/core';
import * as i0 from "@angular/core";
import * as i1 from "../addon/selection.component";
var _c0 = ["nzSelections", ""];
var _c1 = ["*"];
var NzThSelectionComponent = /** @class */ (function () {
    function NzThSelectionComponent() {
        this.nzSelections = [];
        this.nzChecked = false;
        this.nzDisabled = false;
        this.nzIndeterminate = false;
        this.nzShowCheckbox = false;
        this.nzShowRowSelection = false;
        this.nzCheckedChange = new EventEmitter();
        this.nzSortChangeWithKey = new EventEmitter();
    }
    NzThSelectionComponent.prototype.onCheckedChange = function (checked) {
        this.nzChecked = checked;
        this.nzCheckedChange.emit(checked);
    };
    NzThSelectionComponent.prototype.ngOnChanges = function (changes) {
        var nzChecked = changes.nzChecked, nzSelections = changes.nzSelections;
        var isShowCheckbox = nzChecked && nzChecked.firstChange;
        if (isShowCheckbox) {
            this.nzShowCheckbox = true;
        }
        var isShowSelections = nzSelections && nzSelections.firstChange;
        if (isShowSelections) {
            this.nzShowRowSelection = true;
        }
    };
    /** @nocollapse */ NzThSelectionComponent.ɵfac = function NzThSelectionComponent_Factory(t) { return new (t || NzThSelectionComponent)(); };
    /** @nocollapse */ NzThSelectionComponent.ɵcmp = i0.ɵɵdefineComponent({ type: NzThSelectionComponent, selectors: [["th", "nzSelections", ""], ["th", "nzChecked", ""], ["th", "nzShowCheckbox", ""], ["th", "nzShowRowSelection", ""]], hostVars: 2, hostBindings: function NzThSelectionComponent_HostBindings(rf, ctx) { if (rf & 2) {
            i0.ɵɵclassProp("ant-table-selection-column", true);
        } }, inputs: { nzSelections: "nzSelections", nzChecked: "nzChecked", nzDisabled: "nzDisabled", nzIndeterminate: "nzIndeterminate", nzShowCheckbox: "nzShowCheckbox", nzShowRowSelection: "nzShowRowSelection" }, outputs: { nzCheckedChange: "nzCheckedChange", nzSortChangeWithKey: "nzSortChangeWithKey" }, features: [i0.ɵɵNgOnChangesFeature], attrs: _c0, ngContentSelectors: _c1, decls: 2, vars: 6, consts: [[3, "checked", "disabled", "indeterminate", "listOfSelections", "showCheckbox", "showRowSelection", "checkedChange"]], template: function NzThSelectionComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵprojectionDef();
            i0.ɵɵelementStart(0, "nz-table-selection", 0);
            i0.ɵɵlistener("checkedChange", function NzThSelectionComponent_Template_nz_table_selection_checkedChange_0_listener($event) { return ctx.onCheckedChange($event); });
            i0.ɵɵelementEnd();
            i0.ɵɵprojection(1);
        } if (rf & 2) {
            i0.ɵɵproperty("checked", ctx.nzChecked)("disabled", ctx.nzDisabled)("indeterminate", ctx.nzIndeterminate)("listOfSelections", ctx.nzSelections)("showCheckbox", ctx.nzShowCheckbox)("showRowSelection", ctx.nzShowRowSelection);
        } }, directives: [i1.NzTableSelectionComponent], encapsulation: 2, changeDetection: 0 });
    __decorate([
        InputBoolean(),
        __metadata("design:type", Object)
    ], NzThSelectionComponent.prototype, "nzShowCheckbox", void 0);
    __decorate([
        InputBoolean(),
        __metadata("design:type", Object)
    ], NzThSelectionComponent.prototype, "nzShowRowSelection", void 0);
    return NzThSelectionComponent;
}());
export { NzThSelectionComponent };
/*@__PURE__*/ (function () { i0.ɵsetClassMetadata(NzThSelectionComponent, [{
        type: Component,
        args: [{
                selector: 'th[nzSelections],th[nzChecked],th[nzShowCheckbox],th[nzShowRowSelection]',
                preserveWhitespaces: false,
                encapsulation: ViewEncapsulation.None,
                changeDetection: ChangeDetectionStrategy.OnPush,
                template: "\n    <nz-table-selection\n      [checked]=\"nzChecked\"\n      [disabled]=\"nzDisabled\"\n      [indeterminate]=\"nzIndeterminate\"\n      [listOfSelections]=\"nzSelections\"\n      [showCheckbox]=\"nzShowCheckbox\"\n      [showRowSelection]=\"nzShowRowSelection\"\n      (checkedChange)=\"onCheckedChange($event)\"\n    ></nz-table-selection>\n    <ng-content></ng-content>\n  ",
                host: {
                    '[class.ant-table-selection-column]': 'true'
                }
            }]
    }], null, { nzSelections: [{
            type: Input
        }], nzChecked: [{
            type: Input
        }], nzDisabled: [{
            type: Input
        }], nzIndeterminate: [{
            type: Input
        }], nzShowCheckbox: [{
            type: Input
        }], nzShowRowSelection: [{
            type: Input
        }], nzCheckedChange: [{
            type: Output
        }], nzSortChangeWithKey: [{
            type: Output
        }] }); })();
//# sourceMappingURL=data:application/json;base64, 