ng-zorro-antd
Version:
An enterprise-class UI components based on Ant Design and Angular
2 lines • 16.4 kB
JavaScript
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("@angular/core"),require("ng-zorro-antd/core/util"),require("rxjs"),require("rxjs/operators"),require("@angular/cdk/bidi"),require("@angular/common"),require("ng-zorro-antd/avatar"),require("ng-zorro-antd/core/outlet"),require("ng-zorro-antd/empty"),require("ng-zorro-antd/grid"),require("ng-zorro-antd/spin")):"function"==typeof define&&define.amd?define("ng-zorro-antd/list",["exports","@angular/core","ng-zorro-antd/core/util","rxjs","rxjs/operators","@angular/cdk/bidi","@angular/common","ng-zorro-antd/avatar","ng-zorro-antd/core/outlet","ng-zorro-antd/empty","ng-zorro-antd/grid","ng-zorro-antd/spin"],n):n(((t="undefined"!=typeof globalThis?globalThis:t||self)["ng-zorro-antd"]=t["ng-zorro-antd"]||{},t["ng-zorro-antd"].list={}),t.ng.core,t["ng-zorro-antd"].core.util,t.rxjs,t.rxjs.operators,t.ng.cdk.bidi,t.ng.common,t["ng-zorro-antd"].avatar,t["ng-zorro-antd"].core.outlet,t["ng-zorro-antd"].empty,t["ng-zorro-antd"].grid,t["ng-zorro-antd"].spin)}(this,(function(t,n,e,o,i,a,r,s,l,c,p,g){"use strict";var m=function(){};m.decorators=[{type:n.Component,args:[{selector:"nz-list-item-meta-title",exportAs:"nzListItemMetaTitle",template:'\n <h4 class="ant-list-item-meta-title">\n <ng-content></ng-content>\n </h4>\n ',changeDetection:n.ChangeDetectionStrategy.OnPush}]}];var z=function(){};z.decorators=[{type:n.Component,args:[{selector:"nz-list-item-meta-description",exportAs:"nzListItemMetaDescription",template:'\n <div class="ant-list-item-meta-description">\n <ng-content></ng-content>\n </div>\n ',changeDetection:n.ChangeDetectionStrategy.OnPush}]}];var u=function(){};u.decorators=[{type:n.Component,args:[{selector:"nz-list-item-meta-avatar",exportAs:"nzListItemMetaAvatar",template:'\n <div class="ant-list-item-meta-avatar">\n <nz-avatar *ngIf="nzSrc" [nzSrc]="nzSrc"></nz-avatar>\n <ng-content *ngIf="!nzSrc"></ng-content>\n </div>\n ',changeDetection:n.ChangeDetectionStrategy.OnPush}]}],u.propDecorators={nzSrc:[{type:n.Input}]};var d=function(){function t(t,n){this.elementRef=t,this.renderer=n,this.avatarStr="",this.renderer.addClass(t.nativeElement,"ant-list-item-meta")}return Object.defineProperty(t.prototype,"nzAvatar",{set:function(t){t instanceof n.TemplateRef?(this.avatarStr="",this.avatarTpl=t):this.avatarStr=t},enumerable:!1,configurable:!0}),t}();d.decorators=[{type:n.Component,args:[{selector:"nz-list-item-meta, [nz-list-item-meta]",exportAs:"nzListItemMeta",template:'\n \x3c!--Old API Start--\x3e\n <nz-list-item-meta-avatar *ngIf="avatarStr" [nzSrc]="avatarStr"></nz-list-item-meta-avatar>\n <nz-list-item-meta-avatar *ngIf="avatarTpl">\n <ng-container [ngTemplateOutlet]="avatarTpl"></ng-container>\n </nz-list-item-meta-avatar>\n \x3c!--Old API End--\x3e\n\n <ng-content select="nz-list-item-meta-avatar"></ng-content>\n\n <div *ngIf="nzTitle || nzDescription || descriptionComponent || titleComponent" class="ant-list-item-meta-content">\n \x3c!--Old API Start--\x3e\n <nz-list-item-meta-title *ngIf="nzTitle && !titleComponent">\n <ng-container *nzStringTemplateOutlet="nzTitle">{{ nzTitle }}</ng-container>\n </nz-list-item-meta-title>\n <nz-list-item-meta-description *ngIf="nzDescription && !descriptionComponent">\n <ng-container *nzStringTemplateOutlet="nzDescription">{{ nzDescription }}</ng-container>\n </nz-list-item-meta-description>\n \x3c!--Old API End--\x3e\n\n <ng-content select="nz-list-item-meta-title"></ng-content>\n <ng-content select="nz-list-item-meta-description"></ng-content>\n </div>\n ',preserveWhitespaces:!1,changeDetection:n.ChangeDetectionStrategy.OnPush,encapsulation:n.ViewEncapsulation.None}]}],d.ctorParameters=function(){return[{type:n.ElementRef},{type:n.Renderer2}]},d.propDecorators={nzAvatar:[{type:n.Input}],nzTitle:[{type:n.Input}],nzDescription:[{type:n.Input}],descriptionComponent:[{type:n.ContentChild,args:[z]}],titleComponent:[{type:n.ContentChild,args:[m]}]};function h(t,n,e,o){var i,a=arguments.length,r=a<3?n:null===o?o=Object.getOwnPropertyDescriptor(n,e):o;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,n,e,o);else for(var s=t.length-1;s>=0;s--)(i=t[s])&&(r=(a<3?i(r):a>3?i(n,e,r):i(n,e))||r);return a>3&&r&&Object.defineProperty(n,e,r),r}function y(t,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,n)}Object.create;Object.create;var f=function(){};f.decorators=[{type:n.Component,args:[{selector:"nz-list-item-extra, [nz-list-item-extra]",exportAs:"nzListItemExtra",changeDetection:n.ChangeDetectionStrategy.OnPush,template:" <ng-content></ng-content> ",host:{class:"ant-list-item-extra"}}]}],f.ctorParameters=function(){return[]};var C=function(){};C.decorators=[{type:n.Component,args:[{selector:"nz-list-item-action",exportAs:"nzListItemAction",changeDetection:n.ChangeDetectionStrategy.OnPush,template:" <ng-template><ng-content></ng-content></ng-template> "}]}],C.ctorParameters=function(){return[]},C.propDecorators={templateRef:[{type:n.ViewChild,args:[n.TemplateRef]}]};var v=function(){function t(t,n){var e=this;this.ngZone=t,this.cdr=n,this.nzActions=[],this.actions=[],this.destroy$=new o.Subject,this.inputActionChanges$=new o.Subject,this.contentChildrenChanges$=o.defer((function(){return e.nzListItemActions?o.of(null):e.ngZone.onStable.asObservable().pipe(i.take(1),i.switchMap((function(){return e.contentChildrenChanges$})))})),o.merge(this.contentChildrenChanges$,this.inputActionChanges$).pipe(i.takeUntil(this.destroy$)).subscribe((function(){e.nzActions.length?e.actions=e.nzActions:e.actions=e.nzListItemActions.map((function(t){return t.templateRef})),e.cdr.detectChanges()}))}return t.prototype.ngOnChanges=function(){this.inputActionChanges$.next(null)},t.prototype.ngOnDestroy=function(){this.destroy$.next(),this.destroy$.complete()},t}();v.decorators=[{type:n.Component,args:[{selector:"ul[nz-list-item-actions]",exportAs:"nzListItemActions",changeDetection:n.ChangeDetectionStrategy.OnPush,template:'\n <li *ngFor="let i of actions; let last = last">\n <ng-template [ngTemplateOutlet]="i"></ng-template>\n <em *ngIf="!last" class="ant-list-item-action-split"></em>\n </li>\n ',host:{class:"ant-list-item-action"}}]}],v.ctorParameters=function(){return[{type:n.NgZone},{type:n.ChangeDetectorRef}]},v.propDecorators={nzActions:[{type:n.Input}],nzListItemActions:[{type:n.ContentChildren,args:[C]}]};var I=function(){};I.decorators=[{type:n.Component,args:[{selector:"nz-list-empty",exportAs:"nzListHeader",changeDetection:n.ChangeDetectionStrategy.OnPush,template:' <nz-embed-empty [nzComponentName]="\'list\'" [specificContent]="nzNoResult"></nz-embed-empty> ',host:{class:"ant-list-empty-text"}}]}],I.propDecorators={nzNoResult:[{type:n.Input}]};var x=function(){};x.decorators=[{type:n.Component,args:[{selector:"nz-list-header",exportAs:"nzListHeader",changeDetection:n.ChangeDetectionStrategy.OnPush,template:" <ng-content></ng-content> ",host:{class:"ant-list-header"}}]}];var L=function(){};L.decorators=[{type:n.Component,args:[{selector:"nz-list-footer",exportAs:"nzListFooter",changeDetection:n.ChangeDetectionStrategy.OnPush,template:" <ng-content></ng-content> ",host:{class:"ant-list-footer"}}]}];var S=function(){};S.decorators=[{type:n.Component,args:[{selector:"nz-list-pagination",exportAs:"nzListPagination",changeDetection:n.ChangeDetectionStrategy.OnPush,template:" <ng-content></ng-content> ",host:{class:"ant-list-pagination"}}]}];var D=function(){};D.decorators=[{type:n.Directive,args:[{selector:"nz-list-load-more",exportAs:"nzListLoadMoreDirective"}]}];var O=function(){};O.decorators=[{type:n.Directive,args:[{selector:"nz-list[nzGrid]",host:{class:"ant-list-grid"}}]}];var A=function(){function t(t,n){this.elementRef=t,this.directionality=n,this.nzBordered=!1,this.nzGrid="",this.nzItemLayout="horizontal",this.nzRenderItem=null,this.nzLoading=!1,this.nzLoadMore=null,this.nzSize="default",this.nzSplit=!0,this.hasSomethingAfterLastItem=!1,this.dir="ltr",this.itemLayoutNotifySource=new o.BehaviorSubject(this.nzItemLayout),this.destroy$=new o.Subject,this.elementRef.nativeElement.classList.add("ant-list")}return Object.defineProperty(t.prototype,"itemLayoutNotify$",{get:function(){return this.itemLayoutNotifySource.asObservable()},enumerable:!1,configurable:!0}),t.prototype.ngOnInit=function(){var t,n=this;this.dir=this.directionality.value,null===(t=this.directionality.change)||void 0===t||t.pipe(i.takeUntil(this.destroy$)).subscribe((function(t){n.dir=t}))},t.prototype.getSomethingAfterLastItem=function(){return!!(this.nzLoadMore||this.nzPagination||this.nzFooter||this.nzListFooterComponent||this.nzListPaginationComponent||this.nzListLoadMoreDirective)},t.prototype.ngOnChanges=function(t){t.nzItemLayout&&this.itemLayoutNotifySource.next(this.nzItemLayout)},t.prototype.ngOnDestroy=function(){this.itemLayoutNotifySource.unsubscribe(),this.destroy$.next(),this.destroy$.complete()},t.prototype.ngAfterContentInit=function(){this.hasSomethingAfterLastItem=this.getSomethingAfterLastItem()},t}();A.decorators=[{type:n.Component,args:[{selector:"nz-list, [nz-list]",exportAs:"nzList",template:'\n <ng-template #itemsTpl>\n <div class="ant-list-items">\n <ng-container *ngFor="let item of nzDataSource; let index = index">\n <ng-template [ngTemplateOutlet]="nzRenderItem" [ngTemplateOutletContext]="{ $implicit: item, index: index }"></ng-template>\n </ng-container>\n <ng-content></ng-content>\n </div>\n </ng-template>\n\n <nz-list-header *ngIf="nzHeader">\n <ng-container *nzStringTemplateOutlet="nzHeader">{{ nzHeader }}</ng-container>\n </nz-list-header>\n <ng-content select="nz-list-header"></ng-content>\n\n <nz-spin [nzSpinning]="nzLoading">\n <ng-container>\n <div *ngIf="nzLoading && nzDataSource && nzDataSource.length === 0" [style.min-height.px]="53"></div>\n <div *ngIf="nzGrid && nzDataSource; else itemsTpl" nz-row [nzGutter]="nzGrid.gutter || null">\n <div\n nz-col\n [nzSpan]="nzGrid.span || null"\n [nzXs]="nzGrid.xs || null"\n [nzSm]="nzGrid.sm || null"\n [nzMd]="nzGrid.md || null"\n [nzLg]="nzGrid.lg || null"\n [nzXl]="nzGrid.xl || null"\n [nzXXl]="nzGrid.xxl || null"\n *ngFor="let item of nzDataSource; let index = index"\n >\n <ng-template [ngTemplateOutlet]="nzRenderItem" [ngTemplateOutletContext]="{ $implicit: item, index: index }"></ng-template>\n </div>\n </div>\n <nz-list-empty *ngIf="!nzLoading && nzDataSource && nzDataSource.length === 0" [nzNoResult]="nzNoResult"></nz-list-empty>\n </ng-container>\n </nz-spin>\n\n <nz-list-footer *ngIf="nzFooter">\n <ng-container *nzStringTemplateOutlet="nzFooter">{{ nzFooter }}</ng-container>\n </nz-list-footer>\n <ng-content select="nz-list-footer, [nz-list-footer]"></ng-content>\n\n <ng-template [ngTemplateOutlet]="nzLoadMore"></ng-template>\n <ng-content select="nz-list-load-more, [nz-list-load-more]"></ng-content>\n\n <nz-list-pagination *ngIf="nzPagination">\n <ng-template [ngTemplateOutlet]="nzPagination"></ng-template>\n </nz-list-pagination>\n <ng-content select="nz-list-pagination, [nz-list-pagination]"></ng-content>\n ',preserveWhitespaces:!1,encapsulation:n.ViewEncapsulation.None,changeDetection:n.ChangeDetectionStrategy.OnPush,host:{"[class.ant-list-rtl]":"dir === 'rtl'","[class.ant-list-vertical]":'nzItemLayout === "vertical"',"[class.ant-list-lg]":'nzSize === "large"',"[class.ant-list-sm]":'nzSize === "small"',"[class.ant-list-split]":"nzSplit","[class.ant-list-bordered]":"nzBordered","[class.ant-list-loading]":"nzLoading","[class.ant-list-something-after-last-item]":"hasSomethingAfterLastItem"}}]}],A.ctorParameters=function(){return[{type:n.ElementRef},{type:a.Directionality,decorators:[{type:n.Optional}]}]},A.propDecorators={nzDataSource:[{type:n.Input}],nzBordered:[{type:n.Input}],nzGrid:[{type:n.Input}],nzHeader:[{type:n.Input}],nzFooter:[{type:n.Input}],nzItemLayout:[{type:n.Input}],nzRenderItem:[{type:n.Input}],nzLoading:[{type:n.Input}],nzLoadMore:[{type:n.Input}],nzPagination:[{type:n.Input}],nzSize:[{type:n.Input}],nzSplit:[{type:n.Input}],nzNoResult:[{type:n.Input}],nzListFooterComponent:[{type:n.ContentChild,args:[L]}],nzListPaginationComponent:[{type:n.ContentChild,args:[S]}],nzListLoadMoreDirective:[{type:n.ContentChild,args:[D]}]},h([e.InputBoolean(),y("design:type",Object)],A.prototype,"nzBordered",void 0),h([e.InputBoolean(),y("design:type",Object)],A.prototype,"nzLoading",void 0),h([e.InputBoolean(),y("design:type",Object)],A.prototype,"nzSplit",void 0);var T=function(){function t(t,n,e,o){this.parentComp=e,this.cdr=o,this.nzActions=[],this.nzExtra=null,this.nzNoFlex=!1,n.addClass(t.nativeElement,"ant-list-item")}return Object.defineProperty(t.prototype,"isVerticalAndExtra",{get:function(){return!("vertical"!==this.itemLayout||!this.listItemExtraDirective&&!this.nzExtra)},enumerable:!1,configurable:!0}),t.prototype.ngAfterViewInit=function(){var t=this;this.itemLayout$=this.parentComp.itemLayoutNotify$.subscribe((function(n){t.itemLayout=n,t.cdr.detectChanges()}))},t.prototype.ngOnDestroy=function(){this.itemLayout$&&this.itemLayout$.unsubscribe()},t}();T.decorators=[{type:n.Component,args:[{selector:"nz-list-item, [nz-list-item]",exportAs:"nzListItem",template:'\n <ng-template #actionsTpl>\n <ul nz-list-item-actions *ngIf="nzActions && nzActions.length > 0" [nzActions]="nzActions"></ul>\n <ng-content select="nz-list-item-actions, [nz-list-item-actions]"></ng-content>\n </ng-template>\n <ng-template #contentTpl>\n <ng-content select="nz-list-item-meta, [nz-list-item-meta]"></ng-content>\n <ng-content></ng-content>\n <ng-container *ngIf="nzContent">\n <ng-container *nzStringTemplateOutlet="nzContent">{{ nzContent }}</ng-container>\n </ng-container>\n </ng-template>\n <ng-template #extraTpl>\n <ng-content select="nz-list-item-extra, [nz-list-item-extra]"></ng-content>\n </ng-template>\n <ng-template #simpleTpl>\n <ng-template [ngTemplateOutlet]="contentTpl"></ng-template>\n <ng-template [ngTemplateOutlet]="nzExtra"></ng-template>\n <ng-template [ngTemplateOutlet]="extraTpl"></ng-template>\n <ng-template [ngTemplateOutlet]="actionsTpl"></ng-template>\n </ng-template>\n\n <ng-container *ngIf="isVerticalAndExtra; else simpleTpl">\n <div class="ant-list-item-main">\n <ng-template [ngTemplateOutlet]="contentTpl"></ng-template>\n <ng-template [ngTemplateOutlet]="actionsTpl"></ng-template>\n </div>\n <nz-list-item-extra *ngIf="nzExtra">\n <ng-template [ngTemplateOutlet]="nzExtra"></ng-template>\n </nz-list-item-extra>\n <ng-template [ngTemplateOutlet]="extraTpl"></ng-template>\n </ng-container>\n ',preserveWhitespaces:!1,encapsulation:n.ViewEncapsulation.None,changeDetection:n.ChangeDetectionStrategy.OnPush}]}],T.ctorParameters=function(){return[{type:n.ElementRef},{type:n.Renderer2},{type:A},{type:n.ChangeDetectorRef}]},T.propDecorators={nzActions:[{type:n.Input}],nzContent:[{type:n.Input}],nzExtra:[{type:n.Input}],nzNoFlex:[{type:n.Input},{type:n.HostBinding,args:["class.ant-list-item-no-flex"]}],listItemExtraDirective:[{type:n.ContentChild,args:[f]}]},h([e.InputBoolean(),y("design:type",Boolean)],T.prototype,"nzNoFlex",void 0);var b=[A,x,L,S,I,T,d,m,z,u,v,C,f,D,O],N=function(){};N.decorators=[{type:n.NgModule,args:[{imports:[a.BidiModule,r.CommonModule,g.NzSpinModule,p.NzGridModule,s.NzAvatarModule,l.NzOutletModule,c.NzEmptyModule],declarations:[b],exports:[b]}]}],t.NzListComponent=A,t.NzListEmptyComponent=I,t.NzListFooterComponent=L,t.NzListGridDirective=O,t.NzListHeaderComponent=x,t.NzListItemActionComponent=C,t.NzListItemActionsComponent=v,t.NzListItemComponent=T,t.NzListItemExtraComponent=f,t.NzListItemMetaAvatarComponent=u,t.NzListItemMetaComponent=d,t.NzListItemMetaDescriptionComponent=z,t.NzListItemMetaTitleComponent=m,t.NzListLoadMoreDirective=D,t.NzListModule=N,t.NzListPaginationComponent=S,Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=ng-zorro-antd-list.umd.min.js.map