ng-zorro-antd
Version:
An enterprise-class UI components based on Ant Design and Angular
2 lines • 12.2 kB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/cdk/portal"),require("@angular/core"),require("@angular/platform-browser"),require("rxjs"),require("ng-zorro-antd/core"),require("rxjs/operators"),require("ng-zorro-antd/i18n"),require("@angular/common")):"function"==typeof define&&define.amd?define("ng-zorro-antd/empty",["exports","@angular/cdk/portal","@angular/core","@angular/platform-browser","rxjs","ng-zorro-antd/core","rxjs/operators","ng-zorro-antd/i18n","@angular/common"],e):e(((t=t||self)["ng-zorro-antd"]=t["ng-zorro-antd"]||{},t["ng-zorro-antd"].empty={}),t.ng.cdk.portal,t.ng.core,t.ng.platformBrowser,t.rxjs,t["ng-zorro-antd"].core,t.rxjs.operators,t["ng-zorro-antd"].i18n,t.ng.common)}(this,function(t,e,n,o,g,i,I,M,r){"use strict";var c=new n.InjectionToken("nz-empty-content"),a=new n.InjectionToken("nz-empty-component-name"),s="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTg0IiBoZWlnaHQ9IjE1MiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48ZyBmaWxsPSJub25lIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiPjxnIHRyYW5zZm9ybT0idHJhbnNsYXRlKDI0IDMxLjY3KSI+PGVsbGlwc2UgZmlsbC1vcGFjaXR5PSIuOCIgZmlsbD0iI0Y1RjVGNyIgY3g9IjY3Ljc5NyIgY3k9IjEwNi44OSIgcng9IjY3Ljc5NyIgcnk9IjEyLjY2OCIvPjxwYXRoIGQ9Ik0xMjIuMDM0IDY5LjY3NEw5OC4xMDkgNDAuMjI5Yy0xLjE0OC0xLjM4Ni0yLjgyNi0yLjIyNS00LjU5My0yLjIyNWgtNTEuNDRjLTEuNzY2IDAtMy40NDQuODM5LTQuNTkyIDIuMjI1TDEzLjU2IDY5LjY3NHYxNS4zODNoMTA4LjQ3NVY2OS42N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jE0NTY5NTMsMS4yNTczOTYzMyBMMi42MTQ3OTcyN2UtMTIsMTIuNzYwNTYwNCBMMCwyMiBMNDYsMjIgTDQ2LDEyLjc2MDU2MDQgWiIgID48L3BhdGg+CiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgPHBhdGggZD0iTTMyLjYxMzI4MTMsMTUuOTMxNSBDMzIuNjEzMjgxMywxNC4zMjU4NTExIDMzLjYwNjk1MzEsMTMuMDAwMjM0IDM0LjgzOTY5OTIsMTMgTDQ2LDEzIEw0NiwzMS4xMzcxMjc3IEM0NiwzMy4yNTg5NTc0IDQ0LjY3OTM4NjcsMzUgNDMuMDUwNDI5NywzNSBMMi45NDk1NzAzMSwzNSBDMS4zMjA1MjM0NCwzNSAwLDMzLjI1ODg0MDQgMCwzMS4xMzcxMjc3IEwwLDEzIEwxMS4xNjAzMDA4LDEzIEMxMi4zOTMwNDY5LDEzIDEzLjM4NjcxODgsMTQuMzIyODA4NSAxMy4zODY3MTg4LDE1LjkyODQ1NzQgTDEzLjM4NjcxODgsMTUuOTQ5NjM4MyBDMTMuMzg2NzE4OCwxNy41NTUyODcyIDE0LjM5MTcxMDksMTguODUxMTgwOSAxNS42MjQ0NTcsMTguODUxMTgwOSBMMzAuMzc1NTQzLDE4Ljg1MTE4MDkgQzMxLjYwODI4OTEsMTguODUxMTgwOSAzMi42MTMyODEzLDE3LjU0MzM1MTEgMzIuNjEzMjgxMywxNS45Mzc3MDIxIEwzMi42MTMyODEzLDE1LjkzMTUgWiIgIGZpbGw9IiNGQUZBRkEiPjwvcGF0aD4KICAgICAgICAgICAgICAgICAgICAgICAgICAgIDwvZz4KICAgICAgICAgICAgICAgICAgICAgICAgPC9nPgogICAgICAgICAgICAgICAgICAgIDwvZz4KICAgICAgICAgICAgICAgIDwvZz4KICAgICAgICAgICAgPC9nPgogICAgICAgIDwvZz4KICAgIDwvZz4KPC9zdmc+",N=function(){function t(t,e){var n=this;this.nzConfigService=t,this.legacyDefaultEmptyContent=e,this.userDefaultContent$=new g.BehaviorSubject(void 0),e&&i.warnDeprecation("'NZ_DEFAULT_EMPTY_CONTENT' is deprecated and would be removed in 9.0.0. Please migrate to 'NZ_CONFIG'.");var o=this.getUserDefaultEmptyContent();o&&this.userDefaultContent$.next(o),this.nzConfigService.getConfigChangeEventForComponent("empty").subscribe(function(){n.userDefaultContent$.next(n.getUserDefaultEmptyContent())})}return t.prototype.setDefaultContent=function(t){if(i.warnDeprecation("'setDefaultContent' is deprecated and would be removed in 9.0.0. Please migrate to 'NzConfigService'."),!("string"==typeof t||null==t||t instanceof n.TemplateRef||t instanceof n.Type))throw new Error(i.PREFIX+" 'useDefaultContent' expect 'string', 'templateRef' or 'component' but get "+t+".");this.userDefaultContent$.next(t)},t.prototype.resetDefault=function(){i.warnDeprecation("'resetDefault' is deprecated and would be removed in 9.0.0. Please migrate to 'NzConfigService' and provide an 'undefined'."),this.userDefaultContent$.next(void 0)},t.prototype.getUserDefaultEmptyContent=function(){return(this.nzConfigService.getConfigForComponent("empty")||{}).nzDefaultEmptyContent||this.legacyDefaultEmptyContent},t.decorators=[{type:n.Injectable,args:[{providedIn:"root"}]}],t.ctorParameters=function(){return[{type:i.NzConfigService},{type:n.Type,decorators:[{type:n.Inject,args:[c]},{type:n.Optional}]}]},t.ngInjectableDef=n.ɵɵdefineInjectable({factory:function(){return new t(n.ɵɵinject(i.NzConfigService),n.ɵɵinject(c,8))},token:t,providedIn:"root"}),t}();var D=function(){function t(t,e,n,o,i){this.emptyService=t,this.sanitizer=e,this.viewContainerRef=n,this.cdr=o,this.injector=i,this.contentType="string",this.defaultSvg=this.sanitizer.bypassSecurityTrustResourceUrl(u),this.size="",this.subs_=new g.Subscription}return t.prototype.ngOnChanges=function(t){t.nzComponentName&&(this.size=this.getEmptySize(t.nzComponentName.currentValue)),t.specificContent&&!t.specificContent.isFirstChange()&&(this.content=t.specificContent.currentValue,this.renderEmpty())},t.prototype.ngOnInit=function(){var t=this,e=this.emptyService.userDefaultContent$.subscribe(function(e){t.content=t.specificContent||e,t.renderEmpty()});this.subs_.add(e)},t.prototype.ngOnDestroy=function(){this.subs_.unsubscribe()},t.prototype.getEmptySize=function(t){switch(t){case"table":case"list":return"normal";case"select":case"tree-select":case"cascader":case"transfer":return"small";default:return""}},t.prototype.renderEmpty=function(){var t=this.content;if("string"==typeof t)this.contentType="string";else if(t instanceof n.TemplateRef){var o={$implicit:this.nzComponentName};this.contentType="template",this.contentPortal=new e.TemplatePortal(t,this.viewContainerRef,o)}else if(t instanceof n.Type){o=new WeakMap([[a,this.nzComponentName]]);var g=new e.PortalInjector(this.injector,o);this.contentType="component",this.contentPortal=new e.ComponentPortal(t,this.viewContainerRef,g)}else this.contentType="string",this.contentPortal=void 0;this.cdr.markForCheck()},t.decorators=[{type:n.Component,args:[{changeDetection:n.ChangeDetectionStrategy.OnPush,encapsulation:n.ViewEncapsulation.None,selector:"nz-embed-empty",exportAs:"nzEmbedEmpty",template:'<ng-container *ngIf="!content && specificContent !== null" [ngSwitch]="size">\n <nz-empty *ngSwitchCase="\'normal\'" class="ant-empty-normal" [nzNotFoundImage]="defaultSvg"></nz-empty>\n <nz-empty *ngSwitchCase="\'small\'" class="ant-empty-small" [nzNotFoundImage]="defaultSvg"></nz-empty>\n <nz-empty *ngSwitchDefault></nz-empty>\n</ng-container>\n<ng-container *ngIf="content">\n <ng-template *ngIf="contentType !== \'string\'" [cdkPortalOutlet]="contentPortal"></ng-template>\n <ng-container *ngIf="contentType === \'string\'">\n {{ content }}\n </ng-container>\n</ng-container>\n'}]}],t.ctorParameters=function(){return[{type:N},{type:o.DomSanitizer},{type:n.ViewContainerRef},{type:n.ChangeDetectorRef},{type:n.Injector}]},t.propDecorators={nzComponentName:[{type:n.Input}],specificContent:[{type:n.Input}]},t}();var C=function(){function t(t,e,n){this.sanitizer=t,this.i18n=e,this.cdr=n,this.defaultSvg=this.sanitizer.bypassSecurityTrustResourceUrl(s),this.isContentString=!1,this.locale={},this.destroy$=new g.Subject}return Object.defineProperty(t.prototype,"shouldRenderContent",{get:function(){var t=this.nzNotFoundContent;return!(!t&&"string"!=typeof t)},enumerable:!0,configurable:!0}),t.prototype.ngOnChanges=function(t){var e=t.nzNotFoundContent;e&&(this.isContentString="string"==typeof e.currentValue)},t.prototype.ngOnInit=function(){var t=this;this.i18n.localeChange.pipe(I.takeUntil(this.destroy$)).subscribe(function(){t.locale=t.i18n.getLocaleData("Empty"),t.cdr.markForCheck()})},t.prototype.ngOnDestroy=function(){this.destroy$.next(),this.destroy$.complete()},t.decorators=[{type:n.Component,args:[{changeDetection:n.ChangeDetectionStrategy.OnPush,encapsulation:n.ViewEncapsulation.None,selector:"nz-empty",exportAs:"nzEmpty",template:'<div class="ant-empty-image">\n <ng-container *nzStringTemplateOutlet="nzNotFoundImage">\n <img [src]="nzNotFoundImage || defaultSvg" [alt]="isContentString ? nzNotFoundContent : \'empty\'">\n </ng-container>\n</div>\n<p class="ant-empty-description">\n <ng-container *nzStringTemplateOutlet="nzNotFoundContent">\n {{ shouldRenderContent ? nzNotFoundContent : locale[\'description\'] }}\n </ng-container>\n</p>\n<div class="ant-empty-footer" *ngIf="nzNotFoundFooter">\n <ng-container *nzStringTemplateOutlet="nzNotFoundFooter">\n {{ nzNotFoundFooter }}\n </ng-container>\n</div>\n',host:{class:"ant-empty"},styles:["nz-empty { display: block; }"]}]}],t.ctorParameters=function(){return[{type:o.DomSanitizer},{type:M.NzI18nService},{type:n.ChangeDetectorRef}]},t.propDecorators={nzNotFoundImage:[{type:n.Input}],nzNotFoundContent:[{type:n.Input}],nzNotFoundFooter:[{type:n.Input}]},t}();var y=function(){function t(){}return t.decorators=[{type:n.NgModule,args:[{imports:[r.CommonModule,e.PortalModule,i.NzAddOnModule,M.NzI18nModule],declarations:[C,D],exports:[C,D]}]}],t}();t.NZ_DEFAULT_EMPTY_CONTENT=c,t.NZ_EMPTY_COMPONENT_NAME=a,t.NzEmbedEmptyComponent=D,t.NzEmptyComponent=C,t.NzEmptyModule=y,t.NzEmptyService=N,t.emptyImage=s,t.simpleEmptyImage=u,Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=ng-zorro-antd-empty.umd.min.js.map