UNPKG

@ohayojp.com/components

Version:

Common business components of ohayojp.

7 lines 4.78 kB
/** * @license ohayojp(cipchk@qq.com) v1.0.0 * (c) 2020 cipchk https://ohayojp.com/ * License: MIT */ !function (t, e) { "object" == typeof exports && "undefined" != typeof module ? e(exports, require("@angular/core"), require("@ohayojp.com/util"), require("@angular/common"), require("ng-zorro-antd/avatar"), require("ng-zorro-antd/tooltip")) : "function" == typeof define && define.amd ? define("@ohayojp.com/components/avatar-list", ["exports", "@angular/core", "@ohayojp.com/util", "@angular/common", "ng-zorro-antd/avatar", "ng-zorro-antd/tooltip"], e) : e(((t = "undefined" != typeof globalThis ? globalThis : t || self).ohayo = t.ohayo || {}, t.ohayo.components = t.ohayo.components || {}, t.ohayo.components["avatar-list"] = {}), t.ng.core, t.ohayo.util, t.ng.common, t["ng-zorro-antd/avatar"], t["ng-zorro-antd/tooltip"]) }(this, (function (t, e, n, a, o, r) { "use strict"; var i = function () { }; i.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 }] }], i.propDecorators = { src: [{ type: e.Input }], text: [{ type: e.Input }], icon: [{ type: e.Input }], tips: [{ type: e.Input }] }; Object.create; function s(t, e) { var n = "function" == typeof Symbol && t[Symbol.iterator]; if (!n) return t; var a, o, r = n.call(t), i = []; try { for (; (void 0 === e || e-- > 0) && !(a = r.next()).done;)i.push(a.value) } catch (t) { o = { error: t } } finally { try { a && !a.done && (n = r.return) && n.call(r) } finally { if (o) throw o.error } } return i } function c() { for (var t = [], e = 0; e < arguments.length; e++)t = t.concat(s(arguments[e])); return t } Object.create; var l = 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: !1, 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 }(); l.decorators = [{ type: e.Component, args: [{ selector: "avatar-list", exportAs: "avatarList", template: '<ul class="avatar-list__wrap">\n <li *ngFor="let i of items" [ngClass]="cls">\n <nz-avatar *ngIf="i.tips" nz-tooltip [nzTooltipTitle]="i.tips" [nzSrc]="i.src" [nzText]="i.text" [nzIcon]="i.icon" [nzSize]="avatarSize"></nz-avatar>\n <nz-avatar *ngIf="!i.tips" [nzSrc]="i.src" [nzText]="i.text" [nzIcon]="i.icon" [nzSize]="avatarSize"></nz-avatar>\n </li>\n <li *ngIf="exceedCount > 0" [ngClass]="cls">\n <nz-avatar [nzSize]="avatarSize" style="cursor: auto;" [ngStyle]="excessItemsStyle" [nzText]="\'+\' + exceedCount"></nz-avatar>\n </li>\n</ul>\n', host: { "[class.avatar-list]": "true" }, preserveWhitespaces: !1, changeDetection: e.ChangeDetectionStrategy.OnPush, encapsulation: e.ViewEncapsulation.None }] }], l.ctorParameters = function () { return [{ type: e.ChangeDetectorRef }] }, l.propDecorators = { _items: [{ type: e.ContentChildren, args: [i, { descendants: !1 }] }], size: [{ type: e.Input }], maxLength: [{ type: e.Input }], excessItemsStyle: [{ type: e.Input }] }, function (t, e, n, a) { var o, r = arguments.length, i = r < 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--)(o = t[s]) && (i = (r < 3 ? o(i) : r > 3 ? o(e, n, i) : o(e, n)) || i); r > 3 && i && Object.defineProperty(e, n, i) }([n.InputNumber(), function (t, e) { if ("object" == typeof Reflect && "function" == typeof Reflect.metadata) return Reflect.metadata(t, e) }("design:type", Object)], l.prototype, "maxLength", void 0); var p = [l, i], u = function () { }; u.decorators = [{ type: e.NgModule, args: [{ imports: [a.CommonModule, o.NzAvatarModule, r.NzToolTipModule], declarations: c(p), exports: c(p) }] }], t.AvatarListComponent = l, t.AvatarListItemComponent = i, t.AvatarListModule = u, Object.defineProperty(t, "__esModule", { value: !0 }) })); //# sourceMappingURL=avatarList.umd.min.js.map