1- import { booleanAttribute , Component , HostBinding , Input } from '@angular/core' ;
1+ import { booleanAttribute , Component , HostBinding , input , InputSignal , InputSignalWithTransform } from '@angular/core' ;
22import { NgClass } from '@angular/common' ;
33
4- import { Colors , TextColors } from '../../coreui.types' ;
54import { CardBodyComponent , CardComponent } from '../../card' ;
65
76@Component ( {
@@ -12,51 +11,54 @@ import { CardBodyComponent, CardComponent } from '../../card';
1211 imports : [ CardBodyComponent , NgClass ]
1312} )
1413export class WidgetStatBComponent extends CardComponent {
15-
1614 constructor ( ) {
1715 super ( ) ;
1816 }
1917
2018 /**
21- * Sets the color context of the component to one of CoreUI’s themed colors.
19+ * Sets the color context of the component to one of CoreUI themed colors.
2220 * @type Colors
2321 */
24- @Input ( ) override color ?: Colors ;
22+ // override readonly color: InputSignal<Colors | undefined> = input();
23+
2524 /**
26- * Sets the text-color context of the component to one of CoreUI’s themed colors.
27- * @type Colors
25+ * Sets the text-color context of the component to one of CoreUI themed colors.
26+ * via TextColorDirective
27+ * @type TextColors
2828 */
29- @Input ( ) override textColor ?: TextColors ;
29+ // override readonly textColor: InputSignal<TextColors | undefined> = input();
30+
3031 /**
3132 * Title of the widget to display
3233 * @type string
3334 */
34- @Input ( ) title ?: string ;
35+ readonly title : InputSignal < string | undefined > = input ( ) ;
36+
3537 /**
3638 * Helper text for your widget.
3739 * @type string
3840 */
39- @Input ( ) text ?: string ;
41+ readonly text : InputSignal < string | undefined > = input ( ) ;
42+
4043 /**
4144 * Value for your widget to display
4245 * @type string
4346 */
44- @ Input ( ) value ?: string ;
47+ readonly value : InputSignal < string | undefined > = input ( ) ;
4548
4649 /**
4750 * Invert colors from their default dark shade.
4851 * @type boolean
4952 */
50- @ Input ( { transform : booleanAttribute } ) inverse : string | boolean = false ;
53+ readonly inverse : InputSignalWithTransform < boolean , unknown > = input ( false , { transform : booleanAttribute } ) ;
5154
5255 @HostBinding ( 'class' )
5356 override get hostClasses ( ) {
5457 return {
55- ' card' : true ,
56- [ `bg-${ this . color } ` ] : ! ! this . color ,
57- [ `text-${ this . textColor } ` ] : ! ! this . textColor ,
58- 'text-white' : ! ! this . inverse
58+ card : true ,
59+ [ `bg-${ this . color ( ) } ` ] : ! ! this . color ( ) ,
60+ [ `text-${ this . textColor ( ) } ` ] : ! ! this . textColor ( ) ,
61+ 'text-white' : this . inverse ( )
5962 } ;
6063 }
61-
6264}
0 commit comments