@datagouv/components-next 0.0.7 → 0.0.9
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 +34 -14
- package/assets/json/vector.json +2377 -0
- package/assets/main.css +3 -0
- package/assets/swagger-themes/newspaper.css +1669 -0
- package/assets/tailwind.config.js +1 -1
- package/dist/JsonPreview.client-BIz1_EiB.js +92 -0
- package/dist/MapContainer.client-ZDwr4Q_I.js +78276 -0
- package/dist/PdfPreview.client-BTTMM27i.js +112 -0
- package/dist/Pmtiles.client-4kOoUQcR.js +22377 -0
- package/dist/Swagger.client-Q7a5wb51.js +4 -0
- package/dist/XmlPreview.client-BYIIkDqf.js +84 -0
- package/dist/components-next.css +52 -1
- package/dist/components-next.js +42 -41
- package/dist/components.css +1 -1
- package/dist/main-CLUk9Jj7.js +105843 -0
- package/dist/pdf-vue3-BZh6kzke.js +273 -0
- package/dist/pdf.min-f72cfa08-DAetWL3M.js +9501 -0
- package/dist/{text-clamp.esm-DurZFOvT.js → text-clamp.esm-DP59tec5.js} +1 -1
- package/dist/vue3-json-viewer-DIQzFF6K.js +1089 -0
- package/dist/vue3-xml-viewer.common-BmKw6vER.js +5437 -0
- package/package.json +7 -5
- package/src/components/AvatarWithName.vue +6 -2
- package/src/components/BannerAction.vue +1 -1
- package/src/components/BrandedButton.vue +13 -8
- package/src/components/CopyButton.vue +7 -7
- package/src/components/DataserviceCard.vue +54 -23
- package/src/components/DatasetCard.vue +36 -24
- package/src/components/DatasetInformationPanel.vue +19 -18
- package/src/components/DatasetQuality.vue +21 -18
- package/src/components/DatasetQualityInline.vue +1 -1
- package/src/components/DatasetQualityItem.vue +3 -3
- package/src/components/DatasetQualityItemWarning.vue +2 -2
- package/src/components/DatasetQualityScore.vue +2 -2
- package/src/components/DatasetQualityTooltipContent.vue +29 -29
- package/src/components/DescriptionDetails.vue +2 -2
- package/src/components/ExtraAccordion.vue +10 -7
- package/src/components/OrganizationCard.vue +9 -4
- package/src/components/OrganizationNameWithCertificate.vue +25 -11
- package/src/components/Pagination.vue +26 -15
- package/src/components/ReadMore.vue +2 -2
- package/src/components/ResourceAccordion/DataStructure.vue +2 -2
- package/src/components/ResourceAccordion/EditButton.vue +10 -6
- package/src/components/ResourceAccordion/JsonPreview.client.vue +153 -0
- package/src/components/ResourceAccordion/MapContainer.client.vue +137 -0
- package/src/components/ResourceAccordion/Metadata.vue +33 -54
- package/src/components/ResourceAccordion/PdfPreview.client.vue +189 -0
- package/src/components/ResourceAccordion/Pmtiles.client.vue +166 -0
- package/src/components/ResourceAccordion/Preview.vue +39 -37
- package/src/components/ResourceAccordion/ResourceAccordion.vue +141 -63
- package/src/components/ResourceAccordion/ResourceIcon.vue +7 -1
- package/src/components/ResourceAccordion/SchemaBadge.vue +26 -26
- package/src/components/ResourceAccordion/{Swagger.vue → Swagger.client.vue} +1 -1
- package/src/components/ResourceAccordion/XmlPreview.client.vue +143 -0
- package/src/components/ReuseCard.vue +10 -7
- package/src/components/ReuseDetails.vue +3 -3
- package/src/components/SimpleBanner.vue +7 -4
- package/src/components/SmallChart.vue +23 -9
- package/src/components/StatBox.vue +92 -10
- package/src/config.ts +6 -2
- package/src/functions/api.ts +18 -18
- package/src/functions/dates.ts +81 -74
- package/src/functions/helpers.ts +5 -4
- package/src/functions/organizations.ts +5 -5
- package/src/functions/resources.ts +34 -5
- package/src/functions/schemas.ts +4 -3
- package/src/functions/tabularApi.ts +1 -1
- package/src/main.ts +10 -11
- package/src/types/badges.ts +3 -3
- package/src/types/contact_point.ts +5 -5
- package/src/types/dataservices.ts +16 -2
- package/src/types/datasets.ts +20 -2
- package/src/types/frequency.ts +5 -5
- package/src/types/granularity.ts +12 -4
- package/src/types/harvest.ts +2 -2
- package/src/types/licenses.ts +8 -8
- package/src/types/organizations.ts +6 -0
- package/src/types/resources.ts +3 -3
- package/src/types/reuses.ts +3 -1
- package/src/types/site.ts +8 -0
- package/src/types/ui.ts +2 -2
- package/src/types/users.ts +24 -8
- package/src/types/vue3-xml-viewer.d.ts +10 -0
- package/dist/Swagger-DjysB-OI.js +0 -67851
- package/dist/en-DCRve7vN.js +0 -613
- package/dist/fr-DCOnbL-p.js +0 -613
- package/dist/locales/de.js +0 -155
- package/dist/locales/en.js +0 -155
- package/dist/locales/es.js +0 -155
- package/dist/locales/fr.js +0 -155
- package/dist/locales/it.js +0 -155
- package/dist/locales/pt.js +0 -155
- package/dist/locales/sr.js +0 -155
- package/dist/main-CPW2vNLE.js +0 -32008
- package/src/components/DescriptionList/DescriptionDetails.stories.ts +0 -43
- package/src/components/DescriptionList/DescriptionList.stories.ts +0 -47
- package/src/components/DescriptionList/DescriptionTerm.stories.ts +0 -28
- package/src/locales/de.json +0 -154
- package/src/locales/en.json +0 -154
- package/src/locales/es.json +0 -154
- package/src/locales/fr.json +0 -154
- package/src/locales/it.json +0 -154
- package/src/locales/pt.json +0 -154
- package/src/locales/sr.json +0 -154
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { d as T, x as $, r as l, c as y, e as q, b as p, f as r, m as f, y as B, q as a, u, C as L, t as c, p as d, g, F as h, s as m } from "./main-CLUk9Jj7.js";
|
|
2
|
+
const O = { class: "text-xs" }, S = { key: 0 }, N = {
|
|
3
|
+
key: 1,
|
|
4
|
+
class: "text-gray-medium"
|
|
5
|
+
}, A = /* @__PURE__ */ T({
|
|
6
|
+
__name: "PdfPreview.client",
|
|
7
|
+
props: {
|
|
8
|
+
resource: {}
|
|
9
|
+
},
|
|
10
|
+
setup(w) {
|
|
11
|
+
const b = L(
|
|
12
|
+
() => import("./pdf-vue3-BZh6kzke.js").then((e) => e.default)
|
|
13
|
+
), t = w, k = $(), o = l(!1), i = l(!1), s = l(null), P = l(!1), v = y(() => {
|
|
14
|
+
var n;
|
|
15
|
+
if (t.resource.filesize)
|
|
16
|
+
return t.resource.filesize;
|
|
17
|
+
const e = (n = t.resource.extras) == null ? void 0 : n["analysis:content-length"];
|
|
18
|
+
return e && typeof e == "number" ? e : null;
|
|
19
|
+
}), z = y(() => {
|
|
20
|
+
const e = v.value;
|
|
21
|
+
if (!e)
|
|
22
|
+
return !1;
|
|
23
|
+
const n = k.maxPdfPreviewSize ?? 1e7;
|
|
24
|
+
return e <= n;
|
|
25
|
+
}), D = async () => {
|
|
26
|
+
if (!z.value) {
|
|
27
|
+
P.value = !0;
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
i.value = !0, s.value = null;
|
|
31
|
+
try {
|
|
32
|
+
const e = await fetch(t.resource.url, { method: "HEAD" });
|
|
33
|
+
if (!e.ok)
|
|
34
|
+
throw new Error(`HTTP error! status: ${e.status}`);
|
|
35
|
+
o.value = !0;
|
|
36
|
+
} catch (e) {
|
|
37
|
+
console.error("Error testing PDF URL:", e), e instanceof TypeError ? s.value = "network" : s.value = "generic", o.value = !1;
|
|
38
|
+
} finally {
|
|
39
|
+
i.value = !1;
|
|
40
|
+
}
|
|
41
|
+
}, F = (e) => {
|
|
42
|
+
console.log(`PDF loading progress: ${e}%`);
|
|
43
|
+
}, C = () => {
|
|
44
|
+
console.log("PDF download completed");
|
|
45
|
+
}, x = (e) => {
|
|
46
|
+
console.log(`PDF page changed to: ${e}`);
|
|
47
|
+
}, _ = (e) => {
|
|
48
|
+
console.log("PDF initialized:", e);
|
|
49
|
+
}, E = (e) => {
|
|
50
|
+
console.error("PDF loading error:", e), e instanceof TypeError ? s.value = "network" : s.value = "generic", o.value = !1;
|
|
51
|
+
};
|
|
52
|
+
return q(() => {
|
|
53
|
+
D();
|
|
54
|
+
}), (e, n) => (r(), p("div", O, [
|
|
55
|
+
o.value ? (r(), p("div", S, [
|
|
56
|
+
a(u(b), {
|
|
57
|
+
src: t.resource.url,
|
|
58
|
+
"show-progress": !0,
|
|
59
|
+
"progress-color": "#0063cb",
|
|
60
|
+
"show-page-tooltip": !0,
|
|
61
|
+
"show-back-to-top-btn": !0,
|
|
62
|
+
"scroll-threshold": 300,
|
|
63
|
+
"pdf-width": "100%",
|
|
64
|
+
"row-gap": 12,
|
|
65
|
+
"use-system-fonts": !0,
|
|
66
|
+
"disable-range": !1,
|
|
67
|
+
"disable-stream": !1,
|
|
68
|
+
"disable-auto-fetch": !1,
|
|
69
|
+
class: "w-full",
|
|
70
|
+
onOnProgress: F,
|
|
71
|
+
onOnComplete: C,
|
|
72
|
+
onOnPageChange: x,
|
|
73
|
+
onOnPdfInit: _,
|
|
74
|
+
onOnError: E
|
|
75
|
+
}, null, 8, ["src"])
|
|
76
|
+
])) : i.value ? (r(), p("div", N, c(e.$t("Chargement de l'aperçu PDF...")), 1)) : P.value ? (r(), f(m, {
|
|
77
|
+
key: 2,
|
|
78
|
+
type: "warning",
|
|
79
|
+
class: "flex items-center space-x-2"
|
|
80
|
+
}, {
|
|
81
|
+
default: d(() => [
|
|
82
|
+
a(u(h), { class: "shink-0 size-6" }),
|
|
83
|
+
g("span", null, c(v.value ? e.$t("Fichier PDF trop volumineux pour l'aperçu. Pour consulter le fichier complet, téléchargez-le en cliquant sur le bouton bleu ou depuis l'onglet Téléchargements.") : e.$t("L'aperçu n'est pas disponible car la taille du fichier est inconnue. Pour consulter le fichier complet, téléchargez-le en cliquant sur le bouton bleu ou depuis l'onglet Téléchargements.")), 1)
|
|
84
|
+
]),
|
|
85
|
+
_: 1
|
|
86
|
+
})) : s.value === "network" ? (r(), f(m, {
|
|
87
|
+
key: 3,
|
|
88
|
+
type: "warning",
|
|
89
|
+
class: "flex items-center space-x-2"
|
|
90
|
+
}, {
|
|
91
|
+
default: d(() => [
|
|
92
|
+
a(u(h), { class: "shink-0 size-6" }),
|
|
93
|
+
g("span", null, c(e.$t("Ce fichier PDF ne peut pas être prévisualisé, peut-être parce qu'il est hébergé sur un autre site qui ne l'autorise pas. Pour le consulter, téléchargez-le en cliquant sur le bouton bleu ou depuis l'onglet Téléchargements.")), 1)
|
|
94
|
+
]),
|
|
95
|
+
_: 1
|
|
96
|
+
})) : s.value ? (r(), f(m, {
|
|
97
|
+
key: 4,
|
|
98
|
+
type: "warning",
|
|
99
|
+
class: "flex items-center space-x-2"
|
|
100
|
+
}, {
|
|
101
|
+
default: d(() => [
|
|
102
|
+
a(u(h), { class: "shink-0 size-6" }),
|
|
103
|
+
g("span", null, c(e.$t("Erreur lors du chargement de l'aperçu PDF. Pour consulter le fichier, téléchargez-le depuis l'onglet Téléchargements.")), 1)
|
|
104
|
+
]),
|
|
105
|
+
_: 1
|
|
106
|
+
})) : B("", !0)
|
|
107
|
+
]));
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
export {
|
|
111
|
+
A as default
|
|
112
|
+
};
|