@datagouv/components-next 1.0.0 → 1.0.2-dev.0
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/assets/main.css +0 -28
- package/dist/{Control-BNCDn-8E.js → Control-DuZJdKV_.js} +1 -1
- package/dist/{Datafair.client-Dls5AHTE.js → Datafair.client-DpeBuzZZ.js} +2 -2
- package/dist/{Event-BOgJUhNR.js → Event--kp8kMdJ.js} +21 -21
- package/dist/{Image-BN-4XkIn.js → Image-34hvypZI.js} +114 -58
- package/dist/{JsonPreview.client-DPDTs433.js → JsonPreview.client-B3sQR-rW.js} +16 -16
- package/dist/{Map-BdT3i2C4.js → Map-BjUnLyj8.js} +1534 -1466
- package/dist/{MapContainer.client-BdAzd7bj.js → MapContainer.client-BA6GCqKX.js} +8 -8
- package/dist/{OSM-CamriM9b.js → OSM-s40W6sQ2.js} +22 -12
- package/dist/PdfPreview.client-CbeSChb8.js +14513 -0
- package/dist/Pmtiles.client-D8pFim1L.js +25190 -0
- package/dist/{ScaleLine-BiesrgOv.js → ScaleLine-KW-nXqp3.js} +2 -2
- package/dist/Swagger.client-B-2Q16qa.js +4 -0
- package/dist/{Tile-DCuqwNOI.js → Tile-DbNFNPfU.js} +189 -172
- package/dist/{TileImage-CmZf8EdU.js → TileImage-BsXBxMtq.js} +132 -102
- package/dist/{View-DcDc7N2K.js → View-BR92hTWP.js} +8 -8
- package/dist/{XmlPreview.client-C0OgBkSq.js → XmlPreview.client-DWJt61wG.js} +15 -15
- package/dist/{common-C4rDcQpp.js → common-PJfpC179.js} +34 -33
- package/dist/components-next.css +4 -4
- package/dist/components-next.js +130 -125
- package/dist/components.css +2 -2
- package/dist/{index-BRGqW8aQ.js → index-DVp7Y0Xu.js} +11105 -6743
- package/dist/{main-CNHxAJ8J.js → main-CrSRA2X-.js} +25208 -25053
- package/dist/{proj-CKwYjU38.js → proj-DsetBcW7.js} +513 -498
- package/dist/{tilecoord-YW3qEH_j.js → tilecoord-Db24Px13.js} +242 -224
- package/dist/{vue3-xml-viewer.common-CmAdQfIy.js → vue3-xml-viewer.common-BjA4LdSC.js} +1 -1
- package/package.json +3 -2
- package/src/components/DataserviceCard.vue +3 -3
- package/src/components/DatasetCard.vue +2 -2
- package/src/components/DatasetQuality.vue +23 -16
- package/src/components/DatasetQualityInline.vue +13 -17
- package/src/components/DatasetQualityScore.vue +12 -15
- package/src/components/DiscussionMessageCard.vue +1 -1
- package/src/components/ObjectCard.vue +2 -2
- package/src/components/ObjectCardHeader.vue +1 -1
- package/src/components/OrganizationHorizontalCard.vue +87 -0
- package/src/components/OrganizationNameWithCertificate.vue +1 -1
- package/src/components/ProgressBar.vue +31 -0
- package/src/components/ResourceAccordion/Datafair.client.vue +1 -1
- package/src/components/ResourceAccordion/JsonPreview.client.vue +3 -3
- package/src/components/ResourceAccordion/MapContainer.client.vue +1 -1
- package/src/components/ResourceAccordion/PdfPreview.client.vue +70 -74
- package/src/components/ResourceAccordion/Pmtiles.client.vue +1 -1
- package/src/components/ResourceAccordion/Preview.vue +1 -1
- package/src/components/ResourceAccordion/ResourceAccordion.vue +5 -8
- package/src/components/ResourceAccordion/XmlPreview.client.vue +3 -3
- package/src/components/ReuseHorizontalCard.vue +1 -1
- package/src/components/Search/Filter/ProducerTypeFilter.vue +13 -3
- package/src/components/Search/GlobalSearch.vue +124 -28
- package/src/components/Toggletip.vue +5 -2
- package/src/components/TopicCard.vue +1 -1
- package/src/composables/useHasTabularData.ts +15 -0
- package/src/composables/useResourceCapabilities.ts +3 -4
- package/src/composables/useTranslation.ts +2 -1
- package/src/functions/api.types.ts +1 -1
- package/src/main.ts +8 -1
- package/src/types/search.ts +29 -1
- package/dist/PdfPreview.client-CopqSDyt.js +0 -107
- package/dist/Pmtiles.client-mF6xaOO_.js +0 -22812
- package/dist/Swagger.client-eJ7gpfZA.js +0 -4
- package/dist/pdf-vue3-IkJO65RH.js +0 -273
- package/dist/pdf.min-f72cfa08-CdgJTooZ.js +0 -9501
package/assets/main.css
CHANGED
|
@@ -188,34 +188,6 @@
|
|
|
188
188
|
.code {
|
|
189
189
|
@apply p-1! font-mono! bg-gray-lower! text-sm! text-gray-medium! rounded!;
|
|
190
190
|
}
|
|
191
|
-
meter.quality-score {
|
|
192
|
-
background: none;
|
|
193
|
-
border: 1px solid var(--color-gray-default);
|
|
194
|
-
border-radius: 8px;
|
|
195
|
-
height: 10px;
|
|
196
|
-
vertical-align: baseline;
|
|
197
|
-
}
|
|
198
|
-
meter.quality-score::-webkit-meter-bar {
|
|
199
|
-
height: 10px;
|
|
200
|
-
background: whiteSmoke;
|
|
201
|
-
border-radius: 8px;
|
|
202
|
-
}
|
|
203
|
-
meter.quality-score::-moz-meter-bar {
|
|
204
|
-
background: whiteSmoke;
|
|
205
|
-
border-radius: 8px;
|
|
206
|
-
}
|
|
207
|
-
meter.quality-score::-webkit-meter-suboptimum-value {
|
|
208
|
-
background-color: var(--color-gray-low);
|
|
209
|
-
}
|
|
210
|
-
meter.quality-score:-moz-meter-sub-optimum::-moz-meter-bar {
|
|
211
|
-
background-color: var(--color-gray-low);
|
|
212
|
-
}
|
|
213
|
-
meter.quality-score::-webkit-meter-optimum-value {
|
|
214
|
-
background-color: #27A658;
|
|
215
|
-
}
|
|
216
|
-
meter.quality-score:-moz-meter-optimum::-moz-meter-bar {
|
|
217
|
-
background-color: #27A658;
|
|
218
|
-
}
|
|
219
191
|
|
|
220
192
|
/* Vue Sonner Toast custom colors */
|
|
221
193
|
[data-sonner-toast][data-type="success"] {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
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-
|
|
2
|
+
import { a as h, _ as v, F as g } from "./main-CrSRA2X-.js";
|
|
3
3
|
const k = { class: "fr-text--xs" }, b = { key: 0 }, y = ["src"], B = /* @__PURE__ */ f({
|
|
4
4
|
__name: "Datafair.client",
|
|
5
5
|
props: {
|
|
@@ -22,7 +22,7 @@ const k = { class: "fr-text--xs" }, b = { key: 0 }, y = ["src"], B = /* @__PURE_
|
|
|
22
22
|
class: "flex items-center space-x-2"
|
|
23
23
|
}, {
|
|
24
24
|
default: m(() => [
|
|
25
|
-
_(c(g), { class: "
|
|
25
|
+
_(c(g), { class: "shrink-0 size-6" }),
|
|
26
26
|
i("span", null, x(c(l)("Erreur lors de l'affichage de l'aperçu.")), 1)
|
|
27
27
|
]),
|
|
28
28
|
_: 1
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { H as x } from "./View-
|
|
2
|
-
import { a as I } from "./common-
|
|
3
|
-
import { B as C,
|
|
4
|
-
import { c as T } from "./Image-
|
|
1
|
+
import { H as x } from "./View-BR92hTWP.js";
|
|
2
|
+
import { a as I } from "./common-PJfpC179.js";
|
|
3
|
+
import { B as C, a7 as h, al as m, u as S, l as p, E as N, i as L, a4 as P, J as Z } from "./proj-DsetBcW7.js";
|
|
4
|
+
import { c as T } from "./Image-34hvypZI.js";
|
|
5
5
|
const n = {
|
|
6
6
|
OPACITY: "opacity",
|
|
7
7
|
VISIBLE: "visible",
|
|
@@ -596,16 +596,16 @@ function V() {
|
|
|
596
596
|
desynchronized: !0
|
|
597
597
|
})), _;
|
|
598
598
|
}
|
|
599
|
-
const B = /^rgba?\(\s*(\d+%?)\s+(\d+%?)\s+(\d+%?)(?:\s*\/\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,
|
|
599
|
+
const B = /^rgba?\(\s*(\d+%?)\s+(\d+%?)\s+(\d+%?)(?:\s*\/\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i, w = /^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i, z = /^rgba?\(\s*(\d+%)\s*,\s*(\d+%)\s*,\s*(\d+%)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i, F = /^#([\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i;
|
|
600
600
|
function f(t, e) {
|
|
601
601
|
return t.endsWith("%") ? Number(t.substring(0, t.length - 1)) / e : Number(t);
|
|
602
602
|
}
|
|
603
|
-
function
|
|
603
|
+
function d(t) {
|
|
604
604
|
throw new Error('failed to parse "' + t + '" as color');
|
|
605
605
|
}
|
|
606
606
|
function A(t) {
|
|
607
607
|
if (t.toLowerCase().startsWith("rgb")) {
|
|
608
|
-
const a = t.match(
|
|
608
|
+
const a = t.match(w) || t.match(B) || t.match(z);
|
|
609
609
|
if (a) {
|
|
610
610
|
const o = a[4], u = 100 / 255;
|
|
611
611
|
return [
|
|
@@ -615,10 +615,10 @@ function A(t) {
|
|
|
615
615
|
o !== void 0 ? h(f(o, 100), 0, 1) : 1
|
|
616
616
|
];
|
|
617
617
|
}
|
|
618
|
-
|
|
618
|
+
d(t);
|
|
619
619
|
}
|
|
620
620
|
if (t.startsWith("#")) {
|
|
621
|
-
if (
|
|
621
|
+
if (F.test(t)) {
|
|
622
622
|
const a = t.substring(1), o = a.length <= 4 ? 1 : 2, u = [0, 0, 0, 255];
|
|
623
623
|
for (let c = 0, g = a.length; c < g; c += o) {
|
|
624
624
|
let y = parseInt(a.substring(c, c + o), 16);
|
|
@@ -626,12 +626,12 @@ function A(t) {
|
|
|
626
626
|
}
|
|
627
627
|
return u[3] = u[3] / 255, u;
|
|
628
628
|
}
|
|
629
|
-
|
|
629
|
+
d(t);
|
|
630
630
|
}
|
|
631
631
|
const e = V();
|
|
632
632
|
e.fillStyle = "#abcdef";
|
|
633
633
|
let r = e.fillStyle;
|
|
634
|
-
e.fillStyle = t, e.fillStyle === r && (e.fillStyle = "#fedcba", r = e.fillStyle, e.fillStyle = t, e.fillStyle === r &&
|
|
634
|
+
e.fillStyle = t, e.fillStyle === r && (e.fillStyle = "#fedcba", r = e.fillStyle, e.fillStyle = t, e.fillStyle === r && d(t));
|
|
635
635
|
const s = e.fillStyle;
|
|
636
636
|
if (s.startsWith("#") || s.startsWith("rgba"))
|
|
637
637
|
return A(s);
|
|
@@ -642,7 +642,7 @@ function A(t) {
|
|
|
642
642
|
function v(t) {
|
|
643
643
|
return typeof t == "string" ? t : H(t);
|
|
644
644
|
}
|
|
645
|
-
const
|
|
645
|
+
const k = 1024, l = {};
|
|
646
646
|
let R = 0;
|
|
647
647
|
function J(t) {
|
|
648
648
|
if (t.length === 4)
|
|
@@ -683,18 +683,18 @@ function ee(t) {
|
|
|
683
683
|
function j(t) {
|
|
684
684
|
if (t === "none")
|
|
685
685
|
return U;
|
|
686
|
-
if (
|
|
687
|
-
return
|
|
688
|
-
if (R >=
|
|
686
|
+
if (l.hasOwnProperty(t))
|
|
687
|
+
return l[t];
|
|
688
|
+
if (R >= k) {
|
|
689
689
|
let r = 0;
|
|
690
|
-
for (const s in
|
|
691
|
-
(r++ & 3) === 0 && (delete
|
|
690
|
+
for (const s in l)
|
|
691
|
+
(r++ & 3) === 0 && (delete l[s], --R);
|
|
692
692
|
}
|
|
693
693
|
const e = A(t);
|
|
694
|
-
e.length !== 4 &&
|
|
694
|
+
e.length !== 4 && d(t);
|
|
695
695
|
for (const r of e)
|
|
696
|
-
isNaN(r) &&
|
|
697
|
-
return
|
|
696
|
+
isNaN(r) && d(t);
|
|
697
|
+
return l[t] = e, ++R, e;
|
|
698
698
|
}
|
|
699
699
|
function te(t) {
|
|
700
700
|
return Array.isArray(t) ? t : j(t);
|
|
@@ -715,7 +715,7 @@ class re extends Z {
|
|
|
715
715
|
* @param {import("../transform.js").Transform} [inversePixelTransform] Transform for
|
|
716
716
|
* CSS pixels to rendered pixels.
|
|
717
717
|
* @param {import("../Map.js").FrameState} [frameState] Frame state.
|
|
718
|
-
* @param {?(CanvasRenderingContext2D|WebGLRenderingContext)} [context] Context.
|
|
718
|
+
* @param {?(CanvasRenderingContext2D|OffscreenCanvasRenderingContext2D|WebGLRenderingContext)} [context] Context.
|
|
719
719
|
*/
|
|
720
720
|
constructor(e, r, s, i) {
|
|
721
721
|
super(e), this.inversePixelTransform = r, this.frameState = s, this.context = i;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { aC as
|
|
2
|
-
const r = typeof navigator < "u" && typeof navigator.userAgent < "u" ? navigator.userAgent.toLowerCase() : "",
|
|
3
|
-
|
|
4
|
-
const
|
|
1
|
+
import { aC as v, E as f, aq as C, aB as h, u as R } from "./proj-DsetBcW7.js";
|
|
2
|
+
const r = typeof navigator < "u" && typeof navigator.userAgent < "u" ? navigator.userAgent.toLowerCase() : "", I = r.includes("safari") && !r.includes("chrom");
|
|
3
|
+
I && (r.includes("version/15.4") || /cpu (os|iphone os) 15_4 like mac os x/.test(r));
|
|
4
|
+
const L = r.includes("webkit") && !r.includes("edge"), D = r.includes("macintosh"), w = typeof devicePixelRatio < "u" ? devicePixelRatio : 1, y = typeof WorkerGlobalScope < "u" && typeof OffscreenCanvas < "u" && self instanceof WorkerGlobalScope, u = typeof Image < "u" && Image.prototype.decode, p = typeof createImageBitmap == "function", O = (function() {
|
|
5
5
|
let e = !1;
|
|
6
6
|
try {
|
|
7
7
|
const t = Object.defineProperty({}, "passive", {
|
|
@@ -13,7 +13,7 @@ const D = r.includes("webkit") && !r.includes("edge"), _ = r.includes("macintosh
|
|
|
13
13
|
} catch {
|
|
14
14
|
}
|
|
15
15
|
return e;
|
|
16
|
-
})(),
|
|
16
|
+
})(), _ = {
|
|
17
17
|
IDLE: 0,
|
|
18
18
|
LOADING: 1,
|
|
19
19
|
LOADED: 2,
|
|
@@ -24,21 +24,23 @@ const D = r.includes("webkit") && !r.includes("edge"), _ = r.includes("macintosh
|
|
|
24
24
|
ERROR: 3,
|
|
25
25
|
EMPTY: 4
|
|
26
26
|
};
|
|
27
|
-
function
|
|
27
|
+
function m(e, t, n, i) {
|
|
28
28
|
let s;
|
|
29
29
|
return n && n.length ? s = /** @type {HTMLCanvasElement} */
|
|
30
|
-
n.shift() :
|
|
30
|
+
n.shift() : y ? s = new class extends OffscreenCanvas {
|
|
31
|
+
style = {};
|
|
32
|
+
}(e ?? 300, t ?? 150) : s = document.createElement("canvas"), e && (s.width = e), t && (s.height = t), /** @type {CanvasRenderingContext2D|OffscreenCanvasRenderingContext2D} */
|
|
31
33
|
s.getContext("2d", i);
|
|
32
34
|
}
|
|
33
35
|
let l;
|
|
34
|
-
function
|
|
35
|
-
return l || (l =
|
|
36
|
+
function N() {
|
|
37
|
+
return l || (l = m(1, 1)), l;
|
|
36
38
|
}
|
|
37
39
|
function T(e) {
|
|
38
40
|
const t = e.canvas;
|
|
39
41
|
t.width = 1, t.height = 1, e.clearRect(0, 0, 1, 1);
|
|
40
42
|
}
|
|
41
|
-
function
|
|
43
|
+
function S(e) {
|
|
42
44
|
let t = e.offsetWidth;
|
|
43
45
|
const n = getComputedStyle(e);
|
|
44
46
|
return t += parseInt(n.marginLeft, 10) + parseInt(n.marginRight, 10), t;
|
|
@@ -48,15 +50,15 @@ function M(e) {
|
|
|
48
50
|
const n = getComputedStyle(e);
|
|
49
51
|
return t += parseInt(n.marginTop, 10) + parseInt(n.marginBottom, 10), t;
|
|
50
52
|
}
|
|
51
|
-
function
|
|
53
|
+
function P(e, t) {
|
|
52
54
|
const n = t.parentNode;
|
|
53
55
|
n && n.replaceChild(e, t);
|
|
54
56
|
}
|
|
55
|
-
function
|
|
57
|
+
function k(e) {
|
|
56
58
|
for (; e.lastChild; )
|
|
57
59
|
e.lastChild.remove();
|
|
58
60
|
}
|
|
59
|
-
function
|
|
61
|
+
function B(e, t) {
|
|
60
62
|
const n = e.childNodes;
|
|
61
63
|
for (let i = 0; ; ++i) {
|
|
62
64
|
const s = n[i], o = t[i];
|
|
@@ -75,23 +77,75 @@ function G(e, t) {
|
|
|
75
77
|
}
|
|
76
78
|
}
|
|
77
79
|
}
|
|
80
|
+
function G() {
|
|
81
|
+
return new Proxy(
|
|
82
|
+
{
|
|
83
|
+
/**
|
|
84
|
+
* @type {Array<HTMLElement>}
|
|
85
|
+
*/
|
|
86
|
+
childNodes: [],
|
|
87
|
+
/**
|
|
88
|
+
* @param {HTMLElement} node html node.
|
|
89
|
+
* @return {HTMLElement} html node.
|
|
90
|
+
*/
|
|
91
|
+
appendChild: function(t) {
|
|
92
|
+
return this.childNodes.push(t), t;
|
|
93
|
+
},
|
|
94
|
+
/**
|
|
95
|
+
* dummy function, as this structure is not supposed to have a parent.
|
|
96
|
+
*/
|
|
97
|
+
remove: function() {
|
|
98
|
+
},
|
|
99
|
+
/**
|
|
100
|
+
* @param {HTMLElement} node html node.
|
|
101
|
+
* @return {HTMLElement} html node.
|
|
102
|
+
*/
|
|
103
|
+
removeChild: function(t) {
|
|
104
|
+
const n = this.childNodes.indexOf(t);
|
|
105
|
+
if (n === -1)
|
|
106
|
+
throw new Error("Node to remove was not found");
|
|
107
|
+
return this.childNodes.splice(n, 1), t;
|
|
108
|
+
},
|
|
109
|
+
/**
|
|
110
|
+
* @param {HTMLElement} newNode new html node.
|
|
111
|
+
* @param {HTMLElement} referenceNode reference html node.
|
|
112
|
+
* @return {HTMLElement} new html node.
|
|
113
|
+
*/
|
|
114
|
+
insertBefore: function(t, n) {
|
|
115
|
+
const i = this.childNodes.indexOf(n);
|
|
116
|
+
if (i === -1)
|
|
117
|
+
throw new Error("Reference node not found");
|
|
118
|
+
return this.childNodes.splice(i, 0, t), t;
|
|
119
|
+
},
|
|
120
|
+
style: {}
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
get(t, n, i) {
|
|
124
|
+
return n === "firstElementChild" ? t.childNodes.length > 0 ? t.childNodes[0] : null : Reflect.get(t, n, i);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
);
|
|
128
|
+
}
|
|
78
129
|
function W(e) {
|
|
130
|
+
return typeof HTMLCanvasElement < "u" && e instanceof HTMLCanvasElement || typeof OffscreenCanvas < "u" && e instanceof OffscreenCanvas;
|
|
131
|
+
}
|
|
132
|
+
function b(e) {
|
|
79
133
|
return e[0] > 0 && e[1] > 0;
|
|
80
134
|
}
|
|
81
|
-
function
|
|
135
|
+
function H(e, t, n) {
|
|
82
136
|
return n === void 0 && (n = [0, 0]), n[0] = e[0] * t + 0.5 | 0, n[1] = e[1] * t + 0.5 | 0, n;
|
|
83
137
|
}
|
|
84
|
-
function
|
|
138
|
+
function V(e, t) {
|
|
85
139
|
return Array.isArray(e) ? e : (t === void 0 ? t = [e, e] : (t[0] = e, t[1] = e), t);
|
|
86
140
|
}
|
|
87
|
-
const
|
|
141
|
+
const a = {
|
|
88
142
|
IDLE: 0,
|
|
89
143
|
LOADING: 1,
|
|
90
144
|
LOADED: 2,
|
|
91
145
|
ERROR: 3,
|
|
92
146
|
EMPTY: 4
|
|
93
147
|
};
|
|
94
|
-
class
|
|
148
|
+
class F extends v {
|
|
95
149
|
/**
|
|
96
150
|
* @param {import("./extent.js").Extent} extent Extent.
|
|
97
151
|
* @param {number|Array<number>|undefined} resolution Resolution. If provided as array, x and y
|
|
@@ -100,7 +154,7 @@ class V extends I {
|
|
|
100
154
|
* @param {import("./ImageState.js").default|Loader} stateOrLoader State.
|
|
101
155
|
*/
|
|
102
156
|
constructor(t, n, i, s) {
|
|
103
|
-
super(), this.extent = t, this.pixelRatio_ = i, this.resolution = n, this.state = typeof s == "function" ?
|
|
157
|
+
super(), this.extent = t, this.pixelRatio_ = i, this.resolution = n, this.state = typeof s == "function" ? a.IDLE : s, this.image_ = null, this.loader = typeof s == "function" ? s : null;
|
|
104
158
|
}
|
|
105
159
|
/**
|
|
106
160
|
* @protected
|
|
@@ -145,19 +199,19 @@ class V extends I {
|
|
|
145
199
|
* Load not yet loaded URI.
|
|
146
200
|
*/
|
|
147
201
|
load() {
|
|
148
|
-
if (this.state ==
|
|
149
|
-
this.state =
|
|
202
|
+
if (this.state == a.IDLE && this.loader) {
|
|
203
|
+
this.state = a.LOADING, this.changed();
|
|
150
204
|
const t = this.getResolution(), n = Array.isArray(t) ? t[0] : t;
|
|
151
|
-
|
|
205
|
+
C(
|
|
152
206
|
() => this.loader(
|
|
153
207
|
this.getExtent(),
|
|
154
208
|
n,
|
|
155
209
|
this.getPixelRatio()
|
|
156
210
|
)
|
|
157
211
|
).then((i) => {
|
|
158
|
-
"image" in i && (this.image_ = i.image), "extent" in i && (this.extent = i.extent), "resolution" in i && (this.resolution = i.resolution), "pixelRatio" in i && (this.pixelRatio_ = i.pixelRatio), (i instanceof HTMLImageElement || p && i instanceof ImageBitmap || i instanceof HTMLCanvasElement || i instanceof HTMLVideoElement) && (this.image_ = i), this.state =
|
|
212
|
+
"image" in i && (this.image_ = i.image), "extent" in i && (this.extent = i.extent), "resolution" in i && (this.resolution = i.resolution), "pixelRatio" in i && (this.pixelRatio_ = i.pixelRatio), (i instanceof HTMLImageElement || p && i instanceof ImageBitmap || i instanceof HTMLCanvasElement || i instanceof HTMLVideoElement) && (this.image_ = i), this.state = a.LOADED;
|
|
159
213
|
}).catch((i) => {
|
|
160
|
-
this.state =
|
|
214
|
+
this.state = a.ERROR, console.error(i);
|
|
161
215
|
}).finally(() => this.changed());
|
|
162
216
|
}
|
|
163
217
|
}
|
|
@@ -174,74 +228,76 @@ class V extends I {
|
|
|
174
228
|
this.resolution = t;
|
|
175
229
|
}
|
|
176
230
|
}
|
|
177
|
-
function
|
|
231
|
+
function K(e, t, n) {
|
|
178
232
|
const i = (
|
|
179
233
|
/** @type {HTMLImageElement} */
|
|
180
234
|
e
|
|
181
235
|
);
|
|
182
|
-
let s = !0, o = !1,
|
|
183
|
-
const
|
|
184
|
-
|
|
185
|
-
|
|
236
|
+
let s = !0, o = !1, c = !1;
|
|
237
|
+
const d = [
|
|
238
|
+
h(i, f.LOAD, function() {
|
|
239
|
+
c = !0, o || t();
|
|
186
240
|
})
|
|
187
241
|
];
|
|
188
242
|
return i.src && u ? (o = !0, i.decode().then(function() {
|
|
189
243
|
s && t();
|
|
190
244
|
}).catch(function(E) {
|
|
191
|
-
s && (
|
|
192
|
-
})) :
|
|
193
|
-
s = !1,
|
|
245
|
+
s && (c ? t() : n());
|
|
246
|
+
})) : d.push(h(i, f.ERROR, n)), function() {
|
|
247
|
+
s = !1, d.forEach(R);
|
|
194
248
|
};
|
|
195
249
|
}
|
|
196
|
-
function
|
|
250
|
+
function x(e, t) {
|
|
197
251
|
return new Promise((n, i) => {
|
|
198
252
|
function s() {
|
|
199
|
-
|
|
253
|
+
c(), n(e);
|
|
200
254
|
}
|
|
201
255
|
function o() {
|
|
202
|
-
|
|
256
|
+
c(), i(new Error("Image load error"));
|
|
203
257
|
}
|
|
204
|
-
function
|
|
258
|
+
function c() {
|
|
205
259
|
e.removeEventListener("load", s), e.removeEventListener("error", o);
|
|
206
260
|
}
|
|
207
261
|
e.addEventListener("load", s), e.addEventListener("error", o);
|
|
208
262
|
});
|
|
209
263
|
}
|
|
210
|
-
function
|
|
264
|
+
function g(e, t) {
|
|
211
265
|
return t && (e.src = t), e.src && u ? new Promise(
|
|
212
266
|
(n, i) => e.decode().then(() => n(e)).catch(
|
|
213
267
|
(s) => e.complete && e.width ? n(e) : i(s)
|
|
214
268
|
)
|
|
215
|
-
) :
|
|
269
|
+
) : x(e);
|
|
216
270
|
}
|
|
217
|
-
function
|
|
271
|
+
function q(e, t) {
|
|
218
272
|
return t && (e.src = t), e.src && u && p ? e.decode().then(() => createImageBitmap(e)).catch((n) => {
|
|
219
273
|
if (e.complete && e.width)
|
|
220
274
|
return e;
|
|
221
275
|
throw n;
|
|
222
|
-
}) :
|
|
276
|
+
}) : g(e);
|
|
223
277
|
}
|
|
224
278
|
export {
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
279
|
+
w as D,
|
|
280
|
+
F as I,
|
|
281
|
+
D as M,
|
|
282
|
+
O as P,
|
|
283
|
+
_ as T,
|
|
284
|
+
y as W,
|
|
231
285
|
M as a,
|
|
232
286
|
T as b,
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
287
|
+
m as c,
|
|
288
|
+
a as d,
|
|
289
|
+
q as e,
|
|
290
|
+
P as f,
|
|
291
|
+
L as g,
|
|
292
|
+
N as h,
|
|
293
|
+
g as i,
|
|
240
294
|
G as j,
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
k as
|
|
295
|
+
B as k,
|
|
296
|
+
W as l,
|
|
297
|
+
b as m,
|
|
298
|
+
K as n,
|
|
299
|
+
S as o,
|
|
300
|
+
k as r,
|
|
301
|
+
H as s,
|
|
302
|
+
V as t
|
|
247
303
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent as S, defineAsyncComponent as b, ref as o, computed as w, onMounted as N, createElementBlock as p, openBlock as
|
|
2
|
-
import { u as P, a as E, g as q, _ as m, F as v } from "./main-
|
|
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-CrSRA2X-.js";
|
|
3
3
|
const B = { class: "fr-text--xs" }, O = { key: 0 }, V = {
|
|
4
4
|
key: 1,
|
|
5
5
|
class: "text-gray-medium"
|
|
@@ -11,7 +11,7 @@ const B = { class: "fr-text--xs" }, O = { key: 0 }, V = {
|
|
|
11
11
|
setup(k) {
|
|
12
12
|
const z = b(
|
|
13
13
|
() => import("./vue3-json-viewer-BXwup7nO.js").then((e) => (Promise.resolve({ }), e.JsonViewer))
|
|
14
|
-
), g = k, x = P(), { t:
|
|
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
15
|
const e = y.value;
|
|
16
16
|
if (!e || !x.maxJsonPreviewCharSize)
|
|
17
17
|
return !1;
|
|
@@ -22,7 +22,7 @@ const B = { class: "fr-text--xs" }, O = { key: 0 }, V = {
|
|
|
22
22
|
_.value = !0;
|
|
23
23
|
return;
|
|
24
24
|
}
|
|
25
|
-
c.value = !0,
|
|
25
|
+
c.value = !0, n.value = null;
|
|
26
26
|
try {
|
|
27
27
|
const e = await fetch(g.resource.url);
|
|
28
28
|
if (!e.ok)
|
|
@@ -30,15 +30,15 @@ const B = { class: "fr-text--xs" }, O = { key: 0 }, V = {
|
|
|
30
30
|
const a = await e.json();
|
|
31
31
|
l.value = a;
|
|
32
32
|
} catch (e) {
|
|
33
|
-
console.error("Error loading JSON:", e), e instanceof TypeError ?
|
|
33
|
+
console.error("Error loading JSON:", e), e instanceof TypeError ? n.value = "network" : n.value = "generic", l.value = null;
|
|
34
34
|
} finally {
|
|
35
35
|
c.value = !1;
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
return N(() => {
|
|
39
39
|
C();
|
|
40
|
-
}), (e, a) => (
|
|
41
|
-
l.value ? (
|
|
40
|
+
}), (e, a) => (r(), p("div", B, [
|
|
41
|
+
l.value ? (r(), p("div", O, [
|
|
42
42
|
u(t(z), {
|
|
43
43
|
value: l.value,
|
|
44
44
|
boxed: "",
|
|
@@ -48,34 +48,34 @@ const B = { class: "fr-text--xs" }, O = { key: 0 }, V = {
|
|
|
48
48
|
"expand-depth": 2,
|
|
49
49
|
"indent-width": 2
|
|
50
50
|
}, null, 8, ["value"])
|
|
51
|
-
])) : c.value ? (
|
|
51
|
+
])) : c.value ? (r(), p("div", V, i(t(s)("Chargement de l'aperçu JSON...")), 1)) : _.value ? (r(), f(m, {
|
|
52
52
|
key: 2,
|
|
53
53
|
type: "warning",
|
|
54
54
|
class: "flex items-center space-x-2"
|
|
55
55
|
}, {
|
|
56
56
|
default: d(() => [
|
|
57
|
-
u(t(v), { class: "
|
|
58
|
-
h("span", null, i(y.value ? t(
|
|
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
59
|
]),
|
|
60
60
|
_: 1
|
|
61
|
-
})) :
|
|
61
|
+
})) : n.value === "network" ? (r(), f(m, {
|
|
62
62
|
key: 3,
|
|
63
63
|
type: "warning",
|
|
64
64
|
class: "flex items-center space-x-2"
|
|
65
65
|
}, {
|
|
66
66
|
default: d(() => [
|
|
67
|
-
u(t(v), { class: "
|
|
68
|
-
h("span", null, i(t(
|
|
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
69
|
]),
|
|
70
70
|
_: 1
|
|
71
|
-
})) :
|
|
71
|
+
})) : n.value ? (r(), f(m, {
|
|
72
72
|
key: 4,
|
|
73
73
|
type: "warning",
|
|
74
74
|
class: "flex items-center space-x-2"
|
|
75
75
|
}, {
|
|
76
76
|
default: d(() => [
|
|
77
|
-
u(t(v), { class: "
|
|
78
|
-
h("span", null, i(t(
|
|
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
79
|
]),
|
|
80
80
|
_: 1
|
|
81
81
|
})) : T("", !0)
|