bi-components-library 1.0.11 → 1.0.13
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 +1220 -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 S:
|
|
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 === S) 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"), S = 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 = S, 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, S] = 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), S((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), S((I) => ({ ...I, current: 1 }));
|
|
879
|
+
}, []), H = W(() => {
|
|
880
|
+
b.resetFields(), w({}), S((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
|
+
S(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 S = "";
|
|
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
|
+
S = `<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 ? S = `<span class="${e.className}"${c}>${e.text ?? ""}</span>` : S = 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 ? S = `<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>` : S = 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 ? S = `<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>` : S = _;
|
|
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 ? S = `<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>` : S = $;
|
|
1262
1262
|
}
|
|
1263
|
-
g += d +
|
|
1263
|
+
g += d + S + 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 S = d.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
1293
|
+
S && (e[o] = S);
|
|
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 S = 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
|
+
S.setStart(k, Math.min($, k.textContent?.length || 0)), S.collapse(!0);
|
|
1320
|
+
const b = window.getSelection();
|
|
1321
|
+
b && (b.removeAllRanges(), b.addRange(S), o.focus());
|
|
1322
1322
|
} else {
|
|
1323
|
-
|
|
1324
|
-
const
|
|
1325
|
-
|
|
1323
|
+
S.selectNodeContents(o), S.collapse(!1);
|
|
1324
|
+
const b = window.getSelection();
|
|
1325
|
+
b && (b.removeAllRanges(), b.addRange(S), o.focus());
|
|
1326
1326
|
}
|
|
1327
1327
|
} catch {
|
|
1328
|
-
const
|
|
1329
|
-
|
|
1328
|
+
const S = document.createRange();
|
|
1329
|
+
S.selectNodeContents(o), S.collapse(!1);
|
|
1330
1330
|
const c = window.getSelection();
|
|
1331
|
-
c && (c.removeAllRanges(), c.addRange(
|
|
1331
|
+
c && (c.removeAllRanges(), c.addRange(S), 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 S = d.anchorNode;
|
|
1472
|
+
if (!S) return;
|
|
1473
|
+
if (!t.current.contains(S)) {
|
|
1474
1474
|
d.removeAllRanges();
|
|
1475
1475
|
return;
|
|
1476
1476
|
}
|
|
1477
1477
|
let c = null;
|
|
1478
|
-
if (
|
|
1479
|
-
if (Date.now() -
|
|
1478
|
+
if (S.nodeType === Node.ELEMENT_NODE ? c = S.closest('[data-type="variable"]') : S.nodeType === Node.TEXT_NODE && S.parentElement && (c = S.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), S = 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((C) => {
|
|
1555
|
+
C.type === "multi-variable" && C.key && (h[C.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() || "", C = o.current.querySelectorAll('[data-type="variable"]'), v = o.current.querySelectorAll('[data-type="upload"]');
|
|
1575
|
+
let E = !1;
|
|
1576
|
+
C.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 C = h.anchorNode;
|
|
1603
|
+
if (C) {
|
|
1604
|
+
let v = null;
|
|
1605
|
+
if (C.nodeType === Node.ELEMENT_NODE ? v = C.closest('[data-type="variable"]') : C.nodeType === Node.TEXT_NODE && C.parentElement && (v = C.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 C = window.getSelection();
|
|
1651
|
+
if (C && C.rangeCount > 0) {
|
|
1652
|
+
const v = C.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((C) => ({ ...C, [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 C = Math.abs(f.clientX - P.current.x), v = Math.abs(f.clientY - P.current.y);
|
|
1694
|
+
(C > 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,422 @@ 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), S.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 C = window.getSelection();
|
|
1750
|
+
if (C) {
|
|
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
|
+
C.removeAllRanges(), C.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 C = h.querySelector(".variable-info-icon");
|
|
1772
|
+
if (C) {
|
|
1773
|
+
let v = !1;
|
|
1774
|
+
const E = document.createTreeWalker(
|
|
1775
|
+
h,
|
|
1745
1776
|
NodeFilter.SHOW_TEXT,
|
|
1746
1777
|
{
|
|
1747
|
-
acceptNode: (
|
|
1778
|
+
acceptNode: (N) => C.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 ? C.classList.add("hidden") : C.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, C = Z[y.key] || 1, v = [];
|
|
1792
|
+
for (let M = 0; M < C; 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 = C - 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 && C < 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]: C + 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 C = h.target;
|
|
1876
|
+
if (!C || !o.current || !o.current.contains(C))
|
|
1877
|
+
return;
|
|
1878
|
+
const v = h.relatedTarget, E = !v || !o.current.contains(v);
|
|
1879
|
+
if (console.log("[Blur Event] 事件触发:", {
|
|
1880
|
+
target: C,
|
|
1881
|
+
relatedTarget: v,
|
|
1882
|
+
isReallyBlurred: E,
|
|
1883
|
+
activeElement: document.activeElement,
|
|
1884
|
+
targetTagName: C.tagName,
|
|
1885
|
+
targetClassName: C.className
|
|
1886
|
+
}), !E) {
|
|
1887
|
+
console.log("[Blur Event] 焦点仍在编辑器内,跳过处理");
|
|
1888
|
+
return;
|
|
1889
|
+
}
|
|
1890
|
+
const N = C.closest('[data-type="variable"][data-multi-key]');
|
|
1891
|
+
if (N && o.current.contains(N)) {
|
|
1892
|
+
const R = N.dataset.multiKey, j = N.dataset.key, M = N.dataset.index;
|
|
1893
|
+
if (R && j && M !== void 0) {
|
|
1894
|
+
const ne = N.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
1895
|
+
console.log("[Blur Event] 失去焦点的 multi-variable 输入框:", {
|
|
1896
|
+
multiKey: R,
|
|
1897
|
+
currentKey: j,
|
|
1898
|
+
index: M,
|
|
1899
|
+
content: ne
|
|
1900
|
+
});
|
|
1901
|
+
const re = /[、,,\s]+/;
|
|
1902
|
+
if (re.test(ne)) {
|
|
1903
|
+
const ie = ne.split(re).map((te) => te.trim()).filter((te) => te.length > 0);
|
|
1904
|
+
console.log("[Blur Event] 拆分前的内容:", ne), console.log("[Blur Event] 拆分后的部分:", ie);
|
|
1905
|
+
const F = ie.slice(0, 9);
|
|
1906
|
+
if (console.log("[Blur Event] 有效的部分(最多9个):", F), F.length > 1) {
|
|
1907
|
+
const te = t.find((de) => de.type === "multi-variable" && de.key === R);
|
|
1908
|
+
if (te) {
|
|
1909
|
+
const de = Z[R] || 1, Y = parseInt(M, 10), se = te.maxCount || 9, fe = [];
|
|
1910
|
+
for (let ge = 0; ge < de; ge++) {
|
|
1911
|
+
const we = `${R}_${ge}`, Te = o.current.querySelector(
|
|
1912
|
+
`[data-type="variable"][data-key="${we}"][data-multi-key="${R}"]`
|
|
1913
|
+
);
|
|
1914
|
+
if (Te) {
|
|
1915
|
+
const Ne = Te.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
1916
|
+
fe.push(Ne);
|
|
1917
|
+
}
|
|
1918
|
+
}
|
|
1919
|
+
console.log("[Blur Event] 拆分前的所有值:", fe), console.log("[Blur Event] 当前索引:", Y), console.log("[Blur Event] 要插入的值:", F), fe.splice(Y, 1, ...F);
|
|
1920
|
+
const me = fe.slice(0, se);
|
|
1921
|
+
console.log("[Blur Event] 拆分后的所有值:", me), me.length > 0 && me[me.length - 1] !== "" && me.length < se && me.push("");
|
|
1922
|
+
const We = Math.max(me.length, 1), Ae = {};
|
|
1923
|
+
me.forEach((ge, we) => {
|
|
1924
|
+
ge && (Ae[`${R}_${we}`] = ge);
|
|
1925
|
+
}), o.current.querySelectorAll(
|
|
1926
|
+
'[data-type="variable"]'
|
|
1927
|
+
).forEach((ge) => {
|
|
1928
|
+
const we = ge.dataset.key, Te = ge.dataset.multiKey;
|
|
1929
|
+
if (we && Te !== R) {
|
|
1930
|
+
const Ne = ge.innerText.replace(/[\u200B\n]/g, "").trim();
|
|
1931
|
+
Ne && (Ae[we] = Ne);
|
|
1932
|
+
}
|
|
1933
|
+
}), o.current.__tempVariableValues = Ae, T((ge) => ({
|
|
1934
|
+
...ge,
|
|
1935
|
+
[R]: We
|
|
1936
|
+
}));
|
|
1937
|
+
}
|
|
1938
|
+
}
|
|
1939
|
+
}
|
|
1940
|
+
}
|
|
1941
|
+
}
|
|
1942
|
+
};
|
|
1943
|
+
return f.addEventListener("blur", y, !0), () => {
|
|
1944
|
+
f.removeEventListener("blur", y, !0);
|
|
1945
|
+
};
|
|
1946
|
+
}, [t, Z]);
|
|
1947
|
+
const ve = () => {
|
|
1948
|
+
if (o.current) {
|
|
1841
1949
|
if (t.length === 0) {
|
|
1842
|
-
const f =
|
|
1843
|
-
|
|
1950
|
+
const f = o.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "";
|
|
1951
|
+
B(f.length > 0);
|
|
1844
1952
|
return;
|
|
1845
1953
|
}
|
|
1846
|
-
|
|
1954
|
+
$e(o), _e(o, t, c), je(o, t, c, B);
|
|
1847
1955
|
}
|
|
1848
|
-
},
|
|
1849
|
-
if (
|
|
1956
|
+
}, qe = (f) => {
|
|
1957
|
+
if (a) {
|
|
1850
1958
|
f.preventDefault();
|
|
1851
1959
|
return;
|
|
1852
1960
|
}
|
|
1853
1961
|
const y = window.getSelection();
|
|
1854
1962
|
if (y && y.rangeCount > 0) {
|
|
1855
|
-
const
|
|
1856
|
-
let
|
|
1857
|
-
if (
|
|
1858
|
-
if (f.preventDefault(), f.stopPropagation(),
|
|
1859
|
-
const
|
|
1963
|
+
const h = y.anchorNode;
|
|
1964
|
+
let C = null;
|
|
1965
|
+
if (h && (h.nodeType === Node.ELEMENT_NODE ? C = h.closest('[data-type="text"]') : h.nodeType === Node.TEXT_NODE && h.parentElement && (C = h.parentElement.closest('[data-type="text"]'))), C) {
|
|
1966
|
+
if (f.preventDefault(), f.stopPropagation(), o.current) {
|
|
1967
|
+
const v = o.current.querySelector(
|
|
1860
1968
|
'[data-type="variable"], [data-type="upload"]'
|
|
1861
1969
|
);
|
|
1862
|
-
|
|
1970
|
+
v && v.focus();
|
|
1863
1971
|
}
|
|
1864
1972
|
return;
|
|
1865
1973
|
}
|
|
1866
1974
|
}
|
|
1867
1975
|
if (m && y && y.rangeCount > 0) {
|
|
1868
|
-
const
|
|
1869
|
-
let
|
|
1870
|
-
if (
|
|
1871
|
-
if (f.preventDefault(), f.stopPropagation(),
|
|
1872
|
-
const
|
|
1976
|
+
const h = y.anchorNode;
|
|
1977
|
+
let C = null;
|
|
1978
|
+
if (h && (h.nodeType === Node.ELEMENT_NODE ? C = h.closest(".tag-node") : h.nodeType === Node.TEXT_NODE && h.parentElement && (C = h.parentElement.closest(".tag-node"))), C) {
|
|
1979
|
+
if (f.preventDefault(), f.stopPropagation(), o.current) {
|
|
1980
|
+
const v = o.current.querySelector(
|
|
1873
1981
|
'[data-type="variable"], [data-type="upload"]'
|
|
1874
1982
|
);
|
|
1875
|
-
|
|
1983
|
+
v && v.focus();
|
|
1876
1984
|
}
|
|
1877
1985
|
return;
|
|
1878
1986
|
}
|
|
1879
1987
|
}
|
|
1880
|
-
if (f.key === "Enter" && !f.shiftKey && (f.preventDefault(),
|
|
1988
|
+
if (f.key === "Enter" && !f.shiftKey && (f.preventDefault(), Le()), f.key === "Escape" && o.current) {
|
|
1881
1989
|
if (m) {
|
|
1882
1990
|
f.preventDefault();
|
|
1883
1991
|
return;
|
|
1884
1992
|
}
|
|
1885
|
-
|
|
1993
|
+
o.current.innerHTML = "", o.current.focus();
|
|
1886
1994
|
}
|
|
1887
1995
|
if (f.key === "Backspace") {
|
|
1888
|
-
const
|
|
1889
|
-
if (
|
|
1890
|
-
const
|
|
1996
|
+
const h = window.getSelection();
|
|
1997
|
+
if (h && h.rangeCount > 0) {
|
|
1998
|
+
const C = h.getRangeAt(0), v = h.anchorNode;
|
|
1891
1999
|
if (m) {
|
|
1892
|
-
let
|
|
1893
|
-
if (
|
|
2000
|
+
let N = null, R = null;
|
|
2001
|
+
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) && C.collapsed && C.startOffset === 0) {
|
|
1894
2002
|
f.preventDefault();
|
|
1895
2003
|
return;
|
|
1896
2004
|
}
|
|
1897
2005
|
}
|
|
1898
|
-
let
|
|
1899
|
-
if (
|
|
2006
|
+
let E = null;
|
|
2007
|
+
if (v && (v.nodeType === Node.ELEMENT_NODE ? E = v.closest(
|
|
1900
2008
|
'[data-type="variable"]'
|
|
1901
|
-
) :
|
|
2009
|
+
) : v.nodeType === Node.TEXT_NODE && v.parentElement && (E = v.parentElement.closest(
|
|
1902
2010
|
'[data-type="variable"]'
|
|
1903
|
-
))),
|
|
1904
|
-
if (
|
|
2011
|
+
))), E) {
|
|
2012
|
+
if (!C.collapsed)
|
|
1905
2013
|
return;
|
|
1906
|
-
const
|
|
1907
|
-
if (
|
|
2014
|
+
const N = E.innerText;
|
|
2015
|
+
if (N === "" || N === "") {
|
|
1908
2016
|
f.preventDefault();
|
|
1909
2017
|
return;
|
|
1910
2018
|
}
|
|
1911
|
-
if (
|
|
2019
|
+
if (C.startOffset === 0) {
|
|
1912
2020
|
f.preventDefault();
|
|
1913
2021
|
return;
|
|
1914
2022
|
}
|
|
1915
|
-
if (
|
|
2023
|
+
if (N.startsWith("") && C.startOffset === 1) {
|
|
1916
2024
|
f.preventDefault();
|
|
1917
2025
|
return;
|
|
1918
2026
|
}
|
|
1919
2027
|
}
|
|
1920
2028
|
}
|
|
1921
2029
|
}
|
|
1922
|
-
},
|
|
1923
|
-
if (
|
|
2030
|
+
}, Le = () => {
|
|
2031
|
+
if (l || a || e || !D || !o.current) return;
|
|
1924
2032
|
if (t.length === 0) {
|
|
1925
|
-
const
|
|
1926
|
-
if (!
|
|
1927
|
-
p(
|
|
2033
|
+
const E = o.current.textContent?.replace(/[\u200B\n]/g, "").trim() || "";
|
|
2034
|
+
if (!E) return;
|
|
2035
|
+
p(E, E);
|
|
1928
2036
|
return;
|
|
1929
2037
|
}
|
|
1930
|
-
const f =
|
|
2038
|
+
const f = o.current;
|
|
1931
2039
|
let y = "";
|
|
1932
|
-
const
|
|
1933
|
-
if (!(
|
|
1934
|
-
if (
|
|
1935
|
-
y += (
|
|
1936
|
-
else if (
|
|
1937
|
-
const
|
|
1938
|
-
if (
|
|
1939
|
-
let
|
|
1940
|
-
const
|
|
1941
|
-
|
|
2040
|
+
const h = {}, C = (E) => {
|
|
2041
|
+
if (!(E.nodeType === Node.ELEMENT_NODE && E.style.display === "none")) {
|
|
2042
|
+
if (E.nodeType === Node.TEXT_NODE)
|
|
2043
|
+
y += (E.textContent || "").replace(/\u200B/g, "");
|
|
2044
|
+
else if (E.nodeType === Node.ELEMENT_NODE) {
|
|
2045
|
+
const N = E, R = N.dataset.type, j = N.dataset.key;
|
|
2046
|
+
if (R === "variable" && j) {
|
|
2047
|
+
let M = "";
|
|
2048
|
+
const ne = document.createTreeWalker(
|
|
2049
|
+
N,
|
|
1942
2050
|
NodeFilter.SHOW_TEXT,
|
|
1943
2051
|
{
|
|
1944
|
-
acceptNode: (
|
|
1945
|
-
const
|
|
1946
|
-
return
|
|
2052
|
+
acceptNode: (ie) => {
|
|
2053
|
+
const le = N.querySelector(".variable-info-icon");
|
|
2054
|
+
return le && le.contains(ie) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT;
|
|
1947
2055
|
}
|
|
1948
2056
|
}
|
|
1949
2057
|
);
|
|
1950
|
-
for (;
|
|
1951
|
-
|
|
1952
|
-
const
|
|
1953
|
-
if (
|
|
1954
|
-
const
|
|
1955
|
-
if (
|
|
1956
|
-
(!
|
|
1957
|
-
const
|
|
1958
|
-
|
|
2058
|
+
for (; ne.nextNode(); )
|
|
2059
|
+
M += ne.currentNode.textContent || "";
|
|
2060
|
+
const re = M.replace(/[\u200B\n]/g, "").trim();
|
|
2061
|
+
if (re) {
|
|
2062
|
+
const ie = N.dataset.multiKey;
|
|
2063
|
+
if (ie) {
|
|
2064
|
+
(!h[ie] || !Array.isArray(h[ie])) && (h[ie] = []);
|
|
2065
|
+
const le = h[ie];
|
|
2066
|
+
le.push(re), le.length > 1 && (y += " "), y += re;
|
|
1959
2067
|
} else
|
|
1960
|
-
|
|
2068
|
+
h[j] = re, y += re;
|
|
1961
2069
|
}
|
|
1962
|
-
} else if (
|
|
1963
|
-
|
|
2070
|
+
} else if (R === "upload" && j)
|
|
2071
|
+
h[j] = c[j] ?? null, c[j] && (y += ` [附带文件: ${c[j]?.name}] `);
|
|
1964
2072
|
else {
|
|
1965
|
-
if (
|
|
1966
|
-
|
|
2073
|
+
if (N.classList.contains("tag-close-btn") || N.classList.contains("file-remove-btn")) return;
|
|
2074
|
+
N.getAttribute("contenteditable") === "false" && !R && N.classList.contains("tag-node") ? y += N.innerText : N.childNodes.forEach(C);
|
|
1967
2075
|
}
|
|
1968
2076
|
}
|
|
1969
2077
|
}
|
|
1970
2078
|
};
|
|
1971
|
-
if (f.childNodes.forEach(
|
|
1972
|
-
const
|
|
1973
|
-
|
|
1974
|
-
const
|
|
1975
|
-
|
|
1976
|
-
(
|
|
1977
|
-
) ?
|
|
1978
|
-
|
|
1979
|
-
}) :
|
|
1980
|
-
|
|
1981
|
-
}) : typeof
|
|
1982
|
-
}), p(
|
|
1983
|
-
},
|
|
1984
|
-
...
|
|
2079
|
+
if (f.childNodes.forEach(C), y = y.trim(), !y) return;
|
|
2080
|
+
const v = new FormData();
|
|
2081
|
+
v.append("fullPrompt", y), Object.keys(h).forEach((E) => {
|
|
2082
|
+
const N = h[E];
|
|
2083
|
+
N != null && (N instanceof File ? v.append(E, N) : Array.isArray(N) ? t.some(
|
|
2084
|
+
(j) => j.type === "multi-variable" && j.key === E
|
|
2085
|
+
) ? N.forEach((j) => {
|
|
2086
|
+
j != null && j !== "" && v.append(E, String(j));
|
|
2087
|
+
}) : N.forEach((j, M) => {
|
|
2088
|
+
j != null && (j instanceof File ? v.append(`${E}[${M}]`, j) : typeof j == "string" ? v.append(`${E}[${M}]`, j) : v.append(`${E}[${M}]`, String(j)));
|
|
2089
|
+
}) : typeof N == "string" ? v.append(E, N) : v.append(E, String(N)));
|
|
2090
|
+
}), p(v, y);
|
|
2091
|
+
}, He = {
|
|
2092
|
+
...r ? { width: typeof r == "number" ? `${r}px` : r } : {},
|
|
1985
2093
|
...u ? { border: u } : {},
|
|
1986
|
-
...
|
|
2094
|
+
...q ? { background: q } : {}
|
|
1987
2095
|
};
|
|
1988
2096
|
return /* @__PURE__ */ n.jsxs(
|
|
1989
2097
|
"div",
|
|
1990
2098
|
{
|
|
1991
2099
|
className: "rich-text-editor",
|
|
1992
|
-
style:
|
|
1993
|
-
"data-disabled":
|
|
2100
|
+
style: He,
|
|
2101
|
+
"data-disabled": a,
|
|
1994
2102
|
children: [
|
|
1995
2103
|
/* @__PURE__ */ n.jsx(
|
|
1996
2104
|
"div",
|
|
1997
2105
|
{
|
|
1998
|
-
ref:
|
|
1999
|
-
className: `rte-editor ${t.length === 0 ? "rte-editor-default" : ""} ${
|
|
2106
|
+
ref: o,
|
|
2107
|
+
className: `rte-editor ${t.length === 0 ? "rte-editor-default" : ""} ${H && x ? "rte-editor-empty" : ""}`,
|
|
2000
2108
|
contentEditable: t.length === 0,
|
|
2001
2109
|
suppressContentEditableWarning: !0,
|
|
2002
2110
|
"data-placeholder": x,
|
|
2003
|
-
onMouseDown:
|
|
2004
|
-
onMouseMove:
|
|
2005
|
-
onMouseUp:
|
|
2111
|
+
onMouseDown: ye,
|
|
2112
|
+
onMouseMove: ce,
|
|
2113
|
+
onMouseUp: be,
|
|
2006
2114
|
onClick: O,
|
|
2007
|
-
onDoubleClick:
|
|
2008
|
-
onInput:
|
|
2009
|
-
onKeyDown:
|
|
2010
|
-
onPaste:
|
|
2011
|
-
onBlur:
|
|
2115
|
+
onDoubleClick: G,
|
|
2116
|
+
onInput: ue,
|
|
2117
|
+
onKeyDown: qe,
|
|
2118
|
+
onPaste: L,
|
|
2119
|
+
onBlur: ve
|
|
2012
2120
|
}
|
|
2013
2121
|
),
|
|
2014
2122
|
/* @__PURE__ */ n.jsx(
|
|
2015
2123
|
"input",
|
|
2016
2124
|
{
|
|
2017
2125
|
type: "file",
|
|
2018
|
-
ref:
|
|
2126
|
+
ref: S,
|
|
2019
2127
|
className: "rte-file-input",
|
|
2020
2128
|
accept: ".csv,.xlsx,.xls,.txt,.pdf,image/*",
|
|
2021
|
-
onChange:
|
|
2129
|
+
onChange: K
|
|
2022
2130
|
}
|
|
2023
2131
|
),
|
|
2024
2132
|
/* @__PURE__ */ n.jsxs("div", { className: "rich-text-editor-footer", children: [
|
|
@@ -2028,11 +2136,11 @@ const qt = ({
|
|
|
2028
2136
|
/* @__PURE__ */ n.jsx("span", { className: "rte-brand-text", children: "SealSeek 1.0" })
|
|
2029
2137
|
] }),
|
|
2030
2138
|
d !== "hideAgent" && /* @__PURE__ */ n.jsx(
|
|
2031
|
-
|
|
2139
|
+
Ze,
|
|
2032
2140
|
{
|
|
2033
2141
|
placement: "top",
|
|
2034
2142
|
menu: {
|
|
2035
|
-
items:
|
|
2143
|
+
items: A.map((f) => ({
|
|
2036
2144
|
key: f.key,
|
|
2037
2145
|
label: /* @__PURE__ */ n.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
|
|
2038
2146
|
f.icon && /* @__PURE__ */ n.jsx("i", { className: f.icon }),
|
|
@@ -2044,8 +2152,8 @@ const qt = ({
|
|
|
2044
2152
|
}))
|
|
2045
2153
|
},
|
|
2046
2154
|
trigger: ["click"],
|
|
2047
|
-
disabled:
|
|
2048
|
-
children: /* @__PURE__ */ n.jsxs("div", { className: "rte-agent-badge", style: { cursor:
|
|
2155
|
+
disabled: a || l,
|
|
2156
|
+
children: /* @__PURE__ */ n.jsxs("div", { className: "rte-agent-badge", style: { cursor: A.length > 0 ? "pointer" : "default" }, children: [
|
|
2049
2157
|
/* @__PURE__ */ n.jsx("i", { className: "iconfont icon-zhinengti" }),
|
|
2050
2158
|
/* @__PURE__ */ n.jsx("span", { className: "rte-agent-text", children: "智能体" })
|
|
2051
2159
|
] })
|
|
@@ -2056,22 +2164,22 @@ const qt = ({
|
|
|
2056
2164
|
"button",
|
|
2057
2165
|
{
|
|
2058
2166
|
type: "button",
|
|
2059
|
-
onClick:
|
|
2060
|
-
disabled:
|
|
2167
|
+
onClick: Le,
|
|
2168
|
+
disabled: l || a || e || !D,
|
|
2061
2169
|
className: "rich-text-editor-send-button",
|
|
2062
|
-
children:
|
|
2170
|
+
children: l || e ? /* @__PURE__ */ n.jsx("span", { className: "rte-send-spinner" }) : /* @__PURE__ */ n.jsx("i", { className: "iconfont icon-fasong" })
|
|
2063
2171
|
}
|
|
2064
2172
|
)
|
|
2065
2173
|
] }),
|
|
2066
|
-
|
|
2067
|
-
if (!document.body.contains(
|
|
2174
|
+
b?.anchorEl && (() => {
|
|
2175
|
+
if (!document.body.contains(b.anchorEl))
|
|
2068
2176
|
return null;
|
|
2069
2177
|
let f = "";
|
|
2070
|
-
return
|
|
2071
|
-
(
|
|
2072
|
-
)?.tooltip || "" :
|
|
2178
|
+
return b.type === "upload" ? f = t.find(
|
|
2179
|
+
(h) => h.type === "upload" && h.key === b.key
|
|
2180
|
+
)?.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
2181
|
/* @__PURE__ */ n.jsx(
|
|
2074
|
-
|
|
2182
|
+
et,
|
|
2075
2183
|
{
|
|
2076
2184
|
arrow: !1,
|
|
2077
2185
|
title: /* @__PURE__ */ n.jsx("div", { style: { maxWidth: "200px", fontSize: "12px", color: "#fff" }, children: f }),
|
|
@@ -2086,10 +2194,10 @@ const qt = ({
|
|
|
2086
2194
|
{
|
|
2087
2195
|
style: {
|
|
2088
2196
|
position: "fixed",
|
|
2089
|
-
left: `${
|
|
2090
|
-
top: `${
|
|
2091
|
-
width: `${
|
|
2092
|
-
height: `${
|
|
2197
|
+
left: `${b.anchorEl.getBoundingClientRect().left}px`,
|
|
2198
|
+
top: `${b.anchorEl.getBoundingClientRect().top}px`,
|
|
2199
|
+
width: `${b.anchorEl.offsetWidth}px`,
|
|
2200
|
+
height: `${b.anchorEl.offsetHeight}px`,
|
|
2093
2201
|
pointerEvents: "none"
|
|
2094
2202
|
}
|
|
2095
2203
|
}
|
|
@@ -2103,7 +2211,7 @@ const qt = ({
|
|
|
2103
2211
|
}
|
|
2104
2212
|
);
|
|
2105
2213
|
};
|
|
2106
|
-
|
|
2214
|
+
Vt.__docgenInfo = {
|
|
2107
2215
|
displayName: "RichTextEditor",
|
|
2108
2216
|
description: "结构化富文本输入组件,支持标签、变量输入块、文件上传以及互斥显示逻辑。",
|
|
2109
2217
|
props: {
|
|
@@ -2131,33 +2239,33 @@ qt.__docgenInfo = {
|
|
|
2131
2239
|
}
|
|
2132
2240
|
}
|
|
2133
2241
|
};
|
|
2134
|
-
const
|
|
2242
|
+
const De = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAFSSURBVHgB3ZTtccIwDIaVXv83I2SDZgSP0BHMBG0naEZhA2boBGQDswHdQJUOGRxjO0Z8HPDe6eJzJD2W4gjgEYSIn2xwK6EIFHqBGysJpMP3ZB0oRbEtmal1NtIxl4OWWsoxEsvqofJ0rgTNASOYq+7SXKDsuYvAcgkq/PWwBLQWqIfdjeRStaBUc4qzgLi9/BzJNmS/sh6bpvmrTfSFacU3scWy1mQryWdSnXiFE8QVUJINLTuyhWzzz/1OZmTN9hEckqtfUOwIGlGCpVRjE+94JFqpMtTeVzO8/UmPxpZU8Qa7aln8Tb9pfwla4WHWrjPvvbbnTBsX7PmLs83EDAH0BxSw1G31+/1FoDg/vPcXR+wocQS1apj4+P92FfhOoLyuBfYlmPgYnGoCjWADzAkzUyJ430awLmphPaxWQVU22BuuApPkHaanjcXSN3t6/QNjTMSJWDcs1QAAAABJRU5ErkJggg==", Lt = [
|
|
2135
2243
|
{ label: "5页", value: 5 },
|
|
2136
2244
|
{ label: "10页", value: 10 },
|
|
2137
2245
|
{ label: "15页", value: 15 },
|
|
2138
2246
|
{ label: "30页", value: 30 }
|
|
2139
|
-
],
|
|
2247
|
+
], Pt = ({
|
|
2140
2248
|
autoLoading: t,
|
|
2141
2249
|
batchSize: p,
|
|
2142
|
-
loadingProgress:
|
|
2143
|
-
loadIcon:
|
|
2144
|
-
onBatchSizeChange:
|
|
2250
|
+
loadingProgress: l,
|
|
2251
|
+
loadIcon: a,
|
|
2252
|
+
onBatchSizeChange: r,
|
|
2145
2253
|
onLoadNextPage: m,
|
|
2146
|
-
onStartAutoLoad:
|
|
2254
|
+
onStartAutoLoad: A,
|
|
2147
2255
|
onStopLoad: g
|
|
2148
|
-
}) => t &&
|
|
2149
|
-
|
|
2256
|
+
}) => t && l ? /* @__PURE__ */ n.jsxs("div", { className: "auto_load_progress", children: [
|
|
2257
|
+
a || /* @__PURE__ */ n.jsx("img", { src: De, alt: "自动加载", width: 14, height: 14 }),
|
|
2150
2258
|
/* @__PURE__ */ n.jsxs("span", { children: [
|
|
2151
2259
|
"正在加载第",
|
|
2152
|
-
|
|
2260
|
+
l.currentPage,
|
|
2153
2261
|
"/",
|
|
2154
|
-
|
|
2262
|
+
l.totalPages,
|
|
2155
2263
|
"页"
|
|
2156
2264
|
] }),
|
|
2157
2265
|
/* @__PURE__ */ n.jsx(
|
|
2158
|
-
|
|
2266
|
+
tt,
|
|
2159
2267
|
{
|
|
2160
|
-
percent:
|
|
2268
|
+
percent: l.percentage,
|
|
2161
2269
|
type: "line",
|
|
2162
2270
|
size: [160, 8]
|
|
2163
2271
|
}
|
|
@@ -2187,19 +2295,19 @@ const Le = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
2187
2295
|
"div",
|
|
2188
2296
|
{
|
|
2189
2297
|
className: "auto_load_btn",
|
|
2190
|
-
onClick: t ? void 0 :
|
|
2298
|
+
onClick: t ? void 0 : A,
|
|
2191
2299
|
children: [
|
|
2192
|
-
|
|
2300
|
+
a || /* @__PURE__ */ n.jsx("img", { src: De, alt: "自动加载", width: 14, height: 14 }),
|
|
2193
2301
|
/* @__PURE__ */ n.jsx("span", { children: "自动加载" })
|
|
2194
2302
|
]
|
|
2195
2303
|
}
|
|
2196
2304
|
),
|
|
2197
2305
|
/* @__PURE__ */ n.jsx(
|
|
2198
|
-
|
|
2306
|
+
Ve,
|
|
2199
2307
|
{
|
|
2200
2308
|
value: p,
|
|
2201
|
-
onChange:
|
|
2202
|
-
options:
|
|
2309
|
+
onChange: r,
|
|
2310
|
+
options: Lt,
|
|
2203
2311
|
disabled: t,
|
|
2204
2312
|
size: "small",
|
|
2205
2313
|
className: "auto_load_select",
|
|
@@ -2209,36 +2317,36 @@ const Le = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
2209
2317
|
]
|
|
2210
2318
|
}
|
|
2211
2319
|
)
|
|
2212
|
-
] }),
|
|
2320
|
+
] }), Bt = ({
|
|
2213
2321
|
current: t,
|
|
2214
2322
|
loadIcon: p,
|
|
2215
|
-
pageSize:
|
|
2216
|
-
total:
|
|
2217
|
-
cachedPages:
|
|
2323
|
+
pageSize: l,
|
|
2324
|
+
total: a,
|
|
2325
|
+
cachedPages: r,
|
|
2218
2326
|
loadedCount: m,
|
|
2219
|
-
autoLoading:
|
|
2327
|
+
autoLoading: A = !1,
|
|
2220
2328
|
loadingProgress: g,
|
|
2221
|
-
onChange:
|
|
2329
|
+
onChange: i,
|
|
2222
2330
|
onLoadNextPage: e,
|
|
2223
2331
|
onStartAutoLoad: x,
|
|
2224
2332
|
onStopLoading: u
|
|
2225
2333
|
}) => {
|
|
2226
|
-
const [
|
|
2227
|
-
{ length:
|
|
2228
|
-
(
|
|
2229
|
-
).filter((
|
|
2230
|
-
const
|
|
2231
|
-
return
|
|
2334
|
+
const [q, d] = J(5), o = Math.ceil(a / l), S = Ge(() => r.length >= o, [r, o]), c = () => Array.from(
|
|
2335
|
+
{ length: o },
|
|
2336
|
+
($, b) => b + 1
|
|
2337
|
+
).filter(($) => !r.includes($)).slice(0, q), w = (k, $, b) => {
|
|
2338
|
+
const V = r.includes(k);
|
|
2339
|
+
return $ === "prev" || $ === "next" || $ === "jump-prev" || $ === "jump-next" ? /* @__PURE__ */ n.jsx("div", { className: "pageBox", children: b }) : /* @__PURE__ */ n.jsxs(
|
|
2232
2340
|
"div",
|
|
2233
2341
|
{
|
|
2234
2342
|
className: "pageBox",
|
|
2235
2343
|
style: {
|
|
2236
|
-
backgroundColor: t ===
|
|
2237
|
-
color: t ===
|
|
2344
|
+
backgroundColor: t === k ? "#2563EB" : "#f5f5f5",
|
|
2345
|
+
color: t === k ? "#fff" : V ? "#171717" : "#a3a3a3"
|
|
2238
2346
|
},
|
|
2239
2347
|
children: [
|
|
2240
|
-
|
|
2241
|
-
!
|
|
2348
|
+
k,
|
|
2349
|
+
!V && /* @__PURE__ */ n.jsx("span", { className: "unload_spot" })
|
|
2242
2350
|
]
|
|
2243
2351
|
}
|
|
2244
2352
|
);
|
|
@@ -2247,7 +2355,7 @@ const Le = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
2247
2355
|
/* @__PURE__ */ n.jsxs("div", { className: "pagination_leftWrap", children: [
|
|
2248
2356
|
/* @__PURE__ */ n.jsxs("span", { className: "pagination_total", children: [
|
|
2249
2357
|
/* @__PURE__ */ n.jsx(
|
|
2250
|
-
|
|
2358
|
+
it,
|
|
2251
2359
|
{
|
|
2252
2360
|
style: { color: "#2563EB", marginRight: "4px" }
|
|
2253
2361
|
}
|
|
@@ -2255,97 +2363,97 @@ const Le = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAA
|
|
|
2255
2363
|
"已加载: ",
|
|
2256
2364
|
m,
|
|
2257
2365
|
"/",
|
|
2258
|
-
|
|
2366
|
+
a,
|
|
2259
2367
|
"条数据"
|
|
2260
2368
|
] }),
|
|
2261
|
-
!
|
|
2262
|
-
|
|
2369
|
+
!S && /* @__PURE__ */ n.jsx(
|
|
2370
|
+
Pt,
|
|
2263
2371
|
{
|
|
2264
2372
|
loadIcon: p || void 0,
|
|
2265
|
-
autoLoading:
|
|
2266
|
-
batchSize:
|
|
2373
|
+
autoLoading: A,
|
|
2374
|
+
batchSize: q,
|
|
2267
2375
|
loadingProgress: g,
|
|
2268
2376
|
disabled: !e || !x,
|
|
2269
2377
|
onBatchSizeChange: d,
|
|
2270
2378
|
onLoadNextPage: () => e?.(),
|
|
2271
2379
|
onStartAutoLoad: () => {
|
|
2272
|
-
const
|
|
2273
|
-
x?.(
|
|
2380
|
+
const k = c();
|
|
2381
|
+
x?.(k);
|
|
2274
2382
|
},
|
|
2275
2383
|
onStopLoad: () => u?.()
|
|
2276
2384
|
}
|
|
2277
2385
|
)
|
|
2278
2386
|
] }),
|
|
2279
2387
|
/* @__PURE__ */ n.jsx(
|
|
2280
|
-
|
|
2388
|
+
nt,
|
|
2281
2389
|
{
|
|
2282
2390
|
current: t,
|
|
2283
|
-
pageSize:
|
|
2284
|
-
total:
|
|
2285
|
-
onChange: (
|
|
2391
|
+
pageSize: l,
|
|
2392
|
+
total: a,
|
|
2393
|
+
onChange: (k) => i(k),
|
|
2286
2394
|
showSizeChanger: !1,
|
|
2287
2395
|
showQuickJumper: !1,
|
|
2288
|
-
showTotal: (
|
|
2289
|
-
itemRender:
|
|
2396
|
+
showTotal: (k, $) => "",
|
|
2397
|
+
itemRender: w
|
|
2290
2398
|
}
|
|
2291
2399
|
)
|
|
2292
2400
|
] });
|
|
2293
|
-
},
|
|
2401
|
+
}, Ot = (t) => {
|
|
2294
2402
|
const {
|
|
2295
2403
|
loading: p,
|
|
2296
|
-
autoLoading:
|
|
2297
|
-
loadingProgress:
|
|
2298
|
-
columns:
|
|
2404
|
+
autoLoading: l,
|
|
2405
|
+
loadingProgress: a,
|
|
2406
|
+
columns: r = [],
|
|
2299
2407
|
dataSource: m = [],
|
|
2300
|
-
total:
|
|
2408
|
+
total: A,
|
|
2301
2409
|
current: g,
|
|
2302
|
-
pageSize:
|
|
2410
|
+
pageSize: i,
|
|
2303
2411
|
cachedPages: e,
|
|
2304
2412
|
onChangePage: x,
|
|
2305
2413
|
onLoadNextPage: u,
|
|
2306
|
-
onStartAutoLoad:
|
|
2414
|
+
onStartAutoLoad: q,
|
|
2307
2415
|
onStopLoading: d,
|
|
2308
|
-
...
|
|
2309
|
-
} = t,
|
|
2310
|
-
(
|
|
2311
|
-
x(
|
|
2312
|
-
key: `${(
|
|
2416
|
+
...o
|
|
2417
|
+
} = t, S = z(null), c = W(
|
|
2418
|
+
(w) => {
|
|
2419
|
+
x(w), e.includes(w) && S.current?.scrollTo({
|
|
2420
|
+
key: `${(w - 1) * i + 1}`
|
|
2313
2421
|
});
|
|
2314
2422
|
},
|
|
2315
2423
|
[g]
|
|
2316
2424
|
);
|
|
2317
2425
|
return /* @__PURE__ */ n.jsxs("div", { className: "flex flex-col", children: [
|
|
2318
2426
|
/* @__PURE__ */ n.jsx(
|
|
2319
|
-
|
|
2427
|
+
Ie,
|
|
2320
2428
|
{
|
|
2321
|
-
ref:
|
|
2322
|
-
...
|
|
2323
|
-
columns:
|
|
2429
|
+
ref: S,
|
|
2430
|
+
...o,
|
|
2431
|
+
columns: r,
|
|
2324
2432
|
dataSource: m,
|
|
2325
2433
|
pagination: !1,
|
|
2326
2434
|
virtual: !0
|
|
2327
2435
|
}
|
|
2328
2436
|
),
|
|
2329
2437
|
/* @__PURE__ */ n.jsx(
|
|
2330
|
-
|
|
2438
|
+
Bt,
|
|
2331
2439
|
{
|
|
2332
2440
|
loading: p,
|
|
2333
|
-
autoLoading:
|
|
2334
|
-
loadingProgress:
|
|
2441
|
+
autoLoading: l,
|
|
2442
|
+
loadingProgress: a,
|
|
2335
2443
|
current: g,
|
|
2336
|
-
pageSize:
|
|
2337
|
-
total:
|
|
2444
|
+
pageSize: i,
|
|
2445
|
+
total: A,
|
|
2338
2446
|
loadedCount: m.length,
|
|
2339
2447
|
cachedPages: e,
|
|
2340
2448
|
onChange: c,
|
|
2341
2449
|
onLoadNextPage: u,
|
|
2342
|
-
onStartAutoLoad:
|
|
2450
|
+
onStartAutoLoad: q,
|
|
2343
2451
|
onStopLoading: d
|
|
2344
2452
|
}
|
|
2345
2453
|
)
|
|
2346
2454
|
] });
|
|
2347
2455
|
};
|
|
2348
|
-
|
|
2456
|
+
Ot.__docgenInfo = {
|
|
2349
2457
|
displayName: "VirtualTable",
|
|
2350
2458
|
description: "虚拟滚动表格组件,支持分页、数据缓存和自动加载功能。",
|
|
2351
2459
|
props: {
|
|
@@ -2452,79 +2560,79 @@ _t.__docgenInfo = {
|
|
|
2452
2560
|
}
|
|
2453
2561
|
}
|
|
2454
2562
|
};
|
|
2455
|
-
const
|
|
2563
|
+
const Mt = ({
|
|
2456
2564
|
texts: t = [],
|
|
2457
2565
|
placeholder: p = "请输入内容",
|
|
2458
|
-
animationSpeed:
|
|
2459
|
-
autoPlay:
|
|
2460
|
-
value:
|
|
2566
|
+
animationSpeed: l = 100,
|
|
2567
|
+
autoPlay: a = !0,
|
|
2568
|
+
value: r,
|
|
2461
2569
|
onChange: m,
|
|
2462
|
-
...
|
|
2570
|
+
...A
|
|
2463
2571
|
}) => {
|
|
2464
|
-
const [g,
|
|
2465
|
-
|
|
2466
|
-
|
|
2572
|
+
const [g, i] = J(""), [e, x] = J(0), [u, q] = J(!1), [d, o] = J(!1), [S, c] = J(!1), w = z(void 0), k = z(void 0), $ = z(t), b = z(e), V = z(d), _ = z(g);
|
|
2573
|
+
oe(() => {
|
|
2574
|
+
$.current = t, b.current = e, V.current = d, _.current = g;
|
|
2467
2575
|
});
|
|
2468
|
-
const
|
|
2469
|
-
let
|
|
2576
|
+
const P = W((T, I) => {
|
|
2577
|
+
let Q = 0;
|
|
2470
2578
|
c(!0);
|
|
2579
|
+
const ee = () => {
|
|
2580
|
+
Q < T.length ? (i(T.slice(0, Q + 1)), Q++, k.current = window.setTimeout(ee, l)) : (c(!1), I?.());
|
|
2581
|
+
};
|
|
2582
|
+
ee();
|
|
2583
|
+
}, [l]), D = W((T) => {
|
|
2584
|
+
let I = _.current.length;
|
|
2471
2585
|
const Q = () => {
|
|
2472
|
-
|
|
2586
|
+
I > 0 ? (i(_.current.slice(0, I - 1)), I--, k.current = window.setTimeout(Q, l / 2)) : T?.();
|
|
2473
2587
|
};
|
|
2474
2588
|
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);
|
|
2589
|
+
}, [l]), B = W(() => {
|
|
2590
|
+
if ($.current.length === 0 || V.current) return;
|
|
2591
|
+
q(!0);
|
|
2592
|
+
const T = $.current[b.current];
|
|
2593
|
+
_.current ? D(() => {
|
|
2594
|
+
P(T, () => {
|
|
2595
|
+
w.current = window.setTimeout(() => {
|
|
2596
|
+
x((I) => (I + 1) % $.current.length), q(!1);
|
|
2489
2597
|
}, 2e3);
|
|
2490
2598
|
});
|
|
2491
|
-
}) :
|
|
2492
|
-
|
|
2493
|
-
x((
|
|
2599
|
+
}) : P(T, () => {
|
|
2600
|
+
w.current = window.setTimeout(() => {
|
|
2601
|
+
x((I) => (I + 1) % $.current.length), q(!1);
|
|
2494
2602
|
}, 2e3);
|
|
2495
2603
|
});
|
|
2496
|
-
}, [D,
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
}), [e, d,
|
|
2500
|
-
!u &&
|
|
2501
|
-
}, [e, u,
|
|
2502
|
-
const
|
|
2503
|
-
|
|
2504
|
-
},
|
|
2505
|
-
|
|
2506
|
-
},
|
|
2507
|
-
m?.(
|
|
2508
|
-
}, Z = () => d ||
|
|
2604
|
+
}, [D, P]);
|
|
2605
|
+
oe(() => (a && t.length > 0 && !d && B(), () => {
|
|
2606
|
+
w.current && window.clearTimeout(w.current), k.current && window.clearTimeout(k.current);
|
|
2607
|
+
}), [e, d, a, t.length, B]), oe(() => {
|
|
2608
|
+
!u && a && t.length > 0 && !d && B();
|
|
2609
|
+
}, [e, u, a, t.length, d, B]);
|
|
2610
|
+
const U = (T) => {
|
|
2611
|
+
o(!0), w.current && window.clearTimeout(w.current), k.current && window.clearTimeout(k.current), q(!1), c(!1), A.onFocus?.(T);
|
|
2612
|
+
}, H = (T) => {
|
|
2613
|
+
o(!1), !r && t.length > 0 && (i(""), x(0)), A.onBlur?.(T);
|
|
2614
|
+
}, X = (T) => {
|
|
2615
|
+
m?.(T.target.value), A.onChange?.(T);
|
|
2616
|
+
}, Z = () => d || r ? p : g || p;
|
|
2509
2617
|
return /* @__PURE__ */ n.jsxs("div", { style: { position: "relative" }, children: [
|
|
2510
2618
|
/* @__PURE__ */ n.jsx(
|
|
2511
|
-
|
|
2619
|
+
Fe,
|
|
2512
2620
|
{
|
|
2513
|
-
...
|
|
2514
|
-
value:
|
|
2515
|
-
onChange:
|
|
2516
|
-
onFocus:
|
|
2517
|
-
onBlur:
|
|
2621
|
+
...A,
|
|
2622
|
+
value: r,
|
|
2623
|
+
onChange: X,
|
|
2624
|
+
onFocus: U,
|
|
2625
|
+
onBlur: H,
|
|
2518
2626
|
placeholder: Z(),
|
|
2519
2627
|
style: {
|
|
2520
2628
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2521
|
-
...
|
|
2629
|
+
...A.style,
|
|
2522
2630
|
position: "relative",
|
|
2523
2631
|
zIndex: 1
|
|
2524
2632
|
}
|
|
2525
2633
|
}
|
|
2526
2634
|
),
|
|
2527
|
-
!d && !
|
|
2635
|
+
!d && !r && g && /* @__PURE__ */ n.jsxs(
|
|
2528
2636
|
"div",
|
|
2529
2637
|
{
|
|
2530
2638
|
style: {
|
|
@@ -2545,7 +2653,7 @@ const Rt = ({
|
|
|
2545
2653
|
},
|
|
2546
2654
|
children: [
|
|
2547
2655
|
/* @__PURE__ */ n.jsx("span", { children: g }),
|
|
2548
|
-
|
|
2656
|
+
S && /* @__PURE__ */ n.jsx(
|
|
2549
2657
|
"span",
|
|
2550
2658
|
{
|
|
2551
2659
|
style: {
|
|
@@ -2569,7 +2677,7 @@ const Rt = ({
|
|
|
2569
2677
|
` })
|
|
2570
2678
|
] });
|
|
2571
2679
|
};
|
|
2572
|
-
|
|
2680
|
+
Mt.__docgenInfo = {
|
|
2573
2681
|
displayName: "DynamicInput",
|
|
2574
2682
|
description: "动态文案输入框组件,支持流式文字动画效果",
|
|
2575
2683
|
props: {
|
|
@@ -2614,24 +2722,24 @@ Rt.__docgenInfo = {
|
|
|
2614
2722
|
}
|
|
2615
2723
|
}
|
|
2616
2724
|
};
|
|
2617
|
-
const
|
|
2725
|
+
const Dt = ({
|
|
2618
2726
|
texts: t = [],
|
|
2619
2727
|
// 动态文案数组,默认为空数组
|
|
2620
2728
|
placeholder: p = "请输入内容",
|
|
2621
2729
|
// 占位符文本
|
|
2622
|
-
animationSpeed:
|
|
2730
|
+
animationSpeed: l = 100,
|
|
2623
2731
|
// 打字机动画速度,毫秒
|
|
2624
|
-
autoPlay:
|
|
2732
|
+
autoPlay: a = !0,
|
|
2625
2733
|
// 是否自动播放动画
|
|
2626
|
-
value:
|
|
2734
|
+
value: r = "",
|
|
2627
2735
|
// 受控模式的值
|
|
2628
2736
|
onChange: m,
|
|
2629
2737
|
// 受控模式的变化回调
|
|
2630
|
-
onSubmit:
|
|
2738
|
+
onSubmit: A,
|
|
2631
2739
|
// 提交回调
|
|
2632
2740
|
maxLength: g = 500,
|
|
2633
2741
|
// 最大字符数限制
|
|
2634
|
-
showCount:
|
|
2742
|
+
showCount: i = !0,
|
|
2635
2743
|
// 是否显示字数统计
|
|
2636
2744
|
submitText: e = "发送",
|
|
2637
2745
|
// 提交按钮文本
|
|
@@ -2639,78 +2747,78 @@ const It = ({
|
|
|
2639
2747
|
// 是否禁用组件
|
|
2640
2748
|
rows: u = 4,
|
|
2641
2749
|
// 文本域行数
|
|
2642
|
-
style:
|
|
2750
|
+
style: q,
|
|
2643
2751
|
// 自定义样式
|
|
2644
2752
|
...d
|
|
2645
2753
|
// 其他原生属性
|
|
2646
2754
|
}) => {
|
|
2647
|
-
const [
|
|
2648
|
-
|
|
2649
|
-
|
|
2755
|
+
const [o, S] = 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);
|
|
2756
|
+
oe(() => {
|
|
2757
|
+
X.current = t, Z.current = c, T.current = b, I.current = o;
|
|
2650
2758
|
});
|
|
2651
|
-
const
|
|
2652
|
-
let
|
|
2653
|
-
|
|
2654
|
-
const
|
|
2655
|
-
|
|
2759
|
+
const ee = W((O, G) => {
|
|
2760
|
+
let ue = 0;
|
|
2761
|
+
P(!0);
|
|
2762
|
+
const ve = () => {
|
|
2763
|
+
ue < O.length ? (S(O.slice(0, ue + 1)), ue++, H.current = window.setTimeout(ve, l)) : (P(!1), G?.());
|
|
2656
2764
|
};
|
|
2657
|
-
|
|
2658
|
-
}, [
|
|
2659
|
-
let
|
|
2660
|
-
const
|
|
2661
|
-
|
|
2765
|
+
ve();
|
|
2766
|
+
}, [l]), pe = W((O) => {
|
|
2767
|
+
let G = I.current.length;
|
|
2768
|
+
const ue = () => {
|
|
2769
|
+
G > 0 ? (S(I.current.slice(0, G - 1)), G--, H.current = window.setTimeout(ue, l / 2)) : O?.();
|
|
2662
2770
|
};
|
|
2663
|
-
|
|
2664
|
-
}, [
|
|
2665
|
-
if (
|
|
2666
|
-
|
|
2667
|
-
const O =
|
|
2668
|
-
|
|
2669
|
-
|
|
2670
|
-
|
|
2671
|
-
|
|
2771
|
+
ue();
|
|
2772
|
+
}, [l]), he = W(() => {
|
|
2773
|
+
if (X.current.length === 0 || T.current) return;
|
|
2774
|
+
$(!0);
|
|
2775
|
+
const O = X.current[Z.current];
|
|
2776
|
+
I.current ? pe(() => {
|
|
2777
|
+
ee(O, () => {
|
|
2778
|
+
U.current = window.setTimeout(() => {
|
|
2779
|
+
w((G) => (G + 1) % X.current.length), $(!1);
|
|
2672
2780
|
}, 2e3);
|
|
2673
2781
|
});
|
|
2674
|
-
}) :
|
|
2675
|
-
|
|
2676
|
-
|
|
2782
|
+
}) : ee(O, () => {
|
|
2783
|
+
U.current = window.setTimeout(() => {
|
|
2784
|
+
w((G) => (G + 1) % X.current.length), $(!1);
|
|
2677
2785
|
}, 2e3);
|
|
2678
2786
|
});
|
|
2679
|
-
}, [
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
}), [c,
|
|
2683
|
-
!
|
|
2684
|
-
}, [c,
|
|
2787
|
+
}, [pe, ee]);
|
|
2788
|
+
oe(() => (a && t.length > 0 && !b && he(), () => {
|
|
2789
|
+
U.current && window.clearTimeout(U.current), H.current && window.clearTimeout(H.current);
|
|
2790
|
+
}), [c, b, a, t.length, he]), oe(() => {
|
|
2791
|
+
!k && a && t.length > 0 && !b && he();
|
|
2792
|
+
}, [c, k, a, t.length, b, he]);
|
|
2685
2793
|
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", ...
|
|
2794
|
+
V(!0), U.current && window.clearTimeout(U.current), H.current && window.clearTimeout(H.current), $(!1), P(!1), d.onFocus?.(O);
|
|
2795
|
+
}, L = (O) => {
|
|
2796
|
+
V(!1), !r && t.length > 0 && (S(""), w(0)), d.onBlur?.(O);
|
|
2797
|
+
}, K = (O) => {
|
|
2798
|
+
const G = O.target.value;
|
|
2799
|
+
g && G.length > g || (m ? m(G) : B(G), d.onChange?.(O));
|
|
2800
|
+
}, ae = () => {
|
|
2801
|
+
const O = m ? r : D;
|
|
2802
|
+
O.trim() && !x && (A?.(O), m || B(""));
|
|
2803
|
+
}, ye = (O) => {
|
|
2804
|
+
(O.ctrlKey || O.metaKey) && O.key === "Enter" && (O.preventDefault(), ae()), d.onKeyDown?.(O);
|
|
2805
|
+
}, ce = m ? r : D, be = x || !ce.trim() || (g ? ce.length > g : !1);
|
|
2806
|
+
return /* @__PURE__ */ n.jsxs("div", { style: { position: "relative", ...q }, children: [
|
|
2699
2807
|
/* @__PURE__ */ n.jsxs("div", { style: { position: "relative" }, children: [
|
|
2700
2808
|
/* @__PURE__ */ n.jsx(
|
|
2701
2809
|
"textarea",
|
|
2702
2810
|
{
|
|
2703
|
-
ref:
|
|
2704
|
-
value: m ?
|
|
2705
|
-
onChange:
|
|
2811
|
+
ref: Q,
|
|
2812
|
+
value: m ? r : D,
|
|
2813
|
+
onChange: K,
|
|
2706
2814
|
onFocus: (O) => {
|
|
2707
2815
|
O.target.style.borderColor = "#1890ff", O.target.style.boxShadow = "0 0 0 2px rgba(24, 144, 255, 0.2)", s(O);
|
|
2708
2816
|
},
|
|
2709
2817
|
onBlur: (O) => {
|
|
2710
|
-
O.target.style.borderColor = "#d9d9d9", O.target.style.boxShadow = "none",
|
|
2818
|
+
O.target.style.borderColor = "#d9d9d9", O.target.style.boxShadow = "none", L(O);
|
|
2711
2819
|
},
|
|
2712
|
-
onKeyDown:
|
|
2713
|
-
placeholder:
|
|
2820
|
+
onKeyDown: ye,
|
|
2821
|
+
placeholder: b || ce ? p : "",
|
|
2714
2822
|
maxLength: g,
|
|
2715
2823
|
rows: u,
|
|
2716
2824
|
disabled: x,
|
|
@@ -2734,7 +2842,7 @@ const It = ({
|
|
|
2734
2842
|
...d
|
|
2735
2843
|
}
|
|
2736
2844
|
),
|
|
2737
|
-
!
|
|
2845
|
+
!b && !ce && o && /* @__PURE__ */ n.jsxs(
|
|
2738
2846
|
"div",
|
|
2739
2847
|
{
|
|
2740
2848
|
style: {
|
|
@@ -2756,8 +2864,8 @@ const It = ({
|
|
|
2756
2864
|
lineHeight: "1.5"
|
|
2757
2865
|
},
|
|
2758
2866
|
children: [
|
|
2759
|
-
/* @__PURE__ */ n.jsx("span", { children:
|
|
2760
|
-
|
|
2867
|
+
/* @__PURE__ */ n.jsx("span", { children: o }),
|
|
2868
|
+
_ && /* @__PURE__ */ n.jsx(
|
|
2761
2869
|
"span",
|
|
2762
2870
|
{
|
|
2763
2871
|
style: {
|
|
@@ -2783,13 +2891,13 @@ const It = ({
|
|
|
2783
2891
|
zIndex: 3
|
|
2784
2892
|
},
|
|
2785
2893
|
children: /* @__PURE__ */ n.jsx(
|
|
2786
|
-
|
|
2894
|
+
xe,
|
|
2787
2895
|
{
|
|
2788
2896
|
type: "primary",
|
|
2789
2897
|
size: "small",
|
|
2790
|
-
icon: /* @__PURE__ */ n.jsx(
|
|
2791
|
-
onClick:
|
|
2792
|
-
disabled:
|
|
2898
|
+
icon: /* @__PURE__ */ n.jsx(ct, {}),
|
|
2899
|
+
onClick: ae,
|
|
2900
|
+
disabled: be,
|
|
2793
2901
|
style: {
|
|
2794
2902
|
borderRadius: 6,
|
|
2795
2903
|
minWidth: 32,
|
|
@@ -2804,7 +2912,7 @@ const It = ({
|
|
|
2804
2912
|
}
|
|
2805
2913
|
)
|
|
2806
2914
|
] }),
|
|
2807
|
-
|
|
2915
|
+
i && /* @__PURE__ */ n.jsxs(
|
|
2808
2916
|
"div",
|
|
2809
2917
|
{
|
|
2810
2918
|
style: {
|
|
@@ -2814,7 +2922,7 @@ const It = ({
|
|
|
2814
2922
|
color: "#999"
|
|
2815
2923
|
},
|
|
2816
2924
|
children: [
|
|
2817
|
-
|
|
2925
|
+
ce.length,
|
|
2818
2926
|
"/",
|
|
2819
2927
|
g
|
|
2820
2928
|
]
|
|
@@ -2828,7 +2936,7 @@ const It = ({
|
|
|
2828
2936
|
` })
|
|
2829
2937
|
] });
|
|
2830
2938
|
};
|
|
2831
|
-
|
|
2939
|
+
Dt.__docgenInfo = {
|
|
2832
2940
|
displayName: "DynamicTextArea",
|
|
2833
2941
|
description: "动态文案文本域组件,支持流式文字动画效果",
|
|
2834
2942
|
props: {
|
|
@@ -2914,66 +3022,66 @@ It.__docgenInfo = {
|
|
|
2914
3022
|
}
|
|
2915
3023
|
}
|
|
2916
3024
|
};
|
|
2917
|
-
const
|
|
3025
|
+
const ze = ({
|
|
2918
3026
|
src: t,
|
|
2919
3027
|
poster: p,
|
|
2920
|
-
width:
|
|
2921
|
-
height:
|
|
2922
|
-
videoWidth:
|
|
3028
|
+
width: l = 300,
|
|
3029
|
+
height: a,
|
|
3030
|
+
videoWidth: r,
|
|
2923
3031
|
// 参数保留但不使用,由CSS控制
|
|
2924
3032
|
videoHeight: m,
|
|
2925
3033
|
// 参数保留但不使用,由CSS控制
|
|
2926
|
-
showPlayButton:
|
|
3034
|
+
showPlayButton: A = !0,
|
|
2927
3035
|
autoPlayOnHover: g = !0,
|
|
2928
|
-
onClick:
|
|
3036
|
+
onClick: i,
|
|
2929
3037
|
onVideoLoaded: e,
|
|
2930
3038
|
onVideoPlay: x,
|
|
2931
3039
|
onVideoPause: u,
|
|
2932
|
-
onVideoEnded:
|
|
3040
|
+
onVideoEnded: q,
|
|
2933
3041
|
className: d,
|
|
2934
|
-
style:
|
|
2935
|
-
...
|
|
3042
|
+
style: o,
|
|
3043
|
+
...S
|
|
2936
3044
|
}) => {
|
|
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
|
-
}, [
|
|
3045
|
+
const c = z(null), [w, k] = J(!1), [$, b] = J(!1), [V, _] = J(!1), P = W(() => {
|
|
3046
|
+
c.current && (c.current.play(), k(!0), x?.());
|
|
3047
|
+
}, [x]), D = W(() => {
|
|
3048
|
+
c.current && (c.current.pause(), k(!1), u?.());
|
|
3049
|
+
}, [u]), B = W((ee) => {
|
|
3050
|
+
ee.stopPropagation(), w ? D() : P();
|
|
3051
|
+
}, [w, P, D]), U = W(() => {
|
|
3052
|
+
b(!0), g && !w && P();
|
|
3053
|
+
}, [g, w, P]), H = W(() => {
|
|
3054
|
+
b(!1), g && w && D();
|
|
3055
|
+
}, [g, w, D]), X = W(() => {
|
|
3056
|
+
_(!0), e?.();
|
|
3057
|
+
}, [e]), Z = W(() => {
|
|
3058
|
+
k(!0), x?.();
|
|
3059
|
+
}, [x]), T = W(() => {
|
|
3060
|
+
k(!1), u?.();
|
|
3061
|
+
}, [u]), I = W(() => {
|
|
3062
|
+
k(!1), q?.();
|
|
3063
|
+
}, [q]), Q = W((ee) => {
|
|
3064
|
+
i?.(ee);
|
|
3065
|
+
}, [i]);
|
|
2958
3066
|
return /* @__PURE__ */ n.jsx(
|
|
2959
|
-
|
|
3067
|
+
Re,
|
|
2960
3068
|
{
|
|
2961
|
-
...
|
|
3069
|
+
...S,
|
|
2962
3070
|
className: `video-card ${d || ""}`,
|
|
2963
3071
|
style: {
|
|
2964
|
-
width:
|
|
2965
|
-
height:
|
|
3072
|
+
width: l,
|
|
3073
|
+
height: a,
|
|
2966
3074
|
padding: 0,
|
|
2967
3075
|
overflow: "hidden",
|
|
2968
|
-
cursor:
|
|
3076
|
+
cursor: i ? "pointer" : "default",
|
|
2969
3077
|
border: "none",
|
|
2970
3078
|
borderRadius: 0,
|
|
2971
|
-
...
|
|
3079
|
+
...o
|
|
2972
3080
|
},
|
|
2973
3081
|
bordered: !1,
|
|
2974
|
-
onMouseEnter:
|
|
2975
|
-
onMouseLeave:
|
|
2976
|
-
onClick:
|
|
3082
|
+
onMouseEnter: U,
|
|
3083
|
+
onMouseLeave: H,
|
|
3084
|
+
onClick: Q,
|
|
2977
3085
|
children: /* @__PURE__ */ n.jsxs("div", { className: "video-card-container", children: [
|
|
2978
3086
|
/* @__PURE__ */ n.jsx(
|
|
2979
3087
|
"video",
|
|
@@ -2982,28 +3090,28 @@ const Oe = ({
|
|
|
2982
3090
|
src: t,
|
|
2983
3091
|
poster: p,
|
|
2984
3092
|
preload: "metadata",
|
|
2985
|
-
onLoadedData:
|
|
3093
|
+
onLoadedData: X,
|
|
2986
3094
|
onPlay: Z,
|
|
2987
|
-
onPause:
|
|
2988
|
-
onEnded:
|
|
3095
|
+
onPause: T,
|
|
3096
|
+
onEnded: I,
|
|
2989
3097
|
muted: !0,
|
|
2990
3098
|
loop: !0
|
|
2991
3099
|
}
|
|
2992
3100
|
),
|
|
2993
|
-
|
|
3101
|
+
A && /* @__PURE__ */ n.jsx(
|
|
2994
3102
|
"div",
|
|
2995
3103
|
{
|
|
2996
|
-
className: `video-play-button ${
|
|
2997
|
-
onClick:
|
|
2998
|
-
children:
|
|
3104
|
+
className: `video-play-button ${$ ? "hovered" : ""}`,
|
|
3105
|
+
onClick: B,
|
|
3106
|
+
children: w ? /* @__PURE__ */ n.jsx(ut, { className: "play-icon" }) : /* @__PURE__ */ n.jsx(dt, { className: "play-icon" })
|
|
2999
3107
|
}
|
|
3000
3108
|
),
|
|
3001
|
-
!
|
|
3109
|
+
!V && /* @__PURE__ */ n.jsx("div", { className: "video-loading-mask", children: /* @__PURE__ */ n.jsx("div", { className: "loading-spinner" }) })
|
|
3002
3110
|
] })
|
|
3003
3111
|
}
|
|
3004
3112
|
);
|
|
3005
3113
|
};
|
|
3006
|
-
|
|
3114
|
+
ze.__docgenInfo = {
|
|
3007
3115
|
displayName: "VideoCard",
|
|
3008
3116
|
description: "视频卡片组件,支持鼠标悬浮播放控制",
|
|
3009
3117
|
props: {
|
|
@@ -3104,12 +3212,12 @@ Oe.__docgenInfo = {
|
|
|
3104
3212
|
}
|
|
3105
3213
|
}
|
|
3106
3214
|
};
|
|
3107
|
-
const
|
|
3215
|
+
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
3216
|
items: t,
|
|
3109
3217
|
columns: p,
|
|
3110
|
-
gap:
|
|
3111
|
-
responsive:
|
|
3112
|
-
breakpoints:
|
|
3218
|
+
gap: l = 0,
|
|
3219
|
+
responsive: a = !0,
|
|
3220
|
+
breakpoints: r = {
|
|
3113
3221
|
xs: 1,
|
|
3114
3222
|
sm: 2,
|
|
3115
3223
|
md: 3,
|
|
@@ -3118,77 +3226,77 @@ const Lt = (t) => [".mp4", ".webm", ".ogg", ".mov", ".avi", ".wmv", ".flv", ".mk
|
|
|
3118
3226
|
xxl: 6
|
|
3119
3227
|
},
|
|
3120
3228
|
className: m,
|
|
3121
|
-
style:
|
|
3229
|
+
style: A,
|
|
3122
3230
|
onClick: g
|
|
3123
3231
|
}) => {
|
|
3124
|
-
const
|
|
3125
|
-
if (!
|
|
3126
|
-
return p ||
|
|
3232
|
+
const i = z(null), [e, x] = J(p || r.md || 3), u = z(/* @__PURE__ */ new Map()), q = W(() => {
|
|
3233
|
+
if (!a || p)
|
|
3234
|
+
return p || r.md || 3;
|
|
3127
3235
|
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
|
-
|
|
3236
|
+
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;
|
|
3237
|
+
}, [a, p, r]), d = W(() => {
|
|
3238
|
+
if (!i.current) return;
|
|
3239
|
+
const c = e, w = i.current, $ = (w.offsetWidth - l * (c - 1)) / c, b = new Array(c).fill(0);
|
|
3240
|
+
t.forEach((_, P) => {
|
|
3241
|
+
const D = _.id || P, B = u.current.get(D);
|
|
3242
|
+
if (!B) return;
|
|
3243
|
+
const U = Math.min(...b), H = b.indexOf(U), X = H * ($ + l), Z = b[H];
|
|
3244
|
+
B.style.position = "absolute", B.style.left = `${X}px`, B.style.top = `${Z}px`, B.style.width = `${$}px`, b[H] += B.offsetHeight + l;
|
|
3137
3245
|
});
|
|
3138
|
-
const
|
|
3139
|
-
|
|
3140
|
-
}, [t, e,
|
|
3141
|
-
|
|
3246
|
+
const V = Math.max(...b);
|
|
3247
|
+
w.style.height = `${V}px`;
|
|
3248
|
+
}, [t, e, l]);
|
|
3249
|
+
oe(() => {
|
|
3142
3250
|
const c = () => {
|
|
3143
|
-
const
|
|
3144
|
-
|
|
3251
|
+
const w = q();
|
|
3252
|
+
w !== e && x(w);
|
|
3145
3253
|
};
|
|
3146
|
-
if (
|
|
3254
|
+
if (a)
|
|
3147
3255
|
return window.addEventListener("resize", c), c(), () => window.removeEventListener("resize", c);
|
|
3148
|
-
}, [
|
|
3256
|
+
}, [a, q, e]), oe(() => {
|
|
3149
3257
|
const c = setTimeout(() => {
|
|
3150
3258
|
d();
|
|
3151
3259
|
}, 100);
|
|
3152
3260
|
return () => clearTimeout(c);
|
|
3153
3261
|
}, [t, e, d]);
|
|
3154
|
-
const
|
|
3262
|
+
const o = W(() => {
|
|
3155
3263
|
d();
|
|
3156
|
-
}, [d]),
|
|
3264
|
+
}, [d]), S = W((c) => {
|
|
3157
3265
|
g && g(c), c.onClick?.(c);
|
|
3158
3266
|
}, [g]);
|
|
3159
3267
|
return /* @__PURE__ */ n.jsx(
|
|
3160
3268
|
"div",
|
|
3161
3269
|
{
|
|
3162
|
-
ref:
|
|
3270
|
+
ref: i,
|
|
3163
3271
|
className: `waterfall-container ${m || ""}`,
|
|
3164
3272
|
style: {
|
|
3165
3273
|
position: "relative",
|
|
3166
3274
|
width: "100%",
|
|
3167
|
-
...
|
|
3275
|
+
...A
|
|
3168
3276
|
},
|
|
3169
|
-
children: t.map((c,
|
|
3170
|
-
const
|
|
3277
|
+
children: t.map((c, w) => {
|
|
3278
|
+
const k = c.id || w, $ = Ft(c);
|
|
3171
3279
|
return /* @__PURE__ */ n.jsx(
|
|
3172
3280
|
"div",
|
|
3173
3281
|
{
|
|
3174
|
-
ref: (
|
|
3175
|
-
|
|
3282
|
+
ref: (b) => {
|
|
3283
|
+
b ? u.current.set(k, b) : u.current.delete(k);
|
|
3176
3284
|
},
|
|
3177
3285
|
className: "waterfall-item",
|
|
3178
|
-
children:
|
|
3286
|
+
children: $ === "video" ? /* @__PURE__ */ n.jsx("div", { style: {
|
|
3179
3287
|
width: "100%",
|
|
3180
3288
|
position: "relative",
|
|
3181
3289
|
paddingBottom: "56.25%",
|
|
3182
3290
|
cursor: g || c.onClick ? "pointer" : "default"
|
|
3183
3291
|
}, children: /* @__PURE__ */ n.jsx("div", { style: { position: "absolute", top: 0, left: 0, width: "100%", height: "100%" }, children: /* @__PURE__ */ n.jsx(
|
|
3184
|
-
|
|
3292
|
+
ze,
|
|
3185
3293
|
{
|
|
3186
3294
|
src: c.url,
|
|
3187
3295
|
poster: c.poster,
|
|
3188
3296
|
width: "100%",
|
|
3189
3297
|
height: "100%",
|
|
3190
|
-
onClick: () =>
|
|
3191
|
-
onVideoLoaded:
|
|
3298
|
+
onClick: () => S(c),
|
|
3299
|
+
onVideoLoaded: o,
|
|
3192
3300
|
autoPlayOnHover: !0,
|
|
3193
3301
|
showPlayButton: !1
|
|
3194
3302
|
}
|
|
@@ -3196,29 +3304,29 @@ const Lt = (t) => [".mp4", ".webm", ".ogg", ".mov", ".avi", ".wmv", ".flv", ".mk
|
|
|
3196
3304
|
"div",
|
|
3197
3305
|
{
|
|
3198
3306
|
className: "waterfall-image-wrapper",
|
|
3199
|
-
onClick: () =>
|
|
3307
|
+
onClick: () => S(c),
|
|
3200
3308
|
style: { cursor: g || c.onClick ? "pointer" : "default" },
|
|
3201
3309
|
children: /* @__PURE__ */ n.jsx(
|
|
3202
3310
|
"img",
|
|
3203
3311
|
{
|
|
3204
3312
|
src: c.url,
|
|
3205
|
-
alt: `瀑布流图片 ${
|
|
3313
|
+
alt: `瀑布流图片 ${w + 1}`,
|
|
3206
3314
|
className: "waterfall-image",
|
|
3207
|
-
onLoad:
|
|
3208
|
-
onError:
|
|
3315
|
+
onLoad: o,
|
|
3316
|
+
onError: o,
|
|
3209
3317
|
style: { display: "block", width: "100%", height: "auto" }
|
|
3210
3318
|
}
|
|
3211
3319
|
)
|
|
3212
3320
|
}
|
|
3213
3321
|
)
|
|
3214
3322
|
},
|
|
3215
|
-
|
|
3323
|
+
k
|
|
3216
3324
|
);
|
|
3217
3325
|
})
|
|
3218
3326
|
}
|
|
3219
3327
|
);
|
|
3220
3328
|
};
|
|
3221
|
-
|
|
3329
|
+
zt.__docgenInfo = {
|
|
3222
3330
|
displayName: "Waterfall",
|
|
3223
3331
|
description: "瀑布流布局组件,支持图片和视频混合展示",
|
|
3224
3332
|
props: {
|
|
@@ -3274,8 +3382,8 @@ Pt.__docgenInfo = {
|
|
|
3274
3382
|
}
|
|
3275
3383
|
}
|
|
3276
3384
|
};
|
|
3277
|
-
const
|
|
3278
|
-
algorithm:
|
|
3385
|
+
const Yt = {
|
|
3386
|
+
algorithm: at.defaultAlgorithm,
|
|
3279
3387
|
token: {
|
|
3280
3388
|
// 主色
|
|
3281
3389
|
colorPrimary: "#3b82f6",
|
|
@@ -3341,21 +3449,21 @@ const Gt = {
|
|
|
3341
3449
|
}
|
|
3342
3450
|
};
|
|
3343
3451
|
export {
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
|
|
3349
|
-
|
|
3350
|
-
|
|
3351
|
-
|
|
3352
|
-
|
|
3353
|
-
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
|
|
3357
|
-
|
|
3358
|
-
|
|
3359
|
-
|
|
3452
|
+
Ct as AdvancedTable,
|
|
3453
|
+
vt as AppModal,
|
|
3454
|
+
kt as BackButton,
|
|
3455
|
+
gt as Button,
|
|
3456
|
+
ht as Card,
|
|
3457
|
+
Mt as DynamicInput,
|
|
3458
|
+
Dt as DynamicTextArea,
|
|
3459
|
+
Et as EmptyAndSpin,
|
|
3460
|
+
Tt as LinkButton,
|
|
3461
|
+
bt as PageTable,
|
|
3462
|
+
Vt as RichTextEditor,
|
|
3463
|
+
ze as VideoCard,
|
|
3464
|
+
Ot as VirtualTable,
|
|
3465
|
+
zt as Waterfall,
|
|
3466
|
+
wt as XcIcon,
|
|
3467
|
+
Yt as lightTheme
|
|
3360
3468
|
};
|
|
3361
3469
|
//# sourceMappingURL=index.es.js.map
|