react-ecosistema-unp 0.9.14 → 0.9.16-pre-release
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.
- package/dist/{TabPane-Q7bzCwAs.js → TabPane-BvUHIFlv.js} +45 -46
- package/dist/auth/hooks/useFinalizarSesion.js +7 -7
- package/dist/lib/utils/components/ProtectedRoute.d.ts +1 -4
- package/dist/lib/utils/components/UserRoute.d.ts +1 -4
- package/dist/shared/menu-lateral/MenuLateral.js +7 -7
- package/dist/shared/tab-ventana/TabVentana.js +1 -1
- package/dist/shared/ventana-lienzo/VentanaLienzo.js +13 -14
- package/dist/shared/ventana-tabs/VentanaTabs.js +67 -68
- package/dist/tables/tabla-registros/encabezado-tabla/EncabezadoTabla.js +3 -2
- package/dist/ui/items-modal/ItemsModal.js +6 -6
- package/dist/utils/components/ProtectedRoute.js +16 -14
- package/dist/utils/components/UserRoute.js +5 -5
- package/package.json +3 -3
- package/dist/chunk-IR6S3I6Y-DDsyyqUQ.js +0 -1615
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import { useLocation as d, Navigate as r, Outlet as p } from "react-router-dom";
|
|
2
3
|
import { useAuthId as f } from "../../auth/hooks/AuthHook.js";
|
|
3
|
-
import { j as
|
|
4
|
-
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
import { j as h } from "../../index-CuHybtft.js";
|
|
5
|
+
const T = () => {
|
|
6
|
+
const { authToken: s, userToken: n } = f(), i = d(), a = n || localStorage.getItem("user_token");
|
|
7
|
+
if (!(s || localStorage.getItem("access_token")) || !a)
|
|
8
|
+
return /* @__PURE__ */ e(r, { to: "/", replace: !0 });
|
|
9
|
+
let c;
|
|
9
10
|
try {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
} catch (c) {
|
|
14
|
-
return console.error("Error decoding token:", c), /* @__PURE__ */ t(r, { to: "/", replace: !0 });
|
|
11
|
+
c = h(a);
|
|
12
|
+
} catch (t) {
|
|
13
|
+
return console.error("Error decoding token:", t), /* @__PURE__ */ e(r, { to: "/", replace: !0 });
|
|
15
14
|
}
|
|
16
|
-
|
|
15
|
+
const u = c.access_url, o = i.pathname, l = u.map(
|
|
16
|
+
(t) => t.startsWith("/") ? t : `/${t}`
|
|
17
|
+
), m = o.startsWith("/") ? o : `/${o}`;
|
|
18
|
+
return l.includes(m) ? /* @__PURE__ */ e(p, {}) : /* @__PURE__ */ e(r, { to: "/sistema/pagina-no-permitida", replace: !0 });
|
|
17
19
|
};
|
|
18
20
|
export {
|
|
19
|
-
|
|
21
|
+
T as ProtectedRoute
|
|
20
22
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as t
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { Navigate as a, Outlet as n } from "react-router-dom";
|
|
2
3
|
import { useAuthId as s } from "../../auth/hooks/AuthHook.js";
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
return !(o || localStorage.getItem("access_token")) || !a ? /* @__PURE__ */ t(m, { to: "/sistema/pagina-no-permitida", replace: !0 }) : /* @__PURE__ */ t(n, { children: e });
|
|
4
|
+
const p = () => {
|
|
5
|
+
const { authToken: e, userToken: o } = s(), r = o || localStorage.getItem("user_token");
|
|
6
|
+
return !(e || localStorage.getItem("access_token")) || !r ? /* @__PURE__ */ t(a, { to: "/sistema/pagina-no-permitida", replace: !0 }) : /* @__PURE__ */ t(n, {});
|
|
7
7
|
};
|
|
8
8
|
export {
|
|
9
9
|
p as UserRoute
|
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": "0.9.
|
|
5
|
+
"version": "0.9.16-pre-release",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
@@ -57,7 +57,8 @@
|
|
|
57
57
|
},
|
|
58
58
|
"peerDependencies": {
|
|
59
59
|
"react": ">=18.0.0 <=20.0.0",
|
|
60
|
-
"react-dom": ">=18.0.0 <=20.0.0"
|
|
60
|
+
"react-dom": ">=18.0.0 <=20.0.0",
|
|
61
|
+
"react-router-dom": ">=6.0.0 <=8.0.0"
|
|
61
62
|
},
|
|
62
63
|
"dependencies": {
|
|
63
64
|
"bootstrap": "^5.3.3",
|
|
@@ -65,7 +66,6 @@
|
|
|
65
66
|
"lottie-react": "^2.4.1",
|
|
66
67
|
"react-bootstrap": "^2.10.9",
|
|
67
68
|
"react-icons": "^5.4.0",
|
|
68
|
-
"react-router-dom": "^7.1.5",
|
|
69
69
|
"react-toastify": "^11.0.3",
|
|
70
70
|
"sweetalert2": "^11.16.1"
|
|
71
71
|
},
|