/**
 * @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, ChangeDetectorRef, Component, EventEmitter, Input, Output, ViewEncapsulation } from '@angular/core';
import { NzDropdownMenuComponent } from 'ng-zorro-antd/dropdown';
import * as i0 from "@angular/core";
import * as i1 from "ng-zorro-antd/dropdown";
var _c0 = ["*"];
var NzFilterTriggerComponent = /** @class */ (function () {
    function NzFilterTriggerComponent(cdr) {
        this.cdr = cdr;
        this.nzActive = false;
        this.nzVisible = false;
        this.nzVisibleChange = new EventEmitter();
    }
    NzFilterTriggerComponent.prototype.onVisibleChange = function (visible) {
        this.nzVisible = visible;
        this.nzVisibleChange.next(visible);
    };
    NzFilterTriggerComponent.prototype.onFilterClick = function ($event) {
        $event.stopPropagation();
    };
    NzFilterTriggerComponent.prototype.hide = function () {
        this.nzVisible = false;
        this.cdr.markForCheck();
    };
    NzFilterTriggerComponent.prototype.show = function () {
        this.nzVisible = true;
        this.cdr.markForCheck();
    };
    /** @nocollapse */ NzFilterTriggerComponent.ɵfac = function NzFilterTriggerComponent_Factory(t) { return new (t || NzFilterTriggerComponent)(i0.ɵɵdirectiveInject(i0.ChangeDetectorRef)); };
    /** @nocollapse */ NzFilterTriggerComponent.ɵcmp = i0.ɵɵdefineComponent({ type: NzFilterTriggerComponent, selectors: [["nz-filter-trigger"]], hostVars: 4, hostBindings: function NzFilterTriggerComponent_HostBindings(rf, ctx) { if (rf & 2) {
            i0.ɵɵclassProp("ant-table-filter-trigger-container", true)("ant-table-filter-trigger-container-open", ctx.nzVisible);
        } }, inputs: { nzActive: "nzActive", nzDropdownMenu: "nzDropdownMenu", nzVisible: "nzVisible" }, outputs: { nzVisibleChange: "nzVisibleChange" }, exportAs: ["nzFilterTrigger"], ngContentSelectors: _c0, decls: 2, vars: 7, consts: [["nz-dropdown", "", "nzTrigger", "click", "nzPlacement", "bottomRight", 1, "ant-table-filter-trigger", 3, "nzClickHide", "nzDropdownMenu", "nzVisible", "nzVisibleChange", "click"]], template: function NzFilterTriggerComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵprojectionDef();
            i0.ɵɵelementStart(0, "span", 0);
            i0.ɵɵlistener("nzVisibleChange", function NzFilterTriggerComponent_Template_span_nzVisibleChange_0_listener($event) { return ctx.onVisibleChange($event); })("click", function NzFilterTriggerComponent_Template_span_click_0_listener($event) { return ctx.onFilterClick($event); });
            i0.ɵɵprojection(1);
            i0.ɵɵelementEnd();
        } if (rf & 2) {
            i0.ɵɵclassProp("active", ctx.nzActive)("ant-table-filter-open", ctx.nzVisible);
            i0.ɵɵproperty("nzClickHide", false)("nzDropdownMenu", ctx.nzDropdownMenu)("nzVisible", ctx.nzVisible);
        } }, directives: [i1.NzDropDownDirective], encapsulation: 2, changeDetection: 0 });
    return NzFilterTriggerComponent;
}());
export { NzFilterTriggerComponent };
/*@__PURE__*/ (function () { i0.ɵsetClassMetadata(NzFilterTriggerComponent, [{
        type: Component,
        args: [{
                selector: 'nz-filter-trigger',
                exportAs: "nzFilterTrigger",
                changeDetection: ChangeDetectionStrategy.OnPush,
                preserveWhitespaces: false,
                encapsulation: ViewEncapsulation.None,
                template: "\n    <span\n      nz-dropdown\n      class=\"ant-table-filter-trigger\"\n      nzTrigger=\"click\"\n      nzPlacement=\"bottomRight\"\n      [nzClickHide]=\"false\"\n      [nzDropdownMenu]=\"nzDropdownMenu\"\n      [class.active]=\"nzActive\"\n      [class.ant-table-filter-open]=\"nzVisible\"\n      [nzVisible]=\"nzVisible\"\n      (nzVisibleChange)=\"onVisibleChange($event)\"\n      (click)=\"onFilterClick($event)\"\n    >\n      <ng-content></ng-content>\n    </span>\n  ",
                host: {
                    '[class.ant-table-filter-trigger-container]': 'true',
                    '[class.ant-table-filter-trigger-container-open]': 'nzVisible'
                }
            }]
    }], function () { return [{ type: i0.ChangeDetectorRef }]; }, { nzActive: [{
            type: Input
        }], nzDropdownMenu: [{
            type: Input
        }], nzVisible: [{
            type: Input
        }], nzVisibleChange: [{
            type: Output
        }] }); })();
//# sourceMappingURL=data:application/json;base64, 