react-ecosistema-unp 1.7.6 → 1.7.7
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/lib/auth/contexts/AuthContex.d.ts +3 -0
- package/dist/lib/tables/tabla-registros/TablaRegistros.d.ts +1 -0
- package/dist/lib/utils/eco-provider/EcoContext.d.ts +4 -0
- package/dist/lib/utils/websocket-manager/WebSocketContext.d.ts +3 -0
- package/dist/lib/utils.d.ts +1 -0
- package/dist/tables/tabla-registros/TablaRegistros.js +263 -261
- package/dist/tables/tabla-registros/tabla/Tabla.js +104 -101
- package/dist/utils/eco-provider/EcoContext.js +31 -0
- package/dist/utils.js +17 -15
- package/package.json +1 -1
|
@@ -1,93 +1,93 @@
|
|
|
1
1
|
import { jsx as r, 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
|
|
9
|
-
columns:
|
|
10
|
-
displayedData:
|
|
2
|
+
import H, { useState as S } from "react";
|
|
3
|
+
import { v as j } from "../../../index-069JzHFQ.js";
|
|
4
|
+
import { a as A, b as E, c as z } from "../../../index-CgSyrJ_X.js";
|
|
5
|
+
import { T as M } from "../../../Table-C5ydZooy.js";
|
|
6
|
+
import { F as O, a as U } from "../../../FormGroup-BLpFcIN5.js";
|
|
7
|
+
import { B as V } from "../../../Button-B87TJYml.js";
|
|
8
|
+
import '../../../assets/Tabla.css';const P = ({
|
|
9
|
+
columns: f,
|
|
10
|
+
displayedData: l,
|
|
11
11
|
// tableData,
|
|
12
12
|
hasMoreData: h,
|
|
13
|
-
setHasMoreData:
|
|
14
|
-
visibleData:
|
|
15
|
-
setVisibleData:
|
|
16
|
-
handleCellClick:
|
|
17
|
-
totalDias:
|
|
18
|
-
isShared:
|
|
13
|
+
setHasMoreData: v,
|
|
14
|
+
visibleData: x,
|
|
15
|
+
setVisibleData: N,
|
|
16
|
+
handleCellClick: T,
|
|
17
|
+
totalDias: y,
|
|
18
|
+
isShared: p,
|
|
19
19
|
//
|
|
20
|
-
enableColumnSearch:
|
|
21
|
-
columnSearch:
|
|
20
|
+
enableColumnSearch: u,
|
|
21
|
+
columnSearch: k,
|
|
22
22
|
handleColumnSearch: b,
|
|
23
23
|
enableColumnSorter: C
|
|
24
24
|
}) => {
|
|
25
|
-
const [i,
|
|
25
|
+
const [i, B] = S({
|
|
26
26
|
key: null,
|
|
27
27
|
direction: null
|
|
28
|
-
}), F = (e) => {
|
|
29
|
-
if (
|
|
30
|
-
const o = e /
|
|
28
|
+
}), F = { i: 0 }, m = (e) => {
|
|
29
|
+
if (y) {
|
|
30
|
+
const o = e / y * 100;
|
|
31
31
|
return o <= 25 ? { backgroundColor: "#3AB34A", color: "#FFFFFF" } : o <= 50 ? { backgroundColor: "#F8EB10", color: "#000000" } : o <= 75 ? { backgroundColor: "#F79122", color: "#000000" } : { backgroundColor: "#E91720", color: "#FFFFFF" };
|
|
32
32
|
}
|
|
33
33
|
return { backgroundColor: "transparent", color: "inherit" };
|
|
34
|
-
},
|
|
35
|
-
const { scrollTop: o, clientHeight:
|
|
36
|
-
|
|
37
|
-
const s =
|
|
38
|
-
return s >=
|
|
34
|
+
}, _ = (e) => {
|
|
35
|
+
const { scrollTop: o, clientHeight: n, scrollHeight: t } = e.currentTarget;
|
|
36
|
+
t - o <= n + 50 && h && N((a) => {
|
|
37
|
+
const s = a + 5;
|
|
38
|
+
return s >= l.length && v(!1), Math.min(s, l.length);
|
|
39
39
|
});
|
|
40
|
-
},
|
|
41
|
-
|
|
40
|
+
}, R = (e) => {
|
|
41
|
+
B((o) => ({
|
|
42
42
|
key: e,
|
|
43
43
|
direction: o.key === e && o.direction === "asc" ? "desc" : "asc"
|
|
44
44
|
}));
|
|
45
|
-
},
|
|
46
|
-
if (!i.key) return
|
|
47
|
-
if (
|
|
48
|
-
const [e, o] =
|
|
49
|
-
(
|
|
45
|
+
}, G = (() => {
|
|
46
|
+
if (!i.key) return l;
|
|
47
|
+
if (p) {
|
|
48
|
+
const [e, o] = l.reduce(
|
|
49
|
+
(t, a) => (t[a.estadoRegistro === "en_gestion" ? 0 : 1].push(a), t),
|
|
50
50
|
[[], []]
|
|
51
51
|
);
|
|
52
|
-
return [...[...e].sort((
|
|
53
|
-
const s =
|
|
52
|
+
return [...[...e].sort((t, a) => {
|
|
53
|
+
const s = t[i.key], c = a[i.key];
|
|
54
54
|
return typeof s == "number" && typeof c == "number" ? i.direction === "asc" ? s - c : c - s : typeof s == "string" && typeof c == "string" ? i.direction === "asc" ? s.localeCompare(c) : c.localeCompare(s) : 0;
|
|
55
55
|
}), ...o];
|
|
56
56
|
}
|
|
57
|
-
return [...
|
|
58
|
-
const
|
|
59
|
-
return typeof
|
|
57
|
+
return [...l].sort((e, o) => {
|
|
58
|
+
const n = e[i.key], t = o[i.key];
|
|
59
|
+
return typeof n == "number" && typeof t == "number" ? i.direction === "asc" ? n - t : t - n : typeof n == "string" && typeof t == "string" ? i.direction === "asc" ? n.localeCompare(t) : t.localeCompare(n) : 0;
|
|
60
60
|
});
|
|
61
|
-
})(),
|
|
62
|
-
return /* @__PURE__ */ r("div", { className: "table_container", children: /* @__PURE__ */ r("div", { className: "table-scroll", onScroll:
|
|
61
|
+
})(), g = i.direction === "asc" || i.direction === "desc" ? G : l;
|
|
62
|
+
return /* @__PURE__ */ r("div", { className: "table_container", children: /* @__PURE__ */ r("div", { className: "table-scroll", onScroll: _, children: /* @__PURE__ */ d(M, { striped: !0, hover: !0, children: [
|
|
63
63
|
/* @__PURE__ */ d("thead", { children: [
|
|
64
|
-
/* @__PURE__ */ r("tr", { children:
|
|
64
|
+
/* @__PURE__ */ r("tr", { children: f.map((e, o) => /* @__PURE__ */ d(
|
|
65
65
|
"th",
|
|
66
66
|
{
|
|
67
67
|
className: "table-header-unp",
|
|
68
|
-
onClick: () => (e.sorter || C) &&
|
|
69
|
-
style: { cursor:
|
|
68
|
+
onClick: () => (e.sorter || C) && R(e.key),
|
|
69
|
+
style: { cursor: u ? "pointer" : "default" },
|
|
70
70
|
children: [
|
|
71
71
|
e.label,
|
|
72
72
|
" ",
|
|
73
|
-
e.sorter || C ? i.key === e.key ? i.direction === "asc" ? /* @__PURE__ */ r(
|
|
73
|
+
e.sorter || C ? i.key === e.key ? i.direction === "asc" ? /* @__PURE__ */ r(A, {}) : /* @__PURE__ */ r(E, {}) : /* @__PURE__ */ r(z, {}) : null
|
|
74
74
|
]
|
|
75
75
|
},
|
|
76
76
|
o
|
|
77
77
|
)) }),
|
|
78
|
-
|
|
78
|
+
u && /* @__PURE__ */ r("tr", { children: f.map((e, o) => /* @__PURE__ */ r("th", { children: /* @__PURE__ */ d(O, { className: "mx-1 position-relative", children: [
|
|
79
79
|
/* @__PURE__ */ r(
|
|
80
|
-
|
|
80
|
+
U,
|
|
81
81
|
{
|
|
82
82
|
type: "text",
|
|
83
83
|
placeholder: `Buscar ${e.label}`,
|
|
84
|
-
value:
|
|
85
|
-
onChange: (
|
|
86
|
-
className: "
|
|
84
|
+
value: k[e.key] || "",
|
|
85
|
+
onChange: (n) => b(e.key, n.target.value),
|
|
86
|
+
className: "search-column-input"
|
|
87
87
|
}
|
|
88
88
|
),
|
|
89
|
-
|
|
90
|
-
|
|
89
|
+
k[e.key] && /* @__PURE__ */ r(
|
|
90
|
+
V,
|
|
91
91
|
{
|
|
92
92
|
variant: "link",
|
|
93
93
|
size: "sm",
|
|
@@ -100,59 +100,62 @@ import '../../../assets/Tabla.css';const L = ({
|
|
|
100
100
|
] }) }, o)) })
|
|
101
101
|
] }),
|
|
102
102
|
/* @__PURE__ */ d("tbody", { children: [
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
{
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
103
|
+
g.slice(0, x).map((e, o) => {
|
|
104
|
+
let n = !1;
|
|
105
|
+
return p ? e.estadoRegistro === "en_gestion" ? n = !0 : e.estadoRegistro === "por_gestionar" && F.i < 5 && (n = !0, F.i++) : n = !0, /* @__PURE__ */ d(H.Fragment, { children: [
|
|
106
|
+
/* @__PURE__ */ r("tr", { children: f.map((t, a) => /* @__PURE__ */ r(
|
|
107
|
+
"td",
|
|
108
|
+
{
|
|
109
|
+
onClick: () => n ? T(t, e) : {},
|
|
110
|
+
style: {
|
|
111
|
+
cursor: (t.hasModal || t.redirectTo) && n ? "pointer" : "default"
|
|
112
|
+
},
|
|
113
|
+
className: n ? t.redirectTo ? "cell-redirect" : t.hasModal ? "cell-with-modal" : "" : "",
|
|
114
|
+
children: t.key === "diasHabiles" ? /* @__PURE__ */ r(
|
|
115
|
+
"div",
|
|
116
|
+
{
|
|
117
|
+
style: {
|
|
118
|
+
display: "flex",
|
|
119
|
+
justifyContent: "center"
|
|
120
|
+
},
|
|
121
|
+
children: /* @__PURE__ */ r(
|
|
122
|
+
"div",
|
|
123
|
+
{
|
|
124
|
+
style: {
|
|
125
|
+
padding: "8px",
|
|
126
|
+
borderRadius: "100px",
|
|
127
|
+
width: "40px",
|
|
128
|
+
backgroundColor: m(
|
|
129
|
+
e.diasHabiles
|
|
130
|
+
).backgroundColor,
|
|
131
|
+
color: m(
|
|
132
|
+
e.diasHabiles
|
|
133
|
+
).color
|
|
134
|
+
},
|
|
135
|
+
children: /* @__PURE__ */ r("span", { children: e.diasHabiles })
|
|
136
|
+
}
|
|
137
|
+
)
|
|
138
|
+
}
|
|
139
|
+
) : t.renderComponent ? t.renderComponent(e) : /* @__PURE__ */ r("div", { children: t.truncateText && (typeof e[t.key] == "string" || e[t.key] instanceof String) && e[t.key].length > 26 ? e[t.key].slice(0, 26) + "..." : e[t.key] })
|
|
110
140
|
},
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
backgroundColor: F(
|
|
127
|
-
e.diasHabiles
|
|
128
|
-
).backgroundColor,
|
|
129
|
-
color: F(
|
|
130
|
-
e.diasHabiles
|
|
131
|
-
).color
|
|
132
|
-
},
|
|
133
|
-
children: /* @__PURE__ */ r("span", { children: e.diasHabiles })
|
|
134
|
-
}
|
|
135
|
-
)
|
|
136
|
-
}
|
|
137
|
-
) : t.renderComponent ? t.renderComponent(e) : /* @__PURE__ */ r("div", { children: t.truncateText && (typeof e[t.key] == "string" || e[t.key] instanceof String) && e[t.key].length > 26 ? e[t.key].slice(0, 26) + "..." : e[t.key] })
|
|
138
|
-
},
|
|
139
|
-
n
|
|
140
|
-
)) }),
|
|
141
|
-
y && e.estadoRegistro === "en_gestion" && !f.some((t) => t.estadoRegistro === "en_gestion" && f.indexOf(t) > o) && /* @__PURE__ */ r("tr", { children: /* @__PURE__ */ r("td", { colSpan: p.length, className: "text-center", style: { padding: "0 0 0 0" }, children: /* @__PURE__ */ r("div", { style: {
|
|
142
|
-
height: "2rem",
|
|
143
|
-
display: "flex",
|
|
144
|
-
flexDirection: "row",
|
|
145
|
-
justifyContent: "center",
|
|
146
|
-
alignItems: "center",
|
|
147
|
-
fontWeight: "600",
|
|
148
|
-
color: o % 2 === 0 ? "#365072" : "#303D50",
|
|
149
|
-
backgroundColor: o % 2 === 0 ? "#fefefe" : "#f9fafa"
|
|
150
|
-
}, children: /* @__PURE__ */ r(A, { style: { fontSize: "1.3rem" } }) }) }) })
|
|
151
|
-
] }, o)),
|
|
152
|
-
h && /* @__PURE__ */ r("tr", { children: /* @__PURE__ */ r("td", { colSpan: p.length, className: "text-center", children: "Cargando más datos..." }) })
|
|
141
|
+
a
|
|
142
|
+
)) }),
|
|
143
|
+
p && e.estadoRegistro === "en_gestion" && !g.some((t) => t.estadoRegistro === "en_gestion" && g.indexOf(t) > o) && /* @__PURE__ */ r("tr", { children: /* @__PURE__ */ r("td", { colSpan: f.length, className: "text-center", style: { padding: "0 0 0 0" }, children: /* @__PURE__ */ r("div", { style: {
|
|
144
|
+
height: "2rem",
|
|
145
|
+
display: "flex",
|
|
146
|
+
flexDirection: "row",
|
|
147
|
+
justifyContent: "center",
|
|
148
|
+
alignItems: "center",
|
|
149
|
+
fontWeight: "600",
|
|
150
|
+
color: o % 2 === 0 ? "#365072" : "#303D50",
|
|
151
|
+
backgroundColor: o % 2 === 0 ? "#fefefe" : "#f9fafa"
|
|
152
|
+
}, children: /* @__PURE__ */ r(j, { style: { fontSize: "1.3rem" } }) }) }) })
|
|
153
|
+
] }, o);
|
|
154
|
+
}),
|
|
155
|
+
h && /* @__PURE__ */ r("tr", { children: /* @__PURE__ */ r("td", { colSpan: f.length, className: "text-center", children: "Cargando más datos..." }) })
|
|
153
156
|
] })
|
|
154
157
|
] }) }) });
|
|
155
158
|
};
|
|
156
159
|
export {
|
|
157
|
-
|
|
160
|
+
P as Tabla
|
|
158
161
|
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { AuthProvider as t } from "../../auth/contexts/AuthContex.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import "react-router-dom";
|
|
5
|
+
import "../../index-CuHybtft.js";
|
|
6
|
+
import '../../assets/EcoModalStyles.css';import '../../assets/Modal.css';import '../../assets/ContenedorVentana.css';import '../../assets/IconoTooltip.css';import '../../assets/ItemsModal.css';import '../../assets/Paginador.css';import '../../assets/ContenidoModal.css';import '../../assets/Encabezado.css';import '../../assets/SeccionTarjetaLectura.css';import '../../assets/Logo.css';import '../../assets/TarjetaLectura.css';import '../../assets/ContenedorTarjeta.css';import '../../assets/Bootstrap.css';import '../../assets/Tarjeta.css';import '../../assets/UnpHistorico.css';/* empty css */
|
|
7
|
+
/* empty css */
|
|
8
|
+
/* empty css */
|
|
9
|
+
import "../../cards/tarjeta/seccion-tarjeta/SeccionTarjeta.js";
|
|
10
|
+
/* empty css */
|
|
11
|
+
/* empty css */
|
|
12
|
+
/* empty css */
|
|
13
|
+
/* empty css */
|
|
14
|
+
/* empty css */
|
|
15
|
+
/* empty css */
|
|
16
|
+
import "../../ui/subtitulo/Subtitulo.js";
|
|
17
|
+
/* empty css */
|
|
18
|
+
/* empty css */
|
|
19
|
+
/* empty css */
|
|
20
|
+
/* empty css */
|
|
21
|
+
/* empty css */
|
|
22
|
+
/* empty css */
|
|
23
|
+
import "../../index-BrykDZgK.js";
|
|
24
|
+
/* empty css */
|
|
25
|
+
import "../../Animacion-ThNL9iiY.js";
|
|
26
|
+
import "../../index-BUe3EJDH.js";
|
|
27
|
+
import { WebSocketProvider as i } from "../websocket-manager/WebSocketContext.js";
|
|
28
|
+
const B = ({ children: o }) => /* @__PURE__ */ r(t, { children: /* @__PURE__ */ r(i, { children: o }) });
|
|
29
|
+
export {
|
|
30
|
+
B as EcoProvider
|
|
31
|
+
};
|
package/dist/utils.js
CHANGED
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { EcoProvider as r } from "./utils/eco-provider/EcoContext.js";
|
|
2
|
+
import { AuthProvider as m } from "./auth/contexts/AuthContex.js";
|
|
3
|
+
import { ProtectedRoute as c } from "./utils/components/ProtectedRoute.js";
|
|
4
|
+
import { UserRoute as i } from "./utils/components/UserRoute.js";
|
|
5
|
+
import { UnpHistorico as x } from "./utils/unp-historico/UnpHistorico.js";
|
|
6
|
+
import { IsInvalidStyles as u, useFormValidation as d } from "./utils/validations/useFormValidation.js";
|
|
7
|
+
import { CaptchaEcosistema as v } from "./utils/captcha/CaptchaEcosistema.js";
|
|
7
8
|
import { useFetchData as S } from "./utils/fetch-data/useFetchData.js";
|
|
8
9
|
import { WebSocketProvider as h, useWebSocketConnection as k } from "./utils/websocket-manager/WebSocketContext.js";
|
|
9
|
-
import { useWebSocket as
|
|
10
|
+
import { useWebSocket as W } from "./utils/websocket-manager/useWebSocket.js";
|
|
10
11
|
export {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
m as AuthProvider,
|
|
13
|
+
v as CaptchaEcosistema,
|
|
14
|
+
r as EcoProvider,
|
|
15
|
+
u as IsInvalidStyles,
|
|
16
|
+
c as ProtectedRoute,
|
|
17
|
+
x as UnpHistorico,
|
|
18
|
+
i as UserRoute,
|
|
17
19
|
h as WebSocketProvider,
|
|
18
20
|
S as useFetchData,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
d as useFormValidation,
|
|
22
|
+
W as useWebSocket,
|
|
21
23
|
k as useWebSocketConnection
|
|
22
24
|
};
|