@soft-stech/bootsman-ui-shadcn 1.5.0 → 1.5.1
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/components/ui/table/index.js +314 -314
- package/dist/lib/useResizeColumns.d.ts +13 -0
- package/dist/lib/useResizeColumns.js +70 -63
- package/package.json +1 -1
- package/src/components/stories/BuiDataTable.story.vue +8 -4
- package/src/components/stories/data/tasks.json +26 -13
- package/src/components/ui/table/BuiDataTable.vue +15 -2
- package/src/lib/useResizeColumns.ts +52 -28
@@ -1,4 +1,17 @@
|
|
1
1
|
export declare function useResizeColumns(): {
|
2
|
+
cells: import('vue').Ref<{
|
3
|
+
[key: string]: {
|
4
|
+
cell: HTMLTableCellElement;
|
5
|
+
initialWidth: number;
|
6
|
+
minWidth: number;
|
7
|
+
};
|
8
|
+
} | undefined, {
|
9
|
+
[key: string]: {
|
10
|
+
cell: HTMLTableCellElement;
|
11
|
+
initialWidth: number;
|
12
|
+
minWidth: number;
|
13
|
+
};
|
14
|
+
} | undefined>;
|
2
15
|
tableHeaderElement: import('vue').Ref<({
|
3
16
|
$: import('vue').ComponentInternalInstance;
|
4
17
|
$data: {};
|
@@ -1,89 +1,96 @@
|
|
1
|
-
import { ref as
|
1
|
+
import { ref as o } from "vue";
|
2
2
|
import "vee-validate";
|
3
|
-
import { useEventListener as
|
4
|
-
function
|
5
|
-
const
|
6
|
-
|
7
|
-
const s =
|
8
|
-
e && e[s] && (
|
3
|
+
import { useEventListener as M } from "@vueuse/core";
|
4
|
+
function b() {
|
5
|
+
const r = o(!1), u = o(""), d = o(""), l = o(void 0), h = 90, x = 56, z = 10, v = o(void 0), n = o(null), f = o(void 0), y = (e) => {
|
6
|
+
n.value && n.value.headRef && [...n.value.headRef.querySelectorAll("th")].forEach((i) => {
|
7
|
+
const s = a(i);
|
8
|
+
e && e[s] && (i.style.width = e[s] + "px");
|
9
9
|
});
|
10
|
-
},
|
11
|
-
if (
|
12
|
-
return [...
|
13
|
-
const
|
10
|
+
}, E = () => {
|
11
|
+
if (n.value && n.value.headRef)
|
12
|
+
return [...n.value.headRef.querySelectorAll("th")].reduce((i, s) => {
|
13
|
+
const c = a(s);
|
14
14
|
return {
|
15
|
-
...
|
16
|
-
[
|
15
|
+
...i,
|
16
|
+
[c]: {
|
17
17
|
cell: s,
|
18
|
-
initialWidth: s.offsetWidth
|
18
|
+
initialWidth: s.offsetWidth,
|
19
|
+
minWidth: c === "actions" ? z : Math.min(s.offsetWidth, h)
|
19
20
|
}
|
20
21
|
};
|
21
22
|
}, {});
|
22
|
-
},
|
23
|
-
if (t && (
|
24
|
-
const
|
25
|
-
let s =
|
26
|
-
s || (s =
|
23
|
+
}, I = (e, t) => {
|
24
|
+
if (t && (r.value = !0, u.value = e, l.value)) {
|
25
|
+
const i = l.value[e].cell;
|
26
|
+
let s = i.nextElementSibling;
|
27
|
+
s || (s = i.previousElementSibling), d.value = s ? s.id.split("_")[0] : "", f.value = M(document, "mousemove", R);
|
27
28
|
}
|
28
|
-
},
|
29
|
-
if (
|
29
|
+
}, g = () => {
|
30
|
+
if (r.value && (r.value = !1, u.value = "", d.value = "", f.value && f.value(), l.value)) {
|
30
31
|
const e = {};
|
31
|
-
for (let t in
|
32
|
-
const
|
33
|
-
|
32
|
+
for (let t in l.value) {
|
33
|
+
const i = l.value[t], s = i.cell.hasAttribute("can-resize") ? Math.floor(i.cell.offsetWidth) <= i.minWidth ? i.minWidth : i.cell.offsetWidth : i.initialWidth;
|
34
|
+
i.cell.style.width = s + "px", e[t] = s;
|
34
35
|
}
|
35
|
-
|
36
|
+
v.value = e;
|
36
37
|
}
|
37
|
-
},
|
38
|
-
if (!e.nextElementSibling) {
|
39
|
-
const t = e.querySelector(".header-cell_wrapper");
|
40
|
-
if (t)
|
41
|
-
return parseInt(window.getComputedStyle(t).paddingRight);
|
42
|
-
}
|
43
|
-
return 0;
|
44
|
-
}, c = (e, t, l) => {
|
38
|
+
}, S = (e) => a(e) === "actions" ? x : 0, a = (e) => e.id.split("_")[0], m = (e, t, i) => {
|
45
39
|
if (!e || !t) {
|
46
|
-
|
40
|
+
u.value = "", d.value = "";
|
47
41
|
return;
|
48
42
|
}
|
49
|
-
const s =
|
50
|
-
if (
|
51
|
-
|
52
|
-
|
53
|
-
|
43
|
+
const s = i.movementX, c = s < 0 ? "left" : "right", C = Math.floor(parseInt(e.style.width)) + s, W = Math.floor(parseInt(t.style.width)) - s;
|
44
|
+
if (c === "left") {
|
45
|
+
const p = l.value && l.value[a(e)] ? l.value[a(e)].minWidth : h;
|
46
|
+
if (C <= p || !e.hasAttribute("can-resize")) {
|
47
|
+
const w = e.previousElementSibling;
|
48
|
+
m(w, t, i);
|
49
|
+
} else
|
50
|
+
e.style.width = C + "px", t.style.width = W + "px";
|
51
|
+
} else {
|
52
|
+
const p = l.value && l.value[a(t)] ? l.value[a(t)].minWidth + S(t) : h;
|
53
|
+
if (W <= p || !t.hasAttribute("can-resize")) {
|
54
|
+
const w = t.nextElementSibling;
|
55
|
+
m(e, w, i);
|
54
56
|
} else
|
55
|
-
e.style.width =
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
}, z = (e) => {
|
62
|
-
if (e.preventDefault(), i.value) {
|
63
|
-
const t = i.value[o.value]?.cell, l = i.value[r.value]?.cell;
|
64
|
-
c(t, l, e);
|
57
|
+
e.style.width = C + "px", t.style.width = W + "px";
|
58
|
+
}
|
59
|
+
}, R = (e) => {
|
60
|
+
if (e.preventDefault(), l.value) {
|
61
|
+
const t = l.value[u.value]?.cell, i = l.value[d.value]?.cell;
|
62
|
+
m(t, i, e);
|
65
63
|
}
|
66
64
|
};
|
67
65
|
return {
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
66
|
+
cells: l,
|
67
|
+
tableHeaderElement: n,
|
68
|
+
calculatedColumnSizing: v,
|
69
|
+
isResizing: r,
|
70
|
+
resizingCellId: u,
|
71
|
+
handleResizeControlMouseDown: I,
|
72
|
+
handleResizeControlMouseUp: g,
|
74
73
|
resetCells: () => {
|
75
|
-
if (
|
76
|
-
|
77
|
-
|
74
|
+
if (l.value) {
|
75
|
+
const e = {};
|
76
|
+
for (let t in l.value) {
|
77
|
+
const i = l.value[t].initialWidth;
|
78
|
+
l.value[t].cell.style.width = i + "px", e[t] = i;
|
79
|
+
}
|
80
|
+
v.value = e;
|
81
|
+
}
|
78
82
|
},
|
79
83
|
setInitialColumnWidths: () => {
|
80
|
-
if (
|
81
|
-
|
82
|
-
|
84
|
+
if (l.value = E(), l.value) {
|
85
|
+
const e = {};
|
86
|
+
for (let t in l.value)
|
87
|
+
l.value[t].cell.style.width || (l.value[t].cell.style.width = l.value[t].initialWidth + "px"), e[t] = l.value[t].cell.offsetWidth;
|
88
|
+
v.value = e;
|
89
|
+
}
|
83
90
|
},
|
84
|
-
setProvidedCellWidths:
|
91
|
+
setProvidedCellWidths: y
|
85
92
|
};
|
86
93
|
}
|
87
94
|
export {
|
88
|
-
|
95
|
+
b as useResizeColumns
|
89
96
|
};
|
package/package.json
CHANGED
@@ -31,7 +31,8 @@ const taskSchema = z.object({
|
|
31
31
|
status: z.string().nullable().optional(),
|
32
32
|
label: z.string(),
|
33
33
|
priority: z.string(),
|
34
|
-
errorMessage: z.string().optional()
|
34
|
+
errorMessage: z.string().optional(),
|
35
|
+
age: z.string().optional()
|
35
36
|
})
|
36
37
|
type Task = z.infer<typeof taskSchema>
|
37
38
|
|
@@ -68,8 +69,7 @@ const columns: ColumnDef<Task>[] = [
|
|
68
69
|
},
|
69
70
|
{
|
70
71
|
accessorKey: 'title',
|
71
|
-
header: 'Title'
|
72
|
-
enableResizing: false
|
72
|
+
header: 'Title'
|
73
73
|
},
|
74
74
|
{
|
75
75
|
accessorKey: 'status',
|
@@ -80,6 +80,10 @@ const columns: ColumnDef<Task>[] = [
|
|
80
80
|
accessorKey: 'priority',
|
81
81
|
header: ({ column }) => tableColumnSortCommon(column, 'Priorities')
|
82
82
|
},
|
83
|
+
{
|
84
|
+
accessorKey: 'age',
|
85
|
+
header: ({ column }) => tableColumnSortCommon(column, 'Age')
|
86
|
+
},
|
83
87
|
{ id: 'hiddenColumn', header: 'Hidden Column', cell: 'secret info' }
|
84
88
|
]
|
85
89
|
const data = ref<Task[]>(tasks)
|
@@ -108,7 +112,7 @@ function updateSelection(val: RowSelectionState) {
|
|
108
112
|
}
|
109
113
|
|
110
114
|
const columnVisibility = ref<VisibilityState>({ hiddenColumn: false })
|
111
|
-
const columnSizing = ref<Record<string, number>>({ title:
|
115
|
+
const columnSizing = ref<Record<string, number>>({ title: 450 })
|
112
116
|
const columnOrder = ref<ColumnOrderState>()
|
113
117
|
|
114
118
|
type GroupBy = 'none' | 'status' | 'priority'
|
@@ -4,91 +4,104 @@
|
|
4
4
|
"title": "You can't compress the program without quantifying the open-source SSD pixel!",
|
5
5
|
"status": "in progress",
|
6
6
|
"label": "documentation",
|
7
|
-
"priority": "medium"
|
7
|
+
"priority": "medium",
|
8
|
+
"age": "4 days"
|
8
9
|
},
|
9
10
|
{
|
10
11
|
"id": "TASK-7878",
|
11
12
|
"title": "Try to calculate the EXE feed, maybe it will index the multi-byte pixel!",
|
12
13
|
"status": "backlog",
|
13
14
|
"label": "documentation",
|
14
|
-
"priority": "medium"
|
15
|
+
"priority": "medium",
|
16
|
+
"age": "4 days"
|
15
17
|
},
|
16
18
|
{
|
17
19
|
"id": "TASK-7839",
|
18
20
|
"title": "We need to bypass the neural TCP card!",
|
19
21
|
"status": "todo",
|
20
22
|
"label": "bug",
|
21
|
-
"priority": "high"
|
23
|
+
"priority": "high",
|
24
|
+
"age": "4 days"
|
22
25
|
},
|
23
26
|
{
|
24
27
|
"id": "TASK-5562",
|
25
28
|
"title": "The SAS interface is down, bypass the open-source pixel so we can back up the PNG bandwidth!",
|
26
29
|
"status": "backlog",
|
27
30
|
"label": "feature",
|
28
|
-
"priority": "medium"
|
31
|
+
"priority": "medium",
|
32
|
+
"age": "4 days"
|
29
33
|
},
|
30
34
|
{
|
31
35
|
"id": "TASK-8686",
|
32
36
|
"title": "I'll parse the wireless SSL protocol, that should driver the API panel!",
|
33
37
|
"status": "canceled",
|
34
38
|
"label": "feature",
|
35
|
-
"priority": "medium"
|
39
|
+
"priority": "medium",
|
40
|
+
"age": "4 days"
|
36
41
|
},
|
37
42
|
{
|
38
43
|
"id": "TASK-1280",
|
39
44
|
"title": "Use the digital TLS panel, then you can transmit the haptic system!",
|
40
45
|
"status": "done",
|
41
46
|
"label": "bug",
|
42
|
-
"priority": "high"
|
47
|
+
"priority": "high",
|
48
|
+
"age": "4 days"
|
43
49
|
},
|
44
50
|
{
|
45
51
|
"id": "TASK-7262",
|
46
52
|
"title": "The UTF8 application is down, parse the neural bandwidth so we can back up the PNG firewall!",
|
47
53
|
"status": "done",
|
48
54
|
"label": "feature",
|
49
|
-
"priority": "high"
|
55
|
+
"priority": "high",
|
56
|
+
"age": "4 days"
|
50
57
|
},
|
51
58
|
{
|
52
59
|
"id": "TASK-1138",
|
53
60
|
"title": "Generating the driver won't do anything, we need to quantify the 1080p SMTP bandwidth!",
|
54
61
|
"status": "in progress",
|
55
62
|
"label": "feature",
|
56
|
-
"priority": "medium"
|
63
|
+
"priority": "medium",
|
64
|
+
"age": "4 days"
|
57
65
|
},
|
58
66
|
{
|
59
67
|
"id": "TASK-7184",
|
60
68
|
"title": "We need to program the back-end THX pixel!",
|
61
69
|
"status": "todo",
|
62
70
|
"label": "feature",
|
63
|
-
"priority": "low"
|
71
|
+
"priority": "low",
|
72
|
+
"age": "4 days"
|
64
73
|
},
|
65
74
|
{
|
66
75
|
"id": "TASK-5160",
|
67
76
|
"title": "Calculating the bus won't do anything, we need to navigate the back-end JSON protocol!",
|
68
77
|
"status": "in progress",
|
69
78
|
"label": "documentation",
|
70
|
-
"priority": "high"
|
79
|
+
"priority": "high",
|
80
|
+
"age": "4 days"
|
71
81
|
},
|
72
82
|
{
|
73
83
|
"id": "TASK-5618",
|
74
84
|
"title": "Generating the driver won't do anything, we need to index the online SSL application!",
|
75
85
|
"status": "done",
|
76
86
|
"label": "documentation",
|
77
|
-
"priority": "medium"
|
87
|
+
"priority": "medium",
|
88
|
+
"age": "4 days"
|
78
89
|
},
|
79
90
|
{
|
80
91
|
"id": "TASK-6699",
|
81
92
|
"title": "I'll transmit the wireless JBOD capacitor, that should hard drive the SSD feed!",
|
82
93
|
"status": "backlog",
|
83
94
|
"label": "documentation",
|
84
|
-
"priority": "medium"
|
95
|
+
"priority": "medium",
|
96
|
+
"age": "4 days"
|
85
97
|
},
|
86
98
|
{
|
87
99
|
"id": "TASK-2858",
|
88
100
|
"title": "We need to override the online UDP bus!",
|
89
101
|
"status": "backlog",
|
90
102
|
"label": "bug",
|
91
|
-
"priority": "medium"
|
103
|
+
"priority": "medium",
|
104
|
+
"age": "4 days"
|
92
105
|
},
|
93
106
|
{
|
94
107
|
"id": "TASK-9864",
|
@@ -24,7 +24,16 @@ import {
|
|
24
24
|
getSortedRowModel,
|
25
25
|
useVueTable
|
26
26
|
} from '@tanstack/vue-table'
|
27
|
-
import {
|
27
|
+
import {
|
28
|
+
computed,
|
29
|
+
watchEffect,
|
30
|
+
ref,
|
31
|
+
watch,
|
32
|
+
onMounted,
|
33
|
+
onBeforeMount,
|
34
|
+
onUnmounted,
|
35
|
+
nextTick
|
36
|
+
} from 'vue'
|
28
37
|
import {
|
29
38
|
BuiTable,
|
30
39
|
BuiTableBody,
|
@@ -128,8 +137,12 @@ const table = useVueTable({
|
|
128
137
|
onRowSelectionChange: (updaterOrValue) => {
|
129
138
|
valueUpdater(updaterOrValue, rowSelection)
|
130
139
|
},
|
131
|
-
onColumnVisibilityChange: (updaterOrValue) => {
|
140
|
+
onColumnVisibilityChange: async (updaterOrValue) => {
|
132
141
|
valueUpdater(updaterOrValue, columnVisibility)
|
142
|
+
|
143
|
+
await nextTick()
|
144
|
+
|
145
|
+
setInitialColumnWidths()
|
133
146
|
},
|
134
147
|
onColumnOrderChange: (updaterOrValue) => {
|
135
148
|
valueUpdater(updaterOrValue, columnOrder)
|
@@ -3,16 +3,16 @@ import BuiTableHeader from '@/components/ui/table/BuiTableHeader.vue'
|
|
3
3
|
import { useEventListener } from '@vueuse/core'
|
4
4
|
|
5
5
|
export function useResizeColumns() {
|
6
|
+
type CELL = {
|
7
|
+
[key: string]: { cell: HTMLTableCellElement; initialWidth: number; minWidth: number }
|
8
|
+
}
|
6
9
|
const isResizing = ref<boolean>(false)
|
7
10
|
const resizingCellId = ref<string>('')
|
8
11
|
const neighborCellId = ref<string>('')
|
9
|
-
const cells = ref<
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
| undefined
|
14
|
-
>(undefined)
|
15
|
-
const minCellWidth = ref<number>(90)
|
12
|
+
const cells = ref<CELL | undefined>(undefined)
|
13
|
+
const MIN_CELL_WIDTH = 90
|
14
|
+
const LAST_CELL_EXTRA_SPACE = 56
|
15
|
+
const ACTIONS_CELL_MIN_WIDTH = 10
|
16
16
|
const calculatedColumnSizing = ref<Record<string, number> | undefined>(undefined)
|
17
17
|
const tableHeaderElement = ref<InstanceType<typeof BuiTableHeader> | null>(null)
|
18
18
|
const unregisterMouseMove = ref<Function | undefined>(undefined)
|
@@ -23,7 +23,7 @@ export function useResizeColumns() {
|
|
23
23
|
|
24
24
|
//установить заданные как модель изначальные размеры
|
25
25
|
headerCells.forEach((cell) => {
|
26
|
-
const cellId = cell
|
26
|
+
const cellId = getCellId(cell)
|
27
27
|
|
28
28
|
if (columnSizing && columnSizing[cellId]) {
|
29
29
|
cell.style.width = columnSizing[cellId] + 'px'
|
@@ -35,15 +35,17 @@ export function useResizeColumns() {
|
|
35
35
|
const getCells = () => {
|
36
36
|
if (tableHeaderElement.value && tableHeaderElement.value.headRef) {
|
37
37
|
const headerCells = [...tableHeaderElement.value.headRef.querySelectorAll('th')]
|
38
|
-
const headerCellsWidths: {
|
39
|
-
|
40
|
-
} = headerCells.reduce((acc, cell) => {
|
41
|
-
const cellId = cell.id.split('_')[0]
|
38
|
+
const headerCellsWidths: CELL = headerCells.reduce((acc, cell) => {
|
39
|
+
const cellId = getCellId(cell)
|
42
40
|
return {
|
43
41
|
...acc,
|
44
42
|
[cellId]: {
|
45
43
|
cell: cell,
|
46
|
-
initialWidth: cell.offsetWidth
|
44
|
+
initialWidth: cell.offsetWidth,
|
45
|
+
minWidth:
|
46
|
+
cellId === 'actions'
|
47
|
+
? ACTIONS_CELL_MIN_WIDTH
|
48
|
+
: Math.min(cell.offsetWidth, MIN_CELL_WIDTH)
|
47
49
|
}
|
48
50
|
}
|
49
51
|
}, {})
|
@@ -92,8 +94,8 @@ export function useResizeColumns() {
|
|
92
94
|
const currentCell = cells.value[cell]
|
93
95
|
const newWidth = !currentCell.cell.hasAttribute('can-resize')
|
94
96
|
? currentCell.initialWidth
|
95
|
-
: Math.floor(currentCell.cell.offsetWidth) <=
|
96
|
-
?
|
97
|
+
: Math.floor(currentCell.cell.offsetWidth) <= currentCell.minWidth
|
98
|
+
? currentCell.minWidth
|
97
99
|
: currentCell.cell.offsetWidth
|
98
100
|
|
99
101
|
currentCell.cell.style.width = newWidth + 'px'
|
@@ -103,18 +105,19 @@ export function useResizeColumns() {
|
|
103
105
|
calculatedColumnSizing.value = updatedColumnSizingValue
|
104
106
|
}
|
105
107
|
}
|
106
|
-
const getLastCellOnTheRightExtraSpace = (cell: HTMLTableCellElement) => {
|
107
|
-
if (!cell.nextElementSibling) {
|
108
|
-
const cellWrapperElement = cell.querySelector('.header-cell_wrapper') as HTMLElement | null
|
109
108
|
|
110
|
-
|
111
|
-
|
112
|
-
|
109
|
+
const getLastCellOnTheRightExtraSpace = (cell: HTMLTableCellElement) => {
|
110
|
+
if (getCellId(cell) === 'actions') {
|
111
|
+
return LAST_CELL_EXTRA_SPACE
|
113
112
|
}
|
114
113
|
|
115
114
|
return 0
|
116
115
|
}
|
117
116
|
|
117
|
+
const getCellId = (cell: HTMLTableCellElement) => {
|
118
|
+
return cell.id.split('_')[0]
|
119
|
+
}
|
120
|
+
|
118
121
|
const resizeCells = (
|
119
122
|
cell: HTMLTableCellElement | null,
|
120
123
|
neighborCell: HTMLTableCellElement | null,
|
@@ -133,7 +136,12 @@ export function useResizeColumns() {
|
|
133
136
|
const newNeighborCellWidth = Math.floor(parseInt(neighborCell.style.width)) - movementX
|
134
137
|
|
135
138
|
if (direction === 'left') {
|
136
|
-
|
139
|
+
const min =
|
140
|
+
cells.value && cells.value[getCellId(cell)]
|
141
|
+
? cells.value[getCellId(cell)].minWidth
|
142
|
+
: MIN_CELL_WIDTH
|
143
|
+
|
144
|
+
if (newCellWidth <= min || !cell.hasAttribute('can-resize')) {
|
137
145
|
const nextCell = cell.previousElementSibling as HTMLTableCellElement | null
|
138
146
|
|
139
147
|
resizeCells(nextCell, neighborCell, e)
|
@@ -142,11 +150,13 @@ export function useResizeColumns() {
|
|
142
150
|
neighborCell.style.width = newNeighborCellWidth + 'px'
|
143
151
|
}
|
144
152
|
} else {
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
153
|
+
const min =
|
154
|
+
cells.value && cells.value[getCellId(neighborCell)]
|
155
|
+
? cells.value[getCellId(neighborCell)].minWidth +
|
156
|
+
getLastCellOnTheRightExtraSpace(neighborCell)
|
157
|
+
: MIN_CELL_WIDTH
|
158
|
+
|
159
|
+
if (newNeighborCellWidth <= min || !neighborCell.hasAttribute('can-resize')) {
|
150
160
|
const nextNeighborCell = neighborCell.nextElementSibling as HTMLTableCellElement | null
|
151
161
|
|
152
162
|
resizeCells(cell, nextNeighborCell, e)
|
@@ -170,9 +180,16 @@ export function useResizeColumns() {
|
|
170
180
|
|
171
181
|
const resetCells = () => {
|
172
182
|
if (cells.value) {
|
183
|
+
const updatedColumnSizingValue: Record<string, number> = {}
|
184
|
+
|
173
185
|
for (let cell in cells.value) {
|
174
|
-
|
186
|
+
const inititalWidth = cells.value[cell].initialWidth
|
187
|
+
|
188
|
+
cells.value[cell].cell.style.width = inititalWidth + 'px'
|
189
|
+
updatedColumnSizingValue[cell] = inititalWidth
|
175
190
|
}
|
191
|
+
|
192
|
+
calculatedColumnSizing.value = updatedColumnSizingValue
|
176
193
|
}
|
177
194
|
}
|
178
195
|
|
@@ -180,15 +197,22 @@ export function useResizeColumns() {
|
|
180
197
|
cells.value = getCells()
|
181
198
|
|
182
199
|
if (cells.value) {
|
200
|
+
const updatedColumnSizingValue: Record<string, number> = {}
|
201
|
+
|
183
202
|
for (let cell in cells.value) {
|
184
203
|
if (!cells.value[cell].cell.style.width) {
|
185
204
|
cells.value[cell].cell.style.width = cells.value[cell].initialWidth + 'px'
|
186
205
|
}
|
206
|
+
|
207
|
+
updatedColumnSizingValue[cell] = cells.value[cell].cell.offsetWidth
|
187
208
|
}
|
209
|
+
|
210
|
+
calculatedColumnSizing.value = updatedColumnSizingValue
|
188
211
|
}
|
189
212
|
}
|
190
213
|
|
191
214
|
return {
|
215
|
+
cells,
|
192
216
|
tableHeaderElement,
|
193
217
|
calculatedColumnSizing,
|
194
218
|
isResizing,
|