ng-zorro-antd-yj
Version:
An enterprise-class UI components based on Ant Design and Angular
67 lines • 5.29 kB
JavaScript
/**
* @fileoverview added by tsickle
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
*/
import { ChangeDetectionStrategy, Component, ElementRef, Input, Renderer2, TemplateRef, ViewEncapsulation } from '@angular/core';
export class NzListItemMetaComponent {
/**
* @param {?} elementRef
* @param {?} renderer
*/
constructor(elementRef, renderer) {
this.elementRef = elementRef;
this.renderer = renderer;
this.avatarStr = '';
this.renderer.addClass(elementRef.nativeElement, 'ant-list-item-meta');
}
/**
* @param {?} value
* @return {?}
*/
set nzAvatar(value) {
if (value instanceof TemplateRef) {
this.avatarStr = '';
this.avatarTpl = value;
}
else {
this.avatarStr = value;
}
}
}
NzListItemMetaComponent.decorators = [
{ type: Component, args: [{
selector: 'nz-list-item-meta',
template: "<div *ngIf=\"avatarStr || avatarTpl\" class=\"ant-list-item-meta-avatar\">\n <ng-container *ngIf=\"avatarStr; else avatarTpl\">\n <nz-avatar [nzSrc]=\"avatarStr\"></nz-avatar>\n </ng-container>\n</div>\n<div *ngIf=\"nzTitle || nzDescription\" class=\"ant-list-item-meta-content\">\n <h4 *ngIf=\"nzTitle\" class=\"ant-list-item-meta-title\">\n <ng-container *nzStringTemplateOutlet=\"nzTitle\">{{ nzTitle }}</ng-container>\n </h4>\n <div *ngIf=\"nzDescription\" class=\"ant-list-item-meta-description\">\n <ng-container *nzStringTemplateOutlet=\"nzDescription\">{{ nzDescription }}</ng-container>\n </div>\n</div>",
preserveWhitespaces: false,
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None
}] }
];
/** @nocollapse */
NzListItemMetaComponent.ctorParameters = () => [
{ type: ElementRef },
{ type: Renderer2 }
];
NzListItemMetaComponent.propDecorators = {
nzAvatar: [{ type: Input }],
nzTitle: [{ type: Input }],
nzDescription: [{ type: Input }]
};
if (false) {
/** @type {?} */
NzListItemMetaComponent.prototype.avatarStr;
/** @type {?} */
NzListItemMetaComponent.prototype.avatarTpl;
/** @type {?} */
NzListItemMetaComponent.prototype.nzTitle;
/** @type {?} */
NzListItemMetaComponent.prototype.nzDescription;
/** @type {?} */
NzListItemMetaComponent.prototype.elementRef;
/**
* @type {?}
* @private
*/
NzListItemMetaComponent.prototype.renderer;
}
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnotbGlzdC1pdGVtLW1ldGEuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6Im5nOi8vbmctem9ycm8tYW50ZC15ai8iLCJzb3VyY2VzIjpbImxpc3QvbnotbGlzdC1pdGVtLW1ldGEuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7QUFBQSxPQUFPLEVBQ0wsdUJBQXVCLEVBQ3ZCLFNBQVMsRUFDVCxVQUFVLEVBQ1YsS0FBSyxFQUNMLFNBQVMsRUFDVCxXQUFXLEVBQ1gsaUJBQWlCLEVBQ2xCLE1BQU0sZUFBZSxDQUFDO0FBU3ZCLE1BQU0sT0FBTyx1QkFBdUI7Ozs7O0lBa0JsQyxZQUFtQixVQUFzQixFQUFVLFFBQW1CO1FBQW5ELGVBQVUsR0FBVixVQUFVLENBQVk7UUFBVSxhQUFRLEdBQVIsUUFBUSxDQUFXO1FBakJ0RSxjQUFTLEdBQUcsRUFBRSxDQUFDO1FBa0JiLElBQUksQ0FBQyxRQUFRLENBQUMsUUFBUSxDQUFDLFVBQVUsQ0FBQyxhQUFhLEVBQUUsb0JBQW9CLENBQUMsQ0FBQztJQUN6RSxDQUFDOzs7OztJQWhCRCxJQUNJLFFBQVEsQ0FBQyxLQUFpQztRQUM1QyxJQUFJLEtBQUssWUFBWSxXQUFXLEVBQUU7WUFDaEMsSUFBSSxDQUFDLFNBQVMsR0FBRyxFQUFFLENBQUM7WUFDcEIsSUFBSSxDQUFDLFNBQVMsR0FBRyxLQUFLLENBQUM7U0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