react-ecosistema-unp 1.2.9 → 1.2.10
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.
|
@@ -2,8 +2,8 @@ import { jsx as t, jsxs as o } from "react/jsx-runtime";
|
|
|
2
2
|
import C from "react";
|
|
3
3
|
import { p as m } from "../../../index-CcQhl4DX.js";
|
|
4
4
|
import { T as u } from "../../../Table-C5ydZooy.js";
|
|
5
|
-
import '../../../assets/Tabla.css';const
|
|
6
|
-
columns:
|
|
5
|
+
import '../../../assets/Tabla.css';const N = ({
|
|
6
|
+
columns: l,
|
|
7
7
|
filteredData: i,
|
|
8
8
|
tableData: g,
|
|
9
9
|
hasMoreData: d,
|
|
@@ -16,22 +16,22 @@ import '../../../assets/Tabla.css';const T = ({
|
|
|
16
16
|
}) => {
|
|
17
17
|
const c = (e) => {
|
|
18
18
|
if (s) {
|
|
19
|
-
const
|
|
20
|
-
return
|
|
19
|
+
const n = e / s * 100;
|
|
20
|
+
return n <= 25 ? { backgroundColor: "#3AB34A", color: "#FFFFFF" } : n <= 50 ? { backgroundColor: "#F8EB10", color: "#000000" } : n <= 75 ? { backgroundColor: "#F79122", color: "#000000" } : { backgroundColor: "#E91720", color: "#FFFFFF" };
|
|
21
21
|
}
|
|
22
22
|
return { backgroundColor: "transparent", color: "inherit" };
|
|
23
23
|
};
|
|
24
24
|
return /* @__PURE__ */ t("div", { className: "table_container", children: /* @__PURE__ */ t("div", { className: "table-scroll", onScroll: (e) => {
|
|
25
|
-
const { scrollTop:
|
|
26
|
-
a -
|
|
25
|
+
const { scrollTop: n, clientHeight: r, scrollHeight: a } = e.currentTarget;
|
|
26
|
+
a - n <= r + 50 && d && b((F) => {
|
|
27
27
|
const h = F + 5;
|
|
28
28
|
return h >= i.length && p(!1), Math.min(h, i.length);
|
|
29
29
|
});
|
|
30
30
|
}, children: /* @__PURE__ */ o(u, { striped: !0, hover: !0, children: [
|
|
31
|
-
/* @__PURE__ */ t("thead", { children: /* @__PURE__ */ t("tr", { children:
|
|
31
|
+
/* @__PURE__ */ t("thead", { children: /* @__PURE__ */ t("tr", { children: l.map((e, n) => /* @__PURE__ */ t("th", { className: "table-header-unp", children: e.label }, n)) }) }),
|
|
32
32
|
/* @__PURE__ */ o("tbody", { children: [
|
|
33
|
-
g.slice(0, f).map((e,
|
|
34
|
-
/* @__PURE__ */ t("tr", { children:
|
|
33
|
+
g.slice(0, f).map((e, n) => /* @__PURE__ */ o(C.Fragment, { children: [
|
|
34
|
+
/* @__PURE__ */ t("tr", { children: l.map((r, a) => /* @__PURE__ */ t(
|
|
35
35
|
"td",
|
|
36
36
|
{
|
|
37
37
|
onClick: () => y(r, e),
|
|
@@ -64,25 +64,25 @@ import '../../../assets/Tabla.css';const T = ({
|
|
|
64
64
|
}
|
|
65
65
|
)
|
|
66
66
|
}
|
|
67
|
-
) : r.renderComponent ? r.renderComponent(e) : /* @__PURE__ */ t("div", { children: (typeof e[r.key] == "string" || e[r.key] instanceof String) && e[r.key].length >
|
|
67
|
+
) : r.renderComponent ? r.renderComponent(e) : /* @__PURE__ */ t("div", { children: r.truncateText && (typeof e[r.key] == "string" || e[r.key] instanceof String) && e[r.key].length > 26 ? e[r.key].slice(0, 26) + "..." : e[r.key] })
|
|
68
68
|
},
|
|
69
69
|
a
|
|
70
70
|
)) }),
|
|
71
|
-
k && e.estadoRegistro === "en_gestion" && !i.some((r) => r.estadoRegistro === "en_gestion" && i.indexOf(r) >
|
|
71
|
+
k && e.estadoRegistro === "en_gestion" && !i.some((r) => r.estadoRegistro === "en_gestion" && i.indexOf(r) > n) && /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", { colSpan: l.length, className: "text-center", style: { padding: "0 0 0 0" }, children: /* @__PURE__ */ t("div", { style: {
|
|
72
72
|
height: "2rem",
|
|
73
73
|
display: "flex",
|
|
74
74
|
flexDirection: "row",
|
|
75
75
|
justifyContent: "center",
|
|
76
76
|
alignItems: "center",
|
|
77
77
|
fontWeight: "600",
|
|
78
|
-
color:
|
|
79
|
-
backgroundColor:
|
|
78
|
+
color: n % 2 === 0 ? "#365072" : "#303D50",
|
|
79
|
+
backgroundColor: n % 2 === 0 ? "#fefefe" : "#f9fafa"
|
|
80
80
|
}, children: /* @__PURE__ */ t(m, { style: { fontSize: "1.3rem" } }) }) }) })
|
|
81
|
-
] },
|
|
82
|
-
d && /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", { colSpan:
|
|
81
|
+
] }, n)),
|
|
82
|
+
d && /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", { colSpan: l.length, className: "text-center", children: "Cargando más datos..." }) })
|
|
83
83
|
] })
|
|
84
84
|
] }) }) });
|
|
85
85
|
};
|
|
86
86
|
export {
|
|
87
|
-
|
|
87
|
+
N as Tabla
|
|
88
88
|
};
|