UNPKG

ng-zorro-antd-yj

Version:

An enterprise-class UI components based on Ant Design and Angular

94 lines 8.01 kB
/** * @fileoverview added by tsickle * @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc */ import * as tslib_1 from "tslib"; import { ChangeDetectionStrategy, Component, ContentChild, ElementRef, Input, Renderer2, TemplateRef, ViewEncapsulation } from '@angular/core'; import { InputBoolean } from '../core/util/convert'; import { NzCardTabComponent } from './nz-card-tab.component'; export class NzCardComponent { /** * @param {?} renderer * @param {?} elementRef */ constructor(renderer, elementRef) { this.nzBordered = true; this.nzLoading = false; this.nzHoverable = false; this.nzActions = []; renderer.addClass(elementRef.nativeElement, 'ant-card'); } } NzCardComponent.decorators = [ { type: Component, args: [{ selector: 'nz-card', preserveWhitespaces: false, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, template: "<div class=\"ant-card-head\" *ngIf=\"nzTitle || nzExtra || tab\">\n <div class=\"ant-card-head-wrapper\">\n <div class=\"ant-card-head-title\" *ngIf=\"nzTitle\">\n <ng-container *nzStringTemplateOutlet=\"nzTitle\">{{ nzTitle }}</ng-container>\n </div>\n <div class=\"ant-card-extra\" *ngIf=\"nzExtra\">\n <ng-container *nzStringTemplateOutlet=\"nzExtra\">{{ nzExtra }}</ng-container>\n </div>\n </div>\n <ng-container *ngIf=\"tab\">\n <ng-template [ngTemplateOutlet]=\"tab.template\"></ng-template>\n </ng-container>\n</div>\n<div class=\"ant-card-cover\" *ngIf=\"nzCover\">\n <ng-template [ngTemplateOutlet]=\"nzCover\"></ng-template>\n</div>\n<div class=\"ant-card-body\" [ngStyle]=\"nzBodyStyle\">\n <ng-container *ngIf=\"!nzLoading\">\n <ng-content></ng-content>\n </ng-container>\n <nz-card-loading *ngIf=\"nzLoading\"></nz-card-loading>\n</div>\n<ul class=\"ant-card-actions\" *ngIf=\"nzActions.length\">\n <li *ngFor=\"let action of nzActions\" [style.width.%]=\"100 / nzActions.length\">\n <span><ng-template [ngTemplateOutlet]=\"action\"></ng-template></span>\n </li>\n</ul>", host: { '[class.ant-card-loading]': 'nzLoading', '[class.ant-card-bordered]': 'nzBordered', '[class.ant-card-hoverable]': 'nzHoverable', '[class.ant-card-type-inner]': `nzType === 'inner'`, '[class.ant-card-contain-tabs]': '!!tab' }, styles: [` nz-card { display: block; } `] }] } ]; /** @nocollapse */ NzCardComponent.ctorParameters = () => [ { type: Renderer2 }, { type: ElementRef } ]; NzCardComponent.propDecorators = { nzBordered: [{ type: Input }], nzLoading: [{ type: Input }], nzHoverable: [{ type: Input }], nzBodyStyle: [{ type: Input }], nzCover: [{ type: Input }], nzActions: [{ type: Input }], nzType: [{ type: Input }], nzTitle: [{ type: Input }], nzExtra: [{ type: Input }], tab: [{ type: ContentChild, args: [NzCardTabComponent,] }] }; tslib_1.__decorate([ InputBoolean(), tslib_1.__metadata("design:type", Object) ], NzCardComponent.prototype, "nzBordered", void 0); tslib_1.__decorate([ InputBoolean(), tslib_1.__metadata("design:type", Object) ], NzCardComponent.prototype, "nzLoading", void 0); tslib_1.__decorate([ InputBoolean(), tslib_1.__metadata("design:type", Object) ], NzCardComponent.prototype, "nzHoverable", void 0); if (false) { /** @type {?} */ NzCardComponent.prototype.nzBordered; /** @type {?} */ NzCardComponent.prototype.nzLoading; /** @type {?} */ NzCardComponent.prototype.nzHoverable; /** @type {?} */ NzCardComponent.prototype.nzBodyStyle; /** @type {?} */ NzCardComponent.prototype.nzCover; /** @type {?} */ NzCardComponent.prototype.nzActions; /** @type {?} */ NzCardComponent.prototype.nzType; /** @type {?} */ NzCardComponent.prototype.nzTitle; /** @type {?} */ NzCardComponent.prototype.nzExtra; /** @type {?} */ NzCardComponent.prototype.tab; } //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnotY2FyZC5jb21wb25lbnQuanMiLCJzb3VyY2VSb290Ijoibmc6Ly9uZy16b3Jyby1hbnRkLXlqLyIsInNvdXJjZXMiOls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