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