@orchidui/dashboard 1.61.0 → 1.63.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-Dw0kACqh.js +443 -0
- package/dist/{OcOverviewPieChart-DZaeNduU.js → OcOverviewPieChart-OH9erQai.js} +19 -19
- package/package.json +2 -2
- package/dist/OcOverviewMonthlyBarChart-zvNIg1f3.js +0 -163
- package/dist/dayjs.min-CTPVfFeV.js +0 -284
|
@@ -0,0 +1,443 @@
|
|
|
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(b, A) {
|
|
8
|
+
H.exports = A();
|
|
9
|
+
})(it, (function() {
|
|
10
|
+
var b = 1e3, A = 6e4, V = 36e5, j = "millisecond", w = "second", O = "minute", _ = "hour", M = "day", F = "week", d = "month", N = "quarter", x = "year", o = "date", f = "Invalid Date", D = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, T = /\[([^\]]+)]|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
|
+
}, k = { 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: x, w: F, d: M, D: o, h: _, m: O, s: w, ms: j, Q: N }[a] || String(a || "").toLowerCase().replace(/s$/, "");
|
|
27
|
+
}, u: function(a) {
|
|
28
|
+
return a === void 0;
|
|
29
|
+
} }, S = "en", v = {};
|
|
30
|
+
v[S] = 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 S;
|
|
36
|
+
if (typeof r == "string") {
|
|
37
|
+
var s = r.toLowerCase();
|
|
38
|
+
v[s] && (e = s), t && (v[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
|
+
v[c] = r, e = c;
|
|
44
|
+
}
|
|
45
|
+
return !n && e && (S = e), e || !n && S;
|
|
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 = k;
|
|
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, l = (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, l)) : new Date(i[1], c, i[3] || 1, i[4] || 0, i[5] || 0, i[6] || 0, l);
|
|
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() !== f;
|
|
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(Y, p) {
|
|
96
|
+
var C = u.w(e.$u ? Date.UTC(e.$y, p, Y) : new Date(e.$y, p, Y), e);
|
|
97
|
+
return s ? C : C.endOf(M);
|
|
98
|
+
}, l = function(Y, p) {
|
|
99
|
+
return u.w(e.toDate()[Y].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 x:
|
|
103
|
+
return s ? c(1, 0) : c(31, 11);
|
|
104
|
+
case d:
|
|
105
|
+
return s ? c(1, $) : c(0, $ + 1);
|
|
106
|
+
case F:
|
|
107
|
+
var L = this.$locale().weekStart || 0, E = (m < L ? m + 7 : m) - L;
|
|
108
|
+
return c(s ? y - E : y + (6 - E), $);
|
|
109
|
+
case M:
|
|
110
|
+
case o:
|
|
111
|
+
return l(B + "Hours", 0);
|
|
112
|
+
case _:
|
|
113
|
+
return l(B + "Minutes", 1);
|
|
114
|
+
case O:
|
|
115
|
+
return l(B + "Seconds", 2);
|
|
116
|
+
case w:
|
|
117
|
+
return l(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[M] = i + "Date", e[o] = i + "Date", e[d] = i + "Month", e[x] = i + "FullYear", e[_] = i + "Hours", e[O] = i + "Minutes", e[w] = i + "Seconds", e[j] = i + "Milliseconds", e)[s], l = s === M ? this.$D + (n - this.$W) : n;
|
|
125
|
+
if (s === d || s === x) {
|
|
126
|
+
var m = this.clone().set(o, 1);
|
|
127
|
+
m.$d[c](l), m.init(), this.$d = m.set(o, Math.min(this.$D, m.daysInMonth())).$d;
|
|
128
|
+
} else c && this.$d[c](l);
|
|
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 === x) return this.set(x, this.$y + t);
|
|
143
|
+
if (i === M) return c(1);
|
|
144
|
+
if (i === F) return c(7);
|
|
145
|
+
var l = (e = {}, e[O] = A, e[_] = V, e[w] = b, e)[i] || 1, m = this.$d.getTime() + t * l;
|
|
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 || f;
|
|
152
|
+
var s = t || "YYYY-MM-DDTHH:mm:ssZ", i = u.z(this), c = this.$H, l = this.$m, m = this.$M, $ = e.weekdays, y = e.months, B = e.meridiem, L = function(p, C, I, q) {
|
|
153
|
+
return p && (p[C] || p(n, s)) || I[C].slice(0, q);
|
|
154
|
+
}, E = function(p) {
|
|
155
|
+
return u.s(c % 12 || 12, p, "0");
|
|
156
|
+
}, Y = B || function(p, C, I) {
|
|
157
|
+
var q = p < 12 ? "AM" : "PM";
|
|
158
|
+
return I ? q.toLowerCase() : q;
|
|
159
|
+
};
|
|
160
|
+
return s.replace(T, (function(p, C) {
|
|
161
|
+
return C || (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 L(e.monthsShort, m, y, 3);
|
|
173
|
+
case "MMMM":
|
|
174
|
+
return L(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 L(e.weekdaysMin, n.$W, $, 2);
|
|
183
|
+
case "ddd":
|
|
184
|
+
return L(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 Y(c, l, !0);
|
|
197
|
+
case "A":
|
|
198
|
+
return Y(c, l, !1);
|
|
199
|
+
case "m":
|
|
200
|
+
return String(l);
|
|
201
|
+
case "mm":
|
|
202
|
+
return u.s(l, 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), l = h(t), m = (l.utcOffset() - this.utcOffset()) * A, $ = this - l, y = function() {
|
|
219
|
+
return u.m(i, l);
|
|
220
|
+
};
|
|
221
|
+
switch (c) {
|
|
222
|
+
case x:
|
|
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 F:
|
|
232
|
+
s = ($ - m) / 6048e5;
|
|
233
|
+
break;
|
|
234
|
+
case M:
|
|
235
|
+
s = ($ - m) / 864e5;
|
|
236
|
+
break;
|
|
237
|
+
case _:
|
|
238
|
+
s = $ / V;
|
|
239
|
+
break;
|
|
240
|
+
case O:
|
|
241
|
+
s = $ / A;
|
|
242
|
+
break;
|
|
243
|
+
case w:
|
|
244
|
+
s = $ / b;
|
|
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 v[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", w], ["$m", O], ["$H", _], ["$W", M], ["$M", d], ["$y", x], ["$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 = v[S], h.Ls = v, 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, b = U(() => g.labelData.length === 30), A = U(() => Math.max(...g.chartData));
|
|
303
|
+
U(() => g.chartData.indexOf(A.value));
|
|
304
|
+
const V = (o, f = "SGD") => (typeof o == "number" ? o : Number(o)).toLocaleString("en-US", {
|
|
305
|
+
minimumFractionDigits: 2,
|
|
306
|
+
maximumFractionDigits: 2
|
|
307
|
+
}), j = (o, f = !1) => f ? G(o).format("DD MMM").toUpperCase() : G(o).format("ddd DD/MM").toUpperCase(), w = (o) => {
|
|
308
|
+
const f = [...g.chartData].sort((D, T) => T - D);
|
|
309
|
+
return o === f[0] ? "#4C8AFD" : o === f[1] ? "#80ACFE" : "#CCDEFE";
|
|
310
|
+
}, O = U(() => ({
|
|
311
|
+
xAxis: {
|
|
312
|
+
data: g.labelData.map((o) => j(o, b.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: b.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 f = g.labelData[o[0].dataIndex], D = G(f).format("DD MMM YYYY"), T = 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(T)}</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: b.value ? [100, 100, 0, 0] : [4, 4, 0, 0],
|
|
372
|
+
color: ({ value: o }) => w(o)
|
|
373
|
+
},
|
|
374
|
+
clip: !0
|
|
375
|
+
}]
|
|
376
|
+
})), _ = U(() => g.labelData.map((o, f) => G(o).day() === 6 && f + 1 < g.labelData.length ? [f, f + 1] : null).filter(Boolean)), M = {
|
|
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
|
+
}, F = tt(), { chart: d } = at(F, O), N = (o, f, D = !1) => {
|
|
392
|
+
const z = o.getModel().getSeriesByType("bar").map((S) => S.getData())[0], W = z.count(), k = [];
|
|
393
|
+
return f.forEach((S) => {
|
|
394
|
+
if (S < W) {
|
|
395
|
+
const v = z.getItemLayout(S);
|
|
396
|
+
k.push([
|
|
397
|
+
{ x: v.x - 2 },
|
|
398
|
+
{ x: v.x + v.width + 2 }
|
|
399
|
+
]);
|
|
400
|
+
}
|
|
401
|
+
}), D && k.length > 0 ? [[
|
|
402
|
+
{ x: k[0][0].x },
|
|
403
|
+
{ x: k[k.length - 1][1].x }
|
|
404
|
+
]] : k;
|
|
405
|
+
}, x = () => {
|
|
406
|
+
if (d.value)
|
|
407
|
+
if (b.value) {
|
|
408
|
+
const o = _.value.map(
|
|
409
|
+
(D) => N(d.value, D, !0).flat()
|
|
410
|
+
), f = {
|
|
411
|
+
series: {
|
|
412
|
+
id: "myBar",
|
|
413
|
+
markArea: {
|
|
414
|
+
...M,
|
|
415
|
+
data: o
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
};
|
|
419
|
+
d.value.setOption(f);
|
|
420
|
+
} else {
|
|
421
|
+
const o = {
|
|
422
|
+
series: {
|
|
423
|
+
id: "myBar",
|
|
424
|
+
markArea: {
|
|
425
|
+
data: []
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
};
|
|
429
|
+
d.value.setOption(o);
|
|
430
|
+
}
|
|
431
|
+
};
|
|
432
|
+
return et([d, b], () => {
|
|
433
|
+
d.value && x();
|
|
434
|
+
}), (o, f) => (nt(), rt("div", {
|
|
435
|
+
ref_key: "barChart",
|
|
436
|
+
ref: F,
|
|
437
|
+
class: "w-full"
|
|
438
|
+
}, null, 512));
|
|
439
|
+
}
|
|
440
|
+
};
|
|
441
|
+
export {
|
|
442
|
+
dt as default
|
|
443
|
+
};
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { ref as m, computed as y, watch as x, nextTick as C, createElementBlock as
|
|
2
|
-
import { u as
|
|
3
|
-
|
|
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 = {
|
|
1
|
+
import { ref as m, computed as y, watch as x, nextTick as C, createElementBlock as i, openBlock as u, createElementVNode as a, createCommentVNode as F, toDisplayString as d, Fragment as w, renderList as k, normalizeStyle as V } from "vue";
|
|
2
|
+
import { u as L } from "./useChart-D5nAyTGV.js";
|
|
3
|
+
const S = { 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
4
|
key: 0,
|
|
6
5
|
class: "mt-4 flex flex-wrap gap-3 justify-center"
|
|
7
6
|
}, z = { class: "text-sm" }, U = {
|
|
8
7
|
__name: "OcOverviewPieChart",
|
|
9
8
|
props: {
|
|
10
|
-
chartData: Array
|
|
9
|
+
chartData: Array,
|
|
10
|
+
currency: String
|
|
11
11
|
},
|
|
12
12
|
setup(r) {
|
|
13
|
-
const o = r, s = m(""), n = m(0), b = (e
|
|
13
|
+
const o = r, s = m(""), n = m(0), b = (e) => (typeof e == "number" ? e : Number(e)).toLocaleString("en-US", {
|
|
14
14
|
minimumFractionDigits: 2,
|
|
15
15
|
maximumFractionDigits: 2
|
|
16
|
-
}),
|
|
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
19
|
}, l = y(() => !o.chartData || o.chartData.length === 0 ? 0 : o.chartData.reduce((e, t) => e + (t.value || 0), 0)), h = () => {
|
|
20
20
|
s.value = "Total", n.value = l.value;
|
|
21
|
-
},
|
|
21
|
+
}, _ = y(() => ({
|
|
22
22
|
series: [{
|
|
23
23
|
id: "overviewPieChart",
|
|
24
24
|
data: o.chartData || [],
|
|
@@ -52,22 +52,22 @@ const L = { class: "flex flex-col items-center justify-center" }, N = { class: "
|
|
|
52
52
|
label: { show: !1 }
|
|
53
53
|
}
|
|
54
54
|
}]
|
|
55
|
-
})), v = m(), { chart: p } =
|
|
55
|
+
})), v = m(), { chart: p } = L(v, _), D = (e) => {
|
|
56
56
|
const t = ["#356DFF", "#AEC5FF", "#86FFCC"];
|
|
57
57
|
return t[e % t.length];
|
|
58
58
|
};
|
|
59
59
|
return x(p, async (e) => {
|
|
60
60
|
e && (await C(), h(), e.on("mouseover", "series", (t) => {
|
|
61
61
|
if (t.componentType === "series" && t.seriesType === "pie") {
|
|
62
|
-
const
|
|
63
|
-
s.value = `${
|
|
62
|
+
const f = t.name || "Unknown", c = t.value || 0;
|
|
63
|
+
s.value = `${f} (${g(c)}%)`, n.value = t.value || 0;
|
|
64
64
|
}
|
|
65
65
|
}), e.on("mouseout", "series", () => {
|
|
66
66
|
s.value = "Total", n.value = l.value;
|
|
67
67
|
}));
|
|
68
68
|
}), x(() => o.chartData, () => {
|
|
69
69
|
p.value && h();
|
|
70
|
-
}, { deep: !0 }), (e, t) => (
|
|
70
|
+
}, { deep: !0 }), (e, t) => (u(), i("div", S, [
|
|
71
71
|
a("div", N, [
|
|
72
72
|
a("div", {
|
|
73
73
|
ref_key: "pieChart",
|
|
@@ -76,21 +76,21 @@ const L = { class: "flex flex-col items-center justify-center" }, N = { class: "
|
|
|
76
76
|
}, null, 512),
|
|
77
77
|
a("div", T, [
|
|
78
78
|
a("div", O, [
|
|
79
|
-
a("div", j,
|
|
80
|
-
a("div", E, "
|
|
79
|
+
a("div", j, d(s.value), 1),
|
|
80
|
+
a("div", E, d(r.currency) + " " + d(b(n.value)), 1)
|
|
81
81
|
])
|
|
82
82
|
])
|
|
83
83
|
]),
|
|
84
|
-
r.chartData && r.chartData.length > 0 ? (
|
|
85
|
-
(
|
|
86
|
-
key:
|
|
84
|
+
r.chartData && r.chartData.length > 0 ? (u(), i("div", P, [
|
|
85
|
+
(u(!0), i(w, null, k(r.chartData, (f, c) => (u(), i("div", {
|
|
86
|
+
key: c,
|
|
87
87
|
class: "flex items-center gap-2 cursor-pointer hover:opacity-80 transition-opacity"
|
|
88
88
|
}, [
|
|
89
89
|
a("div", {
|
|
90
90
|
class: "w-3 h-3 rounded-full",
|
|
91
|
-
style:
|
|
91
|
+
style: V({ backgroundColor: D(c) })
|
|
92
92
|
}, null, 4),
|
|
93
|
-
a("span", z, f
|
|
93
|
+
a("span", z, d(f.name), 1)
|
|
94
94
|
]))), 128))
|
|
95
95
|
])) : F("", !0)
|
|
96
96
|
]));
|
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.63.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.63.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
|
-
};
|