@mxmweb/zui-components 1.2.3 → 1.2.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/index.js +738 -720
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import me, { useState as
|
|
3
|
-
import J, { createGlobalStyle as
|
|
4
|
-
import { useTheme as
|
|
5
|
-
import
|
|
6
|
-
import { CircleHelp as
|
|
7
|
-
import { Form as K, Input as fe, Select as
|
|
8
|
-
import { Button as
|
|
9
|
-
const
|
|
1
|
+
import { jsxs as O, jsx as o, Fragment as na } from "react/jsx-runtime";
|
|
2
|
+
import me, { useState as ie, useMemo as Se, useEffect as we, useRef as Te, useCallback as he } from "react";
|
|
3
|
+
import J, { createGlobalStyle as pa } from "styled-components";
|
|
4
|
+
import { useTheme as Fe, deepMergeTheme as $e, defaultTheme as B } from "@mxmweb/zui-theme";
|
|
5
|
+
import zr from "animejs/lib/anime.es.js";
|
|
6
|
+
import { CircleHelp as oa, Trash as fa, File as ke, AlertCircle as _r, Upload as ma, ChevronDown as ba, ChevronRight as ga, Search as xa, CircleX as ya } from "lucide-react";
|
|
7
|
+
import { Form as K, Input as fe, Select as tr, InputNumber as nr, Slider as Ar, Switch as Br, DatePicker as or, Radio as Wr, Checkbox as Rr, TimePicker as qr, Tooltip as cr, Button as Lr, Tag as $a } from "antd";
|
|
8
|
+
import { Button as er, DropdownMenu as va, SharedPagination as wa } from "@mxmweb/zui-elements";
|
|
9
|
+
const ka = J.div`
|
|
10
10
|
background-color: #ffffff;
|
|
11
11
|
box-shadow: 0 2px 12px rgba(0,0,0,0.08);
|
|
12
12
|
border-radius: ${(e) => {
|
|
@@ -16,7 +16,7 @@ const da = J.div`
|
|
|
16
16
|
height: 90vh;
|
|
17
17
|
overflow: hidden;
|
|
18
18
|
position: relative;
|
|
19
|
-
`,
|
|
19
|
+
`, Sa = () => {
|
|
20
20
|
we(() => {
|
|
21
21
|
const e = "goggle-nav-icon-styles";
|
|
22
22
|
if (!document.getElementById(e)) {
|
|
@@ -35,7 +35,7 @@ const da = J.div`
|
|
|
35
35
|
`, document.head.appendChild(r);
|
|
36
36
|
}
|
|
37
37
|
}, []);
|
|
38
|
-
},
|
|
38
|
+
}, Ft = ({
|
|
39
39
|
items: e,
|
|
40
40
|
activePath: r,
|
|
41
41
|
defaultOpen: t = !0,
|
|
@@ -47,38 +47,38 @@ const da = J.div`
|
|
|
47
47
|
style: f,
|
|
48
48
|
styles: N
|
|
49
49
|
}) => {
|
|
50
|
-
const M =
|
|
50
|
+
const M = Fe(), C = $e(
|
|
51
51
|
// 基础:默认主题 + useTheme的配置
|
|
52
|
-
|
|
52
|
+
$e({ theme: B, mode: "light" }, M),
|
|
53
53
|
// 最高层:用户手动传入的styles
|
|
54
54
|
N
|
|
55
55
|
);
|
|
56
|
-
|
|
57
|
-
const [W, l] =
|
|
56
|
+
Sa();
|
|
57
|
+
const [W, l] = ie(t), _ = typeof s == "boolean" ? s : W, U = (v) => {
|
|
58
58
|
typeof s == "boolean" || l(v), h == null || h(v);
|
|
59
|
-
}, [
|
|
59
|
+
}, [ae, te] = ie(!1), a = (v) => v ? typeof v == "string" ? /* @__PURE__ */ o("img", { src: v, className: "w-6 h-6 transition-all duration-200", alt: "nav" }) : v : null, T = Se(() => ({
|
|
60
60
|
width: _ ? "60px" : "20px",
|
|
61
61
|
minWidth: _ ? "60px" : "20px",
|
|
62
62
|
transition: "all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"
|
|
63
63
|
}), [_]);
|
|
64
|
-
return /* @__PURE__ */
|
|
64
|
+
return /* @__PURE__ */ O(ka, { $theme: C.theme || B, className: `relative ${d || ""}`, style: { ...T, ...f }, children: [
|
|
65
65
|
/* @__PURE__ */ o(
|
|
66
66
|
"div",
|
|
67
67
|
{
|
|
68
|
-
onMouseEnter: () =>
|
|
69
|
-
onMouseLeave: () =>
|
|
68
|
+
onMouseEnter: () => te(!0),
|
|
69
|
+
onMouseLeave: () => te(!1),
|
|
70
70
|
className: "absolute top-1/2 -translate-y-1/2 right-1 w-6 h-6 cursor-pointer z-20 transition-all duration-300",
|
|
71
|
-
onClick: () =>
|
|
71
|
+
onClick: () => U(!_),
|
|
72
72
|
"aria-label": _ ? "收起" : "展开",
|
|
73
73
|
role: "button",
|
|
74
|
-
children: /* @__PURE__ */ o("div", { className: "group flex items-center justify-center w-6 h-6 rounded-full transition-all duration-200", children: /* @__PURE__ */
|
|
75
|
-
/* @__PURE__ */ o("div", { className: `absolute w-[2px] h-3 bg-gray-400 rounded-full transition-all duration-300 ${
|
|
74
|
+
children: /* @__PURE__ */ o("div", { className: "group flex items-center justify-center w-6 h-6 rounded-full transition-all duration-200", children: /* @__PURE__ */ O("div", { className: "relative w-4 h-4 flex items-center justify-center", children: [
|
|
75
|
+
/* @__PURE__ */ o("div", { className: `absolute w-[2px] h-3 bg-gray-400 rounded-full transition-all duration-300 ${ae ? "opacity-0 scale-0" : "opacity-100 scale-100"}` }),
|
|
76
76
|
/* @__PURE__ */ o(
|
|
77
77
|
"svg",
|
|
78
78
|
{
|
|
79
79
|
viewBox: "0 0 24 24",
|
|
80
80
|
fill: "none",
|
|
81
|
-
className: `absolute w-4 h-4 stroke-gray-400 transition-all duration-300 ${
|
|
81
|
+
className: `absolute w-4 h-4 stroke-gray-400 transition-all duration-300 ${ae ? "opacity-100 scale-100" : "opacity-0 scale-0"} ${_ ? "rotate-0" : "rotate-180"}`,
|
|
82
82
|
strokeWidth: "2",
|
|
83
83
|
strokeLinecap: "round",
|
|
84
84
|
strokeLinejoin: "round",
|
|
@@ -88,7 +88,7 @@ const da = J.div`
|
|
|
88
88
|
] }) })
|
|
89
89
|
}
|
|
90
90
|
),
|
|
91
|
-
/* @__PURE__ */
|
|
91
|
+
/* @__PURE__ */ O(
|
|
92
92
|
"div",
|
|
93
93
|
{
|
|
94
94
|
className: "h-full py-6 px-[2px] flex flex-col items-center",
|
|
@@ -100,14 +100,14 @@ const da = J.div`
|
|
|
100
100
|
children: [
|
|
101
101
|
/* @__PURE__ */ o("div", { className: "mb-6 transition-transform duration-300 hover:scale-105", children: typeof p == "string" ? /* @__PURE__ */ o("img", { src: p, className: "w-7 h-7", alt: "logo" }) : p || /* @__PURE__ */ o("div", { className: "w-7 h-7 rounded bg-gray-100 flex items-center justify-center text-xs text-gray-500", children: "G" }) }),
|
|
102
102
|
/* @__PURE__ */ o("div", { className: "w-full gap-y-[2px] mb-10 flex-1 overflow-x-hidden overflow-y-auto scrollbar-none flex flex-col items-center", children: e.map((v) => {
|
|
103
|
-
const
|
|
104
|
-
return /* @__PURE__ */
|
|
103
|
+
const V = !!(r && v.path && r.startsWith(v.path)), A = V && v.activeIcon ? v.activeIcon : v.icon;
|
|
104
|
+
return /* @__PURE__ */ O(
|
|
105
105
|
"div",
|
|
106
106
|
{
|
|
107
107
|
onClick: () => !v.disabled && (b == null ? void 0 : b(v)),
|
|
108
|
-
className: `g-nav-item group relative w-full flex flex-col items-center justify-center py-3 px-2 rounded-lg cursor-pointer transition-all duration-200 ${
|
|
108
|
+
className: `g-nav-item group relative w-full flex flex-col items-center justify-center py-3 px-2 rounded-lg cursor-pointer transition-all duration-200 ${V ? "active bg-blue-50" : "text-gray-500 hover:bg-gray-50"}`,
|
|
109
109
|
children: [
|
|
110
|
-
/* @__PURE__ */
|
|
110
|
+
/* @__PURE__ */ O("div", { className: "relative g-nav-icon transition-transform duration-200 group-hover:scale-105", children: [
|
|
111
111
|
a(A),
|
|
112
112
|
v.badge && v.badge > 0 && /* @__PURE__ */ o("span", { className: "absolute -top-1 -right-1 min-w-[16px] h-4 px-1 rounded-full bg-red-500 text-white text-[10px] leading-4 text-center", children: v.badge > 99 ? "99+" : v.badge })
|
|
113
113
|
] }),
|
|
@@ -121,7 +121,7 @@ const da = J.div`
|
|
|
121
121
|
}
|
|
122
122
|
)
|
|
123
123
|
] });
|
|
124
|
-
},
|
|
124
|
+
}, Na = J.div.withConfig({
|
|
125
125
|
shouldForwardProp: (e) => !["itemWidth", "itemGap", "theme"].includes(e)
|
|
126
126
|
})`
|
|
127
127
|
position: relative;
|
|
@@ -150,7 +150,7 @@ const da = J.div`
|
|
|
150
150
|
width: fit-content;
|
|
151
151
|
margin: 0 auto;
|
|
152
152
|
min-width: ${(e) => e.itemWidth * 2}px;
|
|
153
|
-
`,
|
|
153
|
+
`, Ca = J.div.withConfig({
|
|
154
154
|
shouldForwardProp: (e) => !["itemWidth", "itemHeight", "itemGap", "isHovered", "magnification"].includes(e)
|
|
155
155
|
})`
|
|
156
156
|
position: relative;
|
|
@@ -162,7 +162,7 @@ const da = J.div`
|
|
|
162
162
|
transform: ${(e) => e.isHovered ? `scale(${e.magnification})` : "scale(1)"};
|
|
163
163
|
transform-origin: center bottom;
|
|
164
164
|
z-index: ${(e) => e.isHovered ? 10 : 1};
|
|
165
|
-
`,
|
|
165
|
+
`, Ma = J.img.withConfig({
|
|
166
166
|
shouldForwardProp: (e) => !["isActive"].includes(e)
|
|
167
167
|
})`
|
|
168
168
|
width: 80%;
|
|
@@ -175,7 +175,7 @@ const da = J.div`
|
|
|
175
175
|
&:hover {
|
|
176
176
|
filter: none;
|
|
177
177
|
}
|
|
178
|
-
`,
|
|
178
|
+
`, Ta = J.div.withConfig({
|
|
179
179
|
shouldForwardProp: (e) => !["isActive", "theme"].includes(e)
|
|
180
180
|
})`
|
|
181
181
|
position: absolute;
|
|
@@ -191,7 +191,7 @@ const da = J.div`
|
|
|
191
191
|
border-radius: 50%;
|
|
192
192
|
opacity: ${(e) => e.isActive ? 1 : 0};
|
|
193
193
|
transition: opacity 0.2s ease;
|
|
194
|
-
`,
|
|
194
|
+
`, Fa = J.div.withConfig({
|
|
195
195
|
shouldForwardProp: (e) => !["visible", "theme"].includes(e)
|
|
196
196
|
})`
|
|
197
197
|
position: absolute;
|
|
@@ -230,7 +230,7 @@ const da = J.div`
|
|
|
230
230
|
return ((t = (r = e.theme) == null ? void 0 : r.colors) == null ? void 0 : t.text) || "rgba(0, 0, 0, 0.8)";
|
|
231
231
|
}};
|
|
232
232
|
}
|
|
233
|
-
`,
|
|
233
|
+
`, Dt = ({
|
|
234
234
|
items: e,
|
|
235
235
|
itemWidth: r = 48,
|
|
236
236
|
itemHeight: t = 48,
|
|
@@ -245,28 +245,28 @@ const da = J.div`
|
|
|
245
245
|
className: C,
|
|
246
246
|
styles: W
|
|
247
247
|
}) => {
|
|
248
|
-
const l =
|
|
248
|
+
const l = Fe(), _ = $e(
|
|
249
249
|
// 基础:默认主题 + useTheme的配置
|
|
250
|
-
|
|
250
|
+
$e({ theme: B, mode: "light" }, l),
|
|
251
251
|
// 最高层:用户手动传入的styles
|
|
252
252
|
W
|
|
253
|
-
), [
|
|
253
|
+
), [U, ae] = ie(null), [te, a] = ie(null), T = () => b === "multiple" ? d || [] : p || (e.length > 0 ? e[0].id : null), [v, V] = ie(
|
|
254
254
|
b === "single" ? T() : null
|
|
255
|
-
), [A,
|
|
255
|
+
), [A, E] = ie(
|
|
256
256
|
b === "multiple" ? T() : []
|
|
257
|
-
),
|
|
258
|
-
|
|
257
|
+
), j = Te(null), Q = Te([]), X = (G) => {
|
|
258
|
+
ae(G), a(G);
|
|
259
259
|
const S = Q.current[G];
|
|
260
|
-
S &&
|
|
260
|
+
S && zr({
|
|
261
261
|
targets: S,
|
|
262
262
|
scale: s,
|
|
263
263
|
duration: 200,
|
|
264
264
|
easing: "easeOutCubic"
|
|
265
265
|
});
|
|
266
266
|
}, R = (G) => {
|
|
267
|
-
|
|
267
|
+
ae(null), a(null);
|
|
268
268
|
const S = Q.current[G];
|
|
269
|
-
S &&
|
|
269
|
+
S && zr({
|
|
270
270
|
targets: S,
|
|
271
271
|
scale: 1,
|
|
272
272
|
duration: 200,
|
|
@@ -274,10 +274,10 @@ const da = J.div`
|
|
|
274
274
|
});
|
|
275
275
|
}, ee = (G, S) => {
|
|
276
276
|
if (b === "single")
|
|
277
|
-
v !== G.id && (
|
|
277
|
+
v !== G.id && (V(G.id), N && N(G.id, G));
|
|
278
278
|
else {
|
|
279
279
|
const y = A.includes(G.id) ? A.filter((x) => x !== G.id) : [...A, G.id];
|
|
280
|
-
if (
|
|
280
|
+
if (E(y), M) {
|
|
281
281
|
const x = e.filter((D) => y.includes(D.id));
|
|
282
282
|
M(y, x);
|
|
283
283
|
}
|
|
@@ -287,28 +287,28 @@ const da = J.div`
|
|
|
287
287
|
return we(() => {
|
|
288
288
|
Q.current = Q.current.slice(0, e.length);
|
|
289
289
|
}, [e.length]), /* @__PURE__ */ o(
|
|
290
|
-
|
|
290
|
+
Na,
|
|
291
291
|
{
|
|
292
|
-
ref:
|
|
292
|
+
ref: j,
|
|
293
293
|
itemWidth: r,
|
|
294
294
|
itemGap: h,
|
|
295
|
-
theme: _.theme ||
|
|
295
|
+
theme: _.theme || B,
|
|
296
296
|
className: C,
|
|
297
|
-
children: e.map((G, S) => /* @__PURE__ */
|
|
298
|
-
|
|
297
|
+
children: e.map((G, S) => /* @__PURE__ */ O(
|
|
298
|
+
Ca,
|
|
299
299
|
{
|
|
300
300
|
ref: (y) => Q.current[S] = y,
|
|
301
301
|
itemWidth: r,
|
|
302
302
|
itemHeight: t,
|
|
303
303
|
itemGap: h,
|
|
304
|
-
isHovered:
|
|
304
|
+
isHovered: U === S,
|
|
305
305
|
magnification: s,
|
|
306
306
|
onMouseEnter: () => X(S),
|
|
307
307
|
onMouseLeave: () => R(S),
|
|
308
308
|
onClick: () => ee(G, S),
|
|
309
309
|
children: [
|
|
310
310
|
/* @__PURE__ */ o(
|
|
311
|
-
|
|
311
|
+
Ma,
|
|
312
312
|
{
|
|
313
313
|
src: G.icon,
|
|
314
314
|
alt: G.label,
|
|
@@ -316,17 +316,17 @@ const da = J.div`
|
|
|
316
316
|
}
|
|
317
317
|
),
|
|
318
318
|
/* @__PURE__ */ o(
|
|
319
|
-
|
|
319
|
+
Ta,
|
|
320
320
|
{
|
|
321
321
|
isActive: b === "single" ? v === G.id : A.includes(G.id),
|
|
322
|
-
theme: _.theme ||
|
|
322
|
+
theme: _.theme || B
|
|
323
323
|
}
|
|
324
324
|
),
|
|
325
325
|
/* @__PURE__ */ o(
|
|
326
|
-
|
|
326
|
+
Fa,
|
|
327
327
|
{
|
|
328
|
-
visible:
|
|
329
|
-
theme: _.theme ||
|
|
328
|
+
visible: te === S,
|
|
329
|
+
theme: _.theme || B,
|
|
330
330
|
children: G.label
|
|
331
331
|
}
|
|
332
332
|
)
|
|
@@ -336,17 +336,17 @@ const da = J.div`
|
|
|
336
336
|
))
|
|
337
337
|
}
|
|
338
338
|
);
|
|
339
|
-
},
|
|
339
|
+
}, sa = (e) => {
|
|
340
340
|
if (e === 0) return "0 B";
|
|
341
341
|
const r = 1024, t = ["B", "KB", "MB", "GB"], s = Math.floor(Math.log(e) / Math.log(r));
|
|
342
342
|
return parseFloat((e / Math.pow(r, s)).toFixed(2)) + " " + t[s];
|
|
343
|
-
},
|
|
343
|
+
}, Or = () => Math.random().toString(36).substr(2, 9), Da = (e, r) => {
|
|
344
344
|
const t = { ...e.formData }, s = ["name", "filename", "title", "displayName", "fileName"], h = ["size", "fileSize", "file_size"], b = ["type", "fileType", "mimeType", "contentType"];
|
|
345
345
|
return r.forEach((p) => {
|
|
346
346
|
const d = p.name || p.field;
|
|
347
|
-
d && (s.includes(d.toLowerCase()) && !t[d] && (t[d] = e.name), h.includes(d.toLowerCase()) && !t[d] && (t[d] =
|
|
347
|
+
d && (s.includes(d.toLowerCase()) && !t[d] && (t[d] = e.name), h.includes(d.toLowerCase()) && !t[d] && (t[d] = sa(e.size)), b.includes(d.toLowerCase()) && !t[d] && (t[d] = e.type));
|
|
348
348
|
}), t;
|
|
349
|
-
},
|
|
349
|
+
}, za = async (e, r, t = {}, s = {}, h) => new Promise((b, p) => {
|
|
350
350
|
var C;
|
|
351
351
|
const d = new XMLHttpRequest(), f = new URL(r);
|
|
352
352
|
if (Object.entries(s).forEach(([W, l]) => {
|
|
@@ -382,8 +382,8 @@ const da = J.div`
|
|
|
382
382
|
console.log("====xhr.responseText", d.responseText);
|
|
383
383
|
let l = "";
|
|
384
384
|
try {
|
|
385
|
-
const
|
|
386
|
-
|
|
385
|
+
const U = JSON.parse(d.responseText);
|
|
386
|
+
U.errorMsg ? l = U.errorMsg : U.message ? l = U.message : U.error ? l = U.error : l = `上传失败: ${d.status} ${d.statusText}`;
|
|
387
387
|
} catch {
|
|
388
388
|
l = `上传失败: ${d.status} ${d.statusText}`;
|
|
389
389
|
}
|
|
@@ -405,7 +405,7 @@ const da = J.div`
|
|
|
405
405
|
d.setRequestHeader(l, _);
|
|
406
406
|
}), d.send(W);
|
|
407
407
|
}
|
|
408
|
-
}),
|
|
408
|
+
}), _a = J.div`
|
|
409
409
|
border: 2px dashed ${(e) => {
|
|
410
410
|
var r, t, s, h;
|
|
411
411
|
return e.$isDragOver ? ((t = (r = e.$theme) == null ? void 0 : r.colors) == null ? void 0 : t.primary) || "#007bff" : ((h = (s = e.$theme) == null ? void 0 : s.colors) == null ? void 0 : h.border) || "#dee2e6";
|
|
@@ -436,14 +436,14 @@ const da = J.div`
|
|
|
436
436
|
return ((t = (r = e.$theme) == null ? void 0 : r.colors) == null ? void 0 : t.background) || "#f8f9fa";
|
|
437
437
|
}};
|
|
438
438
|
}
|
|
439
|
-
`,
|
|
439
|
+
`, Aa = J.div`
|
|
440
440
|
color: ${(e) => {
|
|
441
441
|
var r, t;
|
|
442
442
|
return ((t = (r = e.$theme) == null ? void 0 : r.colors) == null ? void 0 : t.primary) || "#007bff";
|
|
443
443
|
}};
|
|
444
444
|
font-size: 48px;
|
|
445
445
|
margin-bottom: 8px;
|
|
446
|
-
`,
|
|
446
|
+
`, Ba = J.div`
|
|
447
447
|
color: ${(e) => {
|
|
448
448
|
var r, t;
|
|
449
449
|
return ((t = (r = e.$theme) == null ? void 0 : r.colors) == null ? void 0 : t.text) || "#343a40";
|
|
@@ -451,19 +451,19 @@ const da = J.div`
|
|
|
451
451
|
font-size: 16px;
|
|
452
452
|
font-weight: 500;
|
|
453
453
|
margin-bottom: 4px;
|
|
454
|
-
`,
|
|
454
|
+
`, jr = J.div`
|
|
455
455
|
color: ${(e) => {
|
|
456
456
|
var r, t, s, h;
|
|
457
457
|
return ((t = (r = e.$theme) == null ? void 0 : r.colors) == null ? void 0 : t.textSecondary) || ((h = (s = e.$theme) == null ? void 0 : s.colors) == null ? void 0 : h.disabledText) || "#6b7280";
|
|
458
458
|
}};
|
|
459
459
|
font-size: 14px;
|
|
460
|
-
`,
|
|
460
|
+
`, Wa = J.input`
|
|
461
461
|
display: none;
|
|
462
|
-
`,
|
|
462
|
+
`, Ra = J.div`
|
|
463
463
|
|
|
464
464
|
width: 100%;
|
|
465
465
|
max-width: 600px;
|
|
466
|
-
`,
|
|
466
|
+
`, qa = J.div.attrs({
|
|
467
467
|
className: "upload-item"
|
|
468
468
|
})`
|
|
469
469
|
display: flex;
|
|
@@ -490,17 +490,17 @@ const da = J.div`
|
|
|
490
490
|
return e.$hasForm ? "transparent" : e.$status === "error" ? ((t = (r = e.$theme) == null ? void 0 : r.colors) == null ? void 0 : t.error) || "#FF0000" : ((h = (s = e.$theme) == null ? void 0 : s.colors) == null ? void 0 : h.primary) || "#007bff";
|
|
491
491
|
}};
|
|
492
492
|
}
|
|
493
|
-
`,
|
|
493
|
+
`, La = J.div`
|
|
494
494
|
color: ${(e) => {
|
|
495
495
|
var r, t;
|
|
496
496
|
return ((t = (r = e.$theme) == null ? void 0 : r.colors) == null ? void 0 : t.primary) || "#007bff";
|
|
497
497
|
}};
|
|
498
498
|
margin-right: 12px;
|
|
499
499
|
flex-shrink: 0;
|
|
500
|
-
`,
|
|
500
|
+
`, Oa = J.div`
|
|
501
501
|
flex: 1;
|
|
502
502
|
min-width: 0;
|
|
503
|
-
`,
|
|
503
|
+
`, ja = J.div`
|
|
504
504
|
color: ${(e) => {
|
|
505
505
|
var r, t;
|
|
506
506
|
return ((t = (r = e.$theme) == null ? void 0 : r.colors) == null ? void 0 : t.text) || "#343a40";
|
|
@@ -511,13 +511,13 @@ const da = J.div`
|
|
|
511
511
|
white-space: nowrap;
|
|
512
512
|
overflow: hidden;
|
|
513
513
|
text-overflow: ellipsis;
|
|
514
|
-
`,
|
|
514
|
+
`, Ha = J.div`
|
|
515
515
|
color: ${(e) => {
|
|
516
516
|
var r, t, s, h;
|
|
517
517
|
return ((t = (r = e.$theme) == null ? void 0 : r.colors) == null ? void 0 : t.textSecondary) || ((h = (s = e.$theme) == null ? void 0 : s.colors) == null ? void 0 : h.disabledText) || "#6b7280";
|
|
518
518
|
}};
|
|
519
519
|
font-size: 10px;
|
|
520
|
-
`,
|
|
520
|
+
`, Ya = J.div`
|
|
521
521
|
width: 100%;
|
|
522
522
|
height: 4px;
|
|
523
523
|
background: ${(e) => {
|
|
@@ -542,7 +542,7 @@ const da = J.div`
|
|
|
542
542
|
}};
|
|
543
543
|
transition: width 0.3s ease;
|
|
544
544
|
}
|
|
545
|
-
`,
|
|
545
|
+
`, Ia = J.div`
|
|
546
546
|
margin-left: 12px;
|
|
547
547
|
flex-shrink: 0;
|
|
548
548
|
color: ${(e) => {
|
|
@@ -560,7 +560,7 @@ const da = J.div`
|
|
|
560
560
|
return ((M = (N = e.$theme) == null ? void 0 : N.colors) == null ? void 0 : M.disabledText) || "#808080";
|
|
561
561
|
}
|
|
562
562
|
}};
|
|
563
|
-
`,
|
|
563
|
+
`, Ua = J.button`
|
|
564
564
|
background: none;
|
|
565
565
|
border: none;
|
|
566
566
|
color: ${(e) => {
|
|
@@ -635,7 +635,7 @@ J.button`
|
|
|
635
635
|
}}20;
|
|
636
636
|
}
|
|
637
637
|
`;
|
|
638
|
-
const
|
|
638
|
+
const Va = J.div`
|
|
639
639
|
padding: 0px;
|
|
640
640
|
background: ${(e) => {
|
|
641
641
|
var r, t;
|
|
@@ -696,7 +696,7 @@ J.input`
|
|
|
696
696
|
}};
|
|
697
697
|
}
|
|
698
698
|
`;
|
|
699
|
-
const
|
|
699
|
+
const Ea = J.div`
|
|
700
700
|
/* 基础样式 */
|
|
701
701
|
margin-top: 5px;
|
|
702
702
|
background: ${(e) => {
|
|
@@ -739,12 +739,12 @@ const _a = J.div`
|
|
|
739
739
|
min-height: 32px !important;
|
|
740
740
|
}
|
|
741
741
|
`;
|
|
742
|
-
function
|
|
743
|
-
return e.label ? /* @__PURE__ */
|
|
742
|
+
function le(e) {
|
|
743
|
+
return e.label ? /* @__PURE__ */ O("div", { className: "flex items-center gap-2", children: [
|
|
744
744
|
/* @__PURE__ */ o("span", { className: "font-medium text-gray-800 text-sm", children: e.label }),
|
|
745
745
|
e.required && /* @__PURE__ */ o("span", { className: "text-red-500 font-bold text-sm", children: "*" }),
|
|
746
|
-
(e.helpText || e.description) && /* @__PURE__ */ o(
|
|
747
|
-
|
|
746
|
+
(e.helpText || e.description) && /* @__PURE__ */ o(cr, { title: e.helpText || e.description, placement: "top", children: /* @__PURE__ */ o(
|
|
747
|
+
oa,
|
|
748
748
|
{
|
|
749
749
|
className: "text-gray-400 hover:text-gray-600 cursor-help transition-colors",
|
|
750
750
|
size: 14
|
|
@@ -752,12 +752,12 @@ function ie(e) {
|
|
|
752
752
|
) })
|
|
753
753
|
] }) : null;
|
|
754
754
|
}
|
|
755
|
-
function
|
|
755
|
+
function Ja(e = [], r, t = {}, s = "md") {
|
|
756
756
|
const h = s === "sm" ? "28px" : "40px", b = s === "sm" ? "28px" : "40px", p = s === "sm" ? "0 8px" : "0 12px", d = s === "sm" ? "16px" : "24px", f = s === "sm" ? "12px" : "14px", N = me.useMemo(
|
|
757
757
|
() => {
|
|
758
|
-
var v,
|
|
759
|
-
(
|
|
760
|
-
const a = ((
|
|
758
|
+
var v, V, A, E, j, Q;
|
|
759
|
+
(V = (v = r == null ? void 0 : r.theme) == null ? void 0 : v.colors) != null && V.border;
|
|
760
|
+
const a = ((E = (A = r == null ? void 0 : r.theme) == null ? void 0 : A.colors) == null ? void 0 : E.primary) || "#3b82f6", T = ((Q = (j = r == null ? void 0 : r.theme) == null ? void 0 : j.colors) == null ? void 0 : Q.textSecondary) || "#9ca3af";
|
|
761
761
|
return `
|
|
762
762
|
.dynamic-form .ant-form-item-label > label {
|
|
763
763
|
height: auto !important;
|
|
@@ -932,37 +932,37 @@ function Aa(e = [], r, t = {}, s = "md") {
|
|
|
932
932
|
r && r.formInstance && !W.current && (W.current = r.formInstance);
|
|
933
933
|
}, [r]);
|
|
934
934
|
const l = (a, T, v) => {
|
|
935
|
-
var
|
|
935
|
+
var V;
|
|
936
936
|
if (C((A) => ({ ...A, [a]: T })), W.current && v) {
|
|
937
937
|
let A = [];
|
|
938
938
|
if (Array.isArray(v))
|
|
939
939
|
A = v;
|
|
940
940
|
else if (typeof v == "object") {
|
|
941
|
-
const
|
|
942
|
-
Object.keys(v).forEach((
|
|
943
|
-
|
|
941
|
+
const E = String(T);
|
|
942
|
+
Object.keys(v).forEach((j) => {
|
|
943
|
+
j !== E && v[j].forEach((Q) => {
|
|
944
944
|
Q && W.current.setFieldsValue({ [Q]: void 0 });
|
|
945
945
|
});
|
|
946
946
|
});
|
|
947
947
|
}
|
|
948
|
-
Array.isArray(v) && ((
|
|
949
|
-
|
|
948
|
+
Array.isArray(v) && ((V = e.find((j) => j.name === a)) == null ? void 0 : V.type) === "switch" && !T && A.forEach((j) => {
|
|
949
|
+
j && W.current.setFieldsValue({ [j]: void 0 });
|
|
950
950
|
});
|
|
951
951
|
}
|
|
952
|
-
}, _ = /* @__PURE__ */ new Set(),
|
|
952
|
+
}, _ = /* @__PURE__ */ new Set(), U = (() => {
|
|
953
953
|
var a, T;
|
|
954
954
|
try {
|
|
955
955
|
return ((T = (a = r == null ? void 0 : r.formInstance) == null ? void 0 : a.getFieldsValue) == null ? void 0 : T.call(a)) || {};
|
|
956
956
|
} catch {
|
|
957
957
|
return {};
|
|
958
958
|
}
|
|
959
|
-
})(),
|
|
959
|
+
})(), ae = (a) => {
|
|
960
960
|
a.forEach((T) => {
|
|
961
961
|
if (!T) return;
|
|
962
962
|
if (T.controlledItems && T.name) {
|
|
963
|
-
const
|
|
963
|
+
const V = M[T.name];
|
|
964
964
|
if (Array.isArray(T.controlledItems))
|
|
965
|
-
T.type === "switch" &&
|
|
965
|
+
T.type === "switch" && V === !1 && T.controlledItems.forEach((A) => {
|
|
966
966
|
A && _.add(A);
|
|
967
967
|
});
|
|
968
968
|
else if (typeof T.controlledItems == "object") {
|
|
@@ -970,18 +970,18 @@ function Aa(e = [], r, t = {}, s = "md") {
|
|
|
970
970
|
Object.values(T.controlledItems).forEach((Q) => {
|
|
971
971
|
(Q || []).forEach((X) => X && A.add(X));
|
|
972
972
|
});
|
|
973
|
-
const
|
|
973
|
+
const E = String(V ?? ""), j = new Set((T.controlledItems[E] || []).filter(Boolean));
|
|
974
974
|
A.forEach((Q) => {
|
|
975
|
-
|
|
975
|
+
j.has(Q) || _.add(Q);
|
|
976
976
|
});
|
|
977
977
|
}
|
|
978
978
|
}
|
|
979
|
-
(typeof T.hidden == "function" ? T.hidden(
|
|
979
|
+
(typeof T.hidden == "function" ? T.hidden(U) : T.hidden === !0) && T.name && _.add(T.name), T.type === "col" && Array.isArray(T.children) && ae(T.children);
|
|
980
980
|
});
|
|
981
981
|
};
|
|
982
|
-
|
|
983
|
-
const
|
|
984
|
-
var v,
|
|
982
|
+
ae(e);
|
|
983
|
+
const te = e.map((a, T) => {
|
|
984
|
+
var v, V, A, E, j, Q, X, R, ee, G, S, y, x, D, w, L, q, Z, P, k, H, Y;
|
|
985
985
|
if (a.name && _.has(a.name)) return null;
|
|
986
986
|
if (a.type === "divider")
|
|
987
987
|
return /* @__PURE__ */ o(
|
|
@@ -1007,7 +1007,7 @@ function Aa(e = [], r, t = {}, s = "md") {
|
|
|
1007
1007
|
fontWeight: i === 1 ? 700 : i === 2 ? 600 : 500,
|
|
1008
1008
|
animationDelay: `${T * 30}ms`
|
|
1009
1009
|
},
|
|
1010
|
-
children: /* @__PURE__ */
|
|
1010
|
+
children: /* @__PURE__ */ O("div", { className: "flex items-center", children: [
|
|
1011
1011
|
/* @__PURE__ */ o("span", { className: "mr-3", children: a.label }),
|
|
1012
1012
|
/* @__PURE__ */ o(
|
|
1013
1013
|
"div",
|
|
@@ -1028,11 +1028,11 @@ function Aa(e = [], r, t = {}, s = "md") {
|
|
|
1028
1028
|
if (a.type === "col") {
|
|
1029
1029
|
if (!a.children || a.children.length === 0) return null;
|
|
1030
1030
|
const i = (n, z) => {
|
|
1031
|
-
var
|
|
1032
|
-
const F = typeof n.hidden == "function" ? n.hidden(
|
|
1031
|
+
var ye, De, ze, _e, Ae, Be, We, Re, qe, Le, Oe, je, He, Ye, Ie, Ue, Ve, Ee, Je, Ge, Ke, Pe;
|
|
1032
|
+
const F = typeof n.hidden == "function" ? n.hidden(U) : n.hidden === !0;
|
|
1033
1033
|
if (n.name && _.has(n.name) || F) return null;
|
|
1034
1034
|
const m = {
|
|
1035
|
-
label: n.label ?
|
|
1035
|
+
label: n.label ? le(n) : void 0,
|
|
1036
1036
|
name: n.name,
|
|
1037
1037
|
rules: n.name ? [
|
|
1038
1038
|
{
|
|
@@ -1066,23 +1066,23 @@ function Aa(e = [], r, t = {}, s = "md") {
|
|
|
1066
1066
|
) }, g);
|
|
1067
1067
|
case "select":
|
|
1068
1068
|
return /* @__PURE__ */ o(K.Item, { ...m, children: /* @__PURE__ */ o(
|
|
1069
|
-
|
|
1069
|
+
tr,
|
|
1070
1070
|
{
|
|
1071
1071
|
placeholder: n.placeholder,
|
|
1072
1072
|
disabled: n.disabled,
|
|
1073
1073
|
className: re,
|
|
1074
1074
|
value: M[n.name || ""],
|
|
1075
|
-
onChange: (
|
|
1076
|
-
children: (
|
|
1075
|
+
onChange: (pe) => l(n.name || "", pe, n.controlledItems),
|
|
1076
|
+
children: (ye = n.options) == null ? void 0 : ye.map((pe, Ce) => /* @__PURE__ */ o(tr.Option, { value: pe.value, children: pe.render ? pe.render() : pe.label }, pe.value || Ce))
|
|
1077
1077
|
}
|
|
1078
1078
|
) }, g);
|
|
1079
1079
|
case "number":
|
|
1080
1080
|
return /* @__PURE__ */ o(K.Item, { ...m, children: /* @__PURE__ */ o(
|
|
1081
|
-
|
|
1081
|
+
nr,
|
|
1082
1082
|
{
|
|
1083
1083
|
addonAfter: n.unit ? /* @__PURE__ */ o("span", { className: "text-[10px] text-gray-300", children: n.unit }) : null,
|
|
1084
|
-
min: (
|
|
1085
|
-
max: (
|
|
1084
|
+
min: (De = n.range) == null ? void 0 : De.min,
|
|
1085
|
+
max: (ze = n.range) == null ? void 0 : ze.max,
|
|
1086
1086
|
step: n.step,
|
|
1087
1087
|
placeholder: n.placeholder,
|
|
1088
1088
|
disabled: n.disabled,
|
|
@@ -1111,7 +1111,7 @@ function Aa(e = [], r, t = {}, s = "md") {
|
|
|
1111
1111
|
) }, g);
|
|
1112
1112
|
case "date":
|
|
1113
1113
|
return /* @__PURE__ */ o(K.Item, { ...m, children: /* @__PURE__ */ o(
|
|
1114
|
-
|
|
1114
|
+
or,
|
|
1115
1115
|
{
|
|
1116
1116
|
placeholder: n.placeholder,
|
|
1117
1117
|
disabled: n.disabled,
|
|
@@ -1121,7 +1121,7 @@ function Aa(e = [], r, t = {}, s = "md") {
|
|
|
1121
1121
|
) }, g);
|
|
1122
1122
|
case "radio":
|
|
1123
1123
|
return /* @__PURE__ */ o(K.Item, { ...m, children: /* @__PURE__ */ o(
|
|
1124
|
-
|
|
1124
|
+
Wr.Group,
|
|
1125
1125
|
{
|
|
1126
1126
|
options: n.options,
|
|
1127
1127
|
disabled: n.disabled,
|
|
@@ -1137,14 +1137,14 @@ function Aa(e = [], r, t = {}, s = "md") {
|
|
|
1137
1137
|
className: "mb-6",
|
|
1138
1138
|
labelCol: { span: 24 },
|
|
1139
1139
|
wrapperCol: { span: 24 },
|
|
1140
|
-
children: /* @__PURE__ */
|
|
1141
|
-
/* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: n.label ?
|
|
1140
|
+
children: /* @__PURE__ */ O("div", { className: "flex items-center justify-between", children: [
|
|
1141
|
+
/* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: n.label ? le(n) : null }),
|
|
1142
1142
|
/* @__PURE__ */ o(K.Item, { name: n.name, valuePropName: "checked", noStyle: !0, children: /* @__PURE__ */ o(
|
|
1143
|
-
|
|
1143
|
+
Br,
|
|
1144
1144
|
{
|
|
1145
1145
|
disabled: n.disabled,
|
|
1146
1146
|
checked: M[n.name || ""],
|
|
1147
|
-
onChange: (
|
|
1147
|
+
onChange: (pe) => l(n.name || "", pe, n.controlledItems)
|
|
1148
1148
|
}
|
|
1149
1149
|
) })
|
|
1150
1150
|
] })
|
|
@@ -1152,15 +1152,15 @@ function Aa(e = [], r, t = {}, s = "md") {
|
|
|
1152
1152
|
n.name || `switch-${Math.random()}`
|
|
1153
1153
|
);
|
|
1154
1154
|
case "slider":
|
|
1155
|
-
return /* @__PURE__ */
|
|
1156
|
-
/* @__PURE__ */
|
|
1157
|
-
/* @__PURE__ */ o("div", { className: "flex items-center", children: n.label ?
|
|
1158
|
-
/* @__PURE__ */
|
|
1155
|
+
return /* @__PURE__ */ O("div", { className: "mb-6", children: [
|
|
1156
|
+
/* @__PURE__ */ O("div", { className: "flex items-center justify-between mb-3", children: [
|
|
1157
|
+
/* @__PURE__ */ o("div", { className: "flex items-center", children: n.label ? le(n) : null }),
|
|
1158
|
+
/* @__PURE__ */ O("div", { className: "flex items-center gap-2", children: [
|
|
1159
1159
|
/* @__PURE__ */ o(K.Item, { name: n.name, noStyle: !0, children: /* @__PURE__ */ o(
|
|
1160
|
-
|
|
1160
|
+
nr,
|
|
1161
1161
|
{
|
|
1162
|
-
min: (
|
|
1163
|
-
max: (
|
|
1162
|
+
min: (_e = n.range) == null ? void 0 : _e.min,
|
|
1163
|
+
max: (Ae = n.range) == null ? void 0 : Ae.max,
|
|
1164
1164
|
step: n.step,
|
|
1165
1165
|
disabled: n.disabled,
|
|
1166
1166
|
className: "h-8 w-20"
|
|
@@ -1170,10 +1170,10 @@ function Aa(e = [], r, t = {}, s = "md") {
|
|
|
1170
1170
|
] })
|
|
1171
1171
|
] }),
|
|
1172
1172
|
/* @__PURE__ */ o(K.Item, { name: n.name, noStyle: !0, children: /* @__PURE__ */ o(
|
|
1173
|
-
|
|
1173
|
+
Ar,
|
|
1174
1174
|
{
|
|
1175
|
-
min: (
|
|
1176
|
-
max: (
|
|
1175
|
+
min: (Be = n.range) == null ? void 0 : Be.min,
|
|
1176
|
+
max: (We = n.range) == null ? void 0 : We.max,
|
|
1177
1177
|
step: n.step,
|
|
1178
1178
|
disabled: n.disabled,
|
|
1179
1179
|
className: n.className
|
|
@@ -1182,7 +1182,7 @@ function Aa(e = [], r, t = {}, s = "md") {
|
|
|
1182
1182
|
] }, n.name || `slider-${Math.random()}`);
|
|
1183
1183
|
case "checkbox":
|
|
1184
1184
|
return /* @__PURE__ */ o(K.Item, { ...m, children: /* @__PURE__ */ o(
|
|
1185
|
-
|
|
1185
|
+
Rr.Group,
|
|
1186
1186
|
{
|
|
1187
1187
|
options: n.options,
|
|
1188
1188
|
disabled: n.disabled,
|
|
@@ -1201,7 +1201,7 @@ function Aa(e = [], r, t = {}, s = "md") {
|
|
|
1201
1201
|
) }, g);
|
|
1202
1202
|
case "time":
|
|
1203
1203
|
return /* @__PURE__ */ o(K.Item, { ...m, children: /* @__PURE__ */ o(
|
|
1204
|
-
|
|
1204
|
+
qr,
|
|
1205
1205
|
{
|
|
1206
1206
|
placeholder: n.placeholder,
|
|
1207
1207
|
disabled: n.disabled,
|
|
@@ -1211,7 +1211,7 @@ function Aa(e = [], r, t = {}, s = "md") {
|
|
|
1211
1211
|
) }, g);
|
|
1212
1212
|
case "datetime":
|
|
1213
1213
|
return /* @__PURE__ */ o(K.Item, { ...m, children: /* @__PURE__ */ o(
|
|
1214
|
-
|
|
1214
|
+
or,
|
|
1215
1215
|
{
|
|
1216
1216
|
showTime: !0,
|
|
1217
1217
|
placeholder: n.placeholder,
|
|
@@ -1267,30 +1267,30 @@ function Aa(e = [], r, t = {}, s = "md") {
|
|
|
1267
1267
|
) }, g);
|
|
1268
1268
|
case "uploader":
|
|
1269
1269
|
return /* @__PURE__ */ o(K.Item, { ...m, children: /* @__PURE__ */ o(
|
|
1270
|
-
|
|
1270
|
+
Yr,
|
|
1271
1271
|
{
|
|
1272
|
-
multiple: ((
|
|
1273
|
-
accept: ((
|
|
1274
|
-
maxSize: ((
|
|
1275
|
-
maxFiles: ((
|
|
1276
|
-
autoUpload: ((
|
|
1277
|
-
url: (
|
|
1278
|
-
headers: ((
|
|
1279
|
-
queryParams: ((
|
|
1280
|
-
itemForm: ((
|
|
1281
|
-
buttons: ((
|
|
1282
|
-
icons: (
|
|
1283
|
-
placeholder: (
|
|
1284
|
-
listName: (
|
|
1285
|
-
errorMessages: (
|
|
1286
|
-
onRef: (
|
|
1272
|
+
multiple: ((Re = n.uploaderConfig) == null ? void 0 : Re.multiple) ?? !0,
|
|
1273
|
+
accept: ((qe = n.uploaderConfig) == null ? void 0 : qe.accept) ?? "*/*",
|
|
1274
|
+
maxSize: ((Le = n.uploaderConfig) == null ? void 0 : Le.maxSize) ?? 100,
|
|
1275
|
+
maxFiles: ((Oe = n.uploaderConfig) == null ? void 0 : Oe.maxFiles) ?? 10,
|
|
1276
|
+
autoUpload: ((je = n.uploaderConfig) == null ? void 0 : je.autoUpload) ?? !0,
|
|
1277
|
+
url: (He = n.uploaderConfig) == null ? void 0 : He.url,
|
|
1278
|
+
headers: ((Ye = n.uploaderConfig) == null ? void 0 : Ye.headers) ?? {},
|
|
1279
|
+
queryParams: ((Ie = n.uploaderConfig) == null ? void 0 : Ie.queryParams) ?? {},
|
|
1280
|
+
itemForm: ((Ue = n.uploaderConfig) == null ? void 0 : Ue.itemForm) ?? [],
|
|
1281
|
+
buttons: ((Ve = n.uploaderConfig) == null ? void 0 : Ve.buttons) || [],
|
|
1282
|
+
icons: (Ee = n.uploaderConfig) == null ? void 0 : Ee.icons,
|
|
1283
|
+
placeholder: (Je = n.uploaderConfig) == null ? void 0 : Je.placeholder,
|
|
1284
|
+
listName: (Ge = n.uploaderConfig) == null ? void 0 : Ge.listName,
|
|
1285
|
+
errorMessages: (Ke = n.uploaderConfig) == null ? void 0 : Ke.errorMessages,
|
|
1286
|
+
onRef: (Pe = n.uploaderConfig) == null ? void 0 : Pe.onRef,
|
|
1287
1287
|
styles: r,
|
|
1288
|
-
eventsEmit: (
|
|
1288
|
+
eventsEmit: (pe, Ce) => {
|
|
1289
1289
|
if (r && typeof r.eventsEmit == "function") {
|
|
1290
|
-
const
|
|
1291
|
-
r.eventsEmit(
|
|
1290
|
+
const rr = pe.startsWith("uploader:") ? pe : `uploader:${pe}`;
|
|
1291
|
+
r.eventsEmit(rr, {
|
|
1292
1292
|
fieldName: n.name,
|
|
1293
|
-
...
|
|
1293
|
+
...Ce
|
|
1294
1294
|
});
|
|
1295
1295
|
}
|
|
1296
1296
|
}
|
|
@@ -1345,7 +1345,7 @@ function Aa(e = [], r, t = {}, s = "md") {
|
|
|
1345
1345
|
}), /* @__PURE__ */ o(
|
|
1346
1346
|
K.Item,
|
|
1347
1347
|
{
|
|
1348
|
-
label: a.label ?
|
|
1348
|
+
label: a.label ? le(a) : void 0,
|
|
1349
1349
|
name: a.name,
|
|
1350
1350
|
rules: i.length > 0 ? i : void 0,
|
|
1351
1351
|
className: "mb-6",
|
|
@@ -1370,7 +1370,7 @@ function Aa(e = [], r, t = {}, s = "md") {
|
|
|
1370
1370
|
return /* @__PURE__ */ o(
|
|
1371
1371
|
K.Item,
|
|
1372
1372
|
{
|
|
1373
|
-
label: a.label ?
|
|
1373
|
+
label: a.label ? le(a) : void 0,
|
|
1374
1374
|
name: a.name,
|
|
1375
1375
|
rules: a.name ? [{ required: a.required, message: a.error || `请选择${a.label}` }] : void 0,
|
|
1376
1376
|
className: "mb-6",
|
|
@@ -1378,14 +1378,14 @@ function Aa(e = [], r, t = {}, s = "md") {
|
|
|
1378
1378
|
wrapperCol: { span: 24 },
|
|
1379
1379
|
required: !1,
|
|
1380
1380
|
children: /* @__PURE__ */ o(
|
|
1381
|
-
|
|
1381
|
+
tr,
|
|
1382
1382
|
{
|
|
1383
1383
|
placeholder: a.placeholder,
|
|
1384
1384
|
disabled: a.disabled,
|
|
1385
1385
|
className: `${a.className || ""} ${s === "sm" ? "h-7" : "h-10"}`,
|
|
1386
1386
|
value: M[a.name || ""],
|
|
1387
1387
|
onChange: (i) => l(a.name || "", i, a.controlledItems),
|
|
1388
|
-
children: (v = a.options) == null ? void 0 : v.map((i, u) => /* @__PURE__ */ o(
|
|
1388
|
+
children: (v = a.options) == null ? void 0 : v.map((i, u) => /* @__PURE__ */ o(tr.Option, { value: i.value, children: i.render ? i.render() : i.label }, i.value || u))
|
|
1389
1389
|
}
|
|
1390
1390
|
)
|
|
1391
1391
|
},
|
|
@@ -1395,7 +1395,7 @@ function Aa(e = [], r, t = {}, s = "md") {
|
|
|
1395
1395
|
return /* @__PURE__ */ o(
|
|
1396
1396
|
K.Item,
|
|
1397
1397
|
{
|
|
1398
|
-
label: a.label ?
|
|
1398
|
+
label: a.label ? le(a) : void 0,
|
|
1399
1399
|
name: a.name,
|
|
1400
1400
|
rules: a.name ? [{ required: a.required, message: a.error || `请输入${a.label}` }] : void 0,
|
|
1401
1401
|
className: "mb-6",
|
|
@@ -1403,10 +1403,10 @@ function Aa(e = [], r, t = {}, s = "md") {
|
|
|
1403
1403
|
wrapperCol: { span: 24 },
|
|
1404
1404
|
required: !1,
|
|
1405
1405
|
children: /* @__PURE__ */ o(
|
|
1406
|
-
|
|
1406
|
+
nr,
|
|
1407
1407
|
{
|
|
1408
1408
|
addonAfter: a.unit ? /* @__PURE__ */ o("span", { className: "text-[10px] text-gray-300", children: a.unit }) : null,
|
|
1409
|
-
min: (
|
|
1409
|
+
min: (V = a.range) == null ? void 0 : V.min,
|
|
1410
1410
|
max: (A = a.range) == null ? void 0 : A.max,
|
|
1411
1411
|
step: a.step,
|
|
1412
1412
|
placeholder: a.placeholder,
|
|
@@ -1419,15 +1419,15 @@ function Aa(e = [], r, t = {}, s = "md") {
|
|
|
1419
1419
|
a.name || `number-${Math.random()}`
|
|
1420
1420
|
);
|
|
1421
1421
|
if (a.type === "slider")
|
|
1422
|
-
return /* @__PURE__ */
|
|
1423
|
-
/* @__PURE__ */
|
|
1424
|
-
/* @__PURE__ */ o("div", { className: "flex items-center", children: a.label ?
|
|
1425
|
-
/* @__PURE__ */
|
|
1422
|
+
return /* @__PURE__ */ O("div", { className: "mb-6", children: [
|
|
1423
|
+
/* @__PURE__ */ O("div", { className: "flex items-center justify-between mb-3", children: [
|
|
1424
|
+
/* @__PURE__ */ o("div", { className: "flex items-center", children: a.label ? le(a) : null }),
|
|
1425
|
+
/* @__PURE__ */ O("div", { className: "flex items-center gap-2", children: [
|
|
1426
1426
|
/* @__PURE__ */ o(K.Item, { name: a.name, noStyle: !0, children: /* @__PURE__ */ o(
|
|
1427
|
-
|
|
1427
|
+
nr,
|
|
1428
1428
|
{
|
|
1429
|
-
min: (
|
|
1430
|
-
max: (
|
|
1429
|
+
min: (E = a.range) == null ? void 0 : E.min,
|
|
1430
|
+
max: (j = a.range) == null ? void 0 : j.max,
|
|
1431
1431
|
step: a.step,
|
|
1432
1432
|
disabled: a.disabled,
|
|
1433
1433
|
className: "h-8 w-20"
|
|
@@ -1437,7 +1437,7 @@ function Aa(e = [], r, t = {}, s = "md") {
|
|
|
1437
1437
|
] })
|
|
1438
1438
|
] }),
|
|
1439
1439
|
/* @__PURE__ */ o(K.Item, { name: a.name, noStyle: !0, children: /* @__PURE__ */ o(
|
|
1440
|
-
|
|
1440
|
+
Ar,
|
|
1441
1441
|
{
|
|
1442
1442
|
min: (Q = a.range) == null ? void 0 : Q.min,
|
|
1443
1443
|
max: (X = a.range) == null ? void 0 : X.max,
|
|
@@ -1456,10 +1456,10 @@ function Aa(e = [], r, t = {}, s = "md") {
|
|
|
1456
1456
|
className: "mb-6",
|
|
1457
1457
|
labelCol: { span: 24 },
|
|
1458
1458
|
wrapperCol: { span: 24 },
|
|
1459
|
-
children: /* @__PURE__ */
|
|
1460
|
-
/* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: a.label ?
|
|
1459
|
+
children: /* @__PURE__ */ O("div", { className: "flex items-center justify-between", children: [
|
|
1460
|
+
/* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: a.label ? le(a) : null }),
|
|
1461
1461
|
/* @__PURE__ */ o(K.Item, { name: a.name, valuePropName: "checked", noStyle: !0, children: /* @__PURE__ */ o(
|
|
1462
|
-
|
|
1462
|
+
Br,
|
|
1463
1463
|
{
|
|
1464
1464
|
disabled: a.disabled,
|
|
1465
1465
|
checked: a.name ? M[a.name] : !1,
|
|
@@ -1484,7 +1484,7 @@ function Aa(e = [], r, t = {}, s = "md") {
|
|
|
1484
1484
|
}), /* @__PURE__ */ o(
|
|
1485
1485
|
K.Item,
|
|
1486
1486
|
{
|
|
1487
|
-
label: a.label ?
|
|
1487
|
+
label: a.label ? le(a) : void 0,
|
|
1488
1488
|
name: a.name,
|
|
1489
1489
|
rules: i.length > 0 ? i : void 0,
|
|
1490
1490
|
className: "mb-6",
|
|
@@ -1511,7 +1511,7 @@ function Aa(e = [], r, t = {}, s = "md") {
|
|
|
1511
1511
|
return a.type === "date" ? /* @__PURE__ */ o(
|
|
1512
1512
|
K.Item,
|
|
1513
1513
|
{
|
|
1514
|
-
label: a.label ?
|
|
1514
|
+
label: a.label ? le(a) : void 0,
|
|
1515
1515
|
name: a.name,
|
|
1516
1516
|
rules: a.name ? [{ required: a.required, message: a.error || `请选择${a.label}` }] : void 0,
|
|
1517
1517
|
className: "mb-6",
|
|
@@ -1519,7 +1519,7 @@ function Aa(e = [], r, t = {}, s = "md") {
|
|
|
1519
1519
|
wrapperCol: { span: 24 },
|
|
1520
1520
|
required: !1,
|
|
1521
1521
|
children: /* @__PURE__ */ o(
|
|
1522
|
-
|
|
1522
|
+
or,
|
|
1523
1523
|
{
|
|
1524
1524
|
placeholder: a.placeholder,
|
|
1525
1525
|
disabled: a.disabled,
|
|
@@ -1532,20 +1532,20 @@ function Aa(e = [], r, t = {}, s = "md") {
|
|
|
1532
1532
|
) : a.type === "radio" ? /* @__PURE__ */ o(
|
|
1533
1533
|
K.Item,
|
|
1534
1534
|
{
|
|
1535
|
-
label: a.label ?
|
|
1535
|
+
label: a.label ? le(a) : void 0,
|
|
1536
1536
|
name: a.name,
|
|
1537
1537
|
rules: a.name ? [{ required: a.required, message: a.error || `请选择${a.label}` }] : void 0,
|
|
1538
1538
|
className: "mb-6",
|
|
1539
1539
|
labelCol: { span: 24 },
|
|
1540
1540
|
wrapperCol: { span: 24 },
|
|
1541
1541
|
required: !1,
|
|
1542
|
-
children: /* @__PURE__ */ o(
|
|
1542
|
+
children: /* @__PURE__ */ o(Wr.Group, { options: a.options, disabled: a.disabled, className: a.className })
|
|
1543
1543
|
},
|
|
1544
1544
|
a.name || `radio-${Math.random()}`
|
|
1545
1545
|
) : a.type === "password" ? /* @__PURE__ */ o(
|
|
1546
1546
|
K.Item,
|
|
1547
1547
|
{
|
|
1548
|
-
label: a.label ?
|
|
1548
|
+
label: a.label ? le(a) : void 0,
|
|
1549
1549
|
name: a.name,
|
|
1550
1550
|
rules: a.name ? [{ required: a.required, message: a.error || `请输入${a.label}` }] : void 0,
|
|
1551
1551
|
className: "mb-6",
|
|
@@ -1565,7 +1565,7 @@ function Aa(e = [], r, t = {}, s = "md") {
|
|
|
1565
1565
|
) : a.type === "checkbox" ? /* @__PURE__ */ o(
|
|
1566
1566
|
K.Item,
|
|
1567
1567
|
{
|
|
1568
|
-
label: a.label ?
|
|
1568
|
+
label: a.label ? le(a) : void 0,
|
|
1569
1569
|
name: a.name,
|
|
1570
1570
|
rules: a.name ? [{ required: a.required, message: a.error || `请选择${a.label}` }] : void 0,
|
|
1571
1571
|
className: "mb-6",
|
|
@@ -1573,7 +1573,7 @@ function Aa(e = [], r, t = {}, s = "md") {
|
|
|
1573
1573
|
wrapperCol: { span: 24 },
|
|
1574
1574
|
required: !1,
|
|
1575
1575
|
children: /* @__PURE__ */ o(
|
|
1576
|
-
|
|
1576
|
+
Rr.Group,
|
|
1577
1577
|
{
|
|
1578
1578
|
options: a.options,
|
|
1579
1579
|
disabled: a.disabled,
|
|
@@ -1585,7 +1585,7 @@ function Aa(e = [], r, t = {}, s = "md") {
|
|
|
1585
1585
|
) : a.type === "email" ? /* @__PURE__ */ o(
|
|
1586
1586
|
K.Item,
|
|
1587
1587
|
{
|
|
1588
|
-
label: a.label ?
|
|
1588
|
+
label: a.label ? le(a) : void 0,
|
|
1589
1589
|
name: a.name,
|
|
1590
1590
|
rules: a.name ? [
|
|
1591
1591
|
{ required: a.required, message: a.error || `请输入${a.label}` },
|
|
@@ -1609,7 +1609,7 @@ function Aa(e = [], r, t = {}, s = "md") {
|
|
|
1609
1609
|
) : a.type === "time" ? /* @__PURE__ */ o(
|
|
1610
1610
|
K.Item,
|
|
1611
1611
|
{
|
|
1612
|
-
label: a.label ?
|
|
1612
|
+
label: a.label ? le(a) : void 0,
|
|
1613
1613
|
name: a.name,
|
|
1614
1614
|
rules: a.name ? [{ required: a.required, message: a.error || `请选择${a.label}` }] : void 0,
|
|
1615
1615
|
className: "mb-6",
|
|
@@ -1617,7 +1617,7 @@ function Aa(e = [], r, t = {}, s = "md") {
|
|
|
1617
1617
|
wrapperCol: { span: 24 },
|
|
1618
1618
|
required: !1,
|
|
1619
1619
|
children: /* @__PURE__ */ o(
|
|
1620
|
-
|
|
1620
|
+
qr,
|
|
1621
1621
|
{
|
|
1622
1622
|
placeholder: a.placeholder,
|
|
1623
1623
|
disabled: a.disabled,
|
|
@@ -1630,7 +1630,7 @@ function Aa(e = [], r, t = {}, s = "md") {
|
|
|
1630
1630
|
) : a.type === "datetime" ? /* @__PURE__ */ o(
|
|
1631
1631
|
K.Item,
|
|
1632
1632
|
{
|
|
1633
|
-
label: a.label ?
|
|
1633
|
+
label: a.label ? le(a) : void 0,
|
|
1634
1634
|
name: a.name,
|
|
1635
1635
|
rules: a.name ? [{ required: a.required, message: a.error || `请选择${a.label}` }] : void 0,
|
|
1636
1636
|
className: "mb-6",
|
|
@@ -1638,7 +1638,7 @@ function Aa(e = [], r, t = {}, s = "md") {
|
|
|
1638
1638
|
wrapperCol: { span: 24 },
|
|
1639
1639
|
required: !1,
|
|
1640
1640
|
children: /* @__PURE__ */ o(
|
|
1641
|
-
|
|
1641
|
+
or,
|
|
1642
1642
|
{
|
|
1643
1643
|
showTime: !0,
|
|
1644
1644
|
placeholder: a.placeholder,
|
|
@@ -1652,7 +1652,7 @@ function Aa(e = [], r, t = {}, s = "md") {
|
|
|
1652
1652
|
) : a.type === "file" ? /* @__PURE__ */ o(
|
|
1653
1653
|
K.Item,
|
|
1654
1654
|
{
|
|
1655
|
-
label: a.label ?
|
|
1655
|
+
label: a.label ? le(a) : void 0,
|
|
1656
1656
|
name: a.name,
|
|
1657
1657
|
rules: a.name ? [{ required: a.required, message: a.error || `请选择${a.label}` }] : void 0,
|
|
1658
1658
|
className: "mb-6",
|
|
@@ -1673,7 +1673,7 @@ function Aa(e = [], r, t = {}, s = "md") {
|
|
|
1673
1673
|
) : a.type === "color" ? /* @__PURE__ */ o(
|
|
1674
1674
|
K.Item,
|
|
1675
1675
|
{
|
|
1676
|
-
label: a.label ?
|
|
1676
|
+
label: a.label ? le(a) : void 0,
|
|
1677
1677
|
name: a.name,
|
|
1678
1678
|
rules: a.name ? [{ required: a.required, message: a.error || `请选择${a.label}` }] : void 0,
|
|
1679
1679
|
className: "mb-6",
|
|
@@ -1695,7 +1695,7 @@ function Aa(e = [], r, t = {}, s = "md") {
|
|
|
1695
1695
|
) : a.type === "json" ? /* @__PURE__ */ o(
|
|
1696
1696
|
K.Item,
|
|
1697
1697
|
{
|
|
1698
|
-
label: a.label ?
|
|
1698
|
+
label: a.label ? le(a) : void 0,
|
|
1699
1699
|
name: a.name,
|
|
1700
1700
|
rules: a.name ? [
|
|
1701
1701
|
{ required: a.required, message: a.error || `请输入${a.label}` },
|
|
@@ -1728,7 +1728,7 @@ function Aa(e = [], r, t = {}, s = "md") {
|
|
|
1728
1728
|
) : a.type === "markdown" ? /* @__PURE__ */ o(
|
|
1729
1729
|
K.Item,
|
|
1730
1730
|
{
|
|
1731
|
-
label: a.label ?
|
|
1731
|
+
label: a.label ? le(a) : void 0,
|
|
1732
1732
|
name: a.name,
|
|
1733
1733
|
rules: a.name ? [{ required: a.required, message: a.error || `请输入${a.label}` }] : void 0,
|
|
1734
1734
|
className: "mb-6",
|
|
@@ -1749,7 +1749,7 @@ function Aa(e = [], r, t = {}, s = "md") {
|
|
|
1749
1749
|
) : a.type === "uploader" ? /* @__PURE__ */ o(
|
|
1750
1750
|
K.Item,
|
|
1751
1751
|
{
|
|
1752
|
-
label: a.label ?
|
|
1752
|
+
label: a.label ? le(a) : void 0,
|
|
1753
1753
|
name: a.name,
|
|
1754
1754
|
rules: a.name ? [{ required: a.required, message: a.error || `请上传${a.label}` }] : void 0,
|
|
1755
1755
|
className: "mb-6",
|
|
@@ -1757,7 +1757,7 @@ function Aa(e = [], r, t = {}, s = "md") {
|
|
|
1757
1757
|
wrapperCol: { span: 24 },
|
|
1758
1758
|
required: !1,
|
|
1759
1759
|
children: /* @__PURE__ */ o(
|
|
1760
|
-
|
|
1760
|
+
Yr,
|
|
1761
1761
|
{
|
|
1762
1762
|
multiple: ((R = a.uploaderConfig) == null ? void 0 : R.multiple) ?? !0,
|
|
1763
1763
|
accept: ((ee = a.uploaderConfig) == null ? void 0 : ee.accept) ?? "*/*",
|
|
@@ -1772,7 +1772,7 @@ function Aa(e = [], r, t = {}, s = "md") {
|
|
|
1772
1772
|
icons: (Z = a.uploaderConfig) == null ? void 0 : Z.icons,
|
|
1773
1773
|
placeholder: (P = a.uploaderConfig) == null ? void 0 : P.placeholder,
|
|
1774
1774
|
listName: (k = a.uploaderConfig) == null ? void 0 : k.listName,
|
|
1775
|
-
errorMessages: (
|
|
1775
|
+
errorMessages: (H = a.uploaderConfig) == null ? void 0 : H.errorMessages,
|
|
1776
1776
|
onRef: (Y = a.uploaderConfig) == null ? void 0 : Y.onRef,
|
|
1777
1777
|
styles: r,
|
|
1778
1778
|
eventsEmit: (i, u) => {
|
|
@@ -1792,9 +1792,9 @@ function Aa(e = [], r, t = {}, s = "md") {
|
|
|
1792
1792
|
});
|
|
1793
1793
|
return me.useEffect(() => {
|
|
1794
1794
|
r && typeof r.setFormRef == "function" && r.setFormRef(W);
|
|
1795
|
-
}, [r]),
|
|
1795
|
+
}, [r]), te;
|
|
1796
1796
|
}
|
|
1797
|
-
const
|
|
1797
|
+
const Ga = `
|
|
1798
1798
|
.ant-input-password .ant-input-suffix {
|
|
1799
1799
|
position: absolute !important;
|
|
1800
1800
|
right: 8px !important;
|
|
@@ -1813,7 +1813,7 @@ const Wa = `
|
|
|
1813
1813
|
.ant-input-password:hover .ant-input-suffix .anticon {
|
|
1814
1814
|
color: rgba(0, 0, 0, 0.65) !important;
|
|
1815
1815
|
}
|
|
1816
|
-
`,
|
|
1816
|
+
`, la = me.forwardRef(
|
|
1817
1817
|
({
|
|
1818
1818
|
formItems: e,
|
|
1819
1819
|
formProps: r = {},
|
|
@@ -1828,13 +1828,13 @@ const Wa = `
|
|
|
1828
1828
|
formWidth: M,
|
|
1829
1829
|
...C
|
|
1830
1830
|
}, W) => {
|
|
1831
|
-
var G, S, y, x, D, w, L, q, Z, P, k,
|
|
1832
|
-
const [l] = K.useForm(), _ =
|
|
1831
|
+
var G, S, y, x, D, w, L, q, Z, P, k, H, Y, i;
|
|
1832
|
+
const [l] = K.useForm(), _ = Fe(), U = $e(
|
|
1833
1833
|
// 基础:默认主题 + useTheme的配置
|
|
1834
|
-
|
|
1834
|
+
$e({ theme: B, mode: "light" }, _),
|
|
1835
1835
|
// 最高层:用户手动传入的styles
|
|
1836
1836
|
b
|
|
1837
|
-
),
|
|
1837
|
+
), ae = Te({}), te = () => {
|
|
1838
1838
|
const u = l.getFieldsValue(), c = [], n = (F) => {
|
|
1839
1839
|
F == null || F.forEach((m) => {
|
|
1840
1840
|
m && (m.type === "col" && Array.isArray(m.children) ? n(m.children) : m.name && c.push({ name: m.name, type: m.type }));
|
|
@@ -1842,14 +1842,14 @@ const Wa = `
|
|
|
1842
1842
|
};
|
|
1843
1843
|
n(e);
|
|
1844
1844
|
const z = c.map((F) => {
|
|
1845
|
-
const g = F.type === "uploader" ?
|
|
1845
|
+
const g = F.type === "uploader" ? ae.current[F.name] || u[F.name] || [] : u[F.name];
|
|
1846
1846
|
return { name: F.name, type: F.type, value: g };
|
|
1847
1847
|
});
|
|
1848
1848
|
return {
|
|
1849
1849
|
formName: (r == null ? void 0 : r.name) || "",
|
|
1850
1850
|
values: u,
|
|
1851
1851
|
fields: z,
|
|
1852
|
-
files:
|
|
1852
|
+
files: ae.current,
|
|
1853
1853
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
1854
1854
|
};
|
|
1855
1855
|
}, a = (u, c) => {
|
|
@@ -1869,7 +1869,7 @@ const Wa = `
|
|
|
1869
1869
|
if (u.startsWith("uploader:")) {
|
|
1870
1870
|
const n = c == null ? void 0 : c.fieldName;
|
|
1871
1871
|
if (n) {
|
|
1872
|
-
const z =
|
|
1872
|
+
const z = ae.current[n] || [];
|
|
1873
1873
|
let F = z;
|
|
1874
1874
|
switch (u) {
|
|
1875
1875
|
case "uploader:success": {
|
|
@@ -1882,7 +1882,7 @@ const Wa = `
|
|
|
1882
1882
|
type: m.type,
|
|
1883
1883
|
uploadApiRes: m.uploadApiRes || {},
|
|
1884
1884
|
formData: m.formData || {}
|
|
1885
|
-
}, re = z.findIndex((
|
|
1885
|
+
}, re = z.findIndex((ye) => ye.id === g.id);
|
|
1886
1886
|
re >= 0 ? (z[re] = g, F = [...z]) : F = [...z, g];
|
|
1887
1887
|
}
|
|
1888
1888
|
break;
|
|
@@ -1909,7 +1909,7 @@ const Wa = `
|
|
|
1909
1909
|
break;
|
|
1910
1910
|
}
|
|
1911
1911
|
}
|
|
1912
|
-
|
|
1912
|
+
ae.current[n] = F, l.setFieldsValue({ [n]: F });
|
|
1913
1913
|
}
|
|
1914
1914
|
}
|
|
1915
1915
|
if (typeof s == "function") {
|
|
@@ -1917,16 +1917,16 @@ const Wa = `
|
|
|
1917
1917
|
formName: (r == null ? void 0 : r.name) || "",
|
|
1918
1918
|
...c
|
|
1919
1919
|
};
|
|
1920
|
-
u === "uploader:error" && n.data === void 0 && (n.data =
|
|
1920
|
+
u === "uploader:error" && n.data === void 0 && (n.data = te()), s(u, n);
|
|
1921
1921
|
}
|
|
1922
|
-
}, [v,
|
|
1922
|
+
}, [v, V] = ie(e);
|
|
1923
1923
|
we(() => {
|
|
1924
|
-
|
|
1924
|
+
V(e);
|
|
1925
1925
|
}, [e]);
|
|
1926
1926
|
const A = (u, c) => {
|
|
1927
1927
|
const n = (z) => z.map((F) => F && (F.type === "col" && Array.isArray(F.children) ? { ...F, children: n(F.children) } : F.name === u ? { ...F, ...c } : F));
|
|
1928
|
-
|
|
1929
|
-
},
|
|
1928
|
+
V((z) => n(z));
|
|
1929
|
+
}, E = (u) => {
|
|
1930
1930
|
const c = [...v];
|
|
1931
1931
|
for (; c.length; ) {
|
|
1932
1932
|
const n = c.shift();
|
|
@@ -1937,7 +1937,7 @@ const Wa = `
|
|
|
1937
1937
|
return n;
|
|
1938
1938
|
}
|
|
1939
1939
|
}
|
|
1940
|
-
},
|
|
1940
|
+
}, j = Ja(
|
|
1941
1941
|
v,
|
|
1942
1942
|
{ ...b, eventsEmit: T, formInstance: l },
|
|
1943
1943
|
t,
|
|
@@ -1948,24 +1948,24 @@ const Wa = `
|
|
|
1948
1948
|
typeof s == "function" ? s("form:submit", {
|
|
1949
1949
|
formName: (r == null ? void 0 : r.name) || "",
|
|
1950
1950
|
values: u,
|
|
1951
|
-
data:
|
|
1951
|
+
data: te()
|
|
1952
1952
|
}) : l.submit(), d != null && d.onSubmit ? d.onSubmit(u) : l.resetFields();
|
|
1953
1953
|
} catch (u) {
|
|
1954
1954
|
typeof s == "function" && s("form:submit_error", {
|
|
1955
1955
|
formName: (r == null ? void 0 : r.name) || "",
|
|
1956
1956
|
error: u,
|
|
1957
|
-
data:
|
|
1957
|
+
data: te()
|
|
1958
1958
|
});
|
|
1959
1959
|
}
|
|
1960
1960
|
}, X = () => {
|
|
1961
1961
|
l.resetFields(), typeof s == "function" && s("form:reset", {
|
|
1962
1962
|
formName: (r == null ? void 0 : r.name) || "",
|
|
1963
|
-
data:
|
|
1963
|
+
data: te()
|
|
1964
1964
|
}), d != null && d.onReset && d.onReset();
|
|
1965
1965
|
}, R = () => {
|
|
1966
1966
|
l.resetFields(), typeof s == "function" && s("form:cancel", {
|
|
1967
1967
|
formName: (r == null ? void 0 : r.name) || "",
|
|
1968
|
-
data:
|
|
1968
|
+
data: te()
|
|
1969
1969
|
});
|
|
1970
1970
|
}, ee = async () => {
|
|
1971
1971
|
try {
|
|
@@ -1976,7 +1976,7 @@ const Wa = `
|
|
|
1976
1976
|
};
|
|
1977
1977
|
n(e);
|
|
1978
1978
|
const z = c.map((F) => {
|
|
1979
|
-
const g = F.type === "uploader" ?
|
|
1979
|
+
const g = F.type === "uploader" ? ae.current[F.name] || u[F.name] || [] : u[F.name];
|
|
1980
1980
|
return { name: F.name, type: F.type, value: g };
|
|
1981
1981
|
});
|
|
1982
1982
|
return {
|
|
@@ -1994,7 +1994,7 @@ const Wa = `
|
|
|
1994
1994
|
};
|
|
1995
1995
|
z(e);
|
|
1996
1996
|
const F = n.map((m) => {
|
|
1997
|
-
const re = m.type === "uploader" ?
|
|
1997
|
+
const re = m.type === "uploader" ? ae.current[m.name] || c[m.name] || [] : c[m.name];
|
|
1998
1998
|
return { name: m.name, type: m.type, value: re };
|
|
1999
1999
|
});
|
|
2000
2000
|
return {
|
|
@@ -2020,12 +2020,12 @@ const Wa = `
|
|
|
2020
2020
|
getValues: () => l.getFieldsValue(),
|
|
2021
2021
|
setValues: (u) => l.setFieldsValue(u),
|
|
2022
2022
|
setFieldProps: (u, c) => A(u, c),
|
|
2023
|
-
getFieldProps: (u) =>
|
|
2023
|
+
getFieldProps: (u) => E(u)
|
|
2024
2024
|
}),
|
|
2025
2025
|
[l, ee, Q, X, R]
|
|
2026
|
-
), /* @__PURE__ */
|
|
2027
|
-
/* @__PURE__ */ o("style", { children:
|
|
2028
|
-
/* @__PURE__ */
|
|
2026
|
+
), /* @__PURE__ */ O(na, { children: [
|
|
2027
|
+
/* @__PURE__ */ o("style", { children: Ga }),
|
|
2028
|
+
/* @__PURE__ */ O(
|
|
2029
2029
|
"div",
|
|
2030
2030
|
{
|
|
2031
2031
|
style: {
|
|
@@ -2038,14 +2038,14 @@ const Wa = `
|
|
|
2038
2038
|
// 确保最大宽度不超过设定值
|
|
2039
2039
|
},
|
|
2040
2040
|
children: [
|
|
2041
|
-
(f || N) && /* @__PURE__ */
|
|
2041
|
+
(f || N) && /* @__PURE__ */ O("div", { style: { marginBottom: "24px" }, children: [
|
|
2042
2042
|
f && /* @__PURE__ */ o(
|
|
2043
2043
|
"h2",
|
|
2044
2044
|
{
|
|
2045
2045
|
style: {
|
|
2046
2046
|
fontSize: "24px",
|
|
2047
2047
|
fontWeight: "600",
|
|
2048
|
-
color: ((S = (G =
|
|
2048
|
+
color: ((S = (G = U.theme) == null ? void 0 : G.colors) == null ? void 0 : S.text) || "#1f2937",
|
|
2049
2049
|
margin: "0 0 8px 0"
|
|
2050
2050
|
},
|
|
2051
2051
|
children: f
|
|
@@ -2056,7 +2056,7 @@ const Wa = `
|
|
|
2056
2056
|
{
|
|
2057
2057
|
style: {
|
|
2058
2058
|
fontSize: "14px",
|
|
2059
|
-
color: ((x = (y =
|
|
2059
|
+
color: ((x = (y = U.theme) == null ? void 0 : y.colors) == null ? void 0 : x.secondary) || "#6b7280",
|
|
2060
2060
|
margin: "0",
|
|
2061
2061
|
lineHeight: "1.5"
|
|
2062
2062
|
},
|
|
@@ -2064,7 +2064,7 @@ const Wa = `
|
|
|
2064
2064
|
}
|
|
2065
2065
|
)
|
|
2066
2066
|
] }),
|
|
2067
|
-
/* @__PURE__ */
|
|
2067
|
+
/* @__PURE__ */ O(
|
|
2068
2068
|
K,
|
|
2069
2069
|
{
|
|
2070
2070
|
form: l,
|
|
@@ -2081,38 +2081,38 @@ const Wa = `
|
|
|
2081
2081
|
className: "dynamic-form",
|
|
2082
2082
|
loading: (r == null ? void 0 : r.loading) === !0 ? !0 : void 0,
|
|
2083
2083
|
children: [
|
|
2084
|
-
|
|
2085
|
-
((d == null ? void 0 : d.showSubmit) || (d == null ? void 0 : d.showReset)) && /* @__PURE__ */
|
|
2084
|
+
j,
|
|
2085
|
+
((d == null ? void 0 : d.showSubmit) || (d == null ? void 0 : d.showReset)) && /* @__PURE__ */ O(
|
|
2086
2086
|
"div",
|
|
2087
2087
|
{
|
|
2088
2088
|
style: {
|
|
2089
2089
|
marginTop: "32px",
|
|
2090
2090
|
paddingTop: "24px",
|
|
2091
|
-
borderTop: `1px solid ${((w = (D =
|
|
2091
|
+
borderTop: `1px solid ${((w = (D = U.theme) == null ? void 0 : D.colors) == null ? void 0 : w.border) || "#e5e7eb"}`,
|
|
2092
2092
|
display: "flex",
|
|
2093
2093
|
gap: "12px",
|
|
2094
2094
|
justifyContent: "flex-end"
|
|
2095
2095
|
},
|
|
2096
2096
|
children: [
|
|
2097
2097
|
(d == null ? void 0 : d.showReset) && /* @__PURE__ */ o(
|
|
2098
|
-
|
|
2098
|
+
Lr,
|
|
2099
2099
|
{
|
|
2100
2100
|
onClick: X,
|
|
2101
2101
|
style: {
|
|
2102
|
-
borderColor: ((q = (L =
|
|
2103
|
-
color: ((P = (Z =
|
|
2102
|
+
borderColor: ((q = (L = U.theme) == null ? void 0 : L.colors) == null ? void 0 : q.border) || "#e5e7eb",
|
|
2103
|
+
color: ((P = (Z = U.theme) == null ? void 0 : Z.colors) == null ? void 0 : P.text) || "#1f2937"
|
|
2104
2104
|
},
|
|
2105
2105
|
children: (d == null ? void 0 : d.resetText) || "重置"
|
|
2106
2106
|
}
|
|
2107
2107
|
),
|
|
2108
2108
|
(d == null ? void 0 : d.showSubmit) && /* @__PURE__ */ o(
|
|
2109
|
-
|
|
2109
|
+
Lr,
|
|
2110
2110
|
{
|
|
2111
2111
|
type: "primary",
|
|
2112
2112
|
onClick: Q,
|
|
2113
2113
|
style: {
|
|
2114
|
-
backgroundColor: ((
|
|
2115
|
-
borderColor: ((i = (Y =
|
|
2114
|
+
backgroundColor: ((H = (k = U.theme) == null ? void 0 : k.colors) == null ? void 0 : H.primary) || "#2563eb",
|
|
2115
|
+
borderColor: ((i = (Y = U.theme) == null ? void 0 : Y.colors) == null ? void 0 : i.primary) || "#2563eb"
|
|
2116
2116
|
},
|
|
2117
2117
|
children: (d == null ? void 0 : d.submitText) || "提交"
|
|
2118
2118
|
}
|
|
@@ -2129,13 +2129,13 @@ const Wa = `
|
|
|
2129
2129
|
] });
|
|
2130
2130
|
}
|
|
2131
2131
|
);
|
|
2132
|
-
me.memo(
|
|
2133
|
-
const
|
|
2132
|
+
me.memo(la);
|
|
2133
|
+
const Hr = !1, Ka = (e, r) => r != null && r.fileType ? e.startsWith("image/") ? r.fileType.image || /* @__PURE__ */ o(ke, { size: 20 }) : e.includes("document") || e.includes("pdf") || e.includes("text") ? r.fileType.document || /* @__PURE__ */ o(ke, { size: 20 }) : e.includes("spreadsheet") || e.includes("excel") || e.includes("csv") ? r.fileType.spreadsheet || /* @__PURE__ */ o(ke, { size: 20 }) : e.includes("zip") || e.includes("rar") || e.includes("7z") ? r.fileType.archive || /* @__PURE__ */ o(ke, { size: 20 }) : e.startsWith("video/") ? r.fileType.video || /* @__PURE__ */ o(ke, { size: 20 }) : e.startsWith("audio/") ? r.fileType.audio || /* @__PURE__ */ o(ke, { size: 20 }) : r.fileType.default || /* @__PURE__ */ o(ke, { size: 20 }) : /* @__PURE__ */ o(ke, { size: 20 }), Pa = (e, r, t) => {
|
|
2134
2134
|
var s, h, b, p;
|
|
2135
2135
|
if (t != null && t.itemStatus)
|
|
2136
2136
|
switch (e) {
|
|
2137
2137
|
case "error":
|
|
2138
|
-
return t.itemStatus.error || /* @__PURE__ */ o(
|
|
2138
|
+
return t.itemStatus.error || /* @__PURE__ */ o(_r, { size: 20 });
|
|
2139
2139
|
case "uploading":
|
|
2140
2140
|
return t.itemStatus.uploading || /* @__PURE__ */ o("span", { style: { fontSize: "12px", color: ((s = r == null ? void 0 : r.colors) == null ? void 0 : s.primary) || "#007bff" }, children: "上传中..." });
|
|
2141
2141
|
case "success":
|
|
@@ -2147,7 +2147,7 @@ const Mr = !1, Ra = (e, r) => r != null && r.fileType ? e.startsWith("image/") ?
|
|
|
2147
2147
|
}
|
|
2148
2148
|
switch (e) {
|
|
2149
2149
|
case "error":
|
|
2150
|
-
return /* @__PURE__ */ o(
|
|
2150
|
+
return /* @__PURE__ */ o(_r, { size: 20 });
|
|
2151
2151
|
case "uploading":
|
|
2152
2152
|
return /* @__PURE__ */ o("span", { style: { fontSize: "12px", color: ((b = r == null ? void 0 : r.colors) == null ? void 0 : b.primary) || "#007bff" }, children: "上传中..." });
|
|
2153
2153
|
case "pending":
|
|
@@ -2156,7 +2156,7 @@ const Mr = !1, Ra = (e, r) => r != null && r.fileType ? e.startsWith("image/") ?
|
|
|
2156
2156
|
return null;
|
|
2157
2157
|
}
|
|
2158
2158
|
};
|
|
2159
|
-
|
|
2159
|
+
pa`
|
|
2160
2160
|
.upload-item-container .upload-item {
|
|
2161
2161
|
padding: 0px !important;
|
|
2162
2162
|
}
|
|
@@ -2165,7 +2165,7 @@ Qr`
|
|
|
2165
2165
|
padding: 0px !important;
|
|
2166
2166
|
}
|
|
2167
2167
|
`;
|
|
2168
|
-
const
|
|
2168
|
+
const Xa = ({
|
|
2169
2169
|
item: e,
|
|
2170
2170
|
index: r,
|
|
2171
2171
|
theme: t,
|
|
@@ -2176,40 +2176,40 @@ const La = ({
|
|
|
2176
2176
|
icons: d
|
|
2177
2177
|
}) => {
|
|
2178
2178
|
var f;
|
|
2179
|
-
return /* @__PURE__ */
|
|
2180
|
-
/* @__PURE__ */
|
|
2181
|
-
/* @__PURE__ */ o(
|
|
2182
|
-
/* @__PURE__ */
|
|
2183
|
-
/* @__PURE__ */
|
|
2184
|
-
/* @__PURE__ */ o(
|
|
2185
|
-
/* @__PURE__ */ o(
|
|
2179
|
+
return /* @__PURE__ */ O(Ea, { $theme: t, $status: e.status, $hasForm: s.length > 0, children: [
|
|
2180
|
+
/* @__PURE__ */ O(qa, { $theme: t, $status: e.status, $hasForm: s.length > 0, children: [
|
|
2181
|
+
/* @__PURE__ */ o(La, { $theme: t, children: Ka(e.type, d) }),
|
|
2182
|
+
/* @__PURE__ */ O(Oa, { children: [
|
|
2183
|
+
/* @__PURE__ */ O("div", { className: "flex items-center gap-1 line-clamp-1", children: [
|
|
2184
|
+
/* @__PURE__ */ o(ja, { $theme: t, children: e.name }),
|
|
2185
|
+
/* @__PURE__ */ o(Ha, { $theme: t, children: sa(e.size) })
|
|
2186
2186
|
] }),
|
|
2187
|
-
e.status === "uploading" && /* @__PURE__ */ o(
|
|
2187
|
+
e.status === "uploading" && /* @__PURE__ */ o(Ya, { $theme: t, $progress: e.progress }),
|
|
2188
2188
|
e.status === "error" && e.error && /* @__PURE__ */ o("div", { style: { color: ((f = t == null ? void 0 : t.colors) == null ? void 0 : f.error) || "#FF0000", fontSize: "12px", marginTop: "4px" }, children: typeof e.error == "string" ? e.error : String(e.error) })
|
|
2189
2189
|
] }),
|
|
2190
2190
|
(() => {
|
|
2191
|
-
const N =
|
|
2192
|
-
return N && /* @__PURE__ */ o(
|
|
2191
|
+
const N = Pa(e.status, t, d);
|
|
2192
|
+
return N && /* @__PURE__ */ o(Ia, { $theme: t, $status: e.status, children: N });
|
|
2193
2193
|
})(),
|
|
2194
|
-
|
|
2194
|
+
Hr,
|
|
2195
2195
|
/* @__PURE__ */ o(
|
|
2196
|
-
|
|
2196
|
+
Ua,
|
|
2197
2197
|
{
|
|
2198
2198
|
$theme: t,
|
|
2199
2199
|
onClick: () => h(e.id),
|
|
2200
2200
|
title: "移除文件",
|
|
2201
|
-
children: /* @__PURE__ */ o(
|
|
2201
|
+
children: /* @__PURE__ */ o(fa, { size: 16 })
|
|
2202
2202
|
}
|
|
2203
2203
|
)
|
|
2204
2204
|
] }),
|
|
2205
|
-
(s.length > 0 ||
|
|
2206
|
-
|
|
2205
|
+
(s.length > 0 || Hr) && /* @__PURE__ */ o(
|
|
2206
|
+
Va,
|
|
2207
2207
|
{
|
|
2208
2208
|
$theme: t,
|
|
2209
2209
|
$hasError: e.status === "error",
|
|
2210
2210
|
className: "list-my",
|
|
2211
2211
|
children: /* @__PURE__ */ o(
|
|
2212
|
-
|
|
2212
|
+
la,
|
|
2213
2213
|
{
|
|
2214
2214
|
formItems: s,
|
|
2215
2215
|
initialValues: e.formData || {},
|
|
@@ -2250,7 +2250,7 @@ const La = ({
|
|
|
2250
2250
|
}
|
|
2251
2251
|
)
|
|
2252
2252
|
] });
|
|
2253
|
-
},
|
|
2253
|
+
}, Yr = ({
|
|
2254
2254
|
multiple: e = !0,
|
|
2255
2255
|
accept: r = "*/*",
|
|
2256
2256
|
maxSize: t = 100,
|
|
@@ -2274,16 +2274,16 @@ const La = ({
|
|
|
2274
2274
|
// 新增:图标配置
|
|
2275
2275
|
eventsEmit: l,
|
|
2276
2276
|
onRef: _,
|
|
2277
|
-
placeholder:
|
|
2278
|
-
listName:
|
|
2277
|
+
placeholder: U,
|
|
2278
|
+
listName: ae
|
|
2279
2279
|
}) => {
|
|
2280
|
-
var
|
|
2281
|
-
const
|
|
2280
|
+
var H, Y;
|
|
2281
|
+
const te = Fe(), a = $e(
|
|
2282
2282
|
// 基础:默认主题 + useTheme的配置
|
|
2283
|
-
|
|
2283
|
+
$e({ theme: B, mode: "light" }, te),
|
|
2284
2284
|
// 最高层:用户手动传入的styles
|
|
2285
2285
|
N
|
|
2286
|
-
), T =
|
|
2286
|
+
), T = Te(null), [v, V] = ie(!1), [A, E] = ie([]), j = he((i) => (i ?? A).map((c) => ({
|
|
2287
2287
|
id: c.id,
|
|
2288
2288
|
name: c.name,
|
|
2289
2289
|
status: c.status,
|
|
@@ -2294,16 +2294,16 @@ const La = ({
|
|
|
2294
2294
|
size: c.size,
|
|
2295
2295
|
type: c.type
|
|
2296
2296
|
})), [A]), Q = Se(() => {
|
|
2297
|
-
if (!
|
|
2298
|
-
if (typeof
|
|
2299
|
-
let i =
|
|
2297
|
+
if (!U) return null;
|
|
2298
|
+
if (typeof U == "string") {
|
|
2299
|
+
let i = U;
|
|
2300
2300
|
return i = i.replace(/<br\s*\/?>(?=\s*)/gi, `
|
|
2301
2301
|
`), i = i.replace(/\s*\/n\s*/gi, `
|
|
2302
2302
|
`), i = i.replace(/\\n/g, `
|
|
2303
2303
|
`), /* @__PURE__ */ o(
|
|
2304
|
-
|
|
2304
|
+
jr,
|
|
2305
2305
|
{
|
|
2306
|
-
$theme: a.theme ||
|
|
2306
|
+
$theme: a.theme || B,
|
|
2307
2307
|
style: {
|
|
2308
2308
|
textAlign: "center",
|
|
2309
2309
|
whiteSpace: "pre-line"
|
|
@@ -2312,8 +2312,8 @@ const La = ({
|
|
|
2312
2312
|
}
|
|
2313
2313
|
);
|
|
2314
2314
|
}
|
|
2315
|
-
return
|
|
2316
|
-
}, [
|
|
2315
|
+
return U;
|
|
2316
|
+
}, [U, a.theme]), X = {
|
|
2317
2317
|
noUrl: "请提供上传接口地址 (url)",
|
|
2318
2318
|
uploadFailed: "上传失败,请重试",
|
|
2319
2319
|
fileTooLarge: `文件大小不能超过 ${t}MB`,
|
|
@@ -2321,19 +2321,19 @@ const La = ({
|
|
|
2321
2321
|
}, R = { ...X, ...C }, ee = (i, u) => R[i] ? R[i] : u || X[i], G = (i) => {
|
|
2322
2322
|
const u = i / 1048576;
|
|
2323
2323
|
return `${Number(u.toFixed(2))}MB`;
|
|
2324
|
-
}, S =
|
|
2324
|
+
}, S = he(
|
|
2325
2325
|
(i, u) => {
|
|
2326
2326
|
const c = t * 1024 * 1024, n = [], z = [];
|
|
2327
2327
|
if (i.forEach((g) => {
|
|
2328
2328
|
g.size > c ? n.push(g) : z.push(g);
|
|
2329
2329
|
}), n.length > 0) {
|
|
2330
|
-
const g = n.map((
|
|
2330
|
+
const g = n.map((ye) => `${ye.name}(${G(ye.size)})`).join("、"), re = `${ee("fileTooLarge")}:${g}`;
|
|
2331
2331
|
l == null || l("uploader:error", {
|
|
2332
2332
|
type: "fileTooLarge",
|
|
2333
2333
|
message: re,
|
|
2334
|
-
files: n.map((
|
|
2334
|
+
files: n.map((ye) => ({ name: ye.name, size: ye.size })),
|
|
2335
2335
|
limit: `${t}MB`,
|
|
2336
|
-
data:
|
|
2336
|
+
data: j()
|
|
2337
2337
|
});
|
|
2338
2338
|
}
|
|
2339
2339
|
const F = Math.max(0, s - u);
|
|
@@ -2345,7 +2345,7 @@ const La = ({
|
|
|
2345
2345
|
currentCount: u,
|
|
2346
2346
|
tryAdd: i.length,
|
|
2347
2347
|
limit: s,
|
|
2348
|
-
data:
|
|
2348
|
+
data: j()
|
|
2349
2349
|
}), [];
|
|
2350
2350
|
}
|
|
2351
2351
|
const m = z.slice(0, F);
|
|
@@ -2358,12 +2358,12 @@ const La = ({
|
|
|
2358
2358
|
accepted: m.length,
|
|
2359
2359
|
dropped: g,
|
|
2360
2360
|
limit: s,
|
|
2361
|
-
data:
|
|
2361
|
+
data: j()
|
|
2362
2362
|
});
|
|
2363
2363
|
}
|
|
2364
2364
|
return m;
|
|
2365
2365
|
},
|
|
2366
|
-
[t, s, ee, l,
|
|
2366
|
+
[t, s, ee, l, j]
|
|
2367
2367
|
), y = Se(
|
|
2368
2368
|
() => ({
|
|
2369
2369
|
// 获取所有上传项
|
|
@@ -2390,26 +2390,26 @@ const La = ({
|
|
|
2390
2390
|
},
|
|
2391
2391
|
// 清空所有上传项
|
|
2392
2392
|
clearUploadItems: () => {
|
|
2393
|
-
|
|
2393
|
+
E([]), l == null || l("uploader:clear", {});
|
|
2394
2394
|
},
|
|
2395
2395
|
// 新增:设置某个 item 的错误信息
|
|
2396
2396
|
setItemError: (i, u) => {
|
|
2397
|
-
|
|
2397
|
+
E((c) => c.map(
|
|
2398
2398
|
(n) => n.id === i ? { ...n, status: "error", error: u } : n
|
|
2399
|
-
)), l == null || l("uploader:errorSet", { itemId: i, error: u, data:
|
|
2399
|
+
)), l == null || l("uploader:errorSet", { itemId: i, error: u, data: j() });
|
|
2400
2400
|
},
|
|
2401
2401
|
// 新增:清除某个 item 的错误信息
|
|
2402
2402
|
clearItemError: (i) => {
|
|
2403
|
-
|
|
2403
|
+
E((u) => u.map(
|
|
2404
2404
|
(c) => c.id === i ? { ...c, status: "pending", error: void 0 } : c
|
|
2405
|
-
)), l == null || l("uploader:errorCleared", { itemId: i, data:
|
|
2405
|
+
)), l == null || l("uploader:errorCleared", { itemId: i, data: j() });
|
|
2406
2406
|
},
|
|
2407
2407
|
// 添加新的上传项(对外方法也应用限流)
|
|
2408
2408
|
addUploadItems: (i) => {
|
|
2409
2409
|
const u = S(i, A.length);
|
|
2410
2410
|
if (u.length === 0) return;
|
|
2411
2411
|
const c = u.map((n) => ({
|
|
2412
|
-
id:
|
|
2412
|
+
id: Or(),
|
|
2413
2413
|
file: n,
|
|
2414
2414
|
name: n.name,
|
|
2415
2415
|
size: n.size,
|
|
@@ -2419,34 +2419,34 @@ const La = ({
|
|
|
2419
2419
|
formData: {},
|
|
2420
2420
|
isExpanded: !1
|
|
2421
2421
|
}));
|
|
2422
|
-
|
|
2422
|
+
E((n) => [...n, ...c]), h && q(c);
|
|
2423
2423
|
},
|
|
2424
2424
|
// 移除指定上传项
|
|
2425
2425
|
removeUploadItem: (i) => {
|
|
2426
|
-
|
|
2426
|
+
E((u) => {
|
|
2427
2427
|
const c = u.find((n) => n.id === i);
|
|
2428
2428
|
return c && (l == null || l("uploader:remove", {
|
|
2429
2429
|
itemId: i,
|
|
2430
2430
|
item: c,
|
|
2431
|
-
data:
|
|
2431
|
+
data: j(u)
|
|
2432
2432
|
})), u.filter((n) => n.id !== i);
|
|
2433
2433
|
});
|
|
2434
2434
|
},
|
|
2435
2435
|
// 验证表单数据
|
|
2436
2436
|
validateFormData: async () => !(A.some((n) => n.status === "error") || A.some((n) => n.status === "uploading") || !A.some((n) => n.status === "success"))
|
|
2437
2437
|
}),
|
|
2438
|
-
[A, h, l, S,
|
|
2438
|
+
[A, h, l, S, j]
|
|
2439
2439
|
);
|
|
2440
2440
|
we(() => {
|
|
2441
2441
|
_ && _(y);
|
|
2442
2442
|
}, [y, _]);
|
|
2443
|
-
const x =
|
|
2443
|
+
const x = he(
|
|
2444
2444
|
(i) => {
|
|
2445
2445
|
if (!i) return;
|
|
2446
2446
|
const u = S(Array.from(i), A.length);
|
|
2447
2447
|
if (u.length === 0) return;
|
|
2448
2448
|
const c = u.map((n) => ({
|
|
2449
|
-
id:
|
|
2449
|
+
id: Or(),
|
|
2450
2450
|
file: n,
|
|
2451
2451
|
name: n.name,
|
|
2452
2452
|
size: n.size,
|
|
@@ -2457,33 +2457,33 @@ const La = ({
|
|
|
2457
2457
|
// 每个item独立的表单数据
|
|
2458
2458
|
isExpanded: !1
|
|
2459
2459
|
}));
|
|
2460
|
-
|
|
2460
|
+
E((n) => [...n, ...c]), h && q(c);
|
|
2461
2461
|
},
|
|
2462
2462
|
[h, A.length, S]
|
|
2463
|
-
), D =
|
|
2464
|
-
i.preventDefault(),
|
|
2465
|
-
}, []), w =
|
|
2466
|
-
i.preventDefault(),
|
|
2467
|
-
}, []), L =
|
|
2463
|
+
), D = he((i) => {
|
|
2464
|
+
i.preventDefault(), V(!0);
|
|
2465
|
+
}, []), w = he((i) => {
|
|
2466
|
+
i.preventDefault(), V(!1);
|
|
2467
|
+
}, []), L = he(
|
|
2468
2468
|
(i) => {
|
|
2469
|
-
i.preventDefault(),
|
|
2469
|
+
i.preventDefault(), V(!1), x(i.dataTransfer.files);
|
|
2470
2470
|
},
|
|
2471
2471
|
[x]
|
|
2472
|
-
), q =
|
|
2472
|
+
), q = he(
|
|
2473
2473
|
async (i) => {
|
|
2474
2474
|
if (!b) {
|
|
2475
2475
|
console.error(ee("noUrl"));
|
|
2476
2476
|
return;
|
|
2477
2477
|
}
|
|
2478
|
-
l == null || l("uploader:start", { items: i, data:
|
|
2478
|
+
l == null || l("uploader:start", { items: i, data: j() });
|
|
2479
2479
|
for (const u of i)
|
|
2480
2480
|
try {
|
|
2481
|
-
|
|
2481
|
+
E(
|
|
2482
2482
|
(m) => m.map((g) => g.id === u.id ? { ...g, status: "uploading" } : g)
|
|
2483
2483
|
);
|
|
2484
|
-
const c = await
|
|
2485
|
-
|
|
2486
|
-
}), n =
|
|
2484
|
+
const c = await za(u.file, b, p, d, (m) => {
|
|
2485
|
+
E((g) => g.map((re) => re.id === u.id ? { ...re, progress: m } : re)), l == null || l("uploader:progress", { item: { ...u, progress: m }, data: j() });
|
|
2486
|
+
}), n = Da(u, f), z = {
|
|
2487
2487
|
...u,
|
|
2488
2488
|
status: "success",
|
|
2489
2489
|
uploadApiRes: c,
|
|
@@ -2493,7 +2493,7 @@ const La = ({
|
|
|
2493
2493
|
isExpanded: f.length > 0
|
|
2494
2494
|
// 上传成功后,如果有表单配置则默认展开
|
|
2495
2495
|
}, F = A.map((m) => m.id === u.id ? z : m);
|
|
2496
|
-
|
|
2496
|
+
E((m) => m.map((g) => g.id === u.id ? z : g)), l == null || l("uploader:success", { item: z, data: j(F) });
|
|
2497
2497
|
} catch (c) {
|
|
2498
2498
|
let n = "";
|
|
2499
2499
|
if (console.log("上传错误详情:", c), c && typeof c == "object") {
|
|
@@ -2555,26 +2555,26 @@ const La = ({
|
|
|
2555
2555
|
}
|
|
2556
2556
|
n || (n = ee("uploadFailed")), console.log("最终使用的错误信息:", n);
|
|
2557
2557
|
const z = { ...u, status: "error", error: n }, F = A.map((m) => m.id === u.id ? z : m);
|
|
2558
|
-
|
|
2558
|
+
E((m) => m.map((g) => g.id === u.id ? z : g)), l == null || l("uploader:error", { item: z, error: n, data: j(F) });
|
|
2559
2559
|
}
|
|
2560
|
-
l == null || l("uploader:complete", { items: A, data:
|
|
2560
|
+
l == null || l("uploader:complete", { items: A, data: j() });
|
|
2561
2561
|
},
|
|
2562
|
-
[b, p, d, l, A, f, R.uploadFailed,
|
|
2563
|
-
), Z =
|
|
2562
|
+
[b, p, d, l, A, f, R.uploadFailed, j]
|
|
2563
|
+
), Z = he(
|
|
2564
2564
|
(i) => {
|
|
2565
|
-
|
|
2565
|
+
E((u) => {
|
|
2566
2566
|
const c = u.find((n) => n.id === i);
|
|
2567
2567
|
return c && (l == null || l("uploader:remove", {
|
|
2568
2568
|
itemId: i,
|
|
2569
2569
|
item: c,
|
|
2570
|
-
data:
|
|
2570
|
+
data: j(u)
|
|
2571
2571
|
})), u.filter((n) => n.id !== i);
|
|
2572
2572
|
});
|
|
2573
2573
|
},
|
|
2574
|
-
[l,
|
|
2575
|
-
), P =
|
|
2574
|
+
[l, j]
|
|
2575
|
+
), P = he(
|
|
2576
2576
|
(i) => {
|
|
2577
|
-
|
|
2577
|
+
E(
|
|
2578
2578
|
(u) => u.map((c) => {
|
|
2579
2579
|
if (c.id === i) {
|
|
2580
2580
|
const n = {
|
|
@@ -2585,17 +2585,17 @@ const La = ({
|
|
|
2585
2585
|
itemId: i,
|
|
2586
2586
|
isExpanded: n.isExpanded,
|
|
2587
2587
|
item: n,
|
|
2588
|
-
data:
|
|
2588
|
+
data: j(u)
|
|
2589
2589
|
}), n;
|
|
2590
2590
|
}
|
|
2591
2591
|
return c;
|
|
2592
2592
|
})
|
|
2593
2593
|
);
|
|
2594
2594
|
},
|
|
2595
|
-
[l,
|
|
2596
|
-
), k =
|
|
2595
|
+
[l, j]
|
|
2596
|
+
), k = he(
|
|
2597
2597
|
(i, u) => {
|
|
2598
|
-
console.log("FormData Change:", i, u),
|
|
2598
|
+
console.log("FormData Change:", i, u), E((c) => {
|
|
2599
2599
|
const n = c.map((z) => {
|
|
2600
2600
|
if (z.id === i) {
|
|
2601
2601
|
const F = {
|
|
@@ -2607,7 +2607,7 @@ const La = ({
|
|
|
2607
2607
|
itemId: i,
|
|
2608
2608
|
formData: F.formData,
|
|
2609
2609
|
item: F,
|
|
2610
|
-
data:
|
|
2610
|
+
data: j(c)
|
|
2611
2611
|
}), F;
|
|
2612
2612
|
}
|
|
2613
2613
|
return z;
|
|
@@ -2616,17 +2616,17 @@ const La = ({
|
|
|
2616
2616
|
items: n,
|
|
2617
2617
|
changedItemId: i,
|
|
2618
2618
|
changedFormData: u,
|
|
2619
|
-
data:
|
|
2619
|
+
data: j(n)
|
|
2620
2620
|
}), n;
|
|
2621
2621
|
});
|
|
2622
2622
|
},
|
|
2623
|
-
[l,
|
|
2623
|
+
[l, j]
|
|
2624
2624
|
);
|
|
2625
|
-
return /* @__PURE__ */
|
|
2626
|
-
/* @__PURE__ */
|
|
2627
|
-
|
|
2625
|
+
return /* @__PURE__ */ O("div", { children: [
|
|
2626
|
+
/* @__PURE__ */ O(
|
|
2627
|
+
_a,
|
|
2628
2628
|
{
|
|
2629
|
-
$theme: a.theme ||
|
|
2629
|
+
$theme: a.theme || B,
|
|
2630
2630
|
$isDragOver: v,
|
|
2631
2631
|
onDragOver: D,
|
|
2632
2632
|
onDragLeave: w,
|
|
@@ -2636,23 +2636,23 @@ const La = ({
|
|
|
2636
2636
|
T.current && (T.current.value = ""), (i = T.current) == null || i.click();
|
|
2637
2637
|
},
|
|
2638
2638
|
children: [
|
|
2639
|
-
/* @__PURE__ */ o(
|
|
2640
|
-
Q || /* @__PURE__ */
|
|
2641
|
-
/* @__PURE__ */ o(
|
|
2642
|
-
/* @__PURE__ */
|
|
2639
|
+
/* @__PURE__ */ o(Aa, { $theme: a.theme || B, children: (W == null ? void 0 : W.dragUpload) || /* @__PURE__ */ o(ma, { size: 48 }) }),
|
|
2640
|
+
Q || /* @__PURE__ */ O(na, { children: [
|
|
2641
|
+
/* @__PURE__ */ o(Ba, { $theme: a.theme || B, children: "拖拽文件到此处或点击选择文件" }),
|
|
2642
|
+
/* @__PURE__ */ O(jr, { $theme: a.theme || B, children: [
|
|
2643
2643
|
"支持 ",
|
|
2644
2644
|
r,
|
|
2645
2645
|
" 格式,单个文件最大 ",
|
|
2646
2646
|
t,
|
|
2647
2647
|
"MB",
|
|
2648
|
-
!b && /* @__PURE__ */ o("div", { style: { color: ((Y = (
|
|
2648
|
+
!b && /* @__PURE__ */ o("div", { style: { color: ((Y = (H = a.theme) == null ? void 0 : H.colors) == null ? void 0 : Y.error) || "#FF0000", marginTop: "8px", fontSize: "12px" }, children: ee("noUrl") })
|
|
2649
2649
|
] })
|
|
2650
2650
|
] })
|
|
2651
2651
|
]
|
|
2652
2652
|
}
|
|
2653
2653
|
),
|
|
2654
2654
|
/* @__PURE__ */ o(
|
|
2655
|
-
|
|
2655
|
+
Wa,
|
|
2656
2656
|
{
|
|
2657
2657
|
ref: T,
|
|
2658
2658
|
type: "file",
|
|
@@ -2663,20 +2663,20 @@ const La = ({
|
|
|
2663
2663
|
}
|
|
2664
2664
|
}
|
|
2665
2665
|
),
|
|
2666
|
-
A.length > 0 && /* @__PURE__ */
|
|
2667
|
-
/* @__PURE__ */
|
|
2666
|
+
A.length > 0 && /* @__PURE__ */ O("div", { children: [
|
|
2667
|
+
/* @__PURE__ */ O("div", { style: {
|
|
2668
2668
|
display: "flex",
|
|
2669
2669
|
justifyContent: "space-between",
|
|
2670
2670
|
alignItems: "center",
|
|
2671
2671
|
margin: "6px 0px"
|
|
2672
2672
|
}, children: [
|
|
2673
|
-
/* @__PURE__ */ o("div", { className: "text-[14px] font-bold opacity-60", children:
|
|
2673
|
+
/* @__PURE__ */ o("div", { className: "text-[14px] font-bold opacity-60", children: ae || "上传文件列表" }),
|
|
2674
2674
|
M.length > 0 && /* @__PURE__ */ o("div", { style: {
|
|
2675
2675
|
display: "flex",
|
|
2676
2676
|
gap: "8px",
|
|
2677
2677
|
alignItems: "center"
|
|
2678
2678
|
}, children: M.map((i, u) => /* @__PURE__ */ o(
|
|
2679
|
-
|
|
2679
|
+
er,
|
|
2680
2680
|
{
|
|
2681
2681
|
mode: i.mode || "default",
|
|
2682
2682
|
label: i.label,
|
|
@@ -2688,8 +2688,8 @@ const La = ({
|
|
|
2688
2688
|
u
|
|
2689
2689
|
)) })
|
|
2690
2690
|
] }),
|
|
2691
|
-
/* @__PURE__ */ o(
|
|
2692
|
-
|
|
2691
|
+
/* @__PURE__ */ o(Ra, { $theme: a.theme || B, children: A.map((i, u) => /* @__PURE__ */ o(
|
|
2692
|
+
Xa,
|
|
2693
2693
|
{
|
|
2694
2694
|
item: i,
|
|
2695
2695
|
index: u,
|
|
@@ -2697,20 +2697,20 @@ const La = ({
|
|
|
2697
2697
|
onRemove: Z,
|
|
2698
2698
|
onToggleExpand: P,
|
|
2699
2699
|
onFormDataChange: k,
|
|
2700
|
-
theme: a.theme ||
|
|
2700
|
+
theme: a.theme || B,
|
|
2701
2701
|
icons: W
|
|
2702
2702
|
},
|
|
2703
2703
|
i.id
|
|
2704
2704
|
)) })
|
|
2705
2705
|
] })
|
|
2706
2706
|
] });
|
|
2707
|
-
},
|
|
2707
|
+
}, zt = (e) => {
|
|
2708
2708
|
const r = {};
|
|
2709
2709
|
return e.forEach((t) => {
|
|
2710
2710
|
const s = t.name ?? t.key;
|
|
2711
2711
|
t.defaultValue !== void 0 && s && (r[s] = t.defaultValue);
|
|
2712
2712
|
}), r;
|
|
2713
|
-
},
|
|
2713
|
+
}, _t = (e, r) => {
|
|
2714
2714
|
const t = {};
|
|
2715
2715
|
return r.forEach((s) => {
|
|
2716
2716
|
var d;
|
|
@@ -2745,7 +2745,7 @@ const La = ({
|
|
|
2745
2745
|
}
|
|
2746
2746
|
});
|
|
2747
2747
|
}), t;
|
|
2748
|
-
},
|
|
2748
|
+
}, At = (e = 5) => {
|
|
2749
2749
|
const r = [];
|
|
2750
2750
|
for (let t = 0; t < e; t++) {
|
|
2751
2751
|
const s = ["input", "select", "radio", "checkbox", "date", "number"], h = s[t % s.length];
|
|
@@ -2777,17 +2777,17 @@ const La = ({
|
|
|
2777
2777
|
});
|
|
2778
2778
|
}
|
|
2779
2779
|
return r;
|
|
2780
|
-
},
|
|
2781
|
-
function
|
|
2780
|
+
}, Bt = (e) => Object.keys(e).length === 0, Wt = (e) => Object.values(e).filter(Boolean);
|
|
2781
|
+
function ia(e) {
|
|
2782
2782
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
2783
2783
|
}
|
|
2784
|
-
var
|
|
2785
|
-
function
|
|
2786
|
-
return
|
|
2784
|
+
var sr = { exports: {} }, Za = sr.exports, Ir;
|
|
2785
|
+
function da() {
|
|
2786
|
+
return Ir || (Ir = 1, (function(e, r) {
|
|
2787
2787
|
(function(t, s) {
|
|
2788
2788
|
e.exports = s();
|
|
2789
|
-
})(
|
|
2790
|
-
var t = 1e3, s = 6e4, h = 36e5, b = "millisecond", p = "second", d = "minute", f = "hour", N = "day", M = "week", C = "month", W = "quarter", l = "year", _ = "date",
|
|
2789
|
+
})(Za, (function() {
|
|
2790
|
+
var t = 1e3, s = 6e4, h = 36e5, b = "millisecond", p = "second", d = "minute", f = "hour", N = "day", M = "week", C = "month", W = "quarter", l = "year", _ = "date", U = "Invalid Date", ae = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, te = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, a = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(S) {
|
|
2791
2791
|
var y = ["th", "st", "nd", "rd"], x = S % 100;
|
|
2792
2792
|
return "[" + S + (y[(x - 20) % 10] || y[x] || y[0]) + "]";
|
|
2793
2793
|
} }, T = function(S, y, x) {
|
|
@@ -2806,13 +2806,13 @@ function Kr() {
|
|
|
2806
2806
|
return { M: C, y: l, w: M, d: N, D: _, h: f, m: d, s: p, ms: b, Q: W }[S] || String(S || "").toLowerCase().replace(/s$/, "");
|
|
2807
2807
|
}, u: function(S) {
|
|
2808
2808
|
return S === void 0;
|
|
2809
|
-
} },
|
|
2810
|
-
A[
|
|
2811
|
-
var
|
|
2812
|
-
return S instanceof ee || !(!S || !S[
|
|
2809
|
+
} }, V = "en", A = {};
|
|
2810
|
+
A[V] = a;
|
|
2811
|
+
var E = "$isDayjsObject", j = function(S) {
|
|
2812
|
+
return S instanceof ee || !(!S || !S[E]);
|
|
2813
2813
|
}, Q = function S(y, x, D) {
|
|
2814
2814
|
var w;
|
|
2815
|
-
if (!y) return
|
|
2815
|
+
if (!y) return V;
|
|
2816
2816
|
if (typeof y == "string") {
|
|
2817
2817
|
var L = y.toLowerCase();
|
|
2818
2818
|
A[L] && (w = L), x && (A[L] = x, w = L);
|
|
@@ -2822,18 +2822,18 @@ function Kr() {
|
|
|
2822
2822
|
var Z = y.name;
|
|
2823
2823
|
A[Z] = y, w = Z;
|
|
2824
2824
|
}
|
|
2825
|
-
return !D && w && (
|
|
2825
|
+
return !D && w && (V = w), w || !D && V;
|
|
2826
2826
|
}, X = function(S, y) {
|
|
2827
|
-
if (
|
|
2827
|
+
if (j(S)) return S.clone();
|
|
2828
2828
|
var x = typeof y == "object" ? y : {};
|
|
2829
2829
|
return x.date = S, x.args = arguments, new ee(x);
|
|
2830
2830
|
}, R = v;
|
|
2831
|
-
R.l = Q, R.i =
|
|
2831
|
+
R.l = Q, R.i = j, R.w = function(S, y) {
|
|
2832
2832
|
return X(S, { locale: y.$L, utc: y.$u, x: y.$x, $offset: y.$offset });
|
|
2833
2833
|
};
|
|
2834
2834
|
var ee = (function() {
|
|
2835
2835
|
function S(x) {
|
|
2836
|
-
this.$L = Q(x.locale, null, !0), this.parse(x), this.$x = this.$x || x.x || {}, this[
|
|
2836
|
+
this.$L = Q(x.locale, null, !0), this.parse(x), this.$x = this.$x || x.x || {}, this[E] = !0;
|
|
2837
2837
|
}
|
|
2838
2838
|
var y = S.prototype;
|
|
2839
2839
|
return y.parse = function(x) {
|
|
@@ -2843,7 +2843,7 @@ function Kr() {
|
|
|
2843
2843
|
if (R.u(w)) return /* @__PURE__ */ new Date();
|
|
2844
2844
|
if (w instanceof Date) return new Date(w);
|
|
2845
2845
|
if (typeof w == "string" && !/Z$/i.test(w)) {
|
|
2846
|
-
var q = w.match(
|
|
2846
|
+
var q = w.match(ae);
|
|
2847
2847
|
if (q) {
|
|
2848
2848
|
var Z = q[2] - 1 || 0, P = (q[7] || "0").substring(0, 3);
|
|
2849
2849
|
return L ? new Date(Date.UTC(q[1], Z, q[3] || 1, q[4] || 0, q[5] || 0, q[6] || 0, P)) : new Date(q[1], Z, q[3] || 1, q[4] || 0, q[5] || 0, q[6] || 0, P);
|
|
@@ -2857,7 +2857,7 @@ function Kr() {
|
|
|
2857
2857
|
}, y.$utils = function() {
|
|
2858
2858
|
return R;
|
|
2859
2859
|
}, y.isValid = function() {
|
|
2860
|
-
return this.$d.toString() !==
|
|
2860
|
+
return this.$d.toString() !== U;
|
|
2861
2861
|
}, y.isSame = function(x, D) {
|
|
2862
2862
|
var w = X(x);
|
|
2863
2863
|
return this.startOf(D) <= w && w <= this.endOf(D);
|
|
@@ -2877,15 +2877,15 @@ function Kr() {
|
|
|
2877
2877
|
return L ? F : F.endOf(N);
|
|
2878
2878
|
}, P = function(n, z) {
|
|
2879
2879
|
return R.w(w.toDate()[n].apply(w.toDate("s"), (L ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(z)), w);
|
|
2880
|
-
}, k = this.$W,
|
|
2880
|
+
}, k = this.$W, H = this.$M, Y = this.$D, i = "set" + (this.$u ? "UTC" : "");
|
|
2881
2881
|
switch (q) {
|
|
2882
2882
|
case l:
|
|
2883
2883
|
return L ? Z(1, 0) : Z(31, 11);
|
|
2884
2884
|
case C:
|
|
2885
|
-
return L ? Z(1,
|
|
2885
|
+
return L ? Z(1, H) : Z(0, H + 1);
|
|
2886
2886
|
case M:
|
|
2887
2887
|
var u = this.$locale().weekStart || 0, c = (k < u ? k + 7 : k) - u;
|
|
2888
|
-
return Z(L ? Y - c : Y + (6 - c),
|
|
2888
|
+
return Z(L ? Y - c : Y + (6 - c), H);
|
|
2889
2889
|
case N:
|
|
2890
2890
|
case _:
|
|
2891
2891
|
return P(i + "Hours", 0);
|
|
@@ -2914,9 +2914,9 @@ function Kr() {
|
|
|
2914
2914
|
}, y.add = function(x, D) {
|
|
2915
2915
|
var w, L = this;
|
|
2916
2916
|
x = Number(x);
|
|
2917
|
-
var q = R.p(D), Z = function(
|
|
2917
|
+
var q = R.p(D), Z = function(H) {
|
|
2918
2918
|
var Y = X(L);
|
|
2919
|
-
return R.w(Y.date(Y.date() + Math.round(
|
|
2919
|
+
return R.w(Y.date(Y.date() + Math.round(H * x)), L);
|
|
2920
2920
|
};
|
|
2921
2921
|
if (q === C) return this.set(C, this.$M + x);
|
|
2922
2922
|
if (q === l) return this.set(l, this.$y + x);
|
|
@@ -2928,8 +2928,8 @@ function Kr() {
|
|
|
2928
2928
|
return this.add(-1 * x, D);
|
|
2929
2929
|
}, y.format = function(x) {
|
|
2930
2930
|
var D = this, w = this.$locale();
|
|
2931
|
-
if (!this.isValid()) return w.invalidDate ||
|
|
2932
|
-
var L = x || "YYYY-MM-DDTHH:mm:ssZ", q = R.z(this), Z = this.$H, P = this.$m, k = this.$M,
|
|
2931
|
+
if (!this.isValid()) return w.invalidDate || U;
|
|
2932
|
+
var L = x || "YYYY-MM-DDTHH:mm:ssZ", q = R.z(this), Z = this.$H, P = this.$m, k = this.$M, H = w.weekdays, Y = w.months, i = w.meridiem, u = function(z, F, m, g) {
|
|
2933
2933
|
return z && (z[F] || z(D, L)) || m[F].slice(0, g);
|
|
2934
2934
|
}, c = function(z) {
|
|
2935
2935
|
return R.s(Z % 12 || 12, z, "0");
|
|
@@ -2937,7 +2937,7 @@ function Kr() {
|
|
|
2937
2937
|
var g = z < 12 ? "AM" : "PM";
|
|
2938
2938
|
return m ? g.toLowerCase() : g;
|
|
2939
2939
|
};
|
|
2940
|
-
return L.replace(
|
|
2940
|
+
return L.replace(te, (function(z, F) {
|
|
2941
2941
|
return F || (function(m) {
|
|
2942
2942
|
switch (m) {
|
|
2943
2943
|
case "YY":
|
|
@@ -2959,11 +2959,11 @@ function Kr() {
|
|
|
2959
2959
|
case "d":
|
|
2960
2960
|
return String(D.$W);
|
|
2961
2961
|
case "dd":
|
|
2962
|
-
return u(w.weekdaysMin, D.$W,
|
|
2962
|
+
return u(w.weekdaysMin, D.$W, H, 2);
|
|
2963
2963
|
case "ddd":
|
|
2964
|
-
return u(w.weekdaysShort, D.$W,
|
|
2964
|
+
return u(w.weekdaysShort, D.$W, H, 3);
|
|
2965
2965
|
case "dddd":
|
|
2966
|
-
return
|
|
2966
|
+
return H[D.$W];
|
|
2967
2967
|
case "H":
|
|
2968
2968
|
return String(Z);
|
|
2969
2969
|
case "HH":
|
|
@@ -2995,7 +2995,7 @@ function Kr() {
|
|
|
2995
2995
|
}, y.utcOffset = function() {
|
|
2996
2996
|
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
2997
2997
|
}, y.diff = function(x, D, w) {
|
|
2998
|
-
var L, q = this, Z = R.p(D), P = X(x), k = (P.utcOffset() - this.utcOffset()) * s,
|
|
2998
|
+
var L, q = this, Z = R.p(D), P = X(x), k = (P.utcOffset() - this.utcOffset()) * s, H = this - P, Y = function() {
|
|
2999
2999
|
return R.m(q, P);
|
|
3000
3000
|
};
|
|
3001
3001
|
switch (Z) {
|
|
@@ -3009,22 +3009,22 @@ function Kr() {
|
|
|
3009
3009
|
L = Y() / 3;
|
|
3010
3010
|
break;
|
|
3011
3011
|
case M:
|
|
3012
|
-
L = (
|
|
3012
|
+
L = (H - k) / 6048e5;
|
|
3013
3013
|
break;
|
|
3014
3014
|
case N:
|
|
3015
|
-
L = (
|
|
3015
|
+
L = (H - k) / 864e5;
|
|
3016
3016
|
break;
|
|
3017
3017
|
case f:
|
|
3018
|
-
L =
|
|
3018
|
+
L = H / h;
|
|
3019
3019
|
break;
|
|
3020
3020
|
case d:
|
|
3021
|
-
L =
|
|
3021
|
+
L = H / s;
|
|
3022
3022
|
break;
|
|
3023
3023
|
case p:
|
|
3024
|
-
L =
|
|
3024
|
+
L = H / t;
|
|
3025
3025
|
break;
|
|
3026
3026
|
default:
|
|
3027
|
-
L =
|
|
3027
|
+
L = H;
|
|
3028
3028
|
}
|
|
3029
3029
|
return w ? L : R.a(L);
|
|
3030
3030
|
}, y.daysInMonth = function() {
|
|
@@ -3053,20 +3053,20 @@ function Kr() {
|
|
|
3053
3053
|
};
|
|
3054
3054
|
})), X.extend = function(S, y) {
|
|
3055
3055
|
return S.$i || (S(y, ee, X), S.$i = !0), X;
|
|
3056
|
-
}, X.locale = Q, X.isDayjs =
|
|
3056
|
+
}, X.locale = Q, X.isDayjs = j, X.unix = function(S) {
|
|
3057
3057
|
return X(1e3 * S);
|
|
3058
|
-
}, X.en = A[
|
|
3058
|
+
}, X.en = A[V], X.Ls = A, X.p = {}, X;
|
|
3059
3059
|
}));
|
|
3060
|
-
})(
|
|
3060
|
+
})(sr)), sr.exports;
|
|
3061
3061
|
}
|
|
3062
|
-
var
|
|
3063
|
-
const
|
|
3064
|
-
var
|
|
3065
|
-
function
|
|
3066
|
-
return
|
|
3062
|
+
var Qa = da();
|
|
3063
|
+
const ur = /* @__PURE__ */ ia(Qa);
|
|
3064
|
+
var lr = { exports: {} }, et = lr.exports, Ur;
|
|
3065
|
+
function rt() {
|
|
3066
|
+
return Ur || (Ur = 1, (function(e, r) {
|
|
3067
3067
|
(function(t, s) {
|
|
3068
3068
|
e.exports = s();
|
|
3069
|
-
})(
|
|
3069
|
+
})(et, (function() {
|
|
3070
3070
|
return function(t, s, h) {
|
|
3071
3071
|
t = t || {};
|
|
3072
3072
|
var b = s.prototype, p = { future: "in %s", past: "%s ago", s: "a few seconds", m: "a minute", mm: "%d minutes", h: "an hour", hh: "%d hours", d: "a day", dd: "%d days", M: "a month", MM: "%d months", y: "a year", yy: "%d years" };
|
|
@@ -3074,20 +3074,20 @@ function Ya() {
|
|
|
3074
3074
|
return b.fromToBase(N, M, C, W);
|
|
3075
3075
|
}
|
|
3076
3076
|
h.en.relativeTime = p, b.fromToBase = function(N, M, C, W, l) {
|
|
3077
|
-
for (var _,
|
|
3078
|
-
var
|
|
3079
|
-
|
|
3077
|
+
for (var _, U, ae, te = C.$locale().relativeTime || p, a = t.thresholds || [{ l: "s", r: 44, d: "second" }, { l: "m", r: 89 }, { l: "mm", r: 44, d: "minute" }, { l: "h", r: 89 }, { l: "hh", r: 21, d: "hour" }, { l: "d", r: 35 }, { l: "dd", r: 25, d: "day" }, { l: "M", r: 45 }, { l: "MM", r: 10, d: "month" }, { l: "y", r: 17 }, { l: "yy", d: "year" }], T = a.length, v = 0; v < T; v += 1) {
|
|
3078
|
+
var V = a[v];
|
|
3079
|
+
V.d && (_ = W ? h(N).diff(C, V.d, !0) : C.diff(N, V.d, !0));
|
|
3080
3080
|
var A = (t.rounding || Math.round)(Math.abs(_));
|
|
3081
|
-
if (
|
|
3082
|
-
A <= 1 && v > 0 && (
|
|
3083
|
-
var
|
|
3084
|
-
l && (A = l("" + A)),
|
|
3081
|
+
if (ae = _ > 0, A <= V.r || !V.r) {
|
|
3082
|
+
A <= 1 && v > 0 && (V = a[v - 1]);
|
|
3083
|
+
var E = te[V.l];
|
|
3084
|
+
l && (A = l("" + A)), U = typeof E == "string" ? E.replace("%d", A) : E(A, M, V.l, ae);
|
|
3085
3085
|
break;
|
|
3086
3086
|
}
|
|
3087
3087
|
}
|
|
3088
|
-
if (M) return
|
|
3089
|
-
var
|
|
3090
|
-
return typeof
|
|
3088
|
+
if (M) return U;
|
|
3089
|
+
var j = ae ? te.future : te.past;
|
|
3090
|
+
return typeof j == "function" ? j(U) : j.replace("%s", U);
|
|
3091
3091
|
}, b.to = function(N, M) {
|
|
3092
3092
|
return d(N, M, this, !0);
|
|
3093
3093
|
}, b.from = function(N, M) {
|
|
@@ -3103,16 +3103,16 @@ function Ya() {
|
|
|
3103
3103
|
};
|
|
3104
3104
|
};
|
|
3105
3105
|
}));
|
|
3106
|
-
})(
|
|
3106
|
+
})(lr)), lr.exports;
|
|
3107
3107
|
}
|
|
3108
|
-
var
|
|
3109
|
-
const
|
|
3110
|
-
var
|
|
3111
|
-
function
|
|
3112
|
-
return
|
|
3108
|
+
var at = rt();
|
|
3109
|
+
const tt = /* @__PURE__ */ ia(at);
|
|
3110
|
+
var ir = { exports: {} }, nt = ir.exports, Vr;
|
|
3111
|
+
function ot() {
|
|
3112
|
+
return Vr || (Vr = 1, (function(e, r) {
|
|
3113
3113
|
(function(t, s) {
|
|
3114
|
-
e.exports = s(
|
|
3115
|
-
})(
|
|
3114
|
+
e.exports = s(da());
|
|
3115
|
+
})(nt, (function(t) {
|
|
3116
3116
|
function s(p) {
|
|
3117
3117
|
return p && typeof p == "object" && "default" in p ? p : { default: p };
|
|
3118
3118
|
}
|
|
@@ -3124,12 +3124,12 @@ function Va() {
|
|
|
3124
3124
|
} };
|
|
3125
3125
|
return h.default.locale(b, null, !0), b;
|
|
3126
3126
|
}));
|
|
3127
|
-
})(
|
|
3127
|
+
})(ir)), ir.exports;
|
|
3128
3128
|
}
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
const
|
|
3129
|
+
ot();
|
|
3130
|
+
ur.locale("zh-cn");
|
|
3131
|
+
ur.extend(tt);
|
|
3132
|
+
const Er = {
|
|
3133
3133
|
success: "green",
|
|
3134
3134
|
error: "red",
|
|
3135
3135
|
warning: "orange",
|
|
@@ -3137,18 +3137,18 @@ const _r = {
|
|
|
3137
3137
|
info: "cyan",
|
|
3138
3138
|
default: "default"
|
|
3139
3139
|
};
|
|
3140
|
-
function
|
|
3140
|
+
function st(e) {
|
|
3141
3141
|
if (!e) return "-";
|
|
3142
|
-
const r =
|
|
3142
|
+
const r = ur(e), t = r.format("YYYY年M月D日 HH:mm"), s = r.fromNow();
|
|
3143
3143
|
return /* @__PURE__ */ o(
|
|
3144
|
-
|
|
3144
|
+
cr,
|
|
3145
3145
|
{
|
|
3146
3146
|
title: /* @__PURE__ */ o("div", { style: { minWidth: 120 }, children: /* @__PURE__ */ o("div", { style: { color: "#aaa", fontSize: 12, marginTop: 2 }, children: s }) }),
|
|
3147
3147
|
children: /* @__PURE__ */ o("span", { style: { fontWeight: 500, opacity: 0.6 }, children: t })
|
|
3148
3148
|
}
|
|
3149
3149
|
);
|
|
3150
3150
|
}
|
|
3151
|
-
function
|
|
3151
|
+
function lt(e, r) {
|
|
3152
3152
|
if (e == null || e === "") return "-";
|
|
3153
3153
|
const t = Number(e);
|
|
3154
3154
|
if (isNaN(t)) return e;
|
|
@@ -3164,7 +3164,7 @@ function Ja(e, r) {
|
|
|
3164
3164
|
return t.toLocaleString(void 0, { minimumFractionDigits: 2, maximumFractionDigits: 2 });
|
|
3165
3165
|
}
|
|
3166
3166
|
}
|
|
3167
|
-
function
|
|
3167
|
+
function it(e, r, t = {}) {
|
|
3168
3168
|
const { eventsEmit: s } = r || {};
|
|
3169
3169
|
return me.useMemo(
|
|
3170
3170
|
() => e.map((h) => {
|
|
@@ -3174,10 +3174,10 @@ function Ga(e, r, t = {}) {
|
|
|
3174
3174
|
return {
|
|
3175
3175
|
...h,
|
|
3176
3176
|
render: (b, p, d) => {
|
|
3177
|
-
var
|
|
3177
|
+
var te, a;
|
|
3178
3178
|
const f = d == null ? void 0 : d.value;
|
|
3179
3179
|
let M = f && typeof f == "object" && (f.component || f.Comp) ? f.component || f.Comp : h.component;
|
|
3180
|
-
if (typeof M == "string" && (M = ((
|
|
3180
|
+
if (typeof M == "string" && (M = ((te = r == null ? void 0 : r.customizeComponents) == null ? void 0 : te[M]) || ((a = t == null ? void 0 : t.customizeComponents) == null ? void 0 : a[M])), !M)
|
|
3181
3181
|
return h.fallback ?? null;
|
|
3182
3182
|
const C = f && typeof f == "object" && "data" in f ? f.data : d == null ? void 0 : d.value, W = typeof h.componentProps == "function" ? h.componentProps({ value: C, row: p, cell: d, col: h }) : h.componentProps || {}, l = f && typeof f == "object" && "props" in f ? f.props || {} : {};
|
|
3183
3183
|
let _ = {};
|
|
@@ -3187,24 +3187,24 @@ function Ga(e, r, t = {}) {
|
|
|
3187
3187
|
T.has(v) || (_[v] = f[v]);
|
|
3188
3188
|
});
|
|
3189
3189
|
}
|
|
3190
|
-
const
|
|
3190
|
+
const ae = {
|
|
3191
3191
|
value: C,
|
|
3192
3192
|
row: p,
|
|
3193
3193
|
cell: d,
|
|
3194
3194
|
col: h,
|
|
3195
3195
|
emit: (T, v) => {
|
|
3196
|
-
var
|
|
3197
|
-
return (
|
|
3196
|
+
var V;
|
|
3197
|
+
return (V = r == null ? void 0 : r.eventsEmit) == null ? void 0 : V.call(r, T, { row: p, cell: d, col: h, data: v });
|
|
3198
3198
|
},
|
|
3199
3199
|
...W,
|
|
3200
3200
|
..._,
|
|
3201
3201
|
...l
|
|
3202
3202
|
};
|
|
3203
3203
|
if (me.isValidElement(M))
|
|
3204
|
-
return me.cloneElement(M,
|
|
3204
|
+
return me.cloneElement(M, ae);
|
|
3205
3205
|
if (typeof M == "function") {
|
|
3206
3206
|
const T = M;
|
|
3207
|
-
return me.createElement(T,
|
|
3207
|
+
return me.createElement(T, ae);
|
|
3208
3208
|
}
|
|
3209
3209
|
return h.fallback ?? null;
|
|
3210
3210
|
}
|
|
@@ -3213,14 +3213,14 @@ function Ga(e, r, t = {}) {
|
|
|
3213
3213
|
return {
|
|
3214
3214
|
...h,
|
|
3215
3215
|
render: (b, p, d) => {
|
|
3216
|
-
const f = (d == null ? void 0 : d.statusType) || "default", N =
|
|
3217
|
-
return /* @__PURE__ */ o(
|
|
3216
|
+
const f = (d == null ? void 0 : d.statusType) || "default", N = Er[f] || Er.default;
|
|
3217
|
+
return /* @__PURE__ */ o($a, { color: N, children: b });
|
|
3218
3218
|
}
|
|
3219
3219
|
};
|
|
3220
3220
|
case "date":
|
|
3221
3221
|
return {
|
|
3222
3222
|
...h,
|
|
3223
|
-
render: (b) =>
|
|
3223
|
+
render: (b) => st(b)
|
|
3224
3224
|
};
|
|
3225
3225
|
case "number":
|
|
3226
3226
|
return {
|
|
@@ -3238,7 +3238,7 @@ function Ga(e, r, t = {}) {
|
|
|
3238
3238
|
fontVariantNumeric: "tabular-nums",
|
|
3239
3239
|
fontFamily: "Consolas, Menlo, monospace"
|
|
3240
3240
|
},
|
|
3241
|
-
children:
|
|
3241
|
+
children: lt(b, p)
|
|
3242
3242
|
}
|
|
3243
3243
|
);
|
|
3244
3244
|
}
|
|
@@ -3339,7 +3339,7 @@ function Ga(e, r, t = {}) {
|
|
|
3339
3339
|
} : C);
|
|
3340
3340
|
if (M.length >= 3) {
|
|
3341
3341
|
const C = M.slice(0, 2), W = M.slice(2);
|
|
3342
|
-
return /* @__PURE__ */
|
|
3342
|
+
return /* @__PURE__ */ O(
|
|
3343
3343
|
"div",
|
|
3344
3344
|
{
|
|
3345
3345
|
style: {
|
|
@@ -3350,7 +3350,7 @@ function Ga(e, r, t = {}) {
|
|
|
3350
3350
|
},
|
|
3351
3351
|
children: [
|
|
3352
3352
|
C.map((l, _) => /* @__PURE__ */ o(
|
|
3353
|
-
|
|
3353
|
+
er,
|
|
3354
3354
|
{
|
|
3355
3355
|
mode: l.mode || "text",
|
|
3356
3356
|
label: l.label || l.value || "",
|
|
@@ -3363,7 +3363,7 @@ function Ga(e, r, t = {}) {
|
|
|
3363
3363
|
_
|
|
3364
3364
|
)),
|
|
3365
3365
|
/* @__PURE__ */ o(
|
|
3366
|
-
|
|
3366
|
+
va,
|
|
3367
3367
|
{
|
|
3368
3368
|
actions: W.map((l, _) => ({
|
|
3369
3369
|
key: l.value || String(_),
|
|
@@ -3372,7 +3372,7 @@ function Ga(e, r, t = {}) {
|
|
|
3372
3372
|
disabled: l.disabled || f && l.value === "delete"
|
|
3373
3373
|
})),
|
|
3374
3374
|
onAction: (l) => {
|
|
3375
|
-
const _ = W.find((
|
|
3375
|
+
const _ = W.find((U) => (U.value || String(U.key)) === l);
|
|
3376
3376
|
_ && !_.disabled && !(f && _.value === "delete") && (s == null || s(`table_action_${_.value}`, p));
|
|
3377
3377
|
}
|
|
3378
3378
|
}
|
|
@@ -3382,7 +3382,7 @@ function Ga(e, r, t = {}) {
|
|
|
3382
3382
|
);
|
|
3383
3383
|
} else
|
|
3384
3384
|
return /* @__PURE__ */ o("div", { style: { display: "flex", gap: 4, justifyContent: "center" }, children: M.map((C, W) => /* @__PURE__ */ o(
|
|
3385
|
-
|
|
3385
|
+
er,
|
|
3386
3386
|
{
|
|
3387
3387
|
mode: C.mode || "text",
|
|
3388
3388
|
label: C.label || C.value || "",
|
|
@@ -3397,7 +3397,7 @@ function Ga(e, r, t = {}) {
|
|
|
3397
3397
|
}
|
|
3398
3398
|
const N = d || {};
|
|
3399
3399
|
return /* @__PURE__ */ o(
|
|
3400
|
-
|
|
3400
|
+
er,
|
|
3401
3401
|
{
|
|
3402
3402
|
mode: N.mode || "text",
|
|
3403
3403
|
label: N.label || N.value || "",
|
|
@@ -3425,7 +3425,7 @@ function Ga(e, r, t = {}) {
|
|
|
3425
3425
|
2: "text-lg font-semibold",
|
|
3426
3426
|
3: "text-base font-medium"
|
|
3427
3427
|
}, M = N[f] || N[1];
|
|
3428
|
-
return /* @__PURE__ */
|
|
3428
|
+
return /* @__PURE__ */ O(
|
|
3429
3429
|
"div",
|
|
3430
3430
|
{
|
|
3431
3431
|
className: `${M} text-gray-800 ${(d == null ? void 0 : d.className) || ""}`,
|
|
@@ -3475,11 +3475,11 @@ function Ga(e, r, t = {}) {
|
|
|
3475
3475
|
]
|
|
3476
3476
|
);
|
|
3477
3477
|
}
|
|
3478
|
-
function
|
|
3479
|
-
return /* @__PURE__ */
|
|
3478
|
+
function dt(e) {
|
|
3479
|
+
return /* @__PURE__ */ O("div", { className: "flex items-center gap-2", children: [
|
|
3480
3480
|
/* @__PURE__ */ o("span", { className: "font-medium text-gray-800 text-sm", children: e.title }),
|
|
3481
|
-
e.helpText && /* @__PURE__ */ o(
|
|
3482
|
-
|
|
3481
|
+
e.helpText && /* @__PURE__ */ o(cr, { title: e.helpText, placement: "top", children: /* @__PURE__ */ o(
|
|
3482
|
+
oa,
|
|
3483
3483
|
{
|
|
3484
3484
|
className: "text-gray-400 hover:text-gray-600 cursor-help transition-colors",
|
|
3485
3485
|
size: 14
|
|
@@ -3487,11 +3487,12 @@ function Ka(e) {
|
|
|
3487
3487
|
) })
|
|
3488
3488
|
] });
|
|
3489
3489
|
}
|
|
3490
|
-
const
|
|
3490
|
+
const ct = J.div.attrs({
|
|
3491
|
+
className: "dynamic-table-wrapper"
|
|
3492
|
+
})`
|
|
3491
3493
|
background: ${({ theme: e }) => e.colors.tableBackground || e.colors.background};
|
|
3492
3494
|
border-radius: ${({ theme: e }) => e.space.radius};
|
|
3493
|
-
|
|
3494
|
-
padding: ${({ theme: e }) => e.space.padding};
|
|
3495
|
+
|
|
3495
3496
|
overflow-x: auto;
|
|
3496
3497
|
width: 100%;
|
|
3497
3498
|
max-width: 100%;
|
|
@@ -3499,8 +3500,10 @@ const Pa = J.div`
|
|
|
3499
3500
|
min-height: 240px;
|
|
3500
3501
|
display: flex;
|
|
3501
3502
|
flex-direction: column;
|
|
3502
|
-
`,
|
|
3503
|
-
|
|
3503
|
+
`, ut = J.div.attrs({
|
|
3504
|
+
className: "dynamic-table-sub-wrapper"
|
|
3505
|
+
})`
|
|
3506
|
+
background: ${({ theme: e }) => e.colors.subTableBackground || e.colors.tableBackground || e.colors.background};
|
|
3504
3507
|
border-radius: ${({ theme: e }) => e.space.radius};
|
|
3505
3508
|
padding: ${({ theme: e }) => e.space.padding};
|
|
3506
3509
|
width: 100%;
|
|
@@ -3509,14 +3512,16 @@ const Pa = J.div`
|
|
|
3509
3512
|
display: flex;
|
|
3510
3513
|
flex-direction: column;
|
|
3511
3514
|
overflow: visible; // 子table不产生滚动条,由外层容器处理
|
|
3512
|
-
`,
|
|
3515
|
+
`, ht = J.div.attrs({
|
|
3516
|
+
className: "dynamic-table-sub-scroll-container"
|
|
3517
|
+
})`
|
|
3513
3518
|
overflow-x: auto;
|
|
3514
3519
|
overflow-y: hidden;
|
|
3515
3520
|
width: 100%;
|
|
3516
3521
|
max-width: 100%;
|
|
3517
|
-
|
|
3522
|
+
|
|
3518
3523
|
border-radius: ${({ theme: e }) => e.space.radius};
|
|
3519
|
-
background: ${({ theme: e }) => e.colors.tableBackground || e.colors.background};
|
|
3524
|
+
background: ${({ theme: e }) => e.colors.subTableBackground || e.colors.tableBackground || e.colors.background};
|
|
3520
3525
|
position: relative; // 为sticky列提供定位上下文
|
|
3521
3526
|
isolation: isolate; // 创建新的层叠上下文
|
|
3522
3527
|
height: auto; // 确保容器高度自适应内容
|
|
@@ -3547,7 +3552,7 @@ const Pa = J.div`
|
|
|
3547
3552
|
&::-webkit-scrollbar-thumb:hover {
|
|
3548
3553
|
background: ${({ theme: e }) => e.colors.disabled};
|
|
3549
3554
|
}
|
|
3550
|
-
`,
|
|
3555
|
+
`, Jr = (e) => {
|
|
3551
3556
|
switch (e) {
|
|
3552
3557
|
case "avatar":
|
|
3553
3558
|
return { minWidth: 48, textAlign: "center" };
|
|
@@ -3577,8 +3582,10 @@ const Pa = J.div`
|
|
|
3577
3582
|
default:
|
|
3578
3583
|
return { minWidth: 80, textAlign: "left" };
|
|
3579
3584
|
}
|
|
3580
|
-
},
|
|
3581
|
-
|
|
3585
|
+
}, Gr = J.th.attrs({
|
|
3586
|
+
className: "dynamic-table-th"
|
|
3587
|
+
})`
|
|
3588
|
+
background: ${({ theme: e }) => e.colors.tableHeaderBg || e.colors.disabledBackground};
|
|
3582
3589
|
color: ${({ theme: e }) => e.colors.tableHeaderText || e.colors.text};
|
|
3583
3590
|
font-weight: 600;
|
|
3584
3591
|
font-size: 13px;
|
|
@@ -3587,13 +3594,9 @@ const Pa = J.div`
|
|
|
3587
3594
|
min-width: 48px;
|
|
3588
3595
|
white-space: nowrap;
|
|
3589
3596
|
/* 移除默认的 text-align: center,让每列使用自己的对齐方式 */
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
&:last-child {
|
|
3594
|
-
background: ${({ theme: e }) => e.colors.tableLastColumnBg || e.colors.disabledBackground};
|
|
3595
|
-
}
|
|
3596
|
-
`, Rr = J.td`
|
|
3597
|
+
`, Kr = J.td.attrs({
|
|
3598
|
+
className: "dynamic-table-td"
|
|
3599
|
+
})`
|
|
3597
3600
|
padding: 0.5rem 0.75rem;
|
|
3598
3601
|
border-bottom: 1px solid ${({ theme: e }) => e.colors.border};
|
|
3599
3602
|
color: ${({ theme: e }) => e.colors.text};
|
|
@@ -3602,14 +3605,22 @@ const Pa = J.div`
|
|
|
3602
3605
|
white-space: nowrap;
|
|
3603
3606
|
overflow: hidden;
|
|
3604
3607
|
text-overflow: ellipsis;
|
|
3605
|
-
background: ${({ theme: e }) => e.colors.tableBackground ||
|
|
3606
|
-
|
|
3608
|
+
background: ${({ theme: e }) => e.colors.tableBackground || e.colors.background};
|
|
3609
|
+
&:first-child {
|
|
3610
|
+
background: ${({ theme: e }) => e.colors.tableFirstColumnBg || e.colors.tableBackground || e.colors.background};
|
|
3611
|
+
}
|
|
3612
|
+
&:last-child {
|
|
3613
|
+
background: ${({ theme: e }) => e.colors.tableLastColumnBg || e.colors.tableBackground || e.colors.background};
|
|
3614
|
+
}
|
|
3615
|
+
`, pt = J.tr.attrs({
|
|
3616
|
+
className: "dynamic-table-tr"
|
|
3617
|
+
})`
|
|
3607
3618
|
&:hover {
|
|
3608
3619
|
background: ${({ theme: e }) => e.colors.disabledBackground};
|
|
3609
3620
|
}
|
|
3610
|
-
`,
|
|
3611
|
-
(e, r) => /* @__PURE__ */ o(
|
|
3612
|
-
),
|
|
3621
|
+
`, ft = me.forwardRef(
|
|
3622
|
+
(e, r) => /* @__PURE__ */ o(pt, { ...e, ref: r })
|
|
3623
|
+
), mt = `
|
|
3613
3624
|
.sticky-shadow-left {
|
|
3614
3625
|
box-shadow: 4px 0 8px -4px rgba(0,0,0,0.08);
|
|
3615
3626
|
transition: box-shadow 0.2s;
|
|
@@ -3621,24 +3632,24 @@ const Pa = J.div`
|
|
|
3621
3632
|
`;
|
|
3622
3633
|
if (typeof window < "u" && !document.getElementById("dynamic-table-sticky-shadow")) {
|
|
3623
3634
|
const e = document.createElement("style");
|
|
3624
|
-
e.id = "dynamic-table-sticky-shadow", e.innerHTML =
|
|
3635
|
+
e.id = "dynamic-table-sticky-shadow", e.innerHTML = mt, document.head.appendChild(e);
|
|
3625
3636
|
}
|
|
3626
|
-
const
|
|
3627
|
-
var F, m, g, re,
|
|
3628
|
-
const r = e.dataSource || [], t = e.columns || [], s = e.size || "md", h = e.level || 0, b =
|
|
3637
|
+
const bt = me.memo((e) => {
|
|
3638
|
+
var F, m, g, re, ye, De, ze, _e, Ae, Be, We, Re, qe, Le, Oe, je, He, Ye, Ie, Ue, Ve, Ee, Je, Ge, Ke, Pe, pe, Ce, rr;
|
|
3639
|
+
const r = e.dataSource || [], t = e.columns || [], s = e.size || "md", h = e.level || 0, b = Fe(), p = $e(
|
|
3629
3640
|
// 基础:默认主题 + useTheme的配置
|
|
3630
|
-
|
|
3641
|
+
$e({ theme: B, mode: "light" }, b),
|
|
3631
3642
|
// 最高层:用户手动传入的styles
|
|
3632
3643
|
e.styles
|
|
3633
|
-
), d = ((F = p.theme) == null ? void 0 : F.colors) ||
|
|
3644
|
+
), d = ((F = p.theme) == null ? void 0 : F.colors) || B.colors, f = d.tableBackground || d.background || B.colors.background, N = d.tableFirstColumnBg || d.surfaceSubtle || f, M = d.tableLastColumnBg || d.surfaceSubtle || f, { viewId: C, total: W, requestPagesize: l = 50, viewPageSize: _ } = e, [U, ae] = ie(_);
|
|
3634
3645
|
we(() => {
|
|
3635
|
-
typeof _ == "number" && _ > 0 &&
|
|
3646
|
+
typeof _ == "number" && _ > 0 && ae(_);
|
|
3636
3647
|
}, [_]);
|
|
3637
|
-
const [
|
|
3648
|
+
const [te, a] = ie(/* @__PURE__ */ new Set());
|
|
3638
3649
|
we(() => {
|
|
3639
3650
|
a(/* @__PURE__ */ new Set());
|
|
3640
3651
|
}, [C]);
|
|
3641
|
-
const [T, v] =
|
|
3652
|
+
const [T, v] = ie(!1), [V, A] = ie(!1), [E, j] = ie(/* @__PURE__ */ new Set()), Q = Te(null), X = Te(null), [R, ee] = ie(0), G = s === "sm" ? 0.7 : 1, S = it(
|
|
3642
3653
|
t,
|
|
3643
3654
|
{
|
|
3644
3655
|
eventsEmit: e.eventsEmit,
|
|
@@ -3646,69 +3657,69 @@ const at = me.memo((e) => {
|
|
|
3646
3657
|
customizeComponents: e.customizeComponents
|
|
3647
3658
|
},
|
|
3648
3659
|
e.styles
|
|
3649
|
-
), [y, x] =
|
|
3660
|
+
), [y, x] = ie([]), D = he(
|
|
3650
3661
|
($, ne) => {
|
|
3651
3662
|
var de;
|
|
3652
|
-
x((
|
|
3653
|
-
let
|
|
3654
|
-
return ne ?
|
|
3663
|
+
x((ce) => {
|
|
3664
|
+
let be;
|
|
3665
|
+
return ne ? be = [...ce, $] : be = ce.filter((Ne) => Ne !== $), be;
|
|
3655
3666
|
});
|
|
3656
|
-
const
|
|
3667
|
+
const se = ne ? [...y, $] : y.filter((ce) => ce !== $), oe = r.filter((ce) => se.includes(ce.id));
|
|
3657
3668
|
(de = e.eventsEmit) == null || de.call(e, "table_row_select", {
|
|
3658
3669
|
rowId: $,
|
|
3659
3670
|
checked: ne,
|
|
3660
|
-
selectedItems:
|
|
3671
|
+
selectedItems: oe
|
|
3661
3672
|
});
|
|
3662
3673
|
},
|
|
3663
3674
|
[y, r, e.eventsEmit]
|
|
3664
3675
|
), w = Se(
|
|
3665
3676
|
() => r.length > 0 && y.length === r.length,
|
|
3666
3677
|
[r.length, y.length]
|
|
3667
|
-
), L =
|
|
3678
|
+
), L = he(
|
|
3668
3679
|
($) => {
|
|
3669
|
-
var
|
|
3680
|
+
var oe;
|
|
3670
3681
|
const ne = $ ? r.map((de) => de.id) : [];
|
|
3671
3682
|
x(ne);
|
|
3672
|
-
const
|
|
3673
|
-
(
|
|
3683
|
+
const se = $ ? r : [];
|
|
3684
|
+
(oe = e.eventsEmit) == null || oe.call(e, "table_select_all", {
|
|
3674
3685
|
checked: $,
|
|
3675
|
-
selectedItems:
|
|
3686
|
+
selectedItems: se,
|
|
3676
3687
|
totalCount: r.length
|
|
3677
3688
|
});
|
|
3678
3689
|
},
|
|
3679
3690
|
[r, e.eventsEmit]
|
|
3680
|
-
), [q, Z] =
|
|
3691
|
+
), [q, Z] = ie(1), P = typeof U == "number" && U > 0 ? U : _ ?? (e.isSubTable ? 5 : 10), k = W || r.length;
|
|
3681
3692
|
Se(
|
|
3682
3693
|
() => Math.ceil(k / P),
|
|
3683
3694
|
[k, P]
|
|
3684
3695
|
);
|
|
3685
|
-
const
|
|
3696
|
+
const H = Se(() => {
|
|
3686
3697
|
if (e.viewBehavior !== "pagination") return r;
|
|
3687
3698
|
const $ = (q - 1) * P, ne = $ + P;
|
|
3688
|
-
if (r.some((
|
|
3689
|
-
const
|
|
3699
|
+
if (r.some((oe) => typeof oe.__absIndex == "number")) {
|
|
3700
|
+
const oe = [];
|
|
3690
3701
|
for (let de = $; de < ne; de++) {
|
|
3691
|
-
const
|
|
3692
|
-
|
|
3702
|
+
const ce = r.find((be) => be.__absIndex === de);
|
|
3703
|
+
ce && oe.push(ce);
|
|
3693
3704
|
}
|
|
3694
|
-
return
|
|
3705
|
+
return oe;
|
|
3695
3706
|
}
|
|
3696
3707
|
return r.slice($, ne);
|
|
3697
|
-
}, [e.viewBehavior, r, q, P]), Y =
|
|
3708
|
+
}, [e.viewBehavior, r, q, P]), Y = he(
|
|
3698
3709
|
($) => {
|
|
3699
3710
|
var ne;
|
|
3700
3711
|
if (Z($), W && l && C) {
|
|
3701
|
-
const
|
|
3702
|
-
(!
|
|
3703
|
-
const
|
|
3704
|
-
return
|
|
3712
|
+
const se = ($ - 1) * P, oe = Math.floor(se / l) + 1;
|
|
3713
|
+
(!te.has(oe) || se >= r.length) && (a((ce) => {
|
|
3714
|
+
const be = new Set(ce);
|
|
3715
|
+
return be.add(oe), be;
|
|
3705
3716
|
}), (ne = e.eventsEmit) == null || ne.call(
|
|
3706
3717
|
e,
|
|
3707
3718
|
"pagination:request_merge_data",
|
|
3708
3719
|
{
|
|
3709
3720
|
viewId: C,
|
|
3710
3721
|
request: {
|
|
3711
|
-
pageNo:
|
|
3722
|
+
pageNo: oe,
|
|
3712
3723
|
pageSize: l
|
|
3713
3724
|
}
|
|
3714
3725
|
},
|
|
@@ -3716,22 +3727,22 @@ const at = me.memo((e) => {
|
|
|
3716
3727
|
));
|
|
3717
3728
|
}
|
|
3718
3729
|
},
|
|
3719
|
-
[W, l, C, P, r.length, e.eventsEmit,
|
|
3720
|
-
), i =
|
|
3721
|
-
|
|
3722
|
-
const
|
|
3723
|
-
return
|
|
3724
|
-
var
|
|
3730
|
+
[W, l, C, P, r.length, e.eventsEmit, te]
|
|
3731
|
+
), i = he(($) => {
|
|
3732
|
+
j((ne) => {
|
|
3733
|
+
const se = new Set(ne);
|
|
3734
|
+
return se.has($) ? se.delete($) : (se.add($), setTimeout(() => {
|
|
3735
|
+
var oe, de;
|
|
3725
3736
|
(de = e.eventsEmit) == null || de.call(e, "table_expand", {
|
|
3726
3737
|
tableId: $,
|
|
3727
|
-
children: ((
|
|
3738
|
+
children: ((oe = r.find((ce) => ce.id === $)) == null ? void 0 : oe.children) || []
|
|
3728
3739
|
});
|
|
3729
|
-
}, 0)),
|
|
3740
|
+
}, 0)), se;
|
|
3730
3741
|
});
|
|
3731
|
-
}, [r, e.eventsEmit]), u =
|
|
3732
|
-
($) =>
|
|
3733
|
-
[
|
|
3734
|
-
), n =
|
|
3742
|
+
}, [r, e.eventsEmit]), u = he(($) => $.hasOwnProperty("children") && $.children !== void 0, []), c = he(
|
|
3743
|
+
($) => E.has($),
|
|
3744
|
+
[E]
|
|
3745
|
+
), n = he(() => {
|
|
3735
3746
|
const $ = Q.current;
|
|
3736
3747
|
$ && (e.isSubTable || (v($.scrollLeft > 0), A($.scrollLeft < $.scrollWidth - $.offsetWidth - 1)));
|
|
3737
3748
|
}, [e.isSubTable]);
|
|
@@ -3745,20 +3756,20 @@ const at = me.memo((e) => {
|
|
|
3745
3756
|
const $ = Q.current;
|
|
3746
3757
|
if (!$) return;
|
|
3747
3758
|
const ne = () => {
|
|
3748
|
-
const
|
|
3749
|
-
ee(
|
|
3759
|
+
const oe = $.getBoundingClientRect();
|
|
3760
|
+
ee(oe.width);
|
|
3750
3761
|
};
|
|
3751
3762
|
ne(), window.addEventListener("resize", ne);
|
|
3752
|
-
const
|
|
3753
|
-
return
|
|
3754
|
-
window.removeEventListener("resize", ne),
|
|
3763
|
+
const se = new ResizeObserver(ne);
|
|
3764
|
+
return se.observe($), () => {
|
|
3765
|
+
window.removeEventListener("resize", ne), se.disconnect();
|
|
3755
3766
|
};
|
|
3756
3767
|
}, []);
|
|
3757
|
-
const z = e.isSubTable ?
|
|
3758
|
-
return /* @__PURE__ */
|
|
3768
|
+
const z = e.isSubTable ? ut : ct;
|
|
3769
|
+
return /* @__PURE__ */ O(
|
|
3759
3770
|
z,
|
|
3760
3771
|
{
|
|
3761
|
-
theme: p.theme ||
|
|
3772
|
+
theme: p.theme || B,
|
|
3762
3773
|
className: "w-full",
|
|
3763
3774
|
style: {
|
|
3764
3775
|
transform: `scale(${G})`,
|
|
@@ -3811,7 +3822,7 @@ const at = me.memo((e) => {
|
|
|
3811
3822
|
position: "relative",
|
|
3812
3823
|
boxSizing: "border-box"
|
|
3813
3824
|
},
|
|
3814
|
-
children: /* @__PURE__ */
|
|
3825
|
+
children: /* @__PURE__ */ O(
|
|
3815
3826
|
"table",
|
|
3816
3827
|
{
|
|
3817
3828
|
ref: X,
|
|
@@ -3829,18 +3840,18 @@ const at = me.memo((e) => {
|
|
|
3829
3840
|
position: e.isSubTable ? void 0 : "sticky",
|
|
3830
3841
|
top: 0,
|
|
3831
3842
|
zIndex: 3,
|
|
3832
|
-
background: ((g = (m = p.theme) == null ? void 0 : m.colors) == null ? void 0 : g.disabledBackground) ||
|
|
3843
|
+
background: ((g = (m = p.theme) == null ? void 0 : m.colors) == null ? void 0 : g.tableHeaderBg) || ((ye = (re = p.theme) == null ? void 0 : re.colors) == null ? void 0 : ye.disabledBackground) || B.colors.disabledBackground
|
|
3833
3844
|
},
|
|
3834
|
-
children: /* @__PURE__ */
|
|
3845
|
+
children: /* @__PURE__ */ O("tr", { children: [
|
|
3835
3846
|
e.allowMultiSelect && /* @__PURE__ */ o(
|
|
3836
|
-
|
|
3847
|
+
Gr,
|
|
3837
3848
|
{
|
|
3838
|
-
theme: p.theme ||
|
|
3849
|
+
theme: p.theme || B,
|
|
3839
3850
|
style: {
|
|
3840
3851
|
position: "sticky",
|
|
3841
3852
|
left: 0,
|
|
3842
3853
|
zIndex: 3,
|
|
3843
|
-
background: ((
|
|
3854
|
+
background: ((ze = (De = p.theme) == null ? void 0 : De.colors) == null ? void 0 : ze.tableHeaderBg) || ((Ae = (_e = p.theme) == null ? void 0 : _e.colors) == null ? void 0 : Ae.disabledBackground) || B.colors.disabledBackground,
|
|
3844
3855
|
width: 40,
|
|
3845
3856
|
minWidth: 40,
|
|
3846
3857
|
maxWidth: 40,
|
|
@@ -3858,31 +3869,31 @@ const at = me.memo((e) => {
|
|
|
3858
3869
|
}
|
|
3859
3870
|
),
|
|
3860
3871
|
S.map(($, ne) => {
|
|
3861
|
-
var
|
|
3862
|
-
const
|
|
3872
|
+
var be, Ne, Xe, Ze;
|
|
3873
|
+
const se = ne === 0, oe = ne === S.length - 1, de = ((Ne = (be = p.theme) == null ? void 0 : be.colors) == null ? void 0 : Ne.tableHeaderBg) || ((Ze = (Xe = p.theme) == null ? void 0 : Xe.colors) == null ? void 0 : Ze.disabledBackground) || B.colors.disabledBackground, ce = se ? {
|
|
3863
3874
|
position: "sticky",
|
|
3864
3875
|
left: e.allowMultiSelect ? 40 : 0,
|
|
3865
3876
|
zIndex: 2,
|
|
3866
|
-
background:
|
|
3867
|
-
} :
|
|
3877
|
+
background: de
|
|
3878
|
+
} : oe ? {
|
|
3868
3879
|
position: "sticky",
|
|
3869
3880
|
right: 0,
|
|
3870
3881
|
zIndex: 2,
|
|
3871
|
-
background:
|
|
3882
|
+
background: de
|
|
3872
3883
|
} : {};
|
|
3873
3884
|
return /* @__PURE__ */ o(
|
|
3874
|
-
|
|
3885
|
+
Gr,
|
|
3875
3886
|
{
|
|
3876
|
-
theme: p.theme ||
|
|
3887
|
+
theme: p.theme || B,
|
|
3877
3888
|
style: {
|
|
3878
|
-
...
|
|
3879
|
-
...
|
|
3889
|
+
...Jr($.type),
|
|
3890
|
+
...ce,
|
|
3880
3891
|
...$.maxWidth !== void 0 ? {
|
|
3881
3892
|
maxWidth: typeof $.maxWidth == "number" ? `${$.maxWidth}px` : $.maxWidth
|
|
3882
3893
|
} : {}
|
|
3883
3894
|
},
|
|
3884
|
-
className:
|
|
3885
|
-
children:
|
|
3895
|
+
className: se && T ? "sticky-shadow-left" : oe && V ? "sticky-shadow-right" : "",
|
|
3896
|
+
children: dt($)
|
|
3886
3897
|
},
|
|
3887
3898
|
$.id
|
|
3888
3899
|
);
|
|
@@ -3890,37 +3901,37 @@ const at = me.memo((e) => {
|
|
|
3890
3901
|
] })
|
|
3891
3902
|
}
|
|
3892
3903
|
),
|
|
3893
|
-
/* @__PURE__ */ o("tbody", { children:
|
|
3894
|
-
var
|
|
3895
|
-
const
|
|
3896
|
-
return /* @__PURE__ */
|
|
3897
|
-
/* @__PURE__ */
|
|
3898
|
-
|
|
3904
|
+
/* @__PURE__ */ o("tbody", { children: H.map(($, ne) => {
|
|
3905
|
+
var ce, be, Ne, Xe, Ze, hr, pr, fr, mr, br, gr, xr, yr, $r, vr, wr, kr, Sr, Nr, Cr, Mr, Tr;
|
|
3906
|
+
const se = e.rowProps ? e.rowProps($, ne) : {}, oe = u($), de = c($.id) || $.__autoExpand && oe;
|
|
3907
|
+
return /* @__PURE__ */ O(me.Fragment, { children: [
|
|
3908
|
+
/* @__PURE__ */ O(
|
|
3909
|
+
ft,
|
|
3899
3910
|
{
|
|
3900
|
-
theme: p.theme ||
|
|
3901
|
-
...
|
|
3902
|
-
className: `${
|
|
3911
|
+
theme: p.theme || B,
|
|
3912
|
+
...se,
|
|
3913
|
+
className: `${se.className || ""} ${(ce = e.addingIds) != null && ce.includes($.id) ? "adding-row" : ""} ${$.removing ? "removing-row" : ""}`,
|
|
3903
3914
|
style: {
|
|
3904
|
-
...
|
|
3915
|
+
...se.style,
|
|
3905
3916
|
...$.removing ? {
|
|
3906
3917
|
opacity: 0,
|
|
3907
3918
|
transform: "translateX(100px)",
|
|
3908
3919
|
transition: "opacity 0.3s ease, transform 0.3s ease"
|
|
3909
3920
|
} : {}
|
|
3910
3921
|
},
|
|
3911
|
-
onAnimationEnd: (
|
|
3912
|
-
var
|
|
3913
|
-
|
|
3922
|
+
onAnimationEnd: (I) => {
|
|
3923
|
+
var ue, ge;
|
|
3924
|
+
I.animationName === "row-slide-in" && ((ue = e.addingIds) != null && ue.includes($.id)) && ((ge = e.onRowAddAnimationComplete) == null || ge.call(e, $.id));
|
|
3914
3925
|
},
|
|
3915
|
-
onTransitionEnd: (
|
|
3916
|
-
var
|
|
3917
|
-
$.removing &&
|
|
3926
|
+
onTransitionEnd: (I) => {
|
|
3927
|
+
var ue;
|
|
3928
|
+
$.removing && I.propertyName === "transform" && ((ue = e.onRowAnimationComplete) == null || ue.call(e, $.id));
|
|
3918
3929
|
},
|
|
3919
3930
|
children: [
|
|
3920
3931
|
e.allowMultiSelect && /* @__PURE__ */ o(
|
|
3921
|
-
|
|
3932
|
+
Kr,
|
|
3922
3933
|
{
|
|
3923
|
-
theme: p.theme ||
|
|
3934
|
+
theme: p.theme || B,
|
|
3924
3935
|
style: {
|
|
3925
3936
|
position: "sticky",
|
|
3926
3937
|
left: 0,
|
|
@@ -3937,34 +3948,34 @@ const at = me.memo((e) => {
|
|
|
3937
3948
|
{
|
|
3938
3949
|
type: "checkbox",
|
|
3939
3950
|
checked: y.includes($.id),
|
|
3940
|
-
onChange: (
|
|
3951
|
+
onChange: (I) => D($.id, I.target.checked)
|
|
3941
3952
|
}
|
|
3942
3953
|
)
|
|
3943
3954
|
}
|
|
3944
3955
|
),
|
|
3945
|
-
S.map((
|
|
3946
|
-
var
|
|
3947
|
-
const
|
|
3956
|
+
S.map((I, ue) => {
|
|
3957
|
+
var Fr;
|
|
3958
|
+
const ge = ue === 0, Qe = ue === S.length - 1, Me = ge ? N : Qe ? M : f, ca = ge ? {
|
|
3948
3959
|
position: "sticky",
|
|
3949
3960
|
left: e.allowMultiSelect ? 40 : 0,
|
|
3950
3961
|
zIndex: 1,
|
|
3951
|
-
background:
|
|
3952
|
-
} :
|
|
3962
|
+
background: Me
|
|
3963
|
+
} : Qe ? {
|
|
3953
3964
|
position: "sticky",
|
|
3954
3965
|
right: 0,
|
|
3955
3966
|
zIndex: 1,
|
|
3956
|
-
background:
|
|
3957
|
-
} : {},
|
|
3967
|
+
background: Me
|
|
3968
|
+
} : {}, xe = ((Fr = $.data) == null ? void 0 : Fr.filter((ar) => ar.columnId === I.id)) || [], ua = Object.assign(
|
|
3958
3969
|
{},
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
maxWidth: typeof
|
|
3970
|
+
Jr(I.type),
|
|
3971
|
+
ca,
|
|
3972
|
+
I.maxWidth !== void 0 ? {
|
|
3973
|
+
maxWidth: typeof I.maxWidth == "number" ? `${I.maxWidth}px` : I.maxWidth
|
|
3963
3974
|
} : {},
|
|
3964
|
-
{ background:
|
|
3965
|
-
),
|
|
3966
|
-
var
|
|
3967
|
-
return
|
|
3975
|
+
{ background: Me }
|
|
3976
|
+
), ha = () => {
|
|
3977
|
+
var ar, Dr;
|
|
3978
|
+
return ge && oe ? /* @__PURE__ */ O("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
3968
3979
|
/* @__PURE__ */ o(
|
|
3969
3980
|
"button",
|
|
3970
3981
|
{
|
|
@@ -3977,120 +3988,125 @@ const at = me.memo((e) => {
|
|
|
3977
3988
|
display: "flex",
|
|
3978
3989
|
alignItems: "center",
|
|
3979
3990
|
justifyContent: "center",
|
|
3980
|
-
color: ((
|
|
3991
|
+
color: ((Dr = (ar = p.theme) == null ? void 0 : ar.colors) == null ? void 0 : Dr.text) || B.colors.text
|
|
3981
3992
|
},
|
|
3982
|
-
children: de ? /* @__PURE__ */ o(
|
|
3993
|
+
children: de ? /* @__PURE__ */ o(ba, { size: 16 }) : /* @__PURE__ */ o(ga, { size: 16 })
|
|
3983
3994
|
}
|
|
3984
3995
|
),
|
|
3985
|
-
/* @__PURE__ */
|
|
3996
|
+
/* @__PURE__ */ O("span", { style: { paddingLeft: h * 16 }, children: [
|
|
3986
3997
|
" ",
|
|
3987
|
-
|
|
3988
|
-
|
|
3998
|
+
xe.length > 0 ? I.type === "action" ? I.render ? I.render(
|
|
3999
|
+
xe.length > 1 ? xe.map((ve) => ve) : xe[0],
|
|
3989
4000
|
$,
|
|
3990
|
-
|
|
3991
|
-
) : null :
|
|
4001
|
+
xe.length > 1 ? void 0 : xe[0]
|
|
4002
|
+
) : null : xe.map((ve, dr) => /* @__PURE__ */ o(
|
|
3992
4003
|
"span",
|
|
3993
4004
|
{
|
|
3994
4005
|
style: {
|
|
3995
4006
|
marginRight: 4,
|
|
3996
4007
|
display: "inline-block",
|
|
3997
|
-
maxWidth:
|
|
4008
|
+
maxWidth: I.maxWidth ? typeof I.maxWidth == "number" ? `${I.maxWidth}px` : I.maxWidth : void 0,
|
|
3998
4009
|
overflow: "hidden",
|
|
3999
4010
|
textOverflow: "ellipsis",
|
|
4000
4011
|
verticalAlign: "middle"
|
|
4001
4012
|
},
|
|
4002
|
-
children:
|
|
4013
|
+
children: I.render ? I.render(ve.value, $, ve) : /* @__PURE__ */ o("span", { children: ve.value })
|
|
4003
4014
|
},
|
|
4004
|
-
|
|
4015
|
+
dr
|
|
4005
4016
|
)) : null
|
|
4006
4017
|
] })
|
|
4007
|
-
] }) : /* @__PURE__ */
|
|
4018
|
+
] }) : /* @__PURE__ */ O("span", { style: { paddingLeft: h * 16 }, children: [
|
|
4008
4019
|
" ",
|
|
4009
|
-
|
|
4010
|
-
|
|
4020
|
+
xe.length > 0 ? I.type === "action" ? I.render ? I.render(
|
|
4021
|
+
xe.length > 1 ? xe.map((ve) => ve) : xe[0],
|
|
4011
4022
|
$,
|
|
4012
|
-
|
|
4013
|
-
) : null :
|
|
4023
|
+
xe.length > 1 ? void 0 : xe[0]
|
|
4024
|
+
) : null : xe.map((ve, dr) => /* @__PURE__ */ o(
|
|
4014
4025
|
"span",
|
|
4015
4026
|
{
|
|
4016
4027
|
style: {
|
|
4017
4028
|
marginRight: 4,
|
|
4018
4029
|
display: "inline-block",
|
|
4019
|
-
maxWidth:
|
|
4030
|
+
maxWidth: I.maxWidth ? typeof I.maxWidth == "number" ? `${I.maxWidth}px` : I.maxWidth : void 0,
|
|
4020
4031
|
overflow: "hidden",
|
|
4021
4032
|
textOverflow: "ellipsis",
|
|
4022
4033
|
verticalAlign: "middle"
|
|
4023
4034
|
},
|
|
4024
|
-
children:
|
|
4035
|
+
children: I.render ? I.render(ve.value, $, ve) : /* @__PURE__ */ o("span", { children: ve.value })
|
|
4025
4036
|
},
|
|
4026
|
-
|
|
4037
|
+
dr
|
|
4027
4038
|
)) : null
|
|
4028
4039
|
] });
|
|
4029
4040
|
};
|
|
4030
4041
|
return /* @__PURE__ */ o(
|
|
4031
|
-
|
|
4042
|
+
Kr,
|
|
4032
4043
|
{
|
|
4033
|
-
theme: p.theme ||
|
|
4034
|
-
style:
|
|
4035
|
-
className:
|
|
4036
|
-
children:
|
|
4044
|
+
theme: p.theme || B,
|
|
4045
|
+
style: ua,
|
|
4046
|
+
className: ge && T ? "sticky-shadow-left" : Qe && V ? "sticky-shadow-right" : "",
|
|
4047
|
+
children: ha()
|
|
4037
4048
|
},
|
|
4038
|
-
|
|
4049
|
+
I.id
|
|
4039
4050
|
);
|
|
4040
4051
|
})
|
|
4041
4052
|
]
|
|
4042
4053
|
}
|
|
4043
4054
|
),
|
|
4044
|
-
|
|
4055
|
+
oe && de && $.children !== void 0 && /* @__PURE__ */ o(
|
|
4045
4056
|
"tr",
|
|
4046
4057
|
{
|
|
4047
|
-
className: " relative
|
|
4058
|
+
className: "dynamic-table-sub-row relative",
|
|
4048
4059
|
style: {
|
|
4049
4060
|
width: R > 0 ? `${R}px` : "100%"
|
|
4050
4061
|
},
|
|
4051
4062
|
children: /* @__PURE__ */ o(
|
|
4052
4063
|
"td",
|
|
4053
4064
|
{
|
|
4065
|
+
className: "dynamic-table-sub-cell",
|
|
4054
4066
|
style: {
|
|
4055
4067
|
width: R > 0 ? `${R}px` : "100%"
|
|
4056
4068
|
},
|
|
4057
4069
|
colSpan: S.length + (e.allowMultiSelect ? 1 : 0),
|
|
4058
|
-
children: /* @__PURE__ */
|
|
4070
|
+
children: /* @__PURE__ */ O(
|
|
4059
4071
|
"div",
|
|
4060
4072
|
{
|
|
4073
|
+
className: "dynamic-table-sub-container",
|
|
4061
4074
|
style: {
|
|
4062
4075
|
position: "sticky",
|
|
4063
4076
|
left: 0,
|
|
4064
|
-
padding: "
|
|
4077
|
+
padding: "0px 8px",
|
|
4065
4078
|
width: R > 0 ? `${R}px` : "100%",
|
|
4066
4079
|
// 使用父容器实际宽度
|
|
4067
4080
|
minWidth: "800px",
|
|
4068
4081
|
// 最小宽度确保内容显示
|
|
4069
4082
|
maxWidth: "100%",
|
|
4070
4083
|
// 最大宽度不超过父容器
|
|
4071
|
-
background: ((
|
|
4084
|
+
background: ((Ne = (be = p.theme) == null ? void 0 : be.colors) == null ? void 0 : Ne.subTableBackground) || ((Ze = (Xe = p.theme) == null ? void 0 : Xe.colors) == null ? void 0 : Ze.disabledBackground) || B.colors.subTableBackground || B.colors.disabledBackground,
|
|
4072
4085
|
boxSizing: "border-box"
|
|
4073
4086
|
},
|
|
4074
4087
|
children: [
|
|
4075
4088
|
$.tableLoading && /* @__PURE__ */ o(
|
|
4076
4089
|
"div",
|
|
4077
4090
|
{
|
|
4091
|
+
className: "dynamic-table-sub-loading-overlay",
|
|
4078
4092
|
style: {
|
|
4079
4093
|
position: "absolute",
|
|
4080
4094
|
top: 0,
|
|
4081
4095
|
left: 0,
|
|
4082
4096
|
right: 0,
|
|
4083
4097
|
bottom: 0,
|
|
4084
|
-
background:
|
|
4098
|
+
background: ((pr = (hr = p.theme) == null ? void 0 : hr.colors) == null ? void 0 : pr.tableBackground) || ((mr = (fr = p.theme) == null ? void 0 : fr.colors) == null ? void 0 : mr.background) || B.colors.tableBackground,
|
|
4099
|
+
opacity: 0.9,
|
|
4085
4100
|
display: "flex",
|
|
4086
4101
|
alignItems: "center",
|
|
4087
4102
|
justifyContent: "center",
|
|
4088
4103
|
zIndex: 10,
|
|
4089
4104
|
borderRadius: p.space.radius
|
|
4090
4105
|
},
|
|
4091
|
-
children: /* @__PURE__ */
|
|
4106
|
+
children: /* @__PURE__ */ O(
|
|
4092
4107
|
"div",
|
|
4093
4108
|
{
|
|
4109
|
+
className: "dynamic-table-sub-loading-content",
|
|
4094
4110
|
style: {
|
|
4095
4111
|
display: "flex",
|
|
4096
4112
|
flexDirection: "column",
|
|
@@ -4101,66 +4117,68 @@ const at = me.memo((e) => {
|
|
|
4101
4117
|
/* @__PURE__ */ o(
|
|
4102
4118
|
"div",
|
|
4103
4119
|
{
|
|
4120
|
+
className: "dynamic-table-sub-loading-spinner",
|
|
4104
4121
|
style: {
|
|
4105
4122
|
width: 24,
|
|
4106
4123
|
height: 24,
|
|
4107
|
-
border: `2px solid ${((
|
|
4108
|
-
borderTop: `2px solid ${((
|
|
4124
|
+
border: `2px solid ${((gr = (br = p.theme) == null ? void 0 : br.colors) == null ? void 0 : gr.border) || B.colors.border}`,
|
|
4125
|
+
borderTop: `2px solid ${((yr = (xr = p.theme) == null ? void 0 : xr.colors) == null ? void 0 : yr.primary) || B.colors.primary}`,
|
|
4109
4126
|
borderRadius: "50%",
|
|
4110
4127
|
animation: "spin 1s linear infinite"
|
|
4111
4128
|
}
|
|
4112
4129
|
}
|
|
4113
4130
|
),
|
|
4114
|
-
/* @__PURE__ */ o("span", { style: { fontSize: 14, color: ((
|
|
4131
|
+
/* @__PURE__ */ o("span", { style: { fontSize: 14, color: ((vr = ($r = p.theme) == null ? void 0 : $r.colors) == null ? void 0 : vr.text) || B.colors.text }, children: "加载中..." })
|
|
4115
4132
|
]
|
|
4116
4133
|
}
|
|
4117
4134
|
)
|
|
4118
4135
|
}
|
|
4119
4136
|
),
|
|
4120
|
-
/* @__PURE__ */
|
|
4121
|
-
Array.isArray((
|
|
4137
|
+
/* @__PURE__ */ O("div", { className: "dynamic-table-sub-content", style: { marginBottom: "16px" }, children: [
|
|
4138
|
+
Array.isArray((wr = e.subTableConfig) == null ? void 0 : wr.toolbar) && e.subTableConfig.toolbar.length > 0 && /* @__PURE__ */ o(
|
|
4122
4139
|
"div",
|
|
4123
4140
|
{
|
|
4141
|
+
className: "dynamic-table-sub-toolbar",
|
|
4124
4142
|
style: {
|
|
4125
4143
|
display: "flex",
|
|
4126
4144
|
gap: 8,
|
|
4127
4145
|
alignItems: "center",
|
|
4128
4146
|
marginBottom: 8
|
|
4129
4147
|
},
|
|
4130
|
-
children: e.subTableConfig.toolbar.map((
|
|
4131
|
-
const
|
|
4148
|
+
children: e.subTableConfig.toolbar.map((I, ue) => {
|
|
4149
|
+
const Qe = {
|
|
4132
4150
|
primary: "primary",
|
|
4133
4151
|
error: "danger",
|
|
4134
4152
|
default: "text"
|
|
4135
|
-
}[
|
|
4153
|
+
}[I.btnType] || "text";
|
|
4136
4154
|
return /* @__PURE__ */ o(
|
|
4137
|
-
|
|
4155
|
+
er,
|
|
4138
4156
|
{
|
|
4139
|
-
mode:
|
|
4140
|
-
label:
|
|
4141
|
-
icon:
|
|
4157
|
+
mode: Qe,
|
|
4158
|
+
label: I.label,
|
|
4159
|
+
icon: I.icon,
|
|
4142
4160
|
onClick: () => {
|
|
4143
|
-
var
|
|
4144
|
-
return (
|
|
4161
|
+
var Me;
|
|
4162
|
+
return (Me = e.eventsEmit) == null ? void 0 : Me.call(e, "table_action_add", {
|
|
4145
4163
|
tableId: $.id,
|
|
4146
|
-
action:
|
|
4164
|
+
action: I
|
|
4147
4165
|
});
|
|
4148
4166
|
}
|
|
4149
4167
|
},
|
|
4150
|
-
|
|
4168
|
+
ue
|
|
4151
4169
|
);
|
|
4152
4170
|
})
|
|
4153
4171
|
}
|
|
4154
4172
|
),
|
|
4155
4173
|
/* @__PURE__ */ o(
|
|
4156
|
-
|
|
4174
|
+
ht,
|
|
4157
4175
|
{
|
|
4158
|
-
theme: p.theme ||
|
|
4159
|
-
onWheel: (
|
|
4160
|
-
|
|
4176
|
+
theme: p.theme || B,
|
|
4177
|
+
onWheel: (I) => {
|
|
4178
|
+
I.stopPropagation();
|
|
4161
4179
|
},
|
|
4162
|
-
onScroll: (
|
|
4163
|
-
|
|
4180
|
+
onScroll: (I) => {
|
|
4181
|
+
I.stopPropagation();
|
|
4164
4182
|
},
|
|
4165
4183
|
style: {
|
|
4166
4184
|
position: "relative",
|
|
@@ -4170,37 +4188,37 @@ const at = me.memo((e) => {
|
|
|
4170
4188
|
maxWidth: "100%"
|
|
4171
4189
|
},
|
|
4172
4190
|
children: /* @__PURE__ */ o(
|
|
4173
|
-
|
|
4191
|
+
bt,
|
|
4174
4192
|
{
|
|
4175
|
-
columns: ((
|
|
4193
|
+
columns: ((kr = e.subTableConfig) == null ? void 0 : kr.columns) || [],
|
|
4176
4194
|
dataSource: $.children || [],
|
|
4177
4195
|
isSubTable: !0,
|
|
4178
|
-
isPending: (
|
|
4179
|
-
var
|
|
4180
|
-
return ((
|
|
4196
|
+
isPending: (I) => {
|
|
4197
|
+
var ue, ge;
|
|
4198
|
+
return ((ge = (ue = e.subTablePendingIds) == null ? void 0 : ue[$.id]) == null ? void 0 : ge.includes(I)) || !1;
|
|
4181
4199
|
},
|
|
4182
|
-
onRowAnimationComplete: (
|
|
4183
|
-
var
|
|
4184
|
-
(
|
|
4185
|
-
rowId:
|
|
4200
|
+
onRowAnimationComplete: (I) => {
|
|
4201
|
+
var ue;
|
|
4202
|
+
(ue = e.onSubTableRowAnimationComplete) == null || ue.call(e, $.id, I), e.eventsEmit && e.eventsEmit("_internal:subtable_animation_complete", {
|
|
4203
|
+
rowId: I,
|
|
4186
4204
|
tableId: $.id
|
|
4187
4205
|
});
|
|
4188
4206
|
},
|
|
4189
|
-
eventsEmit: (
|
|
4190
|
-
var
|
|
4191
|
-
(
|
|
4207
|
+
eventsEmit: (I, ue) => {
|
|
4208
|
+
var ge;
|
|
4209
|
+
(ge = e.eventsEmit) == null || ge.call(e, I, { ...ue, tableId: $.id });
|
|
4192
4210
|
},
|
|
4193
|
-
allowMultiSelect: (
|
|
4211
|
+
allowMultiSelect: (Sr = e.subTableConfig) == null ? void 0 : Sr.allowMultiSelect,
|
|
4194
4212
|
size: e.size,
|
|
4195
4213
|
level: h + 1,
|
|
4196
4214
|
subTableConfig: e.subTableConfig,
|
|
4197
4215
|
styles: e.styles,
|
|
4198
4216
|
onRowAddAnimationComplete: e.onRowAddAnimationComplete,
|
|
4199
4217
|
addingIds: e.addingIds,
|
|
4200
|
-
viewBehavior: (
|
|
4201
|
-
viewPageSize: (
|
|
4202
|
-
total: (
|
|
4203
|
-
requestPagesize: (
|
|
4218
|
+
viewBehavior: (Nr = e.subTableConfig) == null ? void 0 : Nr.viewBehavior,
|
|
4219
|
+
viewPageSize: (Cr = e.subTableConfig) == null ? void 0 : Cr.viewPageSize,
|
|
4220
|
+
total: (Mr = e.subTableConfig) == null ? void 0 : Mr.total,
|
|
4221
|
+
requestPagesize: (Tr = e.subTableConfig) == null ? void 0 : Tr.requestPagesize
|
|
4204
4222
|
}
|
|
4205
4223
|
)
|
|
4206
4224
|
}
|
|
@@ -4228,13 +4246,13 @@ const at = me.memo((e) => {
|
|
|
4228
4246
|
display: "flex",
|
|
4229
4247
|
justifyContent: "end",
|
|
4230
4248
|
alignItems: "center",
|
|
4231
|
-
background: ((
|
|
4232
|
-
borderTop: `1px solid ${((
|
|
4249
|
+
background: ((We = (Be = p.theme) == null ? void 0 : Be.colors) == null ? void 0 : We.paginationBackground) || ((qe = (Re = p.theme) == null ? void 0 : Re.colors) == null ? void 0 : qe.background) || B.colors.paginationBackground || B.colors.background,
|
|
4250
|
+
borderTop: `1px solid ${((Oe = (Le = p.theme) == null ? void 0 : Le.colors) == null ? void 0 : Oe.border) || B.colors.border}`,
|
|
4233
4251
|
flexShrink: 0,
|
|
4234
4252
|
paddingRight: 16
|
|
4235
4253
|
},
|
|
4236
4254
|
children: /* @__PURE__ */ o(
|
|
4237
|
-
|
|
4255
|
+
wa,
|
|
4238
4256
|
{
|
|
4239
4257
|
current: q,
|
|
4240
4258
|
pageSize: P,
|
|
@@ -4242,7 +4260,7 @@ const at = me.memo((e) => {
|
|
|
4242
4260
|
onChange: Y,
|
|
4243
4261
|
onPageSizeChange: ($) => {
|
|
4244
4262
|
var ne;
|
|
4245
|
-
Z(1),
|
|
4263
|
+
Z(1), ae($), W && l && C && e.eventsEmit && (a(/* @__PURE__ */ new Set()), e.eventsEmit(
|
|
4246
4264
|
"pagination:request_merge_data",
|
|
4247
4265
|
{
|
|
4248
4266
|
viewId: C,
|
|
@@ -4255,13 +4273,13 @@ const at = me.memo((e) => {
|
|
|
4255
4273
|
pageSizeOptions: [5, 10, 20, 30, 50],
|
|
4256
4274
|
theme: {
|
|
4257
4275
|
colors: {
|
|
4258
|
-
background: ((
|
|
4259
|
-
text: ((
|
|
4260
|
-
border: ((
|
|
4261
|
-
disabledBackground: ((
|
|
4262
|
-
primary: ((
|
|
4276
|
+
background: ((He = (je = p.theme) == null ? void 0 : je.colors) == null ? void 0 : He.paginationBackground) || ((Ie = (Ye = p.theme) == null ? void 0 : Ye.colors) == null ? void 0 : Ie.background) || B.colors.paginationBackground || B.colors.background,
|
|
4277
|
+
text: ((Ve = (Ue = p.theme) == null ? void 0 : Ue.colors) == null ? void 0 : Ve.text) || B.colors.text,
|
|
4278
|
+
border: ((Je = (Ee = p.theme) == null ? void 0 : Ee.colors) == null ? void 0 : Je.border) || B.colors.border,
|
|
4279
|
+
disabledBackground: ((Ke = (Ge = p.theme) == null ? void 0 : Ge.colors) == null ? void 0 : Ke.disabledBackground) || B.colors.disabledBackground,
|
|
4280
|
+
primary: ((pe = (Pe = p.theme) == null ? void 0 : Pe.colors) == null ? void 0 : pe.primary) || B.colors.primary
|
|
4263
4281
|
},
|
|
4264
|
-
space: { radius: ((
|
|
4282
|
+
space: { radius: ((rr = (Ce = p.theme) == null ? void 0 : Ce.space) == null ? void 0 : rr.radius) || B.space.radius }
|
|
4265
4283
|
},
|
|
4266
4284
|
size: e.size,
|
|
4267
4285
|
showPageNumbers: !0
|
|
@@ -4272,7 +4290,7 @@ const at = me.memo((e) => {
|
|
|
4272
4290
|
]
|
|
4273
4291
|
}
|
|
4274
4292
|
);
|
|
4275
|
-
}),
|
|
4293
|
+
}), gt = J.div`
|
|
4276
4294
|
display: flex;
|
|
4277
4295
|
background-color: #ffffff;
|
|
4278
4296
|
border: 1px solid ${(e) => {
|
|
@@ -4287,7 +4305,7 @@ const at = me.memo((e) => {
|
|
|
4287
4305
|
width: ${(e) => e.$width || "600px"};
|
|
4288
4306
|
height: ${(e) => e.$height || "400px"};
|
|
4289
4307
|
position: relative;
|
|
4290
|
-
`,
|
|
4308
|
+
`, Pr = J.div`
|
|
4291
4309
|
display: flex;
|
|
4292
4310
|
flex-direction: column;
|
|
4293
4311
|
border-right: 1px solid ${(e) => {
|
|
@@ -4299,7 +4317,7 @@ const at = me.memo((e) => {
|
|
|
4299
4317
|
&:last-child {
|
|
4300
4318
|
border-right: none;
|
|
4301
4319
|
}
|
|
4302
|
-
`,
|
|
4320
|
+
`, Xr = J.div`
|
|
4303
4321
|
padding: 12px 16px;
|
|
4304
4322
|
border-bottom: 1px solid ${(e) => {
|
|
4305
4323
|
var r, t, s;
|
|
@@ -4315,7 +4333,7 @@ const at = me.memo((e) => {
|
|
|
4315
4333
|
var r, t, s;
|
|
4316
4334
|
return ((s = (t = (r = e.$theme) == null ? void 0 : r.colors) == null ? void 0 : t.text) == null ? void 0 : s.primary) || "#111827";
|
|
4317
4335
|
}};
|
|
4318
|
-
`,
|
|
4336
|
+
`, xt = J.div`
|
|
4319
4337
|
padding: 12px;
|
|
4320
4338
|
border-bottom: 1px solid ${(e) => {
|
|
4321
4339
|
var r, t, s;
|
|
@@ -4325,7 +4343,7 @@ const at = me.memo((e) => {
|
|
|
4325
4343
|
var r, t, s;
|
|
4326
4344
|
return ((s = (t = (r = e.$theme) == null ? void 0 : r.colors) == null ? void 0 : t.background) == null ? void 0 : s.default) || "#ffffff";
|
|
4327
4345
|
}};
|
|
4328
|
-
`,
|
|
4346
|
+
`, yt = J.input`
|
|
4329
4347
|
width: 100%;
|
|
4330
4348
|
padding: 8px 12px 8px 36px;
|
|
4331
4349
|
border: 1px solid ${(e) => {
|
|
@@ -4357,14 +4375,14 @@ const at = me.memo((e) => {
|
|
|
4357
4375
|
return ((s = (t = (r = e.$theme) == null ? void 0 : r.colors) == null ? void 0 : t.text) == null ? void 0 : s.tertiary) || "#9ca3af";
|
|
4358
4376
|
}};
|
|
4359
4377
|
}
|
|
4360
|
-
`,
|
|
4378
|
+
`, $t = J.div`
|
|
4361
4379
|
position: absolute;
|
|
4362
4380
|
left: 20px;
|
|
4363
4381
|
top: 50%;
|
|
4364
4382
|
transform: translateY(-50%);
|
|
4365
4383
|
color: #9ca3af;
|
|
4366
4384
|
pointer-events: none;
|
|
4367
|
-
`,
|
|
4385
|
+
`, Zr = J.div`
|
|
4368
4386
|
flex: 1;
|
|
4369
4387
|
overflow-y: auto;
|
|
4370
4388
|
overflow-x: hidden;
|
|
@@ -4385,7 +4403,7 @@ const at = me.memo((e) => {
|
|
|
4385
4403
|
background: #a8a8a8;
|
|
4386
4404
|
}
|
|
4387
4405
|
}
|
|
4388
|
-
`,
|
|
4406
|
+
`, Qr = J.div`
|
|
4389
4407
|
padding: 10px 16px;
|
|
4390
4408
|
cursor: ${(e) => e.$disabled ? "not-allowed" : "pointer"};
|
|
4391
4409
|
transition: all 0.2s;
|
|
@@ -4408,7 +4426,7 @@ const at = me.memo((e) => {
|
|
|
4408
4426
|
&:last-child {
|
|
4409
4427
|
border-bottom: none;
|
|
4410
4428
|
}
|
|
4411
|
-
`,
|
|
4429
|
+
`, ea = J.span`
|
|
4412
4430
|
flex: 1;
|
|
4413
4431
|
font-size: 14px;
|
|
4414
4432
|
color: ${(e) => {
|
|
@@ -4418,7 +4436,7 @@ const at = me.memo((e) => {
|
|
|
4418
4436
|
overflow: hidden;
|
|
4419
4437
|
text-overflow: ellipsis;
|
|
4420
4438
|
white-space: nowrap;
|
|
4421
|
-
`,
|
|
4439
|
+
`, ra = J.button`
|
|
4422
4440
|
display: flex;
|
|
4423
4441
|
align-items: center;
|
|
4424
4442
|
justify-content: center;
|
|
@@ -4442,7 +4460,7 @@ const at = me.memo((e) => {
|
|
|
4442
4460
|
return ((s = (t = (r = e.$theme) == null ? void 0 : r.colors) == null ? void 0 : t.text) == null ? void 0 : s.secondary) || "#C9CDD4";
|
|
4443
4461
|
}};
|
|
4444
4462
|
}
|
|
4445
|
-
`,
|
|
4463
|
+
`, aa = J.div`
|
|
4446
4464
|
padding: 40px 20px;
|
|
4447
4465
|
text-align: center;
|
|
4448
4466
|
color: ${(e) => {
|
|
@@ -4450,7 +4468,7 @@ const at = me.memo((e) => {
|
|
|
4450
4468
|
return ((s = (t = (r = e.$theme) == null ? void 0 : r.colors) == null ? void 0 : t.text) == null ? void 0 : s.tertiary) || "#9ca3af";
|
|
4451
4469
|
}};
|
|
4452
4470
|
font-size: 14px;
|
|
4453
|
-
`,
|
|
4471
|
+
`, ta = J.span`
|
|
4454
4472
|
display: inline-flex;
|
|
4455
4473
|
align-items: center;
|
|
4456
4474
|
justify-content: center;
|
|
@@ -4466,7 +4484,7 @@ const at = me.memo((e) => {
|
|
|
4466
4484
|
font-size: 12px;
|
|
4467
4485
|
font-weight: 500;
|
|
4468
4486
|
margin-left: 8px;
|
|
4469
|
-
`,
|
|
4487
|
+
`, Rt = ({
|
|
4470
4488
|
dataSource: e,
|
|
4471
4489
|
value: r,
|
|
4472
4490
|
defaultValue: t = [],
|
|
@@ -4482,22 +4500,22 @@ const at = me.memo((e) => {
|
|
|
4482
4500
|
onItemDataChange: W,
|
|
4483
4501
|
itemDataMap: l,
|
|
4484
4502
|
className: _,
|
|
4485
|
-
style:
|
|
4486
|
-
styles:
|
|
4487
|
-
height:
|
|
4503
|
+
style: U,
|
|
4504
|
+
styles: ae,
|
|
4505
|
+
height: te,
|
|
4488
4506
|
width: a
|
|
4489
4507
|
}) => {
|
|
4490
|
-
const T =
|
|
4491
|
-
|
|
4492
|
-
|
|
4493
|
-
), [
|
|
4508
|
+
const T = Fe(), v = $e(
|
|
4509
|
+
$e({ theme: B, mode: "light" }, T),
|
|
4510
|
+
ae
|
|
4511
|
+
), [V, A] = ie(t), [E, j] = ie(""), [Q, X] = ie(l || {}), R = l !== void 0 ? l : Q, ee = r !== void 0 ? r : V, G = (k) => {
|
|
4494
4512
|
r === void 0 && A(k), s == null || s(k);
|
|
4495
|
-
}, y = N || ((k,
|
|
4496
|
-
const Y = { ...R[k], ...
|
|
4513
|
+
}, y = N || ((k, H) => k ? H.label.toLowerCase().includes(k.toLowerCase()) : !0), x = Se(() => e.filter((k) => y(E, k)), [e, E, y]), D = Se(() => e.filter((k) => ee.includes(k.key)), [e, ee]), w = (k, H) => {
|
|
4514
|
+
const Y = { ...R[k], ...H }, i = { ...R, [k]: Y };
|
|
4497
4515
|
l === void 0 && X(i), W == null || W(k, Y);
|
|
4498
4516
|
}, L = (k) => {
|
|
4499
|
-
const
|
|
4500
|
-
if (G(
|
|
4517
|
+
const H = ee.filter((Y) => Y !== k.key);
|
|
4518
|
+
if (G(H), l === void 0) {
|
|
4501
4519
|
if (R[k.key]) {
|
|
4502
4520
|
const Y = { ...R };
|
|
4503
4521
|
delete Y[k.key], X(Y);
|
|
@@ -4507,12 +4525,12 @@ const at = me.memo((e) => {
|
|
|
4507
4525
|
};
|
|
4508
4526
|
we(() => {
|
|
4509
4527
|
if (l === void 0) {
|
|
4510
|
-
const k = new Set(ee),
|
|
4528
|
+
const k = new Set(ee), H = Object.keys(R).filter(
|
|
4511
4529
|
(Y) => !k.has(Y)
|
|
4512
4530
|
);
|
|
4513
|
-
if (
|
|
4531
|
+
if (H.length > 0) {
|
|
4514
4532
|
const Y = { ...R };
|
|
4515
|
-
|
|
4533
|
+
H.forEach((i) => {
|
|
4516
4534
|
delete Y[i];
|
|
4517
4535
|
}), X(Y);
|
|
4518
4536
|
}
|
|
@@ -4527,62 +4545,62 @@ const at = me.memo((e) => {
|
|
|
4527
4545
|
}, [ee]);
|
|
4528
4546
|
const q = (k) => {
|
|
4529
4547
|
if (k.disabled) return;
|
|
4530
|
-
const
|
|
4548
|
+
const H = [...ee], Y = H.indexOf(k.key);
|
|
4531
4549
|
if (Y > -1)
|
|
4532
|
-
|
|
4550
|
+
H.splice(Y, 1);
|
|
4533
4551
|
else {
|
|
4534
|
-
if (h > 0 &&
|
|
4552
|
+
if (h > 0 && H.length >= h)
|
|
4535
4553
|
return;
|
|
4536
|
-
|
|
4554
|
+
H.push(k.key);
|
|
4537
4555
|
}
|
|
4538
|
-
G(
|
|
4556
|
+
G(H);
|
|
4539
4557
|
}, Z = (k) => ee.includes(k), P = h > 0 && ee.length >= h;
|
|
4540
|
-
return /* @__PURE__ */
|
|
4541
|
-
|
|
4558
|
+
return /* @__PURE__ */ O(
|
|
4559
|
+
gt,
|
|
4542
4560
|
{
|
|
4543
|
-
$theme: v.theme ||
|
|
4561
|
+
$theme: v.theme || B,
|
|
4544
4562
|
$width: a,
|
|
4545
|
-
$height:
|
|
4563
|
+
$height: te,
|
|
4546
4564
|
className: _,
|
|
4547
|
-
style:
|
|
4565
|
+
style: U,
|
|
4548
4566
|
children: [
|
|
4549
|
-
/* @__PURE__ */
|
|
4550
|
-
/* @__PURE__ */
|
|
4567
|
+
/* @__PURE__ */ O(Pr, { $theme: v.theme || B, style: { flex: 1 }, children: [
|
|
4568
|
+
/* @__PURE__ */ O(Xr, { $theme: v.theme || B, children: [
|
|
4551
4569
|
p,
|
|
4552
|
-
h > 0 && /* @__PURE__ */
|
|
4570
|
+
h > 0 && /* @__PURE__ */ O(ta, { $theme: v.theme || B, children: [
|
|
4553
4571
|
ee.length,
|
|
4554
4572
|
"/",
|
|
4555
4573
|
h
|
|
4556
4574
|
] })
|
|
4557
4575
|
] }),
|
|
4558
|
-
f && /* @__PURE__ */ o(
|
|
4559
|
-
/* @__PURE__ */ o(
|
|
4576
|
+
f && /* @__PURE__ */ o(xt, { $theme: v.theme || B, children: /* @__PURE__ */ O("div", { style: { position: "relative" }, children: [
|
|
4577
|
+
/* @__PURE__ */ o($t, { children: /* @__PURE__ */ o(xa, { size: 16 }) }),
|
|
4560
4578
|
/* @__PURE__ */ o(
|
|
4561
|
-
|
|
4579
|
+
yt,
|
|
4562
4580
|
{
|
|
4563
|
-
$theme: v.theme ||
|
|
4581
|
+
$theme: v.theme || B,
|
|
4564
4582
|
type: "text",
|
|
4565
4583
|
placeholder: b,
|
|
4566
|
-
value:
|
|
4567
|
-
onChange: (k) =>
|
|
4584
|
+
value: E,
|
|
4585
|
+
onChange: (k) => j(k.target.value)
|
|
4568
4586
|
}
|
|
4569
4587
|
)
|
|
4570
4588
|
] }) }),
|
|
4571
|
-
/* @__PURE__ */ o(
|
|
4572
|
-
const
|
|
4573
|
-
return /* @__PURE__ */
|
|
4574
|
-
|
|
4589
|
+
/* @__PURE__ */ o(Zr, { children: x.length === 0 ? /* @__PURE__ */ o(aa, { $theme: v.theme || B, children: E ? "未找到匹配项" : "暂无数据" }) : x.map((k) => {
|
|
4590
|
+
const H = Z(k.key), Y = k.disabled || P && !H;
|
|
4591
|
+
return /* @__PURE__ */ O(
|
|
4592
|
+
Qr,
|
|
4575
4593
|
{
|
|
4576
|
-
$theme: v.theme ||
|
|
4594
|
+
$theme: v.theme || B,
|
|
4577
4595
|
$disabled: Y,
|
|
4578
|
-
$selected:
|
|
4596
|
+
$selected: H,
|
|
4579
4597
|
onClick: () => q(k),
|
|
4580
4598
|
children: [
|
|
4581
|
-
/* @__PURE__ */ o(
|
|
4582
|
-
|
|
4583
|
-
|
|
4599
|
+
/* @__PURE__ */ o(ea, { $theme: v.theme || B, children: M ? M(k) : k.label }),
|
|
4600
|
+
H && /* @__PURE__ */ o(
|
|
4601
|
+
ra,
|
|
4584
4602
|
{
|
|
4585
|
-
$theme: v.theme ||
|
|
4603
|
+
$theme: v.theme || B,
|
|
4586
4604
|
onClick: (i) => {
|
|
4587
4605
|
i.stopPropagation(), L(k);
|
|
4588
4606
|
},
|
|
@@ -4590,10 +4608,10 @@ const at = me.memo((e) => {
|
|
|
4590
4608
|
children: "已添加"
|
|
4591
4609
|
}
|
|
4592
4610
|
),
|
|
4593
|
-
!
|
|
4594
|
-
|
|
4611
|
+
!H && /* @__PURE__ */ o(
|
|
4612
|
+
ra,
|
|
4595
4613
|
{
|
|
4596
|
-
$theme: v.theme ||
|
|
4614
|
+
$theme: v.theme || B,
|
|
4597
4615
|
disabled: Y,
|
|
4598
4616
|
onClick: (i) => {
|
|
4599
4617
|
i.stopPropagation(), q(k);
|
|
@@ -4607,22 +4625,22 @@ const at = me.memo((e) => {
|
|
|
4607
4625
|
);
|
|
4608
4626
|
}) })
|
|
4609
4627
|
] }),
|
|
4610
|
-
/* @__PURE__ */
|
|
4611
|
-
/* @__PURE__ */
|
|
4628
|
+
/* @__PURE__ */ O(Pr, { $theme: v.theme || B, style: { flex: 1 }, children: [
|
|
4629
|
+
/* @__PURE__ */ O(Xr, { $theme: v.theme || B, children: [
|
|
4612
4630
|
d,
|
|
4613
|
-
ee.length > 0 && /* @__PURE__ */ o(
|
|
4631
|
+
ee.length > 0 && /* @__PURE__ */ o(ta, { $theme: v.theme || B, children: ee.length })
|
|
4614
4632
|
] }),
|
|
4615
|
-
/* @__PURE__ */ o(
|
|
4633
|
+
/* @__PURE__ */ o(Zr, { children: D.length === 0 ? /* @__PURE__ */ o(aa, { $theme: v.theme || B, children: "暂无已选项" }) : D.map((k) => {
|
|
4616
4634
|
var i, u, c;
|
|
4617
|
-
const
|
|
4618
|
-
return /* @__PURE__ */
|
|
4619
|
-
|
|
4635
|
+
const H = R[k.key] || {}, Y = (n) => w(k.key, n);
|
|
4636
|
+
return /* @__PURE__ */ O(
|
|
4637
|
+
Qr,
|
|
4620
4638
|
{
|
|
4621
|
-
$theme: v.theme ||
|
|
4639
|
+
$theme: v.theme || B,
|
|
4622
4640
|
children: [
|
|
4623
|
-
/* @__PURE__ */ o(
|
|
4641
|
+
/* @__PURE__ */ o(ea, { $theme: v.theme || B, children: C ? C(k, Y, H) : k.label }),
|
|
4624
4642
|
/* @__PURE__ */ o(
|
|
4625
|
-
|
|
4643
|
+
ya,
|
|
4626
4644
|
{
|
|
4627
4645
|
size: 14,
|
|
4628
4646
|
color: ((c = (u = (i = v.theme) == null ? void 0 : i.colors) == null ? void 0 : u.text) == null ? void 0 : c.secondary) || "#86909C",
|
|
@@ -4646,17 +4664,17 @@ const at = me.memo((e) => {
|
|
|
4646
4664
|
);
|
|
4647
4665
|
};
|
|
4648
4666
|
export {
|
|
4649
|
-
|
|
4650
|
-
|
|
4651
|
-
|
|
4652
|
-
|
|
4653
|
-
|
|
4654
|
-
|
|
4655
|
-
|
|
4656
|
-
|
|
4657
|
-
|
|
4658
|
-
|
|
4659
|
-
|
|
4660
|
-
|
|
4661
|
-
|
|
4667
|
+
Dt as CustomDock,
|
|
4668
|
+
la as DynamicForm,
|
|
4669
|
+
bt as DynamicTable,
|
|
4670
|
+
Ft as GoogleNavbar,
|
|
4671
|
+
Rt as SearchableSelector,
|
|
4672
|
+
Yr as Uploader,
|
|
4673
|
+
At as generateFormItems,
|
|
4674
|
+
zt as getFormDefaultValues,
|
|
4675
|
+
Wt as getFormErrors,
|
|
4676
|
+
Bt as isFormValid,
|
|
4677
|
+
Ja as useDynamicFormItems,
|
|
4678
|
+
it as useDynamicTableColumns,
|
|
4679
|
+
_t as validateFormData
|
|
4662
4680
|
};
|