@datagouv/components-next 1.0.2-dev.172 → 1.0.2-dev.174
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/dist/{Datafair.client-CES67S3v.js → Datafair.client-BU2gspr8.js} +9 -9
- package/dist/ImagePreview.client-BU5QNqG_.js +36 -0
- package/dist/{JsonPreview.client-DtCw5aCA.js → JsonPreview.client-CvOpMCxW.js} +2 -2
- package/dist/{MapContainer.client-Q3TmXpPR.js → MapContainer.client-DNOQ5XTT.js} +9 -9
- package/dist/{PdfPreview.client-BXJzS-Hm.js → PdfPreview.client-DwAvLLq_.js} +438 -427
- package/dist/{Pmtiles.client-DNiYcHH3.js → Pmtiles.client-CgaDrCHk.js} +1341 -1337
- package/dist/PreviewWrapper.vue_vue_type_script_setup_true_lang-CrWEJnPl.js +60 -0
- package/dist/{XmlPreview.client-CPfIZl9q.js → XmlPreview.client-B24FIhU7.js} +3 -3
- package/dist/components-next.css +1 -1
- package/dist/components-next.js +144 -138
- package/dist/components.css +1 -1
- package/dist/{index-CXeG6J6C.js → index-Dw1lR0oe.js} +1 -1
- package/dist/{leaflet-src-BwEce6uO.js → leaflet-src-BoMqG6Yx.js} +1 -1
- package/dist/{main-D7EaQcIR.js → main-I9G-L-lg.js} +16280 -15511
- package/dist/{vue3-xml-viewer.common-DznVepCg.js → vue3-xml-viewer.common-PTUJZpH4.js} +1 -1
- package/package.json +1 -1
- package/src/components/AppLink.vue +3 -0
- package/src/components/CopyButton.vue +6 -2
- package/src/components/ResourceAccordion/Datafair.client.vue +1 -1
- package/src/components/ResourceAccordion/ImagePreview.client.vue +3 -3
- package/src/components/ResourceAccordion/MapContainer.client.vue +1 -8
- package/src/components/ResourceAccordion/PdfPreview.client.vue +36 -12
- package/src/components/ResourceAccordion/PdfSkeleton.vue +44 -0
- package/src/components/ResourceAccordion/Pmtiles.client.vue +25 -12
- package/src/components/ResourceAccordion/PreviewWrapper.vue +17 -10
- package/src/components/ResourceAccordion/ResourceAccordion.vue +4 -1
- package/src/components/ResourceExplorer/ResourceExplorer.vue +98 -209
- package/src/components/ResourceExplorer/ResourceExplorerHeader.vue +74 -0
- package/src/components/ResourceExplorer/ResourceExplorerSidebar.vue +103 -71
- package/src/components/ResourceExplorer/ResourceExplorerViewer.vue +123 -187
- package/src/components/ResourceExplorer/ResourceMainAction.vue +240 -0
- package/src/components/ResourceExplorer/ResourceSelector.vue +24 -86
- package/src/components/ResourceExplorer/ResourceViewerHeader.vue +115 -0
- package/src/components/ResourceExplorer/ResourceViewerSkeleton.vue +94 -0
- package/src/components/ResourceListItem.vue +154 -0
- package/src/components/TabularExplorer/TabularActiveFilters.vue +79 -0
- package/src/components/TabularExplorer/TabularCell.vue +2 -4
- package/src/components/TabularExplorer/TabularColumnsMenu.vue +112 -0
- package/src/components/TabularExplorer/TabularExplorer.vue +68 -995
- package/src/components/TabularExplorer/TabularFilterContent.vue +2 -10
- package/src/components/TabularExplorer/TabularFilterPopover.vue +5 -6
- package/src/components/TabularExplorer/TabularMobileFilterButton.vue +21 -0
- package/src/components/TabularExplorer/TabularMobileFilters.vue +150 -0
- package/src/components/TabularExplorer/TabularRowsInfo.vue +31 -0
- package/src/components/TabularExplorer/TabularSkeleton.vue +92 -0
- package/src/components/TabularExplorer/TabularTable.vue +481 -0
- package/src/components/TabularExplorer/TabularToolbar.vue +25 -0
- package/src/components/TabularExplorer/types.ts +0 -5
- package/src/components/TabularExplorer/useColumnMetadata.ts +98 -0
- package/src/components/TabularExplorer/useTabularContext.ts +82 -0
- package/src/composables/useDatasetResources.ts +164 -0
- package/src/composables/useResizable.ts +46 -0
- package/src/composables/useResourceCapabilities.ts +20 -7
- package/src/functions/resources.ts +19 -0
- package/src/main.ts +8 -0
- package/dist/ImagePreview.client-c_SJXLpr.js +0 -36
- package/dist/PreviewWrapper.vue_vue_type_script_setup_true_lang-B3ByRwHK.js +0 -58
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<Popover
|
|
3
|
+
ref="columnAnchor"
|
|
4
|
+
v-slot="{ open }"
|
|
5
|
+
class="relative"
|
|
6
|
+
>
|
|
7
|
+
<PopoverButton class="flex items-center gap-1.5 text-xs text-gray-plain rounded px-2 py-1 hover:bg-gray-50 focus:outline-none">
|
|
8
|
+
<RiLayoutColumnLine
|
|
9
|
+
class="size-3"
|
|
10
|
+
aria-hidden="true"
|
|
11
|
+
/>
|
|
12
|
+
<span class="font-bold hidden md:inline">{{ t('Colonnes') }}</span>
|
|
13
|
+
<span class="font-mono tabular-nums">{{ visibleColumns.size }}/{{ allColumns.length }}</span>
|
|
14
|
+
<RiArrowDownSLine
|
|
15
|
+
class="size-3 opacity-50"
|
|
16
|
+
aria-hidden="true"
|
|
17
|
+
/>
|
|
18
|
+
</PopoverButton>
|
|
19
|
+
|
|
20
|
+
<ClientOnly>
|
|
21
|
+
<Teleport to="#tooltips">
|
|
22
|
+
<PopoverPanel
|
|
23
|
+
v-show="open"
|
|
24
|
+
ref="columnPanel"
|
|
25
|
+
static
|
|
26
|
+
class="bg-white border border-gray-default rounded shadow-lg w-72 absolute z-[800]"
|
|
27
|
+
:style="columnFloatingStyles"
|
|
28
|
+
>
|
|
29
|
+
<div class="px-3 py-2 border-b border-gray-default space-y-1.5">
|
|
30
|
+
<span class="block text-xs font-medium text-gray-title">
|
|
31
|
+
{{ visibleColumns.size }} {{ t('sur') }} {{ allColumns.length }} {{ t('colonnes visibles') }}
|
|
32
|
+
</span>
|
|
33
|
+
<div class="flex items-center gap-1">
|
|
34
|
+
<BrandedButton
|
|
35
|
+
v-if="hiddenCount"
|
|
36
|
+
color="tertiary"
|
|
37
|
+
size="2xs"
|
|
38
|
+
@click="showAllColumns"
|
|
39
|
+
>
|
|
40
|
+
{{ t('Tout afficher') }}
|
|
41
|
+
</BrandedButton>
|
|
42
|
+
<BrandedButton
|
|
43
|
+
v-if="visibleColumns.size > 0"
|
|
44
|
+
color="tertiary"
|
|
45
|
+
size="2xs"
|
|
46
|
+
@click="hideAllColumns"
|
|
47
|
+
>
|
|
48
|
+
{{ t('Tout masquer') }}
|
|
49
|
+
</BrandedButton>
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
<div class="max-h-64 overflow-auto p-1">
|
|
53
|
+
<div
|
|
54
|
+
v-for="col in allColumns"
|
|
55
|
+
:key="col"
|
|
56
|
+
class="group/col flex items-center gap-2 px-2 py-1.5 rounded hover:bg-gray-50 text-xs"
|
|
57
|
+
>
|
|
58
|
+
<label class="flex items-center gap-2 flex-1 min-w-0 cursor-pointer">
|
|
59
|
+
<input
|
|
60
|
+
type="checkbox"
|
|
61
|
+
:checked="visibleColumns.has(col)"
|
|
62
|
+
class="size-3.5 accent-new-primary"
|
|
63
|
+
@change="toggleColumn(col)"
|
|
64
|
+
>
|
|
65
|
+
<span class="truncate">{{ col }}</span>
|
|
66
|
+
</label>
|
|
67
|
+
<button
|
|
68
|
+
class="shrink-0 px-1 text-new-primary hover:underline hidden group-hover/col:block group-focus-within/col:block"
|
|
69
|
+
@click="selectOnlyColumn(col)"
|
|
70
|
+
>
|
|
71
|
+
{{ t('Uniquement') }}
|
|
72
|
+
</button>
|
|
73
|
+
</div>
|
|
74
|
+
</div>
|
|
75
|
+
</PopoverPanel>
|
|
76
|
+
</Teleport>
|
|
77
|
+
</ClientOnly>
|
|
78
|
+
</Popover>
|
|
79
|
+
</template>
|
|
80
|
+
|
|
81
|
+
<script setup lang="ts">
|
|
82
|
+
import { computed, useTemplateRef } from 'vue'
|
|
83
|
+
import { autoUpdate, flip, shift, useFloating } from '@floating-ui/vue'
|
|
84
|
+
import { Popover, PopoverButton, PopoverPanel } from '@headlessui/vue'
|
|
85
|
+
import { RiArrowDownSLine, RiLayoutColumnLine } from '@remixicon/vue'
|
|
86
|
+
import ClientOnly from '../ClientOnly.vue'
|
|
87
|
+
import BrandedButton from '../BrandedButton.vue'
|
|
88
|
+
import { useTranslation } from '../../composables/useTranslation'
|
|
89
|
+
import { useTabularContext } from './useTabularContext'
|
|
90
|
+
|
|
91
|
+
const { t } = useTranslation()
|
|
92
|
+
const {
|
|
93
|
+
allColumns,
|
|
94
|
+
visibleColumns,
|
|
95
|
+
hiddenCount,
|
|
96
|
+
toggleColumn,
|
|
97
|
+
showAllColumns,
|
|
98
|
+
hideAllColumns,
|
|
99
|
+
selectOnlyColumn,
|
|
100
|
+
} = useTabularContext()
|
|
101
|
+
|
|
102
|
+
// The panel is teleported, so it's positioned against its trigger with floating-ui.
|
|
103
|
+
const columnAnchor = useTemplateRef<InstanceType<typeof Popover>>('columnAnchor')
|
|
104
|
+
const columnPanel = useTemplateRef<InstanceType<typeof PopoverPanel>>('columnPanel')
|
|
105
|
+
const columnAnchorEl = computed(() => columnAnchor.value?.$el as HTMLElement | undefined)
|
|
106
|
+
const columnPanelEl = computed(() => columnPanel.value?.$el as HTMLElement | undefined)
|
|
107
|
+
const { floatingStyles: columnFloatingStyles } = useFloating(columnAnchorEl, columnPanelEl, {
|
|
108
|
+
placement: 'bottom-start',
|
|
109
|
+
middleware: [flip(), shift()],
|
|
110
|
+
whileElementsMounted: autoUpdate,
|
|
111
|
+
})
|
|
112
|
+
</script>
|