@soft-stech/bootsman-ui-shadcn 2.0.16 → 2.0.18
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/{BuiTableHeader.vue_vue_type_script_setup_true_lang-Di2FKUwD.js → BuiTableHeader.vue_vue_type_script_setup_true_lang-BwsxaQdP.js} +5 -4
- package/dist/components/table/BuiTableHeader.js +1 -1
- package/dist/components/table/index.js +355 -354
- package/dist/index.js +1 -1
- package/dist/lib/useResizeColumns.d.ts +1 -1
- package/dist/lib/useResizeColumns.js +42 -43
- package/dist/style.css +1 -1
- package/dist/theme.css +3 -3
- package/package.json +1 -1
- package/src/components/table/BuiDataTable.vue +9 -4
- package/src/components/table/BuiTableHeader.vue +2 -1
- package/src/lib/useResizeColumns.ts +1 -9
- package/src/stories/components/BuiDataTableStory.vue +3 -2
- package/src/theme.css +3 -3
|
@@ -393,6 +393,12 @@ const handleHeaderCellSorting = (header: Header<TData, unknown>) => {
|
|
|
393
393
|
header.column.toggleSorting(header.column.getIsSorted() === 'asc')
|
|
394
394
|
}
|
|
395
395
|
}
|
|
396
|
+
|
|
397
|
+
const handleHeaderCellMouseDown = (e: Event) => {
|
|
398
|
+
const targetHTMLElement = e.target as HTMLElement
|
|
399
|
+
isMouseDownOnHandler.value =
|
|
400
|
+
targetHTMLElement.className.includes && targetHTMLElement.className.includes('resize-handler')
|
|
401
|
+
}
|
|
396
402
|
</script>
|
|
397
403
|
|
|
398
404
|
<template>
|
|
@@ -450,7 +456,7 @@ const handleHeaderCellSorting = (header: Header<TData, unknown>) => {
|
|
|
450
456
|
</BuiPopover>
|
|
451
457
|
</template>
|
|
452
458
|
<BuiTableHeader v-if="tableHeaders" :freeze-header="props.freezeHeader" ref="tableHeaderRef">
|
|
453
|
-
<BuiTableRow class="
|
|
459
|
+
<BuiTableRow class="border-0">
|
|
454
460
|
<BuiTableHead
|
|
455
461
|
v-for="(header, index) in tableHeaders"
|
|
456
462
|
:key="header.id"
|
|
@@ -462,6 +468,7 @@ const handleHeaderCellSorting = (header: Header<TData, unknown>) => {
|
|
|
462
468
|
:freeze-header="props.freezeHeader"
|
|
463
469
|
:can-resize="header.column.getCanResize() ? true : undefined"
|
|
464
470
|
@click="handleHeaderCellSorting(header)"
|
|
471
|
+
@mousedown="handleHeaderCellMouseDown"
|
|
465
472
|
>
|
|
466
473
|
<FlexRender
|
|
467
474
|
v-if="!header.isPlaceholder"
|
|
@@ -475,9 +482,7 @@ const handleHeaderCellSorting = (header: Header<TData, unknown>) => {
|
|
|
475
482
|
header.column.getCanResize()
|
|
476
483
|
"
|
|
477
484
|
@dblclick="resetCells"
|
|
478
|
-
@mousedown.self="
|
|
479
|
-
(e: Event) => handleResizeControlMouseDown(e, header.id, props.enableColumnResizing)
|
|
480
|
-
"
|
|
485
|
+
@mousedown.self="handleResizeControlMouseDown(header.id, props.enableColumnResizing)"
|
|
481
486
|
@click.stop
|
|
482
487
|
:className="
|
|
483
488
|
cn(
|
|
@@ -20,7 +20,8 @@ const props = defineProps<{
|
|
|
20
20
|
props.class,
|
|
21
21
|
props.freezeHeader
|
|
22
22
|
? 'sticky top-0 z-1 [&_th:first-child>div>div]:pl-3 [&_th:last-child>div>div]:border-r-0 [&_th:last-child>div>div]:pr-14 [&_tr:last-child]:border-b-0'
|
|
23
|
-
: '[&_th:first-child>div]:pl-3 [&_th:last-child>div]:border-0 [&_th:last-child>div]:pr-14'
|
|
23
|
+
: '[&_th:first-child>div]:pl-3 [&_th:last-child>div]:border-0 [&_th:last-child>div]:pr-14',
|
|
24
|
+
'[&>tr]:h-10'
|
|
24
25
|
)
|
|
25
26
|
"
|
|
26
27
|
>
|
|
@@ -59,15 +59,7 @@ export function useResizeColumns() {
|
|
|
59
59
|
const isMouseDownOnHandler = ref<boolean>(false)
|
|
60
60
|
const isMouseUpOnHandler = ref<boolean>(false)
|
|
61
61
|
|
|
62
|
-
const handleResizeControlMouseDown = (
|
|
63
|
-
e: Event,
|
|
64
|
-
cellId: string,
|
|
65
|
-
enableColumnResizing: boolean
|
|
66
|
-
) => {
|
|
67
|
-
const targetHTMLElement = e.target as HTMLElement
|
|
68
|
-
isMouseDownOnHandler.value =
|
|
69
|
-
targetHTMLElement.className.includes && targetHTMLElement.className.includes('resize-handler')
|
|
70
|
-
|
|
62
|
+
const handleResizeControlMouseDown = (cellId: string, enableColumnResizing: boolean) => {
|
|
71
63
|
if (!enableColumnResizing) return
|
|
72
64
|
|
|
73
65
|
isResizing.value = true
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
SignalMediumIcon,
|
|
19
19
|
SignalLowIcon
|
|
20
20
|
} from 'lucide-vue-next'
|
|
21
|
-
import { computed, h, ref } from 'vue'
|
|
21
|
+
import { computed, h, ref, withModifiers } from 'vue'
|
|
22
22
|
import { z } from 'zod'
|
|
23
23
|
import tasks from '@/stories/data/tasks.json'
|
|
24
24
|
import { BuiCheckbox } from '@/components/checkbox'
|
|
@@ -51,7 +51,8 @@ const columns: ColumnDef<Task>[] = [
|
|
|
51
51
|
table.getIsSomePageRowsSelected()
|
|
52
52
|
? table.toggleAllPageRowsSelected(false)
|
|
53
53
|
: table.toggleAllPageRowsSelected(!!value),
|
|
54
|
-
ariaLabel: 'Select row'
|
|
54
|
+
ariaLabel: 'Select row',
|
|
55
|
+
onClick: withModifiers(() => {}, ['stop'])
|
|
55
56
|
}),
|
|
56
57
|
tableColumnSortCommon(column, 'ID')
|
|
57
58
|
])
|
package/src/theme.css
CHANGED
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
--radius-md: calc(var(--radius) - 2px);
|
|
43
43
|
--radius-sm: calc(var(--radius) - 4px);
|
|
44
44
|
|
|
45
|
-
--shadow-card: 0px 4px 8px 0px var(--
|
|
45
|
+
--shadow-card: 0px 4px 8px 0px var(--cards-box-shadow);
|
|
46
46
|
--shadow-tab: 0px 2px 4px 0px var(--tab-shadow), 0px 4px 4px 0px var(--tab-shadow);
|
|
47
47
|
--shadow-top: 0px -2px 4px 0px var(--tab-shadow);
|
|
48
48
|
--shadow-level1:
|
|
@@ -150,7 +150,7 @@
|
|
|
150
150
|
|
|
151
151
|
--card: hsl(0 0% 100%);
|
|
152
152
|
--card-foreground: hsl(222.2 84% 4.9%);
|
|
153
|
-
--
|
|
153
|
+
--cards-box-shadow: hsl(241, 92%, 71%, 0.16);
|
|
154
154
|
--tab-shadow: hsl(228, 51%, 11%, 0.08);
|
|
155
155
|
|
|
156
156
|
--side-bar: hsl(0 0% 100%);
|
|
@@ -214,7 +214,7 @@
|
|
|
214
214
|
|
|
215
215
|
--card: hsl(242 24% 21%);
|
|
216
216
|
--card-foreground: hsl(210 40% 98%);
|
|
217
|
-
--
|
|
217
|
+
--cards-box-shadow: hsl(241, 92%, 71%, 0.4);
|
|
218
218
|
--tab-shadow: hsl(228, 51%, 11%, 0.08);
|
|
219
219
|
|
|
220
220
|
--side-bar: hsl(243.2 24.1% 15.5%);
|