@datagouv/components-next 1.0.2-dev.9 → 1.0.2-dev.91

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 (96) hide show
  1. package/assets/main.css +4 -0
  2. package/dist/{Control-DuZJdKV_.js → Control-ZFh5ta_U.js} +1 -1
  3. package/dist/Datafair.client-CyZRNADr.js +30 -0
  4. package/dist/{Event--kp8kMdJ.js → Event-DSQcW7OF.js} +24 -24
  5. package/dist/{Image-34hvypZI.js → Image-BijNEG0p.js} +6 -6
  6. package/dist/JsonPreview.client-C9iaPSmQ.js +40 -0
  7. package/dist/{Map-BjUnLyj8.js → Map-BUtPf5GN.js} +756 -756
  8. package/dist/MapContainer.client-BuoZ69XO.js +101 -0
  9. package/dist/{OSM-s40W6sQ2.js → OSM-D4MTdBtk.js} +2 -2
  10. package/dist/{PdfPreview.client-BVjPxlPu.js → PdfPreview.client-MI0bDghc.js} +822 -865
  11. package/dist/{Pmtiles.client-CRJ56yX2.js → Pmtiles.client-CaKEYQBc.js} +574 -579
  12. package/dist/PreviewWrapper.vue_vue_type_script_setup_true_lang-BKqb6TMw.js +61 -0
  13. package/dist/{ScaleLine-KW-nXqp3.js → ScaleLine-hJQIqcZm.js} +2 -2
  14. package/dist/{Tile-DbNFNPfU.js → Tile-Dcl7oIVu.js} +35 -35
  15. package/dist/{TileImage-BsXBxMtq.js → TileImage-BJeHipMX.js} +4 -4
  16. package/dist/{View-BR92hTWP.js → View-xp_P_OHw.js} +412 -401
  17. package/dist/XmlPreview.client-BVAeNK4n.js +34 -0
  18. package/dist/{common-PJfpC179.js → common-BjQlan3k.js} +36 -36
  19. package/dist/components-next.css +6 -6
  20. package/dist/components-next.js +166 -148
  21. package/dist/components.css +1 -1
  22. package/dist/{index-BZsAZ7iw.js → index-BBdS8QKx.js} +32886 -27183
  23. package/dist/{main-qc4CO9Kn.js → main-Dk_66g-3.js} +91331 -75844
  24. package/dist/{proj-DsetBcW7.js → proj-CsNo9yH1.js} +532 -512
  25. package/dist/{tilecoord-Db24Px13.js → tilecoord-A0fLnBZr.js} +28 -28
  26. package/dist/{vue3-xml-viewer.common-CCOV_ohP.js → vue3-xml-viewer.common-B8dNNkOU.js} +1 -1
  27. package/package.json +18 -11
  28. package/src/components/ActivityList/ActivityList.vue +0 -2
  29. package/src/components/Chart/ChartViewer.vue +226 -0
  30. package/src/components/Chart/ChartViewerWrapper.vue +170 -0
  31. package/src/components/Form/Listbox.vue +101 -0
  32. package/src/components/Form/SearchableSelect.vue +2 -1
  33. package/src/components/InfiniteLoader.vue +53 -0
  34. package/src/components/OpenApiViewer/ContentTypeSelect.vue +48 -0
  35. package/src/components/OpenApiViewer/EndpointRequest.vue +164 -0
  36. package/src/components/OpenApiViewer/EndpointResponses.vue +149 -0
  37. package/src/components/OpenApiViewer/OpenApiViewer.vue +308 -0
  38. package/src/components/OpenApiViewer/SchemaPanel.vue +53 -0
  39. package/src/components/OpenApiViewer/SchemaTree.vue +77 -0
  40. package/src/components/OpenApiViewer/openapi.ts +150 -0
  41. package/src/components/OrganizationNameWithCertificate.vue +3 -2
  42. package/src/components/Pagination.vue +8 -5
  43. package/src/components/ReadMore.vue +1 -1
  44. package/src/components/ResourceAccordion/Datafair.client.vue +4 -10
  45. package/src/components/ResourceAccordion/JsonPreview.client.vue +23 -121
  46. package/src/components/ResourceAccordion/MapContainer.client.vue +5 -14
  47. package/src/components/ResourceAccordion/Metadata.vue +1 -2
  48. package/src/components/ResourceAccordion/PdfPreview.client.vue +24 -103
  49. package/src/components/ResourceAccordion/Pmtiles.client.vue +5 -10
  50. package/src/components/ResourceAccordion/Preview.vue +16 -21
  51. package/src/components/ResourceAccordion/PreviewLoader.vue +1 -2
  52. package/src/components/ResourceAccordion/PreviewUnavailable.vue +22 -0
  53. package/src/components/ResourceAccordion/PreviewWrapper.vue +82 -0
  54. package/src/components/ResourceAccordion/ResourceAccordion.vue +5 -7
  55. package/src/components/ResourceAccordion/XmlPreview.client.vue +16 -115
  56. package/src/components/ResourceExplorer/ResourceExplorer.vue +81 -13
  57. package/src/components/ResourceExplorer/ResourceExplorerSidebar.vue +2 -2
  58. package/src/components/ResourceExplorer/ResourceExplorerViewer.vue +30 -11
  59. package/src/components/Search/GlobalSearch.vue +191 -110
  60. package/src/components/Search/SearchInput.vue +5 -4
  61. package/src/components/TabularExplorer/TabularCell.vue +51 -0
  62. package/src/components/TabularExplorer/TabularCellPopover.vue +170 -0
  63. package/src/components/TabularExplorer/TabularExplorer.vue +870 -0
  64. package/src/components/TabularExplorer/TabularFilterContent.vue +351 -0
  65. package/src/components/TabularExplorer/TabularFilterPopover.vue +111 -0
  66. package/src/components/TabularExplorer/types.ts +83 -0
  67. package/src/composables/useHasTabularData.ts +6 -0
  68. package/src/composables/useResourceCapabilities.ts +1 -1
  69. package/src/composables/useSearchFilter.ts +118 -0
  70. package/src/composables/useStableQueryParams.ts +31 -3
  71. package/src/config.ts +3 -0
  72. package/src/functions/api.ts +34 -33
  73. package/src/functions/api.types.ts +1 -0
  74. package/src/functions/charts.ts +68 -0
  75. package/src/functions/datasets.ts +0 -17
  76. package/src/functions/resources.ts +56 -1
  77. package/src/functions/tabular.ts +60 -0
  78. package/src/functions/tabularApi.ts +138 -11
  79. package/src/main.ts +55 -7
  80. package/src/types/dataservices.ts +2 -0
  81. package/src/types/pages.ts +0 -5
  82. package/src/types/posts.ts +2 -2
  83. package/src/types/reports.ts +5 -1
  84. package/src/types/search.ts +52 -1
  85. package/src/types/site.ts +5 -3
  86. package/src/types/users.ts +2 -1
  87. package/src/types/visualizations.ts +89 -0
  88. package/assets/swagger-themes/newspaper.css +0 -1670
  89. package/dist/Datafair.client-0UYUu5yf.js +0 -35
  90. package/dist/JsonPreview.client-BrTMBWHZ.js +0 -87
  91. package/dist/MapContainer.client-CUmKyByc.js +0 -107
  92. package/dist/Swagger.client-2Yn7iF0A.js +0 -4
  93. package/dist/XmlPreview.client-DxqlVnKu.js +0 -79
  94. package/src/components/ResourceAccordion/Swagger.client.vue +0 -48
  95. package/src/functions/pagination.ts +0 -9
  96. /package/assets/illustrations/{_microscope.svg → microscope.svg} +0 -0
