@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.
- package/README.md +5 -15
- package/assets/labels/hvd.svg +15 -0
- package/assets/labels/inspire.svg +20 -0
- package/assets/labels/sl.svg +5 -0
- package/assets/labels/spd.svg +5 -0
- package/assets/labels/sr.svg +5 -0
- package/dist/JsonPreview.client-nkpNPvZb.js +92 -0
- package/dist/{MapContainer.client-Dhfz-YU8.js → MapContainer.client-CrTw-ai8.js} +17587 -6826
- package/dist/{PdfPreview.client--W0FK7CN.js → PdfPreview.client-JpAWf0A2.js} +47 -48
- package/dist/{Pmtiles.client-B6vRTwrm.js → Pmtiles.client-B83l4Ft5.js} +7609 -7503
- package/dist/Swagger.client-D1TfRQjI.js +4 -0
- package/dist/XmlPreview.client-DV8N1S9Y.js +84 -0
- package/dist/components-next.css +6 -6
- package/dist/components-next.js +95 -80
- package/dist/components.css +2 -2
- package/dist/en-CuSmdvir.js +30 -0
- package/dist/hvd-DYeke1vM.js +4 -0
- package/dist/inspire-BLXeJvob.js +4 -0
- package/dist/{main-yWiuApVL.js → main-CN6IuSUA.js} +53400 -55985
- package/dist/{pdf-vue3-Dm2ZCc3P.js → pdf-vue3-IkJO65RH.js} +2 -2
- package/dist/{pdf.min-f72cfa08-DAetWL3M.js → pdf.min-f72cfa08-CdgJTooZ.js} +78 -78
- package/dist/sl-VR8Tb1_u.js +4 -0
- package/dist/spd-BJ-Omhgt.js +4 -0
- package/dist/sr-DjSF-8xW.js +4 -0
- package/dist/{text-clamp.esm-Mb7Qdtu9.js → text-clamp.esm-B5kW_XMt.js} +54 -55
- package/dist/{vue3-json-viewer-B1fiyuLU.js → vue3-json-viewer-BXwup7nO.js} +88 -93
- package/dist/{vue3-xml-viewer.common-1QyofKqS.js → vue3-xml-viewer.common-9hga4rGF.js} +54 -54
- package/package.json +12 -11
- package/src/components/ActivityList/ActivityList.vue +159 -0
- package/src/components/ActivityList/UserActivityList.vue +30 -0
- package/src/components/AppLink.vue +3 -3
- package/src/components/Avatar.vue +1 -0
- package/src/components/DataserviceCard.vue +3 -3
- package/src/components/DatasetCard.vue +19 -18
- package/src/components/DatasetInformationPanel.vue +16 -16
- package/src/components/DatasetLabelTag.vue +40 -0
- package/src/components/DatasetQuality.vue +13 -10
- package/src/components/DatasetQualityInline.vue +5 -2
- package/src/components/DatasetQualityScore.vue +3 -3
- package/src/components/DatasetQualityTooltipContent.vue +2 -2
- package/src/components/DateRangeDetails.vue +7 -3
- package/src/components/ExtraAccordion.vue +3 -1
- package/src/components/OrganizationNameWithCertificate.vue +2 -2
- package/src/components/PaddedContainer.vue +28 -0
- package/src/components/Pagination.vue +2 -2
- package/src/components/Placeholder.vue +1 -1
- package/src/components/ReadMore.vue +17 -17
- package/src/components/ResourceAccordion/DataStructure.vue +8 -3
- package/src/components/ResourceAccordion/EditButton.vue +2 -2
- package/src/components/ResourceAccordion/JsonPreview.client.vue +7 -5
- package/src/components/ResourceAccordion/MapContainer.client.vue +2 -2
- package/src/components/ResourceAccordion/Metadata.vue +10 -10
- package/src/components/ResourceAccordion/PdfPreview.client.vue +7 -5
- package/src/components/ResourceAccordion/Pmtiles.client.vue +3 -3
- package/src/components/ResourceAccordion/Preview.vue +2 -2
- package/src/components/ResourceAccordion/ResourceAccordion.vue +23 -15
- package/src/components/ResourceAccordion/SchemaBadge.vue +4 -4
- package/src/components/ResourceAccordion/XmlPreview.client.vue +7 -5
- package/src/components/ReuseCard.vue +3 -3
- package/src/components/ReuseDetails.vue +2 -2
- package/src/components/SmallChart.vue +33 -30
- package/src/components/StatBox.vue +12 -7
- package/src/components/Toggletip.vue +0 -1
- package/src/components/TranslationT.vue +51 -0
- package/src/composables/useTranslation.ts +169 -0
- package/src/functions/activities.ts +36 -0
- package/src/functions/api.ts +4 -4
- package/src/functions/datasets.ts +28 -0
- package/src/functions/dates.ts +4 -4
- package/src/functions/helpers.ts +3 -3
- package/src/functions/organizations.ts +2 -2
- package/src/functions/pagination.ts +9 -0
- package/src/functions/resources.ts +2 -2
- package/src/functions/reuses.ts +3 -3
- package/src/main.ts +24 -20
- package/src/types/activity.ts +24 -0
- package/src/types/api.ts +8 -0
- package/src/types/badges.ts +4 -0
- package/src/types/dataservices.ts +6 -8
- package/src/types/datasets.ts +6 -1
- package/src/types/site.ts +1 -0
- package/src/types/topics.ts +17 -2
- package/dist/JsonPreview.client-BRhCOHlE.js +0 -93
- package/dist/Swagger.client-ch5H8aT2.js +0 -4
- 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
|
|
2
|
-
var
|
|
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
|
|
4
|
+
return L || (L = (window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function(r) {
|
|
5
5
|
return setTimeout(r, 16);
|
|
6
|
-
}).bind(window)),
|
|
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(
|
|
22
|
-
t[
|
|
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
|
|
26
|
+
var n = window.getComputedStyle(e, null) || {
|
|
27
27
|
display: "none"
|
|
28
28
|
};
|
|
29
|
-
return
|
|
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
|
|
57
|
-
!e.__resize_observer_triggered__ && (e.__resize_observer_triggered__ = !0, e.offsetWidth ===
|
|
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,
|
|
91
|
-
return s !== t || o !==
|
|
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
|
-
}),
|
|
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
|
-
|
|
122
|
+
n.appendChild(s), t.appendChild(n), t.appendChild(o), e.appendChild(t), e.__resize_triggers__ = {
|
|
123
123
|
triggers: t,
|
|
124
|
-
expand:
|
|
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,
|
|
134
|
-
s.scrollLeft = o, s.scrollTop = i,
|
|
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,
|
|
139
|
-
if (!i.localExpanded && t.maxHeight) return typeof
|
|
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 &&
|
|
146
|
-
|
|
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
|
-
|
|
150
|
-
|
|
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
|
|
154
|
-
}, {})).length : 0, y = (...
|
|
155
|
-
const [c = 0, v = i.offset] =
|
|
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 = (
|
|
160
|
-
i.offset =
|
|
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 = (
|
|
168
|
-
E(i.offset +
|
|
169
|
-
}, l = z(() => !!t.text && i.offset !== t.text.length);
|
|
170
|
-
g(() => l.value, (
|
|
171
|
-
setTimeout(() => {
|
|
172
|
-
r("clamp-change",
|
|
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
|
|
179
|
-
return (t.text.slice(0,
|
|
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, (
|
|
190
|
-
i.localExpanded =
|
|
191
|
-
}), g(() => i.localExpanded, (
|
|
192
|
-
|
|
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
|
-
}), (
|
|
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) {
|