@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.
Files changed (57) hide show
  1. package/dist/Datafair.client-BAokThtJ.js +30 -0
  2. package/dist/JsonPreview.client-DGiaDxVv.js +40 -0
  3. package/dist/{MapContainer.client-DjjvdKBp.js → MapContainer.client-BKGsAP0Y.js} +35 -38
  4. package/dist/{PdfPreview.client-CsvKU0Aq.js → PdfPreview.client-CGjP5ZYb.js} +822 -865
  5. package/dist/{Pmtiles.client-uqg1fwOl.js → Pmtiles.client-C1I7pwT5.js} +574 -579
  6. package/dist/PreviewWrapper.vue_vue_type_script_setup_true_lang-BlcvVwW8.js +61 -0
  7. package/dist/Swagger.client-U7ZDVUHL.js +4 -0
  8. package/dist/XmlPreview.client-CHUVVEH6.js +34 -0
  9. package/dist/components-next.css +3 -3
  10. package/dist/components-next.js +83 -86
  11. package/dist/components.css +1 -1
  12. package/dist/{index-PMeuFwWj.js → index-CzClB3i0.js} +1 -1
  13. package/dist/{main-ByqZlhiZ.js → main-CF7lWk6R.js} +31224 -30474
  14. package/dist/{vue3-xml-viewer.common-DFrGHXJC.js → vue3-xml-viewer.common-CAwAbUJl.js} +1 -1
  15. package/package.json +10 -8
  16. package/src/components/ActivityList/ActivityList.vue +0 -2
  17. package/src/components/Form/SearchableSelect.vue +2 -1
  18. package/src/components/Pagination.vue +8 -5
  19. package/src/components/ReadMore.vue +1 -1
  20. package/src/components/ResourceAccordion/Datafair.client.vue +4 -10
  21. package/src/components/ResourceAccordion/JsonPreview.client.vue +23 -121
  22. package/src/components/ResourceAccordion/MapContainer.client.vue +7 -11
  23. package/src/components/ResourceAccordion/Metadata.vue +1 -2
  24. package/src/components/ResourceAccordion/PdfPreview.client.vue +24 -103
  25. package/src/components/ResourceAccordion/Pmtiles.client.vue +5 -10
  26. package/src/components/ResourceAccordion/Preview.vue +6 -11
  27. package/src/components/ResourceAccordion/PreviewLoader.vue +1 -2
  28. package/src/components/ResourceAccordion/PreviewUnavailable.vue +22 -0
  29. package/src/components/ResourceAccordion/PreviewWrapper.vue +82 -0
  30. package/src/components/ResourceAccordion/ResourceAccordion.vue +1 -2
  31. package/src/components/ResourceAccordion/XmlPreview.client.vue +16 -115
  32. package/src/components/ResourceExplorer/ResourceExplorer.vue +21 -10
  33. package/src/components/ResourceExplorer/ResourceExplorerViewer.vue +24 -3
  34. package/src/components/Search/GlobalSearch.vue +29 -4
  35. package/src/composables/useResourceCapabilities.ts +1 -1
  36. package/src/config.ts +2 -0
  37. package/src/functions/datasets.ts +0 -17
  38. package/src/functions/resources.ts +56 -1
  39. package/src/functions/tabularApi.ts +7 -84
  40. package/src/main.ts +3 -24
  41. package/src/types/dataservices.ts +2 -0
  42. package/src/types/organizations.ts +1 -1
  43. package/src/types/pages.ts +0 -5
  44. package/src/types/posts.ts +2 -2
  45. package/src/types/reports.ts +3 -0
  46. package/src/types/search.ts +26 -1
  47. package/src/types/site.ts +5 -3
  48. package/src/types/users.ts +0 -1
  49. package/dist/Datafair.client-c1cUKkQR.js +0 -35
  50. package/dist/JsonPreview.client-CAs9XTCX.js +0 -87
  51. package/dist/Swagger.client-BGrkka3l.js +0 -4
  52. package/dist/XmlPreview.client-BWbKzLte.js +0 -79
  53. package/src/components/Chart/ChartViewer.vue +0 -152
  54. package/src/components/Chart/ChartViewerWrapper.vue +0 -194
  55. package/src/functions/pagination.ts +0 -9
  56. package/src/types/visualizations.ts +0 -84
  57. /package/assets/illustrations/{_microscope.svg → microscope.svg} +0 -0
