@datagouv/components-next 0.0.32 → 0.1.1

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 (85) hide show
  1. package/README.md +5 -15
  2. package/assets/labels/hvd.svg +15 -0
  3. package/assets/labels/inspire.svg +20 -0
  4. package/assets/labels/sl.svg +5 -0
  5. package/assets/labels/spd.svg +5 -0
  6. package/assets/labels/sr.svg +5 -0
  7. package/dist/JsonPreview.client-nkpNPvZb.js +92 -0
  8. package/dist/{MapContainer.client-Dhfz-YU8.js → MapContainer.client-CrTw-ai8.js} +17587 -6826
  9. package/dist/{PdfPreview.client--W0FK7CN.js → PdfPreview.client-JpAWf0A2.js} +47 -48
  10. package/dist/{Pmtiles.client-B6vRTwrm.js → Pmtiles.client-B83l4Ft5.js} +7609 -7503
  11. package/dist/Swagger.client-D1TfRQjI.js +4 -0
  12. package/dist/XmlPreview.client-DV8N1S9Y.js +84 -0
  13. package/dist/components-next.css +6 -6
  14. package/dist/components-next.js +95 -80
  15. package/dist/components.css +2 -2
  16. package/dist/en-CuSmdvir.js +30 -0
  17. package/dist/hvd-DYeke1vM.js +4 -0
  18. package/dist/inspire-BLXeJvob.js +4 -0
  19. package/dist/{main-yWiuApVL.js → main-CN6IuSUA.js} +53400 -55985
  20. package/dist/{pdf-vue3-Dm2ZCc3P.js → pdf-vue3-IkJO65RH.js} +2 -2
  21. package/dist/{pdf.min-f72cfa08-DAetWL3M.js → pdf.min-f72cfa08-CdgJTooZ.js} +78 -78
  22. package/dist/sl-VR8Tb1_u.js +4 -0
  23. package/dist/spd-BJ-Omhgt.js +4 -0
  24. package/dist/sr-DjSF-8xW.js +4 -0
  25. package/dist/{text-clamp.esm-Mb7Qdtu9.js → text-clamp.esm-B5kW_XMt.js} +54 -55
  26. package/dist/{vue3-json-viewer-B1fiyuLU.js → vue3-json-viewer-BXwup7nO.js} +88 -93
  27. package/dist/{vue3-xml-viewer.common-1QyofKqS.js → vue3-xml-viewer.common-9hga4rGF.js} +54 -54
  28. package/package.json +12 -11
  29. package/src/components/ActivityList/ActivityList.vue +159 -0
  30. package/src/components/ActivityList/UserActivityList.vue +30 -0
  31. package/src/components/AppLink.vue +3 -3
  32. package/src/components/Avatar.vue +1 -0
  33. package/src/components/DataserviceCard.vue +3 -3
  34. package/src/components/DatasetCard.vue +19 -18
  35. package/src/components/DatasetInformationPanel.vue +16 -16
  36. package/src/components/DatasetLabelTag.vue +40 -0
  37. package/src/components/DatasetQuality.vue +13 -10
  38. package/src/components/DatasetQualityInline.vue +5 -2
  39. package/src/components/DatasetQualityScore.vue +3 -3
  40. package/src/components/DatasetQualityTooltipContent.vue +2 -2
  41. package/src/components/DateRangeDetails.vue +7 -3
  42. package/src/components/ExtraAccordion.vue +3 -1
  43. package/src/components/OrganizationNameWithCertificate.vue +2 -2
  44. package/src/components/PaddedContainer.vue +28 -0
  45. package/src/components/Pagination.vue +2 -2
  46. package/src/components/Placeholder.vue +1 -1
  47. package/src/components/ReadMore.vue +17 -17
  48. package/src/components/ResourceAccordion/DataStructure.vue +8 -3
  49. package/src/components/ResourceAccordion/EditButton.vue +2 -2
  50. package/src/components/ResourceAccordion/JsonPreview.client.vue +7 -5
  51. package/src/components/ResourceAccordion/MapContainer.client.vue +2 -2
  52. package/src/components/ResourceAccordion/Metadata.vue +10 -10
  53. package/src/components/ResourceAccordion/PdfPreview.client.vue +7 -5
  54. package/src/components/ResourceAccordion/Pmtiles.client.vue +3 -3
  55. package/src/components/ResourceAccordion/Preview.vue +2 -2
  56. package/src/components/ResourceAccordion/ResourceAccordion.vue +23 -15
  57. package/src/components/ResourceAccordion/SchemaBadge.vue +4 -4
  58. package/src/components/ResourceAccordion/XmlPreview.client.vue +7 -5
  59. package/src/components/ReuseCard.vue +3 -3
  60. package/src/components/ReuseDetails.vue +2 -2
  61. package/src/components/SmallChart.vue +33 -30
  62. package/src/components/StatBox.vue +12 -7
  63. package/src/components/Toggletip.vue +0 -1
  64. package/src/components/TranslationT.vue +51 -0
  65. package/src/composables/useTranslation.ts +169 -0
  66. package/src/functions/activities.ts +36 -0
  67. package/src/functions/api.ts +4 -4
  68. package/src/functions/datasets.ts +28 -0
  69. package/src/functions/dates.ts +4 -4
  70. package/src/functions/helpers.ts +3 -3
  71. package/src/functions/organizations.ts +2 -2
  72. package/src/functions/pagination.ts +9 -0
  73. package/src/functions/resources.ts +2 -2
  74. package/src/functions/reuses.ts +3 -3
  75. package/src/main.ts +24 -20
  76. package/src/types/activity.ts +24 -0
  77. package/src/types/api.ts +8 -0
  78. package/src/types/badges.ts +4 -0
  79. package/src/types/dataservices.ts +6 -8
  80. package/src/types/datasets.ts +6 -1
  81. package/src/types/site.ts +1 -0
  82. package/src/types/topics.ts +17 -2
  83. package/dist/JsonPreview.client-BRhCOHlE.js +0 -93
  84. package/dist/Swagger.client-ch5H8aT2.js +0 -4
  85. package/dist/XmlPreview.client-BcbnRWAp.js +0 -85
