@datagouv/components-next 1.0.2-dev.3 → 1.0.2-dev.30

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 (47) hide show
  1. package/dist/Datafair.client-CSUWxY1U.js +30 -0
  2. package/dist/{Event--kp8kMdJ.js → Event-B0pbfyAo.js} +1 -1
  3. package/dist/JsonPreview.client-DWP5adeD.js +72 -0
  4. package/dist/{Map-BjUnLyj8.js → Map-ByzoJvTf.js} +2 -2
  5. package/dist/MapContainer.client-B0oJPrx5.js +102 -0
  6. package/dist/{OSM-s40W6sQ2.js → OSM-FSBCBM2l.js} +1 -1
  7. package/dist/{PdfPreview.client-C-w6-w44.js → PdfPreview.client-B2E_IWUj.js} +533 -548
  8. package/dist/{Pmtiles.client-BR7_ldHY.js → Pmtiles.client-STSFvULL.js} +575 -580
  9. package/dist/Swagger.client-mrRTl6ll.js +4 -0
  10. package/dist/{Tile-DbNFNPfU.js → Tile-nykTnQlb.js} +4 -4
  11. package/dist/{TileImage-BsXBxMtq.js → TileImage-RLU-wMoy.js} +1 -1
  12. package/dist/{View-BR92hTWP.js → View-SHblmfOT.js} +1 -1
  13. package/dist/XmlPreview.client-C0zaJXWA.js +64 -0
  14. package/dist/components-next.css +4 -4
  15. package/dist/components-next.js +13 -13
  16. package/dist/components.css +1 -1
  17. package/dist/{index-SrYZwgCT.js → index-kxzw3Ssm.js} +1164 -1164
  18. package/dist/{leaflet-src-7m1mB8LI.js → leaflet-src-DfyFSZpM.js} +185 -183
  19. package/dist/{main-B2kXxWRG.js → main-BMXOPzsN.js} +34653 -33895
  20. package/dist/{text-clamp.esm-B5kW_XMt.js → text-clamp.esm-DVseBqZZ.js} +4 -4
  21. package/dist/{tilecoord-Db24Px13.js → tilecoord-BgTy1qJO.js} +5 -5
  22. package/dist/{vue3-json-viewer-BXwup7nO.js → vue3-json-viewer-BgCuOAH6.js} +10 -10
  23. package/dist/{vue3-xml-viewer.common-BRxsqI9j.js → vue3-xml-viewer.common-CwN-5lms.js} +16 -16
  24. package/package.json +9 -5
  25. package/src/components/Form/SearchableSelect.vue +2 -1
  26. package/src/components/ReadMore.vue +1 -1
  27. package/src/components/ResourceAccordion/Datafair.client.vue +4 -10
  28. package/src/components/ResourceAccordion/JsonPreview.client.vue +13 -30
  29. package/src/components/ResourceAccordion/MapContainer.client.vue +7 -11
  30. package/src/components/ResourceAccordion/PdfPreview.client.vue +13 -29
  31. package/src/components/ResourceAccordion/Pmtiles.client.vue +5 -10
  32. package/src/components/ResourceAccordion/Preview.vue +5 -10
  33. package/src/components/ResourceAccordion/PreviewLoader.vue +1 -2
  34. package/src/components/ResourceAccordion/PreviewUnavailable.vue +22 -0
  35. package/src/components/ResourceAccordion/XmlPreview.client.vue +13 -30
  36. package/src/components/ResourceExplorer/ResourceExplorer.vue +21 -10
  37. package/src/components/ResourceExplorer/ResourceExplorerViewer.vue +12 -1
  38. package/src/composables/useResourceCapabilities.ts +1 -1
  39. package/src/types/dataservices.ts +2 -0
  40. package/src/types/organizations.ts +1 -1
  41. package/src/types/users.ts +0 -1
  42. package/dist/Datafair.client-E5D6ePRC.js +0 -35
  43. package/dist/JsonPreview.client-C-6eBbPw.js +0 -87
  44. package/dist/MapContainer.client-DRkAmdOc.js +0 -105
  45. package/dist/Swagger.client-D4-F6yEf.js +0 -4
  46. package/dist/XmlPreview.client-Dl2VCgXF.js +0 -79
  47. /package/assets/illustrations/{_microscope.svg → microscope.svg} +0 -0
