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' ;
22
33@Component ( {
44 selector : 'c-input-group' ,
55 template : '<ng-content />' ,
66 standalone : true ,
7- host : { class : 'input-group' }
7+ host : { class : 'input-group' , '[class]' : 'hostClasses()' }
88} )
99export class InputGroupComponent {
1010 /**
1111 * Size the component small or large.
1212 */
13- @ Input ( ) sizing : string | 'sm' | 'lg' | '' = '' ;
13+ readonly sizing = input < string | 'sm' | 'lg' | '' > ( '' ) ;
1414
15- @ HostBinding ( 'class' )
16- get hostClasses ( ) : any {
15+ readonly hostClasses = computed ( ( ) => {
16+ const sizing = this . sizing ( ) ;
1717 return {
1818 'input-group' : true ,
19- [ `input-group-${ this . sizing } ` ] : ! ! this . sizing
20- } ;
21- }
19+ [ `input-group-${ sizing } ` ] : ! ! sizing
20+ } as Record < string , boolean > ;
21+ } ) ;
2222}
You can’t perform that action at this time.
0 commit comments