@redi.run/redi-components 0.0.48 → 0.0.49
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 +7 -1
- package/dist/redi-components.css +1 -1
- package/dist/redi-components.js +409 -333
- package/dist/redi-components.umd.cjs +20 -20
- package/package.json +1 -1
package/dist/redi-components.js
CHANGED
|
@@ -1474,7 +1474,7 @@ var CRC32 = /* @__PURE__ */ (function() {
|
|
|
1474
1474
|
return c ||= {};
|
|
1475
1475
|
}
|
|
1476
1476
|
function u(e, t) {
|
|
1477
|
-
if (e[0] == 80 && e[1] == 75) return
|
|
1477
|
+
if (e[0] == 80 && e[1] == 75) return og(e, t);
|
|
1478
1478
|
if ((e[0] | 32) == 109 && (e[1] | 32) == 105) return hg(e, t);
|
|
1479
1479
|
if (e.length < 512) throw Error("CFB file size " + e.length + " < 512");
|
|
1480
1480
|
var n = 3, i = 512, a = 0, o = 0, s = 0, c = 0, l = 0, u = [], h = e.slice(0, 512);
|
|
@@ -1487,7 +1487,7 @@ var CRC32 = /* @__PURE__ */ (function() {
|
|
|
1487
1487
|
case 4:
|
|
1488
1488
|
i = 4096;
|
|
1489
1489
|
break;
|
|
1490
|
-
case 0: if (_[1] == 0) return
|
|
1490
|
+
case 0: if (_[1] == 0) return og(e, t);
|
|
1491
1491
|
default: throw Error("Major Version: Expected 3 or 4 saw " + n);
|
|
1492
1492
|
}
|
|
1493
1493
|
i !== 512 && (h = e.slice(0, i), prep_blob(h, 28));
|
|
@@ -1703,7 +1703,7 @@ var CRC32 = /* @__PURE__ */ (function() {
|
|
|
1703
1703
|
var n = t || {};
|
|
1704
1704
|
if (n.fileType == "mad") return gg(e, n);
|
|
1705
1705
|
switch (T(e), n.fileType) {
|
|
1706
|
-
case "zip": return
|
|
1706
|
+
case "zip": return cg(e, n);
|
|
1707
1707
|
}
|
|
1708
1708
|
var i = (function(e) {
|
|
1709
1709
|
for (var t = 0, n = 0, i = 0; i < e.FileIndex.length; ++i) {
|
|
@@ -1825,7 +1825,7 @@ var CRC32 = /* @__PURE__ */ (function() {
|
|
|
1825
1825
|
for (var t = Array(e.length), n = 0; n < e.length; ++n) t[n] = String.fromCharCode(e[n]);
|
|
1826
1826
|
return t.join("");
|
|
1827
1827
|
}
|
|
1828
|
-
function
|
|
1828
|
+
function I(e, t) {
|
|
1829
1829
|
var n = E(e, t);
|
|
1830
1830
|
switch (t && t.type || "buffer") {
|
|
1831
1831
|
case "file": return l(), c.writeFileSync(t.filename, n), n;
|
|
@@ -1836,25 +1836,25 @@ var CRC32 = /* @__PURE__ */ (function() {
|
|
|
1836
1836
|
}
|
|
1837
1837
|
return n;
|
|
1838
1838
|
}
|
|
1839
|
-
var
|
|
1840
|
-
function
|
|
1839
|
+
var L;
|
|
1840
|
+
function Dh(e) {
|
|
1841
1841
|
try {
|
|
1842
1842
|
var t = e.InflateRaw, n = new t();
|
|
1843
|
-
if (n._processChunk(new Uint8Array([3, 0]), n._finishFlushFlag), n.bytesRead)
|
|
1843
|
+
if (n._processChunk(new Uint8Array([3, 0]), n._finishFlushFlag), n.bytesRead) L = e;
|
|
1844
1844
|
else throw Error("zlib does not expose bytesRead");
|
|
1845
1845
|
} catch (e) {
|
|
1846
1846
|
console.error("cannot use native zlib: " + (e.message || e));
|
|
1847
1847
|
}
|
|
1848
1848
|
}
|
|
1849
|
-
function
|
|
1850
|
-
if (!
|
|
1851
|
-
var n =
|
|
1849
|
+
function Fh(e, t) {
|
|
1850
|
+
if (!L) return ig(e, t);
|
|
1851
|
+
var n = L.InflateRaw, i = new n(), a = i._processChunk(e.slice(e.l), i._finishFlushFlag);
|
|
1852
1852
|
return e.l += i.bytesRead, a;
|
|
1853
1853
|
}
|
|
1854
|
-
function
|
|
1855
|
-
return
|
|
1854
|
+
function Ih(e) {
|
|
1855
|
+
return L ? L.deflateRawSync(e) : Zh(e);
|
|
1856
1856
|
}
|
|
1857
|
-
var
|
|
1857
|
+
var R = [
|
|
1858
1858
|
16,
|
|
1859
1859
|
17,
|
|
1860
1860
|
18,
|
|
@@ -1874,7 +1874,7 @@ var CRC32 = /* @__PURE__ */ (function() {
|
|
|
1874
1874
|
14,
|
|
1875
1875
|
1,
|
|
1876
1876
|
15
|
|
1877
|
-
],
|
|
1877
|
+
], z = [
|
|
1878
1878
|
3,
|
|
1879
1879
|
4,
|
|
1880
1880
|
5,
|
|
@@ -1904,7 +1904,7 @@ var CRC32 = /* @__PURE__ */ (function() {
|
|
|
1904
1904
|
195,
|
|
1905
1905
|
227,
|
|
1906
1906
|
258
|
|
1907
|
-
],
|
|
1907
|
+
], V = [
|
|
1908
1908
|
1,
|
|
1909
1909
|
2,
|
|
1910
1910
|
3,
|
|
@@ -1936,20 +1936,20 @@ var CRC32 = /* @__PURE__ */ (function() {
|
|
|
1936
1936
|
16385,
|
|
1937
1937
|
24577
|
|
1938
1938
|
];
|
|
1939
|
-
function
|
|
1939
|
+
function H(e) {
|
|
1940
1940
|
var t = (e << 1 | e << 11) & 139536 | (e << 5 | e << 15) & 558144;
|
|
1941
1941
|
return (t >> 16 | t >> 8 | t) & 255;
|
|
1942
1942
|
}
|
|
1943
|
-
for (var
|
|
1944
|
-
function
|
|
1945
|
-
var n =
|
|
1946
|
-
return t <= 8 ? n >>> 8 - t : (n = n << 8 |
|
|
1943
|
+
for (var U = typeof Uint8Array < "u", W = U ? new Uint8Array(256) : [], zh = 0; zh < 256; ++zh) W[zh] = H(zh);
|
|
1944
|
+
function Bh(e, t) {
|
|
1945
|
+
var n = W[e & 255];
|
|
1946
|
+
return t <= 8 ? n >>> 8 - t : (n = n << 8 | W[e >> 8 & 255], t <= 16 ? n >>> 16 - t : (n = n << 8 | W[e >> 16 & 255], n >>> 24 - t));
|
|
1947
1947
|
}
|
|
1948
|
-
function
|
|
1948
|
+
function Vh(e, t) {
|
|
1949
1949
|
var n = t & 7, i = t >>> 3;
|
|
1950
1950
|
return (e[i] | (n <= 6 ? 0 : e[i + 1] << 8)) >>> n & 3;
|
|
1951
1951
|
}
|
|
1952
|
-
function
|
|
1952
|
+
function Hh(e, t) {
|
|
1953
1953
|
var n = t & 7, i = t >>> 3;
|
|
1954
1954
|
return (e[i] | (n <= 5 ? 0 : e[i + 1] << 8)) >>> n & 7;
|
|
1955
1955
|
}
|
|
@@ -1985,7 +1985,7 @@ var CRC32 = /* @__PURE__ */ (function() {
|
|
|
1985
1985
|
var i = t & 7, a = t >>> 3;
|
|
1986
1986
|
return n <<= i, e[a] |= n & 255, n >>>= 8, e[a + 1] = n & 255, e[a + 2] = n >>> 8, t + 16;
|
|
1987
1987
|
}
|
|
1988
|
-
function
|
|
1988
|
+
function Xh(e, t) {
|
|
1989
1989
|
var n = e.length, i = 2 * n > t ? 2 * n : t + 5, a = 0;
|
|
1990
1990
|
if (n >= t) return e;
|
|
1991
1991
|
if (has_buf) {
|
|
@@ -1993,7 +1993,7 @@ var CRC32 = /* @__PURE__ */ (function() {
|
|
|
1993
1993
|
if (e.copy) e.copy(o);
|
|
1994
1994
|
else for (; a < e.length; ++a) o[a] = e[a];
|
|
1995
1995
|
return o;
|
|
1996
|
-
} else if (
|
|
1996
|
+
} else if (U) {
|
|
1997
1997
|
var s = new Uint8Array(i);
|
|
1998
1998
|
if (s.set) s.set(e);
|
|
1999
1999
|
else for (; a < n; ++a) s[a] = e[a];
|
|
@@ -2001,43 +2001,43 @@ var CRC32 = /* @__PURE__ */ (function() {
|
|
|
2001
2001
|
}
|
|
2002
2002
|
return e.length = i, e;
|
|
2003
2003
|
}
|
|
2004
|
-
function
|
|
2004
|
+
function K(e) {
|
|
2005
2005
|
for (var t = Array(e), n = 0; n < e; ++n) t[n] = 0;
|
|
2006
2006
|
return t;
|
|
2007
2007
|
}
|
|
2008
|
-
function
|
|
2009
|
-
var i = 1, a = 0, o = 0, s = 0, c = 0, l = e.length, u =
|
|
2008
|
+
function q(e, t, n) {
|
|
2009
|
+
var i = 1, a = 0, o = 0, s = 0, c = 0, l = e.length, u = U ? new Uint16Array(32) : K(32);
|
|
2010
2010
|
for (o = 0; o < 32; ++o) u[o] = 0;
|
|
2011
2011
|
for (o = l; o < n; ++o) e[o] = 0;
|
|
2012
2012
|
l = e.length;
|
|
2013
|
-
var d =
|
|
2013
|
+
var d = U ? new Uint16Array(l) : K(l);
|
|
2014
2014
|
for (o = 0; o < l; ++o) u[a = e[o]]++, i < a && (i = a), d[o] = 0;
|
|
2015
2015
|
for (u[0] = 0, o = 1; o <= i; ++o) u[o + 16] = c = c + u[o - 1] << 1;
|
|
2016
2016
|
for (o = 0; o < l; ++o) c = e[o], c != 0 && (d[o] = u[c + 16]++);
|
|
2017
2017
|
var f = 0;
|
|
2018
|
-
for (o = 0; o < l; ++o) if (f = e[o], f != 0) for (c =
|
|
2018
|
+
for (o = 0; o < l; ++o) if (f = e[o], f != 0) for (c = Bh(d[o], i) >> i - f, s = (1 << i + 4 - f) - 1; s >= 0; --s) t[c | s << f] = f & 15 | o << 4;
|
|
2019
2019
|
return i;
|
|
2020
2020
|
}
|
|
2021
|
-
var
|
|
2022
|
-
if (!
|
|
2023
|
-
for (var X = 0; X < 512; ++X)
|
|
2024
|
-
for (X = 0; X < 32; ++X)
|
|
2021
|
+
var J = U ? new Uint16Array(512) : K(512), Y = U ? new Uint16Array(32) : K(32);
|
|
2022
|
+
if (!U) {
|
|
2023
|
+
for (var X = 0; X < 512; ++X) J[X] = 0;
|
|
2024
|
+
for (X = 0; X < 32; ++X) Y[X] = 0;
|
|
2025
2025
|
}
|
|
2026
2026
|
(function() {
|
|
2027
2027
|
for (var e = [], t = 0; t < 32; t++) e.push(5);
|
|
2028
|
-
|
|
2028
|
+
q(e, Y, 32);
|
|
2029
2029
|
var n = [];
|
|
2030
2030
|
for (t = 0; t <= 143; t++) n.push(8);
|
|
2031
2031
|
for (; t <= 255; t++) n.push(9);
|
|
2032
2032
|
for (; t <= 279; t++) n.push(7);
|
|
2033
2033
|
for (; t <= 287; t++) n.push(8);
|
|
2034
|
-
|
|
2034
|
+
q(n, J, 288);
|
|
2035
2035
|
})();
|
|
2036
|
-
var
|
|
2037
|
-
for (var e =
|
|
2036
|
+
var Z = /* @__PURE__ */ (function() {
|
|
2037
|
+
for (var e = U ? new Uint8Array(32768) : [], t = 0, n = 0; t < V.length - 1; ++t) for (; n < V[t + 1]; ++n) e[n] = t;
|
|
2038
2038
|
for (; n < 32768; ++n) e[n] = 29;
|
|
2039
|
-
var i =
|
|
2040
|
-
for (t = 0, n = 0; t <
|
|
2039
|
+
var i = U ? new Uint8Array(259) : [];
|
|
2040
|
+
for (t = 0, n = 0; t < z.length - 1; ++t) for (; n < z[t + 1]; ++n) i[n] = t;
|
|
2041
2041
|
function a(e, t) {
|
|
2042
2042
|
for (var n = 0; n < e.length;) {
|
|
2043
2043
|
var i = Math.min(65535, e.length - n), a = n + i == e.length;
|
|
@@ -2046,7 +2046,7 @@ var CRC32 = /* @__PURE__ */ (function() {
|
|
|
2046
2046
|
return t.l;
|
|
2047
2047
|
}
|
|
2048
2048
|
function o(t, n) {
|
|
2049
|
-
for (var a = 0, o = 0, s =
|
|
2049
|
+
for (var a = 0, o = 0, s = U ? new Uint16Array(32768) : []; o < t.length;) {
|
|
2050
2050
|
var c = Math.min(65535, t.length - o);
|
|
2051
2051
|
if (c < 10) {
|
|
2052
2052
|
for (a = qh(n, a, +(o + c == t.length)), a & 7 && (a += 8 - (a & 7)), n.l = a / 8 | 0, n.write_shift(2, c), n.write_shift(2, ~c & 65535); c-- > 0;) n[n.l++] = t[o++];
|
|
@@ -2060,14 +2060,14 @@ var CRC32 = /* @__PURE__ */ (function() {
|
|
|
2060
2060
|
var d = -1, f = 0;
|
|
2061
2061
|
if ((d = s[l]) && (d |= o & -32768, d > o && (d -= 32768), d < o)) for (; t[d + f] == t[o + f] && f < 250;) ++f;
|
|
2062
2062
|
if (f > 2) {
|
|
2063
|
-
u = i[f], u <= 22 ? a = G(n, a,
|
|
2063
|
+
u = i[f], u <= 22 ? a = G(n, a, W[u + 1] >> 1) - 1 : (G(n, a, 3), a += 5, G(n, a, W[u - 23] >> 5), a += 3);
|
|
2064
2064
|
var p = u < 8 ? 0 : u - 4 >> 2;
|
|
2065
|
-
p > 0 && (Yh(n, a, f -
|
|
2065
|
+
p > 0 && (Yh(n, a, f - z[u]), a += p), u = e[o - d], a = G(n, a, W[u] >> 3), a -= 3;
|
|
2066
2066
|
var m = u < 4 ? 0 : u - 2 >> 1;
|
|
2067
|
-
m > 0 && (Yh(n, a, o - d -
|
|
2067
|
+
m > 0 && (Yh(n, a, o - d - V[u]), a += m);
|
|
2068
2068
|
for (var h = 0; h < f; ++h) s[l] = o & 32767, l = (l << 5 ^ t[o]) & 32767, ++o;
|
|
2069
2069
|
c -= f - 1;
|
|
2070
|
-
} else u <= 143 ? u += 48 : a = Jh(n, a, 1), a = G(n, a,
|
|
2070
|
+
} else u <= 143 ? u += 48 : a = Jh(n, a, 1), a = G(n, a, W[u]), s[l] = o & 32767, ++o;
|
|
2071
2071
|
}
|
|
2072
2072
|
a = G(n, a, 0) - 1;
|
|
2073
2073
|
}
|
|
@@ -2077,19 +2077,19 @@ var CRC32 = /* @__PURE__ */ (function() {
|
|
|
2077
2077
|
return e.length < 8 ? a(e, t) : o(e, t);
|
|
2078
2078
|
};
|
|
2079
2079
|
})();
|
|
2080
|
-
function
|
|
2081
|
-
var t = new_buf(50 + Math.floor(e.length * 1.1)), n =
|
|
2080
|
+
function Zh(e) {
|
|
2081
|
+
var t = new_buf(50 + Math.floor(e.length * 1.1)), n = Z(e, t);
|
|
2082
2082
|
return t.slice(0, n);
|
|
2083
2083
|
}
|
|
2084
|
-
var
|
|
2085
|
-
function
|
|
2084
|
+
var Qh = U ? new Uint16Array(32768) : K(32768), $h = U ? new Uint16Array(32768) : K(32768), eg = U ? new Uint16Array(128) : K(128), Q = 1, tg = 1;
|
|
2085
|
+
function ng(e, t) {
|
|
2086
2086
|
var n = Wh(e, t) + 257;
|
|
2087
2087
|
t += 5;
|
|
2088
2088
|
var i = Wh(e, t) + 1;
|
|
2089
2089
|
t += 5;
|
|
2090
2090
|
var a = Uh(e, t) + 4;
|
|
2091
2091
|
t += 4;
|
|
2092
|
-
for (var o = 0, s =
|
|
2092
|
+
for (var o = 0, s = U ? new Uint8Array(19) : K(19), c = [
|
|
2093
2093
|
0,
|
|
2094
2094
|
0,
|
|
2095
2095
|
0,
|
|
@@ -2109,22 +2109,22 @@ var CRC32 = /* @__PURE__ */ (function() {
|
|
|
2109
2109
|
0,
|
|
2110
2110
|
0,
|
|
2111
2111
|
0
|
|
2112
|
-
], l = 1, u =
|
|
2112
|
+
], l = 1, u = U ? new Uint8Array(8) : K(8), d = U ? new Uint8Array(8) : K(8), f = s.length, p = 0; p < a; ++p) s[R[p]] = o = Hh(e, t), l < o && (l = o), u[o]++, t += 3;
|
|
2113
2113
|
var m = 0;
|
|
2114
2114
|
for (u[0] = 0, p = 1; p <= l; ++p) d[p] = m = m + u[p - 1] << 1;
|
|
2115
2115
|
for (p = 0; p < f; ++p) (m = s[p]) != 0 && (c[p] = d[m]++);
|
|
2116
2116
|
var h = 0;
|
|
2117
2117
|
for (p = 0; p < f; ++p) if (h = s[p], h != 0) {
|
|
2118
|
-
m =
|
|
2119
|
-
for (var g = (1 << 7 - h) - 1; g >= 0; --g)
|
|
2118
|
+
m = W[c[p]] >> 8 - h;
|
|
2119
|
+
for (var g = (1 << 7 - h) - 1; g >= 0; --g) eg[m | g << h] = h & 7 | p << 3;
|
|
2120
2120
|
}
|
|
2121
2121
|
var _ = [];
|
|
2122
|
-
for (l = 1; _.length < n + i;) switch (m =
|
|
2122
|
+
for (l = 1; _.length < n + i;) switch (m = eg[Gh(e, t)], t += m & 7, m >>>= 3) {
|
|
2123
2123
|
case 16:
|
|
2124
|
-
for (o = 3 +
|
|
2124
|
+
for (o = 3 + Vh(e, t), t += 2, m = _[_.length - 1]; o-- > 0;) _.push(m);
|
|
2125
2125
|
break;
|
|
2126
2126
|
case 17:
|
|
2127
|
-
for (o = 3 +
|
|
2127
|
+
for (o = 3 + Hh(e, t), t += 3; o-- > 0;) _.push(0);
|
|
2128
2128
|
break;
|
|
2129
2129
|
case 18:
|
|
2130
2130
|
for (o = 11 + Gh(e, t), t += 7; o-- > 0;) _.push(0);
|
|
@@ -2136,45 +2136,45 @@ var CRC32 = /* @__PURE__ */ (function() {
|
|
|
2136
2136
|
var v = _.slice(0, n), y = _.slice(n);
|
|
2137
2137
|
for (p = n; p < 286; ++p) v[p] = 0;
|
|
2138
2138
|
for (p = i; p < 30; ++p) y[p] = 0;
|
|
2139
|
-
return
|
|
2139
|
+
return Q = q(v, Qh, 286), tg = q(y, $h, 30), t;
|
|
2140
2140
|
}
|
|
2141
|
-
function
|
|
2141
|
+
function rg(e, t) {
|
|
2142
2142
|
if (e[0] == 3 && !(e[1] & 3)) return [new_raw_buf(t), 2];
|
|
2143
2143
|
for (var n = 0, i = 0, a = new_unsafe_buf(t || 1 << 18), o = 0, s = a.length >>> 0, c = 0, l = 0; !(i & 1);) {
|
|
2144
|
-
if (i =
|
|
2144
|
+
if (i = Hh(e, n), n += 3, i >>> 1) i >> 1 == 1 ? (c = 9, l = 5) : (n = ng(e, n), c = Q, l = tg);
|
|
2145
2145
|
else {
|
|
2146
2146
|
n & 7 && (n += 8 - (n & 7));
|
|
2147
2147
|
var u = e[n >>> 3] | e[(n >>> 3) + 1] << 8;
|
|
2148
|
-
if (n += 32, u > 0) for (!t && s < o + u && (a =
|
|
2148
|
+
if (n += 32, u > 0) for (!t && s < o + u && (a = Xh(a, o + u), s = a.length); u-- > 0;) a[o++] = e[n >>> 3], n += 8;
|
|
2149
2149
|
continue;
|
|
2150
2150
|
}
|
|
2151
2151
|
for (;;) {
|
|
2152
|
-
!t && s < o + 32767 && (a =
|
|
2153
|
-
var d = Kh(e, n, c), f = i >>> 1 == 1 ?
|
|
2152
|
+
!t && s < o + 32767 && (a = Xh(a, o + 32767), s = a.length);
|
|
2153
|
+
var d = Kh(e, n, c), f = i >>> 1 == 1 ? J[d] : Qh[d];
|
|
2154
2154
|
if (n += f & 15, f >>>= 4, !(f >>> 8 & 255)) a[o++] = f;
|
|
2155
2155
|
else if (f == 256) break;
|
|
2156
2156
|
else {
|
|
2157
2157
|
f -= 257;
|
|
2158
2158
|
var p = f < 8 ? 0 : f - 4 >> 2;
|
|
2159
2159
|
p > 5 && (p = 0);
|
|
2160
|
-
var m = o +
|
|
2161
|
-
p > 0 && (m += Kh(e, n, p), n += p), d = Kh(e, n, l), f = i >>> 1 == 1 ?
|
|
2162
|
-
var h = f < 4 ? 0 : f - 2 >> 1, g =
|
|
2163
|
-
for (h > 0 && (g += Kh(e, n, h), n += h), !t && s < m && (a =
|
|
2160
|
+
var m = o + z[f];
|
|
2161
|
+
p > 0 && (m += Kh(e, n, p), n += p), d = Kh(e, n, l), f = i >>> 1 == 1 ? Y[d] : $h[d], n += f & 15, f >>>= 4;
|
|
2162
|
+
var h = f < 4 ? 0 : f - 2 >> 1, g = V[f];
|
|
2163
|
+
for (h > 0 && (g += Kh(e, n, h), n += h), !t && s < m && (a = Xh(a, m + 100), s = a.length); o < m;) a[o] = a[o - g], ++o;
|
|
2164
2164
|
}
|
|
2165
2165
|
}
|
|
2166
2166
|
}
|
|
2167
2167
|
return t ? [a, n + 7 >>> 3] : [a.slice(0, o), n + 7 >>> 3];
|
|
2168
2168
|
}
|
|
2169
|
-
function
|
|
2170
|
-
var n = e.slice(e.l || 0), i =
|
|
2169
|
+
function ig(e, t) {
|
|
2170
|
+
var n = e.slice(e.l || 0), i = rg(n, t);
|
|
2171
2171
|
return e.l += i[1], i[0];
|
|
2172
2172
|
}
|
|
2173
|
-
function
|
|
2173
|
+
function ag(e, t) {
|
|
2174
2174
|
if (e) typeof console < "u" && console.error(t);
|
|
2175
2175
|
else throw Error(t);
|
|
2176
2176
|
}
|
|
2177
|
-
function
|
|
2177
|
+
function og(e, t) {
|
|
2178
2178
|
var n = e;
|
|
2179
2179
|
prep_blob(n, 0);
|
|
2180
2180
|
var i = {
|
|
@@ -2192,11 +2192,11 @@ var CRC32 = /* @__PURE__ */ (function() {
|
|
|
2192
2192
|
var p = n.read_shift(4), m = s(n.slice(n.l + u, n.l + u + d));
|
|
2193
2193
|
n.l += u + d + f;
|
|
2194
2194
|
var h = n.l;
|
|
2195
|
-
n.l = p + 4,
|
|
2195
|
+
n.l = p + 4, sg(n, c, l, i, m), n.l = h;
|
|
2196
2196
|
}
|
|
2197
2197
|
return i;
|
|
2198
2198
|
}
|
|
2199
|
-
function
|
|
2199
|
+
function sg(e, t, n, i, a) {
|
|
2200
2200
|
e.l += 2;
|
|
2201
2201
|
var c = e.read_shift(2), l = e.read_shift(2), u = o(e);
|
|
2202
2202
|
if (c & 8257) throw Error("Unsupported ZIP encryption");
|
|
@@ -2209,25 +2209,25 @@ var CRC32 = /* @__PURE__ */ (function() {
|
|
|
2209
2209
|
var y = e.slice(e.l, e.l + f);
|
|
2210
2210
|
switch (l) {
|
|
2211
2211
|
case 8:
|
|
2212
|
-
y =
|
|
2212
|
+
y = Fh(e, p);
|
|
2213
2213
|
break;
|
|
2214
2214
|
case 0: break;
|
|
2215
2215
|
default: throw Error("Unsupported ZIP Compression method " + l);
|
|
2216
2216
|
}
|
|
2217
2217
|
var b = !1;
|
|
2218
|
-
c & 8 && (d = e.read_shift(4), d == 134695760 && (d = e.read_shift(4), b = !0), f = e.read_shift(4), p = e.read_shift(4)), f != t &&
|
|
2218
|
+
c & 8 && (d = e.read_shift(4), d == 134695760 && (d = e.read_shift(4), b = !0), f = e.read_shift(4), p = e.read_shift(4)), f != t && ag(b, "Bad compressed size: " + t + " != " + f), p != n && ag(b, "Bad uncompressed size: " + n + " != " + p), vg(i, g, y, {
|
|
2219
2219
|
unsafe: !0,
|
|
2220
2220
|
mt: u
|
|
2221
2221
|
});
|
|
2222
2222
|
}
|
|
2223
|
-
function
|
|
2223
|
+
function cg(e, t) {
|
|
2224
2224
|
var n = t || {}, i = [], o = [], s = new_buf(1), c = n.compression ? 8 : 0, l = 0, u = 0, d = 0, f = 0, p = 0, m = e.FullPaths[0], h = m, g = e.FileIndex[0], _ = [], v = 0;
|
|
2225
2225
|
for (u = 1; u < e.FullPaths.length; ++u) if (h = e.FullPaths[u].slice(m.length), g = e.FileIndex[u], !(!g.size || !g.content || h == "Sh33tJ5")) {
|
|
2226
2226
|
var y = f, b = new_buf(h.length);
|
|
2227
2227
|
for (d = 0; d < h.length; ++d) b.write_shift(1, h.charCodeAt(d) & 127);
|
|
2228
2228
|
b = b.slice(0, b.l), _[p] = CRC32.buf(g.content, 0);
|
|
2229
2229
|
var x = g.content;
|
|
2230
|
-
c == 8 && (x =
|
|
2230
|
+
c == 8 && (x = Ih(x)), s = new_buf(30), s.write_shift(4, 67324752), s.write_shift(2, 20), s.write_shift(2, l), s.write_shift(2, c), g.mt ? a(s, g.mt) : s.write_shift(4, 0), s.write_shift(-4, l & 8 ? 0 : _[p]), s.write_shift(4, l & 8 ? 0 : x.length), s.write_shift(4, l & 8 ? 0 : g.content.length), s.write_shift(2, b.length), s.write_shift(2, 0), f += s.length, i.push(s), f += b.length, i.push(b), f += x.length, i.push(x), l & 8 && (s = new_buf(12), s.write_shift(-4, _[p]), s.write_shift(4, x.length), s.write_shift(4, g.content.length), f += s.l, i.push(s)), s = new_buf(46), s.write_shift(4, 33639248), s.write_shift(2, 0), s.write_shift(2, 20), s.write_shift(2, l), s.write_shift(2, c), s.write_shift(4, 0), s.write_shift(-4, _[p]), s.write_shift(4, x.length), s.write_shift(4, g.content.length), s.write_shift(2, b.length), s.write_shift(2, 0), s.write_shift(2, 0), s.write_shift(2, 0), s.write_shift(2, 0), s.write_shift(4, 0), s.write_shift(4, y), v += s.l, o.push(s), v += b.length, o.push(b), ++p;
|
|
2231
2231
|
}
|
|
2232
2232
|
return s = new_buf(22), s.write_shift(4, 101010256), s.write_shift(2, 0), s.write_shift(2, 0), s.write_shift(2, p), s.write_shift(2, p), s.write_shift(4, v), s.write_shift(4, f), s.write_shift(2, 0), bconcat([
|
|
2233
2233
|
bconcat(i),
|
|
@@ -2235,7 +2235,7 @@ var CRC32 = /* @__PURE__ */ (function() {
|
|
|
2235
2235
|
s
|
|
2236
2236
|
]);
|
|
2237
2237
|
}
|
|
2238
|
-
var
|
|
2238
|
+
var lg = {
|
|
2239
2239
|
htm: "text/html",
|
|
2240
2240
|
xml: "text/xml",
|
|
2241
2241
|
gif: "image/gif",
|
|
@@ -2245,16 +2245,16 @@ var CRC32 = /* @__PURE__ */ (function() {
|
|
|
2245
2245
|
thmx: "application/vnd.ms-officetheme",
|
|
2246
2246
|
sh33tj5: "application/octet-stream"
|
|
2247
2247
|
};
|
|
2248
|
-
function
|
|
2248
|
+
function ug(e, t) {
|
|
2249
2249
|
if (e.ctype) return e.ctype;
|
|
2250
2250
|
var n = e.name || "", i = n.match(/\.([^\.]+)$/);
|
|
2251
|
-
return i &&
|
|
2251
|
+
return i && lg[i[1]] || t && (i = (n = t).match(/[\.\\]([^\.\\])+$/), i && lg[i[1]]) ? lg[i[1]] : "application/octet-stream";
|
|
2252
2252
|
}
|
|
2253
|
-
function
|
|
2253
|
+
function dg(e) {
|
|
2254
2254
|
for (var t = Base64_encode(e), n = [], i = 0; i < t.length; i += 76) n.push(t.slice(i, i + 76));
|
|
2255
2255
|
return n.join("\r\n") + "\r\n";
|
|
2256
2256
|
}
|
|
2257
|
-
function
|
|
2257
|
+
function fg(e) {
|
|
2258
2258
|
var t = e.replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7E-\xFF=]/g, function(e) {
|
|
2259
2259
|
var t = e.charCodeAt(0).toString(16).toUpperCase();
|
|
2260
2260
|
return "=" + (t.length == 1 ? "0" + t : t);
|
|
@@ -2273,7 +2273,7 @@ var CRC32 = /* @__PURE__ */ (function() {
|
|
|
2273
2273
|
}
|
|
2274
2274
|
return n.join("\r\n");
|
|
2275
2275
|
}
|
|
2276
|
-
function
|
|
2276
|
+
function pg(e) {
|
|
2277
2277
|
for (var t = [], n = 0; n < e.length; ++n) {
|
|
2278
2278
|
for (var i = e[n]; n <= e.length && i.charAt(i.length - 1) == "=";) i = i.slice(0, i.length - 1) + e[++n];
|
|
2279
2279
|
t.push(i);
|
|
@@ -2305,7 +2305,7 @@ var CRC32 = /* @__PURE__ */ (function() {
|
|
|
2305
2305
|
s = s2a(Base64_decode(t.slice(c).join("")));
|
|
2306
2306
|
break;
|
|
2307
2307
|
case "quoted-printable":
|
|
2308
|
-
s =
|
|
2308
|
+
s = pg(t.slice(c));
|
|
2309
2309
|
break;
|
|
2310
2310
|
default: throw Error("Unsupported Content-Transfer-Encoding " + a);
|
|
2311
2311
|
}
|
|
@@ -2347,7 +2347,7 @@ var CRC32 = /* @__PURE__ */ (function() {
|
|
|
2347
2347
|
});
|
|
2348
2348
|
for (var u = c.content, d = has_buf && Buffer.isBuffer(u) ? u.toString("binary") : F(u), f = 0, p = Math.min(1024, d.length), m = 0, h = 0; h <= p; ++h) (m = d.charCodeAt(h)) >= 32 && m < 128 && ++f;
|
|
2349
2349
|
var g = f >= p * 4 / 5;
|
|
2350
|
-
a.push(i), a.push("Content-Location: " + (n.root || "file:///C:/SheetJS/") + s), a.push("Content-Transfer-Encoding: " + (g ? "quoted-printable" : "base64")), a.push("Content-Type: " +
|
|
2350
|
+
a.push(i), a.push("Content-Location: " + (n.root || "file:///C:/SheetJS/") + s), a.push("Content-Transfer-Encoding: " + (g ? "quoted-printable" : "base64")), a.push("Content-Type: " + ug(c, s)), a.push(""), a.push(g ? fg(d) : dg(d));
|
|
2351
2351
|
}
|
|
2352
2352
|
return a.push(i + "--\r\n"), a.join("\r\n");
|
|
2353
2353
|
}
|
|
@@ -2387,7 +2387,7 @@ var CRC32 = /* @__PURE__ */ (function() {
|
|
|
2387
2387
|
function xg(e) {
|
|
2388
2388
|
T(e, !0);
|
|
2389
2389
|
}
|
|
2390
|
-
return e.find = D, e.read = S, e.parse = u, e.write =
|
|
2390
|
+
return e.find = D, e.read = S, e.parse = u, e.write = I, e.writeFile = P, e.utils = {
|
|
2391
2391
|
cfb_new: _g,
|
|
2392
2392
|
cfb_add: vg,
|
|
2393
2393
|
cfb_del: yg,
|
|
@@ -2397,9 +2397,9 @@ var CRC32 = /* @__PURE__ */ (function() {
|
|
|
2397
2397
|
CheckField,
|
|
2398
2398
|
prep_blob,
|
|
2399
2399
|
bconcat,
|
|
2400
|
-
use_zlib:
|
|
2401
|
-
_deflateRaw:
|
|
2402
|
-
_inflateRaw:
|
|
2400
|
+
use_zlib: Dh,
|
|
2401
|
+
_deflateRaw: Zh,
|
|
2402
|
+
_inflateRaw: ig,
|
|
2403
2403
|
consts: N
|
|
2404
2404
|
}, e;
|
|
2405
2405
|
})(), _fs = void 0;
|
|
@@ -5531,7 +5531,7 @@ var DBF = /* @__PURE__ */ (function() {
|
|
|
5531
5531
|
function e(e, t, n) {
|
|
5532
5532
|
if (e) {
|
|
5533
5533
|
prep_blob(e, e.l || 0);
|
|
5534
|
-
for (var i = n.Enum ||
|
|
5534
|
+
for (var i = n.Enum || Oh; e.l < e.length;) {
|
|
5535
5535
|
var a = e.read_shift(2), o = i[a] || i[65535], s = e.read_shift(2), c = e.l + s, l = o.f && o.f(e, s, n);
|
|
5536
5536
|
if (e.l = c, t(l, o, a)) return;
|
|
5537
5537
|
}
|
|
@@ -5561,7 +5561,7 @@ var DBF = /* @__PURE__ */ (function() {
|
|
|
5561
5561
|
}
|
|
5562
5562
|
}, p = i.sheetRows || 0;
|
|
5563
5563
|
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");
|
|
5564
|
-
if (t[2] == 2) i.Enum =
|
|
5564
|
+
if (t[2] == 2) i.Enum = Oh, e(t, function(e, t, n) {
|
|
5565
5565
|
switch (n) {
|
|
5566
5566
|
case 0:
|
|
5567
5567
|
i.vers = e, e >= 4096 && (i.qpro = !0);
|
|
@@ -5600,7 +5600,7 @@ var DBF = /* @__PURE__ */ (function() {
|
|
|
5600
5600
|
default:
|
|
5601
5601
|
}
|
|
5602
5602
|
}, i);
|
|
5603
|
-
else if (t[2] == 26 || t[2] == 14) i.Enum =
|
|
5603
|
+
else if (t[2] == 26 || t[2] == 14) i.Enum = Ah, t[2] == 14 && (i.qpro = !0, t.l = 0), e(t, function(e, t, n) {
|
|
5604
5604
|
switch (n) {
|
|
5605
5605
|
case 204:
|
|
5606
5606
|
o = e;
|
|
@@ -5665,7 +5665,7 @@ var DBF = /* @__PURE__ */ (function() {
|
|
|
5665
5665
|
if (+n.codepage >= 0 && set_cp(+n.codepage), n.type == "string") throw Error("Cannot write WK3 to JS string");
|
|
5666
5666
|
var i = buf_array();
|
|
5667
5667
|
write_biff_rec(i, 0, s(e));
|
|
5668
|
-
for (var a = 0, o = 0; a < e.SheetNames.length; ++a) (e.Sheets[e.SheetNames[a]] || {})["!ref"] && write_biff_rec(i, 27,
|
|
5668
|
+
for (var a = 0, o = 0; a < e.SheetNames.length; ++a) (e.Sheets[e.SheetNames[a]] || {})["!ref"] && write_biff_rec(i, 27, Dh(e.SheetNames[a], o++));
|
|
5669
5669
|
var c = 0;
|
|
5670
5670
|
for (a = 0; a < e.SheetNames.length; ++a) {
|
|
5671
5671
|
var l = e.Sheets[e.SheetNames[a]];
|
|
@@ -5956,7 +5956,7 @@ var DBF = /* @__PURE__ */ (function() {
|
|
|
5956
5956
|
return [i, a];
|
|
5957
5957
|
}
|
|
5958
5958
|
}
|
|
5959
|
-
function
|
|
5959
|
+
function L(e, t) {
|
|
5960
5960
|
for (var n = {}, i = e.l + t; e.l < i;) {
|
|
5961
5961
|
var a = e.read_shift(2);
|
|
5962
5962
|
if (a == 14e3) {
|
|
@@ -5966,7 +5966,7 @@ var DBF = /* @__PURE__ */ (function() {
|
|
|
5966
5966
|
}
|
|
5967
5967
|
return n;
|
|
5968
5968
|
}
|
|
5969
|
-
function
|
|
5969
|
+
function Dh(e, t) {
|
|
5970
5970
|
var n = new_buf(5 + e.length);
|
|
5971
5971
|
n.write_shift(2, 14e3), n.write_shift(2, t);
|
|
5972
5972
|
for (var i = 0; i < e.length; ++i) {
|
|
@@ -5975,7 +5975,7 @@ var DBF = /* @__PURE__ */ (function() {
|
|
|
5975
5975
|
}
|
|
5976
5976
|
return n[n.l++] = 0, n;
|
|
5977
5977
|
}
|
|
5978
|
-
var
|
|
5978
|
+
var Oh = {
|
|
5979
5979
|
0: {
|
|
5980
5980
|
n: "BOF",
|
|
5981
5981
|
f: parseuint16
|
|
@@ -6067,7 +6067,7 @@ var DBF = /* @__PURE__ */ (function() {
|
|
|
6067
6067
|
f: P
|
|
6068
6068
|
},
|
|
6069
6069
|
65535: { n: "" }
|
|
6070
|
-
},
|
|
6070
|
+
}, Ah = {
|
|
6071
6071
|
0: { n: "BOF" },
|
|
6072
6072
|
1: { n: "EOF" },
|
|
6073
6073
|
2: { n: "PASSWORD" },
|
|
@@ -6109,7 +6109,7 @@ var DBF = /* @__PURE__ */ (function() {
|
|
|
6109
6109
|
26: { n: "FORMULA1A" },
|
|
6110
6110
|
27: {
|
|
6111
6111
|
n: "XFORMAT",
|
|
6112
|
-
f:
|
|
6112
|
+
f: L
|
|
6113
6113
|
},
|
|
6114
6114
|
28: { n: "DTLABELMISC" },
|
|
6115
6115
|
29: { n: "DTLABELCELL" },
|
|
@@ -12020,11 +12020,11 @@ function write_numbers_iwa(e, t) {
|
|
|
12020
12020
|
})();
|
|
12021
12021
|
var P = parse_shallow(D[3][0].data), F = P[1][0];
|
|
12022
12022
|
delete P[2];
|
|
12023
|
-
var
|
|
12023
|
+
var I = parse_shallow(F.data), L = parse_TSP_Reference(I[2][0].data);
|
|
12024
12024
|
(function() {
|
|
12025
|
-
for (var e = CFB.find(u, c[
|
|
12025
|
+
for (var e = CFB.find(u, c[L].location), t = parse_iwa_file(decompress_iwa_file(e.content)), n, a = 0; a < t.length; ++a) {
|
|
12026
12026
|
var l = t[a];
|
|
12027
|
-
l.id ==
|
|
12027
|
+
l.id == L && (n = l);
|
|
12028
12028
|
}
|
|
12029
12029
|
var d = parse_shallow(n.messages[0].data);
|
|
12030
12030
|
delete d[6], delete P[7];
|
|
@@ -12052,9 +12052,9 @@ function write_numbers_iwa(e, t) {
|
|
|
12052
12052
|
}], n.messages[0].data = write_shallow(d);
|
|
12053
12053
|
var g = write_iwa_file(t);
|
|
12054
12054
|
e.content = compress_iwa_file(g), e.size = e.content.length;
|
|
12055
|
-
})(), F.data = write_shallow(
|
|
12056
|
-
var
|
|
12057
|
-
return f.content = compress_iwa_file(
|
|
12055
|
+
})(), F.data = write_shallow(I), D[3][0].data = write_shallow(P), v[4][0].data = write_shallow(D), m.messages[0].data = write_shallow(v);
|
|
12056
|
+
var Dh = write_iwa_file(p);
|
|
12057
|
+
return f.content = compress_iwa_file(Dh), f.size = f.content.length, u;
|
|
12058
12058
|
}
|
|
12059
12059
|
function fix_opts_func(e) {
|
|
12060
12060
|
return function(t) {
|
|
@@ -13052,39 +13052,41 @@ var buildThemePalette$1 = (e) => {
|
|
|
13052
13052
|
}),
|
|
13053
13053
|
/* @__PURE__ */ jsxs("div", {
|
|
13054
13054
|
className: AdvancedTable_module_default.filterOptions,
|
|
13055
|
-
children: [
|
|
13056
|
-
|
|
13057
|
-
|
|
13058
|
-
|
|
13059
|
-
|
|
13060
|
-
|
|
13061
|
-
|
|
13062
|
-
|
|
13063
|
-
|
|
13064
|
-
|
|
13065
|
-
|
|
13066
|
-
|
|
13067
|
-
|
|
13068
|
-
|
|
13069
|
-
|
|
13070
|
-
|
|
13071
|
-
|
|
13072
|
-
|
|
13073
|
-
|
|
13074
|
-
|
|
13075
|
-
|
|
13055
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
13056
|
+
className: AdvancedTable_module_default.filterOption,
|
|
13057
|
+
style: {
|
|
13058
|
+
borderBottom: "1px solid #e5e7eb",
|
|
13059
|
+
marginBottom: "4px",
|
|
13060
|
+
paddingBottom: "8px"
|
|
13061
|
+
},
|
|
13062
|
+
children: [/* @__PURE__ */ jsx(Button_default, {
|
|
13063
|
+
onClick: v,
|
|
13064
|
+
size: "small",
|
|
13065
|
+
level: "tertiary",
|
|
13066
|
+
children: "Seleccionar todo"
|
|
13067
|
+
}), /* @__PURE__ */ jsx(Button_default, {
|
|
13068
|
+
onClick: y,
|
|
13069
|
+
size: "small",
|
|
13070
|
+
level: "tertiary",
|
|
13071
|
+
children: "Limpiar todo"
|
|
13072
|
+
})]
|
|
13073
|
+
}), g.length > 0 ? g.map((e, t) => {
|
|
13074
|
+
let n = g[t - 1], a = e.group && (!n || n.group !== e.group);
|
|
13075
|
+
return /* @__PURE__ */ jsxs("div", { children: [a && /* @__PURE__ */ jsx("div", {
|
|
13076
|
+
className: "px-3 py-1 text-xs font-bold text-gray-500 bg-gray-50 uppercase tracking-wider",
|
|
13077
|
+
children: e.group
|
|
13078
|
+
}), /* @__PURE__ */ jsx(FilterOption, {
|
|
13076
13079
|
option: e,
|
|
13077
13080
|
selectedValues: i,
|
|
13078
13081
|
handleOptionToggle: _
|
|
13079
|
-
}, e.value)
|
|
13080
|
-
|
|
13081
|
-
|
|
13082
|
-
|
|
13083
|
-
|
|
13084
|
-
|
|
13085
|
-
})
|
|
13082
|
+
})] }, e.value);
|
|
13083
|
+
}) : /* @__PURE__ */ jsx("div", {
|
|
13084
|
+
className: AdvancedTable_module_default.filterOption,
|
|
13085
|
+
children: /* @__PURE__ */ jsx("span", {
|
|
13086
|
+
className: AdvancedTable_module_default.filterOptionLabel,
|
|
13087
|
+
children: "No se encontraron opciones"
|
|
13086
13088
|
})
|
|
13087
|
-
]
|
|
13089
|
+
})]
|
|
13088
13090
|
}),
|
|
13089
13091
|
/* @__PURE__ */ jsxs("div", {
|
|
13090
13092
|
className: AdvancedTable_module_default.filterModalActions,
|
|
@@ -13115,23 +13117,53 @@ const useAdvancedTable = (e) => {
|
|
|
13115
13117
|
300,
|
|
13116
13118
|
400,
|
|
13117
13119
|
500
|
|
13118
|
-
], initialConfig: p, onConfigChange: m, onPaginationChange: h, onFiltersChange: g, fetchData: _, rowKey: v = "id", onRowSelectionChange: y } = e, [
|
|
13120
|
+
], initialConfig: p, onConfigChange: m, onPaginationChange: h, onFiltersChange: g, fetchData: _, rowKey: v = "id", onRowSelectionChange: y, syncFiltersWithUrl: b = !1 } = e, [x, S] = useState(p?.sort || a || void 0), [C, w] = useState(() => {
|
|
13121
|
+
let e = p?.filters || u;
|
|
13122
|
+
if (b && typeof window < "u") {
|
|
13123
|
+
let t = new URLSearchParams(window.location.search), i = { ...e };
|
|
13124
|
+
return t.forEach((e, a) => {
|
|
13125
|
+
let o = n.find((e) => e.id === a);
|
|
13126
|
+
if (_ && !o?.shouldBeRefetch) return;
|
|
13127
|
+
let s = i[a];
|
|
13128
|
+
if (s) Array.isArray(s.value) ? i[a] = {
|
|
13129
|
+
...s,
|
|
13130
|
+
value: [...s.value, e],
|
|
13131
|
+
type: "multiselect"
|
|
13132
|
+
} : i[a] = {
|
|
13133
|
+
...s,
|
|
13134
|
+
value: [s.value, e],
|
|
13135
|
+
type: "multiselect"
|
|
13136
|
+
};
|
|
13137
|
+
else {
|
|
13138
|
+
let n = t.getAll(a);
|
|
13139
|
+
n.length > 1 ? i[a] = {
|
|
13140
|
+
type: "multiselect",
|
|
13141
|
+
value: n
|
|
13142
|
+
} : i[a] = {
|
|
13143
|
+
type: "text",
|
|
13144
|
+
value: e
|
|
13145
|
+
};
|
|
13146
|
+
}
|
|
13147
|
+
}), i;
|
|
13148
|
+
}
|
|
13149
|
+
return e;
|
|
13150
|
+
}), [T, E] = useState(p?.columnOrder || n.map((e) => e.id)), [D, O] = useState(p?.hiddenColumns || []), [k, A] = useState(p?.pinnedColumns || []), [j, M] = useState([]), [N, P] = useState({}), [F, I] = useState({
|
|
13119
13151
|
page: 1,
|
|
13120
13152
|
pageSize: p?.pagination?.pageSize || d,
|
|
13121
13153
|
total: p?.pagination?.total || t.length
|
|
13122
|
-
}), [
|
|
13154
|
+
}), [L, Dh] = useState([]), [Oh, kh] = useState(0), [Ah, jh] = useState(!1), [Mh, Nh] = useState(0), Ph = useCallback(async () => {
|
|
13123
13155
|
if (_) {
|
|
13124
13156
|
jh(!0);
|
|
13125
13157
|
try {
|
|
13126
13158
|
let e = {
|
|
13127
|
-
page_number:
|
|
13128
|
-
page_size:
|
|
13159
|
+
page_number: F.page,
|
|
13160
|
+
page_size: F.pageSize
|
|
13129
13161
|
};
|
|
13130
|
-
|
|
13131
|
-
|
|
13162
|
+
x && (e.order_by = `${x.direction === "desc" ? "-" : ""}${x.column}`), Object.entries(C).forEach(([t, i]) => {
|
|
13163
|
+
i.value && n.find((e) => e.id === t)?.shouldBeRefetch && (e[t] = i.value);
|
|
13132
13164
|
});
|
|
13133
13165
|
let t = await _(e);
|
|
13134
|
-
|
|
13166
|
+
Dh(t.items), kh(t.total_items);
|
|
13135
13167
|
} catch (e) {
|
|
13136
13168
|
console.error("Failed to fetch data:", e);
|
|
13137
13169
|
} finally {
|
|
@@ -13140,51 +13172,52 @@ const useAdvancedTable = (e) => {
|
|
|
13140
13172
|
}
|
|
13141
13173
|
}, [
|
|
13142
13174
|
_,
|
|
13143
|
-
|
|
13144
|
-
|
|
13145
|
-
|
|
13146
|
-
|
|
13147
|
-
|
|
13175
|
+
F.page,
|
|
13176
|
+
F.pageSize,
|
|
13177
|
+
x,
|
|
13178
|
+
C,
|
|
13179
|
+
n
|
|
13180
|
+
]), Fh = useRef(!0), Ih = useRef(C), R = useRef(x), Lh = useRef(F.page), z = useRef(F.pageSize), Rh = useRef(Mh);
|
|
13148
13181
|
useEffect(() => {
|
|
13149
13182
|
if (_) {
|
|
13150
|
-
let e = !1, t = JSON.stringify(
|
|
13183
|
+
let e = !1, t = JSON.stringify(C) !== JSON.stringify(Ih.current);
|
|
13151
13184
|
if (Fh.current) e = !0, Fh.current = !1;
|
|
13152
|
-
else if (Mh !==
|
|
13153
|
-
else if (
|
|
13154
|
-
else if (JSON.stringify(
|
|
13185
|
+
else if (Mh !== Rh.current) e = !0, Rh.current = Mh;
|
|
13186
|
+
else if (F.page !== Lh.current || F.pageSize !== z.current) e = !0;
|
|
13187
|
+
else if (JSON.stringify(x) !== JSON.stringify(R.current)) e = !0;
|
|
13155
13188
|
else if (t) {
|
|
13156
|
-
let t = Object.keys(Ih.current), i = Object.keys(
|
|
13157
|
-
for (let t of a) if (JSON.stringify(Ih.current[t]) !== JSON.stringify(
|
|
13189
|
+
let t = Object.keys(Ih.current), i = Object.keys(C), a = Array.from(new Set([...t, ...i]));
|
|
13190
|
+
for (let t of a) if (JSON.stringify(Ih.current[t]) !== JSON.stringify(C[t]) && n.find((e) => e.id === t)?.shouldBeRefetch === !0) {
|
|
13158
13191
|
e = !0;
|
|
13159
13192
|
break;
|
|
13160
13193
|
}
|
|
13161
13194
|
}
|
|
13162
|
-
Lh.current =
|
|
13195
|
+
Lh.current = F.page, z.current = F.pageSize, R.current = x, Ih.current = C, e && Ph();
|
|
13163
13196
|
}
|
|
13164
13197
|
}, [
|
|
13165
13198
|
Ph,
|
|
13166
13199
|
Mh,
|
|
13167
13200
|
_,
|
|
13168
|
-
|
|
13169
|
-
|
|
13170
|
-
|
|
13171
|
-
|
|
13201
|
+
F.page,
|
|
13202
|
+
F.pageSize,
|
|
13203
|
+
x,
|
|
13204
|
+
C,
|
|
13172
13205
|
n
|
|
13173
13206
|
]), useEffect(() => {
|
|
13174
|
-
_ &&
|
|
13207
|
+
_ && I((e) => ({
|
|
13175
13208
|
...e,
|
|
13176
13209
|
total: Oh
|
|
13177
13210
|
}));
|
|
13178
13211
|
}, [Oh, _]), useEffect(() => {
|
|
13179
13212
|
let e = n.map((e) => e.id);
|
|
13180
|
-
|
|
13213
|
+
E((t) => {
|
|
13181
13214
|
let n = t.filter((t) => e.includes(t)), i = e.filter((e) => !n.includes(e));
|
|
13182
13215
|
return [...n, ...i];
|
|
13183
|
-
}),
|
|
13216
|
+
}), O((t) => t.filter((t) => e.includes(t))), A((t) => t.filter((t) => e.includes(t)));
|
|
13184
13217
|
}, [n]);
|
|
13185
|
-
let
|
|
13218
|
+
let B = useMemo(() => {
|
|
13186
13219
|
let e = [];
|
|
13187
|
-
return e = _ ? [...
|
|
13220
|
+
return e = _ ? [...L] : [...t], Object.entries(C).forEach(([t, i]) => {
|
|
13188
13221
|
let a = n.find((e) => e.id === t);
|
|
13189
13222
|
a && (_ && a.shouldBeRefetch || (e = e.filter((e) => {
|
|
13190
13223
|
let t = typeof a.accessor == "function" ? a.accessor(e) : e[a.accessor], n = String(t || "").toLowerCase(), o = !0;
|
|
@@ -13193,14 +13226,14 @@ const useAdvancedTable = (e) => {
|
|
|
13193
13226
|
}), e;
|
|
13194
13227
|
}, [
|
|
13195
13228
|
t,
|
|
13196
|
-
|
|
13229
|
+
C,
|
|
13197
13230
|
n,
|
|
13198
13231
|
_,
|
|
13199
|
-
|
|
13200
|
-
]),
|
|
13201
|
-
if (_ || !
|
|
13202
|
-
let e = n.find((e) => e.id ===
|
|
13203
|
-
return e ? [...
|
|
13232
|
+
L
|
|
13233
|
+
]), V = useMemo(() => {
|
|
13234
|
+
if (_ || !x) return B;
|
|
13235
|
+
let e = n.find((e) => e.id === x.column);
|
|
13236
|
+
return e ? [...B].sort((t, n) => {
|
|
13204
13237
|
let i = typeof e.accessor == "function" ? e.accessor(t) : t[e.accessor], a = typeof e.accessor == "function" ? e.accessor(n) : n[e.accessor];
|
|
13205
13238
|
if (i == null) return 1;
|
|
13206
13239
|
if (a == null) return -1;
|
|
@@ -13212,105 +13245,122 @@ const useAdvancedTable = (e) => {
|
|
|
13212
13245
|
let e = String(i).toLowerCase(), t = String(a).toLowerCase();
|
|
13213
13246
|
o = e.localeCompare(t);
|
|
13214
13247
|
}
|
|
13215
|
-
return
|
|
13216
|
-
}) :
|
|
13248
|
+
return x.direction === "desc" ? o * -1 : o;
|
|
13249
|
+
}) : B;
|
|
13217
13250
|
}, [
|
|
13218
|
-
|
|
13219
|
-
|
|
13251
|
+
B,
|
|
13252
|
+
x,
|
|
13220
13253
|
n,
|
|
13221
13254
|
_
|
|
13222
|
-
]),
|
|
13223
|
-
if (_) return
|
|
13224
|
-
let e = (
|
|
13225
|
-
return
|
|
13255
|
+
]), H = useMemo(() => {
|
|
13256
|
+
if (_) return V;
|
|
13257
|
+
let e = (F.page - 1) * F.pageSize, t = e + F.pageSize;
|
|
13258
|
+
return V.slice(e, t);
|
|
13226
13259
|
}, [
|
|
13227
|
-
|
|
13228
|
-
|
|
13229
|
-
|
|
13260
|
+
V,
|
|
13261
|
+
F.page,
|
|
13262
|
+
F.pageSize,
|
|
13230
13263
|
_
|
|
13231
13264
|
]);
|
|
13232
13265
|
useEffect(() => {
|
|
13233
|
-
_ ||
|
|
13266
|
+
_ || I((e) => ({
|
|
13234
13267
|
...e,
|
|
13235
|
-
total:
|
|
13236
|
-
page: Math.min(e.page, Math.ceil(
|
|
13268
|
+
total: B.length,
|
|
13269
|
+
page: Math.min(e.page, Math.ceil(B.length / e.pageSize) || 1)
|
|
13237
13270
|
}));
|
|
13238
|
-
}, [
|
|
13271
|
+
}, [B.length, _]), useEffect(() => {
|
|
13239
13272
|
m?.({
|
|
13240
13273
|
columns: n,
|
|
13241
|
-
sort:
|
|
13242
|
-
filters:
|
|
13243
|
-
pagination:
|
|
13244
|
-
columnOrder:
|
|
13245
|
-
hiddenColumns:
|
|
13246
|
-
pinnedColumns:
|
|
13274
|
+
sort: x,
|
|
13275
|
+
filters: C,
|
|
13276
|
+
pagination: F,
|
|
13277
|
+
columnOrder: T,
|
|
13278
|
+
hiddenColumns: D,
|
|
13279
|
+
pinnedColumns: k
|
|
13247
13280
|
});
|
|
13248
13281
|
}, [
|
|
13249
|
-
|
|
13250
|
-
|
|
13251
|
-
|
|
13252
|
-
|
|
13253
|
-
|
|
13254
|
-
|
|
13282
|
+
x,
|
|
13283
|
+
C,
|
|
13284
|
+
T,
|
|
13285
|
+
D,
|
|
13286
|
+
k,
|
|
13287
|
+
F.pageSize,
|
|
13255
13288
|
m,
|
|
13256
|
-
|
|
13289
|
+
F,
|
|
13257
13290
|
n
|
|
13258
13291
|
]), useEffect(() => {
|
|
13259
|
-
h?.(
|
|
13260
|
-
}, [
|
|
13261
|
-
g?.(
|
|
13262
|
-
}, [
|
|
13263
|
-
|
|
13264
|
-
|
|
13292
|
+
h?.(F);
|
|
13293
|
+
}, [F, h]), useEffect(() => {
|
|
13294
|
+
g?.(C);
|
|
13295
|
+
}, [C, g]), useEffect(() => {
|
|
13296
|
+
if (b && typeof window < "u") {
|
|
13297
|
+
let e = new URLSearchParams(window.location.search);
|
|
13298
|
+
n.forEach((t) => {
|
|
13299
|
+
_ && !t.shouldBeRefetch || e.delete(t.id);
|
|
13300
|
+
}), Object.entries(C).forEach(([t, i]) => {
|
|
13301
|
+
let a = n.find((e) => e.id === t);
|
|
13302
|
+
_ && !a?.shouldBeRefetch || i.value && (Array.isArray(i.value) ? i.value.forEach((n) => e.append(t, String(n))) : e.set(t, String(i.value)));
|
|
13303
|
+
});
|
|
13304
|
+
let t = `${window.location.pathname}?${e.toString()}`;
|
|
13305
|
+
window.history.replaceState({}, "", t);
|
|
13306
|
+
}
|
|
13307
|
+
}, [
|
|
13308
|
+
C,
|
|
13309
|
+
b,
|
|
13310
|
+
n,
|
|
13311
|
+
_
|
|
13312
|
+
]);
|
|
13313
|
+
let U = useCallback((e) => {
|
|
13314
|
+
S((t) => t?.column === e ? t.direction === "asc" ? {
|
|
13265
13315
|
column: e,
|
|
13266
13316
|
direction: "desc"
|
|
13267
13317
|
} : void 0 : {
|
|
13268
13318
|
column: e,
|
|
13269
13319
|
direction: "asc"
|
|
13270
13320
|
});
|
|
13271
|
-
}, []),
|
|
13272
|
-
|
|
13321
|
+
}, []), W = useCallback((e, t, n = "text") => {
|
|
13322
|
+
w((i) => ({
|
|
13273
13323
|
...i,
|
|
13274
13324
|
[e]: {
|
|
13275
13325
|
type: n,
|
|
13276
13326
|
value: t,
|
|
13277
13327
|
options: i[e]?.options
|
|
13278
13328
|
}
|
|
13279
|
-
})),
|
|
13329
|
+
})), I((e) => ({
|
|
13280
13330
|
...e,
|
|
13281
13331
|
page: 1
|
|
13282
13332
|
}));
|
|
13283
|
-
}, []),
|
|
13284
|
-
|
|
13333
|
+
}, []), zh = useCallback((e) => {
|
|
13334
|
+
w((t) => {
|
|
13285
13335
|
let n = { ...t };
|
|
13286
13336
|
return delete n[e], n;
|
|
13287
13337
|
});
|
|
13288
|
-
}, []),
|
|
13289
|
-
|
|
13338
|
+
}, []), Bh = useCallback(() => {
|
|
13339
|
+
w({});
|
|
13290
13340
|
}, []), Vh = useCallback((e) => {
|
|
13291
|
-
|
|
13341
|
+
I((t) => ({
|
|
13292
13342
|
...t,
|
|
13293
13343
|
page: e
|
|
13294
13344
|
}));
|
|
13295
13345
|
}, []), Hh = useCallback((e) => {
|
|
13296
|
-
|
|
13346
|
+
I((t) => ({
|
|
13297
13347
|
...t,
|
|
13298
13348
|
pageSize: e,
|
|
13299
13349
|
page: 1
|
|
13300
13350
|
}));
|
|
13301
|
-
}, []), W = useCallback((e) => {
|
|
13302
|
-
T(e);
|
|
13303
13351
|
}, []), Uh = useCallback((e) => {
|
|
13304
|
-
|
|
13352
|
+
E(e);
|
|
13305
13353
|
}, []), Wh = useCallback((e) => {
|
|
13306
|
-
|
|
13354
|
+
O((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
|
|
13307
13355
|
}, []), Gh = useCallback((e) => {
|
|
13308
|
-
|
|
13356
|
+
A((t) => t.includes(e) ? t.filter((t) => t !== e) : [...t, e]);
|
|
13357
|
+
}, []), Kh = useCallback((e) => {
|
|
13358
|
+
M((t) => {
|
|
13309
13359
|
let n = t.includes(e) ? t.filter((t) => t !== e) : [...t, e];
|
|
13310
13360
|
return y?.(n), n;
|
|
13311
13361
|
});
|
|
13312
|
-
}, [y]),
|
|
13313
|
-
|
|
13362
|
+
}, [y]), qh = useCallback((e) => {
|
|
13363
|
+
M((t) => {
|
|
13314
13364
|
let n = e.map((e) => typeof v == "function" ? v(e) : e[v]), i = n.every((e) => t.includes(e)), a;
|
|
13315
13365
|
if (i) a = t.filter((e) => !n.includes(e));
|
|
13316
13366
|
else {
|
|
@@ -13319,52 +13369,52 @@ const useAdvancedTable = (e) => {
|
|
|
13319
13369
|
}
|
|
13320
13370
|
return y?.(a), a;
|
|
13321
13371
|
});
|
|
13322
|
-
}, [v, y]),
|
|
13323
|
-
|
|
13372
|
+
}, [v, y]), Jh = useCallback((e, t) => {
|
|
13373
|
+
P((n) => ({
|
|
13324
13374
|
...n,
|
|
13325
13375
|
[e]: Math.max(50, t)
|
|
13326
13376
|
}));
|
|
13327
|
-
}, []),
|
|
13328
|
-
let e = new Map(n.map((e) => [e.id, e])), t =
|
|
13329
|
-
return [...t, ...a].filter((e) => !
|
|
13377
|
+
}, []), G = useMemo(() => {
|
|
13378
|
+
let e = new Map(n.map((e) => [e.id, e])), t = T.map((t) => e.get(t)).filter(Boolean), i = new Set(t.map((e) => e.id)), a = n.filter((e) => !i.has(e.id));
|
|
13379
|
+
return [...t, ...a].filter((e) => !D.includes(e.id));
|
|
13330
13380
|
}, [
|
|
13331
|
-
|
|
13381
|
+
T,
|
|
13332
13382
|
n,
|
|
13333
|
-
|
|
13334
|
-
]),
|
|
13383
|
+
D
|
|
13384
|
+
]), Yh = useCallback(() => {
|
|
13335
13385
|
Nh((e) => e + 1);
|
|
13336
13386
|
}, []);
|
|
13337
13387
|
return {
|
|
13338
13388
|
state: {
|
|
13339
13389
|
data: t,
|
|
13340
|
-
filteredData:
|
|
13341
|
-
paginatedData:
|
|
13342
|
-
sortConfig:
|
|
13343
|
-
filters:
|
|
13344
|
-
pagination:
|
|
13345
|
-
columnOrder:
|
|
13346
|
-
hiddenColumns:
|
|
13347
|
-
pinnedColumns:
|
|
13348
|
-
selectedRows:
|
|
13349
|
-
columnWidths:
|
|
13390
|
+
filteredData: B,
|
|
13391
|
+
paginatedData: H,
|
|
13392
|
+
sortConfig: x,
|
|
13393
|
+
filters: C,
|
|
13394
|
+
pagination: F,
|
|
13395
|
+
columnOrder: T,
|
|
13396
|
+
hiddenColumns: D,
|
|
13397
|
+
pinnedColumns: k,
|
|
13398
|
+
selectedRows: j,
|
|
13399
|
+
columnWidths: N,
|
|
13350
13400
|
loading: Ah
|
|
13351
13401
|
},
|
|
13352
|
-
orderedColumns:
|
|
13402
|
+
orderedColumns: G,
|
|
13353
13403
|
pageSizeOptions: f,
|
|
13354
|
-
handleSort:
|
|
13355
|
-
handleFilter:
|
|
13356
|
-
clearFilter:
|
|
13357
|
-
clearAllFilters:
|
|
13404
|
+
handleSort: U,
|
|
13405
|
+
handleFilter: W,
|
|
13406
|
+
clearFilter: zh,
|
|
13407
|
+
clearAllFilters: Bh,
|
|
13358
13408
|
handlePageChange: Vh,
|
|
13359
13409
|
handlePageSizeChange: Hh,
|
|
13360
|
-
handleColumnReorder:
|
|
13361
|
-
handleToggleColumn:
|
|
13362
|
-
handleTogglePin:
|
|
13363
|
-
handleRowSelect:
|
|
13364
|
-
handleSelectAll:
|
|
13365
|
-
handleColumnResize:
|
|
13410
|
+
handleColumnReorder: Uh,
|
|
13411
|
+
handleToggleColumn: Wh,
|
|
13412
|
+
handleTogglePin: Gh,
|
|
13413
|
+
handleRowSelect: Kh,
|
|
13414
|
+
handleSelectAll: qh,
|
|
13415
|
+
handleColumnResize: Jh,
|
|
13366
13416
|
allColumns: n,
|
|
13367
|
-
refresh:
|
|
13417
|
+
refresh: Yh
|
|
13368
13418
|
};
|
|
13369
13419
|
};
|
|
13370
13420
|
var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilters: i = {}, defaultPageSize: a = 10, pageSizeOptions: u = [
|
|
@@ -13389,25 +13439,26 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
|
|
|
13389
13439
|
},
|
|
13390
13440
|
clearAllFilters: "Limpiar todos los filtros",
|
|
13391
13441
|
noData: "No hay datos disponibles"
|
|
13392
|
-
}, enableColumnReordering: A = !0, enableColumnPinning: j = !1, enableColumnResizing: M = !1, enableRowSelection: N = !1, stickyActionsColumn: P = !1, rowKey: F = "id", onRowSelectionChange:
|
|
13393
|
-
let [Ph, Fh] = useState(null), [Ih,
|
|
13442
|
+
}, enableColumnReordering: A = !0, enableColumnPinning: j = !1, enableColumnResizing: M = !1, enableRowSelection: N = !1, stickyActionsColumn: P = !1, rowKey: F = "id", onRowSelectionChange: I, renderActions: L, actionsColumnLabel: Dh, loading: Oh = !1, fetchData: kh, onRefresh: Ah, onPaginationChange: jh, onFiltersChange: Mh, syncFiltersWithUrl: Nh = !1 }) => {
|
|
13443
|
+
let [Ph, Fh] = useState(null), [Ih, R] = useState(null), [Lh, z] = useState(!1), [Rh, B] = useState(null), V = useRef(null), [H, U] = useState(t), { state: W, orderedColumns: zh, handleSort: Bh, handleFilter: Vh, clearAllFilters: Hh, handlePageChange: Uh, handlePageSizeChange: Wh, handleColumnReorder: Gh, handleToggleColumn: Kh, handleTogglePin: qh, handleRowSelect: Jh, handleSelectAll: G, handleColumnResize: Yh, refresh: Xh } = useAdvancedTable({
|
|
13394
13444
|
data: e,
|
|
13395
|
-
columns:
|
|
13445
|
+
columns: H,
|
|
13396
13446
|
defaultSort: n,
|
|
13397
13447
|
defaultFilters: i,
|
|
13398
13448
|
defaultPageSize: a,
|
|
13399
13449
|
pageSizeOptions: u,
|
|
13400
13450
|
initialConfig: E,
|
|
13401
13451
|
onConfigChange: D,
|
|
13402
|
-
fetchData:
|
|
13403
|
-
onPaginationChange:
|
|
13404
|
-
onFiltersChange:
|
|
13452
|
+
fetchData: kh,
|
|
13453
|
+
onPaginationChange: jh,
|
|
13454
|
+
onFiltersChange: Mh,
|
|
13405
13455
|
rowKey: F,
|
|
13406
|
-
onRowSelectionChange:
|
|
13407
|
-
|
|
13408
|
-
|
|
13409
|
-
|
|
13410
|
-
|
|
13456
|
+
onRowSelectionChange: I,
|
|
13457
|
+
syncFiltersWithUrl: Nh
|
|
13458
|
+
}), { paginatedData: K, sortConfig: q, filters: J, pagination: Y, hiddenColumns: X, pinnedColumns: Z, selectedRows: Zh, columnWidths: Qh, loading: $h } = W, eg = Oh || $h;
|
|
13459
|
+
useEffect(() => U(t), [t]);
|
|
13460
|
+
let Q = useMemo(() => {
|
|
13461
|
+
let e = [...zh], t = e.filter((e) => e.isAction), n = [...e.filter((e) => !e.isAction), ...t];
|
|
13411
13462
|
return N && n.unshift({
|
|
13412
13463
|
id: "selection-synthetic",
|
|
13413
13464
|
label: "",
|
|
@@ -13421,7 +13472,7 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
|
|
|
13421
13472
|
className: "w-4 h-4 accent-redi-primary cursor-pointer",
|
|
13422
13473
|
checked: Zh.includes(t),
|
|
13423
13474
|
onChange: (e) => {
|
|
13424
|
-
e.stopPropagation(),
|
|
13475
|
+
e.stopPropagation(), Jh(t);
|
|
13425
13476
|
},
|
|
13426
13477
|
onClick: (e) => e.stopPropagation()
|
|
13427
13478
|
});
|
|
@@ -13430,11 +13481,11 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
|
|
|
13430
13481
|
filterable: !1,
|
|
13431
13482
|
sortable: !1,
|
|
13432
13483
|
draggable: !1
|
|
13433
|
-
}),
|
|
13484
|
+
}), L && n.push({
|
|
13434
13485
|
id: "actions-synthetic",
|
|
13435
|
-
label:
|
|
13486
|
+
label: Dh || "",
|
|
13436
13487
|
accessor: (e) => e[F],
|
|
13437
|
-
render: ({ row: e, column: t, index: n }) =>
|
|
13488
|
+
render: ({ row: e, column: t, index: n }) => L({
|
|
13438
13489
|
row: e,
|
|
13439
13490
|
index: n,
|
|
13440
13491
|
column: t
|
|
@@ -13446,26 +13497,26 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
|
|
|
13446
13497
|
draggable: !1
|
|
13447
13498
|
}), n;
|
|
13448
13499
|
}, [
|
|
13449
|
-
|
|
13450
|
-
|
|
13451
|
-
|
|
13500
|
+
zh,
|
|
13501
|
+
L,
|
|
13502
|
+
Dh,
|
|
13452
13503
|
N,
|
|
13453
13504
|
Zh,
|
|
13454
13505
|
F,
|
|
13455
|
-
|
|
13506
|
+
Jh
|
|
13456
13507
|
]), tg = useRef(null);
|
|
13457
13508
|
useEffect(() => {
|
|
13458
13509
|
let e = (e) => {
|
|
13459
13510
|
if (!tg.current) return;
|
|
13460
13511
|
let { columnId: t, startX: n, startWidth: i } = tg.current, a = e.clientX - n;
|
|
13461
|
-
|
|
13512
|
+
Yh(t, i + a);
|
|
13462
13513
|
}, t = () => {
|
|
13463
13514
|
tg.current = null, document.body.style.cursor = "default", document.body.style.userSelect = "auto";
|
|
13464
13515
|
};
|
|
13465
13516
|
if (M) return document.addEventListener("mousemove", e), document.addEventListener("mouseup", t), () => {
|
|
13466
13517
|
document.removeEventListener("mousemove", e), document.removeEventListener("mouseup", t);
|
|
13467
13518
|
};
|
|
13468
|
-
}, [M,
|
|
13519
|
+
}, [M, Yh]);
|
|
13469
13520
|
let ng = (e, t, n) => {
|
|
13470
13521
|
e.preventDefault(), e.stopPropagation(), tg.current = {
|
|
13471
13522
|
columnId: t,
|
|
@@ -13475,42 +13526,67 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
|
|
|
13475
13526
|
}, rg = (e, t) => {
|
|
13476
13527
|
Fh(t), e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData("text/html", "");
|
|
13477
13528
|
}, ig = (e, t) => {
|
|
13478
|
-
e.preventDefault(), e.dataTransfer.dropEffect = "move",
|
|
13529
|
+
e.preventDefault(), e.dataTransfer.dropEffect = "move", R(t);
|
|
13479
13530
|
}, ag = () => {
|
|
13480
|
-
|
|
13531
|
+
R(null);
|
|
13481
13532
|
}, og = (e, t) => {
|
|
13482
13533
|
if (e.preventDefault(), Ph === null) return;
|
|
13483
|
-
let n =
|
|
13534
|
+
let n = Q[Ph].id, i = Q[t].id;
|
|
13484
13535
|
if (n === i) {
|
|
13485
|
-
Fh(null),
|
|
13536
|
+
Fh(null), R(null);
|
|
13486
13537
|
return;
|
|
13487
13538
|
}
|
|
13488
|
-
let a = e.currentTarget.getBoundingClientRect(), o = e.clientX - a.left > a.width / 2, s = [...
|
|
13489
|
-
c === -1 || l === -1 || (s.splice(c, 1), l = s.indexOf(i), o ? s.splice(l + 1, 0, n) : s.splice(l, 0, n),
|
|
13539
|
+
let a = e.currentTarget.getBoundingClientRect(), o = e.clientX - a.left > a.width / 2, s = [...W.columnOrder], c = s.indexOf(n), l = s.indexOf(i);
|
|
13540
|
+
c === -1 || l === -1 || (s.splice(c, 1), l = s.indexOf(i), o ? s.splice(l + 1, 0, n) : s.splice(l, 0, n), Gh(s), Fh(null), R(null));
|
|
13490
13541
|
}, sg = () => {
|
|
13491
|
-
Fh(null),
|
|
13542
|
+
Fh(null), R(null);
|
|
13492
13543
|
}, cg = () => {
|
|
13493
13544
|
if (!T) return;
|
|
13494
|
-
let e =
|
|
13495
|
-
exportToExcel(
|
|
13545
|
+
let e = Q.filter((e) => !e.isAction);
|
|
13546
|
+
exportToExcel(W.filteredData, e, "table-data.xlsx");
|
|
13496
13547
|
}, lg = (e) => {
|
|
13497
|
-
|
|
13548
|
+
B(Rh === e ? null : e);
|
|
13498
13549
|
}, ug = (t) => {
|
|
13499
|
-
let n =
|
|
13550
|
+
let n = H.find((e) => e.id === t);
|
|
13500
13551
|
if (!n) return [];
|
|
13501
|
-
let i =
|
|
13502
|
-
|
|
13503
|
-
let
|
|
13504
|
-
|
|
13505
|
-
|
|
13506
|
-
value
|
|
13507
|
-
|
|
13508
|
-
|
|
13509
|
-
|
|
13552
|
+
let i = e.filter((e) => Object.entries(J).every(([n, i]) => {
|
|
13553
|
+
if (n === t || !i.value) return !0;
|
|
13554
|
+
let a = H.find((e) => e.id === n);
|
|
13555
|
+
if (!a) return !0;
|
|
13556
|
+
let o = typeof a.accessor == "function" ? a.accessor(e) : e[a.accessor], s = String(o || "").toLowerCase(), c = !0;
|
|
13557
|
+
return i.type === "text" && (c = s.includes(String(i.value).toLowerCase())), i.type === "select" && (c = s === String(i.value).toLowerCase()), i.type === "multiselect" && Array.isArray(i.value) && (c = i.value.some((e) => s === String(e).toLowerCase())), c;
|
|
13558
|
+
})), a = /* @__PURE__ */ new Map();
|
|
13559
|
+
i.forEach((e) => {
|
|
13560
|
+
let t = typeof n.accessor == "function" ? n.accessor(e) : e[n.accessor], i = formatCellValue(t);
|
|
13561
|
+
a.set(i, (a.get(i) || 0) + 1);
|
|
13562
|
+
});
|
|
13563
|
+
let o = /* @__PURE__ */ new Map();
|
|
13564
|
+
e.forEach((e) => {
|
|
13565
|
+
let t = typeof n.accessor == "function" ? n.accessor(e) : e[n.accessor], i = formatCellValue(t);
|
|
13566
|
+
o.set(i, (o.get(i) || 0) + 1);
|
|
13567
|
+
});
|
|
13568
|
+
let s = [], c = [];
|
|
13569
|
+
return o.forEach((e, t) => {
|
|
13570
|
+
let n = a.get(t);
|
|
13571
|
+
n !== void 0 && n > 0 ? s.push({
|
|
13572
|
+
value: t,
|
|
13573
|
+
count: n,
|
|
13574
|
+
label: `${t} (${n})`,
|
|
13575
|
+
group: "Disponibles"
|
|
13576
|
+
}) : c.push({
|
|
13577
|
+
value: t,
|
|
13578
|
+
count: e,
|
|
13579
|
+
label: `${t} (0)`,
|
|
13580
|
+
group: "Otros"
|
|
13581
|
+
});
|
|
13582
|
+
}), s.sort((e, t) => e.value.localeCompare(t.value)), c.sort((e, t) => e.value.localeCompare(t.value)), c.length === 0 ? s.map((e) => ({
|
|
13583
|
+
...e,
|
|
13584
|
+
group: void 0
|
|
13585
|
+
})) : [...s, ...c];
|
|
13510
13586
|
}, dg = Object.values(J).some((e) => e.type === "text" && e.value || e.type === "select" && e.value || e.type === "multiselect" && Array.isArray(e.value) && e.value.length > 0), fg = useMemo(() => {
|
|
13511
13587
|
let e = [];
|
|
13512
13588
|
return Object.entries(J).forEach(([t, n]) => {
|
|
13513
|
-
let i =
|
|
13589
|
+
let i = H.find((e) => e.id === t);
|
|
13514
13590
|
i && (n.type === "text" && n.value ? e.push({
|
|
13515
13591
|
columnId: t,
|
|
13516
13592
|
columnLabel: i.label,
|
|
@@ -13525,7 +13601,7 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
|
|
|
13525
13601
|
});
|
|
13526
13602
|
}));
|
|
13527
13603
|
}), e;
|
|
13528
|
-
}, [J,
|
|
13604
|
+
}, [J, H]), pg = (e, t) => {
|
|
13529
13605
|
let n = J[e];
|
|
13530
13606
|
if (n.type === "text") Vh(e, "", "text");
|
|
13531
13607
|
else if (n.type === "multiselect" && Array.isArray(n.value)) {
|
|
@@ -13535,15 +13611,15 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
|
|
|
13535
13611
|
};
|
|
13536
13612
|
useEffect(() => {
|
|
13537
13613
|
let e = (e) => {
|
|
13538
|
-
|
|
13614
|
+
V.current && !V.current.contains(e.target) && z(!1);
|
|
13539
13615
|
};
|
|
13540
13616
|
return Lh && document.addEventListener("mousedown", e), () => {
|
|
13541
13617
|
document.removeEventListener("mousedown", e);
|
|
13542
13618
|
};
|
|
13543
13619
|
}, [Lh]);
|
|
13544
|
-
let
|
|
13545
|
-
|
|
13546
|
-
},
|
|
13620
|
+
let mg = Math.ceil(Y.total / Y.pageSize), hg = (e) => Qh[e.id] ? Qh[e.id] : e.width ? e.width : e.isAction ? 100 : 150 + (e.filterable ? 50 : 0), gg = () => {
|
|
13621
|
+
Xh(), Ah?.();
|
|
13622
|
+
}, _g = ({ columnLabel: e, value: t, onRemove: n }) => /* @__PURE__ */ jsxs("div", {
|
|
13547
13623
|
className: "inline-flex items-center gap-1 bg-blue-100 text-blue-800 font-medium px-4 py-1 rounded-full border border-blue-300 hover:bg-blue-200 transition-colors",
|
|
13548
13624
|
children: [
|
|
13549
13625
|
/* @__PURE__ */ jsxs("span", {
|
|
@@ -13570,9 +13646,9 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
|
|
|
13570
13646
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
13571
13647
|
className: "flex items-center gap-2",
|
|
13572
13648
|
children: [
|
|
13573
|
-
(
|
|
13649
|
+
(kh || Ah) && /* @__PURE__ */ jsx(Button_default, {
|
|
13574
13650
|
level: "secondary",
|
|
13575
|
-
onClick:
|
|
13651
|
+
onClick: gg,
|
|
13576
13652
|
loading: eg,
|
|
13577
13653
|
children: /* @__PURE__ */ jsx(RefreshIcon, { size: 18 })
|
|
13578
13654
|
}),
|
|
@@ -13580,14 +13656,14 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
|
|
|
13580
13656
|
className: "relative",
|
|
13581
13657
|
children: [/* @__PURE__ */ jsxs(Button_default, {
|
|
13582
13658
|
level: "secondary",
|
|
13583
|
-
onClick: () =>
|
|
13659
|
+
onClick: () => z(!Lh),
|
|
13584
13660
|
children: [/* @__PURE__ */ jsx(EyeIcon, {}), /* @__PURE__ */ jsx("span", {
|
|
13585
13661
|
className: "hidden md:block",
|
|
13586
13662
|
children: k.configuration
|
|
13587
13663
|
})]
|
|
13588
13664
|
}), Lh && /* @__PURE__ */ jsx("div", {
|
|
13589
13665
|
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",
|
|
13590
|
-
ref:
|
|
13666
|
+
ref: V,
|
|
13591
13667
|
children: /* @__PURE__ */ jsxs("div", {
|
|
13592
13668
|
className: "mb-4 last:mb-0",
|
|
13593
13669
|
children: [/* @__PURE__ */ jsx("div", {
|
|
@@ -13595,8 +13671,8 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
|
|
|
13595
13671
|
children: k.columnVisibility
|
|
13596
13672
|
}), /* @__PURE__ */ jsx("div", {
|
|
13597
13673
|
className: "flex flex-col gap-2",
|
|
13598
|
-
children:
|
|
13599
|
-
let t = !
|
|
13674
|
+
children: H.filter((e) => !e.isAction).map((e) => {
|
|
13675
|
+
let t = !X.includes(e.id);
|
|
13600
13676
|
return /* @__PURE__ */ jsxs("div", {
|
|
13601
13677
|
className: "flex items-center justify-between gap-2 hover:bg-gray-50 p-1 rounded",
|
|
13602
13678
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
@@ -13605,7 +13681,7 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
|
|
|
13605
13681
|
type: "checkbox",
|
|
13606
13682
|
className: "w-4 h-4 accent-redi-primary cursor-pointer",
|
|
13607
13683
|
checked: t,
|
|
13608
|
-
onChange: () =>
|
|
13684
|
+
onChange: () => Kh(e.id),
|
|
13609
13685
|
id: `col-visibility-${e.id}`
|
|
13610
13686
|
}), /* @__PURE__ */ jsx("label", {
|
|
13611
13687
|
htmlFor: `col-visibility-${e.id}`,
|
|
@@ -13618,11 +13694,11 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
|
|
|
13618
13694
|
j && /* @__PURE__ */ jsx(Button_default, {
|
|
13619
13695
|
level: "icon",
|
|
13620
13696
|
onClick: (t) => {
|
|
13621
|
-
t.stopPropagation(),
|
|
13697
|
+
t.stopPropagation(), qh(e.id);
|
|
13622
13698
|
},
|
|
13623
|
-
"aria-label":
|
|
13699
|
+
"aria-label": Z.includes(e.id) ? "Unpin column" : "Pin column",
|
|
13624
13700
|
className: "p-1 hover:bg-gray-200 rounded-full",
|
|
13625
|
-
children:
|
|
13701
|
+
children: Z.includes(e.id) ? /* @__PURE__ */ jsx(PinIcon, {
|
|
13626
13702
|
size: 14,
|
|
13627
13703
|
className: "text-redi-primary"
|
|
13628
13704
|
}) : /* @__PURE__ */ jsx(PinOffIcon, {
|
|
@@ -13634,11 +13710,11 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
|
|
|
13634
13710
|
level: "icon",
|
|
13635
13711
|
onClick: (t) => {
|
|
13636
13712
|
t.stopPropagation();
|
|
13637
|
-
let n =
|
|
13713
|
+
let n = H.map((t) => t.id === e.id ? {
|
|
13638
13714
|
...t,
|
|
13639
13715
|
draggable: !t.draggable
|
|
13640
13716
|
} : t);
|
|
13641
|
-
|
|
13717
|
+
U(n);
|
|
13642
13718
|
},
|
|
13643
13719
|
"aria-label": e.draggable ? "Disable drag" : "Enable drag",
|
|
13644
13720
|
className: "p-1 hover:bg-gray-200 rounded-full",
|
|
@@ -13652,11 +13728,11 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
|
|
|
13652
13728
|
level: "icon",
|
|
13653
13729
|
onClick: (t) => {
|
|
13654
13730
|
t.stopPropagation();
|
|
13655
|
-
let n =
|
|
13731
|
+
let n = H.map((t) => t.id === e.id ? {
|
|
13656
13732
|
...t,
|
|
13657
13733
|
filterable: !t.filterable
|
|
13658
13734
|
} : t);
|
|
13659
|
-
|
|
13735
|
+
U(n);
|
|
13660
13736
|
},
|
|
13661
13737
|
"aria-label": e.filterable ? "Disable filter" : "Enable filter",
|
|
13662
13738
|
className: "p-1 hover:bg-gray-200 rounded-full",
|
|
@@ -13684,7 +13760,7 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
|
|
|
13684
13760
|
}),
|
|
13685
13761
|
fg.length > 0 && /* @__PURE__ */ jsx("div", {
|
|
13686
13762
|
className: "flex items-center gap-2 flex-wrap ml-2",
|
|
13687
|
-
children: fg.map((e, t) => /* @__PURE__ */ jsx(
|
|
13763
|
+
children: fg.map((e, t) => /* @__PURE__ */ jsx(_g, {
|
|
13688
13764
|
columnLabel: e.columnLabel,
|
|
13689
13765
|
value: e.displayValue,
|
|
13690
13766
|
onRemove: () => pg(e.columnId, e.value)
|
|
@@ -13705,9 +13781,9 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
|
|
|
13705
13781
|
children: /* @__PURE__ */ jsxs("table", {
|
|
13706
13782
|
className: "w-full border-separate border-spacing-0 table-auto text-sm relative",
|
|
13707
13783
|
"aria-label": "Data Table",
|
|
13708
|
-
children: [/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", { children:
|
|
13709
|
-
let n =
|
|
13710
|
-
if (i) for (let e = 0; e < t; e++)
|
|
13784
|
+
children: [/* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", { children: Q.map((e, t) => {
|
|
13785
|
+
let n = hg(e), i = Z.includes(e.id), a = 0;
|
|
13786
|
+
if (i) for (let e = 0; e < t; e++) Z.includes(Q[e].id) && (a += hg(Q[e]));
|
|
13711
13787
|
let o = {
|
|
13712
13788
|
width: n,
|
|
13713
13789
|
minWidth: n,
|
|
@@ -13750,7 +13826,7 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
|
|
|
13750
13826
|
return Zh.includes(t);
|
|
13751
13827
|
}),
|
|
13752
13828
|
onChange: (e) => {
|
|
13753
|
-
e.stopPropagation(),
|
|
13829
|
+
e.stopPropagation(), G(K);
|
|
13754
13830
|
}
|
|
13755
13831
|
}),
|
|
13756
13832
|
/* @__PURE__ */ jsxs("div", {
|
|
@@ -13758,12 +13834,12 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
|
|
|
13758
13834
|
children: [/* @__PURE__ */ jsxs("span", {
|
|
13759
13835
|
className: h ? "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" : "",
|
|
13760
13836
|
onClick: (t) => {
|
|
13761
|
-
t.stopPropagation(), e.sortable &&
|
|
13837
|
+
t.stopPropagation(), e.sortable && Bh(e.id);
|
|
13762
13838
|
},
|
|
13763
13839
|
role: "button",
|
|
13764
13840
|
tabIndex: 0,
|
|
13765
13841
|
onKeyDown: (t) => {
|
|
13766
|
-
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), e.sortable &&
|
|
13842
|
+
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), e.sortable && Bh(e.id));
|
|
13767
13843
|
},
|
|
13768
13844
|
children: [e.label, e.sortable && q?.column === e.id && /* @__PURE__ */ jsx("span", {
|
|
13769
13845
|
className: "font-bold text-redi-link-text text-base",
|
|
@@ -13780,7 +13856,7 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
|
|
|
13780
13856
|
},
|
|
13781
13857
|
"aria-label": `Filter by ${e.label}`,
|
|
13782
13858
|
children: /* @__PURE__ */ jsx(FilterIcon, { size: 16 })
|
|
13783
|
-
}),
|
|
13859
|
+
}), Rh === e.id && /* @__PURE__ */ jsx(AdvancedFilter_default, {
|
|
13784
13860
|
columnId: e.id,
|
|
13785
13861
|
label: e.label,
|
|
13786
13862
|
options: ug(e.id),
|
|
@@ -13788,7 +13864,7 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
|
|
|
13788
13864
|
selectedValues: J[e.id]?.type === "multiselect" && Array.isArray(J[e.id]?.value) ? J[e.id].value : [],
|
|
13789
13865
|
onTextChange: (t) => Vh(e.id, t, "text"),
|
|
13790
13866
|
onSelectionChange: (t) => Vh(e.id, t, "multiselect"),
|
|
13791
|
-
onClose: () =>
|
|
13867
|
+
onClose: () => B(null)
|
|
13792
13868
|
})]
|
|
13793
13869
|
})
|
|
13794
13870
|
})]
|
|
@@ -13800,11 +13876,11 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
|
|
|
13800
13876
|
]
|
|
13801
13877
|
})
|
|
13802
13878
|
}, e.id);
|
|
13803
|
-
}) }) }), /* @__PURE__ */ jsx("tbody", { children:
|
|
13879
|
+
}) }) }), /* @__PURE__ */ jsx("tbody", { children: Oh ? Array.from({ length: 5 }).map((e, t) => /* @__PURE__ */ jsx("tr", {
|
|
13804
13880
|
className: "border-b border-solid border-gray-100",
|
|
13805
|
-
children:
|
|
13806
|
-
let n =
|
|
13807
|
-
if (i) for (let e = 0; e < t; e++)
|
|
13881
|
+
children: Q.map((e, t) => {
|
|
13882
|
+
let n = hg(e), i = Z.includes(e.id), a = 0;
|
|
13883
|
+
if (i) for (let e = 0; e < t; e++) Z.includes(Q[e].id) && (a += hg(Q[e]));
|
|
13808
13884
|
let o = {
|
|
13809
13885
|
width: n,
|
|
13810
13886
|
minWidth: n,
|
|
@@ -13824,9 +13900,9 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
|
|
|
13824
13900
|
})
|
|
13825
13901
|
}, `skeleton-${t}`)) : K.length > 0 ? K.map((e, t) => /* @__PURE__ */ jsx("tr", {
|
|
13826
13902
|
className: "even:bg-gray-50 hover:bg-gray-100 border-b border-solid border-b-gray-100 odd:bg-white",
|
|
13827
|
-
children:
|
|
13828
|
-
let a = typeof n.accessor == "function" ? n.accessor(e) : e[n.accessor], o = n.isAction, s =
|
|
13829
|
-
if (c) for (let e = 0; e < i; e++)
|
|
13903
|
+
children: Q.map((n, i) => {
|
|
13904
|
+
let a = typeof n.accessor == "function" ? n.accessor(e) : e[n.accessor], o = n.isAction, s = hg(n), c = Z.includes(n.id), l = o && P, u = 0;
|
|
13905
|
+
if (c) for (let e = 0; e < i; e++) Z.includes(Q[e].id) && (u += hg(Q[e]));
|
|
13830
13906
|
let f = `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
|
|
13831
13907
|
${o ? "border-l border-gray-300" : ""}
|
|
13832
13908
|
${c ? "shadow-[2px_0_5px_-2px_rgba(0,0,0,0.1)]" : ""}
|
|
@@ -13865,7 +13941,7 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
|
|
|
13865
13941
|
}, n.id);
|
|
13866
13942
|
})
|
|
13867
13943
|
}, t)) : /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", {
|
|
13868
|
-
colSpan:
|
|
13944
|
+
colSpan: Q.length,
|
|
13869
13945
|
className: "py-12 text-center text-gray-500",
|
|
13870
13946
|
children: /* @__PURE__ */ jsxs("div", {
|
|
13871
13947
|
className: "flex flex-col items-center justify-center gap-2",
|
|
@@ -13915,7 +13991,7 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
|
|
|
13915
13991
|
k.pagination?.showPerPage,
|
|
13916
13992
|
/* @__PURE__ */ jsx("select", {
|
|
13917
13993
|
value: Y.pageSize,
|
|
13918
|
-
onChange: (e) =>
|
|
13994
|
+
onChange: (e) => Wh(Number(e.target.value)),
|
|
13919
13995
|
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",
|
|
13920
13996
|
children: u.map((e) => /* @__PURE__ */ jsx("option", {
|
|
13921
13997
|
value: e,
|
|
@@ -13929,34 +14005,34 @@ var AdvancedTable_default = ({ data: e, columns: t, defaultSort: n, defaultFilte
|
|
|
13929
14005
|
children: [
|
|
13930
14006
|
/* @__PURE__ */ jsx(Button_default, {
|
|
13931
14007
|
level: "icon",
|
|
13932
|
-
onClick: () =>
|
|
14008
|
+
onClick: () => Uh(1),
|
|
13933
14009
|
disabled: Y.page === 1,
|
|
13934
14010
|
children: "<<"
|
|
13935
14011
|
}),
|
|
13936
14012
|
/* @__PURE__ */ jsx(Button_default, {
|
|
13937
14013
|
level: "icon",
|
|
13938
|
-
onClick: () =>
|
|
14014
|
+
onClick: () => Uh(Y.page - 1),
|
|
13939
14015
|
disabled: Y.page === 1,
|
|
13940
14016
|
children: "<"
|
|
13941
14017
|
}),
|
|
13942
|
-
Array.from({ length: Math.min(3,
|
|
14018
|
+
Array.from({ length: Math.min(3, mg) }, (e, t) => {
|
|
13943
14019
|
let n;
|
|
13944
|
-
return n =
|
|
14020
|
+
return n = mg <= 3 || Y.page <= 2 ? t + 1 : Y.page > mg - 2 ? mg - 2 + t : Y.page - 1 + t, /* @__PURE__ */ jsx(Button_default, {
|
|
13945
14021
|
level: Y.page === n ? "primary" : "secondary",
|
|
13946
|
-
onClick: () =>
|
|
14022
|
+
onClick: () => Uh(n),
|
|
13947
14023
|
children: n
|
|
13948
14024
|
}, n);
|
|
13949
14025
|
}),
|
|
13950
14026
|
/* @__PURE__ */ jsx(Button_default, {
|
|
13951
14027
|
level: "icon",
|
|
13952
|
-
onClick: () =>
|
|
13953
|
-
disabled: Y.page ===
|
|
14028
|
+
onClick: () => Uh(Y.page + 1),
|
|
14029
|
+
disabled: Y.page === mg,
|
|
13954
14030
|
children: ">"
|
|
13955
14031
|
}),
|
|
13956
14032
|
/* @__PURE__ */ jsx(Button_default, {
|
|
13957
14033
|
level: "icon",
|
|
13958
|
-
onClick: () =>
|
|
13959
|
-
disabled: Y.page ===
|
|
14034
|
+
onClick: () => Uh(mg),
|
|
14035
|
+
disabled: Y.page === mg,
|
|
13960
14036
|
children: ">>"
|
|
13961
14037
|
})
|
|
13962
14038
|
]
|