ng-zorro-antd-yj
Version:
An enterprise-class UI components based on Ant Design and Angular
63 lines • 8.01 kB
JavaScript
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
import * as tslib_1 from "tslib";
import { forwardRef, ChangeDetectionStrategy, ChangeDetectorRef, Component, ElementRef, Host, Input, Optional, Renderer2, ViewEncapsulation } from '@angular/core';
import { NG_VALUE_ACCESSOR } from '@angular/forms';
import { NzNoAnimationDirective } from '../core/no-animation/nz-no-animation.directive';
import { NzI18nService } from '../i18n/nz-i18n.service';
import { DateHelperService } from '../i18n/date-helper.service';
import { HeaderPickerComponent } from './header-picker.component';
var NzYearPickerComponent = /** @class */ (function (_super) {
tslib_1.__extends(NzYearPickerComponent, _super);
function NzYearPickerComponent(i18n, cdr, dateHelper, renderer, elementRef, noAnimation) {
var _this = _super.call(this, i18n, cdr, dateHelper, noAnimation) || this;
_this.noAnimation = noAnimation;
_this.nzFormat = 'yyyy';
_this.endPanelMode = 'year';
renderer.addClass(elementRef.nativeElement, 'ant-calendar-picker');
return _this;
}
NzYearPickerComponent.decorators = [
{ type: Component, args: [{
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
selector: 'nz-year-picker',
template: "<nz-picker\n [isRange]=\"false\"\n [value]=\"nzValue\"\n (valueChange)=\"onValueChange($event)\"\n [open]=\"nzOpen\"\n [disabled]=\"nzDisabled\"\n [format]=\"nzFormat\"\n [allowClear]=\"nzAllowClear\"\n [autoFocus]=\"nzAutoFocus\"\n [className]=\"nzClassName\"\n [placeholder]=\"nzPlaceHolder\"\n [size]=\"nzSize\"\n [style]=\"nzStyle\"\n [noAnimation]=\"noAnimation?.nzNoAnimation\"\n (openChange)=\"onOpenChange($event)\"\n>\n <div *ngIf=\"realOpenState\">\n <div class=\"ant-calendar-picker-container {{ nzDropdownClassName }} ant-calendar-picker-container-placement-bottomLeft\" [ngStyle]=\"nzPopupStyle\">\n <div class=\"ant-calendar ant-calendar-month ant-calendar-month-calendar\" tabindex=\"0\">\n <div class=\"ant-calendar-month-calendar-content\">\n <div class=\"ant-calendar-month-header-wrap\">\n <calendar-header\n [disabledMonth]=\"nzDisabledDate\"\n [disabledYear]=\"nzDisabledDate\"\n [panelMode]=\"panelMode\"\n (panelModeChange)=\"onPanelModeChange($event)\"\n [value]=\"nzValue\"\n (chooseYear)=\"onChooseValue('year', $event)\"\n (chooseMonth)=\"onChooseValue('month', $event)\"\n [locale]=\"nzLocale.lang\"\n [enablePrev]=\"true\"\n [enableNext]=\"true\"\n ></calendar-header>\n </div>\n <calendar-footer *ngIf=\"extraFooter\" [extraFooter]=\"extraFooter\"></calendar-footer>\n </div>\n </div>\n </div>\n </div>\n</nz-picker>",
providers: [
{
provide: NG_VALUE_ACCESSOR,
multi: true,
useExisting: forwardRef((/**
* @return {?}
*/
function () { return NzYearPickerComponent; }))
}
]
}] }
];
/** @nocollapse */
NzYearPickerComponent.ctorParameters = function () { return [
{ type: NzI18nService },
{ type: ChangeDetectorRef },
{ type: DateHelperService },
{ type: Renderer2 },
{ type: ElementRef },
{ type: NzNoAnimationDirective, decorators: [{ type: Host }, { type: Optional }] }
]; };
NzYearPickerComponent.propDecorators = {
nzFormat: [{ type: Input }]
};
return NzYearPickerComponent;
}(HeaderPickerComponent));
export { NzYearPickerComponent };
if (false) {
/** @type {?} */
NzYearPickerComponent.prototype.nzFormat;
/** @type {?} */
NzYearPickerComponent.prototype.endPanelMode;
/** @type {?} */
NzYearPickerComponent.prototype.noAnimation;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoieWVhci1waWNrZXIuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6Im5nOi8vbmctem9ycm8tYW50ZC15ai8iLCJzb3VyY2VzIjpbImRhdGUtcGlja2VyL3llYXItcGlja2VyLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7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