Skip to content

Commit 02c5c90

Browse files
committed
refactor: explicit type booleanish resolvers
1 parent e9256c1 commit 02c5c90

File tree

7 files changed

+19
-19
lines changed

7 files changed

+19
-19
lines changed

packages/bootstrap-vue-3/src/components/BAccordion/BAccordion.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ const props = withDefaults(defineProps<BAccordionProps>(), {
2626
2727
const computedId = useId(props.id, 'accordion')
2828
29-
const flushBoolean = computed(() => resolveBooleanish(props.flush))
30-
const freeBoolean = computed(() => resolveBooleanish(props.free))
29+
const flushBoolean = computed<boolean>(() => resolveBooleanish(props.flush))
30+
const freeBoolean = computed<boolean>(() => resolveBooleanish(props.free))
3131
3232
const classes = computed(() => ({
3333
'accordion-flush': flushBoolean.value,

packages/bootstrap-vue-3/src/components/BAccordion/BAccordionItem.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ interface BAccordionItemProps {
4646
4747
const props = withDefaults(defineProps<BAccordionItemProps>(), {visible: false})
4848
49-
const visibleBoolean = computed(() => resolveBooleanish(props.visible))
49+
const visibleBoolean = computed<boolean>(() => resolveBooleanish(props.visible))
5050
5151
const computedId = useId(props.id, 'accordion_item')
5252
const parent = inject(injectionKey, '')

packages/bootstrap-vue-3/src/components/BAvatar/BAvatar.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,11 @@ const props = withDefaults(defineProps<BAvatarProps>(), {
6969
variant: 'secondary',
7070
})
7171
72-
const badgeLeftBoolean = computed(() => resolveBooleanish(props.badgeLeft))
73-
const badgeTopBoolean = computed(() => resolveBooleanish(props.badgeTop))
74-
const buttonBoolean = computed(() => resolveBooleanish(props.button))
75-
const disabledBoolean = computed(() => resolveBooleanish(props.disabled))
76-
const squareBoolean = computed(() => resolveBooleanish(props.square))
72+
const badgeLeftBoolean = computed<boolean>(() => resolveBooleanish(props.badgeLeft))
73+
const badgeTopBoolean = computed<boolean>(() => resolveBooleanish(props.badgeTop))
74+
const buttonBoolean = computed<boolean>(() => resolveBooleanish(props.button))
75+
const disabledBoolean = computed<boolean>(() => resolveBooleanish(props.disabled))
76+
const squareBoolean = computed<boolean>(() => resolveBooleanish(props.square))
7777
7878
interface BAvatarEmits {
7979
(e: 'click', value: MouseEvent): void

packages/bootstrap-vue-3/src/components/BAvatar/BAvatarGroup.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const props = withDefaults(defineProps<BAvatarGroupProps>(), {
3131
tag: 'div',
3232
})
3333
34-
const squareBoolean = computed(() => resolveBooleanish(props.square))
34+
const squareBoolean = computed<boolean>(() => resolveBooleanish(props.square))
3535
3636
const computedSize = computed<string | null>(() => computeSize(props.size))
3737

packages/bootstrap-vue-3/src/components/BBadge/BBadge.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,9 @@ export default defineComponent({
2525
const link = computed<boolean>(() => isLink(props))
2626
const computedTag = computed<string>(() => (link.value ? 'b-link' : props.tag))
2727
28-
const pillBoolean = computed(() => resolveBooleanish(props.pill))
29-
const textIndicatorBoolean = computed(() => resolveBooleanish(props.textIndicator))
30-
const dotIndicatorBoolean = computed(() => resolveBooleanish(props.dotIndicator))
28+
const pillBoolean = computed<boolean>(() => resolveBooleanish(props.pill))
29+
const textIndicatorBoolean = computed<boolean>(() => resolveBooleanish(props.textIndicator))
30+
const dotIndicatorBoolean = computed<boolean>(() => resolveBooleanish(props.dotIndicator))
3131
3232
const classes = computed(() => ({
3333
[`bg-${props.variant}`]: props.variant,

packages/bootstrap-vue-3/src/components/BBreadcrumb/BBreadcrumbItem.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ export default defineComponent({
2727
},
2828
emits: ['click'],
2929
setup(props, {emit}) {
30-
const activeBoolean = computed(() => resolveBooleanish(props.active))
31-
const disabledBoolean = computed(() => resolveBooleanish(props.disabled))
30+
const activeBoolean = computed<boolean>(() => resolveBooleanish(props.active))
31+
const disabledBoolean = computed<boolean>(() => resolveBooleanish(props.disabled))
3232
3333
const liClasses = computed(() => ({
3434
active: props.active,

packages/bootstrap-vue-3/src/components/BButton/BButton.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ export default defineComponent({
2828
},
2929
emits: ['click', 'update:pressed'],
3030
setup(props, {emit}) {
31-
const activeBoolean = computed(() => resolveBooleanish(props.active))
32-
const disabledBoolean = computed(() => resolveBooleanish(props.disabled))
33-
const pillBoolean = computed(() => resolveBooleanish(props.pill))
34-
const pressedBoolean = computed(() => resolveBooleanish(props.pressed))
35-
const squaredBoolean = computed(() => resolveBooleanish(props.squared))
31+
const activeBoolean = computed<boolean>(() => resolveBooleanish(props.active))
32+
const disabledBoolean = computed<boolean>(() => resolveBooleanish(props.disabled))
33+
const pillBoolean = computed<boolean>(() => resolveBooleanish(props.pill))
34+
const pressedBoolean = computed<boolean>(() => resolveBooleanish(props.pressed))
35+
const squaredBoolean = computed<boolean>(() => resolveBooleanish(props.squared))
3636
3737
// TODO none of these are computed values. Meaning they will not react if any of these are changed?
3838
const isToggle = pressedBoolean.value !== null

0 commit comments

Comments
 (0)