File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
projects/coreui-angular/src/lib/form/input-group Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change 1
- import { Component , HostBinding , Input } from '@angular/core' ;
1
+ import { Component , computed , input } from '@angular/core' ;
2
2
3
3
@Component ( {
4
4
selector : 'c-input-group' ,
5
5
template : '<ng-content />' ,
6
6
standalone : true ,
7
- host : { class : 'input-group' }
7
+ host : { class : 'input-group' , '[class]' : 'hostClasses()' }
8
8
} )
9
9
export class InputGroupComponent {
10
10
/**
11
11
* Size the component small or large.
12
12
*/
13
- @ Input ( ) sizing : string | 'sm' | 'lg' | '' = '' ;
13
+ readonly sizing = input < string | 'sm' | 'lg' | '' > ( '' ) ;
14
14
15
- @ HostBinding ( 'class' )
16
- get hostClasses ( ) : any {
15
+ readonly hostClasses = computed ( ( ) => {
16
+ const sizing = this . sizing ( ) ;
17
17
return {
18
18
'input-group' : true ,
19
- [ `input-group-${ this . sizing } ` ] : ! ! this . sizing
20
- } ;
21
- }
19
+ [ `input-group-${ sizing } ` ] : ! ! sizing
20
+ } as Record < string , boolean > ;
21
+ } ) ;
22
22
}
You can’t perform that action at this time.
0 commit comments