ng-zorro-antd
Version:
An enterprise-class UI components based on Ant Design and Angular
120 lines (118 loc) • 13.4 kB
JavaScript
/**
* 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, ElementRef, EventEmitter, Input, Output, ViewEncapsulation } from '@angular/core';
import { CandyDate } from 'ng-zorro-antd/core/time';
import { DateHelperService, NzI18nService as I18n } from 'ng-zorro-antd/i18n';
export class NzCalendarHeaderComponent {
constructor(i18n, dateHelper, elementRef) {
this.i18n = i18n;
this.dateHelper = dateHelper;
this.elementRef = elementRef;
this.mode = 'month';
this.fullscreen = true;
this.activeDate = new CandyDate();
this.modeChange = new EventEmitter();
this.yearChange = new EventEmitter();
this.monthChange = new EventEmitter();
// @Output() readonly valueChange: EventEmitter<CandyDate> = new EventEmitter();
this.yearOffset = 10;
this.yearTotal = 20;
this.years = [];
this.months = [];
// TODO: move to host after View Engine deprecation
this.elementRef.nativeElement.classList.add('ant-fullcalendar-header');
}
get activeYear() {
return this.activeDate.getYear();
}
get activeMonth() {
return this.activeDate.getMonth();
}
get size() {
return this.fullscreen ? 'default' : 'small';
}
get yearTypeText() {
return this.i18n.getLocale().Calendar.lang.year;
}
get monthTypeText() {
return this.i18n.getLocale().Calendar.lang.month;
}
ngOnInit() {
this.setUpYears();
this.setUpMonths();
}
updateYear(year) {
this.yearChange.emit(year);
this.setUpYears(year);
}
setUpYears(year) {
const start = (year || this.activeYear) - this.yearOffset;
const end = start + this.yearTotal;
this.years = [];
for (let i = start; i < end; i++) {
this.years.push({ label: `${i}`, value: i });
}
}
setUpMonths() {
this.months = [];
for (let i = 0; i < 12; i++) {
const dateInMonth = this.activeDate.setMonth(i);
const monthText = this.dateHelper.format(dateInMonth.nativeDate, 'MMM');
this.months.push({ label: monthText, value: i });
}
}
}
NzCalendarHeaderComponent.decorators = [
{ type: Component, args: [{
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
selector: 'nz-calendar-header',
exportAs: 'nzCalendarHeader',
template: `
<div class="ant-picker-calendar-header">
<nz-select
class="ant-picker-calendar-year-select"
[nzSize]="size"
[nzDropdownMatchSelectWidth]="false"
[ngModel]="activeYear"
(ngModelChange)="updateYear($event)"
>
<nz-option *ngFor="let year of years" [nzLabel]="year.label" [nzValue]="year.value"></nz-option>
</nz-select>
<nz-select
*ngIf="mode === 'month'"
class="ant-picker-calendar-month-select"
[nzSize]="size"
[nzDropdownMatchSelectWidth]="false"
[ngModel]="activeMonth"
(ngModelChange)="monthChange.emit($event)"
>
<nz-option *ngFor="let month of months" [nzLabel]="month.label" [nzValue]="month.value"></nz-option>
</nz-select>
<nz-radio-group class="ant-picker-calendar-mode-switch" [(ngModel)]="mode" (ngModelChange)="modeChange.emit($event)" [nzSize]="size">
<label nz-radio-button nzValue="month">{{ monthTypeText }}</label>
<label nz-radio-button nzValue="year">{{ yearTypeText }}</label>
</nz-radio-group>
</div>
`,
host: {
'[style.display]': `'block'`
}
},] }
];
NzCalendarHeaderComponent.ctorParameters = () => [
{ type: I18n },
{ type: DateHelperService },
{ type: ElementRef }
];
NzCalendarHeaderComponent.propDecorators = {
mode: [{ type: Input }],
fullscreen: [{ type: Input }],
activeDate: [{ type: Input }],
modeChange: [{ type: Output }],
yearChange: [{ type: Output }],
monthChange: [{ type: Output }]
};
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FsZW5kYXItaGVhZGVyLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIvaG9tZS92c3RzL3dvcmsvMS9zL2NvbXBvbmVudHMvY2FsZW5kYXIvIiwic291cmNlcyI6WyJjYWxlbmRhci1oZWFkZXIuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7R0FHRztBQUVILE9BQU8sRUFBRSx1QkFBdUIsRUFBRSxTQUFTLEVBQUUsVUFBVSxFQU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