Skip to content
This repository was archived by the owner on Mar 27, 2025. It is now read-only.

Commit 02d81f6

Browse files
authored
Merge branch 'bootstrap-vue-next:main' into main
2 parents 43f98e0 + 8c82d06 commit 02d81f6

File tree

10 files changed

+99
-20
lines changed

10 files changed

+99
-20
lines changed

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"packages/bootstrap-vue-next": "0.9.6",
2+
"packages/bootstrap-vue-next": "0.9.9",
33
"packages/nuxt": "0.1.0"
44
}

apps/docs/.vitepress/theme/Layout.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
<client-only>
8080
<b-offcanvas
8181
v-model="sidebar"
82-
static="true"
82+
teleport-disabled="true"
8383
backdrop="false"
8484
title="Browse docs"
8585
class="h-100"

packages/bootstrap-vue-next/CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,27 @@
11
# Changelog
22

33

4+
## [0.9.9](https://github.com/bootstrap-vue-next/bootstrap-vue-next/compare/bootstrap-vue-next-v0.9.8...bootstrap-vue-next-v0.9.9) (2023-06-20)
5+
6+
7+
### Bug Fixes
8+
9+
* **BFormRadio:** update value with empty string. ([1a0f733](https://github.com/bootstrap-vue-next/bootstrap-vue-next/commit/1a0f7338b922e7abb2ff83ad21379f65150a88cb))
10+
11+
## [0.9.8](https://github.com/bootstrap-vue-next/bootstrap-vue-next/compare/bootstrap-vue-next-v0.9.7...bootstrap-vue-next-v0.9.8) (2023-06-20)
12+
13+
14+
### Bug Fixes
15+
16+
* **BTable:** support multi select mode for macOS users ([3a76884](https://github.com/bootstrap-vue-next/bootstrap-vue-next/commit/3a76884c203e28718a73d36e97fd16a60c503a3e))
17+
18+
## [0.9.7](https://github.com/bootstrap-vue-next/bootstrap-vue-next/compare/bootstrap-vue-next-v0.9.6...bootstrap-vue-next-v0.9.7) (2023-06-19)
19+
20+
21+
### Bug Fixes
22+
23+
* **BOffcanvas:** toggle offcanvas with toggle directive. ([e4d47f5](https://github.com/bootstrap-vue-next/bootstrap-vue-next/commit/e4d47f5b0428ff155f69d7b11073f1711bb878e5))
24+
425
## [0.9.6](https://github.com/bootstrap-vue-next/bootstrap-vue-next/compare/bootstrap-vue-next-v0.9.5...bootstrap-vue-next-v0.9.6) (2023-06-16)
526

627

packages/bootstrap-vue-next/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "bootstrap-vue-next",
33
"displayName": "BootstrapVueNext",
44
"description": "Early (but lovely) implementation of Vue 3, Bootstrap 5 and Typescript",
5-
"version": "0.9.6",
5+
"version": "0.9.9",
66
"license": "MIT",
77
"main": "./dist/bootstrap-vue-next.umd.js",
88
"module": "./dist/bootstrap-vue-next.mjs",

packages/bootstrap-vue-next/src/components/BFormRadio/BFormRadio.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ const localValue = computed({
122122
? JSON.stringify(parentData.modelValue.value) === JSON.stringify(props.value)
123123
: JSON.stringify(modelValue.value) === JSON.stringify(props.value),
124124
set: (newValue: string | boolean | unknown[] | Record<string, unknown> | number | null) => {
125-
const updateValue = newValue || newValue === 0 ? props.value : false
125+
const updateValue = newValue || newValue === '' || newValue === 0 ? props.value : false
126126
127127
emit('input', updateValue)
128128
modelValue.value = updateValue

packages/bootstrap-vue-next/src/components/BModal.vue

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<teleport to="body" :disabled="staticBoolean">
2+
<teleport :to="teleportTo" :disabled="teleportDisabledBoolean">
33
<b-transition
44
:no-fade="true"
55
:trans-props="{enterToClass: 'show'}"
@@ -90,7 +90,7 @@
9090
</template>
9191

9292
<script setup lang="ts">
93-
import {computed, ref, useSlots} from 'vue'
93+
import {computed, ref, type RendererElement, useSlots} from 'vue'
9494
import {useBooleanish, useId, useModalManager} from '../composables'
9595
import {useEventListener, useFocus, useVModel} from '@vueuse/core'
9696
import type {Booleanish, ButtonVariant, ClassValue, ColorVariant, Size} from '../types'
@@ -156,8 +156,9 @@ interface BModalProps {
156156
titleClass?: string
157157
titleSrOnly?: Booleanish
158158
titleTag?: string
159-
static?: Booleanish
160159
autoFocusButton?: 'ok' | 'cancel' | 'close'
160+
teleportDisabled?: Booleanish
161+
teleportTo?: string | RendererElement | null | undefined
161162
}
162163
163164
interface BModalEmits {
@@ -215,12 +216,13 @@ const props = withDefaults(defineProps<BModalProps>(), {
215216
okDisabled: false,
216217
okOnly: false,
217218
okTitle: 'Ok',
218-
static: false,
219219
okVariant: 'primary',
220220
scrollable: false,
221221
show: false,
222222
titleSrOnly: false,
223223
titleTag: 'h5',
224+
teleportDisabled: false,
225+
teleportTo: 'body',
224226
})
225227
226228
const emit = defineEmits<BModalEmits>()
@@ -267,7 +269,7 @@ const okDisabledBoolean = useBooleanish(() => props.okDisabled)
267269
const okOnlyBoolean = useBooleanish(() => props.okOnly)
268270
const scrollableBoolean = useBooleanish(() => props.scrollable)
269271
const titleSrOnlyBoolean = useBooleanish(() => props.titleSrOnly)
270-
const staticBoolean = useBooleanish(() => props.static)
272+
const teleportDisabledBoolean = useBooleanish(() => props.teleportDisabled)
271273
272274
const element = ref<HTMLElement | null>(null)
273275
const okButton = ref<HTMLElement | null>(null)

packages/bootstrap-vue-next/src/components/BOffcanvas/BOffcanvas.vue

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<teleport to="body" :disabled="staticBoolean">
2+
<teleport :to="teleportTo" :disabled="teleportDisabledBoolean">
33
<b-transition
44
:no-fade="true"
55
:trans-props="{
@@ -63,7 +63,7 @@
6363
</template>
6464

6565
<script setup lang="ts">
66-
import {computed, nextTick, ref, useSlots} from 'vue'
66+
import {computed, nextTick, ref, type RendererElement, useSlots} from 'vue'
6767
import {useEventListener, useFocus, useVModel} from '@vueuse/core'
6868
import {useBooleanish, useId} from '../../composables'
6969
import type {Booleanish, ColorVariant} from '../../types'
@@ -93,11 +93,12 @@ interface BOffcanvasProps {
9393
lazy?: Booleanish
9494
id?: string
9595
noFocus?: Booleanish
96-
static?: Booleanish
9796
backdropVariant?: ColorVariant | null
9897
headerClass?: string
9998
bodyClass?: string
10099
footerClass?: string
100+
teleportDisabled?: Booleanish
101+
teleportTo?: string | RendererElement | null | undefined
101102
// TODO responsive doesn't work
102103
// responsive?: Breakpoint
103104
}
@@ -119,7 +120,6 @@ const props = withDefaults(defineProps<BOffcanvasProps>(), {
119120
id: undefined,
120121
title: undefined,
121122
modelValue: false,
122-
static: false,
123123
backdropVariant: 'dark',
124124
noFocus: false,
125125
bodyScrolling: false,
@@ -133,6 +133,8 @@ const props = withDefaults(defineProps<BOffcanvasProps>(), {
133133
headerClass: undefined,
134134
bodyClass: undefined,
135135
footerClass: undefined,
136+
teleportDisabled: false,
137+
teleportTo: 'body',
136138
})
137139
138140
const emit = defineEmits<BOffcanvasEmits>()
@@ -158,7 +160,7 @@ defineSlots<{
158160
159161
const slots = useSlots()
160162
161-
const modelValue = useVModel(props, 'modelValue', emit)
163+
const modelValue = useVModel(props, 'modelValue', emit, {passive: true})
162164
163165
const modelValueBoolean = useBooleanish(modelValue)
164166
// TODO
@@ -171,7 +173,7 @@ const noFocusBoolean = useBooleanish(() => props.noFocus)
171173
const noCloseOnBackdropBoolean = useBooleanish(() => props.noCloseOnBackdrop)
172174
const noCloseOnEscBoolean = useBooleanish(() => props.noCloseOnEsc)
173175
const lazyBoolean = useBooleanish(() => props.lazy)
174-
const staticBoolean = useBooleanish(() => props.static)
176+
const teleportDisabledBoolean = useBooleanish(() => props.teleportDisabled)
175177
176178
const computedId = useId(() => props.id, 'offcanvas')
177179

packages/bootstrap-vue-next/src/components/BOffcanvas/offcanvas.spec.ts

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {enableAutoUnmount, mount} from '@vue/test-utils'
2-
import {afterEach, describe, expect, it} from 'vitest'
2+
import {afterEach, beforeEach, describe, expect, it} from 'vitest'
33
import BOffcanvas from './BOffcanvas.vue'
44
import BCloseButton from '../BButton/BCloseButton.vue'
55
import BOverlay from '../BOverlay/BOverlay.vue'
@@ -8,6 +8,28 @@ describe.skip('offcanvas', () => {
88

99
// TODO afaik these tests are not finished
1010

11+
beforeEach(() => {
12+
const el = document.createElement('div')
13+
el.id = 'body-teleports'
14+
document.body.appendChild(el)
15+
})
16+
17+
afterEach(() => {
18+
const el = document.getElementById('body-teleports')
19+
if (el) document.body.removeChild(el)
20+
})
21+
22+
it('has body teleports element set by teleportTo property', () => {
23+
const wrapper = mount(BOffcanvas, {
24+
props: {
25+
teleportTo: '#body-teleports',
26+
modelValue: true,
27+
},
28+
})
29+
expect(wrapper.exists()).toBe(true)
30+
expect(document.getElementById('body-teleports')?.querySelector('.offcanvas')).not.toBe(null)
31+
})
32+
1133
it('has static class offcanvas', () => {
1234
const wrapper = mount(BOffcanvas, {
1335
props: {

packages/bootstrap-vue-next/src/components/BTable/BTable.vue

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,11 @@
4949
v-if="$slots['head(' + field.key + ')'] || $slots['head()']"
5050
:name="$slots['head(' + field.key + ')'] ? 'head(' + field.key + ')' : 'head()'"
5151
:label="field.label"
52+
:column="field.key"
53+
:field="field"
54+
:is-foot="false"
55+
:select-all-rows="selectAllRows"
56+
:clear-selected="clearSelected"
5257
/>
5358
<template v-else>{{ getFieldHeadLabel(field) }}</template>
5459
</div>
@@ -411,6 +416,10 @@ const computedItems = computed(() => {
411416
})
412417
: props.items
413418
419+
if (usesProvider.value && !noProviderPagingBoolean.value) {
420+
return items
421+
}
422+
414423
if (props.perPage !== undefined) {
415424
const startIndex = (props.currentPage - 1) * props.perPage
416425
const endIndex =
@@ -437,7 +446,7 @@ const headerClicked = (field: TableField, event: MouseEvent, isFooter = false) =
437446
const onRowClick = (row: TableItem, index: number, e: MouseEvent) => {
438447
emit('rowClicked', row, index, e)
439448
440-
handleRowSelection(row, index, e.shiftKey, e.ctrlKey)
449+
handleRowSelection(row, index, e.shiftKey, e.ctrlKey, e.metaKey)
441450
}
442451
const onRowDblClick = (row: TableItem, index: number, e: MouseEvent) =>
443452
emit('rowDblClicked', row, index, e)
@@ -472,7 +481,8 @@ const handleRowSelection = (
472481
row: TableItem,
473482
index: number,
474483
shiftClicked = false,
475-
ctrlClicked = false
484+
ctrlClicked = false,
485+
metaClicked = false
476486
) => {
477487
if (!selectableBoolean.value) return
478488
@@ -487,7 +497,7 @@ const handleRowSelection = (
487497
emit('rowSelected', item)
488498
}
489499
})
490-
} else if (ctrlClicked) {
500+
} else if (ctrlClicked || metaClicked) {
491501
if (selectedItems.value.has(row)) {
492502
selectedItems.value.delete(row)
493503
emit('rowUnselected', row)

packages/bootstrap-vue-next/src/components/modal.spec.ts

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,32 @@
11
import {enableAutoUnmount, mount} from '@vue/test-utils'
2-
import {afterEach, describe, expect, it} from 'vitest'
2+
import {afterEach, beforeEach, describe, expect, it} from 'vitest'
33
import BModal from './BModal.vue'
44
// import BTransition from './BTransition/BTransition.vue'
55

66
describe('modal', () => {
77
enableAutoUnmount(afterEach)
8+
9+
beforeEach(() => {
10+
const el = document.createElement('div')
11+
el.id = 'body-teleports'
12+
document.body.appendChild(el)
13+
})
14+
15+
afterEach(() => {
16+
const el = document.getElementById('body-teleports')
17+
if (el) document.body.removeChild(el)
18+
})
19+
20+
it('has body teleports element set by to property', () => {
21+
const wrapper = mount(BModal, {
22+
props: {
23+
teleportTo: '#body-teleports',
24+
},
25+
})
26+
expect(wrapper.exists()).toBe(true)
27+
expect(document.getElementById('body-teleports')?.querySelector('.modal')).not.toBe(null)
28+
})
29+
830
// Having issues getting the 'body' from the VDOM
931
it('has body element', () => {
1032
const wrapper = mount(BModal, {

0 commit comments

Comments
 (0)