prometeo-design-system 4.7.8 → 4.8.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/PyrionLayout.es.js +85 -85
- package/package.json +1 -1
package/dist/PyrionLayout.es.js
CHANGED
|
@@ -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 = O(null), { tabs: l = [], className: d, activeColor: i = "var(--neutral-900)", currentSystemId: f, isLoading:
|
|
27
|
-
console.log("tabs en el tabswitch del layout", l), 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: p = !1 } = t;
|
|
27
|
+
console.log("tabs en el tabswitch del layout", l, f), se(() => {
|
|
28
28
|
c.current?.style.setProperty("--tab-bg", i);
|
|
29
29
|
}, [i]);
|
|
30
|
-
const x = l.find((
|
|
30
|
+
const x = l.find((m) => m?.id === f || m?.name === t?.currentTabName) || l.find((m) => m?.name === 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: (p ? Array(3).fill(null) : l).map(
|
|
44
|
+
(m, b) => {
|
|
45
|
+
if (p) return /* @__PURE__ */ e.jsx(
|
|
46
46
|
"div",
|
|
47
47
|
{
|
|
48
48
|
className: D(
|
|
@@ -58,12 +58,12 @@ const Pt = be((t, r) => {
|
|
|
58
58
|
"grid place-items-center",
|
|
59
59
|
"tab-thumbnail-icon",
|
|
60
60
|
"bg-transparent text-neutral-default-default",
|
|
61
|
-
|
|
61
|
+
m?.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 = m?.name === x?.name, k = typeof m?.thumbnail == "string" ? /* @__PURE__ */ e.jsx("img", { src: m?.thumbnail, alt: m?.description, className: "aspect-square object-contain rounded", draggable: !1 }) : m?.thumbnail, y = () => {
|
|
66
|
+
m.disabled || (o(m?.name), m.onClick && m.onClick(m?.name));
|
|
67
67
|
};
|
|
68
68
|
return /* @__PURE__ */ e.jsx(
|
|
69
69
|
"div",
|
|
@@ -83,17 +83,17 @@ 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
|
+
m?.className
|
|
87
87
|
), children: k })
|
|
88
88
|
},
|
|
89
|
-
|
|
89
|
+
m?.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: p } = Mt(), { closeSidebar: x } = ce(), [m, b] = J(() => l ? p : !0), [S, k] = J(!1);
|
|
97
97
|
return se(() => {
|
|
98
98
|
l && s?.subscribeToSidebarOpen((y) => {
|
|
99
99
|
y ? (k(!1), b(!0)) : k(!0);
|
|
@@ -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
|
+
m && i
|
|
122
122
|
] })
|
|
123
123
|
] });
|
|
124
124
|
})), st = Me(null), nt = Me(null), Mt = () => {
|
|
@@ -144,7 +144,7 @@ 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 = O(null), f = O(null),
|
|
147
|
+
const { children: r, classNameDrawer: s, classNameSidebar: o, disableDragOpen: c, modal: l = !0, closeOnOutsideClick: d = !0 } = t, i = O(null), f = O(null), p = t.outletRef ?? O(null), x = O(null), m = 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) => {
|
|
@@ -155,8 +155,8 @@ const Pt = be((t, r) => {
|
|
|
155
155
|
v && (v.classList.toggle("sidebar-collapsed", n), v.classList.toggle("sidebar-expanded", !n));
|
|
156
156
|
}, []), j = h(
|
|
157
157
|
(n, { notify: u = !0 } = {}) => {
|
|
158
|
-
const v =
|
|
159
|
-
|
|
158
|
+
const v = m.current !== n;
|
|
159
|
+
m.current = n, Rt(n), V(n), u && v && k.current.forEach((I) => I(n));
|
|
160
160
|
},
|
|
161
161
|
[V]
|
|
162
162
|
), U = h(
|
|
@@ -180,7 +180,7 @@ const Pt = be((t, r) => {
|
|
|
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 = p.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);
|
|
@@ -189,7 +189,7 @@ const Pt = be((t, r) => {
|
|
|
189
189
|
C.current && B();
|
|
190
190
|
}, 1e3);
|
|
191
191
|
}, []), G = h(() => {
|
|
192
|
-
const n = i.current, u =
|
|
192
|
+
const n = i.current, u = p.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 = p.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 || !p.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;
|
|
@@ -273,7 +273,7 @@ const Pt = be((t, r) => {
|
|
|
273
273
|
};
|
|
274
274
|
}, [G]);
|
|
275
275
|
const q = h(() => {
|
|
276
|
-
const n = window.matchMedia("(min-width: 768px)").matches, u = !
|
|
276
|
+
const n = window.matchMedia("(min-width: 768px)").matches, u = !m.current;
|
|
277
277
|
if (n) {
|
|
278
278
|
j(u);
|
|
279
279
|
return;
|
|
@@ -285,13 +285,13 @@ const Pt = be((t, r) => {
|
|
|
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 = p.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 !== m.current && (m.current = B, V(B)), B;
|
|
292
292
|
}
|
|
293
293
|
}
|
|
294
|
-
return
|
|
294
|
+
return m.current;
|
|
295
295
|
},
|
|
296
296
|
subscribeToCollapse: (n) => (k.current.add(n), () => {
|
|
297
297
|
k.current.delete(n);
|
|
@@ -385,9 +385,9 @@ const Pt = be((t, r) => {
|
|
|
385
385
|
Q.push(n);
|
|
386
386
|
});
|
|
387
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:
|
|
388
|
+
isCollapsed: m.current,
|
|
389
389
|
isSidebarOpen: !b.current
|
|
390
|
-
}), [
|
|
390
|
+
}), [m.current, b.current]);
|
|
391
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",
|
|
@@ -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
|
+
m.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: p, 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,9 +535,9 @@ 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: p = "div",
|
|
539
539
|
onClick: x,
|
|
540
|
-
onAuxClick:
|
|
540
|
+
onAuxClick: m,
|
|
541
541
|
disabled: b = !1,
|
|
542
542
|
tooltipText: S
|
|
543
543
|
} = t, k = (V) => {
|
|
@@ -580,15 +580,15 @@ const Ft = "hover:bg-neutral-medium-hover", zt = Be("", {
|
|
|
580
580
|
zt({ isSelected: l, disabled: b }),
|
|
581
581
|
c
|
|
582
582
|
);
|
|
583
|
-
if (
|
|
583
|
+
if (p === "a") {
|
|
584
584
|
const V = {
|
|
585
585
|
onClick: k,
|
|
586
|
-
onAuxClick:
|
|
586
|
+
onAuxClick: m,
|
|
587
587
|
className: C
|
|
588
588
|
};
|
|
589
589
|
return /* @__PURE__ */ e.jsx("a", { ...V, children: y });
|
|
590
590
|
}
|
|
591
|
-
if (
|
|
591
|
+
if (p === "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: p } = 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: p
|
|
620
620
|
}
|
|
621
621
|
) : null;
|
|
622
622
|
}, it = M(Ht);
|
|
@@ -625,16 +625,16 @@ 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, ...p } = c, x = l === r, m = () => {
|
|
629
629
|
s?.(l, f), d?.();
|
|
630
630
|
};
|
|
631
631
|
return i ? /* @__PURE__ */ e.jsx(
|
|
632
632
|
it,
|
|
633
633
|
{
|
|
634
|
-
...
|
|
634
|
+
...p,
|
|
635
635
|
id: l,
|
|
636
636
|
isActive: x,
|
|
637
|
-
onClick:
|
|
637
|
+
onClick: m
|
|
638
638
|
},
|
|
639
639
|
l
|
|
640
640
|
) : null;
|
|
@@ -646,8 +646,8 @@ const qt = (t) => {
|
|
|
646
646
|
}, [o]), f = h(() => {
|
|
647
647
|
if (o.startsWith("./")) {
|
|
648
648
|
if (!d) return;
|
|
649
|
-
const
|
|
650
|
-
window.open(
|
|
649
|
+
const p = d + o.slice(2);
|
|
650
|
+
window.open(p, "_blank");
|
|
651
651
|
} else
|
|
652
652
|
window.open(o, "_blank");
|
|
653
653
|
}, [o]);
|
|
@@ -674,7 +674,7 @@ 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 = O(null), { path: l, title: d, icon: i, count: f, className:
|
|
677
|
+
const [s, o] = J(!0), c = O(null), { path: l, title: d, icon: i, count: f, className: p, isSelected: x = !1, onClick: m, 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]);
|
|
@@ -701,8 +701,8 @@ const $t = be((t, r) => {
|
|
|
701
701
|
j(!1), S?.();
|
|
702
702
|
return;
|
|
703
703
|
}
|
|
704
|
-
|
|
705
|
-
}, [l,
|
|
704
|
+
m?.(l);
|
|
705
|
+
}, [l, m, b, S, j, k]), G = h(() => {
|
|
706
706
|
window.open(l, "_blank");
|
|
707
707
|
}, [l]), q = () => {
|
|
708
708
|
if (!b || A) return null;
|
|
@@ -711,9 +711,9 @@ const $t = be((t, r) => {
|
|
|
711
711
|
const E = h((_) => {
|
|
712
712
|
if (_.startsWith("./")) {
|
|
713
713
|
const g = l + _.slice(2);
|
|
714
|
-
|
|
714
|
+
m?.(g);
|
|
715
715
|
} else
|
|
716
|
-
|
|
716
|
+
m?.(_);
|
|
717
717
|
}, [l]);
|
|
718
718
|
return se(() => {
|
|
719
719
|
const _ = c.current;
|
|
@@ -732,7 +732,7 @@ const $t = be((t, r) => {
|
|
|
732
732
|
title: d,
|
|
733
733
|
icon: N,
|
|
734
734
|
count: f,
|
|
735
|
-
className:
|
|
735
|
+
className: p,
|
|
736
736
|
isSelected: x,
|
|
737
737
|
hasSublinks: !!b,
|
|
738
738
|
subLinksCollapsed: s,
|
|
@@ -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 p = 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: p,
|
|
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 &&
|
|
807
|
+
const l = (f, p) => {
|
|
808
|
+
s && p && s(f, p);
|
|
809
809
|
}, d = (f) => {
|
|
810
810
|
if (!c)
|
|
811
811
|
return;
|
|
812
|
-
const
|
|
813
|
-
if (!
|
|
812
|
+
const p = f.metadata;
|
|
813
|
+
if (!p)
|
|
814
814
|
return;
|
|
815
|
-
const x = je({ metadata:
|
|
815
|
+
const x = je({ metadata: p }, c);
|
|
816
816
|
if (x != null)
|
|
817
817
|
return typeof x == "string" ? x : String(x);
|
|
818
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:
|
|
820
|
+
const { auth_id: p } = f;
|
|
821
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: p.name,
|
|
825
825
|
avatarSize: "xxs",
|
|
826
826
|
secondarySlot: i(f),
|
|
827
827
|
subImageUrl: d(f),
|
|
828
|
-
imageUrl:
|
|
828
|
+
imageUrl: p.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: p,
|
|
845
845
|
mobileAppSwitcherControls: x
|
|
846
846
|
}) => {
|
|
847
|
-
const { getIsCollapsed:
|
|
848
|
-
const y =
|
|
849
|
-
y ? (b(),
|
|
850
|
-
}, [
|
|
847
|
+
const { getIsCollapsed: m, toggleCollapse: b, subscribeToCollapse: S } = ce(), k = h(() => {
|
|
848
|
+
const y = m();
|
|
849
|
+
y ? (b(), p.current?.open()) : d?.(y);
|
|
850
|
+
}, [m, b, p, d]);
|
|
851
851
|
return se(() => S((y) => {
|
|
852
|
-
y && (
|
|
853
|
-
}), [S,
|
|
852
|
+
y && (p.current?.close(), x.current?.close());
|
|
853
|
+
}), [S, p, 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: p, children: [
|
|
856
856
|
/* @__PURE__ */ e.jsx(ie.Content, { onClick: k, children: /* @__PURE__ */ e.jsx(
|
|
857
857
|
Ze,
|
|
858
858
|
{
|
|
@@ -876,7 +876,7 @@ const Yt = (t) => {
|
|
|
876
876
|
secondarySlot: o,
|
|
877
877
|
subImageUrlAccessor: i?.sessionCardOptions?.subImageUrlAccessor,
|
|
878
878
|
currentSystemId: f,
|
|
879
|
-
userOptionsControls:
|
|
879
|
+
userOptionsControls: p
|
|
880
880
|
}
|
|
881
881
|
) })
|
|
882
882
|
] }),
|
|
@@ -1019,7 +1019,7 @@ const Xe = ({ type: t }) => {
|
|
|
1019
1019
|
] }),
|
|
1020
1020
|
/* @__PURE__ */ e.jsx(pe, { shape: "rounded", className: "w-20 h-3" })
|
|
1021
1021
|
] }), Qt = ({ onCloseClick: t, onMarkAllAsRead: r, notificationsListControls: s, scrollableControls: o }) => {
|
|
1022
|
-
const [c, l] = J([]), [d, i] = J("NO_LEIDAS"), [f,
|
|
1022
|
+
const [c, l] = J([]), [d, i] = J("NO_LEIDAS"), [f, p] = J({ isLoading: !1, type: "load_more" }), [x, m] = J({ hasError: !1 }), b = O(/* @__PURE__ */ new Set()), S = O(null), k = O(null), y = h((g, P = "top") => {
|
|
1023
1023
|
l((R) => {
|
|
1024
1024
|
const z = Array.isArray(g) ? P === "bottom" ? [...R, ...g] : [...g, ...R] : P === "bottom" ? [...R, g] : [g, ...R];
|
|
1025
1025
|
return queueMicrotask(() => {
|
|
@@ -1044,9 +1044,9 @@ const Xe = ({ type: t }) => {
|
|
|
1044
1044
|
b.current.forEach((P) => P(g, g.length));
|
|
1045
1045
|
});
|
|
1046
1046
|
}, []), j = h((g, P = "load_more") => {
|
|
1047
|
-
|
|
1047
|
+
p({ isLoading: g, type: P });
|
|
1048
1048
|
}, []), U = h((g, P) => {
|
|
1049
|
-
|
|
1049
|
+
m({ hasError: g, children: P });
|
|
1050
1050
|
}, []);
|
|
1051
1051
|
Re(s, () => ({
|
|
1052
1052
|
addNewNotification: y,
|
|
@@ -1159,20 +1159,20 @@ const Xe = ({ type: t }) => {
|
|
|
1159
1159
|
Re(d, () => ({
|
|
1160
1160
|
setActiveSection: f
|
|
1161
1161
|
}));
|
|
1162
|
-
const
|
|
1162
|
+
const p = () => {
|
|
1163
1163
|
t();
|
|
1164
1164
|
};
|
|
1165
1165
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1166
1166
|
i === "notifications" && !r?.notificationsDrawerOptions?.hide && /* @__PURE__ */ e.jsx(
|
|
1167
1167
|
Qt,
|
|
1168
1168
|
{
|
|
1169
|
-
onCloseClick:
|
|
1169
|
+
onCloseClick: p,
|
|
1170
1170
|
onMarkAllAsRead: r?.notificationsDrawerOptions?.onMarkAllAsRead,
|
|
1171
1171
|
notificationsListControls: c,
|
|
1172
1172
|
scrollableControls: l
|
|
1173
1173
|
}
|
|
1174
1174
|
),
|
|
1175
|
-
i === "help" && s && !r?.helpSectionDrawerOptions?.hide && /* @__PURE__ */ e.jsx(Zt, { onCloseClick:
|
|
1175
|
+
i === "help" && s && !r?.helpSectionDrawerOptions?.hide && /* @__PURE__ */ e.jsx(Zt, { onCloseClick: p, children: typeof s == "function" ? s() : s })
|
|
1176
1176
|
] });
|
|
1177
1177
|
}, bt = be(er);
|
|
1178
1178
|
bt.displayName = "SidebarContent";
|
|
@@ -1203,7 +1203,7 @@ const rr = ({ navigationControlsRef: t }) => {
|
|
|
1203
1203
|
const r = ce();
|
|
1204
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;
|
|
1205
1205
|
}, sr = (t) => {
|
|
1206
|
-
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: p, initialSectionRef: x, userOptionsControls: m, mobileAppSwitcherControls: b, notificationsListControls: S, scrollableControls: k, outletRef: y, ...C } = t;
|
|
1207
1207
|
return /* @__PURE__ */ e.jsxs(re, { disableDragOpen: C.options?.disableDragOpen, outletRef: y, children: [
|
|
1208
1208
|
/* @__PURE__ */ e.jsx(rr, { navigationControlsRef: f }),
|
|
1209
1209
|
/* @__PURE__ */ e.jsx(re.Header, { className: "flex flex-col relative w-full select-none", children: /* @__PURE__ */ e.jsx(
|
|
@@ -1237,7 +1237,7 @@ const rr = ({ navigationControlsRef: t }) => {
|
|
|
1237
1237
|
onLogoutClick: C.onLogoutClick,
|
|
1238
1238
|
options: C.options,
|
|
1239
1239
|
currentSystemId: C.currentSystemId,
|
|
1240
|
-
userOptionsControls:
|
|
1240
|
+
userOptionsControls: m,
|
|
1241
1241
|
mobileAppSwitcherControls: b,
|
|
1242
1242
|
onProfileClick: C.onProfileClick
|
|
1243
1243
|
}
|
|
@@ -1254,7 +1254,7 @@ const rr = ({ navigationControlsRef: t }) => {
|
|
|
1254
1254
|
{
|
|
1255
1255
|
options: C.options,
|
|
1256
1256
|
helpSection: C.helpSection,
|
|
1257
|
-
sidebarContentRef:
|
|
1257
|
+
sidebarContentRef: p,
|
|
1258
1258
|
initialSectionRef: x,
|
|
1259
1259
|
notificationsListControls: S,
|
|
1260
1260
|
scrollableControls: k
|
|
@@ -1270,8 +1270,8 @@ const rr = ({ navigationControlsRef: t }) => {
|
|
|
1270
1270
|
for (const f of d) {
|
|
1271
1271
|
if (!Object.prototype.hasOwnProperty.call(l, f))
|
|
1272
1272
|
return !1;
|
|
1273
|
-
const
|
|
1274
|
-
if (
|
|
1273
|
+
const p = o[f], x = l[f];
|
|
1274
|
+
if (p !== x)
|
|
1275
1275
|
return !1;
|
|
1276
1276
|
}
|
|
1277
1277
|
return !0;
|
|
@@ -1284,7 +1284,7 @@ const wt = Me(null), Dr = () => {
|
|
|
1284
1284
|
if (!t)
|
|
1285
1285
|
throw new Error("usePyrionLayout debe usarse dentro de PyrionLayout");
|
|
1286
1286
|
return t;
|
|
1287
|
-
}, 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: p, tabsProps: x, currentSystemId: m, onSessionClick: b, onSystemLogoClick: S, onProfileClick: k, ...y }) => {
|
|
1288
1288
|
const A = Object.assign({
|
|
1289
1289
|
closeDrawerOnNavigate: !0,
|
|
1290
1290
|
disableDragOpen: {
|
|
@@ -1357,18 +1357,18 @@ const wt = Me(null), Dr = () => {
|
|
|
1357
1357
|
(a) => {
|
|
1358
1358
|
const w = A?.userCardOptions?.secondarySlot;
|
|
1359
1359
|
if (!w) return null;
|
|
1360
|
-
const F = s.enabled_systems?.find((ne) => ne._id ===
|
|
1360
|
+
const F = s.enabled_systems?.find((ne) => ne._id === m), T = { company: s.company, user: s.user, system: F, metadata: a };
|
|
1361
1361
|
return ue(w, T);
|
|
1362
1362
|
},
|
|
1363
|
-
[
|
|
1363
|
+
[m, A?.userCardOptions?.secondarySlot, ue, s.company, s.enabled_systems, s.user]
|
|
1364
1364
|
), u = h(
|
|
1365
1365
|
(a) => {
|
|
1366
1366
|
const w = A?.sessionCardOptions?.secondarySlot || A?.userCardOptions?.secondarySlot;
|
|
1367
1367
|
if (!w) return null;
|
|
1368
|
-
const F = s.enabled_systems?.find((ne) => ne._id ===
|
|
1368
|
+
const F = s.enabled_systems?.find((ne) => ne._id === m), T = { company: s.company, user: a.auth_id, metadata: a?.metadata, system: F };
|
|
1369
1369
|
return ue(w, T);
|
|
1370
1370
|
},
|
|
1371
|
-
[
|
|
1371
|
+
[m, A?.sessionCardOptions?.secondarySlot, A?.userCardOptions?.secondarySlot, ue, s.company, s.enabled_systems]
|
|
1372
1372
|
), v = me(() => {
|
|
1373
1373
|
const a = [];
|
|
1374
1374
|
return N.current.openNotifications = () => {
|
|
@@ -1392,7 +1392,7 @@ const wt = Me(null), Dr = () => {
|
|
|
1392
1392
|
icon: _t,
|
|
1393
1393
|
onClick: A.configurationActionOptions?.onClick
|
|
1394
1394
|
}), a;
|
|
1395
|
-
}, [A, r,
|
|
1395
|
+
}, [A, r, p, _]), I = me(
|
|
1396
1396
|
() => [...v, ...i || []],
|
|
1397
1397
|
[v, i]
|
|
1398
1398
|
), W = me(() => {
|
|
@@ -1454,7 +1454,7 @@ const wt = Me(null), Dr = () => {
|
|
|
1454
1454
|
tabs: W,
|
|
1455
1455
|
activeColor: "var(--neutral-900)",
|
|
1456
1456
|
currentTabName: Te,
|
|
1457
|
-
currentSystemId:
|
|
1457
|
+
currentSystemId: m,
|
|
1458
1458
|
isLoading: !s.enabled_systems || s.enabled_systems.length === 0
|
|
1459
1459
|
}
|
|
1460
1460
|
),
|
|
@@ -1465,7 +1465,7 @@ const wt = Me(null), Dr = () => {
|
|
|
1465
1465
|
handleNavigation: ae,
|
|
1466
1466
|
allActions: I,
|
|
1467
1467
|
activeActionId: f,
|
|
1468
|
-
onActionClick:
|
|
1468
|
+
onActionClick: p,
|
|
1469
1469
|
state: s,
|
|
1470
1470
|
currentAppSessions: Oe,
|
|
1471
1471
|
resolveUserSecondarySlot: n,
|
|
@@ -1473,7 +1473,7 @@ const wt = Me(null), Dr = () => {
|
|
|
1473
1473
|
onSessionClick: b,
|
|
1474
1474
|
onLogoutClick: d,
|
|
1475
1475
|
options: A,
|
|
1476
|
-
currentSystemId:
|
|
1476
|
+
currentSystemId: m,
|
|
1477
1477
|
userOptionsControls: q,
|
|
1478
1478
|
mobileAppSwitcherControls: X,
|
|
1479
1479
|
onSystemLogoClick: S,
|