@gulibs/react-vtable 0.0.18 → 0.0.20
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/README.md +992 -1293
- package/dist/components/batch-action-buttons.d.ts +4 -16
- package/dist/components/batch-action-buttons.d.ts.map +1 -1
- package/dist/components/batch-actions.d.ts +2 -17
- package/dist/components/batch-actions.d.ts.map +1 -1
- package/dist/hooks/use-pro-table.d.ts.map +1 -1
- package/dist/index.cjs +6 -6
- package/dist/index.js +188 -238
- package/dist/types.d.ts +50 -27
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -11,7 +11,7 @@ import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
|
11
11
|
import * as SwitchPrimitive from "@radix-ui/react-switch";
|
|
12
12
|
import * as ProgressPrimitive from "@radix-ui/react-progress";
|
|
13
13
|
import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
|
|
14
|
-
import {
|
|
14
|
+
import { ArrowDown, ArrowUp, ArrowUpDown, Calendar as Calendar$1, CalendarIcon, Check, CheckIcon, ChevronDown, ChevronDownIcon, ChevronLeftIcon, ChevronRight, ChevronRightIcon, ChevronUp, ChevronUpIcon, CircleIcon, Copy, Edit, FileText, Filter, GripVertical, Maximize2, Minimize2, Minus, MoreHorizontal, Plus, RotateCw, Save, Search as Search$1, Settings2, Trash2, X } from "lucide-react";
|
|
15
15
|
import * as DropdownMenuPrimitive from "@radix-ui/react-dropdown-menu";
|
|
16
16
|
import * as TooltipPrimitive from "@radix-ui/react-tooltip";
|
|
17
17
|
import { IconChevronLeft, IconChevronRight, IconChevronsLeft, IconChevronsRight, IconEye, IconEyeOff, IconGripVertical, IconPin, IconPinEnd, IconSettings, IconX } from "@tabler/icons-react";
|
|
@@ -47,7 +47,7 @@ var __create = Object.create, __defProp = Object.defineProperty, __getOwnPropDes
|
|
|
47
47
|
["partial", x],
|
|
48
48
|
["partialRight", S],
|
|
49
49
|
["rearg", w]
|
|
50
|
-
], me = "[object Arguments]", he = "[object Array]", ge = "[object AsyncFunction]", D = "[object Boolean]", _e = "[object Date]", ve = "[object DOMException]",
|
|
50
|
+
], me = "[object Arguments]", he = "[object Array]", ge = "[object AsyncFunction]", D = "[object Boolean]", _e = "[object Date]", ve = "[object DOMException]", O = "[object Error]", ye = "[object Function]", be = "[object GeneratorFunction]", k = "[object Map]", A = "[object Number]", xe = "[object Null]", Se = "[object Object]", Ce = "[object Promise]", we = "[object Proxy]", Te = "[object RegExp]", Ee = "[object Set]", De = "[object String]", Oe = "[object Symbol]", ke = "[object Undefined]", Ae = "[object WeakMap]", je = "[object WeakSet]", Me = "[object ArrayBuffer]", Ne = "[object DataView]", Pe = "[object Float32Array]", Fe = "[object Float64Array]", Ie = "[object Int8Array]", Le = "[object Int16Array]", Re = "[object Int32Array]", ze = "[object Uint8Array]", Be = "[object Uint8ClampedArray]", Ve = "[object Uint16Array]", He = "[object Uint32Array]", Ue = /\b__p \+= '';/g, We = /\b(__p \+=) '' \+/g, Ge = /(__e\(.*?\)|\b__t\)) \+\n'';/g, Ke = /&(?:amp|lt|gt|quot|#39);/g, qe = /[&<>"']/g, Je = RegExp(Ke.source), Ye = RegExp(qe.source), Xe = /<%-([\s\S]+?)%>/g, Ze = /<%([\s\S]+?)%>/g, Qe = /<%=([\s\S]+?)%>/g, $e = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, et = /^\w*$/, tt = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, nt = /[\\^$.*+?()[\]{}|]/g, rt = RegExp(nt.source), it = /^\s+/, j = /\s/, at = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, ot = /\{\n\/\* \[wrapped with (.+)\] \*/, st = /,? & /, ct = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g, lt = /[()=,{}\[\]\/\s]/, ut = /\\(\\)?/g, dt = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g, ft = /\w*$/, pt = /^[-+]0x[0-9a-f]+$/i, mt = /^0b[01]+$/i, ht = /^\[object .+?Constructor\]$/, gt = /^0o[0-7]+$/i, _t = /^(?:0|[1-9]\d*)$/, vt = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g, yt = /($^)/, bt = /['\n\r\u2028\u2029\\]/g, xt = "\\ud800-\\udfff", St = "\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff", Ct = "\\u2700-\\u27bf", M = "a-z\\xdf-\\xf6\\xf8-\\xff", wt = "\\xac\\xb1\\xd7\\xf7", Tt = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", Et = "\\u2000-\\u206f", Dt = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", Ot = "A-Z\\xc0-\\xd6\\xd8-\\xde", kt = "\\ufe0e\\ufe0f", At = wt + Tt + Et + Dt, jt = "['’]", N = "[" + xt + "]", Mt = "[" + At + "]", Nt = "[" + St + "]", Pt = "\\d+", Ft = "[" + Ct + "]", It = "[" + M + "]", Lt = "[^" + xt + At + Pt + Ct + M + Ot + "]", Rt = "\\ud83c[\\udffb-\\udfff]", zt = "(?:" + Nt + "|" + Rt + ")", Bt = "[^" + xt + "]", Vt = "(?:\\ud83c[\\udde6-\\uddff]){2}", Ht = "[\\ud800-\\udbff][\\udc00-\\udfff]", Ut = "[" + Ot + "]", Wt = "\\u200d", Gt = "(?:" + It + "|" + Lt + ")", Kt = "(?:" + Ut + "|" + Lt + ")", qt = "(?:" + jt + "(?:d|ll|m|re|s|t|ve))?", Jt = "(?:" + jt + "(?:D|LL|M|RE|S|T|VE))?", Yt = zt + "?", Xt = "[" + kt + "]?", Zt = "(?:" + Wt + "(?:" + [
|
|
51
51
|
Bt,
|
|
52
52
|
Vt,
|
|
53
53
|
Ht
|
|
@@ -79,9 +79,9 @@ var __create = Object.create, __defProp = Object.defineProperty, __getOwnPropDes
|
|
|
79
79
|
Pt,
|
|
80
80
|
tn
|
|
81
81
|
].join("|"), "g"), ln = RegExp("[" + Wt + xt + St + kt + "]"), P = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/, un = /* @__PURE__ */ "Array.Buffer.DataView.Date.Error.Float32Array.Float64Array.Function.Int8Array.Int16Array.Int32Array.Map.Math.Object.Promise.RegExp.Set.String.Symbol.TypeError.Uint8Array.Uint8ClampedArray.Uint16Array.Uint32Array.WeakMap._.clearTimeout.isFinite.parseInt.setTimeout".split("."), dn = -1, F = {};
|
|
82
|
-
F[Pe] = F[Fe] = F[Ie] = F[Le] = F[Re] = F[ze] = F[Be] = F[Ve] = F[He] = !0, F[me] = F[he] = F[Me] = F[D] = F[Ne] = F[_e] = F[
|
|
82
|
+
F[Pe] = F[Fe] = F[Ie] = F[Le] = F[Re] = F[ze] = F[Be] = F[Ve] = F[He] = !0, F[me] = F[he] = F[Me] = F[D] = F[Ne] = F[_e] = F[O] = F[ye] = F[k] = F[A] = F[Se] = F[Te] = F[Ee] = F[De] = F[Ae] = !1;
|
|
83
83
|
var I = {};
|
|
84
|
-
I[me] = I[he] = I[Me] = I[Ne] = I[D] = I[_e] = I[Pe] = I[Fe] = I[Ie] = I[Le] = I[Re] = I[k] = I[A] = I[Se] = I[Te] = I[Ee] = I[De] = I[Oe] = I[ze] = I[Be] = I[Ve] = I[He] = !0, I[
|
|
84
|
+
I[me] = I[he] = I[Me] = I[Ne] = I[D] = I[_e] = I[Pe] = I[Fe] = I[Ie] = I[Le] = I[Re] = I[k] = I[A] = I[Se] = I[Te] = I[Ee] = I[De] = I[Oe] = I[ze] = I[Be] = I[Ve] = I[He] = !0, I[O] = I[ye] = I[Ae] = !1;
|
|
85
85
|
var L = {
|
|
86
86
|
À: "A",
|
|
87
87
|
Á: "A",
|
|
@@ -789,7 +789,7 @@ var __create = Object.create, __defProp = Object.defineProperty, __getOwnPropDes
|
|
|
789
789
|
if (m) {
|
|
790
790
|
if (s = fs(e), !c) return mo(e, s);
|
|
791
791
|
} else {
|
|
792
|
-
var h = cs(e), g = h ==
|
|
792
|
+
var h = cs(e), g = h == ye || h == be;
|
|
793
793
|
if (Su(e)) return ro(e, c);
|
|
794
794
|
if (h == Se || h == me || g && !a) {
|
|
795
795
|
if (s = l || g ? {} : ps(e), !c) return l ? _o(e, Ti(s, e)) : go(e, wi(s, e));
|
|
@@ -1654,7 +1654,7 @@ var __create = Object.create, __defProp = Object.defineProperty, __getOwnPropDes
|
|
|
1654
1654
|
case D:
|
|
1655
1655
|
case _e:
|
|
1656
1656
|
case A: return hu(+e, +t);
|
|
1657
|
-
case
|
|
1657
|
+
case O: return e.name == t.name && e.message == t.message;
|
|
1658
1658
|
case Te:
|
|
1659
1659
|
case De: return e == t + "";
|
|
1660
1660
|
case k: var s = _r;
|
|
@@ -2619,7 +2619,7 @@ var __create = Object.create, __defProp = Object.defineProperty, __getOwnPropDes
|
|
|
2619
2619
|
function Ou(e) {
|
|
2620
2620
|
if (!Y(e)) return !1;
|
|
2621
2621
|
var t = qi(e);
|
|
2622
|
-
return t ==
|
|
2622
|
+
return t == O || t == ve || typeof e.message == "string" && typeof e.name == "string" && !Vu(e);
|
|
2623
2623
|
}
|
|
2624
2624
|
function ku(e) {
|
|
2625
2625
|
return typeof e == "number" && on(e);
|
|
@@ -2627,7 +2627,7 @@ var __create = Object.create, __defProp = Object.defineProperty, __getOwnPropDes
|
|
|
2627
2627
|
function Au(e) {
|
|
2628
2628
|
if (!J(e)) return !1;
|
|
2629
2629
|
var t = qi(e);
|
|
2630
|
-
return t ==
|
|
2630
|
+
return t == ye || t == be || t == ge || t == we;
|
|
2631
2631
|
}
|
|
2632
2632
|
function ju(e) {
|
|
2633
2633
|
return typeof e == "number" && e == Z(e);
|
|
@@ -3937,8 +3937,8 @@ function useProTable(e) {
|
|
|
3937
3937
|
selectedRows: [],
|
|
3938
3938
|
editingKey: null,
|
|
3939
3939
|
editingRecord: null
|
|
3940
|
-
}, [T, E] = useReducer(proTableReducer, ne), re = useRef(null),
|
|
3941
|
-
|
|
3940
|
+
}, [T, E] = useReducer(proTableReducer, ne), re = useRef(null), ie = useRef(/* @__PURE__ */ new Map()), [ae, oe] = useState([]), [se, ce] = useState([]), [le, ue] = useState({}), [de, fe] = useState({}), pe = useCallback((e) => {
|
|
3941
|
+
oe((t) => {
|
|
3942
3942
|
if ((0, import_lodash.isFunction)(e)) try {
|
|
3943
3943
|
let n = e(t || []);
|
|
3944
3944
|
return n == null || !Array.isArray(n) ? [] : n;
|
|
@@ -3947,8 +3947,8 @@ function useProTable(e) {
|
|
|
3947
3947
|
}
|
|
3948
3948
|
return e == null || !Array.isArray(e) ? [] : e;
|
|
3949
3949
|
});
|
|
3950
|
-
}, []),
|
|
3951
|
-
|
|
3950
|
+
}, []), me = useCallback((e) => {
|
|
3951
|
+
ce((t) => {
|
|
3952
3952
|
if ((0, import_lodash.isFunction)(e)) try {
|
|
3953
3953
|
let n = e(t || []);
|
|
3954
3954
|
return n == null || !Array.isArray(n) ? [] : n.filter((e) => e != null);
|
|
@@ -3957,45 +3957,55 @@ function useProTable(e) {
|
|
|
3957
3957
|
}
|
|
3958
3958
|
return e == null || !Array.isArray(e) ? [] : e.filter((e) => e != null);
|
|
3959
3959
|
});
|
|
3960
|
-
}, []),
|
|
3961
|
-
|
|
3960
|
+
}, []), he = useCallback((e) => {
|
|
3961
|
+
ue((t) => {
|
|
3962
3962
|
if ((0, import_lodash.isFunction)(e)) {
|
|
3963
3963
|
let n = e(t || {});
|
|
3964
3964
|
return n && typeof n == "object" ? n : {};
|
|
3965
3965
|
}
|
|
3966
3966
|
return e && typeof e == "object" ? e : {};
|
|
3967
3967
|
});
|
|
3968
|
-
}, []),
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
let e = [], t = [], r = new Set(T.data.map((e) => String(he(e))));
|
|
3973
|
-
Object.keys(n).forEach((r) => {
|
|
3974
|
-
if (n[r]) {
|
|
3975
|
-
let n = T.data.find((e) => String(he(e)) === r);
|
|
3976
|
-
if (n) {
|
|
3977
|
-
let r = he(n);
|
|
3978
|
-
e.push(r), t.push(n);
|
|
3979
|
-
}
|
|
3980
|
-
}
|
|
3981
|
-
});
|
|
3982
|
-
let i = [...T.selectedRowKeys.filter((e) => !r.has(String(e))), ...e];
|
|
3983
|
-
E({
|
|
3984
|
-
type: "SET_SELECTION",
|
|
3985
|
-
payload: {
|
|
3986
|
-
keys: i,
|
|
3987
|
-
rows: t
|
|
3988
|
-
}
|
|
3989
|
-
}), b && typeof b == "object" && b.onChange && b.onChange(i, t);
|
|
3990
|
-
}
|
|
3991
|
-
return n;
|
|
3968
|
+
}, []), ge = useCallback((e) => typeof y == "function" ? String(y(e)) : String(e[y]), [y]), D = b !== !1 && typeof b == "object" && b?.preserveSelectedRowKeys !== void 0 ? !!b.preserveSelectedRowKeys : !0;
|
|
3969
|
+
useEffect(() => {
|
|
3970
|
+
b === !1 || !b || D && T.data.forEach((e) => {
|
|
3971
|
+
ie.current.set(ge(e), e);
|
|
3992
3972
|
});
|
|
3993
3973
|
}, [
|
|
3974
|
+
T.data,
|
|
3975
|
+
ge,
|
|
3994
3976
|
b,
|
|
3977
|
+
D
|
|
3978
|
+
]);
|
|
3979
|
+
let _e = useCallback((e) => {
|
|
3980
|
+
fe((t) => (0, import_lodash.isFunction)(e) ? e(t || {}) || {} : e && typeof e == "object" ? e : {});
|
|
3981
|
+
}, []), ve = useRef("");
|
|
3982
|
+
useEffect(() => {
|
|
3983
|
+
if (b === !1 || !b) return;
|
|
3984
|
+
let e = [], t = [], n = new Set(T.data.map((e) => String(ge(e))));
|
|
3985
|
+
Object.keys(de).forEach((n) => {
|
|
3986
|
+
if (de[n]) {
|
|
3987
|
+
let r = T.data.find((e) => String(ge(e)) === n);
|
|
3988
|
+
if (r) {
|
|
3989
|
+
let n = ge(r);
|
|
3990
|
+
D && ie.current.set(String(n), r), e.push(n), t.push(r);
|
|
3991
|
+
}
|
|
3992
|
+
}
|
|
3993
|
+
});
|
|
3994
|
+
let r = [...T.selectedRowKeys.filter((e) => !n.has(String(e))), ...e], i = D ? r.map((e) => ie.current.get(String(e))).filter(Boolean) : t, a = [...r].sort().join(",");
|
|
3995
|
+
ve.current !== a && (ve.current = a, E({
|
|
3996
|
+
type: "SET_SELECTION",
|
|
3997
|
+
payload: {
|
|
3998
|
+
keys: r,
|
|
3999
|
+
rows: i
|
|
4000
|
+
}
|
|
4001
|
+
}), b && typeof b == "object" && b.onChange && b.onChange(r, i));
|
|
4002
|
+
}, [
|
|
4003
|
+
de,
|
|
3995
4004
|
T.data,
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
])
|
|
4005
|
+
ge,
|
|
4006
|
+
D
|
|
4007
|
+
]);
|
|
4008
|
+
let O = useCallback(() => {
|
|
3999
4009
|
let e = [], n = [];
|
|
4000
4010
|
return t.forEach((t) => {
|
|
4001
4011
|
if (t.hideInTable) return;
|
|
@@ -4005,8 +4015,8 @@ function useProTable(e) {
|
|
|
4005
4015
|
left: e,
|
|
4006
4016
|
right: n
|
|
4007
4017
|
};
|
|
4008
|
-
}, [t]), [
|
|
4009
|
-
|
|
4018
|
+
}, [t]), [ye, be] = useState(() => O()), k = useCallback((e) => {
|
|
4019
|
+
be((t) => {
|
|
4010
4020
|
if ((0, import_lodash.isFunction)(e)) {
|
|
4011
4021
|
let n = e(t || {
|
|
4012
4022
|
left: [],
|
|
@@ -4024,10 +4034,10 @@ function useProTable(e) {
|
|
|
4024
4034
|
});
|
|
4025
4035
|
}, []);
|
|
4026
4036
|
useEffect(() => {
|
|
4027
|
-
let e =
|
|
4028
|
-
|
|
4029
|
-
}, [
|
|
4030
|
-
let
|
|
4037
|
+
let e = O();
|
|
4038
|
+
be(e);
|
|
4039
|
+
}, [O]);
|
|
4040
|
+
let A = useCallback(async (e) => {
|
|
4031
4041
|
if (r) {
|
|
4032
4042
|
E({
|
|
4033
4043
|
type: "SET_LOADING",
|
|
@@ -4084,7 +4094,7 @@ function useProTable(e) {
|
|
|
4084
4094
|
E({
|
|
4085
4095
|
type: "SET_PAGINATION",
|
|
4086
4096
|
payload: n
|
|
4087
|
-
}),
|
|
4097
|
+
}), A(n);
|
|
4088
4098
|
return;
|
|
4089
4099
|
}
|
|
4090
4100
|
E({
|
|
@@ -4095,7 +4105,7 @@ function useProTable(e) {
|
|
|
4095
4105
|
x,
|
|
4096
4106
|
te,
|
|
4097
4107
|
r,
|
|
4098
|
-
|
|
4108
|
+
A,
|
|
4099
4109
|
T.current,
|
|
4100
4110
|
T.pageSize
|
|
4101
4111
|
]), useEffect(() => {
|
|
@@ -4106,7 +4116,7 @@ function useProTable(e) {
|
|
|
4106
4116
|
payload: e
|
|
4107
4117
|
});
|
|
4108
4118
|
}, [x, T.total]);
|
|
4109
|
-
let
|
|
4119
|
+
let xe = useMemo(() => t.filter((e) => !e.hideInTable).map((e) => ({
|
|
4110
4120
|
id: e.key || String(e.dataIndex),
|
|
4111
4121
|
accessorKey: e.dataIndex,
|
|
4112
4122
|
header: e.title,
|
|
@@ -4133,42 +4143,42 @@ function useProTable(e) {
|
|
|
4133
4143
|
return t ? parseFloat(t[1]) : parseInt(String(e.width)) || 100;
|
|
4134
4144
|
})() : 100 : e.fixed ? 100 : void 0,
|
|
4135
4145
|
...e
|
|
4136
|
-
})), [t]),
|
|
4146
|
+
})), [t]), Se = useReactTable({
|
|
4137
4147
|
data: T.data,
|
|
4138
|
-
columns:
|
|
4148
|
+
columns: xe,
|
|
4139
4149
|
state: {
|
|
4140
|
-
sorting:
|
|
4141
|
-
columnFilters:
|
|
4142
|
-
columnVisibility:
|
|
4143
|
-
rowSelection:
|
|
4144
|
-
columnPinning:
|
|
4150
|
+
sorting: ae,
|
|
4151
|
+
columnFilters: se,
|
|
4152
|
+
columnVisibility: le,
|
|
4153
|
+
rowSelection: de,
|
|
4154
|
+
columnPinning: ye,
|
|
4145
4155
|
pagination: {
|
|
4146
4156
|
pageIndex: T.current - 1,
|
|
4147
4157
|
pageSize: T.pageSize
|
|
4148
4158
|
}
|
|
4149
4159
|
},
|
|
4150
|
-
onSortingChange:
|
|
4151
|
-
onColumnFiltersChange:
|
|
4152
|
-
onColumnVisibilityChange:
|
|
4153
|
-
onRowSelectionChange:
|
|
4154
|
-
onColumnPinningChange:
|
|
4160
|
+
onSortingChange: pe,
|
|
4161
|
+
onColumnFiltersChange: me,
|
|
4162
|
+
onColumnVisibilityChange: he,
|
|
4163
|
+
onRowSelectionChange: _e,
|
|
4164
|
+
onColumnPinningChange: k,
|
|
4155
4165
|
getCoreRowModel: getCoreRowModel(),
|
|
4156
4166
|
getFilteredRowModel: getFilteredRowModel(),
|
|
4157
4167
|
getPaginationRowModel: getPaginationRowModel(),
|
|
4158
4168
|
getSortedRowModel: getSortedRowModel(),
|
|
4159
|
-
getRowId:
|
|
4169
|
+
getRowId: ge,
|
|
4160
4170
|
manualPagination: !!r || ee,
|
|
4161
4171
|
pageCount: Math.ceil(T.total / T.pageSize),
|
|
4162
4172
|
columnResizeMode: "onChange",
|
|
4163
4173
|
enableColumnPinning: !0
|
|
4164
|
-
}),
|
|
4174
|
+
}), Ce = useCallback((e, t) => {
|
|
4165
4175
|
r ? (E({
|
|
4166
4176
|
type: "SET_PAGINATION",
|
|
4167
4177
|
payload: {
|
|
4168
4178
|
current: e,
|
|
4169
4179
|
pageSize: t
|
|
4170
4180
|
}
|
|
4171
|
-
}),
|
|
4181
|
+
}), A({
|
|
4172
4182
|
current: e,
|
|
4173
4183
|
pageSize: t
|
|
4174
4184
|
})) : E({
|
|
@@ -4180,56 +4190,56 @@ function useProTable(e) {
|
|
|
4180
4190
|
});
|
|
4181
4191
|
}, [
|
|
4182
4192
|
r,
|
|
4183
|
-
|
|
4193
|
+
A,
|
|
4184
4194
|
x
|
|
4185
|
-
]),
|
|
4195
|
+
]), we = useCallback((e) => {
|
|
4186
4196
|
if (E({
|
|
4187
4197
|
type: "SET_FILTERS",
|
|
4188
4198
|
payload: e
|
|
4189
|
-
}), r)
|
|
4199
|
+
}), r) A({ current: 1 });
|
|
4190
4200
|
else {
|
|
4191
4201
|
let t = Object.entries(e).filter(([e, t]) => t == null || t === "" ? !1 : Array.isArray(t) ? t.length > 0 : !0).map(([e, t]) => ({
|
|
4192
4202
|
id: e,
|
|
4193
4203
|
value: t
|
|
4194
4204
|
}));
|
|
4195
|
-
|
|
4205
|
+
ce(t);
|
|
4196
4206
|
}
|
|
4197
|
-
}, [r,
|
|
4198
|
-
E({ type: "RESET" }), r ?
|
|
4199
|
-
}, [r,
|
|
4207
|
+
}, [r, A]), Te = useCallback(() => {
|
|
4208
|
+
E({ type: "RESET" }), r ? A({ current: 1 }) : ce([]);
|
|
4209
|
+
}, [r, A]);
|
|
4200
4210
|
useEffect(() => {
|
|
4201
|
-
if (r &&
|
|
4202
|
-
let e =
|
|
4211
|
+
if (r && ae.length > 0) {
|
|
4212
|
+
let e = ae[0].id, t = ae[0].desc ? "desc" : "asc";
|
|
4203
4213
|
E({
|
|
4204
4214
|
type: "SET_SORTER",
|
|
4205
4215
|
payload: {
|
|
4206
4216
|
field: e,
|
|
4207
4217
|
order: t
|
|
4208
4218
|
}
|
|
4209
|
-
}),
|
|
4219
|
+
}), A({ current: 1 });
|
|
4210
4220
|
}
|
|
4211
|
-
}, [
|
|
4212
|
-
let
|
|
4221
|
+
}, [ae, r]);
|
|
4222
|
+
let Ee = {
|
|
4213
4223
|
reload: async (e = !1) => {
|
|
4214
|
-
await
|
|
4224
|
+
await A(e ? { current: 1 } : void 0);
|
|
4215
4225
|
},
|
|
4216
4226
|
reloadAndRest: async () => {
|
|
4217
|
-
E({ type: "RESET" }), await
|
|
4227
|
+
E({ type: "RESET" }), await A({ current: 1 });
|
|
4218
4228
|
},
|
|
4219
4229
|
reset: () => {
|
|
4220
4230
|
E({ type: "RESET" });
|
|
4221
4231
|
},
|
|
4222
4232
|
clearSelected: () => {
|
|
4223
|
-
|
|
4233
|
+
fe({}), E({
|
|
4224
4234
|
type: "SET_SELECTION",
|
|
4225
4235
|
payload: {
|
|
4226
4236
|
keys: [],
|
|
4227
4237
|
rows: []
|
|
4228
4238
|
}
|
|
4229
|
-
});
|
|
4239
|
+
}), ie.current.clear();
|
|
4230
4240
|
},
|
|
4231
4241
|
startEditable: (e) => {
|
|
4232
|
-
let t = T.data.find((t) =>
|
|
4242
|
+
let t = T.data.find((t) => ge(t) === String(e));
|
|
4233
4243
|
return t ? (E({
|
|
4234
4244
|
type: "START_EDIT",
|
|
4235
4245
|
payload: {
|
|
@@ -4243,7 +4253,7 @@ function useProTable(e) {
|
|
|
4243
4253
|
type: "SAVE_EDIT",
|
|
4244
4254
|
payload: t
|
|
4245
4255
|
}), !0),
|
|
4246
|
-
getRowData: (e) => T.data.find((t) =>
|
|
4256
|
+
getRowData: (e) => T.data.find((t) => ge(t) === String(e)),
|
|
4247
4257
|
getTableData: () => T.data,
|
|
4248
4258
|
setTableData: (e) => {
|
|
4249
4259
|
E({
|
|
@@ -4253,9 +4263,9 @@ function useProTable(e) {
|
|
|
4253
4263
|
}
|
|
4254
4264
|
};
|
|
4255
4265
|
return useEffect(() => {
|
|
4256
|
-
re.current && Object.assign(re.current,
|
|
4266
|
+
re.current && Object.assign(re.current, Ee);
|
|
4257
4267
|
}), useEffect(() => {
|
|
4258
|
-
r && !n &&
|
|
4268
|
+
r && !n && A();
|
|
4259
4269
|
}, []), useEffect(() => {
|
|
4260
4270
|
n && E({
|
|
4261
4271
|
type: "SET_DATA",
|
|
@@ -4266,27 +4276,27 @@ function useProTable(e) {
|
|
|
4266
4276
|
});
|
|
4267
4277
|
}, [n, x]), useEffect(() => {
|
|
4268
4278
|
if (b === !1 || !b) return;
|
|
4269
|
-
let e = {};
|
|
4270
|
-
T.data.forEach((
|
|
4271
|
-
let
|
|
4272
|
-
|
|
4279
|
+
let e = {}, t = new Set(T.selectedRowKeys.map((e) => String(e)));
|
|
4280
|
+
T.data.forEach((n) => {
|
|
4281
|
+
let r = String(ge(n));
|
|
4282
|
+
t.has(r) && (e[r] = !0);
|
|
4273
4283
|
});
|
|
4274
|
-
let
|
|
4275
|
-
|
|
4284
|
+
let n = Object.keys(de).filter((e) => de[e]), r = Object.keys(e).filter((t) => e[t]);
|
|
4285
|
+
n.length === r.length && n.every((e) => r.includes(e)) && r.every((e) => n.includes(e)) || fe(e);
|
|
4276
4286
|
}, [
|
|
4277
4287
|
T.data,
|
|
4278
4288
|
T.selectedRowKeys,
|
|
4279
|
-
|
|
4289
|
+
ge,
|
|
4280
4290
|
b
|
|
4281
4291
|
]), {
|
|
4282
|
-
table:
|
|
4292
|
+
table: Se,
|
|
4283
4293
|
state: T,
|
|
4284
4294
|
dispatch: E,
|
|
4285
|
-
actions:
|
|
4295
|
+
actions: Ee,
|
|
4286
4296
|
handlers: {
|
|
4287
|
-
handlePaginationChange:
|
|
4288
|
-
handleSearch:
|
|
4289
|
-
handleReset:
|
|
4297
|
+
handlePaginationChange: Ce,
|
|
4298
|
+
handleSearch: we,
|
|
4299
|
+
handleReset: Te
|
|
4290
4300
|
}
|
|
4291
4301
|
};
|
|
4292
4302
|
}
|
|
@@ -5665,134 +5675,73 @@ function AlertDescription({ className: e,...t }) {
|
|
|
5665
5675
|
...t
|
|
5666
5676
|
});
|
|
5667
5677
|
}
|
|
5668
|
-
function BatchActionButtons({
|
|
5669
|
-
if (e === 0) return null;
|
|
5670
|
-
let
|
|
5671
|
-
|
|
5672
|
-
|
|
5673
|
-
|
|
5674
|
-
|
|
5675
|
-
|
|
5676
|
-
|
|
5677
|
-
|
|
5678
|
-
|
|
5679
|
-
|
|
5680
|
-
|
|
5681
|
-
|
|
5682
|
-
|
|
5678
|
+
function BatchActionButtons({ actions: e = [], maxVisibleActions: n = 3, selectedCount: r, selectedRows: i, onClearSelection: a, disabled: o = !1, className: s }) {
|
|
5679
|
+
if (r === 0 || e.length === 0) return null;
|
|
5680
|
+
let c = useMemo(() => e.map((e) => ({
|
|
5681
|
+
...e,
|
|
5682
|
+
onClick: () => {
|
|
5683
|
+
e.onClick(i), e.clearSelection && a?.();
|
|
5684
|
+
}
|
|
5685
|
+
})), [
|
|
5686
|
+
e,
|
|
5687
|
+
i,
|
|
5688
|
+
a
|
|
5689
|
+
]), { visibleActions: u, moreActions: d } = useMemo(() => {
|
|
5690
|
+
let e = c.filter((e) => !e.showInMore), t = c.filter((e) => e.showInMore), r = e, i = t;
|
|
5691
|
+
return e.length > n && (r = e.slice(0, n), i = [...e.slice(n), ...t]), {
|
|
5692
|
+
visibleActions: r,
|
|
5693
|
+
moreActions: i
|
|
5694
|
+
};
|
|
5695
|
+
}, [c, n]), f = useMemo(() => c.filter((e) => e.isExportFormat && !e.showInMore), [c]), p = f.length > 1 && u.some((e) => e.isExportFormat);
|
|
5683
5696
|
return /* @__PURE__ */ jsxs("div", {
|
|
5684
|
-
className: cn("flex items-center gap-2",
|
|
5697
|
+
className: cn("flex items-center gap-2", s),
|
|
5685
5698
|
children: [
|
|
5686
|
-
|
|
5687
|
-
|
|
5688
|
-
|
|
5689
|
-
|
|
5690
|
-
|
|
5691
|
-
|
|
5692
|
-
|
|
5693
|
-
|
|
5694
|
-
|
|
5695
|
-
|
|
5696
|
-
|
|
5697
|
-
")"
|
|
5698
|
-
]
|
|
5699
|
-
}),
|
|
5700
|
-
r && /* @__PURE__ */ jsxs(Button, {
|
|
5701
|
-
variant: "outline",
|
|
5702
|
-
size: "sm",
|
|
5703
|
-
onClick: p,
|
|
5704
|
-
disabled: u,
|
|
5705
|
-
className: "h-8",
|
|
5706
|
-
children: [/* @__PURE__ */ jsx(Download, { className: "h-3 w-3 mr-1" }), "导出"]
|
|
5707
|
-
}),
|
|
5708
|
-
(i || a) && /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, {
|
|
5709
|
-
asChild: !0,
|
|
5710
|
-
children: /* @__PURE__ */ jsxs(Button, {
|
|
5711
|
-
variant: "outline",
|
|
5712
|
-
size: "sm",
|
|
5713
|
-
disabled: u,
|
|
5714
|
-
className: "h-8",
|
|
5715
|
-
children: [/* @__PURE__ */ jsx(FileText, { className: "h-3 w-3 mr-1" }), "导出格式"]
|
|
5716
|
-
})
|
|
5717
|
-
}), /* @__PURE__ */ jsxs(DropdownMenuContent, {
|
|
5718
|
-
align: "start",
|
|
5719
|
-
children: [i && /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
5720
|
-
onClick: m,
|
|
5721
|
-
children: [/* @__PURE__ */ jsx(FileText, { className: "h-4 w-4 mr-2" }), "Excel (.xlsx)"]
|
|
5722
|
-
}), a && /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
5723
|
-
onClick: h,
|
|
5724
|
-
children: [/* @__PURE__ */ jsx(FileText, { className: "h-4 w-4 mr-2" }), "CSV (.csv)"]
|
|
5725
|
-
})]
|
|
5726
|
-
})] }),
|
|
5727
|
-
o && /* @__PURE__ */ jsxs(Button, {
|
|
5728
|
-
variant: "outline",
|
|
5729
|
-
size: "sm",
|
|
5730
|
-
onClick: g,
|
|
5731
|
-
disabled: u,
|
|
5732
|
-
className: "h-8",
|
|
5733
|
-
children: [/* @__PURE__ */ jsx(Mail, { className: "h-3 w-3 mr-1" }), "发送邮件"]
|
|
5734
|
-
}),
|
|
5735
|
-
s && /* @__PURE__ */ jsxs(Button, {
|
|
5699
|
+
u.map((e) => e.isExportFormat && p ? null : /* @__PURE__ */ jsxs(Button, {
|
|
5700
|
+
variant: e.variant,
|
|
5701
|
+
size: "sm",
|
|
5702
|
+
onClick: e.onClick,
|
|
5703
|
+
disabled: o,
|
|
5704
|
+
className: "h-8",
|
|
5705
|
+
children: [e.icon, e.label]
|
|
5706
|
+
}, e.key)),
|
|
5707
|
+
p && /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, {
|
|
5708
|
+
asChild: !0,
|
|
5709
|
+
children: /* @__PURE__ */ jsxs(Button, {
|
|
5736
5710
|
variant: "outline",
|
|
5737
5711
|
size: "sm",
|
|
5738
|
-
|
|
5739
|
-
disabled: u,
|
|
5712
|
+
disabled: o,
|
|
5740
5713
|
className: "h-8",
|
|
5741
|
-
children: [/* @__PURE__ */ jsx(
|
|
5714
|
+
children: [/* @__PURE__ */ jsx(FileText, { className: "h-3 w-3 mr-1" }), "导出格式"]
|
|
5742
5715
|
})
|
|
5743
|
-
|
|
5744
|
-
|
|
5745
|
-
|
|
5746
|
-
|
|
5747
|
-
|
|
5748
|
-
|
|
5749
|
-
|
|
5750
|
-
|
|
5751
|
-
|
|
5752
|
-
|
|
5753
|
-
|
|
5754
|
-
children: e.icon
|
|
5755
|
-
}), e.label]
|
|
5756
|
-
}, e.key)) }),
|
|
5757
|
-
(v || y) && /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, {
|
|
5716
|
+
}), /* @__PURE__ */ jsx(DropdownMenuContent, {
|
|
5717
|
+
align: "start",
|
|
5718
|
+
children: f.map((e) => /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
5719
|
+
onClick: e.onClick,
|
|
5720
|
+
children: [/* @__PURE__ */ jsx("span", {
|
|
5721
|
+
className: "inline-flex h-4 w-4 mr-2",
|
|
5722
|
+
children: /* @__PURE__ */ jsx(FileText, { className: "h-4 w-4" })
|
|
5723
|
+
}), e.label]
|
|
5724
|
+
}, e.key))
|
|
5725
|
+
})] }),
|
|
5726
|
+
d.length > 0 && /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, {
|
|
5758
5727
|
asChild: !0,
|
|
5759
5728
|
children: /* @__PURE__ */ jsx(Button, {
|
|
5760
5729
|
variant: "ghost",
|
|
5761
5730
|
size: "sm",
|
|
5762
|
-
disabled:
|
|
5731
|
+
disabled: o,
|
|
5763
5732
|
className: "h-8 w-8 p-0",
|
|
5764
5733
|
children: /* @__PURE__ */ jsx(MoreHorizontal, { className: "h-4 w-4" })
|
|
5765
5734
|
})
|
|
5766
|
-
}), /* @__PURE__ */
|
|
5735
|
+
}), /* @__PURE__ */ jsx(DropdownMenuContent, {
|
|
5767
5736
|
align: "end",
|
|
5768
|
-
children: [
|
|
5769
|
-
|
|
5770
|
-
|
|
5771
|
-
|
|
5772
|
-
|
|
5773
|
-
|
|
5774
|
-
|
|
5775
|
-
|
|
5776
|
-
children: [/* @__PURE__ */ jsx(Download, { className: "h-4 w-4 mr-2" }), "导出数据"]
|
|
5777
|
-
}),
|
|
5778
|
-
o && /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
5779
|
-
onClick: g,
|
|
5780
|
-
children: [/* @__PURE__ */ jsx(Mail, { className: "h-4 w-4 mr-2" }), "发送邮件"]
|
|
5781
|
-
}),
|
|
5782
|
-
s && /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
5783
|
-
onClick: _,
|
|
5784
|
-
children: [/* @__PURE__ */ jsx(Archive, { className: "h-4 w-4 mr-2" }), "归档"]
|
|
5785
|
-
}),
|
|
5786
|
-
l.length > 0 && /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(DropdownMenuSeparator, {}), l.map((e) => /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
5787
|
-
onClick: () => {
|
|
5788
|
-
e.onClick(t), e.clearSelection && c?.();
|
|
5789
|
-
},
|
|
5790
|
-
children: [e.icon && /* @__PURE__ */ jsx("span", {
|
|
5791
|
-
className: "mr-2",
|
|
5792
|
-
children: e.icon
|
|
5793
|
-
}), e.label]
|
|
5794
|
-
}, e.key))] })
|
|
5795
|
-
]
|
|
5737
|
+
children: d.map((e, n) => /* @__PURE__ */ jsxs(React.Fragment, { children: [/* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
5738
|
+
onClick: e.onClick,
|
|
5739
|
+
className: e.variant === "destructive" ? "text-destructive" : "",
|
|
5740
|
+
children: [e.icon && /* @__PURE__ */ jsx("span", {
|
|
5741
|
+
className: "inline-flex h-4 w-4 mr-2",
|
|
5742
|
+
children: e.icon
|
|
5743
|
+
}), e.label]
|
|
5744
|
+
}), e.key === "delete" && n < d.length - 1 && /* @__PURE__ */ jsx(DropdownMenuSeparator, {})] }, e.key))
|
|
5796
5745
|
})] })
|
|
5797
5746
|
]
|
|
5798
5747
|
});
|
|
@@ -5830,10 +5779,11 @@ function BatchActions({ selectedCount: e, selectedRows: n = [], onClear: r, acti
|
|
|
5830
5779
|
}), e > 0 && /* @__PURE__ */ jsxs("div", {
|
|
5831
5780
|
className: "flex items-center gap-1",
|
|
5832
5781
|
children: [o && /* @__PURE__ */ jsx(BatchActionButtons, {
|
|
5782
|
+
actions: o.actions,
|
|
5783
|
+
maxVisibleActions: o.maxVisibleActions,
|
|
5833
5784
|
selectedCount: e,
|
|
5834
5785
|
selectedRows: n,
|
|
5835
|
-
onClearSelection: r
|
|
5836
|
-
...o
|
|
5786
|
+
onClearSelection: r
|
|
5837
5787
|
}), i.map((e, n) => /* @__PURE__ */ jsx(React.Fragment, { children: e }, n))]
|
|
5838
5788
|
})]
|
|
5839
5789
|
}), e > 0 && !o?.hideClearButton && /* @__PURE__ */ jsxs(Button, {
|
|
@@ -6283,15 +6233,15 @@ function DraggableRow({ row: e, children: t }) {
|
|
|
6283
6233
|
});
|
|
6284
6234
|
}
|
|
6285
6235
|
const ProTable = forwardRef((e, t) => {
|
|
6286
|
-
let { columns: r = [], className: i, classNames: o, style: l, tableStyle: u, size: d = "middle", bordered: m = !1, loading: h = !1, toolbar: g, pagination: _, paginationRender: v, rowSelection: y, draggable: b, editable: x, headerTitle: S, headerSubTitle: C, footer: ne, onRow: T, search: E, cardBordered: re = !1, cardProps:
|
|
6236
|
+
let { columns: r = [], className: i, classNames: o, style: l, tableStyle: u, size: d = "middle", bordered: m = !1, loading: h = !1, toolbar: g, pagination: _, paginationRender: v, rowSelection: y, draggable: b, editable: x, headerTitle: S, headerSubTitle: C, footer: ne, onRow: T, search: E, cardBordered: re = !1, cardProps: se, tableRender: ce, tableExtraRender: le, emptyRender: ue, onSubmit: de, onReset: fe, scroll: pe, sticky: me, tableLayout: he, locale: ge, expandable: D, rowKey: _e = "id", actionRef: ve } = e, [O, ye] = useState(() => r);
|
|
6287
6237
|
useEffect(() => {
|
|
6288
|
-
|
|
6238
|
+
ye(r);
|
|
6289
6239
|
}, [r]);
|
|
6290
6240
|
let be = {
|
|
6291
6241
|
...e,
|
|
6292
|
-
columns:
|
|
6242
|
+
columns: O
|
|
6293
6243
|
}, { table: k, state: A, actions: xe, handlers: Se } = useProTable(be), { request: Ce } = be, { visibleColumns: we, setVisibleColumns: Te, columnSettings: Ee, updateColumnSettings: De } = useColumns({
|
|
6294
|
-
columns:
|
|
6244
|
+
columns: O,
|
|
6295
6245
|
rowSelection: !!y,
|
|
6296
6246
|
draggable: !!b,
|
|
6297
6247
|
editable: !!x
|
|
@@ -6329,7 +6279,7 @@ const ProTable = forwardRef((e, t) => {
|
|
|
6329
6279
|
useImperativeHandle(t, () => xe, [xe]), useEffect(() => {
|
|
6330
6280
|
ve && (typeof ve == "function" ? ve(xe) : ve && typeof ve == "object" && "current" in ve && (ve.current = xe));
|
|
6331
6281
|
}, [xe, ve]);
|
|
6332
|
-
let
|
|
6282
|
+
let Ze = (e) => {
|
|
6333
6283
|
if (b && typeof b == "object" && typeof b.onDragEnd == "function") {
|
|
6334
6284
|
let { active: t, over: n } = e;
|
|
6335
6285
|
if (!n || t.id === n.id) return;
|
|
@@ -6351,16 +6301,16 @@ const ProTable = forwardRef((e, t) => {
|
|
|
6351
6301
|
} catch {}
|
|
6352
6302
|
}
|
|
6353
6303
|
}
|
|
6354
|
-
},
|
|
6304
|
+
}, $e = () => {
|
|
6355
6305
|
try {
|
|
6356
6306
|
k.toggleAllRowsSelected?.(!1);
|
|
6357
6307
|
} catch {}
|
|
6358
6308
|
xe.clearSelected();
|
|
6359
|
-
},
|
|
6309
|
+
}, tt = (e) => {
|
|
6360
6310
|
Se.handleSearch(e), de?.(e);
|
|
6361
|
-
},
|
|
6311
|
+
}, nt = () => {
|
|
6362
6312
|
Se.handleReset(), fe?.();
|
|
6363
|
-
},
|
|
6313
|
+
}, rt = (e, t) => {
|
|
6364
6314
|
if (k.setColumnFilters((n) => {
|
|
6365
6315
|
let r = (Array.isArray(n) ? n : []).filter((t) => t.id !== e);
|
|
6366
6316
|
return t.length > 0 && r.push({
|
|
@@ -6378,12 +6328,12 @@ const ProTable = forwardRef((e, t) => {
|
|
|
6378
6328
|
}
|
|
6379
6329
|
}, j = (e, t) => {
|
|
6380
6330
|
if (e === "order" && Array.isArray(t)) {
|
|
6381
|
-
|
|
6331
|
+
ye(t);
|
|
6382
6332
|
return;
|
|
6383
6333
|
}
|
|
6384
6334
|
if (typeof e == "string" && t && t.fixed !== void 0) {
|
|
6385
6335
|
let n = e, r = t.fixed;
|
|
6386
|
-
|
|
6336
|
+
ye((e) => e.map((e) => (e.key || String(e.dataIndex)) === n ? {
|
|
6387
6337
|
...e,
|
|
6388
6338
|
fixed: r
|
|
6389
6339
|
} : e));
|
|
@@ -6394,7 +6344,7 @@ const ProTable = forwardRef((e, t) => {
|
|
|
6394
6344
|
small: "text-xs [&_th]:py-1.5 [&_td]:py-1",
|
|
6395
6345
|
middle: "text-sm [&_th]:py-2 [&_td]:py-2",
|
|
6396
6346
|
large: "text-base [&_th]:py-3 [&_td]:py-3"
|
|
6397
|
-
}, ot =
|
|
6347
|
+
}, ot = O.length + (y ? 1 : 0) + (b ? 1 : 0), st = (e, t = 0) => {
|
|
6398
6348
|
let n = e.original, r = Ae(n) || e.original.id || e.original.key || e.id, i = A.editingKey === r;
|
|
6399
6349
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
6400
6350
|
/* @__PURE__ */ jsx(ExpandIcon, {
|
|
@@ -6415,7 +6365,7 @@ const ProTable = forwardRef((e, t) => {
|
|
|
6415
6365
|
})
|
|
6416
6366
|
}),
|
|
6417
6367
|
e.getVisibleCells().map((t) => {
|
|
6418
|
-
let n =
|
|
6368
|
+
let n = O.find((e) => (e.key || String(e.dataIndex)) === t.column.id), a = getFixedStyle(t.column), o = n?.width || t.column.getSize(), s = t.column.getIsPinned();
|
|
6419
6369
|
return x && n?.editable && i ? /* @__PURE__ */ jsx(TableCell, {
|
|
6420
6370
|
className: cn("align-middle", n?.align && `text-${n.align}`),
|
|
6421
6371
|
style: {
|
|
@@ -6597,7 +6547,7 @@ const ProTable = forwardRef((e, t) => {
|
|
|
6597
6547
|
t && t.toggleSelected(e);
|
|
6598
6548
|
} catch {}
|
|
6599
6549
|
},
|
|
6600
|
-
getVisibleCells: () =>
|
|
6550
|
+
getVisibleCells: () => O.filter((e) => !e.hideInTable).map((t) => {
|
|
6601
6551
|
let n = t.key || String(t.dataIndex), r = t.dataPath || t.dataIndex, i = () => {
|
|
6602
6552
|
if (r) return getNestedValue(e, Array.isArray(r) || typeof r == "string" ? r : String(r));
|
|
6603
6553
|
}, a = null;
|
|
@@ -6672,7 +6622,7 @@ const ProTable = forwardRef((e, t) => {
|
|
|
6672
6622
|
sensors: Ue,
|
|
6673
6623
|
collisionDetection: closestCenter,
|
|
6674
6624
|
modifiers: [restrictToVerticalAxis],
|
|
6675
|
-
onDragEnd:
|
|
6625
|
+
onDragEnd: Ze,
|
|
6676
6626
|
children: /* @__PURE__ */ jsxs(Table, {
|
|
6677
6627
|
className: cn(at[ze], me && "sticky-header", o?.table),
|
|
6678
6628
|
style: {
|
|
@@ -6704,7 +6654,7 @@ const ProTable = forwardRef((e, t) => {
|
|
|
6704
6654
|
})
|
|
6705
6655
|
}),
|
|
6706
6656
|
e.headers.map((e, t) => {
|
|
6707
|
-
let n =
|
|
6657
|
+
let n = O.find((t) => (t.key || String(t.dataIndex)) === e.column.id), r = getFixedStyle(e.column), i = n?.headerEllipsis ?? n?.ellipsis, a = n?.headerTooltip ?? n?.tooltip, o = n?.width || e.column.getSize(), s = e.column.getIsPinned();
|
|
6708
6658
|
return /* @__PURE__ */ jsx(TableHead, {
|
|
6709
6659
|
style: {
|
|
6710
6660
|
...r,
|
|
@@ -6774,7 +6724,7 @@ const ProTable = forwardRef((e, t) => {
|
|
|
6774
6724
|
filters: n.filters
|
|
6775
6725
|
},
|
|
6776
6726
|
value: Array.isArray(k.getColumn(n.key || String(n.dataIndex))?.getFilterValue()) ? k.getColumn(n.key || String(n.dataIndex))?.getFilterValue() : [],
|
|
6777
|
-
onChange: (e) =>
|
|
6727
|
+
onChange: (e) => rt(n.key || String(n.dataIndex), e),
|
|
6778
6728
|
onClear: () => it(n.key || String(n.dataIndex))
|
|
6779
6729
|
})]
|
|
6780
6730
|
})]
|
|
@@ -6785,7 +6735,7 @@ const ProTable = forwardRef((e, t) => {
|
|
|
6785
6735
|
}), /* @__PURE__ */ jsx(TableBody, {
|
|
6786
6736
|
className: cn(o?.tableBody),
|
|
6787
6737
|
children: h ? /* @__PURE__ */ jsx(LoadingState, {
|
|
6788
|
-
columnCount:
|
|
6738
|
+
columnCount: O.length,
|
|
6789
6739
|
draggable: !!b,
|
|
6790
6740
|
rowSelection: !!y,
|
|
6791
6741
|
rowCount: A.pageSize
|
|
@@ -6815,12 +6765,12 @@ const ProTable = forwardRef((e, t) => {
|
|
|
6815
6765
|
style: l,
|
|
6816
6766
|
children: [
|
|
6817
6767
|
E !== !1 && (() => {
|
|
6818
|
-
let e = extractSearchColumns(
|
|
6768
|
+
let e = extractSearchColumns(O);
|
|
6819
6769
|
return e.length > 0 || typeof E == "object" && E ? /* @__PURE__ */ jsx(Search, {
|
|
6820
6770
|
...typeof E == "object" ? E : {},
|
|
6821
6771
|
columns: e,
|
|
6822
|
-
onSearch:
|
|
6823
|
-
onReset:
|
|
6772
|
+
onSearch: tt,
|
|
6773
|
+
onReset: nt,
|
|
6824
6774
|
loading: A.loading
|
|
6825
6775
|
}) : null;
|
|
6826
6776
|
})(),
|
|
@@ -6829,7 +6779,7 @@ const ProTable = forwardRef((e, t) => {
|
|
|
6829
6779
|
title: S,
|
|
6830
6780
|
subTitle: C,
|
|
6831
6781
|
table: k,
|
|
6832
|
-
columns:
|
|
6782
|
+
columns: O,
|
|
6833
6783
|
loading: A.loading,
|
|
6834
6784
|
onReload: () => xe.reload(),
|
|
6835
6785
|
fullScreen: Ve,
|
|
@@ -6844,7 +6794,7 @@ const ProTable = forwardRef((e, t) => {
|
|
|
6844
6794
|
y && /* @__PURE__ */ jsx(BatchActions, {
|
|
6845
6795
|
selectedCount: A.selectedRowKeys.length,
|
|
6846
6796
|
selectedRows: A.selectedRows,
|
|
6847
|
-
onClear:
|
|
6797
|
+
onClear: $e,
|
|
6848
6798
|
alwaysShow: y.alwaysShowAlert,
|
|
6849
6799
|
batchActions: y.batchActions
|
|
6850
6800
|
}),
|
|
@@ -6879,8 +6829,8 @@ const ProTable = forwardRef((e, t) => {
|
|
|
6879
6829
|
})
|
|
6880
6830
|
});
|
|
6881
6831
|
return re ? /* @__PURE__ */ jsx(Card, {
|
|
6882
|
-
...
|
|
6883
|
-
className: cn(
|
|
6832
|
+
...se,
|
|
6833
|
+
className: cn(se?.className),
|
|
6884
6834
|
children: /* @__PURE__ */ jsx(CardContent, { children: pt })
|
|
6885
6835
|
}) : pt;
|
|
6886
6836
|
});
|