react-ecosistema-unp 1.5.9 → 1.5.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.
@@ -1,2 +1,2 @@
1
- declare function fetchHistorico(endpoint: string, nuip: string): Promise<any>;
1
+ declare function fetchHistorico(endpoint: string, nuip: string, setIsLoading: React.Dispatch<React.SetStateAction<boolean>>): Promise<any>;
2
2
  export { fetchHistorico };
@@ -1,8 +1,9 @@
1
1
  import { jsxs as i, jsx as e } from "react/jsx-runtime";
2
- import { Logo as r } from "../logo/Logo.js";
3
- import '../../assets/Encabezado.css';const c = ({
2
+ import { Logo as n } from "../logo/Logo.js";
3
+ import '../../assets/Encabezado.css';/* empty css */
4
+ const l = ({
4
5
  title: t = "",
5
- subtitle: n = "",
6
+ subtitle: r = "",
6
7
  hasMargin: a = !0
7
8
  }) => /* @__PURE__ */ i(
8
9
  "div",
@@ -15,15 +16,15 @@ import '../../assets/Encabezado.css';const c = ({
15
16
  children: [
16
17
  /* @__PURE__ */ i("div", { className: "logo-subtitle-container", children: [
17
18
  /* @__PURE__ */ e("div", { className: "red-section" }),
18
- /* @__PURE__ */ e(r, { type: "entidad", variant: "unp", color: "gris", height: "62" })
19
+ /* @__PURE__ */ e(n, { type: "entidad", variant: "unp", color: "gris", height: "62" })
19
20
  ] }),
20
21
  /* @__PURE__ */ i("div", { className: "subtitle-container", children: [
21
22
  /* @__PURE__ */ e("span", { className: "title", children: t || "Unidad Nacional de Protección" }),
22
- /* @__PURE__ */ e("span", { className: "subtitle", children: n })
23
+ /* @__PURE__ */ e("span", { className: "subtitle", children: r })
23
24
  ] })
24
25
  ]
25
26
  }
26
27
  );
27
28
  export {
28
- c as Encabezado
29
+ l as Encabezado
29
30
  };
@@ -1,12 +1,13 @@
1
- async function c(e, o) {
2
- const n = e + "consulta-cedula/" + o;
1
+ async function o(t, c, r) {
2
+ r(!0);
3
+ const n = t + "consulta-cedula/" + c;
3
4
  try {
4
- const t = await (await fetch(n)).json();
5
- return t || [];
6
- } catch (r) {
7
- return console.error("Error fetching data:", r), [];
5
+ const e = await (await fetch(n)).json();
6
+ return e ? (r(!1), e) : (r(!1), []);
7
+ } catch {
8
+ return r(!1), [];
8
9
  }
9
10
  }
10
11
  export {
11
- c as fetchHistorico
12
+ o as fetchHistorico
12
13
  };
@@ -1,32 +1,42 @@
1
- import { jsx as t, Fragment as i, jsxs as a } from "react/jsx-runtime";
2
- import { useState as o, useEffect as x } from "react";
3
- 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 */
1
+ import { jsx as t, Fragment as s, jsxs as a } from "react/jsx-runtime";
2
+ import { useState as l, useEffect as N } from "react";
3
+ 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 */
4
4
  /* empty css */
5
5
  import "../../cards/tarjeta/seccion-tarjeta/SeccionTarjeta.js";
6
6
  /* empty css */
7
7
  /* empty css */
8
8
  /* empty css */
9
9
  /* empty css */
10
- import { TarjetaInfo as N } from "../../cards/tarjeta-info/TarjetaInfo.js";
11
- import { F as b } from "../../index-CgSyrJ_X.js";
12
- import { fetchHistorico as p } from "./FetchHistorico.js";
13
- import { T as u } from "../../Table-C5ydZooy.js";
14
- const D = ({ endpoint: n, nuip: d }) => {
15
- const [c, h] = o({
10
+ import { TarjetaInfo as b } from "../../cards/tarjeta-info/TarjetaInfo.js";
11
+ import { F as u } from "../../index-CgSyrJ_X.js";
12
+ import { fetchHistorico as f } from "./FetchHistorico.js";
13
+ /* empty css */
14
+ import "../../ui/subtitulo/Subtitulo.js";
15
+ /* empty css */
16
+ /* empty css */
17
+ import "react-router-dom";
18
+ /* empty css */
19
+ /* empty css */
20
+ /* empty css */
21
+ /* empty css */
22
+ import { Animacion as v } from "../../ui/animacion/Animacion.js";
23
+ import { T as g } from "../../Table-C5ydZooy.js";
24
+ const B = ({ endpoint: h, nuip: r }) => {
25
+ const [c, m] = l({
16
26
  sintesisHechos1: !1,
17
27
  sintesisHehcos2: !1
18
- }), [r, m] = o([]), l = (e) => {
19
- h((s) => ({
20
- ...s,
21
- [e]: !s[e]
28
+ }), [d, p] = l([]), [o, x] = l(!1), n = (e) => {
29
+ m((i) => ({
30
+ ...i,
31
+ [e]: !i[e]
22
32
  }));
23
33
  };
24
- return x(() => {
34
+ return N(() => {
25
35
  (async () => {
26
- const s = await p(n, d);
27
- m(s);
36
+ const i = await f(h, r, x);
37
+ p(i);
28
38
  })();
29
- }, [d]), /* @__PURE__ */ t(i, { children: r && r.length > 0 ? /* @__PURE__ */ t(i, { children: r.sort((e, s) => e.ordenTrabajo < s.ordenTrabajo ? 1 : -1).map((e, s) => /* @__PURE__ */ t(N, { icon: b, label: `OT ${e.ordenTrabajo} • ${e.tipoEstudio}`, children: /* @__PURE__ */ t(u, { striped: !0, bordered: !0, children: /* @__PURE__ */ a("tbody", { children: [
39
+ }, [r]), /* @__PURE__ */ t(s, { children: d && d.length > 0 && !o ? /* @__PURE__ */ t(s, { children: d.sort((e, i) => e.ordenTrabajo < i.ordenTrabajo ? 1 : -1).map((e, i) => /* @__PURE__ */ t(b, { icon: u, label: `OT ${e.ordenTrabajo} • ${e.tipoEstudio}`, children: /* @__PURE__ */ t(g, { striped: !0, bordered: !0, children: /* @__PURE__ */ a("tbody", { children: [
30
40
  /* @__PURE__ */ a("tr", { children: [
31
41
  /* @__PURE__ */ t("td", { className: "text-start", children: /* @__PURE__ */ t("b", { children: "Evaluado" }) }),
32
42
  /* @__PURE__ */ t("td", { className: "text-start", children: e.nombreCompleto && e.nombreCompleto })
@@ -94,16 +104,16 @@ const D = ({ endpoint: n, nuip: d }) => {
94
104
  ] }),
95
105
  /* @__PURE__ */ a("tr", { children: [
96
106
  /* @__PURE__ */ t("td", { className: "text-start", children: /* @__PURE__ */ t("b", { children: "Síntesis de hechos #1" }) }),
97
- /* @__PURE__ */ t("td", { className: "text-start", children: e.sintesisHechos1 && /* @__PURE__ */ a(i, { children: [
107
+ /* @__PURE__ */ t("td", { className: "text-start", children: e.sintesisHechos1 && /* @__PURE__ */ a(s, { children: [
98
108
  c.sintesisHechos1 ? e.sintesisHechos1 + " " : e.sintesisHechos1.slice(0, 250) + "... ",
99
- /* @__PURE__ */ t("a", { className: "link-primary", onClick: () => l("sintesisHechos1"), children: c.sintesisHechos1 ? "Ver menos" : "Ver más" })
109
+ /* @__PURE__ */ t("a", { className: "link-primary", onClick: () => n("sintesisHechos1"), children: c.sintesisHechos1 ? "Ver menos" : "Ver más" })
100
110
  ] }) })
101
111
  ] }),
102
112
  /* @__PURE__ */ a("tr", { children: [
103
113
  /* @__PURE__ */ t("td", { className: "text-start", children: /* @__PURE__ */ t("b", { children: "Síntesos de hechos #2" }) }),
104
- /* @__PURE__ */ t("td", { className: "text-start", children: e.sintesisHechos2 && /* @__PURE__ */ a(i, { children: [
114
+ /* @__PURE__ */ t("td", { className: "text-start", children: e.sintesisHechos2 && /* @__PURE__ */ a(s, { children: [
105
115
  c.sintesisHechos2 ? e.sintesisHechos2 + " " : e.sintesisHechos2.slice(0, 250) + "... ",
106
- /* @__PURE__ */ t("a", { className: "link-primary", onClick: () => l("sintesisHechos2"), children: c.sintesisHechos2 ? "Ver menos" : "Ver más" })
116
+ /* @__PURE__ */ t("a", { className: "link-primary", onClick: () => n("sintesisHechos2"), children: c.sintesisHechos2 ? "Ver menos" : "Ver más" })
107
117
  ] }) })
108
118
  ] }),
109
119
  /* @__PURE__ */ a("tr", { children: [
@@ -138,8 +148,12 @@ const D = ({ endpoint: n, nuip: d }) => {
138
148
  /* @__PURE__ */ t("td", { className: "text-start", children: /* @__PURE__ */ t("b", { children: "Tipo de anulación" }) }),
139
149
  /* @__PURE__ */ t("td", { className: "text-start", children: e.tipoAnulacion && e.tipoAnulacion })
140
150
  ] })
141
- ] }) }) }, s)) }) : /* @__PURE__ */ t(i, { children: "No hay información disponible." }) });
151
+ ] }) }) }, i)) }) : o ? /* @__PURE__ */ t(v, { type: "loading_parrot", width: 200 }) : /* @__PURE__ */ a(s, { children: [
152
+ "No hay información disponible para la identificación ",
153
+ r,
154
+ "."
155
+ ] }) });
142
156
  };
143
157
  export {
144
- D as UnpHistorico
158
+ B as UnpHistorico
145
159
  };
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.5.9",
5
+ "version": "1.5.10",
6
6
  "type": "module",
7
7
  "exports": {
8
8
  ".": {