@innertia-solutions/nuxt-theme-spark 0.1.66 → 0.1.67
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.
|
@@ -46,17 +46,11 @@ const mergedParams = computed(() => ({
|
|
|
46
46
|
const previewRow = ref(null)
|
|
47
47
|
const currentRatio = ref(props.splitRatio)
|
|
48
48
|
const containerRef = ref(null)
|
|
49
|
-
const hasPreviewSlot = computed(() => !!slots.preview)
|
|
50
|
-
const showPreview = computed(() => !!previewRow.value && hasPreviewSlot.value)
|
|
51
|
-
|
|
52
49
|
const closePreview = () => { previewRow.value = null }
|
|
53
50
|
|
|
54
51
|
const handleRowClick = (row) => {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
} else {
|
|
58
|
-
emit('row-click', row)
|
|
59
|
-
}
|
|
52
|
+
previewRow.value = previewRow.value?.id === row.id ? null : row
|
|
53
|
+
if (!slots.preview) emit('row-click', row)
|
|
60
54
|
}
|
|
61
55
|
|
|
62
56
|
const startResize = (e) => {
|
|
@@ -132,12 +126,12 @@ defineExpose({ getSelectedRows, reload, clearCache, exportTable, tableRef })
|
|
|
132
126
|
|
|
133
127
|
<template>
|
|
134
128
|
<div class="relative" ref="containerRef">
|
|
135
|
-
<div :class="
|
|
129
|
+
<div :class="previewRow && $slots.preview ? 'flex items-stretch gap-3' : ''">
|
|
136
130
|
|
|
137
131
|
<!-- Card -->
|
|
138
132
|
<div
|
|
139
133
|
class="relative bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-700 rounded-2xl shadow-sm overflow-hidden"
|
|
140
|
-
:style="
|
|
134
|
+
:style="previewRow && $slots.preview ? { width: currentRatio + '%', minWidth: 0, flexShrink: 0 } : {}"
|
|
141
135
|
>
|
|
142
136
|
<!-- Toolbar -->
|
|
143
137
|
<div class="flex flex-wrap items-center gap-3 px-4 py-3 border-b border-slate-200 dark:border-slate-700">
|
|
@@ -238,7 +232,7 @@ defineExpose({ getSelectedRows, reload, clearCache, exportTable, tableRef })
|
|
|
238
232
|
|
|
239
233
|
<!-- Resize handle -->
|
|
240
234
|
<div
|
|
241
|
-
v-if="
|
|
235
|
+
v-if="previewRow && $slots.preview"
|
|
242
236
|
class="w-3 flex items-center justify-center cursor-col-resize shrink-0 group"
|
|
243
237
|
@mousedown="startResize"
|
|
244
238
|
>
|
|
@@ -255,7 +249,7 @@ defineExpose({ getSelectedRows, reload, clearCache, exportTable, tableRef })
|
|
|
255
249
|
leave-to-class="opacity-0 translate-x-4"
|
|
256
250
|
>
|
|
257
251
|
<div
|
|
258
|
-
v-if="
|
|
252
|
+
v-if="previewRow && $slots.preview"
|
|
259
253
|
class="bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-700 rounded-2xl shadow-sm overflow-hidden flex flex-col"
|
|
260
254
|
:style="{ width: (100 - currentRatio) + '%', minWidth: 0, flexShrink: 0 }"
|
|
261
255
|
>
|