@datagouv/components-next 0.0.18 → 0.0.19
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/dist/{JsonPreview.client-DvhnzVAV.js → JsonPreview.client-BV0aJz23.js} +33 -32
- package/dist/{MapContainer.client-BTa4cY2w.js → MapContainer.client-CxqfY1ge.js} +3 -2
- package/dist/{PdfPreview.client-CFMYzFUs.js → PdfPreview.client-Brxtbt2i.js} +32 -31
- package/dist/{Pmtiles.client-CCMKYGsj.js → Pmtiles.client-AIjEzaIg.js} +694 -693
- package/dist/Swagger.client-C8O-wVwV.js +4 -0
- package/dist/{XmlPreview.client-0NtLStzb.js → XmlPreview.client-XiPNQxwG.js} +27 -26
- package/dist/components-next.js +25 -25
- package/dist/main-CUy8gy19.js +101710 -0
- package/dist/{pdf-vue3-D5SzycIl.js → pdf-vue3-Dm2ZCc3P.js} +1 -1
- package/dist/{text-clamp.esm-D43nX9La.js → text-clamp.esm-Mb7Qdtu9.js} +5 -5
- package/dist/{vue3-json-viewer-BiPkSVJb.js → vue3-json-viewer-B1fiyuLU.js} +100 -100
- package/dist/vue3-xml-viewer.common-BvRWr7iE.js +759 -0
- package/package.json +1 -1
- package/dist/Swagger.client-Ci_pwa2Z.js +0 -4
- package/dist/main-BGN65wY4.js +0 -100461
- package/dist/vue3-xml-viewer.common-ARb4d9zr.js +0 -5443
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineComponent as Zl, ref as c, computed as bl, useSlots as dl, onBeforeMount as Wl, watch as J, onUnmounted as cl, createElementBlock as X, openBlock as M, createElementVNode as s, createCommentVNode as Q, normalizeStyle as u, Fragment as Gl, renderList as ml, renderSlot as H, unref as g, toDisplayString as f } from "vue";
|
|
2
2
|
const Nl = {
|
|
3
3
|
class: "pdf-vue3-main",
|
|
4
4
|
style: { height: "100%", position: "relative", "min-height": "10px" }
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
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
2
|
var H = null;
|
|
3
3
|
function te(e) {
|
|
4
4
|
return H || (H = (window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function(r) {
|
|
@@ -22,7 +22,7 @@ function x(e, r) {
|
|
|
22
22
|
t[a] = r[a];
|
|
23
23
|
}), t;
|
|
24
24
|
}
|
|
25
|
-
function
|
|
25
|
+
function B(e, r, t) {
|
|
26
26
|
var a = window.getComputedStyle(e, null) || {
|
|
27
27
|
display: "none"
|
|
28
28
|
};
|
|
@@ -35,7 +35,7 @@ function R(e) {
|
|
|
35
35
|
rendered: !1
|
|
36
36
|
};
|
|
37
37
|
for (var r = e; r !== document; ) {
|
|
38
|
-
if (
|
|
38
|
+
if (B(r, "display") === "none")
|
|
39
39
|
return {
|
|
40
40
|
detached: !1,
|
|
41
41
|
rendered: !1
|
|
@@ -110,7 +110,7 @@ function w(e) {
|
|
|
110
110
|
});
|
|
111
111
|
}
|
|
112
112
|
function de(e) {
|
|
113
|
-
var r =
|
|
113
|
+
var r = B(e, "position");
|
|
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"
|
|
@@ -202,7 +202,7 @@ var D = K({ __name: "text-clamp", props: { text: { type: String, required: !0 },
|
|
|
202
202
|
A();
|
|
203
203
|
}), Y(() => {
|
|
204
204
|
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 }, [
|
|
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));
|
|
206
206
|
} });
|
|
207
207
|
D.__file = "package/text-clamp.vue";
|
|
208
208
|
const ce = (e) => (e.install = function(r) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
const ye = /^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)(([A-Za-z0-9-~]+)\.)+([A-Za-z0-9-~\/])+$/,
|
|
1
|
+
import { defineComponent as T, ref as k, onMounted as J, h as g, watch as F, computed as O, inject as $, provide as q, createElementBlock as _, openBlock as N, normalizeClass as S, toDisplayString as A, resolveComponent as ce, createCommentVNode as Y, createElementVNode as z, renderSlot as pe, createTextVNode as fe, createVNode as de, nextTick as ve } from "vue";
|
|
2
|
+
const ye = /^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)(([A-Za-z0-9-~]+)\.)+([A-Za-z0-9-~\/])+$/, X = T({
|
|
3
3
|
name: "JsonString",
|
|
4
4
|
props: {
|
|
5
5
|
/** The string value to display. */
|
|
@@ -14,7 +14,7 @@ const ye = /^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)(([A-Za-z0-9-~]+)\.)
|
|
|
14
14
|
*/
|
|
15
15
|
setup(e) {
|
|
16
16
|
const y = k(!0), c = k(!1), p = k(null), d = k(null);
|
|
17
|
-
|
|
17
|
+
J(() => {
|
|
18
18
|
p.value && d.value && p.value.offsetHeight > d.value.offsetHeight && (c.value = !0);
|
|
19
19
|
});
|
|
20
20
|
const i = () => {
|
|
@@ -65,8 +65,8 @@ const ye = /^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)(([A-Za-z0-9-~]+)\.)
|
|
|
65
65
|
}
|
|
66
66
|
},
|
|
67
67
|
setup(e) {
|
|
68
|
-
const y = e, c =
|
|
69
|
-
return (p, d) => (N(), _("span", me,
|
|
68
|
+
const y = e, c = O(() => y.jsonValue === null ? "null" : "undefined");
|
|
69
|
+
return (p, d) => (N(), _("span", me, A(c.value), 1));
|
|
70
70
|
}
|
|
71
71
|
}), ge = /* @__PURE__ */ T({
|
|
72
72
|
__name: "json-number",
|
|
@@ -78,10 +78,10 @@ const ye = /^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)(([A-Za-z0-9-~]+)\.)
|
|
|
78
78
|
}
|
|
79
79
|
},
|
|
80
80
|
setup(e) {
|
|
81
|
-
const y = e, c =
|
|
81
|
+
const y = e, c = O(() => Number.isInteger(y.jsonValue));
|
|
82
82
|
return (p, d) => (N(), _("span", {
|
|
83
83
|
class: S(["jv-item", "jv-number", c.value ? "jv-number-integer" : "jv-number-float"])
|
|
84
|
-
},
|
|
84
|
+
}, A(e.jsonValue.toString()), 3));
|
|
85
85
|
}
|
|
86
86
|
}), be = {
|
|
87
87
|
class: /* @__PURE__ */ S(["jv-item", "jv-boolean"])
|
|
@@ -95,7 +95,7 @@ const ye = /^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)(([A-Za-z0-9-~]+)\.)
|
|
|
95
95
|
}
|
|
96
96
|
},
|
|
97
97
|
setup(e) {
|
|
98
|
-
return (y, c) => (N(), _("span", be,
|
|
98
|
+
return (y, c) => (N(), _("span", be, A(e.jsonValue.toString()), 1));
|
|
99
99
|
}
|
|
100
100
|
}), xe = T({
|
|
101
101
|
name: "JsonObject",
|
|
@@ -136,10 +136,10 @@ const ye = /^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)(([A-Za-z0-9-~]+)\.)
|
|
|
136
136
|
c.value = o;
|
|
137
137
|
}, 0);
|
|
138
138
|
};
|
|
139
|
-
|
|
139
|
+
F(() => e.jsonValue, (o) => {
|
|
140
140
|
d(o);
|
|
141
141
|
}, { immediate: !0, deep: !0 });
|
|
142
|
-
const i =
|
|
142
|
+
const i = O(() => {
|
|
143
143
|
if (!e.sort)
|
|
144
144
|
return c.value;
|
|
145
145
|
const o = Object.keys(c.value).sort(), a = {};
|
|
@@ -163,7 +163,7 @@ const ye = /^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)(([A-Za-z0-9-~]+)\.)
|
|
|
163
163
|
for (const a in i.value)
|
|
164
164
|
if (i.value.hasOwnProperty(a)) {
|
|
165
165
|
const f = i.value[a];
|
|
166
|
-
o.push(g(
|
|
166
|
+
o.push(g(I, {
|
|
167
167
|
key: a,
|
|
168
168
|
// style: { display: !props.expand ? 'none' : undefined }, // Redundant
|
|
169
169
|
sort: e.sort,
|
|
@@ -224,7 +224,7 @@ const ye = /^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)(([A-Za-z0-9-~]+)\.)
|
|
|
224
224
|
n && n.length > t && (c.value.push(n[t]), d(n, t + 1));
|
|
225
225
|
}, 0);
|
|
226
226
|
};
|
|
227
|
-
|
|
227
|
+
F(() => e.jsonValue, (n) => {
|
|
228
228
|
d(n);
|
|
229
229
|
}, { immediate: !0, deep: !0 });
|
|
230
230
|
const i = () => {
|
|
@@ -247,7 +247,7 @@ const ye = /^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)(([A-Za-z0-9-~]+)\.)
|
|
|
247
247
|
})), n.push(g("span", {
|
|
248
248
|
class: ["jv-item", "jv-array"]
|
|
249
249
|
}, "[")), e.expand && c.value.forEach((t, o) => {
|
|
250
|
-
n.push(g(
|
|
250
|
+
n.push(g(I, {
|
|
251
251
|
// Cast JsonBox to Component
|
|
252
252
|
key: o,
|
|
253
253
|
// style: { display: props.expand ? undefined : 'none' }, // This style is redundant if items are not rendered
|
|
@@ -294,8 +294,8 @@ const ye = /^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)(([A-Za-z0-9-~]+)\.)
|
|
|
294
294
|
}
|
|
295
295
|
},
|
|
296
296
|
setup(e) {
|
|
297
|
-
const y = e, c =
|
|
298
|
-
return (d, i) => (N(), _("span", Se, ' "' +
|
|
297
|
+
const y = e, c = $("timeformat", (d) => d.toLocaleString()), p = O(() => c(y.jsonValue));
|
|
298
|
+
return (d, i) => (N(), _("span", Se, ' "' + A(p.value) + '" ', 1));
|
|
299
299
|
}
|
|
300
300
|
}), Ce = {
|
|
301
301
|
class: /* @__PURE__ */ S(["jv-item", "jv-regexp"])
|
|
@@ -309,9 +309,9 @@ const ye = /^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)(([A-Za-z0-9-~]+)\.)
|
|
|
309
309
|
}
|
|
310
310
|
},
|
|
311
311
|
setup(e) {
|
|
312
|
-
return (y, c) => (N(), _("span", Ce,
|
|
312
|
+
return (y, c) => (N(), _("span", Ce, A(e.jsonValue.toString()), 1));
|
|
313
313
|
}
|
|
314
|
-
}),
|
|
314
|
+
}), I = T({
|
|
315
315
|
name: "JsonBox",
|
|
316
316
|
props: {
|
|
317
317
|
/** The JSON value to render. Can be any valid JSON type. */
|
|
@@ -339,10 +339,10 @@ const ye = /^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)(([A-Za-z0-9-~]+)\.)
|
|
|
339
339
|
* @param props - The component's props.
|
|
340
340
|
*/
|
|
341
341
|
setup(e) {
|
|
342
|
-
const y =
|
|
342
|
+
const y = $("expandDepth", 1 / 0), c = $("keyClick", () => {
|
|
343
343
|
}), p = k(!0);
|
|
344
344
|
let d = null;
|
|
345
|
-
|
|
345
|
+
J(() => {
|
|
346
346
|
p.value = e.previewMode || e.depth < y;
|
|
347
347
|
});
|
|
348
348
|
const i = () => {
|
|
@@ -357,7 +357,7 @@ const ye = /^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)(([A-Za-z0-9-~]+)\.)
|
|
|
357
357
|
return () => {
|
|
358
358
|
const n = [];
|
|
359
359
|
let t;
|
|
360
|
-
e.value === null || e.value === void 0 ? t = he : Array.isArray(e.value) ? t = Ee : e.value instanceof Date ? t = Te : e.value instanceof RegExp ? t = _e : typeof e.value == "object" ? t = xe : typeof e.value == "number" ? t = ge : typeof e.value == "string" ? t =
|
|
360
|
+
e.value === null || e.value === void 0 ? t = he : Array.isArray(e.value) ? t = Ee : e.value instanceof Date ? t = Te : e.value instanceof RegExp ? t = _e : typeof e.value == "object" ? t = xe : typeof e.value == "number" ? t = ge : typeof e.value == "string" ? t = X : typeof e.value == "boolean" ? t = je : typeof e.value == "function" ? t = ke : t = X;
|
|
361
361
|
const o = e.value && (Array.isArray(e.value) || typeof e.value == "object" && !(e.value instanceof Date) && // Exclude Date
|
|
362
362
|
!(e.value instanceof RegExp));
|
|
363
363
|
return !e.previewMode && o && !(e.value instanceof RegExp) && n.push(
|
|
@@ -420,19 +420,19 @@ const ye = /^([hH][tT]{2}[pP]:\/\/|[hH][tT]{2}[pP][sS]:\/\/)(([A-Za-z0-9-~]+)\.)
|
|
|
420
420
|
function Ne(e) {
|
|
421
421
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
422
422
|
}
|
|
423
|
-
var
|
|
423
|
+
var H = { exports: {} };
|
|
424
424
|
/*!
|
|
425
425
|
* clipboard.js v2.0.11
|
|
426
426
|
* https://clipboardjs.com/
|
|
427
427
|
*
|
|
428
428
|
* Licensed MIT © Zeno Rocha
|
|
429
429
|
*/
|
|
430
|
-
var
|
|
431
|
-
function
|
|
432
|
-
return
|
|
430
|
+
var Oe = H.exports, Z;
|
|
431
|
+
function Ae() {
|
|
432
|
+
return Z || (Z = 1, function(e, y) {
|
|
433
433
|
(function(c, p) {
|
|
434
434
|
e.exports = p();
|
|
435
|
-
})(
|
|
435
|
+
})(Oe, function() {
|
|
436
436
|
return (
|
|
437
437
|
/******/
|
|
438
438
|
function() {
|
|
@@ -462,21 +462,21 @@ function Oe() {
|
|
|
462
462
|
return v("cut"), r;
|
|
463
463
|
}, h = x;
|
|
464
464
|
function C(u) {
|
|
465
|
-
var r = document.documentElement.getAttribute("dir") === "rtl",
|
|
466
|
-
|
|
467
|
-
var
|
|
468
|
-
return
|
|
465
|
+
var r = document.documentElement.getAttribute("dir") === "rtl", s = document.createElement("textarea");
|
|
466
|
+
s.style.fontSize = "12pt", s.style.border = "0", s.style.padding = "0", s.style.margin = "0", s.style.position = "absolute", s.style[r ? "right" : "left"] = "-9999px";
|
|
467
|
+
var l = window.pageYOffset || document.documentElement.scrollTop;
|
|
468
|
+
return s.style.top = "".concat(l, "px"), s.setAttribute("readonly", ""), s.value = u, s;
|
|
469
469
|
}
|
|
470
470
|
var K = function(u, r) {
|
|
471
|
-
var
|
|
472
|
-
r.container.appendChild(
|
|
473
|
-
var
|
|
474
|
-
return v("copy"),
|
|
471
|
+
var s = C(u);
|
|
472
|
+
r.container.appendChild(s);
|
|
473
|
+
var l = w()(s);
|
|
474
|
+
return v("copy"), s.remove(), l;
|
|
475
475
|
}, Q = function(u) {
|
|
476
476
|
var r = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
|
|
477
477
|
container: document.body
|
|
478
|
-
},
|
|
479
|
-
return typeof u == "string" ?
|
|
478
|
+
}, s = "";
|
|
479
|
+
return typeof u == "string" ? s = K(u, r) : u instanceof HTMLInputElement && !["text", "search", "url", "tel", "password"].includes(u == null ? void 0 : u.type) ? s = K(u.value, r) : (s = w()(u), v("copy")), s;
|
|
480
480
|
}, R = Q;
|
|
481
481
|
function V(u) {
|
|
482
482
|
"@babel/helpers - typeof";
|
|
@@ -487,24 +487,24 @@ function Oe() {
|
|
|
487
487
|
}, V(u);
|
|
488
488
|
}
|
|
489
489
|
var W = function() {
|
|
490
|
-
var u = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, r = u.action,
|
|
491
|
-
if (
|
|
490
|
+
var u = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, r = u.action, s = r === void 0 ? "copy" : r, l = u.container, m = u.target, E = u.text;
|
|
491
|
+
if (s !== "copy" && s !== "cut")
|
|
492
492
|
throw new Error('Invalid "action" value, use either "copy" or "cut"');
|
|
493
493
|
if (m !== void 0)
|
|
494
494
|
if (m && V(m) === "object" && m.nodeType === 1) {
|
|
495
|
-
if (
|
|
495
|
+
if (s === "copy" && m.hasAttribute("disabled"))
|
|
496
496
|
throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');
|
|
497
|
-
if (
|
|
497
|
+
if (s === "cut" && (m.hasAttribute("readonly") || m.hasAttribute("disabled")))
|
|
498
498
|
throw new Error(`Invalid "target" attribute. You can't cut text from elements with "readonly" or "disabled" attributes`);
|
|
499
499
|
} else
|
|
500
500
|
throw new Error('Invalid "target" value, use a valid Element');
|
|
501
501
|
if (E)
|
|
502
502
|
return R(E, {
|
|
503
|
-
container:
|
|
503
|
+
container: l
|
|
504
504
|
});
|
|
505
505
|
if (m)
|
|
506
|
-
return
|
|
507
|
-
container:
|
|
506
|
+
return s === "cut" ? h(m) : R(m, {
|
|
507
|
+
container: l
|
|
508
508
|
});
|
|
509
509
|
}, ee = W;
|
|
510
510
|
function M(u) {
|
|
@@ -520,13 +520,13 @@ function Oe() {
|
|
|
520
520
|
throw new TypeError("Cannot call a class as a function");
|
|
521
521
|
}
|
|
522
522
|
function U(u, r) {
|
|
523
|
-
for (var
|
|
524
|
-
var
|
|
525
|
-
|
|
523
|
+
for (var s = 0; s < r.length; s++) {
|
|
524
|
+
var l = r[s];
|
|
525
|
+
l.enumerable = l.enumerable || !1, l.configurable = !0, "value" in l && (l.writable = !0), Object.defineProperty(u, l.key, l);
|
|
526
526
|
}
|
|
527
527
|
}
|
|
528
|
-
function ne(u, r,
|
|
529
|
-
return r && U(u.prototype, r),
|
|
528
|
+
function ne(u, r, s) {
|
|
529
|
+
return r && U(u.prototype, r), s && U(u, s), u;
|
|
530
530
|
}
|
|
531
531
|
function oe(u, r) {
|
|
532
532
|
if (typeof r != "function" && r !== null)
|
|
@@ -534,20 +534,20 @@ function Oe() {
|
|
|
534
534
|
u.prototype = Object.create(r && r.prototype, { constructor: { value: u, writable: !0, configurable: !0 } }), r && D(u, r);
|
|
535
535
|
}
|
|
536
536
|
function D(u, r) {
|
|
537
|
-
return D = Object.setPrototypeOf || function(
|
|
538
|
-
return
|
|
537
|
+
return D = Object.setPrototypeOf || function(s, l) {
|
|
538
|
+
return s.__proto__ = l, s;
|
|
539
539
|
}, D(u, r);
|
|
540
540
|
}
|
|
541
541
|
function re(u) {
|
|
542
|
-
var r =
|
|
542
|
+
var r = le();
|
|
543
543
|
return function() {
|
|
544
|
-
var
|
|
544
|
+
var s = B(u), l;
|
|
545
545
|
if (r) {
|
|
546
546
|
var m = B(this).constructor;
|
|
547
|
-
|
|
547
|
+
l = Reflect.construct(s, arguments, m);
|
|
548
548
|
} else
|
|
549
|
-
|
|
550
|
-
return ae(this,
|
|
549
|
+
l = s.apply(this, arguments);
|
|
550
|
+
return ae(this, l);
|
|
551
551
|
};
|
|
552
552
|
}
|
|
553
553
|
function ae(u, r) {
|
|
@@ -558,7 +558,7 @@ function Oe() {
|
|
|
558
558
|
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
559
559
|
return u;
|
|
560
560
|
}
|
|
561
|
-
function
|
|
561
|
+
function le() {
|
|
562
562
|
if (typeof Reflect > "u" || !Reflect.construct || Reflect.construct.sham) return !1;
|
|
563
563
|
if (typeof Proxy == "function") return !0;
|
|
564
564
|
try {
|
|
@@ -573,23 +573,23 @@ function Oe() {
|
|
|
573
573
|
return r.__proto__ || Object.getPrototypeOf(r);
|
|
574
574
|
}, B(u);
|
|
575
575
|
}
|
|
576
|
-
function
|
|
577
|
-
var
|
|
578
|
-
if (r.hasAttribute(
|
|
579
|
-
return r.getAttribute(
|
|
576
|
+
function P(u, r) {
|
|
577
|
+
var s = "data-clipboard-".concat(u);
|
|
578
|
+
if (r.hasAttribute(s))
|
|
579
|
+
return r.getAttribute(s);
|
|
580
580
|
}
|
|
581
|
-
var
|
|
582
|
-
oe(
|
|
583
|
-
var r = re(
|
|
584
|
-
function l
|
|
581
|
+
var se = /* @__PURE__ */ function(u) {
|
|
582
|
+
oe(s, u);
|
|
583
|
+
var r = re(s);
|
|
584
|
+
function s(l, m) {
|
|
585
585
|
var E;
|
|
586
|
-
return te(this,
|
|
586
|
+
return te(this, s), E = r.call(this), E.resolveOptions(m), E.listenClick(l), E;
|
|
587
587
|
}
|
|
588
|
-
return ne(
|
|
588
|
+
return ne(s, [{
|
|
589
589
|
key: "resolveOptions",
|
|
590
590
|
value: function() {
|
|
591
|
-
var
|
|
592
|
-
this.action = typeof
|
|
591
|
+
var l = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
|
|
592
|
+
this.action = typeof l.action == "function" ? l.action : this.defaultAction, this.target = typeof l.target == "function" ? l.target : this.defaultTarget, this.text = typeof l.text == "function" ? l.text : this.defaultText, this.container = M(l.container) === "object" ? l.container : document.body;
|
|
593
593
|
}
|
|
594
594
|
/**
|
|
595
595
|
* Adds a click event listener to the passed trigger.
|
|
@@ -597,9 +597,9 @@ function Oe() {
|
|
|
597
597
|
*/
|
|
598
598
|
}, {
|
|
599
599
|
key: "listenClick",
|
|
600
|
-
value: function(
|
|
600
|
+
value: function(l) {
|
|
601
601
|
var m = this;
|
|
602
|
-
this.listener = j()(
|
|
602
|
+
this.listener = j()(l, "click", function(E) {
|
|
603
603
|
return m.onClick(E);
|
|
604
604
|
});
|
|
605
605
|
}
|
|
@@ -609,8 +609,8 @@ function Oe() {
|
|
|
609
609
|
*/
|
|
610
610
|
}, {
|
|
611
611
|
key: "onClick",
|
|
612
|
-
value: function(
|
|
613
|
-
var m =
|
|
612
|
+
value: function(l) {
|
|
613
|
+
var m = l.delegateTarget || l.currentTarget, E = this.action(m) || "copy", L = ee({
|
|
614
614
|
action: E,
|
|
615
615
|
container: this.container,
|
|
616
616
|
target: this.target(m),
|
|
@@ -631,8 +631,8 @@ function Oe() {
|
|
|
631
631
|
*/
|
|
632
632
|
}, {
|
|
633
633
|
key: "defaultAction",
|
|
634
|
-
value: function(
|
|
635
|
-
return
|
|
634
|
+
value: function(l) {
|
|
635
|
+
return P("action", l);
|
|
636
636
|
}
|
|
637
637
|
/**
|
|
638
638
|
* Default `target` lookup function.
|
|
@@ -640,8 +640,8 @@ function Oe() {
|
|
|
640
640
|
*/
|
|
641
641
|
}, {
|
|
642
642
|
key: "defaultTarget",
|
|
643
|
-
value: function(
|
|
644
|
-
var m =
|
|
643
|
+
value: function(l) {
|
|
644
|
+
var m = P("target", l);
|
|
645
645
|
if (m)
|
|
646
646
|
return document.querySelector(m);
|
|
647
647
|
}
|
|
@@ -657,8 +657,8 @@ function Oe() {
|
|
|
657
657
|
* Default `text` lookup function.
|
|
658
658
|
* @param {Element} trigger
|
|
659
659
|
*/
|
|
660
|
-
value: function(
|
|
661
|
-
return
|
|
660
|
+
value: function(l) {
|
|
661
|
+
return P("text", l);
|
|
662
662
|
}
|
|
663
663
|
/**
|
|
664
664
|
* Destroy lifecycle.
|
|
@@ -670,11 +670,11 @@ function Oe() {
|
|
|
670
670
|
}
|
|
671
671
|
}], [{
|
|
672
672
|
key: "copy",
|
|
673
|
-
value: function(
|
|
673
|
+
value: function(l) {
|
|
674
674
|
var m = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
|
|
675
675
|
container: document.body
|
|
676
676
|
};
|
|
677
|
-
return R(
|
|
677
|
+
return R(l, m);
|
|
678
678
|
}
|
|
679
679
|
/**
|
|
680
680
|
* Allow fire programmatically a cut action
|
|
@@ -683,8 +683,8 @@ function Oe() {
|
|
|
683
683
|
*/
|
|
684
684
|
}, {
|
|
685
685
|
key: "cut",
|
|
686
|
-
value: function(
|
|
687
|
-
return h(
|
|
686
|
+
value: function(l) {
|
|
687
|
+
return h(l);
|
|
688
688
|
}
|
|
689
689
|
/**
|
|
690
690
|
* Returns the support of the given action, or all actions if no action is
|
|
@@ -694,13 +694,13 @@ function Oe() {
|
|
|
694
694
|
}, {
|
|
695
695
|
key: "isSupported",
|
|
696
696
|
value: function() {
|
|
697
|
-
var
|
|
697
|
+
var l = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ["copy", "cut"], m = typeof l == "string" ? [l] : l, E = !!document.queryCommandSupported;
|
|
698
698
|
return m.forEach(function(L) {
|
|
699
699
|
E = E && !!document.queryCommandSupported(L);
|
|
700
700
|
}), E;
|
|
701
701
|
}
|
|
702
|
-
}]),
|
|
703
|
-
}(a()), ie =
|
|
702
|
+
}]), s;
|
|
703
|
+
}(a()), ie = se;
|
|
704
704
|
}
|
|
705
705
|
),
|
|
706
706
|
/***/
|
|
@@ -911,9 +911,9 @@ function Oe() {
|
|
|
911
911
|
}().default
|
|
912
912
|
);
|
|
913
913
|
});
|
|
914
|
-
}(
|
|
914
|
+
}(H)), H.exports;
|
|
915
915
|
}
|
|
916
|
-
var Me =
|
|
916
|
+
var Me = Ae();
|
|
917
917
|
const Ve = /* @__PURE__ */ Ne(Me), Be = function(e, y) {
|
|
918
918
|
let c = Date.now(), p;
|
|
919
919
|
return (...d) => {
|
|
@@ -924,7 +924,7 @@ const Ve = /* @__PURE__ */ Ne(Me), Be = function(e, y) {
|
|
|
924
924
|
}, Le = T({
|
|
925
925
|
name: "JsonViewer",
|
|
926
926
|
components: {
|
|
927
|
-
JsonBox:
|
|
927
|
+
JsonBox: I
|
|
928
928
|
},
|
|
929
929
|
props: {
|
|
930
930
|
value: {
|
|
@@ -976,10 +976,10 @@ const Ve = /* @__PURE__ */ Ne(Me), Be = function(e, y) {
|
|
|
976
976
|
*/
|
|
977
977
|
setup(e, { emit: y }) {
|
|
978
978
|
const c = k(!1), p = k(!1), d = k(e.expanded), i = k(null), n = k(null);
|
|
979
|
-
|
|
979
|
+
q("expandDepth", e.expandDepth), q("timeformat", e.timeformat), q("keyClick", (v) => {
|
|
980
980
|
y("onKeyClick", v);
|
|
981
981
|
});
|
|
982
|
-
const t =
|
|
982
|
+
const t = O(() => "jv-container jv-" + e.theme + (e.boxed ? " boxed" : "")), o = O(() => {
|
|
983
983
|
if (typeof e.copyable == "boolean" && !e.copyable)
|
|
984
984
|
return { copyText: "copy", copiedText: "copied!", timeout: 2e3, align: "right" };
|
|
985
985
|
const v = e.copyable;
|
|
@@ -989,7 +989,7 @@ const Ve = /* @__PURE__ */ Ne(Me), Be = function(e, y) {
|
|
|
989
989
|
timeout: v.timeout || 2e3,
|
|
990
990
|
align: v.align || "right"
|
|
991
991
|
};
|
|
992
|
-
}), a =
|
|
992
|
+
}), a = O(() => {
|
|
993
993
|
if (!e.parse || typeof e.value != "string")
|
|
994
994
|
return e.value;
|
|
995
995
|
try {
|
|
@@ -1010,9 +1010,9 @@ const Ve = /* @__PURE__ */ Ne(Me), Be = function(e, y) {
|
|
|
1010
1010
|
}, w = () => {
|
|
1011
1011
|
d.value = !d.value;
|
|
1012
1012
|
};
|
|
1013
|
-
return
|
|
1013
|
+
return F(() => e.value, () => {
|
|
1014
1014
|
f();
|
|
1015
|
-
}),
|
|
1015
|
+
}), J(() => {
|
|
1016
1016
|
e.boxed && n.value && (f(), n.value.$el.addEventListener("resized", f, !0)), e.copyable && i.value && new Ve(i.value, {
|
|
1017
1017
|
text: () => JSON.stringify(a.value, null, 2)
|
|
1018
1018
|
// Use parseValue for copying
|
|
@@ -1048,16 +1048,16 @@ function De(e, y, c, p, d, i) {
|
|
|
1048
1048
|
key: 0,
|
|
1049
1049
|
class: S(`jv-tooltip ${e.copyText.align || "right"}`)
|
|
1050
1050
|
}, [
|
|
1051
|
-
|
|
1051
|
+
z("span", {
|
|
1052
1052
|
ref: "clip",
|
|
1053
1053
|
class: S(["jv-button", { copied: e.copied }])
|
|
1054
1054
|
}, [
|
|
1055
1055
|
pe(e.$slots, "copy", { copied: e.copied }, () => [
|
|
1056
|
-
fe(
|
|
1056
|
+
fe(A(e.copied ? e.copyText.copiedText : e.copyText.copyText), 1)
|
|
1057
1057
|
])
|
|
1058
1058
|
], 2)
|
|
1059
1059
|
], 2)) : Y("", !0),
|
|
1060
|
-
|
|
1060
|
+
z("div", {
|
|
1061
1061
|
class: S(["jv-code", { open: e.expandCode, boxed: e.boxed }])
|
|
1062
1062
|
}, [
|
|
1063
1063
|
de(n, {
|
|
@@ -1072,18 +1072,18 @@ function De(e, y, c, p, d, i) {
|
|
|
1072
1072
|
class: "jv-more",
|
|
1073
1073
|
onClick: y[0] || (y[0] = (...t) => e.toggleExpandCode && e.toggleExpandCode(...t))
|
|
1074
1074
|
}, [
|
|
1075
|
-
|
|
1075
|
+
z("span", {
|
|
1076
1076
|
class: S(["jv-toggle", { open: !!e.expandCode }])
|
|
1077
1077
|
}, null, 2)
|
|
1078
1078
|
])) : Y("", !0)
|
|
1079
1079
|
], 2);
|
|
1080
1080
|
}
|
|
1081
|
-
const
|
|
1082
|
-
e.component(
|
|
1081
|
+
const G = /* @__PURE__ */ Re(Le, [["render", De]]), Pe = (e) => {
|
|
1082
|
+
e.component(G.name, G);
|
|
1083
1083
|
}, ze = {
|
|
1084
|
-
install:
|
|
1084
|
+
install: Pe
|
|
1085
1085
|
};
|
|
1086
1086
|
export {
|
|
1087
|
-
|
|
1087
|
+
G as JsonViewer,
|
|
1088
1088
|
ze as default
|
|
1089
1089
|
};
|