@gx-design-vue/pro-utils 0.2.0-beta.31 → 0.2.0-beta.32

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