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