@gx-design-vue/pro-utils 0.2.0-beta.40 → 0.2.0-beta.42
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 +232 -232
- package/dist/pro-utils.umd.cjs +1 -1
- package/dist/slots/index.d.ts +2 -1
- package/dist/typings/index.d.ts +3 -10
- package/dist/utils/index.d.ts +3 -11
- package/package.json +1 -1
package/dist/pro-utils.js
CHANGED
|
@@ -8,52 +8,52 @@ const w = typeof window > "u";
|
|
|
8
8
|
process.env.NODE_ENV !== "production" && Object.freeze({});
|
|
9
9
|
process.env.NODE_ENV !== "production" && Object.freeze([]);
|
|
10
10
|
const H = (e) => {
|
|
11
|
-
const
|
|
12
|
-
return (r) =>
|
|
11
|
+
const n = /* @__PURE__ */ Object.create(null);
|
|
12
|
+
return (r) => n[r] || (n[r] = e(r));
|
|
13
13
|
}, W = /-(\w)/g, _ = H(
|
|
14
|
-
(e) => e.replace(W, (
|
|
15
|
-
), y = function(e,
|
|
14
|
+
(e) => e.replace(W, (n, r) => r ? r.toUpperCase() : "")
|
|
15
|
+
), y = function(e, n) {
|
|
16
16
|
var r;
|
|
17
|
-
if (w || !e || !
|
|
17
|
+
if (w || !e || !n)
|
|
18
18
|
return "";
|
|
19
|
-
|
|
19
|
+
n = _(n), n === "float" && (n = "cssFloat");
|
|
20
20
|
try {
|
|
21
|
-
const
|
|
22
|
-
if (
|
|
23
|
-
return
|
|
21
|
+
const t = e.style[n];
|
|
22
|
+
if (t)
|
|
23
|
+
return t;
|
|
24
24
|
const i = (r = document == null ? void 0 : document.defaultView) == null ? void 0 : r.getComputedStyle(e, "");
|
|
25
|
-
return i ? i[
|
|
25
|
+
return i ? i[n] : "";
|
|
26
26
|
} catch {
|
|
27
|
-
return e.style[
|
|
27
|
+
return e.style[n];
|
|
28
28
|
}
|
|
29
|
-
}, q = (e,
|
|
29
|
+
}, q = (e, n) => w ? void 0 : (n == null ? y(e, "overflow") : n ? y(e, "overflow-y") : y(e, "overflow-x")).match(/(scroll|auto|overlay)/), ue = (e, n) => {
|
|
30
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 (q(r,
|
|
36
|
+
if (q(r, n))
|
|
37
37
|
return r;
|
|
38
38
|
r = r.parentNode;
|
|
39
39
|
}
|
|
40
40
|
return r;
|
|
41
|
-
}, ce = (e,
|
|
42
|
-
if (w || !e || !
|
|
41
|
+
}, ce = (e, n) => {
|
|
42
|
+
if (w || !e || !n)
|
|
43
43
|
return !1;
|
|
44
44
|
const r = e.getBoundingClientRect();
|
|
45
|
-
let
|
|
46
|
-
return [window, document, document.documentElement, null, void 0].includes(
|
|
45
|
+
let t;
|
|
46
|
+
return [window, document, document.documentElement, null, void 0].includes(n) ? t = {
|
|
47
47
|
top: 0,
|
|
48
48
|
right: window.innerWidth,
|
|
49
49
|
bottom: window.innerHeight,
|
|
50
50
|
left: 0
|
|
51
|
-
} :
|
|
51
|
+
} : t = n.getBoundingClientRect(), r.top < t.bottom && r.bottom > t.top && r.right > t.left && r.left < t.right;
|
|
52
52
|
};
|
|
53
53
|
function fe(e) {
|
|
54
54
|
return /\w.(png|jpg|jpeg|svg|webp|gif|bmp)$/i.test(e);
|
|
55
55
|
}
|
|
56
|
-
const ae = (e) => e == null,
|
|
56
|
+
const ae = (e) => e == null, le = (e) => {
|
|
57
57
|
if (!e || !e.startsWith("http"))
|
|
58
58
|
return !1;
|
|
59
59
|
try {
|
|
@@ -61,44 +61,44 @@ const ae = (e) => e == null, se = (e) => {
|
|
|
61
61
|
} catch {
|
|
62
62
|
return !1;
|
|
63
63
|
}
|
|
64
|
-
},
|
|
65
|
-
const
|
|
66
|
-
let
|
|
64
|
+
}, se = (...e) => {
|
|
65
|
+
const n = {}, r = e.length;
|
|
66
|
+
let t, i = 0;
|
|
67
67
|
for (; i < r; i += 1)
|
|
68
|
-
for (
|
|
69
|
-
e[i].hasOwnProperty(
|
|
70
|
-
...t
|
|
71
|
-
...e[i][
|
|
72
|
-
} : t
|
|
73
|
-
return
|
|
68
|
+
for (t in e[i])
|
|
69
|
+
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] = {
|
|
70
|
+
...n[t],
|
|
71
|
+
...e[i][t]
|
|
72
|
+
} : n[t] = e[i][t]);
|
|
73
|
+
return n;
|
|
74
74
|
};
|
|
75
75
|
let R = 0;
|
|
76
76
|
const b = (e = 21) => {
|
|
77
77
|
if (typeof window > "u" || !window.crypto)
|
|
78
78
|
return (R += 1).toFixed(0);
|
|
79
|
-
let
|
|
79
|
+
let n = "";
|
|
80
80
|
const r = crypto.getRandomValues(new Uint8Array(e));
|
|
81
81
|
for (; e--; ) {
|
|
82
|
-
const
|
|
83
|
-
|
|
82
|
+
const t = 63 & r[e];
|
|
83
|
+
n += t < 36 ? t.toString(36) : t < 62 ? (t - 26).toString(36).toUpperCase() : t < 63 ? "_" : "-";
|
|
84
84
|
}
|
|
85
|
-
return
|
|
85
|
+
return n;
|
|
86
86
|
}, de = () => typeof window > "u" ? b() : window.crypto && window.crypto.randomUUID && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : b();
|
|
87
|
-
function F(e,
|
|
88
|
-
if (typeof
|
|
87
|
+
function F(e, n) {
|
|
88
|
+
if (typeof n != "string" && !Array.isArray(n))
|
|
89
89
|
return;
|
|
90
|
-
const r = Array.isArray(
|
|
91
|
-
let
|
|
90
|
+
const r = Array.isArray(n) ? n : n.split(":");
|
|
91
|
+
let t = e;
|
|
92
92
|
for (let i = 0; i < r.length; i++)
|
|
93
|
-
if (
|
|
94
|
-
|
|
93
|
+
if (t && t.hasOwnProperty(r[i]))
|
|
94
|
+
t = t[r[i]];
|
|
95
95
|
else
|
|
96
96
|
return;
|
|
97
|
-
return
|
|
97
|
+
return t;
|
|
98
98
|
}
|
|
99
99
|
const J = Object.prototype.toString;
|
|
100
|
-
function L(e,
|
|
101
|
-
return J.call(e) === `[object ${
|
|
100
|
+
function L(e, n) {
|
|
101
|
+
return J.call(e) === `[object ${n}]`;
|
|
102
102
|
}
|
|
103
103
|
function D(e) {
|
|
104
104
|
return L(e, "Boolean");
|
|
@@ -119,23 +119,23 @@ function ge(e) {
|
|
|
119
119
|
return typeof e == "function" || Object.prototype.toString.call(e) === "[object Function]";
|
|
120
120
|
}
|
|
121
121
|
function Y(...e) {
|
|
122
|
-
const
|
|
122
|
+
const n = [];
|
|
123
123
|
for (let r = 0; r < e.length; r++) {
|
|
124
|
-
const
|
|
125
|
-
if (
|
|
126
|
-
if (X(
|
|
127
|
-
|
|
128
|
-
else if (B(
|
|
129
|
-
for (let i = 0; i <
|
|
130
|
-
const o = Y(
|
|
131
|
-
o &&
|
|
124
|
+
const t = e[r];
|
|
125
|
+
if (t) {
|
|
126
|
+
if (X(t))
|
|
127
|
+
n.push(t);
|
|
128
|
+
else if (B(t))
|
|
129
|
+
for (let i = 0; i < t.length; i++) {
|
|
130
|
+
const o = Y(t[i]);
|
|
131
|
+
o && n.push(o);
|
|
132
132
|
}
|
|
133
|
-
else if (d(
|
|
134
|
-
for (const i in
|
|
135
|
-
|
|
133
|
+
else if (d(t))
|
|
134
|
+
for (const i in t)
|
|
135
|
+
t[i] && n.push(i);
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
|
-
return
|
|
138
|
+
return n.filter((r) => r).join(" ");
|
|
139
139
|
}
|
|
140
140
|
let C = (e) => setTimeout(e, 16), P = (e) => clearTimeout(e);
|
|
141
141
|
typeof window < "u" && "requestAnimationFrame" in window && (C = (e) => window.requestAnimationFrame(e), P = (e) => window.cancelAnimationFrame(e));
|
|
@@ -144,55 +144,55 @@ const S = /* @__PURE__ */ new Map();
|
|
|
144
144
|
function N(e) {
|
|
145
145
|
S.delete(e);
|
|
146
146
|
}
|
|
147
|
-
function x(e,
|
|
147
|
+
function x(e, n = 1) {
|
|
148
148
|
I += 1;
|
|
149
149
|
const r = I;
|
|
150
|
-
function
|
|
150
|
+
function t(i) {
|
|
151
151
|
if (i === 0)
|
|
152
152
|
N(r), e();
|
|
153
153
|
else {
|
|
154
154
|
const o = C(() => {
|
|
155
|
-
|
|
155
|
+
t(i - 1);
|
|
156
156
|
});
|
|
157
157
|
S.set(r, o);
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
|
-
return n
|
|
160
|
+
return t(n), r;
|
|
161
161
|
}
|
|
162
162
|
x.cancel = (e) => {
|
|
163
|
-
const
|
|
164
|
-
return N(
|
|
163
|
+
const n = S.get(e);
|
|
164
|
+
return N(n), P(n);
|
|
165
165
|
};
|
|
166
166
|
function v(e) {
|
|
167
167
|
return e != null && e === e.window;
|
|
168
168
|
}
|
|
169
|
-
function G(e,
|
|
169
|
+
function G(e, n) {
|
|
170
170
|
var i;
|
|
171
171
|
if (typeof window > "u")
|
|
172
172
|
return 0;
|
|
173
|
-
const r =
|
|
174
|
-
let
|
|
175
|
-
return v(e) ?
|
|
173
|
+
const r = n ? "scrollTop" : "scrollLeft";
|
|
174
|
+
let t = 0;
|
|
175
|
+
return v(e) ? t = e[n ? "pageYOffset" : "pageXOffset"] : e instanceof Document ? t = e.documentElement[r] : e && (t = e[r]), e && !v(e) && typeof t != "number" && (t = (i = (e.ownerDocument || e).documentElement) == null ? void 0 : i[r]), t;
|
|
176
176
|
}
|
|
177
|
-
function Q(e,
|
|
178
|
-
const i = r -
|
|
179
|
-
return e /=
|
|
177
|
+
function Q(e, n, r, t) {
|
|
178
|
+
const i = r - n;
|
|
179
|
+
return e /= t / 2, e < 1 ? i / 2 * e * e * e + n : i / 2 * ((e -= 2) * e * e + 2) + n;
|
|
180
180
|
}
|
|
181
|
-
function me(e,
|
|
182
|
-
const { getContainer: r = () => window, callback:
|
|
183
|
-
const
|
|
184
|
-
v(o) ? o.scrollTo(window.pageXOffset,
|
|
181
|
+
function me(e, n = {}) {
|
|
182
|
+
const { getContainer: r = () => window, callback: t, duration: i = 450 } = n, o = r(), u = G(o, !0), c = Date.now(), f = () => {
|
|
183
|
+
const l = Date.now() - c, s = Q(l > i ? i : l, u, e, i);
|
|
184
|
+
v(o) ? o.scrollTo(window.pageXOffset, s) : o instanceof HTMLDocument || o.constructor.name === "HTMLDocument" ? o.documentElement.scrollTop = s : o.scrollTop = s, l < i ? x(f) : typeof t == "function" && t();
|
|
185
185
|
};
|
|
186
186
|
x(f);
|
|
187
187
|
}
|
|
188
188
|
function we(e) {
|
|
189
|
-
let
|
|
189
|
+
let n;
|
|
190
190
|
const r = (i) => () => {
|
|
191
|
-
|
|
192
|
-
},
|
|
193
|
-
|
|
191
|
+
n = null, e(...i);
|
|
192
|
+
}, t = (...i) => {
|
|
193
|
+
n == null && (n = requestAnimationFrame(r(i)));
|
|
194
194
|
};
|
|
195
|
-
return
|
|
195
|
+
return t.cancel = () => cancelAnimationFrame(n), t;
|
|
196
196
|
}
|
|
197
197
|
const g = {
|
|
198
198
|
videoAllowType: [
|
|
@@ -223,315 +223,315 @@ const g = {
|
|
|
223
223
|
],
|
|
224
224
|
audioType: ["mp3", "mpeg", "aac", "wav", "wma", "mp2", "flac", "midi", "ra", "ape", "aac", "cda"]
|
|
225
225
|
};
|
|
226
|
-
function h(e,
|
|
227
|
-
if (e ===
|
|
226
|
+
function h(e, n, r, t) {
|
|
227
|
+
if (e === n)
|
|
228
228
|
return !0;
|
|
229
|
-
if (e &&
|
|
230
|
-
if (e.constructor !==
|
|
229
|
+
if (e && n && typeof e == "object" && typeof n == "object") {
|
|
230
|
+
if (e.constructor !== n.constructor)
|
|
231
231
|
return !1;
|
|
232
232
|
let i, o, u;
|
|
233
233
|
if (Array.isArray(e)) {
|
|
234
|
-
if (i = e.length, i !=
|
|
234
|
+
if (i = e.length, i != n.length)
|
|
235
235
|
return !1;
|
|
236
236
|
for (o = i; o-- !== 0; )
|
|
237
|
-
if (!h(e[o],
|
|
237
|
+
if (!h(e[o], n[o], r, t))
|
|
238
238
|
return !1;
|
|
239
239
|
return !0;
|
|
240
240
|
}
|
|
241
|
-
if (e instanceof Map &&
|
|
242
|
-
if (e.size !==
|
|
241
|
+
if (e instanceof Map && n instanceof Map) {
|
|
242
|
+
if (e.size !== n.size)
|
|
243
243
|
return !1;
|
|
244
244
|
for (o of e.entries())
|
|
245
|
-
if (!
|
|
245
|
+
if (!n.has(o[0]))
|
|
246
246
|
return !1;
|
|
247
247
|
for (o of e.entries())
|
|
248
|
-
if (!h(o[1],
|
|
248
|
+
if (!h(o[1], n.get(o[0]), r, t))
|
|
249
249
|
return !1;
|
|
250
250
|
return !0;
|
|
251
251
|
}
|
|
252
|
-
if (e instanceof Set &&
|
|
253
|
-
if (e.size !==
|
|
252
|
+
if (e instanceof Set && n instanceof Set) {
|
|
253
|
+
if (e.size !== n.size)
|
|
254
254
|
return !1;
|
|
255
255
|
for (o of e.entries())
|
|
256
|
-
if (!
|
|
256
|
+
if (!n.has(o[0]))
|
|
257
257
|
return !1;
|
|
258
258
|
return !0;
|
|
259
259
|
}
|
|
260
|
-
if (ArrayBuffer.isView(e) && ArrayBuffer.isView(
|
|
261
|
-
if (i = e.length, i !=
|
|
260
|
+
if (ArrayBuffer.isView(e) && ArrayBuffer.isView(n)) {
|
|
261
|
+
if (i = e.length, i != n.length)
|
|
262
262
|
return !1;
|
|
263
263
|
for (o = i; o-- !== 0; )
|
|
264
|
-
if (e[o] !==
|
|
264
|
+
if (e[o] !== n[o])
|
|
265
265
|
return !1;
|
|
266
266
|
return !0;
|
|
267
267
|
}
|
|
268
268
|
if (e.constructor === RegExp)
|
|
269
|
-
return e.source ===
|
|
269
|
+
return e.source === n.source && e.flags === n.flags;
|
|
270
270
|
if (e.valueOf !== Object.prototype.valueOf && e.valueOf)
|
|
271
|
-
return e.valueOf() ===
|
|
271
|
+
return e.valueOf() === n.valueOf();
|
|
272
272
|
if (e.toString !== Object.prototype.toString && e.toString)
|
|
273
|
-
return e.toString() ===
|
|
274
|
-
if (u = Object.keys(e), i = u.length, i !== Object.keys(
|
|
273
|
+
return e.toString() === n.toString();
|
|
274
|
+
if (u = Object.keys(e), i = u.length, i !== Object.keys(n).length)
|
|
275
275
|
return !1;
|
|
276
276
|
for (o = i; o-- !== 0; )
|
|
277
|
-
if (!Object.prototype.hasOwnProperty.call(
|
|
277
|
+
if (!Object.prototype.hasOwnProperty.call(n, u[o]))
|
|
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) && !h(e[c],
|
|
282
|
-
return
|
|
281
|
+
if (!(r != null && r.includes(c)) && !(c === "_owner" && e.$$typeof) && !h(e[c], n[c], r, t))
|
|
282
|
+
return t && console.log(c), !1;
|
|
283
283
|
}
|
|
284
284
|
return !0;
|
|
285
285
|
}
|
|
286
|
-
return e !== e &&
|
|
286
|
+
return e !== e && n !== n;
|
|
287
287
|
}
|
|
288
288
|
const Z = typeof process < "u" && process.versions != null && process.versions.node != null, ye = () => process.env.NODE_ENV === "TEST" ? !0 : typeof window < "u" && typeof window.document < "u" && typeof window.matchMedia < "u" && !Z, he = (e) => {
|
|
289
289
|
if (e && e !== !0)
|
|
290
290
|
return e;
|
|
291
291
|
}, xe = (e) => {
|
|
292
|
-
const
|
|
292
|
+
const n = {};
|
|
293
293
|
if (Object.keys(e || {}).forEach((r) => {
|
|
294
|
-
e[r] !== void 0 && (
|
|
295
|
-
}), !(Object.keys(
|
|
296
|
-
return
|
|
294
|
+
e[r] !== void 0 && (n[r] = e[r]);
|
|
295
|
+
}), !(Object.keys(n).length < 1))
|
|
296
|
+
return n;
|
|
297
297
|
}, ve = (e) => {
|
|
298
|
-
const
|
|
298
|
+
const n = {};
|
|
299
299
|
return Object.keys(e || {}).forEach((r) => {
|
|
300
|
-
var
|
|
301
|
-
Array.isArray(e[r]) && ((
|
|
302
|
-
}),
|
|
300
|
+
var t;
|
|
301
|
+
Array.isArray(e[r]) && ((t = e[r]) == null ? void 0 : t.length) === 0 || e[r] !== void 0 && (n[r] = e[r]);
|
|
302
|
+
}), n;
|
|
303
303
|
};
|
|
304
304
|
function O(e) {
|
|
305
|
-
var
|
|
305
|
+
var n;
|
|
306
306
|
if (!(typeof e != "string" && !Array.isArray(e)))
|
|
307
|
-
return Array.isArray(e) ? e[e.length - 1] : (
|
|
307
|
+
return Array.isArray(e) ? e[e.length - 1] : (n = e.split(":")) == null ? void 0 : n.slice(-1)[0];
|
|
308
308
|
}
|
|
309
309
|
function k(e) {
|
|
310
310
|
return e && (e.type === z || e.type === j && e.children.length === 0 || e.type === Text && e.children.trim() === "");
|
|
311
311
|
}
|
|
312
|
-
function Ae(e,
|
|
312
|
+
function Ae(e, n) {
|
|
313
313
|
var r;
|
|
314
|
-
return M((r = e[
|
|
314
|
+
return M((r = e[n]) == null ? void 0 : r.call(e));
|
|
315
315
|
}
|
|
316
316
|
function M(e = []) {
|
|
317
|
-
const
|
|
317
|
+
const n = [];
|
|
318
318
|
return e.forEach((r) => {
|
|
319
|
-
Array.isArray(r) ?
|
|
320
|
-
}),
|
|
319
|
+
Array.isArray(r) ? n.push(...r) : (r == null ? void 0 : r.type) === j ? n.push(...M(r.children)) : n.push(r);
|
|
320
|
+
}), n.filter((r) => !k(r));
|
|
321
321
|
}
|
|
322
|
-
function V(e, ...
|
|
323
|
-
return typeof e == "function" ? e == null ? void 0 : e(...
|
|
322
|
+
function V(e, ...n) {
|
|
323
|
+
return typeof e == "function" ? e == null ? void 0 : e(...n) : e;
|
|
324
324
|
}
|
|
325
|
-
function K(e,
|
|
325
|
+
function K(e, n, r = "default", t) {
|
|
326
326
|
const i = O(r);
|
|
327
327
|
if (i) {
|
|
328
328
|
let o;
|
|
329
|
-
const u = F(
|
|
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 :
|
|
329
|
+
const u = F(n, r);
|
|
330
|
+
return u === !1 ? o = !1 : u === !0 ? o = e == null ? void 0 : e[i] : d(u) && t ? m(u) ? o = u : o = e == null ? void 0 : e[i] : o = u || (e == null ? void 0 : e[i]), t ? m(o) ? o : V(o) : o;
|
|
331
331
|
}
|
|
332
332
|
}
|
|
333
|
-
function ee(e,
|
|
333
|
+
function ee(e, n, r = "default", t) {
|
|
334
334
|
var o, u, c;
|
|
335
335
|
const i = O(r);
|
|
336
336
|
if (i) {
|
|
337
337
|
let f;
|
|
338
|
-
const a = F(
|
|
339
|
-
return a === !1 ? f = !1 : a === !0 ? f = (o = e == null ? void 0 : e[i]) == null ? void 0 : o.call(e,
|
|
338
|
+
const a = F(n, r);
|
|
339
|
+
return a === !1 ? f = !1 : a === !0 ? f = (o = e == null ? void 0 : e[i]) == null ? void 0 : o.call(e, t) : d(a) ? m(a) ? f = a : f = (u = e == null ? void 0 : e[i]) == null ? void 0 : u.call(e, t) : f = a || ((c = e == null ? void 0 : e[i]) == null ? void 0 : c.call(e, t)), m(f) ? f : V(f, t);
|
|
340
340
|
}
|
|
341
341
|
}
|
|
342
|
-
function Se(e,
|
|
342
|
+
function Se(e, n, r, t) {
|
|
343
343
|
const i = {};
|
|
344
344
|
return e.forEach((o) => {
|
|
345
345
|
const u = O(o);
|
|
346
346
|
if (u) {
|
|
347
|
-
const c =
|
|
347
|
+
const c = t != null && t.render ? ee(n, r, o, t == null ? void 0 : t.params) : K(n, r, o);
|
|
348
348
|
(D(c) || c) && (i[u] = c);
|
|
349
349
|
}
|
|
350
350
|
}), i;
|
|
351
351
|
}
|
|
352
|
-
const Oe = ({ suffixCls: e, customizePrefixCls:
|
|
353
|
-
const i =
|
|
354
|
-
return
|
|
355
|
-
}, Ue = (e,
|
|
356
|
-
function Ee(e, { align:
|
|
357
|
-
const
|
|
352
|
+
const Oe = ({ suffixCls: e, customizePrefixCls: n, isPor: r, className: t }) => {
|
|
353
|
+
const i = t || (r ? "gx-pro" : "gx");
|
|
354
|
+
return n || (e ? `${i}-${e}` : i);
|
|
355
|
+
}, Ue = (e, n) => e ? Array.isArray(e) ? e.join("-") : e.toString() : `${n}`;
|
|
356
|
+
function Ee(e, { align: n, showIndex: r }) {
|
|
357
|
+
const t = U(e);
|
|
358
358
|
if (r && e.length && e.every((i) => i.dataIndex !== "sortIndex")) {
|
|
359
359
|
const i = e[0];
|
|
360
|
-
|
|
360
|
+
t.unshift({
|
|
361
361
|
title: "序号",
|
|
362
|
-
align:
|
|
362
|
+
align: n,
|
|
363
363
|
fixed: i.fixed,
|
|
364
364
|
width: 60,
|
|
365
|
-
uuid:
|
|
365
|
+
uuid: ne().uuid(15),
|
|
366
366
|
dataIndex: "sortIndex",
|
|
367
367
|
key: "sortIndex"
|
|
368
368
|
});
|
|
369
369
|
} else
|
|
370
|
-
|
|
371
|
-
return
|
|
370
|
+
t.filter((i) => i.dataIndex !== "sortIndex");
|
|
371
|
+
return t;
|
|
372
372
|
}
|
|
373
|
-
function Re(e, ...
|
|
374
|
-
return typeof e == "function" ? e(...
|
|
373
|
+
function Re(e, ...n) {
|
|
374
|
+
return typeof e == "function" ? e(...n) : e;
|
|
375
375
|
}
|
|
376
376
|
function U(e) {
|
|
377
377
|
return JSON.parse(JSON.stringify(e));
|
|
378
378
|
}
|
|
379
|
-
function be(e,
|
|
379
|
+
function be(e, n) {
|
|
380
380
|
if (d(e)) {
|
|
381
|
-
const { pageSize: r = 10, total:
|
|
381
|
+
const { pageSize: r = 10, total: t = 0 } = e;
|
|
382
382
|
let { current: i = 1 } = e;
|
|
383
|
-
return
|
|
383
|
+
return t - n <= r * (i - 1) && (i = i - 1), i === 0 ? 1 : i;
|
|
384
384
|
}
|
|
385
385
|
return 1;
|
|
386
386
|
}
|
|
387
|
-
function Ie(e = [],
|
|
388
|
-
function
|
|
387
|
+
function Ie(e = [], n, r = "children") {
|
|
388
|
+
function t(i, o) {
|
|
389
389
|
return o.map((u, c) => {
|
|
390
390
|
const f = `${i}-${c + 1}`;
|
|
391
|
-
return u[r] && (u[r] =
|
|
391
|
+
return u[r] && (u[r] = t(f, u[r])), u.sortIndex = f, u;
|
|
392
392
|
});
|
|
393
393
|
}
|
|
394
394
|
return U(e).map((i, o) => {
|
|
395
395
|
let u = o;
|
|
396
|
-
const c = d(
|
|
397
|
-
return u = c ? (c - 1) * f + (o + 1) : o + 1, i[r] && (i[r] =
|
|
396
|
+
const c = d(n) && n.current || 1, f = d(n) && n.pageSize || 10;
|
|
397
|
+
return u = c ? (c - 1) * f + (o + 1) : o + 1, i[r] && (i[r] = t(`${u}`, i[r])), i.sortIndex = u, i;
|
|
398
398
|
});
|
|
399
399
|
}
|
|
400
|
-
function Te(e,
|
|
401
|
-
const i = e[r], o =
|
|
400
|
+
function Te(e, n, r, t) {
|
|
401
|
+
const i = e[r], o = n[r];
|
|
402
402
|
let u = 0;
|
|
403
|
-
return i < o ? u =
|
|
403
|
+
return i < o ? u = t === 0 ? -1 : 0 : i > o && (u = t === 0 ? 0 : -1), u;
|
|
404
404
|
}
|
|
405
405
|
function je(e) {
|
|
406
|
-
let
|
|
407
|
-
const r = new Set(
|
|
408
|
-
return
|
|
406
|
+
let n = U(e);
|
|
407
|
+
const r = new Set(n);
|
|
408
|
+
return n = Array.from(r), n;
|
|
409
409
|
}
|
|
410
|
-
function Fe(e,
|
|
410
|
+
function Fe(e, n) {
|
|
411
411
|
const r = ["null", "undefined"];
|
|
412
|
-
let
|
|
413
|
-
return e === 0 ?
|
|
412
|
+
let t = !0;
|
|
413
|
+
return e === 0 ? t = !0 : r.includes(e) ? t = !1 : e || (t = !1), t ? {
|
|
414
414
|
value: e,
|
|
415
|
-
success:
|
|
415
|
+
success: t
|
|
416
416
|
} : {
|
|
417
|
-
value:
|
|
418
|
-
success:
|
|
417
|
+
value: n === "" ? n : n || "-",
|
|
418
|
+
success: t
|
|
419
419
|
};
|
|
420
420
|
}
|
|
421
421
|
function Le(e) {
|
|
422
|
-
let
|
|
422
|
+
let n = "";
|
|
423
423
|
if (e > -1) {
|
|
424
|
-
const r = Math.floor(e / 3600),
|
|
425
|
-
r < 10 ?
|
|
424
|
+
const r = Math.floor(e / 3600), t = Math.floor(e / 60) % 60, i = Number.parseInt(String(e % 60));
|
|
425
|
+
r < 10 ? n = "0" + r + ":" : n = r + ":", t < 10 && (n += "0"), n += t + ":", i < 10 && (n += "0"), n += i;
|
|
426
426
|
}
|
|
427
|
-
return
|
|
427
|
+
return n.split(":")[0] === "00" ? `${n.split(":")[1]}:${n.split(":")[2]}` : n;
|
|
428
428
|
}
|
|
429
|
-
function
|
|
429
|
+
function ne() {
|
|
430
430
|
const e = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");
|
|
431
431
|
return {
|
|
432
|
-
uuid(
|
|
433
|
-
const
|
|
432
|
+
uuid(n, r) {
|
|
433
|
+
const t = e, i = [], o = r || t.length;
|
|
434
434
|
let u, c;
|
|
435
|
-
if (
|
|
436
|
-
for (u = 0; u <
|
|
437
|
-
i[u] =
|
|
435
|
+
if (n)
|
|
436
|
+
for (u = 0; u < n; u += 1)
|
|
437
|
+
i[u] = t[Number.parseInt(String(Math.random() * o))];
|
|
438
438
|
else
|
|
439
439
|
for (i[8] = "-", i[13] = "-", i[18] = "-", i[23] = "-", i[14] = "4", u = 0; u < 36; u += 1)
|
|
440
|
-
i[u] || (c = Math.random() * 16, i[u] =
|
|
440
|
+
i[u] || (c = Math.random() * 16, i[u] = t[u === 19 ? c && 3 || 8 : c]);
|
|
441
441
|
return i.join("");
|
|
442
442
|
},
|
|
443
443
|
uuidFast() {
|
|
444
|
-
const
|
|
445
|
-
let
|
|
444
|
+
const n = e, r = Array.from({ length: 36 });
|
|
445
|
+
let t = 0, i, o;
|
|
446
446
|
for (o = 0; o < 36; o += 1)
|
|
447
|
-
o === 8 || o === 13 || o === 18 || o === 23 ? r[o] = "-" : o === 14 ? r[o] = "4" : (
|
|
447
|
+
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]);
|
|
448
448
|
return r.join("");
|
|
449
449
|
},
|
|
450
450
|
uuidString() {
|
|
451
451
|
return this.uuidFast().replace(new RegExp("-", "g"), "");
|
|
452
452
|
},
|
|
453
453
|
uuidCompact() {
|
|
454
|
-
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (
|
|
454
|
+
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (n) => {
|
|
455
455
|
const r = Math.random() * 16 || 0;
|
|
456
|
-
return (
|
|
456
|
+
return (n === "x" ? r : r && 3 || 8).toString(16);
|
|
457
457
|
});
|
|
458
458
|
}
|
|
459
459
|
};
|
|
460
460
|
}
|
|
461
461
|
function De(e = []) {
|
|
462
|
-
let
|
|
463
|
-
function r(
|
|
464
|
-
|
|
465
|
-
o.floor = i, i >
|
|
462
|
+
let n = 0;
|
|
463
|
+
function r(t = [], i) {
|
|
464
|
+
t.forEach((o) => {
|
|
465
|
+
o.floor = i, i > n && (n = i), o.children && o.children.length > 0 && r(o.children, i + 1);
|
|
466
466
|
});
|
|
467
467
|
}
|
|
468
|
-
return r(e, 1),
|
|
468
|
+
return r(e, 1), n;
|
|
469
469
|
}
|
|
470
|
-
function
|
|
470
|
+
function te(e, n = "children") {
|
|
471
471
|
let r = [];
|
|
472
|
-
return e.forEach((
|
|
473
|
-
r.push(
|
|
472
|
+
return e.forEach((t) => {
|
|
473
|
+
r.push(t), B(t[n]) && t[n].length > 0 && (r = r.concat(te(t[n])));
|
|
474
474
|
}), r;
|
|
475
475
|
}
|
|
476
|
-
function Be(e,
|
|
477
|
-
|
|
476
|
+
function Be(e, n, r, t, i) {
|
|
477
|
+
n = n || "id", r = r || "parentId", t = t || "children", i = i || 0;
|
|
478
478
|
const o = JSON.parse(JSON.stringify(e));
|
|
479
479
|
return o.filter((u) => {
|
|
480
|
-
const c = o.filter((f) => u[
|
|
481
|
-
return c.length > 0 ? u[
|
|
480
|
+
const c = o.filter((f) => u[n] === f[r || "parentId"]);
|
|
481
|
+
return c.length > 0 ? u[t || "children"] = c : delete u[t || "children"], u[r || "parentId"] === i;
|
|
482
482
|
});
|
|
483
483
|
}
|
|
484
484
|
function Ce(e) {
|
|
485
485
|
return URL.createObjectURL(e);
|
|
486
486
|
}
|
|
487
487
|
function Pe(e) {
|
|
488
|
-
return new Promise((
|
|
489
|
-
const
|
|
490
|
-
|
|
488
|
+
return new Promise((n, r) => {
|
|
489
|
+
const t = new FileReader();
|
|
490
|
+
t.readAsDataURL(e), t.onload = () => n(t.result), t.onerror = (i) => r(i);
|
|
491
491
|
});
|
|
492
492
|
}
|
|
493
493
|
function Ne(e) {
|
|
494
|
-
const
|
|
495
|
-
let i =
|
|
494
|
+
const n = e.split(","), r = n[0].match(/:(.*?);/)[1], t = atob(n[1]);
|
|
495
|
+
let i = t.length;
|
|
496
496
|
const o = new Uint8Array(i);
|
|
497
497
|
for (; i--; )
|
|
498
|
-
o[i] =
|
|
498
|
+
o[i] = t.charCodeAt(i);
|
|
499
499
|
return new Blob([o], { type: r });
|
|
500
500
|
}
|
|
501
|
-
function Me(e,
|
|
502
|
-
const r = e.split(","),
|
|
501
|
+
function Me(e, n) {
|
|
502
|
+
const r = e.split(","), t = r[0].match(/:(.*?);/)[1], i = atob(r[1]);
|
|
503
503
|
let o = i.length;
|
|
504
504
|
const u = new Uint8Array(o);
|
|
505
505
|
for (; o--; )
|
|
506
506
|
u[o] = i.charCodeAt(o);
|
|
507
|
-
return new File([u],
|
|
507
|
+
return new File([u], n, { type: t });
|
|
508
508
|
}
|
|
509
|
-
function Ve(e,
|
|
510
|
-
return new window.File([e],
|
|
509
|
+
function Ve(e, n, r) {
|
|
510
|
+
return new window.File([e], n, { type: r });
|
|
511
511
|
}
|
|
512
512
|
function re(e = "") {
|
|
513
|
-
const
|
|
514
|
-
return
|
|
513
|
+
const n = e.indexOf("?");
|
|
514
|
+
return n > 0 ? `${e.substring(0, n)}` : e;
|
|
515
515
|
}
|
|
516
516
|
function A(e = "") {
|
|
517
517
|
e = re(e);
|
|
518
|
-
const
|
|
519
|
-
return
|
|
518
|
+
const n = e.lastIndexOf(".");
|
|
519
|
+
return n > 0 ? `${e.substring(n).split("?")[0]}`.split(".")[1] : "";
|
|
520
520
|
}
|
|
521
|
-
function p(e,
|
|
522
|
-
if (
|
|
523
|
-
return
|
|
521
|
+
function p(e, n) {
|
|
522
|
+
if (n)
|
|
523
|
+
return n;
|
|
524
524
|
if (!e || e === "data:")
|
|
525
525
|
return "4";
|
|
526
526
|
let r = "4";
|
|
527
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";
|
|
528
528
|
}
|
|
529
529
|
function ie(e) {
|
|
530
|
-
const { url:
|
|
531
|
-
let
|
|
532
|
-
return
|
|
530
|
+
const { url: n = "", fileType: r = "1" } = e;
|
|
531
|
+
let t = "";
|
|
532
|
+
return n instanceof File ? t = URL.createObjectURL(n) : E(n) ? t = n : n instanceof Blob ? t = URL.createObjectURL(n) : (n.includes("https") || n.includes("http")) && (t = n), new Promise((i) => {
|
|
533
533
|
let o;
|
|
534
|
-
r === "1" ? (o = document.createElement("img"), o.src =
|
|
534
|
+
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() {
|
|
535
535
|
i({
|
|
536
536
|
play: !0,
|
|
537
537
|
width: o.width || 0,
|
|
@@ -552,30 +552,30 @@ function ie(e) {
|
|
|
552
552
|
});
|
|
553
553
|
}
|
|
554
554
|
async function $e(e) {
|
|
555
|
-
const { url:
|
|
556
|
-
let o = "", u =
|
|
557
|
-
return
|
|
555
|
+
const { url: n = "", currentTime: r, videoSuffix: t = "", vidoeAllowPlay: i = !1 } = e;
|
|
556
|
+
let o = "", u = t, c = "1", f;
|
|
557
|
+
return n instanceof File ? (o = URL.createObjectURL(n), u = A(n.name), c = p(n.name)) : n instanceof Blob ? (o = URL.createObjectURL(n), c = p(n)) : E(n) ? (o = n, c = p(n)) : (n.includes("https") || n.includes("http")) && (o = n, u = A(n), c = p(n)), (u ? g.videoAllowType.includes(u.toLowerCase()) : !1) ? i ? T(o, r) : (f = await ie({
|
|
558
558
|
url: o,
|
|
559
559
|
fileType: c
|
|
560
|
-
}), f.play ? T(o, r) : new Promise((
|
|
561
|
-
|
|
562
|
-
})) : new Promise((
|
|
563
|
-
|
|
560
|
+
}), f.play ? T(o, r) : new Promise((l) => {
|
|
561
|
+
l("");
|
|
562
|
+
})) : new Promise((l) => {
|
|
563
|
+
l("");
|
|
564
564
|
});
|
|
565
565
|
}
|
|
566
|
-
async function T(e,
|
|
566
|
+
async function T(e, n = 0) {
|
|
567
567
|
return new Promise((r) => {
|
|
568
|
-
let
|
|
569
|
-
|
|
568
|
+
let t = document.createElement("video");
|
|
569
|
+
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() {
|
|
570
570
|
let i;
|
|
571
|
-
|
|
571
|
+
t == null || t.addEventListener("seeked", async function() {
|
|
572
572
|
i && i();
|
|
573
573
|
});
|
|
574
|
-
const o = (
|
|
575
|
-
for (;
|
|
576
|
-
|
|
577
|
-
const u = document.createElement("canvas"), c = 0.8, f = u.getContext("2d"), a = (
|
|
578
|
-
u.width = (
|
|
574
|
+
const o = (t == null ? void 0 : t.duration) || 0;
|
|
575
|
+
for (; n < o; ) {
|
|
576
|
+
t && (t.currentTime = n), await new Promise(($) => i = $);
|
|
577
|
+
const u = document.createElement("canvas"), c = 0.8, f = u.getContext("2d"), a = (t == null ? void 0 : t.videoWidth) || 0 * c, l = (t == null ? void 0 : t.videoHeight) || 0 * c, s = 0;
|
|
578
|
+
u.width = (t == null ? void 0 : t.videoWidth) || 0 * c, u.height = (t == null ? void 0 : t.videoHeight) || 0 * c, f.drawImage(t, 0, 0, a + s, l + s), t = null, r(a === 0 || l === 0 ? "" : u.toDataURL("image/png", 1));
|
|
579
579
|
}
|
|
580
580
|
});
|
|
581
581
|
});
|
|
@@ -587,11 +587,11 @@ function E(e = "") {
|
|
|
587
587
|
"data:audio/"
|
|
588
588
|
].find((r) => e.includes(r)));
|
|
589
589
|
}
|
|
590
|
-
function ze(e,
|
|
591
|
-
e &&
|
|
590
|
+
function ze(e, n, r, t = !1) {
|
|
591
|
+
e && n && r && e.addEventListener(n, r, t);
|
|
592
592
|
}
|
|
593
|
-
function He(e,
|
|
594
|
-
e &&
|
|
593
|
+
function He(e, n, r, t = !1) {
|
|
594
|
+
e && n && r && e.removeEventListener(n, r, t);
|
|
595
595
|
}
|
|
596
596
|
function We() {
|
|
597
597
|
return /windows|win32/i.test(navigator.userAgent);
|
|
@@ -616,11 +616,11 @@ export {
|
|
|
616
616
|
Pe as getBase64,
|
|
617
617
|
Ce as getBlobUrl,
|
|
618
618
|
A as getFileSuffix,
|
|
619
|
-
|
|
619
|
+
te as getLevelData,
|
|
620
620
|
De as getMaxFloor,
|
|
621
621
|
ie as getMediaInfos,
|
|
622
622
|
Oe as getPrefixCls,
|
|
623
|
-
|
|
623
|
+
ne as getRandomNumber,
|
|
624
624
|
G as getScroll,
|
|
625
625
|
ue as getScrollContainer,
|
|
626
626
|
K as getSlot,
|
|
@@ -651,9 +651,9 @@ export {
|
|
|
651
651
|
q as isScroll,
|
|
652
652
|
w as isServer,
|
|
653
653
|
X as isString,
|
|
654
|
-
|
|
654
|
+
le as isUrl,
|
|
655
655
|
We as isWindowsOs,
|
|
656
|
-
|
|
656
|
+
se as merge,
|
|
657
657
|
de as nanoid,
|
|
658
658
|
He as off,
|
|
659
659
|
he as omitBoolean,
|
package/dist/pro-utils.umd.cjs
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
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 Z=e=>{const n=Object.create(null);return r=>n[r]||(n[r]=e(r))},k=/-(\w)/g,K=Z(e=>e.replace(k,(n,r)=>r?r.toUpperCase():"")),O=function(e,n){var r;if(w||!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]}},C=(e,n)=>w?void 0:(n==null?O(e,"overflow"):n?O(e,"overflow-y"):O(e,"overflow-x")).match(/(scroll|auto|overlay)/),ee=(e,n)=>{if(w)return;let r=e;for(;r;){if([window,document,document.documentElement].includes(r))return window;if(C(r,n))return r;r=r.parentNode}return r},ne=(e,n)=>{if(w||!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 te(e){return/\w.(png|jpg|jpeg|svg|webp|gif|bmp)$/i.test(e)}const re=e=>e==null,ie=e=>{if(!e||!e.startsWith("http"))return!1;try{return!!new URL(e)}catch{return!1}},oe=(...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 N=0;const P=(e=21)=>{if(typeof window>"u"||!window.crypto)return(N+=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},ue=()=>typeof window>"u"?P():window.crypto&&window.crypto.randomUUID&&typeof crypto.randomUUID=="function"?crypto.randomUUID():P();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 ce=Object.prototype.toString;function R(e,n){return ce.call(e)===`[object ${n}]`}function b(e){return R(e,"Boolean")}function fe(e){return typeof e=="number"}function E(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 ae(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(E(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 F=new Map;function W(e){F.delete(e)}function T(e,n=1){z+=1;const r=z;function t(i){if(i===0)W(r),e();else{const o=M(()=>{t(i-1)});F.set(r,o)}}return t(n),r}T.cancel=e=>{const n=F.get(e);return W(n),$(n)};function I(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 I(e)?t=e[n?"pageYOffset":"pageXOffset"]:e instanceof Document?t=e.documentElement[r]:e&&(t=e[r]),e&&!I(e)&&typeof t!="number"&&(t=(i=(e.ownerDocument||e).documentElement)==null?void 0:i[r]),t}function le(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 se(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=le(d>i?i:d,c,e,i);I(o)?o.scrollTo(window.pageXOffset,m):o instanceof HTMLDocument||o.constructor.name==="HTMLDocument"?o.documentElement.scrollTop=m:o.scrollTop=m,d<i?T(a):typeof t=="function"&&t()};T(a)}function de(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 y={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 ge=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,me=()=>process.env.NODE_ENV==="TEST"?!0:typeof window<"u"&&typeof window.document<"u"&&typeof window.matchMedia<"u"&&!ge,we=e=>{if(e&&e!==!0)return e},ye=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 j(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 he(e,n){var r;return B((r=e[n])==null?void 0:r.call(e))}function B(e=[]){const n=[];return e.forEach(r=>{Array.isArray(r)?n.push(...r):(r==null?void 0:r.type)===l.Fragment?n.push(...B(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 _(e,n,r="default",t){const i=j(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 J(e,n,r="default",t){var o,c,f;const i=j(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,t){const i={};return e.forEach(o=>{const c=j(o);if(c){const f=t!=null&&t.render?J(n,r,o,t==null?void 0:t.params):_(n,r,o);(b(f)||f)&&(i[c]=f)}}),i}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:X().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 X(){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 Y(e,n="children"){let r=[];return e.forEach(t=>{r.push(t),E(t[n])&&t[n].length>0&&(r=r.concat(Y(t[n])))}),r}function Be(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 De(e){return URL.createObjectURL(e)}function Le(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 G(e=""){const n=e.indexOf("?");return n>0?`${e.substring(0,n)}`:e}function v(e=""){e=G(e);const n=e.lastIndexOf(".");return n>0?`${e.substring(n).split("?")[0]}`.split(".")[1]:""}function p(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(),y.imageType.includes(r)?"1":y.videoType.includes(r)?"3":y.audioType.includes(r)?"2":"4"}function Q(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=p(n.name)):n instanceof Blob?(o=URL.createObjectURL(n),f=p(n)):A(n)?(o=n,f=p(n)):(n.includes("https")||n.includes("http"))&&(o=n,c=v(n),f=p(n)),(c?y.videoAllowType.includes(c.toLowerCase()):!1)?i?L(o,r):(a=await Q({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(We=>i=We);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)}function ze(e){return b(e)?e:!!e}u.arrayRepeat=Fe,u.blobToDataURL=Pe,u.checkFileType=p,u.classNames=x,u.compareArray=Ee,u.convertValueBoolean=ze,u.dataURLtoBlob=Ce,u.dataURLtoFile=Ne,u.deepCopy=S,u.filterEmpty=B,u.formatDuraton=Ie,u.genColumnKey=Ae,u.generateVidoePicture=L,u.getBase64=Le,u.getBlobUrl=De,u.getFileSuffix=v,u.getLevelData=Y,u.getMaxFloor=je,u.getMediaInfos=Q,u.getPrefixCls=ve,u.getRandomNumber=X,u.getScroll=q,u.getScrollContainer=ee,u.getSlot=_,u.getSlotVNode=J,u.getSlotsChildren=he,u.getSlotsProps=Se,u.getSortIndex=be,u.getValueFromObjectByKey=U,u.getVideoCoverPicture=Ve,u.getVideoFileUrl=G,u.globalConfig=y,u.handleCurrentPage=Re,u.handleShowIndex=Oe,u.hanndleField=Te,u.is=R,u.isArray=E,u.isBase64=A,u.isBoolean=b,u.isBrowser=me,u.isDeepEqualReact=h,u.isEmptyElement=H,u.isFunction=ae,u.isImg=te,u.isInContainer=ne,u.isNil=re,u.isNumber=fe,u.isObject=g,u.isScroll=C,u.isServer=w,u.isString=V,u.isUrl=ie,u.isWindowsOs=$e,u.merge=oe,u.nanoid=ue,u.off=Me,u.omitBoolean=we,u.omitUndefined=ye,u.omitUndefinedAndEmptyArr=pe,u.on=xe,u.runFunction=Ue,u.scrollTo=se,u.slotRender=D,u.throttleByAnimationFrame=de,u.treeData=Be,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
|
|
5
|
+
**/process.env.NODE_ENV!=="production"&&Object.freeze({}),process.env.NODE_ENV!=="production"&&Object.freeze([]);const Z=e=>{const n=Object.create(null);return r=>n[r]||(n[r]=e(r))},k=/-(\w)/g,K=Z(e=>e.replace(k,(n,r)=>r?r.toUpperCase():"")),O=function(e,n){var r;if(w||!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]}},C=(e,n)=>w?void 0:(n==null?O(e,"overflow"):n?O(e,"overflow-y"):O(e,"overflow-x")).match(/(scroll|auto|overlay)/),ee=(e,n)=>{if(w)return;let r=e;for(;r;){if([window,document,document.documentElement].includes(r))return window;if(C(r,n))return r;r=r.parentNode}return r},ne=(e,n)=>{if(w||!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 te(e){return/\w.(png|jpg|jpeg|svg|webp|gif|bmp)$/i.test(e)}const re=e=>e==null,ie=e=>{if(!e||!e.startsWith("http"))return!1;try{return!!new URL(e)}catch{return!1}},oe=(...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 N=0;const P=(e=21)=>{if(typeof window>"u"||!window.crypto)return(N+=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},ue=()=>typeof window>"u"?P():window.crypto&&window.crypto.randomUUID&&typeof crypto.randomUUID=="function"?crypto.randomUUID():P();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 ce=Object.prototype.toString;function R(e,n){return ce.call(e)===`[object ${n}]`}function b(e){return R(e,"Boolean")}function fe(e){return typeof e=="number"}function E(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 ae(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(E(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 F=new Map;function W(e){F.delete(e)}function T(e,n=1){z+=1;const r=z;function t(i){if(i===0)W(r),e();else{const o=M(()=>{t(i-1)});F.set(r,o)}}return t(n),r}T.cancel=e=>{const n=F.get(e);return W(n),$(n)};function I(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 I(e)?t=e[n?"pageYOffset":"pageXOffset"]:e instanceof Document?t=e.documentElement[r]:e&&(t=e[r]),e&&!I(e)&&typeof t!="number"&&(t=(i=(e.ownerDocument||e).documentElement)==null?void 0:i[r]),t}function le(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 se(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=le(d>i?i:d,c,e,i);I(o)?o.scrollTo(window.pageXOffset,m):o instanceof HTMLDocument||o.constructor.name==="HTMLDocument"?o.documentElement.scrollTop=m:o.scrollTop=m,d<i?T(a):typeof t=="function"&&t()};T(a)}function de(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 y={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 ge=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,me=()=>process.env.NODE_ENV==="TEST"?!0:typeof window<"u"&&typeof window.document<"u"&&typeof window.matchMedia<"u"&&!ge,we=e=>{if(e&&e!==!0)return e},ye=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 j(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 he(e,n){var r;return B((r=e[n])==null?void 0:r.call(e))}function B(e=[]){const n=[];return e.forEach(r=>{Array.isArray(r)?n.push(...r):(r==null?void 0:r.type)===l.Fragment?n.push(...B(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 _(e,n,r="default",t){const i=j(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)&&t?l.isVNode(c)?o=c:o=e==null?void 0:e[i]:o=c||(e==null?void 0:e[i]),t?l.isVNode(o)?o:D(o):o}}function J(e,n,r="default",t){var o,c,f;const i=j(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,t){const i={};return e.forEach(o=>{const c=j(o);if(c){const f=t!=null&&t.render?J(n,r,o,t==null?void 0:t.params):_(n,r,o);(b(f)||f)&&(i[c]=f)}}),i}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:X().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 X(){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 Y(e,n="children"){let r=[];return e.forEach(t=>{r.push(t),E(t[n])&&t[n].length>0&&(r=r.concat(Y(t[n])))}),r}function Be(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 De(e){return URL.createObjectURL(e)}function Le(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 G(e=""){const n=e.indexOf("?");return n>0?`${e.substring(0,n)}`:e}function v(e=""){e=G(e);const n=e.lastIndexOf(".");return n>0?`${e.substring(n).split("?")[0]}`.split(".")[1]:""}function p(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(),y.imageType.includes(r)?"1":y.videoType.includes(r)?"3":y.audioType.includes(r)?"2":"4"}function Q(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=p(n.name)):n instanceof Blob?(o=URL.createObjectURL(n),f=p(n)):A(n)?(o=n,f=p(n)):(n.includes("https")||n.includes("http"))&&(o=n,c=v(n),f=p(n)),(c?y.videoAllowType.includes(c.toLowerCase()):!1)?i?L(o,r):(a=await Q({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(We=>i=We);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)}function ze(e){return b(e)?e:!!e}u.arrayRepeat=Fe,u.blobToDataURL=Pe,u.checkFileType=p,u.classNames=x,u.compareArray=Ee,u.convertValueBoolean=ze,u.dataURLtoBlob=Ce,u.dataURLtoFile=Ne,u.deepCopy=S,u.filterEmpty=B,u.formatDuraton=Ie,u.genColumnKey=Ae,u.generateVidoePicture=L,u.getBase64=Le,u.getBlobUrl=De,u.getFileSuffix=v,u.getLevelData=Y,u.getMaxFloor=je,u.getMediaInfos=Q,u.getPrefixCls=ve,u.getRandomNumber=X,u.getScroll=q,u.getScrollContainer=ee,u.getSlot=_,u.getSlotVNode=J,u.getSlotsChildren=he,u.getSlotsProps=Se,u.getSortIndex=be,u.getValueFromObjectByKey=U,u.getVideoCoverPicture=Ve,u.getVideoFileUrl=G,u.globalConfig=y,u.handleCurrentPage=Re,u.handleShowIndex=Oe,u.hanndleField=Te,u.is=R,u.isArray=E,u.isBase64=A,u.isBoolean=b,u.isBrowser=me,u.isDeepEqualReact=h,u.isEmptyElement=H,u.isFunction=ae,u.isImg=te,u.isInContainer=ne,u.isNil=re,u.isNumber=fe,u.isObject=g,u.isScroll=C,u.isServer=w,u.isString=V,u.isUrl=ie,u.isWindowsOs=$e,u.merge=oe,u.nanoid=ue,u.off=Me,u.omitBoolean=we,u.omitUndefined=ye,u.omitUndefinedAndEmptyArr=pe,u.on=xe,u.runFunction=Ue,u.scrollTo=se,u.slotRender=D,u.throttleByAnimationFrame=de,u.treeData=Be,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
|
package/dist/slots/index.d.ts
CHANGED
|
@@ -12,7 +12,8 @@ export declare function slotRender(slot: any, ...arg: any): any;
|
|
|
12
12
|
* @lastTime 2024/2/2
|
|
13
13
|
* @description () => CustomRender
|
|
14
14
|
*/
|
|
15
|
-
export declare function getSlot<T = undefined
|
|
15
|
+
export declare function getSlot<T = undefined>(slots: Readonly<Record<string, any>>, props: Record<string, unknown>, keys: string | string[], render?: false): T extends undefined ? WithFalse<CustomRender> : T;
|
|
16
|
+
export declare function getSlot<T = undefined>(slots: Readonly<Record<string, any>>, props: Record<string, unknown>, keys: string | string[], render?: true): VNode;
|
|
16
17
|
/**
|
|
17
18
|
* @Author gx12358
|
|
18
19
|
* @DateTime 2024/2/2
|
package/dist/typings/index.d.ts
CHANGED
|
@@ -13,7 +13,7 @@ export type BasicTablePageConfig = {
|
|
|
13
13
|
pageSize: number;
|
|
14
14
|
total?: number;
|
|
15
15
|
} | boolean;
|
|
16
|
-
export
|
|
16
|
+
export interface DefaultProColumn {
|
|
17
17
|
title?: string;
|
|
18
18
|
align?: AlignType;
|
|
19
19
|
fixed?: boolean;
|
|
@@ -21,15 +21,8 @@ export type ProColumn<T extends undefined = undefined> = T extends undefined ? {
|
|
|
21
21
|
key: string;
|
|
22
22
|
dataIndex: string;
|
|
23
23
|
width?: number;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
align?: AlignType;
|
|
27
|
-
fixed?: boolean;
|
|
28
|
-
uuid?: string;
|
|
29
|
-
key: string;
|
|
30
|
-
dataIndex: string;
|
|
31
|
-
width?: number;
|
|
32
|
-
} & T;
|
|
24
|
+
}
|
|
25
|
+
export type ProColumn<T = undefined> = T extends undefined ? DefaultProColumn : DefaultProColumn & T;
|
|
33
26
|
export interface MaterialOptions {
|
|
34
27
|
play?: boolean;
|
|
35
28
|
width?: number;
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -14,18 +14,10 @@ export declare const getPrefixCls: ({ suffixCls, customizePrefixCls, isPor, clas
|
|
|
14
14
|
* @param index 序列号,理论上唯一
|
|
15
15
|
*/
|
|
16
16
|
export declare const genColumnKey: (key?: string | number | undefined, index?: number) => string;
|
|
17
|
-
export declare function handleShowIndex(columns:
|
|
17
|
+
export declare function handleShowIndex<T = ProColumn>(columns: T[], { align, showIndex }: {
|
|
18
18
|
align: AlignType;
|
|
19
19
|
showIndex: boolean;
|
|
20
|
-
}):
|
|
21
|
-
title?: string;
|
|
22
|
-
align?: AlignType;
|
|
23
|
-
fixed?: boolean;
|
|
24
|
-
uuid?: string;
|
|
25
|
-
key: string;
|
|
26
|
-
dataIndex: string;
|
|
27
|
-
width?: number;
|
|
28
|
-
}[];
|
|
20
|
+
}): T[];
|
|
29
21
|
/**
|
|
30
22
|
* @Author gx12358
|
|
31
23
|
* @DateTime 2021/11/3
|
|
@@ -39,7 +31,7 @@ export declare function runFunction<T extends any[]>(valueEnum: any, ...rest: T)
|
|
|
39
31
|
* @lastTime 2022/10/11
|
|
40
32
|
* @description 简单深拷贝下
|
|
41
33
|
*/
|
|
42
|
-
export declare function deepCopy(data: object | any[]):
|
|
34
|
+
export declare function deepCopy<T = any>(data: object | any[]): T;
|
|
43
35
|
/**
|
|
44
36
|
* @Author gx12358
|
|
45
37
|
* @DateTime 2021/1/28
|