@datagouv/components-next 0.0.30 → 0.0.32

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 (51) hide show
  1. package/README.md +41 -2
  2. package/assets/main.css +4 -0
  3. package/dist/{JsonPreview.client-DEoTeNS0.js → JsonPreview.client-BRhCOHlE.js} +12 -12
  4. package/dist/{MapContainer.client-CNmXA5i0.js → MapContainer.client-Dhfz-YU8.js} +1 -1
  5. package/dist/{PdfPreview.client-CsVdmxPR.js → PdfPreview.client--W0FK7CN.js} +5 -5
  6. package/dist/{Pmtiles.client-GgcBwFa0.js → Pmtiles.client-B6vRTwrm.js} +1 -1
  7. package/dist/Swagger.client-ch5H8aT2.js +4 -0
  8. package/dist/{XmlPreview.client-C0lxnMVl.js → XmlPreview.client-BcbnRWAp.js} +14 -14
  9. package/dist/components-next.css +1 -1
  10. package/dist/components-next.js +73 -59
  11. package/dist/components.css +1 -1
  12. package/dist/{main-D5CXGAAc.js → main-yWiuApVL.js} +13683 -13594
  13. package/dist/{vue3-xml-viewer.common-WmBgOZ5X.js → vue3-xml-viewer.common-1QyofKqS.js} +1 -1
  14. package/package.json +1 -1
  15. package/src/components/Avatar.vue +2 -1
  16. package/src/components/BrandedButton.vue +4 -1
  17. package/src/components/ClientOnly.vue +17 -0
  18. package/src/components/DataserviceCard.vue +50 -78
  19. package/src/components/DatasetCard.vue +6 -11
  20. package/src/components/DatasetInformationPanel.vue +1 -1
  21. package/src/components/DatasetQuality.vue +1 -3
  22. package/src/components/DatasetQualityInline.vue +3 -3
  23. package/src/components/ExtraAccordion.vue +1 -4
  24. package/src/components/OrganizationCard.vue +9 -7
  25. package/src/components/OwnerType.vue +1 -1
  26. package/src/components/Placeholder.vue +9 -3
  27. package/src/components/ResourceAccordion/DataStructure.vue +6 -5
  28. package/src/components/ResourceAccordion/JsonPreview.client.vue +5 -5
  29. package/src/components/ResourceAccordion/PdfPreview.client.vue +3 -3
  30. package/src/components/ResourceAccordion/Preview.vue +5 -5
  31. package/src/components/ResourceAccordion/ResourceAccordion.vue +2 -2
  32. package/src/components/ResourceAccordion/SchemaBadge.vue +7 -3
  33. package/src/components/ResourceAccordion/XmlPreview.client.vue +5 -5
  34. package/src/components/Tabs/TabGroup.vue +13 -1
  35. package/src/components/Toggletip.vue +75 -47
  36. package/src/components/ValueWatcher.vue +18 -0
  37. package/src/composables/useActiveDescendant.ts +1 -1
  38. package/src/composables/useReuseType.ts +2 -1
  39. package/src/config.ts +5 -4
  40. package/src/functions/datasets.ts +1 -1
  41. package/src/functions/organizations.ts +14 -0
  42. package/src/functions/reuses.ts +10 -7
  43. package/src/functions/schemas.ts +32 -31
  44. package/src/functions/tabularApi.ts +2 -3
  45. package/src/functions/users.ts +2 -2
  46. package/src/main.ts +24 -6
  47. package/src/types/dataservices.ts +1 -0
  48. package/src/types/datasets.ts +1 -0
  49. package/src/types/site.ts +3 -0
  50. package/dist/Swagger.client-2tUSrvmQ.js +0 -4
  51. package/src/components/ToggletipButton.vue +0 -14
package/README.md CHANGED
@@ -18,6 +18,10 @@ app.use(datagouv, {
18
18
  })
