@soft-stech/bootsman-ui-shadcn 1.2.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{BuiDataTable.vue_vue_type_script_setup_true_lang-B9r03KU3.js → BuiDataTable.vue_vue_type_script_setup_true_lang-CBCScilf.js} +85 -77
- package/dist/assets/main.css +1 -1
- package/dist/components/ui/progress/BuiProgress.vue.d.ts +5 -1
- package/dist/components/ui/progress/index.d.ts +4 -0
- package/dist/components/ui/progress/index.js +46 -30
- package/dist/components/ui/table/BuiDataTable.js +1 -1
- package/dist/components/ui/table/BuiDataTable.vue.d.ts +1 -0
- package/dist/components/ui/table/index.js +1 -1
- package/dist/index.js +166 -165
- package/package.json +1 -1
- package/src/components/stories/BuiDataTable.story.vue +10 -0
- package/src/components/stories/BuiProgress.story.vue +3 -3
- package/src/components/ui/progress/BuiProgress.vue +7 -11
- package/src/components/ui/progress/index.ts +26 -4
- package/src/components/ui/table/BuiDataTable.vue +12 -2
@@ -21,7 +21,7 @@ import {
|
|
21
21
|
getSortedRowModel,
|
22
22
|
useVueTable
|
23
23
|
} from '@tanstack/vue-table'
|
24
|
-
import { computed } from 'vue'
|
24
|
+
import { computed, watchEffect } from 'vue'
|
25
25
|
import {
|
26
26
|
BuiTable,
|
27
27
|
BuiTableBody,
|
@@ -79,6 +79,7 @@ const table = useVueTable({
|
|
79
79
|
onRowSelectionChange: (updaterOrValue) => {
|
80
80
|
valueUpdater(updaterOrValue, rowSelection)
|
81
81
|
},
|
82
|
+
autoResetPageIndex: false,
|
82
83
|
manualPagination: props.manualPagination, // set to false to enable client-side pagination
|
83
84
|
manualSorting: props.manualSorting,
|
84
85
|
state: {
|
@@ -117,6 +118,13 @@ const pageIndex = computed({
|
|
117
118
|
}
|
118
119
|
})
|
119
120
|
|
121
|
+
watchEffect(() => {
|
122
|
+
const totalPages = table.getPageCount()
|
123
|
+
if (totalPages && totalPages < pageIndex.value) {
|
124
|
+
pageIndex.value = totalPages
|
125
|
+
}
|
126
|
+
})
|
127
|
+
|
120
128
|
const groupedRows = computed<{ [key: string]: Row<TData>[] }>(() => {
|
121
129
|
if (!props.groupBy) return null
|
122
130
|
|
@@ -188,7 +196,9 @@ function getGroupLabel(index: number) {
|
|
188
196
|
</template>
|
189
197
|
</template>
|
190
198
|
<template v-else>
|
191
|
-
<BuiTableEmpty :colspan="columns.length">
|
199
|
+
<BuiTableEmpty :colspan="columns.length">
|
200
|
+
<slot name="nodata">No data</slot>
|
201
|
+
</BuiTableEmpty>
|
192
202
|
</template>
|
193
203
|
</BuiTableBody>
|
194
204
|
<BuiTableFooter v-if="showPagination && table.getPageCount() > 1">
|