@orchidui/dashboard 1.56.0 → 1.57.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.
- package/dist/Dashboard/Charts/OverviewMonthlyBarChart/OcOverviewMonthlyBarChart.js +1 -1
- package/dist/Dashboard/Charts/OverviewPieChart/OcOverviewPieChart.js +1 -1
- package/dist/{OcOverviewMonthlyBarChart-CSheXsBM.js → OcOverviewMonthlyBarChart-D9_FsW21.js} +60 -51
- package/dist/{OcOverviewPieChart-D2YLaN_P.js → OcOverviewPieChart-D2CKOk4R.js} +2 -2
- package/package.json +2 -2
package/dist/{OcOverviewMonthlyBarChart-CSheXsBM.js → OcOverviewMonthlyBarChart-D9_FsW21.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { computed as
|
|
1
|
+
import { computed as i, ref as w, watch as F, createElementBlock as M, openBlock as S } from "vue";
|
|
2
2
|
import { u as B } from "./useChart-D5nAyTGV.js";
|
|
3
3
|
import { d as u } from "./dayjs.min-CTPVfFeV.js";
|
|
4
|
-
const
|
|
4
|
+
const E = {
|
|
5
5
|
__name: "OcOverviewMonthlyBarChart",
|
|
6
6
|
props: {
|
|
7
7
|
variant: {
|
|
@@ -19,17 +19,17 @@ const O = {
|
|
|
19
19
|
tooltipValueFormatter: Function
|
|
20
20
|
},
|
|
21
21
|
setup(m) {
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
const
|
|
22
|
+
const e = m, s = i(() => e.labelData.length === 30), x = i(() => Math.max(...e.chartData));
|
|
23
|
+
i(() => e.chartData.indexOf(x.value));
|
|
24
|
+
const h = (t, a = "SGD") => (typeof t == "number" ? t : Number(t)).toLocaleString("en-US", {
|
|
25
25
|
minimumFractionDigits: 2,
|
|
26
26
|
maximumFractionDigits: 2
|
|
27
|
-
}), y = (t,
|
|
28
|
-
const
|
|
29
|
-
return t ===
|
|
30
|
-
},
|
|
27
|
+
}), y = (t, a = !1) => a ? u(t).format("DD MMM").toUpperCase() : u(t).format("ddd DD/MM").toUpperCase(), g = (t) => {
|
|
28
|
+
const a = [...e.chartData].sort((r, l) => l - r);
|
|
29
|
+
return t === a[0] ? "#4C8AFD" : t === a[1] ? "#80ACFE" : "#CCDEFE";
|
|
30
|
+
}, D = i(() => ({
|
|
31
31
|
xAxis: {
|
|
32
|
-
data:
|
|
32
|
+
data: e.labelData.map((t) => y(t, s.value)),
|
|
33
33
|
splitLine: { show: !1 },
|
|
34
34
|
axisLine: { show: !1 },
|
|
35
35
|
axisTick: { show: !1 },
|
|
@@ -38,7 +38,7 @@ const O = {
|
|
|
38
38
|
fontSize: 10,
|
|
39
39
|
margin: 4,
|
|
40
40
|
width: 70,
|
|
41
|
-
interval:
|
|
41
|
+
interval: s.value ? 3 : 0
|
|
42
42
|
}
|
|
43
43
|
},
|
|
44
44
|
tooltip: {
|
|
@@ -50,14 +50,14 @@ const O = {
|
|
|
50
50
|
lineStyle: { color: "#2465DE" }
|
|
51
51
|
},
|
|
52
52
|
formatter: (t) => {
|
|
53
|
-
const
|
|
53
|
+
const a = e.labelData[t[0].dataIndex], r = u(a).format("DD MMM YYYY"), l = t[0].value;
|
|
54
54
|
return `
|
|
55
55
|
<div class="py-3 px-4">
|
|
56
56
|
<div class="flex items-center gap-2">
|
|
57
57
|
<span class="text-xs font-medium text-oc-text-300">${r}</span>
|
|
58
58
|
</div>
|
|
59
59
|
<div class="flex items-center gap-2">
|
|
60
|
-
<span class="font-semibold text-oc-text font-reddit-mono">SGD ${
|
|
60
|
+
<span class="font-semibold text-oc-text font-reddit-mono">SGD ${h(l)}</span>
|
|
61
61
|
</div>
|
|
62
62
|
</div>
|
|
63
63
|
`;
|
|
@@ -83,17 +83,16 @@ const O = {
|
|
|
83
83
|
},
|
|
84
84
|
series: [{
|
|
85
85
|
id: "myBar",
|
|
86
|
-
data:
|
|
86
|
+
data: e.chartData,
|
|
87
87
|
type: "bar",
|
|
88
88
|
barCategoryGap: 4,
|
|
89
89
|
itemStyle: {
|
|
90
|
-
borderRadius:
|
|
91
|
-
color: ({ value: t }) =>
|
|
90
|
+
borderRadius: s.value ? [100, 100, 0, 0] : [4, 4, 0, 0],
|
|
91
|
+
color: ({ value: t }) => g(t)
|
|
92
92
|
},
|
|
93
93
|
clip: !0
|
|
94
94
|
}]
|
|
95
|
-
})),
|
|
96
|
-
silent: !0,
|
|
95
|
+
})), b = i(() => e.labelData.map((t, a) => u(t).day() === 6 && a + 1 < e.labelData.length ? [a, a + 1] : null).filter(Boolean)), v = {
|
|
97
96
|
itemStyle: {
|
|
98
97
|
color: {
|
|
99
98
|
type: "linear",
|
|
@@ -106,48 +105,58 @@ const O = {
|
|
|
106
105
|
{ offset: 1, color: "rgba(36, 93, 239, 0.01)" }
|
|
107
106
|
],
|
|
108
107
|
global: !1
|
|
109
|
-
}
|
|
110
|
-
borderColor: "rgba(53, 109, 255, 0.15)",
|
|
111
|
-
borderWidth: 1
|
|
108
|
+
}
|
|
112
109
|
}
|
|
113
|
-
},
|
|
114
|
-
const
|
|
115
|
-
return
|
|
116
|
-
if (c <
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
{ x:
|
|
120
|
-
{ x:
|
|
110
|
+
}, d = w(), { chart: o } = B(d, D), A = (t, a, r = !1) => {
|
|
111
|
+
const f = t.getModel().getSeriesByType("bar").map((c) => c.getData())[0], k = f.count(), n = [];
|
|
112
|
+
return a.forEach((c) => {
|
|
113
|
+
if (c < k) {
|
|
114
|
+
const p = f.getItemLayout(c);
|
|
115
|
+
n.push([
|
|
116
|
+
{ x: p.x - 2 },
|
|
117
|
+
{ x: p.x + p.width + 2 }
|
|
121
118
|
]);
|
|
122
119
|
}
|
|
123
|
-
}), r &&
|
|
124
|
-
{ x:
|
|
125
|
-
{ x:
|
|
126
|
-
]] :
|
|
127
|
-
},
|
|
128
|
-
if (
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
120
|
+
}), r && n.length > 0 ? [[
|
|
121
|
+
{ x: n[0][0].x },
|
|
122
|
+
{ x: n[n.length - 1][1].x }
|
|
123
|
+
]] : n;
|
|
124
|
+
}, C = () => {
|
|
125
|
+
if (o.value)
|
|
126
|
+
if (s.value) {
|
|
127
|
+
const t = b.value.map(
|
|
128
|
+
(r) => A(o.value, r, !0).flat()
|
|
129
|
+
), a = {
|
|
130
|
+
series: {
|
|
131
|
+
id: "myBar",
|
|
132
|
+
markArea: {
|
|
133
|
+
...v,
|
|
134
|
+
data: t
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
o.value.setOption(a);
|
|
139
|
+
} else {
|
|
140
|
+
const t = {
|
|
141
|
+
series: {
|
|
142
|
+
id: "myBar",
|
|
143
|
+
markArea: {
|
|
144
|
+
data: []
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
};
|
|
148
|
+
o.value.setOption(t);
|
|
138
149
|
}
|
|
139
|
-
};
|
|
140
|
-
n.value.setOption(e);
|
|
141
150
|
};
|
|
142
|
-
return
|
|
143
|
-
|
|
144
|
-
}), (t,
|
|
151
|
+
return F([o, s], () => {
|
|
152
|
+
o.value && C();
|
|
153
|
+
}), (t, a) => (S(), M("div", {
|
|
145
154
|
ref_key: "barChart",
|
|
146
|
-
ref:
|
|
155
|
+
ref: d,
|
|
147
156
|
class: "w-full"
|
|
148
157
|
}, null, 512));
|
|
149
158
|
}
|
|
150
159
|
};
|
|
151
160
|
export {
|
|
152
|
-
|
|
161
|
+
E as default
|
|
153
162
|
};
|
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.57.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.
|
|
38
|
+
"@orchidui/core": "1.57.0",
|
|
39
39
|
"lottie-web": "^5.12.2",
|
|
40
40
|
"quill": "^2.0.3",
|
|
41
41
|
"quill-better-table": "^1.2.10",
|