/**
 * @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 DateHeaderComponent_button_1_Template(rf, ctx) { if (rf & 1) {
    const _r1356 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "button", 2);
    i0.ɵɵlistener("click", function DateHeaderComponent_button_1_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r1356); const ctx_r1355 = i0.ɵɵnextContext(); return ctx_r1355.superPrevious(); });
    i0.ɵɵelement(1, "span", 3);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1350 = i0.ɵɵnextContext();
    i0.ɵɵclassMapInterpolate1("", ctx_r1350.prefixCls, "-super-prev-btn");
    i0.ɵɵpropertyInterpolate("title", ctx_r1350.superPreviousTitle());
} }
function DateHeaderComponent_button_2_Template(rf, ctx) { if (rf & 1) {
    const _r1358 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "button", 2);
    i0.ɵɵlistener("click", function DateHeaderComponent_button_2_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r1358); const ctx_r1357 = i0.ɵɵnextContext(); return ctx_r1357.previous(); });
    i0.ɵɵelement(1, "span", 4);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1351 = i0.ɵɵnextContext();
    i0.ɵɵclassMapInterpolate1("", ctx_r1351.prefixCls, "-prev-btn");
    i0.ɵɵpropertyInterpolate("title", ctx_r1351.previousTitle());
} }
function DateHeaderComponent_ng_container_4_Template(rf, ctx) { if (rf & 1) {
    i0.ɵɵelementContainerStart(0);
    i0.ɵɵelementStart(1, "button", 5);
    i0.ɵɵlistener("click", function DateHeaderComponent_ng_container_4_Template_button_click_1_listener() { const selector_r1359 = ctx.$implicit; return selector_r1359.onClick(); });
    i0.ɵɵtext(2);
    i0.ɵɵelementEnd();
    i0.ɵɵelementContainerEnd();
} if (rf & 2) {
    const selector_r1359 = ctx.$implicit;
    i0.ɵɵadvance(1);
    i0.ɵɵclassMap(selector_r1359.className);
    i0.ɵɵpropertyInterpolate("title", selector_r1359.title || null);
    i0.ɵɵadvance(1);
    i0.ɵɵtextInterpolate1(" ", selector_r1359.label, " ");
} }
function DateHeaderComponent_button_5_Template(rf, ctx) { if (rf & 1) {
    const _r1362 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "button", 2);
    i0.ɵɵlistener("click", function DateHeaderComponent_button_5_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r1362); const ctx_r1361 = i0.ɵɵnextContext(); return ctx_r1361.next(); });
    i0.ɵɵelement(1, "span", 6);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1353 = i0.ɵɵnextContext();
    i0.ɵɵclassMapInterpolate1("", ctx_r1353.prefixCls, "-next-btn");
    i0.ɵɵpropertyInterpolate("title", ctx_r1353.nextTitle());
} }
function DateHeaderComponent_button_6_Template(rf, ctx) { if (rf & 1) {
    const _r1364 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "button", 2);
    i0.ɵɵlistener("click", function DateHeaderComponent_button_6_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r1364); const ctx_r1363 = i0.ɵɵnextContext(); return ctx_r1363.superNext(); });
    i0.ɵɵelement(1, "span", 7);
    i0.ɵɵelementEnd();
} if (rf & 2) {
    const ctx_r1354 = i0.ɵɵnextContext();
    i0.ɵɵclassMapInterpolate1("", ctx_r1354.prefixCls, "-super-next-btn");
    i0.ɵɵpropertyInterpolate("title", ctx_r1354.superNextTitle());
} }
export class DateHeaderComponent extends AbstractPanelHeader {
    constructor(dateHelper) {
        super();
        this.dateHelper = dateHelper;
    }
    getSelectors() {
        return [
            {
                className: `${this.prefixCls}-year-btn`,
                title: this.locale.yearSelect,
                onClick: () => this.changeMode('year'),
                label: this.dateHelper.format(this.value.nativeDate, transCompatFormat(this.locale.yearFormat))
            },
            {
                className: `${this.prefixCls}-month-btn`,
                title: this.locale.monthSelect,
                onClick: () => this.changeMode('month'),
                label: this.dateHelper.format(this.value.nativeDate, this.locale.monthFormat || 'MMM')
            }
        ];
    }
}
/** @nocollapse */ DateHeaderComponent.ɵfac = function DateHeaderComponent_Factory(t) { return new (t || DateHeaderComponent)(i0.ɵɵdirectiveInject(i1.DateHelperService)); };
/** @nocollapse */ DateHeaderComponent.ɵcmp = i0.ɵɵdefineComponent({ type: DateHeaderComponent, selectors: [["date-header"]], exportAs: ["dateHeader"], 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 DateHeaderComponent_Template(rf, ctx) { if (rf & 1) {
        i0.ɵɵelementStart(0, "div");
        i0.ɵɵtemplate(1, DateHeaderComponent_button_1_Template, 2, 4, "button", 0);
        i0.ɵɵtemplate(2, DateHeaderComponent_button_2_Template, 2, 4, "button", 0);
        i0.ɵɵelementStart(3, "div");
        i0.ɵɵtemplate(4, DateHeaderComponent_ng_container_4_Template, 3, 5, "ng-container", 1);
        i0.ɵɵelementEnd();
        i0.ɵɵtemplate(5, DateHeaderComponent_button_5_Template, 2, 4, "button", 0);
        i0.ɵɵtemplate(6, DateHeaderComponent_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(DateHeaderComponent, [{
        type: Component,
        args: [{
                encapsulation: ViewEncapsulation.None,
                changeDetection: ChangeDetectionStrategy.OnPush,
                selector: 'date-header',
                exportAs: 'dateHeader',
                templateUrl: './abstract-panel-header.html'
            }]
    }], function () { return [{ type: i1.DateHelperService }]; }, null); })();
//# sourceMappingURL=data:application/json;base64, 