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