/**
 * @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 { Directive, EventEmitter, Input, Output } from '@angular/core';
import * as i0 from "@angular/core";
var NzRowExpandButtonDirective = /** @class */ (function () {
    function NzRowExpandButtonDirective() {
        this.expand = false;
        this.spaceMode = false;
        this.expandChange = new EventEmitter();
    }
    NzRowExpandButtonDirective.prototype.onHostClick = function () {
        if (!this.spaceMode) {
            this.expand = !this.expand;
            this.expandChange.next(this.expand);
        }
    };
    /** @nocollapse */ NzRowExpandButtonDirective.ɵfac = function NzRowExpandButtonDirective_Factory(t) { return new (t || NzRowExpandButtonDirective)(); };
    /** @nocollapse */ NzRowExpandButtonDirective.ɵdir = i0.ɵɵdefineDirective({ type: NzRowExpandButtonDirective, selectors: [["button", "nz-row-expand-button", ""]], hostVars: 9, hostBindings: function NzRowExpandButtonDirective_HostBindings(rf, ctx) { if (rf & 1) {
            i0.ɵɵlistener("click", function NzRowExpandButtonDirective_click_HostBindingHandler() { return ctx.onHostClick(); });
        } if (rf & 2) {
            i0.ɵɵhostProperty("type", "button");
            i0.ɵɵclassProp("ant-table-row-expand-icon", true)("ant-table-row-expand-icon-expanded", !ctx.spaceMode && ctx.expand === true)("ant-table-row-expand-icon-collapsed", !ctx.spaceMode && ctx.expand === false)("ant-table-row-expand-icon-spaced", ctx.spaceMode);
        } }, inputs: { expand: "expand", spaceMode: "spaceMode" }, outputs: { expandChange: "expandChange" } });
    return NzRowExpandButtonDirective;
}());
export { NzRowExpandButtonDirective };
/*@__PURE__*/ (function () { i0.ɵsetClassMetadata(NzRowExpandButtonDirective, [{
        type: Directive,
        args: [{
                selector: 'button[nz-row-expand-button]',
                host: {
                    '[type]': "'button'",
                    '[class.ant-table-row-expand-icon]': 'true',
                    '[class.ant-table-row-expand-icon-expanded]': "!spaceMode && expand === true",
                    '[class.ant-table-row-expand-icon-collapsed]': "!spaceMode && expand === false",
                    '[class.ant-table-row-expand-icon-spaced]': 'spaceMode',
                    '(click)': 'onHostClick()'
                }
            }]
    }], null, { expand: [{
            type: Input
        }], spaceMode: [{
            type: Input
        }], expandChange: [{
            type: Output
        }] }); })();
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicm93LWV4cGFuZC1idXR0b24uZGlyZWN0aXZlLmpzIiwic291cmNlUm9vdCI6Im5nOi8vbmctem9ycm8tYW50ZC90YWJsZS8iLCJzb3VyY2VzIjpbInNyYy9hZGRvbi9yb3ctZXhwYW5kLWJ1dHRvbi5kaXJlY3RpdmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HO0FBRUgsT0FBTyxFQUFFLFNBQVMsRUFBRSxZQUFZLEVBQUUsS0FBSyxFQUFFLE1BQU0sRUFBRSxNQUFNLGVBQWUsQ0FBQzs7QUFFdkU7SUFBQTtRQVlXLFdBQU0sR0FBRyxLQUFLLENBQUM7UUFDZixjQUFTLEdBQUcsS0FBSyxDQUFDO1FBQ1IsaUJBQVksR0FBRyxJQUFJLFlBQVksRUFBRSxDQUFDO0tBT3REO0lBTkMsZ0RBQVcsR0FBWDtRQUNFLElBQUksQ0FBQyxJQUFJLENBQUMsU0FBUyxFQUFFO1lBQ25CLElBQUksQ0FBQyxNQUFNLEdBQUcsQ0FBQyxJQUFJLENBQUMsTUFBTSxDQUFDO1lBQzNCLElBQUksQ0FBQyxZQUFZLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxNQUFNLENBQUMsQ0FBQztTQUNyQztJQUNILENBQUM7d0dBVFUsMEJBQTBCO21FQUExQiwwQkFBMEI7Ozs7OztxQ0FyQnZDO0NBK0JDLEFBckJELElBcUJDO1NBVlksMEJBQTBCO2tEQUExQiwwQkFBMEI7Y0FYdEMsU0FBUztlQUFDO2dCQUNULFFBQVEsRUFBRSw4QkFBOEI7Z0JBQ3hDLElBQUks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