@@ -12,28 +12,24 @@ const getClasses = (items: {
1212 inline ?: boolean
1313 switch ?: boolean
1414 size ?: InputSize
15- } ) : ComputedRef =>
15+ } ) =>
1616 computed ( ( ) => ( {
1717 'form-check' : ! items . plain && ! items . button ,
18- 'form-check-inline' : items . inline ,
19- 'form-switch' : items . switch ,
20- [ `form-control-${ items . size } ` ] : items . size && items . size !== 'md' ,
18+ 'form-check-inline' : items . inline === true ,
19+ 'form-switch' : items . switch === true ,
20+ [ `form-control-${ items . size } ` ] : items . size !== undefined && items . size !== 'md' ,
2121 } ) )
2222
2323/**
2424 * @param items must be a reactive object ex: reactive({ plain: toRef(plainBoolean, 'value')})
2525 * @returns
2626 */
27- const getInputClasses = ( items : {
28- plain ?: boolean
29- button ?: boolean
30- state ?: boolean
31- } ) : ComputedRef =>
27+ const getInputClasses = ( items : { plain ?: boolean ; button ?: boolean ; state ?: boolean } ) =>
3228 computed ( ( ) => ( {
3329 'form-check-input' : ! items . plain && ! items . button ,
3430 'is-valid' : items . state === true ,
3531 'is-invalid' : items . state === false ,
36- 'btn-check' : items . button ,
32+ 'btn-check' : items . button === true ,
3733 } ) )
3834
3935/**
@@ -45,26 +41,22 @@ const getLabelClasses = (items: {
4541 button ?: boolean
4642 buttonVariant ?: ButtonVariant
4743 size ?: InputSize
48- } ) : ComputedRef =>
44+ } ) =>
4945 computed ( ( ) => ( {
5046 'form-check-label' : ! items . plain && ! items . button ,
51- 'btn' : items . button ,
52- [ `btn-${ items . buttonVariant } ` ] : items . button ,
47+ 'btn' : items . button === true ,
48+ [ `btn-${ items . buttonVariant } ` ] : items . button === true && items . buttonVariant !== undefined ,
5349 [ `btn-${ items . size } ` ] : items . button && items . size && items . size !== 'md' ,
5450 } ) )
5551
5652/**
5753 * @param items must be a reactive object ex: reactive({ plain: toRef(plainBoolean, 'value')})
5854 * @returns
5955 */
60- const getGroupAttr = ( items : {
61- required ?: boolean
62- ariaInvalid ?: AriaInvalid
63- state ?: boolean
64- } ) : ComputedRef =>
56+ const getGroupAttr = ( items : { required ?: boolean ; ariaInvalid ?: AriaInvalid ; state ?: boolean } ) =>
6557 computed ( ( ) => ( {
6658 'aria-invalid' : resolveAriaInvalid ( items . ariaInvalid , items . state ) ,
67- 'aria-required' : items . required ?. toString ( ) === ' true' ? ' true' : null ,
59+ 'aria-required' : items . required === true ? true : undefined ,
6860 } ) )
6961
7062/**
@@ -76,12 +68,12 @@ const getGroupClasses = (items: {
7668 buttons ?: boolean
7769 stacked ?: boolean
7870 size ?: InputSize
79- } ) : ComputedRef =>
71+ } ) =>
8072 computed ( ( ) => ( {
81- 'was-validated' : items . validated ,
82- 'btn-group' : items . buttons && ! items . stacked ,
83- 'btn-group-vertical' : items . stacked ,
84- [ `btn-group-${ items . size } ` ] : items . size ,
73+ 'was-validated' : items . validated === true ,
74+ 'btn-group' : items . buttons === true && ! items . stacked ,
75+ 'btn-group-vertical' : items . stacked === true ,
76+ [ `btn-group-${ items . size } ` ] : items . size !== undefined ,
8577 } ) )
8678
8779// TODO this function is similarly used in BTabs and may be capable of being a util function
@@ -155,8 +147,8 @@ const bindGroupProps = (
155147 el : any ,
156148 idx : number ,
157149 props : any ,
158- computedName : ComputedRef ,
159- computedId : ComputedRef
150+ computedName : ComputedRef < string > ,
151+ computedId : ComputedRef < string >
160152) : any => ( {
161153 ...el ,
162154 props : {
0 commit comments