@redi.run/redi-components 0.0.29 → 0.0.31
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.d.ts +2 -4
- package/dist/redi-components.css +1 -1
- package/dist/redi-components.js +324 -387
- package/dist/redi-components.umd.cjs +40 -42
- package/package.json +1 -1
package/dist/redi-components.js
CHANGED
|
@@ -34,6 +34,38 @@ const CloseIcon = ({ color: e, size: t = 24 }) => /* @__PURE__ */ jsx("svg", {
|
|
|
34
34
|
strokeWidth: 2,
|
|
35
35
|
d: "M8 9h8M8 15h8"
|
|
36
36
|
})
|
|
37
|
+
}), DragToggleIcon = ({ active: e = !1, size: t = 14, className: n = "", label: r = "Draggable" }) => e ? /* @__PURE__ */ jsx(DragIcon, {
|
|
38
|
+
size: t,
|
|
39
|
+
className: n
|
|
40
|
+
}) : /* @__PURE__ */ jsxs("svg", {
|
|
41
|
+
width: t,
|
|
42
|
+
height: t,
|
|
43
|
+
viewBox: "0 0 24 24",
|
|
44
|
+
fill: "none",
|
|
45
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
46
|
+
className: n,
|
|
47
|
+
"aria-label": r,
|
|
48
|
+
children: [
|
|
49
|
+
/* @__PURE__ */ jsx("title", { children: r }),
|
|
50
|
+
/* @__PURE__ */ jsx("rect", {
|
|
51
|
+
x: "4",
|
|
52
|
+
y: "4",
|
|
53
|
+
width: "16",
|
|
54
|
+
height: "16",
|
|
55
|
+
rx: "2",
|
|
56
|
+
stroke: "#9ca3af",
|
|
57
|
+
strokeWidth: "2",
|
|
58
|
+
fill: "none"
|
|
59
|
+
}),
|
|
60
|
+
/* @__PURE__ */ jsx("line", {
|
|
61
|
+
x1: "4",
|
|
62
|
+
y1: "4",
|
|
63
|
+
x2: "20",
|
|
64
|
+
y2: "20",
|
|
65
|
+
stroke: "#9ca3af",
|
|
66
|
+
strokeWidth: "2"
|
|
67
|
+
})
|
|
68
|
+
]
|
|
37
69
|
}), EyeIcon = ({ color: e, size: t = 24 }) => /* @__PURE__ */ jsxs("svg", {
|
|
38
70
|
viewBox: "0 0 20 20",
|
|
39
71
|
fill: e,
|
|
@@ -81,22 +113,6 @@ const CloseIcon = ({ color: e, size: t = 24 }) => /* @__PURE__ */ jsx("svg", {
|
|
|
81
113
|
strokeWidth: "2",
|
|
82
114
|
strokeLinecap: "round"
|
|
83
115
|
})]
|
|
84
|
-
}), PinIcon = ({ size: e = 20, color: t = "currentColor", className: n = "" }) => /* @__PURE__ */ jsxs("svg", {
|
|
85
|
-
width: e,
|
|
86
|
-
height: e,
|
|
87
|
-
viewBox: "0 0 24 24",
|
|
88
|
-
fill: "none",
|
|
89
|
-
stroke: t,
|
|
90
|
-
strokeWidth: "2",
|
|
91
|
-
strokeLinecap: "round",
|
|
92
|
-
strokeLinejoin: "round",
|
|
93
|
-
className: n,
|
|
94
|
-
children: [/* @__PURE__ */ jsx("line", {
|
|
95
|
-
x1: "12",
|
|
96
|
-
y1: "17",
|
|
97
|
-
x2: "12",
|
|
98
|
-
y2: "22"
|
|
99
|
-
}), /* @__PURE__ */ jsx("path", { d: "M5 17h14v-1.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V6h1a2 2 0 0 0 0-4H8a2 2 0 0 0 0 4h1v4.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24Z" })]
|
|
100
116
|
});
|
|
101
117
|
/*! xlsx.js (C) 2013-present SheetJS -- http://sheetjs.com */
|
|
102
118
|
var XLSX = {};
|
|
@@ -1663,13 +1679,13 @@ var CRC32 = /* @__PURE__ */ (function() {
|
|
|
1663
1679
|
for (o += e; a < o - 1; ++a) i.write_shift(-4, a + 1);
|
|
1664
1680
|
e && (++a, i.write_shift(-4, O));
|
|
1665
1681
|
};
|
|
1666
|
-
for (o = a = 0, o += r[1]; a < o; ++a) i.write_shift(-4,
|
|
1667
|
-
for (o += r[2]; a < o; ++a) i.write_shift(-4,
|
|
1682
|
+
for (o = a = 0, o += r[1]; a < o; ++a) i.write_shift(-4, R.DIFSECT);
|
|
1683
|
+
for (o += r[2]; a < o; ++a) i.write_shift(-4, R.FATSECT);
|
|
1668
1684
|
s(r[3]), s(r[4]);
|
|
1669
1685
|
for (var c = 0, l = 0, u = e.FileIndex[0]; c < e.FileIndex.length; ++c) u = e.FileIndex[c], u.content && (l = u.content.length, !(l < 4096) && (u.start = o, s(l + 511 >> 9)));
|
|
1670
|
-
for (s(r[6] + 7 >> 3); i.l & 511;) i.write_shift(-4,
|
|
1686
|
+
for (s(r[6] + 7 >> 3); i.l & 511;) i.write_shift(-4, R.ENDOFCHAIN);
|
|
1671
1687
|
for (o = a = 0, c = 0; c < e.FileIndex.length; ++c) u = e.FileIndex[c], u.content && (l = u.content.length, !(!l || l >= 4096) && (u.start = o, s(l + 63 >> 6)));
|
|
1672
|
-
for (; i.l & 511;) i.write_shift(-4,
|
|
1688
|
+
for (; i.l & 511;) i.write_shift(-4, R.ENDOFCHAIN);
|
|
1673
1689
|
for (a = 0; a < r[4] << 2; ++a) {
|
|
1674
1690
|
var d = e.FullPaths[a];
|
|
1675
1691
|
if (!d || d.length === 0) {
|
|
@@ -1721,7 +1737,7 @@ var CRC32 = /* @__PURE__ */ (function() {
|
|
|
1721
1737
|
177,
|
|
1722
1738
|
26,
|
|
1723
1739
|
225
|
|
1724
|
-
], j = "00000000000000000000000000000000",
|
|
1740
|
+
], j = "00000000000000000000000000000000", R = {
|
|
1725
1741
|
MAXREGSECT: -6,
|
|
1726
1742
|
DIFSECT: -4,
|
|
1727
1743
|
FATSECT: -3,
|
|
@@ -1741,28 +1757,28 @@ var CRC32 = /* @__PURE__ */ (function() {
|
|
|
1741
1757
|
"root"
|
|
1742
1758
|
]
|
|
1743
1759
|
};
|
|
1744
|
-
function
|
|
1760
|
+
function z(e, t, n) {
|
|
1745
1761
|
c();
|
|
1746
1762
|
var r = T(e, n);
|
|
1747
1763
|
s.writeFileSync(t, r);
|
|
1748
1764
|
}
|
|
1749
|
-
function
|
|
1765
|
+
function B(e) {
|
|
1750
1766
|
for (var t = Array(e.length), n = 0; n < e.length; ++n) t[n] = String.fromCharCode(e[n]);
|
|
1751
1767
|
return t.join("");
|
|
1752
1768
|
}
|
|
1753
|
-
function
|
|
1769
|
+
function Jf(e, t) {
|
|
1754
1770
|
var n = T(e, t);
|
|
1755
1771
|
switch (t && t.type || "buffer") {
|
|
1756
1772
|
case "file": return c(), s.writeFileSync(t.filename, n), n;
|
|
1757
|
-
case "binary": return typeof n == "string" ? n :
|
|
1758
|
-
case "base64": return Base64_encode(typeof n == "string" ? n :
|
|
1773
|
+
case "binary": return typeof n == "string" ? n : B(n);
|
|
1774
|
+
case "base64": return Base64_encode(typeof n == "string" ? n : B(n));
|
|
1759
1775
|
case "buffer": if (has_buf) return Buffer.isBuffer(n) ? n : Buffer_from(n);
|
|
1760
1776
|
case "array": return typeof n == "string" ? s2a(n) : n;
|
|
1761
1777
|
}
|
|
1762
1778
|
return n;
|
|
1763
1779
|
}
|
|
1764
1780
|
var V;
|
|
1765
|
-
function
|
|
1781
|
+
function Zf(e) {
|
|
1766
1782
|
try {
|
|
1767
1783
|
var t = e.InflateRaw, n = new t();
|
|
1768
1784
|
if (n._processChunk(new Uint8Array([3, 0]), n._finishFlushFlag), n.bytesRead) V = e;
|
|
@@ -1771,15 +1787,15 @@ var CRC32 = /* @__PURE__ */ (function() {
|
|
|
1771
1787
|
console.error("cannot use native zlib: " + (e.message || e));
|
|
1772
1788
|
}
|
|
1773
1789
|
}
|
|
1774
|
-
function
|
|
1790
|
+
function Qf(e, t) {
|
|
1775
1791
|
if (!V) return Sp(e, t);
|
|
1776
1792
|
var n = V.InflateRaw, r = new n(), i = r._processChunk(e.slice(e.l), r._finishFlushFlag);
|
|
1777
1793
|
return e.l += r.bytesRead, i;
|
|
1778
1794
|
}
|
|
1779
|
-
function
|
|
1795
|
+
function $f(e) {
|
|
1780
1796
|
return V ? V.deflateRawSync(e) : mp(e);
|
|
1781
1797
|
}
|
|
1782
|
-
var
|
|
1798
|
+
var ep = [
|
|
1783
1799
|
16,
|
|
1784
1800
|
17,
|
|
1785
1801
|
18,
|
|
@@ -1799,7 +1815,7 @@ var CRC32 = /* @__PURE__ */ (function() {
|
|
|
1799
1815
|
14,
|
|
1800
1816
|
1,
|
|
1801
1817
|
15
|
|
1802
|
-
],
|
|
1818
|
+
], H = [
|
|
1803
1819
|
3,
|
|
1804
1820
|
4,
|
|
1805
1821
|
5,
|
|
@@ -1861,16 +1877,16 @@ var CRC32 = /* @__PURE__ */ (function() {
|
|
|
1861
1877
|
16385,
|
|
1862
1878
|
24577
|
|
1863
1879
|
];
|
|
1864
|
-
function
|
|
1880
|
+
function W(e) {
|
|
1865
1881
|
var t = (e << 1 | e << 11) & 139536 | (e << 5 | e << 15) & 558144;
|
|
1866
1882
|
return (t >> 16 | t >> 8 | t) & 255;
|
|
1867
1883
|
}
|
|
1868
|
-
for (var
|
|
1869
|
-
function
|
|
1870
|
-
var n =
|
|
1871
|
-
return t <= 8 ? n >>> 8 - t : (n = n << 8 |
|
|
1884
|
+
for (var G = typeof Uint8Array < "u", K = G ? new Uint8Array(256) : [], q = 0; q < 256; ++q) K[q] = W(q);
|
|
1885
|
+
function tp(e, t) {
|
|
1886
|
+
var n = K[e & 255];
|
|
1887
|
+
return t <= 8 ? n >>> 8 - t : (n = n << 8 | K[e >> 8 & 255], t <= 16 ? n >>> 16 - t : (n = n << 8 | K[e >> 16 & 255], n >>> 24 - t));
|
|
1872
1888
|
}
|
|
1873
|
-
function
|
|
1889
|
+
function np(e, t) {
|
|
1874
1890
|
var n = t & 7, r = t >>> 3;
|
|
1875
1891
|
return (e[r] | (n <= 6 ? 0 : e[r + 1] << 8)) >>> n & 3;
|
|
1876
1892
|
}
|
|
@@ -1890,27 +1906,27 @@ var CRC32 = /* @__PURE__ */ (function() {
|
|
|
1890
1906
|
var n = t & 7, r = t >>> 3;
|
|
1891
1907
|
return (e[r] | (n <= 1 ? 0 : e[r + 1] << 8)) >>> n & 127;
|
|
1892
1908
|
}
|
|
1893
|
-
function
|
|
1909
|
+
function J(e, t, n) {
|
|
1894
1910
|
var r = t & 7, i = t >>> 3, a = (1 << n) - 1, o = e[i] >>> r;
|
|
1895
1911
|
return n < 8 - r || (o |= e[i + 1] << 8 - r, n < 16 - r) || (o |= e[i + 2] << 16 - r, n < 24 - r) || (o |= e[i + 3] << 24 - r), o & a;
|
|
1896
1912
|
}
|
|
1897
|
-
function
|
|
1913
|
+
function sp(e, t, n) {
|
|
1898
1914
|
var r = t & 7, i = t >>> 3;
|
|
1899
1915
|
return r <= 5 ? e[i] |= (n & 7) << r : (e[i] |= n << r & 255, e[i + 1] = (n & 7) >> 8 - r), t + 3;
|
|
1900
1916
|
}
|
|
1901
|
-
function
|
|
1917
|
+
function Y(e, t, n) {
|
|
1902
1918
|
var r = t & 7, i = t >>> 3;
|
|
1903
1919
|
return n = (n & 1) << r, e[i] |= n, t + 1;
|
|
1904
1920
|
}
|
|
1905
|
-
function
|
|
1921
|
+
function X(e, t, n) {
|
|
1906
1922
|
var r = t & 7, i = t >>> 3;
|
|
1907
1923
|
return n <<= r, e[i] |= n & 255, n >>>= 8, e[i + 1] = n, t + 8;
|
|
1908
1924
|
}
|
|
1909
|
-
function
|
|
1925
|
+
function cp(e, t, n) {
|
|
1910
1926
|
var r = t & 7, i = t >>> 3;
|
|
1911
1927
|
return n <<= r, e[i] |= n & 255, n >>>= 8, e[i + 1] = n & 255, e[i + 2] = n >>> 8, t + 16;
|
|
1912
1928
|
}
|
|
1913
|
-
function
|
|
1929
|
+
function lp(e, t) {
|
|
1914
1930
|
var n = e.length, r = 2 * n > t ? 2 * n : t + 5, i = 0;
|
|
1915
1931
|
if (n >= t) return e;
|
|
1916
1932
|
if (has_buf) {
|
|
@@ -1918,7 +1934,7 @@ var CRC32 = /* @__PURE__ */ (function() {
|
|
|
1918
1934
|
if (e.copy) e.copy(a);
|
|
1919
1935
|
else for (; i < e.length; ++i) a[i] = e[i];
|
|
1920
1936
|
return a;
|
|
1921
|
-
} else if (
|
|
1937
|
+
} else if (G) {
|
|
1922
1938
|
var o = new Uint8Array(r);
|
|
1923
1939
|
if (o.set) o.set(e);
|
|
1924
1940
|
else for (; i < n; ++i) o[i] = e[i];
|
|
@@ -1926,43 +1942,43 @@ var CRC32 = /* @__PURE__ */ (function() {
|
|
|
1926
1942
|
}
|
|
1927
1943
|
return e.length = r, e;
|
|
1928
1944
|
}
|
|
1929
|
-
function
|
|
1945
|
+
function Z(e) {
|
|
1930
1946
|
for (var t = Array(e), n = 0; n < e; ++n) t[n] = 0;
|
|
1931
1947
|
return t;
|
|
1932
1948
|
}
|
|
1933
|
-
function
|
|
1934
|
-
var r = 1, i = 0, a = 0, o = 0, s = 0, c = e.length, l =
|
|
1949
|
+
function up(e, t, n) {
|
|
1950
|
+
var r = 1, i = 0, a = 0, o = 0, s = 0, c = e.length, l = G ? new Uint16Array(32) : Z(32);
|
|
1935
1951
|
for (a = 0; a < 32; ++a) l[a] = 0;
|
|
1936
1952
|
for (a = c; a < n; ++a) e[a] = 0;
|
|
1937
1953
|
c = e.length;
|
|
1938
|
-
var u =
|
|
1954
|
+
var u = G ? new Uint16Array(c) : Z(c);
|
|
1939
1955
|
for (a = 0; a < c; ++a) l[i = e[a]]++, r < i && (r = i), u[a] = 0;
|
|
1940
1956
|
for (l[0] = 0, a = 1; a <= r; ++a) l[a + 16] = s = s + l[a - 1] << 1;
|
|
1941
1957
|
for (a = 0; a < c; ++a) s = e[a], s != 0 && (u[a] = l[s + 16]++);
|
|
1942
1958
|
var d = 0;
|
|
1943
|
-
for (a = 0; a < c; ++a) if (d = e[a], d != 0) for (s =
|
|
1959
|
+
for (a = 0; a < c; ++a) if (d = e[a], d != 0) for (s = tp(u[a], r) >> r - d, o = (1 << r + 4 - d) - 1; o >= 0; --o) t[s | o << d] = d & 15 | a << 4;
|
|
1944
1960
|
return r;
|
|
1945
1961
|
}
|
|
1946
|
-
var dp =
|
|
1947
|
-
if (!
|
|
1962
|
+
var dp = G ? new Uint16Array(512) : Z(512), fp = G ? new Uint16Array(32) : Z(32);
|
|
1963
|
+
if (!G) {
|
|
1948
1964
|
for (var Q = 0; Q < 512; ++Q) dp[Q] = 0;
|
|
1949
1965
|
for (Q = 0; Q < 32; ++Q) fp[Q] = 0;
|
|
1950
1966
|
}
|
|
1951
1967
|
(function() {
|
|
1952
1968
|
for (var e = [], t = 0; t < 32; t++) e.push(5);
|
|
1953
|
-
|
|
1969
|
+
up(e, fp, 32);
|
|
1954
1970
|
var n = [];
|
|
1955
1971
|
for (t = 0; t <= 143; t++) n.push(8);
|
|
1956
1972
|
for (; t <= 255; t++) n.push(9);
|
|
1957
1973
|
for (; t <= 279; t++) n.push(7);
|
|
1958
1974
|
for (; t <= 287; t++) n.push(8);
|
|
1959
|
-
|
|
1975
|
+
up(n, dp, 288);
|
|
1960
1976
|
})();
|
|
1961
1977
|
var pp = /* @__PURE__ */ (function() {
|
|
1962
|
-
for (var e =
|
|
1978
|
+
for (var e = G ? new Uint8Array(32768) : [], t = 0, n = 0; t < U.length - 1; ++t) for (; n < U[t + 1]; ++n) e[n] = t;
|
|
1963
1979
|
for (; n < 32768; ++n) e[n] = 29;
|
|
1964
|
-
var r =
|
|
1965
|
-
for (t = 0, n = 0; t <
|
|
1980
|
+
var r = G ? new Uint8Array(259) : [];
|
|
1981
|
+
for (t = 0, n = 0; t < H.length - 1; ++t) for (; n < H[t + 1]; ++n) r[n] = t;
|
|
1966
1982
|
function i(e, t) {
|
|
1967
1983
|
for (var n = 0; n < e.length;) {
|
|
1968
1984
|
var r = Math.min(65535, e.length - n), i = n + r == e.length;
|
|
@@ -1971,30 +1987,30 @@ var CRC32 = /* @__PURE__ */ (function() {
|
|
|
1971
1987
|
return t.l;
|
|
1972
1988
|
}
|
|
1973
1989
|
function a(t, n) {
|
|
1974
|
-
for (var i = 0, a = 0, o =
|
|
1990
|
+
for (var i = 0, a = 0, o = G ? new Uint16Array(32768) : []; a < t.length;) {
|
|
1975
1991
|
var s = Math.min(65535, t.length - a);
|
|
1976
1992
|
if (s < 10) {
|
|
1977
|
-
for (i =
|
|
1993
|
+
for (i = sp(n, i, +(a + s == t.length)), i & 7 && (i += 8 - (i & 7)), n.l = i / 8 | 0, n.write_shift(2, s), n.write_shift(2, ~s & 65535); s-- > 0;) n[n.l++] = t[a++];
|
|
1978
1994
|
i = n.l * 8;
|
|
1979
1995
|
continue;
|
|
1980
1996
|
}
|
|
1981
|
-
i =
|
|
1997
|
+
i = sp(n, i, +(a + s == t.length) + 2);
|
|
1982
1998
|
for (var c = 0; s-- > 0;) {
|
|
1983
1999
|
var l = t[a];
|
|
1984
2000
|
c = (c << 5 ^ l) & 32767;
|
|
1985
2001
|
var u = -1, d = 0;
|
|
1986
2002
|
if ((u = o[c]) && (u |= a & -32768, u > a && (u -= 32768), u < a)) for (; t[u + d] == t[a + d] && d < 250;) ++d;
|
|
1987
2003
|
if (d > 2) {
|
|
1988
|
-
l = r[d], l <= 22 ? i =
|
|
2004
|
+
l = r[d], l <= 22 ? i = X(n, i, K[l + 1] >> 1) - 1 : (X(n, i, 3), i += 5, X(n, i, K[l - 23] >> 5), i += 3);
|
|
1989
2005
|
var f = l < 8 ? 0 : l - 4 >> 2;
|
|
1990
|
-
f > 0 && (
|
|
2006
|
+
f > 0 && (cp(n, i, d - H[l]), i += f), l = e[a - u], i = X(n, i, K[l] >> 3), i -= 3;
|
|
1991
2007
|
var p = l < 4 ? 0 : l - 2 >> 1;
|
|
1992
|
-
p > 0 && (
|
|
2008
|
+
p > 0 && (cp(n, i, a - u - U[l]), i += p);
|
|
1993
2009
|
for (var m = 0; m < d; ++m) o[c] = a & 32767, c = (c << 5 ^ t[a]) & 32767, ++a;
|
|
1994
2010
|
s -= d - 1;
|
|
1995
|
-
} else l <= 143 ? l += 48 : i =
|
|
2011
|
+
} else l <= 143 ? l += 48 : i = Y(n, i, 1), i = X(n, i, K[l]), o[c] = a & 32767, ++a;
|
|
1996
2012
|
}
|
|
1997
|
-
i =
|
|
2013
|
+
i = X(n, i, 0) - 1;
|
|
1998
2014
|
}
|
|
1999
2015
|
return n.l = (i + 7) / 8 | 0, n.l;
|
|
2000
2016
|
}
|
|
@@ -2006,7 +2022,7 @@ var CRC32 = /* @__PURE__ */ (function() {
|
|
|
2006
2022
|
var t = new_buf(50 + Math.floor(e.length * 1.1)), n = pp(e, t);
|
|
2007
2023
|
return t.slice(0, n);
|
|
2008
2024
|
}
|
|
2009
|
-
var hp =
|
|
2025
|
+
var hp = G ? new Uint16Array(32768) : Z(32768), gp = G ? new Uint16Array(32768) : Z(32768), _p = G ? new Uint16Array(128) : Z(128), vp = 1, yp = 1;
|
|
2010
2026
|
function bp(e, t) {
|
|
2011
2027
|
var n = ap(e, t) + 257;
|
|
2012
2028
|
t += 5;
|
|
@@ -2014,7 +2030,7 @@ var CRC32 = /* @__PURE__ */ (function() {
|
|
|
2014
2030
|
t += 5;
|
|
2015
2031
|
var i = ip(e, t) + 4;
|
|
2016
2032
|
t += 4;
|
|
2017
|
-
for (var a = 0, o =
|
|
2033
|
+
for (var a = 0, o = G ? new Uint8Array(19) : Z(19), s = [
|
|
2018
2034
|
0,
|
|
2019
2035
|
0,
|
|
2020
2036
|
0,
|
|
@@ -2034,19 +2050,19 @@ var CRC32 = /* @__PURE__ */ (function() {
|
|
|
2034
2050
|
0,
|
|
2035
2051
|
0,
|
|
2036
2052
|
0
|
|
2037
|
-
], c = 1, l =
|
|
2053
|
+
], c = 1, l = G ? new Uint8Array(8) : Z(8), u = G ? new Uint8Array(8) : Z(8), d = o.length, f = 0; f < i; ++f) o[ep[f]] = a = rp(e, t), c < a && (c = a), l[a]++, t += 3;
|
|
2038
2054
|
var p = 0;
|
|
2039
2055
|
for (l[0] = 0, f = 1; f <= c; ++f) u[f] = p = p + l[f - 1] << 1;
|
|
2040
2056
|
for (f = 0; f < d; ++f) (p = o[f]) != 0 && (s[f] = u[p]++);
|
|
2041
2057
|
var m = 0;
|
|
2042
2058
|
for (f = 0; f < d; ++f) if (m = o[f], m != 0) {
|
|
2043
|
-
p =
|
|
2059
|
+
p = K[s[f]] >> 8 - m;
|
|
2044
2060
|
for (var h = (1 << 7 - m) - 1; h >= 0; --h) _p[p | h << m] = m & 7 | f << 3;
|
|
2045
2061
|
}
|
|
2046
2062
|
var g = [];
|
|
2047
2063
|
for (c = 1; g.length < n + r;) switch (p = _p[op(e, t)], t += p & 7, p >>>= 3) {
|
|
2048
2064
|
case 16:
|
|
2049
|
-
for (a = 3 +
|
|
2065
|
+
for (a = 3 + np(e, t), t += 2, p = g[g.length - 1]; a-- > 0;) g.push(p);
|
|
2050
2066
|
break;
|
|
2051
2067
|
case 17:
|
|
2052
2068
|
for (a = 3 + rp(e, t), t += 3; a-- > 0;) g.push(0);
|
|
@@ -2061,7 +2077,7 @@ var CRC32 = /* @__PURE__ */ (function() {
|
|
|
2061
2077
|
var _ = g.slice(0, n), v = g.slice(n);
|
|
2062
2078
|
for (f = n; f < 286; ++f) _[f] = 0;
|
|
2063
2079
|
for (f = r; f < 30; ++f) v[f] = 0;
|
|
2064
|
-
return vp =
|
|
2080
|
+
return vp = up(_, hp, 286), yp = up(v, gp, 30), t;
|
|
2065
2081
|
}
|
|
2066
2082
|
function xp(e, t) {
|
|
2067
2083
|
if (e[0] == 3 && !(e[1] & 3)) return [new_raw_buf(t), 2];
|
|
@@ -2070,22 +2086,22 @@ var CRC32 = /* @__PURE__ */ (function() {
|
|
|
2070
2086
|
else {
|
|
2071
2087
|
n & 7 && (n += 8 - (n & 7));
|
|
2072
2088
|
var l = e[n >>> 3] | e[(n >>> 3) + 1] << 8;
|
|
2073
|
-
if (n += 32, l > 0) for (!t && o < a + l && (i =
|
|
2089
|
+
if (n += 32, l > 0) for (!t && o < a + l && (i = lp(i, a + l), o = i.length); l-- > 0;) i[a++] = e[n >>> 3], n += 8;
|
|
2074
2090
|
continue;
|
|
2075
2091
|
}
|
|
2076
2092
|
for (;;) {
|
|
2077
|
-
!t && o < a + 32767 && (i =
|
|
2078
|
-
var u =
|
|
2093
|
+
!t && o < a + 32767 && (i = lp(i, a + 32767), o = i.length);
|
|
2094
|
+
var u = J(e, n, s), d = r >>> 1 == 1 ? dp[u] : hp[u];
|
|
2079
2095
|
if (n += d & 15, d >>>= 4, !(d >>> 8 & 255)) i[a++] = d;
|
|
2080
2096
|
else if (d == 256) break;
|
|
2081
2097
|
else {
|
|
2082
2098
|
d -= 257;
|
|
2083
2099
|
var f = d < 8 ? 0 : d - 4 >> 2;
|
|
2084
2100
|
f > 5 && (f = 0);
|
|
2085
|
-
var p = a +
|
|
2086
|
-
f > 0 && (p +=
|
|
2101
|
+
var p = a + H[d];
|
|
2102
|
+
f > 0 && (p += J(e, n, f), n += f), u = J(e, n, c), d = r >>> 1 == 1 ? fp[u] : gp[u], n += d & 15, d >>>= 4;
|
|
2087
2103
|
var m = d < 4 ? 0 : d - 2 >> 1, h = U[d];
|
|
2088
|
-
for (m > 0 && (h +=
|
|
2104
|
+
for (m > 0 && (h += J(e, n, m), n += m), !t && o < p && (i = lp(i, p + 100), o = i.length); a < p;) i[a] = i[a - h], ++a;
|
|
2089
2105
|
}
|
|
2090
2106
|
}
|
|
2091
2107
|
}
|
|
@@ -2134,7 +2150,7 @@ var CRC32 = /* @__PURE__ */ (function() {
|
|
|
2134
2150
|
var v = e.slice(e.l, e.l + d);
|
|
2135
2151
|
switch (c) {
|
|
2136
2152
|
case 8:
|
|
2137
|
-
v =
|
|
2153
|
+
v = Qf(e, f);
|
|
2138
2154
|
break;
|
|
2139
2155
|
case 0: break;
|
|
2140
2156
|
default: throw Error("Unsupported ZIP Compression method " + c);
|
|
@@ -2152,7 +2168,7 @@ var CRC32 = /* @__PURE__ */ (function() {
|
|
|
2152
2168
|
for (u = 0; u < m.length; ++u) y.write_shift(1, m.charCodeAt(u) & 127);
|
|
2153
2169
|
y = y.slice(0, y.l), g[f] = CRC32.buf(h.content, 0);
|
|
2154
2170
|
var b = h.content;
|
|
2155
|
-
s == 8 && (b =
|
|
2171
|
+
s == 8 && (b = $f(b)), o = new_buf(30), o.write_shift(4, 67324752), o.write_shift(2, 20), o.write_shift(2, c), o.write_shift(2, s), h.mt ? i(o, h.mt) : o.write_shift(4, 0), o.write_shift(-4, c & 8 ? 0 : g[f]), o.write_shift(4, c & 8 ? 0 : b.length), o.write_shift(4, c & 8 ? 0 : h.content.length), o.write_shift(2, y.length), o.write_shift(2, 0), d += o.length, r.push(o), d += y.length, r.push(y), d += b.length, r.push(b), c & 8 && (o = new_buf(12), o.write_shift(-4, g[f]), o.write_shift(4, b.length), o.write_shift(4, h.content.length), d += o.l, r.push(o)), o = new_buf(46), o.write_shift(4, 33639248), o.write_shift(2, 0), o.write_shift(2, 20), o.write_shift(2, c), o.write_shift(2, s), o.write_shift(4, 0), o.write_shift(-4, g[f]), o.write_shift(4, b.length), o.write_shift(4, h.content.length), o.write_shift(2, y.length), o.write_shift(2, 0), o.write_shift(2, 0), o.write_shift(2, 0), o.write_shift(2, 0), o.write_shift(4, 0), o.write_shift(4, v), _ += o.l, a.push(o), _ += y.length, a.push(y), ++f;
|
|
2156
2172
|
}
|
|
2157
2173
|
return o = new_buf(22), o.write_shift(4, 101010256), o.write_shift(2, 0), o.write_shift(2, 0), o.write_shift(2, f), o.write_shift(2, f), o.write_shift(4, _), o.write_shift(4, d), o.write_shift(2, 0), bconcat([
|
|
2158
2174
|
bconcat(r),
|
|
@@ -2238,8 +2254,8 @@ var CRC32 = /* @__PURE__ */ (function() {
|
|
|
2238
2254
|
a && (u.ctype = a);
|
|
2239
2255
|
}
|
|
2240
2256
|
function Np(e, t) {
|
|
2241
|
-
if (
|
|
2242
|
-
var n = t && t.root || "", r = (has_buf && Buffer.isBuffer(e) ? e.toString("binary") :
|
|
2257
|
+
if (B(e.slice(0, 13)).toLowerCase() != "mime-version:") throw Error("Unsupported MAD header");
|
|
2258
|
+
var n = t && t.root || "", r = (has_buf && Buffer.isBuffer(e) ? e.toString("binary") : B(e)).split("\r\n"), i = 0, a = "";
|
|
2243
2259
|
for (i = 0; i < r.length; ++i) if (a = r[i], /^Content-Location:/i.test(a) && (a = a.slice(a.indexOf("file")), n ||= a.slice(0, a.lastIndexOf("/") + 1), a.slice(0, n.length) != n)) for (; n.length > 0 && (n = n.slice(0, n.length - 1), n = n.slice(0, n.lastIndexOf("/") + 1), a.slice(0, n.length) != n););
|
|
2244
2260
|
var o = (r[1] || "").match(/boundary="(.*?)"/);
|
|
2245
2261
|
if (!o) throw Error("MAD cannot find boundary");
|
|
@@ -2270,7 +2286,7 @@ var CRC32 = /* @__PURE__ */ (function() {
|
|
|
2270
2286
|
}).replace(/[\u0080-\uFFFF]/g, function(e) {
|
|
2271
2287
|
return "_u" + e.charCodeAt(0).toString(16) + "_";
|
|
2272
2288
|
});
|
|
2273
|
-
for (var l = s.content, u = has_buf && Buffer.isBuffer(l) ? l.toString("binary") :
|
|
2289
|
+
for (var l = s.content, u = has_buf && Buffer.isBuffer(l) ? l.toString("binary") : B(l), d = 0, f = Math.min(1024, u.length), p = 0, m = 0; m <= f; ++m) (p = u.charCodeAt(m)) >= 32 && p < 128 && ++d;
|
|
2274
2290
|
var h = d >= f * 4 / 5;
|
|
2275
2291
|
i.push(r), i.push("Content-Location: " + (n.root || "file:///C:/SheetJS/") + o), i.push("Content-Transfer-Encoding: " + (h ? "quoted-printable" : "base64")), i.push("Content-Type: " + Op(s, o)), i.push(""), i.push(h ? Ap(u) : kp(u));
|
|
2276
2292
|
}
|
|
@@ -2312,7 +2328,7 @@ var CRC32 = /* @__PURE__ */ (function() {
|
|
|
2312
2328
|
function zp(e) {
|
|
2313
2329
|
w(e, !0);
|
|
2314
2330
|
}
|
|
2315
|
-
return e.find = E, e.read = x, e.parse = l, e.write =
|
|
2331
|
+
return e.find = E, e.read = x, e.parse = l, e.write = Jf, e.writeFile = z, e.utils = {
|
|
2316
2332
|
cfb_new: Fp,
|
|
2317
2333
|
cfb_add: Ip,
|
|
2318
2334
|
cfb_del: Lp,
|
|
@@ -2322,10 +2338,10 @@ var CRC32 = /* @__PURE__ */ (function() {
|
|
|
2322
2338
|
CheckField,
|
|
2323
2339
|
prep_blob,
|
|
2324
2340
|
bconcat,
|
|
2325
|
-
use_zlib:
|
|
2341
|
+
use_zlib: Zf,
|
|
2326
2342
|
_deflateRaw: mp,
|
|
2327
2343
|
_inflateRaw: Sp,
|
|
2328
|
-
consts:
|
|
2344
|
+
consts: R
|
|
2329
2345
|
}, e;
|
|
2330
2346
|
})(), _fs = void 0;
|
|
2331
2347
|
function blobify(e) {
|
|
@@ -5456,7 +5472,7 @@ var DBF = /* @__PURE__ */ (function() {
|
|
|
5456
5472
|
function e(e, t, n) {
|
|
5457
5473
|
if (e) {
|
|
5458
5474
|
prep_blob(e, e.l || 0);
|
|
5459
|
-
for (var r = n.Enum ||
|
|
5475
|
+
for (var r = n.Enum || z; e.l < e.length;) {
|
|
5460
5476
|
var i = e.read_shift(2), a = r[i] || r[65535], o = e.read_shift(2), s = e.l + o, c = a.f && a.f(e, o, n);
|
|
5461
5477
|
if (e.l = s, t(c, a, i)) return;
|
|
5462
5478
|
}
|
|
@@ -5486,7 +5502,7 @@ var DBF = /* @__PURE__ */ (function() {
|
|
|
5486
5502
|
}
|
|
5487
5503
|
}, f = r.sheetRows || 0;
|
|
5488
5504
|
if (t[2] == 0 && (t[3] == 8 || t[3] == 9) && t.length >= 16 && t[14] == 5 && t[15] === 108) throw Error("Unsupported Works 3 for Mac file");
|
|
5489
|
-
if (t[2] == 2) r.Enum =
|
|
5505
|
+
if (t[2] == 2) r.Enum = z, e(t, function(e, t, n) {
|
|
5490
5506
|
switch (n) {
|
|
5491
5507
|
case 0:
|
|
5492
5508
|
r.vers = e, e >= 4096 && (r.qpro = !0);
|
|
@@ -5525,7 +5541,7 @@ var DBF = /* @__PURE__ */ (function() {
|
|
|
5525
5541
|
default:
|
|
5526
5542
|
}
|
|
5527
5543
|
}, r);
|
|
5528
|
-
else if (t[2] == 26 || t[2] == 14) r.Enum =
|
|
5544
|
+
else if (t[2] == 26 || t[2] == 14) r.Enum = B, t[2] == 14 && (r.qpro = !0, t.l = 0), e(t, function(e, t, n) {
|
|
5529
5545
|
switch (n) {
|
|
5530
5546
|
case 204:
|
|
5531
5547
|
a = e;
|
|
@@ -5590,7 +5606,7 @@ var DBF = /* @__PURE__ */ (function() {
|
|
|
5590
5606
|
if (+n.codepage >= 0 && set_cp(+n.codepage), n.type == "string") throw Error("Cannot write WK3 to JS string");
|
|
5591
5607
|
var r = buf_array();
|
|
5592
5608
|
write_biff_rec(r, 0, o(e));
|
|
5593
|
-
for (var i = 0, a = 0; i < e.SheetNames.length; ++i) (e.Sheets[e.SheetNames[i]] || {})["!ref"] && write_biff_rec(r, 27,
|
|
5609
|
+
for (var i = 0, a = 0; i < e.SheetNames.length; ++i) (e.Sheets[e.SheetNames[i]] || {})["!ref"] && write_biff_rec(r, 27, R(e.SheetNames[i], a++));
|
|
5594
5610
|
var s = 0;
|
|
5595
5611
|
for (i = 0; i < e.SheetNames.length; ++i) {
|
|
5596
5612
|
var c = e.Sheets[e.SheetNames[i]];
|
|
@@ -5881,7 +5897,7 @@ var DBF = /* @__PURE__ */ (function() {
|
|
|
5881
5897
|
return [r, i];
|
|
5882
5898
|
}
|
|
5883
5899
|
}
|
|
5884
|
-
function
|
|
5900
|
+
function L(e, t) {
|
|
5885
5901
|
for (var n = {}, r = e.l + t; e.l < r;) {
|
|
5886
5902
|
var i = e.read_shift(2);
|
|
5887
5903
|
if (i == 14e3) {
|
|
@@ -5891,7 +5907,7 @@ var DBF = /* @__PURE__ */ (function() {
|
|
|
5891
5907
|
}
|
|
5892
5908
|
return n;
|
|
5893
5909
|
}
|
|
5894
|
-
function
|
|
5910
|
+
function R(e, t) {
|
|
5895
5911
|
var n = new_buf(5 + e.length);
|
|
5896
5912
|
n.write_shift(2, 14e3), n.write_shift(2, t);
|
|
5897
5913
|
for (var r = 0; r < e.length; ++r) {
|
|
@@ -5900,7 +5916,7 @@ var DBF = /* @__PURE__ */ (function() {
|
|
|
5900
5916
|
}
|
|
5901
5917
|
return n[n.l++] = 0, n;
|
|
5902
5918
|
}
|
|
5903
|
-
var
|
|
5919
|
+
var z = {
|
|
5904
5920
|
0: {
|
|
5905
5921
|
n: "BOF",
|
|
5906
5922
|
f: parseuint16
|
|
@@ -5992,7 +6008,7 @@ var DBF = /* @__PURE__ */ (function() {
|
|
|
5992
6008
|
f: F
|
|
5993
6009
|
},
|
|
5994
6010
|
65535: { n: "" }
|
|
5995
|
-
},
|
|
6011
|
+
}, B = {
|
|
5996
6012
|
0: { n: "BOF" },
|
|
5997
6013
|
1: { n: "EOF" },
|
|
5998
6014
|
2: { n: "PASSWORD" },
|
|
@@ -6034,7 +6050,7 @@ var DBF = /* @__PURE__ */ (function() {
|
|
|
6034
6050
|
26: { n: "FORMULA1A" },
|
|
6035
6051
|
27: {
|
|
6036
6052
|
n: "XFORMAT",
|
|
6037
|
-
f:
|
|
6053
|
+
f: L
|
|
6038
6054
|
},
|
|
6039
6055
|
28: { n: "DTLABELMISC" },
|
|
6040
6056
|
29: { n: "DTLABELCELL" },
|
|
@@ -11978,8 +11994,8 @@ function write_numbers_iwa(e, t) {
|
|
|
11978
11994
|
var h = write_iwa_file(t);
|
|
11979
11995
|
e.content = compress_iwa_file(h), e.size = e.content.length;
|
|
11980
11996
|
})(), P.data = write_shallow(F), E[3][0].data = write_shallow(N), _[4][0].data = write_shallow(E), p.messages[0].data = write_shallow(_);
|
|
11981
|
-
var
|
|
11982
|
-
return d.content = compress_iwa_file(
|
|
11997
|
+
var L = write_iwa_file(f);
|
|
11998
|
+
return d.content = compress_iwa_file(L), d.size = d.content.length, l;
|
|
11983
11999
|
}
|
|
11984
12000
|
function fix_opts_func(e) {
|
|
11985
12001
|
return function(t) {
|
|
@@ -12957,7 +12973,7 @@ const useAdvancedTable = (e) => {
|
|
|
12957
12973
|
} catch (e) {
|
|
12958
12974
|
console.warn("Error saving table config to cookies:", e);
|
|
12959
12975
|
}
|
|
12960
|
-
}, [d, f]), g = m(), [_, v] = useState(g?.sortConfig || s || void 0), [y, b] = useState(g?.filters || c), [x, S] = useState(g?.columnOrder || o.map((e) => e.id)), [C, w] = useState(g?.hiddenColumns || []), [T, E] = useState(
|
|
12976
|
+
}, [d, f]), g = m(), [_, v] = useState(g?.sortConfig || s || void 0), [y, b] = useState(g?.filters || c), [x, S] = useState(g?.columnOrder || o.map((e) => e.id)), [C, w] = useState(g?.hiddenColumns || []), [T, E] = useState({
|
|
12961
12977
|
page: 1,
|
|
12962
12978
|
pageSize: g?.pagination?.pageSize || l,
|
|
12963
12979
|
total: i.length
|
|
@@ -12967,9 +12983,9 @@ const useAdvancedTable = (e) => {
|
|
|
12967
12983
|
S((t) => {
|
|
12968
12984
|
let n = t.filter((t) => e.includes(t)), r = e.filter((e) => !n.includes(e));
|
|
12969
12985
|
return [...n, ...r];
|
|
12970
|
-
}), w((t) => t.filter((t) => e.includes(t)))
|
|
12986
|
+
}), w((t) => t.filter((t) => e.includes(t)));
|
|
12971
12987
|
}, [o]);
|
|
12972
|
-
let
|
|
12988
|
+
let D = useMemo(() => {
|
|
12973
12989
|
let e = [...i];
|
|
12974
12990
|
return Object.entries(y).forEach(([t, n]) => {
|
|
12975
12991
|
let r = o.find((e) => e.id === t);
|
|
@@ -12982,10 +12998,10 @@ const useAdvancedTable = (e) => {
|
|
|
12982
12998
|
i,
|
|
12983
12999
|
y,
|
|
12984
13000
|
o
|
|
12985
|
-
]),
|
|
12986
|
-
if (!_) return
|
|
13001
|
+
]), O = useMemo(() => {
|
|
13002
|
+
if (!_) return D;
|
|
12987
13003
|
let e = o.find((e) => e.id === _.column);
|
|
12988
|
-
return e ? [...
|
|
13004
|
+
return e ? [...D].sort((t, n) => {
|
|
12989
13005
|
let r = typeof e.accessor == "function" ? e.accessor(t) : t[e.accessor], i = typeof e.accessor == "function" ? e.accessor(n) : n[e.accessor];
|
|
12990
13006
|
if (r == null) return 1;
|
|
12991
13007
|
if (i == null) return -1;
|
|
@@ -12998,41 +13014,39 @@ const useAdvancedTable = (e) => {
|
|
|
12998
13014
|
a = e.localeCompare(t);
|
|
12999
13015
|
}
|
|
13000
13016
|
return _.direction === "desc" ? a * -1 : a;
|
|
13001
|
-
}) :
|
|
13017
|
+
}) : D;
|
|
13002
13018
|
}, [
|
|
13003
|
-
|
|
13019
|
+
D,
|
|
13004
13020
|
_,
|
|
13005
13021
|
o
|
|
13006
|
-
]),
|
|
13007
|
-
let e = (
|
|
13008
|
-
return
|
|
13022
|
+
]), k = useMemo(() => {
|
|
13023
|
+
let e = (T.page - 1) * T.pageSize, t = e + T.pageSize;
|
|
13024
|
+
return O.slice(e, t);
|
|
13009
13025
|
}, [
|
|
13010
|
-
|
|
13011
|
-
|
|
13012
|
-
|
|
13026
|
+
O,
|
|
13027
|
+
T.page,
|
|
13028
|
+
T.pageSize
|
|
13013
13029
|
]);
|
|
13014
13030
|
useEffect(() => {
|
|
13015
|
-
|
|
13031
|
+
E((e) => ({
|
|
13016
13032
|
...e,
|
|
13017
|
-
total:
|
|
13018
|
-
page: Math.min(e.page, Math.ceil(
|
|
13033
|
+
total: D.length,
|
|
13034
|
+
page: Math.min(e.page, Math.ceil(D.length / e.pageSize) || 1)
|
|
13019
13035
|
}));
|
|
13020
|
-
}, [
|
|
13036
|
+
}, [D.length]), useEffect(() => {
|
|
13021
13037
|
let e = {
|
|
13022
13038
|
sort: _,
|
|
13023
13039
|
filters: y,
|
|
13024
13040
|
columnOrder: x,
|
|
13025
13041
|
hiddenColumns: C,
|
|
13026
|
-
|
|
13027
|
-
pageSize: D.pageSize
|
|
13042
|
+
pageSize: T.pageSize
|
|
13028
13043
|
};
|
|
13029
13044
|
h(e), p?.({
|
|
13030
13045
|
sort: _,
|
|
13031
13046
|
filters: y,
|
|
13032
|
-
pagination:
|
|
13047
|
+
pagination: T,
|
|
13033
13048
|
columnOrder: x,
|
|
13034
13049
|
hiddenColumns: C,
|
|
13035
|
-
pinnedColumns: T,
|
|
13036
13050
|
columns: o
|
|
13037
13051
|
});
|
|
13038
13052
|
}, [
|
|
@@ -13040,14 +13054,13 @@ const useAdvancedTable = (e) => {
|
|
|
13040
13054
|
y,
|
|
13041
13055
|
x,
|
|
13042
13056
|
C,
|
|
13043
|
-
T,
|
|
13044
|
-
D.pageSize,
|
|
13057
|
+
T.pageSize,
|
|
13045
13058
|
h,
|
|
13046
13059
|
p,
|
|
13047
|
-
|
|
13060
|
+
T,
|
|
13048
13061
|
o
|
|
13049
13062
|
]);
|
|
13050
|
-
let
|
|
13063
|
+
let A = useCallback((e) => {
|
|
13051
13064
|
v((t) => t?.column === e ? t.direction === "asc" ? {
|
|
13052
13065
|
column: e,
|
|
13053
13066
|
direction: "desc"
|
|
@@ -13055,7 +13068,7 @@ const useAdvancedTable = (e) => {
|
|
|
13055
13068
|
column: e,
|
|
13056
13069
|
direction: "asc"
|
|
13057
13070
|
});
|
|
13058
|
-
}, []),
|
|
13071
|
+
}, []), j = useCallback((e, t, n = "text") => {
|
|
13059
13072
|
b((r) => ({
|
|
13060
13073
|
...r,
|
|
13061
13074
|
[e]: {
|
|
@@ -13063,71 +13076,66 @@ const useAdvancedTable = (e) => {
|
|
|
13063
13076
|
value: t,
|
|
13064
13077
|
options: r[e]?.options
|
|
13065
13078
|
}
|
|
13066
|
-
})),
|
|
13079
|
+
})), E((e) => ({
|
|
13067
13080
|
...e,
|
|
13068
13081
|
page: 1
|
|
13069
13082
|
}));
|
|
13070
|
-
}, []),
|
|
13083
|
+
}, []), M = useCallback((e) => {
|
|
13071
13084
|
b((t) => {
|
|
13072
13085
|
let n = { ...t };
|
|
13073
13086
|
return delete n[e], n;
|
|
13074
13087
|
});
|
|
13075
|
-
}, []),
|
|
13088
|
+
}, []), N = useCallback(() => {
|
|
13076
13089
|
b({});
|
|
13077
|
-
}, []),
|
|
13078
|
-
|
|
13090
|
+
}, []), P = useCallback((e) => {
|
|
13091
|
+
E((t) => ({
|
|
13079
13092
|
...t,
|
|
13080
13093
|
page: e
|
|
13081
13094
|
}));
|
|
13082
|
-
}, []),
|
|
13083
|
-
|
|
13095
|
+
}, []), F = useCallback((e) => {
|
|
13096
|
+
E((t) => ({
|
|
13084
13097
|
...t,
|
|
13085
13098
|
pageSize: e,
|
|
13086
13099
|
page: 1
|
|
13087
13100
|
}));
|
|
13088
|
-
}, []),
|
|
13101
|
+
}, []), I = useCallback((e) => {
|
|
13089
13102
|
S(e);
|
|
13090
13103
|
}, []), L = useCallback((e) => {
|
|
13091
13104
|
w((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
|
|
13092
|
-
}, []),
|
|
13093
|
-
|
|
13094
|
-
|
|
13095
|
-
let e = x.map((e) => o.find((t) => t.id === e)).filter(Boolean).filter((e) => !C.includes(e.id)), t = e.filter((e) => T.includes(e.id)), n = e.filter((e) => !T.includes(e.id));
|
|
13096
|
-
return [...t, ...n];
|
|
13105
|
+
}, []), Kf = useMemo(() => {
|
|
13106
|
+
let e = new Map(o.map((e) => [e.id, e])), t = x.map((t) => e.get(t)).filter(Boolean), n = new Set(t.map((e) => e.id)), r = o.filter((e) => !n.has(e.id));
|
|
13107
|
+
return [...t, ...r].filter((e) => !C.includes(e.id));
|
|
13097
13108
|
}, [
|
|
13098
13109
|
x,
|
|
13099
13110
|
o,
|
|
13100
|
-
C
|
|
13101
|
-
T
|
|
13111
|
+
C
|
|
13102
13112
|
]);
|
|
13103
13113
|
return {
|
|
13104
13114
|
state: {
|
|
13105
13115
|
data: i,
|
|
13106
|
-
filteredData:
|
|
13107
|
-
paginatedData:
|
|
13116
|
+
filteredData: D,
|
|
13117
|
+
paginatedData: k,
|
|
13108
13118
|
sortConfig: _,
|
|
13109
13119
|
filters: y,
|
|
13110
|
-
pagination:
|
|
13120
|
+
pagination: T,
|
|
13111
13121
|
columnOrder: x,
|
|
13112
13122
|
hiddenColumns: C,
|
|
13113
|
-
pinnedColumns: T,
|
|
13114
13123
|
loading: !1
|
|
13115
13124
|
},
|
|
13116
|
-
orderedColumns:
|
|
13125
|
+
orderedColumns: Kf,
|
|
13117
13126
|
pageSizeOptions: u,
|
|
13118
|
-
handleSort:
|
|
13119
|
-
handleFilter:
|
|
13120
|
-
clearFilter:
|
|
13121
|
-
clearAllFilters:
|
|
13122
|
-
handlePageChange:
|
|
13123
|
-
handlePageSizeChange:
|
|
13124
|
-
handleColumnReorder:
|
|
13127
|
+
handleSort: A,
|
|
13128
|
+
handleFilter: j,
|
|
13129
|
+
clearFilter: M,
|
|
13130
|
+
clearAllFilters: N,
|
|
13131
|
+
handlePageChange: P,
|
|
13132
|
+
handlePageSizeChange: F,
|
|
13133
|
+
handleColumnReorder: I,
|
|
13125
13134
|
handleToggleColumn: L,
|
|
13126
|
-
handleTogglePinColumn: R,
|
|
13127
13135
|
allColumns: o
|
|
13128
13136
|
};
|
|
13129
13137
|
};
|
|
13130
|
-
var AdvancedTable_default = ({ data: e, columns: t, defaultSort: o, defaultFilters:
|
|
13138
|
+
var AdvancedTable_default = ({ data: e, columns: t, defaultSort: o, defaultFilters: d = {}, defaultPageSize: g = 10, pageSizeOptions: _ = [
|
|
13131
13139
|
10,
|
|
13132
13140
|
25,
|
|
13133
13141
|
50,
|
|
@@ -13136,7 +13144,7 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: o, defaultFilte
|
|
|
13136
13144
|
300,
|
|
13137
13145
|
400,
|
|
13138
13146
|
500
|
|
13139
|
-
], enableSorting:
|
|
13147
|
+
], enableSorting: v = !0, enableFiltering: y = !0, enablePagination: b = !0, enableExport: x = !0, persistConfig: S = !0, configKey: C = "advancedTable", className: w = "", labels: T = {
|
|
13140
13148
|
configuration: "Configuración",
|
|
13141
13149
|
columnVisibility: "Columnas visibles",
|
|
13142
13150
|
pagination: {
|
|
@@ -13148,58 +13156,57 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: o, defaultFilte
|
|
|
13148
13156
|
perPageItems: "elementos"
|
|
13149
13157
|
},
|
|
13150
13158
|
clearAllFilters: "Limpiar todos los filtros"
|
|
13151
|
-
}, enableColumnReordering:
|
|
13152
|
-
let [
|
|
13159
|
+
}, enableColumnReordering: E = !0, renderActions: D, actionsColumnLabel: O, loading: k = !1 }) => {
|
|
13160
|
+
let [A, j] = useState(null), [M, N] = useState(null), [P, F] = useState(!1), [I, L] = useState(null), Kf = useRef(null), [R, z] = useState(t), { state: B, orderedColumns: qf, handleSort: Jf, handleFilter: Yf, clearAllFilters: Xf, handlePageChange: V, handlePageSizeChange: Zf, handleColumnReorder: Qf, handleToggleColumn: $f } = useAdvancedTable({
|
|
13153
13161
|
data: e,
|
|
13154
13162
|
columns: R,
|
|
13155
13163
|
defaultSort: o,
|
|
13156
|
-
defaultFilters:
|
|
13157
|
-
defaultPageSize:
|
|
13158
|
-
pageSizeOptions:
|
|
13159
|
-
persistConfig:
|
|
13160
|
-
configKey:
|
|
13161
|
-
}), { paginatedData:
|
|
13164
|
+
defaultFilters: d,
|
|
13165
|
+
defaultPageSize: g,
|
|
13166
|
+
pageSizeOptions: _,
|
|
13167
|
+
persistConfig: S,
|
|
13168
|
+
configKey: C
|
|
13169
|
+
}), { paginatedData: ep, sortConfig: H, filters: U, pagination: W, hiddenColumns: G } = B;
|
|
13162
13170
|
useEffect(() => z(t), [t]);
|
|
13163
|
-
let
|
|
13164
|
-
let e = [...
|
|
13165
|
-
return
|
|
13171
|
+
let K = useMemo(() => {
|
|
13172
|
+
let e = [...qf], t = e.filter((e) => e.isAction), n = [...e.filter((e) => !e.isAction), ...t];
|
|
13173
|
+
return D && n.push({
|
|
13166
13174
|
id: "actions-synthetic",
|
|
13167
|
-
label:
|
|
13175
|
+
label: O || "",
|
|
13168
13176
|
accessor: (e) => e,
|
|
13169
|
-
render: (e, t, n) =>
|
|
13177
|
+
render: (e, t, n) => D(t, n),
|
|
13170
13178
|
width: 100,
|
|
13171
13179
|
isAction: !0,
|
|
13172
13180
|
filterable: !1,
|
|
13173
13181
|
sortable: !1,
|
|
13174
|
-
draggable: !1
|
|
13175
|
-
pinned: !1
|
|
13182
|
+
draggable: !1
|
|
13176
13183
|
}), n;
|
|
13177
13184
|
}, [
|
|
13178
|
-
|
|
13179
|
-
|
|
13180
|
-
|
|
13181
|
-
]),
|
|
13182
|
-
|
|
13183
|
-
},
|
|
13184
|
-
e.preventDefault(), e.dataTransfer.dropEffect = "move",
|
|
13185
|
-
},
|
|
13186
|
-
|
|
13187
|
-
},
|
|
13188
|
-
if (e.preventDefault(),
|
|
13189
|
-
if (
|
|
13190
|
-
let e = [...
|
|
13185
|
+
qf,
|
|
13186
|
+
D,
|
|
13187
|
+
O
|
|
13188
|
+
]), q = (e, t) => {
|
|
13189
|
+
j(t), e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData("text/html", "");
|
|
13190
|
+
}, tp = (e, t) => {
|
|
13191
|
+
e.preventDefault(), e.dataTransfer.dropEffect = "move", N(t);
|
|
13192
|
+
}, np = () => {
|
|
13193
|
+
N(null);
|
|
13194
|
+
}, rp = (e, t) => {
|
|
13195
|
+
if (e.preventDefault(), A !== null) {
|
|
13196
|
+
if (A !== t) {
|
|
13197
|
+
let e = [...B.columnOrder], [n] = e.splice(A, 1);
|
|
13191
13198
|
e.splice(t, 0, n), Qf(e);
|
|
13192
13199
|
}
|
|
13193
|
-
|
|
13194
|
-
}
|
|
13195
|
-
},
|
|
13196
|
-
|
|
13197
|
-
},
|
|
13198
|
-
if (!
|
|
13199
|
-
let e =
|
|
13200
|
-
exportToExcel(
|
|
13201
|
-
},
|
|
13202
|
-
|
|
13200
|
+
j(null), N(null);
|
|
13201
|
+
}
|
|
13202
|
+
}, ip = () => {
|
|
13203
|
+
j(null), N(null);
|
|
13204
|
+
}, ap = () => {
|
|
13205
|
+
if (!x) return;
|
|
13206
|
+
let e = K.filter((e) => !e.isAction);
|
|
13207
|
+
exportToExcel(B.filteredData, e, "table-data.xlsx");
|
|
13208
|
+
}, op = (e) => {
|
|
13209
|
+
L(I === e ? null : e);
|
|
13203
13210
|
}, J = (t) => {
|
|
13204
13211
|
let n = R.find((e) => e.id === t);
|
|
13205
13212
|
if (!n) return [];
|
|
@@ -13212,28 +13219,18 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: o, defaultFilte
|
|
|
13212
13219
|
count: t,
|
|
13213
13220
|
label: `${e} (${t})`
|
|
13214
13221
|
})).sort((e, t) => e.value.localeCompare(t.value));
|
|
13215
|
-
},
|
|
13222
|
+
}, sp = Object.values(U).some((e) => e.type === "text" && e.value || e.type === "select" && e.value || e.type === "multiselect" && Array.isArray(e.value) && e.value.length > 0);
|
|
13216
13223
|
useEffect(() => {
|
|
13217
13224
|
let e = (e) => {
|
|
13218
|
-
|
|
13225
|
+
Kf.current && !Kf.current.contains(e.target) && F(!1);
|
|
13219
13226
|
};
|
|
13220
|
-
return
|
|
13227
|
+
return P && document.addEventListener("mousedown", e), () => {
|
|
13221
13228
|
document.removeEventListener("mousedown", e);
|
|
13222
13229
|
};
|
|
13223
|
-
}, [
|
|
13224
|
-
let Y = Math.ceil(
|
|
13225
|
-
if (!K.includes(B[e].id)) return;
|
|
13226
|
-
let t = 0;
|
|
13227
|
-
for (let n = 0; n < e; n++) K.includes(B[n].id) && (t += X(B[n]));
|
|
13228
|
-
return t;
|
|
13229
|
-
}, dp = (e) => {
|
|
13230
|
-
if (!q[e].isAction) return;
|
|
13231
|
-
let t = 0;
|
|
13232
|
-
for (let n = e + 1; n < q.length; n++) q[n].isAction && (t += X(q[n]));
|
|
13233
|
-
return t;
|
|
13234
|
-
};
|
|
13230
|
+
}, [P]);
|
|
13231
|
+
let Y = Math.ceil(W.total / W.pageSize), X = (e) => e.width ? e.width : e.isAction ? 100 : 150 + (e.filterable ? 50 : 0);
|
|
13235
13232
|
return /* @__PURE__ */ jsxs("div", {
|
|
13236
|
-
className: `w-full bg-redi-background border border-solid border-gray-500 rounded-xl overflow-hidden font-family-base shadow ${
|
|
13233
|
+
className: `w-full bg-redi-background border border-solid border-gray-500 rounded-xl overflow-hidden font-family-base shadow ${w}`,
|
|
13237
13234
|
children: [
|
|
13238
13235
|
/* @__PURE__ */ jsxs("div", {
|
|
13239
13236
|
className: "flex items-center justify-between p-4 bg-transparent border-b border-solid border-gray-400",
|
|
@@ -13243,23 +13240,23 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: o, defaultFilte
|
|
|
13243
13240
|
className: "relative",
|
|
13244
13241
|
children: [/* @__PURE__ */ jsxs(Button_default, {
|
|
13245
13242
|
level: "secondary",
|
|
13246
|
-
onClick: () =>
|
|
13243
|
+
onClick: () => F(!P),
|
|
13247
13244
|
children: [/* @__PURE__ */ jsx(EyeIcon, {}), /* @__PURE__ */ jsx("span", {
|
|
13248
13245
|
className: "hidden md:block",
|
|
13249
|
-
children:
|
|
13246
|
+
children: T.configuration
|
|
13250
13247
|
})]
|
|
13251
|
-
}),
|
|
13248
|
+
}), P && /* @__PURE__ */ jsx("div", {
|
|
13252
13249
|
className: "absolute top-full left-0 bg-white border border-solid border-gray-300 rounded-md shadow-lg z-1000 mt-2 min-w-2xs max-w-xs opacity-100 visible p-4",
|
|
13253
|
-
ref:
|
|
13250
|
+
ref: Kf,
|
|
13254
13251
|
children: /* @__PURE__ */ jsxs("div", {
|
|
13255
13252
|
className: "mb-4 last:mb-0",
|
|
13256
13253
|
children: [/* @__PURE__ */ jsx("div", {
|
|
13257
13254
|
className: "text-sm font-semibold text-redi-text mb-2 uppercase",
|
|
13258
|
-
children:
|
|
13255
|
+
children: T.columnVisibility
|
|
13259
13256
|
}), /* @__PURE__ */ jsx("div", {
|
|
13260
13257
|
className: "flex flex-col gap-2",
|
|
13261
13258
|
children: R.filter((e) => !e.isAction).map((e) => {
|
|
13262
|
-
let t = !
|
|
13259
|
+
let t = !G.includes(e.id);
|
|
13263
13260
|
return /* @__PURE__ */ jsxs("div", {
|
|
13264
13261
|
className: "flex items-center justify-between gap-2 hover:bg-gray-50 p-1 rounded",
|
|
13265
13262
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
@@ -13277,74 +13274,60 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: o, defaultFilte
|
|
|
13277
13274
|
})]
|
|
13278
13275
|
}), t && /* @__PURE__ */ jsxs("div", {
|
|
13279
13276
|
className: "flex items-center gap-1",
|
|
13280
|
-
children: [
|
|
13281
|
-
|
|
13282
|
-
|
|
13283
|
-
|
|
13284
|
-
|
|
13285
|
-
|
|
13286
|
-
|
|
13287
|
-
|
|
13288
|
-
|
|
13289
|
-
|
|
13290
|
-
|
|
13291
|
-
|
|
13292
|
-
|
|
13293
|
-
|
|
13294
|
-
|
|
13295
|
-
|
|
13296
|
-
t.stopPropagation();
|
|
13297
|
-
let n = R.map((t) => t.id === e.id ? {
|
|
13298
|
-
...t,
|
|
13299
|
-
draggable: !t.draggable
|
|
13300
|
-
} : t);
|
|
13301
|
-
z(n);
|
|
13302
|
-
},
|
|
13303
|
-
"aria-label": e.draggable ? "Disable drag" : "Enable drag",
|
|
13304
|
-
className: "p-1 hover:bg-gray-200 rounded-full",
|
|
13305
|
-
children: /* @__PURE__ */ jsx(DragIcon, {
|
|
13306
|
-
size: 14,
|
|
13307
|
-
color: e.draggable ? "#fa8c16" : "#9ca3af"
|
|
13308
|
-
})
|
|
13309
|
-
}),
|
|
13310
|
-
/* @__PURE__ */ jsx(Button_default, {
|
|
13311
|
-
level: "icon",
|
|
13312
|
-
onClick: (t) => {
|
|
13313
|
-
t.stopPropagation();
|
|
13314
|
-
let n = R.map((t) => t.id === e.id ? {
|
|
13315
|
-
...t,
|
|
13316
|
-
filterable: !t.filterable
|
|
13317
|
-
} : t);
|
|
13318
|
-
z(n);
|
|
13319
|
-
},
|
|
13320
|
-
"aria-label": e.filterable ? "Disable filter" : "Enable filter",
|
|
13321
|
-
className: "p-1 hover:bg-gray-200 rounded-full",
|
|
13322
|
-
children: e.filterable ? /* @__PURE__ */ jsx(FilterIcon, {
|
|
13323
|
-
size: 14,
|
|
13324
|
-
color: "#fa8c16"
|
|
13325
|
-
}) : /* @__PURE__ */ jsx(FilterOffIcon, {
|
|
13326
|
-
size: 14,
|
|
13327
|
-
color: "#9ca3af"
|
|
13328
|
-
})
|
|
13277
|
+
children: [/* @__PURE__ */ jsx(Button_default, {
|
|
13278
|
+
level: "icon",
|
|
13279
|
+
onClick: (t) => {
|
|
13280
|
+
t.stopPropagation();
|
|
13281
|
+
let n = R.map((t) => t.id === e.id ? {
|
|
13282
|
+
...t,
|
|
13283
|
+
draggable: !t.draggable
|
|
13284
|
+
} : t);
|
|
13285
|
+
z(n);
|
|
13286
|
+
},
|
|
13287
|
+
"aria-label": e.draggable ? "Disable drag" : "Enable drag",
|
|
13288
|
+
className: "p-1 hover:bg-gray-200 rounded-full",
|
|
13289
|
+
children: /* @__PURE__ */ jsx(DragToggleIcon, {
|
|
13290
|
+
active: !!e.draggable,
|
|
13291
|
+
size: 14,
|
|
13292
|
+
label: "Draggable"
|
|
13329
13293
|
})
|
|
13330
|
-
|
|
13294
|
+
}), /* @__PURE__ */ jsx(Button_default, {
|
|
13295
|
+
level: "icon",
|
|
13296
|
+
onClick: (t) => {
|
|
13297
|
+
t.stopPropagation();
|
|
13298
|
+
let n = R.map((t) => t.id === e.id ? {
|
|
13299
|
+
...t,
|
|
13300
|
+
filterable: !t.filterable
|
|
13301
|
+
} : t);
|
|
13302
|
+
z(n);
|
|
13303
|
+
},
|
|
13304
|
+
"aria-label": e.filterable ? "Disable filter" : "Enable filter",
|
|
13305
|
+
className: "p-1 hover:bg-gray-200 rounded-full",
|
|
13306
|
+
children: e.filterable ? /* @__PURE__ */ jsx(FilterIcon, {
|
|
13307
|
+
size: 14,
|
|
13308
|
+
color: "#fa8c16"
|
|
13309
|
+
}) : /* @__PURE__ */ jsx(FilterOffIcon, {
|
|
13310
|
+
size: 14,
|
|
13311
|
+
color: "#9ca3af"
|
|
13312
|
+
})
|
|
13313
|
+
})]
|
|
13331
13314
|
})]
|
|
13332
13315
|
}, e.id);
|
|
13333
13316
|
})
|
|
13334
13317
|
})]
|
|
13335
13318
|
})
|
|
13336
13319
|
})]
|
|
13337
|
-
}),
|
|
13320
|
+
}), y && sp && /* @__PURE__ */ jsx(Button_default, {
|
|
13338
13321
|
level: "icon",
|
|
13339
|
-
onClick:
|
|
13340
|
-
label:
|
|
13322
|
+
onClick: Xf,
|
|
13323
|
+
label: T.clearAllFilters,
|
|
13341
13324
|
children: /* @__PURE__ */ jsx(CloseIcon, { color: "white" })
|
|
13342
13325
|
})]
|
|
13343
13326
|
}), /* @__PURE__ */ jsx("div", {
|
|
13344
13327
|
className: "flex items-center gap-2",
|
|
13345
|
-
children:
|
|
13328
|
+
children: x && /* @__PURE__ */ jsx(Button_default, {
|
|
13346
13329
|
level: "secondary",
|
|
13347
|
-
onClick:
|
|
13330
|
+
onClick: ap,
|
|
13348
13331
|
children: /* @__PURE__ */ jsx(DownloadIcon, { size: 18 })
|
|
13349
13332
|
})
|
|
13350
13333
|
})]
|
|
@@ -13354,62 +13337,47 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: o, defaultFilte
|
|
|
13354
13337
|
children: /* @__PURE__ */ jsxs("table", {
|
|
13355
13338
|
className: "w-full border-separate border-spacing-0 table-auto text-sm relative",
|
|
13356
13339
|
"aria-label": "Data Table",
|
|
13357
|
-
children: [/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", { children:
|
|
13358
|
-
let n =
|
|
13359
|
-
position: "sticky",
|
|
13360
|
-
left: i,
|
|
13361
|
-
width: a,
|
|
13362
|
-
minWidth: a,
|
|
13363
|
-
maxWidth: a,
|
|
13364
|
-
zIndex: 20
|
|
13365
|
-
} : r ? {
|
|
13366
|
-
position: "sticky",
|
|
13367
|
-
right: dp(t),
|
|
13368
|
-
width: a,
|
|
13369
|
-
minWidth: a,
|
|
13370
|
-
maxWidth: a,
|
|
13371
|
-
zIndex: 20
|
|
13372
|
-
} : {
|
|
13373
|
-
width: a,
|
|
13374
|
-
minWidth: a,
|
|
13375
|
-
maxWidth: a
|
|
13376
|
-
};
|
|
13340
|
+
children: [/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", { children: K.map((e, t) => {
|
|
13341
|
+
let n = X(e);
|
|
13377
13342
|
return /* @__PURE__ */ jsx("th", {
|
|
13378
13343
|
className: `bg-gray-50 border-b border-solid border-gray-200 text-left font-semibold text-redi-text p-0 sticky top-0 z-10 select-none hover:bg-gray-200
|
|
13379
|
-
${
|
|
13380
|
-
${
|
|
13381
|
-
${
|
|
13382
|
-
${r ? "z-20 bg-gray-50 border-l border-gray-200 shadow-[-2px_0_5px_-2px_rgba(0,0,0,0.1)]" : ""}
|
|
13344
|
+
${A === t ? "opacity-50 bg-gray-300" : ""}
|
|
13345
|
+
${M === t ? "bg-redi-primary-bg border-l border-solid border-redi-primary" : ""}
|
|
13346
|
+
${M === t ? "bg-redi-primary-bg border-l border-solid border-redi-primary" : ""}
|
|
13383
13347
|
`,
|
|
13384
|
-
style:
|
|
13385
|
-
|
|
13386
|
-
|
|
13387
|
-
|
|
13388
|
-
|
|
13389
|
-
|
|
13390
|
-
|
|
13391
|
-
|
|
13348
|
+
style: {
|
|
13349
|
+
width: n,
|
|
13350
|
+
minWidth: n,
|
|
13351
|
+
maxWidth: n
|
|
13352
|
+
},
|
|
13353
|
+
draggable: !e.isAction && E && (e.draggable ?? !1),
|
|
13354
|
+
onDragStart: (n) => !e.isAction && E && (e.draggable ?? !1) && q(n, t),
|
|
13355
|
+
onDragOver: (n) => !e.isAction && E && (e.draggable ?? !1) && tp(n, t),
|
|
13356
|
+
onDragLeave: np,
|
|
13357
|
+
onDrop: (n) => !e.isAction && E && (e.draggable ?? !1) && rp(n, t),
|
|
13358
|
+
onDragEnd: ip,
|
|
13359
|
+
"aria-sort": H?.column === e.id ? H.direction === "asc" ? "ascending" : "descending" : "none",
|
|
13392
13360
|
children: /* @__PURE__ */ jsxs("div", {
|
|
13393
13361
|
className: "flex items-center py-3 px-4 gap-2 min-h-12",
|
|
13394
|
-
children: [!
|
|
13362
|
+
children: [!e.isAction && E && (e.draggable ?? !1) && /* @__PURE__ */ jsx("div", {
|
|
13395
13363
|
className: "text-gray-600 cursor-grab opacity-70 hover:opacity-100 text-base",
|
|
13396
13364
|
"aria-hidden": "true",
|
|
13397
13365
|
children: "⋮⋮"
|
|
13398
13366
|
}), /* @__PURE__ */ jsxs("div", {
|
|
13399
13367
|
className: "flex flex-1 items-center gap-2",
|
|
13400
13368
|
children: [/* @__PURE__ */ jsxs("span", {
|
|
13401
|
-
className:
|
|
13369
|
+
className: v ? "cursor-pointer py-1 px-1.5 rounded-sm flex items-center gap-1.5 text-sm font-semibold text-redi-text uppercase hover:bg-redi-background hover:text-redi-link-text" : "",
|
|
13402
13370
|
onClick: (t) => {
|
|
13403
|
-
t.stopPropagation(), e.sortable &&
|
|
13371
|
+
t.stopPropagation(), e.sortable && Jf(e.id);
|
|
13404
13372
|
},
|
|
13405
13373
|
role: "button",
|
|
13406
13374
|
tabIndex: 0,
|
|
13407
13375
|
onKeyDown: (t) => {
|
|
13408
|
-
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), e.sortable &&
|
|
13376
|
+
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), e.sortable && Jf(e.id));
|
|
13409
13377
|
},
|
|
13410
|
-
children: [e.label, e.sortable &&
|
|
13378
|
+
children: [e.label, e.sortable && H?.column === e.id && /* @__PURE__ */ jsx("span", {
|
|
13411
13379
|
className: "font-bold text-redi-link-text text-base",
|
|
13412
|
-
children:
|
|
13380
|
+
children: H.direction === "asc" ? " ↑" : " ↓"
|
|
13413
13381
|
})]
|
|
13414
13382
|
}), /* @__PURE__ */ jsx("div", {
|
|
13415
13383
|
className: "flex items-center gap-1",
|
|
@@ -13418,92 +13386,61 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: o, defaultFilte
|
|
|
13418
13386
|
children: [/* @__PURE__ */ jsx(Button_default, {
|
|
13419
13387
|
level: "icon",
|
|
13420
13388
|
onClick: (t) => {
|
|
13421
|
-
t.stopPropagation(),
|
|
13389
|
+
t.stopPropagation(), op(e.id);
|
|
13422
13390
|
},
|
|
13423
13391
|
"aria-label": `Filter by ${e.label}`,
|
|
13424
13392
|
children: /* @__PURE__ */ jsx(FilterIcon, { size: 16 })
|
|
13425
|
-
}),
|
|
13393
|
+
}), I === e.id && /* @__PURE__ */ jsx(AdvancedFilter_default, {
|
|
13426
13394
|
columnId: e.id,
|
|
13427
13395
|
label: e.label,
|
|
13428
13396
|
options: J(e.id),
|
|
13429
|
-
textValue:
|
|
13430
|
-
selectedValues:
|
|
13431
|
-
onTextChange: (t) =>
|
|
13432
|
-
onSelectionChange: (t) =>
|
|
13433
|
-
onClose: () =>
|
|
13397
|
+
textValue: U[e.id]?.type === "text" ? String(U[e.id].value || "") : "",
|
|
13398
|
+
selectedValues: U[e.id]?.type === "multiselect" && Array.isArray(U[e.id]?.value) ? U[e.id].value : [],
|
|
13399
|
+
onTextChange: (t) => Yf(e.id, t, "text"),
|
|
13400
|
+
onSelectionChange: (t) => Yf(e.id, t, "multiselect"),
|
|
13401
|
+
onClose: () => L(null)
|
|
13434
13402
|
})]
|
|
13435
13403
|
})
|
|
13436
13404
|
})]
|
|
13437
13405
|
})]
|
|
13438
13406
|
})
|
|
13439
13407
|
}, e.id);
|
|
13440
|
-
}) }) }), /* @__PURE__ */ jsx("tbody", { children:
|
|
13408
|
+
}) }) }), /* @__PURE__ */ jsx("tbody", { children: k ? Array.from({ length: 5 }).map((e, t) => /* @__PURE__ */ jsx("tr", {
|
|
13441
13409
|
className: "border-b border-solid border-gray-100",
|
|
13442
|
-
children:
|
|
13443
|
-
let n =
|
|
13444
|
-
|
|
13445
|
-
|
|
13446
|
-
|
|
13447
|
-
width: a,
|
|
13448
|
-
minWidth: a,
|
|
13449
|
-
maxWidth: a
|
|
13450
|
-
} : r ? {
|
|
13451
|
-
position: "sticky",
|
|
13452
|
-
right: dp(t),
|
|
13453
|
-
zIndex: 10,
|
|
13454
|
-
width: a,
|
|
13455
|
-
minWidth: a,
|
|
13456
|
-
maxWidth: a
|
|
13457
|
-
} : {
|
|
13458
|
-
width: a,
|
|
13459
|
-
minWidth: a,
|
|
13460
|
-
maxWidth: a
|
|
13410
|
+
children: K.map((e, t) => {
|
|
13411
|
+
let n = X(e), r = {
|
|
13412
|
+
width: n,
|
|
13413
|
+
minWidth: n,
|
|
13414
|
+
maxWidth: n
|
|
13461
13415
|
};
|
|
13462
13416
|
return /* @__PURE__ */ jsx("td", {
|
|
13463
|
-
className: `py-4 px-4 ${
|
|
13464
|
-
style:
|
|
13417
|
+
className: `py-4 px-4 ${e.isAction ? "bg-white border-l border-gray-200" : ""}`,
|
|
13418
|
+
style: r,
|
|
13465
13419
|
children: /* @__PURE__ */ jsx("div", { className: "h-4 bg-gray-200 rounded animate-pulse w-3/4" })
|
|
13466
13420
|
}, `skeleton-cell-${t}`);
|
|
13467
13421
|
})
|
|
13468
|
-
}, `skeleton-${t}`)) :
|
|
13422
|
+
}, `skeleton-${t}`)) : ep.length > 0 ? ep.map((e, t) => /* @__PURE__ */ jsx("tr", {
|
|
13469
13423
|
className: "even:bg-gray-50 hover:bg-gray-100 border-b border-solid border-b-gray-100 odd:bg-white",
|
|
13470
|
-
children:
|
|
13471
|
-
let i = typeof n.accessor == "function" ? n.accessor(e) : e[n.accessor], a =
|
|
13472
|
-
${a ? "border-
|
|
13473
|
-
|
|
13474
|
-
|
|
13475
|
-
|
|
13476
|
-
|
|
13477
|
-
zIndex: 5,
|
|
13478
|
-
backgroundColor: d,
|
|
13479
|
-
width: l,
|
|
13480
|
-
minWidth: l,
|
|
13481
|
-
maxWidth: l
|
|
13482
|
-
} : o ? {
|
|
13483
|
-
position: "sticky",
|
|
13484
|
-
right: dp(r),
|
|
13485
|
-
zIndex: 5,
|
|
13486
|
-
backgroundColor: d,
|
|
13487
|
-
width: l,
|
|
13488
|
-
minWidth: l,
|
|
13489
|
-
maxWidth: l
|
|
13490
|
-
} : {
|
|
13491
|
-
width: l,
|
|
13492
|
-
minWidth: l,
|
|
13493
|
-
maxWidth: l
|
|
13424
|
+
children: K.map((n, r) => {
|
|
13425
|
+
let i = typeof n.accessor == "function" ? n.accessor(e) : e[n.accessor], a = n.isAction, o = X(n), c = `py-3 px-4 text-redi-text font-normal leading-6 align-middle border-r border-solid border-r-gray-300 static table-cell last:border-r-0 first:font-medium
|
|
13426
|
+
${a ? "border-l border-gray-300 shadow-[-2px_0_5px_-2px_rgba(0,0,0,0.05)]" : ""}
|
|
13427
|
+
`, l = {
|
|
13428
|
+
width: o,
|
|
13429
|
+
minWidth: o,
|
|
13430
|
+
maxWidth: o
|
|
13494
13431
|
};
|
|
13495
13432
|
return n.render ? /* @__PURE__ */ jsx("td", {
|
|
13496
|
-
className:
|
|
13497
|
-
style:
|
|
13433
|
+
className: c,
|
|
13434
|
+
style: l,
|
|
13498
13435
|
children: n.render(i, e, t)
|
|
13499
13436
|
}, n.id) : /* @__PURE__ */ jsx("td", {
|
|
13500
|
-
className:
|
|
13501
|
-
style:
|
|
13437
|
+
className: c,
|
|
13438
|
+
style: l,
|
|
13502
13439
|
children: formatCellValue(i)
|
|
13503
13440
|
}, n.id);
|
|
13504
13441
|
})
|
|
13505
13442
|
}, t)) : /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", {
|
|
13506
|
-
colSpan:
|
|
13443
|
+
colSpan: K.length,
|
|
13507
13444
|
className: "py-12 text-center text-gray-500",
|
|
13508
13445
|
children: /* @__PURE__ */ jsxs("div", {
|
|
13509
13446
|
className: "flex flex-col items-center justify-center gap-2",
|
|
@@ -13526,75 +13463,75 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: o, defaultFilte
|
|
|
13526
13463
|
}) }) })]
|
|
13527
13464
|
})
|
|
13528
13465
|
}),
|
|
13529
|
-
|
|
13466
|
+
b && /* @__PURE__ */ jsxs("div", {
|
|
13530
13467
|
className: "flex items-center justify-between py-4 px-6 bg-white border-t-gray-300 border-solid border-t gap-4",
|
|
13531
13468
|
children: [/* @__PURE__ */ jsx("div", {
|
|
13532
13469
|
className: "text-redi-text text-base font-medium shrink-0",
|
|
13533
13470
|
children: /* @__PURE__ */ jsxs("span", { children: [
|
|
13534
|
-
|
|
13471
|
+
T.pagination?.showingItems,
|
|
13535
13472
|
" ",
|
|
13536
|
-
(
|
|
13473
|
+
(W.page - 1) * W.pageSize + 1,
|
|
13537
13474
|
" ",
|
|
13538
|
-
|
|
13475
|
+
T.pagination?.to,
|
|
13539
13476
|
" ",
|
|
13540
|
-
Math.min(
|
|
13477
|
+
Math.min(W.page * W.pageSize, W.total),
|
|
13541
13478
|
" ",
|
|
13542
|
-
|
|
13479
|
+
T.pagination?.of,
|
|
13543
13480
|
" ",
|
|
13544
|
-
|
|
13481
|
+
W.total,
|
|
13545
13482
|
" ",
|
|
13546
|
-
|
|
13483
|
+
T.pagination?.items
|
|
13547
13484
|
] })
|
|
13548
13485
|
}), /* @__PURE__ */ jsxs("div", {
|
|
13549
13486
|
className: "flex items-center gap-5",
|
|
13550
13487
|
children: [/* @__PURE__ */ jsxs("label", {
|
|
13551
13488
|
className: "flex items-center gap-3 text-sm font-semibold text-redi-text",
|
|
13552
13489
|
children: [
|
|
13553
|
-
|
|
13490
|
+
T.pagination?.showPerPage,
|
|
13554
13491
|
/* @__PURE__ */ jsx("select", {
|
|
13555
|
-
value:
|
|
13492
|
+
value: W.pageSize,
|
|
13556
13493
|
onChange: (e) => Zf(Number(e.target.value)),
|
|
13557
13494
|
className: "py-1.5 px-2.5 border border-solid border-gray-300 rounded-md bg-white text-redi-text focus:outline-none focus:ring-2 focus:ring-redi-primary",
|
|
13558
|
-
children:
|
|
13495
|
+
children: _.map((e) => /* @__PURE__ */ jsx("option", {
|
|
13559
13496
|
value: e,
|
|
13560
13497
|
children: e
|
|
13561
13498
|
}, e))
|
|
13562
13499
|
}),
|
|
13563
|
-
|
|
13500
|
+
T.pagination?.perPageItems
|
|
13564
13501
|
]
|
|
13565
13502
|
}), /* @__PURE__ */ jsxs("div", {
|
|
13566
13503
|
className: "flex gap-1 items-center",
|
|
13567
13504
|
children: [
|
|
13568
13505
|
/* @__PURE__ */ jsx(Button_default, {
|
|
13569
13506
|
level: "icon",
|
|
13570
|
-
onClick: () =>
|
|
13571
|
-
disabled:
|
|
13507
|
+
onClick: () => V(1),
|
|
13508
|
+
disabled: W.page === 1,
|
|
13572
13509
|
children: "<<"
|
|
13573
13510
|
}),
|
|
13574
13511
|
/* @__PURE__ */ jsx(Button_default, {
|
|
13575
13512
|
level: "icon",
|
|
13576
|
-
onClick: () =>
|
|
13577
|
-
disabled:
|
|
13513
|
+
onClick: () => V(W.page - 1),
|
|
13514
|
+
disabled: W.page === 1,
|
|
13578
13515
|
children: "<"
|
|
13579
13516
|
}),
|
|
13580
13517
|
Array.from({ length: Math.min(3, Y) }, (e, t) => {
|
|
13581
13518
|
let n;
|
|
13582
|
-
return n = Y <= 3 ||
|
|
13583
|
-
level:
|
|
13584
|
-
onClick: () =>
|
|
13519
|
+
return n = Y <= 3 || W.page <= 2 ? t + 1 : W.page > Y - 2 ? Y - 2 + t : W.page - 1 + t, /* @__PURE__ */ jsx(Button_default, {
|
|
13520
|
+
level: W.page === n ? "primary" : "secondary",
|
|
13521
|
+
onClick: () => V(n),
|
|
13585
13522
|
children: n
|
|
13586
13523
|
}, n);
|
|
13587
13524
|
}),
|
|
13588
13525
|
/* @__PURE__ */ jsx(Button_default, {
|
|
13589
13526
|
level: "icon",
|
|
13590
|
-
onClick: () =>
|
|
13591
|
-
disabled:
|
|
13527
|
+
onClick: () => V(W.page + 1),
|
|
13528
|
+
disabled: W.page === Y,
|
|
13592
13529
|
children: ">"
|
|
13593
13530
|
}),
|
|
13594
13531
|
/* @__PURE__ */ jsx(Button_default, {
|
|
13595
13532
|
level: "icon",
|
|
13596
|
-
onClick: () =>
|
|
13597
|
-
disabled:
|
|
13533
|
+
onClick: () => V(Y),
|
|
13534
|
+
disabled: W.page === Y,
|
|
13598
13535
|
children: ">>"
|
|
13599
13536
|
})
|
|
13600
13537
|
]
|