react-ecosistema-unp 1.9.1-pre.2 → 1.9.2

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,28 +1,28 @@
1
- import { FinSesionService as r } from "../services/FinSesionService.js";
2
- import { y as t } from "../../index-Cs6Q8pv4.js";
3
- import { useState as l, useEffect as c } from "react";
4
- const d = () => {
5
- const [o, a] = l(null), s = `${window.location.protocol}//${window.location.host}/`;
6
- return c(() => {
7
- const e = localStorage.getItem("auth_state");
8
- if (e) {
9
- const n = JSON.parse(e);
10
- a(n);
1
+ import { FinSesionService as a } from "../services/FinSesionService.js";
2
+ import { y as e } from "../../index-Cs6Q8pv4.js";
3
+ import { useState as c, useEffect as l } from "react";
4
+ const w = () => {
5
+ const [t, i] = c(null), n = `${window.location.protocol}//${window.location.host}/`;
6
+ return l(() => {
7
+ const o = localStorage.getItem("auth_state");
8
+ if (o) {
9
+ const s = JSON.parse(o);
10
+ i(s);
11
11
  }
12
12
  }, []), { FinSesion: () => {
13
- t.info("Finalizando sesión..."), new Promise(async (e, n) => {
13
+ e.info("Finalizando sesión..."), new Promise(async (o, s) => {
14
14
  try {
15
- console.log("Intentando finalizar sesión..."), await r((o == null ? void 0 : o.user.username) || "", s), t.success("Sesión finalizada con éxito"), e(!0);
16
- } catch (i) {
17
- console.error("Error al finalizar sesión:", i), t.warning("Sesión finalizada localmente"), n(i);
15
+ await a((t == null ? void 0 : t.user.username) || "", n), e.dismiss(), e.success("Sesión finalizada con éxito"), o(!0);
16
+ } catch (r) {
17
+ e.dismiss(), e.warning("Sesión finalizada"), s(r);
18
18
  } finally {
19
- console.log("Finalizando sesión y limpiando tokens..."), sessionStorage.removeItem("user_token"), localStorage.removeItem("auth_state"), localStorage.removeItem("access_token"), localStorage.removeItem("refresh_token"), setTimeout(() => {
20
- window.location.href = s;
19
+ sessionStorage.removeItem("user_token"), localStorage.removeItem("auth_state"), localStorage.removeItem("access_token"), localStorage.removeItem("refresh_token"), setTimeout(() => {
20
+ window.location.href = n;
21
21
  }, 1e3);
22
22
  }
23
23
  });
24
24
  } };
25
25
  };
26
26
  export {
27
- d as useFinalizarSesion
27
+ w as useFinalizarSesion
28
28
  };
@@ -1,7 +1,11 @@
1
1
  import { default as React } from 'react';
2
2
  interface UnpHistoricoProps {
3
- endpoint: string;
3
+ /**
4
+ * @deprecated Will be removed in version 2.0.
5
+ */
6
+ endpoint?: string;
4
7
  nuip: string;
8
+ showMessage?: boolean;
5
9
  }
6
10
  declare const UnpHistorico: React.FC<UnpHistoricoProps>;
7
11
  export { UnpHistorico };
@@ -1,5 +1,5 @@
1
1
  import { jsx as t, Fragment as s, jsxs as a } from "react/jsx-runtime";
2
- import { useState as l, useEffect as x } from "react";
2
+ import { useState as l, useEffect as N } from "react";
3
3
  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 */
4
4
  /* empty css */
5
5
  /* empty css */
@@ -8,9 +8,9 @@ import "../../cards/tarjeta/seccion-tarjeta/SeccionTarjeta.js";
8
8
  /* empty css */
9
9
  /* empty css */
10
10
  /* empty css */
11
- import { TarjetaInfo as N } from "../../cards/tarjeta-info/TarjetaInfo.js";
12
- import { F as b } from "../../index-D3WseyJh.js";
13
- import { fetchHistorico as u } from "./FetchHistorico.js";
11
+ import { TarjetaInfo as b } from "../../cards/tarjeta-info/TarjetaInfo.js";
12
+ import { F as u } from "../../index-D3WseyJh.js";
13
+ import { fetchHistorico as f } from "./FetchHistorico.js";
14
14
  /* empty css */
15
15
  import "../../ui/subtitulo/Subtitulo.js";
16
16
  /* empty css */
@@ -22,24 +22,24 @@ import "react-router-dom";
22
22
  /* empty css */
23
23
  import "../../index-BrykDZgK.js";
24
24
  /* empty css */
25
- import { Animacion as f } from "../../ui/animacion/Animacion.js";
26
- import { T as v } from "../../Table-C5ydZooy.js";
27
- const J = ({ nuip: r }) => {
28
- const [c, h] = l({
25
+ import { Animacion as v } from "../../ui/animacion/Animacion.js";
26
+ import { T as g } from "../../Table-C5ydZooy.js";
27
+ const K = ({ nuip: r, showMessage: h = !0 }) => {
28
+ const [c, m] = l({
29
29
  sintesisHechos1: !1,
30
30
  sintesisHehcos2: !1
31
- }), [d, m] = l([]), [o, p] = l(!1), n = (e) => {
32
- h((i) => ({
31
+ }), [d, p] = l([]), [o, x] = l(!1), n = (e) => {
32
+ m((i) => ({
33
33
  ...i,
34
34
  [e]: !i[e]
35
35
  }));
36
36
  };
37
- return x(() => {
37
+ return N(() => {
38
38
  (async () => {
39
- const i = await u(r, p);
40
- m(i);
39
+ const i = await f(r, x);
40
+ p(i);
41
41
  })();
42
- }, [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(N, { icon: b, label: `OT ${e.ordenTrabajo} • ${e.tipoEstudio}`, children: /* @__PURE__ */ t(v, { striped: !0, bordered: !0, children: /* @__PURE__ */ a("tbody", { children: [
42
+ }, [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: [
43
43
  /* @__PURE__ */ a("tr", { children: [
44
44
  /* @__PURE__ */ t("td", { className: "text-start", children: /* @__PURE__ */ t("b", { children: "Evaluado" }) }),
45
45
  /* @__PURE__ */ t("td", { className: "text-start", children: e.nombreCompleto && e.nombreCompleto })
@@ -151,12 +151,12 @@ const J = ({ nuip: r }) => {
151
151
  /* @__PURE__ */ t("td", { className: "text-start", children: /* @__PURE__ */ t("b", { children: "Tipo de anulación" }) }),
152
152
  /* @__PURE__ */ t("td", { className: "text-start", children: e.tipoAnulacion && e.tipoAnulacion })
153
153
  ] })
154
- ] }) }) }, i)) }) : o ? /* @__PURE__ */ t(f, { type: "loading_parrot", width: 200 }) : /* @__PURE__ */ a(s, { children: [
154
+ ] }) }) }, i)) }) : o ? /* @__PURE__ */ t(v, { type: "loading_parrot", width: 200 }) : h && /* @__PURE__ */ a(s, { children: [
155
155
  "No hay información disponible para la identificación ",
156
156
  r,
157
157
  "."
158
158
  ] }) });
159
159
  };
160
160
  export {
161
- J as UnpHistorico
161
+ K as UnpHistorico
162
162
  };
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.9.1-pre.2",
5
+ "version": "1.9.2",
6
6
  "type": "module",
7
7
  "exports": {
8
8
  ".": {