@orchidui/dashboard 1.94.0 → 1.95.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ref as
|
|
1
|
+
import { ref as f, computed as b, watch as x, nextTick as _, createElementBlock as d, openBlock as m, createElementVNode as o, createCommentVNode as L, toDisplayString as n, Fragment as S, renderList as C, normalizeStyle as O } from "vue";
|
|
2
2
|
import { u as k } from "./useChart-D5nAyTGV.js";
|
|
3
|
-
const
|
|
3
|
+
const F = { class: "flex flex-col items-center justify-center" }, V = { class: "relative w-[210px] h-[210px]" }, j = { class: "absolute inset-0 flex flex-col items-center justify-center pointer-events-none" }, N = { class: "text-center" }, P = { class: "text-oc-text-400" }, T = { class: "text-lg font-semibold font-reddit-mono" }, B = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "mt-4 flex flex-wrap gap-3 justify-center"
|
|
6
6
|
}, $ = { class: "text-sm" }, I = {
|
|
@@ -26,15 +26,15 @@ const V = { class: "flex flex-col items-center justify-center" }, F = { class: "
|
|
|
26
26
|
}
|
|
27
27
|
},
|
|
28
28
|
setup(l) {
|
|
29
|
-
const t = l, r =
|
|
30
|
-
|
|
31
|
-
maximumFractionDigits: 2
|
|
32
|
-
|
|
29
|
+
const t = l, r = f(""), i = f(0), g = (e) => (typeof e == "number" ? e : Number(e)).toLocaleString(
|
|
30
|
+
"en-US",
|
|
31
|
+
t.currency ? { minimumFractionDigits: 2, maximumFractionDigits: 2 } : { minimumFractionDigits: 0, maximumFractionDigits: 0 }
|
|
32
|
+
), h = (e) => {
|
|
33
33
|
const a = typeof e == "number" ? e : Number(e);
|
|
34
|
-
return
|
|
35
|
-
},
|
|
36
|
-
r.value = t.totalLabel,
|
|
37
|
-
},
|
|
34
|
+
return s.value ? Math.round(a / s.value * 100) : 0;
|
|
35
|
+
}, s = b(() => !t.chartData || t.chartData.length === 0 ? 0 : t.chartData.reduce((e, a) => e + (a.value || 0), 0)), v = () => {
|
|
36
|
+
r.value = t.totalLabel, i.value = s.value;
|
|
37
|
+
}, D = b(() => ({
|
|
38
38
|
tooltip: t.tooltip,
|
|
39
39
|
series: [
|
|
40
40
|
{
|
|
@@ -75,15 +75,15 @@ const V = { class: "flex flex-col items-center justify-center" }, F = { class: "
|
|
|
75
75
|
...t.additionalOptions ? t.additionalOptions : {}
|
|
76
76
|
}
|
|
77
77
|
]
|
|
78
|
-
})), p =
|
|
78
|
+
})), p = f(), { chart: y } = k(p, D), w = (e) => t.chartData[e].itemStyle.color;
|
|
79
79
|
return x(y, async (e) => {
|
|
80
80
|
e && (await _(), v(), e.on("mouseover", "series", (a) => {
|
|
81
81
|
if (a.componentType === "series" && a.seriesType === "pie") {
|
|
82
82
|
const c = a.name || "Unknown", u = a.value || 0;
|
|
83
|
-
r.value = `${c} (${
|
|
83
|
+
r.value = `${c} (${h(u)}%)`, i.value = a.value || 0;
|
|
84
84
|
}
|
|
85
85
|
}), e.on("mouseout", "series", () => {
|
|
86
|
-
r.value = t.totalLabel,
|
|
86
|
+
r.value = t.totalLabel, i.value = s.value;
|
|
87
87
|
}));
|
|
88
88
|
}), x(
|
|
89
89
|
() => t.chartData,
|
|
@@ -91,8 +91,8 @@ const V = { class: "flex flex-col items-center justify-center" }, F = { class: "
|
|
|
91
91
|
y.value && v();
|
|
92
92
|
},
|
|
93
93
|
{ deep: !0 }
|
|
94
|
-
), (e, a) => (
|
|
95
|
-
o("div",
|
|
94
|
+
), (e, a) => (m(), d("div", F, [
|
|
95
|
+
o("div", V, [
|
|
96
96
|
o("div", {
|
|
97
97
|
ref_key: "pieChart",
|
|
98
98
|
ref: p,
|
|
@@ -101,20 +101,20 @@ const V = { class: "flex flex-col items-center justify-center" }, F = { class: "
|
|
|
101
101
|
o("div", j, [
|
|
102
102
|
o("div", N, [
|
|
103
103
|
o("div", P, n(r.value), 1),
|
|
104
|
-
o("div", T, n(l.currency) + " " + n(g(
|
|
104
|
+
o("div", T, n(l.currency) + " " + n(g(i.value)), 1)
|
|
105
105
|
])
|
|
106
106
|
])
|
|
107
107
|
]),
|
|
108
|
-
l.chartData && l.chartData.length > 0 ? (
|
|
109
|
-
(
|
|
108
|
+
l.chartData && l.chartData.length > 0 ? (m(), d("div", B, [
|
|
109
|
+
(m(!0), d(S, null, C(l.chartData, (c, u) => (m(), d("div", {
|
|
110
110
|
key: u,
|
|
111
111
|
class: "flex items-center gap-2 cursor-pointer hover:opacity-80 transition-opacity"
|
|
112
112
|
}, [
|
|
113
113
|
o("div", {
|
|
114
114
|
class: "w-3 h-3 rounded-full",
|
|
115
|
-
style: O({ backgroundColor:
|
|
115
|
+
style: O({ backgroundColor: w(u) })
|
|
116
116
|
}, null, 4),
|
|
117
|
-
o("span", $, n(c.name) + " " + n(l.showPercentInLabel ? `(${
|
|
117
|
+
o("span", $, n(c.name) + " " + n(l.showPercentInLabel ? `(${h(c.value)}%)` : ""), 1)
|
|
118
118
|
]))), 128))
|
|
119
119
|
])) : L("", !0)
|
|
120
120
|
]));
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orchidui/dashboard",
|
|
3
3
|
"description": "Orchid Dashboard UI , Dashboard Ui Library Vue 3 tailwind css",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.95.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "vite build"
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"rollup": "npm:@rollup/wasm-node"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@orchidui/core": "1.
|
|
36
|
+
"@orchidui/core": "1.95.0",
|
|
37
37
|
"dayjs": "^1.11.10",
|
|
38
38
|
"echarts": "^5.4.3",
|
|
39
39
|
"lottie-web": "^5.12.2",
|