11import { Component , HostBinding , Input } from '@angular/core' ;
2- import { NgClass , NgTemplateOutlet } from '@angular/common' ;
2+ import { NgClass , NgOptimizedImage , NgTemplateOutlet } from '@angular/common' ;
33
44import { Colors , Shapes , Sizes , TextColors } from '../coreui.types' ;
55import { TextColorDirective } from '../utilities' ;
@@ -8,35 +8,45 @@ import { TextColorDirective } from '../utilities';
88 selector : 'c-avatar' ,
99 templateUrl : './avatar.component.html' ,
1010 standalone : true ,
11- imports : [
12- NgTemplateOutlet ,
13- NgClass
14- ] ,
15- hostDirectives : [ {
16- directive : TextColorDirective , inputs : [ 'cTextColor: textColor' ]
17- } ]
11+ imports : [ NgTemplateOutlet , NgClass , NgOptimizedImage ] ,
12+ hostDirectives : [
13+ {
14+ directive : TextColorDirective ,
15+ inputs : [ 'cTextColor: textColor' ]
16+ }
17+ ]
1818} )
1919export class AvatarComponent {
2020 /**
2121 * Sets the background color context of the component to one of CoreUI’s themed colors.
2222 * @type Colors
2323 */
2424 @Input ( ) color ?: Colors ;
25+
2526 /**
2627 * Select the shape of the component.
2728 * @type Shapes
2829 */
2930 @Input ( ) shape ?: Shapes ;
31+
3032 /**
3133 * Size the component small, large, or extra large.
3234 * @default 'md'
3335 */
3436 @Input ( ) size ?: Omit < Sizes , 'xxl' > = 'md' ;
37+
38+ /**
39+ * The alt attribute for the img element alternate text.
40+ * @type string
41+ */
42+ @Input ( ) alt : string = '' ;
43+
3544 /**
3645 * The src attribute for the img element.
3746 * @type string
3847 */
3948 @Input ( ) src ?: string ;
49+
4050 /**
4151 * Sets the color context of the status indicator to one of CoreUI’s themed colors.
4252 * @type Colors
@@ -50,8 +60,6 @@ export class AvatarComponent {
5060 */
5161 @Input ( ) textColor ?: TextColors ;
5262
53- constructor ( ) { }
54-
5563 get statusClass ( ) : any {
5664 return {
5765 'avatar-status' : true ,
0 commit comments