react-ecosistema-unp 1.2.7 → 1.2.8

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,85 +1,85 @@
1
- import { jsx as e, jsxs as a } from "react/jsx-runtime";
1
+ import { jsx as t, jsxs as o } from "react/jsx-runtime";
2
2
  import C from "react";
3
- import { p as y } from "../../../index-CcQhl4DX.js";
4
- import { T as k } from "../../../Table-C5ydZooy.js";
3
+ import { p as m } from "../../../index-CcQhl4DX.js";
4
+ import { T as u } from "../../../Table-C5ydZooy.js";
5
5
  import '../../../assets/Tabla.css';const T = ({
6
6
  columns: n,
7
- filteredData: o,
7
+ filteredData: i,
8
8
  tableData: g,
9
- hasMoreData: c,
9
+ hasMoreData: d,
10
10
  setHasMoreData: p,
11
11
  visibleData: f,
12
12
  setVisibleData: b,
13
- handleCellClick: m,
14
- totalDias: d,
15
- isShared: u
13
+ handleCellClick: y,
14
+ totalDias: s,
15
+ isShared: k
16
16
  }) => {
17
- const s = (r) => {
18
- if (d) {
19
- const t = r / d * 100;
20
- return t <= 25 ? { backgroundColor: "#3AB34A", color: "#FFFFFF" } : t <= 50 ? { backgroundColor: "#F8EB10", color: "#000000" } : t <= 75 ? { backgroundColor: "#F79122", color: "#000000" } : { backgroundColor: "#E91720", color: "#FFFFFF" };
17
+ const c = (e) => {
18
+ if (s) {
19
+ const l = e / s * 100;
20
+ return l <= 25 ? { backgroundColor: "#3AB34A", color: "#FFFFFF" } : l <= 50 ? { backgroundColor: "#F8EB10", color: "#000000" } : l <= 75 ? { backgroundColor: "#F79122", color: "#000000" } : { backgroundColor: "#E91720", color: "#FFFFFF" };
21
21
  }
22
22
  return { backgroundColor: "transparent", color: "inherit" };
23
23
  };
24
- return /* @__PURE__ */ e("div", { className: "table_container", children: /* @__PURE__ */ e("div", { className: "table-scroll", onScroll: (r) => {
25
- const { scrollTop: t, clientHeight: l, scrollHeight: i } = r.currentTarget;
26
- i - t <= l + 50 && c && b((F) => {
24
+ return /* @__PURE__ */ t("div", { className: "table_container", children: /* @__PURE__ */ t("div", { className: "table-scroll", onScroll: (e) => {
25
+ const { scrollTop: l, clientHeight: r, scrollHeight: a } = e.currentTarget;
26
+ a - l <= r + 50 && d && b((F) => {
27
27
  const h = F + 5;
28
- return h >= o.length && p(!1), Math.min(h, o.length);
28
+ return h >= i.length && p(!1), Math.min(h, i.length);
29
29
  });
30
- }, children: /* @__PURE__ */ a(k, { striped: !0, hover: !0, children: [
31
- /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ e("tr", { children: n.map((r, t) => /* @__PURE__ */ e("th", { className: "table-header-unp", children: r.label }, t)) }) }),
32
- /* @__PURE__ */ a("tbody", { children: [
33
- g.slice(0, f).map((r, t) => /* @__PURE__ */ a(C.Fragment, { children: [
34
- /* @__PURE__ */ e("tr", { children: n.map((l, i) => /* @__PURE__ */ e(
30
+ }, children: /* @__PURE__ */ o(u, { striped: !0, hover: !0, children: [
31
+ /* @__PURE__ */ t("thead", { children: /* @__PURE__ */ t("tr", { children: n.map((e, l) => /* @__PURE__ */ t("th", { className: "table-header-unp", children: e.label }, l)) }) }),
32
+ /* @__PURE__ */ o("tbody", { children: [
33
+ g.slice(0, f).map((e, l) => /* @__PURE__ */ o(C.Fragment, { children: [
34
+ /* @__PURE__ */ t("tr", { children: n.map((r, a) => /* @__PURE__ */ t(
35
35
  "td",
36
36
  {
37
- onClick: () => m(l, r),
37
+ onClick: () => y(r, e),
38
38
  style: {
39
- cursor: l.hasModal ? "pointer" : "default"
39
+ cursor: r.hasModal ? "pointer" : "default"
40
40
  },
41
- className: l.hasModal ? "cell-with-modal" : "",
42
- children: l.key === "diasHabiles" ? /* @__PURE__ */ e(
41
+ className: r.hasModal ? "cell-with-modal" : "",
42
+ children: r.key === "diasHabiles" ? /* @__PURE__ */ t(
43
43
  "div",
44
44
  {
45
45
  style: {
46
46
  display: "flex",
47
47
  justifyContent: "center"
48
48
  },
49
- children: /* @__PURE__ */ e(
49
+ children: /* @__PURE__ */ t(
50
50
  "div",
51
51
  {
52
52
  style: {
53
53
  padding: "8px",
54
54
  borderRadius: "100px",
55
55
  width: "40px",
56
- backgroundColor: s(
57
- r.diasHabiles
56
+ backgroundColor: c(
57
+ e.diasHabiles
58
58
  ).backgroundColor,
59
- color: s(
60
- r.diasHabiles
59
+ color: c(
60
+ e.diasHabiles
61
61
  ).color
62
62
  },
63
- children: /* @__PURE__ */ e("span", { children: r.diasHabiles })
63
+ children: /* @__PURE__ */ t("span", { children: e.diasHabiles })
64
64
  }
65
65
  )
66
66
  }
67
- ) : l.renderComponent ? l.renderComponent(r) : r[l.key]
67
+ ) : r.renderComponent ? r.renderComponent(e) : /* @__PURE__ */ t("div", { children: (typeof e[r.key] == "string" || e[r.key] instanceof String) && e[r.key].length > 39 ? e[r.key].slice(0, 39) + "..." : e[r.key] })
68
68
  },
69
- i
69
+ a
70
70
  )) }),
71
- u && r.estadoRegistro === "en_gestion" && !o.some((l) => l.estadoRegistro === "en_gestion" && o.indexOf(l) > t) && /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: n.length, className: "text-center", style: { padding: "0 0 0 0" }, children: /* @__PURE__ */ e("div", { style: {
71
+ k && e.estadoRegistro === "en_gestion" && !i.some((r) => r.estadoRegistro === "en_gestion" && i.indexOf(r) > l) && /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", { colSpan: n.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: t % 2 === 0 ? "#365072" : "#303D50",
79
- backgroundColor: t % 2 === 0 ? "#fefefe" : "#f9fafa"
80
- }, children: /* @__PURE__ */ e(y, { style: { fontSize: "1.3rem" } }) }) }) })
81
- ] }, t)),
82
- c && /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: n.length, className: "text-center", children: "Cargando más datos..." }) })
78
+ color: l % 2 === 0 ? "#365072" : "#303D50",
79
+ backgroundColor: l % 2 === 0 ? "#fefefe" : "#f9fafa"
80
+ }, children: /* @__PURE__ */ t(m, { style: { fontSize: "1.3rem" } }) }) }) })
81
+ ] }, l)),
82
+ d && /* @__PURE__ */ t("tr", { children: /* @__PURE__ */ t("td", { colSpan: n.length, className: "text-center", children: "Cargando más datos..." }) })
83
83
  ] })
84
84
  ] }) }) });
85
85
  };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "react-ecosistema-unp",
3
3
  "author": "Ecosistema de Información - Unidad Nacional de Protección",
4
4
  "private": false,
5
- "version": "1.2.7",
5
+ "version": "1.2.8",
6
6
  "type": "module",
7
7
  "exports": {
8
8
  ".": {