@datagouv/components-next 1.0.2-dev.2 → 1.0.2-dev.21

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 (35) hide show
  1. package/dist/Datafair.client-Ds3VQrRi.js +30 -0
  2. package/dist/JsonPreview.client-CYxmz0yV.js +72 -0
  3. package/dist/{MapContainer.client-DRkAmdOc.js → MapContainer.client-B2BijMx5.js} +35 -38
  4. package/dist/{PdfPreview.client-C-w6-w44.js → PdfPreview.client-DJBMzrlC.js} +534 -549
  5. package/dist/{Pmtiles.client-BR7_ldHY.js → Pmtiles.client-C_hvRDuy.js} +574 -579
  6. package/dist/Swagger.client-B4y0hXME.js +4 -0
  7. package/dist/XmlPreview.client-LETEfNBH.js +64 -0
  8. package/dist/components-next.css +3 -3
  9. package/dist/components-next.js +1 -1
  10. package/dist/components.css +1 -1
  11. package/dist/{index-SrYZwgCT.js → index-BFQX7Ccz.js} +1 -1
  12. package/dist/{main-B2kXxWRG.js → main-vqhkVhVS.js} +34465 -33707
  13. package/dist/{vue3-xml-viewer.common-BRxsqI9j.js → vue3-xml-viewer.common-BcNJo35o.js} +1 -1
  14. package/package.json +8 -4
  15. package/src/components/Form/SearchableSelect.vue +2 -1
  16. package/src/components/ReadMore.vue +1 -1
  17. package/src/components/ResourceAccordion/Datafair.client.vue +4 -10
  18. package/src/components/ResourceAccordion/JsonPreview.client.vue +13 -30
  19. package/src/components/ResourceAccordion/MapContainer.client.vue +7 -11
  20. package/src/components/ResourceAccordion/PdfPreview.client.vue +13 -29
  21. package/src/components/ResourceAccordion/Pmtiles.client.vue +5 -10
  22. package/src/components/ResourceAccordion/Preview.vue +5 -10
  23. package/src/components/ResourceAccordion/PreviewLoader.vue +1 -2
  24. package/src/components/ResourceAccordion/PreviewUnavailable.vue +22 -0
  25. package/src/components/ResourceAccordion/XmlPreview.client.vue +13 -30
  26. package/src/components/ResourceExplorer/ResourceExplorer.vue +21 -10
  27. package/src/components/ResourceExplorer/ResourceExplorerViewer.vue +12 -1
  28. package/src/composables/useResourceCapabilities.ts +1 -1
  29. package/src/types/dataservices.ts +2 -0
  30. package/src/types/organizations.ts +1 -1
  31. package/dist/Datafair.client-E5D6ePRC.js +0 -35
  32. package/dist/JsonPreview.client-C-6eBbPw.js +0 -87
  33. package/dist/Swagger.client-D4-F6yEf.js +0 -4
  34. package/dist/XmlPreview.client-Dl2VCgXF.js +0 -79
  35. /package/assets/illustrations/{_microscope.svg → microscope.svg} +0 -0
@@ -0,0 +1,4 @@
1
+ import { i as f } from "./main-vqhkVhVS.js";
2
+ export {
3
+ f as default
4
+ };
@@ -0,0 +1,64 @@
1
+ import { defineComponent as z, defineAsyncComponent as C, ref as o, computed as x, onMounted as X, createElementBlock as c, openBlock as t, createBlock as f, createCommentVNode as L, createVNode as B, unref as r, toDisplayString as i, withCtx as m, createTextVNode as p } from "vue";
2
+ import { u as S, a as V, g as E, _ as d } from "./main-vqhkVhVS.js";
3
+ const M = { class: "fr-text--xs" }, P = { key: 0 }, D = {
4
+ key: 1,
5
+ class: "text-gray-medium"
6
+ }, $ = /* @__PURE__ */ z({
7
+ __name: "XmlPreview.client",
8
+ props: {
9
+ resource: {}
10
+ },
11
+ setup(y) {
12
+ const T = C(
13
+ () => import("./vue3-xml-viewer.common-BcNJo35o.js").then((e) => e.v).then((e) => e.default || e.XmlViewer)
14
+ ), h = y, v = S(), { t: a } = V(), n = o(null), u = o(!1), l = o(null), g = o(!1), _ = x(() => E(h.resource)), w = x(() => {
15
+ const e = _.value;
16
+ if (!e || !v.maxXmlPreviewCharSize)
17
+ return !1;
18
+ const s = v.maxXmlPreviewCharSize;
19
+ return e <= s;
20
+ }), k = async () => {
21
+ if (!w.value) {
22
+ g.value = !0;
23
+ return;
24
+ }
25
+ u.value = !0, l.value = null;
26
+ try {
27
+ const e = await fetch(h.resource.url);
28
+ if (!e.ok)
29
+ throw new Error(`HTTP error! status: ${e.status}`);
30
+ const s = await e.text();
31
+ n.value = s;
32
+ } catch (e) {
33
+ console.error("Error loading XML:", e), e instanceof TypeError ? l.value = "network" : l.value = "generic", n.value = null;
34
+ } finally {
35
+ u.value = !1;
36
+ }
37
+ };
38
+ return X(() => {
39
+ k();
40
+ }), (e, s) => (t(), c("div", M, [
41
+ n.value ? (t(), c("div", P, [
42
+ B(r(T), { xml: n.value }, null, 8, ["xml"])
43
+ ])) : u.value ? (t(), c("div", D, i(r(a)("Chargement de l'aperçu XML...")), 1)) : g.value ? (t(), f(d, { key: 2 }, {
44
+ default: m(() => [
45
+ p(i(_.value ? r(a)("Le fichier XML est trop volumineux pour être prévisualisé. Téléchargez-le depuis l'onglet Téléchargements.") : r(a)("La taille du fichier est inconnue, l'aperçu n'est pas disponible. Téléchargez-le depuis l'onglet Téléchargements.")), 1)
46
+ ]),
47
+ _: 1
48
+ })) : l.value === "network" ? (t(), f(d, { key: 3 }, {
49
+ default: m(() => [
50
+ p(i(r(a)("Ce fichier est hébergé sur un site externe qui ne permet pas la prévisualisation. Téléchargez-le depuis l'onglet Téléchargements.")), 1)
51
+ ]),
52
+ _: 1
53
+ })) : l.value ? (t(), f(d, { key: 4 }, {
54
+ default: m(() => [
55
+ p(i(r(a)("L'aperçu de ce fichier n'a pas pu être chargé. Téléchargez-le depuis l'onglet Téléchargements.")), 1)
56
+ ]),
57
+ _: 1
58
+ })) : L("", !0)
59
+ ]));
60
+ }
61
+ });
62
+ export {
63
+ $ as default
64
+ };