ng-zorro-antd
Version:
An enterprise-class UI components based on Ant Design and Angular
16 lines (14 loc) • 88.4 kB
JavaScript
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/cdk/bidi"),require("@angular/cdk/overlay"),require("@angular/common"),require("@angular/core"),require("@angular/forms"),require("ng-zorro-antd/button"),require("ng-zorro-antd/core/no-animation"),require("ng-zorro-antd/core/outlet"),require("ng-zorro-antd/core/overlay"),require("ng-zorro-antd/icon"),require("ng-zorro-antd/time-picker"),require("ng-zorro-antd/core/time"),require("ng-zorro-antd/core/util"),require("ng-zorro-antd/i18n"),require("rxjs"),require("rxjs/operators"),require("ng-zorro-antd/core/config"),require("@angular/cdk/keycodes"),require("@angular/cdk/platform"),require("ng-zorro-antd/core/animation"),require("ng-zorro-antd/core/resize-observers")):"function"==typeof define&&define.amd?define("ng-zorro-antd/date-picker",["exports","@angular/cdk/bidi","@angular/cdk/overlay","@angular/common","@angular/core","@angular/forms","ng-zorro-antd/button","ng-zorro-antd/core/no-animation","ng-zorro-antd/core/outlet","ng-zorro-antd/core/overlay","ng-zorro-antd/icon","ng-zorro-antd/time-picker","ng-zorro-antd/core/time","ng-zorro-antd/core/util","ng-zorro-antd/i18n","rxjs","rxjs/operators","ng-zorro-antd/core/config","@angular/cdk/keycodes","@angular/cdk/platform","ng-zorro-antd/core/animation","ng-zorro-antd/core/resize-observers"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self)["ng-zorro-antd"]=e["ng-zorro-antd"]||{},e["ng-zorro-antd"]["date-picker"]={}),e.ng.cdk.bidi,e.ng.cdk.overlay,e.ng.common,e.ng.core,e.ng.forms,e["ng-zorro-antd"].button,e["ng-zorro-antd"].core["no-animation"],e["ng-zorro-antd"].core.outlet,e["ng-zorro-antd"].core.overlay,e["ng-zorro-antd"].icon,e["ng-zorro-antd"]["time-picker"],e["ng-zorro-antd"].core.time,e["ng-zorro-antd"].core.util,e["ng-zorro-antd"].i18n,e.rxjs,e.rxjs.operators,e["ng-zorro-antd"].core.config,e.ng.cdk.keycodes,e.ng.cdk.platform,e["ng-zorro-antd"].core.animation,e["ng-zorro-antd"].core["resize-observers"])}(this,(function(e,t,n,i,a,r,o,l,s,c,p,d,u,h,g,v,y,f,m,k,C,b){"use strict";var w="ant-picker",S={nzDisabledHours:function(){return[]},nzDisabledMinutes:function(){return[]},nzDisabledSeconds:function(){return[]}};function P(e,t){var n=t?t(e&&e.nativeDate):{};return n=Object.assign(Object.assign({},S),n)}function D(e,t){var n=!1;if(e){var i=e.getHours(),a=e.getMinutes(),r=e.getSeconds();if(-1===t.nzDisabledHours().indexOf(i))if(-1===t.nzDisabledMinutes(i).indexOf(a))n=-1!==t.nzDisabledSeconds(i,a).indexOf(r);else n=!0;else n=!0}return!n}function x(e,t){return D(e,P(e,t))}function O(e,t,n){return!!e&&((!t||!t(e.nativeDate))&&!(n&&!x(e,n)))}function I(e){return e&&e.replace(/Y/g,"y").replace(/D/g,"d")}var z=function(){function e(e){this.dateHelper=e,this.showToday=!1,this.showNow=!1,this.hasTimePicker=!1,this.isRange=!1,this.okDisabled=!1,this.rangeQuickSelector=null,this.clickOk=new a.EventEmitter,this.clickToday=new a.EventEmitter,this.prefixCls=w,this.isTemplateRef=h.isTemplateRef,this.isNonEmptyString=h.isNonEmptyString,this.isTodayDisabled=!1,this.todayTitle=""}return e.prototype.ngOnChanges=function(e){var t=new Date;if(e.disabledDate&&(this.isTodayDisabled=!(!this.disabledDate||!this.disabledDate(t))),e.locale){var n=I(this.locale.dateFormat);this.todayTitle=this.dateHelper.format(t,n)}},e.prototype.onClickToday=function(){var e=new u.CandyDate;this.clickToday.emit(e.clone())},e}();z.decorators=[{type:a.Component,args:[{encapsulation:a.ViewEncapsulation.None,changeDetection:a.ChangeDetectionStrategy.OnPush,selector:"calendar-footer",exportAs:"calendarFooter",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 '}]}],z.ctorParameters=function(){return[{type:g.DateHelperService}]},z.propDecorators={locale:[{type:a.Input}],showToday:[{type:a.Input}],showNow:[{type:a.Input}],hasTimePicker:[{type:a.Input}],isRange:[{type:a.Input}],okDisabled:[{type:a.Input}],disabledDate:[{type:a.Input}],extraFooter:[{type:a.Input}],rangeQuickSelector:[{type:a.Input}],clickOk:[{type:a.Output}],clickToday:[{type:a.Output}]};
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */
var R=function(e,t){return(R=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(e,t)};function M(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}R(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function T(e,t,n,i){var a,r=arguments.length,o=r<3?t:null===i?i=Object.getOwnPropertyDescriptor(t,n):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,n,i);else for(var l=e.length-1;l>=0;l--)(a=e[l])&&(o=(r<3?a(o):r>3?a(t,n,o):a(t,n))||o);return r>3&&o&&Object.defineProperty(t,n,o),o}function V(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}Object.create;function N(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var i,a,r=n.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(i=r.next()).done;)o.push(i.value)}catch(e){a={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return o}Object.create;var B=function(){function e(){this.activeInput="left",this.arrowLeft=0,this.isRange=!1,this.valueChange$=new v.ReplaySubject(1),this.emitValue$=new v.Subject,this.inputPartChange$=new v.Subject}return e.prototype.initValue=function(){this.isRange?this.initialValue=[]:this.initialValue=null,this.setValue(this.initialValue)},e.prototype.hasValue=function(e){return void 0===e&&(e=this.value),Array.isArray(e)?!!e[0]||!!e[1]:!!e},e.prototype.makeValue=function(e){return this.isRange?e?e.map((function(e){return new u.CandyDate(e)})):[]:e?new u.CandyDate(e):null},e.prototype.setActiveDate=function(e,t,n){void 0===t&&(t=!1),void 0===n&&(n="month");this.isRange?this.activeDate=u.normalizeRangeValue(e,t,{date:"month",month:"year",year:"decade"}[n],this.activeInput):this.activeDate=u.cloneDate(e)},e.prototype.setValue=function(e){this.value=e,this.valueChange$.next(this.value)},e.prototype.getActiveIndex=function(e){return void 0===e&&(e=this.activeInput),{left:0,right:1}[e]},e.prototype.ngOnDestroy=function(){this.valueChange$.complete(),this.emitValue$.complete(),this.inputPartChange$.complete()},e}();B.decorators=[{type:a.Injectable}];var E=function(){function e(e,t){var n=this;this.datePickerService=e,this.cdr=t,this.inline=!1,this.panelModeChange=new a.EventEmitter,this.calendarChange=new a.EventEmitter,this.resultOk=new a.EventEmitter,this.dir="ltr",this.prefixCls=w,this.endPanelMode="date",this.timeOptions=null,this.hoverValue=[],this.checkedPartArr=[!1,!1],this.destroy$=new v.Subject,this.disabledStartTime=function(e){return n.disabledTime&&n.disabledTime(e,"start")},this.disabledEndTime=function(e){return n.disabledTime&&n.disabledTime(e,"end")}}return Object.defineProperty(e.prototype,"hasTimePicker",{get:function(){return!!this.showTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"hasFooter",{get:function(){return this.showToday||this.hasTimePicker||!!this.extraFooter||!!this.ranges},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){var e=this;this.datePickerService.valueChange$.pipe(y.takeUntil(this.destroy$)).subscribe((function(){e.updateActiveDate(),e.cdr.markForCheck()}))},e.prototype.ngOnChanges=function(e){(e.showTime||e.disabledTime)&&this.showTime&&this.buildTimeOptions(),e.panelMode&&(this.endPanelMode=this.panelMode),e.defaultPickerValue&&this.updateActiveDate()},e.prototype.ngOnDestroy=function(){this.destroy$.next(),this.destroy$.complete()},e.prototype.updateActiveDate=function(){var e=this.datePickerService.hasValue()?this.datePickerService.value:this.datePickerService.makeValue(this.defaultPickerValue);this.datePickerService.setActiveDate(e,this.hasTimePicker,this.getPanelMode(this.endPanelMode))},e.prototype.init=function(){this.checkedPartArr=[!1,!1],this.updateActiveDate()},e.prototype.onMousedown=function(e){e.preventDefault()},e.prototype.onClickOk=function(){var e={left:0,right:1}[this.datePickerService.activeInput],t=this.isRange?this.datePickerService.value[e]:this.datePickerService.value;this.changeValueFromSelect(t),this.resultOk.emit()},e.prototype.onClickToday=function(e){this.changeValueFromSelect(e,!this.showTime)},e.prototype.onCellHover=function(e){if(this.isRange){var t={left:1,right:0}[this.datePickerService.activeInput],n=this.datePickerService.value[t];n&&(n.isBeforeDay(e)?this.hoverValue=[n,e]:this.hoverValue=[e,n])}},e.prototype.onPanelModeChange=function(e,t){if(this.isRange){var n=this.datePickerService.getActiveIndex(t);this.panelMode=0===n?[e,this.panelMode[1]]:[this.panelMode[0],e]}else this.panelMode=e;this.panelModeChange.emit(this.panelMode)},e.prototype.onActiveDateChange=function(e,t){if(this.isRange){var n=[];n[this.datePickerService.getActiveIndex(t)]=e,this.datePickerService.setActiveDate(n,this.hasTimePicker,this.getPanelMode(this.endPanelMode,t))}else this.datePickerService.setActiveDate(e)},e.prototype.onSelectTime=function(e,t){if(this.isRange){var n=u.cloneDate(this.datePickerService.value),i=this.datePickerService.getActiveIndex(t);n[i]=this.overrideHms(e,n[i]),this.datePickerService.setValue(n)}else{n=this.overrideHms(e,this.datePickerService.value);this.datePickerService.setValue(n)}this.datePickerService.inputPartChange$.next(),this.buildTimeOptions()},e.prototype.changeValueFromSelect=function(e,t){if(void 0===t&&(t=!0),this.isRange){var n=u.cloneDate(this.datePickerService.value),i=this.datePickerService.activeInput,a=i;n[this.datePickerService.getActiveIndex(i)]=e,this.checkedPartArr[this.datePickerService.getActiveIndex(i)]=!0,this.hoverValue=n,t?this.inline?("right"===(a=this.reversedPart(i))&&(n[this.datePickerService.getActiveIndex(a)]=null,this.checkedPartArr[this.datePickerService.getActiveIndex(a)]=!1),this.datePickerService.setValue(n),this.calendarChange.emit(n),this.isBothAllowed(n)&&this.checkedPartArr[0]&&this.checkedPartArr[1]&&(this.clearHoverValue(),this.datePickerService.emitValue$.next())):(u.wrongSortOrder(n)&&(a=this.reversedPart(i),n[this.datePickerService.getActiveIndex(a)]=null,this.checkedPartArr[this.datePickerService.getActiveIndex(a)]=!1),this.datePickerService.setValue(n),this.isBothAllowed(n)&&this.checkedPartArr[0]&&this.checkedPartArr[1]?(this.calendarChange.emit(n),this.clearHoverValue(),this.datePickerService.emitValue$.next()):this.isAllowed(n)&&(a=this.reversedPart(i),this.calendarChange.emit([e.clone()]))):this.datePickerService.setValue(n),this.datePickerService.inputPartChange$.next(a)}else this.datePickerService.setValue(e),this.datePickerService.inputPartChange$.next(),t&&this.isAllowed(e)&&this.datePickerService.emitValue$.next()},e.prototype.reversedPart=function(e){return"left"===e?"right":"left"},e.prototype.getPanelMode=function(e,t){return this.isRange?e[this.datePickerService.getActiveIndex(t)]:e},e.prototype.getValue=function(e){return this.isRange?(this.datePickerService.value||[])[this.datePickerService.getActiveIndex(e)]:this.datePickerService.value},e.prototype.getActiveDate=function(e){return this.isRange?this.datePickerService.activeDate[this.datePickerService.getActiveIndex(e)]:this.datePickerService.activeDate},e.prototype.isOneAllowed=function(e){var t=this.datePickerService.getActiveIndex(),n=[this.disabledStartTime,this.disabledEndTime];return O(e[t],this.disabledDate,n[t])},e.prototype.isBothAllowed=function(e){return O(e[0],this.disabledDate,this.disabledStartTime)&&O(e[1],this.disabledDate,this.disabledEndTime)},e.prototype.isAllowed=function(e,t){return void 0===t&&(t=!1),this.isRange?t?this.isBothAllowed(e):this.isOneAllowed(e):O(e,this.disabledDate,this.disabledTime)},e.prototype.getTimeOptions=function(e){return this.showTime&&this.timeOptions?this.timeOptions instanceof Array?this.timeOptions[this.datePickerService.getActiveIndex(e)]:this.timeOptions:null},e.prototype.onClickPresetRange=function(e){var t="function"==typeof e?e():e;t&&(this.datePickerService.setValue([new u.CandyDate(t[0]),new u.CandyDate(t[1])]),this.datePickerService.emitValue$.next())},e.prototype.onPresetRangeMouseLeave=function(){this.clearHoverValue()},e.prototype.onHoverPresetRange=function(e){"function"!=typeof e&&(this.hoverValue=[new u.CandyDate(e[0]),new u.CandyDate(e[1])])},e.prototype.getObjectKeys=function(e){return e?Object.keys(e):[]},e.prototype.show=function(e){return!(this.showTime&&this.isRange&&this.datePickerService.activeInput!==e)},e.prototype.clearHoverValue=function(){this.hoverValue=[]},e.prototype.buildTimeOptions=function(){if(this.showTime){var e="object"==typeof this.showTime?this.showTime:{};if(this.isRange){var t=this.datePickerService.value;this.timeOptions=[this.overrideTimeOptions(e,t[0],"start"),this.overrideTimeOptions(e,t[1],"end")]}else this.timeOptions=this.overrideTimeOptions(e,this.datePickerService.value)}else this.timeOptions=null},e.prototype.overrideTimeOptions=function(e,t,n){var i;return i=n?"start"===n?this.disabledStartTime:this.disabledEndTime:this.disabledTime,Object.assign(Object.assign({},e),P(t,i))},e.prototype.overrideHms=function(e,t){return e=e||new u.CandyDate,(t=t||new u.CandyDate).setHms(e.getHours(),e.getMinutes(),e.getSeconds())},e}();E.decorators=[{type:a.Component,args:[{encapsulation:a.ViewEncapsulation.None,changeDetection:a.ChangeDetectionStrategy.OnPush,selector:"date-range-popup",exportAs:"dateRangePopup",template:'\n <ng-container *ngIf="isRange; else singlePanel">\n <div class="{{ prefixCls }}-range-wrapper {{ prefixCls }}-date-range-wrapper">\n <div class="{{ prefixCls }}-range-arrow" [style.left.px]="datePickerService?.arrowLeft"></div>\n <div class="{{ prefixCls }}-panel-container">\n <div class="{{ prefixCls }}-panels">\n <ng-container *ngTemplateOutlet="tplInnerPopup; context: { partType: \'left\' }"></ng-container>\n <ng-container *ngTemplateOutlet="tplInnerPopup; context: { partType: \'right\' }"></ng-container>\n </div>\n <ng-container *ngTemplateOutlet="tplFooter"></ng-container>\n </div>\n </div>\n </ng-container>\n <ng-template #singlePanel>\n <div\n class="{{ prefixCls }}-panel-container {{ showWeek ? prefixCls + \'-week-number\' : \'\' }} {{\n hasTimePicker ? prefixCls + \'-time\' : \'\'\n }} {{ isRange ? prefixCls + \'-range\' : \'\' }}"\n >\n <div class="{{ prefixCls }}-panel" [class.ant-picker-panel-rtl]="dir === \'rtl\'" tabindex="-1">\n \x3c!-- Single ONLY --\x3e\n <ng-container *ngTemplateOutlet="tplInnerPopup"></ng-container>\n <ng-container *ngTemplateOutlet="tplFooter"></ng-container>\n </div>\n </div>\n </ng-template>\n\n <ng-template #tplInnerPopup let-partType="partType">\n <div class="{{ prefixCls }}-panel" [class.ant-picker-panel-rtl]="dir === \'rtl\'" [style.display]="show(partType) ? \'block\' : \'none\'">\n \x3c!-- TODO(@wenqi73) [selectedValue] [hoverValue] types--\x3e\n <inner-popup\n [showWeek]="showWeek"\n [endPanelMode]="getPanelMode(endPanelMode, partType)"\n [partType]="partType"\n [locale]="locale!"\n [showTimePicker]="hasTimePicker"\n [timeOptions]="getTimeOptions(partType)"\n [panelMode]="getPanelMode(panelMode, partType)"\n (panelModeChange)="onPanelModeChange($event, partType)"\n [activeDate]="getActiveDate(partType)"\n [value]="getValue(partType)"\n [disabledDate]="disabledDate"\n [dateRender]="dateRender"\n [selectedValue]="$any(datePickerService?.value)"\n [hoverValue]="$any(hoverValue)"\n (cellHover)="onCellHover($event)"\n (selectDate)="changeValueFromSelect($event, !showTime)"\n (selectTime)="onSelectTime($event, partType)"\n (headerChange)="onActiveDateChange($event, partType)"\n ></inner-popup>\n </div>\n </ng-template>\n\n <ng-template #tplFooter>\n <calendar-footer\n *ngIf="hasFooter"\n [locale]="locale!"\n [isRange]="isRange"\n [showToday]="showToday"\n [showNow]="showNow"\n [hasTimePicker]="hasTimePicker"\n [okDisabled]="!isAllowed($any(datePickerService?.value))"\n [extraFooter]="extraFooter"\n [rangeQuickSelector]="ranges ? tplRangeQuickSelector : null"\n (clickOk)="onClickOk()"\n (clickToday)="onClickToday($event)"\n ></calendar-footer>\n </ng-template>\n\n \x3c!-- Range ONLY: Range Quick Selector --\x3e\n <ng-template #tplRangeQuickSelector>\n <li\n *ngFor="let name of getObjectKeys(ranges)"\n class="{{ prefixCls }}-preset"\n (click)="onClickPresetRange(ranges![name])"\n (mouseenter)="onHoverPresetRange(ranges![name])"\n (mouseleave)="onPresetRangeMouseLeave()"\n >\n <span class="ant-tag ant-tag-blue">{{ name }}</span>\n </li>\n </ng-template>\n ',host:{"(mousedown)":"onMousedown($event)"}}]}],E.ctorParameters=function(){return[{type:B},{type:a.ChangeDetectorRef}]},E.propDecorators={isRange:[{type:a.Input}],inline:[{type:a.Input}],showWeek:[{type:a.Input}],locale:[{type:a.Input}],disabledDate:[{type:a.Input}],disabledTime:[{type:a.Input}],showToday:[{type:a.Input}],showNow:[{type:a.Input}],showTime:[{type:a.Input}],extraFooter:[{type:a.Input}],ranges:[{type:a.Input}],dateRender:[{type:a.Input}],panelMode:[{type:a.Input}],defaultPickerValue:[{type:a.Input}],panelModeChange:[{type:a.Output}],calendarChange:[{type:a.Output}],resultOk:[{type:a.Output}],dir:[{type:a.Input}]};var H=function(){function e(e,t,i,r,o,l,s){this.elementRef=e,this.dateHelper=t,this.cdr=i,this.platform=r,this.nzResizeObserver=o,this.datePickerService=l,this.noAnimation=!1,this.isRange=!1,this.open=void 0,this.disabled=!1,this.inputReadOnly=!1,this.inline=!1,this.popupStyle=null,this.dir="ltr",this.nzId=null,this.focusChange=new a.EventEmitter,this.valueChange=new a.EventEmitter,this.openChange=new a.EventEmitter,this.inputSize=12,this.destroy$=new v.Subject,this.prefixCls=w,this.activeBarStyle={},this.overlayOpen=!1,this.overlayPositions=[{offsetX:-12,offsetY:8,originX:"start",originY:"bottom",overlayX:"start",overlayY:"top"},{offsetX:-12,offsetY:-8,originX:"start",originY:"top",overlayX:"start",overlayY:"bottom"},{offsetX:12,offsetY:8,originX:"end",originY:"bottom",overlayX:"end",overlayY:"top"},{offsetX:12,offsetY:-8,originX:"end",originY:"top",overlayX:"end",overlayY:"bottom"}],this.currentPositionX="start",this.currentPositionY="bottom",this.document=s,this.origin=new n.CdkOverlayOrigin(this.elementRef)}return Object.defineProperty(e.prototype,"realOpenState",{get:function(){return this.isOpenHandledByUser()?!!this.open:this.overlayOpen},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){var e=this;this.inputValue=this.isRange?["",""]:"",this.datePickerService.valueChange$.pipe(y.takeUntil(this.destroy$)).subscribe((function(){e.updateInputValue()}))},e.prototype.ngAfterViewInit=function(){var e=this;this.autoFocus&&this.focus(),this.isRange&&this.platform.isBrowser&&this.nzResizeObserver.observe(this.elementRef).pipe(y.takeUntil(this.destroy$)).subscribe((function(){e.updateInputWidthAndArrowLeft()})),this.datePickerService.inputPartChange$.pipe(y.takeUntil(this.destroy$)).subscribe((function(t){var n;t&&(e.datePickerService.activeInput=t),e.focus(),e.updateInputWidthAndArrowLeft(),null===(n=e.panel)||void 0===n||n.updateActiveDate()}))},e.prototype.ngOnDestroy=function(){this.destroy$.next(),this.destroy$.complete()},e.prototype.ngOnChanges=function(e){var t,n;(null===(t=e.format)||void 0===t?void 0:t.currentValue)!==(null===(n=e.format)||void 0===n?void 0:n.previousValue)&&(this.inputSize=Math.max(10,this.format.length)+2,this.updateInputValue())},e.prototype.updateInputWidthAndArrowLeft=function(){var e,t,n;this.inputWidth=(null===(t=null===(e=this.rangePickerInputs)||void 0===e?void 0:e.first)||void 0===t?void 0:t.nativeElement.offsetWidth)||0;var i={position:"absolute",width:this.inputWidth+"px"};this.datePickerService.arrowLeft="left"===this.datePickerService.activeInput?0:this.inputWidth+(null===(n=this.separatorElement)||void 0===n?void 0:n.nativeElement.offsetWidth)||0,"rtl"===this.dir?this.activeBarStyle=Object.assign(Object.assign({},i),{right:this.datePickerService.arrowLeft+"px"}):this.activeBarStyle=Object.assign(Object.assign({},i),{left:this.datePickerService.arrowLeft+"px"}),this.panel.cdr.markForCheck(),this.cdr.markForCheck()},e.prototype.getInput=function(e){var t,n;if(!this.inline)return this.isRange?"left"===e?null===(t=this.rangePickerInputs)||void 0===t?void 0:t.first.nativeElement:null===(n=this.rangePickerInputs)||void 0===n?void 0:n.last.nativeElement:this.pickerInput.nativeElement},e.prototype.focus=function(){var e=this.getInput(this.datePickerService.activeInput);this.document.activeElement!==e&&(null==e||e.focus())},e.prototype.onFocus=function(e,t){e.preventDefault(),this.focusChange.emit(!0),t&&this.datePickerService.inputPartChange$.next(t)},e.prototype.onBlur=function(e){e.preventDefault(),this.focusChange.emit(!1)},e.prototype.showOverlay=function(){this.inline||this.realOpenState||this.disabled||(this.updateInputWidthAndArrowLeft(),this.overlayOpen=!0,this.focus(),this.panel.init(),this.openChange.emit(!0),this.cdr.markForCheck())},e.prototype.hideOverlay=function(){this.inline||this.realOpenState&&(this.overlayOpen=!1,this.openChange.emit(!1))},e.prototype.showClear=function(){return!this.disabled&&!this.isEmptyValue(this.datePickerService.value)&&!!this.allowClear},e.prototype.onClickInputBox=function(e){e.stopPropagation(),this.focus(),this.isOpenHandledByUser()||this.showOverlay()},e.prototype.onClickOutside=function(e){if(!this.elementRef.nativeElement.contains(e.target))if(this.panel.isAllowed(this.datePickerService.value,!0)){if(Array.isArray(this.datePickerService.value)&&u.wrongSortOrder(this.datePickerService.value)){var t=this.datePickerService.getActiveIndex(this.datePickerService.activeInput),n=this.datePickerService.value[t];return void this.panel.changeValueFromSelect(n,!0)}this.updateInputValue(),this.datePickerService.emitValue$.next()}else this.datePickerService.setValue(this.datePickerService.initialValue),this.hideOverlay()},e.prototype.onOverlayDetach=function(){this.hideOverlay()},e.prototype.onOverlayKeydown=function(e){e.keyCode===m.ESCAPE&&this.datePickerService.setValue(this.datePickerService.initialValue)},e.prototype.onPositionChange=function(e){this.currentPositionX=e.connectionPair.originX,this.currentPositionY=e.connectionPair.originY,this.cdr.detectChanges()},e.prototype.onClickClear=function(e){e.preventDefault(),e.stopPropagation(),this.datePickerService.setValue(this.isRange?[]:null),this.datePickerService.emitValue$.next()},e.prototype.updateInputValue=function(){var e=this,t=this.datePickerService.value;this.isRange?this.inputValue=t?t.map((function(t){return e.formatValue(t)})):["",""]:this.inputValue=this.formatValue(t),this.cdr.markForCheck()},e.prototype.formatValue=function(e){return this.dateHelper.format(e&&e.nativeDate,this.format)},e.prototype.onInputChange=function(e,t){if(void 0===t&&(t=!1),this.platform.TRIDENT||this.document.activeElement!==this.getInput(this.datePickerService.activeInput)||this.realOpenState){var n=this.checkValidDate(e);n&&this.panel.changeValueFromSelect(n,t)}else this.showOverlay()},e.prototype.onKeyupEnter=function(e){this.onInputChange(e.target.value,!0)},e.prototype.checkValidDate=function(e){var t=new u.CandyDate(this.dateHelper.parseDate(e,this.format));return t.isValid()&&e===this.dateHelper.format(t.nativeDate,this.format)?t:null},e.prototype.getPlaceholder=function(e){return this.isRange?this.placeholder[this.datePickerService.getActiveIndex(e)]:this.placeholder},e.prototype.isEmptyValue=function(e){return null===e||(this.isRange?!e||!Array.isArray(e)||e.every((function(e){return!e})):!e)},e.prototype.isOpenHandledByUser=function(){return void 0!==this.open},e}();H.decorators=[{type:a.Component,args:[{encapsulation:a.ViewEncapsulation.None,selector:"[nz-picker]",exportAs:"nzPicker",template:'\n <ng-container *ngIf="!inline; else inlineMode">\n \x3c!-- Content of single picker --\x3e\n <div *ngIf="!isRange" class="{{ prefixCls }}-input">\n <input\n #pickerInput\n [attr.id]="nzId"\n [class.ant-input-disabled]="disabled"\n [disabled]="disabled"\n [readOnly]="inputReadOnly"\n [(ngModel)]="inputValue"\n placeholder="{{ getPlaceholder() }}"\n [size]="inputSize"\n (focus)="onFocus($event)"\n (blur)="onBlur($event)"\n (ngModelChange)="onInputChange($event)"\n (keyup.enter)="onKeyupEnter($event)"\n />\n <ng-container *ngTemplateOutlet="tplRightRest"></ng-container>\n </div>\n\n \x3c!-- Content of range picker --\x3e\n <ng-container *ngIf="isRange">\n <div class="{{ prefixCls }}-input">\n <ng-container *ngTemplateOutlet="tplRangeInput; context: { partType: \'left\' }"></ng-container>\n </div>\n <div #separatorElement class="{{ prefixCls }}-range-separator">\n <span class="{{ prefixCls }}-separator">\n <ng-container *ngIf="separator; else defaultSeparator">{{ separator }}</ng-container>\n </span>\n <ng-template #defaultSeparator>\n <i nz-icon nzType="swap-right" nzTheme="outline"></i>\n </ng-template>\n </div>\n <div class="{{ prefixCls }}-input">\n <ng-container *ngTemplateOutlet="tplRangeInput; context: { partType: \'right\' }"></ng-container>\n </div>\n <ng-container *ngTemplateOutlet="tplRightRest"></ng-container>\n </ng-container>\n </ng-container>\n \x3c!-- Input for Range ONLY --\x3e\n <ng-template #tplRangeInput let-partType="partType">\n <input\n #rangePickerInput\n [disabled]="disabled"\n [readOnly]="inputReadOnly"\n [size]="inputSize"\n (click)="onClickInputBox($event)"\n (blur)="onBlur($event)"\n (focus)="onFocus($event, partType)"\n (keyup.enter)="onKeyupEnter($event)"\n [(ngModel)]="inputValue[datePickerService.getActiveIndex(partType)]"\n (ngModelChange)="onInputChange($event)"\n placeholder="{{ getPlaceholder(partType) }}"\n />\n </ng-template>\n\n \x3c!-- Right operator icons --\x3e\n <ng-template #tplRightRest>\n <div class="{{ prefixCls }}-active-bar" [ngStyle]="activeBarStyle"></div>\n <span *ngIf="showClear()" class="{{ prefixCls }}-clear" (click)="onClickClear($event)">\n <i nz-icon nzType="close-circle" nzTheme="fill"></i>\n </span>\n <span class="{{ prefixCls }}-suffix">\n <ng-container *nzStringTemplateOutlet="suffixIcon; let suffixIcon">\n <i nz-icon [nzType]="suffixIcon"></i>\n </ng-container>\n </span>\n </ng-template>\n\n <ng-template #inlineMode>\n <div class="ant-picker-wrapper" [nzNoAnimation]="noAnimation" [@slideMotion]="\'enter\'" style="position: relative;">\n <div\n class="{{ prefixCls }}-dropdown {{ dropdownClassName }}"\n [class.ant-picker-dropdown-rtl]="dir === \'rtl\'"\n [class.ant-picker-dropdown-placement-bottomLeft]="currentPositionY === \'bottom\' && currentPositionX === \'start\'"\n [class.ant-picker-dropdown-placement-topLeft]="currentPositionY === \'top\' && currentPositionX === \'start\'"\n [class.ant-picker-dropdown-placement-bottomRight]="currentPositionY === \'bottom\' && currentPositionX === \'end\'"\n [class.ant-picker-dropdown-placement-topRight]="currentPositionY === \'top\' && currentPositionX === \'end\'"\n [class.ant-picker-dropdown-range]="isRange"\n [class.ant-picker-active-left]="datePickerService.activeInput === \'left\'"\n [class.ant-picker-active-right]="datePickerService.activeInput === \'right\'"\n [ngStyle]="popupStyle"\n >\n \x3c!-- Compatible for overlay that not support offset dynamically and immediately --\x3e\n <ng-content></ng-content>\n </div>\n </div>\n </ng-template>\n\n \x3c!-- Overlay --\x3e\n <ng-template\n cdkConnectedOverlay\n nzConnectedOverlay\n [cdkConnectedOverlayOrigin]="origin"\n [cdkConnectedOverlayOpen]="realOpenState"\n [cdkConnectedOverlayPositions]="overlayPositions"\n [cdkConnectedOverlayTransformOriginOn]="\'.ant-picker-wrapper\'"\n (positionChange)="onPositionChange($event)"\n (detach)="onOverlayDetach()"\n (overlayKeydown)="onOverlayKeydown($event)"\n (overlayOutsideClick)="onClickOutside($event)"\n >\n <ng-container *ngTemplateOutlet="inlineMode"></ng-container>\n </ng-template>\n ',animations:[C.slideMotion],changeDetection:a.ChangeDetectionStrategy.OnPush}]}],H.ctorParameters=function(){return[{type:a.ElementRef},{type:g.DateHelperService},{type:a.ChangeDetectorRef},{type:k.Platform},{type:b.NzResizeObserver},{type:B},{type:void 0,decorators:[{type:a.Inject,args:[i.DOCUMENT]}]}]},H.propDecorators={noAnimation:[{type:a.Input}],isRange:[{type:a.Input}],open:[{type:a.Input}],disabled:[{type:a.Input}],inputReadOnly:[{type:a.Input}],inline:[{type:a.Input}],placeholder:[{type:a.Input}],allowClear:[{type:a.Input}],autoFocus:[{type:a.Input}],format:[{type:a.Input}],separator:[{type:a.Input}],popupStyle:[{type:a.Input}],dropdownClassName:[{type:a.Input}],suffixIcon:[{type:a.Input}],dir:[{type:a.Input}],nzId:[{type:a.Input}],focusChange:[{type:a.Output}],valueChange:[{type:a.Output}],openChange:[{type:a.Output}],cdkConnectedOverlay:[{type:a.ViewChild,args:[n.CdkConnectedOverlay,{static:!1}]}],separatorElement:[{type:a.ViewChild,args:["separatorElement",{static:!1}]}],pickerInput:[{type:a.ViewChild,args:["pickerInput",{static:!1}]}],rangePickerInputs:[{type:a.ViewChildren,args:["rangePickerInput"]}],panel:[{type:a.ContentChild,args:[E]}]};var A={position:"relative"},$=function(){function e(e,t,n,i,r,o,l,s,c){this.nzConfigService=e,this.datePickerService=t,this.i18n=n,this.cdr=i,this.renderer=r,this.elementRef=o,this.dateHelper=l,this.directionality=s,this.noAnimation=c,this._nzModuleName="datePicker",this.isRange=!1,this.focused=!1,this.dir="ltr",this.panelMode="date",this.destroyed$=new v.Subject,this.isCustomPlaceHolder=!1,this.isCustomFormat=!1,this.showTime=!1,this.nzAllowClear=!0,this.nzAutoFocus=!1,this.nzDisabled=!1,this.nzBorderless=!1,this.nzInputReadOnly=!1,this.nzInline=!1,this.nzPlaceHolder="",this.nzPopupStyle=A,this.nzSize="default",this.nzShowToday=!0,this.nzMode="date",this.nzShowNow=!0,this.nzDefaultPickerValue=null,this.nzSeparator=void 0,this.nzSuffixIcon="calendar",this.nzId=null,this.nzOnPanelChange=new a.EventEmitter,this.nzOnCalendarChange=new a.EventEmitter,this.nzOnOk=new a.EventEmitter,this.nzOnOpenChange=new a.EventEmitter,this.onChangeFn=function(){},this.onTouchedFn=function(){},this.elementRef.nativeElement.classList.add("ant-picker")}return Object.defineProperty(e.prototype,"nzShowTime",{get:function(){return this.showTime},set:function(e){this.showTime="object"==typeof e?e:h.toBoolean(e)},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){var e,t=this;this.nzLocale||this.i18n.localeChange.pipe(y.takeUntil(this.destroyed$)).subscribe((function(){return t.setLocale()})),this.datePickerService.isRange=this.isRange,this.datePickerService.initValue(),this.datePickerService.emitValue$.pipe(y.takeUntil(this.destroyed$)).subscribe((function(e){var n,i,a,r,o=t.datePickerService.value;if(t.datePickerService.initialValue=u.cloneDate(o),t.isRange){var l=o;l.length?t.onChangeFn([null!==(i=null===(n=l[0])||void 0===n?void 0:n.nativeDate)&&void 0!==i?i:null,null!==(r=null===(a=l[1])||void 0===a?void 0:a.nativeDate)&&void 0!==r?r:null]):t.onChangeFn([])}else o?t.onChangeFn(o.nativeDate):t.onChangeFn(null);t.onTouchedFn(),t.close()})),this.setModeAndFormat(),null===(e=this.directionality.change)||void 0===e||e.pipe(y.takeUntil(this.destroyed$)).subscribe((function(e){t.dir=e,t.cdr.detectChanges()})),this.dir=this.directionality.value},e.prototype.ngOnChanges=function(e){var t,n;e.nzPopupStyle&&(this.nzPopupStyle=this.nzPopupStyle?Object.assign(Object.assign({},this.nzPopupStyle),A):A),(null===(t=e.nzPlaceHolder)||void 0===t?void 0:t.currentValue)&&(this.isCustomPlaceHolder=!0),(null===(n=e.nzFormat)||void 0===n?void 0:n.currentValue)&&(this.isCustomFormat=!0),e.nzLocale&&this.setDefaultPlaceHolder(),e.nzRenderExtraFooter&&(this.extraFooter=h.valueFunctionProp(this.nzRenderExtraFooter)),e.nzMode&&(this.setDefaultPlaceHolder(),this.setModeAndFormat())},e.prototype.ngOnDestroy=function(){this.destroyed$.next(),this.destroyed$.complete()},e.prototype.setModeAndFormat=function(){var e={year:"yyyy",month:"yyyy-MM",week:this.i18n.getDateLocale()?"RRRR-II":"yyyy-ww",date:this.nzShowTime?"yyyy-MM-dd HH:mm:ss":"yyyy-MM-dd"};this.nzMode||(this.nzMode="date"),this.panelMode=this.isRange?[this.nzMode,this.nzMode]:this.nzMode,this.isCustomFormat||(this.nzFormat=e[this.nzMode])},e.prototype.onOpenChange=function(e){this.nzOnOpenChange.emit(e)},e.prototype.open=function(){this.picker.showOverlay()},e.prototype.close=function(){this.picker.hideOverlay()},e.prototype.writeValue=function(e){this.setValue(e),this.cdr.markForCheck()},e.prototype.registerOnChange=function(e){this.onChangeFn=e},e.prototype.registerOnTouched=function(e){this.onTouchedFn=e},e.prototype.setDisabledState=function(e){this.nzDisabled=e,this.cdr.markForCheck()},e.prototype.setLocale=function(){this.nzLocale=this.i18n.getLocaleData("DatePicker",{}),this.setDefaultPlaceHolder(),this.cdr.markForCheck()},e.prototype.setDefaultPlaceHolder=function(){if(!this.isCustomPlaceHolder&&this.nzLocale){var e={year:this.getPropertyOfLocale("yearPlaceholder"),month:this.getPropertyOfLocale("monthPlaceholder"),week:this.getPropertyOfLocale("weekPlaceholder"),date:this.getPropertyOfLocale("placeholder")},t={year:this.getPropertyOfLocale("rangeYearPlaceholder"),month:this.getPropertyOfLocale("rangeMonthPlaceholder"),week:this.getPropertyOfLocale("rangeWeekPlaceholder"),date:this.getPropertyOfLocale("rangePlaceholder")};this.nzPlaceHolder=this.isRange?t[this.nzMode]:e[this.nzMode]}},e.prototype.getPropertyOfLocale=function(e){return this.nzLocale.lang[e]||this.i18n.getLocaleData("DatePicker.lang."+e)},e.prototype.setValue=function(e){var t=this.datePickerService.makeValue(e);this.datePickerService.setValue(t),this.datePickerService.initialValue=t},e.prototype.onFocusChange=function(e){this.focused=e,this.focused?this.renderer.addClass(this.elementRef.nativeElement,"ant-picker-focused"):this.renderer.removeClass(this.elementRef.nativeElement,"ant-picker-focused")},e.prototype.onPanelModeChange=function(e){this.nzOnPanelChange.emit(e)},e.prototype.onCalendarChange=function(e){if(this.isRange&&Array.isArray(e)){var t=e.filter((function(e){return e instanceof u.CandyDate})).map((function(e){return e.nativeDate}));this.nzOnCalendarChange.emit(t)}},e.prototype.onResultOk=function(){var e,t;if(this.isRange){var n=this.datePickerService.value;n.length?this.nzOnOk.emit([(null===(e=n[0])||void 0===e?void 0:e.nativeDate)||null,(null===(t=n[1])||void 0===t?void 0:t.nativeDate)||null]):this.nzOnOk.emit([])}else this.datePickerService.value?this.nzOnOk.emit(this.datePickerService.value.nativeDate):this.nzOnOk.emit(null)},e}();$.decorators=[{type:a.Component,args:[{encapsulation:a.ViewEncapsulation.None,changeDetection:a.ChangeDetectionStrategy.OnPush,selector:"nz-date-picker,nz-week-picker,nz-month-picker,nz-year-picker,nz-range-picker",exportAs:"nzDatePicker",template:'\n <div\n nz-picker\n [isRange]="isRange"\n [open]="nzOpen"\n [dir]="dir"\n [separator]="nzSeparator"\n [disabled]="nzDisabled"\n [inputReadOnly]="nzInputReadOnly"\n [inline]="nzInline"\n [format]="nzFormat"\n [allowClear]="nzAllowClear"\n [autoFocus]="nzAutoFocus"\n [placeholder]="nzPlaceHolder"\n style="display: inherit; align-items: center; width: 100%;"\n [dropdownClassName]="nzDropdownClassName"\n [class.ant-picker-dropdown-rtl]="dir === \'rtl\'"\n [popupStyle]="nzPopupStyle"\n [noAnimation]="!!noAnimation?.nzNoAnimation"\n [suffixIcon]="nzSuffixIcon"\n (openChange)="onOpenChange($event)"\n (focusChange)="onFocusChange($event)"\n [nzId]="nzId"\n >\n <date-range-popup\n [isRange]="isRange"\n [inline]="nzInline"\n [defaultPickerValue]="nzDefaultPickerValue"\n [showWeek]="nzMode === \'week\'"\n [panelMode]="panelMode"\n (panelModeChange)="onPanelModeChange($event)"\n (calendarChange)="onCalendarChange($event)"\n [locale]="nzLocale?.lang!"\n [showToday]="nzMode === \'date\' && nzShowToday && !isRange && !nzShowTime"\n [showNow]="nzMode === \'date\' && nzShowNow && !isRange && !!nzShowTime"\n [showTime]="nzShowTime"\n [dateRender]="nzDateRender"\n [disabledDate]="nzDisabledDate"\n [disabledTime]="nzDisabledTime"\n [extraFooter]="extraFooter"\n [ranges]="nzRanges"\n [dir]="dir"\n (resultOk)="onResultOk()"\n ></date-range-popup>\n </div>\n ',host:{"[class.ant-picker-range]":"isRange","[class.ant-picker-large]":"nzSize === 'large'","[class.ant-picker-small]":"nzSize === 'small'","[class.ant-picker-disabled]":"nzDisabled","[class.ant-picker-rtl]":"dir === 'rtl'","[class.ant-picker-borderless]":"nzBorderless","[class.ant-picker-inline]":"nzInline","(click)":"picker.onClickInputBox($event)"},providers:[B,{provide:r.NG_VALUE_ACCESSOR,multi:!0,useExisting:a.forwardRef((function(){return $}))}]}]}],$.ctorParameters=function(){return[{type:f.NzConfigService},{type:B},{type:g.NzI18nService},{type:a.ChangeDetectorRef},{type:a.Renderer2},{type:a.ElementRef},{type:g.DateHelperService},{type:t.Directionality,decorators:[{type:a.Optional}]},{type:l.NzNoAnimationDirective,decorators:[{type:a.Host},{type:a.Optional}]}]},$.propDecorators={nzAllowClear:[{type:a.Input}],nzAutoFocus:[{type:a.Input}],nzDisabled:[{type:a.Input}],nzBorderless:[{type:a.Input}],nzInputReadOnly:[{type:a.Input}],nzInline:[{type:a.Input}],nzOpen:[{type:a.Input}],nzDisabledDate:[{type:a.Input}],nzLocale:[{type:a.Input}],nzPlaceHolder:[{type:a.Input}],nzPopupStyle:[{type:a.Input}],nzDropdownClassName:[{type:a.Input}],nzSize:[{type:a.Input}],nzFormat:[{type:a.Input}],nzDateRender:[{type:a.Input}],nzDisabledTime:[{type:a.Input}],nzRenderExtraFooter:[{type:a.Input}],nzShowToday:[{type:a.Input}],nzMode:[{type:a.Input}],nzShowNow:[{type:a.Input}],nzRanges:[{type:a.Input}],nzDefaultPickerValue:[{type:a.Input}],nzSeparator:[{type:a.Input}],nzSuffixIcon:[{type:a.Input}],nzId:[{type:a.Input}],nzOnPanelChange:[{type:a.Output}],nzOnCalendarChange:[{type:a.Output}],nzOnOk:[{type:a.Output}],nzOnOpenChange:[{type:a.Output}],picker:[{type:a.ViewChild,args:[H,{static:!0}]}],nzShowTime:[{type:a.Input}]},T([h.InputBoolean(),V("design:type",Boolean)],$.prototype,"nzAllowClear",void 0),T([h.InputBoolean(),V("design:type",Boolean)],$.prototype,"nzAutoFocus",void 0),T([h.InputBoolean(),V("design:type",Boolean)],$.prototype,"nzDisabled",void 0),T([h.InputBoolean(),V("design:type",Boolean)],$.prototype,"nzBorderless",void 0),T([h.InputBoolean(),V("design:type",Boolean)],$.prototype,"nzInputReadOnly",void 0),T([h.InputBoolean(),V("design:type",Boolean)],$.prototype,"nzInline",void 0),T([h.InputBoolean(),V("design:type",Boolean)],$.prototype,"nzOpen",void 0),T([h.InputBoolean(),V("design:type",Boolean)],$.prototype,"nzShowToday",void 0),T([h.InputBoolean(),V("design:type",Boolean)],$.prototype,"nzShowNow",void 0),T([f.WithConfig(),V("design:type",String)],$.prototype,"nzSeparator",void 0),T([f.WithConfig(),V("design:type",Object)],$.prototype,"nzSuffixIcon",void 0);var F=function(){function e(){this.panelModeChange=new a.EventEmitter,this.headerChange=new a.EventEmitter,this.selectDate=new a.EventEmitter,this.selectTime=new a.EventEmitter,this.cellHover=new a.EventEmitter,this.prefixCls=w}return e.prototype.enablePrevNext=function(e,t){return!(!this.showTimePicker&&t===this.endPanelMode&&("left"===this.partType&&"next"===e||"right"===this.partType&&"prev"===e))},e.prototype.onSelectTime=function(e){this.selectTime.emit(new u.CandyDate(e))},e.prototype.onSelectDate=function(e){var t=e instanceof u.CandyDate?e:new u.CandyDate(e),n=this.timeOptions&&this.timeOptions.nzDefaultOpenValue;!this.value&&n&&t.setHms(n.getHours(),n.getMinutes(),n.getSeconds()),this.selectDate.emit(t)},e.prototype.onChooseMonth=function(e){this.activeDate=this.activeDate.setMonth(e.getMonth()),"month"===this.endPanelMode?(this.value=e,this.selectDate.emit(e)):(this.headerChange.emit(e),this.panelModeChange.emit(this.endPanelMode))},e.prototype.onChooseYear=function(e){this.activeDate=this.activeDate.setYear(e.getYear()),"year"===this.endPanelMode?(this.value=e,this.selectDate.emit(e)):(this.headerChange.emit(e),this.panelModeChange.emit(this.endPanelMode))},e.prototype.onChooseDecade=function(e){this.activeDate=this.activeDate.setYear(e.getYear()),"decade"===this.endPanelMode?(this.value=e,this.selectDate.emit(e)):(this.headerChange.emit(e),this.panelModeChange.emit("year"))},e.prototype.ngOnChanges=function(e){e.activeDate&&!e.activeDate.currentValue&&(this.activeDate=new u.CandyDate),e.panelMode&&"time"===e.panelMode.currentValue&&(this.panelMode="date")},e}();F.decorators=[{type:a.Component,args:[{encapsulation:a.ViewEncapsulation.None,changeDetection:a.ChangeDetectionStrategy.OnPush,selector:"inner-popup",exportAs:"innerPopup",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>\n </div>\n </ng-container>\n <ng-container *ngSwitchCase="\'month\'">\n <month-header\n [(value)]="activeDate"\n [locale]="locale"\n [showSuperPreBtn]="enablePrevNext(\'prev\', \'month\')"\n [showSuperNextBtn]="enablePrevNext(\'next\', \'month\')"\n [showNextBtn]="false"\n [showPreBtn]="false"\n (panelModeChange)="panelModeChange.emit($event)"\n (valueChange)="headerChange.emit($event)"\n ></month-header>\n <div class="{{ prefixCls }}-body">\n <month-table\n [value]="value"\n [activeDate]="activeDate"\n [locale]="locale"\n [disabledDate]="disabledDate"\n [selectedValue]="selectedValue"\n [hoverValue]="hoverValue"\n (valueChange)="onChooseMonth($event)"\n (cellHover)="cellHover.emit($event)"\n ></month-table>\n </div>\n </ng-container>\n\n <ng-container *ngSwitchDefault>\n <date-header\n [(value)]="activeDate"\n [locale]="locale"\n [showSuperPreBtn]="showWeek ? enablePrevNext(\'prev\', \'week\') : enablePrevNext(\'prev\', \'date\')"\n [showSuperNextBtn]="showWeek ? enablePrevNext(\'next\', \'week\') : enablePrevNext(\'next\', \'date\')"\n [showPreBtn]="showWeek ? enablePrevNext(\'prev\', \'week\') : enablePrevNext(\'prev\', \'date\')"\n [showNextBtn]="showWeek ? enablePrevNext(\'next\', \'week\') : enablePrevNext(\'next\', \'date\')"\n (panelModeChange)="panelModeChange.emit($event)"\n (valueChange)="headerChange.emit($event)"\n ></date-header>\n <div class="{{ prefixCls }}-body">\n <date-table\n [locale]="locale"\n [showWeek]="showWeek"\n [value]="value"\n [activeDate]="activeDate"\n [disabledDate]="disabledDate"\n [cellRender]="dateRender"\n [selectedValue]="selectedValue"\n [hoverValue]="hoverValue"\n (valueChange)="onSelectDate($event)"\n (cellHover)="cellHover.emit($event)"\n ></date-table>\n </div>\n </ng-container>\n </ng-container>\n </div>\n <ng-container *ngIf="showTimePicker && timeOptions">\n <nz-time-picker-panel\n [nzInDatePicker]="true"\n [ngModel]="value?.nativeDate"\n (ngModelChange)="onSelectTime($event)"\n [format]="$any(timeOptions.nzFormat)"\n [nzHourStep]="$any(timeOptions.nzHourStep)"\n [nzMinuteStep]="$any(timeOptions.nzMinuteStep)"\n [nzSecondStep]="$any(timeOptions.nzSecondStep)"\n [nzDisabledHours]="$any(timeOptions.nzDisabledHours)"\n [nzDisabledMinutes]="$any(timeOptions.nzDisabledMinutes)"\n [nzDisabledSeconds]="$any(timeOptions.nzDisabledSeconds)"\n [nzHideDisabledOptions]="!!timeOptions.nzHideDisabledOptions"\n [nzDefaultOpenValue]="$any(timeOptions.nzDefaultOpenValue)"\n [nzUse12Hours]="!!timeOptions.nzUse12Hours"\n [nzAddOn]="$any(timeOptions.nzAddOn)"\n ></nz-time-picker-panel>\n \x3c!-- use [opened] to trigger time panel `initPosition()` --\x3e\n </ng-container>\n </div>\n '}]}],F.propDecorators={activeDate:[{type:a.Input}],endPanelMode:[{type:a.Input}],panelMode:[{type:a.Input}],showWeek:[{type:a.Input}],locale:[{type:a.Input}],showTimePicker:[{type:a.Input}],timeOptions