@innertia-solutions/nuxt-theme-spark 0.1.19 → 0.1.21
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/Admin/Page.vue +2 -0
- package/components/Table.vue +42 -2
- package/package.json +2 -2
package/components/Table.vue
CHANGED
|
@@ -48,6 +48,8 @@ const sorting = ref([])
|
|
|
48
48
|
const columnFilters = ref([])
|
|
49
49
|
const columnVisibility = ref({})
|
|
50
50
|
const columnOrder = ref([])
|
|
51
|
+
const columnSizing = ref({})
|
|
52
|
+
const columnSizingInfo = ref({})
|
|
51
53
|
const rowSelection = ref({})
|
|
52
54
|
const isCustomPerPage = ref(false)
|
|
53
55
|
|
|
@@ -64,7 +66,10 @@ const buildColumnDefs = () => {
|
|
|
64
66
|
header: 'select',
|
|
65
67
|
enableSorting: false,
|
|
66
68
|
enableColumnFilter: false,
|
|
69
|
+
enableResizing: false,
|
|
67
70
|
size: 48,
|
|
71
|
+
minSize: 48,
|
|
72
|
+
maxSize: 48,
|
|
68
73
|
})
|
|
69
74
|
}
|
|
70
75
|
for (const col of props.columns) {
|
|
@@ -74,6 +79,10 @@ const buildColumnDefs = () => {
|
|
|
74
79
|
header: col.label,
|
|
75
80
|
enableSorting: col.sortable ?? false,
|
|
76
81
|
enableColumnFilter: col.filterable ?? false,
|
|
82
|
+
enableResizing: col.resizable !== false,
|
|
83
|
+
size: col.size ?? 200,
|
|
84
|
+
minSize: 60,
|
|
85
|
+
maxSize: 800,
|
|
77
86
|
meta: { class: col.class ?? '', label: col.label },
|
|
78
87
|
})
|
|
79
88
|
}
|
|
@@ -95,6 +104,8 @@ const table = useVueTable({
|
|
|
95
104
|
get columnFilters() { return columnFilters.value },
|
|
96
105
|
get columnVisibility() { return columnVisibility.value },
|
|
97
106
|
get columnOrder() { return columnOrder.value },
|
|
107
|
+
get columnSizing() { return columnSizing.value },
|
|
108
|
+
get columnSizingInfo() { return columnSizingInfo.value },
|
|
98
109
|
get rowSelection() { return rowSelection.value },
|
|
99
110
|
},
|
|
100
111
|
onPaginationChange: makeUpdater(pagination),
|
|
@@ -102,8 +113,12 @@ const table = useVueTable({
|
|
|
102
113
|
onColumnFiltersChange: makeUpdater(columnFilters),
|
|
103
114
|
onColumnVisibilityChange: makeUpdater(columnVisibility),
|
|
104
115
|
onColumnOrderChange: makeUpdater(columnOrder),
|
|
116
|
+
onColumnSizingChange: makeUpdater(columnSizing),
|
|
117
|
+
onColumnSizingInfoChange: makeUpdater(columnSizingInfo),
|
|
105
118
|
onRowSelectionChange: makeUpdater(rowSelection),
|
|
106
119
|
getCoreRowModel: getCoreRowModel(),
|
|
120
|
+
columnResizeMode: 'onChange',
|
|
121
|
+
enableColumnResizing: true,
|
|
107
122
|
manualPagination: true,
|
|
108
123
|
manualSorting: true,
|
|
109
124
|
manualFiltering: true,
|
|
@@ -483,7 +498,17 @@ defineExpose({
|
|
|
483
498
|
|
|
484
499
|
<!-- Table view -->
|
|
485
500
|
<div v-if="!isGridView" class="overflow-x-auto relative">
|
|
486
|
-
<table
|
|
501
|
+
<table
|
|
502
|
+
class="relative divide-y divide-gray-200 dark:divide-slate-700"
|
|
503
|
+
:style="{ tableLayout: 'fixed', width: table.getTotalSize() + 'px', minWidth: '100%' }"
|
|
504
|
+
>
|
|
505
|
+
<colgroup>
|
|
506
|
+
<col
|
|
507
|
+
v-for="col in table.getVisibleLeafColumns()"
|
|
508
|
+
:key="col.id"
|
|
509
|
+
:style="{ width: col.getSize() + 'px' }"
|
|
510
|
+
>
|
|
511
|
+
</colgroup>
|
|
487
512
|
<thead class="relative z-20 bg-white dark:bg-slate-800">
|
|
488
513
|
<template v-for="headerGroup in table.getHeaderGroups()" :key="headerGroup.id">
|
|
489
514
|
<!-- Main header row -->
|
|
@@ -500,8 +525,9 @@ defineExpose({
|
|
|
500
525
|
@dragover="header.id !== 'select' && onHeaderDragOver($event, header.id)"
|
|
501
526
|
@dragleave="onHeaderDragLeave"
|
|
502
527
|
@drop="header.id !== 'select' && onHeaderDrop(header.id)"
|
|
528
|
+
class="relative overflow-hidden"
|
|
503
529
|
:class="[
|
|
504
|
-
header.id === 'select' ? 'text-center
|
|
530
|
+
header.id === 'select' ? 'text-center' : '',
|
|
505
531
|
dragOverHeaderId === header.id ? 'bg-indigo-50 dark:bg-indigo-900/20' : '',
|
|
506
532
|
header.column.getCanSort() ? 'cursor-pointer select-none' : '',
|
|
507
533
|
]"
|
|
@@ -527,6 +553,20 @@ defineExpose({
|
|
|
527
553
|
<IconSortAscendingSmallBig v-else class="size-5" />
|
|
528
554
|
</span>
|
|
529
555
|
</div>
|
|
556
|
+
<!-- Resize handle -->
|
|
557
|
+
<div
|
|
558
|
+
v-if="header.column.getCanResize()"
|
|
559
|
+
class="absolute right-0 top-0 h-full w-3 cursor-col-resize group/rz flex items-center justify-center select-none touch-none"
|
|
560
|
+
@mousedown.stop="header.getResizeHandler()?.($event)"
|
|
561
|
+
@touchstart.passive.stop="header.getResizeHandler()?.($event)"
|
|
562
|
+
>
|
|
563
|
+
<div
|
|
564
|
+
class="h-4 w-px transition-all"
|
|
565
|
+
:class="header.column.getIsResizing()
|
|
566
|
+
? 'bg-indigo-400 dark:bg-indigo-500 !w-0.5'
|
|
567
|
+
: 'bg-slate-200 dark:bg-slate-600 group-hover/rz:bg-indigo-300 dark:group-hover/rz:bg-indigo-600 group-hover/rz:w-0.5'"
|
|
568
|
+
/>
|
|
569
|
+
</div>
|
|
530
570
|
</template>
|
|
531
571
|
</th>
|
|
532
572
|
</tr>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@innertia-solutions/nuxt-theme-spark",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.21",
|
|
4
4
|
"description": "Innertia Solutions — Spark theme: backoffice, landing and mobile components and layouts",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"nuxt",
|
|
@@ -43,4 +43,4 @@
|
|
|
43
43
|
"nuxt": "^4.4.2",
|
|
44
44
|
"vue": "^3.5.0"
|
|
45
45
|
}
|
|
46
|
-
}
|
|
46
|
+
}
|