@datagouv/components-next 1.0.2-dev.3 → 1.0.2-dev.31
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-BzyuQrsK.js +30 -0
- package/dist/{Event--kp8kMdJ.js → Event-B0pbfyAo.js} +1 -1
- package/dist/JsonPreview.client-CsFH4_pc.js +78 -0
- package/dist/{Map-BjUnLyj8.js → Map-ByzoJvTf.js} +2 -2
- package/dist/MapContainer.client-PxTb3GFB.js +102 -0
- package/dist/{OSM-s40W6sQ2.js → OSM-FSBCBM2l.js} +1 -1
- package/dist/{PdfPreview.client-C-w6-w44.js → PdfPreview.client-F9riTFzW.js} +693 -699
- package/dist/{Pmtiles.client-BR7_ldHY.js → Pmtiles.client-BdN6D_o3.js} +575 -580
- package/dist/Swagger.client-DRsUsdkD.js +4 -0
- package/dist/{Tile-DbNFNPfU.js → Tile-nykTnQlb.js} +4 -4
- package/dist/{TileImage-BsXBxMtq.js → TileImage-RLU-wMoy.js} +1 -1
- package/dist/{View-BR92hTWP.js → View-SHblmfOT.js} +1 -1
- package/dist/XmlPreview.client-CLDalkuE.js +70 -0
- package/dist/components-next.css +4 -4
- package/dist/components-next.js +47 -46
- package/dist/components.css +1 -1
- package/dist/{index-SrYZwgCT.js → index-DwQ7YeNi.js} +1164 -1164
- package/dist/{leaflet-src-7m1mB8LI.js → leaflet-src-DKk3Q492.js} +185 -183
- package/dist/{main-B2kXxWRG.js → main-BLApSdTQ.js} +34789 -34016
- package/dist/{text-clamp.esm-B5kW_XMt.js → text-clamp.esm-DVseBqZZ.js} +4 -4
- package/dist/{tilecoord-Db24Px13.js → tilecoord-BgTy1qJO.js} +5 -5
- package/dist/{vue3-json-viewer-BXwup7nO.js → vue3-json-viewer-BgCuOAH6.js} +10 -10
- package/dist/{vue3-xml-viewer.common-BRxsqI9j.js → vue3-xml-viewer.common-DkEC3fSC.js} +16 -16
- package/package.json +9 -5
- package/src/components/Form/SearchableSelect.vue +2 -1
- package/src/components/ReadMore.vue +1 -1
- package/src/components/ResourceAccordion/Datafair.client.vue +4 -10
- package/src/components/ResourceAccordion/JsonPreview.client.vue +34 -47
- package/src/components/ResourceAccordion/MapContainer.client.vue +7 -11
- package/src/components/ResourceAccordion/Metadata.vue +1 -2
- package/src/components/ResourceAccordion/PdfPreview.client.vue +28 -32
- package/src/components/ResourceAccordion/Pmtiles.client.vue +5 -10
- package/src/components/ResourceAccordion/Preview.vue +5 -10
- package/src/components/ResourceAccordion/PreviewLoader.vue +1 -2
- package/src/components/ResourceAccordion/PreviewUnavailable.vue +22 -0
- package/src/components/ResourceAccordion/ResourceAccordion.vue +1 -2
- package/src/components/ResourceAccordion/XmlPreview.client.vue +34 -47
- package/src/components/ResourceExplorer/ResourceExplorer.vue +21 -10
- package/src/components/ResourceExplorer/ResourceExplorerViewer.vue +13 -3
- package/src/composables/useResourceCapabilities.ts +1 -1
- package/src/config.ts +2 -0
- package/src/functions/datasets.ts +0 -17
- package/src/functions/resources.ts +56 -1
- package/src/types/dataservices.ts +2 -0
- package/src/types/organizations.ts +1 -1
- package/src/types/users.ts +0 -1
- package/dist/Datafair.client-E5D6ePRC.js +0 -35
- package/dist/JsonPreview.client-C-6eBbPw.js +0 -87
- package/dist/MapContainer.client-DRkAmdOc.js +0 -105
- package/dist/Swagger.client-D4-F6yEf.js +0 -4
- package/dist/XmlPreview.client-Dl2VCgXF.js +0 -79
- /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-BLApSdTQ.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-
|
|
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,78 @@
|
|
|
1
|
+
import { defineComponent as S, defineAsyncComponent as z, ref as u, computed as g, onMounted as J, openBlock as r, createElementBlock as m, createVNode as N, unref as s, toDisplayString as l, createBlock as i, withCtx as c, createTextVNode as p, createCommentVNode as b } from "vue";
|
|
2
|
+
import { u as B, a as O, b as V, c as E, _ as d } from "./main-BLApSdTQ.js";
|
|
3
|
+
const L = { class: "fr-text--xs" }, D = { key: 0 }, P = {
|
|
4
|
+
key: 1,
|
|
5
|
+
class: "text-gray-medium"
|
|
6
|
+
}, q = /* @__PURE__ */ S({
|
|
7
|
+
__name: "JsonPreview.client",
|
|
8
|
+
props: {
|
|
9
|
+
resource: {}
|
|
10
|
+
},
|
|
11
|
+
setup(T) {
|
|
12
|
+
const y = z(
|
|
13
|
+
() => import("./vue3-json-viewer-BgCuOAH6.js").then((e) => (Promise.resolve({ }), e.JsonViewer))
|
|
14
|
+
), f = T, x = B(), { t: a } = O(), o = u(null), h = u(!1), t = u(null), v = u(!1), _ = g(() => V(f.resource)), k = g(() => E(f.resource)), w = g(() => {
|
|
15
|
+
const e = _.value, n = x.maxJsonPreviewCharSize;
|
|
16
|
+
return !e || !n ? !1 : e <= n;
|
|
17
|
+
}), C = async () => {
|
|
18
|
+
if (t.value = null, v.value = !1, !w.value) {
|
|
19
|
+
v.value = !0;
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
if (k.value === "blocked") {
|
|
23
|
+
t.value = "cors";
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
h.value = !0;
|
|
27
|
+
try {
|
|
28
|
+
const e = await fetch(f.resource.url);
|
|
29
|
+
if (!e.ok)
|
|
30
|
+
throw new Error(`HTTP error! status: ${e.status}`);
|
|
31
|
+
const n = await e.json();
|
|
32
|
+
o.value = n;
|
|
33
|
+
} catch (e) {
|
|
34
|
+
console.error("Error loading JSON:", e), e instanceof TypeError ? t.value = "network" : t.value = "generic", o.value = null;
|
|
35
|
+
} finally {
|
|
36
|
+
h.value = !1;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
return J(() => {
|
|
40
|
+
C();
|
|
41
|
+
}), (e, n) => (r(), m("div", L, [
|
|
42
|
+
o.value ? (r(), m("div", D, [
|
|
43
|
+
N(s(y), {
|
|
44
|
+
value: o.value,
|
|
45
|
+
boxed: "",
|
|
46
|
+
sort: "",
|
|
47
|
+
theme: "light",
|
|
48
|
+
"max-depth": 3,
|
|
49
|
+
"expand-depth": 2,
|
|
50
|
+
"indent-width": 2
|
|
51
|
+
}, null, 8, ["value"])
|
|
52
|
+
])) : h.value ? (r(), m("div", P, l(s(a)("Chargement de l'aperçu JSON...")), 1)) : v.value ? (r(), i(d, { key: 2 }, {
|
|
53
|
+
default: c(() => [
|
|
54
|
+
p(l(_.value ? s(a)("Le fichier JSON est trop volumineux pour être prévisualisé. Téléchargez-le depuis l'onglet Téléchargements.") : s(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)
|
|
55
|
+
]),
|
|
56
|
+
_: 1
|
|
57
|
+
})) : t.value === "cors" ? (r(), i(d, { key: 3 }, {
|
|
58
|
+
default: c(() => [
|
|
59
|
+
p(l(s(a)("Ce fichier JSON ne peut pas être prévisualisé car il est hébergé sur un site distant qui restreint l'accès (CORS). Téléchargez-le depuis l'onglet Téléchargements.")), 1)
|
|
60
|
+
]),
|
|
61
|
+
_: 1
|
|
62
|
+
})) : t.value === "network" ? (r(), i(d, { key: 4 }, {
|
|
63
|
+
default: c(() => [
|
|
64
|
+
p(l(s(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)
|
|
65
|
+
]),
|
|
66
|
+
_: 1
|
|
67
|
+
})) : t.value ? (r(), i(d, { key: 5 }, {
|
|
68
|
+
default: c(() => [
|
|
69
|
+
p(l(s(a)("L'aperçu de ce fichier n'a pas pu être chargé. Téléchargez-le depuis l'onglet Téléchargements.")), 1)
|
|
70
|
+
]),
|
|
71
|
+
_: 1
|
|
72
|
+
})) : b("", !0)
|
|
73
|
+
]));
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
export {
|
|
77
|
+
q as default
|
|
78
|
+
};
|
|
@@ -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-
|
|
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
|
|
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-BLApSdTQ.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-DwQ7YeNi.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
|
+
};
|