/**
 * @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) {
    const _r1491 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "button", 2);
    i0.ɵɵlistener("click", function YearHeaderComponent_button_1_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r1491); const ctx_r1490 = i0.ɵɵnextContext(); return ctx_r1490.superPrevious(); });
    i0.ɵɵelement(1, "span", 3);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1485 = i0.ɵɵnextContext();
    i0.ɵɵclassMapInterpolate1("", ctx_r1485.prefixCls, "-super-prev-btn");
    i0.ɵɵpropertyInterpolate("title", ctx_r1485.superPreviousTitle());
} }
function YearHeaderComponent_button_2_Template(rf, ctx) { if (rf & 1) {
    const _r1493 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "button", 2);
    i0.ɵɵlistener("click", function YearHeaderComponent_button_2_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r1493); const ctx_r1492 = i0.ɵɵnextContext(); return ctx_r1492.previous(); });
    i0.ɵɵelement(1, "span", 4);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1486 = i0.ɵɵnextContext();
    i0.ɵɵclassMapInterpolate1("", ctx_r1486.prefixCls, "-prev-btn");
    i0.ɵɵpropertyInterpolate("title", ctx_r1486.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() { const selector_r1494 = ctx.$implicit; return selector_r1494.onClick(); });
    i0.ɵɵtext(2);
    i0.ɵɵelementEnd();
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const selector_r1494 = ctx.$implicit;
    i0.ɵɵadvance(1);
    i0.ɵɵclassMap(selector_r1494.className);
    i0.ɵɵpropertyInterpolate("title", selector_r1494.title || null);
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate1(" ", selector_r1494.label, " ");
} }
function YearHeaderComponent_button_5_Template(rf, ctx) { if (rf & 1) {
    const _r1497 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "button", 2);
    i0.ɵɵlistener("click", function YearHeaderComponent_button_5_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r1497); const ctx_r1496 = i0.ɵɵnextContext(); return ctx_r1496.next(); });
    i0.ɵɵelement(1, "span", 6);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1488 = i0.ɵɵnextContext();
    i0.ɵɵclassMapInterpolate1("", ctx_r1488.prefixCls, "-next-btn");
    i0.ɵɵpropertyInterpolate("title", ctx_r1488.nextTitle());
} }
function YearHeaderComponent_button_6_Template(rf, ctx) { if (rf & 1) {
    const _r1499 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "button", 2);
    i0.ɵɵlistener("click", function YearHeaderComponent_button_6_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r1499); const ctx_r1498 = i0.ɵɵnextContext(); return ctx_r1498.superNext(); });
    i0.ɵɵelement(1, "span", 7);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1489 = i0.ɵɵnextContext();
    i0.ɵɵclassMapInterpolate1("", ctx_r1489.prefixCls, "-super-next-btn");
    i0.ɵɵpropertyInterpolate("title", ctx_r1489.superNextTitle());
} }
export class YearHeaderComponent extends AbstractPanelHeader {
    get startYear() {
        return parseInt(`${this.value.getYear() / 10}`, 10) * 10;
    }
    get endYear() {
        return this.startYear + 9;
    }
    superPrevious() {
        this.changeValue(this.value.addYears(-10));
    }
    superNext() {
        this.changeValue(this.value.addYears(10));
    }
    getSelectors() {
        return [
            {
                className: `${this.prefixCls}-year-btn`,
                title: '',
                onClick: () => 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 });
const ɵ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, 