@gkucmierz/nano-ui 1.6.0 → 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 +448 -103
- package/dist/nano-ui.svg +54 -0
- package/package.json +2 -1
package/dist/nano-ui.js
CHANGED
|
@@ -176,17 +176,23 @@ var P = {
|
|
|
176
176
|
}, I = /* @__PURE__ */ F({
|
|
177
177
|
__name: "GlobalTooltip",
|
|
178
178
|
setup(e) {
|
|
179
|
-
let t = v(null), n = v(0), r = v(0), i = v(0), a = v(!1)
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
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);
|
|
190
196
|
}), (e, s) => (g(), o("div", {
|
|
191
197
|
ref_key: "tooltipRef",
|
|
192
198
|
ref: t,
|
|
@@ -204,7 +210,7 @@ var P = {
|
|
|
204
210
|
})
|
|
205
211
|
}, S(C(j).text), 7));
|
|
206
212
|
}
|
|
207
|
-
}, [["__scopeId", "data-v-
|
|
213
|
+
}, [["__scopeId", "data-v-d7961ba4"]]), L = { class: "nano-modal-title" }, R = {
|
|
208
214
|
key: 1,
|
|
209
215
|
class: "nano-modal-body"
|
|
210
216
|
}, z = {
|
|
@@ -631,10 +637,10 @@ var P = {
|
|
|
631
637
|
});
|
|
632
638
|
}), V = r(() => A.value.reduce((e, t) => e + t.value, 0)), We = r(() => {
|
|
633
639
|
if (c.centerValue !== void 0 && c.centerValue !== "") return c.centerValue;
|
|
634
|
-
let e =
|
|
640
|
+
let e = X.value.find((e) => e.item.id === C.value);
|
|
635
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);
|
|
636
642
|
}), Ge = r(() => {
|
|
637
|
-
let e =
|
|
643
|
+
let e = X.value.find((e) => e.item.id === C.value);
|
|
638
644
|
return e ? R(e.item.name, 12).toUpperCase() : (c.centerLabel || "").toUpperCase();
|
|
639
645
|
}), Ke = (e, t = !1) => {
|
|
640
646
|
let n = new Map(A.value.map((e) => [e.id, e])), r = new Map(e.map((e) => [e.id, e])), i = [];
|
|
@@ -695,22 +701,22 @@ var P = {
|
|
|
695
701
|
l < o ? (o = l, a = e, s = u) : l === o && u < s && (a = e, s = u);
|
|
696
702
|
}
|
|
697
703
|
return a;
|
|
698
|
-
}, Je = r(() => c.autoRotate && B.value && B.value.length > 0 ? qe(B.value, c.rotationAngle) : c.rotationAngle),
|
|
699
|
-
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;
|
|
700
706
|
return 13 + 6 * Math.max(0, Math.min(1, e));
|
|
701
|
-
}),
|
|
702
|
-
let e = (
|
|
707
|
+
}), it = r(() => {
|
|
708
|
+
let e = (W.value - 48) / 132;
|
|
703
709
|
return 7 + 1.5 * Math.max(0, Math.min(1, e));
|
|
704
|
-
}),
|
|
710
|
+
}), at = r(() => U.value - J.value / 2), X = r(() => {
|
|
705
711
|
let e = A.value, t = V.value;
|
|
706
712
|
if (t === 0) return [];
|
|
707
|
-
let n = [], r =
|
|
708
|
-
|
|
709
|
-
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);
|
|
710
716
|
if (f.length === 1) {
|
|
711
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 = "";
|
|
712
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`);
|
|
713
|
-
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;
|
|
714
720
|
return [{
|
|
715
721
|
item: t,
|
|
716
722
|
index: n,
|
|
@@ -838,17 +844,17 @@ var P = {
|
|
|
838
844
|
}), n.sort((e, t) => e.midY - t.midY);
|
|
839
845
|
}), ot = r(() => {
|
|
840
846
|
let e = /* @__PURE__ */ new Set(), t = [];
|
|
841
|
-
return
|
|
847
|
+
return X.value.forEach((n) => {
|
|
842
848
|
e.has(n.item.id) || (e.add(n.item.id), t.push(n));
|
|
843
849
|
}), t;
|
|
844
850
|
}), st = (e) => C.value === e.item.id ? { transform: `translate(${10 * Math.cos(e.originalMidAngle)}px, ${10 * Math.sin(e.originalMidAngle)}px)` } : {}, ct = r(() => {
|
|
845
|
-
if (
|
|
851
|
+
if (Y.value <= .001) return {
|
|
846
852
|
left: [],
|
|
847
853
|
right: []
|
|
848
854
|
};
|
|
849
855
|
let e = [], t = [];
|
|
850
856
|
return ot.value.forEach((n) => {
|
|
851
|
-
let r = Math.cos(n.originalMidAngle) < 0, i = Math.sin(n.originalMidAngle) > 0, a =
|
|
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 = {
|
|
852
858
|
item: n.item,
|
|
853
859
|
index: n.index,
|
|
854
860
|
color: n.color,
|
|
@@ -866,40 +872,40 @@ var P = {
|
|
|
866
872
|
left: e,
|
|
867
873
|
right: t
|
|
868
874
|
};
|
|
869
|
-
}),
|
|
875
|
+
}), lt = r(() => ct.value.left), ut = r(() => ct.value.right), dt = (e) => {
|
|
870
876
|
let t = C.value === e.item.id, n = e.x0, r = e.y0, i = e.finalY;
|
|
871
877
|
if (t) {
|
|
872
878
|
let t = 10 * Math.cos(e.originalMidAngle || 0), a = 10 * Math.sin(e.originalMidAngle || 0);
|
|
873
879
|
n += t, r += a, i -= 5;
|
|
874
880
|
}
|
|
875
|
-
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);
|
|
876
882
|
return `M ${n} ${r} C ${a} ${o}, ${f} ${c ? Math.min(o, i) : Math.max(o, i)}, ${s ? 90 : 670} ${i}`;
|
|
877
|
-
},
|
|
883
|
+
}, ft = (e = 450) => {
|
|
878
884
|
if (c.currentLowFxMode || c.immediate) {
|
|
879
885
|
A.value.forEach((e) => {
|
|
880
886
|
e.value = e.targetValue, e.percentage = e.targetPercentage === void 0 ? 0 : e.targetPercentage;
|
|
881
|
-
}), A.value = A.value.filter((e) => e.targetValue > 0),
|
|
887
|
+
}), A.value = A.value.filter((e) => e.targetValue > 0), Ye.value = Je.value;
|
|
882
888
|
let e = c.is3D;
|
|
883
|
-
|
|
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);
|
|
884
890
|
let t = c.isExpanded && e ? 32 : 0;
|
|
885
|
-
|
|
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;
|
|
886
892
|
return;
|
|
887
893
|
}
|
|
888
|
-
u && cancelAnimationFrame(u),
|
|
889
|
-
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) => {
|
|
890
896
|
let g = c - t, C = Math.min(1, g / e), k = 1 - (1 - C) ** 3;
|
|
891
897
|
A.value.forEach((e) => {
|
|
892
898
|
e.value = e.startValue + (e.targetValue - e.startValue) * k;
|
|
893
899
|
let t = e.startPercentage === void 0 ? 0 : e.startPercentage, n = e.targetPercentage === void 0 ? 0 : e.targetPercentage;
|
|
894
900
|
e.percentage = Math.round(t + (n - t) * k);
|
|
895
|
-
}),
|
|
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) => {
|
|
896
902
|
e.value = e.targetValue, e.percentage = e.targetPercentage === void 0 ? 0 : e.targetPercentage;
|
|
897
|
-
}), 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);
|
|
898
904
|
};
|
|
899
905
|
u = requestAnimationFrame(O);
|
|
900
|
-
},
|
|
906
|
+
}, pt = (e) => {
|
|
901
907
|
if (e.isSingleSlice) return !0;
|
|
902
|
-
let t =
|
|
908
|
+
let t = X.value, n = -1;
|
|
903
909
|
for (let r = t.length - 1; r >= 0; r--) if (t[r].item.id === e.item.id) {
|
|
904
910
|
n = r;
|
|
905
911
|
break;
|
|
@@ -908,46 +914,46 @@ var P = {
|
|
|
908
914
|
};
|
|
909
915
|
return w(B, (e) => {
|
|
910
916
|
let t = c.immediate || c.currentLowFxMode;
|
|
911
|
-
Ke(e || [], t), t ||
|
|
917
|
+
Ke(e || [], t), t || ft();
|
|
912
918
|
}, {
|
|
913
919
|
deep: !0,
|
|
914
920
|
immediate: !0
|
|
915
921
|
}), w(() => c.rotationAngle, () => {
|
|
916
|
-
|
|
917
|
-
|
|
922
|
+
Ze.value = !0, Qe && clearTimeout(Qe), Qe = setTimeout(() => {
|
|
923
|
+
Ze.value = !1;
|
|
918
924
|
}, 100);
|
|
919
925
|
}), w(Je, (e) => {
|
|
920
|
-
c.immediate || c.currentLowFxMode ?
|
|
926
|
+
c.immediate || c.currentLowFxMode ? Ye.value = e : ft();
|
|
921
927
|
}), w(() => c.isExpanded, () => {
|
|
922
928
|
d(() => {
|
|
923
|
-
|
|
929
|
+
ft();
|
|
924
930
|
});
|
|
925
931
|
}), w(() => c.is3D, () => {
|
|
926
932
|
d(() => {
|
|
927
|
-
|
|
933
|
+
ft();
|
|
928
934
|
});
|
|
929
935
|
}), w(() => c.showLabels, () => {
|
|
930
936
|
d(() => {
|
|
931
|
-
|
|
937
|
+
ft();
|
|
932
938
|
});
|
|
933
939
|
}), w(() => c.slopeRatio, (e) => {
|
|
934
940
|
if (c.is3D) {
|
|
935
|
-
|
|
941
|
+
G.value = c.isExpanded ? 180 * e : 48;
|
|
936
942
|
let t = c.isExpanded ? 180 : 48, n = c.isExpanded ? 180 * e : 48;
|
|
937
|
-
|
|
943
|
+
K.value = t * (1 - c.thickness), q.value = n * (1 - c.thickness);
|
|
938
944
|
let r = c.isExpanded ? 32 : 0;
|
|
939
|
-
|
|
945
|
+
J.value = e > .5 ? r * (2 - 2 * e) : r;
|
|
940
946
|
}
|
|
941
947
|
}), w(() => c.thickness, (e) => {
|
|
942
948
|
let t = c.is3D, n = c.isExpanded ? 180 : 48, r = c.isExpanded ? t ? 180 * c.slopeRatio : 180 : t ? 48 * c.slopeRatio : 48;
|
|
943
|
-
|
|
949
|
+
K.value = n * (1 - e), q.value = r * (1 - e);
|
|
944
950
|
}), w(() => c.hoveredItemId, (e) => {
|
|
945
951
|
_.value !== e && (_.value = e);
|
|
946
952
|
}), w(_, (e) => {
|
|
947
953
|
c.hoveredItemId !== e && l("update:hoveredItemId", e);
|
|
948
954
|
}), m(() => {
|
|
949
955
|
document.addEventListener("click", k), d(() => {
|
|
950
|
-
|
|
956
|
+
ft();
|
|
951
957
|
});
|
|
952
958
|
}), h(() => {
|
|
953
959
|
document.removeEventListener("click", k), u && cancelAnimationFrame(u);
|
|
@@ -960,10 +966,10 @@ var P = {
|
|
|
960
966
|
ref: O,
|
|
961
967
|
class: f(["donut-canvas-wrapper", {
|
|
962
968
|
"is-expanded": t.isExpanded,
|
|
963
|
-
"no-transitions":
|
|
969
|
+
"no-transitions": Xe.value || Ze.value || t.immediate
|
|
964
970
|
}])
|
|
965
971
|
}, [(g(), o("svg", {
|
|
966
|
-
viewBox: `0 0 ${
|
|
972
|
+
viewBox: `0 0 ${tt.value} ${nt.value}`,
|
|
967
973
|
class: "items-svg-chart",
|
|
968
974
|
xmlns: "http://www.w3.org/2000/svg"
|
|
969
975
|
}, [B.value && B.value.length > 0 ? (g(), o("defs", te, [
|
|
@@ -1021,7 +1027,7 @@ var P = {
|
|
|
1021
1027
|
"text-anchor": "middle",
|
|
1022
1028
|
"dominant-baseline": "middle"
|
|
1023
1029
|
}, S(t.emptyText || "No data"), 9, fe)])) : (g(), o("g", pe, [
|
|
1024
|
-
(g(!0), o(e, null, y(
|
|
1030
|
+
(g(!0), o(e, null, y(X.value.filter((e) => e.midY < at.value), (e) => (g(), o("g", {
|
|
1025
1031
|
key: "slice-sub-back-" + e.item.id + "-" + e.midAngle,
|
|
1026
1032
|
class: f(["slice-group-3d", {
|
|
1027
1033
|
"is-hovered": C.value === e.item.id,
|
|
@@ -1065,12 +1071,12 @@ var P = {
|
|
|
1065
1071
|
"stroke-width": "0.8",
|
|
1066
1072
|
"stroke-linejoin": "round"
|
|
1067
1073
|
}, null, 8, ye)) : a("", !0),
|
|
1068
|
-
|
|
1074
|
+
pt(e) ? (g(), o("path", {
|
|
1069
1075
|
key: 6,
|
|
1070
1076
|
d: e.originalTopPath,
|
|
1071
1077
|
fill: `url(#top-grad-${z(e.item.id)})`
|
|
1072
1078
|
}, null, 8, be)) : a("", !0),
|
|
1073
|
-
|
|
1079
|
+
pt(e) ? (g(), o("path", {
|
|
1074
1080
|
key: 7,
|
|
1075
1081
|
d: e.topStrokePath,
|
|
1076
1082
|
fill: "none",
|
|
@@ -1078,7 +1084,7 @@ var P = {
|
|
|
1078
1084
|
"stroke-width": "0.8",
|
|
1079
1085
|
"stroke-linejoin": "round"
|
|
1080
1086
|
}, null, 8, xe)) : a("", !0),
|
|
1081
|
-
|
|
1087
|
+
pt(e) ? (g(), o("path", {
|
|
1082
1088
|
key: 8,
|
|
1083
1089
|
d: e.topStrokePath,
|
|
1084
1090
|
fill: "none",
|
|
@@ -1089,13 +1095,13 @@ var P = {
|
|
|
1089
1095
|
], 6))), 128)),
|
|
1090
1096
|
c.showCenterText ? (g(), o("g", {
|
|
1091
1097
|
key: 0,
|
|
1092
|
-
transform: `translate(${
|
|
1098
|
+
transform: `translate(${H.value}, ${U.value})`,
|
|
1093
1099
|
class: "center-text-group"
|
|
1094
1100
|
}, [s("text", {
|
|
1095
1101
|
x: "0",
|
|
1096
1102
|
y: "-3",
|
|
1097
1103
|
class: "center-text-value",
|
|
1098
|
-
"font-size":
|
|
1104
|
+
"font-size": rt.value,
|
|
1099
1105
|
"font-weight": "bold",
|
|
1100
1106
|
"font-family": "'JetBrains Mono', monospace",
|
|
1101
1107
|
"text-anchor": "middle",
|
|
@@ -1104,13 +1110,13 @@ var P = {
|
|
|
1104
1110
|
x: "0",
|
|
1105
1111
|
y: "10",
|
|
1106
1112
|
class: "center-text-label",
|
|
1107
|
-
"font-size":
|
|
1113
|
+
"font-size": it.value,
|
|
1108
1114
|
"font-family": "system-ui, -apple-system, sans-serif",
|
|
1109
1115
|
"font-weight": "600",
|
|
1110
1116
|
"text-anchor": "middle",
|
|
1111
1117
|
"dominant-baseline": "middle"
|
|
1112
1118
|
}, S(Ge.value), 9, Te)], 8, Ce)) : a("", !0),
|
|
1113
|
-
(g(!0), o(e, null, y(
|
|
1119
|
+
(g(!0), o(e, null, y(X.value.filter((e) => e.midY >= at.value), (e) => (g(), o("g", {
|
|
1114
1120
|
key: "slice-sub-front-" + e.item.id + "-" + e.midAngle,
|
|
1115
1121
|
class: f(["slice-group-3d", {
|
|
1116
1122
|
"is-hovered": C.value === e.item.id,
|
|
@@ -1154,12 +1160,12 @@ var P = {
|
|
|
1154
1160
|
"stroke-width": "0.8",
|
|
1155
1161
|
"stroke-linejoin": "round"
|
|
1156
1162
|
}, null, 8, je)) : a("", !0),
|
|
1157
|
-
|
|
1163
|
+
pt(e) ? (g(), o("path", {
|
|
1158
1164
|
key: 6,
|
|
1159
1165
|
d: e.originalTopPath,
|
|
1160
1166
|
fill: `url(#top-grad-${z(e.item.id)})`
|
|
1161
1167
|
}, null, 8, Me)) : a("", !0),
|
|
1162
|
-
|
|
1168
|
+
pt(e) ? (g(), o("path", {
|
|
1163
1169
|
key: 7,
|
|
1164
1170
|
d: e.topStrokePath,
|
|
1165
1171
|
fill: "none",
|
|
@@ -1167,7 +1173,7 @@ var P = {
|
|
|
1167
1173
|
"stroke-width": "0.8",
|
|
1168
1174
|
"stroke-linejoin": "round"
|
|
1169
1175
|
}, null, 8, Ne)) : a("", !0),
|
|
1170
|
-
|
|
1176
|
+
pt(e) ? (g(), o("path", {
|
|
1171
1177
|
key: 8,
|
|
1172
1178
|
d: e.topStrokePath,
|
|
1173
1179
|
fill: "none",
|
|
@@ -1194,10 +1200,10 @@ var P = {
|
|
|
1194
1200
|
s("g", {
|
|
1195
1201
|
class: "labels-layer",
|
|
1196
1202
|
style: p({
|
|
1197
|
-
opacity:
|
|
1198
|
-
pointerEvents:
|
|
1203
|
+
opacity: Y.value,
|
|
1204
|
+
pointerEvents: Y.value > .01 ? "auto" : "none"
|
|
1199
1205
|
})
|
|
1200
|
-
}, [(g(!0), o(e, null, y(
|
|
1206
|
+
}, [(g(!0), o(e, null, y(lt.value, (e, t) => (g(), o("g", {
|
|
1201
1207
|
key: "label-left-" + e.item.id,
|
|
1202
1208
|
class: f(["label-group", {
|
|
1203
1209
|
"is-hovered": C.value === e.item.id,
|
|
@@ -1208,7 +1214,7 @@ var P = {
|
|
|
1208
1214
|
onClick: (t) => E(e.item.id),
|
|
1209
1215
|
style: p({ cursor: c.selectable && !j.value ? "pointer" : "default" })
|
|
1210
1216
|
}, [s("path", {
|
|
1211
|
-
d:
|
|
1217
|
+
d: dt(e),
|
|
1212
1218
|
fill: "none",
|
|
1213
1219
|
stroke: e.color,
|
|
1214
1220
|
"stroke-width": "1.2"
|
|
@@ -1222,7 +1228,7 @@ var P = {
|
|
|
1222
1228
|
"text-anchor": "end",
|
|
1223
1229
|
"dominant-baseline": "middle",
|
|
1224
1230
|
style: p(C.value === e.item.id ? "transform: translate(0, -5px);" : "")
|
|
1225
|
-
}, 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(
|
|
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", {
|
|
1226
1232
|
key: "label-right-" + e.item.id,
|
|
1227
1233
|
class: f(["label-group", {
|
|
1228
1234
|
"is-hovered": C.value === e.item.id,
|
|
@@ -1233,7 +1239,7 @@ var P = {
|
|
|
1233
1239
|
onClick: (t) => E(e.item.id),
|
|
1234
1240
|
style: p({ cursor: c.selectable && !j.value ? "pointer" : "default" })
|
|
1235
1241
|
}, [s("path", {
|
|
1236
|
-
d:
|
|
1242
|
+
d: dt(e),
|
|
1237
1243
|
fill: "none",
|
|
1238
1244
|
stroke: e.color,
|
|
1239
1245
|
"stroke-width": "1.2"
|
|
@@ -1261,7 +1267,7 @@ var P = {
|
|
|
1261
1267
|
"y1",
|
|
1262
1268
|
"x2",
|
|
1263
1269
|
"y2"
|
|
1264
|
-
],
|
|
1270
|
+
], Ye = { class: "nano-scrub-popup-val" }, Xe = { class: "nano-scrub-popup-res" }, Ze = /* @__PURE__ */ F(/* @__PURE__ */ Object.assign({ inheritAttrs: !1 }, {
|
|
1265
1271
|
__name: "PrecisionScrubber",
|
|
1266
1272
|
props: {
|
|
1267
1273
|
modelValue: {
|
|
@@ -1366,21 +1372,21 @@ var P = {
|
|
|
1366
1372
|
})
|
|
1367
1373
|
}, [
|
|
1368
1374
|
c[0] ||= s("div", { class: "nano-scrub-popup-title" }, "Scrubbing Mode", -1),
|
|
1369
|
-
s("div",
|
|
1370
|
-
s("div",
|
|
1375
|
+
s("div", Ye, S(k.value), 1),
|
|
1376
|
+
s("div", Xe, S(E.value), 1)
|
|
1371
1377
|
], 4)
|
|
1372
1378
|
])) : a("", !0)]))], 64));
|
|
1373
1379
|
}
|
|
1374
|
-
}), [["__scopeId", "data-v-21b41bc4"]]),
|
|
1380
|
+
}), [["__scopeId", "data-v-21b41bc4"]]), Qe = { class: "header-inner" }, $e = {
|
|
1375
1381
|
key: 0,
|
|
1376
1382
|
class: "header-left"
|
|
1377
|
-
},
|
|
1383
|
+
}, H = {
|
|
1378
1384
|
key: 1,
|
|
1379
1385
|
class: "header-center"
|
|
1380
|
-
},
|
|
1386
|
+
}, U = {
|
|
1381
1387
|
key: 2,
|
|
1382
1388
|
class: "header-right"
|
|
1383
|
-
},
|
|
1389
|
+
}, W = /* @__PURE__ */ F({
|
|
1384
1390
|
__name: "MutatingHeader",
|
|
1385
1391
|
props: {
|
|
1386
1392
|
threshold: {
|
|
@@ -1451,39 +1457,39 @@ var P = {
|
|
|
1451
1457
|
"--floating-margin": e.floatingMargin,
|
|
1452
1458
|
"--floating-radius": e.floatingRadius
|
|
1453
1459
|
})
|
|
1454
|
-
}, [s("div",
|
|
1455
|
-
t.$slots.left ? (g(), o("div",
|
|
1456
|
-
t.$slots.center ? (g(), o("div",
|
|
1457
|
-
t.$slots.right ? (g(), o("div",
|
|
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),
|
|
1458
1464
|
!t.$slots.left && !t.$slots.center && !t.$slots.right ? b(t.$slots, "default", {
|
|
1459
1465
|
key: 3,
|
|
1460
1466
|
isStuck: l.value
|
|
1461
1467
|
}, void 0, !0) : a("", !0)
|
|
1462
1468
|
])], 6));
|
|
1463
1469
|
}
|
|
1464
|
-
}, [["__scopeId", "data-v-fd47d0d0"]]),
|
|
1470
|
+
}, [["__scopeId", "data-v-fd47d0d0"]]), G = [
|
|
1465
1471
|
"viewBox",
|
|
1466
1472
|
"width",
|
|
1467
1473
|
"height"
|
|
1468
|
-
],
|
|
1474
|
+
], K = ["points"], q = ["points"], et = ["points"], J = ["points"], tt = [
|
|
1469
1475
|
"x1",
|
|
1470
1476
|
"y1",
|
|
1471
1477
|
"x2",
|
|
1472
1478
|
"y2"
|
|
1473
|
-
],
|
|
1479
|
+
], nt = ["x", "y"], Y = [
|
|
1474
1480
|
"points",
|
|
1475
1481
|
"fill",
|
|
1476
1482
|
"stroke",
|
|
1477
1483
|
"opacity"
|
|
1478
|
-
],
|
|
1484
|
+
], rt = [
|
|
1479
1485
|
"points",
|
|
1480
1486
|
"fill",
|
|
1481
1487
|
"stroke"
|
|
1482
|
-
],
|
|
1488
|
+
], it = [
|
|
1483
1489
|
"cx",
|
|
1484
1490
|
"cy",
|
|
1485
1491
|
"fill"
|
|
1486
|
-
],
|
|
1492
|
+
], at = /* @__PURE__ */ F({
|
|
1487
1493
|
__name: "TopologyRadar",
|
|
1488
1494
|
props: {
|
|
1489
1495
|
size: {
|
|
@@ -1552,25 +1558,25 @@ var P = {
|
|
|
1552
1558
|
fill: "var(--nano-radar-grid-bg, rgba(15,23,42,0.8))",
|
|
1553
1559
|
stroke: "var(--nano-radar-grid-stroke, rgba(255,255,255,0.1))",
|
|
1554
1560
|
"stroke-width": "1"
|
|
1555
|
-
}, null, 8,
|
|
1561
|
+
}, null, 8, K),
|
|
1556
1562
|
s("polygon", {
|
|
1557
1563
|
points: f(.75),
|
|
1558
1564
|
fill: "none",
|
|
1559
1565
|
stroke: "var(--nano-radar-grid-subtle, rgba(255,255,255,0.05))",
|
|
1560
1566
|
"stroke-width": "1"
|
|
1561
|
-
}, null, 8,
|
|
1567
|
+
}, null, 8, q),
|
|
1562
1568
|
s("polygon", {
|
|
1563
1569
|
points: f(.5),
|
|
1564
1570
|
fill: "none",
|
|
1565
1571
|
stroke: "var(--nano-radar-grid-subtle, rgba(255,255,255,0.05))",
|
|
1566
1572
|
"stroke-width": "1"
|
|
1567
|
-
}, null, 8,
|
|
1573
|
+
}, null, 8, et),
|
|
1568
1574
|
s("polygon", {
|
|
1569
1575
|
points: f(.25),
|
|
1570
1576
|
fill: "none",
|
|
1571
1577
|
stroke: "var(--nano-radar-grid-subtle, rgba(255,255,255,0.05))",
|
|
1572
1578
|
"stroke-width": "1"
|
|
1573
|
-
}, null, 8,
|
|
1579
|
+
}, null, 8, J),
|
|
1574
1580
|
(g(!0), o(e, null, y(t.labels, (e, n) => (g(), o("line", {
|
|
1575
1581
|
key: "axis-" + n,
|
|
1576
1582
|
x1: t.size / 2,
|
|
@@ -1579,7 +1585,7 @@ var P = {
|
|
|
1579
1585
|
y2: d(100, n).y,
|
|
1580
1586
|
stroke: "var(--nano-radar-grid-stroke, rgba(255,255,255,0.1))",
|
|
1581
1587
|
"stroke-width": "1"
|
|
1582
|
-
}, null, 8,
|
|
1588
|
+
}, null, 8, tt))), 128)),
|
|
1583
1589
|
(g(!0), o(e, null, y(t.labels, (e, t) => (g(), o("text", {
|
|
1584
1590
|
key: "label-" + t,
|
|
1585
1591
|
x: d(115, t).x,
|
|
@@ -1590,7 +1596,7 @@ var P = {
|
|
|
1590
1596
|
"font-weight": "bold",
|
|
1591
1597
|
"text-anchor": "middle",
|
|
1592
1598
|
"dominant-baseline": "middle"
|
|
1593
|
-
}, S(e), 9,
|
|
1599
|
+
}, S(e), 9, nt))), 128)),
|
|
1594
1600
|
(g(!0), o(e, null, y(t.history, (e, n) => (g(), o("polygon", {
|
|
1595
1601
|
key: "hist-" + n,
|
|
1596
1602
|
points: m(e),
|
|
@@ -1598,7 +1604,7 @@ var P = {
|
|
|
1598
1604
|
stroke: t.color,
|
|
1599
1605
|
"stroke-width": 1,
|
|
1600
1606
|
opacity: .1 + n / Math.max(1, t.history.length) * .4
|
|
1601
|
-
}, null, 8,
|
|
1607
|
+
}, null, 8, Y))), 128)),
|
|
1602
1608
|
t.history.length > 0 ? (g(), o("polygon", {
|
|
1603
1609
|
key: 0,
|
|
1604
1610
|
points: m(t.history[t.history.length - 1]),
|
|
@@ -1606,7 +1612,7 @@ var P = {
|
|
|
1606
1612
|
stroke: t.color,
|
|
1607
1613
|
"stroke-width": "2.5",
|
|
1608
1614
|
style: { filter: "drop-shadow(0 0 8px rgba(0, 229, 255, 0.5))" }
|
|
1609
|
-
}, null, 8,
|
|
1615
|
+
}, null, 8, rt)) : a("", !0),
|
|
1610
1616
|
t.history.length > 0 ? (g(!0), o(e, { key: 1 }, y(t.history[t.history.length - 1], (e, n) => (g(), o("circle", {
|
|
1611
1617
|
key: "pt-" + n,
|
|
1612
1618
|
cx: d(e, n).x,
|
|
@@ -1614,10 +1620,10 @@ var P = {
|
|
|
1614
1620
|
r: "3",
|
|
1615
1621
|
fill: t.color,
|
|
1616
1622
|
style: { filter: "drop-shadow(0 0 5px rgba(0, 229, 255, 0.8))" }
|
|
1617
|
-
}, null, 8,
|
|
1618
|
-
], 8,
|
|
1623
|
+
}, null, 8, it))), 128)) : a("", !0)
|
|
1624
|
+
], 8, G))], 4));
|
|
1619
1625
|
}
|
|
1620
|
-
}, [["__scopeId", "data-v-bb4bd598"]]),
|
|
1626
|
+
}, [["__scopeId", "data-v-bb4bd598"]]), X = ["for"], ot = [
|
|
1621
1627
|
"checked",
|
|
1622
1628
|
"disabled",
|
|
1623
1629
|
"name",
|
|
@@ -1711,9 +1717,348 @@ var P = {
|
|
|
1711
1717
|
}, null, 40, ot),
|
|
1712
1718
|
n[0] ||= s("div", { class: "nano-switch-slider" }, null, -1),
|
|
1713
1719
|
e.label || t.$slots.default ? (g(), o("span", st, [b(t.$slots, "default", {}, () => [c(S(e.label), 1)], !0)])) : a("", !0)
|
|
1714
|
-
], 10,
|
|
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
|
+
};
|
|
1715
2060
|
}
|
|
1716
|
-
}, [["__scopeId", "data-v-
|
|
2061
|
+
}, [["__scopeId", "data-v-9bc464f3"]]), Z = {
|
|
1717
2062
|
instant: 100,
|
|
1718
2063
|
fast: 150,
|
|
1719
2064
|
normal: 200,
|
|
@@ -1775,7 +2120,7 @@ var P = {
|
|
|
1775
2120
|
ease: Q.linear,
|
|
1776
2121
|
css: `${Z.ripple}ms ${Q.linear}`
|
|
1777
2122
|
}
|
|
1778
|
-
},
|
|
2123
|
+
}, wt = {
|
|
1779
2124
|
"--nano-duration-fast": `${Z.fast}ms`,
|
|
1780
2125
|
"--nano-duration": `${Z.normal}ms`,
|
|
1781
2126
|
"--nano-duration-toggle": `${Z.toggle}ms`,
|
|
@@ -1797,8 +2142,8 @@ var P = {
|
|
|
1797
2142
|
//#endregion
|
|
1798
2143
|
//#region src/index.js
|
|
1799
2144
|
k.init("nano-ui", "https://analytics.7u.pl");
|
|
1800
|
-
var
|
|
1801
|
-
e.directive("ripple", A), e.directive("tooltip", P), e.component("GlobalTooltip", I), e.component("NanoModal", V), e.component("ThreeDDonutChart", We), e.component("PrecisionScrubber",
|
|
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);
|
|
1802
2147
|
} };
|
|
1803
2148
|
//#endregion
|
|
1804
|
-
export { I as GlobalTooltip,
|
|
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 };
|