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

Commit d39371c

Browse files
committed
2 parents 9a6ae63 + 0ba497a commit d39371c

File tree

8 files changed

+45
-9
lines changed

8 files changed

+45
-9
lines changed

.github/pull_request_template.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ A clear and concise description of what the pull request does.
44

55
## Small replication
66

7-
If the change is large enough, a small replication can help demonstrate the changes made. This is optional, but can help observe the intended changes. A mentioned issue that contains a replication also works.
7+
A small replication or video walkthrough can help demonstrate the changes made. This is optional, but can help observe the intended changes. A mentioned issue that contains a replication also works.
88

99
## PR checklist
1010

.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.25",
2+
"packages/bootstrap-vue-next": "0.9.26",
33
"packages/nuxt": "0.1.3"
44
}

packages/bootstrap-vue-next/CHANGELOG.md

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

33

4+
## [0.9.26](https://github.com/bootstrap-vue-next/bootstrap-vue-next/compare/bootstrap-vue-next-v0.9.25...bootstrap-vue-next-v0.9.26) (2023-07-16)
5+
6+
7+
### Bug Fixes
8+
9+
* **BDropdown:** dropdown not automatically flipping ([9157407](https://github.com/bootstrap-vue-next/bootstrap-vue-next/commit/915740738ea398759dc0031e6cac40b22e3ab4b1))
10+
411
## [0.9.25](https://github.com/bootstrap-vue-next/bootstrap-vue-next/compare/bootstrap-vue-next-v0.9.24...bootstrap-vue-next-v0.9.25) (2023-07-15)
512

613

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": "BootstrapVueNext is an early and lovely component library for Vue 3 & Nuxt 3 based on Bootstrap 5 and Typescript.",
5-
"version": "0.9.25",
5+
"version": "0.9.26",
66
"license": "MIT",
77
"main": "./dist/bootstrap-vue-next.umd.js",
88
"module": "./dist/bootstrap-vue-next.mjs",

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757

5858
<script setup lang="ts">
5959
import {
60+
autoUpdate,
6061
flip,
6162
offset as floatingOffset,
6263
type Middleware,
@@ -238,6 +239,7 @@ const {x, y, strategy, update} = useFloating(referencePlacement, floating, {
238239
placement: floatingPlacement,
239240
middleware: floatingMiddleware,
240241
strategy: props.strategy,
242+
whileElementsMounted: autoUpdate,
241243
})
242244
243245
const computedClasses = computed(() => ({

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
<slot name="table-busy">
7171
<div class="d-flex align-items-center justify-content-center gap-2">
7272
<BSpinner class="align-middle" />
73-
<strong>Loading...</strong>
73+
<strong>{{ busyLoadingText }}</strong>
7474
</div>
7575
</slot>
7676
</td>
@@ -135,6 +135,7 @@ const props = withDefaults(
135135
selectionVariant?: ColorVariant | null
136136
stickyHeader?: Booleanish
137137
busy?: Booleanish
138+
busyLoadingText?: string
138139
showEmpty?: Booleanish
139140
perPage?: number
140141
currentPage?: number
@@ -182,6 +183,7 @@ const props = withDefaults(
182183
selectionVariant: 'primary',
183184
stickyHeader: false,
184185
busy: false,
186+
busyLoadingText: 'Loading...',
185187
showEmpty: false,
186188
currentPage: 1,
187189
emptyText: 'There are no records to show',
@@ -380,7 +382,7 @@ const getRowClasses = (item: TableItem | null, type: string): string | any[] | n
380382
}
381383
382384
const getBusyRowClasses = () => {
383-
const classesArray = [{'b-table-static-busy': props.items.length === 0}]
385+
const classesArray = [{'b-table-static-busy': computedItems.value.length === 0}]
384386
385387
if (props.tbodyTrClass) {
386388
const extraClasses = props.tbodyTrClass(null, 'table-busy')

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@
7070
<slot
7171
v-if="$slots['cell(' + field.key + ')'] || $slots['cell()']"
7272
:name="$slots['cell(' + field.key + ')'] ? 'cell(' + field.key + ')' : 'cell()'"
73-
:value="item[field.key]"
73+
:value="get(item, field.key)"
7474
:index="itemIndex"
7575
:item="item"
7676
:field="field"
@@ -139,7 +139,7 @@
139139
<script setup lang="ts">
140140
import {computed} from 'vue'
141141
import {useBooleanish} from '../../composables'
142-
import {isObject, startCase, titleCase} from '../../utils'
142+
import {get, isObject, startCase, titleCase} from '../../utils'
143143
import type {
144144
Booleanish,
145145
Breakpoint,
@@ -285,7 +285,7 @@ const formatItem = (
285285
fieldKey: string,
286286
formatter?: TableFieldObjectFormatter<typeof item>
287287
) => {
288-
const val = item[fieldKey]
288+
const val = get(item, fieldKey)
289289
if (formatter && typeof formatter === 'function') {
290290
return formatter(val, fieldKey, item)
291291
}
@@ -356,4 +356,3 @@ const getRowClasses = (item: TableItem, type = 'row') => {
356356
return classesArray
357357
}
358358
</script>
359-
../../composables/tableItems

packages/bootstrap-vue-next/src/utils/object.ts

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,29 @@ export const pick = <
2828
memo[prop] = objToPluck[prop]
2929
return memo
3030
}, {} as Record<PropertyKey, unknown>) as Pick<A, B[number]>
31+
32+
/**
33+
* Dynamically get a nested value from an array or
34+
* object with a string.
35+
*
36+
* @example get(person, 'friends[0].name')
37+
* @link https://github.com/rayepps/radash/blob/master/src/object.ts#L214
38+
*/
39+
export const get = <TDefault = unknown>(
40+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
41+
value: any,
42+
path: string,
43+
defaultValue?: TDefault
44+
): TDefault => {
45+
const segments = path.split(/[.[\]]/g)
46+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
47+
let current: any = value
48+
for (const key of segments) {
49+
if (current === null) return defaultValue as TDefault
50+
if (current === undefined) return defaultValue as TDefault
51+
if (key.trim() === '') continue
52+
current = current[key]
53+
}
54+
if (current === undefined) return defaultValue as TDefault
55+
return current
56+
}

0 commit comments

Comments
 (0)