/**
 * @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, Input, ViewEncapsulation } from '@angular/core';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
import * as i2 from "ng-zorro-antd/icon";
function NzTableSortersComponent_ng_template_1_Template(rf, ctx) { }
function NzTableSortersComponent_i_4_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "i", 5);
} if (rf & 2) {
    var ctx_r2967 = i0.ɵɵnextContext();
    i0.ɵɵclassProp("active", ctx_r2967.sortOrder == "ascend");
} }
function NzTableSortersComponent_i_5_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelement(0, "i", 6);
} if (rf & 2) {
    var ctx_r2968 = i0.ɵɵnextContext();
    i0.ɵɵclassProp("active", ctx_r2968.sortOrder == "descend");
} }
var NzTableSortersComponent = /** @class */ (function () {
    function NzTableSortersComponent() {
        this.sortDirections = ['ascend', 'descend', null];
        this.sortOrder = null;
        this.contentTemplate = null;
        this.showSorterUp = false;
        this.showSorterDown = false;
    }
    NzTableSortersComponent.prototype.ngOnChanges = function (changes) {
        var sortDirections = changes.sortDirections;
        if (sortDirections) {
            this.showSorterUp = this.sortDirections.indexOf('ascend') !== -1;
            this.showSorterDown = this.sortDirections.indexOf('descend') !== -1;
        }
    };
    /** @nocollapse */ NzTableSortersComponent.ɵfac = function NzTableSortersComponent_Factory(t) { return new (t || NzTableSortersComponent)(); };
    /** @nocollapse */ NzTableSortersComponent.ɵcmp = i0.ɵɵdefineComponent({ type: NzTableSortersComponent, selectors: [["nz-table-sorters"]], hostVars: 2, hostBindings: function NzTableSortersComponent_HostBindings(rf, ctx) { if (rf & 2) {
            i0.ɵɵclassProp("ant-table-column-sorters", true);
        } }, inputs: { sortDirections: "sortDirections", sortOrder: "sortOrder", contentTemplate: "contentTemplate" }, features: [i0.ɵɵNgOnChangesFeature], decls: 6, vars: 5, consts: [[3, "ngTemplateOutlet"], [1, "ant-table-column-sorter"], [1, "ant-table-column-sorter-inner"], ["nz-icon", "", "nzType", "caret-up", "class", "ant-table-column-sorter-up", 3, "active", 4, "ngIf"], ["nz-icon", "", "nzType", "caret-down", "class", "ant-table-column-sorter-down", 3, "active", 4, "ngIf"], ["nz-icon", "", "nzType", "caret-up", 1, "ant-table-column-sorter-up"], ["nz-icon", "", "nzType", "caret-down", 1, "ant-table-column-sorter-down"]], template: function NzTableSortersComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "span");
            i0.ɵɵtemplate(1, NzTableSortersComponent_ng_template_1_Template, 0, 0, "ng-template", 0);
            i0.ɵɵelementEnd();
            i0.ɵɵelementStart(2, "span", 1);
            i0.ɵɵelementStart(3, "span", 2);
            i0.ɵɵtemplate(4, NzTableSortersComponent_i_4_Template, 1, 2, "i", 3);
            i0.ɵɵtemplate(5, NzTableSortersComponent_i_5_Template, 1, 2, "i", 4);
            i0.ɵɵelementEnd();
            i0.ɵɵelementEnd();
        } if (rf & 2) {
            i0.ɵɵadvance(1);
            i0.ɵɵproperty("ngTemplateOutlet", ctx.contentTemplate);
            i0.ɵɵadvance(1);
            i0.ɵɵclassProp("ant-table-column-sorter-full", ctx.showSorterDown && ctx.showSorterUp);
            i0.ɵɵadvance(2);
            i0.ɵɵproperty("ngIf", ctx.showSorterUp);
            i0.ɵɵadvance(1);
            i0.ɵɵproperty("ngIf", ctx.showSorterDown);
        } }, directives: [i1.NgTemplateOutlet, i1.NgIf, i2.NzIconDirective], encapsulation: 2, changeDetection: 0 });
    return NzTableSortersComponent;
}());
export { NzTableSortersComponent };
/*@__PURE__*/ (function () { i0.ɵsetClassMetadata(NzTableSortersComponent, [{
        type: Component,
        args: [{
                selector: 'nz-table-sorters',
                preserveWhitespaces: false,
                changeDetection: ChangeDetectionStrategy.OnPush,
                encapsulation: ViewEncapsulation.None,
                template: "\n    <span><ng-template [ngTemplateOutlet]=\"contentTemplate\"></ng-template></span>\n    <span class=\"ant-table-column-sorter\" [class.ant-table-column-sorter-full]=\"showSorterDown && showSorterUp\">\n      <span class=\"ant-table-column-sorter-inner\">\n        <i nz-icon nzType=\"caret-up\" *ngIf=\"showSorterUp\" class=\"ant-table-column-sorter-up\" [class.active]=\"sortOrder == 'ascend'\"></i>\n        <i\n          nz-icon\n          nzType=\"caret-down\"\n          *ngIf=\"showSorterDown\"\n          class=\"ant-table-column-sorter-down\"\n          [class.active]=\"sortOrder == 'descend'\"\n        ></i>\n      </span>\n    </span>\n  ",
                host: {
                    '[class.ant-table-column-sorters]': 'true'
                }
            }]
    }], null, { sortDirections: [{
            type: Input
        }], sortOrder: [{
            type: Input
        }], contentTemplate: [{
            type: Input
        }] }); })();
//# sourceMappingURL=data:application/json;base64, 