@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.
Files changed (57) hide show
  1. package/dist/{Datafair.client-CES67S3v.js → Datafair.client-BU2gspr8.js} +9 -9
  2. package/dist/ImagePreview.client-BU5QNqG_.js +36 -0
  3. package/dist/{JsonPreview.client-DtCw5aCA.js → JsonPreview.client-CvOpMCxW.js} +2 -2
  4. package/dist/{MapContainer.client-Q3TmXpPR.js → MapContainer.client-DNOQ5XTT.js} +9 -9
  5. package/dist/{PdfPreview.client-BXJzS-Hm.js → PdfPreview.client-DwAvLLq_.js} +438 -427
  6. package/dist/{Pmtiles.client-DNiYcHH3.js → Pmtiles.client-CgaDrCHk.js} +1341 -1337
  7. package/dist/PreviewWrapper.vue_vue_type_script_setup_true_lang-CrWEJnPl.js +60 -0
  8. package/dist/{XmlPreview.client-CPfIZl9q.js → XmlPreview.client-B24FIhU7.js} +3 -3
  9. package/dist/components-next.css +1 -1
  10. package/dist/components-next.js +144 -138
  11. package/dist/components.css +1 -1
  12. package/dist/{index-CXeG6J6C.js → index-Dw1lR0oe.js} +1 -1
  13. package/dist/{leaflet-src-BwEce6uO.js → leaflet-src-BoMqG6Yx.js} +1 -1
  14. package/dist/{main-D7EaQcIR.js → main-I9G-L-lg.js} +16280 -15511
  15. package/dist/{vue3-xml-viewer.common-DznVepCg.js → vue3-xml-viewer.common-PTUJZpH4.js} +1 -1
  16. package/package.json +1 -1
  17. package/src/components/AppLink.vue +3 -0
  18. package/src/components/CopyButton.vue +6 -2
  19. package/src/components/ResourceAccordion/Datafair.client.vue +1 -1
  20. package/src/components/ResourceAccordion/ImagePreview.client.vue +3 -3
  21. package/src/components/ResourceAccordion/MapContainer.client.vue +1 -8
  22. package/src/components/ResourceAccordion/PdfPreview.client.vue +36 -12
  23. package/src/components/ResourceAccordion/PdfSkeleton.vue +44 -0
  24. package/src/components/ResourceAccordion/Pmtiles.client.vue +25 -12
  25. package/src/components/ResourceAccordion/PreviewWrapper.vue +17 -10
  26. package/src/components/ResourceAccordion/ResourceAccordion.vue +4 -1
  27. package/src/components/ResourceExplorer/ResourceExplorer.vue +98 -209
  28. package/src/components/ResourceExplorer/ResourceExplorerHeader.vue +74 -0
  29. package/src/components/ResourceExplorer/ResourceExplorerSidebar.vue +103 -71
  30. package/src/components/ResourceExplorer/ResourceExplorerViewer.vue +123 -187
  31. package/src/components/ResourceExplorer/ResourceMainAction.vue +240 -0
  32. package/src/components/ResourceExplorer/ResourceSelector.vue +24 -86
  33. package/src/components/ResourceExplorer/ResourceViewerHeader.vue +115 -0
  34. package/src/components/ResourceExplorer/ResourceViewerSkeleton.vue +94 -0
  35. package/src/components/ResourceListItem.vue +154 -0
  36. package/src/components/TabularExplorer/TabularActiveFilters.vue +79 -0
  37. package/src/components/TabularExplorer/TabularCell.vue +2 -4
  38. package/src/components/TabularExplorer/TabularColumnsMenu.vue +112 -0
  39. package/src/components/TabularExplorer/TabularExplorer.vue +68 -995
  40. package/src/components/TabularExplorer/TabularFilterContent.vue +2 -10
  41. package/src/components/TabularExplorer/TabularFilterPopover.vue +5 -6
  42. package/src/components/TabularExplorer/TabularMobileFilterButton.vue +21 -0
  43. package/src/components/TabularExplorer/TabularMobileFilters.vue +150 -0
  44. package/src/components/TabularExplorer/TabularRowsInfo.vue +31 -0
  45. package/src/components/TabularExplorer/TabularSkeleton.vue +92 -0
  46. package/src/components/TabularExplorer/TabularTable.vue +481 -0
  47. package/src/components/TabularExplorer/TabularToolbar.vue +25 -0
  48. package/src/components/TabularExplorer/types.ts +0 -5
  49. package/src/components/TabularExplorer/useColumnMetadata.ts +98 -0
  50. package/src/components/TabularExplorer/useTabularContext.ts +82 -0
  51. package/src/composables/useDatasetResources.ts +164 -0
  52. package/src/composables/useResizable.ts +46 -0
  53. package/src/composables/useResourceCapabilities.ts +20 -7
  54. package/src/functions/resources.ts +19 -0
  55. package/src/main.ts +8 -0
  56. package/dist/ImagePreview.client-c_SJXLpr.js +0 -36
  57. 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>