@datagouv/components-next 0.2.0 → 1.0.1

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 (155) hide show
  1. package/README.md +1 -1
  2. package/assets/main.css +49 -22
  3. package/dist/Control-BNCDn-8E.js +148 -0
  4. package/dist/{Datafair.client-x39O4yfF.js → Datafair.client-B5lBpOl8.js} +2 -2
  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-Doz1Z0BS.js} +23 -23
  8. package/dist/Map-BdT3i2C4.js +7609 -0
  9. package/dist/MapContainer.client-oiieO8H-.js +105 -0
  10. package/dist/OSM-CamriM9b.js +71 -0
  11. package/dist/PdfPreview.client-CdAhkDFJ.js +14513 -0
  12. package/dist/{Pmtiles.client-BaiIo4VZ.js → Pmtiles.client-B0v8tGJQ.js} +3 -3
  13. package/dist/ScaleLine-BiesrgOv.js +165 -0
  14. package/dist/Swagger.client-CsK65JnG.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-CrjHf74q.js} +17 -17
  19. package/dist/common-C4rDcQpp.js +243 -0
  20. package/dist/components-next.css +1 -1
  21. package/dist/components-next.js +158 -117
  22. package/dist/components.css +1 -1
  23. package/dist/{MapContainer.client-DeSo8EvG.js → index-Bbu9rOHt.js} +4975 -21416
  24. package/dist/leaflet-src-7m1mB8LI.js +6338 -0
  25. package/dist/{main-Dgri3TQL.js → main-CiH8ZmBI.js} +56973 -51462
  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-Bi_bsV6C.js} +1 -1
  29. package/package.json +6 -2
  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 +85 -120
  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/DatasetQuality.vue +23 -16
  46. package/src/components/DatasetQualityInline.vue +13 -17
  47. package/src/components/DatasetQualityScore.vue +12 -15
  48. package/src/components/DatasetQualityTooltipContent.vue +3 -3
  49. package/src/components/DescriptionList.vue +1 -4
  50. package/src/components/DescriptionListDetails.vue +5 -0
  51. package/src/components/DescriptionListTerm.vue +5 -0
  52. package/src/components/DiscussionMessageCard.vue +63 -0
  53. package/src/components/ExtraAccordion.vue +4 -4
  54. package/src/components/Form/BadgeSelect.vue +35 -0
  55. package/src/components/Form/FormatSelect.vue +28 -0
  56. package/src/components/Form/GeozoneSelect.vue +52 -0
  57. package/src/components/Form/GranularitySelect.vue +29 -0
  58. package/src/components/Form/LicenseSelect.vue +30 -0
  59. package/src/components/Form/OrganizationSelect.vue +62 -0
  60. package/src/components/Form/OrganizationTypeSelect.vue +34 -0
  61. package/src/components/Form/ReuseTopicSelect.vue +29 -0
  62. package/src/components/Form/SchemaSelect.vue +30 -0
  63. package/src/components/Form/SearchableSelect.vue +334 -0
  64. package/src/components/Form/SelectGroup.vue +132 -0
  65. package/src/components/Form/TagSelect.vue +38 -0
  66. package/src/components/LeafletMap.vue +31 -0
  67. package/src/components/LicenseBadge.vue +24 -0
  68. package/src/components/LoadingBlock.vue +23 -2
  69. package/src/components/MarkdownViewer.vue +3 -1
  70. package/src/components/ObjectCard.vue +42 -0
  71. package/src/components/ObjectCardBadge.vue +22 -0
  72. package/src/components/ObjectCardHeader.vue +35 -0
  73. package/src/components/ObjectCardOwner.vue +43 -0
  74. package/src/components/ObjectCardShortDescription.vue +28 -0
  75. package/src/components/OrganizationCard.vue +35 -20
  76. package/src/components/OrganizationHorizontalCard.vue +87 -0
  77. package/src/components/OrganizationLogo.vue +1 -1
  78. package/src/components/OrganizationNameWithCertificate.vue +12 -6
  79. package/src/components/OwnerTypeIcon.vue +1 -0
  80. package/src/components/Pagination.vue +1 -1
  81. package/src/components/Placeholder.vue +5 -2
  82. package/src/components/PostCard.vue +62 -0
  83. package/src/components/ProgressBar.vue +31 -0
  84. package/src/components/RadioGroup.vue +32 -0
  85. package/src/components/RadioInput.vue +64 -0
  86. package/src/components/ResourceAccordion/Datafair.client.vue +1 -1
  87. package/src/components/ResourceAccordion/EditButton.vue +2 -3
  88. package/src/components/ResourceAccordion/JsonPreview.client.vue +3 -3
  89. package/src/components/ResourceAccordion/MapContainer.client.vue +21 -17
  90. package/src/components/ResourceAccordion/Metadata.vue +11 -24
  91. package/src/components/ResourceAccordion/PdfPreview.client.vue +70 -74
  92. package/src/components/ResourceAccordion/Pmtiles.client.vue +2 -2
  93. package/src/components/ResourceAccordion/Preview.vue +2 -2
  94. package/src/components/ResourceAccordion/ResourceAccordion.vue +35 -28
  95. package/src/components/ResourceAccordion/ResourceIcon.vue +1 -0
  96. package/src/components/ResourceAccordion/SchemaBadge.vue +2 -2
  97. package/src/components/ResourceAccordion/XmlPreview.client.vue +3 -3
  98. package/src/components/ResourceExplorer/ResourceExplorer.vue +243 -0
  99. package/src/components/ResourceExplorer/ResourceExplorerSidebar.vue +116 -0
  100. package/src/components/ResourceExplorer/ResourceExplorerViewer.vue +410 -0
  101. package/src/components/ReuseCard.vue +8 -28
  102. package/src/components/ReuseHorizontalCard.vue +80 -0
  103. package/src/components/Search/BasicAndAdvancedFilters.vue +49 -0
  104. package/src/components/Search/Filter/AccessTypeFilter.vue +37 -0
  105. package/src/components/Search/Filter/DatasetBadgeFilter.vue +40 -0
  106. package/src/components/Search/Filter/FilterButtonGroup.vue +78 -0
  107. package/src/components/Search/Filter/FormatFamilyFilter.vue +39 -0
  108. package/src/components/Search/Filter/LastUpdateRangeFilter.vue +37 -0
  109. package/src/components/Search/Filter/ProducerTypeFilter.vue +49 -0
  110. package/src/components/Search/Filter/ReuseTypeFilter.vue +42 -0
  111. package/src/components/Search/GlobalSearch.vue +707 -0
  112. package/src/components/Search/SearchInput.vue +63 -0
  113. package/src/components/Search/Sidemenu.vue +38 -0
  114. package/src/components/StatBox.vue +5 -5
  115. package/src/components/Tag.vue +30 -0
  116. package/src/components/Toggletip.vue +11 -4
  117. package/src/components/Tooltip.vue +2 -3
  118. package/src/components/TopicCard.vue +134 -0
  119. package/src/components/radioGroupContext.ts +9 -0
  120. package/src/composables/useDebouncedRef.ts +31 -0
  121. package/src/composables/useHasTabularData.ts +15 -0
  122. package/src/composables/useMetrics.ts +4 -3
  123. package/src/composables/useResourceCapabilities.ts +131 -0
  124. package/src/composables/useRouteQueryBoolean.ts +10 -0
  125. package/src/composables/useSelectModelSync.ts +89 -0
  126. package/src/composables/useStableQueryParams.ts +84 -0
  127. package/src/composables/useTranslation.ts +2 -1
  128. package/src/config.ts +4 -0
  129. package/src/functions/api.ts +25 -6
  130. package/src/functions/api.types.ts +5 -3
  131. package/src/functions/datasets.ts +1 -29
  132. package/src/functions/description.ts +33 -0
  133. package/src/functions/helpers.ts +11 -0
  134. package/src/functions/markdown.ts +60 -16
  135. package/src/functions/metrics.ts +33 -0
  136. package/src/functions/organizations.ts +5 -5
  137. package/src/functions/resourceCapabilities.ts +55 -0
  138. package/src/main.ts +96 -7
  139. package/src/types/dataservices.ts +14 -12
  140. package/src/types/datasets.ts +20 -7
  141. package/src/types/discussions.ts +20 -0
  142. package/src/types/licenses.ts +3 -3
  143. package/src/types/organizations.ts +13 -1
  144. package/src/types/owned.ts +4 -2
  145. package/src/types/pages.ts +70 -0
  146. package/src/types/posts.ts +27 -0
  147. package/src/types/resources.ts +16 -0
  148. package/src/types/reuses.ts +14 -5
  149. package/src/types/search.ts +407 -0
  150. package/src/types/users.ts +12 -3
  151. package/dist/PdfPreview.client-COOkEkRA.js +0 -107
  152. package/dist/Swagger.client-CpLgaLg6.js +0 -4
  153. package/dist/pdf-vue3-IkJO65RH.js +0 -273
  154. package/dist/pdf.min-f72cfa08-CdgJTooZ.js +0 -9501
  155. 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,49 @@
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 { computed } from 'vue'
17
+ import type { FacetItem } from '../../../types/search'
18
+ import { useTranslation } from '../../../composables/useTranslation'
19
+ import FilterButtonGroup from './FilterButtonGroup.vue'
20
+
21
+ const props = withDefaults(defineProps<{
22
+ modelValue: string | undefined
23
+ facets?: FacetItem[]
24
+ loading?: boolean
25
+ exclude?: string[]
26
+ }>(), {
27
+ exclude: () => [],
28
+ })
29
+
30
+ const emit = defineEmits<{
31
+ 'update:modelValue': [value: string | undefined]
32
+ }>()
33
+
34
+ const { t } = useTranslation()
35
+
36
+ const allOptions = [
37
+ { value: 'public-service', label: t('Service public') },
38
+ { value: 'local-authority', label: t('Collectivité territoriale') },
39
+ { value: 'company', label: t('Entreprise') },
40
+ { value: 'association', label: t('Association') },
41
+ { value: 'user', label: t('Utilisateur') },
42
+ ]
43
+
44
+ const options = computed(() =>
45
+ props.exclude.length > 0
46
+ ? allOptions.filter(o => !props.exclude.includes(o.value))
47
+ : allOptions,
48
+ )
49
+ </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>