@gx-design-vue/pro-utils 0.0.26 → 0.0.27

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -11,6 +11,8 @@ import getScroll from './scroll/getScroll';
11
11
  import throttleByAnimationFrame from './scroll/throttleByAnimationFrame';
12
12
  import FieldLabel, { type FieldLabelProps } from './components/FieldLabel';
13
13
  import LabelIconTip, { type LabelTooltipType } from './components/LabelIconTip';
14
+ export * from './merge';
15
+ export * from './isDeepEqualReact';
14
16
  export * from './isBrowser';
15
17
  export * from './omitBoolean';
16
18
  export * from './omitUndefined';
@@ -0,0 +1 @@
1
+ export declare function isDeepEqualReact(a: any, b: any, ignoreKeys?: string[], debug?: boolean): boolean;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * 用于合并 n 个对象
3
+ * @param {any[]} ...rest
4
+ * @returns T
5
+ */
6
+ declare const merge: <T>(...rest: any[]) => T;
7
+ export { merge };
@@ -1,98 +1,98 @@
1
- import { defineComponent as N, ref as C, computed as M, createVNode as f, isVNode as H, Fragment as z } from "vue";
2
- import { createTypes as W } from "vue-types";
3
- import { CloseOutlined as _, DownOutlined as q, InfoCircleOutlined as J } from "@ant-design/icons-vue";
4
- import { cloneDeep as k } from "lodash-unified";
5
- import { Tooltip as X } from "ant-design-vue";
6
- const h = typeof window > "u";
1
+ import { defineComponent as N, ref as $, computed as z, createVNode as a, isVNode as k, Fragment as H } from "vue";
2
+ import { createTypes as _ } from "vue-types";
3
+ import { CloseOutlined as q, DownOutlined as W, InfoCircleOutlined as J } from "@ant-design/icons-vue";
4
+ import { cloneDeep as X } from "lodash-unified";
5
+ import { Tooltip as V } from "ant-design-vue";
6
+ const w = typeof window > "u";
7
7
  process.env.NODE_ENV !== "production" && Object.freeze({});
8
8
  process.env.NODE_ENV !== "production" && Object.freeze([]);
