@gx-design-vue/pro-utils 0.2.0-beta.36 → 0.2.0-beta.37
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/pro-utils.js +206 -204
- package/dist/pro-utils.umd.cjs +2 -2
- package/dist/slots/index.d.ts +6 -6
- package/package.json +1 -1
package/dist/pro-utils.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Comment as
|
|
2
|
-
const
|
|
1
|
+
import { Comment as V, Fragment as j, isVNode as m } from "vue";
|
|
2
|
+
const w = typeof window > "u";
|
|
3
3
|
/**
|
|
4
4
|
* @vue/shared v3.5.11
|
|
5
5
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
@@ -7,16 +7,16 @@ const m = typeof window > "u";
|
|
|
7
7
|
**/
|
|
8
8
|
process.env.NODE_ENV !== "production" && Object.freeze({});
|
|
9
9
|
process.env.NODE_ENV !== "production" && Object.freeze([]);
|
|
10
|
-
const
|
|
10
|
+
const z = (e) => {
|
|
11
11
|
const t = /* @__PURE__ */ Object.create(null);
|
|
12
12
|
return (r) => t[r] || (t[r] = e(r));
|
|
13
|
-
},
|
|
14
|
-
(e) => e.replace(
|
|
15
|
-
),
|
|
13
|
+
}, H = /-(\w)/g, W = z(
|
|
14
|
+
(e) => e.replace(H, (t, r) => r ? r.toUpperCase() : "")
|
|
15
|
+
), y = function(e, t) {
|
|
16
16
|
var r;
|
|
17
|
-
if (
|
|
17
|
+
if (w || !e || !t)
|
|
18
18
|
return "";
|
|
19
|
-
t =
|
|
19
|
+
t = W(t), t === "float" && (t = "cssFloat");
|
|
20
20
|
try {
|
|
21
21
|
const n = e.style[t];
|
|
22
22
|
if (n)
|
|
@@ -26,20 +26,20 @@ const $ = (e) => {
|
|
|
26
26
|
} catch {
|
|
27
27
|
return e.style[t];
|
|
28
28
|
}
|
|
29
|
-
},
|
|
30
|
-
if (
|
|
29
|
+
}, _ = (e, t) => w ? void 0 : (t == null ? y(e, "overflow") : t ? y(e, "overflow-y") : y(e, "overflow-x")).match(/(scroll|auto|overlay)/), oe = (e, t) => {
|
|
30
|
+
if (w)
|
|
31
31
|
return;
|
|
32
32
|
let r = e;
|
|
33
33
|
for (; r; ) {
|
|
34
34
|
if ([window, document, document.documentElement].includes(r))
|
|
35
35
|
return window;
|
|
36
|
-
if (
|
|
36
|
+
if (_(r, t))
|
|
37
37
|
return r;
|
|
38
38
|
r = r.parentNode;
|
|
39
39
|
}
|
|
40
40
|
return r;
|
|
41
|
-
},
|
|
42
|
-
if (
|
|
41
|
+
}, ue = (e, t) => {
|
|
42
|
+
if (w || !e || !t)
|
|
43
43
|
return !1;
|
|
44
44
|
const r = e.getBoundingClientRect();
|
|
45
45
|
let n;
|
|
@@ -50,10 +50,10 @@ const $ = (e) => {
|
|
|
50
50
|
left: 0
|
|
51
51
|
} : n = t.getBoundingClientRect(), r.top < n.bottom && r.bottom > n.top && r.right > n.left && r.left < n.right;
|
|
52
52
|
};
|
|
53
|
-
function
|
|
53
|
+
function ce(e) {
|
|
54
54
|
return /\w.(png|jpg|jpeg|svg|webp|gif|bmp)$/i.test(e);
|
|
55
55
|
}
|
|
56
|
-
const
|
|
56
|
+
const fe = (e) => e == null, se = (e) => {
|
|
57
57
|
if (!e || !e.startsWith("http"))
|
|
58
58
|
return !1;
|
|
59
59
|
try {
|
|
@@ -61,7 +61,7 @@ const ue = (e) => e == null, ce = (e) => {
|
|
|
61
61
|
} catch {
|
|
62
62
|
return !1;
|
|
63
63
|
}
|
|
64
|
-
},
|
|
64
|
+
}, ae = (...e) => {
|
|
65
65
|
const t = {}, r = e.length;
|
|
66
66
|
let n, i = 0;
|
|
67
67
|
for (; i < r; i += 1)
|
|
@@ -72,10 +72,10 @@ const ue = (e) => e == null, ce = (e) => {
|
|
|
72
72
|
} : t[n] = e[i][n]);
|
|
73
73
|
return t;
|
|
74
74
|
};
|
|
75
|
-
let
|
|
76
|
-
const
|
|
75
|
+
let R = 0;
|
|
76
|
+
const b = (e = 21) => {
|
|
77
77
|
if (typeof window > "u" || !window.crypto)
|
|
78
|
-
return (
|
|
78
|
+
return (R += 1).toFixed(0);
|
|
79
79
|
let t = "";
|
|
80
80
|
const r = crypto.getRandomValues(new Uint8Array(e));
|
|
81
81
|
for (; e--; ) {
|
|
@@ -83,8 +83,8 @@ const R = (e = 21) => {
|
|
|
83
83
|
t += n < 36 ? n.toString(36) : n < 62 ? (n - 26).toString(36).toUpperCase() : n < 63 ? "_" : "-";
|
|
84
84
|
}
|
|
85
85
|
return t;
|
|
86
|
-
},
|
|
87
|
-
function
|
|
86
|
+
}, le = () => typeof window > "u" ? b() : window.crypto && window.crypto.randomUUID && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : b();
|
|
87
|
+
function F(e, t) {
|
|
88
88
|
if (typeof t != "string" && !Array.isArray(t))
|
|
89
89
|
return;
|
|
90
90
|
const r = Array.isArray(t) ? t : t.split(":");
|
|
@@ -96,96 +96,96 @@ function j(e, t) {
|
|
|
96
96
|
return;
|
|
97
97
|
return n;
|
|
98
98
|
}
|
|
99
|
-
const
|
|
100
|
-
function
|
|
101
|
-
return
|
|
99
|
+
const q = Object.prototype.toString;
|
|
100
|
+
function L(e, t) {
|
|
101
|
+
return q.call(e) === `[object ${t}]`;
|
|
102
102
|
}
|
|
103
|
-
function
|
|
104
|
-
return
|
|
103
|
+
function J(e) {
|
|
104
|
+
return L(e, "Boolean");
|
|
105
105
|
}
|
|
106
|
-
function
|
|
106
|
+
function de(e) {
|
|
107
107
|
return typeof e == "number";
|
|
108
108
|
}
|
|
109
|
-
function
|
|
109
|
+
function D(e) {
|
|
110
110
|
return typeof Array.isArray > "u" ? Object.prototype.toString.call(e) === "[object Array]" : Array.isArray(e);
|
|
111
111
|
}
|
|
112
|
-
function
|
|
113
|
-
return e !== null &&
|
|
112
|
+
function d(e) {
|
|
113
|
+
return e !== null && L(e, "Object");
|
|
114
114
|
}
|
|
115
|
-
function
|
|
115
|
+
function X(e) {
|
|
116
116
|
return typeof e == "string" || e instanceof String;
|
|
117
117
|
}
|
|
118
|
-
function
|
|
118
|
+
function pe(e) {
|
|
119
119
|
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Function]";
|
|
120
120
|
}
|
|
121
|
-
function
|
|
121
|
+
function Y(...e) {
|
|
122
122
|
const t = [];
|
|
123
123
|
for (let r = 0; r < e.length; r++) {
|
|
124
124
|
const n = e[r];
|
|
125
125
|
if (n) {
|
|
126
|
-
if (
|
|
126
|
+
if (X(n))
|
|
127
127
|
t.push(n);
|
|
128
|
-
else if (
|
|
128
|
+
else if (D(n))
|
|
129
129
|
for (let i = 0; i < n.length; i++) {
|
|
130
|
-
const o =
|
|
130
|
+
const o = Y(n[i]);
|
|
131
131
|
o && t.push(o);
|
|
132
132
|
}
|
|
133
|
-
else if (
|
|
133
|
+
else if (d(n))
|
|
134
134
|
for (const i in n)
|
|
135
135
|
n[i] && t.push(i);
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
138
|
return t.filter((r) => r).join(" ");
|
|
139
139
|
}
|
|
140
|
-
let
|
|
141
|
-
typeof window < "u" && "requestAnimationFrame" in window && (
|
|
142
|
-
let
|
|
143
|
-
const
|
|
144
|
-
function
|
|
145
|
-
|
|
140
|
+
let C = (e) => setTimeout(e, 16), B = (e) => clearTimeout(e);
|
|
141
|
+
typeof window < "u" && "requestAnimationFrame" in window && (C = (e) => window.requestAnimationFrame(e), B = (e) => window.cancelAnimationFrame(e));
|
|
142
|
+
let I = 0;
|
|
143
|
+
const S = /* @__PURE__ */ new Map();
|
|
144
|
+
function P(e) {
|
|
145
|
+
S.delete(e);
|
|
146
146
|
}
|
|
147
|
-
function
|
|
148
|
-
|
|
149
|
-
const r =
|
|
147
|
+
function x(e, t = 1) {
|
|
148
|
+
I += 1;
|
|
149
|
+
const r = I;
|
|
150
150
|
function n(i) {
|
|
151
151
|
if (i === 0)
|
|
152
|
-
|
|
152
|
+
P(r), e();
|
|
153
153
|
else {
|
|
154
|
-
const o =
|
|
154
|
+
const o = C(() => {
|
|
155
155
|
n(i - 1);
|
|
156
156
|
});
|
|
157
|
-
|
|
157
|
+
S.set(r, o);
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
return n(t), r;
|
|
161
161
|
}
|
|
162
|
-
|
|
163
|
-
const t =
|
|
164
|
-
return
|
|
162
|
+
x.cancel = (e) => {
|
|
163
|
+
const t = S.get(e);
|
|
164
|
+
return P(t), B(t);
|
|
165
165
|
};
|
|
166
|
-
function
|
|
166
|
+
function v(e) {
|
|
167
167
|
return e != null && e === e.window;
|
|
168
168
|
}
|
|
169
|
-
function
|
|
169
|
+
function G(e, t) {
|
|
170
170
|
var i;
|
|
171
171
|
if (typeof window > "u")
|
|
172
172
|
return 0;
|
|
173
173
|
const r = t ? "scrollTop" : "scrollLeft";
|
|
174
174
|
let n = 0;
|
|
175
|
-
return
|
|
175
|
+
return v(e) ? n = e[t ? "pageYOffset" : "pageXOffset"] : e instanceof Document ? n = e.documentElement[r] : e && (n = e[r]), e && !v(e) && typeof n != "number" && (n = (i = (e.ownerDocument || e).documentElement) == null ? void 0 : i[r]), n;
|
|
176
176
|
}
|
|
177
|
-
function
|
|
177
|
+
function Q(e, t, r, n) {
|
|
178
178
|
const i = r - t;
|
|
179
179
|
return e /= n / 2, e < 1 ? i / 2 * e * e * e + t : i / 2 * ((e -= 2) * e * e + 2) + t;
|
|
180
180
|
}
|
|
181
|
-
function
|
|
182
|
-
const { getContainer: r = () => window, callback: n, duration: i = 450 } = t, o = r(), u =
|
|
183
|
-
const
|
|
184
|
-
|
|
181
|
+
function ge(e, t = {}) {
|
|
182
|
+
const { getContainer: r = () => window, callback: n, duration: i = 450 } = t, o = r(), u = G(o, !0), c = Date.now(), f = () => {
|
|
183
|
+
const a = Date.now() - c, l = Q(a > i ? i : a, u, e, i);
|
|
184
|
+
v(o) ? o.scrollTo(window.pageXOffset, l) : o instanceof HTMLDocument || o.constructor.name === "HTMLDocument" ? o.documentElement.scrollTop = l : o.scrollTop = l, a < i ? x(f) : typeof n == "function" && n();
|
|
185
185
|
};
|
|
186
|
-
|
|
186
|
+
x(f);
|
|
187
187
|
}
|
|
188
|
-
function
|
|
188
|
+
function me(e) {
|
|
189
189
|
let t;
|
|
190
190
|
const r = (i) => () => {
|
|
191
191
|
t = null, e(...i);
|
|
@@ -194,7 +194,7 @@ function pe(e) {
|
|
|
194
194
|
};
|
|
195
195
|
return n.cancel = () => cancelAnimationFrame(t), n;
|
|
196
196
|
}
|
|
197
|
-
const
|
|
197
|
+
const g = {
|
|
198
198
|
videoAllowType: [
|
|
199
199
|
"mp4",
|
|
200
200
|
"webm",
|
|
@@ -223,7 +223,7 @@ const p = {
|
|
|
223
223
|
],
|
|
224
224
|
audioType: ["mp3", "mpeg", "aac", "wav", "wma", "mp2", "flac", "midi", "ra", "ape", "aac", "cda"]
|
|
225
225
|
};
|
|
226
|
-
function
|
|
226
|
+
function h(e, t, r, n) {
|
|
227
227
|
if (e === t)
|
|
228
228
|
return !0;
|
|
229
229
|
if (e && t && typeof e == "object" && typeof t == "object") {
|
|
@@ -234,7 +234,7 @@ function y(e, t, r, n) {
|
|
|
234
234
|
if (i = e.length, i != t.length)
|
|
235
235
|
return !1;
|
|
236
236
|
for (o = i; o-- !== 0; )
|
|
237
|
-
if (!
|
|
237
|
+
if (!h(e[o], t[o], r, n))
|
|
238
238
|
return !1;
|
|
239
239
|
return !0;
|
|
240
240
|
}
|
|
@@ -245,7 +245,7 @@ function y(e, t, r, n) {
|
|
|
245
245
|
if (!t.has(o[0]))
|
|
246
246
|
return !1;
|
|
247
247
|
for (o of e.entries())
|
|
248
|
-
if (!
|
|
248
|
+
if (!h(o[1], t.get(o[0]), r, n))
|
|
249
249
|
return !1;
|
|
250
250
|
return !0;
|
|
251
251
|
}
|
|
@@ -278,81 +278,83 @@ function y(e, t, r, n) {
|
|
|
278
278
|
return !1;
|
|
279
279
|
for (o = i; o-- !== 0; ) {
|
|
280
280
|
const c = u[o];
|
|
281
|
-
if (!(r != null && r.includes(c)) && !(c === "_owner" && e.$$typeof) && !
|
|
281
|
+
if (!(r != null && r.includes(c)) && !(c === "_owner" && e.$$typeof) && !h(e[c], t[c], r, n))
|
|
282
282
|
return n && console.log(c), !1;
|
|
283
283
|
}
|
|
284
284
|
return !0;
|
|
285
285
|
}
|
|
286
286
|
return e !== e && t !== t;
|
|
287
287
|
}
|
|
288
|
-
const
|
|
288
|
+
const Z = typeof process < "u" && process.versions != null && process.versions.node != null, we = () => process.env.NODE_ENV === "TEST" ? !0 : typeof window < "u" && typeof window.document < "u" && typeof window.matchMedia < "u" && !Z, ye = (e) => {
|
|
289
289
|
if (e && e !== !0)
|
|
290
290
|
return e;
|
|
291
|
-
},
|
|
291
|
+
}, he = (e) => {
|
|
292
292
|
const t = {};
|
|
293
293
|
if (Object.keys(e || {}).forEach((r) => {
|
|
294
294
|
e[r] !== void 0 && (t[r] = e[r]);
|
|
295
295
|
}), !(Object.keys(t).length < 1))
|
|
296
296
|
return t;
|
|
297
|
-
},
|
|
297
|
+
}, xe = (e) => {
|
|
298
298
|
const t = {};
|
|
299
299
|
return Object.keys(e || {}).forEach((r) => {
|
|
300
300
|
var n;
|
|
301
301
|
Array.isArray(e[r]) && ((n = e[r]) == null ? void 0 : n.length) === 0 || e[r] !== void 0 && (t[r] = e[r]);
|
|
302
302
|
}), t;
|
|
303
303
|
};
|
|
304
|
-
function
|
|
304
|
+
function O(e) {
|
|
305
305
|
var t;
|
|
306
306
|
if (!(typeof e != "string" && !Array.isArray(e)))
|
|
307
307
|
return Array.isArray(e) ? e[e.length - 1] : (t = e.split(":")) == null ? void 0 : t.slice(-1)[0];
|
|
308
308
|
}
|
|
309
|
-
function
|
|
310
|
-
return e && (e.type ===
|
|
309
|
+
function k(e) {
|
|
310
|
+
return e && (e.type === V || e.type === j && e.children.length === 0 || e.type === Text && e.children.trim() === "");
|
|
311
311
|
}
|
|
312
|
-
function
|
|
312
|
+
function ve(e, t) {
|
|
313
313
|
var r;
|
|
314
|
-
return
|
|
314
|
+
return N((r = e[t]) == null ? void 0 : r.call(e));
|
|
315
315
|
}
|
|
316
|
-
function
|
|
316
|
+
function N(e = []) {
|
|
317
317
|
const t = [];
|
|
318
318
|
return e.forEach((r) => {
|
|
319
|
-
Array.isArray(r) ? t.push(...r) : (r == null ? void 0 : r.type) ===
|
|
320
|
-
}), t.filter((r) => !
|
|
319
|
+
Array.isArray(r) ? t.push(...r) : (r == null ? void 0 : r.type) === j ? t.push(...N(r.children)) : t.push(r);
|
|
320
|
+
}), t.filter((r) => !k(r));
|
|
321
321
|
}
|
|
322
|
-
function
|
|
322
|
+
function M(e, ...t) {
|
|
323
323
|
return typeof e == "function" ? e == null ? void 0 : e(...t) : e;
|
|
324
324
|
}
|
|
325
|
-
function
|
|
326
|
-
const
|
|
327
|
-
if (
|
|
328
|
-
|
|
329
|
-
|
|
325
|
+
function Ae(e, t, r = "default", n) {
|
|
326
|
+
const i = O(r);
|
|
327
|
+
if (i) {
|
|
328
|
+
let o;
|
|
329
|
+
const u = F(t, r);
|
|
330
|
+
return u === !1 ? o = !1 : u === !0 ? o = e == null ? void 0 : e[i] : d(u) ? m(u) ? o = u : o = e == null ? void 0 : e[i] : o = u || (e == null ? void 0 : e[i]), m(o) ? o : n ? M(o) : o;
|
|
330
331
|
}
|
|
331
332
|
}
|
|
332
|
-
function
|
|
333
|
-
var
|
|
334
|
-
const
|
|
335
|
-
if (
|
|
336
|
-
|
|
337
|
-
|
|
333
|
+
function K(e, t, r = "default", n) {
|
|
334
|
+
var o, u, c;
|
|
335
|
+
const i = O(r);
|
|
336
|
+
if (i) {
|
|
337
|
+
let f;
|
|
338
|
+
const s = F(t, r);
|
|
339
|
+
return s === !1 ? f = !1 : s === !0 ? f = (o = e == null ? void 0 : e[i]) == null ? void 0 : o.call(e, n) : d(s) ? m(s) ? f = s : f = (u = e == null ? void 0 : e[i]) == null ? void 0 : u.call(e, n) : f = s || ((c = e == null ? void 0 : e[i]) == null ? void 0 : c.call(e, n)), m(f) ? f : M(f, n);
|
|
338
340
|
}
|
|
339
341
|
}
|
|
340
|
-
function
|
|
342
|
+
function Se(e, t, r) {
|
|
341
343
|
const n = {};
|
|
342
344
|
return e.forEach((i) => {
|
|
343
|
-
const o =
|
|
345
|
+
const o = O(i);
|
|
344
346
|
if (o) {
|
|
345
|
-
const u =
|
|
346
|
-
(
|
|
347
|
+
const u = K(t, r, i);
|
|
348
|
+
(J(u) || u) && (n[o] = u);
|
|
347
349
|
}
|
|
348
350
|
}), n;
|
|
349
351
|
}
|
|
350
|
-
const
|
|
352
|
+
const Oe = ({ suffixCls: e, customizePrefixCls: t, isPor: r, className: n }) => {
|
|
351
353
|
const i = n || (r ? "gx-pro" : "gx");
|
|
352
354
|
return t || (e ? `${i}-${e}` : i);
|
|
353
|
-
},
|
|
354
|
-
function
|
|
355
|
-
const n =
|
|
355
|
+
}, Ue = (e, t) => e ? Array.isArray(e) ? e.join("-") : e.toString() : `${t}`;
|
|
356
|
+
function Ee(e, { align: t, showIndex: r }) {
|
|
357
|
+
const n = U(e);
|
|
356
358
|
if (r && e.length && e.every((i) => i.dataIndex !== "sortIndex")) {
|
|
357
359
|
const i = e[0];
|
|
358
360
|
n.unshift({
|
|
@@ -360,7 +362,7 @@ function Ue(e, { align: t, showIndex: r }) {
|
|
|
360
362
|
align: t,
|
|
361
363
|
fixed: i.fixed,
|
|
362
364
|
width: 60,
|
|
363
|
-
uuid:
|
|
365
|
+
uuid: ee().uuid(15),
|
|
364
366
|
dataIndex: "sortIndex",
|
|
365
367
|
key: "sortIndex"
|
|
366
368
|
});
|
|
@@ -368,44 +370,44 @@ function Ue(e, { align: t, showIndex: r }) {
|
|
|
368
370
|
n.filter((i) => i.dataIndex !== "sortIndex");
|
|
369
371
|
return n;
|
|
370
372
|
}
|
|
371
|
-
function
|
|
373
|
+
function Re(e, ...t) {
|
|
372
374
|
return typeof e == "function" ? e(...t) : e;
|
|
373
375
|
}
|
|
374
|
-
function
|
|
376
|
+
function U(e) {
|
|
375
377
|
return JSON.parse(JSON.stringify(e));
|
|
376
378
|
}
|
|
377
|
-
function
|
|
378
|
-
if (
|
|
379
|
+
function be(e, t) {
|
|
380
|
+
if (d(e)) {
|
|
379
381
|
const { pageSize: r = 10, total: n = 0 } = e;
|
|
380
382
|
let { current: i = 1 } = e;
|
|
381
383
|
return n - t <= r * (i - 1) && (i = i - 1), i === 0 ? 1 : i;
|
|
382
384
|
}
|
|
383
385
|
return 1;
|
|
384
386
|
}
|
|
385
|
-
function
|
|
387
|
+
function Ie(e = [], t, r = "children") {
|
|
386
388
|
function n(i, o) {
|
|
387
389
|
return o.map((u, c) => {
|
|
388
390
|
const f = `${i}-${c + 1}`;
|
|
389
391
|
return u[r] && (u[r] = n(f, u[r])), u.sortIndex = f, u;
|
|
390
392
|
});
|
|
391
393
|
}
|
|
392
|
-
return
|
|
394
|
+
return U(e).map((i, o) => {
|
|
393
395
|
let u = o;
|
|
394
|
-
const c =
|
|
396
|
+
const c = d(t) && t.current || 1, f = d(t) && t.pageSize || 10;
|
|
395
397
|
return u = c ? (c - 1) * f + (o + 1) : o + 1, i[r] && (i[r] = n(`${u}`, i[r])), i.sortIndex = u, i;
|
|
396
398
|
});
|
|
397
399
|
}
|
|
398
|
-
function
|
|
400
|
+
function Te(e, t, r, n) {
|
|
399
401
|
const i = e[r], o = t[r];
|
|
400
402
|
let u = 0;
|
|
401
403
|
return i < o ? u = n === 0 ? -1 : 0 : i > o && (u = n === 0 ? 0 : -1), u;
|
|
402
404
|
}
|
|
403
|
-
function
|
|
404
|
-
let t =
|
|
405
|
+
function je(e) {
|
|
406
|
+
let t = U(e);
|
|
405
407
|
const r = new Set(t);
|
|
406
408
|
return t = Array.from(r), t;
|
|
407
409
|
}
|
|
408
|
-
function
|
|
410
|
+
function Fe(e, t) {
|
|
409
411
|
const r = ["null", "undefined"];
|
|
410
412
|
let n = !0;
|
|
411
413
|
return e === 0 ? n = !0 : r.includes(e) ? n = !1 : e || (n = !1), n ? {
|
|
@@ -416,7 +418,7 @@ function je(e, t) {
|
|
|
416
418
|
success: n
|
|
417
419
|
};
|
|
418
420
|
}
|
|
419
|
-
function
|
|
421
|
+
function Le(e) {
|
|
420
422
|
let t = "";
|
|
421
423
|
if (e > -1) {
|
|
422
424
|
const r = Math.floor(e / 3600), n = Math.floor(e / 60) % 60, i = Number.parseInt(String(e % 60));
|
|
@@ -424,7 +426,7 @@ function Fe(e) {
|
|
|
424
426
|
}
|
|
425
427
|
return t.split(":")[0] === "00" ? `${t.split(":")[1]}:${t.split(":")[2]}` : t;
|
|
426
428
|
}
|
|
427
|
-
function
|
|
429
|
+
function ee() {
|
|
428
430
|
const e = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");
|
|
429
431
|
return {
|
|
430
432
|
uuid(t, r) {
|
|
@@ -456,7 +458,7 @@ function k() {
|
|
|
456
458
|
}
|
|
457
459
|
};
|
|
458
460
|
}
|
|
459
|
-
function
|
|
461
|
+
function De(e = []) {
|
|
460
462
|
let t = 0;
|
|
461
463
|
function r(n = [], i) {
|
|
462
464
|
n.forEach((o) => {
|
|
@@ -465,13 +467,13 @@ function Le(e = []) {
|
|
|
465
467
|
}
|
|
466
468
|
return r(e, 1), t;
|
|
467
469
|
}
|
|
468
|
-
function
|
|
470
|
+
function te(e, t = "children") {
|
|
469
471
|
let r = [];
|
|
470
472
|
return e.forEach((n) => {
|
|
471
|
-
r.push(n),
|
|
473
|
+
r.push(n), D(n[t]) && n[t].length > 0 && (r = r.concat(te(n[t])));
|
|
472
474
|
}), r;
|
|
473
475
|
}
|
|
474
|
-
function
|
|
476
|
+
function Ce(e, t, r, n, i) {
|
|
475
477
|
t = t || "id", r = r || "parentId", n = n || "children", i = i || 0;
|
|
476
478
|
const o = JSON.parse(JSON.stringify(e));
|
|
477
479
|
return o.filter((u) => {
|
|
@@ -479,16 +481,16 @@ function De(e, t, r, n, i) {
|
|
|
479
481
|
return c.length > 0 ? u[n || "children"] = c : delete u[n || "children"], u[r || "parentId"] === i;
|
|
480
482
|
});
|
|
481
483
|
}
|
|
482
|
-
function
|
|
484
|
+
function Be(e) {
|
|
483
485
|
return URL.createObjectURL(e);
|
|
484
486
|
}
|
|
485
|
-
function
|
|
487
|
+
function Pe(e) {
|
|
486
488
|
return new Promise((t, r) => {
|
|
487
489
|
const n = new FileReader();
|
|
488
490
|
n.readAsDataURL(e), n.onload = () => t(n.result), n.onerror = (i) => r(i);
|
|
489
491
|
});
|
|
490
492
|
}
|
|
491
|
-
function
|
|
493
|
+
function Ne(e) {
|
|
492
494
|
const t = e.split(","), r = t[0].match(/:(.*?);/)[1], n = atob(t[1]);
|
|
493
495
|
let i = n.length;
|
|
494
496
|
const o = new Uint8Array(i);
|
|
@@ -504,30 +506,30 @@ function Me(e, t) {
|
|
|
504
506
|
u[o] = i.charCodeAt(o);
|
|
505
507
|
return new File([u], t, { type: n });
|
|
506
508
|
}
|
|
507
|
-
function
|
|
509
|
+
function $e(e, t, r) {
|
|
508
510
|
return new window.File([e], t, { type: r });
|
|
509
511
|
}
|
|
510
|
-
function
|
|
512
|
+
function ne(e = "") {
|
|
511
513
|
const t = e.indexOf("?");
|
|
512
514
|
return t > 0 ? `${e.substring(0, t)}` : e;
|
|
513
515
|
}
|
|
514
|
-
function
|
|
515
|
-
e =
|
|
516
|
+
function A(e = "") {
|
|
517
|
+
e = ne(e);
|
|
516
518
|
const t = e.lastIndexOf(".");
|
|
517
519
|
return t > 0 ? `${e.substring(t).split("?")[0]}`.split(".")[1] : "";
|
|
518
520
|
}
|
|
519
|
-
function
|
|
521
|
+
function p(e, t) {
|
|
520
522
|
if (t)
|
|
521
523
|
return t;
|
|
522
524
|
if (!e || e === "data:")
|
|
523
525
|
return "4";
|
|
524
526
|
let r = "4";
|
|
525
|
-
return
|
|
527
|
+
return E(e) ? e.includes("data:image/") ? r = "png" : e.includes("data:video/") ? r = "mp4" : e.includes("data:audio/") && (r = "mp3") : e instanceof Blob ? (e = String(e), e.includes("image") ? r = "png" : e.includes("video") ? r = "mp4" : e.includes("audio") && (r = "mp3")) : r = A(e).toLowerCase(), g.imageType.includes(r) ? "1" : g.videoType.includes(r) ? "3" : g.audioType.includes(r) ? "2" : "4";
|
|
526
528
|
}
|
|
527
|
-
function
|
|
529
|
+
function re(e) {
|
|
528
530
|
const { url: t = "", fileType: r = "1" } = e;
|
|
529
531
|
let n = "";
|
|
530
|
-
return t instanceof File ? n = URL.createObjectURL(t) :
|
|
532
|
+
return t instanceof File ? n = URL.createObjectURL(t) : E(t) ? n = t : t instanceof Blob ? n = URL.createObjectURL(t) : (t.includes("https") || t.includes("http")) && (n = t), new Promise((i) => {
|
|
531
533
|
let o;
|
|
532
534
|
r === "1" ? (o = document.createElement("img"), o.src = n) : r === "2" ? (o = document.createElement("audio"), o.src = n) : r === "3" && (o = document.createElement("video"), o.src = n), r === "1" ? o.onload = function() {
|
|
533
535
|
i({
|
|
@@ -549,19 +551,19 @@ function te(e) {
|
|
|
549
551
|
};
|
|
550
552
|
});
|
|
551
553
|
}
|
|
552
|
-
async function
|
|
554
|
+
async function Ve(e) {
|
|
553
555
|
const { url: t = "", currentTime: r, videoSuffix: n = "", vidoeAllowPlay: i = !1 } = e;
|
|
554
556
|
let o = "", u = n, c = "1", f;
|
|
555
|
-
return t instanceof File ? (o = URL.createObjectURL(t), u =
|
|
557
|
+
return t instanceof File ? (o = URL.createObjectURL(t), u = A(t.name), c = p(t.name)) : t instanceof Blob ? (o = URL.createObjectURL(t), c = p(t)) : E(t) ? (o = t, c = p(t)) : (t.includes("https") || t.includes("http")) && (o = t, u = A(t), c = p(t)), (u ? g.videoAllowType.includes(u.toLowerCase()) : !1) ? i ? T(o, r) : (f = await re({
|
|
556
558
|
url: o,
|
|
557
559
|
fileType: c
|
|
558
|
-
}), f.play ?
|
|
559
|
-
|
|
560
|
-
})) : new Promise((
|
|
561
|
-
|
|
560
|
+
}), f.play ? T(o, r) : new Promise((a) => {
|
|
561
|
+
a("");
|
|
562
|
+
})) : new Promise((a) => {
|
|
563
|
+
a("");
|
|
562
564
|
});
|
|
563
565
|
}
|
|
564
|
-
async function
|
|
566
|
+
async function T(e, t = 0) {
|
|
565
567
|
return new Promise((r) => {
|
|
566
568
|
let n = document.createElement("video");
|
|
567
569
|
n.controls = !0, n.muted = !0, n.setAttribute("src", e), n.setAttribute("muted", String(!0)), n.setAttribute("crossorigin", "anonymous"), n.setAttribute("autoplay", String(!0)), n && n.addEventListener("loadeddata", async function() {
|
|
@@ -571,92 +573,92 @@ async function I(e, t = 0) {
|
|
|
571
573
|
});
|
|
572
574
|
const o = (n == null ? void 0 : n.duration) || 0;
|
|
573
575
|
for (; t < o; ) {
|
|
574
|
-
n && (n.currentTime = t), await new Promise((
|
|
575
|
-
const u = document.createElement("canvas"), c = 0.8, f = u.getContext("2d"),
|
|
576
|
-
u.width = (n == null ? void 0 : n.videoWidth) || 0 * c, u.height = (n == null ? void 0 : n.videoHeight) || 0 * c, f.drawImage(n, 0, 0,
|
|
576
|
+
n && (n.currentTime = t), await new Promise(($) => i = $);
|
|
577
|
+
const u = document.createElement("canvas"), c = 0.8, f = u.getContext("2d"), s = (n == null ? void 0 : n.videoWidth) || 0 * c, a = (n == null ? void 0 : n.videoHeight) || 0 * c, l = 0;
|
|
578
|
+
u.width = (n == null ? void 0 : n.videoWidth) || 0 * c, u.height = (n == null ? void 0 : n.videoHeight) || 0 * c, f.drawImage(n, 0, 0, s + l, a + l), n = null, r(s === 0 || a === 0 ? "" : u.toDataURL("image/png", 1));
|
|
577
579
|
}
|
|
578
580
|
});
|
|
579
581
|
});
|
|
580
582
|
}
|
|
581
|
-
function
|
|
583
|
+
function E(e = "") {
|
|
582
584
|
return !!(e && [
|
|
583
585
|
"data:image/",
|
|
584
586
|
"data:video/",
|
|
585
587
|
"data:audio/"
|
|
586
588
|
].find((r) => e.includes(r)));
|
|
587
589
|
}
|
|
588
|
-
function
|
|
590
|
+
function ze(e, t, r, n = !1) {
|
|
589
591
|
e && t && r && e.addEventListener(t, r, n);
|
|
590
592
|
}
|
|
591
|
-
function
|
|
593
|
+
function He(e, t, r, n = !1) {
|
|
592
594
|
e && t && r && e.removeEventListener(t, r, n);
|
|
593
595
|
}
|
|
594
|
-
function
|
|
596
|
+
function We() {
|
|
595
597
|
return /windows|win32/i.test(navigator.userAgent);
|
|
596
598
|
}
|
|
597
599
|
export {
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
600
|
+
je as arrayRepeat,
|
|
601
|
+
$e as blobToDataURL,
|
|
602
|
+
p as checkFileType,
|
|
603
|
+
Y as classNames,
|
|
604
|
+
Te as compareArray,
|
|
605
|
+
Ne as dataURLtoBlob,
|
|
604
606
|
Me as dataURLtoFile,
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
607
|
+
U as deepCopy,
|
|
608
|
+
N as filterEmpty,
|
|
609
|
+
Le as formatDuraton,
|
|
610
|
+
Ue as genColumnKey,
|
|
611
|
+
T as generateVidoePicture,
|
|
612
|
+
Pe as getBase64,
|
|
613
|
+
Be as getBlobUrl,
|
|
614
|
+
A as getFileSuffix,
|
|
615
|
+
te as getLevelData,
|
|
616
|
+
De as getMaxFloor,
|
|
617
|
+
re as getMediaInfos,
|
|
618
|
+
Oe as getPrefixCls,
|
|
619
|
+
ee as getRandomNumber,
|
|
620
|
+
G as getScroll,
|
|
621
|
+
oe as getScrollContainer,
|
|
622
|
+
Ae as getSlot,
|
|
623
|
+
K as getSlotVNode,
|
|
624
|
+
ve as getSlotsChildren,
|
|
625
|
+
Se as getSlotsProps,
|
|
626
|
+
Ie as getSortIndex,
|
|
627
|
+
F as getValueFromObjectByKey,
|
|
628
|
+
Ve as getVideoCoverPicture,
|
|
629
|
+
ne as getVideoFileUrl,
|
|
630
|
+
g as globalConfig,
|
|
631
|
+
be as handleCurrentPage,
|
|
632
|
+
Ee as handleShowIndex,
|
|
633
|
+
Fe as hanndleField,
|
|
634
|
+
L as is,
|
|
635
|
+
D as isArray,
|
|
636
|
+
E as isBase64,
|
|
637
|
+
J as isBoolean,
|
|
638
|
+
we as isBrowser,
|
|
639
|
+
h as isDeepEqualReact,
|
|
640
|
+
k as isEmptyElement,
|
|
641
|
+
pe as isFunction,
|
|
642
|
+
ce as isImg,
|
|
643
|
+
ue as isInContainer,
|
|
644
|
+
fe as isNil,
|
|
645
|
+
de as isNumber,
|
|
646
|
+
d as isObject,
|
|
647
|
+
_ as isScroll,
|
|
648
|
+
w as isServer,
|
|
649
|
+
X as isString,
|
|
650
|
+
se as isUrl,
|
|
651
|
+
We as isWindowsOs,
|
|
652
|
+
ae as merge,
|
|
653
|
+
le as nanoid,
|
|
654
|
+
He as off,
|
|
655
|
+
ye as omitBoolean,
|
|
656
|
+
he as omitUndefined,
|
|
657
|
+
xe as omitUndefinedAndEmptyArr,
|
|
658
|
+
ze as on,
|
|
659
|
+
Re as runFunction,
|
|
660
|
+
ge as scrollTo,
|
|
661
|
+
M as slotRender,
|
|
662
|
+
me as throttleByAnimationFrame,
|
|
663
|
+
Ce as treeData
|
|
662
664
|
};
|
package/dist/pro-utils.umd.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
(function(u,
|
|
1
|
+
(function(u,l){typeof exports=="object"&&typeof module<"u"?l(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],l):(u=typeof globalThis<"u"?globalThis:u||self,l(u.PorUtils={},u.vue))})(this,function(u,l){"use strict";const p=typeof window>"u";/**
|
|
2
2
|
* @vue/shared v3.5.11
|
|
3
3
|
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
4
4
|
* @license MIT
|
|
5
|
-
**/process.env.NODE_ENV!=="production"&&Object.freeze({}),process.env.NODE_ENV!=="production"&&Object.freeze([]);const G=e=>{const n=Object.create(null);return r=>n[r]||(n[r]=e(r))},Q=/-(\w)/g,Z=G(e=>e.replace(Q,(n,r)=>r?r.toUpperCase():"")),O=function(e,n){var r;if(g||!e||!n)return"";n=Z(n),n==="float"&&(n="cssFloat");try{const t=e.style[n];if(t)return t;const i=(r=document==null?void 0:document.defaultView)==null?void 0:r.getComputedStyle(e,"");return i?i[n]:""}catch{return e.style[n]}},L=(e,n)=>g?void 0:(n==null?O(e,"overflow"):n?O(e,"overflow-y"):O(e,"overflow-x")).match(/(scroll|auto|overlay)/),k=(e,n)=>{if(g)return;let r=e;for(;r;){if([window,document,document.documentElement].includes(r))return window;if(L(r,n))return r;r=r.parentNode}return r},K=(e,n)=>{if(g||!e||!n)return!1;const r=e.getBoundingClientRect();let t;return[window,document,document.documentElement,null,void 0].includes(n)?t={top:0,right:window.innerWidth,bottom:window.innerHeight,left:0}:t=n.getBoundingClientRect(),r.top<t.bottom&&r.bottom>t.top&&r.right>t.left&&r.left<t.right};function ee(e){return/\w.(png|jpg|jpeg|svg|webp|gif|bmp)$/i.test(e)}const ne=e=>e==null,te=e=>{if(!e||!e.startsWith("http"))return!1;try{return!!new URL(e)}catch{return!1}},re=(...e)=>{const n={},r=e.length;let t,i=0;for(;i<r;i+=1)for(t in e[i])e[i].hasOwnProperty(t)&&(typeof n[t]=="object"&&typeof e[i][t]=="object"&&n[t]!==void 0&&n[t]!==null&&!Array.isArray(n[t])&&!Array.isArray(e[i][t])?n[t]={...n[t],...e[i][t]}:n[t]=e[i][t]);return n};let B=0;const C=(e=21)=>{if(typeof window>"u"||!window.crypto)return(B+=1).toFixed(0);let n="";const r=crypto.getRandomValues(new Uint8Array(e));for(;e--;){const t=63&r[e];n+=t<36?t.toString(36):t<62?(t-26).toString(36).toUpperCase():t<63?"_":"-"}return n},ie=()=>typeof window>"u"?C():window.crypto&&window.crypto.randomUUID&&typeof crypto.randomUUID=="function"?crypto.randomUUID():C();function U(e,n){if(typeof n!="string"&&!Array.isArray(n))return;const r=Array.isArray(n)?n:n.split(":");let t=e;for(let i=0;i<r.length;i++)if(t&&t.hasOwnProperty(r[i]))t=t[r[i]];else return;return t}const oe=Object.prototype.toString;function R(e,n){return oe.call(e)===`[object ${n}]`}function P(e){return R(e,"Boolean")}function ue(e){return typeof e=="number"}function b(e){return typeof Array.isArray>"u"?Object.prototype.toString.call(e)==="[object Array]":Array.isArray(e)}function m(e){return e!==null&&R(e,"Object")}function N(e){return typeof e=="string"||e instanceof String}function ce(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function x(...e){const n=[];for(let r=0;r<e.length;r++){const t=e[r];if(t){if(N(t))n.push(t);else if(b(t))for(let i=0;i<t.length;i++){const o=x(t[i]);o&&n.push(o)}else if(m(t))for(const i in t)t[i]&&n.push(i)}}return n.filter(r=>r).join(" ")}let M=e=>setTimeout(e,16),V=e=>clearTimeout(e);typeof window<"u"&&"requestAnimationFrame"in window&&(M=e=>window.requestAnimationFrame(e),V=e=>window.cancelAnimationFrame(e));let $=0;const E=new Map;function z(e){E.delete(e)}function F(e,n=1){$+=1;const r=$;function t(i){if(i===0)z(r),e();else{const o=M(()=>{t(i-1)});E.set(r,o)}}return t(n),r}F.cancel=e=>{const n=E.get(e);return z(n),V(n)};function T(e){return e!=null&&e===e.window}function W(e,n){var i;if(typeof window>"u")return 0;const r=n?"scrollTop":"scrollLeft";let t=0;return T(e)?t=e[n?"pageYOffset":"pageXOffset"]:e instanceof Document?t=e.documentElement[r]:e&&(t=e[r]),e&&!T(e)&&typeof t!="number"&&(t=(i=(e.ownerDocument||e).documentElement)==null?void 0:i[r]),t}function fe(e,n,r,t){const i=r-n;return e/=t/2,e<1?i/2*e*e*e+n:i/2*((e-=2)*e*e+2)+n}function le(e,n={}){const{getContainer:r=()=>window,callback:t,duration:i=450}=n,o=r(),c=W(o,!0),f=Date.now(),l=()=>{const a=Date.now()-f,d=fe(a>i?i:a,c,e,i);T(o)?o.scrollTo(window.pageXOffset,d):o instanceof HTMLDocument||o.constructor.name==="HTMLDocument"?o.documentElement.scrollTop=d:o.scrollTop=d,a<i?F(l):typeof t=="function"&&t()};F(l)}function ae(e){let n;const r=i=>()=>{n=null,e(...i)},t=(...i)=>{n==null&&(n=requestAnimationFrame(r(i)))};return t.cancel=()=>cancelAnimationFrame(n),t}const p={videoAllowType:["mp4","webm","ogg"],audioAllowType:["mp3"],imageType:["bmp","png","gif","jpg","jpeg","psd","tif"],videoType:["mp4","swf","rmvb","avi","flv","mpg","rm","mov","asf","3gp","mkv","ts","f4v","webm","m4v","3g2","m3u8"],audioType:["mp3","mpeg","aac","wav","wma","mp2","flac","midi","ra","ape","aac","cda"]};function y(e,n,r,t){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;let i,o,c;if(Array.isArray(e)){if(i=e.length,i!=n.length)return!1;for(o=i;o--!==0;)if(!y(e[o],n[o],r,t))return!1;return!0}if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(o of e.entries())if(!n.has(o[0]))return!1;for(o of e.entries())if(!y(o[1],n.get(o[0]),r,t))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(o of e.entries())if(!n.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(n)){if(i=e.length,i!=n.length)return!1;for(o=i;o--!==0;)if(e[o]!==n[o])return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf&&e.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString&&e.toString)return e.toString()===n.toString();if(c=Object.keys(e),i=c.length,i!==Object.keys(n).length)return!1;for(o=i;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,c[o]))return!1;for(o=i;o--!==0;){const f=c[o];if(!(r!=null&&r.includes(f))&&!(f==="_owner"&&e.$$typeof)&&!y(e[f],n[f],r,t))return t&&console.log(f),!1}return!0}return e!==e&&n!==n}const se=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,de=()=>process.env.NODE_ENV==="TEST"?!0:typeof window<"u"&&typeof window.document<"u"&&typeof window.matchMedia<"u"&&!se,ge=e=>{if(e&&e!==!0)return e},me=e=>{const n={};if(Object.keys(e||{}).forEach(r=>{e[r]!==void 0&&(n[r]=e[r])}),!(Object.keys(n).length<1))return n},pe=e=>{const n={};return Object.keys(e||{}).forEach(r=>{var t;Array.isArray(e[r])&&((t=e[r])==null?void 0:t.length)===0||e[r]!==void 0&&(n[r]=e[r])}),n};function I(e){var n;if(!(typeof e!="string"&&!Array.isArray(e)))return Array.isArray(e)?e[e.length-1]:(n=e.split(":"))==null?void 0:n.slice(-1)[0]}function q(e){return e&&(e.type===s.Comment||e.type===s.Fragment&&e.children.length===0||e.type===Text&&e.children.trim()==="")}function we(e,n){var r;return j((r=e[n])==null?void 0:r.call(e))}function j(e=[]){const n=[];return e.forEach(r=>{Array.isArray(r)?n.push(...r):(r==null?void 0:r.type)===s.Fragment?n.push(...j(r.children)):n.push(r)}),n.filter(r=>!q(r))}function ye(e,...n){return typeof e=="function"?e==null?void 0:e(...n):e}function he(e,n,r="default"){const t=I(r);if(t){const i=U(n,r);return i===!1?!1:i===!0?(e==null?void 0:e[t])||i:i||(e==null?void 0:e[t])}}function H(e,n,r="default"){var i,o;const t=I(r);if(t){const c=U(n,r);return c===!1?!1:c===!0?((i=e==null?void 0:e[t])==null?void 0:i.call(e))||c:c||((o=e[t])==null?void 0:o.call(e))}}function ve(e,n,r){const t={};return e.forEach(i=>{const o=I(i);if(o){const c=H(n,r,i);(P(c)||c)&&(t[o]=c)}}),t}const Se=({suffixCls:e,customizePrefixCls:n,isPor:r,className:t})=>{const i=t||(r?"gx-pro":"gx");return n||(e?`${i}-${e}`:i)},Ae=(e,n)=>e?Array.isArray(e)?e.join("-"):e.toString():`${n}`;function Oe(e,{align:n,showIndex:r}){const t=h(e);if(r&&e.length&&e.every(i=>i.dataIndex!=="sortIndex")){const i=e[0];t.unshift({title:"序号",align:n,fixed:i.fixed,width:60,uuid:_().uuid(15),dataIndex:"sortIndex",key:"sortIndex"})}else t.filter(i=>i.dataIndex!=="sortIndex");return t}function Ue(e,...n){return typeof e=="function"?e(...n):e}function h(e){return JSON.parse(JSON.stringify(e))}function Re(e,n){if(m(e)){const{pageSize:r=10,total:t=0}=e;let{current:i=1}=e;return t-n<=r*(i-1)&&(i=i-1),i===0?1:i}return 1}function be(e=[],n,r="children"){function t(i,o){return o.map((c,f)=>{const l=`${i}-${f+1}`;return c[r]&&(c[r]=t(l,c[r])),c.sortIndex=l,c})}return h(e).map((i,o)=>{let c=o;const f=m(n)&&n.current||1,l=m(n)&&n.pageSize||10;return c=f?(f-1)*l+(o+1):o+1,i[r]&&(i[r]=t(`${c}`,i[r])),i.sortIndex=c,i})}function Ee(e,n,r,t){const i=e[r],o=n[r];let c=0;return i<o?c=t===0?-1:0:i>o&&(c=t===0?0:-1),c}function Fe(e){let n=h(e);const r=new Set(n);return n=Array.from(r),n}function Te(e,n){const r=["null","undefined"];let t=!0;return e===0?t=!0:r.includes(e)?t=!1:e||(t=!1),t?{value:e,success:t}:{value:n===""?n:n||"-",success:t}}function Ie(e){let n="";if(e>-1){const r=Math.floor(e/3600),t=Math.floor(e/60)%60,i=Number.parseInt(String(e%60));r<10?n="0"+r+":":n=r+":",t<10&&(n+="0"),n+=t+":",i<10&&(n+="0"),n+=i}return n.split(":")[0]==="00"?`${n.split(":")[1]}:${n.split(":")[2]}`:n}function _(){const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");return{uuid(n,r){const t=e,i=[],o=r||t.length;let c,f;if(n)for(c=0;c<n;c+=1)i[c]=t[Number.parseInt(String(Math.random()*o))];else for(i[8]="-",i[13]="-",i[18]="-",i[23]="-",i[14]="4",c=0;c<36;c+=1)i[c]||(f=Math.random()*16,i[c]=t[c===19?f&&3||8:f]);return i.join("")},uuidFast(){const n=e,r=Array.from({length:36});let t=0,i,o;for(o=0;o<36;o+=1)o===8||o===13||o===18||o===23?r[o]="-":o===14?r[o]="4":(t<=2&&(t=33554432+Math.random()*16777216||0),i=t&&15,t=t>4,r[o]=n[o===19?i&&3||8:i]);return r.join("")},uuidString(){return this.uuidFast().replace(new RegExp("-","g"),"")},uuidCompact(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,n=>{const r=Math.random()*16||0;return(n==="x"?r:r&&3||8).toString(16)})}}}function je(e=[]){let n=0;function r(t=[],i){t.forEach(o=>{o.floor=i,i>n&&(n=i),o.children&&o.children.length>0&&r(o.children,i+1)})}return r(e,1),n}function J(e,n="children"){let r=[];return e.forEach(t=>{r.push(t),b(t[n])&&t[n].length>0&&(r=r.concat(J(t[n])))}),r}function De(e,n,r,t,i){n=n||"id",r=r||"parentId",t=t||"children",i=i||0;const o=JSON.parse(JSON.stringify(e));return o.filter(c=>{const f=o.filter(l=>c[n]===l[r||"parentId"]);return f.length>0?c[t||"children"]=f:delete c[t||"children"],c[r||"parentId"]===i})}function Le(e){return URL.createObjectURL(e)}function Be(e){return new Promise((n,r)=>{const t=new FileReader;t.readAsDataURL(e),t.onload=()=>n(t.result),t.onerror=i=>r(i)})}function Ce(e){const n=e.split(","),r=n[0].match(/:(.*?);/)[1],t=atob(n[1]);let i=t.length;const o=new Uint8Array(i);for(;i--;)o[i]=t.charCodeAt(i);return new Blob([o],{type:r})}function Pe(e,n){const r=e.split(","),t=r[0].match(/:(.*?);/)[1],i=atob(r[1]);let o=i.length;const c=new Uint8Array(o);for(;o--;)c[o]=i.charCodeAt(o);return new File([c],n,{type:t})}function Ne(e,n,r){return new window.File([e],n,{type:r})}function X(e=""){const n=e.indexOf("?");return n>0?`${e.substring(0,n)}`:e}function v(e=""){e=X(e);const n=e.lastIndexOf(".");return n>0?`${e.substring(n).split("?")[0]}`.split(".")[1]:""}function w(e,n){if(n)return n;if(!e||e==="data:")return"4";let r="4";return S(e)?e.includes("data:image/")?r="png":e.includes("data:video/")?r="mp4":e.includes("data:audio/")&&(r="mp3"):e instanceof Blob?(e=String(e),e.includes("image")?r="png":e.includes("video")?r="mp4":e.includes("audio")&&(r="mp3")):r=v(e).toLowerCase(),p.imageType.includes(r)?"1":p.videoType.includes(r)?"3":p.audioType.includes(r)?"2":"4"}function Y(e){const{url:n="",fileType:r="1"}=e;let t="";return n instanceof File?t=URL.createObjectURL(n):S(n)?t=n:n instanceof Blob?t=URL.createObjectURL(n):(n.includes("https")||n.includes("http"))&&(t=n),new Promise(i=>{let o;r==="1"?(o=document.createElement("img"),o.src=t):r==="2"?(o=document.createElement("audio"),o.src=t):r==="3"&&(o=document.createElement("video"),o.src=t),r==="1"?o.onload=function(){i({play:!0,width:o.width||0,height:o.height||0}),o=null}:o.oncanplay=function(){i({play:!0,duration:o.duration,width:(o==null?void 0:o.videoWidth)||0,height:(o==null?void 0:o.videoHeight)||0}),o=null},o.onerror=function(){i({play:!1}),o=null}})}async function xe(e){const{url:n="",currentTime:r,videoSuffix:t="",vidoeAllowPlay:i=!1}=e;let o="",c=t,f="1",l;return n instanceof File?(o=URL.createObjectURL(n),c=v(n.name),f=w(n.name)):n instanceof Blob?(o=URL.createObjectURL(n),f=w(n)):S(n)?(o=n,f=w(n)):(n.includes("https")||n.includes("http"))&&(o=n,c=v(n),f=w(n)),(c?p.videoAllowType.includes(c.toLowerCase()):!1)?i?D(o,r):(l=await Y({url:o,fileType:f}),l.play?D(o,r):new Promise(a=>{a("")})):new Promise(a=>{a("")})}async function D(e,n=0){return new Promise(r=>{let t=document.createElement("video");t.controls=!0,t.muted=!0,t.setAttribute("src",e),t.setAttribute("muted",String(!0)),t.setAttribute("crossorigin","anonymous"),t.setAttribute("autoplay",String(!0)),t&&t.addEventListener("loadeddata",async function(){let i;t==null||t.addEventListener("seeked",async function(){i&&i()});const o=(t==null?void 0:t.duration)||0;for(;n<o;){t&&(t.currentTime=n),await new Promise(ze=>i=ze);const c=document.createElement("canvas"),f=.8,l=c.getContext("2d"),A=(t==null?void 0:t.videoWidth)||0*f,a=(t==null?void 0:t.videoHeight)||0*f,d=0;c.width=(t==null?void 0:t.videoWidth)||0*f,c.height=(t==null?void 0:t.videoHeight)||0*f,l.drawImage(t,0,0,A+d,a+d),t=null,r(A===0||a===0?"":c.toDataURL("image/png",1))}})})}function S(e=""){return!!(e&&["data:image/","data:video/","data:audio/"].find(r=>e.includes(r)))}function Me(e,n,r,t=!1){e&&n&&r&&e.addEventListener(n,r,t)}function Ve(e,n,r,t=!1){e&&n&&r&&e.removeEventListener(n,r,t)}function $e(){return/windows|win32/i.test(navigator.userAgent)}u.arrayRepeat=Fe,u.blobToDataURL=Ne,u.checkFileType=w,u.classNames=x,u.compareArray=Ee,u.dataURLtoBlob=Ce,u.dataURLtoFile=Pe,u.deepCopy=h,u.filterEmpty=j,u.formatDuraton=Ie,u.genColumnKey=Ae,u.generateVidoePicture=D,u.getBase64=Be,u.getBlobUrl=Le,u.getFileSuffix=v,u.getLevelData=J,u.getMaxFloor=je,u.getMediaInfos=Y,u.getPrefixCls=Se,u.getRandomNumber=_,u.getScroll=W,u.getScrollContainer=k,u.getSlot=he,u.getSlotVNode=H,u.getSlotsChildren=we,u.getSlotsProps=ve,u.getSortIndex=be,u.getValueFromObjectByKey=U,u.getVideoCoverPicture=xe,u.getVideoFileUrl=X,u.globalConfig=p,u.handleCurrentPage=Re,u.handleShowIndex=Oe,u.hanndleField=Te,u.is=R,u.isArray=b,u.isBase64=S,u.isBoolean=P,u.isBrowser=de,u.isDeepEqualReact=y,u.isEmptyElement=q,u.isFunction=ce,u.isImg=ee,u.isInContainer=K,u.isNil=ne,u.isNumber=ue,u.isObject=m,u.isScroll=L,u.isServer=g,u.isString=N,u.isUrl=te,u.isWindowsOs=$e,u.merge=re,u.nanoid=ie,u.off=Ve,u.omitBoolean=ge,u.omitUndefined=me,u.omitUndefinedAndEmptyArr=pe,u.on=Me,u.runFunction=Ue,u.scrollTo=le,u.slotRender=ye,u.throttleByAnimationFrame=ae,u.treeData=De,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
|
|
5
|
+
**/process.env.NODE_ENV!=="production"&&Object.freeze({}),process.env.NODE_ENV!=="production"&&Object.freeze([]);const Q=e=>{const n=Object.create(null);return r=>n[r]||(n[r]=e(r))},Z=/-(\w)/g,k=Q(e=>e.replace(Z,(n,r)=>r?r.toUpperCase():"")),O=function(e,n){var r;if(p||!e||!n)return"";n=k(n),n==="float"&&(n="cssFloat");try{const t=e.style[n];if(t)return t;const i=(r=document==null?void 0:document.defaultView)==null?void 0:r.getComputedStyle(e,"");return i?i[n]:""}catch{return e.style[n]}},B=(e,n)=>p?void 0:(n==null?O(e,"overflow"):n?O(e,"overflow-y"):O(e,"overflow-x")).match(/(scroll|auto|overlay)/),K=(e,n)=>{if(p)return;let r=e;for(;r;){if([window,document,document.documentElement].includes(r))return window;if(B(r,n))return r;r=r.parentNode}return r},ee=(e,n)=>{if(p||!e||!n)return!1;const r=e.getBoundingClientRect();let t;return[window,document,document.documentElement,null,void 0].includes(n)?t={top:0,right:window.innerWidth,bottom:window.innerHeight,left:0}:t=n.getBoundingClientRect(),r.top<t.bottom&&r.bottom>t.top&&r.right>t.left&&r.left<t.right};function ne(e){return/\w.(png|jpg|jpeg|svg|webp|gif|bmp)$/i.test(e)}const te=e=>e==null,re=e=>{if(!e||!e.startsWith("http"))return!1;try{return!!new URL(e)}catch{return!1}},ie=(...e)=>{const n={},r=e.length;let t,i=0;for(;i<r;i+=1)for(t in e[i])e[i].hasOwnProperty(t)&&(typeof n[t]=="object"&&typeof e[i][t]=="object"&&n[t]!==void 0&&n[t]!==null&&!Array.isArray(n[t])&&!Array.isArray(e[i][t])?n[t]={...n[t],...e[i][t]}:n[t]=e[i][t]);return n};let C=0;const N=(e=21)=>{if(typeof window>"u"||!window.crypto)return(C+=1).toFixed(0);let n="";const r=crypto.getRandomValues(new Uint8Array(e));for(;e--;){const t=63&r[e];n+=t<36?t.toString(36):t<62?(t-26).toString(36).toUpperCase():t<63?"_":"-"}return n},oe=()=>typeof window>"u"?N():window.crypto&&window.crypto.randomUUID&&typeof crypto.randomUUID=="function"?crypto.randomUUID():N();function U(e,n){if(typeof n!="string"&&!Array.isArray(n))return;const r=Array.isArray(n)?n:n.split(":");let t=e;for(let i=0;i<r.length;i++)if(t&&t.hasOwnProperty(r[i]))t=t[r[i]];else return;return t}const ue=Object.prototype.toString;function R(e,n){return ue.call(e)===`[object ${n}]`}function P(e){return R(e,"Boolean")}function ce(e){return typeof e=="number"}function b(e){return typeof Array.isArray>"u"?Object.prototype.toString.call(e)==="[object Array]":Array.isArray(e)}function g(e){return e!==null&&R(e,"Object")}function V(e){return typeof e=="string"||e instanceof String}function fe(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function x(...e){const n=[];for(let r=0;r<e.length;r++){const t=e[r];if(t){if(V(t))n.push(t);else if(b(t))for(let i=0;i<t.length;i++){const o=x(t[i]);o&&n.push(o)}else if(g(t))for(const i in t)t[i]&&n.push(i)}}return n.filter(r=>r).join(" ")}let M=e=>setTimeout(e,16),$=e=>clearTimeout(e);typeof window<"u"&&"requestAnimationFrame"in window&&(M=e=>window.requestAnimationFrame(e),$=e=>window.cancelAnimationFrame(e));let z=0;const E=new Map;function W(e){E.delete(e)}function F(e,n=1){z+=1;const r=z;function t(i){if(i===0)W(r),e();else{const o=M(()=>{t(i-1)});E.set(r,o)}}return t(n),r}F.cancel=e=>{const n=E.get(e);return W(n),$(n)};function T(e){return e!=null&&e===e.window}function q(e,n){var i;if(typeof window>"u")return 0;const r=n?"scrollTop":"scrollLeft";let t=0;return T(e)?t=e[n?"pageYOffset":"pageXOffset"]:e instanceof Document?t=e.documentElement[r]:e&&(t=e[r]),e&&!T(e)&&typeof t!="number"&&(t=(i=(e.ownerDocument||e).documentElement)==null?void 0:i[r]),t}function ae(e,n,r,t){const i=r-n;return e/=t/2,e<1?i/2*e*e*e+n:i/2*((e-=2)*e*e+2)+n}function le(e,n={}){const{getContainer:r=()=>window,callback:t,duration:i=450}=n,o=r(),c=q(o,!0),f=Date.now(),a=()=>{const d=Date.now()-f,m=ae(d>i?i:d,c,e,i);T(o)?o.scrollTo(window.pageXOffset,m):o instanceof HTMLDocument||o.constructor.name==="HTMLDocument"?o.documentElement.scrollTop=m:o.scrollTop=m,d<i?F(a):typeof t=="function"&&t()};F(a)}function se(e){let n;const r=i=>()=>{n=null,e(...i)},t=(...i)=>{n==null&&(n=requestAnimationFrame(r(i)))};return t.cancel=()=>cancelAnimationFrame(n),t}const w={videoAllowType:["mp4","webm","ogg"],audioAllowType:["mp3"],imageType:["bmp","png","gif","jpg","jpeg","psd","tif"],videoType:["mp4","swf","rmvb","avi","flv","mpg","rm","mov","asf","3gp","mkv","ts","f4v","webm","m4v","3g2","m3u8"],audioType:["mp3","mpeg","aac","wav","wma","mp2","flac","midi","ra","ape","aac","cda"]};function h(e,n,r,t){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;let i,o,c;if(Array.isArray(e)){if(i=e.length,i!=n.length)return!1;for(o=i;o--!==0;)if(!h(e[o],n[o],r,t))return!1;return!0}if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(o of e.entries())if(!n.has(o[0]))return!1;for(o of e.entries())if(!h(o[1],n.get(o[0]),r,t))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(o of e.entries())if(!n.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(n)){if(i=e.length,i!=n.length)return!1;for(o=i;o--!==0;)if(e[o]!==n[o])return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf&&e.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString&&e.toString)return e.toString()===n.toString();if(c=Object.keys(e),i=c.length,i!==Object.keys(n).length)return!1;for(o=i;o--!==0;)if(!Object.prototype.hasOwnProperty.call(n,c[o]))return!1;for(o=i;o--!==0;){const f=c[o];if(!(r!=null&&r.includes(f))&&!(f==="_owner"&&e.$$typeof)&&!h(e[f],n[f],r,t))return t&&console.log(f),!1}return!0}return e!==e&&n!==n}const de=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,ge=()=>process.env.NODE_ENV==="TEST"?!0:typeof window<"u"&&typeof window.document<"u"&&typeof window.matchMedia<"u"&&!de,me=e=>{if(e&&e!==!0)return e},pe=e=>{const n={};if(Object.keys(e||{}).forEach(r=>{e[r]!==void 0&&(n[r]=e[r])}),!(Object.keys(n).length<1))return n},we=e=>{const n={};return Object.keys(e||{}).forEach(r=>{var t;Array.isArray(e[r])&&((t=e[r])==null?void 0:t.length)===0||e[r]!==void 0&&(n[r]=e[r])}),n};function I(e){var n;if(!(typeof e!="string"&&!Array.isArray(e)))return Array.isArray(e)?e[e.length-1]:(n=e.split(":"))==null?void 0:n.slice(-1)[0]}function H(e){return e&&(e.type===l.Comment||e.type===l.Fragment&&e.children.length===0||e.type===Text&&e.children.trim()==="")}function ye(e,n){var r;return j((r=e[n])==null?void 0:r.call(e))}function j(e=[]){const n=[];return e.forEach(r=>{Array.isArray(r)?n.push(...r):(r==null?void 0:r.type)===l.Fragment?n.push(...j(r.children)):n.push(r)}),n.filter(r=>!H(r))}function D(e,...n){return typeof e=="function"?e==null?void 0:e(...n):e}function he(e,n,r="default",t){const i=I(r);if(i){let o;const c=U(n,r);return c===!1?o=!1:c===!0?o=e==null?void 0:e[i]:g(c)?l.isVNode(c)?o=c:o=e==null?void 0:e[i]:o=c||(e==null?void 0:e[i]),l.isVNode(o)?o:t?D(o):o}}function _(e,n,r="default",t){var o,c,f;const i=I(r);if(i){let a;const s=U(n,r);return s===!1?a=!1:s===!0?a=(o=e==null?void 0:e[i])==null?void 0:o.call(e,t):g(s)?l.isVNode(s)?a=s:a=(c=e==null?void 0:e[i])==null?void 0:c.call(e,t):a=s||((f=e==null?void 0:e[i])==null?void 0:f.call(e,t)),l.isVNode(a)?a:D(a,t)}}function Se(e,n,r){const t={};return e.forEach(i=>{const o=I(i);if(o){const c=_(n,r,i);(P(c)||c)&&(t[o]=c)}}),t}const ve=({suffixCls:e,customizePrefixCls:n,isPor:r,className:t})=>{const i=t||(r?"gx-pro":"gx");return n||(e?`${i}-${e}`:i)},Ae=(e,n)=>e?Array.isArray(e)?e.join("-"):e.toString():`${n}`;function Oe(e,{align:n,showIndex:r}){const t=S(e);if(r&&e.length&&e.every(i=>i.dataIndex!=="sortIndex")){const i=e[0];t.unshift({title:"序号",align:n,fixed:i.fixed,width:60,uuid:J().uuid(15),dataIndex:"sortIndex",key:"sortIndex"})}else t.filter(i=>i.dataIndex!=="sortIndex");return t}function Ue(e,...n){return typeof e=="function"?e(...n):e}function S(e){return JSON.parse(JSON.stringify(e))}function Re(e,n){if(g(e)){const{pageSize:r=10,total:t=0}=e;let{current:i=1}=e;return t-n<=r*(i-1)&&(i=i-1),i===0?1:i}return 1}function be(e=[],n,r="children"){function t(i,o){return o.map((c,f)=>{const a=`${i}-${f+1}`;return c[r]&&(c[r]=t(a,c[r])),c.sortIndex=a,c})}return S(e).map((i,o)=>{let c=o;const f=g(n)&&n.current||1,a=g(n)&&n.pageSize||10;return c=f?(f-1)*a+(o+1):o+1,i[r]&&(i[r]=t(`${c}`,i[r])),i.sortIndex=c,i})}function Ee(e,n,r,t){const i=e[r],o=n[r];let c=0;return i<o?c=t===0?-1:0:i>o&&(c=t===0?0:-1),c}function Fe(e){let n=S(e);const r=new Set(n);return n=Array.from(r),n}function Te(e,n){const r=["null","undefined"];let t=!0;return e===0?t=!0:r.includes(e)?t=!1:e||(t=!1),t?{value:e,success:t}:{value:n===""?n:n||"-",success:t}}function Ie(e){let n="";if(e>-1){const r=Math.floor(e/3600),t=Math.floor(e/60)%60,i=Number.parseInt(String(e%60));r<10?n="0"+r+":":n=r+":",t<10&&(n+="0"),n+=t+":",i<10&&(n+="0"),n+=i}return n.split(":")[0]==="00"?`${n.split(":")[1]}:${n.split(":")[2]}`:n}function J(){const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");return{uuid(n,r){const t=e,i=[],o=r||t.length;let c,f;if(n)for(c=0;c<n;c+=1)i[c]=t[Number.parseInt(String(Math.random()*o))];else for(i[8]="-",i[13]="-",i[18]="-",i[23]="-",i[14]="4",c=0;c<36;c+=1)i[c]||(f=Math.random()*16,i[c]=t[c===19?f&&3||8:f]);return i.join("")},uuidFast(){const n=e,r=Array.from({length:36});let t=0,i,o;for(o=0;o<36;o+=1)o===8||o===13||o===18||o===23?r[o]="-":o===14?r[o]="4":(t<=2&&(t=33554432+Math.random()*16777216||0),i=t&&15,t=t>4,r[o]=n[o===19?i&&3||8:i]);return r.join("")},uuidString(){return this.uuidFast().replace(new RegExp("-","g"),"")},uuidCompact(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,n=>{const r=Math.random()*16||0;return(n==="x"?r:r&&3||8).toString(16)})}}}function je(e=[]){let n=0;function r(t=[],i){t.forEach(o=>{o.floor=i,i>n&&(n=i),o.children&&o.children.length>0&&r(o.children,i+1)})}return r(e,1),n}function X(e,n="children"){let r=[];return e.forEach(t=>{r.push(t),b(t[n])&&t[n].length>0&&(r=r.concat(X(t[n])))}),r}function De(e,n,r,t,i){n=n||"id",r=r||"parentId",t=t||"children",i=i||0;const o=JSON.parse(JSON.stringify(e));return o.filter(c=>{const f=o.filter(a=>c[n]===a[r||"parentId"]);return f.length>0?c[t||"children"]=f:delete c[t||"children"],c[r||"parentId"]===i})}function Le(e){return URL.createObjectURL(e)}function Be(e){return new Promise((n,r)=>{const t=new FileReader;t.readAsDataURL(e),t.onload=()=>n(t.result),t.onerror=i=>r(i)})}function Ce(e){const n=e.split(","),r=n[0].match(/:(.*?);/)[1],t=atob(n[1]);let i=t.length;const o=new Uint8Array(i);for(;i--;)o[i]=t.charCodeAt(i);return new Blob([o],{type:r})}function Ne(e,n){const r=e.split(","),t=r[0].match(/:(.*?);/)[1],i=atob(r[1]);let o=i.length;const c=new Uint8Array(o);for(;o--;)c[o]=i.charCodeAt(o);return new File([c],n,{type:t})}function Pe(e,n,r){return new window.File([e],n,{type:r})}function Y(e=""){const n=e.indexOf("?");return n>0?`${e.substring(0,n)}`:e}function v(e=""){e=Y(e);const n=e.lastIndexOf(".");return n>0?`${e.substring(n).split("?")[0]}`.split(".")[1]:""}function y(e,n){if(n)return n;if(!e||e==="data:")return"4";let r="4";return A(e)?e.includes("data:image/")?r="png":e.includes("data:video/")?r="mp4":e.includes("data:audio/")&&(r="mp3"):e instanceof Blob?(e=String(e),e.includes("image")?r="png":e.includes("video")?r="mp4":e.includes("audio")&&(r="mp3")):r=v(e).toLowerCase(),w.imageType.includes(r)?"1":w.videoType.includes(r)?"3":w.audioType.includes(r)?"2":"4"}function G(e){const{url:n="",fileType:r="1"}=e;let t="";return n instanceof File?t=URL.createObjectURL(n):A(n)?t=n:n instanceof Blob?t=URL.createObjectURL(n):(n.includes("https")||n.includes("http"))&&(t=n),new Promise(i=>{let o;r==="1"?(o=document.createElement("img"),o.src=t):r==="2"?(o=document.createElement("audio"),o.src=t):r==="3"&&(o=document.createElement("video"),o.src=t),r==="1"?o.onload=function(){i({play:!0,width:o.width||0,height:o.height||0}),o=null}:o.oncanplay=function(){i({play:!0,duration:o.duration,width:(o==null?void 0:o.videoWidth)||0,height:(o==null?void 0:o.videoHeight)||0}),o=null},o.onerror=function(){i({play:!1}),o=null}})}async function Ve(e){const{url:n="",currentTime:r,videoSuffix:t="",vidoeAllowPlay:i=!1}=e;let o="",c=t,f="1",a;return n instanceof File?(o=URL.createObjectURL(n),c=v(n.name),f=y(n.name)):n instanceof Blob?(o=URL.createObjectURL(n),f=y(n)):A(n)?(o=n,f=y(n)):(n.includes("https")||n.includes("http"))&&(o=n,c=v(n),f=y(n)),(c?w.videoAllowType.includes(c.toLowerCase()):!1)?i?L(o,r):(a=await G({url:o,fileType:f}),a.play?L(o,r):new Promise(d=>{d("")})):new Promise(d=>{d("")})}async function L(e,n=0){return new Promise(r=>{let t=document.createElement("video");t.controls=!0,t.muted=!0,t.setAttribute("src",e),t.setAttribute("muted",String(!0)),t.setAttribute("crossorigin","anonymous"),t.setAttribute("autoplay",String(!0)),t&&t.addEventListener("loadeddata",async function(){let i;t==null||t.addEventListener("seeked",async function(){i&&i()});const o=(t==null?void 0:t.duration)||0;for(;n<o;){t&&(t.currentTime=n),await new Promise(ze=>i=ze);const c=document.createElement("canvas"),f=.8,a=c.getContext("2d"),s=(t==null?void 0:t.videoWidth)||0*f,d=(t==null?void 0:t.videoHeight)||0*f,m=0;c.width=(t==null?void 0:t.videoWidth)||0*f,c.height=(t==null?void 0:t.videoHeight)||0*f,a.drawImage(t,0,0,s+m,d+m),t=null,r(s===0||d===0?"":c.toDataURL("image/png",1))}})})}function A(e=""){return!!(e&&["data:image/","data:video/","data:audio/"].find(r=>e.includes(r)))}function xe(e,n,r,t=!1){e&&n&&r&&e.addEventListener(n,r,t)}function Me(e,n,r,t=!1){e&&n&&r&&e.removeEventListener(n,r,t)}function $e(){return/windows|win32/i.test(navigator.userAgent)}u.arrayRepeat=Fe,u.blobToDataURL=Pe,u.checkFileType=y,u.classNames=x,u.compareArray=Ee,u.dataURLtoBlob=Ce,u.dataURLtoFile=Ne,u.deepCopy=S,u.filterEmpty=j,u.formatDuraton=Ie,u.genColumnKey=Ae,u.generateVidoePicture=L,u.getBase64=Be,u.getBlobUrl=Le,u.getFileSuffix=v,u.getLevelData=X,u.getMaxFloor=je,u.getMediaInfos=G,u.getPrefixCls=ve,u.getRandomNumber=J,u.getScroll=q,u.getScrollContainer=K,u.getSlot=he,u.getSlotVNode=_,u.getSlotsChildren=ye,u.getSlotsProps=Se,u.getSortIndex=be,u.getValueFromObjectByKey=U,u.getVideoCoverPicture=Ve,u.getVideoFileUrl=Y,u.globalConfig=w,u.handleCurrentPage=Re,u.handleShowIndex=Oe,u.hanndleField=Te,u.is=R,u.isArray=b,u.isBase64=A,u.isBoolean=P,u.isBrowser=ge,u.isDeepEqualReact=h,u.isEmptyElement=H,u.isFunction=fe,u.isImg=ne,u.isInContainer=ee,u.isNil=te,u.isNumber=ce,u.isObject=g,u.isScroll=B,u.isServer=p,u.isString=V,u.isUrl=re,u.isWindowsOs=$e,u.merge=ie,u.nanoid=oe,u.off=Me,u.omitBoolean=me,u.omitUndefined=pe,u.omitUndefinedAndEmptyArr=we,u.on=xe,u.runFunction=Ue,u.scrollTo=le,u.slotRender=D,u.throttleByAnimationFrame=se,u.treeData=De,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
|
package/dist/slots/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { VNode } from 'vue';
|
|
2
2
|
import type { CustomRender, WithFalse } from '../typings';
|
|
3
3
|
export declare function isEmptyElement(c: any): any;
|
|
4
|
-
export declare function getSlotsChildren<T extends Readonly<Record<string, any
|
|
4
|
+
export declare function getSlotsChildren<T extends Readonly<Record<string, any>>>(slots: T, key: keyof T): VNode[];
|
|
5
5
|
export declare function filterEmpty(children?: VNode[]): VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
6
6
|
[key: string]: any;
|
|
7
7
|
}>[];
|
|
@@ -10,14 +10,14 @@ export declare function slotRender(slot: any, ...arg: any): any;
|
|
|
10
10
|
* @Author gx12358
|
|
11
11
|
* @DateTime 2024/2/2
|
|
12
12
|
* @lastTime 2024/2/2
|
|
13
|
-
* @description () =>
|
|
13
|
+
* @description () => CustomRender
|
|
14
14
|
*/
|
|
15
|
-
export declare function getSlot<T,
|
|
15
|
+
export declare function getSlot<T = undefined, R extends boolean | undefined = undefined>(slots: Readonly<Record<string, any>>, props: Record<string, unknown>, keys?: string | string[], render?: R): R extends true ? VNode : (T extends undefined ? WithFalse<CustomRender> : T);
|
|
16
16
|
/**
|
|
17
17
|
* @Author gx12358
|
|
18
18
|
* @DateTime 2024/2/2
|
|
19
19
|
* @lastTime 2024/2/2
|
|
20
|
-
* @description () =>
|
|
20
|
+
* @description () => WithFalse<VNode | VNode[]>
|
|
21
21
|
*/
|
|
22
|
-
export declare function getSlotVNode<T
|
|
23
|
-
export declare function getSlotsProps<T extends string
|
|
22
|
+
export declare function getSlotVNode<T = undefined>(slots: Readonly<Record<string, any>>, props: Record<string, unknown>, keys?: string | string[]): T extends undefined ? WithFalse<VNode | VNode[]> : T;
|
|
23
|
+
export declare function getSlotsProps<T extends string>(names: string[], slots: Readonly<Record<string, any>>, props: Record<string, unknown>): Record<T, unknown>;
|