bi-components-library 1.0.91 → 1.0.92
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.es.js +659 -646
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +8 -8
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as M, jsxs as ie, Fragment as Ot } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { Button as Ae, Card as nt, Modal as
|
|
2
|
+
import Rt, { useState as ae, useRef as re, useMemo as tt, useCallback as se, useEffect as de, useLayoutEffect as Ve } from "react";
|
|
3
|
+
import { Button as Ae, Card as nt, Modal as Gt, Table as rt, Flex as ht, Spin as Ft, Empty as zt, Select as ze, Form as He, Input as kt, Space as Yt, DatePicker as jt, message as Ut, Dropdown as Wt, Tooltip as Kt, Progress as Xt, Pagination as Jt, theme as Qt } from "antd";
|
|
4
4
|
import { createFromIconfontCN as Zt, LeftOutlined as en, SearchOutlined as tn, ReloadOutlined as nn, InfoCircleOutlined as rn, SendOutlined as an, PauseCircleOutlined as on, PlayCircleOutlined as sn } from "@ant-design/icons";
|
|
5
5
|
import { createPortal as at } from "react-dom";
|
|
6
6
|
const ln = ({
|
|
@@ -12,8 +12,8 @@ const ln = ({
|
|
|
12
12
|
Ae,
|
|
13
13
|
{
|
|
14
14
|
...i,
|
|
15
|
-
type: ((
|
|
16
|
-
switch (
|
|
15
|
+
type: ((A) => {
|
|
16
|
+
switch (A) {
|
|
17
17
|
case "primary":
|
|
18
18
|
return "primary";
|
|
19
19
|
case "ghost":
|
|
@@ -83,11 +83,11 @@ const cn = ({
|
|
|
83
83
|
bordered: c = !0,
|
|
84
84
|
hoverable: i = !1,
|
|
85
85
|
size: g = "default",
|
|
86
|
-
...
|
|
86
|
+
...A
|
|
87
87
|
}) => /* @__PURE__ */ M(
|
|
88
88
|
nt,
|
|
89
89
|
{
|
|
90
|
-
...
|
|
90
|
+
...A,
|
|
91
91
|
title: t,
|
|
92
92
|
bordered: c,
|
|
93
93
|
hoverable: i,
|
|
@@ -150,12 +150,12 @@ const un = ({
|
|
|
150
150
|
showDefaultFooter: t = !0,
|
|
151
151
|
...y
|
|
152
152
|
}) => {
|
|
153
|
-
const c = y.footer !== void 0 ? y.footer : t ? (i, { OkBtn: g, CancelBtn:
|
|
153
|
+
const c = y.footer !== void 0 ? y.footer : t ? (i, { OkBtn: g, CancelBtn: A }) => /* @__PURE__ */ ie(Ot, { children: [
|
|
154
154
|
/* @__PURE__ */ M(g, {}),
|
|
155
|
-
/* @__PURE__ */ M(
|
|
155
|
+
/* @__PURE__ */ M(A, {})
|
|
156
156
|
] }) : null;
|
|
157
157
|
return /* @__PURE__ */ M(
|
|
158
|
-
|
|
158
|
+
Gt,
|
|
159
159
|
{
|
|
160
160
|
...y,
|
|
161
161
|
footer: c
|
|
@@ -304,7 +304,7 @@ const pn = Zt({
|
|
|
304
304
|
style: i,
|
|
305
305
|
...g
|
|
306
306
|
}) => {
|
|
307
|
-
const
|
|
307
|
+
const A = {
|
|
308
308
|
fontSize: y,
|
|
309
309
|
color: c,
|
|
310
310
|
...i
|
|
@@ -314,7 +314,7 @@ const pn = Zt({
|
|
|
314
314
|
{
|
|
315
315
|
...g,
|
|
316
316
|
type: t,
|
|
317
|
-
style:
|
|
317
|
+
style: A
|
|
318
318
|
}
|
|
319
319
|
);
|
|
320
320
|
};
|
|
@@ -360,7 +360,7 @@ const mn = ({
|
|
|
360
360
|
className: c,
|
|
361
361
|
emptyChildren: i,
|
|
362
362
|
loadingText: g,
|
|
363
|
-
emptyImage:
|
|
363
|
+
emptyImage: A
|
|
364
364
|
}) => t ? /* @__PURE__ */ ie(
|
|
365
365
|
ht,
|
|
366
366
|
{
|
|
@@ -382,7 +382,7 @@ const mn = ({
|
|
|
382
382
|
children: /* @__PURE__ */ M(
|
|
383
383
|
zt,
|
|
384
384
|
{
|
|
385
|
-
image:
|
|
385
|
+
image: A,
|
|
386
386
|
description: y,
|
|
387
387
|
imageStyle: { height: 180 },
|
|
388
388
|
children: i
|
|
@@ -548,26 +548,26 @@ const { Option: gn } = ze, xn = ({
|
|
|
548
548
|
searchFields: c = [],
|
|
549
549
|
showSearch: i = !0,
|
|
550
550
|
showRefresh: g = !0,
|
|
551
|
-
defaultPageSize:
|
|
551
|
+
defaultPageSize: A = 10,
|
|
552
552
|
pageSizeOptions: I = ["10", "20", "50", "100"],
|
|
553
553
|
autoLoad: D = !0,
|
|
554
554
|
externalParams: S = {},
|
|
555
555
|
...E
|
|
556
556
|
}) => {
|
|
557
|
-
const [
|
|
557
|
+
const [q, $] = ae([]), [P, C] = ae(!1), [e, r] = ae({
|
|
558
558
|
current: 1,
|
|
559
|
-
pageSize:
|
|
559
|
+
pageSize: A,
|
|
560
560
|
total: 0
|
|
561
|
-
}), [a, u] = ae({}), [f,
|
|
561
|
+
}), [a, u] = ae({}), [f, N] = ae({}), [T] = He.useForm(), z = re(e);
|
|
562
562
|
z.current = e;
|
|
563
563
|
const F = re(S);
|
|
564
564
|
F.current = S;
|
|
565
|
-
const
|
|
566
|
-
const { sortable: p, render:
|
|
565
|
+
const U = re(!1), Y = tt(() => t.map((d) => {
|
|
566
|
+
const { sortable: p, render: b, ...v } = d;
|
|
567
567
|
return {
|
|
568
568
|
...v,
|
|
569
569
|
sorter: p ? !0 : void 0,
|
|
570
|
-
render:
|
|
570
|
+
render: b || ((_) => _)
|
|
571
571
|
};
|
|
572
572
|
}), [t]), n = se(async (d = {}) => {
|
|
573
573
|
if (y) {
|
|
@@ -580,10 +580,10 @@ const { Option: gn } = ze, xn = ({
|
|
|
580
580
|
sortOrder: f.order,
|
|
581
581
|
searchParams: { ...a, ...F.current },
|
|
582
582
|
...d
|
|
583
|
-
},
|
|
584
|
-
|
|
583
|
+
}, b = await y(p);
|
|
584
|
+
b.success && ($(b.data), r((v) => ({
|
|
585
585
|
...v,
|
|
586
|
-
total:
|
|
586
|
+
total: b.total,
|
|
587
587
|
current: p.page || v.current
|
|
588
588
|
})));
|
|
589
589
|
} catch (p) {
|
|
@@ -598,20 +598,20 @@ const { Option: gn } = ze, xn = ({
|
|
|
598
598
|
T.resetFields(), u({}), r((d) => ({ ...d, current: 1 }));
|
|
599
599
|
}, [T]), H = se(() => {
|
|
600
600
|
n();
|
|
601
|
-
}, [n]), X = se((d, p,
|
|
601
|
+
}, [n]), X = se((d, p, b) => {
|
|
602
602
|
const v = {
|
|
603
603
|
current: d.current || 1,
|
|
604
|
-
pageSize: d.pageSize ||
|
|
604
|
+
pageSize: d.pageSize || A,
|
|
605
605
|
total: d.total || 0
|
|
606
|
-
},
|
|
607
|
-
field:
|
|
608
|
-
order:
|
|
606
|
+
}, _ = {
|
|
607
|
+
field: b?.field,
|
|
608
|
+
order: b?.order
|
|
609
609
|
};
|
|
610
|
-
r(v),
|
|
611
|
-
}, [
|
|
610
|
+
r(v), N(_);
|
|
611
|
+
}, [A]);
|
|
612
612
|
return de(() => {
|
|
613
613
|
const d = Object.keys(S).length > 0;
|
|
614
|
-
(D && !
|
|
614
|
+
(D && !U.current || d) && (n(), U.current = !0);
|
|
615
615
|
}, [D, S, n]), /* @__PURE__ */ ie("div", { children: [
|
|
616
616
|
i && c.length > 0 && /* @__PURE__ */ M(nt, { size: "small", style: { marginBottom: 16 }, children: /* @__PURE__ */ ie(
|
|
617
617
|
He,
|
|
@@ -649,7 +649,7 @@ const { Option: gn } = ze, xn = ({
|
|
|
649
649
|
{
|
|
650
650
|
...E,
|
|
651
651
|
columns: Y,
|
|
652
|
-
dataSource:
|
|
652
|
+
dataSource: q,
|
|
653
653
|
loading: P,
|
|
654
654
|
pagination: {
|
|
655
655
|
...e,
|
|
@@ -740,13 +740,13 @@ function Ze(t, y, c) {
|
|
|
740
740
|
key: $.key,
|
|
741
741
|
exclusionGroup: $.exclusionGroup
|
|
742
742
|
}));
|
|
743
|
-
const
|
|
743
|
+
const A = {};
|
|
744
744
|
for (const $ of i) {
|
|
745
|
-
|
|
745
|
+
A[$] = !1;
|
|
746
746
|
for (const P of g[$])
|
|
747
747
|
if (P.type === "upload" && P.key) {
|
|
748
748
|
if (c[P.key] !== null && c[P.key] !== void 0) {
|
|
749
|
-
|
|
749
|
+
A[$] = !0;
|
|
750
750
|
break;
|
|
751
751
|
}
|
|
752
752
|
} else if ((P.type === "variable" || P.type === "multi-variable") && P.key) {
|
|
@@ -757,20 +757,20 @@ function Ze(t, y, c) {
|
|
|
757
757
|
)].filter(Boolean);
|
|
758
758
|
for (const e of C)
|
|
759
759
|
if (!e.classList.contains("show-placeholder") && e.innerText.replace(/[\u200B\n]/g, "").trim().length > 0) {
|
|
760
|
-
|
|
760
|
+
A[$] = !0;
|
|
761
761
|
break;
|
|
762
762
|
}
|
|
763
|
-
if (
|
|
763
|
+
if (A[$])
|
|
764
764
|
break;
|
|
765
765
|
}
|
|
766
766
|
}
|
|
767
|
-
const I = y.some(($) => $.exclusionGroup === "separator"), S = Object.keys(
|
|
768
|
-
($) =>
|
|
767
|
+
const I = y.some(($) => $.exclusionGroup === "separator"), S = Object.keys(A).filter(
|
|
768
|
+
($) => A[$]
|
|
769
769
|
).length > 0;
|
|
770
770
|
let E = null;
|
|
771
771
|
if (S && I) {
|
|
772
772
|
for (const $ of y)
|
|
773
|
-
if ($.exclusionGroup && $.exclusionGroup !== "separator" &&
|
|
773
|
+
if ($.exclusionGroup && $.exclusionGroup !== "separator" && A[$.exclusionGroup]) {
|
|
774
774
|
E = $.exclusionGroup;
|
|
775
775
|
break;
|
|
776
776
|
}
|
|
@@ -812,7 +812,7 @@ function et(t, y, c, i) {
|
|
|
812
812
|
}
|
|
813
813
|
return u.filter((z, F) => F !== f).map((z) => (z.textContent || "").replace(/[\u200B]/g, "").trim()).join(`
|
|
814
814
|
`).trim() || a;
|
|
815
|
-
},
|
|
815
|
+
}, A = (e) => e ? !!e.closest('[data-rte-force-hidden="1"]') : !1, I = [];
|
|
816
816
|
for (let e = 0; e < y.length; e++) {
|
|
817
817
|
const r = y[e];
|
|
818
818
|
if ((r.type === "variable" || r.type === "report-url" || r.type === "upload" || r.type === "multi-variable" || r.type === "select" || r.type === "textarea" || r.type === "richtext" || r.type === "report-module" || r.type === "datepicker") && r.required && r.key) {
|
|
@@ -862,8 +862,8 @@ function et(t, y, c, i) {
|
|
|
862
862
|
r.exclusionGroup === "separator" && e.push(a);
|
|
863
863
|
});
|
|
864
864
|
for (const r of e) {
|
|
865
|
-
const u = I.filter((T) => typeof T.__index == "number" && T.__index < r).sort((T, z) => (z.__index ?? 0) - (T.__index ?? 0))[0],
|
|
866
|
-
u &&
|
|
865
|
+
const u = I.filter((T) => typeof T.__index == "number" && T.__index < r).sort((T, z) => (z.__index ?? 0) - (T.__index ?? 0))[0], N = I.filter((T) => typeof T.__index == "number" && T.__index > r).sort((T, z) => (T.__index ?? 0) - (z.__index ?? 0))[0];
|
|
866
|
+
u && N && S.push([u, N]);
|
|
867
867
|
}
|
|
868
868
|
}
|
|
869
869
|
if (I.length === 0) {
|
|
@@ -887,14 +887,14 @@ function et(t, y, c, i) {
|
|
|
887
887
|
);
|
|
888
888
|
if (r.length > 0) {
|
|
889
889
|
const a = r[0];
|
|
890
|
-
return
|
|
890
|
+
return A(a) ? !0 : a.style.display !== "none";
|
|
891
891
|
}
|
|
892
892
|
}
|
|
893
893
|
if (e.type === "upload" && e.key) {
|
|
894
894
|
const r = t.current.querySelector(`[data-type="upload"][data-key="${e.key}"]`) || t.current.querySelector(`[data-type="upload"][data-batch-key="${e.key}"]`);
|
|
895
895
|
if (r) {
|
|
896
896
|
const a = r.closest("[data-group]") || r.parentElement;
|
|
897
|
-
return
|
|
897
|
+
return A(a) ? !0 : a ? a.style.display !== "none" : !0;
|
|
898
898
|
}
|
|
899
899
|
} else if (e.type === "variable" && e.key)
|
|
900
900
|
if (e.isMultiVariable) {
|
|
@@ -903,7 +903,7 @@ function et(t, y, c, i) {
|
|
|
903
903
|
);
|
|
904
904
|
if (r.length > 0) {
|
|
905
905
|
const a = r[0], u = a.closest("[data-group]") || a.parentElement;
|
|
906
|
-
return
|
|
906
|
+
return A(u) ? !0 : u ? u.style.display !== "none" : !0;
|
|
907
907
|
}
|
|
908
908
|
} else {
|
|
909
909
|
const r = t.current.querySelector(
|
|
@@ -911,7 +911,7 @@ function et(t, y, c, i) {
|
|
|
911
911
|
);
|
|
912
912
|
if (r) {
|
|
913
913
|
const a = r.closest("[data-group]") || r.parentElement;
|
|
914
|
-
return
|
|
914
|
+
return A(a) ? !0 : a ? a.style.display !== "none" : !0;
|
|
915
915
|
}
|
|
916
916
|
}
|
|
917
917
|
else if (e.type === "select" && e.key) {
|
|
@@ -920,7 +920,7 @@ function et(t, y, c, i) {
|
|
|
920
920
|
);
|
|
921
921
|
if (r) {
|
|
922
922
|
const a = r.closest("[data-group]") || r.parentElement;
|
|
923
|
-
return
|
|
923
|
+
return A(a) ? !0 : a ? a.style.display !== "none" : !0;
|
|
924
924
|
}
|
|
925
925
|
} else if (e.type === "textarea" && e.key) {
|
|
926
926
|
const r = t.current.querySelector(
|
|
@@ -928,13 +928,13 @@ function et(t, y, c, i) {
|
|
|
928
928
|
);
|
|
929
929
|
if (r) {
|
|
930
930
|
const a = r.closest("[data-group]") || r.parentElement;
|
|
931
|
-
return
|
|
931
|
+
return A(a) ? !0 : a ? a.style.display !== "none" : !0;
|
|
932
932
|
}
|
|
933
933
|
} else if (e.type === "richtext" && e.key) {
|
|
934
934
|
const r = typeof e.moduleIndex == "number" ? `[data-type="richtext"][data-node-type="report-module"][data-key="${e.key}"][data-module-index="${e.moduleIndex}"]` : `[data-type="richtext"][data-key="${e.key}"]`, a = t.current.querySelector(r);
|
|
935
935
|
if (a) {
|
|
936
936
|
const u = a.closest("[data-group]") || a.parentElement;
|
|
937
|
-
return
|
|
937
|
+
return A(u) ? !0 : u ? u.style.display !== "none" : !0;
|
|
938
938
|
}
|
|
939
939
|
} else if (e.type === "datepicker" && e.key) {
|
|
940
940
|
const r = t.current.querySelector(
|
|
@@ -942,7 +942,7 @@ function et(t, y, c, i) {
|
|
|
942
942
|
);
|
|
943
943
|
if (r) {
|
|
944
944
|
const a = r.closest("[data-group]") || r.parentElement;
|
|
945
|
-
return
|
|
945
|
+
return A(a) ? !0 : a ? a.style.display !== "none" : !0;
|
|
946
946
|
}
|
|
947
947
|
}
|
|
948
948
|
return !1;
|
|
@@ -951,14 +951,14 @@ function et(t, y, c, i) {
|
|
|
951
951
|
i(!0);
|
|
952
952
|
return;
|
|
953
953
|
}
|
|
954
|
-
const
|
|
954
|
+
const q = /* @__PURE__ */ new Set();
|
|
955
955
|
S.forEach((e) => {
|
|
956
956
|
e.forEach((r) => {
|
|
957
|
-
r.key &&
|
|
957
|
+
r.key && q.add(r.key);
|
|
958
958
|
});
|
|
959
959
|
});
|
|
960
960
|
const $ = E.filter(
|
|
961
|
-
(e) => !e.key || !
|
|
961
|
+
(e) => !e.key || !q.has(e.key)
|
|
962
962
|
);
|
|
963
963
|
let P = (S.length === 0, !0);
|
|
964
964
|
for (const e of S) {
|
|
@@ -969,8 +969,8 @@ function et(t, y, c, i) {
|
|
|
969
969
|
`[data-group="${u.exclusionGroup}"]`
|
|
970
970
|
);
|
|
971
971
|
if (f.length > 0) {
|
|
972
|
-
const
|
|
973
|
-
return
|
|
972
|
+
const N = f[0];
|
|
973
|
+
return A(N) ? !0 : N.style.display !== "none";
|
|
974
974
|
}
|
|
975
975
|
}
|
|
976
976
|
return !0;
|
|
@@ -982,13 +982,13 @@ function et(t, y, c, i) {
|
|
|
982
982
|
if (u.type === "upload" && u.key) {
|
|
983
983
|
if (u.minCount && u.minCount > 0) {
|
|
984
984
|
let f = 0;
|
|
985
|
-
const
|
|
985
|
+
const N = t.current.querySelectorAll(
|
|
986
986
|
`[data-type="upload"][data-batch-key="${u.key}"]`
|
|
987
987
|
);
|
|
988
|
-
if (
|
|
988
|
+
if (N.length === 0)
|
|
989
989
|
continue;
|
|
990
|
-
for (let T = 0; T <
|
|
991
|
-
const F =
|
|
990
|
+
for (let T = 0; T < N.length; T++) {
|
|
991
|
+
const F = N[T].dataset.key;
|
|
992
992
|
F && c[F] != null && (f += 1);
|
|
993
993
|
}
|
|
994
994
|
if (f >= u.minCount) {
|
|
@@ -1004,14 +1004,14 @@ function et(t, y, c, i) {
|
|
|
1004
1004
|
const f = t.current.querySelectorAll(
|
|
1005
1005
|
`[data-type="variable"][data-multi-key="${u.key}"]`
|
|
1006
1006
|
);
|
|
1007
|
-
let
|
|
1007
|
+
let N = 0;
|
|
1008
1008
|
for (const z of Array.from(f)) {
|
|
1009
1009
|
if (z.classList.contains("show-placeholder"))
|
|
1010
1010
|
continue;
|
|
1011
|
-
z.innerText.replace(/[\u200B\n]/g, "").trim().length > 0 && (
|
|
1011
|
+
z.innerText.replace(/[\u200B\n]/g, "").trim().length > 0 && (N += 1);
|
|
1012
1012
|
}
|
|
1013
1013
|
const T = u.minCount && u.minCount > 0 ? u.minCount : 1;
|
|
1014
|
-
if (
|
|
1014
|
+
if (N >= T) {
|
|
1015
1015
|
a = !0;
|
|
1016
1016
|
break;
|
|
1017
1017
|
}
|
|
@@ -1045,8 +1045,8 @@ function et(t, y, c, i) {
|
|
|
1045
1045
|
break;
|
|
1046
1046
|
}
|
|
1047
1047
|
} else if (u.type === "richtext" && u.key) {
|
|
1048
|
-
const f = typeof u.moduleIndex == "number" ? `[data-type="richtext"][data-node-type="report-module"][data-key="${u.key}"][data-module-index="${u.moduleIndex}"]` : `[data-type="richtext"][data-key="${u.key}"]`,
|
|
1049
|
-
if (
|
|
1048
|
+
const f = typeof u.moduleIndex == "number" ? `[data-type="richtext"][data-node-type="report-module"][data-key="${u.key}"][data-module-index="${u.moduleIndex}"]` : `[data-type="richtext"][data-key="${u.key}"]`, N = t.current.querySelector(f);
|
|
1049
|
+
if (N && g(N).length > 0) {
|
|
1050
1050
|
a = !0;
|
|
1051
1051
|
break;
|
|
1052
1052
|
}
|
|
@@ -1077,8 +1077,8 @@ function et(t, y, c, i) {
|
|
|
1077
1077
|
break;
|
|
1078
1078
|
}
|
|
1079
1079
|
for (let u = 0; u < a.length; u++) {
|
|
1080
|
-
const
|
|
1081
|
-
|
|
1080
|
+
const N = a[u].dataset.key;
|
|
1081
|
+
N && c[N] != null && (r += 1);
|
|
1082
1082
|
}
|
|
1083
1083
|
if (r < e.minCount) {
|
|
1084
1084
|
C = !1;
|
|
@@ -1162,13 +1162,13 @@ function Qe(t, y) {
|
|
|
1162
1162
|
});
|
|
1163
1163
|
}
|
|
1164
1164
|
const bn = ({ host: t, onChange: y }) => {
|
|
1165
|
-
const c = t.dataset.key, i = t.dataset.placeholder, g = t.dataset.options ? decodeURIComponent(t.dataset.options) : "[]",
|
|
1165
|
+
const c = t.dataset.key, i = t.dataset.placeholder, g = t.dataset.options ? decodeURIComponent(t.dataset.options) : "[]", A = t.dataset.required === "true", I = t.dataset.value || "", D = Rt.useMemo(() => {
|
|
1166
1166
|
try {
|
|
1167
1167
|
return JSON.parse(g);
|
|
1168
1168
|
} catch {
|
|
1169
1169
|
return [];
|
|
1170
1170
|
}
|
|
1171
|
-
}, [g]), [S, E] = ae(I || void 0),
|
|
1171
|
+
}, [g]), [S, E] = ae(I || void 0), q = ($) => {
|
|
1172
1172
|
E($), t.setAttribute("data-value", $), y(c, $);
|
|
1173
1173
|
};
|
|
1174
1174
|
return de(() => {
|
|
@@ -1184,11 +1184,11 @@ const bn = ({ host: t, onChange: y }) => {
|
|
|
1184
1184
|
ze,
|
|
1185
1185
|
{
|
|
1186
1186
|
value: S,
|
|
1187
|
-
onChange:
|
|
1187
|
+
onChange: q,
|
|
1188
1188
|
placeholder: i || "请选择",
|
|
1189
1189
|
style: { width: "100%" },
|
|
1190
1190
|
options: D,
|
|
1191
|
-
allowClear: !
|
|
1191
|
+
allowClear: !A,
|
|
1192
1192
|
size: "small",
|
|
1193
1193
|
dropdownClassName: "rte-select-dropdown",
|
|
1194
1194
|
getPopupContainer: () => document.body,
|
|
@@ -1216,8 +1216,8 @@ const bn = ({ host: t, onChange: y }) => {
|
|
|
1216
1216
|
host: S,
|
|
1217
1217
|
onChange: () => {
|
|
1218
1218
|
if (t.current) {
|
|
1219
|
-
const
|
|
1220
|
-
t.current.dispatchEvent(
|
|
1219
|
+
const q = new Event("input", { bubbles: !0 });
|
|
1220
|
+
t.current.dispatchEvent(q);
|
|
1221
1221
|
}
|
|
1222
1222
|
}
|
|
1223
1223
|
},
|
|
@@ -1227,19 +1227,19 @@ const bn = ({ host: t, onChange: y }) => {
|
|
|
1227
1227
|
}), c(D);
|
|
1228
1228
|
};
|
|
1229
1229
|
g();
|
|
1230
|
-
const
|
|
1230
|
+
const A = new MutationObserver((I) => {
|
|
1231
1231
|
let D = !1;
|
|
1232
1232
|
for (const S of I)
|
|
1233
1233
|
if (S.type === "childList") {
|
|
1234
1234
|
let E = !1;
|
|
1235
|
-
if (S.addedNodes.forEach((
|
|
1236
|
-
if (
|
|
1237
|
-
const $ =
|
|
1235
|
+
if (S.addedNodes.forEach((q) => {
|
|
1236
|
+
if (q.nodeType === Node.ELEMENT_NODE) {
|
|
1237
|
+
const $ = q;
|
|
1238
1238
|
($.classList?.contains("rte-select-host") || $.querySelector?.(".rte-select-host")) && (E = !0);
|
|
1239
1239
|
}
|
|
1240
|
-
}), S.removedNodes.forEach((
|
|
1241
|
-
if (
|
|
1242
|
-
const $ =
|
|
1240
|
+
}), S.removedNodes.forEach((q) => {
|
|
1241
|
+
if (q.nodeType === Node.ELEMENT_NODE) {
|
|
1242
|
+
const $ = q;
|
|
1243
1243
|
($.classList?.contains("rte-select-host") || $.querySelector?.(".rte-select-host")) && (E = !0);
|
|
1244
1244
|
}
|
|
1245
1245
|
}), E) {
|
|
@@ -1249,15 +1249,15 @@ const bn = ({ host: t, onChange: y }) => {
|
|
|
1249
1249
|
}
|
|
1250
1250
|
D && g();
|
|
1251
1251
|
});
|
|
1252
|
-
return
|
|
1252
|
+
return A.observe(i, { childList: !0, subtree: !0 }), () => A.disconnect();
|
|
1253
1253
|
}, [t]), y;
|
|
1254
1254
|
}, Oe = (t) => t.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
1255
|
-
function wn(t, y, c, i, g,
|
|
1255
|
+
function wn(t, y, c, i, g, A = {}, I, D) {
|
|
1256
1256
|
if (!t.current) return;
|
|
1257
1257
|
const S = /[;;,,。.!!??::、]/, E = (e) => {
|
|
1258
1258
|
const r = (e ?? "").trim();
|
|
1259
1259
|
return r.length === 1 && S.test(r);
|
|
1260
|
-
},
|
|
1260
|
+
}, q = (e) => {
|
|
1261
1261
|
const r = e ?? "", a = r.match(new RegExp(`^\\s*(${S.source})`));
|
|
1262
1262
|
if (!a) return null;
|
|
1263
1263
|
const u = a[1], f = r.replace(new RegExp(`^\\s*${S.source}`), "");
|
|
@@ -1267,44 +1267,44 @@ function wn(t, y, c, i, g, _ = {}, I, D) {
|
|
|
1267
1267
|
for (; C < y.length; ) {
|
|
1268
1268
|
const e = y[C], r = C + 1 < y.length ? y[C + 1] : null;
|
|
1269
1269
|
if (e.type === "text" && (e.text?.includes("icon-bitian") || e.className === "rte-text-required") && r) {
|
|
1270
|
-
const F = r.type === "upload" && r.exclusionGroup === "fileInput" && e.exclusionGroup === "fileInput" && e.exclusionGroup === r.exclusionGroup,
|
|
1270
|
+
const F = r.type === "upload" && r.exclusionGroup === "fileInput" && e.exclusionGroup === "fileInput" && e.exclusionGroup === r.exclusionGroup, U = r.type === "variable" && r.exclusionGroup === "textInput" && e.exclusionGroup === "textInput" && e.exclusionGroup === r.exclusionGroup;
|
|
1271
1271
|
if (F) {
|
|
1272
1272
|
const Y = e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : "", n = `<span ${Y} class="exclusion-wrapper required-upload-group">`, V = "</span>";
|
|
1273
1273
|
let k = "";
|
|
1274
1274
|
e.className ? k = `<span class="${e.className}">${e.text ?? ""}</span>` : k = e.text ?? "";
|
|
1275
|
-
const H = r, X = c[H.key] !== null && c[H.key] !== void 0, d = X ? c[H.key] : null, p = X ? c[H.key]?.name : H.text,
|
|
1276
|
-
let
|
|
1277
|
-
X && d ? d.type?.startsWith("image/") ?
|
|
1278
|
-
const Z = (H.text || "").trim(), ue = X && Z.length >= 12 ? `<span ${Y} contenteditable="false" class="exclusion-wrapper upload-hint">${Z}</span>` : "", me = `<span contenteditable="false" data-type="upload" data-key="${H.key}" class="upload-chip"><span class="upload-inner-wrapper ${
|
|
1275
|
+
const H = r, X = c[H.key] !== null && c[H.key] !== void 0, d = X ? c[H.key] : null, p = X ? c[H.key]?.name : H.text, b = X ? "" : "hidden", v = H.tooltip && !X ? "" : "hidden", _ = X ? "has-file" : "", j = X && p ? ` data-file-name="${p.replace(/"/g, """)}"` : "";
|
|
1276
|
+
let W = "";
|
|
1277
|
+
X && d ? d.type?.startsWith("image/") ? W = `<img class="upload-icon-img upload-icon-preview" src="${URL.createObjectURL(d)}" alt="preview" />` : W = "<i class='iconfont icon-exlwenjian'></i>" : W = "<i class='iconfont icon-shangchuan1'></i>";
|
|
1278
|
+
const Z = (H.text || "").trim(), ue = X && Z.length >= 12 ? `<span ${Y} contenteditable="false" class="exclusion-wrapper upload-hint">${Z}</span>` : "", me = `<span contenteditable="false" data-type="upload" data-key="${H.key}" class="upload-chip"><span class="upload-inner-wrapper ${_}"><span class="upload-icon">${W}</span><span class="upload-label"${j}>${p || H.text}</span>${H.tooltip ? `<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi upload-info-icon ${v}" data-upload-key="${H.key}" data-tooltip="${H.tooltip}"></i>` : ""}<span class="file-remove-btn ${b}" title="移除文件">×</span></span></span>`;
|
|
1279
1279
|
P.push(n + k + me + V + ue), C += 2;
|
|
1280
1280
|
continue;
|
|
1281
1281
|
}
|
|
1282
|
-
if (
|
|
1282
|
+
if (U) {
|
|
1283
1283
|
const n = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group">`, V = "</span>";
|
|
1284
1284
|
let k = "";
|
|
1285
1285
|
e.className ? k = `<span class="${e.className}">${e.text ?? ""}</span>` : k = e.text ?? "";
|
|
1286
|
-
const H = r, d = (H.key ? g[H.key] : void 0) || H.text || "", p = !d,
|
|
1286
|
+
const H = r, d = (H.key ? g[H.key] : void 0) || H.text || "", p = !d, b = p ? "" : d, v = p ? "show-placeholder" : "", _ = H.exclusionGroup ? ` data-group="${H.exclusionGroup}"` : "", j = H.tooltip ? ` data-tooltip="${H.tooltip.replace(/"/g, """)}" data-variable-key="${H.key || ""}"` : "", W = H.tooltip && p ? "" : "hidden", Z = `<span contenteditable="true" data-type="variable" data-key="${H.key}" data-placeholder="${H.placeholder || ""}"${_}${j} class="variable-chip ${v}">${b}${H.tooltip ? `<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi variable-info-icon ${W}" data-variable-key="${H.key}" data-tooltip="${H.tooltip.replace(/"/g, """)}" ></i>` : ""}</span>`;
|
|
1287
1287
|
P.push(n + k + Z + V), C += 2;
|
|
1288
1288
|
continue;
|
|
1289
1289
|
}
|
|
1290
1290
|
}
|
|
1291
|
-
const u = e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : "", f = e.exclusionGroup ? `<span ${u} class="exclusion-wrapper">` : "",
|
|
1291
|
+
const u = e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : "", f = e.exclusionGroup ? `<span ${u} class="exclusion-wrapper">` : "", N = e.exclusionGroup ? "</span>" : "";
|
|
1292
1292
|
let T = "";
|
|
1293
1293
|
if (e.type === "tag") {
|
|
1294
|
-
const
|
|
1295
|
-
T = `<span contenteditable="false" class="tag-node group"${Y}${n}><span class="tag-label">${e.text}</span>${
|
|
1294
|
+
const U = i || I === "hideTagClose" ? "" : '<span class="tag-close-btn" title="Clear (ESC)"><svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6L6 18M6 6l12 12"/></svg></span>', Y = i ? ' data-locked="true"' : "", n = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, """)}" data-tag-key="${e.key || ""}"` : "";
|
|
1295
|
+
T = `<span contenteditable="false" class="tag-node group"${Y}${n}><span class="tag-label">${e.text}</span>${U}</span>`;
|
|
1296
1296
|
} else if (e.type === "text") {
|
|
1297
1297
|
const F = i ? ' data-locked="true" contenteditable="false"' : ' contenteditable="false"', Y = (e.text ?? "").replace(/\n/g, "<br/>");
|
|
1298
1298
|
e.className ? T = `<span data-type="text" class="${e.className}"${F}>${Y}</span>` : T = i ? `<span data-type="text"${F}>${Y}</span>` : `<span data-type="text" contenteditable="false">${Y}</span>`;
|
|
1299
1299
|
} else if (e.type === "variable" && e.key) {
|
|
1300
|
-
const
|
|
1300
|
+
const U = g[e.key] || e.text || "", Y = !U, n = Y ? "" : U, V = Y ? "show-placeholder" : "", k = e.exclusionGroup ? ` data-group="${e.exclusionGroup}"` : "", H = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, """)}" data-variable-key="${e.key || ""}"` : "", X = e.tooltip && Y ? "" : "hidden", d = `<span contenteditable="true" data-type="variable" data-key="${e.key}" data-placeholder="${e.placeholder || ""}"${k}${H} class="variable-chip ${V}">${n}${e.tooltip ? `<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi variable-info-icon ${X}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g, """)}" ></i>` : ""}</span>`;
|
|
1301
1301
|
e.required ? T = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${d}</span>` : T = d;
|
|
1302
1302
|
} else if (e.type === "report-url" && e.key) {
|
|
1303
|
-
const F = `${e.key}__url`, Y = Object.prototype.hasOwnProperty.call(g, F) ? g[F] : void 0, n = g[e.key], V = Y ?? n ?? e.text ?? "", k = !V, H = k ? "" : V, X = k ? "show-placeholder" : "", d = e.exclusionGroup ? ` data-group="${e.exclusionGroup}"` : "", p = e.tooltip ? ` data-tooltip="${Oe(e.tooltip)}" data-variable-key="${e.key || ""}"` : "",
|
|
1303
|
+
const F = `${e.key}__url`, Y = Object.prototype.hasOwnProperty.call(g, F) ? g[F] : void 0, n = g[e.key], V = Y ?? n ?? e.text ?? "", k = !V, H = k ? "" : V, X = k ? "show-placeholder" : "", d = e.exclusionGroup ? ` data-group="${e.exclusionGroup}"` : "", p = e.tooltip ? ` data-tooltip="${Oe(e.tooltip)}" data-variable-key="${e.key || ""}"` : "", b = e.tooltip && k ? "" : "hidden", v = `<span contenteditable="true" data-type="variable" data-key="${e.key}" data-node-type="report-url" data-placeholder="${Oe(e.placeholder || "")}"${d}${p} class="variable-chip rte-report-url ${X}">${H}${e.tooltip ? `<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi variable-info-icon ${b}" data-variable-key="${e.key}" data-tooltip="${Oe(e.tooltip)}" ></i>` : ""}</span>`;
|
|
1304
1304
|
e.required ? T = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${v}</span>` : T = v;
|
|
1305
1305
|
} else if (e.type === "upload" && e.key)
|
|
1306
1306
|
if (typeof e.maxCount == "number" && typeof e.minCount == "number" && e.maxCount > 1) {
|
|
1307
|
-
const
|
|
1307
|
+
const U = e.minCount || 1, Y = e.maxCount || 3;
|
|
1308
1308
|
let n = 0;
|
|
1309
1309
|
for (let H = 0; H < Y; H++) {
|
|
1310
1310
|
const X = `${e.key}-${H}`;
|
|
@@ -1312,69 +1312,69 @@ function wn(t, y, c, i, g, _ = {}, I, D) {
|
|
|
1312
1312
|
}
|
|
1313
1313
|
const V = Math.min(
|
|
1314
1314
|
Y,
|
|
1315
|
-
Math.max(
|
|
1315
|
+
Math.max(U, n + (n < Y ? 1 : 0))
|
|
1316
1316
|
);
|
|
1317
1317
|
let k = "";
|
|
1318
1318
|
for (let H = 0; H < V; H++) {
|
|
1319
|
-
const X = `${e.key}-${H}`, d = c[X] !== null && c[X] !== void 0, p = d ? c[X] : null,
|
|
1319
|
+
const X = `${e.key}-${H}`, d = c[X] !== null && c[X] !== void 0, p = d ? c[X] : null, b = d ? c[X]?.name : e.text, v = d ? "" : "hidden", _ = e.tooltip && !d ? "" : "hidden", j = d ? "has-file" : "", W = d && b ? ` data-file-name="${b.replace(/"/g, """)}"` : "";
|
|
1320
1320
|
let Z = "";
|
|
1321
1321
|
d && p ? p.type?.startsWith("image/") ? Z = `<img class="upload-icon-img upload-icon-preview" src="${URL.createObjectURL(p)}" alt="preview" />` : Z = "<i class='iconfont icon-exlwenjian'></i>" : Z = "<i class='iconfont icon-shangchuan1'></i>";
|
|
1322
|
-
const oe = ` data-batch-key="${e.key}"`, ue = ` data-batch-index="${H}"`, me = `<span contenteditable="false" data-type="upload" data-key="${X}"${oe}${ue} class="upload-chip upload-chip-batch"><span class="upload-inner-wrapper ${j}"><span class="upload-icon">${Z}</span><span class="upload-label"${
|
|
1322
|
+
const oe = ` data-batch-key="${e.key}"`, ue = ` data-batch-index="${H}"`, me = `<span contenteditable="false" data-type="upload" data-key="${X}"${oe}${ue} class="upload-chip upload-chip-batch"><span class="upload-inner-wrapper ${j}"><span class="upload-icon">${Z}</span><span class="upload-label"${W}>${b || e.text}</span>${e.tooltip ? `<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi upload-info-icon ${_}" data-upload-key="${X}" data-tooltip="${e.tooltip}" ></i>` : ""}<span class="file-remove-btn ${v}" title="移除文件">×</span></span></span>`;
|
|
1323
1323
|
k += me;
|
|
1324
1324
|
}
|
|
1325
1325
|
e.required ? T = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group rte-required-upload-batch"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span><span class="rte-upload-batch-chips">${k}</span></span>` : T = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper rte-upload-batch-chips">${k}</span>`;
|
|
1326
1326
|
} else {
|
|
1327
|
-
const
|
|
1327
|
+
const U = c[e.key] !== null && c[e.key] !== void 0, Y = U ? c[e.key] : null, n = U ? c[e.key]?.name : e.text, V = U ? "" : "hidden", k = e.tooltip && !U ? "" : "hidden", H = U ? "has-file" : "", X = U && n ? ` data-file-name="${n.replace(/"/g, """)}"` : "";
|
|
1328
1328
|
let d = "";
|
|
1329
|
-
|
|
1330
|
-
const p = (e.text || "").trim(), v =
|
|
1331
|
-
e.required ? T = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${
|
|
1329
|
+
U && Y ? Y.type?.startsWith("image/") ? d = `<img class="upload-icon-img upload-icon-preview" src="${URL.createObjectURL(Y)}" alt="preview" />` : d = "<i class='iconfont icon-exlwenjian'></i>" : d = "<i class='iconfont icon-shangchuan1'></i>";
|
|
1330
|
+
const p = (e.text || "").trim(), v = U && e.showHint === !0 && p.length >= 12 ? `<span ${u} contenteditable="false" class="exclusion-wrapper upload-hint">${p}</span>` : "", _ = `<span contenteditable="false" data-type="upload" data-key="${e.key}" class="upload-chip"><span class="upload-inner-wrapper ${H}"><span class="upload-icon">${d}</span><span class="upload-label"${X}>${n || e.text}</span>${e.tooltip ? `<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi upload-info-icon ${k}" data-upload-key="${e.key}" data-tooltip="${e.tooltip}" ></i>` : ""}<span class="file-remove-btn ${V}" title="移除文件">×</span></span></span>`;
|
|
1331
|
+
e.required ? T = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${_}</span>${v}` : T = _ + v;
|
|
1332
1332
|
}
|
|
1333
1333
|
else if (e.type === "select" && e.key) {
|
|
1334
|
-
const F = g[e.key] || e.defaultValue || "",
|
|
1334
|
+
const F = g[e.key] || e.defaultValue || "", U = encodeURIComponent(JSON.stringify(e.options || [])), Y = e.placeholder ? ` data-placeholder="${e.placeholder}"` : "", n = e.exclusionGroup ? ` data-group="${e.exclusionGroup}"` : "", V = e.required ? ' data-required="true"' : "", k = `<div data-type="select" data-key="${e.key}" data-value="${F}" data-options="${U}"${Y}${n}${V} class="rte-select-host"></div>`;
|
|
1335
1335
|
e.required ? T = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${k}</span>` : T = k;
|
|
1336
1336
|
} else if (e.type === "textarea" && e.key) {
|
|
1337
|
-
const F = g[e.key] || "",
|
|
1337
|
+
const F = g[e.key] || "", U = typeof e.maxHeight == "number" ? e.maxHeight : 252, Y = e.placeholder ? ` placeholder="${e.placeholder}"` : "", n = `<textarea data-type="textarea" data-key="${e.key}" class="rte-textarea" style="max-height:${U}px;"${Y}>${F}</textarea>`, V = `<div class="rte-textarea-wrapper" data-key="${e.key}">${n}</div>`;
|
|
1338
1338
|
e.required ? T = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${V}</span>` : T = V;
|
|
1339
1339
|
} else if (e.type === "richtext" && e.key) {
|
|
1340
|
-
const F = g[e.key] || e.text || "",
|
|
1341
|
-
e.required ? T = `<div ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper rte-richtext-required">${
|
|
1340
|
+
const F = g[e.key] || e.text || "", U = typeof e.minHeight == "number" ? e.minHeight : 40, Y = typeof e.maxHeight == "number" ? e.maxHeight : 160, n = Math.max(Y, U), V = e.placeholder ? ` data-placeholder="${e.placeholder}"` : "", k = e.expandable !== !1, H = F, X = `<div contenteditable="true" data-type="richtext" data-key="${e.key}" class="rte-richtext"${V} style="min-height:${U}px;max-height:${n}px;overflow:auto;">${H}</div>`, d = k ? `<button type="button" class="rte-richtext-toggle" data-key="${e.key}" data-expanded="false"><i class="iconfont icon-zhankai2"></i><span class="rte-richtext-toggle-label">展开</span></button>` : "", p = `<div class="rte-richtext-wrapper${k ? " rte-richtext-toggleable" : ""}" data-key="${e.key}">${X}${d}</div>`, b = `<div class="rte-richtext-container" data-key="${e.key}">${p}</div>`;
|
|
1341
|
+
e.required ? T = `<div ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper rte-richtext-required">${b}</div>` : T = b;
|
|
1342
1342
|
} else if (e.type === "report-module" && e.key) {
|
|
1343
|
-
const F = typeof e.moduleIndex == "number" ? e.moduleIndex : 0,
|
|
1343
|
+
const F = typeof e.moduleIndex == "number" ? e.moduleIndex : 0, U = `${e.key}__module_${F}`, n = Object.prototype.hasOwnProperty.call(g, U) ? g[U] : e.text || "", V = typeof e.minHeight == "number" ? e.minHeight : 80, k = typeof e.maxHeight == "number" ? e.maxHeight : 240, H = Math.max(k, V), X = e.placeholder ? ` data-placeholder="${Oe(e.placeholder)}"` : "", d = n, p = `<div contenteditable="true" data-type="richtext" data-key="${e.key}" data-node-type="report-module" data-module-index="${F}" class="rte-richtext rte-report-module"${X} style="min-height:${V}px;max-height:${H}px;overflow:auto;">${d}</div>`, b = `<div class="rte-richtext-wrapper rte-report-module-wrapper" data-key="${e.key}">${p}</div>`, v = `<div class="rte-richtext-container rte-report-module-container" data-key="${e.key}">${b}</div>`;
|
|
1344
1344
|
e.required ? T = `<div ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper rte-richtext-required">${v}</div>` : T = v;
|
|
1345
1345
|
} else if (e.type === "datepicker" && e.key) {
|
|
1346
|
-
const F = g[e.key] || "",
|
|
1346
|
+
const F = g[e.key] || "", U = e.placeholder ? ` data-placeholder="${e.placeholder}"` : "", Y = e.limitRange ? ` data-limit-range="${e.limitRange}"` : "", n = e.disableFuture ? ' data-disable-future="true"' : "", V = `<div data-type="datepicker" data-key="${e.key}" data-value="${F}" class="rte-datepicker-host"${U}${Y}${n}></div>`;
|
|
1347
1347
|
e.required ? T = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${V}</span>` : T = V;
|
|
1348
1348
|
} else if (e.type === "multi-variable" && e.key) {
|
|
1349
|
-
const F = e.maxCount || 9,
|
|
1349
|
+
const F = e.maxCount || 9, U = A[e.key] || 1, Y = Math.min(U, F);
|
|
1350
1350
|
if (e.required) {
|
|
1351
1351
|
const n = `<span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>`, V = e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : "";
|
|
1352
1352
|
let k = "";
|
|
1353
1353
|
for (let H = 0; H < Y; H++) {
|
|
1354
|
-
const X = `${e.key}_${H}`, d = g[X] || "", p = !d,
|
|
1354
|
+
const X = `${e.key}_${H}`, d = g[X] || "", p = !d, b = p ? "" : d, v = p ? "show-placeholder" : "", _ = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, """)}" data-variable-key="${e.key || ""}"` : "", j = e.tooltip && p ? "" : "hidden", W = e.exclusionGroup ? ` data-group="${e.exclusionGroup}"` : "", Z = `<span contenteditable="true" data-type="variable" data-key="${X}" data-multi-key="${e.key}" data-index="${H}" data-placeholder="${e.placeholder || ""}"${W}${_} class="variable-chip ${v}">${b}${e.tooltip ? `<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi variable-info-icon ${j}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g, """)}" ></i>` : ""}</span>`;
|
|
1355
1355
|
H === 0 ? k += `<span ${V} class="exclusion-wrapper required-upload-group required-multi-first">${n}${Z}</span>` : k += Z;
|
|
1356
1356
|
}
|
|
1357
1357
|
T = k;
|
|
1358
1358
|
} else {
|
|
1359
1359
|
let n = "";
|
|
1360
1360
|
for (let V = 0; V < Y; V++) {
|
|
1361
|
-
const k = `${e.key}_${V}`, H = g[k] || "", X = !H, d = X ? "" : H, p = X ? "show-placeholder" : "",
|
|
1361
|
+
const k = `${e.key}_${V}`, H = g[k] || "", X = !H, d = X ? "" : H, p = X ? "show-placeholder" : "", b = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, """)}" data-variable-key="${e.key || ""}"` : "", v = e.tooltip && X ? "" : "hidden", _ = e.exclusionGroup ? ` data-group="${e.exclusionGroup}"` : "", j = `<span contenteditable="true" data-type="variable" data-key="${k}" data-multi-key="${e.key}" data-index="${V}" data-placeholder="${e.placeholder || ""}"${_}${b} class="variable-chip ${p}">${d}${e.tooltip ? `<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi variable-info-icon ${v}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g, """)}" ></i>` : ""}</span>`;
|
|
1362
1362
|
n += j;
|
|
1363
1363
|
}
|
|
1364
1364
|
T = n;
|
|
1365
1365
|
}
|
|
1366
1366
|
}
|
|
1367
|
-
const z = f + T +
|
|
1367
|
+
const z = f + T + N;
|
|
1368
1368
|
if (e.type === "text" && !e.className && !e.exclusionGroup) {
|
|
1369
1369
|
if (E(e.text) && P.length > 0) {
|
|
1370
|
-
const
|
|
1371
|
-
P[P.length - 1] = `<span class="rte-inline-group">${
|
|
1370
|
+
const U = P[P.length - 1], Y = (e.text ?? "").trim();
|
|
1371
|
+
P[P.length - 1] = `<span class="rte-inline-group">${U}${$(Y)}</span>`, C++;
|
|
1372
1372
|
continue;
|
|
1373
1373
|
}
|
|
1374
|
-
const F =
|
|
1374
|
+
const F = q(e.text);
|
|
1375
1375
|
if (F && P.length > 0) {
|
|
1376
|
-
const
|
|
1377
|
-
P[P.length - 1] = `<span class="rte-inline-group">${
|
|
1376
|
+
const U = P[P.length - 1];
|
|
1377
|
+
P[P.length - 1] = `<span class="rte-inline-group">${U}${$(F.punct)}</span>`;
|
|
1378
1378
|
const Y = F.rest;
|
|
1379
1379
|
if (Y) {
|
|
1380
1380
|
const n = Y.replace(/\n/g, "<br/>");
|
|
@@ -1394,63 +1394,63 @@ function wn(t, y, c, i, g, _ = {}, I, D) {
|
|
|
1394
1394
|
});
|
|
1395
1395
|
}, 0));
|
|
1396
1396
|
}
|
|
1397
|
-
function kn(t, y, c, i, g = {},
|
|
1397
|
+
function kn(t, y, c, i, g = {}, A, I, D, S) {
|
|
1398
1398
|
const E = se(() => {
|
|
1399
1399
|
if (!t.current) return;
|
|
1400
1400
|
if (y.length === 0) {
|
|
1401
1401
|
t.current.innerHTML = "";
|
|
1402
1402
|
return;
|
|
1403
1403
|
}
|
|
1404
|
-
let
|
|
1404
|
+
let q = {};
|
|
1405
1405
|
const P = t.current.__tempVariableValues;
|
|
1406
|
-
if (P ? (
|
|
1406
|
+
if (P ? (q = P, setTimeout(() => {
|
|
1407
1407
|
if (t.current) {
|
|
1408
1408
|
const C = t.current;
|
|
1409
1409
|
C.__tempVariableValues === P && delete C.__tempVariableValues;
|
|
1410
1410
|
}
|
|
1411
1411
|
}, 100)) : (t.current.querySelectorAll('[data-type="variable"]').forEach((f) => {
|
|
1412
|
-
const
|
|
1413
|
-
if (
|
|
1412
|
+
const N = f.dataset.key;
|
|
1413
|
+
if (N) {
|
|
1414
1414
|
const T = f.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
1415
|
-
T && (f.getAttribute("data-node-type") === "report-url" ?
|
|
1415
|
+
T && (f.getAttribute("data-node-type") === "report-url" ? q[`${N}__url`] = T : q[N] = T);
|
|
1416
1416
|
}
|
|
1417
1417
|
}), t.current.querySelectorAll('[data-type="select"]').forEach((f) => {
|
|
1418
|
-
const
|
|
1419
|
-
if (
|
|
1418
|
+
const N = f.dataset.key;
|
|
1419
|
+
if (N) {
|
|
1420
1420
|
const T = (f.getAttribute("data-value") || "").trim();
|
|
1421
|
-
T && (N
|
|
1421
|
+
T && (q[N] = T);
|
|
1422
1422
|
}
|
|
1423
1423
|
}), t.current.querySelectorAll('[data-type="textarea"]').forEach((f) => {
|
|
1424
|
-
const
|
|
1425
|
-
if (
|
|
1424
|
+
const N = f.dataset.key;
|
|
1425
|
+
if (N) {
|
|
1426
1426
|
const T = f.value.replace(/[\u200B]/g, "").trim();
|
|
1427
|
-
T && (N
|
|
1427
|
+
T && (q[N] = T);
|
|
1428
1428
|
}
|
|
1429
1429
|
}), t.current.querySelectorAll('[data-type="richtext"]').forEach((f) => {
|
|
1430
|
-
const
|
|
1431
|
-
if (
|
|
1430
|
+
const N = f.dataset.key;
|
|
1431
|
+
if (N) {
|
|
1432
1432
|
const T = f.getAttribute("data-node-type") || "", z = T === "report-module" ? (f.innerHTML || "").replace(/[\u200B]/g, "").trim() : (f.textContent || "").replace(/[\u200B]/g, "").trim();
|
|
1433
1433
|
if (T === "report-module") {
|
|
1434
1434
|
const F = Number.parseInt(f.getAttribute("data-module-index") || "0", 10);
|
|
1435
|
-
|
|
1436
|
-
} else z && (N
|
|
1435
|
+
q[`${N}__module_${Number.isFinite(F) ? F : 0}`] = z;
|
|
1436
|
+
} else z && (q[N] = z);
|
|
1437
1437
|
}
|
|
1438
1438
|
}), t.current.querySelectorAll('[data-type="datepicker"]').forEach((f) => {
|
|
1439
|
-
const
|
|
1440
|
-
if (
|
|
1439
|
+
const N = f.dataset.key;
|
|
1440
|
+
if (N) {
|
|
1441
1441
|
const T = (f.getAttribute("data-value") || "").trim();
|
|
1442
|
-
T && (N
|
|
1442
|
+
T && (q[N] = T);
|
|
1443
1443
|
}
|
|
1444
1444
|
})), wn(
|
|
1445
1445
|
t,
|
|
1446
1446
|
y,
|
|
1447
1447
|
c,
|
|
1448
1448
|
i,
|
|
1449
|
-
|
|
1449
|
+
q,
|
|
1450
1450
|
g,
|
|
1451
1451
|
D
|
|
1452
|
-
),
|
|
1453
|
-
const { key: C, offset: e } =
|
|
1452
|
+
), A?.current) {
|
|
1453
|
+
const { key: C, offset: e } = A.current;
|
|
1454
1454
|
setTimeout(() => {
|
|
1455
1455
|
if (!t.current) return;
|
|
1456
1456
|
const r = t.current.querySelector(
|
|
@@ -1463,17 +1463,17 @@ function kn(t, y, c, i, g = {}, _, I, D, S) {
|
|
|
1463
1463
|
NodeFilter.SHOW_TEXT,
|
|
1464
1464
|
null
|
|
1465
1465
|
);
|
|
1466
|
-
let f = 0,
|
|
1466
|
+
let f = 0, N = null, T = 0;
|
|
1467
1467
|
for (; u.nextNode(); ) {
|
|
1468
1468
|
const z = u.currentNode, F = z.textContent?.length || 0;
|
|
1469
1469
|
if (f + F >= e) {
|
|
1470
|
-
|
|
1470
|
+
N = z, T = e - f;
|
|
1471
1471
|
break;
|
|
1472
1472
|
}
|
|
1473
1473
|
f += F;
|
|
1474
1474
|
}
|
|
1475
|
-
if (
|
|
1476
|
-
a.setStart(
|
|
1475
|
+
if (N) {
|
|
1476
|
+
a.setStart(N, Math.min(T, N.textContent?.length || 0)), a.collapse(!0);
|
|
1477
1477
|
const z = window.getSelection();
|
|
1478
1478
|
z && (z.removeAllRanges(), z.addRange(a), r.focus());
|
|
1479
1479
|
} else {
|
|
@@ -1487,11 +1487,11 @@ function kn(t, y, c, i, g = {}, _, I, D, S) {
|
|
|
1487
1487
|
const u = window.getSelection();
|
|
1488
1488
|
u && (u.removeAllRanges(), u.addRange(a), r.focus());
|
|
1489
1489
|
}
|
|
1490
|
-
|
|
1490
|
+
A.current = null;
|
|
1491
1491
|
}
|
|
1492
1492
|
}, 0);
|
|
1493
1493
|
}
|
|
1494
|
-
}, [y, c, i, t, g,
|
|
1494
|
+
}, [y, c, i, t, g, A, I, D, S]);
|
|
1495
1495
|
de(() => {
|
|
1496
1496
|
E();
|
|
1497
1497
|
}, [E]);
|
|
@@ -1500,7 +1500,7 @@ function $n(t, y, c, i) {
|
|
|
1500
1500
|
de(() => {
|
|
1501
1501
|
const g = t.current;
|
|
1502
1502
|
if (!g) return;
|
|
1503
|
-
const
|
|
1503
|
+
const A = (S) => S.type?.startsWith("image/") ? !0 : /\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(S.name || ""), I = (S) => {
|
|
1504
1504
|
const E = S.target?.closest(".upload-info-icon");
|
|
1505
1505
|
if (E && E.classList.contains("upload-info-icon")) {
|
|
1506
1506
|
const $ = E.dataset.uploadKey;
|
|
@@ -1510,31 +1510,31 @@ function $n(t, y, c, i) {
|
|
|
1510
1510
|
}
|
|
1511
1511
|
return;
|
|
1512
1512
|
}
|
|
1513
|
-
const
|
|
1514
|
-
if (
|
|
1515
|
-
const $ =
|
|
1513
|
+
const q = S.target?.closest('[data-type="upload"]');
|
|
1514
|
+
if (q) {
|
|
1515
|
+
const $ = q.dataset.key;
|
|
1516
1516
|
if ($) {
|
|
1517
1517
|
const P = c[$];
|
|
1518
|
-
P &&
|
|
1518
|
+
P && A(P) && i({ key: $, anchorEl: q, type: "upload-preview" });
|
|
1519
1519
|
}
|
|
1520
1520
|
}
|
|
1521
1521
|
}, D = (S) => {
|
|
1522
|
-
const E = S.target?.closest(".upload-info-icon"),
|
|
1522
|
+
const E = S.target?.closest(".upload-info-icon"), q = S.relatedTarget;
|
|
1523
1523
|
if (E && E.classList.contains("upload-info-icon")) {
|
|
1524
1524
|
const P = E.closest('[data-type="upload"]');
|
|
1525
|
-
if (
|
|
1525
|
+
if (q && P && P.contains(q))
|
|
1526
1526
|
return;
|
|
1527
|
-
if (!
|
|
1527
|
+
if (!q || !g.contains(q))
|
|
1528
1528
|
i(null);
|
|
1529
1529
|
else {
|
|
1530
|
-
const C =
|
|
1530
|
+
const C = q.closest('[data-type="upload"]');
|
|
1531
1531
|
(!C || C !== P) && i(null);
|
|
1532
1532
|
}
|
|
1533
1533
|
return;
|
|
1534
1534
|
}
|
|
1535
1535
|
const $ = S.target?.closest('[data-type="upload"]');
|
|
1536
1536
|
if ($) {
|
|
1537
|
-
const P =
|
|
1537
|
+
const P = q;
|
|
1538
1538
|
if (P && $.contains(P))
|
|
1539
1539
|
return;
|
|
1540
1540
|
i(null);
|
|
@@ -1551,9 +1551,9 @@ function En(t, y, c, i) {
|
|
|
1551
1551
|
const g = (S) => {
|
|
1552
1552
|
if (i === "hideTagClose")
|
|
1553
1553
|
return;
|
|
1554
|
-
const E = S.currentTarget,
|
|
1555
|
-
|
|
1556
|
-
},
|
|
1554
|
+
const E = S.currentTarget, q = E.dataset.tooltip, $ = E.dataset.tagKey || "";
|
|
1555
|
+
q && c({ key: $, anchorEl: E, type: "tag" });
|
|
1556
|
+
}, A = () => {
|
|
1557
1557
|
c(null);
|
|
1558
1558
|
};
|
|
1559
1559
|
let I;
|
|
@@ -1562,7 +1562,7 @@ function En(t, y, c, i) {
|
|
|
1562
1562
|
t.current.querySelectorAll(
|
|
1563
1563
|
".tag-node[data-tooltip]"
|
|
1564
1564
|
).forEach((E) => {
|
|
1565
|
-
E.addEventListener("mouseenter", g), E.addEventListener("mouseleave",
|
|
1565
|
+
E.addEventListener("mouseenter", g), E.addEventListener("mouseleave", A);
|
|
1566
1566
|
});
|
|
1567
1567
|
};
|
|
1568
1568
|
return I = requestAnimationFrame(() => {
|
|
@@ -1571,7 +1571,7 @@ function En(t, y, c, i) {
|
|
|
1571
1571
|
cancelAnimationFrame(I), t.current && t.current.querySelectorAll(
|
|
1572
1572
|
".tag-node[data-tooltip]"
|
|
1573
1573
|
).forEach((E) => {
|
|
1574
|
-
E.removeEventListener("mouseenter", g), E.removeEventListener("mouseleave",
|
|
1574
|
+
E.removeEventListener("mouseenter", g), E.removeEventListener("mouseleave", A);
|
|
1575
1575
|
});
|
|
1576
1576
|
};
|
|
1577
1577
|
}, [y, t, c, i]);
|
|
@@ -1594,11 +1594,11 @@ function Cn(t, y, c) {
|
|
|
1594
1594
|
const E = S.dataset.key;
|
|
1595
1595
|
E && c({ key: E, anchorEl: S, type: "variable" });
|
|
1596
1596
|
}
|
|
1597
|
-
},
|
|
1598
|
-
const D = I.target, S = I.relatedTarget, E = D?.closest?.(".variable-info-icon"),
|
|
1597
|
+
}, A = (I) => {
|
|
1598
|
+
const D = I.target, S = I.relatedTarget, E = D?.closest?.(".variable-info-icon"), q = D?.closest?.(
|
|
1599
1599
|
'[data-type="variable"][data-node-type="report-url"][data-tooltip]'
|
|
1600
1600
|
);
|
|
1601
|
-
if (E ||
|
|
1601
|
+
if (E || q) {
|
|
1602
1602
|
if (!S || !i.contains(S)) {
|
|
1603
1603
|
c(null);
|
|
1604
1604
|
return;
|
|
@@ -1609,21 +1609,21 @@ function Cn(t, y, c) {
|
|
|
1609
1609
|
!$ && !P && c(null);
|
|
1610
1610
|
}
|
|
1611
1611
|
};
|
|
1612
|
-
return i.addEventListener("mouseover", g, !0), i.addEventListener("mouseout",
|
|
1613
|
-
i.removeEventListener("mouseover", g, !0), i.removeEventListener("mouseout",
|
|
1612
|
+
return i.addEventListener("mouseover", g, !0), i.addEventListener("mouseout", A, !0), () => {
|
|
1613
|
+
i.removeEventListener("mouseover", g, !0), i.removeEventListener("mouseout", A, !0);
|
|
1614
1614
|
};
|
|
1615
1615
|
}, [y, t, c]);
|
|
1616
1616
|
}
|
|
1617
1617
|
function Sn(t, y, c, i) {
|
|
1618
1618
|
de(() => {
|
|
1619
1619
|
if (!t.current) return;
|
|
1620
|
-
const g = (E) => E.type?.startsWith("image/") ? !0 : /\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(E.name || ""),
|
|
1621
|
-
const
|
|
1620
|
+
const g = (E) => E.type?.startsWith("image/") ? !0 : /\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(E.name || ""), A = (E) => {
|
|
1621
|
+
const q = E.currentTarget, $ = q.dataset.fileName, P = q.closest('[data-type="upload"]'), C = P?.dataset.key || "", e = C ? c[C] : null;
|
|
1622
1622
|
if (e && g(e)) {
|
|
1623
|
-
i({ key: C, anchorEl: P ||
|
|
1623
|
+
i({ key: C, anchorEl: P || q, type: "upload-preview" });
|
|
1624
1624
|
return;
|
|
1625
1625
|
}
|
|
1626
|
-
$ && i({ key: C, anchorEl: P ||
|
|
1626
|
+
$ && i({ key: C, anchorEl: P || q, type: "upload-label" });
|
|
1627
1627
|
}, I = () => {
|
|
1628
1628
|
i(null);
|
|
1629
1629
|
};
|
|
@@ -1632,8 +1632,8 @@ function Sn(t, y, c, i) {
|
|
|
1632
1632
|
if (!t.current) return;
|
|
1633
1633
|
t.current.querySelectorAll(
|
|
1634
1634
|
".upload-label[data-file-name]"
|
|
1635
|
-
).forEach((
|
|
1636
|
-
|
|
1635
|
+
).forEach((q) => {
|
|
1636
|
+
q.addEventListener("mouseenter", A), q.addEventListener("mouseleave", I);
|
|
1637
1637
|
});
|
|
1638
1638
|
};
|
|
1639
1639
|
return D = requestAnimationFrame(() => {
|
|
@@ -1641,8 +1641,8 @@ function Sn(t, y, c, i) {
|
|
|
1641
1641
|
}), () => {
|
|
1642
1642
|
cancelAnimationFrame(D), t.current && t.current.querySelectorAll(
|
|
1643
1643
|
".upload-label[data-file-name]"
|
|
1644
|
-
).forEach((
|
|
1645
|
-
|
|
1644
|
+
).forEach((q) => {
|
|
1645
|
+
q.removeEventListener("mouseenter", A), q.removeEventListener("mouseleave", I);
|
|
1646
1646
|
});
|
|
1647
1647
|
};
|
|
1648
1648
|
}, [y, c, t, i]);
|
|
@@ -1659,17 +1659,17 @@ function qn(t, y) {
|
|
|
1659
1659
|
const c = re(0), i = re(0);
|
|
1660
1660
|
de(() => {
|
|
1661
1661
|
if (!t.current) return;
|
|
1662
|
-
let g = !1,
|
|
1662
|
+
let g = !1, A = 0;
|
|
1663
1663
|
const I = (f) => f instanceof HTMLElement ? !!(f.closest(".rte-datepicker-wrapper") || f.closest(".rte-datepicker-host") || f.closest(".ant-picker") || f.closest(".ant-picker-dropdown")) : !1, D = (f) => f instanceof HTMLElement ? !!(f.closest(".rte-select-wrapper") || f.closest(".rte-select-host") || f.closest(".ant-select") || f.closest(".ant-select-dropdown")) : !1, S = (f) => {
|
|
1664
1664
|
g = !0, I(f.target) && (c.current = Date.now(), console.log("[SelectionCtrl] mousedown on datepicker target")), D(f.target) && (i.current = Date.now(), console.log("[SelectionCtrl] mousedown on select target"));
|
|
1665
1665
|
}, E = () => {
|
|
1666
|
-
g = !1,
|
|
1666
|
+
g = !1, A = Date.now();
|
|
1667
1667
|
};
|
|
1668
|
-
let
|
|
1668
|
+
let q = !1, $ = 0;
|
|
1669
1669
|
const P = () => {
|
|
1670
|
-
|
|
1670
|
+
q = !0;
|
|
1671
1671
|
}, C = () => {
|
|
1672
|
-
|
|
1672
|
+
q = !1, $ = Date.now();
|
|
1673
1673
|
}, e = () => {
|
|
1674
1674
|
$ = Date.now();
|
|
1675
1675
|
}, r = (f) => {
|
|
@@ -1686,28 +1686,28 @@ function qn(t, y) {
|
|
|
1686
1686
|
return;
|
|
1687
1687
|
}
|
|
1688
1688
|
if (!t.current) return;
|
|
1689
|
-
const
|
|
1690
|
-
if (!
|
|
1689
|
+
const N = window.getSelection();
|
|
1690
|
+
if (!N || N.rangeCount === 0 || y.current || g || q || Date.now() - $ < 500)
|
|
1691
1691
|
return;
|
|
1692
|
-
const T =
|
|
1692
|
+
const T = N.getRangeAt(0);
|
|
1693
1693
|
if (!T.collapsed)
|
|
1694
1694
|
return t.current.contains(T.commonAncestorContainer), void 0;
|
|
1695
|
-
const z =
|
|
1695
|
+
const z = N.anchorNode;
|
|
1696
1696
|
if (!z || !t.current.contains(z))
|
|
1697
1697
|
return;
|
|
1698
|
-
let F = !1,
|
|
1698
|
+
let F = !1, U = !1;
|
|
1699
1699
|
if (z.nodeType === Node.ELEMENT_NODE) {
|
|
1700
1700
|
const n = z;
|
|
1701
|
-
(n.closest('[data-type="datepicker"]') || n.closest(".rte-datepicker-wrapper") || n.closest(".rte-datepicker-host")) && (F = !0), (n.closest('[data-type="select"]') || n.closest(".rte-select-wrapper") || n.closest(".rte-select-host")) && (
|
|
1701
|
+
(n.closest('[data-type="datepicker"]') || n.closest(".rte-datepicker-wrapper") || n.closest(".rte-datepicker-host")) && (F = !0), (n.closest('[data-type="select"]') || n.closest(".rte-select-wrapper") || n.closest(".rte-select-host")) && (U = !0);
|
|
1702
1702
|
} else if (z.parentElement) {
|
|
1703
1703
|
const n = z.parentElement;
|
|
1704
|
-
(n.closest('[data-type="datepicker"]') || n.closest(".rte-datepicker-wrapper") || n.closest(".rte-datepicker-host")) && (F = !0), (n.closest('[data-type="select"]') || n.closest(".rte-select-wrapper") || n.closest(".rte-select-host")) && (
|
|
1704
|
+
(n.closest('[data-type="datepicker"]') || n.closest(".rte-datepicker-wrapper") || n.closest(".rte-datepicker-host")) && (F = !0), (n.closest('[data-type="select"]') || n.closest(".rte-select-wrapper") || n.closest(".rte-select-host")) && (U = !0);
|
|
1705
1705
|
}
|
|
1706
|
-
if (F ||
|
|
1706
|
+
if (F || U)
|
|
1707
1707
|
return;
|
|
1708
1708
|
let Y = null;
|
|
1709
1709
|
if (z.nodeType === Node.ELEMENT_NODE ? Y = z.closest('[data-type="variable"]') : z.nodeType === Node.TEXT_NODE && z.parentElement && (Y = z.parentElement.closest('[data-type="variable"]')), !Y) {
|
|
1710
|
-
if (Date.now() -
|
|
1710
|
+
if (Date.now() - A > 500)
|
|
1711
1711
|
return;
|
|
1712
1712
|
const n = t.current.querySelectorAll('[data-type="variable"]');
|
|
1713
1713
|
if (n.length > 0) {
|
|
@@ -1719,11 +1719,11 @@ function qn(t, y) {
|
|
|
1719
1719
|
}
|
|
1720
1720
|
if (!V && n.length > 0 && (V = n[0]), V) {
|
|
1721
1721
|
const k = document.createRange();
|
|
1722
|
-
k.selectNodeContents(V), k.collapse(!1),
|
|
1722
|
+
k.selectNodeContents(V), k.collapse(!1), N.removeAllRanges(), N.addRange(k), V.focus();
|
|
1723
1723
|
} else
|
|
1724
|
-
|
|
1724
|
+
N.removeAllRanges();
|
|
1725
1725
|
} else
|
|
1726
|
-
|
|
1726
|
+
N.removeAllRanges();
|
|
1727
1727
|
}
|
|
1728
1728
|
}, u = t.current;
|
|
1729
1729
|
return u && (u.addEventListener("compositionstart", P), u.addEventListener("compositionend", C), u.addEventListener("input", e)), document.addEventListener("mousedown", S), document.addEventListener("mouseup", E), document.addEventListener("focusin", r), document.addEventListener("selectionchange", a), () => {
|
|
@@ -1735,109 +1735,109 @@ function qn(t, y) {
|
|
|
1735
1735
|
function Nn(t) {
|
|
1736
1736
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
1737
1737
|
}
|
|
1738
|
-
var
|
|
1738
|
+
var Re = { exports: {} }, An = Re.exports, gt;
|
|
1739
1739
|
function $t() {
|
|
1740
1740
|
return gt || (gt = 1, function(t, y) {
|
|
1741
1741
|
(function(c, i) {
|
|
1742
1742
|
t.exports = i();
|
|
1743
1743
|
})(An, function() {
|
|
1744
|
-
var c = 1e3, i = 6e4, g = 36e5,
|
|
1745
|
-
var p = ["th", "st", "nd", "rd"],
|
|
1746
|
-
return "[" + d + (p[(
|
|
1747
|
-
} },
|
|
1744
|
+
var c = 1e3, i = 6e4, g = 36e5, A = "millisecond", I = "second", D = "minute", S = "hour", E = "day", q = "week", $ = "month", P = "quarter", C = "year", e = "date", r = "Invalid Date", a = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, u = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, f = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(d) {
|
|
1745
|
+
var p = ["th", "st", "nd", "rd"], b = d % 100;
|
|
1746
|
+
return "[" + d + (p[(b - 20) % 10] || p[b] || p[0]) + "]";
|
|
1747
|
+
} }, N = function(d, p, b) {
|
|
1748
1748
|
var v = String(d);
|
|
1749
|
-
return !v || v.length >= p ? d : "" + Array(p + 1 - v.length).join(
|
|
1750
|
-
}, T = { s:
|
|
1751
|
-
var p = -d.utcOffset(),
|
|
1752
|
-
return (p <= 0 ? "+" : "-") +
|
|
1753
|
-
}, m: function d(p,
|
|
1754
|
-
if (p.date() <
|
|
1755
|
-
var v = 12 * (
|
|
1756
|
-
return +(-(v + (
|
|
1749
|
+
return !v || v.length >= p ? d : "" + Array(p + 1 - v.length).join(b) + d;
|
|
1750
|
+
}, T = { s: N, z: function(d) {
|
|
1751
|
+
var p = -d.utcOffset(), b = Math.abs(p), v = Math.floor(b / 60), _ = b % 60;
|
|
1752
|
+
return (p <= 0 ? "+" : "-") + N(v, 2, "0") + ":" + N(_, 2, "0");
|
|
1753
|
+
}, m: function d(p, b) {
|
|
1754
|
+
if (p.date() < b.date()) return -d(b, p);
|
|
1755
|
+
var v = 12 * (b.year() - p.year()) + (b.month() - p.month()), _ = p.clone().add(v, $), j = b - _ < 0, W = p.clone().add(v + (j ? -1 : 1), $);
|
|
1756
|
+
return +(-(v + (b - _) / (j ? _ - W : W - _)) || 0);
|
|
1757
1757
|
}, a: function(d) {
|
|
1758
1758
|
return d < 0 ? Math.ceil(d) || 0 : Math.floor(d);
|
|
1759
1759
|
}, p: function(d) {
|
|
1760
|
-
return { M: $, y: C, w:
|
|
1760
|
+
return { M: $, y: C, w: q, d: E, D: e, h: S, m: D, s: I, ms: A, Q: P }[d] || String(d || "").toLowerCase().replace(/s$/, "");
|
|
1761
1761
|
}, u: function(d) {
|
|
1762
1762
|
return d === void 0;
|
|
1763
1763
|
} }, z = "en", F = {};
|
|
1764
1764
|
F[z] = f;
|
|
1765
|
-
var
|
|
1766
|
-
return d instanceof H || !(!d || !d[
|
|
1767
|
-
}, n = function d(p,
|
|
1768
|
-
var
|
|
1765
|
+
var U = "$isDayjsObject", Y = function(d) {
|
|
1766
|
+
return d instanceof H || !(!d || !d[U]);
|
|
1767
|
+
}, n = function d(p, b, v) {
|
|
1768
|
+
var _;
|
|
1769
1769
|
if (!p) return z;
|
|
1770
1770
|
if (typeof p == "string") {
|
|
1771
1771
|
var j = p.toLowerCase();
|
|
1772
|
-
F[j] && (
|
|
1773
|
-
var
|
|
1774
|
-
if (!
|
|
1772
|
+
F[j] && (_ = j), b && (F[j] = b, _ = j);
|
|
1773
|
+
var W = p.split("-");
|
|
1774
|
+
if (!_ && W.length > 1) return d(W[0]);
|
|
1775
1775
|
} else {
|
|
1776
1776
|
var Z = p.name;
|
|
1777
|
-
F[Z] = p,
|
|
1777
|
+
F[Z] = p, _ = Z;
|
|
1778
1778
|
}
|
|
1779
|
-
return !v &&
|
|
1779
|
+
return !v && _ && (z = _), _ || !v && z;
|
|
1780
1780
|
}, V = function(d, p) {
|
|
1781
1781
|
if (Y(d)) return d.clone();
|
|
1782
|
-
var
|
|
1783
|
-
return
|
|
1782
|
+
var b = typeof p == "object" ? p : {};
|
|
1783
|
+
return b.date = d, b.args = arguments, new H(b);
|
|
1784
1784
|
}, k = T;
|
|
1785
1785
|
k.l = n, k.i = Y, k.w = function(d, p) {
|
|
1786
1786
|
return V(d, { locale: p.$L, utc: p.$u, x: p.$x, $offset: p.$offset });
|
|
1787
1787
|
};
|
|
1788
1788
|
var H = function() {
|
|
1789
|
-
function d(
|
|
1790
|
-
this.$L = n(
|
|
1789
|
+
function d(b) {
|
|
1790
|
+
this.$L = n(b.locale, null, !0), this.parse(b), this.$x = this.$x || b.x || {}, this[U] = !0;
|
|
1791
1791
|
}
|
|
1792
1792
|
var p = d.prototype;
|
|
1793
|
-
return p.parse = function(
|
|
1793
|
+
return p.parse = function(b) {
|
|
1794
1794
|
this.$d = function(v) {
|
|
1795
|
-
var
|
|
1796
|
-
if (
|
|
1797
|
-
if (k.u(
|
|
1798
|
-
if (
|
|
1799
|
-
if (typeof
|
|
1800
|
-
var
|
|
1801
|
-
if (
|
|
1802
|
-
var Z =
|
|
1803
|
-
return j ? new Date(Date.UTC(
|
|
1795
|
+
var _ = v.date, j = v.utc;
|
|
1796
|
+
if (_ === null) return /* @__PURE__ */ new Date(NaN);
|
|
1797
|
+
if (k.u(_)) return /* @__PURE__ */ new Date();
|
|
1798
|
+
if (_ instanceof Date) return new Date(_);
|
|
1799
|
+
if (typeof _ == "string" && !/Z$/i.test(_)) {
|
|
1800
|
+
var W = _.match(a);
|
|
1801
|
+
if (W) {
|
|
1802
|
+
var Z = W[2] - 1 || 0, oe = (W[7] || "0").substring(0, 3);
|
|
1803
|
+
return j ? new Date(Date.UTC(W[1], Z, W[3] || 1, W[4] || 0, W[5] || 0, W[6] || 0, oe)) : new Date(W[1], Z, W[3] || 1, W[4] || 0, W[5] || 0, W[6] || 0, oe);
|
|
1804
1804
|
}
|
|
1805
1805
|
}
|
|
1806
|
-
return new Date(
|
|
1807
|
-
}(
|
|
1806
|
+
return new Date(_);
|
|
1807
|
+
}(b), this.init();
|
|
1808
1808
|
}, p.init = function() {
|
|
1809
|
-
var
|
|
1810
|
-
this.$y =
|
|
1809
|
+
var b = this.$d;
|
|
1810
|
+
this.$y = b.getFullYear(), this.$M = b.getMonth(), this.$D = b.getDate(), this.$W = b.getDay(), this.$H = b.getHours(), this.$m = b.getMinutes(), this.$s = b.getSeconds(), this.$ms = b.getMilliseconds();
|
|
1811
1811
|
}, p.$utils = function() {
|
|
1812
1812
|
return k;
|
|
1813
1813
|
}, p.isValid = function() {
|
|
1814
1814
|
return this.$d.toString() !== r;
|
|
1815
|
-
}, p.isSame = function(
|
|
1816
|
-
var
|
|
1817
|
-
return this.startOf(v) <=
|
|
1818
|
-
}, p.isAfter = function(
|
|
1819
|
-
return V(
|
|
1820
|
-
}, p.isBefore = function(
|
|
1821
|
-
return this.endOf(v) < V(
|
|
1822
|
-
}, p.$g = function(
|
|
1823
|
-
return k.u(
|
|
1815
|
+
}, p.isSame = function(b, v) {
|
|
1816
|
+
var _ = V(b);
|
|
1817
|
+
return this.startOf(v) <= _ && _ <= this.endOf(v);
|
|
1818
|
+
}, p.isAfter = function(b, v) {
|
|
1819
|
+
return V(b) < this.startOf(v);
|
|
1820
|
+
}, p.isBefore = function(b, v) {
|
|
1821
|
+
return this.endOf(v) < V(b);
|
|
1822
|
+
}, p.$g = function(b, v, _) {
|
|
1823
|
+
return k.u(b) ? this[v] : this.set(_, b);
|
|
1824
1824
|
}, p.unix = function() {
|
|
1825
1825
|
return Math.floor(this.valueOf() / 1e3);
|
|
1826
1826
|
}, p.valueOf = function() {
|
|
1827
1827
|
return this.$d.getTime();
|
|
1828
|
-
}, p.startOf = function(
|
|
1829
|
-
var
|
|
1830
|
-
var ke = k.w(
|
|
1828
|
+
}, p.startOf = function(b, v) {
|
|
1829
|
+
var _ = this, j = !!k.u(v) || v, W = k.p(b), Z = function(ge, he) {
|
|
1830
|
+
var ke = k.w(_.$u ? Date.UTC(_.$y, he, ge) : new Date(_.$y, he, ge), _);
|
|
1831
1831
|
return j ? ke : ke.endOf(E);
|
|
1832
1832
|
}, oe = function(ge, he) {
|
|
1833
|
-
return k.w(
|
|
1833
|
+
return k.w(_.toDate()[ge].apply(_.toDate("s"), (j ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(he)), _);
|
|
1834
1834
|
}, ue = this.$W, me = this.$M, pe = this.$D, we = "set" + (this.$u ? "UTC" : "");
|
|
1835
|
-
switch (
|
|
1835
|
+
switch (W) {
|
|
1836
1836
|
case C:
|
|
1837
1837
|
return j ? Z(1, 0) : Z(31, 11);
|
|
1838
1838
|
case $:
|
|
1839
1839
|
return j ? Z(1, me) : Z(0, me + 1);
|
|
1840
|
-
case
|
|
1840
|
+
case q:
|
|
1841
1841
|
var ee = this.$locale().weekStart || 0, ye = (ue < ee ? ue + 7 : ue) - ee;
|
|
1842
1842
|
return Z(j ? pe - ye : pe + (6 - ye), me);
|
|
1843
1843
|
case E:
|
|
@@ -1852,38 +1852,38 @@ function $t() {
|
|
|
1852
1852
|
default:
|
|
1853
1853
|
return this.clone();
|
|
1854
1854
|
}
|
|
1855
|
-
}, p.endOf = function(
|
|
1856
|
-
return this.startOf(
|
|
1857
|
-
}, p.$set = function(
|
|
1858
|
-
var
|
|
1855
|
+
}, p.endOf = function(b) {
|
|
1856
|
+
return this.startOf(b, !1);
|
|
1857
|
+
}, p.$set = function(b, v) {
|
|
1858
|
+
var _, j = k.p(b), W = "set" + (this.$u ? "UTC" : ""), Z = (_ = {}, _[E] = W + "Date", _[e] = W + "Date", _[$] = W + "Month", _[C] = W + "FullYear", _[S] = W + "Hours", _[D] = W + "Minutes", _[I] = W + "Seconds", _[A] = W + "Milliseconds", _)[j], oe = j === E ? this.$D + (v - this.$W) : v;
|
|
1859
1859
|
if (j === $ || j === C) {
|
|
1860
1860
|
var ue = this.clone().set(e, 1);
|
|
1861
1861
|
ue.$d[Z](oe), ue.init(), this.$d = ue.set(e, Math.min(this.$D, ue.daysInMonth())).$d;
|
|
1862
1862
|
} else Z && this.$d[Z](oe);
|
|
1863
1863
|
return this.init(), this;
|
|
1864
|
-
}, p.set = function(
|
|
1865
|
-
return this.clone().$set(
|
|
1866
|
-
}, p.get = function(
|
|
1867
|
-
return this[k.p(
|
|
1868
|
-
}, p.add = function(
|
|
1869
|
-
var
|
|
1870
|
-
|
|
1871
|
-
var
|
|
1864
|
+
}, p.set = function(b, v) {
|
|
1865
|
+
return this.clone().$set(b, v);
|
|
1866
|
+
}, p.get = function(b) {
|
|
1867
|
+
return this[k.p(b)]();
|
|
1868
|
+
}, p.add = function(b, v) {
|
|
1869
|
+
var _, j = this;
|
|
1870
|
+
b = Number(b);
|
|
1871
|
+
var W = k.p(v), Z = function(me) {
|
|
1872
1872
|
var pe = V(j);
|
|
1873
|
-
return k.w(pe.date(pe.date() + Math.round(me *
|
|
1873
|
+
return k.w(pe.date(pe.date() + Math.round(me * b)), j);
|
|
1874
1874
|
};
|
|
1875
|
-
if (
|
|
1876
|
-
if (
|
|
1877
|
-
if (
|
|
1878
|
-
if (
|
|
1879
|
-
var oe = (
|
|
1875
|
+
if (W === $) return this.set($, this.$M + b);
|
|
1876
|
+
if (W === C) return this.set(C, this.$y + b);
|
|
1877
|
+
if (W === E) return Z(1);
|
|
1878
|
+
if (W === q) return Z(7);
|
|
1879
|
+
var oe = (_ = {}, _[D] = i, _[S] = g, _[I] = c, _)[W] || 1, ue = this.$d.getTime() + b * oe;
|
|
1880
1880
|
return k.w(ue, this);
|
|
1881
|
-
}, p.subtract = function(
|
|
1882
|
-
return this.add(-1 *
|
|
1883
|
-
}, p.format = function(
|
|
1884
|
-
var v = this,
|
|
1885
|
-
if (!this.isValid()) return
|
|
1886
|
-
var j =
|
|
1881
|
+
}, p.subtract = function(b, v) {
|
|
1882
|
+
return this.add(-1 * b, v);
|
|
1883
|
+
}, p.format = function(b) {
|
|
1884
|
+
var v = this, _ = this.$locale();
|
|
1885
|
+
if (!this.isValid()) return _.invalidDate || r;
|
|
1886
|
+
var j = b || "YYYY-MM-DDTHH:mm:ssZ", W = k.z(this), Z = this.$H, oe = this.$m, ue = this.$M, me = _.weekdays, pe = _.months, we = _.meridiem, ee = function(he, ke, $e, Ee) {
|
|
1887
1887
|
return he && (he[ke] || he(v, j)) || $e[ke].slice(0, Ee);
|
|
1888
1888
|
}, ye = function(he) {
|
|
1889
1889
|
return k.s(Z % 12 || 12, he, "0");
|
|
@@ -1903,7 +1903,7 @@ function $t() {
|
|
|
1903
1903
|
case "MM":
|
|
1904
1904
|
return k.s(ue + 1, 2, "0");
|
|
1905
1905
|
case "MMM":
|
|
1906
|
-
return ee(
|
|
1906
|
+
return ee(_.monthsShort, ue, pe, 3);
|
|
1907
1907
|
case "MMMM":
|
|
1908
1908
|
return ee(pe, ue);
|
|
1909
1909
|
case "D":
|
|
@@ -1913,9 +1913,9 @@ function $t() {
|
|
|
1913
1913
|
case "d":
|
|
1914
1914
|
return String(v.$W);
|
|
1915
1915
|
case "dd":
|
|
1916
|
-
return ee(
|
|
1916
|
+
return ee(_.weekdaysMin, v.$W, me, 2);
|
|
1917
1917
|
case "ddd":
|
|
1918
|
-
return ee(
|
|
1918
|
+
return ee(_.weekdaysShort, v.$W, me, 3);
|
|
1919
1919
|
case "dddd":
|
|
1920
1920
|
return me[v.$W];
|
|
1921
1921
|
case "H":
|
|
@@ -1941,16 +1941,16 @@ function $t() {
|
|
|
1941
1941
|
case "SSS":
|
|
1942
1942
|
return k.s(v.$ms, 3, "0");
|
|
1943
1943
|
case "Z":
|
|
1944
|
-
return
|
|
1944
|
+
return W;
|
|
1945
1945
|
}
|
|
1946
1946
|
return null;
|
|
1947
|
-
}(he) ||
|
|
1947
|
+
}(he) || W.replace(":", "");
|
|
1948
1948
|
});
|
|
1949
1949
|
}, p.utcOffset = function() {
|
|
1950
1950
|
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
1951
|
-
}, p.diff = function(
|
|
1952
|
-
var j,
|
|
1953
|
-
return k.m(
|
|
1951
|
+
}, p.diff = function(b, v, _) {
|
|
1952
|
+
var j, W = this, Z = k.p(v), oe = V(b), ue = (oe.utcOffset() - this.utcOffset()) * i, me = this - oe, pe = function() {
|
|
1953
|
+
return k.m(W, oe);
|
|
1954
1954
|
};
|
|
1955
1955
|
switch (Z) {
|
|
1956
1956
|
case C:
|
|
@@ -1962,7 +1962,7 @@ function $t() {
|
|
|
1962
1962
|
case P:
|
|
1963
1963
|
j = pe() / 3;
|
|
1964
1964
|
break;
|
|
1965
|
-
case
|
|
1965
|
+
case q:
|
|
1966
1966
|
j = (me - ue) / 6048e5;
|
|
1967
1967
|
break;
|
|
1968
1968
|
case E:
|
|
@@ -1980,15 +1980,15 @@ function $t() {
|
|
|
1980
1980
|
default:
|
|
1981
1981
|
j = me;
|
|
1982
1982
|
}
|
|
1983
|
-
return
|
|
1983
|
+
return _ ? j : k.a(j);
|
|
1984
1984
|
}, p.daysInMonth = function() {
|
|
1985
1985
|
return this.endOf($).$D;
|
|
1986
1986
|
}, p.$locale = function() {
|
|
1987
1987
|
return F[this.$L];
|
|
1988
|
-
}, p.locale = function(
|
|
1989
|
-
if (!
|
|
1990
|
-
var
|
|
1991
|
-
return j && (
|
|
1988
|
+
}, p.locale = function(b, v) {
|
|
1989
|
+
if (!b) return this.$L;
|
|
1990
|
+
var _ = this.clone(), j = n(b, v, !0);
|
|
1991
|
+
return j && (_.$L = j), _;
|
|
1992
1992
|
}, p.clone = function() {
|
|
1993
1993
|
return k.w(this.$d, this);
|
|
1994
1994
|
}, p.toDate = function() {
|
|
@@ -2001,7 +2001,7 @@ function $t() {
|
|
|
2001
2001
|
return this.$d.toUTCString();
|
|
2002
2002
|
}, d;
|
|
2003
2003
|
}(), X = H.prototype;
|
|
2004
|
-
return V.prototype = X, [["$ms",
|
|
2004
|
+
return V.prototype = X, [["$ms", A], ["$s", I], ["$m", D], ["$H", S], ["$W", E], ["$M", $], ["$y", C], ["$D", e]].forEach(function(d) {
|
|
2005
2005
|
X[d[1]] = function(p) {
|
|
2006
2006
|
return this.$g(p, d[0], d[1]);
|
|
2007
2007
|
};
|
|
@@ -2011,10 +2011,10 @@ function $t() {
|
|
|
2011
2011
|
return V(1e3 * d);
|
|
2012
2012
|
}, V.en = F[z], V.Ls = F, V.p = {}, V;
|
|
2013
2013
|
});
|
|
2014
|
-
}(
|
|
2014
|
+
}(Re)), Re.exports;
|
|
2015
2015
|
}
|
|
2016
2016
|
var _n = $t();
|
|
2017
|
-
const
|
|
2017
|
+
const Ge = /* @__PURE__ */ Nn(_n);
|
|
2018
2018
|
var Fe = { exports: {} }, Ln = Fe.exports, xt;
|
|
2019
2019
|
function Mn() {
|
|
2020
2020
|
return xt || (xt = 1, function(t, y) {
|
|
@@ -2024,13 +2024,13 @@ function Mn() {
|
|
|
2024
2024
|
function i(I) {
|
|
2025
2025
|
return I && typeof I == "object" && "default" in I ? I : { default: I };
|
|
2026
2026
|
}
|
|
2027
|
-
var g = i(c),
|
|
2027
|
+
var g = i(c), A = { name: "zh-cn", weekdays: "星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"), weekdaysShort: "周日_周一_周二_周三_周四_周五_周六".split("_"), weekdaysMin: "日_一_二_三_四_五_六".split("_"), months: "一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"), monthsShort: "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"), ordinal: function(I, D) {
|
|
2028
2028
|
return D === "W" ? I + "周" : I + "日";
|
|
2029
2029
|
}, weekStart: 1, yearStart: 4, formats: { LT: "HH:mm", LTS: "HH:mm:ss", L: "YYYY/MM/DD", LL: "YYYY年M月D日", LLL: "YYYY年M月D日Ah点mm分", LLLL: "YYYY年M月D日ddddAh点mm分", l: "YYYY/M/D", ll: "YYYY年M月D日", lll: "YYYY年M月D日 HH:mm", llll: "YYYY年M月D日dddd HH:mm" }, relativeTime: { future: "%s内", past: "%s前", s: "几秒", m: "1 分钟", mm: "%d 分钟", h: "1 小时", hh: "%d 小时", d: "1 天", dd: "%d 天", M: "1 个月", MM: "%d 个月", y: "1 年", yy: "%d 年" }, meridiem: function(I, D) {
|
|
2030
2030
|
var S = 100 * I + D;
|
|
2031
2031
|
return S < 600 ? "凌晨" : S < 900 ? "早上" : S < 1100 ? "上午" : S < 1300 ? "中午" : S < 1800 ? "下午" : "晚上";
|
|
2032
2032
|
} };
|
|
2033
|
-
return g.default.locale(
|
|
2033
|
+
return g.default.locale(A, null, !0), A;
|
|
2034
2034
|
});
|
|
2035
2035
|
}(Fe)), Fe.exports;
|
|
2036
2036
|
}
|
|
@@ -2138,31 +2138,31 @@ const Hn = {
|
|
|
2138
2138
|
timePickerLocale: Object.assign({}, Hn)
|
|
2139
2139
|
};
|
|
2140
2140
|
Et.lang.ok = "确定";
|
|
2141
|
-
|
|
2142
|
-
const { RangePicker: On } = jt,
|
|
2143
|
-
const c = t.dataset.key, i = t.dataset.value, g = t.dataset.placeholder,
|
|
2141
|
+
Ge.locale("zh-cn");
|
|
2142
|
+
const { RangePicker: On } = jt, Rn = ({ host: t, onChange: y }) => {
|
|
2143
|
+
const c = t.dataset.key, i = t.dataset.value, g = t.dataset.placeholder, A = t.dataset.limitRange ? parseInt(t.dataset.limitRange, 10) : void 0, I = t.dataset.disableFuture === "true", [D, S] = ae(() => {
|
|
2144
2144
|
if (!i) return null;
|
|
2145
2145
|
const r = i.split(",");
|
|
2146
|
-
return r.length === 2 && r[0] && r[1] ? [
|
|
2147
|
-
}), [E,
|
|
2146
|
+
return r.length === 2 && r[0] && r[1] ? [Ge(r[0]), Ge(r[1])] : null;
|
|
2147
|
+
}), [E, q] = ae(null);
|
|
2148
2148
|
return at(
|
|
2149
2149
|
/* @__PURE__ */ M("div", { className: "rte-datepicker-wrapper", contentEditable: !1, style: { display: "inline-block", verticalAlign: "middle", width: "260px", marginLeft: "4px", marginRight: "4px", fontSize: "16px", height: "30px", lineHeight: "30px" }, children: /* @__PURE__ */ M(
|
|
2150
2150
|
On,
|
|
2151
2151
|
{
|
|
2152
2152
|
value: D,
|
|
2153
|
-
disabledDate: (r) => r ? I && r.isAfter(
|
|
2153
|
+
disabledDate: (r) => r ? I && r.isAfter(Ge(), "day") ? !0 : !A || !E || !E[0] ? !1 : Math.abs(r.diff(E[0], "days")) > A : !1,
|
|
2154
2154
|
onCalendarChange: (r) => {
|
|
2155
|
-
console.log("[DatePicker] onCalendarChange", r?.map((a) => a?.format("YYYY-MM-DD") || null)),
|
|
2155
|
+
console.log("[DatePicker] onCalendarChange", r?.map((a) => a?.format("YYYY-MM-DD") || null)), q(r);
|
|
2156
2156
|
},
|
|
2157
2157
|
onChange: (r) => {
|
|
2158
|
-
if (console.log("[DatePicker] onChange", r?.map((a) => a?.format("YYYY-MM-DD") || null)), S(r),
|
|
2158
|
+
if (console.log("[DatePicker] onChange", r?.map((a) => a?.format("YYYY-MM-DD") || null)), S(r), q(null), r && r[0] && r[1]) {
|
|
2159
2159
|
const a = `${r[0].format("YYYY-MM-DD")},${r[1].format("YYYY-MM-DD")}`;
|
|
2160
2160
|
t.setAttribute("data-value", a), y(c, a);
|
|
2161
2161
|
} else
|
|
2162
2162
|
t.setAttribute("data-value", ""), y(c, "");
|
|
2163
2163
|
},
|
|
2164
2164
|
onOpenChange: (r) => {
|
|
2165
|
-
console.log("[DatePicker] onOpenChange", r),
|
|
2165
|
+
console.log("[DatePicker] onOpenChange", r), q(r ? D : null);
|
|
2166
2166
|
},
|
|
2167
2167
|
placeholder: [g || "开始日期", g || "结束日期"],
|
|
2168
2168
|
style: { width: "100%" },
|
|
@@ -2175,7 +2175,7 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: y }) => {
|
|
|
2175
2175
|
) }),
|
|
2176
2176
|
t
|
|
2177
2177
|
);
|
|
2178
|
-
},
|
|
2178
|
+
}, Gn = (t) => {
|
|
2179
2179
|
const [y, c] = ae([]);
|
|
2180
2180
|
return de(() => {
|
|
2181
2181
|
const i = t.current;
|
|
@@ -2186,13 +2186,13 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: y }) => {
|
|
|
2186
2186
|
const E = S.getAttribute("data-key");
|
|
2187
2187
|
E && D.push(
|
|
2188
2188
|
/* @__PURE__ */ M(
|
|
2189
|
-
|
|
2189
|
+
Rn,
|
|
2190
2190
|
{
|
|
2191
2191
|
host: S,
|
|
2192
2192
|
onChange: () => {
|
|
2193
2193
|
if (t.current) {
|
|
2194
|
-
const
|
|
2195
|
-
t.current.dispatchEvent(
|
|
2194
|
+
const q = new Event("input", { bubbles: !0 });
|
|
2195
|
+
t.current.dispatchEvent(q);
|
|
2196
2196
|
}
|
|
2197
2197
|
}
|
|
2198
2198
|
},
|
|
@@ -2202,19 +2202,19 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: y }) => {
|
|
|
2202
2202
|
}), c(D);
|
|
2203
2203
|
};
|
|
2204
2204
|
g();
|
|
2205
|
-
const
|
|
2205
|
+
const A = new MutationObserver((I) => {
|
|
2206
2206
|
let D = !1;
|
|
2207
2207
|
for (const S of I)
|
|
2208
2208
|
if (S.type === "childList") {
|
|
2209
2209
|
let E = !1;
|
|
2210
|
-
if (S.addedNodes.forEach((
|
|
2211
|
-
if (
|
|
2212
|
-
const $ =
|
|
2210
|
+
if (S.addedNodes.forEach((q) => {
|
|
2211
|
+
if (q.nodeType === Node.ELEMENT_NODE) {
|
|
2212
|
+
const $ = q;
|
|
2213
2213
|
($.classList?.contains("rte-datepicker-host") || $.querySelector?.(".rte-datepicker-host")) && (E = !0);
|
|
2214
2214
|
}
|
|
2215
|
-
}), S.removedNodes.forEach((
|
|
2216
|
-
if (
|
|
2217
|
-
const $ =
|
|
2215
|
+
}), S.removedNodes.forEach((q) => {
|
|
2216
|
+
if (q.nodeType === Node.ELEMENT_NODE) {
|
|
2217
|
+
const $ = q;
|
|
2218
2218
|
($.classList?.contains("rte-datepicker-host") || $.querySelector?.(".rte-datepicker-host")) && (E = !0);
|
|
2219
2219
|
}
|
|
2220
2220
|
}), E) {
|
|
@@ -2224,7 +2224,7 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: y }) => {
|
|
|
2224
2224
|
}
|
|
2225
2225
|
D && g();
|
|
2226
2226
|
});
|
|
2227
|
-
return
|
|
2227
|
+
return A.observe(i, { childList: !0, subtree: !0 }), () => A.disconnect();
|
|
2228
2228
|
}, [t]), y;
|
|
2229
2229
|
}, Fn = (t) => t.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'"), zn = ({
|
|
2230
2230
|
config: t,
|
|
@@ -2232,12 +2232,12 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: y }) => {
|
|
|
2232
2232
|
isProcessing: c = !1,
|
|
2233
2233
|
disabled: i = !1,
|
|
2234
2234
|
width: g,
|
|
2235
|
-
lockStructure:
|
|
2235
|
+
lockStructure: A = !1,
|
|
2236
2236
|
agentOptions: I = [],
|
|
2237
2237
|
onAgentSelect: D,
|
|
2238
2238
|
onAgentExit: S,
|
|
2239
2239
|
loading: E = !1,
|
|
2240
|
-
placeholder:
|
|
2240
|
+
placeholder: q,
|
|
2241
2241
|
border: $,
|
|
2242
2242
|
background: P = "transparent",
|
|
2243
2243
|
hideButtons: C,
|
|
@@ -2246,9 +2246,9 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: y }) => {
|
|
|
2246
2246
|
collapsed: a = !1,
|
|
2247
2247
|
reportAnalyze: u,
|
|
2248
2248
|
onCollapsedChange: f,
|
|
2249
|
-
collapseTransitionMs:
|
|
2249
|
+
collapseTransitionMs: N = 260
|
|
2250
2250
|
}) => {
|
|
2251
|
-
const [T, z] =
|
|
2251
|
+
const [T, z] = Ut.useMessage(), F = re(null), U = re(null), Y = re(null), n = re(null), V = re(null), [k, H] = ae({}), [X, d] = ae(null), [p, b] = ae(null), [v, _] = ae(null), j = re(!1), W = re(null), [Z, oe] = ae(!1), ue = re(null), [me, pe] = ae(!0), we = re(0), [ee, ye] = ae(58), [ge, he] = ae(58), [ke, $e] = ae(!1), [Ee, Le] = ae({}), Ye = re(() => {
|
|
2252
2252
|
}), [Ce, Te] = ae(() => {
|
|
2253
2253
|
const o = {};
|
|
2254
2254
|
return t.forEach((l) => {
|
|
@@ -2260,28 +2260,28 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: y }) => {
|
|
|
2260
2260
|
}, [k]), de(() => {
|
|
2261
2261
|
st.current = Ce;
|
|
2262
2262
|
}, [Ce]);
|
|
2263
|
-
const
|
|
2263
|
+
const Ue = se((o) => o.find((s) => s.type === "tag")?.text || null, []), lt = re(t), Ne = re(null);
|
|
2264
2264
|
de(() => {
|
|
2265
|
-
const o =
|
|
2265
|
+
const o = Ue(lt.current), l = Ue(t);
|
|
2266
2266
|
if (o && o !== l && n.current) {
|
|
2267
2267
|
const s = {};
|
|
2268
2268
|
n.current.querySelectorAll('[data-type="variable"]').forEach((h) => {
|
|
2269
2269
|
const G = h.dataset.key;
|
|
2270
2270
|
if (G) {
|
|
2271
|
-
const
|
|
2272
|
-
|
|
2271
|
+
const O = h.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
2272
|
+
O && (s[G] = O);
|
|
2273
2273
|
}
|
|
2274
2274
|
}), n.current.querySelectorAll('[data-type="select"]').forEach((h) => {
|
|
2275
2275
|
const G = h.dataset.key;
|
|
2276
2276
|
if (G) {
|
|
2277
|
-
const
|
|
2278
|
-
|
|
2277
|
+
const O = (h.getAttribute("data-value") || "").trim();
|
|
2278
|
+
O && (s[G] = O);
|
|
2279
2279
|
}
|
|
2280
2280
|
}), n.current.querySelectorAll('[data-type="textarea"]').forEach((h) => {
|
|
2281
2281
|
const G = h.dataset.key;
|
|
2282
2282
|
if (G) {
|
|
2283
|
-
const
|
|
2284
|
-
|
|
2283
|
+
const O = h.value.replace(/[\u200B]/g, "").trim();
|
|
2284
|
+
O && (s[G] = O);
|
|
2285
2285
|
}
|
|
2286
2286
|
}), je.current[o] = {
|
|
2287
2287
|
variableValues: s,
|
|
@@ -2301,7 +2301,7 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: y }) => {
|
|
|
2301
2301
|
} else
|
|
2302
2302
|
Ne.current = null, Te({}), H({});
|
|
2303
2303
|
lt.current = t;
|
|
2304
|
-
}, [t,
|
|
2304
|
+
}, [t, Ue]), Ve(() => {
|
|
2305
2305
|
Ne.current && n.current && (n.current.__tempVariableValues = Ne.current.variableValues, setTimeout(() => {
|
|
2306
2306
|
Ne.current && (Ne.current = null);
|
|
2307
2307
|
}, 0));
|
|
@@ -2322,7 +2322,7 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: y }) => {
|
|
|
2322
2322
|
className: "rte-report-error",
|
|
2323
2323
|
text: `解析失败:${Fn(s.error)}
|
|
2324
2324
|
`
|
|
2325
|
-
}), m.length > 0 && (m.forEach((
|
|
2325
|
+
}), m.length > 0 && (m.forEach((x, h) => {
|
|
2326
2326
|
o.push({
|
|
2327
2327
|
type: "report-module",
|
|
2328
2328
|
key: l.key,
|
|
@@ -2332,7 +2332,7 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: y }) => {
|
|
|
2332
2332
|
required: !0,
|
|
2333
2333
|
minHeight: 80,
|
|
2334
2334
|
maxHeight: 260,
|
|
2335
|
-
text:
|
|
2335
|
+
text: x.content
|
|
2336
2336
|
});
|
|
2337
2337
|
}), o.push({ type: "text", text: `
|
|
2338
2338
|
` }));
|
|
@@ -2351,8 +2351,8 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: y }) => {
|
|
|
2351
2351
|
return { url: l };
|
|
2352
2352
|
}
|
|
2353
2353
|
}
|
|
2354
|
-
const w = s.pathname.split("/").filter(Boolean), m = w.findIndex((
|
|
2355
|
-
return { url: l, reportId:
|
|
2354
|
+
const w = s.pathname.split("/").filter(Boolean), m = w.findIndex((O) => O === "report"), x = m >= 0 ? w[m + 1] : void 0, h = w[0] && w[0].length <= 5 ? w[0] : void 0, G = s.searchParams.get("agentId") || void 0;
|
|
2355
|
+
return { url: l, reportId: x, agentId: G, lang: h };
|
|
2356
2356
|
}, []), ct = se(() => {
|
|
2357
2357
|
const o = {};
|
|
2358
2358
|
if (!n.current) return o;
|
|
@@ -2361,8 +2361,8 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: y }) => {
|
|
|
2361
2361
|
const w = s.dataset.key;
|
|
2362
2362
|
if (!w) return;
|
|
2363
2363
|
if (s.getAttribute("data-node-type") === "report-url") {
|
|
2364
|
-
const
|
|
2365
|
-
|
|
2364
|
+
const x = s.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
2365
|
+
x && (o[`${w}__url`] = x);
|
|
2366
2366
|
return;
|
|
2367
2367
|
}
|
|
2368
2368
|
const m = s.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
@@ -2385,8 +2385,8 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: y }) => {
|
|
|
2385
2385
|
o[`${w}__module_${Number.isFinite(h) ? h : 0}`] = G;
|
|
2386
2386
|
return;
|
|
2387
2387
|
}
|
|
2388
|
-
const
|
|
2389
|
-
|
|
2388
|
+
const x = (s.textContent || "").replace(/[\u200B]/g, "").trim();
|
|
2389
|
+
x && (o[w] = x);
|
|
2390
2390
|
}), l.querySelectorAll('[data-type="datepicker"]').forEach((s) => {
|
|
2391
2391
|
const w = s.dataset.key;
|
|
2392
2392
|
if (!w) return;
|
|
@@ -2433,21 +2433,21 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: y }) => {
|
|
|
2433
2433
|
})))(m).then((h) => {
|
|
2434
2434
|
const G = ut(h);
|
|
2435
2435
|
if (n.current) {
|
|
2436
|
-
const
|
|
2437
|
-
G.forEach((
|
|
2438
|
-
|
|
2439
|
-
}),
|
|
2436
|
+
const O = ct();
|
|
2437
|
+
G.forEach((L, J) => {
|
|
2438
|
+
O[`${o}__module_${J}`] = L.content;
|
|
2439
|
+
}), O[`${o}__url`] = s, n.current.__tempVariableValues = O;
|
|
2440
2440
|
}
|
|
2441
|
-
Le((
|
|
2442
|
-
...
|
|
2441
|
+
Le((O) => ({
|
|
2442
|
+
...O,
|
|
2443
2443
|
[o]: { status: "success", error: void 0, lastParsedUrl: s, modules: G }
|
|
2444
2444
|
}));
|
|
2445
2445
|
}).catch((h) => {
|
|
2446
2446
|
const G = h instanceof Error ? h.message : String(h);
|
|
2447
|
-
Le((
|
|
2448
|
-
...
|
|
2447
|
+
Le((O) => ({
|
|
2448
|
+
...O,
|
|
2449
2449
|
[o]: {
|
|
2450
|
-
...
|
|
2450
|
+
...O[o] || { modules: [] },
|
|
2451
2451
|
status: "error",
|
|
2452
2452
|
error: G || "解析失败",
|
|
2453
2453
|
lastParsedUrl: s,
|
|
@@ -2464,18 +2464,18 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: y }) => {
|
|
|
2464
2464
|
if (!n.current) return;
|
|
2465
2465
|
const o = /* @__PURE__ */ new Map(), l = window.setTimeout(() => {
|
|
2466
2466
|
if (!n.current) return;
|
|
2467
|
-
o.forEach((m,
|
|
2467
|
+
o.forEach((m, x) => x.removeEventListener("blur", m, !1)), o.clear();
|
|
2468
2468
|
const s = n.current.querySelectorAll(
|
|
2469
2469
|
'[data-type="variable"][data-node-type="report-url"]'
|
|
2470
2470
|
), w = (m) => {
|
|
2471
2471
|
m.stopPropagation(), m.stopImmediatePropagation();
|
|
2472
|
-
const
|
|
2472
|
+
const x = m.target?.closest(
|
|
2473
2473
|
'[data-type="variable"][data-node-type="report-url"]'
|
|
2474
2474
|
);
|
|
2475
|
-
if (!
|
|
2476
|
-
const h =
|
|
2475
|
+
if (!x || !n.current || !n.current.contains(x)) return;
|
|
2476
|
+
const h = x.dataset.key;
|
|
2477
2477
|
if (!h) return;
|
|
2478
|
-
const G =
|
|
2478
|
+
const G = x.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
2479
2479
|
Ye.current(h, G);
|
|
2480
2480
|
};
|
|
2481
2481
|
s.forEach((m) => {
|
|
@@ -2485,8 +2485,8 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: y }) => {
|
|
|
2485
2485
|
return () => {
|
|
2486
2486
|
window.clearTimeout(l), o.forEach((s, w) => w.removeEventListener("blur", s, !1)), o.clear();
|
|
2487
2487
|
};
|
|
2488
|
-
}, [xe]), kn(n, xe, k,
|
|
2489
|
-
const
|
|
2488
|
+
}, [xe]), kn(n, xe, k, A, Ce, ue, void 0, C), $n(n, xe, k, _), En(n, xe, _, C), Sn(n, xe, k, _), Cn(n, xe, _), Tn(n, xe, k, oe), qn(n, j);
|
|
2489
|
+
const We = vn(n);
|
|
2490
2490
|
de(() => {
|
|
2491
2491
|
if (!n.current) return;
|
|
2492
2492
|
n.current.querySelectorAll(".rte-richtext-toggle").forEach((l) => {
|
|
@@ -2494,7 +2494,7 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: y }) => {
|
|
|
2494
2494
|
l.innerHTML = s ? '<i class="iconfont icon-shouqi1"></i><span class="rte-richtext-toggle-label">收起</span>' : '<i class="iconfont icon-zhankai2"></i><span class="rte-richtext-toggle-label">展开</span>';
|
|
2495
2495
|
});
|
|
2496
2496
|
}, [xe, n]);
|
|
2497
|
-
const Ke =
|
|
2497
|
+
const Ke = Gn(n), Xe = se(() => {
|
|
2498
2498
|
const o = Y.current;
|
|
2499
2499
|
if (!o) return;
|
|
2500
2500
|
const l = Math.max(0, Math.ceil(o.scrollHeight || 0));
|
|
@@ -2502,30 +2502,30 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: y }) => {
|
|
|
2502
2502
|
}, []);
|
|
2503
2503
|
Ve(() => {
|
|
2504
2504
|
if (!a) return;
|
|
2505
|
-
const o =
|
|
2505
|
+
const o = U.current, l = n.current;
|
|
2506
2506
|
if (!(!o || !l)) {
|
|
2507
2507
|
o.scrollTop = 0, o.scrollLeft = 0;
|
|
2508
2508
|
try {
|
|
2509
2509
|
const s = l.getBoundingClientRect(), w = document.createRange();
|
|
2510
2510
|
w.selectNodeContents(l);
|
|
2511
2511
|
const m = Array.from(w.getClientRects());
|
|
2512
|
-
let
|
|
2512
|
+
let x = 58;
|
|
2513
2513
|
if (m.length > 0) {
|
|
2514
|
-
const h = Math.min(...m.map((
|
|
2515
|
-
let
|
|
2516
|
-
for (const
|
|
2517
|
-
Math.abs(
|
|
2518
|
-
|
|
2514
|
+
const h = Math.min(...m.map((L) => L.top)), G = 2;
|
|
2515
|
+
let O = 0;
|
|
2516
|
+
for (const L of m)
|
|
2517
|
+
Math.abs(L.top - h) <= G && (O = Math.max(O, L.bottom));
|
|
2518
|
+
O > 0 && (x = Math.max(0, Math.ceil(O - s.top)));
|
|
2519
2519
|
} else {
|
|
2520
|
-
const h = window.getComputedStyle(l), G = Number.parseFloat(h.minHeight) || 0,
|
|
2521
|
-
|
|
2520
|
+
const h = window.getComputedStyle(l), G = Number.parseFloat(h.minHeight) || 0, O = Number.parseFloat(h.paddingTop) || 0, L = Number.parseFloat(h.lineHeight) || 34;
|
|
2521
|
+
x = Math.max(0, Math.ceil(Math.max(G, O + L)));
|
|
2522
2522
|
}
|
|
2523
|
-
if (!Number.isFinite(
|
|
2524
|
-
ye((h) => h ===
|
|
2523
|
+
if (!Number.isFinite(x) || x <= 0) return;
|
|
2524
|
+
ye((h) => h === x ? h : x);
|
|
2525
2525
|
} catch {
|
|
2526
2526
|
}
|
|
2527
2527
|
}
|
|
2528
|
-
}, [a, xe, k, Ce,
|
|
2528
|
+
}, [a, xe, k, Ce, We.length, Ke.length]), de(() => {
|
|
2529
2529
|
if (a) return;
|
|
2530
2530
|
let o = 0;
|
|
2531
2531
|
return o = window.requestAnimationFrame(() => {
|
|
@@ -2536,11 +2536,11 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: y }) => {
|
|
|
2536
2536
|
xe,
|
|
2537
2537
|
k,
|
|
2538
2538
|
Ce,
|
|
2539
|
-
|
|
2539
|
+
We.length,
|
|
2540
2540
|
Ke.length,
|
|
2541
2541
|
Xe
|
|
2542
2542
|
]), de(() => {
|
|
2543
|
-
const o = typeof
|
|
2543
|
+
const o = typeof N == "number" && Number.isFinite(N) && N >= 0 ? N : 260;
|
|
2544
2544
|
if (o <= 0) {
|
|
2545
2545
|
$e(!1);
|
|
2546
2546
|
return;
|
|
@@ -2548,7 +2548,7 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: y }) => {
|
|
|
2548
2548
|
$e(!0);
|
|
2549
2549
|
const l = window.setTimeout(() => $e(!1), o);
|
|
2550
2550
|
return () => window.clearTimeout(l);
|
|
2551
|
-
}, [a,
|
|
2551
|
+
}, [a, N]), de(() => {
|
|
2552
2552
|
if (t.length > 0) {
|
|
2553
2553
|
pe(!1);
|
|
2554
2554
|
return;
|
|
@@ -2559,13 +2559,13 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: y }) => {
|
|
|
2559
2559
|
return;
|
|
2560
2560
|
}
|
|
2561
2561
|
const s = n.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "", w = n.current.querySelectorAll('[data-type="variable"]'), m = n.current.querySelectorAll('[data-type="upload"]');
|
|
2562
|
-
let
|
|
2562
|
+
let x = !1;
|
|
2563
2563
|
w.forEach((G) => {
|
|
2564
|
-
(G.textContent?.replace(/[\u200B\n]/g, "").trim() || "") && (
|
|
2564
|
+
(G.textContent?.replace(/[\u200B\n]/g, "").trim() || "") && (x = !0);
|
|
2565
2565
|
}), m.forEach((G) => {
|
|
2566
|
-
G.querySelector(".upload-inner-wrapper.has-file") && (
|
|
2566
|
+
G.querySelector(".upload-inner-wrapper.has-file") && (x = !0);
|
|
2567
2567
|
});
|
|
2568
|
-
const h = !s && !
|
|
2568
|
+
const h = !s && !x;
|
|
2569
2569
|
pe(h), t.length === 0 && oe(!h);
|
|
2570
2570
|
};
|
|
2571
2571
|
o();
|
|
@@ -2590,42 +2590,42 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: y }) => {
|
|
|
2590
2590
|
if (w) {
|
|
2591
2591
|
let m = null;
|
|
2592
2592
|
if (w.nodeType === Node.ELEMENT_NODE ? m = w.closest('[data-type="variable"]') : w.nodeType === Node.TEXT_NODE && w.parentElement && (m = w.parentElement.closest('[data-type="variable"]')), m) {
|
|
2593
|
-
const
|
|
2594
|
-
if (
|
|
2595
|
-
const h = /[、,,\s\n\r\t]+/, G = l.split(h).map((
|
|
2593
|
+
const x = m.dataset.multiKey;
|
|
2594
|
+
if (x) {
|
|
2595
|
+
const h = /[、,,\s\n\r\t]+/, G = l.split(h).map((O) => O.trim()).filter((O) => O.length > 0);
|
|
2596
2596
|
if (console.log("[Paste Event] 粘贴的内容:", l), console.log("[Paste Event] 拆分后的值:", G), G.length > 1) {
|
|
2597
|
-
const
|
|
2597
|
+
const O = parseInt(m.dataset.index || "0", 10), L = t.find((le) => le.type === "multi-variable" && le.key === x)?.maxCount || 9, J = Ce[x] || 1, B = Math.min(O + G.length, L);
|
|
2598
2598
|
B > J && Te((ne) => ({
|
|
2599
2599
|
...ne,
|
|
2600
|
-
[
|
|
2600
|
+
[x]: B
|
|
2601
2601
|
}));
|
|
2602
2602
|
const K = [];
|
|
2603
2603
|
for (let ne = 0; ne < J; ne++) {
|
|
2604
|
-
const le = `${
|
|
2605
|
-
`[data-type="variable"][data-key="${le}"][data-multi-key="${
|
|
2604
|
+
const le = `${x}_${ne}`, fe = n.current.querySelector(
|
|
2605
|
+
`[data-type="variable"][data-key="${le}"][data-multi-key="${x}"]`
|
|
2606
2606
|
);
|
|
2607
2607
|
if (fe) {
|
|
2608
2608
|
const be = fe.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
2609
2609
|
K.push(be);
|
|
2610
2610
|
}
|
|
2611
2611
|
}
|
|
2612
|
-
K.splice(
|
|
2613
|
-
const Q = K.slice(0,
|
|
2614
|
-
Q.length > 0 && Q[Q.length - 1] !== "" && Q.length <
|
|
2615
|
-
const
|
|
2612
|
+
K.splice(O, 1, ...G.slice(0, L - O));
|
|
2613
|
+
const Q = K.slice(0, L);
|
|
2614
|
+
Q.length > 0 && Q[Q.length - 1] !== "" && Q.length < L && Q.push("");
|
|
2615
|
+
const R = Math.max(Q.length, 1), te = {};
|
|
2616
2616
|
Q.forEach((ne, le) => {
|
|
2617
|
-
ne && (te[`${
|
|
2617
|
+
ne && (te[`${x}_${le}`] = ne);
|
|
2618
2618
|
}), n.current.querySelectorAll(
|
|
2619
2619
|
'[data-type="variable"]'
|
|
2620
2620
|
).forEach((ne) => {
|
|
2621
2621
|
const le = ne.dataset.key, fe = ne.dataset.multiKey;
|
|
2622
|
-
if (le && fe !==
|
|
2622
|
+
if (le && fe !== x) {
|
|
2623
2623
|
const be = ne.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
2624
2624
|
be && (te[le] = be);
|
|
2625
2625
|
}
|
|
2626
2626
|
}), n.current.__tempVariableValues = te, Te((ne) => ({
|
|
2627
2627
|
...ne,
|
|
2628
|
-
[
|
|
2628
|
+
[x]: R
|
|
2629
2629
|
})), console.log("[Paste Event] 粘贴完成,已填充到多个输入框,值:", Q);
|
|
2630
2630
|
return;
|
|
2631
2631
|
} else G.length === 1 && console.log("[Paste Event] 粘贴单个值,将在失去焦点时检查是否需要拆分");
|
|
@@ -2638,14 +2638,14 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: y }) => {
|
|
|
2638
2638
|
if (w && w.rangeCount > 0) {
|
|
2639
2639
|
const m = w.anchorNode;
|
|
2640
2640
|
if (m) {
|
|
2641
|
-
let
|
|
2642
|
-
if (m.nodeType === Node.ELEMENT_NODE ?
|
|
2643
|
-
if ((
|
|
2644
|
-
const G =
|
|
2645
|
-
G && Ye.current(G,
|
|
2641
|
+
let x = null;
|
|
2642
|
+
if (m.nodeType === Node.ELEMENT_NODE ? x = m.closest('[data-type="variable"]') : m.nodeType === Node.TEXT_NODE && m.parentElement && (x = m.parentElement.closest('[data-type="variable"]')), x) {
|
|
2643
|
+
if ((x.getAttribute("data-node-type") || "") === "report-url") {
|
|
2644
|
+
const G = x.dataset.key, O = x.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
2645
|
+
G && Ye.current(G, O);
|
|
2646
2646
|
}
|
|
2647
|
-
if (
|
|
2648
|
-
const G =
|
|
2647
|
+
if (x.dataset.multiKey) {
|
|
2648
|
+
const G = x.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
2649
2649
|
/[、,,\s]+/.test(G) && (console.log("[Paste Event] 粘贴后检测到分隔符,内容:", G), console.log("[Paste Event] 提示:失去焦点后将自动拆分"));
|
|
2650
2650
|
}
|
|
2651
2651
|
}
|
|
@@ -2654,32 +2654,32 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: y }) => {
|
|
|
2654
2654
|
}, 0);
|
|
2655
2655
|
}, Tt = (o) => {
|
|
2656
2656
|
if (!o.target.files) {
|
|
2657
|
-
o.target && (o.target.value = ""), d(null),
|
|
2657
|
+
o.target && (o.target.value = ""), d(null), b(null);
|
|
2658
2658
|
return;
|
|
2659
2659
|
}
|
|
2660
2660
|
const l = 10 * 1024 * 1024, s = (m) => m.type?.startsWith("image/") ? !0 : /\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(m.name || ""), w = (m) => s(m) && m.size > l;
|
|
2661
2661
|
if (p && o.target.files && o.target.files.length > 0) {
|
|
2662
|
-
const m = p,
|
|
2663
|
-
if (
|
|
2664
|
-
const
|
|
2662
|
+
const m = p, x = t.find((L) => L.type === "upload" && L.key === m), h = Array.from(o.target.files), G = h.filter((L) => !w(L)), O = h.length - G.length;
|
|
2663
|
+
if (O > 0 && T.error(`已自动过滤 ${O} 张超过 10MB 的图片,仅允许上传 10MB 以内图片`), x && typeof x.maxCount == "number" && typeof x.minCount == "number") {
|
|
2664
|
+
const L = x.maxCount;
|
|
2665
2665
|
let J = 0;
|
|
2666
2666
|
H((B) => {
|
|
2667
|
-
for (let te = 0; te <
|
|
2667
|
+
for (let te = 0; te < L; te++) {
|
|
2668
2668
|
const ce = `${m}-${te}`;
|
|
2669
2669
|
B[ce] && (J = te + 1);
|
|
2670
2670
|
}
|
|
2671
|
-
const K =
|
|
2671
|
+
const K = L - J, Q = G.slice(0, K), R = { ...B };
|
|
2672
2672
|
return Q.forEach((te, ce) => {
|
|
2673
2673
|
const ne = `${m}-${J + ce}`;
|
|
2674
|
-
|
|
2675
|
-
}),
|
|
2674
|
+
R[ne] = te;
|
|
2675
|
+
}), R;
|
|
2676
2676
|
});
|
|
2677
2677
|
}
|
|
2678
2678
|
} else if (X && o.target.files[0]) {
|
|
2679
|
-
const m = o.target.files[0],
|
|
2680
|
-
w(m) ? T.error("图片大小不能超过 10MB(仅允许上传 10MB 以内图片)") : H((h) => ({ ...h, [
|
|
2679
|
+
const m = o.target.files[0], x = X;
|
|
2680
|
+
w(m) ? T.error("图片大小不能超过 10MB(仅允许上传 10MB 以内图片)") : H((h) => ({ ...h, [x]: m }));
|
|
2681
2681
|
}
|
|
2682
|
-
o.target && (o.target.value = ""), d(null),
|
|
2682
|
+
o.target && (o.target.value = ""), d(null), b(null);
|
|
2683
2683
|
}, pt = (o) => {
|
|
2684
2684
|
H((l) => {
|
|
2685
2685
|
const s = { ...l };
|
|
@@ -2690,32 +2690,32 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: y }) => {
|
|
|
2690
2690
|
if (l.closest(".rte-datepicker-wrapper") || l.closest(".rte-datepicker-host") || l.closest(".rte-select-wrapper") || l.closest(".rte-select-host") || l.closest(".ant-select-dropdown"))
|
|
2691
2691
|
return;
|
|
2692
2692
|
if (l.closest(".tag-close-btn")) {
|
|
2693
|
-
if (o.preventDefault(), o.stopPropagation(),
|
|
2693
|
+
if (o.preventDefault(), o.stopPropagation(), A)
|
|
2694
2694
|
return;
|
|
2695
|
-
|
|
2695
|
+
_(null), S ? S() : n.current && (n.current.innerHTML = "", n.current.focus());
|
|
2696
2696
|
return;
|
|
2697
2697
|
}
|
|
2698
|
-
if (
|
|
2699
|
-
const m = l.closest(".tag-node"),
|
|
2700
|
-
if (m ||
|
|
2698
|
+
if (A) {
|
|
2699
|
+
const m = l.closest(".tag-node"), x = l.closest('[data-type="text"]');
|
|
2700
|
+
if (m || x) {
|
|
2701
2701
|
o.preventDefault(), o.stopPropagation();
|
|
2702
2702
|
const h = window.getSelection();
|
|
2703
2703
|
h && h.removeAllRanges();
|
|
2704
2704
|
return;
|
|
2705
2705
|
}
|
|
2706
2706
|
}
|
|
2707
|
-
l.closest('[data-type="variable"]') || (
|
|
2707
|
+
l.closest('[data-type="variable"]') || (W.current = { x: o.clientX, y: o.clientY }, j.current = !1, l.closest(".file-remove-btn") && (o.preventDefault(), o.stopPropagation()));
|
|
2708
2708
|
}, Nt = (o) => {
|
|
2709
|
-
if (!o.target.closest('[data-type="variable"]') &&
|
|
2710
|
-
const w = Math.abs(o.clientX -
|
|
2709
|
+
if (!o.target.closest('[data-type="variable"]') && W.current) {
|
|
2710
|
+
const w = Math.abs(o.clientX - W.current.x), m = Math.abs(o.clientY - W.current.y);
|
|
2711
2711
|
(w > 3 || m > 3) && (j.current = !0);
|
|
2712
2712
|
}
|
|
2713
2713
|
}, At = (o) => {
|
|
2714
2714
|
if (o.target.closest('[data-type="variable"]')) {
|
|
2715
|
-
|
|
2715
|
+
W.current = null, j.current = !1;
|
|
2716
2716
|
return;
|
|
2717
2717
|
}
|
|
2718
|
-
|
|
2718
|
+
W.current = null, j.current = !1;
|
|
2719
2719
|
}, _t = (o) => {
|
|
2720
2720
|
if (i)
|
|
2721
2721
|
return;
|
|
@@ -2731,54 +2731,54 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: y }) => {
|
|
|
2731
2731
|
return;
|
|
2732
2732
|
const m = (B, K) => {
|
|
2733
2733
|
if (!n.current) return;
|
|
2734
|
-
Array.from(n.current.children).forEach((
|
|
2735
|
-
if (
|
|
2734
|
+
Array.from(n.current.children).forEach((R) => {
|
|
2735
|
+
if (R !== B)
|
|
2736
2736
|
if (K)
|
|
2737
|
-
|
|
2737
|
+
R.dataset.prevDisplay === void 0 && (R.dataset.prevDisplay = R.style.display || ""), R.dataset.rteForceHidden = "1", R.style.setProperty("display", "none", "important");
|
|
2738
2738
|
else {
|
|
2739
|
-
if (
|
|
2740
|
-
const te =
|
|
2741
|
-
te ?
|
|
2739
|
+
if (R.dataset.prevDisplay !== void 0) {
|
|
2740
|
+
const te = R.dataset.prevDisplay;
|
|
2741
|
+
te ? R.style.display = te : R.style.removeProperty("display"), delete R.dataset.prevDisplay;
|
|
2742
2742
|
} else
|
|
2743
|
-
|
|
2744
|
-
delete
|
|
2743
|
+
R.style.removeProperty("display");
|
|
2744
|
+
delete R.dataset.rteForceHidden;
|
|
2745
2745
|
}
|
|
2746
2746
|
});
|
|
2747
|
-
},
|
|
2748
|
-
if (
|
|
2747
|
+
}, x = l.closest(".rte-textarea-toggle");
|
|
2748
|
+
if (x) {
|
|
2749
2749
|
o.preventDefault(), o.stopPropagation();
|
|
2750
|
-
const B =
|
|
2751
|
-
|
|
2750
|
+
const B = x.closest(".rte-textarea-wrapper"), K = B?.querySelector('[data-type="textarea"]'), R = !(x.getAttribute("data-expanded") === "true");
|
|
2751
|
+
x.setAttribute("data-expanded", String(R)), x.textContent = R ? "收起" : "展开", B && B.classList.toggle("rte-textarea-expanded", R);
|
|
2752
2752
|
const te = B?.closest(".rte-textarea-required");
|
|
2753
|
-
if (te ? te.classList.toggle("rte-textarea-overlay",
|
|
2754
|
-
if (
|
|
2753
|
+
if (te ? te.classList.toggle("rte-textarea-overlay", R) : B && B.classList.toggle("rte-textarea-overlay", R), K)
|
|
2754
|
+
if (R)
|
|
2755
2755
|
K.classList.add("rte-textarea-expanded"), K.style.maxHeight = "none", K.style.height = "100%";
|
|
2756
2756
|
else {
|
|
2757
2757
|
K.classList.remove("rte-textarea-expanded");
|
|
2758
2758
|
const ce = K.dataset.maxHeight || "252";
|
|
2759
2759
|
K.style.maxHeight = `${ce}px`, K.style.height = "auto";
|
|
2760
2760
|
}
|
|
2761
|
-
n.current && (
|
|
2761
|
+
n.current && (R ? n.current.classList.add("rte-overlay-active") : n.current.classList.remove("rte-overlay-active"));
|
|
2762
2762
|
return;
|
|
2763
2763
|
}
|
|
2764
2764
|
const h = l.closest(".rte-richtext-toggle");
|
|
2765
2765
|
if (h) {
|
|
2766
2766
|
o.preventDefault(), o.stopPropagation();
|
|
2767
|
-
const B = h.closest(".rte-richtext-wrapper"), K = B?.querySelector('[data-type="richtext"]'),
|
|
2767
|
+
const B = h.closest(".rte-richtext-wrapper"), K = B?.querySelector('[data-type="richtext"]'), R = !(h.getAttribute("data-expanded") === "true");
|
|
2768
2768
|
((le, fe) => {
|
|
2769
2769
|
le.setAttribute("data-expanded", String(fe)), le.innerHTML = fe ? '<i class="iconfont icon-shouqi1"></i><span class="rte-richtext-toggle-label">收起</span>' : '<i class="iconfont icon-zhankai2"></i><span class="rte-richtext-toggle-label">展开</span>';
|
|
2770
|
-
})(h,
|
|
2770
|
+
})(h, R);
|
|
2771
2771
|
const ce = B?.closest(".rte-richtext-required");
|
|
2772
|
-
ce ? ce.classList.toggle("rte-richtext-expanded",
|
|
2772
|
+
ce ? ce.classList.toggle("rte-richtext-expanded", R) : B && B.classList.toggle("rte-richtext-expanded", R);
|
|
2773
2773
|
const ne = B?.closest(".exclusion-wrapper") || B?.parentElement;
|
|
2774
|
-
if (K && (
|
|
2775
|
-
if (n.current.classList.toggle("rte-richtext-fullscreen-active",
|
|
2776
|
-
if (
|
|
2774
|
+
if (K && (R ? (K.style.height = "100%", K.style.overflow = "auto") : (K.style.height = "", K.style.overflow = "")), ne && (ne.classList.toggle("rte-richtext-host-expanded", R), m(ne, R)), n.current) {
|
|
2775
|
+
if (n.current.classList.toggle("rte-richtext-fullscreen-active", R), F.current?.classList.toggle("rte-richtext-container-expanded", R), F.current)
|
|
2776
|
+
if (R) {
|
|
2777
2777
|
const le = Math.ceil(F.current.getBoundingClientRect().height || 0);
|
|
2778
2778
|
le > 0 && F.current.style.setProperty("--rte-richtext-fullscreen-height", `${le}px`);
|
|
2779
2779
|
} else
|
|
2780
2780
|
F.current.style.removeProperty("--rte-richtext-fullscreen-height");
|
|
2781
|
-
if (
|
|
2781
|
+
if (R)
|
|
2782
2782
|
we.current = n.current.scrollTop || 0, setTimeout(() => {
|
|
2783
2783
|
n.current && (n.current.scrollTop = 0, n.current.scrollLeft = 0);
|
|
2784
2784
|
}, 0);
|
|
@@ -2797,7 +2797,7 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: y }) => {
|
|
|
2797
2797
|
B && B.removeAllRanges();
|
|
2798
2798
|
return;
|
|
2799
2799
|
}
|
|
2800
|
-
if (
|
|
2800
|
+
if (A && l.closest(".tag-node")) {
|
|
2801
2801
|
o.preventDefault(), o.stopPropagation();
|
|
2802
2802
|
const K = window.getSelection();
|
|
2803
2803
|
K && K.removeAllRanges();
|
|
@@ -2812,15 +2812,15 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: y }) => {
|
|
|
2812
2812
|
}, 10);
|
|
2813
2813
|
return;
|
|
2814
2814
|
}
|
|
2815
|
-
const
|
|
2816
|
-
if (
|
|
2815
|
+
const L = l.closest(".file-remove-btn");
|
|
2816
|
+
if (L) {
|
|
2817
2817
|
o.preventDefault(), o.stopPropagation();
|
|
2818
|
-
const B =
|
|
2818
|
+
const B = L.closest('[data-type="upload"]'), K = B?.dataset.key, Q = B?.dataset.batchKey;
|
|
2819
2819
|
if (K)
|
|
2820
2820
|
if (Q) {
|
|
2821
|
-
const
|
|
2822
|
-
if (
|
|
2823
|
-
const te =
|
|
2821
|
+
const R = t.find((te) => te.type === "upload" && te.key === Q);
|
|
2822
|
+
if (R && typeof R.maxCount == "number" && typeof R.minCount == "number") {
|
|
2823
|
+
const te = R.maxCount;
|
|
2824
2824
|
H((ce) => {
|
|
2825
2825
|
const ne = { ...ce }, le = [];
|
|
2826
2826
|
for (let fe = 0; fe < te; fe++) {
|
|
@@ -2844,13 +2844,13 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: y }) => {
|
|
|
2844
2844
|
const B = J.dataset.key, K = J.dataset.batchKey;
|
|
2845
2845
|
if (B)
|
|
2846
2846
|
if (K) {
|
|
2847
|
-
const Q = t.find((
|
|
2847
|
+
const Q = t.find((R) => R.type === "upload" && R.key === K);
|
|
2848
2848
|
if (Q && typeof Q.maxCount == "number" && typeof Q.minCount == "number") {
|
|
2849
|
-
const
|
|
2849
|
+
const R = Q.maxCount;
|
|
2850
2850
|
let te = 0;
|
|
2851
|
-
for (let ce = 0; ce <
|
|
2851
|
+
for (let ce = 0; ce < R; ce++)
|
|
2852
2852
|
k[`${K}-${ce}`] != null && (te += 1);
|
|
2853
|
-
te <
|
|
2853
|
+
te < R && V.current ? (V.current.multiple = !0, b(K), V.current.click()) : (V.current && (V.current.multiple = !1), d(B), V.current?.click());
|
|
2854
2854
|
} else
|
|
2855
2855
|
V.current && (V.current.multiple = !1), d(B), V.current?.click();
|
|
2856
2856
|
} else
|
|
@@ -2862,12 +2862,12 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: y }) => {
|
|
|
2862
2862
|
if (s) {
|
|
2863
2863
|
const w = window.getSelection();
|
|
2864
2864
|
if (w) {
|
|
2865
|
-
const m = document.createRange(),
|
|
2866
|
-
if (
|
|
2867
|
-
let G = 0,
|
|
2868
|
-
|
|
2869
|
-
const
|
|
2870
|
-
|
|
2865
|
+
const m = document.createRange(), x = s.textContent || "";
|
|
2866
|
+
if (x.replace(/\u200B/g, "")) {
|
|
2867
|
+
let G = 0, O = x.length;
|
|
2868
|
+
x.startsWith("") && (G = 1), x.endsWith("") && x.length > 1 && (O = x.length - 1);
|
|
2869
|
+
const L = s.firstChild;
|
|
2870
|
+
L && L.nodeType === Node.TEXT_NODE ? (m.setStart(L, G), m.setEnd(L, O)) : m.selectNodeContents(s);
|
|
2871
2871
|
} else
|
|
2872
2872
|
m.selectNodeContents(s), m.collapse(!0);
|
|
2873
2873
|
w.removeAllRanges(), w.addRange(m);
|
|
@@ -2886,10 +2886,10 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: y }) => {
|
|
|
2886
2886
|
).forEach((s) => {
|
|
2887
2887
|
const w = s.dataset.key;
|
|
2888
2888
|
if (!w) return;
|
|
2889
|
-
s.innerText.replace(/[\u200B\n]/g, "").trim() || Le((
|
|
2890
|
-
const h =
|
|
2891
|
-
return !h || h.status === "idle" && (!h.modules || h.modules.length === 0) ?
|
|
2892
|
-
...
|
|
2889
|
+
s.innerText.replace(/[\u200B\n]/g, "").trim() || Le((x) => {
|
|
2890
|
+
const h = x[w];
|
|
2891
|
+
return !h || h.status === "idle" && (!h.modules || h.modules.length === 0) ? x : {
|
|
2892
|
+
...x,
|
|
2893
2893
|
[w]: { status: "idle", modules: [], lastParsedUrl: void 0, error: void 0 }
|
|
2894
2894
|
};
|
|
2895
2895
|
});
|
|
@@ -2897,15 +2897,15 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: y }) => {
|
|
|
2897
2897
|
const w = s.querySelector(".variable-info-icon");
|
|
2898
2898
|
if (w) {
|
|
2899
2899
|
let m = !1;
|
|
2900
|
-
const
|
|
2900
|
+
const x = document.createTreeWalker(
|
|
2901
2901
|
s,
|
|
2902
2902
|
NodeFilter.SHOW_TEXT,
|
|
2903
2903
|
{
|
|
2904
2904
|
acceptNode: (h) => w.contains(h) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT
|
|
2905
2905
|
}
|
|
2906
2906
|
);
|
|
2907
|
-
for (;
|
|
2908
|
-
if (
|
|
2907
|
+
for (; x.nextNode(); )
|
|
2908
|
+
if (x.currentNode.textContent?.replace(/[\u200B\n]/g, "").trim()) {
|
|
2909
2909
|
m = !0;
|
|
2910
2910
|
break;
|
|
2911
2911
|
}
|
|
@@ -2917,8 +2917,8 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: y }) => {
|
|
|
2917
2917
|
t.filter((l) => l.type === "multi-variable" && l.key).forEach((l) => {
|
|
2918
2918
|
if (!l.key) return;
|
|
2919
2919
|
const s = l.maxCount || 9, w = Ce[l.key] || 1, m = [];
|
|
2920
|
-
for (let
|
|
2921
|
-
const J = `${l.key}_${
|
|
2920
|
+
for (let L = 0; L < w; L++) {
|
|
2921
|
+
const J = `${l.key}_${L}`, B = n.current.querySelector(
|
|
2922
2922
|
`[data-type="variable"][data-key="${J}"][data-multi-key="${l.key}"]`
|
|
2923
2923
|
);
|
|
2924
2924
|
if (B) {
|
|
@@ -2927,69 +2927,69 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: y }) => {
|
|
|
2927
2927
|
}
|
|
2928
2928
|
}
|
|
2929
2929
|
const h = (m[m.length - 1] || "") === "";
|
|
2930
|
-
let G = !1,
|
|
2931
|
-
for (let
|
|
2932
|
-
if (m[
|
|
2933
|
-
G = !0,
|
|
2930
|
+
let G = !1, O = -1;
|
|
2931
|
+
for (let L = 0; L < m.length - 1; L++)
|
|
2932
|
+
if (m[L] === "") {
|
|
2933
|
+
G = !0, O = L;
|
|
2934
2934
|
break;
|
|
2935
2935
|
}
|
|
2936
|
-
if (G &&
|
|
2937
|
-
const
|
|
2938
|
-
if (
|
|
2939
|
-
const
|
|
2936
|
+
if (G && O >= 0) {
|
|
2937
|
+
const L = window.getSelection();
|
|
2938
|
+
if (L && L.rangeCount > 0) {
|
|
2939
|
+
const R = L.getRangeAt(0), te = R.startContainer, ce = te.nodeType === Node.ELEMENT_NODE ? te.closest('[data-type="variable"][data-multi-key]') : te.parentElement?.closest('[data-type="variable"][data-multi-key]');
|
|
2940
2940
|
if (ce) {
|
|
2941
2941
|
const ne = ce.dataset.key;
|
|
2942
2942
|
if (ne) {
|
|
2943
2943
|
const le = document.createRange();
|
|
2944
|
-
le.setStartBefore(ce), le.setEnd(
|
|
2944
|
+
le.setStartBefore(ce), le.setEnd(R.startContainer, R.startOffset);
|
|
2945
2945
|
const fe = le.toString().length;
|
|
2946
2946
|
ue.current = { key: ne, offset: fe };
|
|
2947
2947
|
}
|
|
2948
2948
|
}
|
|
2949
2949
|
}
|
|
2950
2950
|
const J = [...m];
|
|
2951
|
-
for (let
|
|
2952
|
-
J[
|
|
2951
|
+
for (let R = O; R < J.length - 1; R++)
|
|
2952
|
+
J[R] = J[R + 1];
|
|
2953
2953
|
J.pop();
|
|
2954
2954
|
const B = {};
|
|
2955
|
-
J.forEach((
|
|
2956
|
-
|
|
2955
|
+
J.forEach((R, te) => {
|
|
2956
|
+
R && (B[`${l.key}_${te}`] = R);
|
|
2957
2957
|
});
|
|
2958
2958
|
const K = Math.max(h ? J.length : J.length + 1, 1);
|
|
2959
2959
|
n.current.querySelectorAll(
|
|
2960
2960
|
'[data-type="variable"]'
|
|
2961
|
-
).forEach((
|
|
2962
|
-
const te =
|
|
2961
|
+
).forEach((R) => {
|
|
2962
|
+
const te = R.dataset.key, ce = R.dataset.multiKey;
|
|
2963
2963
|
if (te && ce !== l.key) {
|
|
2964
|
-
const ne =
|
|
2964
|
+
const ne = R.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
2965
2965
|
ne && (B[te] = ne);
|
|
2966
2966
|
}
|
|
2967
|
-
}), n.current.__tempVariableValues = B, Te((
|
|
2968
|
-
...
|
|
2967
|
+
}), n.current.__tempVariableValues = B, Te((R) => ({
|
|
2968
|
+
...R,
|
|
2969
2969
|
[l.key]: K
|
|
2970
2970
|
}));
|
|
2971
2971
|
return;
|
|
2972
2972
|
}
|
|
2973
2973
|
if (!h) {
|
|
2974
|
-
const
|
|
2974
|
+
const L = w - 1, J = `${l.key}_${L}`, B = n.current.querySelector(
|
|
2975
2975
|
`[data-type="variable"][data-key="${J}"][data-multi-key="${l.key}"]`
|
|
2976
2976
|
);
|
|
2977
2977
|
if (B && B.innerText.replace(/[\u200B\n]/g, "").trim().length > 0 && w < s) {
|
|
2978
2978
|
const Q = window.getSelection();
|
|
2979
2979
|
if (Q && Q.rangeCount > 0) {
|
|
2980
|
-
const
|
|
2980
|
+
const R = Q.getRangeAt(0), te = R.startContainer, ce = te.nodeType === Node.ELEMENT_NODE ? te.closest('[data-type="variable"][data-multi-key]') : te.parentElement?.closest('[data-type="variable"][data-multi-key]');
|
|
2981
2981
|
if (ce) {
|
|
2982
2982
|
const ne = ce.dataset.key;
|
|
2983
2983
|
if (ne) {
|
|
2984
2984
|
const le = document.createRange();
|
|
2985
|
-
le.setStartBefore(ce), le.setEnd(
|
|
2985
|
+
le.setStartBefore(ce), le.setEnd(R.startContainer, R.startOffset);
|
|
2986
2986
|
const fe = le.toString().length;
|
|
2987
2987
|
ue.current = { key: ne, offset: fe };
|
|
2988
2988
|
}
|
|
2989
2989
|
}
|
|
2990
2990
|
}
|
|
2991
|
-
Te((
|
|
2992
|
-
...
|
|
2991
|
+
Te((R) => ({
|
|
2992
|
+
...R,
|
|
2993
2993
|
[l.key]: w + 1
|
|
2994
2994
|
}));
|
|
2995
2995
|
}
|
|
@@ -2999,13 +2999,13 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: y }) => {
|
|
|
2999
2999
|
Ve(() => {
|
|
3000
3000
|
const o = n.current;
|
|
3001
3001
|
if (!o) return;
|
|
3002
|
-
const l = /* @__PURE__ */ new Map(), s = (
|
|
3003
|
-
const h =
|
|
3002
|
+
const l = /* @__PURE__ */ new Map(), s = (x) => {
|
|
3003
|
+
const h = x.target, G = x.relatedTarget;
|
|
3004
3004
|
!h || !n.current || !n.current.contains(h) || G && n.current.contains(G) || setTimeout(() => {
|
|
3005
3005
|
if (n.current) {
|
|
3006
3006
|
if (t.length === 0) {
|
|
3007
|
-
const
|
|
3008
|
-
oe(
|
|
3007
|
+
const O = n.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "";
|
|
3008
|
+
oe(O.length > 0);
|
|
3009
3009
|
return;
|
|
3010
3010
|
}
|
|
3011
3011
|
Qe(n), Ze(n, xe, k), et(n, xe, k, oe);
|
|
@@ -3015,30 +3015,30 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: y }) => {
|
|
|
3015
3015
|
o.addEventListener("blur", s, !0);
|
|
3016
3016
|
const w = () => {
|
|
3017
3017
|
if (!n.current) return;
|
|
3018
|
-
l.forEach((G,
|
|
3019
|
-
|
|
3018
|
+
l.forEach((G, O) => {
|
|
3019
|
+
O.removeEventListener("blur", G, !1);
|
|
3020
3020
|
}), l.clear();
|
|
3021
|
-
const
|
|
3021
|
+
const x = n.current.querySelectorAll(
|
|
3022
3022
|
'[data-type="variable"][data-multi-key]'
|
|
3023
3023
|
), h = (G) => {
|
|
3024
3024
|
G.stopPropagation(), G.stopImmediatePropagation();
|
|
3025
|
-
const
|
|
3026
|
-
if (!
|
|
3025
|
+
const O = G.target;
|
|
3026
|
+
if (!O || !n.current || !n.current.contains(O))
|
|
3027
3027
|
return;
|
|
3028
|
-
const
|
|
3029
|
-
if (!
|
|
3028
|
+
const L = O.closest('[data-type="variable"][data-multi-key]');
|
|
3029
|
+
if (!L || !n.current.contains(L))
|
|
3030
3030
|
return;
|
|
3031
3031
|
let J = !1;
|
|
3032
3032
|
if (l.forEach((le, fe) => {
|
|
3033
|
-
(fe ===
|
|
3033
|
+
(fe === L || fe.contains(O)) && (J = !0);
|
|
3034
3034
|
}), !J)
|
|
3035
3035
|
return;
|
|
3036
|
-
const B =
|
|
3036
|
+
const B = L.dataset.multiKey, K = L.dataset.key, Q = L.dataset.index;
|
|
3037
3037
|
if (!B || !K || Q === void 0) return;
|
|
3038
|
-
const
|
|
3039
|
-
if (!(!
|
|
3038
|
+
const R = G.relatedTarget;
|
|
3039
|
+
if (!(!R || !n.current.contains(R)))
|
|
3040
3040
|
return;
|
|
3041
|
-
const ce =
|
|
3041
|
+
const ce = L.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
3042
3042
|
console.log("[Blur Event] 失去焦点的 multi-variable 输入框:", {
|
|
3043
3043
|
multiKey: B,
|
|
3044
3044
|
currentKey: K,
|
|
@@ -3085,15 +3085,15 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: y }) => {
|
|
|
3085
3085
|
}
|
|
3086
3086
|
}
|
|
3087
3087
|
};
|
|
3088
|
-
|
|
3088
|
+
x.forEach((G) => {
|
|
3089
3089
|
G.addEventListener("blur", h, !1), l.set(G, h);
|
|
3090
3090
|
});
|
|
3091
3091
|
}, m = setTimeout(() => {
|
|
3092
3092
|
w();
|
|
3093
3093
|
}, 0);
|
|
3094
3094
|
return () => {
|
|
3095
|
-
clearTimeout(m), o.removeEventListener("blur", s, !0), l.forEach((
|
|
3096
|
-
h.removeEventListener("blur",
|
|
3095
|
+
clearTimeout(m), o.removeEventListener("blur", s, !0), l.forEach((x, h) => {
|
|
3096
|
+
h.removeEventListener("blur", x, !1);
|
|
3097
3097
|
}), l.clear();
|
|
3098
3098
|
};
|
|
3099
3099
|
}, [t, xe, Ce, k]);
|
|
@@ -3120,7 +3120,7 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: y }) => {
|
|
|
3120
3120
|
return;
|
|
3121
3121
|
}
|
|
3122
3122
|
}
|
|
3123
|
-
if (
|
|
3123
|
+
if (A && l && l.rangeCount > 0) {
|
|
3124
3124
|
const s = l.anchorNode;
|
|
3125
3125
|
let w = null;
|
|
3126
3126
|
if (s && (s.nodeType === Node.ELEMENT_NODE ? w = s.closest(".tag-node") : s.nodeType === Node.TEXT_NODE && s.parentElement && (w = s.parentElement.closest(".tag-node"))), w) {
|
|
@@ -3134,7 +3134,7 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: y }) => {
|
|
|
3134
3134
|
}
|
|
3135
3135
|
}
|
|
3136
3136
|
if (o.key === "Escape" && n.current) {
|
|
3137
|
-
if (
|
|
3137
|
+
if (A) {
|
|
3138
3138
|
o.preventDefault();
|
|
3139
3139
|
return;
|
|
3140
3140
|
}
|
|
@@ -3144,22 +3144,22 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: y }) => {
|
|
|
3144
3144
|
const s = window.getSelection();
|
|
3145
3145
|
if (s && s.rangeCount > 0) {
|
|
3146
3146
|
const w = s.getRangeAt(0), m = s.anchorNode;
|
|
3147
|
-
if (
|
|
3147
|
+
if (A) {
|
|
3148
3148
|
let h = null, G = null;
|
|
3149
3149
|
if (m && (m.nodeType === Node.ELEMENT_NODE ? (h = m.closest(".tag-node"), G = m.closest('[data-type="text"]')) : m.nodeType === Node.TEXT_NODE && m.parentElement && (h = m.parentElement.closest(".tag-node"), G = m.parentElement.closest('[data-type="text"]'))), (h || G) && w.collapsed && w.startOffset === 0) {
|
|
3150
3150
|
o.preventDefault();
|
|
3151
3151
|
return;
|
|
3152
3152
|
}
|
|
3153
3153
|
}
|
|
3154
|
-
let
|
|
3155
|
-
if (m && (m.nodeType === Node.ELEMENT_NODE ?
|
|
3154
|
+
let x = null;
|
|
3155
|
+
if (m && (m.nodeType === Node.ELEMENT_NODE ? x = m.closest(
|
|
3156
3156
|
'[data-type="variable"]'
|
|
3157
|
-
) : m.nodeType === Node.TEXT_NODE && m.parentElement && (
|
|
3157
|
+
) : m.nodeType === Node.TEXT_NODE && m.parentElement && (x = m.parentElement.closest(
|
|
3158
3158
|
'[data-type="variable"]'
|
|
3159
|
-
))),
|
|
3159
|
+
))), x) {
|
|
3160
3160
|
if (!w.collapsed)
|
|
3161
3161
|
return;
|
|
3162
|
-
const h =
|
|
3162
|
+
const h = x.innerText;
|
|
3163
3163
|
if (h === "" || h === "") {
|
|
3164
3164
|
o.preventDefault();
|
|
3165
3165
|
return;
|
|
@@ -3178,9 +3178,9 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: y }) => {
|
|
|
3178
3178
|
}, It = () => {
|
|
3179
3179
|
if (c || i || E || !Z || !n.current) return;
|
|
3180
3180
|
if (t.length === 0) {
|
|
3181
|
-
const
|
|
3182
|
-
if (!
|
|
3183
|
-
if (y(
|
|
3181
|
+
const x = n.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "";
|
|
3182
|
+
if (!x) return;
|
|
3183
|
+
if (y(x, x), n.current) {
|
|
3184
3184
|
n.current.textContent = "";
|
|
3185
3185
|
const h = new Event("input", { bubbles: !0 });
|
|
3186
3186
|
n.current.dispatchEvent(h);
|
|
@@ -3189,14 +3189,14 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: y }) => {
|
|
|
3189
3189
|
}
|
|
3190
3190
|
const o = n.current;
|
|
3191
3191
|
let l = "";
|
|
3192
|
-
const s = {}, w = (
|
|
3193
|
-
if (!(
|
|
3194
|
-
if (
|
|
3195
|
-
l += (
|
|
3196
|
-
else if (
|
|
3197
|
-
const h =
|
|
3198
|
-
if (G === "variable" &&
|
|
3199
|
-
let
|
|
3192
|
+
const s = {}, w = (x) => {
|
|
3193
|
+
if (!(x.nodeType === Node.ELEMENT_NODE && x.style.display === "none")) {
|
|
3194
|
+
if (x.nodeType === Node.TEXT_NODE)
|
|
3195
|
+
l += (x.textContent || "").replace(/\u200B/g, "");
|
|
3196
|
+
else if (x.nodeType === Node.ELEMENT_NODE) {
|
|
3197
|
+
const h = x, G = h.dataset.type, O = h.dataset.key;
|
|
3198
|
+
if (G === "variable" && O) {
|
|
3199
|
+
let L = "";
|
|
3200
3200
|
const J = document.createTreeWalker(
|
|
3201
3201
|
h,
|
|
3202
3202
|
NodeFilter.SHOW_TEXT,
|
|
@@ -3208,8 +3208,8 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: y }) => {
|
|
|
3208
3208
|
}
|
|
3209
3209
|
);
|
|
3210
3210
|
for (; J.nextNode(); )
|
|
3211
|
-
|
|
3212
|
-
const B =
|
|
3211
|
+
L += J.currentNode.textContent || "";
|
|
3212
|
+
const B = L.replace(/[\u200B\n]/g, "").trim();
|
|
3213
3213
|
if (B) {
|
|
3214
3214
|
const K = h.dataset.multiKey;
|
|
3215
3215
|
if (K) {
|
|
@@ -3217,7 +3217,7 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: y }) => {
|
|
|
3217
3217
|
const Q = s[K];
|
|
3218
3218
|
Q.push(B), Q.length > 1 && (l += " "), l += B;
|
|
3219
3219
|
} else
|
|
3220
|
-
h.dataset.nodeType === "report-url" || (s[
|
|
3220
|
+
h.dataset.nodeType === "report-url" || (s[O] = B), l += B;
|
|
3221
3221
|
if (h.dataset.nodeType === "report-url")
|
|
3222
3222
|
if (s.url === void 0)
|
|
3223
3223
|
s.url = B;
|
|
@@ -3226,38 +3226,38 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: y }) => {
|
|
|
3226
3226
|
Array.isArray(Q) ? Q.push(B) : s.url = [String(Q), B];
|
|
3227
3227
|
}
|
|
3228
3228
|
}
|
|
3229
|
-
} else if (G === "select" &&
|
|
3230
|
-
const
|
|
3231
|
-
|
|
3232
|
-
} else if (G === "textarea" &&
|
|
3229
|
+
} else if (G === "select" && O) {
|
|
3230
|
+
const L = (h.getAttribute("data-value") || "").trim();
|
|
3231
|
+
L && (s[O] = L, l += L);
|
|
3232
|
+
} else if (G === "textarea" && O) {
|
|
3233
3233
|
const J = (h.value || "").replace(/\u200B/g, "").trim();
|
|
3234
|
-
J && (s[
|
|
3235
|
-
} else if (G === "richtext" &&
|
|
3236
|
-
const
|
|
3237
|
-
B && (J === "report-module" ? ((!s[
|
|
3238
|
-
} else if (G === "datepicker" &&
|
|
3234
|
+
J && (s[O] = J, l += J);
|
|
3235
|
+
} else if (G === "richtext" && O) {
|
|
3236
|
+
const L = h, J = L.getAttribute("data-node-type") || "", B = (L.textContent || "").replace(/\u200B/g, "").trim();
|
|
3237
|
+
B && (J === "report-module" ? ((!s[O] || !Array.isArray(s[O])) && (s[O] = []), s[O].push(B), l += B) : (s[O] = B, l += B));
|
|
3238
|
+
} else if (G === "datepicker" && O) {
|
|
3239
3239
|
const J = (h.getAttribute("data-value") || "").trim();
|
|
3240
3240
|
if (J)
|
|
3241
3241
|
if (J.includes(",")) {
|
|
3242
3242
|
const B = J.split(",");
|
|
3243
|
-
B.length === 2 ? (s[
|
|
3243
|
+
B.length === 2 ? (s[O] = B, l += `[${B[0]}, ${B[1]}]`) : (s[O] = J, l += J);
|
|
3244
3244
|
} else
|
|
3245
|
-
s[
|
|
3246
|
-
} else if (G === "upload" &&
|
|
3247
|
-
const
|
|
3248
|
-
if (
|
|
3249
|
-
const J = t.find((B) => B.type === "upload" && B.key ===
|
|
3245
|
+
s[O] = J, l += J;
|
|
3246
|
+
} else if (G === "upload" && O) {
|
|
3247
|
+
const L = h.dataset.batchKey;
|
|
3248
|
+
if (L) {
|
|
3249
|
+
const J = t.find((B) => B.type === "upload" && B.key === L);
|
|
3250
3250
|
if (J && typeof J.maxCount == "number" && typeof J.minCount == "number") {
|
|
3251
3251
|
const B = [];
|
|
3252
3252
|
for (let K = 0; K < J.maxCount; K++) {
|
|
3253
|
-
const Q = `${
|
|
3254
|
-
|
|
3253
|
+
const Q = `${L}-${K}`, R = k[Q];
|
|
3254
|
+
R && B.push(R);
|
|
3255
3255
|
}
|
|
3256
|
-
s[
|
|
3256
|
+
s[L] || (s[L] = B.length > 0 ? B : null, B.length > 0 && (l += ` [附带${B.length}个文件: ${B.map((K) => K.name).join(", ")}] `));
|
|
3257
3257
|
} else
|
|
3258
|
-
s[
|
|
3258
|
+
s[O] = k[O] ?? null, k[O] && (l += ` [附带文件: ${k[O]?.name}] `);
|
|
3259
3259
|
} else
|
|
3260
|
-
s[
|
|
3260
|
+
s[O] = k[O] ?? null, k[O] && (l += ` [附带文件: ${k[O]?.name}] `);
|
|
3261
3261
|
} else {
|
|
3262
3262
|
if (h.classList.contains("tag-close-btn") || h.classList.contains("file-remove-btn")) return;
|
|
3263
3263
|
h.getAttribute("contenteditable") === "false" && !G && h.classList.contains("tag-node") ? l += h.innerText : h.childNodes.forEach(w);
|
|
@@ -3267,15 +3267,28 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: y }) => {
|
|
|
3267
3267
|
};
|
|
3268
3268
|
if (o.childNodes.forEach(w), l = l.trim(), !l) return;
|
|
3269
3269
|
const m = new FormData();
|
|
3270
|
-
m.append("fullPrompt", l), Object.keys(s).forEach((
|
|
3271
|
-
const h = s[
|
|
3272
|
-
h != null
|
|
3273
|
-
(
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3270
|
+
m.append("fullPrompt", l), Object.keys(s).forEach((x) => {
|
|
3271
|
+
const h = s[x];
|
|
3272
|
+
if (h != null)
|
|
3273
|
+
if (h instanceof File)
|
|
3274
|
+
m.append(x, h);
|
|
3275
|
+
else if (Array.isArray(h)) {
|
|
3276
|
+
if (t.some(
|
|
3277
|
+
(L) => L.type === "report-url" && L.key === x
|
|
3278
|
+
)) {
|
|
3279
|
+
h.forEach((L) => {
|
|
3280
|
+
L != null && L !== "" && m.append(x, String(L));
|
|
3281
|
+
});
|
|
3282
|
+
return;
|
|
3283
|
+
}
|
|
3284
|
+
t.some(
|
|
3285
|
+
(L) => L.type === "multi-variable" && L.key === x
|
|
3286
|
+
) ? h.forEach((L) => {
|
|
3287
|
+
L != null && L !== "" && m.append(x, String(L));
|
|
3288
|
+
}) : h.forEach((L, J) => {
|
|
3289
|
+
L != null && (L instanceof File ? m.append(`${x}[${J}]`, L) : typeof L == "string" ? m.append(`${x}[${J}]`, L) : m.append(`${x}[${J}]`, String(L)));
|
|
3290
|
+
});
|
|
3291
|
+
} else typeof h == "string" ? m.append(x, h) : m.append(x, String(h));
|
|
3279
3292
|
}), y(m, l);
|
|
3280
3293
|
}, Dt = {
|
|
3281
3294
|
...g ? { width: typeof g == "number" ? `${g}px` : g } : {},
|
|
@@ -3286,7 +3299,7 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: y }) => {
|
|
|
3286
3299
|
...e ? {
|
|
3287
3300
|
"--rte-richtext-fullscreen-height": typeof e == "number" ? `${e}px` : e
|
|
3288
3301
|
} : {}
|
|
3289
|
-
}, Bt = typeof
|
|
3302
|
+
}, Bt = typeof N == "number" && Number.isFinite(N) && N >= 0 ? N : 260, Pt = {
|
|
3290
3303
|
overflow: a || ke ? "hidden" : void 0
|
|
3291
3304
|
}, Vt = {
|
|
3292
3305
|
maxHeight: a ? `${ee}px` : `${Math.max(ge, ee)}px`,
|
|
@@ -3307,17 +3320,17 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: y }) => {
|
|
|
3307
3320
|
"div",
|
|
3308
3321
|
{
|
|
3309
3322
|
className: "rich-text-editor-content",
|
|
3310
|
-
ref:
|
|
3323
|
+
ref: U,
|
|
3311
3324
|
style: Pt,
|
|
3312
3325
|
children: /* @__PURE__ */ ie("div", { ref: Y, style: Vt, children: [
|
|
3313
3326
|
/* @__PURE__ */ M(
|
|
3314
3327
|
"div",
|
|
3315
3328
|
{
|
|
3316
3329
|
ref: n,
|
|
3317
|
-
className: `rte-editor ${t.length === 0 ? "rte-editor-default" : ""} ${me &&
|
|
3330
|
+
className: `rte-editor ${t.length === 0 ? "rte-editor-default" : ""} ${me && q ? "rte-editor-empty" : ""}`,
|
|
3318
3331
|
contentEditable: t.length === 0,
|
|
3319
3332
|
suppressContentEditableWarning: !0,
|
|
3320
|
-
"data-placeholder":
|
|
3333
|
+
"data-placeholder": q,
|
|
3321
3334
|
onMouseDown: qt,
|
|
3322
3335
|
onMouseMove: Nt,
|
|
3323
3336
|
onMouseUp: At,
|
|
@@ -3348,7 +3361,7 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: y }) => {
|
|
|
3348
3361
|
/* @__PURE__ */ M("span", { className: "rte-brand-text", children: "SealSeek 1.0" })
|
|
3349
3362
|
] }),
|
|
3350
3363
|
C !== "hideAgent" && /* @__PURE__ */ M(
|
|
3351
|
-
|
|
3364
|
+
Wt,
|
|
3352
3365
|
{
|
|
3353
3366
|
placement: "topLeft",
|
|
3354
3367
|
menu: {
|
|
@@ -3417,13 +3430,13 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: y }) => {
|
|
|
3417
3430
|
else if (v.type === "upload-preview") {
|
|
3418
3431
|
const w = k[v.key], m = !!w && (w.type?.startsWith("image/") || /\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(w.name || ""));
|
|
3419
3432
|
if (w && m) {
|
|
3420
|
-
const
|
|
3421
|
-
o = /* @__PURE__ */ M("div", { className: "rte-upload-preview", children: /* @__PURE__ */ M("img", { className: "rte-upload-preview-img", src:
|
|
3433
|
+
const x = URL.createObjectURL(w);
|
|
3434
|
+
o = /* @__PURE__ */ M("div", { className: "rte-upload-preview", children: /* @__PURE__ */ M("img", { className: "rte-upload-preview-img", src: x, alt: w.name }) }), l = {
|
|
3422
3435
|
background: "#fff",
|
|
3423
3436
|
padding: 0,
|
|
3424
3437
|
borderRadius: 4,
|
|
3425
3438
|
boxShadow: "0 2px 12px 0 rgba(153, 153, 153, 0.25)"
|
|
3426
|
-
}, setTimeout(() => URL.revokeObjectURL(
|
|
3439
|
+
}, setTimeout(() => URL.revokeObjectURL(x), 1e3);
|
|
3427
3440
|
} else
|
|
3428
3441
|
o = "";
|
|
3429
3442
|
}
|
|
@@ -3459,7 +3472,7 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: y }) => {
|
|
|
3459
3472
|
);
|
|
3460
3473
|
})(),
|
|
3461
3474
|
Ke,
|
|
3462
|
-
|
|
3475
|
+
We
|
|
3463
3476
|
]
|
|
3464
3477
|
}
|
|
3465
3478
|
);
|
|
@@ -3503,7 +3516,7 @@ const wt = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
3503
3516
|
loadingProgress: c,
|
|
3504
3517
|
loadIcon: i,
|
|
3505
3518
|
onBatchSizeChange: g,
|
|
3506
|
-
onLoadNextPage:
|
|
3519
|
+
onLoadNextPage: A,
|
|
3507
3520
|
onStartAutoLoad: I,
|
|
3508
3521
|
onStopLoad: D
|
|
3509
3522
|
}) => t && c ? /* @__PURE__ */ ie("div", { className: "auto_load_progress", children: [
|
|
@@ -3528,7 +3541,7 @@ const wt = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
3528
3541
|
/* @__PURE__ */ M(
|
|
3529
3542
|
"div",
|
|
3530
3543
|
{
|
|
3531
|
-
onClick:
|
|
3544
|
+
onClick: A,
|
|
3532
3545
|
className: "auto_load_next_btn",
|
|
3533
3546
|
style: {
|
|
3534
3547
|
backgroundColor: t ? "#f5f5f5" : "#2563eb"
|
|
@@ -3570,24 +3583,24 @@ const wt = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
3570
3583
|
]
|
|
3571
3584
|
}
|
|
3572
3585
|
)
|
|
3573
|
-
] }),
|
|
3586
|
+
] }), Un = ({
|
|
3574
3587
|
current: t,
|
|
3575
3588
|
loadIcon: y,
|
|
3576
3589
|
pageSize: c,
|
|
3577
3590
|
total: i,
|
|
3578
3591
|
cachedPages: g,
|
|
3579
|
-
loadedCount:
|
|
3592
|
+
loadedCount: A,
|
|
3580
3593
|
autoLoading: I = !1,
|
|
3581
3594
|
loadingProgress: D,
|
|
3582
3595
|
onChange: S,
|
|
3583
3596
|
onLoadNextPage: E,
|
|
3584
|
-
onStartAutoLoad:
|
|
3597
|
+
onStartAutoLoad: q,
|
|
3585
3598
|
onStopLoading: $
|
|
3586
3599
|
}) => {
|
|
3587
3600
|
const [P, C] = ae(5), e = Math.ceil(i / c), r = tt(() => g.length >= e, [g, e]), a = () => Array.from(
|
|
3588
3601
|
{ length: e },
|
|
3589
|
-
(
|
|
3590
|
-
).filter((
|
|
3602
|
+
(N, T) => T + 1
|
|
3603
|
+
).filter((N) => !g.includes(N)).slice(0, P);
|
|
3591
3604
|
return /* @__PURE__ */ ie("div", { className: "pagination_footer", children: [
|
|
3592
3605
|
/* @__PURE__ */ ie("div", { className: "pagination_leftWrap", children: [
|
|
3593
3606
|
/* @__PURE__ */ ie("span", { className: "pagination_total", children: [
|
|
@@ -3598,7 +3611,7 @@ const wt = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
3598
3611
|
}
|
|
3599
3612
|
),
|
|
3600
3613
|
"已加载: ",
|
|
3601
|
-
|
|
3614
|
+
A,
|
|
3602
3615
|
"/",
|
|
3603
3616
|
i,
|
|
3604
3617
|
"条数据"
|
|
@@ -3610,12 +3623,12 @@ const wt = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
3610
3623
|
autoLoading: I,
|
|
3611
3624
|
batchSize: P,
|
|
3612
3625
|
loadingProgress: D,
|
|
3613
|
-
disabled: !E || !
|
|
3626
|
+
disabled: !E || !q,
|
|
3614
3627
|
onBatchSizeChange: C,
|
|
3615
3628
|
onLoadNextPage: () => E?.(),
|
|
3616
3629
|
onStartAutoLoad: () => {
|
|
3617
3630
|
const f = a();
|
|
3618
|
-
|
|
3631
|
+
q?.(f);
|
|
3619
3632
|
},
|
|
3620
3633
|
onStopLoad: () => $?.()
|
|
3621
3634
|
}
|
|
@@ -3631,9 +3644,9 @@ const wt = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
3631
3644
|
showSizeChanger: !1,
|
|
3632
3645
|
showQuickJumper: !1,
|
|
3633
3646
|
showTotal: () => "",
|
|
3634
|
-
itemRender: (f,
|
|
3647
|
+
itemRender: (f, N, T) => {
|
|
3635
3648
|
const z = g.includes(f);
|
|
3636
|
-
return
|
|
3649
|
+
return N === "prev" || N === "next" || N === "jump-prev" || N === "jump-next" ? /* @__PURE__ */ M("div", { className: "pageBox", children: T }) : /* @__PURE__ */ ie(
|
|
3637
3650
|
"div",
|
|
3638
3651
|
{
|
|
3639
3652
|
className: "pageBox",
|
|
@@ -3651,29 +3664,29 @@ const wt = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
3651
3664
|
}
|
|
3652
3665
|
)
|
|
3653
3666
|
] });
|
|
3654
|
-
},
|
|
3667
|
+
}, Wn = (t) => {
|
|
3655
3668
|
const {
|
|
3656
3669
|
loading: y,
|
|
3657
3670
|
autoLoading: c,
|
|
3658
3671
|
loadingProgress: i,
|
|
3659
3672
|
columns: g = [],
|
|
3660
|
-
dataSource:
|
|
3673
|
+
dataSource: A = [],
|
|
3661
3674
|
total: I,
|
|
3662
3675
|
current: D,
|
|
3663
3676
|
pageSize: S,
|
|
3664
3677
|
cachedPages: E,
|
|
3665
|
-
onChangePage:
|
|
3678
|
+
onChangePage: q,
|
|
3666
3679
|
onLoadNextPage: $,
|
|
3667
3680
|
onStartAutoLoad: P,
|
|
3668
3681
|
onStopLoading: C,
|
|
3669
3682
|
...e
|
|
3670
3683
|
} = t, r = re(null), a = se(
|
|
3671
3684
|
(u) => {
|
|
3672
|
-
|
|
3685
|
+
q(u), E.includes(u) && r.current?.scrollTo({
|
|
3673
3686
|
key: `${(u - 1) * S + 1}`
|
|
3674
3687
|
});
|
|
3675
3688
|
},
|
|
3676
|
-
[E,
|
|
3689
|
+
[E, q, S]
|
|
3677
3690
|
);
|
|
3678
3691
|
return /* @__PURE__ */ ie("div", { className: "flex flex-col", children: [
|
|
3679
3692
|
/* @__PURE__ */ M(
|
|
@@ -3682,13 +3695,13 @@ const wt = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
3682
3695
|
ref: r,
|
|
3683
3696
|
...e,
|
|
3684
3697
|
columns: g,
|
|
3685
|
-
dataSource:
|
|
3698
|
+
dataSource: A,
|
|
3686
3699
|
pagination: !1,
|
|
3687
3700
|
virtual: !0
|
|
3688
3701
|
}
|
|
3689
3702
|
),
|
|
3690
3703
|
/* @__PURE__ */ M(
|
|
3691
|
-
|
|
3704
|
+
Un,
|
|
3692
3705
|
{
|
|
3693
3706
|
loading: y,
|
|
3694
3707
|
autoLoading: c,
|
|
@@ -3696,7 +3709,7 @@ const wt = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
3696
3709
|
current: D,
|
|
3697
3710
|
pageSize: S,
|
|
3698
3711
|
total: I,
|
|
3699
|
-
loadedCount:
|
|
3712
|
+
loadedCount: A.length,
|
|
3700
3713
|
cachedPages: E,
|
|
3701
3714
|
onChange: a,
|
|
3702
3715
|
onLoadNextPage: $,
|
|
@@ -3706,7 +3719,7 @@ const wt = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
3706
3719
|
)
|
|
3707
3720
|
] });
|
|
3708
3721
|
};
|
|
3709
|
-
|
|
3722
|
+
Wn.__docgenInfo = {
|
|
3710
3723
|
displayName: "VirtualTable",
|
|
3711
3724
|
description: "虚拟滚动表格组件,支持分页、数据缓存和自动加载功能。",
|
|
3712
3725
|
props: {
|
|
@@ -3819,42 +3832,42 @@ const Kn = ({
|
|
|
3819
3832
|
animationSpeed: c = 100,
|
|
3820
3833
|
autoPlay: i = !0,
|
|
3821
3834
|
value: g,
|
|
3822
|
-
onChange:
|
|
3835
|
+
onChange: A,
|
|
3823
3836
|
...I
|
|
3824
3837
|
}) => {
|
|
3825
|
-
const [D, S] = ae(""), [E,
|
|
3838
|
+
const [D, S] = ae(""), [E, q] = ae(0), [$, P] = ae(!1), [C, e] = ae(!1), [r, a] = ae(!1), u = re(void 0), f = re(void 0), N = re(t), T = re(E), z = re(C), F = re(D);
|
|
3826
3839
|
de(() => {
|
|
3827
|
-
|
|
3840
|
+
N.current = t, T.current = E, z.current = C, F.current = D;
|
|
3828
3841
|
});
|
|
3829
|
-
const
|
|
3830
|
-
let
|
|
3842
|
+
const U = se((d, p) => {
|
|
3843
|
+
let b = 0;
|
|
3831
3844
|
a(!0);
|
|
3832
3845
|
const v = () => {
|
|
3833
|
-
|
|
3846
|
+
b < d.length ? (S(d.slice(0, b + 1)), b++, f.current = window.setTimeout(v, c)) : (a(!1), p?.());
|
|
3834
3847
|
};
|
|
3835
3848
|
v();
|
|
3836
3849
|
}, [c]), Y = se((d) => {
|
|
3837
3850
|
let p = F.current.length;
|
|
3838
|
-
const
|
|
3839
|
-
p > 0 ? (S(F.current.slice(0, p - 1)), p--, f.current = window.setTimeout(
|
|
3851
|
+
const b = () => {
|
|
3852
|
+
p > 0 ? (S(F.current.slice(0, p - 1)), p--, f.current = window.setTimeout(b, c / 2)) : d?.();
|
|
3840
3853
|
};
|
|
3841
|
-
|
|
3854
|
+
b();
|
|
3842
3855
|
}, [c]), n = se(() => {
|
|
3843
|
-
if (
|
|
3856
|
+
if (N.current.length === 0 || z.current) return;
|
|
3844
3857
|
P(!0);
|
|
3845
|
-
const d =
|
|
3858
|
+
const d = N.current[T.current];
|
|
3846
3859
|
F.current ? Y(() => {
|
|
3847
|
-
|
|
3860
|
+
U(d, () => {
|
|
3848
3861
|
u.current = window.setTimeout(() => {
|
|
3849
|
-
|
|
3862
|
+
q((p) => (p + 1) % N.current.length), P(!1);
|
|
3850
3863
|
}, 2e3);
|
|
3851
3864
|
});
|
|
3852
|
-
}) :
|
|
3865
|
+
}) : U(d, () => {
|
|
3853
3866
|
u.current = window.setTimeout(() => {
|
|
3854
|
-
|
|
3867
|
+
q((p) => (p + 1) % N.current.length), P(!1);
|
|
3855
3868
|
}, 2e3);
|
|
3856
3869
|
});
|
|
3857
|
-
}, [Y,
|
|
3870
|
+
}, [Y, U]);
|
|
3858
3871
|
return de(() => (i && t.length > 0 && !C && n(), () => {
|
|
3859
3872
|
u.current && window.clearTimeout(u.current), f.current && window.clearTimeout(f.current);
|
|
3860
3873
|
}), [E, C, i, t.length, n]), de(() => {
|
|
@@ -3866,13 +3879,13 @@ const Kn = ({
|
|
|
3866
3879
|
...I,
|
|
3867
3880
|
value: g,
|
|
3868
3881
|
onChange: (d) => {
|
|
3869
|
-
|
|
3882
|
+
A?.(d.target.value), I.onChange?.(d);
|
|
3870
3883
|
},
|
|
3871
3884
|
onFocus: (d) => {
|
|
3872
3885
|
e(!0), u.current && window.clearTimeout(u.current), f.current && window.clearTimeout(f.current), P(!1), a(!1), I.onFocus?.(d);
|
|
3873
3886
|
},
|
|
3874
3887
|
onBlur: (d) => {
|
|
3875
|
-
e(!1), !g && t.length > 0 && (S(""),
|
|
3888
|
+
e(!1), !g && t.length > 0 && (S(""), q(0)), I.onBlur?.(d);
|
|
3876
3889
|
},
|
|
3877
3890
|
placeholder: C || g ? y : D || y,
|
|
3878
3891
|
style: {
|
|
@@ -3984,7 +3997,7 @@ const Xn = ({
|
|
|
3984
3997
|
// 是否自动播放动画
|
|
3985
3998
|
value: g = "",
|
|
3986
3999
|
// 受控模式的值
|
|
3987
|
-
onChange:
|
|
4000
|
+
onChange: A,
|
|
3988
4001
|
// 受控模式的变化回调
|
|
3989
4002
|
onSubmit: I,
|
|
3990
4003
|
// 提交回调
|
|
@@ -3994,7 +4007,7 @@ const Xn = ({
|
|
|
3994
4007
|
// 是否显示字数统计
|
|
3995
4008
|
submitText: E = "发送",
|
|
3996
4009
|
// 提交按钮文本
|
|
3997
|
-
disabled:
|
|
4010
|
+
disabled: q = !1,
|
|
3998
4011
|
// 是否禁用组件
|
|
3999
4012
|
rows: $ = 4,
|
|
4000
4013
|
// 文本域行数
|
|
@@ -4003,18 +4016,18 @@ const Xn = ({
|
|
|
4003
4016
|
...C
|
|
4004
4017
|
// 其他原生属性
|
|
4005
4018
|
}) => {
|
|
4006
|
-
const [e, r] = ae(""), [a, u] = ae(0), [f,
|
|
4019
|
+
const [e, r] = ae(""), [a, u] = ae(0), [f, N] = ae(!1), [T, z] = ae(!1), [F, U] = ae(!1), [Y, n] = ae(g || ""), V = re(void 0), k = re(void 0), H = re(t), X = re(a), d = re(T), p = re(e), b = re(null);
|
|
4007
4020
|
de(() => {
|
|
4008
4021
|
H.current = t, X.current = a, d.current = T, p.current = e;
|
|
4009
4022
|
});
|
|
4010
4023
|
const v = se((ee, ye) => {
|
|
4011
4024
|
let ge = 0;
|
|
4012
|
-
|
|
4025
|
+
U(!0);
|
|
4013
4026
|
const he = () => {
|
|
4014
|
-
ge < ee.length ? (r(ee.slice(0, ge + 1)), ge++, k.current = window.setTimeout(he, c)) : (
|
|
4027
|
+
ge < ee.length ? (r(ee.slice(0, ge + 1)), ge++, k.current = window.setTimeout(he, c)) : (U(!1), ye?.());
|
|
4015
4028
|
};
|
|
4016
4029
|
he();
|
|
4017
|
-
}, [c]),
|
|
4030
|
+
}, [c]), _ = se((ee) => {
|
|
4018
4031
|
let ye = p.current.length;
|
|
4019
4032
|
const ge = () => {
|
|
4020
4033
|
ye > 0 ? (r(p.current.slice(0, ye - 1)), ye--, k.current = window.setTimeout(ge, c / 2)) : ee?.();
|
|
@@ -4022,48 +4035,48 @@ const Xn = ({
|
|
|
4022
4035
|
ge();
|
|
4023
4036
|
}, [c]), j = se(() => {
|
|
4024
4037
|
if (H.current.length === 0 || d.current) return;
|
|
4025
|
-
|
|
4038
|
+
N(!0);
|
|
4026
4039
|
const ee = H.current[X.current];
|
|
4027
|
-
p.current ?
|
|
4040
|
+
p.current ? _(() => {
|
|
4028
4041
|
v(ee, () => {
|
|
4029
4042
|
V.current = window.setTimeout(() => {
|
|
4030
|
-
u((ye) => (ye + 1) % H.current.length),
|
|
4043
|
+
u((ye) => (ye + 1) % H.current.length), N(!1);
|
|
4031
4044
|
}, 2e3);
|
|
4032
4045
|
});
|
|
4033
4046
|
}) : v(ee, () => {
|
|
4034
4047
|
V.current = window.setTimeout(() => {
|
|
4035
|
-
u((ye) => (ye + 1) % H.current.length),
|
|
4048
|
+
u((ye) => (ye + 1) % H.current.length), N(!1);
|
|
4036
4049
|
}, 2e3);
|
|
4037
4050
|
});
|
|
4038
|
-
}, [
|
|
4051
|
+
}, [_, v]);
|
|
4039
4052
|
de(() => (i && t.length > 0 && !T && j(), () => {
|
|
4040
4053
|
V.current && window.clearTimeout(V.current), k.current && window.clearTimeout(k.current);
|
|
4041
4054
|
}), [a, T, i, t.length, j]), de(() => {
|
|
4042
4055
|
!f && i && t.length > 0 && !T && j();
|
|
4043
4056
|
}, [a, f, i, t.length, T, j]);
|
|
4044
|
-
const
|
|
4045
|
-
z(!0), V.current && window.clearTimeout(V.current), k.current && window.clearTimeout(k.current),
|
|
4057
|
+
const W = (ee) => {
|
|
4058
|
+
z(!0), V.current && window.clearTimeout(V.current), k.current && window.clearTimeout(k.current), N(!1), U(!1), C.onFocus?.(ee);
|
|
4046
4059
|
}, Z = (ee) => {
|
|
4047
4060
|
z(!1), !g && t.length > 0 && (r(""), u(0)), C.onBlur?.(ee);
|
|
4048
4061
|
}, oe = (ee) => {
|
|
4049
4062
|
const ye = ee.target.value;
|
|
4050
|
-
D && ye.length > D || (
|
|
4063
|
+
D && ye.length > D || (A ? A(ye) : n(ye), C.onChange?.(ee));
|
|
4051
4064
|
}, ue = () => {
|
|
4052
|
-
const ee =
|
|
4053
|
-
ee.trim() && !
|
|
4065
|
+
const ee = A ? g : Y;
|
|
4066
|
+
ee.trim() && !q && (I?.(ee), A || n(""));
|
|
4054
4067
|
}, me = (ee) => {
|
|
4055
4068
|
(ee.ctrlKey || ee.metaKey) && ee.key === "Enter" && (ee.preventDefault(), ue()), C.onKeyDown?.(ee);
|
|
4056
|
-
}, pe =
|
|
4069
|
+
}, pe = A ? g : Y, we = q || !pe.trim() || (D ? pe.length > D : !1);
|
|
4057
4070
|
return /* @__PURE__ */ ie("div", { style: { position: "relative", ...P }, children: [
|
|
4058
4071
|
/* @__PURE__ */ ie("div", { style: { position: "relative" }, children: [
|
|
4059
4072
|
/* @__PURE__ */ M(
|
|
4060
4073
|
"textarea",
|
|
4061
4074
|
{
|
|
4062
|
-
ref:
|
|
4063
|
-
value:
|
|
4075
|
+
ref: b,
|
|
4076
|
+
value: A ? g : Y,
|
|
4064
4077
|
onChange: oe,
|
|
4065
4078
|
onFocus: (ee) => {
|
|
4066
|
-
ee.target.style.borderColor = "#1890ff", ee.target.style.boxShadow = "0 0 0 2px rgba(24, 144, 255, 0.2)",
|
|
4079
|
+
ee.target.style.borderColor = "#1890ff", ee.target.style.boxShadow = "0 0 0 2px rgba(24, 144, 255, 0.2)", W(ee);
|
|
4067
4080
|
},
|
|
4068
4081
|
onBlur: (ee) => {
|
|
4069
4082
|
ee.target.style.borderColor = "#d9d9d9", ee.target.style.boxShadow = "none", Z(ee);
|
|
@@ -4072,7 +4085,7 @@ const Xn = ({
|
|
|
4072
4085
|
placeholder: T || pe ? y : "",
|
|
4073
4086
|
maxLength: D,
|
|
4074
4087
|
rows: $,
|
|
4075
|
-
disabled:
|
|
4088
|
+
disabled: q,
|
|
4076
4089
|
style: {
|
|
4077
4090
|
width: "100%",
|
|
4078
4091
|
minHeight: `${$ * 24 + 16}px`,
|
|
@@ -4280,38 +4293,38 @@ const Ct = ({
|
|
|
4280
4293
|
height: i,
|
|
4281
4294
|
videoWidth: g,
|
|
4282
4295
|
// 参数保留但不使用,由CSS控制
|
|
4283
|
-
videoHeight:
|
|
4296
|
+
videoHeight: A,
|
|
4284
4297
|
// 参数保留但不使用,由CSS控制
|
|
4285
4298
|
showPlayButton: I = !0,
|
|
4286
4299
|
autoPlayOnHover: D = !0,
|
|
4287
4300
|
onClick: S,
|
|
4288
4301
|
onVideoLoaded: E,
|
|
4289
|
-
onVideoPlay:
|
|
4302
|
+
onVideoPlay: q,
|
|
4290
4303
|
onVideoPause: $,
|
|
4291
4304
|
onVideoEnded: P,
|
|
4292
4305
|
className: C,
|
|
4293
4306
|
style: e,
|
|
4294
4307
|
...r
|
|
4295
4308
|
}) => {
|
|
4296
|
-
const a = re(null), [u, f] = ae(!1), [
|
|
4297
|
-
a.current && (a.current.play(), f(!0),
|
|
4298
|
-
}, [
|
|
4309
|
+
const a = re(null), [u, f] = ae(!1), [N, T] = ae(!1), [z, F] = ae(!1), U = se(() => {
|
|
4310
|
+
a.current && (a.current.play(), f(!0), q?.());
|
|
4311
|
+
}, [q]), Y = se(() => {
|
|
4299
4312
|
a.current && (a.current.pause(), f(!1), $?.());
|
|
4300
4313
|
}, [$]), n = se((v) => {
|
|
4301
|
-
v.stopPropagation(), u ? Y() :
|
|
4302
|
-
}, [u,
|
|
4303
|
-
T(!0), D && !u &&
|
|
4304
|
-
}, [D, u,
|
|
4314
|
+
v.stopPropagation(), u ? Y() : U();
|
|
4315
|
+
}, [u, U, Y]), V = se(() => {
|
|
4316
|
+
T(!0), D && !u && U();
|
|
4317
|
+
}, [D, u, U]), k = se(() => {
|
|
4305
4318
|
T(!1), D && u && Y();
|
|
4306
4319
|
}, [D, u, Y]), H = se(() => {
|
|
4307
4320
|
F(!0), E?.();
|
|
4308
4321
|
}, [E]), X = se(() => {
|
|
4309
|
-
f(!0),
|
|
4310
|
-
}, [
|
|
4322
|
+
f(!0), q?.();
|
|
4323
|
+
}, [q]), d = se(() => {
|
|
4311
4324
|
f(!1), $?.();
|
|
4312
4325
|
}, [$]), p = se(() => {
|
|
4313
4326
|
f(!1), P?.();
|
|
4314
|
-
}, [P]),
|
|
4327
|
+
}, [P]), b = se((v) => {
|
|
4315
4328
|
S?.(v);
|
|
4316
4329
|
}, [S]);
|
|
4317
4330
|
return /* @__PURE__ */ M(
|
|
@@ -4332,7 +4345,7 @@ const Ct = ({
|
|
|
4332
4345
|
bordered: !1,
|
|
4333
4346
|
onMouseEnter: V,
|
|
4334
4347
|
onMouseLeave: k,
|
|
4335
|
-
onClick:
|
|
4348
|
+
onClick: b,
|
|
4336
4349
|
children: /* @__PURE__ */ ie("div", { className: "video-card-container", children: [
|
|
4337
4350
|
/* @__PURE__ */ M(
|
|
4338
4351
|
"video",
|
|
@@ -4352,7 +4365,7 @@ const Ct = ({
|
|
|
4352
4365
|
I && /* @__PURE__ */ M(
|
|
4353
4366
|
"div",
|
|
4354
4367
|
{
|
|
4355
|
-
className: `video-play-button ${
|
|
4368
|
+
className: `video-play-button ${N ? "hovered" : ""}`,
|
|
4356
4369
|
onClick: n,
|
|
4357
4370
|
children: u ? /* @__PURE__ */ M(on, { className: "play-icon" }) : /* @__PURE__ */ M(sn, { className: "play-icon" })
|
|
4358
4371
|
}
|
|
@@ -4476,23 +4489,23 @@ const Jn = (t) => [".mp4", ".webm", ".ogg", ".mov", ".avi", ".wmv", ".flv", ".mk
|
|
|
4476
4489
|
xl: 5,
|
|
4477
4490
|
xxl: 6
|
|
4478
4491
|
},
|
|
4479
|
-
className:
|
|
4492
|
+
className: A,
|
|
4480
4493
|
style: I,
|
|
4481
4494
|
onClick: D
|
|
4482
4495
|
}) => {
|
|
4483
|
-
const S = re(null), [E,
|
|
4496
|
+
const S = re(null), [E, q] = ae(y || g.md || 3), $ = re(/* @__PURE__ */ new Map()), P = se(() => {
|
|
4484
4497
|
if (!i || y)
|
|
4485
4498
|
return y || g.md || 3;
|
|
4486
4499
|
const a = window.innerWidth;
|
|
4487
4500
|
return a < 576 ? g.xs || 1 : a < 768 ? g.sm || 2 : a < 992 ? g.md || 3 : a < 1200 ? g.lg || 4 : a < 1600 ? g.xl || 5 : g.xxl || 6;
|
|
4488
4501
|
}, [i, y, g]), C = se(() => {
|
|
4489
4502
|
if (!S.current) return;
|
|
4490
|
-
const a = E, u = S.current,
|
|
4491
|
-
t.forEach((F,
|
|
4492
|
-
const Y = F.id ||
|
|
4503
|
+
const a = E, u = S.current, N = (u.offsetWidth - c * (a - 1)) / a, T = new Array(a).fill(0);
|
|
4504
|
+
t.forEach((F, U) => {
|
|
4505
|
+
const Y = F.id || U, n = $.current.get(Y);
|
|
4493
4506
|
if (!n) return;
|
|
4494
|
-
const V = Math.min(...T), k = T.indexOf(V), H = k * (
|
|
4495
|
-
n.style.position = "absolute", n.style.left = `${H}px`, n.style.top = `${X}px`, n.style.width = `${
|
|
4507
|
+
const V = Math.min(...T), k = T.indexOf(V), H = k * (N + c), X = T[k];
|
|
4508
|
+
n.style.position = "absolute", n.style.left = `${H}px`, n.style.top = `${X}px`, n.style.width = `${N}px`, T[k] += n.offsetHeight + c;
|
|
4496
4509
|
});
|
|
4497
4510
|
const z = Math.max(...T);
|
|
4498
4511
|
u.style.height = `${z}px`;
|
|
@@ -4500,7 +4513,7 @@ const Jn = (t) => [".mp4", ".webm", ".ogg", ".mov", ".avi", ".wmv", ".flv", ".mk
|
|
|
4500
4513
|
de(() => {
|
|
4501
4514
|
const a = () => {
|
|
4502
4515
|
const u = P();
|
|
4503
|
-
u !== E &&
|
|
4516
|
+
u !== E && q(u);
|
|
4504
4517
|
};
|
|
4505
4518
|
if (i)
|
|
4506
4519
|
return window.addEventListener("resize", a), a(), () => window.removeEventListener("resize", a);
|
|
@@ -4519,14 +4532,14 @@ const Jn = (t) => [".mp4", ".webm", ".ogg", ".mov", ".avi", ".wmv", ".flv", ".mk
|
|
|
4519
4532
|
"div",
|
|
4520
4533
|
{
|
|
4521
4534
|
ref: S,
|
|
4522
|
-
className: `waterfall-container ${
|
|
4535
|
+
className: `waterfall-container ${A || ""}`,
|
|
4523
4536
|
style: {
|
|
4524
4537
|
position: "relative",
|
|
4525
4538
|
width: "100%",
|
|
4526
4539
|
...I
|
|
4527
4540
|
},
|
|
4528
4541
|
children: t.map((a, u) => {
|
|
4529
|
-
const f = a.id || u,
|
|
4542
|
+
const f = a.id || u, N = Qn(a);
|
|
4530
4543
|
return /* @__PURE__ */ M(
|
|
4531
4544
|
"div",
|
|
4532
4545
|
{
|
|
@@ -4534,7 +4547,7 @@ const Jn = (t) => [".mp4", ".webm", ".ogg", ".mov", ".avi", ".wmv", ".flv", ".mk
|
|
|
4534
4547
|
T ? $.current.set(f, T) : $.current.delete(f);
|
|
4535
4548
|
},
|
|
4536
4549
|
className: "waterfall-item",
|
|
4537
|
-
children:
|
|
4550
|
+
children: N === "video" ? /* @__PURE__ */ M("div", { style: {
|
|
4538
4551
|
width: "100%",
|
|
4539
4552
|
position: "relative",
|
|
4540
4553
|
paddingBottom: "56.25%",
|
|
@@ -4712,7 +4725,7 @@ export {
|
|
|
4712
4725
|
dn as PageTable,
|
|
4713
4726
|
zn as RichTextEditor,
|
|
4714
4727
|
Ct as VideoCard,
|
|
4715
|
-
|
|
4728
|
+
Wn as VirtualTable,
|
|
4716
4729
|
Zn as Waterfall,
|
|
4717
4730
|
fn as XcIcon,
|
|
4718
4731
|
sr as lightTheme
|