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, ChangeDetectorRef, Component, forwardRef, Host, Input, Optional, ViewEncapsulation } from '@angular/core';
import { NG_VALUE_ACCESSOR } from '@angular/forms';
import { NzNoAnimationDirective } from 'ng-zorro-antd/core';
import { DateHelperService, NzI18nService } from 'ng-zorro-antd/i18n';
import { AbstractPickerComponent } from './abstract-picker.component';
import { DatePickerService } from './date-picker.service';
import * as i0 from "@angular/core";
import * as i1 from "./date-picker.service";
import * as i2 from "ng-zorro-antd/i18n";
import * as i3 from "ng-zorro-antd/core";
import * as i4 from "./picker.component";
import * as i5 from "@angular/common";
import * as i6 from "./date-range-popup.component";
function NzYearPickerComponent_date_range_popup_1_Template(rf, ctx) { if (rf & 1) {
    var _r1909 = i0.ɵɵgetCurrentView();
    i0.ɵɵelementStart(0, "date-range-popup", 2);
    i0.ɵɵlistener("panelModeChange", function NzYearPickerComponent_date_range_popup_1_Template_date_range_popup_panelModeChange_0_listener($event) { i0.ɵɵrestoreView(_r1909); var ctx_r1908 = i0.ɵɵnextContext(); return ctx_r1908.onPanelModeChange($event); })("calendarChange", function NzYearPickerComponent_date_range_popup_1_Template_date_range_popup_calendarChange_0_listener($event) { i0.ɵɵrestoreView(_r1909); var ctx_r1910 = i0.ɵɵnextContext(); return ctx_r1910.onCalendarChange($event); })("resultOk", function NzYearPickerComponent_date_range_popup_1_Template_date_range_popup_resultOk_0_listener() { i0.ɵɵrestoreView(_r1909); var ctx_r1911 = i0.ɵɵnextContext(); return ctx_r1911.onResultOk(); });
    i0.ɵɵelementEnd();
} if (rf & 2) {
    var ctx_r1907 = i0.ɵɵnextContext();
    i0.ɵɵproperty("isRange", ctx_r1907.isRange)("defaultPickerValue", ctx_r1907.nzDefaultPickerValue)("showWeek", ctx_r1907.showWeek)("panelMode", ctx_r1907.nzMode)("locale", ctx_r1907.nzLocale == null ? null : ctx_r1907.nzLocale.lang)("showToday", ctx_r1907.realShowToday)("showTime", ctx_r1907.nzShowTime)("format", ctx_r1907.nzFormat)("dateRender", ctx_r1907.nzDateRender)("disabledDate", ctx_r1907.nzDisabledDate)("disabledTime", ctx_r1907.nzDisabledTime)("placeholder", ctx_r1907.nzPlaceHolder)("dropdownClassName", ctx_r1907.nzDropdownClassName)("popupStyle", ctx_r1907.nzPopupStyle)("extraFooter", ctx_r1907.extraFooter)("ranges", ctx_r1907.nzRanges);
} }
var NzYearPickerComponent = /** @class */ (function (_super) {
    __extends(NzYearPickerComponent, _super);
    function NzYearPickerComponent(datePickerService, i18n, cdr, dateHelper, noAnimation) {
        var _this = _super.call(this, datePickerService, i18n, cdr, dateHelper, noAnimation) || this;
        _this.noAnimation = noAnimation;
        _this.nzMode = 'year';
        _this.nzFormat = 'yyyy';
        return _this;
    }
    /** @nocollapse */ NzYearPickerComponent.ɵfac = function NzYearPickerComponent_Factory(t) { return new (t || NzYearPickerComponent)(i0.ɵɵdirectiveInject(i1.DatePickerService), i0.ɵɵdirectiveInject(i2.NzI18nService), i0.ɵɵdirectiveInject(i0.ChangeDetectorRef), i0.ɵɵdirectiveInject(i2.DateHelperService), i0.ɵɵdirectiveInject(i3.NzNoAnimationDirective, 9)); };
    /** @nocollapse */ NzYearPickerComponent.ɵcmp = i0.ɵɵdefineComponent({ type: NzYearPickerComponent, selectors: [["nz-year-picker"]], hostVars: 2, hostBindings: function NzYearPickerComponent_HostBindings(rf, ctx) { if (rf & 2) {
            i0.ɵɵclassMap(ctx.hostClassMap);
        } }, inputs: { nzMode: "nzMode", nzFormat: "nzFormat" }, exportAs: ["nzYearPicker"], features: [i0.ɵɵProvidersFeature([
                DatePickerService,
                {
                    provide: NG_VALUE_ACCESSOR,
                    multi: true,
                    useExisting: forwardRef((function () { return NzYearPickerComponent; }))
                }
            ]), i0.ɵɵInheritDefinitionFeature], decls: 2, vars: 14, consts: [["nz-picker", "", 3, "isRange", "open", "separator", "disabled", "disabledDate", "format", "allowClear", "autoFocus", "placeholder", "ngClass", "noAnimation", "openChange", "focusChange"], [3, "isRange", "defaultPickerValue", "showWeek", "panelMode", "locale", "showToday", "showTime", "format", "dateRender", "disabledDate", "disabledTime", "placeholder", "dropdownClassName", "popupStyle", "extraFooter", "ranges", "panelModeChange", "calendarChange", "resultOk", 4, "ngIf"], [3, "isRange", "defaultPickerValue", "showWeek", "panelMode", "locale", "showToday", "showTime", "format", "dateRender", "disabledDate", "disabledTime", "placeholder", "dropdownClassName", "popupStyle", "extraFooter", "ranges", "panelModeChange", "calendarChange", "resultOk"]], template: function NzYearPickerComponent_Template(rf, ctx) { if (rf & 1) {
            i0.ɵɵelementStart(0, "div", 0);
            i0.ɵɵlistener("openChange", function NzYearPickerComponent_Template_div_openChange_0_listener($event) { return ctx.onOpenChange($event); })("focusChange", function NzYearPickerComponent_Template_div_focusChange_0_listener($event) { return ctx.onFocusChange($event); });
            i0.ɵɵtemplate(1, NzYearPickerComponent_date_range_popup_1_Template, 1, 16, "date-range-popup", 1);
            i0.ɵɵelementEnd();
        } if (rf & 2) {
            i0.ɵɵstyleMap(ctx.nzStyle);
            i0.ɵɵproperty("isRange", ctx.isRange)("open", ctx.nzOpen)("separator", ctx.nzSeparator)("disabled", ctx.nzDisabled)("disabledDate", ctx.nzDisabledDate)("format", ctx.nzFormat)("allowClear", ctx.nzAllowClear)("autoFocus", ctx.nzAutoFocus)("placeholder", ctx.nzPlaceHolder)("ngClass", ctx.nzClassName)("noAnimation", ctx.noAnimation == null ? null : ctx.noAnimation.nzNoAnimation);
            i0.ɵɵadvance(1);
            i0.ɵɵproperty("ngIf", ctx.realOpenState);
        } }, directives: [i4.NzPickerComponent, i5.NgClass, i5.NgIf, i6.DateRangePopupComponent], encapsulation: 2, changeDetection: 0 });
    return NzYearPickerComponent;
}(AbstractPickerComponent));
export { NzYearPickerComponent };
/*@__PURE__*/ (function () { i0.ɵsetClassMetadata(NzYearPickerComponent, [{
        type: Component,
        args: [{
                encapsulation: ViewEncapsulation.None,
                changeDetection: ChangeDetectionStrategy.OnPush,
                selector: 'nz-year-picker',
                exportAs: 'nzYearPicker',
                templateUrl: './abstract-picker.component.html',
                host: {
                    '[class]': 'hostClassMap'
                },
                providers: [
                    DatePickerService,
                    {
                        provide: NG_VALUE_ACCESSOR,
                        multi: true,
                        useExisting: forwardRef((function () { return NzYearPickerComponent; }))
                    }
                ]
            }]
    }], function () { return [{ type: i1.DatePickerService }, { type: i2.NzI18nService }, { type: i0.ChangeDetectorRef }, { type: i2.DateHelperService }, { type: i3.NzNoAnimationDirective, decorators: [{
                type: Host
            }, {
                type: Optional
            }] }]; }, { nzMode: [{
            type: Input
        }], nzFormat: [{
            type: Input
        }] }); })();
//# sourceMappingURL=data:application/json;base64, 