@innertia-solutions/nuxt-theme-spark 0.1.29 → 0.1.31
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/Standard.vue +16 -1
- package/components/Table.vue +13 -12
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { IconSearch, IconAdjustmentsHorizontal } from '@tabler/icons-vue'
|
|
2
|
+
import { IconSearch, IconAdjustmentsHorizontal, IconLayoutColumns } from '@tabler/icons-vue'
|
|
3
3
|
|
|
4
4
|
// Standard admin table: search + filters + Table (TanStack) + export
|
|
5
5
|
const props = defineProps({
|
|
@@ -85,6 +85,21 @@ defineExpose({ getSelectedRows, reload, clearCache, exportTable, tableRef })
|
|
|
85
85
|
|
|
86
86
|
<slot name="actions" />
|
|
87
87
|
|
|
88
|
+
<!-- Column visibility -->
|
|
89
|
+
<button
|
|
90
|
+
type="button"
|
|
91
|
+
@click="tableRef?.toggleColumnPanel()"
|
|
92
|
+
:class="[
|
|
93
|
+
'py-1.5 px-3 inline-flex items-center gap-2 text-sm font-medium rounded-lg border transition-colors',
|
|
94
|
+
tableRef?.showColumnPanel
|
|
95
|
+
? 'border-indigo-500 bg-indigo-50 text-indigo-700 dark:bg-indigo-900/20 dark:border-indigo-500 dark:text-indigo-300'
|
|
96
|
+
: 'border-slate-200 dark:border-slate-700 bg-white dark:bg-slate-800 text-slate-600 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-700'
|
|
97
|
+
]"
|
|
98
|
+
>
|
|
99
|
+
<IconLayoutColumns class="size-4" />
|
|
100
|
+
Columnas
|
|
101
|
+
</button>
|
|
102
|
+
|
|
88
103
|
<!-- Export -->
|
|
89
104
|
<TableExportable
|
|
90
105
|
v-if="showExport"
|
package/components/Table.vue
CHANGED
|
@@ -440,13 +440,23 @@ const handleRowKeydown = (row, e) => {
|
|
|
440
440
|
}
|
|
441
441
|
|
|
442
442
|
// ─── Expose ───────────────────────────────────────────────────────────────────
|
|
443
|
+
const reloadTable = () => {
|
|
444
|
+
clearCache()
|
|
445
|
+
isDataFromCache.value = false
|
|
446
|
+
fetchData()
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
const toggleColumnPanel = () => { showColumnPanel.value = !showColumnPanel.value }
|
|
450
|
+
|
|
443
451
|
defineExpose({
|
|
444
452
|
getSelectedRows,
|
|
445
453
|
loading,
|
|
446
454
|
exportTable,
|
|
447
|
-
reload:
|
|
455
|
+
reload: reloadTable,
|
|
448
456
|
clearCache,
|
|
449
457
|
table,
|
|
458
|
+
showColumnPanel,
|
|
459
|
+
toggleColumnPanel,
|
|
450
460
|
})
|
|
451
461
|
</script>
|
|
452
462
|
|
|
@@ -465,7 +475,7 @@ defineExpose({
|
|
|
465
475
|
<div
|
|
466
476
|
v-if="showColumnPanel"
|
|
467
477
|
ref="columnPanelRef"
|
|
468
|
-
class="absolute
|
|
478
|
+
class="absolute top-0 right-0 z-50 bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-700 rounded-xl shadow-2xl p-3 min-w-56 max-h-80 overflow-y-auto"
|
|
469
479
|
>
|
|
470
480
|
<p class="text-[10px] font-bold text-slate-400 dark:text-slate-500 uppercase tracking-widest mb-2 px-1">
|
|
471
481
|
Columnas visibles
|
|
@@ -763,7 +773,7 @@ defineExpose({
|
|
|
763
773
|
<IconReload
|
|
764
774
|
v-if="!loading"
|
|
765
775
|
class="size-4 cursor-pointer text-gray-500 dark:text-slate-400 hover:text-gray-700 dark:hover:text-slate-300 transition-colors"
|
|
766
|
-
@click="
|
|
776
|
+
@click="reloadTable"
|
|
767
777
|
/>
|
|
768
778
|
<div v-else>
|
|
769
779
|
<svg class="animate-spin size-4 text-slate-400 dark:text-slate-600" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
@@ -791,15 +801,6 @@ defineExpose({
|
|
|
791
801
|
</div>
|
|
792
802
|
</div>
|
|
793
803
|
|
|
794
|
-
<!-- Columns panel button -->
|
|
795
|
-
<button
|
|
796
|
-
@click="showColumnPanel = !showColumnPanel"
|
|
797
|
-
class="flex items-center gap-x-1.5 py-1 px-2.5 rounded-lg text-[11px] font-bold text-slate-500 dark:text-slate-400 hover:bg-slate-100 dark:hover:bg-slate-700 transition-colors border border-transparent"
|
|
798
|
-
:class="showColumnPanel ? 'bg-slate-100 dark:bg-slate-700 border-slate-200 dark:border-slate-600' : ''"
|
|
799
|
-
>
|
|
800
|
-
<IconLayoutColumns class="size-4" />
|
|
801
|
-
Columnas
|
|
802
|
-
</button>
|
|
803
804
|
</div>
|
|
804
805
|
|
|
805
806
|
<!-- Right: per-page + pagination -->
|