cynx-lib 1.3.63 → 1.3.64
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/package.json +1 -1
- package/vue/components/Table.vue +32 -5
package/package.json
CHANGED
package/vue/components/Table.vue
CHANGED
|
@@ -62,8 +62,15 @@ const emit = defineEmits<{
|
|
|
62
62
|
}>();
|
|
63
63
|
|
|
64
64
|
const rootRef = ref<HTMLElement | null>(null);
|
|
65
|
+
const headerScrollRef = ref<HTMLElement | null>(null);
|
|
65
66
|
const bodyScrollRef = ref<HTMLElement | null>(null);
|
|
66
67
|
|
|
68
|
+
const handleBodyScroll = () => {
|
|
69
|
+
if (headerScrollRef.value && bodyScrollRef.value) {
|
|
70
|
+
headerScrollRef.value.scrollLeft = bodyScrollRef.value.scrollLeft;
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
|
|
67
74
|
const { rows: autoRows } = useAutoSkeletonRows(rootRef, {
|
|
68
75
|
rowHeight: props.rowHeight,
|
|
69
76
|
bottomBuffer: 50,
|
|
@@ -126,23 +133,23 @@ const getSkeletonWidth = (rIdx: number, cIdx: number, key: string) => {
|
|
|
126
133
|
]"
|
|
127
134
|
:style="height ? { height: formatWidth(height) } : undefined"
|
|
128
135
|
>
|
|
129
|
-
<!--
|
|
136
|
+
<!-- Dedicated Fixed Header Container (Never moves on row scroll) -->
|
|
130
137
|
<div
|
|
131
|
-
ref="
|
|
132
|
-
class="w-full overflow-
|
|
138
|
+
ref="headerScrollRef"
|
|
139
|
+
class="w-full overflow-hidden flex-shrink-0 border-b border-slate-200 dark:border-slate-800 bg-[#f8fafc] dark:bg-[#16192e]"
|
|
133
140
|
>
|
|
134
141
|
<table class="w-full border-collapse text-left text-xs table-fixed">
|
|
135
142
|
<colgroup>
|
|
136
143
|
<col
|
|
137
144
|
v-for="col in columns"
|
|
138
|
-
:key="`col-${col.key}`"
|
|
145
|
+
:key="`h-col-${col.key}`"
|
|
139
146
|
:style="{
|
|
140
147
|
width: formatWidth(col.width),
|
|
141
148
|
minWidth: formatWidth(col.minWidth || col.width || 100),
|
|
142
149
|
}"
|
|
143
150
|
/>
|
|
144
151
|
</colgroup>
|
|
145
|
-
<thead
|
|
152
|
+
<thead>
|
|
146
153
|
<tr>
|
|
147
154
|
<th
|
|
148
155
|
v-for="col in columns"
|
|
@@ -193,6 +200,26 @@ const getSkeletonWidth = (rIdx: number, cIdx: number, key: string) => {
|
|
|
193
200
|
</th>
|
|
194
201
|
</tr>
|
|
195
202
|
</thead>
|
|
203
|
+
</table>
|
|
204
|
+
</div>
|
|
205
|
+
|
|
206
|
+
<!-- Dedicated Scrollable Body Container -->
|
|
207
|
+
<div
|
|
208
|
+
ref="bodyScrollRef"
|
|
209
|
+
class="w-full overflow-x-auto overflow-y-auto custom-scrollbar flex-1 relative"
|
|
210
|
+
@scroll="handleBodyScroll"
|
|
211
|
+
>
|
|
212
|
+
<table class="w-full border-collapse text-left text-xs table-fixed">
|
|
213
|
+
<colgroup>
|
|
214
|
+
<col
|
|
215
|
+
v-for="col in columns"
|
|
216
|
+
:key="`b-col-${col.key}`"
|
|
217
|
+
:style="{
|
|
218
|
+
width: formatWidth(col.width),
|
|
219
|
+
minWidth: formatWidth(col.minWidth || col.width || 100),
|
|
220
|
+
}"
|
|
221
|
+
/>
|
|
222
|
+
</colgroup>
|
|
196
223
|
<tbody class="divide-y divide-slate-100 dark:divide-slate-800/80">
|
|
197
224
|
<!-- Loading State (Real matching heights and paddings) -->
|
|
198
225
|
<template v-if="loading">
|