1
1
import { Component , HostBinding , Input } from '@angular/core' ;
2
- import { NgClass , NgTemplateOutlet } from '@angular/common' ;
2
+ import { NgClass , NgOptimizedImage , NgTemplateOutlet } from '@angular/common' ;
3
3
4
4
import { Colors , Shapes , Sizes , TextColors } from '../coreui.types' ;
5
5
import { TextColorDirective } from '../utilities' ;
@@ -8,35 +8,45 @@ import { TextColorDirective } from '../utilities';
8
8
selector : 'c-avatar' ,
9
9
templateUrl : './avatar.component.html' ,
10
10
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
+ ]
18
18
} )
19
19
export class AvatarComponent {
20
20
/**
21
21
* Sets the background color context of the component to one of CoreUI’s themed colors.
22
22
* @type Colors
23
23
*/
24
24
@Input ( ) color ?: Colors ;
25
+
25
26
/**
26
27
* Select the shape of the component.
27
28
* @type Shapes
28
29
*/
29
30
@Input ( ) shape ?: Shapes ;
31
+
30
32
/**
31
33
* Size the component small, large, or extra large.
32
34
* @default 'md'
33
35
*/
34
36
@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
+
35
44
/**
36
45
* The src attribute for the img element.
37
46
* @type string
38
47
*/
39
48
@Input ( ) src ?: string ;
49
+
40
50
/**
41
51
* Sets the color context of the status indicator to one of CoreUI’s themed colors.
42
52
* @type Colors
@@ -50,8 +60,6 @@ export class AvatarComponent {
50
60
*/
51
61
@Input ( ) textColor ?: TextColors ;
52
62
53
- constructor ( ) { }
54
-
55
63
get statusClass ( ) : any {
56
64
return {
57
65
'avatar-status' : true ,
0 commit comments