@@ -0,0 +1,30 @@
1
+ import { defineComponent as l, computed as a, openBlock as t, createElementBlock as o, createElementVNode as u, createBlock as f, withCtx as p, createTextVNode as m, toDisplayString as _, unref as h } from "vue";
2
+ import { a as x, _ as g } from "./main-BMXOPzsN.js";
3
+ const v = { class: "fr-text--xs" }, b = { key: 0 }, k = ["src"], $ = /* @__PURE__ */ l({
4
+ __name: "Datafair.client",
5
+ props: {
6
+ resource: {},
7
+ dataset: {}
8
+ },
9
+ setup(c) {
10
+ const e = c, { t: i } = x(), r = a(() => e.resource.extras.datafairOrigin || e.dataset.extras.datafairOrigin), s = a(() => e.resource.extras.datafairDatasetId || e.dataset.extras.datafairDatasetId), d = a(() => e.resource.extras.datafairEmbed), n = a(() => !r.value || !s.value ? null : `${r.value}/embed/dataset/${s.value}/${d.value}`);
11
+ return (D, y) => (t(), o("div", v, [
12
+ n.value ? (t(), o("div", b, [
13
+ u("iframe", {
14
+ src: n.value,
15
+ width: "100%",
16
+ height: "500px",
17
+ style: { "background-color": "transparent", border: "none" }
18
+ }, null, 8, k)
19
+ ])) : (t(), f(g, { key: 1 }, {
20
+ default: p(() => [
21
+ m(_(h(i)("L'aperçu de ce fichier n'a pas pu être chargé. Téléchargez-le depuis l'onglet Téléchargements.")), 1)
22
+ ]),
23
+ _: 1
24
+ }))
25
+ ]));
26
+ }
27
+ });
28
+ export {
29
+ $ as default
30
+ };
@@ -1,4 +1,4 @@
1
- import { H as x } from "./View-BR92hTWP.js";
1
+ import { H as x } from "./View-SHblmfOT.js";
2
2
  import { a as I } from "./common-PJfpC179.js";
3
3
  import { B as C, a7 as h, al as m, u as S, l as p, E as N, i as L, a4 as P, J as Z } from "./proj-DsetBcW7.js";
4
4
  import { c as T } from "./Image-34hvypZI.js";
