react-ecosistema-unp 1.7.17 → 1.7.18
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.
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as s, jsxs as d } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import { v as
|
|
4
|
-
import { a as
|
|
5
|
-
import { T as
|
|
6
|
-
import { F as
|
|
7
|
-
import { B as
|
|
8
|
-
import '../../../assets/Tabla.css';const
|
|
2
|
+
import Q, { useState as m, useEffect as S } from "react";
|
|
3
|
+
import { v as X, w as Y } from "../../../index-DDjnZyBf.js";
|
|
4
|
+
import { a as Z, b as w, c as ee, d as te } from "../../../index-D3WseyJh.js";
|
|
5
|
+
import { T as re } from "../../../Table-C5ydZooy.js";
|
|
6
|
+
import { F as se, a as oe } from "../../../FormGroup-BLpFcIN5.js";
|
|
7
|
+
import { B as ie } from "../../../Button-B87TJYml.js";
|
|
8
|
+
import '../../../assets/Tabla.css';const ge = ({
|
|
9
9
|
columns: u,
|
|
10
10
|
displayedData: f,
|
|
11
11
|
// tableData,
|
|
@@ -23,16 +23,18 @@ import '../../../assets/Tabla.css';const pe = ({
|
|
|
23
23
|
enableColumnSorter: T,
|
|
24
24
|
//
|
|
25
25
|
onSelectionChange: C,
|
|
26
|
-
enableRowSelection: h = !1
|
|
26
|
+
enableRowSelection: h = !1,
|
|
27
|
+
// Indicador para aumentar la selección de casos por gestionar
|
|
28
|
+
extendedSelection: P
|
|
27
29
|
}) => {
|
|
28
|
-
const [l,
|
|
30
|
+
const [l, U] = m({
|
|
29
31
|
key: null,
|
|
30
32
|
direction: null
|
|
31
|
-
}), [c,
|
|
32
|
-
|
|
33
|
+
}), [c, V] = m([]), [y, _] = m(null), [k, B] = m(null);
|
|
34
|
+
S(() => {
|
|
33
35
|
C == null || C(c);
|
|
34
36
|
}, [c]);
|
|
35
|
-
const
|
|
37
|
+
const W = (e, o) => {
|
|
36
38
|
const r = k || H, i = r.findIndex((p) => p.numeroRegistro === e);
|
|
37
39
|
if (i === -1) return;
|
|
38
40
|
const n = r[i], t = c.includes(e);
|
|
@@ -41,27 +43,27 @@ import '../../../assets/Tabla.css';const pe = ({
|
|
|
41
43
|
a = c.filter((p) => p !== e), a.length === 0 && (B(null), _(null));
|
|
42
44
|
else if (c.length === 0) {
|
|
43
45
|
a = [e], _(n.tipoMesa);
|
|
44
|
-
const p = n.tipoMesa,
|
|
45
|
-
B([...
|
|
46
|
+
const p = n.tipoMesa, J = r.filter((g) => g.tipoMesa === p && g.numeroRegistro !== e), j = r.filter((g) => g.tipoMesa !== p), E = r.findIndex((g) => g.numeroRegistro === e), K = j.slice(0, E), L = j.slice(E);
|
|
47
|
+
B([...K, n, ...J, ...L]);
|
|
46
48
|
} else {
|
|
47
49
|
if (y && n.tipoMesa !== y) return;
|
|
48
50
|
a = [...c, e];
|
|
49
51
|
}
|
|
50
|
-
|
|
52
|
+
V(a);
|
|
51
53
|
}, A = { i: 0 }, G = (e) => {
|
|
52
54
|
if (v) {
|
|
53
55
|
const o = e / v * 100;
|
|
54
56
|
return o <= 25 ? { backgroundColor: "#3AB34A", color: "#FFFFFF" } : o <= 50 ? { backgroundColor: "#F8EB10", color: "#000000" } : o <= 75 ? { backgroundColor: "#F79122", color: "#000000" } : { backgroundColor: "#E91720", color: "#FFFFFF" };
|
|
55
57
|
}
|
|
56
58
|
return { backgroundColor: "transparent", color: "inherit" };
|
|
57
|
-
},
|
|
59
|
+
}, $ = (e) => {
|
|
58
60
|
const { scrollTop: o, clientHeight: r, scrollHeight: i } = e.currentTarget;
|
|
59
61
|
i - o <= r + 50 && x && D((n) => {
|
|
60
62
|
const t = n + 5;
|
|
61
63
|
return t >= f.length && z(!1), Math.min(t, f.length);
|
|
62
64
|
});
|
|
63
|
-
},
|
|
64
|
-
|
|
65
|
+
}, q = (e) => {
|
|
66
|
+
U((o) => ({
|
|
65
67
|
key: e,
|
|
66
68
|
direction: o.key === e && o.direction === "asc" ? "desc" : "asc"
|
|
67
69
|
}));
|
|
@@ -82,7 +84,7 @@ import '../../../assets/Tabla.css';const pe = ({
|
|
|
82
84
|
return typeof r == "number" && typeof i == "number" ? l.direction === "asc" ? r - i : i - r : typeof r == "string" && typeof i == "string" ? l.direction === "asc" ? r.localeCompare(i) : i.localeCompare(r) : 0;
|
|
83
85
|
});
|
|
84
86
|
})(), F = k || (l.direction === "asc" || l.direction === "desc" ? H : f);
|
|
85
|
-
return /* @__PURE__ */ s("div", { className: "table_container", children: /* @__PURE__ */ s("div", { className: "table-scroll", onScroll:
|
|
87
|
+
return /* @__PURE__ */ s("div", { className: "table_container", children: /* @__PURE__ */ s("div", { className: "table-scroll", onScroll: $, children: /* @__PURE__ */ d(re, { striped: !0, hover: !0, children: [
|
|
86
88
|
/* @__PURE__ */ d("thead", { children: [
|
|
87
89
|
/* @__PURE__ */ d("tr", { children: [
|
|
88
90
|
h && /* @__PURE__ */ s("th", { className: "table-header-unp" }),
|
|
@@ -90,12 +92,12 @@ import '../../../assets/Tabla.css';const pe = ({
|
|
|
90
92
|
"th",
|
|
91
93
|
{
|
|
92
94
|
className: "table-header-unp",
|
|
93
|
-
onClick: () => (e.sorter || T) &&
|
|
95
|
+
onClick: () => (e.sorter || T) && q(e.key),
|
|
94
96
|
style: { cursor: N ? "pointer" : "default" },
|
|
95
97
|
children: [
|
|
96
98
|
e.label,
|
|
97
99
|
" ",
|
|
98
|
-
c.length == 0 && (e.sorter || T) ? l.key === e.key ? l.direction === "asc" ? /* @__PURE__ */ s(
|
|
100
|
+
c.length == 0 && (e.sorter || T) ? l.key === e.key ? l.direction === "asc" ? /* @__PURE__ */ s(Z, {}) : /* @__PURE__ */ s(w, {}) : /* @__PURE__ */ s(ee, {}) : null
|
|
99
101
|
]
|
|
100
102
|
},
|
|
101
103
|
o
|
|
@@ -103,9 +105,9 @@ import '../../../assets/Tabla.css';const pe = ({
|
|
|
103
105
|
] }),
|
|
104
106
|
c.length == 0 && N && /* @__PURE__ */ d("tr", { children: [
|
|
105
107
|
h && /* @__PURE__ */ s("th", { className: "table-header-unp" }),
|
|
106
|
-
u.map((e, o) => /* @__PURE__ */ s("th", { children: /* @__PURE__ */ d(
|
|
108
|
+
u.map((e, o) => /* @__PURE__ */ s("th", { children: /* @__PURE__ */ d(se, { className: "mx-1 position-relative", children: [
|
|
107
109
|
/* @__PURE__ */ s(
|
|
108
|
-
|
|
110
|
+
oe,
|
|
109
111
|
{
|
|
110
112
|
type: "text",
|
|
111
113
|
placeholder: `Buscar ${e.label}`,
|
|
@@ -115,7 +117,7 @@ import '../../../assets/Tabla.css';const pe = ({
|
|
|
115
117
|
}
|
|
116
118
|
),
|
|
117
119
|
R[e.key] && /* @__PURE__ */ s(
|
|
118
|
-
|
|
120
|
+
ie,
|
|
119
121
|
{
|
|
120
122
|
variant: "link",
|
|
121
123
|
size: "sm",
|
|
@@ -131,9 +133,9 @@ import '../../../assets/Tabla.css';const pe = ({
|
|
|
131
133
|
/* @__PURE__ */ d("tbody", { children: [
|
|
132
134
|
F.slice(0, I).map((e, o) => {
|
|
133
135
|
let r = !1;
|
|
134
|
-
b ? e.estadoRegistro === "en_gestion" ? r = !0 : e.estadoRegistro === "por_gestionar" && A.i < 5 && (r = !0, A.i++) : r = !0;
|
|
136
|
+
b ? e.estadoRegistro === "en_gestion" ? r = !0 : e.estadoRegistro === "por_gestionar" && A.i < (P ? 15 : 5) && (r = !0, A.i++) : r = !0;
|
|
135
137
|
const i = h && y != null && e.tipoMesa !== y, n = c.includes(e.numeroRegistro);
|
|
136
|
-
return /* @__PURE__ */ d(
|
|
138
|
+
return /* @__PURE__ */ d(Q.Fragment, { children: [
|
|
137
139
|
/* @__PURE__ */ d(
|
|
138
140
|
"tr",
|
|
139
141
|
{
|
|
@@ -151,9 +153,9 @@ import '../../../assets/Tabla.css';const pe = ({
|
|
|
151
153
|
cursor: i ? "not-allowed" : "pointer"
|
|
152
154
|
},
|
|
153
155
|
onClick: (t) => {
|
|
154
|
-
t.stopPropagation(), i ||
|
|
156
|
+
t.stopPropagation(), i || W(e.numeroRegistro);
|
|
155
157
|
},
|
|
156
|
-
children: n ? /* @__PURE__ */ s(
|
|
158
|
+
children: n ? /* @__PURE__ */ s(te, { size: 18, style: { color: "#505050ff" } }) : /* @__PURE__ */ s(X, { size: 18, style: { color: "#505050ff" } })
|
|
157
159
|
}
|
|
158
160
|
),
|
|
159
161
|
u.map((t, a) => /* @__PURE__ */ s(
|
|
@@ -206,7 +208,7 @@ import '../../../assets/Tabla.css';const pe = ({
|
|
|
206
208
|
fontWeight: "600",
|
|
207
209
|
color: o % 2 === 0 ? "#365072" : "#303D50",
|
|
208
210
|
backgroundColor: o % 2 === 0 ? "#fefefe" : "#f9fafa"
|
|
209
|
-
}, children: /* @__PURE__ */ s(
|
|
211
|
+
}, children: /* @__PURE__ */ s(Y, { style: { fontSize: "1.3rem" } }) }) }) })
|
|
210
212
|
] }, o);
|
|
211
213
|
}),
|
|
212
214
|
x && /* @__PURE__ */ s("tr", { children: /* @__PURE__ */ s("td", { colSpan: u.length, className: "text-center", children: "Cargando más datos..." }) })
|
|
@@ -214,5 +216,5 @@ import '../../../assets/Tabla.css';const pe = ({
|
|
|
214
216
|
] }) }) });
|
|
215
217
|
};
|
|
216
218
|
export {
|
|
217
|
-
|
|
219
|
+
ge as Tabla
|
|
218
220
|
};
|