@innertia-solutions/nuxt-theme-spark 0.1.40 → 0.1.41
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.
|
@@ -21,7 +21,9 @@ const btnRef = ref(null)
|
|
|
21
21
|
const panelRef = ref(null)
|
|
22
22
|
const panelStyle = ref({})
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
const exportableColumns = computed(() => props.columns.filter(c => c.label))
|
|
25
|
+
|
|
26
|
+
watch(exportableColumns, (cols) => {
|
|
25
27
|
selectedColumns.value = cols.map(c => c.key)
|
|
26
28
|
}, { immediate: true })
|
|
27
29
|
|
|
@@ -41,13 +43,13 @@ const toggleColumn = (key) => {
|
|
|
41
43
|
}
|
|
42
44
|
|
|
43
45
|
const toggleAll = () => {
|
|
44
|
-
if (selectedColumns.value.length ===
|
|
46
|
+
if (selectedColumns.value.length === exportableColumns.value.length)
|
|
45
47
|
selectedColumns.value = []
|
|
46
48
|
else
|
|
47
|
-
selectedColumns.value =
|
|
49
|
+
selectedColumns.value = exportableColumns.value.map(c => c.key)
|
|
48
50
|
}
|
|
49
51
|
|
|
50
|
-
const allSelected = computed(() => selectedColumns.value.length ===
|
|
52
|
+
const allSelected = computed(() => selectedColumns.value.length === exportableColumns.value.length)
|
|
51
53
|
|
|
52
54
|
const open = () => {
|
|
53
55
|
if (!btnRef.value) return
|
|
@@ -163,7 +165,7 @@ defineExpose({ open })
|
|
|
163
165
|
</div>
|
|
164
166
|
|
|
165
167
|
<!-- Columns -->
|
|
166
|
-
<div v-if="
|
|
168
|
+
<div v-if="exportableColumns.length > 0">
|
|
167
169
|
<div class="flex items-center justify-between mb-1.5">
|
|
168
170
|
<p class="text-[10px] font-bold text-slate-400 dark:text-slate-500 uppercase tracking-widest">Columnas</p>
|
|
169
171
|
<button type="button" @click="toggleAll" class="text-[10px] text-blue-600 dark:text-blue-400 hover:underline font-medium">
|
|
@@ -172,7 +174,7 @@ defineExpose({ open })
|
|
|
172
174
|
</div>
|
|
173
175
|
<div class="grid grid-cols-2 gap-1 max-h-36 overflow-y-auto">
|
|
174
176
|
<label
|
|
175
|
-
v-for="col in
|
|
177
|
+
v-for="col in exportableColumns"
|
|
176
178
|
:key="col.key"
|
|
177
179
|
class="flex items-center gap-2 py-1 px-2 rounded-lg hover:bg-slate-50 dark:hover:bg-slate-700 cursor-pointer"
|
|
178
180
|
>
|