@orchidui/dashboard 1.62.0 → 1.64.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-zvNIg1f3.js"));
2
+ const t = o(() => import("../../../OcOverviewMonthlyBarChart-DY9CBi1a.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-Dg8xKIJJ.js"));
2
+ const r = e(() => import("../../../OcOverviewPieChart-CEKbsbpp.js"));
3
3
  export {
4
4
  r as OcOverviewPieChart
5
5
  };
@@ -0,0 +1,444 @@
1
+ import { computed as U, ref as tt, watch as et, createElementBlock as rt, openBlock as nt } from "vue";
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;
5
+ function ot() {
6
+ return X || (X = 1, (function(H, g) {
7
+ (function(w, F) {
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) {
11
+ var r = ["th", "st", "nd", "rd"], t = a % 100;
12
+ return "[" + a + (r[(t - 20) % 10] || r[t] || r[0]) + "]";
13
+ } }, W = function(a, r, t) {
14
+ var n = String(a);
15
+ return !n || n.length >= r ? a : "" + Array(r + 1 - n.length).join(t) + a;
16
+ }, C = { s: W, z: function(a) {
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");
19
+ }, m: function a(r, t) {
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);
23
+ }, a: function(a) {
24
+ return a < 0 ? Math.ceil(a) || 0 : Math.floor(a);
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$/, "");
27
+ }, u: function(a) {
28
+ return a === void 0;
29
+ } }, b = "en", M = {};
30
+ M[b] = z;
31
+ var K = "$isDayjsObject", R = function(a) {
32
+ return a instanceof Z || !(!a || !a[K]);
33
+ }, J = function a(r, t, n) {
34
+ var e;
35
+ if (!r) return b;
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]);
41
+ } else {
42
+ var c = r.name;
43
+ M[c] = r, e = c;
44
+ }
45
+ return !n && e && (b = e), e || !n && b;
46
+ }, h = function(a, r) {
47
+ if (R(a)) return a.clone();
48
+ var t = typeof r == "object" ? r : {};
49
+ return t.date = a, t.args = arguments, new Z(t);
50
+ }, u = C;
51
+ u.l = J, u.i = R, u.w = function(a, r) {
52
+ return h(a, { locale: r.$L, utc: r.$u, x: r.$x, $offset: r.$offset });
53
+ };
54
+ var Z = (function() {
55
+ function a(t) {
56
+ this.$L = J(t.locale, null, !0), this.parse(t), this.$x = this.$x || t.x || {}, this[K] = !0;
57
+ }
58
+ var r = a.prototype;
59
+ return r.parse = function(t) {
60
+ this.$d = (function(n) {
61
+ var e = n.date, s = n.utc;
62
+ if (e === null) return /* @__PURE__ */ new Date(NaN);
63
+ if (u.u(e)) return /* @__PURE__ */ new Date();
64
+ if (e instanceof Date) return new Date(e);
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);
70
+ }
71
+ }
72
+ return new Date(e);
73
+ })(t), this.init();
74
+ }, r.init = function() {
75
+ var t = this.$d;
76
+ this.$y = t.getFullYear(), this.$M = t.getMonth(), this.$D = t.getDate(), this.$W = t.getDay(), this.$H = t.getHours(), this.$m = t.getMinutes(), this.$s = t.getSeconds(), this.$ms = t.getMilliseconds();
77
+ }, r.$utils = function() {
78
+ return u;
79
+ }, r.isValid = function() {
80
+ return this.$d.toString() !== l;
81
+ }, r.isSame = function(t, n) {
82
+ var e = h(t);
83
+ return this.startOf(n) <= e && e <= this.endOf(n);
84
+ }, r.isAfter = function(t, n) {
85
+ return h(t) < this.startOf(n);
86
+ }, r.isBefore = function(t, n) {
87
+ return this.endOf(n) < h(t);
88
+ }, r.$g = function(t, n, e) {
89
+ return u.u(t) ? this[n] : this.set(e, t);
90
+ }, r.unix = function() {
91
+ return Math.floor(this.valueOf() / 1e3);
92
+ }, r.valueOf = function() {
93
+ return this.$d.getTime();
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);
104
+ case d:
105
+ return s ? c(1, $) : c(0, $ + 1);
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), $);
109
+ case x:
110
+ case o:
111
+ return f(B + "Hours", 0);
112
+ case k:
113
+ return f(B + "Minutes", 1);
114
+ case _:
115
+ return f(B + "Seconds", 2);
116
+ case O:
117
+ return f(B + "Milliseconds", 3);
118
+ default:
119
+ return this.clone();
120
+ }
121
+ }, r.endOf = function(t) {
122
+ return this.startOf(t, !1);
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) {
126
+ var m = this.clone().set(o, 1);
127
+ m.$d[c](f), m.init(), this.$d = m.set(o, Math.min(this.$D, m.daysInMonth())).$d;
128
+ } else c && this.$d[c](f);
129
+ return this.init(), this;
130
+ }, r.set = function(t, n) {
131
+ return this.clone().$set(t, n);
132
+ }, r.get = function(t) {
133
+ return this[u.p(t)]();
134
+ }, r.add = function(t, n) {
135
+ var e, s = this;
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);
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;
146
+ return u.w(m, this);
147
+ }, r.subtract = function(t, n) {
148
+ return this.add(-1 * t, n);
149
+ }, r.format = function(t) {
150
+ var n = this, e = this.$locale();
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;
159
+ };
160
+ return s.replace(v, (function(p, A) {
161
+ return A || (function(I) {
162
+ switch (I) {
163
+ case "YY":
164
+ return String(n.$y).slice(-2);
165
+ case "YYYY":
166
+ return u.s(n.$y, 4, "0");
167
+ case "M":
168
+ return m + 1;
169
+ case "MM":
170
+ return u.s(m + 1, 2, "0");
171
+ case "MMM":
172
+ return Y(e.monthsShort, m, y, 3);
173
+ case "MMMM":
174
+ return Y(y, m);
175
+ case "D":
176
+ return n.$D;
177
+ case "DD":
178
+ return u.s(n.$D, 2, "0");
179
+ case "d":
180
+ return String(n.$W);
181
+ case "dd":
182
+ return Y(e.weekdaysMin, n.$W, $, 2);
183
+ case "ddd":
184
+ return Y(e.weekdaysShort, n.$W, $, 3);
185
+ case "dddd":
186
+ return $[n.$W];
187
+ case "H":
188
+ return String(c);
189
+ case "HH":
190
+ return u.s(c, 2, "0");
191
+ case "h":
192
+ return E(1);
193
+ case "hh":
194
+ return E(2);
195
+ case "a":
196
+ return T(c, f, !0);
197
+ case "A":
198
+ return T(c, f, !1);
199
+ case "m":
200
+ return String(f);
201
+ case "mm":
202
+ return u.s(f, 2, "0");
203
+ case "s":
204
+ return String(n.$s);
205
+ case "ss":
206
+ return u.s(n.$s, 2, "0");
207
+ case "SSS":
208
+ return u.s(n.$ms, 3, "0");
209
+ case "Z":
210
+ return i;
211
+ }
212
+ return null;
213
+ })(p) || i.replace(":", "");
214
+ }));
215
+ }, r.utcOffset = function() {
216
+ return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
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);
220
+ };
221
+ switch (c) {
222
+ case S:
223
+ s = y() / 12;
224
+ break;
225
+ case d:
226
+ s = y();
227
+ break;
228
+ case N:
229
+ s = y() / 3;
230
+ break;
231
+ case L:
232
+ s = ($ - m) / 6048e5;
233
+ break;
234
+ case x:
235
+ s = ($ - m) / 864e5;
236
+ break;
237
+ case k:
238
+ s = $ / V;
239
+ break;
240
+ case _:
241
+ s = $ / F;
242
+ break;
243
+ case O:
244
+ s = $ / w;
245
+ break;
246
+ default:
247
+ s = $;
248
+ }
249
+ return e ? s : u.a(s);
250
+ }, r.daysInMonth = function() {
251
+ return this.endOf(d).$D;
252
+ }, r.$locale = function() {
253
+ return M[this.$L];
254
+ }, r.locale = function(t, n) {
255
+ if (!t) return this.$L;
256
+ var e = this.clone(), s = J(t, n, !0);
257
+ return s && (e.$L = s), e;
258
+ }, r.clone = function() {
259
+ return u.w(this.$d, this);
260
+ }, r.toDate = function() {
261
+ return new Date(this.valueOf());
262
+ }, r.toJSON = function() {
263
+ return this.isValid() ? this.toISOString() : null;
264
+ }, r.toISOString = function() {
265
+ return this.$d.toISOString();
266
+ }, r.toString = function() {
267
+ return this.$d.toUTCString();
268
+ }, a;
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) {
271
+ Q[a[1]] = function(r) {
272
+ return this.$g(r, a[0], a[1]);
273
+ };
274
+ })), h.extend = function(a, r) {
275
+ return a.$i || (a(r, Z, h), a.$i = !0), h;
276
+ }, h.locale = J, h.isDayjs = R, h.unix = function(a) {
277
+ return h(1e3 * a);
278
+ }, h.en = M[b], h.Ls = M, h.p = {}, h;
279
+ }));
280
+ })(P)), P.exports;
281
+ }
282
+ var ut = ot();
283
+ const G = /* @__PURE__ */ st(ut), dt = {
284
+ __name: "OcOverviewMonthlyBarChart",
285
+ props: {
286
+ variant: {
287
+ type: String,
288
+ validator: (H) => ["primary", "purple"].includes(H)
289
+ },
290
+ currency: String,
291
+ showTooltip: Boolean,
292
+ showLegend: Boolean,
293
+ showGrid: Boolean,
294
+ chartData: Array,
295
+ labelData: Array,
296
+ yAxisFormatter: Function,
297
+ xAxisFormatter: Function,
298
+ tooltipFormatter: Function,
299
+ tooltipValueFormatter: Function
300
+ },
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));
304
+ const V = (o, l = "SGD") => (typeof o == "number" ? o : Number(o)).toLocaleString("en-US", {
305
+ minimumFractionDigits: 2,
306
+ maximumFractionDigits: 2
307
+ }), j = (o, l = !1) => l ? G(o).format("DD MMM").toUpperCase() : G(o).format("ddd DD/MM").toUpperCase(), O = (o) => {
308
+ const l = [...g.chartData].sort((D, v) => v - D);
309
+ return o === l[0] ? "#4C8AFD" : o === l[1] ? "#80ACFE" : "#CCDEFE";
310
+ }, _ = U(() => ({
311
+ xAxis: {
312
+ data: (g.labelData || []).map((o) => j(o, w.value)),
313
+ splitLine: { show: !1 },
314
+ axisLine: { show: !1 },
315
+ axisTick: { show: !1 },
316
+ axisLabel: {
317
+ color: "#9295A5",
318
+ fontSize: 10,
319
+ margin: 4,
320
+ width: 70,
321
+ interval: w.value ? 3 : 0
322
+ }
323
+ },
324
+ tooltip: {
325
+ trigger: "axis",
326
+ borderWidth: 0,
327
+ padding: 0,
328
+ axisPointer: {
329
+ type: "line",
330
+ lineStyle: { color: "#2465DE" }
331
+ },
332
+ formatter: (o) => {
333
+ const l = g.labelData[o[0].dataIndex], D = G(l).format("DD MMM YYYY"), v = o[0].value;
334
+ return `
335
+ <div class="py-3 px-4">
336
+ <div class="flex items-center gap-2">
337
+ <span class="text-xs font-medium text-oc-text-300">${D}</span>
338
+ </div>
339
+ <div class="flex items-center gap-2">
340
+ <span class="font-semibold text-oc-text font-reddit-mono">${g.currency} ${V(v)}</span>
341
+ </div>
342
+ </div>
343
+ `;
344
+ }
345
+ },
346
+ legend: {},
347
+ yAxis: {
348
+ axisLabel: {
349
+ align: "center",
350
+ fontSize: 10,
351
+ color: "#9295A5",
352
+ margin: 20,
353
+ formatter: (o) => o && `${(o / 1e3).toFixed(1)}K`
354
+ },
355
+ splitLine: { show: !1 }
356
+ },
357
+ grid: {
358
+ left: "0",
359
+ right: "0",
360
+ bottom: "0",
361
+ top: "20",
362
+ containLabel: !0
363
+ },
364
+ animation: !1,
365
+ series: [{
366
+ id: "myBar",
367
+ data: g.chartData,
368
+ type: "bar",
369
+ barCategoryGap: 4,
370
+ itemStyle: {
371
+ borderRadius: w.value ? [100, 100, 0, 0] : [4, 4, 0, 0],
372
+ color: ({ value: o }) => O(o)
373
+ },
374
+ clip: !0
375
+ }]
376
+ })), k = U(() => (g.labelData || []).map((o, l) => G(o).day() === 6 && l + 1 < g.labelData.length ? [l, l + 1] : null).filter(Boolean)), x = {
377
+ itemStyle: {
378
+ color: {
379
+ type: "linear",
380
+ x: 0,
381
+ y: 0,
382
+ x2: 0,
383
+ y2: 1,
384
+ colorStops: [
385
+ { offset: 0, color: "rgba(53, 109, 255, 0.08)" },
386
+ { offset: 1, color: "rgba(36, 93, 239, 0.01)" }
387
+ ],
388
+ global: !1
389
+ }
390
+ }
391
+ }, L = tt(), { chart: d } = at(L, _), N = (o, l, D = !1) => {
392
+ const v = o.getModel().getSeriesByType("bar"), z = v == null ? void 0 : v.map((b) => b.getData())[0], W = z.count(), C = [];
393
+ return l.forEach((b) => {
394
+ if (b < W) {
395
+ const M = z.getItemLayout(b);
396
+ C.push([
397
+ { x: M.x - 2 },
398
+ { x: M.x + M.width + 2 }
399
+ ]);
400
+ }
401
+ }), D && C.length > 0 ? [[
402
+ { x: C[0][0].x },
403
+ { x: C[C.length - 1][1].x }
404
+ ]] : C;
405
+ }, S = () => {
406
+ var o;
407
+ if (d.value)
408
+ if (w.value) {
409
+ const l = (o = k.value) == null ? void 0 : o.map(
410
+ (v) => N(d.value, v, !0).flat()
411
+ ), D = {
412
+ series: {
413
+ id: "myBar",
414
+ markArea: {
415
+ ...x,
416
+ data: l
417
+ }
418
+ }
419
+ };
420
+ d.value.setOption(D);
421
+ } else {
422
+ const l = {
423
+ series: {
424
+ id: "myBar",
425
+ markArea: {
426
+ data: []
427
+ }
428
+ }
429
+ };
430
+ d.value.setOption(l);
431
+ }
432
+ };
433
+ return et([d, w], () => {
434
+ d.value && S();
435
+ }), (o, l) => (nt(), rt("div", {
436
+ ref_key: "barChart",
437
+ ref: L,
438
+ class: "w-full"
439
+ }, null, 512));
440
+ }
441
+ };
442
+ export {
443
+ dt as default
444
+ };
@@ -1,27 +1,27 @@
1
- import { ref as m, computed as y, watch as x, nextTick as w, createElementBlock as u, openBlock as d, createElementVNode as a, createCommentVNode as C, toDisplayString as f, Fragment as S, renderList as k, normalizeStyle as V } from "vue";
1
+ import { ref as f, computed as y, watch as x, nextTick as w, createElementBlock as i, openBlock as u, createElementVNode as a, createCommentVNode as C, toDisplayString as d, Fragment as k, renderList as S, normalizeStyle as V } from "vue";
2
2
  import { u as L } from "./useChart-D5nAyTGV.js";
