m-tool-store 1.0.11 → 1.0.13
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/lib/m-tool-store.js +53 -331
- package/lib/m-tool-store.umd.cjs +1 -1
- package/package.json +7 -4
package/lib/m-tool-store.js
CHANGED
|
@@ -1,348 +1,70 @@
|
|
|
1
|
-
|
|
1
|
+
import d from "dayjs";
|
|
2
|
+
import { default as S } from "dayjs";
|
|
3
|
+
class g {
|
|
2
4
|
//金额格式化 , 千分位
|
|
3
|
-
static formatMoney(
|
|
4
|
-
if (
|
|
5
|
-
let
|
|
6
|
-
if (isNaN(
|
|
7
|
-
let
|
|
8
|
-
return
|
|
5
|
+
static formatMoney(a, n) {
|
|
6
|
+
if (a == null) return "";
|
|
7
|
+
let l = Number(a);
|
|
8
|
+
if (isNaN(l)) return a;
|
|
9
|
+
let o = /([\-\+]?)(\d*)(\.\d+)?/g.exec("" + l), i = o && o[1] || "", e = (o && o[2] || "").split(""), t = o && o[3] || "", s = e.length % 3, u = e.reduce(function(f, _, x) {
|
|
10
|
+
return x + 1 === s || (x + 1 - s) % 3 === 0 ? f + _ + "," : f + _;
|
|
9
11
|
}, "").replace(/\,$/g, "");
|
|
10
|
-
return
|
|
12
|
+
return u === "" && (u = "0"), n != null && (n == 0 ? t && parseFloat(t) > 0.5 ? (t = "", u = parseInt(u) + 1 + "") : t = "" : n > 0 && (!t || t == "0" || t == ".0" ? t = "." + "0".repeat(n) : (t = parseFloat(t).toFixed(2), t >= "1" && (u = parseInt(u) + 1 + "", t = "." + "0".repeat(n)))), t = (t || "").replace("0.", ".")), i + u + t;
|
|
11
13
|
}
|
|
12
14
|
}
|
|
13
|
-
var
|
|
14
|
-
function
|
|
15
|
-
return
|
|
15
|
+
var c = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
16
|
+
function m(r) {
|
|
17
|
+
return r && r.__esModule && Object.prototype.hasOwnProperty.call(r, "default") ? r.default : r;
|
|
16
18
|
}
|
|
17
|
-
var
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
var
|
|
25
|
-
return
|
|
26
|
-
} }, z = function(s, n, t) {
|
|
27
|
-
var r = String(s);
|
|
28
|
-
return !r || r.length >= n ? s : "" + Array(n + 1 - r.length).join(t) + s;
|
|
29
|
-
}, nt = { s: z, z: function(s) {
|
|
30
|
-
var n = -s.utcOffset(), t = Math.abs(n), r = Math.floor(t / 60), e = t % 60;
|
|
31
|
-
return (n <= 0 ? "+" : "-") + z(r, 2, "0") + ":" + z(e, 2, "0");
|
|
32
|
-
}, m: function s(n, t) {
|
|
33
|
-
if (n.date() < t.date()) return -s(t, n);
|
|
34
|
-
var r = 12 * (t.year() - n.year()) + (t.month() - n.month()), e = n.clone().add(r, g), i = t - e < 0, a = n.clone().add(r + (i ? -1 : 1), g);
|
|
35
|
-
return +(-(r + (t - e) / (i ? e - a : a - e)) || 0);
|
|
36
|
-
}, a: function(s) {
|
|
37
|
-
return s < 0 ? Math.ceil(s) || 0 : Math.floor(s);
|
|
38
|
-
}, p: function(s) {
|
|
39
|
-
return { M: g, y: S, w: O, d: _, D: T, h: M, m: u, s: f, ms: w, Q: F }[s] || String(s || "").toLowerCase().replace(/s$/, "");
|
|
40
|
-
}, u: function(s) {
|
|
41
|
-
return s === void 0;
|
|
42
|
-
} }, W = "en", k = {};
|
|
43
|
-
k[W] = et;
|
|
44
|
-
var B = "$isDayjsObject", q = function(s) {
|
|
45
|
-
return s instanceof U || !(!s || !s[B]);
|
|
46
|
-
}, A = function s(n, t, r) {
|
|
47
|
-
var e;
|
|
48
|
-
if (!n) return W;
|
|
49
|
-
if (typeof n == "string") {
|
|
50
|
-
var i = n.toLowerCase();
|
|
51
|
-
k[i] && (e = i), t && (k[i] = t, e = i);
|
|
52
|
-
var a = n.split("-");
|
|
53
|
-
if (!e && a.length > 1) return s(a[0]);
|
|
54
|
-
} else {
|
|
55
|
-
var c = n.name;
|
|
56
|
-
k[c] = n, e = c;
|
|
57
|
-
}
|
|
58
|
-
return !r && e && (W = e), e || !r && W;
|
|
59
|
-
}, h = function(s, n) {
|
|
60
|
-
if (q(s)) return s.clone();
|
|
61
|
-
var t = typeof n == "object" ? n : {};
|
|
62
|
-
return t.date = s, t.args = arguments, new U(t);
|
|
63
|
-
}, o = nt;
|
|
64
|
-
o.l = A, o.i = q, o.w = function(s, n) {
|
|
65
|
-
return h(s, { locale: n.$L, utc: n.$u, x: n.$x, $offset: n.$offset });
|
|
66
|
-
};
|
|
67
|
-
var U = function() {
|
|
68
|
-
function s(t) {
|
|
69
|
-
this.$L = A(t.locale, null, !0), this.parse(t), this.$x = this.$x || t.x || {}, this[B] = !0;
|
|
70
|
-
}
|
|
71
|
-
var n = s.prototype;
|
|
72
|
-
return n.parse = function(t) {
|
|
73
|
-
this.$d = function(r) {
|
|
74
|
-
var e = r.date, i = r.utc;
|
|
75
|
-
if (e === null) return /* @__PURE__ */ new Date(NaN);
|
|
76
|
-
if (o.u(e)) return /* @__PURE__ */ new Date();
|
|
77
|
-
if (e instanceof Date) return new Date(e);
|
|
78
|
-
if (typeof e == "string" && !/Z$/i.test(e)) {
|
|
79
|
-
var a = e.match(X);
|
|
80
|
-
if (a) {
|
|
81
|
-
var c = a[2] - 1 || 0, l = (a[7] || "0").substring(0, 3);
|
|
82
|
-
return i ? new Date(Date.UTC(a[1], c, a[3] || 1, a[4] || 0, a[5] || 0, a[6] || 0, l)) : new Date(a[1], c, a[3] || 1, a[4] || 0, a[5] || 0, a[6] || 0, l);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
return new Date(e);
|
|
86
|
-
}(t), this.init();
|
|
87
|
-
}, n.init = function() {
|
|
88
|
-
var t = this.$d;
|
|
89
|
-
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();
|
|
90
|
-
}, n.$utils = function() {
|
|
91
|
-
return o;
|
|
92
|
-
}, n.isValid = function() {
|
|
93
|
-
return this.$d.toString() !== P;
|
|
94
|
-
}, n.isSame = function(t, r) {
|
|
95
|
-
var e = h(t);
|
|
96
|
-
return this.startOf(r) <= e && e <= this.endOf(r);
|
|
97
|
-
}, n.isAfter = function(t, r) {
|
|
98
|
-
return h(t) < this.startOf(r);
|
|
99
|
-
}, n.isBefore = function(t, r) {
|
|
100
|
-
return this.endOf(r) < h(t);
|
|
101
|
-
}, n.$g = function(t, r, e) {
|
|
102
|
-
return o.u(t) ? this[r] : this.set(e, t);
|
|
103
|
-
}, n.unix = function() {
|
|
104
|
-
return Math.floor(this.valueOf() / 1e3);
|
|
105
|
-
}, n.valueOf = function() {
|
|
106
|
-
return this.$d.getTime();
|
|
107
|
-
}, n.startOf = function(t, r) {
|
|
108
|
-
var e = this, i = !!o.u(r) || r, a = o.p(t), c = function(H, v) {
|
|
109
|
-
var b = o.w(e.$u ? Date.UTC(e.$y, v, H) : new Date(e.$y, v, H), e);
|
|
110
|
-
return i ? b : b.endOf(_);
|
|
111
|
-
}, l = function(H, v) {
|
|
112
|
-
return o.w(e.toDate()[H].apply(e.toDate("s"), (i ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(v)), e);
|
|
113
|
-
}, $ = this.$W, p = this.$M, x = this.$D, j = "set" + (this.$u ? "UTC" : "");
|
|
114
|
-
switch (a) {
|
|
115
|
-
case S:
|
|
116
|
-
return i ? c(1, 0) : c(31, 11);
|
|
117
|
-
case g:
|
|
118
|
-
return i ? c(1, p) : c(0, p + 1);
|
|
119
|
-
case O:
|
|
120
|
-
var L = this.$locale().weekStart || 0, C = ($ < L ? $ + 7 : $) - L;
|
|
121
|
-
return c(i ? x - C : x + (6 - C), p);
|
|
122
|
-
case _:
|
|
123
|
-
case T:
|
|
124
|
-
return l(j + "Hours", 0);
|
|
125
|
-
case M:
|
|
126
|
-
return l(j + "Minutes", 1);
|
|
127
|
-
case u:
|
|
128
|
-
return l(j + "Seconds", 2);
|
|
129
|
-
case f:
|
|
130
|
-
return l(j + "Milliseconds", 3);
|
|
131
|
-
default:
|
|
132
|
-
return this.clone();
|
|
133
|
-
}
|
|
134
|
-
}, n.endOf = function(t) {
|
|
135
|
-
return this.startOf(t, !1);
|
|
136
|
-
}, n.$set = function(t, r) {
|
|
137
|
-
var e, i = o.p(t), a = "set" + (this.$u ? "UTC" : ""), c = (e = {}, e[_] = a + "Date", e[T] = a + "Date", e[g] = a + "Month", e[S] = a + "FullYear", e[M] = a + "Hours", e[u] = a + "Minutes", e[f] = a + "Seconds", e[w] = a + "Milliseconds", e)[i], l = i === _ ? this.$D + (r - this.$W) : r;
|
|
138
|
-
if (i === g || i === S) {
|
|
139
|
-
var $ = this.clone().set(T, 1);
|
|
140
|
-
$.$d[c](l), $.init(), this.$d = $.set(T, Math.min(this.$D, $.daysInMonth())).$d;
|
|
141
|
-
} else c && this.$d[c](l);
|
|
142
|
-
return this.init(), this;
|
|
143
|
-
}, n.set = function(t, r) {
|
|
144
|
-
return this.clone().$set(t, r);
|
|
145
|
-
}, n.get = function(t) {
|
|
146
|
-
return this[o.p(t)]();
|
|
147
|
-
}, n.add = function(t, r) {
|
|
148
|
-
var e, i = this;
|
|
149
|
-
t = Number(t);
|
|
150
|
-
var a = o.p(r), c = function(p) {
|
|
151
|
-
var x = h(i);
|
|
152
|
-
return o.w(x.date(x.date() + Math.round(p * t)), i);
|
|
153
|
-
};
|
|
154
|
-
if (a === g) return this.set(g, this.$M + t);
|
|
155
|
-
if (a === S) return this.set(S, this.$y + t);
|
|
156
|
-
if (a === _) return c(1);
|
|
157
|
-
if (a === O) return c(7);
|
|
158
|
-
var l = (e = {}, e[u] = m, e[M] = D, e[f] = y, e)[a] || 1, $ = this.$d.getTime() + t * l;
|
|
159
|
-
return o.w($, this);
|
|
160
|
-
}, n.subtract = function(t, r) {
|
|
161
|
-
return this.add(-1 * t, r);
|
|
162
|
-
}, n.format = function(t) {
|
|
163
|
-
var r = this, e = this.$locale();
|
|
164
|
-
if (!this.isValid()) return e.invalidDate || P;
|
|
165
|
-
var i = t || "YYYY-MM-DDTHH:mm:ssZ", a = o.z(this), c = this.$H, l = this.$m, $ = this.$M, p = e.weekdays, x = e.months, j = e.meridiem, L = function(v, b, I, N) {
|
|
166
|
-
return v && (v[b] || v(r, i)) || I[b].slice(0, N);
|
|
167
|
-
}, C = function(v) {
|
|
168
|
-
return o.s(c % 12 || 12, v, "0");
|
|
169
|
-
}, H = j || function(v, b, I) {
|
|
170
|
-
var N = v < 12 ? "AM" : "PM";
|
|
171
|
-
return I ? N.toLowerCase() : N;
|
|
172
|
-
};
|
|
173
|
-
return i.replace(tt, function(v, b) {
|
|
174
|
-
return b || function(I) {
|
|
175
|
-
switch (I) {
|
|
176
|
-
case "YY":
|
|
177
|
-
return String(r.$y).slice(-2);
|
|
178
|
-
case "YYYY":
|
|
179
|
-
return o.s(r.$y, 4, "0");
|
|
180
|
-
case "M":
|
|
181
|
-
return $ + 1;
|
|
182
|
-
case "MM":
|
|
183
|
-
return o.s($ + 1, 2, "0");
|
|
184
|
-
case "MMM":
|
|
185
|
-
return L(e.monthsShort, $, x, 3);
|
|
186
|
-
case "MMMM":
|
|
187
|
-
return L(x, $);
|
|
188
|
-
case "D":
|
|
189
|
-
return r.$D;
|
|
190
|
-
case "DD":
|
|
191
|
-
return o.s(r.$D, 2, "0");
|
|
192
|
-
case "d":
|
|
193
|
-
return String(r.$W);
|
|
194
|
-
case "dd":
|
|
195
|
-
return L(e.weekdaysMin, r.$W, p, 2);
|
|
196
|
-
case "ddd":
|
|
197
|
-
return L(e.weekdaysShort, r.$W, p, 3);
|
|
198
|
-
case "dddd":
|
|
199
|
-
return p[r.$W];
|
|
200
|
-
case "H":
|
|
201
|
-
return String(c);
|
|
202
|
-
case "HH":
|
|
203
|
-
return o.s(c, 2, "0");
|
|
204
|
-
case "h":
|
|
205
|
-
return C(1);
|
|
206
|
-
case "hh":
|
|
207
|
-
return C(2);
|
|
208
|
-
case "a":
|
|
209
|
-
return H(c, l, !0);
|
|
210
|
-
case "A":
|
|
211
|
-
return H(c, l, !1);
|
|
212
|
-
case "m":
|
|
213
|
-
return String(l);
|
|
214
|
-
case "mm":
|
|
215
|
-
return o.s(l, 2, "0");
|
|
216
|
-
case "s":
|
|
217
|
-
return String(r.$s);
|
|
218
|
-
case "ss":
|
|
219
|
-
return o.s(r.$s, 2, "0");
|
|
220
|
-
case "SSS":
|
|
221
|
-
return o.s(r.$ms, 3, "0");
|
|
222
|
-
case "Z":
|
|
223
|
-
return a;
|
|
224
|
-
}
|
|
225
|
-
return null;
|
|
226
|
-
}(v) || a.replace(":", "");
|
|
227
|
-
});
|
|
228
|
-
}, n.utcOffset = function() {
|
|
229
|
-
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
230
|
-
}, n.diff = function(t, r, e) {
|
|
231
|
-
var i, a = this, c = o.p(r), l = h(t), $ = (l.utcOffset() - this.utcOffset()) * m, p = this - l, x = function() {
|
|
232
|
-
return o.m(a, l);
|
|
233
|
-
};
|
|
234
|
-
switch (c) {
|
|
235
|
-
case S:
|
|
236
|
-
i = x() / 12;
|
|
237
|
-
break;
|
|
238
|
-
case g:
|
|
239
|
-
i = x();
|
|
240
|
-
break;
|
|
241
|
-
case F:
|
|
242
|
-
i = x() / 3;
|
|
243
|
-
break;
|
|
244
|
-
case O:
|
|
245
|
-
i = (p - $) / 6048e5;
|
|
246
|
-
break;
|
|
247
|
-
case _:
|
|
248
|
-
i = (p - $) / 864e5;
|
|
249
|
-
break;
|
|
250
|
-
case M:
|
|
251
|
-
i = p / D;
|
|
252
|
-
break;
|
|
253
|
-
case u:
|
|
254
|
-
i = p / m;
|
|
255
|
-
break;
|
|
256
|
-
case f:
|
|
257
|
-
i = p / y;
|
|
258
|
-
break;
|
|
259
|
-
default:
|
|
260
|
-
i = p;
|
|
261
|
-
}
|
|
262
|
-
return e ? i : o.a(i);
|
|
263
|
-
}, n.daysInMonth = function() {
|
|
264
|
-
return this.endOf(g).$D;
|
|
265
|
-
}, n.$locale = function() {
|
|
266
|
-
return k[this.$L];
|
|
267
|
-
}, n.locale = function(t, r) {
|
|
268
|
-
if (!t) return this.$L;
|
|
269
|
-
var e = this.clone(), i = A(t, r, !0);
|
|
270
|
-
return i && (e.$L = i), e;
|
|
271
|
-
}, n.clone = function() {
|
|
272
|
-
return o.w(this.$d, this);
|
|
273
|
-
}, n.toDate = function() {
|
|
274
|
-
return new Date(this.valueOf());
|
|
275
|
-
}, n.toJSON = function() {
|
|
276
|
-
return this.isValid() ? this.toISOString() : null;
|
|
277
|
-
}, n.toISOString = function() {
|
|
278
|
-
return this.$d.toISOString();
|
|
279
|
-
}, n.toString = function() {
|
|
280
|
-
return this.$d.toUTCString();
|
|
281
|
-
}, s;
|
|
282
|
-
}(), G = U.prototype;
|
|
283
|
-
return h.prototype = G, [["$ms", w], ["$s", f], ["$m", u], ["$H", M], ["$W", _], ["$M", g], ["$y", S], ["$D", T]].forEach(function(s) {
|
|
284
|
-
G[s[1]] = function(n) {
|
|
285
|
-
return this.$g(n, s[0], s[1]);
|
|
286
|
-
};
|
|
287
|
-
}), h.extend = function(s, n) {
|
|
288
|
-
return s.$i || (s(n, U, h), s.$i = !0), h;
|
|
289
|
-
}, h.locale = A, h.isDayjs = q, h.unix = function(s) {
|
|
290
|
-
return h(1e3 * s);
|
|
291
|
-
}, h.en = k[W], h.Ls = k, h.p = {}, h;
|
|
292
|
-
});
|
|
293
|
-
}(E)), E.exports;
|
|
294
|
-
}
|
|
295
|
-
var rt = V();
|
|
296
|
-
const Z = /* @__PURE__ */ R(rt);
|
|
297
|
-
var K = { exports: {} };
|
|
298
|
-
(function(d, Y) {
|
|
299
|
-
(function(y, m) {
|
|
300
|
-
d.exports = m();
|
|
301
|
-
})(J, function() {
|
|
302
|
-
return function(y, m) {
|
|
303
|
-
m.prototype.weekday = function(D) {
|
|
304
|
-
var w = this.$locale().weekStart || 0, f = this.$W, u = (f < w ? f + 7 : f) - w;
|
|
305
|
-
return this.$utils().u(D) ? u : this.subtract(u, "day").add(D, "day");
|
|
19
|
+
var p = { exports: {} };
|
|
20
|
+
(function(r, a) {
|
|
21
|
+
(function(n, l) {
|
|
22
|
+
r.exports = l();
|
|
23
|
+
})(c, function() {
|
|
24
|
+
return function(n, l) {
|
|
25
|
+
l.prototype.weekday = function(o) {
|
|
26
|
+
var i = this.$locale().weekStart || 0, e = this.$W, t = (e < i ? e + 7 : e) - i;
|
|
27
|
+
return this.$utils().u(o) ? t : this.subtract(t, "day").add(o, "day");
|
|
306
28
|
};
|
|
307
29
|
};
|
|
308
30
|
});
|
|
309
|
-
})(
|
|
310
|
-
var
|
|
311
|
-
const
|
|
312
|
-
var
|
|
313
|
-
(function(
|
|
314
|
-
(function(
|
|
315
|
-
|
|
316
|
-
})(
|
|
317
|
-
function
|
|
318
|
-
return
|
|
31
|
+
})(p);
|
|
32
|
+
var Y = p.exports;
|
|
33
|
+
const y = /* @__PURE__ */ m(Y);
|
|
34
|
+
var h = { exports: {} };
|
|
35
|
+
(function(r, a) {
|
|
36
|
+
(function(n, l) {
|
|
37
|
+
r.exports = l(d);
|
|
38
|
+
})(c, function(n) {
|
|
39
|
+
function l(e) {
|
|
40
|
+
return e && typeof e == "object" && "default" in e ? e : { default: e };
|
|
319
41
|
}
|
|
320
|
-
var
|
|
321
|
-
return
|
|
322
|
-
}, weekStart: 1, yearStart: 4, formats: { LT: "HH:mm", LTS: "HH:mm:ss", L: "YYYY/MM/DD", LL: "YYYY年M月D日", LLL: "YYYY年M月D日Ah点mm分", LLLL: "YYYY年M月D日ddddAh点mm分", l: "YYYY/M/D", ll: "YYYY年M月D日", lll: "YYYY年M月D日 HH:mm", llll: "YYYY年M月D日dddd HH:mm" }, relativeTime: { future: "%s内", past: "%s前", s: "几秒", m: "1 分钟", mm: "%d 分钟", h: "1 小时", hh: "%d 小时", d: "1 天", dd: "%d 天", M: "1 个月", MM: "%d 个月", y: "1 年", yy: "%d 年" }, meridiem: function(
|
|
323
|
-
var
|
|
324
|
-
return
|
|
42
|
+
var o = l(n), i = { name: "zh-cn", weekdays: "星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"), weekdaysShort: "周日_周一_周二_周三_周四_周五_周六".split("_"), weekdaysMin: "日_一_二_三_四_五_六".split("_"), months: "一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"), monthsShort: "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"), ordinal: function(e, t) {
|
|
43
|
+
return t === "W" ? e + "周" : e + "日";
|
|
44
|
+
}, weekStart: 1, yearStart: 4, formats: { LT: "HH:mm", LTS: "HH:mm:ss", L: "YYYY/MM/DD", LL: "YYYY年M月D日", LLL: "YYYY年M月D日Ah点mm分", LLLL: "YYYY年M月D日ddddAh点mm分", l: "YYYY/M/D", ll: "YYYY年M月D日", lll: "YYYY年M月D日 HH:mm", llll: "YYYY年M月D日dddd HH:mm" }, relativeTime: { future: "%s内", past: "%s前", s: "几秒", m: "1 分钟", mm: "%d 分钟", h: "1 小时", hh: "%d 小时", d: "1 天", dd: "%d 天", M: "1 个月", MM: "%d 个月", y: "1 年", yy: "%d 年" }, meridiem: function(e, t) {
|
|
45
|
+
var s = 100 * e + t;
|
|
46
|
+
return s < 600 ? "凌晨" : s < 900 ? "早上" : s < 1100 ? "上午" : s < 1300 ? "中午" : s < 1800 ? "下午" : "晚上";
|
|
325
47
|
} };
|
|
326
|
-
return
|
|
48
|
+
return o.default.locale(i, null, !0), i;
|
|
327
49
|
});
|
|
328
|
-
})(
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
const
|
|
332
|
-
function
|
|
333
|
-
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(
|
|
334
|
-
const
|
|
335
|
-
return (
|
|
50
|
+
})(h);
|
|
51
|
+
d.extend(y);
|
|
52
|
+
d.locale("zh-cn");
|
|
53
|
+
const w = (r, a = "YYYY-MM-DD") => d(r).format(a), D = (r) => (console.log("🌸 信息输出 ~ testFunc ~ record:", r), "testFunc");
|
|
54
|
+
function L() {
|
|
55
|
+
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(r) {
|
|
56
|
+
const a = Math.random() * 16 | 0;
|
|
57
|
+
return (r == "x" ? a : a & 3 | 8).toString(16);
|
|
336
58
|
});
|
|
337
59
|
}
|
|
338
|
-
function
|
|
60
|
+
function b() {
|
|
339
61
|
return Date.now().toString(36) + Math.random().toString(36).substr(2);
|
|
340
62
|
}
|
|
341
63
|
export {
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
64
|
+
g as FormatterUtils,
|
|
65
|
+
S as dayjs,
|
|
66
|
+
w as formatDate,
|
|
67
|
+
L as generateUUID,
|
|
68
|
+
b as generateUniqueId,
|
|
69
|
+
D as testFunc
|
|
348
70
|
};
|
package/lib/m-tool-store.umd.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(r,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("dayjs")):typeof define=="function"&&define.amd?define(["exports","dayjs"],s):(r=typeof globalThis<"u"?globalThis:r||self,s(r.MToolStore={},r.dayjs))})(this,function(r,s){"use strict";class Y{static formatMoney(a,o){if(a==null)return"";let l=Number(a);if(isNaN(l))return a;let i=/([\-\+]?)(\d*)(\.\d+)?/g.exec(""+l),d=i&&i[1]||"",t=(i&&i[2]||"").split(""),e=i&&i[3]||"",u=t.length%3,f=t.reduce(function(m,p,x){return x+1===u||(x+1-u)%3===0?m+p+",":m+p},"").replace(/\,$/g,"");return f===""&&(f="0"),o!=null&&(o==0?e&&parseFloat(e)>.5?(e="",f=parseInt(f)+1+""):e="":o>0&&(!e||e=="0"||e==".0"?e="."+"0".repeat(o):(e=parseFloat(e).toFixed(2),e>="1"&&(f=parseInt(f)+1+"",e="."+"0".repeat(o)))),e=(e||"").replace("0.",".")),d+f+e}}var _=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function y(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var c={exports:{}};(function(n,a){(function(o,l){n.exports=l()})(_,function(){return function(o,l){l.prototype.weekday=function(i){var d=this.$locale().weekStart||0,t=this.$W,e=(t<d?t+7:t)-d;return this.$utils().u(i)?e:this.subtract(e,"day").add(i,"day")}}})})(c);var h=c.exports;const M=y(h);var g={exports:{}};(function(n,a){(function(o,l){n.exports=l(s)})(_,function(o){function l(t){return t&&typeof t=="object"&&"default"in t?t:{default:t}}var i=l(o),d={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(t,e){return e==="W"?t+"周":t+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(t,e){var u=100*t+e;return u<600?"凌晨":u<900?"早上":u<1100?"上午":u<1300?"中午":u<1800?"下午":"晚上"}};return i.default.locale(d,null,!0),d})})(g),s.extend(M),s.locale("zh-cn");const D=(n,a="YYYY-MM-DD")=>s(n).format(a),w=n=>(console.log("🌸 信息输出 ~ testFunc ~ record:",n),"testFunc");function b(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(n){const a=Math.random()*16|0;return(n=="x"?a:a&3|8).toString(16)})}function L(){return Date.now().toString(36)+Math.random().toString(36).substr(2)}r.dayjs=s,r.FormatterUtils=Y,r.formatDate=D,r.generateUUID=b,r.generateUniqueId=L,r.testFunc=w,Object.defineProperty(r,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "m-tool-store",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.13",
|
|
4
4
|
"description": "JavaScript 工具库",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "Mmm",
|
|
@@ -13,6 +13,9 @@
|
|
|
13
13
|
"import": "./lib/m-tool-store.js",
|
|
14
14
|
"require": "./lib/m-tool-store.umd.cjs"
|
|
15
15
|
},
|
|
16
|
+
"./types/global": {
|
|
17
|
+
"types": "./types/global.d.ts"
|
|
18
|
+
},
|
|
16
19
|
"./types/global.d": {
|
|
17
20
|
"types": "./types/global.d.ts"
|
|
18
21
|
}
|
|
@@ -23,9 +26,9 @@
|
|
|
23
26
|
"types"
|
|
24
27
|
],
|
|
25
28
|
"publishConfig": {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
"access": "public",
|
|
30
|
+
"registry": "https://registry.npmjs.org/"
|
|
31
|
+
},
|
|
29
32
|
"scripts": {
|
|
30
33
|
"dev": "vite",
|
|
31
34
|
"build": "vite build",
|