UNPKG

@lxlib/seed

Version:

This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 9.1.1.

16 lines (14 loc) 7.58 kB
!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("@angular/core"),require("@angular/forms"),require("@angular/platform-browser"),require("@lxlib/util"),require("ng-zorro-antd/date-picker"),require("@angular/common")):"function"==typeof define&&define.amd?define("@lxlib/seed/date-picker",["exports","@angular/core","@angular/forms","@angular/platform-browser","@lxlib/util","ng-zorro-antd/date-picker","@angular/common"],n):n(((e=e||self).lxlib=e.lxlib||{},e.lxlib.seed=e.lxlib.seed||{},e.lxlib.seed["date-picker"]={}),e.ng.core,e.ng.forms,e.ng.platformBrowser,e.lxlib.util,e["ng-zorro-antd/date-picker"],e.ng.common)}(this,(function(e,n,t,o,r,i,a){"use strict"; /*! ***************************************************************************** Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */function l(e,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,n)}function u(e,n){var t="function"==typeof Symbol&&e[Symbol.iterator];if(!t)return e;var o,r,i=t.call(e),a=[];try{for(;(void 0===n||n-- >0)&&!(o=i.next()).done;)a.push(o.value)}catch(e){r={error:e}}finally{try{o&&!o.done&&(t=i.return)&&t.call(i)}finally{if(r)throw r.error}}return a}function s(){for(var e=[],n=0;n<arguments.length;n++)e=e.concat(u(arguments[n]));return e}var p=function(){this.nzFormat="yyyy-MM-dd",this.nzAllowClear=!0,this.nzAutoFocus=!1,this.nzDisabled=!1,this.nzPopupStyle={position:"relative"},this.nzShowToday=!0,this.shortcuts={enabled:!1,closed:!0,list:[{text:"今天",fn:function(){return r.getTimeDistance("today")}},{text:"昨天",fn:function(){return r.getTimeDistance("yesterday")}},{text:"近3天",fn:function(){return r.getTimeDistance(-2)}},{text:"近7天",fn:function(){return r.getTimeDistance(-6)}},{text:"本周",fn:function(){return r.getTimeDistance("week")}},{text:"本月",fn:function(){return r.getTimeDistance("month")}},{text:"全年",fn:function(){return r.getTimeDistance("year")}}]}};var c=function(){function e(){}return e.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],e.ɵprov=n.ɵɵdefineInjectable({factory:function(){return new e},token:e,providedIn:"root"}),e}();var d=function(){function e(e,t){this.dom=t,this.value=[],this.ngModelEndChange=new n.EventEmitter,this.nzAllowClear=!0,this.nzAutoFocus=!1,this.nzOnOpenChange=new n.EventEmitter,this.nzShowToday=!0,this.nzOnPanelChange=new n.EventEmitter,this.nzOnOk=new n.EventEmitter,this._cog=r.deepMergeKey(new p,!0,e&&e.range),Object.assign(this,this._cog)}return Object.defineProperty(e.prototype,"shortcut",{get:function(){return this._shortcut},set:function(e){var n=this,t=r.deepMergeKey({},!0,this._cog.shortcuts,null==e?{}:e);"boolean"==typeof e&&(t.enabled=e),(t.list||[]).forEach((function(e){e._text=n.dom.bypassSecurityTrustHtml(e.text)})),this._shortcut=t},enumerable:!0,configurable:!0}),e.prototype._nzOnOpenChange=function(e){this.nzOnOpenChange.emit(e)},e.prototype._nzOnPanelChange=function(e){this.nzOnPanelChange.emit(e)},e.prototype._nzOnOk=function(e){this.nzOnOk.emit(e)},e.prototype.valueChange=function(e){e=r.fixEndTimeOfRange(e),this.onChangeFn(e[0]),this.ngModelEnd=e[1],this.ngModelEndChange.emit(e[1])},e.prototype.writeValue=function(e){this.value=e&&this.ngModelEnd?[e,this.ngModelEnd]:[]},e.prototype.registerOnChange=function(e){this.onChangeFn=e},e.prototype.registerOnTouched=function(e){},e.prototype.setDisabledState=function(e){this.nzDisabled=e},e.prototype.clickShortcut=function(e){this.value=e.fn(this.value),this.valueChange(this.value),this._shortcut.closed&&this.comp.picker.hideOverlay()},e.decorators=[{type:n.Component,args:[{selector:"range-picker",exportAs:"rangePicker",template:'<nz-range-picker #comp\n [ngModel]="value"\n (ngModelChange)="valueChange($event)"\n [nzAllowClear]="nzAllowClear"\n [nzAutoFocus]="nzAutoFocus"\n [class]="nzClassName"\n [nzDisabled]="nzDisabled"\n [nzSize]="nzSize"\n [nzDisabledDate]="nzDisabledDate"\n [nzLocale]="nzLocale"\n [nzPopupStyle]="nzPopupStyle"\n [nzDropdownClassName]="nzDropdownClassName"\n [style]="nzStyle"\n [nzPlaceHolder]="nzPlaceHolder"\n (nzOnOpenChange)="_nzOnOpenChange($event)"\n [nzDateRender]="nzDateRender"\n [nzDisabledTime]="nzDisabledTime"\n [nzFormat]="nzFormat"\n [nzRenderExtraFooter]="nzRenderExtraFooter || (shortcut?.enabled ? shortcutTpl : null)"\n [nzShowTime]="nzShowTime"\n [nzShowToday]="nzShowToday"\n [nzMode]="nzMode"\n [nzRanges]="nzRanges"\n (nzOnPanelChange)="_nzOnPanelChange($event)"\n (nzOnOk)="_nzOnOk($event)"></nz-range-picker>\n<ng-template #shortcutTpl>\n <a *ngFor="let i of shortcut?.list;let first=first"\n (click)="clickShortcut(i)"\n [innerHTML]="i._text"\n [ngClass]="{\'ml-sm\': !first}"></a>\n</ng-template>\n',providers:[{provide:t.NG_VALUE_ACCESSOR,multi:!0,useExisting:n.forwardRef((function(){return e}))}]}]}],e.ctorParameters=function(){return[{type:c},{type:o.DomSanitizer}]},e.propDecorators={comp:[{type:n.ViewChild,args:["comp",{static:!1}]}],ngModelEnd:[{type:n.Input}],shortcut:[{type:n.Input}],ngModelEndChange:[{type:n.Output}],nzAllowClear:[{type:n.Input}],nzAutoFocus:[{type:n.Input}],nzClassName:[{type:n.Input}],nzDisabled:[{type:n.Input}],nzSize:[{type:n.Input}],nzStyle:[{type:n.Input}],nzDisabledDate:[{type:n.Input}],nzLocale:[{type:n.Input}],nzPopupStyle:[{type:n.Input}],nzDropdownClassName:[{type:n.Input}],nzPlaceHolder:[{type:n.Input}],nzOnOpenChange:[{type:n.Output}],nzDateRender:[{type:n.Input}],nzFormat:[{type:n.Input}],nzDisabledTime:[{type:n.Input}],nzRenderExtraFooter:[{type:n.Input}],nzShowTime:[{type:n.Input}],nzShowToday:[{type:n.Input}],nzMode:[{type:n.Input}],nzRanges:[{type:n.Input}],nzOnPanelChange:[{type:n.Output}],nzOnOk:[{type:n.Output}]},function(e,n,t,o){var r,i=arguments.length,a=i<3?n:null===o?o=Object.getOwnPropertyDescriptor(n,t):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,n,t,o);else for(var l=e.length-1;l>=0;l--)(r=e[l])&&(a=(i<3?r(a):i>3?r(n,t,a):r(n,t))||a);i>3&&a&&Object.defineProperty(n,t,a)}([r.InputBoolean(),l("design:type",Boolean)],e.prototype,"nzShowToday",void 0),e}();var f=[d],h=function(){function e(){}return e.decorators=[{type:n.NgModule,args:[{imports:[a.CommonModule,t.FormsModule,i.NzDatePickerModule],declarations:s(f),exports:s(f)}]}],e}();e.DatePickerConfig=c,e.DatePickerModule=h,e.DateRangePickerConfig=p,e.RangePickerComponent=d,Object.defineProperty(e,"__esModule",{value:!0})})); //# sourceMappingURL=datePicker.umd.min.js.map