bi-components-library 1.1.4 → 1.1.5
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 +1221 -1215
- 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
|
@@ -5,7 +5,7 @@ import { createFromIconfontCN as Zt, LeftOutlined as en, SearchOutlined as tn, R
|
|
|
5
5
|
import { createPortal as ot } from "react-dom";
|
|
6
6
|
const ln = ({
|
|
7
7
|
variant: t = "primary",
|
|
8
|
-
loading:
|
|
8
|
+
loading: h = !1,
|
|
9
9
|
children: u,
|
|
10
10
|
...c
|
|
11
11
|
}) => /* @__PURE__ */ H(
|
|
@@ -28,7 +28,7 @@ const ln = ({
|
|
|
28
28
|
return "primary";
|
|
29
29
|
}
|
|
30
30
|
})(t),
|
|
31
|
-
loading:
|
|
31
|
+
loading: h,
|
|
32
32
|
ghost: t === "ghost",
|
|
33
33
|
children: u
|
|
34
34
|
}
|
|
@@ -79,7 +79,7 @@ ln.__docgenInfo = {
|
|
|
79
79
|
};
|
|
80
80
|
const cn = ({
|
|
81
81
|
title: t,
|
|
82
|
-
children:
|
|
82
|
+
children: h,
|
|
83
83
|
bordered: u = !0,
|
|
84
84
|
hoverable: c = !1,
|
|
85
85
|
size: v = "default",
|
|
@@ -92,7 +92,7 @@ const cn = ({
|
|
|
92
92
|
bordered: u,
|
|
93
93
|
hoverable: c,
|
|
94
94
|
size: v,
|
|
95
|
-
children:
|
|
95
|
+
children: h
|
|
96
96
|
}
|
|
97
97
|
);
|
|
98
98
|
cn.__docgenInfo = {
|
|
@@ -148,16 +148,16 @@ cn.__docgenInfo = {
|
|
|
148
148
|
};
|
|
149
149
|
const un = ({
|
|
150
150
|
showDefaultFooter: t = !0,
|
|
151
|
-
...
|
|
151
|
+
...h
|
|
152
152
|
}) => {
|
|
153
|
-
const u =
|
|
153
|
+
const u = h.footer !== void 0 ? h.footer : t ? (c, { OkBtn: v, CancelBtn: D }) => /* @__PURE__ */ ce(Gt, { children: [
|
|
154
154
|
/* @__PURE__ */ H(v, {}),
|
|
155
155
|
/* @__PURE__ */ H(D, {})
|
|
156
156
|
] }) : null;
|
|
157
157
|
return /* @__PURE__ */ H(
|
|
158
158
|
Rt,
|
|
159
159
|
{
|
|
160
|
-
...
|
|
160
|
+
...h,
|
|
161
161
|
footer: u
|
|
162
162
|
}
|
|
163
163
|
);
|
|
@@ -225,7 +225,7 @@ un.__docgenInfo = {
|
|
|
225
225
|
};
|
|
226
226
|
const dn = ({
|
|
227
227
|
scrollX: t,
|
|
228
|
-
showPagination:
|
|
228
|
+
showPagination: h = !0,
|
|
229
229
|
defaultPageSize: u = 10,
|
|
230
230
|
...c
|
|
231
231
|
}) => /* @__PURE__ */ H(
|
|
@@ -236,7 +236,7 @@ const dn = ({
|
|
|
236
236
|
x: t || "max-content",
|
|
237
237
|
y: "50vh"
|
|
238
238
|
},
|
|
239
|
-
pagination:
|
|
239
|
+
pagination: h ? {
|
|
240
240
|
hideOnSinglePage: !0,
|
|
241
241
|
showSizeChanger: !0,
|
|
242
242
|
showQuickJumper: !0,
|
|
@@ -299,13 +299,13 @@ const pn = Zt({
|
|
|
299
299
|
scriptUrl: ["//at.alicdn.com/t/c/font_5037819_a72xy7yjoj.js"]
|
|
300
300
|
}), fn = ({
|
|
301
301
|
name: t,
|
|
302
|
-
size:
|
|
302
|
+
size: h,
|
|
303
303
|
color: u,
|
|
304
304
|
style: c,
|
|
305
305
|
...v
|
|
306
306
|
}) => {
|
|
307
307
|
const D = {
|
|
308
|
-
fontSize:
|
|
308
|
+
fontSize: h,
|
|
309
309
|
color: u,
|
|
310
310
|
...c
|
|
311
311
|
};
|
|
@@ -356,7 +356,7 @@ fn.__docgenInfo = {
|
|
|
356
356
|
};
|
|
357
357
|
const mn = ({
|
|
358
358
|
loading: t,
|
|
359
|
-
description:
|
|
359
|
+
description: h = "暂无数据",
|
|
360
360
|
className: u,
|
|
361
361
|
emptyChildren: c,
|
|
362
362
|
loadingText: v,
|
|
@@ -383,7 +383,7 @@ const mn = ({
|
|
|
383
383
|
zt,
|
|
384
384
|
{
|
|
385
385
|
image: D,
|
|
386
|
-
description:
|
|
386
|
+
description: h,
|
|
387
387
|
imageStyle: { height: 180 },
|
|
388
388
|
children: c
|
|
389
389
|
}
|
|
@@ -435,7 +435,7 @@ mn.__docgenInfo = {
|
|
|
435
435
|
};
|
|
436
436
|
const yn = ({
|
|
437
437
|
onClick: t,
|
|
438
|
-
showText:
|
|
438
|
+
showText: h = !1,
|
|
439
439
|
className: u,
|
|
440
440
|
size: c = "small",
|
|
441
441
|
type: v = "default"
|
|
@@ -447,7 +447,7 @@ const yn = ({
|
|
|
447
447
|
icon: /* @__PURE__ */ H(en, {}),
|
|
448
448
|
className: `cursor-pointer ${u || ""}`,
|
|
449
449
|
onClick: t,
|
|
450
|
-
children:
|
|
450
|
+
children: h && "返回"
|
|
451
451
|
}
|
|
452
452
|
);
|
|
453
453
|
yn.__docgenInfo = {
|
|
@@ -491,10 +491,10 @@ yn.__docgenInfo = {
|
|
|
491
491
|
};
|
|
492
492
|
const hn = ({
|
|
493
493
|
removePadding: t = !0,
|
|
494
|
-
className:
|
|
494
|
+
className: h,
|
|
495
495
|
...u
|
|
496
496
|
}) => {
|
|
497
|
-
const c = t ? `px-0 h-auto ${
|
|
497
|
+
const c = t ? `px-0 h-auto ${h || ""}` : h;
|
|
498
498
|
return /* @__PURE__ */ H(
|
|
499
499
|
Ae,
|
|
500
500
|
{
|
|
@@ -544,82 +544,82 @@ hn.__docgenInfo = {
|
|
|
544
544
|
};
|
|
545
545
|
const { Option: gn } = ze, xn = ({
|
|
546
546
|
columns: t,
|
|
547
|
-
request:
|
|
547
|
+
request: h,
|
|
548
548
|
searchFields: u = [],
|
|
549
549
|
showSearch: c = !0,
|
|
550
550
|
showRefresh: v = !0,
|
|
551
551
|
defaultPageSize: D = 10,
|
|
552
|
-
pageSizeOptions:
|
|
552
|
+
pageSizeOptions: M = ["10", "20", "50", "100"],
|
|
553
553
|
autoLoad: P = !0,
|
|
554
|
-
externalParams:
|
|
555
|
-
...
|
|
554
|
+
externalParams: N = {},
|
|
555
|
+
...T
|
|
556
556
|
}) => {
|
|
557
|
-
const [
|
|
557
|
+
const [_, R] = oe([]), [$, L] = oe(!1), [e, n] = oe({
|
|
558
558
|
current: 1,
|
|
559
559
|
pageSize: D,
|
|
560
560
|
total: 0
|
|
561
|
-
}), [r, i] = oe({}), [
|
|
562
|
-
|
|
563
|
-
const Q = ae(
|
|
564
|
-
Q.current =
|
|
565
|
-
const
|
|
566
|
-
const { sortable:
|
|
561
|
+
}), [r, i] = oe({}), [x, q] = oe({}), [O] = Ve.useForm(), C = ae(e);
|
|
562
|
+
C.current = e;
|
|
563
|
+
const Q = ae(N);
|
|
564
|
+
Q.current = N;
|
|
565
|
+
const W = ae(!1), X = nt(() => t.map((d) => {
|
|
566
|
+
const { sortable: p, render: f, ...y } = d;
|
|
567
567
|
return {
|
|
568
|
-
...
|
|
569
|
-
sorter:
|
|
570
|
-
render:
|
|
568
|
+
...y,
|
|
569
|
+
sorter: p ? !0 : void 0,
|
|
570
|
+
render: f || ((E) => E)
|
|
571
571
|
};
|
|
572
572
|
}), [t]), a = ie(async (d = {}) => {
|
|
573
|
-
if (
|
|
574
|
-
|
|
573
|
+
if (h) {
|
|
574
|
+
L(!0);
|
|
575
575
|
try {
|
|
576
|
-
const
|
|
577
|
-
page:
|
|
578
|
-
pageSize:
|
|
579
|
-
sortField:
|
|
580
|
-
sortOrder:
|
|
576
|
+
const p = {
|
|
577
|
+
page: C.current.current,
|
|
578
|
+
pageSize: C.current.pageSize,
|
|
579
|
+
sortField: x.field,
|
|
580
|
+
sortOrder: x.order,
|
|
581
581
|
searchParams: { ...r, ...Q.current },
|
|
582
582
|
...d
|
|
583
|
-
},
|
|
584
|
-
|
|
585
|
-
...
|
|
586
|
-
total:
|
|
587
|
-
current:
|
|
583
|
+
}, f = await h(p);
|
|
584
|
+
f.success && (R(f.data), n((y) => ({
|
|
585
|
+
...y,
|
|
586
|
+
total: f.total,
|
|
587
|
+
current: p.page || y.current
|
|
588
588
|
})));
|
|
589
|
-
} catch (
|
|
590
|
-
console.error("加载数据失败:",
|
|
589
|
+
} catch (p) {
|
|
590
|
+
console.error("加载数据失败:", p);
|
|
591
591
|
} finally {
|
|
592
|
-
|
|
592
|
+
L(!1);
|
|
593
593
|
}
|
|
594
594
|
}
|
|
595
|
-
}, [
|
|
596
|
-
i(d), n((
|
|
595
|
+
}, [h, x, r]), V = ie((d) => {
|
|
596
|
+
i(d), n((p) => ({ ...p, current: 1 }));
|
|
597
597
|
}, []), w = ie(() => {
|
|
598
|
-
|
|
599
|
-
}, [
|
|
598
|
+
O.resetFields(), i({}), n((d) => ({ ...d, current: 1 }));
|
|
599
|
+
}, [O]), U = ie(() => {
|
|
600
600
|
a();
|
|
601
|
-
}, [a]), z = ie((d,
|
|
602
|
-
const
|
|
601
|
+
}, [a]), z = ie((d, p, f) => {
|
|
602
|
+
const y = {
|
|
603
603
|
current: d.current || 1,
|
|
604
604
|
pageSize: d.pageSize || D,
|
|
605
605
|
total: d.total || 0
|
|
606
606
|
}, E = {
|
|
607
|
-
field:
|
|
608
|
-
order:
|
|
607
|
+
field: f?.field,
|
|
608
|
+
order: f?.order
|
|
609
609
|
};
|
|
610
|
-
n(
|
|
610
|
+
n(y), q(E);
|
|
611
611
|
}, [D]);
|
|
612
612
|
return pe(() => {
|
|
613
|
-
const d = Object.keys(
|
|
614
|
-
(P && !
|
|
615
|
-
}, [P,
|
|
613
|
+
const d = Object.keys(N).length > 0;
|
|
614
|
+
(P && !W.current || d) && (a(), W.current = !0);
|
|
615
|
+
}, [P, N, a]), /* @__PURE__ */ ce("div", { children: [
|
|
616
616
|
c && u.length > 0 && /* @__PURE__ */ H(rt, { size: "small", style: { marginBottom: 16 }, children: /* @__PURE__ */ ce(
|
|
617
617
|
Ve,
|
|
618
618
|
{
|
|
619
|
-
form:
|
|
619
|
+
form: O,
|
|
620
620
|
layout: "inline",
|
|
621
621
|
onFinish: V,
|
|
622
|
-
initialValues: u.reduce((d,
|
|
622
|
+
initialValues: u.reduce((d, p) => (p.defaultValue !== void 0 && (d[p.key] = p.defaultValue), d), {}),
|
|
623
623
|
children: [
|
|
624
624
|
u.map((d) => /* @__PURE__ */ H(Ve.Item, { name: d.key, label: d.label, children: d.type === "input" ? /* @__PURE__ */ H(
|
|
625
625
|
$t,
|
|
@@ -633,13 +633,13 @@ const { Option: gn } = ze, xn = ({
|
|
|
633
633
|
placeholder: d.placeholder || `请选择${d.label}`,
|
|
634
634
|
style: { width: 200 },
|
|
635
635
|
allowClear: !0,
|
|
636
|
-
children: d.options?.map((
|
|
636
|
+
children: d.options?.map((p) => /* @__PURE__ */ H(gn, { value: p.value, children: p.label }, p.value))
|
|
637
637
|
}
|
|
638
638
|
) }, d.key)),
|
|
639
639
|
/* @__PURE__ */ H(Ve.Item, { children: /* @__PURE__ */ ce(Yt, { children: [
|
|
640
640
|
/* @__PURE__ */ H(Ae, { type: "primary", htmlType: "submit", icon: /* @__PURE__ */ H(tn, {}), children: "查询" }),
|
|
641
641
|
/* @__PURE__ */ H(Ae, { onClick: w, children: "重置" }),
|
|
642
|
-
v && /* @__PURE__ */ H(Ae, { icon: /* @__PURE__ */ H(nn, {}), onClick:
|
|
642
|
+
v && /* @__PURE__ */ H(Ae, { icon: /* @__PURE__ */ H(nn, {}), onClick: U, children: "刷新" })
|
|
643
643
|
] }) })
|
|
644
644
|
]
|
|
645
645
|
}
|
|
@@ -647,16 +647,16 @@ const { Option: gn } = ze, xn = ({
|
|
|
647
647
|
/* @__PURE__ */ H(
|
|
648
648
|
at,
|
|
649
649
|
{
|
|
650
|
-
...
|
|
650
|
+
...T,
|
|
651
651
|
columns: X,
|
|
652
|
-
dataSource:
|
|
652
|
+
dataSource: _,
|
|
653
653
|
loading: $,
|
|
654
654
|
pagination: {
|
|
655
655
|
...e,
|
|
656
656
|
showSizeChanger: !0,
|
|
657
657
|
showQuickJumper: !0,
|
|
658
|
-
showTotal: (d,
|
|
659
|
-
pageSizeOptions:
|
|
658
|
+
showTotal: (d, p) => `第 ${p[0]}-${p[1]} 条/共 ${d} 条`,
|
|
659
|
+
pageSizeOptions: M
|
|
660
660
|
},
|
|
661
661
|
onChange: z,
|
|
662
662
|
scroll: { x: "max-content", y: "50vh" }
|
|
@@ -731,68 +731,68 @@ xn.__docgenInfo = {
|
|
|
731
731
|
}
|
|
732
732
|
}
|
|
733
733
|
};
|
|
734
|
-
function et(t,
|
|
734
|
+
function et(t, h, u) {
|
|
735
735
|
if (!t.current) return;
|
|
736
736
|
const c = ($) => {
|
|
737
737
|
$.classList.contains("rte-richtext-host-expanded") && ($.style.setProperty("display", "flex", "important"), $.style.setProperty("flex-direction", "column", "important"), $.style.setProperty("flex", "1 1 auto", "important"), $.style.setProperty("min-height", "0", "important"), $.style.setProperty("width", "100%", "important"), $.style.setProperty("align-self", "stretch", "important"));
|
|
738
738
|
}, v = /* @__PURE__ */ new Set(), D = {};
|
|
739
|
-
for (const $ of
|
|
739
|
+
for (const $ of h)
|
|
740
740
|
$.exclusionGroup && $.exclusionGroup !== "separator" && (v.add($.exclusionGroup), D[$.exclusionGroup] || (D[$.exclusionGroup] = []), D[$.exclusionGroup].push({
|
|
741
741
|
type: $.type,
|
|
742
742
|
key: $.key,
|
|
743
743
|
exclusionGroup: $.exclusionGroup
|
|
744
744
|
}));
|
|
745
|
-
const
|
|
745
|
+
const M = {};
|
|
746
746
|
for (const $ of v) {
|
|
747
|
-
|
|
748
|
-
for (const
|
|
749
|
-
if (
|
|
750
|
-
if (u[
|
|
751
|
-
|
|
747
|
+
M[$] = !1;
|
|
748
|
+
for (const L of D[$])
|
|
749
|
+
if (L.type === "upload" && L.key) {
|
|
750
|
+
if (u[L.key] !== null && u[L.key] !== void 0) {
|
|
751
|
+
M[$] = !0;
|
|
752
752
|
break;
|
|
753
753
|
}
|
|
754
|
-
const e =
|
|
754
|
+
const e = h.find((n) => n.type === "upload" && n.key === L.key);
|
|
755
755
|
if (e && typeof e.maxCount == "number")
|
|
756
756
|
for (let n = 0; n < e.maxCount; n++) {
|
|
757
|
-
const r = `${
|
|
757
|
+
const r = `${L.key}-${n}`;
|
|
758
758
|
if (u[r] !== null && u[r] !== void 0) {
|
|
759
|
-
|
|
759
|
+
M[$] = !0;
|
|
760
760
|
break;
|
|
761
761
|
}
|
|
762
762
|
}
|
|
763
|
-
if (
|
|
763
|
+
if (M[$])
|
|
764
764
|
break;
|
|
765
|
-
} else if ((
|
|
766
|
-
const e =
|
|
767
|
-
`[data-type="variable"][data-multi-key="${
|
|
765
|
+
} else if ((L.type === "variable" || L.type === "multi-variable") && L.key) {
|
|
766
|
+
const e = L.type === "multi-variable" ? t.current.querySelectorAll(
|
|
767
|
+
`[data-type="variable"][data-multi-key="${L.key}"]`
|
|
768
768
|
) : [t.current.querySelector(
|
|
769
|
-
`[data-type="variable"][data-key="${
|
|
769
|
+
`[data-type="variable"][data-key="${L.key}"]`
|
|
770
770
|
)].filter(Boolean);
|
|
771
771
|
for (const n of e)
|
|
772
772
|
if (!n.classList.contains("show-placeholder") && n.innerText.replace(/[\u200B\n]/g, "").trim().length > 0) {
|
|
773
|
-
|
|
773
|
+
M[$] = !0;
|
|
774
774
|
break;
|
|
775
775
|
}
|
|
776
|
-
if (
|
|
776
|
+
if (M[$])
|
|
777
777
|
break;
|
|
778
778
|
}
|
|
779
779
|
}
|
|
780
|
-
const P =
|
|
781
|
-
($) =>
|
|
780
|
+
const P = h.some(($) => $.exclusionGroup === "separator"), T = Object.keys(M).filter(
|
|
781
|
+
($) => M[$]
|
|
782
782
|
).length > 0;
|
|
783
|
-
let
|
|
784
|
-
if (
|
|
785
|
-
for (const $ of
|
|
786
|
-
if ($.exclusionGroup && $.exclusionGroup !== "separator" &&
|
|
787
|
-
|
|
783
|
+
let _ = null;
|
|
784
|
+
if (T && P) {
|
|
785
|
+
for (const $ of h)
|
|
786
|
+
if ($.exclusionGroup && $.exclusionGroup !== "separator" && M[$.exclusionGroup]) {
|
|
787
|
+
_ = $.exclusionGroup;
|
|
788
788
|
break;
|
|
789
789
|
}
|
|
790
790
|
}
|
|
791
791
|
for (const $ of v) {
|
|
792
|
-
const
|
|
792
|
+
const L = t.current.querySelectorAll(
|
|
793
793
|
`[data-group="${$}"]`
|
|
794
794
|
);
|
|
795
|
-
P &&
|
|
795
|
+
P && T && _ ? $ === _ ? L.forEach((e) => {
|
|
796
796
|
if (!e.closest('[data-rte-force-hidden="1"]')) {
|
|
797
797
|
if (e.classList.contains("rte-richtext-host-expanded")) {
|
|
798
798
|
c(e);
|
|
@@ -800,9 +800,9 @@ function et(t, g, u) {
|
|
|
800
800
|
}
|
|
801
801
|
e.classList.contains("required-upload-group") ? e.style.setProperty("display", "inline-flex", "important") : (e.classList.contains("exclusion-wrapper"), e.style.setProperty("display", "inline-block", "important"));
|
|
802
802
|
}
|
|
803
|
-
}) :
|
|
803
|
+
}) : L.forEach((e) => {
|
|
804
804
|
e.closest('[data-rte-force-hidden="1"]') || (e.style.display = "none", e.style.setProperty("display", "none", "important"));
|
|
805
|
-
}) :
|
|
805
|
+
}) : L.forEach((e) => {
|
|
806
806
|
if (!e.closest('[data-rte-force-hidden="1"]')) {
|
|
807
807
|
if (e.classList.contains("rte-richtext-host-expanded")) {
|
|
808
808
|
c(e);
|
|
@@ -815,10 +815,10 @@ function et(t, g, u) {
|
|
|
815
815
|
t.current.querySelectorAll(
|
|
816
816
|
'[data-group="separator"]'
|
|
817
817
|
).forEach(($) => {
|
|
818
|
-
$.style.display =
|
|
818
|
+
$.style.display = T ? "none" : "inline";
|
|
819
819
|
});
|
|
820
820
|
}
|
|
821
|
-
function tt(t,
|
|
821
|
+
function tt(t, h, u, c) {
|
|
822
822
|
if (!t.current) {
|
|
823
823
|
c(!1);
|
|
824
824
|
return;
|
|
@@ -829,19 +829,19 @@ function tt(t, g, u, c) {
|
|
|
829
829
|
const r = (e.textContent || "").replace(/[\u200B]/g, "").trim(), i = Array.from(e.querySelectorAll(":scope > div"));
|
|
830
830
|
if (i.length === 0)
|
|
831
831
|
return r;
|
|
832
|
-
let
|
|
833
|
-
for (let
|
|
834
|
-
if ((i[
|
|
835
|
-
|
|
832
|
+
let x = -1;
|
|
833
|
+
for (let C = 0; C < i.length; C++)
|
|
834
|
+
if ((i[C].textContent || "").replace(/[\u200B]/g, "").trim().length > 0) {
|
|
835
|
+
x = C;
|
|
836
836
|
break;
|
|
837
837
|
}
|
|
838
|
-
return i.filter((
|
|
838
|
+
return i.filter((C, Q) => Q !== x).map((C) => (C.textContent || "").replace(/[\u200B]/g, "").trim()).join(`
|
|
839
839
|
`).trim() || r;
|
|
840
|
-
}, D = (e) => e ? !!e.closest('[data-rte-force-hidden="1"]') : !1,
|
|
841
|
-
for (let e = 0; e <
|
|
842
|
-
const n =
|
|
840
|
+
}, D = (e) => e ? !!e.closest('[data-rte-force-hidden="1"]') : !1, M = [];
|
|
841
|
+
for (let e = 0; e < h.length; e++) {
|
|
842
|
+
const n = h[e];
|
|
843
843
|
if ((n.type === "variable" || n.type === "report-url" || n.type === "upload" || n.type === "multi-variable" || n.type === "select" || n.type === "textarea" || n.type === "richtext" || n.type === "report-module" || n.type === "datepicker" || n.type === "number-input") && n.required && n.key) {
|
|
844
|
-
|
|
844
|
+
M.push({
|
|
845
845
|
exclusionGroup: n.exclusionGroup || "",
|
|
846
846
|
key: n.key,
|
|
847
847
|
type: n.type === "multi-variable" || n.type === "report-url" ? "variable" : n.type === "report-module" ? "richtext" : n.type,
|
|
@@ -854,10 +854,10 @@ function tt(t, g, u, c) {
|
|
|
854
854
|
}
|
|
855
855
|
if (n.type === "text" && n.className?.includes("rte-text-required"))
|
|
856
856
|
if (n.exclusionGroup)
|
|
857
|
-
for (let r = e + 1; r <
|
|
858
|
-
const i =
|
|
857
|
+
for (let r = e + 1; r < h.length; r++) {
|
|
858
|
+
const i = h[r];
|
|
859
859
|
if (i.exclusionGroup === n.exclusionGroup && (i.type === "variable" || i.type === "upload" || i.type === "select" || i.type === "textarea" || i.type === "richtext" || i.type === "datepicker" || i.type === "number-input") && i.key) {
|
|
860
|
-
|
|
860
|
+
M.push({
|
|
861
861
|
exclusionGroup: n.exclusionGroup,
|
|
862
862
|
key: i.key,
|
|
863
863
|
type: i.type,
|
|
@@ -867,10 +867,10 @@ function tt(t, g, u, c) {
|
|
|
867
867
|
}
|
|
868
868
|
}
|
|
869
869
|
else
|
|
870
|
-
for (let r = e + 1; r <
|
|
871
|
-
const i =
|
|
870
|
+
for (let r = e + 1; r < h.length; r++) {
|
|
871
|
+
const i = h[r];
|
|
872
872
|
if ((i.type === "variable" || i.type === "upload" || i.type === "select" || i.type === "textarea" || i.type === "richtext" || i.type === "datepicker" || i.type === "number-input") && i.key) {
|
|
873
|
-
|
|
873
|
+
M.push({
|
|
874
874
|
exclusionGroup: i.exclusionGroup || "",
|
|
875
875
|
key: i.key,
|
|
876
876
|
type: i.type,
|
|
@@ -880,19 +880,19 @@ function tt(t, g, u, c) {
|
|
|
880
880
|
}
|
|
881
881
|
}
|
|
882
882
|
}
|
|
883
|
-
const P =
|
|
884
|
-
if (P &&
|
|
883
|
+
const P = h.some((e) => e.exclusionGroup === "separator"), N = [];
|
|
884
|
+
if (P && M.length > 1) {
|
|
885
885
|
const e = [];
|
|
886
|
-
|
|
886
|
+
h.forEach((n, r) => {
|
|
887
887
|
n.exclusionGroup === "separator" && e.push(r);
|
|
888
888
|
});
|
|
889
889
|
for (const n of e) {
|
|
890
|
-
const i =
|
|
891
|
-
i && q &&
|
|
890
|
+
const i = M.filter((O) => typeof O.__index == "number" && O.__index < n).sort((O, C) => (C.__index ?? 0) - (O.__index ?? 0))[0], q = M.filter((O) => typeof O.__index == "number" && O.__index > n).sort((O, C) => (O.__index ?? 0) - (C.__index ?? 0))[0];
|
|
891
|
+
i && q && N.push([i, q]);
|
|
892
892
|
}
|
|
893
893
|
}
|
|
894
|
-
if (
|
|
895
|
-
if (
|
|
894
|
+
if (M.length === 0) {
|
|
895
|
+
if (h.length === 0) {
|
|
896
896
|
if (!t.current) {
|
|
897
897
|
c(!1);
|
|
898
898
|
return;
|
|
@@ -904,7 +904,7 @@ function tt(t, g, u, c) {
|
|
|
904
904
|
c(!0);
|
|
905
905
|
return;
|
|
906
906
|
}
|
|
907
|
-
const
|
|
907
|
+
const T = M.filter((e) => {
|
|
908
908
|
if (!t.current) return !1;
|
|
909
909
|
if (e.exclusionGroup) {
|
|
910
910
|
const n = t.current.querySelectorAll(
|
|
@@ -980,29 +980,29 @@ function tt(t, g, u, c) {
|
|
|
980
980
|
}
|
|
981
981
|
return !1;
|
|
982
982
|
});
|
|
983
|
-
if (
|
|
983
|
+
if (T.length === 0) {
|
|
984
984
|
c(!0);
|
|
985
985
|
return;
|
|
986
986
|
}
|
|
987
|
-
const
|
|
988
|
-
|
|
987
|
+
const _ = /* @__PURE__ */ new Set();
|
|
988
|
+
N.forEach((e) => {
|
|
989
989
|
e.forEach((n) => {
|
|
990
|
-
n.key &&
|
|
990
|
+
n.key && _.add(n.key);
|
|
991
991
|
});
|
|
992
992
|
});
|
|
993
|
-
const R =
|
|
994
|
-
(e) => !e.key || !
|
|
993
|
+
const R = T.filter(
|
|
994
|
+
(e) => !e.key || !_.has(e.key)
|
|
995
995
|
);
|
|
996
|
-
let $ = (
|
|
997
|
-
for (const e of
|
|
996
|
+
let $ = (N.length === 0, !0);
|
|
997
|
+
for (const e of N) {
|
|
998
998
|
const n = e.filter((i) => {
|
|
999
999
|
if (!t.current) return !1;
|
|
1000
1000
|
if (i.exclusionGroup) {
|
|
1001
|
-
const
|
|
1001
|
+
const x = t.current.querySelectorAll(
|
|
1002
1002
|
`[data-group="${i.exclusionGroup}"]`
|
|
1003
1003
|
);
|
|
1004
|
-
if (
|
|
1005
|
-
const q =
|
|
1004
|
+
if (x.length > 0) {
|
|
1005
|
+
const q = x[0];
|
|
1006
1006
|
return D(q) ? !0 : q.style.display !== "none";
|
|
1007
1007
|
}
|
|
1008
1008
|
}
|
|
@@ -1014,17 +1014,17 @@ function tt(t, g, u, c) {
|
|
|
1014
1014
|
for (const i of n)
|
|
1015
1015
|
if (i.type === "upload" && i.key) {
|
|
1016
1016
|
if (i.minCount && i.minCount > 0) {
|
|
1017
|
-
let
|
|
1017
|
+
let x = 0;
|
|
1018
1018
|
const q = t.current.querySelectorAll(
|
|
1019
1019
|
`[data-type="upload"][data-batch-key="${i.key}"]`
|
|
1020
1020
|
);
|
|
1021
1021
|
if (q.length === 0)
|
|
1022
1022
|
continue;
|
|
1023
|
-
for (let
|
|
1024
|
-
const Q = q[
|
|
1025
|
-
Q && u[Q] != null && (
|
|
1023
|
+
for (let O = 0; O < q.length; O++) {
|
|
1024
|
+
const Q = q[O].dataset.key;
|
|
1025
|
+
Q && u[Q] != null && (x += 1);
|
|
1026
1026
|
}
|
|
1027
|
-
if (
|
|
1027
|
+
if (x >= i.minCount) {
|
|
1028
1028
|
r = !0;
|
|
1029
1029
|
break;
|
|
1030
1030
|
}
|
|
@@ -1034,68 +1034,68 @@ function tt(t, g, u, c) {
|
|
|
1034
1034
|
}
|
|
1035
1035
|
} else if (i.type === "variable" && i.key)
|
|
1036
1036
|
if (i.isMultiVariable) {
|
|
1037
|
-
const
|
|
1037
|
+
const x = t.current.querySelectorAll(
|
|
1038
1038
|
`[data-type="variable"][data-multi-key="${i.key}"]`
|
|
1039
1039
|
);
|
|
1040
1040
|
let q = 0;
|
|
1041
|
-
for (const
|
|
1042
|
-
if (
|
|
1041
|
+
for (const C of Array.from(x)) {
|
|
1042
|
+
if (C.classList.contains("show-placeholder"))
|
|
1043
1043
|
continue;
|
|
1044
|
-
|
|
1044
|
+
C.innerText.replace(/[\u200B\n]/g, "").trim().length > 0 && (q += 1);
|
|
1045
1045
|
}
|
|
1046
|
-
const
|
|
1047
|
-
if (q >=
|
|
1046
|
+
const O = i.minCount && i.minCount > 0 ? i.minCount : 1;
|
|
1047
|
+
if (q >= O) {
|
|
1048
1048
|
r = !0;
|
|
1049
1049
|
break;
|
|
1050
1050
|
}
|
|
1051
1051
|
} else {
|
|
1052
|
-
const
|
|
1052
|
+
const x = t.current.querySelector(
|
|
1053
1053
|
`[data-type="variable"][data-key="${i.key}"]`
|
|
1054
1054
|
);
|
|
1055
|
-
if (
|
|
1056
|
-
if (
|
|
1055
|
+
if (x) {
|
|
1056
|
+
if (x.classList.contains("show-placeholder"))
|
|
1057
1057
|
continue;
|
|
1058
|
-
if (
|
|
1058
|
+
if (x.innerText.replace(/[\u200B\n]/g, "").trim().length > 0) {
|
|
1059
1059
|
r = !0;
|
|
1060
1060
|
break;
|
|
1061
1061
|
}
|
|
1062
1062
|
}
|
|
1063
1063
|
}
|
|
1064
1064
|
else if (i.type === "select" && i.key) {
|
|
1065
|
-
const
|
|
1065
|
+
const x = t.current.querySelector(
|
|
1066
1066
|
`[data-type="select"][data-key="${i.key}"]`
|
|
1067
1067
|
);
|
|
1068
|
-
if (
|
|
1068
|
+
if (x && (x.getAttribute("data-value") || "").trim().length > 0) {
|
|
1069
1069
|
r = !0;
|
|
1070
1070
|
break;
|
|
1071
1071
|
}
|
|
1072
1072
|
} else if (i.type === "textarea" && i.key) {
|
|
1073
|
-
const
|
|
1073
|
+
const x = t.current.querySelector(
|
|
1074
1074
|
`[data-type="textarea"][data-key="${i.key}"]`
|
|
1075
1075
|
);
|
|
1076
|
-
if (
|
|
1076
|
+
if (x && (x.value || "").trim().length > 0) {
|
|
1077
1077
|
r = !0;
|
|
1078
1078
|
break;
|
|
1079
1079
|
}
|
|
1080
1080
|
} else if (i.type === "richtext" && i.key) {
|
|
1081
|
-
const
|
|
1081
|
+
const x = typeof i.moduleIndex == "number" ? `[data-type="richtext"][data-node-type="report-module"][data-key="${i.key}"][data-module-index="${i.moduleIndex}"]` : `[data-type="richtext"][data-key="${i.key}"]`, q = t.current.querySelector(x);
|
|
1082
1082
|
if (q && v(q).length > 0) {
|
|
1083
1083
|
r = !0;
|
|
1084
1084
|
break;
|
|
1085
1085
|
}
|
|
1086
1086
|
} else if (i.type === "datepicker" && i.key) {
|
|
1087
|
-
const
|
|
1087
|
+
const x = t.current.querySelector(
|
|
1088
1088
|
`[data-type="datepicker"][data-key="${i.key}"]`
|
|
1089
1089
|
);
|
|
1090
|
-
if (
|
|
1090
|
+
if (x && (x.getAttribute("data-value") || "").trim().length > 0) {
|
|
1091
1091
|
r = !0;
|
|
1092
1092
|
break;
|
|
1093
1093
|
}
|
|
1094
1094
|
} else if (i.type === "number-input" && i.key) {
|
|
1095
|
-
const
|
|
1095
|
+
const x = t.current.querySelector(
|
|
1096
1096
|
`[data-type="number-input"][data-key="${i.key}"]`
|
|
1097
1097
|
);
|
|
1098
|
-
if (
|
|
1098
|
+
if (x && (x.value || "").trim().length > 0) {
|
|
1099
1099
|
r = !0;
|
|
1100
1100
|
break;
|
|
1101
1101
|
}
|
|
@@ -1105,7 +1105,7 @@ function tt(t, g, u, c) {
|
|
|
1105
1105
|
break;
|
|
1106
1106
|
}
|
|
1107
1107
|
}
|
|
1108
|
-
let
|
|
1108
|
+
let L = !0;
|
|
1109
1109
|
for (const e of R)
|
|
1110
1110
|
if (e.type === "upload" && e.key) {
|
|
1111
1111
|
if (e.minCount && e.minCount > 0) {
|
|
@@ -1114,7 +1114,7 @@ function tt(t, g, u, c) {
|
|
|
1114
1114
|
`[data-type="upload"][data-batch-key="${e.key}"]`
|
|
1115
1115
|
);
|
|
1116
1116
|
if (r.length === 0) {
|
|
1117
|
-
|
|
1117
|
+
L = !1;
|
|
1118
1118
|
break;
|
|
1119
1119
|
}
|
|
1120
1120
|
for (let i = 0; i < r.length; i++) {
|
|
@@ -1122,11 +1122,11 @@ function tt(t, g, u, c) {
|
|
|
1122
1122
|
q && u[q] != null && (n += 1);
|
|
1123
1123
|
}
|
|
1124
1124
|
if (n < e.minCount) {
|
|
1125
|
-
|
|
1125
|
+
L = !1;
|
|
1126
1126
|
break;
|
|
1127
1127
|
}
|
|
1128
1128
|
} else if (u[e.key] === null || u[e.key] === void 0) {
|
|
1129
|
-
|
|
1129
|
+
L = !1;
|
|
1130
1130
|
break;
|
|
1131
1131
|
}
|
|
1132
1132
|
} else if (e.type === "variable" && e.key)
|
|
@@ -1135,14 +1135,14 @@ function tt(t, g, u, c) {
|
|
|
1135
1135
|
`[data-type="variable"][data-multi-key="${e.key}"]`
|
|
1136
1136
|
);
|
|
1137
1137
|
let r = 0;
|
|
1138
|
-
for (const
|
|
1139
|
-
if (
|
|
1138
|
+
for (const x of Array.from(n)) {
|
|
1139
|
+
if (x.classList.contains("show-placeholder"))
|
|
1140
1140
|
continue;
|
|
1141
|
-
|
|
1141
|
+
x.innerText.replace(/[\u200B\n]/g, "").trim().length > 0 && (r += 1);
|
|
1142
1142
|
}
|
|
1143
1143
|
const i = e.minCount && e.minCount > 0 ? e.minCount : 1;
|
|
1144
1144
|
if (r < i) {
|
|
1145
|
-
|
|
1145
|
+
L = !1;
|
|
1146
1146
|
break;
|
|
1147
1147
|
}
|
|
1148
1148
|
} else {
|
|
@@ -1150,15 +1150,15 @@ function tt(t, g, u, c) {
|
|
|
1150
1150
|
`[data-type="variable"][data-key="${e.key}"]`
|
|
1151
1151
|
);
|
|
1152
1152
|
if (!n) {
|
|
1153
|
-
|
|
1153
|
+
L = !1;
|
|
1154
1154
|
break;
|
|
1155
1155
|
}
|
|
1156
1156
|
if (n.classList.contains("show-placeholder")) {
|
|
1157
|
-
|
|
1157
|
+
L = !1;
|
|
1158
1158
|
break;
|
|
1159
1159
|
}
|
|
1160
1160
|
if (n.innerText.replace(/[\u200B\n]/g, "").trim().length === 0) {
|
|
1161
|
-
|
|
1161
|
+
L = !1;
|
|
1162
1162
|
break;
|
|
1163
1163
|
}
|
|
1164
1164
|
}
|
|
@@ -1167,7 +1167,7 @@ function tt(t, g, u, c) {
|
|
|
1167
1167
|
`[data-type="select"][data-key="${e.key}"]`
|
|
1168
1168
|
);
|
|
1169
1169
|
if (!n || (n.getAttribute("data-value") || "").trim().length === 0) {
|
|
1170
|
-
|
|
1170
|
+
L = !1;
|
|
1171
1171
|
break;
|
|
1172
1172
|
}
|
|
1173
1173
|
} else if (e.type === "textarea" && e.key) {
|
|
@@ -1175,13 +1175,13 @@ function tt(t, g, u, c) {
|
|
|
1175
1175
|
`[data-type="textarea"][data-key="${e.key}"]`
|
|
1176
1176
|
);
|
|
1177
1177
|
if (!n || (n.value || "").trim().length === 0) {
|
|
1178
|
-
|
|
1178
|
+
L = !1;
|
|
1179
1179
|
break;
|
|
1180
1180
|
}
|
|
1181
1181
|
} else if (e.type === "richtext" && e.key) {
|
|
1182
1182
|
const n = 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}"]`, r = t.current.querySelector(n);
|
|
1183
1183
|
if (!r || v(r).length === 0) {
|
|
1184
|
-
|
|
1184
|
+
L = !1;
|
|
1185
1185
|
break;
|
|
1186
1186
|
}
|
|
1187
1187
|
} else if (e.type === "datepicker" && e.key) {
|
|
@@ -1189,7 +1189,7 @@ function tt(t, g, u, c) {
|
|
|
1189
1189
|
`[data-type="datepicker"][data-key="${e.key}"]`
|
|
1190
1190
|
);
|
|
1191
1191
|
if (!n || (n.getAttribute("data-value") || "").trim().length === 0) {
|
|
1192
|
-
|
|
1192
|
+
L = !1;
|
|
1193
1193
|
break;
|
|
1194
1194
|
}
|
|
1195
1195
|
} else if (e.type === "number-input" && e.key) {
|
|
@@ -1197,54 +1197,54 @@ function tt(t, g, u, c) {
|
|
|
1197
1197
|
`[data-type="number-input"][data-key="${e.key}"]`
|
|
1198
1198
|
);
|
|
1199
1199
|
if (!n || (n.value || "").trim().length === 0) {
|
|
1200
|
-
|
|
1200
|
+
L = !1;
|
|
1201
1201
|
break;
|
|
1202
1202
|
}
|
|
1203
1203
|
}
|
|
1204
|
-
c($ &&
|
|
1204
|
+
c($ && L);
|
|
1205
1205
|
}
|
|
1206
|
-
function Ze(t,
|
|
1206
|
+
function Ze(t, h) {
|
|
1207
1207
|
if (!t.current) return;
|
|
1208
1208
|
t.current.querySelectorAll('[data-type="variable"]').forEach((c) => {
|
|
1209
1209
|
const v = c.innerText;
|
|
1210
1210
|
v.replace(/\u200B/g, "").trim().length === 0 ? (v !== "" && (c.innerText = ""), c.classList.add("show-placeholder")) : c.classList.remove("show-placeholder");
|
|
1211
1211
|
});
|
|
1212
1212
|
}
|
|
1213
|
-
const bn = ({ host: t, onChange:
|
|
1214
|
-
const u = t.dataset.key, c = t.dataset.placeholder, v = t.dataset.options ? decodeURIComponent(t.dataset.options) : "[]", D = t.dataset.required === "true",
|
|
1213
|
+
const bn = ({ host: t, onChange: h }) => {
|
|
1214
|
+
const u = t.dataset.key, c = t.dataset.placeholder, v = t.dataset.options ? decodeURIComponent(t.dataset.options) : "[]", D = t.dataset.required === "true", M = t.dataset.value || "", P = Qe.useMemo(() => {
|
|
1215
1215
|
try {
|
|
1216
1216
|
return JSON.parse(v);
|
|
1217
1217
|
} catch {
|
|
1218
1218
|
return [];
|
|
1219
1219
|
}
|
|
1220
|
-
}, [v]), [
|
|
1221
|
-
|
|
1220
|
+
}, [v]), [N, T] = oe(M || void 0), [_, R] = oe(64), $ = ae(null), L = (r) => {
|
|
1221
|
+
T(r), t.setAttribute("data-value", r), h(u, r);
|
|
1222
1222
|
};
|
|
1223
1223
|
pe(() => {
|
|
1224
|
-
|
|
1225
|
-
}, [
|
|
1224
|
+
T(M || void 0);
|
|
1225
|
+
}, [M]);
|
|
1226
1226
|
const e = Qe.useCallback(() => {
|
|
1227
|
-
if (
|
|
1228
|
-
const r = P.find((i) => String(i.value) === String(
|
|
1229
|
-
return r ? typeof r.label == "string" ? r.label : String(r.label ??
|
|
1227
|
+
if (N != null && N !== "") {
|
|
1228
|
+
const r = P.find((i) => String(i.value) === String(N));
|
|
1229
|
+
return r ? typeof r.label == "string" ? r.label : String(r.label ?? N) : String(N);
|
|
1230
1230
|
}
|
|
1231
1231
|
return c || "请选择";
|
|
1232
|
-
}, [
|
|
1232
|
+
}, [N, P, c]), n = Qe.useCallback(() => {
|
|
1233
1233
|
const r = $.current;
|
|
1234
1234
|
if (!r) return;
|
|
1235
|
-
const i = r.querySelector(".ant-select-selection-item"),
|
|
1236
|
-
let
|
|
1237
|
-
if (
|
|
1238
|
-
const J = window.getComputedStyle(
|
|
1239
|
-
|
|
1235
|
+
const i = r.querySelector(".ant-select-selection-item"), x = r.querySelector(".ant-select-selection-placeholder"), q = i || x, O = (q?.textContent || "").trim() || e(), C = r.querySelector(".ant-select-selector"), Q = q || C || r, W = window.getComputedStyle(Q), X = q ? W.fontSize : "16px", a = W.fontFamily || "sans-serif", V = W.fontWeight || "400", U = `${W.fontStyle || "normal"} ${V} ${X} ${a}`, d = document.createElement("canvas").getContext("2d"), p = d ? Math.ceil((d.font = U, d.measureText(O).width || 0)) : 0;
|
|
1236
|
+
let f = 0;
|
|
1237
|
+
if (C) {
|
|
1238
|
+
const J = window.getComputedStyle(C);
|
|
1239
|
+
f = (Number.parseFloat(J.paddingLeft) || 0) + (Number.parseFloat(J.paddingRight) || 0);
|
|
1240
1240
|
}
|
|
1241
|
-
const
|
|
1242
|
-
let
|
|
1241
|
+
const y = r.querySelector(".ant-select-arrow"), E = y ? Math.ceil(y.getBoundingClientRect().width) : 12, Y = r.querySelector(".ant-select-clear");
|
|
1242
|
+
let K = 0;
|
|
1243
1243
|
if (Y) {
|
|
1244
1244
|
const J = window.getComputedStyle(Y);
|
|
1245
|
-
J.display !== "none" && J.visibility !== "hidden" && (
|
|
1245
|
+
J.display !== "none" && J.visibility !== "hidden" && (K = Math.ceil(Y.getBoundingClientRect().width));
|
|
1246
1246
|
}
|
|
1247
|
-
const Z = Math.max(36,
|
|
1247
|
+
const Z = Math.max(36, p + f + E + K + 6);
|
|
1248
1248
|
R((J) => J === Z ? J : Z);
|
|
1249
1249
|
}, [e]);
|
|
1250
1250
|
return Le(() => {
|
|
@@ -1273,12 +1273,12 @@ const bn = ({ host: t, onChange: g }) => {
|
|
|
1273
1273
|
className: "rte-select-wrapper",
|
|
1274
1274
|
contentEditable: !1,
|
|
1275
1275
|
ref: $,
|
|
1276
|
-
style: { display: "inline-block", width:
|
|
1276
|
+
style: { display: "inline-block", width: _ },
|
|
1277
1277
|
children: /* @__PURE__ */ H(
|
|
1278
1278
|
ze,
|
|
1279
1279
|
{
|
|
1280
|
-
value:
|
|
1281
|
-
onChange:
|
|
1280
|
+
value: N,
|
|
1281
|
+
onChange: L,
|
|
1282
1282
|
placeholder: c || "请选择",
|
|
1283
1283
|
style: { width: "100%" },
|
|
1284
1284
|
options: P,
|
|
@@ -1295,48 +1295,48 @@ const bn = ({ host: t, onChange: g }) => {
|
|
|
1295
1295
|
t
|
|
1296
1296
|
);
|
|
1297
1297
|
}, vn = (t) => {
|
|
1298
|
-
const [
|
|
1298
|
+
const [h, u] = oe([]);
|
|
1299
1299
|
return pe(() => {
|
|
1300
1300
|
const c = t.current;
|
|
1301
1301
|
if (!c) return;
|
|
1302
1302
|
const v = () => {
|
|
1303
|
-
const
|
|
1304
|
-
|
|
1305
|
-
const
|
|
1306
|
-
|
|
1303
|
+
const M = c.querySelectorAll(".rte-select-host"), P = [];
|
|
1304
|
+
M.forEach((N) => {
|
|
1305
|
+
const T = N.getAttribute("data-key");
|
|
1306
|
+
T && P.push(
|
|
1307
1307
|
/* @__PURE__ */ H(
|
|
1308
1308
|
bn,
|
|
1309
1309
|
{
|
|
1310
|
-
host:
|
|
1310
|
+
host: N,
|
|
1311
1311
|
onChange: () => {
|
|
1312
1312
|
if (t.current) {
|
|
1313
|
-
const
|
|
1314
|
-
t.current.dispatchEvent(
|
|
1313
|
+
const _ = new Event("input", { bubbles: !0 });
|
|
1314
|
+
t.current.dispatchEvent(_);
|
|
1315
1315
|
}
|
|
1316
1316
|
}
|
|
1317
1317
|
},
|
|
1318
|
-
`select-${
|
|
1318
|
+
`select-${T}`
|
|
1319
1319
|
)
|
|
1320
1320
|
);
|
|
1321
1321
|
}), u(P);
|
|
1322
1322
|
};
|
|
1323
1323
|
v();
|
|
1324
|
-
const D = new MutationObserver((
|
|
1324
|
+
const D = new MutationObserver((M) => {
|
|
1325
1325
|
let P = !1;
|
|
1326
|
-
for (const
|
|
1327
|
-
if (
|
|
1328
|
-
let
|
|
1329
|
-
if (
|
|
1330
|
-
if (
|
|
1331
|
-
const R =
|
|
1332
|
-
(R.classList?.contains("rte-select-host") || R.querySelector?.(".rte-select-host")) && (
|
|
1326
|
+
for (const N of M)
|
|
1327
|
+
if (N.type === "childList") {
|
|
1328
|
+
let T = !1;
|
|
1329
|
+
if (N.addedNodes.forEach((_) => {
|
|
1330
|
+
if (_.nodeType === Node.ELEMENT_NODE) {
|
|
1331
|
+
const R = _;
|
|
1332
|
+
(R.classList?.contains("rte-select-host") || R.querySelector?.(".rte-select-host")) && (T = !0);
|
|
1333
1333
|
}
|
|
1334
|
-
}),
|
|
1335
|
-
if (
|
|
1336
|
-
const R =
|
|
1337
|
-
(R.classList?.contains("rte-select-host") || R.querySelector?.(".rte-select-host")) && (
|
|
1334
|
+
}), N.removedNodes.forEach((_) => {
|
|
1335
|
+
if (_.nodeType === Node.ELEMENT_NODE) {
|
|
1336
|
+
const R = _;
|
|
1337
|
+
(R.classList?.contains("rte-select-host") || R.querySelector?.(".rte-select-host")) && (T = !0);
|
|
1338
1338
|
}
|
|
1339
|
-
}),
|
|
1339
|
+
}), T) {
|
|
1340
1340
|
P = !0;
|
|
1341
1341
|
break;
|
|
1342
1342
|
}
|
|
@@ -1344,152 +1344,152 @@ const bn = ({ host: t, onChange: g }) => {
|
|
|
1344
1344
|
P && v();
|
|
1345
1345
|
});
|
|
1346
1346
|
return D.observe(c, { childList: !0, subtree: !0 }), () => D.disconnect();
|
|
1347
|
-
}, [t]),
|
|
1347
|
+
}, [t]), h;
|
|
1348
1348
|
}, Oe = (t) => t.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
1349
|
-
function wn(t,
|
|
1349
|
+
function wn(t, h, u, c, v, D = {}, M, P) {
|
|
1350
1350
|
if (!t.current) return;
|
|
1351
|
-
const
|
|
1351
|
+
const N = /[;;,,。.!!??::、]/, T = (e) => {
|
|
1352
1352
|
const n = (e ?? "").trim();
|
|
1353
|
-
return n.length === 1 &&
|
|
1354
|
-
},
|
|
1355
|
-
const n = e ?? "", r = n.match(new RegExp(`^\\s*(${
|
|
1353
|
+
return n.length === 1 && N.test(n);
|
|
1354
|
+
}, _ = (e) => {
|
|
1355
|
+
const n = e ?? "", r = n.match(new RegExp(`^\\s*(${N.source})`));
|
|
1356
1356
|
if (!r) return null;
|
|
1357
|
-
const i = r[1],
|
|
1358
|
-
return { punct: i, rest:
|
|
1357
|
+
const i = r[1], x = n.replace(new RegExp(`^\\s*${N.source}`), "");
|
|
1358
|
+
return { punct: i, rest: x };
|
|
1359
1359
|
}, R = (e) => `<span data-type="text" class="rte-inline-punct" contenteditable="false">${e}</span>`, $ = [];
|
|
1360
|
-
let
|
|
1361
|
-
for (;
|
|
1362
|
-
const e =
|
|
1360
|
+
let L = 0;
|
|
1361
|
+
for (; L < h.length; ) {
|
|
1362
|
+
const e = h[L], n = L + 1 < h.length ? h[L + 1] : null;
|
|
1363
1363
|
let r = !1;
|
|
1364
1364
|
if (e.type === "text" && (e.text?.includes("icon-bitian") || e.className === "rte-text-required") && n) {
|
|
1365
|
-
const
|
|
1366
|
-
if (
|
|
1365
|
+
const W = n.type === "upload" && n.exclusionGroup === "fileInput" && e.exclusionGroup === "fileInput" && e.exclusionGroup === n.exclusionGroup, X = n.type === "variable" && n.exclusionGroup === "textInput" && e.exclusionGroup === "textInput" && e.exclusionGroup === n.exclusionGroup;
|
|
1366
|
+
if (W) {
|
|
1367
1367
|
const a = e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : "", V = `<span ${a} class="exclusion-wrapper required-upload-group">`, w = "</span>";
|
|
1368
|
-
let
|
|
1369
|
-
e.className ?
|
|
1370
|
-
const z = n, d = u[z.key] !== null && u[z.key] !== void 0,
|
|
1368
|
+
let U = "";
|
|
1369
|
+
e.className ? U = `<span class="${e.className}">${e.text ?? ""}</span>` : U = e.text ?? "";
|
|
1370
|
+
const z = n, d = u[z.key] !== null && u[z.key] !== void 0, p = d ? u[z.key] : null, f = d ? u[z.key]?.name : z.text, y = d ? "" : "hidden", E = z.tooltip && !d ? "" : "hidden", Y = d ? "has-file" : "", K = d && f ? ` data-file-name="${f.replace(/"/g, """)}"` : "";
|
|
1371
1371
|
let Z = "";
|
|
1372
|
-
d &&
|
|
1373
|
-
const J = (z.text || "").trim(), fe = d && J.length >= 12 ? `<span ${a} contenteditable="false" class="exclusion-wrapper upload-hint">${J}</span>` : "", de = `<span contenteditable="false" data-type="upload" data-key="${z.key}" class="upload-chip"><span class="upload-inner-wrapper ${Y}"><span class="upload-icon">${Z}</span><span class="upload-label"${
|
|
1374
|
-
$.push(V +
|
|
1372
|
+
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>";
|
|
1373
|
+
const J = (z.text || "").trim(), fe = d && J.length >= 12 ? `<span ${a} contenteditable="false" class="exclusion-wrapper upload-hint">${J}</span>` : "", de = `<span contenteditable="false" data-type="upload" data-key="${z.key}" class="upload-chip"><span class="upload-inner-wrapper ${Y}"><span class="upload-icon">${Z}</span><span class="upload-label"${K}>${f || z.text}</span>${z.tooltip ? `<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi upload-info-icon ${E}" data-upload-key="${z.key}" data-tooltip="${z.tooltip}"></i>` : ""}<span class="file-remove-btn ${y}" title="移除文件">×</span></span></span>`;
|
|
1374
|
+
$.push(V + U + de + w + fe), L += 2;
|
|
1375
1375
|
continue;
|
|
1376
1376
|
}
|
|
1377
1377
|
if (X) {
|
|
1378
1378
|
const V = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group">`, w = "</span>";
|
|
1379
|
-
let
|
|
1380
|
-
e.className ?
|
|
1381
|
-
const z = n,
|
|
1382
|
-
$.push(V +
|
|
1379
|
+
let U = "";
|
|
1380
|
+
e.className ? U = `<span class="${e.className}">${e.text ?? ""}</span>` : U = e.text ?? "";
|
|
1381
|
+
const z = n, p = (z.key ? v[z.key] : void 0) || z.text || "", f = !p, y = f ? "" : p, E = f ? "show-placeholder" : "", Y = z.exclusionGroup ? ` data-group="${z.exclusionGroup}"` : "", K = z.tooltip ? ` data-tooltip="${z.tooltip.replace(/"/g, """)}" data-variable-key="${z.key || ""}"` : "", Z = z.tooltip && f ? "" : "hidden", J = `<span contenteditable="true" data-type="variable" data-key="${z.key}" data-placeholder="${z.placeholder || ""}"${Y}${K} class="variable-chip ${E}">${y}${z.tooltip ? `<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi variable-info-icon ${Z}" data-variable-key="${z.key}" data-tooltip="${z.tooltip.replace(/"/g, """)}" ></i>` : ""}</span>`;
|
|
1382
|
+
$.push(V + U + J + w), L += 2;
|
|
1383
1383
|
continue;
|
|
1384
1384
|
}
|
|
1385
1385
|
}
|
|
1386
|
-
const
|
|
1387
|
-
let
|
|
1386
|
+
const x = e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : "", q = e.exclusionGroup ? `<span ${x} class="exclusion-wrapper">` : "", O = e.exclusionGroup ? "</span>" : "";
|
|
1387
|
+
let C = "";
|
|
1388
1388
|
if (e.type === "tag") {
|
|
1389
|
-
const X = c ||
|
|
1390
|
-
|
|
1389
|
+
const X = c || M === "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>', a = c ? ' data-locked="true"' : "", V = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, """)}" data-tag-key="${e.key || ""}"` : "";
|
|
1390
|
+
C = `<span contenteditable="false" class="tag-node group"${a}${V}><span class="tag-label">${e.text}</span>${X}</span>`;
|
|
1391
1391
|
} else if (e.type === "text") {
|
|
1392
|
-
const
|
|
1393
|
-
e.className ?
|
|
1392
|
+
const W = c ? ' data-locked="true" contenteditable="false"' : ' contenteditable="false"', a = (e.text ?? "").replace(/\n/g, "<br/>");
|
|
1393
|
+
e.className ? C = `<span data-type="text" class="${e.className}"${W}>${a}</span>` : C = c ? `<span data-type="text"${W}>${a}</span>` : `<span data-type="text" contenteditable="false">${a}</span>`;
|
|
1394
1394
|
} else if (e.type === "variable" && e.key) {
|
|
1395
|
-
const X = v[e.key] || e.text || "", a = !X, V = a ? "" : X, w = a ? "show-placeholder" : "",
|
|
1396
|
-
e.required ?
|
|
1395
|
+
const X = v[e.key] || e.text || "", a = !X, V = a ? "" : X, w = a ? "show-placeholder" : "", U = e.exclusionGroup ? ` data-group="${e.exclusionGroup}"` : "", z = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, """)}" data-variable-key="${e.key || ""}"` : "", d = e.tooltip && a ? "" : "hidden", p = `<span contenteditable="true" data-type="variable" data-key="${e.key}" data-placeholder="${e.placeholder || ""}"${U}${z} class="variable-chip ${w}">${V}${e.tooltip ? `<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi variable-info-icon ${d}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g, """)}" ></i>` : ""}</span>`;
|
|
1396
|
+
e.required ? C = `<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>${p}</span>` : C = p;
|
|
1397
1397
|
} else if (e.type === "report-url" && e.key) {
|
|
1398
|
-
const
|
|
1399
|
-
e.required ?
|
|
1398
|
+
const W = `${e.key}__url`, a = Object.prototype.hasOwnProperty.call(v, W) ? v[W] : void 0, V = v[e.key], w = a ?? V ?? e.text ?? "", U = !w, z = U ? "" : w, d = U ? "show-placeholder" : "", p = e.exclusionGroup ? ` data-group="${e.exclusionGroup}"` : "", f = e.tooltip ? ` data-tooltip="${Oe(e.tooltip)}" data-variable-key="${e.key || ""}"` : "", y = e.tooltip && U ? "" : "hidden", E = `<span contenteditable="true" data-type="variable" data-key="${e.key}" data-node-type="report-url" data-placeholder="${Oe(e.placeholder || "")}"${p}${f} class="variable-chip rte-report-url ${d}">${z}${e.tooltip ? `<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi variable-info-icon ${y}" data-variable-key="${e.key}" data-tooltip="${Oe(e.tooltip)}" ></i>` : ""}</span>`;
|
|
1399
|
+
e.required ? C = `<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>${E}</span>` : C = E;
|
|
1400
1400
|
} else if (e.type === "upload" && e.key) {
|
|
1401
|
-
const
|
|
1402
|
-
if (
|
|
1403
|
-
const w = e.minCount || 1,
|
|
1401
|
+
const W = !!n && n.type === "text" && !n.className && !n.exclusionGroup && T(n.text), X = W ? (n.text ?? "").trim() : "", a = X ? R(X) : "";
|
|
1402
|
+
if (W && (r = !0), typeof e.maxCount == "number" && typeof e.minCount == "number" && e.maxCount > 1) {
|
|
1403
|
+
const w = e.minCount || 1, U = e.maxCount || 3;
|
|
1404
1404
|
let z = 0;
|
|
1405
|
-
for (let
|
|
1406
|
-
const
|
|
1407
|
-
u[
|
|
1405
|
+
for (let f = 0; f < U; f++) {
|
|
1406
|
+
const y = `${e.key}-${f}`;
|
|
1407
|
+
u[y] != null && (z += 1);
|
|
1408
1408
|
}
|
|
1409
1409
|
const d = Math.min(
|
|
1410
|
-
|
|
1411
|
-
Math.max(w, z + (z <
|
|
1410
|
+
U,
|
|
1411
|
+
Math.max(w, z + (z < U ? 1 : 0))
|
|
1412
1412
|
);
|
|
1413
|
-
let
|
|
1414
|
-
for (let
|
|
1415
|
-
const
|
|
1413
|
+
let p = "";
|
|
1414
|
+
for (let f = 0; f < d; f++) {
|
|
1415
|
+
const y = `${e.key}-${f}`, E = u[y] !== null && u[y] !== void 0, Y = E ? u[y] : null, K = E ? u[y]?.name : e.text, Z = E ? "" : "hidden", J = e.tooltip && !E ? "" : "hidden", ue = E ? "has-file" : "", fe = E && K ? ` data-file-name="${K.replace(/"/g, """)}"` : "";
|
|
1416
1416
|
let de = "";
|
|
1417
1417
|
E && Y ? Y.type?.startsWith("image/") ? de = `<img class="upload-icon-img upload-icon-preview" src="${URL.createObjectURL(Y)}" alt="preview" />` : de = "<i class='iconfont icon-exlwenjian'></i>" : de = "<i class='iconfont icon-shangchuan1'></i>";
|
|
1418
|
-
const be = ` data-batch-key="${e.key}"`, ne = ` data-batch-index="${
|
|
1419
|
-
|
|
1418
|
+
const be = ` data-batch-key="${e.key}"`, ne = ` data-batch-index="${f}"`, ye = `<span contenteditable="false" data-type="upload" data-key="${y}"${be}${ne} class="upload-chip upload-chip-batch"><span class="upload-inner-wrapper ${ue}"><span class="upload-icon">${de}</span><span class="upload-label"${fe}>${K || e.text}</span>${e.tooltip ? `<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi upload-info-icon ${J}" data-upload-key="${y}" data-tooltip="${e.tooltip}" ></i>` : ""}<span class="file-remove-btn ${Z}" title="移除文件">×</span></span></span>`;
|
|
1419
|
+
p += ye;
|
|
1420
1420
|
}
|
|
1421
|
-
e.required ?
|
|
1421
|
+
e.required ? C = `<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">${p}${a}</span></span>` : C = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper rte-upload-batch-chips">${p}${a}</span>`;
|
|
1422
1422
|
} else {
|
|
1423
|
-
const w = u[e.key] !== null && u[e.key] !== void 0,
|
|
1423
|
+
const w = u[e.key] !== null && u[e.key] !== void 0, U = w ? u[e.key] : null, z = w ? u[e.key]?.name : e.text, d = w ? "" : "hidden", p = e.tooltip && !w ? "" : "hidden", f = w ? "has-file" : "", y = w && z ? ` data-file-name="${z.replace(/"/g, """)}"` : "";
|
|
1424
1424
|
let E = "";
|
|
1425
|
-
w &&
|
|
1426
|
-
const Y = (e.text || "").trim(), Z = w && e.showHint === !0 && Y.length >= 12 ? `<span ${
|
|
1427
|
-
e.required ?
|
|
1425
|
+
w && U ? U.type?.startsWith("image/") ? E = `<img class="upload-icon-img upload-icon-preview" src="${URL.createObjectURL(U)}" alt="preview" />` : E = "<i class='iconfont icon-exlwenjian'></i>" : E = "<i class='iconfont icon-shangchuan1'></i>";
|
|
1426
|
+
const Y = (e.text || "").trim(), Z = w && e.showHint === !0 && Y.length >= 12 ? `<span ${x} contenteditable="false" class="exclusion-wrapper upload-hint">${Y}</span>` : "", J = `<span contenteditable="false" data-type="upload" data-key="${e.key}" class="upload-chip"><span class="upload-inner-wrapper ${f}"><span class="upload-icon">${E}</span><span class="upload-label"${y}>${z || e.text}</span>${e.tooltip ? `<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi upload-info-icon ${p}" data-upload-key="${e.key}" data-tooltip="${e.tooltip}" ></i>` : ""}<span class="file-remove-btn ${d}" title="移除文件">×</span></span></span>`;
|
|
1427
|
+
e.required ? C = `<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>${J}${a}</span>${Z}` : C = J + a + Z;
|
|
1428
1428
|
}
|
|
1429
1429
|
} else if (e.type === "select" && e.key) {
|
|
1430
|
-
const
|
|
1431
|
-
e.required ?
|
|
1430
|
+
const W = v[e.key] || e.defaultValue || "", X = encodeURIComponent(JSON.stringify(e.options || [])), a = e.placeholder ? ` data-placeholder="${e.placeholder}"` : "", V = e.exclusionGroup ? ` data-group="${e.exclusionGroup}"` : "", w = e.required ? ' data-required="true"' : "", U = `<div data-type="select" data-key="${e.key}" data-value="${W}" data-options="${X}"${a}${V}${w} class="rte-select-host"></div>`;
|
|
1431
|
+
e.required ? C = `<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>${U}</span>` : C = U;
|
|
1432
1432
|
} else if (e.type === "textarea" && e.key) {
|
|
1433
|
-
const
|
|
1434
|
-
e.required ?
|
|
1433
|
+
const W = v[e.key] || "", X = typeof e.maxHeight == "number" ? e.maxHeight : 252, a = e.placeholder ? ` placeholder="${e.placeholder}"` : "", V = `<textarea data-type="textarea" data-key="${e.key}" class="rte-textarea" style="max-height:${X}px;"${a}>${W}</textarea>`, w = `<div class="rte-textarea-wrapper" data-key="${e.key}">${V}</div>`;
|
|
1434
|
+
e.required ? C = `<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>${w}</span>` : C = w;
|
|
1435
1435
|
} else if (e.type === "richtext" && e.key) {
|
|
1436
|
-
const
|
|
1437
|
-
e.required ?
|
|
1436
|
+
const W = v[e.key] || e.text || "", X = typeof e.minHeight == "number" ? e.minHeight : 40, a = typeof e.maxHeight == "number" ? e.maxHeight : 160, V = Math.max(a, X), w = e.placeholder ? ` data-placeholder="${e.placeholder}"` : "", U = e.expandable !== !1, z = W, d = `<div contenteditable="true" data-type="richtext" data-key="${e.key}" class="rte-richtext"${w} style="min-height:${X}px;max-height:${V}px;overflow:auto;">${z}</div>`, p = U ? `<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>` : "", f = `<div class="rte-richtext-wrapper${U ? " rte-richtext-toggleable" : ""}" data-key="${e.key}">${d}${p}</div>`, y = `<div class="rte-richtext-container" data-key="${e.key}">${f}</div>`;
|
|
1437
|
+
e.required ? C = `<div ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper rte-richtext-required">${y}</div>` : C = y;
|
|
1438
1438
|
} else if (e.type === "report-module" && e.key) {
|
|
1439
|
-
const
|
|
1440
|
-
e.required ?
|
|
1439
|
+
const W = typeof e.moduleIndex == "number" ? e.moduleIndex : 0, X = `${e.key}__module_${W}`, V = Object.prototype.hasOwnProperty.call(v, X) ? v[X] : e.text || "", w = typeof e.minHeight == "number" ? e.minHeight : 80, U = typeof e.maxHeight == "number" ? e.maxHeight : 240, z = Math.max(U, w), d = e.placeholder ? ` data-placeholder="${Oe(e.placeholder)}"` : "", p = V, f = `<div contenteditable="true" data-type="richtext" data-key="${e.key}" data-node-type="report-module" data-module-index="${W}" class="rte-richtext rte-report-module"${d} style="min-height:${w}px;max-height:${z}px;overflow:auto;">${p}</div>`, y = `<div class="rte-richtext-wrapper rte-report-module-wrapper" data-key="${e.key}">${f}</div>`, E = `<div class="rte-richtext-container rte-report-module-container" data-key="${e.key}">${y}</div>`;
|
|
1440
|
+
e.required ? C = `<div ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper rte-richtext-required">${E}</div>` : C = E;
|
|
1441
1441
|
} else if (e.type === "datepicker" && e.key) {
|
|
1442
|
-
const
|
|
1443
|
-
e.required ?
|
|
1442
|
+
const W = v[e.key] || "", X = e.placeholder ? ` data-placeholder="${e.placeholder}"` : "", a = e.limitRange ? ` data-limit-range="${e.limitRange}"` : "", V = e.disableFuture ? ' data-disable-future="true"' : "", w = `<div data-type="datepicker" data-key="${e.key}" data-value="${W}" class="rte-datepicker-host"${X}${a}${V}></div>`;
|
|
1443
|
+
e.required ? C = `<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>${w}</span>` : C = w;
|
|
1444
1444
|
} else if (e.type === "number-input" && e.key) {
|
|
1445
|
-
const
|
|
1445
|
+
const W = v[e.key] || "", X = typeof e.min == "number" ? ` min="${e.min}"` : "", a = typeof e.max == "number" ? ` max="${e.max}"` : "", V = e.placeholder ? ` placeholder="${e.placeholder}"` : "", w = e.exclusionGroup ? ` data-group="${e.exclusionGroup}"` : "", U = ' step="1"', z = W || e.placeholder || "";
|
|
1446
1446
|
let d = 0;
|
|
1447
|
-
for (let
|
|
1448
|
-
const E = z.charCodeAt(
|
|
1447
|
+
for (let y = 0; y < z.length; y++) {
|
|
1448
|
+
const E = z.charCodeAt(y);
|
|
1449
1449
|
E > 19968 || E >= 65280 && E <= 65519 ? d += 16 : d += 8;
|
|
1450
1450
|
}
|
|
1451
|
-
const
|
|
1452
|
-
e.required ?
|
|
1451
|
+
const p = Math.max(60, Math.min(600, d + 32)), f = `<input type="number" data-type="number-input" data-key="${e.key}" class="rte-number-input" value="${W}" style="width: ${p}px;"${X}${a}${U}${V}${w} />`;
|
|
1452
|
+
e.required ? C = `<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>${f}</span>` : C = f;
|
|
1453
1453
|
} else if (e.type === "multi-variable" && e.key) {
|
|
1454
|
-
const
|
|
1454
|
+
const W = e.maxCount || 9, X = D[e.key] || 1, a = Math.min(X, W);
|
|
1455
1455
|
if (e.required) {
|
|
1456
1456
|
const V = `<span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>`, w = e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : "";
|
|
1457
|
-
let
|
|
1457
|
+
let U = "";
|
|
1458
1458
|
for (let z = 0; z < a; z++) {
|
|
1459
|
-
const d = `${e.key}_${z}`,
|
|
1460
|
-
z === 0 ?
|
|
1459
|
+
const d = `${e.key}_${z}`, p = v[d] || "", f = !p, y = f ? "" : p, E = f ? "show-placeholder" : "", Y = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, """)}" data-variable-key="${e.key || ""}"` : "", K = e.tooltip && f ? "" : "hidden", Z = e.exclusionGroup ? ` data-group="${e.exclusionGroup}"` : "", J = `<span contenteditable="true" data-type="variable" data-key="${d}" data-multi-key="${e.key}" data-index="${z}" data-placeholder="${e.placeholder || ""}"${Z}${Y} class="variable-chip ${E}">${y}${e.tooltip ? `<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi variable-info-icon ${K}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g, """)}" ></i>` : ""}</span>`;
|
|
1460
|
+
z === 0 ? U += `<span ${w} class="exclusion-wrapper required-upload-group required-multi-first">${V}${J}</span>` : U += J;
|
|
1461
1461
|
}
|
|
1462
|
-
|
|
1462
|
+
C = U;
|
|
1463
1463
|
} else {
|
|
1464
1464
|
let V = "";
|
|
1465
1465
|
for (let w = 0; w < a; w++) {
|
|
1466
|
-
const
|
|
1467
|
-
V +=
|
|
1466
|
+
const U = `${e.key}_${w}`, z = v[U] || "", d = !z, p = d ? "" : z, f = d ? "show-placeholder" : "", y = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, """)}" data-variable-key="${e.key || ""}"` : "", E = e.tooltip && d ? "" : "hidden", Y = e.exclusionGroup ? ` data-group="${e.exclusionGroup}"` : "", K = `<span contenteditable="true" data-type="variable" data-key="${U}" data-multi-key="${e.key}" data-index="${w}" data-placeholder="${e.placeholder || ""}"${Y}${y} class="variable-chip ${f}">${p}${e.tooltip ? `<i contenteditable="false" style="font-weight: 100;" class="iconfont icon-tishi variable-info-icon ${E}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g, """)}" ></i>` : ""}</span>`;
|
|
1467
|
+
V += K;
|
|
1468
1468
|
}
|
|
1469
|
-
|
|
1469
|
+
C = V;
|
|
1470
1470
|
}
|
|
1471
1471
|
}
|
|
1472
|
-
const Q = q +
|
|
1472
|
+
const Q = q + C + O;
|
|
1473
1473
|
if (e.type === "text" && !e.className && !e.exclusionGroup) {
|
|
1474
|
-
if (
|
|
1474
|
+
if (T(e.text) && $.length > 0) {
|
|
1475
1475
|
const X = $[$.length - 1], a = (e.text ?? "").trim();
|
|
1476
|
-
$[$.length - 1] = `<span class="rte-inline-group">${X}${R(a)}</span>`,
|
|
1476
|
+
$[$.length - 1] = `<span class="rte-inline-group">${X}${R(a)}</span>`, L++;
|
|
1477
1477
|
continue;
|
|
1478
1478
|
}
|
|
1479
|
-
const
|
|
1480
|
-
if (
|
|
1479
|
+
const W = _(e.text);
|
|
1480
|
+
if (W && $.length > 0) {
|
|
1481
1481
|
const X = $[$.length - 1];
|
|
1482
|
-
$[$.length - 1] = `<span class="rte-inline-group">${X}${R(
|
|
1483
|
-
const a =
|
|
1482
|
+
$[$.length - 1] = `<span class="rte-inline-group">${X}${R(W.punct)}</span>`;
|
|
1483
|
+
const a = W.rest;
|
|
1484
1484
|
if (a) {
|
|
1485
1485
|
const V = a.replace(/\n/g, "<br/>");
|
|
1486
1486
|
$.push(`<span data-type="text" contenteditable="false">${V}</span>`);
|
|
1487
1487
|
}
|
|
1488
|
-
|
|
1488
|
+
L++;
|
|
1489
1489
|
continue;
|
|
1490
1490
|
}
|
|
1491
1491
|
}
|
|
1492
|
-
$.push(Q),
|
|
1492
|
+
$.push(Q), L += r ? 2 : 1;
|
|
1493
1493
|
}
|
|
1494
1494
|
t.current && (t.current.innerHTML = $.join(""), setTimeout(() => {
|
|
1495
1495
|
if (!t.current) return;
|
|
@@ -1499,67 +1499,73 @@ function wn(t, g, u, c, v, D = {}, I, P) {
|
|
|
1499
1499
|
});
|
|
1500
1500
|
}, 0));
|
|
1501
1501
|
}
|
|
1502
|
-
function kn(t,
|
|
1503
|
-
const
|
|
1502
|
+
function kn(t, h, u, c, v = {}, D, M, P, N) {
|
|
1503
|
+
const T = ie(() => {
|
|
1504
1504
|
if (!t.current) return;
|
|
1505
|
-
if (
|
|
1505
|
+
if (h.length === 0) {
|
|
1506
1506
|
t.current.innerHTML = "";
|
|
1507
1507
|
return;
|
|
1508
1508
|
}
|
|
1509
|
-
let
|
|
1509
|
+
let _ = {};
|
|
1510
1510
|
const $ = t.current.__tempVariableValues;
|
|
1511
|
-
if ($ ? (
|
|
1511
|
+
if ($ ? (_ = $, setTimeout(() => {
|
|
1512
1512
|
if (t.current) {
|
|
1513
|
-
const
|
|
1514
|
-
|
|
1513
|
+
const L = t.current;
|
|
1514
|
+
L.__tempVariableValues === $ && delete L.__tempVariableValues;
|
|
1515
|
+
}
|
|
1516
|
+
}, 100)) : (t.current.querySelectorAll('[data-type="variable"]').forEach((q) => {
|
|
1517
|
+
const O = q.dataset.key;
|
|
1518
|
+
if (O) {
|
|
1519
|
+
const C = q.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
1520
|
+
C && (q.getAttribute("data-node-type") === "report-url" ? _[`${O}__url`] = C : _[O] = C);
|
|
1515
1521
|
}
|
|
1516
|
-
},
|
|
1517
|
-
const
|
|
1518
|
-
if (
|
|
1519
|
-
const
|
|
1520
|
-
|
|
1522
|
+
}), t.current.querySelectorAll('[data-type="select"]').forEach((q) => {
|
|
1523
|
+
const O = q.dataset.key;
|
|
1524
|
+
if (O) {
|
|
1525
|
+
const C = (q.getAttribute("data-value") || "").trim();
|
|
1526
|
+
C && (_[O] = C);
|
|
1521
1527
|
}
|
|
1522
|
-
}), t.current.querySelectorAll('[data-type="
|
|
1523
|
-
const
|
|
1524
|
-
if (
|
|
1525
|
-
const
|
|
1526
|
-
|
|
1528
|
+
}), t.current.querySelectorAll('[data-type="textarea"]').forEach((q) => {
|
|
1529
|
+
const O = q.dataset.key;
|
|
1530
|
+
if (O) {
|
|
1531
|
+
const C = q.value.replace(/[\u200B]/g, "").trim();
|
|
1532
|
+
C && (_[O] = C);
|
|
1527
1533
|
}
|
|
1528
|
-
}), t.current.querySelectorAll('[data-type="
|
|
1529
|
-
const
|
|
1530
|
-
if (
|
|
1531
|
-
const
|
|
1532
|
-
|
|
1534
|
+
}), t.current.querySelectorAll('[data-type="richtext"]').forEach((q) => {
|
|
1535
|
+
const O = q.dataset.key;
|
|
1536
|
+
if (O) {
|
|
1537
|
+
const C = q.getAttribute("data-node-type") || "", Q = C === "report-module" ? (q.innerHTML || "").replace(/[\u200B]/g, "").trim() : (q.textContent || "").replace(/[\u200B]/g, "").trim();
|
|
1538
|
+
if (C === "report-module") {
|
|
1539
|
+
const W = Number.parseInt(q.getAttribute("data-module-index") || "0", 10);
|
|
1540
|
+
_[`${O}__module_${Number.isFinite(W) ? W : 0}`] = Q;
|
|
1541
|
+
} else Q && (_[O] = Q);
|
|
1533
1542
|
}
|
|
1534
|
-
}), t.current.querySelectorAll('[data-type="
|
|
1535
|
-
const
|
|
1536
|
-
if (
|
|
1537
|
-
const
|
|
1538
|
-
|
|
1539
|
-
const Q = Number.parseInt(p.getAttribute("data-module-index") || "0", 10);
|
|
1540
|
-
L[`${q}__module_${Number.isFinite(Q) ? Q : 0}`] = M;
|
|
1541
|
-
} else M && (L[q] = M);
|
|
1543
|
+
}), t.current.querySelectorAll('[data-type="datepicker"]').forEach((q) => {
|
|
1544
|
+
const O = q.dataset.key;
|
|
1545
|
+
if (O) {
|
|
1546
|
+
const C = (q.getAttribute("data-value") || "").trim();
|
|
1547
|
+
C && (_[O] = C);
|
|
1542
1548
|
}
|
|
1543
|
-
}), t.current.querySelectorAll('[data-type="
|
|
1544
|
-
const
|
|
1545
|
-
if (
|
|
1546
|
-
const
|
|
1547
|
-
|
|
1549
|
+
}), t.current.querySelectorAll('[data-type="number-input"]').forEach((q) => {
|
|
1550
|
+
const O = q.dataset.key;
|
|
1551
|
+
if (O) {
|
|
1552
|
+
const C = (q.value || "").trim();
|
|
1553
|
+
C && (_[O] = C);
|
|
1548
1554
|
}
|
|
1549
1555
|
})), wn(
|
|
1550
1556
|
t,
|
|
1551
|
-
|
|
1557
|
+
h,
|
|
1552
1558
|
u,
|
|
1553
1559
|
c,
|
|
1554
|
-
|
|
1560
|
+
_,
|
|
1555
1561
|
v,
|
|
1556
1562
|
P
|
|
1557
1563
|
), D?.current) {
|
|
1558
|
-
const { key:
|
|
1564
|
+
const { key: L, offset: e } = D.current;
|
|
1559
1565
|
setTimeout(() => {
|
|
1560
1566
|
if (!t.current) return;
|
|
1561
1567
|
const n = t.current.querySelector(
|
|
1562
|
-
`[data-type="variable"][data-key="${
|
|
1568
|
+
`[data-type="variable"][data-key="${L}"]`
|
|
1563
1569
|
);
|
|
1564
1570
|
if (n) {
|
|
1565
1571
|
try {
|
|
@@ -1568,23 +1574,23 @@ function kn(t, g, u, c, v = {}, D, I, P, T) {
|
|
|
1568
1574
|
NodeFilter.SHOW_TEXT,
|
|
1569
1575
|
null
|
|
1570
1576
|
);
|
|
1571
|
-
let
|
|
1577
|
+
let x = 0, q = null, O = 0;
|
|
1572
1578
|
for (; i.nextNode(); ) {
|
|
1573
|
-
const
|
|
1574
|
-
if (
|
|
1575
|
-
q =
|
|
1579
|
+
const C = i.currentNode, Q = C.textContent?.length || 0;
|
|
1580
|
+
if (x + Q >= e) {
|
|
1581
|
+
q = C, O = e - x;
|
|
1576
1582
|
break;
|
|
1577
1583
|
}
|
|
1578
|
-
|
|
1584
|
+
x += Q;
|
|
1579
1585
|
}
|
|
1580
1586
|
if (q) {
|
|
1581
|
-
r.setStart(q, Math.min(
|
|
1582
|
-
const
|
|
1583
|
-
|
|
1587
|
+
r.setStart(q, Math.min(O, q.textContent?.length || 0)), r.collapse(!0);
|
|
1588
|
+
const C = window.getSelection();
|
|
1589
|
+
C && (C.removeAllRanges(), C.addRange(r), n.focus());
|
|
1584
1590
|
} else {
|
|
1585
1591
|
r.selectNodeContents(n), r.collapse(!1);
|
|
1586
|
-
const
|
|
1587
|
-
|
|
1592
|
+
const C = window.getSelection();
|
|
1593
|
+
C && (C.removeAllRanges(), C.addRange(r), n.focus());
|
|
1588
1594
|
}
|
|
1589
1595
|
} catch {
|
|
1590
1596
|
const r = document.createRange();
|
|
@@ -1596,119 +1602,119 @@ function kn(t, g, u, c, v = {}, D, I, P, T) {
|
|
|
1596
1602
|
}
|
|
1597
1603
|
}, 0);
|
|
1598
1604
|
}
|
|
1599
|
-
}, [
|
|
1605
|
+
}, [h, u, c, t, v, D, M, P, N]);
|
|
1600
1606
|
pe(() => {
|
|
1601
|
-
|
|
1602
|
-
}, [
|
|
1607
|
+
T();
|
|
1608
|
+
}, [T]);
|
|
1603
1609
|
}
|
|
1604
|
-
function $n(t,
|
|
1610
|
+
function $n(t, h, u, c) {
|
|
1605
1611
|
pe(() => {
|
|
1606
1612
|
const v = t.current;
|
|
1607
1613
|
if (!v) return;
|
|
1608
|
-
const D = (
|
|
1609
|
-
const
|
|
1610
|
-
if (
|
|
1611
|
-
const R =
|
|
1614
|
+
const D = (N) => N.type?.startsWith("image/") ? !0 : /\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(N.name || ""), M = (N) => {
|
|
1615
|
+
const T = N.target?.closest(".upload-info-icon");
|
|
1616
|
+
if (T && T.classList.contains("upload-info-icon")) {
|
|
1617
|
+
const R = T.dataset.uploadKey;
|
|
1612
1618
|
if (R) {
|
|
1613
|
-
const $ =
|
|
1614
|
-
c($ ? { key: R, anchorEl: $, type: "upload" } : { key: R, anchorEl:
|
|
1619
|
+
const $ = T.closest('[data-type="upload"]');
|
|
1620
|
+
c($ ? { key: R, anchorEl: $, type: "upload" } : { key: R, anchorEl: T, type: "upload" });
|
|
1615
1621
|
}
|
|
1616
1622
|
return;
|
|
1617
1623
|
}
|
|
1618
|
-
const
|
|
1619
|
-
if (
|
|
1620
|
-
const R =
|
|
1624
|
+
const _ = N.target?.closest('[data-type="upload"]');
|
|
1625
|
+
if (_) {
|
|
1626
|
+
const R = _.dataset.key;
|
|
1621
1627
|
if (R) {
|
|
1622
1628
|
const $ = u[R];
|
|
1623
|
-
$ && D($) && c({ key: R, anchorEl:
|
|
1629
|
+
$ && D($) && c({ key: R, anchorEl: _, type: "upload-preview" });
|
|
1624
1630
|
}
|
|
1625
1631
|
}
|
|
1626
|
-
}, P = (
|
|
1627
|
-
const
|
|
1628
|
-
if (
|
|
1629
|
-
const $ =
|
|
1630
|
-
if (
|
|
1632
|
+
}, P = (N) => {
|
|
1633
|
+
const T = N.target?.closest(".upload-info-icon"), _ = N.relatedTarget;
|
|
1634
|
+
if (T && T.classList.contains("upload-info-icon")) {
|
|
1635
|
+
const $ = T.closest('[data-type="upload"]');
|
|
1636
|
+
if (_ && $ && $.contains(_))
|
|
1631
1637
|
return;
|
|
1632
|
-
if (!
|
|
1638
|
+
if (!_ || !v.contains(_))
|
|
1633
1639
|
c(null);
|
|
1634
1640
|
else {
|
|
1635
|
-
const
|
|
1636
|
-
(!
|
|
1641
|
+
const L = _.closest('[data-type="upload"]');
|
|
1642
|
+
(!L || L !== $) && c(null);
|
|
1637
1643
|
}
|
|
1638
1644
|
return;
|
|
1639
1645
|
}
|
|
1640
|
-
const R =
|
|
1646
|
+
const R = N.target?.closest('[data-type="upload"]');
|
|
1641
1647
|
if (R) {
|
|
1642
|
-
const $ =
|
|
1648
|
+
const $ = _;
|
|
1643
1649
|
if ($ && R.contains($))
|
|
1644
1650
|
return;
|
|
1645
1651
|
c(null);
|
|
1646
1652
|
}
|
|
1647
1653
|
};
|
|
1648
|
-
return v.addEventListener("mouseover",
|
|
1649
|
-
v.removeEventListener("mouseover",
|
|
1654
|
+
return v.addEventListener("mouseover", M, !0), v.addEventListener("mouseout", P, !0), () => {
|
|
1655
|
+
v.removeEventListener("mouseover", M, !0), v.removeEventListener("mouseout", P, !0);
|
|
1650
1656
|
};
|
|
1651
|
-
}, [
|
|
1657
|
+
}, [h, u, t, c]);
|
|
1652
1658
|
}
|
|
1653
|
-
function En(t,
|
|
1659
|
+
function En(t, h, u, c) {
|
|
1654
1660
|
pe(() => {
|
|
1655
1661
|
if (!t.current) return;
|
|
1656
|
-
const v = (
|
|
1662
|
+
const v = (N) => {
|
|
1657
1663
|
if (c === "hideTagClose")
|
|
1658
1664
|
return;
|
|
1659
|
-
const
|
|
1660
|
-
|
|
1665
|
+
const T = N.currentTarget, _ = T.dataset.tooltip, R = T.dataset.tagKey || "";
|
|
1666
|
+
_ && u({ key: R, anchorEl: T, type: "tag" });
|
|
1661
1667
|
}, D = () => {
|
|
1662
1668
|
u(null);
|
|
1663
1669
|
};
|
|
1664
|
-
let
|
|
1670
|
+
let M;
|
|
1665
1671
|
const P = () => {
|
|
1666
1672
|
if (!t.current) return;
|
|
1667
1673
|
t.current.querySelectorAll(
|
|
1668
1674
|
".tag-node[data-tooltip]"
|
|
1669
|
-
).forEach((
|
|
1670
|
-
|
|
1675
|
+
).forEach((T) => {
|
|
1676
|
+
T.addEventListener("mouseenter", v), T.addEventListener("mouseleave", D);
|
|
1671
1677
|
});
|
|
1672
1678
|
};
|
|
1673
|
-
return
|
|
1674
|
-
|
|
1679
|
+
return M = requestAnimationFrame(() => {
|
|
1680
|
+
M = requestAnimationFrame(P);
|
|
1675
1681
|
}), () => {
|
|
1676
|
-
cancelAnimationFrame(
|
|
1682
|
+
cancelAnimationFrame(M), t.current && t.current.querySelectorAll(
|
|
1677
1683
|
".tag-node[data-tooltip]"
|
|
1678
|
-
).forEach((
|
|
1679
|
-
|
|
1684
|
+
).forEach((T) => {
|
|
1685
|
+
T.removeEventListener("mouseenter", v), T.removeEventListener("mouseleave", D);
|
|
1680
1686
|
});
|
|
1681
1687
|
};
|
|
1682
|
-
}, [
|
|
1688
|
+
}, [h, t, u, c]);
|
|
1683
1689
|
}
|
|
1684
|
-
function Cn(t,
|
|
1690
|
+
function Cn(t, h, u) {
|
|
1685
1691
|
pe(() => {
|
|
1686
1692
|
const c = t.current;
|
|
1687
1693
|
if (!c) return;
|
|
1688
|
-
const v = (
|
|
1689
|
-
const P =
|
|
1694
|
+
const v = (M) => {
|
|
1695
|
+
const P = M.target?.closest(".variable-info-icon");
|
|
1690
1696
|
if (P && P.classList.contains("variable-info-icon")) {
|
|
1691
|
-
const
|
|
1692
|
-
|
|
1697
|
+
const T = P.dataset.variableKey;
|
|
1698
|
+
T && u({ key: T, anchorEl: P, type: "variable" });
|
|
1693
1699
|
return;
|
|
1694
1700
|
}
|
|
1695
|
-
const
|
|
1701
|
+
const N = M.target?.closest(
|
|
1696
1702
|
'[data-type="variable"][data-node-type="report-url"][data-tooltip]'
|
|
1697
1703
|
);
|
|
1698
|
-
if (
|
|
1699
|
-
const
|
|
1700
|
-
|
|
1704
|
+
if (N) {
|
|
1705
|
+
const T = N.dataset.key;
|
|
1706
|
+
T && u({ key: T, anchorEl: N, type: "variable" });
|
|
1701
1707
|
}
|
|
1702
|
-
}, D = (
|
|
1703
|
-
const P =
|
|
1708
|
+
}, D = (M) => {
|
|
1709
|
+
const P = M.target, N = M.relatedTarget, T = P?.closest?.(".variable-info-icon"), _ = P?.closest?.(
|
|
1704
1710
|
'[data-type="variable"][data-node-type="report-url"][data-tooltip]'
|
|
1705
1711
|
);
|
|
1706
|
-
if (
|
|
1707
|
-
if (!
|
|
1712
|
+
if (T || _) {
|
|
1713
|
+
if (!N || !c.contains(N)) {
|
|
1708
1714
|
u(null);
|
|
1709
1715
|
return;
|
|
1710
1716
|
}
|
|
1711
|
-
const R = !!
|
|
1717
|
+
const R = !!N.closest?.(".variable-info-icon"), $ = !!N.closest?.(
|
|
1712
1718
|
'[data-type="variable"][data-node-type="report-url"][data-tooltip]'
|
|
1713
1719
|
);
|
|
1714
1720
|
!R && !$ && u(null);
|
|
@@ -1717,101 +1723,101 @@ function Cn(t, g, u) {
|
|
|
1717
1723
|
return c.addEventListener("mouseover", v, !0), c.addEventListener("mouseout", D, !0), () => {
|
|
1718
1724
|
c.removeEventListener("mouseover", v, !0), c.removeEventListener("mouseout", D, !0);
|
|
1719
1725
|
};
|
|
1720
|
-
}, [
|
|
1726
|
+
}, [h, t, u]);
|
|
1721
1727
|
}
|
|
1722
|
-
function Sn(t,
|
|
1728
|
+
function Sn(t, h, u, c) {
|
|
1723
1729
|
pe(() => {
|
|
1724
1730
|
if (!t.current) return;
|
|
1725
|
-
const v = (
|
|
1726
|
-
const
|
|
1731
|
+
const v = (T) => T.type?.startsWith("image/") ? !0 : /\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(T.name || ""), D = (T) => {
|
|
1732
|
+
const _ = T.currentTarget, R = _.dataset.fileName, $ = _.closest('[data-type="upload"]'), L = $?.dataset.key || "", e = L ? u[L] : null;
|
|
1727
1733
|
if (e && v(e)) {
|
|
1728
|
-
c({ key:
|
|
1734
|
+
c({ key: L, anchorEl: $ || _, type: "upload-preview" });
|
|
1729
1735
|
return;
|
|
1730
1736
|
}
|
|
1731
|
-
R && c({ key:
|
|
1732
|
-
},
|
|
1737
|
+
R && c({ key: L, anchorEl: $ || _, type: "upload-label" });
|
|
1738
|
+
}, M = () => {
|
|
1733
1739
|
c(null);
|
|
1734
1740
|
};
|
|
1735
1741
|
let P;
|
|
1736
|
-
const
|
|
1742
|
+
const N = () => {
|
|
1737
1743
|
if (!t.current) return;
|
|
1738
1744
|
t.current.querySelectorAll(
|
|
1739
1745
|
".upload-label[data-file-name]"
|
|
1740
|
-
).forEach((
|
|
1741
|
-
|
|
1746
|
+
).forEach((_) => {
|
|
1747
|
+
_.addEventListener("mouseenter", D), _.addEventListener("mouseleave", M);
|
|
1742
1748
|
});
|
|
1743
1749
|
};
|
|
1744
1750
|
return P = requestAnimationFrame(() => {
|
|
1745
|
-
P = requestAnimationFrame(
|
|
1751
|
+
P = requestAnimationFrame(N);
|
|
1746
1752
|
}), () => {
|
|
1747
1753
|
cancelAnimationFrame(P), t.current && t.current.querySelectorAll(
|
|
1748
1754
|
".upload-label[data-file-name]"
|
|
1749
|
-
).forEach((
|
|
1750
|
-
|
|
1755
|
+
).forEach((_) => {
|
|
1756
|
+
_.removeEventListener("mouseenter", D), _.removeEventListener("mouseleave", M);
|
|
1751
1757
|
});
|
|
1752
1758
|
};
|
|
1753
|
-
}, [
|
|
1759
|
+
}, [h, u, t, c]);
|
|
1754
1760
|
}
|
|
1755
|
-
function Tn(t,
|
|
1761
|
+
function Tn(t, h, u, c) {
|
|
1756
1762
|
pe(() => {
|
|
1757
1763
|
const v = setTimeout(() => {
|
|
1758
|
-
et(t,
|
|
1764
|
+
et(t, h, u), tt(t, h, u, c);
|
|
1759
1765
|
}, 0);
|
|
1760
1766
|
return () => clearTimeout(v);
|
|
1761
|
-
}, [u,
|
|
1767
|
+
}, [u, h, t, c]);
|
|
1762
1768
|
}
|
|
1763
|
-
function qn(t,
|
|
1769
|
+
function qn(t, h) {
|
|
1764
1770
|
const u = ae(0), c = ae(0);
|
|
1765
1771
|
pe(() => {
|
|
1766
1772
|
if (!t.current) return;
|
|
1767
1773
|
let v = !1, D = 0;
|
|
1768
|
-
const
|
|
1769
|
-
v = !0,
|
|
1770
|
-
},
|
|
1774
|
+
const M = (x) => x instanceof HTMLElement ? !!(x.closest(".rte-datepicker-wrapper") || x.closest(".rte-datepicker-host") || x.closest(".ant-picker") || x.closest(".ant-picker-dropdown")) : !1, P = (x) => x instanceof HTMLElement ? !!(x.closest(".rte-select-wrapper") || x.closest(".rte-select-host") || x.closest(".ant-select") || x.closest(".ant-select-dropdown")) : !1, N = (x) => {
|
|
1775
|
+
v = !0, M(x.target) && (u.current = Date.now(), console.log("[SelectionCtrl] mousedown on datepicker target")), P(x.target) && (c.current = Date.now(), console.log("[SelectionCtrl] mousedown on select target"));
|
|
1776
|
+
}, T = () => {
|
|
1771
1777
|
v = !1, D = Date.now();
|
|
1772
1778
|
};
|
|
1773
|
-
let
|
|
1779
|
+
let _ = !1, R = 0;
|
|
1774
1780
|
const $ = () => {
|
|
1775
|
-
|
|
1776
|
-
},
|
|
1777
|
-
|
|
1781
|
+
_ = !0;
|
|
1782
|
+
}, L = () => {
|
|
1783
|
+
_ = !1, R = Date.now();
|
|
1778
1784
|
}, e = () => {
|
|
1779
1785
|
R = Date.now();
|
|
1780
|
-
}, n = (
|
|
1781
|
-
|
|
1786
|
+
}, n = (x) => {
|
|
1787
|
+
M(x.target) && (u.current = Date.now(), console.log("[SelectionCtrl] focusin datepicker target")), P(x.target) && (c.current = Date.now(), console.log("[SelectionCtrl] focusin select target"));
|
|
1782
1788
|
}, r = () => {
|
|
1783
1789
|
if (Date.now() - u.current < 800 || Date.now() - c.current < 800) {
|
|
1784
1790
|
console.log("[SelectionCtrl] skip selectionchange due to recent picker/select interaction");
|
|
1785
1791
|
return;
|
|
1786
1792
|
}
|
|
1787
|
-
const
|
|
1788
|
-
if (
|
|
1789
|
-
|
|
1793
|
+
const x = document.activeElement;
|
|
1794
|
+
if (x && (x.closest(".rte-datepicker-wrapper") || x.closest(".rte-datepicker-host") || x.closest(".ant-picker-dropdown") || // Antd dropdown
|
|
1795
|
+
x.tagName === "INPUT" && x.closest(".ant-picker") || x.closest(".rte-select-wrapper") || x.closest(".rte-select-host") || x.closest(".ant-select") || x.closest(".ant-select-dropdown"))) {
|
|
1790
1796
|
console.log("[SelectionCtrl] activeElement is picker/select; skip");
|
|
1791
1797
|
return;
|
|
1792
1798
|
}
|
|
1793
1799
|
if (!t.current) return;
|
|
1794
1800
|
const q = window.getSelection();
|
|
1795
|
-
if (!q || q.rangeCount === 0 ||
|
|
1801
|
+
if (!q || q.rangeCount === 0 || h.current || v || _ || Date.now() - R < 500)
|
|
1796
1802
|
return;
|
|
1797
|
-
const
|
|
1798
|
-
if (!
|
|
1799
|
-
return t.current.contains(
|
|
1800
|
-
const
|
|
1801
|
-
if (!
|
|
1803
|
+
const O = q.getRangeAt(0);
|
|
1804
|
+
if (!O.collapsed)
|
|
1805
|
+
return t.current.contains(O.commonAncestorContainer), void 0;
|
|
1806
|
+
const C = q.anchorNode;
|
|
1807
|
+
if (!C || !t.current.contains(C))
|
|
1802
1808
|
return;
|
|
1803
|
-
let Q = !1,
|
|
1804
|
-
if (
|
|
1805
|
-
const a =
|
|
1806
|
-
(a.closest('[data-type="datepicker"]') || a.closest(".rte-datepicker-wrapper") || a.closest(".rte-datepicker-host")) && (Q = !0), (a.closest('[data-type="select"]') || a.closest(".rte-select-wrapper") || a.closest(".rte-select-host")) && (
|
|
1807
|
-
} else if (
|
|
1808
|
-
const a =
|
|
1809
|
-
(a.closest('[data-type="datepicker"]') || a.closest(".rte-datepicker-wrapper") || a.closest(".rte-datepicker-host")) && (Q = !0), (a.closest('[data-type="select"]') || a.closest(".rte-select-wrapper") || a.closest(".rte-select-host")) && (
|
|
1809
|
+
let Q = !1, W = !1;
|
|
1810
|
+
if (C.nodeType === Node.ELEMENT_NODE) {
|
|
1811
|
+
const a = C;
|
|
1812
|
+
(a.closest('[data-type="datepicker"]') || a.closest(".rte-datepicker-wrapper") || a.closest(".rte-datepicker-host")) && (Q = !0), (a.closest('[data-type="select"]') || a.closest(".rte-select-wrapper") || a.closest(".rte-select-host")) && (W = !0);
|
|
1813
|
+
} else if (C.parentElement) {
|
|
1814
|
+
const a = C.parentElement;
|
|
1815
|
+
(a.closest('[data-type="datepicker"]') || a.closest(".rte-datepicker-wrapper") || a.closest(".rte-datepicker-host")) && (Q = !0), (a.closest('[data-type="select"]') || a.closest(".rte-select-wrapper") || a.closest(".rte-select-host")) && (W = !0);
|
|
1810
1816
|
}
|
|
1811
|
-
if (Q ||
|
|
1817
|
+
if (Q || W)
|
|
1812
1818
|
return;
|
|
1813
1819
|
let X = null;
|
|
1814
|
-
if (
|
|
1820
|
+
if (C.nodeType === Node.ELEMENT_NODE ? X = C.closest('[data-type="variable"]') : C.nodeType === Node.TEXT_NODE && C.parentElement && (X = C.parentElement.closest('[data-type="variable"]')), !X) {
|
|
1815
1821
|
if (Date.now() - D > 500)
|
|
1816
1822
|
return;
|
|
1817
1823
|
const a = t.current.querySelectorAll('[data-type="variable"]');
|
|
@@ -1831,165 +1837,165 @@ function qn(t, g) {
|
|
|
1831
1837
|
q.removeAllRanges();
|
|
1832
1838
|
}
|
|
1833
1839
|
}, i = t.current;
|
|
1834
|
-
return i && (i.addEventListener("compositionstart", $), i.addEventListener("compositionend",
|
|
1835
|
-
const
|
|
1836
|
-
|
|
1840
|
+
return i && (i.addEventListener("compositionstart", $), i.addEventListener("compositionend", L), i.addEventListener("input", e)), document.addEventListener("mousedown", N), document.addEventListener("mouseup", T), document.addEventListener("focusin", n), document.addEventListener("selectionchange", r), () => {
|
|
1841
|
+
const x = t.current;
|
|
1842
|
+
x && (x.removeEventListener("compositionstart", $), x.removeEventListener("compositionend", L), x.removeEventListener("input", e)), document.removeEventListener("mousedown", N), document.removeEventListener("mouseup", T), document.removeEventListener("focusin", n), document.removeEventListener("selectionchange", r);
|
|
1837
1843
|
};
|
|
1838
|
-
}, [t,
|
|
1844
|
+
}, [t, h]);
|
|
1839
1845
|
}
|
|
1840
1846
|
function Nn(t) {
|
|
1841
1847
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
1842
1848
|
}
|
|
1843
1849
|
var Ge = { exports: {} }, An = Ge.exports, xt;
|
|
1844
1850
|
function Et() {
|
|
1845
|
-
return xt || (xt = 1, function(t,
|
|
1851
|
+
return xt || (xt = 1, function(t, h) {
|
|
1846
1852
|
(function(u, c) {
|
|
1847
1853
|
t.exports = c();
|
|
1848
1854
|
})(An, function() {
|
|
1849
|
-
var u = 1e3, c = 6e4, v = 36e5, D = "millisecond",
|
|
1850
|
-
var
|
|
1851
|
-
return "[" + d + (
|
|
1852
|
-
} }, q = function(d,
|
|
1853
|
-
var
|
|
1854
|
-
return !
|
|
1855
|
-
},
|
|
1856
|
-
var
|
|
1857
|
-
return (
|
|
1858
|
-
}, m: function d(
|
|
1859
|
-
if (
|
|
1860
|
-
var
|
|
1861
|
-
return +(-(
|
|
1855
|
+
var u = 1e3, c = 6e4, v = 36e5, D = "millisecond", M = "second", P = "minute", N = "hour", T = "day", _ = "week", R = "month", $ = "quarter", L = "year", e = "date", n = "Invalid Date", r = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, i = /\[([^\]]+)]|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, x = { 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) {
|
|
1856
|
+
var p = ["th", "st", "nd", "rd"], f = d % 100;
|
|
1857
|
+
return "[" + d + (p[(f - 20) % 10] || p[f] || p[0]) + "]";
|
|
1858
|
+
} }, q = function(d, p, f) {
|
|
1859
|
+
var y = String(d);
|
|
1860
|
+
return !y || y.length >= p ? d : "" + Array(p + 1 - y.length).join(f) + d;
|
|
1861
|
+
}, O = { s: q, z: function(d) {
|
|
1862
|
+
var p = -d.utcOffset(), f = Math.abs(p), y = Math.floor(f / 60), E = f % 60;
|
|
1863
|
+
return (p <= 0 ? "+" : "-") + q(y, 2, "0") + ":" + q(E, 2, "0");
|
|
1864
|
+
}, m: function d(p, f) {
|
|
1865
|
+
if (p.date() < f.date()) return -d(f, p);
|
|
1866
|
+
var y = 12 * (f.year() - p.year()) + (f.month() - p.month()), E = p.clone().add(y, R), Y = f - E < 0, K = p.clone().add(y + (Y ? -1 : 1), R);
|
|
1867
|
+
return +(-(y + (f - E) / (Y ? E - K : K - E)) || 0);
|
|
1862
1868
|
}, a: function(d) {
|
|
1863
1869
|
return d < 0 ? Math.ceil(d) || 0 : Math.floor(d);
|
|
1864
1870
|
}, p: function(d) {
|
|
1865
|
-
return { M: R, y:
|
|
1871
|
+
return { M: R, y: L, w: _, d: T, D: e, h: N, m: P, s: M, ms: D, Q: $ }[d] || String(d || "").toLowerCase().replace(/s$/, "");
|
|
1866
1872
|
}, u: function(d) {
|
|
1867
1873
|
return d === void 0;
|
|
1868
|
-
} },
|
|
1869
|
-
Q[
|
|
1870
|
-
var
|
|
1871
|
-
return d instanceof
|
|
1872
|
-
}, a = function d(
|
|
1874
|
+
} }, C = "en", Q = {};
|
|
1875
|
+
Q[C] = x;
|
|
1876
|
+
var W = "$isDayjsObject", X = function(d) {
|
|
1877
|
+
return d instanceof U || !(!d || !d[W]);
|
|
1878
|
+
}, a = function d(p, f, y) {
|
|
1873
1879
|
var E;
|
|
1874
|
-
if (!
|
|
1875
|
-
if (typeof
|
|
1876
|
-
var Y =
|
|
1877
|
-
Q[Y] && (E = Y),
|
|
1878
|
-
var
|
|
1879
|
-
if (!E &&
|
|
1880
|
+
if (!p) return C;
|
|
1881
|
+
if (typeof p == "string") {
|
|
1882
|
+
var Y = p.toLowerCase();
|
|
1883
|
+
Q[Y] && (E = Y), f && (Q[Y] = f, E = Y);
|
|
1884
|
+
var K = p.split("-");
|
|
1885
|
+
if (!E && K.length > 1) return d(K[0]);
|
|
1880
1886
|
} else {
|
|
1881
|
-
var Z =
|
|
1882
|
-
Q[Z] =
|
|
1887
|
+
var Z = p.name;
|
|
1888
|
+
Q[Z] = p, E = Z;
|
|
1883
1889
|
}
|
|
1884
|
-
return !
|
|
1885
|
-
}, V = function(d,
|
|
1890
|
+
return !y && E && (C = E), E || !y && C;
|
|
1891
|
+
}, V = function(d, p) {
|
|
1886
1892
|
if (X(d)) return d.clone();
|
|
1887
|
-
var
|
|
1888
|
-
return
|
|
1889
|
-
}, w =
|
|
1890
|
-
w.l = a, w.i = X, w.w = function(d,
|
|
1891
|
-
return V(d, { locale:
|
|
1893
|
+
var f = typeof p == "object" ? p : {};
|
|
1894
|
+
return f.date = d, f.args = arguments, new U(f);
|
|
1895
|
+
}, w = O;
|
|
1896
|
+
w.l = a, w.i = X, w.w = function(d, p) {
|
|
1897
|
+
return V(d, { locale: p.$L, utc: p.$u, x: p.$x, $offset: p.$offset });
|
|
1892
1898
|
};
|
|
1893
|
-
var
|
|
1894
|
-
function d(
|
|
1895
|
-
this.$L = a(
|
|
1899
|
+
var U = function() {
|
|
1900
|
+
function d(f) {
|
|
1901
|
+
this.$L = a(f.locale, null, !0), this.parse(f), this.$x = this.$x || f.x || {}, this[W] = !0;
|
|
1896
1902
|
}
|
|
1897
|
-
var
|
|
1898
|
-
return
|
|
1899
|
-
this.$d = function(
|
|
1900
|
-
var E =
|
|
1903
|
+
var p = d.prototype;
|
|
1904
|
+
return p.parse = function(f) {
|
|
1905
|
+
this.$d = function(y) {
|
|
1906
|
+
var E = y.date, Y = y.utc;
|
|
1901
1907
|
if (E === null) return /* @__PURE__ */ new Date(NaN);
|
|
1902
1908
|
if (w.u(E)) return /* @__PURE__ */ new Date();
|
|
1903
1909
|
if (E instanceof Date) return new Date(E);
|
|
1904
1910
|
if (typeof E == "string" && !/Z$/i.test(E)) {
|
|
1905
|
-
var
|
|
1906
|
-
if (
|
|
1907
|
-
var Z =
|
|
1908
|
-
return Y ? new Date(Date.UTC(
|
|
1911
|
+
var K = E.match(r);
|
|
1912
|
+
if (K) {
|
|
1913
|
+
var Z = K[2] - 1 || 0, J = (K[7] || "0").substring(0, 3);
|
|
1914
|
+
return Y ? new Date(Date.UTC(K[1], Z, K[3] || 1, K[4] || 0, K[5] || 0, K[6] || 0, J)) : new Date(K[1], Z, K[3] || 1, K[4] || 0, K[5] || 0, K[6] || 0, J);
|
|
1909
1915
|
}
|
|
1910
1916
|
}
|
|
1911
1917
|
return new Date(E);
|
|
1912
|
-
}(
|
|
1913
|
-
},
|
|
1914
|
-
var
|
|
1915
|
-
this.$y =
|
|
1916
|
-
},
|
|
1918
|
+
}(f), this.init();
|
|
1919
|
+
}, p.init = function() {
|
|
1920
|
+
var f = this.$d;
|
|
1921
|
+
this.$y = f.getFullYear(), this.$M = f.getMonth(), this.$D = f.getDate(), this.$W = f.getDay(), this.$H = f.getHours(), this.$m = f.getMinutes(), this.$s = f.getSeconds(), this.$ms = f.getMilliseconds();
|
|
1922
|
+
}, p.$utils = function() {
|
|
1917
1923
|
return w;
|
|
1918
|
-
},
|
|
1924
|
+
}, p.isValid = function() {
|
|
1919
1925
|
return this.$d.toString() !== n;
|
|
1920
|
-
},
|
|
1921
|
-
var E = V(
|
|
1922
|
-
return this.startOf(
|
|
1923
|
-
},
|
|
1924
|
-
return V(
|
|
1925
|
-
},
|
|
1926
|
-
return this.endOf(
|
|
1927
|
-
},
|
|
1928
|
-
return w.u(
|
|
1929
|
-
},
|
|
1926
|
+
}, p.isSame = function(f, y) {
|
|
1927
|
+
var E = V(f);
|
|
1928
|
+
return this.startOf(y) <= E && E <= this.endOf(y);
|
|
1929
|
+
}, p.isAfter = function(f, y) {
|
|
1930
|
+
return V(f) < this.startOf(y);
|
|
1931
|
+
}, p.isBefore = function(f, y) {
|
|
1932
|
+
return this.endOf(y) < V(f);
|
|
1933
|
+
}, p.$g = function(f, y, E) {
|
|
1934
|
+
return w.u(f) ? this[y] : this.set(E, f);
|
|
1935
|
+
}, p.unix = function() {
|
|
1930
1936
|
return Math.floor(this.valueOf() / 1e3);
|
|
1931
|
-
},
|
|
1937
|
+
}, p.valueOf = function() {
|
|
1932
1938
|
return this.$d.getTime();
|
|
1933
|
-
},
|
|
1934
|
-
var E = this, Y = !!w.u(
|
|
1939
|
+
}, p.startOf = function(f, y) {
|
|
1940
|
+
var E = this, Y = !!w.u(y) || y, K = w.p(f), Z = function(ge, he) {
|
|
1935
1941
|
var ke = w.w(E.$u ? Date.UTC(E.$y, he, ge) : new Date(E.$y, he, ge), E);
|
|
1936
|
-
return Y ? ke : ke.endOf(
|
|
1942
|
+
return Y ? ke : ke.endOf(T);
|
|
1937
1943
|
}, J = function(ge, he) {
|
|
1938
1944
|
return w.w(E.toDate()[ge].apply(E.toDate("s"), (Y ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(he)), E);
|
|
1939
1945
|
}, ue = this.$W, fe = this.$M, de = this.$D, be = "set" + (this.$u ? "UTC" : "");
|
|
1940
|
-
switch (
|
|
1941
|
-
case
|
|
1946
|
+
switch (K) {
|
|
1947
|
+
case L:
|
|
1942
1948
|
return Y ? Z(1, 0) : Z(31, 11);
|
|
1943
1949
|
case R:
|
|
1944
1950
|
return Y ? Z(1, fe) : Z(0, fe + 1);
|
|
1945
|
-
case
|
|
1951
|
+
case _:
|
|
1946
1952
|
var ne = this.$locale().weekStart || 0, ye = (ue < ne ? ue + 7 : ue) - ne;
|
|
1947
1953
|
return Z(Y ? de - ye : de + (6 - ye), fe);
|
|
1948
|
-
case
|
|
1954
|
+
case T:
|
|
1949
1955
|
case e:
|
|
1950
1956
|
return J(be + "Hours", 0);
|
|
1951
|
-
case
|
|
1957
|
+
case N:
|
|
1952
1958
|
return J(be + "Minutes", 1);
|
|
1953
1959
|
case P:
|
|
1954
1960
|
return J(be + "Seconds", 2);
|
|
1955
|
-
case
|
|
1961
|
+
case M:
|
|
1956
1962
|
return J(be + "Milliseconds", 3);
|
|
1957
1963
|
default:
|
|
1958
1964
|
return this.clone();
|
|
1959
1965
|
}
|
|
1960
|
-
},
|
|
1961
|
-
return this.startOf(
|
|
1962
|
-
},
|
|
1963
|
-
var E, Y = w.p(
|
|
1964
|
-
if (Y === R || Y ===
|
|
1966
|
+
}, p.endOf = function(f) {
|
|
1967
|
+
return this.startOf(f, !1);
|
|
1968
|
+
}, p.$set = function(f, y) {
|
|
1969
|
+
var E, Y = w.p(f), K = "set" + (this.$u ? "UTC" : ""), Z = (E = {}, E[T] = K + "Date", E[e] = K + "Date", E[R] = K + "Month", E[L] = K + "FullYear", E[N] = K + "Hours", E[P] = K + "Minutes", E[M] = K + "Seconds", E[D] = K + "Milliseconds", E)[Y], J = Y === T ? this.$D + (y - this.$W) : y;
|
|
1970
|
+
if (Y === R || Y === L) {
|
|
1965
1971
|
var ue = this.clone().set(e, 1);
|
|
1966
1972
|
ue.$d[Z](J), ue.init(), this.$d = ue.set(e, Math.min(this.$D, ue.daysInMonth())).$d;
|
|
1967
1973
|
} else Z && this.$d[Z](J);
|
|
1968
1974
|
return this.init(), this;
|
|
1969
|
-
},
|
|
1970
|
-
return this.clone().$set(
|
|
1971
|
-
},
|
|
1972
|
-
return this[w.p(
|
|
1973
|
-
},
|
|
1975
|
+
}, p.set = function(f, y) {
|
|
1976
|
+
return this.clone().$set(f, y);
|
|
1977
|
+
}, p.get = function(f) {
|
|
1978
|
+
return this[w.p(f)]();
|
|
1979
|
+
}, p.add = function(f, y) {
|
|
1974
1980
|
var E, Y = this;
|
|
1975
|
-
|
|
1976
|
-
var
|
|
1981
|
+
f = Number(f);
|
|
1982
|
+
var K = w.p(y), Z = function(fe) {
|
|
1977
1983
|
var de = V(Y);
|
|
1978
|
-
return w.w(de.date(de.date() + Math.round(fe *
|
|
1984
|
+
return w.w(de.date(de.date() + Math.round(fe * f)), Y);
|
|
1979
1985
|
};
|
|
1980
|
-
if (
|
|
1981
|
-
if (
|
|
1982
|
-
if (
|
|
1983
|
-
if (
|
|
1984
|
-
var J = (E = {}, E[P] = c, E[
|
|
1986
|
+
if (K === R) return this.set(R, this.$M + f);
|
|
1987
|
+
if (K === L) return this.set(L, this.$y + f);
|
|
1988
|
+
if (K === T) return Z(1);
|
|
1989
|
+
if (K === _) return Z(7);
|
|
1990
|
+
var J = (E = {}, E[P] = c, E[N] = v, E[M] = u, E)[K] || 1, ue = this.$d.getTime() + f * J;
|
|
1985
1991
|
return w.w(ue, this);
|
|
1986
|
-
},
|
|
1987
|
-
return this.add(-1 *
|
|
1988
|
-
},
|
|
1989
|
-
var
|
|
1992
|
+
}, p.subtract = function(f, y) {
|
|
1993
|
+
return this.add(-1 * f, y);
|
|
1994
|
+
}, p.format = function(f) {
|
|
1995
|
+
var y = this, E = this.$locale();
|
|
1990
1996
|
if (!this.isValid()) return E.invalidDate || n;
|
|
1991
|
-
var Y =
|
|
1992
|
-
return he && (he[ke] || he(
|
|
1997
|
+
var Y = f || "YYYY-MM-DDTHH:mm:ssZ", K = w.z(this), Z = this.$H, J = this.$m, ue = this.$M, fe = E.weekdays, de = E.months, be = E.meridiem, ne = function(he, ke, $e, Ee) {
|
|
1998
|
+
return he && (he[ke] || he(y, Y)) || $e[ke].slice(0, Ee);
|
|
1993
1999
|
}, ye = function(he) {
|
|
1994
2000
|
return w.s(Z % 12 || 12, he, "0");
|
|
1995
2001
|
}, ge = be || function(he, ke, $e) {
|
|
@@ -2000,9 +2006,9 @@ function Et() {
|
|
|
2000
2006
|
return ke || function($e) {
|
|
2001
2007
|
switch ($e) {
|
|
2002
2008
|
case "YY":
|
|
2003
|
-
return String(
|
|
2009
|
+
return String(y.$y).slice(-2);
|
|
2004
2010
|
case "YYYY":
|
|
2005
|
-
return w.s(
|
|
2011
|
+
return w.s(y.$y, 4, "0");
|
|
2006
2012
|
case "M":
|
|
2007
2013
|
return ue + 1;
|
|
2008
2014
|
case "MM":
|
|
@@ -2012,17 +2018,17 @@ function Et() {
|
|
|
2012
2018
|
case "MMMM":
|
|
2013
2019
|
return ne(de, ue);
|
|
2014
2020
|
case "D":
|
|
2015
|
-
return
|
|
2021
|
+
return y.$D;
|
|
2016
2022
|
case "DD":
|
|
2017
|
-
return w.s(
|
|
2023
|
+
return w.s(y.$D, 2, "0");
|
|
2018
2024
|
case "d":
|
|
2019
|
-
return String(
|
|
2025
|
+
return String(y.$W);
|
|
2020
2026
|
case "dd":
|
|
2021
|
-
return ne(E.weekdaysMin,
|
|
2027
|
+
return ne(E.weekdaysMin, y.$W, fe, 2);
|
|
2022
2028
|
case "ddd":
|
|
2023
|
-
return ne(E.weekdaysShort,
|
|
2029
|
+
return ne(E.weekdaysShort, y.$W, fe, 3);
|
|
2024
2030
|
case "dddd":
|
|
2025
|
-
return fe[
|
|
2031
|
+
return fe[y.$W];
|
|
2026
2032
|
case "H":
|
|
2027
2033
|
return String(Z);
|
|
2028
2034
|
case "HH":
|
|
@@ -2040,25 +2046,25 @@ function Et() {
|
|
|
2040
2046
|
case "mm":
|
|
2041
2047
|
return w.s(J, 2, "0");
|
|
2042
2048
|
case "s":
|
|
2043
|
-
return String(
|
|
2049
|
+
return String(y.$s);
|
|
2044
2050
|
case "ss":
|
|
2045
|
-
return w.s(
|
|
2051
|
+
return w.s(y.$s, 2, "0");
|
|
2046
2052
|
case "SSS":
|
|
2047
|
-
return w.s(
|
|
2053
|
+
return w.s(y.$ms, 3, "0");
|
|
2048
2054
|
case "Z":
|
|
2049
|
-
return
|
|
2055
|
+
return K;
|
|
2050
2056
|
}
|
|
2051
2057
|
return null;
|
|
2052
|
-
}(he) ||
|
|
2058
|
+
}(he) || K.replace(":", "");
|
|
2053
2059
|
});
|
|
2054
|
-
},
|
|
2060
|
+
}, p.utcOffset = function() {
|
|
2055
2061
|
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
2056
|
-
},
|
|
2057
|
-
var Y,
|
|
2058
|
-
return w.m(
|
|
2062
|
+
}, p.diff = function(f, y, E) {
|
|
2063
|
+
var Y, K = this, Z = w.p(y), J = V(f), ue = (J.utcOffset() - this.utcOffset()) * c, fe = this - J, de = function() {
|
|
2064
|
+
return w.m(K, J);
|
|
2059
2065
|
};
|
|
2060
2066
|
switch (Z) {
|
|
2061
|
-
case
|
|
2067
|
+
case L:
|
|
2062
2068
|
Y = de() / 12;
|
|
2063
2069
|
break;
|
|
2064
2070
|
case R:
|
|
@@ -2067,123 +2073,123 @@ function Et() {
|
|
|
2067
2073
|
case $:
|
|
2068
2074
|
Y = de() / 3;
|
|
2069
2075
|
break;
|
|
2070
|
-
case
|
|
2076
|
+
case _:
|
|
2071
2077
|
Y = (fe - ue) / 6048e5;
|
|
2072
2078
|
break;
|
|
2073
|
-
case
|
|
2079
|
+
case T:
|
|
2074
2080
|
Y = (fe - ue) / 864e5;
|
|
2075
2081
|
break;
|
|
2076
|
-
case
|
|
2082
|
+
case N:
|
|
2077
2083
|
Y = fe / v;
|
|
2078
2084
|
break;
|
|
2079
2085
|
case P:
|
|
2080
2086
|
Y = fe / c;
|
|
2081
2087
|
break;
|
|
2082
|
-
case
|
|
2088
|
+
case M:
|
|
2083
2089
|
Y = fe / u;
|
|
2084
2090
|
break;
|
|
2085
2091
|
default:
|
|
2086
2092
|
Y = fe;
|
|
2087
2093
|
}
|
|
2088
2094
|
return E ? Y : w.a(Y);
|
|
2089
|
-
},
|
|
2095
|
+
}, p.daysInMonth = function() {
|
|
2090
2096
|
return this.endOf(R).$D;
|
|
2091
|
-
},
|
|
2097
|
+
}, p.$locale = function() {
|
|
2092
2098
|
return Q[this.$L];
|
|
2093
|
-
},
|
|
2094
|
-
if (!
|
|
2095
|
-
var E = this.clone(), Y = a(
|
|
2099
|
+
}, p.locale = function(f, y) {
|
|
2100
|
+
if (!f) return this.$L;
|
|
2101
|
+
var E = this.clone(), Y = a(f, y, !0);
|
|
2096
2102
|
return Y && (E.$L = Y), E;
|
|
2097
|
-
},
|
|
2103
|
+
}, p.clone = function() {
|
|
2098
2104
|
return w.w(this.$d, this);
|
|
2099
|
-
},
|
|
2105
|
+
}, p.toDate = function() {
|
|
2100
2106
|
return new Date(this.valueOf());
|
|
2101
|
-
},
|
|
2107
|
+
}, p.toJSON = function() {
|
|
2102
2108
|
return this.isValid() ? this.toISOString() : null;
|
|
2103
|
-
},
|
|
2109
|
+
}, p.toISOString = function() {
|
|
2104
2110
|
return this.$d.toISOString();
|
|
2105
|
-
},
|
|
2111
|
+
}, p.toString = function() {
|
|
2106
2112
|
return this.$d.toUTCString();
|
|
2107
2113
|
}, d;
|
|
2108
|
-
}(), z =
|
|
2109
|
-
return V.prototype = z, [["$ms", D], ["$s",
|
|
2110
|
-
z[d[1]] = function(
|
|
2111
|
-
return this.$g(
|
|
2114
|
+
}(), z = U.prototype;
|
|
2115
|
+
return V.prototype = z, [["$ms", D], ["$s", M], ["$m", P], ["$H", N], ["$W", T], ["$M", R], ["$y", L], ["$D", e]].forEach(function(d) {
|
|
2116
|
+
z[d[1]] = function(p) {
|
|
2117
|
+
return this.$g(p, d[0], d[1]);
|
|
2112
2118
|
};
|
|
2113
|
-
}), V.extend = function(d,
|
|
2114
|
-
return d.$i || (d(
|
|
2119
|
+
}), V.extend = function(d, p) {
|
|
2120
|
+
return d.$i || (d(p, U, V), d.$i = !0), V;
|
|
2115
2121
|
}, V.locale = a, V.isDayjs = X, V.unix = function(d) {
|
|
2116
2122
|
return V(1e3 * d);
|
|
2117
|
-
}, V.en = Q[
|
|
2123
|
+
}, V.en = Q[C], V.Ls = Q, V.p = {}, V;
|
|
2118
2124
|
});
|
|
2119
2125
|
}(Ge)), Ge.exports;
|
|
2120
2126
|
}
|
|
2121
2127
|
var _n = Et();
|
|
2122
2128
|
const Re = /* @__PURE__ */ Nn(_n);
|
|
2123
2129
|
var Fe = { exports: {} }, Ln = Fe.exports, bt;
|
|
2124
|
-
function
|
|
2125
|
-
return bt || (bt = 1, function(t,
|
|
2130
|
+
function In() {
|
|
2131
|
+
return bt || (bt = 1, function(t, h) {
|
|
2126
2132
|
(function(u, c) {
|
|
2127
2133
|
t.exports = c(Et());
|
|
2128
2134
|
})(Ln, function(u) {
|
|
2129
|
-
function c(
|
|
2130
|
-
return
|
|
2135
|
+
function c(M) {
|
|
2136
|
+
return M && typeof M == "object" && "default" in M ? M : { default: M };
|
|
2131
2137
|
}
|
|
2132
|
-
var v = c(u), D = { 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(
|
|
2133
|
-
return P === "W" ?
|
|
2134
|
-
}, 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(
|
|
2135
|
-
var
|
|
2136
|
-
return
|
|
2138
|
+
var v = c(u), D = { 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(M, P) {
|
|
2139
|
+
return P === "W" ? M + "周" : M + "日";
|
|
2140
|
+
}, 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(M, P) {
|
|
2141
|
+
var N = 100 * M + P;
|
|
2142
|
+
return N < 600 ? "凌晨" : N < 900 ? "早上" : N < 1100 ? "上午" : N < 1300 ? "中午" : N < 1800 ? "下午" : "晚上";
|
|
2137
2143
|
} };
|
|
2138
2144
|
return v.default.locale(D, null, !0), D;
|
|
2139
2145
|
});
|
|
2140
2146
|
}(Fe)), Fe.exports;
|
|
2141
2147
|
}
|
|
2142
|
-
|
|
2143
|
-
function
|
|
2148
|
+
In();
|
|
2149
|
+
function Me(t) {
|
|
2144
2150
|
"@babel/helpers - typeof";
|
|
2145
|
-
return
|
|
2146
|
-
return typeof
|
|
2147
|
-
} : function(
|
|
2148
|
-
return
|
|
2149
|
-
},
|
|
2151
|
+
return Me = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(h) {
|
|
2152
|
+
return typeof h;
|
|
2153
|
+
} : function(h) {
|
|
2154
|
+
return h && typeof Symbol == "function" && h.constructor === Symbol && h !== Symbol.prototype ? "symbol" : typeof h;
|
|
2155
|
+
}, Me(t);
|
|
2150
2156
|
}
|
|
2151
|
-
function
|
|
2152
|
-
if (
|
|
2157
|
+
function Mn(t, h) {
|
|
2158
|
+
if (Me(t) != "object" || !t) return t;
|
|
2153
2159
|
var u = t[Symbol.toPrimitive];
|
|
2154
2160
|
if (u !== void 0) {
|
|
2155
|
-
var c = u.call(t,
|
|
2156
|
-
if (
|
|
2161
|
+
var c = u.call(t, h);
|
|
2162
|
+
if (Me(c) != "object") return c;
|
|
2157
2163
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2158
2164
|
}
|
|
2159
|
-
return (
|
|
2165
|
+
return (h === "string" ? String : Number)(t);
|
|
2160
2166
|
}
|
|
2161
2167
|
function Dn(t) {
|
|
2162
|
-
var
|
|
2163
|
-
return
|
|
2168
|
+
var h = Mn(t, "string");
|
|
2169
|
+
return Me(h) == "symbol" ? h : h + "";
|
|
2164
2170
|
}
|
|
2165
|
-
function Pn(t,
|
|
2166
|
-
return (
|
|
2171
|
+
function Pn(t, h, u) {
|
|
2172
|
+
return (h = Dn(h)) in t ? Object.defineProperty(t, h, {
|
|
2167
2173
|
value: u,
|
|
2168
2174
|
enumerable: !0,
|
|
2169
2175
|
configurable: !0,
|
|
2170
2176
|
writable: !0
|
|
2171
|
-
}) : t[
|
|
2177
|
+
}) : t[h] = u, t;
|
|
2172
2178
|
}
|
|
2173
|
-
function vt(t,
|
|
2179
|
+
function vt(t, h) {
|
|
2174
2180
|
var u = Object.keys(t);
|
|
2175
2181
|
if (Object.getOwnPropertySymbols) {
|
|
2176
2182
|
var c = Object.getOwnPropertySymbols(t);
|
|
2177
|
-
|
|
2183
|
+
h && (c = c.filter(function(v) {
|
|
2178
2184
|
return Object.getOwnPropertyDescriptor(t, v).enumerable;
|
|
2179
2185
|
})), u.push.apply(u, c);
|
|
2180
2186
|
}
|
|
2181
2187
|
return u;
|
|
2182
2188
|
}
|
|
2183
2189
|
function wt(t) {
|
|
2184
|
-
for (var
|
|
2185
|
-
var u = arguments[
|
|
2186
|
-
|
|
2190
|
+
for (var h = 1; h < arguments.length; h++) {
|
|
2191
|
+
var u = arguments[h] != null ? arguments[h] : {};
|
|
2192
|
+
h % 2 ? vt(Object(u), !0).forEach(function(c) {
|
|
2187
2193
|
Pn(t, c, u[c]);
|
|
2188
2194
|
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(t, Object.getOwnPropertyDescriptors(u)) : vt(Object(u)).forEach(function(c) {
|
|
2189
2195
|
Object.defineProperty(t, c, Object.getOwnPropertyDescriptor(u, c));
|
|
@@ -2244,30 +2250,30 @@ const Vn = {
|
|
|
2244
2250
|
};
|
|
2245
2251
|
Ct.lang.ok = "确定";
|
|
2246
2252
|
Re.locale("zh-cn");
|
|
2247
|
-
const { RangePicker: On } = jt, Gn = ({ host: t, onChange:
|
|
2248
|
-
const u = t.dataset.key, c = t.dataset.value, v = t.dataset.placeholder, D = t.dataset.limitRange ? parseInt(t.dataset.limitRange, 10) : void 0,
|
|
2253
|
+
const { RangePicker: On } = jt, Gn = ({ host: t, onChange: h }) => {
|
|
2254
|
+
const u = t.dataset.key, c = t.dataset.value, v = t.dataset.placeholder, D = t.dataset.limitRange ? parseInt(t.dataset.limitRange, 10) : void 0, M = t.dataset.disableFuture === "true", [P, N] = oe(() => {
|
|
2249
2255
|
if (!c) return null;
|
|
2250
2256
|
const n = c.split(",");
|
|
2251
2257
|
return n.length === 2 && n[0] && n[1] ? [Re(n[0]), Re(n[1])] : null;
|
|
2252
|
-
}), [
|
|
2258
|
+
}), [T, _] = oe(null);
|
|
2253
2259
|
return ot(
|
|
2254
2260
|
/* @__PURE__ */ H("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__ */ H(
|
|
2255
2261
|
On,
|
|
2256
2262
|
{
|
|
2257
2263
|
value: P,
|
|
2258
|
-
disabledDate: (n) => n ?
|
|
2264
|
+
disabledDate: (n) => n ? M && n.isAfter(Re(), "day") ? !0 : !D || !T || !T[0] ? !1 : Math.abs(n.diff(T[0], "days")) > D : !1,
|
|
2259
2265
|
onCalendarChange: (n) => {
|
|
2260
|
-
console.log("[DatePicker] onCalendarChange", n?.map((r) => r?.format("YYYY-MM-DD") || null)),
|
|
2266
|
+
console.log("[DatePicker] onCalendarChange", n?.map((r) => r?.format("YYYY-MM-DD") || null)), _(n);
|
|
2261
2267
|
},
|
|
2262
2268
|
onChange: (n) => {
|
|
2263
|
-
if (console.log("[DatePicker] onChange", n?.map((r) => r?.format("YYYY-MM-DD") || null)),
|
|
2269
|
+
if (console.log("[DatePicker] onChange", n?.map((r) => r?.format("YYYY-MM-DD") || null)), N(n), _(null), n && n[0] && n[1]) {
|
|
2264
2270
|
const r = `${n[0].format("YYYY-MM-DD")},${n[1].format("YYYY-MM-DD")}`;
|
|
2265
|
-
t.setAttribute("data-value", r),
|
|
2271
|
+
t.setAttribute("data-value", r), h(u, r);
|
|
2266
2272
|
} else
|
|
2267
|
-
t.setAttribute("data-value", ""),
|
|
2273
|
+
t.setAttribute("data-value", ""), h(u, "");
|
|
2268
2274
|
},
|
|
2269
2275
|
onOpenChange: (n) => {
|
|
2270
|
-
console.log("[DatePicker] onOpenChange", n),
|
|
2276
|
+
console.log("[DatePicker] onOpenChange", n), _(n ? P : null);
|
|
2271
2277
|
},
|
|
2272
2278
|
placeholder: [v || "开始日期", v || "结束日期"],
|
|
2273
2279
|
style: { width: "100%" },
|
|
@@ -2281,48 +2287,48 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: g }) => {
|
|
|
2281
2287
|
t
|
|
2282
2288
|
);
|
|
2283
2289
|
}, Rn = (t) => {
|
|
2284
|
-
const [
|
|
2290
|
+
const [h, u] = oe([]);
|
|
2285
2291
|
return pe(() => {
|
|
2286
2292
|
const c = t.current;
|
|
2287
2293
|
if (!c) return;
|
|
2288
2294
|
const v = () => {
|
|
2289
|
-
const
|
|
2290
|
-
|
|
2291
|
-
const
|
|
2292
|
-
|
|
2295
|
+
const M = c.querySelectorAll(".rte-datepicker-host"), P = [];
|
|
2296
|
+
M.forEach((N) => {
|
|
2297
|
+
const T = N.getAttribute("data-key");
|
|
2298
|
+
T && P.push(
|
|
2293
2299
|
/* @__PURE__ */ H(
|
|
2294
2300
|
Gn,
|
|
2295
2301
|
{
|
|
2296
|
-
host:
|
|
2302
|
+
host: N,
|
|
2297
2303
|
onChange: () => {
|
|
2298
2304
|
if (t.current) {
|
|
2299
|
-
const
|
|
2300
|
-
t.current.dispatchEvent(
|
|
2305
|
+
const _ = new Event("input", { bubbles: !0 });
|
|
2306
|
+
t.current.dispatchEvent(_);
|
|
2301
2307
|
}
|
|
2302
2308
|
}
|
|
2303
2309
|
},
|
|
2304
|
-
`datepicker-${
|
|
2310
|
+
`datepicker-${T}`
|
|
2305
2311
|
)
|
|
2306
2312
|
);
|
|
2307
2313
|
}), u(P);
|
|
2308
2314
|
};
|
|
2309
2315
|
v();
|
|
2310
|
-
const D = new MutationObserver((
|
|
2316
|
+
const D = new MutationObserver((M) => {
|
|
2311
2317
|
let P = !1;
|
|
2312
|
-
for (const
|
|
2313
|
-
if (
|
|
2314
|
-
let
|
|
2315
|
-
if (
|
|
2316
|
-
if (
|
|
2317
|
-
const R =
|
|
2318
|
-
(R.classList?.contains("rte-datepicker-host") || R.querySelector?.(".rte-datepicker-host")) && (
|
|
2318
|
+
for (const N of M)
|
|
2319
|
+
if (N.type === "childList") {
|
|
2320
|
+
let T = !1;
|
|
2321
|
+
if (N.addedNodes.forEach((_) => {
|
|
2322
|
+
if (_.nodeType === Node.ELEMENT_NODE) {
|
|
2323
|
+
const R = _;
|
|
2324
|
+
(R.classList?.contains("rte-datepicker-host") || R.querySelector?.(".rte-datepicker-host")) && (T = !0);
|
|
2319
2325
|
}
|
|
2320
|
-
}),
|
|
2321
|
-
if (
|
|
2322
|
-
const R =
|
|
2323
|
-
(R.classList?.contains("rte-datepicker-host") || R.querySelector?.(".rte-datepicker-host")) && (
|
|
2326
|
+
}), N.removedNodes.forEach((_) => {
|
|
2327
|
+
if (_.nodeType === Node.ELEMENT_NODE) {
|
|
2328
|
+
const R = _;
|
|
2329
|
+
(R.classList?.contains("rte-datepicker-host") || R.querySelector?.(".rte-datepicker-host")) && (T = !0);
|
|
2324
2330
|
}
|
|
2325
|
-
}),
|
|
2331
|
+
}), T) {
|
|
2326
2332
|
P = !0;
|
|
2327
2333
|
break;
|
|
2328
2334
|
}
|
|
@@ -2330,30 +2336,30 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: g }) => {
|
|
|
2330
2336
|
P && v();
|
|
2331
2337
|
});
|
|
2332
2338
|
return D.observe(c, { childList: !0, subtree: !0 }), () => D.disconnect();
|
|
2333
|
-
}, [t]),
|
|
2339
|
+
}, [t]), h;
|
|
2334
2340
|
}, Fn = (t) => t.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'"), zn = ({
|
|
2335
2341
|
config: t,
|
|
2336
|
-
onSend:
|
|
2342
|
+
onSend: h,
|
|
2337
2343
|
isProcessing: u = !1,
|
|
2338
2344
|
disabled: c = !1,
|
|
2339
2345
|
width: v,
|
|
2340
2346
|
lockStructure: D = !1,
|
|
2341
|
-
agentOptions:
|
|
2347
|
+
agentOptions: M = [],
|
|
2342
2348
|
onAgentSelect: P,
|
|
2343
|
-
onAgentExit:
|
|
2344
|
-
loading:
|
|
2345
|
-
placeholder:
|
|
2349
|
+
onAgentExit: N,
|
|
2350
|
+
loading: T = !1,
|
|
2351
|
+
placeholder: _,
|
|
2346
2352
|
border: R,
|
|
2347
2353
|
background: $ = "transparent",
|
|
2348
|
-
hideButtons:
|
|
2354
|
+
hideButtons: L,
|
|
2349
2355
|
maxHeight: e,
|
|
2350
2356
|
minHeight: n,
|
|
2351
2357
|
collapsed: r = !1,
|
|
2352
2358
|
reportAnalyze: i,
|
|
2353
|
-
onCollapsedChange:
|
|
2359
|
+
onCollapsedChange: x,
|
|
2354
2360
|
collapseTransitionMs: q = 260
|
|
2355
2361
|
}) => {
|
|
2356
|
-
const [
|
|
2362
|
+
const [O, C] = Wt.useMessage(), Q = ae(null), W = ae(null), X = ae(null), a = ae(null), V = ae(null), [w, U] = oe({}), [z, d] = oe(null), [p, f] = oe(null), [y, E] = oe(null), Y = ae(!1), K = ae(null), [Z, J] = oe(!1), ue = ae(null), [fe, de] = oe(!0), be = ae(0), [ne, ye] = oe(58), [ge, he] = oe(58), [ke, $e] = oe(!1), [Ee, Ie] = oe({}), Ye = ae(() => {
|
|
2357
2363
|
}), [Ce, Te] = oe(() => {
|
|
2358
2364
|
const o = {};
|
|
2359
2365
|
return t.forEach((l) => {
|
|
@@ -2370,23 +2376,23 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: g }) => {
|
|
|
2370
2376
|
const o = We(it.current), l = We(t);
|
|
2371
2377
|
if (o && o !== l && a.current) {
|
|
2372
2378
|
const s = {};
|
|
2373
|
-
a.current.querySelectorAll('[data-type="variable"]').forEach((
|
|
2374
|
-
const
|
|
2375
|
-
if (
|
|
2376
|
-
const
|
|
2377
|
-
|
|
2379
|
+
a.current.querySelectorAll('[data-type="variable"]').forEach((g) => {
|
|
2380
|
+
const G = g.dataset.key;
|
|
2381
|
+
if (G) {
|
|
2382
|
+
const I = g.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
2383
|
+
I && (s[G] = I);
|
|
2378
2384
|
}
|
|
2379
|
-
}), a.current.querySelectorAll('[data-type="select"]').forEach((
|
|
2380
|
-
const
|
|
2381
|
-
if (
|
|
2382
|
-
const
|
|
2383
|
-
|
|
2385
|
+
}), a.current.querySelectorAll('[data-type="select"]').forEach((g) => {
|
|
2386
|
+
const G = g.dataset.key;
|
|
2387
|
+
if (G) {
|
|
2388
|
+
const I = (g.getAttribute("data-value") || "").trim();
|
|
2389
|
+
I && (s[G] = I);
|
|
2384
2390
|
}
|
|
2385
|
-
}), a.current.querySelectorAll('[data-type="textarea"]').forEach((
|
|
2386
|
-
const
|
|
2387
|
-
if (
|
|
2388
|
-
const
|
|
2389
|
-
|
|
2391
|
+
}), a.current.querySelectorAll('[data-type="textarea"]').forEach((g) => {
|
|
2392
|
+
const G = g.dataset.key;
|
|
2393
|
+
if (G) {
|
|
2394
|
+
const I = g.value.replace(/[\u200B]/g, "").trim();
|
|
2395
|
+
I && (s[G] = I);
|
|
2390
2396
|
}
|
|
2391
2397
|
}), je.current[o] = {
|
|
2392
2398
|
variableValues: s,
|
|
@@ -2396,15 +2402,15 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: g }) => {
|
|
|
2396
2402
|
}
|
|
2397
2403
|
if (l && je.current[l]) {
|
|
2398
2404
|
const s = je.current[l];
|
|
2399
|
-
Ne.current = s,
|
|
2405
|
+
Ne.current = s, U(s.files), Te(s.multiVariableCounts);
|
|
2400
2406
|
} else if (l) {
|
|
2401
2407
|
Ne.current = null;
|
|
2402
2408
|
const s = {};
|
|
2403
2409
|
t.forEach((b) => {
|
|
2404
2410
|
b.type === "multi-variable" && b.key && (s[b.key] = 1);
|
|
2405
|
-
}), Te(s),
|
|
2411
|
+
}), Te(s), U({});
|
|
2406
2412
|
} else
|
|
2407
|
-
Ne.current = null, Te({}),
|
|
2413
|
+
Ne.current = null, Te({}), U({});
|
|
2408
2414
|
it.current = t;
|
|
2409
2415
|
}, [t, We]), Le(() => {
|
|
2410
2416
|
Ne.current && a.current && (a.current.__tempVariableValues = Ne.current.variableValues, setTimeout(() => {
|
|
@@ -2416,7 +2422,7 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: g }) => {
|
|
|
2416
2422
|
const o = [];
|
|
2417
2423
|
for (const l of t) {
|
|
2418
2424
|
if (o.push(l), l.type !== "report-url" || !l.key) continue;
|
|
2419
|
-
const s = Ee[l.key], b = s?.status ?? "idle",
|
|
2425
|
+
const s = Ee[l.key], b = s?.status ?? "idle", m = s?.modules ?? [];
|
|
2420
2426
|
b === "loading" && o.push({
|
|
2421
2427
|
type: "text",
|
|
2422
2428
|
className: "rte-report-parsing",
|
|
@@ -2427,12 +2433,12 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: g }) => {
|
|
|
2427
2433
|
className: "rte-report-error",
|
|
2428
2434
|
text: `解析失败:${Fn(s.error)}
|
|
2429
2435
|
`
|
|
2430
|
-
}),
|
|
2436
|
+
}), m.length > 0 && (m.forEach((k, g) => {
|
|
2431
2437
|
o.push({
|
|
2432
2438
|
type: "report-module",
|
|
2433
2439
|
key: l.key,
|
|
2434
2440
|
// 所有模块使用同一个 key(数据收集时会合并为数组)
|
|
2435
|
-
moduleIndex:
|
|
2441
|
+
moduleIndex: g,
|
|
2436
2442
|
placeholder: "可编辑,内容不能为空",
|
|
2437
2443
|
required: !0,
|
|
2438
2444
|
minHeight: 80,
|
|
@@ -2456,8 +2462,8 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: g }) => {
|
|
|
2456
2462
|
return { url: l };
|
|
2457
2463
|
}
|
|
2458
2464
|
}
|
|
2459
|
-
const b = s.pathname.split("/").filter(Boolean),
|
|
2460
|
-
return { url: l, reportId: k, agentId:
|
|
2465
|
+
const b = s.pathname.split("/").filter(Boolean), m = b.findIndex((I) => I === "report"), k = m >= 0 ? b[m + 1] : void 0, g = b[0] && b[0].length <= 5 ? b[0] : void 0, G = s.searchParams.get("agentId") || void 0;
|
|
2466
|
+
return { url: l, reportId: k, agentId: G, lang: g };
|
|
2461
2467
|
}, []), ut = ie(() => {
|
|
2462
2468
|
const o = {};
|
|
2463
2469
|
if (!a.current) return o;
|
|
@@ -2465,24 +2471,24 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: g }) => {
|
|
|
2465
2471
|
return l.querySelectorAll('[data-type="variable"]').forEach((s) => {
|
|
2466
2472
|
const b = s.dataset.key;
|
|
2467
2473
|
if (!b) return;
|
|
2468
|
-
const
|
|
2469
|
-
|
|
2474
|
+
const m = s.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
2475
|
+
m && (o[b] = m);
|
|
2470
2476
|
}), l.querySelectorAll('[data-type="select"]').forEach((s) => {
|
|
2471
2477
|
const b = s.dataset.key;
|
|
2472
2478
|
if (!b) return;
|
|
2473
|
-
const
|
|
2474
|
-
|
|
2479
|
+
const m = (s.getAttribute("data-value") || "").trim();
|
|
2480
|
+
m && (o[b] = m);
|
|
2475
2481
|
}), l.querySelectorAll('[data-type="textarea"]').forEach((s) => {
|
|
2476
2482
|
const b = s.dataset.key;
|
|
2477
2483
|
if (!b) return;
|
|
2478
|
-
const
|
|
2479
|
-
|
|
2484
|
+
const m = s.value.replace(/[\u200B]/g, "").trim();
|
|
2485
|
+
m && (o[b] = m);
|
|
2480
2486
|
}), l.querySelectorAll('[data-type="richtext"]').forEach((s) => {
|
|
2481
2487
|
const b = s.dataset.key;
|
|
2482
2488
|
if (!b) return;
|
|
2483
2489
|
if ((s.getAttribute("data-node-type") || "") === "report-module") {
|
|
2484
|
-
const
|
|
2485
|
-
o[`${b}__module_${Number.isFinite(
|
|
2490
|
+
const g = Number.parseInt(s.getAttribute("data-module-index") || "0", 10), G = (s.innerHTML || "").replace(/[\u200B]/g, "").trim();
|
|
2491
|
+
o[`${b}__module_${Number.isFinite(g) ? g : 0}`] = G;
|
|
2486
2492
|
return;
|
|
2487
2493
|
}
|
|
2488
2494
|
const k = (s.textContent || "").replace(/[\u200B]/g, "").trim();
|
|
@@ -2490,27 +2496,27 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: g }) => {
|
|
|
2490
2496
|
}), l.querySelectorAll('[data-type="datepicker"]').forEach((s) => {
|
|
2491
2497
|
const b = s.dataset.key;
|
|
2492
2498
|
if (!b) return;
|
|
2493
|
-
const
|
|
2494
|
-
|
|
2499
|
+
const m = (s.getAttribute("data-value") || "").trim();
|
|
2500
|
+
m && (o[b] = m);
|
|
2495
2501
|
}), l.querySelectorAll('[data-type="number-input"]').forEach((s) => {
|
|
2496
2502
|
const b = s.dataset.key;
|
|
2497
2503
|
if (!b) return;
|
|
2498
|
-
const
|
|
2499
|
-
|
|
2504
|
+
const m = (s.value || "").trim();
|
|
2505
|
+
m && (o[b] = m);
|
|
2500
2506
|
}), o;
|
|
2501
2507
|
}, []), dt = ie((o) => (o?.modules || []).map((l, s) => {
|
|
2502
|
-
const b = (l?.title || `模块${s + 1}`).trim() || `模块${s + 1}`,
|
|
2508
|
+
const b = (l?.title || `模块${s + 1}`).trim() || `模块${s + 1}`, m = (l?.content || "").trim();
|
|
2503
2509
|
return {
|
|
2504
2510
|
title: b,
|
|
2505
|
-
content:
|
|
2511
|
+
content: m.length > 0 ? m : `请补充:${b}`
|
|
2506
2512
|
};
|
|
2507
2513
|
}), []), pt = ie(
|
|
2508
2514
|
(o, l) => {
|
|
2509
2515
|
const s = (l || "").trim();
|
|
2510
2516
|
if (!o) return;
|
|
2511
2517
|
if (!s) {
|
|
2512
|
-
|
|
2513
|
-
...
|
|
2518
|
+
Ie((g) => ({
|
|
2519
|
+
...g,
|
|
2514
2520
|
[o]: { status: "idle", modules: [], lastParsedUrl: void 0, error: void 0 }
|
|
2515
2521
|
}));
|
|
2516
2522
|
return;
|
|
@@ -2518,43 +2524,43 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: g }) => {
|
|
|
2518
2524
|
const b = Ee[o];
|
|
2519
2525
|
if (b?.lastParsedUrl && b.lastParsedUrl === s && b.status === "loading")
|
|
2520
2526
|
return;
|
|
2521
|
-
|
|
2522
|
-
...
|
|
2523
|
-
[o]: { ...
|
|
2527
|
+
Ie((g) => ({
|
|
2528
|
+
...g,
|
|
2529
|
+
[o]: { ...g[o], status: "loading", error: void 0, lastParsedUrl: s }
|
|
2524
2530
|
}));
|
|
2525
|
-
const
|
|
2526
|
-
(i || (async (
|
|
2531
|
+
const m = ct(s);
|
|
2532
|
+
(i || (async (g) => ({
|
|
2527
2533
|
modules: [
|
|
2528
2534
|
{
|
|
2529
2535
|
title: "第1张:人群+场景直击图",
|
|
2530
2536
|
content: `视觉要求:养宠人在客厅场景中,宠物(猫/狗)自然趴在旁;画面聚焦“人+宠+整洁氛围”。
|
|
2531
|
-
(reportId=${
|
|
2537
|
+
(reportId=${g.reportId || "unknown"}, agentId=${g.agentId || "1"})`
|
|
2532
2538
|
},
|
|
2533
2539
|
{
|
|
2534
2540
|
title: "第2张:痛点放大对比图",
|
|
2535
2541
|
content: "左侧:杂乱堆放、难清理;右侧:分区收纳、拿取方便。文案≤15字,绑定人群+场景+需求。"
|
|
2536
2542
|
}
|
|
2537
2543
|
]
|
|
2538
|
-
})))(
|
|
2539
|
-
const
|
|
2544
|
+
})))(m).then((g) => {
|
|
2545
|
+
const G = dt(g);
|
|
2540
2546
|
if (a.current) {
|
|
2541
|
-
const
|
|
2542
|
-
|
|
2543
|
-
|
|
2544
|
-
}), a.current.__tempVariableValues =
|
|
2547
|
+
const I = ut();
|
|
2548
|
+
G.forEach((S, B) => {
|
|
2549
|
+
I[`${o}__module_${B}`] = S.content;
|
|
2550
|
+
}), a.current.__tempVariableValues = I;
|
|
2545
2551
|
}
|
|
2546
|
-
|
|
2547
|
-
...
|
|
2548
|
-
[o]: { status: "success", error: void 0, lastParsedUrl: s, modules:
|
|
2552
|
+
Ie((I) => ({
|
|
2553
|
+
...I,
|
|
2554
|
+
[o]: { status: "success", error: void 0, lastParsedUrl: s, modules: G }
|
|
2549
2555
|
}));
|
|
2550
|
-
}).catch((
|
|
2551
|
-
const
|
|
2552
|
-
|
|
2553
|
-
...
|
|
2556
|
+
}).catch((g) => {
|
|
2557
|
+
const G = g instanceof Error ? g.message : String(g);
|
|
2558
|
+
Ie((I) => ({
|
|
2559
|
+
...I,
|
|
2554
2560
|
[o]: {
|
|
2555
|
-
...
|
|
2561
|
+
...I[o] || { modules: [] },
|
|
2556
2562
|
status: "error",
|
|
2557
|
-
error:
|
|
2563
|
+
error: G || "解析失败",
|
|
2558
2564
|
lastParsedUrl: s,
|
|
2559
2565
|
modules: []
|
|
2560
2566
|
}
|
|
@@ -2569,22 +2575,22 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: g }) => {
|
|
|
2569
2575
|
if (!a.current) return;
|
|
2570
2576
|
const o = /* @__PURE__ */ new Map(), l = window.setTimeout(() => {
|
|
2571
2577
|
if (!a.current) return;
|
|
2572
|
-
o.forEach((
|
|
2578
|
+
o.forEach((m, k) => k.removeEventListener("blur", m, !1)), o.clear();
|
|
2573
2579
|
const s = a.current.querySelectorAll(
|
|
2574
2580
|
'[data-type="variable"][data-node-type="report-url"]'
|
|
2575
|
-
), b = (
|
|
2576
|
-
|
|
2577
|
-
const k =
|
|
2581
|
+
), b = (m) => {
|
|
2582
|
+
m.stopPropagation(), m.stopImmediatePropagation();
|
|
2583
|
+
const k = m.target?.closest(
|
|
2578
2584
|
'[data-type="variable"][data-node-type="report-url"]'
|
|
2579
2585
|
);
|
|
2580
2586
|
if (!k || !a.current || !a.current.contains(k)) return;
|
|
2581
|
-
const
|
|
2582
|
-
if (!
|
|
2583
|
-
const
|
|
2584
|
-
Ye.current(
|
|
2587
|
+
const g = k.dataset.key;
|
|
2588
|
+
if (!g) return;
|
|
2589
|
+
const G = k.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
2590
|
+
Ye.current(g, G);
|
|
2585
2591
|
};
|
|
2586
|
-
s.forEach((
|
|
2587
|
-
|
|
2592
|
+
s.forEach((m) => {
|
|
2593
|
+
m.addEventListener("blur", b, !1), o.set(m, b);
|
|
2588
2594
|
});
|
|
2589
2595
|
}, 0);
|
|
2590
2596
|
return () => {
|
|
@@ -2592,8 +2598,8 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: g }) => {
|
|
|
2592
2598
|
};
|
|
2593
2599
|
}, [xe]), Le(() => {
|
|
2594
2600
|
if (!a.current) return;
|
|
2595
|
-
const o = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), s = (
|
|
2596
|
-
const
|
|
2601
|
+
const o = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), s = (I) => {
|
|
2602
|
+
const S = I.value || I.placeholder || "", B = document.createElement("span");
|
|
2597
2603
|
B.style.cssText = `
|
|
2598
2604
|
position: absolute;
|
|
2599
2605
|
visibility: hidden;
|
|
@@ -2601,61 +2607,61 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: g }) => {
|
|
|
2601
2607
|
font-size: 16px;
|
|
2602
2608
|
font-family: inherit;
|
|
2603
2609
|
padding: 0 8px;
|
|
2604
|
-
`, B.textContent =
|
|
2605
|
-
const
|
|
2606
|
-
return document.body.removeChild(B),
|
|
2607
|
-
}, b = (
|
|
2608
|
-
const
|
|
2609
|
-
if (!
|
|
2610
|
-
let B =
|
|
2610
|
+
`, B.textContent = S || "0", document.body.appendChild(B);
|
|
2611
|
+
const A = Math.max(60, Math.min(600, B.offsetWidth + 32));
|
|
2612
|
+
return document.body.removeChild(B), A;
|
|
2613
|
+
}, b = (I) => {
|
|
2614
|
+
const S = I.target;
|
|
2615
|
+
if (!S) return;
|
|
2616
|
+
let B = S.value;
|
|
2611
2617
|
if (B = B.replace(/[^\d]/g, ""), B !== "" && B !== "0") {
|
|
2612
|
-
const
|
|
2613
|
-
if (Number.isNaN(
|
|
2614
|
-
|
|
2618
|
+
const A = parseInt(B, 10);
|
|
2619
|
+
if (Number.isNaN(A))
|
|
2620
|
+
S.value = "";
|
|
2615
2621
|
else {
|
|
2616
|
-
const j =
|
|
2617
|
-
|
|
2622
|
+
const j = S.getAttribute("min"), te = S.getAttribute("max"), F = j !== null ? parseInt(j, 10) : 0, ee = te !== null ? parseInt(te, 10) : 1 / 0, le = Math.min(Math.max(A, F), ee);
|
|
2623
|
+
S.value = String(le);
|
|
2618
2624
|
}
|
|
2619
2625
|
} else if (B === "0") {
|
|
2620
|
-
const
|
|
2621
|
-
0 < (
|
|
2626
|
+
const A = S.getAttribute("min");
|
|
2627
|
+
0 < (A !== null ? parseInt(A, 10) : 0) ? S.value = "" : S.value = "0";
|
|
2622
2628
|
}
|
|
2623
|
-
|
|
2624
|
-
},
|
|
2625
|
-
const
|
|
2626
|
-
(
|
|
2629
|
+
S.style.width = `${s(S)}px`;
|
|
2630
|
+
}, m = (I) => {
|
|
2631
|
+
const S = I.key;
|
|
2632
|
+
(S === "-" || S === "." || S === "," || S === "e" || S === "E" || S === "+" || S === "=" || S === " ") && I.preventDefault();
|
|
2627
2633
|
}, k = () => {
|
|
2628
2634
|
if (!a.current) return;
|
|
2629
2635
|
a.current.querySelectorAll(
|
|
2630
2636
|
'[data-type="number-input"]'
|
|
2631
|
-
).forEach((
|
|
2632
|
-
const B =
|
|
2633
|
-
(!B || B === "0px" || parseInt(B) < 60) && (
|
|
2637
|
+
).forEach((S) => {
|
|
2638
|
+
const B = S.style.width, A = `${s(S)}px`;
|
|
2639
|
+
(!B || B === "0px" || parseInt(B) < 60) && (S.style.width = A), o.has(S) || (S.addEventListener("input", b, !1), S.addEventListener("keydown", m, !1), o.set(S, b), l.set(S, m));
|
|
2634
2640
|
});
|
|
2635
|
-
},
|
|
2641
|
+
}, g = window.setTimeout(() => {
|
|
2636
2642
|
k();
|
|
2637
|
-
}, 0),
|
|
2638
|
-
let
|
|
2639
|
-
|
|
2640
|
-
B.type === "childList" && B.addedNodes.forEach((
|
|
2641
|
-
if (
|
|
2642
|
-
const j =
|
|
2643
|
-
j.matches && (j.matches('[data-type="number-input"]') || j.querySelector('[data-type="number-input"]')) && (
|
|
2643
|
+
}, 0), G = new MutationObserver((I) => {
|
|
2644
|
+
let S = !1;
|
|
2645
|
+
I.forEach((B) => {
|
|
2646
|
+
B.type === "childList" && B.addedNodes.forEach((A) => {
|
|
2647
|
+
if (A.nodeType === Node.ELEMENT_NODE) {
|
|
2648
|
+
const j = A;
|
|
2649
|
+
j.matches && (j.matches('[data-type="number-input"]') || j.querySelector('[data-type="number-input"]')) && (S = !0);
|
|
2644
2650
|
}
|
|
2645
2651
|
});
|
|
2646
|
-
}),
|
|
2652
|
+
}), S && setTimeout(k, 10);
|
|
2647
2653
|
});
|
|
2648
|
-
return a.current &&
|
|
2654
|
+
return a.current && G.observe(a.current, {
|
|
2649
2655
|
childList: !0,
|
|
2650
2656
|
subtree: !0
|
|
2651
2657
|
}), () => {
|
|
2652
|
-
window.clearTimeout(
|
|
2653
|
-
|
|
2654
|
-
}), o.clear(), l.forEach((
|
|
2655
|
-
|
|
2658
|
+
window.clearTimeout(g), G.disconnect(), o.forEach((I, S) => {
|
|
2659
|
+
S.removeEventListener("input", I, !1);
|
|
2660
|
+
}), o.clear(), l.forEach((I, S) => {
|
|
2661
|
+
S.removeEventListener("keydown", I, !1);
|
|
2656
2662
|
}), l.clear();
|
|
2657
2663
|
};
|
|
2658
|
-
}, [xe]), kn(a, xe, w, D, Ce, ue, void 0,
|
|
2664
|
+
}, [xe]), kn(a, xe, w, D, Ce, ue, void 0, L), $n(a, xe, w, E), En(a, xe, E, L), Sn(a, xe, w, E), Cn(a, xe, E), Tn(a, xe, w, J), qn(a, Y);
|
|
2659
2665
|
const Ue = vn(a);
|
|
2660
2666
|
pe(() => {
|
|
2661
2667
|
if (!a.current) return;
|
|
@@ -2672,26 +2678,26 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: g }) => {
|
|
|
2672
2678
|
}, []);
|
|
2673
2679
|
Le(() => {
|
|
2674
2680
|
if (!r) return;
|
|
2675
|
-
const o =
|
|
2681
|
+
const o = W.current, l = a.current;
|
|
2676
2682
|
if (!(!o || !l)) {
|
|
2677
2683
|
o.scrollTop = 0, o.scrollLeft = 0;
|
|
2678
2684
|
try {
|
|
2679
2685
|
const s = l.getBoundingClientRect(), b = document.createRange();
|
|
2680
2686
|
b.selectNodeContents(l);
|
|
2681
|
-
const
|
|
2687
|
+
const m = Array.from(b.getClientRects());
|
|
2682
2688
|
let k = 58;
|
|
2683
|
-
if (
|
|
2684
|
-
const
|
|
2685
|
-
let
|
|
2686
|
-
for (const
|
|
2687
|
-
Math.abs(
|
|
2688
|
-
|
|
2689
|
+
if (m.length > 0) {
|
|
2690
|
+
const g = Math.min(...m.map((S) => S.top)), G = 2;
|
|
2691
|
+
let I = 0;
|
|
2692
|
+
for (const S of m)
|
|
2693
|
+
Math.abs(S.top - g) <= G && (I = Math.max(I, S.bottom));
|
|
2694
|
+
I > 0 && (k = Math.max(0, Math.ceil(I - s.top)));
|
|
2689
2695
|
} else {
|
|
2690
|
-
const
|
|
2691
|
-
k = Math.max(0, Math.ceil(Math.max(
|
|
2696
|
+
const g = window.getComputedStyle(l), G = Number.parseFloat(g.minHeight) || 0, I = Number.parseFloat(g.paddingTop) || 0, S = Number.parseFloat(g.lineHeight) || 34;
|
|
2697
|
+
k = Math.max(0, Math.ceil(Math.max(G, I + S)));
|
|
2692
2698
|
}
|
|
2693
2699
|
if (!Number.isFinite(k) || k <= 0) return;
|
|
2694
|
-
ye((
|
|
2700
|
+
ye((g) => g === k ? g : k);
|
|
2695
2701
|
} catch {
|
|
2696
2702
|
}
|
|
2697
2703
|
}
|
|
@@ -2728,15 +2734,15 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: g }) => {
|
|
|
2728
2734
|
de(!0);
|
|
2729
2735
|
return;
|
|
2730
2736
|
}
|
|
2731
|
-
const s = a.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "", b = a.current.querySelectorAll('[data-type="variable"]'),
|
|
2737
|
+
const s = a.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "", b = a.current.querySelectorAll('[data-type="variable"]'), m = a.current.querySelectorAll('[data-type="upload"]');
|
|
2732
2738
|
let k = !1;
|
|
2733
|
-
b.forEach((
|
|
2734
|
-
(
|
|
2735
|
-
}),
|
|
2736
|
-
|
|
2739
|
+
b.forEach((G) => {
|
|
2740
|
+
(G.textContent?.replace(/[\u200B\n]/g, "").trim() || "") && (k = !0);
|
|
2741
|
+
}), m.forEach((G) => {
|
|
2742
|
+
G.querySelector(".upload-inner-wrapper.has-file") && (k = !0);
|
|
2737
2743
|
});
|
|
2738
|
-
const
|
|
2739
|
-
de(
|
|
2744
|
+
const g = !s && !k;
|
|
2745
|
+
de(g), t.length === 0 && J(!g);
|
|
2740
2746
|
};
|
|
2741
2747
|
o();
|
|
2742
2748
|
const l = new MutationObserver(o);
|
|
@@ -2758,16 +2764,16 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: g }) => {
|
|
|
2758
2764
|
if (s && s.rangeCount > 0) {
|
|
2759
2765
|
const b = s.anchorNode;
|
|
2760
2766
|
if (b) {
|
|
2761
|
-
let
|
|
2762
|
-
if (b.nodeType === Node.ELEMENT_NODE ?
|
|
2763
|
-
const k =
|
|
2767
|
+
let m = null;
|
|
2768
|
+
if (b.nodeType === Node.ELEMENT_NODE ? m = b.closest('[data-type="variable"]') : b.nodeType === Node.TEXT_NODE && b.parentElement && (m = b.parentElement.closest('[data-type="variable"]')), m) {
|
|
2769
|
+
const k = m.dataset.multiKey;
|
|
2764
2770
|
if (k) {
|
|
2765
|
-
const
|
|
2766
|
-
if (console.log("[Paste Event] 粘贴的内容:", l), console.log("[Paste Event] 拆分后的值:",
|
|
2767
|
-
const
|
|
2768
|
-
|
|
2771
|
+
const g = /[、,,\s\n\r\t]+/, G = l.split(g).map((I) => I.trim()).filter((I) => I.length > 0);
|
|
2772
|
+
if (console.log("[Paste Event] 粘贴的内容:", l), console.log("[Paste Event] 拆分后的值:", G), G.length > 1) {
|
|
2773
|
+
const I = parseInt(m.dataset.index || "0", 10), S = t.find((se) => se.type === "multi-variable" && se.key === k)?.maxCount || 9, B = Ce[k] || 1, A = Math.min(I + G.length, S);
|
|
2774
|
+
A > B && Te((re) => ({
|
|
2769
2775
|
...re,
|
|
2770
|
-
[k]:
|
|
2776
|
+
[k]: A
|
|
2771
2777
|
}));
|
|
2772
2778
|
const j = [];
|
|
2773
2779
|
for (let re = 0; re < B; re++) {
|
|
@@ -2779,9 +2785,9 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: g }) => {
|
|
|
2779
2785
|
j.push(ve);
|
|
2780
2786
|
}
|
|
2781
2787
|
}
|
|
2782
|
-
j.splice(
|
|
2783
|
-
const te = j.slice(0,
|
|
2784
|
-
te.length > 0 && te[te.length - 1] !== "" && te.length <
|
|
2788
|
+
j.splice(I, 1, ...G.slice(0, S - I));
|
|
2789
|
+
const te = j.slice(0, S);
|
|
2790
|
+
te.length > 0 && te[te.length - 1] !== "" && te.length < S && te.push("");
|
|
2785
2791
|
const F = Math.max(te.length, 1), ee = {};
|
|
2786
2792
|
te.forEach((re, se) => {
|
|
2787
2793
|
re && (ee[`${k}_${se}`] = re);
|
|
@@ -2798,7 +2804,7 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: g }) => {
|
|
|
2798
2804
|
[k]: F
|
|
2799
2805
|
})), console.log("[Paste Event] 粘贴完成,已填充到多个输入框,值:", te);
|
|
2800
2806
|
return;
|
|
2801
|
-
} else
|
|
2807
|
+
} else G.length === 1 && console.log("[Paste Event] 粘贴单个值,将在失去焦点时检查是否需要拆分");
|
|
2802
2808
|
}
|
|
2803
2809
|
}
|
|
2804
2810
|
}
|
|
@@ -2806,17 +2812,17 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: g }) => {
|
|
|
2806
2812
|
document.execCommand("insertText", !1, l), mt(), setTimeout(() => {
|
|
2807
2813
|
const b = window.getSelection();
|
|
2808
2814
|
if (b && b.rangeCount > 0) {
|
|
2809
|
-
const
|
|
2810
|
-
if (
|
|
2815
|
+
const m = b.anchorNode;
|
|
2816
|
+
if (m) {
|
|
2811
2817
|
let k = null;
|
|
2812
|
-
if (
|
|
2818
|
+
if (m.nodeType === Node.ELEMENT_NODE ? k = m.closest('[data-type="variable"]') : m.nodeType === Node.TEXT_NODE && m.parentElement && (k = m.parentElement.closest('[data-type="variable"]')), k) {
|
|
2813
2819
|
if ((k.getAttribute("data-node-type") || "") === "report-url") {
|
|
2814
|
-
const
|
|
2815
|
-
|
|
2820
|
+
const G = k.dataset.key, I = k.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
2821
|
+
G && Ye.current(G, I);
|
|
2816
2822
|
}
|
|
2817
2823
|
if (k.dataset.multiKey) {
|
|
2818
|
-
const
|
|
2819
|
-
/[、,,\s]+/.test(
|
|
2824
|
+
const G = k.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
2825
|
+
/[、,,\s]+/.test(G) && (console.log("[Paste Event] 粘贴后检测到分隔符,内容:", G), console.log("[Paste Event] 提示:失去焦点后将自动拆分"));
|
|
2820
2826
|
}
|
|
2821
2827
|
}
|
|
2822
2828
|
}
|
|
@@ -2824,34 +2830,34 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: g }) => {
|
|
|
2824
2830
|
}, 0);
|
|
2825
2831
|
}, qt = (o) => {
|
|
2826
2832
|
if (!o.target.files) {
|
|
2827
|
-
o.target && (o.target.value = ""), d(null),
|
|
2833
|
+
o.target && (o.target.value = ""), d(null), f(null);
|
|
2828
2834
|
return;
|
|
2829
2835
|
}
|
|
2830
|
-
const l = 10 * 1024 * 1024, s = (
|
|
2831
|
-
if (
|
|
2832
|
-
const
|
|
2833
|
-
if (
|
|
2834
|
-
const
|
|
2836
|
+
const l = 10 * 1024 * 1024, s = (m) => m.type?.startsWith("image/") ? !0 : /\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(m.name || ""), b = (m) => s(m) && m.size > l;
|
|
2837
|
+
if (p && o.target.files && o.target.files.length > 0) {
|
|
2838
|
+
const m = p, k = t.find((S) => S.type === "upload" && S.key === m), g = Array.from(o.target.files), G = g.filter((S) => !b(S)), I = g.length - G.length;
|
|
2839
|
+
if (I > 0 && O.error(`已自动过滤 ${I} 张超过 10MB 的图片,仅允许上传 10MB 以内图片`), k && typeof k.maxCount == "number" && typeof k.minCount == "number") {
|
|
2840
|
+
const S = k.maxCount;
|
|
2835
2841
|
let B = 0;
|
|
2836
|
-
|
|
2837
|
-
for (let ee = 0; ee <
|
|
2838
|
-
const le = `${
|
|
2839
|
-
|
|
2842
|
+
U((A) => {
|
|
2843
|
+
for (let ee = 0; ee < S; ee++) {
|
|
2844
|
+
const le = `${m}-${ee}`;
|
|
2845
|
+
A[le] && (B = ee + 1);
|
|
2840
2846
|
}
|
|
2841
|
-
const j =
|
|
2847
|
+
const j = S - B, te = G.slice(0, j), F = { ...A };
|
|
2842
2848
|
return te.forEach((ee, le) => {
|
|
2843
|
-
const re = `${
|
|
2849
|
+
const re = `${m}-${B + le}`;
|
|
2844
2850
|
F[re] = ee;
|
|
2845
2851
|
}), F;
|
|
2846
2852
|
});
|
|
2847
2853
|
}
|
|
2848
2854
|
} else if (z && o.target.files[0]) {
|
|
2849
|
-
const
|
|
2850
|
-
b(
|
|
2855
|
+
const m = o.target.files[0], k = z;
|
|
2856
|
+
b(m) ? O.error("图片大小不能超过 10MB(仅允许上传 10MB 以内图片)") : U((g) => ({ ...g, [k]: m }));
|
|
2851
2857
|
}
|
|
2852
|
-
o.target && (o.target.value = ""), d(null),
|
|
2858
|
+
o.target && (o.target.value = ""), d(null), f(null);
|
|
2853
2859
|
}, ft = (o) => {
|
|
2854
|
-
|
|
2860
|
+
U((l) => {
|
|
2855
2861
|
const s = { ...l };
|
|
2856
2862
|
return delete s[o], s;
|
|
2857
2863
|
});
|
|
@@ -2862,34 +2868,34 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: g }) => {
|
|
|
2862
2868
|
if (l.closest(".tag-close-btn")) {
|
|
2863
2869
|
if (o.preventDefault(), o.stopPropagation(), D)
|
|
2864
2870
|
return;
|
|
2865
|
-
E(null),
|
|
2871
|
+
E(null), N ? N() : a.current && (a.current.innerHTML = "", a.current.focus());
|
|
2866
2872
|
return;
|
|
2867
2873
|
}
|
|
2868
2874
|
if (D) {
|
|
2869
|
-
const
|
|
2870
|
-
if (
|
|
2875
|
+
const m = l.closest(".tag-node"), k = l.closest('[data-type="text"]');
|
|
2876
|
+
if (m || k) {
|
|
2871
2877
|
o.preventDefault(), o.stopPropagation();
|
|
2872
|
-
const
|
|
2873
|
-
|
|
2878
|
+
const g = window.getSelection();
|
|
2879
|
+
g && g.removeAllRanges();
|
|
2874
2880
|
return;
|
|
2875
2881
|
}
|
|
2876
2882
|
}
|
|
2877
|
-
l.closest('[data-type="variable"]') || (
|
|
2883
|
+
l.closest('[data-type="variable"]') || (K.current = { x: o.clientX, y: o.clientY }, Y.current = !1, l.closest(".file-remove-btn") && (o.preventDefault(), o.stopPropagation()));
|
|
2878
2884
|
}, At = (o) => {
|
|
2879
|
-
if (!o.target.closest('[data-type="variable"]') &&
|
|
2880
|
-
const b = Math.abs(o.clientX -
|
|
2881
|
-
(b > 3 ||
|
|
2885
|
+
if (!o.target.closest('[data-type="variable"]') && K.current) {
|
|
2886
|
+
const b = Math.abs(o.clientX - K.current.x), m = Math.abs(o.clientY - K.current.y);
|
|
2887
|
+
(b > 3 || m > 3) && (Y.current = !0);
|
|
2882
2888
|
}
|
|
2883
2889
|
}, _t = (o) => {
|
|
2884
2890
|
if (o.target.closest('[data-type="variable"]')) {
|
|
2885
|
-
|
|
2891
|
+
K.current = null, Y.current = !1;
|
|
2886
2892
|
return;
|
|
2887
2893
|
}
|
|
2888
|
-
|
|
2894
|
+
K.current = null, Y.current = !1;
|
|
2889
2895
|
}, Lt = (o) => {
|
|
2890
2896
|
if (c)
|
|
2891
2897
|
return;
|
|
2892
|
-
r &&
|
|
2898
|
+
r && x?.(!1);
|
|
2893
2899
|
const l = o.target;
|
|
2894
2900
|
if (l.closest('[data-type="datepicker"]'))
|
|
2895
2901
|
return;
|
|
@@ -2899,10 +2905,10 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: g }) => {
|
|
|
2899
2905
|
}
|
|
2900
2906
|
if (t.length === 0)
|
|
2901
2907
|
return;
|
|
2902
|
-
const
|
|
2908
|
+
const m = (A, j) => {
|
|
2903
2909
|
if (!a.current) return;
|
|
2904
2910
|
Array.from(a.current.children).forEach((F) => {
|
|
2905
|
-
if (F !==
|
|
2911
|
+
if (F !== A)
|
|
2906
2912
|
if (j)
|
|
2907
2913
|
F.dataset.prevDisplay === void 0 && (F.dataset.prevDisplay = F.style.display || ""), F.dataset.rteForceHidden = "1", F.style.setProperty("display", "none", "important");
|
|
2908
2914
|
else {
|
|
@@ -2917,10 +2923,10 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: g }) => {
|
|
|
2917
2923
|
}, k = l.closest(".rte-textarea-toggle");
|
|
2918
2924
|
if (k) {
|
|
2919
2925
|
o.preventDefault(), o.stopPropagation();
|
|
2920
|
-
const
|
|
2921
|
-
k.setAttribute("data-expanded", String(F)), k.textContent = F ? "收起" : "展开",
|
|
2922
|
-
const ee =
|
|
2923
|
-
if (ee ? ee.classList.toggle("rte-textarea-overlay", F) :
|
|
2926
|
+
const A = k.closest(".rte-textarea-wrapper"), j = A?.querySelector('[data-type="textarea"]'), F = !(k.getAttribute("data-expanded") === "true");
|
|
2927
|
+
k.setAttribute("data-expanded", String(F)), k.textContent = F ? "收起" : "展开", A && A.classList.toggle("rte-textarea-expanded", F);
|
|
2928
|
+
const ee = A?.closest(".rte-textarea-required");
|
|
2929
|
+
if (ee ? ee.classList.toggle("rte-textarea-overlay", F) : A && A.classList.toggle("rte-textarea-overlay", F), j)
|
|
2924
2930
|
if (F)
|
|
2925
2931
|
j.classList.add("rte-textarea-expanded"), j.style.maxHeight = "none", j.style.height = "100%";
|
|
2926
2932
|
else {
|
|
@@ -2931,17 +2937,17 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: g }) => {
|
|
|
2931
2937
|
a.current && (F ? a.current.classList.add("rte-overlay-active") : a.current.classList.remove("rte-overlay-active"));
|
|
2932
2938
|
return;
|
|
2933
2939
|
}
|
|
2934
|
-
const
|
|
2935
|
-
if (
|
|
2940
|
+
const g = l.closest(".rte-richtext-toggle");
|
|
2941
|
+
if (g) {
|
|
2936
2942
|
o.preventDefault(), o.stopPropagation();
|
|
2937
|
-
const
|
|
2943
|
+
const A = g.closest(".rte-richtext-wrapper"), j = A?.querySelector('[data-type="richtext"]'), F = !(g.getAttribute("data-expanded") === "true");
|
|
2938
2944
|
((se, me) => {
|
|
2939
2945
|
se.setAttribute("data-expanded", String(me)), se.innerHTML = me ? '<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>';
|
|
2940
|
-
})(
|
|
2941
|
-
const le =
|
|
2942
|
-
le ? le.classList.toggle("rte-richtext-expanded", F) :
|
|
2943
|
-
const re =
|
|
2944
|
-
if (j && (F ? (j.style.height = "100%", j.style.overflow = "auto") : (j.style.height = "", j.style.overflow = "")), re && (re.classList.toggle("rte-richtext-host-expanded", F),
|
|
2946
|
+
})(g, F);
|
|
2947
|
+
const le = A?.closest(".rte-richtext-required");
|
|
2948
|
+
le ? le.classList.toggle("rte-richtext-expanded", F) : A && A.classList.toggle("rte-richtext-expanded", F);
|
|
2949
|
+
const re = A?.closest(".exclusion-wrapper") || A?.parentElement;
|
|
2950
|
+
if (j && (F ? (j.style.height = "100%", j.style.overflow = "auto") : (j.style.height = "", j.style.overflow = "")), re && (re.classList.toggle("rte-richtext-host-expanded", F), m(re, F)), a.current) {
|
|
2945
2951
|
if (a.current.classList.toggle("rte-richtext-fullscreen-active", F), Q.current?.classList.toggle("rte-richtext-container-expanded", F), Q.current)
|
|
2946
2952
|
if (F) {
|
|
2947
2953
|
const se = Math.ceil(Q.current.getBoundingClientRect().height || 0);
|
|
@@ -2963,8 +2969,8 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: g }) => {
|
|
|
2963
2969
|
}
|
|
2964
2970
|
if (l.closest('[data-type="text"]')) {
|
|
2965
2971
|
o.preventDefault(), o.stopPropagation();
|
|
2966
|
-
const
|
|
2967
|
-
|
|
2972
|
+
const A = window.getSelection();
|
|
2973
|
+
A && A.removeAllRanges();
|
|
2968
2974
|
return;
|
|
2969
2975
|
}
|
|
2970
2976
|
if (D && l.closest(".tag-node")) {
|
|
@@ -2977,21 +2983,21 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: g }) => {
|
|
|
2977
2983
|
if (Y.current)
|
|
2978
2984
|
return;
|
|
2979
2985
|
setTimeout(() => {
|
|
2980
|
-
const
|
|
2981
|
-
|
|
2986
|
+
const A = window.getSelection();
|
|
2987
|
+
A && !A.isCollapsed || Ze(a);
|
|
2982
2988
|
}, 10);
|
|
2983
2989
|
return;
|
|
2984
2990
|
}
|
|
2985
|
-
const
|
|
2986
|
-
if (
|
|
2991
|
+
const S = l.closest(".file-remove-btn");
|
|
2992
|
+
if (S) {
|
|
2987
2993
|
o.preventDefault(), o.stopPropagation();
|
|
2988
|
-
const
|
|
2994
|
+
const A = S.closest('[data-type="upload"]'), j = A?.dataset.key, te = A?.dataset.batchKey;
|
|
2989
2995
|
if (j)
|
|
2990
2996
|
if (te) {
|
|
2991
2997
|
const F = t.find((ee) => ee.type === "upload" && ee.key === te);
|
|
2992
2998
|
if (F && typeof F.maxCount == "number" && typeof F.minCount == "number") {
|
|
2993
2999
|
const ee = F.maxCount;
|
|
2994
|
-
|
|
3000
|
+
U((le) => {
|
|
2995
3001
|
const re = { ...le }, se = [];
|
|
2996
3002
|
for (let me = 0; me < ee; me++) {
|
|
2997
3003
|
const ve = `${te}-${me}`, Se = re[ve];
|
|
@@ -3011,9 +3017,9 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: g }) => {
|
|
|
3011
3017
|
}
|
|
3012
3018
|
const B = l.closest('[data-type="upload"]');
|
|
3013
3019
|
if (B) {
|
|
3014
|
-
const
|
|
3015
|
-
if (
|
|
3016
|
-
const te = j ||
|
|
3020
|
+
const A = B.dataset.key, j = B.dataset.batchKey;
|
|
3021
|
+
if (A) {
|
|
3022
|
+
const te = j || A, F = t.find((ee) => ee.type === "upload" && ee.key === te);
|
|
3017
3023
|
if (V.current && (F?.accept ? V.current.accept = F.accept : F?.acceptType === "image" ? V.current.accept = "image/*" : F?.acceptType === "file" ? V.current.accept = ".csv,.xlsx,.xls,.txt,.pdf,.doc,.docx,.json" : V.current.accept = ""), j) {
|
|
3018
3024
|
const ee = t.find((le) => le.type === "upload" && le.key === j);
|
|
3019
3025
|
if (ee && typeof ee.maxCount == "number" && typeof ee.minCount == "number") {
|
|
@@ -3021,28 +3027,28 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: g }) => {
|
|
|
3021
3027
|
let re = 0;
|
|
3022
3028
|
for (let se = 0; se < le; se++)
|
|
3023
3029
|
w[`${j}-${se}`] != null && (re += 1);
|
|
3024
|
-
re < le && V.current ? (V.current.multiple = !0,
|
|
3030
|
+
re < le && V.current ? (V.current.multiple = !0, f(j), V.current.click()) : (V.current && (V.current.multiple = !1), d(A), V.current?.click());
|
|
3025
3031
|
} else
|
|
3026
|
-
V.current && (V.current.multiple = !1), d(
|
|
3032
|
+
V.current && (V.current.multiple = !1), d(A), V.current?.click();
|
|
3027
3033
|
} else
|
|
3028
|
-
V.current && (V.current.multiple = !1), d(
|
|
3034
|
+
V.current && (V.current.multiple = !1), d(A), V.current?.click();
|
|
3029
3035
|
}
|
|
3030
3036
|
return;
|
|
3031
3037
|
}
|
|
3032
|
-
},
|
|
3038
|
+
}, It = (o) => {
|
|
3033
3039
|
const s = o.target.closest('[data-type="variable"]');
|
|
3034
3040
|
if (s) {
|
|
3035
3041
|
const b = window.getSelection();
|
|
3036
3042
|
if (b) {
|
|
3037
|
-
const
|
|
3043
|
+
const m = document.createRange(), k = s.textContent || "";
|
|
3038
3044
|
if (k.replace(/\u200B/g, "")) {
|
|
3039
|
-
let
|
|
3040
|
-
k.startsWith("") && (
|
|
3041
|
-
const
|
|
3042
|
-
|
|
3045
|
+
let G = 0, I = k.length;
|
|
3046
|
+
k.startsWith("") && (G = 1), k.endsWith("") && k.length > 1 && (I = k.length - 1);
|
|
3047
|
+
const S = s.firstChild;
|
|
3048
|
+
S && S.nodeType === Node.TEXT_NODE ? (m.setStart(S, G), m.setEnd(S, I)) : m.selectNodeContents(s);
|
|
3043
3049
|
} else
|
|
3044
|
-
|
|
3045
|
-
b.removeAllRanges(), b.addRange(
|
|
3050
|
+
m.selectNodeContents(s), m.collapse(!0);
|
|
3051
|
+
b.removeAllRanges(), b.addRange(m);
|
|
3046
3052
|
}
|
|
3047
3053
|
}
|
|
3048
3054
|
}, mt = () => {
|
|
@@ -3058,9 +3064,9 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: g }) => {
|
|
|
3058
3064
|
).forEach((s) => {
|
|
3059
3065
|
const b = s.dataset.key;
|
|
3060
3066
|
if (!b) return;
|
|
3061
|
-
s.innerText.replace(/[\u200B\n]/g, "").trim() ||
|
|
3062
|
-
const
|
|
3063
|
-
return !
|
|
3067
|
+
s.innerText.replace(/[\u200B\n]/g, "").trim() || Ie((k) => {
|
|
3068
|
+
const g = k[b];
|
|
3069
|
+
return !g || g.status === "idle" && (!g.modules || g.modules.length === 0) ? k : {
|
|
3064
3070
|
...k,
|
|
3065
3071
|
[b]: { status: "idle", modules: [], lastParsedUrl: void 0, error: void 0 }
|
|
3066
3072
|
};
|
|
@@ -3068,47 +3074,47 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: g }) => {
|
|
|
3068
3074
|
}), a.current && a.current.querySelectorAll('[data-type="variable"]').forEach((s) => {
|
|
3069
3075
|
const b = s.querySelector(".variable-info-icon");
|
|
3070
3076
|
if (b) {
|
|
3071
|
-
let
|
|
3077
|
+
let m = !1;
|
|
3072
3078
|
const k = document.createTreeWalker(
|
|
3073
3079
|
s,
|
|
3074
3080
|
NodeFilter.SHOW_TEXT,
|
|
3075
3081
|
{
|
|
3076
|
-
acceptNode: (
|
|
3082
|
+
acceptNode: (g) => b.contains(g) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT
|
|
3077
3083
|
}
|
|
3078
3084
|
);
|
|
3079
3085
|
for (; k.nextNode(); )
|
|
3080
3086
|
if (k.currentNode.textContent?.replace(/[\u200B\n]/g, "").trim()) {
|
|
3081
|
-
|
|
3087
|
+
m = !0;
|
|
3082
3088
|
break;
|
|
3083
3089
|
}
|
|
3084
|
-
|
|
3090
|
+
m ? b.classList.add("hidden") : b.classList.remove("hidden");
|
|
3085
3091
|
}
|
|
3086
3092
|
}), r || window.requestAnimationFrame(() => {
|
|
3087
3093
|
Xe();
|
|
3088
3094
|
}), et(a, xe, w), tt(a, xe, w, J), !a.current) return;
|
|
3089
3095
|
t.filter((l) => l.type === "multi-variable" && l.key).forEach((l) => {
|
|
3090
3096
|
if (!l.key) return;
|
|
3091
|
-
const s = l.maxCount || 9, b = Ce[l.key] || 1,
|
|
3092
|
-
for (let
|
|
3093
|
-
const B = `${l.key}_${
|
|
3097
|
+
const s = l.maxCount || 9, b = Ce[l.key] || 1, m = [];
|
|
3098
|
+
for (let S = 0; S < b; S++) {
|
|
3099
|
+
const B = `${l.key}_${S}`, A = a.current.querySelector(
|
|
3094
3100
|
`[data-type="variable"][data-key="${B}"][data-multi-key="${l.key}"]`
|
|
3095
3101
|
);
|
|
3096
|
-
if (
|
|
3097
|
-
const j =
|
|
3098
|
-
|
|
3102
|
+
if (A) {
|
|
3103
|
+
const j = A.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
3104
|
+
m.push(j);
|
|
3099
3105
|
}
|
|
3100
3106
|
}
|
|
3101
|
-
const
|
|
3102
|
-
let
|
|
3103
|
-
for (let
|
|
3104
|
-
if (
|
|
3105
|
-
|
|
3107
|
+
const g = (m[m.length - 1] || "") === "";
|
|
3108
|
+
let G = !1, I = -1;
|
|
3109
|
+
for (let S = 0; S < m.length - 1; S++)
|
|
3110
|
+
if (m[S] === "") {
|
|
3111
|
+
G = !0, I = S;
|
|
3106
3112
|
break;
|
|
3107
3113
|
}
|
|
3108
|
-
if (
|
|
3109
|
-
const
|
|
3110
|
-
if (
|
|
3111
|
-
const F =
|
|
3114
|
+
if (G && I >= 0) {
|
|
3115
|
+
const S = window.getSelection();
|
|
3116
|
+
if (S && S.rangeCount > 0) {
|
|
3117
|
+
const F = S.getRangeAt(0), ee = F.startContainer, le = ee.nodeType === Node.ELEMENT_NODE ? ee.closest('[data-type="variable"][data-multi-key]') : ee.parentElement?.closest('[data-type="variable"][data-multi-key]');
|
|
3112
3118
|
if (le) {
|
|
3113
3119
|
const re = le.dataset.key;
|
|
3114
3120
|
if (re) {
|
|
@@ -3119,34 +3125,34 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: g }) => {
|
|
|
3119
3125
|
}
|
|
3120
3126
|
}
|
|
3121
3127
|
}
|
|
3122
|
-
const B = [...
|
|
3123
|
-
for (let F =
|
|
3128
|
+
const B = [...m];
|
|
3129
|
+
for (let F = I; F < B.length - 1; F++)
|
|
3124
3130
|
B[F] = B[F + 1];
|
|
3125
3131
|
B.pop();
|
|
3126
|
-
const
|
|
3132
|
+
const A = {};
|
|
3127
3133
|
B.forEach((F, ee) => {
|
|
3128
|
-
F && (
|
|
3134
|
+
F && (A[`${l.key}_${ee}`] = F);
|
|
3129
3135
|
});
|
|
3130
|
-
const j = Math.max(
|
|
3136
|
+
const j = Math.max(g ? B.length : B.length + 1, 1);
|
|
3131
3137
|
a.current.querySelectorAll(
|
|
3132
3138
|
'[data-type="variable"]'
|
|
3133
3139
|
).forEach((F) => {
|
|
3134
3140
|
const ee = F.dataset.key, le = F.dataset.multiKey;
|
|
3135
3141
|
if (ee && le !== l.key) {
|
|
3136
3142
|
const re = F.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
3137
|
-
re && (
|
|
3143
|
+
re && (A[ee] = re);
|
|
3138
3144
|
}
|
|
3139
|
-
}), a.current.__tempVariableValues =
|
|
3145
|
+
}), a.current.__tempVariableValues = A, Te((F) => ({
|
|
3140
3146
|
...F,
|
|
3141
3147
|
[l.key]: j
|
|
3142
3148
|
}));
|
|
3143
3149
|
return;
|
|
3144
3150
|
}
|
|
3145
|
-
if (!
|
|
3146
|
-
const
|
|
3151
|
+
if (!g) {
|
|
3152
|
+
const S = b - 1, B = `${l.key}_${S}`, A = a.current.querySelector(
|
|
3147
3153
|
`[data-type="variable"][data-key="${B}"][data-multi-key="${l.key}"]`
|
|
3148
3154
|
);
|
|
3149
|
-
if (
|
|
3155
|
+
if (A && A.innerText.replace(/[\u200B\n]/g, "").trim().length > 0 && b < s) {
|
|
3150
3156
|
const te = window.getSelection();
|
|
3151
3157
|
if (te && te.rangeCount > 0) {
|
|
3152
3158
|
const F = te.getRangeAt(0), ee = F.startContainer, le = ee.nodeType === Node.ELEMENT_NODE ? ee.closest('[data-type="variable"][data-multi-key]') : ee.parentElement?.closest('[data-type="variable"][data-multi-key]');
|
|
@@ -3172,12 +3178,12 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: g }) => {
|
|
|
3172
3178
|
const o = a.current;
|
|
3173
3179
|
if (!o) return;
|
|
3174
3180
|
const l = /* @__PURE__ */ new Map(), s = (k) => {
|
|
3175
|
-
const
|
|
3176
|
-
!
|
|
3181
|
+
const g = k.target, G = k.relatedTarget;
|
|
3182
|
+
!g || !a.current || !a.current.contains(g) || G && a.current.contains(G) || setTimeout(() => {
|
|
3177
3183
|
if (a.current) {
|
|
3178
3184
|
if (t.length === 0) {
|
|
3179
|
-
const
|
|
3180
|
-
J(
|
|
3185
|
+
const I = a.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "";
|
|
3186
|
+
J(I.length > 0);
|
|
3181
3187
|
return;
|
|
3182
3188
|
}
|
|
3183
3189
|
Ze(a), et(a, xe, w), tt(a, xe, w, J);
|
|
@@ -3187,32 +3193,32 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: g }) => {
|
|
|
3187
3193
|
o.addEventListener("blur", s, !0);
|
|
3188
3194
|
const b = () => {
|
|
3189
3195
|
if (!a.current) return;
|
|
3190
|
-
l.forEach((
|
|
3191
|
-
|
|
3196
|
+
l.forEach((G, I) => {
|
|
3197
|
+
I.removeEventListener("blur", G, !1);
|
|
3192
3198
|
}), l.clear();
|
|
3193
3199
|
const k = a.current.querySelectorAll(
|
|
3194
3200
|
'[data-type="variable"][data-multi-key]'
|
|
3195
|
-
),
|
|
3196
|
-
|
|
3197
|
-
const
|
|
3198
|
-
if (!
|
|
3201
|
+
), g = (G) => {
|
|
3202
|
+
G.stopPropagation(), G.stopImmediatePropagation();
|
|
3203
|
+
const I = G.target;
|
|
3204
|
+
if (!I || !a.current || !a.current.contains(I))
|
|
3199
3205
|
return;
|
|
3200
|
-
const
|
|
3201
|
-
if (!
|
|
3206
|
+
const S = I.closest('[data-type="variable"][data-multi-key]');
|
|
3207
|
+
if (!S || !a.current.contains(S))
|
|
3202
3208
|
return;
|
|
3203
3209
|
let B = !1;
|
|
3204
3210
|
if (l.forEach((se, me) => {
|
|
3205
|
-
(me ===
|
|
3211
|
+
(me === S || me.contains(I)) && (B = !0);
|
|
3206
3212
|
}), !B)
|
|
3207
3213
|
return;
|
|
3208
|
-
const
|
|
3209
|
-
if (!
|
|
3210
|
-
const F =
|
|
3214
|
+
const A = S.dataset.multiKey, j = S.dataset.key, te = S.dataset.index;
|
|
3215
|
+
if (!A || !j || te === void 0) return;
|
|
3216
|
+
const F = G.relatedTarget;
|
|
3211
3217
|
if (!(!F || !a.current.contains(F)))
|
|
3212
3218
|
return;
|
|
3213
|
-
const le =
|
|
3219
|
+
const le = S.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
3214
3220
|
console.log("[Blur Event] 失去焦点的 multi-variable 输入框:", {
|
|
3215
|
-
multiKey:
|
|
3221
|
+
multiKey: A,
|
|
3216
3222
|
currentKey: j,
|
|
3217
3223
|
index: te,
|
|
3218
3224
|
content: le
|
|
@@ -3223,12 +3229,12 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: g }) => {
|
|
|
3223
3229
|
console.log("[Blur Event] 拆分前的内容:", le), console.log("[Blur Event] 拆分后的部分:", se);
|
|
3224
3230
|
const ve = se.slice(0, 9);
|
|
3225
3231
|
if (console.log("[Blur Event] 有效的部分(最多9个):", ve), ve.length > 1) {
|
|
3226
|
-
const Se = t.find((De) => De.type === "multi-variable" && De.key ===
|
|
3232
|
+
const Se = t.find((De) => De.type === "multi-variable" && De.key === A);
|
|
3227
3233
|
if (Se) {
|
|
3228
|
-
const De = Ce[
|
|
3234
|
+
const De = Ce[A] || 1, yt = parseInt(te, 10), ht = Se.maxCount || 9, Pe = [];
|
|
3229
3235
|
for (let we = 0; we < De; we++) {
|
|
3230
|
-
const _e = `${
|
|
3231
|
-
`[data-type="variable"][data-key="${_e}"][data-multi-key="${
|
|
3236
|
+
const _e = `${A}_${we}`, Be = a.current.querySelector(
|
|
3237
|
+
`[data-type="variable"][data-key="${_e}"][data-multi-key="${A}"]`
|
|
3232
3238
|
);
|
|
3233
3239
|
if (Be) {
|
|
3234
3240
|
const He = Be.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
@@ -3240,36 +3246,36 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: g }) => {
|
|
|
3240
3246
|
console.log("[Blur Event] 拆分后的所有值:", qe), qe.length > 0 && qe[qe.length - 1] !== "" && qe.length < ht && qe.push("");
|
|
3241
3247
|
const Ot = Math.max(qe.length, 1), Je = {};
|
|
3242
3248
|
qe.forEach((we, _e) => {
|
|
3243
|
-
we && (Je[`${
|
|
3249
|
+
we && (Je[`${A}_${_e}`] = we);
|
|
3244
3250
|
}), a.current.querySelectorAll(
|
|
3245
3251
|
'[data-type="variable"]'
|
|
3246
3252
|
).forEach((we) => {
|
|
3247
3253
|
const _e = we.dataset.key, Be = we.dataset.multiKey;
|
|
3248
|
-
if (_e && Be !==
|
|
3254
|
+
if (_e && Be !== A) {
|
|
3249
3255
|
const He = we.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
3250
3256
|
He && (Je[_e] = He);
|
|
3251
3257
|
}
|
|
3252
3258
|
}), a.current.__tempVariableValues = Je, Te((we) => ({
|
|
3253
3259
|
...we,
|
|
3254
|
-
[
|
|
3260
|
+
[A]: Ot
|
|
3255
3261
|
}));
|
|
3256
3262
|
}
|
|
3257
3263
|
}
|
|
3258
3264
|
}
|
|
3259
3265
|
};
|
|
3260
|
-
k.forEach((
|
|
3261
|
-
|
|
3266
|
+
k.forEach((G) => {
|
|
3267
|
+
G.addEventListener("blur", g, !1), l.set(G, g);
|
|
3262
3268
|
});
|
|
3263
|
-
},
|
|
3269
|
+
}, m = setTimeout(() => {
|
|
3264
3270
|
b();
|
|
3265
3271
|
}, 0);
|
|
3266
3272
|
return () => {
|
|
3267
|
-
clearTimeout(
|
|
3268
|
-
|
|
3273
|
+
clearTimeout(m), o.removeEventListener("blur", s, !0), l.forEach((k, g) => {
|
|
3274
|
+
g.removeEventListener("blur", k, !1);
|
|
3269
3275
|
}), l.clear();
|
|
3270
3276
|
};
|
|
3271
3277
|
}, [t, xe, Ce, w]);
|
|
3272
|
-
const
|
|
3278
|
+
const Mt = (o) => {
|
|
3273
3279
|
if (c) {
|
|
3274
3280
|
o.preventDefault();
|
|
3275
3281
|
return;
|
|
@@ -3284,10 +3290,10 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: g }) => {
|
|
|
3284
3290
|
let b = null;
|
|
3285
3291
|
if (s && (s.nodeType === Node.ELEMENT_NODE ? b = s.closest('[data-type="text"]') : s.nodeType === Node.TEXT_NODE && s.parentElement && (b = s.parentElement.closest('[data-type="text"]'))), b) {
|
|
3286
3292
|
if (o.preventDefault(), o.stopPropagation(), a.current) {
|
|
3287
|
-
const
|
|
3293
|
+
const m = a.current.querySelector(
|
|
3288
3294
|
'[data-type="variable"], [data-type="upload"]'
|
|
3289
3295
|
);
|
|
3290
|
-
|
|
3296
|
+
m && m.focus();
|
|
3291
3297
|
}
|
|
3292
3298
|
return;
|
|
3293
3299
|
}
|
|
@@ -3297,10 +3303,10 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: g }) => {
|
|
|
3297
3303
|
let b = null;
|
|
3298
3304
|
if (s && (s.nodeType === Node.ELEMENT_NODE ? b = s.closest(".tag-node") : s.nodeType === Node.TEXT_NODE && s.parentElement && (b = s.parentElement.closest(".tag-node"))), b) {
|
|
3299
3305
|
if (o.preventDefault(), o.stopPropagation(), a.current) {
|
|
3300
|
-
const
|
|
3306
|
+
const m = a.current.querySelector(
|
|
3301
3307
|
'[data-type="variable"], [data-type="upload"]'
|
|
3302
3308
|
);
|
|
3303
|
-
|
|
3309
|
+
m && m.focus();
|
|
3304
3310
|
}
|
|
3305
3311
|
return;
|
|
3306
3312
|
}
|
|
@@ -3315,24 +3321,24 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: g }) => {
|
|
|
3315
3321
|
if (o.key === "Backspace") {
|
|
3316
3322
|
const s = window.getSelection();
|
|
3317
3323
|
if (s && s.rangeCount > 0) {
|
|
3318
|
-
const b = s.getRangeAt(0),
|
|
3324
|
+
const b = s.getRangeAt(0), m = s.anchorNode;
|
|
3319
3325
|
if (D) {
|
|
3320
|
-
let
|
|
3321
|
-
if (
|
|
3326
|
+
let g = null, G = null;
|
|
3327
|
+
if (m && (m.nodeType === Node.ELEMENT_NODE ? (g = m.closest(".tag-node"), G = m.closest('[data-type="text"]')) : m.nodeType === Node.TEXT_NODE && m.parentElement && (g = m.parentElement.closest(".tag-node"), G = m.parentElement.closest('[data-type="text"]'))), (g || G) && b.collapsed && b.startOffset === 0) {
|
|
3322
3328
|
o.preventDefault();
|
|
3323
3329
|
return;
|
|
3324
3330
|
}
|
|
3325
3331
|
}
|
|
3326
3332
|
let k = null;
|
|
3327
|
-
if (
|
|
3333
|
+
if (m && (m.nodeType === Node.ELEMENT_NODE ? k = m.closest(
|
|
3328
3334
|
'[data-type="variable"]'
|
|
3329
|
-
) :
|
|
3335
|
+
) : m.nodeType === Node.TEXT_NODE && m.parentElement && (k = m.parentElement.closest(
|
|
3330
3336
|
'[data-type="variable"]'
|
|
3331
3337
|
))), k) {
|
|
3332
3338
|
if (!b.collapsed)
|
|
3333
3339
|
return;
|
|
3334
|
-
const
|
|
3335
|
-
if (
|
|
3340
|
+
const g = k.innerText;
|
|
3341
|
+
if (g === "" || g === "") {
|
|
3336
3342
|
o.preventDefault();
|
|
3337
3343
|
return;
|
|
3338
3344
|
}
|
|
@@ -3340,7 +3346,7 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: g }) => {
|
|
|
3340
3346
|
o.preventDefault();
|
|
3341
3347
|
return;
|
|
3342
3348
|
}
|
|
3343
|
-
if (
|
|
3349
|
+
if (g.startsWith("") && b.startOffset === 1) {
|
|
3344
3350
|
o.preventDefault();
|
|
3345
3351
|
return;
|
|
3346
3352
|
}
|
|
@@ -3348,14 +3354,14 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: g }) => {
|
|
|
3348
3354
|
}
|
|
3349
3355
|
}
|
|
3350
3356
|
}, Dt = () => {
|
|
3351
|
-
if (u || c ||
|
|
3357
|
+
if (u || c || T || !Z || !a.current) return;
|
|
3352
3358
|
if (t.length === 0) {
|
|
3353
3359
|
const k = a.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "";
|
|
3354
3360
|
if (!k) return;
|
|
3355
|
-
if (
|
|
3361
|
+
if (h(k, k), a.current) {
|
|
3356
3362
|
a.current.textContent = "";
|
|
3357
|
-
const
|
|
3358
|
-
a.current.dispatchEvent(
|
|
3363
|
+
const g = new Event("input", { bubbles: !0 });
|
|
3364
|
+
a.current.dispatchEvent(g);
|
|
3359
3365
|
}
|
|
3360
3366
|
return;
|
|
3361
3367
|
}
|
|
@@ -3366,106 +3372,106 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: g }) => {
|
|
|
3366
3372
|
if (k.nodeType === Node.TEXT_NODE)
|
|
3367
3373
|
l += (k.textContent || "").replace(/\u200B/g, "");
|
|
3368
3374
|
else if (k.nodeType === Node.ELEMENT_NODE) {
|
|
3369
|
-
const
|
|
3370
|
-
if (
|
|
3371
|
-
let
|
|
3375
|
+
const g = k, G = g.dataset.type, I = g.dataset.key;
|
|
3376
|
+
if (G === "variable" && I) {
|
|
3377
|
+
let S = "";
|
|
3372
3378
|
const B = document.createTreeWalker(
|
|
3373
|
-
|
|
3379
|
+
g,
|
|
3374
3380
|
NodeFilter.SHOW_TEXT,
|
|
3375
3381
|
{
|
|
3376
3382
|
acceptNode: (j) => {
|
|
3377
|
-
const te =
|
|
3383
|
+
const te = g.querySelector(".variable-info-icon");
|
|
3378
3384
|
return te && te.contains(j) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT;
|
|
3379
3385
|
}
|
|
3380
3386
|
}
|
|
3381
3387
|
);
|
|
3382
3388
|
for (; B.nextNode(); )
|
|
3383
|
-
|
|
3384
|
-
const
|
|
3385
|
-
if (
|
|
3386
|
-
const j =
|
|
3389
|
+
S += B.currentNode.textContent || "";
|
|
3390
|
+
const A = S.replace(/[\u200B\n]/g, "").trim();
|
|
3391
|
+
if (A) {
|
|
3392
|
+
const j = g.dataset.multiKey;
|
|
3387
3393
|
if (j) {
|
|
3388
3394
|
(!s[j] || !Array.isArray(s[j])) && (s[j] = []);
|
|
3389
3395
|
const te = s[j];
|
|
3390
|
-
te.push(
|
|
3396
|
+
te.push(A), te.length > 1 && (l += " "), l += A;
|
|
3391
3397
|
} else
|
|
3392
|
-
s[
|
|
3393
|
-
if (
|
|
3398
|
+
s[I] = A, l += A;
|
|
3399
|
+
if (g.dataset.nodeType === "report-url")
|
|
3394
3400
|
if (s.url === void 0)
|
|
3395
|
-
s.url =
|
|
3401
|
+
s.url = A;
|
|
3396
3402
|
else {
|
|
3397
3403
|
const te = s.url;
|
|
3398
|
-
Array.isArray(te) ? te.push(
|
|
3404
|
+
Array.isArray(te) ? te.push(A) : s.url = [String(te), A];
|
|
3399
3405
|
}
|
|
3400
3406
|
}
|
|
3401
|
-
} else if (
|
|
3402
|
-
const
|
|
3403
|
-
|
|
3404
|
-
} else if (
|
|
3405
|
-
const B = (
|
|
3406
|
-
B && (s[
|
|
3407
|
-
} else if (
|
|
3408
|
-
const
|
|
3409
|
-
if (
|
|
3407
|
+
} else if (G === "select" && I) {
|
|
3408
|
+
const S = (g.getAttribute("data-value") || "").trim();
|
|
3409
|
+
S && (s[I] = S, l += S);
|
|
3410
|
+
} else if (G === "textarea" && I) {
|
|
3411
|
+
const B = (g.value || "").replace(/\u200B/g, "").trim();
|
|
3412
|
+
B && (s[I] = B, l += B);
|
|
3413
|
+
} else if (G === "richtext" && I) {
|
|
3414
|
+
const S = g, B = S.dataset.nodeType, A = (S.textContent || "").replace(/\u200B/g, "").trim();
|
|
3415
|
+
if (A)
|
|
3410
3416
|
if (B === "report-module") {
|
|
3411
|
-
(!s[
|
|
3412
|
-
const j = s[
|
|
3413
|
-
j.push(
|
|
3417
|
+
(!s[I] || !Array.isArray(s[I])) && (s[I] = []);
|
|
3418
|
+
const j = s[I];
|
|
3419
|
+
j.push(A), j.length > 1 && (l += " "), l += A;
|
|
3414
3420
|
} else
|
|
3415
|
-
s[
|
|
3416
|
-
} else if (
|
|
3417
|
-
const B = (
|
|
3421
|
+
s[I] = A, l += A;
|
|
3422
|
+
} else if (G === "datepicker" && I) {
|
|
3423
|
+
const B = (g.getAttribute("data-value") || "").trim();
|
|
3418
3424
|
if (B)
|
|
3419
3425
|
if (B.includes(",")) {
|
|
3420
|
-
const
|
|
3421
|
-
|
|
3426
|
+
const A = B.split(",");
|
|
3427
|
+
A.length === 2 ? (s[I] = A, l += `[${A[0]}, ${A[1]}]`) : (s[I] = B, l += B);
|
|
3422
3428
|
} else
|
|
3423
|
-
s[
|
|
3424
|
-
} else if (
|
|
3425
|
-
const B = (
|
|
3426
|
-
B && (s[
|
|
3427
|
-
} else if (
|
|
3428
|
-
const
|
|
3429
|
-
if (
|
|
3430
|
-
const B = t.find((
|
|
3429
|
+
s[I] = B, l += B;
|
|
3430
|
+
} else if (G === "number-input" && I) {
|
|
3431
|
+
const B = (g.value || "").trim();
|
|
3432
|
+
B && (s[I] = B, l += B);
|
|
3433
|
+
} else if (G === "upload" && I) {
|
|
3434
|
+
const S = g.dataset.batchKey;
|
|
3435
|
+
if (S) {
|
|
3436
|
+
const B = t.find((A) => A.type === "upload" && A.key === S);
|
|
3431
3437
|
if (B && typeof B.maxCount == "number" && typeof B.minCount == "number") {
|
|
3432
|
-
const
|
|
3438
|
+
const A = [];
|
|
3433
3439
|
for (let j = 0; j < B.maxCount; j++) {
|
|
3434
|
-
const te = `${
|
|
3435
|
-
F &&
|
|
3440
|
+
const te = `${S}-${j}`, F = w[te];
|
|
3441
|
+
F && A.push(F);
|
|
3436
3442
|
}
|
|
3437
|
-
s[
|
|
3443
|
+
s[S] || (s[S] = A.length > 0 ? A : null, A.length > 0 && (l += ` [附带${A.length}个文件: ${A.map((j) => j.name).join(", ")}] `));
|
|
3438
3444
|
} else
|
|
3439
|
-
s[
|
|
3445
|
+
s[I] = w[I] ?? null, w[I] && (l += ` [附带文件: ${w[I]?.name}] `);
|
|
3440
3446
|
} else
|
|
3441
|
-
s[
|
|
3447
|
+
s[I] = w[I] ?? null, w[I] && (l += ` [附带文件: ${w[I]?.name}] `);
|
|
3442
3448
|
} else {
|
|
3443
|
-
if (
|
|
3444
|
-
|
|
3449
|
+
if (g.classList.contains("tag-close-btn") || g.classList.contains("file-remove-btn")) return;
|
|
3450
|
+
g.getAttribute("contenteditable") === "false" && !G && g.classList.contains("tag-node") ? l += g.innerText : g.childNodes.forEach(b);
|
|
3445
3451
|
}
|
|
3446
3452
|
}
|
|
3447
3453
|
}
|
|
3448
3454
|
};
|
|
3449
3455
|
if (o.childNodes.forEach(b), l = l.trim(), !l) return;
|
|
3450
|
-
const
|
|
3451
|
-
|
|
3452
|
-
const
|
|
3453
|
-
if (
|
|
3454
|
-
if (
|
|
3455
|
-
|
|
3456
|
-
else if (Array.isArray(
|
|
3457
|
-
const
|
|
3456
|
+
const m = new FormData();
|
|
3457
|
+
m.append("fullPrompt", l), Object.keys(s).forEach((k) => {
|
|
3458
|
+
const g = s[k];
|
|
3459
|
+
if (g != null)
|
|
3460
|
+
if (g instanceof File)
|
|
3461
|
+
m.append(k, g);
|
|
3462
|
+
else if (Array.isArray(g)) {
|
|
3463
|
+
const G = t.some(
|
|
3458
3464
|
(B) => B.type === "multi-variable" && B.key === k
|
|
3459
|
-
),
|
|
3465
|
+
), I = t.some(
|
|
3460
3466
|
(B) => B.type === "report-url" && B.key === k
|
|
3461
3467
|
);
|
|
3462
|
-
|
|
3463
|
-
B != null && B !== "" &&
|
|
3464
|
-
}) :
|
|
3465
|
-
B != null && (B instanceof File ?
|
|
3468
|
+
G || I || k === "url" ? g.forEach((B) => {
|
|
3469
|
+
B != null && B !== "" && m.append(k, String(B));
|
|
3470
|
+
}) : g.forEach((B, A) => {
|
|
3471
|
+
B != null && (B instanceof File ? m.append(`${k}[${A}]`, B) : typeof B == "string" ? m.append(`${k}[${A}]`, B) : m.append(`${k}[${A}]`, String(B)));
|
|
3466
3472
|
});
|
|
3467
|
-
} else typeof
|
|
3468
|
-
}),
|
|
3473
|
+
} else typeof g == "string" ? m.append(k, g) : m.append(k, String(g));
|
|
3474
|
+
}), h(m, l);
|
|
3469
3475
|
}, Pt = {
|
|
3470
3476
|
...v ? { width: typeof v == "number" ? `${v}px` : v } : {},
|
|
3471
3477
|
...R ? { border: R } : {},
|
|
@@ -3491,12 +3497,12 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: g }) => {
|
|
|
3491
3497
|
"data-disabled": c,
|
|
3492
3498
|
ref: Q,
|
|
3493
3499
|
children: [
|
|
3494
|
-
|
|
3500
|
+
C,
|
|
3495
3501
|
/* @__PURE__ */ H(
|
|
3496
3502
|
"div",
|
|
3497
3503
|
{
|
|
3498
3504
|
className: "rich-text-editor-content",
|
|
3499
|
-
ref:
|
|
3505
|
+
ref: W,
|
|
3500
3506
|
style: Ht,
|
|
3501
3507
|
children: /* @__PURE__ */ ce(
|
|
3502
3508
|
"div",
|
|
@@ -3509,17 +3515,17 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: g }) => {
|
|
|
3509
3515
|
"div",
|
|
3510
3516
|
{
|
|
3511
3517
|
ref: a,
|
|
3512
|
-
className: `rte-editor ${t.length === 0 ? "rte-editor-default" : ""} ${fe &&
|
|
3518
|
+
className: `rte-editor ${t.length === 0 ? "rte-editor-default" : ""} ${fe && _ ? "rte-editor-empty" : ""}`,
|
|
3513
3519
|
contentEditable: t.length === 0,
|
|
3514
3520
|
suppressContentEditableWarning: !0,
|
|
3515
|
-
"data-placeholder":
|
|
3521
|
+
"data-placeholder": _,
|
|
3516
3522
|
onMouseDown: Nt,
|
|
3517
3523
|
onMouseMove: At,
|
|
3518
3524
|
onMouseUp: _t,
|
|
3519
3525
|
onClick: Lt,
|
|
3520
|
-
onDoubleClick:
|
|
3526
|
+
onDoubleClick: It,
|
|
3521
3527
|
onInput: mt,
|
|
3522
|
-
onKeyDown:
|
|
3528
|
+
onKeyDown: Mt,
|
|
3523
3529
|
onPaste: Tt
|
|
3524
3530
|
}
|
|
3525
3531
|
),
|
|
@@ -3544,12 +3550,12 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: g }) => {
|
|
|
3544
3550
|
/* @__PURE__ */ H("img", { src: "https://oospublic.sealseek.cn/file/website/ball.png", alt: "" }),
|
|
3545
3551
|
/* @__PURE__ */ H("span", { className: "rte-brand-text", children: "SealSeek 1.0" })
|
|
3546
3552
|
] }),
|
|
3547
|
-
|
|
3553
|
+
L !== "hideAgent" && /* @__PURE__ */ H(
|
|
3548
3554
|
Ut,
|
|
3549
3555
|
{
|
|
3550
3556
|
placement: "topLeft",
|
|
3551
3557
|
menu: {
|
|
3552
|
-
items:
|
|
3558
|
+
items: M.filter((o) => o.isShowNew !== 1).map((o) => ({
|
|
3553
3559
|
key: o.key,
|
|
3554
3560
|
label: /* @__PURE__ */ ce("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
|
|
3555
3561
|
o.icon && /* @__PURE__ */ H("i", { className: o.icon }),
|
|
@@ -3563,7 +3569,7 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: g }) => {
|
|
|
3563
3569
|
trigger: ["click"],
|
|
3564
3570
|
disabled: c || u,
|
|
3565
3571
|
overlayClassName: "rte-agent-dropdown",
|
|
3566
|
-
children: /* @__PURE__ */ ce("div", { className: "rte-agent-badge", style: { cursor:
|
|
3572
|
+
children: /* @__PURE__ */ ce("div", { className: "rte-agent-badge", style: { cursor: M.length > 0 ? "pointer" : "default" }, children: [
|
|
3567
3573
|
/* @__PURE__ */ H("i", { className: "iconfont icon-zhinengti", style: { fontSize: "16px" } }),
|
|
3568
3574
|
/* @__PURE__ */ H("span", { className: "rte-agent-text", children: "智能体" })
|
|
3569
3575
|
] })
|
|
@@ -3574,7 +3580,7 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: g }) => {
|
|
|
3574
3580
|
(() => {
|
|
3575
3581
|
const o = t.find((s) => s.type === "tag");
|
|
3576
3582
|
if (!o || !o.text) return null;
|
|
3577
|
-
const l =
|
|
3583
|
+
const l = M.find((s) => s.label === o.text);
|
|
3578
3584
|
return !l || l.points === void 0 || l.points === null ? null : /* @__PURE__ */ ce("div", { className: "rte-points-badge", children: [
|
|
3579
3585
|
/* @__PURE__ */ H("i", { className: "iconfont icon-jifen", style: { marginRight: "4px", fontSize: "16px" } }),
|
|
3580
3586
|
/* @__PURE__ */ ce("span", { style: { fontSize: "16px", lineHeight: "22px" }, children: [
|
|
@@ -3588,32 +3594,32 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: g }) => {
|
|
|
3588
3594
|
{
|
|
3589
3595
|
type: "button",
|
|
3590
3596
|
onClick: Dt,
|
|
3591
|
-
disabled: u || c ||
|
|
3597
|
+
disabled: u || c || T || !Z,
|
|
3592
3598
|
className: "rich-text-editor-send-button",
|
|
3593
|
-
children: u ||
|
|
3599
|
+
children: u || T ? /* @__PURE__ */ H("span", { className: "rte-send-spinner" }) : /* @__PURE__ */ H("i", { className: "iconfont icon-fasong" })
|
|
3594
3600
|
}
|
|
3595
3601
|
)
|
|
3596
3602
|
] })
|
|
3597
3603
|
] }),
|
|
3598
|
-
|
|
3599
|
-
if (!document.body.contains(
|
|
3604
|
+
y?.anchorEl && (() => {
|
|
3605
|
+
if (!document.body.contains(y.anchorEl))
|
|
3600
3606
|
return null;
|
|
3601
3607
|
let o = "", l = {
|
|
3602
3608
|
background: "var(--neutral-800, #262626)"
|
|
3603
3609
|
};
|
|
3604
|
-
if (
|
|
3610
|
+
if (y.type === "upload")
|
|
3605
3611
|
o = t.find(
|
|
3606
|
-
(
|
|
3612
|
+
(m) => m.type === "upload" && m.key === y.key
|
|
3607
3613
|
)?.tooltip || "";
|
|
3608
|
-
else if (
|
|
3609
|
-
o =
|
|
3610
|
-
else if (
|
|
3611
|
-
o =
|
|
3612
|
-
else if (
|
|
3613
|
-
o =
|
|
3614
|
-
else if (
|
|
3615
|
-
const b = w[
|
|
3616
|
-
if (b &&
|
|
3614
|
+
else if (y.type === "tag")
|
|
3615
|
+
o = y.anchorEl.dataset.tooltip || "";
|
|
3616
|
+
else if (y.type === "upload-label")
|
|
3617
|
+
o = y.anchorEl.querySelector(".upload-label[data-file-name]")?.dataset.fileName || y.anchorEl.dataset.fileName || "";
|
|
3618
|
+
else if (y.type === "variable")
|
|
3619
|
+
o = y.anchorEl.dataset.tooltip || "";
|
|
3620
|
+
else if (y.type === "upload-preview") {
|
|
3621
|
+
const b = w[y.key], m = !!b && (b.type?.startsWith("image/") || /\.(png|jpe?g|gif|webp|bmp|svg)$/i.test(b.name || ""));
|
|
3622
|
+
if (b && m) {
|
|
3617
3623
|
const k = URL.createObjectURL(b);
|
|
3618
3624
|
o = /* @__PURE__ */ H("div", { className: "rte-upload-preview", children: /* @__PURE__ */ H("img", { className: "rte-upload-preview-img", src: k, alt: b.name }) }), l = {
|
|
3619
3625
|
background: "#fff",
|
|
@@ -3625,15 +3631,15 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: g }) => {
|
|
|
3625
3631
|
o = "";
|
|
3626
3632
|
}
|
|
3627
3633
|
if (!o) return null;
|
|
3628
|
-
const s =
|
|
3634
|
+
const s = y.type === "upload-preview" ? "#0A0A0A" : "#fff";
|
|
3629
3635
|
return ot(
|
|
3630
3636
|
/* @__PURE__ */ H(
|
|
3631
3637
|
Kt,
|
|
3632
3638
|
{
|
|
3633
3639
|
arrow: !1,
|
|
3634
|
-
title:
|
|
3640
|
+
title: y.type === "upload-preview" ? o : /* @__PURE__ */ H("div", { style: { maxWidth: "200px", fontSize: "12px", color: s }, children: o }),
|
|
3635
3641
|
open: !0,
|
|
3636
|
-
placement:
|
|
3642
|
+
placement: y.type === "upload-preview" ? "topLeft" : "top",
|
|
3637
3643
|
getPopupContainer: () => document.body,
|
|
3638
3644
|
overlayInnerStyle: l,
|
|
3639
3645
|
children: /* @__PURE__ */ H(
|
|
@@ -3641,11 +3647,11 @@ const { RangePicker: On } = jt, Gn = ({ host: t, onChange: g }) => {
|
|
|
3641
3647
|
{
|
|
3642
3648
|
style: {
|
|
3643
3649
|
position: "fixed",
|
|
3644
|
-
left: `${
|
|
3650
|
+
left: `${y.anchorEl.getBoundingClientRect().left}px`,
|
|
3645
3651
|
// 对于 upload-label 类型的 tooltip,向上移动 6px 以增加间距
|
|
3646
|
-
top: `${
|
|
3647
|
-
width: `${
|
|
3648
|
-
height: `${
|
|
3652
|
+
top: `${y.anchorEl.getBoundingClientRect().top - (y.type === "upload-label" ? 4 : 0)}px`,
|
|
3653
|
+
width: `${y.anchorEl.offsetWidth}px`,
|
|
3654
|
+
height: `${y.anchorEl.offsetHeight}px`,
|
|
3649
3655
|
pointerEvents: "none"
|
|
3650
3656
|
}
|
|
3651
3657
|
}
|
|
@@ -3696,12 +3702,12 @@ const kt = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
3696
3702
|
{ label: "30页", value: 30 }
|
|
3697
3703
|
], jn = ({
|
|
3698
3704
|
autoLoading: t,
|
|
3699
|
-
batchSize:
|
|
3705
|
+
batchSize: h,
|
|
3700
3706
|
loadingProgress: u,
|
|
3701
3707
|
loadIcon: c,
|
|
3702
3708
|
onBatchSizeChange: v,
|
|
3703
3709
|
onLoadNextPage: D,
|
|
3704
|
-
onStartAutoLoad:
|
|
3710
|
+
onStartAutoLoad: M,
|
|
3705
3711
|
onStopLoad: P
|
|
3706
3712
|
}) => t && u ? /* @__PURE__ */ ce("div", { className: "auto_load_progress", children: [
|
|
3707
3713
|
c || /* @__PURE__ */ H("img", { src: kt, alt: "自动加载", width: 14, height: 14 }),
|
|
@@ -3745,7 +3751,7 @@ const kt = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
3745
3751
|
"div",
|
|
3746
3752
|
{
|
|
3747
3753
|
className: "auto_load_btn",
|
|
3748
|
-
onClick: t ? void 0 :
|
|
3754
|
+
onClick: t ? void 0 : M,
|
|
3749
3755
|
children: [
|
|
3750
3756
|
c || /* @__PURE__ */ H("img", { src: kt, alt: "自动加载", width: 14, height: 14 }),
|
|
3751
3757
|
/* @__PURE__ */ H("span", { children: "自动加载" })
|
|
@@ -3755,7 +3761,7 @@ const kt = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
3755
3761
|
/* @__PURE__ */ H(
|
|
3756
3762
|
ze,
|
|
3757
3763
|
{
|
|
3758
|
-
value:
|
|
3764
|
+
value: h,
|
|
3759
3765
|
onChange: v,
|
|
3760
3766
|
options: Yn,
|
|
3761
3767
|
disabled: t,
|
|
@@ -3769,21 +3775,21 @@ const kt = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
3769
3775
|
)
|
|
3770
3776
|
] }), Wn = ({
|
|
3771
3777
|
current: t,
|
|
3772
|
-
loadIcon:
|
|
3778
|
+
loadIcon: h,
|
|
3773
3779
|
pageSize: u,
|
|
3774
3780
|
total: c,
|
|
3775
3781
|
cachedPages: v,
|
|
3776
3782
|
loadedCount: D,
|
|
3777
|
-
autoLoading:
|
|
3783
|
+
autoLoading: M = !1,
|
|
3778
3784
|
loadingProgress: P,
|
|
3779
|
-
onChange:
|
|
3780
|
-
onLoadNextPage:
|
|
3781
|
-
onStartAutoLoad:
|
|
3785
|
+
onChange: N,
|
|
3786
|
+
onLoadNextPage: T,
|
|
3787
|
+
onStartAutoLoad: _,
|
|
3782
3788
|
onStopLoading: R
|
|
3783
3789
|
}) => {
|
|
3784
|
-
const [$,
|
|
3790
|
+
const [$, L] = oe(5), e = Math.ceil(c / u), n = nt(() => v.length >= e, [v, e]), r = () => Array.from(
|
|
3785
3791
|
{ length: e },
|
|
3786
|
-
(q,
|
|
3792
|
+
(q, O) => O + 1
|
|
3787
3793
|
).filter((q) => !v.includes(q)).slice(0, $);
|
|
3788
3794
|
return /* @__PURE__ */ ce("div", { className: "pagination_footer", children: [
|
|
3789
3795
|
/* @__PURE__ */ ce("div", { className: "pagination_leftWrap", children: [
|
|
@@ -3803,16 +3809,16 @@ const kt = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
3803
3809
|
!n && /* @__PURE__ */ H(
|
|
3804
3810
|
jn,
|
|
3805
3811
|
{
|
|
3806
|
-
loadIcon:
|
|
3807
|
-
autoLoading:
|
|
3812
|
+
loadIcon: h || void 0,
|
|
3813
|
+
autoLoading: M,
|
|
3808
3814
|
batchSize: $,
|
|
3809
3815
|
loadingProgress: P,
|
|
3810
|
-
disabled: !
|
|
3811
|
-
onBatchSizeChange:
|
|
3812
|
-
onLoadNextPage: () =>
|
|
3816
|
+
disabled: !T || !_,
|
|
3817
|
+
onBatchSizeChange: L,
|
|
3818
|
+
onLoadNextPage: () => T?.(),
|
|
3813
3819
|
onStartAutoLoad: () => {
|
|
3814
|
-
const
|
|
3815
|
-
|
|
3820
|
+
const x = r();
|
|
3821
|
+
_?.(x);
|
|
3816
3822
|
},
|
|
3817
3823
|
onStopLoad: () => R?.()
|
|
3818
3824
|
}
|
|
@@ -3824,23 +3830,23 @@ const kt = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
3824
3830
|
current: t,
|
|
3825
3831
|
pageSize: u,
|
|
3826
3832
|
total: c,
|
|
3827
|
-
onChange: (
|
|
3833
|
+
onChange: (x) => N(x),
|
|
3828
3834
|
showSizeChanger: !1,
|
|
3829
3835
|
showQuickJumper: !1,
|
|
3830
3836
|
showTotal: () => "",
|
|
3831
|
-
itemRender: (
|
|
3832
|
-
const
|
|
3833
|
-
return q === "prev" || q === "next" || q === "jump-prev" || q === "jump-next" ? /* @__PURE__ */ H("div", { className: "pageBox", children:
|
|
3837
|
+
itemRender: (x, q, O) => {
|
|
3838
|
+
const C = v.includes(x);
|
|
3839
|
+
return q === "prev" || q === "next" || q === "jump-prev" || q === "jump-next" ? /* @__PURE__ */ H("div", { className: "pageBox", children: O }) : /* @__PURE__ */ ce(
|
|
3834
3840
|
"div",
|
|
3835
3841
|
{
|
|
3836
3842
|
className: "pageBox",
|
|
3837
3843
|
style: {
|
|
3838
|
-
backgroundColor: t ===
|
|
3839
|
-
color: t ===
|
|
3844
|
+
backgroundColor: t === x ? "#2563EB" : "#f5f5f5",
|
|
3845
|
+
color: t === x ? "#fff" : C ? "#171717" : "#a3a3a3"
|
|
3840
3846
|
},
|
|
3841
3847
|
children: [
|
|
3842
|
-
|
|
3843
|
-
!
|
|
3848
|
+
x,
|
|
3849
|
+
!C && /* @__PURE__ */ H("span", { className: "unload_spot" })
|
|
3844
3850
|
]
|
|
3845
3851
|
}
|
|
3846
3852
|
);
|
|
@@ -3850,27 +3856,27 @@ const kt = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
3850
3856
|
] });
|
|
3851
3857
|
}, Un = (t) => {
|
|
3852
3858
|
const {
|
|
3853
|
-
loading:
|
|
3859
|
+
loading: h,
|
|
3854
3860
|
autoLoading: u,
|
|
3855
3861
|
loadingProgress: c,
|
|
3856
3862
|
columns: v = [],
|
|
3857
3863
|
dataSource: D = [],
|
|
3858
|
-
total:
|
|
3864
|
+
total: M,
|
|
3859
3865
|
current: P,
|
|
3860
|
-
pageSize:
|
|
3861
|
-
cachedPages:
|
|
3862
|
-
onChangePage:
|
|
3866
|
+
pageSize: N,
|
|
3867
|
+
cachedPages: T,
|
|
3868
|
+
onChangePage: _,
|
|
3863
3869
|
onLoadNextPage: R,
|
|
3864
3870
|
onStartAutoLoad: $,
|
|
3865
|
-
onStopLoading:
|
|
3871
|
+
onStopLoading: L,
|
|
3866
3872
|
...e
|
|
3867
3873
|
} = t, n = ae(null), r = ie(
|
|
3868
3874
|
(i) => {
|
|
3869
|
-
|
|
3870
|
-
key: `${(i - 1) *
|
|
3875
|
+
_(i), T.includes(i) && n.current?.scrollTo({
|
|
3876
|
+
key: `${(i - 1) * N + 1}`
|
|
3871
3877
|
});
|
|
3872
3878
|
},
|
|
3873
|
-
[
|
|
3879
|
+
[T, _, N]
|
|
3874
3880
|
);
|
|
3875
3881
|
return /* @__PURE__ */ ce("div", { className: "flex flex-col", children: [
|
|
3876
3882
|
/* @__PURE__ */ H(
|
|
@@ -3887,18 +3893,18 @@ const kt = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
3887
3893
|
/* @__PURE__ */ H(
|
|
3888
3894
|
Wn,
|
|
3889
3895
|
{
|
|
3890
|
-
loading:
|
|
3896
|
+
loading: h,
|
|
3891
3897
|
autoLoading: u,
|
|
3892
3898
|
loadingProgress: c,
|
|
3893
3899
|
current: P,
|
|
3894
|
-
pageSize:
|
|
3895
|
-
total:
|
|
3900
|
+
pageSize: N,
|
|
3901
|
+
total: M,
|
|
3896
3902
|
loadedCount: D.length,
|
|
3897
|
-
cachedPages:
|
|
3903
|
+
cachedPages: T,
|
|
3898
3904
|
onChange: r,
|
|
3899
3905
|
onLoadNextPage: R,
|
|
3900
3906
|
onStartAutoLoad: $,
|
|
3901
|
-
onStopLoading:
|
|
3907
|
+
onStopLoading: L
|
|
3902
3908
|
}
|
|
3903
3909
|
)
|
|
3904
3910
|
] });
|
|
@@ -4012,75 +4018,75 @@ Un.__docgenInfo = {
|
|
|
4012
4018
|
};
|
|
4013
4019
|
const Kn = ({
|
|
4014
4020
|
texts: t = [],
|
|
4015
|
-
placeholder:
|
|
4021
|
+
placeholder: h = "请输入内容",
|
|
4016
4022
|
animationSpeed: u = 100,
|
|
4017
4023
|
autoPlay: c = !0,
|
|
4018
4024
|
value: v,
|
|
4019
4025
|
onChange: D,
|
|
4020
|
-
...
|
|
4026
|
+
...M
|
|
4021
4027
|
}) => {
|
|
4022
|
-
const [P,
|
|
4028
|
+
const [P, N] = oe(""), [T, _] = oe(0), [R, $] = oe(!1), [L, e] = oe(!1), [n, r] = oe(!1), i = ae(void 0), x = ae(void 0), q = ae(t), O = ae(T), C = ae(L), Q = ae(P);
|
|
4023
4029
|
pe(() => {
|
|
4024
|
-
q.current = t,
|
|
4030
|
+
q.current = t, O.current = T, C.current = L, Q.current = P;
|
|
4025
4031
|
});
|
|
4026
|
-
const
|
|
4027
|
-
let
|
|
4032
|
+
const W = ie((d, p) => {
|
|
4033
|
+
let f = 0;
|
|
4028
4034
|
r(!0);
|
|
4029
|
-
const
|
|
4030
|
-
|
|
4035
|
+
const y = () => {
|
|
4036
|
+
f < d.length ? (N(d.slice(0, f + 1)), f++, x.current = window.setTimeout(y, u)) : (r(!1), p?.());
|
|
4031
4037
|
};
|
|
4032
|
-
|
|
4038
|
+
y();
|
|
4033
4039
|
}, [u]), X = ie((d) => {
|
|
4034
|
-
let
|
|
4035
|
-
const
|
|
4036
|
-
|
|
4040
|
+
let p = Q.current.length;
|
|
4041
|
+
const f = () => {
|
|
4042
|
+
p > 0 ? (N(Q.current.slice(0, p - 1)), p--, x.current = window.setTimeout(f, u / 2)) : d?.();
|
|
4037
4043
|
};
|
|
4038
|
-
|
|
4044
|
+
f();
|
|
4039
4045
|
}, [u]), a = ie(() => {
|
|
4040
|
-
if (q.current.length === 0 ||
|
|
4046
|
+
if (q.current.length === 0 || C.current) return;
|
|
4041
4047
|
$(!0);
|
|
4042
|
-
const d = q.current[
|
|
4048
|
+
const d = q.current[O.current];
|
|
4043
4049
|
Q.current ? X(() => {
|
|
4044
|
-
|
|
4050
|
+
W(d, () => {
|
|
4045
4051
|
i.current = window.setTimeout(() => {
|
|
4046
|
-
|
|
4052
|
+
_((p) => (p + 1) % q.current.length), $(!1);
|
|
4047
4053
|
}, 2e3);
|
|
4048
4054
|
});
|
|
4049
|
-
}) :
|
|
4055
|
+
}) : W(d, () => {
|
|
4050
4056
|
i.current = window.setTimeout(() => {
|
|
4051
|
-
|
|
4057
|
+
_((p) => (p + 1) % q.current.length), $(!1);
|
|
4052
4058
|
}, 2e3);
|
|
4053
4059
|
});
|
|
4054
|
-
}, [X,
|
|
4055
|
-
return pe(() => (c && t.length > 0 && !
|
|
4056
|
-
i.current && window.clearTimeout(i.current),
|
|
4057
|
-
}), [
|
|
4058
|
-
!R && c && t.length > 0 && !
|
|
4059
|
-
}, [
|
|
4060
|
+
}, [X, W]);
|
|
4061
|
+
return pe(() => (c && t.length > 0 && !L && a(), () => {
|
|
4062
|
+
i.current && window.clearTimeout(i.current), x.current && window.clearTimeout(x.current);
|
|
4063
|
+
}), [T, L, c, t.length, a]), pe(() => {
|
|
4064
|
+
!R && c && t.length > 0 && !L && a();
|
|
4065
|
+
}, [T, R, c, t.length, L, a]), /* @__PURE__ */ ce("div", { style: { position: "relative" }, children: [
|
|
4060
4066
|
/* @__PURE__ */ H(
|
|
4061
4067
|
$t,
|
|
4062
4068
|
{
|
|
4063
|
-
...
|
|
4069
|
+
...M,
|
|
4064
4070
|
value: v,
|
|
4065
4071
|
onChange: (d) => {
|
|
4066
|
-
D?.(d.target.value),
|
|
4072
|
+
D?.(d.target.value), M.onChange?.(d);
|
|
4067
4073
|
},
|
|
4068
4074
|
onFocus: (d) => {
|
|
4069
|
-
e(!0), i.current && window.clearTimeout(i.current),
|
|
4075
|
+
e(!0), i.current && window.clearTimeout(i.current), x.current && window.clearTimeout(x.current), $(!1), r(!1), M.onFocus?.(d);
|
|
4070
4076
|
},
|
|
4071
4077
|
onBlur: (d) => {
|
|
4072
|
-
e(!1), !v && t.length > 0 && (
|
|
4078
|
+
e(!1), !v && t.length > 0 && (N(""), _(0)), M.onBlur?.(d);
|
|
4073
4079
|
},
|
|
4074
|
-
placeholder:
|
|
4080
|
+
placeholder: L || v ? h : P || h,
|
|
4075
4081
|
style: {
|
|
4076
4082
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4077
|
-
...
|
|
4083
|
+
...M.style,
|
|
4078
4084
|
position: "relative",
|
|
4079
4085
|
zIndex: 1
|
|
4080
4086
|
}
|
|
4081
4087
|
}
|
|
4082
4088
|
),
|
|
4083
|
-
!
|
|
4089
|
+
!L && !v && P && /* @__PURE__ */ ce(
|
|
4084
4090
|
"div",
|
|
4085
4091
|
{
|
|
4086
4092
|
style: {
|
|
@@ -4173,7 +4179,7 @@ Kn.__docgenInfo = {
|
|
|
4173
4179
|
const Xn = ({
|
|
4174
4180
|
texts: t = [],
|
|
4175
4181
|
// 动态文案数组,默认为空数组
|
|
4176
|
-
placeholder:
|
|
4182
|
+
placeholder: h = "请输入内容",
|
|
4177
4183
|
// 占位符文本
|
|
4178
4184
|
animationSpeed: u = 100,
|
|
4179
4185
|
// 打字机动画速度,毫秒
|
|
@@ -4183,93 +4189,93 @@ const Xn = ({
|
|
|
4183
4189
|
// 受控模式的值
|
|
4184
4190
|
onChange: D,
|
|
4185
4191
|
// 受控模式的变化回调
|
|
4186
|
-
onSubmit:
|
|
4192
|
+
onSubmit: M,
|
|
4187
4193
|
// 提交回调
|
|
4188
4194
|
maxLength: P = 500,
|
|
4189
4195
|
// 最大字符数限制
|
|
4190
|
-
showCount:
|
|
4196
|
+
showCount: N = !0,
|
|
4191
4197
|
// 是否显示字数统计
|
|
4192
|
-
submitText:
|
|
4198
|
+
submitText: T = "发送",
|
|
4193
4199
|
// 提交按钮文本
|
|
4194
|
-
disabled:
|
|
4200
|
+
disabled: _ = !1,
|
|
4195
4201
|
// 是否禁用组件
|
|
4196
4202
|
rows: R = 4,
|
|
4197
4203
|
// 文本域行数
|
|
4198
4204
|
style: $,
|
|
4199
4205
|
// 自定义样式
|
|
4200
|
-
...
|
|
4206
|
+
...L
|
|
4201
4207
|
// 其他原生属性
|
|
4202
4208
|
}) => {
|
|
4203
|
-
const [e, n] = oe(""), [r, i] = oe(0), [
|
|
4209
|
+
const [e, n] = oe(""), [r, i] = oe(0), [x, q] = oe(!1), [O, C] = oe(!1), [Q, W] = oe(!1), [X, a] = oe(v || ""), V = ae(void 0), w = ae(void 0), U = ae(t), z = ae(r), d = ae(O), p = ae(e), f = ae(null);
|
|
4204
4210
|
pe(() => {
|
|
4205
|
-
|
|
4211
|
+
U.current = t, z.current = r, d.current = O, p.current = e;
|
|
4206
4212
|
});
|
|
4207
|
-
const
|
|
4213
|
+
const y = ie((ne, ye) => {
|
|
4208
4214
|
let ge = 0;
|
|
4209
|
-
|
|
4215
|
+
W(!0);
|
|
4210
4216
|
const he = () => {
|
|
4211
|
-
ge < ne.length ? (n(ne.slice(0, ge + 1)), ge++, w.current = window.setTimeout(he, u)) : (
|
|
4217
|
+
ge < ne.length ? (n(ne.slice(0, ge + 1)), ge++, w.current = window.setTimeout(he, u)) : (W(!1), ye?.());
|
|
4212
4218
|
};
|
|
4213
4219
|
he();
|
|
4214
4220
|
}, [u]), E = ie((ne) => {
|
|
4215
|
-
let ye =
|
|
4221
|
+
let ye = p.current.length;
|
|
4216
4222
|
const ge = () => {
|
|
4217
|
-
ye > 0 ? (n(
|
|
4223
|
+
ye > 0 ? (n(p.current.slice(0, ye - 1)), ye--, w.current = window.setTimeout(ge, u / 2)) : ne?.();
|
|
4218
4224
|
};
|
|
4219
4225
|
ge();
|
|
4220
4226
|
}, [u]), Y = ie(() => {
|
|
4221
|
-
if (
|
|
4227
|
+
if (U.current.length === 0 || d.current) return;
|
|
4222
4228
|
q(!0);
|
|
4223
|
-
const ne =
|
|
4224
|
-
|
|
4225
|
-
|
|
4229
|
+
const ne = U.current[z.current];
|
|
4230
|
+
p.current ? E(() => {
|
|
4231
|
+
y(ne, () => {
|
|
4226
4232
|
V.current = window.setTimeout(() => {
|
|
4227
|
-
i((ye) => (ye + 1) %
|
|
4233
|
+
i((ye) => (ye + 1) % U.current.length), q(!1);
|
|
4228
4234
|
}, 2e3);
|
|
4229
4235
|
});
|
|
4230
|
-
}) :
|
|
4236
|
+
}) : y(ne, () => {
|
|
4231
4237
|
V.current = window.setTimeout(() => {
|
|
4232
|
-
i((ye) => (ye + 1) %
|
|
4238
|
+
i((ye) => (ye + 1) % U.current.length), q(!1);
|
|
4233
4239
|
}, 2e3);
|
|
4234
4240
|
});
|
|
4235
|
-
}, [E,
|
|
4236
|
-
pe(() => (c && t.length > 0 && !
|
|
4241
|
+
}, [E, y]);
|
|
4242
|
+
pe(() => (c && t.length > 0 && !O && Y(), () => {
|
|
4237
4243
|
V.current && window.clearTimeout(V.current), w.current && window.clearTimeout(w.current);
|
|
4238
|
-
}), [r,
|
|
4239
|
-
!
|
|
4240
|
-
}, [r,
|
|
4241
|
-
const
|
|
4242
|
-
|
|
4244
|
+
}), [r, O, c, t.length, Y]), pe(() => {
|
|
4245
|
+
!x && c && t.length > 0 && !O && Y();
|
|
4246
|
+
}, [r, x, c, t.length, O, Y]);
|
|
4247
|
+
const K = (ne) => {
|
|
4248
|
+
C(!0), V.current && window.clearTimeout(V.current), w.current && window.clearTimeout(w.current), q(!1), W(!1), L.onFocus?.(ne);
|
|
4243
4249
|
}, Z = (ne) => {
|
|
4244
|
-
|
|
4250
|
+
C(!1), !v && t.length > 0 && (n(""), i(0)), L.onBlur?.(ne);
|
|
4245
4251
|
}, J = (ne) => {
|
|
4246
4252
|
const ye = ne.target.value;
|
|
4247
|
-
P && ye.length > P || (D ? D(ye) : a(ye),
|
|
4253
|
+
P && ye.length > P || (D ? D(ye) : a(ye), L.onChange?.(ne));
|
|
4248
4254
|
}, ue = () => {
|
|
4249
4255
|
const ne = D ? v : X;
|
|
4250
|
-
ne.trim() && !
|
|
4256
|
+
ne.trim() && !_ && (M?.(ne), D || a(""));
|
|
4251
4257
|
}, fe = (ne) => {
|
|
4252
|
-
(ne.ctrlKey || ne.metaKey) && ne.key === "Enter" && (ne.preventDefault(), ue()),
|
|
4253
|
-
}, de = D ? v : X, be =
|
|
4258
|
+
(ne.ctrlKey || ne.metaKey) && ne.key === "Enter" && (ne.preventDefault(), ue()), L.onKeyDown?.(ne);
|
|
4259
|
+
}, de = D ? v : X, be = _ || !de.trim() || (P ? de.length > P : !1);
|
|
4254
4260
|
return /* @__PURE__ */ ce("div", { style: { position: "relative", ...$ }, children: [
|
|
4255
4261
|
/* @__PURE__ */ ce("div", { style: { position: "relative" }, children: [
|
|
4256
4262
|
/* @__PURE__ */ H(
|
|
4257
4263
|
"textarea",
|
|
4258
4264
|
{
|
|
4259
|
-
ref:
|
|
4265
|
+
ref: f,
|
|
4260
4266
|
value: D ? v : X,
|
|
4261
4267
|
onChange: J,
|
|
4262
4268
|
onFocus: (ne) => {
|
|
4263
|
-
ne.target.style.borderColor = "#1890ff", ne.target.style.boxShadow = "0 0 0 2px rgba(24, 144, 255, 0.2)",
|
|
4269
|
+
ne.target.style.borderColor = "#1890ff", ne.target.style.boxShadow = "0 0 0 2px rgba(24, 144, 255, 0.2)", K(ne);
|
|
4264
4270
|
},
|
|
4265
4271
|
onBlur: (ne) => {
|
|
4266
4272
|
ne.target.style.borderColor = "#d9d9d9", ne.target.style.boxShadow = "none", Z(ne);
|
|
4267
4273
|
},
|
|
4268
4274
|
onKeyDown: fe,
|
|
4269
|
-
placeholder:
|
|
4275
|
+
placeholder: O || de ? h : "",
|
|
4270
4276
|
maxLength: P,
|
|
4271
4277
|
rows: R,
|
|
4272
|
-
disabled:
|
|
4278
|
+
disabled: _,
|
|
4273
4279
|
style: {
|
|
4274
4280
|
width: "100%",
|
|
4275
4281
|
minHeight: `${R * 24 + 16}px`,
|
|
@@ -4285,12 +4291,12 @@ const Xn = ({
|
|
|
4285
4291
|
transition: "border-color 0.3s, box-shadow 0.3s",
|
|
4286
4292
|
backgroundColor: "#fff",
|
|
4287
4293
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4288
|
-
...
|
|
4294
|
+
...L.style
|
|
4289
4295
|
},
|
|
4290
|
-
...
|
|
4296
|
+
...L
|
|
4291
4297
|
}
|
|
4292
4298
|
),
|
|
4293
|
-
!
|
|
4299
|
+
!O && !de && e && /* @__PURE__ */ ce(
|
|
4294
4300
|
"div",
|
|
4295
4301
|
{
|
|
4296
4302
|
style: {
|
|
@@ -4354,13 +4360,13 @@ const Xn = ({
|
|
|
4354
4360
|
alignItems: "center",
|
|
4355
4361
|
justifyContent: "center"
|
|
4356
4362
|
},
|
|
4357
|
-
children:
|
|
4363
|
+
children: T
|
|
4358
4364
|
}
|
|
4359
4365
|
)
|
|
4360
4366
|
}
|
|
4361
4367
|
)
|
|
4362
4368
|
] }),
|
|
4363
|
-
|
|
4369
|
+
N && /* @__PURE__ */ ce(
|
|
4364
4370
|
"div",
|
|
4365
4371
|
{
|
|
4366
4372
|
style: {
|
|
@@ -4472,56 +4478,56 @@ Xn.__docgenInfo = {
|
|
|
4472
4478
|
};
|
|
4473
4479
|
const St = ({
|
|
4474
4480
|
src: t,
|
|
4475
|
-
poster:
|
|
4481
|
+
poster: h,
|
|
4476
4482
|
width: u = 300,
|
|
4477
4483
|
height: c,
|
|
4478
4484
|
videoWidth: v,
|
|
4479
4485
|
// 参数保留但不使用,由CSS控制
|
|
4480
4486
|
videoHeight: D,
|
|
4481
4487
|
// 参数保留但不使用,由CSS控制
|
|
4482
|
-
showPlayButton:
|
|
4488
|
+
showPlayButton: M = !0,
|
|
4483
4489
|
autoPlayOnHover: P = !0,
|
|
4484
|
-
onClick:
|
|
4485
|
-
onVideoLoaded:
|
|
4486
|
-
onVideoPlay:
|
|
4490
|
+
onClick: N,
|
|
4491
|
+
onVideoLoaded: T,
|
|
4492
|
+
onVideoPlay: _,
|
|
4487
4493
|
onVideoPause: R,
|
|
4488
4494
|
onVideoEnded: $,
|
|
4489
|
-
className:
|
|
4495
|
+
className: L,
|
|
4490
4496
|
style: e,
|
|
4491
4497
|
...n
|
|
4492
4498
|
}) => {
|
|
4493
|
-
const r = ae(null), [i,
|
|
4494
|
-
r.current && (r.current.play(),
|
|
4495
|
-
}, [
|
|
4496
|
-
r.current && (r.current.pause(),
|
|
4497
|
-
}, [R]), a = ie((
|
|
4498
|
-
|
|
4499
|
-
}, [i,
|
|
4500
|
-
|
|
4501
|
-
}, [P, i,
|
|
4502
|
-
|
|
4503
|
-
}, [P, i, X]),
|
|
4504
|
-
Q(!0),
|
|
4505
|
-
}, [
|
|
4506
|
-
|
|
4507
|
-
}, [
|
|
4508
|
-
|
|
4509
|
-
}, [R]),
|
|
4510
|
-
|
|
4511
|
-
}, [$]),
|
|
4512
|
-
|
|
4513
|
-
}, [
|
|
4499
|
+
const r = ae(null), [i, x] = oe(!1), [q, O] = oe(!1), [C, Q] = oe(!1), W = ie(() => {
|
|
4500
|
+
r.current && (r.current.play(), x(!0), _?.());
|
|
4501
|
+
}, [_]), X = ie(() => {
|
|
4502
|
+
r.current && (r.current.pause(), x(!1), R?.());
|
|
4503
|
+
}, [R]), a = ie((y) => {
|
|
4504
|
+
y.stopPropagation(), i ? X() : W();
|
|
4505
|
+
}, [i, W, X]), V = ie(() => {
|
|
4506
|
+
O(!0), P && !i && W();
|
|
4507
|
+
}, [P, i, W]), w = ie(() => {
|
|
4508
|
+
O(!1), P && i && X();
|
|
4509
|
+
}, [P, i, X]), U = ie(() => {
|
|
4510
|
+
Q(!0), T?.();
|
|
4511
|
+
}, [T]), z = ie(() => {
|
|
4512
|
+
x(!0), _?.();
|
|
4513
|
+
}, [_]), d = ie(() => {
|
|
4514
|
+
x(!1), R?.();
|
|
4515
|
+
}, [R]), p = ie(() => {
|
|
4516
|
+
x(!1), $?.();
|
|
4517
|
+
}, [$]), f = ie((y) => {
|
|
4518
|
+
N?.(y);
|
|
4519
|
+
}, [N]);
|
|
4514
4520
|
return /* @__PURE__ */ H(
|
|
4515
4521
|
rt,
|
|
4516
4522
|
{
|
|
4517
4523
|
...n,
|
|
4518
|
-
className: `video-card ${
|
|
4524
|
+
className: `video-card ${L || ""}`,
|
|
4519
4525
|
style: {
|
|
4520
4526
|
width: u,
|
|
4521
4527
|
height: c,
|
|
4522
4528
|
padding: 0,
|
|
4523
4529
|
overflow: "hidden",
|
|
4524
|
-
cursor:
|
|
4530
|
+
cursor: N ? "pointer" : "default",
|
|
4525
4531
|
border: "none",
|
|
4526
4532
|
borderRadius: 0,
|
|
4527
4533
|
...e
|
|
@@ -4529,24 +4535,24 @@ const St = ({
|
|
|
4529
4535
|
bordered: !1,
|
|
4530
4536
|
onMouseEnter: V,
|
|
4531
4537
|
onMouseLeave: w,
|
|
4532
|
-
onClick:
|
|
4538
|
+
onClick: f,
|
|
4533
4539
|
children: /* @__PURE__ */ ce("div", { className: "video-card-container", children: [
|
|
4534
4540
|
/* @__PURE__ */ H(
|
|
4535
4541
|
"video",
|
|
4536
4542
|
{
|
|
4537
4543
|
ref: r,
|
|
4538
4544
|
src: t,
|
|
4539
|
-
poster:
|
|
4545
|
+
poster: h,
|
|
4540
4546
|
preload: "metadata",
|
|
4541
|
-
onLoadedData:
|
|
4547
|
+
onLoadedData: U,
|
|
4542
4548
|
onPlay: z,
|
|
4543
4549
|
onPause: d,
|
|
4544
|
-
onEnded:
|
|
4550
|
+
onEnded: p,
|
|
4545
4551
|
muted: !0,
|
|
4546
4552
|
loop: !0
|
|
4547
4553
|
}
|
|
4548
4554
|
),
|
|
4549
|
-
|
|
4555
|
+
M && /* @__PURE__ */ H(
|
|
4550
4556
|
"div",
|
|
4551
4557
|
{
|
|
4552
4558
|
className: `video-play-button ${q ? "hovered" : ""}`,
|
|
@@ -4554,7 +4560,7 @@ const St = ({
|
|
|
4554
4560
|
children: i ? /* @__PURE__ */ H(on, { className: "play-icon" }) : /* @__PURE__ */ H(sn, { className: "play-icon" })
|
|
4555
4561
|
}
|
|
4556
4562
|
),
|
|
4557
|
-
!
|
|
4563
|
+
!C && /* @__PURE__ */ H("div", { className: "video-loading-mask", children: /* @__PURE__ */ H("div", { className: "loading-spinner" }) })
|
|
4558
4564
|
] })
|
|
4559
4565
|
}
|
|
4560
4566
|
);
|
|
@@ -4662,7 +4668,7 @@ St.__docgenInfo = {
|
|
|
4662
4668
|
};
|
|
4663
4669
|
const Jn = (t) => [".mp4", ".webm", ".ogg", ".mov", ".avi", ".wmv", ".flv", ".mkv"].some((u) => t.toLowerCase().includes(u)), Qn = (t) => t.type ? t.type : Jn(t.url) ? "video" : "image", Zn = ({
|
|
4664
4670
|
items: t,
|
|
4665
|
-
columns:
|
|
4671
|
+
columns: h,
|
|
4666
4672
|
gap: u = 0,
|
|
4667
4673
|
responsive: c = !0,
|
|
4668
4674
|
breakpoints: v = {
|
|
@@ -4674,61 +4680,61 @@ const Jn = (t) => [".mp4", ".webm", ".ogg", ".mov", ".avi", ".wmv", ".flv", ".mk
|
|
|
4674
4680
|
xxl: 6
|
|
4675
4681
|
},
|
|
4676
4682
|
className: D,
|
|
4677
|
-
style:
|
|
4683
|
+
style: M,
|
|
4678
4684
|
onClick: P
|
|
4679
4685
|
}) => {
|
|
4680
|
-
const
|
|
4681
|
-
if (!c ||
|
|
4682
|
-
return
|
|
4686
|
+
const N = ae(null), [T, _] = oe(h || v.md || 3), R = ae(/* @__PURE__ */ new Map()), $ = ie(() => {
|
|
4687
|
+
if (!c || h)
|
|
4688
|
+
return h || v.md || 3;
|
|
4683
4689
|
const r = window.innerWidth;
|
|
4684
4690
|
return r < 576 ? v.xs || 1 : r < 768 ? v.sm || 2 : r < 992 ? v.md || 3 : r < 1200 ? v.lg || 4 : r < 1600 ? v.xl || 5 : v.xxl || 6;
|
|
4685
|
-
}, [c,
|
|
4686
|
-
if (!
|
|
4687
|
-
const r =
|
|
4688
|
-
t.forEach((Q,
|
|
4689
|
-
const X = Q.id ||
|
|
4691
|
+
}, [c, h, v]), L = ie(() => {
|
|
4692
|
+
if (!N.current) return;
|
|
4693
|
+
const r = T, i = N.current, q = (i.offsetWidth - u * (r - 1)) / r, O = new Array(r).fill(0);
|
|
4694
|
+
t.forEach((Q, W) => {
|
|
4695
|
+
const X = Q.id || W, a = R.current.get(X);
|
|
4690
4696
|
if (!a) return;
|
|
4691
|
-
const V = Math.min(...
|
|
4692
|
-
a.style.position = "absolute", a.style.left = `${
|
|
4697
|
+
const V = Math.min(...O), w = O.indexOf(V), U = w * (q + u), z = O[w];
|
|
4698
|
+
a.style.position = "absolute", a.style.left = `${U}px`, a.style.top = `${z}px`, a.style.width = `${q}px`, O[w] += a.offsetHeight + u;
|
|
4693
4699
|
});
|
|
4694
|
-
const
|
|
4695
|
-
i.style.height = `${
|
|
4696
|
-
}, [t,
|
|
4700
|
+
const C = Math.max(...O);
|
|
4701
|
+
i.style.height = `${C}px`;
|
|
4702
|
+
}, [t, T, u]);
|
|
4697
4703
|
pe(() => {
|
|
4698
4704
|
const r = () => {
|
|
4699
4705
|
const i = $();
|
|
4700
|
-
i !==
|
|
4706
|
+
i !== T && _(i);
|
|
4701
4707
|
};
|
|
4702
4708
|
if (c)
|
|
4703
4709
|
return window.addEventListener("resize", r), r(), () => window.removeEventListener("resize", r);
|
|
4704
|
-
}, [c, $,
|
|
4710
|
+
}, [c, $, T]), pe(() => {
|
|
4705
4711
|
const r = setTimeout(() => {
|
|
4706
|
-
|
|
4712
|
+
L();
|
|
4707
4713
|
}, 100);
|
|
4708
4714
|
return () => clearTimeout(r);
|
|
4709
|
-
}, [t,
|
|
4715
|
+
}, [t, T, L]);
|
|
4710
4716
|
const e = ie(() => {
|
|
4711
|
-
|
|
4712
|
-
}, [
|
|
4717
|
+
L();
|
|
4718
|
+
}, [L]), n = ie((r) => {
|
|
4713
4719
|
P && P(r), r.onClick?.(r);
|
|
4714
4720
|
}, [P]);
|
|
4715
4721
|
return /* @__PURE__ */ H(
|
|
4716
4722
|
"div",
|
|
4717
4723
|
{
|
|
4718
|
-
ref:
|
|
4724
|
+
ref: N,
|
|
4719
4725
|
className: `waterfall-container ${D || ""}`,
|
|
4720
4726
|
style: {
|
|
4721
4727
|
position: "relative",
|
|
4722
4728
|
width: "100%",
|
|
4723
|
-
...
|
|
4729
|
+
...M
|
|
4724
4730
|
},
|
|
4725
4731
|
children: t.map((r, i) => {
|
|
4726
|
-
const
|
|
4732
|
+
const x = r.id || i, q = Qn(r);
|
|
4727
4733
|
return /* @__PURE__ */ H(
|
|
4728
4734
|
"div",
|
|
4729
4735
|
{
|
|
4730
|
-
ref: (
|
|
4731
|
-
|
|
4736
|
+
ref: (O) => {
|
|
4737
|
+
O ? R.current.set(x, O) : R.current.delete(x);
|
|
4732
4738
|
},
|
|
4733
4739
|
className: "waterfall-item",
|
|
4734
4740
|
children: q === "video" ? /* @__PURE__ */ H("div", { style: {
|
|
@@ -4768,7 +4774,7 @@ const Jn = (t) => [".mp4", ".webm", ".ogg", ".mov", ".avi", ".wmv", ".flv", ".mk
|
|
|
4768
4774
|
}
|
|
4769
4775
|
)
|
|
4770
4776
|
},
|
|
4771
|
-
|
|
4777
|
+
x
|
|
4772
4778
|
);
|
|
4773
4779
|
})
|
|
4774
4780
|
}
|