prometeo-design-system 4.7.7 → 4.7.8
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/PyrionLayout.es.js +178 -177
- package/dist/Scrollable.es.js +310 -272
- package/dist/components/PyrionNavigationDrawer/PLFooter.d.ts +1 -1
- package/dist/components/PyrionNavigationDrawer/PLSystemSessions.d.ts +3 -1
- package/dist/components/PyrionNavigationDrawer/PLayoutBase.d.ts +1 -1
- package/dist/components/PyrionNavigationDrawer/PyrionLayout.d.ts +2 -1
- package/dist/components/Scrollable/Scrollable.d.ts +1 -0
- package/package.json +1 -1
package/dist/PyrionLayout.es.js
CHANGED
|
@@ -2,7 +2,7 @@ import { j as e } from "./jsx-runtime-GkKLlHH4.js";
|
|
|
2
2
|
import { u as Je, g as Nt } from "./useDevice-vwn4GLwK.js";
|
|
3
3
|
import { c as D } from "./cn-B6yFEsav.js";
|
|
4
4
|
import { g as je } from "./utils-X4-h3cum.js";
|
|
5
|
-
import qe, { forwardRef as be, useState as J, useRef as
|
|
5
|
+
import qe, { forwardRef as be, useState as J, useRef as O, useEffect as se, memo as M, useContext as Ge, createContext as Me, useCallback as h, Children as yt, isValidElement as ke, useMemo as me, useImperativeHandle as Re, useLayoutEffect as Ct, use as St } from "react";
|
|
6
6
|
import { createPortal as $e } from "react-dom";
|
|
7
7
|
import { useLocation as jt, useNavigate as kt } from "react-router";
|
|
8
8
|
import pe from "./Skeleton.es.js";
|
|
@@ -23,11 +23,11 @@ import { Close as Fe } from "./Icons/Close.es.js";
|
|
|
23
23
|
import { Help as tt } from "./Icons/Help.es.js";
|
|
24
24
|
import { Settings as _t } from "./Icons/Settings.es.js";
|
|
25
25
|
const Pt = be((t, r) => {
|
|
26
|
-
const [s, o] = J(t?.currentTabName || t.tabs[0]?.name), c =
|
|
27
|
-
se(() => {
|
|
26
|
+
const [s, o] = J(t?.currentTabName || t.tabs[0]?.name), c = O(null), { tabs: l = [], className: d, activeColor: i = "var(--neutral-900)", currentSystemId: f, isLoading: m = !1 } = t;
|
|
27
|
+
console.log("tabs en el tabswitch del layout", l), se(() => {
|
|
28
28
|
c.current?.style.setProperty("--tab-bg", i);
|
|
29
29
|
}, [i]);
|
|
30
|
-
const x = l.find((
|
|
30
|
+
const x = l.find((p) => p?.id === f || p?.name === (t?.currentTabName || s));
|
|
31
31
|
return /* @__PURE__ */ e.jsx(
|
|
32
32
|
"div",
|
|
33
33
|
{
|
|
@@ -40,9 +40,9 @@ const Pt = be((t, r) => {
|
|
|
40
40
|
"border-r border-neutral-default-default",
|
|
41
41
|
d
|
|
42
42
|
),
|
|
43
|
-
children: (
|
|
44
|
-
(
|
|
45
|
-
if (
|
|
43
|
+
children: (m ? Array(3).fill(null) : l).map(
|
|
44
|
+
(p, b) => {
|
|
45
|
+
if (m) return /* @__PURE__ */ e.jsx(
|
|
46
46
|
"div",
|
|
47
47
|
{
|
|
48
48
|
className: D(
|
|
@@ -51,19 +51,19 @@ const Pt = be((t, r) => {
|
|
|
51
51
|
"flex items-center pl-[6px] ",
|
|
52
52
|
"rounded-l-[8px]",
|
|
53
53
|
"tabswitch-element relative",
|
|
54
|
-
|
|
54
|
+
b === 0 && "active"
|
|
55
55
|
),
|
|
56
56
|
children: /* @__PURE__ */ e.jsx("div", { className: D(
|
|
57
57
|
"size-8 rounded-[4px]",
|
|
58
58
|
"grid place-items-center",
|
|
59
59
|
"tab-thumbnail-icon",
|
|
60
60
|
"bg-transparent text-neutral-default-default",
|
|
61
|
-
|
|
61
|
+
p?.className
|
|
62
62
|
), children: /* @__PURE__ */ e.jsx(pe, { shape: "rounded", className: "w-full h-full" }) })
|
|
63
63
|
}
|
|
64
64
|
);
|
|
65
|
-
const S =
|
|
66
|
-
|
|
65
|
+
const S = p?.name === x?.name, k = typeof p?.thumbnail == "string" ? /* @__PURE__ */ e.jsx("img", { src: p?.thumbnail, alt: p?.description, className: "aspect-square object-contain rounded", draggable: !1 }) : p?.thumbnail, y = () => {
|
|
66
|
+
p.disabled || (o(p?.name), p.onClick && p.onClick(p?.name));
|
|
67
67
|
};
|
|
68
68
|
return /* @__PURE__ */ e.jsx(
|
|
69
69
|
"div",
|
|
@@ -83,26 +83,26 @@ const Pt = be((t, r) => {
|
|
|
83
83
|
"grid place-items-center",
|
|
84
84
|
"tab-thumbnail-icon",
|
|
85
85
|
"bg-transparent text-neutral-default-default",
|
|
86
|
-
|
|
86
|
+
p?.className
|
|
87
87
|
), children: k })
|
|
88
88
|
},
|
|
89
|
-
|
|
89
|
+
p?.name
|
|
90
90
|
);
|
|
91
91
|
}
|
|
92
92
|
)
|
|
93
93
|
}
|
|
94
94
|
);
|
|
95
95
|
}), rt = M(be(({ children: t, className: r, context: s, modal: o = !1, closeOnOverlayClick: c = !1, unmountChildrenOnClose: l = !0 }, d) => {
|
|
96
|
-
const i = ge(t, s), f = typeof window < "u" && window.matchMedia("(min-width: 768px)").matches, { isSidebarOpen:
|
|
96
|
+
const i = ge(t, s), f = typeof window < "u" && window.matchMedia("(min-width: 768px)").matches, { isSidebarOpen: m } = Mt(), { closeSidebar: x } = ce(), [p, b] = J(() => l ? m : !0), [S, k] = J(!1);
|
|
97
97
|
return se(() => {
|
|
98
98
|
l && s?.subscribeToSidebarOpen((y) => {
|
|
99
|
-
y ? (k(!1),
|
|
99
|
+
y ? (k(!1), b(!0)) : k(!0);
|
|
100
100
|
});
|
|
101
101
|
}, [l, s]), se(() => {
|
|
102
102
|
const y = d && typeof d == "object" && "current" in d ? d.current : null;
|
|
103
103
|
if (!y) return;
|
|
104
104
|
const C = () => {
|
|
105
|
-
S && (
|
|
105
|
+
S && (b(!1), k(!1));
|
|
106
106
|
};
|
|
107
107
|
return y.addEventListener("transitionend", C), () => y.removeEventListener("transitionend", C);
|
|
108
108
|
}, [S]), /* @__PURE__ */ e.jsxs("div", { ref: d, className: D("sidebar", f ? "collapsed" : "expanded", "h-full overflow-auto", r), "aria-modal": o || void 0, children: [
|
|
@@ -118,7 +118,7 @@ const Pt = be((t, r) => {
|
|
|
118
118
|
),
|
|
119
119
|
/* @__PURE__ */ e.jsxs("div", { className: D("navigation-drawer-sidebar-inner"), children: [
|
|
120
120
|
/* @__PURE__ */ e.jsx("div", { className: "secure-click-margin" }),
|
|
121
|
-
|
|
121
|
+
p && i
|
|
122
122
|
] })
|
|
123
123
|
] });
|
|
124
124
|
})), st = Me(null), nt = Me(null), Mt = () => {
|
|
@@ -144,31 +144,31 @@ const Pt = be((t, r) => {
|
|
|
144
144
|
} catch {
|
|
145
145
|
}
|
|
146
146
|
}, Bt = (t) => {
|
|
147
|
-
const { children: r, classNameDrawer: s, classNameSidebar: o, disableDragOpen: c, modal: l = !0, closeOnOutsideClick: d = !0 } = t, i =
|
|
147
|
+
const { children: r, classNameDrawer: s, classNameSidebar: o, disableDragOpen: c, modal: l = !0, closeOnOutsideClick: d = !0 } = t, i = O(null), f = O(null), m = t.outletRef ?? O(null), x = O(null), p = O(Ke()), b = O(!1), S = O("drawer"), k = O(/* @__PURE__ */ new Set()), y = O(/* @__PURE__ */ new Set()), C = O(!1), A = O(null), V = h((n) => {
|
|
148
148
|
const u = f.current;
|
|
149
149
|
u && (u.classList.toggle("collapsed", n), u.classList.toggle("expanded", !n));
|
|
150
|
-
}, []), $ =
|
|
150
|
+
}, []), $ = h((n) => {
|
|
151
151
|
const u = x.current;
|
|
152
152
|
if (!u) return;
|
|
153
153
|
u.classList.toggle("collapsed", n), u.classList.toggle("expanded", !n);
|
|
154
154
|
const v = i.current;
|
|
155
155
|
v && (v.classList.toggle("sidebar-collapsed", n), v.classList.toggle("sidebar-expanded", !n));
|
|
156
|
-
}, []), j =
|
|
156
|
+
}, []), j = h(
|
|
157
157
|
(n, { notify: u = !0 } = {}) => {
|
|
158
|
-
const v =
|
|
159
|
-
|
|
158
|
+
const v = p.current !== n;
|
|
159
|
+
p.current = n, Rt(n), V(n), u && v && k.current.forEach((I) => I(n));
|
|
160
160
|
},
|
|
161
161
|
[V]
|
|
162
|
-
), U =
|
|
162
|
+
), U = h(
|
|
163
163
|
(n, { notify: u = !0 } = {}) => {
|
|
164
|
-
const v =
|
|
165
|
-
if (
|
|
164
|
+
const v = b.current !== n;
|
|
165
|
+
if (b.current = n, $(n), u && v) {
|
|
166
166
|
const I = !n;
|
|
167
167
|
y.current.forEach((W) => W(I));
|
|
168
168
|
}
|
|
169
169
|
},
|
|
170
170
|
[$]
|
|
171
|
-
), N =
|
|
171
|
+
), N = h(
|
|
172
172
|
(n, { notify: u = !0 } = {}) => {
|
|
173
173
|
const v = S.current, I = v !== n;
|
|
174
174
|
S.current = n, window.matchMedia("(min-width: 768px)").matches || j(n !== "drawer", { notify: u });
|
|
@@ -176,11 +176,11 @@ const Pt = be((t, r) => {
|
|
|
176
176
|
u && I && W !== B && y.current.forEach((te) => te(B)), U(n !== "sidebar", { notify: u }), j(n !== "drawer", { notify: u });
|
|
177
177
|
},
|
|
178
178
|
[j, U]
|
|
179
|
-
), K =
|
|
179
|
+
), K = h((n) => {
|
|
180
180
|
const u = i.current;
|
|
181
181
|
if (!u || window.matchMedia("(min-width: 768px)").matches) return;
|
|
182
182
|
C.current = !0;
|
|
183
|
-
const v =
|
|
183
|
+
const v = m.current?.offsetLeft ?? 0, I = x.current?.offsetLeft ?? v, W = n === "drawer" ? 0 : n === "sidebar" ? I : v;
|
|
184
184
|
A.current = W, u.scrollTo({ left: W, behavior: "smooth" });
|
|
185
185
|
const B = () => {
|
|
186
186
|
C.current = !1, A.current = null, u.removeEventListener("scrollend", B);
|
|
@@ -188,8 +188,8 @@ const Pt = be((t, r) => {
|
|
|
188
188
|
u.addEventListener("scrollend", B, { once: !0 }), setTimeout(() => {
|
|
189
189
|
C.current && B();
|
|
190
190
|
}, 1e3);
|
|
191
|
-
}, []), G =
|
|
192
|
-
const n = i.current, u =
|
|
191
|
+
}, []), G = h(() => {
|
|
192
|
+
const n = i.current, u = m.current;
|
|
193
193
|
if (!n || !u || window.matchMedia("(min-width: 768px)").matches) return;
|
|
194
194
|
const v = [
|
|
195
195
|
{ panel: "drawer", offset: 0 },
|
|
@@ -208,7 +208,7 @@ const Pt = be((t, r) => {
|
|
|
208
208
|
const n = i.current;
|
|
209
209
|
n && (c?.drawer && n.classList.add("disabled-dragopen"), c?.sidebar && n.classList.add("disabled-dragopen-sidebar"));
|
|
210
210
|
}, [c, i]), se(() => {
|
|
211
|
-
const n = i.current, u =
|
|
211
|
+
const n = i.current, u = m.current;
|
|
212
212
|
if (!n || !u) return;
|
|
213
213
|
if (window.matchMedia("(min-width: 768px)").matches) {
|
|
214
214
|
const I = Ke();
|
|
@@ -220,7 +220,7 @@ const Pt = be((t, r) => {
|
|
|
220
220
|
});
|
|
221
221
|
}, [N, j, U]), se(() => {
|
|
222
222
|
const n = i.current;
|
|
223
|
-
if (!n || !
|
|
223
|
+
if (!n || !m.current) return;
|
|
224
224
|
let v = !1, I = 0, W = 0;
|
|
225
225
|
const B = (L) => {
|
|
226
226
|
I = L.touches[0].clientX, W = L.touches[0].clientY;
|
|
@@ -272,26 +272,26 @@ const Pt = be((t, r) => {
|
|
|
272
272
|
n.removeEventListener("touchstart", B), n.removeEventListener("touchmove", Ne), n.removeEventListener("touchend", ye);
|
|
273
273
|
};
|
|
274
274
|
}, [G]);
|
|
275
|
-
const q =
|
|
276
|
-
const n = window.matchMedia("(min-width: 768px)").matches, u = !
|
|
275
|
+
const q = h(() => {
|
|
276
|
+
const n = window.matchMedia("(min-width: 768px)").matches, u = !p.current;
|
|
277
277
|
if (n) {
|
|
278
278
|
j(u);
|
|
279
279
|
return;
|
|
280
280
|
}
|
|
281
281
|
const v = u ? "outlet" : "drawer";
|
|
282
282
|
N(v), K(v);
|
|
283
|
-
}, [K, N, j]), X =
|
|
283
|
+
}, [K, N, j]), X = O(null);
|
|
284
284
|
X.current || (X.current = {
|
|
285
285
|
toggleCollapse: () => q(),
|
|
286
286
|
getIsCollapsed: () => {
|
|
287
287
|
if (!window.matchMedia("(min-width: 768px)").matches) {
|
|
288
|
-
const u = i.current, v =
|
|
288
|
+
const u = i.current, v = m.current;
|
|
289
289
|
if (u && v) {
|
|
290
290
|
const I = u.scrollLeft, W = v.offsetLeft, B = Math.abs(I - W) < Math.abs(I - 0);
|
|
291
|
-
return B !==
|
|
291
|
+
return B !== p.current && (p.current = B, V(B)), B;
|
|
292
292
|
}
|
|
293
293
|
}
|
|
294
|
-
return
|
|
294
|
+
return p.current;
|
|
295
295
|
},
|
|
296
296
|
subscribeToCollapse: (n) => (k.current.add(n), () => {
|
|
297
297
|
k.current.delete(n);
|
|
@@ -315,13 +315,13 @@ const Pt = be((t, r) => {
|
|
|
315
315
|
toggleSidebar: () => {
|
|
316
316
|
if (!x.current) return;
|
|
317
317
|
if (window.matchMedia("(min-width: 768px)").matches) {
|
|
318
|
-
U(!
|
|
318
|
+
U(!b.current);
|
|
319
319
|
return;
|
|
320
320
|
}
|
|
321
321
|
const n = S.current === "sidebar" ? "outlet" : "sidebar";
|
|
322
322
|
N(n), K(n);
|
|
323
323
|
},
|
|
324
|
-
getIsSidebarOpen: () => x.current ? window.matchMedia("(min-width: 768px)").matches ? !
|
|
324
|
+
getIsSidebarOpen: () => x.current ? window.matchMedia("(min-width: 768px)").matches ? !b.current : S.current === "sidebar" : !1,
|
|
325
325
|
subscribeToSidebarOpen: (n) => (y.current.add(n), () => {
|
|
326
326
|
y.current.delete(n);
|
|
327
327
|
}),
|
|
@@ -353,7 +353,7 @@ const Pt = be((t, r) => {
|
|
|
353
353
|
u.classList.add("disabled-dragopen-sidebar");
|
|
354
354
|
}
|
|
355
355
|
});
|
|
356
|
-
const
|
|
356
|
+
const E = X.current, _ = typeof r == "function" ? r(E) : r, g = yt.toArray(_);
|
|
357
357
|
let P = null, R = null, z = null;
|
|
358
358
|
const Q = [];
|
|
359
359
|
let ae = null, Z = null;
|
|
@@ -384,11 +384,11 @@ const Pt = be((t, r) => {
|
|
|
384
384
|
}
|
|
385
385
|
Q.push(n);
|
|
386
386
|
});
|
|
387
|
-
const ve = !!R, we = R ?? (Q.length ? /* @__PURE__ */ e.jsx(Le, { children: Q }) : null), Ae = ve ? Q : [], de = ae ?? (!!ae ? /* @__PURE__ */ e.jsx(_e, { children: _, context:
|
|
388
|
-
isCollapsed:
|
|
389
|
-
isSidebarOpen: !
|
|
390
|
-
}), [
|
|
391
|
-
return /* @__PURE__ */ e.jsx(st.Provider, { value: ue, children: /* @__PURE__ */ e.jsx(nt.Provider, { value:
|
|
387
|
+
const ve = !!R, we = R ?? (Q.length ? /* @__PURE__ */ e.jsx(Le, { children: Q }) : null), Ae = ve ? Q : [], de = ae ?? (!!ae ? /* @__PURE__ */ e.jsx(_e, { children: _, context: E, modal: l, closeOnOutsideClick: d }) : null), Te = z ?? (!!z ? /* @__PURE__ */ e.jsx(De, { children: z }) : null), Oe = !!Z, ee = Z, ue = me(() => ({
|
|
388
|
+
isCollapsed: p.current,
|
|
389
|
+
isSidebarOpen: !b.current
|
|
390
|
+
}), [p.current, b.current]);
|
|
391
|
+
return /* @__PURE__ */ e.jsx(st.Provider, { value: ue, children: /* @__PURE__ */ e.jsx(nt.Provider, { value: E, children: /* @__PURE__ */ e.jsxs("div", { id: "navigation-drawer-container", ref: i, className: D(
|
|
392
392
|
"w-full h-full max-h-dvh overflow-y-hidden",
|
|
393
393
|
Oe ? "navigation-drawer-with-sidebar" : "navigation-drawer",
|
|
394
394
|
c?.drawer ? "disabled-dragopen" : "",
|
|
@@ -400,7 +400,7 @@ const Pt = be((t, r) => {
|
|
|
400
400
|
ref: f,
|
|
401
401
|
className: D(
|
|
402
402
|
"bg-neutral-default-default border-r border-neutral-strong-default h-dvh md:h-screen p-4 overflow-hidden drawer flex flex-col gap-4",
|
|
403
|
-
|
|
403
|
+
p.current ? "collapsed" : "expanded",
|
|
404
404
|
s
|
|
405
405
|
),
|
|
406
406
|
children: [
|
|
@@ -418,7 +418,7 @@ const Pt = be((t, r) => {
|
|
|
418
418
|
]
|
|
419
419
|
}
|
|
420
420
|
),
|
|
421
|
-
de && ke(de) ? qe.cloneElement(de, { ref:
|
|
421
|
+
de && ke(de) ? qe.cloneElement(de, { ref: m, modal: l, closeOnOutsideClick: d }) : de,
|
|
422
422
|
ee && ke(ee) ? qe.cloneElement(ee, {
|
|
423
423
|
ref: x,
|
|
424
424
|
className: D("sidebar", ee.props?.className, o)
|
|
@@ -535,20 +535,20 @@ const Ft = "hover:bg-neutral-medium-hover", zt = Be("", {
|
|
|
535
535
|
hasSublinks: d,
|
|
536
536
|
subLinksCollapsed: i,
|
|
537
537
|
onToggleSublinks: f,
|
|
538
|
-
as:
|
|
538
|
+
as: m = "div",
|
|
539
539
|
onClick: x,
|
|
540
|
-
onAuxClick:
|
|
541
|
-
disabled:
|
|
540
|
+
onAuxClick: p,
|
|
541
|
+
disabled: b = !1,
|
|
542
542
|
tooltipText: S
|
|
543
543
|
} = t, k = (V) => {
|
|
544
|
-
|
|
544
|
+
b || x?.(V);
|
|
545
545
|
}, y = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
546
546
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 items-center flex-nowrap", children: [
|
|
547
|
-
s && (S ? /* @__PURE__ */ e.jsx(Dt, { title: S, disabled:
|
|
548
|
-
/* @__PURE__ */ e.jsx("label", { className: Ut({ disabled:
|
|
547
|
+
s && (S ? /* @__PURE__ */ e.jsx(Dt, { title: S, disabled: b, children: /* @__PURE__ */ e.jsx(s, { size: 24, className: Ie({ disabled: b, isSelected: l }) }) }) : /* @__PURE__ */ e.jsx(s, { size: 24, className: Ie({ disabled: b, isSelected: l }) })),
|
|
548
|
+
/* @__PURE__ */ e.jsx("label", { className: Ut({ disabled: b, isSelected: l }), children: r })
|
|
549
549
|
] }),
|
|
550
550
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-1 items-center", children: [
|
|
551
|
-
o && o ? /* @__PURE__ */ e.jsx(Qe, { count: o, maxCount: 9, className: "badge", disabled:
|
|
551
|
+
o && o ? /* @__PURE__ */ e.jsx(Qe, { count: o, maxCount: 9, className: "badge", disabled: b }) : "",
|
|
552
552
|
d && /* @__PURE__ */ e.jsx(
|
|
553
553
|
"div",
|
|
554
554
|
{
|
|
@@ -562,10 +562,10 @@ const Ft = "hover:bg-neutral-medium-hover", zt = Be("", {
|
|
|
562
562
|
children: /* @__PURE__ */ e.jsx(
|
|
563
563
|
"button",
|
|
564
564
|
{
|
|
565
|
-
disabled:
|
|
565
|
+
disabled: b,
|
|
566
566
|
type: "button",
|
|
567
567
|
onClick: f,
|
|
568
|
-
className: D("absolute cursor-pointer hover:text-primary-default-hover top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 p-2 z-100 select-none", Ie({ disabled:
|
|
568
|
+
className: D("absolute cursor-pointer hover:text-primary-default-hover top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 p-2 z-100 select-none", Ie({ disabled: b, isSelected: l }), b && "pointer-events-none"),
|
|
569
569
|
children: /* @__PURE__ */ e.jsx(At, {})
|
|
570
570
|
}
|
|
571
571
|
)
|
|
@@ -577,18 +577,18 @@ const Ft = "hover:bg-neutral-medium-hover", zt = Be("", {
|
|
|
577
577
|
"h-12 flex-1 flex items-center p-3 rounded-lg justify-between w-full",
|
|
578
578
|
"transition-all duration-300",
|
|
579
579
|
Ft,
|
|
580
|
-
zt({ isSelected: l, disabled:
|
|
580
|
+
zt({ isSelected: l, disabled: b }),
|
|
581
581
|
c
|
|
582
582
|
);
|
|
583
|
-
if (
|
|
583
|
+
if (m === "a") {
|
|
584
584
|
const V = {
|
|
585
585
|
onClick: k,
|
|
586
|
-
onAuxClick:
|
|
586
|
+
onAuxClick: p,
|
|
587
587
|
className: C
|
|
588
588
|
};
|
|
589
589
|
return /* @__PURE__ */ e.jsx("a", { ...V, children: y });
|
|
590
590
|
}
|
|
591
|
-
if (
|
|
591
|
+
if (m === "button") {
|
|
592
592
|
const V = {
|
|
593
593
|
onClick: k,
|
|
594
594
|
type: "button",
|
|
@@ -604,7 +604,7 @@ const Ft = "hover:bg-neutral-medium-hover", zt = Be("", {
|
|
|
604
604
|
}, Ue = M(Wt);
|
|
605
605
|
Ue.displayName = "NavigationDrawerItemBase";
|
|
606
606
|
const Ht = (t) => {
|
|
607
|
-
const { title: r, icon: s, count: o, className: c, isActive: l, onClick: d, isView: i = !0, disabled: f, tooltipText:
|
|
607
|
+
const { title: r, icon: s, count: o, className: c, isActive: l, onClick: d, isView: i = !0, disabled: f, tooltipText: m } = t;
|
|
608
608
|
return i ? /* @__PURE__ */ e.jsx(
|
|
609
609
|
Ue,
|
|
610
610
|
{
|
|
@@ -616,7 +616,7 @@ const Ht = (t) => {
|
|
|
616
616
|
isSelected: l,
|
|
617
617
|
onClick: d,
|
|
618
618
|
disabled: f,
|
|
619
|
-
tooltipText:
|
|
619
|
+
tooltipText: m
|
|
620
620
|
}
|
|
621
621
|
) : null;
|
|
622
622
|
}, it = M(Ht);
|
|
@@ -625,29 +625,29 @@ const Vt = ({ actions: t, activeActionId: r, onActionClick: s, className: o }) =
|
|
|
625
625
|
top: { type: "shadow", behavior: "scroll-on-hover", show: !0 },
|
|
626
626
|
bottom: { type: "shadow", behavior: "scroll-on-hover", show: !0 }
|
|
627
627
|
}, children: t?.map((c) => {
|
|
628
|
-
const { id: l, onClick: d, isView: i = !0, payload: f, ...
|
|
628
|
+
const { id: l, onClick: d, isView: i = !0, payload: f, ...m } = c, x = l === r, p = () => {
|
|
629
629
|
s?.(l, f), d?.();
|
|
630
630
|
};
|
|
631
631
|
return i ? /* @__PURE__ */ e.jsx(
|
|
632
632
|
it,
|
|
633
633
|
{
|
|
634
|
-
...
|
|
634
|
+
...m,
|
|
635
635
|
id: l,
|
|
636
636
|
isActive: x,
|
|
637
|
-
onClick:
|
|
637
|
+
onClick: p
|
|
638
638
|
},
|
|
639
639
|
l
|
|
640
640
|
) : null;
|
|
641
641
|
}) }), ct = M(Vt);
|
|
642
642
|
ct.displayName = "NavigationDrawerActions";
|
|
643
643
|
const qt = (t) => {
|
|
644
|
-
const { className: r, title: s, path: o, onClick: c, isSelected: l, parentPath: d } = t, i =
|
|
644
|
+
const { className: r, title: s, path: o, onClick: c, isSelected: l, parentPath: d } = t, i = h(() => {
|
|
645
645
|
c?.(o);
|
|
646
|
-
}, [o]), f =
|
|
646
|
+
}, [o]), f = h(() => {
|
|
647
647
|
if (o.startsWith("./")) {
|
|
648
648
|
if (!d) return;
|
|
649
|
-
const
|
|
650
|
-
window.open(
|
|
649
|
+
const m = d + o.slice(2);
|
|
650
|
+
window.open(m, "_blank");
|
|
651
651
|
} else
|
|
652
652
|
window.open(o, "_blank");
|
|
653
653
|
}, [o]);
|
|
@@ -674,14 +674,14 @@ const qt = (t) => {
|
|
|
674
674
|
}, dt = M(qt);
|
|
675
675
|
dt.displayName = "NavItemSecondary";
|
|
676
676
|
const $t = be((t, r) => {
|
|
677
|
-
const [s, o] = J(!0), c =
|
|
677
|
+
const [s, o] = J(!0), c = O(null), { path: l, title: d, icon: i, count: f, className: m, isSelected: x = !1, onClick: p, sublinks: b, toggleCollapse: S, getIsCollapsed: k, subscribeToCollapse: y, isView: C = !0, disabled: A, tooltipText: V } = t;
|
|
678
678
|
se(() => y ? y((_) => {
|
|
679
679
|
_ && o(!0);
|
|
680
680
|
}) : void 0, [y]);
|
|
681
|
-
const $ =
|
|
682
|
-
o((
|
|
683
|
-
}, []), j =
|
|
684
|
-
o(
|
|
681
|
+
const $ = h(() => {
|
|
682
|
+
o((E) => !E);
|
|
683
|
+
}, []), j = h((E) => {
|
|
684
|
+
o(E);
|
|
685
685
|
}, []), U = {
|
|
686
686
|
toggle: $,
|
|
687
687
|
setIsCollapsed: j,
|
|
@@ -695,34 +695,34 @@ const $t = be((t, r) => {
|
|
|
695
695
|
subscribeToCollapse: y
|
|
696
696
|
};
|
|
697
697
|
Re(r, () => U, [U, s, k, S]);
|
|
698
|
-
const N = i, K =
|
|
699
|
-
const
|
|
700
|
-
if (
|
|
698
|
+
const N = i, K = h(() => {
|
|
699
|
+
const E = k?.() ?? !1;
|
|
700
|
+
if (b && b.length > 0 && E) {
|
|
701
701
|
j(!1), S?.();
|
|
702
702
|
return;
|
|
703
703
|
}
|
|
704
|
-
|
|
705
|
-
}, [l,
|
|
704
|
+
p?.(l);
|
|
705
|
+
}, [l, p, b, S, j, k]), G = h(() => {
|
|
706
706
|
window.open(l, "_blank");
|
|
707
707
|
}, [l]), q = () => {
|
|
708
|
-
if (!
|
|
709
|
-
if (t.subLinksRender &&
|
|
710
|
-
return t.subLinksRender(
|
|
711
|
-
const
|
|
708
|
+
if (!b || A) return null;
|
|
709
|
+
if (t.subLinksRender && b)
|
|
710
|
+
return t.subLinksRender(b, U);
|
|
711
|
+
const E = h((_) => {
|
|
712
712
|
if (_.startsWith("./")) {
|
|
713
713
|
const g = l + _.slice(2);
|
|
714
|
-
|
|
714
|
+
p?.(g);
|
|
715
715
|
} else
|
|
716
|
-
|
|
716
|
+
p?.(_);
|
|
717
717
|
}, [l]);
|
|
718
718
|
return se(() => {
|
|
719
719
|
const _ = c.current;
|
|
720
720
|
if (!_) return;
|
|
721
721
|
const g = _.scrollHeight;
|
|
722
722
|
_.style.setProperty("--sublinks-max-height", `${g}px`);
|
|
723
|
-
}, []), /* @__PURE__ */ e.jsx("div", { ref: c, className: `sublinks flex flex-col gap-1 ml-8 ${s ? "collapsed" : "expanded"}`, children:
|
|
724
|
-
}, X = (
|
|
725
|
-
|
|
723
|
+
}, []), /* @__PURE__ */ e.jsx("div", { ref: c, className: `sublinks flex flex-col gap-1 ml-8 ${s ? "collapsed" : "expanded"}`, children: b.map((_) => /* @__PURE__ */ e.jsx(dt, { ..._, onClick: E, parentPath: l }, `${_.title}-${_.path}`)) });
|
|
724
|
+
}, X = (E) => {
|
|
725
|
+
E.stopPropagation(), E.preventDefault(), $();
|
|
726
726
|
};
|
|
727
727
|
return C ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2 ", children: [
|
|
728
728
|
/* @__PURE__ */ e.jsx(
|
|
@@ -732,9 +732,9 @@ const $t = be((t, r) => {
|
|
|
732
732
|
title: d,
|
|
733
733
|
icon: N,
|
|
734
734
|
count: f,
|
|
735
|
-
className:
|
|
735
|
+
className: m,
|
|
736
736
|
isSelected: x,
|
|
737
|
-
hasSublinks: !!
|
|
737
|
+
hasSublinks: !!b,
|
|
738
738
|
subLinksCollapsed: s,
|
|
739
739
|
onToggleSublinks: X,
|
|
740
740
|
onClick: K,
|
|
@@ -753,12 +753,12 @@ const Kt = ({ navlinks: t, handleNavigation: r, className: s, getIsCollapsed: o,
|
|
|
753
753
|
top: { type: "shadow", behavior: "scroll-on-hover", show: !0 },
|
|
754
754
|
bottom: { type: "shadow", behavior: "scroll-on-hover", show: !0 }
|
|
755
755
|
}, children: t?.map((i, f) => {
|
|
756
|
-
const
|
|
756
|
+
const m = i.isSelected || i.path === d || (i.relatedPaths?.some((x) => d.startsWith(x)) ?? !1);
|
|
757
757
|
return /* @__PURE__ */ e.jsx(
|
|
758
758
|
ut,
|
|
759
759
|
{
|
|
760
760
|
...i,
|
|
761
|
-
isSelected:
|
|
761
|
+
isSelected: m,
|
|
762
762
|
onClick: r,
|
|
763
763
|
toggleCollapse: c,
|
|
764
764
|
getIsCollapsed: o,
|
|
@@ -804,28 +804,28 @@ const Yt = (t) => {
|
|
|
804
804
|
const { sessions: r, onSessionClick: s, secondarySlot: o, subImageUrlAccessor: c } = t;
|
|
805
805
|
if (!r || r.length === 0)
|
|
806
806
|
return null;
|
|
807
|
-
const l = (f) => {
|
|
808
|
-
s && s(f);
|
|
807
|
+
const l = (f, m) => {
|
|
808
|
+
s && m && s(f, m);
|
|
809
809
|
}, d = (f) => {
|
|
810
810
|
if (!c)
|
|
811
811
|
return;
|
|
812
|
-
const
|
|
813
|
-
if (!
|
|
812
|
+
const m = f.metadata;
|
|
813
|
+
if (!m)
|
|
814
814
|
return;
|
|
815
|
-
const x = je({ metadata:
|
|
815
|
+
const x = je({ metadata: m }, c);
|
|
816
816
|
if (x != null)
|
|
817
817
|
return typeof x == "string" ? x : String(x);
|
|
818
|
-
}, i =
|
|
818
|
+
}, i = h((f) => typeof o == "function" ? o(f) : o, [o]);
|
|
819
819
|
return /* @__PURE__ */ e.jsx("div", { className: "w-full h-full flex flex-col gap-2", children: r?.map((f) => {
|
|
820
|
-
const { auth_id:
|
|
821
|
-
return /* @__PURE__ */ e.jsx(ie, { className: " shrink-0 h-max", children: /* @__PURE__ */ e.jsx(ie.Content, { onClick: () => l(f), className: "p-0 group-data-[expanded=true]/ticketcard:border-none", children: /* @__PURE__ */ e.jsx(
|
|
820
|
+
const { auth_id: m } = f;
|
|
821
|
+
return /* @__PURE__ */ e.jsx(ie, { className: " shrink-0 h-max", children: /* @__PURE__ */ e.jsx(ie.Content, { onClick: () => l(f, t.userOptionsControls), className: "p-0 group-data-[expanded=true]/ticketcard:border-none", children: /* @__PURE__ */ e.jsx(
|
|
822
822
|
Ze,
|
|
823
823
|
{
|
|
824
|
-
name:
|
|
824
|
+
name: m.name,
|
|
825
825
|
avatarSize: "xxs",
|
|
826
826
|
secondarySlot: i(f),
|
|
827
827
|
subImageUrl: d(f),
|
|
828
|
-
imageUrl:
|
|
828
|
+
imageUrl: m.profile_picture,
|
|
829
829
|
className: "pyrion-navigation-drawer-user-card"
|
|
830
830
|
},
|
|
831
831
|
f.token
|
|
@@ -841,18 +841,18 @@ const Yt = (t) => {
|
|
|
841
841
|
onProfileClick: d,
|
|
842
842
|
options: i,
|
|
843
843
|
currentSystemId: f,
|
|
844
|
-
userOptionsControls:
|
|
844
|
+
userOptionsControls: m,
|
|
845
845
|
mobileAppSwitcherControls: x
|
|
846
846
|
}) => {
|
|
847
|
-
const { getIsCollapsed:
|
|
848
|
-
const y =
|
|
849
|
-
y ? (
|
|
850
|
-
}, [
|
|
847
|
+
const { getIsCollapsed: p, toggleCollapse: b, subscribeToCollapse: S } = ce(), k = h(() => {
|
|
848
|
+
const y = p();
|
|
849
|
+
y ? (b(), m.current?.open()) : d?.(y);
|
|
850
|
+
}, [p, b, m, d]);
|
|
851
851
|
return se(() => S((y) => {
|
|
852
|
-
y && (
|
|
853
|
-
}), [S,
|
|
852
|
+
y && (m.current?.close(), x.current?.close());
|
|
853
|
+
}), [S, m, x]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
854
854
|
/* @__PURE__ */ e.jsx(re.Spacer, { className: "mb-3" }),
|
|
855
|
-
/* @__PURE__ */ e.jsxs(ie, { className: "", controls:
|
|
855
|
+
/* @__PURE__ */ e.jsxs(ie, { className: "", controls: m, children: [
|
|
856
856
|
/* @__PURE__ */ e.jsx(ie.Content, { onClick: k, children: /* @__PURE__ */ e.jsx(
|
|
857
857
|
Ze,
|
|
858
858
|
{
|
|
@@ -868,14 +868,15 @@ const Yt = (t) => {
|
|
|
868
868
|
/* @__PURE__ */ e.jsxs(ie.Options, { className: "min-h-max flex flex-col gap-3 pl-3 mt-3 pt-2", children: [
|
|
869
869
|
r && r.length > 0 && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
870
870
|
/* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-label-medium text-neutral-medium-default select-none", children: "Cambiar cuenta" }),
|
|
871
|
-
/* @__PURE__ */ e.jsx(xe, { className: "flex flex-col gap-2 max-h-[165px] flex-1", scrollbarProps: { hide: !0 }, children: /* @__PURE__ */ e.jsx(
|
|
871
|
+
/* @__PURE__ */ e.jsx(xe, { className: "flex flex-col gap-2 max-h-[165px] flex-1", scrollbarProps: { hide: !0 }, indicators: { bottom: { show: !0, type: "shadow", behavior: "scroll-on-hover" }, top: { show: !0, type: "shadow", behavior: "scroll-on-hover" } }, children: /* @__PURE__ */ e.jsx(
|
|
872
872
|
Yt,
|
|
873
873
|
{
|
|
874
874
|
sessions: r,
|
|
875
875
|
onSessionClick: c,
|
|
876
876
|
secondarySlot: o,
|
|
877
877
|
subImageUrlAccessor: i?.sessionCardOptions?.subImageUrlAccessor,
|
|
878
|
-
currentSystemId: f
|
|
878
|
+
currentSystemId: f,
|
|
879
|
+
userOptionsControls: m
|
|
879
880
|
}
|
|
880
881
|
) })
|
|
881
882
|
] }),
|
|
@@ -942,7 +943,7 @@ const Jt = ({ tabs: t, content: r, controls: s }) => /* @__PURE__ */ e.jsxs(ie,
|
|
|
942
943
|
/* @__PURE__ */ e.jsx("div", {})
|
|
943
944
|
] })
|
|
944
945
|
] }), Pe = M(({ enabled_systems: t, onClick: r, currentSystemId: s }) => {
|
|
945
|
-
const o =
|
|
946
|
+
const o = h(() => {
|
|
946
947
|
if (t) {
|
|
947
948
|
if (s) {
|
|
948
949
|
const i = t.find((f) => f._id === s);
|
|
@@ -978,7 +979,7 @@ const Jt = ({ tabs: t, content: r, controls: s }) => /* @__PURE__ */ e.jsxs(ie,
|
|
|
978
979
|
}, (t, r) => t.enabled_systems === r.enabled_systems && t.onClick === r.onClick && t.currentSystemId === r.currentSystemId);
|
|
979
980
|
Pe.displayName = "PyrionNavigationDrawer.SystemLogo";
|
|
980
981
|
const ht = M(({ onSystemLogoClick: t, state: r, currentSystemId: s, tabs: o, mobileAppSwitcherControls: c }) => {
|
|
981
|
-
const { getIsCollapsed: l } = ce(), d = Je(), i =
|
|
982
|
+
const { getIsCollapsed: l } = ce(), d = Je(), i = h(() => {
|
|
982
983
|
if (t) {
|
|
983
984
|
const f = l();
|
|
984
985
|
t(f);
|
|
@@ -1018,34 +1019,34 @@ const Xe = ({ type: t }) => {
|
|
|
1018
1019
|
] }),
|
|
1019
1020
|
/* @__PURE__ */ e.jsx(pe, { shape: "rounded", className: "w-20 h-3" })
|
|
1020
1021
|
] }), Qt = ({ onCloseClick: t, onMarkAllAsRead: r, notificationsListControls: s, scrollableControls: o }) => {
|
|
1021
|
-
const [c, l] = J([]), [d, i] = J("NO_LEIDAS"), [f,
|
|
1022
|
+
const [c, l] = J([]), [d, i] = J("NO_LEIDAS"), [f, m] = J({ isLoading: !1, type: "load_more" }), [x, p] = J({ hasError: !1 }), b = O(/* @__PURE__ */ new Set()), S = O(null), k = O(null), y = h((g, P = "top") => {
|
|
1022
1023
|
l((R) => {
|
|
1023
1024
|
const z = Array.isArray(g) ? P === "bottom" ? [...R, ...g] : [...g, ...R] : P === "bottom" ? [...R, g] : [g, ...R];
|
|
1024
1025
|
return queueMicrotask(() => {
|
|
1025
|
-
|
|
1026
|
+
b.current.forEach((Q) => Q(z, z.length));
|
|
1026
1027
|
}), z;
|
|
1027
1028
|
});
|
|
1028
|
-
}, []), C =
|
|
1029
|
-
|
|
1030
|
-
}), []), A =
|
|
1029
|
+
}, []), C = h((g) => (b.current.add(g), () => {
|
|
1030
|
+
b.current.delete(g);
|
|
1031
|
+
}), []), A = h((g) => {
|
|
1031
1032
|
l((P) => {
|
|
1032
1033
|
const R = Array.isArray(g) ? P.filter((z) => !g.includes(z._id)) : P.filter((z) => z._id !== g);
|
|
1033
1034
|
return queueMicrotask(() => {
|
|
1034
|
-
|
|
1035
|
+
b.current.forEach((z) => z(R, R.length));
|
|
1035
1036
|
}), R;
|
|
1036
1037
|
});
|
|
1037
|
-
}, []), V =
|
|
1038
|
+
}, []), V = h(() => {
|
|
1038
1039
|
l([]), queueMicrotask(() => {
|
|
1039
|
-
|
|
1040
|
+
b.current.forEach((g) => g([], 0));
|
|
1040
1041
|
});
|
|
1041
|
-
}, []), $ =
|
|
1042
|
+
}, []), $ = h((g) => {
|
|
1042
1043
|
l(g), queueMicrotask(() => {
|
|
1043
|
-
|
|
1044
|
+
b.current.forEach((P) => P(g, g.length));
|
|
1044
1045
|
});
|
|
1045
|
-
}, []), j =
|
|
1046
|
-
|
|
1047
|
-
}, []), U =
|
|
1048
|
-
|
|
1046
|
+
}, []), j = h((g, P = "load_more") => {
|
|
1047
|
+
m({ isLoading: g, type: P });
|
|
1048
|
+
}, []), U = h((g, P) => {
|
|
1049
|
+
p({ hasError: g, children: P });
|
|
1049
1050
|
}, []);
|
|
1050
1051
|
Re(s, () => ({
|
|
1051
1052
|
addNewNotification: y,
|
|
@@ -1065,8 +1066,8 @@ const Xe = ({ type: t }) => {
|
|
|
1065
1066
|
k.current.style.setProperty("height", `calc(100vh - ${g}px - 20px)`);
|
|
1066
1067
|
}
|
|
1067
1068
|
}, [S?.current]);
|
|
1068
|
-
const G = c.filter((g) => !g.read).length, { isLoading: q, type: X } = f, { hasError:
|
|
1069
|
-
return
|
|
1069
|
+
const G = c.filter((g) => !g.read).length, { isLoading: q, type: X } = f, { hasError: E, children: _ } = x;
|
|
1070
|
+
return /* @__PURE__ */ e.jsx(
|
|
1070
1071
|
"section",
|
|
1071
1072
|
{
|
|
1072
1073
|
className: "w-full md:w-[479px] bg-neutral-default-default flex flex-col border-l-0 md:border-l border-neutral-strong-default min-h-full h-full max-h-full overflow-hidden",
|
|
@@ -1108,7 +1109,7 @@ const Xe = ({ type: t }) => {
|
|
|
1108
1109
|
] })
|
|
1109
1110
|
}
|
|
1110
1111
|
),
|
|
1111
|
-
r && K && d === "NO_LEIDAS" && !
|
|
1112
|
+
r && K && d === "NO_LEIDAS" && !E && /* @__PURE__ */ e.jsx("div", { className: "flex justify-end px-4", children: /* @__PURE__ */ e.jsx(he, { disabled: q, onClick: r, label: "Marcar todas como leidas", variant: "text", animate: !1, animateIcon: !1, size: "small" }) })
|
|
1112
1113
|
] }),
|
|
1113
1114
|
/* @__PURE__ */ e.jsx("div", { ref: k, className: "", children: /* @__PURE__ */ e.jsxs(
|
|
1114
1115
|
xe,
|
|
@@ -1127,8 +1128,8 @@ const Xe = ({ type: t }) => {
|
|
|
1127
1128
|
isLoading: q
|
|
1128
1129
|
},
|
|
1129
1130
|
children: [
|
|
1130
|
-
|
|
1131
|
-
!
|
|
1131
|
+
E && /* @__PURE__ */ e.jsx("div", { className: "w-full h-full grid place-items-center", children: typeof _ == "function" ? _() : _ }),
|
|
1132
|
+
!E && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1132
1133
|
q && X === "skeletons" ? /* @__PURE__ */ e.jsx(Xe, { type: X }) : K ? c?.filter((g) => d === "NO_LEIDAS" ? !g.read : g)?.map((g, P) => /* @__PURE__ */ e.jsx(Ot, { ...g, className: " border-b border-neutral-strong-default rounded-b-none last:border-b-0" }, P)) : /* @__PURE__ */ e.jsx("p", { className: "flex-1 grid place-items-center prometeo-fonts-headline-xsmall text-neutral-default-default text-center py-8 text-balance", children: "No tienes notificaciones nuevas por el momento" }),
|
|
1133
1134
|
q && X === "load_more" && /* @__PURE__ */ e.jsx(Xe, { type: X })
|
|
1134
1135
|
] })
|
|
@@ -1158,20 +1159,20 @@ const Xe = ({ type: t }) => {
|
|
|
1158
1159
|
Re(d, () => ({
|
|
1159
1160
|
setActiveSection: f
|
|
1160
1161
|
}));
|
|
1161
|
-
const
|
|
1162
|
+
const m = () => {
|
|
1162
1163
|
t();
|
|
1163
1164
|
};
|
|
1164
1165
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1165
1166
|
i === "notifications" && !r?.notificationsDrawerOptions?.hide && /* @__PURE__ */ e.jsx(
|
|
1166
1167
|
Qt,
|
|
1167
1168
|
{
|
|
1168
|
-
onCloseClick:
|
|
1169
|
+
onCloseClick: m,
|
|
1169
1170
|
onMarkAllAsRead: r?.notificationsDrawerOptions?.onMarkAllAsRead,
|
|
1170
1171
|
notificationsListControls: c,
|
|
1171
1172
|
scrollableControls: l
|
|
1172
1173
|
}
|
|
1173
1174
|
),
|
|
1174
|
-
i === "help" && s && !r?.helpSectionDrawerOptions?.hide && /* @__PURE__ */ e.jsx(Zt, { onCloseClick:
|
|
1175
|
+
i === "help" && s && !r?.helpSectionDrawerOptions?.hide && /* @__PURE__ */ e.jsx(Zt, { onCloseClick: m, children: typeof s == "function" ? s() : s })
|
|
1175
1176
|
] });
|
|
1176
1177
|
}, bt = be(er);
|
|
1177
1178
|
bt.displayName = "SidebarContent";
|
|
@@ -1202,7 +1203,7 @@ const rr = ({ navigationControlsRef: t }) => {
|
|
|
1202
1203
|
const r = ce();
|
|
1203
1204
|
return t.current.toggleCollapse = r.toggleCollapse, t.current.getIsCollapsed = r.getIsCollapsed, t.current.subscribeToCollapse = r.subscribeToCollapse, t.current.openSidebar = r.openSidebar, t.current.closeSidebar = r.closeSidebar, t.current.toggleSidebar = r.toggleSidebar, t.current.getIsSidebarOpen = r.getIsSidebarOpen, t.current.subscribeToSidebarOpen = r.subscribeToSidebarOpen, t.current.setDrawerDragEnabled = r.setDrawerDragEnabled, t.current.setSidebarDragEnabled = r.setSidebarDragEnabled, null;
|
|
1204
1205
|
}, sr = (t) => {
|
|
1205
|
-
const { children: r, currentAppSessions: s, resolveUserSecondarySlot: o, resolveSessionSecondarySlot: c, handleNavigation: l, allActions: d, tabs: i, navigationControlsRef: f, sidebarContentRef:
|
|
1206
|
+
const { children: r, currentAppSessions: s, resolveUserSecondarySlot: o, resolveSessionSecondarySlot: c, handleNavigation: l, allActions: d, tabs: i, navigationControlsRef: f, sidebarContentRef: m, initialSectionRef: x, userOptionsControls: p, mobileAppSwitcherControls: b, notificationsListControls: S, scrollableControls: k, outletRef: y, ...C } = t;
|
|
1206
1207
|
return /* @__PURE__ */ e.jsxs(re, { disableDragOpen: C.options?.disableDragOpen, outletRef: y, children: [
|
|
1207
1208
|
/* @__PURE__ */ e.jsx(rr, { navigationControlsRef: f }),
|
|
1208
1209
|
/* @__PURE__ */ e.jsx(re.Header, { className: "flex flex-col relative w-full select-none", children: /* @__PURE__ */ e.jsx(
|
|
@@ -1212,7 +1213,7 @@ const rr = ({ navigationControlsRef: t }) => {
|
|
|
1212
1213
|
state: C.state,
|
|
1213
1214
|
currentSystemId: C.currentSystemId,
|
|
1214
1215
|
tabs: i,
|
|
1215
|
-
mobileAppSwitcherControls:
|
|
1216
|
+
mobileAppSwitcherControls: b
|
|
1216
1217
|
}
|
|
1217
1218
|
) }, "PL-Header"),
|
|
1218
1219
|
/* @__PURE__ */ e.jsx(re.Content, { className: "overflow-hidden flex flex-col relative flex-1 md:w-auto", children: /* @__PURE__ */ e.jsx(
|
|
@@ -1236,8 +1237,8 @@ const rr = ({ navigationControlsRef: t }) => {
|
|
|
1236
1237
|
onLogoutClick: C.onLogoutClick,
|
|
1237
1238
|
options: C.options,
|
|
1238
1239
|
currentSystemId: C.currentSystemId,
|
|
1239
|
-
userOptionsControls:
|
|
1240
|
-
mobileAppSwitcherControls:
|
|
1240
|
+
userOptionsControls: p,
|
|
1241
|
+
mobileAppSwitcherControls: b,
|
|
1241
1242
|
onProfileClick: C.onProfileClick
|
|
1242
1243
|
}
|
|
1243
1244
|
) }, "PL-Footer"),
|
|
@@ -1253,7 +1254,7 @@ const rr = ({ navigationControlsRef: t }) => {
|
|
|
1253
1254
|
{
|
|
1254
1255
|
options: C.options,
|
|
1255
1256
|
helpSection: C.helpSection,
|
|
1256
|
-
sidebarContentRef:
|
|
1257
|
+
sidebarContentRef: m,
|
|
1257
1258
|
initialSectionRef: x,
|
|
1258
1259
|
notificationsListControls: S,
|
|
1259
1260
|
scrollableControls: k
|
|
@@ -1269,8 +1270,8 @@ const rr = ({ navigationControlsRef: t }) => {
|
|
|
1269
1270
|
for (const f of d) {
|
|
1270
1271
|
if (!Object.prototype.hasOwnProperty.call(l, f))
|
|
1271
1272
|
return !1;
|
|
1272
|
-
const
|
|
1273
|
-
if (
|
|
1273
|
+
const m = o[f], x = l[f];
|
|
1274
|
+
if (m !== x)
|
|
1274
1275
|
return !1;
|
|
1275
1276
|
}
|
|
1276
1277
|
return !0;
|
|
@@ -1283,14 +1284,14 @@ const wt = Me(null), Dr = () => {
|
|
|
1283
1284
|
if (!t)
|
|
1284
1285
|
throw new Error("usePyrionLayout debe usarse dentro de PyrionLayout");
|
|
1285
1286
|
return t;
|
|
1286
|
-
}, Ar = ({ children: t, helpSection: r, state: s, links: o, onLinkClick: c, onNavigate: l, onLogoutClick: d, actions: i, activeActionId: f, onActionClick:
|
|
1287
|
+
}, Ar = ({ children: t, helpSection: r, state: s, links: o, onLinkClick: c, onNavigate: l, onLogoutClick: d, actions: i, activeActionId: f, onActionClick: m, tabsProps: x, currentSystemId: p, onSessionClick: b, onSystemLogoClick: S, onProfileClick: k, ...y }) => {
|
|
1287
1288
|
const A = Object.assign({
|
|
1288
1289
|
closeDrawerOnNavigate: !0,
|
|
1289
1290
|
disableDragOpen: {
|
|
1290
1291
|
sidebar: !0,
|
|
1291
1292
|
drawer: !1
|
|
1292
1293
|
}
|
|
1293
|
-
}, y.options), V = kt(), $ = Je(), j =
|
|
1294
|
+
}, y.options), V = kt(), $ = Je(), j = O(null), U = O(null), N = O({}), K = O(null), G = O("notifications"), q = O(null), X = O(null), E = O(null), [_, g] = J(0), [P, R] = J(!1), [z, Q] = J(null), ae = h((a) => {
|
|
1294
1295
|
if (R(!1), c) {
|
|
1295
1296
|
c(a);
|
|
1296
1297
|
return;
|
|
@@ -1310,19 +1311,19 @@ const wt = Me(null), Dr = () => {
|
|
|
1310
1311
|
mobile: Z,
|
|
1311
1312
|
desktop: Z
|
|
1312
1313
|
}
|
|
1313
|
-
}, Ae =
|
|
1314
|
+
}, Ae = h((a) => {
|
|
1314
1315
|
const w = $ ? "mobile" : "desktop", F = s.enabled_systems.find((T) => T.name === a)?.url;
|
|
1315
1316
|
we.system[w](F), x?.onTabClick?.(a);
|
|
1316
|
-
}, [$, s.enabled_systems, x?.onTabClick]), We =
|
|
1317
|
+
}, [$, s.enabled_systems, x?.onTabClick]), We = h((a) => {
|
|
1317
1318
|
const w = $ ? "mobile" : "desktop", F = s.company.products?.find((T) => T.name === a)?.domain;
|
|
1318
1319
|
we.product[w](F), x?.onTabClick?.(a);
|
|
1319
|
-
}, [$, s.company.products, x?.onTabClick]), de =
|
|
1320
|
+
}, [$, s.company.products, x?.onTabClick]), de = h((a, w) => {
|
|
1320
1321
|
if (w) {
|
|
1321
1322
|
w(a), x?.onTabClick?.(a);
|
|
1322
1323
|
return;
|
|
1323
1324
|
} else
|
|
1324
1325
|
x?.onTabClick?.(a);
|
|
1325
|
-
}, [x?.onTabClick]), He =
|
|
1326
|
+
}, [x?.onTabClick]), He = h(() => {
|
|
1326
1327
|
const a = {};
|
|
1327
1328
|
s.enabled_systems.forEach((F) => {
|
|
1328
1329
|
a[F.url] = F.name;
|
|
@@ -1335,7 +1336,7 @@ const wt = Me(null), Dr = () => {
|
|
|
1335
1336
|
}, [s.enabled_systems]), Te = x?.currentTabName || He(), Oe = me(
|
|
1336
1337
|
() => s.sessions || [],
|
|
1337
1338
|
[s.sessions]
|
|
1338
|
-
), ee = (a) => a == null ? null : typeof a == "string" || typeof a == "number" || typeof a == "boolean" ? String(a) : ke(a) ? a : typeof a == "object" ? JSON.stringify(a) : null, ue =
|
|
1339
|
+
), ee = (a) => a == null ? null : typeof a == "string" || typeof a == "number" || typeof a == "boolean" ? String(a) : ke(a) ? a : typeof a == "object" ? JSON.stringify(a) : null, ue = h((a, w) => {
|
|
1339
1340
|
if (!a) return null;
|
|
1340
1341
|
if (Array.isArray(a)) {
|
|
1341
1342
|
const F = a?.[0] ? je(w, a[0]) : null, T = a?.[1] ? je(w, a[1]) : null, ne = ee(F), Ve = ee(T);
|
|
@@ -1352,22 +1353,22 @@ const wt = Me(null), Dr = () => {
|
|
|
1352
1353
|
return ee(F);
|
|
1353
1354
|
}
|
|
1354
1355
|
return typeof a == "function" ? ee(a(w)) : null;
|
|
1355
|
-
}, []), n =
|
|
1356
|
+
}, []), n = h(
|
|
1356
1357
|
(a) => {
|
|
1357
1358
|
const w = A?.userCardOptions?.secondarySlot;
|
|
1358
1359
|
if (!w) return null;
|
|
1359
|
-
const F = s.enabled_systems?.find((ne) => ne._id ===
|
|
1360
|
+
const F = s.enabled_systems?.find((ne) => ne._id === p), T = { company: s.company, user: s.user, system: F, metadata: a };
|
|
1360
1361
|
return ue(w, T);
|
|
1361
1362
|
},
|
|
1362
|
-
[
|
|
1363
|
-
), u =
|
|
1363
|
+
[p, A?.userCardOptions?.secondarySlot, ue, s.company, s.enabled_systems, s.user]
|
|
1364
|
+
), u = h(
|
|
1364
1365
|
(a) => {
|
|
1365
1366
|
const w = A?.sessionCardOptions?.secondarySlot || A?.userCardOptions?.secondarySlot;
|
|
1366
1367
|
if (!w) return null;
|
|
1367
|
-
const F = s.enabled_systems?.find((ne) => ne._id ===
|
|
1368
|
+
const F = s.enabled_systems?.find((ne) => ne._id === p), T = { company: s.company, user: a.auth_id, metadata: a?.metadata, system: F };
|
|
1368
1369
|
return ue(w, T);
|
|
1369
1370
|
},
|
|
1370
|
-
[
|
|
1371
|
+
[p, A?.sessionCardOptions?.secondarySlot, A?.userCardOptions?.secondarySlot, ue, s.company, s.enabled_systems]
|
|
1371
1372
|
), v = me(() => {
|
|
1372
1373
|
const a = [];
|
|
1373
1374
|
return N.current.openNotifications = () => {
|
|
@@ -1391,7 +1392,7 @@ const wt = Me(null), Dr = () => {
|
|
|
1391
1392
|
icon: _t,
|
|
1392
1393
|
onClick: A.configurationActionOptions?.onClick
|
|
1393
1394
|
}), a;
|
|
1394
|
-
}, [A, r,
|
|
1395
|
+
}, [A, r, m, _]), I = me(
|
|
1395
1396
|
() => [...v, ...i || []],
|
|
1396
1397
|
[v, i]
|
|
1397
1398
|
), W = me(() => {
|
|
@@ -1409,34 +1410,34 @@ const wt = Me(null), Dr = () => {
|
|
|
1409
1410
|
onClick: We
|
|
1410
1411
|
})) || [];
|
|
1411
1412
|
return [...a, ...w, ...F];
|
|
1412
|
-
}, [s.enabled_systems, s.company.products, x?.customTabs]), B =
|
|
1413
|
+
}, [s.enabled_systems, s.company.products, x?.customTabs]), B = h((a, w) => {
|
|
1413
1414
|
j.current?.addNewNotification ? j.current.addNewNotification(a, w) : console.warn("Notifications controls not ready yet");
|
|
1414
|
-
}, []), te =
|
|
1415
|
-
}), []), oe =
|
|
1415
|
+
}, []), te = h((a) => j.current?.subscribeToUpdates ? j.current.subscribeToUpdates(a) : (console.warn("Notifications controls not ready yet"), () => {
|
|
1416
|
+
}), []), oe = h((a) => {
|
|
1416
1417
|
j.current?.removeNotification ? j.current.removeNotification(a) : console.warn("Notifications controls not ready yet");
|
|
1417
|
-
}, []), fe =
|
|
1418
|
+
}, []), fe = h(() => {
|
|
1418
1419
|
j.current?.removeAllNotifications ? j.current.removeAllNotifications() : console.warn("Notifications controls not ready yet");
|
|
1419
|
-
}, []), Ne =
|
|
1420
|
+
}, []), Ne = h((a) => {
|
|
1420
1421
|
j.current?.setNotifications ? j.current.setNotifications(a) : console.warn("Notifications controls not ready yet");
|
|
1421
|
-
}, []), ye =
|
|
1422
|
-
}), []), L =
|
|
1422
|
+
}, []), ye = h((a, w) => U.current?.subscribeToScrollTarget ? U.current.subscribeToScrollTarget(a, w) : (console.warn("Scrollable controls not ready yet"), () => {
|
|
1423
|
+
}), []), L = h((a, w = "load_more") => {
|
|
1423
1424
|
j.current?.setLoading ? j.current.setLoading(a, w) : console.warn("Notifications controls not ready yet");
|
|
1424
|
-
}, []), Y =
|
|
1425
|
+
}, []), Y = h((a, w) => {
|
|
1425
1426
|
j.current?.setError ? j.current.setError(a, w) : console.warn("Notifications controls not ready yet");
|
|
1426
|
-
}, []), H =
|
|
1427
|
+
}, []), H = h(() => {
|
|
1427
1428
|
q.current?.open();
|
|
1428
|
-
}, []), le =
|
|
1429
|
+
}, []), le = h(() => {
|
|
1429
1430
|
q.current?.close();
|
|
1430
|
-
}, []), Ee =
|
|
1431
|
+
}, []), Ee = h(() => {
|
|
1431
1432
|
q.current?.toggle();
|
|
1432
|
-
}, []), Ce =
|
|
1433
|
+
}, []), Ce = h((a, w, F) => {
|
|
1433
1434
|
const T = /* @__PURE__ */ e.jsxs("div", { className: D(" bg-black/60 z-200 inset-0 h-full w-full grid place-items-center text-neutral-default-default", w ? "fixed" : "sticky"), children: [
|
|
1434
1435
|
!F && /* @__PURE__ */ e.jsx(he, { label: "", icon: /* @__PURE__ */ e.jsx(Fe, {}), onClick: () => R(!1), variant: "text", className: "absolute top-0 right-0", size: "small", color: "secondary" }),
|
|
1435
1436
|
typeof a == "function" ? a() : a
|
|
1436
1437
|
] });
|
|
1437
1438
|
let ne;
|
|
1438
|
-
return w ? ne = $e(T, document.body, `modal-error-${Date.now()}`) :
|
|
1439
|
-
}, [
|
|
1439
|
+
return w ? ne = $e(T, document.body, `modal-error-${Date.now()}`) : E.current && (ne = $e(T, E.current, `modal-error-${Date.now()}`)), Q(ne), R(!0), T;
|
|
1440
|
+
}, [E]), Se = h(() => {
|
|
1440
1441
|
R(!1);
|
|
1441
1442
|
}, []);
|
|
1442
1443
|
return N.current.addNewNotification = B, N.current.subscribeToNotificationsUpdates = te, N.current.removeNotification = oe, N.current.removeAllNotifications = fe, N.current.setNotifications = Ne, N.current.setNotificationsError = Y, N.current.setNotificationsLoading = L, N.current.subscribeToNotificationsScroll = ye, N.current.showErrorModal = Ce, N.current.closeErrorModal = Se, N.current.userCardExpand = H, N.current.userCardCollapse = le, N.current.userCardToggle = Ee, se(() => {
|
|
@@ -1453,7 +1454,7 @@ const wt = Me(null), Dr = () => {
|
|
|
1453
1454
|
tabs: W,
|
|
1454
1455
|
activeColor: "var(--neutral-900)",
|
|
1455
1456
|
currentTabName: Te,
|
|
1456
|
-
currentSystemId:
|
|
1457
|
+
currentSystemId: p,
|
|
1457
1458
|
isLoading: !s.enabled_systems || s.enabled_systems.length === 0
|
|
1458
1459
|
}
|
|
1459
1460
|
),
|
|
@@ -1464,15 +1465,15 @@ const wt = Me(null), Dr = () => {
|
|
|
1464
1465
|
handleNavigation: ae,
|
|
1465
1466
|
allActions: I,
|
|
1466
1467
|
activeActionId: f,
|
|
1467
|
-
onActionClick:
|
|
1468
|
+
onActionClick: m,
|
|
1468
1469
|
state: s,
|
|
1469
1470
|
currentAppSessions: Oe,
|
|
1470
1471
|
resolveUserSecondarySlot: n,
|
|
1471
1472
|
resolveSessionSecondarySlot: u,
|
|
1472
|
-
onSessionClick:
|
|
1473
|
+
onSessionClick: b,
|
|
1473
1474
|
onLogoutClick: d,
|
|
1474
1475
|
options: A,
|
|
1475
|
-
currentSystemId:
|
|
1476
|
+
currentSystemId: p,
|
|
1476
1477
|
userOptionsControls: q,
|
|
1477
1478
|
mobileAppSwitcherControls: X,
|
|
1478
1479
|
onSystemLogoClick: S,
|
|
@@ -1483,7 +1484,7 @@ const wt = Me(null), Dr = () => {
|
|
|
1483
1484
|
navigationControlsRef: N,
|
|
1484
1485
|
notificationsListControls: j,
|
|
1485
1486
|
scrollableControls: U,
|
|
1486
|
-
outletRef:
|
|
1487
|
+
outletRef: E,
|
|
1487
1488
|
onProfileClick: k,
|
|
1488
1489
|
children: t
|
|
1489
1490
|
}
|