@@ -0,0 +1,72 @@
1
+ import { defineComponent as z, defineAsyncComponent as C, ref as l, computed as x, onMounted as J, openBlock as t, createElementBlock as c, createVNode as S, unref as r, toDisplayString as i, createBlock as p, withCtx as d, createTextVNode as f, createCommentVNode as N } from "vue";
2
+ import { u as B, a as L, b as V, _ as h } from "./main-BMXOPzsN.js";
3
+ const b = { class: "fr-text--xs" }, E = { key: 0 }, P = {
4
+ key: 1,
5
+ class: "text-gray-medium"
6
+ }, j = /* @__PURE__ */ z({
7
+ __name: "JsonPreview.client",
8
+ props: {
9
+ resource: {}
10
+ },
11
+ setup(y) {
12
+ const T = C(
13
+ () => import("./vue3-json-viewer-BgCuOAH6.js").then((e) => (Promise.resolve({ }), e.JsonViewer))
14
+ ), m = y, v = B(), { t: n } = L(), s = l(null), u = l(!1), a = l(null), g = l(!1), _ = x(() => V(m.resource)), w = x(() => {
15
+ const e = _.value;
16
+ if (!e || !v.maxJsonPreviewCharSize)
17
+ return !1;
18
+ const o = v.maxJsonPreviewCharSize;
19
+ return e <= o;
20
+ }), k = async () => {
21
+ if (!w.value) {
22
+ g.value = !0;
23
+ return;
24
+ }
25
+ u.value = !0, a.value = null;
26
+ try {
27
+ const e = await fetch(m.resource.url);
28
+ if (!e.ok)
29
+ throw new Error(`HTTP error! status: ${e.status}`);
30
+ const o = await e.json();
31
+ s.value = o;
32
+ } catch (e) {
33
+ console.error("Error loading JSON:", e), e instanceof TypeError ? a.value = "network" : a.value = "generic", s.value = null;
34
+ } finally {
35
+ u.value = !1;
36
+ }
37
+ };
38
+ return J(() => {
39
+ k();
40
+ }), (e, o) => (t(), c("div", b, [
41
+ s.value ? (t(), c("div", E, [
42
+ S(r(T), {
43
+ value: s.value,
44
+ boxed: "",
45
+ sort: "",
46
+ theme: "light",
47
+ "max-depth": 3,
48
+ "expand-depth": 2,
49
+ "indent-width": 2
50
+ }, null, 8, ["value"])
51
+ ])) : u.value ? (t(), c("div", P, i(r(n)("Chargement de l'aperçu JSON...")), 1)) : g.value ? (t(), p(h, { key: 2 }, {
52
+ default: d(() => [
53
+ f(i(_.value ? r(n)("Le fichier JSON est trop volumineux pour être prévisualisé. Téléchargez-le depuis l'onglet Téléchargements.") : r(n)("La taille du fichier est inconnue, l'aperçu n'est pas disponible. Téléchargez-le depuis l'onglet Téléchargements.")), 1)
54
+ ]),
55
+ _: 1
56
+ })) : a.value === "network" ? (t(), p(h, { key: 3 }, {
57
+ default: d(() => [
58
+ f(i(r(n)("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)
59
+ ]),
60
+ _: 1
61
+ })) : a.value ? (t(), p(h, { key: 4 }, {
62
+ default: d(() => [
63
+ f(i(r(n)("L'aperçu de ce fichier n'a pas pu être chargé. Téléchargez-le depuis l'onglet Téléchargements.")), 1)
64
+ ]),
65
+ _: 1
66
+ })) : N("", !0)
67
+ ]));
68
+ }
69
+ });
70
+ export {
71
+ j as default
72
+ };
@@ -2,8 +2,8 @@ import { B as tt, J as it, E as w, aC as ri, l as T, u as G, aj as Ct, aq as ki,
2
2
  import { P as hi, T as Ce, r as qi, f as St, g as Zi, M as ci, t as we, d as E, h as kt, c as he, i as ji, W as oe, j as Ji, k as Qi, l as le, D as en, m as Nt } from "./Image-34hvypZI.js";
3
3
  import { C as Lt, a as nt, c as At, e as zt, f as We, g as mt, h as tn, M as se } from "./Control-DuZJdKV_.js";
4
4
  import { a as j, j as Fe, k as nn, d as sn, n as rn, o as an, e as Ft, g as Vt } from "./common-PJfpC179.js";
5
- import { K as ui, u as on, H as ae, V as He } from "./View-BR92hTWP.js";
6
- import { B as ln, f as di, t as fi, w as hn, r as Kt, l as cn, a as st, b as un, N as gi, L as It, i as _i, R as dn, E as Me } from "./Event--kp8kMdJ.js";
5
+ import { K as ui, u as on, H as ae, V as He } from "./View-SHblmfOT.js";
6
+ import { B as ln, f as di, t as fi, w as hn, r as Kt, l as cn, a as st, b as un, N as gi, L as It, i as _i, R as dn, E as Me } from "./Event-B0pbfyAo.js";
7
7
  const B = {
8
8
  /**
9
9
  * Triggered when an item is added to the collection.
@@ -0,0 +1,102 @@
1
+ import { defineComponent as E, useTemplateRef as G, ref as W, onMounted as B, openBlock as m, createBlock as z, withCtx as N, createTextVNode as U, toDisplayString as V, unref as q, createElementBlock as A } from "vue";
2
+ import { a as D, _ as F } from "./main-BMXOPzsN.js";
3
+ const Z = /* @__PURE__ */ E({
4
+ __name: "MapContainer.client",
5
+ props: {
6
+ resource: {}
7
+ },
8
+ setup(f) {
9
+ const r = f, { t: d } = D();
10
+ let e = null;
11
+ const a = G("mapRef"), n = W(!1);
12
+ async function w() {
13
+ const [
14
+ { default: i },
15
+ { default: s },
16
+ { default: y },
17
+ { default: C },
18
+ { default: h },
19
+ _
20
+ ] = await Promise.all([
21
+ import("./View-SHblmfOT.js").then((t) => t.M),
22
+ import("./Map-ByzoJvTf.js").then((t) => t.U),
23
+ import("./ScaleLine-KW-nXqp3.js"),
24
+ import("./Tile-nykTnQlb.js").then((t) => t.d),
25
+ import("./OSM-FSBCBM2l.js"),
26
+ // @ts-expect-error no types provided
27
+ import("./index-kxzw3Ssm.js")
28
+ ]), { CRS: S, GeoportalAttribution: g, GeoportalFullScreen: M, GeoportalZoom: b, LayerImport: v, LayerSwitcher: L } = _;
29
+ await Promise.resolve({ }), await Promise.resolve({ }), await Promise.resolve({ }), await Promise.resolve({ }), S.load(), e = new s({
30
+ target: a.value,
31
+ layers: [
32
+ new C({
33
+ source: new h()
34
+ })
35
+ ],
36
+ view: new i({
37
+ center: [288074.8449901076, 6247982515792289e-9],
38
+ zoom: 8,
39
+ constrainResolution: !0
40
+ })
41
+ });
42
+ const R = new y({
43
+ units: "metric",
44
+ bar: !1
45
+ });
46
+ e.addControl(R);
47
+ const T = new M({
48
+ position: "top-right"
49
+ });
50
+ e.addControl(T);
51
+ const k = new b({
52
+ position: "bottom-left"
53
+ });
54
+ e.addControl(k);
55
+ const I = new L({
56
+ options: {
57
+ position: "top-right"
58
+ }
59
+ });
60
+ e.addControl(I);
61
+ const l = new g({
62
+ position: "bottom-right"
63
+ // collapsed option is ignored by the library, thus the override below
64
+ // see https://github.com/IGNF/geopf-extensions-openlayers/issues/497
65
+ });
66
+ l.setCollapsed(!1), e.addControl(l);
67
+ const o = new v({
68
+ position: "bottom-left",
69
+ listable: !0,
70
+ layerTypes: ["WMS"]
71
+ });
72
+ o._serviceUrlImportInput.value = r.resource.url, o._formContainer.dispatchEvent(new CustomEvent("submit", { cancelable: !0 })), e.addControl(o);
73
+ const p = 500;
74
+ let c = 20;
75
+ function u() {
76
+ if (!o._getCapResponseWMSLayers)
77
+ c--, c > 0 ? setTimeout(u, p) : n.value = !0;
78
+ else {
79
+ const t = o._getCapResponseWMSLayers.filter((x) => x.Name == r.resource.title)[0];
80
+ o._addGetCapWMSLayer(t);
81
+ }
82
+ }
83
+ setTimeout(u, p);
84
+ }
85
+ return B(() => {
86
+ w();
87
+ }), (i, s) => n.value ? (m(), z(F, { key: 0 }, {
88
+ default: N(() => [
89
+ U(V(q(d)("L'aperçu cartographique de ce fichier n'a pas pu être chargé.")), 1)
90
+ ]),
91
+ _: 1
92
+ })) : (m(), A("div", {
93
+ key: 1,
94
+ id: "map",
95
+ ref_key: "mapRef",
96
+ ref: a
97
+ }, null, 512));
98
+ }
99
+ });
100
+ export {
101
+ Z as default
102
+ };
@@ -1,5 +1,5 @@
1
1
  import { W as u } from "./Image-34hvypZI.js";
2
- import { T as d, c as o, e as m, d as s } from "./TileImage-BsXBxMtq.js";
2
+ import { T as d, c as o, e as m, d as s } from "./TileImage-RLU-wMoy.js";
3
3
  class g extends d {
4
4
  /**
5
5
  * @param {Options} [options] XYZ options.