@datagouv/components-next 1.0.2-dev.4 → 1.0.2-dev.41
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-BAokThtJ.js +30 -0
- package/dist/JsonPreview.client-DGiaDxVv.js +40 -0
- package/dist/{MapContainer.client-DjjvdKBp.js → MapContainer.client-BKGsAP0Y.js} +35 -38
- package/dist/{PdfPreview.client-CsvKU0Aq.js → PdfPreview.client-CGjP5ZYb.js} +822 -865
- package/dist/{Pmtiles.client-uqg1fwOl.js → Pmtiles.client-C1I7pwT5.js} +574 -579
- package/dist/PreviewWrapper.vue_vue_type_script_setup_true_lang-BlcvVwW8.js +61 -0
- package/dist/Swagger.client-U7ZDVUHL.js +4 -0
- package/dist/XmlPreview.client-CHUVVEH6.js +34 -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-CzClB3i0.js} +1 -1
- package/dist/{main-ByqZlhiZ.js → main-CF7lWk6R.js} +31224 -30474
- package/dist/{vue3-xml-viewer.common-DFrGHXJC.js → vue3-xml-viewer.common-CAwAbUJl.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 +23 -121
- package/src/components/ResourceAccordion/MapContainer.client.vue +7 -11
- package/src/components/ResourceAccordion/Metadata.vue +1 -2
- package/src/components/ResourceAccordion/PdfPreview.client.vue +24 -103
- 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/PreviewWrapper.vue +82 -0
- package/src/components/ResourceAccordion/ResourceAccordion.vue +1 -2
- package/src/components/ResourceAccordion/XmlPreview.client.vue +16 -115
- 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 +3 -24
- package/src/types/dataservices.ts +2 -0
- package/src/types/organizations.ts +1 -1
- package/src/types/pages.ts +0 -5
- package/src/types/posts.ts +2 -2
- package/src/types/reports.ts +3 -0
- package/src/types/search.ts +26 -1
- package/src/types/site.ts +5 -3
- 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,61 @@
|
|
|
1
|
+
import { defineComponent as _, ref as g, computed as h, onMounted as S, nextTick as w, createElementBlock as k, openBlock as l, renderSlot as C, createBlock as n, createCommentVNode as b, toDisplayString as r, unref as a, withCtx as o, createTextVNode as u } from "vue";
|
|
2
|
+
import { a as B, g as E, b as L, _ as c } from "./main-CF7lWk6R.js";
|
|
3
|
+
const R = { class: "text-xs" }, q = {
|
|
4
|
+
key: 1,
|
|
5
|
+
class: "text-gray-medium"
|
|
6
|
+
}, V = /* @__PURE__ */ _({
|
|
7
|
+
__name: "PreviewWrapper",
|
|
8
|
+
props: {
|
|
9
|
+
fileType: {},
|
|
10
|
+
resource: {},
|
|
11
|
+
maxSize: {},
|
|
12
|
+
load: { type: Function }
|
|
13
|
+
},
|
|
14
|
+
emits: ["loaded"],
|
|
15
|
+
setup(s, { emit: x }) {
|
|
16
|
+
const i = s, z = x, { t } = B(), p = g(null), d = g(!1), f = g(null), y = h(() => E(i.resource)), T = h(() => L(i.resource)), v = h(() => {
|
|
17
|
+
const e = y.value, m = i.maxSize;
|
|
18
|
+
return !e || !m ? !1 : e <= m;
|
|
19
|
+
});
|
|
20
|
+
return S(async () => {
|
|
21
|
+
if (!(!v.value || T.value === "blocked")) {
|
|
22
|
+
d.value = !0;
|
|
23
|
+
try {
|
|
24
|
+
p.value = await i.load(), await w(), z("loaded");
|
|
25
|
+
} catch (e) {
|
|
26
|
+
console.error("Error loading preview:", e), f.value = e instanceof TypeError ? "network" : "generic";
|
|
27
|
+
} finally {
|
|
28
|
+
d.value = !1;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}), (e, m) => (l(), k("div", R, [
|
|
32
|
+
p.value !== null ? C(e.$slots, "default", {
|
|
33
|
+
key: 0,
|
|
34
|
+
data: p.value
|
|
35
|
+
}) : d.value ? (l(), k("div", q, r(a(t)("Chargement de l'aperçu {fileType}...", { fileType: s.fileType })), 1)) : v.value ? T.value === "blocked" ? (l(), n(c, { key: 3 }, {
|
|
36
|
+
default: o(() => [
|
|
37
|
+
u(r(a(t)("Ce fichier {fileType} 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.", { fileType: s.fileType })), 1)
|
|
38
|
+
]),
|
|
39
|
+
_: 1
|
|
40
|
+
})) : f.value === "network" ? (l(), n(c, { key: 4 }, {
|
|
41
|
+
default: o(() => [
|
|
42
|
+
u(r(a(t)("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)
|
|
43
|
+
]),
|
|
44
|
+
_: 1
|
|
45
|
+
})) : f.value ? (l(), n(c, { key: 5 }, {
|
|
46
|
+
default: o(() => [
|
|
47
|
+
u(r(a(t)("L'aperçu de ce fichier n'a pas pu être chargé. Téléchargez-le depuis l'onglet Téléchargements.")), 1)
|
|
48
|
+
]),
|
|
49
|
+
_: 1
|
|
50
|
+
})) : b("", !0) : (l(), n(c, { key: 2 }, {
|
|
51
|
+
default: o(() => [
|
|
52
|
+
u(r(y.value ? a(t)("Le fichier {fileType} est trop volumineux pour être prévisualisé. Téléchargez-le depuis l'onglet Téléchargements.", { fileType: s.fileType }) : a(t)("La taille du fichier est inconnue, l'aperçu n'est pas disponible. Téléchargez-le depuis l'onglet Téléchargements.")), 1)
|
|
53
|
+
]),
|
|
54
|
+
_: 1
|
|
55
|
+
}))
|
|
56
|
+
]));
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
export {
|
|
60
|
+
V as _
|
|
61
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { defineComponent as i, defineAsyncComponent as m, createBlock as u, openBlock as f, unref as t, withCtx as l, createVNode as p } from "vue";
|
|
2
|
+
import { u as x } from "./main-CF7lWk6R.js";
|
|
3
|
+
import { _ as w } from "./PreviewWrapper.vue_vue_type_script_setup_true_lang-BlcvVwW8.js";
|
|
4
|
+
const X = /* @__PURE__ */ i({
|
|
5
|
+
__name: "XmlPreview.client",
|
|
6
|
+
props: {
|
|
7
|
+
resource: {}
|
|
8
|
+
},
|
|
9
|
+
setup(r) {
|
|
10
|
+
const o = m(
|
|
11
|
+
() => import("./vue3-xml-viewer.common-CAwAbUJl.js").then((e) => e.v).then((e) => e.default || e.XmlViewer)
|
|
12
|
+
), n = r, s = x(), c = async () => {
|
|
13
|
+
const e = await fetch(n.resource.url);
|
|
14
|
+
if (!e.ok) throw new Error(`HTTP error! status: ${e.status}`);
|
|
15
|
+
return e.text();
|
|
16
|
+
};
|
|
17
|
+
return (e, _) => (f(), u(w, {
|
|
18
|
+
"file-type": "XML",
|
|
19
|
+
resource: r.resource,
|
|
20
|
+
"max-size": t(s).maxXmlPreviewCharSize,
|
|
21
|
+
load: c
|
|
22
|
+
}, {
|
|
23
|
+
default: l(({ data: a }) => [
|
|
24
|
+
p(t(o), {
|
|
25
|
+
xml: a
|
|
26
|
+
}, null, 8, ["xml"])
|
|
27
|
+
]),
|
|
28
|
+
_: 1
|
|
29
|
+
}, 8, ["resource", "max-size"]));
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
export {
|
|
33
|
+
X as default
|
|
34
|
+
};
|