@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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@datagouv/components-next",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -17,13 +17,16 @@
|
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@floating-ui/vue": "^1.1.8",
|
|
20
|
+
"@types/leaflet": "^1.9.17",
|
|
20
21
|
"@headlessui/vue": "^1.7.23",
|
|
21
22
|
"@remixicon/vue": "^4.5.0",
|
|
22
23
|
"@types/hast": "^3.0.4",
|
|
23
24
|
"@vueuse/core": "^13.1.0",
|
|
25
|
+
"@vueuse/router": "^13.1.0",
|
|
24
26
|
"chart.js": "^4.4.8",
|
|
25
27
|
"dompurify": "^3.2.5",
|
|
26
28
|
"geopf-extensions-openlayers": "^1.0.0-beta.5",
|
|
29
|
+
"leaflet": "^1.9.4",
|
|
27
30
|
"maplibre-gl": "^5.6.2",
|
|
28
31
|
"ofetch": "^1.4.1",
|
|
29
32
|
"ol": "^10.6.1",
|
|
@@ -48,6 +51,7 @@
|
|
|
48
51
|
"vue": "^3.5.13",
|
|
49
52
|
"vue-content-loader": "^2.0.1",
|
|
50
53
|
"vue-router": "^4.5.0",
|
|
54
|
+
"vue-sonner": "^2.0.9",
|
|
51
55
|
"vue3-json-viewer": "^2.4.1",
|
|
52
56
|
"vue3-text-clamp": "^0.1.2",
|
|
53
57
|
"vue3-xml-viewer": "^0.0.14"
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<PaddedContainer class="p-4 pr-7">
|
|
3
|
-
<LoadingBlock
|
|
4
|
-
|
|
3
|
+
<LoadingBlock
|
|
4
|
+
v-slot="{ data: activities }"
|
|
5
|
+
:status
|
|
6
|
+
:data="activities"
|
|
7
|
+
>
|
|
8
|
+
<template v-if="activities.total">
|
|
5
9
|
<div
|
|
6
10
|
v-for="(monthlyActivities, month) in groupedActivities"
|
|
7
11
|
:key="month"
|
|
@@ -6,6 +6,9 @@
|
|
|
6
6
|
>
|
|
7
7
|
<slot />
|
|
8
8
|
</component>
|
|
9
|
+
<span v-else-if="!to">
|
|
10
|
+
<slot />
|
|
11
|
+
</span>
|
|
9
12
|
<a
|
|
10
13
|
v-else-if="isExternal"
|
|
11
14
|
:href="(to as string)"
|
|
@@ -29,7 +32,7 @@ const config = useComponentsConfig()
|
|
|
29
32
|
const { locale } = useTranslation()
|
|
30
33
|
|
|
31
34
|
const props = defineProps<{
|
|
32
|
-
to: string | RouteLocationRaw
|
|
35
|
+
to: string | RouteLocationRaw | null | undefined
|
|
33
36
|
}>()
|
|
34
37
|
|
|
35
38
|
const isExternal = computed(() => {
|
|
@@ -13,12 +13,12 @@
|
|
|
13
13
|
<script setup lang="ts">
|
|
14
14
|
import { computed } from 'vue'
|
|
15
15
|
import { useGetUserAvatar } from '../functions/users'
|
|
16
|
-
import type { UserReference } from '../types/users'
|
|
16
|
+
import type { User, UserReference } from '../types/users'
|
|
17
17
|
|
|
18
18
|
type Props = {
|
|
19
19
|
rounded?: boolean
|
|
20
20
|
size?: number
|
|
21
|
-
user: UserReference
|
|
21
|
+
user: User | UserReference
|
|
22
22
|
}
|
|
23
23
|
const props = withDefaults(defineProps<Props>(), {
|
|
24
24
|
rounded: false,
|
|
@@ -6,13 +6,15 @@
|
|
|
6
6
|
:size
|
|
7
7
|
:rounded="true"
|
|
8
8
|
/>
|
|
9
|
-
<
|
|
10
|
-
:
|
|
11
|
-
|
|
9
|
+
<component
|
|
10
|
+
:is="withLink ? AppLink : 'span'"
|
|
11
|
+
:to="withLink ? user.page : undefined"
|
|
12
|
+
class="truncate"
|
|
13
|
+
:class="{ 'font-bold': withLink }"
|
|
12
14
|
>
|
|
13
15
|
{{ user.first_name }}
|
|
14
16
|
{{ user.last_name }}
|
|
15
|
-
</
|
|
17
|
+
</component>
|
|
16
18
|
</span>
|
|
17
19
|
</template>
|
|
18
20
|
|
|
@@ -24,7 +26,9 @@ import Avatar from './Avatar.vue'
|
|
|
24
26
|
withDefaults(defineProps<{
|
|
25
27
|
user: User | UserReference
|
|
26
28
|
size?: number
|
|
29
|
+
withLink?: boolean
|
|
27
30
|
}>(), {
|
|
28
31
|
size: 12,
|
|
32
|
+
withLink: true,
|
|
29
33
|
})
|
|
30
34
|
</script>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<span class="inline-flex gap-0.5 items-end h-2">
|
|
3
|
+
<span
|
|
4
|
+
v-for="i in 3"
|
|
5
|
+
:key="i"
|
|
6
|
+
class="w-1 h-1 bg-current rounded-full animate-[bounce-dot_0.6s_ease-in-out_infinite]"
|
|
7
|
+
:style="`animation-delay: ${(i - 1) * 100}ms !important`"
|
|
8
|
+
/>
|
|
9
|
+
</span>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<style>
|
|
13
|
+
@keyframes bounce-dot {
|
|
14
|
+
0%, 100% {
|
|
15
|
+
transform: translateY(0);
|
|
16
|
+
}
|
|
17
|
+
50% {
|
|
18
|
+
transform: translateY(-3px);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
</style>
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
v-else-if="icon"
|
|
22
22
|
:class="iconSize"
|
|
23
23
|
v-bind="iconAttrs"
|
|
24
|
+
aria-hidden="true"
|
|
24
25
|
/>
|
|
25
26
|
<span
|
|
26
27
|
v-if="hasText"
|
|
@@ -29,6 +30,7 @@
|
|
|
29
30
|
><slot /></span>
|
|
30
31
|
<RiExternalLinkLine
|
|
31
32
|
v-if="newTab"
|
|
33
|
+
aria-hidden="true"
|
|
32
34
|
:class="iconSize"
|
|
33
35
|
/>
|
|
34
36
|
</component>
|
|
@@ -11,10 +11,13 @@
|
|
|
11
11
|
:class="{ 'flex-row-reverse': reverse }"
|
|
12
12
|
style="color: #3558a2;"
|
|
13
13
|
>
|
|
14
|
-
<RiCheckLine
|
|
14
|
+
<RiCheckLine
|
|
15
|
+
class="flex-none size-4 inline"
|
|
16
|
+
aria-hidden="true"
|
|
17
|
+
/>
|
|
15
18
|
<span
|
|
16
19
|
class="copy-label"
|
|
17
|
-
:class="{ '
|
|
20
|
+
:class="{ 'sr-only': hideLabel }"
|
|
18
21
|
>{{ copiedLabel }}</span>
|
|
19
22
|
</span>
|
|
20
23
|
<span
|
|
@@ -25,10 +28,11 @@
|
|
|
25
28
|
<component
|
|
26
29
|
:is="hideLabel ? RiClipboardLine : RiFileCopyLine"
|
|
27
30
|
class="size-4 flex-none inline"
|
|
31
|
+
aria-hidden="true"
|
|
28
32
|
/>
|
|
29
33
|
<span
|
|
30
34
|
class="copy-link copy-label"
|
|
31
|
-
:class="{ '
|
|
35
|
+
:class="{ 'sr-only': hideLabel }"
|
|
32
36
|
>{{ label }}</span>
|
|
33
37
|
</span>
|
|
34
38
|
</button>
|
|
@@ -37,6 +41,8 @@
|
|
|
37
41
|
<script setup lang="ts">
|
|
38
42
|
import { RiCheckLine, RiClipboardLine, RiFileCopyLine } from '@remixicon/vue'
|
|
39
43
|
import { ref } from 'vue'
|
|
44
|
+
import { toast } from 'vue-sonner'
|
|
45
|
+
import { useTranslation } from '../composables/useTranslation'
|
|
40
46
|
|
|
41
47
|
const props = withDefaults(defineProps<{
|
|
42
48
|
text: string
|
|
@@ -49,12 +55,18 @@ const props = withDefaults(defineProps<{
|
|
|
49
55
|
reverse: false,
|
|
50
56
|
})
|
|
51
57
|
|
|
58
|
+
const { t } = useTranslation()
|
|
52
59
|
const copied = ref(false)
|
|
53
60
|
|
|
54
|
-
const copy = () => {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
61
|
+
const copy = async () => {
|
|
62
|
+
try {
|
|
63
|
+
await navigator.clipboard.writeText(props.text)
|
|
64
|
+
copied.value = true
|
|
65
|
+
setTimeout(() => copied.value = false, 2000)
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
toast.error(t('Impossible de copier dans le presse-papier'))
|
|
69
|
+
}
|
|
58
70
|
}
|
|
59
71
|
</script>
|
|
60
72
|
|
|
@@ -1,99 +1,82 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<
|
|
3
|
-
class="
|
|
4
|
-
:class="{
|
|
2
|
+
<ObjectCard
|
|
3
|
+
:article-class="{
|
|
5
4
|
'border-tabular-api': isTabularApi,
|
|
6
5
|
'border-gray-default': !isTabularApi,
|
|
7
|
-
'mt-6': showBadge,
|
|
8
6
|
}"
|
|
9
7
|
>
|
|
10
|
-
<
|
|
11
|
-
|
|
12
|
-
class="absolute top-0 fr-grid-row fr-grid-row--middle fr-mt-n3v fr-ml-n1v"
|
|
13
|
-
>
|
|
14
|
-
<p
|
|
15
|
-
v-if="dataservice.access_type === 'restricted'"
|
|
16
|
-
class="fr-badge fr-badge--sm fr-badge--mention-grey text-gray-medium mr-2"
|
|
17
|
-
>
|
|
18
|
-
<RiLockLine class="size-4 mr-1" />
|
|
19
|
-
{{ t('Accès restreint') }}
|
|
20
|
-
</p>
|
|
21
|
-
<p
|
|
22
|
-
v-else-if="dataservice.access_type === 'open_with_account'"
|
|
23
|
-
class="fr-badge fr-badge--sm fr-badge--mention-grey text-gray-medium mr-2"
|
|
24
|
-
>
|
|
25
|
-
<RiPassValidLine class="size-4 mr-1" />
|
|
26
|
-
{{ t('Ouvert avec un compte') }}
|
|
27
|
-
</p>
|
|
28
|
-
<p
|
|
8
|
+
<template #badge>
|
|
9
|
+
<ObjectCardBadge
|
|
29
10
|
v-if="dataservice.private"
|
|
30
|
-
|
|
11
|
+
:icon="RiLockLine"
|
|
31
12
|
>
|
|
32
|
-
<RiLockLine class="size-4 mr-1" />
|
|
33
13
|
{{ t('Brouillon') }}
|
|
34
|
-
</
|
|
35
|
-
<
|
|
36
|
-
v-if="dataservice.archived_at"
|
|
37
|
-
|
|
14
|
+
</ObjectCardBadge>
|
|
15
|
+
<ObjectCardBadge
|
|
16
|
+
v-else-if="dataservice.archived_at"
|
|
17
|
+
:icon="RiArchiveLine"
|
|
38
18
|
>
|
|
39
|
-
<RiLockLine class="size-4 mr-1" />
|
|
40
19
|
{{ t('Archivé') }}
|
|
41
|
-
</
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
name="dataserviceUrl"
|
|
46
|
-
:dataservice="dataservice"
|
|
47
|
-
:dataservice-url="dataserviceUrl"
|
|
20
|
+
</ObjectCardBadge>
|
|
21
|
+
<ObjectCardBadge
|
|
22
|
+
v-else-if="dataservice.access_type === 'restricted'"
|
|
23
|
+
:icon="RiLockLine"
|
|
48
24
|
>
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
25
|
+
{{ t('Accès restreint') }}
|
|
26
|
+
</ObjectCardBadge>
|
|
27
|
+
<ObjectCardBadge
|
|
28
|
+
v-else-if="dataservice.access_type === 'open_with_account'"
|
|
29
|
+
:icon="RiPassValidLine"
|
|
30
|
+
>
|
|
31
|
+
{{ t('Ouvert avec un compte') }}
|
|
32
|
+
</ObjectCardBadge>
|
|
33
|
+
</template>
|
|
34
|
+
|
|
35
|
+
<template #media>
|
|
36
|
+
<OrganizationLogo
|
|
37
|
+
v-if="dataservice.organization"
|
|
38
|
+
:organization="dataservice.organization"
|
|
39
|
+
size-class="size-12"
|
|
40
|
+
/>
|
|
41
|
+
<Avatar
|
|
42
|
+
v-else-if="dataservice.owner"
|
|
43
|
+
:user="dataservice.owner"
|
|
44
|
+
:size="48"
|
|
45
|
+
/>
|
|
46
|
+
<Placeholder
|
|
47
|
+
v-else
|
|
48
|
+
type="Dataservice"
|
|
49
|
+
class="size-12"
|
|
50
|
+
/>
|
|
51
|
+
</template>
|
|
52
|
+
|
|
53
|
+
<ObjectCardHeader
|
|
54
|
+
:icon="isTabularApi ? RiSparklingLine : RiTerminalLine"
|
|
55
|
+
:url="dataserviceUrl || dataservice.self_web_url"
|
|
56
|
+
>
|
|
57
|
+
{{ dataservice.title }}
|
|
58
|
+
</ObjectCardHeader>
|
|
65
59
|
<div
|
|
66
60
|
v-if="dataservice.organization || dataservice.owner"
|
|
67
|
-
class="text-
|
|
61
|
+
class="text-sm m-0 flex flex-wrap md:flex-nowrap gap-y-1 items-center truncate"
|
|
68
62
|
>
|
|
69
|
-
<
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
</AppLink>
|
|
80
|
-
<OrganizationNameWithCertificate
|
|
81
|
-
v-else
|
|
82
|
-
:organization="dataservice.organization"
|
|
83
|
-
/>
|
|
84
|
-
</p>
|
|
85
|
-
<p
|
|
86
|
-
v-else
|
|
87
|
-
class="text-sm mb-0 truncate"
|
|
88
|
-
>
|
|
89
|
-
{{ ownerName }}
|
|
90
|
-
</p>
|
|
91
|
-
<RiSubtractLine class="size-4 flex-none fill-gray-medium" />
|
|
92
|
-
<!-- This comment is only here to fix this issue https://github.com/datagouv/cdata/issues/653, it could be empty… -->
|
|
63
|
+
<ObjectCardOwner
|
|
64
|
+
:organization="dataservice.organization"
|
|
65
|
+
:owner="dataservice.owner"
|
|
66
|
+
:organization-url="organizationUrl"
|
|
67
|
+
/>
|
|
68
|
+
<RiSubtractLine
|
|
69
|
+
aria-hidden="true"
|
|
70
|
+
class="size-4 flex-none fill-gray-medium"
|
|
71
|
+
/>
|
|
72
|
+
<!-- https://github.com/datagouv/cdata/issues/653 -->
|
|
93
73
|
<p class="text-sm whitespace-nowrap mb-0">
|
|
94
74
|
{{ t('Mis à jour {date}', { date: formatRelativeIfRecentDate(dataservice.metadata_modified_at, { dateStyle: 'medium' }) }) }}
|
|
95
75
|
</p>
|
|
96
|
-
<RiSubtractLine
|
|
76
|
+
<RiSubtractLine
|
|
77
|
+
aria-hidden="true"
|
|
78
|
+
class="size-4 flex-none fill-gray-medium"
|
|
79
|
+
/>
|
|
97
80
|
<div class="flex items-center gap-1">
|
|
98
81
|
<p
|
|
99
82
|
class="text-sm mb-0 flex items-center gap-0.5"
|
|
@@ -115,73 +98,55 @@
|
|
|
115
98
|
</p>
|
|
116
99
|
</div>
|
|
117
100
|
</div>
|
|
118
|
-
<
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
class="text-sm mt-2 mb-0"
|
|
122
|
-
:auto-resize="true"
|
|
123
|
-
:text="description"
|
|
124
|
-
:max-lines="2"
|
|
101
|
+
<ObjectCardShortDescription
|
|
102
|
+
v-if="showDescription"
|
|
103
|
+
:text="dataservice.description"
|
|
125
104
|
/>
|
|
126
|
-
|
|
105
|
+
|
|
106
|
+
<slot />
|
|
107
|
+
</ObjectCard>
|
|
127
108
|
</template>
|
|
128
109
|
|
|
129
110
|
<script setup lang="ts">
|
|
130
|
-
import { computed
|
|
111
|
+
import { computed } from 'vue'
|
|
131
112
|
import type { RouteLocationRaw } from 'vue-router'
|
|
132
|
-
import { RiEyeLine, RiLockLine, RiPassValidLine, RiSparklingLine, RiStarLine, RiSubtractLine, RiTerminalLine } from '@remixicon/vue'
|
|
113
|
+
import { RiArchiveLine, RiEyeLine, RiLockLine, RiPassValidLine, RiSparklingLine, RiStarLine, RiSubtractLine, RiTerminalLine } from '@remixicon/vue'
|
|
133
114
|
import { useComponentsConfig } from '../config'
|
|
134
115
|
import { useFormatDate } from '../functions/dates'
|
|
135
116
|
import { summarize } from '../functions/helpers'
|
|
136
|
-
import { removeMarkdown } from '../functions/markdown'
|
|
137
|
-
import { getOwnerName } from '../functions/owned'
|
|
138
117
|
import type { Dataservice } from '../types/dataservices'
|
|
139
118
|
import { useTranslation } from '../composables/useTranslation'
|
|
140
|
-
import
|
|
141
|
-
import
|
|
119
|
+
import OrganizationLogo from './OrganizationLogo.vue'
|
|
120
|
+
import Avatar from './Avatar.vue'
|
|
121
|
+
import Placeholder from './Placeholder.vue'
|
|
122
|
+
import ObjectCard from './ObjectCard.vue'
|
|
123
|
+
import ObjectCardBadge from './ObjectCardBadge.vue'
|
|
124
|
+
import ObjectCardHeader from './ObjectCardHeader.vue'
|
|
125
|
+
import ObjectCardOwner from './ObjectCardOwner.vue'
|
|
126
|
+
import ObjectCardShortDescription from './ObjectCardShortDescription.vue'
|
|
142
127
|
|
|
143
128
|
type Props = {
|
|
144
129
|
dataservice: Dataservice
|
|
145
|
-
|
|
146
|
-
/**
|
|
147
|
-
* The dataserviceUrl is a route location object to allow Vue Router to navigate to the details of a dataservice.
|
|
148
|
-
* It is used as a separate prop to allow other sites using the package to define their own dataservice pages.
|
|
149
|
-
*/
|
|
150
130
|
dataserviceUrl?: RouteLocationRaw
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* The organizationUrl is an optional route location object to allow Vue Router to navigate to the details of the organization linked to tha dataservice.
|
|
154
|
-
* It is used as a separate prop to allow other sites using the package to define their own organization pages.
|
|
155
|
-
*/
|
|
156
131
|
organizationUrl?: RouteLocationRaw
|
|
157
132
|
showDescription?: boolean
|
|
158
133
|
}
|
|
159
134
|
|
|
160
135
|
const props = withDefaults(defineProps<Props>(), {
|
|
161
|
-
style: () => ({}),
|
|
162
136
|
showDescription: true,
|
|
163
137
|
})
|
|
164
138
|
|
|
165
|
-
const dataserviceUrl = computed(() => props.dataserviceUrl || props.dataservice.self_web_url)
|
|
166
|
-
|
|
167
139
|
const { t } = useTranslation()
|
|
168
140
|
const { formatRelativeIfRecentDate } = useFormatDate()
|
|
169
|
-
const ownerName = computed(() => getOwnerName(props.dataservice))
|
|
170
|
-
const showBadge = computed(() => props.dataservice.access_type === 'restricted' || props.dataservice.access_type === 'open_with_account' || props.dataservice.private || props.dataservice.archived_at)
|
|
171
141
|
|
|
172
142
|
const config = useComponentsConfig()
|
|
173
143
|
const isTabularApi = computed(() => {
|
|
174
144
|
return config.tabularApiDataserviceId === props.dataservice.id
|
|
175
145
|
})
|
|
176
|
-
|
|
177
|
-
const description = ref('')
|
|
178
|
-
watchEffect(async () => {
|
|
179
|
-
description.value = await removeMarkdown(props.dataservice.description)
|
|
180
|
-
})
|
|
181
146
|
</script>
|
|
182
147
|
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
148
|
+
<style scoped>
|
|
149
|
+
.border-tabular-api {
|
|
150
|
+
border-color: #373C42 !important;
|
|
151
|
+
}
|
|
152
|
+
</style>
|