@orchidui/dashboard 1.104.0 → 1.106.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 o } from "vue";
2
- const t = o(() => import("../../../OcOverviewMonthlyBarChart-phAI5_vv.js"));
2
+ const t = o(() => import("../../../OcOverviewMonthlyBarChart-DtW9I-hC.js"));
3
3
  export {
4
4
  t as OverviewMonthlyBarChart
5
5
  };
@@ -1,5 +1,5 @@
1
1
  import { defineAsyncComponent as e } from "vue";
2
- const r = e(() => import("../../../OcOverviewPieChart-DbnX-BGC.js"));
2
+ const r = e(() => import("../../../OcOverviewPieChart-gBl1MAMg.js"));
3
3
  export {
4
4
  r as OcOverviewPieChart
5
5
  };
@@ -1,48 +1,48 @@
1
- import { computed as U, ref as tt, watch as et, createElementBlock as rt, openBlock as nt } from "vue";
1
+ import { computed as I, ref as tt, watch as et, createElementBlock as rt, openBlock as nt } from "vue";
2
2
  import { u as at } from "./useChart-D5nAyTGV.js";
3
- import { g as st } from "./_commonjsHelpers-B4e78b8K.js";
4
- var P = { exports: {} }, it = P.exports, X;
3
+ import { g as it } from "./_commonjsHelpers-B4e78b8K.js";
4
+ var P = { exports: {} }, st = P.exports, X;
5
5
  function ot() {
6
6
  return X || (X = 1, (function(H, g) {
7
7
  (function(w, F) {
8
8
  H.exports = F();
9
- })(it, (function() {
10
- var w = 1e3, F = 6e4, V = 36e5, j = "millisecond", O = "second", _ = "minute", k = "hour", x = "day", L = "week", d = "month", N = "quarter", S = "year", o = "date", l = "Invalid Date", D = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, v = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, z = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(a) {
9
+ })(st, (function() {
10
+ var w = 1e3, F = 6e4, V = 36e5, j = "millisecond", O = "second", _ = "minute", k = "hour", x = "day", L = "week", d = "month", N = "quarter", b = "year", o = "date", l = "Invalid Date", D = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, v = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, z = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(a) {
11
11
  var r = ["th", "st", "nd", "rd"], t = a % 100;
12
12
  return "[" + a + (r[(t - 20) % 10] || r[t] || r[0]) + "]";
13
- } }, W = function(a, r, t) {
13
+ } }, E = function(a, r, t) {
14
14
  var n = String(a);
15
15
  return !n || n.length >= r ? a : "" + Array(r + 1 - n.length).join(t) + a;
16
- }, C = { s: W, z: function(a) {
16
+ }, C = { s: E, z: function(a) {
17
17
  var r = -a.utcOffset(), t = Math.abs(r), n = Math.floor(t / 60), e = t % 60;
18
- return (r <= 0 ? "+" : "-") + W(n, 2, "0") + ":" + W(e, 2, "0");
18
+ return (r <= 0 ? "+" : "-") + E(n, 2, "0") + ":" + E(e, 2, "0");
19
19
  }, m: function a(r, t) {
20
20
  if (r.date() < t.date()) return -a(t, r);
21
- var n = 12 * (t.year() - r.year()) + (t.month() - r.month()), e = r.clone().add(n, d), s = t - e < 0, i = r.clone().add(n + (s ? -1 : 1), d);
22
- return +(-(n + (t - e) / (s ? e - i : i - e)) || 0);
21
+ var n = 12 * (t.year() - r.year()) + (t.month() - r.month()), e = r.clone().add(n, d), i = t - e < 0, s = r.clone().add(n + (i ? -1 : 1), d);
22
+ return +(-(n + (t - e) / (i ? e - s : s - e)) || 0);
23
23
  }, a: function(a) {
24
24
  return a < 0 ? Math.ceil(a) || 0 : Math.floor(a);
25
25
  }, p: function(a) {
26
- return { M: d, y: S, w: L, d: x, D: o, h: k, m: _, s: O, ms: j, Q: N }[a] || String(a || "").toLowerCase().replace(/s$/, "");
26
+ return { M: d, y: b, w: L, d: x, D: o, h: k, m: _, s: O, ms: j, Q: N }[a] || String(a || "").toLowerCase().replace(/s$/, "");
27
27
  }, u: function(a) {
28
28
  return a === void 0;
29
- } }, b = "en", M = {};
30
- M[b] = z;
29
+ } }, S = "en", M = {};
30
+ M[S] = z;
31
31
  var K = "$isDayjsObject", R = function(a) {
32
32
  return a instanceof Z || !(!a || !a[K]);
33
33
  }, J = function a(r, t, n) {
34
34
  var e;
35
- if (!r) return b;
35
+ if (!r) return S;
36
36
  if (typeof r == "string") {
37
- var s = r.toLowerCase();
38
- M[s] && (e = s), t && (M[s] = t, e = s);
39
- var i = r.split("-");
40
- if (!e && i.length > 1) return a(i[0]);
37
+ var i = r.toLowerCase();
38
+ M[i] && (e = i), t && (M[i] = t, e = i);
39
+ var s = r.split("-");
40
+ if (!e && s.length > 1) return a(s[0]);
41
41
  } else {
42
42
  var c = r.name;
43
43
  M[c] = r, e = c;
44
44
  }
45
- return !n && e && (b = e), e || !n && b;
45
+ return !n && e && (S = e), e || !n && S;
46
46
  }, h = function(a, r) {
47
47
  if (R(a)) return a.clone();
48
48
  var t = typeof r == "object" ? r : {};
@@ -58,15 +58,15 @@ function ot() {
58
58
  var r = a.prototype;
59
59
  return r.parse = function(t) {
60
60
  this.$d = (function(n) {
61
- var e = n.date, s = n.utc;
61
+ var e = n.date, i = n.utc;
62
62
  if (e === null) return /* @__PURE__ */ new Date(NaN);
63
63
  if (u.u(e)) return /* @__PURE__ */ new Date();
64
64
  if (e instanceof Date) return new Date(e);
65
65
  if (typeof e == "string" && !/Z$/i.test(e)) {
66
- var i = e.match(D);
67
- if (i) {
68
- var c = i[2] - 1 || 0, f = (i[7] || "0").substring(0, 3);
69
- return s ? new Date(Date.UTC(i[1], c, i[3] || 1, i[4] || 0, i[5] || 0, i[6] || 0, f)) : new Date(i[1], c, i[3] || 1, i[4] || 0, i[5] || 0, i[6] || 0, f);
66
+ var s = e.match(D);
67
+ if (s) {
68
+ var c = s[2] - 1 || 0, f = (s[7] || "0").substring(0, 3);
69
+ return i ? new Date(Date.UTC(s[1], c, s[3] || 1, s[4] || 0, s[5] || 0, s[6] || 0, f)) : new Date(s[1], c, s[3] || 1, s[4] || 0, s[5] || 0, s[6] || 0, f);
70
70
  }
71
71
  }
72
72
  return new Date(e);
@@ -92,20 +92,20 @@ function ot() {
92
92
  }, r.valueOf = function() {
93
93
  return this.$d.getTime();
94
94
  }, r.startOf = function(t, n) {
95
- var e = this, s = !!u.u(n) || n, i = u.p(t), c = function(T, p) {
96
- var A = u.w(e.$u ? Date.UTC(e.$y, p, T) : new Date(e.$y, p, T), e);
97
- return s ? A : A.endOf(x);
98
- }, f = function(T, p) {
99
- return u.w(e.toDate()[T].apply(e.toDate("s"), (s ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(p)), e);
100
- }, m = this.$W, $ = this.$M, y = this.$D, B = "set" + (this.$u ? "UTC" : "");
101
- switch (i) {
102
- case S:
103
- return s ? c(1, 0) : c(31, 11);
95
+ var e = this, i = !!u.u(n) || n, s = u.p(t), c = function(T, $) {
96
+ var A = u.w(e.$u ? Date.UTC(e.$y, $, T) : new Date(e.$y, $, T), e);
97
+ return i ? A : A.endOf(x);
98
+ }, f = function(T, $) {
99
+ return u.w(e.toDate()[T].apply(e.toDate("s"), (i ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice($)), e);
100
+ }, m = this.$W, p = this.$M, y = this.$D, B = "set" + (this.$u ? "UTC" : "");
101
+ switch (s) {
102
+ case b:
103
+ return i ? c(1, 0) : c(31, 11);
104
104
  case d:
105
- return s ? c(1, $) : c(0, $ + 1);
105
+ return i ? c(1, p) : c(0, p + 1);
106
106
  case L:
107
- var Y = this.$locale().weekStart || 0, E = (m < Y ? m + 7 : m) - Y;
108
- return c(s ? y - E : y + (6 - E), $);
107
+ var Y = this.$locale().weekStart || 0, W = (m < Y ? m + 7 : m) - Y;
108
+ return c(i ? y - W : y + (6 - W), p);
109
109
  case x:
110
110
  case o:
111
111
  return f(B + "Hours", 0);
@@ -121,8 +121,8 @@ function ot() {
121
121
  }, r.endOf = function(t) {
122
122
  return this.startOf(t, !1);
123
123
  }, r.$set = function(t, n) {
124
- var e, s = u.p(t), i = "set" + (this.$u ? "UTC" : ""), c = (e = {}, e[x] = i + "Date", e[o] = i + "Date", e[d] = i + "Month", e[S] = i + "FullYear", e[k] = i + "Hours", e[_] = i + "Minutes", e[O] = i + "Seconds", e[j] = i + "Milliseconds", e)[s], f = s === x ? this.$D + (n - this.$W) : n;
125
- if (s === d || s === S) {
124
+ var e, i = u.p(t), s = "set" + (this.$u ? "UTC" : ""), c = (e = {}, e[x] = s + "Date", e[o] = s + "Date", e[d] = s + "Month", e[b] = s + "FullYear", e[k] = s + "Hours", e[_] = s + "Minutes", e[O] = s + "Seconds", e[j] = s + "Milliseconds", e)[i], f = i === x ? this.$D + (n - this.$W) : n;
125
+ if (i === d || i === b) {
126
126
  var m = this.clone().set(o, 1);
127
127
  m.$d[c](f), m.init(), this.$d = m.set(o, Math.min(this.$D, m.daysInMonth())).$d;
128
128
  } else c && this.$d[c](f);
@@ -132,34 +132,34 @@ function ot() {
132
132
  }, r.get = function(t) {
133
133
  return this[u.p(t)]();
134
134
  }, r.add = function(t, n) {
135
- var e, s = this;
135
+ var e, i = this;
136
136
  t = Number(t);
137
- var i = u.p(n), c = function($) {
138
- var y = h(s);
139
- return u.w(y.date(y.date() + Math.round($ * t)), s);
137
+ var s = u.p(n), c = function(p) {
138
+ var y = h(i);
139
+ return u.w(y.date(y.date() + Math.round(p * t)), i);
140
140
  };
141
- if (i === d) return this.set(d, this.$M + t);
142
- if (i === S) return this.set(S, this.$y + t);
143
- if (i === x) return c(1);
144
- if (i === L) return c(7);
145
- var f = (e = {}, e[_] = F, e[k] = V, e[O] = w, e)[i] || 1, m = this.$d.getTime() + t * f;
141
+ if (s === d) return this.set(d, this.$M + t);
142
+ if (s === b) return this.set(b, this.$y + t);
143
+ if (s === x) return c(1);
144
+ if (s === L) return c(7);
145
+ var f = (e = {}, e[_] = F, e[k] = V, e[O] = w, e)[s] || 1, m = this.$d.getTime() + t * f;
146
146
  return u.w(m, this);
147
147
  }, r.subtract = function(t, n) {
148
148
  return this.add(-1 * t, n);
149
149
  }, r.format = function(t) {
150
150
  var n = this, e = this.$locale();
151
151
  if (!this.isValid()) return e.invalidDate || l;
152
- var s = t || "YYYY-MM-DDTHH:mm:ssZ", i = u.z(this), c = this.$H, f = this.$m, m = this.$M, $ = e.weekdays, y = e.months, B = e.meridiem, Y = function(p, A, I, q) {
153
- return p && (p[A] || p(n, s)) || I[A].slice(0, q);
154
- }, E = function(p) {
155
- return u.s(c % 12 || 12, p, "0");
156
- }, T = B || function(p, A, I) {
157
- var q = p < 12 ? "AM" : "PM";
158
- return I ? q.toLowerCase() : q;
152
+ var i = t || "YYYY-MM-DDTHH:mm:ssZ", s = u.z(this), c = this.$H, f = this.$m, m = this.$M, p = e.weekdays, y = e.months, B = e.meridiem, Y = function($, A, U, q) {
153
+ return $ && ($[A] || $(n, i)) || U[A].slice(0, q);
154
+ }, W = function($) {
155
+ return u.s(c % 12 || 12, $, "0");
156
+ }, T = B || function($, A, U) {
157
+ var q = $ < 12 ? "AM" : "PM";
158
+ return U ? q.toLowerCase() : q;
159
159
  };
160
- return s.replace(v, (function(p, A) {
161
- return A || (function(I) {
162
- switch (I) {
160
+ return i.replace(v, (function($, A) {
161
+ return A || (function(U) {
162
+ switch (U) {
163
163
  case "YY":
164
164
  return String(n.$y).slice(-2);
165
165
  case "YYYY":
@@ -179,19 +179,19 @@ function ot() {
179
179
  case "d":
180
180
  return String(n.$W);
181
181
  case "dd":
182
- return Y(e.weekdaysMin, n.$W, $, 2);
182
+ return Y(e.weekdaysMin, n.$W, p, 2);
183
183
  case "ddd":
184
- return Y(e.weekdaysShort, n.$W, $, 3);
184
+ return Y(e.weekdaysShort, n.$W, p, 3);
185
185
  case "dddd":
186
- return $[n.$W];
186
+ return p[n.$W];
187
187
  case "H":
188
188
  return String(c);
189
189
  case "HH":
190
190
  return u.s(c, 2, "0");
191
191
  case "h":
192
- return E(1);
192
+ return W(1);
193
193
  case "hh":
194
- return E(2);
194
+ return W(2);
195
195
  case "a":
196
196
  return T(c, f, !0);
197
197
  case "A":
@@ -207,54 +207,54 @@ function ot() {
207
207
  case "SSS":
208
208
  return u.s(n.$ms, 3, "0");
209
209
  case "Z":
210
- return i;
210
+ return s;
211
211
  }
212
212
  return null;
213
- })(p) || i.replace(":", "");
213
+ })($) || s.replace(":", "");
214
214
  }));
215
215
  }, r.utcOffset = function() {
216
216
  return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
217
217
  }, r.diff = function(t, n, e) {
218
- var s, i = this, c = u.p(n), f = h(t), m = (f.utcOffset() - this.utcOffset()) * F, $ = this - f, y = function() {
219
- return u.m(i, f);
218
+ var i, s = this, c = u.p(n), f = h(t), m = (f.utcOffset() - this.utcOffset()) * F, p = this - f, y = function() {
219
+ return u.m(s, f);
220
220
  };
221
221
  switch (c) {
222
- case S:
223
- s = y() / 12;
222
+ case b:
223
+ i = y() / 12;
224
224
  break;
225
225
  case d:
226
- s = y();
226
+ i = y();
227
227
  break;
228
228
  case N:
229
- s = y() / 3;
229
+ i = y() / 3;
230
230
  break;
231
231
  case L:
232
- s = ($ - m) / 6048e5;
232
+ i = (p - m) / 6048e5;
233
233
  break;
234
234
  case x:
235
- s = ($ - m) / 864e5;
235
+ i = (p - m) / 864e5;
236
236
  break;
237
237
  case k:
238
- s = $ / V;
238
+ i = p / V;
239
239
  break;
240
240
  case _:
241
- s = $ / F;
241
+ i = p / F;
242
242
  break;
243
243
  case O:
244
- s = $ / w;
244
+ i = p / w;
245
245
  break;
246
246
  default:
247
- s = $;
247
+ i = p;
248
248
  }
249
- return e ? s : u.a(s);
249
+ return e ? i : u.a(i);
250
250
  }, r.daysInMonth = function() {
251
251
  return this.endOf(d).$D;
252
252
  }, r.$locale = function() {
253
253
  return M[this.$L];
254
254
  }, r.locale = function(t, n) {
255
255
  if (!t) return this.$L;
256
- var e = this.clone(), s = J(t, n, !0);
257
- return s && (e.$L = s), e;
256
+ var e = this.clone(), i = J(t, n, !0);
257
+ return i && (e.$L = i), e;
258
258
  }, r.clone = function() {
259
259
  return u.w(this.$d, this);
260
260
  }, r.toDate = function() {
@@ -267,7 +267,7 @@ function ot() {
267
267
  return this.$d.toUTCString();
268
268
  }, a;
269
269
  })(), Q = Z.prototype;
270
- return h.prototype = Q, [["$ms", j], ["$s", O], ["$m", _], ["$H", k], ["$W", x], ["$M", d], ["$y", S], ["$D", o]].forEach((function(a) {
270
+ return h.prototype = Q, [["$ms", j], ["$s", O], ["$m", _], ["$H", k], ["$W", x], ["$M", d], ["$y", b], ["$D", o]].forEach((function(a) {
271
271
  Q[a[1]] = function(r) {
272
272
  return this.$g(r, a[0], a[1]);
273
273
  };
@@ -275,12 +275,12 @@ function ot() {
275
275
  return a.$i || (a(r, Z, h), a.$i = !0), h;
276
276
  }, h.locale = J, h.isDayjs = R, h.unix = function(a) {
277
277
  return h(1e3 * a);
278
- }, h.en = M[b], h.Ls = M, h.p = {}, h;
278
+ }, h.en = M[S], h.Ls = M, h.p = {}, h;
279
279
  }));
280
280
  })(P)), P.exports;
281
281
  }
282
282
  var ut = ot();
283
- const G = /* @__PURE__ */ st(ut), dt = {
283
+ const G = /* @__PURE__ */ it(ut), dt = {
284
284
  __name: "OcOverviewMonthlyBarChart",
285
285
  props: {
286
286
  variant: {
@@ -299,15 +299,15 @@ const G = /* @__PURE__ */ st(ut), dt = {
299
299
  tooltipValueFormatter: Function
300
300
  },
301
301
  setup(H) {
302
- const g = H, w = U(() => g.labelData.length === 30), F = U(() => Math.max(...g.chartData));
303
- U(() => g.chartData.indexOf(F.value));
302
+ const g = H, w = I(() => g.labelData.length === 30), F = I(() => Math.max(...g.chartData));
303
+ I(() => g.chartData.indexOf(F.value));
304
304
  const V = (o, l = "SGD") => (typeof o == "number" ? o : Number(o)).toLocaleString("en-US", {
305
305
  minimumFractionDigits: 2,
306
306
  maximumFractionDigits: 2
307
307
  }), j = (o, l = !1) => l ? G(o).format("DD MMM").toUpperCase() : G(o).format("ddd DD/MM").toUpperCase(), O = (o) => {
308
308
  const l = [...g.chartData].sort((D, v) => v - D);
309
309
  return o === l[0] ? "#4C8AFD" : o === l[1] ? "#80ACFE" : "#CCDEFE";
310
- }, _ = U(() => ({
310
+ }, _ = I(() => ({
311
311
  xAxis: {
312
312
  data: (g.labelData || []).map((o) => j(o, w.value)),
313
313
  splitLine: { show: !1 },
@@ -360,7 +360,13 @@ const G = /* @__PURE__ */ st(ut), dt = {
360
360
  top: "20",
361
361
  containLabel: !0
362
362
  },
363
- animation: !1,
363
+ // Animate on first render and whenever the data updates so bars grow up from
364
+ // the baseline (e.g. from a zero/empty state into their real values).
365
+ animation: !0,
366
+ animationDuration: 800,
367
+ animationDurationUpdate: 800,
368
+ animationEasing: "cubicOut",
369
+ animationEasingUpdate: "cubicOut",
364
370
  series: [{
365
371
  id: "myBar",
366
372
  data: g.chartData,
@@ -372,7 +378,7 @@ const G = /* @__PURE__ */ st(ut), dt = {
372
378
  },
373
379
  clip: !0
374
380
  }]
375
- })), k = U(() => (g.labelData || []).map((o, l) => G(o).day() === 6 && l + 1 < g.labelData.length ? [l, l + 1] : null).filter(Boolean)), x = {
381
+ })), k = I(() => (g.labelData || []).map((o, l) => G(o).day() === 6 && l + 1 < g.labelData.length ? [l, l + 1] : null).filter(Boolean)), x = {
376
382
  itemStyle: {
377
383
  color: {
378
384
  type: "linear",
@@ -388,10 +394,10 @@ const G = /* @__PURE__ */ st(ut), dt = {
388
394
  }
389
395
  }
390
396
  }, L = tt(), { chart: d } = at(L, _), N = (o, l, D = !1) => {
391
- const v = o.getModel().getSeriesByType("bar"), z = v == null ? void 0 : v.map((b) => b.getData())[0], W = z.count(), C = [];
392
- return l.forEach((b) => {
393
- if (b < W) {
394
- const M = z.getItemLayout(b);
397
+ const v = o.getModel().getSeriesByType("bar"), z = v == null ? void 0 : v.map((S) => S.getData())[0], E = z.count(), C = [];
398
+ return l.forEach((S) => {
399
+ if (S < E) {
400
+ const M = z.getItemLayout(S);
395
401
  C.push([
396
402
  { x: M.x - 2 },
397
403
  { x: M.x + M.width + 2 }
@@ -401,7 +407,7 @@ const G = /* @__PURE__ */ st(ut), dt = {
401
407
  { x: C[0][0].x },
402
408
  { x: C[C.length - 1][1].x }
403
409
  ]] : C;
404
- }, S = () => {
410
+ }, b = () => {
405
411
  var o;
406
412
  if (d.value)
407
413
  if (w.value) {
@@ -430,7 +436,7 @@ const G = /* @__PURE__ */ st(ut), dt = {
430
436
  }
431
437
  };
432
438
  return et([d, w], () => {
433
- d.value && S();
439
+ d.value && b();
434
440
  }), (o, l) => (nt(), rt("div", {
435
441
  ref_key: "barChart",
436
442
  ref: L,
@@ -1,9 +1,9 @@
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";
1
+ import { ref as f, computed as b, watch as g, nextTick as _, createElementBlock as d, openBlock as m, createElementVNode as o, createCommentVNode as L, toDisplayString as i, Fragment as O, renderList as S, normalizeStyle as C } from "vue";
2
2
  import { u as k } from "./useChart-D5nAyTGV.js";
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 = {
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" }, E = { class: "text-lg font-semibold font-reddit-mono" }, T = {
4
4
  key: 0,
5
5
  class: "mt-4 flex flex-wrap gap-3 justify-center"
6
- }, $ = { class: "text-sm" }, I = {
6
+ }, U = { class: "text-sm" }, z = {
7
7
  __name: "OcOverviewPieChart",
8
8
  props: {
9
9
  chartData: Array,
@@ -25,15 +25,15 @@ const F = { class: "flex flex-col items-center justify-center" }, V = { class: "
25
25
  default: !1
26
26
  }
27
27
  },
28
- setup(l) {
29
- const t = l, r = f(""), i = f(0), g = (e) => (typeof e == "number" ? e : Number(e)).toLocaleString(
28
+ setup(n) {
29
+ const t = n, r = f(""), l = f(0), x = (e) => (typeof e == "number" ? e : Number(e)).toLocaleString(
30
30
  "en-US",
31
31
  t.currency ? { minimumFractionDigits: 2, maximumFractionDigits: 2 } : { minimumFractionDigits: 0, maximumFractionDigits: 0 }
32
32
  ), h = (e) => {
33
33
  const a = typeof e == "number" ? e : Number(e);
34
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;
35
+ }, s = b(() => !t.chartData || t.chartData.length === 0 ? 0 : t.chartData.reduce((e, a) => e + (a.value || 0), 0)), p = () => {
36
+ r.value = t.totalLabel, l.value = s.value;
37
37
  }, D = b(() => ({
38
38
  tooltip: t.tooltip,
39
39
  series: [
@@ -48,7 +48,13 @@ const F = { class: "flex flex-col items-center justify-center" }, V = { class: "
48
48
  borderColor: "#fff",
49
49
  borderWidth: 2
50
50
  },
51
- animation: !1,
51
+ // Animate the ring on first render and on data updates so slices sweep in
52
+ // instead of appearing instantly.
53
+ animation: !0,
54
+ animationDuration: 800,
55
+ animationDurationUpdate: 800,
56
+ animationEasing: "cubicOut",
57
+ animationEasingUpdate: "cubicOut",
52
58
  label: {
53
59
  show: !1
54
60
  // Hide default labels
@@ -75,51 +81,51 @@ const F = { class: "flex flex-col items-center justify-center" }, V = { class: "
75
81
  ...t.additionalOptions ? t.additionalOptions : {}
76
82
  }
77
83
  ]
78
- })), p = f(), { chart: y } = k(p, D), w = (e) => t.chartData[e].itemStyle.color;
79
- return x(y, async (e) => {
80
- e && (await _(), v(), e.on("mouseover", "series", (a) => {
84
+ })), v = f(), { chart: y } = k(v, D), w = (e) => t.chartData[e].itemStyle.color;
85
+ return g(y, async (e) => {
86
+ e && (await _(), p(), e.on("mouseover", "series", (a) => {
81
87
  if (a.componentType === "series" && a.seriesType === "pie") {
82
88
  const c = a.name || "Unknown", u = a.value || 0;
83
- r.value = `${c} (${h(u)}%)`, i.value = a.value || 0;
89
+ r.value = `${c} (${h(u)}%)`, l.value = a.value || 0;
84
90
  }
85
91
  }), e.on("mouseout", "series", () => {
86
- r.value = t.totalLabel, i.value = s.value;
92
+ r.value = t.totalLabel, l.value = s.value;
87
93
  }));
88
- }), x(
94
+ }), g(
89
95
  () => t.chartData,
90
96
  () => {
91
- y.value && v();
97
+ y.value && p();
92
98
  },
93
99
  { deep: !0 }
94
100
  ), (e, a) => (m(), d("div", F, [
95
101
  o("div", V, [
96
102
  o("div", {
97
103
  ref_key: "pieChart",
98
- ref: p,
104
+ ref: v,
99
105
  class: "w-[210px] h-[210px]"
100
106
  }, null, 512),
101
107
  o("div", j, [
102
108
  o("div", N, [
103
- o("div", P, n(r.value), 1),
104
- o("div", T, n(l.currency) + " " + n(g(i.value)), 1)
109
+ o("div", P, i(r.value), 1),
110
+ o("div", E, i(n.currency) + " " + i(x(l.value)), 1)
105
111
  ])
106
112
  ])
107
113
  ]),
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", {
114
+ n.chartData && n.chartData.length > 0 ? (m(), d("div", T, [
115
+ (m(!0), d(O, null, S(n.chartData, (c, u) => (m(), d("div", {
110
116
  key: u,
111
117
  class: "flex items-center gap-2 cursor-pointer hover:opacity-80 transition-opacity"
112
118
  }, [
113
119
  o("div", {
114
120
  class: "w-3 h-3 rounded-full",
115
- style: O({ backgroundColor: w(u) })
121
+ style: C({ backgroundColor: w(u) })
116
122
  }, null, 4),
117
- o("span", $, n(c.name) + " " + n(l.showPercentInLabel ? `(${h(c.value)}%)` : ""), 1)
123
+ o("span", U, i(c.name) + " " + i(n.showPercentInLabel ? `(${h(c.value)}%)` : ""), 1)
118
124
  ]))), 128))
119
125
  ])) : L("", !0)
120
126
  ]));
121
127
  }
122
128
  };
123
129
  export {
124
- I as default
130
+ z as default
125
131
  };
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.104.0",
4
+ "version": "1.106.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.104.0",
36
+ "@orchidui/core": "1.106.0",
37
37
  "dayjs": "^1.11.10",
38
38
  "echarts": "^5.4.3",
39
39
  "lottie-web": "^5.12.2",