/**
 * @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 { DateHelperService } from 'ng-zorro-antd/i18n';
import { AbstractPanelHeader } from './abstract-panel-header';
import { transCompatFormat } from './util';
import * as i0 from "@angular/core";
import * as i1 from "ng-zorro-antd/i18n";
import * as i2 from "@angular/common";
function MonthHeaderComponent_button_1_Template(rf, ctx) { if (rf & 1) {
    const _r1446 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "button", 2);
    i0.ɵɵlistener("click", function MonthHeaderComponent_button_1_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r1446); const ctx_r1445 = i0.ɵɵnextContext(); return ctx_r1445.superPrevious(); });
    i0.ɵɵelement(1, "span", 3);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1440 = i0.ɵɵnextContext();
    i0.ɵɵclassMapInterpolate1("", ctx_r1440.prefixCls, "-super-prev-btn");
    i0.ɵɵpropertyInterpolate("title", ctx_r1440.superPreviousTitle());
} }
function MonthHeaderComponent_button_2_Template(rf, ctx) { if (rf & 1) {
    const _r1448 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "button", 2);
    i0.ɵɵlistener("click", function MonthHeaderComponent_button_2_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r1448); const ctx_r1447 = i0.ɵɵnextContext(); return ctx_r1447.previous(); });
    i0.ɵɵelement(1, "span", 4);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1441 = i0.ɵɵnextContext();
    i0.ɵɵclassMapInterpolate1("", ctx_r1441.prefixCls, "-prev-btn");
    i0.ɵɵpropertyInterpolate("title", ctx_r1441.previousTitle());
} }
function MonthHeaderComponent_ng_container_4_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelementStart(1, "button", 5);
    i0.ɵɵlistener("click", function MonthHeaderComponent_ng_container_4_Template_button_click_1_listener() { const selector_r1449 = ctx.$implicit; return selector_r1449.onClick(); });
    i0.ɵɵtext(2);
    i0.ɵɵelementEnd();
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const selector_r1449 = ctx.$implicit;
    i0.ɵɵadvance(1);
    i0.ɵɵclassMap(selector_r1449.className);
    i0.ɵɵpropertyInterpolate("title", selector_r1449.title || null);
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate1(" ", selector_r1449.label, " ");
} }
function MonthHeaderComponent_button_5_Template(rf, ctx) { if (rf & 1) {
    const _r1452 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "button", 2);
    i0.ɵɵlistener("click", function MonthHeaderComponent_button_5_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r1452); const ctx_r1451 = i0.ɵɵnextContext(); return ctx_r1451.next(); });
    i0.ɵɵelement(1, "span", 6);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1443 = i0.ɵɵnextContext();
    i0.ɵɵclassMapInterpolate1("", ctx_r1443.prefixCls, "-next-btn");
    i0.ɵɵpropertyInterpolate("title", ctx_r1443.nextTitle());
} }
function MonthHeaderComponent_button_6_Template(rf, ctx) { if (rf & 1) {
    const _r1454 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "button", 2);
    i0.ɵɵlistener("click", function MonthHeaderComponent_button_6_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r1454); const ctx_r1453 = i0.ɵɵnextContext(); return ctx_r1453.superNext(); });
    i0.ɵɵelement(1, "span", 7);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1444 = i0.ɵɵnextContext();
    i0.ɵɵclassMapInterpolate1("", ctx_r1444.prefixCls, "-super-next-btn");
    i0.ɵɵpropertyInterpolate("title", ctx_r1444.superNextTitle());
} }
export class MonthHeaderComponent extends AbstractPanelHeader {
    constructor(dateHelper) {
        super();
        this.dateHelper = dateHelper;
    }
    getSelectors() {
        return [
            {
                className: `${this.prefixCls}-month-btn`,
                title: this.locale.yearSelect,
                onClick: () => this.changeMode('year'),
                label: this.dateHelper.format(this.value.nativeDate, transCompatFormat(this.locale.yearFormat))
            }
        ];
    }
}
/** @nocollapse */ MonthHeaderComponent.ɵfac = function MonthHeaderComponent_Factory(t) { return new (t || MonthHeaderComponent)(i0.ɵɵdirectiveInject(i1.DateHelperService)); };
/** @nocollapse */ MonthHeaderComponent.ɵcmp = i0.ɵɵdefineComponent({ type: MonthHeaderComponent, selectors: [["month-header"]], exportAs: ["monthHeader"], 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 MonthHeaderComponent_Template(rf, ctx) { if (rf & 1) {
        i0.ɵɵelementStart(0, "div");
        i0.ɵɵtemplate(1, MonthHeaderComponent_button_1_Template, 2, 4, "button", 0);
        i0.ɵɵtemplate(2, MonthHeaderComponent_button_2_Template, 2, 4, "button", 0);
        i0.ɵɵelementStart(3, "div");
        i0.ɵɵtemplate(4, MonthHeaderComponent_ng_container_4_Template, 3, 5, "ng-container", 1);
        i0.ɵɵelementEnd();
        i0.ɵɵtemplate(5, MonthHeaderComponent_button_5_Template, 2, 4, "button", 0);
        i0.ɵɵtemplate(6, MonthHeaderComponent_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: [i2.NgIf, i2.NgForOf], encapsulation: 2, changeDetection: 0 });
/*@__PURE__*/ (function () { i0.ɵsetClassMetadata(MonthHeaderComponent, [{
        type: Component,
        args: [{
                encapsulation: ViewEncapsulation.None,
                changeDetection: ChangeDetectionStrategy.OnPush,
                selector: 'month-header',
                exportAs: 'monthHeader',
                templateUrl: './abstract-panel-header.html'
            }]
    }], function () { return [{ type: i1.DateHelperService }]; }, null); })();
//# sourceMappingURL=data:application/json;base64, 