UNPKG

@lxlib/seed

Version:

This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 9.1.1.

16 lines (14 loc) 5.1 kB
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@angular/core"),require("@lxlib/util"),require("@angular/common"),require("ng-zorro-antd/avatar"),require("ng-zorro-antd/tooltip")):"function"==typeof define&&define.amd?define("@lxlib/seed/avatar-list",["exports","@angular/core","@lxlib/util","@angular/common","ng-zorro-antd/avatar","ng-zorro-antd/tooltip"],e):e(((t=t||self).lxlib=t.lxlib||{},t.lxlib.seed=t.lxlib.seed||{},t.lxlib.seed["avatar-list"]={}),t.ng.core,t.lxlib.util,t.ng.common,t["ng-zorro-antd/avatar"],t["ng-zorro-antd/tooltip"])}(this,(function(t,e,n,a,r,o){"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 i(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}function s(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var a,r,o=n.call(t),i=[];try{for(;(void 0===e||e-- >0)&&!(a=o.next()).done;)i.push(a.value)}catch(t){r={error:t}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}return i}function l(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(s(arguments[e]));return t}var c=function(){function t(){}return t.decorators=[{type:e.Component,args:[{selector:"avatar-list-item, [avatar-list-item]",exportAs:"avatarListItem",template:"<ng-content></ng-content>",preserveWhitespaces:!1,changeDetection:e.ChangeDetectionStrategy.OnPush,encapsulation:e.ViewEncapsulation.None}]}],t.propDecorators={src:[{type:e.Input}],text:[{type:e.Input}],icon:[{type:e.Input}],tips:[{type:e.Input}]},t}();var u=function(){function t(t){this.cdr=t,this.inited=!1,this.items=[],this.exceedCount=0,this.cls="",this.avatarSize="",this.maxLength=0}return Object.defineProperty(t.prototype,"size",{set:function(t){switch(this.cls="avatar-list__item"+("default"===t?"":" avatar-list__"+t),t){case"large":case"small":case"default":this.avatarSize=t;break;default:this.avatarSize="small"}},enumerable:!0,configurable:!0}),t.prototype.gen=function(){var t=this._items,e=this.maxLength>0?this.maxLength:t.length,n=t.length,a=e>0&&e>=n?n:e;this.items=t.toArray().slice(0,a),this.exceedCount=a<n?n-e:0,this.cdr.detectChanges()},t.prototype.ngAfterViewInit=function(){this.gen(),this.inited=!0},t.prototype.ngOnChanges=function(){this.inited&&this.gen()},t.decorators=[{type:e.Component,args:[{selector:"avatar-list",exportAs:"avatarList",template:'<ul class="avatar-list__wrap">\n <li *ngFor="let i of items"\n [class]="cls">\n <nz-avatar *ngIf="i.tips"\n nz-tooltip [nzTooltipTitle]="i.tips"\n [nzSrc]="i.src"\n [nzText]="i.text"\n [nzIcon]="i.icon"\n [nzSize]="avatarSize"></nz-avatar>\n <nz-avatar *ngIf="!i.tips"\n [nzSrc]="i.src"\n [nzText]="i.text"\n [nzIcon]="i.icon"\n [nzSize]="avatarSize"></nz-avatar>\n </li>\n <li *ngIf="exceedCount > 0"\n [class]="cls">\n <nz-avatar [nzSize]="avatarSize"\n style="cursor: auto"\n [ngStyle]="excessItemsStyle"\n [nzText]="\'+\' + exceedCount"></nz-avatar>\n </li>\n</ul>\n',host:{"[class.avatar-list]":"true"},preserveWhitespaces:!1,changeDetection:e.ChangeDetectionStrategy.OnPush,encapsulation:e.ViewEncapsulation.None}]}],t.ctorParameters=function(){return[{type:e.ChangeDetectorRef}]},t.propDecorators={_items:[{type:e.ContentChildren,args:[c,{descendants:!1}]}],size:[{type:e.Input}],maxLength:[{type:e.Input}],excessItemsStyle:[{type:e.Input}]},function(t,e,n,a){var r,o=arguments.length,i=o<3?e:null===a?a=Object.getOwnPropertyDescriptor(e,n):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,e,n,a);else for(var s=t.length-1;s>=0;s--)(r=t[s])&&(i=(o<3?r(i):o>3?r(e,n,i):r(e,n))||i);o>3&&i&&Object.defineProperty(e,n,i)}([n.InputNumber(),i("design:type",Object)],t.prototype,"maxLength",void 0),t}();var p=[u,c],f=function(){function t(){}return t.decorators=[{type:e.NgModule,args:[{imports:[a.CommonModule,r.NzAvatarModule,o.NzToolTipModule],declarations:l(p),exports:l(p)}]}],t}();t.AvatarListComponent=u,t.AvatarListItemComponent=c,t.AvatarListModule=f,Object.defineProperty(t,"__esModule",{value:!0})})); //# sourceMappingURL=avatarList.umd.min.js.map