react-ecosistema-unp 2.0.1 → 2.2.0
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/{AppList-BshxZhoN.js → AppList-DORGpC4I.js} +84 -84
- package/dist/assets/DocumentoVisorEstado.css +1 -0
- package/dist/assets/EcoDataTable.css +1 -1
- package/dist/assets/EcoDataTableBandejaFooter.css +1 -1
- package/dist/assets/EcoModalStyles.css +1 -1
- package/dist/assets/SileoNotifications.css +1 -1
- package/dist/cards/tarjeta/nuevo-elemento/NuevoElemento.js +1 -1
- package/dist/cards/tarjeta-info/TarjetaInfo.js +1 -1
- package/dist/data/tarjeta-datos/TarjetaDatos.js +1 -1
- package/dist/{index-C4MBu_wk.js → index-B96iRUpt.js} +38 -34
- package/dist/{index-h-TtOxhs.js → index-BqaJxgOF.js} +182 -170
- package/dist/{SileoNotifications-BESOBARG.js → index-C1R4rkuA.js} +1 -1
- package/dist/lib/tables/custom-data-table/CustomDataTable.d.ts +2 -0
- package/dist/lib/tables/custom-data-table-split/CustomDataTableSplit.d.ts +7 -3
- package/dist/lib/tables/eco-data-table/components/EcoDataTable/EcoDataTable.d.ts +1 -1
- package/dist/lib/tables/eco-data-table/components/EcoDataTableBandejaFooter.d.ts +8 -1
- package/dist/lib/tables/eco-data-table/hooks/useEcoTableSelection.d.ts +1 -0
- package/dist/lib/tables/eco-data-table/types.d.ts +7 -0
- package/dist/lib/ui/animacion/Animacion.d.ts +1 -0
- package/dist/lib/ui.d.ts +1 -0
- package/dist/lib/utils/eco-provider/EcoContext.d.ts +4 -2
- package/dist/lib/utils/modal-radicados/DocumentoVisorEstado.d.ts +18 -0
- package/dist/lib/utils/modal-radicados/ModalDocumento.d.ts +26 -0
- package/dist/lib/utils/modal-radicados/VisorDocumento.d.ts +8 -0
- package/dist/lib/utils/notifications/EcoToaster.d.ts +18 -0
- package/dist/lib/utils/notifications/SileoNotifications.d.ts +23 -7
- package/dist/lib/utils.d.ts +2 -1
- package/dist/shared/app-list/AppList.js +2 -2
- package/dist/shared/iconos-sistema/IconosSistema.js +1 -1
- package/dist/shared/iconos-sistema/logout-button/LogoutButton.js +1 -1
- package/dist/shared/menu-lateral/MenuLateral.js +6 -4
- package/dist/shared/notificacion-usuario/NotificacionUsuario.js +61 -59
- package/dist/shared/ventana-tabs/VentanaTabs.js +1 -1
- package/dist/tables/custom-data-table/CustomDataTable.js +551 -548
- package/dist/tables/custom-data-table-split/CustomDataTableSplit.js +186 -173
- package/dist/tables/custom-table-toolbar/CustomTableToolbar.js +1 -1
- package/dist/tables/eco-data-table/components/EcoDataTable/EcoDataTable.js +190 -149
- package/dist/tables/eco-data-table/components/EcoDataTableBandejaFooter.js +36 -26
- package/dist/tables/eco-data-table/hooks/useEcoTableSelection.js +9 -8
- package/dist/tables/tabla-registros/buscador/Buscador.js +1 -1
- package/dist/tables/tabla-registros/modal-v2/EcoModal.js +11 -11
- package/dist/tables/tabla-registros/tabla/Tabla.js +22 -22
- package/dist/ui/alertas/AlertaFormulario.js +1 -1
- package/dist/ui/card-gestion-lateral/CardGestionLateral.js +1 -1
- package/dist/ui/contenido-modal/ContenidoModal.js +1 -1
- package/dist/ui/contenido-modal/ContenidoModalv0.1.js +1 -1
- package/dist/ui/contenido-modal-v2/ContenidoModalV2.js +1 -1
- package/dist/ui/contenido-modal-v2/ModalV2Menu.js +1 -1
- package/dist/ui/datos-basicos-card/DatosBasicosCard.js +1 -1
- package/dist/ui/icono-tooltip/IconoTooltip.js +10 -10
- package/dist/ui/items-modal/ItemsModal.js +1 -1
- package/dist/ui/nav-formularios-lateral/NavFormulariosLateral.js +1 -1
- package/dist/ui/notificacion-popover-v2/NotificacionPopoverV2.js +50 -50
- package/dist/ui/resumen-evaluacion/ResumenEvaluacion.js +5 -5
- package/dist/ui/status-filter-bar/StatusFilterBar.js +8 -8
- package/dist/ui/status-semaphore/StatusSemaphore.js +1 -1
- package/dist/ui/stepper-v2/StepperV2.js +1 -1
- package/dist/utils/eco-provider/EcoContext.js +11 -8
- package/dist/utils/modal-radicados/AuxRadicadosComponents/TarjetaRadicado.js +12 -12
- package/dist/utils/modal-radicados/DocumentoVisorEstado.js +125 -0
- package/dist/utils/modal-radicados/ModalDocumento.js +155 -170
- package/dist/utils/modal-radicados/ModalRadicado.js +34 -34
- package/dist/utils/modal-radicados/VisorDocumento.js +61 -61
- package/dist/utils/notifications/EcoToaster.js +48 -0
- package/dist/utils/notifications/SileoNotifications.js +62 -55
- package/dist/utils/unp-historico/UnpHistorico.js +1 -1
- package/dist/utils/websocket-manager/websocket.js +22 -18
- package/dist/utils.js +29 -24
- package/package.json +1 -1
|
@@ -1,79 +1,79 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { ModalDocumento as
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
/* empty css */
|
|
8
|
-
/* empty css */
|
|
9
|
-
/* empty css */
|
|
10
|
-
/* empty css */
|
|
11
|
-
import "react-router-dom";
|
|
12
|
-
/* empty css */
|
|
13
|
-
/* empty css */
|
|
14
|
-
/* empty css */
|
|
15
|
-
/* empty css */
|
|
16
|
-
import "../../index-DdZBtIJj.js";
|
|
17
|
-
/* empty css */
|
|
18
|
-
import { Animacion as y } from "../../ui/animacion/Animacion.js";
|
|
19
|
-
/* empty css */
|
|
20
|
-
/* empty css */
|
|
21
|
-
import "../../cards/tarjeta/seccion-tarjeta/SeccionTarjeta.js";
|
|
22
|
-
/* empty css */
|
|
23
|
-
/* empty css */
|
|
24
|
-
/* empty css */
|
|
25
|
-
/* empty css */
|
|
26
|
-
/* empty css */
|
|
27
|
-
/* empty css */
|
|
28
|
-
/* empty css */
|
|
29
|
-
/* empty css */
|
|
30
|
-
/* empty css */
|
|
31
|
-
/* empty css */
|
|
32
|
-
/* empty css */
|
|
33
|
-
/* empty css */
|
|
34
|
-
/* empty css */
|
|
35
|
-
/* empty css */
|
|
36
|
-
/* empty css */
|
|
37
|
-
import { getUserToken as L } from "../../auth/services/User.js";
|
|
38
|
-
const no = ({
|
|
39
|
-
idDocumento: t,
|
|
1
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { useState as r, useCallback as T, useEffect as j } from "react";
|
|
3
|
+
import { ModalDocumento as i } from "./ModalDocumento.js";
|
|
4
|
+
import { getUserToken as E } from "../../auth/services/User.js";
|
|
5
|
+
const S = ({
|
|
6
|
+
idDocumento: o,
|
|
40
7
|
nombre: s,
|
|
41
|
-
allowDownloadButton:
|
|
8
|
+
allowDownloadButton: b = !0,
|
|
9
|
+
viewOnly: a = !1,
|
|
10
|
+
animationType: c = "loading_duck"
|
|
42
11
|
}) => {
|
|
43
|
-
const [
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
12
|
+
const [f, d] = r(null), [U, g] = r(""), [h, m] = r(!1), [p, w] = r(null), [R, k] = r(0), L = T(() => {
|
|
13
|
+
k((e) => e + 1);
|
|
14
|
+
}, []);
|
|
15
|
+
return j(() => {
|
|
16
|
+
if (!o) return;
|
|
17
|
+
let e = null, n = !1;
|
|
18
|
+
return m(!0), w(null), d(null), (async () => {
|
|
48
19
|
try {
|
|
49
|
-
const
|
|
20
|
+
const t = `${window.location.protocol}//${window.location.host}/api-gateway/documento/descargar-anexo/${encodeURIComponent(o)}`, l = await fetch(t, {
|
|
50
21
|
headers: {
|
|
51
|
-
Authorization: `Bearer ${
|
|
22
|
+
Authorization: `Bearer ${E()}`,
|
|
52
23
|
"BK-Service": "api-doc"
|
|
53
24
|
}
|
|
54
25
|
});
|
|
55
|
-
if (!
|
|
56
|
-
const
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
26
|
+
if (!l.ok) throw new Error(`Error al obtener el documento: ${l.status}`);
|
|
27
|
+
const y = l.headers.get("Content-Type") || "", B = await l.blob();
|
|
28
|
+
if (e = URL.createObjectURL(B), n) {
|
|
29
|
+
URL.revokeObjectURL(e);
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
g(y), d(e);
|
|
33
|
+
} catch (t) {
|
|
34
|
+
n || w((t == null ? void 0 : t.message) ?? "No se pudo cargar el documento.");
|
|
60
35
|
} finally {
|
|
61
|
-
|
|
36
|
+
n || m(!1);
|
|
62
37
|
}
|
|
63
38
|
})(), () => {
|
|
64
|
-
|
|
39
|
+
n = !0, e && URL.revokeObjectURL(e);
|
|
65
40
|
};
|
|
66
|
-
}, [
|
|
67
|
-
|
|
41
|
+
}, [o, R]), h ? /* @__PURE__ */ u(
|
|
42
|
+
i,
|
|
68
43
|
{
|
|
69
44
|
data: "",
|
|
70
|
-
mimeType:
|
|
71
|
-
name: s ??
|
|
72
|
-
|
|
73
|
-
allowDownloadButton:
|
|
45
|
+
mimeType: "",
|
|
46
|
+
name: s ?? o,
|
|
47
|
+
isLoading: !0,
|
|
48
|
+
allowDownloadButton: !1,
|
|
49
|
+
viewOnly: a,
|
|
50
|
+
animationType: c
|
|
51
|
+
}
|
|
52
|
+
) : p ? /* @__PURE__ */ u(
|
|
53
|
+
i,
|
|
54
|
+
{
|
|
55
|
+
data: "",
|
|
56
|
+
mimeType: "",
|
|
57
|
+
name: s ?? o,
|
|
58
|
+
loadError: p,
|
|
59
|
+
onRetry: L,
|
|
60
|
+
allowDownloadButton: !1,
|
|
61
|
+
viewOnly: a,
|
|
62
|
+
animationType: c
|
|
63
|
+
}
|
|
64
|
+
) : f ? /* @__PURE__ */ u(
|
|
65
|
+
i,
|
|
66
|
+
{
|
|
67
|
+
data: "",
|
|
68
|
+
mimeType: U,
|
|
69
|
+
name: s ?? o,
|
|
70
|
+
blobUrl: f,
|
|
71
|
+
allowDownloadButton: b && !a,
|
|
72
|
+
viewOnly: a,
|
|
73
|
+
animationType: c
|
|
74
74
|
}
|
|
75
75
|
) : null;
|
|
76
76
|
};
|
|
77
77
|
export {
|
|
78
|
-
|
|
78
|
+
S as VisorDocumento
|
|
79
79
|
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import { useId as l, useSyncExternalStore as a, useEffect as u } from "react";
|
|
3
|
+
import { r as m } from "../../index-DdZBtIJj.js";
|
|
4
|
+
import { T as d } from "../../index-C1R4rkuA.js";
|
|
5
|
+
const i = [], f = /* @__PURE__ */ new Set();
|
|
6
|
+
function s() {
|
|
7
|
+
f.forEach((e) => {
|
|
8
|
+
try {
|
|
9
|
+
e();
|
|
10
|
+
} catch {
|
|
11
|
+
}
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
function g(e, t, n) {
|
|
15
|
+
const r = i.find((o) => o.id === e);
|
|
16
|
+
r ? (r.isDefault = t, r.props = n) : i.push({ id: e, isDefault: t, props: n }), s();
|
|
17
|
+
}
|
|
18
|
+
function y(e) {
|
|
19
|
+
const t = i.findIndex((n) => n.id === e);
|
|
20
|
+
t !== -1 && (i.splice(t, 1), s());
|
|
21
|
+
}
|
|
22
|
+
function x(e, t) {
|
|
23
|
+
const n = i.find((r) => r.id === e);
|
|
24
|
+
n && (n.props = t, s());
|
|
25
|
+
}
|
|
26
|
+
function h() {
|
|
27
|
+
if (i.length === 0) return null;
|
|
28
|
+
const e = i.filter((t) => !t.isDefault);
|
|
29
|
+
return e.length > 0 ? e[e.length - 1].id : i[0].id;
|
|
30
|
+
}
|
|
31
|
+
const b = ({ isDefault: e = !1, ...t }) => {
|
|
32
|
+
const n = l(), r = a(
|
|
33
|
+
(o) => (f.add(o), () => {
|
|
34
|
+
f.delete(o);
|
|
35
|
+
}),
|
|
36
|
+
() => h(),
|
|
37
|
+
() => null
|
|
38
|
+
);
|
|
39
|
+
return u(() => (g(n, e, t), () => {
|
|
40
|
+
y(n);
|
|
41
|
+
}), [n, e]), u(() => {
|
|
42
|
+
x(n, t);
|
|
43
|
+
}, [n, t.theme, t.position, JSON.stringify(t.offset), JSON.stringify(t.options)]), r !== n ? null : typeof document < "u" ? m.createPortal(/* @__PURE__ */ c(d, { ...t }), document.body) : /* @__PURE__ */ c(d, { ...t });
|
|
44
|
+
};
|
|
45
|
+
export {
|
|
46
|
+
b as Toaster,
|
|
47
|
+
b as default
|
|
48
|
+
};
|
|
@@ -1,71 +1,78 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { jsxs as _, jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import '../../assets/SileoNotifications.css';/* empty css */
|
|
3
|
+
import { s as i } from "../../index-C1R4rkuA.js";
|
|
4
|
+
const g = 2147483647, m = 3500, A = 6e3, x = 150, l = {
|
|
5
|
+
exito: "#F0FDF4",
|
|
6
|
+
// Fondo Éxito (Verde Pastel)
|
|
7
|
+
error: "#FEF2F2",
|
|
8
|
+
// Fondo Error (Rojo Pastel)
|
|
9
|
+
aviso: "#FFFBEB",
|
|
10
|
+
// Fondo Advertencia (Ámbar Pastel)
|
|
11
|
+
info: "#EFF6FF",
|
|
12
|
+
// Fondo Información (Azul Pastel)
|
|
13
|
+
cargando: "#F9FAFB",
|
|
14
|
+
// Fondo Neutral / Cargando (Gris Pastel)
|
|
15
|
+
accion: "#F5F3FF"
|
|
16
|
+
// Fondo Acción (Morado Pastel)
|
|
17
|
+
}, a = (o) => {
|
|
18
|
+
const e = (o ?? g).toString();
|
|
19
|
+
document.documentElement.style.setProperty("--sileo-z-index", e);
|
|
20
|
+
}, h = (o, e = "Éxito", t) => (a(t), i.success({ title: e, description: o, position: "top-right", duration: m, fill: l.exito })), T = (o, e = "Error", t) => (a(t), i.error({ title: e, description: o, position: "bottom-center", fill: l.error })), y = (o, e = "Procesando...", t) => (a(t), i.show({
|
|
21
|
+
type: "loading",
|
|
22
|
+
title: e,
|
|
12
23
|
description: o,
|
|
13
|
-
icon: /* @__PURE__ */
|
|
24
|
+
icon: /* @__PURE__ */ u("div", { className: "sileo-loading-spinner eco-sileo-loading-spinner" }),
|
|
14
25
|
position: "bottom-center",
|
|
15
|
-
duration: 0
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
onConfirm: f = () => {
|
|
29
|
-
},
|
|
30
|
-
onCancel: m = () => {
|
|
31
|
-
},
|
|
32
|
-
showCancel: u = !0,
|
|
33
|
-
zIndex: C,
|
|
34
|
-
position: x = "top-center"
|
|
35
|
-
} = c;
|
|
36
|
-
s(C);
|
|
37
|
-
const a = n.action({
|
|
26
|
+
duration: 0,
|
|
27
|
+
fill: l.cargando
|
|
28
|
+
})), w = (o, e = "Atención", t = A, n) => (a(n), i.warning({ title: e, description: o, position: "top-center", duration: t, fill: l.aviso })), U = (o, e = "Información", t = A, n) => (a(n), i.info({ title: e, description: o, position: "top-center", duration: t, fill: l.info })), j = () => {
|
|
29
|
+
i.clear();
|
|
30
|
+
}, b = (o) => {
|
|
31
|
+
typeof i.dismiss == "function" ? i.dismiss(o) : i.clear();
|
|
32
|
+
}, z = (o, e, t, n, I, v, D) => {
|
|
33
|
+
let r = () => {
|
|
34
|
+
}, d = () => {
|
|
35
|
+
}, f = I || "Si, tomar caso", C = v || "Cancelar", F = !0, p = D, E = "top-center";
|
|
36
|
+
typeof t == "function" ? (r = t, n && (d = n)) : t && typeof t == "object" && (t.onConfirm && (r = t.onConfirm), t.onCancel && (d = t.onCancel), t.labelConfirm && (f = t.labelConfirm), t.labelCancel && (C = t.labelCancel), t.showCancel !== void 0 && (F = t.showCancel), t.zIndex !== void 0 && (p = t.zIndex), t.position && (E = t.position)), a(p);
|
|
37
|
+
let s;
|
|
38
|
+
return s = i.action({
|
|
38
39
|
title: o,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
fill: l.accion,
|
|
41
|
+
description: /* @__PURE__ */ _("div", { className: "sileo-action-stack eco-sileo-action-stack", children: [
|
|
42
|
+
e ? /* @__PURE__ */ u("div", { className: "sileo-action-text eco-sileo-action-text", children: e }) : null,
|
|
43
|
+
F && /* @__PURE__ */ u(
|
|
44
|
+
"button",
|
|
43
45
|
{
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
type: "button",
|
|
47
|
+
className: "sileo-btn-ajustar eco-sileo-btn-ajustar",
|
|
48
|
+
style: { pointerEvents: "auto", position: "relative", zIndex: 50 },
|
|
49
|
+
onPointerDown: (c) => c.stopPropagation(),
|
|
50
|
+
onClick: (c) => {
|
|
51
|
+
c.preventDefault(), c.stopPropagation(), b(s), setTimeout(() => d(), x);
|
|
48
52
|
},
|
|
49
|
-
children:
|
|
53
|
+
children: C
|
|
50
54
|
}
|
|
51
55
|
)
|
|
52
56
|
] }),
|
|
53
|
-
position:
|
|
57
|
+
position: E,
|
|
54
58
|
duration: null,
|
|
55
59
|
button: {
|
|
56
|
-
title:
|
|
60
|
+
title: f,
|
|
57
61
|
onClick: () => {
|
|
58
|
-
|
|
62
|
+
b(s), setTimeout(() => r(), x);
|
|
59
63
|
}
|
|
60
64
|
}
|
|
61
|
-
});
|
|
65
|
+
}), s;
|
|
62
66
|
};
|
|
63
67
|
export {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
j as
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
l as COLOR_FILLS,
|
|
69
|
+
b as cerrarNotificacion,
|
|
70
|
+
j as limpiarNotificaciones,
|
|
71
|
+
z as notificarAccion,
|
|
72
|
+
w as notificarAviso,
|
|
73
|
+
y as notificarCargando,
|
|
74
|
+
T as notificarError,
|
|
75
|
+
h as notificarExito,
|
|
76
|
+
U as notificarInfo,
|
|
77
|
+
a as setSileoZIndex
|
|
71
78
|
};
|
|
@@ -9,7 +9,7 @@ import "../../cards/tarjeta/seccion-tarjeta/SeccionTarjeta.js";
|
|
|
9
9
|
/* empty css */
|
|
10
10
|
/* empty css */
|
|
11
11
|
import { TarjetaInfo as b } from "../../cards/tarjeta-info/TarjetaInfo.js";
|
|
12
|
-
import { F as u } from "../../index-
|
|
12
|
+
import { F as u } from "../../index-B96iRUpt.js";
|
|
13
13
|
import { fetchHistorico as f } from "./FetchHistorico.js";
|
|
14
14
|
/* empty css */
|
|
15
15
|
import "../../ui/subtitulo/Subtitulo.js";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var u = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var r = (
|
|
4
|
-
const
|
|
5
|
-
class
|
|
2
|
+
var S = (c, t, e) => t in c ? u(c, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : c[t] = e;
|
|
3
|
+
var r = (c, t, e) => S(c, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
const a = [3e3, 3e4, 18e4];
|
|
5
|
+
class d {
|
|
6
6
|
constructor() {
|
|
7
7
|
r(this, "sockets", /* @__PURE__ */ new Map());
|
|
8
8
|
r(this, "statusCallbacks", []);
|
|
@@ -43,10 +43,10 @@ class S {
|
|
|
43
43
|
const s = new WebSocket(t);
|
|
44
44
|
e.socket = s, s.onopen = () => {
|
|
45
45
|
console.log(`✅ WebSocket conectado a ${t}`), this.setSocketStatus(t, "connected"), e.reconnectTimer && clearTimeout(e.reconnectTimer), e.reconnectTimer = null, e.retryCount = 0;
|
|
46
|
-
}, s.onmessage = (
|
|
46
|
+
}, s.onmessage = (n) => {
|
|
47
47
|
try {
|
|
48
|
-
const o = JSON.parse(
|
|
49
|
-
e == null || e.messageHandlers.forEach((
|
|
48
|
+
const o = JSON.parse(n.data);
|
|
49
|
+
e == null || e.messageHandlers.forEach((i) => i(o));
|
|
50
50
|
} catch (o) {
|
|
51
51
|
console.error("❌ Error parseando mensaje WebSocket", o);
|
|
52
52
|
}
|
|
@@ -55,16 +55,20 @@ class S {
|
|
|
55
55
|
this.setSocketStatus(t, "disconnected");
|
|
56
56
|
return;
|
|
57
57
|
}
|
|
58
|
-
if (
|
|
58
|
+
if (typeof document < "u" && document.hidden) {
|
|
59
|
+
console.warn(`🔌 WebSocket: la pestaña está inactiva. Se pausan reintentos para ${t}`), this.setSocketStatus(t, "disconnected");
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
if (e.retryCount >= a.length) {
|
|
59
63
|
console.warn(`🔌 WebSocket: se agotaron los reintentos para ${t}`), e.shouldReconnect = !1, this.setSocketStatus(t, "disconnected");
|
|
60
64
|
return;
|
|
61
65
|
}
|
|
62
|
-
const
|
|
63
|
-
e.retryCount++, console.warn(`🔌 WebSocket cerrado para ${t}. Reintentando en ${
|
|
66
|
+
const n = a[e.retryCount];
|
|
67
|
+
e.retryCount++, console.warn(`🔌 WebSocket cerrado para ${t}. Reintentando en ${n / 1e3}s (intento ${e.retryCount}/${a.length})...`), this.setSocketStatus(t, "connecting"), e.reconnectTimer || (e.reconnectTimer = setTimeout(() => {
|
|
64
68
|
e.reconnectTimer = null, e.shouldReconnect && this.connect(t);
|
|
65
|
-
},
|
|
66
|
-
}, s.onerror = (
|
|
67
|
-
console.error("⚠️ WebSocket error:",
|
|
69
|
+
}, n));
|
|
70
|
+
}, s.onerror = (n) => {
|
|
71
|
+
console.error("⚠️ WebSocket error:", n), this.setSocketStatus(t, "disconnected"), s.close();
|
|
68
72
|
};
|
|
69
73
|
}
|
|
70
74
|
disconnect(t) {
|
|
@@ -79,13 +83,13 @@ class S {
|
|
|
79
83
|
send(t, e) {
|
|
80
84
|
var s;
|
|
81
85
|
if (e) {
|
|
82
|
-
const
|
|
83
|
-
((s =
|
|
86
|
+
const n = this.sockets.get(e);
|
|
87
|
+
((s = n == null ? void 0 : n.socket) == null ? void 0 : s.readyState) === WebSocket.OPEN && n.socket.send(JSON.stringify(t));
|
|
84
88
|
return;
|
|
85
89
|
}
|
|
86
|
-
this.sockets.forEach((
|
|
90
|
+
this.sockets.forEach((n) => {
|
|
87
91
|
var o;
|
|
88
|
-
((o =
|
|
92
|
+
((o = n.socket) == null ? void 0 : o.readyState) === WebSocket.OPEN && n.socket.send(JSON.stringify(t));
|
|
89
93
|
});
|
|
90
94
|
}
|
|
91
95
|
subscribe(t, e) {
|
|
@@ -96,7 +100,7 @@ class S {
|
|
|
96
100
|
s == null || s.messageHandlers.delete(e);
|
|
97
101
|
}
|
|
98
102
|
}
|
|
99
|
-
const h = new
|
|
103
|
+
const h = new d();
|
|
100
104
|
export {
|
|
101
105
|
h as webSocketService
|
|
102
106
|
};
|
package/dist/utils.js
CHANGED
|
@@ -1,38 +1,43 @@
|
|
|
1
1
|
import { formatDate as t } from "./utils/formatters/dateFormatter.js";
|
|
2
2
|
import { IsInvalidStyles as i, useFormValidation as a } from "./utils/validations/useFormValidation.js";
|
|
3
|
-
import { CaptchaEcosistema as
|
|
3
|
+
import { CaptchaEcosistema as f } from "./utils/captcha/CaptchaEcosistema.js";
|
|
4
4
|
import { useFetchData as n } from "./utils/fetch-data/useFetchData.js";
|
|
5
5
|
import { WebSocketProvider as x, useWebSocketConnection as s } from "./utils/websocket-manager/WebSocketContext.js";
|
|
6
6
|
import { useWebSocket as u } from "./utils/websocket-manager/useWebSocket.js";
|
|
7
|
-
import { ModalRadicado as
|
|
7
|
+
import { ModalRadicado as S } from "./utils/modal-radicados/ModalRadicado.js";
|
|
8
8
|
import { ModalDocumento as E } from "./utils/modal-radicados/ModalDocumento.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
9
|
+
import { DocumentoVisorEstado as v } from "./utils/modal-radicados/DocumentoVisorEstado.js";
|
|
10
|
+
import { COLOR_FILLS as R, cerrarNotificacion as b, limpiarNotificaciones as k, notificarAccion as F, notificarAviso as L, notificarCargando as P, notificarError as V, notificarExito as W, notificarInfo as h, setSileoZIndex as A } from "./utils/notifications/SileoNotifications.js";
|
|
11
|
+
import { Toaster as N } from "./utils/notifications/EcoToaster.js";
|
|
12
|
+
import { EcoProvider as U } from "./utils/eco-provider/EcoContext.js";
|
|
13
|
+
import { ProtectedRoute as y } from "./utils/components/ProtectedRoute.js";
|
|
14
|
+
import { UserRoute as T } from "./utils/components/UserRoute.js";
|
|
15
|
+
import { UnpHistorico as _ } from "./utils/unp-historico/UnpHistorico.js";
|
|
16
|
+
import { VisorDocumento as q } from "./utils/modal-radicados/VisorDocumento.js";
|
|
16
17
|
export {
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
R as COLOR_FILLS,
|
|
19
|
+
f as CaptchaEcosistema,
|
|
20
|
+
v as DocumentoVisorEstado,
|
|
21
|
+
U as EcoProvider,
|
|
19
22
|
i as IsInvalidStyles,
|
|
20
23
|
E as ModalDocumento,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
S as ModalRadicado,
|
|
25
|
+
y as ProtectedRoute,
|
|
26
|
+
N as Toaster,
|
|
27
|
+
_ as UnpHistorico,
|
|
28
|
+
T as UserRoute,
|
|
29
|
+
q as VisorDocumento,
|
|
27
30
|
x as WebSocketProvider,
|
|
31
|
+
b as cerrarNotificacion,
|
|
28
32
|
t as formatDate,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
k as limpiarNotificaciones,
|
|
34
|
+
F as notificarAccion,
|
|
35
|
+
L as notificarAviso,
|
|
36
|
+
P as notificarCargando,
|
|
37
|
+
V as notificarError,
|
|
38
|
+
W as notificarExito,
|
|
39
|
+
h as notificarInfo,
|
|
40
|
+
A as setSileoZIndex,
|
|
36
41
|
n as useFetchData,
|
|
37
42
|
a as useFormValidation,
|
|
38
43
|
u as useWebSocket,
|