@innertia-solutions/nuxt-theme-spark 0.1.30 → 0.1.32

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.
@@ -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"
@@ -446,6 +446,8 @@ const reloadTable = () => {
446
446
  fetchData()
447
447
  }
448
448
 
449
+ const toggleColumnPanel = () => { showColumnPanel.value = !showColumnPanel.value }
450
+
449
451
  defineExpose({
450
452
  getSelectedRows,
451
453
  loading,
@@ -453,6 +455,8 @@ defineExpose({
453
455
  reload: reloadTable,
454
456
  clearCache,
455
457
  table,
458
+ showColumnPanel,
459
+ toggleColumnPanel,
456
460
  })
457
461
  </script>
458
462
 
@@ -471,7 +475,7 @@ defineExpose({
471
475
  <div
472
476
  v-if="showColumnPanel"
473
477
  ref="columnPanelRef"
474
- class="absolute bottom-16 right-6 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"
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"
475
479
  >
476
480
  <p class="text-[10px] font-bold text-slate-400 dark:text-slate-500 uppercase tracking-widest mb-2 px-1">
477
481
  Columnas visibles
@@ -682,6 +686,20 @@ defineExpose({
682
686
  </template>
683
687
  </td>
684
688
  </tr>
689
+
690
+ <!-- Filler rows: pad table to full page height when data < perPage -->
691
+ <tr
692
+ v-if="!loading && tableData.length > 0 && tableData.length < pagination.pageSize"
693
+ v-for="i in (pagination.pageSize - tableData.length)"
694
+ :key="'fill-' + i"
695
+ class="divide-x divide-gray-200 dark:divide-slate-700 bg-white dark:bg-slate-800"
696
+ >
697
+ <td
698
+ v-for="header in (table.getHeaderGroups()[0]?.headers ?? [])"
699
+ :key="'fillc-' + header.id"
700
+ :style="{ height: lastRowHeight + 'px' }"
701
+ />
702
+ </tr>
685
703
  </tbody>
686
704
  </table>
687
705
 
@@ -797,15 +815,6 @@ defineExpose({
797
815
  </div>
798
816
  </div>
799
817
 
800
- <!-- Columns panel button -->
801
- <button
802
- @click="showColumnPanel = !showColumnPanel"
803
- 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"
804
- :class="showColumnPanel ? 'bg-slate-100 dark:bg-slate-700 border-slate-200 dark:border-slate-600' : ''"
805
- >
806
- <IconLayoutColumns class="size-4" />
807
- Columnas
808
- </button>
809
818
  </div>
810
819
 
811
820
  <!-- Right: per-page + pagination -->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@innertia-solutions/nuxt-theme-spark",
3
- "version": "0.1.30",
3
+ "version": "0.1.32",
4
4
  "description": "Innertia Solutions — Spark theme: backoffice, landing and mobile components and layouts",
5
5
  "keywords": [
6
6
  "nuxt",