@datagouv/components-next 1.0.2-dev.8 → 1.0.2-dev.80

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 (83) hide show
  1. package/assets/main.css +4 -0
  2. package/dist/Datafair.client-BzW-ctDf.js +30 -0
  3. package/dist/JsonPreview.client-BfMSzR07.js +40 -0
  4. package/dist/{MapContainer.client-DRkAmdOc.js → MapContainer.client-CLs-im9i.js} +35 -38
  5. package/dist/{PdfPreview.client-C-w6-w44.js → PdfPreview.client-C13PQCU_.js} +822 -865
  6. package/dist/{Pmtiles.client-BR7_ldHY.js → Pmtiles.client-CL7PXXDl.js} +574 -579
  7. package/dist/PreviewWrapper.vue_vue_type_script_setup_true_lang-C6XnsZ-7.js +61 -0
  8. package/dist/XmlPreview.client-KaENrbbG.js +34 -0
  9. package/dist/components-next.css +3 -3
  10. package/dist/components-next.js +166 -148
  11. package/dist/components.css +1 -1
  12. package/dist/{index-SrYZwgCT.js → index-C7WVVGgD.js} +1 -1
  13. package/dist/{main-B2kXxWRG.js → main-K-42Oe8-.js} +91315 -75834
  14. package/dist/{vue3-xml-viewer.common-BRxsqI9j.js → vue3-xml-viewer.common-sHPSE-jD.js} +1 -1
  15. package/package.json +17 -10
  16. package/src/components/ActivityList/ActivityList.vue +0 -2
  17. package/src/components/Chart/ChartViewer.vue +226 -0
  18. package/src/components/Chart/ChartViewerWrapper.vue +170 -0
  19. package/src/components/Form/Listbox.vue +101 -0
  20. package/src/components/Form/SearchableSelect.vue +2 -1
  21. package/src/components/InfiniteLoader.vue +53 -0
  22. package/src/components/OpenApiViewer/ContentTypeSelect.vue +48 -0
  23. package/src/components/OpenApiViewer/EndpointRequest.vue +164 -0
  24. package/src/components/OpenApiViewer/EndpointResponses.vue +149 -0
  25. package/src/components/OpenApiViewer/OpenApiViewer.vue +308 -0
  26. package/src/components/OpenApiViewer/SchemaPanel.vue +53 -0
  27. package/src/components/OpenApiViewer/SchemaTree.vue +77 -0
  28. package/src/components/OpenApiViewer/openapi.ts +150 -0
  29. package/src/components/OrganizationNameWithCertificate.vue +3 -2
  30. package/src/components/Pagination.vue +8 -5
  31. package/src/components/ReadMore.vue +1 -1
  32. package/src/components/ResourceAccordion/Datafair.client.vue +4 -10
  33. package/src/components/ResourceAccordion/JsonPreview.client.vue +23 -121
  34. package/src/components/ResourceAccordion/MapContainer.client.vue +7 -11
  35. package/src/components/ResourceAccordion/Metadata.vue +1 -2
  36. package/src/components/ResourceAccordion/PdfPreview.client.vue +24 -103
  37. package/src/components/ResourceAccordion/Pmtiles.client.vue +5 -10
  38. package/src/components/ResourceAccordion/Preview.vue +16 -21
  39. package/src/components/ResourceAccordion/PreviewLoader.vue +1 -2
  40. package/src/components/ResourceAccordion/PreviewUnavailable.vue +22 -0
  41. package/src/components/ResourceAccordion/PreviewWrapper.vue +82 -0
  42. package/src/components/ResourceAccordion/ResourceAccordion.vue +5 -7
  43. package/src/components/ResourceAccordion/XmlPreview.client.vue +16 -115
  44. package/src/components/ResourceExplorer/ResourceExplorer.vue +81 -13
  45. package/src/components/ResourceExplorer/ResourceExplorerSidebar.vue +2 -2
  46. package/src/components/ResourceExplorer/ResourceExplorerViewer.vue +30 -11
  47. package/src/components/Search/GlobalSearch.vue +173 -108
  48. package/src/components/Search/SearchInput.vue +3 -3
  49. package/src/components/TabularExplorer/TabularCell.vue +51 -0
  50. package/src/components/TabularExplorer/TabularCellPopover.vue +170 -0
  51. package/src/components/TabularExplorer/TabularExplorer.vue +870 -0
  52. package/src/components/TabularExplorer/TabularFilterContent.vue +351 -0
  53. package/src/components/TabularExplorer/TabularFilterPopover.vue +111 -0
  54. package/src/components/TabularExplorer/types.ts +83 -0
  55. package/src/composables/useHasTabularData.ts +6 -0
  56. package/src/composables/useResourceCapabilities.ts +1 -1
  57. package/src/composables/useSearchFilter.ts +118 -0
  58. package/src/composables/useStableQueryParams.ts +31 -3
  59. package/src/config.ts +3 -0
  60. package/src/functions/api.ts +34 -33
  61. package/src/functions/api.types.ts +1 -0
  62. package/src/functions/charts.ts +68 -0
  63. package/src/functions/datasets.ts +0 -17
  64. package/src/functions/resources.ts +56 -1
  65. package/src/functions/tabular.ts +60 -0
  66. package/src/functions/tabularApi.ts +138 -11
  67. package/src/main.ts +55 -7
  68. package/src/types/dataservices.ts +2 -0
  69. package/src/types/pages.ts +0 -5
  70. package/src/types/posts.ts +2 -2
  71. package/src/types/reports.ts +5 -1
  72. package/src/types/search.ts +52 -1
  73. package/src/types/site.ts +5 -3
  74. package/src/types/users.ts +2 -1
  75. package/src/types/visualizations.ts +89 -0
  76. package/assets/swagger-themes/newspaper.css +0 -1670
  77. package/dist/Datafair.client-E5D6ePRC.js +0 -35
  78. package/dist/JsonPreview.client-C-6eBbPw.js +0 -87
  79. package/dist/Swagger.client-D4-F6yEf.js +0 -4
  80. package/dist/XmlPreview.client-Dl2VCgXF.js +0 -79
  81. package/src/components/ResourceAccordion/Swagger.client.vue +0 -48
  82. package/src/functions/pagination.ts +0 -9
  83. /package/assets/illustrations/{_microscope.svg → microscope.svg} +0 -0
package/assets/main.css CHANGED
@@ -182,6 +182,10 @@
182
182
  }
183
183
 
184
184
  @layer components {
185
+ .input {
186
+ @apply block w-full rounded-t text-base leading-6 py-2 px-4 text-gray-plain bg-gray-lower! placeholder:opacity-100 placeholder:italic placeholder:text-gray-medium;
187
+ }
188
+
185
189
  .subtitle {
186
190
  @apply text-sm! font-bold! leading-5!;
187
191
  }
@@ -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-K-42Oe8-.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-K-42Oe8-.js";
3
+ import { _ as h } from "./PreviewWrapper.vue_vue_type_script_setup_true_lang-C6XnsZ-7.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-B2kXxWRG.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-K-42Oe8-.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-SrYZwgCT.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-C7WVVGgD.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
  };