19
19
  ```
20
20
 
21
+ ### Layout
22
+
23
+ To use the `Toggletip` component you should add a `<div id="tooltips" />` in your layout.
24
+
21
25
  ### Special functions and components (only for Nuxt)
22
26
 
23
27
  Nuxt is a special environment (both server and browser) and requires some special functions and components to work.
@@ -45,10 +49,14 @@ app.vueApp.use(datagouv, {
45
49
  // Nuxt doesn't like `TextClamp` in the server, provides the client only `TextClamp`
46
50
  textClamp: TextClamp,
47
51
 
48
- // Provide the component to create links inside the application
49
- // This component will receive the raw link (without i18n prefix)
52
+ // The following properties allow to provide components specific to Nuxt.
53
+
54
+ // This `appLink` component will receive the raw link (without i18n prefix)
50
55
  // and needs to add it.
51
56
  appLink: CdataLink,
57
+
58
+ // The ClientOnly allow to disable SSR for some components.
59
+ clientOnly: ClientOnly,
52
60
  })
53
61
  ```
54
62
 
@@ -161,6 +169,37 @@ To do links in the application you can use the `<AppLink>` component. Not sure w
161
169
 
162
170
  Maybe this component shouldn't be exposed too, because I don't know why a user should use this instead of their own component (`<RouterLink>` or `<CdataLink>`…)
163
171
 