3
- import "./dayjs.min-CTPVfFeV.js";
4
3
  const F = { 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" }, P = { class: "text-lg font-semibold font-reddit-mono" }, z = {
5
4
  key: 0,
6
5
  class: "mt-4 flex flex-wrap gap-3 justify-center"
7
6
  }, B = { class: "text-sm" }, $ = {
8
7
  __name: "OcOverviewPieChart",
9
8
  props: {
10
- chartData: Array
9
+ chartData: Array,
10
+ currency: String
11
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", {
12
+ setup(o) {
13
+ const r = o, s = f(""), n = f(0), b = (e) => (typeof e == "number" ? e : Number(e)).toLocaleString("en-US", {
14
14
  minimumFractionDigits: 2,
15
15
  maximumFractionDigits: 2
16
- }), _ = (e) => {
16
+ }), g = (e) => {
17
17
  const t = typeof e == "number" ? e : Number(e);
18
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 = () => {
19
+ }, l = y(() => !r.chartData || r.chartData.length === 0 ? 0 : r.chartData.reduce((e, t) => e + (t.value || 0), 0)), h = () => {
20
20
  s.value = "Total", n.value = l.value;
21
- }, D = y(() => ({
21
+ }, _ = y(() => ({
22
22
  series: [{
23
23
  id: "overviewPieChart",
24
- data: o.chartData || [],
24
+ data: r.chartData || [],
25
25
  type: "pie",
26
26
  radius: ["80%", "100%"],
27
27
  avoidLabelOverlap: !1,
@@ -52,19 +52,19 @@ const F = { class: "flex flex-col items-center justify-center" }, N = { class: "
52
52
  label: { show: !1 }
53
53
  }
54
54
  }]
55
- })), v = m(), { chart: p } = L(v, D), g = (e) => o.chartData[e].itemStyle.color;
55
+ })), v = f(), { chart: p } = L(v, _), D = (e) => r.chartData[e].itemStyle.color;
56
56
  return x(p, async (e) => {
57
57
  e && (await w(), h(), e.on("mouseover", "series", (t) => {
58
58
  if (t.componentType === "series" && t.seriesType === "pie") {
59
- const c = t.name || "Unknown", i = t.value || 0;
60
- s.value = `${c} (${_(i)}%)`, n.value = t.value || 0;
59
+ const m = t.name || "Unknown", c = t.value || 0;
60
+ s.value = `${m} (${g(c)}%)`, n.value = t.value || 0;
61
61
  }
62
62
  }), e.on("mouseout", "series", () => {
63
63
  s.value = "Total", n.value = l.value;
64
64
  }));
65
- }), x(() => o.chartData, () => {
65
+ }), x(() => r.chartData, () => {
66
66
  p.value && h();
67
- }, { deep: !0 }), (e, t) => (d(), u("div", F, [
67
+ }, { deep: !0 }), (e, t) => (u(), i("div", F, [
68
68
  a("div", N, [
69
69
  a("div", {
70
70
  ref_key: "pieChart",
@@ -73,21 +73,21 @@ const F = { class: "flex flex-col items-center justify-center" }, N = { class: "
73
73
  }, null, 512),
74
74
  a("div", T, [
75
75
  a("div", O, [
76
- a("div", j, f(s.value), 1),
77
- a("div", P, "SGD " + f(b(n.value)), 1)
76
+ a("div", j, d(s.value), 1),
77
+ a("div", P, d(o.currency) + " " + d(b(n.value)), 1)
78
78
  ])
79
79
  ])
80
80
  ]),
81
- r.chartData && r.chartData.length > 0 ? (d(), u("div", z, [
82
- (d(!0), u(S, null, k(r.chartData, (c, i) => (d(), u("div", {
83
- key: i,
81
+ o.chartData && o.chartData.length > 0 ? (u(), i("div", z, [
82
+ (u(!0), i(k, null, S(o.chartData, (m, c) => (u(), i("div", {
83
+ key: c,
84
84
  class: "flex items-center gap-2 cursor-pointer hover:opacity-80 transition-opacity"
85
85
  }, [
86
86
  a("div", {
87
87
  class: "w-3 h-3 rounded-full",
88
- style: V({ backgroundColor: g(i) })
88
+ style: V({ backgroundColor: D(c) })
89
89
  }, null, 4),
90
- a("span", B, f(c.name), 1)
90
+ a("span", B, d(m.name), 1)
91
91
  ]))), 128))
92
92
  ])) : C("", !0)
93
93
  ]));
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.62.0",
4
+ "version": "1.64.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.62.0",
38
+ "@orchidui/core": "1.64.0",
39
39
  "lottie-web": "^5.12.2",
40
40
  "quill": "^2.0.3",
41
41
  "quill-better-table": "^1.2.10",
@@ -1,163 +0,0 @@
1
- import { computed as i, ref as w, watch as F, createElementBlock as M, openBlock as S } from "vue";
2
- import { u as B } from "./useChart-D5nAyTGV.js";
3
- import { d as m } from "./dayjs.min-CTPVfFeV.js";
4
- const E = {
5
- __name: "OcOverviewMonthlyBarChart",
6
- props: {
7
- variant: {
8
- type: String,
9
- validator: (u) => ["primary", "purple"].includes(u)
10
- },
11
- showTooltip: Boolean,
12
- showLegend: Boolean,
13
- showGrid: Boolean,
14
- chartData: Array,
15
- labelData: Array,
16
- yAxisFormatter: Function,
17
- xAxisFormatter: Function,
18
- tooltipFormatter: Function,
19
- tooltipValueFormatter: Function
20
- },
21
- setup(u) {
22
- const e = u, 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
- minimumFractionDigits: 2,
26
- maximumFractionDigits: 2
27
- }), y = (t, a = !1) => a ? m(t).format("DD MMM").toUpperCase() : m(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
- xAxis: {
32
- data: e.labelData.map((t) => y(t, s.value)),
33
- splitLine: { show: !1 },
34
- axisLine: { show: !1 },
35
- axisTick: { show: !1 },
36
- axisLabel: {
37
- color: "#9295A5",
38
- fontSize: 10,
39
- margin: 4,
40
- width: 70,
41
- interval: s.value ? 3 : 0
42
- }
43
- },
44
- tooltip: {
45
- trigger: "axis",
46
- borderWidth: 0,
47
- padding: 0,
48
- axisPointer: {
49
- type: "line",
50
- lineStyle: { color: "#2465DE" }
51
- },
52
- formatter: (t) => {
53
- const a = e.labelData[t[0].dataIndex], r = m(a).format("DD MMM YYYY"), l = t[0].value;
54
- return `
55
- <div class="py-3 px-4">
56
- <div class="flex items-center gap-2">
57
- <span class="text-xs font-medium text-oc-text-300">${r}</span>
58
- </div>
59
- <div class="flex items-center gap-2">
60
- <span class="font-semibold text-oc-text font-reddit-mono">SGD ${h(l)}</span>
61
- </div>
62
- </div>
63
- `;
64
- }
65
- },
66
- legend: {},
67
- yAxis: {
68
- axisLabel: {
69
- align: "center",
70
- fontSize: 10,
71
- color: "#9295A5",
72
- margin: 20,
73
- formatter: (t) => t && `${(t / 1e3).toFixed(1)}K`
74
- },
75
- splitLine: { show: !1 }
76
- },
77
- grid: {
78
- left: "0",
79
- right: "0",
80
- bottom: "0",
81
- top: "20",
82
- containLabel: !0
83
- },
84
- animation: !1,
85
- series: [{
86
- id: "myBar",
87
- data: e.chartData,
88
- type: "bar",
89
- barCategoryGap: 4,
90
- itemStyle: {
91
- borderRadius: s.value ? [100, 100, 0, 0] : [4, 4, 0, 0],
92
- color: ({ value: t }) => g(t)
93
- },
94
- clip: !0
95
- }]
96
- })), b = i(() => e.labelData.map((t, a) => m(t).day() === 6 && a + 1 < e.labelData.length ? [a, a + 1] : null).filter(Boolean)), v = {
97
- itemStyle: {
98
- color: {
99
- type: "linear",
100
- x: 0,
101
- y: 0,
102
- x2: 0,
103
- y2: 1,
104
- colorStops: [
105
- { offset: 0, color: "rgba(53, 109, 255, 0.08)" },
106
- { offset: 1, color: "rgba(36, 93, 239, 0.01)" }
107
- ],
108
- global: !1
109
- }
110
- }
111
- }, d = w(), { chart: o } = B(d, D), A = (t, a, r = !1) => {
112
- const f = t.getModel().getSeriesByType("bar").map((c) => c.getData())[0], k = f.count(), n = [];
113
- return a.forEach((c) => {
114
- if (c < k) {
115
- const p = f.getItemLayout(c);
116
- n.push([
117
- { x: p.x - 2 },
118
- { x: p.x + p.width + 2 }
119
- ]);
120
- }
121
- }), r && n.length > 0 ? [[
122
- { x: n[0][0].x },
123
- { x: n[n.length - 1][1].x }
124
- ]] : n;
125
- }, C = () => {
126
- if (o.value)
127
- if (s.value) {
128
- const t = b.value.map(
129
- (r) => A(o.value, r, !0).flat()
130
- ), a = {
131
- series: {
132
- id: "myBar",
133
- markArea: {
134
- ...v,
135
- data: t
136
- }
137
- }
138
- };
139
- o.value.setOption(a);
140
- } else {
141
- const t = {
142
- series: {
143
- id: "myBar",
144
- markArea: {
145
- data: []
146
- }
147
- }
148
- };
149
- o.value.setOption(t);
150
- }
151
- };
152
- return F([o, s], () => {
153
- o.value && C();
154
- }), (t, a) => (S(), M("div", {
155
- ref_key: "barChart",
156
- ref: d,
157
- class: "w-full"
158
- }, null, 512));
159
- }
160
- };
161
- export {
162
- E as default
163
- };
@@ -1,284 +0,0 @@
1
- import { g as G } from "./_commonjsHelpers-B4e78b8K.js";
2
- var W = { exports: {} }, K = W.exports, E;
3
- function X() {
4
- return E || (E = 1, (function(V, et) {
5
- (function(A, x) {
6
- V.exports = x();
7
- })(K, (function() {
8
- var A = 1e3, x = 6e4, U = 36e5, I = "millisecond", S = "second", w = "minute", _ = "hour", M = "day", H = "week", m = "month", J = "quarter", y = "year", O = "date", Z = "Invalid Date", B = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, P = /\[([^\]]+)]|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, Q = { 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(s) {
9
- var n = ["th", "st", "nd", "rd"], t = s % 100;
10
- return "[" + s + (n[(t - 20) % 10] || n[t] || n[0]) + "]";
11
- } }, F = function(s, n, t) {
12
- var r = String(s);
13
- return !r || r.length >= n ? s : "" + Array(n + 1 - r.length).join(t) + s;
14
- }, R = { s: F, z: function(s) {
15
- var n = -s.utcOffset(), t = Math.abs(n), r = Math.floor(t / 60), e = t % 60;
16
- return (n <= 0 ? "+" : "-") + F(r, 2, "0") + ":" + F(e, 2, "0");
17
- }, m: function s(n, t) {
18
- if (n.date() < t.date()) return -s(t, n);
19
- var r = 12 * (t.year() - n.year()) + (t.month() - n.month()), e = n.clone().add(r, m), i = t - e < 0, u = n.clone().add(r + (i ? -1 : 1), m);
20
- return +(-(r + (t - e) / (i ? e - u : u - e)) || 0);
21
- }, a: function(s) {
22
- return s < 0 ? Math.ceil(s) || 0 : Math.floor(s);
23
- }, p: function(s) {
24
- return { M: m, y, w: H, d: M, D: O, h: _, m: w, s: S, ms: I, Q: J }[s] || String(s || "").toLowerCase().replace(/s$/, "");
25
- }, u: function(s) {
26
- return s === void 0;
27
- } }, k = "en", D = {};
28
- D[k] = Q;
29
- var q = "$isDayjsObject", N = function(s) {
30
- return s instanceof C || !(!s || !s[q]);
31
- }, T = function s(n, t, r) {
32
- var e;
33
- if (!n) return k;
34
- if (typeof n == "string") {
35
- var i = n.toLowerCase();
36
- D[i] && (e = i), t && (D[i] = t, e = i);
37
- var u = n.split("-");
38
- if (!e && u.length > 1) return s(u[0]);
39
- } else {
40
- var o = n.name;
41
- D[o] = n, e = o;
42
- }
43
- return !r && e && (k = e), e || !r && k;
44
- }, f = function(s, n) {
45
- if (N(s)) return s.clone();
46
- var t = typeof n == "object" ? n : {};
47
- return t.date = s, t.args = arguments, new C(t);
48
- }, a = R;
49
- a.l = T, a.i = N, a.w = function(s, n) {
50
- return f(s, { locale: n.$L, utc: n.$u, x: n.$x, $offset: n.$offset });
51
- };
52
- var C = (function() {
53
- function s(t) {
54
- this.$L = T(t.locale, null, !0), this.parse(t), this.$x = this.$x || t.x || {}, this[q] = !0;
55
- }
56
- var n = s.prototype;
57
- return n.parse = function(t) {
58
- this.$d = (function(r) {
59
- var e = r.date, i = r.utc;
60
- if (e === null) return /* @__PURE__ */ new Date(NaN);
61
- if (a.u(e)) return /* @__PURE__ */ new Date();
62
- if (e instanceof Date) return new Date(e);
63
- if (typeof e == "string" && !/Z$/i.test(e)) {
64
- var u = e.match(B);
65
- if (u) {
66
- var o = u[2] - 1 || 0, c = (u[7] || "0").substring(0, 3);
67
- return i ? new Date(Date.UTC(u[1], o, u[3] || 1, u[4] || 0, u[5] || 0, u[6] || 0, c)) : new Date(u[1], o, u[3] || 1, u[4] || 0, u[5] || 0, u[6] || 0, c);
68
- }
69
- }
70
- return new Date(e);
71
- })(t), this.init();
72
- }, n.init = function() {
73
- var t = this.$d;
74
- this.$y = t.getFullYear(), this.$M = t.getMonth(), this.$D = t.getDate(), this.$W = t.getDay(), this.$H = t.getHours(), this.$m = t.getMinutes(), this.$s = t.getSeconds(), this.$ms = t.getMilliseconds();
75
- }, n.$utils = function() {
76
- return a;
77
- }, n.isValid = function() {
78
- return this.$d.toString() !== Z;
79
- }, n.isSame = function(t, r) {
80
- var e = f(t);
81
- return this.startOf(r) <= e && e <= this.endOf(r);
82
- }, n.isAfter = function(t, r) {
83
- return f(t) < this.startOf(r);
84
- }, n.isBefore = function(t, r) {
85
- return this.endOf(r) < f(t);
86
- }, n.$g = function(t, r, e) {
87
- return a.u(t) ? this[r] : this.set(e, t);
88
- }, n.unix = function() {
89
- return Math.floor(this.valueOf() / 1e3);
90
- }, n.valueOf = function() {
91
- return this.$d.getTime();
92
- }, n.startOf = function(t, r) {
93
- var e = this, i = !!a.u(r) || r, u = a.p(t), o = function(p, $) {
94
- var v = a.w(e.$u ? Date.UTC(e.$y, $, p) : new Date(e.$y, $, p), e);
95
- return i ? v : v.endOf(M);
96
- }, c = function(p, $) {
97
- return a.w(e.toDate()[p].apply(e.toDate("s"), (i ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice($)), e);
98
- }, h = this.$W, d = this.$M, l = this.$D, b = "set" + (this.$u ? "UTC" : "");
99
- switch (u) {
100
- case y:
101
- return i ? o(1, 0) : o(31, 11);
102
- case m:
103
- return i ? o(1, d) : o(0, d + 1);
104
- case H:
105
- var g = this.$locale().weekStart || 0, Y = (h < g ? h + 7 : h) - g;
106
- return o(i ? l - Y : l + (6 - Y), d);
107
- case M:
108
- case O:
109
- return c(b + "Hours", 0);
110
- case _:
111
- return c(b + "Minutes", 1);
112
- case w:
113
- return c(b + "Seconds", 2);
114
- case S:
115
- return c(b + "Milliseconds", 3);
116
- default:
117
- return this.clone();
118
- }
119
- }, n.endOf = function(t) {
120
- return this.startOf(t, !1);
121
- }, n.$set = function(t, r) {
122
- var e, i = a.p(t), u = "set" + (this.$u ? "UTC" : ""), o = (e = {}, e[M] = u + "Date", e[O] = u + "Date", e[m] = u + "Month", e[y] = u + "FullYear", e[_] = u + "Hours", e[w] = u + "Minutes", e[S] = u + "Seconds", e[I] = u + "Milliseconds", e)[i], c = i === M ? this.$D + (r - this.$W) : r;
123
- if (i === m || i === y) {
124
- var h = this.clone().set(O, 1);
125
- h.$d[o](c), h.init(), this.$d = h.set(O, Math.min(this.$D, h.daysInMonth())).$d;
126
- } else o && this.$d[o](c);
127
- return this.init(), this;
128
- }, n.set = function(t, r) {
129
- return this.clone().$set(t, r);
130
- }, n.get = function(t) {
131
- return this[a.p(t)]();
132
- }, n.add = function(t, r) {
133
- var e, i = this;
134
- t = Number(t);
135
- var u = a.p(r), o = function(d) {
136
- var l = f(i);
137
- return a.w(l.date(l.date() + Math.round(d * t)), i);
138
- };
139
- if (u === m) return this.set(m, this.$M + t);
140
- if (u === y) return this.set(y, this.$y + t);
141
- if (u === M) return o(1);
142
- if (u === H) return o(7);
143
- var c = (e = {}, e[w] = x, e[_] = U, e[S] = A, e)[u] || 1, h = this.$d.getTime() + t * c;
144
- return a.w(h, this);
145
- }, n.subtract = function(t, r) {
146
- return this.add(-1 * t, r);
147
- }, n.format = function(t) {
148
- var r = this, e = this.$locale();
149
- if (!this.isValid()) return e.invalidDate || Z;
150
- var i = t || "YYYY-MM-DDTHH:mm:ssZ", u = a.z(this), o = this.$H, c = this.$m, h = this.$M, d = e.weekdays, l = e.months, b = e.meridiem, g = function($, v, j, L) {
151
- return $ && ($[v] || $(r, i)) || j[v].slice(0, L);
152
- }, Y = function($) {
153
- return a.s(o % 12 || 12, $, "0");
154
- }, p = b || function($, v, j) {
155
- var L = $ < 12 ? "AM" : "PM";
156
- return j ? L.toLowerCase() : L;
157
- };
158
- return i.replace(P, (function($, v) {
159
- return v || (function(j) {
160
- switch (j) {
161
- case "YY":
162
- return String(r.$y).slice(-2);
163
- case "YYYY":
164
- return a.s(r.$y, 4, "0");
165
- case "M":
166
- return h + 1;
167
- case "MM":
168
- return a.s(h + 1, 2, "0");
169
- case "MMM":
170
- return g(e.monthsShort, h, l, 3);
171
- case "MMMM":
172
- return g(l, h);
173
- case "D":
174
- return r.$D;
175
- case "DD":
176
- return a.s(r.$D, 2, "0");
177
- case "d":
178
- return String(r.$W);
179
- case "dd":
180
- return g(e.weekdaysMin, r.$W, d, 2);
181
- case "ddd":
182
- return g(e.weekdaysShort, r.$W, d, 3);
183
- case "dddd":
184
- return d[r.$W];
185
- case "H":
186
- return String(o);
187
- case "HH":
188
- return a.s(o, 2, "0");
189
- case "h":
190
- return Y(1);
191
- case "hh":
192
- return Y(2);
193
- case "a":
194
- return p(o, c, !0);
195
- case "A":
196
- return p(o, c, !1);
197
- case "m":
198
- return String(c);
199
- case "mm":
200
- return a.s(c, 2, "0");
201
- case "s":
202
- return String(r.$s);
203
- case "ss":
204
- return a.s(r.$s, 2, "0");
205
- case "SSS":
206
- return a.s(r.$ms, 3, "0");
207
- case "Z":
208
- return u;
209
- }
210
- return null;
211
- })($) || u.replace(":", "");
212
- }));
213
- }, n.utcOffset = function() {
214
- return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
215
- }, n.diff = function(t, r, e) {
216
- var i, u = this, o = a.p(r), c = f(t), h = (c.utcOffset() - this.utcOffset()) * x, d = this - c, l = function() {
217
- return a.m(u, c);
218
- };
219
- switch (o) {
220
- case y:
221
- i = l() / 12;
222
- break;
223
- case m:
224
- i = l();
225
- break;
226
- case J:
227
- i = l() / 3;
228
- break;
229
- case H:
230
- i = (d - h) / 6048e5;
231
- break;
232
- case M:
233
- i = (d - h) / 864e5;
234
- break;
235
- case _:
236
- i = d / U;
237
- break;
238
- case w:
239
- i = d / x;
240
- break;
241
- case S:
242
- i = d / A;
243
- break;
244
- default:
245
- i = d;
246
- }
247
- return e ? i : a.a(i);
248
- }, n.daysInMonth = function() {
249
- return this.endOf(m).$D;
250
- }, n.$locale = function() {
251
- return D[this.$L];
252
- }, n.locale = function(t, r) {
253
- if (!t) return this.$L;
254
- var e = this.clone(), i = T(t, r, !0);
255
- return i && (e.$L = i), e;
256
- }, n.clone = function() {
257
- return a.w(this.$d, this);
258
- }, n.toDate = function() {
259
- return new Date(this.valueOf());
260
- }, n.toJSON = function() {
261
- return this.isValid() ? this.toISOString() : null;
262
- }, n.toISOString = function() {
263
- return this.$d.toISOString();
264
- }, n.toString = function() {
265
- return this.$d.toUTCString();
266
- }, s;
267
- })(), z = C.prototype;
268
- return f.prototype = z, [["$ms", I], ["$s", S], ["$m", w], ["$H", _], ["$W", M], ["$M", m], ["$y", y], ["$D", O]].forEach((function(s) {
269
- z[s[1]] = function(n) {
270
- return this.$g(n, s[0], s[1]);
271
- };
272
- })), f.extend = function(s, n) {
273
- return s.$i || (s(n, C, f), s.$i = !0), f;
274
- }, f.locale = T, f.isDayjs = N, f.unix = function(s) {
275
- return f(1e3 * s);
276
- }, f.en = D[k], f.Ls = D, f.p = {}, f;
277
- }));
278
- })(W)), W.exports;
279
- }
280
- var tt = X();
281
- const rt = /* @__PURE__ */ G(tt);
282
- export {
283
- rt as d
284
- };