@datagouv/components-next 0.2.0 → 1.0.0

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 (140) hide show
  1. package/README.md +1 -1
  2. package/assets/main.css +56 -1
  3. package/dist/Control-BNCDn-8E.js +148 -0
  4. package/dist/{Datafair.client-x39O4yfF.js → Datafair.client-Dls5AHTE.js} +1 -1
  5. package/dist/Event-BOgJUhNR.js +738 -0
  6. package/dist/Image-BN-4XkIn.js +247 -0
  7. package/dist/{JsonPreview.client-BMsC5JcY.js → JsonPreview.client-DPDTs433.js} +14 -14
  8. package/dist/Map-BdT3i2C4.js +7609 -0
  9. package/dist/MapContainer.client-BdAzd7bj.js +105 -0
  10. package/dist/OSM-CamriM9b.js +71 -0
  11. package/dist/{PdfPreview.client-COOkEkRA.js → PdfPreview.client-CopqSDyt.js} +3 -3
  12. package/dist/{Pmtiles.client-BaiIo4VZ.js → Pmtiles.client-mF6xaOO_.js} +2 -2
  13. package/dist/ScaleLine-BiesrgOv.js +165 -0
  14. package/dist/Swagger.client-eJ7gpfZA.js +4 -0
  15. package/dist/Tile-DCuqwNOI.js +1206 -0
  16. package/dist/TileImage-CmZf8EdU.js +1067 -0
  17. package/dist/View-DcDc7N2K.js +2858 -0
  18. package/dist/{XmlPreview.client-CAdN0w_Y.js → XmlPreview.client-C0OgBkSq.js} +7 -7
  19. package/dist/common-C4rDcQpp.js +243 -0
  20. package/dist/components-next.css +1 -1
  21. package/dist/components-next.js +153 -117
  22. package/dist/components.css +1 -1
  23. package/dist/{MapContainer.client-DeSo8EvG.js → index-BRGqW8aQ.js} +4975 -21416
  24. package/dist/leaflet-src-7m1mB8LI.js +6338 -0
  25. package/dist/{main-Dgri3TQL.js → main-CNHxAJ8J.js} +56758 -51450
  26. package/dist/proj-CKwYjU38.js +1569 -0
  27. package/dist/tilecoord-YW3qEH_j.js +884 -0
  28. package/dist/{vue3-xml-viewer.common-D6skc_Ai.js → vue3-xml-viewer.common-CmAdQfIy.js} +1 -1
  29. package/package.json +5 -1
  30. package/src/components/ActivityList/ActivityList.vue +6 -2
  31. package/src/components/AppLink.vue +4 -1
  32. package/src/components/Avatar.vue +2 -2
  33. package/src/components/AvatarWithName.vue +8 -4
  34. package/src/components/BouncingDots.vue +21 -0
  35. package/src/components/BrandedButton.vue +2 -0
  36. package/src/components/CopyButton.vue +19 -7
  37. package/src/components/DataserviceCard.vue +83 -118
  38. package/src/components/DatasetCard.vue +110 -171
  39. package/src/components/DatasetInformation/DatasetEmbedSection.vue +43 -0
  40. package/src/components/DatasetInformation/DatasetInformationSection.vue +73 -0
  41. package/src/components/DatasetInformation/DatasetSchemaSection.vue +74 -0
  42. package/src/components/DatasetInformation/DatasetSpatialSection.vue +59 -0
  43. package/src/components/DatasetInformation/DatasetTemporalitySection.vue +45 -0
  44. package/src/components/DatasetInformation/index.ts +5 -0
  45. package/src/components/DatasetQualityTooltipContent.vue +3 -3
  46. package/src/components/DescriptionList.vue +1 -4
  47. package/src/components/DescriptionListDetails.vue +5 -0
  48. package/src/components/DescriptionListTerm.vue +5 -0
  49. package/src/components/DiscussionMessageCard.vue +63 -0
  50. package/src/components/ExtraAccordion.vue +4 -4
  51. package/src/components/Form/BadgeSelect.vue +35 -0
  52. package/src/components/Form/FormatSelect.vue +28 -0
  53. package/src/components/Form/GeozoneSelect.vue +52 -0
  54. package/src/components/Form/GranularitySelect.vue +29 -0
  55. package/src/components/Form/LicenseSelect.vue +30 -0
  56. package/src/components/Form/OrganizationSelect.vue +62 -0
  57. package/src/components/Form/OrganizationTypeSelect.vue +34 -0
  58. package/src/components/Form/ReuseTopicSelect.vue +29 -0
  59. package/src/components/Form/SchemaSelect.vue +30 -0
  60. package/src/components/Form/SearchableSelect.vue +334 -0
  61. package/src/components/Form/SelectGroup.vue +132 -0
  62. package/src/components/Form/TagSelect.vue +38 -0
  63. package/src/components/LeafletMap.vue +31 -0
  64. package/src/components/LicenseBadge.vue +24 -0
  65. package/src/components/LoadingBlock.vue +23 -2
  66. package/src/components/MarkdownViewer.vue +3 -1
  67. package/src/components/ObjectCard.vue +42 -0
  68. package/src/components/ObjectCardBadge.vue +22 -0
  69. package/src/components/ObjectCardHeader.vue +35 -0
  70. package/src/components/ObjectCardOwner.vue +43 -0
  71. package/src/components/ObjectCardShortDescription.vue +28 -0
  72. package/src/components/OrganizationCard.vue +35 -20
  73. package/src/components/OrganizationLogo.vue +1 -1
  74. package/src/components/OrganizationNameWithCertificate.vue +13 -7
  75. package/src/components/OwnerTypeIcon.vue +1 -0
  76. package/src/components/Pagination.vue +1 -1
  77. package/src/components/Placeholder.vue +5 -2
  78. package/src/components/PostCard.vue +62 -0
  79. package/src/components/RadioGroup.vue +32 -0
  80. package/src/components/RadioInput.vue +64 -0
  81. package/src/components/ResourceAccordion/EditButton.vue +2 -3
  82. package/src/components/ResourceAccordion/MapContainer.client.vue +20 -16
  83. package/src/components/ResourceAccordion/Metadata.vue +11 -24
  84. package/src/components/ResourceAccordion/Pmtiles.client.vue +1 -1
  85. package/src/components/ResourceAccordion/Preview.vue +1 -1
  86. package/src/components/ResourceAccordion/ResourceAccordion.vue +30 -20
  87. package/src/components/ResourceAccordion/ResourceIcon.vue +1 -0
  88. package/src/components/ResourceAccordion/SchemaBadge.vue +2 -2
  89. package/src/components/ResourceExplorer/ResourceExplorer.vue +243 -0
  90. package/src/components/ResourceExplorer/ResourceExplorerSidebar.vue +116 -0
  91. package/src/components/ResourceExplorer/ResourceExplorerViewer.vue +361 -0
  92. package/src/components/ReuseCard.vue +8 -28
  93. package/src/components/ReuseHorizontalCard.vue +80 -0
  94. package/src/components/Search/BasicAndAdvancedFilters.vue +49 -0
  95. package/src/components/Search/Filter/AccessTypeFilter.vue +37 -0
  96. package/src/components/Search/Filter/DatasetBadgeFilter.vue +40 -0
  97. package/src/components/Search/Filter/FilterButtonGroup.vue +78 -0
  98. package/src/components/Search/Filter/FormatFamilyFilter.vue +39 -0
  99. package/src/components/Search/Filter/LastUpdateRangeFilter.vue +37 -0
  100. package/src/components/Search/Filter/ProducerTypeFilter.vue +39 -0
  101. package/src/components/Search/Filter/ReuseTypeFilter.vue +42 -0
  102. package/src/components/Search/GlobalSearch.vue +611 -0
  103. package/src/components/Search/SearchInput.vue +63 -0
  104. package/src/components/Search/Sidemenu.vue +38 -0
  105. package/src/components/StatBox.vue +5 -5
  106. package/src/components/Tag.vue +30 -0
  107. package/src/components/Toggletip.vue +6 -2
  108. package/src/components/Tooltip.vue +2 -3
  109. package/src/components/TopicCard.vue +134 -0
  110. package/src/components/radioGroupContext.ts +9 -0
  111. package/src/composables/useDebouncedRef.ts +31 -0
  112. package/src/composables/useMetrics.ts +4 -3
  113. package/src/composables/useResourceCapabilities.ts +118 -0
  114. package/src/composables/useRouteQueryBoolean.ts +10 -0
  115. package/src/composables/useSelectModelSync.ts +89 -0
  116. package/src/composables/useStableQueryParams.ts +84 -0
  117. package/src/config.ts +4 -0
  118. package/src/functions/api.ts +17 -6
  119. package/src/functions/api.types.ts +4 -2
  120. package/src/functions/datasets.ts +1 -29
  121. package/src/functions/description.ts +33 -0
  122. package/src/functions/helpers.ts +11 -0
  123. package/src/functions/markdown.ts +60 -16
  124. package/src/functions/metrics.ts +33 -0
  125. package/src/functions/organizations.ts +5 -5
  126. package/src/main.ts +89 -7
  127. package/src/types/dataservices.ts +14 -12
  128. package/src/types/datasets.ts +20 -7
  129. package/src/types/discussions.ts +20 -0
  130. package/src/types/licenses.ts +3 -3
  131. package/src/types/organizations.ts +13 -1
  132. package/src/types/owned.ts +4 -2
  133. package/src/types/pages.ts +70 -0
  134. package/src/types/posts.ts +27 -0
  135. package/src/types/resources.ts +6 -0
  136. package/src/types/reuses.ts +14 -5
  137. package/src/types/search.ts +379 -0
  138. package/src/types/users.ts +12 -3
  139. package/dist/Swagger.client-CpLgaLg6.js +0 -4
  140. package/src/components/DatasetInformationPanel.vue +0 -211
