@gx-design-vue/pro-utils 0.0.18 → 0.0.20

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/README.md ADDED
@@ -0,0 +1,5 @@
1
+ # Pro Utils
2
+
3
+ ```shell
4
+ pnpm add @gx-design-vue/pro-utils
5
+ ```
@@ -0,0 +1,20 @@
1
+ import type { FunctionalComponent, VueElement } from 'vue';
2
+ import { type TooltipProps } from 'ant-design-vue';
3
+ import type { VueNode } from '../../typings';
4
+ import './index.less';
5
+ export declare type WrapperTooltipProps = TooltipProps & {
6
+ icon?: VueElement;
7
+ };
8
+ export declare type LabelTooltipType = WrapperTooltipProps | VueNode;
9
+ /**
10
+ * 在 form 的 label 后面增加一个 tips 来展示一些说明文案
11
+ *
12
+ * @param props
13
+ */
14
+ declare const LabelIconTip: FunctionalComponent<{
15
+ label: VueNode;
16
+ subTitle?: VueNode;
17
+ tooltip?: string | LabelTooltipType;
18
+ ellipsis?: boolean;
19
+ }>;
20
+ export default LabelIconTip;
@@ -0,0 +1,38 @@
1
+ @import '../../design/config.less';
2
+ @import '../../design/ant-design-theme.less';
3
+
4
+ @root-entry-name: 'default';
5
+
6
+ @pro-core-label-tip: ~'@{gx-prefix-pro}-core-label-tip';
7
+
8
+ .@{pro-core-label-tip} {
9
+ display: inline-flex;
10
+ align-items: center;
11
+ max-width: 100%;
12
+
13
+ &-icon {
14
+ display: block;
15
+ margin-left: 4px;
16
+ cursor: pointer;
17
+ }
18
+
19
+ &-title {
20
+ display: inline-flex;
21
+ flex: 1;
22
+ }
23
+
24
+ &-subtitle {
25
+ margin-left: 8px;
26
+ color: @text-color-secondary;
27
+ font-weight: normal;
28
+ font-size: @font-size-base;
29
+ white-space: nowrap;
30
+ }
31
+
32
+ &-title-ellipsis {
33
+ overflow: hidden;
34
+ white-space: nowrap;
35
+ text-overflow: ellipsis;
36
+ word-break: keep-all;
37
+ }
38
+ }
@@ -0,0 +1,4 @@
1
+ @root-entry-name: default;
2
+
3
+ @import 'ant-design-vue/es/style/themes/default.less';
4
+ @import 'ant-design-vue/es/style/core/index.less';
@@ -0,0 +1 @@
1
+ @import 'ant-design-vue/es/tooltip/style/index.less';
@@ -0,0 +1,2 @@
1
+ @gx-prefix: gx;
2
+ @gx-prefix-pro: ~'@{gx-prefix}-pro';
package/dist/index.d.ts CHANGED
@@ -1,8 +1,15 @@
1
+ import './design/config.less';
2
+ import './design/ant-design-theme.less';
3
+ import './design/ant-design-vue.less';
4
+ import './style/index.less';
5
+ import './proUtils.less';
6
+ import './style.less';
1
7
  import isServer from './isServer';
2
8
  import { isScroll, getScrollContainer, isInContainer } from './scroll';
3
9
  import scrollTo from './scroll/scrollTo';
4
10
  import getScroll from './scroll/getScroll';
5
11
  import throttleByAnimationFrame from './scroll/throttleByAnimationFrame';
12
+ import LabelIconTip, { type LabelTooltipType } from './components/LabelIconTip';
6
13
  export * from './isBrowser';
7
14
  export * from './omitBoolean';
8
15
  export * from './omitUndefined';
@@ -10,4 +17,5 @@ export * from './slots';
10
17
  export * from './utils';
11
18
  export * from './utils/validate';
12
19
  export * from './typings';
