bi-components-library 1.0.14 → 1.0.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bi-components-library.css +1 -1
- package/dist/index.es.js +686 -672
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +5 -5
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Ze, { useState as Q, useRef as F, useMemo as Xe, useCallback as U, useEffect as le, useLayoutEffect as Ge } from "react";
|
|
2
|
-
import { Button as we, Card as Pe, Modal as et, Table as Be, Flex as Fe, Spin as tt, Empty as nt, Select as Oe, Form as $e, Input as Ke, Space as
|
|
2
|
+
import { Button as we, Card as Pe, Modal as et, Table as Be, Flex as Fe, Spin as tt, Empty as nt, Select as Oe, Form as $e, Input as Ke, Space as rt, Dropdown as at, Tooltip as ot, Progress as lt, Pagination as st, theme as it } from "antd";
|
|
3
3
|
import { createFromIconfontCN as ct, LeftOutlined as ut, SearchOutlined as dt, ReloadOutlined as pt, InfoCircleOutlined as ft, SendOutlined as mt, PauseCircleOutlined as yt, PlayCircleOutlined as gt } from "@ant-design/icons";
|
|
4
4
|
import { createPortal as ht } from "react-dom";
|
|
5
5
|
var je = { exports: {} }, ke = {};
|
|
@@ -13,26 +13,26 @@ var je = { exports: {} }, ke = {};
|
|
|
13
13
|
* LICENSE file in the root directory of this source tree.
|
|
14
14
|
*/
|
|
15
15
|
var ze;
|
|
16
|
-
function
|
|
16
|
+
function vt() {
|
|
17
17
|
if (ze) return ke;
|
|
18
18
|
ze = 1;
|
|
19
|
-
var t = Symbol.for("react.transitional.element"),
|
|
20
|
-
function l(
|
|
21
|
-
var
|
|
22
|
-
if (y !== void 0 && (
|
|
19
|
+
var t = Symbol.for("react.transitional.element"), p = Symbol.for("react.fragment");
|
|
20
|
+
function l(r, o, y) {
|
|
21
|
+
var S = null;
|
|
22
|
+
if (y !== void 0 && (S = "" + y), o.key !== void 0 && (S = "" + o.key), "key" in o) {
|
|
23
23
|
y = {};
|
|
24
|
-
for (var
|
|
25
|
-
|
|
24
|
+
for (var h in o)
|
|
25
|
+
h !== "key" && (y[h] = o[h]);
|
|
26
26
|
} else y = o;
|
|
27
27
|
return o = y.ref, {
|
|
28
28
|
$$typeof: t,
|
|
29
|
-
type:
|
|
30
|
-
key:
|
|
29
|
+
type: r,
|
|
30
|
+
key: S,
|
|
31
31
|
ref: o !== void 0 ? o : null,
|
|
32
32
|
props: y
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
-
return ke.Fragment =
|
|
35
|
+
return ke.Fragment = p, ke.jsx = l, ke.jsxs = l, ke;
|
|
36
36
|
}
|
|
37
37
|
var Ne = {};
|
|
38
38
|
/**
|
|
@@ -45,7 +45,7 @@ var Ne = {};
|
|
|
45
45
|
* LICENSE file in the root directory of this source tree.
|
|
46
46
|
*/
|
|
47
47
|
var He;
|
|
48
|
-
function
|
|
48
|
+
function bt() {
|
|
49
49
|
return He || (He = 1, process.env.NODE_ENV !== "production" && function() {
|
|
50
50
|
function t(s) {
|
|
51
51
|
if (s == null) return null;
|
|
@@ -70,13 +70,13 @@ function vt() {
|
|
|
70
70
|
switch (typeof s.tag == "number" && console.error(
|
|
71
71
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
72
72
|
), s.$$typeof) {
|
|
73
|
-
case
|
|
73
|
+
case a:
|
|
74
74
|
return "Portal";
|
|
75
75
|
case A:
|
|
76
76
|
return (s.displayName || "Context") + ".Provider";
|
|
77
77
|
case T:
|
|
78
78
|
return (s._context.displayName || "Context") + ".Consumer";
|
|
79
|
-
case
|
|
79
|
+
case v:
|
|
80
80
|
var L = s.render;
|
|
81
81
|
return s = s.displayName, s || (s = L.displayName || L.name || "", s = s !== "" ? "ForwardRef(" + s + ")" : "ForwardRef"), s;
|
|
82
82
|
case P:
|
|
@@ -90,27 +90,27 @@ function vt() {
|
|
|
90
90
|
}
|
|
91
91
|
return null;
|
|
92
92
|
}
|
|
93
|
-
function
|
|
93
|
+
function p(s) {
|
|
94
94
|
return "" + s;
|
|
95
95
|
}
|
|
96
96
|
function l(s) {
|
|
97
97
|
try {
|
|
98
|
-
|
|
98
|
+
p(s);
|
|
99
99
|
var L = !1;
|
|
100
100
|
} catch {
|
|
101
101
|
L = !0;
|
|
102
102
|
}
|
|
103
103
|
if (L) {
|
|
104
104
|
L = console;
|
|
105
|
-
var Y = L.error,
|
|
105
|
+
var Y = L.error, re = typeof Symbol == "function" && Symbol.toStringTag && s[Symbol.toStringTag] || s.constructor.name || "Object";
|
|
106
106
|
return Y.call(
|
|
107
107
|
L,
|
|
108
108
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
109
|
-
|
|
110
|
-
),
|
|
109
|
+
re
|
|
110
|
+
), p(s);
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
function
|
|
113
|
+
function r(s) {
|
|
114
114
|
if (s === C) return "<>";
|
|
115
115
|
if (typeof s == "object" && s !== null && s.$$typeof === D)
|
|
116
116
|
return "<...>";
|
|
@@ -128,14 +128,14 @@ function vt() {
|
|
|
128
128
|
function y() {
|
|
129
129
|
return Error("react-stack-top-frame");
|
|
130
130
|
}
|
|
131
|
-
function
|
|
131
|
+
function S(s) {
|
|
132
132
|
if (K.call(s, "key")) {
|
|
133
133
|
var L = Object.getOwnPropertyDescriptor(s, "key").get;
|
|
134
134
|
if (L && L.isReactWarning) return !1;
|
|
135
135
|
}
|
|
136
136
|
return s.key !== void 0;
|
|
137
137
|
}
|
|
138
|
-
function
|
|
138
|
+
function h(s, L) {
|
|
139
139
|
function Y() {
|
|
140
140
|
I || (I = !0, console.error(
|
|
141
141
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
@@ -153,9 +153,9 @@ function vt() {
|
|
|
153
153
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
154
154
|
)), s = this.props.ref, s !== void 0 ? s : null;
|
|
155
155
|
}
|
|
156
|
-
function e(s, L, Y,
|
|
156
|
+
function e(s, L, Y, re, fe, ie, xe, M) {
|
|
157
157
|
return Y = ie.ref, s = {
|
|
158
|
-
$$typeof:
|
|
158
|
+
$$typeof: m,
|
|
159
159
|
type: s,
|
|
160
160
|
key: L,
|
|
161
161
|
props: ie,
|
|
@@ -185,13 +185,13 @@ function vt() {
|
|
|
185
185
|
value: M
|
|
186
186
|
}), Object.freeze && (Object.freeze(s.props), Object.freeze(s)), s;
|
|
187
187
|
}
|
|
188
|
-
function w(s, L, Y,
|
|
188
|
+
function w(s, L, Y, re, fe, ie, xe, M) {
|
|
189
189
|
var G = L.children;
|
|
190
190
|
if (G !== void 0)
|
|
191
|
-
if (
|
|
191
|
+
if (re)
|
|
192
192
|
if (ee(G)) {
|
|
193
|
-
for (
|
|
194
|
-
u(G[
|
|
193
|
+
for (re = 0; re < G.length; re++)
|
|
194
|
+
u(G[re]);
|
|
195
195
|
Object.freeze && Object.freeze(G);
|
|
196
196
|
} else
|
|
197
197
|
console.error(
|
|
@@ -203,25 +203,25 @@ function vt() {
|
|
|
203
203
|
var ue = Object.keys(L).filter(function(Ce) {
|
|
204
204
|
return Ce !== "key";
|
|
205
205
|
});
|
|
206
|
-
|
|
206
|
+
re = 0 < ue.length ? "{key: someKey, " + ue.join(": ..., ") + ": ...}" : "{key: someKey}", ge[G + re] || (ue = 0 < ue.length ? "{" + ue.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
207
207
|
`A props object containing a "key" prop is being spread into JSX:
|
|
208
208
|
let props = %s;
|
|
209
209
|
<%s {...props} />
|
|
210
210
|
React keys must be passed directly to JSX without using spread:
|
|
211
211
|
let props = %s;
|
|
212
212
|
<%s key={someKey} {...props} />`,
|
|
213
|
-
|
|
213
|
+
re,
|
|
214
214
|
G,
|
|
215
215
|
ue,
|
|
216
216
|
G
|
|
217
|
-
), ge[G +
|
|
217
|
+
), ge[G + re] = !0);
|
|
218
218
|
}
|
|
219
|
-
if (G = null, Y !== void 0 && (l(Y), G = "" + Y),
|
|
219
|
+
if (G = null, Y !== void 0 && (l(Y), G = "" + Y), S(L) && (l(L.key), G = "" + L.key), "key" in L) {
|
|
220
220
|
Y = {};
|
|
221
|
-
for (var
|
|
222
|
-
|
|
221
|
+
for (var ve in L)
|
|
222
|
+
ve !== "key" && (Y[ve] = L[ve]);
|
|
223
223
|
} else Y = L;
|
|
224
|
-
return G &&
|
|
224
|
+
return G && h(
|
|
225
225
|
Y,
|
|
226
226
|
typeof s == "function" ? s.displayName || s.name || "Unknown" : s
|
|
227
227
|
), e(
|
|
@@ -236,57 +236,57 @@ React keys must be passed directly to JSX without using spread:
|
|
|
236
236
|
);
|
|
237
237
|
}
|
|
238
238
|
function u(s) {
|
|
239
|
-
typeof s == "object" && s !== null && s.$$typeof ===
|
|
239
|
+
typeof s == "object" && s !== null && s.$$typeof === m && s._store && (s._store.validated = 1);
|
|
240
240
|
}
|
|
241
|
-
var
|
|
241
|
+
var q = Ze, m = Symbol.for("react.transitional.element"), a = Symbol.for("react.portal"), C = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), E = Symbol.for("react.profiler"), T = Symbol.for("react.consumer"), A = Symbol.for("react.context"), v = Symbol.for("react.forward_ref"), V = Symbol.for("react.suspense"), _ = Symbol.for("react.suspense_list"), P = Symbol.for("react.memo"), D = Symbol.for("react.lazy"), B = Symbol.for("react.activity"), X = Symbol.for("react.client.reference"), z = q.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, K = Object.prototype.hasOwnProperty, ee = Array.isArray, k = console.createTask ? console.createTask : function() {
|
|
242
242
|
return null;
|
|
243
243
|
};
|
|
244
|
-
|
|
244
|
+
q = {
|
|
245
245
|
react_stack_bottom_frame: function(s) {
|
|
246
246
|
return s();
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
|
-
var I, Z = {}, te =
|
|
250
|
-
|
|
249
|
+
var I, Z = {}, te = q.react_stack_bottom_frame.bind(
|
|
250
|
+
q,
|
|
251
251
|
y
|
|
252
|
-
)(), pe = k(
|
|
253
|
-
Ne.Fragment = C, Ne.jsx = function(s, L, Y,
|
|
252
|
+
)(), pe = k(r(y)), ge = {};
|
|
253
|
+
Ne.Fragment = C, Ne.jsx = function(s, L, Y, re, fe) {
|
|
254
254
|
var ie = 1e4 > z.recentlyCreatedOwnerStacks++;
|
|
255
255
|
return w(
|
|
256
256
|
s,
|
|
257
257
|
L,
|
|
258
258
|
Y,
|
|
259
259
|
!1,
|
|
260
|
-
|
|
260
|
+
re,
|
|
261
261
|
fe,
|
|
262
262
|
ie ? Error("react-stack-top-frame") : te,
|
|
263
|
-
ie ? k(
|
|
263
|
+
ie ? k(r(s)) : pe
|
|
264
264
|
);
|
|
265
|
-
}, Ne.jsxs = function(s, L, Y,
|
|
265
|
+
}, Ne.jsxs = function(s, L, Y, re, fe) {
|
|
266
266
|
var ie = 1e4 > z.recentlyCreatedOwnerStacks++;
|
|
267
267
|
return w(
|
|
268
268
|
s,
|
|
269
269
|
L,
|
|
270
270
|
Y,
|
|
271
271
|
!0,
|
|
272
|
-
|
|
272
|
+
re,
|
|
273
273
|
fe,
|
|
274
274
|
ie ? Error("react-stack-top-frame") : te,
|
|
275
|
-
ie ? k(
|
|
275
|
+
ie ? k(r(s)) : pe
|
|
276
276
|
);
|
|
277
277
|
};
|
|
278
278
|
}()), Ne;
|
|
279
279
|
}
|
|
280
280
|
var We;
|
|
281
281
|
function xt() {
|
|
282
|
-
return We || (We = 1, process.env.NODE_ENV === "production" ? je.exports =
|
|
282
|
+
return We || (We = 1, process.env.NODE_ENV === "production" ? je.exports = vt() : je.exports = bt()), je.exports;
|
|
283
283
|
}
|
|
284
284
|
var n = xt();
|
|
285
285
|
const wt = ({
|
|
286
286
|
variant: t = "primary",
|
|
287
|
-
loading:
|
|
287
|
+
loading: p = !1,
|
|
288
288
|
children: l,
|
|
289
|
-
...
|
|
289
|
+
...r
|
|
290
290
|
}) => {
|
|
291
291
|
const o = (y) => {
|
|
292
292
|
switch (y) {
|
|
@@ -307,9 +307,9 @@ const wt = ({
|
|
|
307
307
|
return /* @__PURE__ */ n.jsx(
|
|
308
308
|
we,
|
|
309
309
|
{
|
|
310
|
-
...
|
|
310
|
+
...r,
|
|
311
311
|
type: o(t),
|
|
312
|
-
loading:
|
|
312
|
+
loading: p,
|
|
313
313
|
ghost: t === "ghost",
|
|
314
314
|
children: l
|
|
315
315
|
}
|
|
@@ -361,9 +361,9 @@ wt.__docgenInfo = {
|
|
|
361
361
|
};
|
|
362
362
|
const Et = ({
|
|
363
363
|
title: t,
|
|
364
|
-
children:
|
|
364
|
+
children: p,
|
|
365
365
|
bordered: l = !0,
|
|
366
|
-
hoverable:
|
|
366
|
+
hoverable: r = !1,
|
|
367
367
|
size: o = "default",
|
|
368
368
|
...y
|
|
369
369
|
}) => /* @__PURE__ */ n.jsx(
|
|
@@ -372,9 +372,9 @@ const Et = ({
|
|
|
372
372
|
...y,
|
|
373
373
|
title: t,
|
|
374
374
|
bordered: l,
|
|
375
|
-
hoverable:
|
|
375
|
+
hoverable: r,
|
|
376
376
|
size: o,
|
|
377
|
-
children:
|
|
377
|
+
children: p
|
|
378
378
|
}
|
|
379
379
|
);
|
|
380
380
|
Et.__docgenInfo = {
|
|
@@ -430,16 +430,16 @@ Et.__docgenInfo = {
|
|
|
430
430
|
};
|
|
431
431
|
const Tt = ({
|
|
432
432
|
showDefaultFooter: t = !0,
|
|
433
|
-
...
|
|
433
|
+
...p
|
|
434
434
|
}) => {
|
|
435
|
-
const l =
|
|
435
|
+
const l = p.footer !== void 0 ? p.footer : t ? (r, { OkBtn: o, CancelBtn: y }) => /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
436
436
|
/* @__PURE__ */ n.jsx(o, {}),
|
|
437
437
|
/* @__PURE__ */ n.jsx(y, {})
|
|
438
438
|
] }) : null;
|
|
439
439
|
return /* @__PURE__ */ n.jsx(
|
|
440
440
|
et,
|
|
441
441
|
{
|
|
442
|
-
...
|
|
442
|
+
...p,
|
|
443
443
|
footer: l
|
|
444
444
|
}
|
|
445
445
|
);
|
|
@@ -507,23 +507,23 @@ Tt.__docgenInfo = {
|
|
|
507
507
|
};
|
|
508
508
|
const kt = ({
|
|
509
509
|
scrollX: t,
|
|
510
|
-
showPagination:
|
|
510
|
+
showPagination: p = !0,
|
|
511
511
|
defaultPageSize: l = 10,
|
|
512
|
-
...
|
|
512
|
+
...r
|
|
513
513
|
}) => /* @__PURE__ */ n.jsx(
|
|
514
514
|
Be,
|
|
515
515
|
{
|
|
516
|
-
...
|
|
516
|
+
...r,
|
|
517
517
|
scroll: {
|
|
518
518
|
x: t || "max-content",
|
|
519
519
|
y: "50vh"
|
|
520
520
|
},
|
|
521
|
-
pagination:
|
|
521
|
+
pagination: p ? {
|
|
522
522
|
hideOnSinglePage: !0,
|
|
523
523
|
showSizeChanger: !0,
|
|
524
524
|
showQuickJumper: !0,
|
|
525
525
|
defaultPageSize: l,
|
|
526
|
-
...
|
|
526
|
+
...r.pagination
|
|
527
527
|
} : !1
|
|
528
528
|
}
|
|
529
529
|
);
|
|
@@ -581,15 +581,15 @@ const Nt = ct({
|
|
|
581
581
|
scriptUrl: ["https://at.alicdn.com/t/c/font_4968458_eh91gfr4j9e.js"]
|
|
582
582
|
}), Ct = ({
|
|
583
583
|
name: t,
|
|
584
|
-
size:
|
|
584
|
+
size: p,
|
|
585
585
|
color: l,
|
|
586
|
-
style:
|
|
586
|
+
style: r,
|
|
587
587
|
...o
|
|
588
588
|
}) => {
|
|
589
589
|
const y = {
|
|
590
|
-
fontSize:
|
|
590
|
+
fontSize: p,
|
|
591
591
|
color: l,
|
|
592
|
-
...
|
|
592
|
+
...r
|
|
593
593
|
};
|
|
594
594
|
return /* @__PURE__ */ n.jsx(
|
|
595
595
|
Nt,
|
|
@@ -638,9 +638,9 @@ Ct.__docgenInfo = {
|
|
|
638
638
|
};
|
|
639
639
|
const St = ({
|
|
640
640
|
loading: t,
|
|
641
|
-
description:
|
|
641
|
+
description: p = "暂无数据",
|
|
642
642
|
className: l,
|
|
643
|
-
emptyChildren:
|
|
643
|
+
emptyChildren: r,
|
|
644
644
|
loadingText: o,
|
|
645
645
|
emptyImage: y
|
|
646
646
|
}) => t ? /* @__PURE__ */ n.jsxs(
|
|
@@ -665,9 +665,9 @@ const St = ({
|
|
|
665
665
|
nt,
|
|
666
666
|
{
|
|
667
667
|
image: y,
|
|
668
|
-
description:
|
|
668
|
+
description: p,
|
|
669
669
|
imageStyle: { height: 180 },
|
|
670
|
-
children:
|
|
670
|
+
children: r
|
|
671
671
|
}
|
|
672
672
|
)
|
|
673
673
|
}
|
|
@@ -717,19 +717,19 @@ St.__docgenInfo = {
|
|
|
717
717
|
};
|
|
718
718
|
const qt = ({
|
|
719
719
|
onClick: t,
|
|
720
|
-
showText:
|
|
720
|
+
showText: p = !1,
|
|
721
721
|
className: l,
|
|
722
|
-
size:
|
|
722
|
+
size: r = "small",
|
|
723
723
|
type: o = "default"
|
|
724
724
|
}) => /* @__PURE__ */ n.jsx(
|
|
725
725
|
we,
|
|
726
726
|
{
|
|
727
|
-
size:
|
|
727
|
+
size: r,
|
|
728
728
|
type: o,
|
|
729
729
|
icon: /* @__PURE__ */ n.jsx(ut, {}),
|
|
730
730
|
className: `cursor-pointer ${l || ""}`,
|
|
731
731
|
onClick: t,
|
|
732
|
-
children:
|
|
732
|
+
children: p && "返回"
|
|
733
733
|
}
|
|
734
734
|
);
|
|
735
735
|
qt.__docgenInfo = {
|
|
@@ -773,16 +773,16 @@ qt.__docgenInfo = {
|
|
|
773
773
|
};
|
|
774
774
|
const At = ({
|
|
775
775
|
removePadding: t = !0,
|
|
776
|
-
className:
|
|
776
|
+
className: p,
|
|
777
777
|
...l
|
|
778
778
|
}) => {
|
|
779
|
-
const
|
|
779
|
+
const r = t ? `px-0 h-auto ${p || ""}` : p;
|
|
780
780
|
return /* @__PURE__ */ n.jsx(
|
|
781
781
|
we,
|
|
782
782
|
{
|
|
783
783
|
type: "link",
|
|
784
784
|
...l,
|
|
785
|
-
className:
|
|
785
|
+
className: r,
|
|
786
786
|
children: l.children
|
|
787
787
|
}
|
|
788
788
|
);
|
|
@@ -826,22 +826,22 @@ At.__docgenInfo = {
|
|
|
826
826
|
};
|
|
827
827
|
const { Option: _t } = Oe, $t = ({
|
|
828
828
|
columns: t,
|
|
829
|
-
request:
|
|
829
|
+
request: p,
|
|
830
830
|
searchFields: l = [],
|
|
831
|
-
showSearch:
|
|
831
|
+
showSearch: r = !0,
|
|
832
832
|
showRefresh: o = !0,
|
|
833
833
|
defaultPageSize: y = 10,
|
|
834
|
-
pageSizeOptions:
|
|
835
|
-
autoLoad:
|
|
834
|
+
pageSizeOptions: S = ["10", "20", "50", "100"],
|
|
835
|
+
autoLoad: h = !0,
|
|
836
836
|
externalParams: c = {},
|
|
837
837
|
...e
|
|
838
838
|
}) => {
|
|
839
|
-
const [w, u] = Q([]), [
|
|
839
|
+
const [w, u] = Q([]), [q, m] = Q(!1), [a, C] = Q({
|
|
840
840
|
current: 1,
|
|
841
841
|
pageSize: y,
|
|
842
842
|
total: 0
|
|
843
|
-
}), [i, E] = Q({}), [T, A] = Q({}), [
|
|
844
|
-
V.current =
|
|
843
|
+
}), [i, E] = Q({}), [T, A] = Q({}), [v] = $e.useForm(), V = F(a);
|
|
844
|
+
V.current = a;
|
|
845
845
|
const _ = F(c);
|
|
846
846
|
_.current = c;
|
|
847
847
|
const P = F(!1), D = Xe(() => t.map((k) => {
|
|
@@ -852,8 +852,8 @@ const { Option: _t } = Oe, $t = ({
|
|
|
852
852
|
render: Z || ((pe) => pe)
|
|
853
853
|
};
|
|
854
854
|
}), [t]), B = U(async (k = {}) => {
|
|
855
|
-
if (
|
|
856
|
-
|
|
855
|
+
if (p) {
|
|
856
|
+
m(!0);
|
|
857
857
|
try {
|
|
858
858
|
const I = {
|
|
859
859
|
page: V.current.current,
|
|
@@ -862,7 +862,7 @@ const { Option: _t } = Oe, $t = ({
|
|
|
862
862
|
sortOrder: T.order,
|
|
863
863
|
searchParams: { ...i, ..._.current },
|
|
864
864
|
...k
|
|
865
|
-
}, Z = await
|
|
865
|
+
}, Z = await p(I);
|
|
866
866
|
Z.success && (u(Z.data), C((te) => ({
|
|
867
867
|
...te,
|
|
868
868
|
total: Z.total,
|
|
@@ -871,14 +871,14 @@ const { Option: _t } = Oe, $t = ({
|
|
|
871
871
|
} catch (I) {
|
|
872
872
|
console.error("加载数据失败:", I);
|
|
873
873
|
} finally {
|
|
874
|
-
|
|
874
|
+
m(!1);
|
|
875
875
|
}
|
|
876
876
|
}
|
|
877
|
-
}, [
|
|
877
|
+
}, [p, T, i]), X = U((k) => {
|
|
878
878
|
E(k), C((I) => ({ ...I, current: 1 }));
|
|
879
879
|
}, []), z = U(() => {
|
|
880
|
-
|
|
881
|
-
}, [
|
|
880
|
+
v.resetFields(), E({}), C((k) => ({ ...k, current: 1 }));
|
|
881
|
+
}, [v]), K = U(() => {
|
|
882
882
|
B();
|
|
883
883
|
}, [B]), ee = U((k, I, Z) => {
|
|
884
884
|
const te = {
|
|
@@ -893,12 +893,12 @@ const { Option: _t } = Oe, $t = ({
|
|
|
893
893
|
}, [y]);
|
|
894
894
|
return le(() => {
|
|
895
895
|
const k = Object.keys(c).length > 0;
|
|
896
|
-
(
|
|
897
|
-
}, [
|
|
898
|
-
|
|
896
|
+
(h && !P.current || k) && (B(), P.current = !0);
|
|
897
|
+
}, [h, c, B]), /* @__PURE__ */ n.jsxs("div", { children: [
|
|
898
|
+
r && l.length > 0 && /* @__PURE__ */ n.jsx(Pe, { size: "small", style: { marginBottom: 16 }, children: /* @__PURE__ */ n.jsxs(
|
|
899
899
|
$e,
|
|
900
900
|
{
|
|
901
|
-
form:
|
|
901
|
+
form: v,
|
|
902
902
|
layout: "inline",
|
|
903
903
|
onFinish: X,
|
|
904
904
|
initialValues: l.reduce((k, I) => (I.defaultValue !== void 0 && (k[I.key] = I.defaultValue), k), {}),
|
|
@@ -918,7 +918,7 @@ const { Option: _t } = Oe, $t = ({
|
|
|
918
918
|
children: k.options?.map((I) => /* @__PURE__ */ n.jsx(_t, { value: I.value, children: I.label }, I.value))
|
|
919
919
|
}
|
|
920
920
|
) }, k.key)),
|
|
921
|
-
/* @__PURE__ */ n.jsx($e.Item, { children: /* @__PURE__ */ n.jsxs(
|
|
921
|
+
/* @__PURE__ */ n.jsx($e.Item, { children: /* @__PURE__ */ n.jsxs(rt, { children: [
|
|
922
922
|
/* @__PURE__ */ n.jsx(we, { type: "primary", htmlType: "submit", icon: /* @__PURE__ */ n.jsx(dt, {}), children: "查询" }),
|
|
923
923
|
/* @__PURE__ */ n.jsx(we, { onClick: z, children: "重置" }),
|
|
924
924
|
o && /* @__PURE__ */ n.jsx(we, { icon: /* @__PURE__ */ n.jsx(pt, {}), onClick: K, children: "刷新" })
|
|
@@ -932,13 +932,13 @@ const { Option: _t } = Oe, $t = ({
|
|
|
932
932
|
...e,
|
|
933
933
|
columns: D,
|
|
934
934
|
dataSource: w,
|
|
935
|
-
loading:
|
|
935
|
+
loading: q,
|
|
936
936
|
pagination: {
|
|
937
|
-
...
|
|
937
|
+
...a,
|
|
938
938
|
showSizeChanger: !0,
|
|
939
939
|
showQuickJumper: !0,
|
|
940
940
|
showTotal: (k, I) => `第 ${I[0]}-${I[1]} 条/共 ${k} 条`,
|
|
941
|
-
pageSizeOptions:
|
|
941
|
+
pageSizeOptions: S
|
|
942
942
|
},
|
|
943
943
|
onChange: ee,
|
|
944
944
|
scroll: { x: "max-content", y: "50vh" }
|
|
@@ -1013,55 +1013,55 @@ $t.__docgenInfo = {
|
|
|
1013
1013
|
}
|
|
1014
1014
|
}
|
|
1015
1015
|
};
|
|
1016
|
-
function Ve(t,
|
|
1016
|
+
function Ve(t, p, l) {
|
|
1017
1017
|
if (!t.current) return;
|
|
1018
|
-
const
|
|
1019
|
-
for (const u of
|
|
1020
|
-
u.exclusionGroup && u.exclusionGroup !== "separator" && (
|
|
1018
|
+
const r = /* @__PURE__ */ new Set(), o = {};
|
|
1019
|
+
for (const u of p)
|
|
1020
|
+
u.exclusionGroup && u.exclusionGroup !== "separator" && (r.add(u.exclusionGroup), o[u.exclusionGroup] || (o[u.exclusionGroup] = []), o[u.exclusionGroup].push({
|
|
1021
1021
|
type: u.type,
|
|
1022
1022
|
key: u.key,
|
|
1023
1023
|
exclusionGroup: u.exclusionGroup
|
|
1024
1024
|
}));
|
|
1025
1025
|
const y = {};
|
|
1026
|
-
for (const u of
|
|
1026
|
+
for (const u of r) {
|
|
1027
1027
|
y[u] = !1;
|
|
1028
|
-
for (const
|
|
1029
|
-
if (
|
|
1030
|
-
if (l[
|
|
1028
|
+
for (const q of o[u])
|
|
1029
|
+
if (q.type === "upload" && q.key) {
|
|
1030
|
+
if (l[q.key] !== null && l[q.key] !== void 0) {
|
|
1031
1031
|
y[u] = !0;
|
|
1032
1032
|
break;
|
|
1033
1033
|
}
|
|
1034
|
-
} else if (
|
|
1035
|
-
const
|
|
1036
|
-
`[data-type="variable"][data-key="${
|
|
1034
|
+
} else if (q.type === "variable" && q.key) {
|
|
1035
|
+
const m = t.current.querySelector(
|
|
1036
|
+
`[data-type="variable"][data-key="${q.key}"]`
|
|
1037
1037
|
);
|
|
1038
|
-
if (
|
|
1038
|
+
if (m && m.innerText.replace(/[\u200B\n]/g, "").trim().length > 0) {
|
|
1039
1039
|
y[u] = !0;
|
|
1040
1040
|
break;
|
|
1041
1041
|
}
|
|
1042
1042
|
}
|
|
1043
1043
|
}
|
|
1044
|
-
const
|
|
1044
|
+
const S = p.some((u) => u.exclusionGroup === "separator"), c = Object.keys(y).filter(
|
|
1045
1045
|
(u) => y[u]
|
|
1046
1046
|
).length > 0;
|
|
1047
1047
|
let e = null;
|
|
1048
|
-
if (c &&
|
|
1049
|
-
for (const u of
|
|
1048
|
+
if (c && S) {
|
|
1049
|
+
for (const u of p)
|
|
1050
1050
|
if (u.exclusionGroup && u.exclusionGroup !== "separator" && y[u.exclusionGroup]) {
|
|
1051
1051
|
e = u.exclusionGroup;
|
|
1052
1052
|
break;
|
|
1053
1053
|
}
|
|
1054
1054
|
}
|
|
1055
|
-
for (const u of
|
|
1056
|
-
const
|
|
1055
|
+
for (const u of r) {
|
|
1056
|
+
const q = t.current.querySelectorAll(
|
|
1057
1057
|
`[data-group="${u}"]`
|
|
1058
1058
|
);
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
}) :
|
|
1062
|
-
|
|
1063
|
-
}) :
|
|
1064
|
-
|
|
1059
|
+
S && c && e ? u === e ? q.forEach((m) => {
|
|
1060
|
+
m.classList.contains("required-upload-group") ? m.style.setProperty("display", "inline-flex", "important") : (m.classList.contains("exclusion-wrapper"), m.style.setProperty("display", "inline-block", "important"));
|
|
1061
|
+
}) : q.forEach((m) => {
|
|
1062
|
+
m.style.display = "none", m.style.setProperty("display", "none", "important");
|
|
1063
|
+
}) : q.forEach((m) => {
|
|
1064
|
+
m.classList.contains("required-upload-group") ? m.style.setProperty("display", "inline-flex", "important") : (m.classList.contains("exclusion-wrapper"), m.style.setProperty("display", "inline-block", "important"));
|
|
1065
1065
|
});
|
|
1066
1066
|
}
|
|
1067
1067
|
t.current.querySelectorAll(
|
|
@@ -1070,14 +1070,14 @@ function Ve(t, d, l) {
|
|
|
1070
1070
|
u.style.display = c ? "none" : "inline";
|
|
1071
1071
|
});
|
|
1072
1072
|
}
|
|
1073
|
-
function Le(t,
|
|
1073
|
+
function Le(t, p, l, r) {
|
|
1074
1074
|
if (!t.current) {
|
|
1075
|
-
|
|
1075
|
+
r(!1);
|
|
1076
1076
|
return;
|
|
1077
1077
|
}
|
|
1078
1078
|
const o = [];
|
|
1079
|
-
for (let c = 0; c <
|
|
1080
|
-
const e =
|
|
1079
|
+
for (let c = 0; c < p.length; c++) {
|
|
1080
|
+
const e = p[c];
|
|
1081
1081
|
if ((e.type === "variable" || e.type === "upload" || e.type === "multi-variable") && e.required && e.key) {
|
|
1082
1082
|
o.push({
|
|
1083
1083
|
exclusionGroup: e.exclusionGroup || "",
|
|
@@ -1088,8 +1088,8 @@ function Le(t, d, l, a) {
|
|
|
1088
1088
|
continue;
|
|
1089
1089
|
}
|
|
1090
1090
|
if (e.type === "text" && e.className?.includes("rte-text-required") && e.exclusionGroup)
|
|
1091
|
-
for (let w = c + 1; w <
|
|
1092
|
-
const u =
|
|
1091
|
+
for (let w = c + 1; w < p.length; w++) {
|
|
1092
|
+
const u = p[w];
|
|
1093
1093
|
if (u.exclusionGroup === e.exclusionGroup && (u.type === "variable" || u.type === "upload") && u.key) {
|
|
1094
1094
|
o.push({
|
|
1095
1095
|
exclusionGroup: e.exclusionGroup,
|
|
@@ -1100,43 +1100,43 @@ function Le(t, d, l, a) {
|
|
|
1100
1100
|
}
|
|
1101
1101
|
}
|
|
1102
1102
|
}
|
|
1103
|
-
const y =
|
|
1104
|
-
let
|
|
1103
|
+
const y = p.some((c) => c.exclusionGroup === "separator");
|
|
1104
|
+
let S = !1;
|
|
1105
1105
|
if (y && o.length > 1) {
|
|
1106
|
-
const c =
|
|
1107
|
-
(
|
|
1108
|
-
) < c), w = o.filter((u) =>
|
|
1109
|
-
(
|
|
1106
|
+
const c = p.findIndex((u) => u.exclusionGroup === "separator"), e = o.filter((u) => p.findIndex(
|
|
1107
|
+
(m) => (m.type === "variable" || m.type === "upload") && m.key === u.key && m.exclusionGroup === u.exclusionGroup
|
|
1108
|
+
) < c), w = o.filter((u) => p.findIndex(
|
|
1109
|
+
(m) => (m.type === "variable" || m.type === "upload") && m.key === u.key && m.exclusionGroup === u.exclusionGroup
|
|
1110
1110
|
) > c);
|
|
1111
|
-
|
|
1111
|
+
S = e.length > 0 && w.length > 0;
|
|
1112
1112
|
}
|
|
1113
1113
|
if (o.length === 0) {
|
|
1114
|
-
if (
|
|
1114
|
+
if (p.length === 0) {
|
|
1115
1115
|
if (!t.current) {
|
|
1116
|
-
|
|
1116
|
+
r(!1);
|
|
1117
1117
|
return;
|
|
1118
1118
|
}
|
|
1119
1119
|
const c = t.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "";
|
|
1120
|
-
|
|
1120
|
+
r(c.length > 0);
|
|
1121
1121
|
return;
|
|
1122
1122
|
}
|
|
1123
|
-
|
|
1123
|
+
r(!0);
|
|
1124
1124
|
return;
|
|
1125
1125
|
}
|
|
1126
|
-
const
|
|
1126
|
+
const h = o.filter((c) => {
|
|
1127
1127
|
if (!t.current) return !1;
|
|
1128
1128
|
const e = t.current.querySelectorAll(
|
|
1129
1129
|
`[data-group="${c.exclusionGroup}"]`
|
|
1130
1130
|
);
|
|
1131
1131
|
return e.length === 0 ? !1 : e[0].style.display !== "none";
|
|
1132
1132
|
});
|
|
1133
|
-
if (
|
|
1134
|
-
|
|
1133
|
+
if (h.length === 0) {
|
|
1134
|
+
r(!0);
|
|
1135
1135
|
return;
|
|
1136
1136
|
}
|
|
1137
|
-
if (
|
|
1137
|
+
if (S) {
|
|
1138
1138
|
let c = !1;
|
|
1139
|
-
for (const e of
|
|
1139
|
+
for (const e of h)
|
|
1140
1140
|
if (e.type === "upload" && e.key) {
|
|
1141
1141
|
if (l[e.key] !== null && l[e.key] !== void 0) {
|
|
1142
1142
|
c = !0;
|
|
@@ -1148,8 +1148,8 @@ function Le(t, d, l, a) {
|
|
|
1148
1148
|
`[data-type="variable"][data-multi-key="${e.key}"]`
|
|
1149
1149
|
);
|
|
1150
1150
|
let u = !1;
|
|
1151
|
-
for (const
|
|
1152
|
-
if (
|
|
1151
|
+
for (const q of Array.from(w))
|
|
1152
|
+
if (q.innerText.replace(/[\u200B\n]/g, "").trim().length > 0) {
|
|
1153
1153
|
u = !0;
|
|
1154
1154
|
break;
|
|
1155
1155
|
}
|
|
@@ -1166,10 +1166,10 @@ function Le(t, d, l, a) {
|
|
|
1166
1166
|
break;
|
|
1167
1167
|
}
|
|
1168
1168
|
}
|
|
1169
|
-
|
|
1169
|
+
r(c);
|
|
1170
1170
|
} else {
|
|
1171
1171
|
let c = !0;
|
|
1172
|
-
for (const e of
|
|
1172
|
+
for (const e of h)
|
|
1173
1173
|
if (e.type === "upload" && e.key) {
|
|
1174
1174
|
if (l[e.key] === null || l[e.key] === void 0) {
|
|
1175
1175
|
c = !1;
|
|
@@ -1181,8 +1181,8 @@ function Le(t, d, l, a) {
|
|
|
1181
1181
|
`[data-type="variable"][data-multi-key="${e.key}"]`
|
|
1182
1182
|
);
|
|
1183
1183
|
let u = !1;
|
|
1184
|
-
for (const
|
|
1185
|
-
if (
|
|
1184
|
+
for (const q of Array.from(w))
|
|
1185
|
+
if (q.innerText.replace(/[\u200B\n]/g, "").trim().length > 0) {
|
|
1186
1186
|
u = !0;
|
|
1187
1187
|
break;
|
|
1188
1188
|
}
|
|
@@ -1203,66 +1203,66 @@ function Le(t, d, l, a) {
|
|
|
1203
1203
|
break;
|
|
1204
1204
|
}
|
|
1205
1205
|
}
|
|
1206
|
-
|
|
1206
|
+
r(c);
|
|
1207
1207
|
}
|
|
1208
1208
|
}
|
|
1209
|
-
function Ie(t,
|
|
1209
|
+
function Ie(t, p) {
|
|
1210
1210
|
if (!t.current) return;
|
|
1211
|
-
t.current.querySelectorAll('[data-type="variable"]').forEach((
|
|
1212
|
-
const o =
|
|
1213
|
-
o.replace(/\u200B/g, "") ?
|
|
1211
|
+
t.current.querySelectorAll('[data-type="variable"]').forEach((r) => {
|
|
1212
|
+
const o = r.innerText.replace(/\n/g, "");
|
|
1213
|
+
o.replace(/\u200B/g, "") ? r.classList.remove("show-placeholder") : (o !== "" && (r.innerText = ""), r.classList.add("show-placeholder"));
|
|
1214
1214
|
});
|
|
1215
1215
|
}
|
|
1216
|
-
function jt(t,
|
|
1216
|
+
function jt(t, p, l, r, o, y = {}, S) {
|
|
1217
1217
|
if (!t.current) return;
|
|
1218
|
-
let
|
|
1219
|
-
for (; c <
|
|
1220
|
-
const e =
|
|
1218
|
+
let h = "", c = 0;
|
|
1219
|
+
for (; c < p.length; ) {
|
|
1220
|
+
const e = p[c], w = c + 1 < p.length ? p[c + 1] : null;
|
|
1221
1221
|
if (e.type === "text" && (e.text?.includes("icon-bitian") || e.className === "rte-text-required") && w) {
|
|
1222
1222
|
const i = w.type === "upload" && w.exclusionGroup === "fileInput" && e.exclusionGroup === "fileInput" && e.exclusionGroup === w.exclusionGroup, E = w.type === "variable" && w.exclusionGroup === "textInput" && e.exclusionGroup === "textInput" && e.exclusionGroup === w.exclusionGroup;
|
|
1223
1223
|
if (i) {
|
|
1224
|
-
const A = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group">`,
|
|
1224
|
+
const A = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group">`, v = "</span>";
|
|
1225
1225
|
let V = "";
|
|
1226
1226
|
e.className ? V = `<span class="${e.className}">${e.text ?? ""}</span>` : V = e.text ?? "";
|
|
1227
1227
|
const _ = w, P = l[_.key] !== null && l[_.key] !== void 0, D = P ? l[_.key]?.name : _.text, B = P ? "" : "hidden", X = _.tooltip && !P ? "" : "hidden", z = P ? "has-file" : "", K = P && D ? ` data-file-name="${D.replace(/"/g, """)}"` : "", ee = `<span contenteditable="false" data-type="upload" data-key="${_.key}" class="upload-chip"><span class="upload-inner-wrapper ${z}"><span class="upload-icon">${P ? "<i class='iconfont icon-exlwenjian'></i>" : "<i class='iconfont icon-shangchuan1'></i>"}</span><span class="upload-label"${K}>${D || _.text}</span>${_.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi upload-info-icon ${X}" data-upload-key="${_.key}" data-tooltip="${_.tooltip}" title="提示"></i>` : ""}<span class="file-remove-btn ${B}" title="移除文件">×</span></span></span>`;
|
|
1228
|
-
|
|
1228
|
+
h += A + V + ee + v, c += 2;
|
|
1229
1229
|
continue;
|
|
1230
1230
|
}
|
|
1231
1231
|
if (E) {
|
|
1232
|
-
const A = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group">`,
|
|
1232
|
+
const A = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group">`, v = "</span>";
|
|
1233
1233
|
let V = "";
|
|
1234
1234
|
e.className ? V = `<span class="${e.className}">${e.text ?? ""}</span>` : V = e.text ?? "";
|
|
1235
1235
|
const _ = w, D = (_.key ? o[_.key] : void 0) || _.text || "", B = !D, X = B ? "" : D, z = B ? "show-placeholder" : "", K = _.exclusionGroup ? ` data-group="${_.exclusionGroup}"` : "", ee = _.tooltip ? ` data-tooltip="${_.tooltip.replace(/"/g, """)}" data-variable-key="${_.key || ""}"` : "", k = _.tooltip && B ? "" : "hidden", I = `<span contenteditable="true" data-type="variable" data-key="${_.key}" data-placeholder="${_.placeholder || ""}"${K}${ee} class="variable-chip ${z}">${X}${_.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${k}" data-variable-key="${_.key}" data-tooltip="${_.tooltip.replace(/"/g, """)}" title="提示"></i>` : ""}</span>`;
|
|
1236
|
-
|
|
1236
|
+
h += A + V + I + v, c += 2;
|
|
1237
1237
|
continue;
|
|
1238
1238
|
}
|
|
1239
1239
|
}
|
|
1240
|
-
const
|
|
1240
|
+
const q = e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : "", m = e.exclusionGroup ? `<span ${q} class="exclusion-wrapper">` : "", a = e.exclusionGroup ? "</span>" : "";
|
|
1241
1241
|
let C = "";
|
|
1242
1242
|
if (e.type === "tag") {
|
|
1243
|
-
const E =
|
|
1243
|
+
const E = r || S === "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>', T = r ? ' data-locked="true"' : "", A = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, """)}" data-tag-key="${e.key || ""}"` : "";
|
|
1244
1244
|
C = `<span contenteditable="false" class="tag-node group"${T}${A}><span class="tag-label">${e.text}</span>${E}</span>`;
|
|
1245
1245
|
} else if (e.type === "text") {
|
|
1246
|
-
const i =
|
|
1247
|
-
e.className ? C = `<span class="${e.className}"${i}>${e.text ?? ""}</span>` : C =
|
|
1246
|
+
const i = r ? ' data-locked="true" contenteditable="false"' : ' contenteditable="false"';
|
|
1247
|
+
e.className ? C = `<span class="${e.className}"${i}>${e.text ?? ""}</span>` : C = r ? `<span${i}>${e.text ?? ""}</span>` : `<span contenteditable="false">${e.text ?? ""}</span>`;
|
|
1248
1248
|
} else if (e.type === "variable" && e.key) {
|
|
1249
|
-
const E = o[e.key] || e.text || "", T = !E, A = T ? "" : E,
|
|
1249
|
+
const E = o[e.key] || e.text || "", T = !E, A = T ? "" : E, v = T ? "show-placeholder" : "", V = e.exclusionGroup ? ` data-group="${e.exclusionGroup}"` : "", _ = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, """)}" data-variable-key="${e.key || ""}"` : "", P = e.tooltip && T ? "" : "hidden", D = `<span contenteditable="true" data-type="variable" data-key="${e.key}" data-placeholder="${e.placeholder || ""}"${V}${_} class="variable-chip ${v}">${A}${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>`;
|
|
1250
1250
|
e.required ? C = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${D}</span>` : C = D;
|
|
1251
1251
|
} else if (e.type === "upload" && e.key) {
|
|
1252
|
-
const i = l[e.key] !== null && l[e.key] !== void 0, E = i ? l[e.key]?.name : e.text, T = i ? "" : "hidden", A = e.tooltip && !i ? "" : "hidden",
|
|
1252
|
+
const i = l[e.key] !== null && l[e.key] !== void 0, E = i ? l[e.key]?.name : e.text, T = i ? "" : "hidden", A = e.tooltip && !i ? "" : "hidden", v = i ? "has-file" : "", V = i && E ? ` data-file-name="${E.replace(/"/g, """)}"` : "", _ = `<span contenteditable="false" data-type="upload" data-key="${e.key}" class="upload-chip"><span class="upload-inner-wrapper ${v}"><span class="upload-icon">${i ? "<i class='iconfont icon-exlwenjian'></i>" : "<i class='iconfont icon-shangchuan1'></i>"}</span><span class="upload-label"${V}>${E || e.text}</span>${e.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi upload-info-icon ${A}" data-upload-key="${e.key}" data-tooltip="${e.tooltip}" title="提示"></i>` : ""}<span class="file-remove-btn ${T}" title="移除文件">×</span></span></span>`;
|
|
1253
1253
|
e.required ? C = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${_}</span>` : C = _;
|
|
1254
1254
|
} else if (e.type === "multi-variable" && e.key) {
|
|
1255
1255
|
const i = e.maxCount || 9, E = y[e.key] || 1, T = Math.min(E, i);
|
|
1256
1256
|
let A = "";
|
|
1257
|
-
for (let
|
|
1258
|
-
const V = `${e.key}_${
|
|
1257
|
+
for (let v = 0; v < T; v++) {
|
|
1258
|
+
const V = `${e.key}_${v}`, _ = o[V] || "", P = !_, D = P ? "" : _, B = P ? "show-placeholder" : "", X = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, """)}" data-variable-key="${e.key || ""}"` : "", z = e.tooltip && P ? "" : "hidden", K = `<span contenteditable="true" data-type="variable" data-key="${V}" data-multi-key="${e.key}" data-index="${v}" data-placeholder="${e.placeholder || ""}"${X} class="variable-chip ${B}">${D}${e.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${z}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g, """)}" title="提示"></i>` : ""}</span>`;
|
|
1259
1259
|
A += K;
|
|
1260
1260
|
}
|
|
1261
1261
|
e.required ? C = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${A}</span>` : C = A;
|
|
1262
1262
|
}
|
|
1263
|
-
|
|
1263
|
+
h += m + C + a, c++;
|
|
1264
1264
|
}
|
|
1265
|
-
t.current && (t.current.innerHTML =
|
|
1265
|
+
t.current && (t.current.innerHTML = h, setTimeout(() => {
|
|
1266
1266
|
if (!t.current) return;
|
|
1267
1267
|
t.current.querySelectorAll('[data-type="variable"]').forEach((w) => {
|
|
1268
1268
|
const u = w.innerText.replace(/\n/g, "");
|
|
@@ -1270,10 +1270,10 @@ function jt(t, d, l, a, o, y = {}, q) {
|
|
|
1270
1270
|
});
|
|
1271
1271
|
}, 0));
|
|
1272
1272
|
}
|
|
1273
|
-
function Rt(t,
|
|
1273
|
+
function Rt(t, p, l, r, o = {}, y, S, h) {
|
|
1274
1274
|
const c = U(() => {
|
|
1275
1275
|
if (!t.current) return;
|
|
1276
|
-
if (
|
|
1276
|
+
if (p.length === 0) {
|
|
1277
1277
|
t.current.innerHTML = "";
|
|
1278
1278
|
return;
|
|
1279
1279
|
}
|
|
@@ -1281,96 +1281,96 @@ function Rt(t, d, l, a, o = {}, y, q, g) {
|
|
|
1281
1281
|
const u = t.current.__tempVariableValues;
|
|
1282
1282
|
if (u ? (e = u, setTimeout(() => {
|
|
1283
1283
|
if (t.current) {
|
|
1284
|
-
const
|
|
1285
|
-
|
|
1284
|
+
const q = t.current;
|
|
1285
|
+
q.__tempVariableValues === u && delete q.__tempVariableValues;
|
|
1286
1286
|
}
|
|
1287
1287
|
}, 100)) : t.current.querySelectorAll(
|
|
1288
1288
|
'[data-type="variable"]'
|
|
1289
|
-
).forEach((
|
|
1290
|
-
const
|
|
1291
|
-
if (
|
|
1292
|
-
const C =
|
|
1293
|
-
C && (e[
|
|
1289
|
+
).forEach((m) => {
|
|
1290
|
+
const a = m.dataset.key;
|
|
1291
|
+
if (a) {
|
|
1292
|
+
const C = m.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
1293
|
+
C && (e[a] = C);
|
|
1294
1294
|
}
|
|
1295
|
-
}), jt(t,
|
|
1296
|
-
const { key:
|
|
1295
|
+
}), jt(t, p, l, r, e, o, h), y?.current) {
|
|
1296
|
+
const { key: q, offset: m } = y.current;
|
|
1297
1297
|
setTimeout(() => {
|
|
1298
1298
|
if (!t.current) return;
|
|
1299
|
-
const
|
|
1300
|
-
`[data-type="variable"][data-key="${
|
|
1299
|
+
const a = t.current.querySelector(
|
|
1300
|
+
`[data-type="variable"][data-key="${q}"]`
|
|
1301
1301
|
);
|
|
1302
|
-
if (
|
|
1302
|
+
if (a) {
|
|
1303
1303
|
try {
|
|
1304
1304
|
const C = document.createRange(), i = document.createTreeWalker(
|
|
1305
|
-
|
|
1305
|
+
a,
|
|
1306
1306
|
NodeFilter.SHOW_TEXT,
|
|
1307
1307
|
null
|
|
1308
1308
|
);
|
|
1309
1309
|
let E = 0, T = null, A = 0;
|
|
1310
1310
|
for (; i.nextNode(); ) {
|
|
1311
|
-
const
|
|
1312
|
-
if (E + V >=
|
|
1313
|
-
T =
|
|
1311
|
+
const v = i.currentNode, V = v.textContent?.length || 0;
|
|
1312
|
+
if (E + V >= m) {
|
|
1313
|
+
T = v, A = m - E;
|
|
1314
1314
|
break;
|
|
1315
1315
|
}
|
|
1316
1316
|
E += V;
|
|
1317
1317
|
}
|
|
1318
1318
|
if (T) {
|
|
1319
1319
|
C.setStart(T, Math.min(A, T.textContent?.length || 0)), C.collapse(!0);
|
|
1320
|
-
const
|
|
1321
|
-
|
|
1320
|
+
const v = window.getSelection();
|
|
1321
|
+
v && (v.removeAllRanges(), v.addRange(C), a.focus());
|
|
1322
1322
|
} else {
|
|
1323
|
-
C.selectNodeContents(
|
|
1324
|
-
const
|
|
1325
|
-
|
|
1323
|
+
C.selectNodeContents(a), C.collapse(!1);
|
|
1324
|
+
const v = window.getSelection();
|
|
1325
|
+
v && (v.removeAllRanges(), v.addRange(C), a.focus());
|
|
1326
1326
|
}
|
|
1327
1327
|
} catch {
|
|
1328
1328
|
const C = document.createRange();
|
|
1329
|
-
C.selectNodeContents(
|
|
1329
|
+
C.selectNodeContents(a), C.collapse(!1);
|
|
1330
1330
|
const i = window.getSelection();
|
|
1331
|
-
i && (i.removeAllRanges(), i.addRange(C),
|
|
1331
|
+
i && (i.removeAllRanges(), i.addRange(C), a.focus());
|
|
1332
1332
|
}
|
|
1333
1333
|
y.current = null;
|
|
1334
1334
|
}
|
|
1335
1335
|
}, 0);
|
|
1336
1336
|
}
|
|
1337
|
-
}, [
|
|
1337
|
+
}, [p, l, r, t, o, y, S, h]);
|
|
1338
1338
|
le(() => {
|
|
1339
1339
|
c();
|
|
1340
1340
|
}, [c]);
|
|
1341
1341
|
}
|
|
1342
|
-
function It(t,
|
|
1342
|
+
function It(t, p, l, r) {
|
|
1343
1343
|
le(() => {
|
|
1344
1344
|
const o = t.current;
|
|
1345
1345
|
if (!o) return;
|
|
1346
|
-
const y = (
|
|
1347
|
-
const c =
|
|
1346
|
+
const y = (h) => {
|
|
1347
|
+
const c = h.target?.closest(".upload-info-icon");
|
|
1348
1348
|
if (c && c.classList.contains("upload-info-icon")) {
|
|
1349
1349
|
const e = c.dataset.uploadKey;
|
|
1350
|
-
e &&
|
|
1350
|
+
e && r({ key: e, anchorEl: c, type: "upload" });
|
|
1351
1351
|
}
|
|
1352
|
-
},
|
|
1353
|
-
const c =
|
|
1354
|
-
c && c.classList.contains("upload-info-icon") && (!e || !o.contains(e) ?
|
|
1352
|
+
}, S = (h) => {
|
|
1353
|
+
const c = h.target?.closest(".upload-info-icon"), e = h.relatedTarget;
|
|
1354
|
+
c && c.classList.contains("upload-info-icon") && (!e || !o.contains(e) ? r(null) : e.closest(".upload-info-icon") || r(null));
|
|
1355
1355
|
};
|
|
1356
|
-
return o.addEventListener("mouseover", y, !0), o.addEventListener("mouseout",
|
|
1357
|
-
o.removeEventListener("mouseover", y, !0), o.removeEventListener("mouseout",
|
|
1356
|
+
return o.addEventListener("mouseover", y, !0), o.addEventListener("mouseout", S, !0), () => {
|
|
1357
|
+
o.removeEventListener("mouseover", y, !0), o.removeEventListener("mouseout", S, !0);
|
|
1358
1358
|
};
|
|
1359
|
-
}, [
|
|
1359
|
+
}, [p, l, t, r]);
|
|
1360
1360
|
}
|
|
1361
|
-
function Vt(t,
|
|
1361
|
+
function Vt(t, p, l, r) {
|
|
1362
1362
|
le(() => {
|
|
1363
1363
|
if (!t.current) return;
|
|
1364
1364
|
const o = (c) => {
|
|
1365
|
-
if (
|
|
1365
|
+
if (r === "hideTagClose")
|
|
1366
1366
|
return;
|
|
1367
1367
|
const e = c.currentTarget, w = e.dataset.tooltip, u = e.dataset.tagKey || "";
|
|
1368
1368
|
w && l({ key: u, anchorEl: e, type: "tag" });
|
|
1369
1369
|
}, y = () => {
|
|
1370
1370
|
l(null);
|
|
1371
1371
|
};
|
|
1372
|
-
let
|
|
1373
|
-
const
|
|
1372
|
+
let S;
|
|
1373
|
+
const h = () => {
|
|
1374
1374
|
if (!t.current) return;
|
|
1375
1375
|
t.current.querySelectorAll(
|
|
1376
1376
|
".tag-node[data-tooltip]"
|
|
@@ -1378,47 +1378,47 @@ function Vt(t, d, l, a) {
|
|
|
1378
1378
|
e.addEventListener("mouseenter", o), e.addEventListener("mouseleave", y);
|
|
1379
1379
|
});
|
|
1380
1380
|
};
|
|
1381
|
-
return
|
|
1382
|
-
|
|
1381
|
+
return S = requestAnimationFrame(() => {
|
|
1382
|
+
S = requestAnimationFrame(h);
|
|
1383
1383
|
}), () => {
|
|
1384
|
-
cancelAnimationFrame(
|
|
1384
|
+
cancelAnimationFrame(S), t.current && t.current.querySelectorAll(
|
|
1385
1385
|
".tag-node[data-tooltip]"
|
|
1386
1386
|
).forEach((e) => {
|
|
1387
1387
|
e.removeEventListener("mouseenter", o), e.removeEventListener("mouseleave", y);
|
|
1388
1388
|
});
|
|
1389
1389
|
};
|
|
1390
|
-
}, [
|
|
1390
|
+
}, [p, t, l, r]);
|
|
1391
1391
|
}
|
|
1392
|
-
function Lt(t,
|
|
1392
|
+
function Lt(t, p, l) {
|
|
1393
1393
|
le(() => {
|
|
1394
|
-
const
|
|
1395
|
-
if (!
|
|
1396
|
-
const o = (
|
|
1397
|
-
const
|
|
1398
|
-
if (
|
|
1399
|
-
const c =
|
|
1400
|
-
c && l({ key: c, anchorEl:
|
|
1394
|
+
const r = t.current;
|
|
1395
|
+
if (!r) return;
|
|
1396
|
+
const o = (S) => {
|
|
1397
|
+
const h = S.target?.closest(".variable-info-icon");
|
|
1398
|
+
if (h && h.classList.contains("variable-info-icon")) {
|
|
1399
|
+
const c = h.dataset.variableKey;
|
|
1400
|
+
c && l({ key: c, anchorEl: h, type: "variable" });
|
|
1401
1401
|
}
|
|
1402
|
-
}, y = (
|
|
1403
|
-
const
|
|
1404
|
-
|
|
1402
|
+
}, y = (S) => {
|
|
1403
|
+
const h = S.target?.closest(".variable-info-icon"), c = S.relatedTarget;
|
|
1404
|
+
h && h.classList.contains("variable-info-icon") && (!c || !r.contains(c) ? l(null) : c.closest(".variable-info-icon") || l(null));
|
|
1405
1405
|
};
|
|
1406
|
-
return
|
|
1407
|
-
|
|
1406
|
+
return r.addEventListener("mouseover", o, !0), r.addEventListener("mouseout", y, !0), () => {
|
|
1407
|
+
r.removeEventListener("mouseover", o, !0), r.removeEventListener("mouseout", y, !0);
|
|
1408
1408
|
};
|
|
1409
|
-
}, [
|
|
1409
|
+
}, [p, t, l]);
|
|
1410
1410
|
}
|
|
1411
|
-
function Pt(t,
|
|
1411
|
+
function Pt(t, p, l, r) {
|
|
1412
1412
|
le(() => {
|
|
1413
1413
|
if (!t.current) return;
|
|
1414
1414
|
const o = (c) => {
|
|
1415
1415
|
const e = c.currentTarget;
|
|
1416
|
-
e.dataset.fileName &&
|
|
1416
|
+
e.dataset.fileName && r({ key: "", anchorEl: e, type: "upload-label" });
|
|
1417
1417
|
}, y = () => {
|
|
1418
|
-
|
|
1418
|
+
r(null);
|
|
1419
1419
|
};
|
|
1420
|
-
let
|
|
1421
|
-
const
|
|
1420
|
+
let S;
|
|
1421
|
+
const h = () => {
|
|
1422
1422
|
if (!t.current) return;
|
|
1423
1423
|
t.current.querySelectorAll(
|
|
1424
1424
|
".upload-label[data-file-name]"
|
|
@@ -1426,52 +1426,52 @@ function Pt(t, d, l, a) {
|
|
|
1426
1426
|
e.addEventListener("mouseenter", o), e.addEventListener("mouseleave", y);
|
|
1427
1427
|
});
|
|
1428
1428
|
};
|
|
1429
|
-
return
|
|
1430
|
-
|
|
1429
|
+
return S = requestAnimationFrame(() => {
|
|
1430
|
+
S = requestAnimationFrame(h);
|
|
1431
1431
|
}), () => {
|
|
1432
|
-
cancelAnimationFrame(
|
|
1432
|
+
cancelAnimationFrame(S), t.current && t.current.querySelectorAll(
|
|
1433
1433
|
".upload-label[data-file-name]"
|
|
1434
1434
|
).forEach((e) => {
|
|
1435
1435
|
e.removeEventListener("mouseenter", o), e.removeEventListener("mouseleave", y);
|
|
1436
1436
|
});
|
|
1437
1437
|
};
|
|
1438
|
-
}, [
|
|
1438
|
+
}, [p, l, t, r]);
|
|
1439
1439
|
}
|
|
1440
|
-
function Bt(t,
|
|
1440
|
+
function Bt(t, p, l, r) {
|
|
1441
1441
|
le(() => {
|
|
1442
|
-
Ve(t,
|
|
1443
|
-
}, [l,
|
|
1442
|
+
Ve(t, p, l), Le(t, p, l, r);
|
|
1443
|
+
}, [l, p, t, r]);
|
|
1444
1444
|
}
|
|
1445
|
-
function Ot(t,
|
|
1445
|
+
function Ot(t, p) {
|
|
1446
1446
|
le(() => {
|
|
1447
1447
|
if (!t.current) return;
|
|
1448
|
-
let l = !1,
|
|
1448
|
+
let l = !1, r = 0;
|
|
1449
1449
|
const o = () => {
|
|
1450
1450
|
l = !0;
|
|
1451
1451
|
}, y = () => {
|
|
1452
|
-
l = !1,
|
|
1452
|
+
l = !1, r = Date.now();
|
|
1453
1453
|
};
|
|
1454
|
-
let
|
|
1454
|
+
let S = !1, h = 0;
|
|
1455
1455
|
const c = () => {
|
|
1456
|
-
|
|
1456
|
+
S = !0;
|
|
1457
1457
|
}, e = () => {
|
|
1458
|
-
|
|
1458
|
+
S = !1, h = Date.now();
|
|
1459
1459
|
}, w = () => {
|
|
1460
|
-
|
|
1460
|
+
h = Date.now();
|
|
1461
1461
|
}, u = () => {
|
|
1462
1462
|
if (!t.current) return;
|
|
1463
|
-
const
|
|
1464
|
-
if (!
|
|
1463
|
+
const m = window.getSelection();
|
|
1464
|
+
if (!m || m.rangeCount === 0 || p.current || l || S || Date.now() - h < 500)
|
|
1465
1465
|
return;
|
|
1466
|
-
const
|
|
1467
|
-
if (!
|
|
1468
|
-
return t.current.contains(
|
|
1469
|
-
const C =
|
|
1466
|
+
const a = m.getRangeAt(0);
|
|
1467
|
+
if (!a.collapsed)
|
|
1468
|
+
return t.current.contains(a.commonAncestorContainer), void 0;
|
|
1469
|
+
const C = m.anchorNode;
|
|
1470
1470
|
if (!C || !t.current.contains(C))
|
|
1471
1471
|
return;
|
|
1472
1472
|
let i = null;
|
|
1473
1473
|
if (C.nodeType === Node.ELEMENT_NODE ? i = C.closest('[data-type="variable"]') : C.nodeType === Node.TEXT_NODE && C.parentElement && (i = C.parentElement.closest('[data-type="variable"]')), !i) {
|
|
1474
|
-
if (Date.now() -
|
|
1474
|
+
if (Date.now() - r > 500)
|
|
1475
1475
|
return;
|
|
1476
1476
|
const E = t.current.querySelectorAll('[data-type="variable"]');
|
|
1477
1477
|
if (E.length > 0) {
|
|
@@ -1483,134 +1483,134 @@ function Ot(t, d) {
|
|
|
1483
1483
|
}
|
|
1484
1484
|
if (!T && E.length > 0 && (T = E[0]), T) {
|
|
1485
1485
|
const A = document.createRange();
|
|
1486
|
-
A.selectNodeContents(T), A.collapse(!1),
|
|
1486
|
+
A.selectNodeContents(T), A.collapse(!1), m.removeAllRanges(), m.addRange(A), T.focus();
|
|
1487
1487
|
} else
|
|
1488
|
-
|
|
1488
|
+
m.removeAllRanges();
|
|
1489
1489
|
} else
|
|
1490
|
-
|
|
1490
|
+
m.removeAllRanges();
|
|
1491
1491
|
}
|
|
1492
|
-
},
|
|
1493
|
-
return
|
|
1494
|
-
const
|
|
1495
|
-
|
|
1492
|
+
}, q = t.current;
|
|
1493
|
+
return q && (q.addEventListener("compositionstart", c), q.addEventListener("compositionend", e), q.addEventListener("input", w)), document.addEventListener("mousedown", o), document.addEventListener("mouseup", y), document.addEventListener("selectionchange", u), () => {
|
|
1494
|
+
const m = t.current;
|
|
1495
|
+
m && (m.removeEventListener("compositionstart", c), m.removeEventListener("compositionend", e), m.removeEventListener("input", w)), document.removeEventListener("mousedown", o), document.removeEventListener("mouseup", y), document.removeEventListener("selectionchange", u);
|
|
1496
1496
|
};
|
|
1497
|
-
}, [t,
|
|
1497
|
+
}, [t, p]);
|
|
1498
1498
|
}
|
|
1499
1499
|
const Mt = ({
|
|
1500
1500
|
config: t,
|
|
1501
|
-
onSend:
|
|
1501
|
+
onSend: p,
|
|
1502
1502
|
isProcessing: l = !1,
|
|
1503
|
-
disabled:
|
|
1503
|
+
disabled: r = !1,
|
|
1504
1504
|
width: o,
|
|
1505
1505
|
lockStructure: y = !1,
|
|
1506
|
-
agentOptions:
|
|
1507
|
-
onAgentSelect:
|
|
1506
|
+
agentOptions: S = [],
|
|
1507
|
+
onAgentSelect: h,
|
|
1508
1508
|
onAgentExit: c,
|
|
1509
1509
|
loading: e = !1,
|
|
1510
1510
|
placeholder: w,
|
|
1511
1511
|
border: u,
|
|
1512
|
-
background:
|
|
1513
|
-
hideButtons:
|
|
1512
|
+
background: q = "transparent",
|
|
1513
|
+
hideButtons: m
|
|
1514
1514
|
}) => {
|
|
1515
|
-
const
|
|
1516
|
-
const
|
|
1517
|
-
return t.forEach((
|
|
1518
|
-
|
|
1519
|
-
}),
|
|
1515
|
+
const a = F(null), C = F(null), [i, E] = Q({}), [T, A] = Q(null), [v, V] = Q(null), _ = F(!1), P = F(null), [D, B] = Q(!1), X = F(null), [z, K] = Q(!0), [ee, k] = Q(() => {
|
|
1516
|
+
const d = {};
|
|
1517
|
+
return t.forEach((f) => {
|
|
1518
|
+
f.type === "multi-variable" && f.key && (d[f.key] = 1);
|
|
1519
|
+
}), d;
|
|
1520
1520
|
}), I = F({}), Z = F({}), te = F({});
|
|
1521
1521
|
le(() => {
|
|
1522
1522
|
Z.current = i;
|
|
1523
1523
|
}, [i]), le(() => {
|
|
1524
1524
|
te.current = ee;
|
|
1525
1525
|
}, [ee]);
|
|
1526
|
-
const pe = U((
|
|
1526
|
+
const pe = U((d) => d.find((g) => g.type === "tag")?.text || null, []), ge = F(t), s = F(null);
|
|
1527
1527
|
le(() => {
|
|
1528
|
-
const
|
|
1529
|
-
if (
|
|
1530
|
-
const
|
|
1531
|
-
|
|
1532
|
-
const x =
|
|
1528
|
+
const d = pe(ge.current), f = pe(t);
|
|
1529
|
+
if (d && d !== f && a.current) {
|
|
1530
|
+
const g = {};
|
|
1531
|
+
a.current.querySelectorAll('[data-type="variable"]').forEach((b) => {
|
|
1532
|
+
const x = b.dataset.key;
|
|
1533
1533
|
if (x) {
|
|
1534
|
-
const N =
|
|
1535
|
-
N && (
|
|
1534
|
+
const N = b.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
1535
|
+
N && (g[x] = N);
|
|
1536
1536
|
}
|
|
1537
|
-
}), I.current[
|
|
1538
|
-
variableValues:
|
|
1537
|
+
}), I.current[d] = {
|
|
1538
|
+
variableValues: g,
|
|
1539
1539
|
files: { ...Z.current },
|
|
1540
1540
|
multiVariableCounts: { ...te.current }
|
|
1541
1541
|
};
|
|
1542
1542
|
}
|
|
1543
|
-
if (
|
|
1544
|
-
const
|
|
1545
|
-
s.current =
|
|
1546
|
-
} else if (
|
|
1543
|
+
if (f && I.current[f]) {
|
|
1544
|
+
const g = I.current[f];
|
|
1545
|
+
s.current = g, E(g.files), k(g.multiVariableCounts);
|
|
1546
|
+
} else if (f) {
|
|
1547
1547
|
s.current = null;
|
|
1548
|
-
const
|
|
1548
|
+
const g = {};
|
|
1549
1549
|
t.forEach(($) => {
|
|
1550
|
-
$.type === "multi-variable" && $.key && (
|
|
1551
|
-
}), k(
|
|
1550
|
+
$.type === "multi-variable" && $.key && (g[$.key] = 1);
|
|
1551
|
+
}), k(g), E({});
|
|
1552
1552
|
} else
|
|
1553
1553
|
s.current = null, k({}), E({});
|
|
1554
1554
|
ge.current = t;
|
|
1555
1555
|
}, [t, pe]), Ge(() => {
|
|
1556
|
-
s.current &&
|
|
1556
|
+
s.current && a.current && (a.current.__tempVariableValues = s.current.variableValues, setTimeout(() => {
|
|
1557
1557
|
s.current && (s.current = null);
|
|
1558
1558
|
}, 0));
|
|
1559
|
-
}), Rt(
|
|
1559
|
+
}), Rt(a, t, i, y, ee, X, void 0, m), It(a, t, i, V), Vt(a, t, V, m), Pt(a, t, i, V), Lt(a, t, V), Bt(a, t, i, B), Ot(a, _), le(() => {
|
|
1560
1560
|
if (t.length > 0) {
|
|
1561
1561
|
K(!1);
|
|
1562
1562
|
return;
|
|
1563
1563
|
}
|
|
1564
|
-
const
|
|
1565
|
-
if (!
|
|
1564
|
+
const d = () => {
|
|
1565
|
+
if (!a.current) {
|
|
1566
1566
|
K(!0);
|
|
1567
1567
|
return;
|
|
1568
1568
|
}
|
|
1569
|
-
const
|
|
1569
|
+
const g = a.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "", $ = a.current.querySelectorAll('[data-type="variable"]'), b = a.current.querySelectorAll('[data-type="upload"]');
|
|
1570
1570
|
let x = !1;
|
|
1571
1571
|
$.forEach((R) => {
|
|
1572
1572
|
(R.textContent?.replace(/[\u200B\n]/g, "").trim() || "") && (x = !0);
|
|
1573
|
-
}),
|
|
1573
|
+
}), b.forEach((R) => {
|
|
1574
1574
|
R.querySelector(".upload-inner-wrapper.has-file") && (x = !0);
|
|
1575
1575
|
});
|
|
1576
|
-
const N = !
|
|
1576
|
+
const N = !g && !x;
|
|
1577
1577
|
K(N), t.length === 0 && B(!N);
|
|
1578
1578
|
};
|
|
1579
|
-
|
|
1580
|
-
const
|
|
1581
|
-
return
|
|
1579
|
+
d();
|
|
1580
|
+
const f = new MutationObserver(d);
|
|
1581
|
+
return a.current && f.observe(a.current, {
|
|
1582
1582
|
childList: !0,
|
|
1583
1583
|
subtree: !0,
|
|
1584
1584
|
characterData: !0
|
|
1585
1585
|
}), () => {
|
|
1586
|
-
|
|
1586
|
+
f.disconnect();
|
|
1587
1587
|
};
|
|
1588
1588
|
}, [t]);
|
|
1589
|
-
const L = (
|
|
1590
|
-
if (
|
|
1591
|
-
|
|
1589
|
+
const L = (d) => {
|
|
1590
|
+
if (r) {
|
|
1591
|
+
d.preventDefault();
|
|
1592
1592
|
return;
|
|
1593
1593
|
}
|
|
1594
|
-
|
|
1595
|
-
const
|
|
1596
|
-
if (
|
|
1597
|
-
const $ =
|
|
1594
|
+
d.preventDefault();
|
|
1595
|
+
const f = d.clipboardData.getData("text/plain"), g = window.getSelection();
|
|
1596
|
+
if (g && g.rangeCount > 0) {
|
|
1597
|
+
const $ = g.anchorNode;
|
|
1598
1598
|
if ($) {
|
|
1599
|
-
let
|
|
1600
|
-
if ($.nodeType === Node.ELEMENT_NODE ?
|
|
1601
|
-
const x =
|
|
1599
|
+
let b = null;
|
|
1600
|
+
if ($.nodeType === Node.ELEMENT_NODE ? b = $.closest('[data-type="variable"]') : $.nodeType === Node.TEXT_NODE && $.parentElement && (b = $.parentElement.closest('[data-type="variable"]')), b) {
|
|
1601
|
+
const x = b.dataset.multiKey;
|
|
1602
1602
|
if (x) {
|
|
1603
|
-
const N = /[、,,\s\n\r\t]+/, R =
|
|
1604
|
-
if (console.log("[Paste Event] 粘贴的内容:",
|
|
1605
|
-
const j = parseInt(
|
|
1603
|
+
const N = /[、,,\s\n\r\t]+/, R = f.split(N).map((j) => j.trim()).filter((j) => j.length > 0);
|
|
1604
|
+
if (console.log("[Paste Event] 粘贴的内容:", f), console.log("[Paste Event] 拆分后的值:", R), R.length > 1) {
|
|
1605
|
+
const j = parseInt(b.dataset.index || "0", 10), O = t.find((ae) => ae.type === "multi-variable" && ae.key === x)?.maxCount || 9, oe = ee[x] || 1, H = Math.min(j + R.length, O);
|
|
1606
1606
|
H > oe && k((J) => ({
|
|
1607
1607
|
...J,
|
|
1608
1608
|
[x]: H
|
|
1609
1609
|
}));
|
|
1610
1610
|
const se = [];
|
|
1611
1611
|
for (let J = 0; J < oe; J++) {
|
|
1612
|
-
const
|
|
1613
|
-
`[data-type="variable"][data-key="${
|
|
1612
|
+
const ae = `${x}_${J}`, me = a.current.querySelector(
|
|
1613
|
+
`[data-type="variable"][data-key="${ae}"][data-multi-key="${x}"]`
|
|
1614
1614
|
);
|
|
1615
1615
|
if (me) {
|
|
1616
1616
|
const he = me.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
@@ -1621,17 +1621,17 @@ const Mt = ({
|
|
|
1621
1621
|
const ne = se.slice(0, O);
|
|
1622
1622
|
ne.length > 0 && ne[ne.length - 1] !== "" && ne.length < O && ne.push("");
|
|
1623
1623
|
const W = Math.max(ne.length, 1), ce = {};
|
|
1624
|
-
ne.forEach((J,
|
|
1625
|
-
J && (ce[`${x}_${
|
|
1626
|
-
}),
|
|
1624
|
+
ne.forEach((J, ae) => {
|
|
1625
|
+
J && (ce[`${x}_${ae}`] = J);
|
|
1626
|
+
}), a.current.querySelectorAll(
|
|
1627
1627
|
'[data-type="variable"]'
|
|
1628
1628
|
).forEach((J) => {
|
|
1629
|
-
const
|
|
1630
|
-
if (
|
|
1629
|
+
const ae = J.dataset.key, me = J.dataset.multiKey;
|
|
1630
|
+
if (ae && me !== x) {
|
|
1631
1631
|
const he = J.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
1632
|
-
he && (ce[
|
|
1632
|
+
he && (ce[ae] = he);
|
|
1633
1633
|
}
|
|
1634
|
-
}),
|
|
1634
|
+
}), a.current.__tempVariableValues = ce, k((J) => ({
|
|
1635
1635
|
...J,
|
|
1636
1636
|
[x]: W
|
|
1637
1637
|
})), console.log("[Paste Event] 粘贴完成,已填充到多个输入框,值:", ne);
|
|
@@ -1641,133 +1641,133 @@ const Mt = ({
|
|
|
1641
1641
|
}
|
|
1642
1642
|
}
|
|
1643
1643
|
}
|
|
1644
|
-
document.execCommand("insertText", !1,
|
|
1644
|
+
document.execCommand("insertText", !1, f), ue(), setTimeout(() => {
|
|
1645
1645
|
const $ = window.getSelection();
|
|
1646
1646
|
if ($ && $.rangeCount > 0) {
|
|
1647
|
-
const
|
|
1648
|
-
if (
|
|
1647
|
+
const b = $.anchorNode;
|
|
1648
|
+
if (b) {
|
|
1649
1649
|
let x = null;
|
|
1650
|
-
if (
|
|
1650
|
+
if (b.nodeType === Node.ELEMENT_NODE ? x = b.closest('[data-type="variable"][data-multi-key]') : b.nodeType === Node.TEXT_NODE && b.parentElement && (x = b.parentElement.closest('[data-type="variable"][data-multi-key]')), x) {
|
|
1651
1651
|
const N = x.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
1652
1652
|
/[、,,\s]+/.test(N) && (console.log("[Paste Event] 粘贴后检测到分隔符,内容:", N), console.log("[Paste Event] 提示:失去焦点后将自动拆分"));
|
|
1653
1653
|
}
|
|
1654
1654
|
}
|
|
1655
1655
|
}
|
|
1656
1656
|
}, 0);
|
|
1657
|
-
}, Y = (
|
|
1658
|
-
if (
|
|
1659
|
-
const
|
|
1660
|
-
E(($) => ({ ...$, [
|
|
1661
|
-
}
|
|
1662
|
-
|
|
1663
|
-
},
|
|
1664
|
-
E((
|
|
1665
|
-
const
|
|
1666
|
-
return delete
|
|
1657
|
+
}, Y = (d) => {
|
|
1658
|
+
if (d.target.files && d.target.files[0] && T) {
|
|
1659
|
+
const f = d.target.files[0], g = T;
|
|
1660
|
+
E(($) => ({ ...$, [g]: f }));
|
|
1661
|
+
}
|
|
1662
|
+
d.target && (d.target.value = ""), A(null);
|
|
1663
|
+
}, re = (d) => {
|
|
1664
|
+
E((f) => {
|
|
1665
|
+
const g = { ...f };
|
|
1666
|
+
return delete g[d], g;
|
|
1667
1667
|
});
|
|
1668
|
-
}, fe = (
|
|
1669
|
-
const
|
|
1670
|
-
if (
|
|
1671
|
-
if (
|
|
1668
|
+
}, fe = (d) => {
|
|
1669
|
+
const f = d.target;
|
|
1670
|
+
if (f.closest(".tag-close-btn")) {
|
|
1671
|
+
if (d.preventDefault(), d.stopPropagation(), y)
|
|
1672
1672
|
return;
|
|
1673
|
-
V(null), c ? c() :
|
|
1673
|
+
V(null), c ? c() : a.current && (a.current.innerHTML = "", a.current.focus());
|
|
1674
1674
|
return;
|
|
1675
1675
|
}
|
|
1676
1676
|
if (y) {
|
|
1677
|
-
const
|
|
1678
|
-
if (
|
|
1679
|
-
|
|
1677
|
+
const b = f.closest(".tag-node"), x = f.closest('[data-type="text"]');
|
|
1678
|
+
if (b || x) {
|
|
1679
|
+
d.preventDefault(), d.stopPropagation();
|
|
1680
1680
|
const N = window.getSelection();
|
|
1681
1681
|
N && N.removeAllRanges();
|
|
1682
1682
|
return;
|
|
1683
1683
|
}
|
|
1684
1684
|
}
|
|
1685
|
-
|
|
1686
|
-
}, ie = (
|
|
1687
|
-
if (!
|
|
1688
|
-
const $ = Math.abs(
|
|
1689
|
-
($ > 3 ||
|
|
1685
|
+
f.closest('[data-type="variable"]') || (P.current = { x: d.clientX, y: d.clientY }, _.current = !1, f.closest(".file-remove-btn") && (d.preventDefault(), d.stopPropagation()));
|
|
1686
|
+
}, ie = (d) => {
|
|
1687
|
+
if (!d.target.closest('[data-type="variable"]') && P.current) {
|
|
1688
|
+
const $ = Math.abs(d.clientX - P.current.x), b = Math.abs(d.clientY - P.current.y);
|
|
1689
|
+
($ > 3 || b > 3) && (_.current = !0);
|
|
1690
1690
|
}
|
|
1691
|
-
}, xe = (
|
|
1692
|
-
if (
|
|
1691
|
+
}, xe = (d) => {
|
|
1692
|
+
if (d.target.closest('[data-type="variable"]')) {
|
|
1693
1693
|
P.current = null, _.current = !1;
|
|
1694
1694
|
return;
|
|
1695
1695
|
}
|
|
1696
1696
|
P.current = null, _.current = !1;
|
|
1697
|
-
}, M = (
|
|
1698
|
-
if (
|
|
1697
|
+
}, M = (d) => {
|
|
1698
|
+
if (r)
|
|
1699
1699
|
return;
|
|
1700
|
-
const
|
|
1701
|
-
if (
|
|
1702
|
-
|
|
1700
|
+
const f = d.target;
|
|
1701
|
+
if (f.closest(".tag-close-btn")) {
|
|
1702
|
+
d.preventDefault(), d.stopPropagation();
|
|
1703
1703
|
return;
|
|
1704
1704
|
}
|
|
1705
1705
|
if (t.length === 0)
|
|
1706
1706
|
return;
|
|
1707
|
-
if (
|
|
1708
|
-
|
|
1707
|
+
if (f.closest('[data-type="text"]')) {
|
|
1708
|
+
d.preventDefault(), d.stopPropagation();
|
|
1709
1709
|
const R = window.getSelection();
|
|
1710
1710
|
R && R.removeAllRanges();
|
|
1711
1711
|
return;
|
|
1712
1712
|
}
|
|
1713
|
-
if (y &&
|
|
1714
|
-
|
|
1713
|
+
if (y && f.closest(".tag-node")) {
|
|
1714
|
+
d.preventDefault(), d.stopPropagation();
|
|
1715
1715
|
const j = window.getSelection();
|
|
1716
1716
|
j && j.removeAllRanges();
|
|
1717
1717
|
return;
|
|
1718
1718
|
}
|
|
1719
|
-
if (
|
|
1719
|
+
if (f.closest('[data-type="variable"]')) {
|
|
1720
1720
|
if (_.current)
|
|
1721
1721
|
return;
|
|
1722
1722
|
setTimeout(() => {
|
|
1723
1723
|
const R = window.getSelection();
|
|
1724
|
-
R && !R.isCollapsed || Ie(
|
|
1724
|
+
R && !R.isCollapsed || Ie(a);
|
|
1725
1725
|
}, 10);
|
|
1726
1726
|
return;
|
|
1727
1727
|
}
|
|
1728
|
-
const x =
|
|
1728
|
+
const x = f.closest(".file-remove-btn");
|
|
1729
1729
|
if (x) {
|
|
1730
|
-
|
|
1730
|
+
d.preventDefault(), d.stopPropagation();
|
|
1731
1731
|
const j = x.closest('[data-type="upload"]')?.dataset.key;
|
|
1732
|
-
j &&
|
|
1732
|
+
j && re(j);
|
|
1733
1733
|
return;
|
|
1734
1734
|
}
|
|
1735
|
-
const N =
|
|
1735
|
+
const N = f.closest('[data-type="upload"]');
|
|
1736
1736
|
if (N) {
|
|
1737
1737
|
const R = N.dataset.key;
|
|
1738
1738
|
R && (A(R), C.current?.click());
|
|
1739
1739
|
return;
|
|
1740
1740
|
}
|
|
1741
|
-
}, G = (
|
|
1742
|
-
const
|
|
1743
|
-
if (
|
|
1741
|
+
}, G = (d) => {
|
|
1742
|
+
const g = d.target.closest('[data-type="variable"]');
|
|
1743
|
+
if (g) {
|
|
1744
1744
|
const $ = window.getSelection();
|
|
1745
1745
|
if ($) {
|
|
1746
|
-
const
|
|
1746
|
+
const b = document.createRange(), x = g.textContent || "";
|
|
1747
1747
|
if (x.replace(/\u200B/g, "")) {
|
|
1748
1748
|
let R = 0, j = x.length;
|
|
1749
1749
|
x.startsWith("") && (R = 1), x.endsWith("") && x.length > 1 && (j = x.length - 1);
|
|
1750
|
-
const O =
|
|
1751
|
-
O && O.nodeType === Node.TEXT_NODE ? (
|
|
1750
|
+
const O = g.firstChild;
|
|
1751
|
+
O && O.nodeType === Node.TEXT_NODE ? (b.setStart(O, R), b.setEnd(O, j)) : b.selectNodeContents(g);
|
|
1752
1752
|
} else
|
|
1753
|
-
|
|
1754
|
-
$.removeAllRanges(), $.addRange(
|
|
1753
|
+
b.selectNodeContents(g), b.collapse(!0);
|
|
1754
|
+
$.removeAllRanges(), $.addRange(b);
|
|
1755
1755
|
}
|
|
1756
1756
|
}
|
|
1757
1757
|
}, ue = () => {
|
|
1758
1758
|
if (t.length === 0) {
|
|
1759
|
-
if (
|
|
1760
|
-
const
|
|
1761
|
-
K(
|
|
1759
|
+
if (a.current) {
|
|
1760
|
+
const g = !(a.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "");
|
|
1761
|
+
K(g), B(!g);
|
|
1762
1762
|
}
|
|
1763
1763
|
return;
|
|
1764
1764
|
}
|
|
1765
|
-
if (Ie(
|
|
1766
|
-
const $ =
|
|
1765
|
+
if (Ie(a), a.current && a.current.querySelectorAll('[data-type="variable"]').forEach((g) => {
|
|
1766
|
+
const $ = g.querySelector(".variable-info-icon");
|
|
1767
1767
|
if ($) {
|
|
1768
|
-
let
|
|
1768
|
+
let b = !1;
|
|
1769
1769
|
const x = document.createTreeWalker(
|
|
1770
|
-
|
|
1770
|
+
g,
|
|
1771
1771
|
NodeFilter.SHOW_TEXT,
|
|
1772
1772
|
{
|
|
1773
1773
|
acceptNode: (N) => $.contains(N) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT
|
|
@@ -1775,28 +1775,28 @@ const Mt = ({
|
|
|
1775
1775
|
);
|
|
1776
1776
|
for (; x.nextNode(); )
|
|
1777
1777
|
if (x.currentNode.textContent?.replace(/[\u200B\n]/g, "").trim()) {
|
|
1778
|
-
|
|
1778
|
+
b = !0;
|
|
1779
1779
|
break;
|
|
1780
1780
|
}
|
|
1781
|
-
|
|
1781
|
+
b ? $.classList.add("hidden") : $.classList.remove("hidden");
|
|
1782
1782
|
}
|
|
1783
|
-
}), Ve(
|
|
1784
|
-
t.filter((
|
|
1785
|
-
if (!
|
|
1786
|
-
const
|
|
1783
|
+
}), Ve(a, t, i), Le(a, t, i, B), !a.current) return;
|
|
1784
|
+
t.filter((f) => f.type === "multi-variable" && f.key).forEach((f) => {
|
|
1785
|
+
if (!f.key) return;
|
|
1786
|
+
const g = f.maxCount || 9, $ = ee[f.key] || 1, b = [];
|
|
1787
1787
|
for (let O = 0; O < $; O++) {
|
|
1788
|
-
const oe = `${
|
|
1789
|
-
`[data-type="variable"][data-key="${oe}"][data-multi-key="${
|
|
1788
|
+
const oe = `${f.key}_${O}`, H = a.current.querySelector(
|
|
1789
|
+
`[data-type="variable"][data-key="${oe}"][data-multi-key="${f.key}"]`
|
|
1790
1790
|
);
|
|
1791
1791
|
if (H) {
|
|
1792
1792
|
const se = H.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
1793
|
-
|
|
1793
|
+
b.push(se);
|
|
1794
1794
|
}
|
|
1795
1795
|
}
|
|
1796
|
-
const N = (
|
|
1796
|
+
const N = (b[b.length - 1] || "") === "";
|
|
1797
1797
|
let R = !1, j = -1;
|
|
1798
|
-
for (let O = 0; O <
|
|
1799
|
-
if (
|
|
1798
|
+
for (let O = 0; O < b.length - 1; O++)
|
|
1799
|
+
if (b[O] === "") {
|
|
1800
1800
|
R = !0, j = O;
|
|
1801
1801
|
break;
|
|
1802
1802
|
}
|
|
@@ -1807,103 +1807,103 @@ const Mt = ({
|
|
|
1807
1807
|
if (de) {
|
|
1808
1808
|
const J = de.dataset.key;
|
|
1809
1809
|
if (J) {
|
|
1810
|
-
const
|
|
1811
|
-
|
|
1812
|
-
const me =
|
|
1810
|
+
const ae = document.createRange();
|
|
1811
|
+
ae.setStartBefore(de), ae.setEnd(W.startContainer, W.startOffset);
|
|
1812
|
+
const me = ae.toString().length;
|
|
1813
1813
|
X.current = { key: J, offset: me };
|
|
1814
1814
|
}
|
|
1815
1815
|
}
|
|
1816
1816
|
}
|
|
1817
|
-
const oe = [...
|
|
1817
|
+
const oe = [...b];
|
|
1818
1818
|
for (let W = j; W < oe.length - 1; W++)
|
|
1819
1819
|
oe[W] = oe[W + 1];
|
|
1820
1820
|
oe.pop();
|
|
1821
1821
|
const H = {};
|
|
1822
1822
|
oe.forEach((W, ce) => {
|
|
1823
|
-
W && (H[`${
|
|
1823
|
+
W && (H[`${f.key}_${ce}`] = W);
|
|
1824
1824
|
});
|
|
1825
1825
|
const se = Math.max(N ? oe.length : oe.length + 1, 1);
|
|
1826
|
-
|
|
1826
|
+
a.current.querySelectorAll(
|
|
1827
1827
|
'[data-type="variable"]'
|
|
1828
1828
|
).forEach((W) => {
|
|
1829
1829
|
const ce = W.dataset.key, de = W.dataset.multiKey;
|
|
1830
|
-
if (ce && de !==
|
|
1830
|
+
if (ce && de !== f.key) {
|
|
1831
1831
|
const J = W.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
1832
1832
|
J && (H[ce] = J);
|
|
1833
1833
|
}
|
|
1834
|
-
}),
|
|
1834
|
+
}), a.current.__tempVariableValues = H, k((W) => ({
|
|
1835
1835
|
...W,
|
|
1836
|
-
[
|
|
1836
|
+
[f.key]: se
|
|
1837
1837
|
}));
|
|
1838
1838
|
return;
|
|
1839
1839
|
}
|
|
1840
1840
|
if (!N) {
|
|
1841
|
-
const O = $ - 1, oe = `${
|
|
1842
|
-
`[data-type="variable"][data-key="${oe}"][data-multi-key="${
|
|
1841
|
+
const O = $ - 1, oe = `${f.key}_${O}`, H = a.current.querySelector(
|
|
1842
|
+
`[data-type="variable"][data-key="${oe}"][data-multi-key="${f.key}"]`
|
|
1843
1843
|
);
|
|
1844
|
-
if (H && H.innerText.replace(/[\u200B\n]/g, "").trim().length > 0 && $ <
|
|
1844
|
+
if (H && H.innerText.replace(/[\u200B\n]/g, "").trim().length > 0 && $ < g) {
|
|
1845
1845
|
const ne = window.getSelection();
|
|
1846
1846
|
if (ne && ne.rangeCount > 0) {
|
|
1847
1847
|
const W = ne.getRangeAt(0), ce = W.startContainer, de = ce.nodeType === Node.ELEMENT_NODE ? ce.closest('[data-type="variable"][data-multi-key]') : ce.parentElement?.closest('[data-type="variable"][data-multi-key]');
|
|
1848
1848
|
if (de) {
|
|
1849
1849
|
const J = de.dataset.key;
|
|
1850
1850
|
if (J) {
|
|
1851
|
-
const
|
|
1852
|
-
|
|
1853
|
-
const me =
|
|
1851
|
+
const ae = document.createRange();
|
|
1852
|
+
ae.setStartBefore(de), ae.setEnd(W.startContainer, W.startOffset);
|
|
1853
|
+
const me = ae.toString().length;
|
|
1854
1854
|
X.current = { key: J, offset: me };
|
|
1855
1855
|
}
|
|
1856
1856
|
}
|
|
1857
1857
|
}
|
|
1858
1858
|
k((W) => ({
|
|
1859
1859
|
...W,
|
|
1860
|
-
[
|
|
1860
|
+
[f.key]: $ + 1
|
|
1861
1861
|
}));
|
|
1862
1862
|
}
|
|
1863
1863
|
}
|
|
1864
1864
|
});
|
|
1865
1865
|
};
|
|
1866
1866
|
Ge(() => {
|
|
1867
|
-
const
|
|
1868
|
-
if (!
|
|
1869
|
-
const
|
|
1867
|
+
const d = a.current;
|
|
1868
|
+
if (!d) return;
|
|
1869
|
+
const f = /* @__PURE__ */ new Map(), g = (x) => {
|
|
1870
1870
|
const N = x.target, R = x.relatedTarget;
|
|
1871
|
-
!N || !
|
|
1872
|
-
if (
|
|
1871
|
+
!N || !a.current || !a.current.contains(N) || R && a.current.contains(R) || setTimeout(() => {
|
|
1872
|
+
if (a.current) {
|
|
1873
1873
|
if (t.length === 0) {
|
|
1874
|
-
const j =
|
|
1874
|
+
const j = a.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "";
|
|
1875
1875
|
B(j.length > 0);
|
|
1876
1876
|
return;
|
|
1877
1877
|
}
|
|
1878
|
-
Ie(
|
|
1878
|
+
Ie(a), Ve(a, t, i), Le(a, t, i, B);
|
|
1879
1879
|
}
|
|
1880
1880
|
}, 0);
|
|
1881
1881
|
};
|
|
1882
|
-
|
|
1882
|
+
d.addEventListener("blur", g, !0);
|
|
1883
1883
|
const $ = () => {
|
|
1884
|
-
if (!
|
|
1885
|
-
|
|
1884
|
+
if (!a.current) return;
|
|
1885
|
+
f.forEach((R, j) => {
|
|
1886
1886
|
j.removeEventListener("blur", R, !1);
|
|
1887
|
-
}),
|
|
1888
|
-
const x =
|
|
1887
|
+
}), f.clear();
|
|
1888
|
+
const x = a.current.querySelectorAll(
|
|
1889
1889
|
'[data-type="variable"][data-multi-key]'
|
|
1890
1890
|
), N = (R) => {
|
|
1891
1891
|
R.stopPropagation(), R.stopImmediatePropagation();
|
|
1892
1892
|
const j = R.target;
|
|
1893
|
-
if (!j || !
|
|
1893
|
+
if (!j || !a.current || !a.current.contains(j))
|
|
1894
1894
|
return;
|
|
1895
1895
|
const O = j.closest('[data-type="variable"][data-multi-key]');
|
|
1896
|
-
if (!O || !
|
|
1896
|
+
if (!O || !a.current.contains(O))
|
|
1897
1897
|
return;
|
|
1898
1898
|
let oe = !1;
|
|
1899
|
-
if (
|
|
1899
|
+
if (f.forEach((ae, me) => {
|
|
1900
1900
|
(me === O || me.contains(j)) && (oe = !0);
|
|
1901
1901
|
}), !oe)
|
|
1902
1902
|
return;
|
|
1903
1903
|
const H = O.dataset.multiKey, se = O.dataset.key, ne = O.dataset.index;
|
|
1904
1904
|
if (!H || !se || ne === void 0) return;
|
|
1905
1905
|
const W = R.relatedTarget;
|
|
1906
|
-
if (!(!W || !
|
|
1906
|
+
if (!(!W || !a.current.contains(W)))
|
|
1907
1907
|
return;
|
|
1908
1908
|
const de = O.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
1909
1909
|
console.log("[Blur Event] 失去焦点的 multi-variable 输入框:", {
|
|
@@ -1914,15 +1914,15 @@ const Mt = ({
|
|
|
1914
1914
|
});
|
|
1915
1915
|
const J = /[、,,\s]+/;
|
|
1916
1916
|
if (J.test(de)) {
|
|
1917
|
-
const
|
|
1918
|
-
console.log("[Blur Event] 拆分前的内容:", de), console.log("[Blur Event] 拆分后的部分:",
|
|
1919
|
-
const he =
|
|
1917
|
+
const ae = de.split(J).map((Ee) => Ee.trim()).filter((Ee) => Ee.length > 0);
|
|
1918
|
+
console.log("[Blur Event] 拆分前的内容:", de), console.log("[Blur Event] 拆分后的部分:", ae);
|
|
1919
|
+
const he = ae.slice(0, 9);
|
|
1920
1920
|
if (console.log("[Blur Event] 有效的部分(最多9个):", he), he.length > 1) {
|
|
1921
1921
|
const Ee = t.find((Se) => Se.type === "multi-variable" && Se.key === H);
|
|
1922
1922
|
if (Ee) {
|
|
1923
1923
|
const Se = ee[H] || 1, Me = parseInt(ne, 10), De = Ee.maxCount || 9, qe = [];
|
|
1924
1924
|
for (let ye = 0; ye < Se; ye++) {
|
|
1925
|
-
const Te = `${H}_${ye}`, Ae =
|
|
1925
|
+
const Te = `${H}_${ye}`, Ae = a.current.querySelector(
|
|
1926
1926
|
`[data-type="variable"][data-key="${Te}"][data-multi-key="${H}"]`
|
|
1927
1927
|
);
|
|
1928
1928
|
if (Ae) {
|
|
@@ -1931,12 +1931,12 @@ const Mt = ({
|
|
|
1931
1931
|
}
|
|
1932
1932
|
}
|
|
1933
1933
|
console.log("[Blur Event] 拆分前的所有值:", qe), console.log("[Blur Event] 当前索引:", Me), console.log("[Blur Event] 要插入的值:", he), qe.splice(Me, 1, ...he);
|
|
1934
|
-
const
|
|
1935
|
-
console.log("[Blur Event] 拆分后的所有值:",
|
|
1936
|
-
const Qe = Math.max(
|
|
1937
|
-
|
|
1934
|
+
const be = qe.slice(0, De);
|
|
1935
|
+
console.log("[Blur Event] 拆分后的所有值:", be), be.length > 0 && be[be.length - 1] !== "" && be.length < De && be.push("");
|
|
1936
|
+
const Qe = Math.max(be.length, 1), Re = {};
|
|
1937
|
+
be.forEach((ye, Te) => {
|
|
1938
1938
|
ye && (Re[`${H}_${Te}`] = ye);
|
|
1939
|
-
}),
|
|
1939
|
+
}), a.current.querySelectorAll(
|
|
1940
1940
|
'[data-type="variable"]'
|
|
1941
1941
|
).forEach((ye) => {
|
|
1942
1942
|
const Te = ye.dataset.key, Ae = ye.dataset.multiKey;
|
|
@@ -1944,7 +1944,7 @@ const Mt = ({
|
|
|
1944
1944
|
const _e = ye.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
1945
1945
|
_e && (Re[Te] = _e);
|
|
1946
1946
|
}
|
|
1947
|
-
}),
|
|
1947
|
+
}), a.current.__tempVariableValues = Re, k((ye) => ({
|
|
1948
1948
|
...ye,
|
|
1949
1949
|
[H]: Qe
|
|
1950
1950
|
}));
|
|
@@ -1953,105 +1953,105 @@ const Mt = ({
|
|
|
1953
1953
|
}
|
|
1954
1954
|
};
|
|
1955
1955
|
x.forEach((R) => {
|
|
1956
|
-
R.addEventListener("blur", N, !1),
|
|
1956
|
+
R.addEventListener("blur", N, !1), f.set(R, N);
|
|
1957
1957
|
});
|
|
1958
|
-
},
|
|
1958
|
+
}, b = setTimeout(() => {
|
|
1959
1959
|
$();
|
|
1960
1960
|
}, 0);
|
|
1961
1961
|
return () => {
|
|
1962
|
-
clearTimeout(
|
|
1962
|
+
clearTimeout(b), d.removeEventListener("blur", g, !0), f.forEach((x, N) => {
|
|
1963
1963
|
N.removeEventListener("blur", x, !1);
|
|
1964
|
-
}),
|
|
1964
|
+
}), f.clear();
|
|
1965
1965
|
};
|
|
1966
1966
|
}, [t, ee, i]);
|
|
1967
|
-
const
|
|
1968
|
-
if (
|
|
1969
|
-
|
|
1967
|
+
const ve = (d) => {
|
|
1968
|
+
if (r) {
|
|
1969
|
+
d.preventDefault();
|
|
1970
1970
|
return;
|
|
1971
1971
|
}
|
|
1972
|
-
const
|
|
1973
|
-
if (
|
|
1974
|
-
const
|
|
1972
|
+
const f = window.getSelection();
|
|
1973
|
+
if (f && f.rangeCount > 0) {
|
|
1974
|
+
const g = f.anchorNode;
|
|
1975
1975
|
let $ = null;
|
|
1976
|
-
if (
|
|
1977
|
-
if (
|
|
1978
|
-
const
|
|
1976
|
+
if (g && (g.nodeType === Node.ELEMENT_NODE ? $ = g.closest('[data-type="text"]') : g.nodeType === Node.TEXT_NODE && g.parentElement && ($ = g.parentElement.closest('[data-type="text"]'))), $) {
|
|
1977
|
+
if (d.preventDefault(), d.stopPropagation(), a.current) {
|
|
1978
|
+
const b = a.current.querySelector(
|
|
1979
1979
|
'[data-type="variable"], [data-type="upload"]'
|
|
1980
1980
|
);
|
|
1981
|
-
|
|
1981
|
+
b && b.focus();
|
|
1982
1982
|
}
|
|
1983
1983
|
return;
|
|
1984
1984
|
}
|
|
1985
1985
|
}
|
|
1986
|
-
if (y &&
|
|
1987
|
-
const
|
|
1986
|
+
if (y && f && f.rangeCount > 0) {
|
|
1987
|
+
const g = f.anchorNode;
|
|
1988
1988
|
let $ = null;
|
|
1989
|
-
if (
|
|
1990
|
-
if (
|
|
1991
|
-
const
|
|
1989
|
+
if (g && (g.nodeType === Node.ELEMENT_NODE ? $ = g.closest(".tag-node") : g.nodeType === Node.TEXT_NODE && g.parentElement && ($ = g.parentElement.closest(".tag-node"))), $) {
|
|
1990
|
+
if (d.preventDefault(), d.stopPropagation(), a.current) {
|
|
1991
|
+
const b = a.current.querySelector(
|
|
1992
1992
|
'[data-type="variable"], [data-type="upload"]'
|
|
1993
1993
|
);
|
|
1994
|
-
|
|
1994
|
+
b && b.focus();
|
|
1995
1995
|
}
|
|
1996
1996
|
return;
|
|
1997
1997
|
}
|
|
1998
1998
|
}
|
|
1999
|
-
if (
|
|
1999
|
+
if (d.key === "Enter" && !d.shiftKey && (d.preventDefault(), Ce()), d.key === "Escape" && a.current) {
|
|
2000
2000
|
if (y) {
|
|
2001
|
-
|
|
2001
|
+
d.preventDefault();
|
|
2002
2002
|
return;
|
|
2003
2003
|
}
|
|
2004
|
-
|
|
2004
|
+
a.current.innerHTML = "", a.current.focus();
|
|
2005
2005
|
}
|
|
2006
|
-
if (
|
|
2007
|
-
const
|
|
2008
|
-
if (
|
|
2009
|
-
const $ =
|
|
2006
|
+
if (d.key === "Backspace") {
|
|
2007
|
+
const g = window.getSelection();
|
|
2008
|
+
if (g && g.rangeCount > 0) {
|
|
2009
|
+
const $ = g.getRangeAt(0), b = g.anchorNode;
|
|
2010
2010
|
if (y) {
|
|
2011
2011
|
let N = null, R = null;
|
|
2012
|
-
if (
|
|
2013
|
-
|
|
2012
|
+
if (b && (b.nodeType === Node.ELEMENT_NODE ? (N = b.closest(".tag-node"), R = b.closest('[data-type="text"]')) : b.nodeType === Node.TEXT_NODE && b.parentElement && (N = b.parentElement.closest(".tag-node"), R = b.parentElement.closest('[data-type="text"]'))), (N || R) && $.collapsed && $.startOffset === 0) {
|
|
2013
|
+
d.preventDefault();
|
|
2014
2014
|
return;
|
|
2015
2015
|
}
|
|
2016
2016
|
}
|
|
2017
2017
|
let x = null;
|
|
2018
|
-
if (
|
|
2018
|
+
if (b && (b.nodeType === Node.ELEMENT_NODE ? x = b.closest(
|
|
2019
2019
|
'[data-type="variable"]'
|
|
2020
|
-
) :
|
|
2020
|
+
) : b.nodeType === Node.TEXT_NODE && b.parentElement && (x = b.parentElement.closest(
|
|
2021
2021
|
'[data-type="variable"]'
|
|
2022
2022
|
))), x) {
|
|
2023
2023
|
if (!$.collapsed)
|
|
2024
2024
|
return;
|
|
2025
2025
|
const N = x.innerText;
|
|
2026
2026
|
if (N === "" || N === "") {
|
|
2027
|
-
|
|
2027
|
+
d.preventDefault();
|
|
2028
2028
|
return;
|
|
2029
2029
|
}
|
|
2030
2030
|
if ($.startOffset === 0) {
|
|
2031
|
-
|
|
2031
|
+
d.preventDefault();
|
|
2032
2032
|
return;
|
|
2033
2033
|
}
|
|
2034
2034
|
if (N.startsWith("") && $.startOffset === 1) {
|
|
2035
|
-
|
|
2035
|
+
d.preventDefault();
|
|
2036
2036
|
return;
|
|
2037
2037
|
}
|
|
2038
2038
|
}
|
|
2039
2039
|
}
|
|
2040
2040
|
}
|
|
2041
2041
|
}, Ce = () => {
|
|
2042
|
-
if (l ||
|
|
2042
|
+
if (l || r || e || !D || !a.current) return;
|
|
2043
2043
|
if (t.length === 0) {
|
|
2044
|
-
const x =
|
|
2044
|
+
const x = a.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "";
|
|
2045
2045
|
if (!x) return;
|
|
2046
|
-
|
|
2046
|
+
p(x, x);
|
|
2047
2047
|
return;
|
|
2048
2048
|
}
|
|
2049
|
-
const
|
|
2050
|
-
let
|
|
2051
|
-
const
|
|
2049
|
+
const d = a.current;
|
|
2050
|
+
let f = "";
|
|
2051
|
+
const g = {}, $ = (x) => {
|
|
2052
2052
|
if (!(x.nodeType === Node.ELEMENT_NODE && x.style.display === "none")) {
|
|
2053
2053
|
if (x.nodeType === Node.TEXT_NODE)
|
|
2054
|
-
|
|
2054
|
+
f += (x.textContent || "").replace(/\u200B/g, "");
|
|
2055
2055
|
else if (x.nodeType === Node.ELEMENT_NODE) {
|
|
2056
2056
|
const N = x, R = N.dataset.type, j = N.dataset.key;
|
|
2057
2057
|
if (R === "variable" && j) {
|
|
@@ -2072,49 +2072,49 @@ const Mt = ({
|
|
|
2072
2072
|
if (H) {
|
|
2073
2073
|
const se = N.dataset.multiKey;
|
|
2074
2074
|
if (se) {
|
|
2075
|
-
(!
|
|
2076
|
-
const ne =
|
|
2077
|
-
ne.push(H), ne.length > 1 && (
|
|
2075
|
+
(!g[se] || !Array.isArray(g[se])) && (g[se] = []);
|
|
2076
|
+
const ne = g[se];
|
|
2077
|
+
ne.push(H), ne.length > 1 && (f += " "), f += H;
|
|
2078
2078
|
} else
|
|
2079
|
-
|
|
2079
|
+
g[j] = H, f += H;
|
|
2080
2080
|
}
|
|
2081
2081
|
} else if (R === "upload" && j)
|
|
2082
|
-
|
|
2082
|
+
g[j] = i[j] ?? null, i[j] && (f += ` [附带文件: ${i[j]?.name}] `);
|
|
2083
2083
|
else {
|
|
2084
2084
|
if (N.classList.contains("tag-close-btn") || N.classList.contains("file-remove-btn")) return;
|
|
2085
|
-
N.getAttribute("contenteditable") === "false" && !R && N.classList.contains("tag-node") ?
|
|
2085
|
+
N.getAttribute("contenteditable") === "false" && !R && N.classList.contains("tag-node") ? f += N.innerText : N.childNodes.forEach($);
|
|
2086
2086
|
}
|
|
2087
2087
|
}
|
|
2088
2088
|
}
|
|
2089
2089
|
};
|
|
2090
|
-
if (
|
|
2091
|
-
const
|
|
2092
|
-
|
|
2093
|
-
const N =
|
|
2094
|
-
N != null && (N instanceof File ?
|
|
2090
|
+
if (d.childNodes.forEach($), f = f.trim(), !f) return;
|
|
2091
|
+
const b = new FormData();
|
|
2092
|
+
b.append("fullPrompt", f), Object.keys(g).forEach((x) => {
|
|
2093
|
+
const N = g[x];
|
|
2094
|
+
N != null && (N instanceof File ? b.append(x, N) : Array.isArray(N) ? t.some(
|
|
2095
2095
|
(j) => j.type === "multi-variable" && j.key === x
|
|
2096
2096
|
) ? N.forEach((j) => {
|
|
2097
|
-
j != null && j !== "" &&
|
|
2097
|
+
j != null && j !== "" && b.append(x, String(j));
|
|
2098
2098
|
}) : N.forEach((j, O) => {
|
|
2099
|
-
j != null && (j instanceof File ?
|
|
2100
|
-
}) : typeof N == "string" ?
|
|
2101
|
-
}),
|
|
2099
|
+
j != null && (j instanceof File ? b.append(`${x}[${O}]`, j) : typeof j == "string" ? b.append(`${x}[${O}]`, j) : b.append(`${x}[${O}]`, String(j)));
|
|
2100
|
+
}) : typeof N == "string" ? b.append(x, N) : b.append(x, String(N)));
|
|
2101
|
+
}), p(b, f);
|
|
2102
2102
|
}, Je = {
|
|
2103
2103
|
...o ? { width: typeof o == "number" ? `${o}px` : o } : {},
|
|
2104
2104
|
...u ? { border: u } : {},
|
|
2105
|
-
...
|
|
2105
|
+
...q ? { background: q } : {}
|
|
2106
2106
|
};
|
|
2107
2107
|
return /* @__PURE__ */ n.jsxs(
|
|
2108
2108
|
"div",
|
|
2109
2109
|
{
|
|
2110
2110
|
className: "rich-text-editor",
|
|
2111
2111
|
style: Je,
|
|
2112
|
-
"data-disabled":
|
|
2112
|
+
"data-disabled": r,
|
|
2113
2113
|
children: [
|
|
2114
2114
|
/* @__PURE__ */ n.jsx(
|
|
2115
2115
|
"div",
|
|
2116
2116
|
{
|
|
2117
|
-
ref:
|
|
2117
|
+
ref: a,
|
|
2118
2118
|
className: `rte-editor ${t.length === 0 ? "rte-editor-default" : ""} ${z && w ? "rte-editor-empty" : ""}`,
|
|
2119
2119
|
contentEditable: t.length === 0,
|
|
2120
2120
|
suppressContentEditableWarning: !0,
|
|
@@ -2125,7 +2125,7 @@ const Mt = ({
|
|
|
2125
2125
|
onClick: M,
|
|
2126
2126
|
onDoubleClick: G,
|
|
2127
2127
|
onInput: ue,
|
|
2128
|
-
onKeyDown:
|
|
2128
|
+
onKeyDown: ve,
|
|
2129
2129
|
onPaste: L
|
|
2130
2130
|
}
|
|
2131
2131
|
),
|
|
@@ -2145,54 +2145,68 @@ const Mt = ({
|
|
|
2145
2145
|
/* @__PURE__ */ n.jsx("img", { src: "https://oospublic.sealseek.cn/file/website/ball.png", alt: "" }),
|
|
2146
2146
|
/* @__PURE__ */ n.jsx("span", { className: "rte-brand-text", children: "SealSeek 1.0" })
|
|
2147
2147
|
] }),
|
|
2148
|
-
|
|
2149
|
-
|
|
2148
|
+
m !== "hideAgent" && /* @__PURE__ */ n.jsx(
|
|
2149
|
+
at,
|
|
2150
2150
|
{
|
|
2151
2151
|
placement: "top",
|
|
2152
2152
|
menu: {
|
|
2153
|
-
items:
|
|
2154
|
-
key:
|
|
2153
|
+
items: S.map((d) => ({
|
|
2154
|
+
key: d.key,
|
|
2155
2155
|
label: /* @__PURE__ */ n.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
|
|
2156
|
-
|
|
2157
|
-
/* @__PURE__ */ n.jsx("span", { children:
|
|
2156
|
+
d.icon && /* @__PURE__ */ n.jsx("i", { className: d.icon }),
|
|
2157
|
+
/* @__PURE__ */ n.jsx("span", { children: d.label })
|
|
2158
2158
|
] }),
|
|
2159
2159
|
onClick: () => {
|
|
2160
|
-
|
|
2160
|
+
h?.(d);
|
|
2161
2161
|
}
|
|
2162
2162
|
}))
|
|
2163
2163
|
},
|
|
2164
2164
|
trigger: ["click"],
|
|
2165
|
-
disabled:
|
|
2166
|
-
children: /* @__PURE__ */ n.jsxs("div", { className: "rte-agent-badge", style: { cursor:
|
|
2165
|
+
disabled: r || l,
|
|
2166
|
+
children: /* @__PURE__ */ n.jsxs("div", { className: "rte-agent-badge", style: { cursor: S.length > 0 ? "pointer" : "default" }, children: [
|
|
2167
2167
|
/* @__PURE__ */ n.jsx("i", { className: "iconfont icon-zhinengti" }),
|
|
2168
2168
|
/* @__PURE__ */ n.jsx("span", { className: "rte-agent-text", children: "智能体" })
|
|
2169
2169
|
] })
|
|
2170
2170
|
}
|
|
2171
2171
|
)
|
|
2172
2172
|
] }) }),
|
|
2173
|
-
/* @__PURE__ */ n.
|
|
2174
|
-
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
|
|
2182
|
-
|
|
2173
|
+
/* @__PURE__ */ n.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
|
|
2174
|
+
(() => {
|
|
2175
|
+
const d = t.find((g) => g.type === "tag");
|
|
2176
|
+
if (!d || !d.text) return null;
|
|
2177
|
+
const f = S.find((g) => g.label === d.text);
|
|
2178
|
+
return !f || f.points === void 0 || f.points === null ? null : /* @__PURE__ */ n.jsxs("div", { className: "rte-points-badge", children: [
|
|
2179
|
+
/* @__PURE__ */ n.jsx("i", { className: "iconfont icon-jifen", style: { marginRight: "4px" } }),
|
|
2180
|
+
/* @__PURE__ */ n.jsxs("span", { style: { fontSize: "16px" }, children: [
|
|
2181
|
+
"-",
|
|
2182
|
+
String(f.points)
|
|
2183
|
+
] })
|
|
2184
|
+
] });
|
|
2185
|
+
})(),
|
|
2186
|
+
/* @__PURE__ */ n.jsx(
|
|
2187
|
+
"button",
|
|
2188
|
+
{
|
|
2189
|
+
type: "button",
|
|
2190
|
+
onClick: Ce,
|
|
2191
|
+
disabled: l || r || e || !D,
|
|
2192
|
+
className: "rich-text-editor-send-button",
|
|
2193
|
+
children: l || e ? /* @__PURE__ */ n.jsx("span", { className: "rte-send-spinner" }) : /* @__PURE__ */ n.jsx("i", { className: "iconfont icon-fasong" })
|
|
2194
|
+
}
|
|
2195
|
+
)
|
|
2196
|
+
] })
|
|
2183
2197
|
] }),
|
|
2184
|
-
|
|
2185
|
-
if (!document.body.contains(
|
|
2198
|
+
v?.anchorEl && (() => {
|
|
2199
|
+
if (!document.body.contains(v.anchorEl))
|
|
2186
2200
|
return null;
|
|
2187
|
-
let
|
|
2188
|
-
return
|
|
2189
|
-
(
|
|
2190
|
-
)?.tooltip || "" :
|
|
2201
|
+
let d = "";
|
|
2202
|
+
return v.type === "upload" ? d = t.find(
|
|
2203
|
+
(g) => g.type === "upload" && g.key === v.key
|
|
2204
|
+
)?.tooltip || "" : v.type === "tag" ? d = v.anchorEl.dataset.tooltip || "" : v.type === "upload-label" ? d = v.anchorEl.dataset.fileName || "" : v.type === "variable" && (d = v.anchorEl.dataset.tooltip || ""), ht(
|
|
2191
2205
|
/* @__PURE__ */ n.jsx(
|
|
2192
2206
|
ot,
|
|
2193
2207
|
{
|
|
2194
2208
|
arrow: !1,
|
|
2195
|
-
title: /* @__PURE__ */ n.jsx("div", { style: { maxWidth: "200px", fontSize: "12px", color: "#fff" }, children:
|
|
2209
|
+
title: /* @__PURE__ */ n.jsx("div", { style: { maxWidth: "200px", fontSize: "12px", color: "#fff" }, children: d }),
|
|
2196
2210
|
open: !0,
|
|
2197
2211
|
placement: "top",
|
|
2198
2212
|
getPopupContainer: () => document.body,
|
|
@@ -2204,10 +2218,10 @@ const Mt = ({
|
|
|
2204
2218
|
{
|
|
2205
2219
|
style: {
|
|
2206
2220
|
position: "fixed",
|
|
2207
|
-
left: `${
|
|
2208
|
-
top: `${
|
|
2209
|
-
width: `${
|
|
2210
|
-
height: `${
|
|
2221
|
+
left: `${v.anchorEl.getBoundingClientRect().left}px`,
|
|
2222
|
+
top: `${v.anchorEl.getBoundingClientRect().top}px`,
|
|
2223
|
+
width: `${v.anchorEl.offsetWidth}px`,
|
|
2224
|
+
height: `${v.anchorEl.offsetHeight}px`,
|
|
2211
2225
|
pointerEvents: "none"
|
|
2212
2226
|
}
|
|
2213
2227
|
}
|
|
@@ -2256,15 +2270,15 @@ const Ue = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
2256
2270
|
{ label: "30页", value: 30 }
|
|
2257
2271
|
], Gt = ({
|
|
2258
2272
|
autoLoading: t,
|
|
2259
|
-
batchSize:
|
|
2273
|
+
batchSize: p,
|
|
2260
2274
|
loadingProgress: l,
|
|
2261
|
-
loadIcon:
|
|
2275
|
+
loadIcon: r,
|
|
2262
2276
|
onBatchSizeChange: o,
|
|
2263
2277
|
onLoadNextPage: y,
|
|
2264
|
-
onStartAutoLoad:
|
|
2265
|
-
onStopLoad:
|
|
2278
|
+
onStartAutoLoad: S,
|
|
2279
|
+
onStopLoad: h
|
|
2266
2280
|
}) => t && l ? /* @__PURE__ */ n.jsxs("div", { className: "auto_load_progress", children: [
|
|
2267
|
-
|
|
2281
|
+
r || /* @__PURE__ */ n.jsx("img", { src: Ue, alt: "自动加载", width: 14, height: 14 }),
|
|
2268
2282
|
/* @__PURE__ */ n.jsxs("span", { children: [
|
|
2269
2283
|
"正在加载第",
|
|
2270
2284
|
l.currentPage,
|
|
@@ -2280,7 +2294,7 @@ const Ue = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
2280
2294
|
size: [160, 8]
|
|
2281
2295
|
}
|
|
2282
2296
|
),
|
|
2283
|
-
/* @__PURE__ */ n.jsx("span", { onClick:
|
|
2297
|
+
/* @__PURE__ */ n.jsx("span", { onClick: h, className: "auto_load_stop_btn", children: "停止加载" })
|
|
2284
2298
|
] }) : /* @__PURE__ */ n.jsxs("div", { className: "auto_load_container", children: [
|
|
2285
2299
|
/* @__PURE__ */ n.jsx(
|
|
2286
2300
|
"div",
|
|
@@ -2305,9 +2319,9 @@ const Ue = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
2305
2319
|
"div",
|
|
2306
2320
|
{
|
|
2307
2321
|
className: "auto_load_btn",
|
|
2308
|
-
onClick: t ? void 0 :
|
|
2322
|
+
onClick: t ? void 0 : S,
|
|
2309
2323
|
children: [
|
|
2310
|
-
|
|
2324
|
+
r || /* @__PURE__ */ n.jsx("img", { src: Ue, alt: "自动加载", width: 14, height: 14 }),
|
|
2311
2325
|
/* @__PURE__ */ n.jsx("span", { children: "自动加载" })
|
|
2312
2326
|
]
|
|
2313
2327
|
}
|
|
@@ -2315,7 +2329,7 @@ const Ue = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
2315
2329
|
/* @__PURE__ */ n.jsx(
|
|
2316
2330
|
Oe,
|
|
2317
2331
|
{
|
|
2318
|
-
value:
|
|
2332
|
+
value: p,
|
|
2319
2333
|
onChange: o,
|
|
2320
2334
|
options: Dt,
|
|
2321
2335
|
disabled: t,
|
|
@@ -2329,24 +2343,24 @@ const Ue = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
2329
2343
|
)
|
|
2330
2344
|
] }), Ft = ({
|
|
2331
2345
|
current: t,
|
|
2332
|
-
loadIcon:
|
|
2346
|
+
loadIcon: p,
|
|
2333
2347
|
pageSize: l,
|
|
2334
|
-
total:
|
|
2348
|
+
total: r,
|
|
2335
2349
|
cachedPages: o,
|
|
2336
2350
|
loadedCount: y,
|
|
2337
|
-
autoLoading:
|
|
2338
|
-
loadingProgress:
|
|
2351
|
+
autoLoading: S = !1,
|
|
2352
|
+
loadingProgress: h,
|
|
2339
2353
|
onChange: c,
|
|
2340
2354
|
onLoadNextPage: e,
|
|
2341
2355
|
onStartAutoLoad: w,
|
|
2342
2356
|
onStopLoading: u
|
|
2343
2357
|
}) => {
|
|
2344
|
-
const [
|
|
2345
|
-
{ length:
|
|
2346
|
-
(A,
|
|
2347
|
-
).filter((A) => !o.includes(A)).slice(0,
|
|
2358
|
+
const [q, m] = Q(5), a = Math.ceil(r / l), C = Xe(() => o.length >= a, [o, a]), i = () => Array.from(
|
|
2359
|
+
{ length: a },
|
|
2360
|
+
(A, v) => v + 1
|
|
2361
|
+
).filter((A) => !o.includes(A)).slice(0, q), E = (T, A, v) => {
|
|
2348
2362
|
const V = o.includes(T);
|
|
2349
|
-
return A === "prev" || A === "next" || A === "jump-prev" || A === "jump-next" ? /* @__PURE__ */ n.jsx("div", { className: "pageBox", children:
|
|
2363
|
+
return A === "prev" || A === "next" || A === "jump-prev" || A === "jump-next" ? /* @__PURE__ */ n.jsx("div", { className: "pageBox", children: v }) : /* @__PURE__ */ n.jsxs(
|
|
2350
2364
|
"div",
|
|
2351
2365
|
{
|
|
2352
2366
|
className: "pageBox",
|
|
@@ -2373,18 +2387,18 @@ const Ue = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
2373
2387
|
"已加载: ",
|
|
2374
2388
|
y,
|
|
2375
2389
|
"/",
|
|
2376
|
-
|
|
2390
|
+
r,
|
|
2377
2391
|
"条数据"
|
|
2378
2392
|
] }),
|
|
2379
2393
|
!C && /* @__PURE__ */ n.jsx(
|
|
2380
2394
|
Gt,
|
|
2381
2395
|
{
|
|
2382
|
-
loadIcon:
|
|
2383
|
-
autoLoading:
|
|
2384
|
-
batchSize:
|
|
2385
|
-
loadingProgress:
|
|
2396
|
+
loadIcon: p || void 0,
|
|
2397
|
+
autoLoading: S,
|
|
2398
|
+
batchSize: q,
|
|
2399
|
+
loadingProgress: h,
|
|
2386
2400
|
disabled: !e || !w,
|
|
2387
|
-
onBatchSizeChange:
|
|
2401
|
+
onBatchSizeChange: m,
|
|
2388
2402
|
onLoadNextPage: () => e?.(),
|
|
2389
2403
|
onStartAutoLoad: () => {
|
|
2390
2404
|
const T = i();
|
|
@@ -2399,7 +2413,7 @@ const Ue = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
2399
2413
|
{
|
|
2400
2414
|
current: t,
|
|
2401
2415
|
pageSize: l,
|
|
2402
|
-
total:
|
|
2416
|
+
total: r,
|
|
2403
2417
|
onChange: (T) => c(T),
|
|
2404
2418
|
showSizeChanger: !1,
|
|
2405
2419
|
showQuickJumper: !1,
|
|
@@ -2410,34 +2424,34 @@ const Ue = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
2410
2424
|
] });
|
|
2411
2425
|
}, zt = (t) => {
|
|
2412
2426
|
const {
|
|
2413
|
-
loading:
|
|
2427
|
+
loading: p,
|
|
2414
2428
|
autoLoading: l,
|
|
2415
|
-
loadingProgress:
|
|
2429
|
+
loadingProgress: r,
|
|
2416
2430
|
columns: o = [],
|
|
2417
2431
|
dataSource: y = [],
|
|
2418
|
-
total:
|
|
2419
|
-
current:
|
|
2432
|
+
total: S,
|
|
2433
|
+
current: h,
|
|
2420
2434
|
pageSize: c,
|
|
2421
2435
|
cachedPages: e,
|
|
2422
2436
|
onChangePage: w,
|
|
2423
2437
|
onLoadNextPage: u,
|
|
2424
|
-
onStartAutoLoad:
|
|
2425
|
-
onStopLoading:
|
|
2426
|
-
...
|
|
2438
|
+
onStartAutoLoad: q,
|
|
2439
|
+
onStopLoading: m,
|
|
2440
|
+
...a
|
|
2427
2441
|
} = t, C = F(null), i = U(
|
|
2428
2442
|
(E) => {
|
|
2429
2443
|
w(E), e.includes(E) && C.current?.scrollTo({
|
|
2430
2444
|
key: `${(E - 1) * c + 1}`
|
|
2431
2445
|
});
|
|
2432
2446
|
},
|
|
2433
|
-
[
|
|
2447
|
+
[h]
|
|
2434
2448
|
);
|
|
2435
2449
|
return /* @__PURE__ */ n.jsxs("div", { className: "flex flex-col", children: [
|
|
2436
2450
|
/* @__PURE__ */ n.jsx(
|
|
2437
2451
|
Be,
|
|
2438
2452
|
{
|
|
2439
2453
|
ref: C,
|
|
2440
|
-
...
|
|
2454
|
+
...a,
|
|
2441
2455
|
columns: o,
|
|
2442
2456
|
dataSource: y,
|
|
2443
2457
|
pagination: !1,
|
|
@@ -2447,18 +2461,18 @@ const Ue = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
2447
2461
|
/* @__PURE__ */ n.jsx(
|
|
2448
2462
|
Ft,
|
|
2449
2463
|
{
|
|
2450
|
-
loading:
|
|
2464
|
+
loading: p,
|
|
2451
2465
|
autoLoading: l,
|
|
2452
|
-
loadingProgress:
|
|
2453
|
-
current:
|
|
2466
|
+
loadingProgress: r,
|
|
2467
|
+
current: h,
|
|
2454
2468
|
pageSize: c,
|
|
2455
|
-
total:
|
|
2469
|
+
total: S,
|
|
2456
2470
|
loadedCount: y.length,
|
|
2457
2471
|
cachedPages: e,
|
|
2458
2472
|
onChange: i,
|
|
2459
2473
|
onLoadNextPage: u,
|
|
2460
|
-
onStartAutoLoad:
|
|
2461
|
-
onStopLoading:
|
|
2474
|
+
onStartAutoLoad: q,
|
|
2475
|
+
onStopLoading: m
|
|
2462
2476
|
}
|
|
2463
2477
|
)
|
|
2464
2478
|
] });
|
|
@@ -2572,16 +2586,16 @@ zt.__docgenInfo = {
|
|
|
2572
2586
|
};
|
|
2573
2587
|
const Ht = ({
|
|
2574
2588
|
texts: t = [],
|
|
2575
|
-
placeholder:
|
|
2589
|
+
placeholder: p = "请输入内容",
|
|
2576
2590
|
animationSpeed: l = 100,
|
|
2577
|
-
autoPlay:
|
|
2591
|
+
autoPlay: r = !0,
|
|
2578
2592
|
value: o,
|
|
2579
2593
|
onChange: y,
|
|
2580
|
-
...
|
|
2594
|
+
...S
|
|
2581
2595
|
}) => {
|
|
2582
|
-
const [
|
|
2596
|
+
const [h, c] = Q(""), [e, w] = Q(0), [u, q] = Q(!1), [m, a] = Q(!1), [C, i] = Q(!1), E = F(void 0), T = F(void 0), A = F(t), v = F(e), V = F(m), _ = F(h);
|
|
2583
2597
|
le(() => {
|
|
2584
|
-
A.current = t,
|
|
2598
|
+
A.current = t, v.current = e, V.current = m, _.current = h;
|
|
2585
2599
|
});
|
|
2586
2600
|
const P = U((k, I) => {
|
|
2587
2601
|
let Z = 0;
|
|
@@ -2598,37 +2612,37 @@ const Ht = ({
|
|
|
2598
2612
|
Z();
|
|
2599
2613
|
}, [l]), B = U(() => {
|
|
2600
2614
|
if (A.current.length === 0 || V.current) return;
|
|
2601
|
-
|
|
2602
|
-
const k = A.current[
|
|
2615
|
+
q(!0);
|
|
2616
|
+
const k = A.current[v.current];
|
|
2603
2617
|
_.current ? D(() => {
|
|
2604
2618
|
P(k, () => {
|
|
2605
2619
|
E.current = window.setTimeout(() => {
|
|
2606
|
-
w((I) => (I + 1) % A.current.length),
|
|
2620
|
+
w((I) => (I + 1) % A.current.length), q(!1);
|
|
2607
2621
|
}, 2e3);
|
|
2608
2622
|
});
|
|
2609
2623
|
}) : P(k, () => {
|
|
2610
2624
|
E.current = window.setTimeout(() => {
|
|
2611
|
-
w((I) => (I + 1) % A.current.length),
|
|
2625
|
+
w((I) => (I + 1) % A.current.length), q(!1);
|
|
2612
2626
|
}, 2e3);
|
|
2613
2627
|
});
|
|
2614
2628
|
}, [D, P]);
|
|
2615
|
-
le(() => (
|
|
2629
|
+
le(() => (r && t.length > 0 && !m && B(), () => {
|
|
2616
2630
|
E.current && window.clearTimeout(E.current), T.current && window.clearTimeout(T.current);
|
|
2617
|
-
}), [e,
|
|
2618
|
-
!u &&
|
|
2619
|
-
}, [e, u,
|
|
2631
|
+
}), [e, m, r, t.length, B]), le(() => {
|
|
2632
|
+
!u && r && t.length > 0 && !m && B();
|
|
2633
|
+
}, [e, u, r, t.length, m, B]);
|
|
2620
2634
|
const X = (k) => {
|
|
2621
|
-
|
|
2635
|
+
a(!0), E.current && window.clearTimeout(E.current), T.current && window.clearTimeout(T.current), q(!1), i(!1), S.onFocus?.(k);
|
|
2622
2636
|
}, z = (k) => {
|
|
2623
|
-
|
|
2637
|
+
a(!1), !o && t.length > 0 && (c(""), w(0)), S.onBlur?.(k);
|
|
2624
2638
|
}, K = (k) => {
|
|
2625
|
-
y?.(k.target.value),
|
|
2626
|
-
}, ee = () =>
|
|
2639
|
+
y?.(k.target.value), S.onChange?.(k);
|
|
2640
|
+
}, ee = () => m || o ? p : h || p;
|
|
2627
2641
|
return /* @__PURE__ */ n.jsxs("div", { style: { position: "relative" }, children: [
|
|
2628
2642
|
/* @__PURE__ */ n.jsx(
|
|
2629
2643
|
Ke,
|
|
2630
2644
|
{
|
|
2631
|
-
...
|
|
2645
|
+
...S,
|
|
2632
2646
|
value: o,
|
|
2633
2647
|
onChange: K,
|
|
2634
2648
|
onFocus: X,
|
|
@@ -2636,13 +2650,13 @@ const Ht = ({
|
|
|
2636
2650
|
placeholder: ee(),
|
|
2637
2651
|
style: {
|
|
2638
2652
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2639
|
-
...
|
|
2653
|
+
...S.style,
|
|
2640
2654
|
position: "relative",
|
|
2641
2655
|
zIndex: 1
|
|
2642
2656
|
}
|
|
2643
2657
|
}
|
|
2644
2658
|
),
|
|
2645
|
-
!
|
|
2659
|
+
!m && !o && h && /* @__PURE__ */ n.jsxs(
|
|
2646
2660
|
"div",
|
|
2647
2661
|
{
|
|
2648
2662
|
style: {
|
|
@@ -2662,7 +2676,7 @@ const Ht = ({
|
|
|
2662
2676
|
fontFamily: "inherit"
|
|
2663
2677
|
},
|
|
2664
2678
|
children: [
|
|
2665
|
-
/* @__PURE__ */ n.jsx("span", { children:
|
|
2679
|
+
/* @__PURE__ */ n.jsx("span", { children: h }),
|
|
2666
2680
|
C && /* @__PURE__ */ n.jsx(
|
|
2667
2681
|
"span",
|
|
2668
2682
|
{
|
|
@@ -2735,19 +2749,19 @@ Ht.__docgenInfo = {
|
|
|
2735
2749
|
const Wt = ({
|
|
2736
2750
|
texts: t = [],
|
|
2737
2751
|
// 动态文案数组,默认为空数组
|
|
2738
|
-
placeholder:
|
|
2752
|
+
placeholder: p = "请输入内容",
|
|
2739
2753
|
// 占位符文本
|
|
2740
2754
|
animationSpeed: l = 100,
|
|
2741
2755
|
// 打字机动画速度,毫秒
|
|
2742
|
-
autoPlay:
|
|
2756
|
+
autoPlay: r = !0,
|
|
2743
2757
|
// 是否自动播放动画
|
|
2744
2758
|
value: o = "",
|
|
2745
2759
|
// 受控模式的值
|
|
2746
2760
|
onChange: y,
|
|
2747
2761
|
// 受控模式的变化回调
|
|
2748
|
-
onSubmit:
|
|
2762
|
+
onSubmit: S,
|
|
2749
2763
|
// 提交回调
|
|
2750
|
-
maxLength:
|
|
2764
|
+
maxLength: h = 500,
|
|
2751
2765
|
// 最大字符数限制
|
|
2752
2766
|
showCount: c = !0,
|
|
2753
2767
|
// 是否显示字数统计
|
|
@@ -2757,22 +2771,22 @@ const Wt = ({
|
|
|
2757
2771
|
// 是否禁用组件
|
|
2758
2772
|
rows: u = 4,
|
|
2759
2773
|
// 文本域行数
|
|
2760
|
-
style:
|
|
2774
|
+
style: q,
|
|
2761
2775
|
// 自定义样式
|
|
2762
|
-
...
|
|
2776
|
+
...m
|
|
2763
2777
|
// 其他原生属性
|
|
2764
2778
|
}) => {
|
|
2765
|
-
const [
|
|
2779
|
+
const [a, C] = Q(""), [i, E] = Q(0), [T, A] = Q(!1), [v, V] = Q(!1), [_, P] = Q(!1), [D, B] = Q(o || ""), X = F(void 0), z = F(void 0), K = F(t), ee = F(i), k = F(v), I = F(a), Z = F(null);
|
|
2766
2780
|
le(() => {
|
|
2767
|
-
K.current = t, ee.current = i, k.current =
|
|
2781
|
+
K.current = t, ee.current = i, k.current = v, I.current = a;
|
|
2768
2782
|
});
|
|
2769
2783
|
const te = U((M, G) => {
|
|
2770
2784
|
let ue = 0;
|
|
2771
2785
|
P(!0);
|
|
2772
|
-
const
|
|
2773
|
-
ue < M.length ? (C(M.slice(0, ue + 1)), ue++, z.current = window.setTimeout(
|
|
2786
|
+
const ve = () => {
|
|
2787
|
+
ue < M.length ? (C(M.slice(0, ue + 1)), ue++, z.current = window.setTimeout(ve, l)) : (P(!1), G?.());
|
|
2774
2788
|
};
|
|
2775
|
-
|
|
2789
|
+
ve();
|
|
2776
2790
|
}, [l]), pe = U((M) => {
|
|
2777
2791
|
let G = I.current.length;
|
|
2778
2792
|
const ue = () => {
|
|
@@ -2795,25 +2809,25 @@ const Wt = ({
|
|
|
2795
2809
|
}, 2e3);
|
|
2796
2810
|
});
|
|
2797
2811
|
}, [pe, te]);
|
|
2798
|
-
le(() => (
|
|
2812
|
+
le(() => (r && t.length > 0 && !v && ge(), () => {
|
|
2799
2813
|
X.current && window.clearTimeout(X.current), z.current && window.clearTimeout(z.current);
|
|
2800
|
-
}), [i,
|
|
2801
|
-
!T &&
|
|
2802
|
-
}, [i, T,
|
|
2814
|
+
}), [i, v, r, t.length, ge]), le(() => {
|
|
2815
|
+
!T && r && t.length > 0 && !v && ge();
|
|
2816
|
+
}, [i, T, r, t.length, v, ge]);
|
|
2803
2817
|
const s = (M) => {
|
|
2804
|
-
V(!0), X.current && window.clearTimeout(X.current), z.current && window.clearTimeout(z.current), A(!1), P(!1),
|
|
2818
|
+
V(!0), X.current && window.clearTimeout(X.current), z.current && window.clearTimeout(z.current), A(!1), P(!1), m.onFocus?.(M);
|
|
2805
2819
|
}, L = (M) => {
|
|
2806
|
-
V(!1), !o && t.length > 0 && (C(""), E(0)),
|
|
2820
|
+
V(!1), !o && t.length > 0 && (C(""), E(0)), m.onBlur?.(M);
|
|
2807
2821
|
}, Y = (M) => {
|
|
2808
2822
|
const G = M.target.value;
|
|
2809
|
-
|
|
2810
|
-
},
|
|
2823
|
+
h && G.length > h || (y ? y(G) : B(G), m.onChange?.(M));
|
|
2824
|
+
}, re = () => {
|
|
2811
2825
|
const M = y ? o : D;
|
|
2812
|
-
M.trim() && !w && (
|
|
2826
|
+
M.trim() && !w && (S?.(M), y || B(""));
|
|
2813
2827
|
}, fe = (M) => {
|
|
2814
|
-
(M.ctrlKey || M.metaKey) && M.key === "Enter" && (M.preventDefault(),
|
|
2815
|
-
}, ie = y ? o : D, xe = w || !ie.trim() || (
|
|
2816
|
-
return /* @__PURE__ */ n.jsxs("div", { style: { position: "relative", ...
|
|
2828
|
+
(M.ctrlKey || M.metaKey) && M.key === "Enter" && (M.preventDefault(), re()), m.onKeyDown?.(M);
|
|
2829
|
+
}, ie = y ? o : D, xe = w || !ie.trim() || (h ? ie.length > h : !1);
|
|
2830
|
+
return /* @__PURE__ */ n.jsxs("div", { style: { position: "relative", ...q }, children: [
|
|
2817
2831
|
/* @__PURE__ */ n.jsxs("div", { style: { position: "relative" }, children: [
|
|
2818
2832
|
/* @__PURE__ */ n.jsx(
|
|
2819
2833
|
"textarea",
|
|
@@ -2828,8 +2842,8 @@ const Wt = ({
|
|
|
2828
2842
|
M.target.style.borderColor = "#d9d9d9", M.target.style.boxShadow = "none", L(M);
|
|
2829
2843
|
},
|
|
2830
2844
|
onKeyDown: fe,
|
|
2831
|
-
placeholder:
|
|
2832
|
-
maxLength:
|
|
2845
|
+
placeholder: v || ie ? p : "",
|
|
2846
|
+
maxLength: h,
|
|
2833
2847
|
rows: u,
|
|
2834
2848
|
disabled: w,
|
|
2835
2849
|
style: {
|
|
@@ -2847,12 +2861,12 @@ const Wt = ({
|
|
|
2847
2861
|
transition: "border-color 0.3s, box-shadow 0.3s",
|
|
2848
2862
|
backgroundColor: "#fff",
|
|
2849
2863
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2850
|
-
...
|
|
2864
|
+
...m.style
|
|
2851
2865
|
},
|
|
2852
|
-
...
|
|
2866
|
+
...m
|
|
2853
2867
|
}
|
|
2854
2868
|
),
|
|
2855
|
-
!
|
|
2869
|
+
!v && !ie && a && /* @__PURE__ */ n.jsxs(
|
|
2856
2870
|
"div",
|
|
2857
2871
|
{
|
|
2858
2872
|
style: {
|
|
@@ -2874,7 +2888,7 @@ const Wt = ({
|
|
|
2874
2888
|
lineHeight: "1.5"
|
|
2875
2889
|
},
|
|
2876
2890
|
children: [
|
|
2877
|
-
/* @__PURE__ */ n.jsx("span", { children:
|
|
2891
|
+
/* @__PURE__ */ n.jsx("span", { children: a }),
|
|
2878
2892
|
_ && /* @__PURE__ */ n.jsx(
|
|
2879
2893
|
"span",
|
|
2880
2894
|
{
|
|
@@ -2906,7 +2920,7 @@ const Wt = ({
|
|
|
2906
2920
|
type: "primary",
|
|
2907
2921
|
size: "small",
|
|
2908
2922
|
icon: /* @__PURE__ */ n.jsx(mt, {}),
|
|
2909
|
-
onClick:
|
|
2923
|
+
onClick: re,
|
|
2910
2924
|
disabled: xe,
|
|
2911
2925
|
style: {
|
|
2912
2926
|
borderRadius: 6,
|
|
@@ -2934,7 +2948,7 @@ const Wt = ({
|
|
|
2934
2948
|
children: [
|
|
2935
2949
|
ie.length,
|
|
2936
2950
|
"/",
|
|
2937
|
-
|
|
2951
|
+
h
|
|
2938
2952
|
]
|
|
2939
2953
|
}
|
|
2940
2954
|
),
|
|
@@ -3034,59 +3048,59 @@ Wt.__docgenInfo = {
|
|
|
3034
3048
|
};
|
|
3035
3049
|
const Ye = ({
|
|
3036
3050
|
src: t,
|
|
3037
|
-
poster:
|
|
3051
|
+
poster: p,
|
|
3038
3052
|
width: l = 300,
|
|
3039
|
-
height:
|
|
3053
|
+
height: r,
|
|
3040
3054
|
videoWidth: o,
|
|
3041
3055
|
// 参数保留但不使用,由CSS控制
|
|
3042
3056
|
videoHeight: y,
|
|
3043
3057
|
// 参数保留但不使用,由CSS控制
|
|
3044
|
-
showPlayButton:
|
|
3045
|
-
autoPlayOnHover:
|
|
3058
|
+
showPlayButton: S = !0,
|
|
3059
|
+
autoPlayOnHover: h = !0,
|
|
3046
3060
|
onClick: c,
|
|
3047
3061
|
onVideoLoaded: e,
|
|
3048
3062
|
onVideoPlay: w,
|
|
3049
3063
|
onVideoPause: u,
|
|
3050
|
-
onVideoEnded:
|
|
3051
|
-
className:
|
|
3052
|
-
style:
|
|
3064
|
+
onVideoEnded: q,
|
|
3065
|
+
className: m,
|
|
3066
|
+
style: a,
|
|
3053
3067
|
...C
|
|
3054
3068
|
}) => {
|
|
3055
|
-
const i = F(null), [E, T] = Q(!1), [A,
|
|
3069
|
+
const i = F(null), [E, T] = Q(!1), [A, v] = Q(!1), [V, _] = Q(!1), P = U(() => {
|
|
3056
3070
|
i.current && (i.current.play(), T(!0), w?.());
|
|
3057
3071
|
}, [w]), D = U(() => {
|
|
3058
3072
|
i.current && (i.current.pause(), T(!1), u?.());
|
|
3059
3073
|
}, [u]), B = U((te) => {
|
|
3060
3074
|
te.stopPropagation(), E ? D() : P();
|
|
3061
3075
|
}, [E, P, D]), X = U(() => {
|
|
3062
|
-
|
|
3063
|
-
}, [
|
|
3064
|
-
|
|
3065
|
-
}, [
|
|
3076
|
+
v(!0), h && !E && P();
|
|
3077
|
+
}, [h, E, P]), z = U(() => {
|
|
3078
|
+
v(!1), h && E && D();
|
|
3079
|
+
}, [h, E, D]), K = U(() => {
|
|
3066
3080
|
_(!0), e?.();
|
|
3067
3081
|
}, [e]), ee = U(() => {
|
|
3068
3082
|
T(!0), w?.();
|
|
3069
3083
|
}, [w]), k = U(() => {
|
|
3070
3084
|
T(!1), u?.();
|
|
3071
3085
|
}, [u]), I = U(() => {
|
|
3072
|
-
T(!1),
|
|
3073
|
-
}, [
|
|
3086
|
+
T(!1), q?.();
|
|
3087
|
+
}, [q]), Z = U((te) => {
|
|
3074
3088
|
c?.(te);
|
|
3075
3089
|
}, [c]);
|
|
3076
3090
|
return /* @__PURE__ */ n.jsx(
|
|
3077
3091
|
Pe,
|
|
3078
3092
|
{
|
|
3079
3093
|
...C,
|
|
3080
|
-
className: `video-card ${
|
|
3094
|
+
className: `video-card ${m || ""}`,
|
|
3081
3095
|
style: {
|
|
3082
3096
|
width: l,
|
|
3083
|
-
height:
|
|
3097
|
+
height: r,
|
|
3084
3098
|
padding: 0,
|
|
3085
3099
|
overflow: "hidden",
|
|
3086
3100
|
cursor: c ? "pointer" : "default",
|
|
3087
3101
|
border: "none",
|
|
3088
3102
|
borderRadius: 0,
|
|
3089
|
-
...
|
|
3103
|
+
...a
|
|
3090
3104
|
},
|
|
3091
3105
|
bordered: !1,
|
|
3092
3106
|
onMouseEnter: X,
|
|
@@ -3098,7 +3112,7 @@ const Ye = ({
|
|
|
3098
3112
|
{
|
|
3099
3113
|
ref: i,
|
|
3100
3114
|
src: t,
|
|
3101
|
-
poster:
|
|
3115
|
+
poster: p,
|
|
3102
3116
|
preload: "metadata",
|
|
3103
3117
|
onLoadedData: K,
|
|
3104
3118
|
onPlay: ee,
|
|
@@ -3108,7 +3122,7 @@ const Ye = ({
|
|
|
3108
3122
|
loop: !0
|
|
3109
3123
|
}
|
|
3110
3124
|
),
|
|
3111
|
-
|
|
3125
|
+
S && /* @__PURE__ */ n.jsx(
|
|
3112
3126
|
"div",
|
|
3113
3127
|
{
|
|
3114
3128
|
className: `video-play-button ${A ? "hovered" : ""}`,
|
|
@@ -3224,9 +3238,9 @@ Ye.__docgenInfo = {
|
|
|
3224
3238
|
};
|
|
3225
3239
|
const Ut = (t) => [".mp4", ".webm", ".ogg", ".mov", ".avi", ".wmv", ".flv", ".mkv"].some((l) => t.toLowerCase().includes(l)), Xt = (t) => t.type ? t.type : Ut(t.url) ? "video" : "image", Kt = ({
|
|
3226
3240
|
items: t,
|
|
3227
|
-
columns:
|
|
3241
|
+
columns: p,
|
|
3228
3242
|
gap: l = 0,
|
|
3229
|
-
responsive:
|
|
3243
|
+
responsive: r = !0,
|
|
3230
3244
|
breakpoints: o = {
|
|
3231
3245
|
xs: 1,
|
|
3232
3246
|
sm: 2,
|
|
@@ -3236,44 +3250,44 @@ const Ut = (t) => [".mp4", ".webm", ".ogg", ".mov", ".avi", ".wmv", ".flv", ".mk
|
|
|
3236
3250
|
xxl: 6
|
|
3237
3251
|
},
|
|
3238
3252
|
className: y,
|
|
3239
|
-
style:
|
|
3240
|
-
onClick:
|
|
3253
|
+
style: S,
|
|
3254
|
+
onClick: h
|
|
3241
3255
|
}) => {
|
|
3242
|
-
const c = F(null), [e, w] = Q(
|
|
3243
|
-
if (!
|
|
3244
|
-
return
|
|
3256
|
+
const c = F(null), [e, w] = Q(p || o.md || 3), u = F(/* @__PURE__ */ new Map()), q = U(() => {
|
|
3257
|
+
if (!r || p)
|
|
3258
|
+
return p || o.md || 3;
|
|
3245
3259
|
const i = window.innerWidth;
|
|
3246
3260
|
return i < 576 ? o.xs || 1 : i < 768 ? o.sm || 2 : i < 992 ? o.md || 3 : i < 1200 ? o.lg || 4 : i < 1600 ? o.xl || 5 : o.xxl || 6;
|
|
3247
|
-
}, [
|
|
3261
|
+
}, [r, p, o]), m = U(() => {
|
|
3248
3262
|
if (!c.current) return;
|
|
3249
|
-
const i = e, E = c.current, A = (E.offsetWidth - l * (i - 1)) / i,
|
|
3263
|
+
const i = e, E = c.current, A = (E.offsetWidth - l * (i - 1)) / i, v = new Array(i).fill(0);
|
|
3250
3264
|
t.forEach((_, P) => {
|
|
3251
3265
|
const D = _.id || P, B = u.current.get(D);
|
|
3252
3266
|
if (!B) return;
|
|
3253
|
-
const X = Math.min(...
|
|
3254
|
-
B.style.position = "absolute", B.style.left = `${K}px`, B.style.top = `${ee}px`, B.style.width = `${A}px`,
|
|
3267
|
+
const X = Math.min(...v), z = v.indexOf(X), K = z * (A + l), ee = v[z];
|
|
3268
|
+
B.style.position = "absolute", B.style.left = `${K}px`, B.style.top = `${ee}px`, B.style.width = `${A}px`, v[z] += B.offsetHeight + l;
|
|
3255
3269
|
});
|
|
3256
|
-
const V = Math.max(...
|
|
3270
|
+
const V = Math.max(...v);
|
|
3257
3271
|
E.style.height = `${V}px`;
|
|
3258
3272
|
}, [t, e, l]);
|
|
3259
3273
|
le(() => {
|
|
3260
3274
|
const i = () => {
|
|
3261
|
-
const E =
|
|
3275
|
+
const E = q();
|
|
3262
3276
|
E !== e && w(E);
|
|
3263
3277
|
};
|
|
3264
|
-
if (
|
|
3278
|
+
if (r)
|
|
3265
3279
|
return window.addEventListener("resize", i), i(), () => window.removeEventListener("resize", i);
|
|
3266
|
-
}, [
|
|
3280
|
+
}, [r, q, e]), le(() => {
|
|
3267
3281
|
const i = setTimeout(() => {
|
|
3268
|
-
|
|
3282
|
+
m();
|
|
3269
3283
|
}, 100);
|
|
3270
3284
|
return () => clearTimeout(i);
|
|
3271
|
-
}, [t, e,
|
|
3272
|
-
const
|
|
3273
|
-
|
|
3274
|
-
}, [
|
|
3275
|
-
|
|
3276
|
-
}, [
|
|
3285
|
+
}, [t, e, m]);
|
|
3286
|
+
const a = U(() => {
|
|
3287
|
+
m();
|
|
3288
|
+
}, [m]), C = U((i) => {
|
|
3289
|
+
h && h(i), i.onClick?.(i);
|
|
3290
|
+
}, [h]);
|
|
3277
3291
|
return /* @__PURE__ */ n.jsx(
|
|
3278
3292
|
"div",
|
|
3279
3293
|
{
|
|
@@ -3282,22 +3296,22 @@ const Ut = (t) => [".mp4", ".webm", ".ogg", ".mov", ".avi", ".wmv", ".flv", ".mk
|
|
|
3282
3296
|
style: {
|
|
3283
3297
|
position: "relative",
|
|
3284
3298
|
width: "100%",
|
|
3285
|
-
...
|
|
3299
|
+
...S
|
|
3286
3300
|
},
|
|
3287
3301
|
children: t.map((i, E) => {
|
|
3288
3302
|
const T = i.id || E, A = Xt(i);
|
|
3289
3303
|
return /* @__PURE__ */ n.jsx(
|
|
3290
3304
|
"div",
|
|
3291
3305
|
{
|
|
3292
|
-
ref: (
|
|
3293
|
-
|
|
3306
|
+
ref: (v) => {
|
|
3307
|
+
v ? u.current.set(T, v) : u.current.delete(T);
|
|
3294
3308
|
},
|
|
3295
3309
|
className: "waterfall-item",
|
|
3296
3310
|
children: A === "video" ? /* @__PURE__ */ n.jsx("div", { style: {
|
|
3297
3311
|
width: "100%",
|
|
3298
3312
|
position: "relative",
|
|
3299
3313
|
paddingBottom: "56.25%",
|
|
3300
|
-
cursor:
|
|
3314
|
+
cursor: h || i.onClick ? "pointer" : "default"
|
|
3301
3315
|
}, children: /* @__PURE__ */ n.jsx("div", { style: { position: "absolute", top: 0, left: 0, width: "100%", height: "100%" }, children: /* @__PURE__ */ n.jsx(
|
|
3302
3316
|
Ye,
|
|
3303
3317
|
{
|
|
@@ -3306,7 +3320,7 @@ const Ut = (t) => [".mp4", ".webm", ".ogg", ".mov", ".avi", ".wmv", ".flv", ".mk
|
|
|
3306
3320
|
width: "100%",
|
|
3307
3321
|
height: "100%",
|
|
3308
3322
|
onClick: () => C(i),
|
|
3309
|
-
onVideoLoaded:
|
|
3323
|
+
onVideoLoaded: a,
|
|
3310
3324
|
autoPlayOnHover: !0,
|
|
3311
3325
|
showPlayButton: !1
|
|
3312
3326
|
}
|
|
@@ -3315,15 +3329,15 @@ const Ut = (t) => [".mp4", ".webm", ".ogg", ".mov", ".avi", ".wmv", ".flv", ".mk
|
|
|
3315
3329
|
{
|
|
3316
3330
|
className: "waterfall-image-wrapper",
|
|
3317
3331
|
onClick: () => C(i),
|
|
3318
|
-
style: { cursor:
|
|
3332
|
+
style: { cursor: h || i.onClick ? "pointer" : "default" },
|
|
3319
3333
|
children: /* @__PURE__ */ n.jsx(
|
|
3320
3334
|
"img",
|
|
3321
3335
|
{
|
|
3322
3336
|
src: i.url,
|
|
3323
3337
|
alt: `瀑布流图片 ${E + 1}`,
|
|
3324
3338
|
className: "waterfall-image",
|
|
3325
|
-
onLoad:
|
|
3326
|
-
onError:
|
|
3339
|
+
onLoad: a,
|
|
3340
|
+
onError: a,
|
|
3327
3341
|
style: { display: "block", width: "100%", height: "auto" }
|
|
3328
3342
|
}
|
|
3329
3343
|
)
|