@orchidui/dashboard 1.51.0 → 1.52.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,5 +1,5 @@
1
1
  import { defineAsyncComponent as e } from "vue";
2
- const r = e(() => import("../../../OcOverviewPieChart-D_5Rlnk-.js"));
2
+ const r = e(() => import("../../../OcOverviewPieChart-D2YLaN_P.js"));
3
3
  export {
4
4
  r as OcOverviewPieChart
5
5
  };
@@ -0,0 +1,100 @@
1
+ import { ref as m, computed as y, watch as x, nextTick as C, createElementBlock as u, openBlock as d, createElementVNode as a, createCommentVNode as F, toDisplayString as f, Fragment as w, renderList as k, normalizeStyle as S } from "vue";
2
+ import { u as V } from "./useChart-D5nAyTGV.js";
3
+ import "./dayjs.min-CTPVfFeV.js";
4
+ const L = { class: "flex flex-col items-center justify-center" }, N = { class: "relative w-[210px] h-[210px]" }, T = { class: "absolute inset-0 flex flex-col items-center justify-center pointer-events-none" }, O = { class: "text-center" }, j = { class: "text-oc-text-400" }, E = { class: "text-lg font-semibold font-reddit-mono" }, P = {
5
+ key: 0,
6
+ class: "mt-4 flex flex-wrap gap-3 justify-center"
7
+ }, z = { class: "text-sm" }, U = {
8
+ __name: "OcOverviewPieChart",
9
+ props: {
10
+ chartData: Array
11
+ },
12
+ setup(r) {
13
+ const o = r, s = m(""), n = m(0), b = (e, t = "SGD") => (typeof e == "number" ? e : Number(e)).toLocaleString("en-US", {
14
+ minimumFractionDigits: 2,
15
+ maximumFractionDigits: 2
16
+ }), _ = (e) => {
17
+ const t = typeof e == "number" ? e : Number(e);
18
+ return l.value ? Math.round(t / l.value * 100) : 0;
19
+ }, l = y(() => !o.chartData || o.chartData.length === 0 ? 0 : o.chartData.reduce((e, t) => e + (t.value || 0), 0)), h = () => {
20
+ s.value = "Total", n.value = l.value;
21
+ }, g = y(() => ({
22
+ series: [{
23
+ id: "overviewPieChart",
24
+ data: o.chartData || [],
25
+ type: "pie",
26
+ radius: ["80%", "100%"],
27
+ avoidLabelOverlap: !1,
28
+ itemStyle: {
29
+ borderRadius: 6,
30
+ borderColor: "#fff",
31
+ borderWidth: 2
32
+ },
33
+ label: {
34
+ show: !1
35
+ // Hide default labels
36
+ },
37
+ labelLine: {
38
+ show: !1
39
+ },
40
+ // Emphasize hovered/active slice and blur others to gray
41
+ emphasis: {
42
+ scale: !1,
43
+ focus: "self",
44
+ label: { show: !1 }
45
+ },
46
+ blur: {
47
+ itemStyle: {
48
+ color: "#F2F2F4"
49
+ // Tailwind gray-200
50
+ },
51
+ label: { show: !1 }
52
+ }
53
+ }]
54
+ })), v = m(), { chart: p } = V(v, g), D = (e) => {
55
+ const t = ["#356DFF", "#AEC5FF", "#86FFCC"];
56
+ return t[e % t.length];
57
+ };
58
+ return x(p, async (e) => {
59
+ e && (await C(), h(), e.on("mouseover", "series", (t) => {
60
+ if (t.componentType === "series" && t.seriesType === "pie") {
61
+ const c = t.name || "Unknown", i = t.value || 0;
62
+ s.value = `${c} (${_(i)}%)`, n.value = t.value || 0;
63
+ }
64
+ }), e.on("mouseout", "series", () => {
65
+ s.value = "Total", n.value = l.value;
66
+ }));
67
+ }), x(() => o.chartData, () => {
68
+ p.value && h();
69
+ }, { deep: !0 }), (e, t) => (d(), u("div", L, [
70
+ a("div", N, [
71
+ a("div", {
72
+ ref_key: "pieChart",
73
+ ref: v,
74
+ class: "w-[210px] h-[210px]"
75
+ }, null, 512),
76
+ a("div", T, [
77
+ a("div", O, [
78
+ a("div", j, f(s.value), 1),
79
+ a("div", E, "SGD " + f(b(n.value)), 1)
80
+ ])
81
+ ])
82
+ ]),
83
+ r.chartData && r.chartData.length > 0 ? (d(), u("div", P, [
84
+ (d(!0), u(w, null, k(r.chartData, (c, i) => (d(), u("div", {
85
+ key: i,
86
+ class: "flex items-center gap-2 cursor-pointer hover:opacity-80 transition-opacity"
87
+ }, [
88
+ a("div", {
89
+ class: "w-3 h-3 rounded-full",
90
+ style: S({ backgroundColor: D(i) })
91
+ }, null, 4),
92
+ a("span", z, f(c.name), 1)
93
+ ]))), 128))
94
+ ])) : F("", !0)
95
+ ]));
96
+ }
97
+ };
98
+ export {
99
+ U as default
100
+ };
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.51.0",
4
+ "version": "1.52.0",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "build": "vite build"
@@ -35,7 +35,7 @@
35
35
  "dependencies": {
36
36
  "dayjs": "^1.11.10",
37
37
  "echarts": "^5.4.3",
38
- "@orchidui/core": "1.51.0",
38
+ "@orchidui/core": "1.52.0",
39
39
  "lottie-web": "^5.12.2",
40
40
  "quill": "^2.0.3",
41
41
  "quill-better-table": "^1.2.10",
@@ -1,94 +0,0 @@
1
- import { ref as d, computed as x, watch as y, nextTick as C, createElementBlock as i, openBlock as c, createElementVNode as a, createCommentVNode as k, toDisplayString as h, Fragment as w, renderList as F, normalizeStyle as L } from "vue";
2
- import { u as S } from "./useChart-D5nAyTGV.js";
3
- import "./dayjs.min-CTPVfFeV.js";
4
- const V = { class: "flex flex-col items-center justify-center" }, T = { class: "relative w-[210px] h-[210px]" }, I = { class: "absolute inset-0 flex flex-col items-center justify-center pointer-events-none" }, O = { class: "text-center" }, j = { class: "text-oc-text-400" }, A = { class: "text-lg font-semibold font-reddit-mono" }, E = {
5
- key: 0,
6
- class: "mt-4 flex flex-wrap gap-3 justify-center"
7
- }, N = ["onClick"], z = { class: "text-sm" }, R = {
8
- __name: "OcOverviewPieChart",
9
- props: {
10
- chartData: Array
11
- },
12
- setup(r) {
13
- const s = r, n = d(""), o = d(0), _ = (e, t = "SGD") => (typeof e == "number" ? e : Number(e)).toLocaleString("en-US", {
14
- minimumFractionDigits: 2,
15
- maximumFractionDigits: 2
16
- }), m = x(() => !s.chartData || s.chartData.length === 0 ? 0 : s.chartData.reduce((e, t) => e + (t.value || 0), 0)), v = () => {
17
- n.value = "Total", o.value = m.value;
18
- }, g = x(() => ({
19
- series: [{
20
- id: "overviewPieChart",
21
- data: s.chartData || [],
22
- type: "pie",
23
- radius: ["80%", "100%"],
24
- avoidLabelOverlap: !1,
25
- itemStyle: {
26
- borderRadius: 6,
27
- borderColor: "#fff",
28
- borderWidth: 2
29
- },
30
- label: {
31
- show: !1
32
- // Hide default labels
33
- },
34
- labelLine: {
35
- show: !1
36
- },
37
- emphasis: {
38
- disabled: !0,
39
- label: {
40
- show: !1
41
- }
42
- }
43
- }]
44
- })), f = d(), { chart: l } = S(f, g), D = (e) => {
45
- const t = ["#356DFF", "#AEC5FF", "#86FFCC"];
46
- return t[e % t.length];
47
- }, b = (e) => {
48
- n.value = e.name, o.value = e.value, l.value && l.value.dispatchAction({
49
- type: "highlight",
50
- seriesIndex: 0,
51
- dataIndex: s.chartData.findIndex((t) => t.name === e.name)
52
- });
53
- };
54
- return y(l, async (e) => {
55
- e && (await C(), v(), e.on("mouseover", "series", (t) => {
56
- t.componentType === "series" && t.seriesType === "pie" && (n.value = t.name || "Unknown", o.value = t.value || 0);
57
- }), e.on("mouseout", "series", () => {
58
- n.value = "Total", o.value = m.value;
59
- }));
60
- }), y(() => s.chartData, () => {
61
- l.value && v();
62
- }, { deep: !0 }), (e, t) => (c(), i("div", V, [
63
- a("div", T, [
64
- a("div", {
65
- ref_key: "pieChart",
66
- ref: f,
67
- class: "w-[210px] h-[210px]"
68
- }, null, 512),
69
- a("div", I, [
70
- a("div", O, [
71
- a("div", j, h(n.value), 1),
72
- a("div", A, "SGD " + h(_(o.value)), 1)
73
- ])
74
- ])
75
- ]),
76
- r.chartData && r.chartData.length > 0 ? (c(), i("div", E, [
77
- (c(!0), i(w, null, F(r.chartData, (u, p) => (c(), i("div", {
78
- key: p,
79
- class: "flex items-center gap-2 cursor-pointer hover:opacity-80 transition-opacity",
80
- onClick: (B) => b(u)
81
- }, [
82
- a("div", {
83
- class: "w-3 h-3 rounded-full",
84
- style: L({ backgroundColor: D(p) })
85
- }, null, 4),
86
- a("span", z, h(u.name), 1)
87
- ], 8, N))), 128))
88
- ])) : k("", !0)
89
- ]));
90
- }
91
- };
92
- export {
93
- R as default
94
- };