@mxmweb/zui-components 1.2.4 → 1.2.6
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 +1330 -1304
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
import J, { createGlobalStyle as
|
|
4
|
-
import { useTheme as
|
|
5
|
-
import
|
|
6
|
-
import { CircleHelp as
|
|
7
|
-
import { Form as K, Input as
|
|
8
|
-
import { Button as
|
|
9
|
-
const
|
|
1
|
+
import { jsxs as L, 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 Ar, 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 _r, 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 la = 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,50 +35,50 @@ const la = 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,
|
|
42
42
|
open: s,
|
|
43
43
|
onOpenChange: h,
|
|
44
44
|
onItemClick: b,
|
|
45
|
-
logo:
|
|
45
|
+
logo: p,
|
|
46
46
|
className: d,
|
|
47
|
-
style:
|
|
47
|
+
style: f,
|
|
48
48
|
styles: N
|
|
49
49
|
}) => {
|
|
50
|
-
const
|
|
50
|
+
const F = Fe(), M = $e(
|
|
51
51
|
// 基础:默认主题 + useTheme的配置
|
|
52
|
-
$e({ theme:
|
|
52
|
+
$e({ theme: B, mode: "light" }, F),
|
|
53
53
|
// 最高层:用户手动传入的styles
|
|
54
54
|
N
|
|
55
55
|
);
|
|
56
|
-
|
|
57
|
-
const [
|
|
58
|
-
typeof s == "boolean" || l(
|
|
59
|
-
}, [
|
|
60
|
-
width:
|
|
61
|
-
minWidth:
|
|
56
|
+
Sa();
|
|
57
|
+
const [O, l] = ie(t), $ = typeof s == "boolean" ? s : O, H = (w) => {
|
|
58
|
+
typeof s == "boolean" || l(w), h == null || h(w);
|
|
59
|
+
}, [P, te] = ie(!1), a = (w) => w ? typeof w == "string" ? /* @__PURE__ */ o("img", { src: w, className: "w-6 h-6 transition-all duration-200", alt: "nav" }) : w : null, T = Se(() => ({
|
|
60
|
+
width: $ ? "60px" : "20px",
|
|
61
|
+
minWidth: $ ? "60px" : "20px",
|
|
62
62
|
transition: "all 0.3s cubic-bezier(0.4, 0, 0.2, 1)"
|
|
63
|
-
}), [
|
|
64
|
-
return /* @__PURE__ */
|
|
63
|
+
}), [$]);
|
|
64
|
+
return /* @__PURE__ */ L(ka, { $theme: M.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: () =>
|
|
72
|
-
"aria-label":
|
|
71
|
+
onClick: () => H(!$),
|
|
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__ */ L("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 ${P ? "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 ${P ? "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,40 +88,40 @@ const la = J.div`
|
|
|
88
88
|
] }) })
|
|
89
89
|
}
|
|
90
90
|
),
|
|
91
|
-
/* @__PURE__ */
|
|
91
|
+
/* @__PURE__ */ L(
|
|
92
92
|
"div",
|
|
93
93
|
{
|
|
94
94
|
className: "h-full py-6 px-[2px] flex flex-col items-center",
|
|
95
95
|
style: {
|
|
96
|
-
opacity:
|
|
97
|
-
transform:
|
|
96
|
+
opacity: $ ? 1 : 0,
|
|
97
|
+
transform: $ ? "translateX(0)" : "translateX(-10px)",
|
|
98
98
|
transition: "all 0.2s cubic-bezier(0.4, 0, 0.2, 1)"
|
|
99
99
|
},
|
|
100
100
|
children: [
|
|
101
|
-
/* @__PURE__ */ o("div", { className: "mb-6 transition-transform duration-300 hover:scale-105", children: typeof
|
|
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((
|
|
103
|
-
const
|
|
104
|
-
return /* @__PURE__ */
|
|
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
|
+
/* @__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((w) => {
|
|
103
|
+
const V = !!(r && w.path && r.startsWith(w.path)), _ = V && w.activeIcon ? w.activeIcon : w.icon;
|
|
104
|
+
return /* @__PURE__ */ L(
|
|
105
105
|
"div",
|
|
106
106
|
{
|
|
107
|
-
onClick: () => !
|
|
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 ${
|
|
107
|
+
onClick: () => !w.disabled && (b == null ? void 0 : b(w)),
|
|
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__ */
|
|
111
|
-
a(
|
|
112
|
-
|
|
110
|
+
/* @__PURE__ */ L("div", { className: "relative g-nav-icon transition-transform duration-200 group-hover:scale-105", children: [
|
|
111
|
+
a(_),
|
|
112
|
+
w.badge && w.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: w.badge > 99 ? "99+" : w.badge })
|
|
113
113
|
] }),
|
|
114
|
-
/* @__PURE__ */ o("div", { className: "mt-1 text-xs text-center g-nav-text transition-colors duration-200", children:
|
|
114
|
+
/* @__PURE__ */ o("div", { className: "mt-1 text-xs text-center g-nav-text transition-colors duration-200", children: w.name })
|
|
115
115
|
]
|
|
116
116
|
},
|
|
117
|
-
|
|
117
|
+
w.key
|
|
118
118
|
);
|
|
119
119
|
}) })
|
|
120
120
|
]
|
|
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 la = 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 la = 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 la = 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 la = 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,103 +230,103 @@ const la = 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,
|
|
237
237
|
magnification: s = 1.2,
|
|
238
238
|
itemGap: h = 13,
|
|
239
239
|
activeMode: b = "single",
|
|
240
|
-
defaultActiveId:
|
|
240
|
+
defaultActiveId: p,
|
|
241
241
|
defaultActiveIds: d = [],
|
|
242
|
-
onItemClick:
|
|
242
|
+
onItemClick: f,
|
|
243
243
|
onActiveChange: N,
|
|
244
|
-
onActiveChangeMultiple:
|
|
244
|
+
onActiveChangeMultiple: F,
|
|
245
245
|
className: M,
|
|
246
|
-
styles:
|
|
246
|
+
styles: O
|
|
247
247
|
}) => {
|
|
248
|
-
const l =
|
|
248
|
+
const l = Fe(), $ = $e(
|
|
249
249
|
// 基础:默认主题 + useTheme的配置
|
|
250
|
-
$e({ theme:
|
|
250
|
+
$e({ theme: B, mode: "light" }, l),
|
|
251
251
|
// 最高层:用户手动传入的styles
|
|
252
|
-
|
|
253
|
-
), [
|
|
252
|
+
O
|
|
253
|
+
), [H, P] = ie(null), [te, a] = ie(null), T = () => b === "multiple" ? d || [] : p || (e.length > 0 ? e[0].id : null), [w, V] = ie(
|
|
254
254
|
b === "single" ? T() : null
|
|
255
|
-
), [
|
|
255
|
+
), [_, E] = ie(
|
|
256
256
|
b === "multiple" ? T() : []
|
|
257
|
-
),
|
|
258
|
-
|
|
259
|
-
const
|
|
260
|
-
|
|
261
|
-
targets:
|
|
257
|
+
), j = Te(null), ee = Te([]), Z = (G) => {
|
|
258
|
+
P(G), a(G);
|
|
259
|
+
const C = ee.current[G];
|
|
260
|
+
C && zr({
|
|
261
|
+
targets: C,
|
|
262
262
|
scale: s,
|
|
263
263
|
duration: 200,
|
|
264
264
|
easing: "easeOutCubic"
|
|
265
265
|
});
|
|
266
|
-
},
|
|
267
|
-
|
|
268
|
-
const
|
|
269
|
-
|
|
270
|
-
targets:
|
|
266
|
+
}, W = (G) => {
|
|
267
|
+
P(null), a(null);
|
|
268
|
+
const C = ee.current[G];
|
|
269
|
+
C && zr({
|
|
270
|
+
targets: C,
|
|
271
271
|
scale: 1,
|
|
272
272
|
duration: 200,
|
|
273
273
|
easing: "easeOutCubic"
|
|
274
274
|
});
|
|
275
|
-
},
|
|
275
|
+
}, re = (G, C) => {
|
|
276
276
|
if (b === "single")
|
|
277
|
-
|
|
277
|
+
w !== G.id && (V(G.id), N && N(G.id, G));
|
|
278
278
|
else {
|
|
279
|
-
const y =
|
|
280
|
-
if (
|
|
281
|
-
const x = e.filter((
|
|
282
|
-
|
|
279
|
+
const y = _.includes(G.id) ? _.filter((x) => x !== G.id) : [..._, G.id];
|
|
280
|
+
if (E(y), F) {
|
|
281
|
+
const x = e.filter((z) => y.includes(z.id));
|
|
282
|
+
F(y, x);
|
|
283
283
|
}
|
|
284
284
|
}
|
|
285
|
-
|
|
285
|
+
f && f(G, C), G.onClick && G.onClick();
|
|
286
286
|
};
|
|
287
287
|
return we(() => {
|
|
288
|
-
|
|
288
|
+
ee.current = ee.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:
|
|
295
|
+
theme: $.theme || B,
|
|
296
296
|
className: M,
|
|
297
|
-
children: e.map((G,
|
|
298
|
-
|
|
297
|
+
children: e.map((G, C) => /* @__PURE__ */ L(
|
|
298
|
+
Ca,
|
|
299
299
|
{
|
|
300
|
-
ref: (y) =>
|
|
300
|
+
ref: (y) => ee.current[C] = y,
|
|
301
301
|
itemWidth: r,
|
|
302
302
|
itemHeight: t,
|
|
303
303
|
itemGap: h,
|
|
304
|
-
isHovered:
|
|
304
|
+
isHovered: H === C,
|
|
305
305
|
magnification: s,
|
|
306
|
-
onMouseEnter: () =>
|
|
307
|
-
onMouseLeave: () =>
|
|
308
|
-
onClick: () =>
|
|
306
|
+
onMouseEnter: () => Z(C),
|
|
307
|
+
onMouseLeave: () => W(C),
|
|
308
|
+
onClick: () => re(G, C),
|
|
309
309
|
children: [
|
|
310
310
|
/* @__PURE__ */ o(
|
|
311
|
-
|
|
311
|
+
Ma,
|
|
312
312
|
{
|
|
313
313
|
src: G.icon,
|
|
314
314
|
alt: G.label,
|
|
315
|
-
isActive: b === "single" ?
|
|
315
|
+
isActive: b === "single" ? w === G.id : _.includes(G.id)
|
|
316
316
|
}
|
|
317
317
|
),
|
|
318
318
|
/* @__PURE__ */ o(
|
|
319
|
-
|
|
319
|
+
Ta,
|
|
320
320
|
{
|
|
321
|
-
isActive: b === "single" ?
|
|
322
|
-
theme:
|
|
321
|
+
isActive: b === "single" ? w === G.id : _.includes(G.id),
|
|
322
|
+
theme: $.theme || B
|
|
323
323
|
}
|
|
324
324
|
),
|
|
325
325
|
/* @__PURE__ */ o(
|
|
326
|
-
|
|
326
|
+
Fa,
|
|
327
327
|
{
|
|
328
|
-
visible:
|
|
329
|
-
theme:
|
|
328
|
+
visible: te === C,
|
|
329
|
+
theme: $.theme || B,
|
|
330
330
|
children: G.label
|
|
331
331
|
}
|
|
332
332
|
)
|
|
@@ -336,76 +336,84 @@ const la = 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
|
+
}, jr = () => 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
|
-
return r.forEach((
|
|
346
|
-
const d =
|
|
347
|
-
d && (s.includes(d.toLowerCase()) && !t[d] && (t[d] = e.name), h.includes(d.toLowerCase()) && !t[d] && (t[d] =
|
|
345
|
+
return r.forEach((p) => {
|
|
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] = sa(e.size)), b.includes(d.toLowerCase()) && !t[d] && (t[d] = e.type));
|
|
348
348
|
}), t;
|
|
349
|
-
},
|
|
350
|
-
var
|
|
351
|
-
const d = new XMLHttpRequest(),
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
349
|
+
}, za = async (e, r, t = {}, s = {}, h) => new Promise((b, p) => {
|
|
350
|
+
var O;
|
|
351
|
+
const d = new XMLHttpRequest(), f = /^https?:\/\//i.test(r);
|
|
352
|
+
let N;
|
|
353
|
+
if (f) {
|
|
354
|
+
const l = new URL(r);
|
|
355
|
+
Object.entries(s).forEach(([$, H]) => {
|
|
356
|
+
l.searchParams.append($, H);
|
|
357
|
+
}), N = l.toString();
|
|
358
|
+
} else {
|
|
359
|
+
const l = Object.entries(s).map(([$, H]) => `${encodeURIComponent($)}=${encodeURIComponent(H)}`).join("&");
|
|
360
|
+
N = l ? `${r}${r.includes("?") ? "&" : "?"}${l}` : r;
|
|
361
|
+
}
|
|
362
|
+
if ((O = t["Content-Type"]) == null ? void 0 : O.includes("application/json")) {
|
|
363
|
+
const l = new FileReader();
|
|
364
|
+
l.onload = () => {
|
|
365
|
+
const $ = l.result, H = JSON.stringify({
|
|
366
|
+
file: $.split(",")[1]
|
|
359
367
|
// 移除 data:application/octet-stream;base64, 前缀
|
|
360
368
|
});
|
|
361
|
-
|
|
362
|
-
},
|
|
369
|
+
M(H);
|
|
370
|
+
}, l.onerror = () => p(new Error("文件读取失败")), l.readAsDataURL(e);
|
|
363
371
|
} else {
|
|
364
|
-
const
|
|
365
|
-
|
|
372
|
+
const l = new FormData();
|
|
373
|
+
l.append("tableFile", e), M(l);
|
|
366
374
|
}
|
|
367
|
-
function
|
|
368
|
-
d.upload.addEventListener("progress", (
|
|
369
|
-
if (
|
|
370
|
-
const
|
|
371
|
-
h == null || h(
|
|
375
|
+
function M(l) {
|
|
376
|
+
d.upload.addEventListener("progress", ($) => {
|
|
377
|
+
if ($.lengthComputable) {
|
|
378
|
+
const H = Math.round($.loaded / $.total * 100);
|
|
379
|
+
h == null || h(H);
|
|
372
380
|
}
|
|
373
381
|
}), d.addEventListener("load", () => {
|
|
374
382
|
if (d.status >= 200 && d.status < 300)
|
|
375
383
|
try {
|
|
376
|
-
const
|
|
377
|
-
|
|
384
|
+
const $ = JSON.parse(d.responseText);
|
|
385
|
+
$.data ? b($.data) : b(d.responseText);
|
|
378
386
|
} catch {
|
|
379
387
|
b(d.responseText);
|
|
380
388
|
}
|
|
381
389
|
else {
|
|
382
390
|
console.log("====xhr.responseText", d.responseText);
|
|
383
|
-
let
|
|
391
|
+
let $ = "";
|
|
384
392
|
try {
|
|
385
|
-
const
|
|
386
|
-
|
|
393
|
+
const P = JSON.parse(d.responseText);
|
|
394
|
+
P.errorMsg ? $ = P.errorMsg : P.message ? $ = P.message : P.error ? $ = P.error : $ = `上传失败: ${d.status} ${d.statusText}`;
|
|
387
395
|
} catch {
|
|
388
|
-
|
|
396
|
+
$ = `上传失败: ${d.status} ${d.statusText}`;
|
|
389
397
|
}
|
|
390
|
-
const
|
|
391
|
-
|
|
398
|
+
const H = new Error($);
|
|
399
|
+
H.response = {
|
|
392
400
|
status: d.status,
|
|
393
401
|
statusText: d.statusText,
|
|
394
402
|
data: d.responseText ? JSON.parse(d.responseText) : null,
|
|
395
403
|
headers: d.getAllResponseHeaders()
|
|
396
|
-
},
|
|
404
|
+
}, p(H);
|
|
397
405
|
}
|
|
398
406
|
}), d.addEventListener("error", () => {
|
|
399
|
-
const
|
|
400
|
-
|
|
407
|
+
const $ = new Error("网络错误,上传失败");
|
|
408
|
+
$.request = d, $.type = "network", p($);
|
|
401
409
|
}), d.addEventListener("timeout", () => {
|
|
402
|
-
const
|
|
403
|
-
|
|
404
|
-
}), d.open("POST",
|
|
405
|
-
d.setRequestHeader(
|
|
406
|
-
}), d.send(
|
|
410
|
+
const $ = new Error("请求超时,上传失败");
|
|
411
|
+
$.request = d, $.type = "timeout", p($);
|
|
412
|
+
}), d.open("POST", N), Object.entries(t).forEach(([$, H]) => {
|
|
413
|
+
d.setRequestHeader($, H);
|
|
414
|
+
}), d.send(l);
|
|
407
415
|
}
|
|
408
|
-
}),
|
|
416
|
+
}), Aa = J.div`
|
|
409
417
|
border: 2px dashed ${(e) => {
|
|
410
418
|
var r, t, s, h;
|
|
411
419
|
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 +444,14 @@ const la = J.div`
|
|
|
436
444
|
return ((t = (r = e.$theme) == null ? void 0 : r.colors) == null ? void 0 : t.background) || "#f8f9fa";
|
|
437
445
|
}};
|
|
438
446
|
}
|
|
439
|
-
`,
|
|
447
|
+
`, _a = J.div`
|
|
440
448
|
color: ${(e) => {
|
|
441
449
|
var r, t;
|
|
442
450
|
return ((t = (r = e.$theme) == null ? void 0 : r.colors) == null ? void 0 : t.primary) || "#007bff";
|
|
443
451
|
}};
|
|
444
452
|
font-size: 48px;
|
|
445
453
|
margin-bottom: 8px;
|
|
446
|
-
`,
|
|
454
|
+
`, Ba = J.div`
|
|
447
455
|
color: ${(e) => {
|
|
448
456
|
var r, t;
|
|
449
457
|
return ((t = (r = e.$theme) == null ? void 0 : r.colors) == null ? void 0 : t.text) || "#343a40";
|
|
@@ -451,19 +459,19 @@ const la = J.div`
|
|
|
451
459
|
font-size: 16px;
|
|
452
460
|
font-weight: 500;
|
|
453
461
|
margin-bottom: 4px;
|
|
454
|
-
`,
|
|
462
|
+
`, Or = J.div`
|
|
455
463
|
color: ${(e) => {
|
|
456
464
|
var r, t, s, h;
|
|
457
465
|
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
466
|
}};
|
|
459
467
|
font-size: 14px;
|
|
460
|
-
`,
|
|
468
|
+
`, Wa = J.input`
|
|
461
469
|
display: none;
|
|
462
|
-
`,
|
|
470
|
+
`, Ra = J.div`
|
|
463
471
|
|
|
464
472
|
width: 100%;
|
|
465
473
|
max-width: 600px;
|
|
466
|
-
`,
|
|
474
|
+
`, qa = J.div.attrs({
|
|
467
475
|
className: "upload-item"
|
|
468
476
|
})`
|
|
469
477
|
display: flex;
|
|
@@ -490,17 +498,17 @@ const la = J.div`
|
|
|
490
498
|
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
499
|
}};
|
|
492
500
|
}
|
|
493
|
-
`,
|
|
501
|
+
`, La = J.div`
|
|
494
502
|
color: ${(e) => {
|
|
495
503
|
var r, t;
|
|
496
504
|
return ((t = (r = e.$theme) == null ? void 0 : r.colors) == null ? void 0 : t.primary) || "#007bff";
|
|
497
505
|
}};
|
|
498
506
|
margin-right: 12px;
|
|
499
507
|
flex-shrink: 0;
|
|
500
|
-
`,
|
|
508
|
+
`, ja = J.div`
|
|
501
509
|
flex: 1;
|
|
502
510
|
min-width: 0;
|
|
503
|
-
`,
|
|
511
|
+
`, Oa = J.div`
|
|
504
512
|
color: ${(e) => {
|
|
505
513
|
var r, t;
|
|
506
514
|
return ((t = (r = e.$theme) == null ? void 0 : r.colors) == null ? void 0 : t.text) || "#343a40";
|
|
@@ -511,13 +519,13 @@ const la = J.div`
|
|
|
511
519
|
white-space: nowrap;
|
|
512
520
|
overflow: hidden;
|
|
513
521
|
text-overflow: ellipsis;
|
|
514
|
-
`,
|
|
522
|
+
`, Ha = J.div`
|
|
515
523
|
color: ${(e) => {
|
|
516
524
|
var r, t, s, h;
|
|
517
525
|
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
526
|
}};
|
|
519
527
|
font-size: 10px;
|
|
520
|
-
`,
|
|
528
|
+
`, Ya = J.div`
|
|
521
529
|
width: 100%;
|
|
522
530
|
height: 4px;
|
|
523
531
|
background: ${(e) => {
|
|
@@ -542,25 +550,25 @@ const la = J.div`
|
|
|
542
550
|
}};
|
|
543
551
|
transition: width 0.3s ease;
|
|
544
552
|
}
|
|
545
|
-
`,
|
|
553
|
+
`, Ia = J.div`
|
|
546
554
|
margin-left: 12px;
|
|
547
555
|
flex-shrink: 0;
|
|
548
556
|
color: ${(e) => {
|
|
549
|
-
var r, t, s, h, b,
|
|
557
|
+
var r, t, s, h, b, p, d, f, N, F;
|
|
550
558
|
switch (e.$status) {
|
|
551
559
|
case "success":
|
|
552
560
|
return ((t = (r = e.$theme) == null ? void 0 : r.colors) == null ? void 0 : t.success) || "#008000";
|
|
553
561
|
case "error":
|
|
554
562
|
return ((h = (s = e.$theme) == null ? void 0 : s.colors) == null ? void 0 : h.error) || "#FF0000";
|
|
555
563
|
case "uploading":
|
|
556
|
-
return ((
|
|
564
|
+
return ((p = (b = e.$theme) == null ? void 0 : b.colors) == null ? void 0 : p.primary) || "#007bff";
|
|
557
565
|
case "pending":
|
|
558
|
-
return ((
|
|
566
|
+
return ((f = (d = e.$theme) == null ? void 0 : d.colors) == null ? void 0 : f.warning) || "#FFA500";
|
|
559
567
|
default:
|
|
560
|
-
return ((
|
|
568
|
+
return ((F = (N = e.$theme) == null ? void 0 : N.colors) == null ? void 0 : F.disabledText) || "#808080";
|
|
561
569
|
}
|
|
562
570
|
}};
|
|
563
|
-
`,
|
|
571
|
+
`, Ua = J.button`
|
|
564
572
|
background: none;
|
|
565
573
|
border: none;
|
|
566
574
|
color: ${(e) => {
|
|
@@ -635,7 +643,7 @@ J.button`
|
|
|
635
643
|
}}20;
|
|
636
644
|
}
|
|
637
645
|
`;
|
|
638
|
-
const
|
|
646
|
+
const Va = J.div`
|
|
639
647
|
padding: 0px;
|
|
640
648
|
background: ${(e) => {
|
|
641
649
|
var r, t;
|
|
@@ -696,7 +704,7 @@ J.input`
|
|
|
696
704
|
}};
|
|
697
705
|
}
|
|
698
706
|
`;
|
|
699
|
-
const
|
|
707
|
+
const Ea = J.div`
|
|
700
708
|
/* 基础样式 */
|
|
701
709
|
margin-top: 5px;
|
|
702
710
|
background: ${(e) => {
|
|
@@ -739,12 +747,12 @@ const Da = J.div`
|
|
|
739
747
|
min-height: 32px !important;
|
|
740
748
|
}
|
|
741
749
|
`;
|
|
742
|
-
function
|
|
743
|
-
return e.label ? /* @__PURE__ */
|
|
750
|
+
function le(e) {
|
|
751
|
+
return e.label ? /* @__PURE__ */ L("div", { className: "flex items-center gap-2", children: [
|
|
744
752
|
/* @__PURE__ */ o("span", { className: "font-medium text-gray-800 text-sm", children: e.label }),
|
|
745
753
|
e.required && /* @__PURE__ */ o("span", { className: "text-red-500 font-bold text-sm", children: "*" }),
|
|
746
|
-
(e.helpText || e.description) && /* @__PURE__ */ o(
|
|
747
|
-
|
|
754
|
+
(e.helpText || e.description) && /* @__PURE__ */ o(cr, { title: e.helpText || e.description, placement: "top", children: /* @__PURE__ */ o(
|
|
755
|
+
oa,
|
|
748
756
|
{
|
|
749
757
|
className: "text-gray-400 hover:text-gray-600 cursor-help transition-colors",
|
|
750
758
|
size: 14
|
|
@@ -752,12 +760,12 @@ function ce(e) {
|
|
|
752
760
|
) })
|
|
753
761
|
] }) : null;
|
|
754
762
|
}
|
|
755
|
-
function
|
|
756
|
-
const h = s === "sm" ? "28px" : "40px", b = s === "sm" ? "28px" : "40px",
|
|
763
|
+
function Ja(e = [], r, t = {}, s = "md") {
|
|
764
|
+
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
765
|
() => {
|
|
758
|
-
var
|
|
759
|
-
(
|
|
760
|
-
const a = ((
|
|
766
|
+
var w, V, _, E, j, ee;
|
|
767
|
+
(V = (w = r == null ? void 0 : r.theme) == null ? void 0 : w.colors) != null && V.border;
|
|
768
|
+
const a = ((E = (_ = r == null ? void 0 : r.theme) == null ? void 0 : _.colors) == null ? void 0 : E.primary) || "#3b82f6", T = ((ee = (j = r == null ? void 0 : r.theme) == null ? void 0 : j.colors) == null ? void 0 : ee.textSecondary) || "#9ca3af";
|
|
761
769
|
return `
|
|
762
770
|
.dynamic-form .ant-form-item-label > label {
|
|
763
771
|
height: auto !important;
|
|
@@ -765,7 +773,7 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
765
773
|
margin-bottom: ${s === "sm" ? "6px" : "8px"} !important;
|
|
766
774
|
font-weight: 500 !important;
|
|
767
775
|
color: #374151 !important;
|
|
768
|
-
font-size: ${
|
|
776
|
+
font-size: ${f} !important;
|
|
769
777
|
}
|
|
770
778
|
.dynamic-form .ant-form-item {
|
|
771
779
|
margin-bottom: ${d} !important;
|
|
@@ -795,8 +803,8 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
795
803
|
transition: all 0.2s !important;
|
|
796
804
|
|
|
797
805
|
line-height: ${b} !important;
|
|
798
|
-
padding: ${
|
|
799
|
-
font-size: ${
|
|
806
|
+
padding: ${p} !important;
|
|
807
|
+
font-size: ${f} !important;
|
|
800
808
|
}
|
|
801
809
|
|
|
802
810
|
/* smooth show/hide for controlled items */
|
|
@@ -814,8 +822,8 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
814
822
|
.dynamic-form .ant-input-number,
|
|
815
823
|
.dynamic-form .ant-picker {
|
|
816
824
|
line-height: ${b} !important;
|
|
817
|
-
padding: ${
|
|
818
|
-
font-size: ${
|
|
825
|
+
padding: ${p} !important;
|
|
826
|
+
font-size: ${f} !important;
|
|
819
827
|
}
|
|
820
828
|
|
|
821
829
|
.dynamic-form .ant-input{
|
|
@@ -838,7 +846,7 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
838
846
|
border-radius: 6px !important;
|
|
839
847
|
border: 1px solid #d1d5db !important;
|
|
840
848
|
transition: all 0.2s !important;
|
|
841
|
-
font-size: ${
|
|
849
|
+
font-size: ${f} !important;
|
|
842
850
|
}
|
|
843
851
|
|
|
844
852
|
/* 密码框样式修复 */
|
|
@@ -856,7 +864,7 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
856
864
|
.dynamic-form .ant-input-password .ant-input {
|
|
857
865
|
height: ${s === "sm" ? "26px" : "38px"} !important;
|
|
858
866
|
line-height: ${s === "sm" ? "26px" : "38px"} !important;
|
|
859
|
-
padding: ${
|
|
867
|
+
padding: ${p} !important;
|
|
860
868
|
border: none !important;
|
|
861
869
|
background: transparent !important;
|
|
862
870
|
}
|
|
@@ -914,75 +922,75 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
914
922
|
}
|
|
915
923
|
`;
|
|
916
924
|
},
|
|
917
|
-
[s, h, b,
|
|
925
|
+
[s, h, b, p, d, f, r]
|
|
918
926
|
);
|
|
919
|
-
|
|
927
|
+
me.useEffect(() => {
|
|
920
928
|
const a = document.createElement("style");
|
|
921
929
|
return a.textContent = N, document.head.appendChild(a), () => {
|
|
922
930
|
document.head.removeChild(a);
|
|
923
931
|
};
|
|
924
932
|
}, [N]);
|
|
925
|
-
const [
|
|
933
|
+
const [F, M] = me.useState(() => {
|
|
926
934
|
const a = {};
|
|
927
935
|
return e.forEach((T) => {
|
|
928
936
|
T.name && (T.type === "switch" ? a[T.name] = t[T.name] ?? T.defaultValue ?? !1 : ["select", "radio", "checkbox"].includes(T.type) && (a[T.name] = t[T.name] ?? T.defaultValue ?? (T.type === "checkbox" ? [] : "")));
|
|
929
937
|
}), a;
|
|
930
|
-
}),
|
|
931
|
-
|
|
932
|
-
r && r.formInstance && !
|
|
938
|
+
}), O = me.useRef();
|
|
939
|
+
me.useEffect(() => {
|
|
940
|
+
r && r.formInstance && !O.current && (O.current = r.formInstance);
|
|
933
941
|
}, [r]);
|
|
934
|
-
const l = (a, T,
|
|
935
|
-
var
|
|
936
|
-
if (M((
|
|
937
|
-
let
|
|
938
|
-
if (Array.isArray(
|
|
939
|
-
|
|
940
|
-
else if (typeof
|
|
941
|
-
const
|
|
942
|
-
Object.keys(
|
|
943
|
-
|
|
944
|
-
|
|
942
|
+
const l = (a, T, w) => {
|
|
943
|
+
var V;
|
|
944
|
+
if (M((_) => ({ ..._, [a]: T })), O.current && w) {
|
|
945
|
+
let _ = [];
|
|
946
|
+
if (Array.isArray(w))
|
|
947
|
+
_ = w;
|
|
948
|
+
else if (typeof w == "object") {
|
|
949
|
+
const E = String(T);
|
|
950
|
+
Object.keys(w).forEach((j) => {
|
|
951
|
+
j !== E && w[j].forEach((ee) => {
|
|
952
|
+
ee && O.current.setFieldsValue({ [ee]: void 0 });
|
|
945
953
|
});
|
|
946
954
|
});
|
|
947
955
|
}
|
|
948
|
-
Array.isArray(
|
|
949
|
-
|
|
956
|
+
Array.isArray(w) && ((V = e.find((j) => j.name === a)) == null ? void 0 : V.type) === "switch" && !T && _.forEach((j) => {
|
|
957
|
+
j && O.current.setFieldsValue({ [j]: void 0 });
|
|
950
958
|
});
|
|
951
959
|
}
|
|
952
|
-
},
|
|
960
|
+
}, $ = /* @__PURE__ */ new Set(), H = (() => {
|
|
953
961
|
var a, T;
|
|
954
962
|
try {
|
|
955
963
|
return ((T = (a = r == null ? void 0 : r.formInstance) == null ? void 0 : a.getFieldsValue) == null ? void 0 : T.call(a)) || {};
|
|
956
964
|
} catch {
|
|
957
965
|
return {};
|
|
958
966
|
}
|
|
959
|
-
})(),
|
|
967
|
+
})(), P = (a) => {
|
|
960
968
|
a.forEach((T) => {
|
|
961
969
|
if (!T) return;
|
|
962
970
|
if (T.controlledItems && T.name) {
|
|
963
|
-
const
|
|
971
|
+
const V = F[T.name];
|
|
964
972
|
if (Array.isArray(T.controlledItems))
|
|
965
|
-
T.type === "switch" &&
|
|
966
|
-
|
|
973
|
+
T.type === "switch" && V === !1 && T.controlledItems.forEach((_) => {
|
|
974
|
+
_ && $.add(_);
|
|
967
975
|
});
|
|
968
976
|
else if (typeof T.controlledItems == "object") {
|
|
969
|
-
const
|
|
970
|
-
Object.values(T.controlledItems).forEach((
|
|
971
|
-
(
|
|
977
|
+
const _ = /* @__PURE__ */ new Set();
|
|
978
|
+
Object.values(T.controlledItems).forEach((ee) => {
|
|
979
|
+
(ee || []).forEach((Z) => Z && _.add(Z));
|
|
972
980
|
});
|
|
973
|
-
const
|
|
974
|
-
|
|
975
|
-
|
|
981
|
+
const E = String(V ?? ""), j = new Set((T.controlledItems[E] || []).filter(Boolean));
|
|
982
|
+
_.forEach((ee) => {
|
|
983
|
+
j.has(ee) || $.add(ee);
|
|
976
984
|
});
|
|
977
985
|
}
|
|
978
986
|
}
|
|
979
|
-
(typeof T.hidden == "function" ? T.hidden(
|
|
987
|
+
(typeof T.hidden == "function" ? T.hidden(H) : T.hidden === !0) && T.name && $.add(T.name), T.type === "col" && Array.isArray(T.children) && P(T.children);
|
|
980
988
|
});
|
|
981
989
|
};
|
|
982
|
-
|
|
983
|
-
const
|
|
984
|
-
var
|
|
985
|
-
if (a.name &&
|
|
990
|
+
P(e);
|
|
991
|
+
const te = e.map((a, T) => {
|
|
992
|
+
var w, V, _, E, j, ee, Z, W, re, G, C, y, x, z, k, q, R, Q, X, S, Y, I;
|
|
993
|
+
if (a.name && $.has(a.name)) return null;
|
|
986
994
|
if (a.type === "divider")
|
|
987
995
|
return /* @__PURE__ */ o(
|
|
988
996
|
"div",
|
|
@@ -1007,7 +1015,7 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
1007
1015
|
fontWeight: i === 1 ? 700 : i === 2 ? 600 : 500,
|
|
1008
1016
|
animationDelay: `${T * 30}ms`
|
|
1009
1017
|
},
|
|
1010
|
-
children: /* @__PURE__ */
|
|
1018
|
+
children: /* @__PURE__ */ L("div", { className: "flex items-center", children: [
|
|
1011
1019
|
/* @__PURE__ */ o("span", { className: "mr-3", children: a.label }),
|
|
1012
1020
|
/* @__PURE__ */ o(
|
|
1013
1021
|
"div",
|
|
@@ -1027,12 +1035,12 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
1027
1035
|
}
|
|
1028
1036
|
if (a.type === "col") {
|
|
1029
1037
|
if (!a.children || a.children.length === 0) return null;
|
|
1030
|
-
const i = (n,
|
|
1031
|
-
var ye,
|
|
1032
|
-
const
|
|
1033
|
-
if (n.name &&
|
|
1038
|
+
const i = (n, A) => {
|
|
1039
|
+
var ye, De, ze, Ae, _e, Be, We, Re, qe, Le, je, Oe, He, Ye, Ie, Ue, Ve, Ee, Je, Ge, Ke, Xe;
|
|
1040
|
+
const D = typeof n.hidden == "function" ? n.hidden(H) : n.hidden === !0;
|
|
1041
|
+
if (n.name && $.has(n.name) || D) return null;
|
|
1034
1042
|
const m = {
|
|
1035
|
-
label: n.label ?
|
|
1043
|
+
label: n.label ? le(n) : void 0,
|
|
1036
1044
|
name: n.name,
|
|
1037
1045
|
rules: n.name ? [
|
|
1038
1046
|
{
|
|
@@ -1041,11 +1049,11 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
1041
1049
|
}
|
|
1042
1050
|
] : void 0,
|
|
1043
1051
|
className: "mb-6 df-stagger",
|
|
1044
|
-
style: { animationDelay: `${
|
|
1052
|
+
style: { animationDelay: `${A * 30}ms` },
|
|
1045
1053
|
labelCol: { span: 24 },
|
|
1046
1054
|
wrapperCol: { span: 24 },
|
|
1047
1055
|
required: !1
|
|
1048
|
-
}, g = n.name || n.id || `form-item-${
|
|
1056
|
+
}, g = n.name || n.id || `form-item-${A}`, ae = `${n.className || ""} ${s === "sm" ? "h-7" : "h-10"}`;
|
|
1049
1057
|
switch (n.type) {
|
|
1050
1058
|
case "divider":
|
|
1051
1059
|
return /* @__PURE__ */ o(
|
|
@@ -1053,75 +1061,75 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
1053
1061
|
{
|
|
1054
1062
|
className: "my-3 border-b border-solid border-gray-200"
|
|
1055
1063
|
},
|
|
1056
|
-
n.name || n.id || `divider-${
|
|
1064
|
+
n.name || n.id || `divider-${A}`
|
|
1057
1065
|
);
|
|
1058
1066
|
case "input":
|
|
1059
1067
|
return /* @__PURE__ */ o(K.Item, { ...m, children: /* @__PURE__ */ o(
|
|
1060
|
-
|
|
1068
|
+
fe,
|
|
1061
1069
|
{
|
|
1062
1070
|
placeholder: n.placeholder,
|
|
1063
1071
|
disabled: n.disabled,
|
|
1064
|
-
className:
|
|
1072
|
+
className: ae
|
|
1065
1073
|
}
|
|
1066
1074
|
) }, g);
|
|
1067
1075
|
case "select":
|
|
1068
1076
|
return /* @__PURE__ */ o(K.Item, { ...m, children: /* @__PURE__ */ o(
|
|
1069
|
-
|
|
1077
|
+
tr,
|
|
1070
1078
|
{
|
|
1071
1079
|
placeholder: n.placeholder,
|
|
1072
1080
|
disabled: n.disabled,
|
|
1073
|
-
className:
|
|
1074
|
-
value:
|
|
1075
|
-
onChange: (
|
|
1076
|
-
children: (ye = n.options) == null ? void 0 : ye.map((
|
|
1081
|
+
className: ae,
|
|
1082
|
+
value: F[n.name || ""],
|
|
1083
|
+
onChange: (pe) => l(n.name || "", pe, n.controlledItems),
|
|
1084
|
+
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
1085
|
}
|
|
1078
1086
|
) }, g);
|
|
1079
1087
|
case "number":
|
|
1080
1088
|
return /* @__PURE__ */ o(K.Item, { ...m, children: /* @__PURE__ */ o(
|
|
1081
|
-
|
|
1089
|
+
nr,
|
|
1082
1090
|
{
|
|
1083
1091
|
addonAfter: n.unit ? /* @__PURE__ */ o("span", { className: "text-[10px] text-gray-300", children: n.unit }) : null,
|
|
1084
|
-
min: (
|
|
1085
|
-
max: (
|
|
1092
|
+
min: (De = n.range) == null ? void 0 : De.min,
|
|
1093
|
+
max: (ze = n.range) == null ? void 0 : ze.max,
|
|
1086
1094
|
step: n.step,
|
|
1087
1095
|
placeholder: n.placeholder,
|
|
1088
1096
|
disabled: n.disabled,
|
|
1089
|
-
className:
|
|
1097
|
+
className: ae,
|
|
1090
1098
|
style: { width: "100%" }
|
|
1091
1099
|
}
|
|
1092
1100
|
) }, g);
|
|
1093
1101
|
case "password":
|
|
1094
1102
|
return /* @__PURE__ */ o(K.Item, { ...m, children: /* @__PURE__ */ o(
|
|
1095
|
-
|
|
1103
|
+
fe.Password,
|
|
1096
1104
|
{
|
|
1097
1105
|
placeholder: n.placeholder,
|
|
1098
1106
|
disabled: n.disabled,
|
|
1099
|
-
className:
|
|
1107
|
+
className: ae
|
|
1100
1108
|
}
|
|
1101
1109
|
) }, g);
|
|
1102
1110
|
case "textarea":
|
|
1103
1111
|
return /* @__PURE__ */ o(K.Item, { ...m, children: /* @__PURE__ */ o(
|
|
1104
|
-
|
|
1112
|
+
fe.TextArea,
|
|
1105
1113
|
{
|
|
1106
1114
|
placeholder: n.placeholder,
|
|
1107
1115
|
disabled: n.disabled,
|
|
1108
|
-
className:
|
|
1116
|
+
className: ae,
|
|
1109
1117
|
rows: s === "sm" ? 3 : 4
|
|
1110
1118
|
}
|
|
1111
1119
|
) }, g);
|
|
1112
1120
|
case "date":
|
|
1113
1121
|
return /* @__PURE__ */ o(K.Item, { ...m, children: /* @__PURE__ */ o(
|
|
1114
|
-
|
|
1122
|
+
or,
|
|
1115
1123
|
{
|
|
1116
1124
|
placeholder: n.placeholder,
|
|
1117
1125
|
disabled: n.disabled,
|
|
1118
|
-
className:
|
|
1126
|
+
className: ae,
|
|
1119
1127
|
style: { width: "100%" }
|
|
1120
1128
|
}
|
|
1121
1129
|
) }, g);
|
|
1122
1130
|
case "radio":
|
|
1123
1131
|
return /* @__PURE__ */ o(K.Item, { ...m, children: /* @__PURE__ */ o(
|
|
1124
|
-
|
|
1132
|
+
Wr.Group,
|
|
1125
1133
|
{
|
|
1126
1134
|
options: n.options,
|
|
1127
1135
|
disabled: n.disabled,
|
|
@@ -1137,14 +1145,14 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
1137
1145
|
className: "mb-6",
|
|
1138
1146
|
labelCol: { span: 24 },
|
|
1139
1147
|
wrapperCol: { span: 24 },
|
|
1140
|
-
children: /* @__PURE__ */
|
|
1141
|
-
/* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: n.label ?
|
|
1148
|
+
children: /* @__PURE__ */ L("div", { className: "flex items-center justify-between", children: [
|
|
1149
|
+
/* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: n.label ? le(n) : null }),
|
|
1142
1150
|
/* @__PURE__ */ o(K.Item, { name: n.name, valuePropName: "checked", noStyle: !0, children: /* @__PURE__ */ o(
|
|
1143
|
-
|
|
1151
|
+
Br,
|
|
1144
1152
|
{
|
|
1145
1153
|
disabled: n.disabled,
|
|
1146
|
-
checked:
|
|
1147
|
-
onChange: (
|
|
1154
|
+
checked: F[n.name || ""],
|
|
1155
|
+
onChange: (pe) => l(n.name || "", pe, n.controlledItems)
|
|
1148
1156
|
}
|
|
1149
1157
|
) })
|
|
1150
1158
|
] })
|
|
@@ -1152,14 +1160,14 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
1152
1160
|
n.name || `switch-${Math.random()}`
|
|
1153
1161
|
);
|
|
1154
1162
|
case "slider":
|
|
1155
|
-
return /* @__PURE__ */
|
|
1156
|
-
/* @__PURE__ */
|
|
1157
|
-
/* @__PURE__ */ o("div", { className: "flex items-center", children: n.label ?
|
|
1158
|
-
/* @__PURE__ */
|
|
1163
|
+
return /* @__PURE__ */ L("div", { className: "mb-6", children: [
|
|
1164
|
+
/* @__PURE__ */ L("div", { className: "flex items-center justify-between mb-3", children: [
|
|
1165
|
+
/* @__PURE__ */ o("div", { className: "flex items-center", children: n.label ? le(n) : null }),
|
|
1166
|
+
/* @__PURE__ */ L("div", { className: "flex items-center gap-2", children: [
|
|
1159
1167
|
/* @__PURE__ */ o(K.Item, { name: n.name, noStyle: !0, children: /* @__PURE__ */ o(
|
|
1160
|
-
|
|
1168
|
+
nr,
|
|
1161
1169
|
{
|
|
1162
|
-
min: (
|
|
1170
|
+
min: (Ae = n.range) == null ? void 0 : Ae.min,
|
|
1163
1171
|
max: (_e = n.range) == null ? void 0 : _e.max,
|
|
1164
1172
|
step: n.step,
|
|
1165
1173
|
disabled: n.disabled,
|
|
@@ -1170,9 +1178,9 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
1170
1178
|
] })
|
|
1171
1179
|
] }),
|
|
1172
1180
|
/* @__PURE__ */ o(K.Item, { name: n.name, noStyle: !0, children: /* @__PURE__ */ o(
|
|
1173
|
-
|
|
1181
|
+
_r,
|
|
1174
1182
|
{
|
|
1175
|
-
min: (
|
|
1183
|
+
min: (Be = n.range) == null ? void 0 : Be.min,
|
|
1176
1184
|
max: (We = n.range) == null ? void 0 : We.max,
|
|
1177
1185
|
step: n.step,
|
|
1178
1186
|
disabled: n.disabled,
|
|
@@ -1182,7 +1190,7 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
1182
1190
|
] }, n.name || `slider-${Math.random()}`);
|
|
1183
1191
|
case "checkbox":
|
|
1184
1192
|
return /* @__PURE__ */ o(K.Item, { ...m, children: /* @__PURE__ */ o(
|
|
1185
|
-
|
|
1193
|
+
Rr.Group,
|
|
1186
1194
|
{
|
|
1187
1195
|
options: n.options,
|
|
1188
1196
|
disabled: n.disabled,
|
|
@@ -1191,53 +1199,53 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
1191
1199
|
) }, g);
|
|
1192
1200
|
case "email":
|
|
1193
1201
|
return /* @__PURE__ */ o(K.Item, { ...m, children: /* @__PURE__ */ o(
|
|
1194
|
-
|
|
1202
|
+
fe,
|
|
1195
1203
|
{
|
|
1196
1204
|
type: "email",
|
|
1197
1205
|
placeholder: n.placeholder,
|
|
1198
1206
|
disabled: n.disabled,
|
|
1199
|
-
className:
|
|
1207
|
+
className: ae
|
|
1200
1208
|
}
|
|
1201
1209
|
) }, g);
|
|
1202
1210
|
case "time":
|
|
1203
1211
|
return /* @__PURE__ */ o(K.Item, { ...m, children: /* @__PURE__ */ o(
|
|
1204
|
-
|
|
1212
|
+
qr,
|
|
1205
1213
|
{
|
|
1206
1214
|
placeholder: n.placeholder,
|
|
1207
1215
|
disabled: n.disabled,
|
|
1208
|
-
className:
|
|
1216
|
+
className: ae,
|
|
1209
1217
|
style: { width: "100%" }
|
|
1210
1218
|
}
|
|
1211
1219
|
) }, g);
|
|
1212
1220
|
case "datetime":
|
|
1213
1221
|
return /* @__PURE__ */ o(K.Item, { ...m, children: /* @__PURE__ */ o(
|
|
1214
|
-
|
|
1222
|
+
or,
|
|
1215
1223
|
{
|
|
1216
1224
|
showTime: !0,
|
|
1217
1225
|
placeholder: n.placeholder,
|
|
1218
1226
|
disabled: n.disabled,
|
|
1219
|
-
className:
|
|
1227
|
+
className: ae,
|
|
1220
1228
|
style: { width: "100%" }
|
|
1221
1229
|
}
|
|
1222
1230
|
) }, g);
|
|
1223
1231
|
case "file":
|
|
1224
1232
|
return /* @__PURE__ */ o(K.Item, { ...m, children: /* @__PURE__ */ o(
|
|
1225
|
-
|
|
1233
|
+
fe,
|
|
1226
1234
|
{
|
|
1227
1235
|
type: "file",
|
|
1228
1236
|
placeholder: n.placeholder,
|
|
1229
1237
|
disabled: n.disabled,
|
|
1230
|
-
className:
|
|
1238
|
+
className: ae
|
|
1231
1239
|
}
|
|
1232
1240
|
) }, g);
|
|
1233
1241
|
case "color":
|
|
1234
1242
|
return /* @__PURE__ */ o(K.Item, { ...m, children: /* @__PURE__ */ o(
|
|
1235
|
-
|
|
1243
|
+
fe,
|
|
1236
1244
|
{
|
|
1237
1245
|
type: "color",
|
|
1238
1246
|
placeholder: n.placeholder,
|
|
1239
1247
|
disabled: n.disabled,
|
|
1240
|
-
className:
|
|
1248
|
+
className: ae,
|
|
1241
1249
|
style: {
|
|
1242
1250
|
width: "65px",
|
|
1243
1251
|
height: "40px",
|
|
@@ -1247,50 +1255,50 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
1247
1255
|
) }, g);
|
|
1248
1256
|
case "json":
|
|
1249
1257
|
return /* @__PURE__ */ o(K.Item, { ...m, children: /* @__PURE__ */ o(
|
|
1250
|
-
|
|
1258
|
+
fe.TextArea,
|
|
1251
1259
|
{
|
|
1252
1260
|
placeholder: n.placeholder,
|
|
1253
1261
|
disabled: n.disabled,
|
|
1254
|
-
className:
|
|
1262
|
+
className: ae,
|
|
1255
1263
|
rows: 4
|
|
1256
1264
|
}
|
|
1257
1265
|
) }, g);
|
|
1258
1266
|
case "markdown":
|
|
1259
1267
|
return /* @__PURE__ */ o(K.Item, { ...m, children: /* @__PURE__ */ o(
|
|
1260
|
-
|
|
1268
|
+
fe.TextArea,
|
|
1261
1269
|
{
|
|
1262
1270
|
placeholder: n.placeholder,
|
|
1263
1271
|
disabled: n.disabled,
|
|
1264
|
-
className:
|
|
1272
|
+
className: ae,
|
|
1265
1273
|
rows: 6
|
|
1266
1274
|
}
|
|
1267
1275
|
) }, g);
|
|
1268
1276
|
case "uploader":
|
|
1269
1277
|
return /* @__PURE__ */ o(K.Item, { ...m, children: /* @__PURE__ */ o(
|
|
1270
|
-
|
|
1278
|
+
Yr,
|
|
1271
1279
|
{
|
|
1272
1280
|
multiple: ((Re = n.uploaderConfig) == null ? void 0 : Re.multiple) ?? !0,
|
|
1273
1281
|
accept: ((qe = n.uploaderConfig) == null ? void 0 : qe.accept) ?? "*/*",
|
|
1274
1282
|
maxSize: ((Le = n.uploaderConfig) == null ? void 0 : Le.maxSize) ?? 100,
|
|
1275
|
-
maxFiles: ((
|
|
1283
|
+
maxFiles: ((je = n.uploaderConfig) == null ? void 0 : je.maxFiles) ?? 10,
|
|
1276
1284
|
autoUpload: ((Oe = n.uploaderConfig) == null ? void 0 : Oe.autoUpload) ?? !0,
|
|
1277
|
-
url: (
|
|
1285
|
+
url: (He = n.uploaderConfig) == null ? void 0 : He.url,
|
|
1278
1286
|
headers: ((Ye = n.uploaderConfig) == null ? void 0 : Ye.headers) ?? {},
|
|
1279
|
-
queryParams: ((
|
|
1280
|
-
itemForm: ((
|
|
1281
|
-
buttons: ((
|
|
1282
|
-
icons: (
|
|
1283
|
-
placeholder: (
|
|
1284
|
-
listName: (
|
|
1285
|
-
errorMessages: (
|
|
1286
|
-
onRef: (
|
|
1287
|
+
queryParams: ((Ie = n.uploaderConfig) == null ? void 0 : Ie.queryParams) ?? {},
|
|
1288
|
+
itemForm: ((Ue = n.uploaderConfig) == null ? void 0 : Ue.itemForm) ?? [],
|
|
1289
|
+
buttons: ((Ve = n.uploaderConfig) == null ? void 0 : Ve.buttons) || [],
|
|
1290
|
+
icons: (Ee = n.uploaderConfig) == null ? void 0 : Ee.icons,
|
|
1291
|
+
placeholder: (Je = n.uploaderConfig) == null ? void 0 : Je.placeholder,
|
|
1292
|
+
listName: (Ge = n.uploaderConfig) == null ? void 0 : Ge.listName,
|
|
1293
|
+
errorMessages: (Ke = n.uploaderConfig) == null ? void 0 : Ke.errorMessages,
|
|
1294
|
+
onRef: (Xe = n.uploaderConfig) == null ? void 0 : Xe.onRef,
|
|
1287
1295
|
styles: r,
|
|
1288
|
-
eventsEmit: (
|
|
1296
|
+
eventsEmit: (pe, Ce) => {
|
|
1289
1297
|
if (r && typeof r.eventsEmit == "function") {
|
|
1290
|
-
const
|
|
1291
|
-
r.eventsEmit(
|
|
1298
|
+
const rr = pe.startsWith("uploader:") ? pe : `uploader:${pe}`;
|
|
1299
|
+
r.eventsEmit(rr, {
|
|
1292
1300
|
fieldName: n.name,
|
|
1293
|
-
...
|
|
1301
|
+
...Ce
|
|
1294
1302
|
});
|
|
1295
1303
|
}
|
|
1296
1304
|
}
|
|
@@ -1299,11 +1307,11 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
1299
1307
|
default:
|
|
1300
1308
|
return null;
|
|
1301
1309
|
}
|
|
1302
|
-
}, u = a.children.map((n,
|
|
1310
|
+
}, u = a.children.map((n, A) => i(n, A)), c = (n) => {
|
|
1303
1311
|
if (!a.percentage || a.percentage.length === 0)
|
|
1304
1312
|
return "flex-1";
|
|
1305
|
-
const
|
|
1306
|
-
return
|
|
1313
|
+
const A = a.percentage[n];
|
|
1314
|
+
return A && A > 0 ? `${A / 12 * 100}%` : "flex-1";
|
|
1307
1315
|
};
|
|
1308
1316
|
return /* @__PURE__ */ o(
|
|
1309
1317
|
"div",
|
|
@@ -1316,17 +1324,17 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
1316
1324
|
justifyContent: a.justify || "space-between",
|
|
1317
1325
|
alignItems: a.align || "start"
|
|
1318
1326
|
},
|
|
1319
|
-
children: u.map((n,
|
|
1327
|
+
children: u.map((n, A) => /* @__PURE__ */ o(
|
|
1320
1328
|
"div",
|
|
1321
1329
|
{
|
|
1322
1330
|
style: {
|
|
1323
|
-
width: c(
|
|
1331
|
+
width: c(A),
|
|
1324
1332
|
flex: a.percentage ? "none" : "1"
|
|
1325
1333
|
// 有比例时固定宽度,无比例时弹性
|
|
1326
1334
|
},
|
|
1327
1335
|
children: n
|
|
1328
1336
|
},
|
|
1329
|
-
`col-child-${
|
|
1337
|
+
`col-child-${A}`
|
|
1330
1338
|
))
|
|
1331
1339
|
},
|
|
1332
1340
|
a.name || `col-${Math.random()}`
|
|
@@ -1345,7 +1353,7 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
1345
1353
|
}), /* @__PURE__ */ o(
|
|
1346
1354
|
K.Item,
|
|
1347
1355
|
{
|
|
1348
|
-
label: a.label ?
|
|
1356
|
+
label: a.label ? le(a) : void 0,
|
|
1349
1357
|
name: a.name,
|
|
1350
1358
|
rules: i.length > 0 ? i : void 0,
|
|
1351
1359
|
className: "mb-6",
|
|
@@ -1353,7 +1361,7 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
1353
1361
|
wrapperCol: { span: 24 },
|
|
1354
1362
|
required: !1,
|
|
1355
1363
|
children: /* @__PURE__ */ o(
|
|
1356
|
-
|
|
1364
|
+
fe,
|
|
1357
1365
|
{
|
|
1358
1366
|
placeholder: a.placeholder,
|
|
1359
1367
|
disabled: a.disabled,
|
|
@@ -1370,7 +1378,7 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
1370
1378
|
return /* @__PURE__ */ o(
|
|
1371
1379
|
K.Item,
|
|
1372
1380
|
{
|
|
1373
|
-
label: a.label ?
|
|
1381
|
+
label: a.label ? le(a) : void 0,
|
|
1374
1382
|
name: a.name,
|
|
1375
1383
|
rules: a.name ? [{ required: a.required, message: a.error || `请选择${a.label}` }] : void 0,
|
|
1376
1384
|
className: "mb-6",
|
|
@@ -1378,14 +1386,14 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
1378
1386
|
wrapperCol: { span: 24 },
|
|
1379
1387
|
required: !1,
|
|
1380
1388
|
children: /* @__PURE__ */ o(
|
|
1381
|
-
|
|
1389
|
+
tr,
|
|
1382
1390
|
{
|
|
1383
1391
|
placeholder: a.placeholder,
|
|
1384
1392
|
disabled: a.disabled,
|
|
1385
1393
|
className: `${a.className || ""} ${s === "sm" ? "h-7" : "h-10"}`,
|
|
1386
|
-
value:
|
|
1394
|
+
value: F[a.name || ""],
|
|
1387
1395
|
onChange: (i) => l(a.name || "", i, a.controlledItems),
|
|
1388
|
-
children: (
|
|
1396
|
+
children: (w = a.options) == null ? void 0 : w.map((i, u) => /* @__PURE__ */ o(tr.Option, { value: i.value, children: i.render ? i.render() : i.label }, i.value || u))
|
|
1389
1397
|
}
|
|
1390
1398
|
)
|
|
1391
1399
|
},
|
|
@@ -1395,7 +1403,7 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
1395
1403
|
return /* @__PURE__ */ o(
|
|
1396
1404
|
K.Item,
|
|
1397
1405
|
{
|
|
1398
|
-
label: a.label ?
|
|
1406
|
+
label: a.label ? le(a) : void 0,
|
|
1399
1407
|
name: a.name,
|
|
1400
1408
|
rules: a.name ? [{ required: a.required, message: a.error || `请输入${a.label}` }] : void 0,
|
|
1401
1409
|
className: "mb-6",
|
|
@@ -1403,11 +1411,11 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
1403
1411
|
wrapperCol: { span: 24 },
|
|
1404
1412
|
required: !1,
|
|
1405
1413
|
children: /* @__PURE__ */ o(
|
|
1406
|
-
|
|
1414
|
+
nr,
|
|
1407
1415
|
{
|
|
1408
1416
|
addonAfter: a.unit ? /* @__PURE__ */ o("span", { className: "text-[10px] text-gray-300", children: a.unit }) : null,
|
|
1409
|
-
min: (
|
|
1410
|
-
max: (
|
|
1417
|
+
min: (V = a.range) == null ? void 0 : V.min,
|
|
1418
|
+
max: (_ = a.range) == null ? void 0 : _.max,
|
|
1411
1419
|
step: a.step,
|
|
1412
1420
|
placeholder: a.placeholder,
|
|
1413
1421
|
disabled: a.disabled,
|
|
@@ -1419,15 +1427,15 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
1419
1427
|
a.name || `number-${Math.random()}`
|
|
1420
1428
|
);
|
|
1421
1429
|
if (a.type === "slider")
|
|
1422
|
-
return /* @__PURE__ */
|
|
1423
|
-
/* @__PURE__ */
|
|
1424
|
-
/* @__PURE__ */ o("div", { className: "flex items-center", children: a.label ?
|
|
1425
|
-
/* @__PURE__ */
|
|
1430
|
+
return /* @__PURE__ */ L("div", { className: "mb-6", children: [
|
|
1431
|
+
/* @__PURE__ */ L("div", { className: "flex items-center justify-between mb-3", children: [
|
|
1432
|
+
/* @__PURE__ */ o("div", { className: "flex items-center", children: a.label ? le(a) : null }),
|
|
1433
|
+
/* @__PURE__ */ L("div", { className: "flex items-center gap-2", children: [
|
|
1426
1434
|
/* @__PURE__ */ o(K.Item, { name: a.name, noStyle: !0, children: /* @__PURE__ */ o(
|
|
1427
|
-
|
|
1435
|
+
nr,
|
|
1428
1436
|
{
|
|
1429
|
-
min: (
|
|
1430
|
-
max: (
|
|
1437
|
+
min: (E = a.range) == null ? void 0 : E.min,
|
|
1438
|
+
max: (j = a.range) == null ? void 0 : j.max,
|
|
1431
1439
|
step: a.step,
|
|
1432
1440
|
disabled: a.disabled,
|
|
1433
1441
|
className: "h-8 w-20"
|
|
@@ -1437,10 +1445,10 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
1437
1445
|
] })
|
|
1438
1446
|
] }),
|
|
1439
1447
|
/* @__PURE__ */ o(K.Item, { name: a.name, noStyle: !0, children: /* @__PURE__ */ o(
|
|
1440
|
-
|
|
1448
|
+
_r,
|
|
1441
1449
|
{
|
|
1442
|
-
min: (
|
|
1443
|
-
max: (
|
|
1450
|
+
min: (ee = a.range) == null ? void 0 : ee.min,
|
|
1451
|
+
max: (Z = a.range) == null ? void 0 : Z.max,
|
|
1444
1452
|
step: a.step,
|
|
1445
1453
|
disabled: a.disabled,
|
|
1446
1454
|
className: a.className
|
|
@@ -1456,13 +1464,13 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
1456
1464
|
className: "mb-6",
|
|
1457
1465
|
labelCol: { span: 24 },
|
|
1458
1466
|
wrapperCol: { span: 24 },
|
|
1459
|
-
children: /* @__PURE__ */
|
|
1460
|
-
/* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: a.label ?
|
|
1467
|
+
children: /* @__PURE__ */ L("div", { className: "flex items-center justify-between", children: [
|
|
1468
|
+
/* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: a.label ? le(a) : null }),
|
|
1461
1469
|
/* @__PURE__ */ o(K.Item, { name: a.name, valuePropName: "checked", noStyle: !0, children: /* @__PURE__ */ o(
|
|
1462
|
-
|
|
1470
|
+
Br,
|
|
1463
1471
|
{
|
|
1464
1472
|
disabled: a.disabled,
|
|
1465
|
-
checked: a.name ?
|
|
1473
|
+
checked: a.name ? F[a.name] : !1,
|
|
1466
1474
|
className: a.className,
|
|
1467
1475
|
onChange: (i) => a.name && l(a.name, i, a.controlledItems)
|
|
1468
1476
|
}
|
|
@@ -1484,7 +1492,7 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
1484
1492
|
}), /* @__PURE__ */ o(
|
|
1485
1493
|
K.Item,
|
|
1486
1494
|
{
|
|
1487
|
-
label: a.label ?
|
|
1495
|
+
label: a.label ? le(a) : void 0,
|
|
1488
1496
|
name: a.name,
|
|
1489
1497
|
rules: i.length > 0 ? i : void 0,
|
|
1490
1498
|
className: "mb-6",
|
|
@@ -1492,7 +1500,7 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
1492
1500
|
wrapperCol: { span: 24 },
|
|
1493
1501
|
required: !1,
|
|
1494
1502
|
children: /* @__PURE__ */ o(
|
|
1495
|
-
|
|
1503
|
+
fe.TextArea,
|
|
1496
1504
|
{
|
|
1497
1505
|
placeholder: a.placeholder,
|
|
1498
1506
|
disabled: a.disabled,
|
|
@@ -1511,7 +1519,7 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
1511
1519
|
return a.type === "date" ? /* @__PURE__ */ o(
|
|
1512
1520
|
K.Item,
|
|
1513
1521
|
{
|
|
1514
|
-
label: a.label ?
|
|
1522
|
+
label: a.label ? le(a) : void 0,
|
|
1515
1523
|
name: a.name,
|
|
1516
1524
|
rules: a.name ? [{ required: a.required, message: a.error || `请选择${a.label}` }] : void 0,
|
|
1517
1525
|
className: "mb-6",
|
|
@@ -1519,7 +1527,7 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
1519
1527
|
wrapperCol: { span: 24 },
|
|
1520
1528
|
required: !1,
|
|
1521
1529
|
children: /* @__PURE__ */ o(
|
|
1522
|
-
|
|
1530
|
+
or,
|
|
1523
1531
|
{
|
|
1524
1532
|
placeholder: a.placeholder,
|
|
1525
1533
|
disabled: a.disabled,
|
|
@@ -1532,20 +1540,20 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
1532
1540
|
) : a.type === "radio" ? /* @__PURE__ */ o(
|
|
1533
1541
|
K.Item,
|
|
1534
1542
|
{
|
|
1535
|
-
label: a.label ?
|
|
1543
|
+
label: a.label ? le(a) : void 0,
|
|
1536
1544
|
name: a.name,
|
|
1537
1545
|
rules: a.name ? [{ required: a.required, message: a.error || `请选择${a.label}` }] : void 0,
|
|
1538
1546
|
className: "mb-6",
|
|
1539
1547
|
labelCol: { span: 24 },
|
|
1540
1548
|
wrapperCol: { span: 24 },
|
|
1541
1549
|
required: !1,
|
|
1542
|
-
children: /* @__PURE__ */ o(
|
|
1550
|
+
children: /* @__PURE__ */ o(Wr.Group, { options: a.options, disabled: a.disabled, className: a.className })
|
|
1543
1551
|
},
|
|
1544
1552
|
a.name || `radio-${Math.random()}`
|
|
1545
1553
|
) : a.type === "password" ? /* @__PURE__ */ o(
|
|
1546
1554
|
K.Item,
|
|
1547
1555
|
{
|
|
1548
|
-
label: a.label ?
|
|
1556
|
+
label: a.label ? le(a) : void 0,
|
|
1549
1557
|
name: a.name,
|
|
1550
1558
|
rules: a.name ? [{ required: a.required, message: a.error || `请输入${a.label}` }] : void 0,
|
|
1551
1559
|
className: "mb-6",
|
|
@@ -1553,7 +1561,7 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
1553
1561
|
wrapperCol: { span: 24 },
|
|
1554
1562
|
required: !1,
|
|
1555
1563
|
children: /* @__PURE__ */ o(
|
|
1556
|
-
|
|
1564
|
+
fe.Password,
|
|
1557
1565
|
{
|
|
1558
1566
|
placeholder: a.placeholder,
|
|
1559
1567
|
disabled: a.disabled,
|
|
@@ -1565,7 +1573,7 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
1565
1573
|
) : a.type === "checkbox" ? /* @__PURE__ */ o(
|
|
1566
1574
|
K.Item,
|
|
1567
1575
|
{
|
|
1568
|
-
label: a.label ?
|
|
1576
|
+
label: a.label ? le(a) : void 0,
|
|
1569
1577
|
name: a.name,
|
|
1570
1578
|
rules: a.name ? [{ required: a.required, message: a.error || `请选择${a.label}` }] : void 0,
|
|
1571
1579
|
className: "mb-6",
|
|
@@ -1573,7 +1581,7 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
1573
1581
|
wrapperCol: { span: 24 },
|
|
1574
1582
|
required: !1,
|
|
1575
1583
|
children: /* @__PURE__ */ o(
|
|
1576
|
-
|
|
1584
|
+
Rr.Group,
|
|
1577
1585
|
{
|
|
1578
1586
|
options: a.options,
|
|
1579
1587
|
disabled: a.disabled,
|
|
@@ -1585,7 +1593,7 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
1585
1593
|
) : a.type === "email" ? /* @__PURE__ */ o(
|
|
1586
1594
|
K.Item,
|
|
1587
1595
|
{
|
|
1588
|
-
label: a.label ?
|
|
1596
|
+
label: a.label ? le(a) : void 0,
|
|
1589
1597
|
name: a.name,
|
|
1590
1598
|
rules: a.name ? [
|
|
1591
1599
|
{ required: a.required, message: a.error || `请输入${a.label}` },
|
|
@@ -1596,7 +1604,7 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
1596
1604
|
wrapperCol: { span: 24 },
|
|
1597
1605
|
required: !1,
|
|
1598
1606
|
children: /* @__PURE__ */ o(
|
|
1599
|
-
|
|
1607
|
+
fe,
|
|
1600
1608
|
{
|
|
1601
1609
|
type: "email",
|
|
1602
1610
|
placeholder: a.placeholder,
|
|
@@ -1609,7 +1617,7 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
1609
1617
|
) : a.type === "time" ? /* @__PURE__ */ o(
|
|
1610
1618
|
K.Item,
|
|
1611
1619
|
{
|
|
1612
|
-
label: a.label ?
|
|
1620
|
+
label: a.label ? le(a) : void 0,
|
|
1613
1621
|
name: a.name,
|
|
1614
1622
|
rules: a.name ? [{ required: a.required, message: a.error || `请选择${a.label}` }] : void 0,
|
|
1615
1623
|
className: "mb-6",
|
|
@@ -1617,7 +1625,7 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
1617
1625
|
wrapperCol: { span: 24 },
|
|
1618
1626
|
required: !1,
|
|
1619
1627
|
children: /* @__PURE__ */ o(
|
|
1620
|
-
|
|
1628
|
+
qr,
|
|
1621
1629
|
{
|
|
1622
1630
|
placeholder: a.placeholder,
|
|
1623
1631
|
disabled: a.disabled,
|
|
@@ -1630,7 +1638,7 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
1630
1638
|
) : a.type === "datetime" ? /* @__PURE__ */ o(
|
|
1631
1639
|
K.Item,
|
|
1632
1640
|
{
|
|
1633
|
-
label: a.label ?
|
|
1641
|
+
label: a.label ? le(a) : void 0,
|
|
1634
1642
|
name: a.name,
|
|
1635
1643
|
rules: a.name ? [{ required: a.required, message: a.error || `请选择${a.label}` }] : void 0,
|
|
1636
1644
|
className: "mb-6",
|
|
@@ -1638,7 +1646,7 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
1638
1646
|
wrapperCol: { span: 24 },
|
|
1639
1647
|
required: !1,
|
|
1640
1648
|
children: /* @__PURE__ */ o(
|
|
1641
|
-
|
|
1649
|
+
or,
|
|
1642
1650
|
{
|
|
1643
1651
|
showTime: !0,
|
|
1644
1652
|
placeholder: a.placeholder,
|
|
@@ -1652,7 +1660,7 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
1652
1660
|
) : a.type === "file" ? /* @__PURE__ */ o(
|
|
1653
1661
|
K.Item,
|
|
1654
1662
|
{
|
|
1655
|
-
label: a.label ?
|
|
1663
|
+
label: a.label ? le(a) : void 0,
|
|
1656
1664
|
name: a.name,
|
|
1657
1665
|
rules: a.name ? [{ required: a.required, message: a.error || `请选择${a.label}` }] : void 0,
|
|
1658
1666
|
className: "mb-6",
|
|
@@ -1660,7 +1668,7 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
1660
1668
|
wrapperCol: { span: 24 },
|
|
1661
1669
|
required: !1,
|
|
1662
1670
|
children: /* @__PURE__ */ o(
|
|
1663
|
-
|
|
1671
|
+
fe,
|
|
1664
1672
|
{
|
|
1665
1673
|
type: "file",
|
|
1666
1674
|
placeholder: a.placeholder,
|
|
@@ -1673,7 +1681,7 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
1673
1681
|
) : a.type === "color" ? /* @__PURE__ */ o(
|
|
1674
1682
|
K.Item,
|
|
1675
1683
|
{
|
|
1676
|
-
label: a.label ?
|
|
1684
|
+
label: a.label ? le(a) : void 0,
|
|
1677
1685
|
name: a.name,
|
|
1678
1686
|
rules: a.name ? [{ required: a.required, message: a.error || `请选择${a.label}` }] : void 0,
|
|
1679
1687
|
className: "mb-6",
|
|
@@ -1681,7 +1689,7 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
1681
1689
|
wrapperCol: { span: 24 },
|
|
1682
1690
|
required: !1,
|
|
1683
1691
|
children: /* @__PURE__ */ o(
|
|
1684
|
-
|
|
1692
|
+
fe,
|
|
1685
1693
|
{
|
|
1686
1694
|
type: "color",
|
|
1687
1695
|
placeholder: a.placeholder,
|
|
@@ -1695,7 +1703,7 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
1695
1703
|
) : a.type === "json" ? /* @__PURE__ */ o(
|
|
1696
1704
|
K.Item,
|
|
1697
1705
|
{
|
|
1698
|
-
label: a.label ?
|
|
1706
|
+
label: a.label ? le(a) : void 0,
|
|
1699
1707
|
name: a.name,
|
|
1700
1708
|
rules: a.name ? [
|
|
1701
1709
|
{ required: a.required, message: a.error || `请输入${a.label}` },
|
|
@@ -1715,7 +1723,7 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
1715
1723
|
wrapperCol: { span: 24 },
|
|
1716
1724
|
required: !1,
|
|
1717
1725
|
children: /* @__PURE__ */ o(
|
|
1718
|
-
|
|
1726
|
+
fe.TextArea,
|
|
1719
1727
|
{
|
|
1720
1728
|
placeholder: a.placeholder,
|
|
1721
1729
|
disabled: a.disabled,
|
|
@@ -1728,7 +1736,7 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
1728
1736
|
) : a.type === "markdown" ? /* @__PURE__ */ o(
|
|
1729
1737
|
K.Item,
|
|
1730
1738
|
{
|
|
1731
|
-
label: a.label ?
|
|
1739
|
+
label: a.label ? le(a) : void 0,
|
|
1732
1740
|
name: a.name,
|
|
1733
1741
|
rules: a.name ? [{ required: a.required, message: a.error || `请输入${a.label}` }] : void 0,
|
|
1734
1742
|
className: "mb-6",
|
|
@@ -1736,7 +1744,7 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
1736
1744
|
wrapperCol: { span: 24 },
|
|
1737
1745
|
required: !1,
|
|
1738
1746
|
children: /* @__PURE__ */ o(
|
|
1739
|
-
|
|
1747
|
+
fe.TextArea,
|
|
1740
1748
|
{
|
|
1741
1749
|
placeholder: a.placeholder,
|
|
1742
1750
|
disabled: a.disabled,
|
|
@@ -1749,7 +1757,7 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
1749
1757
|
) : a.type === "uploader" ? /* @__PURE__ */ o(
|
|
1750
1758
|
K.Item,
|
|
1751
1759
|
{
|
|
1752
|
-
label: a.label ?
|
|
1760
|
+
label: a.label ? le(a) : void 0,
|
|
1753
1761
|
name: a.name,
|
|
1754
1762
|
rules: a.name ? [{ required: a.required, message: a.error || `请上传${a.label}` }] : void 0,
|
|
1755
1763
|
className: "mb-6",
|
|
@@ -1757,23 +1765,23 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
1757
1765
|
wrapperCol: { span: 24 },
|
|
1758
1766
|
required: !1,
|
|
1759
1767
|
children: /* @__PURE__ */ o(
|
|
1760
|
-
|
|
1768
|
+
Yr,
|
|
1761
1769
|
{
|
|
1762
|
-
multiple: ((
|
|
1763
|
-
accept: ((
|
|
1770
|
+
multiple: ((W = a.uploaderConfig) == null ? void 0 : W.multiple) ?? !0,
|
|
1771
|
+
accept: ((re = a.uploaderConfig) == null ? void 0 : re.accept) ?? "*/*",
|
|
1764
1772
|
maxSize: ((G = a.uploaderConfig) == null ? void 0 : G.maxSize) ?? 100,
|
|
1765
|
-
maxFiles: ((
|
|
1773
|
+
maxFiles: ((C = a.uploaderConfig) == null ? void 0 : C.maxFiles) ?? 10,
|
|
1766
1774
|
autoUpload: ((y = a.uploaderConfig) == null ? void 0 : y.autoUpload) ?? !0,
|
|
1767
1775
|
url: (x = a.uploaderConfig) == null ? void 0 : x.url,
|
|
1768
|
-
headers: ((
|
|
1769
|
-
queryParams: ((
|
|
1770
|
-
itemForm: ((
|
|
1771
|
-
buttons: ((
|
|
1772
|
-
icons: (
|
|
1773
|
-
placeholder: (
|
|
1774
|
-
listName: (
|
|
1775
|
-
errorMessages: (
|
|
1776
|
-
onRef: (
|
|
1776
|
+
headers: ((z = a.uploaderConfig) == null ? void 0 : z.headers) ?? {},
|
|
1777
|
+
queryParams: ((k = a.uploaderConfig) == null ? void 0 : k.queryParams) ?? {},
|
|
1778
|
+
itemForm: ((q = a.uploaderConfig) == null ? void 0 : q.itemForm) ?? [],
|
|
1779
|
+
buttons: ((R = a.uploaderConfig) == null ? void 0 : R.buttons) || [],
|
|
1780
|
+
icons: (Q = a.uploaderConfig) == null ? void 0 : Q.icons,
|
|
1781
|
+
placeholder: (X = a.uploaderConfig) == null ? void 0 : X.placeholder,
|
|
1782
|
+
listName: (S = a.uploaderConfig) == null ? void 0 : S.listName,
|
|
1783
|
+
errorMessages: (Y = a.uploaderConfig) == null ? void 0 : Y.errorMessages,
|
|
1784
|
+
onRef: (I = a.uploaderConfig) == null ? void 0 : I.onRef,
|
|
1777
1785
|
styles: r,
|
|
1778
1786
|
eventsEmit: (i, u) => {
|
|
1779
1787
|
if (r && typeof r.eventsEmit == "function") {
|
|
@@ -1790,11 +1798,11 @@ function za(e = [], r, t = {}, s = "md") {
|
|
|
1790
1798
|
a.name || `uploader-${Math.random()}`
|
|
1791
1799
|
) : null;
|
|
1792
1800
|
});
|
|
1793
|
-
return
|
|
1794
|
-
r && typeof r.setFormRef == "function" && r.setFormRef(
|
|
1795
|
-
}, [r]),
|
|
1801
|
+
return me.useEffect(() => {
|
|
1802
|
+
r && typeof r.setFormRef == "function" && r.setFormRef(O);
|
|
1803
|
+
}, [r]), te;
|
|
1796
1804
|
}
|
|
1797
|
-
const
|
|
1805
|
+
const Ga = `
|
|
1798
1806
|
.ant-input-password .ant-input-suffix {
|
|
1799
1807
|
position: absolute !important;
|
|
1800
1808
|
right: 8px !important;
|
|
@@ -1813,7 +1821,7 @@ const _a = `
|
|
|
1813
1821
|
.ant-input-password:hover .ant-input-suffix .anticon {
|
|
1814
1822
|
color: rgba(0, 0, 0, 0.65) !important;
|
|
1815
1823
|
}
|
|
1816
|
-
`,
|
|
1824
|
+
`, la = me.forwardRef(
|
|
1817
1825
|
({
|
|
1818
1826
|
formItems: e,
|
|
1819
1827
|
formProps: r = {},
|
|
@@ -1821,35 +1829,35 @@ const _a = `
|
|
|
1821
1829
|
eventsEmit: s,
|
|
1822
1830
|
databaseType: h,
|
|
1823
1831
|
styles: b,
|
|
1824
|
-
size:
|
|
1832
|
+
size: p = "md",
|
|
1825
1833
|
formConfig: d,
|
|
1826
|
-
title:
|
|
1834
|
+
title: f,
|
|
1827
1835
|
description: N,
|
|
1828
|
-
formWidth:
|
|
1836
|
+
formWidth: F,
|
|
1829
1837
|
...M
|
|
1830
|
-
},
|
|
1831
|
-
var G,
|
|
1832
|
-
const [l] = K.useForm(),
|
|
1838
|
+
}, O) => {
|
|
1839
|
+
var G, C, y, x, z, k, q, R, Q, X, S, Y, I, i;
|
|
1840
|
+
const [l] = K.useForm(), $ = Fe(), H = $e(
|
|
1833
1841
|
// 基础:默认主题 + useTheme的配置
|
|
1834
|
-
$e({ theme:
|
|
1842
|
+
$e({ theme: B, mode: "light" }, $),
|
|
1835
1843
|
// 最高层:用户手动传入的styles
|
|
1836
1844
|
b
|
|
1837
|
-
),
|
|
1838
|
-
const u = l.getFieldsValue(), c = [], n = (
|
|
1839
|
-
|
|
1845
|
+
), P = Te({}), te = () => {
|
|
1846
|
+
const u = l.getFieldsValue(), c = [], n = (D) => {
|
|
1847
|
+
D == null || D.forEach((m) => {
|
|
1840
1848
|
m && (m.type === "col" && Array.isArray(m.children) ? n(m.children) : m.name && c.push({ name: m.name, type: m.type }));
|
|
1841
1849
|
});
|
|
1842
1850
|
};
|
|
1843
1851
|
n(e);
|
|
1844
|
-
const
|
|
1845
|
-
const g =
|
|
1846
|
-
return { name:
|
|
1852
|
+
const A = c.map((D) => {
|
|
1853
|
+
const g = D.type === "uploader" ? P.current[D.name] || u[D.name] || [] : u[D.name];
|
|
1854
|
+
return { name: D.name, type: D.type, value: g };
|
|
1847
1855
|
});
|
|
1848
1856
|
return {
|
|
1849
1857
|
formName: (r == null ? void 0 : r.name) || "",
|
|
1850
1858
|
values: u,
|
|
1851
|
-
fields:
|
|
1852
|
-
files:
|
|
1859
|
+
fields: A,
|
|
1860
|
+
files: P.current,
|
|
1853
1861
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
1854
1862
|
};
|
|
1855
1863
|
}, a = (u, c) => {
|
|
@@ -1869,8 +1877,8 @@ const _a = `
|
|
|
1869
1877
|
if (u.startsWith("uploader:")) {
|
|
1870
1878
|
const n = c == null ? void 0 : c.fieldName;
|
|
1871
1879
|
if (n) {
|
|
1872
|
-
const
|
|
1873
|
-
let
|
|
1880
|
+
const A = P.current[n] || [];
|
|
1881
|
+
let D = A;
|
|
1874
1882
|
switch (u) {
|
|
1875
1883
|
case "uploader:success": {
|
|
1876
1884
|
const m = c == null ? void 0 : c.item;
|
|
@@ -1882,23 +1890,23 @@ const _a = `
|
|
|
1882
1890
|
type: m.type,
|
|
1883
1891
|
uploadApiRes: m.uploadApiRes || {},
|
|
1884
1892
|
formData: m.formData || {}
|
|
1885
|
-
},
|
|
1886
|
-
|
|
1893
|
+
}, ae = A.findIndex((ye) => ye.id === g.id);
|
|
1894
|
+
ae >= 0 ? (A[ae] = g, D = [...A]) : D = [...A, g];
|
|
1887
1895
|
}
|
|
1888
1896
|
break;
|
|
1889
1897
|
}
|
|
1890
1898
|
case "uploader:remove": {
|
|
1891
1899
|
const m = c == null ? void 0 : c.itemId;
|
|
1892
|
-
|
|
1900
|
+
D = A.filter((g) => g.id !== m);
|
|
1893
1901
|
break;
|
|
1894
1902
|
}
|
|
1895
1903
|
case "uploader:formDataChange": {
|
|
1896
1904
|
const m = c == null ? void 0 : c.itemId, g = (c == null ? void 0 : c.formData) || {};
|
|
1897
|
-
|
|
1905
|
+
D = A.map((ae) => ae.id === m ? { ...ae, formData: g } : ae);
|
|
1898
1906
|
break;
|
|
1899
1907
|
}
|
|
1900
1908
|
case "uploader:dataChange": {
|
|
1901
|
-
Array.isArray(c == null ? void 0 : c.items) && (
|
|
1909
|
+
Array.isArray(c == null ? void 0 : c.items) && (D = c.items.map((m) => ({
|
|
1902
1910
|
id: m.id,
|
|
1903
1911
|
name: m.name,
|
|
1904
1912
|
size: m.size,
|
|
@@ -1909,7 +1917,7 @@ const _a = `
|
|
|
1909
1917
|
break;
|
|
1910
1918
|
}
|
|
1911
1919
|
}
|
|
1912
|
-
|
|
1920
|
+
P.current[n] = D, l.setFieldsValue({ [n]: D });
|
|
1913
1921
|
}
|
|
1914
1922
|
}
|
|
1915
1923
|
if (typeof s == "function") {
|
|
@@ -1917,17 +1925,17 @@ const _a = `
|
|
|
1917
1925
|
formName: (r == null ? void 0 : r.name) || "",
|
|
1918
1926
|
...c
|
|
1919
1927
|
};
|
|
1920
|
-
u === "uploader:error" && n.data === void 0 && (n.data =
|
|
1928
|
+
u === "uploader:error" && n.data === void 0 && (n.data = te()), s(u, n);
|
|
1921
1929
|
}
|
|
1922
|
-
}, [
|
|
1930
|
+
}, [w, V] = ie(e);
|
|
1923
1931
|
we(() => {
|
|
1924
|
-
|
|
1932
|
+
V(e);
|
|
1925
1933
|
}, [e]);
|
|
1926
|
-
const
|
|
1927
|
-
const n = (
|
|
1928
|
-
|
|
1929
|
-
},
|
|
1930
|
-
const c = [...
|
|
1934
|
+
const _ = (u, c) => {
|
|
1935
|
+
const n = (A) => A.map((D) => D && (D.type === "col" && Array.isArray(D.children) ? { ...D, children: n(D.children) } : D.name === u ? { ...D, ...c } : D));
|
|
1936
|
+
V((A) => n(A));
|
|
1937
|
+
}, E = (u) => {
|
|
1938
|
+
const c = [...w];
|
|
1931
1939
|
for (; c.length; ) {
|
|
1932
1940
|
const n = c.shift();
|
|
1933
1941
|
if (n) {
|
|
@@ -1937,118 +1945,118 @@ const _a = `
|
|
|
1937
1945
|
return n;
|
|
1938
1946
|
}
|
|
1939
1947
|
}
|
|
1940
|
-
},
|
|
1941
|
-
|
|
1948
|
+
}, j = Ja(
|
|
1949
|
+
w,
|
|
1942
1950
|
{ ...b, eventsEmit: T, formInstance: l },
|
|
1943
1951
|
t,
|
|
1944
|
-
|
|
1945
|
-
),
|
|
1952
|
+
p
|
|
1953
|
+
), ee = async () => {
|
|
1946
1954
|
try {
|
|
1947
1955
|
const u = await l.validateFields();
|
|
1948
1956
|
typeof s == "function" ? s("form:submit", {
|
|
1949
1957
|
formName: (r == null ? void 0 : r.name) || "",
|
|
1950
1958
|
values: u,
|
|
1951
|
-
data:
|
|
1959
|
+
data: te()
|
|
1952
1960
|
}) : l.submit(), d != null && d.onSubmit ? d.onSubmit(u) : l.resetFields();
|
|
1953
1961
|
} catch (u) {
|
|
1954
1962
|
typeof s == "function" && s("form:submit_error", {
|
|
1955
1963
|
formName: (r == null ? void 0 : r.name) || "",
|
|
1956
1964
|
error: u,
|
|
1957
|
-
data:
|
|
1965
|
+
data: te()
|
|
1958
1966
|
});
|
|
1959
1967
|
}
|
|
1960
|
-
},
|
|
1968
|
+
}, Z = () => {
|
|
1961
1969
|
l.resetFields(), typeof s == "function" && s("form:reset", {
|
|
1962
1970
|
formName: (r == null ? void 0 : r.name) || "",
|
|
1963
|
-
data:
|
|
1971
|
+
data: te()
|
|
1964
1972
|
}), d != null && d.onReset && d.onReset();
|
|
1965
|
-
},
|
|
1973
|
+
}, W = () => {
|
|
1966
1974
|
l.resetFields(), typeof s == "function" && s("form:cancel", {
|
|
1967
1975
|
formName: (r == null ? void 0 : r.name) || "",
|
|
1968
|
-
data:
|
|
1976
|
+
data: te()
|
|
1969
1977
|
});
|
|
1970
|
-
},
|
|
1978
|
+
}, re = async () => {
|
|
1971
1979
|
try {
|
|
1972
|
-
const u = await l.validateFields(), c = [], n = (
|
|
1973
|
-
|
|
1980
|
+
const u = await l.validateFields(), c = [], n = (D) => {
|
|
1981
|
+
D == null || D.forEach((m) => {
|
|
1974
1982
|
m && (m.type === "col" && Array.isArray(m.children) ? n(m.children) : m.name && c.push({ name: m.name, type: m.type }));
|
|
1975
1983
|
});
|
|
1976
1984
|
};
|
|
1977
1985
|
n(e);
|
|
1978
|
-
const
|
|
1979
|
-
const g =
|
|
1980
|
-
return { name:
|
|
1986
|
+
const A = c.map((D) => {
|
|
1987
|
+
const g = D.type === "uploader" ? P.current[D.name] || u[D.name] || [] : u[D.name];
|
|
1988
|
+
return { name: D.name, type: D.type, value: g };
|
|
1981
1989
|
});
|
|
1982
1990
|
return {
|
|
1983
|
-
fields:
|
|
1991
|
+
fields: A,
|
|
1984
1992
|
formName: (r == null ? void 0 : r.name) || "",
|
|
1985
|
-
fieldCount:
|
|
1993
|
+
fieldCount: A.length,
|
|
1986
1994
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1987
1995
|
isValid: !0
|
|
1988
1996
|
};
|
|
1989
1997
|
} catch (u) {
|
|
1990
|
-
const c = l.getFieldsValue(), n = [],
|
|
1998
|
+
const c = l.getFieldsValue(), n = [], A = (m) => {
|
|
1991
1999
|
m == null || m.forEach((g) => {
|
|
1992
|
-
g && (g.type === "col" && Array.isArray(g.children) ?
|
|
2000
|
+
g && (g.type === "col" && Array.isArray(g.children) ? A(g.children) : g.name && n.push({ name: g.name, type: g.type }));
|
|
1993
2001
|
});
|
|
1994
2002
|
};
|
|
1995
|
-
|
|
1996
|
-
const
|
|
1997
|
-
const
|
|
1998
|
-
return { name: m.name, type: m.type, value:
|
|
2003
|
+
A(e);
|
|
2004
|
+
const D = n.map((m) => {
|
|
2005
|
+
const ae = m.type === "uploader" ? P.current[m.name] || c[m.name] || [] : c[m.name];
|
|
2006
|
+
return { name: m.name, type: m.type, value: ae };
|
|
1999
2007
|
});
|
|
2000
2008
|
return {
|
|
2001
|
-
fields:
|
|
2009
|
+
fields: D,
|
|
2002
2010
|
formName: (r == null ? void 0 : r.name) || "",
|
|
2003
|
-
fieldCount:
|
|
2011
|
+
fieldCount: D.length,
|
|
2004
2012
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2005
2013
|
isValid: !1,
|
|
2006
2014
|
errors: u
|
|
2007
2015
|
};
|
|
2008
2016
|
}
|
|
2009
2017
|
};
|
|
2010
|
-
return
|
|
2011
|
-
|
|
2018
|
+
return me.useImperativeHandle(
|
|
2019
|
+
O,
|
|
2012
2020
|
() => ({
|
|
2013
2021
|
form: l,
|
|
2014
|
-
getAllData:
|
|
2015
|
-
submit:
|
|
2016
|
-
reset:
|
|
2017
|
-
cancel:
|
|
2022
|
+
getAllData: re,
|
|
2023
|
+
submit: ee,
|
|
2024
|
+
reset: Z,
|
|
2025
|
+
cancel: W,
|
|
2018
2026
|
validate: () => l.validateFields(),
|
|
2019
2027
|
getValue: (u) => l.getFieldValue(u),
|
|
2020
2028
|
getValues: () => l.getFieldsValue(),
|
|
2021
2029
|
setValues: (u) => l.setFieldsValue(u),
|
|
2022
|
-
setFieldProps: (u, c) =>
|
|
2023
|
-
getFieldProps: (u) =>
|
|
2030
|
+
setFieldProps: (u, c) => _(u, c),
|
|
2031
|
+
getFieldProps: (u) => E(u)
|
|
2024
2032
|
}),
|
|
2025
|
-
[l,
|
|
2026
|
-
), /* @__PURE__ */
|
|
2027
|
-
/* @__PURE__ */ o("style", { children:
|
|
2028
|
-
/* @__PURE__ */
|
|
2033
|
+
[l, re, ee, Z, W]
|
|
2034
|
+
), /* @__PURE__ */ L(na, { children: [
|
|
2035
|
+
/* @__PURE__ */ o("style", { children: Ga }),
|
|
2036
|
+
/* @__PURE__ */ L(
|
|
2029
2037
|
"div",
|
|
2030
2038
|
{
|
|
2031
2039
|
style: {
|
|
2032
2040
|
position: "relative",
|
|
2033
2041
|
height: "100%",
|
|
2034
2042
|
padding: "24px",
|
|
2035
|
-
width:
|
|
2043
|
+
width: F || "100%",
|
|
2036
2044
|
// 使用传入的表单宽度或默认100%
|
|
2037
|
-
maxWidth:
|
|
2045
|
+
maxWidth: F || "100%"
|
|
2038
2046
|
// 确保最大宽度不超过设定值
|
|
2039
2047
|
},
|
|
2040
2048
|
children: [
|
|
2041
|
-
(
|
|
2042
|
-
|
|
2049
|
+
(f || N) && /* @__PURE__ */ L("div", { style: { marginBottom: "24px" }, children: [
|
|
2050
|
+
f && /* @__PURE__ */ o(
|
|
2043
2051
|
"h2",
|
|
2044
2052
|
{
|
|
2045
2053
|
style: {
|
|
2046
2054
|
fontSize: "24px",
|
|
2047
2055
|
fontWeight: "600",
|
|
2048
|
-
color: ((
|
|
2056
|
+
color: ((C = (G = H.theme) == null ? void 0 : G.colors) == null ? void 0 : C.text) || "#1f2937",
|
|
2049
2057
|
margin: "0 0 8px 0"
|
|
2050
2058
|
},
|
|
2051
|
-
children:
|
|
2059
|
+
children: f
|
|
2052
2060
|
}
|
|
2053
2061
|
),
|
|
2054
2062
|
N && /* @__PURE__ */ o(
|
|
@@ -2056,7 +2064,7 @@ const _a = `
|
|
|
2056
2064
|
{
|
|
2057
2065
|
style: {
|
|
2058
2066
|
fontSize: "14px",
|
|
2059
|
-
color: ((x = (y =
|
|
2067
|
+
color: ((x = (y = H.theme) == null ? void 0 : y.colors) == null ? void 0 : x.secondary) || "#6b7280",
|
|
2060
2068
|
margin: "0",
|
|
2061
2069
|
lineHeight: "1.5"
|
|
2062
2070
|
},
|
|
@@ -2064,7 +2072,7 @@ const _a = `
|
|
|
2064
2072
|
}
|
|
2065
2073
|
)
|
|
2066
2074
|
] }),
|
|
2067
|
-
/* @__PURE__ */
|
|
2075
|
+
/* @__PURE__ */ L(
|
|
2068
2076
|
K,
|
|
2069
2077
|
{
|
|
2070
2078
|
form: l,
|
|
@@ -2081,38 +2089,38 @@ const _a = `
|
|
|
2081
2089
|
className: "dynamic-form",
|
|
2082
2090
|
loading: (r == null ? void 0 : r.loading) === !0 ? !0 : void 0,
|
|
2083
2091
|
children: [
|
|
2084
|
-
|
|
2085
|
-
((d == null ? void 0 : d.showSubmit) || (d == null ? void 0 : d.showReset)) && /* @__PURE__ */
|
|
2092
|
+
j,
|
|
2093
|
+
((d == null ? void 0 : d.showSubmit) || (d == null ? void 0 : d.showReset)) && /* @__PURE__ */ L(
|
|
2086
2094
|
"div",
|
|
2087
2095
|
{
|
|
2088
2096
|
style: {
|
|
2089
2097
|
marginTop: "32px",
|
|
2090
2098
|
paddingTop: "24px",
|
|
2091
|
-
borderTop: `1px solid ${((
|
|
2099
|
+
borderTop: `1px solid ${((k = (z = H.theme) == null ? void 0 : z.colors) == null ? void 0 : k.border) || "#e5e7eb"}`,
|
|
2092
2100
|
display: "flex",
|
|
2093
2101
|
gap: "12px",
|
|
2094
2102
|
justifyContent: "flex-end"
|
|
2095
2103
|
},
|
|
2096
2104
|
children: [
|
|
2097
2105
|
(d == null ? void 0 : d.showReset) && /* @__PURE__ */ o(
|
|
2098
|
-
|
|
2106
|
+
Lr,
|
|
2099
2107
|
{
|
|
2100
|
-
onClick:
|
|
2108
|
+
onClick: Z,
|
|
2101
2109
|
style: {
|
|
2102
|
-
borderColor: ((
|
|
2103
|
-
color: ((
|
|
2110
|
+
borderColor: ((R = (q = H.theme) == null ? void 0 : q.colors) == null ? void 0 : R.border) || "#e5e7eb",
|
|
2111
|
+
color: ((X = (Q = H.theme) == null ? void 0 : Q.colors) == null ? void 0 : X.text) || "#1f2937"
|
|
2104
2112
|
},
|
|
2105
2113
|
children: (d == null ? void 0 : d.resetText) || "重置"
|
|
2106
2114
|
}
|
|
2107
2115
|
),
|
|
2108
2116
|
(d == null ? void 0 : d.showSubmit) && /* @__PURE__ */ o(
|
|
2109
|
-
|
|
2117
|
+
Lr,
|
|
2110
2118
|
{
|
|
2111
2119
|
type: "primary",
|
|
2112
|
-
onClick:
|
|
2120
|
+
onClick: ee,
|
|
2113
2121
|
style: {
|
|
2114
|
-
backgroundColor: ((
|
|
2115
|
-
borderColor: ((i = (
|
|
2122
|
+
backgroundColor: ((Y = (S = H.theme) == null ? void 0 : S.colors) == null ? void 0 : Y.primary) || "#2563eb",
|
|
2123
|
+
borderColor: ((i = (I = H.theme) == null ? void 0 : I.colors) == null ? void 0 : i.primary) || "#2563eb"
|
|
2116
2124
|
},
|
|
2117
2125
|
children: (d == null ? void 0 : d.submitText) || "提交"
|
|
2118
2126
|
}
|
|
@@ -2129,13 +2137,13 @@ const _a = `
|
|
|
2129
2137
|
] });
|
|
2130
2138
|
}
|
|
2131
2139
|
);
|
|
2132
|
-
|
|
2133
|
-
const
|
|
2134
|
-
var s, h, b,
|
|
2140
|
+
me.memo(la);
|
|
2141
|
+
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 }), Xa = (e, r, t) => {
|
|
2142
|
+
var s, h, b, p;
|
|
2135
2143
|
if (t != null && t.itemStatus)
|
|
2136
2144
|
switch (e) {
|
|
2137
2145
|
case "error":
|
|
2138
|
-
return t.itemStatus.error || /* @__PURE__ */ o(
|
|
2146
|
+
return t.itemStatus.error || /* @__PURE__ */ o(Ar, { size: 20 });
|
|
2139
2147
|
case "uploading":
|
|
2140
2148
|
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
2149
|
case "success":
|
|
@@ -2147,16 +2155,16 @@ const Nr = !1, Aa = (e, r) => r != null && r.fileType ? e.startsWith("image/") ?
|
|
|
2147
2155
|
}
|
|
2148
2156
|
switch (e) {
|
|
2149
2157
|
case "error":
|
|
2150
|
-
return /* @__PURE__ */ o(
|
|
2158
|
+
return /* @__PURE__ */ o(Ar, { size: 20 });
|
|
2151
2159
|
case "uploading":
|
|
2152
2160
|
return /* @__PURE__ */ o("span", { style: { fontSize: "12px", color: ((b = r == null ? void 0 : r.colors) == null ? void 0 : b.primary) || "#007bff" }, children: "上传中..." });
|
|
2153
2161
|
case "pending":
|
|
2154
|
-
return /* @__PURE__ */ o("span", { style: { fontSize: "12px", color: ((
|
|
2162
|
+
return /* @__PURE__ */ o("span", { style: { fontSize: "12px", color: ((p = r == null ? void 0 : r.colors) == null ? void 0 : p.warning) || "#FFA500" }, children: "等待中" });
|
|
2155
2163
|
default:
|
|
2156
2164
|
return null;
|
|
2157
2165
|
}
|
|
2158
2166
|
};
|
|
2159
|
-
|
|
2167
|
+
pa`
|
|
2160
2168
|
.upload-item-container .upload-item {
|
|
2161
2169
|
padding: 0px !important;
|
|
2162
2170
|
}
|
|
@@ -2165,78 +2173,78 @@ Xr`
|
|
|
2165
2173
|
padding: 0px !important;
|
|
2166
2174
|
}
|
|
2167
2175
|
`;
|
|
2168
|
-
const
|
|
2176
|
+
const Pa = ({
|
|
2169
2177
|
item: e,
|
|
2170
2178
|
index: r,
|
|
2171
2179
|
theme: t,
|
|
2172
2180
|
itemForm: s,
|
|
2173
2181
|
onRemove: h,
|
|
2174
2182
|
onToggleExpand: b,
|
|
2175
|
-
onFormDataChange:
|
|
2183
|
+
onFormDataChange: p,
|
|
2176
2184
|
icons: d
|
|
2177
2185
|
}) => {
|
|
2178
|
-
var
|
|
2179
|
-
return /* @__PURE__ */
|
|
2180
|
-
/* @__PURE__ */
|
|
2181
|
-
/* @__PURE__ */ o(
|
|
2182
|
-
/* @__PURE__ */
|
|
2183
|
-
/* @__PURE__ */
|
|
2184
|
-
/* @__PURE__ */ o(
|
|
2185
|
-
/* @__PURE__ */ o(
|
|
2186
|
+
var f;
|
|
2187
|
+
return /* @__PURE__ */ L(Ea, { $theme: t, $status: e.status, $hasForm: s.length > 0, children: [
|
|
2188
|
+
/* @__PURE__ */ L(qa, { $theme: t, $status: e.status, $hasForm: s.length > 0, children: [
|
|
2189
|
+
/* @__PURE__ */ o(La, { $theme: t, children: Ka(e.type, d) }),
|
|
2190
|
+
/* @__PURE__ */ L(ja, { children: [
|
|
2191
|
+
/* @__PURE__ */ L("div", { className: "flex items-center gap-1 line-clamp-1", children: [
|
|
2192
|
+
/* @__PURE__ */ o(Oa, { $theme: t, children: e.name }),
|
|
2193
|
+
/* @__PURE__ */ o(Ha, { $theme: t, children: sa(e.size) })
|
|
2186
2194
|
] }),
|
|
2187
|
-
e.status === "uploading" && /* @__PURE__ */ o(
|
|
2188
|
-
e.status === "error" && e.error && /* @__PURE__ */ o("div", { style: { color: ((
|
|
2195
|
+
e.status === "uploading" && /* @__PURE__ */ o(Ya, { $theme: t, $progress: e.progress }),
|
|
2196
|
+
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
2197
|
] }),
|
|
2190
2198
|
(() => {
|
|
2191
|
-
const N =
|
|
2192
|
-
return N && /* @__PURE__ */ o(
|
|
2199
|
+
const N = Xa(e.status, t, d);
|
|
2200
|
+
return N && /* @__PURE__ */ o(Ia, { $theme: t, $status: e.status, children: N });
|
|
2193
2201
|
})(),
|
|
2194
|
-
|
|
2202
|
+
Hr,
|
|
2195
2203
|
/* @__PURE__ */ o(
|
|
2196
|
-
|
|
2204
|
+
Ua,
|
|
2197
2205
|
{
|
|
2198
2206
|
$theme: t,
|
|
2199
2207
|
onClick: () => h(e.id),
|
|
2200
2208
|
title: "移除文件",
|
|
2201
|
-
children: /* @__PURE__ */ o(
|
|
2209
|
+
children: /* @__PURE__ */ o(fa, { size: 16 })
|
|
2202
2210
|
}
|
|
2203
2211
|
)
|
|
2204
2212
|
] }),
|
|
2205
|
-
(s.length > 0 ||
|
|
2206
|
-
|
|
2213
|
+
(s.length > 0 || Hr) && /* @__PURE__ */ o(
|
|
2214
|
+
Va,
|
|
2207
2215
|
{
|
|
2208
2216
|
$theme: t,
|
|
2209
2217
|
$hasError: e.status === "error",
|
|
2210
2218
|
className: "list-my",
|
|
2211
2219
|
children: /* @__PURE__ */ o(
|
|
2212
|
-
|
|
2220
|
+
la,
|
|
2213
2221
|
{
|
|
2214
2222
|
formItems: s,
|
|
2215
2223
|
initialValues: e.formData || {},
|
|
2216
2224
|
size: "sm",
|
|
2217
2225
|
formProps: { component: !1 },
|
|
2218
|
-
eventsEmit: (N,
|
|
2219
|
-
switch (console.log("DynamicForm Event:", N,
|
|
2226
|
+
eventsEmit: (N, F) => {
|
|
2227
|
+
switch (console.log("DynamicForm Event:", N, F), N) {
|
|
2220
2228
|
case "form:submit":
|
|
2221
|
-
|
|
2229
|
+
p(e.id, F.values);
|
|
2222
2230
|
break;
|
|
2223
2231
|
case "form:change":
|
|
2224
|
-
|
|
2232
|
+
p(e.id, F.values);
|
|
2225
2233
|
break;
|
|
2226
2234
|
case "form:fieldChange":
|
|
2227
|
-
if (
|
|
2235
|
+
if (F.field && F.value !== void 0) {
|
|
2228
2236
|
const M = {
|
|
2229
2237
|
...e.formData,
|
|
2230
|
-
[
|
|
2238
|
+
[F.field]: F.value
|
|
2231
2239
|
};
|
|
2232
|
-
|
|
2240
|
+
p(e.id, M);
|
|
2233
2241
|
}
|
|
2234
2242
|
break;
|
|
2235
2243
|
case "form:reset":
|
|
2236
|
-
|
|
2244
|
+
p(e.id, {});
|
|
2237
2245
|
break;
|
|
2238
2246
|
case "form:validate":
|
|
2239
|
-
|
|
2247
|
+
F.values && p(e.id, F.values);
|
|
2240
2248
|
break;
|
|
2241
2249
|
}
|
|
2242
2250
|
},
|
|
@@ -2250,7 +2258,7 @@ const Ra = ({
|
|
|
2250
2258
|
}
|
|
2251
2259
|
)
|
|
2252
2260
|
] });
|
|
2253
|
-
},
|
|
2261
|
+
}, Yr = ({
|
|
2254
2262
|
multiple: e = !0,
|
|
2255
2263
|
accept: r = "*/*",
|
|
2256
2264
|
maxSize: t = 100,
|
|
@@ -2260,30 +2268,30 @@ const Ra = ({
|
|
|
2260
2268
|
autoUpload: h = !0,
|
|
2261
2269
|
url: b = "http://localhost:3000/upload",
|
|
2262
2270
|
// 默认上传地址
|
|
2263
|
-
headers:
|
|
2271
|
+
headers: p = {},
|
|
2264
2272
|
// 默认请求头
|
|
2265
2273
|
queryParams: d = {},
|
|
2266
2274
|
// 默认查询参数
|
|
2267
|
-
itemForm:
|
|
2275
|
+
itemForm: f = [],
|
|
2268
2276
|
styles: N,
|
|
2269
|
-
buttons:
|
|
2277
|
+
buttons: F = [],
|
|
2270
2278
|
// 新增:自定义按钮数组
|
|
2271
2279
|
errorMessages: M = {},
|
|
2272
2280
|
// 新增:错误提示配置
|
|
2273
|
-
icons:
|
|
2281
|
+
icons: O,
|
|
2274
2282
|
// 新增:图标配置
|
|
2275
2283
|
eventsEmit: l,
|
|
2276
|
-
onRef:
|
|
2277
|
-
placeholder:
|
|
2278
|
-
listName:
|
|
2284
|
+
onRef: $,
|
|
2285
|
+
placeholder: H,
|
|
2286
|
+
listName: P
|
|
2279
2287
|
}) => {
|
|
2280
|
-
var
|
|
2281
|
-
const
|
|
2288
|
+
var Y, I;
|
|
2289
|
+
const te = Fe(), a = $e(
|
|
2282
2290
|
// 基础:默认主题 + useTheme的配置
|
|
2283
|
-
$e({ theme:
|
|
2291
|
+
$e({ theme: B, mode: "light" }, te),
|
|
2284
2292
|
// 最高层:用户手动传入的styles
|
|
2285
2293
|
N
|
|
2286
|
-
), T =
|
|
2294
|
+
), T = Te(null), [w, V] = ie(!1), [_, E] = ie([]), j = he((i) => (i ?? _).map((c) => ({
|
|
2287
2295
|
id: c.id,
|
|
2288
2296
|
name: c.name,
|
|
2289
2297
|
status: c.status,
|
|
@@ -2293,17 +2301,17 @@ const Ra = ({
|
|
|
2293
2301
|
file: c.file,
|
|
2294
2302
|
size: c.size,
|
|
2295
2303
|
type: c.type
|
|
2296
|
-
})), [
|
|
2297
|
-
if (!
|
|
2298
|
-
if (typeof
|
|
2299
|
-
let i =
|
|
2304
|
+
})), [_]), ee = Se(() => {
|
|
2305
|
+
if (!H) return null;
|
|
2306
|
+
if (typeof H == "string") {
|
|
2307
|
+
let i = H;
|
|
2300
2308
|
return i = i.replace(/<br\s*\/?>(?=\s*)/gi, `
|
|
2301
2309
|
`), i = i.replace(/\s*\/n\s*/gi, `
|
|
2302
2310
|
`), i = i.replace(/\\n/g, `
|
|
2303
2311
|
`), /* @__PURE__ */ o(
|
|
2304
|
-
|
|
2312
|
+
Or,
|
|
2305
2313
|
{
|
|
2306
|
-
$theme: a.theme ||
|
|
2314
|
+
$theme: a.theme || B,
|
|
2307
2315
|
style: {
|
|
2308
2316
|
textAlign: "center",
|
|
2309
2317
|
whiteSpace: "pre-line"
|
|
@@ -2312,32 +2320,32 @@ const Ra = ({
|
|
|
2312
2320
|
}
|
|
2313
2321
|
);
|
|
2314
2322
|
}
|
|
2315
|
-
return
|
|
2316
|
-
}, [
|
|
2323
|
+
return H;
|
|
2324
|
+
}, [H, a.theme]), Z = {
|
|
2317
2325
|
noUrl: "请提供上传接口地址 (url)",
|
|
2318
2326
|
uploadFailed: "上传失败,请重试",
|
|
2319
2327
|
fileTooLarge: `文件大小不能超过 ${t}MB`,
|
|
2320
2328
|
invalidFileType: "不支持的文件类型"
|
|
2321
|
-
},
|
|
2329
|
+
}, W = { ...Z, ...M }, re = (i, u) => W[i] ? W[i] : u || Z[i], G = (i) => {
|
|
2322
2330
|
const u = i / 1048576;
|
|
2323
2331
|
return `${Number(u.toFixed(2))}MB`;
|
|
2324
|
-
},
|
|
2332
|
+
}, C = he(
|
|
2325
2333
|
(i, u) => {
|
|
2326
|
-
const c = t * 1024 * 1024, n = [],
|
|
2334
|
+
const c = t * 1024 * 1024, n = [], A = [];
|
|
2327
2335
|
if (i.forEach((g) => {
|
|
2328
|
-
g.size > c ? n.push(g) :
|
|
2336
|
+
g.size > c ? n.push(g) : A.push(g);
|
|
2329
2337
|
}), n.length > 0) {
|
|
2330
|
-
const g = n.map((ye) => `${ye.name}(${G(ye.size)})`).join("、"),
|
|
2338
|
+
const g = n.map((ye) => `${ye.name}(${G(ye.size)})`).join("、"), ae = `${re("fileTooLarge")}:${g}`;
|
|
2331
2339
|
l == null || l("uploader:error", {
|
|
2332
2340
|
type: "fileTooLarge",
|
|
2333
|
-
message:
|
|
2341
|
+
message: ae,
|
|
2334
2342
|
files: n.map((ye) => ({ name: ye.name, size: ye.size })),
|
|
2335
2343
|
limit: `${t}MB`,
|
|
2336
|
-
data:
|
|
2344
|
+
data: j()
|
|
2337
2345
|
});
|
|
2338
2346
|
}
|
|
2339
|
-
const
|
|
2340
|
-
if (
|
|
2347
|
+
const D = Math.max(0, s - u);
|
|
2348
|
+
if (D <= 0) {
|
|
2341
2349
|
const g = `最多只能上传 ${s} 个文件,已存在 ${u} 个,无法继续添加。`;
|
|
2342
2350
|
return l == null || l("uploader:error", {
|
|
2343
2351
|
type: "tooManyFiles",
|
|
@@ -2345,32 +2353,32 @@ const Ra = ({
|
|
|
2345
2353
|
currentCount: u,
|
|
2346
2354
|
tryAdd: i.length,
|
|
2347
2355
|
limit: s,
|
|
2348
|
-
data:
|
|
2356
|
+
data: j()
|
|
2349
2357
|
}), [];
|
|
2350
2358
|
}
|
|
2351
|
-
const m =
|
|
2352
|
-
if (
|
|
2353
|
-
const g =
|
|
2359
|
+
const m = A.slice(0, D);
|
|
2360
|
+
if (A.length > D) {
|
|
2361
|
+
const g = A.length - m.length, ae = `最多只能上传 ${s} 个文件,本次仅接受 ${m.length} 个,忽略 ${g} 个。`;
|
|
2354
2362
|
l == null || l("uploader:error", {
|
|
2355
2363
|
type: "tooManyFiles",
|
|
2356
|
-
message:
|
|
2364
|
+
message: ae,
|
|
2357
2365
|
currentCount: u,
|
|
2358
2366
|
accepted: m.length,
|
|
2359
2367
|
dropped: g,
|
|
2360
2368
|
limit: s,
|
|
2361
|
-
data:
|
|
2369
|
+
data: j()
|
|
2362
2370
|
});
|
|
2363
2371
|
}
|
|
2364
2372
|
return m;
|
|
2365
2373
|
},
|
|
2366
|
-
[t, s,
|
|
2374
|
+
[t, s, re, l, j]
|
|
2367
2375
|
), y = Se(
|
|
2368
2376
|
() => ({
|
|
2369
2377
|
// 获取所有上传项
|
|
2370
|
-
getUploadItems: () =>
|
|
2378
|
+
getUploadItems: () => _,
|
|
2371
2379
|
// 获取所有上传项的数据(包含表单数据)
|
|
2372
2380
|
getUploadItemsData: (i) => {
|
|
2373
|
-
let u =
|
|
2381
|
+
let u = _;
|
|
2374
2382
|
return i != null && i.includeStatus && (u = u.filter(
|
|
2375
2383
|
(c) => i.includeStatus.includes(c.status)
|
|
2376
2384
|
)), i != null && i.excludeStatus && (u = u.filter(
|
|
@@ -2390,26 +2398,26 @@ const Ra = ({
|
|
|
2390
2398
|
},
|
|
2391
2399
|
// 清空所有上传项
|
|
2392
2400
|
clearUploadItems: () => {
|
|
2393
|
-
|
|
2401
|
+
E([]), l == null || l("uploader:clear", {});
|
|
2394
2402
|
},
|
|
2395
2403
|
// 新增:设置某个 item 的错误信息
|
|
2396
2404
|
setItemError: (i, u) => {
|
|
2397
|
-
|
|
2405
|
+
E((c) => c.map(
|
|
2398
2406
|
(n) => n.id === i ? { ...n, status: "error", error: u } : n
|
|
2399
|
-
)), l == null || l("uploader:errorSet", { itemId: i, error: u, data:
|
|
2407
|
+
)), l == null || l("uploader:errorSet", { itemId: i, error: u, data: j() });
|
|
2400
2408
|
},
|
|
2401
2409
|
// 新增:清除某个 item 的错误信息
|
|
2402
2410
|
clearItemError: (i) => {
|
|
2403
|
-
|
|
2411
|
+
E((u) => u.map(
|
|
2404
2412
|
(c) => c.id === i ? { ...c, status: "pending", error: void 0 } : c
|
|
2405
|
-
)), l == null || l("uploader:errorCleared", { itemId: i, data:
|
|
2413
|
+
)), l == null || l("uploader:errorCleared", { itemId: i, data: j() });
|
|
2406
2414
|
},
|
|
2407
2415
|
// 添加新的上传项(对外方法也应用限流)
|
|
2408
2416
|
addUploadItems: (i) => {
|
|
2409
|
-
const u =
|
|
2417
|
+
const u = C(i, _.length);
|
|
2410
2418
|
if (u.length === 0) return;
|
|
2411
2419
|
const c = u.map((n) => ({
|
|
2412
|
-
id:
|
|
2420
|
+
id: jr(),
|
|
2413
2421
|
file: n,
|
|
2414
2422
|
name: n.name,
|
|
2415
2423
|
size: n.size,
|
|
@@ -2419,34 +2427,34 @@ const Ra = ({
|
|
|
2419
2427
|
formData: {},
|
|
2420
2428
|
isExpanded: !1
|
|
2421
2429
|
}));
|
|
2422
|
-
|
|
2430
|
+
E((n) => [...n, ...c]), h && R(c);
|
|
2423
2431
|
},
|
|
2424
2432
|
// 移除指定上传项
|
|
2425
2433
|
removeUploadItem: (i) => {
|
|
2426
|
-
|
|
2434
|
+
E((u) => {
|
|
2427
2435
|
const c = u.find((n) => n.id === i);
|
|
2428
2436
|
return c && (l == null || l("uploader:remove", {
|
|
2429
2437
|
itemId: i,
|
|
2430
2438
|
item: c,
|
|
2431
|
-
data:
|
|
2439
|
+
data: j(u)
|
|
2432
2440
|
})), u.filter((n) => n.id !== i);
|
|
2433
2441
|
});
|
|
2434
2442
|
},
|
|
2435
2443
|
// 验证表单数据
|
|
2436
|
-
validateFormData: async () => !(
|
|
2444
|
+
validateFormData: async () => !(_.some((n) => n.status === "error") || _.some((n) => n.status === "uploading") || !_.some((n) => n.status === "success"))
|
|
2437
2445
|
}),
|
|
2438
|
-
[
|
|
2446
|
+
[_, h, l, C, j]
|
|
2439
2447
|
);
|
|
2440
2448
|
we(() => {
|
|
2441
|
-
|
|
2442
|
-
}, [y,
|
|
2443
|
-
const x =
|
|
2449
|
+
$ && $(y);
|
|
2450
|
+
}, [y, $]);
|
|
2451
|
+
const x = he(
|
|
2444
2452
|
(i) => {
|
|
2445
2453
|
if (!i) return;
|
|
2446
|
-
const u =
|
|
2454
|
+
const u = C(Array.from(i), _.length);
|
|
2447
2455
|
if (u.length === 0) return;
|
|
2448
2456
|
const c = u.map((n) => ({
|
|
2449
|
-
id:
|
|
2457
|
+
id: jr(),
|
|
2450
2458
|
file: n,
|
|
2451
2459
|
name: n.name,
|
|
2452
2460
|
size: n.size,
|
|
@@ -2457,43 +2465,43 @@ const Ra = ({
|
|
|
2457
2465
|
// 每个item独立的表单数据
|
|
2458
2466
|
isExpanded: !1
|
|
2459
2467
|
}));
|
|
2460
|
-
|
|
2468
|
+
E((n) => [...n, ...c]), h && R(c);
|
|
2461
2469
|
},
|
|
2462
|
-
[h,
|
|
2463
|
-
),
|
|
2464
|
-
i.preventDefault(),
|
|
2465
|
-
}, []),
|
|
2466
|
-
i.preventDefault(),
|
|
2467
|
-
}, []),
|
|
2470
|
+
[h, _.length, C]
|
|
2471
|
+
), z = he((i) => {
|
|
2472
|
+
i.preventDefault(), V(!0);
|
|
2473
|
+
}, []), k = he((i) => {
|
|
2474
|
+
i.preventDefault(), V(!1);
|
|
2475
|
+
}, []), q = he(
|
|
2468
2476
|
(i) => {
|
|
2469
|
-
i.preventDefault(),
|
|
2477
|
+
i.preventDefault(), V(!1), x(i.dataTransfer.files);
|
|
2470
2478
|
},
|
|
2471
2479
|
[x]
|
|
2472
|
-
),
|
|
2480
|
+
), R = he(
|
|
2473
2481
|
async (i) => {
|
|
2474
2482
|
if (!b) {
|
|
2475
|
-
console.error(
|
|
2483
|
+
console.error(re("noUrl"));
|
|
2476
2484
|
return;
|
|
2477
2485
|
}
|
|
2478
|
-
l == null || l("uploader:start", { items: i, data:
|
|
2486
|
+
l == null || l("uploader:start", { items: i, data: j() });
|
|
2479
2487
|
for (const u of i)
|
|
2480
2488
|
try {
|
|
2481
|
-
|
|
2489
|
+
E(
|
|
2482
2490
|
(m) => m.map((g) => g.id === u.id ? { ...g, status: "uploading" } : g)
|
|
2483
2491
|
);
|
|
2484
|
-
const c = await
|
|
2485
|
-
|
|
2486
|
-
}), n =
|
|
2492
|
+
const c = await za(u.file, b, p, d, (m) => {
|
|
2493
|
+
E((g) => g.map((ae) => ae.id === u.id ? { ...ae, progress: m } : ae)), l == null || l("uploader:progress", { item: { ...u, progress: m }, data: j() });
|
|
2494
|
+
}), n = Da(u, f), A = {
|
|
2487
2495
|
...u,
|
|
2488
2496
|
status: "success",
|
|
2489
2497
|
uploadApiRes: c,
|
|
2490
2498
|
progress: 100,
|
|
2491
2499
|
formData: n,
|
|
2492
2500
|
// 使用自动填充后的表单数据
|
|
2493
|
-
isExpanded:
|
|
2501
|
+
isExpanded: f.length > 0
|
|
2494
2502
|
// 上传成功后,如果有表单配置则默认展开
|
|
2495
|
-
},
|
|
2496
|
-
|
|
2503
|
+
}, D = _.map((m) => m.id === u.id ? A : m);
|
|
2504
|
+
E((m) => m.map((g) => g.id === u.id ? A : g)), l == null || l("uploader:success", { item: A, data: j(D) });
|
|
2497
2505
|
} catch (c) {
|
|
2498
2506
|
let n = "";
|
|
2499
2507
|
if (console.log("上传错误详情:", c), c && typeof c == "object") {
|
|
@@ -2553,28 +2561,28 @@ const Ra = ({
|
|
|
2553
2561
|
console.log("错误消息解析失败:", g), n = m.message;
|
|
2554
2562
|
}
|
|
2555
2563
|
}
|
|
2556
|
-
n || (n =
|
|
2557
|
-
const
|
|
2558
|
-
|
|
2564
|
+
n || (n = re("uploadFailed")), console.log("最终使用的错误信息:", n);
|
|
2565
|
+
const A = { ...u, status: "error", error: n }, D = _.map((m) => m.id === u.id ? A : m);
|
|
2566
|
+
E((m) => m.map((g) => g.id === u.id ? A : g)), l == null || l("uploader:error", { item: A, error: n, data: j(D) });
|
|
2559
2567
|
}
|
|
2560
|
-
l == null || l("uploader:complete", { items:
|
|
2568
|
+
l == null || l("uploader:complete", { items: _, data: j() });
|
|
2561
2569
|
},
|
|
2562
|
-
[b,
|
|
2563
|
-
),
|
|
2570
|
+
[b, p, d, l, _, f, W.uploadFailed, j]
|
|
2571
|
+
), Q = he(
|
|
2564
2572
|
(i) => {
|
|
2565
|
-
|
|
2573
|
+
E((u) => {
|
|
2566
2574
|
const c = u.find((n) => n.id === i);
|
|
2567
2575
|
return c && (l == null || l("uploader:remove", {
|
|
2568
2576
|
itemId: i,
|
|
2569
2577
|
item: c,
|
|
2570
|
-
data:
|
|
2578
|
+
data: j(u)
|
|
2571
2579
|
})), u.filter((n) => n.id !== i);
|
|
2572
2580
|
});
|
|
2573
2581
|
},
|
|
2574
|
-
[l,
|
|
2575
|
-
),
|
|
2582
|
+
[l, j]
|
|
2583
|
+
), X = he(
|
|
2576
2584
|
(i) => {
|
|
2577
|
-
|
|
2585
|
+
E(
|
|
2578
2586
|
(u) => u.map((c) => {
|
|
2579
2587
|
if (c.id === i) {
|
|
2580
2588
|
const n = {
|
|
@@ -2585,74 +2593,74 @@ const Ra = ({
|
|
|
2585
2593
|
itemId: i,
|
|
2586
2594
|
isExpanded: n.isExpanded,
|
|
2587
2595
|
item: n,
|
|
2588
|
-
data:
|
|
2596
|
+
data: j(u)
|
|
2589
2597
|
}), n;
|
|
2590
2598
|
}
|
|
2591
2599
|
return c;
|
|
2592
2600
|
})
|
|
2593
2601
|
);
|
|
2594
2602
|
},
|
|
2595
|
-
[l,
|
|
2596
|
-
),
|
|
2603
|
+
[l, j]
|
|
2604
|
+
), S = he(
|
|
2597
2605
|
(i, u) => {
|
|
2598
|
-
console.log("FormData Change:", i, u),
|
|
2599
|
-
const n = c.map((
|
|
2600
|
-
if (
|
|
2601
|
-
const
|
|
2602
|
-
...
|
|
2606
|
+
console.log("FormData Change:", i, u), E((c) => {
|
|
2607
|
+
const n = c.map((A) => {
|
|
2608
|
+
if (A.id === i) {
|
|
2609
|
+
const D = {
|
|
2610
|
+
...A,
|
|
2603
2611
|
formData: { ...u }
|
|
2604
2612
|
// 确保数据是深拷贝
|
|
2605
2613
|
};
|
|
2606
2614
|
return l == null || l("uploader:formDataChange", {
|
|
2607
2615
|
itemId: i,
|
|
2608
|
-
formData:
|
|
2609
|
-
item:
|
|
2610
|
-
data:
|
|
2611
|
-
}),
|
|
2616
|
+
formData: D.formData,
|
|
2617
|
+
item: D,
|
|
2618
|
+
data: j(c)
|
|
2619
|
+
}), D;
|
|
2612
2620
|
}
|
|
2613
|
-
return
|
|
2621
|
+
return A;
|
|
2614
2622
|
});
|
|
2615
2623
|
return l == null || l("uploader:dataChange", {
|
|
2616
2624
|
items: n,
|
|
2617
2625
|
changedItemId: i,
|
|
2618
2626
|
changedFormData: u,
|
|
2619
|
-
data:
|
|
2627
|
+
data: j(n)
|
|
2620
2628
|
}), n;
|
|
2621
2629
|
});
|
|
2622
2630
|
},
|
|
2623
|
-
[l,
|
|
2631
|
+
[l, j]
|
|
2624
2632
|
);
|
|
2625
|
-
return /* @__PURE__ */
|
|
2626
|
-
/* @__PURE__ */
|
|
2627
|
-
|
|
2633
|
+
return /* @__PURE__ */ L("div", { children: [
|
|
2634
|
+
/* @__PURE__ */ L(
|
|
2635
|
+
Aa,
|
|
2628
2636
|
{
|
|
2629
|
-
$theme: a.theme ||
|
|
2630
|
-
$isDragOver:
|
|
2631
|
-
onDragOver:
|
|
2632
|
-
onDragLeave:
|
|
2633
|
-
onDrop:
|
|
2637
|
+
$theme: a.theme || B,
|
|
2638
|
+
$isDragOver: w,
|
|
2639
|
+
onDragOver: z,
|
|
2640
|
+
onDragLeave: k,
|
|
2641
|
+
onDrop: q,
|
|
2634
2642
|
onClick: () => {
|
|
2635
2643
|
var i;
|
|
2636
2644
|
T.current && (T.current.value = ""), (i = T.current) == null || i.click();
|
|
2637
2645
|
},
|
|
2638
2646
|
children: [
|
|
2639
|
-
/* @__PURE__ */ o(
|
|
2640
|
-
|
|
2641
|
-
/* @__PURE__ */ o(
|
|
2642
|
-
/* @__PURE__ */
|
|
2647
|
+
/* @__PURE__ */ o(_a, { $theme: a.theme || B, children: (O == null ? void 0 : O.dragUpload) || /* @__PURE__ */ o(ma, { size: 48 }) }),
|
|
2648
|
+
ee || /* @__PURE__ */ L(na, { children: [
|
|
2649
|
+
/* @__PURE__ */ o(Ba, { $theme: a.theme || B, children: "拖拽文件到此处或点击选择文件" }),
|
|
2650
|
+
/* @__PURE__ */ L(Or, { $theme: a.theme || B, children: [
|
|
2643
2651
|
"支持 ",
|
|
2644
2652
|
r,
|
|
2645
2653
|
" 格式,单个文件最大 ",
|
|
2646
2654
|
t,
|
|
2647
2655
|
"MB",
|
|
2648
|
-
!b && /* @__PURE__ */ o("div", { style: { color: ((
|
|
2656
|
+
!b && /* @__PURE__ */ o("div", { style: { color: ((I = (Y = a.theme) == null ? void 0 : Y.colors) == null ? void 0 : I.error) || "#FF0000", marginTop: "8px", fontSize: "12px" }, children: re("noUrl") })
|
|
2649
2657
|
] })
|
|
2650
2658
|
] })
|
|
2651
2659
|
]
|
|
2652
2660
|
}
|
|
2653
2661
|
),
|
|
2654
2662
|
/* @__PURE__ */ o(
|
|
2655
|
-
|
|
2663
|
+
Wa,
|
|
2656
2664
|
{
|
|
2657
2665
|
ref: T,
|
|
2658
2666
|
type: "file",
|
|
@@ -2663,20 +2671,20 @@ const Ra = ({
|
|
|
2663
2671
|
}
|
|
2664
2672
|
}
|
|
2665
2673
|
),
|
|
2666
|
-
|
|
2667
|
-
/* @__PURE__ */
|
|
2674
|
+
_.length > 0 && /* @__PURE__ */ L("div", { children: [
|
|
2675
|
+
/* @__PURE__ */ L("div", { style: {
|
|
2668
2676
|
display: "flex",
|
|
2669
2677
|
justifyContent: "space-between",
|
|
2670
2678
|
alignItems: "center",
|
|
2671
2679
|
margin: "6px 0px"
|
|
2672
2680
|
}, children: [
|
|
2673
|
-
/* @__PURE__ */ o("div", { className: "text-[14px] font-bold opacity-60", children:
|
|
2674
|
-
|
|
2681
|
+
/* @__PURE__ */ o("div", { className: "text-[14px] font-bold opacity-60", children: P || "上传文件列表" }),
|
|
2682
|
+
F.length > 0 && /* @__PURE__ */ o("div", { style: {
|
|
2675
2683
|
display: "flex",
|
|
2676
2684
|
gap: "8px",
|
|
2677
2685
|
alignItems: "center"
|
|
2678
|
-
}, children:
|
|
2679
|
-
|
|
2686
|
+
}, children: F.map((i, u) => /* @__PURE__ */ o(
|
|
2687
|
+
er,
|
|
2680
2688
|
{
|
|
2681
2689
|
mode: i.mode || "default",
|
|
2682
2690
|
label: i.label,
|
|
@@ -2688,56 +2696,56 @@ const Ra = ({
|
|
|
2688
2696
|
u
|
|
2689
2697
|
)) })
|
|
2690
2698
|
] }),
|
|
2691
|
-
/* @__PURE__ */ o(
|
|
2692
|
-
|
|
2699
|
+
/* @__PURE__ */ o(Ra, { $theme: a.theme || B, children: _.map((i, u) => /* @__PURE__ */ o(
|
|
2700
|
+
Pa,
|
|
2693
2701
|
{
|
|
2694
2702
|
item: i,
|
|
2695
2703
|
index: u,
|
|
2696
|
-
itemForm:
|
|
2697
|
-
onRemove:
|
|
2698
|
-
onToggleExpand:
|
|
2699
|
-
onFormDataChange:
|
|
2700
|
-
theme: a.theme ||
|
|
2701
|
-
icons:
|
|
2704
|
+
itemForm: f,
|
|
2705
|
+
onRemove: Q,
|
|
2706
|
+
onToggleExpand: X,
|
|
2707
|
+
onFormDataChange: S,
|
|
2708
|
+
theme: a.theme || B,
|
|
2709
|
+
icons: O
|
|
2702
2710
|
},
|
|
2703
2711
|
i.id
|
|
2704
2712
|
)) })
|
|
2705
2713
|
] })
|
|
2706
2714
|
] });
|
|
2707
|
-
},
|
|
2715
|
+
}, zt = (e) => {
|
|
2708
2716
|
const r = {};
|
|
2709
2717
|
return e.forEach((t) => {
|
|
2710
2718
|
const s = t.name ?? t.key;
|
|
2711
2719
|
t.defaultValue !== void 0 && s && (r[s] = t.defaultValue);
|
|
2712
2720
|
}), r;
|
|
2713
|
-
},
|
|
2721
|
+
}, At = (e, r) => {
|
|
2714
2722
|
const t = {};
|
|
2715
2723
|
return r.forEach((s) => {
|
|
2716
2724
|
var d;
|
|
2717
|
-
const h = s.name ?? s.key, b = e[h],
|
|
2725
|
+
const h = s.name ?? s.key, b = e[h], p = s.validation || [];
|
|
2718
2726
|
if (s.required && (b == null || b === "")) {
|
|
2719
|
-
t[h] = ((d =
|
|
2727
|
+
t[h] = ((d = p.find((f) => f.required)) == null ? void 0 : d.message) || `${s.label}是必填项`;
|
|
2720
2728
|
return;
|
|
2721
2729
|
}
|
|
2722
|
-
|
|
2723
|
-
if (
|
|
2724
|
-
t[h] =
|
|
2730
|
+
p.forEach((f) => {
|
|
2731
|
+
if (f.required && (b == null || b === "")) {
|
|
2732
|
+
t[h] = f.message || `${s.label}是必填项`;
|
|
2725
2733
|
return;
|
|
2726
2734
|
}
|
|
2727
|
-
if (
|
|
2728
|
-
t[h] =
|
|
2735
|
+
if (f.pattern && b && !f.pattern.test(b)) {
|
|
2736
|
+
t[h] = f.message || `${s.label}格式不正确`;
|
|
2729
2737
|
return;
|
|
2730
2738
|
}
|
|
2731
|
-
if (
|
|
2732
|
-
t[h] =
|
|
2739
|
+
if (f.min !== void 0 && b < f.min) {
|
|
2740
|
+
t[h] = f.message || `${s.label}不能小于${f.min}`;
|
|
2733
2741
|
return;
|
|
2734
2742
|
}
|
|
2735
|
-
if (
|
|
2736
|
-
t[h] =
|
|
2743
|
+
if (f.max !== void 0 && b > f.max) {
|
|
2744
|
+
t[h] = f.message || `${s.label}不能大于${f.max}`;
|
|
2737
2745
|
return;
|
|
2738
2746
|
}
|
|
2739
|
-
if (
|
|
2740
|
-
const N =
|
|
2747
|
+
if (f.validator && typeof f.validator == "function") {
|
|
2748
|
+
const N = f.validator(b);
|
|
2741
2749
|
if (N !== !0) {
|
|
2742
2750
|
t[h] = typeof N == "string" ? N : `${s.label}验证失败`;
|
|
2743
2751
|
return;
|
|
@@ -2745,7 +2753,7 @@ const Ra = ({
|
|
|
2745
2753
|
}
|
|
2746
2754
|
});
|
|
2747
2755
|
}), t;
|
|
2748
|
-
},
|
|
2756
|
+
}, _t = (e = 5) => {
|
|
2749
2757
|
const r = [];
|
|
2750
2758
|
for (let t = 0; t < e; t++) {
|
|
2751
2759
|
const s = ["input", "select", "radio", "checkbox", "date", "number"], h = s[t % s.length];
|
|
@@ -2777,266 +2785,266 @@ const Ra = ({
|
|
|
2777
2785
|
});
|
|
2778
2786
|
}
|
|
2779
2787
|
return r;
|
|
2780
|
-
},
|
|
2781
|
-
function
|
|
2788
|
+
}, Bt = (e) => Object.keys(e).length === 0, Wt = (e) => Object.values(e).filter(Boolean);
|
|
2789
|
+
function ia(e) {
|
|
2782
2790
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
2783
2791
|
}
|
|
2784
|
-
var
|
|
2785
|
-
function
|
|
2786
|
-
return
|
|
2792
|
+
var sr = { exports: {} }, Za = sr.exports, Ir;
|
|
2793
|
+
function da() {
|
|
2794
|
+
return Ir || (Ir = 1, (function(e, r) {
|
|
2787
2795
|
(function(t, s) {
|
|
2788
2796
|
e.exports = s();
|
|
2789
|
-
})(
|
|
2790
|
-
var t = 1e3, s = 6e4, h = 36e5, b = "millisecond",
|
|
2791
|
-
var y = ["th", "st", "nd", "rd"], x =
|
|
2792
|
-
return "[" +
|
|
2793
|
-
} }, T = function(
|
|
2794
|
-
var
|
|
2795
|
-
return !
|
|
2796
|
-
},
|
|
2797
|
-
var y = -
|
|
2798
|
-
return (y <= 0 ? "+" : "-") + T(
|
|
2799
|
-
}, m: function
|
|
2800
|
-
if (y.date() < x.date()) return -
|
|
2801
|
-
var
|
|
2802
|
-
return +(-(
|
|
2803
|
-
}, a: function(
|
|
2804
|
-
return
|
|
2805
|
-
}, p: function(
|
|
2806
|
-
return { M, y: l, w:
|
|
2807
|
-
}, u: function(
|
|
2808
|
-
return
|
|
2809
|
-
} },
|
|
2810
|
-
|
|
2811
|
-
var
|
|
2812
|
-
return
|
|
2813
|
-
},
|
|
2814
|
-
var
|
|
2815
|
-
if (!y) return
|
|
2797
|
+
})(Za, (function() {
|
|
2798
|
+
var t = 1e3, s = 6e4, h = 36e5, b = "millisecond", p = "second", d = "minute", f = "hour", N = "day", F = "week", M = "month", O = "quarter", l = "year", $ = "date", H = "Invalid Date", P = /^(\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(C) {
|
|
2799
|
+
var y = ["th", "st", "nd", "rd"], x = C % 100;
|
|
2800
|
+
return "[" + C + (y[(x - 20) % 10] || y[x] || y[0]) + "]";
|
|
2801
|
+
} }, T = function(C, y, x) {
|
|
2802
|
+
var z = String(C);
|
|
2803
|
+
return !z || z.length >= y ? C : "" + Array(y + 1 - z.length).join(x) + C;
|
|
2804
|
+
}, w = { s: T, z: function(C) {
|
|
2805
|
+
var y = -C.utcOffset(), x = Math.abs(y), z = Math.floor(x / 60), k = x % 60;
|
|
2806
|
+
return (y <= 0 ? "+" : "-") + T(z, 2, "0") + ":" + T(k, 2, "0");
|
|
2807
|
+
}, m: function C(y, x) {
|
|
2808
|
+
if (y.date() < x.date()) return -C(x, y);
|
|
2809
|
+
var z = 12 * (x.year() - y.year()) + (x.month() - y.month()), k = y.clone().add(z, M), q = x - k < 0, R = y.clone().add(z + (q ? -1 : 1), M);
|
|
2810
|
+
return +(-(z + (x - k) / (q ? k - R : R - k)) || 0);
|
|
2811
|
+
}, a: function(C) {
|
|
2812
|
+
return C < 0 ? Math.ceil(C) || 0 : Math.floor(C);
|
|
2813
|
+
}, p: function(C) {
|
|
2814
|
+
return { M, y: l, w: F, d: N, D: $, h: f, m: d, s: p, ms: b, Q: O }[C] || String(C || "").toLowerCase().replace(/s$/, "");
|
|
2815
|
+
}, u: function(C) {
|
|
2816
|
+
return C === void 0;
|
|
2817
|
+
} }, V = "en", _ = {};
|
|
2818
|
+
_[V] = a;
|
|
2819
|
+
var E = "$isDayjsObject", j = function(C) {
|
|
2820
|
+
return C instanceof re || !(!C || !C[E]);
|
|
2821
|
+
}, ee = function C(y, x, z) {
|
|
2822
|
+
var k;
|
|
2823
|
+
if (!y) return V;
|
|
2816
2824
|
if (typeof y == "string") {
|
|
2817
|
-
var
|
|
2818
|
-
|
|
2819
|
-
var
|
|
2820
|
-
if (!
|
|
2825
|
+
var q = y.toLowerCase();
|
|
2826
|
+
_[q] && (k = q), x && (_[q] = x, k = q);
|
|
2827
|
+
var R = y.split("-");
|
|
2828
|
+
if (!k && R.length > 1) return C(R[0]);
|
|
2821
2829
|
} else {
|
|
2822
|
-
var
|
|
2823
|
-
|
|
2830
|
+
var Q = y.name;
|
|
2831
|
+
_[Q] = y, k = Q;
|
|
2824
2832
|
}
|
|
2825
|
-
return !
|
|
2826
|
-
},
|
|
2827
|
-
if (
|
|
2833
|
+
return !z && k && (V = k), k || !z && V;
|
|
2834
|
+
}, Z = function(C, y) {
|
|
2835
|
+
if (j(C)) return C.clone();
|
|
2828
2836
|
var x = typeof y == "object" ? y : {};
|
|
2829
|
-
return x.date =
|
|
2830
|
-
},
|
|
2831
|
-
|
|
2832
|
-
return
|
|
2837
|
+
return x.date = C, x.args = arguments, new re(x);
|
|
2838
|
+
}, W = w;
|
|
2839
|
+
W.l = ee, W.i = j, W.w = function(C, y) {
|
|
2840
|
+
return Z(C, { locale: y.$L, utc: y.$u, x: y.$x, $offset: y.$offset });
|
|
2833
2841
|
};
|
|
2834
|
-
var
|
|
2835
|
-
function
|
|
2836
|
-
this.$L =
|
|
2842
|
+
var re = (function() {
|
|
2843
|
+
function C(x) {
|
|
2844
|
+
this.$L = ee(x.locale, null, !0), this.parse(x), this.$x = this.$x || x.x || {}, this[E] = !0;
|
|
2837
2845
|
}
|
|
2838
|
-
var y =
|
|
2846
|
+
var y = C.prototype;
|
|
2839
2847
|
return y.parse = function(x) {
|
|
2840
|
-
this.$d = (function(
|
|
2841
|
-
var
|
|
2842
|
-
if (
|
|
2843
|
-
if (
|
|
2844
|
-
if (
|
|
2845
|
-
if (typeof
|
|
2846
|
-
var
|
|
2847
|
-
if (
|
|
2848
|
-
var
|
|
2849
|
-
return
|
|
2848
|
+
this.$d = (function(z) {
|
|
2849
|
+
var k = z.date, q = z.utc;
|
|
2850
|
+
if (k === null) return /* @__PURE__ */ new Date(NaN);
|
|
2851
|
+
if (W.u(k)) return /* @__PURE__ */ new Date();
|
|
2852
|
+
if (k instanceof Date) return new Date(k);
|
|
2853
|
+
if (typeof k == "string" && !/Z$/i.test(k)) {
|
|
2854
|
+
var R = k.match(P);
|
|
2855
|
+
if (R) {
|
|
2856
|
+
var Q = R[2] - 1 || 0, X = (R[7] || "0").substring(0, 3);
|
|
2857
|
+
return q ? new Date(Date.UTC(R[1], Q, R[3] || 1, R[4] || 0, R[5] || 0, R[6] || 0, X)) : new Date(R[1], Q, R[3] || 1, R[4] || 0, R[5] || 0, R[6] || 0, X);
|
|
2850
2858
|
}
|
|
2851
2859
|
}
|
|
2852
|
-
return new Date(
|
|
2860
|
+
return new Date(k);
|
|
2853
2861
|
})(x), this.init();
|
|
2854
2862
|
}, y.init = function() {
|
|
2855
2863
|
var x = this.$d;
|
|
2856
2864
|
this.$y = x.getFullYear(), this.$M = x.getMonth(), this.$D = x.getDate(), this.$W = x.getDay(), this.$H = x.getHours(), this.$m = x.getMinutes(), this.$s = x.getSeconds(), this.$ms = x.getMilliseconds();
|
|
2857
2865
|
}, y.$utils = function() {
|
|
2858
|
-
return
|
|
2866
|
+
return W;
|
|
2859
2867
|
}, y.isValid = function() {
|
|
2860
|
-
return this.$d.toString() !==
|
|
2861
|
-
}, y.isSame = function(x,
|
|
2862
|
-
var
|
|
2863
|
-
return this.startOf(
|
|
2864
|
-
}, y.isAfter = function(x,
|
|
2865
|
-
return
|
|
2866
|
-
}, y.isBefore = function(x,
|
|
2867
|
-
return this.endOf(
|
|
2868
|
-
}, y.$g = function(x,
|
|
2869
|
-
return
|
|
2868
|
+
return this.$d.toString() !== H;
|
|
2869
|
+
}, y.isSame = function(x, z) {
|
|
2870
|
+
var k = Z(x);
|
|
2871
|
+
return this.startOf(z) <= k && k <= this.endOf(z);
|
|
2872
|
+
}, y.isAfter = function(x, z) {
|
|
2873
|
+
return Z(x) < this.startOf(z);
|
|
2874
|
+
}, y.isBefore = function(x, z) {
|
|
2875
|
+
return this.endOf(z) < Z(x);
|
|
2876
|
+
}, y.$g = function(x, z, k) {
|
|
2877
|
+
return W.u(x) ? this[z] : this.set(k, x);
|
|
2870
2878
|
}, y.unix = function() {
|
|
2871
2879
|
return Math.floor(this.valueOf() / 1e3);
|
|
2872
2880
|
}, y.valueOf = function() {
|
|
2873
2881
|
return this.$d.getTime();
|
|
2874
|
-
}, y.startOf = function(x,
|
|
2875
|
-
var
|
|
2876
|
-
var
|
|
2877
|
-
return
|
|
2878
|
-
},
|
|
2879
|
-
return
|
|
2880
|
-
},
|
|
2881
|
-
switch (
|
|
2882
|
+
}, y.startOf = function(x, z) {
|
|
2883
|
+
var k = this, q = !!W.u(z) || z, R = W.p(x), Q = function(n, A) {
|
|
2884
|
+
var D = W.w(k.$u ? Date.UTC(k.$y, A, n) : new Date(k.$y, A, n), k);
|
|
2885
|
+
return q ? D : D.endOf(N);
|
|
2886
|
+
}, X = function(n, A) {
|
|
2887
|
+
return W.w(k.toDate()[n].apply(k.toDate("s"), (q ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(A)), k);
|
|
2888
|
+
}, S = this.$W, Y = this.$M, I = this.$D, i = "set" + (this.$u ? "UTC" : "");
|
|
2889
|
+
switch (R) {
|
|
2882
2890
|
case l:
|
|
2883
|
-
return
|
|
2891
|
+
return q ? Q(1, 0) : Q(31, 11);
|
|
2884
2892
|
case M:
|
|
2885
|
-
return
|
|
2886
|
-
case
|
|
2887
|
-
var u = this.$locale().weekStart || 0, c = (
|
|
2888
|
-
return
|
|
2893
|
+
return q ? Q(1, Y) : Q(0, Y + 1);
|
|
2894
|
+
case F:
|
|
2895
|
+
var u = this.$locale().weekStart || 0, c = (S < u ? S + 7 : S) - u;
|
|
2896
|
+
return Q(q ? I - c : I + (6 - c), Y);
|
|
2889
2897
|
case N:
|
|
2890
|
-
case
|
|
2891
|
-
return
|
|
2892
|
-
case p:
|
|
2893
|
-
return P(i + "Minutes", 1);
|
|
2894
|
-
case d:
|
|
2895
|
-
return P(i + "Seconds", 2);
|
|
2898
|
+
case $:
|
|
2899
|
+
return X(i + "Hours", 0);
|
|
2896
2900
|
case f:
|
|
2897
|
-
return
|
|
2901
|
+
return X(i + "Minutes", 1);
|
|
2902
|
+
case d:
|
|
2903
|
+
return X(i + "Seconds", 2);
|
|
2904
|
+
case p:
|
|
2905
|
+
return X(i + "Milliseconds", 3);
|
|
2898
2906
|
default:
|
|
2899
2907
|
return this.clone();
|
|
2900
2908
|
}
|
|
2901
2909
|
}, y.endOf = function(x) {
|
|
2902
2910
|
return this.startOf(x, !1);
|
|
2903
|
-
}, y.$set = function(x,
|
|
2904
|
-
var
|
|
2905
|
-
if (
|
|
2906
|
-
var
|
|
2907
|
-
|
|
2908
|
-
} else
|
|
2911
|
+
}, y.$set = function(x, z) {
|
|
2912
|
+
var k, q = W.p(x), R = "set" + (this.$u ? "UTC" : ""), Q = (k = {}, k[N] = R + "Date", k[$] = R + "Date", k[M] = R + "Month", k[l] = R + "FullYear", k[f] = R + "Hours", k[d] = R + "Minutes", k[p] = R + "Seconds", k[b] = R + "Milliseconds", k)[q], X = q === N ? this.$D + (z - this.$W) : z;
|
|
2913
|
+
if (q === M || q === l) {
|
|
2914
|
+
var S = this.clone().set($, 1);
|
|
2915
|
+
S.$d[Q](X), S.init(), this.$d = S.set($, Math.min(this.$D, S.daysInMonth())).$d;
|
|
2916
|
+
} else Q && this.$d[Q](X);
|
|
2909
2917
|
return this.init(), this;
|
|
2910
|
-
}, y.set = function(x,
|
|
2911
|
-
return this.clone().$set(x,
|
|
2918
|
+
}, y.set = function(x, z) {
|
|
2919
|
+
return this.clone().$set(x, z);
|
|
2912
2920
|
}, y.get = function(x) {
|
|
2913
|
-
return this[
|
|
2914
|
-
}, y.add = function(x,
|
|
2915
|
-
var
|
|
2921
|
+
return this[W.p(x)]();
|
|
2922
|
+
}, y.add = function(x, z) {
|
|
2923
|
+
var k, q = this;
|
|
2916
2924
|
x = Number(x);
|
|
2917
|
-
var
|
|
2918
|
-
var
|
|
2919
|
-
return
|
|
2925
|
+
var R = W.p(z), Q = function(Y) {
|
|
2926
|
+
var I = Z(q);
|
|
2927
|
+
return W.w(I.date(I.date() + Math.round(Y * x)), q);
|
|
2920
2928
|
};
|
|
2921
|
-
if (
|
|
2922
|
-
if (
|
|
2923
|
-
if (
|
|
2924
|
-
if (
|
|
2925
|
-
var
|
|
2926
|
-
return
|
|
2927
|
-
}, y.subtract = function(x,
|
|
2928
|
-
return this.add(-1 * x,
|
|
2929
|
+
if (R === M) return this.set(M, this.$M + x);
|
|
2930
|
+
if (R === l) return this.set(l, this.$y + x);
|
|
2931
|
+
if (R === N) return Q(1);
|
|
2932
|
+
if (R === F) return Q(7);
|
|
2933
|
+
var X = (k = {}, k[d] = s, k[f] = h, k[p] = t, k)[R] || 1, S = this.$d.getTime() + x * X;
|
|
2934
|
+
return W.w(S, this);
|
|
2935
|
+
}, y.subtract = function(x, z) {
|
|
2936
|
+
return this.add(-1 * x, z);
|
|
2929
2937
|
}, y.format = function(x) {
|
|
2930
|
-
var
|
|
2931
|
-
if (!this.isValid()) return
|
|
2932
|
-
var
|
|
2933
|
-
return
|
|
2934
|
-
}, c = function(
|
|
2935
|
-
return
|
|
2936
|
-
}, n = i || function(
|
|
2937
|
-
var g =
|
|
2938
|
+
var z = this, k = this.$locale();
|
|
2939
|
+
if (!this.isValid()) return k.invalidDate || H;
|
|
2940
|
+
var q = x || "YYYY-MM-DDTHH:mm:ssZ", R = W.z(this), Q = this.$H, X = this.$m, S = this.$M, Y = k.weekdays, I = k.months, i = k.meridiem, u = function(A, D, m, g) {
|
|
2941
|
+
return A && (A[D] || A(z, q)) || m[D].slice(0, g);
|
|
2942
|
+
}, c = function(A) {
|
|
2943
|
+
return W.s(Q % 12 || 12, A, "0");
|
|
2944
|
+
}, n = i || function(A, D, m) {
|
|
2945
|
+
var g = A < 12 ? "AM" : "PM";
|
|
2938
2946
|
return m ? g.toLowerCase() : g;
|
|
2939
2947
|
};
|
|
2940
|
-
return
|
|
2941
|
-
return
|
|
2948
|
+
return q.replace(te, (function(A, D) {
|
|
2949
|
+
return D || (function(m) {
|
|
2942
2950
|
switch (m) {
|
|
2943
2951
|
case "YY":
|
|
2944
|
-
return String(
|
|
2952
|
+
return String(z.$y).slice(-2);
|
|
2945
2953
|
case "YYYY":
|
|
2946
|
-
return
|
|
2954
|
+
return W.s(z.$y, 4, "0");
|
|
2947
2955
|
case "M":
|
|
2948
|
-
return
|
|
2956
|
+
return S + 1;
|
|
2949
2957
|
case "MM":
|
|
2950
|
-
return
|
|
2958
|
+
return W.s(S + 1, 2, "0");
|
|
2951
2959
|
case "MMM":
|
|
2952
|
-
return u(
|
|
2960
|
+
return u(k.monthsShort, S, I, 3);
|
|
2953
2961
|
case "MMMM":
|
|
2954
|
-
return u(
|
|
2962
|
+
return u(I, S);
|
|
2955
2963
|
case "D":
|
|
2956
|
-
return
|
|
2964
|
+
return z.$D;
|
|
2957
2965
|
case "DD":
|
|
2958
|
-
return
|
|
2966
|
+
return W.s(z.$D, 2, "0");
|
|
2959
2967
|
case "d":
|
|
2960
|
-
return String(
|
|
2968
|
+
return String(z.$W);
|
|
2961
2969
|
case "dd":
|
|
2962
|
-
return u(
|
|
2970
|
+
return u(k.weekdaysMin, z.$W, Y, 2);
|
|
2963
2971
|
case "ddd":
|
|
2964
|
-
return u(
|
|
2972
|
+
return u(k.weekdaysShort, z.$W, Y, 3);
|
|
2965
2973
|
case "dddd":
|
|
2966
|
-
return
|
|
2974
|
+
return Y[z.$W];
|
|
2967
2975
|
case "H":
|
|
2968
|
-
return String(
|
|
2976
|
+
return String(Q);
|
|
2969
2977
|
case "HH":
|
|
2970
|
-
return
|
|
2978
|
+
return W.s(Q, 2, "0");
|
|
2971
2979
|
case "h":
|
|
2972
2980
|
return c(1);
|
|
2973
2981
|
case "hh":
|
|
2974
2982
|
return c(2);
|
|
2975
2983
|
case "a":
|
|
2976
|
-
return n(
|
|
2984
|
+
return n(Q, X, !0);
|
|
2977
2985
|
case "A":
|
|
2978
|
-
return n(
|
|
2986
|
+
return n(Q, X, !1);
|
|
2979
2987
|
case "m":
|
|
2980
|
-
return String(
|
|
2988
|
+
return String(X);
|
|
2981
2989
|
case "mm":
|
|
2982
|
-
return
|
|
2990
|
+
return W.s(X, 2, "0");
|
|
2983
2991
|
case "s":
|
|
2984
|
-
return String(
|
|
2992
|
+
return String(z.$s);
|
|
2985
2993
|
case "ss":
|
|
2986
|
-
return
|
|
2994
|
+
return W.s(z.$s, 2, "0");
|
|
2987
2995
|
case "SSS":
|
|
2988
|
-
return
|
|
2996
|
+
return W.s(z.$ms, 3, "0");
|
|
2989
2997
|
case "Z":
|
|
2990
|
-
return
|
|
2998
|
+
return R;
|
|
2991
2999
|
}
|
|
2992
3000
|
return null;
|
|
2993
|
-
})(
|
|
3001
|
+
})(A) || R.replace(":", "");
|
|
2994
3002
|
}));
|
|
2995
3003
|
}, y.utcOffset = function() {
|
|
2996
3004
|
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
2997
|
-
}, y.diff = function(x,
|
|
2998
|
-
var
|
|
2999
|
-
return
|
|
3005
|
+
}, y.diff = function(x, z, k) {
|
|
3006
|
+
var q, R = this, Q = W.p(z), X = Z(x), S = (X.utcOffset() - this.utcOffset()) * s, Y = this - X, I = function() {
|
|
3007
|
+
return W.m(R, X);
|
|
3000
3008
|
};
|
|
3001
|
-
switch (
|
|
3009
|
+
switch (Q) {
|
|
3002
3010
|
case l:
|
|
3003
|
-
|
|
3011
|
+
q = I() / 12;
|
|
3004
3012
|
break;
|
|
3005
3013
|
case M:
|
|
3006
|
-
|
|
3014
|
+
q = I();
|
|
3007
3015
|
break;
|
|
3008
|
-
case
|
|
3009
|
-
|
|
3016
|
+
case O:
|
|
3017
|
+
q = I() / 3;
|
|
3010
3018
|
break;
|
|
3011
|
-
case
|
|
3012
|
-
|
|
3019
|
+
case F:
|
|
3020
|
+
q = (Y - S) / 6048e5;
|
|
3013
3021
|
break;
|
|
3014
3022
|
case N:
|
|
3015
|
-
|
|
3023
|
+
q = (Y - S) / 864e5;
|
|
3016
3024
|
break;
|
|
3017
|
-
case
|
|
3018
|
-
|
|
3025
|
+
case f:
|
|
3026
|
+
q = Y / h;
|
|
3019
3027
|
break;
|
|
3020
3028
|
case d:
|
|
3021
|
-
|
|
3029
|
+
q = Y / s;
|
|
3022
3030
|
break;
|
|
3023
|
-
case
|
|
3024
|
-
|
|
3031
|
+
case p:
|
|
3032
|
+
q = Y / t;
|
|
3025
3033
|
break;
|
|
3026
3034
|
default:
|
|
3027
|
-
|
|
3035
|
+
q = Y;
|
|
3028
3036
|
}
|
|
3029
|
-
return
|
|
3037
|
+
return k ? q : W.a(q);
|
|
3030
3038
|
}, y.daysInMonth = function() {
|
|
3031
3039
|
return this.endOf(M).$D;
|
|
3032
3040
|
}, y.$locale = function() {
|
|
3033
|
-
return
|
|
3034
|
-
}, y.locale = function(x,
|
|
3041
|
+
return _[this.$L];
|
|
3042
|
+
}, y.locale = function(x, z) {
|
|
3035
3043
|
if (!x) return this.$L;
|
|
3036
|
-
var
|
|
3037
|
-
return
|
|
3044
|
+
var k = this.clone(), q = ee(x, z, !0);
|
|
3045
|
+
return q && (k.$L = q), k;
|
|
3038
3046
|
}, y.clone = function() {
|
|
3039
|
-
return
|
|
3047
|
+
return W.w(this.$d, this);
|
|
3040
3048
|
}, y.toDate = function() {
|
|
3041
3049
|
return new Date(this.valueOf());
|
|
3042
3050
|
}, y.toJSON = function() {
|
|
@@ -3045,91 +3053,91 @@ function Jr() {
|
|
|
3045
3053
|
return this.$d.toISOString();
|
|
3046
3054
|
}, y.toString = function() {
|
|
3047
3055
|
return this.$d.toUTCString();
|
|
3048
|
-
},
|
|
3049
|
-
})(), G =
|
|
3050
|
-
return
|
|
3051
|
-
G[
|
|
3052
|
-
return this.$g(y,
|
|
3056
|
+
}, C;
|
|
3057
|
+
})(), G = re.prototype;
|
|
3058
|
+
return Z.prototype = G, [["$ms", b], ["$s", p], ["$m", d], ["$H", f], ["$W", N], ["$M", M], ["$y", l], ["$D", $]].forEach((function(C) {
|
|
3059
|
+
G[C[1]] = function(y) {
|
|
3060
|
+
return this.$g(y, C[0], C[1]);
|
|
3053
3061
|
};
|
|
3054
|
-
})),
|
|
3055
|
-
return
|
|
3056
|
-
},
|
|
3057
|
-
return
|
|
3058
|
-
},
|
|
3062
|
+
})), Z.extend = function(C, y) {
|
|
3063
|
+
return C.$i || (C(y, re, Z), C.$i = !0), Z;
|
|
3064
|
+
}, Z.locale = ee, Z.isDayjs = j, Z.unix = function(C) {
|
|
3065
|
+
return Z(1e3 * C);
|
|
3066
|
+
}, Z.en = _[V], Z.Ls = _, Z.p = {}, Z;
|
|
3059
3067
|
}));
|
|
3060
|
-
})(
|
|
3068
|
+
})(sr)), sr.exports;
|
|
3061
3069
|
}
|
|
3062
|
-
var
|
|
3063
|
-
const
|
|
3064
|
-
var
|
|
3065
|
-
function
|
|
3066
|
-
return
|
|
3070
|
+
var Qa = da();
|
|
3071
|
+
const ur = /* @__PURE__ */ ia(Qa);
|
|
3072
|
+
var lr = { exports: {} }, et = lr.exports, Ur;
|
|
3073
|
+
function rt() {
|
|
3074
|
+
return Ur || (Ur = 1, (function(e, r) {
|
|
3067
3075
|
(function(t, s) {
|
|
3068
3076
|
e.exports = s();
|
|
3069
|
-
})(
|
|
3077
|
+
})(et, (function() {
|
|
3070
3078
|
return function(t, s, h) {
|
|
3071
3079
|
t = t || {};
|
|
3072
|
-
var b = s.prototype,
|
|
3073
|
-
function d(N,
|
|
3074
|
-
return b.fromToBase(N,
|
|
3080
|
+
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" };
|
|
3081
|
+
function d(N, F, M, O) {
|
|
3082
|
+
return b.fromToBase(N, F, M, O);
|
|
3075
3083
|
}
|
|
3076
|
-
h.en.relativeTime =
|
|
3077
|
-
for (var
|
|
3078
|
-
var
|
|
3079
|
-
|
|
3080
|
-
var
|
|
3081
|
-
if (
|
|
3082
|
-
|
|
3083
|
-
var
|
|
3084
|
-
l && (
|
|
3084
|
+
h.en.relativeTime = p, b.fromToBase = function(N, F, M, O, l) {
|
|
3085
|
+
for (var $, H, P, te = M.$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, w = 0; w < T; w += 1) {
|
|
3086
|
+
var V = a[w];
|
|
3087
|
+
V.d && ($ = O ? h(N).diff(M, V.d, !0) : M.diff(N, V.d, !0));
|
|
3088
|
+
var _ = (t.rounding || Math.round)(Math.abs($));
|
|
3089
|
+
if (P = $ > 0, _ <= V.r || !V.r) {
|
|
3090
|
+
_ <= 1 && w > 0 && (V = a[w - 1]);
|
|
3091
|
+
var E = te[V.l];
|
|
3092
|
+
l && (_ = l("" + _)), H = typeof E == "string" ? E.replace("%d", _) : E(_, F, V.l, P);
|
|
3085
3093
|
break;
|
|
3086
3094
|
}
|
|
3087
3095
|
}
|
|
3088
|
-
if (
|
|
3089
|
-
var
|
|
3090
|
-
return typeof
|
|
3091
|
-
}, b.to = function(N,
|
|
3092
|
-
return d(N,
|
|
3093
|
-
}, b.from = function(N,
|
|
3094
|
-
return d(N,
|
|
3096
|
+
if (F) return H;
|
|
3097
|
+
var j = P ? te.future : te.past;
|
|
3098
|
+
return typeof j == "function" ? j(H) : j.replace("%s", H);
|
|
3099
|
+
}, b.to = function(N, F) {
|
|
3100
|
+
return d(N, F, this, !0);
|
|
3101
|
+
}, b.from = function(N, F) {
|
|
3102
|
+
return d(N, F, this);
|
|
3095
3103
|
};
|
|
3096
|
-
var
|
|
3104
|
+
var f = function(N) {
|
|
3097
3105
|
return N.$u ? h.utc() : h();
|
|
3098
3106
|
};
|
|
3099
3107
|
b.toNow = function(N) {
|
|
3100
|
-
return this.to(
|
|
3108
|
+
return this.to(f(this), N);
|
|
3101
3109
|
}, b.fromNow = function(N) {
|
|
3102
|
-
return this.from(
|
|
3110
|
+
return this.from(f(this), N);
|
|
3103
3111
|
};
|
|
3104
3112
|
};
|
|
3105
3113
|
}));
|
|
3106
|
-
})(
|
|
3114
|
+
})(lr)), lr.exports;
|
|
3107
3115
|
}
|
|
3108
|
-
var
|
|
3109
|
-
const
|
|
3110
|
-
var
|
|
3111
|
-
function
|
|
3112
|
-
return
|
|
3116
|
+
var at = rt();
|
|
3117
|
+
const tt = /* @__PURE__ */ ia(at);
|
|
3118
|
+
var ir = { exports: {} }, nt = ir.exports, Vr;
|
|
3119
|
+
function ot() {
|
|
3120
|
+
return Vr || (Vr = 1, (function(e, r) {
|
|
3113
3121
|
(function(t, s) {
|
|
3114
|
-
e.exports = s(
|
|
3115
|
-
})(
|
|
3116
|
-
function s(
|
|
3117
|
-
return
|
|
3122
|
+
e.exports = s(da());
|
|
3123
|
+
})(nt, (function(t) {
|
|
3124
|
+
function s(p) {
|
|
3125
|
+
return p && typeof p == "object" && "default" in p ? p : { default: p };
|
|
3118
3126
|
}
|
|
3119
|
-
var h = s(t), b = { name: "zh-cn", weekdays: "星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"), weekdaysShort: "周日_周一_周二_周三_周四_周五_周六".split("_"), weekdaysMin: "日_一_二_三_四_五_六".split("_"), months: "一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"), monthsShort: "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"), ordinal: function(
|
|
3120
|
-
return d === "W" ?
|
|
3121
|
-
}, weekStart: 1, yearStart: 4, formats: { LT: "HH:mm", LTS: "HH:mm:ss", L: "YYYY/MM/DD", LL: "YYYY年M月D日", LLL: "YYYY年M月D日Ah点mm分", LLLL: "YYYY年M月D日ddddAh点mm分", l: "YYYY/M/D", ll: "YYYY年M月D日", lll: "YYYY年M月D日 HH:mm", llll: "YYYY年M月D日dddd HH:mm" }, relativeTime: { future: "%s内", past: "%s前", s: "几秒", m: "1 分钟", mm: "%d 分钟", h: "1 小时", hh: "%d 小时", d: "1 天", dd: "%d 天", M: "1 个月", MM: "%d 个月", y: "1 年", yy: "%d 年" }, meridiem: function(
|
|
3122
|
-
var
|
|
3123
|
-
return
|
|
3127
|
+
var h = s(t), b = { name: "zh-cn", weekdays: "星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"), weekdaysShort: "周日_周一_周二_周三_周四_周五_周六".split("_"), weekdaysMin: "日_一_二_三_四_五_六".split("_"), months: "一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"), monthsShort: "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"), ordinal: function(p, d) {
|
|
3128
|
+
return d === "W" ? p + "周" : p + "日";
|
|
3129
|
+
}, weekStart: 1, yearStart: 4, formats: { LT: "HH:mm", LTS: "HH:mm:ss", L: "YYYY/MM/DD", LL: "YYYY年M月D日", LLL: "YYYY年M月D日Ah点mm分", LLLL: "YYYY年M月D日ddddAh点mm分", l: "YYYY/M/D", ll: "YYYY年M月D日", lll: "YYYY年M月D日 HH:mm", llll: "YYYY年M月D日dddd HH:mm" }, relativeTime: { future: "%s内", past: "%s前", s: "几秒", m: "1 分钟", mm: "%d 分钟", h: "1 小时", hh: "%d 小时", d: "1 天", dd: "%d 天", M: "1 个月", MM: "%d 个月", y: "1 年", yy: "%d 年" }, meridiem: function(p, d) {
|
|
3130
|
+
var f = 100 * p + d;
|
|
3131
|
+
return f < 600 ? "凌晨" : f < 900 ? "早上" : f < 1100 ? "上午" : f < 1300 ? "中午" : f < 1800 ? "下午" : "晚上";
|
|
3124
3132
|
} };
|
|
3125
3133
|
return h.default.locale(b, null, !0), b;
|
|
3126
3134
|
}));
|
|
3127
|
-
})(
|
|
3135
|
+
})(ir)), ir.exports;
|
|
3128
3136
|
}
|
|
3129
|
-
|
|
3130
|
-
|
|
3131
|
-
|
|
3132
|
-
const
|
|
3137
|
+
ot();
|
|
3138
|
+
ur.locale("zh-cn");
|
|
3139
|
+
ur.extend(tt);
|
|
3140
|
+
const Er = {
|
|
3133
3141
|
success: "green",
|
|
3134
3142
|
error: "red",
|
|
3135
3143
|
warning: "orange",
|
|
@@ -3137,18 +3145,18 @@ const Dr = {
|
|
|
3137
3145
|
info: "cyan",
|
|
3138
3146
|
default: "default"
|
|
3139
3147
|
};
|
|
3140
|
-
function
|
|
3148
|
+
function st(e) {
|
|
3141
3149
|
if (!e) return "-";
|
|
3142
|
-
const r =
|
|
3150
|
+
const r = ur(e), t = r.format("YYYY年M月D日 HH:mm"), s = r.fromNow();
|
|
3143
3151
|
return /* @__PURE__ */ o(
|
|
3144
|
-
|
|
3152
|
+
cr,
|
|
3145
3153
|
{
|
|
3146
3154
|
title: /* @__PURE__ */ o("div", { style: { minWidth: 120 }, children: /* @__PURE__ */ o("div", { style: { color: "#aaa", fontSize: 12, marginTop: 2 }, children: s }) }),
|
|
3147
3155
|
children: /* @__PURE__ */ o("span", { style: { fontWeight: 500, opacity: 0.6 }, children: t })
|
|
3148
3156
|
}
|
|
3149
3157
|
);
|
|
3150
3158
|
}
|
|
3151
|
-
function
|
|
3159
|
+
function lt(e, r) {
|
|
3152
3160
|
if (e == null || e === "") return "-";
|
|
3153
3161
|
const t = Number(e);
|
|
3154
3162
|
if (isNaN(t)) return e;
|
|
@@ -3164,47 +3172,47 @@ function Va(e, r) {
|
|
|
3164
3172
|
return t.toLocaleString(void 0, { minimumFractionDigits: 2, maximumFractionDigits: 2 });
|
|
3165
3173
|
}
|
|
3166
3174
|
}
|
|
3167
|
-
function
|
|
3175
|
+
function it(e, r, t = {}) {
|
|
3168
3176
|
const { eventsEmit: s } = r || {};
|
|
3169
|
-
return
|
|
3177
|
+
return me.useMemo(
|
|
3170
3178
|
() => e.map((h) => {
|
|
3171
3179
|
if (h.render) return h;
|
|
3172
3180
|
switch (h.type) {
|
|
3173
3181
|
case "customized":
|
|
3174
3182
|
return {
|
|
3175
3183
|
...h,
|
|
3176
|
-
render: (b,
|
|
3177
|
-
var
|
|
3178
|
-
const
|
|
3179
|
-
let
|
|
3180
|
-
if (typeof
|
|
3184
|
+
render: (b, p, d) => {
|
|
3185
|
+
var te, a;
|
|
3186
|
+
const f = d == null ? void 0 : d.value;
|
|
3187
|
+
let F = f && typeof f == "object" && (f.component || f.Comp) ? f.component || f.Comp : h.component;
|
|
3188
|
+
if (typeof F == "string" && (F = ((te = r == null ? void 0 : r.customizeComponents) == null ? void 0 : te[F]) || ((a = t == null ? void 0 : t.customizeComponents) == null ? void 0 : a[F])), !F)
|
|
3181
3189
|
return h.fallback ?? null;
|
|
3182
|
-
const M =
|
|
3183
|
-
let
|
|
3184
|
-
if (
|
|
3190
|
+
const M = f && typeof f == "object" && "data" in f ? f.data : d == null ? void 0 : d.value, O = typeof h.componentProps == "function" ? h.componentProps({ value: M, row: p, cell: d, col: h }) : h.componentProps || {}, l = f && typeof f == "object" && "props" in f ? f.props || {} : {};
|
|
3191
|
+
let $ = {};
|
|
3192
|
+
if (f && typeof f == "object") {
|
|
3185
3193
|
const T = /* @__PURE__ */ new Set(["component", "Comp", "props"]);
|
|
3186
|
-
Object.keys(
|
|
3187
|
-
T.has(
|
|
3194
|
+
Object.keys(f).forEach((w) => {
|
|
3195
|
+
T.has(w) || ($[w] = f[w]);
|
|
3188
3196
|
});
|
|
3189
3197
|
}
|
|
3190
|
-
const
|
|
3198
|
+
const P = {
|
|
3191
3199
|
value: M,
|
|
3192
|
-
row:
|
|
3200
|
+
row: p,
|
|
3193
3201
|
cell: d,
|
|
3194
3202
|
col: h,
|
|
3195
|
-
emit: (T,
|
|
3196
|
-
var
|
|
3197
|
-
return (
|
|
3203
|
+
emit: (T, w) => {
|
|
3204
|
+
var V;
|
|
3205
|
+
return (V = r == null ? void 0 : r.eventsEmit) == null ? void 0 : V.call(r, T, { row: p, cell: d, col: h, data: w });
|
|
3198
3206
|
},
|
|
3199
|
-
...
|
|
3200
|
-
|
|
3207
|
+
...O,
|
|
3208
|
+
...$,
|
|
3201
3209
|
...l
|
|
3202
3210
|
};
|
|
3203
|
-
if (
|
|
3204
|
-
return
|
|
3205
|
-
if (typeof
|
|
3206
|
-
const T =
|
|
3207
|
-
return
|
|
3211
|
+
if (me.isValidElement(F))
|
|
3212
|
+
return me.cloneElement(F, P);
|
|
3213
|
+
if (typeof F == "function") {
|
|
3214
|
+
const T = F;
|
|
3215
|
+
return me.createElement(T, P);
|
|
3208
3216
|
}
|
|
3209
3217
|
return h.fallback ?? null;
|
|
3210
3218
|
}
|
|
@@ -3212,21 +3220,21 @@ function Ea(e, r, t = {}) {
|
|
|
3212
3220
|
case "status":
|
|
3213
3221
|
return {
|
|
3214
3222
|
...h,
|
|
3215
|
-
render: (b,
|
|
3216
|
-
const
|
|
3217
|
-
return /* @__PURE__ */ o(
|
|
3223
|
+
render: (b, p, d) => {
|
|
3224
|
+
const f = (d == null ? void 0 : d.statusType) || "default", N = Er[f] || Er.default;
|
|
3225
|
+
return /* @__PURE__ */ o($a, { color: N, children: b });
|
|
3218
3226
|
}
|
|
3219
3227
|
};
|
|
3220
3228
|
case "date":
|
|
3221
3229
|
return {
|
|
3222
3230
|
...h,
|
|
3223
|
-
render: (b) =>
|
|
3231
|
+
render: (b) => st(b)
|
|
3224
3232
|
};
|
|
3225
3233
|
case "number":
|
|
3226
3234
|
return {
|
|
3227
3235
|
...h,
|
|
3228
3236
|
render: (b) => {
|
|
3229
|
-
const
|
|
3237
|
+
const p = h.numberStyle || "float";
|
|
3230
3238
|
return /* @__PURE__ */ o(
|
|
3231
3239
|
"span",
|
|
3232
3240
|
{
|
|
@@ -3238,7 +3246,7 @@ function Ea(e, r, t = {}) {
|
|
|
3238
3246
|
fontVariantNumeric: "tabular-nums",
|
|
3239
3247
|
fontFamily: "Consolas, Menlo, monospace"
|
|
3240
3248
|
},
|
|
3241
|
-
children:
|
|
3249
|
+
children: lt(b, p)
|
|
3242
3250
|
}
|
|
3243
3251
|
);
|
|
3244
3252
|
}
|
|
@@ -3264,20 +3272,20 @@ function Ea(e, r, t = {}) {
|
|
|
3264
3272
|
return {
|
|
3265
3273
|
...h,
|
|
3266
3274
|
render: (b) => {
|
|
3267
|
-
const
|
|
3275
|
+
const p = h.maxRow || 1, d = h.maxWidth || 240, f = h.areaStyle || "default", N = 13, F = 1.6, M = N * F, O = p * M;
|
|
3268
3276
|
let l = {
|
|
3269
3277
|
maxWidth: typeof d == "number" ? `${d}px` : d,
|
|
3270
|
-
maxHeight:
|
|
3278
|
+
maxHeight: O,
|
|
3271
3279
|
overflowY: "auto",
|
|
3272
|
-
color:
|
|
3273
|
-
opacity:
|
|
3280
|
+
color: f === "code" ? "#d4d4d4" : "#666",
|
|
3281
|
+
opacity: f === "code" ? 1 : 0.85,
|
|
3274
3282
|
fontSize: N,
|
|
3275
|
-
lineHeight:
|
|
3283
|
+
lineHeight: F,
|
|
3276
3284
|
padding: "6px 10px",
|
|
3277
|
-
background:
|
|
3285
|
+
background: f === "code" ? "#1e1e1e" : "#f6f8fa",
|
|
3278
3286
|
borderRadius: 6,
|
|
3279
|
-
fontFamily:
|
|
3280
|
-
border:
|
|
3287
|
+
fontFamily: f === "code" ? '"SF Mono", "Consolas", "Menlo", monospace' : void 0,
|
|
3288
|
+
border: f === "code" ? "1px solid #232323" : "1px solid #e5e7eb",
|
|
3281
3289
|
whiteSpace: "pre-wrap",
|
|
3282
3290
|
wordBreak: "break-all",
|
|
3283
3291
|
boxSizing: "border-box",
|
|
@@ -3300,7 +3308,7 @@ function Ea(e, r, t = {}) {
|
|
|
3300
3308
|
minWidth: "200px",
|
|
3301
3309
|
maxWidth: "100%"
|
|
3302
3310
|
},
|
|
3303
|
-
children: b.map((
|
|
3311
|
+
children: b.map((p, d) => /* @__PURE__ */ o(
|
|
3304
3312
|
"span",
|
|
3305
3313
|
{
|
|
3306
3314
|
style: {
|
|
@@ -3317,7 +3325,7 @@ function Ea(e, r, t = {}) {
|
|
|
3317
3325
|
boxShadow: "0 1px 2px rgba(37, 99, 235, 0.1)",
|
|
3318
3326
|
flexShrink: 0
|
|
3319
3327
|
},
|
|
3320
|
-
children:
|
|
3328
|
+
children: p
|
|
3321
3329
|
},
|
|
3322
3330
|
d
|
|
3323
3331
|
))
|
|
@@ -3327,19 +3335,19 @@ function Ea(e, r, t = {}) {
|
|
|
3327
3335
|
case "action":
|
|
3328
3336
|
return {
|
|
3329
3337
|
...h,
|
|
3330
|
-
render: (b,
|
|
3331
|
-
const
|
|
3338
|
+
render: (b, p, d) => {
|
|
3339
|
+
const f = r != null && r.isPending ? r.isPending(p.id) : !1;
|
|
3332
3340
|
if (Array.isArray(b)) {
|
|
3333
|
-
const
|
|
3341
|
+
const F = b.map((M) => M && typeof M == "object" && (M.columnId === "actions" || M.type === "action") && "value" in M && !("mode" in M) ? {
|
|
3334
3342
|
value: M.value,
|
|
3335
3343
|
label: M.label || M.value,
|
|
3336
3344
|
icon: M.icon,
|
|
3337
3345
|
disabled: M.disabled,
|
|
3338
3346
|
key: M.key
|
|
3339
3347
|
} : M);
|
|
3340
|
-
if (
|
|
3341
|
-
const M =
|
|
3342
|
-
return /* @__PURE__ */
|
|
3348
|
+
if (F.length >= 3) {
|
|
3349
|
+
const M = F.slice(0, 2), O = F.slice(2);
|
|
3350
|
+
return /* @__PURE__ */ L(
|
|
3343
3351
|
"div",
|
|
3344
3352
|
{
|
|
3345
3353
|
style: {
|
|
@@ -3349,31 +3357,31 @@ function Ea(e, r, t = {}) {
|
|
|
3349
3357
|
alignItems: "center"
|
|
3350
3358
|
},
|
|
3351
3359
|
children: [
|
|
3352
|
-
M.map((l,
|
|
3353
|
-
|
|
3360
|
+
M.map((l, $) => /* @__PURE__ */ o(
|
|
3361
|
+
er,
|
|
3354
3362
|
{
|
|
3355
3363
|
mode: l.mode || "text",
|
|
3356
3364
|
label: l.label || l.value || "",
|
|
3357
3365
|
icon: l.icon,
|
|
3358
|
-
disabled: l.disabled ||
|
|
3366
|
+
disabled: l.disabled || f && l.value === "delete",
|
|
3359
3367
|
styles: t,
|
|
3360
3368
|
style: { padding: "0 8px", minWidth: 0 },
|
|
3361
|
-
onClick: () => s == null ? void 0 : s(`table_action_${l.value}`,
|
|
3369
|
+
onClick: () => s == null ? void 0 : s(`table_action_${l.value}`, p)
|
|
3362
3370
|
},
|
|
3363
|
-
|
|
3371
|
+
$
|
|
3364
3372
|
)),
|
|
3365
3373
|
/* @__PURE__ */ o(
|
|
3366
|
-
|
|
3374
|
+
va,
|
|
3367
3375
|
{
|
|
3368
|
-
actions:
|
|
3369
|
-
key: l.value || String(
|
|
3376
|
+
actions: O.map((l, $) => ({
|
|
3377
|
+
key: l.value || String($),
|
|
3370
3378
|
label: l.label || l.value || "",
|
|
3371
3379
|
icon: l.icon,
|
|
3372
|
-
disabled: l.disabled ||
|
|
3380
|
+
disabled: l.disabled || f && l.value === "delete"
|
|
3373
3381
|
})),
|
|
3374
3382
|
onAction: (l) => {
|
|
3375
|
-
const
|
|
3376
|
-
|
|
3383
|
+
const $ = O.find((H) => (H.value || String(H.key)) === l);
|
|
3384
|
+
$ && !$.disabled && !(f && $.value === "delete") && (s == null || s(`table_action_${$.value}`, p));
|
|
3377
3385
|
}
|
|
3378
3386
|
}
|
|
3379
3387
|
)
|
|
@@ -3381,31 +3389,31 @@ function Ea(e, r, t = {}) {
|
|
|
3381
3389
|
}
|
|
3382
3390
|
);
|
|
3383
3391
|
} else
|
|
3384
|
-
return /* @__PURE__ */ o("div", { style: { display: "flex", gap: 4, justifyContent: "center" }, children:
|
|
3385
|
-
|
|
3392
|
+
return /* @__PURE__ */ o("div", { style: { display: "flex", gap: 4, justifyContent: "center" }, children: F.map((M, O) => /* @__PURE__ */ o(
|
|
3393
|
+
er,
|
|
3386
3394
|
{
|
|
3387
3395
|
mode: M.mode || "text",
|
|
3388
3396
|
label: M.label || M.value || "",
|
|
3389
3397
|
icon: M.icon,
|
|
3390
|
-
disabled: M.disabled ||
|
|
3398
|
+
disabled: M.disabled || f && M.value === "delete",
|
|
3391
3399
|
styles: t,
|
|
3392
3400
|
style: { padding: "0 8px", minWidth: 0 },
|
|
3393
|
-
onClick: () => s == null ? void 0 : s(`table_action_${M.value}`,
|
|
3401
|
+
onClick: () => s == null ? void 0 : s(`table_action_${M.value}`, p)
|
|
3394
3402
|
},
|
|
3395
|
-
|
|
3403
|
+
O
|
|
3396
3404
|
)) });
|
|
3397
3405
|
}
|
|
3398
3406
|
const N = d || {};
|
|
3399
3407
|
return /* @__PURE__ */ o(
|
|
3400
|
-
|
|
3408
|
+
er,
|
|
3401
3409
|
{
|
|
3402
3410
|
mode: N.mode || "text",
|
|
3403
3411
|
label: N.label || N.value || "",
|
|
3404
3412
|
icon: N.icon,
|
|
3405
|
-
disabled: N.disabled ||
|
|
3413
|
+
disabled: N.disabled || f && N.value === "delete",
|
|
3406
3414
|
styles: t,
|
|
3407
3415
|
style: { padding: "0 8px", minWidth: 0 },
|
|
3408
|
-
onClick: () => s == null ? void 0 : s(`table_action_${N.value}`,
|
|
3416
|
+
onClick: () => s == null ? void 0 : s(`table_action_${N.value}`, p)
|
|
3409
3417
|
}
|
|
3410
3418
|
);
|
|
3411
3419
|
}
|
|
@@ -3419,20 +3427,20 @@ function Ea(e, r, t = {}) {
|
|
|
3419
3427
|
case "title":
|
|
3420
3428
|
return {
|
|
3421
3429
|
...h,
|
|
3422
|
-
render: (b,
|
|
3423
|
-
const
|
|
3430
|
+
render: (b, p, d) => {
|
|
3431
|
+
const f = (d == null ? void 0 : d.level) || 1, N = {
|
|
3424
3432
|
1: "text-xl font-bold",
|
|
3425
3433
|
2: "text-lg font-semibold",
|
|
3426
3434
|
3: "text-base font-medium"
|
|
3427
|
-
},
|
|
3428
|
-
return /* @__PURE__ */
|
|
3435
|
+
}, F = N[f] || N[1];
|
|
3436
|
+
return /* @__PURE__ */ L(
|
|
3429
3437
|
"div",
|
|
3430
3438
|
{
|
|
3431
|
-
className: `${
|
|
3439
|
+
className: `${F} text-gray-800 ${(d == null ? void 0 : d.className) || ""}`,
|
|
3432
3440
|
style: {
|
|
3433
3441
|
color: "#1f2937",
|
|
3434
3442
|
lineHeight: "1.4",
|
|
3435
|
-
fontWeight:
|
|
3443
|
+
fontWeight: f === 1 ? 700 : f === 2 ? 600 : 400
|
|
3436
3444
|
},
|
|
3437
3445
|
children: [
|
|
3438
3446
|
/* @__PURE__ */ o("span", { className: "h-full w-1 bg-gray-500 rounded-full mr-2" }),
|
|
@@ -3475,11 +3483,11 @@ function Ea(e, r, t = {}) {
|
|
|
3475
3483
|
]
|
|
3476
3484
|
);
|
|
3477
3485
|
}
|
|
3478
|
-
function
|
|
3479
|
-
return /* @__PURE__ */
|
|
3486
|
+
function dt(e) {
|
|
3487
|
+
return /* @__PURE__ */ L("div", { className: "flex items-center gap-2", children: [
|
|
3480
3488
|
/* @__PURE__ */ o("span", { className: "font-medium text-gray-800 text-sm", children: e.title }),
|
|
3481
|
-
e.helpText && /* @__PURE__ */ o(
|
|
3482
|
-
|
|
3489
|
+
e.helpText && /* @__PURE__ */ o(cr, { title: e.helpText, placement: "top", children: /* @__PURE__ */ o(
|
|
3490
|
+
oa,
|
|
3483
3491
|
{
|
|
3484
3492
|
className: "text-gray-400 hover:text-gray-600 cursor-help transition-colors",
|
|
3485
3493
|
size: 14
|
|
@@ -3487,11 +3495,12 @@ function Ja(e) {
|
|
|
3487
3495
|
) })
|
|
3488
3496
|
] });
|
|
3489
3497
|
}
|
|
3490
|
-
const
|
|
3498
|
+
const ct = J.div.attrs({
|
|
3499
|
+
className: "dynamic-table-wrapper"
|
|
3500
|
+
})`
|
|
3491
3501
|
background: ${({ theme: e }) => e.colors.tableBackground || e.colors.background};
|
|
3492
3502
|
border-radius: ${({ theme: e }) => e.space.radius};
|
|
3493
|
-
|
|
3494
|
-
padding: ${({ theme: e }) => e.space.padding};
|
|
3503
|
+
|
|
3495
3504
|
overflow-x: auto;
|
|
3496
3505
|
width: 100%;
|
|
3497
3506
|
max-width: 100%;
|
|
@@ -3499,8 +3508,10 @@ const Ga = J.div`
|
|
|
3499
3508
|
min-height: 240px;
|
|
3500
3509
|
display: flex;
|
|
3501
3510
|
flex-direction: column;
|
|
3502
|
-
`,
|
|
3503
|
-
|
|
3511
|
+
`, ut = J.div.attrs({
|
|
3512
|
+
className: "dynamic-table-sub-wrapper"
|
|
3513
|
+
})`
|
|
3514
|
+
background: ${({ theme: e }) => e.colors.subTableBackground || e.colors.tableBackground || e.colors.background};
|
|
3504
3515
|
border-radius: ${({ theme: e }) => e.space.radius};
|
|
3505
3516
|
padding: ${({ theme: e }) => e.space.padding};
|
|
3506
3517
|
width: 100%;
|
|
@@ -3509,14 +3520,16 @@ const Ga = J.div`
|
|
|
3509
3520
|
display: flex;
|
|
3510
3521
|
flex-direction: column;
|
|
3511
3522
|
overflow: visible; // 子table不产生滚动条,由外层容器处理
|
|
3512
|
-
`,
|
|
3523
|
+
`, ht = J.div.attrs({
|
|
3524
|
+
className: "dynamic-table-sub-scroll-container"
|
|
3525
|
+
})`
|
|
3513
3526
|
overflow-x: auto;
|
|
3514
3527
|
overflow-y: hidden;
|
|
3515
3528
|
width: 100%;
|
|
3516
3529
|
max-width: 100%;
|
|
3517
|
-
|
|
3530
|
+
|
|
3518
3531
|
border-radius: ${({ theme: e }) => e.space.radius};
|
|
3519
|
-
background: ${({ theme: e }) => e.colors.tableBackground || e.colors.background};
|
|
3532
|
+
background: ${({ theme: e }) => e.colors.subTableBackground || e.colors.tableBackground || e.colors.background};
|
|
3520
3533
|
position: relative; // 为sticky列提供定位上下文
|
|
3521
3534
|
isolation: isolate; // 创建新的层叠上下文
|
|
3522
3535
|
height: auto; // 确保容器高度自适应内容
|
|
@@ -3547,7 +3560,7 @@ const Ga = J.div`
|
|
|
3547
3560
|
&::-webkit-scrollbar-thumb:hover {
|
|
3548
3561
|
background: ${({ theme: e }) => e.colors.disabled};
|
|
3549
3562
|
}
|
|
3550
|
-
`,
|
|
3563
|
+
`, Jr = (e) => {
|
|
3551
3564
|
switch (e) {
|
|
3552
3565
|
case "avatar":
|
|
3553
3566
|
return { minWidth: 48, textAlign: "center" };
|
|
@@ -3577,8 +3590,10 @@ const Ga = J.div`
|
|
|
3577
3590
|
default:
|
|
3578
3591
|
return { minWidth: 80, textAlign: "left" };
|
|
3579
3592
|
}
|
|
3580
|
-
},
|
|
3581
|
-
|
|
3593
|
+
}, Gr = J.th.attrs({
|
|
3594
|
+
className: "dynamic-table-th"
|
|
3595
|
+
})`
|
|
3596
|
+
background: ${({ theme: e }) => e.colors.tableHeaderBg || e.colors.disabledBackground};
|
|
3582
3597
|
color: ${({ theme: e }) => e.colors.tableHeaderText || e.colors.text};
|
|
3583
3598
|
font-weight: 600;
|
|
3584
3599
|
font-size: 13px;
|
|
@@ -3587,13 +3602,9 @@ const Ga = J.div`
|
|
|
3587
3602
|
min-width: 48px;
|
|
3588
3603
|
white-space: nowrap;
|
|
3589
3604
|
/* 移除默认的 text-align: center,让每列使用自己的对齐方式 */
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
&:last-child {
|
|
3594
|
-
background: ${({ theme: e }) => e.colors.tableLastColumnBg || e.colors.disabledBackground};
|
|
3595
|
-
}
|
|
3596
|
-
`, Ar = J.td`
|
|
3605
|
+
`, Kr = J.td.attrs({
|
|
3606
|
+
className: "dynamic-table-td"
|
|
3607
|
+
})`
|
|
3597
3608
|
padding: 0.5rem 0.75rem;
|
|
3598
3609
|
border-bottom: 1px solid ${({ theme: e }) => e.colors.border};
|
|
3599
3610
|
color: ${({ theme: e }) => e.colors.text};
|
|
@@ -3602,14 +3613,22 @@ const Ga = J.div`
|
|
|
3602
3613
|
white-space: nowrap;
|
|
3603
3614
|
overflow: hidden;
|
|
3604
3615
|
text-overflow: ellipsis;
|
|
3605
|
-
background: ${({ theme: e }) => e.colors.tableBackground ||
|
|
3606
|
-
|
|
3616
|
+
background: ${({ theme: e }) => e.colors.tableBackground || e.colors.background};
|
|
3617
|
+
&:first-child {
|
|
3618
|
+
background: ${({ theme: e }) => e.colors.tableFirstColumnBg || e.colors.tableBackground || e.colors.background};
|
|
3619
|
+
}
|
|
3620
|
+
&:last-child {
|
|
3621
|
+
background: ${({ theme: e }) => e.colors.tableLastColumnBg || e.colors.tableBackground || e.colors.background};
|
|
3622
|
+
}
|
|
3623
|
+
`, pt = J.tr.attrs({
|
|
3624
|
+
className: "dynamic-table-tr"
|
|
3625
|
+
})`
|
|
3607
3626
|
&:hover {
|
|
3608
3627
|
background: ${({ theme: e }) => e.colors.disabledBackground};
|
|
3609
3628
|
}
|
|
3610
|
-
`,
|
|
3611
|
-
(e, r) => /* @__PURE__ */ o(
|
|
3612
|
-
),
|
|
3629
|
+
`, ft = me.forwardRef(
|
|
3630
|
+
(e, r) => /* @__PURE__ */ o(pt, { ...e, ref: r })
|
|
3631
|
+
), mt = `
|
|
3613
3632
|
.sticky-shadow-left {
|
|
3614
3633
|
box-shadow: 4px 0 8px -4px rgba(0,0,0,0.08);
|
|
3615
3634
|
transition: box-shadow 0.2s;
|
|
@@ -3621,24 +3640,24 @@ const Ga = J.div`
|
|
|
3621
3640
|
`;
|
|
3622
3641
|
if (typeof window < "u" && !document.getElementById("dynamic-table-sticky-shadow")) {
|
|
3623
3642
|
const e = document.createElement("style");
|
|
3624
|
-
e.id = "dynamic-table-sticky-shadow", e.innerHTML =
|
|
3643
|
+
e.id = "dynamic-table-sticky-shadow", e.innerHTML = mt, document.head.appendChild(e);
|
|
3625
3644
|
}
|
|
3626
|
-
const
|
|
3627
|
-
var
|
|
3628
|
-
const r = e.dataSource || [], t = e.columns || [], s = e.size || "md", h = e.level || 0, b =
|
|
3645
|
+
const bt = me.memo((e) => {
|
|
3646
|
+
var D, m, g, ae, ye, De, ze, Ae, _e, Be, We, Re, qe, Le, je, Oe, He, Ye, Ie, Ue, Ve, Ee, Je, Ge, Ke, Xe, pe, Ce, rr;
|
|
3647
|
+
const r = e.dataSource || [], t = e.columns || [], s = e.size || "md", h = e.level || 0, b = Fe(), p = $e(
|
|
3629
3648
|
// 基础:默认主题 + useTheme的配置
|
|
3630
|
-
$e({ theme:
|
|
3649
|
+
$e({ theme: B, mode: "light" }, b),
|
|
3631
3650
|
// 最高层:用户手动传入的styles
|
|
3632
3651
|
e.styles
|
|
3633
|
-
), d = ((
|
|
3652
|
+
), d = ((D = p.theme) == null ? void 0 : D.colors) || B.colors, f = d.tableBackground || d.background || B.colors.background, N = d.tableFirstColumnBg || d.surfaceSubtle || f, F = d.tableLastColumnBg || d.surfaceSubtle || f, { viewId: M, total: O, requestPagesize: l = 50, viewPageSize: $ } = e, [H, P] = ie($);
|
|
3634
3653
|
we(() => {
|
|
3635
|
-
typeof
|
|
3636
|
-
}, [
|
|
3637
|
-
const [
|
|
3654
|
+
typeof $ == "number" && $ > 0 && P($);
|
|
3655
|
+
}, [$]);
|
|
3656
|
+
const [te, a] = ie(/* @__PURE__ */ new Set());
|
|
3638
3657
|
we(() => {
|
|
3639
3658
|
a(/* @__PURE__ */ new Set());
|
|
3640
3659
|
}, [M]);
|
|
3641
|
-
const [T,
|
|
3660
|
+
const [T, w] = ie(!1), [V, _] = ie(!1), [E, j] = ie(/* @__PURE__ */ new Set()), ee = Te(null), Z = Te(null), [W, re] = ie(0), G = s === "sm" ? 0.7 : 1, C = it(
|
|
3642
3661
|
t,
|
|
3643
3662
|
{
|
|
3644
3663
|
eventsEmit: e.eventsEmit,
|
|
@@ -3646,69 +3665,69 @@ const et = be.memo((e) => {
|
|
|
3646
3665
|
customizeComponents: e.customizeComponents
|
|
3647
3666
|
},
|
|
3648
3667
|
e.styles
|
|
3649
|
-
), [y, x] =
|
|
3650
|
-
(
|
|
3651
|
-
var
|
|
3652
|
-
x((
|
|
3653
|
-
let
|
|
3654
|
-
return
|
|
3668
|
+
), [y, x] = ie([]), z = he(
|
|
3669
|
+
(v, ne) => {
|
|
3670
|
+
var de;
|
|
3671
|
+
x((ce) => {
|
|
3672
|
+
let be;
|
|
3673
|
+
return ne ? be = [...ce, v] : be = ce.filter((Ne) => Ne !== v), be;
|
|
3655
3674
|
});
|
|
3656
|
-
const se =
|
|
3657
|
-
(
|
|
3658
|
-
rowId:
|
|
3659
|
-
checked:
|
|
3660
|
-
selectedItems:
|
|
3675
|
+
const se = ne ? [...y, v] : y.filter((ce) => ce !== v), oe = r.filter((ce) => se.includes(ce.id));
|
|
3676
|
+
(de = e.eventsEmit) == null || de.call(e, "table_row_select", {
|
|
3677
|
+
rowId: v,
|
|
3678
|
+
checked: ne,
|
|
3679
|
+
selectedItems: oe
|
|
3661
3680
|
});
|
|
3662
3681
|
},
|
|
3663
3682
|
[y, r, e.eventsEmit]
|
|
3664
|
-
),
|
|
3683
|
+
), k = Se(
|
|
3665
3684
|
() => r.length > 0 && y.length === r.length,
|
|
3666
3685
|
[r.length, y.length]
|
|
3667
|
-
),
|
|
3668
|
-
(
|
|
3669
|
-
var
|
|
3670
|
-
const
|
|
3671
|
-
x(
|
|
3672
|
-
const se =
|
|
3673
|
-
(
|
|
3674
|
-
checked:
|
|
3686
|
+
), q = he(
|
|
3687
|
+
(v) => {
|
|
3688
|
+
var oe;
|
|
3689
|
+
const ne = v ? r.map((de) => de.id) : [];
|
|
3690
|
+
x(ne);
|
|
3691
|
+
const se = v ? r : [];
|
|
3692
|
+
(oe = e.eventsEmit) == null || oe.call(e, "table_select_all", {
|
|
3693
|
+
checked: v,
|
|
3675
3694
|
selectedItems: se,
|
|
3676
3695
|
totalCount: r.length
|
|
3677
3696
|
});
|
|
3678
3697
|
},
|
|
3679
3698
|
[r, e.eventsEmit]
|
|
3680
|
-
), [
|
|
3699
|
+
), [R, Q] = ie(1), X = typeof H == "number" && H > 0 ? H : $ ?? (e.isSubTable ? 5 : 10), S = O || r.length;
|
|
3681
3700
|
Se(
|
|
3682
|
-
() => Math.ceil(
|
|
3683
|
-
[
|
|
3701
|
+
() => Math.ceil(S / X),
|
|
3702
|
+
[S, X]
|
|
3684
3703
|
);
|
|
3685
|
-
const
|
|
3704
|
+
const Y = Se(() => {
|
|
3686
3705
|
if (e.viewBehavior !== "pagination") return r;
|
|
3687
|
-
const
|
|
3688
|
-
if (r.some((
|
|
3689
|
-
const
|
|
3690
|
-
for (let
|
|
3691
|
-
const
|
|
3692
|
-
|
|
3706
|
+
const v = (R - 1) * X, ne = v + X;
|
|
3707
|
+
if (r.some((oe) => typeof oe.__absIndex == "number")) {
|
|
3708
|
+
const oe = [];
|
|
3709
|
+
for (let de = v; de < ne; de++) {
|
|
3710
|
+
const ce = r.find((be) => be.__absIndex === de);
|
|
3711
|
+
ce && oe.push(ce);
|
|
3693
3712
|
}
|
|
3694
|
-
return
|
|
3713
|
+
return oe;
|
|
3695
3714
|
}
|
|
3696
|
-
return r.slice(
|
|
3697
|
-
}, [e.viewBehavior, r,
|
|
3698
|
-
(
|
|
3699
|
-
var
|
|
3700
|
-
if (
|
|
3701
|
-
const se = (
|
|
3702
|
-
(!
|
|
3703
|
-
const
|
|
3704
|
-
return
|
|
3705
|
-
}), (
|
|
3715
|
+
return r.slice(v, ne);
|
|
3716
|
+
}, [e.viewBehavior, r, R, X]), I = he(
|
|
3717
|
+
(v) => {
|
|
3718
|
+
var ne;
|
|
3719
|
+
if (Q(v), O && l && M) {
|
|
3720
|
+
const se = (v - 1) * X, oe = Math.floor(se / l) + 1;
|
|
3721
|
+
(!te.has(oe) || se >= r.length) && (a((ce) => {
|
|
3722
|
+
const be = new Set(ce);
|
|
3723
|
+
return be.add(oe), be;
|
|
3724
|
+
}), (ne = e.eventsEmit) == null || ne.call(
|
|
3706
3725
|
e,
|
|
3707
3726
|
"pagination:request_merge_data",
|
|
3708
3727
|
{
|
|
3709
3728
|
viewId: M,
|
|
3710
3729
|
request: {
|
|
3711
|
-
pageNo:
|
|
3730
|
+
pageNo: oe,
|
|
3712
3731
|
pageSize: l
|
|
3713
3732
|
}
|
|
3714
3733
|
},
|
|
@@ -3716,49 +3735,49 @@ const et = be.memo((e) => {
|
|
|
3716
3735
|
));
|
|
3717
3736
|
}
|
|
3718
3737
|
},
|
|
3719
|
-
[
|
|
3720
|
-
), i =
|
|
3721
|
-
|
|
3722
|
-
const se = new Set(
|
|
3723
|
-
return se.has(
|
|
3724
|
-
var
|
|
3725
|
-
(
|
|
3726
|
-
tableId:
|
|
3727
|
-
children: ((
|
|
3738
|
+
[O, l, M, X, r.length, e.eventsEmit, te]
|
|
3739
|
+
), i = he((v) => {
|
|
3740
|
+
j((ne) => {
|
|
3741
|
+
const se = new Set(ne);
|
|
3742
|
+
return se.has(v) ? se.delete(v) : (se.add(v), setTimeout(() => {
|
|
3743
|
+
var oe, de;
|
|
3744
|
+
(de = e.eventsEmit) == null || de.call(e, "table_expand", {
|
|
3745
|
+
tableId: v,
|
|
3746
|
+
children: ((oe = r.find((ce) => ce.id === v)) == null ? void 0 : oe.children) || []
|
|
3728
3747
|
});
|
|
3729
3748
|
}, 0)), se;
|
|
3730
3749
|
});
|
|
3731
|
-
}, [r, e.eventsEmit]), u =
|
|
3732
|
-
(
|
|
3733
|
-
[
|
|
3734
|
-
), n =
|
|
3735
|
-
const
|
|
3736
|
-
|
|
3750
|
+
}, [r, e.eventsEmit]), u = he((v) => v.hasOwnProperty("children") && v.children !== void 0, []), c = he(
|
|
3751
|
+
(v) => E.has(v),
|
|
3752
|
+
[E]
|
|
3753
|
+
), n = he(() => {
|
|
3754
|
+
const v = ee.current;
|
|
3755
|
+
v && (e.isSubTable || (w(v.scrollLeft > 0), _(v.scrollLeft < v.scrollWidth - v.offsetWidth - 1)));
|
|
3737
3756
|
}, [e.isSubTable]);
|
|
3738
3757
|
we(() => {
|
|
3739
|
-
const
|
|
3740
|
-
if (
|
|
3741
|
-
return n(),
|
|
3742
|
-
|
|
3758
|
+
const v = ee.current;
|
|
3759
|
+
if (v)
|
|
3760
|
+
return n(), v.addEventListener("scroll", n), window.addEventListener("resize", n), () => {
|
|
3761
|
+
v.removeEventListener("scroll", n), window.removeEventListener("resize", n);
|
|
3743
3762
|
};
|
|
3744
3763
|
}, [n]), we(() => {
|
|
3745
|
-
const
|
|
3746
|
-
if (
|
|
3747
|
-
const
|
|
3748
|
-
const
|
|
3749
|
-
|
|
3764
|
+
const v = ee.current;
|
|
3765
|
+
if (!v) return;
|
|
3766
|
+
const ne = () => {
|
|
3767
|
+
const oe = v.getBoundingClientRect();
|
|
3768
|
+
re(oe.width);
|
|
3750
3769
|
};
|
|
3751
|
-
|
|
3752
|
-
const se = new ResizeObserver(
|
|
3753
|
-
return se.observe(
|
|
3754
|
-
window.removeEventListener("resize",
|
|
3770
|
+
ne(), window.addEventListener("resize", ne);
|
|
3771
|
+
const se = new ResizeObserver(ne);
|
|
3772
|
+
return se.observe(v), () => {
|
|
3773
|
+
window.removeEventListener("resize", ne), se.disconnect();
|
|
3755
3774
|
};
|
|
3756
3775
|
}, []);
|
|
3757
|
-
const
|
|
3758
|
-
return /* @__PURE__ */
|
|
3759
|
-
|
|
3776
|
+
const A = e.isSubTable ? ut : ct;
|
|
3777
|
+
return /* @__PURE__ */ L(
|
|
3778
|
+
A,
|
|
3760
3779
|
{
|
|
3761
|
-
theme:
|
|
3780
|
+
theme: p.theme || B,
|
|
3762
3781
|
className: "w-full",
|
|
3763
3782
|
style: {
|
|
3764
3783
|
transform: `scale(${G})`,
|
|
@@ -3799,7 +3818,7 @@ const et = be.memo((e) => {
|
|
|
3799
3818
|
/* @__PURE__ */ o(
|
|
3800
3819
|
"div",
|
|
3801
3820
|
{
|
|
3802
|
-
ref:
|
|
3821
|
+
ref: ee,
|
|
3803
3822
|
style: {
|
|
3804
3823
|
width: (e.isSubTable, "100%"),
|
|
3805
3824
|
maxWidth: (e.isSubTable, "100%"),
|
|
@@ -3811,10 +3830,10 @@ const et = be.memo((e) => {
|
|
|
3811
3830
|
position: "relative",
|
|
3812
3831
|
boxSizing: "border-box"
|
|
3813
3832
|
},
|
|
3814
|
-
children: /* @__PURE__ */
|
|
3833
|
+
children: /* @__PURE__ */ L(
|
|
3815
3834
|
"table",
|
|
3816
3835
|
{
|
|
3817
|
-
ref:
|
|
3836
|
+
ref: Z,
|
|
3818
3837
|
className: "border-collapse",
|
|
3819
3838
|
style: {
|
|
3820
3839
|
minWidth: "max-content",
|
|
@@ -3829,18 +3848,18 @@ const et = be.memo((e) => {
|
|
|
3829
3848
|
position: e.isSubTable ? void 0 : "sticky",
|
|
3830
3849
|
top: 0,
|
|
3831
3850
|
zIndex: 3,
|
|
3832
|
-
background: ((g = (m =
|
|
3851
|
+
background: ((g = (m = p.theme) == null ? void 0 : m.colors) == null ? void 0 : g.tableHeaderBg) || ((ye = (ae = p.theme) == null ? void 0 : ae.colors) == null ? void 0 : ye.disabledBackground) || B.colors.disabledBackground
|
|
3833
3852
|
},
|
|
3834
|
-
children: /* @__PURE__ */
|
|
3853
|
+
children: /* @__PURE__ */ L("tr", { children: [
|
|
3835
3854
|
e.allowMultiSelect && /* @__PURE__ */ o(
|
|
3836
|
-
|
|
3855
|
+
Gr,
|
|
3837
3856
|
{
|
|
3838
|
-
theme:
|
|
3857
|
+
theme: p.theme || B,
|
|
3839
3858
|
style: {
|
|
3840
3859
|
position: "sticky",
|
|
3841
3860
|
left: 0,
|
|
3842
3861
|
zIndex: 3,
|
|
3843
|
-
background:
|
|
3862
|
+
background: ((ze = (De = p.theme) == null ? void 0 : De.colors) == null ? void 0 : ze.tableHeaderBg) || ((_e = (Ae = p.theme) == null ? void 0 : Ae.colors) == null ? void 0 : _e.disabledBackground) || B.colors.disabledBackground,
|
|
3844
3863
|
width: 40,
|
|
3845
3864
|
minWidth: 40,
|
|
3846
3865
|
maxWidth: 40,
|
|
@@ -3851,76 +3870,76 @@ const et = be.memo((e) => {
|
|
|
3851
3870
|
"input",
|
|
3852
3871
|
{
|
|
3853
3872
|
type: "checkbox",
|
|
3854
|
-
checked:
|
|
3855
|
-
onChange: (
|
|
3873
|
+
checked: k,
|
|
3874
|
+
onChange: (v) => q(v.target.checked)
|
|
3856
3875
|
}
|
|
3857
3876
|
)
|
|
3858
3877
|
}
|
|
3859
3878
|
),
|
|
3860
|
-
|
|
3861
|
-
var
|
|
3862
|
-
const se =
|
|
3879
|
+
C.map((v, ne) => {
|
|
3880
|
+
var be, Ne, Pe, Ze;
|
|
3881
|
+
const se = ne === 0, oe = ne === C.length - 1, de = ((Ne = (be = p.theme) == null ? void 0 : be.colors) == null ? void 0 : Ne.tableHeaderBg) || ((Ze = (Pe = p.theme) == null ? void 0 : Pe.colors) == null ? void 0 : Ze.disabledBackground) || B.colors.disabledBackground, ce = se ? {
|
|
3863
3882
|
position: "sticky",
|
|
3864
3883
|
left: e.allowMultiSelect ? 40 : 0,
|
|
3865
3884
|
zIndex: 2,
|
|
3866
|
-
background:
|
|
3867
|
-
} :
|
|
3885
|
+
background: de
|
|
3886
|
+
} : oe ? {
|
|
3868
3887
|
position: "sticky",
|
|
3869
3888
|
right: 0,
|
|
3870
3889
|
zIndex: 2,
|
|
3871
|
-
background:
|
|
3890
|
+
background: de
|
|
3872
3891
|
} : {};
|
|
3873
3892
|
return /* @__PURE__ */ o(
|
|
3874
|
-
|
|
3893
|
+
Gr,
|
|
3875
3894
|
{
|
|
3876
|
-
theme:
|
|
3895
|
+
theme: p.theme || B,
|
|
3877
3896
|
style: {
|
|
3878
|
-
...
|
|
3879
|
-
...
|
|
3880
|
-
|
|
3881
|
-
maxWidth: typeof
|
|
3897
|
+
...Jr(v.type),
|
|
3898
|
+
...ce,
|
|
3899
|
+
...v.maxWidth !== void 0 ? {
|
|
3900
|
+
maxWidth: typeof v.maxWidth == "number" ? `${v.maxWidth}px` : v.maxWidth
|
|
3882
3901
|
} : {}
|
|
3883
3902
|
},
|
|
3884
|
-
className: se && T ? "sticky-shadow-left" :
|
|
3885
|
-
children:
|
|
3903
|
+
className: se && T ? "sticky-shadow-left" : oe && V ? "sticky-shadow-right" : "",
|
|
3904
|
+
children: dt(v)
|
|
3886
3905
|
},
|
|
3887
|
-
|
|
3906
|
+
v.id
|
|
3888
3907
|
);
|
|
3889
3908
|
})
|
|
3890
3909
|
] })
|
|
3891
3910
|
}
|
|
3892
3911
|
),
|
|
3893
|
-
/* @__PURE__ */ o("tbody", { children:
|
|
3894
|
-
var
|
|
3895
|
-
const se = e.rowProps ? e.rowProps(
|
|
3896
|
-
return /* @__PURE__ */
|
|
3897
|
-
/* @__PURE__ */
|
|
3898
|
-
|
|
3912
|
+
/* @__PURE__ */ o("tbody", { children: Y.map((v, ne) => {
|
|
3913
|
+
var ce, be, Ne, Pe, Ze, hr, pr, fr, mr, br, gr, xr, yr, $r, vr, wr, kr, Sr, Nr, Cr, Mr, Tr;
|
|
3914
|
+
const se = e.rowProps ? e.rowProps(v, ne) : {}, oe = u(v), de = c(v.id) || v.__autoExpand && oe;
|
|
3915
|
+
return /* @__PURE__ */ L(me.Fragment, { children: [
|
|
3916
|
+
/* @__PURE__ */ L(
|
|
3917
|
+
ft,
|
|
3899
3918
|
{
|
|
3900
|
-
theme:
|
|
3919
|
+
theme: p.theme || B,
|
|
3901
3920
|
...se,
|
|
3902
|
-
className: `${se.className || ""} ${(
|
|
3921
|
+
className: `${se.className || ""} ${(ce = e.addingIds) != null && ce.includes(v.id) ? "adding-row" : ""} ${v.removing ? "removing-row" : ""}`,
|
|
3903
3922
|
style: {
|
|
3904
3923
|
...se.style,
|
|
3905
|
-
|
|
3924
|
+
...v.removing ? {
|
|
3906
3925
|
opacity: 0,
|
|
3907
3926
|
transform: "translateX(100px)",
|
|
3908
3927
|
transition: "opacity 0.3s ease, transform 0.3s ease"
|
|
3909
3928
|
} : {}
|
|
3910
3929
|
},
|
|
3911
|
-
onAnimationEnd: (
|
|
3912
|
-
var
|
|
3913
|
-
|
|
3930
|
+
onAnimationEnd: (U) => {
|
|
3931
|
+
var ue, ge;
|
|
3932
|
+
U.animationName === "row-slide-in" && ((ue = e.addingIds) != null && ue.includes(v.id)) && ((ge = e.onRowAddAnimationComplete) == null || ge.call(e, v.id));
|
|
3914
3933
|
},
|
|
3915
|
-
onTransitionEnd: (
|
|
3916
|
-
var
|
|
3917
|
-
|
|
3934
|
+
onTransitionEnd: (U) => {
|
|
3935
|
+
var ue;
|
|
3936
|
+
v.removing && U.propertyName === "transform" && ((ue = e.onRowAnimationComplete) == null || ue.call(e, v.id));
|
|
3918
3937
|
},
|
|
3919
3938
|
children: [
|
|
3920
3939
|
e.allowMultiSelect && /* @__PURE__ */ o(
|
|
3921
|
-
|
|
3940
|
+
Kr,
|
|
3922
3941
|
{
|
|
3923
|
-
theme:
|
|
3942
|
+
theme: p.theme || B,
|
|
3924
3943
|
style: {
|
|
3925
3944
|
position: "sticky",
|
|
3926
3945
|
left: 0,
|
|
@@ -3936,39 +3955,39 @@ const et = be.memo((e) => {
|
|
|
3936
3955
|
"input",
|
|
3937
3956
|
{
|
|
3938
3957
|
type: "checkbox",
|
|
3939
|
-
checked: y.includes(
|
|
3940
|
-
onChange: (
|
|
3958
|
+
checked: y.includes(v.id),
|
|
3959
|
+
onChange: (U) => z(v.id, U.target.checked)
|
|
3941
3960
|
}
|
|
3942
3961
|
)
|
|
3943
3962
|
}
|
|
3944
3963
|
),
|
|
3945
|
-
|
|
3946
|
-
var
|
|
3947
|
-
const ge =
|
|
3964
|
+
C.map((U, ue) => {
|
|
3965
|
+
var Fr;
|
|
3966
|
+
const ge = ue === 0, Qe = ue === C.length - 1, Me = ge ? N : Qe ? F : f, ca = ge ? {
|
|
3948
3967
|
position: "sticky",
|
|
3949
3968
|
left: e.allowMultiSelect ? 40 : 0,
|
|
3950
3969
|
zIndex: 1,
|
|
3951
|
-
background:
|
|
3952
|
-
} :
|
|
3970
|
+
background: Me
|
|
3971
|
+
} : Qe ? {
|
|
3953
3972
|
position: "sticky",
|
|
3954
3973
|
right: 0,
|
|
3955
3974
|
zIndex: 1,
|
|
3956
|
-
background:
|
|
3957
|
-
} : {}, xe = ((
|
|
3975
|
+
background: Me
|
|
3976
|
+
} : {}, xe = ((Fr = v.data) == null ? void 0 : Fr.filter((ar) => ar.columnId === U.id)) || [], ua = Object.assign(
|
|
3958
3977
|
{},
|
|
3959
|
-
|
|
3960
|
-
|
|
3961
|
-
|
|
3962
|
-
maxWidth: typeof
|
|
3978
|
+
Jr(U.type),
|
|
3979
|
+
ca,
|
|
3980
|
+
U.maxWidth !== void 0 ? {
|
|
3981
|
+
maxWidth: typeof U.maxWidth == "number" ? `${U.maxWidth}px` : U.maxWidth
|
|
3963
3982
|
} : {},
|
|
3964
|
-
{ background:
|
|
3965
|
-
),
|
|
3966
|
-
var
|
|
3967
|
-
return ge &&
|
|
3983
|
+
{ background: Me }
|
|
3984
|
+
), ha = () => {
|
|
3985
|
+
var ar, Dr;
|
|
3986
|
+
return ge && oe ? /* @__PURE__ */ L("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
3968
3987
|
/* @__PURE__ */ o(
|
|
3969
3988
|
"button",
|
|
3970
3989
|
{
|
|
3971
|
-
onClick: () => i(
|
|
3990
|
+
onClick: () => i(v.id),
|
|
3972
3991
|
style: {
|
|
3973
3992
|
background: "none",
|
|
3974
3993
|
border: "none",
|
|
@@ -3977,120 +3996,125 @@ const et = be.memo((e) => {
|
|
|
3977
3996
|
display: "flex",
|
|
3978
3997
|
alignItems: "center",
|
|
3979
3998
|
justifyContent: "center",
|
|
3980
|
-
color: ((
|
|
3999
|
+
color: ((Dr = (ar = p.theme) == null ? void 0 : ar.colors) == null ? void 0 : Dr.text) || B.colors.text
|
|
3981
4000
|
},
|
|
3982
|
-
children:
|
|
4001
|
+
children: de ? /* @__PURE__ */ o(ba, { size: 16 }) : /* @__PURE__ */ o(ga, { size: 16 })
|
|
3983
4002
|
}
|
|
3984
4003
|
),
|
|
3985
|
-
/* @__PURE__ */
|
|
4004
|
+
/* @__PURE__ */ L("span", { style: { paddingLeft: h * 16 }, children: [
|
|
3986
4005
|
" ",
|
|
3987
|
-
xe.length > 0 ?
|
|
4006
|
+
xe.length > 0 ? U.type === "action" ? U.render ? U.render(
|
|
3988
4007
|
xe.length > 1 ? xe.map((ve) => ve) : xe[0],
|
|
3989
|
-
|
|
4008
|
+
v,
|
|
3990
4009
|
xe.length > 1 ? void 0 : xe[0]
|
|
3991
|
-
) : null : xe.map((ve,
|
|
4010
|
+
) : null : xe.map((ve, dr) => /* @__PURE__ */ o(
|
|
3992
4011
|
"span",
|
|
3993
4012
|
{
|
|
3994
4013
|
style: {
|
|
3995
4014
|
marginRight: 4,
|
|
3996
4015
|
display: "inline-block",
|
|
3997
|
-
maxWidth:
|
|
4016
|
+
maxWidth: U.maxWidth ? typeof U.maxWidth == "number" ? `${U.maxWidth}px` : U.maxWidth : void 0,
|
|
3998
4017
|
overflow: "hidden",
|
|
3999
4018
|
textOverflow: "ellipsis",
|
|
4000
4019
|
verticalAlign: "middle"
|
|
4001
4020
|
},
|
|
4002
|
-
children:
|
|
4021
|
+
children: U.render ? U.render(ve.value, v, ve) : /* @__PURE__ */ o("span", { children: ve.value })
|
|
4003
4022
|
},
|
|
4004
|
-
|
|
4023
|
+
dr
|
|
4005
4024
|
)) : null
|
|
4006
4025
|
] })
|
|
4007
|
-
] }) : /* @__PURE__ */
|
|
4026
|
+
] }) : /* @__PURE__ */ L("span", { style: { paddingLeft: h * 16 }, children: [
|
|
4008
4027
|
" ",
|
|
4009
|
-
xe.length > 0 ?
|
|
4028
|
+
xe.length > 0 ? U.type === "action" ? U.render ? U.render(
|
|
4010
4029
|
xe.length > 1 ? xe.map((ve) => ve) : xe[0],
|
|
4011
|
-
|
|
4030
|
+
v,
|
|
4012
4031
|
xe.length > 1 ? void 0 : xe[0]
|
|
4013
|
-
) : null : xe.map((ve,
|
|
4032
|
+
) : null : xe.map((ve, dr) => /* @__PURE__ */ o(
|
|
4014
4033
|
"span",
|
|
4015
4034
|
{
|
|
4016
4035
|
style: {
|
|
4017
4036
|
marginRight: 4,
|
|
4018
4037
|
display: "inline-block",
|
|
4019
|
-
maxWidth:
|
|
4038
|
+
maxWidth: U.maxWidth ? typeof U.maxWidth == "number" ? `${U.maxWidth}px` : U.maxWidth : void 0,
|
|
4020
4039
|
overflow: "hidden",
|
|
4021
4040
|
textOverflow: "ellipsis",
|
|
4022
4041
|
verticalAlign: "middle"
|
|
4023
4042
|
},
|
|
4024
|
-
children:
|
|
4043
|
+
children: U.render ? U.render(ve.value, v, ve) : /* @__PURE__ */ o("span", { children: ve.value })
|
|
4025
4044
|
},
|
|
4026
|
-
|
|
4045
|
+
dr
|
|
4027
4046
|
)) : null
|
|
4028
4047
|
] });
|
|
4029
4048
|
};
|
|
4030
4049
|
return /* @__PURE__ */ o(
|
|
4031
|
-
|
|
4050
|
+
Kr,
|
|
4032
4051
|
{
|
|
4033
|
-
theme:
|
|
4034
|
-
style:
|
|
4035
|
-
className: ge && T ? "sticky-shadow-left" :
|
|
4036
|
-
children:
|
|
4052
|
+
theme: p.theme || B,
|
|
4053
|
+
style: ua,
|
|
4054
|
+
className: ge && T ? "sticky-shadow-left" : Qe && V ? "sticky-shadow-right" : "",
|
|
4055
|
+
children: ha()
|
|
4037
4056
|
},
|
|
4038
|
-
|
|
4057
|
+
U.id
|
|
4039
4058
|
);
|
|
4040
4059
|
})
|
|
4041
4060
|
]
|
|
4042
4061
|
}
|
|
4043
4062
|
),
|
|
4044
|
-
|
|
4063
|
+
oe && de && v.children !== void 0 && /* @__PURE__ */ o(
|
|
4045
4064
|
"tr",
|
|
4046
4065
|
{
|
|
4047
|
-
className: " relative
|
|
4066
|
+
className: "dynamic-table-sub-row relative",
|
|
4048
4067
|
style: {
|
|
4049
|
-
width:
|
|
4068
|
+
width: W > 0 ? `${W}px` : "100%"
|
|
4050
4069
|
},
|
|
4051
4070
|
children: /* @__PURE__ */ o(
|
|
4052
4071
|
"td",
|
|
4053
4072
|
{
|
|
4073
|
+
className: "dynamic-table-sub-cell",
|
|
4054
4074
|
style: {
|
|
4055
|
-
width:
|
|
4075
|
+
width: W > 0 ? `${W}px` : "100%"
|
|
4056
4076
|
},
|
|
4057
|
-
colSpan:
|
|
4058
|
-
children: /* @__PURE__ */
|
|
4077
|
+
colSpan: C.length + (e.allowMultiSelect ? 1 : 0),
|
|
4078
|
+
children: /* @__PURE__ */ L(
|
|
4059
4079
|
"div",
|
|
4060
4080
|
{
|
|
4081
|
+
className: "dynamic-table-sub-container",
|
|
4061
4082
|
style: {
|
|
4062
4083
|
position: "sticky",
|
|
4063
4084
|
left: 0,
|
|
4064
|
-
padding: "
|
|
4065
|
-
width:
|
|
4085
|
+
padding: "0px 8px",
|
|
4086
|
+
width: W > 0 ? `${W}px` : "100%",
|
|
4066
4087
|
// 使用父容器实际宽度
|
|
4067
4088
|
minWidth: "800px",
|
|
4068
4089
|
// 最小宽度确保内容显示
|
|
4069
4090
|
maxWidth: "100%",
|
|
4070
4091
|
// 最大宽度不超过父容器
|
|
4071
|
-
background: ((
|
|
4092
|
+
background: ((Ne = (be = p.theme) == null ? void 0 : be.colors) == null ? void 0 : Ne.subTableBackground) || ((Ze = (Pe = p.theme) == null ? void 0 : Pe.colors) == null ? void 0 : Ze.disabledBackground) || B.colors.subTableBackground || B.colors.disabledBackground,
|
|
4072
4093
|
boxSizing: "border-box"
|
|
4073
4094
|
},
|
|
4074
4095
|
children: [
|
|
4075
|
-
|
|
4096
|
+
v.tableLoading && /* @__PURE__ */ o(
|
|
4076
4097
|
"div",
|
|
4077
4098
|
{
|
|
4099
|
+
className: "dynamic-table-sub-loading-overlay",
|
|
4078
4100
|
style: {
|
|
4079
4101
|
position: "absolute",
|
|
4080
4102
|
top: 0,
|
|
4081
4103
|
left: 0,
|
|
4082
4104
|
right: 0,
|
|
4083
4105
|
bottom: 0,
|
|
4084
|
-
background:
|
|
4106
|
+
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,
|
|
4107
|
+
opacity: 0.9,
|
|
4085
4108
|
display: "flex",
|
|
4086
4109
|
alignItems: "center",
|
|
4087
4110
|
justifyContent: "center",
|
|
4088
4111
|
zIndex: 10,
|
|
4089
|
-
borderRadius:
|
|
4112
|
+
borderRadius: p.space.radius
|
|
4090
4113
|
},
|
|
4091
|
-
children: /* @__PURE__ */
|
|
4114
|
+
children: /* @__PURE__ */ L(
|
|
4092
4115
|
"div",
|
|
4093
4116
|
{
|
|
4117
|
+
className: "dynamic-table-sub-loading-content",
|
|
4094
4118
|
style: {
|
|
4095
4119
|
display: "flex",
|
|
4096
4120
|
flexDirection: "column",
|
|
@@ -4101,66 +4125,68 @@ const et = be.memo((e) => {
|
|
|
4101
4125
|
/* @__PURE__ */ o(
|
|
4102
4126
|
"div",
|
|
4103
4127
|
{
|
|
4128
|
+
className: "dynamic-table-sub-loading-spinner",
|
|
4104
4129
|
style: {
|
|
4105
4130
|
width: 24,
|
|
4106
4131
|
height: 24,
|
|
4107
|
-
border: `2px solid ${((
|
|
4108
|
-
borderTop: `2px solid ${((
|
|
4132
|
+
border: `2px solid ${((gr = (br = p.theme) == null ? void 0 : br.colors) == null ? void 0 : gr.border) || B.colors.border}`,
|
|
4133
|
+
borderTop: `2px solid ${((yr = (xr = p.theme) == null ? void 0 : xr.colors) == null ? void 0 : yr.primary) || B.colors.primary}`,
|
|
4109
4134
|
borderRadius: "50%",
|
|
4110
4135
|
animation: "spin 1s linear infinite"
|
|
4111
4136
|
}
|
|
4112
4137
|
}
|
|
4113
4138
|
),
|
|
4114
|
-
/* @__PURE__ */ o("span", { style: { fontSize: 14, color: ((
|
|
4139
|
+
/* @__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
4140
|
]
|
|
4116
4141
|
}
|
|
4117
4142
|
)
|
|
4118
4143
|
}
|
|
4119
4144
|
),
|
|
4120
|
-
/* @__PURE__ */
|
|
4121
|
-
Array.isArray((
|
|
4145
|
+
/* @__PURE__ */ L("div", { className: "dynamic-table-sub-content", style: { marginBottom: "16px" }, children: [
|
|
4146
|
+
Array.isArray((wr = e.subTableConfig) == null ? void 0 : wr.toolbar) && e.subTableConfig.toolbar.length > 0 && /* @__PURE__ */ o(
|
|
4122
4147
|
"div",
|
|
4123
4148
|
{
|
|
4149
|
+
className: "dynamic-table-sub-toolbar",
|
|
4124
4150
|
style: {
|
|
4125
4151
|
display: "flex",
|
|
4126
4152
|
gap: 8,
|
|
4127
4153
|
alignItems: "center",
|
|
4128
4154
|
marginBottom: 8
|
|
4129
4155
|
},
|
|
4130
|
-
children: e.subTableConfig.toolbar.map((
|
|
4131
|
-
const
|
|
4156
|
+
children: e.subTableConfig.toolbar.map((U, ue) => {
|
|
4157
|
+
const Qe = {
|
|
4132
4158
|
primary: "primary",
|
|
4133
4159
|
error: "danger",
|
|
4134
4160
|
default: "text"
|
|
4135
|
-
}[
|
|
4161
|
+
}[U.btnType] || "text";
|
|
4136
4162
|
return /* @__PURE__ */ o(
|
|
4137
|
-
|
|
4163
|
+
er,
|
|
4138
4164
|
{
|
|
4139
|
-
mode:
|
|
4140
|
-
label:
|
|
4141
|
-
icon:
|
|
4165
|
+
mode: Qe,
|
|
4166
|
+
label: U.label,
|
|
4167
|
+
icon: U.icon,
|
|
4142
4168
|
onClick: () => {
|
|
4143
|
-
var
|
|
4144
|
-
return (
|
|
4145
|
-
tableId:
|
|
4146
|
-
action:
|
|
4169
|
+
var Me;
|
|
4170
|
+
return (Me = e.eventsEmit) == null ? void 0 : Me.call(e, "table_action_add", {
|
|
4171
|
+
tableId: v.id,
|
|
4172
|
+
action: U
|
|
4147
4173
|
});
|
|
4148
4174
|
}
|
|
4149
4175
|
},
|
|
4150
|
-
|
|
4176
|
+
ue
|
|
4151
4177
|
);
|
|
4152
4178
|
})
|
|
4153
4179
|
}
|
|
4154
4180
|
),
|
|
4155
4181
|
/* @__PURE__ */ o(
|
|
4156
|
-
|
|
4182
|
+
ht,
|
|
4157
4183
|
{
|
|
4158
|
-
theme:
|
|
4159
|
-
onWheel: (
|
|
4160
|
-
|
|
4184
|
+
theme: p.theme || B,
|
|
4185
|
+
onWheel: (U) => {
|
|
4186
|
+
U.stopPropagation();
|
|
4161
4187
|
},
|
|
4162
|
-
onScroll: (
|
|
4163
|
-
|
|
4188
|
+
onScroll: (U) => {
|
|
4189
|
+
U.stopPropagation();
|
|
4164
4190
|
},
|
|
4165
4191
|
style: {
|
|
4166
4192
|
position: "relative",
|
|
@@ -4170,37 +4196,37 @@ const et = be.memo((e) => {
|
|
|
4170
4196
|
maxWidth: "100%"
|
|
4171
4197
|
},
|
|
4172
4198
|
children: /* @__PURE__ */ o(
|
|
4173
|
-
|
|
4199
|
+
bt,
|
|
4174
4200
|
{
|
|
4175
|
-
columns: ((
|
|
4176
|
-
dataSource:
|
|
4201
|
+
columns: ((kr = e.subTableConfig) == null ? void 0 : kr.columns) || [],
|
|
4202
|
+
dataSource: v.children || [],
|
|
4177
4203
|
isSubTable: !0,
|
|
4178
|
-
isPending: (
|
|
4179
|
-
var
|
|
4180
|
-
return ((ge = (
|
|
4204
|
+
isPending: (U) => {
|
|
4205
|
+
var ue, ge;
|
|
4206
|
+
return ((ge = (ue = e.subTablePendingIds) == null ? void 0 : ue[v.id]) == null ? void 0 : ge.includes(U)) || !1;
|
|
4181
4207
|
},
|
|
4182
|
-
onRowAnimationComplete: (
|
|
4183
|
-
var
|
|
4184
|
-
(
|
|
4185
|
-
rowId:
|
|
4186
|
-
tableId:
|
|
4208
|
+
onRowAnimationComplete: (U) => {
|
|
4209
|
+
var ue;
|
|
4210
|
+
(ue = e.onSubTableRowAnimationComplete) == null || ue.call(e, v.id, U), e.eventsEmit && e.eventsEmit("_internal:subtable_animation_complete", {
|
|
4211
|
+
rowId: U,
|
|
4212
|
+
tableId: v.id
|
|
4187
4213
|
});
|
|
4188
4214
|
},
|
|
4189
|
-
eventsEmit: (
|
|
4215
|
+
eventsEmit: (U, ue) => {
|
|
4190
4216
|
var ge;
|
|
4191
|
-
(ge = e.eventsEmit) == null || ge.call(e,
|
|
4217
|
+
(ge = e.eventsEmit) == null || ge.call(e, U, { ...ue, tableId: v.id });
|
|
4192
4218
|
},
|
|
4193
|
-
allowMultiSelect: (
|
|
4219
|
+
allowMultiSelect: (Sr = e.subTableConfig) == null ? void 0 : Sr.allowMultiSelect,
|
|
4194
4220
|
size: e.size,
|
|
4195
4221
|
level: h + 1,
|
|
4196
4222
|
subTableConfig: e.subTableConfig,
|
|
4197
4223
|
styles: e.styles,
|
|
4198
4224
|
onRowAddAnimationComplete: e.onRowAddAnimationComplete,
|
|
4199
4225
|
addingIds: e.addingIds,
|
|
4200
|
-
viewBehavior: (
|
|
4201
|
-
viewPageSize: (
|
|
4202
|
-
total: (
|
|
4203
|
-
requestPagesize: (
|
|
4226
|
+
viewBehavior: (Nr = e.subTableConfig) == null ? void 0 : Nr.viewBehavior,
|
|
4227
|
+
viewPageSize: (Cr = e.subTableConfig) == null ? void 0 : Cr.viewPageSize,
|
|
4228
|
+
total: (Mr = e.subTableConfig) == null ? void 0 : Mr.total,
|
|
4229
|
+
requestPagesize: (Tr = e.subTableConfig) == null ? void 0 : Tr.requestPagesize
|
|
4204
4230
|
}
|
|
4205
4231
|
)
|
|
4206
4232
|
}
|
|
@@ -4213,7 +4239,7 @@ const et = be.memo((e) => {
|
|
|
4213
4239
|
)
|
|
4214
4240
|
}
|
|
4215
4241
|
)
|
|
4216
|
-
] },
|
|
4242
|
+
] }, v.id ?? ne);
|
|
4217
4243
|
}) })
|
|
4218
4244
|
]
|
|
4219
4245
|
}
|
|
@@ -4228,40 +4254,40 @@ const et = be.memo((e) => {
|
|
|
4228
4254
|
display: "flex",
|
|
4229
4255
|
justifyContent: "end",
|
|
4230
4256
|
alignItems: "center",
|
|
4231
|
-
background: ((
|
|
4232
|
-
borderTop: `1px solid ${((
|
|
4257
|
+
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,
|
|
4258
|
+
borderTop: `1px solid ${((je = (Le = p.theme) == null ? void 0 : Le.colors) == null ? void 0 : je.border) || B.colors.border}`,
|
|
4233
4259
|
flexShrink: 0,
|
|
4234
4260
|
paddingRight: 16
|
|
4235
4261
|
},
|
|
4236
4262
|
children: /* @__PURE__ */ o(
|
|
4237
|
-
|
|
4263
|
+
wa,
|
|
4238
4264
|
{
|
|
4239
|
-
current:
|
|
4240
|
-
pageSize:
|
|
4241
|
-
total:
|
|
4242
|
-
onChange:
|
|
4243
|
-
onPageSizeChange: (
|
|
4244
|
-
var
|
|
4245
|
-
|
|
4265
|
+
current: R,
|
|
4266
|
+
pageSize: X,
|
|
4267
|
+
total: S,
|
|
4268
|
+
onChange: I,
|
|
4269
|
+
onPageSizeChange: (v) => {
|
|
4270
|
+
var ne;
|
|
4271
|
+
Q(1), P(v), O && l && M && e.eventsEmit && (a(/* @__PURE__ */ new Set()), e.eventsEmit(
|
|
4246
4272
|
"pagination:request_merge_data",
|
|
4247
4273
|
{
|
|
4248
4274
|
viewId: M,
|
|
4249
4275
|
request: { pageNo: 1, pageSize: l }
|
|
4250
4276
|
},
|
|
4251
4277
|
void 0
|
|
4252
|
-
)), (
|
|
4278
|
+
)), (ne = e.eventsEmit) == null || ne.call(e, "pagination:pageSizeChange", { viewId: M, pageSize: v });
|
|
4253
4279
|
},
|
|
4254
4280
|
showSizeChanger: !0,
|
|
4255
4281
|
pageSizeOptions: [5, 10, 20, 30, 50],
|
|
4256
4282
|
theme: {
|
|
4257
4283
|
colors: {
|
|
4258
|
-
background: ((
|
|
4259
|
-
text: ((
|
|
4260
|
-
border: ((
|
|
4261
|
-
disabledBackground: ((
|
|
4262
|
-
primary: ((
|
|
4284
|
+
background: ((He = (Oe = p.theme) == null ? void 0 : Oe.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,
|
|
4285
|
+
text: ((Ve = (Ue = p.theme) == null ? void 0 : Ue.colors) == null ? void 0 : Ve.text) || B.colors.text,
|
|
4286
|
+
border: ((Je = (Ee = p.theme) == null ? void 0 : Ee.colors) == null ? void 0 : Je.border) || B.colors.border,
|
|
4287
|
+
disabledBackground: ((Ke = (Ge = p.theme) == null ? void 0 : Ge.colors) == null ? void 0 : Ke.disabledBackground) || B.colors.disabledBackground,
|
|
4288
|
+
primary: ((pe = (Xe = p.theme) == null ? void 0 : Xe.colors) == null ? void 0 : pe.primary) || B.colors.primary
|
|
4263
4289
|
},
|
|
4264
|
-
space: { radius: ((
|
|
4290
|
+
space: { radius: ((rr = (Ce = p.theme) == null ? void 0 : Ce.space) == null ? void 0 : rr.radius) || B.space.radius }
|
|
4265
4291
|
},
|
|
4266
4292
|
size: e.size,
|
|
4267
4293
|
showPageNumbers: !0
|
|
@@ -4272,7 +4298,7 @@ const et = be.memo((e) => {
|
|
|
4272
4298
|
]
|
|
4273
4299
|
}
|
|
4274
4300
|
);
|
|
4275
|
-
}),
|
|
4301
|
+
}), gt = J.div`
|
|
4276
4302
|
display: flex;
|
|
4277
4303
|
background-color: #ffffff;
|
|
4278
4304
|
border: 1px solid ${(e) => {
|
|
@@ -4287,7 +4313,7 @@ const et = be.memo((e) => {
|
|
|
4287
4313
|
width: ${(e) => e.$width || "600px"};
|
|
4288
4314
|
height: ${(e) => e.$height || "400px"};
|
|
4289
4315
|
position: relative;
|
|
4290
|
-
`,
|
|
4316
|
+
`, Xr = J.div`
|
|
4291
4317
|
display: flex;
|
|
4292
4318
|
flex-direction: column;
|
|
4293
4319
|
border-right: 1px solid ${(e) => {
|
|
@@ -4299,7 +4325,7 @@ const et = be.memo((e) => {
|
|
|
4299
4325
|
&:last-child {
|
|
4300
4326
|
border-right: none;
|
|
4301
4327
|
}
|
|
4302
|
-
`,
|
|
4328
|
+
`, Pr = J.div`
|
|
4303
4329
|
padding: 12px 16px;
|
|
4304
4330
|
border-bottom: 1px solid ${(e) => {
|
|
4305
4331
|
var r, t, s;
|
|
@@ -4315,7 +4341,7 @@ const et = be.memo((e) => {
|
|
|
4315
4341
|
var r, t, s;
|
|
4316
4342
|
return ((s = (t = (r = e.$theme) == null ? void 0 : r.colors) == null ? void 0 : t.text) == null ? void 0 : s.primary) || "#111827";
|
|
4317
4343
|
}};
|
|
4318
|
-
`,
|
|
4344
|
+
`, xt = J.div`
|
|
4319
4345
|
padding: 12px;
|
|
4320
4346
|
border-bottom: 1px solid ${(e) => {
|
|
4321
4347
|
var r, t, s;
|
|
@@ -4325,7 +4351,7 @@ const et = be.memo((e) => {
|
|
|
4325
4351
|
var r, t, s;
|
|
4326
4352
|
return ((s = (t = (r = e.$theme) == null ? void 0 : r.colors) == null ? void 0 : t.background) == null ? void 0 : s.default) || "#ffffff";
|
|
4327
4353
|
}};
|
|
4328
|
-
`,
|
|
4354
|
+
`, yt = J.input`
|
|
4329
4355
|
width: 100%;
|
|
4330
4356
|
padding: 8px 12px 8px 36px;
|
|
4331
4357
|
border: 1px solid ${(e) => {
|
|
@@ -4357,14 +4383,14 @@ const et = be.memo((e) => {
|
|
|
4357
4383
|
return ((s = (t = (r = e.$theme) == null ? void 0 : r.colors) == null ? void 0 : t.text) == null ? void 0 : s.tertiary) || "#9ca3af";
|
|
4358
4384
|
}};
|
|
4359
4385
|
}
|
|
4360
|
-
`,
|
|
4386
|
+
`, $t = J.div`
|
|
4361
4387
|
position: absolute;
|
|
4362
4388
|
left: 20px;
|
|
4363
4389
|
top: 50%;
|
|
4364
4390
|
transform: translateY(-50%);
|
|
4365
4391
|
color: #9ca3af;
|
|
4366
4392
|
pointer-events: none;
|
|
4367
|
-
`,
|
|
4393
|
+
`, Zr = J.div`
|
|
4368
4394
|
flex: 1;
|
|
4369
4395
|
overflow-y: auto;
|
|
4370
4396
|
overflow-x: hidden;
|
|
@@ -4385,7 +4411,7 @@ const et = be.memo((e) => {
|
|
|
4385
4411
|
background: #a8a8a8;
|
|
4386
4412
|
}
|
|
4387
4413
|
}
|
|
4388
|
-
`,
|
|
4414
|
+
`, Qr = J.div`
|
|
4389
4415
|
padding: 10px 16px;
|
|
4390
4416
|
cursor: ${(e) => e.$disabled ? "not-allowed" : "pointer"};
|
|
4391
4417
|
transition: all 0.2s;
|
|
@@ -4408,7 +4434,7 @@ const et = be.memo((e) => {
|
|
|
4408
4434
|
&:last-child {
|
|
4409
4435
|
border-bottom: none;
|
|
4410
4436
|
}
|
|
4411
|
-
`,
|
|
4437
|
+
`, ea = J.span`
|
|
4412
4438
|
flex: 1;
|
|
4413
4439
|
font-size: 14px;
|
|
4414
4440
|
color: ${(e) => {
|
|
@@ -4418,7 +4444,7 @@ const et = be.memo((e) => {
|
|
|
4418
4444
|
overflow: hidden;
|
|
4419
4445
|
text-overflow: ellipsis;
|
|
4420
4446
|
white-space: nowrap;
|
|
4421
|
-
`,
|
|
4447
|
+
`, ra = J.button`
|
|
4422
4448
|
display: flex;
|
|
4423
4449
|
align-items: center;
|
|
4424
4450
|
justify-content: center;
|
|
@@ -4442,7 +4468,7 @@ const et = be.memo((e) => {
|
|
|
4442
4468
|
return ((s = (t = (r = e.$theme) == null ? void 0 : r.colors) == null ? void 0 : t.text) == null ? void 0 : s.secondary) || "#C9CDD4";
|
|
4443
4469
|
}};
|
|
4444
4470
|
}
|
|
4445
|
-
`,
|
|
4471
|
+
`, aa = J.div`
|
|
4446
4472
|
padding: 40px 20px;
|
|
4447
4473
|
text-align: center;
|
|
4448
4474
|
color: ${(e) => {
|
|
@@ -4450,7 +4476,7 @@ const et = be.memo((e) => {
|
|
|
4450
4476
|
return ((s = (t = (r = e.$theme) == null ? void 0 : r.colors) == null ? void 0 : t.text) == null ? void 0 : s.tertiary) || "#9ca3af";
|
|
4451
4477
|
}};
|
|
4452
4478
|
font-size: 14px;
|
|
4453
|
-
`,
|
|
4479
|
+
`, ta = J.span`
|
|
4454
4480
|
display: inline-flex;
|
|
4455
4481
|
align-items: center;
|
|
4456
4482
|
justify-content: center;
|
|
@@ -4466,178 +4492,178 @@ const et = be.memo((e) => {
|
|
|
4466
4492
|
font-size: 12px;
|
|
4467
4493
|
font-weight: 500;
|
|
4468
4494
|
margin-left: 8px;
|
|
4469
|
-
`,
|
|
4495
|
+
`, Rt = ({
|
|
4470
4496
|
dataSource: e,
|
|
4471
4497
|
value: r,
|
|
4472
4498
|
defaultValue: t = [],
|
|
4473
4499
|
onChange: s,
|
|
4474
4500
|
maxCount: h = 0,
|
|
4475
4501
|
searchPlaceholder: b = "搜索...",
|
|
4476
|
-
leftTitle:
|
|
4502
|
+
leftTitle: p = "可选",
|
|
4477
4503
|
rightTitle: d = "已选",
|
|
4478
|
-
showSearch:
|
|
4504
|
+
showSearch: f = !0,
|
|
4479
4505
|
filterOption: N,
|
|
4480
|
-
renderItem:
|
|
4506
|
+
renderItem: F,
|
|
4481
4507
|
renderSelectedItem: M,
|
|
4482
|
-
onItemDataChange:
|
|
4508
|
+
onItemDataChange: O,
|
|
4483
4509
|
itemDataMap: l,
|
|
4484
|
-
className:
|
|
4485
|
-
style:
|
|
4486
|
-
styles:
|
|
4487
|
-
height:
|
|
4510
|
+
className: $,
|
|
4511
|
+
style: H,
|
|
4512
|
+
styles: P,
|
|
4513
|
+
height: te,
|
|
4488
4514
|
width: a
|
|
4489
4515
|
}) => {
|
|
4490
|
-
const T =
|
|
4491
|
-
$e({ theme:
|
|
4492
|
-
|
|
4493
|
-
), [
|
|
4494
|
-
r === void 0 &&
|
|
4495
|
-
}, y = N || ((
|
|
4496
|
-
const
|
|
4497
|
-
l === void 0 &&
|
|
4498
|
-
},
|
|
4499
|
-
const
|
|
4500
|
-
if (G(
|
|
4501
|
-
if (
|
|
4502
|
-
const
|
|
4503
|
-
delete
|
|
4516
|
+
const T = Fe(), w = $e(
|
|
4517
|
+
$e({ theme: B, mode: "light" }, T),
|
|
4518
|
+
P
|
|
4519
|
+
), [V, _] = ie(t), [E, j] = ie(""), [ee, Z] = ie(l || {}), W = l !== void 0 ? l : ee, re = r !== void 0 ? r : V, G = (S) => {
|
|
4520
|
+
r === void 0 && _(S), s == null || s(S);
|
|
4521
|
+
}, y = N || ((S, Y) => S ? Y.label.toLowerCase().includes(S.toLowerCase()) : !0), x = Se(() => e.filter((S) => y(E, S)), [e, E, y]), z = Se(() => e.filter((S) => re.includes(S.key)), [e, re]), k = (S, Y) => {
|
|
4522
|
+
const I = { ...W[S], ...Y }, i = { ...W, [S]: I };
|
|
4523
|
+
l === void 0 && Z(i), O == null || O(S, I);
|
|
4524
|
+
}, q = (S) => {
|
|
4525
|
+
const Y = re.filter((I) => I !== S.key);
|
|
4526
|
+
if (G(Y), l === void 0) {
|
|
4527
|
+
if (W[S.key]) {
|
|
4528
|
+
const I = { ...W };
|
|
4529
|
+
delete I[S.key], Z(I);
|
|
4504
4530
|
}
|
|
4505
4531
|
} else
|
|
4506
|
-
|
|
4532
|
+
W[S.key] && (O == null || O(S.key, void 0));
|
|
4507
4533
|
};
|
|
4508
4534
|
we(() => {
|
|
4509
4535
|
if (l === void 0) {
|
|
4510
|
-
const
|
|
4511
|
-
(
|
|
4536
|
+
const S = new Set(re), Y = Object.keys(W).filter(
|
|
4537
|
+
(I) => !S.has(I)
|
|
4512
4538
|
);
|
|
4513
|
-
if (
|
|
4514
|
-
const
|
|
4515
|
-
|
|
4516
|
-
delete
|
|
4517
|
-
}),
|
|
4539
|
+
if (Y.length > 0) {
|
|
4540
|
+
const I = { ...W };
|
|
4541
|
+
Y.forEach((i) => {
|
|
4542
|
+
delete I[i];
|
|
4543
|
+
}), Z(I);
|
|
4518
4544
|
}
|
|
4519
4545
|
} else {
|
|
4520
|
-
const
|
|
4521
|
-
Object.keys(
|
|
4522
|
-
(
|
|
4523
|
-
).forEach((
|
|
4524
|
-
|
|
4546
|
+
const S = new Set(re);
|
|
4547
|
+
Object.keys(W).filter(
|
|
4548
|
+
(I) => !S.has(I)
|
|
4549
|
+
).forEach((I) => {
|
|
4550
|
+
O == null || O(I, void 0);
|
|
4525
4551
|
});
|
|
4526
4552
|
}
|
|
4527
|
-
}, [
|
|
4528
|
-
const
|
|
4529
|
-
if (
|
|
4530
|
-
const
|
|
4531
|
-
if (
|
|
4532
|
-
|
|
4553
|
+
}, [re]);
|
|
4554
|
+
const R = (S) => {
|
|
4555
|
+
if (S.disabled) return;
|
|
4556
|
+
const Y = [...re], I = Y.indexOf(S.key);
|
|
4557
|
+
if (I > -1)
|
|
4558
|
+
Y.splice(I, 1);
|
|
4533
4559
|
else {
|
|
4534
|
-
if (h > 0 &&
|
|
4560
|
+
if (h > 0 && Y.length >= h)
|
|
4535
4561
|
return;
|
|
4536
|
-
|
|
4562
|
+
Y.push(S.key);
|
|
4537
4563
|
}
|
|
4538
|
-
G(
|
|
4539
|
-
},
|
|
4540
|
-
return /* @__PURE__ */
|
|
4541
|
-
|
|
4564
|
+
G(Y);
|
|
4565
|
+
}, Q = (S) => re.includes(S), X = h > 0 && re.length >= h;
|
|
4566
|
+
return /* @__PURE__ */ L(
|
|
4567
|
+
gt,
|
|
4542
4568
|
{
|
|
4543
|
-
$theme:
|
|
4569
|
+
$theme: w.theme || B,
|
|
4544
4570
|
$width: a,
|
|
4545
|
-
$height:
|
|
4546
|
-
className:
|
|
4547
|
-
style:
|
|
4571
|
+
$height: te,
|
|
4572
|
+
className: $,
|
|
4573
|
+
style: H,
|
|
4548
4574
|
children: [
|
|
4549
|
-
/* @__PURE__ */
|
|
4550
|
-
/* @__PURE__ */
|
|
4551
|
-
|
|
4552
|
-
h > 0 && /* @__PURE__ */
|
|
4553
|
-
|
|
4575
|
+
/* @__PURE__ */ L(Xr, { $theme: w.theme || B, style: { flex: 1 }, children: [
|
|
4576
|
+
/* @__PURE__ */ L(Pr, { $theme: w.theme || B, children: [
|
|
4577
|
+
p,
|
|
4578
|
+
h > 0 && /* @__PURE__ */ L(ta, { $theme: w.theme || B, children: [
|
|
4579
|
+
re.length,
|
|
4554
4580
|
"/",
|
|
4555
4581
|
h
|
|
4556
4582
|
] })
|
|
4557
4583
|
] }),
|
|
4558
|
-
|
|
4559
|
-
/* @__PURE__ */ o(
|
|
4584
|
+
f && /* @__PURE__ */ o(xt, { $theme: w.theme || B, children: /* @__PURE__ */ L("div", { style: { position: "relative" }, children: [
|
|
4585
|
+
/* @__PURE__ */ o($t, { children: /* @__PURE__ */ o(xa, { size: 16 }) }),
|
|
4560
4586
|
/* @__PURE__ */ o(
|
|
4561
|
-
|
|
4587
|
+
yt,
|
|
4562
4588
|
{
|
|
4563
|
-
$theme:
|
|
4589
|
+
$theme: w.theme || B,
|
|
4564
4590
|
type: "text",
|
|
4565
4591
|
placeholder: b,
|
|
4566
|
-
value:
|
|
4567
|
-
onChange: (
|
|
4592
|
+
value: E,
|
|
4593
|
+
onChange: (S) => j(S.target.value)
|
|
4568
4594
|
}
|
|
4569
4595
|
)
|
|
4570
4596
|
] }) }),
|
|
4571
|
-
/* @__PURE__ */ o(
|
|
4572
|
-
const
|
|
4573
|
-
return /* @__PURE__ */
|
|
4574
|
-
|
|
4597
|
+
/* @__PURE__ */ o(Zr, { children: x.length === 0 ? /* @__PURE__ */ o(aa, { $theme: w.theme || B, children: E ? "未找到匹配项" : "暂无数据" }) : x.map((S) => {
|
|
4598
|
+
const Y = Q(S.key), I = S.disabled || X && !Y;
|
|
4599
|
+
return /* @__PURE__ */ L(
|
|
4600
|
+
Qr,
|
|
4575
4601
|
{
|
|
4576
|
-
$theme:
|
|
4577
|
-
$disabled:
|
|
4578
|
-
$selected:
|
|
4579
|
-
onClick: () =>
|
|
4602
|
+
$theme: w.theme || B,
|
|
4603
|
+
$disabled: I,
|
|
4604
|
+
$selected: Y,
|
|
4605
|
+
onClick: () => R(S),
|
|
4580
4606
|
children: [
|
|
4581
|
-
/* @__PURE__ */ o(
|
|
4582
|
-
|
|
4583
|
-
|
|
4607
|
+
/* @__PURE__ */ o(ea, { $theme: w.theme || B, children: F ? F(S) : S.label }),
|
|
4608
|
+
Y && /* @__PURE__ */ o(
|
|
4609
|
+
ra,
|
|
4584
4610
|
{
|
|
4585
|
-
$theme:
|
|
4611
|
+
$theme: w.theme || B,
|
|
4586
4612
|
onClick: (i) => {
|
|
4587
|
-
i.stopPropagation(),
|
|
4613
|
+
i.stopPropagation(), q(S);
|
|
4588
4614
|
},
|
|
4589
4615
|
disabled: !0,
|
|
4590
4616
|
children: "已添加"
|
|
4591
4617
|
}
|
|
4592
4618
|
),
|
|
4593
|
-
!
|
|
4594
|
-
|
|
4619
|
+
!Y && /* @__PURE__ */ o(
|
|
4620
|
+
ra,
|
|
4595
4621
|
{
|
|
4596
|
-
$theme:
|
|
4597
|
-
disabled:
|
|
4622
|
+
$theme: w.theme || B,
|
|
4623
|
+
disabled: I,
|
|
4598
4624
|
onClick: (i) => {
|
|
4599
|
-
i.stopPropagation(),
|
|
4625
|
+
i.stopPropagation(), R(S);
|
|
4600
4626
|
},
|
|
4601
4627
|
children: "添加"
|
|
4602
4628
|
}
|
|
4603
4629
|
)
|
|
4604
4630
|
]
|
|
4605
4631
|
},
|
|
4606
|
-
|
|
4632
|
+
S.key
|
|
4607
4633
|
);
|
|
4608
4634
|
}) })
|
|
4609
4635
|
] }),
|
|
4610
|
-
/* @__PURE__ */
|
|
4611
|
-
/* @__PURE__ */
|
|
4636
|
+
/* @__PURE__ */ L(Xr, { $theme: w.theme || B, style: { flex: 1 }, children: [
|
|
4637
|
+
/* @__PURE__ */ L(Pr, { $theme: w.theme || B, children: [
|
|
4612
4638
|
d,
|
|
4613
|
-
|
|
4639
|
+
re.length > 0 && /* @__PURE__ */ o(ta, { $theme: w.theme || B, children: re.length })
|
|
4614
4640
|
] }),
|
|
4615
|
-
/* @__PURE__ */ o(
|
|
4641
|
+
/* @__PURE__ */ o(Zr, { children: z.length === 0 ? /* @__PURE__ */ o(aa, { $theme: w.theme || B, children: "暂无已选项" }) : z.map((S) => {
|
|
4616
4642
|
var i, u, c;
|
|
4617
|
-
const
|
|
4618
|
-
return /* @__PURE__ */
|
|
4619
|
-
|
|
4643
|
+
const Y = W[S.key] || {}, I = (n) => k(S.key, n);
|
|
4644
|
+
return /* @__PURE__ */ L(
|
|
4645
|
+
Qr,
|
|
4620
4646
|
{
|
|
4621
|
-
$theme:
|
|
4647
|
+
$theme: w.theme || B,
|
|
4622
4648
|
children: [
|
|
4623
|
-
/* @__PURE__ */ o(
|
|
4649
|
+
/* @__PURE__ */ o(ea, { $theme: w.theme || B, children: M ? M(S, I, Y) : S.label }),
|
|
4624
4650
|
/* @__PURE__ */ o(
|
|
4625
|
-
|
|
4651
|
+
ya,
|
|
4626
4652
|
{
|
|
4627
4653
|
size: 14,
|
|
4628
|
-
color: ((c = (u = (i =
|
|
4654
|
+
color: ((c = (u = (i = w.theme) == null ? void 0 : i.colors) == null ? void 0 : u.text) == null ? void 0 : c.secondary) || "#86909C",
|
|
4629
4655
|
style: {
|
|
4630
4656
|
cursor: "pointer",
|
|
4631
4657
|
marginLeft: "8px"
|
|
4632
4658
|
},
|
|
4633
4659
|
onClick: (n) => {
|
|
4634
|
-
n.stopPropagation(),
|
|
4660
|
+
n.stopPropagation(), q(S);
|
|
4635
4661
|
}
|
|
4636
4662
|
}
|
|
4637
4663
|
)
|
|
4638
4664
|
]
|
|
4639
4665
|
},
|
|
4640
|
-
|
|
4666
|
+
S.key
|
|
4641
4667
|
);
|
|
4642
4668
|
}) })
|
|
4643
4669
|
] })
|
|
@@ -4646,17 +4672,17 @@ const et = be.memo((e) => {
|
|
|
4646
4672
|
);
|
|
4647
4673
|
};
|
|
4648
4674
|
export {
|
|
4649
|
-
|
|
4650
|
-
|
|
4651
|
-
|
|
4652
|
-
|
|
4653
|
-
|
|
4654
|
-
|
|
4655
|
-
|
|
4656
|
-
|
|
4657
|
-
|
|
4658
|
-
|
|
4659
|
-
|
|
4660
|
-
|
|
4661
|
-
|
|
4675
|
+
Dt as CustomDock,
|
|
4676
|
+
la as DynamicForm,
|
|
4677
|
+
bt as DynamicTable,
|
|
4678
|
+
Ft as GoogleNavbar,
|
|
4679
|
+
Rt as SearchableSelector,
|
|
4680
|
+
Yr as Uploader,
|
|
4681
|
+
_t as generateFormItems,
|
|
4682
|
+
zt as getFormDefaultValues,
|
|
4683
|
+
Wt as getFormErrors,
|
|
4684
|
+
Bt as isFormValid,
|
|
4685
|
+
Ja as useDynamicFormItems,
|
|
4686
|
+
it as useDynamicTableColumns,
|
|
4687
|
+
At as validateFormData
|
|
4662
4688
|
};
|