@gkucmierz/nano-ui 1.5.4 → 1.7.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 +383 -38
- package/dist/nano-ui-512.png +0 -0
- package/dist/nano-ui.css +1 -1
- package/dist/nano-ui.js +944 -179
- package/dist/nano-ui.svg +54 -0
- package/package.json +9 -2
package/dist/nano-ui.js
CHANGED
|
@@ -101,9 +101,7 @@ typeof window < "u" && (window.Analytics = k);
|
|
|
101
101
|
var A = { mounted(e, t) {
|
|
102
102
|
e.style.position = "relative", e.style.overflow = "hidden", e.addEventListener("click", function(n) {
|
|
103
103
|
let r = e.getBoundingClientRect(), i = n.clientX - r.left, a = n.clientY - r.top, o = document.createElement("span"), s = Math.max(r.width, r.height), c = s / 2;
|
|
104
|
-
o.style.width = o.style.height = `${s}px`, o.style.left = `${i - c}px`, o.style.top = `${a - c}px`, o.classList.add("ripple"), t.value && typeof t.value == "string" && (o.style.backgroundColor = t.value),
|
|
105
|
-
o.remove();
|
|
106
|
-
}, 600);
|
|
104
|
+
o.style.width = o.style.height = `${s}px`, o.style.left = `${i - c}px`, o.style.top = `${a - c}px`, o.classList.add("ripple"), t.value && typeof t.value == "string" && (o.style.backgroundColor = t.value), o.addEventListener("animationend", () => o.remove(), { once: !0 }), e.appendChild(o);
|
|
107
105
|
});
|
|
108
106
|
} }, j = _({
|
|
109
107
|
isVisible: !1,
|
|
@@ -178,17 +176,23 @@ var P = {
|
|
|
178
176
|
}, I = /* @__PURE__ */ F({
|
|
179
177
|
__name: "GlobalTooltip",
|
|
180
178
|
setup(e) {
|
|
181
|
-
let t = v(null), n = v(0), r = v(0), i = v(0), a = v(!1)
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
179
|
+
let t = v(null), n = v(0), r = v(0), i = v(0), a = v(!1), s = async () => {
|
|
180
|
+
if (!j.isVisible || !t.value || !j.targetRect || (await d(), !t.value || !j.targetRect)) return;
|
|
181
|
+
let e = j.targetRect, o = t.value, s = o.offsetWidth || o.getBoundingClientRect().width, c = o.offsetHeight || o.getBoundingClientRect().height, l = window.innerWidth, u = window.innerHeight, f = e.top, p = u - e.bottom, m = e.top - c - 8;
|
|
182
|
+
a.value = !1, (m < 8 || f < c + 8 && p > f) && (m = e.bottom + 8, a.value = !0), m + c > u - 8 && (m = Math.max(8, u - c - 8)), m < 8 && (m = 8);
|
|
183
|
+
let h = e.left + e.width / 2, g = h - s / 2, _ = Math.max(8, l - s - 8), v = Math.max(8, Math.min(_, g)), y = h - (v + s / 2), b = Math.max(0, s / 2 - 19);
|
|
184
|
+
i.value = Math.max(-b, Math.min(b, y)), n.value = v, r.value = m;
|
|
185
|
+
};
|
|
186
|
+
return w([
|
|
187
|
+
() => j.isVisible,
|
|
188
|
+
() => j.text,
|
|
189
|
+
() => j.targetRect
|
|
190
|
+
], async ([e]) => {
|
|
191
|
+
e && await s();
|
|
192
|
+
}, { deep: !0 }), m(() => {
|
|
193
|
+
window.addEventListener("resize", s, { passive: !0 });
|
|
194
|
+
}), h(() => {
|
|
195
|
+
window.removeEventListener("resize", s);
|
|
192
196
|
}), (e, s) => (g(), o("div", {
|
|
193
197
|
ref_key: "tooltipRef",
|
|
194
198
|
ref: t,
|
|
@@ -206,13 +210,13 @@ var P = {
|
|
|
206
210
|
})
|
|
207
211
|
}, S(C(j).text), 7));
|
|
208
212
|
}
|
|
209
|
-
}, [["__scopeId", "data-v-
|
|
213
|
+
}, [["__scopeId", "data-v-d7961ba4"]]), L = { class: "nano-modal-title" }, R = {
|
|
210
214
|
key: 1,
|
|
211
215
|
class: "nano-modal-body"
|
|
212
216
|
}, z = {
|
|
213
217
|
key: 2,
|
|
214
218
|
class: "nano-modal-footer"
|
|
215
|
-
}, B = { class: "nano-modal-actions" }, V = {
|
|
219
|
+
}, B = { class: "nano-modal-actions" }, V = /* @__PURE__ */ F({
|
|
216
220
|
__name: "NanoModal",
|
|
217
221
|
props: {
|
|
218
222
|
visible: {
|
|
@@ -294,48 +298,48 @@ var P = {
|
|
|
294
298
|
"cancel"
|
|
295
299
|
],
|
|
296
300
|
setup(e, { emit: u }) {
|
|
297
|
-
let m = e, _ = u, y = v(null), C = v(null), k = v(null), A = v(null), j = v(null), M = v(null), N = v(!1), P = v(!1), F = 0, I = 0, V = 0, ee = 0,
|
|
301
|
+
let m = e, _ = u, y = v(null), C = v(null), k = v(null), A = v(null), j = v(null), M = v(null), N = v(!1), P = v(!1), F = 0, I = 0, V = 0, ee = 0, te = 0, ne = 0, re = 0, ie = 0, ae = r(() => {
|
|
298
302
|
let e = {};
|
|
299
303
|
return j.value === null ? (e.maxWidth = typeof m.width == "number" ? `${m.width}px` : m.width, e.width = "100%") : (e.width = `${j.value}px`, e.maxWidth = "none"), M.value === null ? m.height !== "auto" && (e.height = typeof m.height == "number" ? `${m.height}px` : m.height) : (e.height = `${M.value}px`, e.maxHeight = "none"), k.value !== null && A.value !== null && (e.position = "absolute", e.left = `${k.value}px`, e.top = `${A.value}px`, e.transform = "none", e.margin = "0"), e;
|
|
300
|
-
}),
|
|
304
|
+
}), oe = (e) => {
|
|
301
305
|
if (m.draggable && !(e.target.tagName === "BUTTON" || e.target.closest("button"))) {
|
|
302
306
|
if (N.value = !0, F = e.clientX, I = e.clientY, k.value === null) {
|
|
303
307
|
let e = C.value.getBoundingClientRect();
|
|
304
308
|
k.value = e.left, A.value = e.top, j.value === null && (j.value = e.width), M.value === null && (M.value = e.height);
|
|
305
309
|
}
|
|
306
|
-
V = k.value, ee = A.value, window.addEventListener("mousemove",
|
|
310
|
+
V = k.value, ee = A.value, window.addEventListener("mousemove", se), window.addEventListener("mouseup", ce);
|
|
307
311
|
}
|
|
308
|
-
},
|
|
312
|
+
}, se = (e) => {
|
|
309
313
|
if (!N.value) return;
|
|
310
314
|
let t = V + (e.clientX - F), n = ee + (e.clientY - I), r = window.innerWidth, i = window.innerHeight, a = C.value.getBoundingClientRect();
|
|
311
315
|
t < 0 && (t = 0), n < 0 && (n = 0), t + a.width > r && (t = r - a.width), n + a.height > i && (n = i - a.height), k.value = t, A.value = n;
|
|
312
|
-
},
|
|
313
|
-
N.value = !1, window.removeEventListener("mousemove",
|
|
314
|
-
},
|
|
316
|
+
}, ce = () => {
|
|
317
|
+
N.value = !1, window.removeEventListener("mousemove", se), window.removeEventListener("mouseup", ce);
|
|
318
|
+
}, le = (e) => {
|
|
315
319
|
if (!m.resizable) return;
|
|
316
|
-
e.preventDefault(), e.stopPropagation(), P.value = !0,
|
|
320
|
+
e.preventDefault(), e.stopPropagation(), P.value = !0, te = e.clientX, ne = e.clientY;
|
|
317
321
|
let t = C.value.getBoundingClientRect();
|
|
318
|
-
k.value === null && (k.value = t.left, A.value = t.top),
|
|
319
|
-
},
|
|
322
|
+
k.value === null && (k.value = t.left, A.value = t.top), re = t.width, ie = t.height, window.addEventListener("mousemove", ue), window.addEventListener("mouseup", de);
|
|
323
|
+
}, ue = (e) => {
|
|
320
324
|
if (!P.value) return;
|
|
321
|
-
let t =
|
|
325
|
+
let t = re + (e.clientX - te), n = ie + (e.clientY - ne);
|
|
322
326
|
t < m.minWidth && (t = m.minWidth), n < m.minHeight && (n = m.minHeight);
|
|
323
327
|
let r = window.innerWidth - k.value, i = window.innerHeight - A.value;
|
|
324
328
|
t > r && (t = r), n > i && (n = i), j.value = t, M.value = n;
|
|
325
|
-
},
|
|
326
|
-
P.value = !1, window.removeEventListener("mousemove",
|
|
327
|
-
},
|
|
328
|
-
m.visible && e.key === "Escape" && (e.preventDefault(), e.stopPropagation(),
|
|
329
|
+
}, de = () => {
|
|
330
|
+
P.value = !1, window.removeEventListener("mousemove", ue), window.removeEventListener("mouseup", de);
|
|
331
|
+
}, fe = (e) => {
|
|
332
|
+
m.visible && e.key === "Escape" && (e.preventDefault(), e.stopPropagation(), pe());
|
|
329
333
|
};
|
|
330
334
|
w(() => m.visible, async (e) => {
|
|
331
|
-
e ? (k.value = null, A.value = null, j.value = null, M.value = null, document.body.style.overflow = "hidden", window.addEventListener("keydown",
|
|
335
|
+
e ? (k.value = null, A.value = null, j.value = null, M.value = null, document.body.style.overflow = "hidden", window.addEventListener("keydown", fe, { capture: !0 }), await d(), y.value && y.value.focus()) : (document.body.style.overflow = "", window.removeEventListener("keydown", fe, { capture: !0 }), ce(), de());
|
|
332
336
|
}), h(() => {
|
|
333
|
-
document.body.style.overflow = "", window.removeEventListener("keydown",
|
|
337
|
+
document.body.style.overflow = "", window.removeEventListener("keydown", fe, { capture: !0 }), ce(), de();
|
|
334
338
|
});
|
|
335
|
-
let
|
|
336
|
-
m.closeOnBackdrop &&
|
|
337
|
-
},
|
|
338
|
-
_("cancel"),
|
|
339
|
+
let pe = () => _("close"), me = () => {
|
|
340
|
+
m.closeOnBackdrop && pe();
|
|
341
|
+
}, he = () => _("ok"), ge = () => {
|
|
342
|
+
_("cancel"), pe();
|
|
339
343
|
};
|
|
340
344
|
return (r, u) => {
|
|
341
345
|
let d = x("ripple");
|
|
@@ -343,7 +347,7 @@ var P = {
|
|
|
343
347
|
default: T(() => [e.visible ? (g(), o("div", {
|
|
344
348
|
key: 0,
|
|
345
349
|
class: f(["nano-modal-overlay", { "nano-glass": e.glassmorphism }]),
|
|
346
|
-
onClick: O(
|
|
350
|
+
onClick: O(me, ["self"]),
|
|
347
351
|
onKeydown: u[1] ||= D(O((...e) => r.handleEsc && r.handleEsc(...e), ["stop"]), ["esc"]),
|
|
348
352
|
tabindex: "-1",
|
|
349
353
|
ref_key: "modalOverlay",
|
|
@@ -353,17 +357,17 @@ var P = {
|
|
|
353
357
|
"is-dragging": N.value,
|
|
354
358
|
"is-resizing": P.value
|
|
355
359
|
}]),
|
|
356
|
-
style: p(
|
|
360
|
+
style: p(ae.value),
|
|
357
361
|
ref_key: "modalWindow",
|
|
358
362
|
ref: C
|
|
359
363
|
}, [
|
|
360
364
|
e.showHeader ? (g(), o("div", {
|
|
361
365
|
key: 0,
|
|
362
366
|
class: f(["nano-modal-header", { "is-draggable": e.draggable }]),
|
|
363
|
-
onMousedown:
|
|
364
|
-
}, [b(r.$slots, "header", {}, () => [s("h2", L, S(e.title), 1)]), s("button", {
|
|
367
|
+
onMousedown: oe
|
|
368
|
+
}, [b(r.$slots, "header", {}, () => [s("h2", L, S(e.title), 1)], !0), s("button", {
|
|
365
369
|
class: "nano-modal-close-btn",
|
|
366
|
-
onClick: O(
|
|
370
|
+
onClick: O(pe, ["stop"]),
|
|
367
371
|
"aria-label": "Close",
|
|
368
372
|
onMousedown: u[0] ||= O(() => {}, ["stop"])
|
|
369
373
|
}, [...u[2] ||= [s("svg", {
|
|
@@ -387,20 +391,20 @@ var P = {
|
|
|
387
391
|
x2: "18",
|
|
388
392
|
y2: "18"
|
|
389
393
|
})], -1)]], 32)], 34)) : a("", !0),
|
|
390
|
-
e.showBody ? (g(), o("div", R, [b(r.$slots, "body")])) : a("", !0),
|
|
394
|
+
e.showBody ? (g(), o("div", R, [b(r.$slots, "body", {}, void 0, !0)])) : a("", !0),
|
|
391
395
|
e.showFooter ? (g(), o("div", z, [b(r.$slots, "footer", {}, () => [s("div", B, [e.showCancel ? E((g(), o("button", {
|
|
392
396
|
key: 0,
|
|
393
397
|
class: "nano-btn nano-btn-secondary",
|
|
394
|
-
onClick:
|
|
398
|
+
onClick: ge
|
|
395
399
|
}, [c(S(e.cancelText), 1)])), [[d]]) : a("", !0), e.showOk ? E((g(), o("button", {
|
|
396
400
|
key: 1,
|
|
397
401
|
class: f(["nano-btn", "nano-btn-" + e.okVariant]),
|
|
398
|
-
onClick:
|
|
399
|
-
}, [c(S(e.okText), 1)], 2)), [[d]]) : a("", !0)])])])) : a("", !0),
|
|
402
|
+
onClick: he
|
|
403
|
+
}, [c(S(e.okText), 1)], 2)), [[d]]) : a("", !0)])], !0)])) : a("", !0),
|
|
400
404
|
e.resizable ? (g(), o("div", {
|
|
401
405
|
key: 3,
|
|
402
406
|
class: "nano-modal-resizer",
|
|
403
|
-
onMousedown:
|
|
407
|
+
onMousedown: le
|
|
404
408
|
}, [...u[3] ||= [s("svg", {
|
|
405
409
|
width: "10",
|
|
406
410
|
height: "10",
|
|
@@ -419,21 +423,21 @@ var P = {
|
|
|
419
423
|
})]);
|
|
420
424
|
};
|
|
421
425
|
}
|
|
422
|
-
}, ee = ["viewBox"],
|
|
426
|
+
}, [["__scopeId", "data-v-52e94a15"]]), ee = ["viewBox"], te = { key: 0 }, ne = [
|
|
423
427
|
"id",
|
|
424
428
|
"x1",
|
|
425
429
|
"y1",
|
|
426
430
|
"x2",
|
|
427
431
|
"y2"
|
|
428
|
-
],
|
|
432
|
+
], re = ["stop-color"], ie = ["stop-color"], ae = [
|
|
429
433
|
"id",
|
|
430
434
|
"y1",
|
|
431
435
|
"y2"
|
|
432
|
-
],
|
|
436
|
+
], oe = ["stop-color"], se = ["stop-color"], ce = [
|
|
433
437
|
"id",
|
|
434
438
|
"y1",
|
|
435
439
|
"y2"
|
|
436
|
-
],
|
|
440
|
+
], le = ["stop-color"], ue = ["stop-color"], de = { key: 1 }, fe = ["x", "y"], pe = { key: 2 }, me = ["d", "fill"], he = ["d", "stroke"], ge = ["d", "fill"], _e = ["d", "fill"], ve = ["d", "fill"], ye = ["d", "stroke"], be = ["d", "fill"], xe = ["d", "stroke"], Se = ["d", "stroke-width"], Ce = ["transform"], we = ["font-size"], Te = ["font-size"], Ee = ["d", "fill"], De = ["d", "stroke"], Oe = ["d", "fill"], ke = ["d", "fill"], Ae = ["d", "fill"], je = ["d", "stroke"], Me = ["d", "fill"], Ne = ["d", "stroke"], Pe = ["d", "stroke-width"], Fe = ["onMouseenter", "onClick"], Ie = ["d"], Le = ["d"], Re = ["onMouseenter", "onClick"], ze = ["d", "stroke"], Be = ["y", "fill"], Ve = ["onMouseenter", "onClick"], He = ["d", "stroke"], Ue = ["y", "fill"], We = /* @__PURE__ */ F({
|
|
437
441
|
__name: "ThreeDDonutChart",
|
|
438
442
|
props: {
|
|
439
443
|
data: {
|
|
@@ -631,14 +635,14 @@ var P = {
|
|
|
631
635
|
percentage: n
|
|
632
636
|
};
|
|
633
637
|
});
|
|
634
|
-
}), V = r(() => A.value.reduce((e, t) => e + t.value, 0)),
|
|
638
|
+
}), V = r(() => A.value.reduce((e, t) => e + t.value, 0)), We = r(() => {
|
|
635
639
|
if (c.centerValue !== void 0 && c.centerValue !== "") return c.centerValue;
|
|
636
|
-
let e =
|
|
640
|
+
let e = X.value.find((e) => e.item.id === C.value);
|
|
637
641
|
return e ? c.centerValueFormatter ? c.centerValueFormatter(e.item.value, e.item) : L(e.item.value) : c.centerValueFormatter ? c.centerValueFormatter(V.value, null) : c.valueDecimals === void 0 ? Math.round(V.value) : L(V.value);
|
|
638
|
-
}),
|
|
639
|
-
let e =
|
|
642
|
+
}), Ge = r(() => {
|
|
643
|
+
let e = X.value.find((e) => e.item.id === C.value);
|
|
640
644
|
return e ? R(e.item.name, 12).toUpperCase() : (c.centerLabel || "").toUpperCase();
|
|
641
|
-
}),
|
|
645
|
+
}), Ke = (e, t = !1) => {
|
|
642
646
|
let n = new Map(A.value.map((e) => [e.id, e])), r = new Map(e.map((e) => [e.id, e])), i = [];
|
|
643
647
|
e.forEach((e) => {
|
|
644
648
|
let r = n.get(e.id);
|
|
@@ -679,7 +683,7 @@ var P = {
|
|
|
679
683
|
unit: e.unit
|
|
680
684
|
});
|
|
681
685
|
}), A.value = i, t && (A.value = A.value.filter((e) => e.targetValue > 0));
|
|
682
|
-
},
|
|
686
|
+
}, qe = (e, t = -90) => {
|
|
683
687
|
if (!e || e.length === 0) return t;
|
|
684
688
|
let n = e.reduce((e, t) => e + (t.value || 0), 0);
|
|
685
689
|
if (n === 0) return t;
|
|
@@ -697,22 +701,22 @@ var P = {
|
|
|
697
701
|
l < o ? (o = l, a = e, s = u) : l === o && u < s && (a = e, s = u);
|
|
698
702
|
}
|
|
699
703
|
return a;
|
|
700
|
-
},
|
|
701
|
-
let e = (
|
|
704
|
+
}, Je = r(() => c.autoRotate && B.value && B.value.length > 0 ? qe(B.value, c.rotationAngle) : c.rotationAngle), Ye = v(Je.value), Xe = v(!1), Ze = v(!1), Qe = null, $e = c.is3D, H = v(c.isExpanded ? 380 : 60), U = v(c.isExpanded ? 160 : 60), W = v(c.isExpanded ? 180 : 48), G = v(c.isExpanded ? $e ? 180 * c.slopeRatio : 180 : $e ? 48 * c.slopeRatio : 48), K = v(c.isExpanded ? 180 * (1 - c.thickness) : 48 * (1 - c.thickness)), q = v(c.isExpanded ? $e ? 180 * (1 - c.thickness) * c.slopeRatio : 180 * (1 - c.thickness) : $e ? 48 * (1 - c.thickness) * c.slopeRatio : 48 * (1 - c.thickness)), et = c.isExpanded && $e ? 32 : 0, J = v($e && c.slopeRatio > .5 ? et * (2 - 2 * c.slopeRatio) : et), tt = v(c.isExpanded ? 760 : 120), nt = v(c.isExpanded ? 320 : 120), Y = v(c.isExpanded && c.showLabels ? 1 : 0), rt = r(() => {
|
|
705
|
+
let e = (W.value - 48) / 132;
|
|
702
706
|
return 13 + 6 * Math.max(0, Math.min(1, e));
|
|
703
|
-
}),
|
|
704
|
-
let e = (
|
|
707
|
+
}), it = r(() => {
|
|
708
|
+
let e = (W.value - 48) / 132;
|
|
705
709
|
return 7 + 1.5 * Math.max(0, Math.min(1, e));
|
|
706
|
-
}),
|
|
710
|
+
}), at = r(() => U.value - J.value / 2), X = r(() => {
|
|
707
711
|
let e = A.value, t = V.value;
|
|
708
712
|
if (t === 0) return [];
|
|
709
|
-
let n = [], r =
|
|
710
|
-
|
|
711
|
-
let a =
|
|
713
|
+
let n = [], r = Ye.value * Math.PI / 180, i = H.value;
|
|
714
|
+
U.value;
|
|
715
|
+
let a = W.value, o = G.value, s = K.value, l = q.value, u = J.value, d = at.value, f = e.filter((e) => e.value > .001);
|
|
712
716
|
if (f.length === 1) {
|
|
713
717
|
let t = f[0], n = e.indexOf(t), r = F(t, n), p = `M ${i - a} ${d} A ${a} ${o} 0 0 1 ${i + a} ${d} A ${a} ${o} 0 0 1 ${i - a} ${d} M ${i - s} ${d} A ${s} ${l} 0 0 0 ${i + s} ${d} A ${s} ${l} 0 0 0 ${i - s} ${d} Z`, m = "", h = "";
|
|
714
718
|
u > 0 && (m = `M ${i + a} ${d} A ${a} ${o} 0 0 1 ${i - a} ${d} L ${i - a} ${d + u} A ${a} ${o} 0 0 0 ${i + a} ${d + u} Z`, h = `M ${i - s} ${d} A ${s} ${l} 0 0 1 ${i + s} ${d} L ${i + s} ${d + u} A ${s} ${l} 0 0 0 ${i - s} ${d + u} Z`);
|
|
715
|
-
let g = `M ${i - a} ${d} A ${a} ${o} 0 0 1 ${i + a} ${d} L ${i + s} ${d} A ${s} ${l} 0 0 0 ${i - s} ${d} Z`, _ = `M ${i - a} ${d} A ${a} ${o} 0 0 1 ${i + a} ${d} M ${i + s} ${d} A ${s} ${l} 0 0 0 ${i - s} ${d}`, v = h, y = `M ${i + a} ${d} A ${a} ${o} 0 0 1 ${i - a} ${d} L ${i - s} ${d} A ${s} ${l} 0 0 0 ${i + s} ${d} Z`, b = `M ${i + a} ${d} A ${a} ${o} 0 0 1 ${i - a} ${d} M ${i - s} ${d} A ${s} ${l} 0 0 0 ${i + s} ${d}`, x = m, S =
|
|
719
|
+
let g = `M ${i - a} ${d} A ${a} ${o} 0 0 1 ${i + a} ${d} L ${i + s} ${d} A ${s} ${l} 0 0 0 ${i - s} ${d} Z`, _ = `M ${i - a} ${d} A ${a} ${o} 0 0 1 ${i + a} ${d} M ${i + s} ${d} A ${s} ${l} 0 0 0 ${i - s} ${d}`, v = h, y = `M ${i + a} ${d} A ${a} ${o} 0 0 1 ${i - a} ${d} L ${i - s} ${d} A ${s} ${l} 0 0 0 ${i + s} ${d} Z`, b = `M ${i + a} ${d} A ${a} ${o} 0 0 1 ${i - a} ${d} M ${i - s} ${d} A ${s} ${l} 0 0 0 ${i + s} ${d}`, x = m, S = Ye.value * Math.PI / 180 + Math.PI, C = i + a * Math.cos(S), w = d + o * Math.sin(S), T = i + (a + 25) * Math.cos(S), E = d + (o + 35 * c.slopeRatio) * Math.sin(S), D = i + (a + s) / 2 * Math.cos(S), O = d + (o + l) / 2 * Math.sin(S), k = a - s, A = o - l;
|
|
716
720
|
return [{
|
|
717
721
|
item: t,
|
|
718
722
|
index: n,
|
|
@@ -806,7 +810,7 @@ var P = {
|
|
|
806
810
|
M ? (P = `M ${h} ${v} A ${a} ${o} 0 ${T} 1 ${y} ${b} M ${x} ${S} A ${s} ${l} 0 ${T} 0 ${C} ${w}`, N || (P += ` L ${h} ${v}`)) : (P = `M ${h} ${v} A ${a} ${o} 0 ${T} 1 ${y} ${b} L ${x} ${S} A ${s} ${l} 0 ${T} 0 ${C} ${w}`, N || (P += " Z"));
|
|
807
811
|
let F = "", I = "", L = "", R = "", z = "", B = "";
|
|
808
812
|
u > 0 && (F = `M ${h} ${v} A ${a} ${o} 0 ${T} 1 ${y} ${b} L ${y} ${b + u} A ${a} ${o} 0 ${T} 0 ${h} ${v + u} Z`, I = `M ${C} ${w} A ${s} ${l} 0 ${T} 1 ${x} ${S} L ${x} ${S + u} A ${s} ${l} 0 ${T} 0 ${C} ${w + u} Z`, M ? (L = `M ${h} ${v} A ${a} ${o} 0 ${T} 1 ${y} ${b} M ${y} ${b + u} A ${a} ${o} 0 ${T} 0 ${h} ${v + u}`, N || (L += ` L ${h} ${v}`)) : (L = `M ${h} ${v} A ${a} ${o} 0 ${T} 1 ${y} ${b} L ${y} ${b + u} A ${a} ${o} 0 ${T} 0 ${h} ${v + u}`, N || (L += " Z")), M ? (R = `M ${C} ${w} A ${s} ${l} 0 ${T} 1 ${x} ${S} M ${x} ${S + u} A ${s} ${l} 0 ${T} 0 ${C} ${w + u}`, N || (R += ` L ${C} ${w}`)) : (R = `M ${C} ${w} A ${s} ${l} 0 ${T} 1 ${x} ${S} L ${x} ${S + u} A ${s} ${l} 0 ${T} 0 ${C} ${w + u}`, N || (R += " Z")), Math.abs(r - A) < .001 && (z = `M ${h} ${v} L ${C} ${w} L ${C} ${w + u} L ${h} ${v + u} Z`), Math.abs(p - j) < .001 && (B = `M ${y} ${b} L ${x} ${S} L ${x} ${S + u} L ${y} ${b + u} Z`));
|
|
809
|
-
let V = d + o * Math.sin(m), ee = i + a * Math.cos(g),
|
|
813
|
+
let V = d + o * Math.sin(m), ee = i + a * Math.cos(g), te = d + o * Math.sin(g), ne = i + (a + 25) * Math.cos(g), re = d + (o + 35 * c.slopeRatio) * Math.sin(g), ie = i + (a + s) / 2 * Math.cos(g), ae = d + (o + l) / 2 * Math.sin(g), oe = a - s, se = o - l;
|
|
810
814
|
n.push({
|
|
811
815
|
item: e,
|
|
812
816
|
index: f,
|
|
@@ -826,31 +830,31 @@ var P = {
|
|
|
826
830
|
startCutPath: z,
|
|
827
831
|
endCutPath: B,
|
|
828
832
|
x0: ee,
|
|
829
|
-
y0:
|
|
830
|
-
x1:
|
|
831
|
-
y1:
|
|
832
|
-
topGradX1:
|
|
833
|
-
topGradY1:
|
|
834
|
-
topGradX2:
|
|
835
|
-
topGradY2:
|
|
836
|
-
wallY1:
|
|
837
|
-
wallY2:
|
|
833
|
+
y0: te,
|
|
834
|
+
x1: ne,
|
|
835
|
+
y1: re,
|
|
836
|
+
topGradX1: ie - oe / 2,
|
|
837
|
+
topGradY1: ae - se / 2,
|
|
838
|
+
topGradX2: ie + oe / 2,
|
|
839
|
+
topGradY2: ae + se / 2,
|
|
840
|
+
wallY1: te,
|
|
841
|
+
wallY2: te + u
|
|
838
842
|
});
|
|
839
843
|
}), r += p;
|
|
840
844
|
}), n.sort((e, t) => e.midY - t.midY);
|
|
841
|
-
}),
|
|
845
|
+
}), ot = r(() => {
|
|
842
846
|
let e = /* @__PURE__ */ new Set(), t = [];
|
|
843
|
-
return
|
|
847
|
+
return X.value.forEach((n) => {
|
|
844
848
|
e.has(n.item.id) || (e.add(n.item.id), t.push(n));
|
|
845
849
|
}), t;
|
|
846
|
-
}),
|
|
847
|
-
if (
|
|
850
|
+
}), st = (e) => C.value === e.item.id ? { transform: `translate(${10 * Math.cos(e.originalMidAngle)}px, ${10 * Math.sin(e.originalMidAngle)}px)` } : {}, ct = r(() => {
|
|
851
|
+
if (Y.value <= .001) return {
|
|
848
852
|
left: [],
|
|
849
853
|
right: []
|
|
850
854
|
};
|
|
851
855
|
let e = [], t = [];
|
|
852
|
-
return
|
|
853
|
-
let r = Math.cos(n.originalMidAngle) < 0, i = Math.sin(n.originalMidAngle) > 0, a =
|
|
856
|
+
return ot.value.forEach((n) => {
|
|
857
|
+
let r = Math.cos(n.originalMidAngle) < 0, i = Math.sin(n.originalMidAngle) > 0, a = J.value, o = n.y0 + (i ? a : 0), s = n.y1 + (i ? a : 0), c = {
|
|
854
858
|
item: n.item,
|
|
855
859
|
index: n.index,
|
|
856
860
|
color: n.color,
|
|
@@ -868,40 +872,40 @@ var P = {
|
|
|
868
872
|
left: e,
|
|
869
873
|
right: t
|
|
870
874
|
};
|
|
871
|
-
}),
|
|
875
|
+
}), lt = r(() => ct.value.left), ut = r(() => ct.value.right), dt = (e) => {
|
|
872
876
|
let t = C.value === e.item.id, n = e.x0, r = e.y0, i = e.finalY;
|
|
873
877
|
if (t) {
|
|
874
878
|
let t = 10 * Math.cos(e.originalMidAngle || 0), a = 10 * Math.sin(e.originalMidAngle || 0);
|
|
875
879
|
n += t, r += a, i -= 5;
|
|
876
880
|
}
|
|
877
|
-
let a = n + 30 * Math.cos(e.originalMidAngle || 0), o = r + 30 * Math.sin(e.originalMidAngle || 0), s = e.isLeft, c = Math.sin(e.originalMidAngle || 0) < 0, l =
|
|
881
|
+
let a = n + 30 * Math.cos(e.originalMidAngle || 0), o = r + 30 * Math.sin(e.originalMidAngle || 0), s = e.isLeft, c = Math.sin(e.originalMidAngle || 0) < 0, l = H.value, u = W.value, d = s ? l - u - 15 : l + u + 15, f = s ? Math.min(d, a - 30) : Math.max(d, a + 30);
|
|
878
882
|
return `M ${n} ${r} C ${a} ${o}, ${f} ${c ? Math.min(o, i) : Math.max(o, i)}, ${s ? 90 : 670} ${i}`;
|
|
879
|
-
},
|
|
883
|
+
}, ft = (e = 450) => {
|
|
880
884
|
if (c.currentLowFxMode || c.immediate) {
|
|
881
885
|
A.value.forEach((e) => {
|
|
882
886
|
e.value = e.targetValue, e.percentage = e.targetPercentage === void 0 ? 0 : e.targetPercentage;
|
|
883
|
-
}), A.value = A.value.filter((e) => e.targetValue > 0),
|
|
887
|
+
}), A.value = A.value.filter((e) => e.targetValue > 0), Ye.value = Je.value;
|
|
884
888
|
let e = c.is3D;
|
|
885
|
-
|
|
889
|
+
H.value = c.isExpanded ? 380 : 60, U.value = c.isExpanded ? 160 : 60, W.value = c.isExpanded ? 180 : 48, G.value = c.isExpanded ? e ? 180 * c.slopeRatio : 180 : e ? 48 * c.slopeRatio : 48, K.value = c.isExpanded ? 180 * (1 - c.thickness) : 48 * (1 - c.thickness), q.value = c.isExpanded ? e ? 180 * (1 - c.thickness) * c.slopeRatio : 180 * (1 - c.thickness) : e ? 48 * (1 - c.thickness) * c.slopeRatio : 48 * (1 - c.thickness);
|
|
886
890
|
let t = c.isExpanded && e ? 32 : 0;
|
|
887
|
-
|
|
891
|
+
J.value = e && c.slopeRatio > .5 ? t * (2 - 2 * c.slopeRatio) : t, tt.value = c.isExpanded ? 760 : 120, nt.value = c.isExpanded ? 320 : 120, Y.value = c.isExpanded && c.showLabels ? 1 : 0, Xe.value = !1;
|
|
888
892
|
return;
|
|
889
893
|
}
|
|
890
|
-
u && cancelAnimationFrame(u),
|
|
891
|
-
let t = performance.now(), n =
|
|
894
|
+
u && cancelAnimationFrame(u), Xe.value = !0;
|
|
895
|
+
let t = performance.now(), n = Ye.value, r = Je.value, i = H.value, a = U.value, o = W.value, s = G.value, l = K.value, d = q.value, f = J.value, p = tt.value, m = nt.value, h = Y.value, g = c.is3D, _ = c.isExpanded ? 380 : 60, v = c.isExpanded ? 160 : 60, y = c.isExpanded ? 180 : 48, b = c.isExpanded ? g ? 180 * c.slopeRatio : 180 : g ? 48 * c.slopeRatio : 48, x = c.isExpanded ? 180 * (1 - c.thickness) : 48 * (1 - c.thickness), S = c.isExpanded ? g ? 180 * (1 - c.thickness) * c.slopeRatio : 180 * (1 - c.thickness) : g ? 48 * (1 - c.thickness) * c.slopeRatio : 48 * (1 - c.thickness), C = c.isExpanded && g ? 32 : 0, w = g && c.slopeRatio > .5 ? C * (2 - 2 * c.slopeRatio) : C, T = c.isExpanded ? 760 : 120, E = c.isExpanded ? 320 : 120, D = c.isExpanded && c.showLabels ? 1 : 0, O = (c) => {
|
|
892
896
|
let g = c - t, C = Math.min(1, g / e), k = 1 - (1 - C) ** 3;
|
|
893
897
|
A.value.forEach((e) => {
|
|
894
898
|
e.value = e.startValue + (e.targetValue - e.startValue) * k;
|
|
895
899
|
let t = e.startPercentage === void 0 ? 0 : e.startPercentage, n = e.targetPercentage === void 0 ? 0 : e.targetPercentage;
|
|
896
900
|
e.percentage = Math.round(t + (n - t) * k);
|
|
897
|
-
}),
|
|
901
|
+
}), Ye.value = n + (r - n) * k, H.value = i + (_ - i) * k, U.value = a + (v - a) * k, W.value = o + (y - o) * k, G.value = s + (b - s) * k, K.value = l + (x - l) * k, q.value = d + (S - d) * k, J.value = f + (w - f) * k, tt.value = p + (T - p) * k, nt.value = m + (E - m) * k, Y.value = h + (D - h) * k, C < 1 ? u = requestAnimationFrame(O) : (u = null, A.value.forEach((e) => {
|
|
898
902
|
e.value = e.targetValue, e.percentage = e.targetPercentage === void 0 ? 0 : e.targetPercentage;
|
|
899
|
-
}), A.value = A.value.filter((e) => e.targetValue > 0),
|
|
903
|
+
}), A.value = A.value.filter((e) => e.targetValue > 0), H.value = _, U.value = v, W.value = y, G.value = b, K.value = x, q.value = S, J.value = w, tt.value = T, nt.value = E, Y.value = D, Xe.value = !1);
|
|
900
904
|
};
|
|
901
905
|
u = requestAnimationFrame(O);
|
|
902
|
-
},
|
|
906
|
+
}, pt = (e) => {
|
|
903
907
|
if (e.isSingleSlice) return !0;
|
|
904
|
-
let t =
|
|
908
|
+
let t = X.value, n = -1;
|
|
905
909
|
for (let r = t.length - 1; r >= 0; r--) if (t[r].item.id === e.item.id) {
|
|
906
910
|
n = r;
|
|
907
911
|
break;
|
|
@@ -910,46 +914,46 @@ var P = {
|
|
|
910
914
|
};
|
|
911
915
|
return w(B, (e) => {
|
|
912
916
|
let t = c.immediate || c.currentLowFxMode;
|
|
913
|
-
|
|
917
|
+
Ke(e || [], t), t || ft();
|
|
914
918
|
}, {
|
|
915
919
|
deep: !0,
|
|
916
920
|
immediate: !0
|
|
917
921
|
}), w(() => c.rotationAngle, () => {
|
|
918
|
-
|
|
919
|
-
|
|
922
|
+
Ze.value = !0, Qe && clearTimeout(Qe), Qe = setTimeout(() => {
|
|
923
|
+
Ze.value = !1;
|
|
920
924
|
}, 100);
|
|
921
|
-
}), w(
|
|
922
|
-
c.immediate || c.currentLowFxMode ?
|
|
925
|
+
}), w(Je, (e) => {
|
|
926
|
+
c.immediate || c.currentLowFxMode ? Ye.value = e : ft();
|
|
923
927
|
}), w(() => c.isExpanded, () => {
|
|
924
928
|
d(() => {
|
|
925
|
-
|
|
929
|
+
ft();
|
|
926
930
|
});
|
|
927
931
|
}), w(() => c.is3D, () => {
|
|
928
932
|
d(() => {
|
|
929
|
-
|
|
933
|
+
ft();
|
|
930
934
|
});
|
|
931
935
|
}), w(() => c.showLabels, () => {
|
|
932
936
|
d(() => {
|
|
933
|
-
|
|
937
|
+
ft();
|
|
934
938
|
});
|
|
935
939
|
}), w(() => c.slopeRatio, (e) => {
|
|
936
940
|
if (c.is3D) {
|
|
937
|
-
|
|
941
|
+
G.value = c.isExpanded ? 180 * e : 48;
|
|
938
942
|
let t = c.isExpanded ? 180 : 48, n = c.isExpanded ? 180 * e : 48;
|
|
939
|
-
|
|
943
|
+
K.value = t * (1 - c.thickness), q.value = n * (1 - c.thickness);
|
|
940
944
|
let r = c.isExpanded ? 32 : 0;
|
|
941
|
-
|
|
945
|
+
J.value = e > .5 ? r * (2 - 2 * e) : r;
|
|
942
946
|
}
|
|
943
947
|
}), w(() => c.thickness, (e) => {
|
|
944
948
|
let t = c.is3D, n = c.isExpanded ? 180 : 48, r = c.isExpanded ? t ? 180 * c.slopeRatio : 180 : t ? 48 * c.slopeRatio : 48;
|
|
945
|
-
|
|
949
|
+
K.value = n * (1 - e), q.value = r * (1 - e);
|
|
946
950
|
}), w(() => c.hoveredItemId, (e) => {
|
|
947
951
|
_.value !== e && (_.value = e);
|
|
948
952
|
}), w(_, (e) => {
|
|
949
953
|
c.hoveredItemId !== e && l("update:hoveredItemId", e);
|
|
950
954
|
}), m(() => {
|
|
951
955
|
document.addEventListener("click", k), d(() => {
|
|
952
|
-
|
|
956
|
+
ft();
|
|
953
957
|
});
|
|
954
958
|
}), h(() => {
|
|
955
959
|
document.removeEventListener("click", k), u && cancelAnimationFrame(u);
|
|
@@ -962,14 +966,14 @@ var P = {
|
|
|
962
966
|
ref: O,
|
|
963
967
|
class: f(["donut-canvas-wrapper", {
|
|
964
968
|
"is-expanded": t.isExpanded,
|
|
965
|
-
"no-transitions":
|
|
969
|
+
"no-transitions": Xe.value || Ze.value || t.immediate
|
|
966
970
|
}])
|
|
967
971
|
}, [(g(), o("svg", {
|
|
968
|
-
viewBox: `0 0 ${
|
|
972
|
+
viewBox: `0 0 ${tt.value} ${nt.value}`,
|
|
969
973
|
class: "items-svg-chart",
|
|
970
974
|
xmlns: "http://www.w3.org/2000/svg"
|
|
971
|
-
}, [B.value && B.value.length > 0 ? (g(), o("defs",
|
|
972
|
-
(g(!0), o(e, null, y(
|
|
975
|
+
}, [B.value && B.value.length > 0 ? (g(), o("defs", te, [
|
|
976
|
+
(g(!0), o(e, null, y(ot.value, (e) => (g(), o("linearGradient", {
|
|
973
977
|
key: "top-grad-" + z(e.item.id),
|
|
974
978
|
id: "top-grad-" + z(e.item.id),
|
|
975
979
|
gradientUnits: "userSpaceOnUse",
|
|
@@ -980,11 +984,11 @@ var P = {
|
|
|
980
984
|
}, [s("stop", {
|
|
981
985
|
offset: "0%",
|
|
982
986
|
"stop-color": P(e.color, 1.15)
|
|
983
|
-
}, null, 8,
|
|
987
|
+
}, null, 8, re), s("stop", {
|
|
984
988
|
offset: "100%",
|
|
985
989
|
"stop-color": N(e.color, .85)
|
|
986
|
-
}, null, 8,
|
|
987
|
-
(g(!0), o(e, null, y(
|
|
990
|
+
}, null, 8, ie)], 8, ne))), 128)),
|
|
991
|
+
(g(!0), o(e, null, y(ot.value, (e) => (g(), o("linearGradient", {
|
|
988
992
|
key: "outer-grad-" + z(e.item.id),
|
|
989
993
|
id: "outer-grad-" + z(e.item.id),
|
|
990
994
|
gradientUnits: "userSpaceOnUse",
|
|
@@ -995,11 +999,11 @@ var P = {
|
|
|
995
999
|
}, [s("stop", {
|
|
996
1000
|
offset: "0%",
|
|
997
1001
|
"stop-color": N(e.color, .75)
|
|
998
|
-
}, null, 8,
|
|
1002
|
+
}, null, 8, oe), s("stop", {
|
|
999
1003
|
offset: "100%",
|
|
1000
1004
|
"stop-color": N(e.color, .5)
|
|
1001
|
-
}, null, 8,
|
|
1002
|
-
(g(!0), o(e, null, y(
|
|
1005
|
+
}, null, 8, se)], 8, ae))), 128)),
|
|
1006
|
+
(g(!0), o(e, null, y(ot.value, (e) => (g(), o("linearGradient", {
|
|
1003
1007
|
key: "inner-grad-" + z(e.item.id),
|
|
1004
1008
|
id: "inner-grad-" + z(e.item.id),
|
|
1005
1009
|
gradientUnits: "userSpaceOnUse",
|
|
@@ -1010,11 +1014,11 @@ var P = {
|
|
|
1010
1014
|
}, [s("stop", {
|
|
1011
1015
|
offset: "0%",
|
|
1012
1016
|
"stop-color": N(e.color, .6)
|
|
1013
|
-
}, null, 8,
|
|
1017
|
+
}, null, 8, le), s("stop", {
|
|
1014
1018
|
offset: "100%",
|
|
1015
1019
|
"stop-color": N(e.color, .4)
|
|
1016
|
-
}, null, 8,
|
|
1017
|
-
])) : a("", !0), !B.value || B.value.length === 0 ? (g(), o("g",
|
|
1020
|
+
}, null, 8, ue)], 8, ce))), 128))
|
|
1021
|
+
])) : a("", !0), !B.value || B.value.length === 0 ? (g(), o("g", de, [s("text", {
|
|
1018
1022
|
x: t.isExpanded ? 380 : 60,
|
|
1019
1023
|
y: t.isExpanded ? 160 : 60,
|
|
1020
1024
|
fill: "#64748b",
|
|
@@ -1022,20 +1026,20 @@ var P = {
|
|
|
1022
1026
|
"font-family": "system-ui, -apple-system, sans-serif",
|
|
1023
1027
|
"text-anchor": "middle",
|
|
1024
1028
|
"dominant-baseline": "middle"
|
|
1025
|
-
}, S(t.emptyText || "No data"), 9,
|
|
1026
|
-
(g(!0), o(e, null, y(
|
|
1029
|
+
}, S(t.emptyText || "No data"), 9, fe)])) : (g(), o("g", pe, [
|
|
1030
|
+
(g(!0), o(e, null, y(X.value.filter((e) => e.midY < at.value), (e) => (g(), o("g", {
|
|
1027
1031
|
key: "slice-sub-back-" + e.item.id + "-" + e.midAngle,
|
|
1028
1032
|
class: f(["slice-group-3d", {
|
|
1029
1033
|
"is-hovered": C.value === e.item.id,
|
|
1030
1034
|
"is-dimmed": C.value !== null && C.value !== e.item.id
|
|
1031
1035
|
}]),
|
|
1032
|
-
style: p(
|
|
1036
|
+
style: p(st(e))
|
|
1033
1037
|
}, [
|
|
1034
1038
|
t.isExpanded && e.innerWallPath ? (g(), o("path", {
|
|
1035
1039
|
key: 0,
|
|
1036
1040
|
d: e.innerWallPath,
|
|
1037
1041
|
fill: `url(#inner-grad-${z(e.item.id)})`
|
|
1038
|
-
}, null, 8,
|
|
1042
|
+
}, null, 8, me)) : a("", !0),
|
|
1039
1043
|
t.isExpanded && e.innerWallStrokePath ? (g(), o("path", {
|
|
1040
1044
|
key: 1,
|
|
1041
1045
|
d: e.innerWallStrokePath,
|
|
@@ -1043,22 +1047,22 @@ var P = {
|
|
|
1043
1047
|
stroke: `url(#inner-grad-${z(e.item.id)})`,
|
|
1044
1048
|
"stroke-width": "0.8",
|
|
1045
1049
|
"stroke-linejoin": "round"
|
|
1046
|
-
}, null, 8,
|
|
1050
|
+
}, null, 8, he)) : a("", !0),
|
|
1047
1051
|
t.isExpanded && e.startCutPath ? (g(), o("path", {
|
|
1048
1052
|
key: 2,
|
|
1049
1053
|
d: e.startCutPath,
|
|
1050
1054
|
fill: N(e.color, .65)
|
|
1051
|
-
}, null, 8,
|
|
1055
|
+
}, null, 8, ge)) : a("", !0),
|
|
1052
1056
|
t.isExpanded && e.endCutPath ? (g(), o("path", {
|
|
1053
1057
|
key: 3,
|
|
1054
1058
|
d: e.endCutPath,
|
|
1055
1059
|
fill: N(e.color, .75)
|
|
1056
|
-
}, null, 8,
|
|
1060
|
+
}, null, 8, _e)) : a("", !0),
|
|
1057
1061
|
t.isExpanded && e.outerWallPath ? (g(), o("path", {
|
|
1058
1062
|
key: 4,
|
|
1059
1063
|
d: e.outerWallPath,
|
|
1060
1064
|
fill: `url(#outer-grad-${z(e.item.id)})`
|
|
1061
|
-
}, null, 8,
|
|
1065
|
+
}, null, 8, ve)) : a("", !0),
|
|
1062
1066
|
t.isExpanded && e.outerWallStrokePath ? (g(), o("path", {
|
|
1063
1067
|
key: 5,
|
|
1064
1068
|
d: e.outerWallStrokePath,
|
|
@@ -1066,65 +1070,65 @@ var P = {
|
|
|
1066
1070
|
stroke: `url(#outer-grad-${z(e.item.id)})`,
|
|
1067
1071
|
"stroke-width": "0.8",
|
|
1068
1072
|
"stroke-linejoin": "round"
|
|
1069
|
-
}, null, 8,
|
|
1070
|
-
|
|
1073
|
+
}, null, 8, ye)) : a("", !0),
|
|
1074
|
+
pt(e) ? (g(), o("path", {
|
|
1071
1075
|
key: 6,
|
|
1072
1076
|
d: e.originalTopPath,
|
|
1073
1077
|
fill: `url(#top-grad-${z(e.item.id)})`
|
|
1074
|
-
}, null, 8,
|
|
1075
|
-
|
|
1078
|
+
}, null, 8, be)) : a("", !0),
|
|
1079
|
+
pt(e) ? (g(), o("path", {
|
|
1076
1080
|
key: 7,
|
|
1077
1081
|
d: e.topStrokePath,
|
|
1078
1082
|
fill: "none",
|
|
1079
1083
|
stroke: `url(#top-grad-${z(e.item.id)})`,
|
|
1080
1084
|
"stroke-width": "0.8",
|
|
1081
1085
|
"stroke-linejoin": "round"
|
|
1082
|
-
}, null, 8,
|
|
1083
|
-
|
|
1086
|
+
}, null, 8, xe)) : a("", !0),
|
|
1087
|
+
pt(e) ? (g(), o("path", {
|
|
1084
1088
|
key: 8,
|
|
1085
1089
|
d: e.topStrokePath,
|
|
1086
1090
|
fill: "none",
|
|
1087
1091
|
stroke: "rgba(255, 255, 255, 0.16)",
|
|
1088
1092
|
"stroke-width": t.isExpanded ? .8 : .5,
|
|
1089
1093
|
"stroke-linejoin": "round"
|
|
1090
|
-
}, null, 8,
|
|
1094
|
+
}, null, 8, Se)) : a("", !0)
|
|
1091
1095
|
], 6))), 128)),
|
|
1092
1096
|
c.showCenterText ? (g(), o("g", {
|
|
1093
1097
|
key: 0,
|
|
1094
|
-
transform: `translate(${
|
|
1098
|
+
transform: `translate(${H.value}, ${U.value})`,
|
|
1095
1099
|
class: "center-text-group"
|
|
1096
1100
|
}, [s("text", {
|
|
1097
1101
|
x: "0",
|
|
1098
1102
|
y: "-3",
|
|
1099
1103
|
class: "center-text-value",
|
|
1100
|
-
"font-size":
|
|
1104
|
+
"font-size": rt.value,
|
|
1101
1105
|
"font-weight": "bold",
|
|
1102
1106
|
"font-family": "'JetBrains Mono', monospace",
|
|
1103
1107
|
"text-anchor": "middle",
|
|
1104
1108
|
"dominant-baseline": "middle"
|
|
1105
|
-
}, S(
|
|
1109
|
+
}, S(We.value), 9, we), s("text", {
|
|
1106
1110
|
x: "0",
|
|
1107
1111
|
y: "10",
|
|
1108
1112
|
class: "center-text-label",
|
|
1109
|
-
"font-size":
|
|
1113
|
+
"font-size": it.value,
|
|
1110
1114
|
"font-family": "system-ui, -apple-system, sans-serif",
|
|
1111
1115
|
"font-weight": "600",
|
|
1112
1116
|
"text-anchor": "middle",
|
|
1113
1117
|
"dominant-baseline": "middle"
|
|
1114
|
-
}, S(
|
|
1115
|
-
(g(!0), o(e, null, y(
|
|
1118
|
+
}, S(Ge.value), 9, Te)], 8, Ce)) : a("", !0),
|
|
1119
|
+
(g(!0), o(e, null, y(X.value.filter((e) => e.midY >= at.value), (e) => (g(), o("g", {
|
|
1116
1120
|
key: "slice-sub-front-" + e.item.id + "-" + e.midAngle,
|
|
1117
1121
|
class: f(["slice-group-3d", {
|
|
1118
1122
|
"is-hovered": C.value === e.item.id,
|
|
1119
1123
|
"is-dimmed": C.value !== null && C.value !== e.item.id
|
|
1120
1124
|
}]),
|
|
1121
|
-
style: p(
|
|
1125
|
+
style: p(st(e))
|
|
1122
1126
|
}, [
|
|
1123
1127
|
t.isExpanded && e.innerWallPath ? (g(), o("path", {
|
|
1124
1128
|
key: 0,
|
|
1125
1129
|
d: e.innerWallPath,
|
|
1126
1130
|
fill: `url(#inner-grad-${z(e.item.id)})`
|
|
1127
|
-
}, null, 8,
|
|
1131
|
+
}, null, 8, Ee)) : a("", !0),
|
|
1128
1132
|
t.isExpanded && e.innerWallStrokePath ? (g(), o("path", {
|
|
1129
1133
|
key: 1,
|
|
1130
1134
|
d: e.innerWallStrokePath,
|
|
@@ -1132,22 +1136,22 @@ var P = {
|
|
|
1132
1136
|
stroke: `url(#inner-grad-${z(e.item.id)})`,
|
|
1133
1137
|
"stroke-width": "0.8",
|
|
1134
1138
|
"stroke-linejoin": "round"
|
|
1135
|
-
}, null, 8,
|
|
1139
|
+
}, null, 8, De)) : a("", !0),
|
|
1136
1140
|
t.isExpanded && e.startCutPath ? (g(), o("path", {
|
|
1137
1141
|
key: 2,
|
|
1138
1142
|
d: e.startCutPath,
|
|
1139
1143
|
fill: N(e.color, .65)
|
|
1140
|
-
}, null, 8,
|
|
1144
|
+
}, null, 8, Oe)) : a("", !0),
|
|
1141
1145
|
t.isExpanded && e.endCutPath ? (g(), o("path", {
|
|
1142
1146
|
key: 3,
|
|
1143
1147
|
d: e.endCutPath,
|
|
1144
1148
|
fill: N(e.color, .75)
|
|
1145
|
-
}, null, 8,
|
|
1149
|
+
}, null, 8, ke)) : a("", !0),
|
|
1146
1150
|
t.isExpanded && e.outerWallPath ? (g(), o("path", {
|
|
1147
1151
|
key: 4,
|
|
1148
1152
|
d: e.outerWallPath,
|
|
1149
1153
|
fill: `url(#outer-grad-${z(e.item.id)})`
|
|
1150
|
-
}, null, 8,
|
|
1154
|
+
}, null, 8, Ae)) : a("", !0),
|
|
1151
1155
|
t.isExpanded && e.outerWallStrokePath ? (g(), o("path", {
|
|
1152
1156
|
key: 5,
|
|
1153
1157
|
d: e.outerWallStrokePath,
|
|
@@ -1155,30 +1159,30 @@ var P = {
|
|
|
1155
1159
|
stroke: `url(#outer-grad-${z(e.item.id)})`,
|
|
1156
1160
|
"stroke-width": "0.8",
|
|
1157
1161
|
"stroke-linejoin": "round"
|
|
1158
|
-
}, null, 8,
|
|
1159
|
-
|
|
1162
|
+
}, null, 8, je)) : a("", !0),
|
|
1163
|
+
pt(e) ? (g(), o("path", {
|
|
1160
1164
|
key: 6,
|
|
1161
1165
|
d: e.originalTopPath,
|
|
1162
1166
|
fill: `url(#top-grad-${z(e.item.id)})`
|
|
1163
|
-
}, null, 8,
|
|
1164
|
-
|
|
1167
|
+
}, null, 8, Me)) : a("", !0),
|
|
1168
|
+
pt(e) ? (g(), o("path", {
|
|
1165
1169
|
key: 7,
|
|
1166
1170
|
d: e.topStrokePath,
|
|
1167
1171
|
fill: "none",
|
|
1168
1172
|
stroke: `url(#top-grad-${z(e.item.id)})`,
|
|
1169
1173
|
"stroke-width": "0.8",
|
|
1170
1174
|
"stroke-linejoin": "round"
|
|
1171
|
-
}, null, 8,
|
|
1172
|
-
|
|
1175
|
+
}, null, 8, Ne)) : a("", !0),
|
|
1176
|
+
pt(e) ? (g(), o("path", {
|
|
1173
1177
|
key: 8,
|
|
1174
1178
|
d: e.topStrokePath,
|
|
1175
1179
|
fill: "none",
|
|
1176
1180
|
stroke: "rgba(255, 255, 255, 0.16)",
|
|
1177
1181
|
"stroke-width": t.isExpanded ? .8 : .5,
|
|
1178
1182
|
"stroke-linejoin": "round"
|
|
1179
|
-
}, null, 8,
|
|
1183
|
+
}, null, 8, Pe)) : a("", !0)
|
|
1180
1184
|
], 6))), 128)),
|
|
1181
|
-
(g(!0), o(e, null, y(
|
|
1185
|
+
(g(!0), o(e, null, y(ot.value, (e) => (g(), o("g", {
|
|
1182
1186
|
key: "hover-trigger-" + e.item.id,
|
|
1183
1187
|
class: "hover-trigger-group",
|
|
1184
1188
|
style: p({ cursor: c.selectable && !j.value ? "pointer" : "default" }),
|
|
@@ -1188,18 +1192,18 @@ var P = {
|
|
|
1188
1192
|
}, [s("path", {
|
|
1189
1193
|
d: e.hoverPath || e.originalTopPath,
|
|
1190
1194
|
fill: "transparent"
|
|
1191
|
-
}, null, 8,
|
|
1195
|
+
}, null, 8, Ie), e.originalOuterWallPath ? (g(), o("path", {
|
|
1192
1196
|
key: 0,
|
|
1193
1197
|
d: e.originalOuterWallPath,
|
|
1194
1198
|
fill: "transparent"
|
|
1195
|
-
}, null, 8,
|
|
1199
|
+
}, null, 8, Le)) : a("", !0)], 44, Fe))), 128)),
|
|
1196
1200
|
s("g", {
|
|
1197
1201
|
class: "labels-layer",
|
|
1198
1202
|
style: p({
|
|
1199
|
-
opacity:
|
|
1200
|
-
pointerEvents:
|
|
1203
|
+
opacity: Y.value,
|
|
1204
|
+
pointerEvents: Y.value > .01 ? "auto" : "none"
|
|
1201
1205
|
})
|
|
1202
|
-
}, [(g(!0), o(e, null, y(
|
|
1206
|
+
}, [(g(!0), o(e, null, y(lt.value, (e, t) => (g(), o("g", {
|
|
1203
1207
|
key: "label-left-" + e.item.id,
|
|
1204
1208
|
class: f(["label-group", {
|
|
1205
1209
|
"is-hovered": C.value === e.item.id,
|
|
@@ -1210,11 +1214,11 @@ var P = {
|
|
|
1210
1214
|
onClick: (t) => E(e.item.id),
|
|
1211
1215
|
style: p({ cursor: c.selectable && !j.value ? "pointer" : "default" })
|
|
1212
1216
|
}, [s("path", {
|
|
1213
|
-
d:
|
|
1217
|
+
d: dt(e),
|
|
1214
1218
|
fill: "none",
|
|
1215
1219
|
stroke: e.color,
|
|
1216
1220
|
"stroke-width": "1.2"
|
|
1217
|
-
}, null, 8,
|
|
1221
|
+
}, null, 8, ze), s("text", {
|
|
1218
1222
|
x: "85",
|
|
1219
1223
|
y: e.finalY,
|
|
1220
1224
|
fill: e.color,
|
|
@@ -1224,7 +1228,7 @@ var P = {
|
|
|
1224
1228
|
"text-anchor": "end",
|
|
1225
1229
|
"dominant-baseline": "middle",
|
|
1226
1230
|
style: p(C.value === e.item.id ? "transform: translate(0, -5px);" : "")
|
|
1227
|
-
}, S(R(e.item.name, 24)) + " " + S(L(e.item.value)) + " " + S(e.item.unit || "") + " (" + S(e.item.percentage) + "%) ", 13,
|
|
1231
|
+
}, S(R(e.item.name, 24)) + " " + S(L(e.item.value)) + " " + S(e.item.unit || "") + " (" + S(e.item.percentage) + "%) ", 13, Be)], 46, Re))), 128)), (g(!0), o(e, null, y(ut.value, (e, t) => (g(), o("g", {
|
|
1228
1232
|
key: "label-right-" + e.item.id,
|
|
1229
1233
|
class: f(["label-group", {
|
|
1230
1234
|
"is-hovered": C.value === e.item.id,
|
|
@@ -1235,11 +1239,11 @@ var P = {
|
|
|
1235
1239
|
onClick: (t) => E(e.item.id),
|
|
1236
1240
|
style: p({ cursor: c.selectable && !j.value ? "pointer" : "default" })
|
|
1237
1241
|
}, [s("path", {
|
|
1238
|
-
d:
|
|
1242
|
+
d: dt(e),
|
|
1239
1243
|
fill: "none",
|
|
1240
1244
|
stroke: e.color,
|
|
1241
1245
|
"stroke-width": "1.2"
|
|
1242
|
-
}, null, 8,
|
|
1246
|
+
}, null, 8, He), s("text", {
|
|
1243
1247
|
x: "675",
|
|
1244
1248
|
y: e.finalY,
|
|
1245
1249
|
fill: e.color,
|
|
@@ -1249,21 +1253,21 @@ var P = {
|
|
|
1249
1253
|
"text-anchor": "start",
|
|
1250
1254
|
"dominant-baseline": "middle",
|
|
1251
1255
|
style: p(C.value === e.item.id ? "transform: translate(0, -5px);" : "")
|
|
1252
|
-
}, S(R(e.item.name, 24)) + " " + S(L(e.item.value)) + " " + S(e.item.unit || "") + " (" + S(e.item.percentage) + "%) ", 13,
|
|
1256
|
+
}, S(R(e.item.name, 24)) + " " + S(L(e.item.value)) + " " + S(e.item.unit || "") + " (" + S(e.item.percentage) + "%) ", 13, Ue)], 46, Ve))), 128))], 4)
|
|
1253
1257
|
]))], 8, ee))], 2));
|
|
1254
1258
|
}
|
|
1255
|
-
}, [["__scopeId", "data-v-
|
|
1259
|
+
}, [["__scopeId", "data-v-acd0447d"]]), Ge = { class: "nano-scrub-label" }, Ke = {
|
|
1256
1260
|
key: 0,
|
|
1257
1261
|
class: "nano-scrub-overlay"
|
|
1258
|
-
},
|
|
1262
|
+
}, qe = {
|
|
1259
1263
|
key: 1,
|
|
1260
1264
|
class: "nano-scrub-svg-line"
|
|
1261
|
-
},
|
|
1265
|
+
}, Je = [
|
|
1262
1266
|
"x1",
|
|
1263
1267
|
"y1",
|
|
1264
1268
|
"x2",
|
|
1265
1269
|
"y2"
|
|
1266
|
-
],
|
|
1270
|
+
], Ye = { class: "nano-scrub-popup-val" }, Xe = { class: "nano-scrub-popup-res" }, Ze = /* @__PURE__ */ F(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
|
|
1267
1271
|
__name: "PrecisionScrubber",
|
|
1268
1272
|
props: {
|
|
1269
1273
|
modelValue: {
|
|
@@ -1341,7 +1345,7 @@ var P = {
|
|
|
1341
1345
|
}, r.$attrs), [s("div", {
|
|
1342
1346
|
class: "nano-scrub-progress",
|
|
1343
1347
|
style: p({ width: O.value + "%" })
|
|
1344
|
-
}, null, 4), s("span",
|
|
1348
|
+
}, null, 4), s("span", Ge, S(n.label), 1)], 16), (g(), i(t, { to: "body" }, [m.value ? (g(), o("div", Ke, [
|
|
1345
1349
|
h.value ? (g(), o("div", {
|
|
1346
1350
|
key: 0,
|
|
1347
1351
|
class: "nano-scrub-anchor",
|
|
@@ -1350,7 +1354,7 @@ var P = {
|
|
|
1350
1354
|
top: x.value + "px"
|
|
1351
1355
|
})
|
|
1352
1356
|
}, null, 4)) : a("", !0),
|
|
1353
|
-
h.value ? (g(), o("svg",
|
|
1357
|
+
h.value ? (g(), o("svg", qe, [s("line", {
|
|
1354
1358
|
x1: b.value,
|
|
1355
1359
|
y1: x.value,
|
|
1356
1360
|
x2: w.value,
|
|
@@ -1359,7 +1363,7 @@ var P = {
|
|
|
1359
1363
|
"stroke-dasharray": "4,4",
|
|
1360
1364
|
"stroke-width": "1.5",
|
|
1361
1365
|
opacity: "0.6"
|
|
1362
|
-
}, null, 8,
|
|
1366
|
+
}, null, 8, Je)])) : a("", !0),
|
|
1363
1367
|
s("div", {
|
|
1364
1368
|
class: "nano-scrub-popup",
|
|
1365
1369
|
style: p({
|
|
@@ -1368,17 +1372,778 @@ var P = {
|
|
|
1368
1372
|
})
|
|
1369
1373
|
}, [
|
|
1370
1374
|
c[0] ||= s("div", { class: "nano-scrub-popup-title" }, "Scrubbing Mode", -1),
|
|
1371
|
-
s("div",
|
|
1372
|
-
s("div",
|
|
1375
|
+
s("div", Ye, S(k.value), 1),
|
|
1376
|
+
s("div", Xe, S(E.value), 1)
|
|
1373
1377
|
], 4)
|
|
1374
1378
|
])) : a("", !0)]))], 64));
|
|
1375
1379
|
}
|
|
1376
|
-
}), [["__scopeId", "data-v-
|
|
1380
|
+
}), [["__scopeId", "data-v-21b41bc4"]]), Qe = { class: "header-inner" }, $e = {
|
|
1381
|
+
key: 0,
|
|
1382
|
+
class: "header-left"
|
|
1383
|
+
}, H = {
|
|
1384
|
+
key: 1,
|
|
1385
|
+
class: "header-center"
|
|
1386
|
+
}, U = {
|
|
1387
|
+
key: 2,
|
|
1388
|
+
class: "header-right"
|
|
1389
|
+
}, W = /* @__PURE__ */ F({
|
|
1390
|
+
__name: "MutatingHeader",
|
|
1391
|
+
props: {
|
|
1392
|
+
threshold: {
|
|
1393
|
+
type: Number,
|
|
1394
|
+
default: 24
|
|
1395
|
+
},
|
|
1396
|
+
hysteresis: {
|
|
1397
|
+
type: Number,
|
|
1398
|
+
default: 8
|
|
1399
|
+
},
|
|
1400
|
+
scrollContainer: {
|
|
1401
|
+
type: [String, Object],
|
|
1402
|
+
default: null
|
|
1403
|
+
},
|
|
1404
|
+
height: {
|
|
1405
|
+
type: String,
|
|
1406
|
+
default: "60px"
|
|
1407
|
+
},
|
|
1408
|
+
floatingMargin: {
|
|
1409
|
+
type: String,
|
|
1410
|
+
default: "12px 24px 0 24px"
|
|
1411
|
+
},
|
|
1412
|
+
floatingRadius: {
|
|
1413
|
+
type: String,
|
|
1414
|
+
default: "16px"
|
|
1415
|
+
},
|
|
1416
|
+
glassmorphism: {
|
|
1417
|
+
type: Boolean,
|
|
1418
|
+
default: !0
|
|
1419
|
+
},
|
|
1420
|
+
stuck: {
|
|
1421
|
+
type: Boolean,
|
|
1422
|
+
default: void 0
|
|
1423
|
+
}
|
|
1424
|
+
},
|
|
1425
|
+
emits: [
|
|
1426
|
+
"update:stuck",
|
|
1427
|
+
"stuck",
|
|
1428
|
+
"unstick"
|
|
1429
|
+
],
|
|
1430
|
+
setup(e, { emit: t }) {
|
|
1431
|
+
let n = e, i = t, c = v(!1), l = r({
|
|
1432
|
+
get: () => n.stuck === void 0 ? c.value : n.stuck,
|
|
1433
|
+
set: (e) => {
|
|
1434
|
+
c.value = e, i("update:stuck", e), i(e ? "stuck" : "unstick");
|
|
1435
|
+
}
|
|
1436
|
+
}), u = null, d = () => u && u !== window ? u.scrollTop || 0 : window.scrollY || document.documentElement.scrollTop || 0, _ = () => {
|
|
1437
|
+
let e = d(), t = n.threshold, r = n.hysteresis;
|
|
1438
|
+
!l.value && e > t ? l.value = !0 : l.value && e < r && (l.value = !1);
|
|
1439
|
+
}, y = () => {
|
|
1440
|
+
x(), !(typeof window > "u") && (n.scrollContainer && (typeof n.scrollContainer == "string" ? u = document.querySelector(n.scrollContainer) : n.scrollContainer instanceof HTMLElement && (u = n.scrollContainer)), u ||= window, u.addEventListener("scroll", _, { passive: !0 }), _());
|
|
1441
|
+
}, x = () => {
|
|
1442
|
+
u &&= (u.removeEventListener("scroll", _), null);
|
|
1443
|
+
};
|
|
1444
|
+
return w(() => n.scrollContainer, () => {
|
|
1445
|
+
y();
|
|
1446
|
+
}), m(() => {
|
|
1447
|
+
y();
|
|
1448
|
+
}), h(() => {
|
|
1449
|
+
x();
|
|
1450
|
+
}), (t, n) => (g(), o("header", {
|
|
1451
|
+
class: f(["nano-mutating-header", {
|
|
1452
|
+
"is-stuck": l.value,
|
|
1453
|
+
"has-glassmorphism": e.glassmorphism
|
|
1454
|
+
}]),
|
|
1455
|
+
style: p({
|
|
1456
|
+
"--header-height": e.height,
|
|
1457
|
+
"--floating-margin": e.floatingMargin,
|
|
1458
|
+
"--floating-radius": e.floatingRadius
|
|
1459
|
+
})
|
|
1460
|
+
}, [s("div", Qe, [
|
|
1461
|
+
t.$slots.left ? (g(), o("div", $e, [b(t.$slots, "left", { isStuck: l.value }, void 0, !0)])) : a("", !0),
|
|
1462
|
+
t.$slots.center ? (g(), o("div", H, [b(t.$slots, "center", { isStuck: l.value }, void 0, !0)])) : a("", !0),
|
|
1463
|
+
t.$slots.right ? (g(), o("div", U, [b(t.$slots, "right", { isStuck: l.value }, void 0, !0)])) : a("", !0),
|
|
1464
|
+
!t.$slots.left && !t.$slots.center && !t.$slots.right ? b(t.$slots, "default", {
|
|
1465
|
+
key: 3,
|
|
1466
|
+
isStuck: l.value
|
|
1467
|
+
}, void 0, !0) : a("", !0)
|
|
1468
|
+
])], 6));
|
|
1469
|
+
}
|
|
1470
|
+
}, [["__scopeId", "data-v-fd47d0d0"]]), G = [
|
|
1471
|
+
"viewBox",
|
|
1472
|
+
"width",
|
|
1473
|
+
"height"
|
|
1474
|
+
], K = ["points"], q = ["points"], et = ["points"], J = ["points"], tt = [
|
|
1475
|
+
"x1",
|
|
1476
|
+
"y1",
|
|
1477
|
+
"x2",
|
|
1478
|
+
"y2"
|
|
1479
|
+
], nt = ["x", "y"], Y = [
|
|
1480
|
+
"points",
|
|
1481
|
+
"fill",
|
|
1482
|
+
"stroke",
|
|
1483
|
+
"opacity"
|
|
1484
|
+
], rt = [
|
|
1485
|
+
"points",
|
|
1486
|
+
"fill",
|
|
1487
|
+
"stroke"
|
|
1488
|
+
], it = [
|
|
1489
|
+
"cx",
|
|
1490
|
+
"cy",
|
|
1491
|
+
"fill"
|
|
1492
|
+
], at = /* @__PURE__ */ F({
|
|
1493
|
+
__name: "TopologyRadar",
|
|
1494
|
+
props: {
|
|
1495
|
+
size: {
|
|
1496
|
+
type: Number,
|
|
1497
|
+
default: 200
|
|
1498
|
+
},
|
|
1499
|
+
history: {
|
|
1500
|
+
type: Array,
|
|
1501
|
+
required: !0
|
|
1502
|
+
},
|
|
1503
|
+
labels: {
|
|
1504
|
+
type: Array,
|
|
1505
|
+
default: () => []
|
|
1506
|
+
},
|
|
1507
|
+
color: {
|
|
1508
|
+
type: String,
|
|
1509
|
+
default: "#00e5ff"
|
|
1510
|
+
}
|
|
1511
|
+
},
|
|
1512
|
+
setup(t) {
|
|
1513
|
+
let n = t, i = r(() => n.labels.length > 0 ? n.labels.length : n.history.length > 0 ? n.history[0].length : 5), c = r(() => n.size * .4), l = r(() => n.size / 2), u = r(() => n.size / 2), d = (e, t) => {
|
|
1514
|
+
let n = Math.PI * 2 * t / i.value - Math.PI / 2, r = e / 100 * c.value;
|
|
1515
|
+
return {
|
|
1516
|
+
x: l.value + Math.cos(n) * r,
|
|
1517
|
+
y: u.value + Math.sin(n) * r
|
|
1518
|
+
};
|
|
1519
|
+
}, f = (e) => {
|
|
1520
|
+
let t = [];
|
|
1521
|
+
for (let n = 0; n < i.value; n++) {
|
|
1522
|
+
let r = d(e * 100, n);
|
|
1523
|
+
t.push(`${r.x},${r.y}`);
|
|
1524
|
+
}
|
|
1525
|
+
return t.join(" ");
|
|
1526
|
+
}, m = (e) => e.map((e, t) => {
|
|
1527
|
+
let n = d(e, t);
|
|
1528
|
+
return `${n.x},${n.y}`;
|
|
1529
|
+
}).join(" "), h = (e, t) => {
|
|
1530
|
+
let n;
|
|
1531
|
+
return /^#([A-Fa-f0-9]{3}){1,2}$/.test(e) ? (n = e.substring(1).split(""), n.length === 3 && (n = [
|
|
1532
|
+
n[0],
|
|
1533
|
+
n[0],
|
|
1534
|
+
n[1],
|
|
1535
|
+
n[1],
|
|
1536
|
+
n[2],
|
|
1537
|
+
n[2]
|
|
1538
|
+
]), n = "0x" + n.join(""), "rgba(" + [
|
|
1539
|
+
n >> 16 & 255,
|
|
1540
|
+
n >> 8 & 255,
|
|
1541
|
+
n & 255
|
|
1542
|
+
].join(",") + "," + t + ")") : `rgba(0, 229, 255, ${t})`;
|
|
1543
|
+
};
|
|
1544
|
+
return (n, r) => (g(), o("div", {
|
|
1545
|
+
class: "topology-radar-container",
|
|
1546
|
+
style: p({
|
|
1547
|
+
width: t.size + "px",
|
|
1548
|
+
height: t.size + "px"
|
|
1549
|
+
})
|
|
1550
|
+
}, [(g(), o("svg", {
|
|
1551
|
+
viewBox: `0 0 ${t.size} ${t.size}`,
|
|
1552
|
+
width: t.size,
|
|
1553
|
+
height: t.size,
|
|
1554
|
+
style: { overflow: "visible" }
|
|
1555
|
+
}, [
|
|
1556
|
+
s("polygon", {
|
|
1557
|
+
points: f(1),
|
|
1558
|
+
fill: "var(--nano-radar-grid-bg, rgba(15,23,42,0.8))",
|
|
1559
|
+
stroke: "var(--nano-radar-grid-stroke, rgba(255,255,255,0.1))",
|
|
1560
|
+
"stroke-width": "1"
|
|
1561
|
+
}, null, 8, K),
|
|
1562
|
+
s("polygon", {
|
|
1563
|
+
points: f(.75),
|
|
1564
|
+
fill: "none",
|
|
1565
|
+
stroke: "var(--nano-radar-grid-subtle, rgba(255,255,255,0.05))",
|
|
1566
|
+
"stroke-width": "1"
|
|
1567
|
+
}, null, 8, q),
|
|
1568
|
+
s("polygon", {
|
|
1569
|
+
points: f(.5),
|
|
1570
|
+
fill: "none",
|
|
1571
|
+
stroke: "var(--nano-radar-grid-subtle, rgba(255,255,255,0.05))",
|
|
1572
|
+
"stroke-width": "1"
|
|
1573
|
+
}, null, 8, et),
|
|
1574
|
+
s("polygon", {
|
|
1575
|
+
points: f(.25),
|
|
1576
|
+
fill: "none",
|
|
1577
|
+
stroke: "var(--nano-radar-grid-subtle, rgba(255,255,255,0.05))",
|
|
1578
|
+
"stroke-width": "1"
|
|
1579
|
+
}, null, 8, J),
|
|
1580
|
+
(g(!0), o(e, null, y(t.labels, (e, n) => (g(), o("line", {
|
|
1581
|
+
key: "axis-" + n,
|
|
1582
|
+
x1: t.size / 2,
|
|
1583
|
+
y1: t.size / 2,
|
|
1584
|
+
x2: d(100, n).x,
|
|
1585
|
+
y2: d(100, n).y,
|
|
1586
|
+
stroke: "var(--nano-radar-grid-stroke, rgba(255,255,255,0.1))",
|
|
1587
|
+
"stroke-width": "1"
|
|
1588
|
+
}, null, 8, tt))), 128)),
|
|
1589
|
+
(g(!0), o(e, null, y(t.labels, (e, t) => (g(), o("text", {
|
|
1590
|
+
key: "label-" + t,
|
|
1591
|
+
x: d(115, t).x,
|
|
1592
|
+
y: d(115, t).y,
|
|
1593
|
+
fill: "var(--nano-radar-text, rgba(255,255,255,0.6))",
|
|
1594
|
+
"font-size": "10",
|
|
1595
|
+
"font-family": "monospace",
|
|
1596
|
+
"font-weight": "bold",
|
|
1597
|
+
"text-anchor": "middle",
|
|
1598
|
+
"dominant-baseline": "middle"
|
|
1599
|
+
}, S(e), 9, nt))), 128)),
|
|
1600
|
+
(g(!0), o(e, null, y(t.history, (e, n) => (g(), o("polygon", {
|
|
1601
|
+
key: "hist-" + n,
|
|
1602
|
+
points: m(e),
|
|
1603
|
+
fill: h(t.color, .02),
|
|
1604
|
+
stroke: t.color,
|
|
1605
|
+
"stroke-width": 1,
|
|
1606
|
+
opacity: .1 + n / Math.max(1, t.history.length) * .4
|
|
1607
|
+
}, null, 8, Y))), 128)),
|
|
1608
|
+
t.history.length > 0 ? (g(), o("polygon", {
|
|
1609
|
+
key: 0,
|
|
1610
|
+
points: m(t.history[t.history.length - 1]),
|
|
1611
|
+
fill: h(t.color, .15),
|
|
1612
|
+
stroke: t.color,
|
|
1613
|
+
"stroke-width": "2.5",
|
|
1614
|
+
style: { filter: "drop-shadow(0 0 8px rgba(0, 229, 255, 0.5))" }
|
|
1615
|
+
}, null, 8, rt)) : a("", !0),
|
|
1616
|
+
t.history.length > 0 ? (g(!0), o(e, { key: 1 }, y(t.history[t.history.length - 1], (e, n) => (g(), o("circle", {
|
|
1617
|
+
key: "pt-" + n,
|
|
1618
|
+
cx: d(e, n).x,
|
|
1619
|
+
cy: d(e, n).y,
|
|
1620
|
+
r: "3",
|
|
1621
|
+
fill: t.color,
|
|
1622
|
+
style: { filter: "drop-shadow(0 0 5px rgba(0, 229, 255, 0.8))" }
|
|
1623
|
+
}, null, 8, it))), 128)) : a("", !0)
|
|
1624
|
+
], 8, G))], 4));
|
|
1625
|
+
}
|
|
1626
|
+
}, [["__scopeId", "data-v-bb4bd598"]]), X = ["for"], ot = [
|
|
1627
|
+
"checked",
|
|
1628
|
+
"disabled",
|
|
1629
|
+
"name",
|
|
1630
|
+
"id",
|
|
1631
|
+
"aria-checked"
|
|
1632
|
+
], st = {
|
|
1633
|
+
key: 0,
|
|
1634
|
+
class: "nano-switch-label"
|
|
1635
|
+
}, ct = /* @__PURE__ */ F({
|
|
1636
|
+
__name: "NanoSwitch",
|
|
1637
|
+
props: {
|
|
1638
|
+
modelValue: {
|
|
1639
|
+
type: [Boolean, null],
|
|
1640
|
+
default: !1
|
|
1641
|
+
},
|
|
1642
|
+
indeterminate: {
|
|
1643
|
+
type: Boolean,
|
|
1644
|
+
default: !1
|
|
1645
|
+
},
|
|
1646
|
+
label: {
|
|
1647
|
+
type: String,
|
|
1648
|
+
default: ""
|
|
1649
|
+
},
|
|
1650
|
+
size: {
|
|
1651
|
+
type: String,
|
|
1652
|
+
default: "default",
|
|
1653
|
+
validator: (e) => [
|
|
1654
|
+
"default",
|
|
1655
|
+
"compact",
|
|
1656
|
+
"mini"
|
|
1657
|
+
].includes(e)
|
|
1658
|
+
},
|
|
1659
|
+
color: {
|
|
1660
|
+
type: String,
|
|
1661
|
+
default: "primary"
|
|
1662
|
+
},
|
|
1663
|
+
disabled: {
|
|
1664
|
+
type: Boolean,
|
|
1665
|
+
default: !1
|
|
1666
|
+
},
|
|
1667
|
+
name: {
|
|
1668
|
+
type: String,
|
|
1669
|
+
default: ""
|
|
1670
|
+
},
|
|
1671
|
+
id: {
|
|
1672
|
+
type: String,
|
|
1673
|
+
default: ""
|
|
1674
|
+
}
|
|
1675
|
+
},
|
|
1676
|
+
emits: [
|
|
1677
|
+
"update:modelValue",
|
|
1678
|
+
"update:indeterminate",
|
|
1679
|
+
"change"
|
|
1680
|
+
],
|
|
1681
|
+
setup(e, { emit: t }) {
|
|
1682
|
+
let n = e, i = t, l = v(null), u = r(() => n.indeterminate || n.modelValue === null), d = r(() => !u.value && !!n.modelValue);
|
|
1683
|
+
w(u, (e) => {
|
|
1684
|
+
l.value && (l.value.indeterminate = e);
|
|
1685
|
+
}, { immediate: !0 });
|
|
1686
|
+
let p = (e) => {
|
|
1687
|
+
if (!n.disabled) if (u.value) i("update:indeterminate", !1), i("update:modelValue", !0), i("change", !0, e);
|
|
1688
|
+
else {
|
|
1689
|
+
let t = !d.value;
|
|
1690
|
+
i("update:modelValue", t), i("change", t, e);
|
|
1691
|
+
}
|
|
1692
|
+
};
|
|
1693
|
+
return (t, n) => (g(), o("label", {
|
|
1694
|
+
class: f(["nano-switch", [
|
|
1695
|
+
`size-${e.size}`,
|
|
1696
|
+
`color-${e.color}`,
|
|
1697
|
+
{
|
|
1698
|
+
"is-checked": d.value,
|
|
1699
|
+
"is-indeterminate": u.value,
|
|
1700
|
+
"is-disabled": e.disabled
|
|
1701
|
+
}
|
|
1702
|
+
]]),
|
|
1703
|
+
for: e.id || void 0
|
|
1704
|
+
}, [
|
|
1705
|
+
s("input", {
|
|
1706
|
+
ref_key: "inputRef",
|
|
1707
|
+
ref: l,
|
|
1708
|
+
type: "checkbox",
|
|
1709
|
+
class: "nano-switch-input",
|
|
1710
|
+
checked: d.value,
|
|
1711
|
+
disabled: e.disabled,
|
|
1712
|
+
name: e.name || void 0,
|
|
1713
|
+
id: e.id || void 0,
|
|
1714
|
+
onChange: p,
|
|
1715
|
+
role: "switch",
|
|
1716
|
+
"aria-checked": u.value ? "mixed" : d.value
|
|
1717
|
+
}, null, 40, ot),
|
|
1718
|
+
n[0] ||= s("div", { class: "nano-switch-slider" }, null, -1),
|
|
1719
|
+
e.label || t.$slots.default ? (g(), o("span", st, [b(t.$slots, "default", {}, () => [c(S(e.label), 1)], !0)])) : a("", !0)
|
|
1720
|
+
], 10, X));
|
|
1721
|
+
}
|
|
1722
|
+
}, [["__scopeId", "data-v-50b63887"]]), lt = { class: "rotator-fallback" }, ut = { class: "fallback-angle" }, dt = /* @__PURE__ */ F({
|
|
1723
|
+
__name: "KineticRotator",
|
|
1724
|
+
props: {
|
|
1725
|
+
modelValue: {
|
|
1726
|
+
type: Number,
|
|
1727
|
+
default: 0
|
|
1728
|
+
},
|
|
1729
|
+
duration: {
|
|
1730
|
+
type: Number,
|
|
1731
|
+
default: 1e3
|
|
1732
|
+
},
|
|
1733
|
+
speedMultiplier: {
|
|
1734
|
+
type: Number,
|
|
1735
|
+
default: 1
|
|
1736
|
+
},
|
|
1737
|
+
step: {
|
|
1738
|
+
type: Number,
|
|
1739
|
+
default: 90
|
|
1740
|
+
},
|
|
1741
|
+
shortestPath: {
|
|
1742
|
+
type: Boolean,
|
|
1743
|
+
default: !0
|
|
1744
|
+
},
|
|
1745
|
+
timingMode: {
|
|
1746
|
+
type: String,
|
|
1747
|
+
default: "proportional",
|
|
1748
|
+
validator: (e) => ["proportional", "fixed"].includes(e)
|
|
1749
|
+
},
|
|
1750
|
+
inertiaThreshold: {
|
|
1751
|
+
type: Number,
|
|
1752
|
+
default: .25
|
|
1753
|
+
},
|
|
1754
|
+
size: {
|
|
1755
|
+
type: [Number, String],
|
|
1756
|
+
default: 260
|
|
1757
|
+
}
|
|
1758
|
+
},
|
|
1759
|
+
emits: [
|
|
1760
|
+
"update:modelValue",
|
|
1761
|
+
"change",
|
|
1762
|
+
"settled",
|
|
1763
|
+
"frame"
|
|
1764
|
+
],
|
|
1765
|
+
setup(e, { expose: t, emit: n }) {
|
|
1766
|
+
let i = e, a = n, c = (e, t) => (t - 2) * e * e * e + (3 - 2 * t) * e * e + t * e, l = (e, t) => 3 * (t - 2) * e * e + 2 * (3 - 2 * t) * e + t, u = (e, t) => 6 * (t - 2) * e + 2 * (3 - 2 * t), d = (e) => e < .5 ? 4 * e * e * e : 1 - (-2 * e + 2) ** 3 / 2, f = (e) => e < .5 ? 12 * e * e : 3 * (-2 * e + 2) ** 2, _ = (e) => e < .5 ? 24 * e : 24 * e - 24, y = (e) => (e % 360 + 360) % 360, x = (e, t) => {
|
|
1767
|
+
let n = y(e);
|
|
1768
|
+
return ((y(t) - n + 180) % 360 + 360) % 360 - 180;
|
|
1769
|
+
}, C = v(i.modelValue), T = v(i.modelValue), E = v(0), D = v(0), O = v(!1), k = v(1), A = v(0), j = null, M = null, N = r(() => {
|
|
1770
|
+
let e = typeof i.size == "number" ? `${i.size}px` : i.size;
|
|
1771
|
+
return {
|
|
1772
|
+
width: e,
|
|
1773
|
+
height: e
|
|
1774
|
+
};
|
|
1775
|
+
}), P = (e) => {
|
|
1776
|
+
if (!j) return {
|
|
1777
|
+
angle: C.value,
|
|
1778
|
+
vel: 0,
|
|
1779
|
+
acc: 0,
|
|
1780
|
+
p: 1
|
|
1781
|
+
};
|
|
1782
|
+
let t = e - j.startTime, n = Math.max(0, Math.min(1, t / j.duration)), r = j.v0 === void 0 ? d(n) : c(n, j.v0), i = j.startAngle + (j.targetAngle - j.startAngle) * r, a = j.v0 === void 0 ? f(n) : l(n, j.v0), o = j.targetAngle - j.startAngle;
|
|
1783
|
+
return {
|
|
1784
|
+
angle: i,
|
|
1785
|
+
vel: o * a / j.duration * 1e3,
|
|
1786
|
+
acc: o * (j.v0 === void 0 ? _(n) : u(n, j.v0)) / (j.duration * j.duration) * 1e6,
|
|
1787
|
+
p: n
|
|
1788
|
+
};
|
|
1789
|
+
}, F = (e) => {
|
|
1790
|
+
if (!j) {
|
|
1791
|
+
O.value = !1, E.value = 0, D.value = 0, k.value = 1;
|
|
1792
|
+
return;
|
|
1793
|
+
}
|
|
1794
|
+
let { angle: t, vel: n, acc: r, p: i } = P(e);
|
|
1795
|
+
if (C.value = t, E.value = n, D.value = r, k.value = i, a("frame", {
|
|
1796
|
+
currentAngle: t,
|
|
1797
|
+
targetAngle: j.targetAngle,
|
|
1798
|
+
velocity: n,
|
|
1799
|
+
acceleration: r,
|
|
1800
|
+
progress: i,
|
|
1801
|
+
isMoving: !0,
|
|
1802
|
+
v0: j.v0 || 0,
|
|
1803
|
+
timestamp: e
|
|
1804
|
+
}), i < 1) M = requestAnimationFrame(F);
|
|
1805
|
+
else {
|
|
1806
|
+
C.value = j.targetAngle, E.value = 0, D.value = 0, k.value = 1, O.value = !1;
|
|
1807
|
+
let t = j.targetAngle;
|
|
1808
|
+
j = null, a("update:modelValue", t), a("settled", {
|
|
1809
|
+
angle: t,
|
|
1810
|
+
normalizedAngle: y(t)
|
|
1811
|
+
}), a("frame", {
|
|
1812
|
+
currentAngle: t,
|
|
1813
|
+
targetAngle: t,
|
|
1814
|
+
velocity: 0,
|
|
1815
|
+
acceleration: 0,
|
|
1816
|
+
progress: 1,
|
|
1817
|
+
isMoving: !1,
|
|
1818
|
+
v0: 0,
|
|
1819
|
+
timestamp: e
|
|
1820
|
+
});
|
|
1821
|
+
}
|
|
1822
|
+
}, I = (e, { isRelative: t = !1, delta: n = 0 } = {}) => {
|
|
1823
|
+
let r = performance.now(), o = C.value, s = E.value;
|
|
1824
|
+
if (j && O.value) {
|
|
1825
|
+
let e = P(r);
|
|
1826
|
+
o = e.angle, s = e.vel;
|
|
1827
|
+
}
|
|
1828
|
+
let c = e;
|
|
1829
|
+
if (i.shortestPath) {
|
|
1830
|
+
let r = 0;
|
|
1831
|
+
if (t) {
|
|
1832
|
+
let e = T.value;
|
|
1833
|
+
r = y(e + n);
|
|
1834
|
+
} else r = y(e);
|
|
1835
|
+
let a = x(o, r);
|
|
1836
|
+
if (i.inertiaThreshold > 0 && Math.abs(s) > 20 && (s > 0 && a < 0 || s < 0 && a > 0)) {
|
|
1837
|
+
let e = a > 0 ? a - 360 : a + 360;
|
|
1838
|
+
360 - 2 * Math.abs(a) < Math.abs(s) * i.inertiaThreshold && (a = e);
|
|
1839
|
+
}
|
|
1840
|
+
c = o + a;
|
|
1841
|
+
}
|
|
1842
|
+
T.value = c, a("change", c);
|
|
1843
|
+
let l = c - o;
|
|
1844
|
+
if (Math.abs(l) < .05) {
|
|
1845
|
+
C.value = c, E.value = 0, D.value = 0, k.value = 1, O.value = !1, j = null, a("update:modelValue", c);
|
|
1846
|
+
return;
|
|
1847
|
+
}
|
|
1848
|
+
let u = Math.max(.01, i.speedMultiplier), d = i.timingMode === "fixed" ? i.duration / u : i.duration / u * Math.max(.2, Math.abs(l) / i.step), f = 0;
|
|
1849
|
+
Math.abs(l) > .01 && Math.abs(s) > .1 && (f = s / 1e3 * d / l, f = Math.max(-2.5, Math.min(2.5, f))), A.value = f, O.value = !0, j = {
|
|
1850
|
+
startAngle: o,
|
|
1851
|
+
targetAngle: c,
|
|
1852
|
+
startTime: r,
|
|
1853
|
+
duration: d,
|
|
1854
|
+
v0: f
|
|
1855
|
+
}, M && cancelAnimationFrame(M), M = requestAnimationFrame(F);
|
|
1856
|
+
}, L = (e) => {
|
|
1857
|
+
I(T.value + e, {
|
|
1858
|
+
isRelative: !0,
|
|
1859
|
+
delta: e
|
|
1860
|
+
});
|
|
1861
|
+
}, R = (e) => {
|
|
1862
|
+
I(e, { isRelative: !1 });
|
|
1863
|
+
}, z = () => {
|
|
1864
|
+
M && cancelAnimationFrame(M), j = null, C.value = 0, T.value = 0, E.value = 0, D.value = 0, k.value = 1, O.value = !1, A.value = 0, a("update:modelValue", 0), a("settled", {
|
|
1865
|
+
angle: 0,
|
|
1866
|
+
normalizedAngle: 0
|
|
1867
|
+
});
|
|
1868
|
+
}, B = () => {
|
|
1869
|
+
if (!j || !O.value) return;
|
|
1870
|
+
let e = performance.now(), { p: t } = P(e);
|
|
1871
|
+
if (t >= 1) return;
|
|
1872
|
+
let n = j.targetAngle - j.startAngle, r = Math.max(.01, i.speedMultiplier), a = i.timingMode === "fixed" ? i.duration / r : i.duration / r * Math.max(.2, Math.abs(n) / i.step);
|
|
1873
|
+
j.duration = a, j.startTime = e - t * a;
|
|
1874
|
+
};
|
|
1875
|
+
return w([
|
|
1876
|
+
() => i.duration,
|
|
1877
|
+
() => i.speedMultiplier,
|
|
1878
|
+
() => i.timingMode
|
|
1879
|
+
], B), w(() => i.modelValue, (e) => {
|
|
1880
|
+
Math.abs(e - T.value) > .01 && R(e);
|
|
1881
|
+
}), m(() => {
|
|
1882
|
+
C.value = i.modelValue, T.value = i.modelValue;
|
|
1883
|
+
}), h(() => {
|
|
1884
|
+
M && cancelAnimationFrame(M);
|
|
1885
|
+
}), t({
|
|
1886
|
+
currentAngle: C,
|
|
1887
|
+
targetAngle: T,
|
|
1888
|
+
velocity: E,
|
|
1889
|
+
acceleration: D,
|
|
1890
|
+
isMoving: O,
|
|
1891
|
+
progress: k,
|
|
1892
|
+
v0: A,
|
|
1893
|
+
rotateBy: L,
|
|
1894
|
+
setAngle: R,
|
|
1895
|
+
reset: z,
|
|
1896
|
+
updateActiveDuration: B
|
|
1897
|
+
}), (e, t) => (g(), o("div", {
|
|
1898
|
+
class: "nano-kinetic-rotator",
|
|
1899
|
+
style: p(N.value)
|
|
1900
|
+
}, [s("div", {
|
|
1901
|
+
class: "rotator-tile",
|
|
1902
|
+
style: p({ transform: `rotate(${C.value}deg)` })
|
|
1903
|
+
}, [b(e.$slots, "default", {
|
|
1904
|
+
currentAngle: C.value,
|
|
1905
|
+
targetAngle: T.value,
|
|
1906
|
+
normalizedAngle: y(C.value),
|
|
1907
|
+
velocity: E.value,
|
|
1908
|
+
acceleration: D.value,
|
|
1909
|
+
isMoving: O.value,
|
|
1910
|
+
progress: k.value
|
|
1911
|
+
}, () => [s("div", lt, [t[0] ||= s("span", { class: "fallback-icon" }, "⚡", -1), s("span", ut, S(Math.round(y(C.value))) + "°", 1)])], !0)], 4)], 4));
|
|
1912
|
+
}
|
|
1913
|
+
}, [["__scopeId", "data-v-abbbb111"]]), ft = {
|
|
1914
|
+
key: 0,
|
|
1915
|
+
class: "code-block-header"
|
|
1916
|
+
}, pt = { class: "code-block-title-group" }, mt = {
|
|
1917
|
+
key: 0,
|
|
1918
|
+
class: "code-block-title"
|
|
1919
|
+
}, ht = {
|
|
1920
|
+
key: 1,
|
|
1921
|
+
class: "code-block-lang"
|
|
1922
|
+
}, gt = { class: "code-block-actions" }, _t = ["aria-label"], vt = {
|
|
1923
|
+
key: 0,
|
|
1924
|
+
class: "action-svg",
|
|
1925
|
+
viewBox: "0 0 24 24",
|
|
1926
|
+
fill: "none",
|
|
1927
|
+
stroke: "currentColor",
|
|
1928
|
+
"stroke-width": "2",
|
|
1929
|
+
"stroke-linecap": "round",
|
|
1930
|
+
"stroke-linejoin": "round"
|
|
1931
|
+
}, yt = {
|
|
1932
|
+
key: 1,
|
|
1933
|
+
class: "action-svg",
|
|
1934
|
+
viewBox: "0 0 24 24",
|
|
1935
|
+
fill: "none",
|
|
1936
|
+
stroke: "currentColor",
|
|
1937
|
+
"stroke-width": "2",
|
|
1938
|
+
"stroke-linecap": "round",
|
|
1939
|
+
"stroke-linejoin": "round"
|
|
1940
|
+
}, bt = ["aria-label"], xt = {
|
|
1941
|
+
key: 0,
|
|
1942
|
+
class: "action-svg",
|
|
1943
|
+
viewBox: "0 0 24 24",
|
|
1944
|
+
fill: "none",
|
|
1945
|
+
stroke: "currentColor",
|
|
1946
|
+
"stroke-width": "2",
|
|
1947
|
+
"stroke-linecap": "round",
|
|
1948
|
+
"stroke-linejoin": "round"
|
|
1949
|
+
}, St = {
|
|
1950
|
+
key: 1,
|
|
1951
|
+
class: "action-svg success-icon",
|
|
1952
|
+
viewBox: "0 0 24 24",
|
|
1953
|
+
fill: "none",
|
|
1954
|
+
stroke: "currentColor",
|
|
1955
|
+
"stroke-width": "2.5",
|
|
1956
|
+
"stroke-linecap": "round",
|
|
1957
|
+
"stroke-linejoin": "round"
|
|
1958
|
+
}, Ct = /* @__PURE__ */ F({
|
|
1959
|
+
__name: "NanoCodeBlock",
|
|
1960
|
+
props: {
|
|
1961
|
+
title: {
|
|
1962
|
+
type: String,
|
|
1963
|
+
default: ""
|
|
1964
|
+
},
|
|
1965
|
+
lang: {
|
|
1966
|
+
type: String,
|
|
1967
|
+
default: ""
|
|
1968
|
+
},
|
|
1969
|
+
code: {
|
|
1970
|
+
type: String,
|
|
1971
|
+
default: ""
|
|
1972
|
+
},
|
|
1973
|
+
defaultWrap: {
|
|
1974
|
+
type: Boolean,
|
|
1975
|
+
default: !1
|
|
1976
|
+
},
|
|
1977
|
+
allowWrap: {
|
|
1978
|
+
type: Boolean,
|
|
1979
|
+
default: !0
|
|
1980
|
+
},
|
|
1981
|
+
allowCopy: {
|
|
1982
|
+
type: Boolean,
|
|
1983
|
+
default: !0
|
|
1984
|
+
},
|
|
1985
|
+
maxHeight: {
|
|
1986
|
+
type: [Number, String],
|
|
1987
|
+
default: null
|
|
1988
|
+
}
|
|
1989
|
+
},
|
|
1990
|
+
emits: ["update:wrap", "copied"],
|
|
1991
|
+
setup(e, { emit: t }) {
|
|
1992
|
+
let n = e, i = t, l = v(n.defaultWrap), u = v(!1), d = v(null), m = null, h = () => {
|
|
1993
|
+
l.value = !l.value, i("update:wrap", l.value);
|
|
1994
|
+
}, _ = async () => {
|
|
1995
|
+
let e = n.code;
|
|
1996
|
+
if (!e && d.value && (e = d.value.innerText || d.value.textContent || ""), e) try {
|
|
1997
|
+
if (navigator.clipboard && navigator.clipboard.writeText) await navigator.clipboard.writeText(e);
|
|
1998
|
+
else {
|
|
1999
|
+
let t = document.createElement("textarea");
|
|
2000
|
+
t.value = e, t.style.position = "fixed", t.style.opacity = "0", document.body.appendChild(t), t.select(), document.execCommand("copy"), document.body.removeChild(t);
|
|
2001
|
+
}
|
|
2002
|
+
u.value = !0, i("copied", e), m && clearTimeout(m), m = setTimeout(() => {
|
|
2003
|
+
u.value = !1;
|
|
2004
|
+
}, 2e3);
|
|
2005
|
+
} catch (e) {
|
|
2006
|
+
console.error("Failed to copy code snippet:", e);
|
|
2007
|
+
}
|
|
2008
|
+
}, y = r(() => {
|
|
2009
|
+
if (n.maxHeight) return typeof n.maxHeight == "number" ? `${n.maxHeight}px` : n.maxHeight;
|
|
2010
|
+
});
|
|
2011
|
+
return (t, n) => {
|
|
2012
|
+
let r = x("tooltip");
|
|
2013
|
+
return g(), o("div", { class: f(["nano-code-block", { "is-wrapped": l.value }]) }, [e.title || e.lang || t.$slots.header || e.allowWrap || e.allowCopy ? (g(), o("div", ft, [s("div", pt, [b(t.$slots, "header", {}, () => [e.title ? (g(), o("span", mt, S(e.title), 1)) : a("", !0), e.lang ? (g(), o("span", ht, S(e.lang), 1)) : a("", !0)], !0)]), s("div", gt, [e.allowWrap ? E((g(), o("button", {
|
|
2014
|
+
key: 0,
|
|
2015
|
+
type: "button",
|
|
2016
|
+
class: f(["code-action-btn", { active: l.value }]),
|
|
2017
|
+
onClick: h,
|
|
2018
|
+
"aria-label": l.value ? "Unwrap lines (Scroll mode)" : "Wrap lines (Word-wrap mode)"
|
|
2019
|
+
}, [l.value ? (g(), o("svg", yt, [...n[1] ||= [
|
|
2020
|
+
s("line", {
|
|
2021
|
+
x1: "3",
|
|
2022
|
+
y1: "6",
|
|
2023
|
+
x2: "21",
|
|
2024
|
+
y2: "6"
|
|
2025
|
+
}, null, -1),
|
|
2026
|
+
s("line", {
|
|
2027
|
+
x1: "3",
|
|
2028
|
+
y1: "12",
|
|
2029
|
+
x2: "21",
|
|
2030
|
+
y2: "12"
|
|
2031
|
+
}, null, -1),
|
|
2032
|
+
s("line", {
|
|
2033
|
+
x1: "3",
|
|
2034
|
+
y1: "18",
|
|
2035
|
+
x2: "21",
|
|
2036
|
+
y2: "18"
|
|
2037
|
+
}, null, -1)
|
|
2038
|
+
]])) : (g(), o("svg", vt, [...n[0] ||= [s("polyline", { points: "9 10 4 15 9 20" }, null, -1), s("path", { d: "M20 4v7a4 4 0 0 1-4 4H4" }, null, -1)]]))], 10, _t)), [[r, l.value ? "Unwrap lines (Scroll)" : "Wrap lines"]]) : a("", !0), e.allowCopy ? E((g(), o("button", {
|
|
2039
|
+
key: 1,
|
|
2040
|
+
type: "button",
|
|
2041
|
+
class: f(["code-action-btn", { copied: u.value }]),
|
|
2042
|
+
onClick: _,
|
|
2043
|
+
"aria-label": u.value ? "Copied to clipboard" : "Copy code to clipboard"
|
|
2044
|
+
}, [u.value ? (g(), o("svg", St, [...n[3] ||= [s("polyline", { points: "20 6 9 17 4 12" }, null, -1)]])) : (g(), o("svg", xt, [...n[2] ||= [s("rect", {
|
|
2045
|
+
x: "9",
|
|
2046
|
+
y: "9",
|
|
2047
|
+
width: "13",
|
|
2048
|
+
height: "13",
|
|
2049
|
+
rx: "2",
|
|
2050
|
+
ry: "2"
|
|
2051
|
+
}, null, -1), s("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" }, null, -1)]]))], 10, bt)), [[r, u.value ? "Copied!" : "Copy code"]]) : a("", !0)])])) : a("", !0), s("div", {
|
|
2052
|
+
class: "code-block-body",
|
|
2053
|
+
style: p({ maxHeight: y.value })
|
|
2054
|
+
}, [s("pre", {
|
|
2055
|
+
ref_key: "preRef",
|
|
2056
|
+
ref: d,
|
|
2057
|
+
class: "code-block-pre"
|
|
2058
|
+
}, [s("code", null, [b(t.$slots, "default", {}, () => [c(S(e.code), 1)], !0)])], 512)], 4)], 2);
|
|
2059
|
+
};
|
|
2060
|
+
}
|
|
2061
|
+
}, [["__scopeId", "data-v-9bc464f3"]]), Z = {
|
|
2062
|
+
instant: 100,
|
|
2063
|
+
fast: 150,
|
|
2064
|
+
normal: 200,
|
|
2065
|
+
toggle: 250,
|
|
2066
|
+
slow: 300,
|
|
2067
|
+
ripple: 600
|
|
2068
|
+
}, Q = {
|
|
2069
|
+
standard: "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
2070
|
+
smooth: "cubic-bezier(0.16, 1, 0.3, 1)",
|
|
2071
|
+
easeOut: "cubic-bezier(0, 0, 0.2, 1)",
|
|
2072
|
+
easeIn: "cubic-bezier(0.4, 0, 1, 1)",
|
|
2073
|
+
spring: "cubic-bezier(0.175, 0.885, 0.32, 1.275)",
|
|
2074
|
+
linear: "linear"
|
|
2075
|
+
}, $ = {
|
|
2076
|
+
interactive: {
|
|
2077
|
+
duration: Z.fast,
|
|
2078
|
+
ease: Q.standard,
|
|
2079
|
+
css: `${Z.fast}ms ${Q.standard}`
|
|
2080
|
+
},
|
|
2081
|
+
toggle: {
|
|
2082
|
+
duration: Z.toggle,
|
|
2083
|
+
ease: Q.standard,
|
|
2084
|
+
css: `${Z.toggle}ms ${Q.standard}`
|
|
2085
|
+
},
|
|
2086
|
+
tooltip: {
|
|
2087
|
+
duration: Z.normal,
|
|
2088
|
+
ease: Q.smooth,
|
|
2089
|
+
css: `${Z.normal}ms ${Q.smooth}`
|
|
2090
|
+
},
|
|
2091
|
+
header: {
|
|
2092
|
+
duration: Z.normal,
|
|
2093
|
+
ease: Q.smooth,
|
|
2094
|
+
css: `${Z.normal}ms ${Q.smooth}`
|
|
2095
|
+
},
|
|
2096
|
+
chart: {
|
|
2097
|
+
duration: Z.toggle,
|
|
2098
|
+
ease: Q.standard,
|
|
2099
|
+
css: `${Z.toggle}ms ${Q.standard}`
|
|
2100
|
+
},
|
|
2101
|
+
modal: {
|
|
2102
|
+
backdrop: {
|
|
2103
|
+
duration: Z.toggle,
|
|
2104
|
+
ease: Q.easeOut,
|
|
2105
|
+
css: `${Z.toggle}ms ${Q.easeOut}`
|
|
2106
|
+
},
|
|
2107
|
+
enter: {
|
|
2108
|
+
duration: Z.slow,
|
|
2109
|
+
ease: Q.spring,
|
|
2110
|
+
css: `${Z.slow}ms ${Q.spring}`
|
|
2111
|
+
},
|
|
2112
|
+
leave: {
|
|
2113
|
+
duration: Z.normal,
|
|
2114
|
+
ease: Q.easeIn,
|
|
2115
|
+
css: `${Z.normal}ms ${Q.easeIn}`
|
|
2116
|
+
}
|
|
2117
|
+
},
|
|
2118
|
+
ripple: {
|
|
2119
|
+
duration: Z.ripple,
|
|
2120
|
+
ease: Q.linear,
|
|
2121
|
+
css: `${Z.ripple}ms ${Q.linear}`
|
|
2122
|
+
}
|
|
2123
|
+
}, wt = {
|
|
2124
|
+
"--nano-duration-fast": `${Z.fast}ms`,
|
|
2125
|
+
"--nano-duration": `${Z.normal}ms`,
|
|
2126
|
+
"--nano-duration-toggle": `${Z.toggle}ms`,
|
|
2127
|
+
"--nano-duration-slow": `${Z.slow}ms`,
|
|
2128
|
+
"--nano-duration-ripple": `${Z.ripple}ms`,
|
|
2129
|
+
"--nano-ease-standard": Q.standard,
|
|
2130
|
+
"--nano-ease-smooth": Q.smooth,
|
|
2131
|
+
"--nano-ease-spring": Q.spring,
|
|
2132
|
+
"--nano-transition-interactive": $.interactive.css,
|
|
2133
|
+
"--nano-transition-toggle": $.toggle.css,
|
|
2134
|
+
"--nano-transition-tooltip": $.tooltip.css,
|
|
2135
|
+
"--nano-transition-header": $.header.css,
|
|
2136
|
+
"--nano-transition-chart": $.chart.css,
|
|
2137
|
+
"--nano-transition-modal-backdrop": $.modal.backdrop.css,
|
|
2138
|
+
"--nano-transition-modal-enter": $.modal.enter.css,
|
|
2139
|
+
"--nano-transition-modal-leave": $.modal.leave.css,
|
|
2140
|
+
"--nano-transition-ripple": $.ripple.css
|
|
2141
|
+
};
|
|
1377
2142
|
//#endregion
|
|
1378
2143
|
//#region src/index.js
|
|
1379
2144
|
k.init("nano-ui", "https://analytics.7u.pl");
|
|
1380
|
-
var
|
|
1381
|
-
e.directive("ripple", A), e.directive("tooltip", P), e.component("GlobalTooltip", I), e.component("NanoModal", V), e.component("ThreeDDonutChart",
|
|
2145
|
+
var Tt = { install(e) {
|
|
2146
|
+
e.directive("ripple", A), e.directive("tooltip", P), e.component("GlobalTooltip", I), e.component("NanoModal", V), e.component("ThreeDDonutChart", We), e.component("PrecisionScrubber", Ze), e.component("TopologyRadar", at), e.component("MutatingHeader", W), e.component("NanoSwitch", ct), e.component("KineticRotator", dt), e.component("NanoCodeBlock", Ct);
|
|
1382
2147
|
} };
|
|
1383
2148
|
//#endregion
|
|
1384
|
-
export { I as GlobalTooltip, V as NanoModal,
|
|
2149
|
+
export { I as GlobalTooltip, dt as KineticRotator, W as MutatingHeader, Ct as NanoCodeBlock, V as NanoModal, ct as NanoSwitch, Ze as PrecisionScrubber, A as Ripple, We as ThreeDDonutChart, at as TopologyRadar, Tt as default, Z as durations, Q as easings, N as hideTooltip, M as showTooltip, P as tooltipDirective, j as tooltipState, wt as transitionVariables, $ as transitions };
|