ng-zorro-antd
Version:
An enterprise-class UI components based on Ant Design and Angular
1 lines • 175 kB
Source Map (JSON)
{"version":3,"file":"ng-zorro-antd-date-picker.mjs","sources":["../../components/date-picker/util.ts","../../components/date-picker/lib/util.ts","../../components/date-picker/calendar-footer.component.ts","../../components/date-picker/date-picker.service.ts","../../components/date-picker/lib/abstract-panel-header.ts","../../components/date-picker/lib/decade-header.component.ts","../../components/date-picker/lib/abstract-panel-header.html","../../components/date-picker/lib/abstract-table.ts","../../components/date-picker/lib/decade-table.component.ts","../../components/date-picker/lib/abstract-table.html","../../components/date-picker/lib/year-header.component.ts","../../components/date-picker/lib/year-table.component.ts","../../components/date-picker/lib/month-header.component.ts","../../components/date-picker/lib/month-table.component.ts","../../components/date-picker/lib/date-header.component.ts","../../components/date-picker/lib/date-table.component.ts","../../components/date-picker/inner-popup.component.ts","../../components/date-picker/date-range-popup.component.ts","../../components/date-picker/date-picker.component.ts","../../components/date-picker/lib/lib-packer.module.ts","../../components/date-picker/month-picker.component.ts","../../components/date-picker/range-picker.component.ts","../../components/date-picker/week-picker.component.ts","../../components/date-picker/year-picker.component.ts","../../components/date-picker/date-picker.module.ts","../../components/date-picker/lib/public-api.ts","../../components/date-picker/public-api.ts","../../components/date-picker/ng-zorro-antd-date-picker.ts"],"sourcesContent":["/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { CandyDate } from 'ng-zorro-antd/core/time';\n\nimport { DisabledDateFn, DisabledTimeConfig, DisabledTimeFn } from './standard-types';\n\nexport const PREFIX_CLASS = 'ant-picker';\n\nconst defaultDisabledTime: DisabledTimeConfig = {\n nzDisabledHours(): number[] {\n return [];\n },\n nzDisabledMinutes(): number[] {\n return [];\n },\n nzDisabledSeconds(): number[] {\n return [];\n }\n};\n\nexport function getTimeConfig(value: CandyDate, disabledTime?: DisabledTimeFn): DisabledTimeConfig {\n let disabledTimeConfig = disabledTime ? disabledTime(value && value.nativeDate) : ({} as DisabledTimeConfig);\n disabledTimeConfig = {\n ...defaultDisabledTime,\n ...disabledTimeConfig\n };\n return disabledTimeConfig;\n}\n\nexport function isTimeValidByConfig(value: CandyDate, disabledTimeConfig: DisabledTimeConfig): boolean {\n let invalidTime = false;\n if (value) {\n const hour = value.getHours();\n const minutes = value.getMinutes();\n const seconds = value.getSeconds();\n const disabledHours = disabledTimeConfig.nzDisabledHours();\n if (disabledHours.indexOf(hour) === -1) {\n const disabledMinutes = disabledTimeConfig.nzDisabledMinutes(hour);\n if (disabledMinutes.indexOf(minutes) === -1) {\n const disabledSeconds = disabledTimeConfig.nzDisabledSeconds(hour, minutes);\n invalidTime = disabledSeconds.indexOf(seconds) !== -1;\n } else {\n invalidTime = true;\n }\n } else {\n invalidTime = true;\n }\n }\n return !invalidTime;\n}\n\nexport function isTimeValid(value: CandyDate, disabledTime: DisabledTimeFn): boolean {\n const disabledTimeConfig = getTimeConfig(value, disabledTime);\n return isTimeValidByConfig(value, disabledTimeConfig);\n}\n\nexport function isAllowedDate(value: CandyDate, disabledDate?: DisabledDateFn, disabledTime?: DisabledTimeFn): boolean {\n if (!value) {\n return false;\n }\n if (disabledDate) {\n if (disabledDate(value.nativeDate)) {\n return false;\n }\n }\n if (disabledTime) {\n if (!isTimeValid(value, disabledTime)) {\n return false;\n }\n }\n return true;\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\n/**\n * Compatible translate the moment-like format pattern to angular's pattern\n * Why? For now, we need to support the existing language formats in AntD, and AntD uses the default temporal syntax.\n *\n * TODO: compare and complete all format patterns\n * Each format docs as below:\n *\n * @link https://momentjs.com/docs/#/displaying/format/\n * @link https://angular.io/api/common/DatePipe#description\n * @param format input format pattern\n */\nexport function transCompatFormat(format: string): string {\n return (\n format &&\n format\n .replace(/Y/g, 'y') // only support y, yy, yyy, yyyy\n .replace(/D/g, 'd')\n ); // d, dd represent of D, DD for momentjs, others are not support\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n OnChanges,\n Output,\n SimpleChanges,\n TemplateRef,\n ViewEncapsulation\n} from '@angular/core';\n\nimport { CandyDate } from 'ng-zorro-antd/core/time';\nimport { NzSafeAny } from 'ng-zorro-antd/core/types';\nimport { isNonEmptyString, isTemplateRef } from 'ng-zorro-antd/core/util';\nimport { DateHelperService, NzCalendarI18nInterface } from 'ng-zorro-antd/i18n';\n\nimport { transCompatFormat } from './lib/util';\nimport { PREFIX_CLASS } from './util';\n\n@Component({\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'calendar-footer',\n exportAs: 'calendarFooter',\n template: `\n <div class=\"{{ prefixCls }}-footer\">\n <div *ngIf=\"extraFooter\" class=\"{{ prefixCls }}-footer-extra\">\n <ng-container [ngSwitch]=\"true\">\n <ng-container *ngSwitchCase=\"isTemplateRef(extraFooter)\">\n <ng-container *ngTemplateOutlet=\"$any(extraFooter)\"></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"isNonEmptyString(extraFooter)\">\n <span [innerHTML]=\"extraFooter\"></span>\n </ng-container>\n </ng-container>\n </div>\n <a\n *ngIf=\"showToday\"\n class=\"{{ prefixCls }}-today-btn {{ isTodayDisabled ? prefixCls + '-today-btn-disabled' : '' }}\"\n role=\"button\"\n (click)=\"isTodayDisabled ? null : onClickToday()\"\n title=\"{{ todayTitle }}\"\n >\n {{ locale.today }}\n </a>\n <ul *ngIf=\"hasTimePicker || rangeQuickSelector\" class=\"{{ prefixCls }}-ranges\">\n <ng-container *ngTemplateOutlet=\"rangeQuickSelector\"></ng-container>\n <li *ngIf=\"showNow\" class=\"{{ prefixCls }}-now\">\n <a class=\"{{ prefixCls }}-now-btn\" (click)=\"isTodayDisabled ? null : onClickToday()\">\n {{ locale.now }}\n </a>\n </li>\n <li *ngIf=\"hasTimePicker\" class=\"{{ prefixCls }}-ok\">\n <button\n nz-button\n type=\"button\"\n nzType=\"primary\"\n nzSize=\"small\"\n [disabled]=\"okDisabled\"\n (click)=\"okDisabled ? null : clickOk.emit()\"\n >\n {{ locale.ok }}\n </button>\n </li>\n </ul>\n </div>\n `\n})\nexport class CalendarFooterComponent implements OnChanges {\n @Input() locale!: NzCalendarI18nInterface;\n @Input() showToday: boolean = false;\n @Input() showNow: boolean = false;\n @Input() hasTimePicker: boolean = false;\n @Input() isRange: boolean = false;\n\n @Input() okDisabled: boolean = false;\n @Input() disabledDate?: (d: Date) => boolean;\n @Input() extraFooter?: TemplateRef<void> | string;\n @Input() rangeQuickSelector: TemplateRef<NzSafeAny> | null = null;\n\n @Output() readonly clickOk = new EventEmitter<void>();\n @Output() readonly clickToday = new EventEmitter<CandyDate>();\n\n prefixCls: string = PREFIX_CLASS;\n isTemplateRef = isTemplateRef;\n isNonEmptyString = isNonEmptyString;\n isTodayDisabled: boolean = false;\n todayTitle: string = '';\n\n constructor(private dateHelper: DateHelperService) {}\n\n ngOnChanges(changes: SimpleChanges): void {\n const now: Date = new Date();\n if (changes.disabledDate) {\n this.isTodayDisabled = !!(this.disabledDate && this.disabledDate(now));\n }\n if (changes.locale) {\n // NOTE: Compat for DatePipe formatting rules\n const dateFormat: string = transCompatFormat(this.locale.dateFormat);\n this.todayTitle = this.dateHelper.format(now, dateFormat);\n }\n }\n\n onClickToday(): void {\n const now: CandyDate = new CandyDate();\n this.clickToday.emit(now.clone()); // To prevent the \"now\" being modified from outside, we use clone\n }\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { Injectable, OnDestroy } from '@angular/core';\nimport { ReplaySubject, Subject } from 'rxjs';\n\nimport { CandyDate, cloneDate, CompatibleValue, NormalizedMode, normalizeRangeValue } from 'ng-zorro-antd/core/time';\n\nimport { CompatibleDate, NzDateMode, RangePartType } from './standard-types';\n\n@Injectable()\nexport class DatePickerService implements OnDestroy {\n initialValue!: CompatibleValue;\n value!: CompatibleValue;\n activeDate?: CompatibleValue;\n activeInput: RangePartType = 'left';\n arrowLeft: number = 0;\n isRange = false;\n\n valueChange$ = new ReplaySubject<CompatibleValue>(1);\n emitValue$ = new Subject<void>();\n inputPartChange$ = new Subject<RangePartType>();\n\n initValue(reset: boolean = false): void {\n if (reset) {\n this.initialValue = this.isRange ? [] : null;\n }\n\n this.setValue(this.initialValue);\n }\n\n hasValue(value: CompatibleValue = this.value): boolean {\n if (Array.isArray(value)) {\n return !!value[0] || !!value[1];\n } else {\n return !!value;\n }\n }\n\n makeValue(value?: CompatibleDate): CompatibleValue {\n if (this.isRange) {\n return value ? (value as Date[]).map(val => new CandyDate(val)) : [];\n } else {\n return value ? new CandyDate(value as Date) : null;\n }\n }\n\n setActiveDate(value: CompatibleValue, hasTimePicker: boolean = false, mode: NormalizedMode = 'month'): void {\n const parentPanels: { [key in NzDateMode]?: NormalizedMode } = {\n date: 'month',\n month: 'year',\n year: 'decade'\n };\n if (this.isRange) {\n this.activeDate = normalizeRangeValue(value as CandyDate[], hasTimePicker, parentPanels[mode], this.activeInput);\n } else {\n this.activeDate = cloneDate(value);\n }\n }\n\n setValue(value: CompatibleValue): void {\n this.value = value;\n this.valueChange$.next(this.value);\n }\n\n getActiveIndex(part: RangePartType = this.activeInput): number {\n return { left: 0, right: 1 }[part];\n }\n\n ngOnDestroy(): void {\n this.valueChange$.complete();\n this.emitValue$.complete();\n this.inputPartChange$.complete();\n }\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { Directive, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChanges } from '@angular/core';\nimport { CandyDate } from 'ng-zorro-antd/core/time';\nimport { NzCalendarI18nInterface } from 'ng-zorro-antd/i18n';\nimport { NzDateMode } from '../standard-types';\nimport { PanelSelector } from './interface';\n\n@Directive()\n// eslint-disable-next-line @angular-eslint/directive-class-suffix\nexport abstract class AbstractPanelHeader implements OnInit, OnChanges {\n prefixCls: string = `ant-picker-header`;\n selectors: PanelSelector[] = [];\n\n @Input() value!: CandyDate;\n @Input() locale!: NzCalendarI18nInterface;\n @Input() showSuperPreBtn: boolean = true;\n @Input() showSuperNextBtn: boolean = true;\n @Input() showPreBtn: boolean = true;\n @Input() showNextBtn: boolean = true;\n\n @Output() readonly panelModeChange = new EventEmitter<NzDateMode>();\n @Output() readonly valueChange = new EventEmitter<CandyDate>();\n\n abstract getSelectors(): PanelSelector[];\n\n superPreviousTitle(): string {\n return this.locale.previousYear;\n }\n\n previousTitle(): string {\n return this.locale.previousMonth;\n }\n\n superNextTitle(): string {\n return this.locale.nextYear;\n }\n\n nextTitle(): string {\n return this.locale.nextMonth;\n }\n\n superPrevious(): void {\n this.changeValue(this.value.addYears(-1));\n }\n\n superNext(): void {\n this.changeValue(this.value.addYears(1));\n }\n\n previous(): void {\n this.changeValue(this.value.addMonths(-1));\n }\n\n next(): void {\n this.changeValue(this.value.addMonths(1));\n }\n\n changeValue(value: CandyDate): void {\n if (this.value !== value) {\n this.value = value;\n this.valueChange.emit(this.value);\n this.render();\n }\n }\n\n changeMode(mode: NzDateMode): void {\n this.panelModeChange.emit(mode);\n }\n\n private render(): void {\n if (this.value) {\n this.selectors = this.getSelectors();\n }\n }\n\n ngOnInit(): void {\n if (!this.value) {\n this.value = new CandyDate(); // Show today by default\n }\n this.selectors = this.getSelectors();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.value || changes.locale) {\n this.render();\n }\n }\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/core';\nimport { AbstractPanelHeader } from './abstract-panel-header';\nimport { PanelSelector } from './interface';\n\n@Component({\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'decade-header', // eslint-disable-line @angular-eslint/component-selector\n exportAs: 'decadeHeader',\n templateUrl: './abstract-panel-header.html'\n})\nexport class DecadeHeaderComponent extends AbstractPanelHeader {\n override previous(): void {}\n override next(): void {}\n\n get startYear(): number {\n return parseInt(`${this.value.getYear() / 100}`, 10) * 100;\n }\n\n get endYear(): number {\n return this.startYear + 99;\n }\n\n override superPrevious(): void {\n this.changeValue(this.value.addYears(-100));\n }\n\n override superNext(): void {\n this.changeValue(this.value.addYears(100));\n }\n\n getSelectors(): PanelSelector[] {\n return [\n {\n className: `${this.prefixCls}-decade-btn`,\n title: '',\n onClick: () => {\n // noop\n },\n label: `${this.startYear}-${this.endYear}`\n }\n ];\n }\n}\n","<div class=\"{{ prefixCls }}\">\n <button\n [style.visibility]=\"showSuperPreBtn ? 'visible' : 'hidden'\"\n class=\"{{ prefixCls }}-super-prev-btn\"\n role=\"button\"\n type=\"button\"\n tabindex=\"-1\"\n title=\"{{ superPreviousTitle() }}\"\n (click)=\"superPrevious()\"\n >\n <span class=\"ant-picker-super-prev-icon\"></span>\n </button>\n <button\n [style.visibility]=\"showPreBtn ? 'visible' : 'hidden'\"\n class=\"{{ prefixCls }}-prev-btn\"\n role=\"button\"\n type=\"button\"\n title=\"{{ previousTitle() }}\"\n tabindex=\"-1\"\n (click)=\"previous()\"\n >\n <span class=\"ant-picker-prev-icon\"></span>\n </button>\n\n <div class=\"{{ prefixCls }}-view\">\n <ng-container *ngFor=\"let selector of selectors\">\n <button\n class=\"{{ selector.className }}\"\n role=\"button\"\n type=\"button\"\n title=\"{{ selector.title || null }}\"\n (click)=\"selector.onClick()\"\n >\n {{ selector.label }}\n </button>\n </ng-container>\n </div>\n <button\n [style.visibility]=\"showNextBtn ? 'visible' : 'hidden'\"\n class=\"{{ prefixCls }}-next-btn\"\n role=\"button\"\n type=\"button\"\n tabindex=\"-1\"\n title=\"{{ nextTitle() }}\"\n (click)=\"next()\"\n >\n <span class=\"ant-picker-next-icon\"></span>\n </button>\n <button\n [style.visibility]=\"showSuperNextBtn ? 'visible' : 'hidden'\"\n class=\"{{ prefixCls }}-super-next-btn\"\n role=\"button\"\n type=\"button\"\n tabindex=\"-1\"\n title=\"{{ superNextTitle() }}\"\n (click)=\"superNext()\"\n >\n <span class=\"ant-picker-super-next-icon\"></span>\n </button>\n</div>\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { Directive, EventEmitter, Input, OnChanges, OnInit, Output, SimpleChange, SimpleChanges, TemplateRef } from '@angular/core';\nimport { CandyDate } from 'ng-zorro-antd/core/time';\nimport { FunctionProp, NzSafeAny } from 'ng-zorro-antd/core/types';\nimport { isNonEmptyString, isTemplateRef } from 'ng-zorro-antd/core/util';\nimport { NzCalendarI18nInterface } from 'ng-zorro-antd/i18n';\nimport { DateBodyRow, DateCell } from './interface';\n\n@Directive()\n// eslint-disable-next-line @angular-eslint/directive-class-suffix\nexport abstract class AbstractTable implements OnInit, OnChanges {\n isTemplateRef = isTemplateRef;\n isNonEmptyString = isNonEmptyString;\n headRow: DateCell[] = [];\n bodyRows: DateBodyRow[] = [];\n MAX_ROW = 6;\n MAX_COL = 7;\n\n @Input() prefixCls: string = 'ant-picker';\n @Input() value!: CandyDate;\n @Input() locale!: NzCalendarI18nInterface;\n @Input() activeDate: CandyDate = new CandyDate();\n @Input() showWeek: boolean = false;\n @Input() selectedValue: CandyDate[] = []; // Range ONLY\n @Input() hoverValue: CandyDate[] = []; // Range ONLY\n @Input() disabledDate?: (d: Date) => boolean;\n @Input() cellRender?: string | TemplateRef<Date> | FunctionProp<TemplateRef<Date> | string>;\n @Input() fullCellRender?: string | TemplateRef<Date> | FunctionProp<TemplateRef<Date> | string>;\n\n @Output() readonly valueChange = new EventEmitter<CandyDate>();\n @Output() readonly cellHover = new EventEmitter<CandyDate>(); // Emitted when hover on a day by mouse enter\n\n protected render(): void {\n if (this.activeDate) {\n this.headRow = this.makeHeadRow();\n this.bodyRows = this.makeBodyRows();\n }\n }\n\n trackByBodyRow(_index: number, item: DateBodyRow): NzSafeAny {\n return item.trackByIndex;\n }\n\n trackByBodyColumn(_index: number, item: DateCell): NzSafeAny {\n return item.trackByIndex;\n }\n\n hasRangeValue(): boolean {\n return this.selectedValue?.length > 0 || this.hoverValue?.length > 0;\n }\n\n getClassMap(cell: DateCell): { [key: string]: boolean } {\n return {\n [`ant-picker-cell`]: true,\n [`ant-picker-cell-in-view`]: true,\n [`ant-picker-cell-selected`]: cell.isSelected,\n [`ant-picker-cell-disabled`]: cell.isDisabled,\n [`ant-picker-cell-in-range`]: !!cell.isInSelectedRange,\n [`ant-picker-cell-range-start`]: !!cell.isSelectedStart,\n [`ant-picker-cell-range-end`]: !!cell.isSelectedEnd,\n [`ant-picker-cell-range-start-single`]: !!cell.isStartSingle,\n [`ant-picker-cell-range-end-single`]: !!cell.isEndSingle,\n [`ant-picker-cell-range-hover`]: !!cell.isInHoverRange,\n [`ant-picker-cell-range-hover-start`]: !!cell.isHoverStart,\n [`ant-picker-cell-range-hover-end`]: !!cell.isHoverEnd,\n [`ant-picker-cell-range-hover-edge-start`]: !!cell.isFirstCellInPanel,\n [`ant-picker-cell-range-hover-edge-end`]: !!cell.isLastCellInPanel,\n [`ant-picker-cell-range-start-near-hover`]: !!cell.isRangeStartNearHover,\n [`ant-picker-cell-range-end-near-hover`]: !!cell.isRangeEndNearHover\n };\n }\n\n abstract makeHeadRow(): DateCell[];\n abstract makeBodyRows(): DateBodyRow[];\n\n ngOnInit(): void {\n this.render();\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.activeDate && !changes.activeDate.currentValue) {\n this.activeDate = new CandyDate();\n }\n\n if (\n changes.disabledDate ||\n changes.locale ||\n changes.showWeek ||\n this.isDateRealChange(changes.activeDate) ||\n this.isDateRealChange(changes.value) ||\n this.isDateRealChange(changes.selectedValue) ||\n this.isDateRealChange(changes.hoverValue)\n ) {\n this.render();\n }\n }\n\n private isDateRealChange(change: SimpleChange): boolean {\n if (change) {\n const previousValue: CandyDate | CandyDate[] = change.previousValue;\n const currentValue: CandyDate | CandyDate[] = change.currentValue;\n if (Array.isArray(currentValue)) {\n return (\n !Array.isArray(previousValue) ||\n currentValue.length !== previousValue.length ||\n currentValue.some((value, index) => {\n const previousCandyDate = previousValue[index];\n return previousCandyDate instanceof CandyDate ? previousCandyDate.isSameDay(value) : previousCandyDate !== value;\n })\n );\n } else {\n return !this.isSameDate(previousValue as CandyDate, currentValue);\n }\n }\n return false;\n }\n\n private isSameDate(left: CandyDate, right: CandyDate): boolean {\n return (!left && !right) || (left && right && right.isSameDay(left));\n }\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { ChangeDetectionStrategy, Component, OnChanges, ViewEncapsulation } from '@angular/core';\nimport { AbstractTable } from './abstract-table';\nimport { DateBodyRow, DateCell, DecadeCell } from './interface';\n\nconst MAX_ROW = 4;\nconst MAX_COL = 3;\n\n@Component({\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'decade-table',\n exportAs: 'decadeTable',\n templateUrl: 'abstract-table.html'\n})\nexport class DecadeTableComponent extends AbstractTable implements OnChanges {\n get startYear(): number {\n return parseInt(`${this.activeDate.getYear() / 100}`, 10) * 100;\n }\n\n get endYear(): number {\n return this.startYear + 99;\n }\n\n makeHeadRow(): DateCell[] {\n return [];\n }\n\n makeBodyRows(): DateBodyRow[] {\n const decades: DateBodyRow[] = [];\n const currentYear = this.value && this.value.getYear();\n const startYear = this.startYear;\n const endYear = this.endYear;\n const previousYear = startYear - 10;\n\n let index = 0;\n for (let rowIndex = 0; rowIndex < MAX_ROW; rowIndex++) {\n const row: DateBodyRow = {\n dateCells: [],\n trackByIndex: rowIndex\n };\n\n for (let colIndex = 0; colIndex < MAX_COL; colIndex++) {\n const start = previousYear + index * 10;\n const end = previousYear + index * 10 + 9;\n const content = `${start}-${end}`;\n\n const cell: DecadeCell = {\n trackByIndex: colIndex,\n value: this.activeDate.setYear(start).nativeDate,\n content,\n title: content,\n isDisabled: false,\n isSelected: currentYear >= start && currentYear <= end,\n isLowerThanStart: end < startYear,\n isBiggerThanEnd: start > endYear,\n classMap: {},\n onClick(): void {},\n onMouseEnter(): void {}\n };\n\n cell.classMap = this.getClassMap(cell);\n cell.onClick = () => this.chooseDecade(start);\n index++;\n row.dateCells.push(cell);\n }\n\n decades.push(row);\n }\n return decades;\n }\n\n override getClassMap(cell: DecadeCell): { [key: string]: boolean } {\n return {\n [`${this.prefixCls}-cell`]: true,\n [`${this.prefixCls}-cell-in-view`]: !cell.isBiggerThanEnd && !cell.isLowerThanStart,\n [`${this.prefixCls}-cell-selected`]: cell.isSelected,\n [`${this.prefixCls}-cell-disabled`]: cell.isDisabled\n };\n }\n\n private chooseDecade(year: number): void {\n this.value = this.activeDate.setYear(year);\n this.valueChange.emit(this.value);\n }\n}\n","<table class=\"ant-picker-content\" cellspacing=\"0\" role=\"grid\">\n <thead *ngIf=\"headRow && headRow.length > 0\">\n <tr role=\"row\">\n <th *ngIf=\"showWeek\" role=\"columnheader\"></th>\n <th *ngFor=\"let cell of headRow\" role=\"columnheader\" title=\"{{ cell.title }}\">\n {{ cell.content }}\n </th>\n </tr>\n </thead>\n <tbody>\n <tr *ngFor=\"let row of bodyRows; trackBy: trackByBodyRow\" [ngClass]=\"row.classMap!\" role=\"row\">\n <td *ngIf=\"row.weekNum\" role=\"gridcell\" class=\"{{ prefixCls }}-cell-week\">\n {{ row.weekNum }}\n </td>\n <td\n *ngFor=\"let cell of row.dateCells; trackBy: trackByBodyColumn\"\n title=\"{{ cell.title }}\"\n role=\"gridcell\"\n [ngClass]=\"cell.classMap!\"\n (click)=\"cell.isDisabled ? null : cell.onClick()\"\n (mouseenter)=\"cell.onMouseEnter()\"\n >\n <ng-container [ngSwitch]=\"prefixCls\">\n <ng-container *ngSwitchCase=\"'ant-picker'\">\n <ng-container [ngSwitch]=\"true\">\n <ng-container *ngSwitchCase=\"isTemplateRef(cell.cellRender)\">\n <!-- *ngSwitchCase not has type assertion support, the cellRender type here is TemplateRef -->\n <ng-container\n *ngTemplateOutlet=\"$any(cell.cellRender); context: { $implicit: cell.value }\"\n ></ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"isNonEmptyString(cell.cellRender)\">\n <span [innerHTML]=\"cell.cellRender\"></span>\n </ng-container>\n <ng-container *ngSwitchDefault>\n <div\n class=\"{{ prefixCls }}-cell-inner\"\n [attr.aria-selected]=\"cell.isSelected\"\n [attr.aria-disabled]=\"cell.isDisabled\"\n >\n {{ cell.content }}\n </div>\n </ng-container>\n </ng-container>\n </ng-container>\n <ng-container *ngSwitchCase=\"'ant-picker-calendar'\">\n <div\n class=\"{{ prefixCls }}-date ant-picker-cell-inner\"\n [class.ant-picker-calendar-date-today]=\"cell.isToday\"\n >\n <ng-container *ngIf=\"cell.fullCellRender; else defaultCell\">\n <ng-container\n *ngTemplateOutlet=\"$any(cell.fullCellRender); context: { $implicit: cell.value }\"\n >\n </ng-container>\n </ng-container>\n <ng-template #defaultCell>\n <div class=\"{{ prefixCls }}-date-value\">{{ cell.content }}</div>\n <div class=\"{{ prefixCls }}-date-content\">\n <ng-container\n *ngTemplateOutlet=\"$any(cell.cellRender); context: { $implicit: cell.value }\"\n >\n </ng-container>\n </div>\n </ng-template>\n </div>\n </ng-container>\n </ng-container>\n </td>\n </tr>\n </tbody>\n</table>\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/core';\nimport { AbstractPanelHeader } from './abstract-panel-header';\nimport { PanelSelector } from './interface';\n\n@Component({\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'year-header', // eslint-disable-line @angular-eslint/component-selector\n exportAs: 'yearHeader',\n templateUrl: './abstract-panel-header.html'\n})\nexport class YearHeaderComponent extends AbstractPanelHeader {\n get startYear(): number {\n return parseInt(`${this.value.getYear() / 10}`, 10) * 10;\n }\n\n get endYear(): number {\n return this.startYear + 9;\n }\n\n override superPrevious(): void {\n this.changeValue(this.value.addYears(-10));\n }\n\n override superNext(): void {\n this.changeValue(this.value.addYears(10));\n }\n\n getSelectors(): PanelSelector[] {\n return [\n {\n className: `${this.prefixCls}-year-btn`,\n title: '',\n onClick: () => this.changeMode('decade'),\n label: `${this.startYear}-${this.endYear}`\n }\n ];\n }\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/core';\nimport { CandyDate } from 'ng-zorro-antd/core/time';\nimport { valueFunctionProp } from 'ng-zorro-antd/core/util';\nimport { DateHelperService } from 'ng-zorro-antd/i18n';\nimport { AbstractTable } from './abstract-table';\nimport { DateBodyRow, DateCell, YearCell } from './interface';\n\n@Component({\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'year-table',\n exportAs: 'yearTable',\n templateUrl: 'abstract-table.html'\n})\nexport class YearTableComponent extends AbstractTable {\n override MAX_ROW = 4;\n override MAX_COL = 3;\n\n constructor(private dateHelper: DateHelperService) {\n super();\n }\n\n makeHeadRow(): DateCell[] {\n return [];\n }\n\n makeBodyRows(): DateBodyRow[] {\n const currentYear = this.activeDate && this.activeDate.getYear();\n const startYear = parseInt(`${currentYear / 10}`, 10) * 10;\n const endYear = startYear + 9;\n const previousYear = startYear - 1;\n const years: DateBodyRow[] = [];\n let yearValue = 0;\n\n for (let rowIndex = 0; rowIndex < this.MAX_ROW; rowIndex++) {\n const row: DateBodyRow = {\n dateCells: [],\n trackByIndex: rowIndex\n };\n for (let colIndex = 0; colIndex < this.MAX_COL; colIndex++) {\n const yearNum = previousYear + yearValue;\n const year = this.activeDate.setYear(yearNum);\n const content = this.dateHelper.format(year.nativeDate, 'yyyy');\n const isDisabled = this.isDisabledYear(year);\n const cell: YearCell = {\n trackByIndex: colIndex,\n value: year.nativeDate,\n isDisabled,\n isSameDecade: yearNum >= startYear && yearNum <= endYear,\n isSelected: yearNum === (this.value && this.value.getYear()),\n content,\n title: content,\n classMap: {},\n isLastCellInPanel: year.getYear() === endYear,\n isFirstCellInPanel: year.getYear() === startYear,\n cellRender: valueFunctionProp(this.cellRender!, year), // Customized content\n fullCellRender: valueFunctionProp(this.fullCellRender!, year),\n onClick: () => this.chooseYear(cell.value.getFullYear()), // don't use yearValue here,\n onMouseEnter: () => this.cellHover.emit(year)\n };\n\n this.addCellProperty(cell, year);\n row.dateCells.push(cell);\n yearValue++;\n }\n years.push(row);\n }\n return years;\n }\n\n override getClassMap(cell: YearCell): { [key: string]: boolean } {\n return {\n ...super.getClassMap(cell),\n [`ant-picker-cell-in-view`]: !!cell.isSameDecade\n };\n }\n\n private isDisabledYear(year: CandyDate): boolean {\n if (!this.disabledDate) {\n return false;\n }\n\n const firstOfMonth = year.setMonth(0).setDate(1);\n\n for (let date = firstOfMonth; date.getYear() === year.getYear(); date = date.addDays(1)) {\n if (!this.disabledDate(date.nativeDate)) {\n return false;\n }\n }\n\n return true;\n }\n\n private addCellProperty(cell: DateCell, year: CandyDate): void {\n if (this.hasRangeValue()) {\n const [startHover, endHover] = this.hoverValue;\n const [startSelected, endSelected] = this.selectedValue;\n // Selected\n if (startSelected?.isSameYear(year)) {\n cell.isSelectedStart = true;\n cell.isSelected = true;\n }\n\n if (endSelected?.isSameYear(year)) {\n cell.isSelectedEnd = true;\n cell.isSelected = true;\n }\n\n if (startHover && endHover) {\n cell.isHoverStart = startHover.isSameYear(year);\n cell.isHoverEnd = endHover.isSameYear(year);\n cell.isInHoverRange = startHover.isBeforeYear(year) && year.isBeforeYear(endHover);\n }\n cell.isStartSingle = startSelected && !endSelected;\n cell.isEndSingle = !startSelected && endSelected;\n cell.isInSelectedRange = startSelected?.isBeforeYear(year) && year?.isBeforeYear(endSelected);\n cell.isRangeStartNearHover = startSelected && cell.isInHoverRange;\n cell.isRangeEndNearHover = endSelected && cell.isInHoverRange;\n } else if (year.isSameYear(this.value)) {\n cell.isSelected = true;\n }\n cell.classMap = this.getClassMap(cell);\n }\n\n private chooseYear(year: number): void {\n this.value = this.activeDate.setYear(year);\n this.valueChange.emit(this.value);\n this.render();\n }\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/core';\n\nimport { DateHelperService } from 'ng-zorro-antd/i18n';\nimport { AbstractPanelHeader } from './abstract-panel-header';\nimport { PanelSelector } from './interface';\nimport { transCompatFormat } from './util';\n\n@Component({\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'month-header', // eslint-disable-line @angular-eslint/component-selector\n exportAs: 'monthHeader',\n templateUrl: './abstract-panel-header.html'\n})\nexport class MonthHeaderComponent extends AbstractPanelHeader {\n constructor(private dateHelper: DateHelperService) {\n super();\n }\n\n getSelectors(): PanelSelector[] {\n return [\n {\n className: `${this.prefixCls}-month-btn`,\n title: this.locale.yearSelect,\n onClick: () => this.changeMode('year'),\n label: this.dateHelper.format(this.value.nativeDate, transCompatFormat(this.locale.yearFormat))\n }\n ];\n }\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { ChangeDetectionStrategy, Component, OnChanges, OnInit, ViewEncapsulation } from '@angular/core';\nimport { CandyDate } from 'ng-zorro-antd/core/time';\nimport { valueFunctionProp } from 'ng-zorro-antd/core/util';\nimport { DateHelperService } from 'ng-zorro-antd/i18n';\nimport { AbstractTable } from './abstract-table';\nimport { DateBodyRow, DateCell } from './interface';\n\n@Component({\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'month-table',\n exportAs: 'monthTable',\n templateUrl: 'abstract-table.html'\n})\nexport class MonthTableComponent extends AbstractTable implements OnChanges, OnInit {\n override MAX_ROW = 4;\n override MAX_COL = 3;\n\n constructor(private dateHelper: DateHelperService) {\n super();\n }\n\n makeHeadRow(): DateCell[] {\n return [];\n }\n\n makeBodyRows(): DateBodyRow[] {\n const months: DateBodyRow[] = [];\n let monthValue = 0;\n\n for (let rowIndex = 0; rowIndex < this.MAX_ROW; rowIndex++) {\n const row: DateBodyRow = {\n dateCells: [],\n trackByIndex: rowIndex\n };\n\n for (let colIndex = 0; colIndex < this.MAX_COL; colIndex++) {\n const month = this.activeDate.setMonth(monthValue);\n const isDisabled = this.isDisabledMonth(month);\n const content = this.dateHelper.format(month.nativeDate, 'MMM');\n const cell: DateCell = {\n trackByIndex: colIndex,\n value: month.nativeDate,\n isDisabled,\n isSelected: month.isSameMonth(this.value),\n content,\n title: content,\n classMap: {},\n cellRender: valueFunctionProp(this.cellRender!, month), // Customized content\n fullCellRender: valueFunctionProp(this.fullCellRender!, month),\n onClick: () => this.chooseMonth(cell.value.getMonth()), // don't use monthValue here,\n onMouseEnter: () => this.cellHover.emit(month)\n };\n\n this.addCellProperty(cell, month);\n row.dateCells.push(cell);\n monthValue++;\n }\n months.push(row);\n }\n return months;\n }\n\n private isDisabledMonth(month: CandyDate): boolean {\n if (!this.disabledDate) {\n return false;\n }\n\n const firstOfMonth = month.setDate(1);\n\n for (let date = firstOfMonth; date.getMonth() === month.getMonth(); date = date.addDays(1)) {\n if (!this.disabledDate(date.nativeDate)) {\n return false;\n }\n }\n\n return true;\n }\n\n private addCellProperty(cell: DateCell, month: CandyDate): void {\n if (this.hasRangeValue()) {\n const [startHover, endHover] = this.hoverValue;\n const [startSelected, endSelected] = this.selectedValue;\n // Selected\n if (startSelected?.isSameMonth(month)) {\n cell.isSelectedStart = true;\n cell.isSelected = true;\n }\n\n if (endSelected?.isSameMonth(month)) {\n cell.isSelectedEnd = true;\n cell.isSelected = true;\n }\n\n if (startHover && endHover) {\n cell.isHoverStart = startHover.isSameMonth(month);\n cell.isHoverEnd = endHover.isSameMonth(month);\n cell.isLastCellInPanel = month.getMonth() === 11;\n cell.isFirstCellInPanel = month.getMonth() === 0;\n cell.isInHoverRange = startHover.isBeforeMonth(month) && month.isBeforeMonth(endHover);\n }\n cell.isStartSingle = startSelected && !endSelected;\n cell.isEndSingle = !startSelected && endSelected;\n cell.isInSelectedRange = startSelected?.isBeforeMonth(month) && month?.isBeforeMonth(endSelected);\n cell.isRangeStartNearHover = startSelected && cell.isInHoverRange;\n cell.isRangeEndNearHover = endSelected && cell.isInHoverRange;\n } else if (month.isSameMonth(this.value)) {\n cell.isSelected = true;\n }\n cell.classMap = this.getClassMap(cell);\n }\n\n private chooseMonth(month: number): void {\n this.value = this.activeDate.setMonth(month);\n this.valueChange.emit(this.value);\n }\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/core';\n\nimport { DateHelperService } from 'ng-zorro-antd/i18n';\nimport { AbstractPanelHeader } from './abstract-panel-header';\nimport { PanelSelector } from './interface';\nimport { transCompatFormat } from './util';\n\n@Component({\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n selector: 'date-header', // eslint-disable-line @angular-eslint/component-selector\n exportAs: 'dateHeader',\n templateUrl: './abstract-panel-header.html'\n})\nexport class DateHeaderComponent extends AbstractPanelHeader {\n constructor(private dateHelper: DateHelperService) {\n super();\n }\n\n getSelectors(): PanelSelector[] {\n return [\n {\n className: `${this.prefixCls}-year-btn`,\n title: this.locale.yearSelect,\n onClick: () => this.changeMode('year'),\n label: this.dateHelper.format(this.value.nativeDate, transCompatFormat(this.locale.yearFormat))\n },\n {\n className: `${this.prefixCls}-month-btn`,\n title: this.locale.monthSelect,\n onClick: () => this.changeMode('month'),\n label: this.dateHelper.format(this.value.nativeDate, this.locale.monthFormat || 'MMM')\n }\n ];\n }\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport { ChangeDetectionStrategy, Component, Input, OnChanges, OnInit, ViewEncapsulation } from '@angular/core';\nimport { CandyDate } from 'ng-zorro-antd/core/time';\nimport { valueFunctionProp } from 'ng-zorro-antd/core/util';\n\nimport { DateHelperService, NzCalendarI18nInterface, NzI18nService } from 'ng-zorro-antd/i18n';\nimport { AbstractTable } from './abstract-table';\nimport { DateBodyRow, DateCell } from './interface';\nimport { transCompatFormat } from './util';\n\n@Component({\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'date-table',\n exportAs: 'dateTable',\n templateUrl: './abstract-table.html'\n})\nexport class DateTableComponent extends AbstractTable implements OnChanges, OnInit {\n @Input() override locale!: NzCalendarI18nInterface;\n\n constructor(private i18n: NzI18nService, private dateHelper: DateHelperService) {\n super();\n }\n\n private changeValueFromInside(value: CandyDate): void {\n // Only change date not change time\n this.activeDate = this.activeDate.setYear(value.getYear()).setMonth(value.getMonth()).setDate(value.getDate());\n this.valueChange.emit(this.activeDate);\n\n if (!this.activeDate.isSameMonth(this.value)) {\n this.render();\n }\n }\n\n makeHeadRow(): DateCell[] {\n const weekDays: DateCell[] = [];\n const start = this.activeDate.calendarStart({ weekStartsOn: this.dateHelper.getFirstDayOfWeek() });\n for (let colIndex = 0; colIndex < this.MAX_COL; colIndex++) {\n const day = start.addDays(colIndex);\n weekDays.push({\n trackByIndex: null,\n value: day.nativeDate,\n title: this.dateHelper.format(day.nativeDate, 'E'), // eg. Tue\n content: this.dateHelper.format(day.nativeDate, this.getVeryShortWeekFormat()), // eg. Tu,\n isSelected: false,\n isDisabled: false,\n onClick(): void {},\n onMouseEnter(): void {}\n });\n }\n return weekDays;\n }\n\n private getVeryShortWeekFormat(): string {\n return this.i18n.getLocaleId().toLowerCase().indexOf('zh') === 0 ? 'EEEEE' : 'EEEEEE'; // Use extreme short for chinese\n }\n\n makeBodyRows(): DateBodyRow[] {\n const weekRows: DateBodyRow[] = [];\n const firstDayOfMonth = this.activeDate.calendarStart({ weekStartsOn: this.dateHelper.getFirstDayOfWeek() });\n\n for (let week = 0; week < this.MAX_ROW; week++) {\n const weekStart = firstDayOfMonth.addDays(week * 7);\n const row: DateBodyRow = {\n isActive: false,\n dateCells: [],\n trackByIndex: week\n };\n\n for (let day = 0; day < 7; day++) {\n const date = weekStart.addDays(day);\n const dateFormat = transCompatFormat(this.i18n.getLocaleData('DatePicker.lang.dateFormat', 'YYYY-MM-DD'));\n const title = this.dateHelper.format(date.nativeDate, dateFormat);\n const label = this.dateHelper.format(date.nativeDate, 'dd');\n const cell: DateCell = {\n trackByIndex: day,\n value: date.nativeDate,\n label,\n isSelected: false,\n isDisabled: false,\n isToday: false,\n title,\n cellRender: valueFunctionProp(this.cellRender!, date), // Customized content\n fullCellRender: valueFunctionProp(this.fullCellRender!, date),\n content: `${date.getDate()}`,\n onClick: () => this.changeValueFromInside(date),\n onMouseEnter: () => this.cellHover.emit(date)\n };\n\n this.addCellProperty(cell, date);\n\n if (this.showWeek && !row.weekNum) {\n row.weekNum = this.dateHelper.getISOWeek(date.nativeDate);\n }\n if (date.isSameDay(this.value)) {\n row.isActive = date.isSameDay(this.value);\n }\n row.dateCells.push(cell);\n }\n row.classMap = {\n [`ant-picker-week-panel-row`]: this.showWeek,\n [`ant-picker-week-panel-row-selected`]: this.showWeek && row.isActive\n };\n weekRows.push(row);\n }\n return weekRows;\n }\n\n addCellProperty(cell: DateCell, date: CandyDate): void {\n if (this.hasRangeValue() && !this.showWeek) {\n const [startHover, endHover] = this.hoverValue;\n const [startSelected, endSelected] = this.selectedValue;\n // Selected\n if (startSelected?.isSameDay(date)) {\n cell.isSelectedStart = true;\n cell.isSelected = true;\n }\n\n if (endSelected?.isSameDay(date)) {\n cell.isSelectedEnd = true;\n cell.isSelected = true;\n }\n\n if (startHover && endHover) {\n cell.isHoverStart = startHover.isSameDay(date);\n cell.isHoverEnd = endHover.isSameDay(date);\n cell.isLastCellInPanel = date.isLastDayOfMonth();\n cell.isFirstCellInPanel = date.isFirstDayOfMonth();\n cell.isInHoverRange = startHover.isBeforeDay(date) && date.isBeforeDay(endHover);\n }\n cell.isStartSingle = startSelected && !endSelected;\n cell.isEndSingle = !startSelected && endSelected;\n cell.isInSelectedRange = startSelected?.isBeforeDay(date) && date.isBeforeDay(endSelected);\n cell.isRangeStartNearHover = startSelected && cell.isInHoverRange;\n cell.isRangeEndNearHover = endSelected && cell.isInHoverRange;\n }\n\n cell.isToday = date.isToday();\n cell.isSelected = date.isSameDay(this.value);\n cell.isDisabled = !!this.disabledDate?.(date.nativeDate);\n cell.classMap = this.getClassMap(cell);\n }\n\n override getClassMap(cell: DateCell): { [key: string]: boolean } {\n const date = new CandyDate(cell.value);\n return {\n ...super.getClassMap(cell),\n [`ant-picker-cell-today`]: !!cell.isToday,\n [`ant-picker-cell-in-view`]: date.isSameMonth(this.activeDate)\n };\n }\n}\n","/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\nimport {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n Input,\n OnChanges,\n Output,\n SimpleChanges,\n TemplateRef,\n ViewEncapsulation\n} from '@angular/core';\n\nimport { CandyDate } from 'ng-zorro-antd/core/time';\nimport { FunctionProp } from 'ng-zorro-antd/core/types';\nimport { NzCalendarI18nInterface } from 'ng-zorro-antd/i18n';\n\nimport { DisabledDateFn, NzDateMode, RangePartType, SupportTimeOptions } from './standard-types';\nimport { PREFIX_CLASS } from './util';\n\n@Component({\n // eslint-disable-next-line @angular-eslint/component-selector\n selector: 'inner-popup',\n exportAs: 'innerPopup',\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <div [class.ant-picker-datetime-panel]=\"showTimePicker\">\n <div class=\"{{ prefixCls }}-{{ panelMode }}-panel\">\n <ng-container [ngSwitch]=\"panelMode\">\n <ng-container *ngSwitchCase=\"'decade'\">\n <decade-header\n [(value)]=\"activeDate\"\n [locale]=\"locale\"\n [showSuperPreBtn]=\"enablePrevNext('prev', 'decade')\"\n [showSuperNextBtn]=\"enablePrevNext('next', 'decade')\"\n [showNextBtn]=\"false\"\n [showPreBtn]=\"false\"\n (panelModeChange)=\"panelModeChange.emit($event)\"\n (valueChange)=\"headerChange.emit($event)\"\n ></decade-header>\n <div class=\"{{ prefixCls }}-body\">\n <decade-table\n [activeDate]=\"activeDate\"\n [value]=\"value\"\n [locale]=\"locale\"\n (valueChange)=\"onChooseDecade($event)\"\n [disabledDate]=\"disabledDate\"\n ></decade-table>\n </div>\n </ng-container>\n <ng-container *ngSwitchCase=\"'year'\">\n <year-header\n [(value)]=\"activeDate\"\n [locale]=\"locale\"\n [showSuperPreBtn]=\"enablePrevNext('prev', 'year')\"\n [showSuperNextBtn]=\"enablePrevNext('next', 'year')\"\n [showNextBtn]=\"false\"\n [showPreBtn]=\"false\"\n (panelModeChange)=\"panelModeChange.emit($event)\"\n (valueChange)=\"headerChange.emit($event)\"\n ></year-header>\n <div class=\"{{ prefixCls }}-body\">\n <year-table\n [activeDate]=\"activeDate\"\n [value]=\"value\"\n [locale]=\"locale\"\n [disabledDate]=\"disabledDate\"\n [selectedValue]=\"selectedValue\"\n [hoverValue]=\"hoverValue\"\n (valueChange)=\"onChooseYear($event)\"\n (cellHover)=\"cellHover.emit($event)\"\n ></year-table