import { __extends } 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
 */
import { ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/core';
import { AbstractPanelHeader } from './abstract-panel-header';
import * as i0 from "@angular/core";
import * as i1 from "@angular/common";
function YearHeaderComponent_button_1_Template(rf, ctx) { if (rf & 1) {
    var _r1814 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "button", 2);
    i0.ɵɵlistener("click", function YearHeaderComponent_button_1_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r1814); var ctx_r1813 = i0.ɵɵnextContext(); return ctx_r1813.superPrevious(); });
    i0.ɵɵelement(1, "span", 3);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    var ctx_r1808 = i0.ɵɵnextContext();
    i0.ɵɵclassMapInterpolate1("", ctx_r1808.prefixCls, "-super-prev-btn");
    i0.ɵɵpropertyInterpolate("title", ctx_r1808.superPreviousTitle());
} }
function YearHeaderComponent_button_2_Template(rf, ctx) { if (rf & 1) {
    var _r1816 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "button", 2);
    i0.ɵɵlistener("click", function YearHeaderComponent_button_2_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r1816); var ctx_r1815 = i0.ɵɵnextContext(); return ctx_r1815.previous(); });
    i0.ɵɵelement(1, "span", 4);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    var ctx_r1809 = i0.ɵɵnextContext();
    i0.ɵɵclassMapInterpolate1("", ctx_r1809.prefixCls, "-prev-btn");
    i0.ɵɵpropertyInterpolate("title", ctx_r1809.previousTitle());
} }
function YearHeaderComponent_ng_container_4_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelementStart(1, "button", 5);
    i0.ɵɵlistener("click", function YearHeaderComponent_ng_container_4_Template_button_click_1_listener() { var selector_r1817 = ctx.$implicit; return selector_r1817.onClick(); });
    i0.ɵɵtext(2);
    i0.ɵɵelementEnd();
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    var selector_r1817 = ctx.$implicit;
    i0.ɵɵadvance(1);
    i0.ɵɵclassMap(selector_r1817.className);
    i0.ɵɵpropertyInterpolate("title", selector_r1817.title || null);
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate1(" ", selector_r1817.label, " ");
} }
function YearHeaderComponent_button_5_Template(rf, ctx) { if (rf & 1) {
    var _r1820 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "button", 2);
    i0.ɵɵlistener("click", function YearHeaderComponent_button_5_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r1820); var ctx_r1819 = i0.ɵɵnextContext(); return ctx_r1819.next(); });
    i0.ɵɵelement(1, "span", 6);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    var ctx_r1811 = i0.ɵɵnextContext();
    i0.ɵɵclassMapInterpolate1("", ctx_r1811.prefixCls, "-next-btn");
    i0.ɵɵpropertyInterpolate("title", ctx_r1811.nextTitle());
} }
function YearHeaderComponent_button_6_Template(rf, ctx) { if (rf & 1) {
    var _r1822 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "button", 2);
    i0.ɵɵlistener("click", function YearHeaderComponent_button_6_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r1822); var ctx_r1821 = i0.ɵɵnextContext(); return ctx_r1821.superNext(); });
    i0.ɵɵelement(1, "span", 7);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    var ctx_r1812 = i0.ɵɵnextContext();
    i0.ɵɵclassMapInterpolate1("", ctx_r1812.prefixCls, "-super-next-btn");
    i0.ɵɵpropertyInterpolate("title", ctx_r1812.superNextTitle());
} }
var YearHeaderComponent = /** @class */ (function (_super) {
    __extends(YearHeaderComponent, _super);
    function YearHeaderComponent() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    Object.defineProperty(YearHeaderComponent.prototype, "startYear", {
        get: function () {
            return parseInt("" + this.value.getYear() / 10, 10) * 10;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(YearHeaderComponent.prototype, "endYear", {
        get: function () {
            return this.startYear + 9;
        },
        enumerable: true,
        configurable: true
    });
    YearHeaderComponent.prototype.superPrevious = function () {
        this.changeValue(this.value.addYears(-10));
    };
    YearHeaderComponent.prototype.superNext = function () {
        this.changeValue(this.value.addYears(10));
    };
    YearHeaderComponent.prototype.getSelectors = function () {
        var _this = this;
        return [
            {
                className: this.prefixCls + "-year-btn",
                title: '',
                onClick: function () { return _this.changeMode('decade'); },
                label: this.startYear + "-" + this.endYear
            }
        ];
    };
    /** @nocollapse */ YearHeaderComponent.ɵfac = function YearHeaderComponent_Factory(t) { return ɵYearHeaderComponent_BaseFactory(t || YearHeaderComponent); };
    /** @nocollapse */ YearHeaderComponent.ɵcmp = i0.ɵɵdefineComponent({ type: YearHeaderComponent, selectors: [["year-header"]], exportAs: ["yearHeader"], features: [i0.ɵɵInheritDefinitionFeature], decls: 7, vars: 11, consts: [["role", "button", "tabindex", "-1", 3, "class", "title", "click", 4, "ngIf"], [4, "ngFor", "ngForOf"], ["role", "button", "tabindex", "-1", 3, "title", "click"], [1, "ant-picker-super-prev-icon"], [1, "ant-picker-prev-icon"], ["role", "button", "type", "button", 3, "title", "click"], [1, "ant-picker-next-icon"], [1, "ant-picker-super-next-icon"]], template: function YearHeaderComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "div");
            i0.ɵɵtemplate(1, YearHeaderComponent_button_1_Template, 2, 4, "button", 0);
            i0.ɵɵtemplate(2, YearHeaderComponent_button_2_Template, 2, 4, "button", 0);
            i0.ɵɵelementStart(3, "div");
            i0.ɵɵtemplate(4, YearHeaderComponent_ng_container_4_Template, 3, 5, "ng-container", 1);
            i0.ɵɵelementEnd();
            i0.ɵɵtemplate(5, YearHeaderComponent_button_5_Template, 2, 4, "button", 0);
            i0.ɵɵtemplate(6, YearHeaderComponent_button_6_Template, 2, 4, "button", 0);
            i0.ɵɵelementEnd();
        } if (rf & 2) {
            i0.ɵɵclassMap(ctx.prefixCls);
            i0.ɵɵadvance(1);
            i0.ɵɵproperty("ngIf", ctx.showSuperPreBtn);
            i0.ɵɵadvance(1);
            i0.ɵɵproperty("ngIf", ctx.showPreBtn);
            i0.ɵɵadvance(1);
            i0.ɵɵclassMapInterpolate1("", ctx.prefixCls, "-view");
            i0.ɵɵadvance(1);
            i0.ɵɵproperty("ngForOf", ctx.selectors);
            i0.ɵɵadvance(1);
            i0.ɵɵproperty("ngIf", ctx.showNextBtn);
            i0.ɵɵadvance(1);
            i0.ɵɵproperty("ngIf", ctx.showSuperNextBtn);
        } }, directives: [i1.NgIf, i1.NgForOf], encapsulation: 2, changeDetection: 0 });
    return YearHeaderComponent;
}(AbstractPanelHeader));
export { YearHeaderComponent };
var ɵYearHeaderComponent_BaseFactory = i0.ɵɵgetInheritedFactory(YearHeaderComponent);
/*@__PURE__*/ (function () { i0.ɵsetClassMetadata(YearHeaderComponent, [{
        type: Component,
        args: [{
                encapsulation: ViewEncapsulation.None,
                changeDetection: ChangeDetectionStrategy.OnPush,
                selector: 'year-header',
                exportAs: 'yearHeader',
                templateUrl: './abstract-panel-header.html'
            }]
    }], null, null); })();
//# sourceMappingURL=data:application/json;base64, 