@@ -0,0 +1,30 @@
1
+ import { defineComponent as l, computed as a, createElementBlock as o, openBlock as t, createBlock as u, createElementVNode as f, withCtx as p, createTextVNode as m, toDisplayString as _, unref as h } from "vue";
2
+ import { a as x, _ as g } from "./main-CF7lWk6R.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
+ f("iframe", {
14
+ src: n.value,
15
+ width: "100%",
16
+ height: "500px",
17
+ style: { "background-color": "transparent", border: "none" }
18
+ }, null, 8, k)
19
+ ])) : (t(), u(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
+ };
@@ -0,0 +1,40 @@
1
+ import { defineComponent as c, defineAsyncComponent as u, createBlock as m, openBlock as p, unref as r, withCtx as f, createVNode as l } from "vue";
2
+ import { u as d } from "./main-CF7lWk6R.js";
3
+ import { _ as h } from "./PreviewWrapper.vue_vue_type_script_setup_true_lang-BlcvVwW8.js";
4
+ const J = /* @__PURE__ */ c({
5
+ __name: "JsonPreview.client",
6
+ props: {
7
+ resource: {}
8
+ },
9
+ setup(o) {
10
+ const t = u(
11
+ () => import("./vue3-json-viewer-BXwup7nO.js").then((e) => (Promise.resolve({ }), e.JsonViewer))
12
+ ), n = o, s = d(), i = async () => {
13
+ const e = await fetch(n.resource.url);
14
+ if (!e.ok) throw new Error(`HTTP error! status: ${e.status}`);
15
+ return e.json();
16
+ };
17
+ return (e, w) => (p(), m(h, {
18
+ "file-type": "JSON",
19
+ resource: o.resource,
20
+ "max-size": r(s).maxJsonPreviewCharSize,
21
+ load: i
22
+ }, {
23
+ default: f(({ data: a }) => [
24
+ l(r(t), {
25
+ value: a,
26
+ boxed: "",
27
+ sort: "",
28
+ theme: "light",
29
+ "max-depth": 3,
30
+ "expand-depth": 2,
31
+ "indent-width": 2
32
+ }, null, 8, ["value"])
33
+ ]),
34
+ _: 1
35
+ }, 8, ["resource", "max-size"]));
36
+ }
37
+ });
38
+ export {
39
+ J as default
40
+ };
@@ -1,21 +1,21 @@
1
- import { defineComponent as G, useTemplateRef as W, ref as z, onMounted as B, createBlock as F, createElementBlock as N, openBlock as u, withCtx as V, createVNode as U, createElementVNode as q, unref as m, toDisplayString as A } from "vue";
2
- import { a as D, _ as O, F as P } from "./main-ByqZlhiZ.js";
3
- const j = /* @__PURE__ */ G({
1
+ import { defineComponent as E, useTemplateRef as G, ref as W, onMounted as B, createBlock as z, createElementBlock as N, openBlock as m, withCtx as U, createTextVNode as V, toDisplayString as q, unref as A } from "vue";
2
+ import { a as D, _ as F } from "./main-CF7lWk6R.js";
3
+ const Z = /* @__PURE__ */ E({
4
4
  __name: "MapContainer.client",
5
5
  props: {
6
6
  resource: {}
7
7
  },
8
8
  setup(f) {
9
- const a = f, { t: d } = D();
9
+ const r = f, { t: d } = D();
10
10
  let e = null;
11
- const r = W("mapRef"), n = z(!1);
11
+ const a = G("mapRef"), n = W(!1);
12
12
  async function w() {
13
13
  const [
14
14
  { default: i },
15
15
  { default: s },
16
16
  { default: y },
17
- { default: h },
18
17
  { default: C },
18
+ { default: h },
19
19
  _
20
20
  ] = await Promise.all([
21
21
  import("./View-BR92hTWP.js").then((t) => t.M),
@@ -24,13 +24,13 @@ const j = /* @__PURE__ */ G({
24
24
  import("./Tile-DbNFNPfU.js").then((t) => t.d),
25
25
  import("./OSM-s40W6sQ2.js"),
26
26
  // @ts-expect-error no types provided
27
- import("./index-PMeuFwWj.js")
28
- ]), { CRS: g, GeoportalAttribution: S, GeoportalFullScreen: M, GeoportalZoom: b, LayerImport: v, LayerSwitcher: L } = _;
29
- await Promise.resolve({ }), await Promise.resolve({ }), await Promise.resolve({ }), await Promise.resolve({ }), g.load(), e = new s({
30
- target: r.value,
27
+ import("./index-CzClB3i0.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
31
  layers: [
32
- new h({
33
- source: new C()
32
+ new C({
33
+ source: new h()
34
34
  })
35
35
  ],
36
36
  view: new i({
@@ -44,62 +44,59 @@ const j = /* @__PURE__ */ G({
44
44
  bar: !1
45
45
  });
46
46
  e.addControl(R);
47
- const k = new M({
47
+ const T = new M({
48
48
  position: "top-right"
49
49
  });
50
- e.addControl(k);
51
- const T = new b({
50
+ e.addControl(T);
51
+ const k = new b({
52
52
  position: "bottom-left"
53
53
  });
54
- e.addControl(T);
55
- const x = new L({
54
+ e.addControl(k);
55
+ const I = new L({
56
56
  options: {
57
57
  position: "top-right"
58
58
  }
59
59
  });
60
- e.addControl(x);
61
- const E = new S({
60
+ e.addControl(I);
61
+ const l = new g({
62
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
63
65
  });
64
- e.addControl(E);
66
+ l.setCollapsed(!1), e.addControl(l);
65
67
  const o = new v({
66
68
  position: "bottom-left",
67
69
  listable: !0,
68
70
  layerTypes: ["WMS"]
69
71
  });
70
- o._serviceUrlImportInput.value = a.resource.url, o._formContainer.dispatchEvent(new CustomEvent("submit", { cancelable: !0 })), e.addControl(o);
71
- const l = 500;
72
- let p = 20;
73
- function c() {
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() {
74
76
  if (!o._getCapResponseWMSLayers)
75
- p--, p > 0 ? setTimeout(c, l) : n.value = !0;
77
+ c--, c > 0 ? setTimeout(u, p) : n.value = !0;
76
78
  else {
77
- const t = o._getCapResponseWMSLayers.filter((I) => I.Name == a.resource.title)[0];
79
+ const t = o._getCapResponseWMSLayers.filter((x) => x.Name == r.resource.title)[0];
78
80
  o._addGetCapWMSLayer(t);
79
81
  }
80
82
  }
81
- setTimeout(c, l);
83
+ setTimeout(u, p);
82
84
  }
83
85
  return B(() => {
84
86
  w();
85
- }), (i, s) => n.value ? (u(), F(O, {
86
- key: 0,
87
- type: "warning",
88
- class: "flex items-center space-x-2"
89
- }, {
90
- default: V(() => [
91
- U(m(P), { class: "shrink-0 size-6" }),
92
- q("span", null, A(m(d)("L'aperçu cartographique de ce fichier n'a pas pu être chargé.")), 1)
87
+ }), (i, s) => n.value ? (m(), z(F, { key: 0 }, {
88
+ default: U(() => [
89
+ V(q(A(d)("L'aperçu cartographique de ce fichier n'a pas pu être chargé.")), 1)
93
90
  ]),
94
91
  _: 1
95
- })) : (u(), N("div", {
92
+ })) : (m(), N("div", {
96
93
  key: 1,
97
94
  id: "map",
98
95
  ref_key: "mapRef",
99
- ref: r
96
+ ref: a
100
97
  }, null, 512));
101
98
  }
102
99
  });
103
100
  export {
104
- j as default
101
+ Z as default
105
102
  };