@datagouv/components-next 1.0.2-dev.4 → 1.0.2-dev.40
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-CYO9vwx6.js +30 -0
- package/dist/JsonPreview.client-B6aU3vl4.js +78 -0
- package/dist/{MapContainer.client-DjjvdKBp.js → MapContainer.client-BZsKgRUh.js} +35 -38
- package/dist/{PdfPreview.client-CsvKU0Aq.js → PdfPreview.client-ClkseuKU.js} +694 -700
- package/dist/{Pmtiles.client-uqg1fwOl.js → Pmtiles.client-CUaeaV-O.js} +574 -579
- package/dist/Swagger.client-FpYXdDuX.js +4 -0
- package/dist/XmlPreview.client-BNGHvVnU.js +70 -0
- package/dist/components-next.css +3 -3
- package/dist/components-next.js +83 -86
- package/dist/components.css +1 -1
- package/dist/{index-PMeuFwWj.js → index-B0fPq7-b.js} +1 -1
- package/dist/{main-ByqZlhiZ.js → main-ifX24DGW.js} +31224 -30474
- package/dist/{vue3-xml-viewer.common-DFrGHXJC.js → vue3-xml-viewer.common-Bkgr-tAS.js} +1 -1
- package/package.json +10 -8
- package/src/components/ActivityList/ActivityList.vue +0 -2
- package/src/components/Form/SearchableSelect.vue +2 -1
- package/src/components/Pagination.vue +8 -5
- 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 +6 -11
- 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 +24 -3
- package/src/components/Search/GlobalSearch.vue +29 -4
- 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/functions/tabularApi.ts +7 -84
- package/src/main.ts +2 -22
- package/src/types/dataservices.ts +2 -0
- package/src/types/organizations.ts +1 -1
- package/src/types/reports.ts +3 -0
- package/src/types/search.ts +26 -1
- package/src/types/users.ts +0 -1
- package/dist/Datafair.client-c1cUKkQR.js +0 -35
- package/dist/JsonPreview.client-CAs9XTCX.js +0 -87
- package/dist/Swagger.client-BGrkka3l.js +0 -4
- package/dist/XmlPreview.client-BWbKzLte.js +0 -79
- package/src/components/Chart/ChartViewer.vue +0 -152
- package/src/components/Chart/ChartViewerWrapper.vue +0 -194
- package/src/functions/pagination.ts +0 -9
- package/src/types/visualizations.ts +0 -84
- /package/assets/illustrations/{_microscope.svg → microscope.svg} +0 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { defineComponent as z, defineAsyncComponent as X, ref as u, computed as v, onMounted as L, createElementBlock as g, openBlock as r, createBlock as i, createCommentVNode as S, createVNode as b, unref as s, toDisplayString as n, withCtx as c, createTextVNode as f } from "vue";
|
|
2
|
+
import { u as B, a as M, g as V, b as E, _ as p } from "./main-ifX24DGW.js";
|
|
3
|
+
const D = { class: "fr-text--xs" }, N = { key: 0 }, P = {
|
|
4
|
+
key: 1,
|
|
5
|
+
class: "text-gray-medium"
|
|
6
|
+
}, A = /* @__PURE__ */ z({
|
|
7
|
+
__name: "XmlPreview.client",
|
|
8
|
+
props: {
|
|
9
|
+
resource: {}
|
|
10
|
+
},
|
|
11
|
+
setup(T) {
|
|
12
|
+
const x = X(
|
|
13
|
+
() => import("./vue3-xml-viewer.common-Bkgr-tAS.js").then((e) => e.v).then((e) => e.default || e.XmlViewer)
|
|
14
|
+
), d = T, y = B(), { t: a } = M(), o = u(null), m = u(!1), t = u(null), h = u(!1), _ = v(() => V(d.resource)), k = v(() => E(d.resource)), w = v(() => {
|
|
15
|
+
const e = _.value, l = y.maxXmlPreviewCharSize;
|
|
16
|
+
return !e || !l ? !1 : e <= l;
|
|
17
|
+
}), C = async () => {
|
|
18
|
+
if (t.value = null, h.value = !1, !w.value) {
|
|
19
|
+
h.value = !0;
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
if (k.value === "blocked") {
|
|
23
|
+
t.value = "cors";
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
m.value = !0;
|
|
27
|
+
try {
|
|
28
|
+
const e = await fetch(d.resource.url);
|
|
29
|
+
if (!e.ok)
|
|
30
|
+
throw new Error(`HTTP error! status: ${e.status}`);
|
|
31
|
+
const l = await e.text();
|
|
32
|
+
o.value = l;
|
|
33
|
+
} catch (e) {
|
|
34
|
+
console.error("Error loading XML:", e), e instanceof TypeError ? t.value = "network" : t.value = "generic", o.value = null;
|
|
35
|
+
} finally {
|
|
36
|
+
m.value = !1;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
return L(() => {
|
|
40
|
+
C();
|
|
41
|
+
}), (e, l) => (r(), g("div", D, [
|
|
42
|
+
o.value ? (r(), g("div", N, [
|
|
43
|
+
b(s(x), { xml: o.value }, null, 8, ["xml"])
|
|
44
|
+
])) : m.value ? (r(), g("div", P, n(s(a)("Chargement de l'aperçu XML...")), 1)) : h.value ? (r(), i(p, { key: 2 }, {
|
|
45
|
+
default: c(() => [
|
|
46
|
+
f(n(_.value ? s(a)("Le fichier XML 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)
|
|
47
|
+
]),
|
|
48
|
+
_: 1
|
|
49
|
+
})) : t.value === "cors" ? (r(), i(p, { key: 3 }, {
|
|
50
|
+
default: c(() => [
|
|
51
|
+
f(n(s(a)("Ce fichier XML 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)
|
|
52
|
+
]),
|
|
53
|
+
_: 1
|
|
54
|
+
})) : t.value === "network" ? (r(), i(p, { key: 4 }, {
|
|
55
|
+
default: c(() => [
|
|
56
|
+
f(n(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)
|
|
57
|
+
]),
|
|
58
|
+
_: 1
|
|
59
|
+
})) : t.value ? (r(), i(p, { key: 5 }, {
|
|
60
|
+
default: c(() => [
|
|
61
|
+
f(n(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)
|
|
62
|
+
]),
|
|
63
|
+
_: 1
|
|
64
|
+
})) : S("", !0)
|
|
65
|
+
]));
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
export {
|
|
69
|
+
A as default
|
|
70
|
+
};
|