@gx-design-vue/pro-utils 0.2.0-beta.10 → 0.2.0-beta.12

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.
@@ -1,16 +1,15 @@
1
- import { isVNode as T } from "vue";
2
- import { cloneDeep as L } from "lodash-es";
1
+ import { cloneDeep as T } from "lodash-es";
3
2
  const w = typeof window > "u";
4
3
  process.env.NODE_ENV !== "production" && Object.freeze({});
5
4
  process.env.NODE_ENV !== "production" && Object.freeze([]);
6
- const D = (e) => {
5
+ const L = (e) => {
7
6
  const t = /* @__PURE__ */ Object.create(null);
8
7
  return (r) => t[r] || (t[r] = e(r));
9
- }, I = /-(\w)/g, U = D((e) => e.replace(I, (t, r) => r ? r.toUpperCase() : "")), y = function(e, t) {
8
+ }, D = /-(\w)/g, I = L((e) => e.replace(D, (t, r) => r ? r.toUpperCase() : "")), y = function(e, t) {
10
9
  var r;
11
10
  if (w || !e || !t)
12
11
  return "";
13
- t = U(t), t === "float" && (t = "cssFloat");
12
+ t = I(t), t === "float" && (t = "cssFloat");
14
13
  try {
15
14
  const n = e.style[t];
16
15
  if (n)
@@ -20,19 +19,19 @@ const D = (e) => {
20
19
  } catch {
21
20
  return e.style[t];
22
21
  }
23
- }, B = (e, t) => w ? void 0 : (t == null ? y(e, "overflow") : t ? y(e, "overflow-y") : y(e, "overflow-x")).match(/(scroll|auto|overlay)/), G = (e, t) => {
22
+ }, U = (e, t) => w ? void 0 : (t == null ? y(e, "overflow") : t ? y(e, "overflow-y") : y(e, "overflow-x")).match(/(scroll|auto|overlay)/), X = (e, t) => {
24
23
  if (w)
25
24
  return;
26
25
  let r = e;
27
26
  for (; r; ) {
28
27
  if ([window, document, document.documentElement].includes(r))
29
28
  return window;
30
- if (B(r, t))
29
+ if (U(r, t))
31
30
  return r;
32
31
  r = r.parentNode;
33
32
  }
34
33
  return r;
35
- }, Q = (e, t) => {
34
+ }, Y = (e, t) => {
36
35
  if (w || !e || !t)
37
36
  return !1;
38
37
  const r = e.getBoundingClientRect();
@@ -43,14 +42,14 @@ const D = (e) => {
43
42
  bottom: window.innerHeight,
44
43
  left: 0
45
44
  } : n = t.getBoundingClientRect(), r.top < n.bottom && r.bottom > n.top && r.right > n.left && r.left < n.right;
46
- }, C = Object.prototype.toString;
45
+ }, B = Object.prototype.toString;
47
46
  function b(e, t) {
48
- return C.call(e) === `[object ${t}]`;
47
+ return B.call(e) === `[object ${t}]`;
49
48
  }
50
49
  function R(e) {
51
50
  return b(e, "Boolean");
52
51
  }
53
- function Z(e) {
52
+ function G(e) {
54
53
  return typeof e == "number";
55
54
  }
56
55
  function E(e) {
@@ -59,22 +58,22 @@ function E(e) {
59
58
  function g(e) {
60
59
  return e !== null && b(e, "Object");
61
60
  }
62
- function P(e) {
61
+ function C(e) {
63
62
  return typeof e == "string" || e instanceof String;
64
63
  }
65
- function K(e) {
64
+ function Q(e) {
66
65
  return typeof e == "function" || Object.prototype.toString.call(e) === "[object Function]";
67
66
  }
68
- function M(...e) {
67
+ function P(...e) {
69
68
  const t = [];
70
69
  for (let r = 0; r < e.length; r++) {
71
70
  const n = e[r];
72
71
  if (n) {
73
- if (P(n))
72
+ if (C(n))
74
73
  t.push(n);
75
74
  else if (E(n))
76
75
  for (let i = 0; i < n.length; i++) {
77
- const o = M(n[i]);
76
+ const o = P(n[i]);
78
77
  o && t.push(o);
79
78
  }
80
79
  else if (g(n))
@@ -84,10 +83,10 @@ function M(...e) {
84
83
  }
85
84
  return t.filter((r) => r).join(" ");
86
85
  }
87
- let N = 0;
86
+ let M = 0;
88
87
  const a = {};
89
88
  function h(e, t = 1) {
90
- const r = N++;
89
+ const r = M++;
91
90
  let n = t;
92
91
  function i() {
93
92
  n -= 1, n <= 0 ? (e(), delete a[r]) : a[r] = requestAnimationFrame(i);
@@ -109,18 +108,18 @@ function $(e, t) {
109
108
  let n = 0;
110
109
  return S(e) ? n = e[t ? "pageYOffset" : "pageXOffset"] : e instanceof Document ? n = e.documentElement[r] : e && (n = e[r]), e && !S(e) && typeof n != "number" && (n = (i = (e.ownerDocument || e).documentElement) == null ? void 0 : i[r]), n;
111
110
  }
112
- function V(e, t, r, n) {
111
+ function N(e, t, r, n) {
113
112
  const i = r - t;
114
113
  return e /= n / 2, e < 1 ? i / 2 * e * e * e + t : i / 2 * ((e -= 2) * e * e + 2) + t;
115
114
  }
116
- function ee(e, t = {}) {
115
+ function Z(e, t = {}) {
117
116
  const { getContainer: r = () => window, callback: n, duration: i = 450 } = t, o = r(), c = $(o, !0), u = Date.now(), f = () => {
118
- const s = Date.now() - u, l = V(s > i ? i : s, c, e, i);
119
- S(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();
117
+ const l = Date.now() - u, s = N(l > i ? i : l, c, e, i);
118
+ S(o) ? o.scrollTo(window.pageXOffset, s) : o instanceof HTMLDocument || o.constructor.name === "HTMLDocument" ? o.documentElement.scrollTop = s : o.scrollTop = s, l < i ? h(f) : typeof n == "function" && n();
120
119
  };
121
120
  h(f);
122
121
  }
123
- function te(e) {
122
+ function K(e) {
124
123
  let t;
125
124
  const r = (i) => () => {
126
125
  t = null, e(...i);
@@ -157,7 +156,7 @@ const p = {
157
156
  "m3u8"
158
157
  ],
159
158
  audioType: ["mp3", "mpeg", "aac", "wav", "wma", "mp2", "flac", "midi", "ra", "ape", "aac", "cda"]
160
- }, ne = (...e) => {
159
+ }, ee = (...e) => {
161
160
  const t = {}, r = e.length;
162
161
  let n, i = 0;
163
162
  for (; i < r; i += 1)
@@ -230,41 +229,41 @@ function x(e, t, r, n) {
230
229
  }
231
230
  return e !== e && t !== t;
232
231
  }
233
- const z = (
232
+ const V = (
234
233
  // @ts-ignore
235
234
  typeof process < "u" && process.versions != null && process.versions.node != null
236
- ), re = () => process.env.NODE_ENV === "TEST" ? !0 : typeof window < "u" && typeof window.document < "u" && typeof window.matchMedia < "u" && !z, ie = (e) => {
235
+ ), te = () => process.env.NODE_ENV === "TEST" ? !0 : typeof window < "u" && typeof window.document < "u" && typeof window.matchMedia < "u" && !V, ne = (e) => {
237
236
  if (e && e !== !0)
238
237
  return e;
239
- }, oe = (e) => {
238
+ }, re = (e) => {
240
239
  const t = {};
241
240
  if (Object.keys(e || {}).forEach((r) => {
242
241
  e[r] !== void 0 && (t[r] = e[r]);
243
242
  }), !(Object.keys(t).length < 1))
244
243
  return t;
245
- }, H = (e) => e.length === 1 && (String(e[0].type) === String(Symbol("Comment")) || String(e[0].type) === String(Symbol("Fragment")) || String(e[0].type) === String(Symbol()));
246
- function ce(e) {
247
- return e && E(e) && H(e) ? T(e[0].children) ? e[0].children : e : [];
244
+ }, z = (e) => e.length === 1 && (String(e[0].type) === "template" || String(e[0].type) === String(Symbol("Comment")) || String(e[0].type) === String(Symbol("Fragment")) || String(e[0].type) === String(Symbol()));
245
+ function ie(e) {
246
+ return e && E(e) ? z(e) ? e[0].children : e : e || [];
248
247
  }
249
- function ue(e, t, r = "default") {
248
+ function oe(e, t, r = "default") {
250
249
  return t[r] === !1 ? !1 : R(t[r]) && t[r] ? (e == null ? void 0 : e[r]) || t[r] : t[r] || e[r];
251
250
  }
252
- function k(e, t, r = "default") {
251
+ function H(e, t, r = "default") {
253
252
  var n, i;
254
253
  return t[r] === !1 ? !1 : R(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));
255
254
  }
256
- function fe(e, t, r) {
255
+ function ce(e, t, r) {
257
256
  const n = {};
258
257
  return e.forEach((i) => {
259
- n[i] = k(t, r, i);
258
+ n[i] = H(t, r, i);
260
259
  }), n;
261
260
  }
262
- const se = ({ suffixCls: e, customizePrefixCls: t, isPor: r, className: n }) => {
261
+ const ue = ({ suffixCls: e, customizePrefixCls: t, isPor: r, className: n }) => {
263
262
  const i = n || (r ? "gx-pro" : "gx");
264
263
  return t || (e ? `${i}-${e}` : i);
265
- }, le = (e, t) => e ? Array.isArray(e) ? e.join("-") : e.toString() : `${t}`;
266
- function ae(e, { align: t, showIndex: r }) {
267
- const n = L(e);
264
+ }, fe = (e, t) => e ? Array.isArray(e) ? e.join("-") : e.toString() : `${t}`;
265
+ function le(e, { align: t, showIndex: r }) {
266
+ const n = T(e);
268
267
  if (r && e.length && e.every((i) => i.dataIndex !== "sortIndex")) {
269
268
  const i = e[0];
270
269
  n.unshift({
@@ -272,7 +271,7 @@ function ae(e, { align: t, showIndex: r }) {
272
271
  align: t,
273
272
  fixed: i.fixed,
274
273
  width: 60,
275
- uuid: q().uuid(15),
274
+ uuid: k().uuid(15),
276
275
  dataIndex: "sortIndex",
277
276
  key: "sortIndex"
278
277
  });
@@ -280,13 +279,13 @@ function ae(e, { align: t, showIndex: r }) {
280
279
  n.filter((i) => i.dataIndex !== "sortIndex");
281
280
  return n;
282
281
  }
283
- function de(e, ...t) {
282
+ function se(e, ...t) {
284
283
  return typeof e == "function" ? e(...t) : e;
285
284
  }
286
285
  function j(e) {
287
286
  return JSON.parse(JSON.stringify(e));
288
287
  }
289
- function me(e, t) {
288
+ function ae(e, t) {
290
289
  if (g(e)) {
291
290
  const { pageSize: r = 10, total: n = 0 } = e;
292
291
  let { current: i = 1 } = e;
@@ -294,7 +293,7 @@ function me(e, t) {
294
293
  }
295
294
  return 1;
296
295
  }
297
- function pe(e = [], t, r = "children") {
296
+ function de(e = [], t, r = "children") {
298
297
  function n(i, o) {
299
298
  return o.map((c, u) => {
300
299
  const f = `${i}-${u + 1}`;
@@ -307,17 +306,17 @@ function pe(e = [], t, r = "children") {
307
306
  return c = u ? (u - 1) * f + (o + 1) : o + 1, i[r] && (i[r] = n(`${c}`, i[r])), i.sortIndex = c, i;
308
307
  });
309
308
  }
310
- function ge(e, t, r, n) {
309
+ function me(e, t, r, n) {
311
310
  const i = e[r], o = t[r];
312
311
  let c = 0;
313
312
  return i < o ? c = n === 0 ? -1 : 0 : i > o && (c = n === 0 ? 0 : -1), c;
314
313
  }
315
- function he(e) {
314
+ function pe(e) {
316
315
  let t = j(e);
317
316
  const r = new Set(t);
318
317
  return t = Array.from(r), t;
319
318
  }
320
- function we(e, t) {
319
+ function ge(e, t) {
321
320
  const r = ["null", "undefined"];
322
321
  let n = !0;
323
322
  return e === 0 ? n = !0 : r.includes(e) ? n = !1 : e || (n = !1), n ? {
@@ -328,7 +327,7 @@ function we(e, t) {
328
327
  success: n
329
328
  };
330
329
  }
331
- function ye(e) {
330
+ function he(e) {
332
331
  let t = "";
333
332
  if (e > -1) {
334
333
  const r = Math.floor(e / 3600), n = Math.floor(e / 60) % 60, i = parseInt(String(e % 60));
@@ -336,7 +335,7 @@ function ye(e) {
336
335
  }
337
336
  return t.split(":")[0] === "00" ? `${t.split(":")[1]}:${t.split(":")[2]}` : t;
338
337
  }
339
- function q() {
338
+ function k() {
340
339
  const e = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");
341
340
  return {
342
341
  uuid(t, r) {
@@ -368,7 +367,7 @@ function q() {
368
367
  }
369
368
  };
370
369
  }
371
- function xe(e = []) {
370
+ function we(e = []) {
372
371
  let t = 0;
373
372
  function r(n = [], i) {
374
373
  n.forEach((o) => {
@@ -377,13 +376,13 @@ function xe(e = []) {
377
376
  }
378
377
  return r(e, 1), t;
379
378
  }
380
- function W(e, t = "children") {
379
+ function q(e, t = "children") {
381
380
  let r = [];
382
381
  return e.forEach((n) => {
383
- r.push(n), n[t] && n[t].length > 0 && (r = r.concat(W(n[t])));
382
+ r.push(n), n[t] && n[t].length > 0 && (r = r.concat(q(n[t])));
384
383
  }), r;
385
384
  }
386
- function Se(e, t, r, n, i) {
385
+ function ye(e, t, r, n, i) {
387
386
  t = t || "id", r = r || "parentId", n = n || "children", i = i || 0;
388
387
  const o = JSON.parse(JSON.stringify(e));
389
388
  return o.filter((c) => {
@@ -391,16 +390,16 @@ function Se(e, t, r, n, i) {
391
390
  return u.length > 0 ? c[n || "children"] = u : delete c[n || "children"], c[r || "parentId"] === i;
392
391
  });
393
392
  }
394
- function ve(e) {
393
+ function xe(e) {
395
394
  return URL.createObjectURL(e);
396
395
  }
397
- function Ae(e) {
396
+ function Se(e) {
398
397
  return new Promise((t, r) => {
399
398
  const n = new FileReader();
400
399
  n.readAsDataURL(e), n.onload = () => t(n.result), n.onerror = (i) => r(i);
401
400
  });
402
401
  }
403
- function Oe(e) {
402
+ function ve(e) {
404
403
  const t = e.split(","), r = t[0].match(/:(.*?);/)[1], n = atob(t[1]);
405
404
  let i = n.length;
406
405
  const o = new Uint8Array(i);
@@ -408,7 +407,7 @@ function Oe(e) {
408
407
  o[i] = n.charCodeAt(i);
409
408
  return new Blob([o], { type: r });
410
409
  }
411
- function be(e, t) {
410
+ function Ae(e, t) {
412
411
  const r = e.split(","), n = r[0].match(/:(.*?);/)[1], i = atob(r[1]);
413
412
  let o = i.length;
414
413
  const c = new Uint8Array(o);
@@ -416,15 +415,15 @@ function be(e, t) {
416
415
  c[o] = i.charCodeAt(o);
417
416
  return new File([c], t, { type: n });
418
417
  }
419
- function Re(e, t, r) {
418
+ function Oe(e, t, r) {
420
419
  return new window.File([e], t, { type: r });
421
420
  }
422
- function J(e = "") {
421
+ function W(e = "") {
423
422
  const t = e.indexOf("?");
424
423
  return t > 0 ? `${e.substring(0, t)}` : e;
425
424
  }
426
425
  function v(e = "") {
427
- e = J(e);
426
+ e = W(e);
428
427
  const t = e.lastIndexOf(".");
429
428
  return t > 0 ? `${e.substring(t).split("?")[0]}`.split(".")[1] : "";
430
429
  }
@@ -436,7 +435,7 @@ function m(e, t) {
436
435
  let r = "4";
437
436
  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(), p.imageType.includes(r) ? "1" : p.videoType.includes(r) ? "3" : p.audioType.includes(r) ? "2" : "4";
438
437
  }
439
- function _(e) {
438
+ function J(e) {
440
439
  const { url: t = "", fileType: r = "1" } = e;
441
440
  let n = "";
442
441
  return t instanceof File ? n = URL.createObjectURL(t) : A(t) ? n = t : t instanceof Blob ? n = URL.createObjectURL(t) : (t.includes("https") || t.includes("http")) && (n = t), new Promise(function(i) {
@@ -461,16 +460,16 @@ function _(e) {
461
460
  };
462
461
  });
463
462
  }
464
- async function Ee(e) {
463
+ async function be(e) {
465
464
  const { url: t = "", currentTime: r, videoSuffix: n = "", vidoeAllowPlay: i = !1 } = e;
466
465
  let o = "", c = n, u = "1", f;
467
- return t instanceof File ? (o = URL.createObjectURL(t), c = v(t.name), u = m(t.name)) : t instanceof Blob ? (o = URL.createObjectURL(t), u = m(t)) : A(t) ? (o = t, u = m(t)) : (t.includes("https") || t.includes("http")) && (o = t, c = v(t), u = m(t)), (c ? p.videoAllowType.includes(c.toLowerCase()) : !1) ? i ? O(o, r) : (f = await _({
466
+ return t instanceof File ? (o = URL.createObjectURL(t), c = v(t.name), u = m(t.name)) : t instanceof Blob ? (o = URL.createObjectURL(t), u = m(t)) : A(t) ? (o = t, u = m(t)) : (t.includes("https") || t.includes("http")) && (o = t, c = v(t), u = m(t)), (c ? p.videoAllowType.includes(c.toLowerCase()) : !1) ? i ? O(o, r) : (f = await J({
468
467
  url: o,
469
468
  fileType: u
470
- }), f.play ? O(o, r) : new Promise(function(s) {
471
- s("");
472
- })) : new Promise(function(s) {
473
- s("");
469
+ }), f.play ? O(o, r) : new Promise(function(l) {
470
+ l("");
471
+ })) : new Promise(function(l) {
472
+ l("");
474
473
  });
475
474
  }
476
475
  async function O(e, t = 0) {
@@ -484,8 +483,8 @@ async function O(e, t = 0) {
484
483
  const o = (n == null ? void 0 : n.duration) || 0;
485
484
  for (; t < o; ) {
486
485
  n && (n.currentTime = t), await new Promise((F) => i = F);
487
- const c = document.createElement("canvas"), u = 0.8, f = c.getContext("2d"), d = (n == null ? void 0 : n.videoWidth) || 0 * u, s = (n == null ? void 0 : n.videoHeight) || 0 * u, l = 0;
488
- 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, d + l, s + l), n = null, r(d === 0 || s === 0 ? "" : c.toDataURL("image/png", 1));
486
+ const c = document.createElement("canvas"), u = 0.8, f = c.getContext("2d"), d = (n == null ? void 0 : n.videoWidth) || 0 * u, l = (n == null ? void 0 : n.videoHeight) || 0 * u, s = 0;
487
+ 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, d + s, l + s), n = null, r(d === 0 || l === 0 ? "" : c.toDataURL("image/png", 1));
489
488
  }
490
489
  });
491
490
  });
@@ -497,66 +496,66 @@ function A(e = "") {
497
496
  "data:audio/"
498
497
  ].find((r) => e.includes(r)));
499
498
  }
500
- function je(e, t, r, n = !1) {
499
+ function Re(e, t, r, n = !1) {
501
500
  e && t && r && e.addEventListener(t, r, n);
502
501
  }
503
- function Fe(e, t, r, n = !1) {
502
+ function Ee(e, t, r, n = !1) {
504
503
  e && t && r && e.removeEventListener(t, r, n);
505
504
  }
506
505
  export {
507
- he as arrayRepeat,
508
- Re as blobToDataURL,
506
+ pe as arrayRepeat,
507
+ Oe as blobToDataURL,
509
508
  m as checkFileType,
510
- M as classNames,
511
- ge as compareArray,
512
- Oe as dataURLtoBlob,
513
- be as dataURLtoFile,
509
+ P as classNames,
510
+ me as compareArray,
511
+ ve as dataURLtoBlob,
512
+ Ae as dataURLtoFile,
514
513
  j as deepCopy,
515
- ye as formatDuraton,
516
- le as genColumnKey,
514
+ he as formatDuraton,
515
+ fe as genColumnKey,
517
516
  O as generateVidoePicture,
518
- Ae as getBase64,
519
- ve as getBlobUrl,
517
+ Se as getBase64,
518
+ xe as getBlobUrl,
520
519
  v as getFileSuffix,
521
- W as getLevelData,
522
- xe as getMaxFloor,
523
- _ as getMediaInfos,
524
- se as getPrefixCls,
525
- q as getRandomNumber,
526
- ce as getRealVNode,
520
+ q as getLevelData,
521
+ we as getMaxFloor,
522
+ J as getMediaInfos,
523
+ ue as getPrefixCls,
524
+ k as getRandomNumber,
525
+ ie as getRealVNode,
527
526
  $ as getScroll,
528
- G as getScrollContainer,
529
- ue as getSlot,
530
- k as getSlotVNode,
531
- fe as getSlotsProps,
532
- pe as getSortIndex,
533
- Ee as getVideoCoverPicture,
534
- J as getVideoFileUrl,
527
+ X as getScrollContainer,
528
+ oe as getSlot,
529
+ H as getSlotVNode,
530
+ ce as getSlotsProps,
531
+ de as getSortIndex,
532
+ be as getVideoCoverPicture,
533
+ W as getVideoFileUrl,
535
534
  p as globalConfig,
536
- me as handleCurrentPage,
537
- ae as handleShowIndex,
538
- we as hanndleField,
535
+ ae as handleCurrentPage,
536
+ le as handleShowIndex,
537
+ ge as hanndleField,
539
538
  b as is,
540
539
  E as isArray,
541
540
  A as isBase64,
542
541
  R as isBoolean,
543
- re as isBrowser,
542
+ te as isBrowser,
544
543
  x as isDeepEqualReact,
545
- K as isFunction,
546
- Q as isInContainer,
547
- Z as isNumber,
544
+ Q as isFunction,
545
+ Y as isInContainer,
546
+ G as isNumber,
548
547
  g as isObject,
549
- B as isScroll,
548
+ U as isScroll,
550
549
  w as isServer,
551
- H as isSlotFragment,
552
- P as isString,
553
- ne as merge,
554
- Fe as off,
555
- ie as omitBoolean,
556
- oe as omitUndefined,
557
- je as on,
558
- de as runFunction,
559
- ee as scrollTo,
560
- te as throttleByAnimationFrame,
561
- Se as treeData
550
+ z as isSlotFragment,
551
+ C as isString,
552
+ ee as merge,
553
+ Ee as off,
554
+ ne as omitBoolean,
555
+ re as omitUndefined,
556
+ Re as on,
557
+ se as runFunction,
558
+ Z as scrollTo,
559
+ K as throttleByAnimationFrame,
560
+ ye as treeData
562
561
  };
@@ -1 +1 @@
1
- (function(c,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("vue"),require("lodash-es")):typeof define=="function"&&define.amd?define(["exports","vue","lodash-es"],g):(c=typeof globalThis<"u"?globalThis:c||self,g(c.PorUtils={},c.vue,c.lodashEs))})(this,function(c,g,$){"use strict";const m=typeof window>"u";process.env.NODE_ENV!=="production"&&Object.freeze({}),process.env.NODE_ENV!=="production"&&Object.freeze([]);const q=e=>{const n=Object.create(null);return i=>n[i]||(n[i]=e(i))},z=/-(\w)/g,k=q(e=>e.replace(z,(n,i)=>i?i.toUpperCase():"")),b=function(e,n){var i;if(m||!e||!n)return"";n=k(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)=>m?void 0:(n==null?b(e,"overflow"):n?b(e,"overflow-y"):b(e,"overflow-x")).match(/(scroll|auto|overlay)/),H=(e,n)=>{if(m)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(m||!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},J=Object.prototype.toString;function F(e,n){return J.call(e)===`[object ${n}]`}function R(e){return F(e,"Boolean")}function _(e){return typeof e=="number"}function T(e){return typeof Array.isArray>"u"?Object.prototype.toString.call(e)==="[object Array]":Array.isArray(e)}function h(e){return e!==null&&F(e,"Object")}function D(e){return typeof e=="string"||e instanceof String}function X(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function B(...e){const n=[];for(let i=0;i<e.length;i++){const t=e[i];if(t){if(D(t))n.push(t);else if(T(t))for(let r=0;r<t.length;r++){const o=B(t[r]);o&&n.push(o)}else if(h(t))for(const r in t)t[r]&&n.push(r)}}return n.filter(i=>i).join(" ")}let Y=0;const s={};function S(e,n=1){const i=Y++;let t=n;function r(){t-=1,t<=0?(e(),delete s[i]):s[i]=requestAnimationFrame(r)}return s[i]=requestAnimationFrame(r),i}S.cancel=function(n){n!==void 0&&(cancelAnimationFrame(s[n]),delete s[n])},S.ids=s;function j(e){return e!=null&&e===e.window}function I(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=I(o,!0),f=Date.now(),l=()=>{const a=Date.now()-f,d=G(a>r?r:a,u,e,r);j(o)?o.scrollTo(window.pageXOffset,d):o instanceof HTMLDocument||o.constructor.name==="HTMLDocument"?o.documentElement.scrollTop=d:o.scrollTop=d,a<r?S(l):typeof t=="function"&&t()};S(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 p(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(!p(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(!p(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)&&!p(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},C=e=>e.length===1&&(String(e[0].type)===String(Symbol("Comment"))||String(e[0].type)===String(Symbol("Fragment"))||String(e[0].type)===String(Symbol()));function re(e){return e&&T(e)&&C(e)?g.isVNode(e[0].children)?e[0].children:e:[]}function oe(e,n,i="default"){return n[i]===!1?!1:R(n[i])&&n[i]?(e==null?void 0:e[i])||n[i]:n[i]||e[i]}function P(e,n,i="default"){var t,r;return n[i]===!1?!1:R(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=>{t[r]=P(n,i,r)}),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=$.cloneDeep(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:x().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 E(e){return JSON.parse(JSON.stringify(e))}function se(e,n){if(h(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 E(e).map((r,o)=>{let u=o;const f=h(n)&&n.current||1,l=h(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=E(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 ye(e){let n="";if(e>-1){const i=Math.floor(e/3600),t=Math.floor(e/60)%60,r=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 x(){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[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=new Array(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 we(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 N(e,n="children"){let i=[];return e.forEach(t=>{i.push(t),t[n]&&t[n].length>0&&(i=i.concat(N(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 M(e=""){const n=e.indexOf("?");return n>0?`${e.substring(0,n)}`:e}function v(e=""){e=M(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 i="4";return A(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=v(e).toLowerCase(),y.imageType.includes(i)?"1":y.videoType.includes(i)?"3":y.audioType.includes(i)?"2":"4"}function V(e){const{url:n="",fileType:i="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(function(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 Fe(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=v(n.name),f=w(n.name)):n instanceof Blob?(o=URL.createObjectURL(n),f=w(n)):A(n)?(o=n,f=w(n)):(n.includes("https")||n.includes("http"))&&(o=n,u=v(n),f=w(n)),(u?y.videoAllowType.includes(u.toLowerCase()):!1)?r?L(o,i):(l=await V({url:o,fileType:f}),l.play?L(o,i):new Promise(function(a){a("")})):new Promise(function(a){a("")})}async function L(e,n=0){return new Promise(function(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"),O=(t==null?void 0:t.videoWidth)||0*f,a=(t==null?void 0:t.videoHeight)||0*f,d=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,O+d,a+d),t=null,i(O===0||a===0?"":u.toDataURL("image/png",1))}})})}function A(e=""){return!!(e&&["data:image/","data:video/","data:audio/"].find(i=>e.includes(i)))}function Re(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)}c.arrayRepeat=me,c.blobToDataURL=be,c.checkFileType=w,c.classNames=B,c.compareArray=ge,c.dataURLtoBlob=Ae,c.dataURLtoFile=Oe,c.deepCopy=E,c.formatDuraton=ye,c.genColumnKey=fe,c.generateVidoePicture=L,c.getBase64=ve,c.getBlobUrl=pe,c.getFileSuffix=v,c.getLevelData=N,c.getMaxFloor=we,c.getMediaInfos=V,c.getPrefixCls=ue,c.getRandomNumber=x,c.getRealVNode=re,c.getScroll=I,c.getScrollContainer=H,c.getSlot=oe,c.getSlotVNode=P,c.getSlotsProps=ce,c.getSortIndex=de,c.getVideoCoverPicture=Fe,c.getVideoFileUrl=M,c.globalConfig=y,c.handleCurrentPage=se,c.handleShowIndex=le,c.hanndleField=he,c.is=F,c.isArray=T,c.isBase64=A,c.isBoolean=R,c.isBrowser=ne,c.isDeepEqualReact=p,c.isFunction=X,c.isInContainer=W,c.isNumber=_,c.isObject=h,c.isScroll=U,c.isServer=m,c.isSlotFragment=C,c.isString=D,c.merge=K,c.off=Te,c.omitBoolean=te,c.omitUndefined=ie,c.on=Re,c.runFunction=ae,c.scrollTo=Q,c.throttleByAnimationFrame=Z,c.treeData=Se,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
1
+ (function(c,g){typeof exports=="object"&&typeof module<"u"?g(exports,require("lodash-es")):typeof define=="function"&&define.amd?define(["exports","lodash-es"],g):(c=typeof globalThis<"u"?globalThis:c||self,g(c.PorUtils={},c.lodashEs))})(this,function(c,g){"use strict";const m=typeof window>"u";process.env.NODE_ENV!=="production"&&Object.freeze({}),process.env.NODE_ENV!=="production"&&Object.freeze([]);const $=e=>{const n=Object.create(null);return i=>n[i]||(n[i]=e(i))},z=/-(\w)/g,k=$(e=>e.replace(z,(n,i)=>i?i.toUpperCase():"")),b=function(e,n){var i;if(m||!e||!n)return"";n=k(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)=>m?void 0:(n==null?b(e,"overflow"):n?b(e,"overflow-y"):b(e,"overflow-x")).match(/(scroll|auto|overlay)/),q=(e,n)=>{if(m)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},H=(e,n)=>{if(m||!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},W=Object.prototype.toString;function F(e,n){return W.call(e)===`[object ${n}]`}function R(e){return F(e,"Boolean")}function J(e){return typeof e=="number"}function T(e){return typeof Array.isArray>"u"?Object.prototype.toString.call(e)==="[object Array]":Array.isArray(e)}function h(e){return e!==null&&F(e,"Object")}function D(e){return typeof e=="string"||e instanceof String}function _(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}function B(...e){const n=[];for(let i=0;i<e.length;i++){const t=e[i];if(t){if(D(t))n.push(t);else if(T(t))for(let r=0;r<t.length;r++){const o=B(t[r]);o&&n.push(o)}else if(h(t))for(const r in t)t[r]&&n.push(r)}}return n.filter(i=>i).join(" ")}let X=0;const s={};function S(e,n=1){const i=X++;let t=n;function r(){t-=1,t<=0?(e(),delete s[i]):s[i]=requestAnimationFrame(r)}return s[i]=requestAnimationFrame(r),i}S.cancel=function(n){n!==void 0&&(cancelAnimationFrame(s[n]),delete s[n])},S.ids=s;function j(e){return e!=null&&e===e.window}function I(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 Y(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 G(e,n={}){const{getContainer:i=()=>window,callback:t,duration:r=450}=n,o=i(),u=I(o,!0),f=Date.now(),l=()=>{const a=Date.now()-f,d=Y(a>r?r:a,u,e,r);j(o)?o.scrollTo(window.pageXOffset,d):o instanceof HTMLDocument||o.constructor.name==="HTMLDocument"?o.documentElement.scrollTop=d:o.scrollTop=d,a<r?S(l):typeof t=="function"&&t()};S(l)}function Q(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"]},Z=(...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 p(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(!p(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(!p(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)&&!p(e[f],n[f],i,t))return t&&console.log(f),!1}return!0}return e!==e&&n!==n}const K=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,ee=()=>process.env.NODE_ENV==="TEST"?!0:typeof window<"u"&&typeof window.document<"u"&&typeof window.matchMedia<"u"&&!K,ne=e=>{if(e&&e!==!0)return e},te=e=>{const n={};if(Object.keys(e||{}).forEach(i=>{e[i]!==void 0&&(n[i]=e[i])}),!(Object.keys(n).length<1))return n},C=e=>e.length===1&&(String(e[0].type)==="template"||String(e[0].type)===String(Symbol("Comment"))||String(e[0].type)===String(Symbol("Fragment"))||String(e[0].type)===String(Symbol()));function ie(e){return e&&T(e)?C(e)?e[0].children:e:e||[]}function re(e,n,i="default"){return n[i]===!1?!1:R(n[i])&&n[i]?(e==null?void 0:e[i])||n[i]:n[i]||e[i]}function P(e,n,i="default"){var t,r;return n[i]===!1?!1:R(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 oe(e,n,i){const t={};return e.forEach(r=>{t[r]=P(n,i,r)}),t}const ce=({suffixCls:e,customizePrefixCls:n,isPor:i,className:t})=>{const r=t||(i?"gx-pro":"gx");return n||(e?`${r}-${e}`:r)},ue=(e,n)=>e?Array.isArray(e)?e.join("-"):e.toString():`${n}`;function fe(e,{align:n,showIndex:i}){const t=g.cloneDeep(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:x().uuid(15),dataIndex:"sortIndex",key:"sortIndex"})}else t.filter(r=>r.dataIndex!=="sortIndex");return t}function le(e,...n){return typeof e=="function"?e(...n):e}function E(e){return JSON.parse(JSON.stringify(e))}function ae(e,n){if(h(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 se(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 E(e).map((r,o)=>{let u=o;const f=h(n)&&n.current||1,l=h(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 de(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 ge(e){let n=E(e);const i=new Set(n);return n=Array.from(i),n}function me(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 he(e){let n="";if(e>-1){const i=Math.floor(e/3600),t=Math.floor(e/60)%60,r=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 x(){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[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=new Array(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),t[n]&&t[n].length>0&&(i=i.concat(M(t[n])))}),i}function we(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 Se(e){return URL.createObjectURL(e)}function pe(e){return new Promise((n,i)=>{const t=new FileReader;t.readAsDataURL(e),t.onload=()=>n(t.result),t.onerror=r=>i(r)})}function ve(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 Ae(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 Oe(e,n,i){return new window.File([e],n,{type:i})}function N(e=""){const n=e.indexOf("?");return n>0?`${e.substring(0,n)}`:e}function v(e=""){e=N(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 i="4";return A(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=v(e).toLowerCase(),y.imageType.includes(i)?"1":y.videoType.includes(i)?"3":y.audioType.includes(i)?"2":"4"}function V(e){const{url:n="",fileType:i="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(function(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 be(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=v(n.name),f=w(n.name)):n instanceof Blob?(o=URL.createObjectURL(n),f=w(n)):A(n)?(o=n,f=w(n)):(n.includes("https")||n.includes("http"))&&(o=n,u=v(n),f=w(n)),(u?y.videoAllowType.includes(u.toLowerCase()):!1)?r?L(o,i):(l=await V({url:o,fileType:f}),l.play?L(o,i):new Promise(function(a){a("")})):new Promise(function(a){a("")})}async function L(e,n=0){return new Promise(function(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(Te=>r=Te);const u=document.createElement("canvas"),f=.8,l=u.getContext("2d"),O=(t==null?void 0:t.videoWidth)||0*f,a=(t==null?void 0:t.videoHeight)||0*f,d=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,O+d,a+d),t=null,i(O===0||a===0?"":u.toDataURL("image/png",1))}})})}function A(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 Re(e,n,i,t=!1){e&&n&&i&&e.removeEventListener(n,i,t)}c.arrayRepeat=ge,c.blobToDataURL=Oe,c.checkFileType=w,c.classNames=B,c.compareArray=de,c.dataURLtoBlob=ve,c.dataURLtoFile=Ae,c.deepCopy=E,c.formatDuraton=he,c.genColumnKey=ue,c.generateVidoePicture=L,c.getBase64=pe,c.getBlobUrl=Se,c.getFileSuffix=v,c.getLevelData=M,c.getMaxFloor=ye,c.getMediaInfos=V,c.getPrefixCls=ce,c.getRandomNumber=x,c.getRealVNode=ie,c.getScroll=I,c.getScrollContainer=q,c.getSlot=re,c.getSlotVNode=P,c.getSlotsProps=oe,c.getSortIndex=se,c.getVideoCoverPicture=be,c.getVideoFileUrl=N,c.globalConfig=y,c.handleCurrentPage=ae,c.handleShowIndex=fe,c.hanndleField=me,c.is=F,c.isArray=T,c.isBase64=A,c.isBoolean=R,c.isBrowser=ee,c.isDeepEqualReact=p,c.isFunction=_,c.isInContainer=H,c.isNumber=J,c.isObject=h,c.isScroll=U,c.isServer=m,c.isSlotFragment=C,c.isString=D,c.merge=Z,c.off=Re,c.omitBoolean=ne,c.omitUndefined=te,c.on=Fe,c.runFunction=le,c.scrollTo=G,c.throttleByAnimationFrame=Q,c.treeData=we,Object.defineProperty(c,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gx-design-vue/pro-utils",
3
- "version": "0.2.0-beta.10",
3
+ "version": "0.2.0-beta.12",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "vite build",