@innertia-solutions/nuxt-theme-spark 0.1.86 → 0.1.88
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.
|
@@ -56,6 +56,7 @@ const paginationHeight = ref(0)
|
|
|
56
56
|
|
|
57
57
|
const previewCacheKey = computed(() => `table-preview-${props.name}`)
|
|
58
58
|
|
|
59
|
+
const previewFromCache = ref(false)
|
|
59
60
|
const closePreview = () => { previewRow.value = null }
|
|
60
61
|
|
|
61
62
|
const handleRowClick = (row) => {
|
|
@@ -115,11 +116,16 @@ const onEsc = (e) => { if (e.key === 'Escape' && previewRow.value) closePreview(
|
|
|
115
116
|
onMounted(() => {
|
|
116
117
|
previewEnabled.value = !!slots.preview
|
|
117
118
|
window.addEventListener('keydown', onEsc)
|
|
118
|
-
// Restore preview from session cache
|
|
119
|
+
// Restore preview from session cache — mark as from-cache to skip enter animation
|
|
119
120
|
if (props.cached && previewEnabled.value) {
|
|
120
121
|
try {
|
|
121
122
|
const raw = sessionStorage.getItem(previewCacheKey.value)
|
|
122
|
-
if (raw)
|
|
123
|
+
if (raw) {
|
|
124
|
+
previewFromCache.value = true
|
|
125
|
+
previewRow.value = JSON.parse(raw)
|
|
126
|
+
await nextTick()
|
|
127
|
+
previewFromCache.value = false
|
|
128
|
+
}
|
|
123
129
|
} catch {}
|
|
124
130
|
}
|
|
125
131
|
})
|
|
@@ -283,9 +289,9 @@ defineExpose({ getSelectedRows, reload, clearCache, exportTable, tableRef })
|
|
|
283
289
|
|
|
284
290
|
<!-- Preview panel overlay — slides in from right, tapa la tabla -->
|
|
285
291
|
<Transition
|
|
286
|
-
enter-active-class="transition ease-out duration-200"
|
|
287
|
-
enter-from-class="opacity-0 translate-x-6"
|
|
288
|
-
enter-to-class="opacity-100 translate-x-0"
|
|
292
|
+
:enter-active-class="previewFromCache ? '' : 'transition ease-out duration-200'"
|
|
293
|
+
:enter-from-class="previewFromCache ? '' : 'opacity-0 translate-x-6'"
|
|
294
|
+
:enter-to-class="previewFromCache ? '' : 'opacity-100 translate-x-0'"
|
|
289
295
|
leave-active-class="transition ease-in duration-150"
|
|
290
296
|
leave-from-class="opacity-100 translate-x-0"
|
|
291
297
|
leave-to-class="opacity-0 translate-x-6"
|