ng-zorro-antd
Version:
An enterprise-class UI components based on Ant Design and Angular
16 lines (14 loc) • 4.99 kB
JavaScript
!function(n,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("ng-zorro-antd/core/config"),require("ng-zorro-antd/core/util"),require("rxjs"),require("rxjs/operators"),require("@angular/cdk/observers"),require("@angular/common")):"function"==typeof define&&define.amd?define("ng-zorro-antd/spin",["exports","@angular/core","ng-zorro-antd/core/config","ng-zorro-antd/core/util","rxjs","rxjs/operators","@angular/cdk/observers","@angular/common"],e):e(((n=n||self)["ng-zorro-antd"]=n["ng-zorro-antd"]||{},n["ng-zorro-antd"].spin={}),n.ng.core,n["ng-zorro-antd"].core.config,n["ng-zorro-antd"].core.util,n.rxjs,n.rxjs.operators,n.ng.cdk.observers,n.ng.common)}(this,(function(n,e,t,i,o,r,s,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 p(n,e,t,i){var o,r=arguments.length,s=r<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,t):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(n,e,t,i);else for(var a=n.length-1;a>=0;a--)(o=n[a])&&(s=(r<3?o(s):r>3?o(e,t,s):o(e,t))||s);return r>3&&s&&Object.defineProperty(e,t,s),s}function c(n,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(n,e)}var l=function(){function n(n,e){this.nzConfigService=n,this.cdr=e,this.nzSize="default",this.nzTip=null,this.nzDelay=0,this.nzSimple=!1,this.nzSpinning=!0,this.destroy$=new o.Subject,this.spinning$=new o.BehaviorSubject(this.nzSpinning),this.delay$=new o.BehaviorSubject(this.nzDelay),this.isLoading=!0}return n.prototype.ngOnInit=function(){var n=this;this.spinning$.pipe(r.flatMap((function(){return n.delay$})),r.flatMap((function(e){return 0===e?n.spinning$:n.spinning$.pipe(r.debounceTime(e))})),r.takeUntil(this.destroy$)).subscribe((function(e){n.isLoading=e,n.cdr.markForCheck()})),this.nzConfigService.getConfigChangeEventForComponent("spin").pipe(r.takeUntil(this.destroy$)).subscribe((function(){return n.cdr.markForCheck()}))},n.prototype.ngOnChanges=function(n){var e=n.nzSpinning,t=n.nzDelay;e&&this.spinning$.next(this.nzSpinning),t&&this.delay$.next(this.nzDelay)},n.prototype.ngOnDestroy=function(){this.destroy$.next(),this.destroy$.complete()},n.decorators=[{type:e.Component,args:[{selector:"nz-spin",exportAs:"nzSpin",preserveWhitespaces:!1,encapsulation:e.ViewEncapsulation.None,template:'\n <ng-template #defaultTemplate>\n <span class="ant-spin-dot ant-spin-dot-spin">\n <i class="ant-spin-dot-item"></i>\n <i class="ant-spin-dot-item"></i>\n <i class="ant-spin-dot-item"></i>\n <i class="ant-spin-dot-item"></i>\n </span>\n </ng-template>\n <div *ngIf="isLoading">\n <div\n class="ant-spin"\n [class.ant-spin-spinning]="isLoading"\n [class.ant-spin-lg]="nzSize === \'large\'"\n [class.ant-spin-sm]="nzSize === \'small\'"\n [class.ant-spin-show-text]="nzTip"\n >\n <ng-template [ngTemplateOutlet]="nzIndicator || defaultTemplate"></ng-template>\n <div class="ant-spin-text" *ngIf="nzTip">{{ nzTip }}</div>\n </div>\n </div>\n <div *ngIf="!nzSimple" class="ant-spin-container" [class.ant-spin-blur]="isLoading">\n <ng-content></ng-content>\n </div>\n ',host:{"[class.ant-spin-nested-loading]":"!nzSimple"}}]}],n.ctorParameters=function(){return[{type:t.NzConfigService},{type:e.ChangeDetectorRef}]},n.propDecorators={nzIndicator:[{type:e.Input}],nzSize:[{type:e.Input}],nzTip:[{type:e.Input}],nzDelay:[{type:e.Input}],nzSimple:[{type:e.Input}],nzSpinning:[{type:e.Input}]},p([t.WithConfig("spin"),c("design:type",e.TemplateRef)],n.prototype,"nzIndicator",void 0),p([i.InputNumber(),c("design:type",Object)],n.prototype,"nzDelay",void 0),p([i.InputBoolean(),c("design:type",Object)],n.prototype,"nzSimple",void 0),p([i.InputBoolean(),c("design:type",Object)],n.prototype,"nzSpinning",void 0),n}();var d=function(){function n(){}return n.decorators=[{type:e.NgModule,args:[{exports:[l],declarations:[l],imports:[a.CommonModule,s.ObserversModule]}]}],n}();n.NzSpinComponent=l,n.NzSpinModule=d,Object.defineProperty(n,"__esModule",{value:!0})}));
//# sourceMappingURL=ng-zorro-antd-spin.umd.min.js.map