@@ -2,6 +2,7 @@ import { Component, HostBinding, Input } from '@angular/core';
2
2
import { NgClass , NgTemplateOutlet } from '@angular/common' ;
3
3
4
4
import { Colors , Shapes , Sizes , TextColors } from '../coreui.types' ;
5
+ import { TextColorDirective } from '../utilities' ;
5
6
6
7
@Component ( {
7
8
selector : 'c-avatar' ,
@@ -10,7 +11,10 @@ import { Colors, Shapes, Sizes, TextColors } from '../coreui.types';
10
11
imports : [
11
12
NgTemplateOutlet ,
12
13
NgClass
13
- ]
14
+ ] ,
15
+ hostDirectives : [ {
16
+ directive : TextColorDirective , inputs : [ 'cTextColor: textColor' ]
17
+ } ]
14
18
} )
15
19
export class AvatarComponent {
16
20
/**
@@ -38,10 +42,11 @@ export class AvatarComponent {
38
42
* @type Colors
39
43
*/
40
44
@Input ( ) status ?: Colors ;
45
+
41
46
/**
42
47
* Sets the text color of the component to one of CoreUI’s themed colors.
43
- *
44
- * @values 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'dark' | 'light' | 'white' | 'muted' | string
48
+ * via TextColorDirective
49
+ * @type TextColors
45
50
*/
46
51
@Input ( ) textColor ?: TextColors ;
47
52
@@ -60,8 +65,7 @@ export class AvatarComponent {
60
65
avatar : true ,
61
66
[ `avatar-${ this . size } ` ] : ! ! this . size ,
62
67
[ `bg-${ this . color } ` ] : ! ! this . color ,
63
- [ `${ this . shape } ` ] : ! ! this . shape ,
64
- [ `text-${ this . textColor } ` ] : ! ! this . textColor
68
+ [ `${ this . shape } ` ] : ! ! this . shape
65
69
} ;
66
70
}
67
71
}
0 commit comments