ng-zorro-antd
Version:
An enterprise-class UI components based on Ant Design and Angular
235 lines (233 loc) • 27.3 kB
JavaScript
import { __decorate } from "tslib";
import { ChangeDetectionStrategy, Component, ContentChild, EventEmitter, forwardRef, Input, Optional, Output, TemplateRef, ViewEncapsulation } from '@angular/core';
import { NG_VALUE_ACCESSOR } from '@angular/forms';
import { Subject } from 'rxjs';
import { takeUntil } from 'rxjs/operators';
import { CandyDate } from 'ng-zorro-antd/core/time';
import { InputBoolean } from 'ng-zorro-antd/core/util';
import { LibPackerModule } from 'ng-zorro-antd/date-picker';
import { NzDateCellDirective as DateCell, NzDateFullCellDirective as DateFullCell, NzMonthCellDirective as MonthCell, NzMonthFullCellDirective as MonthFullCell } from './calendar-cells';
import { NzCalendarHeaderComponent } from './calendar-header.component';
import * as i0 from "@angular/core";
import * as i1 from "@angular/cdk/bidi";
import * as i2 from "ng-zorro-antd/date-picker";
export class NzCalendarComponent {
get dateCell() {
return (this.nzDateCell || this.nzDateCellChild);
}
get dateFullCell() {
return (this.nzDateFullCell || this.nzDateFullCellChild);
}
get monthCell() {
return (this.nzMonthCell || this.nzMonthCellChild);
}
get monthFullCell() {
return (this.nzMonthFullCell || this.nzMonthFullCellChild);
}
constructor(cdr, directionality) {
this.cdr = cdr;
this.directionality = directionality;
this.activeDate = new CandyDate();
this.prefixCls = 'ant-picker-calendar';
this.destroy$ = new Subject();
this.dir = 'ltr';
this.onChangeFn = () => { };
this.onTouchFn = () => { };
this.nzMode = 'month';
this.nzModeChange = new EventEmitter();
this.nzPanelChange = new EventEmitter();
this.nzSelectChange = new EventEmitter();
this.nzValueChange = new EventEmitter();
this.nzFullscreen = true;
}
ngOnInit() {
this.dir = this.directionality.value;
this.directionality.change?.pipe(takeUntil(this.destroy$)).subscribe(() => {
this.dir = this.directionality.value;
});
}
onModeChange(mode) {
this.nzModeChange.emit(mode);
this.nzPanelChange.emit({ date: this.activeDate.nativeDate, mode });
}
onYearSelect(year) {
const date = this.activeDate.setYear(year);
this.updateDate(date);
}
onMonthSelect(month) {
const date = this.activeDate.setMonth(month);
this.updateDate(date);
}
onDateSelect(date) {
// Only activeDate is enough in calendar
// this.value = date;
this.updateDate(date);
}
writeValue(value) {
this.updateDate(new CandyDate(value), false);
this.cdr.markForCheck();
}
registerOnChange(fn) {
this.onChangeFn = fn;
}
registerOnTouched(fn) {
this.onTouchFn = fn;
}
updateDate(date, touched = true) {
this.activeDate = date;
if (touched) {
this.onChangeFn(date.nativeDate);
this.onTouchFn();
this.nzSelectChange.emit(date.nativeDate);
this.nzValueChange.emit(date.nativeDate);
}
}
ngOnChanges(changes) {
if (changes.nzValue) {
this.updateDate(new CandyDate(this.nzValue), false);
}
}
ngOnDestroy() {
this.destroy$.next();
this.destroy$.complete();
}
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: NzCalendarComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1.Directionality, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.4", type: NzCalendarComponent, isStandalone: true, selector: "nz-calendar", inputs: { nzMode: "nzMode", nzValue: "nzValue", nzDisabledDate: "nzDisabledDate", nzDateCell: "nzDateCell", nzDateFullCell: "nzDateFullCell", nzMonthCell: "nzMonthCell", nzMonthFullCell: "nzMonthFullCell", nzCustomHeader: "nzCustomHeader", nzFullscreen: "nzFullscreen" }, outputs: { nzModeChange: "nzModeChange", nzPanelChange: "nzPanelChange", nzSelectChange: "nzSelectChange", nzValueChange: "nzValueChange" }, host: { properties: { "class.ant-picker-calendar-full": "nzFullscreen", "class.ant-picker-calendar-mini": "!nzFullscreen", "class.ant-picker-calendar-rtl": "dir === 'rtl'" }, classAttribute: "ant-picker-calendar" }, providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => NzCalendarComponent), multi: true }], queries: [{ propertyName: "nzDateCellChild", first: true, predicate: DateCell, descendants: true, read: TemplateRef }, { propertyName: "nzDateFullCellChild", first: true, predicate: DateFullCell, descendants: true, read: TemplateRef }, { propertyName: "nzMonthCellChild", first: true, predicate: MonthCell, descendants: true, read: TemplateRef }, { propertyName: "nzMonthFullCellChild", first: true, predicate: MonthFullCell, descendants: true, read: TemplateRef }], exportAs: ["nzCalendar"], usesOnChanges: true, ngImport: i0, template: `
<nz-calendar-header
[fullscreen]="nzFullscreen"
[activeDate]="activeDate"
[nzCustomHeader]="nzCustomHeader"
[(mode)]="nzMode"
(modeChange)="onModeChange($event)"
(yearChange)="onYearSelect($event)"
(monthChange)="onMonthSelect($event)"
></nz-calendar-header>
<div class="ant-picker-panel">
<div class="ant-picker-{{ nzMode === 'month' ? 'date' : 'month' }}-panel">
<div class="ant-picker-body">
(nzMode === 'month') {
<!-- TODO( ) [cellRender] [fullCellRender] -->
<date-table
[prefixCls]="prefixCls"
[value]="activeDate"
[activeDate]="activeDate"
[cellRender]="$any(dateCell)"
[fullCellRender]="$any(dateFullCell)"
[disabledDate]="nzDisabledDate"
(valueChange)="onDateSelect($event)"
></date-table>
} {
<month-table
[prefixCls]="prefixCls"
[value]="activeDate"
[activeDate]="activeDate"
[cellRender]="$any(monthCell)"
[fullCellRender]="$any(monthFullCell)"
(valueChange)="onDateSelect($event)"
></month-table>
}
</div>
</div>
</div>
`, isInline: true, dependencies: [{ kind: "component", type: NzCalendarHeaderComponent, selector: "nz-calendar-header", inputs: ["mode", "fullscreen", "activeDate", "nzCustomHeader"], outputs: ["modeChange", "yearChange", "monthChange"], exportAs: ["nzCalendarHeader"] }, { kind: "ngmodule", type: LibPackerModule }, { kind: "component", type: i2.ɵDateTableComponent, selector: "date-table", inputs: ["locale"], exportAs: ["dateTable"] }, { kind: "component", type: i2.ɵMonthTableComponent, selector: "month-table", exportAs: ["monthTable"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
}
__decorate([
InputBoolean()
], NzCalendarComponent.prototype, "nzFullscreen", void 0);
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: NzCalendarComponent, decorators: [{
type: Component,
args: [{
encapsulation: ViewEncapsulation.None,
changeDetection: ChangeDetectionStrategy.OnPush,
selector: 'nz-calendar',
exportAs: 'nzCalendar',
template: `
<nz-calendar-header
[fullscreen]="nzFullscreen"
[activeDate]="activeDate"
[nzCustomHeader]="nzCustomHeader"
[(mode)]="nzMode"
(modeChange)="onModeChange($event)"
(yearChange)="onYearSelect($event)"
(monthChange)="onMonthSelect($event)"
></nz-calendar-header>
<div class="ant-picker-panel">
<div class="ant-picker-{{ nzMode === 'month' ? 'date' : 'month' }}-panel">
<div class="ant-picker-body">
(nzMode === 'month') {
<!-- TODO( ) [cellRender] [fullCellRender] -->
<date-table
[prefixCls]="prefixCls"
[value]="activeDate"
[activeDate]="activeDate"
[cellRender]="$any(dateCell)"
[fullCellRender]="$any(dateFullCell)"
[disabledDate]="nzDisabledDate"
(valueChange)="onDateSelect($event)"
></date-table>
} {
<month-table
[prefixCls]="prefixCls"
[value]="activeDate"
[activeDate]="activeDate"
[cellRender]="$any(monthCell)"
[fullCellRender]="$any(monthFullCell)"
(valueChange)="onDateSelect($event)"
></month-table>
}
</div>
</div>
</div>
`,
host: {
class: 'ant-picker-calendar',
'[class.ant-picker-calendar-full]': 'nzFullscreen',
'[class.ant-picker-calendar-mini]': '!nzFullscreen',
'[class.ant-picker-calendar-rtl]': `dir === 'rtl'`
},
providers: [{ provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => NzCalendarComponent), multi: true }],
imports: [NzCalendarHeaderComponent, LibPackerModule],
standalone: true
}]
}], ctorParameters: () => [{ type: i0.ChangeDetectorRef }, { type: i1.Directionality, decorators: [{
type: Optional
}] }], propDecorators: { nzMode: [{
type: Input
}], nzValue: [{
type: Input
}], nzDisabledDate: [{
type: Input
}], nzModeChange: [{
type: Output
}], nzPanelChange: [{
type: Output
}], nzSelectChange: [{
type: Output
}], nzValueChange: [{
type: Output
}], nzDateCell: [{
type: Input
}], nzDateCellChild: [{
type: ContentChild,
args: [DateCell, { static: false, read: TemplateRef }]
}], nzDateFullCell: [{
type: Input
}], nzDateFullCellChild: [{
type: ContentChild,
args: [DateFullCell, { static: false, read: TemplateRef }]
}], nzMonthCell: [{
type: Input
}], nzMonthCellChild: [{
type: ContentChild,
args: [MonthCell, { static: false, read: TemplateRef }]
}], nzMonthFullCell: [{
type: Input
}], nzMonthFullCellChild: [{
type: ContentChild,
args: [MonthFullCell, { static: false, read: TemplateRef }]
}], nzCustomHeader: [{
type: Input
}], nzFullscreen: [{
type: Input
}] } });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2FsZW5kYXIuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vY29tcG9uZW50cy9jYWxlbmRhci9jYWxlbmRhci5jb21wb25lbnQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQU1BLE9BQU8sRUFDTCx1QkFBdUIsRUFFdkIsU0FBUyxFQUNULFlBQVksRUFDWixZQUFZLEVBQ1osVUFBVSxFQUNWLEtBQUssRUFJTCxRQUFRLEVBQ1IsTUFBTSxFQUVOLFdBQVcsRUFDWCxpQkFBaUIsRUFDbEIsTUFBTSxlQUFlLENBQUM7QUFDdkIsT0FBTyxFQUF3QixpQkFBaUIsRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBQ3pFLE9BQU8sRUFBRSxPQUFPLEVBQUUsTUFBTSxNQUFNLENBQUM7QUFDL0IsT0FBTyxFQUFFLFNBQVMsRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBRTNDLE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSx5QkFBeUIsQ0FBQztBQUVwRCxPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0seUJBQXlCLENBQUM7QUFDdkQsT0FBTyxFQUFFLGV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gICAgICAgICAgIDwhLS0gIFRPRE8oQHdlbnFpNzMpIFtjZWxsUmVuZGVyXSBbZnVsbENlbGxSZW5kZXJdIC0tPlxuICAgICAgICAgICAgPGRhdGUtdGFibGVcbiAgICAgICAgICAgICAgW3ByZWZpeENsc109XCJwcmVmaXhDbHNcIlxuICAgICAgICAgICAgICBbdmFsdWVdPVwiYWN0aXZlRGF0ZVwiXG4gICAgICAgICAgICAgIFthY3RpdmVEYXRlXT1cImFjdGl2ZURhdGVcIlxuICAgICAgICAgICAgICBbY2VsbFJlbmRlcl09XCIkYW55KGRhdGVDZWxsKVwiXG4gICAgICAgICAgICAgIFtmdWxsQ2VsbFJlbmRlcl09XCIkYW55KGRhdGVGdWxsQ2VsbClcIlxuICAgICAgICAgICAgICBbZGlzYWJsZWREYXRlXT1cIm56RGlzYWJsZWREYXRlXCJcbiAgICAgICAgICAgICAgKHZhbHVlQ2hhbmdlKT1cIm9uRGF0ZVNlbGVjdCgkZXZlbnQpXCJcbiAgICAgICAgICAgID48L2RhdGUtdGFibGU+XG4gICAgICAgICAgfSBAZWxzZSB7XG4gICAgICAgICAgICA8bW9udGgtdGFibGVcbiAgICAgICAgICAgICAgW3ByZWZpeENsc109XCJwcmVmaXhDbHNcIlxuICAgICAgICAgICAgICBbdmFsdWVdPVwiYWN0aXZlRGF0ZVwiXG4gICAgICAgICAgICAgIFthY3RpdmVEYXRlXT1cImFjdGl2ZURhdGVcIlxuICAgICAgICAgICAgICBbY2VsbFJlbmRlcl09XCIkYW55KG1vbnRoQ2VsbClcIlxuICAgICAgICAgICAgICBbZnVsbENlbGxSZW5kZXJdPVwiJGFueShtb250aEZ1bGxDZWxsKVwiXG4gICAgICAgICAgICAgICh2YWx1ZUNoYW5nZSk9XCJvbkRhdGVTZWxlY3QoJGV2ZW50KVwiXG4gICAgICAgICAgICA+PC9tb250aC10YWJsZT5cbiAgICAgICAgICB9XG4gICAgICAgIDwvZGl2PlxuICAgICAgPC9kaXY+XG4gICAgPC9kaX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