UNPKG

ng-zorro-antd

Version:

An enterprise-class UI components based on Ant Design and Angular

814 lines (805 loc) 36.9 kB
(function (global, factory) { typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/core'), require('@angular/forms'), require('ng-zorro-antd/i18n'), require('ng-zorro-antd/radio'), require('ng-zorro-antd/select'), require('date-fns/set_month'), require('@angular/cdk/coercion'), require('date-fns/add_days'), require('date-fns/difference_in_calendar_days'), require('date-fns/difference_in_calendar_months'), require('date-fns/difference_in_calendar_weeks'), require('date-fns/end_of_month'), require('date-fns/is_same_day'), require('date-fns/is_same_month'), require('date-fns/is_same_year'), require('date-fns/is_this_month'), require('date-fns/is_this_year'), require('date-fns/set_year'), require('date-fns/start_of_month'), require('date-fns/start_of_week'), require('date-fns/start_of_year')) : typeof define === 'function' && define.amd ? define('ng-zorro-antd/calendar', ['exports', '@angular/common', '@angular/core', '@angular/forms', 'ng-zorro-antd/i18n', 'ng-zorro-antd/radio', 'ng-zorro-antd/select', 'date-fns/set_month', '@angular/cdk/coercion', 'date-fns/add_days', 'date-fns/difference_in_calendar_days', 'date-fns/difference_in_calendar_months', 'date-fns/difference_in_calendar_weeks', 'date-fns/end_of_month', 'date-fns/is_same_day', 'date-fns/is_same_month', 'date-fns/is_same_year', 'date-fns/is_this_month', 'date-fns/is_this_year', 'date-fns/set_year', 'date-fns/start_of_month', 'date-fns/start_of_week', 'date-fns/start_of_year'], factory) : (global = global || self, factory((global['ng-zorro-antd'] = global['ng-zorro-antd'] || {}, global['ng-zorro-antd'].calendar = {}), global.ng.common, global.ng.core, global.ng.forms, global['ng-zorro-antd'].i18n, global['ng-zorro-antd'].radio, global['ng-zorro-antd'].select, global.setMonth, global.ng.cdk.coercion, global.addDays, global.differenceInCalendarDays, global.differenceInCalendarMonths, global.differenceInCalendarWeeks, global.endOfMonth, global.isSameDay, global.isSameMonth, global.isSameYear, global.isThisMonth, global.isThisYear, global.setYear, global.startOfMonth, global.startOfWeek, global.startOfYear)); }(this, function (exports, common, core, forms, i18n, radio, select, setMonth, coercion, addDays, differenceInCalendarDays, differenceInCalendarMonths, differenceInCalendarWeeks, endOfMonth, isSameDay, isSameMonth, isSameYear, isThisMonth, isThisYear, setYear, startOfMonth, startOfWeek, startOfYear) { 'use strict'; setMonth = setMonth && setMonth.hasOwnProperty('default') ? setMonth['default'] : setMonth; addDays = addDays && addDays.hasOwnProperty('default') ? addDays['default'] : addDays; differenceInCalendarDays = differenceInCalendarDays && differenceInCalendarDays.hasOwnProperty('default') ? differenceInCalendarDays['default'] : differenceInCalendarDays; differenceInCalendarMonths = differenceInCalendarMonths && differenceInCalendarMonths.hasOwnProperty('default') ? differenceInCalendarMonths['default'] : differenceInCalendarMonths; differenceInCalendarWeeks = differenceInCalendarWeeks && differenceInCalendarWeeks.hasOwnProperty('default') ? differenceInCalendarWeeks['default'] : differenceInCalendarWeeks; endOfMonth = endOfMonth && endOfMonth.hasOwnProperty('default') ? endOfMonth['default'] : endOfMonth; isSameDay = isSameDay && isSameDay.hasOwnProperty('default') ? isSameDay['default'] : isSameDay; isSameMonth = isSameMonth && isSameMonth.hasOwnProperty('default') ? isSameMonth['default'] : isSameMonth; isSameYear = isSameYear && isSameYear.hasOwnProperty('default') ? isSameYear['default'] : isSameYear; isThisMonth = isThisMonth && isThisMonth.hasOwnProperty('default') ? isThisMonth['default'] : isThisMonth; isThisYear = isThisYear && isThisYear.hasOwnProperty('default') ? isThisYear['default'] : isThisYear; setYear = setYear && setYear.hasOwnProperty('default') ? setYear['default'] : setYear; startOfMonth = startOfMonth && startOfMonth.hasOwnProperty('default') ? startOfMonth['default'] : startOfMonth; startOfWeek = startOfWeek && startOfWeek.hasOwnProperty('default') ? startOfWeek['default'] : startOfWeek; startOfYear = startOfYear && startOfYear.hasOwnProperty('default') ? startOfYear['default'] : startOfYear; /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ var NzDateCellDirective = /** @class */ (function () { function NzDateCellDirective() { } NzDateCellDirective.decorators = [ { type: core.Directive, args: [{ selector: '[nzDateCell]', exportAs: 'nzDateCell' },] } ]; return NzDateCellDirective; }()); var NzMonthCellDirective = /** @class */ (function () { function NzMonthCellDirective() { } NzMonthCellDirective.decorators = [ { type: core.Directive, args: [{ selector: '[nzMonthCell]', exportAs: 'nzMonthCell' },] } ]; return NzMonthCellDirective; }()); var NzDateFullCellDirective = /** @class */ (function () { function NzDateFullCellDirective() { } NzDateFullCellDirective.decorators = [ { type: core.Directive, args: [{ selector: '[nzDateFullCell]', exportAs: 'nzDateFullCell' },] } ]; return NzDateFullCellDirective; }()); var NzMonthFullCellDirective = /** @class */ (function () { function NzMonthFullCellDirective() { } NzMonthFullCellDirective.decorators = [ { type: core.Directive, args: [{ selector: '[nzMonthFullCell]', exportAs: 'nzMonthFullCell' },] } ]; return NzMonthFullCellDirective; }()); /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ var NzCalendarHeaderComponent = /** @class */ (function () { function NzCalendarHeaderComponent(i18n, dateHelper) { this.i18n = i18n; this.dateHelper = dateHelper; this.mode = 'month'; this.modeChange = new core.EventEmitter(); this.fullscreen = true; this.yearChange = new core.EventEmitter(); this.monthChange = new core.EventEmitter(); this._activeDate = new Date(); this.yearOffset = 10; this.yearTotal = 20; } Object.defineProperty(NzCalendarHeaderComponent.prototype, "activeDate", { get: /** * @return {?} */ function () { return this._activeDate; }, set: /** * @param {?} value * @return {?} */ function (value) { this._activeDate = value; this.setUpYears(); }, enumerable: true, configurable: true }); Object.defineProperty(NzCalendarHeaderComponent.prototype, "activeYear", { get: /** * @return {?} */ function () { return this.activeDate.getFullYear(); }, enumerable: true, configurable: true }); Object.defineProperty(NzCalendarHeaderComponent.prototype, "activeMonth", { get: /** * @return {?} */ function () { return this.activeDate.getMonth(); }, enumerable: true, configurable: true }); Object.defineProperty(NzCalendarHeaderComponent.prototype, "size", { get: /** * @return {?} */ function () { return this.fullscreen ? 'default' : 'small'; }, enumerable: true, configurable: true }); Object.defineProperty(NzCalendarHeaderComponent.prototype, "yearTypeText", { get: /** * @return {?} */ function () { return this.i18n.getLocale().Calendar.year; }, enumerable: true, configurable: true }); Object.defineProperty(NzCalendarHeaderComponent.prototype, "monthTypeText", { get: /** * @return {?} */ function () { return this.i18n.getLocale().Calendar.month; }, enumerable: true, configurable: true }); /** * @return {?} */ NzCalendarHeaderComponent.prototype.ngOnInit = /** * @return {?} */ function () { this.setUpYears(); this.setUpMonths(); }; /** * @param {?} year * @return {?} */ NzCalendarHeaderComponent.prototype.updateYear = /** * @param {?} year * @return {?} */ function (year) { this.yearChange.emit(year); this.setUpYears(year); }; /** * @private * @param {?=} year * @return {?} */ NzCalendarHeaderComponent.prototype.setUpYears = /** * @private * @param {?=} year * @return {?} */ function (year) { /** @type {?} */ var start = (year || this.activeYear) - this.yearOffset; /** @type {?} */ var end = start + this.yearTotal; this.years = []; for (var i = start; i < end; i++) { this.years.push({ label: "" + i, value: i }); } }; /** * @private * @return {?} */ NzCalendarHeaderComponent.prototype.setUpMonths = /** * @private * @return {?} */ function () { this.months = []; for (var i = 0; i < 12; i++) { /** @type {?} */ var dateInMonth = setMonth(this.activeDate, i); /** @type {?} */ var monthText = this.dateHelper.format(dateInMonth, 'MMM'); this.months.push({ label: monthText, value: i }); } }; NzCalendarHeaderComponent.decorators = [ { type: core.Component, args: [{ encapsulation: core.ViewEncapsulation.None, changeDetection: core.ChangeDetectionStrategy.OnPush, selector: 'nz-calendar-header', exportAs: 'nzCalendarHeader', template: "<nz-select class=\"ant-fullcalendar-year-select\" [nzSize]=\"size\" [nzDropdownMatchSelectWidth]=\"false\"\n [ngModel]=\"activeYear\" (ngModelChange)=\"updateYear($event)\">\n <nz-option *ngFor=\"let year of years\" [nzLabel]=\"year.label\" [nzValue]=\"year.value\"></nz-option>\n</nz-select>\n\n<nz-select *ngIf=\"mode === 'month'\" class=\"ant-fullcalendar-month-select\" [nzSize]=\"size\" [nzDropdownMatchSelectWidth]=\"false\"\n [ngModel]=\"activeMonth\" (ngModelChange)=\"monthChange.emit($event)\">\n <nz-option *ngFor=\"let month of months\" [nzLabel]=\"month.label\" [nzValue]=\"month.value\"></nz-option>\n</nz-select>\n\n<nz-radio-group [(ngModel)]=\"mode\" (ngModelChange)=\"modeChange.emit($event)\" [nzSize]=\"size\">\n <label nz-radio-button nzValue=\"month\">{{ monthTypeText }}</label>\n <label nz-radio-button nzValue=\"year\">{{ yearTypeText }}</label>\n</nz-radio-group>\n", host: { '[style.display]': "'block'", '[class.ant-fullcalendar-header]': "true" } }] } ]; /** @nocollapse */ NzCalendarHeaderComponent.ctorParameters = function () { return [ { type: i18n.NzI18nService }, { type: i18n.DateHelperService } ]; }; NzCalendarHeaderComponent.propDecorators = { mode: [{ type: core.Input }], modeChange: [{ type: core.Output }], fullscreen: [{ type: core.Input }], activeDate: [{ type: core.Input }], yearChange: [{ type: core.Output }], monthChange: [{ type: core.Output }] }; return NzCalendarHeaderComponent; }()); /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ var NzCalendarComponent = /** @class */ (function () { function NzCalendarComponent(i18n, cdr, dateHelper) { this.i18n = i18n; this.cdr = cdr; this.dateHelper = dateHelper; this.nzMode = 'month'; this.nzModeChange = new core.EventEmitter(); this.nzPanelChange = new core.EventEmitter(); this.nzSelectChange = new core.EventEmitter(); this.nzValueChange = new core.EventEmitter(); this.fullscreen = true; this.daysInWeek = []; this.monthsInYear = []; this.dateMatrix = []; this.activeDate = new Date(); this.currentDateRow = -1; this.currentDateCol = -1; this.activeDateRow = -1; this.activeDateCol = -1; this.currentMonthRow = -1; this.currentMonthCol = -1; this.activeMonthRow = -1; this.activeMonthCol = -1; this.dateCell = null; this.dateFullCell = null; this.monthCell = null; this.monthFullCell = null; this.currentDate = new Date(); this.onChangeFn = (/** * @return {?} */ function () { }); this.onTouchFn = (/** * @return {?} */ function () { }); } Object.defineProperty(NzCalendarComponent.prototype, "nzValue", { set: /** * @param {?} value * @return {?} */ function (value) { this.updateDate(value, false); }, enumerable: true, configurable: true }); Object.defineProperty(NzCalendarComponent.prototype, "nzDateCell", { set: /** * @param {?} value * @return {?} */ function (value) { this.dateCell = value; }, enumerable: true, configurable: true }); Object.defineProperty(NzCalendarComponent.prototype, "nzDateFullCell", { set: /** * @param {?} value * @return {?} */ function (value) { this.dateFullCell = value; }, enumerable: true, configurable: true }); Object.defineProperty(NzCalendarComponent.prototype, "nzMonthCell", { set: /** * @param {?} value * @return {?} */ function (value) { this.monthCell = value; }, enumerable: true, configurable: true }); Object.defineProperty(NzCalendarComponent.prototype, "nzMonthFullCell", { set: /** * @param {?} value * @return {?} */ function (value) { this.monthFullCell = value; }, enumerable: true, configurable: true }); Object.defineProperty(NzCalendarComponent.prototype, "nzFullscreen", { get: /** * @return {?} */ function () { return this.fullscreen; }, set: /** * @param {?} value * @return {?} */ function (value) { this.fullscreen = coercion.coerceBooleanProperty(value); }, enumerable: true, configurable: true }); Object.defineProperty(NzCalendarComponent.prototype, "nzCard", { get: /** * @return {?} */ function () { return !this.fullscreen; }, set: /** * @param {?} value * @return {?} */ function (value) { this.fullscreen = !coercion.coerceBooleanProperty(value); }, enumerable: true, configurable: true }); Object.defineProperty(NzCalendarComponent.prototype, "dateCellChild", { set: /** * @param {?} value * @return {?} */ function (value) { if (value) { this.dateCell = value; } }, enumerable: true, configurable: true }); Object.defineProperty(NzCalendarComponent.prototype, "dateFullCellChild", { set: /** * @param {?} value * @return {?} */ function (value) { if (value) { this.dateFullCell = value; } }, enumerable: true, configurable: true }); Object.defineProperty(NzCalendarComponent.prototype, "monthCellChild", { set: /** * @param {?} value * @return {?} */ function (value) { if (value) { this.monthCell = value; } }, enumerable: true, configurable: true }); Object.defineProperty(NzCalendarComponent.prototype, "monthFullCellChild", { set: /** * @param {?} value * @return {?} */ function (value) { if (value) { this.monthFullCell = value; } }, enumerable: true, configurable: true }); Object.defineProperty(NzCalendarComponent.prototype, "calendarStart", { get: /** * @private * @return {?} */ function () { return startOfWeek(startOfMonth(this.activeDate), { weekStartsOn: this.dateHelper.getFirstDayOfWeek() }); }, enumerable: true, configurable: true }); /** * @return {?} */ NzCalendarComponent.prototype.ngOnInit = /** * @return {?} */ function () { this.setUpDaysInWeek(); this.setUpMonthsInYear(); this.setUpDateMatrix(); this.calculateCurrentDate(); this.calculateActiveDate(); this.calculateCurrentMonth(); this.calculateActiveMonth(); }; /** * @param {?} mode * @return {?} */ NzCalendarComponent.prototype.onModeChange = /** * @param {?} mode * @return {?} */ function (mode) { this.nzModeChange.emit(mode); this.nzPanelChange.emit({ date: this.activeDate, mode: mode }); }; /** * @param {?} date * @return {?} */ NzCalendarComponent.prototype.onDateSelect = /** * @param {?} date * @return {?} */ function (date) { this.updateDate(date); this.nzSelectChange.emit(date); }; /** * @param {?} year * @return {?} */ NzCalendarComponent.prototype.onYearSelect = /** * @param {?} year * @return {?} */ function (year) { /** @type {?} */ var date = setYear(this.activeDate, year); this.updateDate(date); this.nzSelectChange.emit(date); }; /** * @param {?} month * @return {?} */ NzCalendarComponent.prototype.onMonthSelect = /** * @param {?} month * @return {?} */ function (month) { /** @type {?} */ var date = setMonth(this.activeDate, month); this.updateDate(date); this.nzSelectChange.emit(date); }; /** * @param {?} value * @return {?} */ NzCalendarComponent.prototype.writeValue = /** * @param {?} value * @return {?} */ function (value) { this.updateDate(value || new Date(), false); this.cdr.markForCheck(); }; /** * @param {?} fn * @return {?} */ NzCalendarComponent.prototype.registerOnChange = /** * @param {?} fn * @return {?} */ function (fn) { this.onChangeFn = fn; }; /** * @param {?} fn * @return {?} */ NzCalendarComponent.prototype.registerOnTouched = /** * @param {?} fn * @return {?} */ function (fn) { this.onTouchFn = fn; }; /** * @private * @param {?} date * @param {?=} touched * @return {?} */ NzCalendarComponent.prototype.updateDate = /** * @private * @param {?} date * @param {?=} touched * @return {?} */ function (date, touched) { if (touched === void 0) { touched = true; } /** @type {?} */ var dayChanged = !isSameDay(date, this.activeDate); /** @type {?} */ var monthChanged = !isSameMonth(date, this.activeDate); /** @type {?} */ var yearChanged = !isSameYear(date, this.activeDate); this.activeDate = date; if (dayChanged) { this.calculateActiveDate(); } if (monthChanged) { this.setUpDateMatrix(); this.calculateCurrentDate(); this.calculateActiveMonth(); } if (yearChanged) { this.calculateCurrentMonth(); } if (touched) { this.onChangeFn(date); this.onTouchFn(); this.nzValueChange.emit(date); } }; /** * @private * @return {?} */ NzCalendarComponent.prototype.setUpDaysInWeek = /** * @private * @return {?} */ function () { this.daysInWeek = []; /** @type {?} */ var weekStart = startOfWeek(this.activeDate, { weekStartsOn: this.dateHelper.getFirstDayOfWeek() }); for (var i = 0; i < 7; i++) { /** @type {?} */ var date = addDays(weekStart, i); /** @type {?} */ var title = this.dateHelper.format(date, this.dateHelper.relyOnDatePipe ? 'E' : 'ddd'); /** @type {?} */ var label = this.dateHelper.format(date, this.dateHelper.relyOnDatePipe ? 'EEEEEE' : 'dd'); this.daysInWeek.push({ title: title, label: label }); } }; /** * @private * @return {?} */ NzCalendarComponent.prototype.setUpMonthsInYear = /** * @private * @return {?} */ function () { this.monthsInYear = []; for (var i = 0; i < 12; i++) { /** @type {?} */ var date = setMonth(this.activeDate, i); /** @type {?} */ var title = this.dateHelper.format(date, 'MMM'); /** @type {?} */ var label = this.dateHelper.format(date, 'MMM'); /** @type {?} */ var start = startOfMonth(date); this.monthsInYear.push({ title: title, label: label, start: start }); } }; /** * @private * @return {?} */ NzCalendarComponent.prototype.setUpDateMatrix = /** * @private * @return {?} */ function () { this.dateMatrix = []; /** @type {?} */ var monthStart = startOfMonth(this.activeDate); /** @type {?} */ var monthEnd = endOfMonth(this.activeDate); /** @type {?} */ var weekDiff = differenceInCalendarWeeks(monthEnd, monthStart, { weekStartsOn: this.dateHelper.getFirstDayOfWeek() }) + 2; for (var week = 0; week < weekDiff; week++) { /** @type {?} */ var row = []; /** @type {?} */ var weekStart = addDays(this.calendarStart, week * 7); for (var day = 0; day < 7; day++) { /** @type {?} */ var date = addDays(weekStart, day); /** @type {?} */ var monthDiff = differenceInCalendarMonths(date, this.activeDate); /** @type {?} */ var dateFormat = this.dateHelper.relyOnDatePipe ? 'longDate' : this.i18n.getLocaleData('DatePicker.lang.dateFormat', 'YYYY-MM-DD'); /** @type {?} */ var title = this.dateHelper.format(date, dateFormat); /** @type {?} */ var label = this.dateHelper.format(date, this.dateHelper.relyOnDatePipe ? 'dd' : 'DD'); /** @type {?} */ var rel = monthDiff === 0 ? 'current' : monthDiff < 0 ? 'last' : 'next'; row.push({ title: title, label: label, rel: rel, value: date }); } this.dateMatrix.push(row); } }; /** * @private * @return {?} */ NzCalendarComponent.prototype.calculateCurrentDate = /** * @private * @return {?} */ function () { if (isThisMonth(this.activeDate)) { this.currentDateRow = differenceInCalendarWeeks(this.currentDate, this.calendarStart, { weekStartsOn: this.dateHelper.getFirstDayOfWeek() }); this.currentDateCol = differenceInCalendarDays(this.currentDate, addDays(this.calendarStart, this.currentDateRow * 7)); } else { this.currentDateRow = -1; this.currentDateCol = -1; } }; /** * @private * @return {?} */ NzCalendarComponent.prototype.calculateActiveDate = /** * @private * @return {?} */ function () { this.activeDateRow = differenceInCalendarWeeks(this.activeDate, this.calendarStart, { weekStartsOn: this.dateHelper.getFirstDayOfWeek() }); this.activeDateCol = differenceInCalendarDays(this.activeDate, addDays(this.calendarStart, this.activeDateRow * 7)); }; /** * @private * @return {?} */ NzCalendarComponent.prototype.calculateCurrentMonth = /** * @private * @return {?} */ function () { if (isThisYear(this.activeDate)) { /** @type {?} */ var yearStart = startOfYear(this.currentDate); /** @type {?} */ var monthDiff = differenceInCalendarMonths(this.currentDate, yearStart); this.currentMonthRow = Math.floor(monthDiff / 3); this.currentMonthCol = monthDiff % 3; } else { this.currentMonthRow = -1; this.currentMonthCol = -1; } }; /** * @private * @return {?} */ NzCalendarComponent.prototype.calculateActiveMonth = /** * @private * @return {?} */ function () { this.activeMonthRow = Math.floor(this.activeDate.getMonth() / 3); this.activeMonthCol = this.activeDate.getMonth() % 3; }; NzCalendarComponent.decorators = [ { type: core.Component, args: [{ encapsulation: core.ViewEncapsulation.None, changeDetection: core.ChangeDetectionStrategy.OnPush, selector: 'nz-calendar', exportAs: 'nzCalendar', template: "<nz-calendar-header [fullscreen]=\"fullscreen\" [activeDate]=\"activeDate\"\n [(mode)]=\"nzMode\" (modeChange)=\"onModeChange($event)\"\n (yearChange)=\"onYearSelect($event)\" (monthChange)=\"onMonthSelect($event)\">\n</nz-calendar-header>\n\n<div class=\"ant-fullcalendar ant-fullcalendar-full\" [ngClass]=\"fullscreen ? 'ant-fullcalendar-fullscreen' : ''\">\n <div class=\"ant-fullcalendar-calendar-body\">\n <ng-container *ngIf=\"nzMode === 'month' then monthModeTable else yearModeTable\"></ng-container>\n </div>\n</div>\n\n<ng-template #monthModeTable>\n <table class=\"ant-fullcalendar-table\" cellspacing=\"0\" role=\"grid\">\n <thead>\n <tr role=\"row\">\n <th *ngFor=\"let day of daysInWeek\" class=\"ant-fullcalendar-column-header\" role=\"columnheader\" [title]=\"day.title\">\n <span class=\"ant-fullcalendar-column-header-inner\">{{ day.label }}</span>\n </th>\n </tr>\n </thead>\n <tbody class=\"ant-fullcalendar-tbody\">\n <tr *ngFor=\"let week of dateMatrix; index as row\"\n [class.ant-fullcalendar-current-week]=\"row === currentDateRow\"\n [class.ant-fullcalendar-active-week]=\"row === activeDateRow\">\n <td *ngFor=\"let day of week; index as col\" role=\"gridcell\" class=\"ant-fullcalendar-cell\" [title]=\"day.title\"\n [class.ant-fullcalendar-today]=\"row === currentDateRow && col === currentDateCol\"\n [class.ant-fullcalendar-selected-day]=\"row === activeDateRow && col === activeDateCol\"\n [class.ant-fullcalendar-last-month-cell]=\"day.rel === 'last'\"\n [class.ant-fullcalendar-next-month-btn-day]=\"day.rel === 'next'\"\n (click)=\"onDateSelect(day.value)\">\n <div class=\"ant-fullcalendar-date\">\n <ng-container *ngIf=\"dateFullCell else defaultCell\">\n <ng-container *ngTemplateOutlet=\"dateFullCell; context: {$implicit: day.value}\"></ng-container>\n </ng-container>\n <ng-template #defaultCell>\n <div class=\"ant-fullcalendar-value\">{{ day.label }}</div>\n <div *ngIf=\"dateCell\" class=\"ant-fullcalendar-content\">\n <ng-container *ngTemplateOutlet=\"dateCell; context: {$implicit: day.value}\"></ng-container>\n </div>\n </ng-template>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n</ng-template>\n\n<ng-template #yearModeTable>\n <table class=\"ant-fullcalendar-month-panel-table\" cellspacing=\"0\" role=\"grid\">\n <tbody class=\"ant-fullcalendar-month-panel-tbody\">\n <tr *ngFor=\"let row of [0, 1, 2, 3]\" role=\"row\">\n <td *ngFor=\"let col of [0, 1, 2]\" role=\"gridcell\" [title]=\"monthsInYear[row * 3 + col].title\"\n class=\"ant-fullcalendar-month-panel-cell\"\n [class.ant-fullcalendar-month-panel-current-cell]=\"row === currentMonthRow && col === currentMonthCol\"\n [class.ant-fullcalendar-month-panel-selected-cell]=\"row === activeMonthRow && col === activeMonthCol\"\n (click)=\"onMonthSelect(row * 3 + col)\">\n <div class=\"ant-fullcalendar-month\">\n <ng-container *ngIf=\"monthFullCell else defaultCell\">\n <ng-container *ngTemplateOutlet=\"monthFullCell; context: {$implicit: monthsInYear[row * 3 + col].start}\"></ng-container>\n </ng-container>\n <ng-template #defaultCell>\n <div class=\"ant-fullcalendar-value\">{{ monthsInYear[row * 3 + col].label }}</div>\n <div *ngIf=\"monthCell\" class=\"ant-fullcalendar-content\">\n <ng-container *ngTemplateOutlet=\"monthCell; context: {$implicit: monthsInYear[row * 3 + col].start}\"></ng-container>\n </div>\n </ng-template>\n </div>\n </td>\n </tr>\n </tbody>\n </table>\n</ng-template>\n", providers: [{ provide: forms.NG_VALUE_ACCESSOR, useExisting: core.forwardRef((/** * @return {?} */ function () { return NzCalendarComponent; })), multi: true }] }] } ]; /** @nocollapse */ NzCalendarComponent.ctorParameters = function () { return [ { type: i18n.NzI18nService }, { type: core.ChangeDetectorRef }, { type: i18n.DateHelperService } ]; }; NzCalendarComponent.propDecorators = { nzMode: [{ type: core.Input }], nzModeChange: [{ type: core.Output }], nzPanelChange: [{ type: core.Output }], nzSelectChange: [{ type: core.Output }], nzValue: [{ type: core.Input }], nzValueChange: [{ type: core.Output }], nzDateCell: [{ type: core.Input }], nzDateFullCell: [{ type: core.Input }], nzMonthCell: [{ type: core.Input }], nzMonthFullCell: [{ type: core.Input }], nzFullscreen: [{ type: core.Input }], nzCard: [{ type: core.Input }], dateCellChild: [{ type: core.ContentChild, args: [NzDateCellDirective, { static: false, read: core.TemplateRef },] }], dateFullCellChild: [{ type: core.ContentChild, args: [NzDateFullCellDirective, { static: false, read: core.TemplateRef },] }], monthCellChild: [{ type: core.ContentChild, args: [NzMonthCellDirective, { static: false, read: core.TemplateRef },] }], monthFullCellChild: [{ type: core.ContentChild, args: [NzMonthFullCellDirective, { static: false, read: core.TemplateRef },] }], fullscreen: [{ type: core.HostBinding, args: ['class.ant-fullcalendar--fullscreen',] }] }; return NzCalendarComponent; }()); /** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ var NzCalendarModule = /** @class */ (function () { function NzCalendarModule() { } NzCalendarModule.decorators = [ { type: core.NgModule, args: [{ declarations: [ NzCalendarHeaderComponent, NzCalendarComponent, NzDateCellDirective, NzDateFullCellDirective, NzMonthCellDirective, NzMonthFullCellDirective ], exports: [ NzCalendarComponent, NzDateCellDirective, NzDateFullCellDirective, NzMonthCellDirective, NzMonthFullCellDirective ], imports: [common.CommonModule, forms.FormsModule, i18n.NzI18nModule, radio.NzRadioModule, select.NzSelectModule] },] } ]; return NzCalendarModule; }()); exports.NzCalendarComponent = NzCalendarComponent; exports.NzCalendarHeaderComponent = NzCalendarHeaderComponent; exports.NzCalendarModule = NzCalendarModule; exports.NzDateCellDirective = NzDateCellDirective; exports.NzDateFullCellDirective = NzDateFullCellDirective; exports.NzMonthCellDirective = NzMonthCellDirective; exports.NzMonthFullCellDirective = NzMonthFullCellDirective; Object.defineProperty(exports, '__esModule', { value: true }); })); //# sourceMappingURL=ng-zorro-antd-calendar.umd.js.map