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.
@@ -1,11 +1,11 @@
1
1
  import { jsx as s, jsxs as d } from "react/jsx-runtime";
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 = ({
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, U] = m({
31
+ const [l, V] = m({
31
32
  key: null,
32
33
  direction: null
33
- }), [c, V] = m([]), [y, _] = m(null), [k, B] = m(null);
34
- S(() => {
34
+ }), [c, W] = m([]), [y, _] = m(null), [k, B] = m(null);
35
+ X(() => {
35
36
  C == null || C(c);
36
37
  }, [c]);
37
- const W = (e, o) => {
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, 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]);
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
- V(a);
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
- }, $ = (e) => {
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
- }, q = (e) => {
66
- U((o) => ({
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: $, children: /* @__PURE__ */ d(re, { striped: !0, hover: !0, children: [
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) && q(e.key),
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(Z, {}) : /* @__PURE__ */ s(w, {}) : /* @__PURE__ */ s(ee, {}) : null
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(se, { className: "mx-1 position-relative", children: [
109
+ u.map((e, o) => /* @__PURE__ */ s("th", { children: /* @__PURE__ */ d(oe, { className: "mx-1 position-relative", children: [
109
110
  /* @__PURE__ */ s(
110
- oe,
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
- ie,
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(Q.Fragment, { children: [
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 || W(e.numeroRegistro);
157
+ t.stopPropagation(), i || $(e.numeroRegistro);
157
158
  },
158
- children: n ? /* @__PURE__ */ s(te, { size: 18, style: { color: "#505050ff" } }) : /* @__PURE__ */ s(X, { size: 18, style: { color: "#505050ff" } })
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(Y, { style: { fontSize: "1.3rem" } }) }) }) })
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
- ge as Tabla
221
+ ue as Tabla
220
222
  };
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.7.19",
5
+ "version": "1.7.21",
6
6
  "type": "module",
7
7
  "exports": {
8
8
  ".": {