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 "@angular/common";
import * as i2 from "../addon/row-indent.directive";
import * as i3 from "../addon/row-expand-button.directive";
import * as i4 from "ng-zorro-antd/checkbox";
import * as i5 from "@angular/forms";
var _c0 = ["nzChecked", ""];
function NzTdAddOnComponent_ng_container_0_Template(rf, ctx) { if (rf & 1) {
    var _r2972 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelement(1, "nz-row-indent", 2);
    i0.ɵɵelementStart(2, "button", 3);
    i0.ɵɵlistener("expandChange", function NzTdAddOnComponent_ng_container_0_Template_button_expandChange_2_listener($event) { i0.ɵɵrestoreView(_r2972); var ctx_r2971 = i0.ɵɵnextContext(); return ctx_r2971.onExpandChange($event); });
    i0.ɵɵelementEnd();
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    var ctx_r2969 = i0.ɵɵnextContext();
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("indentSize", ctx_r2969.nzIndentSize);
    i0.ɵɵadvance(1);
    i0.ɵɵproperty("expand", ctx_r2969.nzExpand)("spaceMode", !ctx_r2969.nzShowExpand);
} }
function NzTdAddOnComponent_label_1_Template(rf, ctx) { if (rf & 1) {
    var _r2974 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "label", 4);
    i0.ɵɵlistener("ngModelChange", function NzTdAddOnComponent_label_1_Template_label_ngModelChange_0_listener($event) { i0.ɵɵrestoreView(_r2974); var ctx_r2973 = i0.ɵɵnextContext(); return ctx_r2973.onCheckedChange($event); });
    i0.ɵɵelementEnd();
} if (rf & 2) {
    var ctx_r2970 = i0.ɵɵnextContext();
    i0.ɵɵproperty("nzDisabled", ctx_r2970.nzDisabled)("ngModel", ctx_r2970.nzChecked)("nzIndeterminate", ctx_r2970.nzIndeterminate);
} }
var _c1 = ["*"];
var NzTdAddOnComponent = /** @class */ (function () {
    function NzTdAddOnComponent() {
        this.nzChecked = false;
        this.nzDisabled = false;
        this.nzIndeterminate = false;
        this.nzIndentSize = 0;
        this.nzShowExpand = false;
        this.nzShowCheckbox = false;
        this.nzExpand = false;
        this.nzCheckedChange = new EventEmitter();
        this.nzExpandChange = new EventEmitter();
    }
    NzTdAddOnComponent.prototype.onCheckedChange = function (checked) {
        this.nzChecked = checked;
        this.nzCheckedChange.emit(checked);
    };
    NzTdAddOnComponent.prototype.onExpandChange = function (expand) {
        this.nzExpand = expand;
        this.nzExpandChange.emit(expand);
    };
    NzTdAddOnComponent.prototype.ngOnChanges = function (changes) {
        var isFirstChange = function (value) { return value && value.firstChange && value.currentValue !== undefined; };
        var nzExpand = changes.nzExpand, nzChecked = changes.nzChecked;
        if (isFirstChange(nzExpand)) {
            this.nzShowExpand = true;
        }
        if (isFirstChange(nzChecked)) {
            this.nzShowCheckbox = true;
        }
    };
    /** @nocollapse */ NzTdAddOnComponent.ɵfac = function NzTdAddOnComponent_Factory(t) { return new (t || NzTdAddOnComponent)(); };
    /** @nocollapse */ NzTdAddOnComponent.ɵcmp = i0.ɵɵdefineComponent({ type: NzTdAddOnComponent, selectors: [["td", "nzChecked", ""], ["td", "nzDisabled", ""], ["td", "nzIndeterminate", ""], ["td", "nzIndentSize", ""], ["td", "nzExpand", ""], ["td", "nzShowExpand", ""], ["td", "nzShowCheckbox", ""]], hostVars: 4, hostBindings: function NzTdAddOnComponent_HostBindings(rf, ctx) { if (rf & 2) {
            i0.ɵɵclassProp("ant-table-cell-with-append", ctx.nzShowExpand || ctx.nzIndentSize > 0)("ant-table-selection-column", ctx.nzShowCheckbox);
        } }, inputs: { nzChecked: "nzChecked", nzDisabled: "nzDisabled", nzIndeterminate: "nzIndeterminate", nzIndentSize: "nzIndentSize", nzShowExpand: "nzShowExpand", nzShowCheckbox: "nzShowCheckbox", nzExpand: "nzExpand" }, outputs: { nzCheckedChange: "nzCheckedChange", nzExpandChange: "nzExpandChange" }, features: [i0.ɵɵNgOnChangesFeature], attrs: _c0, ngContentSelectors: _c1, decls: 3, vars: 2, consts: [[4, "ngIf"], ["nz-checkbox", "", 3, "nzDisabled", "ngModel", "nzIndeterminate", "ngModelChange", 4, "ngIf"], [3, "indentSize"], ["nz-row-expand-button", "", 3, "expand", "spaceMode", "expandChange"], ["nz-checkbox", "", 3, "nzDisabled", "ngModel", "nzIndeterminate", "ngModelChange"]], template: function NzTdAddOnComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵprojectionDef();
            i0.ɵɵtemplate(0, NzTdAddOnComponent_ng_container_0_Template, 3, 3, "ng-container", 0);
            i0.ɵɵtemplate(1, NzTdAddOnComponent_label_1_Template, 1, 3, "label", 1);
            i0.ɵɵprojection(2);
        } if (rf & 2) {
            i0.ɵɵproperty("ngIf", ctx.nzShowExpand || ctx.nzIndentSize > 0);
            i0.ɵɵadvance(1);
            i0.ɵɵproperty("ngIf", ctx.nzShowCheckbox);
        } }, directives: [i1.NgIf, i2.NzRowIndentDirective, i3.NzRowExpandButtonDirective, i4.NzCheckboxComponent, i5.NgControlStatus, i5.NgModel], encapsulation: 2, changeDetection: 0 });
    __decorate([
        InputBoolean(),
        __metadata("design:type", Object)
    ], NzTdAddOnComponent.prototype, "nzShowExpand", void 0);
    __decorate([
        InputBoolean(),
        __metadata("design:type", Object)
    ], NzTdAddOnComponent.prototype, "nzShowCheckbox", void 0);
    __decorate([
        InputBoolean(),
        __metadata("design:type", Object)
    ], NzTdAddOnComponent.prototype, "nzExpand", void 0);
    return NzTdAddOnComponent;
}());
export { NzTdAddOnComponent };
/*@__PURE__*/ (function () { i0.ɵsetClassMetadata(NzTdAddOnComponent, [{
        type: Component,
        args: [{
                selector: 'td[nzChecked], td[nzDisabled], td[nzIndeterminate], td[nzIndentSize], td[nzExpand], td[nzShowExpand], td[nzShowCheckbox]',
                changeDetection: ChangeDetectionStrategy.OnPush,
                preserveWhitespaces: false,
                encapsulation: ViewEncapsulation.None,
                template: "\n    <ng-container *ngIf=\"nzShowExpand || nzIndentSize > 0\">\n      <nz-row-indent [indentSize]=\"nzIndentSize\"></nz-row-indent>\n      <button nz-row-expand-button [expand]=\"nzExpand\" (expandChange)=\"onExpandChange($event)\" [spaceMode]=\"!nzShowExpand\"></button>\n    </ng-container>\n    <label\n      nz-checkbox\n      *ngIf=\"nzShowCheckbox\"\n      [nzDisabled]=\"nzDisabled\"\n      [ngModel]=\"nzChecked\"\n      [nzIndeterminate]=\"nzIndeterminate\"\n      (ngModelChange)=\"onCheckedChange($event)\"\n    >\n    </label>\n    <ng-content></ng-content>\n  ",
                host: {
                    '[class.ant-table-cell-with-append]': "nzShowExpand || nzIndentSize > 0",
                    '[class.ant-table-selection-column]': "nzShowCheckbox"
                }
            }]
    }], null, { nzChecked: [{
            type: Input
        }], nzDisabled: [{
            type: Input
        }], nzIndeterminate: [{
            type: Input
        }], nzIndentSize: [{
            type: Input
        }], nzShowExpand: [{
            type: Input
        }], nzShowCheckbox: [{
            type: Input
        }], nzExpand: [{
            type: Input
        }], nzCheckedChange: [{
            type: Output
        }], nzExpandChange: [{
            type: Output
        }] }); })();
//# sourceMappingURL=data:application/json;base64, 