@innertia-solutions/innertia-nuxt 0.1.9 → 0.1.11
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/DataPreview.vue +323 -0
- package/components/DataTable.vue +12 -12
- package/components/Forms/DatePicker.vue +64 -39
- package/components/Forms/Input.vue +8 -2
- package/components/Forms/Select.vue +56 -20
- package/components/Forms/SelectServer.vue +39 -34
- package/components/PermissionsTree.vue +4 -4
- package/components/Table/Database.vue +5 -5
- package/components/Table/DownloadDropdown.vue +8 -8
- package/components/Table/Enterprise.vue +9 -9
- package/components/Table/FilterDropdown.vue +3 -3
- package/components/Table/Grid.vue +4 -4
- package/components/Table/Kanban.vue +3 -3
- package/components/Table/List.vue +6 -6
- package/components/Table/Standard.vue +69 -324
- package/components/Table/index.vue +13 -13
- package/components/TableExportable.vue +6 -6
- package/components/TableFilter.vue +4 -4
- package/components/Tree/Node.vue +187 -84
- package/components/Tree/Standard.vue +345 -57
- package/composables/useTable.ts +7 -3
- package/css/tokens.css +90 -0
- package/package.json +1 -1
- package/theme.css +2 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup>
|
|
2
|
-
import { IconSearch, IconLayoutColumns, IconGripVertical,
|
|
2
|
+
import { IconSearch, IconLayoutColumns, IconGripVertical, IconX, IconPlus, IconChevronLeft, IconCheck, IconChevronDown } from '@tabler/icons-vue'
|
|
3
3
|
import Table from './index.vue'
|
|
4
4
|
|
|
5
5
|
const props = defineProps({
|
|
@@ -250,62 +250,35 @@ const resolvedPreviewHref = computed(() => {
|
|
|
250
250
|
: props.previewHref
|
|
251
251
|
})
|
|
252
252
|
|
|
253
|
-
// ─── Preview
|
|
254
|
-
const previewRow
|
|
255
|
-
const
|
|
256
|
-
const
|
|
257
|
-
const previewEnabled
|
|
258
|
-
const
|
|
253
|
+
// ─── Preview — la UI vive en <DataPreview>, este file solo le pasa la fila ─
|
|
254
|
+
const previewRow = ref(null)
|
|
255
|
+
const containerRef = ref(null)
|
|
256
|
+
const dataPreviewRef = ref(null)
|
|
257
|
+
const previewEnabled = ref(false)
|
|
258
|
+
const tableMeta = ref(null)
|
|
259
259
|
|
|
260
|
-
const previewCacheKey = computed(() => `table-preview-${resolvedName.value}`)
|
|
261
|
-
|
|
262
|
-
const previewFromCache = ref(false)
|
|
263
|
-
const previewPanelRef = ref(null)
|
|
264
260
|
const closePreview = () => { previewRow.value = null }
|
|
265
261
|
|
|
266
|
-
const previewTab = ref('datos')
|
|
267
|
-
const tableMeta = ref(null)
|
|
268
|
-
|
|
269
|
-
const hasHistory = computed(() => !!tableMeta.value?.has_history)
|
|
270
262
|
const resolvedHistoryEndpoint = computed(() => {
|
|
271
|
-
if (!
|
|
263
|
+
if (!tableMeta.value?.has_history || !previewRow.value?.id || !tableMeta.value?.entity_type) return null
|
|
272
264
|
return `history/${tableMeta.value.entity_type}/${previewRow.value.id}`
|
|
273
265
|
})
|
|
274
266
|
|
|
275
|
-
|
|
276
|
-
previewTab.value = 'datos'
|
|
277
|
-
if (row) {
|
|
278
|
-
await nextTick()
|
|
279
|
-
if (typeof window !== 'undefined') window.HSStaticMethods?.autoInit?.(['Tooltip'])
|
|
280
|
-
}
|
|
281
|
-
})
|
|
267
|
+
const { collapseDock } = useDockedPreviews()
|
|
282
268
|
|
|
283
269
|
const handleRowClick = (row) => {
|
|
284
270
|
if (!previewEnabled.value) {
|
|
285
271
|
emit('row-click', row)
|
|
286
272
|
return
|
|
287
273
|
}
|
|
288
|
-
|
|
289
|
-
// Si la misma fila ya tiene el preview abierto, no hacer nada.
|
|
290
|
-
// Comparación stringificada para tolerar mismatch de tipo (string vs number).
|
|
291
|
-
const currentId = previewRow.value?.id
|
|
274
|
+
const currentId = previewRow.value?.id
|
|
292
275
|
const incomingId = row?.id
|
|
293
|
-
if (currentId != null && incomingId != null && String(currentId) === String(incomingId))
|
|
294
|
-
return
|
|
295
|
-
}
|
|
296
|
-
|
|
276
|
+
if (currentId != null && incomingId != null && String(currentId) === String(incomingId)) return
|
|
297
277
|
collapseDock()
|
|
298
278
|
previewRow.value = row
|
|
299
279
|
}
|
|
300
280
|
|
|
301
|
-
//
|
|
302
|
-
watch(previewRow, (row) => {
|
|
303
|
-
if (!props.cached) return
|
|
304
|
-
if (row) sessionStorage.setItem(previewCacheKey.value, JSON.stringify(row))
|
|
305
|
-
else sessionStorage.removeItem(previewCacheKey.value)
|
|
306
|
-
})
|
|
307
|
-
|
|
308
|
-
// When data reloads, update previewRow with fresh data — close silently if deleted
|
|
281
|
+
// Cuando recarga la data, mantener viva la fila previewada (o cerrar si fue eliminada).
|
|
309
282
|
const handleLoaded = (res) => {
|
|
310
283
|
emit('loaded', res)
|
|
311
284
|
if (res?.meta) tableMeta.value = res.meta
|
|
@@ -316,93 +289,22 @@ const handleLoaded = (res) => {
|
|
|
316
289
|
}
|
|
317
290
|
}
|
|
318
291
|
|
|
319
|
-
//
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
paginationHeight.value = el.offsetHeight
|
|
326
|
-
paginationObserver = new ResizeObserver(() => {
|
|
327
|
-
paginationHeight.value = el.offsetHeight
|
|
328
|
-
})
|
|
329
|
-
paginationObserver.observe(el)
|
|
330
|
-
}, { flush: 'post' })
|
|
331
|
-
|
|
332
|
-
const startResize = (e) => {
|
|
333
|
-
e.preventDefault()
|
|
334
|
-
const onMove = (ev) => {
|
|
335
|
-
if (!containerRef.value) return
|
|
336
|
-
const rect = containerRef.value.getBoundingClientRect()
|
|
337
|
-
const ratio = ((ev.clientX - rect.left) / rect.width) * 100
|
|
338
|
-
currentRatio.value = Math.min(80, Math.max(25, ratio))
|
|
339
|
-
}
|
|
340
|
-
const onUp = () => {
|
|
341
|
-
window.removeEventListener('mousemove', onMove)
|
|
342
|
-
window.removeEventListener('mouseup', onUp)
|
|
343
|
-
}
|
|
344
|
-
window.addEventListener('mousemove', onMove)
|
|
345
|
-
window.addEventListener('mouseup', onUp)
|
|
292
|
+
// ESC + click-fuera → cierran el preview (la UI no maneja esto porque depende
|
|
293
|
+
// del container del padre).
|
|
294
|
+
const onEsc = (e) => {
|
|
295
|
+
if (e.key !== 'Escape') return
|
|
296
|
+
if (previewRow.value) closePreview()
|
|
297
|
+
else collapseDock()
|
|
346
298
|
}
|
|
347
|
-
|
|
348
|
-
const onEsc = (e) => { if (e.key === 'Escape') { if (previewRow.value) closePreview(); else collapseDock() } }
|
|
349
|
-
|
|
350
|
-
// ─── Auto-close preview on outside click ──────────────────────────────────────
|
|
351
299
|
const onDocMousedown = (e) => {
|
|
352
|
-
if (props.autoClosePreview
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
// ─── Dock (minimizar preview) ──────────────────────────────────────────────────
|
|
358
|
-
const {
|
|
359
|
-
docked,
|
|
360
|
-
dock, undock: undockItem, isActive,
|
|
361
|
-
activeDockId, activeDockRect,
|
|
362
|
-
expandDock, collapseDock,
|
|
363
|
-
} = useDockedPreviews()
|
|
364
|
-
const route = useRoute()
|
|
365
|
-
|
|
366
|
-
function minimizePreview() {
|
|
367
|
-
if (!previewRow.value) return
|
|
368
|
-
const label = previewRow.value.name ?? previewRow.value.title ?? previewRow.value.email ?? String(previewRow.value.id)
|
|
369
|
-
const subtitle = previewRow.value.email ?? previewRow.value.description ?? null
|
|
370
|
-
dock({
|
|
371
|
-
id: `${resolvedName.value}-${previewRow.value.id}`,
|
|
372
|
-
label,
|
|
373
|
-
subtitle,
|
|
374
|
-
row: { ...previewRow.value },
|
|
375
|
-
tableName: resolvedName.value,
|
|
376
|
-
route: route.path,
|
|
377
|
-
})
|
|
300
|
+
if (!props.autoClosePreview || !previewRow.value) return
|
|
301
|
+
const panelEl = dataPreviewRef.value?.panelRef
|
|
302
|
+
if (containerRef.value?.contains(e.target)) return
|
|
303
|
+
if (panelEl?.contains(e.target)) return
|
|
378
304
|
closePreview()
|
|
379
305
|
}
|
|
380
306
|
|
|
381
|
-
//
|
|
382
|
-
const floatingItem = computed(() =>
|
|
383
|
-
activeDockId.value
|
|
384
|
-
? docked.value.find(d => d.id === activeDockId.value && d.tableName === resolvedName.value) ?? null
|
|
385
|
-
: null
|
|
386
|
-
)
|
|
387
|
-
|
|
388
|
-
// Posición del panel flotante: centrado sobre el tab que lo abrió
|
|
389
|
-
const floatingPanelStyle = computed(() => {
|
|
390
|
-
const rect = activeDockRect.value
|
|
391
|
-
const panelW = 384
|
|
392
|
-
const bottom = 52
|
|
393
|
-
if (!rect || typeof window === 'undefined') return { bottom: bottom + 'px', right: '16px' }
|
|
394
|
-
const tabCenter = rect.left + rect.width / 2
|
|
395
|
-
let right = window.innerWidth - tabCenter - panelW / 2
|
|
396
|
-
right = Math.max(8, Math.min(right, window.innerWidth - panelW - 8))
|
|
397
|
-
return { bottom: bottom + 'px', right: right + 'px' }
|
|
398
|
-
})
|
|
399
|
-
|
|
400
|
-
function expandToFull(item) {
|
|
401
|
-
previewRow.value = item.row
|
|
402
|
-
undockItem(item.id)
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
// Escuchar evento de restauración (fallback cuando la tabla no estaba montada)
|
|
307
|
+
// Restauración cuando se vuelve a la página tabla → la fila docked se promueve.
|
|
406
308
|
onMounted(() => {
|
|
407
309
|
useNuxtApp().hooks.hook('preview:restore', (item) => {
|
|
408
310
|
if (item.tableName === resolvedName.value) previewRow.value = item.row
|
|
@@ -413,31 +315,16 @@ onMounted(async () => {
|
|
|
413
315
|
previewEnabled.value = !!slots.preview
|
|
414
316
|
window.addEventListener('keydown', onEsc)
|
|
415
317
|
document.addEventListener('mousedown', onDocMousedown)
|
|
416
|
-
// Restore preview from session cache — mark as from-cache to skip enter animation
|
|
417
|
-
if (props.cached && previewEnabled.value) {
|
|
418
|
-
try {
|
|
419
|
-
const raw = sessionStorage.getItem(previewCacheKey.value)
|
|
420
|
-
if (raw) {
|
|
421
|
-
previewFromCache.value = true
|
|
422
|
-
previewRow.value = JSON.parse(raw)
|
|
423
|
-
await nextTick()
|
|
424
|
-
previewFromCache.value = false
|
|
425
|
-
}
|
|
426
|
-
} catch {}
|
|
427
|
-
}
|
|
428
318
|
|
|
429
319
|
// Load column preferences from backend
|
|
430
320
|
if (props.persistPreferences && resolvedName.value) {
|
|
431
321
|
await loadPrefs()
|
|
432
|
-
// Apply saved visibility
|
|
433
322
|
if (tablePrefs.value.visibility && tableRef.value?.table) {
|
|
434
323
|
tableRef.value.table.setColumnVisibility(tablePrefs.value.visibility)
|
|
435
324
|
}
|
|
436
|
-
// Apply saved column order
|
|
437
325
|
if (tablePrefs.value.order?.length && tableRef.value?.setColumnOrder) {
|
|
438
326
|
tableRef.value.setColumnOrder(tablePrefs.value.order)
|
|
439
327
|
}
|
|
440
|
-
// Apply saved pinning
|
|
441
328
|
if (tablePrefs.value.pinning && tableRef.value?.table) {
|
|
442
329
|
tableRef.value.table.setColumnPinning(tablePrefs.value.pinning)
|
|
443
330
|
}
|
|
@@ -447,7 +334,6 @@ onMounted(async () => {
|
|
|
447
334
|
onBeforeUnmount(() => {
|
|
448
335
|
window.removeEventListener('keydown', onEsc)
|
|
449
336
|
document.removeEventListener('mousedown', onDocMousedown)
|
|
450
|
-
paginationObserver?.disconnect()
|
|
451
337
|
})
|
|
452
338
|
|
|
453
339
|
// ─── Column panel ─────────────────────────────────────────────────────────────
|
|
@@ -651,7 +537,7 @@ defineExpose({ getSelectedRows, reload, clearCache, exportTable, tableRef, close
|
|
|
651
537
|
|
|
652
538
|
<!-- Search -->
|
|
653
539
|
<div v-if="showSearch" class="flex-1 min-w-48 max-w-xs">
|
|
654
|
-
<Forms.Input v-model="search" type="
|
|
540
|
+
<Forms.Input v-model="search" type="text" :placeholder="searchPlaceholder" :icon-right="IconSearch" size="sm" />
|
|
655
541
|
</div>
|
|
656
542
|
|
|
657
543
|
<!-- + Filtros button -->
|
|
@@ -660,7 +546,7 @@ defineExpose({ getSelectedRows, reload, clearCache, exportTable, tableRef, close
|
|
|
660
546
|
type="button"
|
|
661
547
|
@click="toggleFilterMenu"
|
|
662
548
|
:class="[
|
|
663
|
-
'inline-flex items-center gap-1.5 py-1.5 px-3 text-sm font-medium rounded-
|
|
549
|
+
'inline-flex items-center gap-1.5 py-1.5 px-3 text-sm font-medium rounded-control border transition-colors',
|
|
664
550
|
activeFilterList.length
|
|
665
551
|
? 'border-primary/40 bg-primary/10 text-primary'
|
|
666
552
|
: 'border-card-line bg-card text-muted-foreground-1 hover:bg-muted-hover'
|
|
@@ -682,7 +568,7 @@ defineExpose({ getSelectedRows, reload, clearCache, exportTable, tableRef, close
|
|
|
682
568
|
@click="showColumnPanel = !showColumnPanel"
|
|
683
569
|
:title="'Columnas'"
|
|
684
570
|
:class="[
|
|
685
|
-
'p-1.5 inline-flex items-center justify-center rounded-
|
|
571
|
+
'p-1.5 inline-flex items-center justify-center rounded-control border transition-colors',
|
|
686
572
|
showColumnPanel
|
|
687
573
|
? 'border-primary/40 bg-primary/10 text-primary'
|
|
688
574
|
: 'border-transparent text-muted-foreground hover:border-card-line hover:bg-muted-hover hover:text-foreground'
|
|
@@ -700,7 +586,7 @@ defineExpose({ getSelectedRows, reload, clearCache, exportTable, tableRef, close
|
|
|
700
586
|
<div
|
|
701
587
|
v-for="chip in activeFilterList"
|
|
702
588
|
:key="chip.key"
|
|
703
|
-
class="inline-flex items-center text-xs rounded-
|
|
589
|
+
class="inline-flex items-center text-xs rounded-control border border-card-line bg-card overflow-hidden"
|
|
704
590
|
>
|
|
705
591
|
<span class="px-2.5 py-1 text-foreground font-medium border-r border-card-line bg-surface">{{ chip.label }}</span>
|
|
706
592
|
<span class="px-2 py-1 text-muted-foreground">{{ chip.displayOp }}</span>
|
|
@@ -723,7 +609,7 @@ defineExpose({ getSelectedRows, reload, clearCache, exportTable, tableRef, close
|
|
|
723
609
|
</div>
|
|
724
610
|
|
|
725
611
|
<!-- Tabla -->
|
|
726
|
-
<div class="overflow-hidden border border-card-line rounded-
|
|
612
|
+
<div class="overflow-hidden border border-card-line rounded-card">
|
|
727
613
|
<Table
|
|
728
614
|
ref="tableRef"
|
|
729
615
|
:endpoint="resolvedEndpoint"
|
|
@@ -749,172 +635,31 @@ defineExpose({ getSelectedRows, reload, clearCache, exportTable, tableRef, close
|
|
|
749
635
|
</Table>
|
|
750
636
|
</div>
|
|
751
637
|
|
|
752
|
-
<!-- Preview panel
|
|
753
|
-
<
|
|
754
|
-
|
|
755
|
-
:
|
|
756
|
-
:
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
638
|
+
<!-- Preview compartido (panel overlay + chip flotante + history tab) -->
|
|
639
|
+
<DataPreview
|
|
640
|
+
ref="dataPreviewRef"
|
|
641
|
+
v-model:row="previewRow"
|
|
642
|
+
:enabled="previewEnabled"
|
|
643
|
+
:name="resolvedName"
|
|
644
|
+
:cached="cached"
|
|
645
|
+
:preview-href="previewHref"
|
|
646
|
+
:preview-deletable="previewDeletable"
|
|
647
|
+
:split-ratio="splitRatio"
|
|
648
|
+
:container-ref="containerRef"
|
|
649
|
+
:history-endpoint="resolvedHistoryEndpoint"
|
|
650
|
+
@delete="emit('preview-delete', $event)"
|
|
760
651
|
>
|
|
761
|
-
<
|
|
762
|
-
v-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
>
|
|
767
|
-
|
|
768
|
-
<
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
/>
|
|
772
|
-
|
|
773
|
-
<!-- Barra de acciones del preview -->
|
|
774
|
-
<div class="shrink-0 flex items-center gap-3 px-5 py-4 border-b border-card-line">
|
|
775
|
-
<!-- Título (reemplazable via slot) -->
|
|
776
|
-
<div class="flex-1 min-w-0">
|
|
777
|
-
<slot name="preview-header" :row="previewRow" :close="closePreview" />
|
|
778
|
-
</div>
|
|
779
|
-
|
|
780
|
-
<!-- Botones de acción — todos icon-only, mismo tamaño y estilo -->
|
|
781
|
-
<div class="flex items-center gap-0.5 shrink-0">
|
|
782
|
-
|
|
783
|
-
<!-- Acciones extra configurables desde el padre -->
|
|
784
|
-
<slot name="preview-actions" :row="previewRow" :close="closePreview" />
|
|
652
|
+
<template #header="bind">
|
|
653
|
+
<slot name="preview-header" v-bind="bind" />
|
|
654
|
+
</template>
|
|
655
|
+
<template #actions="bind">
|
|
656
|
+
<slot name="preview-actions" v-bind="bind" />
|
|
657
|
+
</template>
|
|
658
|
+
<template #default="bind">
|
|
659
|
+
<slot name="preview" v-bind="bind" />
|
|
660
|
+
</template>
|
|
661
|
+
</DataPreview>
|
|
785
662
|
|
|
786
|
-
<!-- Abrir (configurable vía :preview-href) -->
|
|
787
|
-
<div v-if="resolvedPreviewHref" class="hs-tooltip [--placement:top] inline-block">
|
|
788
|
-
<NuxtLink
|
|
789
|
-
:to="resolvedPreviewHref"
|
|
790
|
-
class="hs-tooltip-toggle inline-flex items-center justify-center size-7 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted-hover transition-colors"
|
|
791
|
-
>
|
|
792
|
-
<IconExternalLink class="size-3.5" />
|
|
793
|
-
</NuxtLink>
|
|
794
|
-
<span class="hs-tooltip-content hs-tooltip-shown:opacity-100 hs-tooltip-shown:visible opacity-0 transition-opacity inline-block absolute invisible z-10 py-1 px-2 bg-tooltip border border-tooltip-line text-xs font-medium text-tooltip-foreground rounded-md shadow-2xs" role="tooltip">Abrir</span>
|
|
795
|
-
</div>
|
|
796
|
-
|
|
797
|
-
<!-- Eliminar (configurable vía :preview-deletable) -->
|
|
798
|
-
<div v-if="previewDeletable" class="hs-tooltip [--placement:top] inline-block">
|
|
799
|
-
<button
|
|
800
|
-
type="button"
|
|
801
|
-
class="hs-tooltip-toggle inline-flex items-center justify-center size-7 rounded-md text-muted-foreground hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors"
|
|
802
|
-
@click.stop="emit('preview-delete', previewRow)"
|
|
803
|
-
>
|
|
804
|
-
<IconTrash class="size-3.5" />
|
|
805
|
-
</button>
|
|
806
|
-
<span class="hs-tooltip-content hs-tooltip-shown:opacity-100 hs-tooltip-shown:visible opacity-0 transition-opacity inline-block absolute invisible z-10 py-1 px-2 bg-tooltip border border-tooltip-line text-xs font-medium text-tooltip-foreground rounded-md shadow-2xs" role="tooltip">Eliminar</span>
|
|
807
|
-
</div>
|
|
808
|
-
|
|
809
|
-
<!-- Minimizar (siempre) -->
|
|
810
|
-
<div class="hs-tooltip [--placement:top] inline-block">
|
|
811
|
-
<button
|
|
812
|
-
type="button"
|
|
813
|
-
class="hs-tooltip-toggle inline-flex items-center justify-center size-7 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted-hover transition-colors"
|
|
814
|
-
@click.stop="minimizePreview"
|
|
815
|
-
>
|
|
816
|
-
<IconMinus class="size-3.5" />
|
|
817
|
-
</button>
|
|
818
|
-
<span class="hs-tooltip-content hs-tooltip-shown:opacity-100 hs-tooltip-shown:visible opacity-0 transition-opacity inline-block absolute invisible z-10 py-1 px-2 bg-tooltip border border-tooltip-line text-xs font-medium text-tooltip-foreground rounded-md shadow-2xs" role="tooltip">Minimizar</span>
|
|
819
|
-
</div>
|
|
820
|
-
|
|
821
|
-
<!-- Cerrar (siempre) -->
|
|
822
|
-
<div class="hs-tooltip [--placement:top] inline-block">
|
|
823
|
-
<button
|
|
824
|
-
type="button"
|
|
825
|
-
class="hs-tooltip-toggle inline-flex items-center justify-center size-7 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted-hover transition-colors"
|
|
826
|
-
@click.stop="closePreview"
|
|
827
|
-
>
|
|
828
|
-
<IconX class="size-3.5" />
|
|
829
|
-
</button>
|
|
830
|
-
<span class="hs-tooltip-content hs-tooltip-shown:opacity-100 hs-tooltip-shown:visible opacity-0 transition-opacity inline-block absolute invisible z-10 py-1 px-2 bg-tooltip border border-tooltip-line text-xs font-medium text-tooltip-foreground rounded-md shadow-2xs" role="tooltip">Cerrar</span>
|
|
831
|
-
</div>
|
|
832
|
-
|
|
833
|
-
</div>
|
|
834
|
-
</div>
|
|
835
|
-
|
|
836
|
-
<!-- Scrollable content -->
|
|
837
|
-
<div class="flex-1 overflow-y-auto min-h-0">
|
|
838
|
-
<slot v-if="previewTab === 'datos'" name="preview" :row="previewRow" :close="closePreview" />
|
|
839
|
-
<Table.PreviewTimeline
|
|
840
|
-
v-else-if="previewTab === 'bitacora' && resolvedHistoryEndpoint"
|
|
841
|
-
:endpoint="resolvedHistoryEndpoint"
|
|
842
|
-
/>
|
|
843
|
-
</div>
|
|
844
|
-
|
|
845
|
-
<!-- Tabs — bottom -->
|
|
846
|
-
<div v-if="hasHistory" class="shrink-0 flex border-t border-card-line">
|
|
847
|
-
<button
|
|
848
|
-
type="button"
|
|
849
|
-
@click="previewTab = 'datos'"
|
|
850
|
-
:class="[
|
|
851
|
-
'flex-1 py-2.5 text-xs font-semibold transition-colors border-r border-card-line border-t-2 -mt-px',
|
|
852
|
-
previewTab === 'datos'
|
|
853
|
-
? 'border-t-card text-foreground'
|
|
854
|
-
: 'border-t-transparent text-muted-foreground hover:text-foreground hover:bg-muted-hover'
|
|
855
|
-
]"
|
|
856
|
-
>
|
|
857
|
-
Datos
|
|
858
|
-
</button>
|
|
859
|
-
<button
|
|
860
|
-
type="button"
|
|
861
|
-
@click="resolvedHistoryEndpoint && (previewTab = 'bitacora')"
|
|
862
|
-
:disabled="!resolvedHistoryEndpoint"
|
|
863
|
-
:class="[
|
|
864
|
-
'flex-1 py-2.5 text-xs font-semibold transition-colors border-t-2 -mt-px',
|
|
865
|
-
!resolvedHistoryEndpoint
|
|
866
|
-
? 'border-t-transparent text-muted-foreground/40 cursor-not-allowed'
|
|
867
|
-
: previewTab === 'bitacora'
|
|
868
|
-
? 'border-t-card text-foreground'
|
|
869
|
-
: 'border-t-transparent text-muted-foreground hover:text-foreground hover:bg-muted-hover'
|
|
870
|
-
]"
|
|
871
|
-
>
|
|
872
|
-
Bitácora
|
|
873
|
-
</button>
|
|
874
|
-
</div>
|
|
875
|
-
|
|
876
|
-
</div>
|
|
877
|
-
</Transition>
|
|
878
|
-
|
|
879
|
-
<!-- ── Floating mini-preview (dock expand, estilo Gmail) ── -->
|
|
880
|
-
<Teleport to="body">
|
|
881
|
-
<Transition
|
|
882
|
-
enter-active-class="transition ease-out duration-200"
|
|
883
|
-
enter-from-class="opacity-0 translate-y-4"
|
|
884
|
-
enter-to-class="opacity-100 translate-y-0"
|
|
885
|
-
leave-active-class="transition ease-in duration-150"
|
|
886
|
-
leave-from-class="opacity-100 translate-y-0"
|
|
887
|
-
leave-to-class="opacity-0 translate-y-4"
|
|
888
|
-
>
|
|
889
|
-
<div
|
|
890
|
-
v-if="floatingItem"
|
|
891
|
-
class="fixed z-[60] w-96 flex flex-col bg-card border border-card-line rounded-t-xl shadow-2xl overflow-hidden"
|
|
892
|
-
:style="{ ...floatingPanelStyle, maxHeight: 'min(480px, calc(100vh - 60px))' }"
|
|
893
|
-
>
|
|
894
|
-
<div class="flex items-center gap-2 px-3 py-2.5 border-b border-card-line shrink-0 bg-surface select-none">
|
|
895
|
-
<span class="size-6 rounded-full bg-primary flex items-center justify-center text-[10px] font-bold text-primary-foreground shrink-0">
|
|
896
|
-
{{ (floatingItem.label?.[0] ?? '?').toUpperCase() }}
|
|
897
|
-
</span>
|
|
898
|
-
<div class="flex-1 min-w-0">
|
|
899
|
-
<p class="text-sm font-semibold text-foreground truncate leading-tight">{{ floatingItem.label }}</p>
|
|
900
|
-
<p v-if="floatingItem.subtitle" class="text-xs text-muted-foreground truncate">{{ floatingItem.subtitle }}</p>
|
|
901
|
-
</div>
|
|
902
|
-
<button type="button" title="Expandir" class="inline-flex items-center justify-center size-6 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted-hover transition-colors" @click.stop="expandToFull(floatingItem)">
|
|
903
|
-
<IconMaximize class="size-3.5" />
|
|
904
|
-
</button>
|
|
905
|
-
<button type="button" title="Minimizar" class="inline-flex items-center justify-center size-6 rounded-md text-muted-foreground hover:text-foreground hover:bg-muted-hover transition-colors" @click.stop="collapseDock()">
|
|
906
|
-
<IconMinus class="size-3.5" />
|
|
907
|
-
</button>
|
|
908
|
-
<button type="button" title="Cerrar" class="inline-flex items-center justify-center size-6 rounded-md text-muted-foreground hover:text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20 transition-colors" @click.stop="undockItem(floatingItem.id)">
|
|
909
|
-
<IconX class="size-3.5" />
|
|
910
|
-
</button>
|
|
911
|
-
</div>
|
|
912
|
-
<div class="flex-1 overflow-y-auto min-h-0">
|
|
913
|
-
<slot name="preview" :row="floatingItem.row" :close="() => undockItem(floatingItem.id)" />
|
|
914
|
-
</div>
|
|
915
|
-
</div>
|
|
916
|
-
</Transition>
|
|
917
|
-
</Teleport>
|
|
918
663
|
|
|
919
664
|
<!-- Filter menu — teleported to body -->
|
|
920
665
|
<Teleport to="body">
|
|
@@ -929,7 +674,7 @@ defineExpose({ getSelectedRows, reload, clearCache, exportTable, tableRef, close
|
|
|
929
674
|
<div
|
|
930
675
|
v-if="showFilterPanel"
|
|
931
676
|
ref="filterMenuRef"
|
|
932
|
-
class="fixed z-[60] bg-dropdown border border-dropdown-line rounded-
|
|
677
|
+
class="fixed z-[60] bg-dropdown border border-dropdown-line rounded-popover shadow-2xl overflow-hidden"
|
|
933
678
|
:style="filterMenuStyle"
|
|
934
679
|
>
|
|
935
680
|
|
|
@@ -967,7 +712,7 @@ defineExpose({ getSelectedRows, reload, clearCache, exportTable, tableRef, close
|
|
|
967
712
|
<button
|
|
968
713
|
type="button"
|
|
969
714
|
@click.stop="filterMenuStep = 'columns'"
|
|
970
|
-
class="inline-flex items-center justify-center size-6 rounded-
|
|
715
|
+
class="inline-flex items-center justify-center size-6 rounded-control text-muted-foreground hover:text-foreground hover:bg-muted-hover transition-colors shrink-0"
|
|
971
716
|
>
|
|
972
717
|
<IconChevronLeft class="size-4" />
|
|
973
718
|
</button>
|
|
@@ -977,13 +722,13 @@ defineExpose({ getSelectedRows, reload, clearCache, exportTable, tableRef, close
|
|
|
977
722
|
<select
|
|
978
723
|
v-if="pendingCol.filterType === 'text'"
|
|
979
724
|
v-model="pendingOperator"
|
|
980
|
-
class="ml-auto text-xs bg-dropdown border border-dropdown-line rounded-
|
|
725
|
+
class="ml-auto text-xs bg-dropdown border border-dropdown-line rounded-control px-2 py-1 text-muted-foreground focus:outline-none focus:ring-1 focus:ring-primary/50 cursor-pointer"
|
|
981
726
|
>
|
|
982
727
|
<option v-for="op in textOps" :key="op.value" :value="op.value">{{ op.label }}</option>
|
|
983
728
|
</select>
|
|
984
729
|
|
|
985
730
|
<!-- Operator: segmented toggle for select (es / no es) -->
|
|
986
|
-
<div v-else-if="pendingCol.filterType === 'select'" class="ml-auto flex rounded-
|
|
731
|
+
<div v-else-if="pendingCol.filterType === 'select'" class="ml-auto flex rounded-control border border-dropdown-line overflow-hidden text-xs">
|
|
987
732
|
<button
|
|
988
733
|
v-for="op in selectOps"
|
|
989
734
|
:key="op.value"
|
|
@@ -1004,7 +749,7 @@ defineExpose({ getSelectedRows, reload, clearCache, exportTable, tableRef, close
|
|
|
1004
749
|
<select
|
|
1005
750
|
v-else-if="pendingCol.filterType === 'daterange'"
|
|
1006
751
|
v-model="pendingDateOp"
|
|
1007
|
-
class="ml-auto text-xs bg-dropdown border border-dropdown-line rounded-
|
|
752
|
+
class="ml-auto text-xs bg-dropdown border border-dropdown-line rounded-control px-2 py-1 text-muted-foreground focus:outline-none focus:ring-1 focus:ring-primary/50 cursor-pointer"
|
|
1008
753
|
>
|
|
1009
754
|
<option v-for="op in dateOps" :key="op.value" :value="op.value">{{ op.label }}</option>
|
|
1010
755
|
</select>
|
|
@@ -1021,7 +766,7 @@ defineExpose({ getSelectedRows, reload, clearCache, exportTable, tableRef, close
|
|
|
1021
766
|
@keydown.enter.stop="applyPendingFilter"
|
|
1022
767
|
@keydown.escape.stop="closeFilterMenu"
|
|
1023
768
|
placeholder="Valor..."
|
|
1024
|
-
class="w-full rounded-
|
|
769
|
+
class="w-full rounded-control border border-dropdown-line bg-card text-foreground py-1.5 px-3 text-sm focus:outline-none focus:ring-1 focus:ring-primary/60 focus:border-primary"
|
|
1025
770
|
/>
|
|
1026
771
|
|
|
1027
772
|
<!-- ── SELECT ── -->
|
|
@@ -1032,7 +777,7 @@ defineExpose({ getSelectedRows, reload, clearCache, exportTable, tableRef, close
|
|
|
1032
777
|
type="button"
|
|
1033
778
|
@click.stop="pendingValue = opt.value; applyPendingFilter()"
|
|
1034
779
|
:class="[
|
|
1035
|
-
'w-full flex items-center gap-2 px-2.5 py-2 text-sm rounded-
|
|
780
|
+
'w-full flex items-center gap-2 px-2.5 py-2 text-sm rounded-control transition-colors text-left',
|
|
1036
781
|
pendingValue === opt.value
|
|
1037
782
|
? 'bg-primary/10 text-primary'
|
|
1038
783
|
: 'hover:bg-muted-hover text-foreground'
|
|
@@ -1046,10 +791,10 @@ defineExpose({ getSelectedRows, reload, clearCache, exportTable, tableRef, close
|
|
|
1046
791
|
<!-- ── DATERANGE ── -->
|
|
1047
792
|
<template v-else-if="pendingCol.filterType === 'daterange'">
|
|
1048
793
|
<template v-if="pendingDateOp === 'between'">
|
|
1049
|
-
<input type="date" v-model="pendingValue.from" class="w-full rounded-
|
|
1050
|
-
<input type="date" v-model="pendingValue.to" class="w-full rounded-
|
|
794
|
+
<input type="date" v-model="pendingValue.from" class="w-full rounded-control border border-dropdown-line bg-card text-foreground py-1.5 px-3 text-sm focus:outline-none focus:ring-1 focus:ring-primary/60" />
|
|
795
|
+
<input type="date" v-model="pendingValue.to" class="w-full rounded-control border border-dropdown-line bg-card text-foreground py-1.5 px-3 text-sm focus:outline-none focus:ring-1 focus:ring-primary/60" />
|
|
1051
796
|
</template>
|
|
1052
|
-
<input v-else type="date" v-model="pendingValue.singleDate" class="w-full rounded-
|
|
797
|
+
<input v-else type="date" v-model="pendingValue.singleDate" class="w-full rounded-control border border-dropdown-line bg-card text-foreground py-1.5 px-3 text-sm focus:outline-none focus:ring-1 focus:ring-primary/60" />
|
|
1053
798
|
</template>
|
|
1054
799
|
|
|
1055
800
|
<!-- Apply (not for select — auto-applies on click) -->
|
|
@@ -1057,7 +802,7 @@ defineExpose({ getSelectedRows, reload, clearCache, exportTable, tableRef, close
|
|
|
1057
802
|
v-if="pendingCol.filterType !== 'select'"
|
|
1058
803
|
type="button"
|
|
1059
804
|
@click.stop="applyPendingFilter"
|
|
1060
|
-
class="w-full py-1.5 text-sm font-medium rounded-
|
|
805
|
+
class="w-full py-1.5 text-sm font-medium rounded-control bg-primary text-white hover:bg-primary/90 active:bg-primary/80 transition-colors"
|
|
1061
806
|
>
|
|
1062
807
|
Aplicar
|
|
1063
808
|
</button>
|
|
@@ -1082,7 +827,7 @@ defineExpose({ getSelectedRows, reload, clearCache, exportTable, tableRef, close
|
|
|
1082
827
|
<div
|
|
1083
828
|
v-if="showColumnPanel"
|
|
1084
829
|
ref="columnPanelRef"
|
|
1085
|
-
class="fixed z-50 bg-dropdown border border-dropdown-line rounded-
|
|
830
|
+
class="fixed z-50 bg-dropdown border border-dropdown-line rounded-popover shadow-2xl min-w-64 max-h-[480px] overflow-y-auto"
|
|
1086
831
|
:style="columnPanelStyle"
|
|
1087
832
|
>
|
|
1088
833
|
|
|
@@ -1093,7 +838,7 @@ defineExpose({ getSelectedRows, reload, clearCache, exportTable, tableRef, close
|
|
|
1093
838
|
Fija a la izquierda
|
|
1094
839
|
</p>
|
|
1095
840
|
<div
|
|
1096
|
-
class="rounded-
|
|
841
|
+
class="rounded-control min-h-[34px] transition-colors"
|
|
1097
842
|
:class="dragOverSection === 'left' && draggedKey && !columnsBySection.left.find(c => c.key === draggedKey)
|
|
1098
843
|
? 'bg-indigo-50 dark:bg-indigo-900/20 ring-1 ring-indigo-300 dark:ring-indigo-700'
|
|
1099
844
|
: columnsBySection.left.length === 0 ? 'border border-dashed border-card-line' : ''"
|
|
@@ -1112,7 +857,7 @@ defineExpose({ getSelectedRows, reload, clearCache, exportTable, tableRef, close
|
|
|
1112
857
|
@dragover.prevent="dragOverSection = 'left'; dragOverKey = col.key"
|
|
1113
858
|
@dragleave="dragOverKey = null"
|
|
1114
859
|
@drop.stop="onDrop(col.key, 'left')"
|
|
1115
|
-
class="flex items-center gap-2 py-1.5 px-2 rounded-
|
|
860
|
+
class="flex items-center gap-2 py-1.5 px-2 rounded-control select-none cursor-grab transition-colors"
|
|
1116
861
|
:class="dragOverKey === col.key ? 'bg-indigo-50 dark:bg-indigo-900/20' : 'hover:bg-muted-hover'"
|
|
1117
862
|
>
|
|
1118
863
|
<IconGripVertical class="size-4 text-muted-foreground-2 shrink-0" />
|
|
@@ -1138,7 +883,7 @@ defineExpose({ getSelectedRows, reload, clearCache, exportTable, tableRef, close
|
|
|
1138
883
|
Columnas
|
|
1139
884
|
</p>
|
|
1140
885
|
<div
|
|
1141
|
-
class="rounded-
|
|
886
|
+
class="rounded-control min-h-[34px] transition-colors"
|
|
1142
887
|
:class="dragOverSection === 'center' && draggedKey && !columnsBySection.center.find(c => c.key === draggedKey)
|
|
1143
888
|
? 'bg-muted/60 ring-1 ring-border'
|
|
1144
889
|
: ''"
|
|
@@ -1157,7 +902,7 @@ defineExpose({ getSelectedRows, reload, clearCache, exportTable, tableRef, close
|
|
|
1157
902
|
@dragover.prevent="dragOverSection = 'center'; dragOverKey = col.key"
|
|
1158
903
|
@dragleave="dragOverKey = null"
|
|
1159
904
|
@drop.stop="onDrop(col.key, 'center')"
|
|
1160
|
-
class="flex items-center gap-2 py-1.5 px-2 rounded-
|
|
905
|
+
class="flex items-center gap-2 py-1.5 px-2 rounded-control select-none cursor-grab transition-colors"
|
|
1161
906
|
:class="dragOverKey === col.key ? 'bg-blue-50 dark:bg-blue-900/20 ring-1 ring-blue-200 dark:ring-blue-700' : 'hover:bg-muted-hover'"
|
|
1162
907
|
>
|
|
1163
908
|
<IconGripVertical class="size-4 text-muted-foreground-2 shrink-0" />
|
|
@@ -1182,7 +927,7 @@ defineExpose({ getSelectedRows, reload, clearCache, exportTable, tableRef, close
|
|
|
1182
927
|
Fija a la derecha
|
|
1183
928
|
</p>
|
|
1184
929
|
<div
|
|
1185
|
-
class="rounded-
|
|
930
|
+
class="rounded-control min-h-[34px] transition-colors"
|
|
1186
931
|
:class="dragOverSection === 'right' && draggedKey && !columnsBySection.right.find(c => c.key === draggedKey)
|
|
1187
932
|
? 'bg-amber-50 dark:bg-amber-900/20 ring-1 ring-amber-300 dark:ring-amber-700'
|
|
1188
933
|
: columnsBySection.right.length === 0 ? 'border border-dashed border-card-line' : ''"
|
|
@@ -1201,7 +946,7 @@ defineExpose({ getSelectedRows, reload, clearCache, exportTable, tableRef, close
|
|
|
1201
946
|
@dragover.prevent="dragOverSection = 'right'; dragOverKey = col.key"
|
|
1202
947
|
@dragleave="dragOverKey = null"
|
|
1203
948
|
@drop.stop="onDrop(col.key, 'right')"
|
|
1204
|
-
class="flex items-center gap-2 py-1.5 px-2 rounded-
|
|
949
|
+
class="flex items-center gap-2 py-1.5 px-2 rounded-control select-none cursor-grab transition-colors"
|
|
1205
950
|
:class="dragOverKey === col.key ? 'bg-amber-50 dark:bg-amber-900/20' : 'hover:bg-muted-hover'"
|
|
1206
951
|
>
|
|
1207
952
|
<IconGripVertical class="size-4 text-muted-foreground-2 shrink-0" />
|