172
+ ## Release
173
+
174
+ This package is available as `@datagouv/components-next` on [npm](https://www.npmjs.com/package/@datagouv/components-next).
175
+
176
+ It follows the [semantic versioning specification](https://semver.org/).
177
+
178
+ To make a new release, you have to :
179
+ 1. update the version
180
+ 2. publish to npm
181
+ 3. Commit and push the version change
182
+
183
+ ### Update the version
184
+
185
+ Use the dedicated npm command, with the correct parameter :
186
+
187
+ ```
188
+ npm version VERSION
189
+ ```
190
+
191
+ Where VERSION is :
192
+ - `major` when you make incompatible API changes
193
+ - `minor` when you add functionality in a backward compatible manner
194
+ - `patch` version when you make backward compatible bug fixes
195
+ Additional labels for pre-release and build metadata are available as extensions to the MAJOR.MINOR.PATCH format.
196
+
197
+ ### Publish to NPM
198
+
199
+ ```
200
+ npm run publish-stable
201
+ ```
202
+
164
203
  ## 📄 License
165
204
 
166
205
  This component library is licensed under the **MIT License**, which is the same as the main project. This allows for permissive usage of the components in other projects.
package/assets/main.css CHANGED
@@ -19,9 +19,13 @@
19
19
  --text-4\.5xl: 2.75rem;
20
20
 
21
21
  --color-primary: #3558a2;
22
+ --color-ocher: #A6481C;
23
+ --color-green-reuse: #2B6972;
24
+ --color-purple-dataservice: #5E5DAE;
22
25
  --color-mention-grey: #666; /* Copy from --text-mention-grey */
23
26
  --color-gray-title: #161616;
24
27
  --color-gray-medium: #666666;
28
+ --color-gray-lowest-2: #fafafa;
25
29
  --color-gray-low: #929292;
26
30
  --color-gray-lower-hover: #d2d2d2;
27
31
  --color-gray-lower-active: #c1c1c1;
@@ -1,5 +1,5 @@
1
- import { defineComponent as b, defineAsyncComponent as S, ref as o, computed as x, onMounted as C, createElementBlock as p, openBlock as n, createBlock as f, createCommentVNode as N, createVNode as a, unref as u, toDisplayString as i, withCtx as d, createElementVNode as m } from "vue";
2
- import { d as P, a as h, F as v } from "./main-D5CXGAAc.js";
1
+ import { defineComponent as b, defineAsyncComponent as C, ref as o, computed as x, onMounted as S, createElementBlock as p, openBlock as n, createBlock as f, createCommentVNode as N, createVNode as a, unref as u, toDisplayString as i, withCtx as d, createElementVNode as h } from "vue";
2
+ import { d as P, a as m, F as v } from "./main-yWiuApVL.js";
3
3
  const T = { class: "fr-text--xs" }, $ = { key: 0 }, E = {
4
4
  key: 1,
5
5
  class: "text-gray-medium"
@@ -9,7 +9,7 @@ const T = { class: "fr-text--xs" }, $ = { key: 0 }, E = {
9
9
  resource: {}
10
10
  },
11
11
  setup(k) {
12
- const z = S(
12
+ const z = C(
13
13
  () => import("./vue3-json-viewer-B1fiyuLU.js").then((e) => (Promise.resolve({ }), e.JsonViewer))
14
14
  ), s = k, g = P(), l = o(null), c = o(!1), r = o(null), y = o(!1), w = x(() => {
15
15
  var t;
@@ -19,9 +19,9 @@ const T = { class: "fr-text--xs" }, $ = { key: 0 }, E = {
19
19
  return e && typeof e == "number" ? e : null;
20
20
  }), J = x(() => {
21
21
  const e = w.value;
22
- if (!e || !g.maxJsonPreviewSize)
22
+ if (!e || !g.maxJsonPreviewCharSize)
23
23
  return !1;
24
- const t = g.maxJsonPreviewSize;
24
+ const t = g.maxJsonPreviewCharSize;
25
25
  return e <= t;
26
26
  }), _ = async () => {
27
27
  if (!J.value) {
@@ -41,7 +41,7 @@ const T = { class: "fr-text--xs" }, $ = { key: 0 }, E = {
41
41
  c.value = !1;
42
42
  }
43
43
  };
44
- return C(() => {
44
+ return S(() => {
45
45
  _();
46
46
  }), (e, t) => (n(), p("div", T, [
47
47
  l.value ? (n(), p("div", $, [
@@ -54,34 +54,34 @@ const T = { class: "fr-text--xs" }, $ = { key: 0 }, E = {
54
54
  "expand-depth": 2,
55
55
  "indent-width": 2
56
56
  }, null, 8, ["value"])
57
- ])) : c.value ? (n(), p("div", E, i(e.$t("Chargement de l'aperçu JSON...")), 1)) : y.value ? (n(), f(h, {
57
+ ])) : c.value ? (n(), p("div", E, i(e.$t("Chargement de l'aperçu JSON...")), 1)) : y.value ? (n(), f(m, {
58
58
  key: 2,
59
59
  type: "warning",
60
60
  class: "flex items-center space-x-2"
61
61
  }, {
62
62
  default: d(() => [
63
63
  a(u(v), { class: "shink-0 size-6" }),
64
- m("span", null, i(w.value ? e.$t("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.") : e.$t("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)
64
+ h("span", null, i(w.value ? e.$t("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.") : e.$t("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)
65
65
  ]),
66
66
  _: 1
67
- })) : r.value === "network" ? (n(), f(h, {
67
+ })) : r.value === "network" ? (n(), f(m, {
68
68
  key: 3,
69
69
  type: "warning",
70
70
  class: "flex items-center space-x-2"
71
71
  }, {
72
72
  default: d(() => [
73
73
  a(u(v), { class: "shink-0 size-6" }),
74
- m("span", null, i(e.$t("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)
74
+ h("span", null, i(e.$t("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)
75
75
  ]),
76
76
  _: 1
77
- })) : r.value ? (n(), f(h, {
77
+ })) : r.value ? (n(), f(m, {
78
78
  key: 4,
79
79
  type: "warning",
80
80
  class: "flex items-center space-x-2"
81
81
  }, {
82
82
  default: d(() => [
83
83
  a(u(v), { class: "shink-0 size-6" }),
84
- m("span", null, i(e.$t("Erreur lors du chargement de l'aperçu JSON.")), 1)
84
+ h("span", null, i(e.$t("Erreur lors du chargement de l'aperçu JSON.")), 1)
85
85
  ]),
86
86
  _: 1
87
87
  })) : N("", !0)
@@ -7,7 +7,7 @@ var mt = (i, e, t) => si(i, typeof e != "symbol" ? e + "" : e, t), ai = (i, e, t
7
7
  var Pt = (i, e, t) => e.has(i) ? Rt("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(i) : e.set(i, t);
8
8
  var ft = (i, e, t) => (ai(i, e, "access private method"), t);
9
9
  import { defineComponent, useTemplateRef, ref, onMounted, createBlock, createElementBlock, openBlock, withCtx, createVNode, createElementVNode, unref, toDisplayString } from "vue";
10
- import { c as commonjsGlobal, g as getDefaultExportFromCjs$1, u as useI18n, a as _sfc_main$1, F as Fe } from "./main-D5CXGAAc.js";
10
+ import { c as commonjsGlobal, g as getDefaultExportFromCjs$1, u as useI18n, a as _sfc_main$1, F as Fe } from "./main-yWiuApVL.js";
11
11
  const ObjectEventType = {
12
12
  /**
13
13
  * Triggered when a property is changed.
@@ -1,5 +1,5 @@
1
- import { defineComponent as T, defineAsyncComponent as $, ref as l, computed as y, onMounted as q, createElementBlock as p, openBlock as t, createBlock as f, createCommentVNode as B, createVNode as a, unref as u, toDisplayString as c, withCtx as d, createElementVNode as g } from "vue";
2
- import { d as L, a as h, F as m } from "./main-D5CXGAAc.js";
1
+ import { defineComponent as T, defineAsyncComponent as $, ref as l, computed as y, onMounted as B, createElementBlock as p, openBlock as t, createBlock as f, createCommentVNode as q, createVNode as a, unref as u, toDisplayString as c, withCtx as d, createElementVNode as g } from "vue";
2
+ import { d as L, a as h, F as m } from "./main-yWiuApVL.js";
3
3
  const O = { class: "text-xs" }, S = { key: 0 }, N = {
4
4
  key: 1,
5
5
  class: "text-gray-medium"
@@ -21,7 +21,7 @@ const O = { class: "text-xs" }, S = { key: 0 }, N = {
21
21
  const e = v.value;
22
22
  if (!e)
23
23
  return !1;
24
- const o = b.maxPdfPreviewSize ?? 1e7;
24
+ const o = b.maxPdfPreviewByteSize ?? 1e7;
25
25
  return e <= o;
26
26
  }), D = async () => {
27
27
  if (!z.value) {
@@ -50,7 +50,7 @@ const O = { class: "text-xs" }, S = { key: 0 }, N = {
50
50
  }, E = (e) => {
51
51
  console.error("PDF loading error:", e), e instanceof TypeError ? r.value = "network" : r.value = "generic", n.value = !1;
52
52
  };
53
- return q(() => {
53
+ return B(() => {
54
54
  D();
55
55
  }), (e, o) => (t(), p("div", O, [
56
56
  n.value ? (t(), p("div", S, [
@@ -104,7 +104,7 @@ const O = { class: "text-xs" }, S = { key: 0 }, N = {
104
104
  g("span", null, c(e.$t("Erreur lors du chargement de l'aperçu PDF. Pour consulter le fichier, téléchargez-le depuis l'onglet Téléchargements.")), 1)
105
105
  ]),
106
106
  _: 1
107
- })) : B("", !0)
107
+ })) : q("", !0)
108
108
  ]));
109
109
  }
110
110
  });
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as Xm, ref as Ym, computed as Kc, useTemplateRef as Km, onMounted as Jm, createElementBlock as xh, openBlock as Jc, createBlock as Qm, withCtx as _d, createVNode as yd, createElementVNode as pa, unref as Ua, toDisplayString as Rl, createCommentVNode as eg, createTextVNode as tg } from "vue";
2
- import { g as ig, u as rg, b as ng, d as ag, a as sg, F as og, f as lg, e as cg, K as ug, t as hg } from "./main-D5CXGAAc.js";
2
+ import { g as ig, u as rg, b as ng, d as ag, a as sg, F as og, f as lg, e as cg, K as ug, t as hg } from "./main-yWiuApVL.js";
3
3
  var nn = Uint8Array, To = Uint16Array, pg = Int32Array, Ad = new nn([
4
4
  0,
5
5
  0,
@@ -0,0 +1,4 @@
1
+ import { _ as f } from "./main-yWiuApVL.js";
2
+ export {
3
+ f as default
4
+ };
@@ -1,16 +1,16 @@
1
- import { defineComponent as b, defineAsyncComponent as L, ref as a, computed as w, onMounted as C, createElementBlock as p, openBlock as r, createBlock as f, createCommentVNode as P, createVNode as o, unref as u, toDisplayString as i, withCtx as m, createElementVNode as d } from "vue";
2
- import { d as T, a as h, F as v } from "./main-D5CXGAAc.js";
1
+ import { defineComponent as C, defineAsyncComponent as b, ref as a, computed as w, onMounted as L, createElementBlock as p, openBlock as r, createBlock as f, createCommentVNode as P, createVNode as o, unref as u, toDisplayString as i, withCtx as m, createElementVNode as h } from "vue";
2
+ import { d as T, a as d, F as v } from "./main-yWiuApVL.js";
3
3
  const $ = { class: "fr-text--xs" }, E = { key: 0 }, M = {
4
4
  key: 1,
5
5
  class: "text-gray-medium"
6
- }, S = /* @__PURE__ */ b({
6
+ }, S = /* @__PURE__ */ C({
7
7
  __name: "XmlPreview.client",
8
8
  props: {
9
9
  resource: {}
10
10
  },
11
11
  setup(k) {
12
- const z = L(
13
- () => import("./vue3-xml-viewer.common-WmBgOZ5X.js").then((e) => e.v).then((e) => e.default || e.XmlViewer)
12
+ const z = b(
13
+ () => import("./vue3-xml-viewer.common-1QyofKqS.js").then((e) => e.v).then((e) => e.default || e.XmlViewer)
14
14
  ), n = k, g = T(), s = a(null), c = a(!1), l = a(null), y = a(!1), x = w(() => {
15
15
  var t;
16
16
  if (n.resource.filesize)
@@ -19,9 +19,9 @@ const $ = { class: "fr-text--xs" }, E = { key: 0 }, M = {
19
19
  return e && typeof e == "number" ? e : null;
20
20
  }), X = w(() => {
21
21
  const e = x.value;
22
- if (!e || !g.maxXmlPreviewSize)
22
+ if (!e || !g.maxXmlPreviewCharSize)
23
23
  return !1;
24
- const t = g.maxXmlPreviewSize;
24
+ const t = g.maxXmlPreviewCharSize;
25
25
  return e <= t;
26
26
  }), _ = async () => {
27
27
  if (!X.value) {
@@ -41,39 +41,39 @@ const $ = { class: "fr-text--xs" }, E = { key: 0 }, M = {
41
41
  c.value = !1;
42
42
  }
43
43
  };
44
- return C(() => {
44
+ return L(() => {
45
45
  _();
46
46
  }), (e, t) => (r(), p("div", $, [
47
47
  s.value ? (r(), p("div", E, [
48
48
  o(u(z), { xml: s.value }, null, 8, ["xml"])
49
- ])) : c.value ? (r(), p("div", M, i(e.$t("Chargement de l'aperçu XML...")), 1)) : y.value ? (r(), f(h, {
49
+ ])) : c.value ? (r(), p("div", M, i(e.$t("Chargement de l'aperçu XML...")), 1)) : y.value ? (r(), f(d, {
50
50
  key: 2,
51
51
  type: "warning",
52
52
  class: "flex items-center space-x-2"
53
53
  }, {
54
54
  default: m(() => [
55
55
  o(u(v), { class: "shink-0 size-6" }),
56
- d("span", null, i(x.value ? e.$t("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.") : e.$t("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)
56
+ h("span", null, i(x.value ? e.$t("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.") : e.$t("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)
57
57
  ]),
58
58
  _: 1
59
- })) : l.value === "network" ? (r(), f(h, {
59
+ })) : l.value === "network" ? (r(), f(d, {
60
60
  key: 3,
61
61
  type: "warning",
62
62
  class: "flex items-center space-x-2"
63
63
  }, {
64
64
  default: m(() => [
65
65
  o(u(v), { class: "shink-0 size-6" }),
66
- d("span", null, i(e.$t("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)
66
+ h("span", null, i(e.$t("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)
67
67
  ]),
68
68
  _: 1
69
- })) : l.value ? (r(), f(h, {
69
+ })) : l.value ? (r(), f(d, {
70
70
  key: 4,
71
71
  type: "warning",
72
72
  class: "flex items-center space-x-2"
73
73
  }, {
74
74
  default: m(() => [
75
75
  o(u(v), { class: "shink-0 size-6" }),
76
- d("span", null, i(e.$t("Erreur lors du chargement de l'aperçu XML.")), 1)
76
+ h("span", null, i(e.$t("Erreur lors du chargement de l'aperçu XML.")), 1)
77
77
  ]),
78
78
  _: 1
79
79
  })) : P("", !0)