react-ecosistema-unp 1.7.19 → 1.7.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/Tabla.css +1 -1
- package/dist/cards/tarjeta-info/TarjetaInfo.js +33 -30
- package/dist/lib/cards/tarjeta-info/TarjetaInfo.d.ts +1 -0
- package/dist/lib/tables/tabla-registros/TablaRegistros.d.ts +1 -0
- package/dist/lib/tables/tabla-registros/tabla/Tabla.d.ts +1 -0
- package/dist/tables/tabla-registros/TablaRegistros.js +263 -261
- package/dist/tables/tabla-registros/tabla/Tabla.js +32 -30
- package/package.json +1 -1
|
@@ -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 S, { useState as m, useEffect as X } from "react";
|
|
3
|
+
import { v as Y, w as Z } from "../../../index-DDjnZyBf.js";
|
|
4
|
+
import { a as w, b as ee, c as te, d as re } from "../../../index-D3WseyJh.js";
|
|
5
|
+
import { T as se } from "../../../Table-C5ydZooy.js";
|
|
6
|
+
import { F as oe, a as ie } from "../../../FormGroup-BLpFcIN5.js";
|
|
7
|
+
import { B as ne } from "../../../Button-B87TJYml.js";
|
|
8
|
+
import '../../../assets/Tabla.css';const ue = ({
|
|
9
9
|
columns: u,
|
|
10
10
|
displayedData: f,
|
|
11
11
|
// tableData,
|
|
@@ -25,16 +25,17 @@ import '../../../assets/Tabla.css';const ge = ({
|
|
|
25
25
|
onSelectionChange: C,
|
|
26
26
|
enableRowSelection: h = !1,
|
|
27
27
|
// Indicador para aumentar la selección de casos por gestionar
|
|
28
|
-
extendedSelection: P
|
|
28
|
+
extendedSelection: P,
|
|
29
|
+
cellSelectionColor: U
|
|
29
30
|
}) => {
|
|
30
|
-
const [l,
|
|
31
|
+
const [l, V] = m({
|
|
31
32
|
key: null,
|
|
32
33
|
direction: null
|
|
33
|
-
}), [c,
|
|
34
|
-
|
|
34
|
+
}), [c, W] = m([]), [y, _] = m(null), [k, B] = m(null);
|
|
35
|
+
X(() => {
|
|
35
36
|
C == null || C(c);
|
|
36
37
|
}, [c]);
|
|
37
|
-
const
|
|
38
|
+
const $ = (e, o) => {
|
|
38
39
|
const r = k || H, i = r.findIndex((p) => p.numeroRegistro === e);
|
|
39
40
|
if (i === -1) return;
|
|
40
41
|
const n = r[i], t = c.includes(e);
|
|
@@ -43,27 +44,27 @@ import '../../../assets/Tabla.css';const ge = ({
|
|
|
43
44
|
a = c.filter((p) => p !== e), a.length === 0 && (B(null), _(null));
|
|
44
45
|
else if (c.length === 0) {
|
|
45
46
|
a = [e], _(n.tipoMesa);
|
|
46
|
-
const p = n.tipoMesa,
|
|
47
|
-
B([...
|
|
47
|
+
const p = n.tipoMesa, K = r.filter((g) => g.tipoMesa === p && g.numeroRegistro !== e), j = r.filter((g) => g.tipoMesa !== p), E = r.findIndex((g) => g.numeroRegistro === e), L = j.slice(0, E), Q = j.slice(E);
|
|
48
|
+
B([...L, n, ...K, ...Q]);
|
|
48
49
|
} else {
|
|
49
50
|
if (y && n.tipoMesa !== y) return;
|
|
50
51
|
a = [...c, e];
|
|
51
52
|
}
|
|
52
|
-
|
|
53
|
+
W(a);
|
|
53
54
|
}, A = { i: 0 }, G = (e) => {
|
|
54
55
|
if (v) {
|
|
55
56
|
const o = e / v * 100;
|
|
56
57
|
return o <= 25 ? { backgroundColor: "#3AB34A", color: "#FFFFFF" } : o <= 50 ? { backgroundColor: "#F8EB10", color: "#000000" } : o <= 75 ? { backgroundColor: "#F79122", color: "#000000" } : { backgroundColor: "#E91720", color: "#FFFFFF" };
|
|
57
58
|
}
|
|
58
59
|
return { backgroundColor: "transparent", color: "inherit" };
|
|
59
|
-
},
|
|
60
|
+
}, q = (e) => {
|
|
60
61
|
const { scrollTop: o, clientHeight: r, scrollHeight: i } = e.currentTarget;
|
|
61
62
|
i - o <= r + 50 && x && D((n) => {
|
|
62
63
|
const t = n + 5;
|
|
63
64
|
return t >= f.length && z(!1), Math.min(t, f.length);
|
|
64
65
|
});
|
|
65
|
-
},
|
|
66
|
-
|
|
66
|
+
}, J = (e) => {
|
|
67
|
+
V((o) => ({
|
|
67
68
|
key: e,
|
|
68
69
|
direction: o.key === e && o.direction === "asc" ? "desc" : "asc"
|
|
69
70
|
}));
|
|
@@ -84,7 +85,7 @@ import '../../../assets/Tabla.css';const ge = ({
|
|
|
84
85
|
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;
|
|
85
86
|
});
|
|
86
87
|
})(), F = k || (l.direction === "asc" || l.direction === "desc" ? H : f);
|
|
87
|
-
return /* @__PURE__ */ s("div", { className: "table_container", children: /* @__PURE__ */ s("div", { className: "table-scroll", onScroll:
|
|
88
|
+
return /* @__PURE__ */ s("div", { className: "table_container", children: /* @__PURE__ */ s("div", { className: "table-scroll", onScroll: q, children: /* @__PURE__ */ d(se, { striped: !0, hover: !0, children: [
|
|
88
89
|
/* @__PURE__ */ d("thead", { children: [
|
|
89
90
|
/* @__PURE__ */ d("tr", { children: [
|
|
90
91
|
h && /* @__PURE__ */ s("th", { className: "table-header-unp" }),
|
|
@@ -92,12 +93,12 @@ import '../../../assets/Tabla.css';const ge = ({
|
|
|
92
93
|
"th",
|
|
93
94
|
{
|
|
94
95
|
className: "table-header-unp",
|
|
95
|
-
onClick: () => (e.sorter || T) &&
|
|
96
|
+
onClick: () => (e.sorter || T) && J(e.key),
|
|
96
97
|
style: { cursor: N ? "pointer" : "default" },
|
|
97
98
|
children: [
|
|
98
99
|
e.label,
|
|
99
100
|
" ",
|
|
100
|
-
c.length == 0 && (e.sorter || T) ? l.key === e.key ? l.direction === "asc" ? /* @__PURE__ */ s(
|
|
101
|
+
c.length == 0 && (e.sorter || T) ? l.key === e.key ? l.direction === "asc" ? /* @__PURE__ */ s(w, {}) : /* @__PURE__ */ s(ee, {}) : /* @__PURE__ */ s(te, {}) : null
|
|
101
102
|
]
|
|
102
103
|
},
|
|
103
104
|
o
|
|
@@ -105,9 +106,9 @@ import '../../../assets/Tabla.css';const ge = ({
|
|
|
105
106
|
] }),
|
|
106
107
|
c.length == 0 && N && /* @__PURE__ */ d("tr", { children: [
|
|
107
108
|
h && /* @__PURE__ */ s("th", { className: "table-header-unp" }),
|
|
108
|
-
u.map((e, o) => /* @__PURE__ */ s("th", { children: /* @__PURE__ */ d(
|
|
109
|
+
u.map((e, o) => /* @__PURE__ */ s("th", { children: /* @__PURE__ */ d(oe, { className: "mx-1 position-relative", children: [
|
|
109
110
|
/* @__PURE__ */ s(
|
|
110
|
-
|
|
111
|
+
ie,
|
|
111
112
|
{
|
|
112
113
|
type: "text",
|
|
113
114
|
placeholder: `Buscar ${e.label}`,
|
|
@@ -117,7 +118,7 @@ import '../../../assets/Tabla.css';const ge = ({
|
|
|
117
118
|
}
|
|
118
119
|
),
|
|
119
120
|
R[e.key] && /* @__PURE__ */ s(
|
|
120
|
-
|
|
121
|
+
ne,
|
|
121
122
|
{
|
|
122
123
|
variant: "link",
|
|
123
124
|
size: "sm",
|
|
@@ -135,7 +136,7 @@ import '../../../assets/Tabla.css';const ge = ({
|
|
|
135
136
|
let r = !1;
|
|
136
137
|
b ? e.estadoRegistro === "en_gestion" ? r = !0 : e.estadoRegistro === "por_gestionar" && A.i < (P ? 15 : 5) && (r = !0, A.i++) : r = !0;
|
|
137
138
|
const i = h && y != null && e.tipoMesa !== y, n = c.includes(e.numeroRegistro);
|
|
138
|
-
return /* @__PURE__ */ d(
|
|
139
|
+
return /* @__PURE__ */ d(S.Fragment, { children: [
|
|
139
140
|
/* @__PURE__ */ d(
|
|
140
141
|
"tr",
|
|
141
142
|
{
|
|
@@ -153,9 +154,9 @@ import '../../../assets/Tabla.css';const ge = ({
|
|
|
153
154
|
cursor: i ? "not-allowed" : "pointer"
|
|
154
155
|
},
|
|
155
156
|
onClick: (t) => {
|
|
156
|
-
t.stopPropagation(), i ||
|
|
157
|
+
t.stopPropagation(), i || $(e.numeroRegistro);
|
|
157
158
|
},
|
|
158
|
-
children: n ? /* @__PURE__ */ s(
|
|
159
|
+
children: n ? /* @__PURE__ */ s(re, { size: 18, style: { color: "#505050ff" } }) : /* @__PURE__ */ s(Y, { size: 18, style: { color: "#505050ff" } })
|
|
159
160
|
}
|
|
160
161
|
),
|
|
161
162
|
u.map((t, a) => /* @__PURE__ */ s(
|
|
@@ -163,7 +164,8 @@ import '../../../assets/Tabla.css';const ge = ({
|
|
|
163
164
|
{
|
|
164
165
|
onClick: () => r ? O(t, e) : {},
|
|
165
166
|
style: {
|
|
166
|
-
cursor: (t.hasModal || t.redirectTo) && r ? "pointer" : "default"
|
|
167
|
+
cursor: (t.hasModal || t.redirectTo) && r ? "pointer" : "default",
|
|
168
|
+
"--cell-selection-bg-color": U || void 0
|
|
167
169
|
},
|
|
168
170
|
className: r ? t.redirectTo ? "cell-redirect" : t.hasModal ? "cell-with-modal" : "" : "",
|
|
169
171
|
children: t.key === "diasHabiles" ? /* @__PURE__ */ s(
|
|
@@ -208,7 +210,7 @@ import '../../../assets/Tabla.css';const ge = ({
|
|
|
208
210
|
fontWeight: "600",
|
|
209
211
|
color: o % 2 === 0 ? "#365072" : "#303D50",
|
|
210
212
|
backgroundColor: o % 2 === 0 ? "#fefefe" : "#f9fafa"
|
|
211
|
-
}, children: /* @__PURE__ */ s(
|
|
213
|
+
}, children: /* @__PURE__ */ s(Z, { style: { fontSize: "1.3rem" } }) }) }) })
|
|
212
214
|
] }, o);
|
|
213
215
|
}),
|
|
214
216
|
x && /* @__PURE__ */ s("tr", { children: /* @__PURE__ */ s("td", { colSpan: u.length, className: "text-center", children: "Cargando más datos..." }) })
|
|
@@ -216,5 +218,5 @@ import '../../../assets/Tabla.css';const ge = ({
|
|
|
216
218
|
] }) }) });
|
|
217
219
|
};
|
|
218
220
|
export {
|
|
219
|
-
|
|
221
|
+
ue as Tabla
|
|
220
222
|
};
|