@datagouv/components-next 0.0.17 → 0.0.19
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/{JsonPreview.client-DhW6_H9n.js → JsonPreview.client-BV0aJz23.js} +33 -32
- package/dist/{MapContainer.client-Bvbt6dnn.js → MapContainer.client-CxqfY1ge.js} +3 -2
- package/dist/{PdfPreview.client-D6LTtYh7.js → PdfPreview.client-Brxtbt2i.js} +32 -31
- package/dist/{Pmtiles.client-CcrZRQLW.js → Pmtiles.client-AIjEzaIg.js} +694 -693
- package/dist/Swagger.client-C8O-wVwV.js +4 -0
- package/dist/{XmlPreview.client-Be0RWwzt.js → XmlPreview.client-XiPNQxwG.js} +27 -26
- package/dist/components-next.js +56 -55
- package/dist/main-CUy8gy19.js +101710 -0
- package/dist/{pdf-vue3-BH4rWOjw.js → pdf-vue3-Dm2ZCc3P.js} +1 -1
- package/dist/{text-clamp.esm-B39D0K4b.js → text-clamp.esm-Mb7Qdtu9.js} +5 -5
- package/dist/{vue3-json-viewer-BAs2SD9h.js → vue3-json-viewer-B1fiyuLU.js} +100 -100
- package/dist/vue3-xml-viewer.common-BvRWr7iE.js +759 -0
- package/package.json +1 -1
- package/src/main.ts +3 -2
- package/dist/Swagger.client-DTm9HS9i.js +0 -4
- package/dist/main-DCjiKaCW.js +0 -100461
- package/dist/vue3-xml-viewer.common-DL5vgWDy.js +0 -5443
|
@@ -1,51 +1,52 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { defineComponent as b, defineAsyncComponent as S, ref as o, computed as x, onMounted as C, createElementBlock as p, openBlock as n, createBlock as f, createCommentVNode as N, createVNode as a, unref as u, toDisplayString as i, withCtx as d, createElementVNode as m } from "vue";
|
|
2
|
+
import { d as P, a as h, F as v } from "./main-CUy8gy19.js";
|
|
3
|
+
const T = { class: "fr-text--xs" }, $ = { key: 0 }, E = {
|
|
3
4
|
key: 1,
|
|
4
5
|
class: "text-gray-medium"
|
|
5
|
-
},
|
|
6
|
+
}, O = /* @__PURE__ */ b({
|
|
6
7
|
__name: "JsonPreview.client",
|
|
7
8
|
props: {
|
|
8
9
|
resource: {}
|
|
9
10
|
},
|
|
10
11
|
setup(k) {
|
|
11
|
-
const z =
|
|
12
|
-
() => import("./vue3-json-viewer-
|
|
13
|
-
),
|
|
14
|
-
var
|
|
15
|
-
if (
|
|
16
|
-
return
|
|
17
|
-
const e = (
|
|
12
|
+
const z = S(
|
|
13
|
+
() => import("./vue3-json-viewer-B1fiyuLU.js").then((e) => (Promise.resolve({ }), e.JsonViewer))
|
|
14
|
+
), s = k, g = P(), l = o(null), c = o(!1), r = o(null), y = o(!1), w = x(() => {
|
|
15
|
+
var t;
|
|
16
|
+
if (s.resource.filesize)
|
|
17
|
+
return s.resource.filesize;
|
|
18
|
+
const e = (t = s.resource.extras) == null ? void 0 : t["analysis:content-length"];
|
|
18
19
|
return e && typeof e == "number" ? e : null;
|
|
19
20
|
}), J = x(() => {
|
|
20
21
|
const e = w.value;
|
|
21
|
-
if (!e || !
|
|
22
|
+
if (!e || !g.maxJsonPreviewSize)
|
|
22
23
|
return !1;
|
|
23
|
-
const
|
|
24
|
-
return e <=
|
|
24
|
+
const t = g.maxJsonPreviewSize;
|
|
25
|
+
return e <= t;
|
|
25
26
|
}), _ = async () => {
|
|
26
27
|
if (!J.value) {
|
|
27
28
|
y.value = !0;
|
|
28
29
|
return;
|
|
29
30
|
}
|
|
30
|
-
c.value = !0,
|
|
31
|
+
c.value = !0, r.value = null;
|
|
31
32
|
try {
|
|
32
|
-
const e = await fetch(
|
|
33
|
+
const e = await fetch(s.resource.url);
|
|
33
34
|
if (!e.ok)
|
|
34
35
|
throw new Error(`HTTP error! status: ${e.status}`);
|
|
35
|
-
const
|
|
36
|
-
|
|
36
|
+
const t = await e.json();
|
|
37
|
+
l.value = t;
|
|
37
38
|
} catch (e) {
|
|
38
|
-
console.error("Error loading JSON:", e), e instanceof TypeError ?
|
|
39
|
+
console.error("Error loading JSON:", e), e instanceof TypeError ? r.value = "network" : r.value = "generic", l.value = null;
|
|
39
40
|
} finally {
|
|
40
41
|
c.value = !1;
|
|
41
42
|
}
|
|
42
43
|
};
|
|
43
44
|
return C(() => {
|
|
44
45
|
_();
|
|
45
|
-
}), (e,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
value:
|
|
46
|
+
}), (e, t) => (n(), p("div", T, [
|
|
47
|
+
l.value ? (n(), p("div", $, [
|
|
48
|
+
a(u(z), {
|
|
49
|
+
value: l.value,
|
|
49
50
|
boxed: "",
|
|
50
51
|
sort: "",
|
|
51
52
|
theme: "light",
|
|
@@ -53,34 +54,34 @@ const T = { class: "fr-text--xs" }, $ = { key: 0 }, q = {
|
|
|
53
54
|
"expand-depth": 2,
|
|
54
55
|
"indent-width": 2
|
|
55
56
|
}, null, 8, ["value"])
|
|
56
|
-
])) : c.value ? (
|
|
57
|
+
])) : c.value ? (n(), p("div", E, i(e.$t("Chargement de l'aperçu JSON...")), 1)) : y.value ? (n(), f(h, {
|
|
57
58
|
key: 2,
|
|
58
59
|
type: "warning",
|
|
59
60
|
class: "flex items-center space-x-2"
|
|
60
61
|
}, {
|
|
61
62
|
default: d(() => [
|
|
62
|
-
|
|
63
|
-
|
|
63
|
+
a(u(v), { class: "shink-0 size-6" }),
|
|
64
|
+
m("span", null, i(w.value ? e.$t("Fichier JSON 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)
|
|
64
65
|
]),
|
|
65
66
|
_: 1
|
|
66
|
-
})) :
|
|
67
|
+
})) : r.value === "network" ? (n(), f(h, {
|
|
67
68
|
key: 3,
|
|
68
69
|
type: "warning",
|
|
69
70
|
class: "flex items-center space-x-2"
|
|
70
71
|
}, {
|
|
71
72
|
default: d(() => [
|
|
72
|
-
|
|
73
|
-
|
|
73
|
+
a(u(v), { class: "shink-0 size-6" }),
|
|
74
|
+
m("span", null, i(e.$t("Ce fichier JSON 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)
|
|
74
75
|
]),
|
|
75
76
|
_: 1
|
|
76
|
-
})) :
|
|
77
|
+
})) : r.value ? (n(), f(h, {
|
|
77
78
|
key: 4,
|
|
78
79
|
type: "warning",
|
|
79
80
|
class: "flex items-center space-x-2"
|
|
80
81
|
}, {
|
|
81
82
|
default: d(() => [
|
|
82
|
-
|
|
83
|
-
|
|
83
|
+
a(u(v), { class: "shink-0 size-6" }),
|
|
84
|
+
m("span", null, i(e.$t("Erreur lors du chargement de l'aperçu JSON.")), 1)
|
|
84
85
|
]),
|
|
85
86
|
_: 1
|
|
86
87
|
})) : N("", !0)
|
|
@@ -88,5 +89,5 @@ const T = { class: "fr-text--xs" }, $ = { key: 0 }, q = {
|
|
|
88
89
|
}
|
|
89
90
|
});
|
|
90
91
|
export {
|
|
91
|
-
|
|
92
|
+
O as default
|
|
92
93
|
};
|
|
@@ -6,7 +6,8 @@ var si = (i, e, t) => e in i ? ri(i, e, { enumerable: !0, configurable: !0, writ
|
|
|
6
6
|
var mt = (i, e, t) => si(i, typeof e != "symbol" ? e + "" : e, t), ai = (i, e, t) => e.has(i) || Rt("Cannot " + t);
|
|
7
7
|
var Pt = (i, e, t) => e.has(i) ? Rt("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(i) : e.set(i, t);
|
|
8
8
|
var ft = (i, e, t) => (ai(i, e, "access private method"), t);
|
|
9
|
-
import {
|
|
9
|
+
import { defineComponent, ref, onMounted, createBlock, createElementBlock, openBlock, withCtx, createVNode, createElementVNode, unref, toDisplayString } from "vue";
|
|
10
|
+
import { c as commonjsGlobal, g as getDefaultExportFromCjs$1, u as useI18n, a as _sfc_main$1, F as Fe } from "./main-CUy8gy19.js";
|
|
10
11
|
const ObjectEventType = {
|
|
11
12
|
/**
|
|
12
13
|
* Triggered when a property is changed.
|
|
@@ -78298,7 +78299,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
78298
78299
|
}, {
|
|
78299
78300
|
default: withCtx(() => [
|
|
78300
78301
|
createVNode(unref(Fe), { class: "shink-0 size-6" }),
|
|
78301
|
-
|
|
78302
|
+
createElementVNode("span", null, toDisplayString(unref(t)("L'aperçu cartographique de ce fichier n'a pas pu être chargé.")), 1)
|
|
78302
78303
|
]),
|
|
78303
78304
|
_: 1
|
|
78304
78305
|
})) : (openBlock(), createElementBlock("div", {
|
|
@@ -1,40 +1,41 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineComponent as T, defineAsyncComponent as $, ref as l, computed as y, onMounted as q, createElementBlock as p, openBlock as t, createBlock as f, createCommentVNode as B, createVNode as a, unref as u, toDisplayString as c, withCtx as d, createElementVNode as g } from "vue";
|
|
2
|
+
import { d as L, a as h, F as m } from "./main-CUy8gy19.js";
|
|
2
3
|
const O = { class: "text-xs" }, S = { key: 0 }, N = {
|
|
3
4
|
key: 1,
|
|
4
5
|
class: "text-gray-medium"
|
|
5
|
-
},
|
|
6
|
+
}, H = /* @__PURE__ */ T({
|
|
6
7
|
__name: "PdfPreview.client",
|
|
7
8
|
props: {
|
|
8
9
|
resource: {}
|
|
9
10
|
},
|
|
10
11
|
setup(w) {
|
|
11
|
-
const
|
|
12
|
-
() => import("./pdf-vue3-
|
|
13
|
-
),
|
|
14
|
-
var
|
|
15
|
-
if (
|
|
16
|
-
return
|
|
17
|
-
const e = (
|
|
12
|
+
const k = $(
|
|
13
|
+
() => import("./pdf-vue3-Dm2ZCc3P.js").then((e) => e.default)
|
|
14
|
+
), s = w, b = L(), n = l(!1), i = l(!1), r = l(null), P = l(!1), v = y(() => {
|
|
15
|
+
var o;
|
|
16
|
+
if (s.resource.filesize)
|
|
17
|
+
return s.resource.filesize;
|
|
18
|
+
const e = (o = s.resource.extras) == null ? void 0 : o["analysis:content-length"];
|
|
18
19
|
return e && typeof e == "number" ? e : null;
|
|
19
20
|
}), z = y(() => {
|
|
20
21
|
const e = v.value;
|
|
21
22
|
if (!e)
|
|
22
23
|
return !1;
|
|
23
|
-
const
|
|
24
|
-
return e <=
|
|
24
|
+
const o = b.maxPdfPreviewSize ?? 1e7;
|
|
25
|
+
return e <= o;
|
|
25
26
|
}), D = async () => {
|
|
26
27
|
if (!z.value) {
|
|
27
28
|
P.value = !0;
|
|
28
29
|
return;
|
|
29
30
|
}
|
|
30
|
-
i.value = !0,
|
|
31
|
+
i.value = !0, r.value = null;
|
|
31
32
|
try {
|
|
32
|
-
const e = await fetch(
|
|
33
|
+
const e = await fetch(s.resource.url, { method: "HEAD" });
|
|
33
34
|
if (!e.ok)
|
|
34
35
|
throw new Error(`HTTP error! status: ${e.status}`);
|
|
35
|
-
|
|
36
|
+
n.value = !0;
|
|
36
37
|
} catch (e) {
|
|
37
|
-
console.error("Error testing PDF URL:", e), e instanceof TypeError ?
|
|
38
|
+
console.error("Error testing PDF URL:", e), e instanceof TypeError ? r.value = "network" : r.value = "generic", n.value = !1;
|
|
38
39
|
} finally {
|
|
39
40
|
i.value = !1;
|
|
40
41
|
}
|
|
@@ -42,19 +43,19 @@ const O = { class: "text-xs" }, S = { key: 0 }, N = {
|
|
|
42
43
|
console.log(`PDF loading progress: ${e}%`);
|
|
43
44
|
}, C = () => {
|
|
44
45
|
console.log("PDF download completed");
|
|
45
|
-
}, x = (e) => {
|
|
46
|
-
console.log(`PDF page changed to: ${e}`);
|
|
47
46
|
}, _ = (e) => {
|
|
47
|
+
console.log(`PDF page changed to: ${e}`);
|
|
48
|
+
}, x = (e) => {
|
|
48
49
|
console.log("PDF initialized:", e);
|
|
49
50
|
}, E = (e) => {
|
|
50
|
-
console.error("PDF loading error:", e), e instanceof TypeError ?
|
|
51
|
+
console.error("PDF loading error:", e), e instanceof TypeError ? r.value = "network" : r.value = "generic", n.value = !1;
|
|
51
52
|
};
|
|
52
53
|
return q(() => {
|
|
53
54
|
D();
|
|
54
|
-
}), (e,
|
|
55
|
-
|
|
56
|
-
a(u(
|
|
57
|
-
src:
|
|
55
|
+
}), (e, o) => (t(), p("div", O, [
|
|
56
|
+
n.value ? (t(), p("div", S, [
|
|
57
|
+
a(u(k), {
|
|
58
|
+
src: s.resource.url,
|
|
58
59
|
"show-progress": !0,
|
|
59
60
|
"progress-color": "#0063cb",
|
|
60
61
|
"show-page-tooltip": !0,
|
|
@@ -69,37 +70,37 @@ const O = { class: "text-xs" }, S = { key: 0 }, N = {
|
|
|
69
70
|
class: "w-full",
|
|
70
71
|
onOnProgress: F,
|
|
71
72
|
onOnComplete: C,
|
|
72
|
-
onOnPageChange:
|
|
73
|
-
onOnPdfInit:
|
|
73
|
+
onOnPageChange: _,
|
|
74
|
+
onOnPdfInit: x,
|
|
74
75
|
onOnError: E
|
|
75
76
|
}, null, 8, ["src"])
|
|
76
|
-
])) : i.value ? (
|
|
77
|
+
])) : i.value ? (t(), p("div", N, c(e.$t("Chargement de l'aperçu PDF...")), 1)) : P.value ? (t(), f(h, {
|
|
77
78
|
key: 2,
|
|
78
79
|
type: "warning",
|
|
79
80
|
class: "flex items-center space-x-2"
|
|
80
81
|
}, {
|
|
81
82
|
default: d(() => [
|
|
82
|
-
a(u(
|
|
83
|
+
a(u(m), { class: "shink-0 size-6" }),
|
|
83
84
|
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
|
]),
|
|
85
86
|
_: 1
|
|
86
|
-
})) :
|
|
87
|
+
})) : r.value === "network" ? (t(), f(h, {
|
|
87
88
|
key: 3,
|
|
88
89
|
type: "warning",
|
|
89
90
|
class: "flex items-center space-x-2"
|
|
90
91
|
}, {
|
|
91
92
|
default: d(() => [
|
|
92
|
-
a(u(
|
|
93
|
+
a(u(m), { class: "shink-0 size-6" }),
|
|
93
94
|
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
|
]),
|
|
95
96
|
_: 1
|
|
96
|
-
})) :
|
|
97
|
+
})) : r.value ? (t(), f(h, {
|
|
97
98
|
key: 4,
|
|
98
99
|
type: "warning",
|
|
99
100
|
class: "flex items-center space-x-2"
|
|
100
101
|
}, {
|
|
101
102
|
default: d(() => [
|
|
102
|
-
a(u(
|
|
103
|
+
a(u(m), { class: "shink-0 size-6" }),
|
|
103
104
|
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
|
]),
|
|
105
106
|
_: 1
|
|
@@ -108,5 +109,5 @@ const O = { class: "text-xs" }, S = { key: 0 }, N = {
|
|
|
108
109
|
}
|
|
109
110
|
});
|
|
110
111
|
export {
|
|
111
|
-
|
|
112
|
+
H as default
|
|
112
113
|
};
|