bi-components-library 1.0.11 → 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.es.js +1219 -1112
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +6 -6
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { Button as
|
|
3
|
-
import { createFromIconfontCN as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
var
|
|
1
|
+
import Ue, { useState as J, useRef as z, useMemo as Ge, useCallback as W, useEffect as oe, useLayoutEffect as Xe } from "react";
|
|
2
|
+
import { Button as xe, Card as Re, Modal as Ke, Table as Ie, Flex as Pe, Spin as Ye, Empty as Je, Select as Ve, Form as Ce, Input as Fe, Space as Qe, Dropdown as Ze, Tooltip as et, Progress as tt, Pagination as nt, theme as at } from "antd";
|
|
3
|
+
import { createFromIconfontCN as rt, LeftOutlined as ot, SearchOutlined as lt, ReloadOutlined as st, InfoCircleOutlined as it, SendOutlined as ct, PauseCircleOutlined as ut, PlayCircleOutlined as dt } from "@ant-design/icons";
|
|
4
|
+
import { createPortal as pt } from "react-dom";
|
|
5
|
+
var Se = { exports: {} }, Ee = {};
|
|
6
6
|
/**
|
|
7
7
|
* @license React
|
|
8
8
|
* react-jsx-runtime.production.js
|
|
@@ -12,29 +12,29 @@ var we = { exports: {} }, be = {};
|
|
|
12
12
|
* This source code is licensed under the MIT license found in the
|
|
13
13
|
* LICENSE file in the root directory of this source tree.
|
|
14
14
|
*/
|
|
15
|
-
var
|
|
16
|
-
function
|
|
17
|
-
if (
|
|
18
|
-
|
|
15
|
+
var Be;
|
|
16
|
+
function ft() {
|
|
17
|
+
if (Be) return Ee;
|
|
18
|
+
Be = 1;
|
|
19
19
|
var t = Symbol.for("react.transitional.element"), p = Symbol.for("react.fragment");
|
|
20
|
-
function
|
|
21
|
-
var
|
|
22
|
-
if (m !== void 0 && (
|
|
20
|
+
function l(a, r, m) {
|
|
21
|
+
var A = null;
|
|
22
|
+
if (m !== void 0 && (A = "" + m), r.key !== void 0 && (A = "" + r.key), "key" in r) {
|
|
23
23
|
m = {};
|
|
24
|
-
for (var g in
|
|
25
|
-
g !== "key" && (m[g] =
|
|
26
|
-
} else m =
|
|
27
|
-
return
|
|
24
|
+
for (var g in r)
|
|
25
|
+
g !== "key" && (m[g] = r[g]);
|
|
26
|
+
} else m = r;
|
|
27
|
+
return r = m.ref, {
|
|
28
28
|
$$typeof: t,
|
|
29
|
-
type:
|
|
30
|
-
key:
|
|
31
|
-
ref:
|
|
29
|
+
type: a,
|
|
30
|
+
key: A,
|
|
31
|
+
ref: r !== void 0 ? r : null,
|
|
32
32
|
props: m
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
|
-
return
|
|
35
|
+
return Ee.Fragment = p, Ee.jsx = l, Ee.jsxs = l, Ee;
|
|
36
36
|
}
|
|
37
|
-
var
|
|
37
|
+
var ke = {};
|
|
38
38
|
/**
|
|
39
39
|
* @license React
|
|
40
40
|
* react-jsx-runtime.development.js
|
|
@@ -44,47 +44,47 @@ var xe = {};
|
|
|
44
44
|
* This source code is licensed under the MIT license found in the
|
|
45
45
|
* LICENSE file in the root directory of this source tree.
|
|
46
46
|
*/
|
|
47
|
-
var
|
|
48
|
-
function
|
|
49
|
-
return
|
|
47
|
+
var Oe;
|
|
48
|
+
function mt() {
|
|
49
|
+
return Oe || (Oe = 1, process.env.NODE_ENV !== "production" && function() {
|
|
50
50
|
function t(s) {
|
|
51
51
|
if (s == null) return null;
|
|
52
52
|
if (typeof s == "function")
|
|
53
|
-
return s.$$typeof ===
|
|
53
|
+
return s.$$typeof === U ? null : s.displayName || s.name || null;
|
|
54
54
|
if (typeof s == "string") return s;
|
|
55
55
|
switch (s) {
|
|
56
|
-
case
|
|
56
|
+
case C:
|
|
57
57
|
return "Fragment";
|
|
58
|
-
case
|
|
58
|
+
case w:
|
|
59
59
|
return "Profiler";
|
|
60
60
|
case c:
|
|
61
61
|
return "StrictMode";
|
|
62
|
-
case
|
|
62
|
+
case V:
|
|
63
63
|
return "Suspense";
|
|
64
|
-
case
|
|
64
|
+
case _:
|
|
65
65
|
return "SuspenseList";
|
|
66
|
-
case
|
|
66
|
+
case B:
|
|
67
67
|
return "Activity";
|
|
68
68
|
}
|
|
69
69
|
if (typeof s == "object")
|
|
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 o:
|
|
74
74
|
return "Portal";
|
|
75
|
-
case
|
|
75
|
+
case $:
|
|
76
76
|
return (s.displayName || "Context") + ".Provider";
|
|
77
|
-
case
|
|
77
|
+
case k:
|
|
78
78
|
return (s._context.displayName || "Context") + ".Consumer";
|
|
79
|
-
case
|
|
80
|
-
var
|
|
81
|
-
return s = s.displayName, s || (s =
|
|
82
|
-
case
|
|
83
|
-
return
|
|
79
|
+
case b:
|
|
80
|
+
var L = s.render;
|
|
81
|
+
return s = s.displayName, s || (s = L.displayName || L.name || "", s = s !== "" ? "ForwardRef(" + s + ")" : "ForwardRef"), s;
|
|
82
|
+
case P:
|
|
83
|
+
return L = s.displayName || null, L !== null ? L : t(s.type) || "Memo";
|
|
84
84
|
case D:
|
|
85
|
-
|
|
85
|
+
L = s._payload, s = s._init;
|
|
86
86
|
try {
|
|
87
|
-
return t(s(
|
|
87
|
+
return t(s(L));
|
|
88
88
|
} catch {
|
|
89
89
|
}
|
|
90
90
|
}
|
|
@@ -93,76 +93,76 @@ function lt() {
|
|
|
93
93
|
function p(s) {
|
|
94
94
|
return "" + s;
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function l(s) {
|
|
97
97
|
try {
|
|
98
98
|
p(s);
|
|
99
|
-
var
|
|
99
|
+
var L = !1;
|
|
100
100
|
} catch {
|
|
101
|
-
|
|
101
|
+
L = !0;
|
|
102
102
|
}
|
|
103
|
-
if (
|
|
104
|
-
|
|
105
|
-
var
|
|
106
|
-
return
|
|
107
|
-
|
|
103
|
+
if (L) {
|
|
104
|
+
L = console;
|
|
105
|
+
var K = L.error, ae = typeof Symbol == "function" && Symbol.toStringTag && s[Symbol.toStringTag] || s.constructor.name || "Object";
|
|
106
|
+
return K.call(
|
|
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
|
-
|
|
109
|
+
ae
|
|
110
110
|
), p(s);
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
-
function
|
|
114
|
-
if (s ===
|
|
113
|
+
function a(s) {
|
|
114
|
+
if (s === C) return "<>";
|
|
115
115
|
if (typeof s == "object" && s !== null && s.$$typeof === D)
|
|
116
116
|
return "<...>";
|
|
117
117
|
try {
|
|
118
|
-
var
|
|
119
|
-
return
|
|
118
|
+
var L = t(s);
|
|
119
|
+
return L ? "<" + L + ">" : "<...>";
|
|
120
120
|
} catch {
|
|
121
121
|
return "<...>";
|
|
122
122
|
}
|
|
123
123
|
}
|
|
124
|
-
function
|
|
125
|
-
var s =
|
|
124
|
+
function r() {
|
|
125
|
+
var s = H.A;
|
|
126
126
|
return s === null ? null : s.getOwner();
|
|
127
127
|
}
|
|
128
128
|
function m() {
|
|
129
129
|
return Error("react-stack-top-frame");
|
|
130
130
|
}
|
|
131
|
-
function
|
|
132
|
-
if (
|
|
133
|
-
var
|
|
134
|
-
if (
|
|
131
|
+
function A(s) {
|
|
132
|
+
if (X.call(s, "key")) {
|
|
133
|
+
var L = Object.getOwnPropertyDescriptor(s, "key").get;
|
|
134
|
+
if (L && L.isReactWarning) return !1;
|
|
135
135
|
}
|
|
136
136
|
return s.key !== void 0;
|
|
137
137
|
}
|
|
138
|
-
function g(s,
|
|
139
|
-
function
|
|
140
|
-
|
|
138
|
+
function g(s, L) {
|
|
139
|
+
function K() {
|
|
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)",
|
|
142
|
-
|
|
142
|
+
L
|
|
143
143
|
));
|
|
144
144
|
}
|
|
145
|
-
|
|
146
|
-
get:
|
|
145
|
+
K.isReactWarning = !0, Object.defineProperty(s, "key", {
|
|
146
|
+
get: K,
|
|
147
147
|
configurable: !0
|
|
148
148
|
});
|
|
149
149
|
}
|
|
150
|
-
function
|
|
150
|
+
function i() {
|
|
151
151
|
var s = t(this.type);
|
|
152
|
-
return
|
|
152
|
+
return Q[s] || (Q[s] = !0, console.error(
|
|
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,
|
|
157
|
-
return
|
|
156
|
+
function e(s, L, K, ae, ye, ce, be, O) {
|
|
157
|
+
return K = ce.ref, s = {
|
|
158
158
|
$$typeof: d,
|
|
159
159
|
type: s,
|
|
160
|
-
key:
|
|
161
|
-
props:
|
|
162
|
-
_owner:
|
|
163
|
-
}, (
|
|
160
|
+
key: L,
|
|
161
|
+
props: ce,
|
|
162
|
+
_owner: ye
|
|
163
|
+
}, (K !== void 0 ? K : null) !== null ? Object.defineProperty(s, "ref", {
|
|
164
164
|
enumerable: !1,
|
|
165
|
-
get:
|
|
165
|
+
get: i
|
|
166
166
|
}) : Object.defineProperty(s, "ref", { enumerable: !1, value: null }), s._store = {}, Object.defineProperty(s._store, "validated", {
|
|
167
167
|
configurable: !1,
|
|
168
168
|
enumerable: !1,
|
|
@@ -177,7 +177,7 @@ function lt() {
|
|
|
177
177
|
configurable: !1,
|
|
178
178
|
enumerable: !1,
|
|
179
179
|
writable: !0,
|
|
180
|
-
value:
|
|
180
|
+
value: be
|
|
181
181
|
}), Object.defineProperty(s, "_debugTask", {
|
|
182
182
|
configurable: !1,
|
|
183
183
|
enumerable: !1,
|
|
@@ -185,110 +185,110 @@ function lt() {
|
|
|
185
185
|
value: O
|
|
186
186
|
}), Object.freeze && (Object.freeze(s.props), Object.freeze(s)), s;
|
|
187
187
|
}
|
|
188
|
-
function x(s,
|
|
189
|
-
var
|
|
190
|
-
if (
|
|
191
|
-
if (
|
|
192
|
-
if (Z(
|
|
193
|
-
for (
|
|
194
|
-
u(
|
|
195
|
-
Object.freeze && Object.freeze(
|
|
188
|
+
function x(s, L, K, ae, ye, ce, be, O) {
|
|
189
|
+
var G = L.children;
|
|
190
|
+
if (G !== void 0)
|
|
191
|
+
if (ae)
|
|
192
|
+
if (Z(G)) {
|
|
193
|
+
for (ae = 0; ae < G.length; ae++)
|
|
194
|
+
u(G[ae]);
|
|
195
|
+
Object.freeze && Object.freeze(G);
|
|
196
196
|
} else
|
|
197
197
|
console.error(
|
|
198
198
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
199
199
|
);
|
|
200
|
-
else u(
|
|
201
|
-
if (
|
|
202
|
-
|
|
203
|
-
var
|
|
204
|
-
return
|
|
200
|
+
else u(G);
|
|
201
|
+
if (X.call(L, "key")) {
|
|
202
|
+
G = t(s);
|
|
203
|
+
var ue = Object.keys(L).filter(function(qe) {
|
|
204
|
+
return qe !== "key";
|
|
205
205
|
});
|
|
206
|
-
|
|
206
|
+
ae = 0 < ue.length ? "{key: someKey, " + ue.join(": ..., ") + ": ...}" : "{key: someKey}", he[G + ae] || (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
|
-
ee,
|
|
214
|
-
M,
|
|
215
213
|
ae,
|
|
216
|
-
|
|
217
|
-
|
|
214
|
+
G,
|
|
215
|
+
ue,
|
|
216
|
+
G
|
|
217
|
+
), he[G + ae] = !0);
|
|
218
218
|
}
|
|
219
|
-
if (
|
|
220
|
-
|
|
221
|
-
for (var
|
|
222
|
-
|
|
223
|
-
} else
|
|
224
|
-
return
|
|
225
|
-
|
|
219
|
+
if (G = null, K !== void 0 && (l(K), G = "" + K), A(L) && (l(L.key), G = "" + L.key), "key" in L) {
|
|
220
|
+
K = {};
|
|
221
|
+
for (var ve in L)
|
|
222
|
+
ve !== "key" && (K[ve] = L[ve]);
|
|
223
|
+
} else K = L;
|
|
224
|
+
return G && g(
|
|
225
|
+
K,
|
|
226
226
|
typeof s == "function" ? s.displayName || s.name || "Unknown" : s
|
|
227
227
|
), e(
|
|
228
228
|
s,
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
ue,
|
|
232
|
-
a(),
|
|
233
|
-
X,
|
|
229
|
+
G,
|
|
230
|
+
ce,
|
|
234
231
|
ye,
|
|
232
|
+
r(),
|
|
233
|
+
K,
|
|
234
|
+
be,
|
|
235
235
|
O
|
|
236
236
|
);
|
|
237
237
|
}
|
|
238
238
|
function u(s) {
|
|
239
239
|
typeof s == "object" && s !== null && s.$$typeof === d && s._store && (s._store.validated = 1);
|
|
240
240
|
}
|
|
241
|
-
var
|
|
241
|
+
var q = Ue, d = Symbol.for("react.transitional.element"), o = Symbol.for("react.portal"), C = Symbol.for("react.fragment"), c = Symbol.for("react.strict_mode"), w = Symbol.for("react.profiler"), k = Symbol.for("react.consumer"), $ = Symbol.for("react.context"), b = 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"), U = Symbol.for("react.client.reference"), H = q.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, X = Object.prototype.hasOwnProperty, Z = Array.isArray, T = 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
|
|
250
|
-
|
|
249
|
+
var I, Q = {}, ee = q.react_stack_bottom_frame.bind(
|
|
250
|
+
q,
|
|
251
251
|
m
|
|
252
|
-
)(),
|
|
253
|
-
|
|
254
|
-
var
|
|
252
|
+
)(), pe = T(a(m)), he = {};
|
|
253
|
+
ke.Fragment = C, ke.jsx = function(s, L, K, ae, ye) {
|
|
254
|
+
var ce = 1e4 > H.recentlyCreatedOwnerStacks++;
|
|
255
255
|
return x(
|
|
256
256
|
s,
|
|
257
|
-
|
|
258
|
-
|
|
257
|
+
L,
|
|
258
|
+
K,
|
|
259
259
|
!1,
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
260
|
+
ae,
|
|
261
|
+
ye,
|
|
262
|
+
ce ? Error("react-stack-top-frame") : ee,
|
|
263
|
+
ce ? T(a(s)) : pe
|
|
264
264
|
);
|
|
265
|
-
},
|
|
266
|
-
var
|
|
265
|
+
}, ke.jsxs = function(s, L, K, ae, ye) {
|
|
266
|
+
var ce = 1e4 > H.recentlyCreatedOwnerStacks++;
|
|
267
267
|
return x(
|
|
268
268
|
s,
|
|
269
|
-
|
|
270
|
-
|
|
269
|
+
L,
|
|
270
|
+
K,
|
|
271
271
|
!0,
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
272
|
+
ae,
|
|
273
|
+
ye,
|
|
274
|
+
ce ? Error("react-stack-top-frame") : ee,
|
|
275
|
+
ce ? T(a(s)) : pe
|
|
276
276
|
);
|
|
277
277
|
};
|
|
278
|
-
}()),
|
|
278
|
+
}()), ke;
|
|
279
279
|
}
|
|
280
|
-
var
|
|
281
|
-
function
|
|
282
|
-
return
|
|
280
|
+
var Me;
|
|
281
|
+
function yt() {
|
|
282
|
+
return Me || (Me = 1, process.env.NODE_ENV === "production" ? Se.exports = ft() : Se.exports = mt()), Se.exports;
|
|
283
283
|
}
|
|
284
|
-
var n =
|
|
285
|
-
const
|
|
284
|
+
var n = yt();
|
|
285
|
+
const gt = ({
|
|
286
286
|
variant: t = "primary",
|
|
287
287
|
loading: p = !1,
|
|
288
|
-
children:
|
|
289
|
-
...
|
|
288
|
+
children: l,
|
|
289
|
+
...a
|
|
290
290
|
}) => {
|
|
291
|
-
const
|
|
291
|
+
const r = (m) => {
|
|
292
292
|
switch (m) {
|
|
293
293
|
case "primary":
|
|
294
294
|
return "primary";
|
|
@@ -305,17 +305,17 @@ const ct = ({
|
|
|
305
305
|
}
|
|
306
306
|
};
|
|
307
307
|
return /* @__PURE__ */ n.jsx(
|
|
308
|
-
|
|
308
|
+
xe,
|
|
309
309
|
{
|
|
310
|
-
...
|
|
311
|
-
type:
|
|
310
|
+
...a,
|
|
311
|
+
type: r(t),
|
|
312
312
|
loading: p,
|
|
313
313
|
ghost: t === "ghost",
|
|
314
|
-
children:
|
|
314
|
+
children: l
|
|
315
315
|
}
|
|
316
316
|
);
|
|
317
317
|
};
|
|
318
|
-
|
|
318
|
+
gt.__docgenInfo = {
|
|
319
319
|
displayName: "Button",
|
|
320
320
|
description: "基础按钮,用于触发操作",
|
|
321
321
|
props: {
|
|
@@ -359,25 +359,25 @@ ct.__docgenInfo = {
|
|
|
359
359
|
}
|
|
360
360
|
}
|
|
361
361
|
};
|
|
362
|
-
const
|
|
362
|
+
const ht = ({
|
|
363
363
|
title: t,
|
|
364
364
|
children: p,
|
|
365
|
-
bordered:
|
|
366
|
-
hoverable:
|
|
367
|
-
size:
|
|
365
|
+
bordered: l = !0,
|
|
366
|
+
hoverable: a = !1,
|
|
367
|
+
size: r = "default",
|
|
368
368
|
...m
|
|
369
369
|
}) => /* @__PURE__ */ n.jsx(
|
|
370
|
-
|
|
370
|
+
Re,
|
|
371
371
|
{
|
|
372
372
|
...m,
|
|
373
373
|
title: t,
|
|
374
|
-
bordered:
|
|
375
|
-
hoverable:
|
|
376
|
-
size:
|
|
374
|
+
bordered: l,
|
|
375
|
+
hoverable: a,
|
|
376
|
+
size: r,
|
|
377
377
|
children: p
|
|
378
378
|
}
|
|
379
379
|
);
|
|
380
|
-
|
|
380
|
+
ht.__docgenInfo = {
|
|
381
381
|
displayName: "Card",
|
|
382
382
|
description: "卡片容器,用于分组内容",
|
|
383
383
|
props: {
|
|
@@ -428,23 +428,23 @@ ut.__docgenInfo = {
|
|
|
428
428
|
}
|
|
429
429
|
}
|
|
430
430
|
};
|
|
431
|
-
const
|
|
431
|
+
const vt = ({
|
|
432
432
|
showDefaultFooter: t = !0,
|
|
433
433
|
...p
|
|
434
434
|
}) => {
|
|
435
|
-
const
|
|
436
|
-
/* @__PURE__ */ n.jsx(
|
|
435
|
+
const l = p.footer !== void 0 ? p.footer : t ? (a, { OkBtn: r, CancelBtn: m }) => /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
436
|
+
/* @__PURE__ */ n.jsx(r, {}),
|
|
437
437
|
/* @__PURE__ */ n.jsx(m, {})
|
|
438
438
|
] }) : null;
|
|
439
439
|
return /* @__PURE__ */ n.jsx(
|
|
440
|
-
|
|
440
|
+
Ke,
|
|
441
441
|
{
|
|
442
442
|
...p,
|
|
443
|
-
footer:
|
|
443
|
+
footer: l
|
|
444
444
|
}
|
|
445
445
|
);
|
|
446
446
|
};
|
|
447
|
-
|
|
447
|
+
vt.__docgenInfo = {
|
|
448
448
|
displayName: "AppModal",
|
|
449
449
|
description: "应用级模态框组件,基于 Ant Design Modal 封装",
|
|
450
450
|
props: {
|
|
@@ -505,15 +505,15 @@ dt.__docgenInfo = {
|
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
507
|
};
|
|
508
|
-
const
|
|
508
|
+
const bt = ({
|
|
509
509
|
scrollX: t,
|
|
510
510
|
showPagination: p = !0,
|
|
511
|
-
defaultPageSize:
|
|
512
|
-
...
|
|
511
|
+
defaultPageSize: l = 10,
|
|
512
|
+
...a
|
|
513
513
|
}) => /* @__PURE__ */ n.jsx(
|
|
514
|
-
|
|
514
|
+
Ie,
|
|
515
515
|
{
|
|
516
|
-
...
|
|
516
|
+
...a,
|
|
517
517
|
scroll: {
|
|
518
518
|
x: t || "max-content",
|
|
519
519
|
y: "50vh"
|
|
@@ -522,12 +522,12 @@ const pt = ({
|
|
|
522
522
|
hideOnSinglePage: !0,
|
|
523
523
|
showSizeChanger: !0,
|
|
524
524
|
showQuickJumper: !0,
|
|
525
|
-
defaultPageSize:
|
|
526
|
-
...
|
|
525
|
+
defaultPageSize: l,
|
|
526
|
+
...a.pagination
|
|
527
527
|
} : !1
|
|
528
528
|
}
|
|
529
529
|
);
|
|
530
|
-
|
|
530
|
+
bt.__docgenInfo = {
|
|
531
531
|
displayName: "PageTable",
|
|
532
532
|
description: "页面级表格组件,高度铺满容器,自动滚动",
|
|
533
533
|
props: {
|
|
@@ -577,30 +577,30 @@ pt.__docgenInfo = {
|
|
|
577
577
|
}
|
|
578
578
|
}
|
|
579
579
|
};
|
|
580
|
-
const
|
|
580
|
+
const xt = rt({
|
|
581
581
|
scriptUrl: ["https://at.alicdn.com/t/c/font_4968458_eh91gfr4j9e.js"]
|
|
582
|
-
}),
|
|
582
|
+
}), wt = ({
|
|
583
583
|
name: t,
|
|
584
584
|
size: p,
|
|
585
|
-
color:
|
|
586
|
-
style:
|
|
587
|
-
...
|
|
585
|
+
color: l,
|
|
586
|
+
style: a,
|
|
587
|
+
...r
|
|
588
588
|
}) => {
|
|
589
589
|
const m = {
|
|
590
590
|
fontSize: p,
|
|
591
|
-
color:
|
|
592
|
-
...
|
|
591
|
+
color: l,
|
|
592
|
+
...a
|
|
593
593
|
};
|
|
594
594
|
return /* @__PURE__ */ n.jsx(
|
|
595
|
-
|
|
595
|
+
xt,
|
|
596
596
|
{
|
|
597
|
-
...
|
|
597
|
+
...r,
|
|
598
598
|
type: t,
|
|
599
599
|
style: m
|
|
600
600
|
}
|
|
601
601
|
);
|
|
602
602
|
};
|
|
603
|
-
|
|
603
|
+
wt.__docgenInfo = {
|
|
604
604
|
displayName: "XcIcon",
|
|
605
605
|
description: "自定义图标组件,基于 iconfont",
|
|
606
606
|
props: {
|
|
@@ -636,43 +636,43 @@ mt.__docgenInfo = {
|
|
|
636
636
|
}
|
|
637
637
|
}
|
|
638
638
|
};
|
|
639
|
-
const
|
|
639
|
+
const Et = ({
|
|
640
640
|
loading: t,
|
|
641
641
|
description: p = "暂无数据",
|
|
642
|
-
className:
|
|
643
|
-
emptyChildren:
|
|
644
|
-
loadingText:
|
|
642
|
+
className: l,
|
|
643
|
+
emptyChildren: a,
|
|
644
|
+
loadingText: r,
|
|
645
645
|
emptyImage: m
|
|
646
646
|
}) => t ? /* @__PURE__ */ n.jsxs(
|
|
647
|
-
|
|
647
|
+
Pe,
|
|
648
648
|
{
|
|
649
|
-
className: `pt-10 w-full ${
|
|
649
|
+
className: `pt-10 w-full ${l || ""}`,
|
|
650
650
|
align: "center",
|
|
651
651
|
justify: "center",
|
|
652
652
|
vertical: !0,
|
|
653
653
|
children: [
|
|
654
|
-
/* @__PURE__ */ n.jsx(
|
|
655
|
-
|
|
654
|
+
/* @__PURE__ */ n.jsx(Ye, { size: "large" }),
|
|
655
|
+
r && /* @__PURE__ */ n.jsx("div", { className: "mt-4 text-gray-500", children: r })
|
|
656
656
|
]
|
|
657
657
|
}
|
|
658
658
|
) : /* @__PURE__ */ n.jsx(
|
|
659
|
-
|
|
659
|
+
Pe,
|
|
660
660
|
{
|
|
661
|
-
className: `pt-10 w-full ${
|
|
661
|
+
className: `pt-10 w-full ${l || ""}`,
|
|
662
662
|
align: "center",
|
|
663
663
|
justify: "center",
|
|
664
664
|
children: /* @__PURE__ */ n.jsx(
|
|
665
|
-
|
|
665
|
+
Je,
|
|
666
666
|
{
|
|
667
667
|
image: m,
|
|
668
668
|
description: p,
|
|
669
669
|
imageStyle: { height: 180 },
|
|
670
|
-
children:
|
|
670
|
+
children: a
|
|
671
671
|
}
|
|
672
672
|
)
|
|
673
673
|
}
|
|
674
674
|
);
|
|
675
|
-
|
|
675
|
+
Et.__docgenInfo = {
|
|
676
676
|
displayName: "EmptyAndSpin",
|
|
677
677
|
description: "空状态和加载状态组合组件",
|
|
678
678
|
props: {
|
|
@@ -715,24 +715,24 @@ yt.__docgenInfo = {
|
|
|
715
715
|
}
|
|
716
716
|
}
|
|
717
717
|
};
|
|
718
|
-
const
|
|
718
|
+
const kt = ({
|
|
719
719
|
onClick: t,
|
|
720
720
|
showText: p = !1,
|
|
721
|
-
className:
|
|
722
|
-
size:
|
|
723
|
-
type:
|
|
721
|
+
className: l,
|
|
722
|
+
size: a = "small",
|
|
723
|
+
type: r = "default"
|
|
724
724
|
}) => /* @__PURE__ */ n.jsx(
|
|
725
|
-
|
|
725
|
+
xe,
|
|
726
726
|
{
|
|
727
|
-
size:
|
|
728
|
-
type:
|
|
729
|
-
icon: /* @__PURE__ */ n.jsx(
|
|
730
|
-
className: `cursor-pointer ${
|
|
727
|
+
size: a,
|
|
728
|
+
type: r,
|
|
729
|
+
icon: /* @__PURE__ */ n.jsx(ot, {}),
|
|
730
|
+
className: `cursor-pointer ${l || ""}`,
|
|
731
731
|
onClick: t,
|
|
732
732
|
children: p && "返回"
|
|
733
733
|
}
|
|
734
734
|
);
|
|
735
|
-
|
|
735
|
+
kt.__docgenInfo = {
|
|
736
736
|
displayName: "BackButton",
|
|
737
737
|
description: "返回按钮组件",
|
|
738
738
|
props: {
|
|
@@ -771,23 +771,23 @@ gt.__docgenInfo = {
|
|
|
771
771
|
}
|
|
772
772
|
}
|
|
773
773
|
};
|
|
774
|
-
const
|
|
774
|
+
const Tt = ({
|
|
775
775
|
removePadding: t = !0,
|
|
776
776
|
className: p,
|
|
777
|
-
...
|
|
777
|
+
...l
|
|
778
778
|
}) => {
|
|
779
|
-
const
|
|
779
|
+
const a = t ? `px-0 h-auto ${p || ""}` : p;
|
|
780
780
|
return /* @__PURE__ */ n.jsx(
|
|
781
|
-
|
|
781
|
+
xe,
|
|
782
782
|
{
|
|
783
783
|
type: "link",
|
|
784
|
-
...
|
|
785
|
-
className:
|
|
786
|
-
children:
|
|
784
|
+
...l,
|
|
785
|
+
className: a,
|
|
786
|
+
children: l.children
|
|
787
787
|
}
|
|
788
788
|
);
|
|
789
789
|
};
|
|
790
|
-
|
|
790
|
+
Tt.__docgenInfo = {
|
|
791
791
|
displayName: "LinkButton",
|
|
792
792
|
description: "链接样式按钮组件,适用于表格操作列",
|
|
793
793
|
props: {
|
|
@@ -824,121 +824,121 @@ ht.__docgenInfo = {
|
|
|
824
824
|
}
|
|
825
825
|
}
|
|
826
826
|
};
|
|
827
|
-
const { Option:
|
|
827
|
+
const { Option: Nt } = Ve, Ct = ({
|
|
828
828
|
columns: t,
|
|
829
829
|
request: p,
|
|
830
|
-
searchFields:
|
|
831
|
-
showSearch:
|
|
832
|
-
showRefresh:
|
|
830
|
+
searchFields: l = [],
|
|
831
|
+
showSearch: a = !0,
|
|
832
|
+
showRefresh: r = !0,
|
|
833
833
|
defaultPageSize: m = 10,
|
|
834
|
-
pageSizeOptions:
|
|
834
|
+
pageSizeOptions: A = ["10", "20", "50", "100"],
|
|
835
835
|
autoLoad: g = !0,
|
|
836
|
-
externalParams:
|
|
836
|
+
externalParams: i = {},
|
|
837
837
|
...e
|
|
838
838
|
}) => {
|
|
839
|
-
const [x, u] =
|
|
839
|
+
const [x, u] = J([]), [q, d] = J(!1), [o, C] = J({
|
|
840
840
|
current: 1,
|
|
841
841
|
pageSize: m,
|
|
842
842
|
total: 0
|
|
843
|
-
}), [c,
|
|
844
|
-
|
|
845
|
-
const
|
|
846
|
-
|
|
847
|
-
const
|
|
848
|
-
const { sortable:
|
|
843
|
+
}), [c, w] = J({}), [k, $] = J({}), [b] = Ce.useForm(), V = z(o);
|
|
844
|
+
V.current = o;
|
|
845
|
+
const _ = z(i);
|
|
846
|
+
_.current = i;
|
|
847
|
+
const P = z(!1), D = Ge(() => t.map((T) => {
|
|
848
|
+
const { sortable: I, render: Q, ...ee } = T;
|
|
849
849
|
return {
|
|
850
|
-
...
|
|
851
|
-
sorter:
|
|
852
|
-
render:
|
|
850
|
+
...ee,
|
|
851
|
+
sorter: I ? !0 : void 0,
|
|
852
|
+
render: Q || ((pe) => pe)
|
|
853
853
|
};
|
|
854
|
-
}), [t]),
|
|
854
|
+
}), [t]), B = W(async (T = {}) => {
|
|
855
855
|
if (p) {
|
|
856
856
|
d(!0);
|
|
857
857
|
try {
|
|
858
|
-
const
|
|
859
|
-
page:
|
|
860
|
-
pageSize:
|
|
861
|
-
sortField:
|
|
862
|
-
sortOrder:
|
|
863
|
-
searchParams: { ...c, ...
|
|
864
|
-
...
|
|
865
|
-
},
|
|
866
|
-
|
|
867
|
-
...
|
|
868
|
-
total:
|
|
869
|
-
current:
|
|
858
|
+
const I = {
|
|
859
|
+
page: V.current.current,
|
|
860
|
+
pageSize: V.current.pageSize,
|
|
861
|
+
sortField: k.field,
|
|
862
|
+
sortOrder: k.order,
|
|
863
|
+
searchParams: { ...c, ..._.current },
|
|
864
|
+
...T
|
|
865
|
+
}, Q = await p(I);
|
|
866
|
+
Q.success && (u(Q.data), C((ee) => ({
|
|
867
|
+
...ee,
|
|
868
|
+
total: Q.total,
|
|
869
|
+
current: I.page || ee.current
|
|
870
870
|
})));
|
|
871
|
-
} catch (
|
|
872
|
-
console.error("加载数据失败:",
|
|
871
|
+
} catch (I) {
|
|
872
|
+
console.error("加载数据失败:", I);
|
|
873
873
|
} finally {
|
|
874
874
|
d(!1);
|
|
875
875
|
}
|
|
876
876
|
}
|
|
877
|
-
}, [p,
|
|
878
|
-
|
|
879
|
-
}, []),
|
|
880
|
-
|
|
881
|
-
}, [
|
|
882
|
-
|
|
883
|
-
}, [
|
|
884
|
-
const
|
|
885
|
-
current:
|
|
886
|
-
pageSize:
|
|
887
|
-
total:
|
|
888
|
-
},
|
|
889
|
-
field:
|
|
890
|
-
order:
|
|
877
|
+
}, [p, k, c]), U = W((T) => {
|
|
878
|
+
w(T), C((I) => ({ ...I, current: 1 }));
|
|
879
|
+
}, []), H = W(() => {
|
|
880
|
+
b.resetFields(), w({}), C((T) => ({ ...T, current: 1 }));
|
|
881
|
+
}, [b]), X = W(() => {
|
|
882
|
+
B();
|
|
883
|
+
}, [B]), Z = W((T, I, Q) => {
|
|
884
|
+
const ee = {
|
|
885
|
+
current: T.current || 1,
|
|
886
|
+
pageSize: T.pageSize || m,
|
|
887
|
+
total: T.total || 0
|
|
888
|
+
}, pe = {
|
|
889
|
+
field: Q?.field,
|
|
890
|
+
order: Q?.order
|
|
891
891
|
};
|
|
892
|
-
|
|
892
|
+
C(ee), $(pe);
|
|
893
893
|
}, [m]);
|
|
894
|
-
return
|
|
895
|
-
const
|
|
896
|
-
(g && !
|
|
897
|
-
}, [g,
|
|
898
|
-
|
|
899
|
-
|
|
894
|
+
return oe(() => {
|
|
895
|
+
const T = Object.keys(i).length > 0;
|
|
896
|
+
(g && !P.current || T) && (B(), P.current = !0);
|
|
897
|
+
}, [g, i, B]), /* @__PURE__ */ n.jsxs("div", { children: [
|
|
898
|
+
a && l.length > 0 && /* @__PURE__ */ n.jsx(Re, { size: "small", style: { marginBottom: 16 }, children: /* @__PURE__ */ n.jsxs(
|
|
899
|
+
Ce,
|
|
900
900
|
{
|
|
901
|
-
form:
|
|
901
|
+
form: b,
|
|
902
902
|
layout: "inline",
|
|
903
|
-
onFinish:
|
|
904
|
-
initialValues:
|
|
903
|
+
onFinish: U,
|
|
904
|
+
initialValues: l.reduce((T, I) => (I.defaultValue !== void 0 && (T[I.key] = I.defaultValue), T), {}),
|
|
905
905
|
children: [
|
|
906
|
-
|
|
907
|
-
|
|
906
|
+
l.map((T) => /* @__PURE__ */ n.jsx(Ce.Item, { name: T.key, label: T.label, children: T.type === "input" ? /* @__PURE__ */ n.jsx(
|
|
907
|
+
Fe,
|
|
908
908
|
{
|
|
909
|
-
placeholder:
|
|
909
|
+
placeholder: T.placeholder || `请输入${T.label}`,
|
|
910
910
|
style: { width: 200 }
|
|
911
911
|
}
|
|
912
912
|
) : /* @__PURE__ */ n.jsx(
|
|
913
|
-
|
|
913
|
+
Ve,
|
|
914
914
|
{
|
|
915
|
-
placeholder:
|
|
915
|
+
placeholder: T.placeholder || `请选择${T.label}`,
|
|
916
916
|
style: { width: 200 },
|
|
917
917
|
allowClear: !0,
|
|
918
|
-
children:
|
|
918
|
+
children: T.options?.map((I) => /* @__PURE__ */ n.jsx(Nt, { value: I.value, children: I.label }, I.value))
|
|
919
919
|
}
|
|
920
|
-
) },
|
|
921
|
-
/* @__PURE__ */ n.jsx(
|
|
922
|
-
/* @__PURE__ */ n.jsx(
|
|
923
|
-
/* @__PURE__ */ n.jsx(
|
|
924
|
-
|
|
920
|
+
) }, T.key)),
|
|
921
|
+
/* @__PURE__ */ n.jsx(Ce.Item, { children: /* @__PURE__ */ n.jsxs(Qe, { children: [
|
|
922
|
+
/* @__PURE__ */ n.jsx(xe, { type: "primary", htmlType: "submit", icon: /* @__PURE__ */ n.jsx(lt, {}), children: "查询" }),
|
|
923
|
+
/* @__PURE__ */ n.jsx(xe, { onClick: H, children: "重置" }),
|
|
924
|
+
r && /* @__PURE__ */ n.jsx(xe, { icon: /* @__PURE__ */ n.jsx(st, {}), onClick: X, children: "刷新" })
|
|
925
925
|
] }) })
|
|
926
926
|
]
|
|
927
927
|
}
|
|
928
928
|
) }),
|
|
929
929
|
/* @__PURE__ */ n.jsx(
|
|
930
|
-
|
|
930
|
+
Ie,
|
|
931
931
|
{
|
|
932
932
|
...e,
|
|
933
933
|
columns: D,
|
|
934
934
|
dataSource: x,
|
|
935
|
-
loading:
|
|
935
|
+
loading: q,
|
|
936
936
|
pagination: {
|
|
937
|
-
...
|
|
937
|
+
...o,
|
|
938
938
|
showSizeChanger: !0,
|
|
939
939
|
showQuickJumper: !0,
|
|
940
|
-
showTotal: (
|
|
941
|
-
pageSizeOptions:
|
|
940
|
+
showTotal: (T, I) => `第 ${I[0]}-${I[1]} 条/共 ${T} 条`,
|
|
941
|
+
pageSizeOptions: A
|
|
942
942
|
},
|
|
943
943
|
onChange: Z,
|
|
944
944
|
scroll: { x: "max-content", y: "50vh" }
|
|
@@ -946,7 +946,7 @@ const { Option: bt } = Ae, xt = ({
|
|
|
946
946
|
)
|
|
947
947
|
] });
|
|
948
948
|
};
|
|
949
|
-
|
|
949
|
+
Ct.__docgenInfo = {
|
|
950
950
|
displayName: "AdvancedTable",
|
|
951
951
|
description: "高阶表格组件,支持异步请求、搜索、排序等功能",
|
|
952
952
|
props: {
|
|
@@ -1013,27 +1013,27 @@ xt.__docgenInfo = {
|
|
|
1013
1013
|
}
|
|
1014
1014
|
}
|
|
1015
1015
|
};
|
|
1016
|
-
function
|
|
1016
|
+
function _e(t, p, l) {
|
|
1017
1017
|
if (!t.current) return;
|
|
1018
|
-
const
|
|
1018
|
+
const a = /* @__PURE__ */ new Set(), r = {};
|
|
1019
1019
|
for (const u of p)
|
|
1020
|
-
u.exclusionGroup && u.exclusionGroup !== "separator" && (
|
|
1020
|
+
u.exclusionGroup && u.exclusionGroup !== "separator" && (a.add(u.exclusionGroup), r[u.exclusionGroup] || (r[u.exclusionGroup] = []), r[u.exclusionGroup].push({
|
|
1021
1021
|
type: u.type,
|
|
1022
1022
|
key: u.key,
|
|
1023
1023
|
exclusionGroup: u.exclusionGroup
|
|
1024
1024
|
}));
|
|
1025
1025
|
const m = {};
|
|
1026
|
-
for (const u of
|
|
1026
|
+
for (const u of a) {
|
|
1027
1027
|
m[u] = !1;
|
|
1028
|
-
for (const
|
|
1029
|
-
if (
|
|
1030
|
-
if (
|
|
1028
|
+
for (const q of r[u])
|
|
1029
|
+
if (q.type === "upload" && q.key) {
|
|
1030
|
+
if (l[q.key] !== null && l[q.key] !== void 0) {
|
|
1031
1031
|
m[u] = !0;
|
|
1032
1032
|
break;
|
|
1033
1033
|
}
|
|
1034
|
-
} else if (
|
|
1034
|
+
} else if (q.type === "variable" && q.key) {
|
|
1035
1035
|
const d = t.current.querySelector(
|
|
1036
|
-
`[data-type="variable"][data-key="${
|
|
1036
|
+
`[data-type="variable"][data-key="${q.key}"]`
|
|
1037
1037
|
);
|
|
1038
1038
|
if (d && d.innerText.replace(/[\u200B\n]/g, "").trim().length > 0) {
|
|
1039
1039
|
m[u] = !0;
|
|
@@ -1041,45 +1041,45 @@ function Ne(t, p, o) {
|
|
|
1041
1041
|
}
|
|
1042
1042
|
}
|
|
1043
1043
|
}
|
|
1044
|
-
const
|
|
1044
|
+
const A = p.some((u) => u.exclusionGroup === "separator"), i = Object.keys(m).filter(
|
|
1045
1045
|
(u) => m[u]
|
|
1046
1046
|
).length > 0;
|
|
1047
1047
|
let e = null;
|
|
1048
|
-
if (
|
|
1048
|
+
if (i && A) {
|
|
1049
1049
|
for (const u of p)
|
|
1050
1050
|
if (u.exclusionGroup && u.exclusionGroup !== "separator" && m[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 a) {
|
|
1056
|
+
const q = t.current.querySelectorAll(
|
|
1057
1057
|
`[data-group="${u}"]`
|
|
1058
1058
|
);
|
|
1059
|
-
|
|
1059
|
+
A && i && e ? u === e ? q.forEach((d) => {
|
|
1060
1060
|
d.classList.contains("required-upload-group") ? d.style.setProperty("display", "inline-flex", "important") : (d.classList.contains("exclusion-wrapper"), d.style.setProperty("display", "inline-block", "important"));
|
|
1061
|
-
}) :
|
|
1061
|
+
}) : q.forEach((d) => {
|
|
1062
1062
|
d.style.display = "none", d.style.setProperty("display", "none", "important");
|
|
1063
|
-
}) :
|
|
1063
|
+
}) : q.forEach((d) => {
|
|
1064
1064
|
d.classList.contains("required-upload-group") ? d.style.setProperty("display", "inline-flex", "important") : (d.classList.contains("exclusion-wrapper"), d.style.setProperty("display", "inline-block", "important"));
|
|
1065
1065
|
});
|
|
1066
1066
|
}
|
|
1067
1067
|
t.current.querySelectorAll(
|
|
1068
1068
|
'[data-group="separator"]'
|
|
1069
1069
|
).forEach((u) => {
|
|
1070
|
-
u.style.display =
|
|
1070
|
+
u.style.display = i ? "none" : "inline";
|
|
1071
1071
|
});
|
|
1072
1072
|
}
|
|
1073
|
-
function
|
|
1073
|
+
function je(t, p, l, a) {
|
|
1074
1074
|
if (!t.current) {
|
|
1075
|
-
|
|
1075
|
+
a(!1);
|
|
1076
1076
|
return;
|
|
1077
1077
|
}
|
|
1078
|
-
const
|
|
1079
|
-
for (let
|
|
1080
|
-
const e = p[
|
|
1078
|
+
const r = [];
|
|
1079
|
+
for (let i = 0; i < p.length; i++) {
|
|
1080
|
+
const e = p[i];
|
|
1081
1081
|
if ((e.type === "variable" || e.type === "upload" || e.type === "multi-variable") && e.required && e.key) {
|
|
1082
|
-
|
|
1082
|
+
r.push({
|
|
1083
1083
|
exclusionGroup: e.exclusionGroup || "",
|
|
1084
1084
|
key: e.key,
|
|
1085
1085
|
type: e.type === "multi-variable" ? "variable" : e.type,
|
|
@@ -1088,10 +1088,10 @@ function Ce(t, p, o, r) {
|
|
|
1088
1088
|
continue;
|
|
1089
1089
|
}
|
|
1090
1090
|
if (e.type === "text" && e.className?.includes("rte-text-required") && e.exclusionGroup)
|
|
1091
|
-
for (let x =
|
|
1091
|
+
for (let x = i + 1; x < p.length; x++) {
|
|
1092
1092
|
const u = p[x];
|
|
1093
1093
|
if (u.exclusionGroup === e.exclusionGroup && (u.type === "variable" || u.type === "upload") && u.key) {
|
|
1094
|
-
|
|
1094
|
+
r.push({
|
|
1095
1095
|
exclusionGroup: e.exclusionGroup,
|
|
1096
1096
|
key: u.key,
|
|
1097
1097
|
type: u.type
|
|
@@ -1100,46 +1100,46 @@ function Ce(t, p, o, r) {
|
|
|
1100
1100
|
}
|
|
1101
1101
|
}
|
|
1102
1102
|
}
|
|
1103
|
-
const m = p.some((
|
|
1104
|
-
let
|
|
1105
|
-
if (m &&
|
|
1106
|
-
const
|
|
1103
|
+
const m = p.some((i) => i.exclusionGroup === "separator");
|
|
1104
|
+
let A = !1;
|
|
1105
|
+
if (m && r.length > 1) {
|
|
1106
|
+
const i = p.findIndex((u) => u.exclusionGroup === "separator"), e = r.filter((u) => p.findIndex(
|
|
1107
1107
|
(d) => (d.type === "variable" || d.type === "upload") && d.key === u.key && d.exclusionGroup === u.exclusionGroup
|
|
1108
|
-
) <
|
|
1108
|
+
) < i), x = r.filter((u) => p.findIndex(
|
|
1109
1109
|
(d) => (d.type === "variable" || d.type === "upload") && d.key === u.key && d.exclusionGroup === u.exclusionGroup
|
|
1110
|
-
) >
|
|
1111
|
-
|
|
1110
|
+
) > i);
|
|
1111
|
+
A = e.length > 0 && x.length > 0;
|
|
1112
1112
|
}
|
|
1113
|
-
if (
|
|
1113
|
+
if (r.length === 0) {
|
|
1114
1114
|
if (p.length === 0) {
|
|
1115
1115
|
if (!t.current) {
|
|
1116
|
-
|
|
1116
|
+
a(!1);
|
|
1117
1117
|
return;
|
|
1118
1118
|
}
|
|
1119
|
-
const
|
|
1120
|
-
|
|
1119
|
+
const i = t.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "";
|
|
1120
|
+
a(i.length > 0);
|
|
1121
1121
|
return;
|
|
1122
1122
|
}
|
|
1123
|
-
|
|
1123
|
+
a(!0);
|
|
1124
1124
|
return;
|
|
1125
1125
|
}
|
|
1126
|
-
const g =
|
|
1126
|
+
const g = r.filter((i) => {
|
|
1127
1127
|
if (!t.current) return !1;
|
|
1128
1128
|
const e = t.current.querySelectorAll(
|
|
1129
|
-
`[data-group="${
|
|
1129
|
+
`[data-group="${i.exclusionGroup}"]`
|
|
1130
1130
|
);
|
|
1131
1131
|
return e.length === 0 ? !1 : e[0].style.display !== "none";
|
|
1132
1132
|
});
|
|
1133
1133
|
if (g.length === 0) {
|
|
1134
|
-
|
|
1134
|
+
a(!0);
|
|
1135
1135
|
return;
|
|
1136
1136
|
}
|
|
1137
|
-
if (
|
|
1138
|
-
let
|
|
1137
|
+
if (A) {
|
|
1138
|
+
let i = !1;
|
|
1139
1139
|
for (const e of g)
|
|
1140
1140
|
if (e.type === "upload" && e.key) {
|
|
1141
|
-
if (
|
|
1142
|
-
|
|
1141
|
+
if (l[e.key] !== null && l[e.key] !== void 0) {
|
|
1142
|
+
i = !0;
|
|
1143
1143
|
break;
|
|
1144
1144
|
}
|
|
1145
1145
|
} else if (e.type === "variable" && e.key)
|
|
@@ -1148,13 +1148,13 @@ function Ce(t, p, o, r) {
|
|
|
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(x))
|
|
1152
|
+
if (q.innerText.replace(/[\u200B\n]/g, "").trim().length > 0) {
|
|
1153
1153
|
u = !0;
|
|
1154
1154
|
break;
|
|
1155
1155
|
}
|
|
1156
1156
|
if (u) {
|
|
1157
|
-
|
|
1157
|
+
i = !0;
|
|
1158
1158
|
break;
|
|
1159
1159
|
}
|
|
1160
1160
|
} else {
|
|
@@ -1162,17 +1162,17 @@ function Ce(t, p, o, r) {
|
|
|
1162
1162
|
`[data-type="variable"][data-key="${e.key}"]`
|
|
1163
1163
|
);
|
|
1164
1164
|
if (x && x.innerText.replace(/[\u200B\n]/g, "").trim().length > 0) {
|
|
1165
|
-
|
|
1165
|
+
i = !0;
|
|
1166
1166
|
break;
|
|
1167
1167
|
}
|
|
1168
1168
|
}
|
|
1169
|
-
|
|
1169
|
+
a(i);
|
|
1170
1170
|
} else {
|
|
1171
|
-
let
|
|
1171
|
+
let i = !0;
|
|
1172
1172
|
for (const e of g)
|
|
1173
1173
|
if (e.type === "upload" && e.key) {
|
|
1174
|
-
if (
|
|
1175
|
-
|
|
1174
|
+
if (l[e.key] === null || l[e.key] === void 0) {
|
|
1175
|
+
i = !1;
|
|
1176
1176
|
break;
|
|
1177
1177
|
}
|
|
1178
1178
|
} else if (e.type === "variable" && e.key)
|
|
@@ -1181,13 +1181,13 @@ function Ce(t, p, o, r) {
|
|
|
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(x))
|
|
1185
|
+
if (q.innerText.replace(/[\u200B\n]/g, "").trim().length > 0) {
|
|
1186
1186
|
u = !0;
|
|
1187
1187
|
break;
|
|
1188
1188
|
}
|
|
1189
1189
|
if (!u) {
|
|
1190
|
-
|
|
1190
|
+
i = !1;
|
|
1191
1191
|
break;
|
|
1192
1192
|
}
|
|
1193
1193
|
} else {
|
|
@@ -1195,72 +1195,72 @@ function Ce(t, p, o, r) {
|
|
|
1195
1195
|
`[data-type="variable"][data-key="${e.key}"]`
|
|
1196
1196
|
);
|
|
1197
1197
|
if (!x) {
|
|
1198
|
-
|
|
1198
|
+
i = !1;
|
|
1199
1199
|
break;
|
|
1200
1200
|
}
|
|
1201
1201
|
if (x.innerText.replace(/[\u200B\n]/g, "").trim().length === 0) {
|
|
1202
|
-
|
|
1202
|
+
i = !1;
|
|
1203
1203
|
break;
|
|
1204
1204
|
}
|
|
1205
1205
|
}
|
|
1206
|
-
|
|
1206
|
+
a(i);
|
|
1207
1207
|
}
|
|
1208
1208
|
}
|
|
1209
|
-
function
|
|
1209
|
+
function $e(t, p) {
|
|
1210
1210
|
if (!t.current) return;
|
|
1211
|
-
t.current.querySelectorAll('[data-type="variable"]').forEach((
|
|
1212
|
-
const
|
|
1213
|
-
|
|
1211
|
+
t.current.querySelectorAll('[data-type="variable"]').forEach((a) => {
|
|
1212
|
+
const r = a.innerText.replace(/\n/g, "");
|
|
1213
|
+
r.replace(/\u200B/g, "") ? a.classList.remove("show-placeholder") : (r !== "" && (a.innerText = ""), a.classList.add("show-placeholder"));
|
|
1214
1214
|
});
|
|
1215
1215
|
}
|
|
1216
|
-
function
|
|
1216
|
+
function St(t, p, l, a, r, m = {}, A) {
|
|
1217
1217
|
if (!t.current) return;
|
|
1218
|
-
let g = "",
|
|
1219
|
-
for (;
|
|
1220
|
-
const e = p[
|
|
1218
|
+
let g = "", i = 0;
|
|
1219
|
+
for (; i < p.length; ) {
|
|
1220
|
+
const e = p[i], x = i + 1 < p.length ? p[i + 1] : null;
|
|
1221
1221
|
if (e.type === "text" && (e.text?.includes("icon-bitian") || e.className === "rte-text-required") && x) {
|
|
1222
|
-
const c = x.type === "upload" && x.exclusionGroup === "fileInput" && e.exclusionGroup === "fileInput" && e.exclusionGroup === x.exclusionGroup,
|
|
1222
|
+
const c = x.type === "upload" && x.exclusionGroup === "fileInput" && e.exclusionGroup === "fileInput" && e.exclusionGroup === x.exclusionGroup, w = x.type === "variable" && x.exclusionGroup === "textInput" && e.exclusionGroup === "textInput" && e.exclusionGroup === x.exclusionGroup;
|
|
1223
1223
|
if (c) {
|
|
1224
|
-
const
|
|
1225
|
-
let
|
|
1226
|
-
e.className ?
|
|
1227
|
-
const
|
|
1228
|
-
g +=
|
|
1224
|
+
const $ = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group">`, b = "</span>";
|
|
1225
|
+
let V = "";
|
|
1226
|
+
e.className ? V = `<span class="${e.className}">${e.text ?? ""}</span>` : V = e.text ?? "";
|
|
1227
|
+
const _ = x, P = l[_.key] !== null && l[_.key] !== void 0, D = P ? l[_.key]?.name : _.text, B = P ? "" : "hidden", U = _.tooltip && !P ? "" : "hidden", H = P ? "has-file" : "", X = P && D ? ` data-file-name="${D.replace(/"/g, """)}"` : "", Z = `<span contenteditable="false" data-type="upload" data-key="${_.key}" class="upload-chip"><span class="upload-inner-wrapper ${H}"><span class="upload-icon">${P ? "<i class='iconfont icon-exlwenjian'></i>" : "<i class='iconfont icon-shangchuan1'></i>"}</span><span class="upload-label"${X}>${D || _.text}</span>${_.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi upload-info-icon ${U}" data-upload-key="${_.key}" data-tooltip="${_.tooltip}" title="提示"></i>` : ""}<span class="file-remove-btn ${B}" title="移除文件">×</span></span></span>`;
|
|
1228
|
+
g += $ + V + Z + b, i += 2;
|
|
1229
1229
|
continue;
|
|
1230
1230
|
}
|
|
1231
|
-
if (
|
|
1232
|
-
const
|
|
1233
|
-
let
|
|
1234
|
-
e.className ?
|
|
1235
|
-
const
|
|
1236
|
-
g +=
|
|
1231
|
+
if (w) {
|
|
1232
|
+
const $ = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group">`, b = "</span>";
|
|
1233
|
+
let V = "";
|
|
1234
|
+
e.className ? V = `<span class="${e.className}">${e.text ?? ""}</span>` : V = e.text ?? "";
|
|
1235
|
+
const _ = x, D = (_.key ? r[_.key] : void 0) || _.text || "", B = !D, U = B ? "" : D, H = B ? "show-placeholder" : "", X = _.exclusionGroup ? ` data-group="${_.exclusionGroup}"` : "", Z = _.tooltip ? ` data-tooltip="${_.tooltip.replace(/"/g, """)}" data-variable-key="${_.key || ""}"` : "", T = _.tooltip && B ? "" : "hidden", I = `<span contenteditable="true" data-type="variable" data-key="${_.key}" data-placeholder="${_.placeholder || ""}"${X}${Z} class="variable-chip ${H}">${U}${_.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${T}" data-variable-key="${_.key}" data-tooltip="${_.tooltip.replace(/"/g, """)}" title="提示"></i>` : ""}</span>`;
|
|
1236
|
+
g += $ + V + I + b, i += 2;
|
|
1237
1237
|
continue;
|
|
1238
1238
|
}
|
|
1239
1239
|
}
|
|
1240
|
-
const
|
|
1241
|
-
let
|
|
1240
|
+
const q = e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : "", d = e.exclusionGroup ? `<span ${q} class="exclusion-wrapper">` : "", o = e.exclusionGroup ? "</span>" : "";
|
|
1241
|
+
let C = "";
|
|
1242
1242
|
if (e.type === "tag") {
|
|
1243
|
-
const
|
|
1244
|
-
|
|
1243
|
+
const w = a || A === "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>', k = a ? ' data-locked="true"' : "", $ = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, """)}" data-tag-key="${e.key || ""}"` : "";
|
|
1244
|
+
C = `<span contenteditable="false" class="tag-node group"${k}${$}><span class="tag-label">${e.text}</span>${w}</span>`;
|
|
1245
1245
|
} else if (e.type === "text") {
|
|
1246
|
-
const c =
|
|
1247
|
-
e.className ?
|
|
1246
|
+
const c = a ? ' data-locked="true" contenteditable="false"' : ' contenteditable="false"';
|
|
1247
|
+
e.className ? C = `<span class="${e.className}"${c}>${e.text ?? ""}</span>` : C = a ? `<span${c}>${e.text ?? ""}</span>` : `<span contenteditable="false">${e.text ?? ""}</span>`;
|
|
1248
1248
|
} else if (e.type === "variable" && e.key) {
|
|
1249
|
-
const
|
|
1250
|
-
e.required ?
|
|
1249
|
+
const w = r[e.key] || e.text || "", k = !w, $ = k ? "" : w, b = k ? "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 && k ? "" : "hidden", D = `<span contenteditable="true" data-type="variable" data-key="${e.key}" data-placeholder="${e.placeholder || ""}"${V}${_} class="variable-chip ${b}">${$}${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
|
+
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 c =
|
|
1253
|
-
e.required ?
|
|
1252
|
+
const c = l[e.key] !== null && l[e.key] !== void 0, w = c ? l[e.key]?.name : e.text, k = c ? "" : "hidden", $ = e.tooltip && !c ? "" : "hidden", b = c ? "has-file" : "", V = c && w ? ` data-file-name="${w.replace(/"/g, """)}"` : "", _ = `<span contenteditable="false" data-type="upload" data-key="${e.key}" class="upload-chip"><span class="upload-inner-wrapper ${b}"><span class="upload-icon">${c ? "<i class='iconfont icon-exlwenjian'></i>" : "<i class='iconfont icon-shangchuan1'></i>"}</span><span class="upload-label"${V}>${w || e.text}</span>${e.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi upload-info-icon ${$}" data-upload-key="${e.key}" data-tooltip="${e.tooltip}" title="提示"></i>` : ""}<span class="file-remove-btn ${k}" title="移除文件">×</span></span></span>`;
|
|
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
|
-
const c = e.maxCount || 9,
|
|
1256
|
-
let
|
|
1257
|
-
for (let
|
|
1258
|
-
const
|
|
1259
|
-
|
|
1255
|
+
const c = e.maxCount || 9, w = m[e.key] || 1, k = Math.min(w, c);
|
|
1256
|
+
let $ = "";
|
|
1257
|
+
for (let b = 0; b < k; b++) {
|
|
1258
|
+
const V = `${e.key}_${b}`, _ = r[V] || "", P = !_, D = P ? "" : _, B = P ? "show-placeholder" : "", U = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, """)}" data-variable-key="${e.key || ""}"` : "", H = e.tooltip && P ? "" : "hidden", X = `<span contenteditable="true" data-type="variable" data-key="${V}" data-multi-key="${e.key}" data-index="${b}" data-placeholder="${e.placeholder || ""}"${U} class="variable-chip ${B}">${D}${e.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${H}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g, """)}" title="提示"></i>` : ""}</span>`;
|
|
1259
|
+
$ += X;
|
|
1260
1260
|
}
|
|
1261
|
-
e.required ?
|
|
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>${$}</span>` : C = $;
|
|
1262
1262
|
}
|
|
1263
|
-
g += d +
|
|
1263
|
+
g += d + C + o, i++;
|
|
1264
1264
|
}
|
|
1265
1265
|
t.current && (t.current.innerHTML = g, setTimeout(() => {
|
|
1266
1266
|
if (!t.current) return;
|
|
@@ -1270,8 +1270,8 @@ function vt(t, p, o, r, a, m = {}, C) {
|
|
|
1270
1270
|
});
|
|
1271
1271
|
}, 0));
|
|
1272
1272
|
}
|
|
1273
|
-
function
|
|
1274
|
-
const
|
|
1273
|
+
function qt(t, p, l, a, r = {}, m, A, g) {
|
|
1274
|
+
const i = W(() => {
|
|
1275
1275
|
if (!t.current) return;
|
|
1276
1276
|
if (p.length === 0) {
|
|
1277
1277
|
t.current.innerHTML = "";
|
|
@@ -1281,309 +1281,309 @@ function wt(t, p, o, r, a = {}, m, C, 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
1289
|
).forEach((d) => {
|
|
1290
|
-
const
|
|
1291
|
-
if (
|
|
1292
|
-
const
|
|
1293
|
-
|
|
1290
|
+
const o = d.dataset.key;
|
|
1291
|
+
if (o) {
|
|
1292
|
+
const C = d.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
1293
|
+
C && (e[o] = C);
|
|
1294
1294
|
}
|
|
1295
|
-
}),
|
|
1296
|
-
const { key:
|
|
1295
|
+
}), St(t, p, l, a, e, r, g), m?.current) {
|
|
1296
|
+
const { key: q, offset: d } = m.current;
|
|
1297
1297
|
setTimeout(() => {
|
|
1298
1298
|
if (!t.current) return;
|
|
1299
|
-
const
|
|
1300
|
-
`[data-type="variable"][data-key="${
|
|
1299
|
+
const o = t.current.querySelector(
|
|
1300
|
+
`[data-type="variable"][data-key="${q}"]`
|
|
1301
1301
|
);
|
|
1302
|
-
if (
|
|
1302
|
+
if (o) {
|
|
1303
1303
|
try {
|
|
1304
|
-
const
|
|
1305
|
-
|
|
1304
|
+
const C = document.createRange(), c = document.createTreeWalker(
|
|
1305
|
+
o,
|
|
1306
1306
|
NodeFilter.SHOW_TEXT,
|
|
1307
1307
|
null
|
|
1308
1308
|
);
|
|
1309
|
-
let
|
|
1309
|
+
let w = 0, k = null, $ = 0;
|
|
1310
1310
|
for (; c.nextNode(); ) {
|
|
1311
|
-
const
|
|
1312
|
-
if (
|
|
1313
|
-
|
|
1311
|
+
const b = c.currentNode, V = b.textContent?.length || 0;
|
|
1312
|
+
if (w + V >= d) {
|
|
1313
|
+
k = b, $ = d - w;
|
|
1314
1314
|
break;
|
|
1315
1315
|
}
|
|
1316
|
-
|
|
1316
|
+
w += V;
|
|
1317
1317
|
}
|
|
1318
|
-
if (
|
|
1319
|
-
|
|
1320
|
-
const
|
|
1321
|
-
|
|
1318
|
+
if (k) {
|
|
1319
|
+
C.setStart(k, Math.min($, k.textContent?.length || 0)), C.collapse(!0);
|
|
1320
|
+
const b = window.getSelection();
|
|
1321
|
+
b && (b.removeAllRanges(), b.addRange(C), o.focus());
|
|
1322
1322
|
} else {
|
|
1323
|
-
|
|
1324
|
-
const
|
|
1325
|
-
|
|
1323
|
+
C.selectNodeContents(o), C.collapse(!1);
|
|
1324
|
+
const b = window.getSelection();
|
|
1325
|
+
b && (b.removeAllRanges(), b.addRange(C), o.focus());
|
|
1326
1326
|
}
|
|
1327
1327
|
} catch {
|
|
1328
|
-
const
|
|
1329
|
-
|
|
1328
|
+
const C = document.createRange();
|
|
1329
|
+
C.selectNodeContents(o), C.collapse(!1);
|
|
1330
1330
|
const c = window.getSelection();
|
|
1331
|
-
c && (c.removeAllRanges(), c.addRange(
|
|
1331
|
+
c && (c.removeAllRanges(), c.addRange(C), o.focus());
|
|
1332
1332
|
}
|
|
1333
1333
|
m.current = null;
|
|
1334
1334
|
}
|
|
1335
1335
|
}, 0);
|
|
1336
1336
|
}
|
|
1337
|
-
}, [p,
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
}, [
|
|
1337
|
+
}, [p, l, a, t, r, m, A, g]);
|
|
1338
|
+
oe(() => {
|
|
1339
|
+
i();
|
|
1340
|
+
}, [i]);
|
|
1341
1341
|
}
|
|
1342
|
-
function
|
|
1343
|
-
|
|
1344
|
-
const
|
|
1345
|
-
if (!
|
|
1342
|
+
function At(t, p, l, a) {
|
|
1343
|
+
oe(() => {
|
|
1344
|
+
const r = t.current;
|
|
1345
|
+
if (!r) return;
|
|
1346
1346
|
const m = (g) => {
|
|
1347
|
-
const
|
|
1348
|
-
if (
|
|
1349
|
-
const e =
|
|
1350
|
-
e &&
|
|
1347
|
+
const i = g.target?.closest(".upload-info-icon");
|
|
1348
|
+
if (i && i.classList.contains("upload-info-icon")) {
|
|
1349
|
+
const e = i.dataset.uploadKey;
|
|
1350
|
+
e && a({ key: e, anchorEl: i, type: "upload" });
|
|
1351
1351
|
}
|
|
1352
|
-
},
|
|
1353
|
-
const
|
|
1354
|
-
|
|
1352
|
+
}, A = (g) => {
|
|
1353
|
+
const i = g.target?.closest(".upload-info-icon"), e = g.relatedTarget;
|
|
1354
|
+
i && i.classList.contains("upload-info-icon") && (!e || !r.contains(e) ? a(null) : e.closest(".upload-info-icon") || a(null));
|
|
1355
1355
|
};
|
|
1356
|
-
return
|
|
1357
|
-
|
|
1356
|
+
return r.addEventListener("mouseover", m, !0), r.addEventListener("mouseout", A, !0), () => {
|
|
1357
|
+
r.removeEventListener("mouseover", m, !0), r.removeEventListener("mouseout", A, !0);
|
|
1358
1358
|
};
|
|
1359
|
-
}, [p,
|
|
1359
|
+
}, [p, l, t, a]);
|
|
1360
1360
|
}
|
|
1361
|
-
function
|
|
1362
|
-
|
|
1361
|
+
function $t(t, p, l, a) {
|
|
1362
|
+
oe(() => {
|
|
1363
1363
|
if (!t.current) return;
|
|
1364
|
-
const
|
|
1365
|
-
if (
|
|
1364
|
+
const r = (i) => {
|
|
1365
|
+
if (a === "hideTagClose")
|
|
1366
1366
|
return;
|
|
1367
|
-
const e =
|
|
1368
|
-
x &&
|
|
1367
|
+
const e = i.currentTarget, x = e.dataset.tooltip, u = e.dataset.tagKey || "";
|
|
1368
|
+
x && l({ key: u, anchorEl: e, type: "tag" });
|
|
1369
1369
|
}, m = () => {
|
|
1370
|
-
|
|
1370
|
+
l(null);
|
|
1371
1371
|
};
|
|
1372
|
-
let
|
|
1372
|
+
let A;
|
|
1373
1373
|
const g = () => {
|
|
1374
1374
|
if (!t.current) return;
|
|
1375
1375
|
t.current.querySelectorAll(
|
|
1376
1376
|
".tag-node[data-tooltip]"
|
|
1377
1377
|
).forEach((e) => {
|
|
1378
|
-
e.addEventListener("mouseenter",
|
|
1378
|
+
e.addEventListener("mouseenter", r), e.addEventListener("mouseleave", m);
|
|
1379
1379
|
});
|
|
1380
1380
|
};
|
|
1381
|
-
return
|
|
1382
|
-
|
|
1381
|
+
return A = requestAnimationFrame(() => {
|
|
1382
|
+
A = requestAnimationFrame(g);
|
|
1383
1383
|
}), () => {
|
|
1384
|
-
cancelAnimationFrame(
|
|
1384
|
+
cancelAnimationFrame(A), t.current && t.current.querySelectorAll(
|
|
1385
1385
|
".tag-node[data-tooltip]"
|
|
1386
1386
|
).forEach((e) => {
|
|
1387
|
-
e.removeEventListener("mouseenter",
|
|
1387
|
+
e.removeEventListener("mouseenter", r), e.removeEventListener("mouseleave", m);
|
|
1388
1388
|
});
|
|
1389
1389
|
};
|
|
1390
|
-
}, [p, t,
|
|
1390
|
+
}, [p, t, l, a]);
|
|
1391
1391
|
}
|
|
1392
|
-
function
|
|
1393
|
-
|
|
1394
|
-
const
|
|
1395
|
-
if (!
|
|
1396
|
-
const
|
|
1397
|
-
const g =
|
|
1392
|
+
function _t(t, p, l) {
|
|
1393
|
+
oe(() => {
|
|
1394
|
+
const a = t.current;
|
|
1395
|
+
if (!a) return;
|
|
1396
|
+
const r = (A) => {
|
|
1397
|
+
const g = A.target?.closest(".variable-info-icon");
|
|
1398
1398
|
if (g && g.classList.contains("variable-info-icon")) {
|
|
1399
|
-
const
|
|
1400
|
-
|
|
1399
|
+
const i = g.dataset.variableKey;
|
|
1400
|
+
i && l({ key: i, anchorEl: g, type: "variable" });
|
|
1401
1401
|
}
|
|
1402
|
-
}, m = (
|
|
1403
|
-
const g =
|
|
1404
|
-
g && g.classList.contains("variable-info-icon") && (!
|
|
1402
|
+
}, m = (A) => {
|
|
1403
|
+
const g = A.target?.closest(".variable-info-icon"), i = A.relatedTarget;
|
|
1404
|
+
g && g.classList.contains("variable-info-icon") && (!i || !a.contains(i) ? l(null) : i.closest(".variable-info-icon") || l(null));
|
|
1405
1405
|
};
|
|
1406
|
-
return
|
|
1407
|
-
|
|
1406
|
+
return a.addEventListener("mouseover", r, !0), a.addEventListener("mouseout", m, !0), () => {
|
|
1407
|
+
a.removeEventListener("mouseover", r, !0), a.removeEventListener("mouseout", m, !0);
|
|
1408
1408
|
};
|
|
1409
|
-
}, [p, t,
|
|
1409
|
+
}, [p, t, l]);
|
|
1410
1410
|
}
|
|
1411
|
-
function
|
|
1412
|
-
|
|
1411
|
+
function jt(t, p, l, a) {
|
|
1412
|
+
oe(() => {
|
|
1413
1413
|
if (!t.current) return;
|
|
1414
|
-
const
|
|
1415
|
-
const e =
|
|
1416
|
-
e.dataset.fileName &&
|
|
1414
|
+
const r = (i) => {
|
|
1415
|
+
const e = i.currentTarget;
|
|
1416
|
+
e.dataset.fileName && a({ key: "", anchorEl: e, type: "upload-label" });
|
|
1417
1417
|
}, m = () => {
|
|
1418
|
-
|
|
1418
|
+
a(null);
|
|
1419
1419
|
};
|
|
1420
|
-
let
|
|
1420
|
+
let A;
|
|
1421
1421
|
const g = () => {
|
|
1422
1422
|
if (!t.current) return;
|
|
1423
1423
|
t.current.querySelectorAll(
|
|
1424
1424
|
".upload-label[data-file-name]"
|
|
1425
1425
|
).forEach((e) => {
|
|
1426
|
-
e.addEventListener("mouseenter",
|
|
1426
|
+
e.addEventListener("mouseenter", r), e.addEventListener("mouseleave", m);
|
|
1427
1427
|
});
|
|
1428
1428
|
};
|
|
1429
|
-
return
|
|
1430
|
-
|
|
1429
|
+
return A = requestAnimationFrame(() => {
|
|
1430
|
+
A = requestAnimationFrame(g);
|
|
1431
1431
|
}), () => {
|
|
1432
|
-
cancelAnimationFrame(
|
|
1432
|
+
cancelAnimationFrame(A), t.current && t.current.querySelectorAll(
|
|
1433
1433
|
".upload-label[data-file-name]"
|
|
1434
1434
|
).forEach((e) => {
|
|
1435
|
-
e.removeEventListener("mouseenter",
|
|
1435
|
+
e.removeEventListener("mouseenter", r), e.removeEventListener("mouseleave", m);
|
|
1436
1436
|
});
|
|
1437
1437
|
};
|
|
1438
|
-
}, [p,
|
|
1438
|
+
}, [p, l, t, a]);
|
|
1439
1439
|
}
|
|
1440
|
-
function
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
}, [
|
|
1440
|
+
function Rt(t, p, l, a) {
|
|
1441
|
+
oe(() => {
|
|
1442
|
+
_e(t, p, l), je(t, p, l, a);
|
|
1443
|
+
}, [l, p, t, a]);
|
|
1444
1444
|
}
|
|
1445
|
-
function
|
|
1446
|
-
|
|
1445
|
+
function It(t, p) {
|
|
1446
|
+
oe(() => {
|
|
1447
1447
|
if (!t.current) return;
|
|
1448
|
-
let
|
|
1449
|
-
const
|
|
1450
|
-
|
|
1448
|
+
let l = !1, a = 0;
|
|
1449
|
+
const r = () => {
|
|
1450
|
+
l = !0;
|
|
1451
1451
|
}, m = () => {
|
|
1452
|
-
|
|
1452
|
+
l = !1, a = Date.now();
|
|
1453
1453
|
};
|
|
1454
|
-
let
|
|
1455
|
-
const
|
|
1456
|
-
|
|
1454
|
+
let A = !1, g = 0;
|
|
1455
|
+
const i = () => {
|
|
1456
|
+
A = !0;
|
|
1457
1457
|
}, e = () => {
|
|
1458
|
-
|
|
1458
|
+
A = !1, g = Date.now();
|
|
1459
1459
|
}, x = () => {
|
|
1460
1460
|
g = Date.now();
|
|
1461
1461
|
}, u = () => {
|
|
1462
1462
|
if (!t.current) return;
|
|
1463
1463
|
const d = window.getSelection();
|
|
1464
|
-
if (!d || d.rangeCount === 0 || p.current ||
|
|
1464
|
+
if (!d || d.rangeCount === 0 || p.current || l || A || Date.now() - g < 500)
|
|
1465
1465
|
return;
|
|
1466
|
-
const
|
|
1467
|
-
if (!
|
|
1468
|
-
t.current.contains(
|
|
1466
|
+
const o = d.getRangeAt(0);
|
|
1467
|
+
if (!o.collapsed) {
|
|
1468
|
+
t.current.contains(o.commonAncestorContainer) || d.removeAllRanges();
|
|
1469
1469
|
return;
|
|
1470
1470
|
}
|
|
1471
|
-
const
|
|
1472
|
-
if (!
|
|
1473
|
-
if (!t.current.contains(
|
|
1471
|
+
const C = d.anchorNode;
|
|
1472
|
+
if (!C) return;
|
|
1473
|
+
if (!t.current.contains(C)) {
|
|
1474
1474
|
d.removeAllRanges();
|
|
1475
1475
|
return;
|
|
1476
1476
|
}
|
|
1477
1477
|
let c = null;
|
|
1478
|
-
if (
|
|
1479
|
-
if (Date.now() -
|
|
1478
|
+
if (C.nodeType === Node.ELEMENT_NODE ? c = C.closest('[data-type="variable"]') : C.nodeType === Node.TEXT_NODE && C.parentElement && (c = C.parentElement.closest('[data-type="variable"]')), !c) {
|
|
1479
|
+
if (Date.now() - a > 500)
|
|
1480
1480
|
return;
|
|
1481
|
-
const
|
|
1482
|
-
if (
|
|
1483
|
-
let
|
|
1484
|
-
for (const
|
|
1485
|
-
if (
|
|
1486
|
-
|
|
1481
|
+
const w = t.current.querySelectorAll('[data-type="variable"]');
|
|
1482
|
+
if (w.length > 0) {
|
|
1483
|
+
let k = null;
|
|
1484
|
+
for (const $ of Array.from(w))
|
|
1485
|
+
if ($.style.display !== "none") {
|
|
1486
|
+
k = $;
|
|
1487
1487
|
break;
|
|
1488
1488
|
}
|
|
1489
|
-
if (!
|
|
1490
|
-
const
|
|
1491
|
-
|
|
1489
|
+
if (!k && w.length > 0 && (k = w[0]), k) {
|
|
1490
|
+
const $ = document.createRange();
|
|
1491
|
+
$.selectNodeContents(k), $.collapse(!1), d.removeAllRanges(), d.addRange($), k.focus();
|
|
1492
1492
|
} else
|
|
1493
1493
|
d.removeAllRanges();
|
|
1494
1494
|
} else
|
|
1495
1495
|
d.removeAllRanges();
|
|
1496
1496
|
}
|
|
1497
|
-
},
|
|
1498
|
-
return
|
|
1497
|
+
}, q = t.current;
|
|
1498
|
+
return q && (q.addEventListener("compositionstart", i), q.addEventListener("compositionend", e), q.addEventListener("input", x)), document.addEventListener("mousedown", r), document.addEventListener("mouseup", m), document.addEventListener("selectionchange", u), () => {
|
|
1499
1499
|
const d = t.current;
|
|
1500
|
-
d && (d.removeEventListener("compositionstart",
|
|
1500
|
+
d && (d.removeEventListener("compositionstart", i), d.removeEventListener("compositionend", e), d.removeEventListener("input", x)), document.removeEventListener("mousedown", r), document.removeEventListener("mouseup", m), document.removeEventListener("selectionchange", u);
|
|
1501
1501
|
};
|
|
1502
1502
|
}, [t, p]);
|
|
1503
1503
|
}
|
|
1504
|
-
const
|
|
1504
|
+
const Vt = ({
|
|
1505
1505
|
config: t,
|
|
1506
1506
|
onSend: p,
|
|
1507
|
-
isProcessing:
|
|
1508
|
-
disabled:
|
|
1509
|
-
width:
|
|
1507
|
+
isProcessing: l = !1,
|
|
1508
|
+
disabled: a = !1,
|
|
1509
|
+
width: r,
|
|
1510
1510
|
lockStructure: m = !1,
|
|
1511
|
-
agentOptions:
|
|
1511
|
+
agentOptions: A = [],
|
|
1512
1512
|
onAgentSelect: g,
|
|
1513
|
-
onAgentExit:
|
|
1513
|
+
onAgentExit: i,
|
|
1514
1514
|
loading: e = !1,
|
|
1515
1515
|
placeholder: x,
|
|
1516
1516
|
border: u,
|
|
1517
|
-
background:
|
|
1517
|
+
background: q = "transparent",
|
|
1518
1518
|
hideButtons: d
|
|
1519
1519
|
}) => {
|
|
1520
|
-
const
|
|
1520
|
+
const o = z(null), C = z(null), [c, w] = J({}), [k, $] = J(null), [b, V] = J(null), _ = z(!1), P = z(null), [D, B] = J(!1), U = z(null), [H, X] = J(!0), [Z, T] = J(() => {
|
|
1521
1521
|
const f = {};
|
|
1522
1522
|
return t.forEach((y) => {
|
|
1523
1523
|
y.type === "multi-variable" && y.key && (f[y.key] = 1);
|
|
1524
1524
|
}), f;
|
|
1525
|
-
}),
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
}, [c]),
|
|
1529
|
-
|
|
1525
|
+
}), I = z({}), Q = z({}), ee = z({});
|
|
1526
|
+
oe(() => {
|
|
1527
|
+
Q.current = c;
|
|
1528
|
+
}, [c]), oe(() => {
|
|
1529
|
+
ee.current = Z;
|
|
1530
1530
|
}, [Z]);
|
|
1531
|
-
const
|
|
1532
|
-
|
|
1533
|
-
const f =
|
|
1534
|
-
if (f && f !== y &&
|
|
1535
|
-
const
|
|
1536
|
-
|
|
1537
|
-
const
|
|
1538
|
-
if (
|
|
1539
|
-
const
|
|
1540
|
-
|
|
1531
|
+
const pe = W((f) => f.find((h) => h.type === "tag")?.text || null, []), he = z(t), s = z(null);
|
|
1532
|
+
oe(() => {
|
|
1533
|
+
const f = pe(he.current), y = pe(t);
|
|
1534
|
+
if (f && f !== y && o.current) {
|
|
1535
|
+
const h = {};
|
|
1536
|
+
o.current.querySelectorAll('[data-type="variable"]').forEach((v) => {
|
|
1537
|
+
const E = v.dataset.key;
|
|
1538
|
+
if (E) {
|
|
1539
|
+
const N = v.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
1540
|
+
N && (h[E] = N);
|
|
1541
1541
|
}
|
|
1542
|
-
}),
|
|
1543
|
-
variableValues:
|
|
1544
|
-
files: { ...
|
|
1545
|
-
multiVariableCounts: { ...
|
|
1542
|
+
}), I.current[f] = {
|
|
1543
|
+
variableValues: h,
|
|
1544
|
+
files: { ...Q.current },
|
|
1545
|
+
multiVariableCounts: { ...ee.current }
|
|
1546
1546
|
};
|
|
1547
1547
|
}
|
|
1548
|
-
if (y &&
|
|
1549
|
-
const
|
|
1550
|
-
s.current =
|
|
1548
|
+
if (y && I.current[y]) {
|
|
1549
|
+
const h = I.current[y];
|
|
1550
|
+
s.current = h, w(h.files), T(h.multiVariableCounts);
|
|
1551
1551
|
} else if (y) {
|
|
1552
1552
|
s.current = null;
|
|
1553
|
-
const
|
|
1554
|
-
t.forEach((
|
|
1555
|
-
|
|
1556
|
-
}),
|
|
1553
|
+
const h = {};
|
|
1554
|
+
t.forEach((S) => {
|
|
1555
|
+
S.type === "multi-variable" && S.key && (h[S.key] = 1);
|
|
1556
|
+
}), T(h), w({});
|
|
1557
1557
|
} else
|
|
1558
|
-
s.current = null,
|
|
1559
|
-
|
|
1560
|
-
}, [t,
|
|
1561
|
-
s.current &&
|
|
1558
|
+
s.current = null, T({}), w({});
|
|
1559
|
+
he.current = t;
|
|
1560
|
+
}, [t, pe]), Xe(() => {
|
|
1561
|
+
s.current && o.current && (o.current.__tempVariableValues = s.current.variableValues, setTimeout(() => {
|
|
1562
1562
|
s.current && (s.current = null);
|
|
1563
1563
|
}, 0));
|
|
1564
|
-
}),
|
|
1564
|
+
}), qt(o, t, c, m, Z, U, void 0, d), At(o, t, c, V), $t(o, t, V, d), jt(o, t, c, V), _t(o, t, V), Rt(o, t, c, B), It(o, _), oe(() => {
|
|
1565
1565
|
if (t.length > 0) {
|
|
1566
|
-
|
|
1566
|
+
X(!1);
|
|
1567
1567
|
return;
|
|
1568
1568
|
}
|
|
1569
1569
|
const f = () => {
|
|
1570
|
-
if (!
|
|
1571
|
-
|
|
1570
|
+
if (!o.current) {
|
|
1571
|
+
X(!0);
|
|
1572
1572
|
return;
|
|
1573
1573
|
}
|
|
1574
|
-
const
|
|
1575
|
-
let
|
|
1576
|
-
|
|
1577
|
-
(
|
|
1578
|
-
}),
|
|
1579
|
-
|
|
1574
|
+
const h = o.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "", S = o.current.querySelectorAll('[data-type="variable"]'), v = o.current.querySelectorAll('[data-type="upload"]');
|
|
1575
|
+
let E = !1;
|
|
1576
|
+
S.forEach((R) => {
|
|
1577
|
+
(R.textContent?.replace(/[\u200B\n]/g, "").trim() || "") && (E = !0);
|
|
1578
|
+
}), v.forEach((R) => {
|
|
1579
|
+
R.querySelector(".upload-inner-wrapper.has-file") && (E = !0);
|
|
1580
1580
|
});
|
|
1581
|
-
const
|
|
1582
|
-
|
|
1581
|
+
const N = !h && !E;
|
|
1582
|
+
X(N), t.length === 0 && B(!N);
|
|
1583
1583
|
};
|
|
1584
1584
|
f();
|
|
1585
1585
|
const y = new MutationObserver(f);
|
|
1586
|
-
return
|
|
1586
|
+
return o.current && y.observe(o.current, {
|
|
1587
1587
|
childList: !0,
|
|
1588
1588
|
subtree: !0,
|
|
1589
1589
|
characterData: !0
|
|
@@ -1591,85 +1591,116 @@ const qt = ({
|
|
|
1591
1591
|
y.disconnect();
|
|
1592
1592
|
};
|
|
1593
1593
|
}, [t]);
|
|
1594
|
-
const
|
|
1595
|
-
if (
|
|
1594
|
+
const L = (f) => {
|
|
1595
|
+
if (a) {
|
|
1596
1596
|
f.preventDefault();
|
|
1597
1597
|
return;
|
|
1598
1598
|
}
|
|
1599
1599
|
f.preventDefault();
|
|
1600
|
-
const y = f.clipboardData.getData("text/plain"),
|
|
1601
|
-
if (
|
|
1602
|
-
const
|
|
1603
|
-
if (
|
|
1604
|
-
let
|
|
1605
|
-
if (
|
|
1606
|
-
const
|
|
1607
|
-
if (
|
|
1608
|
-
const
|
|
1609
|
-
if (
|
|
1610
|
-
const
|
|
1611
|
-
|
|
1612
|
-
...
|
|
1613
|
-
[
|
|
1614
|
-
}))
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1600
|
+
const y = f.clipboardData.getData("text/plain"), h = window.getSelection();
|
|
1601
|
+
if (h && h.rangeCount > 0) {
|
|
1602
|
+
const S = h.anchorNode;
|
|
1603
|
+
if (S) {
|
|
1604
|
+
let v = null;
|
|
1605
|
+
if (S.nodeType === Node.ELEMENT_NODE ? v = S.closest('[data-type="variable"]') : S.nodeType === Node.TEXT_NODE && S.parentElement && (v = S.parentElement.closest('[data-type="variable"]')), v) {
|
|
1606
|
+
const E = v.dataset.multiKey;
|
|
1607
|
+
if (E) {
|
|
1608
|
+
const N = /[、,,\s\n\r\t]+/, R = y.split(N).map((j) => j.trim()).filter((j) => j.length > 0);
|
|
1609
|
+
if (console.log("[Paste Event] 粘贴的内容:", y), console.log("[Paste Event] 拆分后的值:", R), R.length > 1) {
|
|
1610
|
+
const j = parseInt(v.dataset.index || "0", 10), M = t.find((se) => se.type === "multi-variable" && se.key === E)?.maxCount || 9, ne = Z[E] || 1, re = Math.min(j + R.length, M);
|
|
1611
|
+
re > ne && T((Y) => ({
|
|
1612
|
+
...Y,
|
|
1613
|
+
[E]: re
|
|
1614
|
+
}));
|
|
1615
|
+
const ie = [];
|
|
1616
|
+
for (let Y = 0; Y < ne; Y++) {
|
|
1617
|
+
const se = `${E}_${Y}`, fe = o.current.querySelector(
|
|
1618
|
+
`[data-type="variable"][data-key="${se}"][data-multi-key="${E}"]`
|
|
1619
|
+
);
|
|
1620
|
+
if (fe) {
|
|
1621
|
+
const me = fe.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
1622
|
+
ie.push(me);
|
|
1623
|
+
}
|
|
1624
|
+
}
|
|
1625
|
+
ie.splice(j, 1, ...R.slice(0, M - j));
|
|
1626
|
+
const le = ie.slice(0, M);
|
|
1627
|
+
le.length > 0 && le[le.length - 1] !== "" && le.length < M && le.push("");
|
|
1628
|
+
const F = Math.max(le.length, 1), te = {};
|
|
1629
|
+
le.forEach((Y, se) => {
|
|
1630
|
+
Y && (te[`${E}_${se}`] = Y);
|
|
1631
|
+
}), o.current.querySelectorAll(
|
|
1632
|
+
'[data-type="variable"]'
|
|
1633
|
+
).forEach((Y) => {
|
|
1634
|
+
const se = Y.dataset.key, fe = Y.dataset.multiKey;
|
|
1635
|
+
if (se && fe !== E) {
|
|
1636
|
+
const me = Y.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
1637
|
+
me && (te[se] = me);
|
|
1638
|
+
}
|
|
1639
|
+
}), o.current.__tempVariableValues = te, T((Y) => ({
|
|
1640
|
+
...Y,
|
|
1641
|
+
[E]: F
|
|
1642
|
+
})), console.log("[Paste Event] 粘贴完成,已填充到多个输入框,值:", le);
|
|
1624
1643
|
return;
|
|
1625
|
-
}
|
|
1644
|
+
} else R.length === 1 && console.log("[Paste Event] 粘贴单个值,将在失去焦点时检查是否需要拆分");
|
|
1626
1645
|
}
|
|
1627
1646
|
}
|
|
1628
1647
|
}
|
|
1629
1648
|
}
|
|
1630
|
-
document.execCommand("insertText", !1, y),
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1649
|
+
document.execCommand("insertText", !1, y), ue(), setTimeout(() => {
|
|
1650
|
+
const S = window.getSelection();
|
|
1651
|
+
if (S && S.rangeCount > 0) {
|
|
1652
|
+
const v = S.anchorNode;
|
|
1653
|
+
if (v) {
|
|
1654
|
+
let E = null;
|
|
1655
|
+
if (v.nodeType === Node.ELEMENT_NODE ? E = v.closest('[data-type="variable"][data-multi-key]') : v.nodeType === Node.TEXT_NODE && v.parentElement && (E = v.parentElement.closest('[data-type="variable"][data-multi-key]')), E) {
|
|
1656
|
+
const N = E.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
1657
|
+
/[、,,\s]+/.test(N) && (console.log("[Paste Event] 粘贴后检测到分隔符,内容:", N), console.log("[Paste Event] 提示:失去焦点后将自动拆分"));
|
|
1658
|
+
}
|
|
1659
|
+
}
|
|
1660
|
+
}
|
|
1661
|
+
}, 0);
|
|
1662
|
+
}, K = (f) => {
|
|
1663
|
+
if (f.target.files && f.target.files[0] && k) {
|
|
1664
|
+
const y = f.target.files[0], h = k;
|
|
1665
|
+
w((S) => ({ ...S, [h]: y }));
|
|
1666
|
+
}
|
|
1667
|
+
f.target && (f.target.value = ""), $(null);
|
|
1668
|
+
}, ae = (f) => {
|
|
1669
|
+
w((y) => {
|
|
1670
|
+
const h = { ...y };
|
|
1671
|
+
return delete h[f], h;
|
|
1641
1672
|
});
|
|
1642
|
-
},
|
|
1673
|
+
}, ye = (f) => {
|
|
1643
1674
|
const y = f.target;
|
|
1644
1675
|
if (y.closest(".tag-close-btn")) {
|
|
1645
1676
|
if (f.preventDefault(), f.stopPropagation(), m)
|
|
1646
1677
|
return;
|
|
1647
|
-
|
|
1678
|
+
V(null), i ? i() : o.current && (o.current.innerHTML = "", o.current.focus());
|
|
1648
1679
|
return;
|
|
1649
1680
|
}
|
|
1650
1681
|
if (m) {
|
|
1651
|
-
const
|
|
1652
|
-
if (
|
|
1682
|
+
const v = y.closest(".tag-node"), E = y.closest('[data-type="text"]');
|
|
1683
|
+
if (v || E) {
|
|
1653
1684
|
f.preventDefault(), f.stopPropagation();
|
|
1654
|
-
const
|
|
1655
|
-
|
|
1685
|
+
const N = window.getSelection();
|
|
1686
|
+
N && N.removeAllRanges();
|
|
1656
1687
|
return;
|
|
1657
1688
|
}
|
|
1658
1689
|
}
|
|
1659
|
-
y.closest('[data-type="variable"]') || (
|
|
1660
|
-
},
|
|
1661
|
-
if (!f.target.closest('[data-type="variable"]') &&
|
|
1662
|
-
const
|
|
1663
|
-
(
|
|
1690
|
+
y.closest('[data-type="variable"]') || (P.current = { x: f.clientX, y: f.clientY }, _.current = !1, y.closest(".file-remove-btn") && (f.preventDefault(), f.stopPropagation()));
|
|
1691
|
+
}, ce = (f) => {
|
|
1692
|
+
if (!f.target.closest('[data-type="variable"]') && P.current) {
|
|
1693
|
+
const S = Math.abs(f.clientX - P.current.x), v = Math.abs(f.clientY - P.current.y);
|
|
1694
|
+
(S > 3 || v > 3) && (_.current = !0);
|
|
1664
1695
|
}
|
|
1665
|
-
},
|
|
1696
|
+
}, be = (f) => {
|
|
1666
1697
|
if (f.target.closest('[data-type="variable"]')) {
|
|
1667
|
-
|
|
1698
|
+
P.current = null, _.current = !1;
|
|
1668
1699
|
return;
|
|
1669
1700
|
}
|
|
1670
|
-
|
|
1701
|
+
P.current = null, _.current = !1;
|
|
1671
1702
|
}, O = (f) => {
|
|
1672
|
-
if (
|
|
1703
|
+
if (a)
|
|
1673
1704
|
return;
|
|
1674
1705
|
const y = f.target;
|
|
1675
1706
|
if (y.closest(".tag-close-btn")) {
|
|
@@ -1680,345 +1711,421 @@ const qt = ({
|
|
|
1680
1711
|
return;
|
|
1681
1712
|
if (y.closest('[data-type="text"]')) {
|
|
1682
1713
|
f.preventDefault(), f.stopPropagation();
|
|
1683
|
-
const
|
|
1684
|
-
|
|
1714
|
+
const R = window.getSelection();
|
|
1715
|
+
R && R.removeAllRanges();
|
|
1685
1716
|
return;
|
|
1686
1717
|
}
|
|
1687
1718
|
if (m && y.closest(".tag-node")) {
|
|
1688
1719
|
f.preventDefault(), f.stopPropagation();
|
|
1689
|
-
const
|
|
1690
|
-
|
|
1720
|
+
const j = window.getSelection();
|
|
1721
|
+
j && j.removeAllRanges();
|
|
1691
1722
|
return;
|
|
1692
1723
|
}
|
|
1693
1724
|
if (y.closest('[data-type="variable"]')) {
|
|
1694
|
-
if (
|
|
1725
|
+
if (_.current)
|
|
1695
1726
|
return;
|
|
1696
1727
|
setTimeout(() => {
|
|
1697
|
-
const
|
|
1698
|
-
|
|
1728
|
+
const R = window.getSelection();
|
|
1729
|
+
R && !R.isCollapsed || $e(o);
|
|
1699
1730
|
}, 10);
|
|
1700
1731
|
return;
|
|
1701
1732
|
}
|
|
1702
|
-
const
|
|
1703
|
-
if (
|
|
1733
|
+
const E = y.closest(".file-remove-btn");
|
|
1734
|
+
if (E) {
|
|
1704
1735
|
f.preventDefault(), f.stopPropagation();
|
|
1705
|
-
const
|
|
1706
|
-
|
|
1736
|
+
const j = E.closest('[data-type="upload"]')?.dataset.key;
|
|
1737
|
+
j && ae(j);
|
|
1707
1738
|
return;
|
|
1708
1739
|
}
|
|
1709
|
-
const
|
|
1710
|
-
if (
|
|
1711
|
-
const
|
|
1712
|
-
|
|
1740
|
+
const N = y.closest('[data-type="upload"]');
|
|
1741
|
+
if (N) {
|
|
1742
|
+
const R = N.dataset.key;
|
|
1743
|
+
R && ($(R), C.current?.click());
|
|
1713
1744
|
return;
|
|
1714
1745
|
}
|
|
1715
|
-
},
|
|
1716
|
-
const
|
|
1717
|
-
if (
|
|
1718
|
-
const
|
|
1719
|
-
if (
|
|
1720
|
-
const
|
|
1721
|
-
if (
|
|
1722
|
-
let
|
|
1723
|
-
|
|
1724
|
-
const
|
|
1725
|
-
|
|
1746
|
+
}, G = (f) => {
|
|
1747
|
+
const h = f.target.closest('[data-type="variable"]');
|
|
1748
|
+
if (h) {
|
|
1749
|
+
const S = window.getSelection();
|
|
1750
|
+
if (S) {
|
|
1751
|
+
const v = document.createRange(), E = h.textContent || "";
|
|
1752
|
+
if (E.replace(/\u200B/g, "")) {
|
|
1753
|
+
let R = 0, j = E.length;
|
|
1754
|
+
E.startsWith("") && (R = 1), E.endsWith("") && E.length > 1 && (j = E.length - 1);
|
|
1755
|
+
const M = h.firstChild;
|
|
1756
|
+
M && M.nodeType === Node.TEXT_NODE ? (v.setStart(M, R), v.setEnd(M, j)) : v.selectNodeContents(h);
|
|
1726
1757
|
} else
|
|
1727
|
-
|
|
1728
|
-
|
|
1758
|
+
v.selectNodeContents(h), v.collapse(!0);
|
|
1759
|
+
S.removeAllRanges(), S.addRange(v);
|
|
1729
1760
|
}
|
|
1730
1761
|
}
|
|
1731
|
-
},
|
|
1762
|
+
}, ue = () => {
|
|
1732
1763
|
if (t.length === 0) {
|
|
1733
|
-
if (
|
|
1734
|
-
const
|
|
1735
|
-
|
|
1764
|
+
if (o.current) {
|
|
1765
|
+
const h = !(o.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "");
|
|
1766
|
+
X(h), B(!h);
|
|
1736
1767
|
}
|
|
1737
1768
|
return;
|
|
1738
1769
|
}
|
|
1739
|
-
if (
|
|
1740
|
-
const
|
|
1741
|
-
if (
|
|
1742
|
-
let
|
|
1743
|
-
const
|
|
1744
|
-
|
|
1770
|
+
if ($e(o), o.current && o.current.querySelectorAll('[data-type="variable"]').forEach((h) => {
|
|
1771
|
+
const S = h.querySelector(".variable-info-icon");
|
|
1772
|
+
if (S) {
|
|
1773
|
+
let v = !1;
|
|
1774
|
+
const E = document.createTreeWalker(
|
|
1775
|
+
h,
|
|
1745
1776
|
NodeFilter.SHOW_TEXT,
|
|
1746
1777
|
{
|
|
1747
|
-
acceptNode: (
|
|
1778
|
+
acceptNode: (N) => S.contains(N) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT
|
|
1748
1779
|
}
|
|
1749
1780
|
);
|
|
1750
|
-
for (;
|
|
1751
|
-
if (
|
|
1752
|
-
|
|
1781
|
+
for (; E.nextNode(); )
|
|
1782
|
+
if (E.currentNode.textContent?.replace(/[\u200B\n]/g, "").trim()) {
|
|
1783
|
+
v = !0;
|
|
1753
1784
|
break;
|
|
1754
1785
|
}
|
|
1755
|
-
|
|
1786
|
+
v ? S.classList.add("hidden") : S.classList.remove("hidden");
|
|
1756
1787
|
}
|
|
1757
|
-
}),
|
|
1788
|
+
}), _e(o, t, c), je(o, t, c, B), !o.current) return;
|
|
1758
1789
|
t.filter((y) => y.type === "multi-variable" && y.key).forEach((y) => {
|
|
1759
1790
|
if (!y.key) return;
|
|
1760
|
-
const
|
|
1761
|
-
for (let
|
|
1762
|
-
const
|
|
1763
|
-
`[data-type="variable"][data-key="${
|
|
1791
|
+
const h = y.maxCount || 9, S = Z[y.key] || 1, v = [];
|
|
1792
|
+
for (let M = 0; M < S; M++) {
|
|
1793
|
+
const ne = `${y.key}_${M}`, re = o.current.querySelector(
|
|
1794
|
+
`[data-type="variable"][data-key="${ne}"][data-multi-key="${y.key}"]`
|
|
1764
1795
|
);
|
|
1765
|
-
if (
|
|
1766
|
-
const
|
|
1767
|
-
|
|
1796
|
+
if (re) {
|
|
1797
|
+
const ie = re.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
1798
|
+
v.push(ie);
|
|
1768
1799
|
}
|
|
1769
1800
|
}
|
|
1770
|
-
const
|
|
1771
|
-
let
|
|
1772
|
-
for (let
|
|
1773
|
-
if (
|
|
1774
|
-
|
|
1801
|
+
const N = (v[v.length - 1] || "") === "";
|
|
1802
|
+
let R = !1, j = -1;
|
|
1803
|
+
for (let M = 0; M < v.length - 1; M++)
|
|
1804
|
+
if (v[M] === "") {
|
|
1805
|
+
R = !0, j = M;
|
|
1775
1806
|
break;
|
|
1776
1807
|
}
|
|
1777
|
-
if (
|
|
1778
|
-
const
|
|
1779
|
-
if (
|
|
1780
|
-
const
|
|
1781
|
-
if (
|
|
1782
|
-
const
|
|
1783
|
-
if (
|
|
1784
|
-
const
|
|
1785
|
-
|
|
1786
|
-
const
|
|
1787
|
-
|
|
1808
|
+
if (R && j >= 0) {
|
|
1809
|
+
const M = window.getSelection();
|
|
1810
|
+
if (M && M.rangeCount > 0) {
|
|
1811
|
+
const F = M.getRangeAt(0), te = F.startContainer, de = te.nodeType === Node.ELEMENT_NODE ? te.closest('[data-type="variable"][data-multi-key]') : te.parentElement?.closest('[data-type="variable"][data-multi-key]');
|
|
1812
|
+
if (de) {
|
|
1813
|
+
const Y = de.dataset.key;
|
|
1814
|
+
if (Y) {
|
|
1815
|
+
const se = document.createRange();
|
|
1816
|
+
se.setStartBefore(de), se.setEnd(F.startContainer, F.startOffset);
|
|
1817
|
+
const fe = se.toString().length;
|
|
1818
|
+
U.current = { key: Y, offset: fe };
|
|
1788
1819
|
}
|
|
1789
1820
|
}
|
|
1790
1821
|
}
|
|
1791
|
-
const
|
|
1792
|
-
for (let
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
const
|
|
1796
|
-
|
|
1797
|
-
|
|
1822
|
+
const ne = [...v];
|
|
1823
|
+
for (let F = j; F < ne.length - 1; F++)
|
|
1824
|
+
ne[F] = ne[F + 1];
|
|
1825
|
+
ne.pop();
|
|
1826
|
+
const re = {};
|
|
1827
|
+
ne.forEach((F, te) => {
|
|
1828
|
+
F && (re[`${y.key}_${te}`] = F);
|
|
1798
1829
|
});
|
|
1799
|
-
const
|
|
1800
|
-
|
|
1830
|
+
const ie = Math.max(N ? ne.length : ne.length + 1, 1);
|
|
1831
|
+
o.current.querySelectorAll(
|
|
1801
1832
|
'[data-type="variable"]'
|
|
1802
|
-
).forEach((
|
|
1803
|
-
const
|
|
1804
|
-
if (
|
|
1805
|
-
const
|
|
1806
|
-
|
|
1833
|
+
).forEach((F) => {
|
|
1834
|
+
const te = F.dataset.key, de = F.dataset.multiKey;
|
|
1835
|
+
if (te && de !== y.key) {
|
|
1836
|
+
const Y = F.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
1837
|
+
Y && (re[te] = Y);
|
|
1807
1838
|
}
|
|
1808
|
-
}),
|
|
1809
|
-
...
|
|
1810
|
-
[y.key]:
|
|
1839
|
+
}), o.current.__tempVariableValues = re, T((F) => ({
|
|
1840
|
+
...F,
|
|
1841
|
+
[y.key]: ie
|
|
1811
1842
|
}));
|
|
1812
1843
|
return;
|
|
1813
1844
|
}
|
|
1814
|
-
if (!
|
|
1815
|
-
const
|
|
1816
|
-
`[data-type="variable"][data-key="${
|
|
1845
|
+
if (!N) {
|
|
1846
|
+
const M = S - 1, ne = `${y.key}_${M}`, re = o.current.querySelector(
|
|
1847
|
+
`[data-type="variable"][data-key="${ne}"][data-multi-key="${y.key}"]`
|
|
1817
1848
|
);
|
|
1818
|
-
if (
|
|
1819
|
-
const
|
|
1820
|
-
if (
|
|
1821
|
-
const
|
|
1822
|
-
if (
|
|
1823
|
-
const
|
|
1824
|
-
if (
|
|
1825
|
-
const
|
|
1826
|
-
|
|
1827
|
-
const
|
|
1828
|
-
|
|
1849
|
+
if (re && re.innerText.replace(/[\u200B\n]/g, "").trim().length > 0 && S < h) {
|
|
1850
|
+
const le = window.getSelection();
|
|
1851
|
+
if (le && le.rangeCount > 0) {
|
|
1852
|
+
const F = le.getRangeAt(0), te = F.startContainer, de = te.nodeType === Node.ELEMENT_NODE ? te.closest('[data-type="variable"][data-multi-key]') : te.parentElement?.closest('[data-type="variable"][data-multi-key]');
|
|
1853
|
+
if (de) {
|
|
1854
|
+
const Y = de.dataset.key;
|
|
1855
|
+
if (Y) {
|
|
1856
|
+
const se = document.createRange();
|
|
1857
|
+
se.setStartBefore(de), se.setEnd(F.startContainer, F.startOffset);
|
|
1858
|
+
const fe = se.toString().length;
|
|
1859
|
+
U.current = { key: Y, offset: fe };
|
|
1829
1860
|
}
|
|
1830
1861
|
}
|
|
1831
1862
|
}
|
|
1832
|
-
|
|
1833
|
-
...
|
|
1834
|
-
[y.key]:
|
|
1863
|
+
T((F) => ({
|
|
1864
|
+
...F,
|
|
1865
|
+
[y.key]: S + 1
|
|
1835
1866
|
}));
|
|
1836
1867
|
}
|
|
1837
1868
|
}
|
|
1838
1869
|
});
|
|
1839
|
-
}
|
|
1840
|
-
|
|
1870
|
+
};
|
|
1871
|
+
oe(() => {
|
|
1872
|
+
const f = o.current;
|
|
1873
|
+
if (!f) return;
|
|
1874
|
+
const y = (h) => {
|
|
1875
|
+
const S = h.target;
|
|
1876
|
+
if (!S || !o.current) return;
|
|
1877
|
+
const v = h.relatedTarget, E = !v || !o.current.contains(v);
|
|
1878
|
+
if (console.log("[Blur Event] 事件触发:", {
|
|
1879
|
+
target: S,
|
|
1880
|
+
relatedTarget: v,
|
|
1881
|
+
isReallyBlurred: E,
|
|
1882
|
+
activeElement: document.activeElement,
|
|
1883
|
+
targetTagName: S.tagName,
|
|
1884
|
+
targetClassName: S.className
|
|
1885
|
+
}), !E) {
|
|
1886
|
+
console.log("[Blur Event] 焦点仍在编辑器内,跳过处理");
|
|
1887
|
+
return;
|
|
1888
|
+
}
|
|
1889
|
+
const N = S.closest('[data-type="variable"][data-multi-key]');
|
|
1890
|
+
if (N && o.current.contains(N)) {
|
|
1891
|
+
const R = N.dataset.multiKey, j = N.dataset.key, M = N.dataset.index;
|
|
1892
|
+
if (R && j && M !== void 0) {
|
|
1893
|
+
const ne = N.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
1894
|
+
console.log("[Blur Event] 失去焦点的 multi-variable 输入框:", {
|
|
1895
|
+
multiKey: R,
|
|
1896
|
+
currentKey: j,
|
|
1897
|
+
index: M,
|
|
1898
|
+
content: ne
|
|
1899
|
+
});
|
|
1900
|
+
const re = /[、,,\s]+/;
|
|
1901
|
+
if (re.test(ne)) {
|
|
1902
|
+
const ie = ne.split(re).map((te) => te.trim()).filter((te) => te.length > 0);
|
|
1903
|
+
console.log("[Blur Event] 拆分前的内容:", ne), console.log("[Blur Event] 拆分后的部分:", ie);
|
|
1904
|
+
const F = ie.slice(0, 9);
|
|
1905
|
+
if (console.log("[Blur Event] 有效的部分(最多9个):", F), F.length > 1) {
|
|
1906
|
+
const te = t.find((de) => de.type === "multi-variable" && de.key === R);
|
|
1907
|
+
if (te) {
|
|
1908
|
+
const de = Z[R] || 1, Y = parseInt(M, 10), se = te.maxCount || 9, fe = [];
|
|
1909
|
+
for (let ge = 0; ge < de; ge++) {
|
|
1910
|
+
const we = `${R}_${ge}`, Te = o.current.querySelector(
|
|
1911
|
+
`[data-type="variable"][data-key="${we}"][data-multi-key="${R}"]`
|
|
1912
|
+
);
|
|
1913
|
+
if (Te) {
|
|
1914
|
+
const Ne = Te.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
1915
|
+
fe.push(Ne);
|
|
1916
|
+
}
|
|
1917
|
+
}
|
|
1918
|
+
console.log("[Blur Event] 拆分前的所有值:", fe), console.log("[Blur Event] 当前索引:", Y), console.log("[Blur Event] 要插入的值:", F), fe.splice(Y, 1, ...F);
|
|
1919
|
+
const me = fe.slice(0, se);
|
|
1920
|
+
console.log("[Blur Event] 拆分后的所有值:", me), me.length > 0 && me[me.length - 1] !== "" && me.length < se && me.push("");
|
|
1921
|
+
const We = Math.max(me.length, 1), Ae = {};
|
|
1922
|
+
me.forEach((ge, we) => {
|
|
1923
|
+
ge && (Ae[`${R}_${we}`] = ge);
|
|
1924
|
+
}), o.current.querySelectorAll(
|
|
1925
|
+
'[data-type="variable"]'
|
|
1926
|
+
).forEach((ge) => {
|
|
1927
|
+
const we = ge.dataset.key, Te = ge.dataset.multiKey;
|
|
1928
|
+
if (we && Te !== R) {
|
|
1929
|
+
const Ne = ge.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
1930
|
+
Ne && (Ae[we] = Ne);
|
|
1931
|
+
}
|
|
1932
|
+
}), o.current.__tempVariableValues = Ae, T((ge) => ({
|
|
1933
|
+
...ge,
|
|
1934
|
+
[R]: We
|
|
1935
|
+
}));
|
|
1936
|
+
}
|
|
1937
|
+
}
|
|
1938
|
+
}
|
|
1939
|
+
}
|
|
1940
|
+
}
|
|
1941
|
+
};
|
|
1942
|
+
return f.addEventListener("blur", y, !1), () => {
|
|
1943
|
+
f.removeEventListener("blur", y, !1);
|
|
1944
|
+
};
|
|
1945
|
+
}, [t, Z]);
|
|
1946
|
+
const ve = () => {
|
|
1947
|
+
if (o.current) {
|
|
1841
1948
|
if (t.length === 0) {
|
|
1842
|
-
const f =
|
|
1843
|
-
|
|
1949
|
+
const f = o.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "";
|
|
1950
|
+
B(f.length > 0);
|
|
1844
1951
|
return;
|
|
1845
1952
|
}
|
|
1846
|
-
|
|
1953
|
+
$e(o), _e(o, t, c), je(o, t, c, B);
|
|
1847
1954
|
}
|
|
1848
|
-
},
|
|
1849
|
-
if (
|
|
1955
|
+
}, qe = (f) => {
|
|
1956
|
+
if (a) {
|
|
1850
1957
|
f.preventDefault();
|
|
1851
1958
|
return;
|
|
1852
1959
|
}
|
|
1853
1960
|
const y = window.getSelection();
|
|
1854
1961
|
if (y && y.rangeCount > 0) {
|
|
1855
|
-
const
|
|
1856
|
-
let
|
|
1857
|
-
if (
|
|
1858
|
-
if (f.preventDefault(), f.stopPropagation(),
|
|
1859
|
-
const
|
|
1962
|
+
const h = y.anchorNode;
|
|
1963
|
+
let S = null;
|
|
1964
|
+
if (h && (h.nodeType === Node.ELEMENT_NODE ? S = h.closest('[data-type="text"]') : h.nodeType === Node.TEXT_NODE && h.parentElement && (S = h.parentElement.closest('[data-type="text"]'))), S) {
|
|
1965
|
+
if (f.preventDefault(), f.stopPropagation(), o.current) {
|
|
1966
|
+
const v = o.current.querySelector(
|
|
1860
1967
|
'[data-type="variable"], [data-type="upload"]'
|
|
1861
1968
|
);
|
|
1862
|
-
|
|
1969
|
+
v && v.focus();
|
|
1863
1970
|
}
|
|
1864
1971
|
return;
|
|
1865
1972
|
}
|
|
1866
1973
|
}
|
|
1867
1974
|
if (m && y && y.rangeCount > 0) {
|
|
1868
|
-
const
|
|
1869
|
-
let
|
|
1870
|
-
if (
|
|
1871
|
-
if (f.preventDefault(), f.stopPropagation(),
|
|
1872
|
-
const
|
|
1975
|
+
const h = y.anchorNode;
|
|
1976
|
+
let S = null;
|
|
1977
|
+
if (h && (h.nodeType === Node.ELEMENT_NODE ? S = h.closest(".tag-node") : h.nodeType === Node.TEXT_NODE && h.parentElement && (S = h.parentElement.closest(".tag-node"))), S) {
|
|
1978
|
+
if (f.preventDefault(), f.stopPropagation(), o.current) {
|
|
1979
|
+
const v = o.current.querySelector(
|
|
1873
1980
|
'[data-type="variable"], [data-type="upload"]'
|
|
1874
1981
|
);
|
|
1875
|
-
|
|
1982
|
+
v && v.focus();
|
|
1876
1983
|
}
|
|
1877
1984
|
return;
|
|
1878
1985
|
}
|
|
1879
1986
|
}
|
|
1880
|
-
if (f.key === "Enter" && !f.shiftKey && (f.preventDefault(),
|
|
1987
|
+
if (f.key === "Enter" && !f.shiftKey && (f.preventDefault(), Le()), f.key === "Escape" && o.current) {
|
|
1881
1988
|
if (m) {
|
|
1882
1989
|
f.preventDefault();
|
|
1883
1990
|
return;
|
|
1884
1991
|
}
|
|
1885
|
-
|
|
1992
|
+
o.current.innerHTML = "", o.current.focus();
|
|
1886
1993
|
}
|
|
1887
1994
|
if (f.key === "Backspace") {
|
|
1888
|
-
const
|
|
1889
|
-
if (
|
|
1890
|
-
const
|
|
1995
|
+
const h = window.getSelection();
|
|
1996
|
+
if (h && h.rangeCount > 0) {
|
|
1997
|
+
const S = h.getRangeAt(0), v = h.anchorNode;
|
|
1891
1998
|
if (m) {
|
|
1892
|
-
let
|
|
1893
|
-
if (
|
|
1999
|
+
let N = null, R = null;
|
|
2000
|
+
if (v && (v.nodeType === Node.ELEMENT_NODE ? (N = v.closest(".tag-node"), R = v.closest('[data-type="text"]')) : v.nodeType === Node.TEXT_NODE && v.parentElement && (N = v.parentElement.closest(".tag-node"), R = v.parentElement.closest('[data-type="text"]'))), (N || R) && S.collapsed && S.startOffset === 0) {
|
|
1894
2001
|
f.preventDefault();
|
|
1895
2002
|
return;
|
|
1896
2003
|
}
|
|
1897
2004
|
}
|
|
1898
|
-
let
|
|
1899
|
-
if (
|
|
2005
|
+
let E = null;
|
|
2006
|
+
if (v && (v.nodeType === Node.ELEMENT_NODE ? E = v.closest(
|
|
1900
2007
|
'[data-type="variable"]'
|
|
1901
|
-
) :
|
|
2008
|
+
) : v.nodeType === Node.TEXT_NODE && v.parentElement && (E = v.parentElement.closest(
|
|
1902
2009
|
'[data-type="variable"]'
|
|
1903
|
-
))),
|
|
1904
|
-
if (
|
|
2010
|
+
))), E) {
|
|
2011
|
+
if (!S.collapsed)
|
|
1905
2012
|
return;
|
|
1906
|
-
const
|
|
1907
|
-
if (
|
|
2013
|
+
const N = E.innerText;
|
|
2014
|
+
if (N === "" || N === "") {
|
|
1908
2015
|
f.preventDefault();
|
|
1909
2016
|
return;
|
|
1910
2017
|
}
|
|
1911
|
-
if (
|
|
2018
|
+
if (S.startOffset === 0) {
|
|
1912
2019
|
f.preventDefault();
|
|
1913
2020
|
return;
|
|
1914
2021
|
}
|
|
1915
|
-
if (
|
|
2022
|
+
if (N.startsWith("") && S.startOffset === 1) {
|
|
1916
2023
|
f.preventDefault();
|
|
1917
2024
|
return;
|
|
1918
2025
|
}
|
|
1919
2026
|
}
|
|
1920
2027
|
}
|
|
1921
2028
|
}
|
|
1922
|
-
},
|
|
1923
|
-
if (
|
|
2029
|
+
}, Le = () => {
|
|
2030
|
+
if (l || a || e || !D || !o.current) return;
|
|
1924
2031
|
if (t.length === 0) {
|
|
1925
|
-
const
|
|
1926
|
-
if (!
|
|
1927
|
-
p(
|
|
2032
|
+
const E = o.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "";
|
|
2033
|
+
if (!E) return;
|
|
2034
|
+
p(E, E);
|
|
1928
2035
|
return;
|
|
1929
2036
|
}
|
|
1930
|
-
const f =
|
|
2037
|
+
const f = o.current;
|
|
1931
2038
|
let y = "";
|
|
1932
|
-
const
|
|
1933
|
-
if (!(
|
|
1934
|
-
if (
|
|
1935
|
-
y += (
|
|
1936
|
-
else if (
|
|
1937
|
-
const
|
|
1938
|
-
if (
|
|
1939
|
-
let
|
|
1940
|
-
const
|
|
1941
|
-
|
|
2039
|
+
const h = {}, S = (E) => {
|
|
2040
|
+
if (!(E.nodeType === Node.ELEMENT_NODE && E.style.display === "none")) {
|
|
2041
|
+
if (E.nodeType === Node.TEXT_NODE)
|
|
2042
|
+
y += (E.textContent || "").replace(/\u200B/g, "");
|
|
2043
|
+
else if (E.nodeType === Node.ELEMENT_NODE) {
|
|
2044
|
+
const N = E, R = N.dataset.type, j = N.dataset.key;
|
|
2045
|
+
if (R === "variable" && j) {
|
|
2046
|
+
let M = "";
|
|
2047
|
+
const ne = document.createTreeWalker(
|
|
2048
|
+
N,
|
|
1942
2049
|
NodeFilter.SHOW_TEXT,
|
|
1943
2050
|
{
|
|
1944
|
-
acceptNode: (
|
|
1945
|
-
const
|
|
1946
|
-
return
|
|
2051
|
+
acceptNode: (ie) => {
|
|
2052
|
+
const le = N.querySelector(".variable-info-icon");
|
|
2053
|
+
return le && le.contains(ie) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT;
|
|
1947
2054
|
}
|
|
1948
2055
|
}
|
|
1949
2056
|
);
|
|
1950
|
-
for (;
|
|
1951
|
-
|
|
1952
|
-
const
|
|
1953
|
-
if (
|
|
1954
|
-
const
|
|
1955
|
-
if (
|
|
1956
|
-
(!
|
|
1957
|
-
const
|
|
1958
|
-
|
|
2057
|
+
for (; ne.nextNode(); )
|
|
2058
|
+
M += ne.currentNode.textContent || "";
|
|
2059
|
+
const re = M.replace(/[\u200B\n]/g, "").trim();
|
|
2060
|
+
if (re) {
|
|
2061
|
+
const ie = N.dataset.multiKey;
|
|
2062
|
+
if (ie) {
|
|
2063
|
+
(!h[ie] || !Array.isArray(h[ie])) && (h[ie] = []);
|
|
2064
|
+
const le = h[ie];
|
|
2065
|
+
le.push(re), le.length > 1 && (y += " "), y += re;
|
|
1959
2066
|
} else
|
|
1960
|
-
|
|
2067
|
+
h[j] = re, y += re;
|
|
1961
2068
|
}
|
|
1962
|
-
} else if (
|
|
1963
|
-
|
|
2069
|
+
} else if (R === "upload" && j)
|
|
2070
|
+
h[j] = c[j] ?? null, c[j] && (y += ` [附带文件: ${c[j]?.name}] `);
|
|
1964
2071
|
else {
|
|
1965
|
-
if (
|
|
1966
|
-
|
|
2072
|
+
if (N.classList.contains("tag-close-btn") || N.classList.contains("file-remove-btn")) return;
|
|
2073
|
+
N.getAttribute("contenteditable") === "false" && !R && N.classList.contains("tag-node") ? y += N.innerText : N.childNodes.forEach(S);
|
|
1967
2074
|
}
|
|
1968
2075
|
}
|
|
1969
2076
|
}
|
|
1970
2077
|
};
|
|
1971
|
-
if (f.childNodes.forEach(
|
|
1972
|
-
const
|
|
1973
|
-
|
|
1974
|
-
const
|
|
1975
|
-
|
|
1976
|
-
(
|
|
1977
|
-
) ?
|
|
1978
|
-
|
|
1979
|
-
}) :
|
|
1980
|
-
|
|
1981
|
-
}) : typeof
|
|
1982
|
-
}), p(
|
|
1983
|
-
},
|
|
1984
|
-
...
|
|
2078
|
+
if (f.childNodes.forEach(S), y = y.trim(), !y) return;
|
|
2079
|
+
const v = new FormData();
|
|
2080
|
+
v.append("fullPrompt", y), Object.keys(h).forEach((E) => {
|
|
2081
|
+
const N = h[E];
|
|
2082
|
+
N != null && (N instanceof File ? v.append(E, N) : Array.isArray(N) ? t.some(
|
|
2083
|
+
(j) => j.type === "multi-variable" && j.key === E
|
|
2084
|
+
) ? N.forEach((j) => {
|
|
2085
|
+
j != null && j !== "" && v.append(E, String(j));
|
|
2086
|
+
}) : N.forEach((j, M) => {
|
|
2087
|
+
j != null && (j instanceof File ? v.append(`${E}[${M}]`, j) : typeof j == "string" ? v.append(`${E}[${M}]`, j) : v.append(`${E}[${M}]`, String(j)));
|
|
2088
|
+
}) : typeof N == "string" ? v.append(E, N) : v.append(E, String(N)));
|
|
2089
|
+
}), p(v, y);
|
|
2090
|
+
}, He = {
|
|
2091
|
+
...r ? { width: typeof r == "number" ? `${r}px` : r } : {},
|
|
1985
2092
|
...u ? { border: u } : {},
|
|
1986
|
-
...
|
|
2093
|
+
...q ? { background: q } : {}
|
|
1987
2094
|
};
|
|
1988
2095
|
return /* @__PURE__ */ n.jsxs(
|
|
1989
2096
|
"div",
|
|
1990
2097
|
{
|
|
1991
2098
|
className: "rich-text-editor",
|
|
1992
|
-
style:
|
|
1993
|
-
"data-disabled":
|
|
2099
|
+
style: He,
|
|
2100
|
+
"data-disabled": a,
|
|
1994
2101
|
children: [
|
|
1995
2102
|
/* @__PURE__ */ n.jsx(
|
|
1996
2103
|
"div",
|
|
1997
2104
|
{
|
|
1998
|
-
ref:
|
|
1999
|
-
className: `rte-editor ${t.length === 0 ? "rte-editor-default" : ""} ${
|
|
2105
|
+
ref: o,
|
|
2106
|
+
className: `rte-editor ${t.length === 0 ? "rte-editor-default" : ""} ${H && x ? "rte-editor-empty" : ""}`,
|
|
2000
2107
|
contentEditable: t.length === 0,
|
|
2001
2108
|
suppressContentEditableWarning: !0,
|
|
2002
2109
|
"data-placeholder": x,
|
|
2003
|
-
onMouseDown:
|
|
2004
|
-
onMouseMove:
|
|
2005
|
-
onMouseUp:
|
|
2110
|
+
onMouseDown: ye,
|
|
2111
|
+
onMouseMove: ce,
|
|
2112
|
+
onMouseUp: be,
|
|
2006
2113
|
onClick: O,
|
|
2007
|
-
onDoubleClick:
|
|
2008
|
-
onInput:
|
|
2009
|
-
onKeyDown:
|
|
2010
|
-
onPaste:
|
|
2011
|
-
onBlur:
|
|
2114
|
+
onDoubleClick: G,
|
|
2115
|
+
onInput: ue,
|
|
2116
|
+
onKeyDown: qe,
|
|
2117
|
+
onPaste: L,
|
|
2118
|
+
onBlur: ve
|
|
2012
2119
|
}
|
|
2013
2120
|
),
|
|
2014
2121
|
/* @__PURE__ */ n.jsx(
|
|
2015
2122
|
"input",
|
|
2016
2123
|
{
|
|
2017
2124
|
type: "file",
|
|
2018
|
-
ref:
|
|
2125
|
+
ref: C,
|
|
2019
2126
|
className: "rte-file-input",
|
|
2020
2127
|
accept: ".csv,.xlsx,.xls,.txt,.pdf,image/*",
|
|
2021
|
-
onChange:
|
|
2128
|
+
onChange: K
|
|
2022
2129
|
}
|
|
2023
2130
|
),
|
|
2024
2131
|
/* @__PURE__ */ n.jsxs("div", { className: "rich-text-editor-footer", children: [
|
|
@@ -2028,11 +2135,11 @@ const qt = ({
|
|
|
2028
2135
|
/* @__PURE__ */ n.jsx("span", { className: "rte-brand-text", children: "SealSeek 1.0" })
|
|
2029
2136
|
] }),
|
|
2030
2137
|
d !== "hideAgent" && /* @__PURE__ */ n.jsx(
|
|
2031
|
-
|
|
2138
|
+
Ze,
|
|
2032
2139
|
{
|
|
2033
2140
|
placement: "top",
|
|
2034
2141
|
menu: {
|
|
2035
|
-
items:
|
|
2142
|
+
items: A.map((f) => ({
|
|
2036
2143
|
key: f.key,
|
|
2037
2144
|
label: /* @__PURE__ */ n.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
|
|
2038
2145
|
f.icon && /* @__PURE__ */ n.jsx("i", { className: f.icon }),
|
|
@@ -2044,8 +2151,8 @@ const qt = ({
|
|
|
2044
2151
|
}))
|
|
2045
2152
|
},
|
|
2046
2153
|
trigger: ["click"],
|
|
2047
|
-
disabled:
|
|
2048
|
-
children: /* @__PURE__ */ n.jsxs("div", { className: "rte-agent-badge", style: { cursor:
|
|
2154
|
+
disabled: a || l,
|
|
2155
|
+
children: /* @__PURE__ */ n.jsxs("div", { className: "rte-agent-badge", style: { cursor: A.length > 0 ? "pointer" : "default" }, children: [
|
|
2049
2156
|
/* @__PURE__ */ n.jsx("i", { className: "iconfont icon-zhinengti" }),
|
|
2050
2157
|
/* @__PURE__ */ n.jsx("span", { className: "rte-agent-text", children: "智能体" })
|
|
2051
2158
|
] })
|
|
@@ -2056,22 +2163,22 @@ const qt = ({
|
|
|
2056
2163
|
"button",
|
|
2057
2164
|
{
|
|
2058
2165
|
type: "button",
|
|
2059
|
-
onClick:
|
|
2060
|
-
disabled:
|
|
2166
|
+
onClick: Le,
|
|
2167
|
+
disabled: l || a || e || !D,
|
|
2061
2168
|
className: "rich-text-editor-send-button",
|
|
2062
|
-
children:
|
|
2169
|
+
children: l || e ? /* @__PURE__ */ n.jsx("span", { className: "rte-send-spinner" }) : /* @__PURE__ */ n.jsx("i", { className: "iconfont icon-fasong" })
|
|
2063
2170
|
}
|
|
2064
2171
|
)
|
|
2065
2172
|
] }),
|
|
2066
|
-
|
|
2067
|
-
if (!document.body.contains(
|
|
2173
|
+
b?.anchorEl && (() => {
|
|
2174
|
+
if (!document.body.contains(b.anchorEl))
|
|
2068
2175
|
return null;
|
|
2069
2176
|
let f = "";
|
|
2070
|
-
return
|
|
2071
|
-
(
|
|
2072
|
-
)?.tooltip || "" :
|
|
2177
|
+
return b.type === "upload" ? f = t.find(
|
|
2178
|
+
(h) => h.type === "upload" && h.key === b.key
|
|
2179
|
+
)?.tooltip || "" : b.type === "tag" ? f = b.anchorEl.dataset.tooltip || "" : b.type === "upload-label" ? f = b.anchorEl.dataset.fileName || "" : b.type === "variable" && (f = b.anchorEl.dataset.tooltip || ""), pt(
|
|
2073
2180
|
/* @__PURE__ */ n.jsx(
|
|
2074
|
-
|
|
2181
|
+
et,
|
|
2075
2182
|
{
|
|
2076
2183
|
arrow: !1,
|
|
2077
2184
|
title: /* @__PURE__ */ n.jsx("div", { style: { maxWidth: "200px", fontSize: "12px", color: "#fff" }, children: f }),
|
|
@@ -2086,10 +2193,10 @@ const qt = ({
|
|
|
2086
2193
|
{
|
|
2087
2194
|
style: {
|
|
2088
2195
|
position: "fixed",
|
|
2089
|
-
left: `${
|
|
2090
|
-
top: `${
|
|
2091
|
-
width: `${
|
|
2092
|
-
height: `${
|
|
2196
|
+
left: `${b.anchorEl.getBoundingClientRect().left}px`,
|
|
2197
|
+
top: `${b.anchorEl.getBoundingClientRect().top}px`,
|
|
2198
|
+
width: `${b.anchorEl.offsetWidth}px`,
|
|
2199
|
+
height: `${b.anchorEl.offsetHeight}px`,
|
|
2093
2200
|
pointerEvents: "none"
|
|
2094
2201
|
}
|
|
2095
2202
|
}
|
|
@@ -2103,7 +2210,7 @@ const qt = ({
|
|
|
2103
2210
|
}
|
|
2104
2211
|
);
|
|
2105
2212
|
};
|
|
2106
|
-
|
|
2213
|
+
Vt.__docgenInfo = {
|
|
2107
2214
|
displayName: "RichTextEditor",
|
|
2108
2215
|
description: "结构化富文本输入组件,支持标签、变量输入块、文件上传以及互斥显示逻辑。",
|
|
2109
2216
|
props: {
|
|
@@ -2131,33 +2238,33 @@ qt.__docgenInfo = {
|
|
|
2131
2238
|
}
|
|
2132
2239
|
}
|
|
2133
2240
|
};
|
|
2134
|
-
const
|
|
2241
|
+
const De = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAFSSURBVHgB3ZTtccIwDIaVXv83I2SDZgSP0BHMBG0naEZhA2boBGQDswHdQJUOGRxjO0Z8HPDe6eJzJD2W4gjgEYSIn2xwK6EIFHqBGysJpMP3ZB0oRbEtmal1NtIxl4OWWsoxEsvqofJ0rgTNASOYq+7SXKDsuYvAcgkq/PWwBLQWqIfdjeRStaBUc4qzgLi9/BzJNmS/sh6bpvmrTfSFacU3scWy1mQryWdSnXiFE8QVUJINLTuyhWzzz/1OZmTN9hEckqtfUOwIGlGCpVRjE+94JFqpMtTeVzO8/UmPxpZU8Qa7aln8Tb9pfwla4WHWrjPvvbbnTBsX7PmLs83EDAH0BxSw1G31+/1FoDg/vPcXR+wocQS1apj4+P92FfhOoLyuBfYlmPgYnGoCjWADzAkzUyJ430awLmphPaxWQVU22BuuApPkHaanjcXSN3t6/QNjTMSJWDcs1QAAAABJRU5ErkJggg==", Lt = [
|
|
2135
2242
|
{ label: "5页", value: 5 },
|
|
2136
2243
|
{ label: "10页", value: 10 },
|
|
2137
2244
|
{ label: "15页", value: 15 },
|
|
2138
2245
|
{ label: "30页", value: 30 }
|
|
2139
|
-
],
|
|
2246
|
+
], Pt = ({
|
|
2140
2247
|
autoLoading: t,
|
|
2141
2248
|
batchSize: p,
|
|
2142
|
-
loadingProgress:
|
|
2143
|
-
loadIcon:
|
|
2144
|
-
onBatchSizeChange:
|
|
2249
|
+
loadingProgress: l,
|
|
2250
|
+
loadIcon: a,
|
|
2251
|
+
onBatchSizeChange: r,
|
|
2145
2252
|
onLoadNextPage: m,
|
|
2146
|
-
onStartAutoLoad:
|
|
2253
|
+
onStartAutoLoad: A,
|
|
2147
2254
|
onStopLoad: g
|
|
2148
|
-
}) => t &&
|
|
2149
|
-
|
|
2255
|
+
}) => t && l ? /* @__PURE__ */ n.jsxs("div", { className: "auto_load_progress", children: [
|
|
2256
|
+
a || /* @__PURE__ */ n.jsx("img", { src: De, alt: "自动加载", width: 14, height: 14 }),
|
|
2150
2257
|
/* @__PURE__ */ n.jsxs("span", { children: [
|
|
2151
2258
|
"正在加载第",
|
|
2152
|
-
|
|
2259
|
+
l.currentPage,
|
|
2153
2260
|
"/",
|
|
2154
|
-
|
|
2261
|
+
l.totalPages,
|
|
2155
2262
|
"页"
|
|
2156
2263
|
] }),
|
|
2157
2264
|
/* @__PURE__ */ n.jsx(
|
|
2158
|
-
|
|
2265
|
+
tt,
|
|
2159
2266
|
{
|
|
2160
|
-
percent:
|
|
2267
|
+
percent: l.percentage,
|
|
2161
2268
|
type: "line",
|
|
2162
2269
|
size: [160, 8]
|
|
2163
2270
|
}
|
|
@@ -2187,19 +2294,19 @@ const Le = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
2187
2294
|
"div",
|
|
2188
2295
|
{
|
|
2189
2296
|
className: "auto_load_btn",
|
|
2190
|
-
onClick: t ? void 0 :
|
|
2297
|
+
onClick: t ? void 0 : A,
|
|
2191
2298
|
children: [
|
|
2192
|
-
|
|
2299
|
+
a || /* @__PURE__ */ n.jsx("img", { src: De, alt: "自动加载", width: 14, height: 14 }),
|
|
2193
2300
|
/* @__PURE__ */ n.jsx("span", { children: "自动加载" })
|
|
2194
2301
|
]
|
|
2195
2302
|
}
|
|
2196
2303
|
),
|
|
2197
2304
|
/* @__PURE__ */ n.jsx(
|
|
2198
|
-
|
|
2305
|
+
Ve,
|
|
2199
2306
|
{
|
|
2200
2307
|
value: p,
|
|
2201
|
-
onChange:
|
|
2202
|
-
options:
|
|
2308
|
+
onChange: r,
|
|
2309
|
+
options: Lt,
|
|
2203
2310
|
disabled: t,
|
|
2204
2311
|
size: "small",
|
|
2205
2312
|
className: "auto_load_select",
|
|
@@ -2209,36 +2316,36 @@ const Le = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
2209
2316
|
]
|
|
2210
2317
|
}
|
|
2211
2318
|
)
|
|
2212
|
-
] }),
|
|
2319
|
+
] }), Bt = ({
|
|
2213
2320
|
current: t,
|
|
2214
2321
|
loadIcon: p,
|
|
2215
|
-
pageSize:
|
|
2216
|
-
total:
|
|
2217
|
-
cachedPages:
|
|
2322
|
+
pageSize: l,
|
|
2323
|
+
total: a,
|
|
2324
|
+
cachedPages: r,
|
|
2218
2325
|
loadedCount: m,
|
|
2219
|
-
autoLoading:
|
|
2326
|
+
autoLoading: A = !1,
|
|
2220
2327
|
loadingProgress: g,
|
|
2221
|
-
onChange:
|
|
2328
|
+
onChange: i,
|
|
2222
2329
|
onLoadNextPage: e,
|
|
2223
2330
|
onStartAutoLoad: x,
|
|
2224
2331
|
onStopLoading: u
|
|
2225
2332
|
}) => {
|
|
2226
|
-
const [
|
|
2227
|
-
{ length:
|
|
2228
|
-
(
|
|
2229
|
-
).filter((
|
|
2230
|
-
const
|
|
2231
|
-
return
|
|
2333
|
+
const [q, d] = J(5), o = Math.ceil(a / l), C = Ge(() => r.length >= o, [r, o]), c = () => Array.from(
|
|
2334
|
+
{ length: o },
|
|
2335
|
+
($, b) => b + 1
|
|
2336
|
+
).filter(($) => !r.includes($)).slice(0, q), w = (k, $, b) => {
|
|
2337
|
+
const V = r.includes(k);
|
|
2338
|
+
return $ === "prev" || $ === "next" || $ === "jump-prev" || $ === "jump-next" ? /* @__PURE__ */ n.jsx("div", { className: "pageBox", children: b }) : /* @__PURE__ */ n.jsxs(
|
|
2232
2339
|
"div",
|
|
2233
2340
|
{
|
|
2234
2341
|
className: "pageBox",
|
|
2235
2342
|
style: {
|
|
2236
|
-
backgroundColor: t ===
|
|
2237
|
-
color: t ===
|
|
2343
|
+
backgroundColor: t === k ? "#2563EB" : "#f5f5f5",
|
|
2344
|
+
color: t === k ? "#fff" : V ? "#171717" : "#a3a3a3"
|
|
2238
2345
|
},
|
|
2239
2346
|
children: [
|
|
2240
|
-
|
|
2241
|
-
!
|
|
2347
|
+
k,
|
|
2348
|
+
!V && /* @__PURE__ */ n.jsx("span", { className: "unload_spot" })
|
|
2242
2349
|
]
|
|
2243
2350
|
}
|
|
2244
2351
|
);
|
|
@@ -2247,7 +2354,7 @@ const Le = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
2247
2354
|
/* @__PURE__ */ n.jsxs("div", { className: "pagination_leftWrap", children: [
|
|
2248
2355
|
/* @__PURE__ */ n.jsxs("span", { className: "pagination_total", children: [
|
|
2249
2356
|
/* @__PURE__ */ n.jsx(
|
|
2250
|
-
|
|
2357
|
+
it,
|
|
2251
2358
|
{
|
|
2252
2359
|
style: { color: "#2563EB", marginRight: "4px" }
|
|
2253
2360
|
}
|
|
@@ -2255,97 +2362,97 @@ const Le = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
2255
2362
|
"已加载: ",
|
|
2256
2363
|
m,
|
|
2257
2364
|
"/",
|
|
2258
|
-
|
|
2365
|
+
a,
|
|
2259
2366
|
"条数据"
|
|
2260
2367
|
] }),
|
|
2261
|
-
!
|
|
2262
|
-
|
|
2368
|
+
!C && /* @__PURE__ */ n.jsx(
|
|
2369
|
+
Pt,
|
|
2263
2370
|
{
|
|
2264
2371
|
loadIcon: p || void 0,
|
|
2265
|
-
autoLoading:
|
|
2266
|
-
batchSize:
|
|
2372
|
+
autoLoading: A,
|
|
2373
|
+
batchSize: q,
|
|
2267
2374
|
loadingProgress: g,
|
|
2268
2375
|
disabled: !e || !x,
|
|
2269
2376
|
onBatchSizeChange: d,
|
|
2270
2377
|
onLoadNextPage: () => e?.(),
|
|
2271
2378
|
onStartAutoLoad: () => {
|
|
2272
|
-
const
|
|
2273
|
-
x?.(
|
|
2379
|
+
const k = c();
|
|
2380
|
+
x?.(k);
|
|
2274
2381
|
},
|
|
2275
2382
|
onStopLoad: () => u?.()
|
|
2276
2383
|
}
|
|
2277
2384
|
)
|
|
2278
2385
|
] }),
|
|
2279
2386
|
/* @__PURE__ */ n.jsx(
|
|
2280
|
-
|
|
2387
|
+
nt,
|
|
2281
2388
|
{
|
|
2282
2389
|
current: t,
|
|
2283
|
-
pageSize:
|
|
2284
|
-
total:
|
|
2285
|
-
onChange: (
|
|
2390
|
+
pageSize: l,
|
|
2391
|
+
total: a,
|
|
2392
|
+
onChange: (k) => i(k),
|
|
2286
2393
|
showSizeChanger: !1,
|
|
2287
2394
|
showQuickJumper: !1,
|
|
2288
|
-
showTotal: (
|
|
2289
|
-
itemRender:
|
|
2395
|
+
showTotal: (k, $) => "",
|
|
2396
|
+
itemRender: w
|
|
2290
2397
|
}
|
|
2291
2398
|
)
|
|
2292
2399
|
] });
|
|
2293
|
-
},
|
|
2400
|
+
}, Ot = (t) => {
|
|
2294
2401
|
const {
|
|
2295
2402
|
loading: p,
|
|
2296
|
-
autoLoading:
|
|
2297
|
-
loadingProgress:
|
|
2298
|
-
columns:
|
|
2403
|
+
autoLoading: l,
|
|
2404
|
+
loadingProgress: a,
|
|
2405
|
+
columns: r = [],
|
|
2299
2406
|
dataSource: m = [],
|
|
2300
|
-
total:
|
|
2407
|
+
total: A,
|
|
2301
2408
|
current: g,
|
|
2302
|
-
pageSize:
|
|
2409
|
+
pageSize: i,
|
|
2303
2410
|
cachedPages: e,
|
|
2304
2411
|
onChangePage: x,
|
|
2305
2412
|
onLoadNextPage: u,
|
|
2306
|
-
onStartAutoLoad:
|
|
2413
|
+
onStartAutoLoad: q,
|
|
2307
2414
|
onStopLoading: d,
|
|
2308
|
-
...
|
|
2309
|
-
} = t,
|
|
2310
|
-
(
|
|
2311
|
-
x(
|
|
2312
|
-
key: `${(
|
|
2415
|
+
...o
|
|
2416
|
+
} = t, C = z(null), c = W(
|
|
2417
|
+
(w) => {
|
|
2418
|
+
x(w), e.includes(w) && C.current?.scrollTo({
|
|
2419
|
+
key: `${(w - 1) * i + 1}`
|
|
2313
2420
|
});
|
|
2314
2421
|
},
|
|
2315
2422
|
[g]
|
|
2316
2423
|
);
|
|
2317
2424
|
return /* @__PURE__ */ n.jsxs("div", { className: "flex flex-col", children: [
|
|
2318
2425
|
/* @__PURE__ */ n.jsx(
|
|
2319
|
-
|
|
2426
|
+
Ie,
|
|
2320
2427
|
{
|
|
2321
|
-
ref:
|
|
2322
|
-
...
|
|
2323
|
-
columns:
|
|
2428
|
+
ref: C,
|
|
2429
|
+
...o,
|
|
2430
|
+
columns: r,
|
|
2324
2431
|
dataSource: m,
|
|
2325
2432
|
pagination: !1,
|
|
2326
2433
|
virtual: !0
|
|
2327
2434
|
}
|
|
2328
2435
|
),
|
|
2329
2436
|
/* @__PURE__ */ n.jsx(
|
|
2330
|
-
|
|
2437
|
+
Bt,
|
|
2331
2438
|
{
|
|
2332
2439
|
loading: p,
|
|
2333
|
-
autoLoading:
|
|
2334
|
-
loadingProgress:
|
|
2440
|
+
autoLoading: l,
|
|
2441
|
+
loadingProgress: a,
|
|
2335
2442
|
current: g,
|
|
2336
|
-
pageSize:
|
|
2337
|
-
total:
|
|
2443
|
+
pageSize: i,
|
|
2444
|
+
total: A,
|
|
2338
2445
|
loadedCount: m.length,
|
|
2339
2446
|
cachedPages: e,
|
|
2340
2447
|
onChange: c,
|
|
2341
2448
|
onLoadNextPage: u,
|
|
2342
|
-
onStartAutoLoad:
|
|
2449
|
+
onStartAutoLoad: q,
|
|
2343
2450
|
onStopLoading: d
|
|
2344
2451
|
}
|
|
2345
2452
|
)
|
|
2346
2453
|
] });
|
|
2347
2454
|
};
|
|
2348
|
-
|
|
2455
|
+
Ot.__docgenInfo = {
|
|
2349
2456
|
displayName: "VirtualTable",
|
|
2350
2457
|
description: "虚拟滚动表格组件,支持分页、数据缓存和自动加载功能。",
|
|
2351
2458
|
props: {
|
|
@@ -2452,79 +2559,79 @@ _t.__docgenInfo = {
|
|
|
2452
2559
|
}
|
|
2453
2560
|
}
|
|
2454
2561
|
};
|
|
2455
|
-
const
|
|
2562
|
+
const Mt = ({
|
|
2456
2563
|
texts: t = [],
|
|
2457
2564
|
placeholder: p = "请输入内容",
|
|
2458
|
-
animationSpeed:
|
|
2459
|
-
autoPlay:
|
|
2460
|
-
value:
|
|
2565
|
+
animationSpeed: l = 100,
|
|
2566
|
+
autoPlay: a = !0,
|
|
2567
|
+
value: r,
|
|
2461
2568
|
onChange: m,
|
|
2462
|
-
...
|
|
2569
|
+
...A
|
|
2463
2570
|
}) => {
|
|
2464
|
-
const [g,
|
|
2465
|
-
|
|
2466
|
-
|
|
2571
|
+
const [g, i] = J(""), [e, x] = J(0), [u, q] = J(!1), [d, o] = J(!1), [C, c] = J(!1), w = z(void 0), k = z(void 0), $ = z(t), b = z(e), V = z(d), _ = z(g);
|
|
2572
|
+
oe(() => {
|
|
2573
|
+
$.current = t, b.current = e, V.current = d, _.current = g;
|
|
2467
2574
|
});
|
|
2468
|
-
const
|
|
2469
|
-
let
|
|
2575
|
+
const P = W((T, I) => {
|
|
2576
|
+
let Q = 0;
|
|
2470
2577
|
c(!0);
|
|
2578
|
+
const ee = () => {
|
|
2579
|
+
Q < T.length ? (i(T.slice(0, Q + 1)), Q++, k.current = window.setTimeout(ee, l)) : (c(!1), I?.());
|
|
2580
|
+
};
|
|
2581
|
+
ee();
|
|
2582
|
+
}, [l]), D = W((T) => {
|
|
2583
|
+
let I = _.current.length;
|
|
2471
2584
|
const Q = () => {
|
|
2472
|
-
|
|
2585
|
+
I > 0 ? (i(_.current.slice(0, I - 1)), I--, k.current = window.setTimeout(Q, l / 2)) : T?.();
|
|
2473
2586
|
};
|
|
2474
2587
|
Q();
|
|
2475
|
-
}, [
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
|
|
2480
|
-
|
|
2481
|
-
|
|
2482
|
-
|
|
2483
|
-
N(!0);
|
|
2484
|
-
const k = S.current[h.current];
|
|
2485
|
-
q.current ? D(() => {
|
|
2486
|
-
L(k, () => {
|
|
2487
|
-
v.current = window.setTimeout(() => {
|
|
2488
|
-
x((_) => (_ + 1) % S.current.length), N(!1);
|
|
2588
|
+
}, [l]), B = W(() => {
|
|
2589
|
+
if ($.current.length === 0 || V.current) return;
|
|
2590
|
+
q(!0);
|
|
2591
|
+
const T = $.current[b.current];
|
|
2592
|
+
_.current ? D(() => {
|
|
2593
|
+
P(T, () => {
|
|
2594
|
+
w.current = window.setTimeout(() => {
|
|
2595
|
+
x((I) => (I + 1) % $.current.length), q(!1);
|
|
2489
2596
|
}, 2e3);
|
|
2490
2597
|
});
|
|
2491
|
-
}) :
|
|
2492
|
-
|
|
2493
|
-
x((
|
|
2598
|
+
}) : P(T, () => {
|
|
2599
|
+
w.current = window.setTimeout(() => {
|
|
2600
|
+
x((I) => (I + 1) % $.current.length), q(!1);
|
|
2494
2601
|
}, 2e3);
|
|
2495
2602
|
});
|
|
2496
|
-
}, [D,
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
}), [e, d,
|
|
2500
|
-
!u &&
|
|
2501
|
-
}, [e, u,
|
|
2502
|
-
const
|
|
2503
|
-
|
|
2504
|
-
},
|
|
2505
|
-
|
|
2506
|
-
},
|
|
2507
|
-
m?.(
|
|
2508
|
-
}, Z = () => d ||
|
|
2603
|
+
}, [D, P]);
|
|
2604
|
+
oe(() => (a && t.length > 0 && !d && B(), () => {
|
|
2605
|
+
w.current && window.clearTimeout(w.current), k.current && window.clearTimeout(k.current);
|
|
2606
|
+
}), [e, d, a, t.length, B]), oe(() => {
|
|
2607
|
+
!u && a && t.length > 0 && !d && B();
|
|
2608
|
+
}, [e, u, a, t.length, d, B]);
|
|
2609
|
+
const U = (T) => {
|
|
2610
|
+
o(!0), w.current && window.clearTimeout(w.current), k.current && window.clearTimeout(k.current), q(!1), c(!1), A.onFocus?.(T);
|
|
2611
|
+
}, H = (T) => {
|
|
2612
|
+
o(!1), !r && t.length > 0 && (i(""), x(0)), A.onBlur?.(T);
|
|
2613
|
+
}, X = (T) => {
|
|
2614
|
+
m?.(T.target.value), A.onChange?.(T);
|
|
2615
|
+
}, Z = () => d || r ? p : g || p;
|
|
2509
2616
|
return /* @__PURE__ */ n.jsxs("div", { style: { position: "relative" }, children: [
|
|
2510
2617
|
/* @__PURE__ */ n.jsx(
|
|
2511
|
-
|
|
2618
|
+
Fe,
|
|
2512
2619
|
{
|
|
2513
|
-
...
|
|
2514
|
-
value:
|
|
2515
|
-
onChange:
|
|
2516
|
-
onFocus:
|
|
2517
|
-
onBlur:
|
|
2620
|
+
...A,
|
|
2621
|
+
value: r,
|
|
2622
|
+
onChange: X,
|
|
2623
|
+
onFocus: U,
|
|
2624
|
+
onBlur: H,
|
|
2518
2625
|
placeholder: Z(),
|
|
2519
2626
|
style: {
|
|
2520
2627
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2521
|
-
...
|
|
2628
|
+
...A.style,
|
|
2522
2629
|
position: "relative",
|
|
2523
2630
|
zIndex: 1
|
|
2524
2631
|
}
|
|
2525
2632
|
}
|
|
2526
2633
|
),
|
|
2527
|
-
!d && !
|
|
2634
|
+
!d && !r && g && /* @__PURE__ */ n.jsxs(
|
|
2528
2635
|
"div",
|
|
2529
2636
|
{
|
|
2530
2637
|
style: {
|
|
@@ -2545,7 +2652,7 @@ const Rt = ({
|
|
|
2545
2652
|
},
|
|
2546
2653
|
children: [
|
|
2547
2654
|
/* @__PURE__ */ n.jsx("span", { children: g }),
|
|
2548
|
-
|
|
2655
|
+
C && /* @__PURE__ */ n.jsx(
|
|
2549
2656
|
"span",
|
|
2550
2657
|
{
|
|
2551
2658
|
style: {
|
|
@@ -2569,7 +2676,7 @@ const Rt = ({
|
|
|
2569
2676
|
` })
|
|
2570
2677
|
] });
|
|
2571
2678
|
};
|
|
2572
|
-
|
|
2679
|
+
Mt.__docgenInfo = {
|
|
2573
2680
|
displayName: "DynamicInput",
|
|
2574
2681
|
description: "动态文案输入框组件,支持流式文字动画效果",
|
|
2575
2682
|
props: {
|
|
@@ -2614,24 +2721,24 @@ Rt.__docgenInfo = {
|
|
|
2614
2721
|
}
|
|
2615
2722
|
}
|
|
2616
2723
|
};
|
|
2617
|
-
const
|
|
2724
|
+
const Dt = ({
|
|
2618
2725
|
texts: t = [],
|
|
2619
2726
|
// 动态文案数组,默认为空数组
|
|
2620
2727
|
placeholder: p = "请输入内容",
|
|
2621
2728
|
// 占位符文本
|
|
2622
|
-
animationSpeed:
|
|
2729
|
+
animationSpeed: l = 100,
|
|
2623
2730
|
// 打字机动画速度,毫秒
|
|
2624
|
-
autoPlay:
|
|
2731
|
+
autoPlay: a = !0,
|
|
2625
2732
|
// 是否自动播放动画
|
|
2626
|
-
value:
|
|
2733
|
+
value: r = "",
|
|
2627
2734
|
// 受控模式的值
|
|
2628
2735
|
onChange: m,
|
|
2629
2736
|
// 受控模式的变化回调
|
|
2630
|
-
onSubmit:
|
|
2737
|
+
onSubmit: A,
|
|
2631
2738
|
// 提交回调
|
|
2632
2739
|
maxLength: g = 500,
|
|
2633
2740
|
// 最大字符数限制
|
|
2634
|
-
showCount:
|
|
2741
|
+
showCount: i = !0,
|
|
2635
2742
|
// 是否显示字数统计
|
|
2636
2743
|
submitText: e = "发送",
|
|
2637
2744
|
// 提交按钮文本
|
|
@@ -2639,78 +2746,78 @@ const It = ({
|
|
|
2639
2746
|
// 是否禁用组件
|
|
2640
2747
|
rows: u = 4,
|
|
2641
2748
|
// 文本域行数
|
|
2642
|
-
style:
|
|
2749
|
+
style: q,
|
|
2643
2750
|
// 自定义样式
|
|
2644
2751
|
...d
|
|
2645
2752
|
// 其他原生属性
|
|
2646
2753
|
}) => {
|
|
2647
|
-
const [
|
|
2648
|
-
|
|
2649
|
-
|
|
2754
|
+
const [o, C] = J(""), [c, w] = J(0), [k, $] = J(!1), [b, V] = J(!1), [_, P] = J(!1), [D, B] = J(r || ""), U = z(void 0), H = z(void 0), X = z(t), Z = z(c), T = z(b), I = z(o), Q = z(null);
|
|
2755
|
+
oe(() => {
|
|
2756
|
+
X.current = t, Z.current = c, T.current = b, I.current = o;
|
|
2650
2757
|
});
|
|
2651
|
-
const
|
|
2652
|
-
let
|
|
2653
|
-
|
|
2654
|
-
const
|
|
2655
|
-
|
|
2758
|
+
const ee = W((O, G) => {
|
|
2759
|
+
let ue = 0;
|
|
2760
|
+
P(!0);
|
|
2761
|
+
const ve = () => {
|
|
2762
|
+
ue < O.length ? (C(O.slice(0, ue + 1)), ue++, H.current = window.setTimeout(ve, l)) : (P(!1), G?.());
|
|
2656
2763
|
};
|
|
2657
|
-
|
|
2658
|
-
}, [
|
|
2659
|
-
let
|
|
2660
|
-
const
|
|
2661
|
-
|
|
2764
|
+
ve();
|
|
2765
|
+
}, [l]), pe = W((O) => {
|
|
2766
|
+
let G = I.current.length;
|
|
2767
|
+
const ue = () => {
|
|
2768
|
+
G > 0 ? (C(I.current.slice(0, G - 1)), G--, H.current = window.setTimeout(ue, l / 2)) : O?.();
|
|
2662
2769
|
};
|
|
2663
|
-
|
|
2664
|
-
}, [
|
|
2665
|
-
if (
|
|
2666
|
-
|
|
2667
|
-
const O =
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2770
|
+
ue();
|
|
2771
|
+
}, [l]), he = W(() => {
|
|
2772
|
+
if (X.current.length === 0 || T.current) return;
|
|
2773
|
+
$(!0);
|
|
2774
|
+
const O = X.current[Z.current];
|
|
2775
|
+
I.current ? pe(() => {
|
|
2776
|
+
ee(O, () => {
|
|
2777
|
+
U.current = window.setTimeout(() => {
|
|
2778
|
+
w((G) => (G + 1) % X.current.length), $(!1);
|
|
2672
2779
|
}, 2e3);
|
|
2673
2780
|
});
|
|
2674
|
-
}) :
|
|
2675
|
-
|
|
2676
|
-
|
|
2781
|
+
}) : ee(O, () => {
|
|
2782
|
+
U.current = window.setTimeout(() => {
|
|
2783
|
+
w((G) => (G + 1) % X.current.length), $(!1);
|
|
2677
2784
|
}, 2e3);
|
|
2678
2785
|
});
|
|
2679
|
-
}, [
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
}), [c,
|
|
2683
|
-
!
|
|
2684
|
-
}, [c,
|
|
2786
|
+
}, [pe, ee]);
|
|
2787
|
+
oe(() => (a && t.length > 0 && !b && he(), () => {
|
|
2788
|
+
U.current && window.clearTimeout(U.current), H.current && window.clearTimeout(H.current);
|
|
2789
|
+
}), [c, b, a, t.length, he]), oe(() => {
|
|
2790
|
+
!k && a && t.length > 0 && !b && he();
|
|
2791
|
+
}, [c, k, a, t.length, b, he]);
|
|
2685
2792
|
const s = (O) => {
|
|
2686
|
-
|
|
2687
|
-
},
|
|
2688
|
-
|
|
2689
|
-
},
|
|
2690
|
-
const
|
|
2691
|
-
g &&
|
|
2692
|
-
},
|
|
2693
|
-
const O = m ?
|
|
2694
|
-
O.trim() && !x && (
|
|
2695
|
-
},
|
|
2696
|
-
(O.ctrlKey || O.metaKey) && O.key === "Enter" && (O.preventDefault(),
|
|
2697
|
-
},
|
|
2698
|
-
return /* @__PURE__ */ n.jsxs("div", { style: { position: "relative", ...
|
|
2793
|
+
V(!0), U.current && window.clearTimeout(U.current), H.current && window.clearTimeout(H.current), $(!1), P(!1), d.onFocus?.(O);
|
|
2794
|
+
}, L = (O) => {
|
|
2795
|
+
V(!1), !r && t.length > 0 && (C(""), w(0)), d.onBlur?.(O);
|
|
2796
|
+
}, K = (O) => {
|
|
2797
|
+
const G = O.target.value;
|
|
2798
|
+
g && G.length > g || (m ? m(G) : B(G), d.onChange?.(O));
|
|
2799
|
+
}, ae = () => {
|
|
2800
|
+
const O = m ? r : D;
|
|
2801
|
+
O.trim() && !x && (A?.(O), m || B(""));
|
|
2802
|
+
}, ye = (O) => {
|
|
2803
|
+
(O.ctrlKey || O.metaKey) && O.key === "Enter" && (O.preventDefault(), ae()), d.onKeyDown?.(O);
|
|
2804
|
+
}, ce = m ? r : D, be = x || !ce.trim() || (g ? ce.length > g : !1);
|
|
2805
|
+
return /* @__PURE__ */ n.jsxs("div", { style: { position: "relative", ...q }, children: [
|
|
2699
2806
|
/* @__PURE__ */ n.jsxs("div", { style: { position: "relative" }, children: [
|
|
2700
2807
|
/* @__PURE__ */ n.jsx(
|
|
2701
2808
|
"textarea",
|
|
2702
2809
|
{
|
|
2703
|
-
ref:
|
|
2704
|
-
value: m ?
|
|
2705
|
-
onChange:
|
|
2810
|
+
ref: Q,
|
|
2811
|
+
value: m ? r : D,
|
|
2812
|
+
onChange: K,
|
|
2706
2813
|
onFocus: (O) => {
|
|
2707
2814
|
O.target.style.borderColor = "#1890ff", O.target.style.boxShadow = "0 0 0 2px rgba(24, 144, 255, 0.2)", s(O);
|
|
2708
2815
|
},
|
|
2709
2816
|
onBlur: (O) => {
|
|
2710
|
-
O.target.style.borderColor = "#d9d9d9", O.target.style.boxShadow = "none",
|
|
2817
|
+
O.target.style.borderColor = "#d9d9d9", O.target.style.boxShadow = "none", L(O);
|
|
2711
2818
|
},
|
|
2712
|
-
onKeyDown:
|
|
2713
|
-
placeholder:
|
|
2819
|
+
onKeyDown: ye,
|
|
2820
|
+
placeholder: b || ce ? p : "",
|
|
2714
2821
|
maxLength: g,
|
|
2715
2822
|
rows: u,
|
|
2716
2823
|
disabled: x,
|
|
@@ -2734,7 +2841,7 @@ const It = ({
|
|
|
2734
2841
|
...d
|
|
2735
2842
|
}
|
|
2736
2843
|
),
|
|
2737
|
-
!
|
|
2844
|
+
!b && !ce && o && /* @__PURE__ */ n.jsxs(
|
|
2738
2845
|
"div",
|
|
2739
2846
|
{
|
|
2740
2847
|
style: {
|
|
@@ -2756,8 +2863,8 @@ const It = ({
|
|
|
2756
2863
|
lineHeight: "1.5"
|
|
2757
2864
|
},
|
|
2758
2865
|
children: [
|
|
2759
|
-
/* @__PURE__ */ n.jsx("span", { children:
|
|
2760
|
-
|
|
2866
|
+
/* @__PURE__ */ n.jsx("span", { children: o }),
|
|
2867
|
+
_ && /* @__PURE__ */ n.jsx(
|
|
2761
2868
|
"span",
|
|
2762
2869
|
{
|
|
2763
2870
|
style: {
|
|
@@ -2783,13 +2890,13 @@ const It = ({
|
|
|
2783
2890
|
zIndex: 3
|
|
2784
2891
|
},
|
|
2785
2892
|
children: /* @__PURE__ */ n.jsx(
|
|
2786
|
-
|
|
2893
|
+
xe,
|
|
2787
2894
|
{
|
|
2788
2895
|
type: "primary",
|
|
2789
2896
|
size: "small",
|
|
2790
|
-
icon: /* @__PURE__ */ n.jsx(
|
|
2791
|
-
onClick:
|
|
2792
|
-
disabled:
|
|
2897
|
+
icon: /* @__PURE__ */ n.jsx(ct, {}),
|
|
2898
|
+
onClick: ae,
|
|
2899
|
+
disabled: be,
|
|
2793
2900
|
style: {
|
|
2794
2901
|
borderRadius: 6,
|
|
2795
2902
|
minWidth: 32,
|
|
@@ -2804,7 +2911,7 @@ const It = ({
|
|
|
2804
2911
|
}
|
|
2805
2912
|
)
|
|
2806
2913
|
] }),
|
|
2807
|
-
|
|
2914
|
+
i && /* @__PURE__ */ n.jsxs(
|
|
2808
2915
|
"div",
|
|
2809
2916
|
{
|
|
2810
2917
|
style: {
|
|
@@ -2814,7 +2921,7 @@ const It = ({
|
|
|
2814
2921
|
color: "#999"
|
|
2815
2922
|
},
|
|
2816
2923
|
children: [
|
|
2817
|
-
|
|
2924
|
+
ce.length,
|
|
2818
2925
|
"/",
|
|
2819
2926
|
g
|
|
2820
2927
|
]
|
|
@@ -2828,7 +2935,7 @@ const It = ({
|
|
|
2828
2935
|
` })
|
|
2829
2936
|
] });
|
|
2830
2937
|
};
|
|
2831
|
-
|
|
2938
|
+
Dt.__docgenInfo = {
|
|
2832
2939
|
displayName: "DynamicTextArea",
|
|
2833
2940
|
description: "动态文案文本域组件,支持流式文字动画效果",
|
|
2834
2941
|
props: {
|
|
@@ -2914,66 +3021,66 @@ It.__docgenInfo = {
|
|
|
2914
3021
|
}
|
|
2915
3022
|
}
|
|
2916
3023
|
};
|
|
2917
|
-
const
|
|
3024
|
+
const ze = ({
|
|
2918
3025
|
src: t,
|
|
2919
3026
|
poster: p,
|
|
2920
|
-
width:
|
|
2921
|
-
height:
|
|
2922
|
-
videoWidth:
|
|
3027
|
+
width: l = 300,
|
|
3028
|
+
height: a,
|
|
3029
|
+
videoWidth: r,
|
|
2923
3030
|
// 参数保留但不使用,由CSS控制
|
|
2924
3031
|
videoHeight: m,
|
|
2925
3032
|
// 参数保留但不使用,由CSS控制
|
|
2926
|
-
showPlayButton:
|
|
3033
|
+
showPlayButton: A = !0,
|
|
2927
3034
|
autoPlayOnHover: g = !0,
|
|
2928
|
-
onClick:
|
|
3035
|
+
onClick: i,
|
|
2929
3036
|
onVideoLoaded: e,
|
|
2930
3037
|
onVideoPlay: x,
|
|
2931
3038
|
onVideoPause: u,
|
|
2932
|
-
onVideoEnded:
|
|
3039
|
+
onVideoEnded: q,
|
|
2933
3040
|
className: d,
|
|
2934
|
-
style:
|
|
2935
|
-
...
|
|
3041
|
+
style: o,
|
|
3042
|
+
...C
|
|
2936
3043
|
}) => {
|
|
2937
|
-
const c =
|
|
2938
|
-
c.current && (c.current.play(),
|
|
2939
|
-
}, [x]), D =
|
|
2940
|
-
c.current && (c.current.pause(),
|
|
2941
|
-
}, [u]),
|
|
2942
|
-
|
|
2943
|
-
}, [
|
|
2944
|
-
|
|
2945
|
-
}, [g,
|
|
2946
|
-
|
|
2947
|
-
}, [g,
|
|
2948
|
-
|
|
2949
|
-
}, [e]), Z =
|
|
2950
|
-
|
|
2951
|
-
}, [x]),
|
|
2952
|
-
|
|
2953
|
-
}, [u]),
|
|
2954
|
-
|
|
2955
|
-
}, [
|
|
2956
|
-
|
|
2957
|
-
}, [
|
|
3044
|
+
const c = z(null), [w, k] = J(!1), [$, b] = J(!1), [V, _] = J(!1), P = W(() => {
|
|
3045
|
+
c.current && (c.current.play(), k(!0), x?.());
|
|
3046
|
+
}, [x]), D = W(() => {
|
|
3047
|
+
c.current && (c.current.pause(), k(!1), u?.());
|
|
3048
|
+
}, [u]), B = W((ee) => {
|
|
3049
|
+
ee.stopPropagation(), w ? D() : P();
|
|
3050
|
+
}, [w, P, D]), U = W(() => {
|
|
3051
|
+
b(!0), g && !w && P();
|
|
3052
|
+
}, [g, w, P]), H = W(() => {
|
|
3053
|
+
b(!1), g && w && D();
|
|
3054
|
+
}, [g, w, D]), X = W(() => {
|
|
3055
|
+
_(!0), e?.();
|
|
3056
|
+
}, [e]), Z = W(() => {
|
|
3057
|
+
k(!0), x?.();
|
|
3058
|
+
}, [x]), T = W(() => {
|
|
3059
|
+
k(!1), u?.();
|
|
3060
|
+
}, [u]), I = W(() => {
|
|
3061
|
+
k(!1), q?.();
|
|
3062
|
+
}, [q]), Q = W((ee) => {
|
|
3063
|
+
i?.(ee);
|
|
3064
|
+
}, [i]);
|
|
2958
3065
|
return /* @__PURE__ */ n.jsx(
|
|
2959
|
-
|
|
3066
|
+
Re,
|
|
2960
3067
|
{
|
|
2961
|
-
...
|
|
3068
|
+
...C,
|
|
2962
3069
|
className: `video-card ${d || ""}`,
|
|
2963
3070
|
style: {
|
|
2964
|
-
width:
|
|
2965
|
-
height:
|
|
3071
|
+
width: l,
|
|
3072
|
+
height: a,
|
|
2966
3073
|
padding: 0,
|
|
2967
3074
|
overflow: "hidden",
|
|
2968
|
-
cursor:
|
|
3075
|
+
cursor: i ? "pointer" : "default",
|
|
2969
3076
|
border: "none",
|
|
2970
3077
|
borderRadius: 0,
|
|
2971
|
-
...
|
|
3078
|
+
...o
|
|
2972
3079
|
},
|
|
2973
3080
|
bordered: !1,
|
|
2974
|
-
onMouseEnter:
|
|
2975
|
-
onMouseLeave:
|
|
2976
|
-
onClick:
|
|
3081
|
+
onMouseEnter: U,
|
|
3082
|
+
onMouseLeave: H,
|
|
3083
|
+
onClick: Q,
|
|
2977
3084
|
children: /* @__PURE__ */ n.jsxs("div", { className: "video-card-container", children: [
|
|
2978
3085
|
/* @__PURE__ */ n.jsx(
|
|
2979
3086
|
"video",
|
|
@@ -2982,28 +3089,28 @@ const Oe = ({
|
|
|
2982
3089
|
src: t,
|
|
2983
3090
|
poster: p,
|
|
2984
3091
|
preload: "metadata",
|
|
2985
|
-
onLoadedData:
|
|
3092
|
+
onLoadedData: X,
|
|
2986
3093
|
onPlay: Z,
|
|
2987
|
-
onPause:
|
|
2988
|
-
onEnded:
|
|
3094
|
+
onPause: T,
|
|
3095
|
+
onEnded: I,
|
|
2989
3096
|
muted: !0,
|
|
2990
3097
|
loop: !0
|
|
2991
3098
|
}
|
|
2992
3099
|
),
|
|
2993
|
-
|
|
3100
|
+
A && /* @__PURE__ */ n.jsx(
|
|
2994
3101
|
"div",
|
|
2995
3102
|
{
|
|
2996
|
-
className: `video-play-button ${
|
|
2997
|
-
onClick:
|
|
2998
|
-
children:
|
|
3103
|
+
className: `video-play-button ${$ ? "hovered" : ""}`,
|
|
3104
|
+
onClick: B,
|
|
3105
|
+
children: w ? /* @__PURE__ */ n.jsx(ut, { className: "play-icon" }) : /* @__PURE__ */ n.jsx(dt, { className: "play-icon" })
|
|
2999
3106
|
}
|
|
3000
3107
|
),
|
|
3001
|
-
!
|
|
3108
|
+
!V && /* @__PURE__ */ n.jsx("div", { className: "video-loading-mask", children: /* @__PURE__ */ n.jsx("div", { className: "loading-spinner" }) })
|
|
3002
3109
|
] })
|
|
3003
3110
|
}
|
|
3004
3111
|
);
|
|
3005
3112
|
};
|
|
3006
|
-
|
|
3113
|
+
ze.__docgenInfo = {
|
|
3007
3114
|
displayName: "VideoCard",
|
|
3008
3115
|
description: "视频卡片组件,支持鼠标悬浮播放控制",
|
|
3009
3116
|
props: {
|
|
@@ -3104,12 +3211,12 @@ Oe.__docgenInfo = {
|
|
|
3104
3211
|
}
|
|
3105
3212
|
}
|
|
3106
3213
|
};
|
|
3107
|
-
const
|
|
3214
|
+
const Gt = (t) => [".mp4", ".webm", ".ogg", ".mov", ".avi", ".wmv", ".flv", ".mkv"].some((l) => t.toLowerCase().includes(l)), Ft = (t) => t.type ? t.type : Gt(t.url) ? "video" : "image", zt = ({
|
|
3108
3215
|
items: t,
|
|
3109
3216
|
columns: p,
|
|
3110
|
-
gap:
|
|
3111
|
-
responsive:
|
|
3112
|
-
breakpoints:
|
|
3217
|
+
gap: l = 0,
|
|
3218
|
+
responsive: a = !0,
|
|
3219
|
+
breakpoints: r = {
|
|
3113
3220
|
xs: 1,
|
|
3114
3221
|
sm: 2,
|
|
3115
3222
|
md: 3,
|
|
@@ -3118,77 +3225,77 @@ const Lt = (t) => [".mp4", ".webm", ".ogg", ".mov", ".avi", ".wmv", ".flv", ".mk
|
|
|
3118
3225
|
xxl: 6
|
|
3119
3226
|
},
|
|
3120
3227
|
className: m,
|
|
3121
|
-
style:
|
|
3228
|
+
style: A,
|
|
3122
3229
|
onClick: g
|
|
3123
3230
|
}) => {
|
|
3124
|
-
const
|
|
3125
|
-
if (!
|
|
3126
|
-
return p ||
|
|
3231
|
+
const i = z(null), [e, x] = J(p || r.md || 3), u = z(/* @__PURE__ */ new Map()), q = W(() => {
|
|
3232
|
+
if (!a || p)
|
|
3233
|
+
return p || r.md || 3;
|
|
3127
3234
|
const c = window.innerWidth;
|
|
3128
|
-
return c < 576 ?
|
|
3129
|
-
}, [
|
|
3130
|
-
if (!
|
|
3131
|
-
const c = e,
|
|
3132
|
-
t.forEach((
|
|
3133
|
-
const D =
|
|
3134
|
-
if (!
|
|
3135
|
-
const
|
|
3136
|
-
|
|
3235
|
+
return c < 576 ? r.xs || 1 : c < 768 ? r.sm || 2 : c < 992 ? r.md || 3 : c < 1200 ? r.lg || 4 : c < 1600 ? r.xl || 5 : r.xxl || 6;
|
|
3236
|
+
}, [a, p, r]), d = W(() => {
|
|
3237
|
+
if (!i.current) return;
|
|
3238
|
+
const c = e, w = i.current, $ = (w.offsetWidth - l * (c - 1)) / c, b = new Array(c).fill(0);
|
|
3239
|
+
t.forEach((_, P) => {
|
|
3240
|
+
const D = _.id || P, B = u.current.get(D);
|
|
3241
|
+
if (!B) return;
|
|
3242
|
+
const U = Math.min(...b), H = b.indexOf(U), X = H * ($ + l), Z = b[H];
|
|
3243
|
+
B.style.position = "absolute", B.style.left = `${X}px`, B.style.top = `${Z}px`, B.style.width = `${$}px`, b[H] += B.offsetHeight + l;
|
|
3137
3244
|
});
|
|
3138
|
-
const
|
|
3139
|
-
|
|
3140
|
-
}, [t, e,
|
|
3141
|
-
|
|
3245
|
+
const V = Math.max(...b);
|
|
3246
|
+
w.style.height = `${V}px`;
|
|
3247
|
+
}, [t, e, l]);
|
|
3248
|
+
oe(() => {
|
|
3142
3249
|
const c = () => {
|
|
3143
|
-
const
|
|
3144
|
-
|
|
3250
|
+
const w = q();
|
|
3251
|
+
w !== e && x(w);
|
|
3145
3252
|
};
|
|
3146
|
-
if (
|
|
3253
|
+
if (a)
|
|
3147
3254
|
return window.addEventListener("resize", c), c(), () => window.removeEventListener("resize", c);
|
|
3148
|
-
}, [
|
|
3255
|
+
}, [a, q, e]), oe(() => {
|
|
3149
3256
|
const c = setTimeout(() => {
|
|
3150
3257
|
d();
|
|
3151
3258
|
}, 100);
|
|
3152
3259
|
return () => clearTimeout(c);
|
|
3153
3260
|
}, [t, e, d]);
|
|
3154
|
-
const
|
|
3261
|
+
const o = W(() => {
|
|
3155
3262
|
d();
|
|
3156
|
-
}, [d]),
|
|
3263
|
+
}, [d]), C = W((c) => {
|
|
3157
3264
|
g && g(c), c.onClick?.(c);
|
|
3158
3265
|
}, [g]);
|
|
3159
3266
|
return /* @__PURE__ */ n.jsx(
|
|
3160
3267
|
"div",
|
|
3161
3268
|
{
|
|
3162
|
-
ref:
|
|
3269
|
+
ref: i,
|
|
3163
3270
|
className: `waterfall-container ${m || ""}`,
|
|
3164
3271
|
style: {
|
|
3165
3272
|
position: "relative",
|
|
3166
3273
|
width: "100%",
|
|
3167
|
-
...
|
|
3274
|
+
...A
|
|
3168
3275
|
},
|
|
3169
|
-
children: t.map((c,
|
|
3170
|
-
const
|
|
3276
|
+
children: t.map((c, w) => {
|
|
3277
|
+
const k = c.id || w, $ = Ft(c);
|
|
3171
3278
|
return /* @__PURE__ */ n.jsx(
|
|
3172
3279
|
"div",
|
|
3173
3280
|
{
|
|
3174
|
-
ref: (
|
|
3175
|
-
|
|
3281
|
+
ref: (b) => {
|
|
3282
|
+
b ? u.current.set(k, b) : u.current.delete(k);
|
|
3176
3283
|
},
|
|
3177
3284
|
className: "waterfall-item",
|
|
3178
|
-
children:
|
|
3285
|
+
children: $ === "video" ? /* @__PURE__ */ n.jsx("div", { style: {
|
|
3179
3286
|
width: "100%",
|
|
3180
3287
|
position: "relative",
|
|
3181
3288
|
paddingBottom: "56.25%",
|
|
3182
3289
|
cursor: g || c.onClick ? "pointer" : "default"
|
|
3183
3290
|
}, children: /* @__PURE__ */ n.jsx("div", { style: { position: "absolute", top: 0, left: 0, width: "100%", height: "100%" }, children: /* @__PURE__ */ n.jsx(
|
|
3184
|
-
|
|
3291
|
+
ze,
|
|
3185
3292
|
{
|
|
3186
3293
|
src: c.url,
|
|
3187
3294
|
poster: c.poster,
|
|
3188
3295
|
width: "100%",
|
|
3189
3296
|
height: "100%",
|
|
3190
|
-
onClick: () =>
|
|
3191
|
-
onVideoLoaded:
|
|
3297
|
+
onClick: () => C(c),
|
|
3298
|
+
onVideoLoaded: o,
|
|
3192
3299
|
autoPlayOnHover: !0,
|
|
3193
3300
|
showPlayButton: !1
|
|
3194
3301
|
}
|
|
@@ -3196,29 +3303,29 @@ const Lt = (t) => [".mp4", ".webm", ".ogg", ".mov", ".avi", ".wmv", ".flv", ".mk
|
|
|
3196
3303
|
"div",
|
|
3197
3304
|
{
|
|
3198
3305
|
className: "waterfall-image-wrapper",
|
|
3199
|
-
onClick: () =>
|
|
3306
|
+
onClick: () => C(c),
|
|
3200
3307
|
style: { cursor: g || c.onClick ? "pointer" : "default" },
|
|
3201
3308
|
children: /* @__PURE__ */ n.jsx(
|
|
3202
3309
|
"img",
|
|
3203
3310
|
{
|
|
3204
3311
|
src: c.url,
|
|
3205
|
-
alt: `瀑布流图片 ${
|
|
3312
|
+
alt: `瀑布流图片 ${w + 1}`,
|
|
3206
3313
|
className: "waterfall-image",
|
|
3207
|
-
onLoad:
|
|
3208
|
-
onError:
|
|
3314
|
+
onLoad: o,
|
|
3315
|
+
onError: o,
|
|
3209
3316
|
style: { display: "block", width: "100%", height: "auto" }
|
|
3210
3317
|
}
|
|
3211
3318
|
)
|
|
3212
3319
|
}
|
|
3213
3320
|
)
|
|
3214
3321
|
},
|
|
3215
|
-
|
|
3322
|
+
k
|
|
3216
3323
|
);
|
|
3217
3324
|
})
|
|
3218
3325
|
}
|
|
3219
3326
|
);
|
|
3220
3327
|
};
|
|
3221
|
-
|
|
3328
|
+
zt.__docgenInfo = {
|
|
3222
3329
|
displayName: "Waterfall",
|
|
3223
3330
|
description: "瀑布流布局组件,支持图片和视频混合展示",
|
|
3224
3331
|
props: {
|
|
@@ -3274,8 +3381,8 @@ Pt.__docgenInfo = {
|
|
|
3274
3381
|
}
|
|
3275
3382
|
}
|
|
3276
3383
|
};
|
|
3277
|
-
const
|
|
3278
|
-
algorithm:
|
|
3384
|
+
const Yt = {
|
|
3385
|
+
algorithm: at.defaultAlgorithm,
|
|
3279
3386
|
token: {
|
|
3280
3387
|
// 主色
|
|
3281
3388
|
colorPrimary: "#3b82f6",
|
|
@@ -3341,21 +3448,21 @@ const Gt = {
|
|
|
3341
3448
|
}
|
|
3342
3449
|
};
|
|
3343
3450
|
export {
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3451
|
+
Ct as AdvancedTable,
|
|
3452
|
+
vt as AppModal,
|
|
3453
|
+
kt as BackButton,
|
|
3454
|
+
gt as Button,
|
|
3455
|
+
ht as Card,
|
|
3456
|
+
Mt as DynamicInput,
|
|
3457
|
+
Dt as DynamicTextArea,
|
|
3458
|
+
Et as EmptyAndSpin,
|
|
3459
|
+
Tt as LinkButton,
|
|
3460
|
+
bt as PageTable,
|
|
3461
|
+
Vt as RichTextEditor,
|
|
3462
|
+
ze as VideoCard,
|
|
3463
|
+
Ot as VirtualTable,
|
|
3464
|
+
zt as Waterfall,
|
|
3465
|
+
wt as XcIcon,
|
|
3466
|
+
Yt as lightTheme
|
|
3360
3467
|
};
|
|
3361
3468
|
//# sourceMappingURL=index.es.js.map
|