@@ -1,35 +0,0 @@
1
- import { defineComponent as f, computed as a, createElementBlock as o, openBlock as t, createBlock as p, createElementVNode as i, withCtx as m, createVNode as _, unref as c, toDisplayString as x } from "vue";
2
- import { a as h, _ as v, F as g } from "./main-qc4CO9Kn.js";
3
- const k = { class: "fr-text--xs" }, b = { key: 0 }, y = ["src"], B = /* @__PURE__ */ f({
4
- __name: "Datafair.client",
5
- props: {
6
- resource: {},
7
- dataset: {}
8
- },
9
- setup(d) {
10
- const e = d, { t: l } = h(), r = a(() => e.resource.extras.datafairOrigin || e.dataset.extras.datafairOrigin), s = a(() => e.resource.extras.datafairDatasetId || e.dataset.extras.datafairDatasetId), u = a(() => e.resource.extras.datafairEmbed), n = a(() => !r.value || !s.value ? null : `${r.value}/embed/dataset/${s.value}/${u.value}`);
11
- return (D, E) => (t(), o("div", k, [
12
- n.value ? (t(), o("div", b, [
13
- i("iframe", {
14
- src: n.value,
15
- width: "100%",
16
- height: "500px",
17
- style: { "background-color": "transparent", border: "none" }
18
- }, null, 8, y)
19
- ])) : (t(), p(v, {
20
- key: 1,
21
- type: "warning",
22
- class: "flex items-center space-x-2"
23
- }, {
24
- default: m(() => [
25
- _(c(g), { class: "shrink-0 size-6" }),
26
- i("span", null, x(c(l)("Erreur lors de l'affichage de l'aperçu.")), 1)
27
- ]),
28
- _: 1
29
- }))
30
- ]));
31
- }
32
- });
33
- export {
34
- B as default
35
- };
@@ -1,87 +0,0 @@
1
- import { defineComponent as S, defineAsyncComponent as b, ref as o, computed as w, onMounted as N, createElementBlock as p, openBlock as r, createBlock as f, createCommentVNode as T, createVNode as u, unref as t, toDisplayString as i, withCtx as d, createElementVNode as h } from "vue";
2
- import { u as P, a as E, g as q, _ as m, F as v } from "./main-qc4CO9Kn.js";
3
- const B = { class: "fr-text--xs" }, O = { key: 0 }, V = {
4
- key: 1,
5
- class: "text-gray-medium"
6
- }, L = /* @__PURE__ */ S({
7
- __name: "JsonPreview.client",
8
- props: {
9
- resource: {}
10
- },
11
- setup(k) {
12
- const z = b(
13
- () => import("./vue3-json-viewer-BXwup7nO.js").then((e) => (Promise.resolve({ }), e.JsonViewer))
14
- ), g = k, x = P(), { t: s } = E(), l = o(null), c = o(!1), n = o(null), _ = o(!1), y = w(() => q(g.resource)), J = w(() => {
15
- const e = y.value;
16
- if (!e || !x.maxJsonPreviewCharSize)
17
- return !1;
18
- const a = x.maxJsonPreviewCharSize;
19
- return e <= a;
20
- }), C = async () => {
21
- if (!J.value) {
22
- _.value = !0;
23
- return;
24
- }
25
- c.value = !0, n.value = null;
26
- try {
27
- const e = await fetch(g.resource.url);
28
- if (!e.ok)
29
- throw new Error(`HTTP error! status: ${e.status}`);
30
- const a = await e.json();
31
- l.value = a;
32
- } catch (e) {
33
- console.error("Error loading JSON:", e), e instanceof TypeError ? n.value = "network" : n.value = "generic", l.value = null;
34
- } finally {
35
- c.value = !1;
36
- }
37
- };
38
- return N(() => {
39
- C();
40
- }), (e, a) => (r(), p("div", B, [
41
- l.value ? (r(), p("div", O, [
42
- u(t(z), {
43
- value: l.value,
44
- boxed: "",
45
- sort: "",
46
- theme: "light",
47
- "max-depth": 3,
48
- "expand-depth": 2,
49
- "indent-width": 2
50
- }, null, 8, ["value"])
51
- ])) : c.value ? (r(), p("div", V, i(t(s)("Chargement de l'aperçu JSON...")), 1)) : _.value ? (r(), f(m, {
52
- key: 2,
53
- type: "warning",
54
- class: "flex items-center space-x-2"
55
- }, {
56
- default: d(() => [
57
- u(t(v), { class: "shrink-0 size-6" }),
58
- h("span", null, i(y.value ? t(s)("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.") : t(s)("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)
59
- ]),
60
- _: 1
61
- })) : n.value === "network" ? (r(), f(m, {
62
- key: 3,
63
- type: "warning",
64
- class: "flex items-center space-x-2"
65
- }, {
66
- default: d(() => [
67
- u(t(v), { class: "shrink-0 size-6" }),
68
- h("span", null, i(t(s)("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)
69
- ]),
70
- _: 1
71
- })) : n.value ? (r(), f(m, {
72
- key: 4,
73
- type: "warning",
74
- class: "flex items-center space-x-2"
75
- }, {
76
- default: d(() => [
77
- u(t(v), { class: "shrink-0 size-6" }),
78
- h("span", null, i(t(s)("Erreur lors du chargement de l'aperçu JSON.")), 1)
79
- ]),
80
- _: 1
81
- })) : T("", !0)
82
- ]));
83
- }
84
- });
85
- export {
86
- L as default
87
- };
@@ -1,107 +0,0 @@
1
- import { defineComponent as G, useTemplateRef as W, ref as z, onMounted as B, createBlock as F, createElementBlock as N, openBlock as m, withCtx as V, createVNode as U, createElementVNode as q, unref as f, toDisplayString as A } from "vue";
2
- import { a as D, _ as O, F as P } from "./main-qc4CO9Kn.js";
3
- const j = /* @__PURE__ */ G({
4
- __name: "MapContainer.client",
5
- props: {
6
- resource: {}
7
- },
8
- setup(d) {
9
- const a = d, { t: w } = D();
10
- let e = null;
11
- const r = W("mapRef"), n = z(!1);
12
- async function y() {
13
- const [
14
- { default: s },
15
- { default: i },
16
- { default: h },
17
- { default: C },
18
- { default: _ },
19
- g
20
- ] = await Promise.all([
21
- import("./View-BR92hTWP.js").then((t) => t.M),
22
- import("./Map-BjUnLyj8.js").then((t) => t.U),
23
- import("./ScaleLine-KW-nXqp3.js"),
24
- import("./Tile-DbNFNPfU.js").then((t) => t.d),
25
- import("./OSM-s40W6sQ2.js"),
26
- // @ts-expect-error no types provided
27
- import("./index-BZsAZ7iw.js")
28
- ]), { CRS: S, GeoportalAttribution: M, GeoportalFullScreen: b, GeoportalZoom: v, LayerImport: L, LayerSwitcher: R } = g;
29
- await Promise.resolve({ }), await Promise.resolve({ }), await Promise.resolve({ }), await Promise.resolve({ }), S.load(), e = new i({
30
- target: r.value,
31
- layers: [
32
- new C({
33
- source: new _()
34
- })
35
- ],
36
- view: new s({
37
- center: [288074.8449901076, 6247982515792289e-9],
38
- zoom: 8,
39
- constrainResolution: !0
40
- })
41
- });
42
- const k = new h({
43
- units: "metric",
44
- bar: !1
45
- });
46
- e.addControl(k);
47
- const T = new b({
48
- position: "top-right"
49
- });
50
- e.addControl(T);
51
- const x = new v({
52
- position: "bottom-left"
53
- });
54
- e.addControl(x);
55
- const E = new R({
56
- options: {
57
- position: "top-right"
58
- }
59
- });
60
- e.addControl(E);
61
- const l = new M({
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
65
- });
66
- l.setCollapsed(!1), e.addControl(l);
67
- const o = new L({
68
- position: "bottom-left",
69
- listable: !0,
70
- layerTypes: ["WMS"]
71
- });
72
- o._serviceUrlImportInput.value = a.resource.url, o._formContainer.dispatchEvent(new CustomEvent("submit", { cancelable: !0 })), e.addControl(o);
73
- const p = 500;
74
- let c = 20;
75
- function u() {
76
- if (!o._getCapResponseWMSLayers)
77
- c--, c > 0 ? setTimeout(u, p) : n.value = !0;
78
- else {
79
- const t = o._getCapResponseWMSLayers.filter((I) => I.Name == a.resource.title)[0];
80
- o._addGetCapWMSLayer(t);
81
- }
82
- }
83
- setTimeout(u, p);
84
- }
85
- return B(() => {
86
- y();
87
- }), (s, i) => n.value ? (m(), F(O, {
88
- key: 0,
89
- type: "warning",
90
- class: "flex items-center space-x-2"
91
- }, {
92
- default: V(() => [
93
- U(f(P), { class: "shrink-0 size-6" }),
94
- q("span", null, A(f(w)("L'aperçu cartographique de ce fichier n'a pas pu être chargé.")), 1)
95
- ]),
96
- _: 1
97
- })) : (m(), N("div", {
98
- key: 1,
99
- id: "map",
100
- ref_key: "mapRef",
101
- ref: r
102
- }, null, 512));
103
- }
104
- });
105
- export {
106
- j as default
107
- };
@@ -1,4 +0,0 @@
1
- import { i as f } from "./main-qc4CO9Kn.js";
2
- export {
3
- f as default
4
- };
@@ -1,79 +0,0 @@
1
- import { defineComponent as b, defineAsyncComponent as L, ref as o, computed as w, onMounted as T, createElementBlock as p, openBlock as r, createBlock as m, createCommentVNode as P, createVNode as u, unref as t, toDisplayString as i, withCtx as f, createElementVNode as d } from "vue";
2
- import { u as E, a as M, g as q, _ as h, F as v } from "./main-qc4CO9Kn.js";
3
- const B = { class: "fr-text--xs" }, S = { key: 0 }, V = {
4
- key: 1,
5
- class: "text-gray-medium"
6
- }, N = /* @__PURE__ */ b({
7
- __name: "XmlPreview.client",
8
- props: {
9
- resource: {}
10
- },
11
- setup(k) {
12
- const z = L(
13
- () => import("./vue3-xml-viewer.common-CCOV_ohP.js").then((e) => e.v).then((e) => e.default || e.XmlViewer)
14
- ), g = k, x = E(), { t: l } = M(), n = o(null), c = o(!1), s = o(null), _ = o(!1), y = w(() => q(g.resource)), X = w(() => {
15
- const e = y.value;
16
- if (!e || !x.maxXmlPreviewCharSize)
17
- return !1;
18
- const a = x.maxXmlPreviewCharSize;
19
- return e <= a;
20
- }), C = async () => {
21
- if (!X.value) {
22
- _.value = !0;
23
- return;
24
- }
25
- c.value = !0, s.value = null;
26
- try {
27
- const e = await fetch(g.resource.url);
28
- if (!e.ok)
29
- throw new Error(`HTTP error! status: ${e.status}`);
30
- const a = await e.text();
31
- n.value = a;
32
- } catch (e) {
33
- console.error("Error loading XML:", e), e instanceof TypeError ? s.value = "network" : s.value = "generic", n.value = null;
34
- } finally {
35
- c.value = !1;
36
- }
37
- };
38
- return T(() => {
39
- C();
40
- }), (e, a) => (r(), p("div", B, [
41
- n.value ? (r(), p("div", S, [
42
- u(t(z), { xml: n.value }, null, 8, ["xml"])
43
- ])) : c.value ? (r(), p("div", V, i(t(l)("Chargement de l'aperçu XML...")), 1)) : _.value ? (r(), m(h, {
44
- key: 2,
45
- type: "warning",
46
- class: "flex items-center space-x-2"
47
- }, {
48
- default: f(() => [
49
- u(t(v), { class: "shrink-0 size-6" }),
50
- d("span", null, i(y.value ? t(l)("Fichier XML 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.") : t(l)("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)
51
- ]),
52
- _: 1
53
- })) : s.value === "network" ? (r(), m(h, {
54
- key: 3,
55
- type: "warning",
56
- class: "flex items-center space-x-2"
57
- }, {
58
- default: f(() => [
59
- u(t(v), { class: "shrink-0 size-6" }),
60
- d("span", null, i(t(l)("Ce fichier XML 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)
61
- ]),
62
- _: 1
63
- })) : s.value ? (r(), m(h, {
64
- key: 4,
65
- type: "warning",
66
- class: "flex items-center space-x-2"
67
- }, {
68
- default: f(() => [
69
- u(t(v), { class: "shrink-0 size-6" }),
70
- d("span", null, i(t(l)("Erreur lors du chargement de l'aperçu XML.")), 1)
71
- ]),
72
- _: 1
73
- })) : P("", !0)
74
- ]));
75
- }
76
- });
77
- export {
78
- N as default
79
- };
@@ -1,48 +0,0 @@
1
- <template>
2
- <div id="swagger-ui" />
3
- </template>
4
-
5
- <script setup lang="ts">
6
- import { onMounted } from 'vue'
7
- // @ts-expect-error no types for `swagger-ui-dist`
8
- import * as SwaggerUiDist from 'swagger-ui-dist'
9
- import 'swagger-ui-dist/swagger-ui.css'
10
- import '../../../assets/swagger-themes/newspaper.css'
11
-
12
- const { SwaggerUIBundle } = SwaggerUiDist
13
- const props = defineProps<{
14
- url: string
15
- }>()
16
-
17
- onMounted(async () => {
18
- SwaggerUIBundle({
19
- dom_id: '#swagger-ui',
20
- url: props.url,
21
- })
22
- })
23
- </script>
24
-
25
- <style>
26
- /** Taken from newsletter theme */
27
- .swagger-ui .opblock-tag small,
28
- .swagger-ui .opblock .opblock-summary-description,
29
- .swagger-ui .opblock-description-wrapper,
30
- .swagger-ui .opblock-description-wrapper h4,
31
- .swagger-ui .opblock-title_normal,
32
- .swagger-ui .opblock-title_normal h4,
33
- .swagger-ui .opblock-description-wrapper p,
34
- .swagger-ui .opblock-title_normal p,
35
- .swagger-ui .responses-inner h4,
36
- .swagger-ui .responses-inner h5,
37
- .swagger-ui .response-col_status,
38
- .swagger-ui .dialog-ux .modal-ux-content p,
39
- .swagger-ui table thead tr td,
40
- .swagger-ui table thead tr th,
41
- .swagger-ui .parameters-col_description p,
42
- .swagger-ui .info p,
43
- .swagger-ui .info a,
44
- .swagger-ui .info .title,
45
- .swagger-ui .topbar {
46
- font-family: 'Marianne', Arial, sans-serif !important;
47
- }
48
- </style>
@@ -1,9 +0,0 @@
1
- import { useRoute } from 'vue-router'
2
-
3
- export function getLink(page: number): string {
4
- const route = useRoute()
5
- const routePath = route.path
6
- const search = new URLSearchParams(route.query as Record<string, string>)
7
- search.set('page', page.toFixed(0))
8
- return `${routePath}?${search.toString()}`
9
- }