13
- export { isServer, isScroll, isInContainer, getScrollContainer, scrollTo, getScroll, throttleByAnimationFrame };
20
+ export type { LabelTooltipType };
21
+ export { isServer, LabelIconTip, isScroll, isInContainer, getScrollContainer, scrollTo, getScroll, throttleByAnimationFrame };
@@ -0,0 +1,490 @@
1
+ import { createVNode as l, Fragment as E } from "vue";
2
+ import { Tooltip as L } from "ant-design-vue";
3
+ import { InfoCircleOutlined as R } from "@ant-design/icons-vue";
4
+ import { cloneDeep as I } from "lodash-unified";
5
+ const w = typeof window > "u";
6
+ process.env.NODE_ENV !== "production" && Object.freeze({});
7
+ process.env.NODE_ENV !== "production" && Object.freeze([]);
8
+ const D = (e) => {
9
+ const t = /* @__PURE__ */ Object.create(null);
10
+ return (n) => t[n] || (t[n] = e(n));
11
+ }, U = /-(\w)/g, C = D((e) => e.replace(U, (t, n) => n ? n.toUpperCase() : "")), x = function(e, t) {
12
+ var n;
13
+ if (w || !e || !t)
14
+ return "";
15
+ t = C(t), t === "float" && (t = "cssFloat");
16
+ try {
17
+ const i = e.style[t];
18
+ if (i)
19
+ return i;
20
+ const r = (n = document == null ? void 0 : document.defaultView) == null ? void 0 : n.getComputedStyle(e, "");
21
+ return r ? r[t] : "";
22
+ } catch {
23
+ return e.style[t];
24
+ }
25
+ }, j = (e, t) => w ? void 0 : (t == null ? x(e, "overflow") : t ? x(e, "overflow-y") : x(e, "overflow-x")).match(/(scroll|auto|overlay)/), Q = (e, t) => {
26
+ if (w)
27
+ return;
28
+ let n = e;
29
+ for (; n; ) {
30
+ if ([window, document, document.documentElement].includes(n))
31
+ return window;
32
+ if (j(n, t))
33
+ return n;
34
+ n = n.parentNode;
35
+ }
36
+ return n;
37
+ }, Z = (e, t) => {
38
+ if (w || !e || !t)
39
+ return !1;
40
+ const n = e.getBoundingClientRect();
41
+ let i;
42
+ return [window, document, document.documentElement, null, void 0].includes(t) ? i = {
43
+ top: 0,
44
+ right: window.innerWidth,
45
+ bottom: window.innerHeight,
46
+ left: 0
47
+ } : i = t.getBoundingClientRect(), n.top < i.bottom && n.bottom > i.top && n.right > i.left && n.left < i.right;
48
+ };
49
+ let B = 0;
50
+ const f = {};
51
+ function g(e, t = 1) {
52
+ const n = B++;
53
+ let i = t;
54
+ function r() {
55
+ i -= 1, i <= 0 ? (e(), delete f[n]) : f[n] = requestAnimationFrame(r);
56
+ }
57
+ return f[n] = requestAnimationFrame(r), n;
58
+ }
59
+ g.cancel = function(t) {
60
+ t !== void 0 && (cancelAnimationFrame(f[t]), delete f[t]);
61
+ };
62
+ g.ids = f;
63
+ function y(e) {
64
+ return e != null && e === e.window;
65
+ }
66
+ function P(e, t) {
67
+ var r;
68
+ if (typeof window > "u")
69
+ return 0;
70
+ const n = t ? "scrollTop" : "scrollLeft";
71
+ let i = 0;
72
+ return y(e) ? i = e[t ? "pageYOffset" : "pageXOffset"] : e instanceof Document ? i = e.documentElement[n] : e && (i = e[n]), e && !y(e) && typeof i != "number" && (i = (r = (e.ownerDocument || e).documentElement) == null ? void 0 : r[n]), i;
73
+ }
74
+ function $(e, t, n, i) {
75
+ const r = n - t;
76
+ return e /= i / 2, e < 1 ? r / 2 * e * e * e + t : r / 2 * ((e -= 2) * e * e + 2) + t;
77
+ }
78
+ function k(e, t = {}) {
79
+ const { getContainer: n = () => window, callback: i, duration: r = 450 } = t, o = n(), c = P(o, !0), u = Date.now(), s = () => {
80
+ const a = Date.now() - u, h = $(a > r ? r : a, c, e, r);
81
+ y(o) ? o.scrollTo(window.pageXOffset, h) : o instanceof HTMLDocument || o.constructor.name === "HTMLDocument" ? o.documentElement.scrollTop = h : o.scrollTop = h, a < r ? g(s) : typeof i == "function" && i();
82
+ };
83
+ g(s);
84
+ }
85
+ function K(e) {
86
+ let t;
87
+ const n = (r) => () => {
88
+ t = null, e(...r);
89
+ }, i = (...r) => {
90
+ t == null && (t = requestAnimationFrame(n(r)));
91
+ };
92
+ return i.cancel = () => cancelAnimationFrame(t), i;
93
+ }
94
+ const p = {
95
+ videoAllowType: [
96
+ "mp4",
97
+ "webm",
98
+ "ogg"
99
+ ],
100
+ audioAllowType: ["mp3"],
101
+ imageType: ["bmp", "png", "gif", "jpg", "jpeg", "psd", "tif"],
102
+ videoType: [
103
+ "mp4",
104
+ "swf",
105
+ "rmvb",
106
+ "avi",
107
+ "flv",
108
+ "mpg",
109
+ "rm",
110
+ "mov",
111
+ "asf",
112
+ "3gp",
113
+ "mkv",
114
+ "ts",
115
+ "f4v",
116
+ "webm",
117
+ "m4v",
118
+ "3g2",
119
+ "m3u8"
120
+ ],
121
+ audioType: ["mp3", "mpeg", "aac", "wav", "wma", "mp2", "flac", "midi", "ra", "ape", "aac", "cda"]
122
+ }, M = Object.prototype.toString;
123
+ function T(e, t) {
124
+ return M.call(e) === `[object ${t}]`;
125
+ }
126
+ function O(e) {
127
+ return T(e, "Boolean");
128
+ }
129
+ function ee(e) {
130
+ return typeof e == "number";
131
+ }
132
+ function te(e) {
133
+ return typeof Array.isArray > "u" ? Object.prototype.toString.call(e) === "[object Array]" : Array.isArray(e);
134
+ }
135
+ function v(e) {
136
+ return e !== null && T(e, "Object");
137
+ }
138
+ function ne(e) {
139
+ return typeof e == "string" || e instanceof String;
140
+ }
141
+ function ie(e) {
142
+ return typeof e == "function" || Object.prototype.toString.call(e) === "[object Function]";
143
+ }
144
+ const N = ({ suffixCls: e, customizePrefixCls: t, isPor: n, className: i }) => {
145
+ const r = i || (n ? "gx-pro" : "gx");
146
+ return t || (e ? `${r}-${e}` : r);
147
+ }, re = (e, t) => e ? Array.isArray(e) ? e.join("-") : e.toString() : `${t}`;
148
+ function oe(e, { align: t, showIndex: n }) {
149
+ const i = I(e);
150
+ if (n && e.length && e.every((r) => r.dataIndex !== "sortIndex")) {
151
+ const r = e[0];
152
+ i.unshift({
153
+ title: "\u5E8F\u53F7",
154
+ align: t,
155
+ fixed: r.fixed,
156
+ width: 60,
157
+ uuid: V().uuid(15),
158
+ dataIndex: "sortIndex",
159
+ key: "sortIndex"
160
+ });
161
+ } else
162
+ i.filter((r) => r.dataIndex !== "sortIndex");
163
+ return i;
164
+ }
165
+ function ce(e, ...t) {
166
+ return typeof e == "function" ? e(...t) : e;
167
+ }
168
+ function F(e) {
169
+ return JSON.parse(JSON.stringify(e));
170
+ }
171
+ function ue(e, t) {
172
+ if (v(e)) {
173
+ const { pageSize: n = 10, total: i = 0 } = e;
174
+ let { current: r = 1 } = e;
175
+ return i - t <= n * (r - 1) && (r = r - 1), r === 0 ? 1 : r;
176
+ }
177
+ return 1;
178
+ }
179
+ function se(e = [], t, n = "children") {
180
+ function i(r, o) {
181
+ return o.map((c, u) => {
182
+ const s = `${r}-${u + 1}`;
183
+ return c[n] && (c[n] = i(s, c[n])), c.sortIndex = s, c;
184
+ });
185
+ }
186
+ return F(e).map((r, o) => {
187
+ let c = o;
188
+ const u = v(t) && t.current || 1, s = v(t) && t.pageSize || 10;
189
+ return c = u ? (u - 1) * s + (o + 1) : o + 1, r[n] && (r[n] = i(`${c}`, r[n])), r.sortIndex = c, r;
190
+ });
191
+ }
192
+ function ae(e, t, n, i) {
193
+ const r = e[n], o = t[n];
194
+ let c = 0;
195
+ return r < o ? c = i === 0 ? -1 : 0 : r > o && (c = i === 0 ? 0 : -1), c;
196
+ }
197
+ function le(e) {
198
+ let t = F(e);
199
+ const n = new Set(t);
200
+ return t = Array.from(n), t;
201
+ }
202
+ function fe(e, t) {
203
+ const n = ["null", "undefined"];
204
+ let i = !0;
205
+ return e === 0 ? i = !0 : n.includes(e) ? i = !1 : e || (i = !1), i ? {
206
+ value: e,
207
+ success: i
208
+ } : {
209
+ value: t === "" ? t : t || "-",
210
+ success: i
211
+ };
212
+ }
213
+ function de(e) {
214
+ let t = "";
215
+ if (e > -1) {
216
+ const n = Math.floor(e / 3600), i = Math.floor(e / 60) % 60, r = parseInt(String(e % 60));
217
+ n < 10 ? t = "0" + n + ":" : t = n + ":", i < 10 && (t += "0"), t += i + ":", r < 10 && (t += "0"), t += r;
218
+ }
219
+ return t.split(":")[0] === "00" ? `${t.split(":")[1]}:${t.split(":")[2]}` : t;
220
+ }
221
+ function V() {
222
+ const e = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");
223
+ return {
224
+ uuid(t, n) {
225
+ const i = e, r = [], o = n || i.length;
226
+ let c, u;
227
+ if (t)
228
+ for (c = 0; c < t; c += 1)
229
+ r[c] = i[parseInt(String(Math.random() * o))];
230
+ else
231
+ for (r[8] = "-", r[13] = "-", r[18] = "-", r[23] = "-", r[14] = "4", c = 0; c < 36; c += 1)
232
+ r[c] || (u = Math.random() * 16, r[c] = i[c === 19 ? u && 3 || 8 : u]);
233
+ return r.join("");
234
+ },
235
+ uuidFast() {
236
+ const t = e, n = new Array(36);
237
+ let i = 0, r, o;
238
+ for (o = 0; o < 36; o += 1)
239
+ 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]);
240
+ return n.join("");
241
+ },
242
+ uuidString() {
243
+ return this.uuidFast().replace(new RegExp("-", "g"), "");
244
+ },
245
+ uuidCompact() {
246
+ return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (t) => {
247
+ const n = Math.random() * 16 || 0;
248
+ return (t === "x" ? n : n && 3 || 8).toString(16);
249
+ });
250
+ }
251
+ };
252
+ }
253
+ function me(e = []) {
254
+ let t = 0;
255
+ function n(i = [], r) {
256
+ i.forEach((o) => {
257
+ o.floor = r, r > t && (t = r), o.children && o.children.length > 0 && n(o.children, r + 1);
258
+ });
259
+ }
260
+ return n(e, 1), t;
261
+ }
262
+ function H(e, t = "children") {
263
+ let n = [];
264
+ return e.forEach((i) => {
265
+ n.push(i), i[t] && i[t].length > 0 && (n = n.concat(H(i[t])));
266
+ }), n;
267
+ }
268
+ function pe(e, t, n, i, r) {
269
+ t = t || "id", n = n || "parentId", i = i || "children", r = r || 0;
270
+ const o = JSON.parse(JSON.stringify(e));
271
+ return o.filter((c) => {
272
+ const u = o.filter((s) => c[t] === s[n || "parentId"]);
273
+ return u.length > 0 ? c[i || "children"] = u : delete c[i || "children"], c[n || "parentId"] === r;
274
+ });
275
+ }
276
+ function ge(e) {
277
+ return URL.createObjectURL(e);
278
+ }
279
+ function we(e) {
280
+ return new Promise((t, n) => {
281
+ const i = new FileReader();
282
+ i.readAsDataURL(e), i.onload = () => t(i.result), i.onerror = (r) => n(r);
283
+ });
284
+ }
285
+ function he(e) {
286
+ const t = e.split(","), n = t[0].match(/:(.*?);/)[1], i = atob(t[1]);
287
+ let r = i.length;
288
+ const o = new Uint8Array(r);
289
+ for (; r--; )
290
+ o[r] = i.charCodeAt(r);
291
+ return new Blob([o], { type: n });
292
+ }
293
+ function xe(e, t) {
294
+ const n = e.split(","), i = n[0].match(/:(.*?);/)[1], r = atob(n[1]);
295
+ let o = r.length;
296
+ const c = new Uint8Array(o);
297
+ for (; o--; )
298
+ c[o] = r.charCodeAt(o);
299
+ return new File([c], t, { type: i });
300
+ }
301
+ function ye(e, t, n) {
302
+ return new window.File([e], t, { type: n });
303
+ }
304
+ function W(e = "") {
305
+ const t = e.indexOf("?");
306
+ return t > 0 ? `${e.substring(0, t)}` : e;
307
+ }
308
+ function b(e = "") {
309
+ e = W(e);
310
+ const t = e.lastIndexOf(".");
311
+ return t > 0 ? `${e.substring(t).split("?")[0]}`.split(".")[1] : "";
312
+ }
313
+ function m(e, t) {
314
+ if (t)
315
+ return t;
316
+ if (!e || e === "data:")
317
+ return "4";
318
+ let n = "4";
319
+ return S(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 = b(e).toLowerCase(), p.imageType.includes(n) ? "1" : p.videoType.includes(n) ? "3" : p.audioType.includes(n) ? "2" : "4";
320
+ }
321
+ function q(e) {
322
+ const { url: t = "", fileType: n = "1" } = e;
323
+ let i = "";
324
+ return t instanceof File ? i = URL.createObjectURL(t) : S(t) ? i = t : t instanceof Blob ? i = URL.createObjectURL(t) : (t.includes("https") || t.includes("http")) && (i = t), new Promise(function(r) {
325
+ let o;
326
+ 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() {
327
+ r({
328
+ play: !0,
329
+ width: o.width || 0,
330
+ height: o.height || 0
331
+ }), o = null;
332
+ } : o.oncanplay = function() {
333
+ r({
334
+ play: !0,
335
+ duration: o.duration,
336
+ width: (o == null ? void 0 : o.videoWidth) || 0,
337
+ height: (o == null ? void 0 : o.videoHeight) || 0
338
+ }), o = null;
339
+ }, o.onerror = function() {
340
+ r({
341
+ play: !1
342
+ }), o = null;
343
+ };
344
+ });
345
+ }
346
+ async function ve(e) {
347
+ const { url: t = "", currentTime: n, videoSuffix: i = "", vidoeAllowPlay: r = !1 } = e;
348
+ let o = "", c = i, u = "1", s;
349
+ return t instanceof File ? (o = URL.createObjectURL(t), c = b(t.name), u = m(t.name)) : t instanceof Blob ? (o = URL.createObjectURL(t), u = m(t)) : S(t) ? (o = t, u = m(t)) : (t.includes("https") || t.includes("http")) && (o = t, c = b(t), u = m(t)), (c ? p.videoAllowType.includes(c.toLowerCase()) : !1) ? r ? A(o, n) : (s = await q({
350
+ url: o,
351
+ fileType: u
352
+ }), s.play ? A(o, n) : new Promise(function(a) {
353
+ a("");
354
+ })) : new Promise(function(a) {
355
+ a("");
356
+ });
357
+ }
358
+ async function A(e, t) {
359
+ let n = document.createElement("video");
360
+ 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));
361
+ const i = document.createElement("canvas"), r = 0.8, o = 100, c = i.getContext("2d");
362
+ return new Promise(function(u) {
363
+ n && n.addEventListener("canplay", function() {
364
+ setTimeout(function() {
365
+ const s = (n == null ? void 0 : n.videoWidth) || 0 * r, d = (n == null ? void 0 : n.videoHeight) || 0 * r, a = 0;
366
+ 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, s + a, d + a), n = null, u(s === 0 || d === 0 ? "" : i.toDataURL("image/png", 1));
367
+ }, o);
368
+ }, !1);
369
+ });
370
+ }
371
+ function S(e = "") {
372
+ return !!(e && [
373
+ "data:image/",
374
+ "data:video/",
375
+ "data:audio/"
376
+ ].find((n) => e.includes(n)));
377
+ }
378
+ function be(e, t, n, i = !1) {
379
+ e && t && n && e.addEventListener(t, n, i);
380
+ }
381
+ function Se(e, t, n, i = !1) {
382
+ e && t && n && e.removeEventListener(t, n, i);
383
+ }
384
+ const Ae = (e) => {
385
+ const {
386
+ label: t,
387
+ tooltip: n,
388
+ ellipsis: i,
389
+ subTitle: r
390
+ } = e;
391
+ if (!n && !r)
392
+ return l(E, null, [t]);
393
+ const o = N({
394
+ suffixCls: "core-label-tip",
395
+ isPor: !0
396
+ }), c = typeof n == "string" ? {
397
+ title: n
398
+ } : n, u = (c == null ? void 0 : c.icon) || l(R, null, null);
399
+ return l("div", {
400
+ class: o,
401
+ onMousedown: (s) => s.stopPropagation(),
402
+ onMouseleave: (s) => s.stopPropagation(),
403
+ onMousemove: (s) => s.stopPropagation()
404
+ }, [l("div", {
405
+ class: {
406
+ [`${o}-title`]: !0,
407
+ [`${o}-title-ellipsis`]: i
408
+ }
409
+ }, [t]), r && l("div", {
410
+ class: `${o}-subtitle`
411
+ }, [r]), n && l(L, c, {
412
+ default: () => [l("span", {
413
+ class: `${o}-icon`
414
+ }, [u])]
415
+ })]);
416
+ }, z = typeof process < "u" && process.versions != null && process.versions.node != null, Te = () => process.env.NODE_ENV === "TEST" ? !0 : typeof window < "u" && typeof window.document < "u" && typeof window.matchMedia < "u" && !z, Oe = (e) => {
417
+ if (e && e !== !0)
418
+ return e;
419
+ }, Fe = (e) => {
420
+ const t = {};
421
+ if (Object.keys(e || {}).forEach((n) => {
422
+ e[n] !== void 0 && (t[n] = e[n]);
423
+ }), !(Object.keys(t).length < 1))
424
+ return t;
425
+ };
426
+ function Ee(e, t, n = "default") {
427
+ return t[n] === !1 ? !1 : O(t[n]) && t[n] ? (e == null ? void 0 : e[n]) || !1 : t[n] || e[n];
428
+ }
429
+ function J(e, t, n = "default") {
430
+ var i, r;
431
+ return t[n] === !1 ? !1 : O(t[n]) && t[n] ? ((i = e == null ? void 0 : e[n]) == null ? void 0 : i.call(e)) || !1 : t[n] || ((r = e[n]) == null ? void 0 : r.call(e));
432
+ }
433
+ function Le(e, t, n) {
434
+ const i = {};
435
+ return e.forEach((r) => {
436
+ i[r] = J(t, n, r);
437
+ }), i;
438
+ }
439
+ export {
440
+ Ae as LabelIconTip,
441
+ le as arrayRepeat,
442
+ ye as blobToDataURL,
443
+ m as checkFileType,
444
+ ae as compareArray,
445
+ he as dataURLtoBlob,
446
+ xe as dataURLtoFile,
447
+ F as deepCopy,
448
+ de as formatDuraton,
449
+ re as genColumnKey,
450
+ A as generateVidoePicture,
451
+ we as getBase64,
452
+ ge as getBlobUrl,
453
+ b as getFileSuffix,
454
+ H as getLevelData,
455
+ me as getMaxFloor,
456
+ q as getMediaInfos,
457
+ N as getPrefixCls,
458
+ V as getRandomNumber,
459
+ P as getScroll,
460
+ Q as getScrollContainer,
461
+ Ee as getSlot,
462
+ J as getSlotVNode,
463
+ Le as getSlotsProps,
464
+ se as getSortIndex,
465
+ ve as getVideoCoverPicture,
466
+ W as getVideoFileUrl,
467
+ ue as handleCurrentPage,
468
+ oe as handleShowIndex,
469
+ fe as hanndleField,
470
+ T as is,
471
+ te as isArray,
472
+ S as isBase64,
473
+ O as isBoolean,
474
+ Te as isBrowser,
475
+ ie as isFunction,
476
+ Z as isInContainer,
477
+ ee as isNumber,
478
+ v as isObject,
479
+ j as isScroll,
480
+ w as isServer,
481
+ ne as isString,
482
+ Se as off,
483
+ Oe as omitBoolean,
484
+ Fe as omitUndefined,
485
+ be as on,
486
+ ce as runFunction,
487
+ k as scrollTo,
488
+ K as throttleByAnimationFrame,
489
+ pe as treeData
490
+ };
@@ -0,0 +1 @@
1
+ (function(c,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("vue"),require("ant-design-vue"),require("@ant-design/icons-vue"),require("lodash-unified")):typeof define=="function"&&define.amd?define(["exports","vue","ant-design-vue","@ant-design/icons-vue","lodash-unified"],s):(c=typeof globalThis<"u"?globalThis:c||self,s(c.PorUtils={},c.vue,c.antDesignVue$1,c.iconsVue,c.lodashUnified))})(this,function(c,s,j,N,V){"use strict";const Oe="",Ue="",Le="",Re="",Ie="",De="",g=typeof window>"u";process.env.NODE_ENV!=="production"&&Object.freeze({}),process.env.NODE_ENV!=="production"&&Object.freeze([]);const M=e=>{const n=Object.create(null);return t=>n[t]||(n[t]=e(t))},$=/-(\w)/g,q=M(e=>e.replace($,(n,t)=>t?t.toUpperCase():"")),S=function(e,n){var t;if(g||!e||!n)return"";n=q(n),n==="float"&&(n="cssFloat");try{const i=e.style[n];if(i)return i;const o=(t=document==null?void 0:document.defaultView)==null?void 0:t.getComputedStyle(e,"");return o?o[n]:""}catch{return e.style[n]}},R=(e,n)=>g?void 0:(n==null?S(e,"overflow"):n?S(e,"overflow-y"):S(e,"overflow-x")).match(/(scroll|auto|overlay)/),H=(e,n)=>{if(g)return;let t=e;for(;t;){if([window,document,document.documentElement].includes(t))return window;if(R(t,n))return t;t=t.parentNode}return t},W=(e,n)=>{if(g||!e||!n)return!1;const t=e.getBoundingClientRect();let i;return[window,document,document.documentElement,null,void 0].includes(n)?i={top:0,right:window.innerWidth,bottom:window.innerHeight,left:0}:i=n.getBoundingClientRect(),t.top<i.bottom&&t.bottom>i.top&&t.right>i.left&&t.left<i.right};let _=0;const d={};function h(e,n=1){const t=_++;let i=n;function o(){i-=1,i<=0?(e(),delete d[t]):d[t]=requestAnimationFrame(o)}return d[t]=requestAnimationFrame(o),t}h.cancel=function(n){n!==void 0&&(cancelAnimationFrame(d[n]),delete d[n])},h.ids=d;function T(e){return e!=null&&e===e.window}function I(e,n){var o;if(typeof window>"u")return 0;const t=n?"scrollTop":"scrollLeft";let i=0;return T(e)?i=e[n?"pageYOffset":"pageXOffset"]:e instanceof Document?i=e.documentElement[t]:e&&(i=e[t]),e&&!T(e)&&typeof i!="number"&&(i=(o=(e.ownerDocument||e).documentElement)==null?void 0:o[t]),i}function z(e,n,t,i){const o=t-n;return e/=i/2,e<1?o/2*e*e*e+n:o/2*((e-=2)*e*e+2)+n}function J(e,n={}){const{getContainer:t=()=>window,callback:i,duration:o=450}=n,r=t(),u=I(r,!0),a=Date.now(),l=()=>{const f=Date.now()-a,L=z(f>o?o:f,u,e,o);T(r)?r.scrollTo(window.pageXOffset,L):r instanceof HTMLDocument||r.constructor.name==="HTMLDocument"?r.documentElement.scrollTop=L:r.scrollTop=L,f<o?h(l):typeof i=="function"&&i()};h(l)}function X(e){let n;const t=o=>()=>{n=null,e(...o)},i=(...o)=>{n==null&&(n=requestAnimationFrame(t(o)))};return i.cancel=()=>cancelAnimationFrame(n),i}const w={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"]},Y=Object.prototype.toString;function F(e,n){return Y.call(e)===`[object ${n}]`}function A(e){return F(e,"Boolean")}function k(e){return typeof e=="number"}function G(e){return typeof Array.isArray>"u"?Object.prototype.toString.call(e)==="[object Array]":Array.isArray(e)}function y(e){return e!==null&&F(e,"Object")}function Q(e){return typeof e=="string"||e instanceof String}function Z(e){return typeof e=="function"||Object.prototype.toString.call(e)==="[object Function]"}const D=({suffixCls:e,customizePrefixCls:n,isPor:t,className:i})=>{const o=i||(t?"gx-pro":"gx");return n||(e?`${o}-${e}`:o)},K=(e,n)=>e?Array.isArray(e)?e.join("-"):e.toString():`${n}`;function ee(e,{align:n,showIndex:t}){const i=V.cloneDeep(e);if(t&&e.length&&e.every(o=>o.dataIndex!=="sortIndex")){const o=e[0];i.unshift({title:"\u5E8F\u53F7",align:n,fixed:o.fixed,width:60,uuid:x().uuid(15),dataIndex:"sortIndex",key:"sortIndex"})}else i.filter(o=>o.dataIndex!=="sortIndex");return i}function ne(e,...n){return typeof e=="function"?e(...n):e}function O(e){return JSON.parse(JSON.stringify(e))}function te(e,n){if(y(e)){const{pageSize:t=10,total:i=0}=e;let{current:o=1}=e;return i-n<=t*(o-1)&&(o=o-1),o===0?1:o}return 1}function ie(e=[],n,t="children"){function i(o,r){return r.map((u,a)=>{const l=`${o}-${a+1}`;return u[t]&&(u[t]=i(l,u[t])),u.sortIndex=l,u})}return O(e).map((o,r)=>{let u=r;const a=y(n)&&n.current||1,l=y(n)&&n.pageSize||10;return u=a?(a-1)*l+(r+1):r+1,o[t]&&(o[t]=i(`${u}`,o[t])),o.sortIndex=u,o})}function oe(e,n,t,i){const o=e[t],r=n[t];let u=0;return o<r?u=i===0?-1:0:o>r&&(u=i===0?0:-1),u}function re(e){let n=O(e);const t=new Set(n);return n=Array.from(t),n}function ce(e,n){const t=["null","undefined"];let i=!0;return e===0?i=!0:t.includes(e)?i=!1:e||(i=!1),i?{value:e,success:i}:{value:n===""?n:n||"-",success:i}}function ue(e){let n="";if(e>-1){const t=Math.floor(e/3600),i=Math.floor(e/60)%60,o=parseInt(String(e%60));t<10?n="0"+t+":":n=t+":",i<10&&(n+="0"),n+=i+":",o<10&&(n+="0"),n+=o}return n.split(":")[0]==="00"?`${n.split(":")[1]}:${n.split(":")[2]}`:n}function x(){const e="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz".split("");return{uuid(n,t){const i=e,o=[],r=t||i.length;let u,a;if(n)for(u=0;u<n;u+=1)o[u]=i[parseInt(String(Math.random()*r))];else for(o[8]="-",o[13]="-",o[18]="-",o[23]="-",o[14]="4",u=0;u<36;u+=1)o[u]||(a=Math.random()*16,o[u]=i[u===19?a&&3||8:a]);return o.join("")},uuidFast(){const n=e,t=new Array(36);let i=0,o,r;for(r=0;r<36;r+=1)r===8||r===13||r===18||r===23?t[r]="-":r===14?t[r]="4":(i<=2&&(i=33554432+Math.random()*16777216||0),o=i&&15,i=i>4,t[r]=n[r===19?o&&3||8:o]);return t.join("")},uuidString(){return this.uuidFast().replace(new RegExp("-","g"),"")},uuidCompact(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,n=>{const t=Math.random()*16||0;return(n==="x"?t:t&&3||8).toString(16)})}}}function ae(e=[]){let n=0;function t(i=[],o){i.forEach(r=>{r.floor=o,o>n&&(n=o),r.children&&r.children.length>0&&t(r.children,o+1)})}return t(e,1),n}function E(e,n="children"){let t=[];return e.forEach(i=>{t.push(i),i[n]&&i[n].length>0&&(t=t.concat(E(i[n])))}),t}function le(e,n,t,i,o){n=n||"id",t=t||"parentId",i=i||"children",o=o||0;const r=JSON.parse(JSON.stringify(e));return r.filter(u=>{const a=r.filter(l=>u[n]===l[t||"parentId"]);return a.length>0?u[i||"children"]=a:delete u[i||"children"],u[t||"parentId"]===o})}function se(e){return URL.createObjectURL(e)}function fe(e){return new Promise((n,t)=>{const i=new FileReader;i.readAsDataURL(e),i.onload=()=>n(i.result),i.onerror=o=>t(o)})}function de(e){const n=e.split(","),t=n[0].match(/:(.*?);/)[1],i=atob(n[1]);let o=i.length;const r=new Uint8Array(o);for(;o--;)r[o]=i.charCodeAt(o);return new Blob([r],{type:t})}function ge(e,n){const t=e.split(","),i=t[0].match(/:(.*?);/)[1],o=atob(t[1]);let r=o.length;const u=new Uint8Array(r);for(;r--;)u[r]=o.charCodeAt(r);return new File([u],n,{type:i})}function me(e,n,t){return new window.File([e],n,{type:t})}function C(e=""){const n=e.indexOf("?");return n>0?`${e.substring(0,n)}`:e}function p(e=""){e=C(e);const n=e.lastIndexOf(".");return n>0?`${e.substring(n).split("?")[0]}`.split(".")[1]:""}function m(e,n){if(n)return n;if(!e||e==="data:")return"4";let t="4";return v(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=p(e).toLowerCase(),w.imageType.includes(t)?"1":w.videoType.includes(t)?"3":w.audioType.includes(t)?"2":"4"}function B(e){const{url:n="",fileType:t="1"}=e;let i="";return n instanceof File?i=URL.createObjectURL(n):v(n)?i=n:n instanceof Blob?i=URL.createObjectURL(n):(n.includes("https")||n.includes("http"))&&(i=n),new Promise(function(o){let r;t==="1"?(r=document.createElement("img"),r.src=i):t==="2"?(r=document.createElement("audio"),r.src=i):t==="3"&&(r=document.createElement("video"),r.src=i),t==="1"?r.onload=function(){o({play:!0,width:r.width||0,height:r.height||0}),r=null}:r.oncanplay=function(){o({play:!0,duration:r.duration,width:(r==null?void 0:r.videoWidth)||0,height:(r==null?void 0:r.videoHeight)||0}),r=null},r.onerror=function(){o({play:!1}),r=null}})}async function he(e){const{url:n="",currentTime:t,videoSuffix:i="",vidoeAllowPlay:o=!1}=e;let r="",u=i,a="1",l;return n instanceof File?(r=URL.createObjectURL(n),u=p(n.name),a=m(n.name)):n instanceof Blob?(r=URL.createObjectURL(n),a=m(n)):v(n)?(r=n,a=m(n)):(n.includes("https")||n.includes("http"))&&(r=n,u=p(n),a=m(n)),(u?w.videoAllowType.includes(u.toLowerCase()):!1)?o?U(r,t):(l=await B({url:r,fileType:a}),l.play?U(r,t):new Promise(function(f){f("")})):new Promise(function(f){f("")})}async function U(e,n){let t=document.createElement("video");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));const i=document.createElement("canvas"),o=.8,r=100,u=i.getContext("2d");return new Promise(function(a){t&&t.addEventListener("canplay",function(){setTimeout(function(){const l=(t==null?void 0:t.videoWidth)||0*o,b=(t==null?void 0:t.videoHeight)||0*o,f=0;i.width=(t==null?void 0:t.videoWidth)||0*o,i.height=(t==null?void 0:t.videoHeight)||0*o,u.drawImage(t,0,0,l+f,b+f),t=null,a(l===0||b===0?"":i.toDataURL("image/png",1))},r)},!1)})}function v(e=""){return!!(e&&["data:image/","data:video/","data:audio/"].find(t=>e.includes(t)))}function we(e,n,t,i=!1){e&&n&&t&&e.addEventListener(n,t,i)}function ye(e,n,t,i=!1){e&&n&&t&&e.removeEventListener(n,t,i)}const xe="",pe=e=>{const{label:n,tooltip:t,ellipsis:i,subTitle:o}=e;if(!t&&!o)return s.createVNode(s.Fragment,null,[n]);const r=D({suffixCls:"core-label-tip",isPor:!0}),u=typeof t=="string"?{title:t}:t,a=(u==null?void 0:u.icon)||s.createVNode(N.InfoCircleOutlined,null,null);return s.createVNode("div",{class:r,onMousedown:l=>l.stopPropagation(),onMouseleave:l=>l.stopPropagation(),onMousemove:l=>l.stopPropagation()},[s.createVNode("div",{class:{[`${r}-title`]:!0,[`${r}-title-ellipsis`]:i}},[n]),o&&s.createVNode("div",{class:`${r}-subtitle`},[o]),t&&s.createVNode(j.Tooltip,u,{default:()=>[s.createVNode("span",{class:`${r}-icon`},[a])]})])},ve=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"&&!ve,Se=e=>{if(e&&e!==!0)return e},Te=e=>{const n={};if(Object.keys(e||{}).forEach(t=>{e[t]!==void 0&&(n[t]=e[t])}),!(Object.keys(n).length<1))return n};function Fe(e,n,t="default"){return n[t]===!1?!1:A(n[t])&&n[t]?(e==null?void 0:e[t])||!1:n[t]||e[t]}function P(e,n,t="default"){var i,o;return n[t]===!1?!1:A(n[t])&&n[t]?((i=e==null?void 0:e[t])==null?void 0:i.call(e))||!1:n[t]||((o=e[t])==null?void 0:o.call(e))}function Ae(e,n,t){const i={};return e.forEach(o=>{i[o]=P(n,t,o)}),i}c.LabelIconTip=pe,c.arrayRepeat=re,c.blobToDataURL=me,c.checkFileType=m,c.compareArray=oe,c.dataURLtoBlob=de,c.dataURLtoFile=ge,c.deepCopy=O,c.formatDuraton=ue,c.genColumnKey=K,c.generateVidoePicture=U,c.getBase64=fe,c.getBlobUrl=se,c.getFileSuffix=p,c.getLevelData=E,c.getMaxFloor=ae,c.getMediaInfos=B,c.getPrefixCls=D,c.getRandomNumber=x,c.getScroll=I,c.getScrollContainer=H,c.getSlot=Fe,c.getSlotVNode=P,c.getSlotsProps=Ae,c.getSortIndex=ie,c.getVideoCoverPicture=he,c.getVideoFileUrl=C,c.handleCurrentPage=te,c.handleShowIndex=ee,c.hanndleField=ce,c.is=F,c.isArray=G,c.isBase64=v,c.isBoolean=A,c.isBrowser=be,c.isFunction=Z,c.isInContainer=W,c.isNumber=k,c.isObject=y,c.isScroll=R,c.isServer=g,c.isString=Q,c.off=ye,c.omitBoolean=Se,c.omitUndefined=Te,c.on=we,c.runFunction=ne,c.scrollTo=J,c.throttleByAnimationFrame=X,c.treeData=le,Object.defineProperties(c,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -0,0 +1,3 @@
1
+ @import './style/index.less';
2
+ @import './components/LabelIconTip/index.less';
3
+
@@ -0,0 +1,2 @@
1
+ @import '../design/config.less';
2
+ @import '../design/ant-design-theme.less';