@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.
- package/README.md +1 -1
- package/assets/main.css +56 -1
- package/dist/Control-BNCDn-8E.js +148 -0
- package/dist/{Datafair.client-x39O4yfF.js → Datafair.client-Dls5AHTE.js} +1 -1
- package/dist/Event-BOgJUhNR.js +738 -0
- package/dist/Image-BN-4XkIn.js +247 -0
- package/dist/{JsonPreview.client-BMsC5JcY.js → JsonPreview.client-DPDTs433.js} +14 -14
- package/dist/Map-BdT3i2C4.js +7609 -0
- package/dist/MapContainer.client-BdAzd7bj.js +105 -0
- package/dist/OSM-CamriM9b.js +71 -0
- package/dist/{PdfPreview.client-COOkEkRA.js → PdfPreview.client-CopqSDyt.js} +3 -3
- package/dist/{Pmtiles.client-BaiIo4VZ.js → Pmtiles.client-mF6xaOO_.js} +2 -2
- package/dist/ScaleLine-BiesrgOv.js +165 -0
- package/dist/Swagger.client-eJ7gpfZA.js +4 -0
- package/dist/Tile-DCuqwNOI.js +1206 -0
- package/dist/TileImage-CmZf8EdU.js +1067 -0
- package/dist/View-DcDc7N2K.js +2858 -0
- package/dist/{XmlPreview.client-CAdN0w_Y.js → XmlPreview.client-C0OgBkSq.js} +7 -7
- package/dist/common-C4rDcQpp.js +243 -0
- package/dist/components-next.css +1 -1
- package/dist/components-next.js +153 -117
- package/dist/components.css +1 -1
- package/dist/{MapContainer.client-DeSo8EvG.js → index-BRGqW8aQ.js} +4975 -21416
- package/dist/leaflet-src-7m1mB8LI.js +6338 -0
- package/dist/{main-Dgri3TQL.js → main-CNHxAJ8J.js} +56758 -51450
- package/dist/proj-CKwYjU38.js +1569 -0
- package/dist/tilecoord-YW3qEH_j.js +884 -0
- package/dist/{vue3-xml-viewer.common-D6skc_Ai.js → vue3-xml-viewer.common-CmAdQfIy.js} +1 -1
- package/package.json +5 -1
- package/src/components/ActivityList/ActivityList.vue +6 -2
- package/src/components/AppLink.vue +4 -1
- package/src/components/Avatar.vue +2 -2
- package/src/components/AvatarWithName.vue +8 -4
- package/src/components/BouncingDots.vue +21 -0
- package/src/components/BrandedButton.vue +2 -0
- package/src/components/CopyButton.vue +19 -7
- package/src/components/DataserviceCard.vue +83 -118
- package/src/components/DatasetCard.vue +110 -171
- package/src/components/DatasetInformation/DatasetEmbedSection.vue +43 -0
- package/src/components/DatasetInformation/DatasetInformationSection.vue +73 -0
- package/src/components/DatasetInformation/DatasetSchemaSection.vue +74 -0
- package/src/components/DatasetInformation/DatasetSpatialSection.vue +59 -0
- package/src/components/DatasetInformation/DatasetTemporalitySection.vue +45 -0
- package/src/components/DatasetInformation/index.ts +5 -0
- package/src/components/DatasetQualityTooltipContent.vue +3 -3
- package/src/components/DescriptionList.vue +1 -4
- package/src/components/DescriptionListDetails.vue +5 -0
- package/src/components/DescriptionListTerm.vue +5 -0
- package/src/components/DiscussionMessageCard.vue +63 -0
- package/src/components/ExtraAccordion.vue +4 -4
- package/src/components/Form/BadgeSelect.vue +35 -0
- package/src/components/Form/FormatSelect.vue +28 -0
- package/src/components/Form/GeozoneSelect.vue +52 -0
- package/src/components/Form/GranularitySelect.vue +29 -0
- package/src/components/Form/LicenseSelect.vue +30 -0
- package/src/components/Form/OrganizationSelect.vue +62 -0
- package/src/components/Form/OrganizationTypeSelect.vue +34 -0
- package/src/components/Form/ReuseTopicSelect.vue +29 -0
- package/src/components/Form/SchemaSelect.vue +30 -0
- package/src/components/Form/SearchableSelect.vue +334 -0
- package/src/components/Form/SelectGroup.vue +132 -0
- package/src/components/Form/TagSelect.vue +38 -0
- package/src/components/LeafletMap.vue +31 -0
- package/src/components/LicenseBadge.vue +24 -0
- package/src/components/LoadingBlock.vue +23 -2
- package/src/components/MarkdownViewer.vue +3 -1
- package/src/components/ObjectCard.vue +42 -0
- package/src/components/ObjectCardBadge.vue +22 -0
- package/src/components/ObjectCardHeader.vue +35 -0
- package/src/components/ObjectCardOwner.vue +43 -0
- package/src/components/ObjectCardShortDescription.vue +28 -0
- package/src/components/OrganizationCard.vue +35 -20
- package/src/components/OrganizationLogo.vue +1 -1
- package/src/components/OrganizationNameWithCertificate.vue +13 -7
- package/src/components/OwnerTypeIcon.vue +1 -0
- package/src/components/Pagination.vue +1 -1
- package/src/components/Placeholder.vue +5 -2
- package/src/components/PostCard.vue +62 -0
- package/src/components/RadioGroup.vue +32 -0
- package/src/components/RadioInput.vue +64 -0
- package/src/components/ResourceAccordion/EditButton.vue +2 -3
- package/src/components/ResourceAccordion/MapContainer.client.vue +20 -16
- package/src/components/ResourceAccordion/Metadata.vue +11 -24
- package/src/components/ResourceAccordion/Pmtiles.client.vue +1 -1
- package/src/components/ResourceAccordion/Preview.vue +1 -1
- package/src/components/ResourceAccordion/ResourceAccordion.vue +30 -20
- package/src/components/ResourceAccordion/ResourceIcon.vue +1 -0
- package/src/components/ResourceAccordion/SchemaBadge.vue +2 -2
- package/src/components/ResourceExplorer/ResourceExplorer.vue +243 -0
- package/src/components/ResourceExplorer/ResourceExplorerSidebar.vue +116 -0
- package/src/components/ResourceExplorer/ResourceExplorerViewer.vue +361 -0
- package/src/components/ReuseCard.vue +8 -28
- package/src/components/ReuseHorizontalCard.vue +80 -0
- package/src/components/Search/BasicAndAdvancedFilters.vue +49 -0
- package/src/components/Search/Filter/AccessTypeFilter.vue +37 -0
- package/src/components/Search/Filter/DatasetBadgeFilter.vue +40 -0
- package/src/components/Search/Filter/FilterButtonGroup.vue +78 -0
- package/src/components/Search/Filter/FormatFamilyFilter.vue +39 -0
- package/src/components/Search/Filter/LastUpdateRangeFilter.vue +37 -0
- package/src/components/Search/Filter/ProducerTypeFilter.vue +39 -0
- package/src/components/Search/Filter/ReuseTypeFilter.vue +42 -0
- package/src/components/Search/GlobalSearch.vue +611 -0
- package/src/components/Search/SearchInput.vue +63 -0
- package/src/components/Search/Sidemenu.vue +38 -0
- package/src/components/StatBox.vue +5 -5
- package/src/components/Tag.vue +30 -0
- package/src/components/Toggletip.vue +6 -2
- package/src/components/Tooltip.vue +2 -3
- package/src/components/TopicCard.vue +134 -0
- package/src/components/radioGroupContext.ts +9 -0
- package/src/composables/useDebouncedRef.ts +31 -0
- package/src/composables/useMetrics.ts +4 -3
- package/src/composables/useResourceCapabilities.ts +118 -0
- package/src/composables/useRouteQueryBoolean.ts +10 -0
- package/src/composables/useSelectModelSync.ts +89 -0
- package/src/composables/useStableQueryParams.ts +84 -0
- package/src/config.ts +4 -0
- package/src/functions/api.ts +17 -6
- package/src/functions/api.types.ts +4 -2
- package/src/functions/datasets.ts +1 -29
- package/src/functions/description.ts +33 -0
- package/src/functions/helpers.ts +11 -0
- package/src/functions/markdown.ts +60 -16
- package/src/functions/metrics.ts +33 -0
- package/src/functions/organizations.ts +5 -5
- package/src/main.ts +89 -7
- package/src/types/dataservices.ts +14 -12
- package/src/types/datasets.ts +20 -7
- package/src/types/discussions.ts +20 -0
- package/src/types/licenses.ts +3 -3
- package/src/types/organizations.ts +13 -1
- package/src/types/owned.ts +4 -2
- package/src/types/pages.ts +70 -0
- package/src/types/posts.ts +27 -0
- package/src/types/resources.ts +6 -0
- package/src/types/reuses.ts +14 -5
- package/src/types/search.ts +379 -0
- package/src/types/users.ts +12 -3
- package/dist/Swagger.client-CpLgaLg6.js +0 -4
- package/src/components/DatasetInformationPanel.vue +0 -211
|
@@ -1,211 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="py-6 mb-6 border-bottom border-gray-default">
|
|
3
|
-
<h2 class="subtitle subtitle--uppercase">
|
|
4
|
-
{{ t('Informations') }}
|
|
5
|
-
</h2>
|
|
6
|
-
<div class="fr-text--sm fr-m-0">
|
|
7
|
-
<dl class="fr-grid-row fr-grid-row--gutters">
|
|
8
|
-
<div
|
|
9
|
-
v-if="license"
|
|
10
|
-
class="fr-col-12 fr-col-sm-6 fr-col-md-4"
|
|
11
|
-
>
|
|
12
|
-
<dt class="subtitle fr-mb-0">
|
|
13
|
-
{{ t('Licence') }}
|
|
14
|
-
</dt>
|
|
15
|
-
<dd class="text-sm m-0 text-gray-medium p-0">
|
|
16
|
-
<code class="bg-grey-some px-1 text-gray-medium">
|
|
17
|
-
<a :href="license.url">
|
|
18
|
-
{{ license.title }}
|
|
19
|
-
</a>
|
|
20
|
-
</code>
|
|
21
|
-
</dd>
|
|
22
|
-
</div>
|
|
23
|
-
<div class="fr-col-12 fr-col-sm-6 fr-col-md-4">
|
|
24
|
-
<dt class="subtitle fr-mb-0">
|
|
25
|
-
{{ t('Identifiant') }}
|
|
26
|
-
</dt>
|
|
27
|
-
<dd class="text-sm m-0 text-gray-medium p-0">
|
|
28
|
-
{{ dataset.id }}
|
|
29
|
-
</dd>
|
|
30
|
-
</div>
|
|
31
|
-
</dl>
|
|
32
|
-
</div>
|
|
33
|
-
</div>
|
|
34
|
-
<div class="pb-6 mb-6 border-bottom border-gray-default">
|
|
35
|
-
<h2 class="subtitle subtitle--uppercase">
|
|
36
|
-
{{ t('Temporalité') }}
|
|
37
|
-
</h2>
|
|
38
|
-
<div class="fr-text--sm fr-m-0">
|
|
39
|
-
<dl class="fr-grid-row fr-grid-row--gutters">
|
|
40
|
-
<div class="fr-col-12 fr-col-sm-6 fr-col-md-4">
|
|
41
|
-
<dt class="subtitle fr-mb-0">
|
|
42
|
-
{{ t('Création') }}
|
|
43
|
-
</dt>
|
|
44
|
-
<dd class="text-sm m-0 text-gray-medium p-0">
|
|
45
|
-
{{ formatDate(dataset.created_at) }}
|
|
46
|
-
</dd>
|
|
47
|
-
</div>
|
|
48
|
-
<div
|
|
49
|
-
v-if="frequency"
|
|
50
|
-
class="fr-col-12 fr-col-sm-6 fr-col-md-4"
|
|
51
|
-
>
|
|
52
|
-
<dt class="subtitle fr-mb-0">
|
|
53
|
-
{{ t('Fréquence') }}
|
|
54
|
-
</dt>
|
|
55
|
-
<dd class="text-sm m-0 text-gray-medium p-0">
|
|
56
|
-
{{ frequency.label }}
|
|
57
|
-
</dd>
|
|
58
|
-
</div>
|
|
59
|
-
</dl>
|
|
60
|
-
<dl class="fr-grid-row fr-grid-row--gutters">
|
|
61
|
-
<div class="fr-col-12 fr-col-sm-6 fr-col-md-4">
|
|
62
|
-
<dt class="subtitle fr-mb-0">
|
|
63
|
-
{{ t('Dernière mise à jour') }}
|
|
64
|
-
</dt>
|
|
65
|
-
<dd class="text-sm m-0 text-gray-medium p-0">
|
|
66
|
-
{{ formatDate(props.dataset.last_update) }}
|
|
67
|
-
</dd>
|
|
68
|
-
</div>
|
|
69
|
-
</dl>
|
|
70
|
-
</div>
|
|
71
|
-
</div>
|
|
72
|
-
<div class="pb-6 mb-6 border-bottom border-gray-default">
|
|
73
|
-
<h2 class="subtitle subtitle--uppercase">
|
|
74
|
-
{{ t('Couverture spatiale') }}
|
|
75
|
-
</h2>
|
|
76
|
-
<div class="fr-text--sm fr-m-0">
|
|
77
|
-
<dl class="fr-grid-row fr-grid-row--gutters">
|
|
78
|
-
<div
|
|
79
|
-
v-if="zonesLabels.length"
|
|
80
|
-
class="fr-col-12 fr-col-sm-6 fr-col-md-4"
|
|
81
|
-
>
|
|
82
|
-
<dt class="subtitle fr-mb-0">
|
|
83
|
-
{{ t('Couverture territoriale') }}
|
|
84
|
-
</dt>
|
|
85
|
-
<dd class="text-sm m-0 text-gray-medium p-0">
|
|
86
|
-
{{ zonesLabels.join(', ') }}
|
|
87
|
-
</dd>
|
|
88
|
-
</div>
|
|
89
|
-
<div
|
|
90
|
-
v-if="granularity"
|
|
91
|
-
class="fr-col-12 fr-col-sm-6 fr-col-md-4"
|
|
92
|
-
>
|
|
93
|
-
<dt class="subtitle fr-mb-0">
|
|
94
|
-
{{ t('Granularité de la couverture territoriale') }}
|
|
95
|
-
</dt>
|
|
96
|
-
<dd class="text-sm m-0 text-gray-medium p-0">
|
|
97
|
-
{{ granularity.name }}
|
|
98
|
-
</dd>
|
|
99
|
-
</div>
|
|
100
|
-
</dl>
|
|
101
|
-
</div>
|
|
102
|
-
</div>
|
|
103
|
-
<div class="pb-6 mb-6 border-bottom border-gray-default">
|
|
104
|
-
<h2 class="subtitle subtitle--uppercase">
|
|
105
|
-
{{ t('Actions') }}
|
|
106
|
-
</h2>
|
|
107
|
-
<div class="fr-text--sm fr-m-0">
|
|
108
|
-
<h3 class="subtitle fr-mb-1v">
|
|
109
|
-
{{ t('Intégrer sur votre site') }}
|
|
110
|
-
<CopyButton
|
|
111
|
-
:hide-label="true"
|
|
112
|
-
:label="t(`Copier l'intégration`)"
|
|
113
|
-
:copied-label="t('Intégration copiée !')"
|
|
114
|
-
class="fr-my-1w fr-mr-1w"
|
|
115
|
-
:text="getDatasetOEmbedHtml('dataset', dataset.id)"
|
|
116
|
-
/>
|
|
117
|
-
</h3>
|
|
118
|
-
<div class="embed-wrapper">
|
|
119
|
-
<textarea
|
|
120
|
-
ref="textAreaRef"
|
|
121
|
-
:value="getDatasetOEmbedHtml('dataset', dataset.id)"
|
|
122
|
-
readonly="true"
|
|
123
|
-
rows="1"
|
|
124
|
-
@click="selectContent"
|
|
125
|
-
/>
|
|
126
|
-
</div>
|
|
127
|
-
</div>
|
|
128
|
-
</div>
|
|
129
|
-
<div v-if="hasExtras">
|
|
130
|
-
<ExtraAccordion
|
|
131
|
-
:button-text="t('Voir les extras')"
|
|
132
|
-
:title-text="t('Extras')"
|
|
133
|
-
:extra="props.dataset.extras"
|
|
134
|
-
title-level="h2"
|
|
135
|
-
/>
|
|
136
|
-
</div>
|
|
137
|
-
<div v-if="props.dataset?.harvest">
|
|
138
|
-
<ExtraAccordion
|
|
139
|
-
:button-text="t('Voir le moissonage')"
|
|
140
|
-
:title-text="t('Moissonnage')"
|
|
141
|
-
:extra="props.dataset.harvest"
|
|
142
|
-
title-level="h2"
|
|
143
|
-
/>
|
|
144
|
-
</div>
|
|
145
|
-
</template>
|
|
146
|
-
|
|
147
|
-
<script setup lang="ts">
|
|
148
|
-
import { ref, computed } from 'vue'
|
|
149
|
-
import { useFormatDate } from '../functions/dates'
|
|
150
|
-
// import useOEmbed from '../../composables/useOEmbed'
|
|
151
|
-
import type { Dataset, DatasetV2 } from '../types/datasets'
|
|
152
|
-
import type { Granularity } from '../types/granularity'
|
|
153
|
-
import type { Frequency } from '../types/frequency'
|
|
154
|
-
import type { License } from '../types/licenses'
|
|
155
|
-
import { useFetch } from '../functions/api'
|
|
156
|
-
import { getDatasetOEmbedHtml } from '../functions/datasets'
|
|
157
|
-
import { useTranslation } from '../composables/useTranslation'
|
|
158
|
-
import ExtraAccordion from './ExtraAccordion.vue'
|
|
159
|
-
import CopyButton from './CopyButton.vue'
|
|
160
|
-
|
|
161
|
-
const props = defineProps<{
|
|
162
|
-
dataset: DatasetV2 | Dataset
|
|
163
|
-
}>()
|
|
164
|
-
const { t } = useTranslation()
|
|
165
|
-
const { formatDate } = useFormatDate()
|
|
166
|
-
// const embedText = useOEmbed('dataset', props.dataset.id)
|
|
167
|
-
const textAreaRef = ref<HTMLTextAreaElement | null>(null)
|
|
168
|
-
|
|
169
|
-
const hasExtras = computed(() => Object.keys(props.dataset.extras).length > 0)
|
|
170
|
-
|
|
171
|
-
function selectContent() {
|
|
172
|
-
if (textAreaRef.value) {
|
|
173
|
-
textAreaRef.value.select()
|
|
174
|
-
}
|
|
175
|
-
};
|
|
176
|
-
|
|
177
|
-
const { data: allLicenses } = await useFetch<Array<License>>('/api/1/datasets/licenses/')
|
|
178
|
-
const license = computed(() => {
|
|
179
|
-
if (!props.dataset.license) return null
|
|
180
|
-
if (!allLicenses.value) return null
|
|
181
|
-
|
|
182
|
-
return allLicenses.value.find(license => license.id === props.dataset.license)
|
|
183
|
-
})
|
|
184
|
-
|
|
185
|
-
const { data: frequencies } = await useFetch<Array<Frequency>>('/api/1/datasets/frequencies/')
|
|
186
|
-
const frequency = computed(() => {
|
|
187
|
-
if (!props.dataset.frequency) return null
|
|
188
|
-
if (!frequencies.value) return null
|
|
189
|
-
|
|
190
|
-
return frequencies.value.find(frequency => frequency.id === props.dataset.frequency)
|
|
191
|
-
})
|
|
192
|
-
|
|
193
|
-
const zonesUrl = computed(() => {
|
|
194
|
-
if (!props.dataset.spatial?.zones || !props.dataset.spatial.zones.length) return null
|
|
195
|
-
|
|
196
|
-
return `/api/1/spatial/zones/${props.dataset.spatial.zones.join(',')}/`
|
|
197
|
-
})
|
|
198
|
-
const { data: zones } = await useFetch<{ features: Array<{ properties: { name: string } }> }>(zonesUrl)
|
|
199
|
-
const zonesLabels = computed(() => {
|
|
200
|
-
if (!zones.value) return []
|
|
201
|
-
return zones.value.features.map(feature => feature.properties.name)
|
|
202
|
-
})
|
|
203
|
-
|
|
204
|
-
const { data: granularities } = await useFetch<Array<Granularity>>('/api/1/spatial/granularities/')
|
|
205
|
-
const granularity = computed(() => {
|
|
206
|
-
if (!props.dataset.spatial?.granularity) return null
|
|
207
|
-
if (!granularities.value) return null
|
|
208
|
-
|
|
209
|
-
return granularities.value.find(granularity => granularity.id === props.dataset.spatial?.granularity)
|
|
210
|
-
})
|
|
211
|
-
</script>
|