ng-zorro-antd
Version:
An enterprise-class UI components based on Ant Design and Angular
2 lines • 9.32 kB
JavaScript
!function(t,n){"object"==typeof exports&&"undefined"!=typeof module?n(exports,require("@angular/core"),require("ng-zorro-antd/core"),require("rxjs"),require("@angular/common"),require("ng-zorro-antd/avatar"),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","rxjs","@angular/common","ng-zorro-antd/avatar","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,t.rxjs,t.ng.common,t["ng-zorro-antd"].avatar,t["ng-zorro-antd"].empty,t["ng-zorro-antd"].grid,t["ng-zorro-antd"].spin)}(this,function(t,n,e,i,a,o,r,s,l){"use strict";function p(t,n,e,i){var a,o=arguments.length,r=o<3?n:null===i?i=Object.getOwnPropertyDescriptor(n,e):i;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,n,e,i);else for(var s=t.length-1;s>=0;s--)(a=t[s])&&(r=(o<3?a(r):o>3?a(n,e,r):a(n,e))||r);return o>3&&r&&Object.defineProperty(n,e,r),r}function c(t,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,n)}var g=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:'<div *ngIf="avatarStr || avatarTpl" class="ant-list-item-meta-avatar">\n <ng-container *ngIf="avatarStr; else avatarTpl">\n <nz-avatar [nzSrc]="avatarStr"></nz-avatar>\n </ng-container>\n</div>\n<div *ngIf="nzTitle || nzDescription" class="ant-list-item-meta-content">\n <h4 *ngIf="nzTitle" class="ant-list-item-meta-title">\n <ng-container *nzStringTemplateOutlet="nzTitle">{{ nzTitle }}</ng-container>\n </h4>\n <div *ngIf="nzDescription" class="ant-list-item-meta-description">\n <ng-container *nzStringTemplateOutlet="nzDescription">{{ nzDescription }}</ng-container>\n </div>\n</div>',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}]},t}();var d=function(){function t(t,n){this.el=t,this.updateHostClassService=n,this.nzBordered=!1,this.nzItemLayout="horizontal",this.nzLoading=!1,this.nzSize="default",this.nzSplit=!0,this.prefixCls="ant-list",this.itemLayoutNotifySource=new i.BehaviorSubject(this.nzItemLayout)}return t.prototype._setClassMap=function(){var t,n=((t={})[this.prefixCls]=!0,t[this.prefixCls+"-vertical"]="vertical"===this.nzItemLayout,t[this.prefixCls+"-lg"]="large"===this.nzSize,t[this.prefixCls+"-sm"]="small"===this.nzSize,t[this.prefixCls+"-split"]=this.nzSplit,t[this.prefixCls+"-bordered"]=this.nzBordered,t[this.prefixCls+"-loading"]=this.nzLoading,t[this.prefixCls+"-grid"]=this.nzGrid,t[this.prefixCls+"-something-after-last-item"]=!!(this.nzLoadMore||this.nzPagination||this.nzFooter),t);this.updateHostClassService.updateHostClass(this.el.nativeElement,n)},Object.defineProperty(t.prototype,"itemLayoutNotify$",{get:function(){return this.itemLayoutNotifySource.asObservable()},enumerable:!0,configurable:!0}),t.prototype.ngOnInit=function(){this._setClassMap()},t.prototype.ngOnChanges=function(t){this._setClassMap(),t.nzItemLayout&&this.itemLayoutNotifySource.next(this.nzItemLayout)},t.prototype.ngOnDestroy=function(){this.itemLayoutNotifySource.unsubscribe()},t.decorators=[{type:n.Component,args:[{selector:"nz-list, [nz-list]",exportAs:"nzList",template:'<ng-template #itemsTpl>\n <div class="ant-list-items" *ngIf="nzDataSource.length > 0">\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 </div>\n</ng-template>\n<div *ngIf="nzHeader" class="ant-list-header">\n <ng-container *nzStringTemplateOutlet="nzHeader">{{ nzHeader }}</ng-container>\n</div>\n<nz-spin [nzSpinning]="nzLoading">\n <ng-container *ngIf="nzDataSource">\n <div *ngIf="nzLoading && nzDataSource.length === 0" [style.min-height.px]="53"></div>\n <div *ngIf="nzGrid; else itemsTpl" nz-row [nzGutter]="nzGrid.gutter">\n <div nz-col [nzSpan]="nzGrid.span" [nzXs]="nzGrid.xs" [nzSm]="nzGrid.sm" [nzMd]="nzGrid.md" [nzLg]="nzGrid.lg" [nzXl]="nzGrid.xl"\n [nzXXl]="nzGrid.xxl" *ngFor="let item of nzDataSource; let index = index">\n <ng-template [ngTemplateOutlet]="nzRenderItem" [ngTemplateOutletContext]="{ $implicit: item, index: index }"></ng-template>\n </div>\n </div>\n <div *ngIf="!nzLoading && nzDataSource.length === 0" class="ant-list-empty-text">\n <nz-embed-empty [nzComponentName]="\'list\'" [specificContent]="nzNoResult"></nz-embed-empty>\n </div>\n </ng-container>\n <ng-content></ng-content>\n</nz-spin>\n<div *ngIf="nzFooter" class="ant-list-footer">\n <ng-container *nzStringTemplateOutlet="nzFooter">{{ nzFooter }}</ng-container>\n</div>\n<ng-template [ngTemplateOutlet]="nzLoadMore"></ng-template>\n<div *ngIf="nzPagination" class="ant-list-pagination">\n <ng-template [ngTemplateOutlet]="nzPagination"></ng-template>\n</div>',providers:[e.NzUpdateHostClassService],preserveWhitespaces:!1,encapsulation:n.ViewEncapsulation.None,changeDetection:n.ChangeDetectionStrategy.OnPush,styles:["\n nz-list,\n nz-list nz-spin {\n display: block;\n }\n "]}]}],t.ctorParameters=function(){return[{type:n.ElementRef},{type:e.NzUpdateHostClassService}]},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}]},p([e.InputBoolean(),c("design:type",Object)],t.prototype,"nzBordered",void 0),p([e.InputBoolean(),c("design:type",Object)],t.prototype,"nzLoading",void 0),p([e.InputBoolean(),c("design:type",Object)],t.prototype,"nzSplit",void 0),t}();var m=function(){function t(t,n,e,i){this.parentComp=e,this.cdr=i,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.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:'<ng-template #actionsTpl>\n <ul *ngIf="nzActions?.length > 0" class="ant-list-item-action">\n <li *ngFor="let i of nzActions; let last=last;">\n <ng-template [ngTemplateOutlet]="i"></ng-template>\n <em *ngIf="!last" class="ant-list-item-action-split"></em>\n </li>\n </ul>\n</ng-template>\n<ng-template #contentTpl>\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 #simpleTpl>\n <ng-template [ngTemplateOutlet]="contentTpl"></ng-template>\n <ng-template [ngTemplateOutlet]="nzExtra"></ng-template>\n <ng-template [ngTemplateOutlet]="actionsTpl"></ng-template>\n</ng-template>\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 <div class="ant-list-item-extra">\n <ng-template [ngTemplateOutlet]="nzExtra"></ng-template>\n </div>\n</ng-container>',preserveWhitespaces:!1,encapsulation:n.ViewEncapsulation.None,changeDetection:n.ChangeDetectionStrategy.OnPush}]}],t.ctorParameters=function(){return[{type:n.ElementRef},{type:n.Renderer2},{type:d},{type:n.ChangeDetectorRef}]},t.propDecorators={metas:[{type:n.ContentChildren,args:[g]}],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"]}]},p([e.InputBoolean(),c("design:type",Boolean)],t.prototype,"nzNoFlex",void 0),t}();var u=function(){function t(){}return t.decorators=[{type:n.NgModule,args:[{imports:[a.CommonModule,l.NzSpinModule,s.NzGridModule,o.NzAvatarModule,e.NzAddOnModule,r.NzEmptyModule],declarations:[d,m,g],exports:[d,m,g]}]}],t}();t.NzListComponent=d,t.NzListItemComponent=m,t.NzListItemMetaComponent=g,t.NzListModule=u,Object.defineProperty(t,"__esModule",{value:!0})});
//# sourceMappingURL=ng-zorro-antd-list.umd.min.js.map