@gx-design-vue/pro-utils 0.2.0-alpha.2 → 0.2.0-alpha.3
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/array/index.js +1 -2
- package/dist/array/slice.js +1 -3
- package/dist/array/sort.js +1 -3
- package/dist/array/tree.d.ts +2 -2
- package/dist/array/tree.js +1 -3
- package/dist/array/unique.js +1 -2
- package/dist/base64/index.js +1 -2
- package/dist/class/index.js +1 -2
- package/dist/class/prefix.js +1 -2
- package/dist/clone/cloneDeep.js +1 -3
- package/dist/clone/cloneDeepWith.js +1 -3
- package/dist/clone/getTag.js +1 -2
- package/dist/clone/index.js +1 -2
- package/dist/clone/symbols.js +1 -2
- package/dist/clone/tags.js +1 -2
- package/dist/dom/event.js +1 -2
- package/dist/dom/index.js +1 -2
- package/dist/dom/measure.js +1 -3
- package/dist/dom/raf.js +1 -2
- package/dist/dom/scroll.js +1 -3
- package/dist/file/config.js +6 -2
- package/dist/file/convert.js +1 -2
- package/dist/file/index.js +1 -2
- package/dist/file/media.js +1 -3
- package/dist/file/type.js +1 -3
- package/dist/function/copy.js +1 -2
- package/dist/function/getValue.js +1 -2
- package/dist/function/index.js +1 -2
- package/dist/function/object.js +1 -2
- package/dist/function/run.js +1 -2
- package/dist/index.d.ts +0 -7
- package/dist/index.js +2 -3
- package/dist/is/base64.js +1 -2
- package/dist/is/browser.js +1 -2
- package/dist/is/deepEqual.js +1 -2
- package/dist/is/device.js +1 -2
- package/dist/is/equal.js +1 -2
- package/dist/is/img.js +1 -2
- package/dist/is/index.js +1 -2
- package/dist/is/nil.js +1 -2
- package/dist/is/plainObject.js +1 -3
- package/dist/is/primitive.js +1 -2
- package/dist/is/server.js +1 -2
- package/dist/is/type.js +1 -2
- package/dist/is/typedArray.js +1 -2
- package/dist/is/unsafeProperty.js +1 -2
- package/dist/is/url.js +1 -2
- package/dist/is/valid.js +1 -2
- package/dist/merge/index.js +25 -7
- package/dist/merge/mergeWith.js +1 -3
- package/dist/merge/useDeepMege.js +1 -3
- package/dist/number/chinese.js +1 -3
- package/dist/number/format.js +1 -3
- package/dist/number/index.js +1 -2
- package/dist/object/classNames.js +1 -4
- package/dist/object/index.js +2 -3
- package/dist/object/omitBoolean.js +1 -2
- package/dist/object/omitUndefined.js +1 -2
- package/dist/object/omitUndefinedAndEmptyArr.js +1 -2
- package/dist/pro-utils.esm.js +366 -242
- package/dist/pro-utils.js +1 -1
- package/dist/string/duration.js +1 -2
- package/dist/string/empty.js +1 -2
- package/dist/string/index.js +1 -2
- package/dist/string/nanoid.js +1 -2
- package/dist/string/uuid.js +23 -2
- package/dist/table/column.js +1 -3
- package/dist/table/index.js +1 -2
- package/dist/table/page.js +1 -3
- package/dist/typing.js +1 -1
- package/dist/vue/index.js +1 -2
- package/dist/vue/slots.d.ts +2 -2
- package/dist/vue/slots.js +1 -3
- package/package.json +1 -1
package/dist/pro-utils.esm.js
CHANGED
|
@@ -1,32 +1,37 @@
|
|
|
1
|
-
import { Comment, Fragment, isVNode } from "vue";
|
|
2
|
-
|
|
1
|
+
import { Comment as e, Fragment as t, isVNode as n } from "vue";
|
|
2
|
+
//#region src/is/base64.ts
|
|
3
|
+
function r(e = "") {
|
|
3
4
|
return !!(e && [
|
|
4
5
|
"data:image/",
|
|
5
6
|
"data:video/",
|
|
6
7
|
"data:audio/"
|
|
7
8
|
].find((t) => e.includes(t)));
|
|
8
9
|
}
|
|
9
|
-
function
|
|
10
|
+
function i(e) {
|
|
10
11
|
return typeof e == "string" && /^data:(?:image|video|audio)\/[A-Za-z]+;base64,[A-Za-z0-9+/=]+$/.test(e);
|
|
11
12
|
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
//#endregion
|
|
14
|
+
//#region src/is/browser.ts
|
|
15
|
+
var a = typeof process < "u" && process.versions != null && process.versions.node != null;
|
|
16
|
+
function o() {
|
|
17
|
+
return process.env.NODE_ENV === "TEST" ? !0 : typeof window < "u" && window.document !== void 0 && window.matchMedia !== void 0 && !a;
|
|
15
18
|
}
|
|
16
|
-
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region src/is/deepEqual.ts
|
|
21
|
+
function s(e, t, n, r) {
|
|
17
22
|
if (e === t) return !0;
|
|
18
23
|
if (e && t && typeof e == "object" && typeof t == "object") {
|
|
19
24
|
if (e.constructor !== t.constructor) return !1;
|
|
20
25
|
let i, a;
|
|
21
26
|
if (Array.isArray(e)) {
|
|
22
27
|
if (i = e.length, i != t.length) return !1;
|
|
23
|
-
for (a = i; a-- !== 0;) if (!
|
|
28
|
+
for (a = i; a-- !== 0;) if (!s(e[a], t[a], n, r)) return !1;
|
|
24
29
|
return !0;
|
|
25
30
|
}
|
|
26
31
|
if (e instanceof Map && t instanceof Map) {
|
|
27
32
|
if (e.size !== t.size) return !1;
|
|
28
33
|
for (a of e.entries()) if (!t.has(a[0])) return !1;
|
|
29
|
-
for (a of e.entries()) if (!
|
|
34
|
+
for (a of e.entries()) if (!s(a[1], t.get(a[0]), n, r)) return !1;
|
|
30
35
|
return !0;
|
|
31
36
|
}
|
|
32
37
|
if (e instanceof Set && t instanceof Set) {
|
|
@@ -47,24 +52,28 @@ function isDeepEqualReact(e, t, n, r) {
|
|
|
47
52
|
for (a = i; a-- !== 0;) if (!Object.prototype.hasOwnProperty.call(t, o[a])) return !1;
|
|
48
53
|
for (a = i; a-- !== 0;) {
|
|
49
54
|
let i = o[a];
|
|
50
|
-
if (!n?.includes(i) && !(i === "_owner" && e.$$typeof) && !
|
|
55
|
+
if (!n?.includes(i) && !(i === "_owner" && e.$$typeof) && !s(e[i], t[i], n, r)) return r && console.log(i), !1;
|
|
51
56
|
}
|
|
52
57
|
return !0;
|
|
53
58
|
}
|
|
54
59
|
return e !== e && t !== t;
|
|
55
60
|
}
|
|
56
|
-
|
|
61
|
+
//#endregion
|
|
62
|
+
//#region src/is/device.ts
|
|
63
|
+
function c() {
|
|
57
64
|
let e = navigator.userAgent || navigator.vendor;
|
|
58
|
-
return !!(/iPhone/.test(e) || /Android/.test(e) && /Mobile/.test(e) || /Windows Phone/.test(e) || /Mobile/.test(e) && !
|
|
65
|
+
return !!(/iPhone/.test(e) || /Android/.test(e) && /Mobile/.test(e) || /Windows Phone/.test(e) || /Mobile/.test(e) && !l());
|
|
59
66
|
}
|
|
60
|
-
function
|
|
67
|
+
function l() {
|
|
61
68
|
let e = navigator.userAgent || navigator.vendor;
|
|
62
69
|
return !!(/iPad/.test(e) || /Macintosh/.test(e) && "ontouchend" in document || /Android/.test(e) && !/Mobile/.test(e));
|
|
63
70
|
}
|
|
64
|
-
function
|
|
71
|
+
function u() {
|
|
65
72
|
return /windows|win32/i.test(navigator.userAgent);
|
|
66
73
|
}
|
|
67
|
-
|
|
74
|
+
//#endregion
|
|
75
|
+
//#region src/is/equal.ts
|
|
76
|
+
function d(e, t, n = !1) {
|
|
68
77
|
let r = /* @__PURE__ */ new Set();
|
|
69
78
|
function i(e, t, a = 1) {
|
|
70
79
|
if (r.has(e)) return !1;
|
|
@@ -85,48 +94,56 @@ function isEqual(e, t, n = !1) {
|
|
|
85
94
|
}
|
|
86
95
|
return i(e, t);
|
|
87
96
|
}
|
|
88
|
-
|
|
97
|
+
//#endregion
|
|
98
|
+
//#region src/is/img.ts
|
|
99
|
+
function ee(e) {
|
|
89
100
|
return /\w.(?:png|jpg|jpeg|svg|webp|gif|bmp)$/i.test(e);
|
|
90
101
|
}
|
|
91
|
-
|
|
102
|
+
//#endregion
|
|
103
|
+
//#region src/is/nil.ts
|
|
104
|
+
function te(e) {
|
|
92
105
|
return e == null;
|
|
93
106
|
}
|
|
94
|
-
function
|
|
107
|
+
function ne(e) {
|
|
95
108
|
return e != null;
|
|
96
109
|
}
|
|
97
|
-
|
|
110
|
+
//#endregion
|
|
111
|
+
//#region src/function/object.ts
|
|
112
|
+
function f(e) {
|
|
98
113
|
return Object.getOwnPropertySymbols(e);
|
|
99
114
|
}
|
|
100
|
-
function
|
|
115
|
+
function re(e, t) {
|
|
101
116
|
Object.keys(e).forEach((n) => {
|
|
102
117
|
t(n, e[n]);
|
|
103
118
|
});
|
|
104
119
|
}
|
|
105
|
-
function
|
|
120
|
+
function ie(e) {
|
|
106
121
|
return Object.keys(e);
|
|
107
122
|
}
|
|
108
|
-
|
|
123
|
+
//#endregion
|
|
124
|
+
//#region src/is/type.ts
|
|
125
|
+
function p(e, t) {
|
|
109
126
|
return Object.prototype.toString.call(e) === `[object ${t}]`;
|
|
110
127
|
}
|
|
111
|
-
function
|
|
128
|
+
function m(e) {
|
|
112
129
|
return typeof e == "boolean";
|
|
113
130
|
}
|
|
114
|
-
function
|
|
131
|
+
function h(e) {
|
|
115
132
|
return typeof e == "number";
|
|
116
133
|
}
|
|
117
|
-
function
|
|
134
|
+
function g(e) {
|
|
118
135
|
return Array.isArray === void 0 ? Object.prototype.toString.call(e) === "[object Array]" : Array.isArray(e);
|
|
119
136
|
}
|
|
120
|
-
function
|
|
121
|
-
return e !== null &&
|
|
137
|
+
function _(e) {
|
|
138
|
+
return e !== null && p(e, "Object");
|
|
122
139
|
}
|
|
123
|
-
function
|
|
140
|
+
function v(e) {
|
|
124
141
|
return typeof e == "string";
|
|
125
142
|
}
|
|
126
|
-
function
|
|
143
|
+
function ae(e) {
|
|
127
144
|
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Function]";
|
|
128
145
|
}
|
|
129
|
-
function
|
|
146
|
+
function oe(e) {
|
|
130
147
|
if (typeof e != "string") return !1;
|
|
131
148
|
try {
|
|
132
149
|
let t = JSON.parse(e);
|
|
@@ -135,31 +152,43 @@ function isJSONStr(e) {
|
|
|
135
152
|
return !1;
|
|
136
153
|
}
|
|
137
154
|
}
|
|
138
|
-
|
|
139
|
-
|
|
155
|
+
//#endregion
|
|
156
|
+
//#region src/is/plainObject.ts
|
|
157
|
+
function y(e) {
|
|
158
|
+
if (!_(e)) return !1;
|
|
140
159
|
let t = Object.getPrototypeOf(e);
|
|
141
160
|
if (t === null) return !0;
|
|
142
161
|
let n = Object.prototype.hasOwnProperty.call(t, "constructor") && t.constructor;
|
|
143
162
|
return typeof n == "function" && n instanceof n && Function.prototype.toString.call(n) === Function.prototype.toString.call(Object);
|
|
144
163
|
}
|
|
145
|
-
function
|
|
146
|
-
return
|
|
164
|
+
function se(e) {
|
|
165
|
+
return _(e) ? f(e).length > 0 : !1;
|
|
147
166
|
}
|
|
148
|
-
|
|
167
|
+
//#endregion
|
|
168
|
+
//#region src/is/primitive.ts
|
|
169
|
+
function b(e) {
|
|
149
170
|
return e === null || typeof e != "object" && typeof e != "function";
|
|
150
171
|
}
|
|
151
|
-
|
|
152
|
-
|
|
172
|
+
//#endregion
|
|
173
|
+
//#region src/is/server.ts
|
|
174
|
+
var x = typeof window > "u";
|
|
175
|
+
//#endregion
|
|
176
|
+
//#region src/is/typedArray.ts
|
|
177
|
+
function ce(e) {
|
|
153
178
|
return ArrayBuffer.isView(e) && !(e instanceof DataView);
|
|
154
179
|
}
|
|
155
|
-
|
|
180
|
+
//#endregion
|
|
181
|
+
//#region src/is/unsafeProperty.ts
|
|
182
|
+
function le(e) {
|
|
156
183
|
return typeof e == "symbol" ? !1 : [
|
|
157
184
|
"__proto__",
|
|
158
185
|
"constructor",
|
|
159
186
|
"prototype"
|
|
160
187
|
].includes(e);
|
|
161
188
|
}
|
|
162
|
-
|
|
189
|
+
//#endregion
|
|
190
|
+
//#region src/is/url.ts
|
|
191
|
+
function ue(e) {
|
|
163
192
|
if (!e || !e.startsWith("http")) return !1;
|
|
164
193
|
try {
|
|
165
194
|
return !!new URL(e);
|
|
@@ -167,68 +196,76 @@ function isUrl(e) {
|
|
|
167
196
|
return console.error("isUrl error", e), !1;
|
|
168
197
|
}
|
|
169
198
|
}
|
|
170
|
-
|
|
199
|
+
//#endregion
|
|
200
|
+
//#region src/is/valid.ts
|
|
201
|
+
function de(e) {
|
|
171
202
|
return e != null && e !== "";
|
|
172
203
|
}
|
|
173
|
-
function
|
|
204
|
+
function fe(e) {
|
|
174
205
|
return typeof e == "boolean" ? e : !!e;
|
|
175
206
|
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
207
|
+
//#endregion
|
|
208
|
+
//#region src/array/slice.ts
|
|
209
|
+
function pe(e, t) {
|
|
210
|
+
return g(e) ? e?.filter((n, r) => {
|
|
211
|
+
if (h(t)) return r <= t - 1;
|
|
212
|
+
if (g(t) && t.length === 2) {
|
|
180
213
|
let n = t, i = n[0] - 1;
|
|
181
214
|
return r <= (n[1] ? n[1] - 1 : e.length - 1) && r >= i;
|
|
182
|
-
} else if (
|
|
215
|
+
} else if (g(t) && t.length === 1) {
|
|
183
216
|
let n = t[0] - 1;
|
|
184
217
|
return r <= e.length - 1 && r >= n;
|
|
185
218
|
}
|
|
186
219
|
return !0;
|
|
187
220
|
}) : [];
|
|
188
221
|
}
|
|
189
|
-
|
|
190
|
-
|
|
222
|
+
//#endregion
|
|
223
|
+
//#region src/array/sort.ts
|
|
224
|
+
function S(e, t, n, r = 0) {
|
|
225
|
+
let i = h(r) && (r === 0 || r === 1) ? r : 0, a = e[n], o = t[n], s = 0;
|
|
191
226
|
return a < o ? s = i === 0 ? -1 : 0 : a > o && (s = i === 0 ? 0 : -1), s;
|
|
192
227
|
}
|
|
193
|
-
function
|
|
194
|
-
let i =
|
|
228
|
+
function C(e, t, n, r = 0) {
|
|
229
|
+
let i = h(r) && (r === 0 || r === 1) ? r : 0, a = new Date(e[n]), o = new Date(t[n]), s = 0;
|
|
195
230
|
return a < o ? s = i === 0 ? -1 : 0 : a > o && (s = i === 0 ? 0 : -1), s;
|
|
196
231
|
}
|
|
197
|
-
function
|
|
198
|
-
return e.sort((e, r) =>
|
|
232
|
+
function me(e, t, n = 0) {
|
|
233
|
+
return e.sort((e, r) => S(e, r, t, n));
|
|
199
234
|
}
|
|
200
|
-
function
|
|
201
|
-
return e.sort((e, r) =>
|
|
235
|
+
function he(e, t, n = 0) {
|
|
236
|
+
return e.sort((e, r) => C(e, r, t, n));
|
|
202
237
|
}
|
|
203
|
-
|
|
238
|
+
//#endregion
|
|
239
|
+
//#region src/array/tree.ts
|
|
240
|
+
function w(e, t) {
|
|
204
241
|
if (!Array.isArray(e) || e.length === 0) return 0;
|
|
205
242
|
let n = t || "children";
|
|
206
243
|
return Math.max(...e.map((e) => {
|
|
207
244
|
let t = e[n];
|
|
208
|
-
return 1 + (t ?
|
|
245
|
+
return 1 + (t ? w(t, n) : 0);
|
|
209
246
|
}));
|
|
210
247
|
}
|
|
211
|
-
function
|
|
248
|
+
function T(e, t = "children") {
|
|
212
249
|
let n = [];
|
|
213
250
|
return e.forEach((e) => {
|
|
214
|
-
n.push(e),
|
|
251
|
+
n.push(e), g(e[t]) && e[t].length > 0 && (n = n.concat(T(e[t], t)));
|
|
215
252
|
}), n;
|
|
216
253
|
}
|
|
217
|
-
function
|
|
218
|
-
if (!e || !
|
|
254
|
+
function ge(e, t) {
|
|
255
|
+
if (!e || !g(e) || e?.length === 0) return [];
|
|
219
256
|
let { id: n = "id", parentId: r = "parentId", children: i = "children", emptyChildren: a = !0 } = t || {}, o = t?.rootId ?? 0, s = structuredClone(e);
|
|
220
257
|
return s.map((e) => (!a && e[i] && e[i]?.length === 0 && delete e[i], e)).filter((e) => {
|
|
221
258
|
let t = s.filter((t) => e[n] === t[r]);
|
|
222
259
|
return t.length > 0 ? e[i] = t : a && (e[i] = []), o === !1 ? !0 : e[r] === o;
|
|
223
260
|
});
|
|
224
261
|
}
|
|
225
|
-
function
|
|
262
|
+
function E(e, t) {
|
|
226
263
|
return e.map((e) => {
|
|
227
264
|
let n = { ...e };
|
|
228
|
-
return n.children &&=
|
|
265
|
+
return n.children &&= E(n.children, t), t(n) || n.children && n.children.length > 0 ? n : null;
|
|
229
266
|
}).filter(Boolean);
|
|
230
267
|
}
|
|
231
|
-
function
|
|
268
|
+
function _e(e, t, n) {
|
|
232
269
|
let { value: r, children: i } = n || {
|
|
233
270
|
value: "value",
|
|
234
271
|
children: "children"
|
|
@@ -243,21 +280,21 @@ function findValueAndAncestors(e, t, n) {
|
|
|
243
280
|
for (let t of e) if (o(t, [])) break;
|
|
244
281
|
return a;
|
|
245
282
|
}
|
|
246
|
-
function
|
|
283
|
+
function D(e, t, n) {
|
|
247
284
|
let r = n?.value || "id", i = n?.children || "children";
|
|
248
285
|
for (let a of e) {
|
|
249
286
|
if (a[r] === t) return a;
|
|
250
287
|
let e = a[i];
|
|
251
288
|
if (e) {
|
|
252
|
-
let r =
|
|
289
|
+
let r = D(e, t, n);
|
|
253
290
|
if (r) return r;
|
|
254
291
|
}
|
|
255
292
|
}
|
|
256
293
|
}
|
|
257
|
-
function
|
|
258
|
-
return e &&
|
|
294
|
+
function ve(e) {
|
|
295
|
+
return e && g(e) ? e[e.length - 1] : null;
|
|
259
296
|
}
|
|
260
|
-
function
|
|
297
|
+
function ye(e = [], t, n = "children") {
|
|
261
298
|
function r(e, t) {
|
|
262
299
|
return t.map((t, i) => {
|
|
263
300
|
let a = `${e}-${i + 1}`;
|
|
@@ -265,36 +302,49 @@ function getSortIndex(e = [], t, n = "children") {
|
|
|
265
302
|
});
|
|
266
303
|
}
|
|
267
304
|
return structuredClone(e).map((e, i) => {
|
|
268
|
-
let a =
|
|
305
|
+
let a = _(t) && t.current || 1, o = _(t) && t.pageSize || 10, s = `${a ? (a - 1) * o + (i + 1) : i + 1}`;
|
|
269
306
|
return e[n] && (e[n] = r(`${s}`, e[n])), e.sortIndex = s, e;
|
|
270
307
|
});
|
|
271
308
|
}
|
|
272
|
-
|
|
309
|
+
//#endregion
|
|
310
|
+
//#region src/array/unique.ts
|
|
311
|
+
function be(e) {
|
|
273
312
|
let t = new Set(e);
|
|
274
313
|
return Array.from(t);
|
|
275
314
|
}
|
|
276
|
-
|
|
315
|
+
//#endregion
|
|
316
|
+
//#region src/class/prefix.ts
|
|
317
|
+
function xe({ suffixCls: e, customizePrefixCls: t, isPor: n, className: r }) {
|
|
277
318
|
let i = r || (n ? "gx-pro" : "gx");
|
|
278
319
|
return t || (e ? `${i}-${e}` : i);
|
|
279
320
|
}
|
|
280
|
-
|
|
321
|
+
//#endregion
|
|
322
|
+
//#region src/clone/getTag.ts
|
|
323
|
+
function Se(e) {
|
|
281
324
|
return Object.prototype.toString.call(e);
|
|
282
325
|
}
|
|
283
|
-
|
|
326
|
+
//#endregion
|
|
327
|
+
//#region src/clone/symbols.ts
|
|
328
|
+
function Ce(e) {
|
|
284
329
|
return Object.getOwnPropertySymbols(e);
|
|
285
330
|
}
|
|
286
|
-
|
|
287
|
-
|
|
331
|
+
//#endregion
|
|
332
|
+
//#region src/clone/tags.ts
|
|
333
|
+
var we = "[object Arguments]", Te = "[object Array]", Ee = "[object ArrayBuffer]", De = "[object Boolean]", Oe = "[object DataView]", ke = "[object Date]", Ae = "[object Float32Array]", je = "[object Float64Array]", Me = "[object Int8Array]", Ne = "[object Int16Array]", Pe = "[object Int32Array]", Fe = "[object Map]", Ie = "[object Number]", Le = "[object Object]", Re = "[object RegExp]", ze = "[object Set]", Be = "[object String]", Ve = "[object Symbol]", He = "[object Uint8Array]", Ue = "[object Uint8ClampedArray]", We = "[object Uint16Array]", Ge = "[object Uint32Array]";
|
|
334
|
+
//#endregion
|
|
335
|
+
//#region src/clone/cloneDeepWith.ts
|
|
336
|
+
function Ke(e, t) {
|
|
337
|
+
return O(e, void 0, e, /* @__PURE__ */ new Map(), t);
|
|
288
338
|
}
|
|
289
|
-
function
|
|
339
|
+
function O(e, t, n, r = /* @__PURE__ */ new Map(), i = void 0) {
|
|
290
340
|
let a = i?.(e, t, n, r);
|
|
291
341
|
if (a !== void 0) return a;
|
|
292
|
-
if (
|
|
342
|
+
if (b(e)) return e;
|
|
293
343
|
if (r.has(e)) return r.get(e);
|
|
294
344
|
if (Array.isArray(e)) {
|
|
295
345
|
let t = Array.from({ length: e.length });
|
|
296
346
|
r.set(e, t);
|
|
297
|
-
for (let a = 0; a < e.length; a++) t[a] =
|
|
347
|
+
for (let a = 0; a < e.length; a++) t[a] = O(e[a], a, n, r, i);
|
|
298
348
|
return Object.prototype.hasOwnProperty.call(e, "index") && (t.index = e.index), Object.prototype.hasOwnProperty.call(e, "input") && (t.input = e.input), t;
|
|
299
349
|
}
|
|
300
350
|
if (e instanceof Date) return new Date(e.getTime());
|
|
@@ -305,102 +355,108 @@ function cloneDeepWithImpl(e, t, n, r = /* @__PURE__ */ new Map(), i = void 0) {
|
|
|
305
355
|
if (e instanceof Map) {
|
|
306
356
|
let t = /* @__PURE__ */ new Map();
|
|
307
357
|
r.set(e, t);
|
|
308
|
-
for (let [a, o] of e) t.set(a,
|
|
358
|
+
for (let [a, o] of e) t.set(a, O(o, a, n, r, i));
|
|
309
359
|
return t;
|
|
310
360
|
}
|
|
311
361
|
if (e instanceof Set) {
|
|
312
362
|
let t = /* @__PURE__ */ new Set();
|
|
313
363
|
r.set(e, t);
|
|
314
|
-
for (let a of e) t.add(
|
|
364
|
+
for (let a of e) t.add(O(a, void 0, n, r, i));
|
|
315
365
|
return t;
|
|
316
366
|
}
|
|
317
367
|
if (typeof Buffer < "u" && Buffer.isBuffer(e)) return e.subarray();
|
|
318
|
-
if (
|
|
368
|
+
if (ce(e)) {
|
|
319
369
|
let t = new (Object.getPrototypeOf(e)).constructor(e.length);
|
|
320
370
|
r.set(e, t);
|
|
321
|
-
for (let a = 0; a < e.length; a++) t[a] =
|
|
371
|
+
for (let a = 0; a < e.length; a++) t[a] = O(e[a], a, n, r, i);
|
|
322
372
|
return t;
|
|
323
373
|
}
|
|
324
374
|
if (e instanceof ArrayBuffer || typeof SharedArrayBuffer < "u" && e instanceof SharedArrayBuffer) return e.slice(0);
|
|
325
375
|
if (e instanceof DataView) {
|
|
326
376
|
let t = new DataView(e.buffer.slice(0), e.byteOffset, e.byteLength);
|
|
327
|
-
return r.set(e, t),
|
|
377
|
+
return r.set(e, t), k(t, e, n, r, i), t;
|
|
328
378
|
}
|
|
329
379
|
if (typeof File < "u" && e instanceof File) {
|
|
330
380
|
let t = new File([e], e.name, { type: e.type });
|
|
331
|
-
return r.set(e, t),
|
|
381
|
+
return r.set(e, t), k(t, e, n, r, i), t;
|
|
332
382
|
}
|
|
333
383
|
if (typeof Blob < "u" && e instanceof Blob) {
|
|
334
384
|
let t = new Blob([e], { type: e.type });
|
|
335
|
-
return r.set(e, t),
|
|
385
|
+
return r.set(e, t), k(t, e, n, r, i), t;
|
|
336
386
|
}
|
|
337
387
|
if (e instanceof Error) {
|
|
338
388
|
let t = new e.constructor();
|
|
339
|
-
return r.set(e, t), t.message = e.message, t.name = e.name, t.stack = e.stack, t.cause = e.cause,
|
|
389
|
+
return r.set(e, t), t.message = e.message, t.name = e.name, t.stack = e.stack, t.cause = e.cause, k(t, e, n, r, i), t;
|
|
340
390
|
}
|
|
341
391
|
if (typeof e == "boolean") {
|
|
342
392
|
let t = !!e.valueOf();
|
|
343
|
-
return r.set(e, t),
|
|
393
|
+
return r.set(e, t), k(t, e, n, r, i), t;
|
|
344
394
|
}
|
|
345
395
|
if (typeof e == "number") {
|
|
346
396
|
let t = Number(e.valueOf());
|
|
347
|
-
return r.set(e, t),
|
|
397
|
+
return r.set(e, t), k(t, e, n, r, i), t;
|
|
348
398
|
}
|
|
349
399
|
if (typeof e == "string") {
|
|
350
400
|
let t = String(e.valueOf());
|
|
351
|
-
return r.set(e, t),
|
|
401
|
+
return r.set(e, t), k(t, e, n, r, i), t;
|
|
352
402
|
}
|
|
353
|
-
if (typeof e == "object" &&
|
|
403
|
+
if (typeof e == "object" && qe(e)) {
|
|
354
404
|
let t = Object.create(Object.getPrototypeOf(e));
|
|
355
|
-
return r.set(e, t),
|
|
405
|
+
return r.set(e, t), k(t, e, n, r, i), t;
|
|
356
406
|
}
|
|
357
407
|
return e;
|
|
358
408
|
}
|
|
359
|
-
function
|
|
360
|
-
let a = [...Object.keys(t), ...
|
|
409
|
+
function k(e, t, n = e, r, i) {
|
|
410
|
+
let a = [...Object.keys(t), ...Ce(t)];
|
|
361
411
|
for (let o = 0; o < a.length; o++) {
|
|
362
412
|
let s = a[o], c = Object.getOwnPropertyDescriptor(e, s);
|
|
363
|
-
(c == null || c.writable) && (e[s] =
|
|
364
|
-
}
|
|
365
|
-
}
|
|
366
|
-
function
|
|
367
|
-
switch (
|
|
368
|
-
case
|
|
369
|
-
case
|
|
370
|
-
case
|
|
371
|
-
case
|
|
372
|
-
case
|
|
373
|
-
case
|
|
374
|
-
case
|
|
375
|
-
case
|
|
376
|
-
case
|
|
377
|
-
case
|
|
378
|
-
case
|
|
379
|
-
case
|
|
380
|
-
case
|
|
381
|
-
case
|
|
382
|
-
case
|
|
383
|
-
case
|
|
384
|
-
case
|
|
385
|
-
case
|
|
386
|
-
case
|
|
387
|
-
case
|
|
388
|
-
case
|
|
389
|
-
case
|
|
413
|
+
(c == null || c.writable) && (e[s] = O(t[s], s, n, r, i));
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
function qe(e) {
|
|
417
|
+
switch (Se(e)) {
|
|
418
|
+
case we:
|
|
419
|
+
case Te:
|
|
420
|
+
case Ee:
|
|
421
|
+
case Oe:
|
|
422
|
+
case De:
|
|
423
|
+
case ke:
|
|
424
|
+
case Ae:
|
|
425
|
+
case je:
|
|
426
|
+
case Me:
|
|
427
|
+
case Ne:
|
|
428
|
+
case Pe:
|
|
429
|
+
case Fe:
|
|
430
|
+
case Ie:
|
|
431
|
+
case Le:
|
|
432
|
+
case Re:
|
|
433
|
+
case ze:
|
|
434
|
+
case Be:
|
|
435
|
+
case Ve:
|
|
436
|
+
case He:
|
|
437
|
+
case Ue:
|
|
438
|
+
case We:
|
|
439
|
+
case Ge: return !0;
|
|
390
440
|
default: return !1;
|
|
391
441
|
}
|
|
392
442
|
}
|
|
393
|
-
|
|
394
|
-
|
|
443
|
+
//#endregion
|
|
444
|
+
//#region src/clone/cloneDeep.ts
|
|
445
|
+
function A(e) {
|
|
446
|
+
return O(e, void 0, e, /* @__PURE__ */ new Map(), void 0);
|
|
395
447
|
}
|
|
396
|
-
|
|
448
|
+
//#endregion
|
|
449
|
+
//#region src/dom/event.ts
|
|
450
|
+
function Je(e, t, n, r = !1) {
|
|
397
451
|
e && t && n && e.addEventListener(t, n, r);
|
|
398
452
|
}
|
|
399
|
-
function
|
|
453
|
+
function Ye(e, t, n, r = !1) {
|
|
400
454
|
e && t && n && e.removeEventListener(t, n, r);
|
|
401
455
|
}
|
|
402
|
-
|
|
403
|
-
|
|
456
|
+
//#endregion
|
|
457
|
+
//#region src/dom/measure.ts
|
|
458
|
+
function Xe(e, t) {
|
|
459
|
+
let n = 0, r = m(t.removeAfter) ? t.removeAfter : !0, i = t.id || "hiddenElement", a = {
|
|
404
460
|
opacity: 0,
|
|
405
461
|
visibility: "hidden",
|
|
406
462
|
position: "fixed",
|
|
@@ -414,42 +470,46 @@ function getTextWidth(e, t) {
|
|
|
414
470
|
}
|
|
415
471
|
Object.assign(o.style, a);
|
|
416
472
|
let s = document.createElement(t.createName || "span");
|
|
417
|
-
return s.innerHTML = e, (t.cssObject ||
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
var
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
473
|
+
return s.innerHTML = e, (t.cssObject || _(t.cssObject)) && Object.assign(s.style, t.cssObject), o.append(s), n = s.getBoundingClientRect()[t.type || "width"], r && o.removeChild(s), n;
|
|
474
|
+
}
|
|
475
|
+
//#endregion
|
|
476
|
+
//#region src/dom/raf.ts
|
|
477
|
+
var j = (e) => setTimeout(e, 16), M = (e) => clearTimeout(e);
|
|
478
|
+
typeof window < "u" && "requestAnimationFrame" in window && (j = (e) => window.requestAnimationFrame(e), M = (e) => window.cancelAnimationFrame(e));
|
|
479
|
+
var N = 0, P = /* @__PURE__ */ new Map();
|
|
480
|
+
function F(e) {
|
|
481
|
+
P.delete(e);
|
|
482
|
+
}
|
|
483
|
+
function I(e, t = 1) {
|
|
484
|
+
N += 1;
|
|
485
|
+
let n = N;
|
|
428
486
|
function r(t) {
|
|
429
|
-
if (t === 0)
|
|
487
|
+
if (t === 0) F(n), e();
|
|
430
488
|
else {
|
|
431
|
-
let e =
|
|
489
|
+
let e = j(() => {
|
|
432
490
|
r(t - 1);
|
|
433
491
|
});
|
|
434
|
-
|
|
492
|
+
P.set(n, e);
|
|
435
493
|
}
|
|
436
494
|
}
|
|
437
495
|
return r(t), n;
|
|
438
496
|
}
|
|
439
|
-
|
|
440
|
-
let t =
|
|
441
|
-
return
|
|
497
|
+
I.cancel = (e) => {
|
|
498
|
+
let t = P.get(e);
|
|
499
|
+
return F(t), M(t);
|
|
442
500
|
};
|
|
443
|
-
|
|
501
|
+
//#endregion
|
|
502
|
+
//#region src/dom/scroll.ts
|
|
503
|
+
function L(e, t, n, r) {
|
|
444
504
|
let i = n - t;
|
|
445
505
|
return e /= r / 2, e < 1 ? i / 2 * e * e * e + t : i / 2 * ((e -= 2) * e * e + 2) + t;
|
|
446
506
|
}
|
|
447
|
-
function
|
|
507
|
+
function Ze(e) {
|
|
448
508
|
return e.replace(/[-_](.)/g, (e, t) => t.toUpperCase());
|
|
449
509
|
}
|
|
450
|
-
function
|
|
451
|
-
if (
|
|
452
|
-
t =
|
|
510
|
+
function R(e, t) {
|
|
511
|
+
if (x || !e || !t) return "";
|
|
512
|
+
t = Ze(t), t === "float" && (t = "cssFloat");
|
|
453
513
|
try {
|
|
454
514
|
let n = e.style[t];
|
|
455
515
|
if (n) return n;
|
|
@@ -459,11 +519,11 @@ function getStyle(e, t) {
|
|
|
459
519
|
return e.style[t];
|
|
460
520
|
}
|
|
461
521
|
}
|
|
462
|
-
function
|
|
463
|
-
if (!
|
|
522
|
+
function z(e, t) {
|
|
523
|
+
if (!x) return (t == null ? R(e, "overflow") : t ? R(e, "overflow-y") : R(e, "overflow-x")).match(/(scroll|auto|overlay)/);
|
|
464
524
|
}
|
|
465
|
-
function
|
|
466
|
-
if (
|
|
525
|
+
function Qe(e, t) {
|
|
526
|
+
if (x) return;
|
|
467
527
|
let n = e;
|
|
468
528
|
for (; n;) {
|
|
469
529
|
if ([
|
|
@@ -471,13 +531,13 @@ function getScrollContainer(e, t) {
|
|
|
471
531
|
document,
|
|
472
532
|
document.documentElement
|
|
473
533
|
].includes(n)) return window;
|
|
474
|
-
if (
|
|
534
|
+
if (z(n, t)) return n;
|
|
475
535
|
n = n.parentNode;
|
|
476
536
|
}
|
|
477
537
|
return n;
|
|
478
538
|
}
|
|
479
|
-
function
|
|
480
|
-
if (
|
|
539
|
+
function $e(e, t) {
|
|
540
|
+
if (x || !e || !t) return !1;
|
|
481
541
|
let n = e.getBoundingClientRect(), r;
|
|
482
542
|
return r = [
|
|
483
543
|
window,
|
|
@@ -492,22 +552,24 @@ function isInContainer(e, t) {
|
|
|
492
552
|
left: 0
|
|
493
553
|
} : t.getBoundingClientRect(), n.top < r.bottom && n.bottom > r.top && n.right > r.left && n.left < r.right;
|
|
494
554
|
}
|
|
495
|
-
function
|
|
555
|
+
function B(e) {
|
|
496
556
|
return e != null && e === e.window;
|
|
497
557
|
}
|
|
498
|
-
function
|
|
558
|
+
function V(e, t) {
|
|
499
559
|
if (typeof window > "u") return 0;
|
|
500
560
|
let n = t ? "scrollTop" : "scrollLeft", r = 0;
|
|
501
|
-
return
|
|
561
|
+
return B(e) ? r = e[t ? "pageYOffset" : "pageXOffset"] : e instanceof Document ? r = e.documentElement[n] : e && (r = e[n]), e && !B(e) && typeof r != "number" && (r = (e.ownerDocument || e).documentElement?.[n]), r;
|
|
502
562
|
}
|
|
503
|
-
function
|
|
504
|
-
let { getContainer: n = () => window, callback: r, duration: i = 450 } = t, a = n(), o =
|
|
505
|
-
let t = Date.now() - s, n =
|
|
506
|
-
|
|
563
|
+
function et(e, t = {}) {
|
|
564
|
+
let { getContainer: n = () => window, callback: r, duration: i = 450 } = t, a = n(), o = V(a, !0), s = Date.now(), c = () => {
|
|
565
|
+
let t = Date.now() - s, n = L(t > i ? i : t, o, e, i);
|
|
566
|
+
B(a) ? a.scrollTo(window.pageXOffset, n) : a instanceof HTMLDocument || a.constructor.name === "HTMLDocument" ? a.documentElement.scrollTop = n : a.scrollTop = n, t < i ? I(c) : typeof r == "function" && r();
|
|
507
567
|
};
|
|
508
|
-
a &&
|
|
568
|
+
a && I(c);
|
|
509
569
|
}
|
|
510
|
-
|
|
570
|
+
//#endregion
|
|
571
|
+
//#region src/file/config.ts
|
|
572
|
+
var H = {
|
|
511
573
|
videoAllowType: [
|
|
512
574
|
"mp4",
|
|
513
575
|
"webm",
|
|
@@ -581,45 +643,51 @@ const fileTypes = {
|
|
|
581
643
|
"ape"
|
|
582
644
|
]
|
|
583
645
|
};
|
|
584
|
-
|
|
646
|
+
//#endregion
|
|
647
|
+
//#region src/file/convert.ts
|
|
648
|
+
function tt(e) {
|
|
585
649
|
return URL.createObjectURL(e);
|
|
586
650
|
}
|
|
587
|
-
function
|
|
651
|
+
function nt(e) {
|
|
588
652
|
return new Promise((t, n) => {
|
|
589
653
|
let r = new FileReader();
|
|
590
654
|
r.readAsDataURL(e), r.onload = () => t(r.result), r.onerror = (e) => n(e);
|
|
591
655
|
});
|
|
592
656
|
}
|
|
593
|
-
function
|
|
657
|
+
function rt(e) {
|
|
594
658
|
let t = e.split(","), n = t[0].match(/:(.*?);/)[1], r = atob(t[1]), i = r.length, a = new Uint8Array(i);
|
|
595
659
|
for (; i--;) a[i] = r.charCodeAt(i);
|
|
596
660
|
return new Blob([a], { type: n });
|
|
597
661
|
}
|
|
598
|
-
function
|
|
662
|
+
function it(e, t) {
|
|
599
663
|
let n = e.split(","), r = n[0].match(/:(.*?);/)[1], i = atob(n[1]), a = i.length, o = new Uint8Array(a);
|
|
600
664
|
for (; a--;) o[a] = i.charCodeAt(a);
|
|
601
665
|
return new File([o], t, { type: r });
|
|
602
666
|
}
|
|
603
|
-
function
|
|
667
|
+
function at(e, t, n) {
|
|
604
668
|
return new window.File([e], t, { type: n });
|
|
605
669
|
}
|
|
606
|
-
|
|
670
|
+
//#endregion
|
|
671
|
+
//#region src/file/type.ts
|
|
672
|
+
function U(e) {
|
|
607
673
|
if (!e || typeof e != "string") return "";
|
|
608
|
-
let t =
|
|
674
|
+
let t = W(e), n = t.lastIndexOf(".");
|
|
609
675
|
return n > 0 && `${t?.substring?.(n)?.split("?")?.[0]}`?.split(".")?.[1] || "";
|
|
610
676
|
}
|
|
611
|
-
function
|
|
677
|
+
function W(e) {
|
|
612
678
|
if (!e || typeof e != "string") return "";
|
|
613
679
|
let t = e.indexOf("?");
|
|
614
680
|
return t > 0 ? `${e.substring(0, t)}` : e;
|
|
615
681
|
}
|
|
616
|
-
function
|
|
682
|
+
function G(e, t) {
|
|
617
683
|
if (t) return t;
|
|
618
684
|
if (!e || e === "data:") return "4";
|
|
619
685
|
let n = "4";
|
|
620
|
-
return
|
|
686
|
+
return r(e) ? e.includes("data:image/") ? n = "png" : e.includes("data:video/") ? n = "mp4" : e.includes("data:audio/") && (n = "mp3") : e instanceof Blob ? (e = String(e), e.includes("image") ? n = "png" : e.includes("video") ? n = "mp4" : e.includes("audio") && (n = "mp3")) : n = U(e).toLowerCase(), H.imageType.includes(n) ? "1" : H.videoType.includes(n) ? "3" : H.audioType.includes(n) ? "2" : "4";
|
|
621
687
|
}
|
|
622
|
-
|
|
688
|
+
//#endregion
|
|
689
|
+
//#region src/file/media.ts
|
|
690
|
+
function K(e) {
|
|
623
691
|
let { url: t = "", fileType: n = "1" } = e || {}, i = "", a = {
|
|
624
692
|
play: !1,
|
|
625
693
|
height: 0,
|
|
@@ -636,7 +704,7 @@ function getMediaInfos(e) {
|
|
|
636
704
|
duration: 0
|
|
637
705
|
};
|
|
638
706
|
}
|
|
639
|
-
return t instanceof File ? i = URL.createObjectURL(t) :
|
|
707
|
+
return t instanceof File ? i = URL.createObjectURL(t) : r(t) ? i = t : t instanceof Blob ? i = URL.createObjectURL(t) : (t.includes("https") || t.includes("http")) && (i = t), new Promise((e) => {
|
|
640
708
|
let t;
|
|
641
709
|
if (n === "4") {
|
|
642
710
|
e(a);
|
|
@@ -651,18 +719,18 @@ function getMediaInfos(e) {
|
|
|
651
719
|
};
|
|
652
720
|
});
|
|
653
721
|
}
|
|
654
|
-
async function
|
|
722
|
+
async function ot(e) {
|
|
655
723
|
let { url: t = "", currentTime: n, videoSuffix: i = "", videoAllowPlay: a = !1 } = e, o = "", s = i, c = "1", l;
|
|
656
|
-
return t instanceof File ? (o = URL.createObjectURL(t), s =
|
|
724
|
+
return t instanceof File ? (o = URL.createObjectURL(t), s = U(t.name), c = G(t.name)) : t instanceof Blob ? (o = URL.createObjectURL(t), c = G(t)) : r(t) ? (o = t, c = G(t)) : (t.includes("https") || t.includes("http")) && (o = t, s = U(t), c = G(t)), s && H.videoAllowType.includes(s.toLowerCase()) ? a ? q(o, n) : (l = await K({
|
|
657
725
|
url: o,
|
|
658
726
|
fileType: c
|
|
659
|
-
}), l.play ?
|
|
727
|
+
}), l.play ? q(o, n) : new Promise((e) => {
|
|
660
728
|
e("");
|
|
661
729
|
})) : new Promise((e) => {
|
|
662
730
|
e("");
|
|
663
731
|
});
|
|
664
732
|
}
|
|
665
|
-
async function
|
|
733
|
+
async function q(e, t = 0) {
|
|
666
734
|
return new Promise((n) => {
|
|
667
735
|
let r = document.createElement("video");
|
|
668
736
|
r && (r.controls = !0, r.muted = !0, r.setAttribute("src", e), r.setAttribute("muted", "true"), r.setAttribute("crossorigin", "anonymous"), r.setAttribute("autoplay", "true"), r.addEventListener("loadeddata", async () => {
|
|
@@ -677,49 +745,80 @@ async function generateVideoPicture(e, t = 0) {
|
|
|
677
745
|
}));
|
|
678
746
|
});
|
|
679
747
|
}
|
|
680
|
-
|
|
748
|
+
//#endregion
|
|
749
|
+
//#region src/function/copy.ts
|
|
750
|
+
function st(e) {
|
|
681
751
|
return JSON.parse(JSON.stringify(e));
|
|
682
752
|
}
|
|
683
|
-
|
|
753
|
+
//#endregion
|
|
754
|
+
//#region src/function/getValue.ts
|
|
755
|
+
function ct(e, t) {
|
|
684
756
|
if (typeof t != "string" && !Array.isArray(t)) return;
|
|
685
757
|
let n = Array.isArray(t) ? t : t.split(":"), r = e;
|
|
686
758
|
for (let e = 0; e < n.length; e++) if (r && Object.prototype.hasOwnProperty.call(r, n[e])) r = r[n[e]];
|
|
687
759
|
else return;
|
|
688
760
|
return r;
|
|
689
761
|
}
|
|
690
|
-
|
|
762
|
+
//#endregion
|
|
763
|
+
//#region src/function/run.ts
|
|
764
|
+
function lt(e, ...t) {
|
|
691
765
|
return typeof e == "function" ? e(...t) : e;
|
|
692
766
|
}
|
|
693
|
-
|
|
767
|
+
//#endregion
|
|
768
|
+
//#region src/merge/mergeWith.ts
|
|
769
|
+
function J(e, t, n) {
|
|
694
770
|
let r = Object.keys(t);
|
|
695
771
|
for (let i = 0; i < r.length; i++) {
|
|
696
772
|
let a = r[i];
|
|
697
|
-
if (
|
|
773
|
+
if (le(a)) continue;
|
|
698
774
|
let o = t[a], s = e[a], c = n(s, o, a, e, t);
|
|
699
|
-
c === void 0 ?
|
|
775
|
+
c === void 0 ? y(o) ? y(s) ? e[a] = J(s, o, n) : e[a] = J({}, o, n) : e[a] = o : e[a] = c;
|
|
700
776
|
}
|
|
701
777
|
return e;
|
|
702
778
|
}
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
779
|
+
//#endregion
|
|
780
|
+
//#region src/merge/useDeepMege.ts
|
|
781
|
+
function ut(e, t) {
|
|
782
|
+
return J(e, t, function e(t, n) {
|
|
783
|
+
if (y(n)) return y(t) ? J(t, n, e) : J({}, n, e);
|
|
706
784
|
});
|
|
707
785
|
}
|
|
708
|
-
|
|
786
|
+
//#endregion
|
|
787
|
+
//#region src/merge/index.ts
|
|
788
|
+
function dt(...e) {
|
|
709
789
|
let t = {}, n = e.length, r, i = 0;
|
|
710
|
-
for (; i < n; i += 1) for (r in e[i]) Object.
|
|
790
|
+
for (; i < n; i += 1) for (r in e[i]) Object.getOwnPropertyDescriptor(e[i], r) && (typeof t[r] == "object" && typeof e[i][r] == "object" && t[r] !== void 0 && t[r] !== null && !Array.isArray(t[r]) && !Array.isArray(e[i][r]) ? t[r] = {
|
|
711
791
|
...t[r],
|
|
712
792
|
...e[i][r]
|
|
713
793
|
} : t[r] = e[i][r]);
|
|
714
794
|
return t;
|
|
715
795
|
}
|
|
716
|
-
function
|
|
717
|
-
|
|
718
|
-
|
|
796
|
+
function ft(e, t) {
|
|
797
|
+
let n = /* @__PURE__ */ new WeakMap(), r = A(e);
|
|
798
|
+
y(t) && n.set(t, r);
|
|
799
|
+
let i = J(r, t, function e(t, r) {
|
|
800
|
+
if (y(r)) {
|
|
801
|
+
let i = n.get(r);
|
|
802
|
+
if (i) return i;
|
|
803
|
+
if (y(t)) {
|
|
804
|
+
let i = A(t);
|
|
805
|
+
n.set(r, i);
|
|
806
|
+
let a = J(i, r, e);
|
|
807
|
+
return n.delete(r), a;
|
|
808
|
+
} else {
|
|
809
|
+
let t = {};
|
|
810
|
+
n.set(r, t);
|
|
811
|
+
let i = J(t, r, e);
|
|
812
|
+
return n.delete(r), i;
|
|
813
|
+
}
|
|
814
|
+
}
|
|
719
815
|
});
|
|
816
|
+
return y(t) && n.delete(t), i;
|
|
720
817
|
}
|
|
721
|
-
|
|
722
|
-
|
|
818
|
+
//#endregion
|
|
819
|
+
//#region src/number/chinese.ts
|
|
820
|
+
function pt(e) {
|
|
821
|
+
e = h(e) && !Number.isNaN(e) ? e : 0;
|
|
723
822
|
let t = [
|
|
724
823
|
"零",
|
|
725
824
|
"一",
|
|
@@ -746,7 +845,9 @@ function toChinesNum(e) {
|
|
|
746
845
|
}, i = Math.floor(e / 1e4), a = e % 1e4;
|
|
747
846
|
return a.toString().length < 4 && (a = `0${a}`), i ? `${r(i)}万${r(a)}` : r(e);
|
|
748
847
|
}
|
|
749
|
-
|
|
848
|
+
//#endregion
|
|
849
|
+
//#region src/number/format.ts
|
|
850
|
+
function Y(e, t) {
|
|
750
851
|
let n = `^\\d+(?:\\.\\d{0,${e}})?`, r = new RegExp(n), i = t.toString().match(r);
|
|
751
852
|
if (i) {
|
|
752
853
|
let e = i[0];
|
|
@@ -758,9 +859,9 @@ function formatNumber(e, t) {
|
|
|
758
859
|
}
|
|
759
860
|
return t.toString();
|
|
760
861
|
}
|
|
761
|
-
function
|
|
762
|
-
let { toChinese: n = !1, fixed: r = 2, min: i = 1e4 } = t || {}, a =
|
|
763
|
-
if (!
|
|
862
|
+
function mt(e, t) {
|
|
863
|
+
let { toChinese: n = !1, fixed: r = 2, min: i = 1e4 } = t || {}, a = h(i) ? i : 1e4, o = h(r) ? r : 2, s = n ? e < a ? "" : e < 1e8 ? "万" : "亿" : e < a ? "" : e < 1e8 ? "w" : "亿";
|
|
864
|
+
if (!h(e) || e < a) return {
|
|
764
865
|
str: `${e}`,
|
|
765
866
|
number: `${e}`
|
|
766
867
|
};
|
|
@@ -773,47 +874,57 @@ function toConvertNumberShow(e, t) {
|
|
|
773
874
|
};
|
|
774
875
|
}
|
|
775
876
|
let c;
|
|
776
|
-
return e < 1e8 ? (c =
|
|
877
|
+
return e < 1e8 ? (c = Y(o, e / 1e4), {
|
|
777
878
|
str: c + s,
|
|
778
879
|
number: c,
|
|
779
880
|
unit: s
|
|
780
|
-
}) : (c =
|
|
881
|
+
}) : (c = Y(o, e / 1e8), {
|
|
781
882
|
str: c + s,
|
|
782
883
|
number: c,
|
|
783
884
|
unit: s
|
|
784
885
|
});
|
|
785
886
|
}
|
|
786
|
-
|
|
887
|
+
//#endregion
|
|
888
|
+
//#region src/object/classNames.ts
|
|
889
|
+
function X(...e) {
|
|
787
890
|
let t = [];
|
|
788
891
|
for (let n = 0; n < e.length; n++) {
|
|
789
892
|
let r = e[n];
|
|
790
893
|
if (r) {
|
|
791
|
-
if (
|
|
792
|
-
else if (
|
|
793
|
-
let n =
|
|
894
|
+
if (v(r)) t.push(r);
|
|
895
|
+
else if (g(r)) for (let e = 0; e < r.length; e++) {
|
|
896
|
+
let n = X(r[e]);
|
|
794
897
|
n && t.push(n);
|
|
795
898
|
}
|
|
796
|
-
else if (
|
|
899
|
+
else if (_(r)) for (let e in r) r[e] && t.push(e);
|
|
797
900
|
}
|
|
798
901
|
}
|
|
799
902
|
return t.filter((e) => e).join(" ");
|
|
800
903
|
}
|
|
801
|
-
|
|
904
|
+
//#endregion
|
|
905
|
+
//#region src/object/omitBoolean.ts
|
|
906
|
+
function ht(e) {
|
|
802
907
|
if (e && e !== !0) return e;
|
|
803
908
|
}
|
|
804
|
-
|
|
909
|
+
//#endregion
|
|
910
|
+
//#region src/object/omitUndefined.ts
|
|
911
|
+
function gt(e) {
|
|
805
912
|
let t = {};
|
|
806
913
|
if (Object.keys(e || {}).forEach((n) => {
|
|
807
914
|
e[n] !== void 0 && (t[n] = e[n]);
|
|
808
915
|
}), !(Object.keys(t).length < 1)) return t;
|
|
809
916
|
}
|
|
810
|
-
|
|
917
|
+
//#endregion
|
|
918
|
+
//#region src/object/omitUndefinedAndEmptyArr.ts
|
|
919
|
+
function _t(e) {
|
|
811
920
|
let t = {};
|
|
812
921
|
return Object.keys(e || {}).forEach((n) => {
|
|
813
922
|
Array.isArray(e[n]) && e[n]?.length === 0 || e[n] !== void 0 && (t[n] = e[n]);
|
|
814
923
|
}), t;
|
|
815
924
|
}
|
|
816
|
-
|
|
925
|
+
//#endregion
|
|
926
|
+
//#region src/string/duration.ts
|
|
927
|
+
function vt(e) {
|
|
817
928
|
let t = "";
|
|
818
929
|
if (e > -1) {
|
|
819
930
|
let n = Math.floor(e / 3600), r = Math.floor(e / 60) % 60, i = Number.parseInt(String(e % 60));
|
|
@@ -821,7 +932,9 @@ function formatDuration(e) {
|
|
|
821
932
|
}
|
|
822
933
|
return t.split(":")[0] === "00" ? `${t.split(":")[1]}:${t.split(":")[2]}` : t;
|
|
823
934
|
}
|
|
824
|
-
|
|
935
|
+
//#endregion
|
|
936
|
+
//#region src/string/empty.ts
|
|
937
|
+
function yt(e, t) {
|
|
825
938
|
let n = ["null", "undefined"], r = !0;
|
|
826
939
|
return e === 0 ? r = !0 : n.includes(e) ? r = !1 : e || (r = !1), r ? {
|
|
827
940
|
value: e,
|
|
@@ -831,9 +944,11 @@ function handleEmptyField(e, t) {
|
|
|
831
944
|
success: r
|
|
832
945
|
};
|
|
833
946
|
}
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
947
|
+
//#endregion
|
|
948
|
+
//#region src/string/nanoid.ts
|
|
949
|
+
var bt = 0;
|
|
950
|
+
function xt(e = 21) {
|
|
951
|
+
if (typeof window > "u" || !window.crypto) return (bt += 1).toFixed(0);
|
|
837
952
|
let t = "", n = crypto.getRandomValues(new Uint8Array(e));
|
|
838
953
|
for (; e--;) {
|
|
839
954
|
let r = 63 & n[e];
|
|
@@ -841,10 +956,12 @@ function genNanoid(e = 21) {
|
|
|
841
956
|
}
|
|
842
957
|
return t;
|
|
843
958
|
}
|
|
844
|
-
function
|
|
845
|
-
return typeof window > "u" ?
|
|
959
|
+
function St() {
|
|
960
|
+
return typeof window > "u" ? xt() : window.crypto && window.crypto.randomUUID && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : xt();
|
|
846
961
|
}
|
|
847
|
-
|
|
962
|
+
//#endregion
|
|
963
|
+
//#region src/string/uuid.ts
|
|
964
|
+
function Ct() {
|
|
848
965
|
let e = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");
|
|
849
966
|
return {
|
|
850
967
|
uuid(t, n) {
|
|
@@ -869,11 +986,13 @@ function getRandomNumber() {
|
|
|
869
986
|
}
|
|
870
987
|
};
|
|
871
988
|
}
|
|
872
|
-
|
|
873
|
-
|
|
989
|
+
//#endregion
|
|
990
|
+
//#region src/table/column.ts
|
|
991
|
+
function wt(e, t) {
|
|
992
|
+
return e ? g(e) ? e.join("-") : e.toString() : `${t || 0}`;
|
|
874
993
|
}
|
|
875
|
-
function
|
|
876
|
-
let r =
|
|
994
|
+
function Tt(e, { align: t, showIndex: n }) {
|
|
995
|
+
let r = A(e);
|
|
877
996
|
if (n && e.length && e.every((e) => e.dataIndex !== "sortIndex")) {
|
|
878
997
|
let n = e[0];
|
|
879
998
|
r.unshift({
|
|
@@ -881,68 +1000,73 @@ function handleShowIndex(e, { align: t, showIndex: n }) {
|
|
|
881
1000
|
align: t,
|
|
882
1001
|
fixed: n.fixed,
|
|
883
1002
|
width: 60,
|
|
884
|
-
uuid:
|
|
1003
|
+
uuid: Ct().uuid(15),
|
|
885
1004
|
dataIndex: "sortIndex",
|
|
886
1005
|
key: "sortIndex"
|
|
887
1006
|
});
|
|
888
1007
|
} else r.filter((e) => e.dataIndex !== "sortIndex");
|
|
889
1008
|
return r;
|
|
890
1009
|
}
|
|
891
|
-
|
|
892
|
-
|
|
1010
|
+
//#endregion
|
|
1011
|
+
//#region src/table/page.ts
|
|
1012
|
+
function Et(e, t) {
|
|
1013
|
+
if (_(e)) {
|
|
893
1014
|
let { pageSize: n = 10, total: r = 0 } = e, { current: i = 1 } = e;
|
|
894
1015
|
return r - t <= n * (i - 1) && --i, i === 0 ? 1 : i;
|
|
895
1016
|
}
|
|
896
1017
|
return 1;
|
|
897
1018
|
}
|
|
898
|
-
|
|
1019
|
+
//#endregion
|
|
1020
|
+
//#region src/vue/slots.ts
|
|
1021
|
+
function Dt(e) {
|
|
899
1022
|
if (!(typeof e != "string" && !Array.isArray(e))) return Array.isArray(e) ? e[e.length - 1] : e.split(":")?.slice(-1)[0];
|
|
900
1023
|
}
|
|
901
|
-
function
|
|
902
|
-
return n && (n.type ===
|
|
1024
|
+
function Ot(n) {
|
|
1025
|
+
return n && (n.type === e || n.type === t && n.children.length === 0 || n.type === Text && n.children.trim() === "");
|
|
903
1026
|
}
|
|
904
|
-
function
|
|
905
|
-
return
|
|
1027
|
+
function kt(e, t) {
|
|
1028
|
+
return Z(typeof e[t] == "function" ? e[t]?.() : []);
|
|
906
1029
|
}
|
|
907
|
-
function
|
|
1030
|
+
function Z(e = [], r = !0) {
|
|
908
1031
|
let i = Array.isArray(e) ? e : [e], a = [];
|
|
909
1032
|
return i.forEach((e) => {
|
|
910
|
-
Array.isArray(e) ? a.push(...
|
|
1033
|
+
Array.isArray(e) ? a.push(...Z(e, r)) : e?.type === t || e?.type === "template" ? a.push(...Z(e.children, r)) : e && n(e) ? r && !Ot(e) ? a.push(e) : r || a.push(e) : de(e) && a.push(e);
|
|
911
1034
|
}), a;
|
|
912
1035
|
}
|
|
913
|
-
function
|
|
1036
|
+
function Q({ vnode: e, defaultVNode: t }, ...n) {
|
|
914
1037
|
return e === !1 ? null : typeof e == "function" ? e?.(...n) : e || t;
|
|
915
1038
|
}
|
|
916
|
-
function
|
|
1039
|
+
function At(e, ...t) {
|
|
917
1040
|
let { slots: r, key: i = "default", render: a, props: o, defaultChildren: s } = e, c, l = o[i], u = r?.[i], d = typeof s == "function" ? s?.() : s;
|
|
918
|
-
return c = l === !1 ? !1 : l === !0 ? u ?? d :
|
|
1041
|
+
return c = l === !1 ? !1 : l === !0 ? u ?? d : _(l) && a ? n(l) ? l : u : l || u, c === !1 ? !1 : a ? Q({
|
|
919
1042
|
vnode: c,
|
|
920
1043
|
defaultVNode: d
|
|
921
1044
|
}, ...t) : c;
|
|
922
1045
|
}
|
|
923
|
-
function
|
|
1046
|
+
function $(e, ...t) {
|
|
924
1047
|
let { slots: r, key: i = "default", props: a, defaultChildren: o } = e, s, c = a[i], l = r?.[i]?.(...t), u = typeof o == "function" ? o?.() : o;
|
|
925
|
-
return s = c === !1 ? !1 : c === !0 ? l ?? u :
|
|
1048
|
+
return s = c === !1 ? !1 : c === !0 ? l ?? u : _(c) ? n(c) ? c : l : c || l, s === !1 ? !1 : Q({
|
|
926
1049
|
vnode: s,
|
|
927
1050
|
defaultVNode: u
|
|
928
1051
|
}, ...t);
|
|
929
1052
|
}
|
|
930
|
-
function
|
|
1053
|
+
function jt(e, ...t) {
|
|
931
1054
|
let { slots: n, props: r, keys: i, render: a, defaultVNodes: o } = e, s = {};
|
|
932
1055
|
return i.forEach((e, i) => {
|
|
933
|
-
let c = o ? o[i] : null, l = a ?
|
|
1056
|
+
let c = o ? o[i] : null, l = a ? $({
|
|
934
1057
|
slots: n,
|
|
935
1058
|
props: r,
|
|
936
1059
|
key: e,
|
|
937
1060
|
defaultChildren: c
|
|
938
|
-
}, ...t) :
|
|
1061
|
+
}, ...t) : At({
|
|
939
1062
|
slots: n,
|
|
940
1063
|
props: r,
|
|
941
1064
|
key: e,
|
|
942
1065
|
render: !1,
|
|
943
1066
|
defaultChildren: c
|
|
944
1067
|
}, ...t);
|
|
945
|
-
(
|
|
1068
|
+
(m(l) || l) && (s[e] = l);
|
|
946
1069
|
}), s;
|
|
947
1070
|
}
|
|
948
|
-
|
|
1071
|
+
//#endregion
|
|
1072
|
+
export { pe as arraySlice, be as arrayUnique, at as blobToDataURL, G as checkFileType, X as classNames, A as cloneDeep, Ke as cloneDeepWith, O as cloneDeepWithImpl, S as compareArray, me as compareArraySort, he as compareArrayTimeSort, C as compareTime, fe as convertValueBoolean, k as copyProperties, rt as dataURLtoBlob, it as dataURLtoFile, st as deepCopy, ft as deepMerge, L as easeInOutCubic, H as fileTypes, Z as filterEmpty, E as filterTree, D as findSourceByTree, _e as findValueAndAncestors, re as forInObject, vt as formatDuration, Y as formatNumber, wt as genColumnKey, q as generateVideoPicture, ve as getArrayLast, nt as getBase64, tt as getBlobUrl, U as getFileSuffix, Dt as getKeys, T as getLevelData, w as getMaxFloor, K as getMediaInfos, xe as getPrefixCls, Ct as getRandomNumber, V as getScroll, Qe as getScrollContainer, At as getSlot, $ as getSlotVNode, kt as getSlotsChildren, jt as getSlotsProps, ye as getSortIndex, f as getSymbols, Xe as getTextWidth, ct as getValueFromObjectByKey, ot as getVideoCoverPicture, W as getVideoFileUrl, Et as handleCurrentPage, yt as handleEmptyField, Tt as handleShowIndex, p as is, g as isArray, r as isBase64, m as isBoolean, o as isBrowser, i as isDataURLBase64, s as isDeepEqualReact, Ot as isEmptyElement, d as isEqual, ae as isFunction, ee as isImg, $e as isInContainer, oe as isJSONStr, c as isMobile, te as isNil, ne as isNotNil, h as isNumber, _ as isObject, se as isObjectWithSymbols, y as isPlainObject, b as isPrimitive, z as isScroll, x as isServer, v as isString, l as isTablet, ce as isTypedArray, le as isUnsafeProperty, ue as isUrl, de as isValid, B as isWindow, u as isWindowsOs, ie as keysOf, dt as merge, J as mergeWith, St as nanoid, Ye as off, ht as omitBoolean, gt as omitUndefined, _t as omitUndefinedAndEmptyArr, Je as on, I as raf, lt as runFunction, et as scrollTo, Q as slotRender, pt as toChinesNum, mt as toConvertNumberShow, ge as treeData, ut as useDeepMerge };
|