@mxmweb/zui-components 1.2.1 → 1.2.2
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 +325 -313
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsxs as O, jsx as o, Fragment as Vr } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import be, { useState as ce, useMemo as Me, useEffect as ke, useRef as Te, useCallback as pe } from "react";
|
|
3
3
|
import J, { createGlobalStyle as Qr } from "styled-components";
|
|
4
4
|
import { useTheme as Fe, deepMergeTheme as $e, defaultTheme as P } from "@mxmweb/zui-theme";
|
|
5
5
|
import xr from "animejs/lib/anime.es.js";
|
|
6
6
|
import { CircleHelp as Er, Trash as et, File as Ne, AlertCircle as yr, Upload as rt, ChevronDown as tt, ChevronRight as at, Search as nt, CircleX as ot } from "lucide-react";
|
|
7
|
-
import { Form as K, Input as
|
|
7
|
+
import { Form as K, Input as me, Select as Je, InputNumber as Ge, Slider as $r, Switch as vr, DatePicker as Ke, Radio as wr, Checkbox as kr, TimePicker as Sr, Tooltip as er, Button as Nr, Tag as st } from "antd";
|
|
8
8
|
import { Button as He, DropdownMenu as lt, SharedPagination as it } from "@mxmweb/zui-elements";
|
|
9
9
|
const dt = J.div`
|
|
10
10
|
background-color: #ffffff;
|
|
@@ -263,7 +263,7 @@ const dt = J.div`
|
|
|
263
263
|
duration: 200,
|
|
264
264
|
easing: "easeOutCubic"
|
|
265
265
|
});
|
|
266
|
-
},
|
|
266
|
+
}, R = (G) => {
|
|
267
267
|
te(null), t(null);
|
|
268
268
|
const M = Z.current[G];
|
|
269
269
|
M && xr({
|
|
@@ -276,10 +276,10 @@ const dt = J.div`
|
|
|
276
276
|
if (b === "single")
|
|
277
277
|
w !== G.id && (H(G.id), k && k(G.id, G));
|
|
278
278
|
else {
|
|
279
|
-
const
|
|
280
|
-
if (U(
|
|
281
|
-
const g = e.filter((T) =>
|
|
282
|
-
S(
|
|
279
|
+
const v = _.includes(G.id) ? _.filter((g) => g !== G.id) : [..._, G.id];
|
|
280
|
+
if (U(v), S) {
|
|
281
|
+
const g = e.filter((T) => v.includes(T.id));
|
|
282
|
+
S(v, g);
|
|
283
283
|
}
|
|
284
284
|
}
|
|
285
285
|
f && f(G, M), G.onClick && G.onClick();
|
|
@@ -297,14 +297,14 @@ const dt = J.div`
|
|
|
297
297
|
children: e.map((G, M) => /* @__PURE__ */ O(
|
|
298
298
|
ht,
|
|
299
299
|
{
|
|
300
|
-
ref: (
|
|
300
|
+
ref: (v) => Z.current[M] = v,
|
|
301
301
|
itemWidth: r,
|
|
302
302
|
itemHeight: a,
|
|
303
303
|
itemGap: h,
|
|
304
304
|
isHovered: I === M,
|
|
305
305
|
magnification: s,
|
|
306
306
|
onMouseEnter: () => E(M),
|
|
307
|
-
onMouseLeave: () =>
|
|
307
|
+
onMouseLeave: () => R(M),
|
|
308
308
|
onClick: () => Q(G, M),
|
|
309
309
|
children: [
|
|
310
310
|
/* @__PURE__ */ o(
|
|
@@ -753,7 +753,7 @@ function ie(e) {
|
|
|
753
753
|
] }) : null;
|
|
754
754
|
}
|
|
755
755
|
function At(e = [], r, a = {}, s = "md") {
|
|
756
|
-
const h = s === "sm" ? "28px" : "40px", b = s === "sm" ? "28px" : "40px", p = s === "sm" ? "0 8px" : "0 12px", i = s === "sm" ? "16px" : "24px", f = s === "sm" ? "12px" : "14px", k =
|
|
756
|
+
const h = s === "sm" ? "28px" : "40px", b = s === "sm" ? "28px" : "40px", p = s === "sm" ? "0 8px" : "0 12px", i = s === "sm" ? "16px" : "24px", f = s === "sm" ? "12px" : "14px", k = be.useMemo(
|
|
757
757
|
() => {
|
|
758
758
|
var w, H, _, U, j, Z;
|
|
759
759
|
(H = (w = r == null ? void 0 : r.theme) == null ? void 0 : w.colors) != null && H.border;
|
|
@@ -916,19 +916,19 @@ function At(e = [], r, a = {}, s = "md") {
|
|
|
916
916
|
},
|
|
917
917
|
[s, h, b, p, i, f, r]
|
|
918
918
|
);
|
|
919
|
-
|
|
919
|
+
be.useEffect(() => {
|
|
920
920
|
const t = document.createElement("style");
|
|
921
921
|
return t.textContent = k, document.head.appendChild(t), () => {
|
|
922
922
|
document.head.removeChild(t);
|
|
923
923
|
};
|
|
924
924
|
}, [k]);
|
|
925
|
-
const [S, D] =
|
|
925
|
+
const [S, D] = be.useState(() => {
|
|
926
926
|
const t = {};
|
|
927
927
|
return e.forEach((C) => {
|
|
928
928
|
C.name && (C.type === "switch" ? t[C.name] = a[C.name] ?? C.defaultValue ?? !1 : ["select", "radio", "checkbox"].includes(C.type) && (t[C.name] = a[C.name] ?? C.defaultValue ?? (C.type === "checkbox" ? [] : "")));
|
|
929
929
|
}), t;
|
|
930
|
-
}), W =
|
|
931
|
-
|
|
930
|
+
}), W = be.useRef();
|
|
931
|
+
be.useEffect(() => {
|
|
932
932
|
r && r.formInstance && !W.current && (W.current = r.formInstance);
|
|
933
933
|
}, [r]);
|
|
934
934
|
const l = (t, C, w) => {
|
|
@@ -981,7 +981,7 @@ function At(e = [], r, a = {}, s = "md") {
|
|
|
981
981
|
};
|
|
982
982
|
te(e);
|
|
983
983
|
const ne = e.map((t, C) => {
|
|
984
|
-
var w, H, _, U, j, Z, E,
|
|
984
|
+
var w, H, _, U, j, Z, E, R, Q, G, M, v, g, T, $, q, L, X, ee, N, Y, B;
|
|
985
985
|
if (t.name && A.has(t.name)) return null;
|
|
986
986
|
if (t.type === "divider")
|
|
987
987
|
return /* @__PURE__ */ o(
|
|
@@ -1028,7 +1028,7 @@ function At(e = [], r, a = {}, s = "md") {
|
|
|
1028
1028
|
if (t.type === "col") {
|
|
1029
1029
|
if (!t.children || t.children.length === 0) return null;
|
|
1030
1030
|
const d = (n, z) => {
|
|
1031
|
-
var xe, De, ze, _e, Ae, We,
|
|
1031
|
+
var xe, De, ze, _e, Ae, We, Re, qe, Le, Oe, je, Be, y, ae, se, oe, de, le, he, we, Se, Ye;
|
|
1032
1032
|
const F = typeof n.hidden == "function" ? n.hidden(I) : n.hidden === !0;
|
|
1033
1033
|
if (n.name && A.has(n.name) || F) return null;
|
|
1034
1034
|
const m = {
|
|
@@ -1057,7 +1057,7 @@ function At(e = [], r, a = {}, s = "md") {
|
|
|
1057
1057
|
);
|
|
1058
1058
|
case "input":
|
|
1059
1059
|
return /* @__PURE__ */ o(K.Item, { ...m, children: /* @__PURE__ */ o(
|
|
1060
|
-
|
|
1060
|
+
me,
|
|
1061
1061
|
{
|
|
1062
1062
|
placeholder: n.placeholder,
|
|
1063
1063
|
disabled: n.disabled,
|
|
@@ -1072,8 +1072,8 @@ function At(e = [], r, a = {}, s = "md") {
|
|
|
1072
1072
|
disabled: n.disabled,
|
|
1073
1073
|
className: re,
|
|
1074
1074
|
value: S[n.name || ""],
|
|
1075
|
-
onChange: (
|
|
1076
|
-
children: (xe = n.options) == null ? void 0 : xe.map((
|
|
1075
|
+
onChange: (fe) => l(n.name || "", fe, n.controlledItems),
|
|
1076
|
+
children: (xe = n.options) == null ? void 0 : xe.map((fe, Ce) => /* @__PURE__ */ o(Je.Option, { value: fe.value, children: fe.render ? fe.render() : fe.label }, fe.value || Ce))
|
|
1077
1077
|
}
|
|
1078
1078
|
) }, x);
|
|
1079
1079
|
case "number":
|
|
@@ -1092,7 +1092,7 @@ function At(e = [], r, a = {}, s = "md") {
|
|
|
1092
1092
|
) }, x);
|
|
1093
1093
|
case "password":
|
|
1094
1094
|
return /* @__PURE__ */ o(K.Item, { ...m, children: /* @__PURE__ */ o(
|
|
1095
|
-
|
|
1095
|
+
me.Password,
|
|
1096
1096
|
{
|
|
1097
1097
|
placeholder: n.placeholder,
|
|
1098
1098
|
disabled: n.disabled,
|
|
@@ -1101,7 +1101,7 @@ function At(e = [], r, a = {}, s = "md") {
|
|
|
1101
1101
|
) }, x);
|
|
1102
1102
|
case "textarea":
|
|
1103
1103
|
return /* @__PURE__ */ o(K.Item, { ...m, children: /* @__PURE__ */ o(
|
|
1104
|
-
|
|
1104
|
+
me.TextArea,
|
|
1105
1105
|
{
|
|
1106
1106
|
placeholder: n.placeholder,
|
|
1107
1107
|
disabled: n.disabled,
|
|
@@ -1144,7 +1144,7 @@ function At(e = [], r, a = {}, s = "md") {
|
|
|
1144
1144
|
{
|
|
1145
1145
|
disabled: n.disabled,
|
|
1146
1146
|
checked: S[n.name || ""],
|
|
1147
|
-
onChange: (
|
|
1147
|
+
onChange: (fe) => l(n.name || "", fe, n.controlledItems)
|
|
1148
1148
|
}
|
|
1149
1149
|
) })
|
|
1150
1150
|
] })
|
|
@@ -1173,7 +1173,7 @@ function At(e = [], r, a = {}, s = "md") {
|
|
|
1173
1173
|
$r,
|
|
1174
1174
|
{
|
|
1175
1175
|
min: (We = n.range) == null ? void 0 : We.min,
|
|
1176
|
-
max: (
|
|
1176
|
+
max: (Re = n.range) == null ? void 0 : Re.max,
|
|
1177
1177
|
step: n.step,
|
|
1178
1178
|
disabled: n.disabled,
|
|
1179
1179
|
className: n.className
|
|
@@ -1191,7 +1191,7 @@ function At(e = [], r, a = {}, s = "md") {
|
|
|
1191
1191
|
) }, x);
|
|
1192
1192
|
case "email":
|
|
1193
1193
|
return /* @__PURE__ */ o(K.Item, { ...m, children: /* @__PURE__ */ o(
|
|
1194
|
-
|
|
1194
|
+
me,
|
|
1195
1195
|
{
|
|
1196
1196
|
type: "email",
|
|
1197
1197
|
placeholder: n.placeholder,
|
|
@@ -1222,7 +1222,7 @@ function At(e = [], r, a = {}, s = "md") {
|
|
|
1222
1222
|
) }, x);
|
|
1223
1223
|
case "file":
|
|
1224
1224
|
return /* @__PURE__ */ o(K.Item, { ...m, children: /* @__PURE__ */ o(
|
|
1225
|
-
|
|
1225
|
+
me,
|
|
1226
1226
|
{
|
|
1227
1227
|
type: "file",
|
|
1228
1228
|
placeholder: n.placeholder,
|
|
@@ -1232,7 +1232,7 @@ function At(e = [], r, a = {}, s = "md") {
|
|
|
1232
1232
|
) }, x);
|
|
1233
1233
|
case "color":
|
|
1234
1234
|
return /* @__PURE__ */ o(K.Item, { ...m, children: /* @__PURE__ */ o(
|
|
1235
|
-
|
|
1235
|
+
me,
|
|
1236
1236
|
{
|
|
1237
1237
|
type: "color",
|
|
1238
1238
|
placeholder: n.placeholder,
|
|
@@ -1247,7 +1247,7 @@ function At(e = [], r, a = {}, s = "md") {
|
|
|
1247
1247
|
) }, x);
|
|
1248
1248
|
case "json":
|
|
1249
1249
|
return /* @__PURE__ */ o(K.Item, { ...m, children: /* @__PURE__ */ o(
|
|
1250
|
-
|
|
1250
|
+
me.TextArea,
|
|
1251
1251
|
{
|
|
1252
1252
|
placeholder: n.placeholder,
|
|
1253
1253
|
disabled: n.disabled,
|
|
@@ -1257,7 +1257,7 @@ function At(e = [], r, a = {}, s = "md") {
|
|
|
1257
1257
|
) }, x);
|
|
1258
1258
|
case "markdown":
|
|
1259
1259
|
return /* @__PURE__ */ o(K.Item, { ...m, children: /* @__PURE__ */ o(
|
|
1260
|
-
|
|
1260
|
+
me.TextArea,
|
|
1261
1261
|
{
|
|
1262
1262
|
placeholder: n.placeholder,
|
|
1263
1263
|
disabled: n.disabled,
|
|
@@ -1269,25 +1269,25 @@ function At(e = [], r, a = {}, s = "md") {
|
|
|
1269
1269
|
return /* @__PURE__ */ o(K.Item, { ...m, children: /* @__PURE__ */ o(
|
|
1270
1270
|
Fr,
|
|
1271
1271
|
{
|
|
1272
|
-
multiple: ((
|
|
1272
|
+
multiple: ((qe = n.uploaderConfig) == null ? void 0 : qe.multiple) ?? !0,
|
|
1273
1273
|
accept: ((Le = n.uploaderConfig) == null ? void 0 : Le.accept) ?? "*/*",
|
|
1274
1274
|
maxSize: ((Oe = n.uploaderConfig) == null ? void 0 : Oe.maxSize) ?? 100,
|
|
1275
1275
|
maxFiles: ((je = n.uploaderConfig) == null ? void 0 : je.maxFiles) ?? 10,
|
|
1276
1276
|
autoUpload: ((Be = n.uploaderConfig) == null ? void 0 : Be.autoUpload) ?? !0,
|
|
1277
|
-
url: (
|
|
1277
|
+
url: (y = n.uploaderConfig) == null ? void 0 : y.url,
|
|
1278
1278
|
headers: ((ae = n.uploaderConfig) == null ? void 0 : ae.headers) ?? {},
|
|
1279
1279
|
queryParams: ((se = n.uploaderConfig) == null ? void 0 : se.queryParams) ?? {},
|
|
1280
1280
|
itemForm: ((oe = n.uploaderConfig) == null ? void 0 : oe.itemForm) ?? [],
|
|
1281
1281
|
buttons: ((de = n.uploaderConfig) == null ? void 0 : de.buttons) || [],
|
|
1282
1282
|
icons: (le = n.uploaderConfig) == null ? void 0 : le.icons,
|
|
1283
|
-
placeholder: (
|
|
1283
|
+
placeholder: (he = n.uploaderConfig) == null ? void 0 : he.placeholder,
|
|
1284
1284
|
listName: (we = n.uploaderConfig) == null ? void 0 : we.listName,
|
|
1285
1285
|
errorMessages: (Se = n.uploaderConfig) == null ? void 0 : Se.errorMessages,
|
|
1286
1286
|
onRef: (Ye = n.uploaderConfig) == null ? void 0 : Ye.onRef,
|
|
1287
1287
|
styles: r,
|
|
1288
|
-
eventsEmit: (
|
|
1288
|
+
eventsEmit: (fe, Ce) => {
|
|
1289
1289
|
if (r && typeof r.eventsEmit == "function") {
|
|
1290
|
-
const Ie =
|
|
1290
|
+
const Ie = fe.startsWith("uploader:") ? fe : `uploader:${fe}`;
|
|
1291
1291
|
r.eventsEmit(Ie, {
|
|
1292
1292
|
fieldName: n.name,
|
|
1293
1293
|
...Ce
|
|
@@ -1353,7 +1353,7 @@ function At(e = [], r, a = {}, s = "md") {
|
|
|
1353
1353
|
wrapperCol: { span: 24 },
|
|
1354
1354
|
required: !1,
|
|
1355
1355
|
children: /* @__PURE__ */ o(
|
|
1356
|
-
|
|
1356
|
+
me,
|
|
1357
1357
|
{
|
|
1358
1358
|
placeholder: t.placeholder,
|
|
1359
1359
|
disabled: t.disabled,
|
|
@@ -1492,7 +1492,7 @@ function At(e = [], r, a = {}, s = "md") {
|
|
|
1492
1492
|
wrapperCol: { span: 24 },
|
|
1493
1493
|
required: !1,
|
|
1494
1494
|
children: /* @__PURE__ */ o(
|
|
1495
|
-
|
|
1495
|
+
me.TextArea,
|
|
1496
1496
|
{
|
|
1497
1497
|
placeholder: t.placeholder,
|
|
1498
1498
|
disabled: t.disabled,
|
|
@@ -1553,7 +1553,7 @@ function At(e = [], r, a = {}, s = "md") {
|
|
|
1553
1553
|
wrapperCol: { span: 24 },
|
|
1554
1554
|
required: !1,
|
|
1555
1555
|
children: /* @__PURE__ */ o(
|
|
1556
|
-
|
|
1556
|
+
me.Password,
|
|
1557
1557
|
{
|
|
1558
1558
|
placeholder: t.placeholder,
|
|
1559
1559
|
disabled: t.disabled,
|
|
@@ -1596,7 +1596,7 @@ function At(e = [], r, a = {}, s = "md") {
|
|
|
1596
1596
|
wrapperCol: { span: 24 },
|
|
1597
1597
|
required: !1,
|
|
1598
1598
|
children: /* @__PURE__ */ o(
|
|
1599
|
-
|
|
1599
|
+
me,
|
|
1600
1600
|
{
|
|
1601
1601
|
type: "email",
|
|
1602
1602
|
placeholder: t.placeholder,
|
|
@@ -1660,7 +1660,7 @@ function At(e = [], r, a = {}, s = "md") {
|
|
|
1660
1660
|
wrapperCol: { span: 24 },
|
|
1661
1661
|
required: !1,
|
|
1662
1662
|
children: /* @__PURE__ */ o(
|
|
1663
|
-
|
|
1663
|
+
me,
|
|
1664
1664
|
{
|
|
1665
1665
|
type: "file",
|
|
1666
1666
|
placeholder: t.placeholder,
|
|
@@ -1681,7 +1681,7 @@ function At(e = [], r, a = {}, s = "md") {
|
|
|
1681
1681
|
wrapperCol: { span: 24 },
|
|
1682
1682
|
required: !1,
|
|
1683
1683
|
children: /* @__PURE__ */ o(
|
|
1684
|
-
|
|
1684
|
+
me,
|
|
1685
1685
|
{
|
|
1686
1686
|
type: "color",
|
|
1687
1687
|
placeholder: t.placeholder,
|
|
@@ -1715,7 +1715,7 @@ function At(e = [], r, a = {}, s = "md") {
|
|
|
1715
1715
|
wrapperCol: { span: 24 },
|
|
1716
1716
|
required: !1,
|
|
1717
1717
|
children: /* @__PURE__ */ o(
|
|
1718
|
-
|
|
1718
|
+
me.TextArea,
|
|
1719
1719
|
{
|
|
1720
1720
|
placeholder: t.placeholder,
|
|
1721
1721
|
disabled: t.disabled,
|
|
@@ -1736,7 +1736,7 @@ function At(e = [], r, a = {}, s = "md") {
|
|
|
1736
1736
|
wrapperCol: { span: 24 },
|
|
1737
1737
|
required: !1,
|
|
1738
1738
|
children: /* @__PURE__ */ o(
|
|
1739
|
-
|
|
1739
|
+
me.TextArea,
|
|
1740
1740
|
{
|
|
1741
1741
|
placeholder: t.placeholder,
|
|
1742
1742
|
disabled: t.disabled,
|
|
@@ -1759,15 +1759,15 @@ function At(e = [], r, a = {}, s = "md") {
|
|
|
1759
1759
|
children: /* @__PURE__ */ o(
|
|
1760
1760
|
Fr,
|
|
1761
1761
|
{
|
|
1762
|
-
multiple: ((
|
|
1762
|
+
multiple: ((R = t.uploaderConfig) == null ? void 0 : R.multiple) ?? !0,
|
|
1763
1763
|
accept: ((Q = t.uploaderConfig) == null ? void 0 : Q.accept) ?? "*/*",
|
|
1764
1764
|
maxSize: ((G = t.uploaderConfig) == null ? void 0 : G.maxSize) ?? 100,
|
|
1765
1765
|
maxFiles: ((M = t.uploaderConfig) == null ? void 0 : M.maxFiles) ?? 10,
|
|
1766
|
-
autoUpload: ((
|
|
1766
|
+
autoUpload: ((v = t.uploaderConfig) == null ? void 0 : v.autoUpload) ?? !0,
|
|
1767
1767
|
url: (g = t.uploaderConfig) == null ? void 0 : g.url,
|
|
1768
1768
|
headers: ((T = t.uploaderConfig) == null ? void 0 : T.headers) ?? {},
|
|
1769
|
-
queryParams: ((
|
|
1770
|
-
itemForm: ((
|
|
1769
|
+
queryParams: (($ = t.uploaderConfig) == null ? void 0 : $.queryParams) ?? {},
|
|
1770
|
+
itemForm: ((q = t.uploaderConfig) == null ? void 0 : q.itemForm) ?? [],
|
|
1771
1771
|
buttons: ((L = t.uploaderConfig) == null ? void 0 : L.buttons) || [],
|
|
1772
1772
|
icons: (X = t.uploaderConfig) == null ? void 0 : X.icons,
|
|
1773
1773
|
placeholder: (ee = t.uploaderConfig) == null ? void 0 : ee.placeholder,
|
|
@@ -1790,7 +1790,7 @@ function At(e = [], r, a = {}, s = "md") {
|
|
|
1790
1790
|
t.name || `uploader-${Math.random()}`
|
|
1791
1791
|
) : null;
|
|
1792
1792
|
});
|
|
1793
|
-
return
|
|
1793
|
+
return be.useEffect(() => {
|
|
1794
1794
|
r && typeof r.setFormRef == "function" && r.setFormRef(W);
|
|
1795
1795
|
}, [r]), ne;
|
|
1796
1796
|
}
|
|
@@ -1813,7 +1813,7 @@ const Wt = `
|
|
|
1813
1813
|
.ant-input-password:hover .ant-input-suffix .anticon {
|
|
1814
1814
|
color: rgba(0, 0, 0, 0.65) !important;
|
|
1815
1815
|
}
|
|
1816
|
-
`, Gr =
|
|
1816
|
+
`, Gr = be.forwardRef(
|
|
1817
1817
|
({
|
|
1818
1818
|
formItems: e,
|
|
1819
1819
|
formProps: r = {},
|
|
@@ -1828,7 +1828,7 @@ const Wt = `
|
|
|
1828
1828
|
formWidth: S,
|
|
1829
1829
|
...D
|
|
1830
1830
|
}, W) => {
|
|
1831
|
-
var G, M,
|
|
1831
|
+
var G, M, v, g, T, $, q, L, X, ee, N, Y, B, d;
|
|
1832
1832
|
const [l] = K.useForm(), A = Fe(), I = $e(
|
|
1833
1833
|
// 基础:默认主题 + useTheme的配置
|
|
1834
1834
|
$e({ theme: P, mode: "light" }, A),
|
|
@@ -1962,7 +1962,7 @@ const Wt = `
|
|
|
1962
1962
|
formName: (r == null ? void 0 : r.name) || "",
|
|
1963
1963
|
data: ne()
|
|
1964
1964
|
}), i != null && i.onReset && i.onReset();
|
|
1965
|
-
},
|
|
1965
|
+
}, R = () => {
|
|
1966
1966
|
l.resetFields(), typeof s == "function" && s("form:cancel", {
|
|
1967
1967
|
formName: (r == null ? void 0 : r.name) || "",
|
|
1968
1968
|
data: ne()
|
|
@@ -2007,14 +2007,14 @@ const Wt = `
|
|
|
2007
2007
|
};
|
|
2008
2008
|
}
|
|
2009
2009
|
};
|
|
2010
|
-
return
|
|
2010
|
+
return be.useImperativeHandle(
|
|
2011
2011
|
W,
|
|
2012
2012
|
() => ({
|
|
2013
2013
|
form: l,
|
|
2014
2014
|
getAllData: Q,
|
|
2015
2015
|
submit: Z,
|
|
2016
2016
|
reset: E,
|
|
2017
|
-
cancel:
|
|
2017
|
+
cancel: R,
|
|
2018
2018
|
validate: () => l.validateFields(),
|
|
2019
2019
|
getValue: (u) => l.getFieldValue(u),
|
|
2020
2020
|
getValues: () => l.getFieldsValue(),
|
|
@@ -2022,7 +2022,7 @@ const Wt = `
|
|
|
2022
2022
|
setFieldProps: (u, c) => _(u, c),
|
|
2023
2023
|
getFieldProps: (u) => U(u)
|
|
2024
2024
|
}),
|
|
2025
|
-
[l, Q, Z, E,
|
|
2025
|
+
[l, Q, Z, E, R]
|
|
2026
2026
|
), /* @__PURE__ */ O(Vr, { children: [
|
|
2027
2027
|
/* @__PURE__ */ o("style", { children: Wt }),
|
|
2028
2028
|
/* @__PURE__ */ O(
|
|
@@ -2056,7 +2056,7 @@ const Wt = `
|
|
|
2056
2056
|
{
|
|
2057
2057
|
style: {
|
|
2058
2058
|
fontSize: "14px",
|
|
2059
|
-
color: ((g = (
|
|
2059
|
+
color: ((g = (v = I.theme) == null ? void 0 : v.colors) == null ? void 0 : g.secondary) || "#6b7280",
|
|
2060
2060
|
margin: "0",
|
|
2061
2061
|
lineHeight: "1.5"
|
|
2062
2062
|
},
|
|
@@ -2088,7 +2088,7 @@ const Wt = `
|
|
|
2088
2088
|
style: {
|
|
2089
2089
|
marginTop: "32px",
|
|
2090
2090
|
paddingTop: "24px",
|
|
2091
|
-
borderTop: `1px solid ${((
|
|
2091
|
+
borderTop: `1px solid ${(($ = (T = I.theme) == null ? void 0 : T.colors) == null ? void 0 : $.border) || "#e5e7eb"}`,
|
|
2092
2092
|
display: "flex",
|
|
2093
2093
|
gap: "12px",
|
|
2094
2094
|
justifyContent: "flex-end"
|
|
@@ -2099,7 +2099,7 @@ const Wt = `
|
|
|
2099
2099
|
{
|
|
2100
2100
|
onClick: E,
|
|
2101
2101
|
style: {
|
|
2102
|
-
borderColor: ((L = (
|
|
2102
|
+
borderColor: ((L = (q = I.theme) == null ? void 0 : q.colors) == null ? void 0 : L.border) || "#e5e7eb",
|
|
2103
2103
|
color: ((ee = (X = I.theme) == null ? void 0 : X.colors) == null ? void 0 : ee.text) || "#1f2937"
|
|
2104
2104
|
},
|
|
2105
2105
|
children: (i == null ? void 0 : i.resetText) || "重置"
|
|
@@ -2129,8 +2129,8 @@ const Wt = `
|
|
|
2129
2129
|
] });
|
|
2130
2130
|
}
|
|
2131
2131
|
);
|
|
2132
|
-
|
|
2133
|
-
const Tr = !1,
|
|
2132
|
+
be.memo(Gr);
|
|
2133
|
+
const Tr = !1, Rt = (e, r) => r != null && r.fileType ? e.startsWith("image/") ? r.fileType.image || /* @__PURE__ */ o(Ne, { size: 20 }) : e.includes("document") || e.includes("pdf") || e.includes("text") ? r.fileType.document || /* @__PURE__ */ o(Ne, { size: 20 }) : e.includes("spreadsheet") || e.includes("excel") || e.includes("csv") ? r.fileType.spreadsheet || /* @__PURE__ */ o(Ne, { size: 20 }) : e.includes("zip") || e.includes("rar") || e.includes("7z") ? r.fileType.archive || /* @__PURE__ */ o(Ne, { size: 20 }) : e.startsWith("video/") ? r.fileType.video || /* @__PURE__ */ o(Ne, { size: 20 }) : e.startsWith("audio/") ? r.fileType.audio || /* @__PURE__ */ o(Ne, { size: 20 }) : r.fileType.default || /* @__PURE__ */ o(Ne, { size: 20 }) : /* @__PURE__ */ o(Ne, { size: 20 }), qt = (e, r, a) => {
|
|
2134
2134
|
var s, h, b, p;
|
|
2135
2135
|
if (a != null && a.itemStatus)
|
|
2136
2136
|
switch (e) {
|
|
@@ -2178,7 +2178,7 @@ const Lt = ({
|
|
|
2178
2178
|
var f;
|
|
2179
2179
|
return /* @__PURE__ */ O(_t, { $theme: a, $status: e.status, $hasForm: s.length > 0, children: [
|
|
2180
2180
|
/* @__PURE__ */ O(kt, { $theme: a, $status: e.status, $hasForm: s.length > 0, children: [
|
|
2181
|
-
/* @__PURE__ */ o(St, { $theme: a, children:
|
|
2181
|
+
/* @__PURE__ */ o(St, { $theme: a, children: Rt(e.type, i) }),
|
|
2182
2182
|
/* @__PURE__ */ O(Nt, { children: [
|
|
2183
2183
|
/* @__PURE__ */ O("div", { className: "flex items-center gap-1 line-clamp-1", children: [
|
|
2184
2184
|
/* @__PURE__ */ o(Mt, { $theme: a, children: e.name }),
|
|
@@ -2188,7 +2188,7 @@ const Lt = ({
|
|
|
2188
2188
|
e.status === "error" && e.error && /* @__PURE__ */ o("div", { style: { color: ((f = a == null ? void 0 : a.colors) == null ? void 0 : f.error) || "#FF0000", fontSize: "12px", marginTop: "4px" }, children: typeof e.error == "string" ? e.error : String(e.error) })
|
|
2189
2189
|
] }),
|
|
2190
2190
|
(() => {
|
|
2191
|
-
const k =
|
|
2191
|
+
const k = qt(e.status, a, i);
|
|
2192
2192
|
return k && /* @__PURE__ */ o(Ft, { $theme: a, $status: e.status, children: k });
|
|
2193
2193
|
})(),
|
|
2194
2194
|
Tr,
|
|
@@ -2283,7 +2283,7 @@ const Lt = ({
|
|
|
2283
2283
|
$e({ theme: P, mode: "light" }, ne),
|
|
2284
2284
|
// 最高层:用户手动传入的styles
|
|
2285
2285
|
k
|
|
2286
|
-
), C = Te(null), [w, H] = ce(!1), [_, U] = ce([]), j =
|
|
2286
|
+
), C = Te(null), [w, H] = ce(!1), [_, U] = ce([]), j = pe((d) => (d ?? _).map((c) => ({
|
|
2287
2287
|
id: c.id,
|
|
2288
2288
|
name: c.name,
|
|
2289
2289
|
status: c.status,
|
|
@@ -2318,10 +2318,10 @@ const Lt = ({
|
|
|
2318
2318
|
uploadFailed: "上传失败,请重试",
|
|
2319
2319
|
fileTooLarge: `文件大小不能超过 ${a}MB`,
|
|
2320
2320
|
invalidFileType: "不支持的文件类型"
|
|
2321
|
-
},
|
|
2321
|
+
}, R = { ...E, ...D }, Q = (d, u) => R[d] ? R[d] : u || E[d], G = (d) => {
|
|
2322
2322
|
const u = d / 1048576;
|
|
2323
2323
|
return `${Number(u.toFixed(2))}MB`;
|
|
2324
|
-
}, M =
|
|
2324
|
+
}, M = pe(
|
|
2325
2325
|
(d, u) => {
|
|
2326
2326
|
const c = a * 1024 * 1024, n = [], z = [];
|
|
2327
2327
|
if (d.forEach((x) => {
|
|
@@ -2364,7 +2364,7 @@ const Lt = ({
|
|
|
2364
2364
|
return m;
|
|
2365
2365
|
},
|
|
2366
2366
|
[a, s, Q, l, j]
|
|
2367
|
-
),
|
|
2367
|
+
), v = Me(
|
|
2368
2368
|
() => ({
|
|
2369
2369
|
// 获取所有上传项
|
|
2370
2370
|
getUploadItems: () => _,
|
|
@@ -2438,9 +2438,9 @@ const Lt = ({
|
|
|
2438
2438
|
[_, h, l, M, j]
|
|
2439
2439
|
);
|
|
2440
2440
|
ke(() => {
|
|
2441
|
-
A && A(
|
|
2442
|
-
}, [
|
|
2443
|
-
const g =
|
|
2441
|
+
A && A(v);
|
|
2442
|
+
}, [v, A]);
|
|
2443
|
+
const g = pe(
|
|
2444
2444
|
(d) => {
|
|
2445
2445
|
if (!d) return;
|
|
2446
2446
|
const u = M(Array.from(d), _.length);
|
|
@@ -2460,16 +2460,16 @@ const Lt = ({
|
|
|
2460
2460
|
U((n) => [...n, ...c]), h && L(c);
|
|
2461
2461
|
},
|
|
2462
2462
|
[h, _.length, M]
|
|
2463
|
-
), T =
|
|
2463
|
+
), T = pe((d) => {
|
|
2464
2464
|
d.preventDefault(), H(!0);
|
|
2465
|
-
}, []),
|
|
2465
|
+
}, []), $ = pe((d) => {
|
|
2466
2466
|
d.preventDefault(), H(!1);
|
|
2467
|
-
}, []),
|
|
2467
|
+
}, []), q = pe(
|
|
2468
2468
|
(d) => {
|
|
2469
2469
|
d.preventDefault(), H(!1), g(d.dataTransfer.files);
|
|
2470
2470
|
},
|
|
2471
2471
|
[g]
|
|
2472
|
-
), L =
|
|
2472
|
+
), L = pe(
|
|
2473
2473
|
async (d) => {
|
|
2474
2474
|
if (!b) {
|
|
2475
2475
|
console.error(Q("noUrl"));
|
|
@@ -2559,8 +2559,8 @@ const Lt = ({
|
|
|
2559
2559
|
}
|
|
2560
2560
|
l == null || l("uploader:complete", { items: _, data: j() });
|
|
2561
2561
|
},
|
|
2562
|
-
[b, p, i, l, _, f,
|
|
2563
|
-
), X =
|
|
2562
|
+
[b, p, i, l, _, f, R.uploadFailed, j]
|
|
2563
|
+
), X = pe(
|
|
2564
2564
|
(d) => {
|
|
2565
2565
|
U((u) => {
|
|
2566
2566
|
const c = u.find((n) => n.id === d);
|
|
@@ -2572,7 +2572,7 @@ const Lt = ({
|
|
|
2572
2572
|
});
|
|
2573
2573
|
},
|
|
2574
2574
|
[l, j]
|
|
2575
|
-
), ee =
|
|
2575
|
+
), ee = pe(
|
|
2576
2576
|
(d) => {
|
|
2577
2577
|
U(
|
|
2578
2578
|
(u) => u.map((c) => {
|
|
@@ -2593,7 +2593,7 @@ const Lt = ({
|
|
|
2593
2593
|
);
|
|
2594
2594
|
},
|
|
2595
2595
|
[l, j]
|
|
2596
|
-
), N =
|
|
2596
|
+
), N = pe(
|
|
2597
2597
|
(d, u) => {
|
|
2598
2598
|
console.log("FormData Change:", d, u), U((c) => {
|
|
2599
2599
|
const n = c.map((z) => {
|
|
@@ -2629,8 +2629,8 @@ const Lt = ({
|
|
|
2629
2629
|
$theme: t.theme || P,
|
|
2630
2630
|
$isDragOver: w,
|
|
2631
2631
|
onDragOver: T,
|
|
2632
|
-
onDragLeave:
|
|
2633
|
-
onDrop:
|
|
2632
|
+
onDragLeave: $,
|
|
2633
|
+
onDrop: q,
|
|
2634
2634
|
onClick: () => {
|
|
2635
2635
|
var d;
|
|
2636
2636
|
C.current && (C.current.value = ""), (d = C.current) == null || d.click();
|
|
@@ -2788,18 +2788,18 @@ function Pr() {
|
|
|
2788
2788
|
e.exports = s();
|
|
2789
2789
|
})(Ot, (function() {
|
|
2790
2790
|
var a = 1e3, s = 6e4, h = 36e5, b = "millisecond", p = "second", i = "minute", f = "hour", k = "day", S = "week", D = "month", W = "quarter", l = "year", A = "date", I = "Invalid Date", te = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, ne = /\[([^\]]+)]|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, t = { 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(M) {
|
|
2791
|
-
var
|
|
2792
|
-
return "[" + M + (
|
|
2793
|
-
} }, C = function(M,
|
|
2791
|
+
var v = ["th", "st", "nd", "rd"], g = M % 100;
|
|
2792
|
+
return "[" + M + (v[(g - 20) % 10] || v[g] || v[0]) + "]";
|
|
2793
|
+
} }, C = function(M, v, g) {
|
|
2794
2794
|
var T = String(M);
|
|
2795
|
-
return !T || T.length >=
|
|
2795
|
+
return !T || T.length >= v ? M : "" + Array(v + 1 - T.length).join(g) + M;
|
|
2796
2796
|
}, w = { s: C, z: function(M) {
|
|
2797
|
-
var
|
|
2798
|
-
return (
|
|
2799
|
-
}, m: function M(
|
|
2800
|
-
if (
|
|
2801
|
-
var T = 12 * (g.year() -
|
|
2802
|
-
return +(-(T + (g -
|
|
2797
|
+
var v = -M.utcOffset(), g = Math.abs(v), T = Math.floor(g / 60), $ = g % 60;
|
|
2798
|
+
return (v <= 0 ? "+" : "-") + C(T, 2, "0") + ":" + C($, 2, "0");
|
|
2799
|
+
}, m: function M(v, g) {
|
|
2800
|
+
if (v.date() < g.date()) return -M(g, v);
|
|
2801
|
+
var T = 12 * (g.year() - v.year()) + (g.month() - v.month()), $ = v.clone().add(T, D), q = g - $ < 0, L = v.clone().add(T + (q ? -1 : 1), D);
|
|
2802
|
+
return +(-(T + (g - $) / (q ? $ - L : L - $)) || 0);
|
|
2803
2803
|
}, a: function(M) {
|
|
2804
2804
|
return M < 0 ? Math.ceil(M) || 0 : Math.floor(M);
|
|
2805
2805
|
}, p: function(M) {
|
|
@@ -2810,82 +2810,82 @@ function Pr() {
|
|
|
2810
2810
|
_[H] = t;
|
|
2811
2811
|
var U = "$isDayjsObject", j = function(M) {
|
|
2812
2812
|
return M instanceof Q || !(!M || !M[U]);
|
|
2813
|
-
}, Z = function M(
|
|
2814
|
-
var
|
|
2815
|
-
if (
|
|
2816
|
-
if (typeof
|
|
2817
|
-
var
|
|
2818
|
-
_[
|
|
2819
|
-
var L =
|
|
2820
|
-
if (
|
|
2813
|
+
}, Z = function M(v, g, T) {
|
|
2814
|
+
var $;
|
|
2815
|
+
if (!v) return H;
|
|
2816
|
+
if (typeof v == "string") {
|
|
2817
|
+
var q = v.toLowerCase();
|
|
2818
|
+
_[q] && ($ = q), g && (_[q] = g, $ = q);
|
|
2819
|
+
var L = v.split("-");
|
|
2820
|
+
if (!$ && L.length > 1) return M(L[0]);
|
|
2821
2821
|
} else {
|
|
2822
|
-
var X =
|
|
2823
|
-
_[X] =
|
|
2822
|
+
var X = v.name;
|
|
2823
|
+
_[X] = v, $ = X;
|
|
2824
2824
|
}
|
|
2825
|
-
return !T &&
|
|
2826
|
-
}, E = function(M,
|
|
2825
|
+
return !T && $ && (H = $), $ || !T && H;
|
|
2826
|
+
}, E = function(M, v) {
|
|
2827
2827
|
if (j(M)) return M.clone();
|
|
2828
|
-
var g = typeof
|
|
2828
|
+
var g = typeof v == "object" ? v : {};
|
|
2829
2829
|
return g.date = M, g.args = arguments, new Q(g);
|
|
2830
|
-
},
|
|
2831
|
-
|
|
2832
|
-
return E(M, { locale:
|
|
2830
|
+
}, R = w;
|
|
2831
|
+
R.l = Z, R.i = j, R.w = function(M, v) {
|
|
2832
|
+
return E(M, { locale: v.$L, utc: v.$u, x: v.$x, $offset: v.$offset });
|
|
2833
2833
|
};
|
|
2834
2834
|
var Q = (function() {
|
|
2835
2835
|
function M(g) {
|
|
2836
2836
|
this.$L = Z(g.locale, null, !0), this.parse(g), this.$x = this.$x || g.x || {}, this[U] = !0;
|
|
2837
2837
|
}
|
|
2838
|
-
var
|
|
2839
|
-
return
|
|
2838
|
+
var v = M.prototype;
|
|
2839
|
+
return v.parse = function(g) {
|
|
2840
2840
|
this.$d = (function(T) {
|
|
2841
|
-
var
|
|
2842
|
-
if (
|
|
2843
|
-
if (
|
|
2844
|
-
if (
|
|
2845
|
-
if (typeof
|
|
2846
|
-
var L =
|
|
2841
|
+
var $ = T.date, q = T.utc;
|
|
2842
|
+
if ($ === null) return /* @__PURE__ */ new Date(NaN);
|
|
2843
|
+
if (R.u($)) return /* @__PURE__ */ new Date();
|
|
2844
|
+
if ($ instanceof Date) return new Date($);
|
|
2845
|
+
if (typeof $ == "string" && !/Z$/i.test($)) {
|
|
2846
|
+
var L = $.match(te);
|
|
2847
2847
|
if (L) {
|
|
2848
2848
|
var X = L[2] - 1 || 0, ee = (L[7] || "0").substring(0, 3);
|
|
2849
|
-
return
|
|
2849
|
+
return q ? new Date(Date.UTC(L[1], X, L[3] || 1, L[4] || 0, L[5] || 0, L[6] || 0, ee)) : new Date(L[1], X, L[3] || 1, L[4] || 0, L[5] || 0, L[6] || 0, ee);
|
|
2850
2850
|
}
|
|
2851
2851
|
}
|
|
2852
|
-
return new Date(
|
|
2852
|
+
return new Date($);
|
|
2853
2853
|
})(g), this.init();
|
|
2854
|
-
},
|
|
2854
|
+
}, v.init = function() {
|
|
2855
2855
|
var g = this.$d;
|
|
2856
2856
|
this.$y = g.getFullYear(), this.$M = g.getMonth(), this.$D = g.getDate(), this.$W = g.getDay(), this.$H = g.getHours(), this.$m = g.getMinutes(), this.$s = g.getSeconds(), this.$ms = g.getMilliseconds();
|
|
2857
|
-
},
|
|
2858
|
-
return
|
|
2859
|
-
},
|
|
2857
|
+
}, v.$utils = function() {
|
|
2858
|
+
return R;
|
|
2859
|
+
}, v.isValid = function() {
|
|
2860
2860
|
return this.$d.toString() !== I;
|
|
2861
|
-
},
|
|
2862
|
-
var
|
|
2863
|
-
return this.startOf(T) <=
|
|
2864
|
-
},
|
|
2861
|
+
}, v.isSame = function(g, T) {
|
|
2862
|
+
var $ = E(g);
|
|
2863
|
+
return this.startOf(T) <= $ && $ <= this.endOf(T);
|
|
2864
|
+
}, v.isAfter = function(g, T) {
|
|
2865
2865
|
return E(g) < this.startOf(T);
|
|
2866
|
-
},
|
|
2866
|
+
}, v.isBefore = function(g, T) {
|
|
2867
2867
|
return this.endOf(T) < E(g);
|
|
2868
|
-
},
|
|
2869
|
-
return
|
|
2870
|
-
},
|
|
2868
|
+
}, v.$g = function(g, T, $) {
|
|
2869
|
+
return R.u(g) ? this[T] : this.set($, g);
|
|
2870
|
+
}, v.unix = function() {
|
|
2871
2871
|
return Math.floor(this.valueOf() / 1e3);
|
|
2872
|
-
},
|
|
2872
|
+
}, v.valueOf = function() {
|
|
2873
2873
|
return this.$d.getTime();
|
|
2874
|
-
},
|
|
2875
|
-
var
|
|
2876
|
-
var F =
|
|
2877
|
-
return
|
|
2874
|
+
}, v.startOf = function(g, T) {
|
|
2875
|
+
var $ = this, q = !!R.u(T) || T, L = R.p(g), X = function(n, z) {
|
|
2876
|
+
var F = R.w($.$u ? Date.UTC($.$y, z, n) : new Date($.$y, z, n), $);
|
|
2877
|
+
return q ? F : F.endOf(k);
|
|
2878
2878
|
}, ee = function(n, z) {
|
|
2879
|
-
return
|
|
2879
|
+
return R.w($.toDate()[n].apply($.toDate("s"), (q ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(z)), $);
|
|
2880
2880
|
}, N = this.$W, Y = this.$M, B = this.$D, d = "set" + (this.$u ? "UTC" : "");
|
|
2881
2881
|
switch (L) {
|
|
2882
2882
|
case l:
|
|
2883
|
-
return
|
|
2883
|
+
return q ? X(1, 0) : X(31, 11);
|
|
2884
2884
|
case D:
|
|
2885
|
-
return
|
|
2885
|
+
return q ? X(1, Y) : X(0, Y + 1);
|
|
2886
2886
|
case S:
|
|
2887
2887
|
var u = this.$locale().weekStart || 0, c = (N < u ? N + 7 : N) - u;
|
|
2888
|
-
return X(
|
|
2888
|
+
return X(q ? B - c : B + (6 - c), Y);
|
|
2889
2889
|
case k:
|
|
2890
2890
|
case A:
|
|
2891
2891
|
return ee(d + "Hours", 0);
|
|
@@ -2898,76 +2898,76 @@ function Pr() {
|
|
|
2898
2898
|
default:
|
|
2899
2899
|
return this.clone();
|
|
2900
2900
|
}
|
|
2901
|
-
},
|
|
2901
|
+
}, v.endOf = function(g) {
|
|
2902
2902
|
return this.startOf(g, !1);
|
|
2903
|
-
},
|
|
2904
|
-
var
|
|
2905
|
-
if (
|
|
2903
|
+
}, v.$set = function(g, T) {
|
|
2904
|
+
var $, q = R.p(g), L = "set" + (this.$u ? "UTC" : ""), X = ($ = {}, $[k] = L + "Date", $[A] = L + "Date", $[D] = L + "Month", $[l] = L + "FullYear", $[f] = L + "Hours", $[i] = L + "Minutes", $[p] = L + "Seconds", $[b] = L + "Milliseconds", $)[q], ee = q === k ? this.$D + (T - this.$W) : T;
|
|
2905
|
+
if (q === D || q === l) {
|
|
2906
2906
|
var N = this.clone().set(A, 1);
|
|
2907
2907
|
N.$d[X](ee), N.init(), this.$d = N.set(A, Math.min(this.$D, N.daysInMonth())).$d;
|
|
2908
2908
|
} else X && this.$d[X](ee);
|
|
2909
2909
|
return this.init(), this;
|
|
2910
|
-
},
|
|
2910
|
+
}, v.set = function(g, T) {
|
|
2911
2911
|
return this.clone().$set(g, T);
|
|
2912
|
-
},
|
|
2913
|
-
return this[
|
|
2914
|
-
},
|
|
2915
|
-
var
|
|
2912
|
+
}, v.get = function(g) {
|
|
2913
|
+
return this[R.p(g)]();
|
|
2914
|
+
}, v.add = function(g, T) {
|
|
2915
|
+
var $, q = this;
|
|
2916
2916
|
g = Number(g);
|
|
2917
|
-
var L =
|
|
2918
|
-
var B = E(
|
|
2919
|
-
return
|
|
2917
|
+
var L = R.p(T), X = function(Y) {
|
|
2918
|
+
var B = E(q);
|
|
2919
|
+
return R.w(B.date(B.date() + Math.round(Y * g)), q);
|
|
2920
2920
|
};
|
|
2921
2921
|
if (L === D) return this.set(D, this.$M + g);
|
|
2922
2922
|
if (L === l) return this.set(l, this.$y + g);
|
|
2923
2923
|
if (L === k) return X(1);
|
|
2924
2924
|
if (L === S) return X(7);
|
|
2925
|
-
var ee = (
|
|
2926
|
-
return
|
|
2927
|
-
},
|
|
2925
|
+
var ee = ($ = {}, $[i] = s, $[f] = h, $[p] = a, $)[L] || 1, N = this.$d.getTime() + g * ee;
|
|
2926
|
+
return R.w(N, this);
|
|
2927
|
+
}, v.subtract = function(g, T) {
|
|
2928
2928
|
return this.add(-1 * g, T);
|
|
2929
|
-
},
|
|
2930
|
-
var T = this,
|
|
2931
|
-
if (!this.isValid()) return
|
|
2932
|
-
var
|
|
2933
|
-
return z && (z[F] || z(T,
|
|
2929
|
+
}, v.format = function(g) {
|
|
2930
|
+
var T = this, $ = this.$locale();
|
|
2931
|
+
if (!this.isValid()) return $.invalidDate || I;
|
|
2932
|
+
var q = g || "YYYY-MM-DDTHH:mm:ssZ", L = R.z(this), X = this.$H, ee = this.$m, N = this.$M, Y = $.weekdays, B = $.months, d = $.meridiem, u = function(z, F, m, x) {
|
|
2933
|
+
return z && (z[F] || z(T, q)) || m[F].slice(0, x);
|
|
2934
2934
|
}, c = function(z) {
|
|
2935
|
-
return
|
|
2935
|
+
return R.s(X % 12 || 12, z, "0");
|
|
2936
2936
|
}, n = d || function(z, F, m) {
|
|
2937
2937
|
var x = z < 12 ? "AM" : "PM";
|
|
2938
2938
|
return m ? x.toLowerCase() : x;
|
|
2939
2939
|
};
|
|
2940
|
-
return
|
|
2940
|
+
return q.replace(ne, (function(z, F) {
|
|
2941
2941
|
return F || (function(m) {
|
|
2942
2942
|
switch (m) {
|
|
2943
2943
|
case "YY":
|
|
2944
2944
|
return String(T.$y).slice(-2);
|
|
2945
2945
|
case "YYYY":
|
|
2946
|
-
return
|
|
2946
|
+
return R.s(T.$y, 4, "0");
|
|
2947
2947
|
case "M":
|
|
2948
2948
|
return N + 1;
|
|
2949
2949
|
case "MM":
|
|
2950
|
-
return
|
|
2950
|
+
return R.s(N + 1, 2, "0");
|
|
2951
2951
|
case "MMM":
|
|
2952
|
-
return u(
|
|
2952
|
+
return u($.monthsShort, N, B, 3);
|
|
2953
2953
|
case "MMMM":
|
|
2954
2954
|
return u(B, N);
|
|
2955
2955
|
case "D":
|
|
2956
2956
|
return T.$D;
|
|
2957
2957
|
case "DD":
|
|
2958
|
-
return
|
|
2958
|
+
return R.s(T.$D, 2, "0");
|
|
2959
2959
|
case "d":
|
|
2960
2960
|
return String(T.$W);
|
|
2961
2961
|
case "dd":
|
|
2962
|
-
return u(
|
|
2962
|
+
return u($.weekdaysMin, T.$W, Y, 2);
|
|
2963
2963
|
case "ddd":
|
|
2964
|
-
return u(
|
|
2964
|
+
return u($.weekdaysShort, T.$W, Y, 3);
|
|
2965
2965
|
case "dddd":
|
|
2966
2966
|
return Y[T.$W];
|
|
2967
2967
|
case "H":
|
|
2968
2968
|
return String(X);
|
|
2969
2969
|
case "HH":
|
|
2970
|
-
return
|
|
2970
|
+
return R.s(X, 2, "0");
|
|
2971
2971
|
case "h":
|
|
2972
2972
|
return c(1);
|
|
2973
2973
|
case "hh":
|
|
@@ -2979,80 +2979,80 @@ function Pr() {
|
|
|
2979
2979
|
case "m":
|
|
2980
2980
|
return String(ee);
|
|
2981
2981
|
case "mm":
|
|
2982
|
-
return
|
|
2982
|
+
return R.s(ee, 2, "0");
|
|
2983
2983
|
case "s":
|
|
2984
2984
|
return String(T.$s);
|
|
2985
2985
|
case "ss":
|
|
2986
|
-
return
|
|
2986
|
+
return R.s(T.$s, 2, "0");
|
|
2987
2987
|
case "SSS":
|
|
2988
|
-
return
|
|
2988
|
+
return R.s(T.$ms, 3, "0");
|
|
2989
2989
|
case "Z":
|
|
2990
2990
|
return L;
|
|
2991
2991
|
}
|
|
2992
2992
|
return null;
|
|
2993
2993
|
})(z) || L.replace(":", "");
|
|
2994
2994
|
}));
|
|
2995
|
-
},
|
|
2995
|
+
}, v.utcOffset = function() {
|
|
2996
2996
|
return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
|
|
2997
|
-
},
|
|
2998
|
-
var
|
|
2999
|
-
return
|
|
2997
|
+
}, v.diff = function(g, T, $) {
|
|
2998
|
+
var q, L = this, X = R.p(T), ee = E(g), N = (ee.utcOffset() - this.utcOffset()) * s, Y = this - ee, B = function() {
|
|
2999
|
+
return R.m(L, ee);
|
|
3000
3000
|
};
|
|
3001
3001
|
switch (X) {
|
|
3002
3002
|
case l:
|
|
3003
|
-
|
|
3003
|
+
q = B() / 12;
|
|
3004
3004
|
break;
|
|
3005
3005
|
case D:
|
|
3006
|
-
|
|
3006
|
+
q = B();
|
|
3007
3007
|
break;
|
|
3008
3008
|
case W:
|
|
3009
|
-
|
|
3009
|
+
q = B() / 3;
|
|
3010
3010
|
break;
|
|
3011
3011
|
case S:
|
|
3012
|
-
|
|
3012
|
+
q = (Y - N) / 6048e5;
|
|
3013
3013
|
break;
|
|
3014
3014
|
case k:
|
|
3015
|
-
|
|
3015
|
+
q = (Y - N) / 864e5;
|
|
3016
3016
|
break;
|
|
3017
3017
|
case f:
|
|
3018
|
-
|
|
3018
|
+
q = Y / h;
|
|
3019
3019
|
break;
|
|
3020
3020
|
case i:
|
|
3021
|
-
|
|
3021
|
+
q = Y / s;
|
|
3022
3022
|
break;
|
|
3023
3023
|
case p:
|
|
3024
|
-
|
|
3024
|
+
q = Y / a;
|
|
3025
3025
|
break;
|
|
3026
3026
|
default:
|
|
3027
|
-
|
|
3027
|
+
q = Y;
|
|
3028
3028
|
}
|
|
3029
|
-
return
|
|
3030
|
-
},
|
|
3029
|
+
return $ ? q : R.a(q);
|
|
3030
|
+
}, v.daysInMonth = function() {
|
|
3031
3031
|
return this.endOf(D).$D;
|
|
3032
|
-
},
|
|
3032
|
+
}, v.$locale = function() {
|
|
3033
3033
|
return _[this.$L];
|
|
3034
|
-
},
|
|
3034
|
+
}, v.locale = function(g, T) {
|
|
3035
3035
|
if (!g) return this.$L;
|
|
3036
|
-
var
|
|
3037
|
-
return
|
|
3038
|
-
},
|
|
3039
|
-
return
|
|
3040
|
-
},
|
|
3036
|
+
var $ = this.clone(), q = Z(g, T, !0);
|
|
3037
|
+
return q && ($.$L = q), $;
|
|
3038
|
+
}, v.clone = function() {
|
|
3039
|
+
return R.w(this.$d, this);
|
|
3040
|
+
}, v.toDate = function() {
|
|
3041
3041
|
return new Date(this.valueOf());
|
|
3042
|
-
},
|
|
3042
|
+
}, v.toJSON = function() {
|
|
3043
3043
|
return this.isValid() ? this.toISOString() : null;
|
|
3044
|
-
},
|
|
3044
|
+
}, v.toISOString = function() {
|
|
3045
3045
|
return this.$d.toISOString();
|
|
3046
|
-
},
|
|
3046
|
+
}, v.toString = function() {
|
|
3047
3047
|
return this.$d.toUTCString();
|
|
3048
3048
|
}, M;
|
|
3049
3049
|
})(), G = Q.prototype;
|
|
3050
3050
|
return E.prototype = G, [["$ms", b], ["$s", p], ["$m", i], ["$H", f], ["$W", k], ["$M", D], ["$y", l], ["$D", A]].forEach((function(M) {
|
|
3051
|
-
G[M[1]] = function(
|
|
3052
|
-
return this.$g(
|
|
3051
|
+
G[M[1]] = function(v) {
|
|
3052
|
+
return this.$g(v, M[0], M[1]);
|
|
3053
3053
|
};
|
|
3054
|
-
})), E.extend = function(M,
|
|
3055
|
-
return M.$i || (M(
|
|
3054
|
+
})), E.extend = function(M, v) {
|
|
3055
|
+
return M.$i || (M(v, Q, E), M.$i = !0), E;
|
|
3056
3056
|
}, E.locale = Z, E.isDayjs = j, E.unix = function(M) {
|
|
3057
3057
|
return E(1e3 * M);
|
|
3058
3058
|
}, E.en = _[H], E.Ls = _, E.p = {}, E;
|
|
@@ -3166,7 +3166,7 @@ function Jt(e, r) {
|
|
|
3166
3166
|
}
|
|
3167
3167
|
function Gt(e, r, a = {}) {
|
|
3168
3168
|
const { eventsEmit: s } = r || {};
|
|
3169
|
-
return
|
|
3169
|
+
return be.useMemo(
|
|
3170
3170
|
() => e.map((h) => {
|
|
3171
3171
|
if (h.render) return h;
|
|
3172
3172
|
switch (h.type) {
|
|
@@ -3200,11 +3200,11 @@ function Gt(e, r, a = {}) {
|
|
|
3200
3200
|
...A,
|
|
3201
3201
|
...l
|
|
3202
3202
|
};
|
|
3203
|
-
if (
|
|
3204
|
-
return
|
|
3203
|
+
if (be.isValidElement(S))
|
|
3204
|
+
return be.cloneElement(S, te);
|
|
3205
3205
|
if (typeof S == "function") {
|
|
3206
3206
|
const C = S;
|
|
3207
|
-
return
|
|
3207
|
+
return be.createElement(C, te);
|
|
3208
3208
|
}
|
|
3209
3209
|
return h.fallback ?? null;
|
|
3210
3210
|
}
|
|
@@ -3577,7 +3577,7 @@ const Pt = J.div`
|
|
|
3577
3577
|
default:
|
|
3578
3578
|
return { minWidth: 80, textAlign: "left" };
|
|
3579
3579
|
}
|
|
3580
|
-
},
|
|
3580
|
+
}, Rr = J.th`
|
|
3581
3581
|
background: ${({ theme: e }) => e.colors.disabledBackground};
|
|
3582
3582
|
color: ${({ theme: e }) => e.colors.text};
|
|
3583
3583
|
font-weight: 600;
|
|
@@ -3587,7 +3587,7 @@ const Pt = J.div`
|
|
|
3587
3587
|
min-width: 48px;
|
|
3588
3588
|
white-space: nowrap;
|
|
3589
3589
|
/* 移除默认的 text-align: center,让每列使用自己的对齐方式 */
|
|
3590
|
-
`,
|
|
3590
|
+
`, qr = J.td`
|
|
3591
3591
|
padding: 0.5rem 0.75rem;
|
|
3592
3592
|
border-bottom: 1px solid ${({ theme: e }) => e.colors.border};
|
|
3593
3593
|
color: ${({ theme: e }) => e.colors.text};
|
|
@@ -3600,7 +3600,7 @@ const Pt = J.div`
|
|
|
3600
3600
|
&:hover {
|
|
3601
3601
|
background: ${({ theme: e }) => e.colors.disabledBackground};
|
|
3602
3602
|
}
|
|
3603
|
-
`, ea =
|
|
3603
|
+
`, ea = be.forwardRef(
|
|
3604
3604
|
(e, r) => /* @__PURE__ */ o(Qt, { ...e, ref: r })
|
|
3605
3605
|
), ra = `
|
|
3606
3606
|
.sticky-shadow-left {
|
|
@@ -3616,8 +3616,8 @@ if (typeof window < "u" && !document.getElementById("dynamic-table-sticky-shadow
|
|
|
3616
3616
|
const e = document.createElement("style");
|
|
3617
3617
|
e.id = "dynamic-table-sticky-shadow", e.innerHTML = ra, document.head.appendChild(e);
|
|
3618
3618
|
}
|
|
3619
|
-
const ta =
|
|
3620
|
-
var u, c, n, z, F, m, x, re, xe, De, ze, _e, Ae, We,
|
|
3619
|
+
const ta = be.memo((e) => {
|
|
3620
|
+
var u, c, n, z, F, m, x, re, xe, De, ze, _e, Ae, We, Re, qe, Le, Oe, je, Be;
|
|
3621
3621
|
const r = e.dataSource || [], a = e.columns || [], s = e.size || "md", h = e.level || 0, b = Fe(), p = $e(
|
|
3622
3622
|
// 基础:默认主题 + useTheme的配置
|
|
3623
3623
|
$e({ theme: P, mode: "light" }, b),
|
|
@@ -3639,62 +3639,62 @@ const ta = me.memo((e) => {
|
|
|
3639
3639
|
customizeComponents: e.customizeComponents
|
|
3640
3640
|
},
|
|
3641
3641
|
e.styles
|
|
3642
|
-
), [
|
|
3643
|
-
(
|
|
3642
|
+
), [R, Q] = ce([]), G = pe(
|
|
3643
|
+
(y, ae) => {
|
|
3644
3644
|
var de;
|
|
3645
3645
|
Q((le) => {
|
|
3646
|
-
let
|
|
3647
|
-
return ae ?
|
|
3646
|
+
let he;
|
|
3647
|
+
return ae ? he = [...le, y] : he = le.filter((we) => we !== y), he;
|
|
3648
3648
|
});
|
|
3649
|
-
const se = ae ? [...
|
|
3649
|
+
const se = ae ? [...R, y] : R.filter((le) => le !== y), oe = r.filter((le) => se.includes(le.id));
|
|
3650
3650
|
(de = e.eventsEmit) == null || de.call(e, "table_row_select", {
|
|
3651
|
-
rowId:
|
|
3651
|
+
rowId: y,
|
|
3652
3652
|
checked: ae,
|
|
3653
3653
|
selectedItems: oe
|
|
3654
3654
|
});
|
|
3655
3655
|
},
|
|
3656
|
-
[
|
|
3656
|
+
[R, r, e.eventsEmit]
|
|
3657
3657
|
), M = Me(
|
|
3658
|
-
() => r.length > 0 &&
|
|
3659
|
-
[r.length,
|
|
3660
|
-
),
|
|
3661
|
-
(
|
|
3658
|
+
() => r.length > 0 && R.length === r.length,
|
|
3659
|
+
[r.length, R.length]
|
|
3660
|
+
), v = pe(
|
|
3661
|
+
(y) => {
|
|
3662
3662
|
var oe;
|
|
3663
|
-
const ae =
|
|
3663
|
+
const ae = y ? r.map((de) => de.id) : [];
|
|
3664
3664
|
Q(ae);
|
|
3665
|
-
const se =
|
|
3665
|
+
const se = y ? r : [];
|
|
3666
3666
|
(oe = e.eventsEmit) == null || oe.call(e, "table_select_all", {
|
|
3667
|
-
checked:
|
|
3667
|
+
checked: y,
|
|
3668
3668
|
selectedItems: se,
|
|
3669
3669
|
totalCount: r.length
|
|
3670
3670
|
});
|
|
3671
3671
|
},
|
|
3672
3672
|
[r, e.eventsEmit]
|
|
3673
|
-
), [g, T] = ce(1),
|
|
3673
|
+
), [g, T] = ce(1), $ = typeof D == "number" && D > 0 ? D : S ?? (e.isSubTable ? 5 : 10), q = f || r.length;
|
|
3674
3674
|
Me(
|
|
3675
|
-
() => Math.ceil(
|
|
3676
|
-
[
|
|
3675
|
+
() => Math.ceil(q / $),
|
|
3676
|
+
[q, $]
|
|
3677
3677
|
);
|
|
3678
3678
|
const L = Me(() => {
|
|
3679
3679
|
if (e.viewBehavior !== "pagination") return r;
|
|
3680
|
-
const
|
|
3680
|
+
const y = (g - 1) * $, ae = y + $;
|
|
3681
3681
|
if (r.some((oe) => typeof oe.__absIndex == "number")) {
|
|
3682
3682
|
const oe = [];
|
|
3683
|
-
for (let de =
|
|
3684
|
-
const le = r.find((
|
|
3683
|
+
for (let de = y; de < ae; de++) {
|
|
3684
|
+
const le = r.find((he) => he.__absIndex === de);
|
|
3685
3685
|
le && oe.push(le);
|
|
3686
3686
|
}
|
|
3687
3687
|
return oe;
|
|
3688
3688
|
}
|
|
3689
|
-
return r.slice(
|
|
3690
|
-
}, [e.viewBehavior, r, g,
|
|
3691
|
-
(
|
|
3689
|
+
return r.slice(y, ae);
|
|
3690
|
+
}, [e.viewBehavior, r, g, $]), X = pe(
|
|
3691
|
+
(y) => {
|
|
3692
3692
|
var ae;
|
|
3693
|
-
if (T(
|
|
3694
|
-
const se = (
|
|
3693
|
+
if (T(y), f && k && i) {
|
|
3694
|
+
const se = (y - 1) * $, oe = Math.floor(se / k) + 1;
|
|
3695
3695
|
(!l.has(oe) || se >= r.length) && (A((le) => {
|
|
3696
|
-
const
|
|
3697
|
-
return
|
|
3696
|
+
const he = new Set(le);
|
|
3697
|
+
return he.add(oe), he;
|
|
3698
3698
|
}), (ae = e.eventsEmit) == null || ae.call(
|
|
3699
3699
|
e,
|
|
3700
3700
|
"pagination:request_merge_data",
|
|
@@ -3709,41 +3709,41 @@ const ta = me.memo((e) => {
|
|
|
3709
3709
|
));
|
|
3710
3710
|
}
|
|
3711
3711
|
},
|
|
3712
|
-
[f, k, i,
|
|
3713
|
-
), ee =
|
|
3712
|
+
[f, k, i, $, r.length, e.eventsEmit, l]
|
|
3713
|
+
), ee = pe((y) => {
|
|
3714
3714
|
w((ae) => {
|
|
3715
3715
|
const se = new Set(ae);
|
|
3716
|
-
return se.has(
|
|
3716
|
+
return se.has(y) ? se.delete(y) : (se.add(y), setTimeout(() => {
|
|
3717
3717
|
var oe, de;
|
|
3718
3718
|
(de = e.eventsEmit) == null || de.call(e, "table_expand", {
|
|
3719
|
-
tableId:
|
|
3720
|
-
children: ((oe = r.find((le) => le.id ===
|
|
3719
|
+
tableId: y,
|
|
3720
|
+
children: ((oe = r.find((le) => le.id === y)) == null ? void 0 : oe.children) || []
|
|
3721
3721
|
});
|
|
3722
3722
|
}, 0)), se;
|
|
3723
3723
|
});
|
|
3724
|
-
}, [r, e.eventsEmit]), N =
|
|
3725
|
-
(
|
|
3724
|
+
}, [r, e.eventsEmit]), N = pe((y) => y.hasOwnProperty("children") && y.children !== void 0, []), Y = pe(
|
|
3725
|
+
(y) => C.has(y),
|
|
3726
3726
|
[C]
|
|
3727
|
-
), B =
|
|
3728
|
-
const
|
|
3729
|
-
|
|
3727
|
+
), B = pe(() => {
|
|
3728
|
+
const y = H.current;
|
|
3729
|
+
y && (e.isSubTable || (te(y.scrollLeft > 0), t(y.scrollLeft < y.scrollWidth - y.offsetWidth - 1)));
|
|
3730
3730
|
}, [e.isSubTable]);
|
|
3731
3731
|
ke(() => {
|
|
3732
|
-
const
|
|
3733
|
-
if (
|
|
3734
|
-
return B(),
|
|
3735
|
-
|
|
3732
|
+
const y = H.current;
|
|
3733
|
+
if (y)
|
|
3734
|
+
return B(), y.addEventListener("scroll", B), window.addEventListener("resize", B), () => {
|
|
3735
|
+
y.removeEventListener("scroll", B), window.removeEventListener("resize", B);
|
|
3736
3736
|
};
|
|
3737
3737
|
}, [B]), ke(() => {
|
|
3738
|
-
const
|
|
3739
|
-
if (!
|
|
3738
|
+
const y = H.current;
|
|
3739
|
+
if (!y) return;
|
|
3740
3740
|
const ae = () => {
|
|
3741
|
-
const oe =
|
|
3741
|
+
const oe = y.getBoundingClientRect();
|
|
3742
3742
|
j(oe.width);
|
|
3743
3743
|
};
|
|
3744
3744
|
ae(), window.addEventListener("resize", ae);
|
|
3745
3745
|
const se = new ResizeObserver(ae);
|
|
3746
|
-
return se.observe(
|
|
3746
|
+
return se.observe(y), () => {
|
|
3747
3747
|
window.removeEventListener("resize", ae), se.disconnect();
|
|
3748
3748
|
};
|
|
3749
3749
|
}, []);
|
|
@@ -3826,7 +3826,7 @@ const ta = me.memo((e) => {
|
|
|
3826
3826
|
},
|
|
3827
3827
|
children: /* @__PURE__ */ O("tr", { children: [
|
|
3828
3828
|
e.allowMultiSelect && /* @__PURE__ */ o(
|
|
3829
|
-
|
|
3829
|
+
Rr,
|
|
3830
3830
|
{
|
|
3831
3831
|
theme: p.theme || P,
|
|
3832
3832
|
style: {
|
|
@@ -3845,18 +3845,18 @@ const ta = me.memo((e) => {
|
|
|
3845
3845
|
{
|
|
3846
3846
|
type: "checkbox",
|
|
3847
3847
|
checked: M,
|
|
3848
|
-
onChange: (
|
|
3848
|
+
onChange: (y) => v(y.target.checked)
|
|
3849
3849
|
}
|
|
3850
3850
|
)
|
|
3851
3851
|
}
|
|
3852
3852
|
),
|
|
3853
|
-
E.map((
|
|
3854
|
-
var le,
|
|
3853
|
+
E.map((y, ae) => {
|
|
3854
|
+
var le, he, we, Se;
|
|
3855
3855
|
const se = ae === 0, oe = ae === E.length - 1, de = se ? {
|
|
3856
3856
|
position: "sticky",
|
|
3857
3857
|
left: e.allowMultiSelect ? 40 : 0,
|
|
3858
3858
|
zIndex: 2,
|
|
3859
|
-
background: ((
|
|
3859
|
+
background: ((he = (le = p.theme) == null ? void 0 : le.colors) == null ? void 0 : he.disabledBackground) || "#f5f5f5"
|
|
3860
3860
|
} : oe ? {
|
|
3861
3861
|
position: "sticky",
|
|
3862
3862
|
right: 0,
|
|
@@ -3864,49 +3864,61 @@ const ta = me.memo((e) => {
|
|
|
3864
3864
|
background: ((Se = (we = p.theme) == null ? void 0 : we.colors) == null ? void 0 : Se.disabledBackground) || "#f5f5f5"
|
|
3865
3865
|
} : {};
|
|
3866
3866
|
return /* @__PURE__ */ o(
|
|
3867
|
-
|
|
3867
|
+
Rr,
|
|
3868
3868
|
{
|
|
3869
3869
|
theme: p.theme || P,
|
|
3870
3870
|
style: {
|
|
3871
|
-
...Wr(
|
|
3871
|
+
...Wr(y.type),
|
|
3872
3872
|
...de,
|
|
3873
|
-
...
|
|
3874
|
-
maxWidth: typeof
|
|
3873
|
+
...y.maxWidth !== void 0 ? {
|
|
3874
|
+
maxWidth: typeof y.maxWidth == "number" ? `${y.maxWidth}px` : y.maxWidth
|
|
3875
3875
|
} : {}
|
|
3876
3876
|
},
|
|
3877
3877
|
className: se && I ? "sticky-shadow-left" : oe && ne ? "sticky-shadow-right" : "",
|
|
3878
|
-
children: Kt(
|
|
3878
|
+
children: Kt(y)
|
|
3879
3879
|
},
|
|
3880
|
-
|
|
3880
|
+
y.id
|
|
3881
3881
|
);
|
|
3882
3882
|
})
|
|
3883
3883
|
] })
|
|
3884
3884
|
}
|
|
3885
3885
|
),
|
|
3886
|
-
/* @__PURE__ */ o("tbody", { children: L.map((
|
|
3887
|
-
var le,
|
|
3888
|
-
const se = e.rowProps ? e.rowProps(
|
|
3889
|
-
return /* @__PURE__ */ O(
|
|
3886
|
+
/* @__PURE__ */ o("tbody", { children: L.map((y, ae) => {
|
|
3887
|
+
var le, he, we, Se, Ye, fe, Ce, Ie, tr, ar, nr, or, sr, lr, ir, dr, cr, ur;
|
|
3888
|
+
const se = e.rowProps ? e.rowProps(y, ae) : {}, oe = N(y), de = Y(y.id) || y.__autoExpand && oe;
|
|
3889
|
+
return /* @__PURE__ */ O(be.Fragment, { children: [
|
|
3890
3890
|
/* @__PURE__ */ O(
|
|
3891
3891
|
ea,
|
|
3892
3892
|
{
|
|
3893
3893
|
theme: p.theme || P,
|
|
3894
3894
|
...se,
|
|
3895
|
-
className: `${se.className || ""} ${(le = e.addingIds) != null && le.includes(
|
|
3895
|
+
className: `${se.className || ""} ${(le = e.addingIds) != null && le.includes(y.id) ? "adding-row" : ""} ${y.removing ? "removing-row" : ""}`,
|
|
3896
|
+
style: {
|
|
3897
|
+
...se.style,
|
|
3898
|
+
...y.removing ? {
|
|
3899
|
+
opacity: 0,
|
|
3900
|
+
transform: "translateX(100px)",
|
|
3901
|
+
transition: "opacity 0.3s ease, transform 0.3s ease"
|
|
3902
|
+
} : {}
|
|
3903
|
+
},
|
|
3896
3904
|
onAnimationEnd: (V) => {
|
|
3897
|
-
var
|
|
3898
|
-
V.animationName === "row-slide-in" && ((
|
|
3905
|
+
var ue, ye;
|
|
3906
|
+
V.animationName === "row-slide-in" && ((ue = e.addingIds) != null && ue.includes(y.id)) && ((ye = e.onRowAddAnimationComplete) == null || ye.call(e, y.id));
|
|
3907
|
+
},
|
|
3908
|
+
onTransitionEnd: (V) => {
|
|
3909
|
+
var ue;
|
|
3910
|
+
y.removing && V.propertyName === "transform" && ((ue = e.onRowAnimationComplete) == null || ue.call(e, y.id));
|
|
3899
3911
|
},
|
|
3900
3912
|
children: [
|
|
3901
3913
|
e.allowMultiSelect && /* @__PURE__ */ o(
|
|
3902
|
-
|
|
3914
|
+
qr,
|
|
3903
3915
|
{
|
|
3904
3916
|
theme: p.theme || P,
|
|
3905
3917
|
style: {
|
|
3906
3918
|
position: "sticky",
|
|
3907
3919
|
left: 0,
|
|
3908
3920
|
zIndex: 2,
|
|
3909
|
-
background: ((we = (
|
|
3921
|
+
background: ((we = (he = p.theme) == null ? void 0 : he.colors) == null ? void 0 : we.background) || "#fff",
|
|
3910
3922
|
width: 40,
|
|
3911
3923
|
minWidth: 40,
|
|
3912
3924
|
maxWidth: 40,
|
|
@@ -3917,15 +3929,15 @@ const ta = me.memo((e) => {
|
|
|
3917
3929
|
"input",
|
|
3918
3930
|
{
|
|
3919
3931
|
type: "checkbox",
|
|
3920
|
-
checked:
|
|
3921
|
-
onChange: (V) => G(
|
|
3932
|
+
checked: R.includes(y.id),
|
|
3933
|
+
onChange: (V) => G(y.id, V.target.checked)
|
|
3922
3934
|
}
|
|
3923
3935
|
)
|
|
3924
3936
|
}
|
|
3925
3937
|
),
|
|
3926
|
-
E.map((V,
|
|
3938
|
+
E.map((V, ue) => {
|
|
3927
3939
|
var hr, pr, fr, mr, br;
|
|
3928
|
-
const ye =
|
|
3940
|
+
const ye = ue === 0, Ue = ue === E.length - 1, Ve = ye ? {
|
|
3929
3941
|
position: "sticky",
|
|
3930
3942
|
left: e.allowMultiSelect ? 40 : 0,
|
|
3931
3943
|
zIndex: 1,
|
|
@@ -3935,7 +3947,7 @@ const ta = me.memo((e) => {
|
|
|
3935
3947
|
right: 0,
|
|
3936
3948
|
zIndex: 1,
|
|
3937
3949
|
background: ((mr = (fr = p.theme) == null ? void 0 : fr.colors) == null ? void 0 : mr.background) || "#fff"
|
|
3938
|
-
} : {}, ge = ((br =
|
|
3950
|
+
} : {}, ge = ((br = y.data) == null ? void 0 : br.filter((Ee) => Ee.columnId === V.id)) || [], Xr = Object.assign(
|
|
3939
3951
|
{},
|
|
3940
3952
|
Wr(V.type),
|
|
3941
3953
|
Ve,
|
|
@@ -3948,7 +3960,7 @@ const ta = me.memo((e) => {
|
|
|
3948
3960
|
/* @__PURE__ */ o(
|
|
3949
3961
|
"button",
|
|
3950
3962
|
{
|
|
3951
|
-
onClick: () => ee(
|
|
3963
|
+
onClick: () => ee(y.id),
|
|
3952
3964
|
style: {
|
|
3953
3965
|
background: "none",
|
|
3954
3966
|
border: "none",
|
|
@@ -3966,7 +3978,7 @@ const ta = me.memo((e) => {
|
|
|
3966
3978
|
" ",
|
|
3967
3979
|
ge.length > 0 ? V.type === "action" ? V.render ? V.render(
|
|
3968
3980
|
ge.length > 1 ? ge.map((ve) => ve) : ge[0],
|
|
3969
|
-
|
|
3981
|
+
y,
|
|
3970
3982
|
ge.length > 1 ? void 0 : ge[0]
|
|
3971
3983
|
) : null : ge.map((ve, Qe) => /* @__PURE__ */ o(
|
|
3972
3984
|
"span",
|
|
@@ -3979,7 +3991,7 @@ const ta = me.memo((e) => {
|
|
|
3979
3991
|
textOverflow: "ellipsis",
|
|
3980
3992
|
verticalAlign: "middle"
|
|
3981
3993
|
},
|
|
3982
|
-
children: V.render ? V.render(ve.value,
|
|
3994
|
+
children: V.render ? V.render(ve.value, y, ve) : /* @__PURE__ */ o("span", { children: ve.value })
|
|
3983
3995
|
},
|
|
3984
3996
|
Qe
|
|
3985
3997
|
)) : null
|
|
@@ -3988,7 +4000,7 @@ const ta = me.memo((e) => {
|
|
|
3988
4000
|
" ",
|
|
3989
4001
|
ge.length > 0 ? V.type === "action" ? V.render ? V.render(
|
|
3990
4002
|
ge.length > 1 ? ge.map((ve) => ve) : ge[0],
|
|
3991
|
-
|
|
4003
|
+
y,
|
|
3992
4004
|
ge.length > 1 ? void 0 : ge[0]
|
|
3993
4005
|
) : null : ge.map((ve, Qe) => /* @__PURE__ */ o(
|
|
3994
4006
|
"span",
|
|
@@ -4001,14 +4013,14 @@ const ta = me.memo((e) => {
|
|
|
4001
4013
|
textOverflow: "ellipsis",
|
|
4002
4014
|
verticalAlign: "middle"
|
|
4003
4015
|
},
|
|
4004
|
-
children: V.render ? V.render(ve.value,
|
|
4016
|
+
children: V.render ? V.render(ve.value, y, ve) : /* @__PURE__ */ o("span", { children: ve.value })
|
|
4005
4017
|
},
|
|
4006
4018
|
Qe
|
|
4007
4019
|
)) : null
|
|
4008
4020
|
] });
|
|
4009
4021
|
};
|
|
4010
4022
|
return /* @__PURE__ */ o(
|
|
4011
|
-
|
|
4023
|
+
qr,
|
|
4012
4024
|
{
|
|
4013
4025
|
theme: p.theme || P,
|
|
4014
4026
|
style: Xr,
|
|
@@ -4021,7 +4033,7 @@ const ta = me.memo((e) => {
|
|
|
4021
4033
|
]
|
|
4022
4034
|
}
|
|
4023
4035
|
),
|
|
4024
|
-
oe && de &&
|
|
4036
|
+
oe && de && y.children !== void 0 && /* @__PURE__ */ o(
|
|
4025
4037
|
"tr",
|
|
4026
4038
|
{
|
|
4027
4039
|
className: " relative ",
|
|
@@ -4052,7 +4064,7 @@ const ta = me.memo((e) => {
|
|
|
4052
4064
|
boxSizing: "border-box"
|
|
4053
4065
|
},
|
|
4054
4066
|
children: [
|
|
4055
|
-
|
|
4067
|
+
y.tableLoading && /* @__PURE__ */ o(
|
|
4056
4068
|
"div",
|
|
4057
4069
|
{
|
|
4058
4070
|
style: {
|
|
@@ -4084,7 +4096,7 @@ const ta = me.memo((e) => {
|
|
|
4084
4096
|
style: {
|
|
4085
4097
|
width: 24,
|
|
4086
4098
|
height: 24,
|
|
4087
|
-
border: `2px solid ${((Ce = (
|
|
4099
|
+
border: `2px solid ${((Ce = (fe = p.theme) == null ? void 0 : fe.colors) == null ? void 0 : Ce.border) || "#d1d5db"}`,
|
|
4088
4100
|
borderTop: `2px solid ${((tr = (Ie = p.theme) == null ? void 0 : Ie.colors) == null ? void 0 : tr.primary) || "#2563eb"}`,
|
|
4089
4101
|
borderRadius: "50%",
|
|
4090
4102
|
animation: "spin 1s linear infinite"
|
|
@@ -4107,7 +4119,7 @@ const ta = me.memo((e) => {
|
|
|
4107
4119
|
alignItems: "center",
|
|
4108
4120
|
marginBottom: 8
|
|
4109
4121
|
},
|
|
4110
|
-
children: e.subTableConfig.toolbar.map((V,
|
|
4122
|
+
children: e.subTableConfig.toolbar.map((V, ue) => {
|
|
4111
4123
|
const Ue = {
|
|
4112
4124
|
primary: "primary",
|
|
4113
4125
|
error: "danger",
|
|
@@ -4122,12 +4134,12 @@ const ta = me.memo((e) => {
|
|
|
4122
4134
|
onClick: () => {
|
|
4123
4135
|
var Ve;
|
|
4124
4136
|
return (Ve = e.eventsEmit) == null ? void 0 : Ve.call(e, "table_action_add", {
|
|
4125
|
-
tableId:
|
|
4137
|
+
tableId: y.id,
|
|
4126
4138
|
action: V
|
|
4127
4139
|
});
|
|
4128
4140
|
}
|
|
4129
4141
|
},
|
|
4130
|
-
|
|
4142
|
+
ue
|
|
4131
4143
|
);
|
|
4132
4144
|
})
|
|
4133
4145
|
}
|
|
@@ -4153,22 +4165,22 @@ const ta = me.memo((e) => {
|
|
|
4153
4165
|
ta,
|
|
4154
4166
|
{
|
|
4155
4167
|
columns: ((sr = e.subTableConfig) == null ? void 0 : sr.columns) || [],
|
|
4156
|
-
dataSource:
|
|
4168
|
+
dataSource: y.children || [],
|
|
4157
4169
|
isSubTable: !0,
|
|
4158
4170
|
isPending: (V) => {
|
|
4159
|
-
var
|
|
4160
|
-
return ((ye = (
|
|
4171
|
+
var ue, ye;
|
|
4172
|
+
return ((ye = (ue = e.subTablePendingIds) == null ? void 0 : ue[y.id]) == null ? void 0 : ye.includes(V)) || !1;
|
|
4161
4173
|
},
|
|
4162
4174
|
onRowAnimationComplete: (V) => {
|
|
4163
|
-
var
|
|
4164
|
-
(
|
|
4175
|
+
var ue;
|
|
4176
|
+
(ue = e.onSubTableRowAnimationComplete) == null || ue.call(e, y.id, V), e.eventsEmit && e.eventsEmit("_internal:subtable_animation_complete", {
|
|
4165
4177
|
rowId: V,
|
|
4166
|
-
tableId:
|
|
4178
|
+
tableId: y.id
|
|
4167
4179
|
});
|
|
4168
4180
|
},
|
|
4169
|
-
eventsEmit: (V,
|
|
4181
|
+
eventsEmit: (V, ue) => {
|
|
4170
4182
|
var ye;
|
|
4171
|
-
(ye = e.eventsEmit) == null || ye.call(e, V, { ...
|
|
4183
|
+
(ye = e.eventsEmit) == null || ye.call(e, V, { ...ue, tableId: y.id });
|
|
4172
4184
|
},
|
|
4173
4185
|
allowMultiSelect: (lr = e.subTableConfig) == null ? void 0 : lr.allowMultiSelect,
|
|
4174
4186
|
size: e.size,
|
|
@@ -4193,7 +4205,7 @@ const ta = me.memo((e) => {
|
|
|
4193
4205
|
)
|
|
4194
4206
|
}
|
|
4195
4207
|
)
|
|
4196
|
-
] },
|
|
4208
|
+
] }, y.id ?? ae);
|
|
4197
4209
|
}) })
|
|
4198
4210
|
]
|
|
4199
4211
|
}
|
|
@@ -4217,19 +4229,19 @@ const ta = me.memo((e) => {
|
|
|
4217
4229
|
it,
|
|
4218
4230
|
{
|
|
4219
4231
|
current: g,
|
|
4220
|
-
pageSize:
|
|
4221
|
-
total:
|
|
4232
|
+
pageSize: $,
|
|
4233
|
+
total: q,
|
|
4222
4234
|
onChange: X,
|
|
4223
|
-
onPageSizeChange: (
|
|
4235
|
+
onPageSizeChange: (y) => {
|
|
4224
4236
|
var ae;
|
|
4225
|
-
T(1), W(
|
|
4237
|
+
T(1), W(y), f && k && i && e.eventsEmit && (A(/* @__PURE__ */ new Set()), e.eventsEmit(
|
|
4226
4238
|
"pagination:request_merge_data",
|
|
4227
4239
|
{
|
|
4228
4240
|
viewId: i,
|
|
4229
4241
|
request: { pageNo: 1, pageSize: k }
|
|
4230
4242
|
},
|
|
4231
4243
|
void 0
|
|
4232
|
-
)), (ae = e.eventsEmit) == null || ae.call(e, "pagination:pageSizeChange", { viewId: i, pageSize:
|
|
4244
|
+
)), (ae = e.eventsEmit) == null || ae.call(e, "pagination:pageSizeChange", { viewId: i, pageSize: y });
|
|
4233
4245
|
},
|
|
4234
4246
|
showSizeChanger: !0,
|
|
4235
4247
|
pageSizeOptions: [5, 10, 20, 30, 50],
|
|
@@ -4238,7 +4250,7 @@ const ta = me.memo((e) => {
|
|
|
4238
4250
|
background: ((De = (xe = p.theme) == null ? void 0 : xe.colors) == null ? void 0 : De.background) || "#fff",
|
|
4239
4251
|
text: ((_e = (ze = p.theme) == null ? void 0 : ze.colors) == null ? void 0 : _e.text) || "#222",
|
|
4240
4252
|
border: ((We = (Ae = p.theme) == null ? void 0 : Ae.colors) == null ? void 0 : We.border) || "#d1d5db",
|
|
4241
|
-
disabledBackground: ((
|
|
4253
|
+
disabledBackground: ((qe = (Re = p.theme) == null ? void 0 : Re.colors) == null ? void 0 : qe.disabledBackground) || "#f5f5f5",
|
|
4242
4254
|
primary: ((Oe = (Le = p.theme) == null ? void 0 : Le.colors) == null ? void 0 : Oe.primary) || "#2563eb"
|
|
4243
4255
|
},
|
|
4244
4256
|
space: { radius: ((Be = (je = p.theme) == null ? void 0 : je.space) == null ? void 0 : Be.radius) || "6px" }
|
|
@@ -4470,35 +4482,35 @@ const ta = me.memo((e) => {
|
|
|
4470
4482
|
const C = Fe(), w = $e(
|
|
4471
4483
|
$e({ theme: P, mode: "light" }, C),
|
|
4472
4484
|
te
|
|
4473
|
-
), [H, _] = ce(a), [U, j] = ce(""), [Z, E] = ce(l || {}),
|
|
4485
|
+
), [H, _] = ce(a), [U, j] = ce(""), [Z, E] = ce(l || {}), R = l !== void 0 ? l : Z, Q = r !== void 0 ? r : H, G = (N) => {
|
|
4474
4486
|
r === void 0 && _(N), s == null || s(N);
|
|
4475
|
-
},
|
|
4476
|
-
const B = { ...
|
|
4487
|
+
}, v = k || ((N, Y) => N ? Y.label.toLowerCase().includes(N.toLowerCase()) : !0), g = Me(() => e.filter((N) => v(U, N)), [e, U, v]), T = Me(() => e.filter((N) => Q.includes(N.key)), [e, Q]), $ = (N, Y) => {
|
|
4488
|
+
const B = { ...R[N], ...Y }, d = { ...R, [N]: B };
|
|
4477
4489
|
l === void 0 && E(d), W == null || W(N, B);
|
|
4478
|
-
},
|
|
4490
|
+
}, q = (N) => {
|
|
4479
4491
|
const Y = Q.filter((B) => B !== N.key);
|
|
4480
4492
|
if (G(Y), l === void 0) {
|
|
4481
|
-
if (
|
|
4482
|
-
const B = { ...
|
|
4493
|
+
if (R[N.key]) {
|
|
4494
|
+
const B = { ...R };
|
|
4483
4495
|
delete B[N.key], E(B);
|
|
4484
4496
|
}
|
|
4485
4497
|
} else
|
|
4486
|
-
|
|
4498
|
+
R[N.key] && (W == null || W(N.key, void 0));
|
|
4487
4499
|
};
|
|
4488
4500
|
ke(() => {
|
|
4489
4501
|
if (l === void 0) {
|
|
4490
|
-
const N = new Set(Q), Y = Object.keys(
|
|
4502
|
+
const N = new Set(Q), Y = Object.keys(R).filter(
|
|
4491
4503
|
(B) => !N.has(B)
|
|
4492
4504
|
);
|
|
4493
4505
|
if (Y.length > 0) {
|
|
4494
|
-
const B = { ...
|
|
4506
|
+
const B = { ...R };
|
|
4495
4507
|
Y.forEach((d) => {
|
|
4496
4508
|
delete B[d];
|
|
4497
4509
|
}), E(B);
|
|
4498
4510
|
}
|
|
4499
4511
|
} else {
|
|
4500
4512
|
const N = new Set(Q);
|
|
4501
|
-
Object.keys(
|
|
4513
|
+
Object.keys(R).filter(
|
|
4502
4514
|
(B) => !N.has(B)
|
|
4503
4515
|
).forEach((B) => {
|
|
4504
4516
|
W == null || W(B, void 0);
|
|
@@ -4564,7 +4576,7 @@ const ta = me.memo((e) => {
|
|
|
4564
4576
|
{
|
|
4565
4577
|
$theme: w.theme || P,
|
|
4566
4578
|
onClick: (d) => {
|
|
4567
|
-
d.stopPropagation(),
|
|
4579
|
+
d.stopPropagation(), q(N);
|
|
4568
4580
|
},
|
|
4569
4581
|
disabled: !0,
|
|
4570
4582
|
children: "已添加"
|
|
@@ -4594,7 +4606,7 @@ const ta = me.memo((e) => {
|
|
|
4594
4606
|
] }),
|
|
4595
4607
|
/* @__PURE__ */ o(jr, { children: T.length === 0 ? /* @__PURE__ */ o(Ir, { $theme: w.theme || P, children: "暂无已选项" }) : T.map((N) => {
|
|
4596
4608
|
var d, u, c;
|
|
4597
|
-
const Y =
|
|
4609
|
+
const Y = R[N.key] || {}, B = (n) => $(N.key, n);
|
|
4598
4610
|
return /* @__PURE__ */ O(
|
|
4599
4611
|
Br,
|
|
4600
4612
|
{
|
|
@@ -4611,7 +4623,7 @@ const ta = me.memo((e) => {
|
|
|
4611
4623
|
marginLeft: "8px"
|
|
4612
4624
|
},
|
|
4613
4625
|
onClick: (n) => {
|
|
4614
|
-
n.stopPropagation(),
|
|
4626
|
+
n.stopPropagation(), q(N);
|
|
4615
4627
|
}
|
|
4616
4628
|
}
|
|
4617
4629
|
)
|