/**
 * @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 DecadeHeaderComponent_button_1_Template(rf, ctx) { if (rf & 1) {
    const _r1401 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "button", 2);
    i0.ɵɵlistener("click", function DecadeHeaderComponent_button_1_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r1401); const ctx_r1400 = i0.ɵɵnextContext(); return ctx_r1400.superPrevious(); });
    i0.ɵɵelement(1, "span", 3);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1395 = i0.ɵɵnextContext();
    i0.ɵɵclassMapInterpolate1("", ctx_r1395.prefixCls, "-super-prev-btn");
    i0.ɵɵpropertyInterpolate("title", ctx_r1395.superPreviousTitle());
} }
function DecadeHeaderComponent_button_2_Template(rf, ctx) { if (rf & 1) {
    const _r1403 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "button", 2);
    i0.ɵɵlistener("click", function DecadeHeaderComponent_button_2_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r1403); const ctx_r1402 = i0.ɵɵnextContext(); return ctx_r1402.previous(); });
    i0.ɵɵelement(1, "span", 4);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1396 = i0.ɵɵnextContext();
    i0.ɵɵclassMapInterpolate1("", ctx_r1396.prefixCls, "-prev-btn");
    i0.ɵɵpropertyInterpolate("title", ctx_r1396.previousTitle());
} }
function DecadeHeaderComponent_ng_container_4_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelementStart(1, "button", 5);
    i0.ɵɵlistener("click", function DecadeHeaderComponent_ng_container_4_Template_button_click_1_listener() { const selector_r1404 = ctx.$implicit; return selector_r1404.onClick(); });
    i0.ɵɵtext(2);
    i0.ɵɵelementEnd();
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const selector_r1404 = ctx.$implicit;
    i0.ɵɵadvance(1);
    i0.ɵɵclassMap(selector_r1404.className);
    i0.ɵɵpropertyInterpolate("title", selector_r1404.title || null);
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate1(" ", selector_r1404.label, " ");
} }
function DecadeHeaderComponent_button_5_Template(rf, ctx) { if (rf & 1) {
    const _r1407 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "button", 2);
    i0.ɵɵlistener("click", function DecadeHeaderComponent_button_5_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r1407); const ctx_r1406 = i0.ɵɵnextContext(); return ctx_r1406.next(); });
    i0.ɵɵelement(1, "span", 6);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1398 = i0.ɵɵnextContext();
    i0.ɵɵclassMapInterpolate1("", ctx_r1398.prefixCls, "-next-btn");
    i0.ɵɵpropertyInterpolate("title", ctx_r1398.nextTitle());
} }
function DecadeHeaderComponent_button_6_Template(rf, ctx) { if (rf & 1) {
    const _r1409 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "button", 2);
    i0.ɵɵlistener("click", function DecadeHeaderComponent_button_6_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r1409); const ctx_r1408 = i0.ɵɵnextContext(); return ctx_r1408.superNext(); });
    i0.ɵɵelement(1, "span", 7);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1399 = i0.ɵɵnextContext();
    i0.ɵɵclassMapInterpolate1("", ctx_r1399.prefixCls, "-super-next-btn");
    i0.ɵɵpropertyInterpolate("title", ctx_r1399.superNextTitle());
} }
export class DecadeHeaderComponent extends AbstractPanelHeader {
    previous() { }
    next() { }
    get startYear() {
        return parseInt(`${this.value.getYear() / 100}`, 10) * 100;
    }
    get endYear() {
        return this.startYear + 99;
    }
    superPrevious() {
        this.changeValue(this.value.addYears(-100));
    }
    superNext() {
        this.changeValue(this.value.addYears(100));
    }
    getSelectors() {
        return [
            {
                className: `${this.prefixCls}-decade-btn`,
                title: '',
                onClick: () => {
                    // noop
                },
                label: `${this.startYear}-${this.endYear}`
            }
        ];
    }
}
/** @nocollapse */ DecadeHeaderComponent.ɵfac = function DecadeHeaderComponent_Factory(t) { return ɵDecadeHeaderComponent_BaseFactory(t || DecadeHeaderComponent); };
/** @nocollapse */ DecadeHeaderComponent.ɵcmp = i0.ɵɵdefineComponent({ type: DecadeHeaderComponent, selectors: [["decade-header"]], exportAs: ["decadeHeader"], 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 DecadeHeaderComponent_Template(rf, ctx) { if (rf & 1) {
        i0.ɵɵelementStart(0, "div");
        i0.ɵɵtemplate(1, DecadeHeaderComponent_button_1_Template, 2, 4, "button", 0);
        i0.ɵɵtemplate(2, DecadeHeaderComponent_button_2_Template, 2, 4, "button", 0);
        i0.ɵɵelementStart(3, "div");
        i0.ɵɵtemplate(4, DecadeHeaderComponent_ng_container_4_Template, 3, 5, "ng-container", 1);
        i0.ɵɵelementEnd();
        i0.ɵɵtemplate(5, DecadeHeaderComponent_button_5_Template, 2, 4, "button", 0);
        i0.ɵɵtemplate(6, DecadeHeaderComponent_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 ɵDecadeHeaderComponent_BaseFactory = i0.ɵɵgetInheritedFactory(DecadeHeaderComponent);
/*@__PURE__*/ (function () { i0.ɵsetClassMetadata(DecadeHeaderComponent, [{
        type: Component,
        args: [{
                encapsulation: ViewEncapsulation.None,
                changeDetection: ChangeDetectionStrategy.OnPush,
                selector: 'decade-header',
                exportAs: 'decadeHeader',
                templateUrl: './abstract-panel-header.html'
            }]
    }], null, null); })();
//# sourceMappingURL=data:application/json;base64, 