UNPKG

ng-zorro-antd

Version:

An enterprise-class UI components based on Ant Design and Angular

16 lines (14 loc) 16.9 kB
!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/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/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=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.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){"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 g(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 m(t,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,n)}var z=function(){function t(){}return t.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}]}],t}(),u=function(){function t(){}return t.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}]}],t}(),d=function(){function t(){}return t.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}]}],t.propDecorators={nzSrc:[{type:n.Input}]},t}();var h=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:!0,configurable:!0}),t.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}]}],t.ctorParameters=function(){return[{type:n.ElementRef},{type:n.Renderer2}]},t.propDecorators={nzAvatar:[{type:n.Input}],nzTitle:[{type:n.Input}],nzDescription:[{type:n.Input}],descriptionComponent:[{type:n.ContentChild,args:[u]}],titleComponent:[{type:n.ContentChild,args:[z]}]},t}();var f=function(){function t(){}return t.decorators=[{type:n.Component,args:[{selector:"nz-list-item-extra, [nz-list-item-extra]",exportAs:"nzListItemExtra",changeDetection:n.ChangeDetectionStrategy.OnPush,template:"\n <ng-content></ng-content>\n ",host:{class:"ant-list-item-extra"}}]}],t.ctorParameters=function(){return[]},t}(),y=function(){function t(){}return t.decorators=[{type:n.Component,args:[{selector:"nz-list-item-action",exportAs:"nzListItemAction",changeDetection:n.ChangeDetectionStrategy.OnPush,template:"\n <ng-template><ng-content></ng-content></ng-template>\n "}]}],t.ctorParameters=function(){return[]},t.propDecorators={templateRef:[{type:n.ViewChild,args:[n.TemplateRef]}]},t}();var C=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.markForCheck()}))}return t.prototype.ngOnChanges=function(){this.inputActionChanges$.next(null)},t.prototype.ngOnDestroy=function(){this.destroy$.next(),this.destroy$.complete()},t.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"}}]}],t.ctorParameters=function(){return[{type:n.NgZone},{type:n.ChangeDetectorRef}]},t.propDecorators={nzActions:[{type:n.Input}],nzListItemActions:[{type:n.ContentChildren,args:[y]}]},t}();var I=function(){function t(){}return t.decorators=[{type:n.Component,args:[{selector:"nz-list-empty",exportAs:"nzListHeader",changeDetection:n.ChangeDetectionStrategy.OnPush,template:'\n <nz-embed-empty [nzComponentName]="\'list\'" [specificContent]="nzNoResult"></nz-embed-empty>\n ',host:{class:"ant-list-empty-text"}}]}],t.propDecorators={nzNoResult:[{type:n.Input}]},t}();var v=function(){function t(){}return t.decorators=[{type:n.Component,args:[{selector:"nz-list-header",exportAs:"nzListHeader",changeDetection:n.ChangeDetectionStrategy.OnPush,template:"\n <ng-content></ng-content>\n ",host:{class:"ant-list-header"}}]}],t}(),x=function(){function t(){}return t.decorators=[{type:n.Component,args:[{selector:"nz-list-footer",exportAs:"nzListFooter",changeDetection:n.ChangeDetectionStrategy.OnPush,template:"\n <ng-content></ng-content>\n ",host:{class:"ant-list-footer"}}]}],t}(),L=function(){function t(){}return t.decorators=[{type:n.Component,args:[{selector:"nz-list-pagination",exportAs:"nzListPagination",changeDetection:n.ChangeDetectionStrategy.OnPush,template:"\n <ng-content></ng-content>\n ",host:{class:"ant-list-pagination"}}]}],t}(),S=function(){function t(){}return t.decorators=[{type:n.Directive,args:[{selector:"nz-list-load-more",exportAs:"nzListLoadMoreDirective"}]}],t}(),D=function(){function t(){}return t.decorators=[{type:n.Directive,args:[{selector:"nz-list[nzGrid]",host:{class:"ant-list-grid"}}]}],t}(),O=function(){function t(){this.nzBordered=!1,this.nzItemLayout="horizontal",this.nzLoading=!1,this.nzSize="default",this.nzSplit=!0,this.hasSomethingAfterLastItem=!1,this.itemLayoutNotifySource=new o.BehaviorSubject(this.nzItemLayout)}return Object.defineProperty(t.prototype,"itemLayoutNotify$",{get:function(){return this.itemLayoutNotifySource.asObservable()},enumerable:!0,configurable:!0}),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()},t.prototype.ngAfterContentInit=function(){this.hasSomethingAfterLastItem=this.getSomethingAfterLastItem()},t.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 select="nz-list-item, [nz-list-item]"></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">\n <div\n nz-col\n [nzSpan]="nzGrid.span"\n [nzXs]="nzGrid.xs"\n [nzSm]="nzGrid.sm"\n [nzMd]="nzGrid.md"\n [nzLg]="nzGrid.lg"\n [nzXl]="nzGrid.xl"\n [nzXXl]="nzGrid.xxl"\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 <ng-content></ng-content>\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]":"true","[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"}}]}],t.ctorParameters=function(){return[]},t.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:[x]}],nzListPaginationComponent:[{type:n.ContentChild,args:[L]}],nzListLoadMoreDirective:[{type:n.ContentChild,args:[S]}]},g([e.InputBoolean(),m("design:type",Object)],t.prototype,"nzBordered",void 0),g([e.InputBoolean(),m("design:type",Object)],t.prototype,"nzLoading",void 0),g([e.InputBoolean(),m("design:type",Object)],t.prototype,"nzSplit",void 0),t}();var A=function(){function t(t,n,e,o){this.parentComp=e,this.cdr=o,this.nzActions=[],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:!0,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.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?.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:O},{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]}]},g([e.InputBoolean(),m("design:type",Boolean)],t.prototype,"nzNoFlex",void 0),t}();var T=[O,v,x,L,I,A,h,z,u,d,C,y,f,S,D],N=function(){function t(){}return t.decorators=[{type:n.NgModule,args:[{imports:[a.CommonModule,p.NzSpinModule,c.NzGridModule,r.NzAvatarModule,s.NzOutletModule,l.NzEmptyModule],declarations:[T],exports:[T]}]}],t}();t.NzListComponent=O,t.NzListEmptyComponent=I,t.NzListFooterComponent=x,t.NzListGridDirective=D,t.NzListHeaderComponent=v,t.NzListItemActionComponent=y,t.NzListItemActionsComponent=C,t.NzListItemComponent=A,t.NzListItemExtraComponent=f,t.NzListItemMetaAvatarComponent=d,t.NzListItemMetaComponent=h,t.NzListItemMetaDescriptionComponent=u,t.NzListItemMetaTitleComponent=z,t.NzListLoadMoreDirective=S,t.NzListModule=N,t.NzListPaginationComponent=L,Object.defineProperty(t,"__esModule",{value:!0})})); //# sourceMappingURL=ng-zorro-antd-list.umd.min.js.map