@gulibs/react-vtable 0.0.20 → 0.0.21
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/dist/index.js
CHANGED
|
@@ -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]", ye = "[object Error]", be = "[object Function]", xe = "[object GeneratorFunction]", O = "[object Map]", k = "[object Number]", Se = "[object Null]", A = "[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[ye] = F[be] = F[O] = F[k] = F[A] = 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[
|
|
84
|
+
I[me] = I[he] = I[Me] = I[Ne] = I[D] = I[_e] = I[Pe] = I[Fe] = I[Ie] = I[Le] = I[Re] = I[O] = I[k] = I[A] = I[Te] = I[Ee] = I[De] = I[Oe] = I[ze] = I[Be] = I[Ve] = I[He] = !0, I[ye] = I[be] = I[Ae] = !1;
|
|
85
85
|
var L = {
|
|
86
86
|
À: "A",
|
|
87
87
|
Á: "A",
|
|
@@ -789,9 +789,9 @@ 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 == be || h == xe;
|
|
793
793
|
if (Su(e)) return ro(e, c);
|
|
794
|
-
if (h ==
|
|
794
|
+
if (h == A || 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));
|
|
796
796
|
} else {
|
|
797
797
|
if (!I[h]) return a ? e : {};
|
|
@@ -900,7 +900,7 @@ var __create = Object.create, __defProp = Object.defineProperty, __getOwnPropDes
|
|
|
900
900
|
return K(e) ? r : Ln(r, n(e));
|
|
901
901
|
}
|
|
902
902
|
function qi(e) {
|
|
903
|
-
return e == null ? e === n ? ke :
|
|
903
|
+
return e == null ? e === n ? ke : Se : Jt && Jt in M(e) ? rs(e) : As(e);
|
|
904
904
|
}
|
|
905
905
|
function Ji(e, t) {
|
|
906
906
|
return e > t;
|
|
@@ -957,8 +957,8 @@ var __create = Object.create, __defProp = Object.defineProperty, __getOwnPropDes
|
|
|
957
957
|
}
|
|
958
958
|
function aa(e, t, n, r, i, a) {
|
|
959
959
|
var o = K(e), s = K(t), c = o ? he : cs(e), l = s ? he : cs(t);
|
|
960
|
-
c = c == me ?
|
|
961
|
-
var u = c ==
|
|
960
|
+
c = c == me ? A : c, l = l == me ? A : l;
|
|
961
|
+
var u = c == A, d = l == A, f = c == l;
|
|
962
962
|
if (f && Su(e)) {
|
|
963
963
|
if (!Su(t)) return !1;
|
|
964
964
|
o = !0, u = !1;
|
|
@@ -974,7 +974,7 @@ var __create = Object.create, __defProp = Object.defineProperty, __getOwnPropDes
|
|
|
974
974
|
return f ? (a ||= new ui(), qo(e, t, n, r, i, a)) : !1;
|
|
975
975
|
}
|
|
976
976
|
function oa(e) {
|
|
977
|
-
return Y(e) && cs(e) ==
|
|
977
|
+
return Y(e) && cs(e) == O;
|
|
978
978
|
}
|
|
979
979
|
function sa(e, t, r, i) {
|
|
980
980
|
var a = r.length, o = a, s = !i;
|
|
@@ -1581,7 +1581,7 @@ var __create = Object.create, __defProp = Object.defineProperty, __getOwnPropDes
|
|
|
1581
1581
|
function Bo(e) {
|
|
1582
1582
|
return function(t) {
|
|
1583
1583
|
var n = cs(t);
|
|
1584
|
-
return n ==
|
|
1584
|
+
return n == O ? _r(t) : n == Ee ? xr(t) : nr(t, e(t));
|
|
1585
1585
|
};
|
|
1586
1586
|
}
|
|
1587
1587
|
function Vo(e, t, r, i, a, s, c, l) {
|
|
@@ -1653,11 +1653,11 @@ var __create = Object.create, __defProp = Object.defineProperty, __getOwnPropDes
|
|
|
1653
1653
|
case Me: return !(e.byteLength != t.byteLength || !a(new Bt(e), new Bt(t)));
|
|
1654
1654
|
case D:
|
|
1655
1655
|
case _e:
|
|
1656
|
-
case
|
|
1657
|
-
case
|
|
1656
|
+
case k: return hu(+e, +t);
|
|
1657
|
+
case ye: return e.name == t.name && e.message == t.message;
|
|
1658
1658
|
case Te:
|
|
1659
1659
|
case De: return e == t + "";
|
|
1660
|
-
case
|
|
1660
|
+
case O: var s = _r;
|
|
1661
1661
|
case Ee:
|
|
1662
1662
|
var c = r & m;
|
|
1663
1663
|
if (s ||= br, e.size != t.size && !c) return !1;
|
|
@@ -1759,11 +1759,11 @@ var __create = Object.create, __defProp = Object.defineProperty, __getOwnPropDes
|
|
|
1759
1759
|
for (var t = []; e;) Ln(t, os(e)), e = Ht(e);
|
|
1760
1760
|
return t;
|
|
1761
1761
|
} : $f, cs = qi;
|
|
1762
|
-
(vn && cs(new vn(/* @__PURE__ */ new ArrayBuffer(1))) != Ne || yn && cs(new yn()) !=
|
|
1763
|
-
var t = qi(e), r = t ==
|
|
1762
|
+
(vn && cs(new vn(/* @__PURE__ */ new ArrayBuffer(1))) != Ne || yn && cs(new yn()) != O || bn && cs(bn.resolve()) != Ce || Sn && cs(new Sn()) != Ee || z && cs(new z()) != Ae) && (cs = function(e) {
|
|
1763
|
+
var t = qi(e), r = t == A ? e.constructor : n, i = r ? Us(r) : "";
|
|
1764
1764
|
if (i) switch (i) {
|
|
1765
1765
|
case Sr: return Ne;
|
|
1766
|
-
case Or: return
|
|
1766
|
+
case Or: return O;
|
|
1767
1767
|
case kr: return Ce;
|
|
1768
1768
|
case Mr: return Ee;
|
|
1769
1769
|
case Nr: return Ae;
|
|
@@ -1829,8 +1829,8 @@ var __create = Object.create, __defProp = Object.defineProperty, __getOwnPropDes
|
|
|
1829
1829
|
case Be:
|
|
1830
1830
|
case Ve:
|
|
1831
1831
|
case He: return co(e, n);
|
|
1832
|
-
case
|
|
1833
|
-
case
|
|
1832
|
+
case O: return new r();
|
|
1833
|
+
case k:
|
|
1834
1834
|
case De: return new r(e);
|
|
1835
1835
|
case Te: return oo(e);
|
|
1836
1836
|
case Ee: return new r();
|
|
@@ -2382,7 +2382,7 @@ var __create = Object.create, __defProp = Object.defineProperty, __getOwnPropDes
|
|
|
2382
2382
|
if (e == null) return 0;
|
|
2383
2383
|
if (bu(e)) return Gu(e) ? wr(e) : e.length;
|
|
2384
2384
|
var t = cs(e);
|
|
2385
|
-
return t ==
|
|
2385
|
+
return t == O || t == Ee ? e.size : pa(e).length;
|
|
2386
2386
|
}
|
|
2387
2387
|
function Ll(e, t, r) {
|
|
2388
2388
|
var i = K(e) ? Bn : Ra;
|
|
@@ -2603,7 +2603,7 @@ var __create = Object.create, __defProp = Object.defineProperty, __getOwnPropDes
|
|
|
2603
2603
|
if (e == null) return !0;
|
|
2604
2604
|
if (bu(e) && (K(e) || typeof e == "string" || typeof e.splice == "function" || Su(e) || qu(e) || vu(e))) return !e.length;
|
|
2605
2605
|
var t = cs(e);
|
|
2606
|
-
if (t ==
|
|
2606
|
+
if (t == O || t == Ee) return !e.size;
|
|
2607
2607
|
if (ws(e)) return !pa(e).length;
|
|
2608
2608
|
for (var n in e) if (N.call(e, n)) return !1;
|
|
2609
2609
|
return !0;
|
|
@@ -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 == ye || 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 == be || t == xe || t == ge || t == we;
|
|
2631
2631
|
}
|
|
2632
2632
|
function ju(e) {
|
|
2633
2633
|
return typeof e == "number" && e == Z(e);
|
|
@@ -2663,10 +2663,10 @@ var __create = Object.create, __defProp = Object.defineProperty, __getOwnPropDes
|
|
|
2663
2663
|
return e == null;
|
|
2664
2664
|
}
|
|
2665
2665
|
function Bu(e) {
|
|
2666
|
-
return typeof e == "number" || Y(e) && qi(e) ==
|
|
2666
|
+
return typeof e == "number" || Y(e) && qi(e) == k;
|
|
2667
2667
|
}
|
|
2668
2668
|
function Vu(e) {
|
|
2669
|
-
if (!Y(e) || qi(e) !=
|
|
2669
|
+
if (!Y(e) || qi(e) != A) return !1;
|
|
2670
2670
|
var t = Ht(e);
|
|
2671
2671
|
if (t === null) return !0;
|
|
2672
2672
|
var n = N.call(t, "constructor") && t.constructor;
|
|
@@ -2701,7 +2701,7 @@ var __create = Object.create, __defProp = Object.defineProperty, __getOwnPropDes
|
|
|
2701
2701
|
if (bu(e)) return Gu(e) ? Tr(e) : mo(e);
|
|
2702
2702
|
if (qt && e[qt]) return gr(e[qt]());
|
|
2703
2703
|
var t = cs(e);
|
|
2704
|
-
return (t ==
|
|
2704
|
+
return (t == O ? _r : t == Ee ? br : Gd)(e);
|
|
2705
2705
|
}
|
|
2706
2706
|
function ed(e) {
|
|
2707
2707
|
return e ? (e = nd(e), e === oe || e === -oe ? (e < 0 ? -1 : 1) * ce : e === e ? e : 0) : e === 0 ? e : 0;
|
|
@@ -3978,7 +3978,7 @@ function useProTable(e) {
|
|
|
3978
3978
|
]);
|
|
3979
3979
|
let _e = useCallback((e) => {
|
|
3980
3980
|
fe((t) => (0, import_lodash.isFunction)(e) ? e(t || {}) || {} : e && typeof e == "object" ? e : {});
|
|
3981
|
-
}, []), ve = useRef("");
|
|
3981
|
+
}, []), ve = useRef(""), ye = useRef([]), be = useRef([]);
|
|
3982
3982
|
useEffect(() => {
|
|
3983
3983
|
if (b === !1 || !b) return;
|
|
3984
3984
|
let e = [], t = [], n = new Set(T.data.map((e) => String(ge(e))));
|
|
@@ -3991,8 +3991,8 @@ function useProTable(e) {
|
|
|
3991
3991
|
}
|
|
3992
3992
|
}
|
|
3993
3993
|
});
|
|
3994
|
-
let r = [...
|
|
3995
|
-
ve.current !== a && (ve.current = a, E({
|
|
3994
|
+
let r = [...be.current.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, be.current = r, ye.current = i, E({
|
|
3996
3996
|
type: "SET_SELECTION",
|
|
3997
3997
|
payload: {
|
|
3998
3998
|
keys: r,
|
|
@@ -4005,7 +4005,7 @@ function useProTable(e) {
|
|
|
4005
4005
|
ge,
|
|
4006
4006
|
D
|
|
4007
4007
|
]);
|
|
4008
|
-
let
|
|
4008
|
+
let xe = useCallback(() => {
|
|
4009
4009
|
let e = [], n = [];
|
|
4010
4010
|
return t.forEach((t) => {
|
|
4011
4011
|
if (t.hideInTable) return;
|
|
@@ -4015,8 +4015,8 @@ function useProTable(e) {
|
|
|
4015
4015
|
left: e,
|
|
4016
4016
|
right: n
|
|
4017
4017
|
};
|
|
4018
|
-
}, [t]), [
|
|
4019
|
-
|
|
4018
|
+
}, [t]), [O, k] = useState(() => xe()), Se = useCallback((e) => {
|
|
4019
|
+
k((t) => {
|
|
4020
4020
|
if ((0, import_lodash.isFunction)(e)) {
|
|
4021
4021
|
let n = e(t || {
|
|
4022
4022
|
left: [],
|
|
@@ -4034,9 +4034,9 @@ function useProTable(e) {
|
|
|
4034
4034
|
});
|
|
4035
4035
|
}, []);
|
|
4036
4036
|
useEffect(() => {
|
|
4037
|
-
let e =
|
|
4038
|
-
|
|
4039
|
-
}, [
|
|
4037
|
+
let e = xe();
|
|
4038
|
+
k(e);
|
|
4039
|
+
}, [xe]);
|
|
4040
4040
|
let A = useCallback(async (e) => {
|
|
4041
4041
|
if (r) {
|
|
4042
4042
|
E({
|
|
@@ -4116,7 +4116,7 @@ function useProTable(e) {
|
|
|
4116
4116
|
payload: e
|
|
4117
4117
|
});
|
|
4118
4118
|
}, [x, T.total]);
|
|
4119
|
-
let
|
|
4119
|
+
let Ce = useMemo(() => t.filter((e) => !e.hideInTable).map((e) => ({
|
|
4120
4120
|
id: e.key || String(e.dataIndex),
|
|
4121
4121
|
accessorKey: e.dataIndex,
|
|
4122
4122
|
header: e.title,
|
|
@@ -4143,15 +4143,15 @@ function useProTable(e) {
|
|
|
4143
4143
|
return t ? parseFloat(t[1]) : parseInt(String(e.width)) || 100;
|
|
4144
4144
|
})() : 100 : e.fixed ? 100 : void 0,
|
|
4145
4145
|
...e
|
|
4146
|
-
})), [t]),
|
|
4146
|
+
})), [t]), we = useReactTable({
|
|
4147
4147
|
data: T.data,
|
|
4148
|
-
columns:
|
|
4148
|
+
columns: Ce,
|
|
4149
4149
|
state: {
|
|
4150
4150
|
sorting: ae,
|
|
4151
4151
|
columnFilters: se,
|
|
4152
4152
|
columnVisibility: le,
|
|
4153
4153
|
rowSelection: de,
|
|
4154
|
-
columnPinning:
|
|
4154
|
+
columnPinning: O,
|
|
4155
4155
|
pagination: {
|
|
4156
4156
|
pageIndex: T.current - 1,
|
|
4157
4157
|
pageSize: T.pageSize
|
|
@@ -4161,7 +4161,7 @@ function useProTable(e) {
|
|
|
4161
4161
|
onColumnFiltersChange: me,
|
|
4162
4162
|
onColumnVisibilityChange: he,
|
|
4163
4163
|
onRowSelectionChange: _e,
|
|
4164
|
-
onColumnPinningChange:
|
|
4164
|
+
onColumnPinningChange: Se,
|
|
4165
4165
|
getCoreRowModel: getCoreRowModel(),
|
|
4166
4166
|
getFilteredRowModel: getFilteredRowModel(),
|
|
4167
4167
|
getPaginationRowModel: getPaginationRowModel(),
|
|
@@ -4171,7 +4171,7 @@ function useProTable(e) {
|
|
|
4171
4171
|
pageCount: Math.ceil(T.total / T.pageSize),
|
|
4172
4172
|
columnResizeMode: "onChange",
|
|
4173
4173
|
enableColumnPinning: !0
|
|
4174
|
-
}),
|
|
4174
|
+
}), Te = useCallback((e, t) => {
|
|
4175
4175
|
r ? (E({
|
|
4176
4176
|
type: "SET_PAGINATION",
|
|
4177
4177
|
payload: {
|
|
@@ -4192,7 +4192,7 @@ function useProTable(e) {
|
|
|
4192
4192
|
r,
|
|
4193
4193
|
A,
|
|
4194
4194
|
x
|
|
4195
|
-
]),
|
|
4195
|
+
]), Ee = useCallback((e) => {
|
|
4196
4196
|
if (E({
|
|
4197
4197
|
type: "SET_FILTERS",
|
|
4198
4198
|
payload: e
|
|
@@ -4204,7 +4204,7 @@ function useProTable(e) {
|
|
|
4204
4204
|
}));
|
|
4205
4205
|
ce(t);
|
|
4206
4206
|
}
|
|
4207
|
-
}, [r, A]),
|
|
4207
|
+
}, [r, A]), De = useCallback(() => {
|
|
4208
4208
|
E({ type: "RESET" }), r ? A({ current: 1 }) : ce([]);
|
|
4209
4209
|
}, [r, A]);
|
|
4210
4210
|
useEffect(() => {
|
|
@@ -4219,7 +4219,7 @@ function useProTable(e) {
|
|
|
4219
4219
|
}), A({ current: 1 });
|
|
4220
4220
|
}
|
|
4221
4221
|
}, [ae, r]);
|
|
4222
|
-
let
|
|
4222
|
+
let Oe = {
|
|
4223
4223
|
reload: async (e = !1) => {
|
|
4224
4224
|
await A(e ? { current: 1 } : void 0);
|
|
4225
4225
|
},
|
|
@@ -4236,7 +4236,7 @@ function useProTable(e) {
|
|
|
4236
4236
|
keys: [],
|
|
4237
4237
|
rows: []
|
|
4238
4238
|
}
|
|
4239
|
-
}), ie.current.clear();
|
|
4239
|
+
}), ie.current.clear(), ve.current = "", be.current = [], ye.current = [];
|
|
4240
4240
|
},
|
|
4241
4241
|
startEditable: (e) => {
|
|
4242
4242
|
let t = T.data.find((t) => ge(t) === String(e));
|
|
@@ -4263,7 +4263,7 @@ function useProTable(e) {
|
|
|
4263
4263
|
}
|
|
4264
4264
|
};
|
|
4265
4265
|
return useEffect(() => {
|
|
4266
|
-
re.current && Object.assign(re.current,
|
|
4266
|
+
re.current && Object.assign(re.current, Oe);
|
|
4267
4267
|
}), useEffect(() => {
|
|
4268
4268
|
r && !n && A();
|
|
4269
4269
|
}, []), useEffect(() => {
|
|
@@ -4289,14 +4289,14 @@ function useProTable(e) {
|
|
|
4289
4289
|
ge,
|
|
4290
4290
|
b
|
|
4291
4291
|
]), {
|
|
4292
|
-
table:
|
|
4292
|
+
table: we,
|
|
4293
4293
|
state: T,
|
|
4294
4294
|
dispatch: E,
|
|
4295
|
-
actions:
|
|
4295
|
+
actions: Oe,
|
|
4296
4296
|
handlers: {
|
|
4297
|
-
handlePaginationChange:
|
|
4298
|
-
handleSearch:
|
|
4299
|
-
handleReset:
|
|
4297
|
+
handlePaginationChange: Te,
|
|
4298
|
+
handleSearch: Ee,
|
|
4299
|
+
handleReset: De
|
|
4300
4300
|
}
|
|
4301
4301
|
};
|
|
4302
4302
|
}
|
|
@@ -5677,26 +5677,24 @@ function AlertDescription({ className: e,...t }) {
|
|
|
5677
5677
|
}
|
|
5678
5678
|
function BatchActionButtons({ actions: e = [], maxVisibleActions: n = 3, selectedCount: r, selectedRows: i, onClearSelection: a, disabled: o = !1, className: s }) {
|
|
5679
5679
|
if (r === 0 || e.length === 0) return null;
|
|
5680
|
-
let c =
|
|
5680
|
+
let c = useRef(i);
|
|
5681
|
+
c.current = i;
|
|
5682
|
+
let u = useMemo(() => e.map((e) => ({
|
|
5681
5683
|
...e,
|
|
5682
5684
|
onClick: () => {
|
|
5683
|
-
e.onClick(
|
|
5685
|
+
e.onClick(c.current), e.clearSelection && a?.();
|
|
5684
5686
|
}
|
|
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;
|
|
5687
|
+
})), [e, a]), { visibleActions: f, moreActions: p } = useMemo(() => {
|
|
5688
|
+
let e = u.filter((e) => !e.showInMore), t = u.filter((e) => e.showInMore), r = e, i = t;
|
|
5691
5689
|
return e.length > n && (r = e.slice(0, n), i = [...e.slice(n), ...t]), {
|
|
5692
5690
|
visibleActions: r,
|
|
5693
5691
|
moreActions: i
|
|
5694
5692
|
};
|
|
5695
|
-
}, [
|
|
5693
|
+
}, [u, n]), m = useMemo(() => u.filter((e) => e.isExportFormat && !e.showInMore), [u]), h = m.length > 1 && f.some((e) => e.isExportFormat);
|
|
5696
5694
|
return /* @__PURE__ */ jsxs("div", {
|
|
5697
5695
|
className: cn("flex items-center gap-2", s),
|
|
5698
5696
|
children: [
|
|
5699
|
-
|
|
5697
|
+
f.map((e) => e.isExportFormat && h ? null : /* @__PURE__ */ jsxs(Button, {
|
|
5700
5698
|
variant: e.variant,
|
|
5701
5699
|
size: "sm",
|
|
5702
5700
|
onClick: e.onClick,
|
|
@@ -5704,7 +5702,7 @@ function BatchActionButtons({ actions: e = [], maxVisibleActions: n = 3, selecte
|
|
|
5704
5702
|
className: "h-8",
|
|
5705
5703
|
children: [e.icon, e.label]
|
|
5706
5704
|
}, e.key)),
|
|
5707
|
-
|
|
5705
|
+
h && /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, {
|
|
5708
5706
|
asChild: !0,
|
|
5709
5707
|
children: /* @__PURE__ */ jsxs(Button, {
|
|
5710
5708
|
variant: "outline",
|
|
@@ -5715,7 +5713,7 @@ function BatchActionButtons({ actions: e = [], maxVisibleActions: n = 3, selecte
|
|
|
5715
5713
|
})
|
|
5716
5714
|
}), /* @__PURE__ */ jsx(DropdownMenuContent, {
|
|
5717
5715
|
align: "start",
|
|
5718
|
-
children:
|
|
5716
|
+
children: m.map((e) => /* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
5719
5717
|
onClick: e.onClick,
|
|
5720
5718
|
children: [/* @__PURE__ */ jsx("span", {
|
|
5721
5719
|
className: "inline-flex h-4 w-4 mr-2",
|
|
@@ -5723,7 +5721,7 @@ function BatchActionButtons({ actions: e = [], maxVisibleActions: n = 3, selecte
|
|
|
5723
5721
|
}), e.label]
|
|
5724
5722
|
}, e.key))
|
|
5725
5723
|
})] }),
|
|
5726
|
-
|
|
5724
|
+
p.length > 0 && /* @__PURE__ */ jsxs(DropdownMenu, { children: [/* @__PURE__ */ jsx(DropdownMenuTrigger, {
|
|
5727
5725
|
asChild: !0,
|
|
5728
5726
|
children: /* @__PURE__ */ jsx(Button, {
|
|
5729
5727
|
variant: "ghost",
|
|
@@ -5734,14 +5732,14 @@ function BatchActionButtons({ actions: e = [], maxVisibleActions: n = 3, selecte
|
|
|
5734
5732
|
})
|
|
5735
5733
|
}), /* @__PURE__ */ jsx(DropdownMenuContent, {
|
|
5736
5734
|
align: "end",
|
|
5737
|
-
children:
|
|
5735
|
+
children: p.map((e, n) => /* @__PURE__ */ jsxs(React.Fragment, { children: [/* @__PURE__ */ jsxs(DropdownMenuItem, {
|
|
5738
5736
|
onClick: e.onClick,
|
|
5739
5737
|
className: e.variant === "destructive" ? "text-destructive" : "",
|
|
5740
5738
|
children: [e.icon && /* @__PURE__ */ jsx("span", {
|
|
5741
5739
|
className: "inline-flex h-4 w-4 mr-2",
|
|
5742
5740
|
children: e.icon
|
|
5743
5741
|
}), e.label]
|
|
5744
|
-
}), e.key === "delete" && n <
|
|
5742
|
+
}), e.key === "delete" && n < p.length - 1 && /* @__PURE__ */ jsx(DropdownMenuSeparator, {})] }, e.key))
|
|
5745
5743
|
})] })
|
|
5746
5744
|
]
|
|
5747
5745
|
});
|
|
@@ -6233,15 +6231,15 @@ function DraggableRow({ row: e, children: t }) {
|
|
|
6233
6231
|
});
|
|
6234
6232
|
}
|
|
6235
6233
|
const ProTable = forwardRef((e, t) => {
|
|
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, [
|
|
6234
|
+
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, [ye, be] = useState(() => r);
|
|
6237
6235
|
useEffect(() => {
|
|
6238
|
-
|
|
6236
|
+
be(r);
|
|
6239
6237
|
}, [r]);
|
|
6240
|
-
let
|
|
6238
|
+
let xe = {
|
|
6241
6239
|
...e,
|
|
6242
|
-
columns:
|
|
6243
|
-
}, { table:
|
|
6244
|
-
columns:
|
|
6240
|
+
columns: ye
|
|
6241
|
+
}, { table: O, state: k, actions: Se, handlers: A } = useProTable(xe), { request: Ce } = xe, { visibleColumns: we, setVisibleColumns: Te, columnSettings: Ee, updateColumnSettings: De } = useColumns({
|
|
6242
|
+
columns: ye,
|
|
6245
6243
|
rowSelection: !!y,
|
|
6246
6244
|
draggable: !!b,
|
|
6247
6245
|
editable: !!x
|
|
@@ -6252,11 +6250,11 @@ const ProTable = forwardRef((e, t) => {
|
|
|
6252
6250
|
let n = e[ke];
|
|
6253
6251
|
n && Array.isArray(n) && n.length > 0 && t.push(...je(n));
|
|
6254
6252
|
}), t;
|
|
6255
|
-
}, [ke, Ae]), [Me, Ne] = useState(() => D !== !1 && D !== void 0 && D.defaultExpandAllRows &&
|
|
6253
|
+
}, [ke, Ae]), [Me, Ne] = useState(() => D !== !1 && D !== void 0 && D.defaultExpandAllRows && k.data.length > 0 ? je(k.data) : D !== !1 && D !== void 0 && D.defaultExpandedRowKeys || []), Pe = D !== !1 && D !== void 0 ? D.expandedRowKeys ?? Me : Me, Fe = D !== !1 && D !== void 0 && D.expandedRowKeys !== void 0;
|
|
6256
6254
|
useEffect(() => {
|
|
6257
|
-
D !== !1 && D !== void 0 && D.defaultExpandAllRows &&
|
|
6255
|
+
D !== !1 && D !== void 0 && D.defaultExpandAllRows && k.data.length > 0 && !Fe && Ne(je(k.data));
|
|
6258
6256
|
}, [
|
|
6259
|
-
|
|
6257
|
+
k.data,
|
|
6260
6258
|
D !== !1 && D !== void 0 ? D.defaultExpandAllRows : !1,
|
|
6261
6259
|
je,
|
|
6262
6260
|
Fe
|
|
@@ -6276,19 +6274,19 @@ const ProTable = forwardRef((e, t) => {
|
|
|
6276
6274
|
let t = Ae(e);
|
|
6277
6275
|
return Pe.includes(t);
|
|
6278
6276
|
}, [Pe, Ae]), [ze, Be] = useState(d), [Ve, He] = useState(!1), Ue = useSensors(useSensor(PointerSensor), useSensor(KeyboardSensor));
|
|
6279
|
-
useImperativeHandle(t, () =>
|
|
6280
|
-
ve && (typeof ve == "function" ? ve(
|
|
6281
|
-
}, [
|
|
6277
|
+
useImperativeHandle(t, () => Se, [Se]), useEffect(() => {
|
|
6278
|
+
ve && (typeof ve == "function" ? ve(Se) : ve && typeof ve == "object" && "current" in ve && (ve.current = Se));
|
|
6279
|
+
}, [Se, ve]);
|
|
6282
6280
|
let Ze = (e) => {
|
|
6283
6281
|
if (b && typeof b == "object" && typeof b.onDragEnd == "function") {
|
|
6284
6282
|
let { active: t, over: n } = e;
|
|
6285
6283
|
if (!n || t.id === n.id) return;
|
|
6286
|
-
let r =
|
|
6284
|
+
let r = O.getRowModel().rows, i = r.findIndex((e) => String(e.id) === String(t.id)), a = r.findIndex((e) => String(e.id) === String(n.id));
|
|
6287
6285
|
if (i !== -1 && a !== -1) {
|
|
6288
|
-
let t = [...
|
|
6286
|
+
let t = [...k.data], [n] = t.splice(i, 1);
|
|
6289
6287
|
t.splice(a, 0, n);
|
|
6290
6288
|
try {
|
|
6291
|
-
|
|
6289
|
+
Se.setTableData(t);
|
|
6292
6290
|
} catch {}
|
|
6293
6291
|
try {
|
|
6294
6292
|
b.onDragEnd({
|
|
@@ -6303,37 +6301,37 @@ const ProTable = forwardRef((e, t) => {
|
|
|
6303
6301
|
}
|
|
6304
6302
|
}, $e = () => {
|
|
6305
6303
|
try {
|
|
6306
|
-
|
|
6304
|
+
O.toggleAllRowsSelected?.(!1);
|
|
6307
6305
|
} catch {}
|
|
6308
|
-
|
|
6306
|
+
Se.clearSelected();
|
|
6309
6307
|
}, tt = (e) => {
|
|
6310
|
-
|
|
6308
|
+
A.handleSearch(e), de?.(e);
|
|
6311
6309
|
}, nt = () => {
|
|
6312
|
-
|
|
6310
|
+
A.handleReset(), fe?.();
|
|
6313
6311
|
}, rt = (e, t) => {
|
|
6314
|
-
if (
|
|
6312
|
+
if (O.setColumnFilters((n) => {
|
|
6315
6313
|
let r = (Array.isArray(n) ? n : []).filter((t) => t.id !== e);
|
|
6316
6314
|
return t.length > 0 && r.push({
|
|
6317
6315
|
id: e,
|
|
6318
6316
|
value: t
|
|
6319
6317
|
}), r;
|
|
6320
6318
|
}), Ce) {
|
|
6321
|
-
let n = { ...
|
|
6322
|
-
t.length > 0 ? n[e] = t : delete n[e],
|
|
6319
|
+
let n = { ...k.filters };
|
|
6320
|
+
t.length > 0 ? n[e] = t : delete n[e], A.handleSearch(n);
|
|
6323
6321
|
}
|
|
6324
6322
|
}, it = (e) => {
|
|
6325
|
-
if (
|
|
6326
|
-
let t = { ...
|
|
6327
|
-
delete t[e],
|
|
6323
|
+
if (O.setColumnFilters((t) => (Array.isArray(t) ? t : []).filter((t) => t.id !== e)), Ce) {
|
|
6324
|
+
let t = { ...k.filters };
|
|
6325
|
+
delete t[e], A.handleSearch(t);
|
|
6328
6326
|
}
|
|
6329
6327
|
}, j = (e, t) => {
|
|
6330
6328
|
if (e === "order" && Array.isArray(t)) {
|
|
6331
|
-
|
|
6329
|
+
be(t);
|
|
6332
6330
|
return;
|
|
6333
6331
|
}
|
|
6334
6332
|
if (typeof e == "string" && t && t.fixed !== void 0) {
|
|
6335
6333
|
let n = e, r = t.fixed;
|
|
6336
|
-
|
|
6334
|
+
be((e) => e.map((e) => (e.key || String(e.dataIndex)) === n ? {
|
|
6337
6335
|
...e,
|
|
6338
6336
|
fixed: r
|
|
6339
6337
|
} : e));
|
|
@@ -6344,8 +6342,8 @@ const ProTable = forwardRef((e, t) => {
|
|
|
6344
6342
|
small: "text-xs [&_th]:py-1.5 [&_td]:py-1",
|
|
6345
6343
|
middle: "text-sm [&_th]:py-2 [&_td]:py-2",
|
|
6346
6344
|
large: "text-base [&_th]:py-3 [&_td]:py-3"
|
|
6347
|
-
}, ot =
|
|
6348
|
-
let n = e.original, r = Ae(n) || e.original.id || e.original.key || e.id, i =
|
|
6345
|
+
}, ot = ye.length + (y ? 1 : 0) + (b ? 1 : 0), st = (e, t = 0) => {
|
|
6346
|
+
let n = e.original, r = Ae(n) || e.original.id || e.original.key || e.id, i = k.editingKey === r;
|
|
6349
6347
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
6350
6348
|
/* @__PURE__ */ jsx(ExpandIcon, {
|
|
6351
6349
|
record: n,
|
|
@@ -6365,7 +6363,7 @@ const ProTable = forwardRef((e, t) => {
|
|
|
6365
6363
|
})
|
|
6366
6364
|
}),
|
|
6367
6365
|
e.getVisibleCells().map((t) => {
|
|
6368
|
-
let n =
|
|
6366
|
+
let n = ye.find((e) => (e.key || String(e.dataIndex)) === t.column.id), a = getFixedStyle(t.column), o = n?.width || t.column.getSize(), s = t.column.getIsPinned();
|
|
6369
6367
|
return x && n?.editable && i ? /* @__PURE__ */ jsx(TableCell, {
|
|
6370
6368
|
className: cn("align-middle", n?.align && `text-${n.align}`),
|
|
6371
6369
|
style: {
|
|
@@ -6408,10 +6406,10 @@ const ProTable = forwardRef((e, t) => {
|
|
|
6408
6406
|
...e.original,
|
|
6409
6407
|
[n.dataIndex]: t
|
|
6410
6408
|
};
|
|
6411
|
-
|
|
6409
|
+
Se.saveEditable(r, i), x?.onSave && x.onSave(r, i, e.original);
|
|
6412
6410
|
},
|
|
6413
|
-
onCancel: () =>
|
|
6414
|
-
onStartEdit: () =>
|
|
6411
|
+
onCancel: () => Se.cancelEditable(r),
|
|
6412
|
+
onStartEdit: () => Se.startEditable(r)
|
|
6415
6413
|
})
|
|
6416
6414
|
}), o = !!n?.ellipsis;
|
|
6417
6415
|
if (n?.tooltip && !i) {
|
|
@@ -6515,14 +6513,14 @@ const ProTable = forwardRef((e, t) => {
|
|
|
6515
6513
|
record: e.original,
|
|
6516
6514
|
config: {
|
|
6517
6515
|
isEditing: i,
|
|
6518
|
-
editingKey:
|
|
6516
|
+
editingKey: k.editingKey || ""
|
|
6519
6517
|
},
|
|
6520
6518
|
editable: x,
|
|
6521
|
-
onEdit: () =>
|
|
6519
|
+
onEdit: () => Se.startEditable(r),
|
|
6522
6520
|
onSave: () => {
|
|
6523
|
-
|
|
6521
|
+
Se.cancelEditable(r);
|
|
6524
6522
|
},
|
|
6525
|
-
onCancel: () =>
|
|
6523
|
+
onCancel: () => Se.cancelEditable(r),
|
|
6526
6524
|
onDelete: x.onDelete ? () => {
|
|
6527
6525
|
x.onDelete && x.onDelete(r, e.original);
|
|
6528
6526
|
} : void 0
|
|
@@ -6533,26 +6531,26 @@ const ProTable = forwardRef((e, t) => {
|
|
|
6533
6531
|
let n = Ae(e), r = Le(e), i = Re(e), a = e[ke], o = {
|
|
6534
6532
|
id: String(n),
|
|
6535
6533
|
original: e,
|
|
6536
|
-
index:
|
|
6534
|
+
index: k.data.findIndex((e) => Ae(e) === n),
|
|
6537
6535
|
getIsSelected: () => {
|
|
6538
6536
|
try {
|
|
6539
|
-
return
|
|
6537
|
+
return O.getRow(String(n))?.getIsSelected() ?? !1;
|
|
6540
6538
|
} catch {
|
|
6541
6539
|
return !1;
|
|
6542
6540
|
}
|
|
6543
6541
|
},
|
|
6544
6542
|
toggleSelected: (e) => {
|
|
6545
6543
|
try {
|
|
6546
|
-
let t =
|
|
6544
|
+
let t = O.getRow(String(n));
|
|
6547
6545
|
t && t.toggleSelected(e);
|
|
6548
6546
|
} catch {}
|
|
6549
6547
|
},
|
|
6550
|
-
getVisibleCells: () =>
|
|
6548
|
+
getVisibleCells: () => ye.filter((e) => !e.hideInTable).map((t) => {
|
|
6551
6549
|
let n = t.key || String(t.dataIndex), r = t.dataPath || t.dataIndex, i = () => {
|
|
6552
6550
|
if (r) return getNestedValue(e, Array.isArray(r) || typeof r == "string" ? r : String(r));
|
|
6553
6551
|
}, a = null;
|
|
6554
6552
|
try {
|
|
6555
|
-
a =
|
|
6553
|
+
a = O.getColumn(n);
|
|
6556
6554
|
} catch {
|
|
6557
6555
|
a = {
|
|
6558
6556
|
id: n,
|
|
@@ -6583,7 +6581,7 @@ const ProTable = forwardRef((e, t) => {
|
|
|
6583
6581
|
cell: c,
|
|
6584
6582
|
getValue: i,
|
|
6585
6583
|
renderValue: (e) => e,
|
|
6586
|
-
table:
|
|
6584
|
+
table: O
|
|
6587
6585
|
})
|
|
6588
6586
|
};
|
|
6589
6587
|
return c;
|
|
@@ -6639,7 +6637,7 @@ const ProTable = forwardRef((e, t) => {
|
|
|
6639
6637
|
top: typeof me == "object" && me.offsetHeader || 0,
|
|
6640
6638
|
zIndex: 10
|
|
6641
6639
|
} : void 0,
|
|
6642
|
-
children:
|
|
6640
|
+
children: O.getHeaderGroups().map((e) => /* @__PURE__ */ jsxs(TableRow, { children: [
|
|
6643
6641
|
Oe && D?.showExpandColumn !== !1 && /* @__PURE__ */ jsx(TableHead, {
|
|
6644
6642
|
className: "w-8",
|
|
6645
6643
|
style: { width: `${D?.expandColumnWidth || 50}px` }
|
|
@@ -6648,13 +6646,13 @@ const ProTable = forwardRef((e, t) => {
|
|
|
6648
6646
|
y && /* @__PURE__ */ jsx(TableHead, {
|
|
6649
6647
|
className: "w-8",
|
|
6650
6648
|
children: /* @__PURE__ */ jsx(Checkbox, {
|
|
6651
|
-
checked:
|
|
6652
|
-
onCheckedChange: (e) =>
|
|
6649
|
+
checked: O.getIsAllPageRowsSelected?.() ?? !1,
|
|
6650
|
+
onCheckedChange: (e) => O.toggleAllPageRowsSelected?.(!!e),
|
|
6653
6651
|
"aria-label": "Select all"
|
|
6654
6652
|
})
|
|
6655
6653
|
}),
|
|
6656
6654
|
e.headers.map((e, t) => {
|
|
6657
|
-
let n =
|
|
6655
|
+
let n = ye.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();
|
|
6658
6656
|
return /* @__PURE__ */ jsx(TableHead, {
|
|
6659
6657
|
style: {
|
|
6660
6658
|
...r,
|
|
@@ -6723,7 +6721,7 @@ const ProTable = forwardRef((e, t) => {
|
|
|
6723
6721
|
title: n.title,
|
|
6724
6722
|
filters: n.filters
|
|
6725
6723
|
},
|
|
6726
|
-
value: Array.isArray(
|
|
6724
|
+
value: Array.isArray(O.getColumn(n.key || String(n.dataIndex))?.getFilterValue()) ? O.getColumn(n.key || String(n.dataIndex))?.getFilterValue() : [],
|
|
6727
6725
|
onChange: (e) => rt(n.key || String(n.dataIndex), e),
|
|
6728
6726
|
onClear: () => it(n.key || String(n.dataIndex))
|
|
6729
6727
|
})]
|
|
@@ -6735,21 +6733,21 @@ const ProTable = forwardRef((e, t) => {
|
|
|
6735
6733
|
}), /* @__PURE__ */ jsx(TableBody, {
|
|
6736
6734
|
className: cn(o?.tableBody),
|
|
6737
6735
|
children: h ? /* @__PURE__ */ jsx(LoadingState, {
|
|
6738
|
-
columnCount:
|
|
6736
|
+
columnCount: ye.length,
|
|
6739
6737
|
draggable: !!b,
|
|
6740
6738
|
rowSelection: !!y,
|
|
6741
|
-
rowCount:
|
|
6742
|
-
}) :
|
|
6739
|
+
rowCount: k.pageSize
|
|
6740
|
+
}) : k.data.length === 0 ? /* @__PURE__ */ jsx(EmptyState, {
|
|
6743
6741
|
colSpan: ot,
|
|
6744
6742
|
emptyRender: ue
|
|
6745
6743
|
}) : b ? /* @__PURE__ */ jsx(SortableContext, {
|
|
6746
|
-
items:
|
|
6744
|
+
items: O.getRowModel().rows.map((e) => e.id),
|
|
6747
6745
|
strategy: verticalListSortingStrategy,
|
|
6748
|
-
children:
|
|
6749
|
-
}) : Oe ? /* @__PURE__ */ jsx(Fragment$1, { children:
|
|
6746
|
+
children: O.getRowModel().rows.map((e, t) => lt(e, t))
|
|
6747
|
+
}) : Oe ? /* @__PURE__ */ jsx(Fragment$1, { children: k.data.map((e) => {
|
|
6750
6748
|
let t = ct(e, 0);
|
|
6751
6749
|
return /* @__PURE__ */ jsx(Fragment, { children: t }, Ae(e));
|
|
6752
|
-
}) }) :
|
|
6750
|
+
}) }) : O.getRowModel().rows.map((e, t) => lt(e, t))
|
|
6753
6751
|
})]
|
|
6754
6752
|
})
|
|
6755
6753
|
})
|
|
@@ -6765,23 +6763,23 @@ const ProTable = forwardRef((e, t) => {
|
|
|
6765
6763
|
style: l,
|
|
6766
6764
|
children: [
|
|
6767
6765
|
E !== !1 && (() => {
|
|
6768
|
-
let e = extractSearchColumns(
|
|
6766
|
+
let e = extractSearchColumns(ye);
|
|
6769
6767
|
return e.length > 0 || typeof E == "object" && E ? /* @__PURE__ */ jsx(Search, {
|
|
6770
6768
|
...typeof E == "object" ? E : {},
|
|
6771
6769
|
columns: e,
|
|
6772
6770
|
onSearch: tt,
|
|
6773
6771
|
onReset: nt,
|
|
6774
|
-
loading:
|
|
6772
|
+
loading: k.loading
|
|
6775
6773
|
}) : null;
|
|
6776
6774
|
})(),
|
|
6777
6775
|
g !== !1 && /* @__PURE__ */ jsx(ToolBar, {
|
|
6778
6776
|
...typeof g == "object" ? g : {},
|
|
6779
6777
|
title: S,
|
|
6780
6778
|
subTitle: C,
|
|
6781
|
-
table:
|
|
6782
|
-
columns:
|
|
6783
|
-
loading:
|
|
6784
|
-
onReload: () =>
|
|
6779
|
+
table: O,
|
|
6780
|
+
columns: ye,
|
|
6781
|
+
loading: k.loading,
|
|
6782
|
+
onReload: () => Se.reload(),
|
|
6785
6783
|
fullScreen: Ve,
|
|
6786
6784
|
onFullScreenChange: He,
|
|
6787
6785
|
density: ze,
|
|
@@ -6792,35 +6790,35 @@ const ProTable = forwardRef((e, t) => {
|
|
|
6792
6790
|
onColumnSettingsChange: j
|
|
6793
6791
|
}),
|
|
6794
6792
|
y && /* @__PURE__ */ jsx(BatchActions, {
|
|
6795
|
-
selectedCount:
|
|
6796
|
-
selectedRows:
|
|
6793
|
+
selectedCount: k.selectedRowKeys.length,
|
|
6794
|
+
selectedRows: k.selectedRows,
|
|
6797
6795
|
onClear: $e,
|
|
6798
6796
|
alwaysShow: y.alwaysShowAlert,
|
|
6799
6797
|
batchActions: y.batchActions
|
|
6800
6798
|
}),
|
|
6801
|
-
le?.(e,
|
|
6799
|
+
le?.(e, k.data),
|
|
6802
6800
|
dt,
|
|
6803
6801
|
ne && /* @__PURE__ */ jsx("div", {
|
|
6804
6802
|
className: "px-4",
|
|
6805
|
-
children: ne(
|
|
6803
|
+
children: ne(k.data)
|
|
6806
6804
|
}),
|
|
6807
6805
|
_ !== !1 && (() => {
|
|
6808
6806
|
let e = typeof _ == "object" ? _ : {}, t = /* @__PURE__ */ jsx(Pagination, {
|
|
6809
6807
|
...e,
|
|
6810
|
-
current:
|
|
6811
|
-
pageSize:
|
|
6812
|
-
total:
|
|
6813
|
-
onPaginationChange:
|
|
6808
|
+
current: k.current,
|
|
6809
|
+
pageSize: k.pageSize,
|
|
6810
|
+
total: k.total,
|
|
6811
|
+
onPaginationChange: A.handlePaginationChange
|
|
6814
6812
|
});
|
|
6815
6813
|
return v ? v({
|
|
6816
6814
|
pagination: {
|
|
6817
6815
|
...e,
|
|
6818
|
-
current:
|
|
6819
|
-
pageSize:
|
|
6820
|
-
total:
|
|
6816
|
+
current: k.current,
|
|
6817
|
+
pageSize: k.pageSize,
|
|
6818
|
+
total: k.total
|
|
6821
6819
|
},
|
|
6822
6820
|
onChange: (t, n) => {
|
|
6823
|
-
e.onChange?.(t, n),
|
|
6821
|
+
e.onChange?.(t, n), A.handlePaginationChange(t, n);
|
|
6824
6822
|
},
|
|
6825
6823
|
defaultDom: t
|
|
6826
6824
|
}) : t;
|