yoyo-ng-modulewindy
Version:
服务于52ABP模板的前端开源的相关组件内容。整合了ng-alain和你NG ZORRO的内容
74 lines • 3.55 kB
JavaScript
import { Component, Input, Output, EventEmitter } from '@angular/core';
import { toNumber, toBoolean } from 'yoyo-ng-module/util';
var NoticeIconComponent = /** @class */ (function () {
function NoticeIconComponent() {
this.data = [];
this._loading = false;
this.select = new EventEmitter();
this.clear = new EventEmitter();
this._popoverVisible = false;
this.popoverVisibleChange = new EventEmitter();
}
Object.defineProperty(NoticeIconComponent.prototype, "count", {
/** 图标上的消息总数 */
get: function () {
return this._count;
},
set: function (value) {
this._count = toNumber(value);
},
enumerable: true,
configurable: true
});
Object.defineProperty(NoticeIconComponent.prototype, "loading", {
/** 弹出卡片加载状态 */
get: function () {
return this._loading;
},
set: function (value) {
this._loading = toBoolean(value);
},
enumerable: true,
configurable: true
});
Object.defineProperty(NoticeIconComponent.prototype, "popoverVisible", {
/** 手动控制Popover显示 */
get: function () {
return this._popoverVisible;
},
set: function (value) {
this._popoverVisible = toBoolean(value);
},
enumerable: true,
configurable: true
});
NoticeIconComponent.prototype.onVisibleChange = function (result) {
this.popoverVisibleChange.emit(result);
};
NoticeIconComponent.prototype.onSelect = function (i) {
this.select.emit(i);
};
NoticeIconComponent.prototype.onClear = function (title) {
this.clear.emit(title);
};
NoticeIconComponent.decorators = [
{ type: Component, args: [{
selector: 'notice-icon',
template: "\n <nz-badge *ngIf=\"data?.length === 0\" [nzCount]=\"count\">\n <i class=\"anticon anticon-bell\"></i>\n </nz-badge>\n <nz-popover *ngIf=\"data?.length > 0\"\n [nzVisible]=\"popoverVisible\" (nzVisibleChange)=\"onVisibleChange($event)\" nzTrigger=\"click\"\n nzPlacement=\"bottomRight\"\n nzOverlayClassName=\"ad-notice-icon-con\">\n <div nz-popover class=\"item\">\n <nz-badge [nzCount]=\"count\">\n <i class=\"anticon anticon-bell\"></i>\n </nz-badge>\n </div>\n <ng-template #nzTemplate>\n <nz-spin [nzSpinning]=\"loading\" [nzDelay]=\"0\">\n <nz-tabset>\n <nz-tab *ngFor=\"let i of data\" [nzTitle]=\"i.title\">\n <notice-icon-tab\n [data]=\"i\"\n (select)=\"onSelect($event)\"\n (clear)=\"onClear($event)\"></notice-icon-tab>\n </nz-tab>\n </nz-tabset>\n </nz-spin>\n </ng-template>\n </nz-popover>\n ",
host: { '[class.ad-notice-icon]': 'true' },
preserveWhitespaces: false,
},] },
];
NoticeIconComponent.propDecorators = {
data: [{ type: Input }],
count: [{ type: Input }],
loading: [{ type: Input }],
select: [{ type: Output }],
clear: [{ type: Output }],
popoverVisible: [{ type: Input }],
popoverVisibleChange: [{ type: Output }]
};
return NoticeIconComponent;
}());
export { NoticeIconComponent };
//# sourceMappingURL=notice-icon.component.js.map