@datagouv/components-next 0.0.30 → 0.0.31
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 +10 -2
- package/assets/main.css +4 -0
- package/dist/{JsonPreview.client-DEoTeNS0.js → JsonPreview.client-B5cv59th.js} +12 -12
- package/dist/{MapContainer.client-CNmXA5i0.js → MapContainer.client-DXVDyZYz.js} +1 -1
- package/dist/{PdfPreview.client-CsVdmxPR.js → PdfPreview.client-XwjUHnmx.js} +5 -5
- package/dist/{Pmtiles.client-GgcBwFa0.js → Pmtiles.client-DfnKDlpg.js} +1 -1
- package/dist/Swagger.client-BisHyZkP.js +4 -0
- package/dist/{XmlPreview.client-C0lxnMVl.js → XmlPreview.client-BSjMew4d.js} +14 -14
- package/dist/components-next.css +1 -1
- package/dist/components-next.js +32 -31
- package/dist/components.css +1 -1
- package/dist/{main-D5CXGAAc.js → main-Qu3kUOIH.js} +15092 -15081
- package/dist/{vue3-xml-viewer.common-WmBgOZ5X.js → vue3-xml-viewer.common-NQY1dx9T.js} +1 -1
- package/package.json +1 -1
- package/src/components/Avatar.vue +2 -1
- package/src/components/BrandedButton.vue +4 -1
- package/src/components/ClientOnly.vue +17 -0
- package/src/components/DataserviceCard.vue +50 -78
- package/src/components/DatasetCard.vue +6 -11
- package/src/components/DatasetQuality.vue +1 -2
- package/src/components/DatasetQualityInline.vue +1 -3
- package/src/components/OrganizationCard.vue +9 -7
- package/src/components/OwnerType.vue +1 -1
- package/src/components/ResourceAccordion/DataStructure.vue +6 -5
- package/src/components/ResourceAccordion/JsonPreview.client.vue +5 -5
- package/src/components/ResourceAccordion/PdfPreview.client.vue +3 -3
- package/src/components/ResourceAccordion/Preview.vue +5 -5
- package/src/components/ResourceAccordion/ResourceAccordion.vue +2 -2
- package/src/components/ResourceAccordion/SchemaBadge.vue +5 -3
- package/src/components/ResourceAccordion/XmlPreview.client.vue +5 -5
- package/src/components/Tabs/TabGroup.vue +13 -1
- package/src/components/Toggletip.vue +81 -49
- package/src/components/ValueWatcher.vue +18 -0
- package/src/composables/useReuseType.ts +2 -1
- package/src/config.ts +5 -4
- package/src/functions/organizations.ts +14 -0
- package/src/functions/reuses.ts +10 -7
- package/src/functions/schemas.ts +32 -31
- package/src/functions/tabularApi.ts +2 -3
- package/src/functions/users.ts +2 -2
- package/src/main.ts +2 -0
- package/src/types/dataservices.ts +1 -0
- package/src/types/site.ts +3 -0
- package/dist/Swagger.client-2tUSrvmQ.js +0 -4
- 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
|
-
//
|
|
49
|
-
|
|
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
|
|
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
|
|
2
|
-
import { d as P, a as
|
|
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-Qu3kUOIH.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 =
|
|
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.
|
|
22
|
+
if (!e || !g.maxJsonPreviewCharSize)
|
|
23
23
|
return !1;
|
|
24
|
-
const t = g.
|
|
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
|
|
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(
|
|
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
|
-
|
|
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(
|
|
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
|
-
|
|
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(
|
|
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
|
-
|
|
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-
|
|
10
|
+
import { c as commonjsGlobal, g as getDefaultExportFromCjs$1, u as useI18n, a as _sfc_main$1, F as Fe } from "./main-Qu3kUOIH.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
|
|
2
|
-
import { d as L, a as h, F as m } from "./main-
|
|
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-Qu3kUOIH.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.
|
|
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
|
|
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
|
-
})) :
|
|
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-
|
|
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-Qu3kUOIH.js";
|
|
3
3
|
var nn = Uint8Array, To = Uint16Array, pg = Int32Array, Ad = new nn([
|
|
4
4
|
0,
|
|
5
5
|
0,
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { d as T, a as
|
|
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-Qu3kUOIH.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__ */
|
|
6
|
+
}, S = /* @__PURE__ */ C({
|
|
7
7
|
__name: "XmlPreview.client",
|
|
8
8
|
props: {
|
|
9
9
|
resource: {}
|
|
10
10
|
},
|
|
11
11
|
setup(k) {
|
|
12
|
-
const z =
|
|
13
|
-
() => import("./vue3-xml-viewer.common-
|
|
12
|
+
const z = b(
|
|
13
|
+
() => import("./vue3-xml-viewer.common-NQY1dx9T.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.
|
|
22
|
+
if (!e || !g.maxXmlPreviewCharSize)
|
|
23
23
|
return !1;
|
|
24
|
-
const t = g.
|
|
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
|
|
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(
|
|
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
|
-
|
|
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(
|
|
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
|
-
|
|
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(
|
|
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
|
-
|
|
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)
|