bi-components-library 1.0.28 → 1.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +945 -935
- 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
1
|
import { jsx as E, jsxs as Z, Fragment as Ze } from "react/jsx-runtime";
|
|
2
2
|
import { useState as ne, useRef as Q, useMemo as Ye, useCallback as ae, useEffect as de, useLayoutEffect as ze } from "react";
|
|
3
|
-
import { Button as $e, Card as Oe, Modal as et, Table as Re, Flex as We, Spin as tt, Empty as nt, Select as Ge, Form as
|
|
3
|
+
import { Button as $e, Card as Oe, Modal as et, Table as Re, Flex as We, Spin as tt, Empty as nt, Select as Ge, Form as _e, Input as Ke, Space as at, DatePicker as rt, Dropdown as ot, Tooltip as st, Progress as it, Pagination as lt, theme as ct } from "antd";
|
|
4
4
|
import { createFromIconfontCN as ut, LeftOutlined as dt, SearchOutlined as pt, ReloadOutlined as ft, InfoCircleOutlined as yt, SendOutlined as mt, PauseCircleOutlined as ht, PlayCircleOutlined as gt } from "@ant-design/icons";
|
|
5
5
|
import { createPortal as Xe } from "react-dom";
|
|
6
6
|
const vt = ({
|
|
7
7
|
variant: t = "primary",
|
|
8
|
-
loading:
|
|
9
|
-
children:
|
|
10
|
-
...
|
|
8
|
+
loading: x = !1,
|
|
9
|
+
children: d,
|
|
10
|
+
...i
|
|
11
11
|
}) => /* @__PURE__ */ E(
|
|
12
12
|
$e,
|
|
13
13
|
{
|
|
14
|
-
...
|
|
14
|
+
...i,
|
|
15
15
|
type: ((T) => {
|
|
16
16
|
switch (T) {
|
|
17
17
|
case "primary":
|
|
@@ -28,9 +28,9 @@ const vt = ({
|
|
|
28
28
|
return "primary";
|
|
29
29
|
}
|
|
30
30
|
})(t),
|
|
31
|
-
loading:
|
|
31
|
+
loading: x,
|
|
32
32
|
ghost: t === "ghost",
|
|
33
|
-
children:
|
|
33
|
+
children: d
|
|
34
34
|
}
|
|
35
35
|
);
|
|
36
36
|
vt.__docgenInfo = {
|
|
@@ -79,20 +79,20 @@ vt.__docgenInfo = {
|
|
|
79
79
|
};
|
|
80
80
|
const bt = ({
|
|
81
81
|
title: t,
|
|
82
|
-
children:
|
|
83
|
-
bordered:
|
|
84
|
-
hoverable:
|
|
85
|
-
size:
|
|
82
|
+
children: x,
|
|
83
|
+
bordered: d = !0,
|
|
84
|
+
hoverable: i = !1,
|
|
85
|
+
size: u = "default",
|
|
86
86
|
...T
|
|
87
87
|
}) => /* @__PURE__ */ E(
|
|
88
88
|
Oe,
|
|
89
89
|
{
|
|
90
90
|
...T,
|
|
91
91
|
title: t,
|
|
92
|
-
bordered:
|
|
93
|
-
hoverable:
|
|
94
|
-
size:
|
|
95
|
-
children:
|
|
92
|
+
bordered: d,
|
|
93
|
+
hoverable: i,
|
|
94
|
+
size: u,
|
|
95
|
+
children: x
|
|
96
96
|
}
|
|
97
97
|
);
|
|
98
98
|
bt.__docgenInfo = {
|
|
@@ -148,17 +148,17 @@ bt.__docgenInfo = {
|
|
|
148
148
|
};
|
|
149
149
|
const xt = ({
|
|
150
150
|
showDefaultFooter: t = !0,
|
|
151
|
-
...
|
|
151
|
+
...x
|
|
152
152
|
}) => {
|
|
153
|
-
const
|
|
154
|
-
/* @__PURE__ */ E(
|
|
153
|
+
const d = x.footer !== void 0 ? x.footer : t ? (i, { OkBtn: u, CancelBtn: T }) => /* @__PURE__ */ Z(Ze, { children: [
|
|
154
|
+
/* @__PURE__ */ E(u, {}),
|
|
155
155
|
/* @__PURE__ */ E(T, {})
|
|
156
156
|
] }) : null;
|
|
157
157
|
return /* @__PURE__ */ E(
|
|
158
158
|
et,
|
|
159
159
|
{
|
|
160
|
-
...
|
|
161
|
-
footer:
|
|
160
|
+
...x,
|
|
161
|
+
footer: d
|
|
162
162
|
}
|
|
163
163
|
);
|
|
164
164
|
};
|
|
@@ -225,23 +225,23 @@ xt.__docgenInfo = {
|
|
|
225
225
|
};
|
|
226
226
|
const kt = ({
|
|
227
227
|
scrollX: t,
|
|
228
|
-
showPagination:
|
|
229
|
-
defaultPageSize:
|
|
230
|
-
...
|
|
228
|
+
showPagination: x = !0,
|
|
229
|
+
defaultPageSize: d = 10,
|
|
230
|
+
...i
|
|
231
231
|
}) => /* @__PURE__ */ E(
|
|
232
232
|
Re,
|
|
233
233
|
{
|
|
234
|
-
...
|
|
234
|
+
...i,
|
|
235
235
|
scroll: {
|
|
236
236
|
x: t || "max-content",
|
|
237
237
|
y: "50vh"
|
|
238
238
|
},
|
|
239
|
-
pagination:
|
|
239
|
+
pagination: x ? {
|
|
240
240
|
hideOnSinglePage: !0,
|
|
241
241
|
showSizeChanger: !0,
|
|
242
242
|
showQuickJumper: !0,
|
|
243
|
-
defaultPageSize:
|
|
244
|
-
...
|
|
243
|
+
defaultPageSize: d,
|
|
244
|
+
...i.pagination
|
|
245
245
|
} : !1
|
|
246
246
|
}
|
|
247
247
|
);
|
|
@@ -299,20 +299,20 @@ const wt = ut({
|
|
|
299
299
|
scriptUrl: ["https://at.alicdn.com/t/c/font_4968458_eh91gfr4j9e.js"]
|
|
300
300
|
}), Et = ({
|
|
301
301
|
name: t,
|
|
302
|
-
size:
|
|
303
|
-
color:
|
|
304
|
-
style:
|
|
305
|
-
...
|
|
302
|
+
size: x,
|
|
303
|
+
color: d,
|
|
304
|
+
style: i,
|
|
305
|
+
...u
|
|
306
306
|
}) => {
|
|
307
307
|
const T = {
|
|
308
|
-
fontSize:
|
|
309
|
-
color:
|
|
310
|
-
...
|
|
308
|
+
fontSize: x,
|
|
309
|
+
color: d,
|
|
310
|
+
...i
|
|
311
311
|
};
|
|
312
312
|
return /* @__PURE__ */ E(
|
|
313
313
|
wt,
|
|
314
314
|
{
|
|
315
|
-
...
|
|
315
|
+
...u,
|
|
316
316
|
type: t,
|
|
317
317
|
style: T
|
|
318
318
|
}
|
|
@@ -356,36 +356,36 @@ Et.__docgenInfo = {
|
|
|
356
356
|
};
|
|
357
357
|
const $t = ({
|
|
358
358
|
loading: t,
|
|
359
|
-
description:
|
|
360
|
-
className:
|
|
361
|
-
emptyChildren:
|
|
362
|
-
loadingText:
|
|
359
|
+
description: x = "暂无数据",
|
|
360
|
+
className: d,
|
|
361
|
+
emptyChildren: i,
|
|
362
|
+
loadingText: u,
|
|
363
363
|
emptyImage: T
|
|
364
364
|
}) => t ? /* @__PURE__ */ Z(
|
|
365
365
|
We,
|
|
366
366
|
{
|
|
367
|
-
className: `pt-10 w-full ${
|
|
367
|
+
className: `pt-10 w-full ${d || ""}`,
|
|
368
368
|
align: "center",
|
|
369
369
|
justify: "center",
|
|
370
370
|
vertical: !0,
|
|
371
371
|
children: [
|
|
372
372
|
/* @__PURE__ */ E(tt, { size: "large" }),
|
|
373
|
-
|
|
373
|
+
u && /* @__PURE__ */ E("div", { className: "mt-4 text-gray-500", children: u })
|
|
374
374
|
]
|
|
375
375
|
}
|
|
376
376
|
) : /* @__PURE__ */ E(
|
|
377
377
|
We,
|
|
378
378
|
{
|
|
379
|
-
className: `pt-10 w-full ${
|
|
379
|
+
className: `pt-10 w-full ${d || ""}`,
|
|
380
380
|
align: "center",
|
|
381
381
|
justify: "center",
|
|
382
382
|
children: /* @__PURE__ */ E(
|
|
383
383
|
nt,
|
|
384
384
|
{
|
|
385
385
|
image: T,
|
|
386
|
-
description:
|
|
386
|
+
description: x,
|
|
387
387
|
imageStyle: { height: 180 },
|
|
388
|
-
children:
|
|
388
|
+
children: i
|
|
389
389
|
}
|
|
390
390
|
)
|
|
391
391
|
}
|
|
@@ -435,19 +435,19 @@ $t.__docgenInfo = {
|
|
|
435
435
|
};
|
|
436
436
|
const Ct = ({
|
|
437
437
|
onClick: t,
|
|
438
|
-
showText:
|
|
439
|
-
className:
|
|
440
|
-
size:
|
|
441
|
-
type:
|
|
438
|
+
showText: x = !1,
|
|
439
|
+
className: d,
|
|
440
|
+
size: i = "small",
|
|
441
|
+
type: u = "default"
|
|
442
442
|
}) => /* @__PURE__ */ E(
|
|
443
443
|
$e,
|
|
444
444
|
{
|
|
445
|
-
size:
|
|
446
|
-
type:
|
|
445
|
+
size: i,
|
|
446
|
+
type: u,
|
|
447
447
|
icon: /* @__PURE__ */ E(dt, {}),
|
|
448
|
-
className: `cursor-pointer ${
|
|
448
|
+
className: `cursor-pointer ${d || ""}`,
|
|
449
449
|
onClick: t,
|
|
450
|
-
children:
|
|
450
|
+
children: x && "返回"
|
|
451
451
|
}
|
|
452
452
|
);
|
|
453
453
|
Ct.__docgenInfo = {
|
|
@@ -491,17 +491,17 @@ Ct.__docgenInfo = {
|
|
|
491
491
|
};
|
|
492
492
|
const Tt = ({
|
|
493
493
|
removePadding: t = !0,
|
|
494
|
-
className:
|
|
495
|
-
...
|
|
494
|
+
className: x,
|
|
495
|
+
...d
|
|
496
496
|
}) => {
|
|
497
|
-
const
|
|
497
|
+
const i = t ? `px-0 h-auto ${x || ""}` : x;
|
|
498
498
|
return /* @__PURE__ */ E(
|
|
499
499
|
$e,
|
|
500
500
|
{
|
|
501
501
|
type: "link",
|
|
502
|
-
...
|
|
503
|
-
className:
|
|
504
|
-
children:
|
|
502
|
+
...d,
|
|
503
|
+
className: i,
|
|
504
|
+
children: d.children
|
|
505
505
|
}
|
|
506
506
|
);
|
|
507
507
|
};
|
|
@@ -542,48 +542,48 @@ Tt.__docgenInfo = {
|
|
|
542
542
|
}
|
|
543
543
|
}
|
|
544
544
|
};
|
|
545
|
-
const { Option: qt } = Ge,
|
|
545
|
+
const { Option: qt } = Ge, Nt = ({
|
|
546
546
|
columns: t,
|
|
547
|
-
request:
|
|
548
|
-
searchFields:
|
|
549
|
-
showSearch:
|
|
550
|
-
showRefresh:
|
|
547
|
+
request: x,
|
|
548
|
+
searchFields: d = [],
|
|
549
|
+
showSearch: i = !0,
|
|
550
|
+
showRefresh: u = !0,
|
|
551
551
|
defaultPageSize: T = 10,
|
|
552
|
-
pageSizeOptions:
|
|
552
|
+
pageSizeOptions: I = ["10", "20", "50", "100"],
|
|
553
553
|
autoLoad: $ = !0,
|
|
554
554
|
externalParams: w = {},
|
|
555
555
|
...e
|
|
556
556
|
}) => {
|
|
557
|
-
const [q,
|
|
557
|
+
const [q, f] = ne([]), [s, r] = ne(!1), [n, o] = ne({
|
|
558
558
|
current: 1,
|
|
559
559
|
pageSize: T,
|
|
560
560
|
total: 0
|
|
561
|
-
}), [a,
|
|
562
|
-
|
|
561
|
+
}), [a, p] = ne({}), [y, g] = ne({}), [b] = _e.useForm(), V = Q(n);
|
|
562
|
+
V.current = n;
|
|
563
563
|
const k = Q(w);
|
|
564
564
|
k.current = w;
|
|
565
|
-
const P = Q(!1), H = Ye(() => t.map((
|
|
566
|
-
const { sortable: c, render:
|
|
565
|
+
const P = Q(!1), H = Ye(() => t.map((l) => {
|
|
566
|
+
const { sortable: c, render: v, ...L } = l;
|
|
567
567
|
return {
|
|
568
568
|
...L,
|
|
569
569
|
sorter: c ? !0 : void 0,
|
|
570
|
-
render:
|
|
570
|
+
render: v || ((N) => N)
|
|
571
571
|
};
|
|
572
|
-
}), [t]), F = ae(async (
|
|
573
|
-
if (
|
|
572
|
+
}), [t]), F = ae(async (l = {}) => {
|
|
573
|
+
if (x) {
|
|
574
574
|
r(!0);
|
|
575
575
|
try {
|
|
576
576
|
const c = {
|
|
577
|
-
page:
|
|
578
|
-
pageSize:
|
|
579
|
-
sortField:
|
|
580
|
-
sortOrder:
|
|
577
|
+
page: V.current.current,
|
|
578
|
+
pageSize: V.current.pageSize,
|
|
579
|
+
sortField: y.field,
|
|
580
|
+
sortOrder: y.order,
|
|
581
581
|
searchParams: { ...a, ...k.current },
|
|
582
|
-
...
|
|
583
|
-
},
|
|
584
|
-
|
|
582
|
+
...l
|
|
583
|
+
}, v = await x(c);
|
|
584
|
+
v.success && (f(v.data), o((L) => ({
|
|
585
585
|
...L,
|
|
586
|
-
total:
|
|
586
|
+
total: v.total,
|
|
587
587
|
current: c.page || L.current
|
|
588
588
|
})));
|
|
589
589
|
} catch (c) {
|
|
@@ -592,54 +592,54 @@ const { Option: qt } = Ge, St = ({
|
|
|
592
592
|
r(!1);
|
|
593
593
|
}
|
|
594
594
|
}
|
|
595
|
-
}, [
|
|
596
|
-
|
|
595
|
+
}, [x, y, a]), U = ae((l) => {
|
|
596
|
+
p(l), o((c) => ({ ...c, current: 1 }));
|
|
597
597
|
}, []), R = ae(() => {
|
|
598
|
-
|
|
599
|
-
}, [
|
|
598
|
+
b.resetFields(), p({}), o((l) => ({ ...l, current: 1 }));
|
|
599
|
+
}, [b]), ee = ae(() => {
|
|
600
600
|
F();
|
|
601
|
-
}, [F]), re = ae((
|
|
601
|
+
}, [F]), re = ae((l, c, v) => {
|
|
602
602
|
const L = {
|
|
603
|
-
current:
|
|
604
|
-
pageSize:
|
|
605
|
-
total:
|
|
606
|
-
},
|
|
607
|
-
field:
|
|
608
|
-
order:
|
|
603
|
+
current: l.current || 1,
|
|
604
|
+
pageSize: l.pageSize || T,
|
|
605
|
+
total: l.total || 0
|
|
606
|
+
}, N = {
|
|
607
|
+
field: v?.field,
|
|
608
|
+
order: v?.order
|
|
609
609
|
};
|
|
610
|
-
o(L),
|
|
610
|
+
o(L), g(N);
|
|
611
611
|
}, [T]);
|
|
612
612
|
return de(() => {
|
|
613
|
-
const
|
|
614
|
-
($ && !P.current ||
|
|
613
|
+
const l = Object.keys(w).length > 0;
|
|
614
|
+
($ && !P.current || l) && (F(), P.current = !0);
|
|
615
615
|
}, [$, w, F]), /* @__PURE__ */ Z("div", { children: [
|
|
616
|
-
|
|
617
|
-
|
|
616
|
+
i && d.length > 0 && /* @__PURE__ */ E(Oe, { size: "small", style: { marginBottom: 16 }, children: /* @__PURE__ */ Z(
|
|
617
|
+
_e,
|
|
618
618
|
{
|
|
619
|
-
form:
|
|
619
|
+
form: b,
|
|
620
620
|
layout: "inline",
|
|
621
621
|
onFinish: U,
|
|
622
|
-
initialValues:
|
|
622
|
+
initialValues: d.reduce((l, c) => (c.defaultValue !== void 0 && (l[c.key] = c.defaultValue), l), {}),
|
|
623
623
|
children: [
|
|
624
|
-
|
|
624
|
+
d.map((l) => /* @__PURE__ */ E(_e.Item, { name: l.key, label: l.label, children: l.type === "input" ? /* @__PURE__ */ E(
|
|
625
625
|
Ke,
|
|
626
626
|
{
|
|
627
|
-
placeholder:
|
|
627
|
+
placeholder: l.placeholder || `请输入${l.label}`,
|
|
628
628
|
style: { width: 200 }
|
|
629
629
|
}
|
|
630
630
|
) : /* @__PURE__ */ E(
|
|
631
631
|
Ge,
|
|
632
632
|
{
|
|
633
|
-
placeholder:
|
|
633
|
+
placeholder: l.placeholder || `请选择${l.label}`,
|
|
634
634
|
style: { width: 200 },
|
|
635
635
|
allowClear: !0,
|
|
636
|
-
children:
|
|
636
|
+
children: l.options?.map((c) => /* @__PURE__ */ E(qt, { value: c.value, children: c.label }, c.value))
|
|
637
637
|
}
|
|
638
|
-
) },
|
|
639
|
-
/* @__PURE__ */ E(
|
|
638
|
+
) }, l.key)),
|
|
639
|
+
/* @__PURE__ */ E(_e.Item, { children: /* @__PURE__ */ Z(at, { children: [
|
|
640
640
|
/* @__PURE__ */ E($e, { type: "primary", htmlType: "submit", icon: /* @__PURE__ */ E(pt, {}), children: "查询" }),
|
|
641
641
|
/* @__PURE__ */ E($e, { onClick: R, children: "重置" }),
|
|
642
|
-
|
|
642
|
+
u && /* @__PURE__ */ E($e, { icon: /* @__PURE__ */ E(ft, {}), onClick: ee, children: "刷新" })
|
|
643
643
|
] }) })
|
|
644
644
|
]
|
|
645
645
|
}
|
|
@@ -655,8 +655,8 @@ const { Option: qt } = Ge, St = ({
|
|
|
655
655
|
...n,
|
|
656
656
|
showSizeChanger: !0,
|
|
657
657
|
showQuickJumper: !0,
|
|
658
|
-
showTotal: (
|
|
659
|
-
pageSizeOptions:
|
|
658
|
+
showTotal: (l, c) => `第 ${c[0]}-${c[1]} 条/共 ${l} 条`,
|
|
659
|
+
pageSizeOptions: I
|
|
660
660
|
},
|
|
661
661
|
onChange: re,
|
|
662
662
|
scroll: { x: "max-content", y: "50vh" }
|
|
@@ -664,7 +664,7 @@ const { Option: qt } = Ge, St = ({
|
|
|
664
664
|
)
|
|
665
665
|
] });
|
|
666
666
|
};
|
|
667
|
-
|
|
667
|
+
Nt.__docgenInfo = {
|
|
668
668
|
displayName: "AdvancedTable",
|
|
669
669
|
description: "高阶表格组件,支持异步请求、搜索、排序等功能",
|
|
670
670
|
props: {
|
|
@@ -731,22 +731,22 @@ St.__docgenInfo = {
|
|
|
731
731
|
}
|
|
732
732
|
}
|
|
733
733
|
};
|
|
734
|
-
function Be(t,
|
|
734
|
+
function Be(t, x, d) {
|
|
735
735
|
if (!t.current) return;
|
|
736
|
-
const
|
|
737
|
-
for (const
|
|
738
|
-
|
|
739
|
-
type:
|
|
740
|
-
key:
|
|
741
|
-
exclusionGroup:
|
|
736
|
+
const i = /* @__PURE__ */ new Set(), u = {};
|
|
737
|
+
for (const f of x)
|
|
738
|
+
f.exclusionGroup && f.exclusionGroup !== "separator" && (i.add(f.exclusionGroup), u[f.exclusionGroup] || (u[f.exclusionGroup] = []), u[f.exclusionGroup].push({
|
|
739
|
+
type: f.type,
|
|
740
|
+
key: f.key,
|
|
741
|
+
exclusionGroup: f.exclusionGroup
|
|
742
742
|
}));
|
|
743
743
|
const T = {};
|
|
744
|
-
for (const
|
|
745
|
-
T[
|
|
746
|
-
for (const s of f
|
|
744
|
+
for (const f of i) {
|
|
745
|
+
T[f] = !1;
|
|
746
|
+
for (const s of u[f])
|
|
747
747
|
if (s.type === "upload" && s.key) {
|
|
748
|
-
if (
|
|
749
|
-
T[
|
|
748
|
+
if (d[s.key] !== null && d[s.key] !== void 0) {
|
|
749
|
+
T[f] = !0;
|
|
750
750
|
break;
|
|
751
751
|
}
|
|
752
752
|
} else if (s.type === "variable" && s.key) {
|
|
@@ -754,27 +754,27 @@ function Be(t, b, p) {
|
|
|
754
754
|
`[data-type="variable"][data-key="${s.key}"]`
|
|
755
755
|
);
|
|
756
756
|
if (r && r.innerText.replace(/[\u200B\n]/g, "").trim().length > 0) {
|
|
757
|
-
T[
|
|
757
|
+
T[f] = !0;
|
|
758
758
|
break;
|
|
759
759
|
}
|
|
760
760
|
}
|
|
761
761
|
}
|
|
762
|
-
const
|
|
763
|
-
(
|
|
762
|
+
const I = x.some((f) => f.exclusionGroup === "separator"), w = Object.keys(T).filter(
|
|
763
|
+
(f) => T[f]
|
|
764
764
|
).length > 0;
|
|
765
765
|
let e = null;
|
|
766
|
-
if (w &&
|
|
767
|
-
for (const
|
|
768
|
-
if (
|
|
769
|
-
e =
|
|
766
|
+
if (w && I) {
|
|
767
|
+
for (const f of x)
|
|
768
|
+
if (f.exclusionGroup && f.exclusionGroup !== "separator" && T[f.exclusionGroup]) {
|
|
769
|
+
e = f.exclusionGroup;
|
|
770
770
|
break;
|
|
771
771
|
}
|
|
772
772
|
}
|
|
773
|
-
for (const
|
|
773
|
+
for (const f of i) {
|
|
774
774
|
const s = t.current.querySelectorAll(
|
|
775
|
-
`[data-group="${
|
|
775
|
+
`[data-group="${f}"]`
|
|
776
776
|
);
|
|
777
|
-
|
|
777
|
+
I && w && e ? f === e ? s.forEach((r) => {
|
|
778
778
|
r.classList.contains("required-upload-group") ? r.style.setProperty("display", "inline-flex", "important") : (r.classList.contains("exclusion-wrapper"), r.style.setProperty("display", "inline-block", "important"));
|
|
779
779
|
}) : s.forEach((r) => {
|
|
780
780
|
r.style.display = "none", r.style.setProperty("display", "none", "important");
|
|
@@ -784,89 +784,82 @@ function Be(t, b, p) {
|
|
|
784
784
|
}
|
|
785
785
|
t.current.querySelectorAll(
|
|
786
786
|
'[data-group="separator"]'
|
|
787
|
-
).forEach((
|
|
788
|
-
|
|
787
|
+
).forEach((f) => {
|
|
788
|
+
f.style.display = w ? "none" : "inline";
|
|
789
789
|
});
|
|
790
790
|
}
|
|
791
|
-
function Pe(t,
|
|
791
|
+
function Pe(t, x, d, i) {
|
|
792
792
|
if (!t.current) {
|
|
793
|
-
|
|
793
|
+
i(!1);
|
|
794
794
|
return;
|
|
795
795
|
}
|
|
796
|
-
const
|
|
797
|
-
for (let s = 0; s <
|
|
798
|
-
const r =
|
|
796
|
+
const u = [];
|
|
797
|
+
for (let s = 0; s < x.length; s++) {
|
|
798
|
+
const r = x[s];
|
|
799
799
|
if ((r.type === "variable" || r.type === "upload" || r.type === "multi-variable" || r.type === "select" || r.type === "textarea" || r.type === "richtext" || r.type === "datepicker") && r.required && r.key) {
|
|
800
|
-
|
|
800
|
+
u.push({
|
|
801
801
|
exclusionGroup: r.exclusionGroup || "",
|
|
802
802
|
key: r.key,
|
|
803
803
|
type: r.type === "multi-variable" ? "variable" : r.type,
|
|
804
804
|
isMultiVariable: r.type === "multi-variable",
|
|
805
|
-
minCount: r.type === "multi-variable" ? r.minCount : void 0
|
|
805
|
+
minCount: r.type === "multi-variable" ? r.minCount : void 0,
|
|
806
|
+
__index: s
|
|
806
807
|
});
|
|
807
808
|
continue;
|
|
808
809
|
}
|
|
809
810
|
if (r.type === "text" && r.className?.includes("rte-text-required"))
|
|
810
811
|
if (r.exclusionGroup)
|
|
811
|
-
for (let n = s + 1; n <
|
|
812
|
-
const o =
|
|
812
|
+
for (let n = s + 1; n < x.length; n++) {
|
|
813
|
+
const o = x[n];
|
|
813
814
|
if (o.exclusionGroup === r.exclusionGroup && (o.type === "variable" || o.type === "upload" || o.type === "select" || o.type === "textarea" || o.type === "richtext" || o.type === "datepicker") && o.key) {
|
|
814
|
-
|
|
815
|
+
u.push({
|
|
815
816
|
exclusionGroup: r.exclusionGroup,
|
|
816
817
|
key: o.key,
|
|
817
|
-
type: o.type
|
|
818
|
+
type: o.type,
|
|
819
|
+
__index: n
|
|
818
820
|
});
|
|
819
821
|
break;
|
|
820
822
|
}
|
|
821
823
|
}
|
|
822
824
|
else
|
|
823
|
-
for (let n = s + 1; n <
|
|
824
|
-
const o =
|
|
825
|
+
for (let n = s + 1; n < x.length; n++) {
|
|
826
|
+
const o = x[n];
|
|
825
827
|
if ((o.type === "variable" || o.type === "upload" || o.type === "select" || o.type === "textarea" || o.type === "richtext" || o.type === "datepicker") && o.key) {
|
|
826
|
-
|
|
828
|
+
u.push({
|
|
827
829
|
exclusionGroup: o.exclusionGroup || "",
|
|
828
830
|
key: o.key,
|
|
829
|
-
type: o.type
|
|
831
|
+
type: o.type,
|
|
832
|
+
__index: n
|
|
830
833
|
});
|
|
831
834
|
break;
|
|
832
835
|
}
|
|
833
836
|
}
|
|
834
837
|
}
|
|
835
|
-
const T =
|
|
836
|
-
if (T &&
|
|
838
|
+
const T = x.some((s) => s.exclusionGroup === "separator"), I = [];
|
|
839
|
+
if (T && u.length > 1) {
|
|
837
840
|
const s = [];
|
|
838
|
-
|
|
841
|
+
x.forEach((r, n) => {
|
|
839
842
|
r.exclusionGroup === "separator" && s.push(n);
|
|
840
843
|
});
|
|
841
844
|
for (const r of s) {
|
|
842
|
-
const
|
|
843
|
-
|
|
844
|
-
(d) => (d.type === "variable" || d.type === "upload" || d.type === "select" || d.type === "textarea" || d.type === "richtext" || d.type === "datepicker") && d.key === a.key
|
|
845
|
-
);
|
|
846
|
-
return u >= 0 && u < r;
|
|
847
|
-
}), o = f.filter((a) => {
|
|
848
|
-
const u = b.findIndex(
|
|
849
|
-
(d) => (d.type === "variable" || d.type === "upload" || d.type === "select" || d.type === "textarea" || d.type === "richtext" || d.type === "datepicker") && d.key === a.key
|
|
850
|
-
);
|
|
851
|
-
return u >= 0 && u > r;
|
|
852
|
-
});
|
|
853
|
-
n.length > 0 && o.length > 0 && M.push([...n, ...o]);
|
|
845
|
+
const o = u.filter((y) => typeof y.__index == "number" && y.__index < r).sort((y, g) => (g.__index ?? 0) - (y.__index ?? 0))[0], p = u.filter((y) => typeof y.__index == "number" && y.__index > r).sort((y, g) => (y.__index ?? 0) - (g.__index ?? 0))[0];
|
|
846
|
+
o && p && I.push([o, p]);
|
|
854
847
|
}
|
|
855
848
|
}
|
|
856
|
-
if (
|
|
857
|
-
if (
|
|
849
|
+
if (u.length === 0) {
|
|
850
|
+
if (x.length === 0) {
|
|
858
851
|
if (!t.current) {
|
|
859
|
-
|
|
852
|
+
i(!1);
|
|
860
853
|
return;
|
|
861
854
|
}
|
|
862
855
|
const s = t.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "";
|
|
863
|
-
|
|
856
|
+
i(s.length > 0);
|
|
864
857
|
return;
|
|
865
858
|
}
|
|
866
|
-
|
|
859
|
+
i(!0);
|
|
867
860
|
return;
|
|
868
861
|
}
|
|
869
|
-
const $ =
|
|
862
|
+
const $ = u.filter((s) => {
|
|
870
863
|
if (!t.current) return !1;
|
|
871
864
|
if (s.exclusionGroup) {
|
|
872
865
|
const r = t.current.querySelectorAll(
|
|
@@ -937,11 +930,11 @@ function Pe(t, b, p, l) {
|
|
|
937
930
|
return !1;
|
|
938
931
|
});
|
|
939
932
|
if ($.length === 0) {
|
|
940
|
-
|
|
933
|
+
i(!0);
|
|
941
934
|
return;
|
|
942
935
|
}
|
|
943
936
|
const w = /* @__PURE__ */ new Set();
|
|
944
|
-
|
|
937
|
+
I.forEach((s) => {
|
|
945
938
|
s.forEach((r) => {
|
|
946
939
|
r.key && w.add(r.key);
|
|
947
940
|
});
|
|
@@ -949,8 +942,8 @@ function Pe(t, b, p, l) {
|
|
|
949
942
|
const e = $.filter(
|
|
950
943
|
(s) => !s.key || !w.has(s.key)
|
|
951
944
|
);
|
|
952
|
-
let q = (
|
|
953
|
-
for (const s of
|
|
945
|
+
let q = (I.length === 0, !0);
|
|
946
|
+
for (const s of I) {
|
|
954
947
|
const r = s.filter((o) => {
|
|
955
948
|
if (!t.current) return !1;
|
|
956
949
|
if (o.exclusionGroup) {
|
|
@@ -967,7 +960,7 @@ function Pe(t, b, p, l) {
|
|
|
967
960
|
let n = !1;
|
|
968
961
|
for (const o of r)
|
|
969
962
|
if (o.type === "upload" && o.key) {
|
|
970
|
-
if (
|
|
963
|
+
if (d[o.key] !== null && d[o.key] !== void 0) {
|
|
971
964
|
n = !0;
|
|
972
965
|
break;
|
|
973
966
|
}
|
|
@@ -976,11 +969,14 @@ function Pe(t, b, p, l) {
|
|
|
976
969
|
const a = t.current.querySelectorAll(
|
|
977
970
|
`[data-type="variable"][data-multi-key="${o.key}"]`
|
|
978
971
|
);
|
|
979
|
-
let
|
|
980
|
-
for (const
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
972
|
+
let p = 0;
|
|
973
|
+
for (const g of Array.from(a)) {
|
|
974
|
+
if (g.classList.contains("show-placeholder"))
|
|
975
|
+
continue;
|
|
976
|
+
g.innerText.replace(/[\u200B\n]/g, "").trim().length > 0 && (p += 1);
|
|
977
|
+
}
|
|
978
|
+
const y = o.minCount && o.minCount > 0 ? o.minCount : 1;
|
|
979
|
+
if (p >= y) {
|
|
984
980
|
n = !0;
|
|
985
981
|
break;
|
|
986
982
|
}
|
|
@@ -988,9 +984,13 @@ function Pe(t, b, p, l) {
|
|
|
988
984
|
const a = t.current.querySelector(
|
|
989
985
|
`[data-type="variable"][data-key="${o.key}"]`
|
|
990
986
|
);
|
|
991
|
-
if (a
|
|
992
|
-
|
|
993
|
-
|
|
987
|
+
if (a) {
|
|
988
|
+
if (a.classList.contains("show-placeholder"))
|
|
989
|
+
continue;
|
|
990
|
+
if (a.innerText.replace(/[\u200B\n]/g, "").trim().length > 0) {
|
|
991
|
+
n = !0;
|
|
992
|
+
break;
|
|
993
|
+
}
|
|
994
994
|
}
|
|
995
995
|
}
|
|
996
996
|
else if (o.type === "select" && o.key) {
|
|
@@ -1031,11 +1031,11 @@ function Pe(t, b, p, l) {
|
|
|
1031
1031
|
break;
|
|
1032
1032
|
}
|
|
1033
1033
|
}
|
|
1034
|
-
let
|
|
1034
|
+
let f = !0;
|
|
1035
1035
|
for (const s of e)
|
|
1036
1036
|
if (s.type === "upload" && s.key) {
|
|
1037
|
-
if (
|
|
1038
|
-
|
|
1037
|
+
if (d[s.key] === null || d[s.key] === void 0) {
|
|
1038
|
+
f = !1;
|
|
1039
1039
|
break;
|
|
1040
1040
|
}
|
|
1041
1041
|
} else if (s.type === "variable" && s.key)
|
|
@@ -1044,11 +1044,14 @@ function Pe(t, b, p, l) {
|
|
|
1044
1044
|
`[data-type="variable"][data-multi-key="${s.key}"]`
|
|
1045
1045
|
);
|
|
1046
1046
|
let n = 0;
|
|
1047
|
-
for (const a of Array.from(r))
|
|
1047
|
+
for (const a of Array.from(r)) {
|
|
1048
|
+
if (a.classList.contains("show-placeholder"))
|
|
1049
|
+
continue;
|
|
1048
1050
|
a.innerText.replace(/[\u200B\n]/g, "").trim().length > 0 && (n += 1);
|
|
1051
|
+
}
|
|
1049
1052
|
const o = s.minCount && s.minCount > 0 ? s.minCount : 1;
|
|
1050
1053
|
if (n < o) {
|
|
1051
|
-
|
|
1054
|
+
f = !1;
|
|
1052
1055
|
break;
|
|
1053
1056
|
}
|
|
1054
1057
|
} else {
|
|
@@ -1056,11 +1059,15 @@ function Pe(t, b, p, l) {
|
|
|
1056
1059
|
`[data-type="variable"][data-key="${s.key}"]`
|
|
1057
1060
|
);
|
|
1058
1061
|
if (!r) {
|
|
1059
|
-
|
|
1062
|
+
f = !1;
|
|
1063
|
+
break;
|
|
1064
|
+
}
|
|
1065
|
+
if (r.classList.contains("show-placeholder")) {
|
|
1066
|
+
f = !1;
|
|
1060
1067
|
break;
|
|
1061
1068
|
}
|
|
1062
1069
|
if (r.innerText.replace(/[\u200B\n]/g, "").trim().length === 0) {
|
|
1063
|
-
|
|
1070
|
+
f = !1;
|
|
1064
1071
|
break;
|
|
1065
1072
|
}
|
|
1066
1073
|
}
|
|
@@ -1069,7 +1076,7 @@ function Pe(t, b, p, l) {
|
|
|
1069
1076
|
`[data-type="select"][data-key="${s.key}"]`
|
|
1070
1077
|
);
|
|
1071
1078
|
if (!r || (r.value || "").trim().length === 0) {
|
|
1072
|
-
|
|
1079
|
+
f = !1;
|
|
1073
1080
|
break;
|
|
1074
1081
|
}
|
|
1075
1082
|
} else if (s.type === "textarea" && s.key) {
|
|
@@ -1077,7 +1084,7 @@ function Pe(t, b, p, l) {
|
|
|
1077
1084
|
`[data-type="textarea"][data-key="${s.key}"]`
|
|
1078
1085
|
);
|
|
1079
1086
|
if (!r || (r.value || "").trim().length === 0) {
|
|
1080
|
-
|
|
1087
|
+
f = !1;
|
|
1081
1088
|
break;
|
|
1082
1089
|
}
|
|
1083
1090
|
} else if (s.type === "richtext" && s.key) {
|
|
@@ -1085,7 +1092,7 @@ function Pe(t, b, p, l) {
|
|
|
1085
1092
|
`[data-type="richtext"][data-key="${s.key}"]`
|
|
1086
1093
|
);
|
|
1087
1094
|
if (!r || (r.textContent || "").replace(/[\u200B]/g, "").trim().length === 0) {
|
|
1088
|
-
|
|
1095
|
+
f = !1;
|
|
1089
1096
|
break;
|
|
1090
1097
|
}
|
|
1091
1098
|
} else if (s.type === "datepicker" && s.key) {
|
|
@@ -1093,95 +1100,95 @@ function Pe(t, b, p, l) {
|
|
|
1093
1100
|
`[data-type="datepicker"][data-key="${s.key}"]`
|
|
1094
1101
|
);
|
|
1095
1102
|
if (!r || (r.getAttribute("data-value") || "").trim().length === 0) {
|
|
1096
|
-
|
|
1103
|
+
f = !1;
|
|
1097
1104
|
break;
|
|
1098
1105
|
}
|
|
1099
1106
|
}
|
|
1100
|
-
|
|
1107
|
+
i(q && f);
|
|
1101
1108
|
}
|
|
1102
|
-
function
|
|
1109
|
+
function Me(t, x) {
|
|
1103
1110
|
if (!t.current) return;
|
|
1104
|
-
t.current.querySelectorAll('[data-type="variable"]').forEach((
|
|
1105
|
-
const
|
|
1106
|
-
|
|
1111
|
+
t.current.querySelectorAll('[data-type="variable"]').forEach((i) => {
|
|
1112
|
+
const u = i.innerText.replace(/\n/g, "");
|
|
1113
|
+
u.replace(/\u200B/g, "") ? i.classList.remove("show-placeholder") : (u !== "" && (i.innerText = ""), i.classList.add("show-placeholder"));
|
|
1107
1114
|
});
|
|
1108
1115
|
}
|
|
1109
|
-
function
|
|
1116
|
+
function St(t, x, d, i, u, T = {}, I) {
|
|
1110
1117
|
if (!t.current) return;
|
|
1111
1118
|
let $ = "", w = 0;
|
|
1112
|
-
for (; w <
|
|
1113
|
-
const e =
|
|
1119
|
+
for (; w < x.length; ) {
|
|
1120
|
+
const e = x[w], q = w + 1 < x.length ? x[w + 1] : null;
|
|
1114
1121
|
if (e.type === "text" && (e.text?.includes("icon-bitian") || e.className === "rte-text-required") && q) {
|
|
1115
|
-
const a = q.type === "upload" && q.exclusionGroup === "fileInput" && e.exclusionGroup === "fileInput" && e.exclusionGroup === q.exclusionGroup,
|
|
1122
|
+
const a = q.type === "upload" && q.exclusionGroup === "fileInput" && e.exclusionGroup === "fileInput" && e.exclusionGroup === q.exclusionGroup, p = q.type === "variable" && q.exclusionGroup === "textInput" && e.exclusionGroup === "textInput" && e.exclusionGroup === q.exclusionGroup;
|
|
1116
1123
|
if (a) {
|
|
1117
|
-
const
|
|
1118
|
-
let
|
|
1119
|
-
e.className ?
|
|
1120
|
-
const k = q, P =
|
|
1121
|
-
let
|
|
1122
|
-
P && H && (H.type?.startsWith("image/") ?
|
|
1123
|
-
const c = `<span contenteditable="false" data-type="upload" data-key="${k.key}" class="upload-chip"><span class="upload-inner-wrapper ${ee}"><span class="upload-icon">${
|
|
1124
|
-
$ +=
|
|
1124
|
+
const g = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group">`, b = "</span>";
|
|
1125
|
+
let V = "";
|
|
1126
|
+
e.className ? V = `<span class="${e.className}">${e.text ?? ""}</span>` : V = e.text ?? "";
|
|
1127
|
+
const k = q, P = d[k.key] !== null && d[k.key] !== void 0, H = P ? d[k.key] : null, F = P ? d[k.key]?.name : k.text, U = P ? "" : "hidden", R = k.tooltip && !P ? "" : "hidden", ee = P ? "has-file" : "", re = P && F ? ` data-file-name="${F.replace(/"/g, """)}"` : "";
|
|
1128
|
+
let l = "";
|
|
1129
|
+
P && H && (H.type?.startsWith("image/") ? l = `<img class="upload-icon-img upload-icon-preview" src="${URL.createObjectURL(H)}" alt="preview" />` : l = "<i class='iconfont icon-exlwenjian'></i>");
|
|
1130
|
+
const c = `<span contenteditable="false" data-type="upload" data-key="${k.key}" class="upload-chip"><span class="upload-inner-wrapper ${ee}"><span class="upload-icon">${l}</span><span class="upload-label"${re}>${F || k.text}</span>${k.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi upload-info-icon ${R}" data-upload-key="${k.key}" data-tooltip="${k.tooltip}" title="提示"></i>` : ""}<span class="file-remove-btn ${U}" title="移除文件">×</span></span></span>`;
|
|
1131
|
+
$ += g + V + c + b, w += 2;
|
|
1125
1132
|
continue;
|
|
1126
1133
|
}
|
|
1127
|
-
if (
|
|
1128
|
-
const
|
|
1129
|
-
let
|
|
1130
|
-
e.className ?
|
|
1131
|
-
const k = q, H = (k.key ?
|
|
1132
|
-
$ +=
|
|
1134
|
+
if (p) {
|
|
1135
|
+
const g = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group">`, b = "</span>";
|
|
1136
|
+
let V = "";
|
|
1137
|
+
e.className ? V = `<span class="${e.className}">${e.text ?? ""}</span>` : V = e.text ?? "";
|
|
1138
|
+
const k = q, H = (k.key ? u[k.key] : void 0) || k.text || "", F = !H, U = F ? "" : H, R = F ? "show-placeholder" : "", ee = k.exclusionGroup ? ` data-group="${k.exclusionGroup}"` : "", re = k.tooltip ? ` data-tooltip="${k.tooltip.replace(/"/g, """)}" data-variable-key="${k.key || ""}"` : "", l = k.tooltip && F ? "" : "hidden", c = `<span contenteditable="true" data-type="variable" data-key="${k.key}" data-placeholder="${k.placeholder || ""}"${ee}${re} class="variable-chip ${R}">${U}${k.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${l}" data-variable-key="${k.key}" data-tooltip="${k.tooltip.replace(/"/g, """)}" title="提示"></i>` : ""}</span>`;
|
|
1139
|
+
$ += g + V + c + b, w += 2;
|
|
1133
1140
|
continue;
|
|
1134
1141
|
}
|
|
1135
1142
|
}
|
|
1136
1143
|
const s = e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : "", r = e.exclusionGroup ? `<span ${s} class="exclusion-wrapper">` : "", n = e.exclusionGroup ? "</span>" : "";
|
|
1137
1144
|
let o = "";
|
|
1138
1145
|
if (e.type === "tag") {
|
|
1139
|
-
const
|
|
1140
|
-
o = `<span contenteditable="false" class="tag-node group"${
|
|
1146
|
+
const p = i || I === "hideTagClose" ? "" : '<span class="tag-close-btn" title="Clear (ESC)"><svg width="10" height="10" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6L6 18M6 6l12 12"/></svg></span>', y = i ? ' data-locked="true"' : "", g = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, """)}" data-tag-key="${e.key || ""}"` : "";
|
|
1147
|
+
o = `<span contenteditable="false" class="tag-node group"${y}${g}><span class="tag-label">${e.text}</span>${p}</span>`;
|
|
1141
1148
|
} else if (e.type === "text") {
|
|
1142
|
-
const a =
|
|
1143
|
-
e.className ? o = `<span class="${e.className}"${a}>${
|
|
1149
|
+
const a = i ? ' data-locked="true" contenteditable="false"' : ' contenteditable="false"', y = (e.text ?? "").replace(/\n/g, "<br/>");
|
|
1150
|
+
e.className ? o = `<span class="${e.className}"${a}>${y}</span>` : o = i ? `<span${a}>${y}</span>` : `<span contenteditable="false">${y}</span>`;
|
|
1144
1151
|
} else if (e.type === "variable" && e.key) {
|
|
1145
|
-
const
|
|
1152
|
+
const p = u[e.key] || e.text || "", y = !p, g = y ? "" : p, b = y ? "show-placeholder" : "", V = e.exclusionGroup ? ` data-group="${e.exclusionGroup}"` : "", k = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, """)}" data-variable-key="${e.key || ""}"` : "", P = e.tooltip && y ? "" : "hidden", H = `<span contenteditable="true" data-type="variable" data-key="${e.key}" data-placeholder="${e.placeholder || ""}"${V}${k} class="variable-chip ${b}">${g}${e.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${P}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g, """)}" title="提示"></i>` : ""}</span>`;
|
|
1146
1153
|
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;
|
|
1147
1154
|
} else if (e.type === "upload" && e.key) {
|
|
1148
|
-
const a =
|
|
1155
|
+
const a = d[e.key] !== null && d[e.key] !== void 0, p = a ? d[e.key] : null, y = a ? d[e.key]?.name : e.text, g = a ? "" : "hidden", b = e.tooltip && !a ? "" : "hidden", V = a ? "has-file" : "", k = a && y ? ` data-file-name="${y.replace(/"/g, """)}"` : "";
|
|
1149
1156
|
let P = "";
|
|
1150
|
-
a &&
|
|
1151
|
-
const H = `<span contenteditable="false" data-type="upload" data-key="${e.key}" class="upload-chip"><span class="upload-inner-wrapper ${
|
|
1157
|
+
a && p && (p.type?.startsWith("image/") ? P = `<img class="upload-icon-img upload-icon-preview" src="${URL.createObjectURL(p)}" alt="preview" />` : P = "<i class='iconfont icon-exlwenjian'></i>");
|
|
1158
|
+
const H = `<span contenteditable="false" data-type="upload" data-key="${e.key}" class="upload-chip"><span class="upload-inner-wrapper ${V}"><span class="upload-icon">${P}</span><span class="upload-label"${k}>${y || e.text}</span>${e.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi upload-info-icon ${b}" data-upload-key="${e.key}" data-tooltip="${e.tooltip}" title="提示"></i>` : ""}<span class="file-remove-btn ${g}" title="移除文件">×</span></span></span>`;
|
|
1152
1159
|
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;
|
|
1153
1160
|
} else if (e.type === "select" && e.key) {
|
|
1154
|
-
const a =
|
|
1155
|
-
const
|
|
1156
|
-
return `<option value="${
|
|
1157
|
-
}).join(""),
|
|
1158
|
-
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>${
|
|
1161
|
+
const a = u[e.key] || e.defaultValue || "", p = (e.options || []).map((b) => {
|
|
1162
|
+
const V = a === b.value ? "selected" : "";
|
|
1163
|
+
return `<option value="${b.value}" ${V}>${b.label}</option>`;
|
|
1164
|
+
}).join(""), y = e.placeholder ? `<option value="" ${a ? "" : "selected"} disabled hidden>${e.placeholder}</option>` : "", g = `<select data-type="select" data-key="${e.key}" class="rte-select">${y}${p}</select>`;
|
|
1165
|
+
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;
|
|
1159
1166
|
} else if (e.type === "textarea" && e.key) {
|
|
1160
|
-
const a =
|
|
1167
|
+
const a = u[e.key] || "", p = e.maxHeight || 252, y = e.expandable !== !1, g = e.placeholder ? ` placeholder="${e.placeholder}"` : "", b = `<textarea data-type="textarea" data-key="${e.key}" class="rte-textarea" data-max-height="${p}" style="max-height:${p}px;"${g}>${a}</textarea>`, V = y ? `<button type="button" class="rte-textarea-toggle" data-key="${e.key}" data-expanded="false">展开</button>` : "", k = `<div class="rte-textarea-wrapper" data-key="${e.key}">${b}${V}</div>`;
|
|
1161
1168
|
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>${k}</span>` : o = k;
|
|
1162
1169
|
} else if (e.type === "richtext" && e.key) {
|
|
1163
|
-
const a =
|
|
1170
|
+
const a = u[e.key] || e.text || "", p = e.minHeight || 140, y = e.placeholder ? ` data-placeholder="${e.placeholder}"` : "", g = e.expandable !== !1, b = a, V = `<div contenteditable="true" data-type="richtext" data-key="${e.key}" class="rte-richtext"${y} style="min-height:${p}px;">${b}</div>`, k = g ? `<button type="button" class="rte-richtext-toggle" data-key="${e.key}" data-expanded="false">展开</button>` : "", P = `<div class="rte-richtext-wrapper" data-key="${e.key}">${V}${k}</div>`, H = `<div class="rte-richtext-container" data-key="${e.key}">${P}</div>`;
|
|
1164
1171
|
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;
|
|
1165
1172
|
} else if (e.type === "datepicker" && e.key) {
|
|
1166
|
-
const a =
|
|
1167
|
-
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>${
|
|
1173
|
+
const a = u[e.key] || "", p = e.placeholder ? ` data-placeholder="${e.placeholder}"` : "", y = e.limitRange ? ` data-limit-range="${e.limitRange}"` : "", g = e.disableFuture ? ' data-disable-future="true"' : "", b = `<div data-type="datepicker" data-key="${e.key}" data-value="${a}" class="rte-datepicker-host"${p}${y}${g}></div>`;
|
|
1174
|
+
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>${b}</span>` : o = b;
|
|
1168
1175
|
} else if (e.type === "multi-variable" && e.key) {
|
|
1169
|
-
const a = e.maxCount || 9,
|
|
1176
|
+
const a = e.maxCount || 9, p = T[e.key] || 1, y = Math.min(p, a);
|
|
1170
1177
|
if (e.required) {
|
|
1171
|
-
const
|
|
1172
|
-
let
|
|
1173
|
-
for (let k = 0; k <
|
|
1174
|
-
const P = `${e.key}_${k}`, H =
|
|
1175
|
-
k === 0 ?
|
|
1178
|
+
const g = `<span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>`, b = e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : "";
|
|
1179
|
+
let V = "";
|
|
1180
|
+
for (let k = 0; k < y; k++) {
|
|
1181
|
+
const P = `${e.key}_${k}`, H = u[P] || "", F = !H, U = F ? "" : H, R = F ? "show-placeholder" : "", ee = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, """)}" data-variable-key="${e.key || ""}"` : "", re = e.tooltip && F ? "" : "hidden", l = `<span contenteditable="true" data-type="variable" data-key="${P}" data-multi-key="${e.key}" data-index="${k}" data-placeholder="${e.placeholder || ""}"${ee} class="variable-chip ${R}">${U}${e.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${re}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g, """)}" title="提示"></i>` : ""}</span>`;
|
|
1182
|
+
k === 0 ? V += `<span ${b} class="exclusion-wrapper required-upload-group required-multi-first">${g}${l}</span>` : V += l;
|
|
1176
1183
|
}
|
|
1177
|
-
o =
|
|
1184
|
+
o = V;
|
|
1178
1185
|
} else {
|
|
1179
|
-
let
|
|
1180
|
-
for (let
|
|
1181
|
-
const
|
|
1182
|
-
|
|
1186
|
+
let g = "";
|
|
1187
|
+
for (let b = 0; b < y; b++) {
|
|
1188
|
+
const V = `${e.key}_${b}`, k = u[V] || "", P = !k, H = P ? "" : k, F = P ? "show-placeholder" : "", U = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, """)}" data-variable-key="${e.key || ""}"` : "", R = e.tooltip && P ? "" : "hidden", ee = `<span contenteditable="true" data-type="variable" data-key="${V}" data-multi-key="${e.key}" data-index="${b}" data-placeholder="${e.placeholder || ""}"${U} class="variable-chip ${F}">${H}${e.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${R}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g, """)}" title="提示"></i>` : ""}</span>`;
|
|
1189
|
+
g += ee;
|
|
1183
1190
|
}
|
|
1184
|
-
o =
|
|
1191
|
+
o = g;
|
|
1185
1192
|
}
|
|
1186
1193
|
}
|
|
1187
1194
|
$ += r + o + n, w++;
|
|
@@ -1189,56 +1196,56 @@ function Nt(t, b, p, l, f, T = {}, M) {
|
|
|
1189
1196
|
t.current && (t.current.innerHTML = $, setTimeout(() => {
|
|
1190
1197
|
if (!t.current) return;
|
|
1191
1198
|
t.current.querySelectorAll('[data-type="variable"]').forEach((q) => {
|
|
1192
|
-
const
|
|
1193
|
-
|
|
1199
|
+
const f = q.innerText.replace(/\n/g, "");
|
|
1200
|
+
f.replace(/\u200B/g, "") ? q.classList.remove("show-placeholder") : (f !== "" && (q.innerText = ""), q.classList.add("show-placeholder"));
|
|
1194
1201
|
});
|
|
1195
1202
|
}, 0));
|
|
1196
1203
|
}
|
|
1197
|
-
function At(t,
|
|
1204
|
+
function At(t, x, d, i, u = {}, T, I, $) {
|
|
1198
1205
|
const w = ae(() => {
|
|
1199
1206
|
if (!t.current) return;
|
|
1200
|
-
if (
|
|
1207
|
+
if (x.length === 0) {
|
|
1201
1208
|
t.current.innerHTML = "";
|
|
1202
1209
|
return;
|
|
1203
1210
|
}
|
|
1204
1211
|
let e = {};
|
|
1205
|
-
const
|
|
1206
|
-
if (
|
|
1212
|
+
const f = t.current.__tempVariableValues;
|
|
1213
|
+
if (f ? (e = f, setTimeout(() => {
|
|
1207
1214
|
if (t.current) {
|
|
1208
1215
|
const s = t.current;
|
|
1209
|
-
s.__tempVariableValues ===
|
|
1210
|
-
}
|
|
1211
|
-
}, 100)) : (t.current.querySelectorAll('[data-type="variable"]').forEach((
|
|
1212
|
-
const
|
|
1213
|
-
if (
|
|
1214
|
-
const
|
|
1215
|
-
|
|
1216
|
-
}
|
|
1217
|
-
}), t.current.querySelectorAll('[data-type="select"]').forEach((
|
|
1218
|
-
const
|
|
1219
|
-
if (
|
|
1220
|
-
const
|
|
1221
|
-
|
|
1222
|
-
}
|
|
1223
|
-
}), t.current.querySelectorAll('[data-type="textarea"]').forEach((
|
|
1224
|
-
const
|
|
1225
|
-
if (
|
|
1226
|
-
const
|
|
1227
|
-
|
|
1228
|
-
}
|
|
1229
|
-
}), t.current.querySelectorAll('[data-type="richtext"]').forEach((
|
|
1230
|
-
const
|
|
1231
|
-
if (
|
|
1232
|
-
const
|
|
1233
|
-
|
|
1234
|
-
}
|
|
1235
|
-
}), t.current.querySelectorAll('[data-type="datepicker"]').forEach((
|
|
1236
|
-
const
|
|
1237
|
-
if (
|
|
1238
|
-
const
|
|
1239
|
-
|
|
1240
|
-
}
|
|
1241
|
-
})),
|
|
1216
|
+
s.__tempVariableValues === f && delete s.__tempVariableValues;
|
|
1217
|
+
}
|
|
1218
|
+
}, 100)) : (t.current.querySelectorAll('[data-type="variable"]').forEach((p) => {
|
|
1219
|
+
const y = p.dataset.key;
|
|
1220
|
+
if (y) {
|
|
1221
|
+
const g = p.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
1222
|
+
g && (e[y] = g);
|
|
1223
|
+
}
|
|
1224
|
+
}), t.current.querySelectorAll('[data-type="select"]').forEach((p) => {
|
|
1225
|
+
const y = p.dataset.key;
|
|
1226
|
+
if (y) {
|
|
1227
|
+
const g = p.value.trim();
|
|
1228
|
+
g && (e[y] = g);
|
|
1229
|
+
}
|
|
1230
|
+
}), t.current.querySelectorAll('[data-type="textarea"]').forEach((p) => {
|
|
1231
|
+
const y = p.dataset.key;
|
|
1232
|
+
if (y) {
|
|
1233
|
+
const g = p.value.replace(/[\u200B]/g, "").trim();
|
|
1234
|
+
g && (e[y] = g);
|
|
1235
|
+
}
|
|
1236
|
+
}), t.current.querySelectorAll('[data-type="richtext"]').forEach((p) => {
|
|
1237
|
+
const y = p.dataset.key;
|
|
1238
|
+
if (y) {
|
|
1239
|
+
const g = (p.textContent || "").replace(/[\u200B]/g, "").trim();
|
|
1240
|
+
g && (e[y] = g);
|
|
1241
|
+
}
|
|
1242
|
+
}), t.current.querySelectorAll('[data-type="datepicker"]').forEach((p) => {
|
|
1243
|
+
const y = p.dataset.key;
|
|
1244
|
+
if (y) {
|
|
1245
|
+
const g = (p.getAttribute("data-value") || "").trim();
|
|
1246
|
+
g && (e[y] = g);
|
|
1247
|
+
}
|
|
1248
|
+
})), St(t, x, d, i, e, u, $), T?.current) {
|
|
1242
1249
|
const { key: s, offset: r } = T.current;
|
|
1243
1250
|
setTimeout(() => {
|
|
1244
1251
|
if (!t.current) return;
|
|
@@ -1252,23 +1259,23 @@ function At(t, b, p, l, f = {}, T, M, $) {
|
|
|
1252
1259
|
NodeFilter.SHOW_TEXT,
|
|
1253
1260
|
null
|
|
1254
1261
|
);
|
|
1255
|
-
let
|
|
1262
|
+
let p = 0, y = null, g = 0;
|
|
1256
1263
|
for (; a.nextNode(); ) {
|
|
1257
|
-
const
|
|
1258
|
-
if (
|
|
1259
|
-
|
|
1264
|
+
const b = a.currentNode, V = b.textContent?.length || 0;
|
|
1265
|
+
if (p + V >= r) {
|
|
1266
|
+
y = b, g = r - p;
|
|
1260
1267
|
break;
|
|
1261
1268
|
}
|
|
1262
|
-
|
|
1269
|
+
p += V;
|
|
1263
1270
|
}
|
|
1264
|
-
if (
|
|
1265
|
-
o.setStart(
|
|
1266
|
-
const
|
|
1267
|
-
|
|
1271
|
+
if (y) {
|
|
1272
|
+
o.setStart(y, Math.min(g, y.textContent?.length || 0)), o.collapse(!0);
|
|
1273
|
+
const b = window.getSelection();
|
|
1274
|
+
b && (b.removeAllRanges(), b.addRange(o), n.focus());
|
|
1268
1275
|
} else {
|
|
1269
1276
|
o.selectNodeContents(n), o.collapse(!1);
|
|
1270
|
-
const
|
|
1271
|
-
|
|
1277
|
+
const b = window.getSelection();
|
|
1278
|
+
b && (b.removeAllRanges(), b.addRange(o), n.focus());
|
|
1272
1279
|
}
|
|
1273
1280
|
} catch {
|
|
1274
1281
|
const o = document.createRange();
|
|
@@ -1280,154 +1287,157 @@ function At(t, b, p, l, f = {}, T, M, $) {
|
|
|
1280
1287
|
}
|
|
1281
1288
|
}, 0);
|
|
1282
1289
|
}
|
|
1283
|
-
}, [
|
|
1290
|
+
}, [x, d, i, t, u, T, I, $]);
|
|
1284
1291
|
de(() => {
|
|
1285
1292
|
w();
|
|
1286
1293
|
}, [w]);
|
|
1287
1294
|
}
|
|
1288
|
-
function Lt(t,
|
|
1295
|
+
function Lt(t, x, d, i) {
|
|
1289
1296
|
de(() => {
|
|
1290
|
-
const
|
|
1291
|
-
if (!
|
|
1297
|
+
const u = t.current;
|
|
1298
|
+
if (!u) return;
|
|
1292
1299
|
const T = ($) => {
|
|
1293
1300
|
const w = $.target?.closest(".upload-info-icon");
|
|
1294
1301
|
if (w && w.classList.contains("upload-info-icon")) {
|
|
1295
1302
|
const q = w.dataset.uploadKey;
|
|
1296
|
-
q &&
|
|
1303
|
+
q && i({ key: q, anchorEl: w, type: "upload" });
|
|
1297
1304
|
return;
|
|
1298
1305
|
}
|
|
1299
1306
|
const e = $.target?.closest('[data-type="upload"]');
|
|
1300
1307
|
if (e) {
|
|
1301
1308
|
const q = e.dataset.key;
|
|
1302
1309
|
if (q) {
|
|
1303
|
-
const
|
|
1304
|
-
|
|
1310
|
+
const f = d[q];
|
|
1311
|
+
f && f.type && f.type.startsWith("image/") && i({ key: q, anchorEl: e, type: "upload-preview" });
|
|
1305
1312
|
}
|
|
1306
1313
|
}
|
|
1307
|
-
},
|
|
1314
|
+
}, I = ($) => {
|
|
1308
1315
|
const w = $.target?.closest(".upload-info-icon"), e = $.relatedTarget;
|
|
1309
1316
|
if (w && w.classList.contains("upload-info-icon")) {
|
|
1310
|
-
!e || !
|
|
1317
|
+
!e || !u.contains(e) ? i(null) : e.closest(".upload-info-icon") || i(null);
|
|
1311
1318
|
return;
|
|
1312
1319
|
}
|
|
1313
1320
|
const q = $.target?.closest('[data-type="upload"]');
|
|
1314
1321
|
if (q) {
|
|
1315
|
-
const
|
|
1316
|
-
if (
|
|
1322
|
+
const f = e;
|
|
1323
|
+
if (f && q.contains(f))
|
|
1317
1324
|
return;
|
|
1318
|
-
|
|
1325
|
+
i(null);
|
|
1319
1326
|
}
|
|
1320
1327
|
};
|
|
1321
|
-
return
|
|
1322
|
-
|
|
1328
|
+
return u.addEventListener("mouseover", T, !0), u.addEventListener("mouseout", I, !0), () => {
|
|
1329
|
+
u.removeEventListener("mouseover", T, !0), u.removeEventListener("mouseout", I, !0);
|
|
1323
1330
|
};
|
|
1324
|
-
}, [
|
|
1331
|
+
}, [x, d, t, i]);
|
|
1325
1332
|
}
|
|
1326
|
-
function
|
|
1333
|
+
function _t(t, x, d, i) {
|
|
1327
1334
|
de(() => {
|
|
1328
1335
|
if (!t.current) return;
|
|
1329
|
-
const
|
|
1330
|
-
if (
|
|
1336
|
+
const u = (w) => {
|
|
1337
|
+
if (i === "hideTagClose")
|
|
1331
1338
|
return;
|
|
1332
|
-
const e = w.currentTarget, q = e.dataset.tooltip,
|
|
1333
|
-
q &&
|
|
1339
|
+
const e = w.currentTarget, q = e.dataset.tooltip, f = e.dataset.tagKey || "";
|
|
1340
|
+
q && d({ key: f, anchorEl: e, type: "tag" });
|
|
1334
1341
|
}, T = () => {
|
|
1335
|
-
|
|
1342
|
+
d(null);
|
|
1336
1343
|
};
|
|
1337
|
-
let
|
|
1344
|
+
let I;
|
|
1338
1345
|
const $ = () => {
|
|
1339
1346
|
if (!t.current) return;
|
|
1340
1347
|
t.current.querySelectorAll(
|
|
1341
1348
|
".tag-node[data-tooltip]"
|
|
1342
1349
|
).forEach((e) => {
|
|
1343
|
-
e.addEventListener("mouseenter",
|
|
1350
|
+
e.addEventListener("mouseenter", u), e.addEventListener("mouseleave", T);
|
|
1344
1351
|
});
|
|
1345
1352
|
};
|
|
1346
|
-
return
|
|
1347
|
-
|
|
1353
|
+
return I = requestAnimationFrame(() => {
|
|
1354
|
+
I = requestAnimationFrame($);
|
|
1348
1355
|
}), () => {
|
|
1349
|
-
cancelAnimationFrame(
|
|
1356
|
+
cancelAnimationFrame(I), t.current && t.current.querySelectorAll(
|
|
1350
1357
|
".tag-node[data-tooltip]"
|
|
1351
1358
|
).forEach((e) => {
|
|
1352
|
-
e.removeEventListener("mouseenter",
|
|
1359
|
+
e.removeEventListener("mouseenter", u), e.removeEventListener("mouseleave", T);
|
|
1353
1360
|
});
|
|
1354
1361
|
};
|
|
1355
|
-
}, [
|
|
1362
|
+
}, [x, t, d, i]);
|
|
1356
1363
|
}
|
|
1357
|
-
function Dt(t,
|
|
1364
|
+
function Dt(t, x, d) {
|
|
1358
1365
|
de(() => {
|
|
1359
|
-
const
|
|
1360
|
-
if (!
|
|
1361
|
-
const
|
|
1362
|
-
const $ =
|
|
1366
|
+
const i = t.current;
|
|
1367
|
+
if (!i) return;
|
|
1368
|
+
const u = (I) => {
|
|
1369
|
+
const $ = I.target?.closest(".variable-info-icon");
|
|
1363
1370
|
if ($ && $.classList.contains("variable-info-icon")) {
|
|
1364
1371
|
const w = $.dataset.variableKey;
|
|
1365
|
-
w &&
|
|
1372
|
+
w && d({ key: w, anchorEl: $, type: "variable" });
|
|
1366
1373
|
}
|
|
1367
|
-
}, T = (
|
|
1368
|
-
const $ =
|
|
1369
|
-
$ && $.classList.contains("variable-info-icon") && (!w || !
|
|
1374
|
+
}, T = (I) => {
|
|
1375
|
+
const $ = I.target?.closest(".variable-info-icon"), w = I.relatedTarget;
|
|
1376
|
+
$ && $.classList.contains("variable-info-icon") && (!w || !i.contains(w) ? d(null) : w.closest(".variable-info-icon") || d(null));
|
|
1370
1377
|
};
|
|
1371
|
-
return
|
|
1372
|
-
|
|
1378
|
+
return i.addEventListener("mouseover", u, !0), i.addEventListener("mouseout", T, !0), () => {
|
|
1379
|
+
i.removeEventListener("mouseover", u, !0), i.removeEventListener("mouseout", T, !0);
|
|
1373
1380
|
};
|
|
1374
|
-
}, [
|
|
1381
|
+
}, [x, t, d]);
|
|
1375
1382
|
}
|
|
1376
|
-
function
|
|
1383
|
+
function It(t, x, d, i) {
|
|
1377
1384
|
de(() => {
|
|
1378
1385
|
if (!t.current) return;
|
|
1379
|
-
const
|
|
1386
|
+
const u = (w) => {
|
|
1380
1387
|
const e = w.currentTarget;
|
|
1381
|
-
e.dataset.fileName &&
|
|
1388
|
+
e.dataset.fileName && i({ key: "", anchorEl: e, type: "upload-label" });
|
|
1382
1389
|
}, T = () => {
|
|
1383
|
-
|
|
1390
|
+
i(null);
|
|
1384
1391
|
};
|
|
1385
|
-
let
|
|
1392
|
+
let I;
|
|
1386
1393
|
const $ = () => {
|
|
1387
1394
|
if (!t.current) return;
|
|
1388
1395
|
t.current.querySelectorAll(
|
|
1389
1396
|
".upload-label[data-file-name]"
|
|
1390
1397
|
).forEach((e) => {
|
|
1391
|
-
e.addEventListener("mouseenter",
|
|
1398
|
+
e.addEventListener("mouseenter", u), e.addEventListener("mouseleave", T);
|
|
1392
1399
|
});
|
|
1393
1400
|
};
|
|
1394
|
-
return
|
|
1395
|
-
|
|
1401
|
+
return I = requestAnimationFrame(() => {
|
|
1402
|
+
I = requestAnimationFrame($);
|
|
1396
1403
|
}), () => {
|
|
1397
|
-
cancelAnimationFrame(
|
|
1404
|
+
cancelAnimationFrame(I), t.current && t.current.querySelectorAll(
|
|
1398
1405
|
".upload-label[data-file-name]"
|
|
1399
1406
|
).forEach((e) => {
|
|
1400
|
-
e.removeEventListener("mouseenter",
|
|
1407
|
+
e.removeEventListener("mouseenter", u), e.removeEventListener("mouseleave", T);
|
|
1401
1408
|
});
|
|
1402
1409
|
};
|
|
1403
|
-
}, [
|
|
1410
|
+
}, [x, d, t, i]);
|
|
1404
1411
|
}
|
|
1405
|
-
function
|
|
1412
|
+
function Mt(t, x, d, i) {
|
|
1406
1413
|
de(() => {
|
|
1407
|
-
|
|
1408
|
-
|
|
1414
|
+
const u = setTimeout(() => {
|
|
1415
|
+
Be(t, x, d), Pe(t, x, d, i);
|
|
1416
|
+
}, 0);
|
|
1417
|
+
return () => clearTimeout(u);
|
|
1418
|
+
}, [d, x, t, i]);
|
|
1409
1419
|
}
|
|
1410
|
-
function
|
|
1411
|
-
const
|
|
1420
|
+
function Vt(t, x) {
|
|
1421
|
+
const d = Q(0);
|
|
1412
1422
|
de(() => {
|
|
1413
1423
|
if (!t.current) return;
|
|
1414
|
-
let
|
|
1415
|
-
const T = (a) => a instanceof HTMLElement ? !!(a.closest(".rte-datepicker-wrapper") || a.closest(".rte-datepicker-host") || a.closest(".ant-picker") || a.closest(".ant-picker-dropdown")) : !1,
|
|
1416
|
-
|
|
1424
|
+
let i = !1, u = 0;
|
|
1425
|
+
const T = (a) => a instanceof HTMLElement ? !!(a.closest(".rte-datepicker-wrapper") || a.closest(".rte-datepicker-host") || a.closest(".ant-picker") || a.closest(".ant-picker-dropdown")) : !1, I = (a) => {
|
|
1426
|
+
i = !0, T(a.target) && (d.current = Date.now(), console.log("[SelectionCtrl] mousedown on datepicker target"));
|
|
1417
1427
|
}, $ = () => {
|
|
1418
|
-
|
|
1428
|
+
i = !1, u = Date.now();
|
|
1419
1429
|
};
|
|
1420
1430
|
let w = !1, e = 0;
|
|
1421
1431
|
const q = () => {
|
|
1422
1432
|
w = !0;
|
|
1423
|
-
},
|
|
1433
|
+
}, f = () => {
|
|
1424
1434
|
w = !1, e = Date.now();
|
|
1425
1435
|
}, s = () => {
|
|
1426
1436
|
e = Date.now();
|
|
1427
1437
|
}, r = (a) => {
|
|
1428
|
-
T(a.target) && (
|
|
1438
|
+
T(a.target) && (d.current = Date.now(), console.log("[SelectionCtrl] focusin datepicker target"));
|
|
1429
1439
|
}, n = () => {
|
|
1430
|
-
if (Date.now() -
|
|
1440
|
+
if (Date.now() - d.current < 800) {
|
|
1431
1441
|
console.log("[SelectionCtrl] skip selectionchange due to recent datepicker interaction");
|
|
1432
1442
|
return;
|
|
1433
1443
|
}
|
|
@@ -1438,28 +1448,28 @@ function _t(t, b) {
|
|
|
1438
1448
|
return;
|
|
1439
1449
|
}
|
|
1440
1450
|
if (!t.current) return;
|
|
1441
|
-
const
|
|
1442
|
-
if (!
|
|
1451
|
+
const p = window.getSelection();
|
|
1452
|
+
if (!p || p.rangeCount === 0 || x.current || i || w || Date.now() - e < 500)
|
|
1443
1453
|
return;
|
|
1444
|
-
const
|
|
1445
|
-
if (!
|
|
1446
|
-
return t.current.contains(
|
|
1447
|
-
const
|
|
1448
|
-
if (!
|
|
1454
|
+
const y = p.getRangeAt(0);
|
|
1455
|
+
if (!y.collapsed)
|
|
1456
|
+
return t.current.contains(y.commonAncestorContainer), void 0;
|
|
1457
|
+
const g = p.anchorNode;
|
|
1458
|
+
if (!g || !t.current.contains(g))
|
|
1449
1459
|
return;
|
|
1450
|
-
let
|
|
1451
|
-
if (
|
|
1452
|
-
const k =
|
|
1453
|
-
(k.closest('[data-type="datepicker"]') || k.closest(".rte-datepicker-wrapper") || k.closest(".rte-datepicker-host")) && (
|
|
1454
|
-
} else if (
|
|
1455
|
-
const k =
|
|
1456
|
-
(k.closest('[data-type="datepicker"]') || k.closest(".rte-datepicker-wrapper") || k.closest(".rte-datepicker-host")) && (
|
|
1457
|
-
}
|
|
1458
|
-
if (
|
|
1460
|
+
let b = !1;
|
|
1461
|
+
if (g.nodeType === Node.ELEMENT_NODE) {
|
|
1462
|
+
const k = g;
|
|
1463
|
+
(k.closest('[data-type="datepicker"]') || k.closest(".rte-datepicker-wrapper") || k.closest(".rte-datepicker-host")) && (b = !0);
|
|
1464
|
+
} else if (g.parentElement) {
|
|
1465
|
+
const k = g.parentElement;
|
|
1466
|
+
(k.closest('[data-type="datepicker"]') || k.closest(".rte-datepicker-wrapper") || k.closest(".rte-datepicker-host")) && (b = !0);
|
|
1467
|
+
}
|
|
1468
|
+
if (b)
|
|
1459
1469
|
return;
|
|
1460
|
-
let
|
|
1461
|
-
if (
|
|
1462
|
-
if (Date.now() -
|
|
1470
|
+
let V = null;
|
|
1471
|
+
if (g.nodeType === Node.ELEMENT_NODE ? V = g.closest('[data-type="variable"]') : g.nodeType === Node.TEXT_NODE && g.parentElement && (V = g.parentElement.closest('[data-type="variable"]')), !V) {
|
|
1472
|
+
if (Date.now() - u > 500)
|
|
1463
1473
|
return;
|
|
1464
1474
|
const k = t.current.querySelectorAll('[data-type="variable"]');
|
|
1465
1475
|
if (k.length > 0) {
|
|
@@ -1471,123 +1481,123 @@ function _t(t, b) {
|
|
|
1471
1481
|
}
|
|
1472
1482
|
if (!P && k.length > 0 && (P = k[0]), P) {
|
|
1473
1483
|
const H = document.createRange();
|
|
1474
|
-
H.selectNodeContents(P), H.collapse(!1),
|
|
1484
|
+
H.selectNodeContents(P), H.collapse(!1), p.removeAllRanges(), p.addRange(H), P.focus();
|
|
1475
1485
|
} else
|
|
1476
|
-
|
|
1486
|
+
p.removeAllRanges();
|
|
1477
1487
|
} else
|
|
1478
|
-
|
|
1488
|
+
p.removeAllRanges();
|
|
1479
1489
|
}
|
|
1480
1490
|
}, o = t.current;
|
|
1481
|
-
return o && (o.addEventListener("compositionstart", q), o.addEventListener("compositionend",
|
|
1491
|
+
return o && (o.addEventListener("compositionstart", q), o.addEventListener("compositionend", f), o.addEventListener("input", s)), document.addEventListener("mousedown", I), document.addEventListener("mouseup", $), document.addEventListener("focusin", r), document.addEventListener("selectionchange", n), () => {
|
|
1482
1492
|
const a = t.current;
|
|
1483
|
-
a && (a.removeEventListener("compositionstart", q), a.removeEventListener("compositionend",
|
|
1493
|
+
a && (a.removeEventListener("compositionstart", q), a.removeEventListener("compositionend", f), a.removeEventListener("input", s)), document.removeEventListener("mousedown", I), document.removeEventListener("mouseup", $), document.removeEventListener("focusin", r), document.removeEventListener("selectionchange", n);
|
|
1484
1494
|
};
|
|
1485
|
-
}, [t,
|
|
1495
|
+
}, [t, x]);
|
|
1486
1496
|
}
|
|
1487
1497
|
function Bt(t) {
|
|
1488
1498
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
1489
1499
|
}
|
|
1490
1500
|
var De = { exports: {} }, Pt = De.exports, je;
|
|
1491
1501
|
function Ot() {
|
|
1492
|
-
return je || (je = 1, function(t,
|
|
1493
|
-
(function(
|
|
1494
|
-
t.exports =
|
|
1502
|
+
return je || (je = 1, function(t, x) {
|
|
1503
|
+
(function(d, i) {
|
|
1504
|
+
t.exports = i();
|
|
1495
1505
|
})(Pt, function() {
|
|
1496
|
-
var
|
|
1497
|
-
var c = ["th", "st", "nd", "rd"],
|
|
1498
|
-
return "[" +
|
|
1499
|
-
} },
|
|
1500
|
-
var L = String(
|
|
1501
|
-
return !L || L.length >= c ?
|
|
1502
|
-
},
|
|
1503
|
-
var c = -
|
|
1504
|
-
return (c <= 0 ? "+" : "-") +
|
|
1505
|
-
}, m: function
|
|
1506
|
-
if (c.date() <
|
|
1507
|
-
var L = 12 * (
|
|
1508
|
-
return +(-(L + (
|
|
1509
|
-
}, a: function(
|
|
1510
|
-
return
|
|
1511
|
-
}, p: function(
|
|
1512
|
-
return { M:
|
|
1513
|
-
}, u: function(
|
|
1514
|
-
return
|
|
1515
|
-
} },
|
|
1516
|
-
k[
|
|
1517
|
-
var P = "$isDayjsObject", H = function(
|
|
1518
|
-
return
|
|
1519
|
-
}, F = function
|
|
1520
|
-
var
|
|
1521
|
-
if (!c) return
|
|
1506
|
+
var d = 1e3, i = 6e4, u = 36e5, T = "millisecond", I = "second", $ = "minute", w = "hour", e = "day", q = "week", f = "month", s = "quarter", r = "year", n = "date", o = "Invalid Date", a = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, p = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, y = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(l) {
|
|
1507
|
+
var c = ["th", "st", "nd", "rd"], v = l % 100;
|
|
1508
|
+
return "[" + l + (c[(v - 20) % 10] || c[v] || c[0]) + "]";
|
|
1509
|
+
} }, g = function(l, c, v) {
|
|
1510
|
+
var L = String(l);
|
|
1511
|
+
return !L || L.length >= c ? l : "" + Array(c + 1 - L.length).join(v) + l;
|
|
1512
|
+
}, b = { s: g, z: function(l) {
|
|
1513
|
+
var c = -l.utcOffset(), v = Math.abs(c), L = Math.floor(v / 60), N = v % 60;
|
|
1514
|
+
return (c <= 0 ? "+" : "-") + g(L, 2, "0") + ":" + g(N, 2, "0");
|
|
1515
|
+
}, m: function l(c, v) {
|
|
1516
|
+
if (c.date() < v.date()) return -l(v, c);
|
|
1517
|
+
var L = 12 * (v.year() - c.year()) + (v.month() - c.month()), N = c.clone().add(L, f), W = v - N < 0, z = c.clone().add(L + (W ? -1 : 1), f);
|
|
1518
|
+
return +(-(L + (v - N) / (W ? N - z : z - N)) || 0);
|
|
1519
|
+
}, a: function(l) {
|
|
1520
|
+
return l < 0 ? Math.ceil(l) || 0 : Math.floor(l);
|
|
1521
|
+
}, p: function(l) {
|
|
1522
|
+
return { M: f, y: r, w: q, d: e, D: n, h: w, m: $, s: I, ms: T, Q: s }[l] || String(l || "").toLowerCase().replace(/s$/, "");
|
|
1523
|
+
}, u: function(l) {
|
|
1524
|
+
return l === void 0;
|
|
1525
|
+
} }, V = "en", k = {};
|
|
1526
|
+
k[V] = y;
|
|
1527
|
+
var P = "$isDayjsObject", H = function(l) {
|
|
1528
|
+
return l instanceof ee || !(!l || !l[P]);
|
|
1529
|
+
}, F = function l(c, v, L) {
|
|
1530
|
+
var N;
|
|
1531
|
+
if (!c) return V;
|
|
1522
1532
|
if (typeof c == "string") {
|
|
1523
1533
|
var W = c.toLowerCase();
|
|
1524
|
-
k[W] && (
|
|
1534
|
+
k[W] && (N = W), v && (k[W] = v, N = W);
|
|
1525
1535
|
var z = c.split("-");
|
|
1526
|
-
if (!
|
|
1536
|
+
if (!N && z.length > 1) return l(z[0]);
|
|
1527
1537
|
} else {
|
|
1528
1538
|
var te = c.name;
|
|
1529
|
-
k[te] = c,
|
|
1539
|
+
k[te] = c, N = te;
|
|
1530
1540
|
}
|
|
1531
|
-
return !L &&
|
|
1532
|
-
}, U = function(
|
|
1533
|
-
if (H(
|
|
1534
|
-
var
|
|
1535
|
-
return
|
|
1536
|
-
}, R =
|
|
1537
|
-
R.l = F, R.i = H, R.w = function(
|
|
1538
|
-
return U(
|
|
1541
|
+
return !L && N && (V = N), N || !L && V;
|
|
1542
|
+
}, U = function(l, c) {
|
|
1543
|
+
if (H(l)) return l.clone();
|
|
1544
|
+
var v = typeof c == "object" ? c : {};
|
|
1545
|
+
return v.date = l, v.args = arguments, new ee(v);
|
|
1546
|
+
}, R = b;
|
|
1547
|
+
R.l = F, R.i = H, R.w = function(l, c) {
|
|
1548
|
+
return U(l, { locale: c.$L, utc: c.$u, x: c.$x, $offset: c.$offset });
|
|
1539
1549
|
};
|
|
1540
1550
|
var ee = function() {
|
|
1541
|
-
function
|
|
1542
|
-
this.$L = F(
|
|
1551
|
+
function l(v) {
|
|
1552
|
+
this.$L = F(v.locale, null, !0), this.parse(v), this.$x = this.$x || v.x || {}, this[P] = !0;
|
|
1543
1553
|
}
|
|
1544
|
-
var c =
|
|
1545
|
-
return c.parse = function(
|
|
1554
|
+
var c = l.prototype;
|
|
1555
|
+
return c.parse = function(v) {
|
|
1546
1556
|
this.$d = function(L) {
|
|
1547
|
-
var
|
|
1548
|
-
if (
|
|
1549
|
-
if (R.u(
|
|
1550
|
-
if (
|
|
1551
|
-
if (typeof
|
|
1552
|
-
var z =
|
|
1557
|
+
var N = L.date, W = L.utc;
|
|
1558
|
+
if (N === null) return /* @__PURE__ */ new Date(NaN);
|
|
1559
|
+
if (R.u(N)) return /* @__PURE__ */ new Date();
|
|
1560
|
+
if (N instanceof Date) return new Date(N);
|
|
1561
|
+
if (typeof N == "string" && !/Z$/i.test(N)) {
|
|
1562
|
+
var z = N.match(a);
|
|
1553
1563
|
if (z) {
|
|
1554
1564
|
var te = z[2] - 1 || 0, se = (z[7] || "0").substring(0, 3);
|
|
1555
1565
|
return W ? new Date(Date.UTC(z[1], te, z[3] || 1, z[4] || 0, z[5] || 0, z[6] || 0, se)) : new Date(z[1], te, z[3] || 1, z[4] || 0, z[5] || 0, z[6] || 0, se);
|
|
1556
1566
|
}
|
|
1557
1567
|
}
|
|
1558
|
-
return new Date(
|
|
1559
|
-
}(
|
|
1568
|
+
return new Date(N);
|
|
1569
|
+
}(v), this.init();
|
|
1560
1570
|
}, c.init = function() {
|
|
1561
|
-
var
|
|
1562
|
-
this.$y =
|
|
1571
|
+
var v = this.$d;
|
|
1572
|
+
this.$y = v.getFullYear(), this.$M = v.getMonth(), this.$D = v.getDate(), this.$W = v.getDay(), this.$H = v.getHours(), this.$m = v.getMinutes(), this.$s = v.getSeconds(), this.$ms = v.getMilliseconds();
|
|
1563
1573
|
}, c.$utils = function() {
|
|
1564
1574
|
return R;
|
|
1565
1575
|
}, c.isValid = function() {
|
|
1566
1576
|
return this.$d.toString() !== o;
|
|
1567
|
-
}, c.isSame = function(
|
|
1568
|
-
var
|
|
1569
|
-
return this.startOf(L) <=
|
|
1570
|
-
}, c.isAfter = function(
|
|
1571
|
-
return U(
|
|
1572
|
-
}, c.isBefore = function(
|
|
1573
|
-
return this.endOf(L) < U(
|
|
1574
|
-
}, c.$g = function(
|
|
1575
|
-
return R.u(
|
|
1577
|
+
}, c.isSame = function(v, L) {
|
|
1578
|
+
var N = U(v);
|
|
1579
|
+
return this.startOf(L) <= N && N <= this.endOf(L);
|
|
1580
|
+
}, c.isAfter = function(v, L) {
|
|
1581
|
+
return U(v) < this.startOf(L);
|
|
1582
|
+
}, c.isBefore = function(v, L) {
|
|
1583
|
+
return this.endOf(L) < U(v);
|
|
1584
|
+
}, c.$g = function(v, L, N) {
|
|
1585
|
+
return R.u(v) ? this[L] : this.set(N, v);
|
|
1576
1586
|
}, c.unix = function() {
|
|
1577
1587
|
return Math.floor(this.valueOf() / 1e3);
|
|
1578
1588
|
}, c.valueOf = function() {
|
|
1579
1589
|
return this.$d.getTime();
|
|
1580
|
-
}, c.startOf = function(
|
|
1581
|
-
var
|
|
1582
|
-
var xe = R.w(
|
|
1590
|
+
}, c.startOf = function(v, L) {
|
|
1591
|
+
var N = this, W = !!R.u(L) || L, z = R.p(v), te = function(he, ye) {
|
|
1592
|
+
var xe = R.w(N.$u ? Date.UTC(N.$y, ye, he) : new Date(N.$y, ye, he), N);
|
|
1583
1593
|
return W ? xe : xe.endOf(e);
|
|
1584
1594
|
}, se = function(he, ye) {
|
|
1585
|
-
return R.w(
|
|
1595
|
+
return R.w(N.toDate()[he].apply(N.toDate("s"), (W ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(ye)), N);
|
|
1586
1596
|
}, ce = this.$W, pe = this.$M, fe = this.$D, be = "set" + (this.$u ? "UTC" : "");
|
|
1587
1597
|
switch (z) {
|
|
1588
1598
|
case r:
|
|
1589
1599
|
return W ? te(1, 0) : te(31, 11);
|
|
1590
|
-
case
|
|
1600
|
+
case f:
|
|
1591
1601
|
return W ? te(1, pe) : te(0, pe + 1);
|
|
1592
1602
|
case q:
|
|
1593
1603
|
var X = this.$locale().weekStart || 0, ue = (ce < X ? ce + 7 : ce) - X;
|
|
@@ -1599,43 +1609,43 @@ function Ot() {
|
|
|
1599
1609
|
return se(be + "Minutes", 1);
|
|
1600
1610
|
case $:
|
|
1601
1611
|
return se(be + "Seconds", 2);
|
|
1602
|
-
case
|
|
1612
|
+
case I:
|
|
1603
1613
|
return se(be + "Milliseconds", 3);
|
|
1604
1614
|
default:
|
|
1605
1615
|
return this.clone();
|
|
1606
1616
|
}
|
|
1607
|
-
}, c.endOf = function(
|
|
1608
|
-
return this.startOf(
|
|
1609
|
-
}, c.$set = function(
|
|
1610
|
-
var
|
|
1611
|
-
if (W ===
|
|
1617
|
+
}, c.endOf = function(v) {
|
|
1618
|
+
return this.startOf(v, !1);
|
|
1619
|
+
}, c.$set = function(v, L) {
|
|
1620
|
+
var N, W = R.p(v), z = "set" + (this.$u ? "UTC" : ""), te = (N = {}, N[e] = z + "Date", N[n] = z + "Date", N[f] = z + "Month", N[r] = z + "FullYear", N[w] = z + "Hours", N[$] = z + "Minutes", N[I] = z + "Seconds", N[T] = z + "Milliseconds", N)[W], se = W === e ? this.$D + (L - this.$W) : L;
|
|
1621
|
+
if (W === f || W === r) {
|
|
1612
1622
|
var ce = this.clone().set(n, 1);
|
|
1613
1623
|
ce.$d[te](se), ce.init(), this.$d = ce.set(n, Math.min(this.$D, ce.daysInMonth())).$d;
|
|
1614
1624
|
} else te && this.$d[te](se);
|
|
1615
1625
|
return this.init(), this;
|
|
1616
|
-
}, c.set = function(
|
|
1617
|
-
return this.clone().$set(
|
|
1618
|
-
}, c.get = function(
|
|
1619
|
-
return this[R.p(
|
|
1620
|
-
}, c.add = function(
|
|
1621
|
-
var
|
|
1622
|
-
|
|
1626
|
+
}, c.set = function(v, L) {
|
|
1627
|
+
return this.clone().$set(v, L);
|
|
1628
|
+
}, c.get = function(v) {
|
|
1629
|
+
return this[R.p(v)]();
|
|
1630
|
+
}, c.add = function(v, L) {
|
|
1631
|
+
var N, W = this;
|
|
1632
|
+
v = Number(v);
|
|
1623
1633
|
var z = R.p(L), te = function(pe) {
|
|
1624
1634
|
var fe = U(W);
|
|
1625
|
-
return R.w(fe.date(fe.date() + Math.round(pe *
|
|
1635
|
+
return R.w(fe.date(fe.date() + Math.round(pe * v)), W);
|
|
1626
1636
|
};
|
|
1627
|
-
if (z ===
|
|
1628
|
-
if (z === r) return this.set(r, this.$y +
|
|
1637
|
+
if (z === f) return this.set(f, this.$M + v);
|
|
1638
|
+
if (z === r) return this.set(r, this.$y + v);
|
|
1629
1639
|
if (z === e) return te(1);
|
|
1630
1640
|
if (z === q) return te(7);
|
|
1631
|
-
var se = (
|
|
1641
|
+
var se = (N = {}, N[$] = i, N[w] = u, N[I] = d, N)[z] || 1, ce = this.$d.getTime() + v * se;
|
|
1632
1642
|
return R.w(ce, this);
|
|
1633
|
-
}, c.subtract = function(
|
|
1634
|
-
return this.add(-1 *
|
|
1635
|
-
}, c.format = function(
|
|
1636
|
-
var L = this,
|
|
1637
|
-
if (!this.isValid()) return
|
|
1638
|
-
var W =
|
|
1643
|
+
}, c.subtract = function(v, L) {
|
|
1644
|
+
return this.add(-1 * v, L);
|
|
1645
|
+
}, c.format = function(v) {
|
|
1646
|
+
var L = this, N = this.$locale();
|
|
1647
|
+
if (!this.isValid()) return N.invalidDate || o;
|
|
1648
|
+
var W = v || "YYYY-MM-DDTHH:mm:ssZ", z = R.z(this), te = this.$H, se = this.$m, ce = this.$M, pe = N.weekdays, fe = N.months, be = N.meridiem, X = function(ye, xe, we, Ce) {
|
|
1639
1649
|
return ye && (ye[xe] || ye(L, W)) || we[xe].slice(0, Ce);
|
|
1640
1650
|
}, ue = function(ye) {
|
|
1641
1651
|
return R.s(te % 12 || 12, ye, "0");
|
|
@@ -1643,7 +1653,7 @@ function Ot() {
|
|
|
1643
1653
|
var Ce = ye < 12 ? "AM" : "PM";
|
|
1644
1654
|
return we ? Ce.toLowerCase() : Ce;
|
|
1645
1655
|
};
|
|
1646
|
-
return W.replace(
|
|
1656
|
+
return W.replace(p, function(ye, xe) {
|
|
1647
1657
|
return xe || function(we) {
|
|
1648
1658
|
switch (we) {
|
|
1649
1659
|
case "YY":
|
|
@@ -1655,7 +1665,7 @@ function Ot() {
|
|
|
1655
1665
|
case "MM":
|
|
1656
1666
|
return R.s(ce + 1, 2, "0");
|
|
1657
1667
|
case "MMM":
|
|
1658
|
-
return X(
|
|
1668
|
+
return X(N.monthsShort, ce, fe, 3);
|
|
1659
1669
|
case "MMMM":
|
|
1660
1670
|
return X(fe, ce);
|
|
1661
1671
|
case "D":
|
|
@@ -1665,9 +1675,9 @@ function Ot() {
|
|
|
1665
1675
|
case "d":
|
|
1666
1676
|
return String(L.$W);
|
|
1667
1677
|
case "dd":
|
|
1668
|
-
return X(
|
|
1678
|
+
return X(N.weekdaysMin, L.$W, pe, 2);
|
|
1669
1679
|
case "ddd":
|
|
1670
|
-
return X(
|
|
1680
|
+
return X(N.weekdaysShort, L.$W, pe, 3);
|
|
1671
1681
|
case "dddd":
|
|
1672
1682
|
return pe[L.$W];
|
|
1673
1683
|
case "H":
|
|
@@ -1700,15 +1710,15 @@ function Ot() {
|
|
|
1700
1710
|
});
|
|
1701
1711
|
}, c.utcOffset = function() {
|
|
1702
1712
|
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
1703
|
-
}, c.diff = function(
|
|
1704
|
-
var W, z = this, te = R.p(L), se = U(
|
|
1713
|
+
}, c.diff = function(v, L, N) {
|
|
1714
|
+
var W, z = this, te = R.p(L), se = U(v), ce = (se.utcOffset() - this.utcOffset()) * i, pe = this - se, fe = function() {
|
|
1705
1715
|
return R.m(z, se);
|
|
1706
1716
|
};
|
|
1707
1717
|
switch (te) {
|
|
1708
1718
|
case r:
|
|
1709
1719
|
W = fe() / 12;
|
|
1710
1720
|
break;
|
|
1711
|
-
case
|
|
1721
|
+
case f:
|
|
1712
1722
|
W = fe();
|
|
1713
1723
|
break;
|
|
1714
1724
|
case s:
|
|
@@ -1721,26 +1731,26 @@ function Ot() {
|
|
|
1721
1731
|
W = (pe - ce) / 864e5;
|
|
1722
1732
|
break;
|
|
1723
1733
|
case w:
|
|
1724
|
-
W = pe /
|
|
1734
|
+
W = pe / u;
|
|
1725
1735
|
break;
|
|
1726
1736
|
case $:
|
|
1727
|
-
W = pe /
|
|
1737
|
+
W = pe / i;
|
|
1728
1738
|
break;
|
|
1729
|
-
case
|
|
1730
|
-
W = pe /
|
|
1739
|
+
case I:
|
|
1740
|
+
W = pe / d;
|
|
1731
1741
|
break;
|
|
1732
1742
|
default:
|
|
1733
1743
|
W = pe;
|
|
1734
1744
|
}
|
|
1735
|
-
return
|
|
1745
|
+
return N ? W : R.a(W);
|
|
1736
1746
|
}, c.daysInMonth = function() {
|
|
1737
|
-
return this.endOf(
|
|
1747
|
+
return this.endOf(f).$D;
|
|
1738
1748
|
}, c.$locale = function() {
|
|
1739
1749
|
return k[this.$L];
|
|
1740
|
-
}, c.locale = function(
|
|
1741
|
-
if (!
|
|
1742
|
-
var
|
|
1743
|
-
return W && (
|
|
1750
|
+
}, c.locale = function(v, L) {
|
|
1751
|
+
if (!v) return this.$L;
|
|
1752
|
+
var N = this.clone(), W = F(v, L, !0);
|
|
1753
|
+
return W && (N.$L = W), N;
|
|
1744
1754
|
}, c.clone = function() {
|
|
1745
1755
|
return R.w(this.$d, this);
|
|
1746
1756
|
}, c.toDate = function() {
|
|
@@ -1751,47 +1761,47 @@ function Ot() {
|
|
|
1751
1761
|
return this.$d.toISOString();
|
|
1752
1762
|
}, c.toString = function() {
|
|
1753
1763
|
return this.$d.toUTCString();
|
|
1754
|
-
},
|
|
1764
|
+
}, l;
|
|
1755
1765
|
}(), re = ee.prototype;
|
|
1756
|
-
return U.prototype = re, [["$ms", T], ["$s",
|
|
1757
|
-
re[
|
|
1758
|
-
return this.$g(c,
|
|
1766
|
+
return U.prototype = re, [["$ms", T], ["$s", I], ["$m", $], ["$H", w], ["$W", e], ["$M", f], ["$y", r], ["$D", n]].forEach(function(l) {
|
|
1767
|
+
re[l[1]] = function(c) {
|
|
1768
|
+
return this.$g(c, l[0], l[1]);
|
|
1759
1769
|
};
|
|
1760
|
-
}), U.extend = function(
|
|
1761
|
-
return
|
|
1762
|
-
}, U.locale = F, U.isDayjs = H, U.unix = function(
|
|
1763
|
-
return U(1e3 *
|
|
1764
|
-
}, U.en = k[
|
|
1770
|
+
}), U.extend = function(l, c) {
|
|
1771
|
+
return l.$i || (l(c, ee, U), l.$i = !0), U;
|
|
1772
|
+
}, U.locale = F, U.isDayjs = H, U.unix = function(l) {
|
|
1773
|
+
return U(1e3 * l);
|
|
1774
|
+
}, U.en = k[V], U.Ls = k, U.p = {}, U;
|
|
1765
1775
|
});
|
|
1766
1776
|
}(De)), De.exports;
|
|
1767
1777
|
}
|
|
1768
1778
|
var Rt = Ot();
|
|
1769
|
-
const
|
|
1770
|
-
const
|
|
1771
|
-
if (!
|
|
1772
|
-
const o =
|
|
1773
|
-
return o.length === 2 && o[0] && o[1] ? [
|
|
1779
|
+
const Ve = /* @__PURE__ */ Bt(Rt), { RangePicker: Gt } = rt, Ht = ({ host: t, onChange: x }) => {
|
|
1780
|
+
const d = t.dataset.key, i = t.dataset.value, u = t.dataset.placeholder, T = t.dataset.limitRange ? parseInt(t.dataset.limitRange, 10) : void 0, I = t.dataset.disableFuture === "true", [$, w] = ne(() => {
|
|
1781
|
+
if (!i) return null;
|
|
1782
|
+
const o = i.split(",");
|
|
1783
|
+
return o.length === 2 && o[0] && o[1] ? [Ve(o[0]), Ve(o[1])] : null;
|
|
1774
1784
|
}), [e, q] = ne(null);
|
|
1775
1785
|
return Xe(
|
|
1776
1786
|
/* @__PURE__ */ E("div", { className: "rte-datepicker-wrapper", contentEditable: !1, style: { display: "inline-block", verticalAlign: "middle", width: "240px" }, children: /* @__PURE__ */ E(
|
|
1777
1787
|
Gt,
|
|
1778
1788
|
{
|
|
1779
1789
|
value: $,
|
|
1780
|
-
disabledDate: (o) => o ?
|
|
1790
|
+
disabledDate: (o) => o ? I && o.isAfter(Ve(), "day") ? !0 : !T || !e || !e[0] ? !1 : Math.abs(o.diff(e[0], "days")) > T : !1,
|
|
1781
1791
|
onCalendarChange: (o) => {
|
|
1782
1792
|
console.log("[DatePicker] onCalendarChange", o?.map((a) => a?.format("YYYY-MM-DD") || null)), q(o);
|
|
1783
1793
|
},
|
|
1784
1794
|
onChange: (o) => {
|
|
1785
1795
|
if (console.log("[DatePicker] onChange", o?.map((a) => a?.format("YYYY-MM-DD") || null)), w(o), q(null), o && o[0] && o[1]) {
|
|
1786
1796
|
const a = `${o[0].format("YYYY-MM-DD")},${o[1].format("YYYY-MM-DD")}`;
|
|
1787
|
-
t.setAttribute("data-value", a),
|
|
1797
|
+
t.setAttribute("data-value", a), x(d, a);
|
|
1788
1798
|
} else
|
|
1789
|
-
t.setAttribute("data-value", ""),
|
|
1799
|
+
t.setAttribute("data-value", ""), x(d, "");
|
|
1790
1800
|
},
|
|
1791
1801
|
onOpenChange: (o) => {
|
|
1792
1802
|
console.log("[DatePicker] onOpenChange", o), q(o ? $ : null);
|
|
1793
1803
|
},
|
|
1794
|
-
placeholder: [
|
|
1804
|
+
placeholder: [u || "开始日期", u || "结束日期"],
|
|
1795
1805
|
style: { width: "100%" },
|
|
1796
1806
|
size: "small",
|
|
1797
1807
|
allowClear: !0,
|
|
@@ -1802,86 +1812,86 @@ const _e = /* @__PURE__ */ Bt(Rt), { RangePicker: Gt } = rt, Ht = ({ host: t, on
|
|
|
1802
1812
|
t
|
|
1803
1813
|
);
|
|
1804
1814
|
}, Ft = (t) => {
|
|
1805
|
-
const [
|
|
1815
|
+
const [x, d] = ne([]);
|
|
1806
1816
|
return de(() => {
|
|
1807
|
-
const
|
|
1808
|
-
if (!
|
|
1809
|
-
const
|
|
1810
|
-
const
|
|
1811
|
-
|
|
1817
|
+
const i = t.current;
|
|
1818
|
+
if (!i) return;
|
|
1819
|
+
const u = () => {
|
|
1820
|
+
const I = i.querySelectorAll(".rte-datepicker-host"), $ = [];
|
|
1821
|
+
I.forEach((w) => {
|
|
1812
1822
|
const e = w.getAttribute("data-key");
|
|
1813
1823
|
e && $.push(
|
|
1814
1824
|
/* @__PURE__ */ E(
|
|
1815
1825
|
Ht,
|
|
1816
1826
|
{
|
|
1817
1827
|
host: w,
|
|
1818
|
-
onChange: (
|
|
1828
|
+
onChange: () => {
|
|
1819
1829
|
if (t.current) {
|
|
1820
|
-
const
|
|
1821
|
-
t.current.dispatchEvent(
|
|
1830
|
+
const q = new Event("input", { bubbles: !0 });
|
|
1831
|
+
t.current.dispatchEvent(q);
|
|
1822
1832
|
}
|
|
1823
1833
|
}
|
|
1824
1834
|
},
|
|
1825
1835
|
`datepicker-${e}`
|
|
1826
1836
|
)
|
|
1827
1837
|
);
|
|
1828
|
-
}),
|
|
1838
|
+
}), d($);
|
|
1829
1839
|
};
|
|
1830
|
-
|
|
1831
|
-
const T = new MutationObserver((
|
|
1840
|
+
u();
|
|
1841
|
+
const T = new MutationObserver((I) => {
|
|
1832
1842
|
let $ = !1;
|
|
1833
|
-
for (const w of
|
|
1843
|
+
for (const w of I)
|
|
1834
1844
|
if (w.type === "childList") {
|
|
1835
1845
|
let e = !1;
|
|
1836
1846
|
if (w.addedNodes.forEach((q) => {
|
|
1837
1847
|
if (q.nodeType === Node.ELEMENT_NODE) {
|
|
1838
|
-
const
|
|
1839
|
-
(
|
|
1848
|
+
const f = q;
|
|
1849
|
+
(f.classList?.contains("rte-datepicker-host") || f.querySelector?.(".rte-datepicker-host")) && (e = !0);
|
|
1840
1850
|
}
|
|
1841
1851
|
}), w.removedNodes.forEach((q) => {
|
|
1842
1852
|
if (q.nodeType === Node.ELEMENT_NODE) {
|
|
1843
|
-
const
|
|
1844
|
-
(
|
|
1853
|
+
const f = q;
|
|
1854
|
+
(f.classList?.contains("rte-datepicker-host") || f.querySelector?.(".rte-datepicker-host")) && (e = !0);
|
|
1845
1855
|
}
|
|
1846
1856
|
}), e) {
|
|
1847
1857
|
$ = !0;
|
|
1848
1858
|
break;
|
|
1849
1859
|
}
|
|
1850
1860
|
}
|
|
1851
|
-
$ &&
|
|
1861
|
+
$ && u();
|
|
1852
1862
|
});
|
|
1853
|
-
return T.observe(
|
|
1854
|
-
}, [t]),
|
|
1863
|
+
return T.observe(i, { childList: !0, subtree: !0 }), () => T.disconnect();
|
|
1864
|
+
}, [t]), x;
|
|
1855
1865
|
}, zt = ({
|
|
1856
1866
|
config: t,
|
|
1857
|
-
onSend:
|
|
1858
|
-
isProcessing:
|
|
1859
|
-
disabled:
|
|
1860
|
-
width:
|
|
1867
|
+
onSend: x,
|
|
1868
|
+
isProcessing: d = !1,
|
|
1869
|
+
disabled: i = !1,
|
|
1870
|
+
width: u,
|
|
1861
1871
|
lockStructure: T = !1,
|
|
1862
|
-
agentOptions:
|
|
1872
|
+
agentOptions: I = [],
|
|
1863
1873
|
onAgentSelect: $,
|
|
1864
1874
|
onAgentExit: w,
|
|
1865
1875
|
loading: e = !1,
|
|
1866
1876
|
placeholder: q,
|
|
1867
|
-
border:
|
|
1877
|
+
border: f,
|
|
1868
1878
|
background: s = "transparent",
|
|
1869
1879
|
hideButtons: r
|
|
1870
1880
|
}) => {
|
|
1871
|
-
const n = Q(null), o = Q(null), [a,
|
|
1881
|
+
const n = Q(null), o = Q(null), [a, p] = ne({}), [y, g] = ne(null), [b, V] = ne(null), k = Q(!1), P = Q(null), [H, F] = ne(!1), U = Q(null), [R, ee] = ne(!0), [re, l] = ne(() => {
|
|
1872
1882
|
const h = {};
|
|
1873
1883
|
return t.forEach((m) => {
|
|
1874
1884
|
m.type === "multi-variable" && m.key && (h[m.key] = 1);
|
|
1875
1885
|
}), h;
|
|
1876
|
-
}), c = Q({}),
|
|
1886
|
+
}), c = Q({}), v = Q({}), L = Q({});
|
|
1877
1887
|
de(() => {
|
|
1878
|
-
|
|
1888
|
+
v.current = a;
|
|
1879
1889
|
}, [a]), de(() => {
|
|
1880
1890
|
L.current = re;
|
|
1881
1891
|
}, [re]);
|
|
1882
|
-
const
|
|
1892
|
+
const N = ae((h) => h.find((C) => C.type === "tag")?.text || null, []), W = Q(t), z = Q(null);
|
|
1883
1893
|
de(() => {
|
|
1884
|
-
const h =
|
|
1894
|
+
const h = N(W.current), m = N(t);
|
|
1885
1895
|
if (h && h !== m && n.current) {
|
|
1886
1896
|
const C = {};
|
|
1887
1897
|
n.current.querySelectorAll('[data-type="variable"]').forEach((A) => {
|
|
@@ -1904,27 +1914,27 @@ const _e = /* @__PURE__ */ Bt(Rt), { RangePicker: Gt } = rt, Ht = ({ host: t, on
|
|
|
1904
1914
|
}
|
|
1905
1915
|
}), c.current[h] = {
|
|
1906
1916
|
variableValues: C,
|
|
1907
|
-
files: { ...
|
|
1917
|
+
files: { ...v.current },
|
|
1908
1918
|
multiVariableCounts: { ...L.current }
|
|
1909
1919
|
};
|
|
1910
1920
|
}
|
|
1911
1921
|
if (m && c.current[m]) {
|
|
1912
1922
|
const C = c.current[m];
|
|
1913
|
-
z.current = C,
|
|
1923
|
+
z.current = C, p(C.files), l(C.multiVariableCounts);
|
|
1914
1924
|
} else if (m) {
|
|
1915
1925
|
z.current = null;
|
|
1916
1926
|
const C = {};
|
|
1917
|
-
t.forEach((
|
|
1918
|
-
|
|
1919
|
-
}),
|
|
1927
|
+
t.forEach((M) => {
|
|
1928
|
+
M.type === "multi-variable" && M.key && (C[M.key] = 1);
|
|
1929
|
+
}), l(C), p({});
|
|
1920
1930
|
} else
|
|
1921
|
-
z.current = null,
|
|
1931
|
+
z.current = null, l({}), p({});
|
|
1922
1932
|
W.current = t;
|
|
1923
|
-
}, [t,
|
|
1933
|
+
}, [t, N]), ze(() => {
|
|
1924
1934
|
z.current && n.current && (n.current.__tempVariableValues = z.current.variableValues, setTimeout(() => {
|
|
1925
1935
|
z.current && (z.current = null);
|
|
1926
1936
|
}, 0));
|
|
1927
|
-
}), At(n, t, a, T, re, U, void 0, r), Lt(n, t, a,
|
|
1937
|
+
}), At(n, t, a, T, re, U, void 0, r), Lt(n, t, a, V), _t(n, t, V, r), It(n, t, a, V), Dt(n, t, V), Mt(n, t, a, F), Vt(n, k);
|
|
1928
1938
|
const te = Ft(n);
|
|
1929
1939
|
de(() => {
|
|
1930
1940
|
if (t.length > 0) {
|
|
@@ -1936,14 +1946,14 @@ const _e = /* @__PURE__ */ Bt(Rt), { RangePicker: Gt } = rt, Ht = ({ host: t, on
|
|
|
1936
1946
|
ee(!0);
|
|
1937
1947
|
return;
|
|
1938
1948
|
}
|
|
1939
|
-
const C = n.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "",
|
|
1940
|
-
let
|
|
1941
|
-
|
|
1942
|
-
(G.textContent?.replace(/[\u200B\n]/g, "").trim() || "") && (
|
|
1943
|
-
}),
|
|
1944
|
-
G.querySelector(".upload-inner-wrapper.has-file") && (
|
|
1949
|
+
const C = n.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "", M = n.current.querySelectorAll('[data-type="variable"]'), S = n.current.querySelectorAll('[data-type="upload"]');
|
|
1950
|
+
let _ = !1;
|
|
1951
|
+
M.forEach((G) => {
|
|
1952
|
+
(G.textContent?.replace(/[\u200B\n]/g, "").trim() || "") && (_ = !0);
|
|
1953
|
+
}), S.forEach((G) => {
|
|
1954
|
+
G.querySelector(".upload-inner-wrapper.has-file") && (_ = !0);
|
|
1945
1955
|
});
|
|
1946
|
-
const A = !C && !
|
|
1956
|
+
const A = !C && !_;
|
|
1947
1957
|
ee(A), t.length === 0 && F(!A);
|
|
1948
1958
|
};
|
|
1949
1959
|
h();
|
|
@@ -1957,30 +1967,30 @@ const _e = /* @__PURE__ */ Bt(Rt), { RangePicker: Gt } = rt, Ht = ({ host: t, on
|
|
|
1957
1967
|
};
|
|
1958
1968
|
}, [t]);
|
|
1959
1969
|
const se = (h) => {
|
|
1960
|
-
if (
|
|
1970
|
+
if (i) {
|
|
1961
1971
|
h.preventDefault();
|
|
1962
1972
|
return;
|
|
1963
1973
|
}
|
|
1964
1974
|
h.preventDefault();
|
|
1965
1975
|
const m = h.clipboardData.getData("text/plain"), C = window.getSelection();
|
|
1966
1976
|
if (C && C.rangeCount > 0) {
|
|
1967
|
-
const
|
|
1968
|
-
if (
|
|
1969
|
-
let
|
|
1970
|
-
if (
|
|
1971
|
-
const
|
|
1972
|
-
if (
|
|
1977
|
+
const M = C.anchorNode;
|
|
1978
|
+
if (M) {
|
|
1979
|
+
let S = null;
|
|
1980
|
+
if (M.nodeType === Node.ELEMENT_NODE ? S = M.closest('[data-type="variable"]') : M.nodeType === Node.TEXT_NODE && M.parentElement && (S = M.parentElement.closest('[data-type="variable"]')), S) {
|
|
1981
|
+
const _ = S.dataset.multiKey;
|
|
1982
|
+
if (_) {
|
|
1973
1983
|
const A = /[、,,\s\n\r\t]+/, G = m.split(A).map((D) => D.trim()).filter((D) => D.length > 0);
|
|
1974
1984
|
if (console.log("[Paste Event] 粘贴的内容:", m), console.log("[Paste Event] 拆分后的值:", G), G.length > 1) {
|
|
1975
|
-
const D = parseInt(
|
|
1976
|
-
B > Y &&
|
|
1985
|
+
const D = parseInt(S.dataset.index || "0", 10), j = t.find((le) => le.type === "multi-variable" && le.key === _)?.maxCount || 9, Y = re[_] || 1, B = Math.min(D + G.length, j);
|
|
1986
|
+
B > Y && l((J) => ({
|
|
1977
1987
|
...J,
|
|
1978
|
-
[
|
|
1988
|
+
[_]: B
|
|
1979
1989
|
}));
|
|
1980
1990
|
const K = [];
|
|
1981
1991
|
for (let J = 0; J < Y; J++) {
|
|
1982
|
-
const
|
|
1983
|
-
`[data-type="variable"][data-key="${
|
|
1992
|
+
const le = `${_}_${J}`, ge = n.current.querySelector(
|
|
1993
|
+
`[data-type="variable"][data-key="${le}"][data-multi-key="${_}"]`
|
|
1984
1994
|
);
|
|
1985
1995
|
if (ge) {
|
|
1986
1996
|
const ke = ge.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
@@ -1990,20 +2000,20 @@ const _e = /* @__PURE__ */ Bt(Rt), { RangePicker: Gt } = rt, Ht = ({ host: t, on
|
|
|
1990
2000
|
K.splice(D, 1, ...G.slice(0, j - D));
|
|
1991
2001
|
const oe = K.slice(0, j);
|
|
1992
2002
|
oe.length > 0 && oe[oe.length - 1] !== "" && oe.length < j && oe.push("");
|
|
1993
|
-
const O = Math.max(oe.length, 1),
|
|
1994
|
-
oe.forEach((J,
|
|
1995
|
-
J && (
|
|
2003
|
+
const O = Math.max(oe.length, 1), ie = {};
|
|
2004
|
+
oe.forEach((J, le) => {
|
|
2005
|
+
J && (ie[`${_}_${le}`] = J);
|
|
1996
2006
|
}), n.current.querySelectorAll(
|
|
1997
2007
|
'[data-type="variable"]'
|
|
1998
2008
|
).forEach((J) => {
|
|
1999
|
-
const
|
|
2000
|
-
if (
|
|
2009
|
+
const le = J.dataset.key, ge = J.dataset.multiKey;
|
|
2010
|
+
if (le && ge !== _) {
|
|
2001
2011
|
const ke = J.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
2002
|
-
ke && (le
|
|
2012
|
+
ke && (ie[le] = ke);
|
|
2003
2013
|
}
|
|
2004
|
-
}), n.current.__tempVariableValues =
|
|
2014
|
+
}), n.current.__tempVariableValues = ie, l((J) => ({
|
|
2005
2015
|
...J,
|
|
2006
|
-
[
|
|
2016
|
+
[_]: O
|
|
2007
2017
|
})), console.log("[Paste Event] 粘贴完成,已填充到多个输入框,值:", oe);
|
|
2008
2018
|
return;
|
|
2009
2019
|
} else G.length === 1 && console.log("[Paste Event] 粘贴单个值,将在失去焦点时检查是否需要拆分");
|
|
@@ -2012,26 +2022,26 @@ const _e = /* @__PURE__ */ Bt(Rt), { RangePicker: Gt } = rt, Ht = ({ host: t, on
|
|
|
2012
2022
|
}
|
|
2013
2023
|
}
|
|
2014
2024
|
document.execCommand("insertText", !1, m), ye(), setTimeout(() => {
|
|
2015
|
-
const
|
|
2016
|
-
if (
|
|
2017
|
-
const
|
|
2018
|
-
if (
|
|
2019
|
-
let
|
|
2020
|
-
if (
|
|
2021
|
-
const A =
|
|
2025
|
+
const M = window.getSelection();
|
|
2026
|
+
if (M && M.rangeCount > 0) {
|
|
2027
|
+
const S = M.anchorNode;
|
|
2028
|
+
if (S) {
|
|
2029
|
+
let _ = null;
|
|
2030
|
+
if (S.nodeType === Node.ELEMENT_NODE ? _ = S.closest('[data-type="variable"][data-multi-key]') : S.nodeType === Node.TEXT_NODE && S.parentElement && (_ = S.parentElement.closest('[data-type="variable"][data-multi-key]')), _) {
|
|
2031
|
+
const A = _.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
2022
2032
|
/[、,,\s]+/.test(A) && (console.log("[Paste Event] 粘贴后检测到分隔符,内容:", A), console.log("[Paste Event] 提示:失去焦点后将自动拆分"));
|
|
2023
2033
|
}
|
|
2024
2034
|
}
|
|
2025
2035
|
}
|
|
2026
2036
|
}, 0);
|
|
2027
2037
|
}, ce = (h) => {
|
|
2028
|
-
if (h.target.files && h.target.files[0] &&
|
|
2029
|
-
const m = h.target.files[0], C =
|
|
2030
|
-
|
|
2038
|
+
if (h.target.files && h.target.files[0] && y) {
|
|
2039
|
+
const m = h.target.files[0], C = y;
|
|
2040
|
+
p((M) => ({ ...M, [C]: m }));
|
|
2031
2041
|
}
|
|
2032
|
-
h.target && (h.target.value = ""),
|
|
2042
|
+
h.target && (h.target.value = ""), g(null);
|
|
2033
2043
|
}, pe = (h) => {
|
|
2034
|
-
|
|
2044
|
+
p((m) => {
|
|
2035
2045
|
const C = { ...m };
|
|
2036
2046
|
return delete C[h], C;
|
|
2037
2047
|
});
|
|
@@ -2042,12 +2052,12 @@ const _e = /* @__PURE__ */ Bt(Rt), { RangePicker: Gt } = rt, Ht = ({ host: t, on
|
|
|
2042
2052
|
if (m.closest(".tag-close-btn")) {
|
|
2043
2053
|
if (h.preventDefault(), h.stopPropagation(), T)
|
|
2044
2054
|
return;
|
|
2045
|
-
|
|
2055
|
+
V(null), w ? w() : n.current && (n.current.innerHTML = "", n.current.focus());
|
|
2046
2056
|
return;
|
|
2047
2057
|
}
|
|
2048
2058
|
if (T) {
|
|
2049
|
-
const
|
|
2050
|
-
if (
|
|
2059
|
+
const S = m.closest(".tag-node"), _ = m.closest('[data-type="text"]');
|
|
2060
|
+
if (S || _) {
|
|
2051
2061
|
h.preventDefault(), h.stopPropagation();
|
|
2052
2062
|
const A = window.getSelection();
|
|
2053
2063
|
A && A.removeAllRanges();
|
|
@@ -2057,8 +2067,8 @@ const _e = /* @__PURE__ */ Bt(Rt), { RangePicker: Gt } = rt, Ht = ({ host: t, on
|
|
|
2057
2067
|
m.closest('[data-type="variable"]') || (P.current = { x: h.clientX, y: h.clientY }, k.current = !1, m.closest(".file-remove-btn") && (h.preventDefault(), h.stopPropagation()));
|
|
2058
2068
|
}, be = (h) => {
|
|
2059
2069
|
if (!h.target.closest('[data-type="variable"]') && P.current) {
|
|
2060
|
-
const
|
|
2061
|
-
(
|
|
2070
|
+
const M = Math.abs(h.clientX - P.current.x), S = Math.abs(h.clientY - P.current.y);
|
|
2071
|
+
(M > 3 || S > 3) && (k.current = !0);
|
|
2062
2072
|
}
|
|
2063
2073
|
}, X = (h) => {
|
|
2064
2074
|
if (h.target.closest('[data-type="variable"]')) {
|
|
@@ -2067,7 +2077,7 @@ const _e = /* @__PURE__ */ Bt(Rt), { RangePicker: Gt } = rt, Ht = ({ host: t, on
|
|
|
2067
2077
|
}
|
|
2068
2078
|
P.current = null, k.current = !1;
|
|
2069
2079
|
}, ue = (h) => {
|
|
2070
|
-
if (
|
|
2080
|
+
if (i)
|
|
2071
2081
|
return;
|
|
2072
2082
|
const m = h.target;
|
|
2073
2083
|
if (m.closest('[data-type="datepicker"]'))
|
|
@@ -2078,25 +2088,25 @@ const _e = /* @__PURE__ */ Bt(Rt), { RangePicker: Gt } = rt, Ht = ({ host: t, on
|
|
|
2078
2088
|
}
|
|
2079
2089
|
if (t.length === 0)
|
|
2080
2090
|
return;
|
|
2081
|
-
const
|
|
2091
|
+
const S = (B, K) => {
|
|
2082
2092
|
if (!n.current) return;
|
|
2083
2093
|
Array.from(n.current.children).forEach((O) => {
|
|
2084
2094
|
if (O !== B)
|
|
2085
2095
|
if (K)
|
|
2086
2096
|
O.dataset.prevDisplay === void 0 && (O.dataset.prevDisplay = O.style.display || ""), O.style.setProperty("display", "none", "important");
|
|
2087
2097
|
else if (O.dataset.prevDisplay !== void 0) {
|
|
2088
|
-
const
|
|
2089
|
-
|
|
2098
|
+
const ie = O.dataset.prevDisplay;
|
|
2099
|
+
ie ? O.style.display = ie : O.style.removeProperty("display"), delete O.dataset.prevDisplay;
|
|
2090
2100
|
} else
|
|
2091
2101
|
O.style.removeProperty("display");
|
|
2092
2102
|
});
|
|
2093
|
-
},
|
|
2094
|
-
if (
|
|
2103
|
+
}, _ = m.closest(".rte-textarea-toggle");
|
|
2104
|
+
if (_) {
|
|
2095
2105
|
h.preventDefault(), h.stopPropagation();
|
|
2096
|
-
const B =
|
|
2097
|
-
|
|
2098
|
-
const
|
|
2099
|
-
if (
|
|
2106
|
+
const B = _.closest(".rte-textarea-wrapper"), K = B?.querySelector('[data-type="textarea"]'), O = !(_.getAttribute("data-expanded") === "true");
|
|
2107
|
+
_.setAttribute("data-expanded", String(O)), _.textContent = O ? "收起" : "展开", B && B.classList.toggle("rte-textarea-expanded", O);
|
|
2108
|
+
const ie = B?.closest(".rte-textarea-required");
|
|
2109
|
+
if (ie ? ie.classList.toggle("rte-textarea-overlay", O) : B && B.classList.toggle("rte-textarea-overlay", O), K)
|
|
2100
2110
|
if (O)
|
|
2101
2111
|
K.classList.add("rte-textarea-expanded"), K.style.maxHeight = "none", K.style.height = "100%";
|
|
2102
2112
|
else {
|
|
@@ -2111,13 +2121,13 @@ const _e = /* @__PURE__ */ Bt(Rt), { RangePicker: Gt } = rt, Ht = ({ host: t, on
|
|
|
2111
2121
|
if (A) {
|
|
2112
2122
|
h.preventDefault(), h.stopPropagation();
|
|
2113
2123
|
const B = A.closest(".rte-richtext-wrapper"), K = B?.querySelector('[data-type="richtext"]'), O = !(A.getAttribute("data-expanded") === "true");
|
|
2114
|
-
((
|
|
2115
|
-
|
|
2124
|
+
((le, ge) => {
|
|
2125
|
+
le.setAttribute("data-expanded", String(ge)), le.innerHTML = ge ? '<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>';
|
|
2116
2126
|
})(A, O);
|
|
2117
2127
|
const me = B?.closest(".rte-richtext-required");
|
|
2118
2128
|
me ? me.classList.toggle("rte-richtext-expanded", O) : B && B.classList.toggle("rte-richtext-expanded", O);
|
|
2119
2129
|
const J = B?.closest(".exclusion-wrapper") || B?.parentElement;
|
|
2120
|
-
K && (O ? (K.style.height = "100%", K.style.overflow = "auto") : (K.style.height = "", K.style.overflow = "")), J && (J.classList.toggle("rte-richtext-host-expanded", O),
|
|
2130
|
+
K && (O ? (K.style.height = "100%", K.style.overflow = "auto") : (K.style.height = "", K.style.overflow = "")), J && (J.classList.toggle("rte-richtext-host-expanded", O), S(J, O)), n.current && n.current.classList.toggle("rte-richtext-fullscreen-active", O);
|
|
2121
2131
|
return;
|
|
2122
2132
|
}
|
|
2123
2133
|
if (m.closest('[data-type="text"]')) {
|
|
@@ -2137,7 +2147,7 @@ const _e = /* @__PURE__ */ Bt(Rt), { RangePicker: Gt } = rt, Ht = ({ host: t, on
|
|
|
2137
2147
|
return;
|
|
2138
2148
|
setTimeout(() => {
|
|
2139
2149
|
const B = window.getSelection();
|
|
2140
|
-
B && !B.isCollapsed ||
|
|
2150
|
+
B && !B.isCollapsed || Me(n);
|
|
2141
2151
|
}, 10);
|
|
2142
2152
|
return;
|
|
2143
2153
|
}
|
|
@@ -2151,23 +2161,23 @@ const _e = /* @__PURE__ */ Bt(Rt), { RangePicker: Gt } = rt, Ht = ({ host: t, on
|
|
|
2151
2161
|
const Y = m.closest('[data-type="upload"]');
|
|
2152
2162
|
if (Y) {
|
|
2153
2163
|
const B = Y.dataset.key;
|
|
2154
|
-
B && (
|
|
2164
|
+
B && (g(B), o.current?.click());
|
|
2155
2165
|
return;
|
|
2156
2166
|
}
|
|
2157
2167
|
}, he = (h) => {
|
|
2158
2168
|
const C = h.target.closest('[data-type="variable"]');
|
|
2159
2169
|
if (C) {
|
|
2160
|
-
const
|
|
2161
|
-
if (
|
|
2162
|
-
const
|
|
2163
|
-
if (
|
|
2164
|
-
let G = 0, D =
|
|
2165
|
-
|
|
2170
|
+
const M = window.getSelection();
|
|
2171
|
+
if (M) {
|
|
2172
|
+
const S = document.createRange(), _ = C.textContent || "";
|
|
2173
|
+
if (_.replace(/\u200B/g, "")) {
|
|
2174
|
+
let G = 0, D = _.length;
|
|
2175
|
+
_.startsWith("") && (G = 1), _.endsWith("") && _.length > 1 && (D = _.length - 1);
|
|
2166
2176
|
const j = C.firstChild;
|
|
2167
|
-
j && j.nodeType === Node.TEXT_NODE ? (
|
|
2177
|
+
j && j.nodeType === Node.TEXT_NODE ? (S.setStart(j, G), S.setEnd(j, D)) : S.selectNodeContents(C);
|
|
2168
2178
|
} else
|
|
2169
|
-
|
|
2170
|
-
|
|
2179
|
+
S.selectNodeContents(C), S.collapse(!0);
|
|
2180
|
+
M.removeAllRanges(), M.addRange(S);
|
|
2171
2181
|
}
|
|
2172
2182
|
}
|
|
2173
2183
|
}, ye = () => {
|
|
@@ -2178,102 +2188,102 @@ const _e = /* @__PURE__ */ Bt(Rt), { RangePicker: Gt } = rt, Ht = ({ host: t, on
|
|
|
2178
2188
|
}
|
|
2179
2189
|
return;
|
|
2180
2190
|
}
|
|
2181
|
-
if (
|
|
2182
|
-
const
|
|
2183
|
-
if (
|
|
2184
|
-
let
|
|
2185
|
-
const
|
|
2191
|
+
if (Me(n), n.current && n.current.querySelectorAll('[data-type="variable"]').forEach((C) => {
|
|
2192
|
+
const M = C.querySelector(".variable-info-icon");
|
|
2193
|
+
if (M) {
|
|
2194
|
+
let S = !1;
|
|
2195
|
+
const _ = document.createTreeWalker(
|
|
2186
2196
|
C,
|
|
2187
2197
|
NodeFilter.SHOW_TEXT,
|
|
2188
2198
|
{
|
|
2189
|
-
acceptNode: (A) =>
|
|
2199
|
+
acceptNode: (A) => M.contains(A) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT
|
|
2190
2200
|
}
|
|
2191
2201
|
);
|
|
2192
|
-
for (;
|
|
2193
|
-
if (
|
|
2194
|
-
|
|
2202
|
+
for (; _.nextNode(); )
|
|
2203
|
+
if (_.currentNode.textContent?.replace(/[\u200B\n]/g, "").trim()) {
|
|
2204
|
+
S = !0;
|
|
2195
2205
|
break;
|
|
2196
2206
|
}
|
|
2197
|
-
|
|
2207
|
+
S ? M.classList.add("hidden") : M.classList.remove("hidden");
|
|
2198
2208
|
}
|
|
2199
2209
|
}), Be(n, t, a), Pe(n, t, a, F), !n.current) return;
|
|
2200
2210
|
t.filter((m) => m.type === "multi-variable" && m.key).forEach((m) => {
|
|
2201
2211
|
if (!m.key) return;
|
|
2202
|
-
const C = m.maxCount || 9,
|
|
2203
|
-
for (let j = 0; j <
|
|
2212
|
+
const C = m.maxCount || 9, M = re[m.key] || 1, S = [];
|
|
2213
|
+
for (let j = 0; j < M; j++) {
|
|
2204
2214
|
const Y = `${m.key}_${j}`, B = n.current.querySelector(
|
|
2205
2215
|
`[data-type="variable"][data-key="${Y}"][data-multi-key="${m.key}"]`
|
|
2206
2216
|
);
|
|
2207
2217
|
if (B) {
|
|
2208
2218
|
const K = B.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
2209
|
-
|
|
2219
|
+
S.push(K);
|
|
2210
2220
|
}
|
|
2211
2221
|
}
|
|
2212
|
-
const A = (
|
|
2222
|
+
const A = (S[S.length - 1] || "") === "";
|
|
2213
2223
|
let G = !1, D = -1;
|
|
2214
|
-
for (let j = 0; j <
|
|
2215
|
-
if (
|
|
2224
|
+
for (let j = 0; j < S.length - 1; j++)
|
|
2225
|
+
if (S[j] === "") {
|
|
2216
2226
|
G = !0, D = j;
|
|
2217
2227
|
break;
|
|
2218
2228
|
}
|
|
2219
2229
|
if (G && D >= 0) {
|
|
2220
2230
|
const j = window.getSelection();
|
|
2221
2231
|
if (j && j.rangeCount > 0) {
|
|
2222
|
-
const O = j.getRangeAt(0),
|
|
2232
|
+
const O = j.getRangeAt(0), ie = O.startContainer, me = ie.nodeType === Node.ELEMENT_NODE ? ie.closest('[data-type="variable"][data-multi-key]') : ie.parentElement?.closest('[data-type="variable"][data-multi-key]');
|
|
2223
2233
|
if (me) {
|
|
2224
2234
|
const J = me.dataset.key;
|
|
2225
2235
|
if (J) {
|
|
2226
|
-
const
|
|
2227
|
-
|
|
2228
|
-
const ge =
|
|
2236
|
+
const le = document.createRange();
|
|
2237
|
+
le.setStartBefore(me), le.setEnd(O.startContainer, O.startOffset);
|
|
2238
|
+
const ge = le.toString().length;
|
|
2229
2239
|
U.current = { key: J, offset: ge };
|
|
2230
2240
|
}
|
|
2231
2241
|
}
|
|
2232
2242
|
}
|
|
2233
|
-
const Y = [...
|
|
2243
|
+
const Y = [...S];
|
|
2234
2244
|
for (let O = D; O < Y.length - 1; O++)
|
|
2235
2245
|
Y[O] = Y[O + 1];
|
|
2236
2246
|
Y.pop();
|
|
2237
2247
|
const B = {};
|
|
2238
|
-
Y.forEach((O,
|
|
2239
|
-
O && (B[`${m.key}_${
|
|
2248
|
+
Y.forEach((O, ie) => {
|
|
2249
|
+
O && (B[`${m.key}_${ie}`] = O);
|
|
2240
2250
|
});
|
|
2241
2251
|
const K = Math.max(A ? Y.length : Y.length + 1, 1);
|
|
2242
2252
|
n.current.querySelectorAll(
|
|
2243
2253
|
'[data-type="variable"]'
|
|
2244
2254
|
).forEach((O) => {
|
|
2245
|
-
const
|
|
2246
|
-
if (
|
|
2255
|
+
const ie = O.dataset.key, me = O.dataset.multiKey;
|
|
2256
|
+
if (ie && me !== m.key) {
|
|
2247
2257
|
const J = O.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
2248
|
-
J && (B[
|
|
2258
|
+
J && (B[ie] = J);
|
|
2249
2259
|
}
|
|
2250
|
-
}), n.current.__tempVariableValues = B,
|
|
2260
|
+
}), n.current.__tempVariableValues = B, l((O) => ({
|
|
2251
2261
|
...O,
|
|
2252
2262
|
[m.key]: K
|
|
2253
2263
|
}));
|
|
2254
2264
|
return;
|
|
2255
2265
|
}
|
|
2256
2266
|
if (!A) {
|
|
2257
|
-
const j =
|
|
2267
|
+
const j = M - 1, Y = `${m.key}_${j}`, B = n.current.querySelector(
|
|
2258
2268
|
`[data-type="variable"][data-key="${Y}"][data-multi-key="${m.key}"]`
|
|
2259
2269
|
);
|
|
2260
|
-
if (B && B.innerText.replace(/[\u200B\n]/g, "").trim().length > 0 &&
|
|
2270
|
+
if (B && B.innerText.replace(/[\u200B\n]/g, "").trim().length > 0 && M < C) {
|
|
2261
2271
|
const oe = window.getSelection();
|
|
2262
2272
|
if (oe && oe.rangeCount > 0) {
|
|
2263
|
-
const O = oe.getRangeAt(0),
|
|
2273
|
+
const O = oe.getRangeAt(0), ie = O.startContainer, me = ie.nodeType === Node.ELEMENT_NODE ? ie.closest('[data-type="variable"][data-multi-key]') : ie.parentElement?.closest('[data-type="variable"][data-multi-key]');
|
|
2264
2274
|
if (me) {
|
|
2265
2275
|
const J = me.dataset.key;
|
|
2266
2276
|
if (J) {
|
|
2267
|
-
const
|
|
2268
|
-
|
|
2269
|
-
const ge =
|
|
2277
|
+
const le = document.createRange();
|
|
2278
|
+
le.setStartBefore(me), le.setEnd(O.startContainer, O.startOffset);
|
|
2279
|
+
const ge = le.toString().length;
|
|
2270
2280
|
U.current = { key: J, offset: ge };
|
|
2271
2281
|
}
|
|
2272
2282
|
}
|
|
2273
2283
|
}
|
|
2274
|
-
|
|
2284
|
+
l((O) => ({
|
|
2275
2285
|
...O,
|
|
2276
|
-
[m.key]:
|
|
2286
|
+
[m.key]: M + 1
|
|
2277
2287
|
}));
|
|
2278
2288
|
}
|
|
2279
2289
|
}
|
|
@@ -2282,8 +2292,8 @@ const _e = /* @__PURE__ */ Bt(Rt), { RangePicker: Gt } = rt, Ht = ({ host: t, on
|
|
|
2282
2292
|
ze(() => {
|
|
2283
2293
|
const h = n.current;
|
|
2284
2294
|
if (!h) return;
|
|
2285
|
-
const m = /* @__PURE__ */ new Map(), C = (
|
|
2286
|
-
const A =
|
|
2295
|
+
const m = /* @__PURE__ */ new Map(), C = (_) => {
|
|
2296
|
+
const A = _.target, G = _.relatedTarget;
|
|
2287
2297
|
!A || !n.current || !n.current.contains(A) || G && n.current.contains(G) || setTimeout(() => {
|
|
2288
2298
|
if (n.current) {
|
|
2289
2299
|
if (t.length === 0) {
|
|
@@ -2291,17 +2301,17 @@ const _e = /* @__PURE__ */ Bt(Rt), { RangePicker: Gt } = rt, Ht = ({ host: t, on
|
|
|
2291
2301
|
F(D.length > 0);
|
|
2292
2302
|
return;
|
|
2293
2303
|
}
|
|
2294
|
-
|
|
2304
|
+
Me(n), Be(n, t, a), Pe(n, t, a, F);
|
|
2295
2305
|
}
|
|
2296
2306
|
}, 0);
|
|
2297
2307
|
};
|
|
2298
2308
|
h.addEventListener("blur", C, !0);
|
|
2299
|
-
const
|
|
2309
|
+
const M = () => {
|
|
2300
2310
|
if (!n.current) return;
|
|
2301
2311
|
m.forEach((G, D) => {
|
|
2302
2312
|
D.removeEventListener("blur", G, !1);
|
|
2303
2313
|
}), m.clear();
|
|
2304
|
-
const
|
|
2314
|
+
const _ = n.current.querySelectorAll(
|
|
2305
2315
|
'[data-type="variable"][data-multi-key]'
|
|
2306
2316
|
), A = (G) => {
|
|
2307
2317
|
G.stopPropagation(), G.stopImmediatePropagation();
|
|
@@ -2312,7 +2322,7 @@ const _e = /* @__PURE__ */ Bt(Rt), { RangePicker: Gt } = rt, Ht = ({ host: t, on
|
|
|
2312
2322
|
if (!j || !n.current.contains(j))
|
|
2313
2323
|
return;
|
|
2314
2324
|
let Y = !1;
|
|
2315
|
-
if (m.forEach((
|
|
2325
|
+
if (m.forEach((le, ge) => {
|
|
2316
2326
|
(ge === j || ge.contains(D)) && (Y = !0);
|
|
2317
2327
|
}), !Y)
|
|
2318
2328
|
return;
|
|
@@ -2330,37 +2340,37 @@ const _e = /* @__PURE__ */ Bt(Rt), { RangePicker: Gt } = rt, Ht = ({ host: t, on
|
|
|
2330
2340
|
});
|
|
2331
2341
|
const J = /[、,,\s]+/;
|
|
2332
2342
|
if (J.test(me)) {
|
|
2333
|
-
const
|
|
2334
|
-
console.log("[Blur Event] 拆分前的内容:", me), console.log("[Blur Event] 拆分后的部分:",
|
|
2335
|
-
const ke =
|
|
2343
|
+
const le = me.split(J).map((Te) => Te.trim()).filter((Te) => Te.length > 0);
|
|
2344
|
+
console.log("[Blur Event] 拆分前的内容:", me), console.log("[Blur Event] 拆分后的部分:", le);
|
|
2345
|
+
const ke = le.slice(0, 9);
|
|
2336
2346
|
if (console.log("[Blur Event] 有效的部分(最多9个):", ke), ke.length > 1) {
|
|
2337
|
-
const Te = t.find((
|
|
2347
|
+
const Te = t.find((Ne) => Ne.type === "multi-variable" && Ne.key === B);
|
|
2338
2348
|
if (Te) {
|
|
2339
|
-
const
|
|
2340
|
-
for (let ve = 0; ve <
|
|
2349
|
+
const Ne = re[B] || 1, He = parseInt(oe, 10), Fe = Te.maxCount || 9, Se = [];
|
|
2350
|
+
for (let ve = 0; ve < Ne; ve++) {
|
|
2341
2351
|
const qe = `${B}_${ve}`, Ae = n.current.querySelector(
|
|
2342
2352
|
`[data-type="variable"][data-key="${qe}"][data-multi-key="${B}"]`
|
|
2343
2353
|
);
|
|
2344
2354
|
if (Ae) {
|
|
2345
2355
|
const Le = Ae.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
2346
|
-
|
|
2356
|
+
Se.push(Le);
|
|
2347
2357
|
}
|
|
2348
2358
|
}
|
|
2349
|
-
console.log("[Blur Event] 拆分前的所有值:",
|
|
2350
|
-
const Ee =
|
|
2359
|
+
console.log("[Blur Event] 拆分前的所有值:", Se), console.log("[Blur Event] 当前索引:", He), console.log("[Blur Event] 要插入的值:", ke), Se.splice(He, 1, ...ke);
|
|
2360
|
+
const Ee = Se.slice(0, Fe);
|
|
2351
2361
|
console.log("[Blur Event] 拆分后的所有值:", Ee), Ee.length > 0 && Ee[Ee.length - 1] !== "" && Ee.length < Fe && Ee.push("");
|
|
2352
|
-
const Qe = Math.max(Ee.length, 1),
|
|
2362
|
+
const Qe = Math.max(Ee.length, 1), Ie = {};
|
|
2353
2363
|
Ee.forEach((ve, qe) => {
|
|
2354
|
-
ve && (
|
|
2364
|
+
ve && (Ie[`${B}_${qe}`] = ve);
|
|
2355
2365
|
}), n.current.querySelectorAll(
|
|
2356
2366
|
'[data-type="variable"]'
|
|
2357
2367
|
).forEach((ve) => {
|
|
2358
2368
|
const qe = ve.dataset.key, Ae = ve.dataset.multiKey;
|
|
2359
2369
|
if (qe && Ae !== B) {
|
|
2360
2370
|
const Le = ve.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
2361
|
-
Le && (
|
|
2371
|
+
Le && (Ie[qe] = Le);
|
|
2362
2372
|
}
|
|
2363
|
-
}), n.current.__tempVariableValues =
|
|
2373
|
+
}), n.current.__tempVariableValues = Ie, l((ve) => ({
|
|
2364
2374
|
...ve,
|
|
2365
2375
|
[B]: Qe
|
|
2366
2376
|
}));
|
|
@@ -2368,46 +2378,46 @@ const _e = /* @__PURE__ */ Bt(Rt), { RangePicker: Gt } = rt, Ht = ({ host: t, on
|
|
|
2368
2378
|
}
|
|
2369
2379
|
}
|
|
2370
2380
|
};
|
|
2371
|
-
|
|
2381
|
+
_.forEach((G) => {
|
|
2372
2382
|
G.addEventListener("blur", A, !1), m.set(G, A);
|
|
2373
2383
|
});
|
|
2374
|
-
},
|
|
2375
|
-
|
|
2384
|
+
}, S = setTimeout(() => {
|
|
2385
|
+
M();
|
|
2376
2386
|
}, 0);
|
|
2377
2387
|
return () => {
|
|
2378
|
-
clearTimeout(
|
|
2379
|
-
A.removeEventListener("blur",
|
|
2388
|
+
clearTimeout(S), h.removeEventListener("blur", C, !0), m.forEach((_, A) => {
|
|
2389
|
+
A.removeEventListener("blur", _, !1);
|
|
2380
2390
|
}), m.clear();
|
|
2381
2391
|
};
|
|
2382
2392
|
}, [t, re, a]);
|
|
2383
2393
|
const xe = (h) => {
|
|
2384
|
-
if (
|
|
2394
|
+
if (i) {
|
|
2385
2395
|
h.preventDefault();
|
|
2386
2396
|
return;
|
|
2387
2397
|
}
|
|
2388
2398
|
const m = window.getSelection();
|
|
2389
2399
|
if (m && m.rangeCount > 0) {
|
|
2390
2400
|
const C = m.anchorNode;
|
|
2391
|
-
let
|
|
2392
|
-
if (C && (C.nodeType === Node.ELEMENT_NODE ?
|
|
2401
|
+
let M = null;
|
|
2402
|
+
if (C && (C.nodeType === Node.ELEMENT_NODE ? M = C.closest('[data-type="text"]') : C.nodeType === Node.TEXT_NODE && C.parentElement && (M = C.parentElement.closest('[data-type="text"]'))), M) {
|
|
2393
2403
|
if (h.preventDefault(), h.stopPropagation(), n.current) {
|
|
2394
|
-
const
|
|
2404
|
+
const S = n.current.querySelector(
|
|
2395
2405
|
'[data-type="variable"], [data-type="upload"]'
|
|
2396
2406
|
);
|
|
2397
|
-
|
|
2407
|
+
S && S.focus();
|
|
2398
2408
|
}
|
|
2399
2409
|
return;
|
|
2400
2410
|
}
|
|
2401
2411
|
}
|
|
2402
2412
|
if (T && m && m.rangeCount > 0) {
|
|
2403
2413
|
const C = m.anchorNode;
|
|
2404
|
-
let
|
|
2405
|
-
if (C && (C.nodeType === Node.ELEMENT_NODE ?
|
|
2414
|
+
let M = null;
|
|
2415
|
+
if (C && (C.nodeType === Node.ELEMENT_NODE ? M = C.closest(".tag-node") : C.nodeType === Node.TEXT_NODE && C.parentElement && (M = C.parentElement.closest(".tag-node"))), M) {
|
|
2406
2416
|
if (h.preventDefault(), h.stopPropagation(), n.current) {
|
|
2407
|
-
const
|
|
2417
|
+
const S = n.current.querySelector(
|
|
2408
2418
|
'[data-type="variable"], [data-type="upload"]'
|
|
2409
2419
|
);
|
|
2410
|
-
|
|
2420
|
+
S && S.focus();
|
|
2411
2421
|
}
|
|
2412
2422
|
return;
|
|
2413
2423
|
}
|
|
@@ -2422,32 +2432,32 @@ const _e = /* @__PURE__ */ Bt(Rt), { RangePicker: Gt } = rt, Ht = ({ host: t, on
|
|
|
2422
2432
|
if (h.key === "Backspace") {
|
|
2423
2433
|
const C = window.getSelection();
|
|
2424
2434
|
if (C && C.rangeCount > 0) {
|
|
2425
|
-
const
|
|
2435
|
+
const M = C.getRangeAt(0), S = C.anchorNode;
|
|
2426
2436
|
if (T) {
|
|
2427
2437
|
let A = null, G = null;
|
|
2428
|
-
if (
|
|
2438
|
+
if (S && (S.nodeType === Node.ELEMENT_NODE ? (A = S.closest(".tag-node"), G = S.closest('[data-type="text"]')) : S.nodeType === Node.TEXT_NODE && S.parentElement && (A = S.parentElement.closest(".tag-node"), G = S.parentElement.closest('[data-type="text"]'))), (A || G) && M.collapsed && M.startOffset === 0) {
|
|
2429
2439
|
h.preventDefault();
|
|
2430
2440
|
return;
|
|
2431
2441
|
}
|
|
2432
2442
|
}
|
|
2433
|
-
let
|
|
2434
|
-
if (
|
|
2443
|
+
let _ = null;
|
|
2444
|
+
if (S && (S.nodeType === Node.ELEMENT_NODE ? _ = S.closest(
|
|
2435
2445
|
'[data-type="variable"]'
|
|
2436
|
-
) :
|
|
2446
|
+
) : S.nodeType === Node.TEXT_NODE && S.parentElement && (_ = S.parentElement.closest(
|
|
2437
2447
|
'[data-type="variable"]'
|
|
2438
|
-
))),
|
|
2439
|
-
if (!
|
|
2448
|
+
))), _) {
|
|
2449
|
+
if (!M.collapsed)
|
|
2440
2450
|
return;
|
|
2441
|
-
const A =
|
|
2451
|
+
const A = _.innerText;
|
|
2442
2452
|
if (A === "" || A === "") {
|
|
2443
2453
|
h.preventDefault();
|
|
2444
2454
|
return;
|
|
2445
2455
|
}
|
|
2446
|
-
if (
|
|
2456
|
+
if (M.startOffset === 0) {
|
|
2447
2457
|
h.preventDefault();
|
|
2448
2458
|
return;
|
|
2449
2459
|
}
|
|
2450
|
-
if (A.startsWith("") &&
|
|
2460
|
+
if (A.startsWith("") && M.startOffset === 1) {
|
|
2451
2461
|
h.preventDefault();
|
|
2452
2462
|
return;
|
|
2453
2463
|
}
|
|
@@ -2455,21 +2465,21 @@ const _e = /* @__PURE__ */ Bt(Rt), { RangePicker: Gt } = rt, Ht = ({ host: t, on
|
|
|
2455
2465
|
}
|
|
2456
2466
|
}
|
|
2457
2467
|
}, we = () => {
|
|
2458
|
-
if (
|
|
2468
|
+
if (d || i || e || !H || !n.current) return;
|
|
2459
2469
|
if (t.length === 0) {
|
|
2460
|
-
const
|
|
2461
|
-
if (!
|
|
2462
|
-
|
|
2470
|
+
const _ = n.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "";
|
|
2471
|
+
if (!_) return;
|
|
2472
|
+
x(_, _);
|
|
2463
2473
|
return;
|
|
2464
2474
|
}
|
|
2465
2475
|
const h = n.current;
|
|
2466
2476
|
let m = "";
|
|
2467
|
-
const C = {},
|
|
2468
|
-
if (!(
|
|
2469
|
-
if (
|
|
2470
|
-
m += (
|
|
2471
|
-
else if (
|
|
2472
|
-
const A =
|
|
2477
|
+
const C = {}, M = (_) => {
|
|
2478
|
+
if (!(_.nodeType === Node.ELEMENT_NODE && _.style.display === "none")) {
|
|
2479
|
+
if (_.nodeType === Node.TEXT_NODE)
|
|
2480
|
+
m += (_.textContent || "").replace(/\u200B/g, "");
|
|
2481
|
+
else if (_.nodeType === Node.ELEMENT_NODE) {
|
|
2482
|
+
const A = _, G = A.dataset.type, D = A.dataset.key;
|
|
2473
2483
|
if (G === "variable" && D) {
|
|
2474
2484
|
let j = "";
|
|
2475
2485
|
const Y = document.createTreeWalker(
|
|
@@ -2519,26 +2529,26 @@ const _e = /* @__PURE__ */ Bt(Rt), { RangePicker: Gt } = rt, Ht = ({ host: t, on
|
|
|
2519
2529
|
C[D] = a[D] ?? null, a[D] && (m += ` [附带文件: ${a[D]?.name}] `);
|
|
2520
2530
|
else {
|
|
2521
2531
|
if (A.classList.contains("tag-close-btn") || A.classList.contains("file-remove-btn")) return;
|
|
2522
|
-
A.getAttribute("contenteditable") === "false" && !G && A.classList.contains("tag-node") ? m += A.innerText : A.childNodes.forEach(
|
|
2532
|
+
A.getAttribute("contenteditable") === "false" && !G && A.classList.contains("tag-node") ? m += A.innerText : A.childNodes.forEach(M);
|
|
2523
2533
|
}
|
|
2524
2534
|
}
|
|
2525
2535
|
}
|
|
2526
2536
|
};
|
|
2527
|
-
if (h.childNodes.forEach(
|
|
2528
|
-
const
|
|
2529
|
-
|
|
2530
|
-
const A = C[
|
|
2531
|
-
A != null && (A instanceof File ?
|
|
2532
|
-
(D) => D.type === "multi-variable" && D.key ===
|
|
2537
|
+
if (h.childNodes.forEach(M), m = m.trim(), !m) return;
|
|
2538
|
+
const S = new FormData();
|
|
2539
|
+
S.append("fullPrompt", m), Object.keys(C).forEach((_) => {
|
|
2540
|
+
const A = C[_];
|
|
2541
|
+
A != null && (A instanceof File ? S.append(_, A) : Array.isArray(A) ? t.some(
|
|
2542
|
+
(D) => D.type === "multi-variable" && D.key === _
|
|
2533
2543
|
) ? A.forEach((D) => {
|
|
2534
|
-
D != null && D !== "" &&
|
|
2544
|
+
D != null && D !== "" && S.append(_, String(D));
|
|
2535
2545
|
}) : A.forEach((D, j) => {
|
|
2536
|
-
D != null && (D instanceof File ?
|
|
2537
|
-
}) : typeof A == "string" ?
|
|
2538
|
-
}),
|
|
2546
|
+
D != null && (D instanceof File ? S.append(`${_}[${j}]`, D) : typeof D == "string" ? S.append(`${_}[${j}]`, D) : S.append(`${_}[${j}]`, String(D)));
|
|
2547
|
+
}) : typeof A == "string" ? S.append(_, A) : S.append(_, String(A)));
|
|
2548
|
+
}), x(S, m);
|
|
2539
2549
|
}, Ce = {
|
|
2540
|
-
...
|
|
2541
|
-
...
|
|
2550
|
+
...u ? { width: typeof u == "number" ? `${u}px` : u } : {},
|
|
2551
|
+
...f ? { border: f } : {},
|
|
2542
2552
|
...s ? { background: s } : {}
|
|
2543
2553
|
};
|
|
2544
2554
|
return /* @__PURE__ */ Z(
|
|
@@ -2546,7 +2556,7 @@ const _e = /* @__PURE__ */ Bt(Rt), { RangePicker: Gt } = rt, Ht = ({ host: t, on
|
|
|
2546
2556
|
{
|
|
2547
2557
|
className: "rich-text-editor",
|
|
2548
2558
|
style: Ce,
|
|
2549
|
-
"data-disabled":
|
|
2559
|
+
"data-disabled": i,
|
|
2550
2560
|
children: [
|
|
2551
2561
|
/* @__PURE__ */ E(
|
|
2552
2562
|
"div",
|
|
@@ -2587,7 +2597,7 @@ const _e = /* @__PURE__ */ Bt(Rt), { RangePicker: Gt } = rt, Ht = ({ host: t, on
|
|
|
2587
2597
|
{
|
|
2588
2598
|
placement: "top",
|
|
2589
2599
|
menu: {
|
|
2590
|
-
items:
|
|
2600
|
+
items: I.map((h) => ({
|
|
2591
2601
|
key: h.key,
|
|
2592
2602
|
label: /* @__PURE__ */ Z("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
|
|
2593
2603
|
h.icon && /* @__PURE__ */ E("i", { className: h.icon }),
|
|
@@ -2599,8 +2609,8 @@ const _e = /* @__PURE__ */ Bt(Rt), { RangePicker: Gt } = rt, Ht = ({ host: t, on
|
|
|
2599
2609
|
}))
|
|
2600
2610
|
},
|
|
2601
2611
|
trigger: ["click"],
|
|
2602
|
-
disabled:
|
|
2603
|
-
children: /* @__PURE__ */ Z("div", { className: "rte-agent-badge", style: { cursor:
|
|
2612
|
+
disabled: i || d,
|
|
2613
|
+
children: /* @__PURE__ */ Z("div", { className: "rte-agent-badge", style: { cursor: I.length > 0 ? "pointer" : "default" }, children: [
|
|
2604
2614
|
/* @__PURE__ */ E("i", { className: "iconfont icon-zhinengti" }),
|
|
2605
2615
|
/* @__PURE__ */ E("span", { className: "rte-agent-text", children: "智能体" })
|
|
2606
2616
|
] })
|
|
@@ -2611,7 +2621,7 @@ const _e = /* @__PURE__ */ Bt(Rt), { RangePicker: Gt } = rt, Ht = ({ host: t, on
|
|
|
2611
2621
|
(() => {
|
|
2612
2622
|
const h = t.find((C) => C.type === "tag");
|
|
2613
2623
|
if (!h || !h.text) return null;
|
|
2614
|
-
const m =
|
|
2624
|
+
const m = I.find((C) => C.label === h.text);
|
|
2615
2625
|
return !m || m.points === void 0 || m.points === null ? null : /* @__PURE__ */ Z("div", { className: "rte-points-badge", children: [
|
|
2616
2626
|
/* @__PURE__ */ E("i", { className: "iconfont icon-jifen", style: { marginRight: "4px" } }),
|
|
2617
2627
|
/* @__PURE__ */ Z("span", { style: { fontSize: "16px" }, children: [
|
|
@@ -2625,42 +2635,42 @@ const _e = /* @__PURE__ */ Bt(Rt), { RangePicker: Gt } = rt, Ht = ({ host: t, on
|
|
|
2625
2635
|
{
|
|
2626
2636
|
type: "button",
|
|
2627
2637
|
onClick: we,
|
|
2628
|
-
disabled:
|
|
2638
|
+
disabled: d || i || e || !H,
|
|
2629
2639
|
className: "rich-text-editor-send-button",
|
|
2630
|
-
children:
|
|
2640
|
+
children: d || e ? /* @__PURE__ */ E("span", { className: "rte-send-spinner" }) : /* @__PURE__ */ E("i", { className: "iconfont icon-fasong" })
|
|
2631
2641
|
}
|
|
2632
2642
|
)
|
|
2633
2643
|
] })
|
|
2634
2644
|
] }),
|
|
2635
|
-
|
|
2636
|
-
if (!document.body.contains(
|
|
2645
|
+
b?.anchorEl && (() => {
|
|
2646
|
+
if (!document.body.contains(b.anchorEl))
|
|
2637
2647
|
return null;
|
|
2638
2648
|
let h = "", m = {
|
|
2639
2649
|
background: "var(--neutral-800, #262626)"
|
|
2640
2650
|
};
|
|
2641
|
-
if (
|
|
2651
|
+
if (b.type === "upload")
|
|
2642
2652
|
h = t.find(
|
|
2643
|
-
(
|
|
2653
|
+
(S) => S.type === "upload" && S.key === b.key
|
|
2644
2654
|
)?.tooltip || "";
|
|
2645
|
-
else if (
|
|
2646
|
-
h =
|
|
2647
|
-
else if (
|
|
2648
|
-
h =
|
|
2649
|
-
else if (
|
|
2650
|
-
h =
|
|
2651
|
-
else if (
|
|
2652
|
-
const
|
|
2653
|
-
if (
|
|
2654
|
-
const
|
|
2655
|
-
h = /* @__PURE__ */ E("div", { style: { width: 120, height: 120, display: "flex", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ E("img", { src:
|
|
2655
|
+
else if (b.type === "tag")
|
|
2656
|
+
h = b.anchorEl.dataset.tooltip || "";
|
|
2657
|
+
else if (b.type === "upload-label")
|
|
2658
|
+
h = b.anchorEl.dataset.fileName || "";
|
|
2659
|
+
else if (b.type === "variable")
|
|
2660
|
+
h = b.anchorEl.dataset.tooltip || "";
|
|
2661
|
+
else if (b.type === "upload-preview") {
|
|
2662
|
+
const M = a[b.key];
|
|
2663
|
+
if (M && M.type && M.type.startsWith("image/")) {
|
|
2664
|
+
const S = URL.createObjectURL(M);
|
|
2665
|
+
h = /* @__PURE__ */ E("div", { style: { width: 120, height: 120, display: "flex", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ E("img", { src: S, style: { maxWidth: 120, maxHeight: 120, objectFit: "contain" } }) }), m = {
|
|
2656
2666
|
background: "#fff",
|
|
2657
2667
|
padding: 4
|
|
2658
|
-
}, setTimeout(() => URL.revokeObjectURL(
|
|
2668
|
+
}, setTimeout(() => URL.revokeObjectURL(S), 1e3);
|
|
2659
2669
|
} else
|
|
2660
2670
|
h = "";
|
|
2661
2671
|
}
|
|
2662
2672
|
if (!h) return null;
|
|
2663
|
-
const C =
|
|
2673
|
+
const C = b.type === "upload-preview" ? "#0A0A0A" : "#fff";
|
|
2664
2674
|
return Xe(
|
|
2665
2675
|
/* @__PURE__ */ E(
|
|
2666
2676
|
st,
|
|
@@ -2676,10 +2686,10 @@ const _e = /* @__PURE__ */ Bt(Rt), { RangePicker: Gt } = rt, Ht = ({ host: t, on
|
|
|
2676
2686
|
{
|
|
2677
2687
|
style: {
|
|
2678
2688
|
position: "fixed",
|
|
2679
|
-
left: `${
|
|
2680
|
-
top: `${
|
|
2681
|
-
width: `${
|
|
2682
|
-
height: `${
|
|
2689
|
+
left: `${b.anchorEl.getBoundingClientRect().left}px`,
|
|
2690
|
+
top: `${b.anchorEl.getBoundingClientRect().top}px`,
|
|
2691
|
+
width: `${b.anchorEl.offsetWidth}px`,
|
|
2692
|
+
height: `${b.anchorEl.offsetHeight}px`,
|
|
2683
2693
|
pointerEvents: "none"
|
|
2684
2694
|
}
|
|
2685
2695
|
}
|
|
@@ -2729,26 +2739,26 @@ const Ue = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
2729
2739
|
{ label: "30页", value: 30 }
|
|
2730
2740
|
], jt = ({
|
|
2731
2741
|
autoLoading: t,
|
|
2732
|
-
batchSize:
|
|
2733
|
-
loadingProgress:
|
|
2734
|
-
loadIcon:
|
|
2735
|
-
onBatchSizeChange:
|
|
2742
|
+
batchSize: x,
|
|
2743
|
+
loadingProgress: d,
|
|
2744
|
+
loadIcon: i,
|
|
2745
|
+
onBatchSizeChange: u,
|
|
2736
2746
|
onLoadNextPage: T,
|
|
2737
|
-
onStartAutoLoad:
|
|
2747
|
+
onStartAutoLoad: I,
|
|
2738
2748
|
onStopLoad: $
|
|
2739
|
-
}) => t &&
|
|
2740
|
-
|
|
2749
|
+
}) => t && d ? /* @__PURE__ */ Z("div", { className: "auto_load_progress", children: [
|
|
2750
|
+
i || /* @__PURE__ */ E("img", { src: Ue, alt: "自动加载", width: 14, height: 14 }),
|
|
2741
2751
|
/* @__PURE__ */ Z("span", { children: [
|
|
2742
2752
|
"正在加载第",
|
|
2743
|
-
|
|
2753
|
+
d.currentPage,
|
|
2744
2754
|
"/",
|
|
2745
|
-
|
|
2755
|
+
d.totalPages,
|
|
2746
2756
|
"页"
|
|
2747
2757
|
] }),
|
|
2748
2758
|
/* @__PURE__ */ E(
|
|
2749
|
-
|
|
2759
|
+
it,
|
|
2750
2760
|
{
|
|
2751
|
-
percent:
|
|
2761
|
+
percent: d.percentage,
|
|
2752
2762
|
type: "line",
|
|
2753
2763
|
size: [160, 8]
|
|
2754
2764
|
}
|
|
@@ -2778,9 +2788,9 @@ const Ue = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
2778
2788
|
"div",
|
|
2779
2789
|
{
|
|
2780
2790
|
className: "auto_load_btn",
|
|
2781
|
-
onClick: t ? void 0 :
|
|
2791
|
+
onClick: t ? void 0 : I,
|
|
2782
2792
|
children: [
|
|
2783
|
-
|
|
2793
|
+
i || /* @__PURE__ */ E("img", { src: Ue, alt: "自动加载", width: 14, height: 14 }),
|
|
2784
2794
|
/* @__PURE__ */ E("span", { children: "自动加载" })
|
|
2785
2795
|
]
|
|
2786
2796
|
}
|
|
@@ -2788,8 +2798,8 @@ const Ue = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
2788
2798
|
/* @__PURE__ */ E(
|
|
2789
2799
|
Ge,
|
|
2790
2800
|
{
|
|
2791
|
-
value:
|
|
2792
|
-
onChange:
|
|
2801
|
+
value: x,
|
|
2802
|
+
onChange: u,
|
|
2793
2803
|
options: Wt,
|
|
2794
2804
|
disabled: t,
|
|
2795
2805
|
size: "small",
|
|
@@ -2802,22 +2812,22 @@ const Ue = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
2802
2812
|
)
|
|
2803
2813
|
] }), Ut = ({
|
|
2804
2814
|
current: t,
|
|
2805
|
-
loadIcon:
|
|
2806
|
-
pageSize:
|
|
2807
|
-
total:
|
|
2808
|
-
cachedPages:
|
|
2815
|
+
loadIcon: x,
|
|
2816
|
+
pageSize: d,
|
|
2817
|
+
total: i,
|
|
2818
|
+
cachedPages: u,
|
|
2809
2819
|
loadedCount: T,
|
|
2810
|
-
autoLoading:
|
|
2820
|
+
autoLoading: I = !1,
|
|
2811
2821
|
loadingProgress: $,
|
|
2812
2822
|
onChange: w,
|
|
2813
2823
|
onLoadNextPage: e,
|
|
2814
2824
|
onStartAutoLoad: q,
|
|
2815
|
-
onStopLoading:
|
|
2825
|
+
onStopLoading: f
|
|
2816
2826
|
}) => {
|
|
2817
|
-
const [s, r] = ne(5), n = Math.ceil(
|
|
2827
|
+
const [s, r] = ne(5), n = Math.ceil(i / d), o = Ye(() => u.length >= n, [u, n]), a = () => Array.from(
|
|
2818
2828
|
{ length: n },
|
|
2819
|
-
(
|
|
2820
|
-
).filter((
|
|
2829
|
+
(g, b) => b + 1
|
|
2830
|
+
).filter((g) => !u.includes(g)).slice(0, s);
|
|
2821
2831
|
return /* @__PURE__ */ Z("div", { className: "pagination_footer", children: [
|
|
2822
2832
|
/* @__PURE__ */ Z("div", { className: "pagination_leftWrap", children: [
|
|
2823
2833
|
/* @__PURE__ */ Z("span", { className: "pagination_total", children: [
|
|
@@ -2830,50 +2840,50 @@ const Ue = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
2830
2840
|
"已加载: ",
|
|
2831
2841
|
T,
|
|
2832
2842
|
"/",
|
|
2833
|
-
|
|
2843
|
+
i,
|
|
2834
2844
|
"条数据"
|
|
2835
2845
|
] }),
|
|
2836
2846
|
!o && /* @__PURE__ */ E(
|
|
2837
2847
|
jt,
|
|
2838
2848
|
{
|
|
2839
|
-
loadIcon:
|
|
2840
|
-
autoLoading:
|
|
2849
|
+
loadIcon: x || void 0,
|
|
2850
|
+
autoLoading: I,
|
|
2841
2851
|
batchSize: s,
|
|
2842
2852
|
loadingProgress: $,
|
|
2843
2853
|
disabled: !e || !q,
|
|
2844
2854
|
onBatchSizeChange: r,
|
|
2845
2855
|
onLoadNextPage: () => e?.(),
|
|
2846
2856
|
onStartAutoLoad: () => {
|
|
2847
|
-
const
|
|
2848
|
-
q?.(
|
|
2857
|
+
const y = a();
|
|
2858
|
+
q?.(y);
|
|
2849
2859
|
},
|
|
2850
|
-
onStopLoad: () =>
|
|
2860
|
+
onStopLoad: () => f?.()
|
|
2851
2861
|
}
|
|
2852
2862
|
)
|
|
2853
2863
|
] }),
|
|
2854
2864
|
/* @__PURE__ */ E(
|
|
2855
|
-
|
|
2865
|
+
lt,
|
|
2856
2866
|
{
|
|
2857
2867
|
current: t,
|
|
2858
|
-
pageSize:
|
|
2859
|
-
total:
|
|
2860
|
-
onChange: (
|
|
2868
|
+
pageSize: d,
|
|
2869
|
+
total: i,
|
|
2870
|
+
onChange: (y) => w(y),
|
|
2861
2871
|
showSizeChanger: !1,
|
|
2862
2872
|
showQuickJumper: !1,
|
|
2863
|
-
showTotal: (
|
|
2864
|
-
itemRender: (
|
|
2865
|
-
const
|
|
2866
|
-
return
|
|
2873
|
+
showTotal: (y, g) => "",
|
|
2874
|
+
itemRender: (y, g, b) => {
|
|
2875
|
+
const V = u.includes(y);
|
|
2876
|
+
return g === "prev" || g === "next" || g === "jump-prev" || g === "jump-next" ? /* @__PURE__ */ E("div", { className: "pageBox", children: b }) : /* @__PURE__ */ Z(
|
|
2867
2877
|
"div",
|
|
2868
2878
|
{
|
|
2869
2879
|
className: "pageBox",
|
|
2870
2880
|
style: {
|
|
2871
|
-
backgroundColor: t ===
|
|
2872
|
-
color: t ===
|
|
2881
|
+
backgroundColor: t === y ? "#2563EB" : "#f5f5f5",
|
|
2882
|
+
color: t === y ? "#fff" : V ? "#171717" : "#a3a3a3"
|
|
2873
2883
|
},
|
|
2874
2884
|
children: [
|
|
2875
|
-
|
|
2876
|
-
!
|
|
2885
|
+
y,
|
|
2886
|
+
!V && /* @__PURE__ */ E("span", { className: "unload_spot" })
|
|
2877
2887
|
]
|
|
2878
2888
|
}
|
|
2879
2889
|
);
|
|
@@ -2883,24 +2893,24 @@ const Ue = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
2883
2893
|
] });
|
|
2884
2894
|
}, Yt = (t) => {
|
|
2885
2895
|
const {
|
|
2886
|
-
loading:
|
|
2887
|
-
autoLoading:
|
|
2888
|
-
loadingProgress:
|
|
2889
|
-
columns:
|
|
2896
|
+
loading: x,
|
|
2897
|
+
autoLoading: d,
|
|
2898
|
+
loadingProgress: i,
|
|
2899
|
+
columns: u = [],
|
|
2890
2900
|
dataSource: T = [],
|
|
2891
|
-
total:
|
|
2901
|
+
total: I,
|
|
2892
2902
|
current: $,
|
|
2893
2903
|
pageSize: w,
|
|
2894
2904
|
cachedPages: e,
|
|
2895
2905
|
onChangePage: q,
|
|
2896
|
-
onLoadNextPage:
|
|
2906
|
+
onLoadNextPage: f,
|
|
2897
2907
|
onStartAutoLoad: s,
|
|
2898
2908
|
onStopLoading: r,
|
|
2899
2909
|
...n
|
|
2900
2910
|
} = t, o = Q(null), a = ae(
|
|
2901
|
-
(
|
|
2902
|
-
q(
|
|
2903
|
-
key: `${(
|
|
2911
|
+
(p) => {
|
|
2912
|
+
q(p), e.includes(p) && o.current?.scrollTo({
|
|
2913
|
+
key: `${(p - 1) * w + 1}`
|
|
2904
2914
|
});
|
|
2905
2915
|
},
|
|
2906
2916
|
[$]
|
|
@@ -2911,7 +2921,7 @@ const Ue = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
2911
2921
|
{
|
|
2912
2922
|
ref: o,
|
|
2913
2923
|
...n,
|
|
2914
|
-
columns:
|
|
2924
|
+
columns: u,
|
|
2915
2925
|
dataSource: T,
|
|
2916
2926
|
pagination: !1,
|
|
2917
2927
|
virtual: !0
|
|
@@ -2920,16 +2930,16 @@ const Ue = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
2920
2930
|
/* @__PURE__ */ E(
|
|
2921
2931
|
Ut,
|
|
2922
2932
|
{
|
|
2923
|
-
loading:
|
|
2924
|
-
autoLoading:
|
|
2925
|
-
loadingProgress:
|
|
2933
|
+
loading: x,
|
|
2934
|
+
autoLoading: d,
|
|
2935
|
+
loadingProgress: i,
|
|
2926
2936
|
current: $,
|
|
2927
2937
|
pageSize: w,
|
|
2928
|
-
total:
|
|
2938
|
+
total: I,
|
|
2929
2939
|
loadedCount: T.length,
|
|
2930
2940
|
cachedPages: e,
|
|
2931
2941
|
onChange: a,
|
|
2932
|
-
onLoadNextPage:
|
|
2942
|
+
onLoadNextPage: f,
|
|
2933
2943
|
onStartAutoLoad: s,
|
|
2934
2944
|
onStopLoading: r
|
|
2935
2945
|
}
|
|
@@ -3045,75 +3055,75 @@ Yt.__docgenInfo = {
|
|
|
3045
3055
|
};
|
|
3046
3056
|
const Kt = ({
|
|
3047
3057
|
texts: t = [],
|
|
3048
|
-
placeholder:
|
|
3049
|
-
animationSpeed:
|
|
3050
|
-
autoPlay:
|
|
3051
|
-
value:
|
|
3058
|
+
placeholder: x = "请输入内容",
|
|
3059
|
+
animationSpeed: d = 100,
|
|
3060
|
+
autoPlay: i = !0,
|
|
3061
|
+
value: u,
|
|
3052
3062
|
onChange: T,
|
|
3053
|
-
...
|
|
3063
|
+
...I
|
|
3054
3064
|
}) => {
|
|
3055
|
-
const [$, w] = ne(""), [e, q] = ne(0), [
|
|
3065
|
+
const [$, w] = ne(""), [e, q] = ne(0), [f, s] = ne(!1), [r, n] = ne(!1), [o, a] = ne(!1), p = Q(void 0), y = Q(void 0), g = Q(t), b = Q(e), V = Q(r), k = Q($);
|
|
3056
3066
|
de(() => {
|
|
3057
|
-
|
|
3067
|
+
g.current = t, b.current = e, V.current = r, k.current = $;
|
|
3058
3068
|
});
|
|
3059
|
-
const P = ae((
|
|
3060
|
-
let
|
|
3069
|
+
const P = ae((l, c) => {
|
|
3070
|
+
let v = 0;
|
|
3061
3071
|
a(!0);
|
|
3062
3072
|
const L = () => {
|
|
3063
|
-
|
|
3073
|
+
v < l.length ? (w(l.slice(0, v + 1)), v++, y.current = window.setTimeout(L, d)) : (a(!1), c?.());
|
|
3064
3074
|
};
|
|
3065
3075
|
L();
|
|
3066
|
-
}, [
|
|
3076
|
+
}, [d]), H = ae((l) => {
|
|
3067
3077
|
let c = k.current.length;
|
|
3068
|
-
const
|
|
3069
|
-
c > 0 ? (w(k.current.slice(0, c - 1)), c--,
|
|
3078
|
+
const v = () => {
|
|
3079
|
+
c > 0 ? (w(k.current.slice(0, c - 1)), c--, y.current = window.setTimeout(v, d / 2)) : l?.();
|
|
3070
3080
|
};
|
|
3071
|
-
|
|
3072
|
-
}, [
|
|
3073
|
-
if (
|
|
3081
|
+
v();
|
|
3082
|
+
}, [d]), F = ae(() => {
|
|
3083
|
+
if (g.current.length === 0 || V.current) return;
|
|
3074
3084
|
s(!0);
|
|
3075
|
-
const
|
|
3085
|
+
const l = g.current[b.current];
|
|
3076
3086
|
k.current ? H(() => {
|
|
3077
|
-
P(
|
|
3078
|
-
|
|
3079
|
-
q((c) => (c + 1) %
|
|
3087
|
+
P(l, () => {
|
|
3088
|
+
p.current = window.setTimeout(() => {
|
|
3089
|
+
q((c) => (c + 1) % g.current.length), s(!1);
|
|
3080
3090
|
}, 2e3);
|
|
3081
3091
|
});
|
|
3082
|
-
}) : P(
|
|
3083
|
-
|
|
3084
|
-
q((c) => (c + 1) %
|
|
3092
|
+
}) : P(l, () => {
|
|
3093
|
+
p.current = window.setTimeout(() => {
|
|
3094
|
+
q((c) => (c + 1) % g.current.length), s(!1);
|
|
3085
3095
|
}, 2e3);
|
|
3086
3096
|
});
|
|
3087
3097
|
}, [H, P]);
|
|
3088
|
-
return de(() => (
|
|
3089
|
-
|
|
3090
|
-
}), [e, r,
|
|
3091
|
-
!
|
|
3092
|
-
}, [e,
|
|
3098
|
+
return de(() => (i && t.length > 0 && !r && F(), () => {
|
|
3099
|
+
p.current && window.clearTimeout(p.current), y.current && window.clearTimeout(y.current);
|
|
3100
|
+
}), [e, r, i, t.length, F]), de(() => {
|
|
3101
|
+
!f && i && t.length > 0 && !r && F();
|
|
3102
|
+
}, [e, f, i, t.length, r, F]), /* @__PURE__ */ Z("div", { style: { position: "relative" }, children: [
|
|
3093
3103
|
/* @__PURE__ */ E(
|
|
3094
3104
|
Ke,
|
|
3095
3105
|
{
|
|
3096
|
-
...
|
|
3097
|
-
value:
|
|
3098
|
-
onChange: (
|
|
3099
|
-
T?.(
|
|
3106
|
+
...I,
|
|
3107
|
+
value: u,
|
|
3108
|
+
onChange: (l) => {
|
|
3109
|
+
T?.(l.target.value), I.onChange?.(l);
|
|
3100
3110
|
},
|
|
3101
|
-
onFocus: (
|
|
3102
|
-
n(!0),
|
|
3111
|
+
onFocus: (l) => {
|
|
3112
|
+
n(!0), p.current && window.clearTimeout(p.current), y.current && window.clearTimeout(y.current), s(!1), a(!1), I.onFocus?.(l);
|
|
3103
3113
|
},
|
|
3104
|
-
onBlur: (
|
|
3105
|
-
n(!1), !
|
|
3114
|
+
onBlur: (l) => {
|
|
3115
|
+
n(!1), !u && t.length > 0 && (w(""), q(0)), I.onBlur?.(l);
|
|
3106
3116
|
},
|
|
3107
|
-
placeholder: r ||
|
|
3117
|
+
placeholder: r || u ? x : $ || x,
|
|
3108
3118
|
style: {
|
|
3109
3119
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3110
|
-
...
|
|
3120
|
+
...I.style,
|
|
3111
3121
|
position: "relative",
|
|
3112
3122
|
zIndex: 1
|
|
3113
3123
|
}
|
|
3114
3124
|
}
|
|
3115
3125
|
),
|
|
3116
|
-
!r && !
|
|
3126
|
+
!r && !u && $ && /* @__PURE__ */ Z(
|
|
3117
3127
|
"div",
|
|
3118
3128
|
{
|
|
3119
3129
|
style: {
|
|
@@ -3206,17 +3216,17 @@ Kt.__docgenInfo = {
|
|
|
3206
3216
|
const Xt = ({
|
|
3207
3217
|
texts: t = [],
|
|
3208
3218
|
// 动态文案数组,默认为空数组
|
|
3209
|
-
placeholder:
|
|
3219
|
+
placeholder: x = "请输入内容",
|
|
3210
3220
|
// 占位符文本
|
|
3211
|
-
animationSpeed:
|
|
3221
|
+
animationSpeed: d = 100,
|
|
3212
3222
|
// 打字机动画速度,毫秒
|
|
3213
|
-
autoPlay:
|
|
3223
|
+
autoPlay: i = !0,
|
|
3214
3224
|
// 是否自动播放动画
|
|
3215
|
-
value:
|
|
3225
|
+
value: u = "",
|
|
3216
3226
|
// 受控模式的值
|
|
3217
3227
|
onChange: T,
|
|
3218
3228
|
// 受控模式的变化回调
|
|
3219
|
-
onSubmit:
|
|
3229
|
+
onSubmit: I,
|
|
3220
3230
|
// 提交回调
|
|
3221
3231
|
maxLength: $ = 500,
|
|
3222
3232
|
// 最大字符数限制
|
|
@@ -3226,71 +3236,71 @@ const Xt = ({
|
|
|
3226
3236
|
// 提交按钮文本
|
|
3227
3237
|
disabled: q = !1,
|
|
3228
3238
|
// 是否禁用组件
|
|
3229
|
-
rows:
|
|
3239
|
+
rows: f = 4,
|
|
3230
3240
|
// 文本域行数
|
|
3231
3241
|
style: s,
|
|
3232
3242
|
// 自定义样式
|
|
3233
3243
|
...r
|
|
3234
3244
|
// 其他原生属性
|
|
3235
3245
|
}) => {
|
|
3236
|
-
const [n, o] = ne(""), [a,
|
|
3246
|
+
const [n, o] = ne(""), [a, p] = ne(0), [y, g] = ne(!1), [b, V] = ne(!1), [k, P] = ne(!1), [H, F] = ne(u || ""), U = Q(void 0), R = Q(void 0), ee = Q(t), re = Q(a), l = Q(b), c = Q(n), v = Q(null);
|
|
3237
3247
|
de(() => {
|
|
3238
|
-
ee.current = t, re.current = a,
|
|
3248
|
+
ee.current = t, re.current = a, l.current = b, c.current = n;
|
|
3239
3249
|
});
|
|
3240
3250
|
const L = ae((X, ue) => {
|
|
3241
3251
|
let he = 0;
|
|
3242
3252
|
P(!0);
|
|
3243
3253
|
const ye = () => {
|
|
3244
|
-
he < X.length ? (o(X.slice(0, he + 1)), he++, R.current = window.setTimeout(ye,
|
|
3254
|
+
he < X.length ? (o(X.slice(0, he + 1)), he++, R.current = window.setTimeout(ye, d)) : (P(!1), ue?.());
|
|
3245
3255
|
};
|
|
3246
3256
|
ye();
|
|
3247
|
-
}, [
|
|
3257
|
+
}, [d]), N = ae((X) => {
|
|
3248
3258
|
let ue = c.current.length;
|
|
3249
3259
|
const he = () => {
|
|
3250
|
-
ue > 0 ? (o(c.current.slice(0, ue - 1)), ue--, R.current = window.setTimeout(he,
|
|
3260
|
+
ue > 0 ? (o(c.current.slice(0, ue - 1)), ue--, R.current = window.setTimeout(he, d / 2)) : X?.();
|
|
3251
3261
|
};
|
|
3252
3262
|
he();
|
|
3253
|
-
}, [
|
|
3254
|
-
if (ee.current.length === 0 ||
|
|
3255
|
-
|
|
3263
|
+
}, [d]), W = ae(() => {
|
|
3264
|
+
if (ee.current.length === 0 || l.current) return;
|
|
3265
|
+
g(!0);
|
|
3256
3266
|
const X = ee.current[re.current];
|
|
3257
|
-
c.current ?
|
|
3267
|
+
c.current ? N(() => {
|
|
3258
3268
|
L(X, () => {
|
|
3259
3269
|
U.current = window.setTimeout(() => {
|
|
3260
|
-
|
|
3270
|
+
p((ue) => (ue + 1) % ee.current.length), g(!1);
|
|
3261
3271
|
}, 2e3);
|
|
3262
3272
|
});
|
|
3263
3273
|
}) : L(X, () => {
|
|
3264
3274
|
U.current = window.setTimeout(() => {
|
|
3265
|
-
|
|
3275
|
+
p((ue) => (ue + 1) % ee.current.length), g(!1);
|
|
3266
3276
|
}, 2e3);
|
|
3267
3277
|
});
|
|
3268
|
-
}, [
|
|
3269
|
-
de(() => (
|
|
3278
|
+
}, [N, L]);
|
|
3279
|
+
de(() => (i && t.length > 0 && !b && W(), () => {
|
|
3270
3280
|
U.current && window.clearTimeout(U.current), R.current && window.clearTimeout(R.current);
|
|
3271
|
-
}), [a,
|
|
3272
|
-
!
|
|
3273
|
-
}, [a,
|
|
3281
|
+
}), [a, b, i, t.length, W]), de(() => {
|
|
3282
|
+
!y && i && t.length > 0 && !b && W();
|
|
3283
|
+
}, [a, y, i, t.length, b, W]);
|
|
3274
3284
|
const z = (X) => {
|
|
3275
|
-
|
|
3285
|
+
V(!0), U.current && window.clearTimeout(U.current), R.current && window.clearTimeout(R.current), g(!1), P(!1), r.onFocus?.(X);
|
|
3276
3286
|
}, te = (X) => {
|
|
3277
|
-
|
|
3287
|
+
V(!1), !u && t.length > 0 && (o(""), p(0)), r.onBlur?.(X);
|
|
3278
3288
|
}, se = (X) => {
|
|
3279
3289
|
const ue = X.target.value;
|
|
3280
3290
|
$ && ue.length > $ || (T ? T(ue) : F(ue), r.onChange?.(X));
|
|
3281
3291
|
}, ce = () => {
|
|
3282
|
-
const X = T ?
|
|
3283
|
-
X.trim() && !q && (
|
|
3292
|
+
const X = T ? u : H;
|
|
3293
|
+
X.trim() && !q && (I?.(X), T || F(""));
|
|
3284
3294
|
}, pe = (X) => {
|
|
3285
3295
|
(X.ctrlKey || X.metaKey) && X.key === "Enter" && (X.preventDefault(), ce()), r.onKeyDown?.(X);
|
|
3286
|
-
}, fe = T ?
|
|
3296
|
+
}, fe = T ? u : H, be = q || !fe.trim() || ($ ? fe.length > $ : !1);
|
|
3287
3297
|
return /* @__PURE__ */ Z("div", { style: { position: "relative", ...s }, children: [
|
|
3288
3298
|
/* @__PURE__ */ Z("div", { style: { position: "relative" }, children: [
|
|
3289
3299
|
/* @__PURE__ */ E(
|
|
3290
3300
|
"textarea",
|
|
3291
3301
|
{
|
|
3292
|
-
ref:
|
|
3293
|
-
value: T ?
|
|
3302
|
+
ref: v,
|
|
3303
|
+
value: T ? u : H,
|
|
3294
3304
|
onChange: se,
|
|
3295
3305
|
onFocus: (X) => {
|
|
3296
3306
|
X.target.style.borderColor = "#1890ff", X.target.style.boxShadow = "0 0 0 2px rgba(24, 144, 255, 0.2)", z(X);
|
|
@@ -3299,13 +3309,13 @@ const Xt = ({
|
|
|
3299
3309
|
X.target.style.borderColor = "#d9d9d9", X.target.style.boxShadow = "none", te(X);
|
|
3300
3310
|
},
|
|
3301
3311
|
onKeyDown: pe,
|
|
3302
|
-
placeholder:
|
|
3312
|
+
placeholder: b || fe ? x : "",
|
|
3303
3313
|
maxLength: $,
|
|
3304
|
-
rows:
|
|
3314
|
+
rows: f,
|
|
3305
3315
|
disabled: q,
|
|
3306
3316
|
style: {
|
|
3307
3317
|
width: "100%",
|
|
3308
|
-
minHeight: `${
|
|
3318
|
+
minHeight: `${f * 24 + 16}px`,
|
|
3309
3319
|
padding: "8px 60px 8px 12px",
|
|
3310
3320
|
// 右侧留出按钮空间
|
|
3311
3321
|
border: "1px solid #d9d9d9",
|
|
@@ -3323,7 +3333,7 @@ const Xt = ({
|
|
|
3323
3333
|
...r
|
|
3324
3334
|
}
|
|
3325
3335
|
),
|
|
3326
|
-
!
|
|
3336
|
+
!b && !fe && n && /* @__PURE__ */ Z(
|
|
3327
3337
|
"div",
|
|
3328
3338
|
{
|
|
3329
3339
|
style: {
|
|
@@ -3505,43 +3515,43 @@ Xt.__docgenInfo = {
|
|
|
3505
3515
|
};
|
|
3506
3516
|
const Je = ({
|
|
3507
3517
|
src: t,
|
|
3508
|
-
poster:
|
|
3509
|
-
width:
|
|
3510
|
-
height:
|
|
3511
|
-
videoWidth:
|
|
3518
|
+
poster: x,
|
|
3519
|
+
width: d = 300,
|
|
3520
|
+
height: i,
|
|
3521
|
+
videoWidth: u,
|
|
3512
3522
|
// 参数保留但不使用,由CSS控制
|
|
3513
3523
|
videoHeight: T,
|
|
3514
3524
|
// 参数保留但不使用,由CSS控制
|
|
3515
|
-
showPlayButton:
|
|
3525
|
+
showPlayButton: I = !0,
|
|
3516
3526
|
autoPlayOnHover: $ = !0,
|
|
3517
3527
|
onClick: w,
|
|
3518
3528
|
onVideoLoaded: e,
|
|
3519
3529
|
onVideoPlay: q,
|
|
3520
|
-
onVideoPause:
|
|
3530
|
+
onVideoPause: f,
|
|
3521
3531
|
onVideoEnded: s,
|
|
3522
3532
|
className: r,
|
|
3523
3533
|
style: n,
|
|
3524
3534
|
...o
|
|
3525
3535
|
}) => {
|
|
3526
|
-
const a = Q(null), [
|
|
3527
|
-
a.current && (a.current.play(),
|
|
3536
|
+
const a = Q(null), [p, y] = ne(!1), [g, b] = ne(!1), [V, k] = ne(!1), P = ae(() => {
|
|
3537
|
+
a.current && (a.current.play(), y(!0), q?.());
|
|
3528
3538
|
}, [q]), H = ae(() => {
|
|
3529
|
-
a.current && (a.current.pause(),
|
|
3530
|
-
}, [
|
|
3531
|
-
L.stopPropagation(),
|
|
3532
|
-
}, [
|
|
3533
|
-
|
|
3534
|
-
}, [$,
|
|
3535
|
-
|
|
3536
|
-
}, [$,
|
|
3539
|
+
a.current && (a.current.pause(), y(!1), f?.());
|
|
3540
|
+
}, [f]), F = ae((L) => {
|
|
3541
|
+
L.stopPropagation(), p ? H() : P();
|
|
3542
|
+
}, [p, P, H]), U = ae(() => {
|
|
3543
|
+
b(!0), $ && !p && P();
|
|
3544
|
+
}, [$, p, P]), R = ae(() => {
|
|
3545
|
+
b(!1), $ && p && H();
|
|
3546
|
+
}, [$, p, H]), ee = ae(() => {
|
|
3537
3547
|
k(!0), e?.();
|
|
3538
3548
|
}, [e]), re = ae(() => {
|
|
3539
|
-
|
|
3540
|
-
}, [q]),
|
|
3541
|
-
|
|
3542
|
-
}, [
|
|
3543
|
-
|
|
3544
|
-
}, [s]),
|
|
3549
|
+
y(!0), q?.();
|
|
3550
|
+
}, [q]), l = ae(() => {
|
|
3551
|
+
y(!1), f?.();
|
|
3552
|
+
}, [f]), c = ae(() => {
|
|
3553
|
+
y(!1), s?.();
|
|
3554
|
+
}, [s]), v = ae((L) => {
|
|
3545
3555
|
w?.(L);
|
|
3546
3556
|
}, [w]);
|
|
3547
3557
|
return /* @__PURE__ */ E(
|
|
@@ -3550,8 +3560,8 @@ const Je = ({
|
|
|
3550
3560
|
...o,
|
|
3551
3561
|
className: `video-card ${r || ""}`,
|
|
3552
3562
|
style: {
|
|
3553
|
-
width:
|
|
3554
|
-
height:
|
|
3563
|
+
width: d,
|
|
3564
|
+
height: i,
|
|
3555
3565
|
padding: 0,
|
|
3556
3566
|
overflow: "hidden",
|
|
3557
3567
|
cursor: w ? "pointer" : "default",
|
|
@@ -3562,32 +3572,32 @@ const Je = ({
|
|
|
3562
3572
|
bordered: !1,
|
|
3563
3573
|
onMouseEnter: U,
|
|
3564
3574
|
onMouseLeave: R,
|
|
3565
|
-
onClick:
|
|
3575
|
+
onClick: v,
|
|
3566
3576
|
children: /* @__PURE__ */ Z("div", { className: "video-card-container", children: [
|
|
3567
3577
|
/* @__PURE__ */ E(
|
|
3568
3578
|
"video",
|
|
3569
3579
|
{
|
|
3570
3580
|
ref: a,
|
|
3571
3581
|
src: t,
|
|
3572
|
-
poster:
|
|
3582
|
+
poster: x,
|
|
3573
3583
|
preload: "metadata",
|
|
3574
3584
|
onLoadedData: ee,
|
|
3575
3585
|
onPlay: re,
|
|
3576
|
-
onPause:
|
|
3586
|
+
onPause: l,
|
|
3577
3587
|
onEnded: c,
|
|
3578
3588
|
muted: !0,
|
|
3579
3589
|
loop: !0
|
|
3580
3590
|
}
|
|
3581
3591
|
),
|
|
3582
|
-
|
|
3592
|
+
I && /* @__PURE__ */ E(
|
|
3583
3593
|
"div",
|
|
3584
3594
|
{
|
|
3585
|
-
className: `video-play-button ${
|
|
3595
|
+
className: `video-play-button ${g ? "hovered" : ""}`,
|
|
3586
3596
|
onClick: F,
|
|
3587
|
-
children:
|
|
3597
|
+
children: p ? /* @__PURE__ */ E(ht, { className: "play-icon" }) : /* @__PURE__ */ E(gt, { className: "play-icon" })
|
|
3588
3598
|
}
|
|
3589
3599
|
),
|
|
3590
|
-
!
|
|
3600
|
+
!V && /* @__PURE__ */ E("div", { className: "video-loading-mask", children: /* @__PURE__ */ E("div", { className: "loading-spinner" }) })
|
|
3591
3601
|
] })
|
|
3592
3602
|
}
|
|
3593
3603
|
);
|
|
@@ -3693,12 +3703,12 @@ Je.__docgenInfo = {
|
|
|
3693
3703
|
}
|
|
3694
3704
|
}
|
|
3695
3705
|
};
|
|
3696
|
-
const Jt = (t) => [".mp4", ".webm", ".ogg", ".mov", ".avi", ".wmv", ".flv", ".mkv"].some((
|
|
3706
|
+
const Jt = (t) => [".mp4", ".webm", ".ogg", ".mov", ".avi", ".wmv", ".flv", ".mkv"].some((d) => t.toLowerCase().includes(d)), Qt = (t) => t.type ? t.type : Jt(t.url) ? "video" : "image", Zt = ({
|
|
3697
3707
|
items: t,
|
|
3698
|
-
columns:
|
|
3699
|
-
gap:
|
|
3700
|
-
responsive:
|
|
3701
|
-
breakpoints:
|
|
3708
|
+
columns: x,
|
|
3709
|
+
gap: d = 0,
|
|
3710
|
+
responsive: i = !0,
|
|
3711
|
+
breakpoints: u = {
|
|
3702
3712
|
xs: 1,
|
|
3703
3713
|
sm: 2,
|
|
3704
3714
|
md: 3,
|
|
@@ -3707,34 +3717,34 @@ const Jt = (t) => [".mp4", ".webm", ".ogg", ".mov", ".avi", ".wmv", ".flv", ".mk
|
|
|
3707
3717
|
xxl: 6
|
|
3708
3718
|
},
|
|
3709
3719
|
className: T,
|
|
3710
|
-
style:
|
|
3720
|
+
style: I,
|
|
3711
3721
|
onClick: $
|
|
3712
3722
|
}) => {
|
|
3713
|
-
const w = Q(null), [e, q] = ne(
|
|
3714
|
-
if (!
|
|
3715
|
-
return
|
|
3723
|
+
const w = Q(null), [e, q] = ne(x || u.md || 3), f = Q(/* @__PURE__ */ new Map()), s = ae(() => {
|
|
3724
|
+
if (!i || x)
|
|
3725
|
+
return x || u.md || 3;
|
|
3716
3726
|
const a = window.innerWidth;
|
|
3717
|
-
return a < 576 ?
|
|
3718
|
-
}, [
|
|
3727
|
+
return a < 576 ? u.xs || 1 : a < 768 ? u.sm || 2 : a < 992 ? u.md || 3 : a < 1200 ? u.lg || 4 : a < 1600 ? u.xl || 5 : u.xxl || 6;
|
|
3728
|
+
}, [i, x, u]), r = ae(() => {
|
|
3719
3729
|
if (!w.current) return;
|
|
3720
|
-
const a = e,
|
|
3730
|
+
const a = e, p = w.current, g = (p.offsetWidth - d * (a - 1)) / a, b = new Array(a).fill(0);
|
|
3721
3731
|
t.forEach((k, P) => {
|
|
3722
|
-
const H = k.id || P, F =
|
|
3732
|
+
const H = k.id || P, F = f.current.get(H);
|
|
3723
3733
|
if (!F) return;
|
|
3724
|
-
const U = Math.min(...
|
|
3725
|
-
F.style.position = "absolute", F.style.left = `${ee}px`, F.style.top = `${re}px`, F.style.width = `${
|
|
3734
|
+
const U = Math.min(...b), R = b.indexOf(U), ee = R * (g + d), re = b[R];
|
|
3735
|
+
F.style.position = "absolute", F.style.left = `${ee}px`, F.style.top = `${re}px`, F.style.width = `${g}px`, b[R] += F.offsetHeight + d;
|
|
3726
3736
|
});
|
|
3727
|
-
const
|
|
3728
|
-
|
|
3729
|
-
}, [t, e,
|
|
3737
|
+
const V = Math.max(...b);
|
|
3738
|
+
p.style.height = `${V}px`;
|
|
3739
|
+
}, [t, e, d]);
|
|
3730
3740
|
de(() => {
|
|
3731
3741
|
const a = () => {
|
|
3732
|
-
const
|
|
3733
|
-
|
|
3742
|
+
const p = s();
|
|
3743
|
+
p !== e && q(p);
|
|
3734
3744
|
};
|
|
3735
|
-
if (
|
|
3745
|
+
if (i)
|
|
3736
3746
|
return window.addEventListener("resize", a), a(), () => window.removeEventListener("resize", a);
|
|
3737
|
-
}, [
|
|
3747
|
+
}, [i, s, e]), de(() => {
|
|
3738
3748
|
const a = setTimeout(() => {
|
|
3739
3749
|
r();
|
|
3740
3750
|
}, 100);
|
|
@@ -3753,18 +3763,18 @@ const Jt = (t) => [".mp4", ".webm", ".ogg", ".mov", ".avi", ".wmv", ".flv", ".mk
|
|
|
3753
3763
|
style: {
|
|
3754
3764
|
position: "relative",
|
|
3755
3765
|
width: "100%",
|
|
3756
|
-
...
|
|
3766
|
+
...I
|
|
3757
3767
|
},
|
|
3758
|
-
children: t.map((a,
|
|
3759
|
-
const
|
|
3768
|
+
children: t.map((a, p) => {
|
|
3769
|
+
const y = a.id || p, g = Qt(a);
|
|
3760
3770
|
return /* @__PURE__ */ E(
|
|
3761
3771
|
"div",
|
|
3762
3772
|
{
|
|
3763
|
-
ref: (
|
|
3764
|
-
|
|
3773
|
+
ref: (b) => {
|
|
3774
|
+
b ? f.current.set(y, b) : f.current.delete(y);
|
|
3765
3775
|
},
|
|
3766
3776
|
className: "waterfall-item",
|
|
3767
|
-
children:
|
|
3777
|
+
children: g === "video" ? /* @__PURE__ */ E("div", { style: {
|
|
3768
3778
|
width: "100%",
|
|
3769
3779
|
position: "relative",
|
|
3770
3780
|
paddingBottom: "56.25%",
|
|
@@ -3791,7 +3801,7 @@ const Jt = (t) => [".mp4", ".webm", ".ogg", ".mov", ".avi", ".wmv", ".flv", ".mk
|
|
|
3791
3801
|
"img",
|
|
3792
3802
|
{
|
|
3793
3803
|
src: a.url,
|
|
3794
|
-
alt: `瀑布流图片 ${
|
|
3804
|
+
alt: `瀑布流图片 ${p + 1}`,
|
|
3795
3805
|
className: "waterfall-image",
|
|
3796
3806
|
onLoad: n,
|
|
3797
3807
|
onError: n,
|
|
@@ -3801,7 +3811,7 @@ const Jt = (t) => [".mp4", ".webm", ".ogg", ".mov", ".avi", ".wmv", ".flv", ".mk
|
|
|
3801
3811
|
}
|
|
3802
3812
|
)
|
|
3803
3813
|
},
|
|
3804
|
-
|
|
3814
|
+
y
|
|
3805
3815
|
);
|
|
3806
3816
|
})
|
|
3807
3817
|
}
|
|
@@ -3930,7 +3940,7 @@ const sn = {
|
|
|
3930
3940
|
}
|
|
3931
3941
|
};
|
|
3932
3942
|
export {
|
|
3933
|
-
|
|
3943
|
+
Nt as AdvancedTable,
|
|
3934
3944
|
xt as AppModal,
|
|
3935
3945
|
Ct as BackButton,
|
|
3936
3946
|
vt as Button,
|