@datagouv/components-next 1.0.2-dev.206 → 1.0.2-dev.208
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/dist/{Datafair.client-CKO7zvcu.js → Datafair.client-CZhPt853.js} +1 -1
- package/dist/{ImagePreview.client-Ds2a8rNF.js → ImagePreview.client-CTF6hyMR.js} +1 -1
- package/dist/{JsonPreview.client-B1qB66gi.js → JsonPreview.client-BwsgTnR7.js} +2 -2
- package/dist/{MapContainer.client-CmhRqcQO.js → MapContainer.client-C95seuim.js} +2 -2
- package/dist/{PdfPreview.client-4DPbht9W.js → PdfPreview.client-DaXPl9xc.js} +2 -2
- package/dist/{Pmtiles.client-B-SqGzWJ.js → Pmtiles.client-PSLUkGmF.js} +1 -1
- package/dist/{PreviewWrapper.vue_vue_type_script_setup_true_lang-BhUv9AsR.js → PreviewWrapper.vue_vue_type_script_setup_true_lang-McCfJHd3.js} +1 -1
- package/dist/{XmlPreview.client-Dyw-XIcJ.js → XmlPreview.client-BOVVyHXW.js} +3 -3
- package/dist/components-next.js +192 -191
- package/dist/components.css +1 -1
- package/dist/{index-D3tWi9cQ.js → index-CeH9i6IP.js} +1 -1
- package/dist/{leaflet-src-RJqDGxU9.js → leaflet-src-D1Cl1V-1.js} +1 -1
- package/dist/{main-DV8PLxLT.js → main-DADRUTDs.js} +10723 -10622
- package/dist/{vue3-xml-viewer.common-w91Jvccv.js → vue3-xml-viewer.common-BzsQ7xw8.js} +1 -1
- package/package.json +1 -1
- package/src/components/ChartCard.vue +112 -0
- package/src/components/ObjectCard.vue +4 -1
- package/src/components/Placeholder.vue +3 -2
- package/src/main.ts +2 -0
- package/src/types/visualizations.ts +1 -0
package/package.json
CHANGED
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<ObjectCard media-size="xl">
|
|
3
|
+
<template #badge>
|
|
4
|
+
<ObjectCardBadge
|
|
5
|
+
v-if="chart.deleted_at"
|
|
6
|
+
:icon="RiDeleteBinLine"
|
|
7
|
+
>
|
|
8
|
+
{{ t('Supprimé') }}
|
|
9
|
+
</ObjectCardBadge>
|
|
10
|
+
<ObjectCardBadge
|
|
11
|
+
v-else-if="chart.private"
|
|
12
|
+
:icon="RiLockLine"
|
|
13
|
+
>
|
|
14
|
+
{{ t('Brouillon') }}
|
|
15
|
+
</ObjectCardBadge>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<template #media>
|
|
19
|
+
<img
|
|
20
|
+
v-if="chart.image"
|
|
21
|
+
:src="chart.image"
|
|
22
|
+
class="w-full h-full object-cover"
|
|
23
|
+
:alt="chart.title"
|
|
24
|
+
>
|
|
25
|
+
<Placeholder
|
|
26
|
+
v-else
|
|
27
|
+
type="Chart"
|
|
28
|
+
class="w-full h-full"
|
|
29
|
+
/>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<ObjectCardHeader
|
|
33
|
+
:icon="chartIcon"
|
|
34
|
+
:url="chartUrl || chart.page"
|
|
35
|
+
>
|
|
36
|
+
{{ chart.title }}
|
|
37
|
+
</ObjectCardHeader>
|
|
38
|
+
|
|
39
|
+
<div
|
|
40
|
+
v-if="chart.organization || chart.owner"
|
|
41
|
+
class="text-sm flex flex-wrap gap-y-1 items-center truncate"
|
|
42
|
+
>
|
|
43
|
+
<ObjectCardOwner
|
|
44
|
+
:organization="chart.organization"
|
|
45
|
+
:owner="chart.owner"
|
|
46
|
+
:organization-url="organizationUrl"
|
|
47
|
+
/>
|
|
48
|
+
<RiSubtractLine
|
|
49
|
+
aria-hidden="true"
|
|
50
|
+
class="size-4 flex-none fill-gray-medium"
|
|
51
|
+
/>
|
|
52
|
+
<TranslationT
|
|
53
|
+
tag="p"
|
|
54
|
+
class="text-sm whitespace-nowrap mb-0 text-gray-medium"
|
|
55
|
+
keypath="Mis à jour {date}"
|
|
56
|
+
>
|
|
57
|
+
<template #date>
|
|
58
|
+
<FormattedDate
|
|
59
|
+
:date="chart.last_modified"
|
|
60
|
+
format="relative"
|
|
61
|
+
:options="{ dateStyle: 'medium' }"
|
|
62
|
+
/>
|
|
63
|
+
</template>
|
|
64
|
+
</TranslationT>
|
|
65
|
+
</div>
|
|
66
|
+
|
|
67
|
+
<div class="mx-0 -mb-1 flex flex-wrap items-center text-sm text-gray-medium mt-1">
|
|
68
|
+
<p
|
|
69
|
+
class="text-sm mb-0 flex items-center gap-0.5"
|
|
70
|
+
:aria-label="t('{n} vues | {n} vue | {n} vues', chart.metrics.views)"
|
|
71
|
+
>
|
|
72
|
+
<RiEyeLine
|
|
73
|
+
aria-hidden="true"
|
|
74
|
+
class="size-3.5"
|
|
75
|
+
/>{{ summarize(chart.metrics.views) }}
|
|
76
|
+
</p>
|
|
77
|
+
</div>
|
|
78
|
+
|
|
79
|
+
<ObjectCardShortDescription :text="chart.description" />
|
|
80
|
+
|
|
81
|
+
<slot />
|
|
82
|
+
</ObjectCard>
|
|
83
|
+
</template>
|
|
84
|
+
|
|
85
|
+
<script setup lang="ts">
|
|
86
|
+
import { computed } from 'vue'
|
|
87
|
+
import { RiBarChartBoxLine, RiDeleteBinLine, RiEyeLine, RiLineChartLine, RiLockLine, RiSubtractLine } from '@remixicon/vue'
|
|
88
|
+
import type { RouteLocationRaw } from 'vue-router'
|
|
89
|
+
import type { Chart } from '../types/visualizations'
|
|
90
|
+
import { summarize } from '../functions/helpers'
|
|
91
|
+
import { useTranslation } from '../composables/useTranslation'
|
|
92
|
+
import Placeholder from './Placeholder.vue'
|
|
93
|
+
import FormattedDate from './FormattedDate.vue'
|
|
94
|
+
import ObjectCard from './ObjectCard.vue'
|
|
95
|
+
import ObjectCardBadge from './ObjectCardBadge.vue'
|
|
96
|
+
import ObjectCardHeader from './ObjectCardHeader.vue'
|
|
97
|
+
import ObjectCardOwner from './ObjectCardOwner.vue'
|
|
98
|
+
import ObjectCardShortDescription from './ObjectCardShortDescription.vue'
|
|
99
|
+
import TranslationT from './TranslationT.vue'
|
|
100
|
+
|
|
101
|
+
const props = defineProps<{
|
|
102
|
+
chart: Chart
|
|
103
|
+
chartUrl?: RouteLocationRaw
|
|
104
|
+
organizationUrl?: RouteLocationRaw
|
|
105
|
+
}>()
|
|
106
|
+
|
|
107
|
+
const { t } = useTranslation()
|
|
108
|
+
|
|
109
|
+
const chartIcon = computed(() => {
|
|
110
|
+
return props.chart.series[0]?.type === 'line' ? RiLineChartLine : RiBarChartBoxLine
|
|
111
|
+
})
|
|
112
|
+
</script>
|
|
@@ -28,12 +28,15 @@ import { computed } from 'vue'
|
|
|
28
28
|
|
|
29
29
|
const props = withDefaults(defineProps<{
|
|
30
30
|
articleClass?: string | string[] | Record<string, boolean>
|
|
31
|
-
mediaSize?: 'sm' | 'lg'
|
|
31
|
+
mediaSize?: 'sm' | 'lg' | 'xl'
|
|
32
32
|
}>(), {
|
|
33
33
|
mediaSize: 'sm',
|
|
34
34
|
})
|
|
35
35
|
|
|
36
36
|
const mediaContainerClass = computed(() => {
|
|
37
|
+
if (props.mediaSize === 'xl') {
|
|
38
|
+
return 'w-[250px] h-[190px]'
|
|
39
|
+
}
|
|
37
40
|
if (props.mediaSize === 'lg') {
|
|
38
41
|
return 'w-[225px] h-[120px]'
|
|
39
42
|
}
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
|
|
11
11
|
<script setup lang="ts">
|
|
12
12
|
import { computed } from 'vue'
|
|
13
|
-
import { RiBookShelfLine, RiBuilding2Line, RiDatabase2Line, RiLineChartLine, RiTerminalLine } from '@remixicon/vue'
|
|
13
|
+
import { RiBarChartBoxLine, RiBookShelfLine, RiBuilding2Line, RiDatabase2Line, RiLineChartLine, RiTerminalLine } from '@remixicon/vue'
|
|
14
14
|
|
|
15
15
|
const props = defineProps<{
|
|
16
|
-
type: 'Dataset' | 'Dataservice' | 'Reuse' | 'Organization' | 'Topic'
|
|
16
|
+
type: 'Dataset' | 'Dataservice' | 'Reuse' | 'Organization' | 'Topic' | 'Chart'
|
|
17
17
|
}>()
|
|
18
18
|
|
|
19
19
|
const icon = computed(() => {
|
|
@@ -23,6 +23,7 @@ const icon = computed(() => {
|
|
|
23
23
|
Reuse: RiLineChartLine,
|
|
24
24
|
Organization: RiBuilding2Line,
|
|
25
25
|
Topic: RiBookShelfLine,
|
|
26
|
+
Chart: RiBarChartBoxLine,
|
|
26
27
|
}[props.type]
|
|
27
28
|
})
|
|
28
29
|
</script>
|
package/src/main.ts
CHANGED
|
@@ -38,6 +38,7 @@ import Avatar from './components/Avatar.vue'
|
|
|
38
38
|
import AvatarWithName from './components/AvatarWithName.vue'
|
|
39
39
|
import BannerAction from './components/BannerAction.vue'
|
|
40
40
|
import BrandedButton from './components/BrandedButton.vue'
|
|
41
|
+
import ChartCard from './components/ChartCard.vue'
|
|
41
42
|
import CopyButton from './components/CopyButton.vue'
|
|
42
43
|
import DataserviceCard from './components/DataserviceCard.vue'
|
|
43
44
|
import DataserviceQuality from './components/DataserviceQuality.vue'
|
|
@@ -344,6 +345,7 @@ export {
|
|
|
344
345
|
AvatarWithName,
|
|
345
346
|
BannerAction,
|
|
346
347
|
BrandedButton,
|
|
348
|
+
ChartCard,
|
|
347
349
|
CopyButton,
|
|
348
350
|
DataserviceCard,
|
|
349
351
|
DataserviceQuality,
|