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