bi-components-library 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,7 +1,8 @@
1
- import me, { useState as j, useRef as z, useMemo as pe, useCallback as v, useEffect as U } from "react";
2
- import { Button as X, Card as te, Modal as ye, Table as le, Flex as ae, Spin as ge, Empty as he, Select as ce, Form as re, Input as ue, Space as be, theme as we } from "antd";
3
- import { createFromIconfontCN as ve, LeftOutlined as xe, SearchOutlined as Re, ReloadOutlined as Te, SendOutlined as Se, PauseCircleOutlined as qe, PlayCircleOutlined as Ce } from "@ant-design/icons";
4
- var ne = { exports: {} }, Z = {};
1
+ import Ne, { useState as z, useRef as W, useMemo as Ce, useCallback as B, useEffect as J } from "react";
2
+ import { Button as le, Card as he, Modal as qe, Table as we, Flex as ge, Spin as Se, Empty as $e, Select as Ee, Form as ue, Input as ke, Space as Re, Dropdown as Ae, Tooltip as _e, theme as je } from "antd";
3
+ import { createFromIconfontCN as Ie, LeftOutlined as Le, SearchOutlined as Ve, ReloadOutlined as Oe, SendOutlined as Pe, PauseCircleOutlined as Me, PlayCircleOutlined as De } from "@ant-design/icons";
4
+ import { createPortal as Ge } from "react-dom";
5
+ var de = { exports: {} }, ie = {};
5
6
  /**
6
7
  * @license React
7
8
  * react-jsx-runtime.production.js
@@ -11,29 +12,29 @@ var ne = { exports: {} }, Z = {};
11
12
  * This source code is licensed under the MIT license found in the
12
13
  * LICENSE file in the root directory of this source tree.
13
14
  */