9
9
  const G = (e) => {
10
- const n = /* @__PURE__ */ Object.create(null);
11
- return (t) => n[t] || (n[t] = e(t));
12
- }, Y = /-(\w)/g, Q = G((e) => e.replace(Y, (n, t) => t ? t.toUpperCase() : "")), b = function(e, n) {
13
- var t;
14
- if (h || !e || !n)
10
+ const t = /* @__PURE__ */ Object.create(null);
11
+ return (n) => t[n] || (t[n] = e(n));
12
+ }, Y = /-(\w)/g, Q = G((e) => e.replace(Y, (t, n) => n ? n.toUpperCase() : "")), v = function(e, t) {
13
+ var n;
14
+ if (w || !e || !t)
15
15
  return "";
16
- n = Q(n), n === "float" && (n = "cssFloat");
16
+ t = Q(t), t === "float" && (t = "cssFloat");
17
17
  try {
18
- const i = e.style[n];
19
- if (i)
20
- return i;
21
- const r = (t = document == null ? void 0 : document.defaultView) == null ? void 0 : t.getComputedStyle(e, "");
22
- return r ? r[n] : "";
18
+ const r = e.style[t];
19
+ if (r)
20
+ return r;
21
+ const i = (n = document == null ? void 0 : document.defaultView) == null ? void 0 : n.getComputedStyle(e, "");
22
+ return i ? i[t] : "";
23
23
  } catch {
24
- return e.style[n];
24
+ return e.style[t];
25
25
  }
26
- }, V = (e, n) => h ? void 0 : (n == null ? b(e, "overflow") : n ? b(e, "overflow-y") : b(e, "overflow-x")).match(/(scroll|auto|overlay)/), ye = (e, n) => {
27
- if (h)
26
+ }, Z = (e, t) => w ? void 0 : (t == null ? v(e, "overflow") : t ? v(e, "overflow-y") : v(e, "overflow-x")).match(/(scroll|auto|overlay)/), pe = (e, t) => {
27
+ if (w)
28
28
  return;
29
- let t = e;
30
- for (; t; ) {
31
- if ([window, document, document.documentElement].includes(t))
29
+ let n = e;
30
+ for (; n; ) {
31
+ if ([window, document, document.documentElement].includes(n))
32
32
  return window;
33
- if (V(t, n))
34
- return t;
35
- t = t.parentNode;
33
+ if (Z(n, t))
34
+ return n;
35
+ n = n.parentNode;
36
36
  }
37
- return t;
38
- }, we = (e, n) => {
39
- if (h || !e || !n)
37
+ return n;
38
+ }, he = (e, t) => {
39
+ if (w || !e || !t)
40
40
  return !1;
41
- const t = e.getBoundingClientRect();
42
- let i;
43
- return [window, document, document.documentElement, null, void 0].includes(n) ? i = {
41
+ const n = e.getBoundingClientRect();
42
+ let r;
43
+ return [window, document, document.documentElement, null, void 0].includes(t) ? r = {
44
44
  top: 0,
45
45
  right: window.innerWidth,
46
46
  bottom: window.innerHeight,
47
47
  left: 0
48
- } : i = n.getBoundingClientRect(), t.top < i.bottom && t.bottom > i.top && t.right > i.left && t.left < i.right;
48
+ } : r = t.getBoundingClientRect(), n.top < r.bottom && n.bottom > r.top && n.right > r.left && n.left < r.right;
49
49
  };
50
- let Z = 0;
51
- const g = {};
52
- function x(e, n = 1) {
53
- const t = Z++;
54
- let i = n;
55
- function r() {
56
- i -= 1, i <= 0 ? (e(), delete g[t]) : g[t] = requestAnimationFrame(r);
50
+ let K = 0;
51
+ const m = {};
52
+ function h(e, t = 1) {
53
+ const n = K++;
54
+ let r = t;
55
+ function i() {
56
+ r -= 1, r <= 0 ? (e(), delete m[n]) : m[n] = requestAnimationFrame(i);
57
57
  }
58
- return g[t] = requestAnimationFrame(r), t;
58
+ return m[n] = requestAnimationFrame(i), n;
59
59
  }
60
- x.cancel = function(n) {
61
- n !== void 0 && (cancelAnimationFrame(g[n]), delete g[n]);
60
+ h.cancel = function(t) {
61
+ t !== void 0 && (cancelAnimationFrame(m[t]), delete m[t]);
62
62
  };
63
- x.ids = g;
64
- function S(e) {
63
+ h.ids = m;
64
+ function A(e) {
65
65
  return e != null && e === e.window;
66
66
  }
67
- function K(e, n) {
68
- var r;
67
+ function ee(e, t) {
68
+ var i;
69
69
  if (typeof window > "u")
70
70
  return 0;
71
- const t = n ? "scrollTop" : "scrollLeft";
72
- let i = 0;
73
- return S(e) ? i = e[n ? "pageYOffset" : "pageXOffset"] : e instanceof Document ? i = e.documentElement[t] : e && (i = e[t]), e && !S(e) && typeof i != "number" && (i = (r = (e.ownerDocument || e).documentElement) == null ? void 0 : r[t]), i;
74
- }
75
- function ee(e, n, t, i) {
76
- const r = t - n;
77
- return e /= i / 2, e < 1 ? r / 2 * e * e * e + n : r / 2 * ((e -= 2) * e * e + 2) + n;
78
- }
79
- function xe(e, n = {}) {
80
- const { getContainer: t = () => window, callback: i, duration: r = 450 } = n, o = t(), c = K(o, !0), u = Date.now(), l = () => {
81
- const a = Date.now() - u, d = ee(a > r ? r : a, c, e, r);
82
- S(o) ? o.scrollTo(window.pageXOffset, d) : o instanceof HTMLDocument || o.constructor.name === "HTMLDocument" ? o.documentElement.scrollTop = d : o.scrollTop = d, a < r ? x(l) : typeof i == "function" && i();
71
+ const n = t ? "scrollTop" : "scrollLeft";
72
+ let r = 0;
73
+ return A(e) ? r = e[t ? "pageYOffset" : "pageXOffset"] : e instanceof Document ? r = e.documentElement[n] : e && (r = e[n]), e && !A(e) && typeof r != "number" && (r = (i = (e.ownerDocument || e).documentElement) == null ? void 0 : i[n]), r;
74
+ }
75
+ function te(e, t, n, r) {
76
+ const i = n - t;
77
+ return e /= r / 2, e < 1 ? i / 2 * e * e * e + t : i / 2 * ((e -= 2) * e * e + 2) + t;
78
+ }
79
+ function we(e, t = {}) {
80
+ const { getContainer: n = () => window, callback: r, duration: i = 450 } = t, o = n(), c = ee(o, !0), l = Date.now(), u = () => {
81
+ const f = Date.now() - l, d = te(f > i ? i : f, c, e, i);
82
+ A(o) ? o.scrollTo(window.pageXOffset, d) : o instanceof HTMLDocument || o.constructor.name === "HTMLDocument" ? o.documentElement.scrollTop = d : o.scrollTop = d, f < i ? h(u) : typeof r == "function" && r();
83
83
  };
84
- x(l);
85
- }
86
- function he(e) {
87
- let n;
88
- const t = (r) => () => {
89
- n = null, e(...r);
90
- }, i = (...r) => {
91
- n == null && (n = requestAnimationFrame(t(r)));
84
+ h(u);
85
+ }
86
+ function xe(e) {
87
+ let t;
88
+ const n = (i) => () => {
89
+ t = null, e(...i);
90
+ }, r = (...i) => {
91
+ t == null && (t = requestAnimationFrame(n(i)));
92
92
  };
93
- return i.cancel = () => cancelAnimationFrame(n), i;
93
+ return r.cancel = () => cancelAnimationFrame(t), r;
94
94
  }
95
- var E = W({
95
+ var E = _({
96
96
  func: void 0,
97
97
  bool: void 0,
98
98
  string: void 0,
@@ -116,7 +116,7 @@ E.extend([{
116
116
  getter: !0,
117
117
  type: null
118
118
  }]);
119
- const v = E, w = {
119
+ const S = E, p = {
120
120
  videoAllowType: [
121
121
  "mp4",
122
122
  "webm",
@@ -144,251 +144,251 @@ const v = E, w = {
144
144
  "m3u8"
145
145
  ],
146
146
  audioType: ["mp3", "mpeg", "aac", "wav", "wma", "mp2", "flac", "midi", "ra", "ape", "aac", "cda"]
147
- }, te = Object.prototype.toString;
148
- function L(e, n) {
149
- return te.call(e) === `[object ${n}]`;
147
+ }, ne = Object.prototype.toString;
148
+ function R(e, t) {
149
+ return ne.call(e) === `[object ${t}]`;
150
150
  }
151
- function R(e) {
152
- return L(e, "Boolean");
151
+ function L(e) {
152
+ return R(e, "Boolean");
153
153
  }
154
- function pe(e) {
154
+ function ve(e) {
155
155
  return typeof e == "number";
156
156
  }
157
- function be(e) {
157
+ function Se(e) {
158
158
  return typeof Array.isArray > "u" ? Object.prototype.toString.call(e) === "[object Array]" : Array.isArray(e);
159
159
  }
160
- function T(e) {
161
- return e !== null && L(e, "Object");
160
+ function O(e) {
161
+ return e !== null && R(e, "Object");
162
162
  }
163
- function ve(e) {
163
+ function be(e) {
164
164
  return typeof e == "string" || e instanceof String;
165
165
  }
166
- function Se(e) {
166
+ function Ae(e) {
167
167
  return typeof e == "function" || Object.prototype.toString.call(e) === "[object Function]";
168
168
  }
169
- const I = ({ suffixCls: e, customizePrefixCls: n, isPor: t, className: i }) => {
170
- const r = i || (t ? "gx-pro" : "gx");
171
- return n || (e ? `${r}-${e}` : r);
172
- }, Te = (e, n) => e ? Array.isArray(e) ? e.join("-") : e.toString() : `${n}`;
173
- function Ae(e, { align: n, showIndex: t }) {
174
- const i = k(e);
175
- if (t && e.length && e.every((r) => r.dataIndex !== "sortIndex")) {
176
- const r = e[0];
177
- i.unshift({
169
+ const I = ({ suffixCls: e, customizePrefixCls: t, isPor: n, className: r }) => {
170
+ const i = r || (n ? "gx-pro" : "gx");
171
+ return t || (e ? `${i}-${e}` : i);
172
+ }, Oe = (e, t) => e ? Array.isArray(e) ? e.join("-") : e.toString() : `${t}`;
173
+ function Te(e, { align: t, showIndex: n }) {
174
+ const r = X(e);
175
+ if (n && e.length && e.every((i) => i.dataIndex !== "sortIndex")) {
176
+ const i = e[0];
177
+ r.unshift({
178
178
  title: "\u5E8F\u53F7",
179
- align: n,
180
- fixed: r.fixed,
179
+ align: t,
180
+ fixed: i.fixed,
181
181
  width: 60,
182
- uuid: ne().uuid(15),
182
+ uuid: re().uuid(15),
183
183
  dataIndex: "sortIndex",
184
184
  key: "sortIndex"
185
185
  });
186
186
  } else
187
- i.filter((r) => r.dataIndex !== "sortIndex");
188
- return i;
187
+ r.filter((i) => i.dataIndex !== "sortIndex");
188
+ return r;
189
189
  }
190
- function Fe(e, ...n) {
191
- return typeof e == "function" ? e(...n) : e;
190
+ function Fe(e, ...t) {
191
+ return typeof e == "function" ? e(...t) : e;
192
192
  }
193
193
  function B(e) {
194
194
  return JSON.parse(JSON.stringify(e));
195
195
  }
196
- function Oe(e, n) {
197
- if (T(e)) {
198
- const { pageSize: t = 10, total: i = 0 } = e;
199
- let { current: r = 1 } = e;
200
- return i - n <= t * (r - 1) && (r = r - 1), r === 0 ? 1 : r;
196
+ function Ce(e, t) {
197
+ if (O(e)) {
198
+ const { pageSize: n = 10, total: r = 0 } = e;
199
+ let { current: i = 1 } = e;
200
+ return r - t <= n * (i - 1) && (i = i - 1), i === 0 ? 1 : i;
201
201
  }
202
202
  return 1;
203
203
  }
204
- function Ce(e = [], n, t = "children") {
205
- function i(r, o) {
206
- return o.map((c, u) => {
207
- const l = `${r}-${u + 1}`;
208
- return c[t] && (c[t] = i(l, c[t])), c.sortIndex = l, c;
204
+ function $e(e = [], t, n = "children") {
205
+ function r(i, o) {
206
+ return o.map((c, l) => {
207
+ const u = `${i}-${l + 1}`;
208
+ return c[n] && (c[n] = r(u, c[n])), c.sortIndex = u, c;
209
209
  });
210
210
  }
211
- return B(e).map((r, o) => {
211
+ return B(e).map((i, o) => {
212
212
  let c = o;
213
- const u = T(n) && n.current || 1, l = T(n) && n.pageSize || 10;
214
- return c = u ? (u - 1) * l + (o + 1) : o + 1, r[t] && (r[t] = i(`${c}`, r[t])), r.sortIndex = c, r;
213
+ const l = O(t) && t.current || 1, u = O(t) && t.pageSize || 10;
214
+ return c = l ? (l - 1) * u + (o + 1) : o + 1, i[n] && (i[n] = r(`${c}`, i[n])), i.sortIndex = c, i;
215
215
  });
216
216
  }
217
- function $e(e, n, t, i) {
218
- const r = e[t], o = n[t];
217
+ function je(e, t, n, r) {
218
+ const i = e[n], o = t[n];
219
219
  let c = 0;
220
- return r < o ? c = i === 0 ? -1 : 0 : r > o && (c = i === 0 ? 0 : -1), c;
220
+ return i < o ? c = r === 0 ? -1 : 0 : i > o && (c = r === 0 ? 0 : -1), c;
221
221
  }
222
222
  function Ee(e) {
223
- let n = B(e);
224
- const t = new Set(n);
225
- return n = Array.from(t), n;
226
- }
227
- function Le(e, n) {
228
- const t = ["null", "undefined"];
229
- let i = !0;
230
- return e === 0 ? i = !0 : t.includes(e) ? i = !1 : e || (i = !1), i ? {
223
+ let t = B(e);
224
+ const n = new Set(t);
225
+ return t = Array.from(n), t;
226
+ }
227
+ function Re(e, t) {
228
+ const n = ["null", "undefined"];
229
+ let r = !0;
230
+ return e === 0 ? r = !0 : n.includes(e) ? r = !1 : e || (r = !1), r ? {
231
231
  value: e,
232
- success: i
232
+ success: r
233
233
  } : {
234
- value: n === "" ? n : n || "-",
235
- success: i
234
+ value: t === "" ? t : t || "-",
235
+ success: r
236
236
  };
237
237
  }
238
- function Re(e) {
239
- let n = "";
238
+ function Le(e) {
239
+ let t = "";
240
240
  if (e > -1) {
241
- const t = Math.floor(e / 3600), i = Math.floor(e / 60) % 60, r = parseInt(String(e % 60));
242
- t < 10 ? n = "0" + t + ":" : n = t + ":", i < 10 && (n += "0"), n += i + ":", r < 10 && (n += "0"), n += r;
241
+ const n = Math.floor(e / 3600), r = Math.floor(e / 60) % 60, i = parseInt(String(e % 60));
242
+ n < 10 ? t = "0" + n + ":" : t = n + ":", r < 10 && (t += "0"), t += r + ":", i < 10 && (t += "0"), t += i;
243
243
  }
244
- return n.split(":")[0] === "00" ? `${n.split(":")[1]}:${n.split(":")[2]}` : n;
244
+ return t.split(":")[0] === "00" ? `${t.split(":")[1]}:${t.split(":")[2]}` : t;
245
245
  }
246
- function ne() {
246
+ function re() {
247
247
  const e = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");
248
248
  return {
249
- uuid(n, t) {
250
- const i = e, r = [], o = t || i.length;
251
- let c, u;
252
- if (n)
253
- for (c = 0; c < n; c += 1)
254
- r[c] = i[parseInt(String(Math.random() * o))];
249
+ uuid(t, n) {
250
+ const r = e, i = [], o = n || r.length;
251
+ let c, l;
252
+ if (t)
253
+ for (c = 0; c < t; c += 1)
254
+ i[c] = r[parseInt(String(Math.random() * o))];
255
255
  else
256
- for (r[8] = "-", r[13] = "-", r[18] = "-", r[23] = "-", r[14] = "4", c = 0; c < 36; c += 1)
257
- r[c] || (u = Math.random() * 16, r[c] = i[c === 19 ? u && 3 || 8 : u]);
258
- return r.join("");
256
+ for (i[8] = "-", i[13] = "-", i[18] = "-", i[23] = "-", i[14] = "4", c = 0; c < 36; c += 1)
257
+ i[c] || (l = Math.random() * 16, i[c] = r[c === 19 ? l && 3 || 8 : l]);
258
+ return i.join("");
259
259
  },
260
260
  uuidFast() {
261
- const n = e, t = new Array(36);
262
- let i = 0, r, o;
261
+ const t = e, n = new Array(36);
262
+ let r = 0, i, o;
263
263
  for (o = 0; o < 36; o += 1)
264
- o === 8 || o === 13 || o === 18 || o === 23 ? t[o] = "-" : o === 14 ? t[o] = "4" : (i <= 2 && (i = 33554432 + Math.random() * 16777216 || 0), r = i && 15, i = i > 4, t[o] = n[o === 19 ? r && 3 || 8 : r]);
265
- return t.join("");
264
+ o === 8 || o === 13 || o === 18 || o === 23 ? n[o] = "-" : o === 14 ? n[o] = "4" : (r <= 2 && (r = 33554432 + Math.random() * 16777216 || 0), i = r && 15, r = r > 4, n[o] = t[o === 19 ? i && 3 || 8 : i]);
265
+ return n.join("");
266
266
  },
267
267
  uuidString() {
268
268
  return this.uuidFast().replace(new RegExp("-", "g"), "");
269
269
  },
270
270
  uuidCompact() {
271
- return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (n) => {
272
- const t = Math.random() * 16 || 0;
273
- return (n === "x" ? t : t && 3 || 8).toString(16);
271
+ return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (t) => {
272
+ const n = Math.random() * 16 || 0;
273
+ return (t === "x" ? n : n && 3 || 8).toString(16);
274
274
  });
275
275
  }
276
276
  };
277
277
  }
278
278
  function Ie(e = []) {
279
- let n = 0;
280
- function t(i = [], r) {
281
- i.forEach((o) => {
282
- o.floor = r, r > n && (n = r), o.children && o.children.length > 0 && t(o.children, r + 1);
279
+ let t = 0;
280
+ function n(r = [], i) {
281
+ r.forEach((o) => {
282
+ o.floor = i, i > t && (t = i), o.children && o.children.length > 0 && n(o.children, i + 1);
283
283
  });
284
284
  }
285
- return t(e, 1), n;
285
+ return n(e, 1), t;
286
286
  }
287
- function ie(e, n = "children") {
288
- let t = [];
289
- return e.forEach((i) => {
290
- t.push(i), i[n] && i[n].length > 0 && (t = t.concat(ie(i[n])));
291
- }), t;
287
+ function ie(e, t = "children") {
288
+ let n = [];
289
+ return e.forEach((r) => {
290
+ n.push(r), r[t] && r[t].length > 0 && (n = n.concat(ie(r[t])));
291
+ }), n;
292
292
  }
293
- function Be(e, n, t, i, r) {
294
- n = n || "id", t = t || "parentId", i = i || "children", r = r || 0;
293
+ function Be(e, t, n, r, i) {
294
+ t = t || "id", n = n || "parentId", r = r || "children", i = i || 0;
295
295
  const o = JSON.parse(JSON.stringify(e));
296
296
  return o.filter((c) => {
297
- const u = o.filter((l) => c[n] === l[t || "parentId"]);
298
- return u.length > 0 ? c[i || "children"] = u : delete c[i || "children"], c[t || "parentId"] === r;
297
+ const l = o.filter((u) => c[t] === u[n || "parentId"]);
298
+ return l.length > 0 ? c[r || "children"] = l : delete c[r || "children"], c[n || "parentId"] === i;
299
299
  });
300
300
  }
301
301
  function De(e) {
302
302
  return URL.createObjectURL(e);
303
303
  }
304
304
  function Ue(e) {
305
- return new Promise((n, t) => {
306
- const i = new FileReader();
307
- i.readAsDataURL(e), i.onload = () => n(i.result), i.onerror = (r) => t(r);
305
+ return new Promise((t, n) => {
306
+ const r = new FileReader();
307
+ r.readAsDataURL(e), r.onload = () => t(r.result), r.onerror = (i) => n(i);
308
308
  });
309
309
  }
310
- function je(e) {
311
- const n = e.split(","), t = n[0].match(/:(.*?);/)[1], i = atob(n[1]);
312
- let r = i.length;
313
- const o = new Uint8Array(r);
314
- for (; r--; )
315
- o[r] = i.charCodeAt(r);
316
- return new Blob([o], { type: t });
317
- }
318
- function Pe(e, n) {
319
- const t = e.split(","), i = t[0].match(/:(.*?);/)[1], r = atob(t[1]);
320
- let o = r.length;
310
+ function Pe(e) {
311
+ const t = e.split(","), n = t[0].match(/:(.*?);/)[1], r = atob(t[1]);
312
+ let i = r.length;
313
+ const o = new Uint8Array(i);
314
+ for (; i--; )
315
+ o[i] = r.charCodeAt(i);
316
+ return new Blob([o], { type: n });
317
+ }
318
+ function Me(e, t) {
319
+ const n = e.split(","), r = n[0].match(/:(.*?);/)[1], i = atob(n[1]);
320
+ let o = i.length;
321
321
  const c = new Uint8Array(o);
322
322
  for (; o--; )
323
- c[o] = r.charCodeAt(o);
324
- return new File([c], n, { type: i });
323
+ c[o] = i.charCodeAt(o);
324
+ return new File([c], t, { type: r });
325
325
  }
326
- function Ne(e, n, t) {
327
- return new window.File([e], n, { type: t });
326
+ function Ne(e, t, n) {
327
+ return new window.File([e], t, { type: n });
328
328
  }
329
- function re(e = "") {
330
- const n = e.indexOf("?");
331
- return n > 0 ? `${e.substring(0, n)}` : e;
329
+ function oe(e = "") {
330
+ const t = e.indexOf("?");
331
+ return t > 0 ? `${e.substring(0, t)}` : e;
332
332
  }
333
- function A(e = "") {
334
- e = re(e);
335
- const n = e.lastIndexOf(".");
336
- return n > 0 ? `${e.substring(n).split("?")[0]}`.split(".")[1] : "";
333
+ function T(e = "") {
334
+ e = oe(e);
335
+ const t = e.lastIndexOf(".");
336
+ return t > 0 ? `${e.substring(t).split("?")[0]}`.split(".")[1] : "";
337
337
  }
338
- function y(e, n) {
339
- if (n)
340
- return n;
338
+ function y(e, t) {
339
+ if (t)
340
+ return t;
341
341
  if (!e || e === "data:")
342
342
  return "4";
343
- let t = "4";
344
- return F(e) ? e.includes("data:image/") ? t = "png" : e.includes("data:video/") ? t = "mp4" : e.includes("data:audio/") && (t = "mp3") : e instanceof Blob ? (e = String(e), e.includes("image") ? t = "png" : e.includes("video") ? t = "mp4" : e.includes("audio") && (t = "mp3")) : t = A(e).toLowerCase(), w.imageType.includes(t) ? "1" : w.videoType.includes(t) ? "3" : w.audioType.includes(t) ? "2" : "4";
343
+ let n = "4";
344
+ return F(e) ? e.includes("data:image/") ? n = "png" : e.includes("data:video/") ? n = "mp4" : e.includes("data:audio/") && (n = "mp3") : e instanceof Blob ? (e = String(e), e.includes("image") ? n = "png" : e.includes("video") ? n = "mp4" : e.includes("audio") && (n = "mp3")) : n = T(e).toLowerCase(), p.imageType.includes(n) ? "1" : p.videoType.includes(n) ? "3" : p.audioType.includes(n) ? "2" : "4";
345
345
  }
346
- function oe(e) {
347
- const { url: n = "", fileType: t = "1" } = e;
348
- let i = "";
349
- return n instanceof File ? i = URL.createObjectURL(n) : F(n) ? i = n : n instanceof Blob ? i = URL.createObjectURL(n) : (n.includes("https") || n.includes("http")) && (i = n), new Promise(function(r) {
346
+ function ce(e) {
347
+ const { url: t = "", fileType: n = "1" } = e;
348
+ let r = "";
349
+ return t instanceof File ? r = URL.createObjectURL(t) : F(t) ? r = t : t instanceof Blob ? r = URL.createObjectURL(t) : (t.includes("https") || t.includes("http")) && (r = t), new Promise(function(i) {
350
350
  let o;
351
- t === "1" ? (o = document.createElement("img"), o.src = i) : t === "2" ? (o = document.createElement("audio"), o.src = i) : t === "3" && (o = document.createElement("video"), o.src = i), t === "1" ? o.onload = function() {
352
- r({
351
+ n === "1" ? (o = document.createElement("img"), o.src = r) : n === "2" ? (o = document.createElement("audio"), o.src = r) : n === "3" && (o = document.createElement("video"), o.src = r), n === "1" ? o.onload = function() {
352
+ i({
353
353
  play: !0,
354
354
  width: o.width || 0,
355
355
  height: o.height || 0
356
356
  }), o = null;
357
357
  } : o.oncanplay = function() {
358
- r({
358
+ i({
359
359
  play: !0,
360
360
  duration: o.duration,
361
361
  width: (o == null ? void 0 : o.videoWidth) || 0,
362
362
  height: (o == null ? void 0 : o.videoHeight) || 0
363
363
  }), o = null;
364
364
  }, o.onerror = function() {
365
- r({
365
+ i({
366
366
  play: !1
367
367
  }), o = null;
368
368
  };
369
369
  });
370
370
  }
371
- async function Me(e) {
372
- const { url: n = "", currentTime: t, videoSuffix: i = "", vidoeAllowPlay: r = !1 } = e;
373
- let o = "", c = i, u = "1", l;
374
- return n instanceof File ? (o = URL.createObjectURL(n), c = A(n.name), u = y(n.name)) : n instanceof Blob ? (o = URL.createObjectURL(n), u = y(n)) : F(n) ? (o = n, u = y(n)) : (n.includes("https") || n.includes("http")) && (o = n, c = A(n), u = y(n)), (c ? w.videoAllowType.includes(c.toLowerCase()) : !1) ? r ? $(o, t) : (l = await oe({
371
+ async function ze(e) {
372
+ const { url: t = "", currentTime: n, videoSuffix: r = "", vidoeAllowPlay: i = !1 } = e;
373
+ let o = "", c = r, l = "1", u;
374
+ return t instanceof File ? (o = URL.createObjectURL(t), c = T(t.name), l = y(t.name)) : t instanceof Blob ? (o = URL.createObjectURL(t), l = y(t)) : F(t) ? (o = t, l = y(t)) : (t.includes("https") || t.includes("http")) && (o = t, c = T(t), l = y(t)), (c ? p.videoAllowType.includes(c.toLowerCase()) : !1) ? i ? j(o, n) : (u = await ce({
375
375
  url: o,
376
- fileType: u
377
- }), l.play ? $(o, t) : new Promise(function(a) {
378
- a("");
379
- })) : new Promise(function(a) {
380
- a("");
376
+ fileType: l
377
+ }), u.play ? j(o, n) : new Promise(function(f) {
378
+ f("");
379
+ })) : new Promise(function(f) {
380
+ f("");
381
381
  });
382
382
  }
383
- async function $(e, n) {
384
- let t = document.createElement("video");
385
- t.style.display = "none", t.controls = !0, t.muted = !0, n && (t.currentTime = n), t.setAttribute("src", e), t.setAttribute("muted", String(!0)), t.setAttribute("crossorigin", "anonymous"), t.setAttribute("autoplay", String(!0));
386
- const i = document.createElement("canvas"), r = 0.8, o = 100, c = i.getContext("2d");
387
- return new Promise(function(u) {
388
- t && t.addEventListener("canplay", function() {
383
+ async function j(e, t) {
384
+ let n = document.createElement("video");
385
+ n.style.display = "none", n.controls = !0, n.muted = !0, t && (n.currentTime = t), n.setAttribute("src", e), n.setAttribute("muted", String(!0)), n.setAttribute("crossorigin", "anonymous"), n.setAttribute("autoplay", String(!0));
386
+ const r = document.createElement("canvas"), i = 0.8, o = 100, c = r.getContext("2d");
387
+ return new Promise(function(l) {
388
+ n && n.addEventListener("canplay", function() {
389
389
  setTimeout(function() {
390
- const l = (t == null ? void 0 : t.videoWidth) || 0 * r, s = (t == null ? void 0 : t.videoHeight) || 0 * r, a = 0;
391
- i.width = (t == null ? void 0 : t.videoWidth) || 0 * r, i.height = (t == null ? void 0 : t.videoHeight) || 0 * r, c.drawImage(t, 0, 0, l + a, s + a), t = null, u(l === 0 || s === 0 ? "" : i.toDataURL("image/png", 1));
390
+ const u = (n == null ? void 0 : n.videoWidth) || 0 * i, s = (n == null ? void 0 : n.videoHeight) || 0 * i, f = 0;
391
+ r.width = (n == null ? void 0 : n.videoWidth) || 0 * i, r.height = (n == null ? void 0 : n.videoHeight) || 0 * i, c.drawImage(n, 0, 0, u + f, s + f), n = null, l(u === 0 || s === 0 ? "" : r.toDataURL("image/png", 1));
392
392
  }, o);
393
393
  }, !1);
394
394
  });
@@ -398,18 +398,18 @@ function F(e = "") {
398
398
  "data:image/",
399
399
  "data:video/",
400
400
  "data:audio/"
401
- ].find((t) => e.includes(t)));
401
+ ].find((n) => e.includes(n)));
402
402
  }
403
- function He(e, n, t, i = !1) {
404
- e && n && t && e.addEventListener(n, t, i);
403
+ function ke(e, t, n, r = !1) {
404
+ e && t && n && e.addEventListener(t, n, r);
405
405
  }
406
- function ze(e, n, t, i = !1) {
407
- e && n && t && e.removeEventListener(n, t, i);
406
+ function He(e, t, n, r = !1) {
407
+ e && t && n && e.removeEventListener(t, n, r);
408
408
  }
409
- const We = N({
409
+ const _e = N({
410
410
  props: {
411
- id: v.string,
412
- style: v.style,
411
+ id: S.string,
412
+ style: S.style,
413
413
  size: {
414
414
  type: String,
415
415
  default: "middle"
@@ -428,180 +428,255 @@ const We = N({
428
428
  onClear: Function,
429
429
  onLabelClick: Function,
430
430
  formatter: Function,
431
- value: v.any
431
+ value: S.any
432
432
  },
433
433
  setup(e, {
434
- expose: n
434
+ expose: t
435
435
  }) {
436
- const t = I({
436
+ const n = I({
437
437
  suffixCls: "core-field-label",
438
438
  isPor: !0
439
- }), i = C(), r = C(), o = M(() => e.allowClear || !0);
440
- n({
441
- labelRef: i,
442
- clearRef: r
439
+ }), r = $(), i = $(), o = z(() => e.allowClear || !0);
440
+ t({
441
+ labelRef: r,
442
+ clearRef: i
443
443
  });
444
- const c = (l) => e.formatter ? e.formatter(l) : Array.isArray(l) ? l.join(",") : String(l), u = (l, s) => {
445
- var a, d;
444
+ const c = (u) => e.formatter ? e.formatter(u) : Array.isArray(u) ? u.join(",") : String(u), l = (u, s) => {
445
+ var f, d;
446
446
  if (s != null && s !== "" && (!Array.isArray(s) || s.length)) {
447
- const p = H(s), O = l ? f("span", {
447
+ const x = k(s), C = u ? a("span", {
448
448
  onClick: e.onLabelClick,
449
- class: `${t}-text`
450
- }, [l, ": "]) : "", m = p ? "" : c(s);
449
+ class: `${n}-text`
450
+ }, [u, ": "]) : "", g = x ? "" : c(s);
451
451
  if (!e.ellipsis)
452
- return f("span", {
452
+ return a("span", {
453
453
  style: {
454
454
  display: "inline-flex",
455
455
  alignItems: "center"
456
456
  }
457
- }, [O, p ? s : c(s)]);
457
+ }, [C, x ? s : c(s)]);
458
458
  const D = 41, U = (() => {
459
- const j = Array.isArray(s) && s.length > 1, P = "\u9879";
460
- return m.length > 32 && j ? `...${s.length}${P}` : "";
459
+ const P = Array.isArray(s) && s.length > 1, M = "\u9879";
460
+ return g.length > 32 && P ? `...${s.length}${M}` : "";
461
461
  })();
462
- return f("span", {
463
- title: p ? "" : m,
462
+ return a("span", {
463
+ title: x ? "" : g,
464
464
  style: {
465
465
  display: "inline-flex",
466
466
  alignItems: "center"
467
467
  }
468
- }, [O, f("span", {
468
+ }, [C, a("span", {
469
469
  style: {
470
470
  paddingInlineStart: 4
471
471
  }
472
- }, [typeof m == "string" ? (d = (a = m == null ? void 0 : m.toString()) == null ? void 0 : a.substr) == null ? void 0 : d.call(a, 0, D) : s]), U]);
472
+ }, [typeof g == "string" ? (d = (f = g == null ? void 0 : g.toString()) == null ? void 0 : f.substr) == null ? void 0 : d.call(f, 0, D) : s]), U]);
473
473
  }
474
- return l || e.placeholder;
474
+ return u || e.placeholder;
475
475
  };
476
- return () => f("span", {
476
+ return () => a("span", {
477
477
  class: {
478
- [`${t}`]: !0,
479
- [`${t}-${e.size}`]: e.size,
480
- [`${t}-active`]: !!e.value || e.value === 0,
481
- [`${t}-disabled`]: e.disabled,
482
- [`${t}-bordered`]: e.bordered,
483
- [`${t}-allow-clear`]: o.value,
478
+ [`${n}`]: !0,
479
+ [`${n}-${e.size}`]: e.size,
480
+ [`${n}-active`]: !!e.value || e.value === 0,
481
+ [`${n}-disabled`]: e.disabled,
482
+ [`${n}-bordered`]: e.bordered,
483
+ [`${n}-allow-clear`]: o.value,
484
484
  [`${e.class}`]: e.class
485
485
  },
486
486
  style: e.style,
487
- ref: i
488
- }, [u(e.label, e.value), (e.value || e.value === 0) && o.value && f(_, {
487
+ ref: r
488
+ }, [l(e.label, e.value), (e.value || e.value === 0) && o.value && a(q, {
489
489
  role: "button",
490
490
  title: "\u6E05\u9664",
491
- class: [`${t}-icon`, `${t}-close`],
492
- onClick: (l) => {
493
- e.onClear && !e.disabled && e.onClear(), l.stopPropagation();
491
+ class: [`${n}-icon`, `${n}-close`],
492
+ onClick: (u) => {
493
+ e.onClear && !e.disabled && e.onClear(), u.stopPropagation();
494
494
  },
495
- ref: r
496
- }, null), f(q, {
497
- class: [`${t}-icon`, `${t}-arrow`]
495
+ ref: i
496
+ }, null), a(W, {
497
+ class: [`${n}-icon`, `${n}-arrow`]
498
498
  }, null)]);
499
499
  }
500
500
  });
501
- const _e = (e) => {
501
+ const qe = (e) => {
502
502
  if (!e.tooltip && !e.subTitle)
503
- return f(z, null, [e.label]);
504
- const n = I({
503
+ return a(H, null, [e.label]);
504
+ const t = I({
505
505
  suffixCls: "core-label-tip",
506
506
  isPor: !0
507
- }), t = typeof e.tooltip == "string" ? {
507
+ }), n = typeof e.tooltip == "string" ? {
508
508
  title: e.tooltip
509
- } : e.tooltip, i = (t == null ? void 0 : t.icon) || f(J, null, null);
510
- return f("div", {
511
- class: n,
512
- onMousedown: (r) => r.stopPropagation(),
513
- onMouseleave: (r) => r.stopPropagation(),
514
- onMousemove: (r) => r.stopPropagation()
515
- }, [f("div", {
509
+ } : e.tooltip, r = (n == null ? void 0 : n.icon) || a(J, null, null);
510
+ return a("div", {
511
+ class: t,
512
+ onMousedown: (i) => i.stopPropagation(),
513
+ onMouseleave: (i) => i.stopPropagation(),
514
+ onMousemove: (i) => i.stopPropagation()
515
+ }, [a("div", {
516
516
  class: {
517
- [`${n}-title`]: !0,
518
- [`${n}-title-ellipsis`]: e.ellipsis
517
+ [`${t}-title`]: !0,
518
+ [`${t}-title-ellipsis`]: e.ellipsis
519
519
  }
520
- }, [e.label]), e.subTitle && f("div", {
521
- class: `${n}-subtitle`
522
- }, [e.subTitle]), e.tooltip && f(X, t, {
523
- default: () => [f("span", {
524
- class: `${n}-icon`
525
- }, [i])]
520
+ }, [e.label]), e.subTitle && a("div", {
521
+ class: `${t}-subtitle`
522
+ }, [e.subTitle]), e.tooltip && a(V, n, {
523
+ default: () => [a("span", {
524
+ class: `${t}-icon`
525
+ }, [r])]
526
526
  })]);
527
- }, ce = typeof process < "u" && process.versions != null && process.versions.node != null, qe = () => process.env.NODE_ENV === "TEST" ? !0 : typeof window < "u" && typeof window.document < "u" && typeof window.matchMedia < "u" && !ce, Je = (e) => {
527
+ }, We = (...e) => {
528
+ const t = {}, n = e.length;
529
+ let r, i = 0;
530
+ for (; i < n; i += 1)
531
+ for (r in e[i])
532
+ e[i].hasOwnProperty(r) && (typeof t[r] == "object" && typeof e[i][r] == "object" && t[r] !== void 0 && t[r] !== null && !Array.isArray(t[r]) && !Array.isArray(e[i][r]) ? t[r] = {
533
+ ...t[r],
534
+ ...e[i][r]
535
+ } : t[r] = e[i][r]);
536
+ return t;
537
+ };
538
+ function b(e, t, n, r) {
539
+ if (e === t)
540
+ return !0;
541
+ if (e && t && typeof e == "object" && typeof t == "object") {
542
+ if (e.constructor !== t.constructor)
543
+ return !1;
544
+ let i, o, c;
545
+ if (Array.isArray(e)) {
546
+ if (i = e.length, i != t.length)
547
+ return !1;
548
+ for (o = i; o-- !== 0; )
549
+ if (!b(e[o], t[o], n, r))
550
+ return !1;
551
+ return !0;
552
+ }
553
+ if (e instanceof Map && t instanceof Map) {
554
+ if (e.size !== t.size)
555
+ return !1;
556
+ for (o of e.entries())
557
+ if (!t.has(o[0]))
558
+ return !1;
559
+ for (o of e.entries())
560
+ if (!b(o[1], t.get(o[0]), n, r))
561
+ return !1;
562
+ return !0;
563
+ }
564
+ if (e instanceof Set && t instanceof Set) {
565
+ if (e.size !== t.size)
566
+ return !1;
567
+ for (o of e.entries())
568
+ if (!t.has(o[0]))
569
+ return !1;
570
+ return !0;
571
+ }
572
+ if (ArrayBuffer.isView(e) && ArrayBuffer.isView(t)) {
573
+ if (i = e.length, i != t.length)
574
+ return !1;
575
+ for (o = i; o-- !== 0; )
576
+ if (e[o] !== t[o])
577
+ return !1;
578
+ return !0;
579
+ }
580
+ if (e.constructor === RegExp)
581
+ return e.source === t.source && e.flags === t.flags;
582
+ if (e.valueOf !== Object.prototype.valueOf && e.valueOf)
583
+ return e.valueOf() === t.valueOf();
584
+ if (e.toString !== Object.prototype.toString && e.toString)
585
+ return e.toString() === t.toString();
586
+ if (c = Object.keys(e), i = c.length, i !== Object.keys(t).length)
587
+ return !1;
588
+ for (o = i; o-- !== 0; )
589
+ if (!Object.prototype.hasOwnProperty.call(t, c[o]))
590
+ return !1;
591
+ for (o = i; o-- !== 0; ) {
592
+ const l = c[o];
593
+ if (!(n != null && n.includes(l)) && !(l === "_owner" && e.$$typeof) && !b(e[l], t[l], n, r))
594
+ return r && console.log(l), !1;
595
+ }
596
+ return !0;
597
+ }
598
+ return e !== e && t !== t;
599
+ }
600
+ const le = typeof process < "u" && process.versions != null && process.versions.node != null, Je = () => process.env.NODE_ENV === "TEST" ? !0 : typeof window < "u" && typeof window.document < "u" && typeof window.matchMedia < "u" && !le, Xe = (e) => {
528
601
  if (e && e !== !0)
529
602
  return e;
530
- }, ke = (e) => {
531
- const n = {};
532
- if (Object.keys(e || {}).forEach((t) => {
533
- e[t] !== void 0 && (n[t] = e[t]);
534
- }), !(Object.keys(n).length < 1))
535
- return n;
536
- }, le = (e) => e.length === 1 && (String(e[0].type) === String(Symbol("Comment")) || String(e[0].type) === String(Symbol("Fragment")) || String(e[0].type) === String(Symbol()));
537
- function Xe(e) {
538
- return le(e) ? e[0].children : e;
539
- }
540
- function Ge(e, n, t = "default") {
541
- return n[t] === !1 ? !1 : R(n[t]) && n[t] ? (e == null ? void 0 : e[t]) || n[t] : n[t] || e[t];
542
- }
543
- function ue(e, n, t = "default") {
544
- var i, r;
545
- return n[t] === !1 ? !1 : R(n[t]) && n[t] ? ((i = e == null ? void 0 : e[t]) == null ? void 0 : i.call(e)) || n[t] : n[t] || ((r = e[t]) == null ? void 0 : r.call(e));
546
- }
547
- function Ye(e, n, t) {
548
- const i = {};
549
- return e.forEach((r) => {
550
- i[r] = ue(n, t, r);
551
- }), i;
603
+ }, Ve = (e) => {
604
+ const t = {};
605
+ if (Object.keys(e || {}).forEach((n) => {
606
+ e[n] !== void 0 && (t[n] = e[n]);
607
+ }), !(Object.keys(t).length < 1))
608
+ return t;
609
+ }, ue = (e) => e.length === 1 && (String(e[0].type) === String(Symbol("Comment")) || String(e[0].type) === String(Symbol("Fragment")) || String(e[0].type) === String(Symbol()));
610
+ function Ge(e) {
611
+ return ue(e) ? e[0].children : e;
612
+ }
613
+ function Ye(e, t, n = "default") {
614
+ return t[n] === !1 ? !1 : L(t[n]) && t[n] ? (e == null ? void 0 : e[n]) || t[n] : t[n] || e[n];
615
+ }
616
+ function se(e, t, n = "default") {
617
+ var r, i;
618
+ return t[n] === !1 ? !1 : L(t[n]) && t[n] ? ((r = e == null ? void 0 : e[n]) == null ? void 0 : r.call(e)) || t[n] : t[n] || ((i = e[n]) == null ? void 0 : i.call(e));
619
+ }
620
+ function Qe(e, t, n) {
621
+ const r = {};
622
+ return e.forEach((i) => {
623
+ r[i] = se(t, n, i);
624
+ }), r;
552
625
  }
553
626
  export {
554
- We as FieldLabel,
555
- _e as LabelIconTip,
627
+ _e as FieldLabel,
628
+ qe as LabelIconTip,
556
629
  Ee as arrayRepeat,
557
630
  Ne as blobToDataURL,
558
631
  y as checkFileType,
559
- $e as compareArray,
560
- je as dataURLtoBlob,
561
- Pe as dataURLtoFile,
632
+ je as compareArray,
633
+ Pe as dataURLtoBlob,
634
+ Me as dataURLtoFile,
562
635
  B as deepCopy,
563
- Re as formatDuraton,
564
- Te as genColumnKey,
565
- $ as generateVidoePicture,
636
+ Le as formatDuraton,
637
+ Oe as genColumnKey,
638
+ j as generateVidoePicture,
566
639
  Ue as getBase64,
567
640
  De as getBlobUrl,
568
- A as getFileSuffix,
641
+ T as getFileSuffix,
569
642
  ie as getLevelData,
570
643
  Ie as getMaxFloor,
571
- oe as getMediaInfos,
644
+ ce as getMediaInfos,
572
645
  I as getPrefixCls,
573
- ne as getRandomNumber,
574
- Xe as getRealVNode,
575
- K as getScroll,
576
- ye as getScrollContainer,
577
- Ge as getSlot,
578
- ue as getSlotVNode,
579
- Ye as getSlotsProps,
580
- Ce as getSortIndex,
581
- Me as getVideoCoverPicture,
582
- re as getVideoFileUrl,
583
- Oe as handleCurrentPage,
584
- Ae as handleShowIndex,
585
- Le as hanndleField,
586
- L as is,
587
- be as isArray,
646
+ re as getRandomNumber,
647
+ Ge as getRealVNode,
648
+ ee as getScroll,
649
+ pe as getScrollContainer,
650
+ Ye as getSlot,
651
+ se as getSlotVNode,
652
+ Qe as getSlotsProps,
653
+ $e as getSortIndex,
654
+ ze as getVideoCoverPicture,
655
+ oe as getVideoFileUrl,
656
+ Ce as handleCurrentPage,
657
+ Te as handleShowIndex,
658
+ Re as hanndleField,
659
+ R as is,
660
+ Se as isArray,
588
661
  F as isBase64,
589
- R as isBoolean,
590
- qe as isBrowser,
591
- Se as isFunction,
592
- we as isInContainer,
593
- pe as isNumber,
594
- T as isObject,
595
- V as isScroll,
596
- h as isServer,
597
- le as isSlotFragment,
598
- ve as isString,
599
- ze as off,
600
- Je as omitBoolean,
601
- ke as omitUndefined,
602
- He as on,
662
+ L as isBoolean,
663
+ Je as isBrowser,
664
+ b as isDeepEqualReact,
665
+ Ae as isFunction,
666
+ he as isInContainer,
667
+ ve as isNumber,
668
+ O as isObject,
669
+ Z as isScroll,
670
+ w as isServer,
671
+ ue as isSlotFragment,
672
+ be as isString,
673
+ We as merge,
674
+ He as off,
675
+ Xe as omitBoolean,
676
+ Ve as omitUndefined,
677
+ ke as on,
603
678
  Fe as runFunction,
604
- xe as scrollTo,
605
- he as throttleByAnimationFrame,
679
+ we as scrollTo,
680
+ xe as throttleByAnimationFrame,
606
681
  Be as treeData
607
682
  };
@@ -1 +1 @@
1
- (function(c,u){typeof exports=="object"&&typeof module<"u"?u(exports,require("vue"),require("vue-types"),require("@ant-design/icons-vue"),require("lodash-unified"),require("ant-design-vue")):typeof define=="function"&&define.amd?define(["exports","vue","vue-types","@ant-design/icons-vue","lodash-unified","ant-design-vue"],u):(c=typeof globalThis<"u"?globalThis:c||self,u(c.PorUtils={},c.vue,c.vueTypes,c.iconsVue,c.lodashUnified,c.antDesignVue$1))})(this,function(c,u,z,A,_,W){"use strict";const je="",Me="",Ve="",qe="",He="",ze="",h=typeof window>"u";process.env.NODE_ENV!=="production"&&Object.freeze({}),process.env.NODE_ENV!=="production"&&Object.freeze([]);const k=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},J=/-(\w)/g,X=k(e=>e.replace(J,(t,n)=>n?n.toUpperCase():"")),C=function(e,t){var n;if(h||!e||!t)return"";t=X(t),t==="float"&&(t="cssFloat");try{const i=e.style[t];if(i)return i;const r=(n=document==null?void 0:document.defaultView)==null?void 0:n.getComputedStyle(e,"");return r?r[t]:""}catch{return e.style[t]}},U=(e,t)=>h?void 0:(t==null?C(e,"overflow"):t?C(e,"overflow-y"):C(e,"overflow-x")).match(/(scroll|auto|overlay)/),G=(e,t)=>{if(h)return;let n=e;for(;n;){if([window,document,document.documentElement].includes(n))return window;if(U(n,t))return n;n=n.parentNode}return n},Y=(e,t)=>{if(h||!e||!t)return!1;const n=e.getBoundingClientRect();let i;return[window,document,document.documentElement,null,void 0].includes(t)?i={top:0,right:window.innerWidth,bottom:window.innerHeight,left:0}:i=t.getBoundingClientRect(),n.top<i.bottom&&n.bottom>i.top&&n.right>i.left&&n.left<i.right};let Q=0;const g={};function b(e,t=1){const n=Q++;let i=t;function r(){i-=1,i<=0?(e(),delete g[n]):g[n]=requestAnimationFrame(r)}return g[n]=requestAnimationFrame(r),n}b.cancel=function(t){t!==void 0&&(cancelAnimationFrame(g[t]),delete g[t])},b.ids=g;function p(e){return e!=null&&e===e.window}function $(e,t){var r;if(typeof window>"u")return 0;const n=t?"scrollTop":"scrollLeft";let i=0;return p(e)?i=e[t?"pageYOffset":"pageXOffset"]:e instanceof Document?i=e.documentElement[n]:e&&(i=e[n]),e&&!p(e)&&typeof i!="number"&&(i=(r=(e.ownerDocument||e).documentElement)==null?void 0:r[n]),i}function Z(e,t,n,i){const r=n-t;return e/=i/2,e<1?r/2*e*e*e+t:r/2*((e-=2)*e*e+2)+t}function K(e,t={}){const{getContainer:n=()=>window,callback:i,duration:r=450}=t,o=n(),l=$(o,!0),s=Date.now(),a=()=>{const f=Date.now()-s,m=Z(f>r?r:f,l,e,r);p(o)?o.scrollTo(window.pageXOffset,m):o instanceof HTMLDocument||o.constructor.name==="HTMLDocument"?o.documentElement.scrollTop=m:o.scrollTop=m,f<r?b(a):typeof i=="function"&&i()};b(a)}function ee(e){let t;const n=r=>()=>{t=null,e(...r)},i=(...r)=>{t==null&&(t=requestAnimationFrame(n(r)))};return i.cancel=()=>cancelAnimationFrame(t),i}var D=z.createTypes({func:void 0,bool:void 0,string:void 0,number:void 0,array:void 0,object:void 0,integer:void 0});D.extend([{name:"looseBool",getter:!0,type:Boolean,default:void 0},{name:"style",getter:!0,type:[String,Object],default:void 0},{name:"VueNode",getter:!0,type:null}]);const x=D,S={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"]},ne=Object.prototype.toString;function O(e,t){return ne.call(e)===`[object ${t}]`}function L(e){return O(e,"Boolean")}function te(e){return typeof e=="number"}function ie(e){return typeof Array.isArray>"u"?Object.prototype.toString.call(e)==="[object Array]":Array.isArray(e)}function v(e){return e!==null&&O(e,"Object")}function re(e){return typeof e=="string"||e instanceof String}function oe(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}const R=({suffixCls:e,customizePrefixCls:t,isPor:n,className:i})=>{const r=i||(n?"gx-pro":"gx");return t||(e?`${r}-${e}`:r)},ce=(e,t)=>e?Array.isArray(e)?e.join("-"):e.toString():`${t}`;function le(e,{align:t,showIndex:n}){const i=_.cloneDeep(e);if(n&&e.length&&e.every(r=>r.dataIndex!=="sortIndex")){const r=e[0];i.unshift({title:"\u5E8F\u53F7",align:t,fixed:r.fixed,width:60,uuid:E().uuid(15),dataIndex:"sortIndex",key:"sortIndex"})}else i.filter(r=>r.dataIndex!=="sortIndex");return i}function ae(e,...t){return typeof e=="function"?e(...t):e}function B(e){return JSON.parse(JSON.stringify(e))}function ue(e,t){if(v(e)){const{pageSize:n=10,total:i=0}=e;let{current:r=1}=e;return i-t<=n*(r-1)&&(r=r-1),r===0?1:r}return 1}function se(e=[],t,n="children"){function i(r,o){return o.map((l,s)=>{const a=`${r}-${s+1}`;return l[n]&&(l[n]=i(a,l[n])),l.sortIndex=a,l})}return B(e).map((r,o)=>{let l=o;const s=v(t)&&t.current||1,a=v(t)&&t.pageSize||10;return l=s?(s-1)*a+(o+1):o+1,r[n]&&(r[n]=i(`${l}`,r[n])),r.sortIndex=l,r})}function de(e,t,n,i){const r=e[n],o=t[n];let l=0;return r<o?l=i===0?-1:0:r>o&&(l=i===0?0:-1),l}function fe(e){let t=B(e);const n=new Set(t);return t=Array.from(n),t}function ge(e,t){const n=["null","undefined"];let i=!0;return e===0?i=!0:n.includes(e)?i=!1:e||(i=!1),i?{value:e,success:i}:{value:t===""?t:t||"-",success:i}}function me(e){let t="";if(e>-1){const n=Math.floor(e/3600),i=Math.floor(e/60)%60,r=parseInt(String(e%60));n<10?t="0"+n+":":t=n+":",i<10&&(t+="0"),t+=i+":",r<10&&(t+="0"),t+=r}return t.split(":")[0]==="00"?`${t.split(":")[1]}:${t.split(":")[2]}`:t}function E(){const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");return{uuid(t,n){const i=e,r=[],o=n||i.length;let l,s;if(t)for(l=0;l<t;l+=1)r[l]=i[parseInt(String(Math.random()*o))];else for(r[8]="-",r[13]="-",r[18]="-",r[23]="-",r[14]="4",l=0;l<36;l+=1)r[l]||(s=Math.random()*16,r[l]=i[l===19?s&&3||8:s]);return r.join("")},uuidFast(){const t=e,n=new Array(36);let i=0,r,o;for(o=0;o<36;o+=1)o===8||o===13||o===18||o===23?n[o]="-":o===14?n[o]="4":(i<=2&&(i=33554432+Math.random()*16777216||0),r=i&&15,i=i>4,n[o]=t[o===19?r&&3||8:r]);return n.join("")},uuidString(){return this.uuidFast().replace(new RegExp("-","g"),"")},uuidCompact(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const n=Math.random()*16||0;return(t==="x"?n:n&&3||8).toString(16)})}}}function ye(e=[]){let t=0;function n(i=[],r){i.forEach(o=>{o.floor=r,r>t&&(t=r),o.children&&o.children.length>0&&n(o.children,r+1)})}return n(e,1),t}function P(e,t="children"){let n=[];return e.forEach(i=>{n.push(i),i[t]&&i[t].length>0&&(n=n.concat(P(i[t])))}),n}function he(e,t,n,i,r){t=t||"id",n=n||"parentId",i=i||"children",r=r||0;const o=JSON.parse(JSON.stringify(e));return o.filter(l=>{const s=o.filter(a=>l[t]===a[n||"parentId"]);return s.length>0?l[i||"children"]=s:delete l[i||"children"],l[n||"parentId"]===r})}function we(e){return URL.createObjectURL(e)}function be(e){return new Promise((t,n)=>{const i=new FileReader;i.readAsDataURL(e),i.onload=()=>t(i.result),i.onerror=r=>n(r)})}function Se(e){const t=e.split(","),n=t[0].match(/:(.*?);/)[1],i=atob(t[1]);let r=i.length;const o=new Uint8Array(r);for(;r--;)o[r]=i.charCodeAt(r);return new Blob([o],{type:n})}function ve(e,t){const n=e.split(","),i=n[0].match(/:(.*?);/)[1],r=atob(n[1]);let o=r.length;const l=new Uint8Array(o);for(;o--;)l[o]=r.charCodeAt(o);return new File([l],t,{type:i})}function Te(e,t,n){return new window.File([e],t,{type:n})}function j(e=""){const t=e.indexOf("?");return t>0?`${e.substring(0,t)}`:e}function T(e=""){e=j(e);const t=e.lastIndexOf(".");return t>0?`${e.substring(t).split("?")[0]}`.split(".")[1]:""}function w(e,t){if(t)return t;if(!e||e==="data:")return"4";let n="4";return F(e)?e.includes("data:image/")?n="png":e.includes("data:video/")?n="mp4":e.includes("data:audio/")&&(n="mp3"):e instanceof Blob?(e=String(e),e.includes("image")?n="png":e.includes("video")?n="mp4":e.includes("audio")&&(n="mp3")):n=T(e).toLowerCase(),S.imageType.includes(n)?"1":S.videoType.includes(n)?"3":S.audioType.includes(n)?"2":"4"}function M(e){const{url:t="",fileType:n="1"}=e;let i="";return t instanceof File?i=URL.createObjectURL(t):F(t)?i=t:t instanceof Blob?i=URL.createObjectURL(t):(t.includes("https")||t.includes("http"))&&(i=t),new Promise(function(r){let o;n==="1"?(o=document.createElement("img"),o.src=i):n==="2"?(o=document.createElement("audio"),o.src=i):n==="3"&&(o=document.createElement("video"),o.src=i),n==="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:t="",currentTime:n,videoSuffix:i="",vidoeAllowPlay:r=!1}=e;let o="",l=i,s="1",a;return t instanceof File?(o=URL.createObjectURL(t),l=T(t.name),s=w(t.name)):t instanceof Blob?(o=URL.createObjectURL(t),s=w(t)):F(t)?(o=t,s=w(t)):(t.includes("https")||t.includes("http"))&&(o=t,l=T(t),s=w(t)),(l?S.videoAllowType.includes(l.toLowerCase()):!1)?r?I(o,n):(a=await M({url:o,fileType:s}),a.play?I(o,n):new Promise(function(f){f("")})):new Promise(function(f){f("")})}async function I(e,t){let n=document.createElement("video");n.style.display="none",n.controls=!0,n.muted=!0,t&&(n.currentTime=t),n.setAttribute("src",e),n.setAttribute("muted",String(!0)),n.setAttribute("crossorigin","anonymous"),n.setAttribute("autoplay",String(!0));const i=document.createElement("canvas"),r=.8,o=100,l=i.getContext("2d");return new Promise(function(s){n&&n.addEventListener("canplay",function(){setTimeout(function(){const a=(n==null?void 0:n.videoWidth)||0*r,d=(n==null?void 0:n.videoHeight)||0*r,f=0;i.width=(n==null?void 0:n.videoWidth)||0*r,i.height=(n==null?void 0:n.videoHeight)||0*r,l.drawImage(n,0,0,a+f,d+f),n=null,s(a===0||d===0?"":i.toDataURL("image/png",1))},o)},!1)})}function F(e=""){return!!(e&&["data:image/","data:video/","data:audio/"].find(n=>e.includes(n)))}function Ae(e,t,n,i=!1){e&&t&&n&&e.addEventListener(t,n,i)}function Ce(e,t,n,i=!1){e&&t&&n&&e.removeEventListener(t,n,i)}const _e="",pe=u.defineComponent({props:{id:x.string,style:x.style,size:{type:String,default:"middle"},label:Object,placeholder:[Object,String],class:String,ellipsis:Boolean,allowClear:{type:Boolean,default:!0},bordered:Boolean,expanded:Boolean,disabled:Boolean,onClear:Function,onLabelClick:Function,formatter:Function,value:x.any},setup(e,{expose:t}){const n=R({suffixCls:"core-field-label",isPor:!0}),i=u.ref(),r=u.ref(),o=u.computed(()=>e.allowClear||!0);t({labelRef:i,clearRef:r});const l=a=>e.formatter?e.formatter(a):Array.isArray(a)?a.join(","):String(a),s=(a,d)=>{var f,m;if(d!=null&&d!==""&&(!Array.isArray(d)||d.length)){const N=u.isVNode(d),H=a?u.createVNode("span",{onClick:e.onLabelClick,class:`${n}-text`},[a,": "]):"",y=N?"":l(d);if(!e.ellipsis)return u.createVNode("span",{style:{display:"inline-flex",alignItems:"center"}},[H,N?d:l(d)]);const $e=41,De=(()=>{const Ee=Array.isArray(d)&&d.length>1,Pe="\u9879";return y.length>32&&Ee?`...${d.length}${Pe}`:""})();return u.createVNode("span",{title:N?"":y,style:{display:"inline-flex",alignItems:"center"}},[H,u.createVNode("span",{style:{paddingInlineStart:4}},[typeof y=="string"?(m=(f=y==null?void 0:y.toString())==null?void 0:f.substr)==null?void 0:m.call(f,0,$e):d]),De])}return a||e.placeholder};return()=>u.createVNode("span",{class:{[`${n}`]:!0,[`${n}-${e.size}`]:e.size,[`${n}-active`]:!!e.value||e.value===0,[`${n}-disabled`]:e.disabled,[`${n}-bordered`]:e.bordered,[`${n}-allow-clear`]:o.value,[`${e.class}`]:e.class},style:e.style,ref:i},[s(e.label,e.value),(e.value||e.value===0)&&o.value&&u.createVNode(A.CloseOutlined,{role:"button",title:"\u6E05\u9664",class:[`${n}-icon`,`${n}-close`],onClick:a=>{e.onClear&&!e.disabled&&e.onClear(),a.stopPropagation()},ref:r},null),u.createVNode(A.DownOutlined,{class:[`${n}-icon`,`${n}-arrow`]},null)])}}),We="",xe=e=>{if(!e.tooltip&&!e.subTitle)return u.createVNode(u.Fragment,null,[e.label]);const t=R({suffixCls:"core-label-tip",isPor:!0}),n=typeof e.tooltip=="string"?{title:e.tooltip}:e.tooltip,i=(n==null?void 0:n.icon)||u.createVNode(A.InfoCircleOutlined,null,null);return u.createVNode("div",{class:t,onMousedown:r=>r.stopPropagation(),onMouseleave:r=>r.stopPropagation(),onMousemove:r=>r.stopPropagation()},[u.createVNode("div",{class:{[`${t}-title`]:!0,[`${t}-title-ellipsis`]:e.ellipsis}},[e.label]),e.subTitle&&u.createVNode("div",{class:`${t}-subtitle`},[e.subTitle]),e.tooltip&&u.createVNode(W.Tooltip,n,{default:()=>[u.createVNode("span",{class:`${t}-icon`},[i])]})])},Oe=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,Le=()=>process.env.NODE_ENV==="TEST"?!0:typeof window<"u"&&typeof window.document<"u"&&typeof window.matchMedia<"u"&&!Oe,Re=e=>{if(e&&e!==!0)return e},Be=e=>{const t={};if(Object.keys(e||{}).forEach(n=>{e[n]!==void 0&&(t[n]=e[n])}),!(Object.keys(t).length<1))return t},V=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 Ie(e){return V(e)?e[0].children:e}function Ne(e,t,n="default"){return t[n]===!1?!1:L(t[n])&&t[n]?(e==null?void 0:e[n])||t[n]:t[n]||e[n]}function q(e,t,n="default"){var i,r;return t[n]===!1?!1:L(t[n])&&t[n]?((i=e==null?void 0:e[n])==null?void 0:i.call(e))||t[n]:t[n]||((r=e[n])==null?void 0:r.call(e))}function Ue(e,t,n){const i={};return e.forEach(r=>{i[r]=q(t,n,r)}),i}c.FieldLabel=pe,c.LabelIconTip=xe,c.arrayRepeat=fe,c.blobToDataURL=Te,c.checkFileType=w,c.compareArray=de,c.dataURLtoBlob=Se,c.dataURLtoFile=ve,c.deepCopy=B,c.formatDuraton=me,c.genColumnKey=ce,c.generateVidoePicture=I,c.getBase64=be,c.getBlobUrl=we,c.getFileSuffix=T,c.getLevelData=P,c.getMaxFloor=ye,c.getMediaInfos=M,c.getPrefixCls=R,c.getRandomNumber=E,c.getRealVNode=Ie,c.getScroll=$,c.getScrollContainer=G,c.getSlot=Ne,c.getSlotVNode=q,c.getSlotsProps=Ue,c.getSortIndex=se,c.getVideoCoverPicture=Fe,c.getVideoFileUrl=j,c.handleCurrentPage=ue,c.handleShowIndex=le,c.hanndleField=ge,c.is=O,c.isArray=ie,c.isBase64=F,c.isBoolean=L,c.isBrowser=Le,c.isFunction=oe,c.isInContainer=Y,c.isNumber=te,c.isObject=v,c.isScroll=U,c.isServer=h,c.isSlotFragment=V,c.isString=re,c.off=Ce,c.omitBoolean=Re,c.omitUndefined=Be,c.on=Ae,c.runFunction=ae,c.scrollTo=K,c.throttleByAnimationFrame=ee,c.treeData=he,Object.defineProperties(c,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(l,f){typeof exports=="object"&&typeof module<"u"?f(exports,require("vue"),require("vue-types"),require("@ant-design/icons-vue"),require("lodash-unified"),require("ant-design-vue")):typeof define=="function"&&define.amd?define(["exports","vue","vue-types","@ant-design/icons-vue","lodash-unified","ant-design-vue"],f):(l=typeof globalThis<"u"?globalThis:l||self,f(l.PorUtils={},l.vue,l.vueTypes,l.iconsVue,l.lodashUnified,l.antDesignVue$1))})(this,function(l,f,H,O,_,W){"use strict";const Ve="",qe="",ze="",ke="",He="",_e="",h=typeof window>"u";process.env.NODE_ENV!=="production"&&Object.freeze({}),process.env.NODE_ENV!=="production"&&Object.freeze([]);const J=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},X=/-(\w)/g,G=J(e=>e.replace(X,(t,n)=>n?n.toUpperCase():"")),F=function(e,t){var n;if(h||!e||!t)return"";t=G(t),t==="float"&&(t="cssFloat");try{const i=e.style[t];if(i)return i;const r=(n=document==null?void 0:document.defaultView)==null?void 0:n.getComputedStyle(e,"");return r?r[t]:""}catch{return e.style[t]}},N=(e,t)=>h?void 0:(t==null?F(e,"overflow"):t?F(e,"overflow-y"):F(e,"overflow-x")).match(/(scroll|auto|overlay)/),Y=(e,t)=>{if(h)return;let n=e;for(;n;){if([window,document,document.documentElement].includes(n))return window;if(N(n,t))return n;n=n.parentNode}return n},Q=(e,t)=>{if(h||!e||!t)return!1;const n=e.getBoundingClientRect();let i;return[window,document,document.documentElement,null,void 0].includes(t)?i={top:0,right:window.innerWidth,bottom:window.innerHeight,left:0}:i=t.getBoundingClientRect(),n.top<i.bottom&&n.bottom>i.top&&n.right>i.left&&n.left<i.right};let Z=0;const g={};function S(e,t=1){const n=Z++;let i=t;function r(){i-=1,i<=0?(e(),delete g[n]):g[n]=requestAnimationFrame(r)}return g[n]=requestAnimationFrame(r),n}S.cancel=function(t){t!==void 0&&(cancelAnimationFrame(g[t]),delete g[t])},S.ids=g;function C(e){return e!=null&&e===e.window}function U(e,t){var r;if(typeof window>"u")return 0;const n=t?"scrollTop":"scrollLeft";let i=0;return C(e)?i=e[t?"pageYOffset":"pageXOffset"]:e instanceof Document?i=e.documentElement[n]:e&&(i=e[n]),e&&!C(e)&&typeof i!="number"&&(i=(r=(e.ownerDocument||e).documentElement)==null?void 0:r[n]),i}function K(e,t,n,i){const r=n-t;return e/=i/2,e<1?r/2*e*e*e+t:r/2*((e-=2)*e*e+2)+t}function ee(e,t={}){const{getContainer:n=()=>window,callback:i,duration:r=450}=t,o=n(),c=U(o,!0),u=Date.now(),a=()=>{const d=Date.now()-u,m=K(d>r?r:d,c,e,r);C(o)?o.scrollTo(window.pageXOffset,m):o instanceof HTMLDocument||o.constructor.name==="HTMLDocument"?o.documentElement.scrollTop=m:o.scrollTop=m,d<r?S(a):typeof i=="function"&&i()};S(a)}function te(e){let t;const n=r=>()=>{t=null,e(...r)},i=(...r)=>{t==null&&(t=requestAnimationFrame(n(r)))};return i.cancel=()=>cancelAnimationFrame(t),i}var D=H.createTypes({func:void 0,bool:void 0,string:void 0,number:void 0,array:void 0,object:void 0,integer:void 0});D.extend([{name:"looseBool",getter:!0,type:Boolean,default:void 0},{name:"style",getter:!0,type:[String,Object],default:void 0},{name:"VueNode",getter:!0,type:null}]);const x=D,b={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"]},ne=Object.prototype.toString;function R(e,t){return ne.call(e)===`[object ${t}]`}function j(e){return R(e,"Boolean")}function ie(e){return typeof e=="number"}function re(e){return typeof Array.isArray>"u"?Object.prototype.toString.call(e)==="[object Array]":Array.isArray(e)}function v(e){return e!==null&&R(e,"Object")}function oe(e){return typeof e=="string"||e instanceof String}function le(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}const B=({suffixCls:e,customizePrefixCls:t,isPor:n,className:i})=>{const r=i||(n?"gx-pro":"gx");return t||(e?`${r}-${e}`:r)},ce=(e,t)=>e?Array.isArray(e)?e.join("-"):e.toString():`${t}`;function ue(e,{align:t,showIndex:n}){const i=_.cloneDeep(e);if(n&&e.length&&e.every(r=>r.dataIndex!=="sortIndex")){const r=e[0];i.unshift({title:"\u5E8F\u53F7",align:t,fixed:r.fixed,width:60,uuid:E().uuid(15),dataIndex:"sortIndex",key:"sortIndex"})}else i.filter(r=>r.dataIndex!=="sortIndex");return i}function ae(e,...t){return typeof e=="function"?e(...t):e}function L(e){return JSON.parse(JSON.stringify(e))}function fe(e,t){if(v(e)){const{pageSize:n=10,total:i=0}=e;let{current:r=1}=e;return i-t<=n*(r-1)&&(r=r-1),r===0?1:r}return 1}function se(e=[],t,n="children"){function i(r,o){return o.map((c,u)=>{const a=`${r}-${u+1}`;return c[n]&&(c[n]=i(a,c[n])),c.sortIndex=a,c})}return L(e).map((r,o)=>{let c=o;const u=v(t)&&t.current||1,a=v(t)&&t.pageSize||10;return c=u?(u-1)*a+(o+1):o+1,r[n]&&(r[n]=i(`${c}`,r[n])),r.sortIndex=c,r})}function de(e,t,n,i){const r=e[n],o=t[n];let c=0;return r<o?c=i===0?-1:0:r>o&&(c=i===0?0:-1),c}function ge(e){let t=L(e);const n=new Set(t);return t=Array.from(n),t}function me(e,t){const n=["null","undefined"];let i=!0;return e===0?i=!0:n.includes(e)?i=!1:e||(i=!1),i?{value:e,success:i}:{value:t===""?t:t||"-",success:i}}function ye(e){let t="";if(e>-1){const n=Math.floor(e/3600),i=Math.floor(e/60)%60,r=parseInt(String(e%60));n<10?t="0"+n+":":t=n+":",i<10&&(t+="0"),t+=i+":",r<10&&(t+="0"),t+=r}return t.split(":")[0]==="00"?`${t.split(":")[1]}:${t.split(":")[2]}`:t}function E(){const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");return{uuid(t,n){const i=e,r=[],o=n||i.length;let c,u;if(t)for(c=0;c<t;c+=1)r[c]=i[parseInt(String(Math.random()*o))];else for(r[8]="-",r[13]="-",r[18]="-",r[23]="-",r[14]="4",c=0;c<36;c+=1)r[c]||(u=Math.random()*16,r[c]=i[c===19?u&&3||8:u]);return r.join("")},uuidFast(){const t=e,n=new Array(36);let i=0,r,o;for(o=0;o<36;o+=1)o===8||o===13||o===18||o===23?n[o]="-":o===14?n[o]="4":(i<=2&&(i=33554432+Math.random()*16777216||0),r=i&&15,i=i>4,n[o]=t[o===19?r&&3||8:r]);return n.join("")},uuidString(){return this.uuidFast().replace(new RegExp("-","g"),"")},uuidCompact(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{const n=Math.random()*16||0;return(t==="x"?n:n&&3||8).toString(16)})}}}function he(e=[]){let t=0;function n(i=[],r){i.forEach(o=>{o.floor=r,r>t&&(t=r),o.children&&o.children.length>0&&n(o.children,r+1)})}return n(e,1),t}function P(e,t="children"){let n=[];return e.forEach(i=>{n.push(i),i[t]&&i[t].length>0&&(n=n.concat(P(i[t])))}),n}function we(e,t,n,i,r){t=t||"id",n=n||"parentId",i=i||"children",r=r||0;const o=JSON.parse(JSON.stringify(e));return o.filter(c=>{const u=o.filter(a=>c[t]===a[n||"parentId"]);return u.length>0?c[i||"children"]=u:delete c[i||"children"],c[n||"parentId"]===r})}function Se(e){return URL.createObjectURL(e)}function be(e){return new Promise((t,n)=>{const i=new FileReader;i.readAsDataURL(e),i.onload=()=>t(i.result),i.onerror=r=>n(r)})}function ve(e){const t=e.split(","),n=t[0].match(/:(.*?);/)[1],i=atob(t[1]);let r=i.length;const o=new Uint8Array(r);for(;r--;)o[r]=i.charCodeAt(r);return new Blob([o],{type:n})}function pe(e,t){const n=e.split(","),i=n[0].match(/:(.*?);/)[1],r=atob(n[1]);let o=r.length;const c=new Uint8Array(o);for(;o--;)c[o]=r.charCodeAt(o);return new File([c],t,{type:i})}function Ae(e,t,n){return new window.File([e],t,{type:n})}function M(e=""){const t=e.indexOf("?");return t>0?`${e.substring(0,t)}`:e}function p(e=""){e=M(e);const t=e.lastIndexOf(".");return t>0?`${e.substring(t).split("?")[0]}`.split(".")[1]:""}function w(e,t){if(t)return t;if(!e||e==="data:")return"4";let n="4";return A(e)?e.includes("data:image/")?n="png":e.includes("data:video/")?n="mp4":e.includes("data:audio/")&&(n="mp3"):e instanceof Blob?(e=String(e),e.includes("image")?n="png":e.includes("video")?n="mp4":e.includes("audio")&&(n="mp3")):n=p(e).toLowerCase(),b.imageType.includes(n)?"1":b.videoType.includes(n)?"3":b.audioType.includes(n)?"2":"4"}function V(e){const{url:t="",fileType:n="1"}=e;let i="";return t instanceof File?i=URL.createObjectURL(t):A(t)?i=t:t instanceof Blob?i=URL.createObjectURL(t):(t.includes("https")||t.includes("http"))&&(i=t),new Promise(function(r){let o;n==="1"?(o=document.createElement("img"),o.src=i):n==="2"?(o=document.createElement("audio"),o.src=i):n==="3"&&(o=document.createElement("video"),o.src=i),n==="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 Te(e){const{url:t="",currentTime:n,videoSuffix:i="",vidoeAllowPlay:r=!1}=e;let o="",c=i,u="1",a;return t instanceof File?(o=URL.createObjectURL(t),c=p(t.name),u=w(t.name)):t instanceof Blob?(o=URL.createObjectURL(t),u=w(t)):A(t)?(o=t,u=w(t)):(t.includes("https")||t.includes("http"))&&(o=t,c=p(t),u=w(t)),(c?b.videoAllowType.includes(c.toLowerCase()):!1)?r?$(o,n):(a=await V({url:o,fileType:u}),a.play?$(o,n):new Promise(function(d){d("")})):new Promise(function(d){d("")})}async function $(e,t){let n=document.createElement("video");n.style.display="none",n.controls=!0,n.muted=!0,t&&(n.currentTime=t),n.setAttribute("src",e),n.setAttribute("muted",String(!0)),n.setAttribute("crossorigin","anonymous"),n.setAttribute("autoplay",String(!0));const i=document.createElement("canvas"),r=.8,o=100,c=i.getContext("2d");return new Promise(function(u){n&&n.addEventListener("canplay",function(){setTimeout(function(){const a=(n==null?void 0:n.videoWidth)||0*r,s=(n==null?void 0:n.videoHeight)||0*r,d=0;i.width=(n==null?void 0:n.videoWidth)||0*r,i.height=(n==null?void 0:n.videoHeight)||0*r,c.drawImage(n,0,0,a+d,s+d),n=null,u(a===0||s===0?"":i.toDataURL("image/png",1))},o)},!1)})}function A(e=""){return!!(e&&["data:image/","data:video/","data:audio/"].find(n=>e.includes(n)))}function Oe(e,t,n,i=!1){e&&t&&n&&e.addEventListener(t,n,i)}function Fe(e,t,n,i=!1){e&&t&&n&&e.removeEventListener(t,n,i)}const We="",Ce=f.defineComponent({props:{id:x.string,style:x.style,size:{type:String,default:"middle"},label:Object,placeholder:[Object,String],class:String,ellipsis:Boolean,allowClear:{type:Boolean,default:!0},bordered:Boolean,expanded:Boolean,disabled:Boolean,onClear:Function,onLabelClick:Function,formatter:Function,value:x.any},setup(e,{expose:t}){const n=B({suffixCls:"core-field-label",isPor:!0}),i=f.ref(),r=f.ref(),o=f.computed(()=>e.allowClear||!0);t({labelRef:i,clearRef:r});const c=a=>e.formatter?e.formatter(a):Array.isArray(a)?a.join(","):String(a),u=(a,s)=>{var d,m;if(s!=null&&s!==""&&(!Array.isArray(s)||s.length)){const I=f.isVNode(s),k=a?f.createVNode("span",{onClick:e.onLabelClick,class:`${n}-text`},[a,": "]):"",y=I?"":c(s);if(!e.ellipsis)return f.createVNode("span",{style:{display:"inline-flex",alignItems:"center"}},[k,I?s:c(s)]);const De=41,Ee=(()=>{const Pe=Array.isArray(s)&&s.length>1,Me="\u9879";return y.length>32&&Pe?`...${s.length}${Me}`:""})();return f.createVNode("span",{title:I?"":y,style:{display:"inline-flex",alignItems:"center"}},[k,f.createVNode("span",{style:{paddingInlineStart:4}},[typeof y=="string"?(m=(d=y==null?void 0:y.toString())==null?void 0:d.substr)==null?void 0:m.call(d,0,De):s]),Ee])}return a||e.placeholder};return()=>f.createVNode("span",{class:{[`${n}`]:!0,[`${n}-${e.size}`]:e.size,[`${n}-active`]:!!e.value||e.value===0,[`${n}-disabled`]:e.disabled,[`${n}-bordered`]:e.bordered,[`${n}-allow-clear`]:o.value,[`${e.class}`]:e.class},style:e.style,ref:i},[u(e.label,e.value),(e.value||e.value===0)&&o.value&&f.createVNode(O.CloseOutlined,{role:"button",title:"\u6E05\u9664",class:[`${n}-icon`,`${n}-close`],onClick:a=>{e.onClear&&!e.disabled&&e.onClear(),a.stopPropagation()},ref:r},null),f.createVNode(O.DownOutlined,{class:[`${n}-icon`,`${n}-arrow`]},null)])}}),Je="",xe=e=>{if(!e.tooltip&&!e.subTitle)return f.createVNode(f.Fragment,null,[e.label]);const t=B({suffixCls:"core-label-tip",isPor:!0}),n=typeof e.tooltip=="string"?{title:e.tooltip}:e.tooltip,i=(n==null?void 0:n.icon)||f.createVNode(O.InfoCircleOutlined,null,null);return f.createVNode("div",{class:t,onMousedown:r=>r.stopPropagation(),onMouseleave:r=>r.stopPropagation(),onMousemove:r=>r.stopPropagation()},[f.createVNode("div",{class:{[`${t}-title`]:!0,[`${t}-title-ellipsis`]:e.ellipsis}},[e.label]),e.subTitle&&f.createVNode("div",{class:`${t}-subtitle`},[e.subTitle]),e.tooltip&&f.createVNode(W.Tooltip,n,{default:()=>[f.createVNode("span",{class:`${t}-icon`},[i])]})])},Re=(...e)=>{const t={},n=e.length;let i,r=0;for(;r<n;r+=1)for(i in e[r])e[r].hasOwnProperty(i)&&(typeof t[i]=="object"&&typeof e[r][i]=="object"&&t[i]!==void 0&&t[i]!==null&&!Array.isArray(t[i])&&!Array.isArray(e[r][i])?t[i]={...t[i],...e[r][i]}:t[i]=e[r][i]);return t};function T(e,t,n,i){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){if(e.constructor!==t.constructor)return!1;let r,o,c;if(Array.isArray(e)){if(r=e.length,r!=t.length)return!1;for(o=r;o--!==0;)if(!T(e[o],t[o],n,i))return!1;return!0}if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(o of e.entries())if(!t.has(o[0]))return!1;for(o of e.entries())if(!T(o[1],t.get(o[0]),n,i))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(o of e.entries())if(!t.has(o[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(t)){if(r=e.length,r!=t.length)return!1;for(o=r;o--!==0;)if(e[o]!==t[o])return!1;return!0}if(e.constructor===RegExp)return e.source===t.source&&e.flags===t.flags;if(e.valueOf!==Object.prototype.valueOf&&e.valueOf)return e.valueOf()===t.valueOf();if(e.toString!==Object.prototype.toString&&e.toString)return e.toString()===t.toString();if(c=Object.keys(e),r=c.length,r!==Object.keys(t).length)return!1;for(o=r;o--!==0;)if(!Object.prototype.hasOwnProperty.call(t,c[o]))return!1;for(o=r;o--!==0;){const u=c[o];if(!(n!=null&&n.includes(u))&&!(u==="_owner"&&e.$$typeof)&&!T(e[u],t[u],n,i))return i&&console.log(u),!1}return!0}return e!==e&&t!==t}const je=typeof process<"u"&&process.versions!=null&&process.versions.node!=null,Be=()=>process.env.NODE_ENV==="TEST"?!0:typeof window<"u"&&typeof window.document<"u"&&typeof window.matchMedia<"u"&&!je,Le=e=>{if(e&&e!==!0)return e},$e=e=>{const t={};if(Object.keys(e||{}).forEach(n=>{e[n]!==void 0&&(t[n]=e[n])}),!(Object.keys(t).length<1))return t},q=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 Ie(e){return q(e)?e[0].children:e}function Ne(e,t,n="default"){return t[n]===!1?!1:j(t[n])&&t[n]?(e==null?void 0:e[n])||t[n]:t[n]||e[n]}function z(e,t,n="default"){var i,r;return t[n]===!1?!1:j(t[n])&&t[n]?((i=e==null?void 0:e[n])==null?void 0:i.call(e))||t[n]:t[n]||((r=e[n])==null?void 0:r.call(e))}function Ue(e,t,n){const i={};return e.forEach(r=>{i[r]=z(t,n,r)}),i}l.FieldLabel=Ce,l.LabelIconTip=xe,l.arrayRepeat=ge,l.blobToDataURL=Ae,l.checkFileType=w,l.compareArray=de,l.dataURLtoBlob=ve,l.dataURLtoFile=pe,l.deepCopy=L,l.formatDuraton=ye,l.genColumnKey=ce,l.generateVidoePicture=$,l.getBase64=be,l.getBlobUrl=Se,l.getFileSuffix=p,l.getLevelData=P,l.getMaxFloor=he,l.getMediaInfos=V,l.getPrefixCls=B,l.getRandomNumber=E,l.getRealVNode=Ie,l.getScroll=U,l.getScrollContainer=Y,l.getSlot=Ne,l.getSlotVNode=z,l.getSlotsProps=Ue,l.getSortIndex=se,l.getVideoCoverPicture=Te,l.getVideoFileUrl=M,l.handleCurrentPage=fe,l.handleShowIndex=ue,l.hanndleField=me,l.is=R,l.isArray=re,l.isBase64=A,l.isBoolean=j,l.isBrowser=Be,l.isDeepEqualReact=T,l.isFunction=le,l.isInContainer=Q,l.isNumber=ie,l.isObject=v,l.isScroll=N,l.isServer=h,l.isSlotFragment=q,l.isString=oe,l.merge=Re,l.off=Fe,l.omitBoolean=Le,l.omitUndefined=$e,l.on=Oe,l.runFunction=ae,l.scrollTo=ee,l.throttleByAnimationFrame=te,l.treeData=we,Object.defineProperties(l,{__esModule:{value:!0},[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.0.26",
3
+ "version": "0.0.27",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "vite build",