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