@mxmweb/zui-components 1.2.5 → 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 +849 -841
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as L, jsx as o, Fragment as na } from "react/jsx-runtime";
|
|
2
2
|
import me, { useState as ie, useMemo as Se, useEffect as we, useRef as Te, useCallback as he } from "react";
|
|
3
3
|
import J, { createGlobalStyle as pa } from "styled-components";
|
|
4
4
|
import { useTheme as Fe, deepMergeTheme as $e, defaultTheme as B } from "@mxmweb/zui-theme";
|
|
5
5
|
import zr from "animejs/lib/anime.es.js";
|
|
6
|
-
import { CircleHelp as oa, Trash as fa, File as ke, AlertCircle as
|
|
7
|
-
import { Form as K, Input as fe, Select as tr, InputNumber as nr, Slider as
|
|
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
8
|
import { Button as er, DropdownMenu as va, SharedPagination as wa } from "@mxmweb/zui-elements";
|
|
9
9
|
const ka = J.div`
|
|
10
10
|
background-color: #ffffff;
|
|
@@ -47,38 +47,38 @@ const ka = J.div`
|
|
|
47
47
|
style: f,
|
|
48
48
|
styles: N
|
|
49
49
|
}) => {
|
|
50
|
-
const
|
|
50
|
+
const F = Fe(), M = $e(
|
|
51
51
|
// 基础:默认主题 + useTheme的配置
|
|
52
|
-
$e({ theme: B, mode: "light" },
|
|
52
|
+
$e({ theme: B, mode: "light" }, F),
|
|
53
53
|
// 最高层:用户手动传入的styles
|
|
54
54
|
N
|
|
55
55
|
);
|
|
56
56
|
Sa();
|
|
57
|
-
const [
|
|
58
|
-
typeof s == "boolean" || l(
|
|
59
|
-
}, [
|
|
60
|
-
width:
|
|
61
|
-
minWidth:
|
|
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
68
|
onMouseEnter: () => te(!0),
|
|
69
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,33 +88,33 @@ const ka = 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
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((
|
|
103
|
-
const V = !!(r &&
|
|
104
|
-
return /* @__PURE__ */
|
|
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: () => !
|
|
107
|
+
onClick: () => !w.disabled && (b == null ? void 0 : b(w)),
|
|
108
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
|
]
|
|
@@ -241,92 +241,92 @@ const ka = J.div`
|
|
|
241
241
|
defaultActiveIds: d = [],
|
|
242
242
|
onItemClick: f,
|
|
243
243
|
onActiveChange: N,
|
|
244
|
-
onActiveChangeMultiple:
|
|
245
|
-
className:
|
|
246
|
-
styles:
|
|
244
|
+
onActiveChangeMultiple: F,
|
|
245
|
+
className: M,
|
|
246
|
+
styles: O
|
|
247
247
|
}) => {
|
|
248
|
-
const l = Fe(),
|
|
248
|
+
const l = Fe(), $ = $e(
|
|
249
249
|
// 基础:默认主题 + useTheme的配置
|
|
250
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
|
-
), j = Te(null),
|
|
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 (E(y),
|
|
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
|
-
f && f(G,
|
|
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
292
|
ref: j,
|
|
293
293
|
itemWidth: r,
|
|
294
294
|
itemGap: h,
|
|
295
|
-
theme:
|
|
296
|
-
className:
|
|
297
|
-
children: e.map((G,
|
|
295
|
+
theme: $.theme || B,
|
|
296
|
+
className: M,
|
|
297
|
+
children: e.map((G, C) => /* @__PURE__ */ L(
|
|
298
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: te ===
|
|
329
|
-
theme:
|
|
328
|
+
visible: te === C,
|
|
329
|
+
theme: $.theme || B,
|
|
330
330
|
children: G.label
|
|
331
331
|
}
|
|
332
332
|
)
|
|
@@ -340,72 +340,80 @@ const ka = J.div`
|
|
|
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
345
|
return r.forEach((p) => {
|
|
346
346
|
const d = p.name || p.field;
|
|
347
347
|
d && (s.includes(d.toLowerCase()) && !t[d] && (t[d] = e.name), h.includes(d.toLowerCase()) && !t[d] && (t[d] = sa(e.size)), b.includes(d.toLowerCase()) && !t[d] && (t[d] = e.type));
|
|
348
348
|
}), t;
|
|
349
349
|
}, za = async (e, r, t = {}, s = {}, h) => new Promise((b, p) => {
|
|
350
|
-
var
|
|
351
|
-
const d = new XMLHttpRequest(), f =
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
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
|
-
M(
|
|
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 M(
|
|
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
|
-
}, p(
|
|
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,7 +444,7 @@ const ka = 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";
|
|
@@ -451,7 +459,7 @@ const ka = 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";
|
|
@@ -497,10 +505,10 @@ const ka = J.div`
|
|
|
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";
|
|
@@ -546,7 +554,7 @@ const ka = J.div`
|
|
|
546
554
|
margin-left: 12px;
|
|
547
555
|
flex-shrink: 0;
|
|
548
556
|
color: ${(e) => {
|
|
549
|
-
var r, t, s, h, b, p, d, f, N,
|
|
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";
|
|
@@ -557,7 +565,7 @@ const ka = J.div`
|
|
|
557
565
|
case "pending":
|
|
558
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`
|
|
@@ -740,7 +748,7 @@ const Ea = J.div`
|
|
|
740
748
|
}
|
|
741
749
|
`;
|
|
742
750
|
function le(e) {
|
|
743
|
-
return e.label ? /* @__PURE__ */
|
|
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
754
|
(e.helpText || e.description) && /* @__PURE__ */ o(cr, { title: e.helpText || e.description, placement: "top", children: /* @__PURE__ */ o(
|
|
@@ -755,9 +763,9 @@ function le(e) {
|
|
|
755
763
|
function Ja(e = [], r, t = {}, s = "md") {
|
|
756
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
|
-
(V = (
|
|
760
|
-
const a = ((E = (
|
|
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;
|
|
@@ -922,67 +930,67 @@ function Ja(e = [], r, t = {}, s = "md") {
|
|
|
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
|
-
}),
|
|
938
|
+
}), O = me.useRef();
|
|
931
939
|
me.useEffect(() => {
|
|
932
|
-
r && r.formInstance && !
|
|
940
|
+
r && r.formInstance && !O.current && (O.current = r.formInstance);
|
|
933
941
|
}, [r]);
|
|
934
|
-
const l = (a, T,
|
|
942
|
+
const l = (a, T, w) => {
|
|
935
943
|
var V;
|
|
936
|
-
if (
|
|
937
|
-
let
|
|
938
|
-
if (Array.isArray(
|
|
939
|
-
|
|
940
|
-
else if (typeof
|
|
944
|
+
if (M((_) => ({ ..._, [a]: T })), O.current && w) {
|
|
945
|
+
let _ = [];
|
|
946
|
+
if (Array.isArray(w))
|
|
947
|
+
_ = w;
|
|
948
|
+
else if (typeof w == "object") {
|
|
941
949
|
const E = String(T);
|
|
942
|
-
Object.keys(
|
|
943
|
-
j !== E &&
|
|
944
|
-
|
|
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
|
-
j &&
|
|
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 V =
|
|
971
|
+
const V = F[T.name];
|
|
964
972
|
if (Array.isArray(T.controlledItems))
|
|
965
|
-
T.type === "switch" && V === !1 && T.controlledItems.forEach((
|
|
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
981
|
const E = String(V ?? ""), j = new Set((T.controlledItems[E] || []).filter(Boolean));
|
|
974
|
-
|
|
975
|
-
j.has(
|
|
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
|
-
|
|
990
|
+
P(e);
|
|
983
991
|
const te = e.map((a, T) => {
|
|
984
|
-
var
|
|
985
|
-
if (a.name &&
|
|
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 Ja(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,10 +1035,10 @@ function Ja(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, De, ze,
|
|
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
1043
|
label: n.label ? le(n) : void 0,
|
|
1036
1044
|
name: n.name,
|
|
@@ -1041,11 +1049,11 @@ function Ja(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,7 +1061,7 @@ function Ja(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(
|
|
@@ -1061,7 +1069,7 @@ function Ja(e = [], r, t = {}, s = "md") {
|
|
|
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":
|
|
@@ -1070,8 +1078,8 @@ function Ja(e = [], r, t = {}, s = "md") {
|
|
|
1070
1078
|
{
|
|
1071
1079
|
placeholder: n.placeholder,
|
|
1072
1080
|
disabled: n.disabled,
|
|
1073
|
-
className:
|
|
1074
|
-
value:
|
|
1081
|
+
className: ae,
|
|
1082
|
+
value: F[n.name || ""],
|
|
1075
1083
|
onChange: (pe) => l(n.name || "", pe, n.controlledItems),
|
|
1076
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
|
}
|
|
@@ -1086,7 +1094,7 @@ function Ja(e = [], r, t = {}, s = "md") {
|
|
|
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);
|
|
@@ -1096,7 +1104,7 @@ function Ja(e = [], r, t = {}, s = "md") {
|
|
|
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":
|
|
@@ -1105,7 +1113,7 @@ function Ja(e = [], r, t = {}, s = "md") {
|
|
|
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);
|
|
@@ -1115,7 +1123,7 @@ function Ja(e = [], r, t = {}, s = "md") {
|
|
|
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);
|
|
@@ -1137,13 +1145,13 @@ function Ja(e = [], r, t = {}, s = "md") {
|
|
|
1137
1145
|
className: "mb-6",
|
|
1138
1146
|
labelCol: { span: 24 },
|
|
1139
1147
|
wrapperCol: { span: 24 },
|
|
1140
|
-
children: /* @__PURE__ */
|
|
1148
|
+
children: /* @__PURE__ */ L("div", { className: "flex items-center justify-between", children: [
|
|
1141
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:
|
|
1154
|
+
checked: F[n.name || ""],
|
|
1147
1155
|
onChange: (pe) => l(n.name || "", pe, n.controlledItems)
|
|
1148
1156
|
}
|
|
1149
1157
|
) })
|
|
@@ -1152,15 +1160,15 @@ function Ja(e = [], r, t = {}, s = "md") {
|
|
|
1152
1160
|
n.name || `switch-${Math.random()}`
|
|
1153
1161
|
);
|
|
1154
1162
|
case "slider":
|
|
1155
|
-
return /* @__PURE__ */
|
|
1156
|
-
/* @__PURE__ */
|
|
1163
|
+
return /* @__PURE__ */ L("div", { className: "mb-6", children: [
|
|
1164
|
+
/* @__PURE__ */ L("div", { className: "flex items-center justify-between mb-3", children: [
|
|
1157
1165
|
/* @__PURE__ */ o("div", { className: "flex items-center", children: n.label ? le(n) : null }),
|
|
1158
|
-
/* @__PURE__ */
|
|
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: (
|
|
1163
|
-
max: (
|
|
1170
|
+
min: (Ae = n.range) == null ? void 0 : Ae.min,
|
|
1171
|
+
max: (_e = n.range) == null ? void 0 : _e.max,
|
|
1164
1172
|
step: n.step,
|
|
1165
1173
|
disabled: n.disabled,
|
|
1166
1174
|
className: "h-8 w-20"
|
|
@@ -1170,7 +1178,7 @@ function Ja(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
1183
|
min: (Be = n.range) == null ? void 0 : Be.min,
|
|
1176
1184
|
max: (We = n.range) == null ? void 0 : We.max,
|
|
@@ -1196,7 +1204,7 @@ function Ja(e = [], r, t = {}, s = "md") {
|
|
|
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":
|
|
@@ -1205,7 +1213,7 @@ function Ja(e = [], r, t = {}, s = "md") {
|
|
|
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);
|
|
@@ -1216,7 +1224,7 @@ function Ja(e = [], r, t = {}, s = "md") {
|
|
|
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);
|
|
@@ -1227,7 +1235,7 @@ function Ja(e = [], r, t = {}, s = "md") {
|
|
|
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":
|
|
@@ -1237,7 +1245,7 @@ function Ja(e = [], r, t = {}, s = "md") {
|
|
|
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",
|
|
@@ -1251,7 +1259,7 @@ function Ja(e = [], r, t = {}, s = "md") {
|
|
|
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);
|
|
@@ -1261,7 +1269,7 @@ function Ja(e = [], r, t = {}, s = "md") {
|
|
|
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);
|
|
@@ -1272,8 +1280,8 @@ function Ja(e = [], r, t = {}, s = "md") {
|
|
|
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: ((
|
|
1276
|
-
autoUpload: ((
|
|
1283
|
+
maxFiles: ((je = n.uploaderConfig) == null ? void 0 : je.maxFiles) ?? 10,
|
|
1284
|
+
autoUpload: ((Oe = n.uploaderConfig) == null ? void 0 : Oe.autoUpload) ?? !0,
|
|
1277
1285
|
url: (He = n.uploaderConfig) == null ? void 0 : He.url,
|
|
1278
1286
|
headers: ((Ye = n.uploaderConfig) == null ? void 0 : Ye.headers) ?? {},
|
|
1279
1287
|
queryParams: ((Ie = n.uploaderConfig) == null ? void 0 : Ie.queryParams) ?? {},
|
|
@@ -1283,7 +1291,7 @@ function Ja(e = [], r, t = {}, s = "md") {
|
|
|
1283
1291
|
placeholder: (Je = n.uploaderConfig) == null ? void 0 : Je.placeholder,
|
|
1284
1292
|
listName: (Ge = n.uploaderConfig) == null ? void 0 : Ge.listName,
|
|
1285
1293
|
errorMessages: (Ke = n.uploaderConfig) == null ? void 0 : Ke.errorMessages,
|
|
1286
|
-
onRef: (
|
|
1294
|
+
onRef: (Xe = n.uploaderConfig) == null ? void 0 : Xe.onRef,
|
|
1287
1295
|
styles: r,
|
|
1288
1296
|
eventsEmit: (pe, Ce) => {
|
|
1289
1297
|
if (r && typeof r.eventsEmit == "function") {
|
|
@@ -1299,11 +1307,11 @@ function Ja(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 Ja(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()}`
|
|
@@ -1383,9 +1391,9 @@ function Ja(e = [], r, t = {}, s = "md") {
|
|
|
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
|
},
|
|
@@ -1407,7 +1415,7 @@ function Ja(e = [], r, t = {}, s = "md") {
|
|
|
1407
1415
|
{
|
|
1408
1416
|
addonAfter: a.unit ? /* @__PURE__ */ o("span", { className: "text-[10px] text-gray-300", children: a.unit }) : null,
|
|
1409
1417
|
min: (V = a.range) == null ? void 0 : V.min,
|
|
1410
|
-
max: (
|
|
1418
|
+
max: (_ = a.range) == null ? void 0 : _.max,
|
|
1411
1419
|
step: a.step,
|
|
1412
1420
|
placeholder: a.placeholder,
|
|
1413
1421
|
disabled: a.disabled,
|
|
@@ -1419,10 +1427,10 @@ function Ja(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__ */
|
|
1430
|
+
return /* @__PURE__ */ L("div", { className: "mb-6", children: [
|
|
1431
|
+
/* @__PURE__ */ L("div", { className: "flex items-center justify-between mb-3", children: [
|
|
1424
1432
|
/* @__PURE__ */ o("div", { className: "flex items-center", children: a.label ? le(a) : null }),
|
|
1425
|
-
/* @__PURE__ */
|
|
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
|
{
|
|
@@ -1437,10 +1445,10 @@ function Ja(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 Ja(e = [], r, t = {}, s = "md") {
|
|
|
1456
1464
|
className: "mb-6",
|
|
1457
1465
|
labelCol: { span: 24 },
|
|
1458
1466
|
wrapperCol: { span: 24 },
|
|
1459
|
-
children: /* @__PURE__ */
|
|
1467
|
+
children: /* @__PURE__ */ L("div", { className: "flex items-center justify-between", children: [
|
|
1460
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
|
}
|
|
@@ -1759,21 +1767,21 @@ function Ja(e = [], r, t = {}, s = "md") {
|
|
|
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") {
|
|
@@ -1791,7 +1799,7 @@ function Ja(e = [], r, t = {}, s = "md") {
|
|
|
1791
1799
|
) : null;
|
|
1792
1800
|
});
|
|
1793
1801
|
return me.useEffect(() => {
|
|
1794
|
-
r && typeof r.setFormRef == "function" && r.setFormRef(
|
|
1802
|
+
r && typeof r.setFormRef == "function" && r.setFormRef(O);
|
|
1795
1803
|
}, [r]), te;
|
|
1796
1804
|
}
|
|
1797
1805
|
const Ga = `
|
|
@@ -1825,31 +1833,31 @@ const Ga = `
|
|
|
1825
1833
|
formConfig: d,
|
|
1826
1834
|
title: f,
|
|
1827
1835
|
description: N,
|
|
1828
|
-
formWidth:
|
|
1829
|
-
...
|
|
1830
|
-
},
|
|
1831
|
-
var G,
|
|
1832
|
-
const [l] = K.useForm(),
|
|
1836
|
+
formWidth: F,
|
|
1837
|
+
...M
|
|
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: B, mode: "light" },
|
|
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 Ga = `
|
|
|
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 Ga = `
|
|
|
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 Ga = `
|
|
|
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") {
|
|
@@ -1919,15 +1927,15 @@ const Ga = `
|
|
|
1919
1927
|
};
|
|
1920
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
|
-
V((
|
|
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));
|
|
1929
1937
|
}, E = (u) => {
|
|
1930
|
-
const c = [...
|
|
1938
|
+
const c = [...w];
|
|
1931
1939
|
for (; c.length; ) {
|
|
1932
1940
|
const n = c.shift();
|
|
1933
1941
|
if (n) {
|
|
@@ -1938,11 +1946,11 @@ const Ga = `
|
|
|
1938
1946
|
}
|
|
1939
1947
|
}
|
|
1940
1948
|
}, j = Ja(
|
|
1941
|
-
|
|
1949
|
+
w,
|
|
1942
1950
|
{ ...b, eventsEmit: T, formInstance: l },
|
|
1943
1951
|
t,
|
|
1944
1952
|
p
|
|
1945
|
-
),
|
|
1953
|
+
), ee = async () => {
|
|
1946
1954
|
try {
|
|
1947
1955
|
const u = await l.validateFields();
|
|
1948
1956
|
typeof s == "function" ? s("form:submit", {
|
|
@@ -1957,50 +1965,50 @@ const Ga = `
|
|
|
1957
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
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
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
|
|
@@ -2008,44 +2016,44 @@ const Ga = `
|
|
|
2008
2016
|
}
|
|
2009
2017
|
};
|
|
2010
2018
|
return me.useImperativeHandle(
|
|
2011
|
-
|
|
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) =>
|
|
2030
|
+
setFieldProps: (u, c) => _(u, c),
|
|
2023
2031
|
getFieldProps: (u) => E(u)
|
|
2024
2032
|
}),
|
|
2025
|
-
[l,
|
|
2026
|
-
), /* @__PURE__ */
|
|
2033
|
+
[l, re, ee, Z, W]
|
|
2034
|
+
), /* @__PURE__ */ L(na, { children: [
|
|
2027
2035
|
/* @__PURE__ */ o("style", { children: Ga }),
|
|
2028
|
-
/* @__PURE__ */
|
|
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
|
-
(f || N) && /* @__PURE__ */
|
|
2049
|
+
(f || N) && /* @__PURE__ */ L("div", { style: { marginBottom: "24px" }, children: [
|
|
2042
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
2059
|
children: f
|
|
@@ -2056,7 +2064,7 @@ const Ga = `
|
|
|
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,14 +2072,14 @@ const Ga = `
|
|
|
2064
2072
|
}
|
|
2065
2073
|
)
|
|
2066
2074
|
] }),
|
|
2067
|
-
/* @__PURE__ */
|
|
2075
|
+
/* @__PURE__ */ L(
|
|
2068
2076
|
K,
|
|
2069
2077
|
{
|
|
2070
2078
|
form: l,
|
|
2071
2079
|
...r,
|
|
2072
2080
|
initialValues: t,
|
|
2073
2081
|
onValuesChange: a,
|
|
2074
|
-
...
|
|
2082
|
+
...M,
|
|
2075
2083
|
style: {
|
|
2076
2084
|
...r == null ? void 0 : r.style,
|
|
2077
2085
|
width: "100%",
|
|
@@ -2082,13 +2090,13 @@ const Ga = `
|
|
|
2082
2090
|
loading: (r == null ? void 0 : r.loading) === !0 ? !0 : void 0,
|
|
2083
2091
|
children: [
|
|
2084
2092
|
j,
|
|
2085
|
-
((d == null ? void 0 : d.showSubmit) || (d == null ? void 0 : d.showReset)) && /* @__PURE__ */
|
|
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"
|
|
@@ -2097,10 +2105,10 @@ const Ga = `
|
|
|
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
|
}
|
|
@@ -2109,10 +2117,10 @@ const Ga = `
|
|
|
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
|
}
|
|
@@ -2130,12 +2138,12 @@ const Ga = `
|
|
|
2130
2138
|
}
|
|
2131
2139
|
);
|
|
2132
2140
|
me.memo(la);
|
|
2133
|
-
const Hr = !1, Ka = (e, r) => r != null && r.fileType ? e.startsWith("image/") ? r.fileType.image || /* @__PURE__ */ o(ke, { size: 20 }) : e.includes("document") || e.includes("pdf") || e.includes("text") ? r.fileType.document || /* @__PURE__ */ o(ke, { size: 20 }) : e.includes("spreadsheet") || e.includes("excel") || e.includes("csv") ? r.fileType.spreadsheet || /* @__PURE__ */ o(ke, { size: 20 }) : e.includes("zip") || e.includes("rar") || e.includes("7z") ? r.fileType.archive || /* @__PURE__ */ o(ke, { size: 20 }) : e.startsWith("video/") ? r.fileType.video || /* @__PURE__ */ o(ke, { size: 20 }) : e.startsWith("audio/") ? r.fileType.audio || /* @__PURE__ */ o(ke, { size: 20 }) : r.fileType.default || /* @__PURE__ */ o(ke, { size: 20 }) : /* @__PURE__ */ o(ke, { size: 20 }),
|
|
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) => {
|
|
2134
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,7 +2155,7 @@ const Hr = !1, Ka = (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":
|
|
@@ -2165,7 +2173,7 @@ pa`
|
|
|
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,
|
|
@@ -2176,19 +2184,19 @@ const Xa = ({
|
|
|
2176
2184
|
icons: d
|
|
2177
2185
|
}) => {
|
|
2178
2186
|
var f;
|
|
2179
|
-
return /* @__PURE__ */
|
|
2180
|
-
/* @__PURE__ */
|
|
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: [
|
|
2181
2189
|
/* @__PURE__ */ o(La, { $theme: t, children: Ka(e.type, d) }),
|
|
2182
|
-
/* @__PURE__ */
|
|
2183
|
-
/* @__PURE__ */
|
|
2184
|
-
/* @__PURE__ */ o(
|
|
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 }),
|
|
2185
2193
|
/* @__PURE__ */ o(Ha, { $theme: t, children: sa(e.size) })
|
|
2186
2194
|
] }),
|
|
2187
2195
|
e.status === "uploading" && /* @__PURE__ */ o(Ya, { $theme: t, $progress: e.progress }),
|
|
2188
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 =
|
|
2199
|
+
const N = Xa(e.status, t, d);
|
|
2192
2200
|
return N && /* @__PURE__ */ o(Ia, { $theme: t, $status: e.status, children: N });
|
|
2193
2201
|
})(),
|
|
2194
2202
|
Hr,
|
|
@@ -2215,28 +2223,28 @@ const Xa = ({
|
|
|
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
|
-
p(e.id,
|
|
2229
|
+
p(e.id, F.values);
|
|
2222
2230
|
break;
|
|
2223
2231
|
case "form:change":
|
|
2224
|
-
p(e.id,
|
|
2232
|
+
p(e.id, F.values);
|
|
2225
2233
|
break;
|
|
2226
2234
|
case "form:fieldChange":
|
|
2227
|
-
if (
|
|
2228
|
-
const
|
|
2235
|
+
if (F.field && F.value !== void 0) {
|
|
2236
|
+
const M = {
|
|
2229
2237
|
...e.formData,
|
|
2230
|
-
[
|
|
2238
|
+
[F.field]: F.value
|
|
2231
2239
|
};
|
|
2232
|
-
p(e.id,
|
|
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
|
},
|
|
@@ -2266,24 +2274,24 @@ const Xa = ({
|
|
|
2266
2274
|
// 默认查询参数
|
|
2267
2275
|
itemForm: f = [],
|
|
2268
2276
|
styles: N,
|
|
2269
|
-
buttons:
|
|
2277
|
+
buttons: F = [],
|
|
2270
2278
|
// 新增:自定义按钮数组
|
|
2271
|
-
errorMessages:
|
|
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
|
|
2288
|
+
var Y, I;
|
|
2281
2289
|
const te = Fe(), a = $e(
|
|
2282
2290
|
// 基础:默认主题 + useTheme的配置
|
|
2283
2291
|
$e({ theme: B, mode: "light" }, te),
|
|
2284
2292
|
// 最高层:用户手动传入的styles
|
|
2285
2293
|
N
|
|
2286
|
-
), T = Te(null), [
|
|
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,15 +2301,15 @@ const Xa = ({
|
|
|
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
2314
|
$theme: a.theme || B,
|
|
2307
2315
|
style: {
|
|
@@ -2312,32 +2320,32 @@ const Xa = ({
|
|
|
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
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",
|
|
@@ -2348,12 +2356,12 @@ const Xa = ({
|
|
|
2348
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,
|
|
@@ -2363,14 +2371,14 @@ const Xa = ({
|
|
|
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(
|
|
@@ -2406,10 +2414,10 @@ const Xa = ({
|
|
|
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,7 +2427,7 @@ const Xa = ({
|
|
|
2419
2427
|
formData: {},
|
|
2420
2428
|
isExpanded: !1
|
|
2421
2429
|
}));
|
|
2422
|
-
E((n) => [...n, ...c]), h &&
|
|
2430
|
+
E((n) => [...n, ...c]), h && R(c);
|
|
2423
2431
|
},
|
|
2424
2432
|
// 移除指定上传项
|
|
2425
2433
|
removeUploadItem: (i) => {
|
|
@@ -2433,20 +2441,20 @@ const Xa = ({
|
|
|
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,
|
|
2449
|
+
$ && $(y);
|
|
2450
|
+
}, [y, $]);
|
|
2443
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,22 +2465,22 @@ const Xa = ({
|
|
|
2457
2465
|
// 每个item独立的表单数据
|
|
2458
2466
|
isExpanded: !1
|
|
2459
2467
|
}));
|
|
2460
|
-
E((n) => [...n, ...c]), h &&
|
|
2468
|
+
E((n) => [...n, ...c]), h && R(c);
|
|
2461
2469
|
},
|
|
2462
|
-
[h,
|
|
2463
|
-
),
|
|
2470
|
+
[h, _.length, C]
|
|
2471
|
+
), z = he((i) => {
|
|
2464
2472
|
i.preventDefault(), V(!0);
|
|
2465
|
-
}, []),
|
|
2473
|
+
}, []), k = he((i) => {
|
|
2466
2474
|
i.preventDefault(), V(!1);
|
|
2467
|
-
}, []),
|
|
2475
|
+
}, []), q = he(
|
|
2468
2476
|
(i) => {
|
|
2469
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
2486
|
l == null || l("uploader:start", { items: i, data: j() });
|
|
@@ -2482,8 +2490,8 @@ const Xa = ({
|
|
|
2482
2490
|
(m) => m.map((g) => g.id === u.id ? { ...g, status: "uploading" } : g)
|
|
2483
2491
|
);
|
|
2484
2492
|
const c = await za(u.file, b, p, d, (m) => {
|
|
2485
|
-
E((g) => g.map((
|
|
2486
|
-
}), n = Da(u, f),
|
|
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,
|
|
@@ -2492,8 +2500,8 @@ const Xa = ({
|
|
|
2492
2500
|
// 使用自动填充后的表单数据
|
|
2493
2501
|
isExpanded: f.length > 0
|
|
2494
2502
|
// 上传成功后,如果有表单配置则默认展开
|
|
2495
|
-
},
|
|
2496
|
-
E((m) => m.map((g) => g.id === u.id ?
|
|
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,14 +2561,14 @@ const Xa = ({
|
|
|
2553
2561
|
console.log("错误消息解析失败:", g), n = m.message;
|
|
2554
2562
|
}
|
|
2555
2563
|
}
|
|
2556
|
-
n || (n =
|
|
2557
|
-
const
|
|
2558
|
-
E((m) => m.map((g) => g.id === u.id ?
|
|
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, p, d, l,
|
|
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);
|
|
@@ -2572,7 +2580,7 @@ const Xa = ({
|
|
|
2572
2580
|
});
|
|
2573
2581
|
},
|
|
2574
2582
|
[l, j]
|
|
2575
|
-
),
|
|
2583
|
+
), X = he(
|
|
2576
2584
|
(i) => {
|
|
2577
2585
|
E(
|
|
2578
2586
|
(u) => u.map((c) => {
|
|
@@ -2593,24 +2601,24 @@ const Xa = ({
|
|
|
2593
2601
|
);
|
|
2594
2602
|
},
|
|
2595
2603
|
[l, j]
|
|
2596
|
-
),
|
|
2604
|
+
), S = he(
|
|
2597
2605
|
(i, u) => {
|
|
2598
2606
|
console.log("FormData Change:", i, u), E((c) => {
|
|
2599
|
-
const n = c.map((
|
|
2600
|
-
if (
|
|
2601
|
-
const
|
|
2602
|
-
...
|
|
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:
|
|
2616
|
+
formData: D.formData,
|
|
2617
|
+
item: D,
|
|
2610
2618
|
data: j(c)
|
|
2611
|
-
}),
|
|
2619
|
+
}), D;
|
|
2612
2620
|
}
|
|
2613
|
-
return
|
|
2621
|
+
return A;
|
|
2614
2622
|
});
|
|
2615
2623
|
return l == null || l("uploader:dataChange", {
|
|
2616
2624
|
items: n,
|
|
@@ -2622,30 +2630,30 @@ const Xa = ({
|
|
|
2622
2630
|
},
|
|
2623
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
2637
|
$theme: a.theme || B,
|
|
2630
|
-
$isDragOver:
|
|
2631
|
-
onDragOver:
|
|
2632
|
-
onDragLeave:
|
|
2633
|
-
onDrop:
|
|
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
|
-
|
|
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: [
|
|
2641
2649
|
/* @__PURE__ */ o(Ba, { $theme: a.theme || B, children: "拖拽文件到此处或点击选择文件" }),
|
|
2642
|
-
/* @__PURE__ */
|
|
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
|
]
|
|
@@ -2663,19 +2671,19 @@ const Xa = ({
|
|
|
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:
|
|
2686
|
+
}, children: F.map((i, u) => /* @__PURE__ */ o(
|
|
2679
2687
|
er,
|
|
2680
2688
|
{
|
|
2681
2689
|
mode: i.mode || "default",
|
|
@@ -2688,17 +2696,17 @@ const Xa = ({
|
|
|
2688
2696
|
u
|
|
2689
2697
|
)) })
|
|
2690
2698
|
] }),
|
|
2691
|
-
/* @__PURE__ */ o(Ra, { $theme: a.theme || B, children:
|
|
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
2704
|
itemForm: f,
|
|
2697
|
-
onRemove:
|
|
2698
|
-
onToggleExpand:
|
|
2699
|
-
onFormDataChange:
|
|
2705
|
+
onRemove: Q,
|
|
2706
|
+
onToggleExpand: X,
|
|
2707
|
+
onFormDataChange: S,
|
|
2700
2708
|
theme: a.theme || B,
|
|
2701
|
-
icons:
|
|
2709
|
+
icons: O
|
|
2702
2710
|
},
|
|
2703
2711
|
i.id
|
|
2704
2712
|
)) })
|
|
@@ -2710,7 +2718,7 @@ const Xa = ({
|
|
|
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;
|
|
@@ -2745,7 +2753,7 @@ const Xa = ({
|
|
|
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];
|
|
@@ -2787,256 +2795,256 @@ function da() {
|
|
|
2787
2795
|
(function(t, s) {
|
|
2788
2796
|
e.exports = s();
|
|
2789
2797
|
})(Za, (function() {
|
|
2790
|
-
var t = 1e3, s = 6e4, h = 36e5, b = "millisecond", p = "second", d = "minute", f = "hour", N = "day",
|
|
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
|
|
2807
|
-
}, u: function(
|
|
2808
|
-
return
|
|
2809
|
-
} }, V = "en",
|
|
2810
|
-
|
|
2811
|
-
var E = "$isDayjsObject", j = function(
|
|
2812
|
-
return
|
|
2813
|
-
},
|
|
2814
|
-
var
|
|
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;
|
|
2815
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 (j(
|
|
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
|
|
2884
|
-
case C:
|
|
2885
|
-
return L ? Z(1, H) : Z(0, H + 1);
|
|
2891
|
+
return q ? Q(1, 0) : Q(31, 11);
|
|
2886
2892
|
case M:
|
|
2887
|
-
|
|
2888
|
-
|
|
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
|
|
2898
|
+
case $:
|
|
2899
|
+
return X(i + "Hours", 0);
|
|
2892
2900
|
case f:
|
|
2893
|
-
return
|
|
2901
|
+
return X(i + "Minutes", 1);
|
|
2894
2902
|
case d:
|
|
2895
|
-
return
|
|
2903
|
+
return X(i + "Seconds", 2);
|
|
2896
2904
|
case p:
|
|
2897
|
-
return
|
|
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
|
-
case
|
|
3006
|
-
|
|
3013
|
+
case M:
|
|
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
3025
|
case f:
|
|
3018
|
-
|
|
3026
|
+
q = Y / h;
|
|
3019
3027
|
break;
|
|
3020
3028
|
case d:
|
|
3021
|
-
|
|
3029
|
+
q = Y / s;
|
|
3022
3030
|
break;
|
|
3023
3031
|
case p:
|
|
3024
|
-
|
|
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
|
-
return this.endOf(
|
|
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,17 +3053,17 @@ function da() {
|
|
|
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
|
}
|
|
@@ -3070,28 +3078,28 @@ function rt() {
|
|
|
3070
3078
|
return function(t, s, h) {
|
|
3071
3079
|
t = t || {};
|
|
3072
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" };
|
|
3073
|
-
function d(N,
|
|
3074
|
-
return b.fromToBase(N,
|
|
3081
|
+
function d(N, F, M, O) {
|
|
3082
|
+
return b.fromToBase(N, F, M, O);
|
|
3075
3083
|
}
|
|
3076
|
-
h.en.relativeTime = p, b.fromToBase = function(N,
|
|
3077
|
-
for (var
|
|
3078
|
-
var V = a[
|
|
3079
|
-
V.d && (
|
|
3080
|
-
var
|
|
3081
|
-
if (
|
|
3082
|
-
|
|
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]);
|
|
3083
3091
|
var E = te[V.l];
|
|
3084
|
-
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 j =
|
|
3090
|
-
return typeof j == "function" ? j(
|
|
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
3104
|
var f = function(N) {
|
|
3097
3105
|
return N.$u ? h.utc() : h();
|
|
@@ -3176,35 +3184,35 @@ function it(e, r, t = {}) {
|
|
|
3176
3184
|
render: (b, p, d) => {
|
|
3177
3185
|
var te, a;
|
|
3178
3186
|
const f = d == null ? void 0 : d.value;
|
|
3179
|
-
let
|
|
3180
|
-
if (typeof
|
|
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
|
|
3183
|
-
let
|
|
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 $ = {};
|
|
3184
3192
|
if (f && typeof f == "object") {
|
|
3185
3193
|
const T = /* @__PURE__ */ new Set(["component", "Comp", "props"]);
|
|
3186
|
-
Object.keys(f).forEach((
|
|
3187
|
-
T.has(
|
|
3194
|
+
Object.keys(f).forEach((w) => {
|
|
3195
|
+
T.has(w) || ($[w] = f[w]);
|
|
3188
3196
|
});
|
|
3189
3197
|
}
|
|
3190
|
-
const
|
|
3191
|
-
value:
|
|
3198
|
+
const P = {
|
|
3199
|
+
value: M,
|
|
3192
3200
|
row: p,
|
|
3193
3201
|
cell: d,
|
|
3194
3202
|
col: h,
|
|
3195
|
-
emit: (T,
|
|
3203
|
+
emit: (T, w) => {
|
|
3196
3204
|
var V;
|
|
3197
|
-
return (V = r == null ? void 0 : r.eventsEmit) == null ? void 0 : V.call(r, T, { row: p, cell: d, col: h, data:
|
|
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 (me.isValidElement(
|
|
3204
|
-
return me.cloneElement(
|
|
3205
|
-
if (typeof
|
|
3206
|
-
const T =
|
|
3207
|
-
return me.createElement(T,
|
|
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
|
}
|
|
@@ -3264,15 +3272,15 @@ function it(e, r, t = {}) {
|
|
|
3264
3272
|
return {
|
|
3265
3273
|
...h,
|
|
3266
3274
|
render: (b) => {
|
|
3267
|
-
const p = h.maxRow || 1, d = h.maxWidth || 240, f = h.areaStyle || "default", N = 13,
|
|
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
3280
|
color: f === "code" ? "#d4d4d4" : "#666",
|
|
3273
3281
|
opacity: f === "code" ? 1 : 0.85,
|
|
3274
3282
|
fontSize: N,
|
|
3275
|
-
lineHeight:
|
|
3283
|
+
lineHeight: F,
|
|
3276
3284
|
padding: "6px 10px",
|
|
3277
3285
|
background: f === "code" ? "#1e1e1e" : "#f6f8fa",
|
|
3278
3286
|
borderRadius: 6,
|
|
@@ -3330,16 +3338,16 @@ function it(e, r, t = {}) {
|
|
|
3330
3338
|
render: (b, p, d) => {
|
|
3331
3339
|
const f = r != null && r.isPending ? r.isPending(p.id) : !1;
|
|
3332
3340
|
if (Array.isArray(b)) {
|
|
3333
|
-
const
|
|
3334
|
-
value:
|
|
3335
|
-
label:
|
|
3336
|
-
icon:
|
|
3337
|
-
disabled:
|
|
3338
|
-
key:
|
|
3339
|
-
} :
|
|
3340
|
-
if (
|
|
3341
|
-
const
|
|
3342
|
-
return /* @__PURE__ */
|
|
3341
|
+
const F = b.map((M) => M && typeof M == "object" && (M.columnId === "actions" || M.type === "action") && "value" in M && !("mode" in M) ? {
|
|
3342
|
+
value: M.value,
|
|
3343
|
+
label: M.label || M.value,
|
|
3344
|
+
icon: M.icon,
|
|
3345
|
+
disabled: M.disabled,
|
|
3346
|
+
key: M.key
|
|
3347
|
+
} : M);
|
|
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,7 +3357,7 @@ function it(e, r, t = {}) {
|
|
|
3349
3357
|
alignItems: "center"
|
|
3350
3358
|
},
|
|
3351
3359
|
children: [
|
|
3352
|
-
|
|
3360
|
+
M.map((l, $) => /* @__PURE__ */ o(
|
|
3353
3361
|
er,
|
|
3354
3362
|
{
|
|
3355
3363
|
mode: l.mode || "text",
|
|
@@ -3360,20 +3368,20 @@ function it(e, r, t = {}) {
|
|
|
3360
3368
|
style: { padding: "0 8px", minWidth: 0 },
|
|
3361
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
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,18 +3389,18 @@ function it(e, r, t = {}) {
|
|
|
3381
3389
|
}
|
|
3382
3390
|
);
|
|
3383
3391
|
} else
|
|
3384
|
-
return /* @__PURE__ */ o("div", { style: { display: "flex", gap: 4, justifyContent: "center" }, children:
|
|
3392
|
+
return /* @__PURE__ */ o("div", { style: { display: "flex", gap: 4, justifyContent: "center" }, children: F.map((M, O) => /* @__PURE__ */ o(
|
|
3385
3393
|
er,
|
|
3386
3394
|
{
|
|
3387
|
-
mode:
|
|
3388
|
-
label:
|
|
3389
|
-
icon:
|
|
3390
|
-
disabled:
|
|
3395
|
+
mode: M.mode || "text",
|
|
3396
|
+
label: M.label || M.value || "",
|
|
3397
|
+
icon: M.icon,
|
|
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_${
|
|
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 || {};
|
|
@@ -3424,11 +3432,11 @@ function it(e, r, t = {}) {
|
|
|
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",
|
|
@@ -3476,7 +3484,7 @@ function it(e, r, t = {}) {
|
|
|
3476
3484
|
);
|
|
3477
3485
|
}
|
|
3478
3486
|
function dt(e) {
|
|
3479
|
-
return /* @__PURE__ */
|
|
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
3489
|
e.helpText && /* @__PURE__ */ o(cr, { title: e.helpText, placement: "top", children: /* @__PURE__ */ o(
|
|
3482
3490
|
oa,
|
|
@@ -3635,21 +3643,21 @@ if (typeof window < "u" && !document.getElementById("dynamic-table-sticky-shadow
|
|
|
3635
3643
|
e.id = "dynamic-table-sticky-shadow", e.innerHTML = mt, document.head.appendChild(e);
|
|
3636
3644
|
}
|
|
3637
3645
|
const bt = me.memo((e) => {
|
|
3638
|
-
var
|
|
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;
|
|
3639
3647
|
const r = e.dataSource || [], t = e.columns || [], s = e.size || "md", h = e.level || 0, b = Fe(), p = $e(
|
|
3640
3648
|
// 基础:默认主题 + useTheme的配置
|
|
3641
3649
|
$e({ theme: B, mode: "light" }, b),
|
|
3642
3650
|
// 最高层:用户手动传入的styles
|
|
3643
3651
|
e.styles
|
|
3644
|
-
), 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($);
|
|
3645
3653
|
we(() => {
|
|
3646
|
-
typeof
|
|
3647
|
-
}, [
|
|
3654
|
+
typeof $ == "number" && $ > 0 && P($);
|
|
3655
|
+
}, [$]);
|
|
3648
3656
|
const [te, a] = ie(/* @__PURE__ */ new Set());
|
|
3649
3657
|
we(() => {
|
|
3650
3658
|
a(/* @__PURE__ */ new Set());
|
|
3651
|
-
}, [
|
|
3652
|
-
const [T,
|
|
3659
|
+
}, [M]);
|
|
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(
|
|
3653
3661
|
t,
|
|
3654
3662
|
{
|
|
3655
3663
|
eventsEmit: e.eventsEmit,
|
|
@@ -3657,59 +3665,59 @@ const bt = me.memo((e) => {
|
|
|
3657
3665
|
customizeComponents: e.customizeComponents
|
|
3658
3666
|
},
|
|
3659
3667
|
e.styles
|
|
3660
|
-
), [y, x] = ie([]),
|
|
3661
|
-
(
|
|
3668
|
+
), [y, x] = ie([]), z = he(
|
|
3669
|
+
(v, ne) => {
|
|
3662
3670
|
var de;
|
|
3663
3671
|
x((ce) => {
|
|
3664
3672
|
let be;
|
|
3665
|
-
return ne ? be = [...ce,
|
|
3673
|
+
return ne ? be = [...ce, v] : be = ce.filter((Ne) => Ne !== v), be;
|
|
3666
3674
|
});
|
|
3667
|
-
const se = ne ? [...y,
|
|
3675
|
+
const se = ne ? [...y, v] : y.filter((ce) => ce !== v), oe = r.filter((ce) => se.includes(ce.id));
|
|
3668
3676
|
(de = e.eventsEmit) == null || de.call(e, "table_row_select", {
|
|
3669
|
-
rowId:
|
|
3677
|
+
rowId: v,
|
|
3670
3678
|
checked: ne,
|
|
3671
3679
|
selectedItems: oe
|
|
3672
3680
|
});
|
|
3673
3681
|
},
|
|
3674
3682
|
[y, r, e.eventsEmit]
|
|
3675
|
-
),
|
|
3683
|
+
), k = Se(
|
|
3676
3684
|
() => r.length > 0 && y.length === r.length,
|
|
3677
3685
|
[r.length, y.length]
|
|
3678
|
-
),
|
|
3679
|
-
(
|
|
3686
|
+
), q = he(
|
|
3687
|
+
(v) => {
|
|
3680
3688
|
var oe;
|
|
3681
|
-
const ne =
|
|
3689
|
+
const ne = v ? r.map((de) => de.id) : [];
|
|
3682
3690
|
x(ne);
|
|
3683
|
-
const se =
|
|
3691
|
+
const se = v ? r : [];
|
|
3684
3692
|
(oe = e.eventsEmit) == null || oe.call(e, "table_select_all", {
|
|
3685
|
-
checked:
|
|
3693
|
+
checked: v,
|
|
3686
3694
|
selectedItems: se,
|
|
3687
3695
|
totalCount: r.length
|
|
3688
3696
|
});
|
|
3689
3697
|
},
|
|
3690
3698
|
[r, e.eventsEmit]
|
|
3691
|
-
), [
|
|
3699
|
+
), [R, Q] = ie(1), X = typeof H == "number" && H > 0 ? H : $ ?? (e.isSubTable ? 5 : 10), S = O || r.length;
|
|
3692
3700
|
Se(
|
|
3693
|
-
() => Math.ceil(
|
|
3694
|
-
[
|
|
3701
|
+
() => Math.ceil(S / X),
|
|
3702
|
+
[S, X]
|
|
3695
3703
|
);
|
|
3696
|
-
const
|
|
3704
|
+
const Y = Se(() => {
|
|
3697
3705
|
if (e.viewBehavior !== "pagination") return r;
|
|
3698
|
-
const
|
|
3706
|
+
const v = (R - 1) * X, ne = v + X;
|
|
3699
3707
|
if (r.some((oe) => typeof oe.__absIndex == "number")) {
|
|
3700
3708
|
const oe = [];
|
|
3701
|
-
for (let de =
|
|
3709
|
+
for (let de = v; de < ne; de++) {
|
|
3702
3710
|
const ce = r.find((be) => be.__absIndex === de);
|
|
3703
3711
|
ce && oe.push(ce);
|
|
3704
3712
|
}
|
|
3705
3713
|
return oe;
|
|
3706
3714
|
}
|
|
3707
|
-
return r.slice(
|
|
3708
|
-
}, [e.viewBehavior, r,
|
|
3709
|
-
(
|
|
3715
|
+
return r.slice(v, ne);
|
|
3716
|
+
}, [e.viewBehavior, r, R, X]), I = he(
|
|
3717
|
+
(v) => {
|
|
3710
3718
|
var ne;
|
|
3711
|
-
if (
|
|
3712
|
-
const se = (
|
|
3719
|
+
if (Q(v), O && l && M) {
|
|
3720
|
+
const se = (v - 1) * X, oe = Math.floor(se / l) + 1;
|
|
3713
3721
|
(!te.has(oe) || se >= r.length) && (a((ce) => {
|
|
3714
3722
|
const be = new Set(ce);
|
|
3715
3723
|
return be.add(oe), be;
|
|
@@ -3717,7 +3725,7 @@ const bt = me.memo((e) => {
|
|
|
3717
3725
|
e,
|
|
3718
3726
|
"pagination:request_merge_data",
|
|
3719
3727
|
{
|
|
3720
|
-
viewId:
|
|
3728
|
+
viewId: M,
|
|
3721
3729
|
request: {
|
|
3722
3730
|
pageNo: oe,
|
|
3723
3731
|
pageSize: l
|
|
@@ -3727,47 +3735,47 @@ const bt = me.memo((e) => {
|
|
|
3727
3735
|
));
|
|
3728
3736
|
}
|
|
3729
3737
|
},
|
|
3730
|
-
[
|
|
3731
|
-
), i = he((
|
|
3738
|
+
[O, l, M, X, r.length, e.eventsEmit, te]
|
|
3739
|
+
), i = he((v) => {
|
|
3732
3740
|
j((ne) => {
|
|
3733
3741
|
const se = new Set(ne);
|
|
3734
|
-
return se.has(
|
|
3742
|
+
return se.has(v) ? se.delete(v) : (se.add(v), setTimeout(() => {
|
|
3735
3743
|
var oe, de;
|
|
3736
3744
|
(de = e.eventsEmit) == null || de.call(e, "table_expand", {
|
|
3737
|
-
tableId:
|
|
3738
|
-
children: ((oe = r.find((ce) => ce.id ===
|
|
3745
|
+
tableId: v,
|
|
3746
|
+
children: ((oe = r.find((ce) => ce.id === v)) == null ? void 0 : oe.children) || []
|
|
3739
3747
|
});
|
|
3740
3748
|
}, 0)), se;
|
|
3741
3749
|
});
|
|
3742
|
-
}, [r, e.eventsEmit]), u = he((
|
|
3743
|
-
(
|
|
3750
|
+
}, [r, e.eventsEmit]), u = he((v) => v.hasOwnProperty("children") && v.children !== void 0, []), c = he(
|
|
3751
|
+
(v) => E.has(v),
|
|
3744
3752
|
[E]
|
|
3745
3753
|
), n = he(() => {
|
|
3746
|
-
const
|
|
3747
|
-
|
|
3754
|
+
const v = ee.current;
|
|
3755
|
+
v && (e.isSubTable || (w(v.scrollLeft > 0), _(v.scrollLeft < v.scrollWidth - v.offsetWidth - 1)));
|
|
3748
3756
|
}, [e.isSubTable]);
|
|
3749
3757
|
we(() => {
|
|
3750
|
-
const
|
|
3751
|
-
if (
|
|
3752
|
-
return n(),
|
|
3753
|
-
|
|
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);
|
|
3754
3762
|
};
|
|
3755
3763
|
}, [n]), we(() => {
|
|
3756
|
-
const
|
|
3757
|
-
if (
|
|
3764
|
+
const v = ee.current;
|
|
3765
|
+
if (!v) return;
|
|
3758
3766
|
const ne = () => {
|
|
3759
|
-
const oe =
|
|
3760
|
-
|
|
3767
|
+
const oe = v.getBoundingClientRect();
|
|
3768
|
+
re(oe.width);
|
|
3761
3769
|
};
|
|
3762
3770
|
ne(), window.addEventListener("resize", ne);
|
|
3763
3771
|
const se = new ResizeObserver(ne);
|
|
3764
|
-
return se.observe(
|
|
3772
|
+
return se.observe(v), () => {
|
|
3765
3773
|
window.removeEventListener("resize", ne), se.disconnect();
|
|
3766
3774
|
};
|
|
3767
3775
|
}, []);
|
|
3768
|
-
const
|
|
3769
|
-
return /* @__PURE__ */
|
|
3770
|
-
|
|
3776
|
+
const A = e.isSubTable ? ut : ct;
|
|
3777
|
+
return /* @__PURE__ */ L(
|
|
3778
|
+
A,
|
|
3771
3779
|
{
|
|
3772
3780
|
theme: p.theme || B,
|
|
3773
3781
|
className: "w-full",
|
|
@@ -3810,7 +3818,7 @@ const bt = me.memo((e) => {
|
|
|
3810
3818
|
/* @__PURE__ */ o(
|
|
3811
3819
|
"div",
|
|
3812
3820
|
{
|
|
3813
|
-
ref:
|
|
3821
|
+
ref: ee,
|
|
3814
3822
|
style: {
|
|
3815
3823
|
width: (e.isSubTable, "100%"),
|
|
3816
3824
|
maxWidth: (e.isSubTable, "100%"),
|
|
@@ -3822,10 +3830,10 @@ const bt = me.memo((e) => {
|
|
|
3822
3830
|
position: "relative",
|
|
3823
3831
|
boxSizing: "border-box"
|
|
3824
3832
|
},
|
|
3825
|
-
children: /* @__PURE__ */
|
|
3833
|
+
children: /* @__PURE__ */ L(
|
|
3826
3834
|
"table",
|
|
3827
3835
|
{
|
|
3828
|
-
ref:
|
|
3836
|
+
ref: Z,
|
|
3829
3837
|
className: "border-collapse",
|
|
3830
3838
|
style: {
|
|
3831
3839
|
minWidth: "max-content",
|
|
@@ -3840,9 +3848,9 @@ const bt = me.memo((e) => {
|
|
|
3840
3848
|
position: e.isSubTable ? void 0 : "sticky",
|
|
3841
3849
|
top: 0,
|
|
3842
3850
|
zIndex: 3,
|
|
3843
|
-
background: ((g = (m = p.theme) == null ? void 0 : m.colors) == null ? void 0 : g.tableHeaderBg) || ((ye = (
|
|
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
|
|
3844
3852
|
},
|
|
3845
|
-
children: /* @__PURE__ */
|
|
3853
|
+
children: /* @__PURE__ */ L("tr", { children: [
|
|
3846
3854
|
e.allowMultiSelect && /* @__PURE__ */ o(
|
|
3847
3855
|
Gr,
|
|
3848
3856
|
{
|
|
@@ -3851,7 +3859,7 @@ const bt = me.memo((e) => {
|
|
|
3851
3859
|
position: "sticky",
|
|
3852
3860
|
left: 0,
|
|
3853
3861
|
zIndex: 3,
|
|
3854
|
-
background: ((ze = (De = p.theme) == null ? void 0 : De.colors) == null ? void 0 : ze.tableHeaderBg) || ((
|
|
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,
|
|
3855
3863
|
width: 40,
|
|
3856
3864
|
minWidth: 40,
|
|
3857
3865
|
maxWidth: 40,
|
|
@@ -3862,15 +3870,15 @@ const bt = me.memo((e) => {
|
|
|
3862
3870
|
"input",
|
|
3863
3871
|
{
|
|
3864
3872
|
type: "checkbox",
|
|
3865
|
-
checked:
|
|
3866
|
-
onChange: (
|
|
3873
|
+
checked: k,
|
|
3874
|
+
onChange: (v) => q(v.target.checked)
|
|
3867
3875
|
}
|
|
3868
3876
|
)
|
|
3869
3877
|
}
|
|
3870
3878
|
),
|
|
3871
|
-
|
|
3872
|
-
var be, Ne,
|
|
3873
|
-
const se = ne === 0, oe = ne ===
|
|
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 ? {
|
|
3874
3882
|
position: "sticky",
|
|
3875
3883
|
left: e.allowMultiSelect ? 40 : 0,
|
|
3876
3884
|
zIndex: 2,
|
|
@@ -3886,46 +3894,46 @@ const bt = me.memo((e) => {
|
|
|
3886
3894
|
{
|
|
3887
3895
|
theme: p.theme || B,
|
|
3888
3896
|
style: {
|
|
3889
|
-
...Jr(
|
|
3897
|
+
...Jr(v.type),
|
|
3890
3898
|
...ce,
|
|
3891
|
-
|
|
3892
|
-
maxWidth: typeof
|
|
3899
|
+
...v.maxWidth !== void 0 ? {
|
|
3900
|
+
maxWidth: typeof v.maxWidth == "number" ? `${v.maxWidth}px` : v.maxWidth
|
|
3893
3901
|
} : {}
|
|
3894
3902
|
},
|
|
3895
3903
|
className: se && T ? "sticky-shadow-left" : oe && V ? "sticky-shadow-right" : "",
|
|
3896
|
-
children: dt(
|
|
3904
|
+
children: dt(v)
|
|
3897
3905
|
},
|
|
3898
|
-
|
|
3906
|
+
v.id
|
|
3899
3907
|
);
|
|
3900
3908
|
})
|
|
3901
3909
|
] })
|
|
3902
3910
|
}
|
|
3903
3911
|
),
|
|
3904
|
-
/* @__PURE__ */ o("tbody", { children:
|
|
3905
|
-
var ce, be, Ne,
|
|
3906
|
-
const se = e.rowProps ? e.rowProps(
|
|
3907
|
-
return /* @__PURE__ */
|
|
3908
|
-
/* @__PURE__ */
|
|
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(
|
|
3909
3917
|
ft,
|
|
3910
3918
|
{
|
|
3911
3919
|
theme: p.theme || B,
|
|
3912
3920
|
...se,
|
|
3913
|
-
className: `${se.className || ""} ${(ce = e.addingIds) != null && ce.includes(
|
|
3921
|
+
className: `${se.className || ""} ${(ce = e.addingIds) != null && ce.includes(v.id) ? "adding-row" : ""} ${v.removing ? "removing-row" : ""}`,
|
|
3914
3922
|
style: {
|
|
3915
3923
|
...se.style,
|
|
3916
|
-
|
|
3924
|
+
...v.removing ? {
|
|
3917
3925
|
opacity: 0,
|
|
3918
3926
|
transform: "translateX(100px)",
|
|
3919
3927
|
transition: "opacity 0.3s ease, transform 0.3s ease"
|
|
3920
3928
|
} : {}
|
|
3921
3929
|
},
|
|
3922
|
-
onAnimationEnd: (
|
|
3930
|
+
onAnimationEnd: (U) => {
|
|
3923
3931
|
var ue, ge;
|
|
3924
|
-
|
|
3932
|
+
U.animationName === "row-slide-in" && ((ue = e.addingIds) != null && ue.includes(v.id)) && ((ge = e.onRowAddAnimationComplete) == null || ge.call(e, v.id));
|
|
3925
3933
|
},
|
|
3926
|
-
onTransitionEnd: (
|
|
3934
|
+
onTransitionEnd: (U) => {
|
|
3927
3935
|
var ue;
|
|
3928
|
-
|
|
3936
|
+
v.removing && U.propertyName === "transform" && ((ue = e.onRowAnimationComplete) == null || ue.call(e, v.id));
|
|
3929
3937
|
},
|
|
3930
3938
|
children: [
|
|
3931
3939
|
e.allowMultiSelect && /* @__PURE__ */ o(
|
|
@@ -3947,15 +3955,15 @@ const bt = me.memo((e) => {
|
|
|
3947
3955
|
"input",
|
|
3948
3956
|
{
|
|
3949
3957
|
type: "checkbox",
|
|
3950
|
-
checked: y.includes(
|
|
3951
|
-
onChange: (
|
|
3958
|
+
checked: y.includes(v.id),
|
|
3959
|
+
onChange: (U) => z(v.id, U.target.checked)
|
|
3952
3960
|
}
|
|
3953
3961
|
)
|
|
3954
3962
|
}
|
|
3955
3963
|
),
|
|
3956
|
-
|
|
3964
|
+
C.map((U, ue) => {
|
|
3957
3965
|
var Fr;
|
|
3958
|
-
const ge = ue === 0, Qe = ue ===
|
|
3966
|
+
const ge = ue === 0, Qe = ue === C.length - 1, Me = ge ? N : Qe ? F : f, ca = ge ? {
|
|
3959
3967
|
position: "sticky",
|
|
3960
3968
|
left: e.allowMultiSelect ? 40 : 0,
|
|
3961
3969
|
zIndex: 1,
|
|
@@ -3965,21 +3973,21 @@ const bt = me.memo((e) => {
|
|
|
3965
3973
|
right: 0,
|
|
3966
3974
|
zIndex: 1,
|
|
3967
3975
|
background: Me
|
|
3968
|
-
} : {}, xe = ((Fr =
|
|
3976
|
+
} : {}, xe = ((Fr = v.data) == null ? void 0 : Fr.filter((ar) => ar.columnId === U.id)) || [], ua = Object.assign(
|
|
3969
3977
|
{},
|
|
3970
|
-
Jr(
|
|
3978
|
+
Jr(U.type),
|
|
3971
3979
|
ca,
|
|
3972
|
-
|
|
3973
|
-
maxWidth: typeof
|
|
3980
|
+
U.maxWidth !== void 0 ? {
|
|
3981
|
+
maxWidth: typeof U.maxWidth == "number" ? `${U.maxWidth}px` : U.maxWidth
|
|
3974
3982
|
} : {},
|
|
3975
3983
|
{ background: Me }
|
|
3976
3984
|
), ha = () => {
|
|
3977
3985
|
var ar, Dr;
|
|
3978
|
-
return ge && oe ? /* @__PURE__ */
|
|
3986
|
+
return ge && oe ? /* @__PURE__ */ L("div", { style: { display: "flex", alignItems: "center", gap: 8 }, children: [
|
|
3979
3987
|
/* @__PURE__ */ o(
|
|
3980
3988
|
"button",
|
|
3981
3989
|
{
|
|
3982
|
-
onClick: () => i(
|
|
3990
|
+
onClick: () => i(v.id),
|
|
3983
3991
|
style: {
|
|
3984
3992
|
background: "none",
|
|
3985
3993
|
border: "none",
|
|
@@ -3993,11 +4001,11 @@ const bt = me.memo((e) => {
|
|
|
3993
4001
|
children: de ? /* @__PURE__ */ o(ba, { size: 16 }) : /* @__PURE__ */ o(ga, { size: 16 })
|
|
3994
4002
|
}
|
|
3995
4003
|
),
|
|
3996
|
-
/* @__PURE__ */
|
|
4004
|
+
/* @__PURE__ */ L("span", { style: { paddingLeft: h * 16 }, children: [
|
|
3997
4005
|
" ",
|
|
3998
|
-
xe.length > 0 ?
|
|
4006
|
+
xe.length > 0 ? U.type === "action" ? U.render ? U.render(
|
|
3999
4007
|
xe.length > 1 ? xe.map((ve) => ve) : xe[0],
|
|
4000
|
-
|
|
4008
|
+
v,
|
|
4001
4009
|
xe.length > 1 ? void 0 : xe[0]
|
|
4002
4010
|
) : null : xe.map((ve, dr) => /* @__PURE__ */ o(
|
|
4003
4011
|
"span",
|
|
@@ -4005,21 +4013,21 @@ const bt = me.memo((e) => {
|
|
|
4005
4013
|
style: {
|
|
4006
4014
|
marginRight: 4,
|
|
4007
4015
|
display: "inline-block",
|
|
4008
|
-
maxWidth:
|
|
4016
|
+
maxWidth: U.maxWidth ? typeof U.maxWidth == "number" ? `${U.maxWidth}px` : U.maxWidth : void 0,
|
|
4009
4017
|
overflow: "hidden",
|
|
4010
4018
|
textOverflow: "ellipsis",
|
|
4011
4019
|
verticalAlign: "middle"
|
|
4012
4020
|
},
|
|
4013
|
-
children:
|
|
4021
|
+
children: U.render ? U.render(ve.value, v, ve) : /* @__PURE__ */ o("span", { children: ve.value })
|
|
4014
4022
|
},
|
|
4015
4023
|
dr
|
|
4016
4024
|
)) : null
|
|
4017
4025
|
] })
|
|
4018
|
-
] }) : /* @__PURE__ */
|
|
4026
|
+
] }) : /* @__PURE__ */ L("span", { style: { paddingLeft: h * 16 }, children: [
|
|
4019
4027
|
" ",
|
|
4020
|
-
xe.length > 0 ?
|
|
4028
|
+
xe.length > 0 ? U.type === "action" ? U.render ? U.render(
|
|
4021
4029
|
xe.length > 1 ? xe.map((ve) => ve) : xe[0],
|
|
4022
|
-
|
|
4030
|
+
v,
|
|
4023
4031
|
xe.length > 1 ? void 0 : xe[0]
|
|
4024
4032
|
) : null : xe.map((ve, dr) => /* @__PURE__ */ o(
|
|
4025
4033
|
"span",
|
|
@@ -4027,12 +4035,12 @@ const bt = me.memo((e) => {
|
|
|
4027
4035
|
style: {
|
|
4028
4036
|
marginRight: 4,
|
|
4029
4037
|
display: "inline-block",
|
|
4030
|
-
maxWidth:
|
|
4038
|
+
maxWidth: U.maxWidth ? typeof U.maxWidth == "number" ? `${U.maxWidth}px` : U.maxWidth : void 0,
|
|
4031
4039
|
overflow: "hidden",
|
|
4032
4040
|
textOverflow: "ellipsis",
|
|
4033
4041
|
verticalAlign: "middle"
|
|
4034
4042
|
},
|
|
4035
|
-
children:
|
|
4043
|
+
children: U.render ? U.render(ve.value, v, ve) : /* @__PURE__ */ o("span", { children: ve.value })
|
|
4036
4044
|
},
|
|
4037
4045
|
dr
|
|
4038
4046
|
)) : null
|
|
@@ -4046,28 +4054,28 @@ const bt = me.memo((e) => {
|
|
|
4046
4054
|
className: ge && T ? "sticky-shadow-left" : Qe && V ? "sticky-shadow-right" : "",
|
|
4047
4055
|
children: ha()
|
|
4048
4056
|
},
|
|
4049
|
-
|
|
4057
|
+
U.id
|
|
4050
4058
|
);
|
|
4051
4059
|
})
|
|
4052
4060
|
]
|
|
4053
4061
|
}
|
|
4054
4062
|
),
|
|
4055
|
-
oe && de &&
|
|
4063
|
+
oe && de && v.children !== void 0 && /* @__PURE__ */ o(
|
|
4056
4064
|
"tr",
|
|
4057
4065
|
{
|
|
4058
4066
|
className: "dynamic-table-sub-row relative",
|
|
4059
4067
|
style: {
|
|
4060
|
-
width:
|
|
4068
|
+
width: W > 0 ? `${W}px` : "100%"
|
|
4061
4069
|
},
|
|
4062
4070
|
children: /* @__PURE__ */ o(
|
|
4063
4071
|
"td",
|
|
4064
4072
|
{
|
|
4065
4073
|
className: "dynamic-table-sub-cell",
|
|
4066
4074
|
style: {
|
|
4067
|
-
width:
|
|
4075
|
+
width: W > 0 ? `${W}px` : "100%"
|
|
4068
4076
|
},
|
|
4069
|
-
colSpan:
|
|
4070
|
-
children: /* @__PURE__ */
|
|
4077
|
+
colSpan: C.length + (e.allowMultiSelect ? 1 : 0),
|
|
4078
|
+
children: /* @__PURE__ */ L(
|
|
4071
4079
|
"div",
|
|
4072
4080
|
{
|
|
4073
4081
|
className: "dynamic-table-sub-container",
|
|
@@ -4075,17 +4083,17 @@ const bt = me.memo((e) => {
|
|
|
4075
4083
|
position: "sticky",
|
|
4076
4084
|
left: 0,
|
|
4077
4085
|
padding: "0px 8px",
|
|
4078
|
-
width:
|
|
4086
|
+
width: W > 0 ? `${W}px` : "100%",
|
|
4079
4087
|
// 使用父容器实际宽度
|
|
4080
4088
|
minWidth: "800px",
|
|
4081
4089
|
// 最小宽度确保内容显示
|
|
4082
4090
|
maxWidth: "100%",
|
|
4083
4091
|
// 最大宽度不超过父容器
|
|
4084
|
-
background: ((Ne = (be = p.theme) == null ? void 0 : be.colors) == null ? void 0 : Ne.subTableBackground) || ((Ze = (
|
|
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,
|
|
4085
4093
|
boxSizing: "border-box"
|
|
4086
4094
|
},
|
|
4087
4095
|
children: [
|
|
4088
|
-
|
|
4096
|
+
v.tableLoading && /* @__PURE__ */ o(
|
|
4089
4097
|
"div",
|
|
4090
4098
|
{
|
|
4091
4099
|
className: "dynamic-table-sub-loading-overlay",
|
|
@@ -4103,7 +4111,7 @@ const bt = me.memo((e) => {
|
|
|
4103
4111
|
zIndex: 10,
|
|
4104
4112
|
borderRadius: p.space.radius
|
|
4105
4113
|
},
|
|
4106
|
-
children: /* @__PURE__ */
|
|
4114
|
+
children: /* @__PURE__ */ L(
|
|
4107
4115
|
"div",
|
|
4108
4116
|
{
|
|
4109
4117
|
className: "dynamic-table-sub-loading-content",
|
|
@@ -4134,7 +4142,7 @@ const bt = me.memo((e) => {
|
|
|
4134
4142
|
)
|
|
4135
4143
|
}
|
|
4136
4144
|
),
|
|
4137
|
-
/* @__PURE__ */
|
|
4145
|
+
/* @__PURE__ */ L("div", { className: "dynamic-table-sub-content", style: { marginBottom: "16px" }, children: [
|
|
4138
4146
|
Array.isArray((wr = e.subTableConfig) == null ? void 0 : wr.toolbar) && e.subTableConfig.toolbar.length > 0 && /* @__PURE__ */ o(
|
|
4139
4147
|
"div",
|
|
4140
4148
|
{
|
|
@@ -4145,23 +4153,23 @@ const bt = me.memo((e) => {
|
|
|
4145
4153
|
alignItems: "center",
|
|
4146
4154
|
marginBottom: 8
|
|
4147
4155
|
},
|
|
4148
|
-
children: e.subTableConfig.toolbar.map((
|
|
4156
|
+
children: e.subTableConfig.toolbar.map((U, ue) => {
|
|
4149
4157
|
const Qe = {
|
|
4150
4158
|
primary: "primary",
|
|
4151
4159
|
error: "danger",
|
|
4152
4160
|
default: "text"
|
|
4153
|
-
}[
|
|
4161
|
+
}[U.btnType] || "text";
|
|
4154
4162
|
return /* @__PURE__ */ o(
|
|
4155
4163
|
er,
|
|
4156
4164
|
{
|
|
4157
4165
|
mode: Qe,
|
|
4158
|
-
label:
|
|
4159
|
-
icon:
|
|
4166
|
+
label: U.label,
|
|
4167
|
+
icon: U.icon,
|
|
4160
4168
|
onClick: () => {
|
|
4161
4169
|
var Me;
|
|
4162
4170
|
return (Me = e.eventsEmit) == null ? void 0 : Me.call(e, "table_action_add", {
|
|
4163
|
-
tableId:
|
|
4164
|
-
action:
|
|
4171
|
+
tableId: v.id,
|
|
4172
|
+
action: U
|
|
4165
4173
|
});
|
|
4166
4174
|
}
|
|
4167
4175
|
},
|
|
@@ -4174,11 +4182,11 @@ const bt = me.memo((e) => {
|
|
|
4174
4182
|
ht,
|
|
4175
4183
|
{
|
|
4176
4184
|
theme: p.theme || B,
|
|
4177
|
-
onWheel: (
|
|
4178
|
-
|
|
4185
|
+
onWheel: (U) => {
|
|
4186
|
+
U.stopPropagation();
|
|
4179
4187
|
},
|
|
4180
|
-
onScroll: (
|
|
4181
|
-
|
|
4188
|
+
onScroll: (U) => {
|
|
4189
|
+
U.stopPropagation();
|
|
4182
4190
|
},
|
|
4183
4191
|
style: {
|
|
4184
4192
|
position: "relative",
|
|
@@ -4191,22 +4199,22 @@ const bt = me.memo((e) => {
|
|
|
4191
4199
|
bt,
|
|
4192
4200
|
{
|
|
4193
4201
|
columns: ((kr = e.subTableConfig) == null ? void 0 : kr.columns) || [],
|
|
4194
|
-
dataSource:
|
|
4202
|
+
dataSource: v.children || [],
|
|
4195
4203
|
isSubTable: !0,
|
|
4196
|
-
isPending: (
|
|
4204
|
+
isPending: (U) => {
|
|
4197
4205
|
var ue, ge;
|
|
4198
|
-
return ((ge = (ue = e.subTablePendingIds) == null ? void 0 : ue[
|
|
4206
|
+
return ((ge = (ue = e.subTablePendingIds) == null ? void 0 : ue[v.id]) == null ? void 0 : ge.includes(U)) || !1;
|
|
4199
4207
|
},
|
|
4200
|
-
onRowAnimationComplete: (
|
|
4208
|
+
onRowAnimationComplete: (U) => {
|
|
4201
4209
|
var ue;
|
|
4202
|
-
(ue = e.onSubTableRowAnimationComplete) == null || ue.call(e,
|
|
4203
|
-
rowId:
|
|
4204
|
-
tableId:
|
|
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
|
|
4205
4213
|
});
|
|
4206
4214
|
},
|
|
4207
|
-
eventsEmit: (
|
|
4215
|
+
eventsEmit: (U, ue) => {
|
|
4208
4216
|
var ge;
|
|
4209
|
-
(ge = e.eventsEmit) == null || ge.call(e,
|
|
4217
|
+
(ge = e.eventsEmit) == null || ge.call(e, U, { ...ue, tableId: v.id });
|
|
4210
4218
|
},
|
|
4211
4219
|
allowMultiSelect: (Sr = e.subTableConfig) == null ? void 0 : Sr.allowMultiSelect,
|
|
4212
4220
|
size: e.size,
|
|
@@ -4231,7 +4239,7 @@ const bt = me.memo((e) => {
|
|
|
4231
4239
|
)
|
|
4232
4240
|
}
|
|
4233
4241
|
)
|
|
4234
|
-
] },
|
|
4242
|
+
] }, v.id ?? ne);
|
|
4235
4243
|
}) })
|
|
4236
4244
|
]
|
|
4237
4245
|
}
|
|
@@ -4247,37 +4255,37 @@ const bt = me.memo((e) => {
|
|
|
4247
4255
|
justifyContent: "end",
|
|
4248
4256
|
alignItems: "center",
|
|
4249
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,
|
|
4250
|
-
borderTop: `1px solid ${((
|
|
4258
|
+
borderTop: `1px solid ${((je = (Le = p.theme) == null ? void 0 : Le.colors) == null ? void 0 : je.border) || B.colors.border}`,
|
|
4251
4259
|
flexShrink: 0,
|
|
4252
4260
|
paddingRight: 16
|
|
4253
4261
|
},
|
|
4254
4262
|
children: /* @__PURE__ */ o(
|
|
4255
4263
|
wa,
|
|
4256
4264
|
{
|
|
4257
|
-
current:
|
|
4258
|
-
pageSize:
|
|
4259
|
-
total:
|
|
4260
|
-
onChange:
|
|
4261
|
-
onPageSizeChange: (
|
|
4265
|
+
current: R,
|
|
4266
|
+
pageSize: X,
|
|
4267
|
+
total: S,
|
|
4268
|
+
onChange: I,
|
|
4269
|
+
onPageSizeChange: (v) => {
|
|
4262
4270
|
var ne;
|
|
4263
|
-
|
|
4271
|
+
Q(1), P(v), O && l && M && e.eventsEmit && (a(/* @__PURE__ */ new Set()), e.eventsEmit(
|
|
4264
4272
|
"pagination:request_merge_data",
|
|
4265
4273
|
{
|
|
4266
|
-
viewId:
|
|
4274
|
+
viewId: M,
|
|
4267
4275
|
request: { pageNo: 1, pageSize: l }
|
|
4268
4276
|
},
|
|
4269
4277
|
void 0
|
|
4270
|
-
)), (ne = e.eventsEmit) == null || ne.call(e, "pagination:pageSizeChange", { viewId:
|
|
4278
|
+
)), (ne = e.eventsEmit) == null || ne.call(e, "pagination:pageSizeChange", { viewId: M, pageSize: v });
|
|
4271
4279
|
},
|
|
4272
4280
|
showSizeChanger: !0,
|
|
4273
4281
|
pageSizeOptions: [5, 10, 20, 30, 50],
|
|
4274
4282
|
theme: {
|
|
4275
4283
|
colors: {
|
|
4276
|
-
background: ((He = (
|
|
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,
|
|
4277
4285
|
text: ((Ve = (Ue = p.theme) == null ? void 0 : Ue.colors) == null ? void 0 : Ve.text) || B.colors.text,
|
|
4278
4286
|
border: ((Je = (Ee = p.theme) == null ? void 0 : Ee.colors) == null ? void 0 : Je.border) || B.colors.border,
|
|
4279
4287
|
disabledBackground: ((Ke = (Ge = p.theme) == null ? void 0 : Ge.colors) == null ? void 0 : Ke.disabledBackground) || B.colors.disabledBackground,
|
|
4280
|
-
primary: ((pe = (
|
|
4288
|
+
primary: ((pe = (Xe = p.theme) == null ? void 0 : Xe.colors) == null ? void 0 : pe.primary) || B.colors.primary
|
|
4281
4289
|
},
|
|
4282
4290
|
space: { radius: ((rr = (Ce = p.theme) == null ? void 0 : Ce.space) == null ? void 0 : rr.radius) || B.space.radius }
|
|
4283
4291
|
},
|
|
@@ -4305,7 +4313,7 @@ const bt = me.memo((e) => {
|
|
|
4305
4313
|
width: ${(e) => e.$width || "600px"};
|
|
4306
4314
|
height: ${(e) => e.$height || "400px"};
|
|
4307
4315
|
position: relative;
|
|
4308
|
-
`,
|
|
4316
|
+
`, Xr = J.div`
|
|
4309
4317
|
display: flex;
|
|
4310
4318
|
flex-direction: column;
|
|
4311
4319
|
border-right: 1px solid ${(e) => {
|
|
@@ -4317,7 +4325,7 @@ const bt = me.memo((e) => {
|
|
|
4317
4325
|
&:last-child {
|
|
4318
4326
|
border-right: none;
|
|
4319
4327
|
}
|
|
4320
|
-
`,
|
|
4328
|
+
`, Pr = J.div`
|
|
4321
4329
|
padding: 12px 16px;
|
|
4322
4330
|
border-bottom: 1px solid ${(e) => {
|
|
4323
4331
|
var r, t, s;
|
|
@@ -4495,167 +4503,167 @@ const bt = me.memo((e) => {
|
|
|
4495
4503
|
rightTitle: d = "已选",
|
|
4496
4504
|
showSearch: f = !0,
|
|
4497
4505
|
filterOption: N,
|
|
4498
|
-
renderItem:
|
|
4499
|
-
renderSelectedItem:
|
|
4500
|
-
onItemDataChange:
|
|
4506
|
+
renderItem: F,
|
|
4507
|
+
renderSelectedItem: M,
|
|
4508
|
+
onItemDataChange: O,
|
|
4501
4509
|
itemDataMap: l,
|
|
4502
|
-
className:
|
|
4503
|
-
style:
|
|
4504
|
-
styles:
|
|
4510
|
+
className: $,
|
|
4511
|
+
style: H,
|
|
4512
|
+
styles: P,
|
|
4505
4513
|
height: te,
|
|
4506
4514
|
width: a
|
|
4507
4515
|
}) => {
|
|
4508
|
-
const T = Fe(),
|
|
4516
|
+
const T = Fe(), w = $e(
|
|
4509
4517
|
$e({ theme: B, mode: "light" }, T),
|
|
4510
|
-
|
|
4511
|
-
), [V,
|
|
4512
|
-
r === void 0 &&
|
|
4513
|
-
}, y = N || ((
|
|
4514
|
-
const
|
|
4515
|
-
l === void 0 &&
|
|
4516
|
-
},
|
|
4517
|
-
const
|
|
4518
|
-
if (G(
|
|
4519
|
-
if (
|
|
4520
|
-
const
|
|
4521
|
-
delete
|
|
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);
|
|
4522
4530
|
}
|
|
4523
4531
|
} else
|
|
4524
|
-
|
|
4532
|
+
W[S.key] && (O == null || O(S.key, void 0));
|
|
4525
4533
|
};
|
|
4526
4534
|
we(() => {
|
|
4527
4535
|
if (l === void 0) {
|
|
4528
|
-
const
|
|
4529
|
-
(
|
|
4536
|
+
const S = new Set(re), Y = Object.keys(W).filter(
|
|
4537
|
+
(I) => !S.has(I)
|
|
4530
4538
|
);
|
|
4531
|
-
if (
|
|
4532
|
-
const
|
|
4533
|
-
|
|
4534
|
-
delete
|
|
4535
|
-
}),
|
|
4539
|
+
if (Y.length > 0) {
|
|
4540
|
+
const I = { ...W };
|
|
4541
|
+
Y.forEach((i) => {
|
|
4542
|
+
delete I[i];
|
|
4543
|
+
}), Z(I);
|
|
4536
4544
|
}
|
|
4537
4545
|
} else {
|
|
4538
|
-
const
|
|
4539
|
-
Object.keys(
|
|
4540
|
-
(
|
|
4541
|
-
).forEach((
|
|
4542
|
-
|
|
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);
|
|
4543
4551
|
});
|
|
4544
4552
|
}
|
|
4545
|
-
}, [
|
|
4546
|
-
const
|
|
4547
|
-
if (
|
|
4548
|
-
const
|
|
4549
|
-
if (
|
|
4550
|
-
|
|
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);
|
|
4551
4559
|
else {
|
|
4552
|
-
if (h > 0 &&
|
|
4560
|
+
if (h > 0 && Y.length >= h)
|
|
4553
4561
|
return;
|
|
4554
|
-
|
|
4562
|
+
Y.push(S.key);
|
|
4555
4563
|
}
|
|
4556
|
-
G(
|
|
4557
|
-
},
|
|
4558
|
-
return /* @__PURE__ */
|
|
4564
|
+
G(Y);
|
|
4565
|
+
}, Q = (S) => re.includes(S), X = h > 0 && re.length >= h;
|
|
4566
|
+
return /* @__PURE__ */ L(
|
|
4559
4567
|
gt,
|
|
4560
4568
|
{
|
|
4561
|
-
$theme:
|
|
4569
|
+
$theme: w.theme || B,
|
|
4562
4570
|
$width: a,
|
|
4563
4571
|
$height: te,
|
|
4564
|
-
className:
|
|
4565
|
-
style:
|
|
4572
|
+
className: $,
|
|
4573
|
+
style: H,
|
|
4566
4574
|
children: [
|
|
4567
|
-
/* @__PURE__ */
|
|
4568
|
-
/* @__PURE__ */
|
|
4575
|
+
/* @__PURE__ */ L(Xr, { $theme: w.theme || B, style: { flex: 1 }, children: [
|
|
4576
|
+
/* @__PURE__ */ L(Pr, { $theme: w.theme || B, children: [
|
|
4569
4577
|
p,
|
|
4570
|
-
h > 0 && /* @__PURE__ */
|
|
4571
|
-
|
|
4578
|
+
h > 0 && /* @__PURE__ */ L(ta, { $theme: w.theme || B, children: [
|
|
4579
|
+
re.length,
|
|
4572
4580
|
"/",
|
|
4573
4581
|
h
|
|
4574
4582
|
] })
|
|
4575
4583
|
] }),
|
|
4576
|
-
f && /* @__PURE__ */ o(xt, { $theme:
|
|
4584
|
+
f && /* @__PURE__ */ o(xt, { $theme: w.theme || B, children: /* @__PURE__ */ L("div", { style: { position: "relative" }, children: [
|
|
4577
4585
|
/* @__PURE__ */ o($t, { children: /* @__PURE__ */ o(xa, { size: 16 }) }),
|
|
4578
4586
|
/* @__PURE__ */ o(
|
|
4579
4587
|
yt,
|
|
4580
4588
|
{
|
|
4581
|
-
$theme:
|
|
4589
|
+
$theme: w.theme || B,
|
|
4582
4590
|
type: "text",
|
|
4583
4591
|
placeholder: b,
|
|
4584
4592
|
value: E,
|
|
4585
|
-
onChange: (
|
|
4593
|
+
onChange: (S) => j(S.target.value)
|
|
4586
4594
|
}
|
|
4587
4595
|
)
|
|
4588
4596
|
] }) }),
|
|
4589
|
-
/* @__PURE__ */ o(Zr, { children: x.length === 0 ? /* @__PURE__ */ o(aa, { $theme:
|
|
4590
|
-
const
|
|
4591
|
-
return /* @__PURE__ */
|
|
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(
|
|
4592
4600
|
Qr,
|
|
4593
4601
|
{
|
|
4594
|
-
$theme:
|
|
4595
|
-
$disabled:
|
|
4596
|
-
$selected:
|
|
4597
|
-
onClick: () =>
|
|
4602
|
+
$theme: w.theme || B,
|
|
4603
|
+
$disabled: I,
|
|
4604
|
+
$selected: Y,
|
|
4605
|
+
onClick: () => R(S),
|
|
4598
4606
|
children: [
|
|
4599
|
-
/* @__PURE__ */ o(ea, { $theme:
|
|
4600
|
-
|
|
4607
|
+
/* @__PURE__ */ o(ea, { $theme: w.theme || B, children: F ? F(S) : S.label }),
|
|
4608
|
+
Y && /* @__PURE__ */ o(
|
|
4601
4609
|
ra,
|
|
4602
4610
|
{
|
|
4603
|
-
$theme:
|
|
4611
|
+
$theme: w.theme || B,
|
|
4604
4612
|
onClick: (i) => {
|
|
4605
|
-
i.stopPropagation(),
|
|
4613
|
+
i.stopPropagation(), q(S);
|
|
4606
4614
|
},
|
|
4607
4615
|
disabled: !0,
|
|
4608
4616
|
children: "已添加"
|
|
4609
4617
|
}
|
|
4610
4618
|
),
|
|
4611
|
-
!
|
|
4619
|
+
!Y && /* @__PURE__ */ o(
|
|
4612
4620
|
ra,
|
|
4613
4621
|
{
|
|
4614
|
-
$theme:
|
|
4615
|
-
disabled:
|
|
4622
|
+
$theme: w.theme || B,
|
|
4623
|
+
disabled: I,
|
|
4616
4624
|
onClick: (i) => {
|
|
4617
|
-
i.stopPropagation(),
|
|
4625
|
+
i.stopPropagation(), R(S);
|
|
4618
4626
|
},
|
|
4619
4627
|
children: "添加"
|
|
4620
4628
|
}
|
|
4621
4629
|
)
|
|
4622
4630
|
]
|
|
4623
4631
|
},
|
|
4624
|
-
|
|
4632
|
+
S.key
|
|
4625
4633
|
);
|
|
4626
4634
|
}) })
|
|
4627
4635
|
] }),
|
|
4628
|
-
/* @__PURE__ */
|
|
4629
|
-
/* @__PURE__ */
|
|
4636
|
+
/* @__PURE__ */ L(Xr, { $theme: w.theme || B, style: { flex: 1 }, children: [
|
|
4637
|
+
/* @__PURE__ */ L(Pr, { $theme: w.theme || B, children: [
|
|
4630
4638
|
d,
|
|
4631
|
-
|
|
4639
|
+
re.length > 0 && /* @__PURE__ */ o(ta, { $theme: w.theme || B, children: re.length })
|
|
4632
4640
|
] }),
|
|
4633
|
-
/* @__PURE__ */ o(Zr, { children:
|
|
4641
|
+
/* @__PURE__ */ o(Zr, { children: z.length === 0 ? /* @__PURE__ */ o(aa, { $theme: w.theme || B, children: "暂无已选项" }) : z.map((S) => {
|
|
4634
4642
|
var i, u, c;
|
|
4635
|
-
const
|
|
4636
|
-
return /* @__PURE__ */
|
|
4643
|
+
const Y = W[S.key] || {}, I = (n) => k(S.key, n);
|
|
4644
|
+
return /* @__PURE__ */ L(
|
|
4637
4645
|
Qr,
|
|
4638
4646
|
{
|
|
4639
|
-
$theme:
|
|
4647
|
+
$theme: w.theme || B,
|
|
4640
4648
|
children: [
|
|
4641
|
-
/* @__PURE__ */ o(ea, { $theme:
|
|
4649
|
+
/* @__PURE__ */ o(ea, { $theme: w.theme || B, children: M ? M(S, I, Y) : S.label }),
|
|
4642
4650
|
/* @__PURE__ */ o(
|
|
4643
4651
|
ya,
|
|
4644
4652
|
{
|
|
4645
4653
|
size: 14,
|
|
4646
|
-
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",
|
|
4647
4655
|
style: {
|
|
4648
4656
|
cursor: "pointer",
|
|
4649
4657
|
marginLeft: "8px"
|
|
4650
4658
|
},
|
|
4651
4659
|
onClick: (n) => {
|
|
4652
|
-
n.stopPropagation(),
|
|
4660
|
+
n.stopPropagation(), q(S);
|
|
4653
4661
|
}
|
|
4654
4662
|
}
|
|
4655
4663
|
)
|
|
4656
4664
|
]
|
|
4657
4665
|
},
|
|
4658
|
-
|
|
4666
|
+
S.key
|
|
4659
4667
|
);
|
|
4660
4668
|
}) })
|
|
4661
4669
|
] })
|
|
@@ -4670,11 +4678,11 @@ export {
|
|
|
4670
4678
|
Ft as GoogleNavbar,
|
|
4671
4679
|
Rt as SearchableSelector,
|
|
4672
4680
|
Yr as Uploader,
|
|
4673
|
-
|
|
4681
|
+
_t as generateFormItems,
|
|
4674
4682
|
zt as getFormDefaultValues,
|
|
4675
4683
|
Wt as getFormErrors,
|
|
4676
4684
|
Bt as isFormValid,
|
|
4677
4685
|
Ja as useDynamicFormItems,
|
|
4678
4686
|
it as useDynamicTableColumns,
|
|
4679
|
-
|
|
4687
|
+
At as validateFormData
|
|
4680
4688
|
};
|