@@ -0,0 +1,78 @@
1
+ <template>
2
+ <RadioGroup
3
+ :model-value="modelValue ?? ''"
4
+ :name="name"
5
+ :legend="label"
6
+ @update:model-value="emit('update:modelValue', $event === '' ? undefined : $event)"
7
+ >
8
+ <RadioInput
9
+ value=""
10
+ :count="totalCount"
11
+ :loading="loading"
12
+ >
13
+ {{ allLabel }}
14
+ </RadioInput>
15
+ <RadioInput
16
+ v-for="option in options"
17
+ :key="option.value"
18
+ :value="option.value"
19
+ :count="getCount(option.value)"
20
+ :loading="loading"
21
+ :highlighted="props.highlightActive && !!props.modelValue"
22
+ >
23
+ <span class="flex items-center gap-1 min-w-0 overflow-hidden">
24
+ <span
25
+ class="shrink min-w-0 truncate"
26
+ :title="option.description ? `${option.label} (${option.description})` : option.label"
27
+ >{{ option.label }}</span>
28
+ <span
29
+ v-if="option.description"
30
+ class="flex-1 basis-0 min-w-0 text-gray-400 text-xs truncate"
31
+ :title="option.description"
32
+ >
33
+ {{ option.description }}
34
+ </span>
35
+ </span>
36
+ </RadioInput>
37
+ </RadioGroup>
38
+ </template>
39
+
40
+ <script setup lang="ts">
41
+ import { computed } from 'vue'
42
+ import type { FacetItem } from '../../../types/search'
43
+ import RadioGroup from '../../RadioGroup.vue'
44
+ import RadioInput from '../../RadioInput.vue'
45
+
46
+ export interface FilterOption {
47
+ value: string
48
+ label: string
49
+ description?: string
50
+ }
51
+
52
+ const props = withDefaults(defineProps<{
53
+ modelValue: string | undefined
54
+ options: FilterOption[]
55
+ label: string
56
+ name: string
57
+ allLabel?: string
58
+ facets?: FacetItem[]
59
+ loading?: boolean
60
+ highlightActive?: boolean
61
+ }>(), {
62
+ allLabel: 'Tous',
63
+ loading: false,
64
+ highlightActive: false,
65
+ })
66
+
67
+ const emit = defineEmits<{
68
+ 'update:modelValue': [value: string | undefined]
69
+ }>()
70
+
71
+ function getCount(value: string): number | undefined {
72
+ if (!props.facets) return undefined
73
+ const facet = props.facets.find(f => f.name === value)
74
+ return facet?.count ?? 0
75
+ }
76
+
77
+ const totalCount = computed(() => getCount('all'))
78
+ </script>
@@ -0,0 +1,39 @@
1
+ <template>
2
+ <FilterButtonGroup
3
+ :model-value="modelValue"
4
+ :options="options"
5
+ :label="t('Format de données')"
6
+ :all-label="t('Tous')"
7
+ :facets="facets"
8
+ :loading="loading"
9
+ name="format_family"
10
+ highlight-active
11
+ @update:model-value="emit('update:modelValue', $event)"
12
+ />
13
+ </template>
14
+
15
+ <script setup lang="ts">
16
+ import type { FacetItem } from '../../../types/search'
17
+ import { useTranslation } from '../../../composables/useTranslation'
18
+ import FilterButtonGroup from './FilterButtonGroup.vue'
19
+
20
+ defineProps<{
21
+ modelValue: string | undefined
22
+ facets?: FacetItem[]
23
+ loading?: boolean
24
+ }>()
25
+
26
+ const emit = defineEmits<{
27
+ 'update:modelValue': [value: string | undefined]
28
+ }>()
29
+
30
+ const { t } = useTranslation()
31
+
32
+ const options = [
33
+ { value: 'tabular', label: t('Tabulaires'), description: 'csv, xls, xlsx, ods, parquet...' },
34
+ { value: 'machine_readable', label: t('Structurées'), description: 'json, rdf, xml, sql...' },
35
+ { value: 'geographical', label: t('Géographiques'), description: 'geojson, shp, kml...' },
36
+ { value: 'documents', label: t('Documents'), description: 'pdf, doc, docx, md, txt, html...' },
37
+ { value: 'other', label: t('Autre') },
38
+ ]
39
+ </script>
@@ -0,0 +1,37 @@
1
+ <template>
2
+ <FilterButtonGroup
3
+ :model-value="modelValue"
4
+ :options="options"
5
+ :label="t('Date de mise à jour')"
6
+ :all-label="t('Toutes')"
7
+ :facets="facets"
8
+ :loading="loading"
9
+ name="last_update_range"
10
+ highlight-active
11
+ @update:model-value="emit('update:modelValue', $event)"
12
+ />
13
+ </template>
14
+
15
+ <script setup lang="ts">
16
+ import type { FacetItem } from '../../../types/search'
17
+ import { useTranslation } from '../../../composables/useTranslation'
18
+ import FilterButtonGroup from './FilterButtonGroup.vue'
19
+
20
+ defineProps<{
21
+ modelValue: string | undefined
22
+ facets?: FacetItem[]
23
+ loading?: boolean
24
+ }>()
25
+
26
+ const emit = defineEmits<{
27
+ 'update:modelValue': [value: string | undefined]
28
+ }>()
29
+
30
+ const { t } = useTranslation()
31
+
32
+ const options = [
33
+ { value: 'last_30_days', label: t('Les 30 derniers jours') },
34
+ { value: 'last_12_months', label: t('Les 12 derniers mois') },
35
+ { value: 'last_3_years', label: t('Les 3 dernières années') },
36
+ ]
37
+ </script>
@@ -0,0 +1,39 @@
1
+ <template>
2
+ <FilterButtonGroup
3
+ :model-value="modelValue"
4
+ :options="options"
5
+ :label="t(`Type d'organisation`)"
6
+ :all-label="t('Toutes')"
7
+ :facets="facets"
8
+ :loading="loading"
9
+ name="producer_type"
10
+ highlight-active
11
+ @update:model-value="emit('update:modelValue', $event)"
12
+ />
13
+ </template>
14
+
15
+ <script setup lang="ts">
16
+ import type { FacetItem } from '../../../types/search'
17
+ import { useTranslation } from '../../../composables/useTranslation'
18
+ import FilterButtonGroup from './FilterButtonGroup.vue'
19
+
20
+ defineProps<{
21
+ modelValue: string | undefined
22
+ facets?: FacetItem[]
23
+ loading?: boolean
24
+ }>()
25
+
26
+ const emit = defineEmits<{
27
+ 'update:modelValue': [value: string | undefined]
28
+ }>()
29
+
30
+ const { t } = useTranslation()
31
+
32
+ const options = [
33
+ { value: 'public-service', label: t('Service public') },
34
+ { value: 'local-authority', label: t('Collectivité territoriale') },
35
+ { value: 'company', label: t('Entreprise') },
36
+ { value: 'association', label: t('Association') },
37
+ { value: 'user', label: t('Utilisateur') },
38
+ ]
39
+ </script>
@@ -0,0 +1,42 @@
1
+ <template>
2
+ <FilterButtonGroup
3
+ :model-value="modelValue"
4
+ :options="options"
5
+ :label="t('Type de réutilisation')"
6
+ :all-label="t('Tous')"
7
+ :facets="facets"
8
+ :loading="loading"
9
+ name="type"
10
+ highlight-active
11
+ @update:model-value="emit('update:modelValue', $event)"
12
+ />
13
+ </template>
14
+
15
+ <script setup lang="ts">
16
+ import type { FacetItem } from '../../../types/search'
17
+ import { useTranslation } from '../../../composables/useTranslation'
18
+ import FilterButtonGroup from './FilterButtonGroup.vue'
19
+
20
+ defineProps<{
21
+ modelValue: string | undefined
22
+ facets?: FacetItem[]
23
+ loading?: boolean
24
+ }>()
25
+
26
+ const emit = defineEmits<{
27
+ 'update:modelValue': [value: string | undefined]
28
+ }>()
29
+
30
+ const { t } = useTranslation()
31
+
32
+ const options = [
33
+ { value: 'visualization', label: t('Visualisation') },
34
+ { value: 'application', label: t('Application') },
35
+ { value: 'post', label: t('Article de blog') },
36
+ { value: 'news_article', label: t('Article de presse') },
37
+ { value: 'api', label: 'API' },
38
+ { value: 'paper', label: t('Publication scientifique') },
39
+ { value: 'idea', label: t('Idée') },
40
+ { value: 'hardware', label: t('Matériel connecté') },
41
+ ]
42
+ </script>