bi-components-library 1.0.26 → 1.0.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -2
- package/dist/bi-components-library.css +1 -1
- package/dist/index.es.js +1503 -1428
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +3 -3
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as X, useRef as
|
|
3
|
-
import { Button as ge, Card as Be, Modal as Xe, Table as _e, Flex as He, Spin as Je, Empty as Qe, Select as
|
|
1
|
+
import { jsx as m, jsxs as W, Fragment as Ue } from "react/jsx-runtime";
|
|
2
|
+
import { useState as X, useRef as j, useMemo as Oe, useCallback as U, useEffect as ae, useLayoutEffect as Re } from "react";
|
|
3
|
+
import { Button as ge, Card as Be, Modal as Xe, Table as _e, Flex as He, Spin as Je, Empty as Qe, Select as Ge, Form as Ce, Input as Fe, Space as Ye, Dropdown as Ze, Tooltip as et, Progress as tt, Pagination as nt, theme as at } from "antd";
|
|
4
4
|
import { createFromIconfontCN as rt, LeftOutlined as ot, SearchOutlined as lt, ReloadOutlined as st, InfoCircleOutlined as it, SendOutlined as ct, PauseCircleOutlined as ut, PlayCircleOutlined as dt } from "@ant-design/icons";
|
|
5
5
|
import { createPortal as pt } from "react-dom";
|
|
6
6
|
const ft = ({
|
|
7
7
|
variant: t = "primary",
|
|
8
|
-
loading:
|
|
9
|
-
children:
|
|
10
|
-
...
|
|
11
|
-
}) => /* @__PURE__ */
|
|
8
|
+
loading: y = !1,
|
|
9
|
+
children: u,
|
|
10
|
+
...i
|
|
11
|
+
}) => /* @__PURE__ */ m(
|
|
12
12
|
ge,
|
|
13
13
|
{
|
|
14
|
-
...
|
|
14
|
+
...i,
|
|
15
15
|
type: ((k) => {
|
|
16
16
|
switch (k) {
|
|
17
17
|
case "primary":
|
|
@@ -28,9 +28,9 @@ const ft = ({
|
|
|
28
28
|
return "primary";
|
|
29
29
|
}
|
|
30
30
|
})(t),
|
|
31
|
-
loading:
|
|
31
|
+
loading: y,
|
|
32
32
|
ghost: t === "ghost",
|
|
33
|
-
children:
|
|
33
|
+
children: u
|
|
34
34
|
}
|
|
35
35
|
);
|
|
36
36
|
ft.__docgenInfo = {
|
|
@@ -79,20 +79,20 @@ ft.__docgenInfo = {
|
|
|
79
79
|
};
|
|
80
80
|
const yt = ({
|
|
81
81
|
title: t,
|
|
82
|
-
children:
|
|
83
|
-
bordered:
|
|
84
|
-
hoverable:
|
|
85
|
-
size:
|
|
82
|
+
children: y,
|
|
83
|
+
bordered: u = !0,
|
|
84
|
+
hoverable: i = !1,
|
|
85
|
+
size: c = "default",
|
|
86
86
|
...k
|
|
87
|
-
}) => /* @__PURE__ */
|
|
87
|
+
}) => /* @__PURE__ */ m(
|
|
88
88
|
Be,
|
|
89
89
|
{
|
|
90
90
|
...k,
|
|
91
91
|
title: t,
|
|
92
|
-
bordered:
|
|
93
|
-
hoverable:
|
|
94
|
-
size:
|
|
95
|
-
children:
|
|
92
|
+
bordered: u,
|
|
93
|
+
hoverable: i,
|
|
94
|
+
size: c,
|
|
95
|
+
children: y
|
|
96
96
|
}
|
|
97
97
|
);
|
|
98
98
|
yt.__docgenInfo = {
|
|
@@ -148,17 +148,17 @@ yt.__docgenInfo = {
|
|
|
148
148
|
};
|
|
149
149
|
const mt = ({
|
|
150
150
|
showDefaultFooter: t = !0,
|
|
151
|
-
...
|
|
151
|
+
...y
|
|
152
152
|
}) => {
|
|
153
|
-
const
|
|
154
|
-
/* @__PURE__ */
|
|
155
|
-
/* @__PURE__ */
|
|
153
|
+
const u = y.footer !== void 0 ? y.footer : t ? (i, { OkBtn: c, CancelBtn: k }) => /* @__PURE__ */ W(Ue, { children: [
|
|
154
|
+
/* @__PURE__ */ m(c, {}),
|
|
155
|
+
/* @__PURE__ */ m(k, {})
|
|
156
156
|
] }) : null;
|
|
157
|
-
return /* @__PURE__ */
|
|
157
|
+
return /* @__PURE__ */ m(
|
|
158
158
|
Xe,
|
|
159
159
|
{
|
|
160
|
-
...
|
|
161
|
-
footer:
|
|
160
|
+
...y,
|
|
161
|
+
footer: u
|
|
162
162
|
}
|
|
163
163
|
);
|
|
164
164
|
};
|
|
@@ -225,23 +225,23 @@ mt.__docgenInfo = {
|
|
|
225
225
|
};
|
|
226
226
|
const gt = ({
|
|
227
227
|
scrollX: t,
|
|
228
|
-
showPagination:
|
|
229
|
-
defaultPageSize:
|
|
230
|
-
...
|
|
231
|
-
}) => /* @__PURE__ */
|
|
228
|
+
showPagination: y = !0,
|
|
229
|
+
defaultPageSize: u = 10,
|
|
230
|
+
...i
|
|
231
|
+
}) => /* @__PURE__ */ m(
|
|
232
232
|
_e,
|
|
233
233
|
{
|
|
234
|
-
...
|
|
234
|
+
...i,
|
|
235
235
|
scroll: {
|
|
236
236
|
x: t || "max-content",
|
|
237
237
|
y: "50vh"
|
|
238
238
|
},
|
|
239
|
-
pagination:
|
|
239
|
+
pagination: y ? {
|
|
240
240
|
hideOnSinglePage: !0,
|
|
241
241
|
showSizeChanger: !0,
|
|
242
242
|
showQuickJumper: !0,
|
|
243
|
-
defaultPageSize:
|
|
244
|
-
...
|
|
243
|
+
defaultPageSize: u,
|
|
244
|
+
...i.pagination
|
|
245
245
|
} : !1
|
|
246
246
|
}
|
|
247
247
|
);
|
|
@@ -299,20 +299,20 @@ const ht = rt({
|
|
|
299
299
|
scriptUrl: ["https://at.alicdn.com/t/c/font_4968458_eh91gfr4j9e.js"]
|
|
300
300
|
}), vt = ({
|
|
301
301
|
name: t,
|
|
302
|
-
size:
|
|
303
|
-
color:
|
|
304
|
-
style:
|
|
305
|
-
...
|
|
302
|
+
size: y,
|
|
303
|
+
color: u,
|
|
304
|
+
style: i,
|
|
305
|
+
...c
|
|
306
306
|
}) => {
|
|
307
307
|
const k = {
|
|
308
|
-
fontSize:
|
|
309
|
-
color:
|
|
310
|
-
...
|
|
308
|
+
fontSize: y,
|
|
309
|
+
color: u,
|
|
310
|
+
...i
|
|
311
311
|
};
|
|
312
|
-
return /* @__PURE__ */
|
|
312
|
+
return /* @__PURE__ */ m(
|
|
313
313
|
ht,
|
|
314
314
|
{
|
|
315
|
-
...
|
|
315
|
+
...c,
|
|
316
316
|
type: t,
|
|
317
317
|
style: k
|
|
318
318
|
}
|
|
@@ -356,36 +356,36 @@ vt.__docgenInfo = {
|
|
|
356
356
|
};
|
|
357
357
|
const xt = ({
|
|
358
358
|
loading: t,
|
|
359
|
-
description:
|
|
360
|
-
className:
|
|
361
|
-
emptyChildren:
|
|
362
|
-
loadingText:
|
|
359
|
+
description: y = "暂无数据",
|
|
360
|
+
className: u,
|
|
361
|
+
emptyChildren: i,
|
|
362
|
+
loadingText: c,
|
|
363
363
|
emptyImage: k
|
|
364
|
-
}) => t ? /* @__PURE__ */
|
|
364
|
+
}) => t ? /* @__PURE__ */ W(
|
|
365
365
|
He,
|
|
366
366
|
{
|
|
367
|
-
className: `pt-10 w-full ${
|
|
367
|
+
className: `pt-10 w-full ${u || ""}`,
|
|
368
368
|
align: "center",
|
|
369
369
|
justify: "center",
|
|
370
370
|
vertical: !0,
|
|
371
371
|
children: [
|
|
372
|
-
/* @__PURE__ */
|
|
373
|
-
|
|
372
|
+
/* @__PURE__ */ m(Je, { size: "large" }),
|
|
373
|
+
c && /* @__PURE__ */ m("div", { className: "mt-4 text-gray-500", children: c })
|
|
374
374
|
]
|
|
375
375
|
}
|
|
376
|
-
) : /* @__PURE__ */
|
|
376
|
+
) : /* @__PURE__ */ m(
|
|
377
377
|
He,
|
|
378
378
|
{
|
|
379
|
-
className: `pt-10 w-full ${
|
|
379
|
+
className: `pt-10 w-full ${u || ""}`,
|
|
380
380
|
align: "center",
|
|
381
381
|
justify: "center",
|
|
382
|
-
children: /* @__PURE__ */
|
|
382
|
+
children: /* @__PURE__ */ m(
|
|
383
383
|
Qe,
|
|
384
384
|
{
|
|
385
385
|
image: k,
|
|
386
|
-
description:
|
|
386
|
+
description: y,
|
|
387
387
|
imageStyle: { height: 180 },
|
|
388
|
-
children:
|
|
388
|
+
children: i
|
|
389
389
|
}
|
|
390
390
|
)
|
|
391
391
|
}
|
|
@@ -435,19 +435,19 @@ xt.__docgenInfo = {
|
|
|
435
435
|
};
|
|
436
436
|
const bt = ({
|
|
437
437
|
onClick: t,
|
|
438
|
-
showText:
|
|
439
|
-
className:
|
|
440
|
-
size:
|
|
441
|
-
type:
|
|
442
|
-
}) => /* @__PURE__ */
|
|
438
|
+
showText: y = !1,
|
|
439
|
+
className: u,
|
|
440
|
+
size: i = "small",
|
|
441
|
+
type: c = "default"
|
|
442
|
+
}) => /* @__PURE__ */ m(
|
|
443
443
|
ge,
|
|
444
444
|
{
|
|
445
|
-
size:
|
|
446
|
-
type:
|
|
447
|
-
icon: /* @__PURE__ */
|
|
448
|
-
className: `cursor-pointer ${
|
|
445
|
+
size: i,
|
|
446
|
+
type: c,
|
|
447
|
+
icon: /* @__PURE__ */ m(ot, {}),
|
|
448
|
+
className: `cursor-pointer ${u || ""}`,
|
|
449
449
|
onClick: t,
|
|
450
|
-
children:
|
|
450
|
+
children: y && "返回"
|
|
451
451
|
}
|
|
452
452
|
);
|
|
453
453
|
bt.__docgenInfo = {
|
|
@@ -489,23 +489,23 @@ bt.__docgenInfo = {
|
|
|
489
489
|
}
|
|
490
490
|
}
|
|
491
491
|
};
|
|
492
|
-
const
|
|
492
|
+
const kt = ({
|
|
493
493
|
removePadding: t = !0,
|
|
494
|
-
className:
|
|
495
|
-
...
|
|
494
|
+
className: y,
|
|
495
|
+
...u
|
|
496
496
|
}) => {
|
|
497
|
-
const
|
|
498
|
-
return /* @__PURE__ */
|
|
497
|
+
const i = t ? `px-0 h-auto ${y || ""}` : y;
|
|
498
|
+
return /* @__PURE__ */ m(
|
|
499
499
|
ge,
|
|
500
500
|
{
|
|
501
501
|
type: "link",
|
|
502
|
-
...
|
|
503
|
-
className:
|
|
504
|
-
children:
|
|
502
|
+
...u,
|
|
503
|
+
className: i,
|
|
504
|
+
children: u.children
|
|
505
505
|
}
|
|
506
506
|
);
|
|
507
507
|
};
|
|
508
|
-
|
|
508
|
+
kt.__docgenInfo = {
|
|
509
509
|
displayName: "LinkButton",
|
|
510
510
|
description: "链接样式按钮组件,适用于表格操作列",
|
|
511
511
|
props: {
|
|
@@ -542,123 +542,123 @@ wt.__docgenInfo = {
|
|
|
542
542
|
}
|
|
543
543
|
}
|
|
544
544
|
};
|
|
545
|
-
const { Option:
|
|
545
|
+
const { Option: wt } = Ge, Et = ({
|
|
546
546
|
columns: t,
|
|
547
|
-
request:
|
|
548
|
-
searchFields:
|
|
549
|
-
showSearch:
|
|
550
|
-
showRefresh:
|
|
547
|
+
request: y,
|
|
548
|
+
searchFields: u = [],
|
|
549
|
+
showSearch: i = !0,
|
|
550
|
+
showRefresh: c = !0,
|
|
551
551
|
defaultPageSize: k = 10,
|
|
552
|
-
pageSizeOptions:
|
|
552
|
+
pageSizeOptions: L = ["10", "20", "50", "100"],
|
|
553
553
|
autoLoad: E = !0,
|
|
554
|
-
externalParams:
|
|
554
|
+
externalParams: C = {},
|
|
555
555
|
...e
|
|
556
556
|
}) => {
|
|
557
|
-
const [
|
|
557
|
+
const [A, g] = X([]), [l, a] = X(!1), [n, o] = X({
|
|
558
558
|
current: 1,
|
|
559
559
|
pageSize: k,
|
|
560
560
|
total: 0
|
|
561
|
-
}), [
|
|
562
|
-
|
|
563
|
-
const T =
|
|
564
|
-
T.current =
|
|
565
|
-
const
|
|
566
|
-
const { sortable:
|
|
561
|
+
}), [r, s] = X({}), [d, h] = X({}), [x] = Ce.useForm(), G = j(n);
|
|
562
|
+
G.current = n;
|
|
563
|
+
const T = j(C);
|
|
564
|
+
T.current = C;
|
|
565
|
+
const _ = j(!1), H = Oe(() => t.map((N) => {
|
|
566
|
+
const { sortable: M, render: ne, ...re } = N;
|
|
567
567
|
return {
|
|
568
568
|
...re,
|
|
569
|
-
sorter:
|
|
570
|
-
render:
|
|
569
|
+
sorter: M ? !0 : void 0,
|
|
570
|
+
render: ne || ((ce) => ce)
|
|
571
571
|
};
|
|
572
|
-
}), [t]),
|
|
573
|
-
if (
|
|
574
|
-
|
|
572
|
+
}), [t]), D = U(async (N = {}) => {
|
|
573
|
+
if (y) {
|
|
574
|
+
a(!0);
|
|
575
575
|
try {
|
|
576
|
-
const
|
|
577
|
-
page:
|
|
578
|
-
pageSize:
|
|
579
|
-
sortField:
|
|
580
|
-
sortOrder:
|
|
581
|
-
searchParams: { ...
|
|
582
|
-
|
|
583
|
-
},
|
|
584
|
-
|
|
576
|
+
const M = {
|
|
577
|
+
page: G.current.current,
|
|
578
|
+
pageSize: G.current.pageSize,
|
|
579
|
+
sortField: d.field,
|
|
580
|
+
sortOrder: d.order,
|
|
581
|
+
searchParams: { ...r, ...T.current },
|
|
582
|
+
...N
|
|
583
|
+
}, ne = await y(M);
|
|
584
|
+
ne.success && (g(ne.data), o((re) => ({
|
|
585
585
|
...re,
|
|
586
|
-
total:
|
|
587
|
-
current:
|
|
586
|
+
total: ne.total,
|
|
587
|
+
current: M.page || re.current
|
|
588
588
|
})));
|
|
589
|
-
} catch (
|
|
590
|
-
console.error("加载数据失败:",
|
|
589
|
+
} catch (M) {
|
|
590
|
+
console.error("加载数据失败:", M);
|
|
591
591
|
} finally {
|
|
592
|
-
|
|
592
|
+
a(!1);
|
|
593
593
|
}
|
|
594
594
|
}
|
|
595
|
-
}, [
|
|
596
|
-
|
|
597
|
-
}, []),
|
|
598
|
-
|
|
599
|
-
}, [
|
|
600
|
-
|
|
601
|
-
}, [
|
|
595
|
+
}, [y, d, r]), K = U((N) => {
|
|
596
|
+
s(N), o((M) => ({ ...M, current: 1 }));
|
|
597
|
+
}, []), Q = U(() => {
|
|
598
|
+
x.resetFields(), s({}), o((N) => ({ ...N, current: 1 }));
|
|
599
|
+
}, [x]), Y = U(() => {
|
|
600
|
+
D();
|
|
601
|
+
}, [D]), te = U((N, M, ne) => {
|
|
602
602
|
const re = {
|
|
603
|
-
current:
|
|
604
|
-
pageSize:
|
|
605
|
-
total:
|
|
603
|
+
current: N.current || 1,
|
|
604
|
+
pageSize: N.pageSize || k,
|
|
605
|
+
total: N.total || 0
|
|
606
606
|
}, ce = {
|
|
607
|
-
field:
|
|
608
|
-
order:
|
|
607
|
+
field: ne?.field,
|
|
608
|
+
order: ne?.order
|
|
609
609
|
};
|
|
610
|
-
|
|
610
|
+
o(re), h(ce);
|
|
611
611
|
}, [k]);
|
|
612
|
-
return
|
|
613
|
-
const
|
|
614
|
-
(E && !
|
|
615
|
-
}, [E,
|
|
616
|
-
|
|
617
|
-
|
|
612
|
+
return ae(() => {
|
|
613
|
+
const N = Object.keys(C).length > 0;
|
|
614
|
+
(E && !_.current || N) && (D(), _.current = !0);
|
|
615
|
+
}, [E, C, D]), /* @__PURE__ */ W("div", { children: [
|
|
616
|
+
i && u.length > 0 && /* @__PURE__ */ m(Be, { size: "small", style: { marginBottom: 16 }, children: /* @__PURE__ */ W(
|
|
617
|
+
Ce,
|
|
618
618
|
{
|
|
619
|
-
form:
|
|
619
|
+
form: x,
|
|
620
620
|
layout: "inline",
|
|
621
|
-
onFinish:
|
|
622
|
-
initialValues:
|
|
621
|
+
onFinish: K,
|
|
622
|
+
initialValues: u.reduce((N, M) => (M.defaultValue !== void 0 && (N[M.key] = M.defaultValue), N), {}),
|
|
623
623
|
children: [
|
|
624
|
-
|
|
624
|
+
u.map((N) => /* @__PURE__ */ m(Ce.Item, { name: N.key, label: N.label, children: N.type === "input" ? /* @__PURE__ */ m(
|
|
625
625
|
Fe,
|
|
626
626
|
{
|
|
627
|
-
placeholder:
|
|
627
|
+
placeholder: N.placeholder || `请输入${N.label}`,
|
|
628
628
|
style: { width: 200 }
|
|
629
629
|
}
|
|
630
|
-
) : /* @__PURE__ */
|
|
631
|
-
|
|
630
|
+
) : /* @__PURE__ */ m(
|
|
631
|
+
Ge,
|
|
632
632
|
{
|
|
633
|
-
placeholder:
|
|
633
|
+
placeholder: N.placeholder || `请选择${N.label}`,
|
|
634
634
|
style: { width: 200 },
|
|
635
635
|
allowClear: !0,
|
|
636
|
-
children:
|
|
636
|
+
children: N.options?.map((M) => /* @__PURE__ */ m(wt, { value: M.value, children: M.label }, M.value))
|
|
637
637
|
}
|
|
638
|
-
) },
|
|
639
|
-
/* @__PURE__ */
|
|
640
|
-
/* @__PURE__ */
|
|
641
|
-
/* @__PURE__ */
|
|
642
|
-
|
|
638
|
+
) }, N.key)),
|
|
639
|
+
/* @__PURE__ */ m(Ce.Item, { children: /* @__PURE__ */ W(Ye, { children: [
|
|
640
|
+
/* @__PURE__ */ m(ge, { type: "primary", htmlType: "submit", icon: /* @__PURE__ */ m(lt, {}), children: "查询" }),
|
|
641
|
+
/* @__PURE__ */ m(ge, { onClick: Q, children: "重置" }),
|
|
642
|
+
c && /* @__PURE__ */ m(ge, { icon: /* @__PURE__ */ m(st, {}), onClick: Y, children: "刷新" })
|
|
643
643
|
] }) })
|
|
644
644
|
]
|
|
645
645
|
}
|
|
646
646
|
) }),
|
|
647
|
-
/* @__PURE__ */
|
|
647
|
+
/* @__PURE__ */ m(
|
|
648
648
|
_e,
|
|
649
649
|
{
|
|
650
650
|
...e,
|
|
651
651
|
columns: H,
|
|
652
|
-
dataSource:
|
|
653
|
-
loading:
|
|
652
|
+
dataSource: A,
|
|
653
|
+
loading: l,
|
|
654
654
|
pagination: {
|
|
655
|
-
...
|
|
655
|
+
...n,
|
|
656
656
|
showSizeChanger: !0,
|
|
657
657
|
showQuickJumper: !0,
|
|
658
|
-
showTotal: (
|
|
659
|
-
pageSizeOptions:
|
|
658
|
+
showTotal: (N, M) => `第 ${M[0]}-${M[1]} 条/共 ${N} 条`,
|
|
659
|
+
pageSizeOptions: L
|
|
660
660
|
},
|
|
661
|
-
onChange:
|
|
661
|
+
onChange: te,
|
|
662
662
|
scroll: { x: "max-content", y: "50vh" }
|
|
663
663
|
}
|
|
664
664
|
)
|
|
@@ -731,837 +731,910 @@ Et.__docgenInfo = {
|
|
|
731
731
|
}
|
|
732
732
|
}
|
|
733
733
|
};
|
|
734
|
-
function
|
|
734
|
+
function Te(t, y, u) {
|
|
735
735
|
if (!t.current) return;
|
|
736
|
-
const
|
|
737
|
-
for (const
|
|
738
|
-
|
|
739
|
-
type:
|
|
740
|
-
key:
|
|
741
|
-
exclusionGroup:
|
|
736
|
+
const i = /* @__PURE__ */ new Set(), c = {};
|
|
737
|
+
for (const g of y)
|
|
738
|
+
g.exclusionGroup && g.exclusionGroup !== "separator" && (i.add(g.exclusionGroup), c[g.exclusionGroup] || (c[g.exclusionGroup] = []), c[g.exclusionGroup].push({
|
|
739
|
+
type: g.type,
|
|
740
|
+
key: g.key,
|
|
741
|
+
exclusionGroup: g.exclusionGroup
|
|
742
742
|
}));
|
|
743
743
|
const k = {};
|
|
744
|
-
for (const
|
|
745
|
-
k[
|
|
746
|
-
for (const
|
|
747
|
-
if (
|
|
748
|
-
if (
|
|
749
|
-
k[
|
|
744
|
+
for (const g of i) {
|
|
745
|
+
k[g] = !1;
|
|
746
|
+
for (const l of c[g])
|
|
747
|
+
if (l.type === "upload" && l.key) {
|
|
748
|
+
if (u[l.key] !== null && u[l.key] !== void 0) {
|
|
749
|
+
k[g] = !0;
|
|
750
750
|
break;
|
|
751
751
|
}
|
|
752
|
-
} else if (
|
|
753
|
-
const
|
|
754
|
-
`[data-type="variable"][data-key="${
|
|
752
|
+
} else if (l.type === "variable" && l.key) {
|
|
753
|
+
const a = t.current.querySelector(
|
|
754
|
+
`[data-type="variable"][data-key="${l.key}"]`
|
|
755
755
|
);
|
|
756
|
-
if (
|
|
757
|
-
k[
|
|
756
|
+
if (a && a.innerText.replace(/[\u200B\n]/g, "").trim().length > 0) {
|
|
757
|
+
k[g] = !0;
|
|
758
758
|
break;
|
|
759
759
|
}
|
|
760
760
|
}
|
|
761
761
|
}
|
|
762
|
-
const
|
|
763
|
-
(
|
|
762
|
+
const L = y.some((g) => g.exclusionGroup === "separator"), C = Object.keys(k).filter(
|
|
763
|
+
(g) => k[g]
|
|
764
764
|
).length > 0;
|
|
765
765
|
let e = null;
|
|
766
|
-
if (
|
|
767
|
-
for (const
|
|
768
|
-
if (
|
|
769
|
-
e =
|
|
766
|
+
if (C && L) {
|
|
767
|
+
for (const g of y)
|
|
768
|
+
if (g.exclusionGroup && g.exclusionGroup !== "separator" && k[g.exclusionGroup]) {
|
|
769
|
+
e = g.exclusionGroup;
|
|
770
770
|
break;
|
|
771
771
|
}
|
|
772
772
|
}
|
|
773
|
-
for (const
|
|
774
|
-
const
|
|
775
|
-
`[data-group="${
|
|
773
|
+
for (const g of i) {
|
|
774
|
+
const l = t.current.querySelectorAll(
|
|
775
|
+
`[data-group="${g}"]`
|
|
776
776
|
);
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
}) :
|
|
780
|
-
|
|
781
|
-
}) :
|
|
782
|
-
|
|
777
|
+
L && C && e ? g === e ? l.forEach((a) => {
|
|
778
|
+
a.classList.contains("required-upload-group") ? a.style.setProperty("display", "inline-flex", "important") : (a.classList.contains("exclusion-wrapper"), a.style.setProperty("display", "inline-block", "important"));
|
|
779
|
+
}) : l.forEach((a) => {
|
|
780
|
+
a.style.display = "none", a.style.setProperty("display", "none", "important");
|
|
781
|
+
}) : l.forEach((a) => {
|
|
782
|
+
a.classList.contains("required-upload-group") ? a.style.setProperty("display", "inline-flex", "important") : (a.classList.contains("exclusion-wrapper"), a.style.setProperty("display", "inline-block", "important"));
|
|
783
783
|
});
|
|
784
784
|
}
|
|
785
785
|
t.current.querySelectorAll(
|
|
786
786
|
'[data-group="separator"]'
|
|
787
|
-
).forEach((
|
|
788
|
-
|
|
787
|
+
).forEach((g) => {
|
|
788
|
+
g.style.display = C ? "none" : "inline";
|
|
789
789
|
});
|
|
790
790
|
}
|
|
791
|
-
function
|
|
791
|
+
function $e(t, y, u, i) {
|
|
792
792
|
if (!t.current) {
|
|
793
|
-
|
|
793
|
+
i(!1);
|
|
794
794
|
return;
|
|
795
795
|
}
|
|
796
|
-
const
|
|
797
|
-
for (let
|
|
798
|
-
const
|
|
799
|
-
if ((
|
|
800
|
-
|
|
801
|
-
exclusionGroup:
|
|
802
|
-
key:
|
|
803
|
-
type:
|
|
804
|
-
isMultiVariable:
|
|
805
|
-
minCount:
|
|
796
|
+
const c = [];
|
|
797
|
+
for (let l = 0; l < y.length; l++) {
|
|
798
|
+
const a = y[l];
|
|
799
|
+
if ((a.type === "variable" || a.type === "upload" || a.type === "multi-variable" || a.type === "select" || a.type === "textarea" || a.type === "richtext" || a.type === "datepicker") && a.required && a.key) {
|
|
800
|
+
c.push({
|
|
801
|
+
exclusionGroup: a.exclusionGroup || "",
|
|
802
|
+
key: a.key,
|
|
803
|
+
type: a.type === "multi-variable" ? "variable" : a.type,
|
|
804
|
+
isMultiVariable: a.type === "multi-variable",
|
|
805
|
+
minCount: a.type === "multi-variable" ? a.minCount : void 0
|
|
806
806
|
});
|
|
807
807
|
continue;
|
|
808
808
|
}
|
|
809
|
-
if (
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
809
|
+
if (a.type === "text" && a.className?.includes("rte-text-required"))
|
|
810
|
+
if (a.exclusionGroup)
|
|
811
|
+
for (let n = l + 1; n < y.length; n++) {
|
|
812
|
+
const o = y[n];
|
|
813
|
+
if (o.exclusionGroup === a.exclusionGroup && (o.type === "variable" || o.type === "upload" || o.type === "select" || o.type === "textarea" || o.type === "richtext" || o.type === "datepicker") && o.key) {
|
|
814
|
+
c.push({
|
|
815
|
+
exclusionGroup: a.exclusionGroup,
|
|
816
|
+
key: o.key,
|
|
817
|
+
type: o.type
|
|
818
|
+
});
|
|
819
|
+
break;
|
|
820
|
+
}
|
|
821
|
+
}
|
|
822
|
+
else
|
|
823
|
+
for (let n = l + 1; n < y.length; n++) {
|
|
824
|
+
const o = y[n];
|
|
825
|
+
if ((o.type === "variable" || o.type === "upload" || o.type === "select" || o.type === "textarea" || o.type === "richtext" || o.type === "datepicker") && o.key) {
|
|
826
|
+
c.push({
|
|
827
|
+
exclusionGroup: o.exclusionGroup || "",
|
|
828
|
+
key: o.key,
|
|
829
|
+
type: o.type
|
|
830
|
+
});
|
|
831
|
+
break;
|
|
832
|
+
}
|
|
819
833
|
}
|
|
820
|
-
}
|
|
821
834
|
}
|
|
822
|
-
const k =
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
)
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
835
|
+
const k = y.some((l) => l.exclusionGroup === "separator"), L = [];
|
|
836
|
+
if (k && c.length > 1) {
|
|
837
|
+
const l = [];
|
|
838
|
+
y.forEach((a, n) => {
|
|
839
|
+
a.exclusionGroup === "separator" && l.push(n);
|
|
840
|
+
});
|
|
841
|
+
for (const a of l) {
|
|
842
|
+
let n = null;
|
|
843
|
+
for (let r = a - 1; r >= 0; r--) {
|
|
844
|
+
const s = y[r];
|
|
845
|
+
if ((s.type === "variable" || s.type === "upload" || s.type === "select" || s.type === "textarea" || s.type === "richtext" || s.type === "datepicker") && s.key) {
|
|
846
|
+
const d = c.find((h) => h.key === s.key);
|
|
847
|
+
if (d) {
|
|
848
|
+
n = d;
|
|
849
|
+
break;
|
|
850
|
+
}
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
let o = null;
|
|
854
|
+
for (let r = a + 1; r < y.length; r++) {
|
|
855
|
+
const s = y[r];
|
|
856
|
+
if ((s.type === "variable" || s.type === "upload" || s.type === "select" || s.type === "textarea" || s.type === "richtext" || s.type === "datepicker") && s.key) {
|
|
857
|
+
const d = c.find((h) => h.key === s.key);
|
|
858
|
+
if (d) {
|
|
859
|
+
o = d;
|
|
860
|
+
break;
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
n && o && L.push([n, o]);
|
|
865
|
+
}
|
|
831
866
|
}
|
|
832
|
-
if (
|
|
833
|
-
if (
|
|
867
|
+
if (c.length === 0) {
|
|
868
|
+
if (y.length === 0) {
|
|
834
869
|
if (!t.current) {
|
|
835
|
-
|
|
870
|
+
i(!1);
|
|
836
871
|
return;
|
|
837
872
|
}
|
|
838
|
-
const
|
|
839
|
-
l
|
|
873
|
+
const l = t.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "";
|
|
874
|
+
i(l.length > 0);
|
|
840
875
|
return;
|
|
841
876
|
}
|
|
842
|
-
|
|
877
|
+
i(!0);
|
|
843
878
|
return;
|
|
844
879
|
}
|
|
845
|
-
const E =
|
|
880
|
+
const E = c.filter((l) => {
|
|
846
881
|
if (!t.current) return !1;
|
|
847
|
-
if (
|
|
848
|
-
const
|
|
849
|
-
`[data-group="${
|
|
882
|
+
if (l.exclusionGroup) {
|
|
883
|
+
const a = t.current.querySelectorAll(
|
|
884
|
+
`[data-group="${l.exclusionGroup}"]`
|
|
850
885
|
);
|
|
851
|
-
if (
|
|
852
|
-
return
|
|
886
|
+
if (a.length > 0)
|
|
887
|
+
return a[0].style.display !== "none";
|
|
853
888
|
}
|
|
854
|
-
if (
|
|
855
|
-
const
|
|
856
|
-
`[data-type="upload"][data-key="${
|
|
889
|
+
if (l.type === "upload" && l.key) {
|
|
890
|
+
const a = t.current.querySelector(
|
|
891
|
+
`[data-type="upload"][data-key="${l.key}"]`
|
|
857
892
|
);
|
|
858
|
-
if (
|
|
859
|
-
const
|
|
860
|
-
return
|
|
893
|
+
if (a) {
|
|
894
|
+
const n = a.closest("[data-group]") || a.parentElement;
|
|
895
|
+
return n ? n.style.display !== "none" : !0;
|
|
861
896
|
}
|
|
862
|
-
} else if (
|
|
863
|
-
if (
|
|
864
|
-
const
|
|
865
|
-
`[data-type="variable"][data-multi-key="${
|
|
897
|
+
} else if (l.type === "variable" && l.key)
|
|
898
|
+
if (l.isMultiVariable) {
|
|
899
|
+
const a = t.current.querySelectorAll(
|
|
900
|
+
`[data-type="variable"][data-multi-key="${l.key}"]`
|
|
866
901
|
);
|
|
867
|
-
if (
|
|
868
|
-
const
|
|
902
|
+
if (a.length > 0) {
|
|
903
|
+
const n = a[0], o = n.closest("[data-group]") || n.parentElement;
|
|
869
904
|
return o ? o.style.display !== "none" : !0;
|
|
870
905
|
}
|
|
871
906
|
} else {
|
|
872
|
-
const
|
|
873
|
-
`[data-type="variable"][data-key="${
|
|
907
|
+
const a = t.current.querySelector(
|
|
908
|
+
`[data-type="variable"][data-key="${l.key}"]`
|
|
874
909
|
);
|
|
875
|
-
if (
|
|
876
|
-
const
|
|
877
|
-
return
|
|
910
|
+
if (a) {
|
|
911
|
+
const n = a.closest("[data-group]") || a.parentElement;
|
|
912
|
+
return n ? n.style.display !== "none" : !0;
|
|
878
913
|
}
|
|
879
914
|
}
|
|
880
|
-
else if (
|
|
881
|
-
const
|
|
882
|
-
`[data-type="select"][data-key="${
|
|
915
|
+
else if (l.type === "select" && l.key) {
|
|
916
|
+
const a = t.current.querySelector(
|
|
917
|
+
`[data-type="select"][data-key="${l.key}"]`
|
|
883
918
|
);
|
|
884
|
-
if (
|
|
885
|
-
const
|
|
886
|
-
return
|
|
919
|
+
if (a) {
|
|
920
|
+
const n = a.closest("[data-group]") || a.parentElement;
|
|
921
|
+
return n ? n.style.display !== "none" : !0;
|
|
887
922
|
}
|
|
888
|
-
} else if (
|
|
889
|
-
const
|
|
890
|
-
`[data-type="textarea"][data-key="${
|
|
923
|
+
} else if (l.type === "textarea" && l.key) {
|
|
924
|
+
const a = t.current.querySelector(
|
|
925
|
+
`[data-type="textarea"][data-key="${l.key}"]`
|
|
891
926
|
);
|
|
892
|
-
if (
|
|
893
|
-
const
|
|
894
|
-
return
|
|
927
|
+
if (a) {
|
|
928
|
+
const n = a.closest("[data-group]") || a.parentElement;
|
|
929
|
+
return n ? n.style.display !== "none" : !0;
|
|
895
930
|
}
|
|
896
|
-
} else if (
|
|
897
|
-
const
|
|
898
|
-
`[data-type="richtext"][data-key="${
|
|
931
|
+
} else if (l.type === "richtext" && l.key) {
|
|
932
|
+
const a = t.current.querySelector(
|
|
933
|
+
`[data-type="richtext"][data-key="${l.key}"]`
|
|
899
934
|
);
|
|
900
|
-
if (
|
|
901
|
-
const
|
|
902
|
-
return
|
|
935
|
+
if (a) {
|
|
936
|
+
const n = a.closest("[data-group]") || a.parentElement;
|
|
937
|
+
return n ? n.style.display !== "none" : !0;
|
|
903
938
|
}
|
|
904
|
-
} else if (
|
|
905
|
-
const
|
|
906
|
-
`[data-type="datepicker"][data-key="${
|
|
939
|
+
} else if (l.type === "datepicker" && l.key) {
|
|
940
|
+
const a = t.current.querySelector(
|
|
941
|
+
`[data-type="datepicker"][data-key="${l.key}"]`
|
|
907
942
|
);
|
|
908
|
-
if (
|
|
909
|
-
const
|
|
910
|
-
return
|
|
943
|
+
if (a) {
|
|
944
|
+
const n = a.closest("[data-group]") || a.parentElement;
|
|
945
|
+
return n ? n.style.display !== "none" : !0;
|
|
911
946
|
}
|
|
912
947
|
}
|
|
913
948
|
return !1;
|
|
914
949
|
});
|
|
915
950
|
if (E.length === 0) {
|
|
916
|
-
|
|
951
|
+
i(!0);
|
|
917
952
|
return;
|
|
918
953
|
}
|
|
919
|
-
|
|
954
|
+
const C = /* @__PURE__ */ new Set();
|
|
955
|
+
L.forEach((l) => {
|
|
956
|
+
l.forEach((a) => {
|
|
957
|
+
a.key && C.add(a.key);
|
|
958
|
+
});
|
|
959
|
+
});
|
|
960
|
+
const e = E.filter(
|
|
961
|
+
(l) => !l.key || !C.has(l.key)
|
|
962
|
+
);
|
|
963
|
+
let A = (L.length === 0, !0);
|
|
964
|
+
for (const l of L) {
|
|
965
|
+
const a = l.filter((o) => {
|
|
966
|
+
if (!t.current) return !1;
|
|
967
|
+
if (o.exclusionGroup) {
|
|
968
|
+
const r = t.current.querySelectorAll(
|
|
969
|
+
`[data-group="${o.exclusionGroup}"]`
|
|
970
|
+
);
|
|
971
|
+
if (r.length > 0)
|
|
972
|
+
return r[0].style.display !== "none";
|
|
973
|
+
}
|
|
974
|
+
return !0;
|
|
975
|
+
});
|
|
976
|
+
if (a.length === 0)
|
|
977
|
+
continue;
|
|
920
978
|
let n = !1;
|
|
921
|
-
for (const
|
|
922
|
-
if (
|
|
923
|
-
if (
|
|
979
|
+
for (const o of a)
|
|
980
|
+
if (o.type === "upload" && o.key) {
|
|
981
|
+
if (u[o.key] !== null && u[o.key] !== void 0) {
|
|
924
982
|
n = !0;
|
|
925
983
|
break;
|
|
926
984
|
}
|
|
927
|
-
} else if (
|
|
928
|
-
if (
|
|
929
|
-
const
|
|
930
|
-
`[data-type="variable"][data-multi-key="${
|
|
985
|
+
} else if (o.type === "variable" && o.key)
|
|
986
|
+
if (o.isMultiVariable) {
|
|
987
|
+
const r = t.current.querySelectorAll(
|
|
988
|
+
`[data-type="variable"][data-multi-key="${o.key}"]`
|
|
931
989
|
);
|
|
932
|
-
let
|
|
933
|
-
for (const
|
|
934
|
-
|
|
935
|
-
const
|
|
936
|
-
if (
|
|
990
|
+
let s = 0;
|
|
991
|
+
for (const h of Array.from(r))
|
|
992
|
+
h.innerText.replace(/[\u200B\n]/g, "").trim().length > 0 && (s += 1);
|
|
993
|
+
const d = o.minCount && o.minCount > 0 ? o.minCount : 1;
|
|
994
|
+
if (s >= d) {
|
|
937
995
|
n = !0;
|
|
938
996
|
break;
|
|
939
997
|
}
|
|
940
998
|
} else {
|
|
941
|
-
const
|
|
942
|
-
`[data-type="variable"][data-key="${
|
|
999
|
+
const r = t.current.querySelector(
|
|
1000
|
+
`[data-type="variable"][data-key="${o.key}"]`
|
|
943
1001
|
);
|
|
944
|
-
if (
|
|
1002
|
+
if (r && r.innerText.replace(/[\u200B\n]/g, "").trim().length > 0) {
|
|
945
1003
|
n = !0;
|
|
946
1004
|
break;
|
|
947
1005
|
}
|
|
948
1006
|
}
|
|
949
|
-
else if (
|
|
950
|
-
const
|
|
951
|
-
`[data-type="select"][data-key="${
|
|
1007
|
+
else if (o.type === "select" && o.key) {
|
|
1008
|
+
const r = t.current.querySelector(
|
|
1009
|
+
`[data-type="select"][data-key="${o.key}"]`
|
|
952
1010
|
);
|
|
953
|
-
if (
|
|
1011
|
+
if (r && (r.value || "").trim().length > 0) {
|
|
954
1012
|
n = !0;
|
|
955
1013
|
break;
|
|
956
1014
|
}
|
|
957
|
-
} else if (
|
|
958
|
-
const
|
|
959
|
-
`[data-type="textarea"][data-key="${
|
|
1015
|
+
} else if (o.type === "textarea" && o.key) {
|
|
1016
|
+
const r = t.current.querySelector(
|
|
1017
|
+
`[data-type="textarea"][data-key="${o.key}"]`
|
|
960
1018
|
);
|
|
961
|
-
if (
|
|
1019
|
+
if (r && (r.value || "").trim().length > 0) {
|
|
962
1020
|
n = !0;
|
|
963
1021
|
break;
|
|
964
1022
|
}
|
|
965
|
-
} else if (
|
|
966
|
-
const
|
|
967
|
-
`[data-type="richtext"][data-key="${
|
|
1023
|
+
} else if (o.type === "richtext" && o.key) {
|
|
1024
|
+
const r = t.current.querySelector(
|
|
1025
|
+
`[data-type="richtext"][data-key="${o.key}"]`
|
|
968
1026
|
);
|
|
969
|
-
if (
|
|
1027
|
+
if (r && (r.textContent || "").replace(/[\u200B]/g, "").trim().length > 0) {
|
|
970
1028
|
n = !0;
|
|
971
1029
|
break;
|
|
972
1030
|
}
|
|
973
|
-
} else if (
|
|
974
|
-
const
|
|
975
|
-
`[data-type="datepicker"][data-key="${
|
|
1031
|
+
} else if (o.type === "datepicker" && o.key) {
|
|
1032
|
+
const r = t.current.querySelector(
|
|
1033
|
+
`[data-type="datepicker"][data-key="${o.key}"]`
|
|
976
1034
|
);
|
|
977
|
-
if (
|
|
1035
|
+
if (r && (r.getAttribute("data-value") || "").trim().length > 0) {
|
|
978
1036
|
n = !0;
|
|
979
1037
|
break;
|
|
980
1038
|
}
|
|
981
1039
|
}
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
f.innerText.replace(/[\u200B\n]/g, "").trim().length > 0 && (o += 1);
|
|
999
|
-
const L = e.minCount && e.minCount > 0 ? e.minCount : 1;
|
|
1000
|
-
if (o < L) {
|
|
1001
|
-
n = !1;
|
|
1002
|
-
break;
|
|
1003
|
-
}
|
|
1004
|
-
} else {
|
|
1005
|
-
const a = t.current.querySelector(
|
|
1006
|
-
`[data-type="variable"][data-key="${e.key}"]`
|
|
1007
|
-
);
|
|
1008
|
-
if (!a) {
|
|
1009
|
-
n = !1;
|
|
1010
|
-
break;
|
|
1011
|
-
}
|
|
1012
|
-
if (a.innerText.replace(/[\u200B\n]/g, "").trim().length === 0) {
|
|
1013
|
-
n = !1;
|
|
1014
|
-
break;
|
|
1015
|
-
}
|
|
1016
|
-
}
|
|
1017
|
-
else if (e.type === "select" && e.key) {
|
|
1018
|
-
const a = t.current.querySelector(
|
|
1019
|
-
`[data-type="select"][data-key="${e.key}"]`
|
|
1020
|
-
);
|
|
1021
|
-
if (!a || (a.value || "").trim().length === 0) {
|
|
1022
|
-
n = !1;
|
|
1023
|
-
break;
|
|
1024
|
-
}
|
|
1025
|
-
} else if (e.type === "textarea" && e.key) {
|
|
1026
|
-
const a = t.current.querySelector(
|
|
1027
|
-
`[data-type="textarea"][data-key="${e.key}"]`
|
|
1040
|
+
if (!n) {
|
|
1041
|
+
A = !1;
|
|
1042
|
+
break;
|
|
1043
|
+
}
|
|
1044
|
+
}
|
|
1045
|
+
let g = !0;
|
|
1046
|
+
for (const l of e)
|
|
1047
|
+
if (l.type === "upload" && l.key) {
|
|
1048
|
+
if (u[l.key] === null || u[l.key] === void 0) {
|
|
1049
|
+
g = !1;
|
|
1050
|
+
break;
|
|
1051
|
+
}
|
|
1052
|
+
} else if (l.type === "variable" && l.key)
|
|
1053
|
+
if (l.isMultiVariable) {
|
|
1054
|
+
const a = t.current.querySelectorAll(
|
|
1055
|
+
`[data-type="variable"][data-multi-key="${l.key}"]`
|
|
1028
1056
|
);
|
|
1029
|
-
|
|
1030
|
-
|
|
1057
|
+
let n = 0;
|
|
1058
|
+
for (const r of Array.from(a))
|
|
1059
|
+
r.innerText.replace(/[\u200B\n]/g, "").trim().length > 0 && (n += 1);
|
|
1060
|
+
const o = l.minCount && l.minCount > 0 ? l.minCount : 1;
|
|
1061
|
+
if (n < o) {
|
|
1062
|
+
g = !1;
|
|
1031
1063
|
break;
|
|
1032
1064
|
}
|
|
1033
|
-
} else
|
|
1065
|
+
} else {
|
|
1034
1066
|
const a = t.current.querySelector(
|
|
1035
|
-
`[data-type="
|
|
1067
|
+
`[data-type="variable"][data-key="${l.key}"]`
|
|
1036
1068
|
);
|
|
1037
|
-
if (!a
|
|
1038
|
-
|
|
1069
|
+
if (!a) {
|
|
1070
|
+
g = !1;
|
|
1039
1071
|
break;
|
|
1040
1072
|
}
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
`[data-type="datepicker"][data-key="${e.key}"]`
|
|
1044
|
-
);
|
|
1045
|
-
if (!a || (a.getAttribute("data-value") || "").trim().length === 0) {
|
|
1046
|
-
n = !1;
|
|
1073
|
+
if (a.innerText.replace(/[\u200B\n]/g, "").trim().length === 0) {
|
|
1074
|
+
g = !1;
|
|
1047
1075
|
break;
|
|
1048
1076
|
}
|
|
1049
1077
|
}
|
|
1050
|
-
l
|
|
1051
|
-
|
|
1078
|
+
else if (l.type === "select" && l.key) {
|
|
1079
|
+
const a = t.current.querySelector(
|
|
1080
|
+
`[data-type="select"][data-key="${l.key}"]`
|
|
1081
|
+
);
|
|
1082
|
+
if (!a || (a.value || "").trim().length === 0) {
|
|
1083
|
+
g = !1;
|
|
1084
|
+
break;
|
|
1085
|
+
}
|
|
1086
|
+
} else if (l.type === "textarea" && l.key) {
|
|
1087
|
+
const a = t.current.querySelector(
|
|
1088
|
+
`[data-type="textarea"][data-key="${l.key}"]`
|
|
1089
|
+
);
|
|
1090
|
+
if (!a || (a.value || "").trim().length === 0) {
|
|
1091
|
+
g = !1;
|
|
1092
|
+
break;
|
|
1093
|
+
}
|
|
1094
|
+
} else if (l.type === "richtext" && l.key) {
|
|
1095
|
+
const a = t.current.querySelector(
|
|
1096
|
+
`[data-type="richtext"][data-key="${l.key}"]`
|
|
1097
|
+
);
|
|
1098
|
+
if (!a || (a.textContent || "").replace(/[\u200B]/g, "").trim().length === 0) {
|
|
1099
|
+
g = !1;
|
|
1100
|
+
break;
|
|
1101
|
+
}
|
|
1102
|
+
} else if (l.type === "datepicker" && l.key) {
|
|
1103
|
+
const a = t.current.querySelector(
|
|
1104
|
+
`[data-type="datepicker"][data-key="${l.key}"]`
|
|
1105
|
+
);
|
|
1106
|
+
if (!a || (a.getAttribute("data-value") || "").trim().length === 0) {
|
|
1107
|
+
g = !1;
|
|
1108
|
+
break;
|
|
1109
|
+
}
|
|
1110
|
+
}
|
|
1111
|
+
i(A && g);
|
|
1052
1112
|
}
|
|
1053
|
-
function
|
|
1113
|
+
function Ve(t, y) {
|
|
1054
1114
|
if (!t.current) return;
|
|
1055
|
-
t.current.querySelectorAll('[data-type="variable"]').forEach((
|
|
1056
|
-
const
|
|
1057
|
-
|
|
1115
|
+
t.current.querySelectorAll('[data-type="variable"]').forEach((i) => {
|
|
1116
|
+
const c = i.innerText.replace(/\n/g, "");
|
|
1117
|
+
c.replace(/\u200B/g, "") ? i.classList.remove("show-placeholder") : (c !== "" && (i.innerText = ""), i.classList.add("show-placeholder"));
|
|
1058
1118
|
});
|
|
1059
1119
|
}
|
|
1060
|
-
function
|
|
1120
|
+
function qt(t, y, u, i, c, k = {}, L) {
|
|
1061
1121
|
if (!t.current) return;
|
|
1062
|
-
let E = "",
|
|
1063
|
-
for (;
|
|
1064
|
-
const e =
|
|
1065
|
-
if (e.type === "text" && (e.text?.includes("icon-bitian") || e.className === "rte-text-required") &&
|
|
1066
|
-
const
|
|
1067
|
-
if (
|
|
1068
|
-
const
|
|
1069
|
-
let
|
|
1070
|
-
e.className ?
|
|
1071
|
-
const T =
|
|
1072
|
-
let
|
|
1073
|
-
|
|
1074
|
-
const
|
|
1075
|
-
E +=
|
|
1122
|
+
let E = "", C = 0;
|
|
1123
|
+
for (; C < y.length; ) {
|
|
1124
|
+
const e = y[C], A = C + 1 < y.length ? y[C + 1] : null;
|
|
1125
|
+
if (e.type === "text" && (e.text?.includes("icon-bitian") || e.className === "rte-text-required") && A) {
|
|
1126
|
+
const r = A.type === "upload" && A.exclusionGroup === "fileInput" && e.exclusionGroup === "fileInput" && e.exclusionGroup === A.exclusionGroup, s = A.type === "variable" && A.exclusionGroup === "textInput" && e.exclusionGroup === "textInput" && e.exclusionGroup === A.exclusionGroup;
|
|
1127
|
+
if (r) {
|
|
1128
|
+
const h = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group">`, x = "</span>";
|
|
1129
|
+
let G = "";
|
|
1130
|
+
e.className ? G = `<span class="${e.className}">${e.text ?? ""}</span>` : G = e.text ?? "";
|
|
1131
|
+
const T = A, _ = u[T.key] !== null && u[T.key] !== void 0, H = _ ? u[T.key] : null, D = _ ? u[T.key]?.name : T.text, K = _ ? "" : "hidden", Q = T.tooltip && !_ ? "" : "hidden", Y = _ ? "has-file" : "", te = _ && D ? ` data-file-name="${D.replace(/"/g, """)}"` : "";
|
|
1132
|
+
let N = "";
|
|
1133
|
+
_ && H && (H.type?.startsWith("image/") ? N = `<img class="upload-icon-img upload-icon-preview" src="${URL.createObjectURL(H)}" alt="preview" />` : N = "<i class='iconfont icon-exlwenjian'></i>");
|
|
1134
|
+
const M = `<span contenteditable="false" data-type="upload" data-key="${T.key}" class="upload-chip"><span class="upload-inner-wrapper ${Y}"><span class="upload-icon">${N}</span><span class="upload-label"${te}>${D || T.text}</span>${T.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi upload-info-icon ${Q}" data-upload-key="${T.key}" data-tooltip="${T.tooltip}" title="提示"></i>` : ""}<span class="file-remove-btn ${K}" title="移除文件">×</span></span></span>`;
|
|
1135
|
+
E += h + G + M + x, C += 2;
|
|
1076
1136
|
continue;
|
|
1077
1137
|
}
|
|
1078
|
-
if (
|
|
1079
|
-
const
|
|
1080
|
-
let
|
|
1081
|
-
e.className ?
|
|
1082
|
-
const T =
|
|
1083
|
-
E +=
|
|
1138
|
+
if (s) {
|
|
1139
|
+
const h = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group">`, x = "</span>";
|
|
1140
|
+
let G = "";
|
|
1141
|
+
e.className ? G = `<span class="${e.className}">${e.text ?? ""}</span>` : G = e.text ?? "";
|
|
1142
|
+
const T = A, H = (T.key ? c[T.key] : void 0) || T.text || "", D = !H, K = D ? "" : H, Q = D ? "show-placeholder" : "", Y = T.exclusionGroup ? ` data-group="${T.exclusionGroup}"` : "", te = T.tooltip ? ` data-tooltip="${T.tooltip.replace(/"/g, """)}" data-variable-key="${T.key || ""}"` : "", N = T.tooltip && D ? "" : "hidden", M = `<span contenteditable="true" data-type="variable" data-key="${T.key}" data-placeholder="${T.placeholder || ""}"${Y}${te} class="variable-chip ${Q}">${K}${T.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${N}" data-variable-key="${T.key}" data-tooltip="${T.tooltip.replace(/"/g, """)}" title="提示"></i>` : ""}</span>`;
|
|
1143
|
+
E += h + G + M + x, C += 2;
|
|
1084
1144
|
continue;
|
|
1085
1145
|
}
|
|
1086
1146
|
}
|
|
1087
|
-
const
|
|
1088
|
-
let
|
|
1147
|
+
const l = e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : "", a = e.exclusionGroup ? `<span ${l} class="exclusion-wrapper">` : "", n = e.exclusionGroup ? "</span>" : "";
|
|
1148
|
+
let o = "";
|
|
1089
1149
|
if (e.type === "tag") {
|
|
1090
|
-
const
|
|
1091
|
-
|
|
1150
|
+
const s = i || L === "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>', d = i ? ' data-locked="true"' : "", h = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, """)}" data-tag-key="${e.key || ""}"` : "";
|
|
1151
|
+
o = `<span contenteditable="false" class="tag-node group"${d}${h}><span class="tag-label">${e.text}</span>${s}</span>`;
|
|
1092
1152
|
} else if (e.type === "text") {
|
|
1093
|
-
const
|
|
1094
|
-
e.className ?
|
|
1153
|
+
const r = i ? ' data-locked="true" contenteditable="false"' : ' contenteditable="false"', d = (e.text ?? "").replace(/\n/g, "<br/>");
|
|
1154
|
+
e.className ? o = `<span class="${e.className}"${r}>${d}</span>` : o = i ? `<span${r}>${d}</span>` : `<span contenteditable="false">${d}</span>`;
|
|
1095
1155
|
} else if (e.type === "variable" && e.key) {
|
|
1096
|
-
const
|
|
1097
|
-
e.required ?
|
|
1156
|
+
const s = c[e.key] || e.text || "", d = !s, h = d ? "" : s, x = d ? "show-placeholder" : "", G = e.exclusionGroup ? ` data-group="${e.exclusionGroup}"` : "", T = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, """)}" data-variable-key="${e.key || ""}"` : "", _ = e.tooltip && d ? "" : "hidden", H = `<span contenteditable="true" data-type="variable" data-key="${e.key}" data-placeholder="${e.placeholder || ""}"${G}${T} class="variable-chip ${x}">${h}${e.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${_}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g, """)}" title="提示"></i>` : ""}</span>`;
|
|
1157
|
+
e.required ? o = `<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>${H}</span>` : o = H;
|
|
1098
1158
|
} else if (e.type === "upload" && e.key) {
|
|
1099
|
-
const
|
|
1100
|
-
let
|
|
1101
|
-
|
|
1102
|
-
const H = `<span contenteditable="false" data-type="upload" data-key="${e.key}" class="upload-chip"><span class="upload-inner-wrapper ${
|
|
1103
|
-
e.required ?
|
|
1159
|
+
const r = u[e.key] !== null && u[e.key] !== void 0, s = r ? u[e.key] : null, d = r ? u[e.key]?.name : e.text, h = r ? "" : "hidden", x = e.tooltip && !r ? "" : "hidden", G = r ? "has-file" : "", T = r && d ? ` data-file-name="${d.replace(/"/g, """)}"` : "";
|
|
1160
|
+
let _ = "";
|
|
1161
|
+
r && s && (s.type?.startsWith("image/") ? _ = `<img class="upload-icon-img upload-icon-preview" src="${URL.createObjectURL(s)}" alt="preview" />` : _ = "<i class='iconfont icon-exlwenjian'></i>");
|
|
1162
|
+
const H = `<span contenteditable="false" data-type="upload" data-key="${e.key}" class="upload-chip"><span class="upload-inner-wrapper ${G}"><span class="upload-icon">${_}</span><span class="upload-label"${T}>${d || e.text}</span>${e.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi upload-info-icon ${x}" data-upload-key="${e.key}" data-tooltip="${e.tooltip}" title="提示"></i>` : ""}<span class="file-remove-btn ${h}" title="移除文件">×</span></span></span>`;
|
|
1163
|
+
e.required ? o = `<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>${H}</span>` : o = H;
|
|
1104
1164
|
} else if (e.type === "select" && e.key) {
|
|
1105
|
-
const
|
|
1106
|
-
const _ =
|
|
1107
|
-
return `<option value="${
|
|
1108
|
-
}).join(""),
|
|
1109
|
-
e.required ?
|
|
1165
|
+
const r = c[e.key] ?? e.text ?? "", s = (e.options || []).map((T) => {
|
|
1166
|
+
const _ = r === T.value ? "selected" : "";
|
|
1167
|
+
return `<option value="${T.value}" ${_}>${T.label}</option>`;
|
|
1168
|
+
}).join(""), d = e.placeholder ? `<option value="" ${r ? "" : "selected"} disabled hidden>${e.placeholder}</option>` : "", G = `<span class="rte-select-wrapper">${`<select data-type="select" data-key="${e.key}" class="rte-select rte-select-has-icon">${d}${s}</select>`}<i class="iconfont icon-qiehuan-xiayizhang rte-select-icon"></i></span>`;
|
|
1169
|
+
e.required ? o = `<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>${G}</span>` : o = G;
|
|
1110
1170
|
} else if (e.type === "textarea" && e.key) {
|
|
1111
|
-
const
|
|
1112
|
-
e.required ?
|
|
1171
|
+
const r = c[e.key] || "", s = e.maxHeight || 252, d = e.expandable !== !1, h = e.placeholder ? ` placeholder="${e.placeholder}"` : "", x = `<textarea data-type="textarea" data-key="${e.key}" class="rte-textarea" data-max-height="${s}" style="max-height:${s}px;"${h}>${r}</textarea>`, G = d ? `<button type="button" class="rte-textarea-toggle" data-key="${e.key}" data-expanded="false">展开</button>` : "", T = `<div class="rte-textarea-wrapper" data-key="${e.key}">${x}${G}</div>`;
|
|
1172
|
+
e.required ? o = `<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>${T}</span>` : o = T;
|
|
1113
1173
|
} else if (e.type === "richtext" && e.key) {
|
|
1114
|
-
const
|
|
1115
|
-
e.required ?
|
|
1174
|
+
const r = c[e.key] || e.text || "", s = e.minHeight || 140, d = e.placeholder ? ` data-placeholder="${e.placeholder}"` : "", h = e.expandable !== !1, x = r.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'"), G = `<div contenteditable="true" data-type="richtext" data-key="${e.key}" class="rte-richtext"${d} style="min-height:${s}px;">${x}</div>`, T = h ? `<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>` : "", _ = `<div class="rte-richtext-wrapper" data-key="${e.key}">${G}${T}</div>`, H = `<div class="rte-richtext-container" data-key="${e.key}">${_}</div>`;
|
|
1175
|
+
e.required ? o = `<div ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group rte-richtext-required"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${H}</div>` : o = H;
|
|
1116
1176
|
} else if (e.type === "datepicker" && e.key) {
|
|
1117
|
-
const
|
|
1118
|
-
e.required ?
|
|
1177
|
+
const r = c[e.key] || "", s = e.placeholder ? ` data-placeholder="${e.placeholder}"` : "", d = `<div data-type="datepicker" data-key="${e.key}" data-value="${r}" class="rte-datepicker-host"${s}></div>`;
|
|
1178
|
+
e.required ? o = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${d}</span>` : o = d;
|
|
1119
1179
|
} else if (e.type === "multi-variable" && e.key) {
|
|
1120
|
-
const
|
|
1180
|
+
const r = e.maxCount || 9, s = k[e.key] || 1, d = Math.min(s, r);
|
|
1121
1181
|
if (e.required) {
|
|
1122
|
-
const
|
|
1123
|
-
let
|
|
1124
|
-
for (let T = 0; T <
|
|
1125
|
-
const
|
|
1126
|
-
T === 0 ?
|
|
1182
|
+
const h = `<span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>`, x = e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : "";
|
|
1183
|
+
let G = "";
|
|
1184
|
+
for (let T = 0; T < d; T++) {
|
|
1185
|
+
const _ = `${e.key}_${T}`, H = c[_] || "", D = !H, K = D ? "" : H, Q = D ? "show-placeholder" : "", Y = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, """)}" data-variable-key="${e.key || ""}"` : "", te = e.tooltip && D ? "" : "hidden", N = `<span contenteditable="true" data-type="variable" data-key="${_}" data-multi-key="${e.key}" data-index="${T}" data-placeholder="${e.placeholder || ""}"${Y} class="variable-chip ${Q}">${K}${e.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${te}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g, """)}" title="提示"></i>` : ""}</span>`;
|
|
1186
|
+
T === 0 ? G += `<span ${x} class="exclusion-wrapper required-upload-group required-multi-first">${h}${N}</span>` : G += N;
|
|
1127
1187
|
}
|
|
1128
|
-
|
|
1188
|
+
o = G;
|
|
1129
1189
|
} else {
|
|
1130
|
-
let
|
|
1131
|
-
for (let
|
|
1132
|
-
const
|
|
1133
|
-
|
|
1190
|
+
let h = "";
|
|
1191
|
+
for (let x = 0; x < d; x++) {
|
|
1192
|
+
const G = `${e.key}_${x}`, T = c[G] || "", _ = !T, H = _ ? "" : T, D = _ ? "show-placeholder" : "", K = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, """)}" data-variable-key="${e.key || ""}"` : "", Q = e.tooltip && _ ? "" : "hidden", Y = `<span contenteditable="true" data-type="variable" data-key="${G}" data-multi-key="${e.key}" data-index="${x}" data-placeholder="${e.placeholder || ""}"${K} class="variable-chip ${D}">${H}${e.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${Q}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g, """)}" title="提示"></i>` : ""}</span>`;
|
|
1193
|
+
h += Y;
|
|
1134
1194
|
}
|
|
1135
|
-
|
|
1195
|
+
o = h;
|
|
1136
1196
|
}
|
|
1137
1197
|
}
|
|
1138
|
-
E +=
|
|
1198
|
+
E += a + o + n, C++;
|
|
1139
1199
|
}
|
|
1140
1200
|
t.current && (t.current.innerHTML = E, setTimeout(() => {
|
|
1141
1201
|
if (!t.current) return;
|
|
1142
|
-
t.current.querySelectorAll('[data-type="variable"]').forEach((
|
|
1143
|
-
const
|
|
1144
|
-
|
|
1202
|
+
t.current.querySelectorAll('[data-type="variable"]').forEach((A) => {
|
|
1203
|
+
const g = A.innerText.replace(/\n/g, "");
|
|
1204
|
+
g.replace(/\u200B/g, "") ? A.classList.remove("show-placeholder") : (g !== "" && (A.innerText = ""), A.classList.add("show-placeholder"));
|
|
1145
1205
|
});
|
|
1146
1206
|
}, 0));
|
|
1147
1207
|
}
|
|
1148
|
-
function
|
|
1149
|
-
const
|
|
1208
|
+
function Ct(t, y, u, i, c = {}, k, L, E) {
|
|
1209
|
+
const C = U(() => {
|
|
1150
1210
|
if (!t.current) return;
|
|
1151
|
-
if (
|
|
1211
|
+
if (y.length === 0) {
|
|
1152
1212
|
t.current.innerHTML = "";
|
|
1153
1213
|
return;
|
|
1154
1214
|
}
|
|
1155
1215
|
let e = {};
|
|
1156
|
-
const
|
|
1157
|
-
if (
|
|
1216
|
+
const g = t.current.__tempVariableValues;
|
|
1217
|
+
if (g ? (e = g, setTimeout(() => {
|
|
1158
1218
|
if (t.current) {
|
|
1159
|
-
const
|
|
1160
|
-
|
|
1219
|
+
const l = t.current;
|
|
1220
|
+
l.__tempVariableValues === g && delete l.__tempVariableValues;
|
|
1161
1221
|
}
|
|
1162
|
-
}, 100)) : (t.current.querySelectorAll('[data-type="variable"]').forEach((
|
|
1163
|
-
const
|
|
1164
|
-
if (
|
|
1165
|
-
const
|
|
1166
|
-
|
|
1222
|
+
}, 100)) : (t.current.querySelectorAll('[data-type="variable"]').forEach((s) => {
|
|
1223
|
+
const d = s.dataset.key;
|
|
1224
|
+
if (d) {
|
|
1225
|
+
const h = s.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
1226
|
+
h && (e[d] = h);
|
|
1167
1227
|
}
|
|
1168
|
-
}), t.current.querySelectorAll('[data-type="select"]').forEach((
|
|
1169
|
-
const
|
|
1170
|
-
if (
|
|
1171
|
-
const
|
|
1172
|
-
|
|
1228
|
+
}), t.current.querySelectorAll('[data-type="select"]').forEach((s) => {
|
|
1229
|
+
const d = s.dataset.key;
|
|
1230
|
+
if (d) {
|
|
1231
|
+
const h = s.value.trim();
|
|
1232
|
+
h && (e[d] = h);
|
|
1173
1233
|
}
|
|
1174
|
-
}), t.current.querySelectorAll('[data-type="textarea"]').forEach((
|
|
1175
|
-
const
|
|
1176
|
-
if (
|
|
1177
|
-
const
|
|
1178
|
-
|
|
1234
|
+
}), t.current.querySelectorAll('[data-type="textarea"]').forEach((s) => {
|
|
1235
|
+
const d = s.dataset.key;
|
|
1236
|
+
if (d) {
|
|
1237
|
+
const h = s.value.replace(/[\u200B]/g, "").trim();
|
|
1238
|
+
h && (e[d] = h);
|
|
1179
1239
|
}
|
|
1180
|
-
}), t.current.querySelectorAll('[data-type="richtext"]').forEach((
|
|
1181
|
-
const
|
|
1182
|
-
if (
|
|
1183
|
-
const
|
|
1184
|
-
|
|
1240
|
+
}), t.current.querySelectorAll('[data-type="richtext"]').forEach((s) => {
|
|
1241
|
+
const d = s.dataset.key;
|
|
1242
|
+
if (d) {
|
|
1243
|
+
const h = (s.textContent || "").replace(/[\u200B]/g, "").trim();
|
|
1244
|
+
h && (e[d] = h);
|
|
1185
1245
|
}
|
|
1186
|
-
}), t.current.querySelectorAll('[data-type="datepicker"]').forEach((
|
|
1187
|
-
const
|
|
1188
|
-
if (
|
|
1189
|
-
const
|
|
1190
|
-
|
|
1246
|
+
}), t.current.querySelectorAll('[data-type="datepicker"]').forEach((s) => {
|
|
1247
|
+
const d = s.dataset.key;
|
|
1248
|
+
if (d) {
|
|
1249
|
+
const h = (s.getAttribute("data-value") || "").trim();
|
|
1250
|
+
h && (e[d] = h);
|
|
1191
1251
|
}
|
|
1192
|
-
})),
|
|
1193
|
-
const { key:
|
|
1252
|
+
})), qt(t, y, u, i, e, c, E), k?.current) {
|
|
1253
|
+
const { key: l, offset: a } = k.current;
|
|
1194
1254
|
setTimeout(() => {
|
|
1195
1255
|
if (!t.current) return;
|
|
1196
|
-
const
|
|
1197
|
-
`[data-type="variable"][data-key="${
|
|
1256
|
+
const n = t.current.querySelector(
|
|
1257
|
+
`[data-type="variable"][data-key="${l}"]`
|
|
1198
1258
|
);
|
|
1199
|
-
if (
|
|
1259
|
+
if (n) {
|
|
1200
1260
|
try {
|
|
1201
|
-
const
|
|
1202
|
-
|
|
1261
|
+
const o = document.createRange(), r = document.createTreeWalker(
|
|
1262
|
+
n,
|
|
1203
1263
|
NodeFilter.SHOW_TEXT,
|
|
1204
1264
|
null
|
|
1205
1265
|
);
|
|
1206
|
-
let
|
|
1207
|
-
for (;
|
|
1208
|
-
const
|
|
1209
|
-
if (
|
|
1210
|
-
|
|
1266
|
+
let s = 0, d = null, h = 0;
|
|
1267
|
+
for (; r.nextNode(); ) {
|
|
1268
|
+
const x = r.currentNode, G = x.textContent?.length || 0;
|
|
1269
|
+
if (s + G >= a) {
|
|
1270
|
+
d = x, h = a - s;
|
|
1211
1271
|
break;
|
|
1212
1272
|
}
|
|
1213
|
-
|
|
1273
|
+
s += G;
|
|
1214
1274
|
}
|
|
1215
|
-
if (
|
|
1216
|
-
|
|
1217
|
-
const
|
|
1218
|
-
|
|
1275
|
+
if (d) {
|
|
1276
|
+
o.setStart(d, Math.min(h, d.textContent?.length || 0)), o.collapse(!0);
|
|
1277
|
+
const x = window.getSelection();
|
|
1278
|
+
x && (x.removeAllRanges(), x.addRange(o), n.focus());
|
|
1219
1279
|
} else {
|
|
1220
|
-
|
|
1221
|
-
const
|
|
1222
|
-
|
|
1280
|
+
o.selectNodeContents(n), o.collapse(!1);
|
|
1281
|
+
const x = window.getSelection();
|
|
1282
|
+
x && (x.removeAllRanges(), x.addRange(o), n.focus());
|
|
1223
1283
|
}
|
|
1224
1284
|
} catch {
|
|
1225
|
-
const
|
|
1226
|
-
|
|
1227
|
-
const
|
|
1228
|
-
|
|
1285
|
+
const o = document.createRange();
|
|
1286
|
+
o.selectNodeContents(n), o.collapse(!1);
|
|
1287
|
+
const r = window.getSelection();
|
|
1288
|
+
r && (r.removeAllRanges(), r.addRange(o), n.focus());
|
|
1229
1289
|
}
|
|
1230
1290
|
k.current = null;
|
|
1231
1291
|
}
|
|
1232
1292
|
}, 0);
|
|
1233
1293
|
}
|
|
1234
|
-
}, [
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
}, [
|
|
1294
|
+
}, [y, u, i, t, c, k, L, E]);
|
|
1295
|
+
ae(() => {
|
|
1296
|
+
C();
|
|
1297
|
+
}, [C]);
|
|
1238
1298
|
}
|
|
1239
|
-
function
|
|
1240
|
-
|
|
1241
|
-
const
|
|
1242
|
-
if (!
|
|
1299
|
+
function Tt(t, y, u, i) {
|
|
1300
|
+
ae(() => {
|
|
1301
|
+
const c = t.current;
|
|
1302
|
+
if (!c) return;
|
|
1243
1303
|
const k = (E) => {
|
|
1244
|
-
const
|
|
1245
|
-
if (
|
|
1246
|
-
const
|
|
1247
|
-
|
|
1304
|
+
const C = E.target?.closest(".upload-info-icon");
|
|
1305
|
+
if (C && C.classList.contains("upload-info-icon")) {
|
|
1306
|
+
const A = C.dataset.uploadKey;
|
|
1307
|
+
A && i({ key: A, anchorEl: C, type: "upload" });
|
|
1248
1308
|
return;
|
|
1249
1309
|
}
|
|
1250
1310
|
const e = E.target?.closest('[data-type="upload"]');
|
|
1251
1311
|
if (e) {
|
|
1252
|
-
const
|
|
1253
|
-
if (
|
|
1254
|
-
const
|
|
1255
|
-
|
|
1312
|
+
const A = e.dataset.key;
|
|
1313
|
+
if (A) {
|
|
1314
|
+
const g = u[A];
|
|
1315
|
+
g && g.type && g.type.startsWith("image/") && i({ key: A, anchorEl: e, type: "upload-preview" });
|
|
1256
1316
|
}
|
|
1257
1317
|
}
|
|
1258
|
-
},
|
|
1259
|
-
const
|
|
1260
|
-
if (
|
|
1261
|
-
!e || !
|
|
1318
|
+
}, L = (E) => {
|
|
1319
|
+
const C = E.target?.closest(".upload-info-icon"), e = E.relatedTarget;
|
|
1320
|
+
if (C && C.classList.contains("upload-info-icon")) {
|
|
1321
|
+
!e || !c.contains(e) ? i(null) : e.closest(".upload-info-icon") || i(null);
|
|
1262
1322
|
return;
|
|
1263
1323
|
}
|
|
1264
|
-
const
|
|
1265
|
-
if (
|
|
1266
|
-
const
|
|
1267
|
-
if (
|
|
1324
|
+
const A = E.target?.closest('[data-type="upload"]');
|
|
1325
|
+
if (A) {
|
|
1326
|
+
const g = e;
|
|
1327
|
+
if (g && A.contains(g))
|
|
1268
1328
|
return;
|
|
1269
|
-
|
|
1329
|
+
i(null);
|
|
1270
1330
|
}
|
|
1271
1331
|
};
|
|
1272
|
-
return
|
|
1273
|
-
|
|
1332
|
+
return c.addEventListener("mouseover", k, !0), c.addEventListener("mouseout", L, !0), () => {
|
|
1333
|
+
c.removeEventListener("mouseover", k, !0), c.removeEventListener("mouseout", L, !0);
|
|
1274
1334
|
};
|
|
1275
|
-
}, [
|
|
1335
|
+
}, [y, u, t, i]);
|
|
1276
1336
|
}
|
|
1277
|
-
function
|
|
1278
|
-
|
|
1337
|
+
function $t(t, y, u, i) {
|
|
1338
|
+
ae(() => {
|
|
1279
1339
|
if (!t.current) return;
|
|
1280
|
-
const
|
|
1281
|
-
if (
|
|
1340
|
+
const c = (C) => {
|
|
1341
|
+
if (i === "hideTagClose")
|
|
1282
1342
|
return;
|
|
1283
|
-
const e =
|
|
1284
|
-
|
|
1343
|
+
const e = C.currentTarget, A = e.dataset.tooltip, g = e.dataset.tagKey || "";
|
|
1344
|
+
A && u({ key: g, anchorEl: e, type: "tag" });
|
|
1285
1345
|
}, k = () => {
|
|
1286
|
-
|
|
1346
|
+
u(null);
|
|
1287
1347
|
};
|
|
1288
|
-
let
|
|
1348
|
+
let L;
|
|
1289
1349
|
const E = () => {
|
|
1290
1350
|
if (!t.current) return;
|
|
1291
1351
|
t.current.querySelectorAll(
|
|
1292
1352
|
".tag-node[data-tooltip]"
|
|
1293
1353
|
).forEach((e) => {
|
|
1294
|
-
e.addEventListener("mouseenter",
|
|
1354
|
+
e.addEventListener("mouseenter", c), e.addEventListener("mouseleave", k);
|
|
1295
1355
|
});
|
|
1296
1356
|
};
|
|
1297
|
-
return
|
|
1298
|
-
|
|
1357
|
+
return L = requestAnimationFrame(() => {
|
|
1358
|
+
L = requestAnimationFrame(E);
|
|
1299
1359
|
}), () => {
|
|
1300
|
-
cancelAnimationFrame(
|
|
1360
|
+
cancelAnimationFrame(L), t.current && t.current.querySelectorAll(
|
|
1301
1361
|
".tag-node[data-tooltip]"
|
|
1302
1362
|
).forEach((e) => {
|
|
1303
|
-
e.removeEventListener("mouseenter",
|
|
1363
|
+
e.removeEventListener("mouseenter", c), e.removeEventListener("mouseleave", k);
|
|
1304
1364
|
});
|
|
1305
1365
|
};
|
|
1306
|
-
}, [
|
|
1366
|
+
}, [y, t, u, i]);
|
|
1307
1367
|
}
|
|
1308
|
-
function Nt(t,
|
|
1309
|
-
|
|
1310
|
-
const
|
|
1311
|
-
if (!
|
|
1312
|
-
const
|
|
1313
|
-
const E =
|
|
1368
|
+
function Nt(t, y, u) {
|
|
1369
|
+
ae(() => {
|
|
1370
|
+
const i = t.current;
|
|
1371
|
+
if (!i) return;
|
|
1372
|
+
const c = (L) => {
|
|
1373
|
+
const E = L.target?.closest(".variable-info-icon");
|
|
1314
1374
|
if (E && E.classList.contains("variable-info-icon")) {
|
|
1315
|
-
const
|
|
1316
|
-
|
|
1375
|
+
const C = E.dataset.variableKey;
|
|
1376
|
+
C && u({ key: C, anchorEl: E, type: "variable" });
|
|
1317
1377
|
}
|
|
1318
|
-
}, k = (
|
|
1319
|
-
const E =
|
|
1320
|
-
E && E.classList.contains("variable-info-icon") && (!
|
|
1378
|
+
}, k = (L) => {
|
|
1379
|
+
const E = L.target?.closest(".variable-info-icon"), C = L.relatedTarget;
|
|
1380
|
+
E && E.classList.contains("variable-info-icon") && (!C || !i.contains(C) ? u(null) : C.closest(".variable-info-icon") || u(null));
|
|
1321
1381
|
};
|
|
1322
|
-
return
|
|
1323
|
-
|
|
1382
|
+
return i.addEventListener("mouseover", c, !0), i.addEventListener("mouseout", k, !0), () => {
|
|
1383
|
+
i.removeEventListener("mouseover", c, !0), i.removeEventListener("mouseout", k, !0);
|
|
1324
1384
|
};
|
|
1325
|
-
}, [
|
|
1385
|
+
}, [y, t, u]);
|
|
1326
1386
|
}
|
|
1327
|
-
function St(t,
|
|
1328
|
-
|
|
1387
|
+
function St(t, y, u, i) {
|
|
1388
|
+
ae(() => {
|
|
1329
1389
|
if (!t.current) return;
|
|
1330
|
-
const
|
|
1331
|
-
const e =
|
|
1332
|
-
e.dataset.fileName &&
|
|
1390
|
+
const c = (C) => {
|
|
1391
|
+
const e = C.currentTarget;
|
|
1392
|
+
e.dataset.fileName && i({ key: "", anchorEl: e, type: "upload-label" });
|
|
1333
1393
|
}, k = () => {
|
|
1334
|
-
|
|
1394
|
+
i(null);
|
|
1335
1395
|
};
|
|
1336
|
-
let
|
|
1396
|
+
let L;
|
|
1337
1397
|
const E = () => {
|
|
1338
1398
|
if (!t.current) return;
|
|
1339
1399
|
t.current.querySelectorAll(
|
|
1340
1400
|
".upload-label[data-file-name]"
|
|
1341
1401
|
).forEach((e) => {
|
|
1342
|
-
e.addEventListener("mouseenter",
|
|
1402
|
+
e.addEventListener("mouseenter", c), e.addEventListener("mouseleave", k);
|
|
1343
1403
|
});
|
|
1344
1404
|
};
|
|
1345
|
-
return
|
|
1346
|
-
|
|
1405
|
+
return L = requestAnimationFrame(() => {
|
|
1406
|
+
L = requestAnimationFrame(E);
|
|
1347
1407
|
}), () => {
|
|
1348
|
-
cancelAnimationFrame(
|
|
1408
|
+
cancelAnimationFrame(L), t.current && t.current.querySelectorAll(
|
|
1349
1409
|
".upload-label[data-file-name]"
|
|
1350
1410
|
).forEach((e) => {
|
|
1351
|
-
e.removeEventListener("mouseenter",
|
|
1411
|
+
e.removeEventListener("mouseenter", c), e.removeEventListener("mouseleave", k);
|
|
1352
1412
|
});
|
|
1353
1413
|
};
|
|
1354
|
-
}, [
|
|
1414
|
+
}, [y, u, t, i]);
|
|
1355
1415
|
}
|
|
1356
|
-
function At(t,
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1416
|
+
function At(t, y, u, i) {
|
|
1417
|
+
ae(() => {
|
|
1418
|
+
const c = setTimeout(() => {
|
|
1419
|
+
Te(t, y, u), $e(t, y, u, i);
|
|
1420
|
+
}, 0);
|
|
1421
|
+
return () => clearTimeout(c);
|
|
1422
|
+
}, [u, y, t, i]), ae(() => {
|
|
1423
|
+
const c = t.current;
|
|
1424
|
+
if (!c) return;
|
|
1425
|
+
const k = (L) => {
|
|
1426
|
+
const E = L.target;
|
|
1427
|
+
E && E.matches('[data-type="select"]') && (Te(t, y, u), $e(t, y, u, i));
|
|
1428
|
+
};
|
|
1429
|
+
return c.addEventListener("change", k, !0), () => {
|
|
1430
|
+
c.removeEventListener("change", k, !0);
|
|
1431
|
+
};
|
|
1432
|
+
}, [y, u, t, i]);
|
|
1360
1433
|
}
|
|
1361
|
-
function
|
|
1362
|
-
|
|
1434
|
+
function Lt(t, y) {
|
|
1435
|
+
ae(() => {
|
|
1363
1436
|
if (!t.current) return;
|
|
1364
|
-
let
|
|
1365
|
-
const
|
|
1366
|
-
|
|
1437
|
+
let u = !1, i = 0;
|
|
1438
|
+
const c = () => {
|
|
1439
|
+
u = !0;
|
|
1367
1440
|
}, k = () => {
|
|
1368
|
-
|
|
1441
|
+
u = !1, i = Date.now();
|
|
1369
1442
|
};
|
|
1370
|
-
let
|
|
1371
|
-
const
|
|
1372
|
-
|
|
1443
|
+
let L = !1, E = 0;
|
|
1444
|
+
const C = () => {
|
|
1445
|
+
L = !0;
|
|
1373
1446
|
}, e = () => {
|
|
1374
|
-
|
|
1375
|
-
},
|
|
1447
|
+
L = !1, E = Date.now();
|
|
1448
|
+
}, A = () => {
|
|
1376
1449
|
E = Date.now();
|
|
1377
|
-
},
|
|
1450
|
+
}, g = () => {
|
|
1378
1451
|
if (!t.current) return;
|
|
1379
|
-
const
|
|
1380
|
-
if (!
|
|
1452
|
+
const a = window.getSelection();
|
|
1453
|
+
if (!a || a.rangeCount === 0 || y.current || u || L || Date.now() - E < 500)
|
|
1381
1454
|
return;
|
|
1382
|
-
const
|
|
1383
|
-
if (!
|
|
1384
|
-
return t.current.contains(
|
|
1385
|
-
const
|
|
1386
|
-
if (!
|
|
1455
|
+
const n = a.getRangeAt(0);
|
|
1456
|
+
if (!n.collapsed)
|
|
1457
|
+
return t.current.contains(n.commonAncestorContainer), void 0;
|
|
1458
|
+
const o = a.anchorNode;
|
|
1459
|
+
if (!o || !t.current.contains(o))
|
|
1387
1460
|
return;
|
|
1388
|
-
let
|
|
1389
|
-
if (
|
|
1390
|
-
if (Date.now() -
|
|
1461
|
+
let r = null;
|
|
1462
|
+
if (o.nodeType === Node.ELEMENT_NODE ? r = o.closest('[data-type="variable"]') : o.nodeType === Node.TEXT_NODE && o.parentElement && (r = o.parentElement.closest('[data-type="variable"]')), !r) {
|
|
1463
|
+
if (Date.now() - i > 500)
|
|
1391
1464
|
return;
|
|
1392
|
-
const
|
|
1393
|
-
if (
|
|
1394
|
-
let
|
|
1395
|
-
for (const
|
|
1396
|
-
if (
|
|
1397
|
-
|
|
1465
|
+
const s = t.current.querySelectorAll('[data-type="variable"]');
|
|
1466
|
+
if (s.length > 0) {
|
|
1467
|
+
let d = null;
|
|
1468
|
+
for (const h of Array.from(s))
|
|
1469
|
+
if (h.style.display !== "none") {
|
|
1470
|
+
d = h;
|
|
1398
1471
|
break;
|
|
1399
1472
|
}
|
|
1400
|
-
if (!
|
|
1401
|
-
const
|
|
1402
|
-
|
|
1473
|
+
if (!d && s.length > 0 && (d = s[0]), d) {
|
|
1474
|
+
const h = document.createRange();
|
|
1475
|
+
h.selectNodeContents(d), h.collapse(!1), a.removeAllRanges(), a.addRange(h), d.focus();
|
|
1403
1476
|
} else
|
|
1404
|
-
|
|
1477
|
+
a.removeAllRanges();
|
|
1405
1478
|
} else
|
|
1406
|
-
|
|
1479
|
+
a.removeAllRanges();
|
|
1407
1480
|
}
|
|
1408
|
-
},
|
|
1409
|
-
return
|
|
1410
|
-
const
|
|
1411
|
-
|
|
1481
|
+
}, l = t.current;
|
|
1482
|
+
return l && (l.addEventListener("compositionstart", C), l.addEventListener("compositionend", e), l.addEventListener("input", A)), document.addEventListener("mousedown", c), document.addEventListener("mouseup", k), document.addEventListener("selectionchange", g), () => {
|
|
1483
|
+
const a = t.current;
|
|
1484
|
+
a && (a.removeEventListener("compositionstart", C), a.removeEventListener("compositionend", e), a.removeEventListener("input", A)), document.removeEventListener("mousedown", c), document.removeEventListener("mouseup", k), document.removeEventListener("selectionchange", g);
|
|
1412
1485
|
};
|
|
1413
|
-
}, [t,
|
|
1486
|
+
}, [t, y]);
|
|
1414
1487
|
}
|
|
1415
|
-
const
|
|
1488
|
+
const It = ({
|
|
1416
1489
|
config: t,
|
|
1417
|
-
onSend:
|
|
1418
|
-
isProcessing:
|
|
1419
|
-
disabled:
|
|
1420
|
-
width:
|
|
1490
|
+
onSend: y,
|
|
1491
|
+
isProcessing: u = !1,
|
|
1492
|
+
disabled: i = !1,
|
|
1493
|
+
width: c,
|
|
1421
1494
|
lockStructure: k = !1,
|
|
1422
|
-
agentOptions:
|
|
1495
|
+
agentOptions: L = [],
|
|
1423
1496
|
onAgentSelect: E,
|
|
1424
|
-
onAgentExit:
|
|
1497
|
+
onAgentExit: C,
|
|
1425
1498
|
loading: e = !1,
|
|
1426
|
-
placeholder:
|
|
1427
|
-
border:
|
|
1428
|
-
background:
|
|
1429
|
-
hideButtons:
|
|
1499
|
+
placeholder: A,
|
|
1500
|
+
border: g,
|
|
1501
|
+
background: l = "transparent",
|
|
1502
|
+
hideButtons: a
|
|
1430
1503
|
}) => {
|
|
1431
|
-
const
|
|
1432
|
-
const
|
|
1433
|
-
return t.forEach((
|
|
1434
|
-
|
|
1435
|
-
}),
|
|
1436
|
-
}),
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
}, [
|
|
1440
|
-
re.current =
|
|
1441
|
-
}, [
|
|
1442
|
-
const ce =
|
|
1443
|
-
|
|
1444
|
-
const
|
|
1445
|
-
if (
|
|
1504
|
+
const n = j(null), o = j(null), [r, s] = X({}), [d, h] = X(null), [x, G] = X(null), T = j(!1), _ = j(null), [H, D] = X(!1), K = j(null), [Q, Y] = X(!0), [te, N] = X(() => {
|
|
1505
|
+
const p = {};
|
|
1506
|
+
return t.forEach((f) => {
|
|
1507
|
+
f.type === "multi-variable" && f.key && (p[f.key] = 1);
|
|
1508
|
+
}), p;
|
|
1509
|
+
}), M = j({}), ne = j({}), re = j({});
|
|
1510
|
+
ae(() => {
|
|
1511
|
+
ne.current = r;
|
|
1512
|
+
}, [r]), ae(() => {
|
|
1513
|
+
re.current = te;
|
|
1514
|
+
}, [te]);
|
|
1515
|
+
const ce = U((p) => p.find((v) => v.type === "tag")?.text || null, []), ye = j(t), ue = j(null);
|
|
1516
|
+
ae(() => {
|
|
1517
|
+
const p = ce(ye.current), f = ce(t);
|
|
1518
|
+
if (p && p !== f && n.current) {
|
|
1446
1519
|
const v = {};
|
|
1447
|
-
|
|
1520
|
+
n.current.querySelectorAll('[data-type="variable"]').forEach((w) => {
|
|
1448
1521
|
const B = w.dataset.key;
|
|
1449
1522
|
if (B) {
|
|
1450
|
-
const
|
|
1451
|
-
|
|
1523
|
+
const $ = w.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
1524
|
+
$ && (v[B] = $);
|
|
1452
1525
|
}
|
|
1453
|
-
}),
|
|
1526
|
+
}), n.current.querySelectorAll('[data-type="select"]').forEach((w) => {
|
|
1454
1527
|
const B = w.dataset.key;
|
|
1455
1528
|
if (B) {
|
|
1456
|
-
const
|
|
1457
|
-
|
|
1529
|
+
const $ = w.value.trim();
|
|
1530
|
+
$ && (v[B] = $);
|
|
1458
1531
|
}
|
|
1459
|
-
}),
|
|
1532
|
+
}), n.current.querySelectorAll('[data-type="textarea"]').forEach((w) => {
|
|
1460
1533
|
const B = w.dataset.key;
|
|
1461
1534
|
if (B) {
|
|
1462
|
-
const
|
|
1463
|
-
|
|
1535
|
+
const $ = w.value.replace(/[\u200B]/g, "").trim();
|
|
1536
|
+
$ && (v[B] = $);
|
|
1464
1537
|
}
|
|
1465
|
-
}),
|
|
1538
|
+
}), M.current[p] = {
|
|
1466
1539
|
variableValues: v,
|
|
1467
|
-
files: { ...
|
|
1540
|
+
files: { ...ne.current },
|
|
1468
1541
|
multiVariableCounts: { ...re.current }
|
|
1469
1542
|
};
|
|
1470
1543
|
}
|
|
1471
|
-
if (
|
|
1472
|
-
const v =
|
|
1473
|
-
ue.current = v,
|
|
1474
|
-
} else if (
|
|
1544
|
+
if (f && M.current[f]) {
|
|
1545
|
+
const v = M.current[f];
|
|
1546
|
+
ue.current = v, s(v.files), N(v.multiVariableCounts);
|
|
1547
|
+
} else if (f) {
|
|
1475
1548
|
ue.current = null;
|
|
1476
1549
|
const v = {};
|
|
1477
|
-
t.forEach((
|
|
1478
|
-
|
|
1479
|
-
}),
|
|
1550
|
+
t.forEach((S) => {
|
|
1551
|
+
S.type === "multi-variable" && S.key && (v[S.key] = 1);
|
|
1552
|
+
}), N(v), s({});
|
|
1480
1553
|
} else
|
|
1481
|
-
ue.current = null,
|
|
1554
|
+
ue.current = null, N({}), s({});
|
|
1482
1555
|
ye.current = t;
|
|
1483
|
-
}, [t, ce]),
|
|
1484
|
-
ue.current &&
|
|
1556
|
+
}, [t, ce]), Re(() => {
|
|
1557
|
+
ue.current && n.current && (n.current.__tempVariableValues = ue.current.variableValues, setTimeout(() => {
|
|
1485
1558
|
ue.current && (ue.current = null);
|
|
1486
1559
|
}, 0));
|
|
1487
|
-
}),
|
|
1560
|
+
}), Ct(n, t, r, k, te, K, void 0, a), Tt(n, t, r, G), $t(n, t, G, a), St(n, t, r, G), Nt(n, t, G), At(n, t, r, D), Lt(n, T), ae(() => {
|
|
1488
1561
|
if (t.length > 0) {
|
|
1489
|
-
|
|
1562
|
+
Y(!1);
|
|
1490
1563
|
return;
|
|
1491
1564
|
}
|
|
1492
|
-
const
|
|
1493
|
-
if (!
|
|
1494
|
-
|
|
1565
|
+
const p = () => {
|
|
1566
|
+
if (!n.current) {
|
|
1567
|
+
Y(!0);
|
|
1495
1568
|
return;
|
|
1496
1569
|
}
|
|
1497
|
-
const v =
|
|
1498
|
-
let
|
|
1499
|
-
|
|
1500
|
-
(B.textContent?.replace(/[\u200B\n]/g, "").trim() || "") && (
|
|
1570
|
+
const v = n.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "", S = n.current.querySelectorAll('[data-type="variable"]'), b = n.current.querySelectorAll('[data-type="upload"]');
|
|
1571
|
+
let q = !1;
|
|
1572
|
+
S.forEach((B) => {
|
|
1573
|
+
(B.textContent?.replace(/[\u200B\n]/g, "").trim() || "") && (q = !0);
|
|
1501
1574
|
}), b.forEach((B) => {
|
|
1502
|
-
B.querySelector(".upload-inner-wrapper.has-file") && (
|
|
1575
|
+
B.querySelector(".upload-inner-wrapper.has-file") && (q = !0);
|
|
1503
1576
|
});
|
|
1504
|
-
const w = !v && !
|
|
1505
|
-
|
|
1577
|
+
const w = !v && !q;
|
|
1578
|
+
Y(w), t.length === 0 && D(!w);
|
|
1506
1579
|
};
|
|
1507
|
-
|
|
1508
|
-
const
|
|
1509
|
-
return
|
|
1580
|
+
p();
|
|
1581
|
+
const f = new MutationObserver(p);
|
|
1582
|
+
return n.current && f.observe(n.current, {
|
|
1510
1583
|
childList: !0,
|
|
1511
1584
|
subtree: !0,
|
|
1512
1585
|
characterData: !0
|
|
1513
1586
|
}), () => {
|
|
1514
|
-
|
|
1587
|
+
f.disconnect();
|
|
1515
1588
|
};
|
|
1516
1589
|
}, [t]);
|
|
1517
|
-
const
|
|
1518
|
-
if (
|
|
1519
|
-
|
|
1590
|
+
const Ne = (p) => {
|
|
1591
|
+
if (i) {
|
|
1592
|
+
p.preventDefault();
|
|
1520
1593
|
return;
|
|
1521
1594
|
}
|
|
1522
|
-
|
|
1523
|
-
const
|
|
1595
|
+
p.preventDefault();
|
|
1596
|
+
const f = p.clipboardData.getData("text/plain"), v = window.getSelection();
|
|
1524
1597
|
if (v && v.rangeCount > 0) {
|
|
1525
|
-
const
|
|
1526
|
-
if (
|
|
1598
|
+
const S = v.anchorNode;
|
|
1599
|
+
if (S) {
|
|
1527
1600
|
let b = null;
|
|
1528
|
-
if (
|
|
1529
|
-
const
|
|
1530
|
-
if (
|
|
1531
|
-
const w = /[、,,\s\n\r\t]+/, B =
|
|
1532
|
-
if (console.log("[Paste Event] 粘贴的内容:",
|
|
1533
|
-
const
|
|
1534
|
-
|
|
1535
|
-
...
|
|
1536
|
-
[
|
|
1601
|
+
if (S.nodeType === Node.ELEMENT_NODE ? b = S.closest('[data-type="variable"]') : S.nodeType === Node.TEXT_NODE && S.parentElement && (b = S.parentElement.closest('[data-type="variable"]')), b) {
|
|
1602
|
+
const q = b.dataset.multiKey;
|
|
1603
|
+
if (q) {
|
|
1604
|
+
const w = /[、,,\s\n\r\t]+/, B = f.split(w).map(($) => $.trim()).filter(($) => $.length > 0);
|
|
1605
|
+
if (console.log("[Paste Event] 粘贴的内容:", f), console.log("[Paste Event] 拆分后的值:", B), B.length > 1) {
|
|
1606
|
+
const $ = parseInt(b.dataset.index || "0", 10), P = t.find((ee) => ee.type === "multi-variable" && ee.key === q)?.maxCount || 9, z = te[q] || 1, I = Math.min($ + B.length, P);
|
|
1607
|
+
I > z && N((F) => ({
|
|
1608
|
+
...F,
|
|
1609
|
+
[q]: I
|
|
1537
1610
|
}));
|
|
1538
|
-
const
|
|
1539
|
-
for (let
|
|
1540
|
-
const
|
|
1541
|
-
`[data-type="variable"][data-key="${
|
|
1611
|
+
const R = [];
|
|
1612
|
+
for (let F = 0; F < z; F++) {
|
|
1613
|
+
const ee = `${q}_${F}`, se = n.current.querySelector(
|
|
1614
|
+
`[data-type="variable"][data-key="${ee}"][data-multi-key="${q}"]`
|
|
1542
1615
|
);
|
|
1543
1616
|
if (se) {
|
|
1544
1617
|
const pe = se.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
1545
|
-
|
|
1618
|
+
R.push(pe);
|
|
1546
1619
|
}
|
|
1547
1620
|
}
|
|
1548
|
-
|
|
1549
|
-
const J =
|
|
1550
|
-
J.length > 0 && J[J.length - 1] !== "" && J.length <
|
|
1551
|
-
const
|
|
1552
|
-
J.forEach((
|
|
1553
|
-
|
|
1554
|
-
}),
|
|
1621
|
+
R.splice($, 1, ...B.slice(0, P - $));
|
|
1622
|
+
const J = R.slice(0, P);
|
|
1623
|
+
J.length > 0 && J[J.length - 1] !== "" && J.length < P && J.push("");
|
|
1624
|
+
const V = Math.max(J.length, 1), Z = {};
|
|
1625
|
+
J.forEach((F, ee) => {
|
|
1626
|
+
F && (Z[`${q}_${ee}`] = F);
|
|
1627
|
+
}), n.current.querySelectorAll(
|
|
1555
1628
|
'[data-type="variable"]'
|
|
1556
|
-
).forEach((
|
|
1557
|
-
const
|
|
1558
|
-
if (
|
|
1559
|
-
const pe =
|
|
1560
|
-
pe && (
|
|
1629
|
+
).forEach((F) => {
|
|
1630
|
+
const ee = F.dataset.key, se = F.dataset.multiKey;
|
|
1631
|
+
if (ee && se !== q) {
|
|
1632
|
+
const pe = F.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
1633
|
+
pe && (Z[ee] = pe);
|
|
1561
1634
|
}
|
|
1562
|
-
}),
|
|
1563
|
-
...
|
|
1564
|
-
[
|
|
1635
|
+
}), n.current.__tempVariableValues = Z, N((F) => ({
|
|
1636
|
+
...F,
|
|
1637
|
+
[q]: V
|
|
1565
1638
|
})), console.log("[Paste Event] 粘贴完成,已填充到多个输入框,值:", J);
|
|
1566
1639
|
return;
|
|
1567
1640
|
} else B.length === 1 && console.log("[Paste Event] 粘贴单个值,将在失去焦点时检查是否需要拆分");
|
|
@@ -1569,383 +1642,385 @@ const Lt = ({
|
|
|
1569
1642
|
}
|
|
1570
1643
|
}
|
|
1571
1644
|
}
|
|
1572
|
-
document.execCommand("insertText", !1,
|
|
1573
|
-
const
|
|
1574
|
-
if (
|
|
1575
|
-
const b =
|
|
1645
|
+
document.execCommand("insertText", !1, f), de(), setTimeout(() => {
|
|
1646
|
+
const S = window.getSelection();
|
|
1647
|
+
if (S && S.rangeCount > 0) {
|
|
1648
|
+
const b = S.anchorNode;
|
|
1576
1649
|
if (b) {
|
|
1577
|
-
let
|
|
1578
|
-
if (b.nodeType === Node.ELEMENT_NODE ?
|
|
1579
|
-
const w =
|
|
1650
|
+
let q = null;
|
|
1651
|
+
if (b.nodeType === Node.ELEMENT_NODE ? q = b.closest('[data-type="variable"][data-multi-key]') : b.nodeType === Node.TEXT_NODE && b.parentElement && (q = b.parentElement.closest('[data-type="variable"][data-multi-key]')), q) {
|
|
1652
|
+
const w = q.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
1580
1653
|
/[、,,\s]+/.test(w) && (console.log("[Paste Event] 粘贴后检测到分隔符,内容:", w), console.log("[Paste Event] 提示:失去焦点后将自动拆分"));
|
|
1581
1654
|
}
|
|
1582
1655
|
}
|
|
1583
1656
|
}
|
|
1584
1657
|
}, 0);
|
|
1585
|
-
},
|
|
1586
|
-
if (
|
|
1587
|
-
const
|
|
1588
|
-
|
|
1658
|
+
}, Se = (p) => {
|
|
1659
|
+
if (p.target.files && p.target.files[0] && d) {
|
|
1660
|
+
const f = p.target.files[0], v = d;
|
|
1661
|
+
s((S) => ({ ...S, [v]: f }));
|
|
1589
1662
|
}
|
|
1590
|
-
|
|
1591
|
-
}, xe = (
|
|
1592
|
-
|
|
1593
|
-
const v = { ...
|
|
1594
|
-
return delete v[
|
|
1663
|
+
p.target && (p.target.value = ""), h(null);
|
|
1664
|
+
}, xe = (p) => {
|
|
1665
|
+
s((f) => {
|
|
1666
|
+
const v = { ...f };
|
|
1667
|
+
return delete v[p], v;
|
|
1595
1668
|
});
|
|
1596
|
-
},
|
|
1597
|
-
const
|
|
1598
|
-
if (
|
|
1599
|
-
if (
|
|
1669
|
+
}, Ae = (p) => {
|
|
1670
|
+
const f = p.target;
|
|
1671
|
+
if (f.closest(".tag-close-btn")) {
|
|
1672
|
+
if (p.preventDefault(), p.stopPropagation(), k)
|
|
1600
1673
|
return;
|
|
1601
|
-
|
|
1674
|
+
G(null), C ? C() : n.current && (n.current.innerHTML = "", n.current.focus());
|
|
1602
1675
|
return;
|
|
1603
1676
|
}
|
|
1604
1677
|
if (k) {
|
|
1605
|
-
const b =
|
|
1606
|
-
if (b ||
|
|
1607
|
-
|
|
1678
|
+
const b = f.closest(".tag-node"), q = f.closest('[data-type="text"]');
|
|
1679
|
+
if (b || q) {
|
|
1680
|
+
p.preventDefault(), p.stopPropagation();
|
|
1608
1681
|
const w = window.getSelection();
|
|
1609
1682
|
w && w.removeAllRanges();
|
|
1610
1683
|
return;
|
|
1611
1684
|
}
|
|
1612
1685
|
}
|
|
1613
|
-
|
|
1614
|
-
}, me = (
|
|
1615
|
-
if (!
|
|
1616
|
-
const
|
|
1617
|
-
(
|
|
1686
|
+
f.closest('[data-type="variable"]') || (_.current = { x: p.clientX, y: p.clientY }, T.current = !1, f.closest(".file-remove-btn") && (p.preventDefault(), p.stopPropagation()));
|
|
1687
|
+
}, me = (p) => {
|
|
1688
|
+
if (!p.target.closest('[data-type="variable"]') && _.current) {
|
|
1689
|
+
const S = Math.abs(p.clientX - _.current.x), b = Math.abs(p.clientY - _.current.y);
|
|
1690
|
+
(S > 3 || b > 3) && (T.current = !0);
|
|
1618
1691
|
}
|
|
1619
|
-
},
|
|
1620
|
-
if (
|
|
1621
|
-
|
|
1692
|
+
}, Le = (p) => {
|
|
1693
|
+
if (p.target.closest('[data-type="variable"]')) {
|
|
1694
|
+
_.current = null, T.current = !1;
|
|
1622
1695
|
return;
|
|
1623
1696
|
}
|
|
1624
|
-
|
|
1625
|
-
},
|
|
1626
|
-
if (
|
|
1697
|
+
_.current = null, T.current = !1;
|
|
1698
|
+
}, O = (p) => {
|
|
1699
|
+
if (i)
|
|
1627
1700
|
return;
|
|
1628
|
-
const
|
|
1629
|
-
if (
|
|
1701
|
+
const f = p.target;
|
|
1702
|
+
if (f.closest('[data-type="datepicker"]'))
|
|
1630
1703
|
return;
|
|
1631
|
-
if (
|
|
1632
|
-
|
|
1704
|
+
if (f.closest(".tag-close-btn")) {
|
|
1705
|
+
p.preventDefault(), p.stopPropagation();
|
|
1633
1706
|
return;
|
|
1634
1707
|
}
|
|
1635
1708
|
if (t.length === 0)
|
|
1636
1709
|
return;
|
|
1637
|
-
const b = (
|
|
1638
|
-
if (!
|
|
1639
|
-
Array.from(
|
|
1640
|
-
if (
|
|
1641
|
-
if (
|
|
1642
|
-
|
|
1643
|
-
else if (
|
|
1644
|
-
const
|
|
1645
|
-
|
|
1710
|
+
const b = (I, R) => {
|
|
1711
|
+
if (!n.current) return;
|
|
1712
|
+
Array.from(n.current.children).forEach((V) => {
|
|
1713
|
+
if (V !== I)
|
|
1714
|
+
if (R)
|
|
1715
|
+
V.dataset.prevDisplay === void 0 && (V.dataset.prevDisplay = V.style.display || ""), V.style.setProperty("display", "none", "important");
|
|
1716
|
+
else if (V.dataset.prevDisplay !== void 0) {
|
|
1717
|
+
const Z = V.dataset.prevDisplay;
|
|
1718
|
+
Z ? V.style.display = Z : V.style.removeProperty("display"), delete V.dataset.prevDisplay;
|
|
1646
1719
|
} else
|
|
1647
|
-
|
|
1720
|
+
V.style.removeProperty("display");
|
|
1648
1721
|
});
|
|
1649
|
-
},
|
|
1650
|
-
if (
|
|
1651
|
-
|
|
1652
|
-
const
|
|
1653
|
-
|
|
1654
|
-
const
|
|
1655
|
-
if (
|
|
1656
|
-
if (
|
|
1657
|
-
|
|
1722
|
+
}, q = f.closest(".rte-textarea-toggle");
|
|
1723
|
+
if (q) {
|
|
1724
|
+
p.preventDefault(), p.stopPropagation();
|
|
1725
|
+
const I = q.closest(".rte-textarea-wrapper"), R = I?.querySelector('[data-type="textarea"]'), V = !(q.getAttribute("data-expanded") === "true");
|
|
1726
|
+
q.setAttribute("data-expanded", String(V)), q.textContent = V ? "收起" : "展开", I && I.classList.toggle("rte-textarea-expanded", V);
|
|
1727
|
+
const Z = I?.closest(".rte-textarea-required");
|
|
1728
|
+
if (Z ? Z.classList.toggle("rte-textarea-overlay", V) : I && I.classList.toggle("rte-textarea-overlay", V), R)
|
|
1729
|
+
if (V)
|
|
1730
|
+
R.classList.add("rte-textarea-expanded"), R.style.maxHeight = "none", R.style.height = "100%";
|
|
1658
1731
|
else {
|
|
1659
|
-
|
|
1660
|
-
const
|
|
1661
|
-
|
|
1732
|
+
R.classList.remove("rte-textarea-expanded");
|
|
1733
|
+
const oe = R.dataset.maxHeight || "252";
|
|
1734
|
+
R.style.maxHeight = `${oe}px`, R.style.height = "auto";
|
|
1662
1735
|
}
|
|
1663
|
-
|
|
1736
|
+
n.current && (V ? n.current.classList.add("rte-overlay-active") : n.current.classList.remove("rte-overlay-active"));
|
|
1664
1737
|
return;
|
|
1665
1738
|
}
|
|
1666
|
-
const w =
|
|
1739
|
+
const w = f.closest(".rte-richtext-toggle");
|
|
1667
1740
|
if (w) {
|
|
1668
|
-
|
|
1669
|
-
const
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
const
|
|
1674
|
-
|
|
1741
|
+
p.preventDefault(), p.stopPropagation();
|
|
1742
|
+
const I = w.closest(".rte-richtext-wrapper"), R = I?.querySelector('[data-type="richtext"]'), V = !(w.getAttribute("data-expanded") === "true");
|
|
1743
|
+
((ee, se) => {
|
|
1744
|
+
ee.setAttribute("data-expanded", String(se)), ee.innerHTML = se ? '<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>';
|
|
1745
|
+
})(w, V);
|
|
1746
|
+
const oe = I?.closest(".rte-richtext-required");
|
|
1747
|
+
oe ? oe.classList.toggle("rte-richtext-expanded", V) : I && I.classList.toggle("rte-richtext-expanded", V);
|
|
1748
|
+
const F = I?.closest(".exclusion-wrapper") || I?.parentElement;
|
|
1749
|
+
R && (V ? (R.style.height = "100%", R.style.overflow = "auto") : (R.style.height = "", R.style.overflow = "")), F && (F.classList.toggle("rte-richtext-host-expanded", V), b(F, V)), n.current && n.current.classList.toggle("rte-richtext-fullscreen-active", V);
|
|
1675
1750
|
return;
|
|
1676
1751
|
}
|
|
1677
|
-
if (
|
|
1678
|
-
|
|
1679
|
-
const
|
|
1680
|
-
|
|
1752
|
+
if (f.closest('[data-type="text"]')) {
|
|
1753
|
+
p.preventDefault(), p.stopPropagation();
|
|
1754
|
+
const I = window.getSelection();
|
|
1755
|
+
I && I.removeAllRanges();
|
|
1681
1756
|
return;
|
|
1682
1757
|
}
|
|
1683
|
-
if (k &&
|
|
1684
|
-
|
|
1685
|
-
const
|
|
1686
|
-
|
|
1758
|
+
if (k && f.closest(".tag-node")) {
|
|
1759
|
+
p.preventDefault(), p.stopPropagation();
|
|
1760
|
+
const R = window.getSelection();
|
|
1761
|
+
R && R.removeAllRanges();
|
|
1687
1762
|
return;
|
|
1688
1763
|
}
|
|
1689
|
-
if (
|
|
1764
|
+
if (f.closest('[data-type="variable"]')) {
|
|
1690
1765
|
if (T.current)
|
|
1691
1766
|
return;
|
|
1692
1767
|
setTimeout(() => {
|
|
1693
|
-
const
|
|
1694
|
-
|
|
1768
|
+
const I = window.getSelection();
|
|
1769
|
+
I && !I.isCollapsed || Ve(n);
|
|
1695
1770
|
}, 10);
|
|
1696
1771
|
return;
|
|
1697
1772
|
}
|
|
1698
|
-
const
|
|
1699
|
-
if (
|
|
1700
|
-
|
|
1701
|
-
const
|
|
1702
|
-
|
|
1773
|
+
const P = f.closest(".file-remove-btn");
|
|
1774
|
+
if (P) {
|
|
1775
|
+
p.preventDefault(), p.stopPropagation();
|
|
1776
|
+
const R = P.closest('[data-type="upload"]')?.dataset.key;
|
|
1777
|
+
R && xe(R);
|
|
1703
1778
|
return;
|
|
1704
1779
|
}
|
|
1705
|
-
const
|
|
1706
|
-
if (
|
|
1707
|
-
const
|
|
1708
|
-
|
|
1780
|
+
const z = f.closest('[data-type="upload"]');
|
|
1781
|
+
if (z) {
|
|
1782
|
+
const I = z.dataset.key;
|
|
1783
|
+
I && (h(I), o.current?.click());
|
|
1709
1784
|
return;
|
|
1710
1785
|
}
|
|
1711
|
-
}, le = (
|
|
1712
|
-
const v =
|
|
1786
|
+
}, le = (p) => {
|
|
1787
|
+
const v = p.target.closest('[data-type="variable"]');
|
|
1713
1788
|
if (v) {
|
|
1714
|
-
const
|
|
1715
|
-
if (
|
|
1716
|
-
const b = document.createRange(),
|
|
1717
|
-
if (
|
|
1718
|
-
let B = 0,
|
|
1719
|
-
|
|
1720
|
-
const
|
|
1721
|
-
|
|
1789
|
+
const S = window.getSelection();
|
|
1790
|
+
if (S) {
|
|
1791
|
+
const b = document.createRange(), q = v.textContent || "";
|
|
1792
|
+
if (q.replace(/\u200B/g, "")) {
|
|
1793
|
+
let B = 0, $ = q.length;
|
|
1794
|
+
q.startsWith("") && (B = 1), q.endsWith("") && q.length > 1 && ($ = q.length - 1);
|
|
1795
|
+
const P = v.firstChild;
|
|
1796
|
+
P && P.nodeType === Node.TEXT_NODE ? (b.setStart(P, B), b.setEnd(P, $)) : b.selectNodeContents(v);
|
|
1722
1797
|
} else
|
|
1723
1798
|
b.selectNodeContents(v), b.collapse(!0);
|
|
1724
|
-
|
|
1799
|
+
S.removeAllRanges(), S.addRange(b);
|
|
1725
1800
|
}
|
|
1726
1801
|
}
|
|
1727
1802
|
}, de = () => {
|
|
1728
1803
|
if (t.length === 0) {
|
|
1729
|
-
if (
|
|
1730
|
-
const v = !(
|
|
1731
|
-
|
|
1804
|
+
if (n.current) {
|
|
1805
|
+
const v = !(n.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "");
|
|
1806
|
+
Y(v), D(!v);
|
|
1732
1807
|
}
|
|
1733
1808
|
return;
|
|
1734
1809
|
}
|
|
1735
|
-
if (
|
|
1736
|
-
const
|
|
1737
|
-
if (
|
|
1810
|
+
if (Ve(n), n.current && n.current.querySelectorAll('[data-type="variable"]').forEach((v) => {
|
|
1811
|
+
const S = v.querySelector(".variable-info-icon");
|
|
1812
|
+
if (S) {
|
|
1738
1813
|
let b = !1;
|
|
1739
|
-
const
|
|
1814
|
+
const q = document.createTreeWalker(
|
|
1740
1815
|
v,
|
|
1741
1816
|
NodeFilter.SHOW_TEXT,
|
|
1742
1817
|
{
|
|
1743
|
-
acceptNode: (w) =>
|
|
1818
|
+
acceptNode: (w) => S.contains(w) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT
|
|
1744
1819
|
}
|
|
1745
1820
|
);
|
|
1746
|
-
for (;
|
|
1747
|
-
if (
|
|
1821
|
+
for (; q.nextNode(); )
|
|
1822
|
+
if (q.currentNode.textContent?.replace(/[\u200B\n]/g, "").trim()) {
|
|
1748
1823
|
b = !0;
|
|
1749
1824
|
break;
|
|
1750
1825
|
}
|
|
1751
|
-
b ?
|
|
1826
|
+
b ? S.classList.add("hidden") : S.classList.remove("hidden");
|
|
1752
1827
|
}
|
|
1753
|
-
}),
|
|
1754
|
-
t.filter((
|
|
1755
|
-
if (!
|
|
1756
|
-
const v =
|
|
1757
|
-
for (let
|
|
1758
|
-
const
|
|
1759
|
-
`[data-type="variable"][data-key="${
|
|
1828
|
+
}), Te(n, t, r), $e(n, t, r, D), !n.current) return;
|
|
1829
|
+
t.filter((f) => f.type === "multi-variable" && f.key).forEach((f) => {
|
|
1830
|
+
if (!f.key) return;
|
|
1831
|
+
const v = f.maxCount || 9, S = te[f.key] || 1, b = [];
|
|
1832
|
+
for (let P = 0; P < S; P++) {
|
|
1833
|
+
const z = `${f.key}_${P}`, I = n.current.querySelector(
|
|
1834
|
+
`[data-type="variable"][data-key="${z}"][data-multi-key="${f.key}"]`
|
|
1760
1835
|
);
|
|
1761
|
-
if (
|
|
1762
|
-
const
|
|
1763
|
-
b.push(
|
|
1836
|
+
if (I) {
|
|
1837
|
+
const R = I.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
1838
|
+
b.push(R);
|
|
1764
1839
|
}
|
|
1765
1840
|
}
|
|
1766
1841
|
const w = (b[b.length - 1] || "") === "";
|
|
1767
|
-
let B = !1,
|
|
1768
|
-
for (let
|
|
1769
|
-
if (b[
|
|
1770
|
-
B = !0,
|
|
1842
|
+
let B = !1, $ = -1;
|
|
1843
|
+
for (let P = 0; P < b.length - 1; P++)
|
|
1844
|
+
if (b[P] === "") {
|
|
1845
|
+
B = !0, $ = P;
|
|
1771
1846
|
break;
|
|
1772
1847
|
}
|
|
1773
|
-
if (B &&
|
|
1774
|
-
const
|
|
1775
|
-
if (
|
|
1776
|
-
const
|
|
1777
|
-
if (
|
|
1778
|
-
const
|
|
1779
|
-
if (
|
|
1780
|
-
const
|
|
1781
|
-
|
|
1782
|
-
const se =
|
|
1783
|
-
|
|
1848
|
+
if (B && $ >= 0) {
|
|
1849
|
+
const P = window.getSelection();
|
|
1850
|
+
if (P && P.rangeCount > 0) {
|
|
1851
|
+
const V = P.getRangeAt(0), Z = V.startContainer, oe = Z.nodeType === Node.ELEMENT_NODE ? Z.closest('[data-type="variable"][data-multi-key]') : Z.parentElement?.closest('[data-type="variable"][data-multi-key]');
|
|
1852
|
+
if (oe) {
|
|
1853
|
+
const F = oe.dataset.key;
|
|
1854
|
+
if (F) {
|
|
1855
|
+
const ee = document.createRange();
|
|
1856
|
+
ee.setStartBefore(oe), ee.setEnd(V.startContainer, V.startOffset);
|
|
1857
|
+
const se = ee.toString().length;
|
|
1858
|
+
K.current = { key: F, offset: se };
|
|
1784
1859
|
}
|
|
1785
1860
|
}
|
|
1786
1861
|
}
|
|
1787
|
-
const
|
|
1788
|
-
for (let
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
const
|
|
1792
|
-
|
|
1793
|
-
|
|
1862
|
+
const z = [...b];
|
|
1863
|
+
for (let V = $; V < z.length - 1; V++)
|
|
1864
|
+
z[V] = z[V + 1];
|
|
1865
|
+
z.pop();
|
|
1866
|
+
const I = {};
|
|
1867
|
+
z.forEach((V, Z) => {
|
|
1868
|
+
V && (I[`${f.key}_${Z}`] = V);
|
|
1794
1869
|
});
|
|
1795
|
-
const
|
|
1796
|
-
|
|
1870
|
+
const R = Math.max(w ? z.length : z.length + 1, 1);
|
|
1871
|
+
n.current.querySelectorAll(
|
|
1797
1872
|
'[data-type="variable"]'
|
|
1798
|
-
).forEach((
|
|
1799
|
-
const
|
|
1800
|
-
if (
|
|
1801
|
-
const
|
|
1802
|
-
|
|
1873
|
+
).forEach((V) => {
|
|
1874
|
+
const Z = V.dataset.key, oe = V.dataset.multiKey;
|
|
1875
|
+
if (Z && oe !== f.key) {
|
|
1876
|
+
const F = V.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
1877
|
+
F && (I[Z] = F);
|
|
1803
1878
|
}
|
|
1804
|
-
}),
|
|
1805
|
-
...
|
|
1806
|
-
[
|
|
1879
|
+
}), n.current.__tempVariableValues = I, N((V) => ({
|
|
1880
|
+
...V,
|
|
1881
|
+
[f.key]: R
|
|
1807
1882
|
}));
|
|
1808
1883
|
return;
|
|
1809
1884
|
}
|
|
1810
1885
|
if (!w) {
|
|
1811
|
-
const
|
|
1812
|
-
`[data-type="variable"][data-key="${
|
|
1886
|
+
const P = S - 1, z = `${f.key}_${P}`, I = n.current.querySelector(
|
|
1887
|
+
`[data-type="variable"][data-key="${z}"][data-multi-key="${f.key}"]`
|
|
1813
1888
|
);
|
|
1814
|
-
if (
|
|
1889
|
+
if (I && I.innerText.replace(/[\u200B\n]/g, "").trim().length > 0 && S < v) {
|
|
1815
1890
|
const J = window.getSelection();
|
|
1816
1891
|
if (J && J.rangeCount > 0) {
|
|
1817
|
-
const
|
|
1818
|
-
if (
|
|
1819
|
-
const
|
|
1820
|
-
if (
|
|
1821
|
-
const
|
|
1822
|
-
|
|
1823
|
-
const se =
|
|
1824
|
-
|
|
1892
|
+
const V = J.getRangeAt(0), Z = V.startContainer, oe = Z.nodeType === Node.ELEMENT_NODE ? Z.closest('[data-type="variable"][data-multi-key]') : Z.parentElement?.closest('[data-type="variable"][data-multi-key]');
|
|
1893
|
+
if (oe) {
|
|
1894
|
+
const F = oe.dataset.key;
|
|
1895
|
+
if (F) {
|
|
1896
|
+
const ee = document.createRange();
|
|
1897
|
+
ee.setStartBefore(oe), ee.setEnd(V.startContainer, V.startOffset);
|
|
1898
|
+
const se = ee.toString().length;
|
|
1899
|
+
K.current = { key: F, offset: se };
|
|
1825
1900
|
}
|
|
1826
1901
|
}
|
|
1827
1902
|
}
|
|
1828
|
-
|
|
1829
|
-
...
|
|
1830
|
-
[
|
|
1903
|
+
N((V) => ({
|
|
1904
|
+
...V,
|
|
1905
|
+
[f.key]: S + 1
|
|
1831
1906
|
}));
|
|
1832
1907
|
}
|
|
1833
1908
|
}
|
|
1834
1909
|
});
|
|
1835
1910
|
};
|
|
1836
|
-
|
|
1837
|
-
const
|
|
1838
|
-
if (!
|
|
1839
|
-
const
|
|
1840
|
-
const w =
|
|
1841
|
-
!w || !
|
|
1842
|
-
if (
|
|
1911
|
+
Re(() => {
|
|
1912
|
+
const p = n.current;
|
|
1913
|
+
if (!p) return;
|
|
1914
|
+
const f = /* @__PURE__ */ new Map(), v = (q) => {
|
|
1915
|
+
const w = q.target, B = q.relatedTarget;
|
|
1916
|
+
!w || !n.current || !n.current.contains(w) || B && n.current.contains(B) || setTimeout(() => {
|
|
1917
|
+
if (n.current) {
|
|
1843
1918
|
if (t.length === 0) {
|
|
1844
|
-
const
|
|
1845
|
-
|
|
1919
|
+
const $ = n.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "";
|
|
1920
|
+
D($.length > 0);
|
|
1846
1921
|
return;
|
|
1847
1922
|
}
|
|
1848
|
-
|
|
1923
|
+
Ve(n), Te(n, t, r), $e(n, t, r, D);
|
|
1849
1924
|
}
|
|
1850
1925
|
}, 0);
|
|
1851
1926
|
};
|
|
1852
|
-
|
|
1853
|
-
const
|
|
1854
|
-
if (!
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
}),
|
|
1858
|
-
const
|
|
1927
|
+
p.addEventListener("blur", v, !0);
|
|
1928
|
+
const S = () => {
|
|
1929
|
+
if (!n.current) return;
|
|
1930
|
+
f.forEach((B, $) => {
|
|
1931
|
+
$.removeEventListener("blur", B, !1);
|
|
1932
|
+
}), f.clear();
|
|
1933
|
+
const q = n.current.querySelectorAll(
|
|
1859
1934
|
'[data-type="variable"][data-multi-key]'
|
|
1860
1935
|
), w = (B) => {
|
|
1861
1936
|
B.stopPropagation(), B.stopImmediatePropagation();
|
|
1862
|
-
const
|
|
1863
|
-
if (
|
|
1937
|
+
const $ = B.target;
|
|
1938
|
+
if (!$ || !n.current || !n.current.contains($))
|
|
1864
1939
|
return;
|
|
1865
|
-
const
|
|
1866
|
-
if (!
|
|
1940
|
+
const P = $.closest('[data-type="variable"][data-multi-key]');
|
|
1941
|
+
if (!P || !n.current.contains(P))
|
|
1867
1942
|
return;
|
|
1868
|
-
let
|
|
1869
|
-
if (
|
|
1870
|
-
(se ===
|
|
1871
|
-
}), !
|
|
1943
|
+
let z = !1;
|
|
1944
|
+
if (f.forEach((ee, se) => {
|
|
1945
|
+
(se === P || se.contains($)) && (z = !0);
|
|
1946
|
+
}), !z)
|
|
1872
1947
|
return;
|
|
1873
|
-
const
|
|
1874
|
-
if (!
|
|
1875
|
-
const
|
|
1876
|
-
if (!(!
|
|
1948
|
+
const I = P.dataset.multiKey, R = P.dataset.key, J = P.dataset.index;
|
|
1949
|
+
if (!I || !R || J === void 0) return;
|
|
1950
|
+
const V = B.relatedTarget;
|
|
1951
|
+
if (!(!V || !n.current.contains(V)))
|
|
1877
1952
|
return;
|
|
1878
|
-
const
|
|
1953
|
+
const oe = P.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
1879
1954
|
console.log("[Blur Event] 失去焦点的 multi-variable 输入框:", {
|
|
1880
|
-
multiKey:
|
|
1881
|
-
currentKey:
|
|
1955
|
+
multiKey: I,
|
|
1956
|
+
currentKey: R,
|
|
1882
1957
|
index: J,
|
|
1883
|
-
content:
|
|
1958
|
+
content: oe
|
|
1884
1959
|
});
|
|
1885
|
-
const
|
|
1886
|
-
if (
|
|
1887
|
-
const
|
|
1888
|
-
console.log("[Blur Event] 拆分前的内容:",
|
|
1889
|
-
const pe =
|
|
1960
|
+
const F = /[、,,\s]+/;
|
|
1961
|
+
if (F.test(oe)) {
|
|
1962
|
+
const ee = oe.split(F).map((he) => he.trim()).filter((he) => he.length > 0);
|
|
1963
|
+
console.log("[Blur Event] 拆分前的内容:", oe), console.log("[Blur Event] 拆分后的部分:", ee);
|
|
1964
|
+
const pe = ee.slice(0, 9);
|
|
1890
1965
|
if (console.log("[Blur Event] 有效的部分(最多9个):", pe), pe.length > 1) {
|
|
1891
|
-
const he = t.find((
|
|
1966
|
+
const he = t.find((ke) => ke.type === "multi-variable" && ke.key === I);
|
|
1892
1967
|
if (he) {
|
|
1893
|
-
const
|
|
1894
|
-
for (let ie = 0; ie <
|
|
1895
|
-
const ve = `${
|
|
1896
|
-
`[data-type="variable"][data-key="${ve}"][data-multi-key="${
|
|
1968
|
+
const ke = te[I] || 1, De = parseInt(J, 10), Me = he.maxCount || 9, we = [];
|
|
1969
|
+
for (let ie = 0; ie < ke; ie++) {
|
|
1970
|
+
const ve = `${I}_${ie}`, Ee = n.current.querySelector(
|
|
1971
|
+
`[data-type="variable"][data-key="${ve}"][data-multi-key="${I}"]`
|
|
1897
1972
|
);
|
|
1898
1973
|
if (Ee) {
|
|
1899
|
-
const
|
|
1900
|
-
|
|
1974
|
+
const qe = Ee.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
1975
|
+
we.push(qe);
|
|
1901
1976
|
}
|
|
1902
1977
|
}
|
|
1903
|
-
console.log("[Blur Event] 拆分前的所有值:",
|
|
1904
|
-
const fe =
|
|
1905
|
-
console.log("[Blur Event] 拆分后的所有值:", fe), fe.length > 0 && fe[fe.length - 1] !== "" && fe.length <
|
|
1906
|
-
const Ke = Math.max(fe.length, 1),
|
|
1978
|
+
console.log("[Blur Event] 拆分前的所有值:", we), console.log("[Blur Event] 当前索引:", De), console.log("[Blur Event] 要插入的值:", pe), we.splice(De, 1, ...pe);
|
|
1979
|
+
const fe = we.slice(0, Me);
|
|
1980
|
+
console.log("[Blur Event] 拆分后的所有值:", fe), fe.length > 0 && fe[fe.length - 1] !== "" && fe.length < Me && fe.push("");
|
|
1981
|
+
const Ke = Math.max(fe.length, 1), Ie = {};
|
|
1907
1982
|
fe.forEach((ie, ve) => {
|
|
1908
|
-
ie && (
|
|
1909
|
-
}),
|
|
1983
|
+
ie && (Ie[`${I}_${ve}`] = ie);
|
|
1984
|
+
}), n.current.querySelectorAll(
|
|
1910
1985
|
'[data-type="variable"]'
|
|
1911
1986
|
).forEach((ie) => {
|
|
1912
1987
|
const ve = ie.dataset.key, Ee = ie.dataset.multiKey;
|
|
1913
|
-
if (ve && Ee !==
|
|
1914
|
-
const
|
|
1915
|
-
|
|
1988
|
+
if (ve && Ee !== I) {
|
|
1989
|
+
const qe = ie.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
1990
|
+
qe && (Ie[ve] = qe);
|
|
1916
1991
|
}
|
|
1917
|
-
}),
|
|
1992
|
+
}), n.current.__tempVariableValues = Ie, N((ie) => ({
|
|
1918
1993
|
...ie,
|
|
1919
|
-
[
|
|
1994
|
+
[I]: Ke
|
|
1920
1995
|
}));
|
|
1921
1996
|
}
|
|
1922
1997
|
}
|
|
1923
1998
|
}
|
|
1924
1999
|
};
|
|
1925
|
-
|
|
1926
|
-
B.addEventListener("blur", w, !1),
|
|
2000
|
+
q.forEach((B) => {
|
|
2001
|
+
B.addEventListener("blur", w, !1), f.set(B, w);
|
|
1927
2002
|
});
|
|
1928
2003
|
}, b = setTimeout(() => {
|
|
1929
|
-
|
|
2004
|
+
S();
|
|
1930
2005
|
}, 0);
|
|
1931
2006
|
return () => {
|
|
1932
|
-
clearTimeout(b),
|
|
1933
|
-
w.removeEventListener("blur",
|
|
1934
|
-
}),
|
|
2007
|
+
clearTimeout(b), p.removeEventListener("blur", v, !0), f.forEach((q, w) => {
|
|
2008
|
+
w.removeEventListener("blur", q, !1);
|
|
2009
|
+
}), f.clear();
|
|
1935
2010
|
};
|
|
1936
|
-
}, [t,
|
|
1937
|
-
const be = (
|
|
1938
|
-
if (
|
|
1939
|
-
|
|
2011
|
+
}, [t, te, r]);
|
|
2012
|
+
const be = (p) => {
|
|
2013
|
+
if (i) {
|
|
2014
|
+
p.preventDefault();
|
|
1940
2015
|
return;
|
|
1941
2016
|
}
|
|
1942
|
-
const
|
|
1943
|
-
if (
|
|
1944
|
-
const v =
|
|
1945
|
-
let
|
|
1946
|
-
if (v && (v.nodeType === Node.ELEMENT_NODE ?
|
|
1947
|
-
if (
|
|
1948
|
-
const b =
|
|
2017
|
+
const f = window.getSelection();
|
|
2018
|
+
if (f && f.rangeCount > 0) {
|
|
2019
|
+
const v = f.anchorNode;
|
|
2020
|
+
let S = null;
|
|
2021
|
+
if (v && (v.nodeType === Node.ELEMENT_NODE ? S = v.closest('[data-type="text"]') : v.nodeType === Node.TEXT_NODE && v.parentElement && (S = v.parentElement.closest('[data-type="text"]'))), S) {
|
|
2022
|
+
if (p.preventDefault(), p.stopPropagation(), n.current) {
|
|
2023
|
+
const b = n.current.querySelector(
|
|
1949
2024
|
'[data-type="variable"], [data-type="upload"]'
|
|
1950
2025
|
);
|
|
1951
2026
|
b && b.focus();
|
|
@@ -1953,12 +2028,12 @@ const Lt = ({
|
|
|
1953
2028
|
return;
|
|
1954
2029
|
}
|
|
1955
2030
|
}
|
|
1956
|
-
if (k &&
|
|
1957
|
-
const v =
|
|
1958
|
-
let
|
|
1959
|
-
if (v && (v.nodeType === Node.ELEMENT_NODE ?
|
|
1960
|
-
if (
|
|
1961
|
-
const b =
|
|
2031
|
+
if (k && f && f.rangeCount > 0) {
|
|
2032
|
+
const v = f.anchorNode;
|
|
2033
|
+
let S = null;
|
|
2034
|
+
if (v && (v.nodeType === Node.ELEMENT_NODE ? S = v.closest(".tag-node") : v.nodeType === Node.TEXT_NODE && v.parentElement && (S = v.parentElement.closest(".tag-node"))), S) {
|
|
2035
|
+
if (p.preventDefault(), p.stopPropagation(), n.current) {
|
|
2036
|
+
const b = n.current.querySelector(
|
|
1962
2037
|
'[data-type="variable"], [data-type="upload"]'
|
|
1963
2038
|
);
|
|
1964
2039
|
b && b.focus();
|
|
@@ -1966,269 +2041,269 @@ const Lt = ({
|
|
|
1966
2041
|
return;
|
|
1967
2042
|
}
|
|
1968
2043
|
}
|
|
1969
|
-
if (
|
|
2044
|
+
if (p.key === "Enter" && !p.shiftKey && (p.preventDefault(), Pe()), p.key === "Escape" && n.current) {
|
|
1970
2045
|
if (k) {
|
|
1971
|
-
|
|
2046
|
+
p.preventDefault();
|
|
1972
2047
|
return;
|
|
1973
2048
|
}
|
|
1974
|
-
|
|
2049
|
+
n.current.innerHTML = "", n.current.focus();
|
|
1975
2050
|
}
|
|
1976
|
-
if (
|
|
2051
|
+
if (p.key === "Backspace") {
|
|
1977
2052
|
const v = window.getSelection();
|
|
1978
2053
|
if (v && v.rangeCount > 0) {
|
|
1979
|
-
const
|
|
2054
|
+
const S = v.getRangeAt(0), b = v.anchorNode;
|
|
1980
2055
|
if (k) {
|
|
1981
2056
|
let w = null, B = null;
|
|
1982
|
-
if (b && (b.nodeType === Node.ELEMENT_NODE ? (w = b.closest(".tag-node"), B = b.closest('[data-type="text"]')) : b.nodeType === Node.TEXT_NODE && b.parentElement && (w = b.parentElement.closest(".tag-node"), B = b.parentElement.closest('[data-type="text"]'))), (w || B) &&
|
|
1983
|
-
|
|
2057
|
+
if (b && (b.nodeType === Node.ELEMENT_NODE ? (w = b.closest(".tag-node"), B = b.closest('[data-type="text"]')) : b.nodeType === Node.TEXT_NODE && b.parentElement && (w = b.parentElement.closest(".tag-node"), B = b.parentElement.closest('[data-type="text"]'))), (w || B) && S.collapsed && S.startOffset === 0) {
|
|
2058
|
+
p.preventDefault();
|
|
1984
2059
|
return;
|
|
1985
2060
|
}
|
|
1986
2061
|
}
|
|
1987
|
-
let
|
|
1988
|
-
if (b && (b.nodeType === Node.ELEMENT_NODE ?
|
|
2062
|
+
let q = null;
|
|
2063
|
+
if (b && (b.nodeType === Node.ELEMENT_NODE ? q = b.closest(
|
|
1989
2064
|
'[data-type="variable"]'
|
|
1990
|
-
) : b.nodeType === Node.TEXT_NODE && b.parentElement && (
|
|
2065
|
+
) : b.nodeType === Node.TEXT_NODE && b.parentElement && (q = b.parentElement.closest(
|
|
1991
2066
|
'[data-type="variable"]'
|
|
1992
|
-
))),
|
|
1993
|
-
if (!
|
|
2067
|
+
))), q) {
|
|
2068
|
+
if (!S.collapsed)
|
|
1994
2069
|
return;
|
|
1995
|
-
const w =
|
|
2070
|
+
const w = q.innerText;
|
|
1996
2071
|
if (w === "" || w === "") {
|
|
1997
|
-
|
|
2072
|
+
p.preventDefault();
|
|
1998
2073
|
return;
|
|
1999
2074
|
}
|
|
2000
|
-
if (
|
|
2001
|
-
|
|
2075
|
+
if (S.startOffset === 0) {
|
|
2076
|
+
p.preventDefault();
|
|
2002
2077
|
return;
|
|
2003
2078
|
}
|
|
2004
|
-
if (w.startsWith("") &&
|
|
2005
|
-
|
|
2079
|
+
if (w.startsWith("") && S.startOffset === 1) {
|
|
2080
|
+
p.preventDefault();
|
|
2006
2081
|
return;
|
|
2007
2082
|
}
|
|
2008
2083
|
}
|
|
2009
2084
|
}
|
|
2010
2085
|
}
|
|
2011
|
-
},
|
|
2012
|
-
if (
|
|
2086
|
+
}, Pe = () => {
|
|
2087
|
+
if (u || i || e || !H || !n.current) return;
|
|
2013
2088
|
if (t.length === 0) {
|
|
2014
|
-
const
|
|
2015
|
-
if (!
|
|
2016
|
-
|
|
2089
|
+
const q = n.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "";
|
|
2090
|
+
if (!q) return;
|
|
2091
|
+
y(q, q);
|
|
2017
2092
|
return;
|
|
2018
2093
|
}
|
|
2019
|
-
const
|
|
2020
|
-
let
|
|
2021
|
-
const v = {},
|
|
2022
|
-
if (!(
|
|
2023
|
-
if (
|
|
2024
|
-
|
|
2025
|
-
else if (
|
|
2026
|
-
const w =
|
|
2027
|
-
if (B === "variable" &&
|
|
2028
|
-
let
|
|
2029
|
-
const
|
|
2094
|
+
const p = n.current;
|
|
2095
|
+
let f = "";
|
|
2096
|
+
const v = {}, S = (q) => {
|
|
2097
|
+
if (!(q.nodeType === Node.ELEMENT_NODE && q.style.display === "none")) {
|
|
2098
|
+
if (q.nodeType === Node.TEXT_NODE)
|
|
2099
|
+
f += (q.textContent || "").replace(/\u200B/g, "");
|
|
2100
|
+
else if (q.nodeType === Node.ELEMENT_NODE) {
|
|
2101
|
+
const w = q, B = w.dataset.type, $ = w.dataset.key;
|
|
2102
|
+
if (B === "variable" && $) {
|
|
2103
|
+
let P = "";
|
|
2104
|
+
const z = document.createTreeWalker(
|
|
2030
2105
|
w,
|
|
2031
2106
|
NodeFilter.SHOW_TEXT,
|
|
2032
2107
|
{
|
|
2033
|
-
acceptNode: (
|
|
2108
|
+
acceptNode: (R) => {
|
|
2034
2109
|
const J = w.querySelector(".variable-info-icon");
|
|
2035
|
-
return J && J.contains(
|
|
2110
|
+
return J && J.contains(R) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT;
|
|
2036
2111
|
}
|
|
2037
2112
|
}
|
|
2038
2113
|
);
|
|
2039
|
-
for (;
|
|
2040
|
-
|
|
2041
|
-
const
|
|
2042
|
-
if (
|
|
2043
|
-
const
|
|
2044
|
-
if (
|
|
2045
|
-
(!v[
|
|
2046
|
-
const J = v[
|
|
2047
|
-
J.push(
|
|
2114
|
+
for (; z.nextNode(); )
|
|
2115
|
+
P += z.currentNode.textContent || "";
|
|
2116
|
+
const I = P.replace(/[\u200B\n]/g, "").trim();
|
|
2117
|
+
if (I) {
|
|
2118
|
+
const R = w.dataset.multiKey;
|
|
2119
|
+
if (R) {
|
|
2120
|
+
(!v[R] || !Array.isArray(v[R])) && (v[R] = []);
|
|
2121
|
+
const J = v[R];
|
|
2122
|
+
J.push(I), J.length > 1 && (f += " "), f += I;
|
|
2048
2123
|
} else
|
|
2049
|
-
v[
|
|
2124
|
+
v[$] = I, f += I;
|
|
2050
2125
|
}
|
|
2051
|
-
} else if (B === "select" &&
|
|
2052
|
-
const
|
|
2053
|
-
if (
|
|
2054
|
-
v[
|
|
2055
|
-
const
|
|
2056
|
-
|
|
2126
|
+
} else if (B === "select" && $) {
|
|
2127
|
+
const P = w, z = (P.value || "").trim();
|
|
2128
|
+
if (z) {
|
|
2129
|
+
v[$] = z;
|
|
2130
|
+
const I = P.selectedOptions?.[0];
|
|
2131
|
+
f += I?.textContent || z;
|
|
2057
2132
|
}
|
|
2058
|
-
} else if (B === "textarea" &&
|
|
2059
|
-
const
|
|
2060
|
-
|
|
2061
|
-
} else if (B === "richtext" &&
|
|
2062
|
-
const
|
|
2063
|
-
|
|
2064
|
-
} else if (B === "datepicker" &&
|
|
2065
|
-
const
|
|
2066
|
-
|
|
2067
|
-
} else if (B === "upload" &&
|
|
2068
|
-
v[
|
|
2133
|
+
} else if (B === "textarea" && $) {
|
|
2134
|
+
const z = (w.value || "").replace(/\u200B/g, "").trim();
|
|
2135
|
+
z && (v[$] = z, f += z);
|
|
2136
|
+
} else if (B === "richtext" && $) {
|
|
2137
|
+
const z = (w.textContent || "").replace(/\u200B/g, "").trim();
|
|
2138
|
+
z && (v[$] = z, f += z);
|
|
2139
|
+
} else if (B === "datepicker" && $) {
|
|
2140
|
+
const z = (w.getAttribute("data-value") || "").trim();
|
|
2141
|
+
z && (v[$] = z, f += z);
|
|
2142
|
+
} else if (B === "upload" && $)
|
|
2143
|
+
v[$] = r[$] ?? null, r[$] && (f += ` [附带文件: ${r[$]?.name}] `);
|
|
2069
2144
|
else {
|
|
2070
2145
|
if (w.classList.contains("tag-close-btn") || w.classList.contains("file-remove-btn")) return;
|
|
2071
|
-
w.getAttribute("contenteditable") === "false" && !B && w.classList.contains("tag-node") ?
|
|
2146
|
+
w.getAttribute("contenteditable") === "false" && !B && w.classList.contains("tag-node") ? f += w.innerText : w.childNodes.forEach(S);
|
|
2072
2147
|
}
|
|
2073
2148
|
}
|
|
2074
2149
|
}
|
|
2075
2150
|
};
|
|
2076
|
-
if (
|
|
2151
|
+
if (p.childNodes.forEach(S), f = f.trim(), !f) return;
|
|
2077
2152
|
const b = new FormData();
|
|
2078
|
-
b.append("fullPrompt",
|
|
2079
|
-
const w = v[
|
|
2080
|
-
w != null && (w instanceof File ? b.append(
|
|
2081
|
-
(
|
|
2082
|
-
) ? w.forEach((
|
|
2083
|
-
|
|
2084
|
-
}) : w.forEach((
|
|
2085
|
-
|
|
2086
|
-
}) : typeof w == "string" ? b.append(
|
|
2087
|
-
}),
|
|
2153
|
+
b.append("fullPrompt", f), Object.keys(v).forEach((q) => {
|
|
2154
|
+
const w = v[q];
|
|
2155
|
+
w != null && (w instanceof File ? b.append(q, w) : Array.isArray(w) ? t.some(
|
|
2156
|
+
($) => $.type === "multi-variable" && $.key === q
|
|
2157
|
+
) ? w.forEach(($) => {
|
|
2158
|
+
$ != null && $ !== "" && b.append(q, String($));
|
|
2159
|
+
}) : w.forEach(($, P) => {
|
|
2160
|
+
$ != null && ($ instanceof File ? b.append(`${q}[${P}]`, $) : typeof $ == "string" ? b.append(`${q}[${P}]`, $) : b.append(`${q}[${P}]`, String($)));
|
|
2161
|
+
}) : typeof w == "string" ? b.append(q, w) : b.append(q, String(w)));
|
|
2162
|
+
}), y(b, f);
|
|
2088
2163
|
}, je = {
|
|
2089
|
-
...
|
|
2090
|
-
...
|
|
2091
|
-
...
|
|
2164
|
+
...c ? { width: typeof c == "number" ? `${c}px` : c } : {},
|
|
2165
|
+
...g ? { border: g } : {},
|
|
2166
|
+
...l ? { background: l } : {}
|
|
2092
2167
|
};
|
|
2093
|
-
return /* @__PURE__ */
|
|
2168
|
+
return /* @__PURE__ */ W(
|
|
2094
2169
|
"div",
|
|
2095
2170
|
{
|
|
2096
2171
|
className: "rich-text-editor",
|
|
2097
2172
|
style: je,
|
|
2098
|
-
"data-disabled":
|
|
2173
|
+
"data-disabled": i,
|
|
2099
2174
|
children: [
|
|
2100
|
-
/* @__PURE__ */
|
|
2175
|
+
/* @__PURE__ */ m(
|
|
2101
2176
|
"div",
|
|
2102
2177
|
{
|
|
2103
|
-
ref:
|
|
2104
|
-
className: `rte-editor ${t.length === 0 ? "rte-editor-default" : ""} ${
|
|
2178
|
+
ref: n,
|
|
2179
|
+
className: `rte-editor ${t.length === 0 ? "rte-editor-default" : ""} ${Q && A ? "rte-editor-empty" : ""}`,
|
|
2105
2180
|
contentEditable: t.length === 0,
|
|
2106
2181
|
suppressContentEditableWarning: !0,
|
|
2107
|
-
"data-placeholder":
|
|
2108
|
-
onMouseDown:
|
|
2182
|
+
"data-placeholder": A,
|
|
2183
|
+
onMouseDown: Ae,
|
|
2109
2184
|
onMouseMove: me,
|
|
2110
|
-
onMouseUp:
|
|
2111
|
-
onClick:
|
|
2185
|
+
onMouseUp: Le,
|
|
2186
|
+
onClick: O,
|
|
2112
2187
|
onDoubleClick: le,
|
|
2113
2188
|
onInput: de,
|
|
2114
2189
|
onKeyDown: be,
|
|
2115
|
-
onPaste:
|
|
2190
|
+
onPaste: Ne
|
|
2116
2191
|
}
|
|
2117
2192
|
),
|
|
2118
|
-
/* @__PURE__ */
|
|
2193
|
+
/* @__PURE__ */ m(
|
|
2119
2194
|
"input",
|
|
2120
2195
|
{
|
|
2121
2196
|
type: "file",
|
|
2122
|
-
ref:
|
|
2197
|
+
ref: o,
|
|
2123
2198
|
className: "rte-file-input",
|
|
2124
2199
|
accept: ".csv,.xlsx,.xls,.txt,.pdf,image/*",
|
|
2125
|
-
onChange:
|
|
2200
|
+
onChange: Se
|
|
2126
2201
|
}
|
|
2127
2202
|
),
|
|
2128
|
-
/* @__PURE__ */
|
|
2129
|
-
/* @__PURE__ */
|
|
2130
|
-
/* @__PURE__ */
|
|
2131
|
-
/* @__PURE__ */
|
|
2132
|
-
/* @__PURE__ */
|
|
2203
|
+
/* @__PURE__ */ W("div", { className: "rich-text-editor-footer", children: [
|
|
2204
|
+
/* @__PURE__ */ m("div", { className: "rich-text-editor-footer-left", children: /* @__PURE__ */ W("div", { className: "rich-text-editor-brand", children: [
|
|
2205
|
+
/* @__PURE__ */ W("div", { className: "rte-brand-badge", children: [
|
|
2206
|
+
/* @__PURE__ */ m("img", { src: "https://oospublic.sealseek.cn/file/website/ball.png", alt: "" }),
|
|
2207
|
+
/* @__PURE__ */ m("span", { className: "rte-brand-text", children: "SealSeek 1.0" })
|
|
2133
2208
|
] }),
|
|
2134
|
-
|
|
2209
|
+
a !== "hideAgent" && /* @__PURE__ */ m(
|
|
2135
2210
|
Ze,
|
|
2136
2211
|
{
|
|
2137
2212
|
placement: "top",
|
|
2138
2213
|
menu: {
|
|
2139
|
-
items:
|
|
2140
|
-
key:
|
|
2141
|
-
label: /* @__PURE__ */
|
|
2142
|
-
|
|
2143
|
-
/* @__PURE__ */
|
|
2214
|
+
items: L.map((p) => ({
|
|
2215
|
+
key: p.key,
|
|
2216
|
+
label: /* @__PURE__ */ W("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
|
|
2217
|
+
p.icon && /* @__PURE__ */ m("i", { className: p.icon }),
|
|
2218
|
+
/* @__PURE__ */ m("span", { children: p.label })
|
|
2144
2219
|
] }),
|
|
2145
2220
|
onClick: () => {
|
|
2146
|
-
E?.(
|
|
2221
|
+
E?.(p);
|
|
2147
2222
|
}
|
|
2148
2223
|
}))
|
|
2149
2224
|
},
|
|
2150
2225
|
trigger: ["click"],
|
|
2151
|
-
disabled:
|
|
2152
|
-
children: /* @__PURE__ */
|
|
2153
|
-
/* @__PURE__ */
|
|
2154
|
-
/* @__PURE__ */
|
|
2226
|
+
disabled: i || u,
|
|
2227
|
+
children: /* @__PURE__ */ W("div", { className: "rte-agent-badge", style: { cursor: L.length > 0 ? "pointer" : "default" }, children: [
|
|
2228
|
+
/* @__PURE__ */ m("i", { className: "iconfont icon-zhinengti" }),
|
|
2229
|
+
/* @__PURE__ */ m("span", { className: "rte-agent-text", children: "智能体" })
|
|
2155
2230
|
] })
|
|
2156
2231
|
}
|
|
2157
2232
|
)
|
|
2158
2233
|
] }) }),
|
|
2159
|
-
/* @__PURE__ */
|
|
2234
|
+
/* @__PURE__ */ W("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
|
|
2160
2235
|
(() => {
|
|
2161
|
-
const
|
|
2162
|
-
if (!
|
|
2163
|
-
const
|
|
2164
|
-
return !
|
|
2165
|
-
/* @__PURE__ */
|
|
2166
|
-
/* @__PURE__ */
|
|
2236
|
+
const p = t.find((v) => v.type === "tag");
|
|
2237
|
+
if (!p || !p.text) return null;
|
|
2238
|
+
const f = L.find((v) => v.label === p.text);
|
|
2239
|
+
return !f || f.points === void 0 || f.points === null ? null : /* @__PURE__ */ W("div", { className: "rte-points-badge", children: [
|
|
2240
|
+
/* @__PURE__ */ m("i", { className: "iconfont icon-jifen", style: { marginRight: "4px" } }),
|
|
2241
|
+
/* @__PURE__ */ W("span", { style: { fontSize: "16px" }, children: [
|
|
2167
2242
|
"-",
|
|
2168
|
-
String(
|
|
2243
|
+
String(f.points)
|
|
2169
2244
|
] })
|
|
2170
2245
|
] });
|
|
2171
2246
|
})(),
|
|
2172
|
-
/* @__PURE__ */
|
|
2247
|
+
/* @__PURE__ */ m(
|
|
2173
2248
|
"button",
|
|
2174
2249
|
{
|
|
2175
2250
|
type: "button",
|
|
2176
|
-
onClick:
|
|
2177
|
-
disabled:
|
|
2251
|
+
onClick: Pe,
|
|
2252
|
+
disabled: u || i || e || !H,
|
|
2178
2253
|
className: "rich-text-editor-send-button",
|
|
2179
|
-
children:
|
|
2254
|
+
children: u || e ? /* @__PURE__ */ m("span", { className: "rte-send-spinner" }) : /* @__PURE__ */ m("i", { className: "iconfont icon-fasong" })
|
|
2180
2255
|
}
|
|
2181
2256
|
)
|
|
2182
2257
|
] })
|
|
2183
2258
|
] }),
|
|
2184
|
-
|
|
2185
|
-
if (!document.body.contains(
|
|
2259
|
+
x?.anchorEl && (() => {
|
|
2260
|
+
if (!document.body.contains(x.anchorEl))
|
|
2186
2261
|
return null;
|
|
2187
|
-
let
|
|
2262
|
+
let p = "", f = {
|
|
2188
2263
|
background: "var(--neutral-800, #262626)"
|
|
2189
2264
|
};
|
|
2190
|
-
if (
|
|
2191
|
-
|
|
2192
|
-
(b) => b.type === "upload" && b.key ===
|
|
2265
|
+
if (x.type === "upload")
|
|
2266
|
+
p = t.find(
|
|
2267
|
+
(b) => b.type === "upload" && b.key === x.key
|
|
2193
2268
|
)?.tooltip || "";
|
|
2194
|
-
else if (
|
|
2195
|
-
|
|
2196
|
-
else if (
|
|
2197
|
-
|
|
2198
|
-
else if (
|
|
2199
|
-
|
|
2200
|
-
else if (
|
|
2201
|
-
const
|
|
2202
|
-
if (
|
|
2203
|
-
const b = URL.createObjectURL(
|
|
2204
|
-
|
|
2269
|
+
else if (x.type === "tag")
|
|
2270
|
+
p = x.anchorEl.dataset.tooltip || "";
|
|
2271
|
+
else if (x.type === "upload-label")
|
|
2272
|
+
p = x.anchorEl.dataset.fileName || "";
|
|
2273
|
+
else if (x.type === "variable")
|
|
2274
|
+
p = x.anchorEl.dataset.tooltip || "";
|
|
2275
|
+
else if (x.type === "upload-preview") {
|
|
2276
|
+
const S = r[x.key];
|
|
2277
|
+
if (S && S.type && S.type.startsWith("image/")) {
|
|
2278
|
+
const b = URL.createObjectURL(S);
|
|
2279
|
+
p = /* @__PURE__ */ m("div", { style: { width: 120, height: 120, display: "flex", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ m("img", { src: b, style: { maxWidth: 120, maxHeight: 120, objectFit: "contain" } }) }), f = {
|
|
2205
2280
|
background: "#fff",
|
|
2206
2281
|
padding: 4
|
|
2207
2282
|
}, setTimeout(() => URL.revokeObjectURL(b), 1e3);
|
|
2208
2283
|
} else
|
|
2209
|
-
|
|
2284
|
+
p = "";
|
|
2210
2285
|
}
|
|
2211
|
-
if (!
|
|
2212
|
-
const v =
|
|
2286
|
+
if (!p) return null;
|
|
2287
|
+
const v = x.type === "upload-preview" ? "#0A0A0A" : "#fff";
|
|
2213
2288
|
return pt(
|
|
2214
|
-
/* @__PURE__ */
|
|
2289
|
+
/* @__PURE__ */ m(
|
|
2215
2290
|
et,
|
|
2216
2291
|
{
|
|
2217
2292
|
arrow: !1,
|
|
2218
|
-
title: /* @__PURE__ */
|
|
2293
|
+
title: /* @__PURE__ */ m("div", { style: { maxWidth: "200px", fontSize: "12px", color: v }, children: p }),
|
|
2219
2294
|
open: !0,
|
|
2220
2295
|
placement: "top",
|
|
2221
2296
|
getPopupContainer: () => document.body,
|
|
2222
|
-
overlayInnerStyle:
|
|
2223
|
-
children: /* @__PURE__ */
|
|
2297
|
+
overlayInnerStyle: f,
|
|
2298
|
+
children: /* @__PURE__ */ m(
|
|
2224
2299
|
"div",
|
|
2225
2300
|
{
|
|
2226
2301
|
style: {
|
|
2227
2302
|
position: "fixed",
|
|
2228
|
-
left: `${
|
|
2229
|
-
top: `${
|
|
2230
|
-
width: `${
|
|
2231
|
-
height: `${
|
|
2303
|
+
left: `${x.anchorEl.getBoundingClientRect().left}px`,
|
|
2304
|
+
top: `${x.anchorEl.getBoundingClientRect().top}px`,
|
|
2305
|
+
width: `${x.anchorEl.offsetWidth}px`,
|
|
2306
|
+
height: `${x.anchorEl.offsetHeight}px`,
|
|
2232
2307
|
pointerEvents: "none"
|
|
2233
2308
|
}
|
|
2234
2309
|
}
|
|
@@ -2242,7 +2317,7 @@ const Lt = ({
|
|
|
2242
2317
|
}
|
|
2243
2318
|
);
|
|
2244
2319
|
};
|
|
2245
|
-
|
|
2320
|
+
It.__docgenInfo = {
|
|
2246
2321
|
displayName: "RichTextEditor",
|
|
2247
2322
|
description: "结构化富文本输入组件,支持标签、变量输入块、文件上传以及互斥显示逻辑。",
|
|
2248
2323
|
props: {
|
|
@@ -2270,40 +2345,40 @@ Lt.__docgenInfo = {
|
|
|
2270
2345
|
}
|
|
2271
2346
|
}
|
|
2272
2347
|
};
|
|
2273
|
-
const
|
|
2348
|
+
const ze = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAFSSURBVHgB3ZTtccIwDIaVXv83I2SDZgSP0BHMBG0naEZhA2boBGQDswHdQJUOGRxjO0Z8HPDe6eJzJD2W4gjgEYSIn2xwK6EIFHqBGysJpMP3ZB0oRbEtmal1NtIxl4OWWsoxEsvqofJ0rgTNASOYq+7SXKDsuYvAcgkq/PWwBLQWqIfdjeRStaBUc4qzgLi9/BzJNmS/sh6bpvmrTfSFacU3scWy1mQryWdSnXiFE8QVUJINLTuyhWzzz/1OZmTN9hEckqtfUOwIGlGCpVRjE+94JFqpMtTeVzO8/UmPxpZU8Qa7aln8Tb9pfwla4WHWrjPvvbbnTBsX7PmLs83EDAH0BxSw1G31+/1FoDg/vPcXR+wocQS1apj4+P92FfhOoLyuBfYlmPgYnGoCjWADzAkzUyJ430awLmphPaxWQVU22BuuApPkHaanjcXSN3t6/QNjTMSJWDcs1QAAAABJRU5ErkJggg==", Vt = [
|
|
2274
2349
|
{ label: "5页", value: 5 },
|
|
2275
2350
|
{ label: "10页", value: 10 },
|
|
2276
2351
|
{ label: "15页", value: 15 },
|
|
2277
2352
|
{ label: "30页", value: 30 }
|
|
2278
2353
|
], Bt = ({
|
|
2279
2354
|
autoLoading: t,
|
|
2280
|
-
batchSize:
|
|
2281
|
-
loadingProgress:
|
|
2282
|
-
loadIcon:
|
|
2283
|
-
onBatchSizeChange:
|
|
2355
|
+
batchSize: y,
|
|
2356
|
+
loadingProgress: u,
|
|
2357
|
+
loadIcon: i,
|
|
2358
|
+
onBatchSizeChange: c,
|
|
2284
2359
|
onLoadNextPage: k,
|
|
2285
|
-
onStartAutoLoad:
|
|
2360
|
+
onStartAutoLoad: L,
|
|
2286
2361
|
onStopLoad: E
|
|
2287
|
-
}) => t &&
|
|
2288
|
-
|
|
2289
|
-
/* @__PURE__ */
|
|
2362
|
+
}) => t && u ? /* @__PURE__ */ W("div", { className: "auto_load_progress", children: [
|
|
2363
|
+
i || /* @__PURE__ */ m("img", { src: ze, alt: "自动加载", width: 14, height: 14 }),
|
|
2364
|
+
/* @__PURE__ */ W("span", { children: [
|
|
2290
2365
|
"正在加载第",
|
|
2291
|
-
|
|
2366
|
+
u.currentPage,
|
|
2292
2367
|
"/",
|
|
2293
|
-
|
|
2368
|
+
u.totalPages,
|
|
2294
2369
|
"页"
|
|
2295
2370
|
] }),
|
|
2296
|
-
/* @__PURE__ */
|
|
2371
|
+
/* @__PURE__ */ m(
|
|
2297
2372
|
tt,
|
|
2298
2373
|
{
|
|
2299
|
-
percent:
|
|
2374
|
+
percent: u.percentage,
|
|
2300
2375
|
type: "line",
|
|
2301
2376
|
size: [160, 8]
|
|
2302
2377
|
}
|
|
2303
2378
|
),
|
|
2304
|
-
/* @__PURE__ */
|
|
2305
|
-
] }) : /* @__PURE__ */
|
|
2306
|
-
/* @__PURE__ */
|
|
2379
|
+
/* @__PURE__ */ m("span", { onClick: E, className: "auto_load_stop_btn", children: "停止加载" })
|
|
2380
|
+
] }) : /* @__PURE__ */ W("div", { className: "auto_load_container", children: [
|
|
2381
|
+
/* @__PURE__ */ m(
|
|
2307
2382
|
"div",
|
|
2308
2383
|
{
|
|
2309
2384
|
onClick: k,
|
|
@@ -2314,7 +2389,7 @@ const Oe = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
2314
2389
|
children: "加载下一页"
|
|
2315
2390
|
}
|
|
2316
2391
|
),
|
|
2317
|
-
/* @__PURE__ */
|
|
2392
|
+
/* @__PURE__ */ W(
|
|
2318
2393
|
"div",
|
|
2319
2394
|
{
|
|
2320
2395
|
className: "right_control_wrap",
|
|
@@ -2322,22 +2397,22 @@ const Oe = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
2322
2397
|
backgroundColor: t ? "#f5f5f5" : "#2563eb"
|
|
2323
2398
|
},
|
|
2324
2399
|
children: [
|
|
2325
|
-
/* @__PURE__ */
|
|
2400
|
+
/* @__PURE__ */ W(
|
|
2326
2401
|
"div",
|
|
2327
2402
|
{
|
|
2328
2403
|
className: "auto_load_btn",
|
|
2329
|
-
onClick: t ? void 0 :
|
|
2404
|
+
onClick: t ? void 0 : L,
|
|
2330
2405
|
children: [
|
|
2331
|
-
|
|
2332
|
-
/* @__PURE__ */
|
|
2406
|
+
i || /* @__PURE__ */ m("img", { src: ze, alt: "自动加载", width: 14, height: 14 }),
|
|
2407
|
+
/* @__PURE__ */ m("span", { children: "自动加载" })
|
|
2333
2408
|
]
|
|
2334
2409
|
}
|
|
2335
2410
|
),
|
|
2336
|
-
/* @__PURE__ */
|
|
2337
|
-
|
|
2411
|
+
/* @__PURE__ */ m(
|
|
2412
|
+
Ge,
|
|
2338
2413
|
{
|
|
2339
|
-
value:
|
|
2340
|
-
onChange:
|
|
2414
|
+
value: y,
|
|
2415
|
+
onChange: c,
|
|
2341
2416
|
options: Vt,
|
|
2342
2417
|
disabled: t,
|
|
2343
2418
|
size: "small",
|
|
@@ -2350,26 +2425,26 @@ const Oe = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
2350
2425
|
)
|
|
2351
2426
|
] }), _t = ({
|
|
2352
2427
|
current: t,
|
|
2353
|
-
loadIcon:
|
|
2354
|
-
pageSize:
|
|
2355
|
-
total:
|
|
2356
|
-
cachedPages:
|
|
2428
|
+
loadIcon: y,
|
|
2429
|
+
pageSize: u,
|
|
2430
|
+
total: i,
|
|
2431
|
+
cachedPages: c,
|
|
2357
2432
|
loadedCount: k,
|
|
2358
|
-
autoLoading:
|
|
2433
|
+
autoLoading: L = !1,
|
|
2359
2434
|
loadingProgress: E,
|
|
2360
|
-
onChange:
|
|
2435
|
+
onChange: C,
|
|
2361
2436
|
onLoadNextPage: e,
|
|
2362
|
-
onStartAutoLoad:
|
|
2363
|
-
onStopLoading:
|
|
2437
|
+
onStartAutoLoad: A,
|
|
2438
|
+
onStopLoading: g
|
|
2364
2439
|
}) => {
|
|
2365
|
-
const [
|
|
2366
|
-
{ length:
|
|
2367
|
-
(
|
|
2368
|
-
).filter((
|
|
2369
|
-
return /* @__PURE__ */
|
|
2370
|
-
/* @__PURE__ */
|
|
2371
|
-
/* @__PURE__ */
|
|
2372
|
-
/* @__PURE__ */
|
|
2440
|
+
const [l, a] = X(5), n = Math.ceil(i / u), o = Oe(() => c.length >= n, [c, n]), r = () => Array.from(
|
|
2441
|
+
{ length: n },
|
|
2442
|
+
(h, x) => x + 1
|
|
2443
|
+
).filter((h) => !c.includes(h)).slice(0, l);
|
|
2444
|
+
return /* @__PURE__ */ W("div", { className: "pagination_footer", children: [
|
|
2445
|
+
/* @__PURE__ */ W("div", { className: "pagination_leftWrap", children: [
|
|
2446
|
+
/* @__PURE__ */ W("span", { className: "pagination_total", children: [
|
|
2447
|
+
/* @__PURE__ */ m(
|
|
2373
2448
|
it,
|
|
2374
2449
|
{
|
|
2375
2450
|
style: { color: "#2563EB", marginRight: "4px" }
|
|
@@ -2378,50 +2453,50 @@ const Oe = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
2378
2453
|
"已加载: ",
|
|
2379
2454
|
k,
|
|
2380
2455
|
"/",
|
|
2381
|
-
|
|
2456
|
+
i,
|
|
2382
2457
|
"条数据"
|
|
2383
2458
|
] }),
|
|
2384
|
-
!
|
|
2459
|
+
!o && /* @__PURE__ */ m(
|
|
2385
2460
|
Bt,
|
|
2386
2461
|
{
|
|
2387
|
-
loadIcon:
|
|
2388
|
-
autoLoading:
|
|
2389
|
-
batchSize:
|
|
2462
|
+
loadIcon: y || void 0,
|
|
2463
|
+
autoLoading: L,
|
|
2464
|
+
batchSize: l,
|
|
2390
2465
|
loadingProgress: E,
|
|
2391
|
-
disabled: !e || !
|
|
2392
|
-
onBatchSizeChange:
|
|
2466
|
+
disabled: !e || !A,
|
|
2467
|
+
onBatchSizeChange: a,
|
|
2393
2468
|
onLoadNextPage: () => e?.(),
|
|
2394
2469
|
onStartAutoLoad: () => {
|
|
2395
|
-
const
|
|
2396
|
-
|
|
2470
|
+
const d = r();
|
|
2471
|
+
A?.(d);
|
|
2397
2472
|
},
|
|
2398
|
-
onStopLoad: () =>
|
|
2473
|
+
onStopLoad: () => g?.()
|
|
2399
2474
|
}
|
|
2400
2475
|
)
|
|
2401
2476
|
] }),
|
|
2402
|
-
/* @__PURE__ */
|
|
2477
|
+
/* @__PURE__ */ m(
|
|
2403
2478
|
nt,
|
|
2404
2479
|
{
|
|
2405
2480
|
current: t,
|
|
2406
|
-
pageSize:
|
|
2407
|
-
total:
|
|
2408
|
-
onChange: (
|
|
2481
|
+
pageSize: u,
|
|
2482
|
+
total: i,
|
|
2483
|
+
onChange: (d) => C(d),
|
|
2409
2484
|
showSizeChanger: !1,
|
|
2410
2485
|
showQuickJumper: !1,
|
|
2411
|
-
showTotal: (
|
|
2412
|
-
itemRender: (
|
|
2413
|
-
const
|
|
2414
|
-
return
|
|
2486
|
+
showTotal: (d, h) => "",
|
|
2487
|
+
itemRender: (d, h, x) => {
|
|
2488
|
+
const G = c.includes(d);
|
|
2489
|
+
return h === "prev" || h === "next" || h === "jump-prev" || h === "jump-next" ? /* @__PURE__ */ m("div", { className: "pageBox", children: x }) : /* @__PURE__ */ W(
|
|
2415
2490
|
"div",
|
|
2416
2491
|
{
|
|
2417
2492
|
className: "pageBox",
|
|
2418
2493
|
style: {
|
|
2419
|
-
backgroundColor: t ===
|
|
2420
|
-
color: t ===
|
|
2494
|
+
backgroundColor: t === d ? "#2563EB" : "#f5f5f5",
|
|
2495
|
+
color: t === d ? "#fff" : G ? "#171717" : "#a3a3a3"
|
|
2421
2496
|
},
|
|
2422
2497
|
children: [
|
|
2423
|
-
|
|
2424
|
-
!
|
|
2498
|
+
d,
|
|
2499
|
+
!G && /* @__PURE__ */ m("span", { className: "unload_spot" })
|
|
2425
2500
|
]
|
|
2426
2501
|
}
|
|
2427
2502
|
);
|
|
@@ -2429,62 +2504,62 @@ const Oe = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
2429
2504
|
}
|
|
2430
2505
|
)
|
|
2431
2506
|
] });
|
|
2432
|
-
},
|
|
2507
|
+
}, Gt = (t) => {
|
|
2433
2508
|
const {
|
|
2434
|
-
loading:
|
|
2435
|
-
autoLoading:
|
|
2436
|
-
loadingProgress:
|
|
2437
|
-
columns:
|
|
2509
|
+
loading: y,
|
|
2510
|
+
autoLoading: u,
|
|
2511
|
+
loadingProgress: i,
|
|
2512
|
+
columns: c = [],
|
|
2438
2513
|
dataSource: k = [],
|
|
2439
|
-
total:
|
|
2514
|
+
total: L,
|
|
2440
2515
|
current: E,
|
|
2441
|
-
pageSize:
|
|
2516
|
+
pageSize: C,
|
|
2442
2517
|
cachedPages: e,
|
|
2443
|
-
onChangePage:
|
|
2444
|
-
onLoadNextPage:
|
|
2445
|
-
onStartAutoLoad:
|
|
2446
|
-
onStopLoading:
|
|
2447
|
-
...
|
|
2448
|
-
} = t,
|
|
2449
|
-
(
|
|
2450
|
-
|
|
2451
|
-
key: `${(
|
|
2518
|
+
onChangePage: A,
|
|
2519
|
+
onLoadNextPage: g,
|
|
2520
|
+
onStartAutoLoad: l,
|
|
2521
|
+
onStopLoading: a,
|
|
2522
|
+
...n
|
|
2523
|
+
} = t, o = j(null), r = U(
|
|
2524
|
+
(s) => {
|
|
2525
|
+
A(s), e.includes(s) && o.current?.scrollTo({
|
|
2526
|
+
key: `${(s - 1) * C + 1}`
|
|
2452
2527
|
});
|
|
2453
2528
|
},
|
|
2454
2529
|
[E]
|
|
2455
2530
|
);
|
|
2456
|
-
return /* @__PURE__ */
|
|
2457
|
-
/* @__PURE__ */
|
|
2531
|
+
return /* @__PURE__ */ W("div", { className: "flex flex-col", children: [
|
|
2532
|
+
/* @__PURE__ */ m(
|
|
2458
2533
|
_e,
|
|
2459
2534
|
{
|
|
2460
|
-
ref:
|
|
2461
|
-
...
|
|
2462
|
-
columns:
|
|
2535
|
+
ref: o,
|
|
2536
|
+
...n,
|
|
2537
|
+
columns: c,
|
|
2463
2538
|
dataSource: k,
|
|
2464
2539
|
pagination: !1,
|
|
2465
2540
|
virtual: !0
|
|
2466
2541
|
}
|
|
2467
2542
|
),
|
|
2468
|
-
/* @__PURE__ */
|
|
2543
|
+
/* @__PURE__ */ m(
|
|
2469
2544
|
_t,
|
|
2470
2545
|
{
|
|
2471
|
-
loading:
|
|
2472
|
-
autoLoading:
|
|
2473
|
-
loadingProgress:
|
|
2546
|
+
loading: y,
|
|
2547
|
+
autoLoading: u,
|
|
2548
|
+
loadingProgress: i,
|
|
2474
2549
|
current: E,
|
|
2475
|
-
pageSize:
|
|
2476
|
-
total:
|
|
2550
|
+
pageSize: C,
|
|
2551
|
+
total: L,
|
|
2477
2552
|
loadedCount: k.length,
|
|
2478
2553
|
cachedPages: e,
|
|
2479
|
-
onChange:
|
|
2480
|
-
onLoadNextPage:
|
|
2481
|
-
onStartAutoLoad:
|
|
2482
|
-
onStopLoading:
|
|
2554
|
+
onChange: r,
|
|
2555
|
+
onLoadNextPage: g,
|
|
2556
|
+
onStartAutoLoad: l,
|
|
2557
|
+
onStopLoading: a
|
|
2483
2558
|
}
|
|
2484
2559
|
)
|
|
2485
2560
|
] });
|
|
2486
2561
|
};
|
|
2487
|
-
|
|
2562
|
+
Gt.__docgenInfo = {
|
|
2488
2563
|
displayName: "VirtualTable",
|
|
2489
2564
|
description: "虚拟滚动表格组件,支持分页、数据缓存和自动加载功能。",
|
|
2490
2565
|
props: {
|
|
@@ -2591,77 +2666,77 @@ Pt.__docgenInfo = {
|
|
|
2591
2666
|
}
|
|
2592
2667
|
}
|
|
2593
2668
|
};
|
|
2594
|
-
const
|
|
2669
|
+
const Pt = ({
|
|
2595
2670
|
texts: t = [],
|
|
2596
|
-
placeholder:
|
|
2597
|
-
animationSpeed:
|
|
2598
|
-
autoPlay:
|
|
2599
|
-
value:
|
|
2671
|
+
placeholder: y = "请输入内容",
|
|
2672
|
+
animationSpeed: u = 100,
|
|
2673
|
+
autoPlay: i = !0,
|
|
2674
|
+
value: c,
|
|
2600
2675
|
onChange: k,
|
|
2601
|
-
...
|
|
2676
|
+
...L
|
|
2602
2677
|
}) => {
|
|
2603
|
-
const [E,
|
|
2604
|
-
|
|
2605
|
-
|
|
2678
|
+
const [E, C] = X(""), [e, A] = X(0), [g, l] = X(!1), [a, n] = X(!1), [o, r] = X(!1), s = j(void 0), d = j(void 0), h = j(t), x = j(e), G = j(a), T = j(E);
|
|
2679
|
+
ae(() => {
|
|
2680
|
+
h.current = t, x.current = e, G.current = a, T.current = E;
|
|
2606
2681
|
});
|
|
2607
|
-
const
|
|
2608
|
-
let
|
|
2609
|
-
|
|
2682
|
+
const _ = U((N, M) => {
|
|
2683
|
+
let ne = 0;
|
|
2684
|
+
r(!0);
|
|
2610
2685
|
const re = () => {
|
|
2611
|
-
|
|
2686
|
+
ne < N.length ? (C(N.slice(0, ne + 1)), ne++, d.current = window.setTimeout(re, u)) : (r(!1), M?.());
|
|
2612
2687
|
};
|
|
2613
2688
|
re();
|
|
2614
|
-
}, [
|
|
2615
|
-
let
|
|
2616
|
-
const
|
|
2617
|
-
|
|
2689
|
+
}, [u]), H = U((N) => {
|
|
2690
|
+
let M = T.current.length;
|
|
2691
|
+
const ne = () => {
|
|
2692
|
+
M > 0 ? (C(T.current.slice(0, M - 1)), M--, d.current = window.setTimeout(ne, u / 2)) : N?.();
|
|
2618
2693
|
};
|
|
2619
|
-
|
|
2620
|
-
}, [
|
|
2621
|
-
if (
|
|
2622
|
-
|
|
2623
|
-
const
|
|
2694
|
+
ne();
|
|
2695
|
+
}, [u]), D = U(() => {
|
|
2696
|
+
if (h.current.length === 0 || G.current) return;
|
|
2697
|
+
l(!0);
|
|
2698
|
+
const N = h.current[x.current];
|
|
2624
2699
|
T.current ? H(() => {
|
|
2625
|
-
|
|
2626
|
-
|
|
2627
|
-
|
|
2700
|
+
_(N, () => {
|
|
2701
|
+
s.current = window.setTimeout(() => {
|
|
2702
|
+
A((M) => (M + 1) % h.current.length), l(!1);
|
|
2628
2703
|
}, 2e3);
|
|
2629
2704
|
});
|
|
2630
|
-
}) :
|
|
2631
|
-
|
|
2632
|
-
|
|
2705
|
+
}) : _(N, () => {
|
|
2706
|
+
s.current = window.setTimeout(() => {
|
|
2707
|
+
A((M) => (M + 1) % h.current.length), l(!1);
|
|
2633
2708
|
}, 2e3);
|
|
2634
2709
|
});
|
|
2635
|
-
}, [H,
|
|
2636
|
-
return
|
|
2637
|
-
|
|
2638
|
-
}), [e,
|
|
2639
|
-
!
|
|
2640
|
-
}, [e,
|
|
2641
|
-
/* @__PURE__ */
|
|
2710
|
+
}, [H, _]);
|
|
2711
|
+
return ae(() => (i && t.length > 0 && !a && D(), () => {
|
|
2712
|
+
s.current && window.clearTimeout(s.current), d.current && window.clearTimeout(d.current);
|
|
2713
|
+
}), [e, a, i, t.length, D]), ae(() => {
|
|
2714
|
+
!g && i && t.length > 0 && !a && D();
|
|
2715
|
+
}, [e, g, i, t.length, a, D]), /* @__PURE__ */ W("div", { style: { position: "relative" }, children: [
|
|
2716
|
+
/* @__PURE__ */ m(
|
|
2642
2717
|
Fe,
|
|
2643
2718
|
{
|
|
2644
|
-
...
|
|
2645
|
-
value:
|
|
2646
|
-
onChange: (
|
|
2647
|
-
k?.(
|
|
2719
|
+
...L,
|
|
2720
|
+
value: c,
|
|
2721
|
+
onChange: (N) => {
|
|
2722
|
+
k?.(N.target.value), L.onChange?.(N);
|
|
2648
2723
|
},
|
|
2649
|
-
onFocus: (
|
|
2650
|
-
|
|
2724
|
+
onFocus: (N) => {
|
|
2725
|
+
n(!0), s.current && window.clearTimeout(s.current), d.current && window.clearTimeout(d.current), l(!1), r(!1), L.onFocus?.(N);
|
|
2651
2726
|
},
|
|
2652
|
-
onBlur: (
|
|
2653
|
-
|
|
2727
|
+
onBlur: (N) => {
|
|
2728
|
+
n(!1), !c && t.length > 0 && (C(""), A(0)), L.onBlur?.(N);
|
|
2654
2729
|
},
|
|
2655
|
-
placeholder:
|
|
2730
|
+
placeholder: a || c ? y : E || y,
|
|
2656
2731
|
style: {
|
|
2657
2732
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2658
|
-
...
|
|
2733
|
+
...L.style,
|
|
2659
2734
|
position: "relative",
|
|
2660
2735
|
zIndex: 1
|
|
2661
2736
|
}
|
|
2662
2737
|
}
|
|
2663
2738
|
),
|
|
2664
|
-
!
|
|
2739
|
+
!a && !c && E && /* @__PURE__ */ W(
|
|
2665
2740
|
"div",
|
|
2666
2741
|
{
|
|
2667
2742
|
style: {
|
|
@@ -2681,8 +2756,8 @@ const Gt = ({
|
|
|
2681
2756
|
fontFamily: "inherit"
|
|
2682
2757
|
},
|
|
2683
2758
|
children: [
|
|
2684
|
-
/* @__PURE__ */
|
|
2685
|
-
|
|
2759
|
+
/* @__PURE__ */ m("span", { children: E }),
|
|
2760
|
+
o && /* @__PURE__ */ m(
|
|
2686
2761
|
"span",
|
|
2687
2762
|
{
|
|
2688
2763
|
style: {
|
|
@@ -2698,7 +2773,7 @@ const Gt = ({
|
|
|
2698
2773
|
]
|
|
2699
2774
|
}
|
|
2700
2775
|
),
|
|
2701
|
-
/* @__PURE__ */
|
|
2776
|
+
/* @__PURE__ */ m("style", { children: `
|
|
2702
2777
|
@keyframes blink {
|
|
2703
2778
|
0%, 50% { opacity: 1; }
|
|
2704
2779
|
51%, 100% { opacity: 0; }
|
|
@@ -2706,7 +2781,7 @@ const Gt = ({
|
|
|
2706
2781
|
` })
|
|
2707
2782
|
] });
|
|
2708
2783
|
};
|
|
2709
|
-
|
|
2784
|
+
Pt.__docgenInfo = {
|
|
2710
2785
|
displayName: "DynamicInput",
|
|
2711
2786
|
description: "动态文案输入框组件,支持流式文字动画效果",
|
|
2712
2787
|
props: {
|
|
@@ -2751,109 +2826,109 @@ Gt.__docgenInfo = {
|
|
|
2751
2826
|
}
|
|
2752
2827
|
}
|
|
2753
2828
|
};
|
|
2754
|
-
const
|
|
2829
|
+
const Dt = ({
|
|
2755
2830
|
texts: t = [],
|
|
2756
2831
|
// 动态文案数组,默认为空数组
|
|
2757
|
-
placeholder:
|
|
2832
|
+
placeholder: y = "请输入内容",
|
|
2758
2833
|
// 占位符文本
|
|
2759
|
-
animationSpeed:
|
|
2834
|
+
animationSpeed: u = 100,
|
|
2760
2835
|
// 打字机动画速度,毫秒
|
|
2761
|
-
autoPlay:
|
|
2836
|
+
autoPlay: i = !0,
|
|
2762
2837
|
// 是否自动播放动画
|
|
2763
|
-
value:
|
|
2838
|
+
value: c = "",
|
|
2764
2839
|
// 受控模式的值
|
|
2765
2840
|
onChange: k,
|
|
2766
2841
|
// 受控模式的变化回调
|
|
2767
|
-
onSubmit:
|
|
2842
|
+
onSubmit: L,
|
|
2768
2843
|
// 提交回调
|
|
2769
2844
|
maxLength: E = 500,
|
|
2770
2845
|
// 最大字符数限制
|
|
2771
|
-
showCount:
|
|
2846
|
+
showCount: C = !0,
|
|
2772
2847
|
// 是否显示字数统计
|
|
2773
2848
|
submitText: e = "发送",
|
|
2774
2849
|
// 提交按钮文本
|
|
2775
|
-
disabled:
|
|
2850
|
+
disabled: A = !1,
|
|
2776
2851
|
// 是否禁用组件
|
|
2777
|
-
rows:
|
|
2852
|
+
rows: g = 4,
|
|
2778
2853
|
// 文本域行数
|
|
2779
|
-
style:
|
|
2854
|
+
style: l,
|
|
2780
2855
|
// 自定义样式
|
|
2781
|
-
...
|
|
2856
|
+
...a
|
|
2782
2857
|
// 其他原生属性
|
|
2783
2858
|
}) => {
|
|
2784
|
-
const [
|
|
2785
|
-
|
|
2786
|
-
|
|
2859
|
+
const [n, o] = X(""), [r, s] = X(0), [d, h] = X(!1), [x, G] = X(!1), [T, _] = X(!1), [H, D] = X(c || ""), K = j(void 0), Q = j(void 0), Y = j(t), te = j(r), N = j(x), M = j(n), ne = j(null);
|
|
2860
|
+
ae(() => {
|
|
2861
|
+
Y.current = t, te.current = r, N.current = x, M.current = n;
|
|
2787
2862
|
});
|
|
2788
|
-
const re =
|
|
2863
|
+
const re = U((O, le) => {
|
|
2789
2864
|
let de = 0;
|
|
2790
|
-
|
|
2865
|
+
_(!0);
|
|
2791
2866
|
const be = () => {
|
|
2792
|
-
de <
|
|
2867
|
+
de < O.length ? (o(O.slice(0, de + 1)), de++, Q.current = window.setTimeout(be, u)) : (_(!1), le?.());
|
|
2793
2868
|
};
|
|
2794
2869
|
be();
|
|
2795
|
-
}, [
|
|
2796
|
-
let le =
|
|
2870
|
+
}, [u]), ce = U((O) => {
|
|
2871
|
+
let le = M.current.length;
|
|
2797
2872
|
const de = () => {
|
|
2798
|
-
le > 0 ? (
|
|
2873
|
+
le > 0 ? (o(M.current.slice(0, le - 1)), le--, Q.current = window.setTimeout(de, u / 2)) : O?.();
|
|
2799
2874
|
};
|
|
2800
2875
|
de();
|
|
2801
|
-
}, [
|
|
2802
|
-
if (
|
|
2803
|
-
|
|
2804
|
-
const
|
|
2805
|
-
|
|
2806
|
-
re(
|
|
2807
|
-
|
|
2808
|
-
|
|
2876
|
+
}, [u]), ye = U(() => {
|
|
2877
|
+
if (Y.current.length === 0 || N.current) return;
|
|
2878
|
+
h(!0);
|
|
2879
|
+
const O = Y.current[te.current];
|
|
2880
|
+
M.current ? ce(() => {
|
|
2881
|
+
re(O, () => {
|
|
2882
|
+
K.current = window.setTimeout(() => {
|
|
2883
|
+
s((le) => (le + 1) % Y.current.length), h(!1);
|
|
2809
2884
|
}, 2e3);
|
|
2810
2885
|
});
|
|
2811
|
-
}) : re(
|
|
2812
|
-
|
|
2813
|
-
|
|
2886
|
+
}) : re(O, () => {
|
|
2887
|
+
K.current = window.setTimeout(() => {
|
|
2888
|
+
s((le) => (le + 1) % Y.current.length), h(!1);
|
|
2814
2889
|
}, 2e3);
|
|
2815
2890
|
});
|
|
2816
2891
|
}, [ce, re]);
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
}), [
|
|
2820
|
-
!
|
|
2821
|
-
}, [
|
|
2822
|
-
const ue = (
|
|
2823
|
-
|
|
2824
|
-
},
|
|
2825
|
-
|
|
2826
|
-
},
|
|
2827
|
-
const le =
|
|
2828
|
-
E && le.length > E || (k ? k(le) :
|
|
2892
|
+
ae(() => (i && t.length > 0 && !x && ye(), () => {
|
|
2893
|
+
K.current && window.clearTimeout(K.current), Q.current && window.clearTimeout(Q.current);
|
|
2894
|
+
}), [r, x, i, t.length, ye]), ae(() => {
|
|
2895
|
+
!d && i && t.length > 0 && !x && ye();
|
|
2896
|
+
}, [r, d, i, t.length, x, ye]);
|
|
2897
|
+
const ue = (O) => {
|
|
2898
|
+
G(!0), K.current && window.clearTimeout(K.current), Q.current && window.clearTimeout(Q.current), h(!1), _(!1), a.onFocus?.(O);
|
|
2899
|
+
}, Ne = (O) => {
|
|
2900
|
+
G(!1), !c && t.length > 0 && (o(""), s(0)), a.onBlur?.(O);
|
|
2901
|
+
}, Se = (O) => {
|
|
2902
|
+
const le = O.target.value;
|
|
2903
|
+
E && le.length > E || (k ? k(le) : D(le), a.onChange?.(O));
|
|
2829
2904
|
}, xe = () => {
|
|
2830
|
-
const
|
|
2831
|
-
|
|
2832
|
-
},
|
|
2833
|
-
(
|
|
2834
|
-
}, me = k ?
|
|
2835
|
-
return /* @__PURE__ */
|
|
2836
|
-
/* @__PURE__ */
|
|
2837
|
-
/* @__PURE__ */
|
|
2905
|
+
const O = k ? c : H;
|
|
2906
|
+
O.trim() && !A && (L?.(O), k || D(""));
|
|
2907
|
+
}, Ae = (O) => {
|
|
2908
|
+
(O.ctrlKey || O.metaKey) && O.key === "Enter" && (O.preventDefault(), xe()), a.onKeyDown?.(O);
|
|
2909
|
+
}, me = k ? c : H, Le = A || !me.trim() || (E ? me.length > E : !1);
|
|
2910
|
+
return /* @__PURE__ */ W("div", { style: { position: "relative", ...l }, children: [
|
|
2911
|
+
/* @__PURE__ */ W("div", { style: { position: "relative" }, children: [
|
|
2912
|
+
/* @__PURE__ */ m(
|
|
2838
2913
|
"textarea",
|
|
2839
2914
|
{
|
|
2840
|
-
ref:
|
|
2841
|
-
value: k ?
|
|
2842
|
-
onChange:
|
|
2843
|
-
onFocus: (
|
|
2844
|
-
|
|
2915
|
+
ref: ne,
|
|
2916
|
+
value: k ? c : H,
|
|
2917
|
+
onChange: Se,
|
|
2918
|
+
onFocus: (O) => {
|
|
2919
|
+
O.target.style.borderColor = "#1890ff", O.target.style.boxShadow = "0 0 0 2px rgba(24, 144, 255, 0.2)", ue(O);
|
|
2845
2920
|
},
|
|
2846
|
-
onBlur: (
|
|
2847
|
-
|
|
2921
|
+
onBlur: (O) => {
|
|
2922
|
+
O.target.style.borderColor = "#d9d9d9", O.target.style.boxShadow = "none", Ne(O);
|
|
2848
2923
|
},
|
|
2849
|
-
onKeyDown:
|
|
2850
|
-
placeholder:
|
|
2924
|
+
onKeyDown: Ae,
|
|
2925
|
+
placeholder: x || me ? y : "",
|
|
2851
2926
|
maxLength: E,
|
|
2852
|
-
rows:
|
|
2853
|
-
disabled:
|
|
2927
|
+
rows: g,
|
|
2928
|
+
disabled: A,
|
|
2854
2929
|
style: {
|
|
2855
2930
|
width: "100%",
|
|
2856
|
-
minHeight: `${
|
|
2931
|
+
minHeight: `${g * 24 + 16}px`,
|
|
2857
2932
|
padding: "8px 60px 8px 12px",
|
|
2858
2933
|
// 右侧留出按钮空间
|
|
2859
2934
|
border: "1px solid #d9d9d9",
|
|
@@ -2866,12 +2941,12 @@ const Rt = ({
|
|
|
2866
2941
|
transition: "border-color 0.3s, box-shadow 0.3s",
|
|
2867
2942
|
backgroundColor: "#fff",
|
|
2868
2943
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2869
|
-
...
|
|
2944
|
+
...a.style
|
|
2870
2945
|
},
|
|
2871
|
-
...
|
|
2946
|
+
...a
|
|
2872
2947
|
}
|
|
2873
2948
|
),
|
|
2874
|
-
!
|
|
2949
|
+
!x && !me && n && /* @__PURE__ */ W(
|
|
2875
2950
|
"div",
|
|
2876
2951
|
{
|
|
2877
2952
|
style: {
|
|
@@ -2893,8 +2968,8 @@ const Rt = ({
|
|
|
2893
2968
|
lineHeight: "1.5"
|
|
2894
2969
|
},
|
|
2895
2970
|
children: [
|
|
2896
|
-
/* @__PURE__ */
|
|
2897
|
-
T && /* @__PURE__ */
|
|
2971
|
+
/* @__PURE__ */ m("span", { children: n }),
|
|
2972
|
+
T && /* @__PURE__ */ m(
|
|
2898
2973
|
"span",
|
|
2899
2974
|
{
|
|
2900
2975
|
style: {
|
|
@@ -2910,7 +2985,7 @@ const Rt = ({
|
|
|
2910
2985
|
]
|
|
2911
2986
|
}
|
|
2912
2987
|
),
|
|
2913
|
-
/* @__PURE__ */
|
|
2988
|
+
/* @__PURE__ */ m(
|
|
2914
2989
|
"div",
|
|
2915
2990
|
{
|
|
2916
2991
|
style: {
|
|
@@ -2919,14 +2994,14 @@ const Rt = ({
|
|
|
2919
2994
|
right: 8,
|
|
2920
2995
|
zIndex: 3
|
|
2921
2996
|
},
|
|
2922
|
-
children: /* @__PURE__ */
|
|
2997
|
+
children: /* @__PURE__ */ m(
|
|
2923
2998
|
ge,
|
|
2924
2999
|
{
|
|
2925
3000
|
type: "primary",
|
|
2926
3001
|
size: "small",
|
|
2927
|
-
icon: /* @__PURE__ */
|
|
3002
|
+
icon: /* @__PURE__ */ m(ct, {}),
|
|
2928
3003
|
onClick: xe,
|
|
2929
|
-
disabled:
|
|
3004
|
+
disabled: Le,
|
|
2930
3005
|
style: {
|
|
2931
3006
|
borderRadius: 6,
|
|
2932
3007
|
minWidth: 32,
|
|
@@ -2941,7 +3016,7 @@ const Rt = ({
|
|
|
2941
3016
|
}
|
|
2942
3017
|
)
|
|
2943
3018
|
] }),
|
|
2944
|
-
|
|
3019
|
+
C && /* @__PURE__ */ W(
|
|
2945
3020
|
"div",
|
|
2946
3021
|
{
|
|
2947
3022
|
style: {
|
|
@@ -2957,7 +3032,7 @@ const Rt = ({
|
|
|
2957
3032
|
]
|
|
2958
3033
|
}
|
|
2959
3034
|
),
|
|
2960
|
-
/* @__PURE__ */
|
|
3035
|
+
/* @__PURE__ */ m("style", { children: `
|
|
2961
3036
|
@keyframes blink {
|
|
2962
3037
|
0%, 50% { opacity: 1; }
|
|
2963
3038
|
51%, 100% { opacity: 0; }
|
|
@@ -2965,7 +3040,7 @@ const Rt = ({
|
|
|
2965
3040
|
` })
|
|
2966
3041
|
] });
|
|
2967
3042
|
};
|
|
2968
|
-
|
|
3043
|
+
Dt.__docgenInfo = {
|
|
2969
3044
|
displayName: "DynamicTextArea",
|
|
2970
3045
|
description: "动态文案文本域组件,支持流式文字动画效果",
|
|
2971
3046
|
props: {
|
|
@@ -3053,89 +3128,89 @@ Rt.__docgenInfo = {
|
|
|
3053
3128
|
};
|
|
3054
3129
|
const We = ({
|
|
3055
3130
|
src: t,
|
|
3056
|
-
poster:
|
|
3057
|
-
width:
|
|
3058
|
-
height:
|
|
3059
|
-
videoWidth:
|
|
3131
|
+
poster: y,
|
|
3132
|
+
width: u = 300,
|
|
3133
|
+
height: i,
|
|
3134
|
+
videoWidth: c,
|
|
3060
3135
|
// 参数保留但不使用,由CSS控制
|
|
3061
3136
|
videoHeight: k,
|
|
3062
3137
|
// 参数保留但不使用,由CSS控制
|
|
3063
|
-
showPlayButton:
|
|
3138
|
+
showPlayButton: L = !0,
|
|
3064
3139
|
autoPlayOnHover: E = !0,
|
|
3065
|
-
onClick:
|
|
3140
|
+
onClick: C,
|
|
3066
3141
|
onVideoLoaded: e,
|
|
3067
|
-
onVideoPlay:
|
|
3068
|
-
onVideoPause:
|
|
3069
|
-
onVideoEnded:
|
|
3070
|
-
className:
|
|
3071
|
-
style:
|
|
3072
|
-
...
|
|
3142
|
+
onVideoPlay: A,
|
|
3143
|
+
onVideoPause: g,
|
|
3144
|
+
onVideoEnded: l,
|
|
3145
|
+
className: a,
|
|
3146
|
+
style: n,
|
|
3147
|
+
...o
|
|
3073
3148
|
}) => {
|
|
3074
|
-
const
|
|
3075
|
-
|
|
3076
|
-
}, [
|
|
3077
|
-
|
|
3078
|
-
}, [
|
|
3079
|
-
re.stopPropagation(),
|
|
3080
|
-
}, [
|
|
3081
|
-
|
|
3082
|
-
}, [E,
|
|
3083
|
-
|
|
3084
|
-
}, [E,
|
|
3149
|
+
const r = j(null), [s, d] = X(!1), [h, x] = X(!1), [G, T] = X(!1), _ = U(() => {
|
|
3150
|
+
r.current && (r.current.play(), d(!0), A?.());
|
|
3151
|
+
}, [A]), H = U(() => {
|
|
3152
|
+
r.current && (r.current.pause(), d(!1), g?.());
|
|
3153
|
+
}, [g]), D = U((re) => {
|
|
3154
|
+
re.stopPropagation(), s ? H() : _();
|
|
3155
|
+
}, [s, _, H]), K = U(() => {
|
|
3156
|
+
x(!0), E && !s && _();
|
|
3157
|
+
}, [E, s, _]), Q = U(() => {
|
|
3158
|
+
x(!1), E && s && H();
|
|
3159
|
+
}, [E, s, H]), Y = U(() => {
|
|
3085
3160
|
T(!0), e?.();
|
|
3086
|
-
}, [e]),
|
|
3087
|
-
|
|
3088
|
-
}, [
|
|
3089
|
-
|
|
3090
|
-
}, [
|
|
3091
|
-
|
|
3092
|
-
}, [
|
|
3093
|
-
|
|
3094
|
-
}, [
|
|
3095
|
-
return /* @__PURE__ */
|
|
3161
|
+
}, [e]), te = U(() => {
|
|
3162
|
+
d(!0), A?.();
|
|
3163
|
+
}, [A]), N = U(() => {
|
|
3164
|
+
d(!1), g?.();
|
|
3165
|
+
}, [g]), M = U(() => {
|
|
3166
|
+
d(!1), l?.();
|
|
3167
|
+
}, [l]), ne = U((re) => {
|
|
3168
|
+
C?.(re);
|
|
3169
|
+
}, [C]);
|
|
3170
|
+
return /* @__PURE__ */ m(
|
|
3096
3171
|
Be,
|
|
3097
3172
|
{
|
|
3098
|
-
...
|
|
3099
|
-
className: `video-card ${
|
|
3173
|
+
...o,
|
|
3174
|
+
className: `video-card ${a || ""}`,
|
|
3100
3175
|
style: {
|
|
3101
|
-
width:
|
|
3102
|
-
height:
|
|
3176
|
+
width: u,
|
|
3177
|
+
height: i,
|
|
3103
3178
|
padding: 0,
|
|
3104
3179
|
overflow: "hidden",
|
|
3105
|
-
cursor:
|
|
3180
|
+
cursor: C ? "pointer" : "default",
|
|
3106
3181
|
border: "none",
|
|
3107
3182
|
borderRadius: 0,
|
|
3108
|
-
...
|
|
3183
|
+
...n
|
|
3109
3184
|
},
|
|
3110
3185
|
bordered: !1,
|
|
3111
|
-
onMouseEnter:
|
|
3112
|
-
onMouseLeave:
|
|
3113
|
-
onClick:
|
|
3114
|
-
children: /* @__PURE__ */
|
|
3115
|
-
/* @__PURE__ */
|
|
3186
|
+
onMouseEnter: K,
|
|
3187
|
+
onMouseLeave: Q,
|
|
3188
|
+
onClick: ne,
|
|
3189
|
+
children: /* @__PURE__ */ W("div", { className: "video-card-container", children: [
|
|
3190
|
+
/* @__PURE__ */ m(
|
|
3116
3191
|
"video",
|
|
3117
3192
|
{
|
|
3118
|
-
ref:
|
|
3193
|
+
ref: r,
|
|
3119
3194
|
src: t,
|
|
3120
|
-
poster:
|
|
3195
|
+
poster: y,
|
|
3121
3196
|
preload: "metadata",
|
|
3122
|
-
onLoadedData:
|
|
3123
|
-
onPlay:
|
|
3124
|
-
onPause:
|
|
3125
|
-
onEnded:
|
|
3197
|
+
onLoadedData: Y,
|
|
3198
|
+
onPlay: te,
|
|
3199
|
+
onPause: N,
|
|
3200
|
+
onEnded: M,
|
|
3126
3201
|
muted: !0,
|
|
3127
3202
|
loop: !0
|
|
3128
3203
|
}
|
|
3129
3204
|
),
|
|
3130
|
-
|
|
3205
|
+
L && /* @__PURE__ */ m(
|
|
3131
3206
|
"div",
|
|
3132
3207
|
{
|
|
3133
|
-
className: `video-play-button ${
|
|
3134
|
-
onClick:
|
|
3135
|
-
children:
|
|
3208
|
+
className: `video-play-button ${h ? "hovered" : ""}`,
|
|
3209
|
+
onClick: D,
|
|
3210
|
+
children: s ? /* @__PURE__ */ m(ut, { className: "play-icon" }) : /* @__PURE__ */ m(dt, { className: "play-icon" })
|
|
3136
3211
|
}
|
|
3137
3212
|
),
|
|
3138
|
-
!
|
|
3213
|
+
!G && /* @__PURE__ */ m("div", { className: "video-loading-mask", children: /* @__PURE__ */ m("div", { className: "loading-spinner" }) })
|
|
3139
3214
|
] })
|
|
3140
3215
|
}
|
|
3141
3216
|
);
|
|
@@ -3241,12 +3316,12 @@ We.__docgenInfo = {
|
|
|
3241
3316
|
}
|
|
3242
3317
|
}
|
|
3243
3318
|
};
|
|
3244
|
-
const
|
|
3319
|
+
const Mt = (t) => [".mp4", ".webm", ".ogg", ".mov", ".avi", ".wmv", ".flv", ".mkv"].some((u) => t.toLowerCase().includes(u)), Rt = (t) => t.type ? t.type : Mt(t.url) ? "video" : "image", Ht = ({
|
|
3245
3320
|
items: t,
|
|
3246
|
-
columns:
|
|
3247
|
-
gap:
|
|
3248
|
-
responsive:
|
|
3249
|
-
breakpoints:
|
|
3321
|
+
columns: y,
|
|
3322
|
+
gap: u = 0,
|
|
3323
|
+
responsive: i = !0,
|
|
3324
|
+
breakpoints: c = {
|
|
3250
3325
|
xs: 1,
|
|
3251
3326
|
sm: 2,
|
|
3252
3327
|
md: 3,
|
|
@@ -3255,101 +3330,101 @@ const Dt = (t) => [".mp4", ".webm", ".ogg", ".mov", ".avi", ".wmv", ".flv", ".mk
|
|
|
3255
3330
|
xxl: 6
|
|
3256
3331
|
},
|
|
3257
3332
|
className: k,
|
|
3258
|
-
style:
|
|
3333
|
+
style: L,
|
|
3259
3334
|
onClick: E
|
|
3260
3335
|
}) => {
|
|
3261
|
-
const
|
|
3262
|
-
if (!
|
|
3263
|
-
return
|
|
3264
|
-
const
|
|
3265
|
-
return
|
|
3266
|
-
}, [
|
|
3267
|
-
if (!
|
|
3268
|
-
const
|
|
3269
|
-
t.forEach((T,
|
|
3270
|
-
const H = T.id ||
|
|
3271
|
-
if (!
|
|
3272
|
-
const
|
|
3273
|
-
|
|
3336
|
+
const C = j(null), [e, A] = X(y || c.md || 3), g = j(/* @__PURE__ */ new Map()), l = U(() => {
|
|
3337
|
+
if (!i || y)
|
|
3338
|
+
return y || c.md || 3;
|
|
3339
|
+
const r = window.innerWidth;
|
|
3340
|
+
return r < 576 ? c.xs || 1 : r < 768 ? c.sm || 2 : r < 992 ? c.md || 3 : r < 1200 ? c.lg || 4 : r < 1600 ? c.xl || 5 : c.xxl || 6;
|
|
3341
|
+
}, [i, y, c]), a = U(() => {
|
|
3342
|
+
if (!C.current) return;
|
|
3343
|
+
const r = e, s = C.current, h = (s.offsetWidth - u * (r - 1)) / r, x = new Array(r).fill(0);
|
|
3344
|
+
t.forEach((T, _) => {
|
|
3345
|
+
const H = T.id || _, D = g.current.get(H);
|
|
3346
|
+
if (!D) return;
|
|
3347
|
+
const K = Math.min(...x), Q = x.indexOf(K), Y = Q * (h + u), te = x[Q];
|
|
3348
|
+
D.style.position = "absolute", D.style.left = `${Y}px`, D.style.top = `${te}px`, D.style.width = `${h}px`, x[Q] += D.offsetHeight + u;
|
|
3274
3349
|
});
|
|
3275
|
-
const
|
|
3276
|
-
|
|
3277
|
-
}, [t, e,
|
|
3278
|
-
|
|
3279
|
-
const
|
|
3280
|
-
const
|
|
3281
|
-
|
|
3350
|
+
const G = Math.max(...x);
|
|
3351
|
+
s.style.height = `${G}px`;
|
|
3352
|
+
}, [t, e, u]);
|
|
3353
|
+
ae(() => {
|
|
3354
|
+
const r = () => {
|
|
3355
|
+
const s = l();
|
|
3356
|
+
s !== e && A(s);
|
|
3282
3357
|
};
|
|
3283
|
-
if (
|
|
3284
|
-
return window.addEventListener("resize",
|
|
3285
|
-
}, [
|
|
3286
|
-
const
|
|
3287
|
-
|
|
3358
|
+
if (i)
|
|
3359
|
+
return window.addEventListener("resize", r), r(), () => window.removeEventListener("resize", r);
|
|
3360
|
+
}, [i, l, e]), ae(() => {
|
|
3361
|
+
const r = setTimeout(() => {
|
|
3362
|
+
a();
|
|
3288
3363
|
}, 100);
|
|
3289
|
-
return () => clearTimeout(
|
|
3290
|
-
}, [t, e,
|
|
3291
|
-
const
|
|
3292
|
-
|
|
3293
|
-
}, [
|
|
3294
|
-
E && E(
|
|
3364
|
+
return () => clearTimeout(r);
|
|
3365
|
+
}, [t, e, a]);
|
|
3366
|
+
const n = U(() => {
|
|
3367
|
+
a();
|
|
3368
|
+
}, [a]), o = U((r) => {
|
|
3369
|
+
E && E(r), r.onClick?.(r);
|
|
3295
3370
|
}, [E]);
|
|
3296
|
-
return /* @__PURE__ */
|
|
3371
|
+
return /* @__PURE__ */ m(
|
|
3297
3372
|
"div",
|
|
3298
3373
|
{
|
|
3299
|
-
ref:
|
|
3374
|
+
ref: C,
|
|
3300
3375
|
className: `waterfall-container ${k || ""}`,
|
|
3301
3376
|
style: {
|
|
3302
3377
|
position: "relative",
|
|
3303
3378
|
width: "100%",
|
|
3304
|
-
...
|
|
3379
|
+
...L
|
|
3305
3380
|
},
|
|
3306
|
-
children: t.map((
|
|
3307
|
-
const
|
|
3308
|
-
return /* @__PURE__ */
|
|
3381
|
+
children: t.map((r, s) => {
|
|
3382
|
+
const d = r.id || s, h = Rt(r);
|
|
3383
|
+
return /* @__PURE__ */ m(
|
|
3309
3384
|
"div",
|
|
3310
3385
|
{
|
|
3311
|
-
ref: (
|
|
3312
|
-
|
|
3386
|
+
ref: (x) => {
|
|
3387
|
+
x ? g.current.set(d, x) : g.current.delete(d);
|
|
3313
3388
|
},
|
|
3314
3389
|
className: "waterfall-item",
|
|
3315
|
-
children:
|
|
3390
|
+
children: h === "video" ? /* @__PURE__ */ m("div", { style: {
|
|
3316
3391
|
width: "100%",
|
|
3317
3392
|
position: "relative",
|
|
3318
3393
|
paddingBottom: "56.25%",
|
|
3319
|
-
cursor: E ||
|
|
3320
|
-
}, children: /* @__PURE__ */
|
|
3394
|
+
cursor: E || r.onClick ? "pointer" : "default"
|
|
3395
|
+
}, children: /* @__PURE__ */ m("div", { style: { position: "absolute", top: 0, left: 0, width: "100%", height: "100%" }, children: /* @__PURE__ */ m(
|
|
3321
3396
|
We,
|
|
3322
3397
|
{
|
|
3323
|
-
src:
|
|
3324
|
-
poster:
|
|
3398
|
+
src: r.url,
|
|
3399
|
+
poster: r.poster,
|
|
3325
3400
|
width: "100%",
|
|
3326
3401
|
height: "100%",
|
|
3327
|
-
onClick: () =>
|
|
3328
|
-
onVideoLoaded:
|
|
3402
|
+
onClick: () => o(r),
|
|
3403
|
+
onVideoLoaded: n,
|
|
3329
3404
|
autoPlayOnHover: !0,
|
|
3330
3405
|
showPlayButton: !1
|
|
3331
3406
|
}
|
|
3332
|
-
) }) }) : /* @__PURE__ */
|
|
3407
|
+
) }) }) : /* @__PURE__ */ m(
|
|
3333
3408
|
"div",
|
|
3334
3409
|
{
|
|
3335
3410
|
className: "waterfall-image-wrapper",
|
|
3336
|
-
onClick: () =>
|
|
3337
|
-
style: { cursor: E ||
|
|
3338
|
-
children: /* @__PURE__ */
|
|
3411
|
+
onClick: () => o(r),
|
|
3412
|
+
style: { cursor: E || r.onClick ? "pointer" : "default" },
|
|
3413
|
+
children: /* @__PURE__ */ m(
|
|
3339
3414
|
"img",
|
|
3340
3415
|
{
|
|
3341
|
-
src:
|
|
3342
|
-
alt: `瀑布流图片 ${
|
|
3416
|
+
src: r.url,
|
|
3417
|
+
alt: `瀑布流图片 ${s + 1}`,
|
|
3343
3418
|
className: "waterfall-image",
|
|
3344
|
-
onLoad:
|
|
3345
|
-
onError:
|
|
3419
|
+
onLoad: n,
|
|
3420
|
+
onError: n,
|
|
3346
3421
|
style: { display: "block", width: "100%", height: "auto" }
|
|
3347
3422
|
}
|
|
3348
3423
|
)
|
|
3349
3424
|
}
|
|
3350
3425
|
)
|
|
3351
3426
|
},
|
|
3352
|
-
|
|
3427
|
+
d
|
|
3353
3428
|
);
|
|
3354
3429
|
})
|
|
3355
3430
|
}
|
|
@@ -3483,14 +3558,14 @@ export {
|
|
|
3483
3558
|
bt as BackButton,
|
|
3484
3559
|
ft as Button,
|
|
3485
3560
|
yt as Card,
|
|
3486
|
-
|
|
3487
|
-
|
|
3561
|
+
Pt as DynamicInput,
|
|
3562
|
+
Dt as DynamicTextArea,
|
|
3488
3563
|
xt as EmptyAndSpin,
|
|
3489
|
-
|
|
3564
|
+
kt as LinkButton,
|
|
3490
3565
|
gt as PageTable,
|
|
3491
|
-
|
|
3566
|
+
It as RichTextEditor,
|
|
3492
3567
|
We as VideoCard,
|
|
3493
|
-
|
|
3568
|
+
Gt as VirtualTable,
|
|
3494
3569
|
Ht as Waterfall,
|
|
3495
3570
|
vt as XcIcon,
|
|
3496
3571
|
Ut as lightTheme
|