@@ -1,9 +1,9 @@
1
- import { defineComponent as K, ref as C, reactive as P, computed as z, watch as g, createElementBlock as Q, nextTick as W, onUnmounted as X, onMounted as Y, openBlock as Z, normalizeStyle as ee, unref as L, createElementVNode as $, renderSlot as j } from "vue";
2
- var H = null;
1
+ import { defineComponent as K, ref as C, reactive as P, computed as z, watch as g, createElementBlock as Q, nextTick as W, onUnmounted as X, onMounted as Y, openBlock as Z, normalizeStyle as ee, unref as H, createElementVNode as $, renderSlot as j } from "vue";
2
+ var L = null;
3
3
  function te(e) {
4
- return H || (H = (window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function(r) {
4
+ return L || (L = (window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function(r) {
5
5
  return setTimeout(r, 16);
6
- }).bind(window)), H(e);
6
+ }).bind(window)), L(e);
7
7
  }
8
8
  var S = null;
9
9
  function re(e) {
@@ -18,15 +18,15 @@ function ie(e) {
18
18
  function x(e, r) {
19
19
  r === void 0 && (r = {});
20
20
  var t = document.createElement(e);
21
- return Object.keys(r).forEach(function(a) {
22
- t[a] = r[a];
21
+ return Object.keys(r).forEach(function(n) {
22
+ t[n] = r[n];
23
23
  }), t;
24
24
  }
25
25
  function B(e, r, t) {
26
- var a = window.getComputedStyle(e, null) || {
26
+ var n = window.getComputedStyle(e, null) || {
27
27
  display: "none"
28
28
  };
29
- return a[r];
29
+ return n[r];
30
30
  }
31
31
  function R(e) {
32
32
  if (!document.documentElement.contains(e))
@@ -53,8 +53,8 @@ function ae(e, r) {
53
53
  var t = e.__resize_listeners__;
54
54
  if (!t) {
55
55
  if (e.__resize_listeners__ = [], window.ResizeObserver) {
56
- var a = e.offsetWidth, s = e.offsetHeight, o = new ResizeObserver(function() {
57
- !e.__resize_observer_triggered__ && (e.__resize_observer_triggered__ = !0, e.offsetWidth === a && e.offsetHeight === s) || w(e);
56
+ var n = e.offsetWidth, s = e.offsetHeight, o = new ResizeObserver(function() {
57
+ !e.__resize_observer_triggered__ && (e.__resize_observer_triggered__ = !0, e.offsetWidth === n && e.offsetHeight === s) || w(e);
58
58
  }), i = R(e), u = i.detached, d = i.rendered;
59
59
  e.__resize_observer_triggered__ = u === !1 && d === !1, e.__resize_observer__ = o, o.observe(e);
60
60
  } else if (e.attachEvent && e.addEventListener)
@@ -87,8 +87,8 @@ function se(e, r) {
87
87
  }
88
88
  }
89
89
  function oe(e) {
90
- var r = e.__resize_last__, t = r.width, a = r.height, s = e.offsetWidth, o = e.offsetHeight;
91
- return s !== t || o !== a ? {
90
+ var r = e.__resize_last__, t = r.width, n = r.height, s = e.offsetWidth, o = e.offsetHeight;
91
+ return s !== t || o !== n ? {
92
92
  width: s,
93
93
  height: o
94
94
  } : null;
@@ -114,14 +114,14 @@ function de(e) {
114
114
  (!r || r === "static") && (e.style.position = "relative"), e.__resize_old_position__ = r, e.__resize_last__ = {};
115
115
  var t = x("div", {
116
116
  className: "resize-triggers"
117
- }), a = x("div", {
117
+ }), n = x("div", {
118
118
  className: "resize-expand-trigger"
119
119
  }), s = x("div"), o = x("div", {
120
120
  className: "resize-contract-trigger"
121
121
  });
122
- a.appendChild(s), t.appendChild(a), t.appendChild(o), e.appendChild(t), e.__resize_triggers__ = {
122
+ n.appendChild(s), t.appendChild(n), t.appendChild(o), e.appendChild(t), e.__resize_triggers__ = {
123
123
  triggers: t,
124
- expand: a,
124
+ expand: n,
125
125
  expandChild: s,
126
126
  contract: o
127
127
  }, M(e), e.addEventListener("scroll", q, !0), e.__resize_last__ = {
@@ -130,79 +130,78 @@ function de(e) {
130
130
  };
131
131
  }
132
132
  function M(e) {
133
- var r = e.__resize_triggers__, t = r.expand, a = r.expandChild, s = r.contract, o = s.scrollWidth, i = s.scrollHeight, u = t.offsetWidth, d = t.offsetHeight, _ = t.scrollWidth, h = t.scrollHeight;
134
- s.scrollLeft = o, s.scrollTop = i, a.style.width = u + 1 + "px", a.style.height = d + 1 + "px", t.scrollLeft = _, t.scrollTop = h;
133
+ var r = e.__resize_triggers__, t = r.expand, n = r.expandChild, s = r.contract, o = s.scrollWidth, i = s.scrollHeight, u = t.offsetWidth, d = t.offsetHeight, _ = t.scrollWidth, h = t.scrollHeight;
134
+ s.scrollLeft = o, s.scrollTop = i, n.style.width = u + 1 + "px", n.style.height = d + 1 + "px", t.scrollLeft = _, t.scrollTop = h;
135
135
  }
136
136
  const le = ["aria-label"];
137
137
  var D = K({ __name: "text-clamp", props: { text: { type: String, required: !0 }, maxHeight: { type: [String, Number], required: !1 }, maxLines: { type: Number, required: !1 }, expanded: { type: Boolean, required: !1, default: !1 }, location: { type: String, required: !1, default: "end" }, ellipsis: { type: String, required: !1, default: "…" }, autoResize: { type: Boolean, required: !1, default: !1 } }, emits: ["clamp-change", "update:expanded"], setup(e, { emit: r }) {
138
- const t = e, a = C(null), s = C(null), o = C(null), i = P({ offset: 0, localExpanded: !!t.expanded, unregisterResizeCallback: null }), u = z(() => {
139
- if (!i.localExpanded && t.maxHeight) return typeof (t == null ? void 0 : t.maxHeight) == "number" ? `${t == null ? void 0 : t.maxHeight}px` : t == null ? void 0 : t.maxHeight;
140
- }), d = () => {
138
+ const t = e, n = C(null), s = C(null), o = C(null), i = P({ offset: 0, localExpanded: !!t.expanded, unregisterResizeCallback: null }), u = z((() => {
139
+ if (!i.localExpanded && t.maxHeight) return typeof t?.maxHeight == "number" ? `${t?.maxHeight}px` : t?.maxHeight;
140
+ })), d = () => {
141
141
  o.value && (o.value.textContent = G.value);
142
142
  }, _ = () => {
143
143
  i.localExpanded || (d(), (p() || l.value) && y());
144
144
  }, h = () => {
145
- t.text && (i.offset = t.text.length, A(), t.autoResize && a.value && (ae(a.value, _), i.unregisterResizeCallback = () => {
146
- a.value && se(a.value, _);
145
+ t.text && (i.offset = t.text.length, A(), t.autoResize && n.value && (ae(n.value, _), i.unregisterResizeCallback = () => {
146
+ n.value && se(n.value, _);
147
147
  }), _());
148
148
  }, A = () => {
149
- var n;
150
- (n = i.unregisterResizeCallback) == null || n.call(i);
151
- }, p = () => !(!t.maxLines && !t.maxHeight) && !!a.value && (!!(t.maxLines && m() > t.maxLines) || !!(t.maxHeight && a.value.scrollHeight > a.value.offsetHeight)), m = () => s.value ? Object.keys(Array.prototype.slice.call(s.value.getClientRects()).reduce((n, { top: c, bottom: v }) => {
149
+ i.unregisterResizeCallback?.();
150
+ }, p = () => !(!t.maxLines && !t.maxHeight) && !!n.value && (!!(t.maxLines && m() > t.maxLines) || !!(t.maxHeight && n.value.scrollHeight > n.value.offsetHeight)), m = () => s.value ? Object.keys(Array.prototype.slice.call(s.value.getClientRects()).reduce(((a, { top: c, bottom: v }) => {
152
151
  const f = `${c}/${v}`;
153
- return n[f] || (n[f] = !0), n;
154
- }, {})).length : 0, y = (...n) => {
155
- const [c = 0, v = i.offset] = n;
152
+ return a[f] || (a[f] = !0), a;
153
+ }), {})).length : 0, y = (...a) => {
154
+ const [c = 0, v = i.offset] = a;
156
155
  if (v - c <= 3) return void I();
157
156
  const f = Math.floor((v + c) / 2);
158
157
  E(f), p() ? y(c, f) : y(f, v);
159
- }, E = (n) => {
160
- i.offset = n, d();
158
+ }, E = (a) => {
159
+ i.offset = a, d();
161
160
  }, I = () => {
162
161
  U(), V();
163
162
  }, U = () => {
164
163
  for (; (!p() || m() < 2) && i.offset < t.text.length; ) N(1);
165
164
  }, V = () => {
166
165
  for (; p() && m() > 1 && i.offset > 0; ) N(-1);
167
- }, N = (n) => {
168
- E(i.offset + n);
169
- }, l = z(() => !!t.text && i.offset !== t.text.length);
170
- g(() => l.value, (n) => {
171
- setTimeout(() => {
172
- r("clamp-change", n);
173
- }, 0);
174
- }, { immediate: !0 });
175
- const G = z(() => l.value ? J.value : t.text), J = z(() => {
166
+ }, N = (a) => {
167
+ E(i.offset + a);
168
+ }, l = z((() => !!t.text && i.offset !== t.text.length));
169
+ g((() => l.value), ((a) => {
170
+ setTimeout((() => {
171
+ r("clamp-change", a);
172
+ }), 0);
173
+ }), { immediate: !0 });
174
+ const G = z((() => l.value ? J.value : t.text)), J = z((() => {
176
175
  if (t.location === "start") return t.ellipsis + (t.text.slice(-i.offset) || "").trim();
177
176
  if (t.location === "middle") {
178
- const n = Math.floor(i.offset / 2);
179
- return (t.text.slice(0, n) || "").trim() + t.ellipsis + (t.text.slice(-n) || "").trim();
177
+ const a = Math.floor(i.offset / 2);
178
+ return (t.text.slice(0, a) || "").trim() + t.ellipsis + (t.text.slice(-a) || "").trim();
180
179
  }
181
180
  return (t.text.slice(0, i.offset) || "").trim() + t.ellipsis;
182
- }), O = () => {
181
+ })), O = () => {
183
182
  i.localExpanded = !0;
184
183
  }, T = () => {
185
184
  i.localExpanded = !1;
186
185
  }, F = () => {
187
186
  i.localExpanded = !i.localExpanded;
188
187
  };
189
- return g(() => t.expanded, (n) => {
190
- i.localExpanded = n;
191
- }), g(() => i.localExpanded, (n) => {
192
- n ? E(t.text.length) : _(), t.expanded !== n && r("update:expanded", n);
193
- }), g(() => [t.maxLines, t.maxHeight, t.ellipsis, t.location, l.value].join(), () => {
194
- W(() => {
188
+ return g((() => t.expanded), ((a) => {
189
+ i.localExpanded = a;
190
+ })), g((() => i.localExpanded), ((a) => {
191
+ a ? E(t.text.length) : _(), t.expanded !== a && r("update:expanded", a);
192
+ })), g((() => [t.maxLines, t.maxHeight, t.ellipsis, t.location, l.value].join()), (() => {
193
+ W((() => {
195
194
  _();
196
- });
197
- }), g(() => [t.text, t.autoResize].join(), () => {
198
- W(() => {
195
+ }));
196
+ })), g((() => [t.text, t.autoResize].join()), (() => {
197
+ W((() => {
199
198
  h();
200
- });
201
- }), X(() => {
199
+ }));
200
+ })), X((() => {
202
201
  A();
203
- }), Y(() => {
202
+ })), Y((() => {
204
203
  h();
205
- }), (n, c) => (Z(), Q("div", { ref_key: "textClampRef", ref: a, class: "text-clamp", style: ee({ overflow: "hidden", maxHeight: L(u) }) }, [$("span", { ref_key: "contentRef", ref: s }, [j(n.$slots, "before", { expand: O, collapse: T, toggle: F, clamped: L(l), expanded: i.localExpanded }), $("span", { ref_key: "textRef", ref: o, "aria-label": e.text }, null, 8, le), j(n.$slots, "after", { expand: O, collapse: T, toggle: F, clamped: L(l), expanded: i.localExpanded })], 512)], 4));
204
+ })), (a, c) => (Z(), Q("div", { ref_key: "textClampRef", ref: n, class: "text-clamp", style: ee({ overflow: "hidden", maxHeight: H(u) }) }, [$("span", { ref_key: "contentRef", ref: s }, [j(a.$slots, "before", { expand: O, collapse: T, toggle: F, clamped: H(l), expanded: i.localExpanded }), $("span", { ref_key: "textRef", ref: o, "aria-label": e.text }, null, 8, le), j(a.$slots, "after", { expand: O, collapse: T, toggle: F, clamped: H(l), expanded: i.localExpanded })], 512)], 4));
206
205
  } });
207
206
  D.__file = "package/text-clamp.vue";
208
207
  const ce = (e) => (e.install = function(r) {