UNPKG

primeng

Version:

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![npm version](https://badge.fury.io/js/primeng.svg)](https://badge.fury.io/js/primeng) [![Discord](https://img.shields.io/discord/557940238991753

60 lines (56 loc) 2.2 kB
import { Component, ChangeDetectionStrategy, ViewEncapsulation, Input, NgModule } from '@angular/core'; import { CommonModule } from '@angular/common'; class Avatar { constructor() { this.size = "normal"; this.shape = "square"; } containerClass() { return { 'p-avatar p-component': true, 'p-avatar-image': this.image != null, 'p-avatar-circle': this.shape === 'circle', 'p-avatar-lg': this.size === 'large', 'p-avatar-xl': this.size === 'xlarge' }; } } Avatar.decorators = [ { type: Component, args: [{ selector: 'p-avatar', template: ` <div [ngClass]="containerClass()" [class]="styleClass" [ngStyle]="style"> <ng-content></ng-content> <span class="p-avatar-text" *ngIf="label; else iconTemplate">{{label}}</span> <ng-template #iconTemplate><span [class]="icon" [ngClass]="'p-avatar-icon'" *ngIf="icon; else imageTemplate"></span></ng-template> <ng-template #imageTemplate><img [src]="image" *ngIf="image"></ng-template> </div> `, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, styles: [".p-avatar{align-items:center;display:inline-flex;font-size:1rem;height:2rem;justify-content:center;width:2rem}.p-avatar.p-avatar-image{background-color:transparent}.p-avatar.p-avatar-circle{border-radius:50%;overflow:hidden}.p-avatar .p-avatar-icon{font-size:1rem}.p-avatar img{height:100%;width:100%}"] },] } ]; Avatar.propDecorators = { label: [{ type: Input }], icon: [{ type: Input }], image: [{ type: Input }], size: [{ type: Input }], shape: [{ type: Input }], style: [{ type: Input }], styleClass: [{ type: Input }] }; class AvatarModule { } AvatarModule.decorators = [ { type: NgModule, args: [{ imports: [CommonModule], exports: [Avatar], declarations: [Avatar] },] } ]; /** * Generated bundle index. Do not edit. */ export { Avatar, AvatarModule }; //# sourceMappingURL=primeng-avatar.js.map