Skip to content

Commit a4a72ea

Browse files
committed
feat: add booleanish to more bbutton*
BCloseButton doesn't contain a slot? I don't think it contains any words or anything
1 parent 02c5c90 commit a4a72ea

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

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

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@
66

77
<script setup lang="ts">
88
// import type {BButtonToolbarProps} from '../../types/components'
9+
import type {Booleanish} from '../../types'
910
import {computed} from 'vue'
11+
import {resolveBooleanish} from '../../utils'
1012
1113
interface BButtonToolbarProps {
1214
ariaRole?: string
13-
justify?: boolean
15+
justify?: Booleanish
1416
// keyNav?: boolean
1517
}
1618
@@ -19,7 +21,9 @@ const props = withDefaults(defineProps<BButtonToolbarProps>(), {
1921
justify: false,
2022
})
2123
24+
const justifyBoolean = computed<boolean>(() => resolveBooleanish(props.justify))
25+
2226
const classes = computed(() => ({
23-
'justify-content-between': props.justify,
27+
'justify-content-between': justifyBoolean.value,
2428
}))
2529
</script>

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

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<button
33
type="button"
44
class="btn-close"
5-
:disabled="disabled"
5+
:disabled="disabledBoolean"
66
:class="classes"
77
aria-label="Close"
88
/>
@@ -11,18 +11,23 @@
1111
<script setup lang="ts">
1212
// import type {BCloseButtonProps} from '../../types/components'
1313
import {computed} from 'vue'
14+
import type {Booleanish} from '../../types'
15+
import {resolveBooleanish} from '../../utils'
1416
1517
interface BCloseButtonProps {
16-
disabled?: boolean
17-
white?: boolean
18+
disabled?: Booleanish
19+
white?: Booleanish
1820
}
1921
2022
const props = withDefaults(defineProps<BCloseButtonProps>(), {
2123
disabled: false,
2224
white: false,
2325
})
2426
27+
const disabledBoolean = computed<boolean>(() => resolveBooleanish(props.disabled))
28+
const whiteBoolean = computed<boolean>(() => resolveBooleanish(props.white))
29+
2530
const classes = computed(() => ({
26-
'btn-close-white': props.white,
31+
'btn-close-white': whiteBoolean.value,
2732
}))
2833
</script>

0 commit comments

Comments
 (0)