14
- var oe;
15
- function je() {
16
- if (oe) return Z;
17
- oe = 1;
18
- var n = Symbol.for("react.transitional.element"), s = Symbol.for("react.fragment");
19
- function i(l, o, d) {
20
- var E = null;
21
- if (d !== void 0 && (E = "" + d), o.key !== void 0 && (E = "" + o.key), "key" in o) {
22
- d = {};
23
- for (var m in o)
24
- m !== "key" && (d[m] = o[m]);
25
- } else d = o;
26
- return o = d.ref, {
15
+ var be;
16
+ function Fe() {
17
+ if (be) return ie;
18
+ be = 1;
19
+ var n = Symbol.for("react.transitional.element"), m = Symbol.for("react.fragment");
20
+ function c(a, o, h) {
21
+ var q = null;
22
+ if (h !== void 0 && (q = "" + h), o.key !== void 0 && (q = "" + o.key), "key" in o) {
23
+ h = {};
24
+ for (var p in o)
25
+ p !== "key" && (h[p] = o[p]);
26
+ } else h = o;
27
+ return o = h.ref, {
27
28
  $$typeof: n,
28
- type: l,
29
- key: E,
29
+ type: a,
30
+ key: q,
30
31
  ref: o !== void 0 ? o : null,
31
- props: d
32
+ props: h
32
33
  };
33
34
  }
34
- return Z.Fragment = s, Z.jsx = i, Z.jsxs = i, Z;
35
+ return ie.Fragment = m, ie.jsx = c, ie.jsxs = c, ie;
35
36
  }
36
- var ee = {};
37
+ var ce = {};
37
38
  /**
38
39
  * @license React
39
40
  * react-jsx-runtime.development.js
@@ -43,252 +44,252 @@ var ee = {};
43
44
  * This source code is licensed under the MIT license found in the
44
45
  * LICENSE file in the root directory of this source tree.
45
46
  */
46
- var ie;
47
- function Ee() {
48
- return ie || (ie = 1, process.env.NODE_ENV !== "production" && function() {
49
- function n(e) {
50
- if (e == null) return null;
51
- if (typeof e == "function")
52
- return e.$$typeof === L ? null : e.displayName || e.name || null;
53
- if (typeof e == "string") return e;
54
- switch (e) {
55
- case V:
47
+ var xe;
48
+ function Be() {
49
+ return xe || (xe = 1, process.env.NODE_ENV !== "production" && function() {
50
+ function n(l) {
51
+ if (l == null) return null;
52
+ if (typeof l == "function")
53
+ return l.$$typeof === H ? null : l.displayName || l.name || null;
54
+ if (typeof l == "string") return l;
55
+ switch (l) {
56
+ case v:
56
57
  return "Fragment";
57
- case p:
58
+ case w:
58
59
  return "Profiler";
59
- case a:
60
+ case x:
60
61
  return "StrictMode";
61
- case $:
62
+ case C:
62
63
  return "Suspense";
63
- case D:
64
+ case O:
64
65
  return "SuspenseList";
65
- case x:
66
+ case P:
66
67
  return "Activity";
67
68
  }
68
- if (typeof e == "object")
69
- switch (typeof e.tag == "number" && console.error(
69
+ if (typeof l == "object")
70
+ switch (typeof l.tag == "number" && console.error(
70
71
  "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
71
- ), e.$$typeof) {
72
- case P:
72
+ ), l.$$typeof) {
73
+ case R:
73
74
  return "Portal";
74
- case T:
75
- return (e.displayName || "Context") + ".Provider";
76
- case b:
77
- return (e._context.displayName || "Context") + ".Consumer";
78
- case g:
79
- var u = e.render;
80
- return e = e.displayName, e || (e = u.displayName || u.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
75
+ case $:
76
+ return (l.displayName || "Context") + ".Provider";
81
77
  case A:
82
- return u = e.displayName || null, u !== null ? u : n(e.type) || "Memo";
83
- case F:
84
- u = e._payload, e = e._init;
78
+ return (l._context.displayName || "Context") + ".Consumer";
79
+ case S:
80
+ var r = l.render;
81
+ return l = l.displayName, l || (l = r.displayName || r.name || "", l = l !== "" ? "ForwardRef(" + l + ")" : "ForwardRef"), l;
82
+ case I:
83
+ return r = l.displayName || null, r !== null ? r : n(l.type) || "Memo";
84
+ case D:
85
+ r = l._payload, l = l._init;
85
86
  try {
86
- return n(e(u));
87
+ return n(l(r));
87
88
  } catch {
88
89
  }
89
90
  }
90
91
  return null;
91
92
  }
92
- function s(e) {
93
- return "" + e;
93
+ function m(l) {
94
+ return "" + l;
94
95
  }
95
- function i(e) {
96
+ function c(l) {
96
97
  try {
97
- s(e);
98
- var u = !1;
98
+ m(l);
99
+ var r = !1;
99
100
  } catch {
100
- u = !0;
101
+ r = !0;
101
102
  }
102
- if (u) {
103
- u = console;
104
- var w = u.error, O = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
105
- return w.call(
106
- u,
103
+ if (r) {
104
+ r = console;
105
+ var i = r.error, y = typeof Symbol == "function" && Symbol.toStringTag && l[Symbol.toStringTag] || l.constructor.name || "Object";
106
+ return i.call(
107
+ r,
107
108
  "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
108
- O
109
- ), s(e);
109
+ y
110
+ ), m(l);
110
111
  }
111
112
  }
112
- function l(e) {
113
- if (e === V) return "<>";
114
- if (typeof e == "object" && e !== null && e.$$typeof === F)
113
+ function a(l) {
114
+ if (l === v) return "<>";
115
+ if (typeof l == "object" && l !== null && l.$$typeof === D)
115
116
  return "<...>";
116
117
  try {
117
- var u = n(e);
118
- return u ? "<" + u + ">" : "<...>";
118
+ var r = n(l);
119
+ return r ? "<" + r + ">" : "<...>";
119
120
  } catch {
120
121
  return "<...>";
121
122
  }
122
123
  }
123
124
  function o() {
124
- var e = q.A;
125
- return e === null ? null : e.getOwner();
125
+ var l = G.A;
126
+ return l === null ? null : l.getOwner();
126
127
  }
127
- function d() {
128
+ function h() {
128
129
  return Error("react-stack-top-frame");
129
130
  }
130
- function E(e) {
131
- if (B.call(e, "key")) {
132
- var u = Object.getOwnPropertyDescriptor(e, "key").get;
133
- if (u && u.isReactWarning) return !1;
131
+ function q(l) {
132
+ if (K.call(l, "key")) {
133
+ var r = Object.getOwnPropertyDescriptor(l, "key").get;
134
+ if (r && r.isReactWarning) return !1;
134
135
  }
135
- return e.key !== void 0;
136
+ return l.key !== void 0;
136
137
  }
137
- function m(e, u) {
138
- function w() {
139
- c || (c = !0, console.error(
138
+ function p(l, r) {
139
+ function i() {
140
+ _ || (_ = !0, console.error(
140
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)",
141
- u
142
+ r
142
143
  ));
143
144
  }
144
- w.isReactWarning = !0, Object.defineProperty(e, "key", {
145
- get: w,
145
+ i.isReactWarning = !0, Object.defineProperty(l, "key", {
146
+ get: i,
146
147
  configurable: !0
147
148
  });
148
149
  }
149
- function S() {
150
- var e = n(this.type);
151
- return R[e] || (R[e] = !0, console.error(
150
+ function e() {
151
+ var l = n(this.type);
152
+ return F[l] || (F[l] = !0, console.error(
152
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."
153
- )), e = this.props.ref, e !== void 0 ? e : null;
154
+ )), l = this.props.ref, l !== void 0 ? l : null;
154
155
  }
155
- function _(e, u, w, O, Y, M, Q, f) {
156
- return w = M.ref, e = {
157
- $$typeof: h,
158
- type: e,
159
- key: u,
160
- props: M,
161
- _owner: Y
162
- }, (w !== void 0 ? w : null) !== null ? Object.defineProperty(e, "ref", {
156
+ function t(l, r, i, y, T, g, L, f) {
157
+ return i = g.ref, l = {
158
+ $$typeof: d,
159
+ type: l,
160
+ key: r,
161
+ props: g,
162
+ _owner: T
163
+ }, (i !== void 0 ? i : null) !== null ? Object.defineProperty(l, "ref", {
163
164
  enumerable: !1,
164
- get: S
165
- }) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
165
+ get: e
166
+ }) : Object.defineProperty(l, "ref", { enumerable: !1, value: null }), l._store = {}, Object.defineProperty(l._store, "validated", {
166
167
  configurable: !1,
167
168
  enumerable: !1,
168
169
  writable: !0,
169
170
  value: 0
170
- }), Object.defineProperty(e, "_debugInfo", {
171
+ }), Object.defineProperty(l, "_debugInfo", {
171
172
  configurable: !1,
172
173
  enumerable: !1,
173
174
  writable: !0,
174
175
  value: null
175
- }), Object.defineProperty(e, "_debugStack", {
176
+ }), Object.defineProperty(l, "_debugStack", {
176
177
  configurable: !1,
177
178
  enumerable: !1,
178
179
  writable: !0,
179
- value: Q
180
- }), Object.defineProperty(e, "_debugTask", {
180
+ value: L
181
+ }), Object.defineProperty(l, "_debugTask", {
181
182
  configurable: !1,
182
183
  enumerable: !1,
183
184
  writable: !0,
184
185
  value: f
185
- }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
186
+ }), Object.freeze && (Object.freeze(l.props), Object.freeze(l)), l;
186
187
  }
187
- function k(e, u, w, O, Y, M, Q, f) {
188
- var y = u.children;
189
- if (y !== void 0)
190
- if (O)
191
- if (H(y)) {
192
- for (O = 0; O < y.length; O++)
193
- N(y[O]);
194
- Object.freeze && Object.freeze(y);
188
+ function N(l, r, i, y, T, g, L, f) {
189
+ var b = r.children;
190
+ if (b !== void 0)
191
+ if (y)
192
+ if (Q(b)) {
193
+ for (y = 0; y < b.length; y++)
194
+ s(b[y]);
195
+ Object.freeze && Object.freeze(b);
195
196
  } else
196
197
  console.error(
197
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."
198
199
  );
199
- else N(y);
200
- if (B.call(u, "key")) {
201
- y = n(e);
202
- var W = Object.keys(u).filter(function(fe) {
203
- return fe !== "key";
200
+ else s(b);
201
+ if (K.call(r, "key")) {
202
+ b = n(l);
203
+ var V = Object.keys(r).filter(function(Y) {
204
+ return Y !== "key";
204
205
  });
205
- O = 0 < W.length ? "{key: someKey, " + W.join(": ..., ") + ": ...}" : "{key: someKey}", J[y + O] || (W = 0 < W.length ? "{" + W.join(": ..., ") + ": ...}" : "{}", console.error(
206
+ y = 0 < V.length ? "{key: someKey, " + V.join(": ..., ") + ": ...}" : "{key: someKey}", re[b + y] || (V = 0 < V.length ? "{" + V.join(": ..., ") + ": ...}" : "{}", console.error(
206
207
  `A props object containing a "key" prop is being spread into JSX:
207
208
  let props = %s;
208
209
  <%s {...props} />
209
210
  React keys must be passed directly to JSX without using spread:
210
211
  let props = %s;
211
212
  <%s key={someKey} {...props} />`,
212
- O,
213
213
  y,
214
- W,
215
- y
216
- ), J[y + O] = !0);
214
+ b,
215
+ V,
216
+ b
217
+ ), re[b + y] = !0);
217
218
  }
218
- if (y = null, w !== void 0 && (i(w), y = "" + w), E(u) && (i(u.key), y = "" + u.key), "key" in u) {
219
- w = {};
220
- for (var K in u)
221
- K !== "key" && (w[K] = u[K]);
222
- } else w = u;
223
- return y && m(
224
- w,
225
- typeof e == "function" ? e.displayName || e.name || "Unknown" : e
226
- ), _(
227
- e,
228
- y,
229
- M,
230
- Y,
219
+ if (b = null, i !== void 0 && (c(i), b = "" + i), q(r) && (c(r.key), b = "" + r.key), "key" in r) {
220
+ i = {};
221
+ for (var j in r)
222
+ j !== "key" && (i[j] = r[j]);
223
+ } else i = r;
224
+ return b && p(
225
+ i,
226
+ typeof l == "function" ? l.displayName || l.name || "Unknown" : l
227
+ ), t(
228
+ l,
229
+ b,
230
+ g,
231
+ T,
231
232
  o(),
232
- w,
233
- Q,
233
+ i,
234
+ L,
234
235
  f
235
236
  );
236
237
  }
237
- function N(e) {
238
- typeof e == "object" && e !== null && e.$$typeof === h && e._store && (e._store.validated = 1);
238
+ function s(l) {
239
+ typeof l == "object" && l !== null && l.$$typeof === d && l._store && (l._store.validated = 1);
239
240
  }
240
- var I = me, h = Symbol.for("react.transitional.element"), P = Symbol.for("react.portal"), V = Symbol.for("react.fragment"), a = Symbol.for("react.strict_mode"), p = Symbol.for("react.profiler"), b = Symbol.for("react.consumer"), T = Symbol.for("react.context"), g = Symbol.for("react.forward_ref"), $ = Symbol.for("react.suspense"), D = Symbol.for("react.suspense_list"), A = Symbol.for("react.memo"), F = Symbol.for("react.lazy"), x = Symbol.for("react.activity"), L = Symbol.for("react.client.reference"), q = I.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, B = Object.prototype.hasOwnProperty, H = Array.isArray, t = console.createTask ? console.createTask : function() {
241
+ var k = Ne, d = Symbol.for("react.transitional.element"), R = Symbol.for("react.portal"), v = Symbol.for("react.fragment"), x = Symbol.for("react.strict_mode"), w = Symbol.for("react.profiler"), A = Symbol.for("react.consumer"), $ = Symbol.for("react.context"), S = Symbol.for("react.forward_ref"), C = Symbol.for("react.suspense"), O = Symbol.for("react.suspense_list"), I = Symbol.for("react.memo"), D = Symbol.for("react.lazy"), P = Symbol.for("react.activity"), H = Symbol.for("react.client.reference"), G = k.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, K = Object.prototype.hasOwnProperty, Q = Array.isArray, E = console.createTask ? console.createTask : function() {
241
242
  return null;
242
243
  };
243
- I = {
244
- react_stack_bottom_frame: function(e) {
245
- return e();
244
+ k = {
245
+ react_stack_bottom_frame: function(l) {
246
+ return l();
246
247
  }
247
248
  };
248
- var c, R = {}, C = I.react_stack_bottom_frame.bind(
249
- I,
250
- d
251
- )(), G = t(l(d)), J = {};
252
- ee.Fragment = V, ee.jsx = function(e, u, w, O, Y) {
253
- var M = 1e4 > q.recentlyCreatedOwnerStacks++;
254
- return k(
255
- e,
256
- u,
257
- w,
249
+ var _, F = {}, X = k.react_stack_bottom_frame.bind(
250
+ k,
251
+ h
252
+ )(), ne = E(a(h)), re = {};
253
+ ce.Fragment = v, ce.jsx = function(l, r, i, y, T) {
254
+ var g = 1e4 > G.recentlyCreatedOwnerStacks++;
255
+ return N(
256
+ l,
257
+ r,
258
+ i,
258
259
  !1,
259
- O,
260
- Y,
261
- M ? Error("react-stack-top-frame") : C,
262
- M ? t(l(e)) : G
260
+ y,
261
+ T,
262
+ g ? Error("react-stack-top-frame") : X,
263
+ g ? E(a(l)) : ne
263
264
  );
264
- }, ee.jsxs = function(e, u, w, O, Y) {
265
- var M = 1e4 > q.recentlyCreatedOwnerStacks++;
266
- return k(
267
- e,
268
- u,
269
- w,
265
+ }, ce.jsxs = function(l, r, i, y, T) {
266
+ var g = 1e4 > G.recentlyCreatedOwnerStacks++;
267
+ return N(
268
+ l,
269
+ r,
270
+ i,
270
271
  !0,
271
- O,
272
- Y,
273
- M ? Error("react-stack-top-frame") : C,
274
- M ? t(l(e)) : G
272
+ y,
273
+ T,
274
+ g ? Error("react-stack-top-frame") : X,
275
+ g ? E(a(l)) : ne
275
276
  );
276
277
  };
277
- }()), ee;
278
+ }()), ce;
278
279
  }
279
- var se;
280
- function _e() {
281
- return se || (se = 1, process.env.NODE_ENV === "production" ? ne.exports = je() : ne.exports = Ee()), ne.exports;
280
+ var ve;
281
+ function ze() {
282
+ return ve || (ve = 1, process.env.NODE_ENV === "production" ? de.exports = Fe() : de.exports = Be()), de.exports;
282
283
  }
283
- var r = _e();
284
- const ke = ({
284
+ var u = ze();
285
+ const He = ({
285
286
  variant: n = "primary",
286
- loading: s = !1,
287
- children: i,
288
- ...l
287
+ loading: m = !1,
288
+ children: c,
289
+ ...a
289
290
  }) => {
290
- const o = (d) => {
291
- switch (d) {
291
+ const o = (h) => {
292
+ switch (h) {
292
293
  case "primary":
293
294
  return "primary";
294
295
  case "ghost":
@@ -303,18 +304,18 @@ const ke = ({
303
304
  return "primary";
304
305
  }
305
306
  };
306
- return /* @__PURE__ */ r.jsx(
307
- X,
307
+ return /* @__PURE__ */ u.jsx(
308
+ le,
308
309
  {
309
- ...l,
310
+ ...a,
310
311
  type: o(n),
311
- loading: s,
312
+ loading: m,
312
313
  ghost: n === "ghost",
313
- children: i
314
+ children: c
314
315
  }
315
316
  );
316
317
  };
317
- ke.__docgenInfo = {
318
+ He.__docgenInfo = {
318
319
  displayName: "Button",
319
320
  description: "基础按钮,用于触发操作",
320
321
  props: {
@@ -358,25 +359,25 @@ ke.__docgenInfo = {
358
359
  }
359
360
  }
360
361
  };
361
- const Ne = ({
362
+ const We = ({
362
363
  title: n,
363
- children: s,
364
- bordered: i = !0,
365
- hoverable: l = !1,
364
+ children: m,
365
+ bordered: c = !0,
366
+ hoverable: a = !1,
366
367
  size: o = "default",
367
- ...d
368
- }) => /* @__PURE__ */ r.jsx(
369
- te,
368
+ ...h
369
+ }) => /* @__PURE__ */ u.jsx(
370
+ he,
370
371
  {
371
- ...d,
372
+ ...h,
372
373
  title: n,
373
- bordered: i,
374
- hoverable: l,
374
+ bordered: c,
375
+ hoverable: a,
375
376
  size: o,
376
- children: s
377
+ children: m
377
378
  }
378
379
  );
379
- Ne.__docgenInfo = {
380
+ We.__docgenInfo = {
380
381
  displayName: "Card",
381
382
  description: "卡片容器,用于分组内容",
382
383
  props: {
@@ -427,23 +428,23 @@ Ne.__docgenInfo = {
427
428
  }
428
429
  }
429
430
  };
430
- const Ie = ({
431
+ const Ke = ({
431
432
  showDefaultFooter: n = !0,
432
- ...s
433
+ ...m
433
434
  }) => {
434
- const i = s.footer !== void 0 ? s.footer : n ? (l, { OkBtn: o, CancelBtn: d }) => /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
435
- /* @__PURE__ */ r.jsx(o, {}),
436
- /* @__PURE__ */ r.jsx(d, {})
435
+ const c = m.footer !== void 0 ? m.footer : n ? (a, { OkBtn: o, CancelBtn: h }) => /* @__PURE__ */ u.jsxs(u.Fragment, { children: [
436
+ /* @__PURE__ */ u.jsx(o, {}),
437
+ /* @__PURE__ */ u.jsx(h, {})
437
438
  ] }) : null;
438
- return /* @__PURE__ */ r.jsx(
439
- ye,
439
+ return /* @__PURE__ */ u.jsx(
440
+ qe,
440
441
  {
441
- ...s,
442
- footer: i
442
+ ...m,
443
+ footer: c
443
444
  }
444
445
  );
445
446
  };
446
- Ie.__docgenInfo = {
447
+ Ke.__docgenInfo = {
447
448
  displayName: "AppModal",
448
449
  description: "应用级模态框组件,基于 Ant Design Modal 封装",
449
450
  props: {
@@ -504,29 +505,29 @@ Ie.__docgenInfo = {
504
505
  }
505
506
  }
506
507
  };
507
- const Pe = ({
508
+ const Xe = ({
508
509
  scrollX: n,
509
- showPagination: s = !0,
510
- defaultPageSize: i = 10,
511
- ...l
512
- }) => /* @__PURE__ */ r.jsx(
513
- le,
510
+ showPagination: m = !0,
511
+ defaultPageSize: c = 10,
512
+ ...a
513
+ }) => /* @__PURE__ */ u.jsx(
514
+ we,
514
515
  {
515
- ...l,
516
+ ...a,
516
517
  scroll: {
517
518
  x: n || "max-content",
518
519
  y: "50vh"
519
520
  },
520
- pagination: s ? {
521
+ pagination: m ? {
521
522
  hideOnSinglePage: !0,
522
523
  showSizeChanger: !0,
523
524
  showQuickJumper: !0,
524
- defaultPageSize: i,
525
- ...l.pagination
525
+ defaultPageSize: c,
526
+ ...a.pagination
526
527
  } : !1
527
528
  }
528
529
  );
529
- Pe.__docgenInfo = {
530
+ Xe.__docgenInfo = {
530
531
  displayName: "PageTable",
531
532
  description: "页面级表格组件,高度铺满容器,自动滚动",
532
533
  props: {
@@ -576,30 +577,30 @@ Pe.__docgenInfo = {
576
577
  }
577
578
  }
578
579
  };
579
- const Ve = ve({
580
+ const Ye = Ie({
580
581
  scriptUrl: ["https://at.alicdn.com/t/c/font_4968458_eh91gfr4j9e.js"]
581
- }), Ae = ({
582
+ }), Ue = ({
582
583
  name: n,
583
- size: s,
584
- color: i,
585
- style: l,
584
+ size: m,
585
+ color: c,
586
+ style: a,
586
587
  ...o
587
588
  }) => {
588
- const d = {
589
- fontSize: s,
590
- color: i,
591
- ...l
589
+ const h = {
590
+ fontSize: m,
591
+ color: c,
592
+ ...a
592
593
  };
593
- return /* @__PURE__ */ r.jsx(
594
- Ve,
594
+ return /* @__PURE__ */ u.jsx(
595
+ Ye,
595
596
  {
596
597
  ...o,
597
598
  type: n,
598
- style: d
599
+ style: h
599
600
  }
600
601
  );
601
602
  };
602
- Ae.__docgenInfo = {
603
+ Ue.__docgenInfo = {
603
604
  displayName: "XcIcon",
604
605
  description: "自定义图标组件,基于 iconfont",
605
606
  props: {
@@ -635,43 +636,43 @@ Ae.__docgenInfo = {
635
636
  }
636
637
  }
637
638
  };
638
- const Oe = ({
639
+ const Je = ({
639
640
  loading: n,
640
- description: s = "暂无数据",
641
- className: i,
642
- emptyChildren: l,
641
+ description: m = "暂无数据",
642
+ className: c,
643
+ emptyChildren: a,
643
644
  loadingText: o,
644
- emptyImage: d
645
- }) => n ? /* @__PURE__ */ r.jsxs(
646
- ae,
645
+ emptyImage: h
646
+ }) => n ? /* @__PURE__ */ u.jsxs(
647
+ ge,
647
648
  {
648
- className: `pt-10 w-full ${i || ""}`,
649
+ className: `pt-10 w-full ${c || ""}`,
649
650
  align: "center",
650
651
  justify: "center",
651
652
  vertical: !0,
652
653
  children: [
653
- /* @__PURE__ */ r.jsx(ge, { size: "large" }),
654
- o && /* @__PURE__ */ r.jsx("div", { className: "mt-4 text-gray-500", children: o })
654
+ /* @__PURE__ */ u.jsx(Se, { size: "large" }),
655
+ o && /* @__PURE__ */ u.jsx("div", { className: "mt-4 text-gray-500", children: o })
655
656
  ]
656
657
  }
657
- ) : /* @__PURE__ */ r.jsx(
658
- ae,
658
+ ) : /* @__PURE__ */ u.jsx(
659
+ ge,
659
660
  {
660
- className: `pt-10 w-full ${i || ""}`,
661
+ className: `pt-10 w-full ${c || ""}`,
661
662
  align: "center",
662
663
  justify: "center",
663
- children: /* @__PURE__ */ r.jsx(
664
- he,
664
+ children: /* @__PURE__ */ u.jsx(
665
+ $e,
665
666
  {
666
- image: d,
667
- description: s,
667
+ image: h,
668
+ description: m,
668
669
  imageStyle: { height: 180 },
669
- children: l
670
+ children: a
670
671
  }
671
672
  )
672
673
  }
673
674
  );
674
- Oe.__docgenInfo = {
675
+ Je.__docgenInfo = {
675
676
  displayName: "EmptyAndSpin",
676
677
  description: "空状态和加载状态组合组件",
677
678
  props: {
@@ -714,24 +715,24 @@ Oe.__docgenInfo = {
714
715
  }
715
716
  }
716
717
  };
717
- const ze = ({
718
+ const Qe = ({
718
719
  onClick: n,
719
- showText: s = !1,
720
- className: i,
721
- size: l = "small",
720
+ showText: m = !1,
721
+ className: c,
722
+ size: a = "small",
722
723
  type: o = "default"
723
- }) => /* @__PURE__ */ r.jsx(
724
- X,
724
+ }) => /* @__PURE__ */ u.jsx(
725
+ le,
725
726
  {
726
- size: l,
727
+ size: a,
727
728
  type: o,
728
- icon: /* @__PURE__ */ r.jsx(xe, {}),
729
- className: `cursor-pointer ${i || ""}`,
729
+ icon: /* @__PURE__ */ u.jsx(Le, {}),
730
+ className: `cursor-pointer ${c || ""}`,
730
731
  onClick: n,
731
- children: s && "返回"
732
+ children: m && "返回"
732
733
  }
733
734
  );
734
- ze.__docgenInfo = {
735
+ Qe.__docgenInfo = {
735
736
  displayName: "BackButton",
736
737
  description: "返回按钮组件",
737
738
  props: {
@@ -770,23 +771,23 @@ ze.__docgenInfo = {
770
771
  }
771
772
  }
772
773
  };
773
- const Fe = ({
774
+ const Ze = ({
774
775
  removePadding: n = !0,
775
- className: s,
776
- ...i
776
+ className: m,
777
+ ...c
777
778
  }) => {
778
- const l = n ? `px-0 h-auto ${s || ""}` : s;
779
- return /* @__PURE__ */ r.jsx(
780
- X,
779
+ const a = n ? `px-0 h-auto ${m || ""}` : m;
780
+ return /* @__PURE__ */ u.jsx(
781
+ le,
781
782
  {
782
783
  type: "link",
783
- ...i,
784
- className: l,
785
- children: i.children
784
+ ...c,
785
+ className: a,
786
+ children: c.children
786
787
  }
787
788
  );
788
789
  };
789
- Fe.__docgenInfo = {
790
+ Ze.__docgenInfo = {
790
791
  displayName: "LinkButton",
791
792
  description: "链接样式按钮组件,适用于表格操作列",
792
793
  props: {
@@ -823,129 +824,129 @@ Fe.__docgenInfo = {
823
824
  }
824
825
  }
825
826
  };
826
- const { Option: Le } = ce, Be = ({
827
+ const { Option: et } = Ee, tt = ({
827
828
  columns: n,
828
- request: s,
829
- searchFields: i = [],
830
- showSearch: l = !0,
829
+ request: m,
830
+ searchFields: c = [],
831
+ showSearch: a = !0,
831
832
  showRefresh: o = !0,
832
- defaultPageSize: d = 10,
833
- pageSizeOptions: E = ["10", "20", "50", "100"],
834
- autoLoad: m = !0,
835
- externalParams: S = {},
836
- ..._
833
+ defaultPageSize: h = 10,
834
+ pageSizeOptions: q = ["10", "20", "50", "100"],
835
+ autoLoad: p = !0,
836
+ externalParams: e = {},
837
+ ...t
837
838
  }) => {
838
- const [k, N] = j([]), [I, h] = j(!1), [P, V] = j({
839
+ const [N, s] = z([]), [k, d] = z(!1), [R, v] = z({
839
840
  current: 1,
840
- pageSize: d,
841
+ pageSize: h,
841
842
  total: 0
842
- }), [a, p] = j({}), [b, T] = j({}), [g] = re.useForm(), $ = z(P);
843
- $.current = P;
844
- const D = z(S);
845
- D.current = S;
846
- const A = z(!1), F = pe(() => n.map((t) => {
847
- const { sortable: c, render: R, ...C } = t;
843
+ }), [x, w] = z({}), [A, $] = z({}), [S] = ue.useForm(), C = W(R);
844
+ C.current = R;
845
+ const O = W(e);
846
+ O.current = e;
847
+ const I = W(!1), D = Ce(() => n.map((E) => {
848
+ const { sortable: _, render: F, ...X } = E;
848
849
  return {
849
- ...C,
850
- sorter: c ? !0 : void 0,
851
- render: R || ((G) => G)
850
+ ...X,
851
+ sorter: _ ? !0 : void 0,
852
+ render: F || ((ne) => ne)
852
853
  };
853
- }), [n]), x = v(async (t = {}) => {
854
- if (s) {
855
- h(!0);
854
+ }), [n]), P = B(async (E = {}) => {
855
+ if (m) {
856
+ d(!0);
856
857
  try {
857
- const c = {
858
- page: $.current.current,
859
- pageSize: $.current.pageSize,
860
- sortField: b.field,
861
- sortOrder: b.order,
862
- searchParams: { ...a, ...D.current },
863
- ...t
864
- }, R = await s(c);
865
- R.success && (N(R.data), V((C) => ({
866
- ...C,
867
- total: R.total,
868
- current: c.page || C.current
858
+ const _ = {
859
+ page: C.current.current,
860
+ pageSize: C.current.pageSize,
861
+ sortField: A.field,
862
+ sortOrder: A.order,
863
+ searchParams: { ...x, ...O.current },
864
+ ...E
865
+ }, F = await m(_);
866
+ F.success && (s(F.data), v((X) => ({
867
+ ...X,
868
+ total: F.total,
869
+ current: _.page || X.current
869
870
  })));
870
- } catch (c) {
871
- console.error("加载数据失败:", c);
871
+ } catch (_) {
872
+ console.error("加载数据失败:", _);
872
873
  } finally {
873
- h(!1);
874
+ d(!1);
874
875
  }
875
876
  }
876
- }, [s, b, a]), L = v((t) => {
877
- p(t), V((c) => ({ ...c, current: 1 }));
878
- }, []), q = v(() => {
879
- g.resetFields(), p({}), V((t) => ({ ...t, current: 1 }));
880
- }, [g]), B = v(() => {
881
- x();
882
- }, [x]), H = v((t, c, R) => {
883
- const C = {
884
- current: t.current || 1,
885
- pageSize: t.pageSize || d,
886
- total: t.total || 0
887
- }, G = {
888
- field: R?.field,
889
- order: R?.order
877
+ }, [m, A, x]), H = B((E) => {
878
+ w(E), v((_) => ({ ..._, current: 1 }));
879
+ }, []), G = B(() => {
880
+ S.resetFields(), w({}), v((E) => ({ ...E, current: 1 }));
881
+ }, [S]), K = B(() => {
882
+ P();
883
+ }, [P]), Q = B((E, _, F) => {
884
+ const X = {
885
+ current: E.current || 1,
886
+ pageSize: E.pageSize || h,
887
+ total: E.total || 0
888
+ }, ne = {
889
+ field: F?.field,
890
+ order: F?.order
890
891
  };
891
- V(C), T(G);
892
- }, [d]);
893
- return U(() => {
894
- const t = Object.keys(S).length > 0;
895
- (m && !A.current || t) && (x(), A.current = !0);
896
- }, [m, S, x]), /* @__PURE__ */ r.jsxs("div", { children: [
897
- l && i.length > 0 && /* @__PURE__ */ r.jsx(te, { size: "small", style: { marginBottom: 16 }, children: /* @__PURE__ */ r.jsxs(
898
- re,
892
+ v(X), $(ne);
893
+ }, [h]);
894
+ return J(() => {
895
+ const E = Object.keys(e).length > 0;
896
+ (p && !I.current || E) && (P(), I.current = !0);
897
+ }, [p, e, P]), /* @__PURE__ */ u.jsxs("div", { children: [
898
+ a && c.length > 0 && /* @__PURE__ */ u.jsx(he, { size: "small", style: { marginBottom: 16 }, children: /* @__PURE__ */ u.jsxs(
899
+ ue,
899
900
  {
900
- form: g,
901
+ form: S,
901
902
  layout: "inline",
902
- onFinish: L,
903
- initialValues: i.reduce((t, c) => (c.defaultValue !== void 0 && (t[c.key] = c.defaultValue), t), {}),
903
+ onFinish: H,
904
+ initialValues: c.reduce((E, _) => (_.defaultValue !== void 0 && (E[_.key] = _.defaultValue), E), {}),
904
905
  children: [
905
- i.map((t) => /* @__PURE__ */ r.jsx(re.Item, { name: t.key, label: t.label, children: t.type === "input" ? /* @__PURE__ */ r.jsx(
906
- ue,
906
+ c.map((E) => /* @__PURE__ */ u.jsx(ue.Item, { name: E.key, label: E.label, children: E.type === "input" ? /* @__PURE__ */ u.jsx(
907
+ ke,
907
908
  {
908
- placeholder: t.placeholder || `请输入${t.label}`,
909
+ placeholder: E.placeholder || `请输入${E.label}`,
909
910
  style: { width: 200 }
910
911
  }
911
- ) : /* @__PURE__ */ r.jsx(
912
- ce,
912
+ ) : /* @__PURE__ */ u.jsx(
913
+ Ee,
913
914
  {
914
- placeholder: t.placeholder || `请选择${t.label}`,
915
+ placeholder: E.placeholder || `请选择${E.label}`,
915
916
  style: { width: 200 },
916
917
  allowClear: !0,
917
- children: t.options?.map((c) => /* @__PURE__ */ r.jsx(Le, { value: c.value, children: c.label }, c.value))
918
+ children: E.options?.map((_) => /* @__PURE__ */ u.jsx(et, { value: _.value, children: _.label }, _.value))
918
919
  }
919
- ) }, t.key)),
920
- /* @__PURE__ */ r.jsx(re.Item, { children: /* @__PURE__ */ r.jsxs(be, { children: [
921
- /* @__PURE__ */ r.jsx(X, { type: "primary", htmlType: "submit", icon: /* @__PURE__ */ r.jsx(Re, {}), children: "查询" }),
922
- /* @__PURE__ */ r.jsx(X, { onClick: q, children: "重置" }),
923
- o && /* @__PURE__ */ r.jsx(X, { icon: /* @__PURE__ */ r.jsx(Te, {}), onClick: B, children: "刷新" })
920
+ ) }, E.key)),
921
+ /* @__PURE__ */ u.jsx(ue.Item, { children: /* @__PURE__ */ u.jsxs(Re, { children: [
922
+ /* @__PURE__ */ u.jsx(le, { type: "primary", htmlType: "submit", icon: /* @__PURE__ */ u.jsx(Ve, {}), children: "查询" }),
923
+ /* @__PURE__ */ u.jsx(le, { onClick: G, children: "重置" }),
924
+ o && /* @__PURE__ */ u.jsx(le, { icon: /* @__PURE__ */ u.jsx(Oe, {}), onClick: K, children: "刷新" })
924
925
  ] }) })
925
926
  ]
926
927
  }
927
928
  ) }),
928
- /* @__PURE__ */ r.jsx(
929
- le,
929
+ /* @__PURE__ */ u.jsx(
930
+ we,
930
931
  {
931
- ..._,
932
- columns: F,
933
- dataSource: k,
934
- loading: I,
932
+ ...t,
933
+ columns: D,
934
+ dataSource: N,
935
+ loading: k,
935
936
  pagination: {
936
- ...P,
937
+ ...R,
937
938
  showSizeChanger: !0,
938
939
  showQuickJumper: !0,
939
- showTotal: (t, c) => `第 ${c[0]}-${c[1]} 条/共 ${t} 条`,
940
- pageSizeOptions: E
940
+ showTotal: (E, _) => `第 ${_[0]}-${_[1]} 条/共 ${E} 条`,
941
+ pageSizeOptions: q
941
942
  },
942
- onChange: H,
943
+ onChange: Q,
943
944
  scroll: { x: "max-content", y: "50vh" }
944
945
  }
945
946
  )
946
947
  ] });
947
948
  };
948
- Be.__docgenInfo = {
949
+ tt.__docgenInfo = {
949
950
  displayName: "AdvancedTable",
950
951
  description: "高阶表格组件,支持异步请求、搜索、排序等功能",
951
952
  props: {
@@ -1012,79 +1013,1072 @@ Be.__docgenInfo = {
1012
1013
  }
1013
1014
  }
1014
1015
  };
1015
- const Me = ({
1016
+ function me(n, m, c) {
1017
+ if (!n.current) return;
1018
+ const a = /* @__PURE__ */ new Set(), o = {};
1019
+ for (const s of m)
1020
+ s.exclusionGroup && s.exclusionGroup !== "separator" && (a.add(s.exclusionGroup), o[s.exclusionGroup] || (o[s.exclusionGroup] = []), o[s.exclusionGroup].push({
1021
+ type: s.type,
1022
+ key: s.key,
1023
+ exclusionGroup: s.exclusionGroup
1024
+ }));
1025
+ const h = {};
1026
+ for (const s of a) {
1027
+ h[s] = !1;
1028
+ for (const k of o[s])
1029
+ if (k.type === "upload" && k.key) {
1030
+ if (c[k.key] !== null && c[k.key] !== void 0) {
1031
+ h[s] = !0;
1032
+ break;
1033
+ }
1034
+ } else if (k.type === "variable" && k.key) {
1035
+ const d = n.current.querySelector(
1036
+ `[data-type="variable"][data-key="${k.key}"]`
1037
+ );
1038
+ if (d && d.innerText.replace(/[\u200B\n]/g, "").trim().length > 0) {
1039
+ h[s] = !0;
1040
+ break;
1041
+ }
1042
+ }
1043
+ }
1044
+ const q = m.some((s) => s.exclusionGroup === "separator"), e = Object.keys(h).filter(
1045
+ (s) => h[s]
1046
+ ).length > 0;
1047
+ let t = null;
1048
+ if (e && q) {
1049
+ for (const s of m)
1050
+ if (s.exclusionGroup && s.exclusionGroup !== "separator" && h[s.exclusionGroup]) {
1051
+ t = s.exclusionGroup;
1052
+ break;
1053
+ }
1054
+ }
1055
+ for (const s of a) {
1056
+ const k = n.current.querySelectorAll(
1057
+ `[data-group="${s}"]`
1058
+ );
1059
+ q && e && t ? s === t ? k.forEach((d) => {
1060
+ d.classList.contains("required-upload-group") ? d.style.setProperty("display", "inline-flex", "important") : (d.classList.contains("exclusion-wrapper"), d.style.setProperty("display", "inline-block", "important"));
1061
+ }) : k.forEach((d) => {
1062
+ d.style.display = "none", d.style.setProperty("display", "none", "important");
1063
+ }) : k.forEach((d) => {
1064
+ d.classList.contains("required-upload-group") ? d.style.setProperty("display", "inline-flex", "important") : (d.classList.contains("exclusion-wrapper"), d.style.setProperty("display", "inline-block", "important"));
1065
+ });
1066
+ }
1067
+ n.current.querySelectorAll(
1068
+ '[data-group="separator"]'
1069
+ ).forEach((s) => {
1070
+ s.style.display = e ? "none" : "inline";
1071
+ });
1072
+ }
1073
+ function ye(n, m, c, a) {
1074
+ if (!n.current) {
1075
+ a(!1);
1076
+ return;
1077
+ }
1078
+ const o = [];
1079
+ for (let e = 0; e < m.length; e++) {
1080
+ const t = m[e];
1081
+ if ((t.type === "variable" || t.type === "upload" || t.type === "multi-variable") && t.required && t.key) {
1082
+ o.push({
1083
+ exclusionGroup: t.exclusionGroup || "",
1084
+ key: t.key,
1085
+ type: t.type === "multi-variable" ? "variable" : t.type,
1086
+ isMultiVariable: t.type === "multi-variable"
1087
+ });
1088
+ continue;
1089
+ }
1090
+ if (t.type === "text" && t.className?.includes("rte-text-required") && t.exclusionGroup)
1091
+ for (let N = e + 1; N < m.length; N++) {
1092
+ const s = m[N];
1093
+ if (s.exclusionGroup === t.exclusionGroup && (s.type === "variable" || s.type === "upload") && s.key) {
1094
+ o.push({
1095
+ exclusionGroup: t.exclusionGroup,
1096
+ key: s.key,
1097
+ type: s.type
1098
+ });
1099
+ break;
1100
+ }
1101
+ }
1102
+ }
1103
+ const h = m.some((e) => e.exclusionGroup === "separator");
1104
+ let q = !1;
1105
+ if (h && o.length > 1) {
1106
+ const e = m.findIndex((s) => s.exclusionGroup === "separator"), t = o.filter((s) => m.findIndex(
1107
+ (d) => (d.type === "variable" || d.type === "upload") && d.key === s.key && d.exclusionGroup === s.exclusionGroup
1108
+ ) < e), N = o.filter((s) => m.findIndex(
1109
+ (d) => (d.type === "variable" || d.type === "upload") && d.key === s.key && d.exclusionGroup === s.exclusionGroup
1110
+ ) > e);
1111
+ q = t.length > 0 && N.length > 0;
1112
+ }
1113
+ if (o.length === 0) {
1114
+ a(!0);
1115
+ return;
1116
+ }
1117
+ const p = o.filter((e) => {
1118
+ if (!n.current) return !1;
1119
+ const t = n.current.querySelectorAll(
1120
+ `[data-group="${e.exclusionGroup}"]`
1121
+ );
1122
+ return t.length === 0 ? !1 : t[0].style.display !== "none";
1123
+ });
1124
+ if (p.length === 0) {
1125
+ a(!0);
1126
+ return;
1127
+ }
1128
+ if (q) {
1129
+ let e = !1;
1130
+ for (const t of p)
1131
+ if (t.type === "upload" && t.key) {
1132
+ if (c[t.key] !== null && c[t.key] !== void 0) {
1133
+ e = !0;
1134
+ break;
1135
+ }
1136
+ } else if (t.type === "variable" && t.key)
1137
+ if (t.isMultiVariable) {
1138
+ const N = n.current.querySelectorAll(
1139
+ `[data-type="variable"][data-multi-key="${t.key}"]`
1140
+ );
1141
+ let s = !1;
1142
+ for (const k of Array.from(N))
1143
+ if (k.innerText.replace(/[\u200B\n]/g, "").trim().length > 0) {
1144
+ s = !0;
1145
+ break;
1146
+ }
1147
+ if (s) {
1148
+ e = !0;
1149
+ break;
1150
+ }
1151
+ } else {
1152
+ const N = n.current.querySelector(
1153
+ `[data-type="variable"][data-key="${t.key}"]`
1154
+ );
1155
+ if (N && N.innerText.replace(/[\u200B\n]/g, "").trim().length > 0) {
1156
+ e = !0;
1157
+ break;
1158
+ }
1159
+ }
1160
+ a(e);
1161
+ } else {
1162
+ let e = !0;
1163
+ for (const t of p)
1164
+ if (t.type === "upload" && t.key) {
1165
+ if (c[t.key] === null || c[t.key] === void 0) {
1166
+ e = !1;
1167
+ break;
1168
+ }
1169
+ } else if (t.type === "variable" && t.key)
1170
+ if (t.isMultiVariable) {
1171
+ const N = n.current.querySelectorAll(
1172
+ `[data-type="variable"][data-multi-key="${t.key}"]`
1173
+ );
1174
+ let s = !1;
1175
+ for (const k of Array.from(N))
1176
+ if (k.innerText.replace(/[\u200B\n]/g, "").trim().length > 0) {
1177
+ s = !0;
1178
+ break;
1179
+ }
1180
+ if (!s) {
1181
+ e = !1;
1182
+ break;
1183
+ }
1184
+ } else {
1185
+ const N = n.current.querySelector(
1186
+ `[data-type="variable"][data-key="${t.key}"]`
1187
+ );
1188
+ if (!N) {
1189
+ e = !1;
1190
+ break;
1191
+ }
1192
+ if (N.innerText.replace(/[\u200B\n]/g, "").trim().length === 0) {
1193
+ e = !1;
1194
+ break;
1195
+ }
1196
+ }
1197
+ a(e);
1198
+ }
1199
+ }
1200
+ function fe(n, m) {
1201
+ if (!n.current) return;
1202
+ n.current.querySelectorAll('[data-type="variable"]').forEach((a) => {
1203
+ const o = a.innerText.replace(/\n/g, "");
1204
+ o.replace(/\u200B/g, "") ? a.classList.remove("show-placeholder") : (o !== "​" && (a.innerText = "​"), a.classList.add("show-placeholder"));
1205
+ });
1206
+ }
1207
+ function nt(n, m, c, a, o, h = {}) {
1208
+ if (!n.current) return;
1209
+ let q = "", p = 0;
1210
+ for (; p < m.length; ) {
1211
+ const e = m[p], t = p + 1 < m.length ? m[p + 1] : null;
1212
+ if (e.type === "text" && (e.text?.includes("icon-bitian") || e.className === "rte-text-required") && t) {
1213
+ const v = t.type === "upload" && t.exclusionGroup === "fileInput" && e.exclusionGroup === "fileInput" && e.exclusionGroup === t.exclusionGroup, x = t.type === "variable" && t.exclusionGroup === "textInput" && e.exclusionGroup === "textInput" && e.exclusionGroup === t.exclusionGroup;
1214
+ if (v) {
1215
+ const A = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group">`, $ = "</span>";
1216
+ let S = "";
1217
+ e.className ? S = `<span class="${e.className}">${e.text ?? ""}</span>` : S = e.text ?? "";
1218
+ const C = t, O = c[C.key] !== null && c[C.key] !== void 0, I = O ? c[C.key]?.name : C.text, D = O ? "" : "hidden", P = C.tooltip && !O ? "" : "hidden", H = O ? "has-file" : "", G = O && I ? ` data-file-name="${I.replace(/"/g, "&quot;")}"` : "", K = `<span contenteditable="false" data-type="upload" data-key="${C.key}" class="upload-chip"><span class="upload-inner-wrapper ${H}"><span class="upload-icon">${O ? "<i class='iconfont icon-exlwenjian'></i>" : "<i class='iconfont icon-shangchuan1'></i>"}</span><span class="upload-label"${G}>${I || C.text}</span>${C.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi upload-info-icon ${P}" data-upload-key="${C.key}" data-tooltip="${C.tooltip}" title="提示"></i>` : ""}<span class="file-remove-btn ${D}" title="移除文件">×</span></span></span>`;
1219
+ q += A + S + K + $, p += 2;
1220
+ continue;
1221
+ }
1222
+ if (x) {
1223
+ const A = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group">`, $ = "</span>";
1224
+ let S = "";
1225
+ e.className ? S = `<span class="${e.className}">${e.text ?? ""}</span>` : S = e.text ?? "";
1226
+ const C = t, I = (C.key ? o[C.key] : void 0) || C.text || "", D = !I, P = D ? "​" : I, H = D ? "show-placeholder" : "", G = C.exclusionGroup ? ` data-group="${C.exclusionGroup}"` : "", K = C.tooltip ? ` data-tooltip="${C.tooltip.replace(/"/g, "&quot;")}" data-variable-key="${C.key || ""}"` : "", Q = C.tooltip && D ? "" : "hidden", E = `<span contenteditable="true" data-type="variable" data-key="${C.key}" data-placeholder="${C.placeholder || ""}"${G}${K} class="variable-chip ${H}">${P}${C.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${Q}" data-variable-key="${C.key}" data-tooltip="${C.tooltip.replace(/"/g, "&quot;")}" title="提示"></i>` : ""}</span>`;
1227
+ q += A + S + E + $, p += 2;
1228
+ continue;
1229
+ }
1230
+ }
1231
+ const s = e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : "", k = e.exclusionGroup ? `<span ${s} class="exclusion-wrapper">` : "", d = e.exclusionGroup ? "</span>" : "";
1232
+ let R = "";
1233
+ if (e.type === "tag") {
1234
+ const v = a ? "" : '<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>', x = a ? ' data-locked="true"' : "", w = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" data-tag-key="${e.key || ""}"` : "";
1235
+ R = `<span contenteditable="false" class="tag-node group"${x}${w}><span class="tag-label">${e.text}</span>${v}</span>`;
1236
+ } else if (e.type === "text") {
1237
+ const v = a ? ' data-locked="true" contenteditable="false"' : ' contenteditable="false"';
1238
+ e.className ? R = `<span class="${e.className}"${v}>${e.text ?? ""}</span>` : R = a ? `<span${v}>${e.text ?? ""}</span>` : `<span contenteditable="false">${e.text ?? ""}</span>`;
1239
+ } else if (e.type === "variable" && e.key) {
1240
+ const x = o[e.key] || e.text || "", w = !x, A = w ? "​" : x, $ = w ? "show-placeholder" : "", S = e.exclusionGroup ? ` data-group="${e.exclusionGroup}"` : "", C = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" data-variable-key="${e.key || ""}"` : "", O = e.tooltip && w ? "" : "hidden", I = `<span contenteditable="true" data-type="variable" data-key="${e.key}" data-placeholder="${e.placeholder || ""}"${S}${C} class="variable-chip ${$}">${A}${e.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${O}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" title="提示"></i>` : ""}</span>`;
1241
+ e.required ? R = `<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>${I}</span>` : R = I;
1242
+ } else if (e.type === "upload" && e.key) {
1243
+ const v = c[e.key] !== null && c[e.key] !== void 0, x = v ? c[e.key]?.name : e.text, w = v ? "" : "hidden", A = e.tooltip && !v ? "" : "hidden", $ = v ? "has-file" : "", S = v && x ? ` data-file-name="${x.replace(/"/g, "&quot;")}"` : "", C = `<span contenteditable="false" data-type="upload" data-key="${e.key}" class="upload-chip"><span class="upload-inner-wrapper ${$}"><span class="upload-icon">${v ? "<i class='iconfont icon-exlwenjian'></i>" : "<i class='iconfont icon-shangchuan1'></i>"}</span><span class="upload-label"${S}>${x || e.text}</span>${e.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi upload-info-icon ${A}" data-upload-key="${e.key}" data-tooltip="${e.tooltip}" title="提示"></i>` : ""}<span class="file-remove-btn ${w}" title="移除文件">×</span></span></span>`;
1244
+ e.required ? R = `<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>${C}</span>` : R = C;
1245
+ } else if (e.type === "multi-variable" && e.key) {
1246
+ const v = e.maxCount || 9, x = h[e.key] || 1, w = Math.min(x, v);
1247
+ let A = "";
1248
+ for (let $ = 0; $ < w; $++) {
1249
+ const S = `${e.key}_${$}`, C = o[S] || "", O = !C, I = O ? "​" : C, D = O ? "show-placeholder" : "", P = e.tooltip ? ` data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" data-variable-key="${e.key || ""}"` : "", H = e.tooltip && O ? "" : "hidden", G = `<span contenteditable="true" data-type="variable" data-key="${S}" data-multi-key="${e.key}" data-index="${$}" data-placeholder="${e.placeholder || ""}"${P} class="variable-chip ${D}">${I}${e.tooltip ? `<i contenteditable="false" class="iconfont icon-tishi variable-info-icon ${H}" data-variable-key="${e.key}" data-tooltip="${e.tooltip.replace(/"/g, "&quot;")}" title="提示"></i>` : ""}</span>`;
1250
+ A += G;
1251
+ }
1252
+ e.required ? R = `<span ${e.exclusionGroup ? `data-group="${e.exclusionGroup}"` : ""} class="exclusion-wrapper required-upload-group"><span class="rte-text-required"><i class='iconfont icon-bitian' style='font-size: 10px;'></i></span>${A}</span>` : R = A;
1253
+ }
1254
+ q += k + R + d, p++;
1255
+ }
1256
+ n.current && (n.current.innerHTML = q, setTimeout(() => {
1257
+ if (!n.current) return;
1258
+ n.current.querySelectorAll('[data-type="variable"]').forEach((t) => {
1259
+ const N = t.innerText.replace(/\n/g, "");
1260
+ N.replace(/\u200B/g, "") ? t.classList.remove("show-placeholder") : (N !== "​" && (t.innerText = "​"), t.classList.add("show-placeholder"));
1261
+ });
1262
+ }, 0));
1263
+ }
1264
+ function rt(n, m, c, a, o = {}, h, q) {
1265
+ const p = B(() => {
1266
+ if (!n.current) return;
1267
+ let e = {};
1268
+ const t = n.current, N = t.__tempVariableValues;
1269
+ if (N ? (e = N, delete t.__tempVariableValues) : n.current.querySelectorAll(
1270
+ '[data-type="variable"]'
1271
+ ).forEach((k) => {
1272
+ const d = k.dataset.key;
1273
+ if (d) {
1274
+ const R = k.innerText.replace(/[\u200B\n]/g, "").trim();
1275
+ R && (e[d] = R);
1276
+ }
1277
+ }), nt(n, m, c, a, e, o), h?.current) {
1278
+ const { key: s, offset: k } = h.current;
1279
+ setTimeout(() => {
1280
+ if (!n.current) return;
1281
+ const d = n.current.querySelector(
1282
+ `[data-type="variable"][data-key="${s}"]`
1283
+ );
1284
+ if (d) {
1285
+ try {
1286
+ const R = document.createRange(), v = document.createTreeWalker(
1287
+ d,
1288
+ NodeFilter.SHOW_TEXT,
1289
+ null
1290
+ );
1291
+ let x = 0, w = null, A = 0;
1292
+ for (; v.nextNode(); ) {
1293
+ const $ = v.currentNode, S = $.textContent?.length || 0;
1294
+ if (x + S >= k) {
1295
+ w = $, A = k - x;
1296
+ break;
1297
+ }
1298
+ x += S;
1299
+ }
1300
+ if (w) {
1301
+ R.setStart(w, Math.min(A, w.textContent?.length || 0)), R.collapse(!0);
1302
+ const $ = window.getSelection();
1303
+ $ && ($.removeAllRanges(), $.addRange(R), d.focus());
1304
+ } else {
1305
+ R.selectNodeContents(d), R.collapse(!1);
1306
+ const $ = window.getSelection();
1307
+ $ && ($.removeAllRanges(), $.addRange(R), d.focus());
1308
+ }
1309
+ } catch {
1310
+ const R = document.createRange();
1311
+ R.selectNodeContents(d), R.collapse(!1);
1312
+ const v = window.getSelection();
1313
+ v && (v.removeAllRanges(), v.addRange(R), d.focus());
1314
+ }
1315
+ h.current = null;
1316
+ }
1317
+ }, 0);
1318
+ }
1319
+ }, [m, c, a, n, o, h, q]);
1320
+ J(() => {
1321
+ p();
1322
+ }, [p]);
1323
+ }
1324
+ function at(n, m, c, a) {
1325
+ J(() => {
1326
+ const o = n.current;
1327
+ if (!o) return;
1328
+ const h = (p) => {
1329
+ const e = p.target?.closest(".upload-info-icon");
1330
+ if (e && e.classList.contains("upload-info-icon")) {
1331
+ const t = e.dataset.uploadKey;
1332
+ t && a({ key: t, anchorEl: e, type: "upload" });
1333
+ }
1334
+ }, q = (p) => {
1335
+ const e = p.target?.closest(".upload-info-icon"), t = p.relatedTarget;
1336
+ e && e.classList.contains("upload-info-icon") && (!t || !o.contains(t) ? a(null) : t.closest(".upload-info-icon") || a(null));
1337
+ };
1338
+ return o.addEventListener("mouseover", h, !0), o.addEventListener("mouseout", q, !0), () => {
1339
+ o.removeEventListener("mouseover", h, !0), o.removeEventListener("mouseout", q, !0);
1340
+ };
1341
+ }, [m, c, n, a]);
1342
+ }
1343
+ function ot(n, m, c) {
1344
+ J(() => {
1345
+ if (!n.current) return;
1346
+ const a = (p) => {
1347
+ const e = p.currentTarget, t = e.dataset.tooltip, N = e.dataset.tagKey || "";
1348
+ t && c({ key: N, anchorEl: e, type: "tag" });
1349
+ }, o = () => {
1350
+ c(null);
1351
+ };
1352
+ let h;
1353
+ const q = () => {
1354
+ if (!n.current) return;
1355
+ n.current.querySelectorAll(
1356
+ ".tag-node[data-tooltip]"
1357
+ ).forEach((e) => {
1358
+ e.addEventListener("mouseenter", a), e.addEventListener("mouseleave", o);
1359
+ });
1360
+ };
1361
+ return h = requestAnimationFrame(() => {
1362
+ h = requestAnimationFrame(q);
1363
+ }), () => {
1364
+ cancelAnimationFrame(h), n.current && n.current.querySelectorAll(
1365
+ ".tag-node[data-tooltip]"
1366
+ ).forEach((e) => {
1367
+ e.removeEventListener("mouseenter", a), e.removeEventListener("mouseleave", o);
1368
+ });
1369
+ };
1370
+ }, [m, n, c]);
1371
+ }
1372
+ function st(n, m, c) {
1373
+ J(() => {
1374
+ const a = n.current;
1375
+ if (!a) return;
1376
+ const o = (q) => {
1377
+ const p = q.target?.closest(".variable-info-icon");
1378
+ if (p && p.classList.contains("variable-info-icon")) {
1379
+ const e = p.dataset.variableKey;
1380
+ e && c({ key: e, anchorEl: p, type: "variable" });
1381
+ }
1382
+ }, h = (q) => {
1383
+ const p = q.target?.closest(".variable-info-icon"), e = q.relatedTarget;
1384
+ p && p.classList.contains("variable-info-icon") && (!e || !a.contains(e) ? c(null) : e.closest(".variable-info-icon") || c(null));
1385
+ };
1386
+ return a.addEventListener("mouseover", o, !0), a.addEventListener("mouseout", h, !0), () => {
1387
+ a.removeEventListener("mouseover", o, !0), a.removeEventListener("mouseout", h, !0);
1388
+ };
1389
+ }, [m, n, c]);
1390
+ }
1391
+ function lt(n, m, c, a) {
1392
+ J(() => {
1393
+ if (!n.current) return;
1394
+ const o = (e) => {
1395
+ const t = e.currentTarget;
1396
+ t.dataset.fileName && a({ key: "", anchorEl: t, type: "upload-label" });
1397
+ }, h = () => {
1398
+ a(null);
1399
+ };
1400
+ let q;
1401
+ const p = () => {
1402
+ if (!n.current) return;
1403
+ n.current.querySelectorAll(
1404
+ ".upload-label[data-file-name]"
1405
+ ).forEach((t) => {
1406
+ t.addEventListener("mouseenter", o), t.addEventListener("mouseleave", h);
1407
+ });
1408
+ };
1409
+ return q = requestAnimationFrame(() => {
1410
+ q = requestAnimationFrame(p);
1411
+ }), () => {
1412
+ cancelAnimationFrame(q), n.current && n.current.querySelectorAll(
1413
+ ".upload-label[data-file-name]"
1414
+ ).forEach((t) => {
1415
+ t.removeEventListener("mouseenter", o), t.removeEventListener("mouseleave", h);
1416
+ });
1417
+ };
1418
+ }, [m, c, n, a]);
1419
+ }
1420
+ function it(n, m, c, a) {
1421
+ J(() => {
1422
+ me(n, m, c), ye(n, m, c, a);
1423
+ }, [c, m, n, a]);
1424
+ }
1425
+ function ct(n, m) {
1426
+ J(() => {
1427
+ if (!n.current) return;
1428
+ let c = !1, a = 0;
1429
+ const o = () => {
1430
+ c = !0;
1431
+ }, h = () => {
1432
+ c = !1, a = Date.now();
1433
+ }, q = () => {
1434
+ if (!n.current) return;
1435
+ const p = window.getSelection();
1436
+ if (!p || p.rangeCount === 0 || m.current || c)
1437
+ return;
1438
+ const e = p.getRangeAt(0);
1439
+ if (!e.collapsed) {
1440
+ n.current.contains(e.commonAncestorContainer) || p.removeAllRanges();
1441
+ return;
1442
+ }
1443
+ const t = p.anchorNode;
1444
+ if (!t) return;
1445
+ if (!n.current.contains(t)) {
1446
+ p.removeAllRanges();
1447
+ return;
1448
+ }
1449
+ let N = null;
1450
+ if (t.nodeType === Node.ELEMENT_NODE ? N = t.closest('[data-type="variable"]') : t.nodeType === Node.TEXT_NODE && t.parentElement && (N = t.parentElement.closest('[data-type="variable"]')), !N) {
1451
+ if (Date.now() - a > 500)
1452
+ return;
1453
+ const s = n.current.querySelectorAll('[data-type="variable"]');
1454
+ if (s.length > 0) {
1455
+ let k = null;
1456
+ for (const d of Array.from(s))
1457
+ if (d.style.display !== "none") {
1458
+ k = d;
1459
+ break;
1460
+ }
1461
+ if (!k && s.length > 0 && (k = s[0]), k) {
1462
+ const d = document.createRange();
1463
+ d.selectNodeContents(k), d.collapse(!1), p.removeAllRanges(), p.addRange(d), k.focus();
1464
+ } else
1465
+ p.removeAllRanges();
1466
+ } else
1467
+ p.removeAllRanges();
1468
+ }
1469
+ };
1470
+ return document.addEventListener("mousedown", o), document.addEventListener("mouseup", h), document.addEventListener("selectionchange", q), () => {
1471
+ document.removeEventListener("mousedown", o), document.removeEventListener("mouseup", h), document.removeEventListener("selectionchange", q);
1472
+ };
1473
+ }, [n, m]);
1474
+ }
1475
+ const ut = ({
1476
+ config: n,
1477
+ onSend: m,
1478
+ isProcessing: c = !1,
1479
+ disabled: a = !1,
1480
+ width: o,
1481
+ lockStructure: h = !1,
1482
+ agentOptions: q = [],
1483
+ onAgentSelect: p,
1484
+ loading: e = !1
1485
+ }) => {
1486
+ const t = W(null), N = W(null), [s, k] = z({}), [d, R] = z(null), [v, x] = z(null), w = W(!1), A = W(null), [$, S] = z(!1), C = W(null), [O, I] = z(() => {
1487
+ const r = {};
1488
+ return n.forEach((i) => {
1489
+ i.type === "multi-variable" && i.key && (r[i.key] = 1);
1490
+ }), r;
1491
+ });
1492
+ J(() => {
1493
+ I((r) => {
1494
+ const i = {};
1495
+ return n.forEach((y) => {
1496
+ y.type === "multi-variable" && y.key && (i[y.key] = r[y.key] || 1);
1497
+ }), i;
1498
+ });
1499
+ }, [n]), rt(t, n, s, h, O, C), at(t, n, s, x), ot(t, n, x), lt(t, n, s, x), st(t, n, x), it(t, n, s, S), ct(t, w);
1500
+ const D = (r) => {
1501
+ if (a) {
1502
+ r.preventDefault();
1503
+ return;
1504
+ }
1505
+ r.preventDefault();
1506
+ const i = r.clipboardData.getData("text/plain"), y = window.getSelection();
1507
+ if (y && y.rangeCount > 0) {
1508
+ const T = y.anchorNode;
1509
+ if (T) {
1510
+ let g = null;
1511
+ if (T.nodeType === Node.ELEMENT_NODE ? g = T.closest('[data-type="variable"]') : T.nodeType === Node.TEXT_NODE && T.parentElement && (g = T.parentElement.closest('[data-type="variable"]')), g) {
1512
+ const L = g.dataset.multiKey;
1513
+ if (L) {
1514
+ const f = i.split(/[,\n\r\t]+/).map((b) => b.trim()).filter((b) => b.length > 0);
1515
+ if (f.length > 1) {
1516
+ const b = parseInt(g.dataset.index || "0", 10), V = n.find((ee) => ee.type === "multi-variable" && ee.key === L)?.maxCount || 9, j = O[L] || 1, Y = Math.min(b + f.length, V);
1517
+ Y > j && I((U) => ({
1518
+ ...U,
1519
+ [L]: Y
1520
+ })), setTimeout(() => {
1521
+ t.current && (f.forEach((U, ee) => {
1522
+ const te = b + ee;
1523
+ if (te >= V) return;
1524
+ const M = `${L}_${te}`, Z = t.current.querySelector(
1525
+ `[data-type="variable"][data-key="${M}"]`
1526
+ );
1527
+ Z && (Z.innerText = U, Z.classList.remove("show-placeholder"));
1528
+ }), F());
1529
+ }, 0);
1530
+ return;
1531
+ }
1532
+ }
1533
+ }
1534
+ }
1535
+ }
1536
+ document.execCommand("insertText", !1, i), F();
1537
+ }, P = (r) => {
1538
+ if (r.target.files && r.target.files[0] && d) {
1539
+ const i = r.target.files[0], y = d;
1540
+ k((T) => ({ ...T, [y]: i }));
1541
+ }
1542
+ r.target && (r.target.value = ""), R(null);
1543
+ }, H = (r) => {
1544
+ k((i) => {
1545
+ const y = { ...i };
1546
+ return delete y[r], y;
1547
+ });
1548
+ }, G = (r) => {
1549
+ const i = r.target;
1550
+ if (h) {
1551
+ const T = i.closest(".tag-node"), g = i.closest('[data-type="text"]');
1552
+ if (T || g) {
1553
+ r.preventDefault(), r.stopPropagation();
1554
+ const L = window.getSelection();
1555
+ L && L.removeAllRanges();
1556
+ return;
1557
+ }
1558
+ }
1559
+ i.closest('[data-type="variable"]') || (A.current = { x: r.clientX, y: r.clientY }, w.current = !1, (i.closest(".tag-close-btn") || i.closest(".file-remove-btn")) && (r.preventDefault(), r.stopPropagation()));
1560
+ }, K = (r) => {
1561
+ if (!r.target.closest('[data-type="variable"]') && A.current) {
1562
+ const T = Math.abs(r.clientX - A.current.x), g = Math.abs(r.clientY - A.current.y);
1563
+ (T > 3 || g > 3) && (w.current = !0);
1564
+ }
1565
+ }, Q = (r) => {
1566
+ if (r.target.closest('[data-type="variable"]')) {
1567
+ A.current = null, w.current = !1;
1568
+ return;
1569
+ }
1570
+ A.current = null, w.current = !1;
1571
+ }, E = (r) => {
1572
+ if (a)
1573
+ return;
1574
+ const i = r.target;
1575
+ if (i.closest('[data-type="text"]')) {
1576
+ r.preventDefault(), r.stopPropagation();
1577
+ const f = window.getSelection();
1578
+ f && f.removeAllRanges();
1579
+ return;
1580
+ }
1581
+ if (h && i.closest(".tag-node")) {
1582
+ r.preventDefault(), r.stopPropagation();
1583
+ const b = window.getSelection();
1584
+ b && b.removeAllRanges();
1585
+ return;
1586
+ }
1587
+ if (i.closest('[data-type="variable"]')) {
1588
+ if (w.current)
1589
+ return;
1590
+ setTimeout(() => {
1591
+ const f = window.getSelection();
1592
+ f && !f.isCollapsed || fe(t);
1593
+ }, 10);
1594
+ return;
1595
+ }
1596
+ if (i.closest(".tag-close-btn")) {
1597
+ if (h) {
1598
+ r.preventDefault(), r.stopPropagation();
1599
+ return;
1600
+ }
1601
+ r.preventDefault(), r.stopPropagation(), x(null), t.current && (t.current.innerHTML = "", t.current.focus());
1602
+ return;
1603
+ }
1604
+ const g = i.closest(".file-remove-btn");
1605
+ if (g) {
1606
+ r.preventDefault(), r.stopPropagation();
1607
+ const b = g.closest('[data-type="upload"]')?.dataset.key;
1608
+ b && H(b);
1609
+ return;
1610
+ }
1611
+ const L = i.closest('[data-type="upload"]');
1612
+ if (L) {
1613
+ const f = L.dataset.key;
1614
+ f && (R(f), N.current?.click());
1615
+ return;
1616
+ }
1617
+ }, _ = (r) => {
1618
+ const y = r.target.closest('[data-type="variable"]');
1619
+ if (y) {
1620
+ const T = window.getSelection();
1621
+ if (T) {
1622
+ const g = document.createRange(), L = y.textContent || "";
1623
+ if (L.replace(/\u200B/g, "")) {
1624
+ let b = 0, V = L.length;
1625
+ L.startsWith("​") && (b = 1), L.endsWith("​") && L.length > 1 && (V = L.length - 1);
1626
+ const j = y.firstChild;
1627
+ j && j.nodeType === Node.TEXT_NODE ? (g.setStart(j, b), g.setEnd(j, V)) : g.selectNodeContents(y);
1628
+ } else
1629
+ g.selectNodeContents(y), g.collapse(!0);
1630
+ T.removeAllRanges(), T.addRange(g);
1631
+ }
1632
+ }
1633
+ }, F = () => {
1634
+ if (fe(t), t.current && t.current.querySelectorAll('[data-type="variable"]').forEach((y) => {
1635
+ const T = y.querySelector(".variable-info-icon");
1636
+ if (T) {
1637
+ let g = !1;
1638
+ const L = document.createTreeWalker(
1639
+ y,
1640
+ NodeFilter.SHOW_TEXT,
1641
+ {
1642
+ acceptNode: (f) => T.contains(f) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT
1643
+ }
1644
+ );
1645
+ for (; L.nextNode(); )
1646
+ if (L.currentNode.textContent?.replace(/[\u200B\n]/g, "").trim()) {
1647
+ g = !0;
1648
+ break;
1649
+ }
1650
+ g ? T.classList.add("hidden") : T.classList.remove("hidden");
1651
+ }
1652
+ }), me(t, n, s), ye(t, n, s, S), !t.current) return;
1653
+ n.filter((i) => i.type === "multi-variable" && i.key).forEach((i) => {
1654
+ if (!i.key) return;
1655
+ const y = i.maxCount || 9, T = O[i.key] || 1, g = [];
1656
+ for (let j = 0; j < T; j++) {
1657
+ const Y = `${i.key}_${j}`, U = t.current.querySelector(
1658
+ `[data-type="variable"][data-key="${Y}"][data-multi-key="${i.key}"]`
1659
+ );
1660
+ if (U) {
1661
+ const ee = U.innerText.replace(/[\u200B\n]/g, "").trim();
1662
+ g.push(ee);
1663
+ }
1664
+ }
1665
+ const f = (g[g.length - 1] || "") === "";
1666
+ let b = !1, V = -1;
1667
+ for (let j = 0; j < g.length - 1; j++)
1668
+ if (g[j] === "") {
1669
+ b = !0, V = j;
1670
+ break;
1671
+ }
1672
+ if (b && V >= 0) {
1673
+ const j = window.getSelection();
1674
+ if (j && j.rangeCount > 0) {
1675
+ const M = j.getRangeAt(0), Z = M.startContainer, ae = Z.nodeType === Node.ELEMENT_NODE ? Z.closest('[data-type="variable"][data-multi-key]') : Z.parentElement?.closest('[data-type="variable"][data-multi-key]');
1676
+ if (ae) {
1677
+ const oe = ae.dataset.key;
1678
+ if (oe) {
1679
+ const se = document.createRange();
1680
+ se.setStartBefore(ae), se.setEnd(M.startContainer, M.startOffset);
1681
+ const pe = se.toString().length;
1682
+ C.current = { key: oe, offset: pe };
1683
+ }
1684
+ }
1685
+ }
1686
+ const Y = [...g];
1687
+ for (let M = V; M < Y.length - 1; M++)
1688
+ Y[M] = Y[M + 1];
1689
+ Y.pop();
1690
+ const U = {};
1691
+ Y.forEach((M, Z) => {
1692
+ M && (U[`${i.key}_${Z}`] = M);
1693
+ });
1694
+ const ee = Math.max(f ? Y.length : Y.length + 1, 1);
1695
+ t.current.querySelectorAll(
1696
+ '[data-type="variable"]'
1697
+ ).forEach((M) => {
1698
+ const Z = M.dataset.key, ae = M.dataset.multiKey;
1699
+ if (Z && ae !== i.key) {
1700
+ const oe = M.innerText.replace(/[\u200B\n]/g, "").trim();
1701
+ oe && (U[Z] = oe);
1702
+ }
1703
+ }), t.current.__tempVariableValues = U, I((M) => ({
1704
+ ...M,
1705
+ [i.key]: ee
1706
+ }));
1707
+ return;
1708
+ }
1709
+ if (!f) {
1710
+ const j = T - 1, Y = `${i.key}_${j}`, U = t.current.querySelector(
1711
+ `[data-type="variable"][data-key="${Y}"][data-multi-key="${i.key}"]`
1712
+ );
1713
+ if (U && U.innerText.replace(/[\u200B\n]/g, "").trim().length > 0 && T < y) {
1714
+ const te = window.getSelection();
1715
+ if (te && te.rangeCount > 0) {
1716
+ const M = te.getRangeAt(0), Z = M.startContainer, ae = Z.nodeType === Node.ELEMENT_NODE ? Z.closest('[data-type="variable"][data-multi-key]') : Z.parentElement?.closest('[data-type="variable"][data-multi-key]');
1717
+ if (ae) {
1718
+ const oe = ae.dataset.key;
1719
+ if (oe) {
1720
+ const se = document.createRange();
1721
+ se.setStartBefore(ae), se.setEnd(M.startContainer, M.startOffset);
1722
+ const pe = se.toString().length;
1723
+ C.current = { key: oe, offset: pe };
1724
+ }
1725
+ }
1726
+ }
1727
+ I((M) => ({
1728
+ ...M,
1729
+ [i.key]: T + 1
1730
+ }));
1731
+ }
1732
+ }
1733
+ });
1734
+ }, X = () => {
1735
+ t.current && (fe(t), me(t, n, s), ye(t, n, s, S));
1736
+ }, ne = (r) => {
1737
+ if (a) {
1738
+ r.preventDefault();
1739
+ return;
1740
+ }
1741
+ const i = window.getSelection();
1742
+ if (i && i.rangeCount > 0) {
1743
+ const y = i.anchorNode;
1744
+ let T = null;
1745
+ if (y && (y.nodeType === Node.ELEMENT_NODE ? T = y.closest('[data-type="text"]') : y.nodeType === Node.TEXT_NODE && y.parentElement && (T = y.parentElement.closest('[data-type="text"]'))), T) {
1746
+ if (r.preventDefault(), r.stopPropagation(), t.current) {
1747
+ const g = t.current.querySelector(
1748
+ '[data-type="variable"], [data-type="upload"]'
1749
+ );
1750
+ g && g.focus();
1751
+ }
1752
+ return;
1753
+ }
1754
+ }
1755
+ if (h && i && i.rangeCount > 0) {
1756
+ const y = i.anchorNode;
1757
+ let T = null;
1758
+ if (y && (y.nodeType === Node.ELEMENT_NODE ? T = y.closest(".tag-node") : y.nodeType === Node.TEXT_NODE && y.parentElement && (T = y.parentElement.closest(".tag-node"))), T) {
1759
+ if (r.preventDefault(), r.stopPropagation(), t.current) {
1760
+ const g = t.current.querySelector(
1761
+ '[data-type="variable"], [data-type="upload"]'
1762
+ );
1763
+ g && g.focus();
1764
+ }
1765
+ return;
1766
+ }
1767
+ }
1768
+ if (r.key === "Enter" && !r.shiftKey && (r.preventDefault(), re()), r.key === "Escape" && t.current) {
1769
+ if (h) {
1770
+ r.preventDefault();
1771
+ return;
1772
+ }
1773
+ t.current.innerHTML = "", t.current.focus();
1774
+ }
1775
+ if (r.key === "Backspace") {
1776
+ const y = window.getSelection();
1777
+ if (y && y.rangeCount > 0) {
1778
+ const T = y.getRangeAt(0), g = y.anchorNode;
1779
+ if (h) {
1780
+ let f = null, b = null;
1781
+ if (g && (g.nodeType === Node.ELEMENT_NODE ? (f = g.closest(".tag-node"), b = g.closest('[data-type="text"]')) : g.nodeType === Node.TEXT_NODE && g.parentElement && (f = g.parentElement.closest(".tag-node"), b = g.parentElement.closest('[data-type="text"]'))), (f || b) && T.collapsed && T.startOffset === 0) {
1782
+ r.preventDefault();
1783
+ return;
1784
+ }
1785
+ }
1786
+ let L = null;
1787
+ if (g && (g.nodeType === Node.ELEMENT_NODE ? L = g.closest(
1788
+ '[data-type="variable"]'
1789
+ ) : g.nodeType === Node.TEXT_NODE && g.parentElement && (L = g.parentElement.closest(
1790
+ '[data-type="variable"]'
1791
+ ))), L) {
1792
+ if (!T.collapsed)
1793
+ return;
1794
+ const f = L.innerText;
1795
+ if (f === "​" || f === "") {
1796
+ r.preventDefault();
1797
+ return;
1798
+ }
1799
+ if (T.startOffset === 0) {
1800
+ r.preventDefault();
1801
+ return;
1802
+ }
1803
+ if (f.startsWith("​") && T.startOffset === 1) {
1804
+ r.preventDefault();
1805
+ return;
1806
+ }
1807
+ }
1808
+ }
1809
+ }
1810
+ }, re = () => {
1811
+ if (c || a || e || !$ || !t.current) return;
1812
+ const r = t.current;
1813
+ let i = "";
1814
+ const y = {}, T = (f) => {
1815
+ if (!(f.nodeType === Node.ELEMENT_NODE && f.style.display === "none")) {
1816
+ if (f.nodeType === Node.TEXT_NODE)
1817
+ i += (f.textContent || "").replace(/\u200B/g, "");
1818
+ else if (f.nodeType === Node.ELEMENT_NODE) {
1819
+ const b = f, V = b.dataset.type, j = b.dataset.key;
1820
+ if (V === "variable" && j) {
1821
+ let Y = "";
1822
+ const U = document.createTreeWalker(
1823
+ b,
1824
+ NodeFilter.SHOW_TEXT,
1825
+ {
1826
+ acceptNode: (te) => {
1827
+ const M = b.querySelector(".variable-info-icon");
1828
+ return M && M.contains(te) ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT;
1829
+ }
1830
+ }
1831
+ );
1832
+ for (; U.nextNode(); )
1833
+ Y += U.currentNode.textContent || "";
1834
+ const ee = Y.replace(/[\u200B\n]/g, "").trim();
1835
+ if (ee) {
1836
+ const te = b.dataset.multiKey;
1837
+ if (te) {
1838
+ y[te] || (y[te] = []);
1839
+ const M = y[te];
1840
+ M.push(ee), M.length > 1 && (i += " "), i += ee;
1841
+ } else
1842
+ y[j] = ee, i += ee;
1843
+ }
1844
+ } else if (V === "upload" && j)
1845
+ y[j] = s[j] ?? null, s[j] && (i += ` [附带文件: ${s[j]?.name}] `);
1846
+ else {
1847
+ if (b.classList.contains("tag-close-btn") || b.classList.contains("file-remove-btn")) return;
1848
+ b.getAttribute("contenteditable") === "false" && !V && b.classList.contains("tag-node") ? i += b.innerText : b.childNodes.forEach(T);
1849
+ }
1850
+ }
1851
+ }
1852
+ };
1853
+ if (r.childNodes.forEach(T), i = i.trim(), !i) return;
1854
+ const g = new FormData();
1855
+ g.append("fullPrompt", i), Object.keys(y).forEach((f) => {
1856
+ const b = y[f];
1857
+ b != null && (b instanceof File ? g.append(f, b) : Array.isArray(b) ? b.forEach((V, j) => {
1858
+ V != null && (V instanceof File ? g.append(`${f}[${j}]`, V) : typeof V == "string" ? g.append(`${f}[${j}]`, V) : g.append(`${f}[${j}]`, String(V)));
1859
+ }) : typeof b == "string" ? g.append(f, b) : g.append(f, String(b)));
1860
+ }), console.log("dataPayload:", y);
1861
+ const L = Array.from(g.keys());
1862
+ console.log("FormData keys:", L), m(g, i);
1863
+ }, l = o ? { width: typeof o == "number" ? `${o}px` : o } : {};
1864
+ return /* @__PURE__ */ u.jsxs(
1865
+ "div",
1866
+ {
1867
+ className: "rich-text-editor",
1868
+ style: l,
1869
+ "data-disabled": a,
1870
+ children: [
1871
+ /* @__PURE__ */ u.jsx(
1872
+ "div",
1873
+ {
1874
+ ref: t,
1875
+ className: "rte-editor",
1876
+ contentEditable: !1,
1877
+ suppressContentEditableWarning: !0,
1878
+ onMouseDown: G,
1879
+ onMouseMove: K,
1880
+ onMouseUp: Q,
1881
+ onClick: E,
1882
+ onDoubleClick: _,
1883
+ onInput: F,
1884
+ onKeyDown: ne,
1885
+ onPaste: D,
1886
+ onBlur: X
1887
+ }
1888
+ ),
1889
+ /* @__PURE__ */ u.jsx(
1890
+ "input",
1891
+ {
1892
+ type: "file",
1893
+ ref: N,
1894
+ className: "rte-file-input",
1895
+ accept: ".csv,.xlsx,.xls,.txt,.pdf,image/*",
1896
+ onChange: P
1897
+ }
1898
+ ),
1899
+ /* @__PURE__ */ u.jsxs("div", { className: "rich-text-editor-footer", children: [
1900
+ /* @__PURE__ */ u.jsx("div", { className: "rich-text-editor-footer-left", children: /* @__PURE__ */ u.jsxs("div", { className: "rich-text-editor-brand", children: [
1901
+ /* @__PURE__ */ u.jsxs("div", { className: "rte-brand-badge", children: [
1902
+ /* @__PURE__ */ u.jsx("img", { src: "https://oospublic.sealseek.cn/file/website/ball.png", alt: "" }),
1903
+ /* @__PURE__ */ u.jsx("span", { className: "rte-brand-text", children: "SealSeek 1.0" })
1904
+ ] }),
1905
+ /* @__PURE__ */ u.jsx(
1906
+ Ae,
1907
+ {
1908
+ placement: "top",
1909
+ menu: {
1910
+ items: q.map((r) => ({
1911
+ key: r.key,
1912
+ label: /* @__PURE__ */ u.jsxs("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
1913
+ r.icon && /* @__PURE__ */ u.jsx("i", { className: r.icon }),
1914
+ /* @__PURE__ */ u.jsx("span", { children: r.label })
1915
+ ] }),
1916
+ onClick: () => {
1917
+ p?.(r);
1918
+ }
1919
+ }))
1920
+ },
1921
+ trigger: ["click"],
1922
+ disabled: a || c,
1923
+ children: /* @__PURE__ */ u.jsxs("div", { className: "rte-agent-badge", style: { cursor: q.length > 0 ? "pointer" : "default" }, children: [
1924
+ /* @__PURE__ */ u.jsx("i", { className: "iconfont icon-zhinengti" }),
1925
+ /* @__PURE__ */ u.jsx("span", { className: "rte-agent-text", children: "智能体" })
1926
+ ] })
1927
+ }
1928
+ )
1929
+ ] }) }),
1930
+ /* @__PURE__ */ u.jsx(
1931
+ "button",
1932
+ {
1933
+ type: "button",
1934
+ onClick: re,
1935
+ disabled: c || a || e || !$,
1936
+ className: "rich-text-editor-send-button",
1937
+ children: c || e ? /* @__PURE__ */ u.jsx("span", { className: "rte-send-spinner" }) : /* @__PURE__ */ u.jsx("i", { className: "iconfont icon-fasong" })
1938
+ }
1939
+ )
1940
+ ] }),
1941
+ v?.anchorEl && (() => {
1942
+ if (!document.body.contains(v.anchorEl))
1943
+ return null;
1944
+ let r = "";
1945
+ return v.type === "upload" ? r = n.find(
1946
+ (y) => y.type === "upload" && y.key === v.key
1947
+ )?.tooltip || "" : v.type === "tag" ? r = v.anchorEl.dataset.tooltip || "" : v.type === "upload-label" ? r = v.anchorEl.dataset.fileName || "" : v.type === "variable" && (r = v.anchorEl.dataset.tooltip || ""), Ge(
1948
+ /* @__PURE__ */ u.jsx(
1949
+ _e,
1950
+ {
1951
+ arrow: !1,
1952
+ title: /* @__PURE__ */ u.jsx("div", { style: { maxWidth: "200px", fontSize: "12px", color: "#fff" }, children: r }),
1953
+ open: !0,
1954
+ placement: "top",
1955
+ getPopupContainer: () => document.body,
1956
+ overlayInnerStyle: {
1957
+ background: "var(--neutral-800, #262626)"
1958
+ },
1959
+ children: /* @__PURE__ */ u.jsx(
1960
+ "div",
1961
+ {
1962
+ style: {
1963
+ position: "fixed",
1964
+ left: `${v.anchorEl.getBoundingClientRect().left}px`,
1965
+ top: `${v.anchorEl.getBoundingClientRect().top}px`,
1966
+ width: `${v.anchorEl.offsetWidth}px`,
1967
+ height: `${v.anchorEl.offsetHeight}px`,
1968
+ pointerEvents: "none"
1969
+ }
1970
+ }
1971
+ )
1972
+ }
1973
+ ),
1974
+ document.body
1975
+ );
1976
+ })()
1977
+ ]
1978
+ }
1979
+ );
1980
+ };
1981
+ ut.__docgenInfo = {
1982
+ displayName: "RichTextEditor",
1983
+ description: "结构化富文本输入组件,支持标签、变量输入块、文件上传以及互斥显示逻辑。",
1984
+ props: {
1985
+ config: {
1986
+ name: "config",
1987
+ required: !0,
1988
+ description: "结构化输入配置节点数组",
1989
+ type: { name: "InputNode[]", raw: "InputNode[]" }
1990
+ },
1991
+ onSend: {
1992
+ name: "onSend",
1993
+ required: !0,
1994
+ description: "点击发送按钮时的回调,返回数据与拼接后的 Prompt",
1995
+ type: {
1996
+ name: "function",
1997
+ raw: "(data: Record<string, any>, fullPrompt: string) => void"
1998
+ }
1999
+ },
2000
+ isProcessing: {
2001
+ name: "isProcessing",
2002
+ required: !1,
2003
+ description: "是否处于处理状态(禁用输入与发送)",
2004
+ type: { name: "boolean", raw: "boolean" },
2005
+ defaultValue: { value: "false" }
2006
+ }
2007
+ }
2008
+ };
2009
+ const dt = ({
1016
2010
  texts: n = [],
1017
- placeholder: s = "请输入内容",
1018
- animationSpeed: i = 100,
1019
- autoPlay: l = !0,
2011
+ placeholder: m = "请输入内容",
2012
+ animationSpeed: c = 100,
2013
+ autoPlay: a = !0,
1020
2014
  value: o,
1021
- onChange: d,
1022
- ...E
2015
+ onChange: h,
2016
+ ...q
1023
2017
  }) => {
1024
- const [m, S] = j(""), [_, k] = j(0), [N, I] = j(!1), [h, P] = j(!1), [V, a] = j(!1), p = z(void 0), b = z(void 0), T = z(n), g = z(_), $ = z(h), D = z(m);
1025
- U(() => {
1026
- T.current = n, g.current = _, $.current = h, D.current = m;
2018
+ const [p, e] = z(""), [t, N] = z(0), [s, k] = z(!1), [d, R] = z(!1), [v, x] = z(!1), w = W(void 0), A = W(void 0), $ = W(n), S = W(t), C = W(d), O = W(p);
2019
+ J(() => {
2020
+ $.current = n, S.current = t, C.current = d, O.current = p;
1027
2021
  });
1028
- const A = v((t, c) => {
1029
- let R = 0;
1030
- a(!0);
1031
- const C = () => {
1032
- R < t.length ? (S(t.slice(0, R + 1)), R++, b.current = window.setTimeout(C, i)) : (a(!1), c?.());
2022
+ const I = B((E, _) => {
2023
+ let F = 0;
2024
+ x(!0);
2025
+ const X = () => {
2026
+ F < E.length ? (e(E.slice(0, F + 1)), F++, A.current = window.setTimeout(X, c)) : (x(!1), _?.());
1033
2027
  };
1034
- C();
1035
- }, [i]), F = v((t) => {
1036
- let c = D.current.length;
1037
- const R = () => {
1038
- c > 0 ? (S(D.current.slice(0, c - 1)), c--, b.current = window.setTimeout(R, i / 2)) : t?.();
2028
+ X();
2029
+ }, [c]), D = B((E) => {
2030
+ let _ = O.current.length;
2031
+ const F = () => {
2032
+ _ > 0 ? (e(O.current.slice(0, _ - 1)), _--, A.current = window.setTimeout(F, c / 2)) : E?.();
1039
2033
  };
1040
- R();
1041
- }, [i]), x = v(() => {
1042
- if (T.current.length === 0 || $.current) return;
1043
- I(!0);
1044
- const t = T.current[g.current];
1045
- D.current ? F(() => {
1046
- A(t, () => {
1047
- p.current = window.setTimeout(() => {
1048
- k((c) => (c + 1) % T.current.length), I(!1);
2034
+ F();
2035
+ }, [c]), P = B(() => {
2036
+ if ($.current.length === 0 || C.current) return;
2037
+ k(!0);
2038
+ const E = $.current[S.current];
2039
+ O.current ? D(() => {
2040
+ I(E, () => {
2041
+ w.current = window.setTimeout(() => {
2042
+ N((_) => (_ + 1) % $.current.length), k(!1);
1049
2043
  }, 2e3);
1050
2044
  });
1051
- }) : A(t, () => {
1052
- p.current = window.setTimeout(() => {
1053
- k((c) => (c + 1) % T.current.length), I(!1);
2045
+ }) : I(E, () => {
2046
+ w.current = window.setTimeout(() => {
2047
+ N((_) => (_ + 1) % $.current.length), k(!1);
1054
2048
  }, 2e3);
1055
2049
  });
1056
- }, [F, A]);
1057
- U(() => (l && n.length > 0 && !h && x(), () => {
1058
- p.current && window.clearTimeout(p.current), b.current && window.clearTimeout(b.current);
1059
- }), [_, h, l, n.length, x]), U(() => {
1060
- !N && l && n.length > 0 && !h && x();
1061
- }, [_, N, l, n.length, h, x]);
1062
- const L = (t) => {
1063
- P(!0), p.current && window.clearTimeout(p.current), b.current && window.clearTimeout(b.current), I(!1), a(!1), E.onFocus?.(t);
1064
- }, q = (t) => {
1065
- P(!1), !o && n.length > 0 && (S(""), k(0)), E.onBlur?.(t);
1066
- }, B = (t) => {
1067
- d?.(t.target.value), E.onChange?.(t);
1068
- }, H = () => h || o ? s : m || s;
1069
- return /* @__PURE__ */ r.jsxs("div", { style: { position: "relative" }, children: [
1070
- /* @__PURE__ */ r.jsx(
1071
- ue,
2050
+ }, [D, I]);
2051
+ J(() => (a && n.length > 0 && !d && P(), () => {
2052
+ w.current && window.clearTimeout(w.current), A.current && window.clearTimeout(A.current);
2053
+ }), [t, d, a, n.length, P]), J(() => {
2054
+ !s && a && n.length > 0 && !d && P();
2055
+ }, [t, s, a, n.length, d, P]);
2056
+ const H = (E) => {
2057
+ R(!0), w.current && window.clearTimeout(w.current), A.current && window.clearTimeout(A.current), k(!1), x(!1), q.onFocus?.(E);
2058
+ }, G = (E) => {
2059
+ R(!1), !o && n.length > 0 && (e(""), N(0)), q.onBlur?.(E);
2060
+ }, K = (E) => {
2061
+ h?.(E.target.value), q.onChange?.(E);
2062
+ }, Q = () => d || o ? m : p || m;
2063
+ return /* @__PURE__ */ u.jsxs("div", { style: { position: "relative" }, children: [
2064
+ /* @__PURE__ */ u.jsx(
2065
+ ke,
1072
2066
  {
1073
- ...E,
2067
+ ...q,
1074
2068
  value: o,
1075
- onChange: B,
1076
- onFocus: L,
1077
- onBlur: q,
1078
- placeholder: H(),
2069
+ onChange: K,
2070
+ onFocus: H,
2071
+ onBlur: G,
2072
+ placeholder: Q(),
1079
2073
  style: {
1080
2074
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1081
- ...E.style,
2075
+ ...q.style,
1082
2076
  position: "relative",
1083
2077
  zIndex: 1
1084
2078
  }
1085
2079
  }
1086
2080
  ),
1087
- !h && !o && m && /* @__PURE__ */ r.jsxs(
2081
+ !d && !o && p && /* @__PURE__ */ u.jsxs(
1088
2082
  "div",
1089
2083
  {
1090
2084
  style: {
@@ -1104,8 +2098,8 @@ const Me = ({
1104
2098
  fontFamily: "inherit"
1105
2099
  },
1106
2100
  children: [
1107
- /* @__PURE__ */ r.jsx("span", { children: m }),
1108
- V && /* @__PURE__ */ r.jsx(
2101
+ /* @__PURE__ */ u.jsx("span", { children: p }),
2102
+ v && /* @__PURE__ */ u.jsx(
1109
2103
  "span",
1110
2104
  {
1111
2105
  style: {
@@ -1121,7 +2115,7 @@ const Me = ({
1121
2115
  ]
1122
2116
  }
1123
2117
  ),
1124
- /* @__PURE__ */ r.jsx("style", { children: `
2118
+ /* @__PURE__ */ u.jsx("style", { children: `
1125
2119
  @keyframes blink {
1126
2120
  0%, 50% { opacity: 1; }
1127
2121
  51%, 100% { opacity: 0; }
@@ -1129,7 +2123,7 @@ const Me = ({
1129
2123
  ` })
1130
2124
  ] });
1131
2125
  };
1132
- Me.__docgenInfo = {
2126
+ dt.__docgenInfo = {
1133
2127
  displayName: "DynamicInput",
1134
2128
  description: "动态文案输入框组件,支持流式文字动画效果",
1135
2129
  props: {
@@ -1174,109 +2168,109 @@ Me.__docgenInfo = {
1174
2168
  }
1175
2169
  }
1176
2170
  };
1177
- const $e = ({
2171
+ const pt = ({
1178
2172
  texts: n = [],
1179
2173
  // 动态文案数组,默认为空数组
1180
- placeholder: s = "请输入内容",
2174
+ placeholder: m = "请输入内容",
1181
2175
  // 占位符文本
1182
- animationSpeed: i = 100,
2176
+ animationSpeed: c = 100,
1183
2177
  // 打字机动画速度,毫秒
1184
- autoPlay: l = !0,
2178
+ autoPlay: a = !0,
1185
2179
  // 是否自动播放动画
1186
2180
  value: o = "",
1187
2181
  // 受控模式的值
1188
- onChange: d,
2182
+ onChange: h,
1189
2183
  // 受控模式的变化回调
1190
- onSubmit: E,
2184
+ onSubmit: q,
1191
2185
  // 提交回调
1192
- maxLength: m = 500,
2186
+ maxLength: p = 500,
1193
2187
  // 最大字符数限制
1194
- showCount: S = !0,
2188
+ showCount: e = !0,
1195
2189
  // 是否显示字数统计
1196
- submitText: _ = "发送",
2190
+ submitText: t = "发送",
1197
2191
  // 提交按钮文本
1198
- disabled: k = !1,
2192
+ disabled: N = !1,
1199
2193
  // 是否禁用组件
1200
- rows: N = 4,
2194
+ rows: s = 4,
1201
2195
  // 文本域行数
1202
- style: I,
2196
+ style: k,
1203
2197
  // 自定义样式
1204
- ...h
2198
+ ...d
1205
2199
  // 其他原生属性
1206
2200
  }) => {
1207
- const [P, V] = j(""), [a, p] = j(0), [b, T] = j(!1), [g, $] = j(!1), [D, A] = j(!1), [F, x] = j(o || ""), L = z(void 0), q = z(void 0), B = z(n), H = z(a), t = z(g), c = z(P), R = z(null);
1208
- U(() => {
1209
- B.current = n, H.current = a, t.current = g, c.current = P;
2201
+ const [R, v] = z(""), [x, w] = z(0), [A, $] = z(!1), [S, C] = z(!1), [O, I] = z(!1), [D, P] = z(o || ""), H = W(void 0), G = W(void 0), K = W(n), Q = W(x), E = W(S), _ = W(R), F = W(null);
2202
+ J(() => {
2203
+ K.current = n, Q.current = x, E.current = S, _.current = R;
1210
2204
  });
1211
- const C = v((f, y) => {
1212
- let W = 0;
1213
- A(!0);
1214
- const K = () => {
1215
- W < f.length ? (V(f.slice(0, W + 1)), W++, q.current = window.setTimeout(K, i)) : (A(!1), y?.());
2205
+ const X = B((f, b) => {
2206
+ let V = 0;
2207
+ I(!0);
2208
+ const j = () => {
2209
+ V < f.length ? (v(f.slice(0, V + 1)), V++, G.current = window.setTimeout(j, c)) : (I(!1), b?.());
1216
2210
  };
1217
- K();
1218
- }, [i]), G = v((f) => {
1219
- let y = c.current.length;
1220
- const W = () => {
1221
- y > 0 ? (V(c.current.slice(0, y - 1)), y--, q.current = window.setTimeout(W, i / 2)) : f?.();
2211
+ j();
2212
+ }, [c]), ne = B((f) => {
2213
+ let b = _.current.length;
2214
+ const V = () => {
2215
+ b > 0 ? (v(_.current.slice(0, b - 1)), b--, G.current = window.setTimeout(V, c / 2)) : f?.();
1222
2216
  };
1223
- W();
1224
- }, [i]), J = v(() => {
1225
- if (B.current.length === 0 || t.current) return;
1226
- T(!0);
1227
- const f = B.current[H.current];
1228
- c.current ? G(() => {
1229
- C(f, () => {
1230
- L.current = window.setTimeout(() => {
1231
- p((y) => (y + 1) % B.current.length), T(!1);
2217
+ V();
2218
+ }, [c]), re = B(() => {
2219
+ if (K.current.length === 0 || E.current) return;
2220
+ $(!0);
2221
+ const f = K.current[Q.current];
2222
+ _.current ? ne(() => {
2223
+ X(f, () => {
2224
+ H.current = window.setTimeout(() => {
2225
+ w((b) => (b + 1) % K.current.length), $(!1);
1232
2226
  }, 2e3);
1233
2227
  });
1234
- }) : C(f, () => {
1235
- L.current = window.setTimeout(() => {
1236
- p((y) => (y + 1) % B.current.length), T(!1);
2228
+ }) : X(f, () => {
2229
+ H.current = window.setTimeout(() => {
2230
+ w((b) => (b + 1) % K.current.length), $(!1);
1237
2231
  }, 2e3);
1238
2232
  });
1239
- }, [G, C]);
1240
- U(() => (l && n.length > 0 && !g && J(), () => {
1241
- L.current && window.clearTimeout(L.current), q.current && window.clearTimeout(q.current);
1242
- }), [a, g, l, n.length, J]), U(() => {
1243
- !b && l && n.length > 0 && !g && J();
1244
- }, [a, b, l, n.length, g, J]);
1245
- const e = (f) => {
1246
- $(!0), L.current && window.clearTimeout(L.current), q.current && window.clearTimeout(q.current), T(!1), A(!1), h.onFocus?.(f);
1247
- }, u = (f) => {
1248
- $(!1), !o && n.length > 0 && (V(""), p(0)), h.onBlur?.(f);
1249
- }, w = (f) => {
1250
- const y = f.target.value;
1251
- m && y.length > m || (d ? d(y) : x(y), h.onChange?.(f));
1252
- }, O = () => {
1253
- const f = d ? o : F;
1254
- f.trim() && !k && (E?.(f), d || x(""));
1255
- }, Y = (f) => {
1256
- (f.ctrlKey || f.metaKey) && f.key === "Enter" && (f.preventDefault(), O()), h.onKeyDown?.(f);
1257
- }, M = d ? o : F, Q = k || !M.trim() || (m ? M.length > m : !1);
1258
- return /* @__PURE__ */ r.jsxs("div", { style: { position: "relative", ...I }, children: [
1259
- /* @__PURE__ */ r.jsxs("div", { style: { position: "relative" }, children: [
1260
- /* @__PURE__ */ r.jsx(
2233
+ }, [ne, X]);
2234
+ J(() => (a && n.length > 0 && !S && re(), () => {
2235
+ H.current && window.clearTimeout(H.current), G.current && window.clearTimeout(G.current);
2236
+ }), [x, S, a, n.length, re]), J(() => {
2237
+ !A && a && n.length > 0 && !S && re();
2238
+ }, [x, A, a, n.length, S, re]);
2239
+ const l = (f) => {
2240
+ C(!0), H.current && window.clearTimeout(H.current), G.current && window.clearTimeout(G.current), $(!1), I(!1), d.onFocus?.(f);
2241
+ }, r = (f) => {
2242
+ C(!1), !o && n.length > 0 && (v(""), w(0)), d.onBlur?.(f);
2243
+ }, i = (f) => {
2244
+ const b = f.target.value;
2245
+ p && b.length > p || (h ? h(b) : P(b), d.onChange?.(f));
2246
+ }, y = () => {
2247
+ const f = h ? o : D;
2248
+ f.trim() && !N && (q?.(f), h || P(""));
2249
+ }, T = (f) => {
2250
+ (f.ctrlKey || f.metaKey) && f.key === "Enter" && (f.preventDefault(), y()), d.onKeyDown?.(f);
2251
+ }, g = h ? o : D, L = N || !g.trim() || (p ? g.length > p : !1);
2252
+ return /* @__PURE__ */ u.jsxs("div", { style: { position: "relative", ...k }, children: [
2253
+ /* @__PURE__ */ u.jsxs("div", { style: { position: "relative" }, children: [
2254
+ /* @__PURE__ */ u.jsx(
1261
2255
  "textarea",
1262
2256
  {
1263
- ref: R,
1264
- value: d ? o : F,
1265
- onChange: w,
2257
+ ref: F,
2258
+ value: h ? o : D,
2259
+ onChange: i,
1266
2260
  onFocus: (f) => {
1267
- f.target.style.borderColor = "#1890ff", f.target.style.boxShadow = "0 0 0 2px rgba(24, 144, 255, 0.2)", e(f);
2261
+ f.target.style.borderColor = "#1890ff", f.target.style.boxShadow = "0 0 0 2px rgba(24, 144, 255, 0.2)", l(f);
1268
2262
  },
1269
2263
  onBlur: (f) => {
1270
- f.target.style.borderColor = "#d9d9d9", f.target.style.boxShadow = "none", u(f);
2264
+ f.target.style.borderColor = "#d9d9d9", f.target.style.boxShadow = "none", r(f);
1271
2265
  },
1272
- onKeyDown: Y,
1273
- placeholder: g || M ? s : "",
1274
- maxLength: m,
1275
- rows: N,
1276
- disabled: k,
2266
+ onKeyDown: T,
2267
+ placeholder: S || g ? m : "",
2268
+ maxLength: p,
2269
+ rows: s,
2270
+ disabled: N,
1277
2271
  style: {
1278
2272
  width: "100%",
1279
- minHeight: `${N * 24 + 16}px`,
2273
+ minHeight: `${s * 24 + 16}px`,
1280
2274
  padding: "8px 60px 8px 12px",
1281
2275
  // 右侧留出按钮空间
1282
2276
  border: "1px solid #d9d9d9",
@@ -1289,12 +2283,12 @@ const $e = ({
1289
2283
  transition: "border-color 0.3s, box-shadow 0.3s",
1290
2284
  backgroundColor: "#fff",
1291
2285
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
1292
- ...h.style
2286
+ ...d.style
1293
2287
  },
1294
- ...h
2288
+ ...d
1295
2289
  }
1296
2290
  ),
1297
- !g && !M && P && /* @__PURE__ */ r.jsxs(
2291
+ !S && !g && R && /* @__PURE__ */ u.jsxs(
1298
2292
  "div",
1299
2293
  {
1300
2294
  style: {
@@ -1316,8 +2310,8 @@ const $e = ({
1316
2310
  lineHeight: "1.5"
1317
2311
  },
1318
2312
  children: [
1319
- /* @__PURE__ */ r.jsx("span", { children: P }),
1320
- D && /* @__PURE__ */ r.jsx(
2313
+ /* @__PURE__ */ u.jsx("span", { children: R }),
2314
+ O && /* @__PURE__ */ u.jsx(
1321
2315
  "span",
1322
2316
  {
1323
2317
  style: {
@@ -1333,7 +2327,7 @@ const $e = ({
1333
2327
  ]
1334
2328
  }
1335
2329
  ),
1336
- /* @__PURE__ */ r.jsx(
2330
+ /* @__PURE__ */ u.jsx(
1337
2331
  "div",
1338
2332
  {
1339
2333
  style: {
@@ -1342,14 +2336,14 @@ const $e = ({
1342
2336
  right: 8,
1343
2337
  zIndex: 3
1344
2338
  },
1345
- children: /* @__PURE__ */ r.jsx(
1346
- X,
2339
+ children: /* @__PURE__ */ u.jsx(
2340
+ le,
1347
2341
  {
1348
2342
  type: "primary",
1349
2343
  size: "small",
1350
- icon: /* @__PURE__ */ r.jsx(Se, {}),
1351
- onClick: O,
1352
- disabled: Q,
2344
+ icon: /* @__PURE__ */ u.jsx(Pe, {}),
2345
+ onClick: y,
2346
+ disabled: L,
1353
2347
  style: {
1354
2348
  borderRadius: 6,
1355
2349
  minWidth: 32,
@@ -1358,13 +2352,13 @@ const $e = ({
1358
2352
  alignItems: "center",
1359
2353
  justifyContent: "center"
1360
2354
  },
1361
- children: _
2355
+ children: t
1362
2356
  }
1363
2357
  )
1364
2358
  }
1365
2359
  )
1366
2360
  ] }),
1367
- S && /* @__PURE__ */ r.jsxs(
2361
+ e && /* @__PURE__ */ u.jsxs(
1368
2362
  "div",
1369
2363
  {
1370
2364
  style: {
@@ -1374,13 +2368,13 @@ const $e = ({
1374
2368
  color: "#999"
1375
2369
  },
1376
2370
  children: [
1377
- M.length,
2371
+ g.length,
1378
2372
  "/",
1379
- m
2373
+ p
1380
2374
  ]
1381
2375
  }
1382
2376
  ),
1383
- /* @__PURE__ */ r.jsx("style", { children: `
2377
+ /* @__PURE__ */ u.jsx("style", { children: `
1384
2378
  @keyframes blink {
1385
2379
  0%, 50% { opacity: 1; }
1386
2380
  51%, 100% { opacity: 0; }
@@ -1388,7 +2382,7 @@ const $e = ({
1388
2382
  ` })
1389
2383
  ] });
1390
2384
  };
1391
- $e.__docgenInfo = {
2385
+ pt.__docgenInfo = {
1392
2386
  displayName: "DynamicTextArea",
1393
2387
  description: "动态文案文本域组件,支持流式文字动画效果",
1394
2388
  props: {
@@ -1474,96 +2468,96 @@ $e.__docgenInfo = {
1474
2468
  }
1475
2469
  }
1476
2470
  };
1477
- const de = ({
2471
+ const Te = ({
1478
2472
  src: n,
1479
- poster: s,
1480
- width: i = 300,
1481
- height: l,
2473
+ poster: m,
2474
+ width: c = 300,
2475
+ height: a,
1482
2476
  videoWidth: o,
1483
2477
  // 参数保留但不使用,由CSS控制
1484
- videoHeight: d,
2478
+ videoHeight: h,
1485
2479
  // 参数保留但不使用,由CSS控制
1486
- showPlayButton: E = !0,
1487
- autoPlayOnHover: m = !0,
1488
- onClick: S,
1489
- onVideoLoaded: _,
1490
- onVideoPlay: k,
1491
- onVideoPause: N,
1492
- onVideoEnded: I,
1493
- className: h,
1494
- style: P,
1495
- ...V
2480
+ showPlayButton: q = !0,
2481
+ autoPlayOnHover: p = !0,
2482
+ onClick: e,
2483
+ onVideoLoaded: t,
2484
+ onVideoPlay: N,
2485
+ onVideoPause: s,
2486
+ onVideoEnded: k,
2487
+ className: d,
2488
+ style: R,
2489
+ ...v
1496
2490
  }) => {
1497
- const a = z(null), [p, b] = j(!1), [T, g] = j(!1), [$, D] = j(!1), A = v(() => {
1498
- a.current && (a.current.play(), b(!0), k?.());
1499
- }, [k]), F = v(() => {
1500
- a.current && (a.current.pause(), b(!1), N?.());
1501
- }, [N]), x = v((C) => {
1502
- C.stopPropagation(), p ? F() : A();
1503
- }, [p, A, F]), L = v(() => {
1504
- g(!0), m && !p && A();
1505
- }, [m, p, A]), q = v(() => {
1506
- g(!1), m && p && F();
1507
- }, [m, p, F]), B = v(() => {
1508
- D(!0), _?.();
1509
- }, [_]), H = v(() => {
1510
- b(!0), k?.();
1511
- }, [k]), t = v(() => {
1512
- b(!1), N?.();
1513
- }, [N]), c = v(() => {
1514
- b(!1), I?.();
1515
- }, [I]), R = v((C) => {
1516
- S?.(C);
1517
- }, [S]);
1518
- return /* @__PURE__ */ r.jsx(
1519
- te,
2491
+ const x = W(null), [w, A] = z(!1), [$, S] = z(!1), [C, O] = z(!1), I = B(() => {
2492
+ x.current && (x.current.play(), A(!0), N?.());
2493
+ }, [N]), D = B(() => {
2494
+ x.current && (x.current.pause(), A(!1), s?.());
2495
+ }, [s]), P = B((X) => {
2496
+ X.stopPropagation(), w ? D() : I();
2497
+ }, [w, I, D]), H = B(() => {
2498
+ S(!0), p && !w && I();
2499
+ }, [p, w, I]), G = B(() => {
2500
+ S(!1), p && w && D();
2501
+ }, [p, w, D]), K = B(() => {
2502
+ O(!0), t?.();
2503
+ }, [t]), Q = B(() => {
2504
+ A(!0), N?.();
2505
+ }, [N]), E = B(() => {
2506
+ A(!1), s?.();
2507
+ }, [s]), _ = B(() => {
2508
+ A(!1), k?.();
2509
+ }, [k]), F = B((X) => {
2510
+ e?.(X);
2511
+ }, [e]);
2512
+ return /* @__PURE__ */ u.jsx(
2513
+ he,
1520
2514
  {
1521
- ...V,
1522
- className: `video-card ${h || ""}`,
2515
+ ...v,
2516
+ className: `video-card ${d || ""}`,
1523
2517
  style: {
1524
- width: i,
1525
- height: l,
2518
+ width: c,
2519
+ height: a,
1526
2520
  padding: 0,
1527
2521
  overflow: "hidden",
1528
- cursor: S ? "pointer" : "default",
2522
+ cursor: e ? "pointer" : "default",
1529
2523
  border: "none",
1530
2524
  borderRadius: 0,
1531
- ...P
2525
+ ...R
1532
2526
  },
1533
2527
  bordered: !1,
1534
- onMouseEnter: L,
1535
- onMouseLeave: q,
1536
- onClick: R,
1537
- children: /* @__PURE__ */ r.jsxs("div", { className: "video-card-container", children: [
1538
- /* @__PURE__ */ r.jsx(
2528
+ onMouseEnter: H,
2529
+ onMouseLeave: G,
2530
+ onClick: F,
2531
+ children: /* @__PURE__ */ u.jsxs("div", { className: "video-card-container", children: [
2532
+ /* @__PURE__ */ u.jsx(
1539
2533
  "video",
1540
2534
  {
1541
- ref: a,
2535
+ ref: x,
1542
2536
  src: n,
1543
- poster: s,
2537
+ poster: m,
1544
2538
  preload: "metadata",
1545
- onLoadedData: B,
1546
- onPlay: H,
1547
- onPause: t,
1548
- onEnded: c,
2539
+ onLoadedData: K,
2540
+ onPlay: Q,
2541
+ onPause: E,
2542
+ onEnded: _,
1549
2543
  muted: !0,
1550
2544
  loop: !0
1551
2545
  }
1552
2546
  ),
1553
- E && /* @__PURE__ */ r.jsx(
2547
+ q && /* @__PURE__ */ u.jsx(
1554
2548
  "div",
1555
2549
  {
1556
- className: `video-play-button ${T ? "hovered" : ""}`,
1557
- onClick: x,
1558
- children: p ? /* @__PURE__ */ r.jsx(qe, { className: "play-icon" }) : /* @__PURE__ */ r.jsx(Ce, { className: "play-icon" })
2550
+ className: `video-play-button ${$ ? "hovered" : ""}`,
2551
+ onClick: P,
2552
+ children: w ? /* @__PURE__ */ u.jsx(Me, { className: "play-icon" }) : /* @__PURE__ */ u.jsx(De, { className: "play-icon" })
1559
2553
  }
1560
2554
  ),
1561
- !$ && /* @__PURE__ */ r.jsx("div", { className: "video-loading-mask", children: /* @__PURE__ */ r.jsx("div", { className: "loading-spinner" }) })
2555
+ !C && /* @__PURE__ */ u.jsx("div", { className: "video-loading-mask", children: /* @__PURE__ */ u.jsx("div", { className: "loading-spinner" }) })
1562
2556
  ] })
1563
2557
  }
1564
2558
  );
1565
2559
  };
1566
- de.__docgenInfo = {
2560
+ Te.__docgenInfo = {
1567
2561
  displayName: "VideoCard",
1568
2562
  description: "视频卡片组件,支持鼠标悬浮播放控制",
1569
2563
  props: {
@@ -1664,11 +2658,11 @@ de.__docgenInfo = {
1664
2658
  }
1665
2659
  }
1666
2660
  };
1667
- const De = (n) => [".mp4", ".webm", ".ogg", ".mov", ".avi", ".wmv", ".flv", ".mkv"].some((i) => n.toLowerCase().includes(i)), We = (n) => n.type ? n.type : De(n.url) ? "video" : "image", He = ({
2661
+ const ft = (n) => [".mp4", ".webm", ".ogg", ".mov", ".avi", ".wmv", ".flv", ".mkv"].some((c) => n.toLowerCase().includes(c)), mt = (n) => n.type ? n.type : ft(n.url) ? "video" : "image", yt = ({
1668
2662
  items: n,
1669
- columns: s,
1670
- gap: i = 0,
1671
- responsive: l = !0,
2663
+ columns: m,
2664
+ gap: c = 0,
2665
+ responsive: a = !0,
1672
2666
  breakpoints: o = {
1673
2667
  xs: 1,
1674
2668
  sm: 2,
@@ -1677,108 +2671,108 @@ const De = (n) => [".mp4", ".webm", ".ogg", ".mov", ".avi", ".wmv", ".flv", ".mk
1677
2671
  xl: 5,
1678
2672
  xxl: 6
1679
2673
  },
1680
- className: d,
1681
- style: E,
1682
- onClick: m
2674
+ className: h,
2675
+ style: q,
2676
+ onClick: p
1683
2677
  }) => {
1684
- const S = z(null), [_, k] = j(s || o.md || 3), N = z(/* @__PURE__ */ new Map()), I = v(() => {
1685
- if (!l || s)
1686
- return s || o.md || 3;
1687
- const a = window.innerWidth;
1688
- return a < 576 ? o.xs || 1 : a < 768 ? o.sm || 2 : a < 992 ? o.md || 3 : a < 1200 ? o.lg || 4 : a < 1600 ? o.xl || 5 : o.xxl || 6;
1689
- }, [l, s, o]), h = v(() => {
1690
- if (!S.current) return;
1691
- const a = _, p = S.current, T = (p.offsetWidth - i * (a - 1)) / a, g = new Array(a).fill(0);
1692
- n.forEach((D, A) => {
1693
- const F = D.id || A, x = N.current.get(F);
1694
- if (!x) return;
1695
- const L = Math.min(...g), q = g.indexOf(L), B = q * (T + i), H = g[q];
1696
- x.style.position = "absolute", x.style.left = `${B}px`, x.style.top = `${H}px`, x.style.width = `${T}px`, g[q] += x.offsetHeight + i;
2678
+ const e = W(null), [t, N] = z(m || o.md || 3), s = W(/* @__PURE__ */ new Map()), k = B(() => {
2679
+ if (!a || m)
2680
+ return m || o.md || 3;
2681
+ const x = window.innerWidth;
2682
+ return x < 576 ? o.xs || 1 : x < 768 ? o.sm || 2 : x < 992 ? o.md || 3 : x < 1200 ? o.lg || 4 : x < 1600 ? o.xl || 5 : o.xxl || 6;
2683
+ }, [a, m, o]), d = B(() => {
2684
+ if (!e.current) return;
2685
+ const x = t, w = e.current, $ = (w.offsetWidth - c * (x - 1)) / x, S = new Array(x).fill(0);
2686
+ n.forEach((O, I) => {
2687
+ const D = O.id || I, P = s.current.get(D);
2688
+ if (!P) return;
2689
+ const H = Math.min(...S), G = S.indexOf(H), K = G * ($ + c), Q = S[G];
2690
+ P.style.position = "absolute", P.style.left = `${K}px`, P.style.top = `${Q}px`, P.style.width = `${$}px`, S[G] += P.offsetHeight + c;
1697
2691
  });
1698
- const $ = Math.max(...g);
1699
- p.style.height = `${$}px`;
1700
- }, [n, _, i]);
1701
- U(() => {
1702
- const a = () => {
1703
- const p = I();
1704
- p !== _ && k(p);
2692
+ const C = Math.max(...S);
2693
+ w.style.height = `${C}px`;
2694
+ }, [n, t, c]);
2695
+ J(() => {
2696
+ const x = () => {
2697
+ const w = k();
2698
+ w !== t && N(w);
1705
2699
  };
1706
- if (l)
1707
- return window.addEventListener("resize", a), a(), () => window.removeEventListener("resize", a);
1708
- }, [l, I, _]), U(() => {
1709
- const a = setTimeout(() => {
1710
- h();
2700
+ if (a)
2701
+ return window.addEventListener("resize", x), x(), () => window.removeEventListener("resize", x);
2702
+ }, [a, k, t]), J(() => {
2703
+ const x = setTimeout(() => {
2704
+ d();
1711
2705
  }, 100);
1712
- return () => clearTimeout(a);
1713
- }, [n, _, h]);
1714
- const P = v(() => {
1715
- h();
1716
- }, [h]), V = v((a) => {
1717
- m && m(a), a.onClick?.(a);
1718
- }, [m]);
1719
- return /* @__PURE__ */ r.jsx(
2706
+ return () => clearTimeout(x);
2707
+ }, [n, t, d]);
2708
+ const R = B(() => {
2709
+ d();
2710
+ }, [d]), v = B((x) => {
2711
+ p && p(x), x.onClick?.(x);
2712
+ }, [p]);
2713
+ return /* @__PURE__ */ u.jsx(
1720
2714
  "div",
1721
2715
  {
1722
- ref: S,
1723
- className: `waterfall-container ${d || ""}`,
2716
+ ref: e,
2717
+ className: `waterfall-container ${h || ""}`,
1724
2718
  style: {
1725
2719
  position: "relative",
1726
2720
  width: "100%",
1727
- ...E
2721
+ ...q
1728
2722
  },
1729
- children: n.map((a, p) => {
1730
- const b = a.id || p, T = We(a);
1731
- return /* @__PURE__ */ r.jsx(
2723
+ children: n.map((x, w) => {
2724
+ const A = x.id || w, $ = mt(x);
2725
+ return /* @__PURE__ */ u.jsx(
1732
2726
  "div",
1733
2727
  {
1734
- ref: (g) => {
1735
- g ? N.current.set(b, g) : N.current.delete(b);
2728
+ ref: (S) => {
2729
+ S ? s.current.set(A, S) : s.current.delete(A);
1736
2730
  },
1737
2731
  className: "waterfall-item",
1738
- children: T === "video" ? /* @__PURE__ */ r.jsx("div", { style: {
2732
+ children: $ === "video" ? /* @__PURE__ */ u.jsx("div", { style: {
1739
2733
  width: "100%",
1740
2734
  position: "relative",
1741
2735
  paddingBottom: "56.25%",
1742
- cursor: m || a.onClick ? "pointer" : "default"
1743
- }, children: /* @__PURE__ */ r.jsx("div", { style: { position: "absolute", top: 0, left: 0, width: "100%", height: "100%" }, children: /* @__PURE__ */ r.jsx(
1744
- de,
2736
+ cursor: p || x.onClick ? "pointer" : "default"
2737
+ }, children: /* @__PURE__ */ u.jsx("div", { style: { position: "absolute", top: 0, left: 0, width: "100%", height: "100%" }, children: /* @__PURE__ */ u.jsx(
2738
+ Te,
1745
2739
  {
1746
- src: a.url,
1747
- poster: a.poster,
2740
+ src: x.url,
2741
+ poster: x.poster,
1748
2742
  width: "100%",
1749
2743
  height: "100%",
1750
- onClick: () => V(a),
1751
- onVideoLoaded: P,
2744
+ onClick: () => v(x),
2745
+ onVideoLoaded: R,
1752
2746
  autoPlayOnHover: !0,
1753
2747
  showPlayButton: !1
1754
2748
  }
1755
- ) }) }) : /* @__PURE__ */ r.jsx(
2749
+ ) }) }) : /* @__PURE__ */ u.jsx(
1756
2750
  "div",
1757
2751
  {
1758
2752
  className: "waterfall-image-wrapper",
1759
- onClick: () => V(a),
1760
- style: { cursor: m || a.onClick ? "pointer" : "default" },
1761
- children: /* @__PURE__ */ r.jsx(
2753
+ onClick: () => v(x),
2754
+ style: { cursor: p || x.onClick ? "pointer" : "default" },
2755
+ children: /* @__PURE__ */ u.jsx(
1762
2756
  "img",
1763
2757
  {
1764
- src: a.url,
1765
- alt: `瀑布流图片 ${p + 1}`,
2758
+ src: x.url,
2759
+ alt: `瀑布流图片 ${w + 1}`,
1766
2760
  className: "waterfall-image",
1767
- onLoad: P,
1768
- onError: P,
2761
+ onLoad: R,
2762
+ onError: R,
1769
2763
  style: { display: "block", width: "100%", height: "auto" }
1770
2764
  }
1771
2765
  )
1772
2766
  }
1773
2767
  )
1774
2768
  },
1775
- b
2769
+ A
1776
2770
  );
1777
2771
  })
1778
2772
  }
1779
2773
  );
1780
2774
  };
1781
- He.__docgenInfo = {
2775
+ yt.__docgenInfo = {
1782
2776
  displayName: "Waterfall",
1783
2777
  description: "瀑布流布局组件,支持图片和视频混合展示",
1784
2778
  props: {
@@ -1834,8 +2828,8 @@ He.__docgenInfo = {
1834
2828
  }
1835
2829
  }
1836
2830
  };
1837
- const Je = {
1838
- algorithm: we.defaultAlgorithm,
2831
+ const vt = {
2832
+ algorithm: je.defaultAlgorithm,
1839
2833
  token: {
1840
2834
  // 主色
1841
2835
  colorPrimary: "#3b82f6",
@@ -1901,19 +2895,20 @@ const Je = {
1901
2895
  }
1902
2896
  };
1903
2897
  export {
1904
- Be as AdvancedTable,
1905
- Ie as AppModal,
1906
- ze as BackButton,
1907
- ke as Button,
1908
- Ne as Card,
1909
- Me as DynamicInput,
1910
- $e as DynamicTextArea,
1911
- Oe as EmptyAndSpin,
1912
- Fe as LinkButton,
1913
- Pe as PageTable,
1914
- de as VideoCard,
1915
- He as Waterfall,
1916
- Ae as XcIcon,
1917
- Je as lightTheme
2898
+ tt as AdvancedTable,
2899
+ Ke as AppModal,
2900
+ Qe as BackButton,
2901
+ He as Button,
2902
+ We as Card,
2903
+ dt as DynamicInput,
2904
+ pt as DynamicTextArea,
2905
+ Je as EmptyAndSpin,
2906
+ Ze as LinkButton,
2907
+ Xe as PageTable,
2908
+ ut as RichTextEditor,
2909
+ Te as VideoCard,
2910
+ yt as Waterfall,
2911
+ Ue as XcIcon,
2912
+ vt as lightTheme
1918
2913
  };
1919
2914
  //# sourceMappingURL=index.es.js.map