ng-zorro-antd
Version:
An enterprise-class UI components based on Ant Design and Angular
198 lines (194 loc) • 21.6 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 { NgTemplateOutlet } from '@angular/common';
import { ChangeDetectionStrategy, Component, EventEmitter, Input, Output, ViewEncapsulation } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { NzStringTemplateOutletDirective } from 'ng-zorro-antd/core/outlet';
import { CandyDate } from 'ng-zorro-antd/core/time';
import { NzRadioModule } from 'ng-zorro-antd/radio';
import { NzSelectModule } from 'ng-zorro-antd/select';
import * as i0 from "@angular/core";
import * as i1 from "ng-zorro-antd/i18n";
import * as i2 from "ng-zorro-antd/select";
import * as i3 from "@angular/forms";
import * as i4 from "ng-zorro-antd/radio";
export class NzCalendarHeaderComponent {
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;
}
constructor(i18n, dateHelper) {
this.i18n = i18n;
this.dateHelper = dateHelper;
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 = [];
}
ngOnInit() {
this.setUpYears();
this.setUpMonths();
}
ngOnChanges(changes) {
if (changes['activeDate']) {
const previousActiveDate = changes['activeDate'].previousValue;
const currentActiveDate = changes['activeDate'].currentValue;
if (previousActiveDate?.getYear() !== currentActiveDate?.getYear()) {
this.setUpYears();
}
}
}
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 });
}
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: NzCalendarHeaderComponent, deps: [{ token: i1.NzI18nService }, { token: i1.DateHelperService }], target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.4", type: NzCalendarHeaderComponent, isStandalone: true, selector: "nz-calendar-header", inputs: { mode: "mode", fullscreen: "fullscreen", activeDate: "activeDate", nzCustomHeader: "nzCustomHeader" }, outputs: { modeChange: "modeChange", yearChange: "yearChange", monthChange: "monthChange" }, host: { properties: { "style.display": "'block'" }, classAttribute: "ant-fullcalendar-header" }, exportAs: ["nzCalendarHeader"], usesOnChanges: true, ngImport: i0, template: `
(nzCustomHeader) {
<ng-container *nzStringTemplateOutlet="nzCustomHeader">{{ nzCustomHeader }}</ng-container>
} {
<div class="ant-picker-calendar-header">
<nz-select
class="ant-picker-calendar-year-select"
[nzSize]="size"
[nzDropdownMatchSelectWidth]="false"
[ngModel]="activeYear"
(ngModelChange)="updateYear($event)"
>
(year of years; track year.value) {
<nz-option [nzLabel]="year.label" [nzValue]="year.value" />
}
</nz-select>
(mode === 'month') {
<nz-select
class="ant-picker-calendar-month-select"
[nzSize]="size"
[nzDropdownMatchSelectWidth]="false"
[ngModel]="activeMonth"
(ngModelChange)="monthChange.emit($event)"
>
(month of months; track month.value) {
<nz-option [nzLabel]="month.label" [nzValue]="month.value" />
}
</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>
}
`, isInline: true, dependencies: [{ kind: "ngmodule", type: NzSelectModule }, { kind: "component", type: i2.NzOptionComponent, selector: "nz-option", inputs: ["nzTitle", "nzLabel", "nzValue", "nzKey", "nzDisabled", "nzHide", "nzCustomContent"], exportAs: ["nzOption"] }, { kind: "component", type: i2.NzSelectComponent, selector: "nz-select", inputs: ["nzId", "nzSize", "nzStatus", "nzOptionHeightPx", "nzOptionOverflowSize", "nzDropdownClassName", "nzDropdownMatchSelectWidth", "nzDropdownStyle", "nzNotFoundContent", "nzPlaceHolder", "nzPlacement", "nzMaxTagCount", "nzDropdownRender", "nzCustomTemplate", "nzSuffixIcon", "nzClearIcon", "nzRemoveIcon", "nzMenuItemSelectedIcon", "nzTokenSeparators", "nzMaxTagPlaceholder", "nzMaxMultipleCount", "nzMode", "nzFilterOption", "compareWith", "nzAllowClear", "nzBorderless", "nzShowSearch", "nzLoading", "nzAutoFocus", "nzAutoClearSearchValue", "nzServerSearch", "nzDisabled", "nzOpen", "nzSelectOnTab", "nzBackdrop", "nzOptions", "nzShowArrow"], outputs: ["nzOnSearch", "nzScrollToBottom", "nzOpenChange", "nzBlur", "nzFocus"], exportAs: ["nzSelect"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: NzRadioModule }, { kind: "component", type: i4.NzRadioComponent, selector: "[nz-radio],[nz-radio-button]", inputs: ["nzValue", "nzDisabled", "nzAutoFocus", "nz-radio-button"], exportAs: ["nzRadio"] }, { kind: "component", type: i4.NzRadioGroupComponent, selector: "nz-radio-group", inputs: ["nzDisabled", "nzButtonStyle", "nzSize", "nzName"], exportAs: ["nzRadioGroup"] }, { kind: "directive", type: NzStringTemplateOutletDirective, selector: "[nzStringTemplateOutlet]", inputs: ["nzStringTemplateOutletContext", "nzStringTemplateOutlet"], exportAs: ["nzStringTemplateOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: NzCalendarHeaderComponent, decorators: [{
type: Component,
args: [{
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
selector: 'nz-calendar-header',
exportAs: 'nzCalendarHeader',
template: `
(nzCustomHeader) {
<ng-container *nzStringTemplateOutlet="nzCustomHeader">{{ nzCustomHeader }}</ng-container>
} {
<div class="ant-picker-calendar-header">
<nz-select
class="ant-picker-calendar-year-select"
[nzSize]="size"
[nzDropdownMatchSelectWidth]="false"
[ngModel]="activeYear"
(ngModelChange)="updateYear($event)"
>
(year of years; track year.value) {
<nz-option [nzLabel]="year.label" [nzValue]="year.value" />
}
</nz-select>
(mode === 'month') {
<nz-select
class="ant-picker-calendar-month-select"
[nzSize]="size"
[nzDropdownMatchSelectWidth]="false"
[ngModel]="activeMonth"
(ngModelChange)="monthChange.emit($event)"
>
(month of months; track month.value) {
<nz-option [nzLabel]="month.label" [nzValue]="month.value" />
}
</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: {
class: 'ant-fullcalendar-header',
'[style.display]': `'block'`
},
imports: [NzSelectModule, FormsModule, NzRadioModule, NgTemplateOutlet, NzStringTemplateOutletDirective],
standalone: true
}]
}], ctorParameters: () => [{ type: i1.NzI18nService }, { type: i1.DateHelperService }], propDecorators: { mode: [{
type: Input
}], fullscreen: [{
type: Input
}], activeDate: [{
type: Input
}], nzCustomHeader: [{
type: Input
}], modeChange: [{
type: Output
}], yearChange: [{
type: Output
}], monthChange: [{
type: Output
}] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FsZW5kYXItaGVhZGVyLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL2NvbXBvbmVudHMvY2FsZW5kYXIvY2FsZW5kYXItaGVhZGVyLmNvbXBvbmVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7O0dBR0c7QUFFSCxPQUFPLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQUNuRCxPQUFPLEVBQ0wsdUJBQXVCLEVBQ3ZCLFNBQVMsRUFDVCxZQUFZLEVBQ1osS0FBSyxFQUdMLE1BQU0sRUFHTixpQkFBaUIsRUFDbEIsTUFBTSxlQUFlLENBQUM7QUFDdkIsT0FBTyxFQUFFLFdBQVcsRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBRTdDLE9BQU8sRUFBRSwrQkFBK0IsRUFBRSxNQUFNLDJCQUEyQixDQUFDO0FBQzVFLE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUVwRCxPQUFPLEVBQUUsYUFBYSxFQUFFLE1BQU0scUJBQXFCLENBQUM7QUFDcEQsT0FBTyxFQUFFLGNBQWMsRUFBb0IsTUFBTSxzQkFBc0IsQ0FBQzs7Ozs7O0FBeUR4RSxNQUFNLE9BQU8seUJBQXlCO0lBZ0JwQyxJQUFJLFVBQVU7UUFDWixPQUFPLElBQUksQ0FBQyxVQUFVLENBQUMsT0FBTyxFQUFFLENBQUM7SUFDbkMsQ0FBQztJQUVELElBQUksV0FBVztRQUNiLE9BQU8sSUFBSSxDQUFDLFVBQVUsQ0FBQyxRQUFR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FxuICAgICAgICAgIGNsYXNzPVwiYW50LXBpY2tlci1jYWxlbmRhci15ZWFyLXNlbGVjdFwiXG4gICAgICAgICAgW256U2l6ZV09XCJzaXplXCJcbiAgICAgICAgICBbbnpEcm9wZG93bk1hdGNoU2VsZWN0V2lkdGhdPVwiZmFsc2VcIlxuICAgICAgICAgIFtuZ01vZGVsXT1cImFjdGl2ZVllYXJcIlxuICAgICAgICAgIChuZ01vZGVsQ2hhbmdlKT1cInVwZGF0ZVllYXIoJGV2ZW50KVwiXG4gICAgICAgID5cbiAgICAgICAgICBAZm9yICh5ZWFyIG9mIHllYXJzOyB0cmFjayB5ZWFyLnZhbHVlKSB7XG4gICAgICAgICAgICA8bnotb3B0aW9uIFtuekxhYmVsXT1cInllYXIubGFiZWxcIiBbbnpWYWx1ZV09XCJ5ZWFyLnZhbHVlXCIgLz5cbiAgICAgICAgICB9XG4gICAgICAgIDwvbnotc2VsZWN0PlxuXG4gICAgICAgIEBpZiAobW9kZSA9PT0gJ21vbnRoJykge1xuICAgICAgICAgIDxuei1zZWxlY3RcbiAgICAgICAgICAgIGNsYXNzPVwiYW50LXBpY2tlci1jYWxlbmRhci1tb250aC1zZWxlY3RcIlxuICAgICAgICAgICAgW256U2l6ZV09XCJzaXplXCJcbiAgICAgICAgICAgIFtuekRyb3Bkb3duTWF0Y2hTZWxlY3RXaWR0aF09XCJmYWxzZVwiXG4gICAgICAgICAgICBbbmdNb2RlbF09XCJhY3RpdmVNb250aFwiXG4gICAgICAgICAgICAobmdNb2RlbENoYW5nZSk9XCJtb250aENoYW5nZS5lbWl0KCRldmVudClcIlxuICAgICAgICAgID5cbiAgICAgICAgICAgIEBmb3IgKG1vbnRoIG9mIG1vbnRoczsgdHJhY2sgbW9udGgudmFsdWUpIHtcbiAgICAgICAgICAgICAgPG56LW9wdGlvbiBbbnpMYWJlbF09XCJtb250aC5sYWJlbFwiIFtuelZhbHVlXT1cIm1vbnRoLnZhbHVlXCIgLz5cbiAgICAgICAgICAgIH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