UNPKG

yoyo-ng-modulewindy

Version:

服务于52ABP模板的前端开源的相关组件内容。整合了ng-alain和你NG ZORRO的内容

116 lines 4.93 kB
import { Component, TemplateRef, Input, } from '@angular/core'; import { toBoolean } from 'yoyo-ng-module/util'; var G2CardComponent = /** @class */ (function () { function G2CardComponent() { // region fields this._bordered = false; this._avatar = ''; this._title = ''; this._action = ''; this.total = ''; this._height = 'auto'; this._footer = ''; this._loading = false; // endregion } Object.defineProperty(G2CardComponent.prototype, "bordered", { /** 是否显示边框 */ get: function () { return this._bordered; }, set: function (value) { this._bordered = toBoolean(value); }, enumerable: true, configurable: true }); Object.defineProperty(G2CardComponent.prototype, "avatar", { set: function (value) { if (value instanceof TemplateRef) { this._avatar = null; this._avatarTpl = value; } else this._avatar = value; }, enumerable: true, configurable: true }); Object.defineProperty(G2CardComponent.prototype, "title", { set: function (value) { if (value instanceof TemplateRef) { this._title = null; this._titleTpl = value; } else this._title = value; }, enumerable: true, configurable: true }); Object.defineProperty(G2CardComponent.prototype, "action", { set: function (value) { if (value instanceof TemplateRef) { this._action = null; this._actionTpl = value; } else this._action = value; }, enumerable: true, configurable: true }); Object.defineProperty(G2CardComponent.prototype, "contentHeight", { set: function (value) { this._orgHeight = value; this._height = typeof value === 'number' ? (this._height = value + "px") : value; }, enumerable: true, configurable: true }); Object.defineProperty(G2CardComponent.prototype, "footer", { set: function (value) { if (value instanceof TemplateRef) { this._footer = null; this._footerTpl = value; } else this._footer = value; }, enumerable: true, configurable: true }); Object.defineProperty(G2CardComponent.prototype, "loading", { /** 是否显示Loading */ get: function () { return this._loading; }, set: function (value) { this._loading = toBoolean(value); }, enumerable: true, configurable: true }); G2CardComponent.decorators = [ { type: Component, args: [{ selector: 'g2-card', template: "\n <nz-card [nzBodyStyle]=\"{padding: '20px 24px 8px 24px'}\" [nzBordered]=\"bordered\">\n <nz-spin [nzSpinning]=\"loading\">\n <div class=\"chart-card\">\n <div class=\"chart-top\">\n <div class=\"avatar\"><ng-container *ngIf=\"_avatar; else _avatarTpl\">{{ _avatar }}</ng-container></div>\n <div class=\"meta-wrap\">\n <div class=\"meta\">\n <span class=\"title\" *ngIf=\"_title; else _titleTpl\">{{ _title }}</span>\n <span class=\"action\" *ngIf=\"_action || _actionTpl\">\n <ng-container *ngIf=\"_action; else _actionTpl\">{{ _action }}</ng-container>\n </span>\n </div>\n <p *ngIf=\"total\" class=\"total\" [innerHTML]=\"total\"></p>\n </div>\n </div>\n <div class=\"desc\" [ngStyle]=\"{'height':_height}\">\n <div [ngClass]=\"{'fixed': !!_orgHeight }\">\n <ng-content></ng-content>\n </div>\n </div>\n <div class=\"footer\" *ngIf=\"_footer || _footerTpl\">\n <ng-container *ngIf=\"_footer; else _footerTpl\">{{ _footer }}</ng-container>\n </div>\n </div>\n </nz-spin>\n </nz-card>", host: { '[class.ad-g2-card]': 'true' }, preserveWhitespaces: false, },] }, ]; G2CardComponent.propDecorators = { bordered: [{ type: Input }], avatar: [{ type: Input }], title: [{ type: Input }], action: [{ type: Input }], total: [{ type: Input }], contentHeight: [{ type: Input }], footer: [{ type: Input }], loading: [{ type: Input }] }; return G2CardComponent; }()); export { G2CardComponent }; //# sourceMappingURL=card.component.js.map