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