@innertia-solutions/nuxt-theme-spark 0.1.45 → 0.1.47
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/components/Table.vue +20 -3
- package/package.json +1 -1
package/components/Table.vue
CHANGED
|
@@ -34,10 +34,13 @@ const tableData = ref([])
|
|
|
34
34
|
const rowCount = ref(0)
|
|
35
35
|
const loading = ref(false)
|
|
36
36
|
const isDataFromCache = ref(false)
|
|
37
|
-
const lastDataLength = ref(
|
|
37
|
+
const lastDataLength = ref(-1)
|
|
38
38
|
const lastRowHeight = ref(48)
|
|
39
39
|
const tableBodyRef = ref(null)
|
|
40
|
-
const skeletonRows = computed(() =>
|
|
40
|
+
const skeletonRows = computed(() => {
|
|
41
|
+
const count = lastDataLength.value < 0 ? pagination.value.pageSize : lastDataLength.value
|
|
42
|
+
return Array.from({ length: count })
|
|
43
|
+
})
|
|
41
44
|
const isGridView = computed(() => props.viewMode === 'grid')
|
|
42
45
|
|
|
43
46
|
// ─── TanStack state ───────────────────────────────────────────────────────────
|
|
@@ -535,7 +538,7 @@ defineExpose({
|
|
|
535
538
|
</thead>
|
|
536
539
|
|
|
537
540
|
<tbody ref="tableBodyRef" class="divide-y divide-gray-200 dark:divide-slate-700">
|
|
538
|
-
<!-- Loading skeleton -->
|
|
541
|
+
<!-- Loading skeleton rows -->
|
|
539
542
|
<tr
|
|
540
543
|
v-if="loading"
|
|
541
544
|
v-for="(_, i) in skeletonRows"
|
|
@@ -553,6 +556,20 @@ defineExpose({
|
|
|
553
556
|
</td>
|
|
554
557
|
</tr>
|
|
555
558
|
|
|
559
|
+
<!-- Loading filler rows: pad to pageSize so table height doesn't change -->
|
|
560
|
+
<tr
|
|
561
|
+
v-if="loading && skeletonRows.length < pagination.pageSize"
|
|
562
|
+
v-for="i in (pagination.pageSize - skeletonRows.length)"
|
|
563
|
+
:key="'lf-' + i"
|
|
564
|
+
class="divide-x divide-gray-200 dark:divide-slate-700 bg-white dark:bg-slate-800"
|
|
565
|
+
>
|
|
566
|
+
<td
|
|
567
|
+
v-for="header in (table.getHeaderGroups()[0]?.headers ?? [])"
|
|
568
|
+
:key="'lfc-' + header.id"
|
|
569
|
+
:style="{ height: lastRowHeight + 'px' }"
|
|
570
|
+
/>
|
|
571
|
+
</tr>
|
|
572
|
+
|
|
556
573
|
<!-- Empty skeleton -->
|
|
557
574
|
<tr
|
|
558
575
|
v-if="!loading && tableData.length === 0"
|