1- import { booleanAttribute , Component , computed , input , InputSignal , InputSignalWithTransform } from '@angular/core' ;
1+ import { booleanAttribute , Component , computed , input , InputSignalWithTransform } from '@angular/core' ;
22
33@Component ( {
44 selector : 'c-button-group' ,
@@ -8,9 +8,9 @@ import { booleanAttribute, Component, computed, input, InputSignal, InputSignalW
88export class ButtonGroupComponent {
99 /**
1010 * Size the component small or large.
11- * @type { 'sm' | 'lg' }
11+ * @return { 'sm' | 'lg' }
1212 */
13- readonly size : InputSignal < ' sm' | 'lg' | undefined > = input ( ) ;
13+ readonly size = input < '' | ' sm' | 'lg' | string > ( ) ;
1414
1515 /**
1616 * Create a set of buttons that appear vertically stacked rather than horizontally. Split button dropdowns are not supported here.
@@ -20,16 +20,18 @@ export class ButtonGroupComponent {
2020
2121 /**
2222 * Default role attr for ButtonGroup. [docs]
23- * @type InputSignal< string>
23+ * @return string
2424 * @default 'group'
2525 */
26- readonly role : InputSignal < string > = input ( 'group' ) ;
26+ readonly role = input < string > ( 'group' ) ;
2727
2828 readonly hostClasses = computed ( ( ) => {
29+ const size = this . size ( ) ;
30+ const vertical = this . vertical ( ) ;
2931 return {
30- 'btn-group' : ! this . vertical ( ) ,
31- 'btn-group-vertical' : this . vertical ( ) ,
32- [ `btn-group-${ this . size ( ) } ` ] : ! ! this . size ( )
32+ 'btn-group' : ! vertical ,
33+ 'btn-group-vertical' : vertical ,
34+ [ `btn-group-${ size } ` ] : ! ! size
3335 } as Record < string , boolean > ;
3436 } ) ;
3537}
0 commit comments