m-tool-store 1.0.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/README.en.md +36 -0
- package/README.md +37 -0
- package/dist/m-tool-store.js +336 -0
- package/dist/m-tool-store.umd.cjs +1 -0
- package/package.json +42 -0
package/README.en.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# mToolStore
|
|
2
|
+
|
|
3
|
+
#### Description
|
|
4
|
+
工具库
|
|
5
|
+
|
|
6
|
+
#### Software Architecture
|
|
7
|
+
Software architecture description
|
|
8
|
+
|
|
9
|
+
#### Installation
|
|
10
|
+
|
|
11
|
+
1. xxxx
|
|
12
|
+
2. xxxx
|
|
13
|
+
3. xxxx
|
|
14
|
+
|
|
15
|
+
#### Instructions
|
|
16
|
+
|
|
17
|
+
1. xxxx
|
|
18
|
+
2. xxxx
|
|
19
|
+
3. xxxx
|
|
20
|
+
|
|
21
|
+
#### Contribution
|
|
22
|
+
|
|
23
|
+
1. Fork the repository
|
|
24
|
+
2. Create Feat_xxx branch
|
|
25
|
+
3. Commit your code
|
|
26
|
+
4. Create Pull Request
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
#### Gitee Feature
|
|
30
|
+
|
|
31
|
+
1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md
|
|
32
|
+
2. Gitee blog [blog.gitee.com](https://blog.gitee.com)
|
|
33
|
+
3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore)
|
|
34
|
+
4. The most valuable open source project [GVP](https://gitee.com/gvp)
|
|
35
|
+
5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help)
|
|
36
|
+
6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
|
package/README.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# mToolStore
|
|
2
|
+
|
|
3
|
+
#### 介绍
|
|
4
|
+
工具库
|
|
5
|
+
|
|
6
|
+
#### 软件架构
|
|
7
|
+
软件架构说明
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
#### 安装教程
|
|
11
|
+
|
|
12
|
+
1. xxxx
|
|
13
|
+
2. xxxx
|
|
14
|
+
3. xxxx
|
|
15
|
+
|
|
16
|
+
#### 使用说明
|
|
17
|
+
|
|
18
|
+
1. xxxx
|
|
19
|
+
2. xxxx
|
|
20
|
+
3. xxxx
|
|
21
|
+
|
|
22
|
+
#### 参与贡献
|
|
23
|
+
|
|
24
|
+
1. Fork 本仓库
|
|
25
|
+
2. 新建 Feat_xxx 分支
|
|
26
|
+
3. 提交代码
|
|
27
|
+
4. 新建 Pull Request
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
#### 特技
|
|
31
|
+
|
|
32
|
+
1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
|
|
33
|
+
2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com)
|
|
34
|
+
3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目
|
|
35
|
+
4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
|
|
36
|
+
5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
|
|
37
|
+
6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
|
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
class ut {
|
|
2
|
+
//金额格式化 , 千分位
|
|
3
|
+
static formatMoney(S, M) {
|
|
4
|
+
if (S == null) return "";
|
|
5
|
+
let $ = Number(S);
|
|
6
|
+
if (isNaN($)) return S;
|
|
7
|
+
let D = /([\-\+]?)(\d*)(\.\d+)?/g.exec("" + $), w = D && D[1] || "", f = (D && D[2] || "").split(""), u = D && D[3] || "", p = f.length % 3, m = f.reduce(function(k, v, W) {
|
|
8
|
+
return W + 1 === p || (W + 1 - p) % 3 === 0 ? k + v + "," : k + v;
|
|
9
|
+
}, "").replace(/\,$/g, "");
|
|
10
|
+
return m === "" && (m = "0"), M != null && (M == 0 ? u && parseFloat(u) > 0.5 ? (u = "", m = parseInt(m) + 1 + "") : u = "" : M > 0 && (!u || u == "0" || u == ".0" ? u = "." + "0".repeat(M) : (u = parseFloat(u).toFixed(2), u >= "1" && (m = parseInt(m) + 1 + "", u = "." + "0".repeat(M)))), u = (u || "").replace("0.", ".")), w + m + u;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
var Z = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
14
|
+
function R(y) {
|
|
15
|
+
return y && y.__esModule && Object.prototype.hasOwnProperty.call(y, "default") ? y.default : y;
|
|
16
|
+
}
|
|
17
|
+
var J = { exports: {} }, Q;
|
|
18
|
+
function V() {
|
|
19
|
+
return Q || (Q = 1, function(y, S) {
|
|
20
|
+
(function(M, $) {
|
|
21
|
+
y.exports = $();
|
|
22
|
+
})(Z, function() {
|
|
23
|
+
var M = 1e3, $ = 6e4, D = 36e5, w = "millisecond", f = "second", u = "minute", p = "hour", m = "day", k = "week", v = "month", W = "quarter", b = "year", T = "date", P = "Invalid Date", X = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, tt = /\[([^\]]+)]|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, et = { 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) {
|
|
24
|
+
var n = ["th", "st", "nd", "rd"], t = s % 100;
|
|
25
|
+
return "[" + s + (n[(t - 20) % 10] || n[t] || n[0]) + "]";
|
|
26
|
+
} }, U = 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: U, z: function(s) {
|
|
30
|
+
var n = -s.utcOffset(), t = Math.abs(n), r = Math.floor(t / 60), e = t % 60;
|
|
31
|
+
return (n <= 0 ? "+" : "-") + U(r, 2, "0") + ":" + U(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, v), i = t - e < 0, a = n.clone().add(r + (i ? -1 : 1), v);
|
|
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: v, y: b, w: k, d: m, D: T, h: p, m: u, s: f, ms: w, Q: W }[s] || String(s || "").toLowerCase().replace(/s$/, "");
|
|
40
|
+
}, u: function(s) {
|
|
41
|
+
return s === void 0;
|
|
42
|
+
} }, C = "en", x = {};
|
|
43
|
+
x[C] = et;
|
|
44
|
+
var B = "$isDayjsObject", E = function(s) {
|
|
45
|
+
return s instanceof N || !(!s || !s[B]);
|
|
46
|
+
}, I = function s(n, t, r) {
|
|
47
|
+
var e;
|
|
48
|
+
if (!n) return C;
|
|
49
|
+
if (typeof n == "string") {
|
|
50
|
+
var i = n.toLowerCase();
|
|
51
|
+
x[i] && (e = i), t && (x[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
|
+
x[c] = n, e = c;
|
|
57
|
+
}
|
|
58
|
+
return !r && e && (C = e), e || !r && C;
|
|
59
|
+
}, d = function(s, n) {
|
|
60
|
+
if (E(s)) return s.clone();
|
|
61
|
+
var t = typeof n == "object" ? n : {};
|
|
62
|
+
return t.date = s, t.args = arguments, new N(t);
|
|
63
|
+
}, o = nt;
|
|
64
|
+
o.l = I, o.i = E, o.w = function(s, n) {
|
|
65
|
+
return d(s, { locale: n.$L, utc: n.$u, x: n.$x, $offset: n.$offset });
|
|
66
|
+
};
|
|
67
|
+
var N = function() {
|
|
68
|
+
function s(t) {
|
|
69
|
+
this.$L = I(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 = d(t);
|
|
96
|
+
return this.startOf(r) <= e && e <= this.endOf(r);
|
|
97
|
+
}, n.isAfter = function(t, r) {
|
|
98
|
+
return d(t) < this.startOf(r);
|
|
99
|
+
}, n.isBefore = function(t, r) {
|
|
100
|
+
return this.endOf(r) < d(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, Y) {
|
|
109
|
+
var O = o.w(e.$u ? Date.UTC(e.$y, Y, H) : new Date(e.$y, Y, H), e);
|
|
110
|
+
return i ? O : O.endOf(m);
|
|
111
|
+
}, l = function(H, Y) {
|
|
112
|
+
return o.w(e.toDate()[H].apply(e.toDate("s"), (i ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(Y)), e);
|
|
113
|
+
}, h = this.$W, _ = this.$M, g = this.$D, j = "set" + (this.$u ? "UTC" : "");
|
|
114
|
+
switch (a) {
|
|
115
|
+
case b:
|
|
116
|
+
return i ? c(1, 0) : c(31, 11);
|
|
117
|
+
case v:
|
|
118
|
+
return i ? c(1, _) : c(0, _ + 1);
|
|
119
|
+
case k:
|
|
120
|
+
var L = this.$locale().weekStart || 0, A = (h < L ? h + 7 : h) - L;
|
|
121
|
+
return c(i ? g - A : g + (6 - A), _);
|
|
122
|
+
case m:
|
|
123
|
+
case T:
|
|
124
|
+
return l(j + "Hours", 0);
|
|
125
|
+
case p:
|
|
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[m] = a + "Date", e[T] = a + "Date", e[v] = a + "Month", e[b] = a + "FullYear", e[p] = a + "Hours", e[u] = a + "Minutes", e[f] = a + "Seconds", e[w] = a + "Milliseconds", e)[i], l = i === m ? this.$D + (r - this.$W) : r;
|
|
138
|
+
if (i === v || i === b) {
|
|
139
|
+
var h = this.clone().set(T, 1);
|
|
140
|
+
h.$d[c](l), h.init(), this.$d = h.set(T, Math.min(this.$D, h.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(_) {
|
|
151
|
+
var g = d(i);
|
|
152
|
+
return o.w(g.date(g.date() + Math.round(_ * t)), i);
|
|
153
|
+
};
|
|
154
|
+
if (a === v) return this.set(v, this.$M + t);
|
|
155
|
+
if (a === b) return this.set(b, this.$y + t);
|
|
156
|
+
if (a === m) return c(1);
|
|
157
|
+
if (a === k) return c(7);
|
|
158
|
+
var l = (e = {}, e[u] = $, e[p] = D, e[f] = M, e)[a] || 1, h = this.$d.getTime() + t * l;
|
|
159
|
+
return o.w(h, 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, h = this.$M, _ = e.weekdays, g = e.months, j = e.meridiem, L = function(Y, O, F, z) {
|
|
166
|
+
return Y && (Y[O] || Y(r, i)) || F[O].slice(0, z);
|
|
167
|
+
}, A = function(Y) {
|
|
168
|
+
return o.s(c % 12 || 12, Y, "0");
|
|
169
|
+
}, H = j || function(Y, O, F) {
|
|
170
|
+
var z = Y < 12 ? "AM" : "PM";
|
|
171
|
+
return F ? z.toLowerCase() : z;
|
|
172
|
+
};
|
|
173
|
+
return i.replace(tt, function(Y, O) {
|
|
174
|
+
return O || function(F) {
|
|
175
|
+
switch (F) {
|
|
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 h + 1;
|
|
182
|
+
case "MM":
|
|
183
|
+
return o.s(h + 1, 2, "0");
|
|
184
|
+
case "MMM":
|
|
185
|
+
return L(e.monthsShort, h, g, 3);
|
|
186
|
+
case "MMMM":
|
|
187
|
+
return L(g, h);
|
|
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, _, 2);
|
|
196
|
+
case "ddd":
|
|
197
|
+
return L(e.weekdaysShort, r.$W, _, 3);
|
|
198
|
+
case "dddd":
|
|
199
|
+
return _[r.$W];
|
|
200
|
+
case "H":
|
|
201
|
+
return String(c);
|
|
202
|
+
case "HH":
|
|
203
|
+
return o.s(c, 2, "0");
|
|
204
|
+
case "h":
|
|
205
|
+
return A(1);
|
|
206
|
+
case "hh":
|
|
207
|
+
return A(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
|
+
}(Y) || 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 = d(t), h = (l.utcOffset() - this.utcOffset()) * $, _ = this - l, g = function() {
|
|
232
|
+
return o.m(a, l);
|
|
233
|
+
};
|
|
234
|
+
switch (c) {
|
|
235
|
+
case b:
|
|
236
|
+
i = g() / 12;
|
|
237
|
+
break;
|
|
238
|
+
case v:
|
|
239
|
+
i = g();
|
|
240
|
+
break;
|
|
241
|
+
case W:
|
|
242
|
+
i = g() / 3;
|
|
243
|
+
break;
|
|
244
|
+
case k:
|
|
245
|
+
i = (_ - h) / 6048e5;
|
|
246
|
+
break;
|
|
247
|
+
case m:
|
|
248
|
+
i = (_ - h) / 864e5;
|
|
249
|
+
break;
|
|
250
|
+
case p:
|
|
251
|
+
i = _ / D;
|
|
252
|
+
break;
|
|
253
|
+
case u:
|
|
254
|
+
i = _ / $;
|
|
255
|
+
break;
|
|
256
|
+
case f:
|
|
257
|
+
i = _ / M;
|
|
258
|
+
break;
|
|
259
|
+
default:
|
|
260
|
+
i = _;
|
|
261
|
+
}
|
|
262
|
+
return e ? i : o.a(i);
|
|
263
|
+
}, n.daysInMonth = function() {
|
|
264
|
+
return this.endOf(v).$D;
|
|
265
|
+
}, n.$locale = function() {
|
|
266
|
+
return x[this.$L];
|
|
267
|
+
}, n.locale = function(t, r) {
|
|
268
|
+
if (!t) return this.$L;
|
|
269
|
+
var e = this.clone(), i = I(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 = N.prototype;
|
|
283
|
+
return d.prototype = G, [["$ms", w], ["$s", f], ["$m", u], ["$H", p], ["$W", m], ["$M", v], ["$y", b], ["$D", T]].forEach(function(s) {
|
|
284
|
+
G[s[1]] = function(n) {
|
|
285
|
+
return this.$g(n, s[0], s[1]);
|
|
286
|
+
};
|
|
287
|
+
}), d.extend = function(s, n) {
|
|
288
|
+
return s.$i || (s(n, N, d), s.$i = !0), d;
|
|
289
|
+
}, d.locale = I, d.isDayjs = E, d.unix = function(s) {
|
|
290
|
+
return d(1e3 * s);
|
|
291
|
+
}, d.en = x[C], d.Ls = x, d.p = {}, d;
|
|
292
|
+
});
|
|
293
|
+
}(J)), J.exports;
|
|
294
|
+
}
|
|
295
|
+
var rt = V();
|
|
296
|
+
const q = /* @__PURE__ */ R(rt);
|
|
297
|
+
var K = { exports: {} };
|
|
298
|
+
(function(y, S) {
|
|
299
|
+
(function(M, $) {
|
|
300
|
+
y.exports = $();
|
|
301
|
+
})(Z, function() {
|
|
302
|
+
return function(M, $) {
|
|
303
|
+
$.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");
|
|
306
|
+
};
|
|
307
|
+
};
|
|
308
|
+
});
|
|
309
|
+
})(K);
|
|
310
|
+
var st = K.exports;
|
|
311
|
+
const it = /* @__PURE__ */ R(st);
|
|
312
|
+
var at = { exports: {} };
|
|
313
|
+
(function(y, S) {
|
|
314
|
+
(function(M, $) {
|
|
315
|
+
y.exports = $(V());
|
|
316
|
+
})(Z, function(M) {
|
|
317
|
+
function $(f) {
|
|
318
|
+
return f && typeof f == "object" && "default" in f ? f : { default: f };
|
|
319
|
+
}
|
|
320
|
+
var D = $(M), w = { 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(f, u) {
|
|
321
|
+
return u === "W" ? f + "周" : f + "日";
|
|
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(f, u) {
|
|
323
|
+
var p = 100 * f + u;
|
|
324
|
+
return p < 600 ? "凌晨" : p < 900 ? "早上" : p < 1100 ? "上午" : p < 1300 ? "中午" : p < 1800 ? "下午" : "晚上";
|
|
325
|
+
} };
|
|
326
|
+
return D.default.locale(w, null, !0), w;
|
|
327
|
+
});
|
|
328
|
+
})(at);
|
|
329
|
+
q.extend(it);
|
|
330
|
+
q.locale("zh-cn");
|
|
331
|
+
const ot = (y, S = "YYYY-MM-DD") => q(y).format(S);
|
|
332
|
+
export {
|
|
333
|
+
ut as FormatterUtils,
|
|
334
|
+
q as dayjs,
|
|
335
|
+
ot as formatDate
|
|
336
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(S,C){typeof exports=="object"&&typeof module<"u"?C(exports):typeof define=="function"&&define.amd?define(["exports"],C):(S=typeof globalThis<"u"?globalThis:S||self,C(S.MToolStore={}))})(this,function(S){"use strict";class C{static formatMoney(b,M){if(b==null)return"";let $=Number(b);if(isNaN($))return b;let D=/([\-\+]?)(\d*)(\.\d+)?/g.exec(""+$),w=D&&D[1]||"",c=(D&&D[2]||"").split(""),u=D&&D[3]||"",y=c.length%3,m=c.reduce(function(x,v,F){return F+1===y||(F+1-y)%3===0?x+v+",":x+v},"").replace(/\,$/g,"");return m===""&&(m="0"),M!=null&&(M==0?u&&parseFloat(u)>.5?(u="",m=parseInt(m)+1+""):u="":M>0&&(!u||u=="0"||u==".0"?u="."+"0".repeat(M):(u=parseFloat(u).toFixed(2),u>="1"&&(m=parseInt(m)+1+"",u="."+"0".repeat(M)))),u=(u||"").replace("0.",".")),w+m+u}}var Z=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function G(_){return _&&_.__esModule&&Object.prototype.hasOwnProperty.call(_,"default")?_.default:_}var q={exports:{}},Q;function R(){return Q||(Q=1,function(_,b){(function(M,$){_.exports=$()})(Z,function(){var M=1e3,$=6e4,D=36e5,w="millisecond",c="second",u="minute",y="hour",m="day",x="week",v="month",F="quarter",O="year",j="date",K="Invalid Date",at=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,ut=/\[([^\]]+)]|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,ot={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(i){var n=["th","st","nd","rd"],t=i%100;return"["+i+(n[(t-20)%10]||n[t]||n[0])+"]"}},P=function(i,n,t){var r=String(i);return!r||r.length>=n?i:""+Array(n+1-r.length).join(t)+i},ft={s:P,z:function(i){var n=-i.utcOffset(),t=Math.abs(n),r=Math.floor(t/60),e=t%60;return(n<=0?"+":"-")+P(r,2,"0")+":"+P(e,2,"0")},m:function i(n,t){if(n.date()<t.date())return-i(t,n);var r=12*(t.year()-n.year())+(t.month()-n.month()),e=n.clone().add(r,v),s=t-e<0,a=n.clone().add(r+(s?-1:1),v);return+(-(r+(t-e)/(s?e-a:a-e))||0)},a:function(i){return i<0?Math.ceil(i)||0:Math.floor(i)},p:function(i){return{M:v,y:O,w:x,d:m,D:j,h:y,m:u,s:c,ms:w,Q:F}[i]||String(i||"").toLowerCase().replace(/s$/,"")},u:function(i){return i===void 0}},A="en",L={};L[A]=ot;var X="$isDayjsObject",B=function(i){return i instanceof E||!(!i||!i[X])},z=function i(n,t,r){var e;if(!n)return A;if(typeof n=="string"){var s=n.toLowerCase();L[s]&&(e=s),t&&(L[s]=t,e=s);var a=n.split("-");if(!e&&a.length>1)return i(a[0])}else{var f=n.name;L[f]=n,e=f}return!r&&e&&(A=e),e||!r&&A},l=function(i,n){if(B(i))return i.clone();var t=typeof n=="object"?n:{};return t.date=i,t.args=arguments,new E(t)},o=ft;o.l=z,o.i=B,o.w=function(i,n){return l(i,{locale:n.$L,utc:n.$u,x:n.$x,$offset:n.$offset})};var E=function(){function i(t){this.$L=z(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[X]=!0}var n=i.prototype;return n.parse=function(t){this.$d=function(r){var e=r.date,s=r.utc;if(e===null)return new Date(NaN);if(o.u(e))return new Date;if(e instanceof Date)return new Date(e);if(typeof e=="string"&&!/Z$/i.test(e)){var a=e.match(at);if(a){var f=a[2]-1||0,d=(a[7]||"0").substring(0,3);return s?new Date(Date.UTC(a[1],f,a[3]||1,a[4]||0,a[5]||0,a[6]||0,d)):new Date(a[1],f,a[3]||1,a[4]||0,a[5]||0,a[6]||0,d)}}return new Date(e)}(t),this.init()},n.init=function(){var t=this.$d;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()},n.$utils=function(){return o},n.isValid=function(){return this.$d.toString()!==K},n.isSame=function(t,r){var e=l(t);return this.startOf(r)<=e&&e<=this.endOf(r)},n.isAfter=function(t,r){return l(t)<this.startOf(r)},n.isBefore=function(t,r){return this.endOf(r)<l(t)},n.$g=function(t,r,e){return o.u(t)?this[r]:this.set(e,t)},n.unix=function(){return Math.floor(this.valueOf()/1e3)},n.valueOf=function(){return this.$d.getTime()},n.startOf=function(t,r){var e=this,s=!!o.u(r)||r,a=o.p(t),f=function(H,g){var k=o.w(e.$u?Date.UTC(e.$y,g,H):new Date(e.$y,g,H),e);return s?k:k.endOf(m)},d=function(H,g){return o.w(e.toDate()[H].apply(e.toDate("s"),(s?[0,0,0,0]:[23,59,59,999]).slice(g)),e)},h=this.$W,p=this.$M,Y=this.$D,W="set"+(this.$u?"UTC":"");switch(a){case O:return s?f(1,0):f(31,11);case v:return s?f(1,p):f(0,p+1);case x:var T=this.$locale().weekStart||0,I=(h<T?h+7:h)-T;return f(s?Y-I:Y+(6-I),p);case m:case j:return d(W+"Hours",0);case y:return d(W+"Minutes",1);case u:return d(W+"Seconds",2);case c:return d(W+"Milliseconds",3);default:return this.clone()}},n.endOf=function(t){return this.startOf(t,!1)},n.$set=function(t,r){var e,s=o.p(t),a="set"+(this.$u?"UTC":""),f=(e={},e[m]=a+"Date",e[j]=a+"Date",e[v]=a+"Month",e[O]=a+"FullYear",e[y]=a+"Hours",e[u]=a+"Minutes",e[c]=a+"Seconds",e[w]=a+"Milliseconds",e)[s],d=s===m?this.$D+(r-this.$W):r;if(s===v||s===O){var h=this.clone().set(j,1);h.$d[f](d),h.init(),this.$d=h.set(j,Math.min(this.$D,h.daysInMonth())).$d}else f&&this.$d[f](d);return this.init(),this},n.set=function(t,r){return this.clone().$set(t,r)},n.get=function(t){return this[o.p(t)]()},n.add=function(t,r){var e,s=this;t=Number(t);var a=o.p(r),f=function(p){var Y=l(s);return o.w(Y.date(Y.date()+Math.round(p*t)),s)};if(a===v)return this.set(v,this.$M+t);if(a===O)return this.set(O,this.$y+t);if(a===m)return f(1);if(a===x)return f(7);var d=(e={},e[u]=$,e[y]=D,e[c]=M,e)[a]||1,h=this.$d.getTime()+t*d;return o.w(h,this)},n.subtract=function(t,r){return this.add(-1*t,r)},n.format=function(t){var r=this,e=this.$locale();if(!this.isValid())return e.invalidDate||K;var s=t||"YYYY-MM-DDTHH:mm:ssZ",a=o.z(this),f=this.$H,d=this.$m,h=this.$M,p=e.weekdays,Y=e.months,W=e.meridiem,T=function(g,k,N,J){return g&&(g[k]||g(r,s))||N[k].slice(0,J)},I=function(g){return o.s(f%12||12,g,"0")},H=W||function(g,k,N){var J=g<12?"AM":"PM";return N?J.toLowerCase():J};return s.replace(ut,function(g,k){return k||function(N){switch(N){case"YY":return String(r.$y).slice(-2);case"YYYY":return o.s(r.$y,4,"0");case"M":return h+1;case"MM":return o.s(h+1,2,"0");case"MMM":return T(e.monthsShort,h,Y,3);case"MMMM":return T(Y,h);case"D":return r.$D;case"DD":return o.s(r.$D,2,"0");case"d":return String(r.$W);case"dd":return T(e.weekdaysMin,r.$W,p,2);case"ddd":return T(e.weekdaysShort,r.$W,p,3);case"dddd":return p[r.$W];case"H":return String(f);case"HH":return o.s(f,2,"0");case"h":return I(1);case"hh":return I(2);case"a":return H(f,d,!0);case"A":return H(f,d,!1);case"m":return String(d);case"mm":return o.s(d,2,"0");case"s":return String(r.$s);case"ss":return o.s(r.$s,2,"0");case"SSS":return o.s(r.$ms,3,"0");case"Z":return a}return null}(g)||a.replace(":","")})},n.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},n.diff=function(t,r,e){var s,a=this,f=o.p(r),d=l(t),h=(d.utcOffset()-this.utcOffset())*$,p=this-d,Y=function(){return o.m(a,d)};switch(f){case O:s=Y()/12;break;case v:s=Y();break;case F:s=Y()/3;break;case x:s=(p-h)/6048e5;break;case m:s=(p-h)/864e5;break;case y:s=p/D;break;case u:s=p/$;break;case c:s=p/M;break;default:s=p}return e?s:o.a(s)},n.daysInMonth=function(){return this.endOf(v).$D},n.$locale=function(){return L[this.$L]},n.locale=function(t,r){if(!t)return this.$L;var e=this.clone(),s=z(t,r,!0);return s&&(e.$L=s),e},n.clone=function(){return o.w(this.$d,this)},n.toDate=function(){return new Date(this.valueOf())},n.toJSON=function(){return this.isValid()?this.toISOString():null},n.toISOString=function(){return this.$d.toISOString()},n.toString=function(){return this.$d.toUTCString()},i}(),tt=E.prototype;return l.prototype=tt,[["$ms",w],["$s",c],["$m",u],["$H",y],["$W",m],["$M",v],["$y",O],["$D",j]].forEach(function(i){tt[i[1]]=function(n){return this.$g(n,i[0],i[1])}}),l.extend=function(i,n){return i.$i||(i(n,E,l),i.$i=!0),l},l.locale=z,l.isDayjs=B,l.unix=function(i){return l(1e3*i)},l.en=L[A],l.Ls=L,l.p={},l})}(q)),q.exports}var et=R();const U=G(et);var V={exports:{}};(function(_,b){(function(M,$){_.exports=$()})(Z,function(){return function(M,$){$.prototype.weekday=function(D){var w=this.$locale().weekStart||0,c=this.$W,u=(c<w?c+7:c)-w;return this.$utils().u(D)?u:this.subtract(u,"day").add(D,"day")}}})})(V);var nt=V.exports;const rt=G(nt);var it={exports:{}};(function(_,b){(function(M,$){_.exports=$(R())})(Z,function(M){function $(c){return c&&typeof c=="object"&&"default"in c?c:{default:c}}var D=$(M),w={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(c,u){return u==="W"?c+"周":c+"日"},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(c,u){var y=100*c+u;return y<600?"凌晨":y<900?"早上":y<1100?"上午":y<1300?"中午":y<1800?"下午":"晚上"}};return D.default.locale(w,null,!0),w})})(it),U.extend(rt),U.locale("zh-cn");const st=(_,b="YYYY-MM-DD")=>U(_).format(b);S.FormatterUtils=C,S.dayjs=U,S.formatDate=st,Object.defineProperty(S,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "m-tool-store",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "JavaScript 工具库",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"author": "Mmm",
|
|
7
|
+
"license": "ISC",
|
|
8
|
+
"main": "./dist/m-tool-store.umd.cjs",
|
|
9
|
+
"module": "./dist/m-tool-store.js",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"import": "./dist/m-tool-store.js",
|
|
13
|
+
"require": "./dist/m-tool-store.umd.cjs"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public",
|
|
21
|
+
"registry": "https://registry.npmjs.org/"
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"dev": "vite",
|
|
25
|
+
"build": "vite build",
|
|
26
|
+
"preview": "vite preview"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"dayjs": "^1.11.13",
|
|
30
|
+
"view-ui-plus": "^1.3.20",
|
|
31
|
+
"vue": "^3.2.16",
|
|
32
|
+
"vue-router": "^4.0.11"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@types/node": "^24.2.0",
|
|
36
|
+
"@vitejs/plugin-vue": "^5.2.3",
|
|
37
|
+
"cross-env": "^7.0.3",
|
|
38
|
+
"sass": "^1.86.3",
|
|
39
|
+
"vite": "^5.0.0",
|
|
40
|
+
"vue-tsc": "^0.3.0"
|
|
41
|
+
}
|
|
42
|
+
}
|