prometeo-design-system 4.8.2 → 4.8.3
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 +474 -470
- package/dist/components/NavigationDrawer/NavigationDrawerActionItem.d.ts +1 -0
- package/dist/components/NavigationDrawer/NavigationDrawerItemBase.d.ts +1 -0
- package/dist/components/NavigationDrawer/NavigationDrawerLinkItem.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 Se } 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 I, useEffect as se, memo as P, useContext as Ge, createContext as Me, useCallback as x, Children as yt, isValidElement as ke, useMemo as pe, useImperativeHandle as Re, useLayoutEffect as Ct, use as jt } from "react";
|
|
6
6
|
import { createPortal as $e } from "react-dom";
|
|
7
7
|
import { useLocation as St, useNavigate as kt } from "react-router";
|
|
8
8
|
import ce 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, a] = J(t?.currentTabName || t.tabs[0]?.name), c =
|
|
27
|
-
console.log("tabs en el tabswitch del layout", l,
|
|
26
|
+
const [s, a] = J(t?.currentTabName || t.tabs[0]?.name), c = I(null), { tabs: l = [], className: d, activeColor: i = "var(--neutral-900)", currentSystemId: m, isLoading: h = !1 } = t;
|
|
27
|
+
console.log("tabs en el tabswitch del layout", l, m), se(() => {
|
|
28
28
|
c.current?.style.setProperty("--tab-bg", i);
|
|
29
29
|
}, [i]);
|
|
30
|
-
const
|
|
30
|
+
const b = l.find((p) => p?.id === m || p?.name === t?.currentTabName) || l.find((p) => p?.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: (h ? Array(3).fill(null) : l).map(
|
|
44
|
+
(p, g) => {
|
|
45
|
+
if (h) 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
|
+
g === 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(ce, { shape: "rounded", className: "w-full h-full" }) })
|
|
63
63
|
}
|
|
64
64
|
);
|
|
65
|
-
const j =
|
|
66
|
-
|
|
65
|
+
const j = p?.name === b?.name, A = 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 || (a(p?.name), p.onClick && p.onClick(p?.name));
|
|
67
67
|
};
|
|
68
68
|
return /* @__PURE__ */ e.jsx(
|
|
69
69
|
"div",
|
|
@@ -83,42 +83,42 @@ 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
|
-
|
|
87
|
-
), children:
|
|
86
|
+
p?.className
|
|
87
|
+
), children: A })
|
|
88
88
|
},
|
|
89
|
-
|
|
89
|
+
p?.name
|
|
90
90
|
);
|
|
91
91
|
}
|
|
92
92
|
)
|
|
93
93
|
}
|
|
94
94
|
);
|
|
95
|
-
}), rt =
|
|
96
|
-
const i = ge(t, s),
|
|
95
|
+
}), rt = P(be(({ children: t, className: r, context: s, modal: a = !1, closeOnOverlayClick: c = !1, unmountChildrenOnClose: l = !0 }, d) => {
|
|
96
|
+
const i = ge(t, s), m = typeof window < "u" && window.matchMedia("(min-width: 768px)").matches, { isSidebarOpen: h } = Mt(), { closeSidebar: b } = de(), [p, g] = J(() => l ? h : !0), [j, A] = J(!1);
|
|
97
97
|
return se(() => {
|
|
98
98
|
l && s?.subscribeToSidebarOpen((y) => {
|
|
99
|
-
y ? (
|
|
99
|
+
y ? (A(!1), g(!0)) : A(!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
|
-
j && (
|
|
105
|
+
j && (g(!1), A(!1));
|
|
106
106
|
};
|
|
107
107
|
return y.addEventListener("transitionend", C), () => y.removeEventListener("transitionend", C);
|
|
108
|
-
}, [j]), /* @__PURE__ */ e.jsxs("div", { ref: d, className: D("sidebar",
|
|
109
|
-
a &&
|
|
108
|
+
}, [j]), /* @__PURE__ */ e.jsxs("div", { ref: d, className: D("sidebar", m ? "collapsed" : "expanded", "h-full overflow-auto", r), "aria-modal": a || void 0, children: [
|
|
109
|
+
a && m && /* @__PURE__ */ e.jsx(
|
|
110
110
|
"div",
|
|
111
111
|
{
|
|
112
112
|
className: D("navigation-drawer-sidebar-overlay"),
|
|
113
113
|
onClick: (y) => {
|
|
114
|
-
y.preventDefault(), y.stopPropagation(), c &&
|
|
114
|
+
y.preventDefault(), y.stopPropagation(), c && b?.();
|
|
115
115
|
},
|
|
116
116
|
"aria-hidden": "true"
|
|
117
117
|
}
|
|
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,86 +144,86 @@ const Pt = be((t, r) => {
|
|
|
144
144
|
} catch {
|
|
145
145
|
}
|
|
146
146
|
}, Bt = (t) => {
|
|
147
|
-
const { children: r, classNameDrawer: s, classNameSidebar: a, disableDragOpen: c, modal: l = !0, closeOnOutsideClick: d = !0 } = t, i =
|
|
148
|
-
const
|
|
149
|
-
|
|
150
|
-
}, []),
|
|
151
|
-
const
|
|
152
|
-
if (!
|
|
153
|
-
|
|
154
|
-
const
|
|
155
|
-
|
|
156
|
-
}, []),
|
|
157
|
-
(n, { notify:
|
|
158
|
-
const
|
|
159
|
-
|
|
147
|
+
const { children: r, classNameDrawer: s, classNameSidebar: a, disableDragOpen: c, modal: l = !0, closeOnOutsideClick: d = !0 } = t, i = I(null), m = I(null), h = t.outletRef ?? I(null), b = I(null), p = I(Ke()), g = I(!1), j = I("drawer"), A = I(/* @__PURE__ */ new Set()), y = I(/* @__PURE__ */ new Set()), C = I(!1), S = I(null), K = x((n) => {
|
|
148
|
+
const f = m.current;
|
|
149
|
+
f && (f.classList.toggle("collapsed", n), f.classList.toggle("expanded", !n));
|
|
150
|
+
}, []), z = x((n) => {
|
|
151
|
+
const f = b.current;
|
|
152
|
+
if (!f) return;
|
|
153
|
+
f.classList.toggle("collapsed", n), f.classList.toggle("expanded", !n);
|
|
154
|
+
const w = i.current;
|
|
155
|
+
w && (w.classList.toggle("sidebar-collapsed", n), w.classList.toggle("sidebar-expanded", !n));
|
|
156
|
+
}, []), k = x(
|
|
157
|
+
(n, { notify: f = !0 } = {}) => {
|
|
158
|
+
const w = p.current !== n;
|
|
159
|
+
p.current = n, Rt(n), K(n), f && w && A.current.forEach((E) => E(n));
|
|
160
160
|
},
|
|
161
|
-
[
|
|
162
|
-
), U =
|
|
163
|
-
(n, { notify:
|
|
164
|
-
const
|
|
165
|
-
if (
|
|
161
|
+
[K]
|
|
162
|
+
), U = x(
|
|
163
|
+
(n, { notify: f = !0 } = {}) => {
|
|
164
|
+
const w = g.current !== n;
|
|
165
|
+
if (g.current = n, z(n), f && w) {
|
|
166
166
|
const E = !n;
|
|
167
|
-
y.current.forEach((
|
|
167
|
+
y.current.forEach((H) => H(E));
|
|
168
168
|
}
|
|
169
169
|
},
|
|
170
|
-
[
|
|
171
|
-
),
|
|
172
|
-
(n, { notify:
|
|
173
|
-
const
|
|
174
|
-
j.current = n, window.matchMedia("(min-width: 768px)").matches ||
|
|
175
|
-
const
|
|
176
|
-
|
|
170
|
+
[z]
|
|
171
|
+
), v = x(
|
|
172
|
+
(n, { notify: f = !0 } = {}) => {
|
|
173
|
+
const w = j.current, E = w !== n;
|
|
174
|
+
j.current = n, window.matchMedia("(min-width: 768px)").matches || k(n !== "drawer", { notify: f });
|
|
175
|
+
const H = w === "sidebar", R = n === "sidebar";
|
|
176
|
+
f && E && H !== R && y.current.forEach((te) => te(R)), U(n !== "sidebar", { notify: f }), k(n !== "drawer", { notify: f });
|
|
177
177
|
},
|
|
178
|
-
[
|
|
179
|
-
),
|
|
180
|
-
const
|
|
181
|
-
if (!
|
|
178
|
+
[k, U]
|
|
179
|
+
), q = x((n) => {
|
|
180
|
+
const f = i.current;
|
|
181
|
+
if (!f || window.matchMedia("(min-width: 768px)").matches) return;
|
|
182
182
|
C.current = !0;
|
|
183
|
-
const
|
|
184
|
-
|
|
185
|
-
const
|
|
186
|
-
C.current = !1,
|
|
183
|
+
const w = h.current?.offsetLeft ?? 0, E = b.current?.offsetLeft ?? w, H = n === "drawer" ? 0 : n === "sidebar" ? E : w;
|
|
184
|
+
S.current = H, f.scrollTo({ left: H, behavior: "smooth" });
|
|
185
|
+
const R = () => {
|
|
186
|
+
C.current = !1, S.current = null, f.removeEventListener("scrollend", R);
|
|
187
187
|
};
|
|
188
|
-
|
|
189
|
-
C.current &&
|
|
188
|
+
f.addEventListener("scrollend", R, { once: !0 }), setTimeout(() => {
|
|
189
|
+
C.current && R();
|
|
190
190
|
}, 1e3);
|
|
191
|
-
}, []), G =
|
|
192
|
-
const n = i.current,
|
|
193
|
-
if (!n || !
|
|
194
|
-
const
|
|
191
|
+
}, []), G = x(() => {
|
|
192
|
+
const n = i.current, f = h.current;
|
|
193
|
+
if (!n || !f || window.matchMedia("(min-width: 768px)").matches) return;
|
|
194
|
+
const w = [
|
|
195
195
|
{ panel: "drawer", offset: 0 },
|
|
196
|
-
{ panel: "outlet", offset:
|
|
197
|
-
], E =
|
|
198
|
-
E &&
|
|
199
|
-
const
|
|
200
|
-
let
|
|
201
|
-
for (let oe = 1; oe <
|
|
202
|
-
const me = Math.abs(
|
|
203
|
-
me < te && (
|
|
196
|
+
{ panel: "outlet", offset: f.offsetLeft }
|
|
197
|
+
], E = b.current;
|
|
198
|
+
E && w.push({ panel: "sidebar", offset: E.offsetLeft });
|
|
199
|
+
const H = n.scrollLeft;
|
|
200
|
+
let R = w[0], te = Math.abs(H - R.offset);
|
|
201
|
+
for (let oe = 1; oe < w.length; oe++) {
|
|
202
|
+
const me = Math.abs(H - w[oe].offset);
|
|
203
|
+
me < te && (R = w[oe], te = me);
|
|
204
204
|
}
|
|
205
|
-
|
|
206
|
-
}, [
|
|
205
|
+
v(R.panel);
|
|
206
|
+
}, [v]);
|
|
207
207
|
se(() => {
|
|
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,
|
|
212
|
-
if (!n || !
|
|
211
|
+
const n = i.current, f = h.current;
|
|
212
|
+
if (!n || !f) return;
|
|
213
213
|
if (window.matchMedia("(min-width: 768px)").matches) {
|
|
214
214
|
const E = Ke();
|
|
215
|
-
|
|
215
|
+
k(E, { notify: !1 }), U(!0, { notify: !1 });
|
|
216
216
|
return;
|
|
217
217
|
}
|
|
218
218
|
requestAnimationFrame(() => {
|
|
219
|
-
n.scrollLeft =
|
|
219
|
+
n.scrollLeft = f.offsetLeft, v("outlet");
|
|
220
220
|
});
|
|
221
|
-
}, [
|
|
221
|
+
}, [v, k, U]), se(() => {
|
|
222
222
|
const n = i.current;
|
|
223
|
-
if (!n || !
|
|
224
|
-
let
|
|
225
|
-
const
|
|
226
|
-
E = L.touches[0].clientX,
|
|
223
|
+
if (!n || !h.current) return;
|
|
224
|
+
let w = !1, E = 0, H = 0;
|
|
225
|
+
const R = (L) => {
|
|
226
|
+
E = L.touches[0].clientX, H = L.touches[0].clientY;
|
|
227
227
|
}, te = (L, Y) => {
|
|
228
228
|
const W = window.getComputedStyle(L), le = Y === "x" ? W.overflowX : W.overflowY;
|
|
229
229
|
return /(auto|scroll|overlay)/.test(le) ? Y === "x" ? L.scrollWidth > L.clientWidth : L.scrollHeight > L.clientHeight : !1;
|
|
@@ -237,72 +237,72 @@ const Pt = be((t, r) => {
|
|
|
237
237
|
return null;
|
|
238
238
|
}, me = (L, Y, W) => W === 0 ? !1 : Y === "x" ? W < 0 ? L.scrollLeft + L.clientWidth < L.scrollWidth : L.scrollLeft > 0 : W < 0 ? L.scrollTop + L.clientHeight < L.scrollHeight : L.scrollTop > 0, Ne = (L) => {
|
|
239
239
|
if (!(L.target instanceof HTMLElement)) return;
|
|
240
|
-
const Y = L.touches[0].clientX - E, W = L.touches[0].clientY -
|
|
240
|
+
const Y = L.touches[0].clientX - E, W = L.touches[0].clientY - H, le = Math.abs(Y) > Math.abs(W) ? "x" : "y", Ie = le === "x" ? Y : W, Ce = oe(L.target, le);
|
|
241
241
|
if (Ce && me(Ce, le, Ie))
|
|
242
242
|
return;
|
|
243
|
-
const je = n.classList.contains("disabled-dragopen"), o = n.classList.contains("disabled-dragopen-sidebar"),
|
|
243
|
+
const je = n.classList.contains("disabled-dragopen"), o = n.classList.contains("disabled-dragopen-sidebar"), N = () => L.cancelable ? (L.preventDefault(), !0) : !1;
|
|
244
244
|
if (le === "x") {
|
|
245
245
|
if (Y > 0) {
|
|
246
246
|
if (j.current === "sidebar" && !o) {
|
|
247
|
-
|
|
247
|
+
w = !0;
|
|
248
248
|
return;
|
|
249
249
|
}
|
|
250
250
|
if (je) {
|
|
251
|
-
|
|
251
|
+
N();
|
|
252
252
|
return;
|
|
253
253
|
}
|
|
254
254
|
} else if (Y < 0) {
|
|
255
255
|
if (j.current === "drawer" && !je) {
|
|
256
|
-
|
|
256
|
+
w = !0;
|
|
257
257
|
return;
|
|
258
258
|
}
|
|
259
259
|
if (o) {
|
|
260
|
-
|
|
260
|
+
N();
|
|
261
261
|
return;
|
|
262
262
|
}
|
|
263
263
|
}
|
|
264
|
-
|
|
264
|
+
w = !0;
|
|
265
265
|
}
|
|
266
266
|
}, ye = () => {
|
|
267
267
|
setTimeout(() => {
|
|
268
|
-
|
|
268
|
+
w && (G(), w = !1);
|
|
269
269
|
}, 100);
|
|
270
270
|
};
|
|
271
|
-
return n.addEventListener("touchstart",
|
|
272
|
-
n.removeEventListener("touchstart",
|
|
271
|
+
return n.addEventListener("touchstart", R, { passive: !1 }), n.addEventListener("touchmove", Ne, { passive: !1 }), n.addEventListener("touchend", ye), () => {
|
|
272
|
+
n.removeEventListener("touchstart", R), n.removeEventListener("touchmove", Ne), n.removeEventListener("touchend", ye);
|
|
273
273
|
};
|
|
274
274
|
}, [G]);
|
|
275
|
-
const
|
|
276
|
-
const n = window.matchMedia("(min-width: 768px)").matches,
|
|
275
|
+
const V = x(() => {
|
|
276
|
+
const n = window.matchMedia("(min-width: 768px)").matches, f = !p.current;
|
|
277
277
|
if (n) {
|
|
278
|
-
|
|
278
|
+
k(f);
|
|
279
279
|
return;
|
|
280
280
|
}
|
|
281
|
-
const
|
|
282
|
-
|
|
283
|
-
}, [
|
|
281
|
+
const w = f ? "outlet" : "drawer";
|
|
282
|
+
v(w), q(w);
|
|
283
|
+
}, [q, v, k]), X = I(null);
|
|
284
284
|
X.current || (X.current = {
|
|
285
|
-
toggleCollapse: () =>
|
|
285
|
+
toggleCollapse: () => V(),
|
|
286
286
|
getIsCollapsed: () => {
|
|
287
287
|
if (!window.matchMedia("(min-width: 768px)").matches) {
|
|
288
|
-
const
|
|
289
|
-
if (
|
|
290
|
-
const E =
|
|
291
|
-
return
|
|
288
|
+
const f = i.current, w = h.current;
|
|
289
|
+
if (f && w) {
|
|
290
|
+
const E = f.scrollLeft, H = w.offsetLeft, R = Math.abs(E - H) < Math.abs(E - 0);
|
|
291
|
+
return R !== p.current && (p.current = R, K(R)), R;
|
|
292
292
|
}
|
|
293
293
|
}
|
|
294
|
-
return
|
|
294
|
+
return p.current;
|
|
295
295
|
},
|
|
296
|
-
subscribeToCollapse: (n) => (
|
|
297
|
-
|
|
296
|
+
subscribeToCollapse: (n) => (A.current.add(n), () => {
|
|
297
|
+
A.current.delete(n);
|
|
298
298
|
}),
|
|
299
299
|
openSidebar: () => {
|
|
300
|
-
if (
|
|
300
|
+
if (b.current) {
|
|
301
301
|
if (window.matchMedia("(min-width: 768px)").matches) {
|
|
302
302
|
U(!1);
|
|
303
303
|
return;
|
|
304
304
|
}
|
|
305
|
-
|
|
305
|
+
v("sidebar"), q("sidebar");
|
|
306
306
|
}
|
|
307
307
|
},
|
|
308
308
|
closeSidebar: () => {
|
|
@@ -310,68 +310,68 @@ const Pt = be((t, r) => {
|
|
|
310
310
|
U(!0);
|
|
311
311
|
return;
|
|
312
312
|
}
|
|
313
|
-
|
|
313
|
+
v("outlet"), q("outlet");
|
|
314
314
|
},
|
|
315
315
|
toggleSidebar: () => {
|
|
316
|
-
if (!
|
|
316
|
+
if (!b.current) return;
|
|
317
317
|
if (window.matchMedia("(min-width: 768px)").matches) {
|
|
318
|
-
U(!
|
|
318
|
+
U(!g.current);
|
|
319
319
|
return;
|
|
320
320
|
}
|
|
321
321
|
const n = j.current === "sidebar" ? "outlet" : "sidebar";
|
|
322
|
-
|
|
322
|
+
v(n), q(n);
|
|
323
323
|
},
|
|
324
|
-
getIsSidebarOpen: () =>
|
|
324
|
+
getIsSidebarOpen: () => b.current ? window.matchMedia("(min-width: 768px)").matches ? !g.current : j.current === "sidebar" : !1,
|
|
325
325
|
subscribeToSidebarOpen: (n) => (y.current.add(n), () => {
|
|
326
326
|
y.current.delete(n);
|
|
327
327
|
}),
|
|
328
328
|
setDrawerDragEnabled: (n) => {
|
|
329
|
-
const
|
|
330
|
-
if (!
|
|
331
|
-
const
|
|
329
|
+
const f = i.current;
|
|
330
|
+
if (!f) return;
|
|
331
|
+
const w = f.scrollLeft;
|
|
332
332
|
if (n) {
|
|
333
|
-
const E =
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
333
|
+
const E = f.style.scrollBehavior;
|
|
334
|
+
f.style.scrollBehavior = "auto", f.classList.remove("disabled-dragopen"), requestAnimationFrame(() => {
|
|
335
|
+
f.scrollLeft = w, requestAnimationFrame(() => {
|
|
336
|
+
f.style.scrollBehavior = E;
|
|
337
337
|
});
|
|
338
338
|
});
|
|
339
339
|
} else
|
|
340
|
-
|
|
340
|
+
f.classList.add("disabled-dragopen");
|
|
341
341
|
},
|
|
342
342
|
setSidebarDragEnabled: (n) => {
|
|
343
|
-
const
|
|
344
|
-
if (
|
|
343
|
+
const f = i.current;
|
|
344
|
+
if (f)
|
|
345
345
|
if (n) {
|
|
346
|
-
const
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
346
|
+
const w = f.scrollLeft, E = f.style.scrollBehavior;
|
|
347
|
+
f.style.scrollBehavior = "auto", f.classList.remove("disabled-dragopen-sidebar"), requestAnimationFrame(() => {
|
|
348
|
+
f.scrollLeft = w, requestAnimationFrame(() => {
|
|
349
|
+
f.style.scrollBehavior = E;
|
|
350
350
|
});
|
|
351
351
|
});
|
|
352
352
|
} else
|
|
353
|
-
|
|
353
|
+
f.classList.add("disabled-dragopen-sidebar");
|
|
354
354
|
}
|
|
355
355
|
});
|
|
356
|
-
const
|
|
357
|
-
let
|
|
356
|
+
const $ = X.current, _ = typeof r == "function" ? r($) : r, u = yt.toArray(_);
|
|
357
|
+
let O = null, M = null, F = null;
|
|
358
358
|
const Q = [];
|
|
359
359
|
let ae = null, Z = null;
|
|
360
|
-
|
|
360
|
+
u.forEach((n) => {
|
|
361
361
|
if (!ke(n)) {
|
|
362
362
|
Q.push(n);
|
|
363
363
|
return;
|
|
364
364
|
}
|
|
365
|
-
if (n.type === ze && !
|
|
366
|
-
|
|
365
|
+
if (n.type === ze && !O) {
|
|
366
|
+
O = n;
|
|
367
367
|
return;
|
|
368
368
|
}
|
|
369
|
-
if (n.type === Le && !
|
|
370
|
-
|
|
369
|
+
if (n.type === Le && !M) {
|
|
370
|
+
M = n;
|
|
371
371
|
return;
|
|
372
372
|
}
|
|
373
|
-
if (n.type === De && !
|
|
374
|
-
|
|
373
|
+
if (n.type === De && !F) {
|
|
374
|
+
F = n;
|
|
375
375
|
return;
|
|
376
376
|
}
|
|
377
377
|
if (n.type === _e && !ae) {
|
|
@@ -384,11 +384,11 @@ const Pt = be((t, r) => {
|
|
|
384
384
|
}
|
|
385
385
|
Q.push(n);
|
|
386
386
|
});
|
|
387
|
-
const ve = !!
|
|
388
|
-
isCollapsed:
|
|
389
|
-
isSidebarOpen: !
|
|
390
|
-
}), [
|
|
391
|
-
return /* @__PURE__ */ e.jsx(st.Provider, { value: fe, children: /* @__PURE__ */ e.jsx(nt.Provider, { value:
|
|
387
|
+
const ve = !!M, we = M ?? (Q.length ? /* @__PURE__ */ e.jsx(Le, { children: Q }) : null), Ae = ve ? Q : [], ue = ae ?? (!!ae ? /* @__PURE__ */ e.jsx(_e, { children: _, context: $, modal: l, closeOnOutsideClick: d }) : null), Te = F ?? (!!F ? /* @__PURE__ */ e.jsx(De, { children: F }) : null), Oe = !!Z, ee = Z, fe = pe(() => ({
|
|
388
|
+
isCollapsed: p.current,
|
|
389
|
+
isSidebarOpen: !g.current
|
|
390
|
+
}), [p.current, g.current]);
|
|
391
|
+
return /* @__PURE__ */ e.jsx(st.Provider, { value: fe, children: /* @__PURE__ */ e.jsx(nt.Provider, { value: $, 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" : "",
|
|
@@ -397,17 +397,17 @@ const Pt = be((t, r) => {
|
|
|
397
397
|
/* @__PURE__ */ e.jsxs(
|
|
398
398
|
"div",
|
|
399
399
|
{
|
|
400
|
-
ref:
|
|
400
|
+
ref: m,
|
|
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: [
|
|
407
407
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col flex-1 gap-4 overflow-hidden", children: [
|
|
408
408
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2", children: [
|
|
409
|
-
/* @__PURE__ */ e.jsx(ot, { onToggleCollapse:
|
|
410
|
-
|
|
409
|
+
/* @__PURE__ */ e.jsx(ot, { onToggleCollapse: V }),
|
|
410
|
+
O
|
|
411
411
|
] }),
|
|
412
412
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-1 overflow-hidden relative flex-col", children: [
|
|
413
413
|
Ae,
|
|
@@ -418,13 +418,13 @@ const Pt = be((t, r) => {
|
|
|
418
418
|
]
|
|
419
419
|
}
|
|
420
420
|
),
|
|
421
|
-
ue && ke(ue) ? qe.cloneElement(ue, { ref:
|
|
421
|
+
ue && ke(ue) ? qe.cloneElement(ue, { ref: h, modal: l, closeOnOutsideClick: d }) : ue,
|
|
422
422
|
ee && ke(ee) ? qe.cloneElement(ee, {
|
|
423
|
-
ref:
|
|
423
|
+
ref: b,
|
|
424
424
|
className: D("sidebar", ee.props?.className, a)
|
|
425
425
|
}) : ee
|
|
426
426
|
] }) }) });
|
|
427
|
-
}, Ye =
|
|
427
|
+
}, Ye = P(Bt), ot = P(({ onToggleCollapse: t }) => /* @__PURE__ */ e.jsx(
|
|
428
428
|
"button",
|
|
429
429
|
{
|
|
430
430
|
type: "button",
|
|
@@ -434,29 +434,29 @@ const Pt = be((t, r) => {
|
|
|
434
434
|
}
|
|
435
435
|
), (t, r) => t.onToggleCollapse === r.onToggleCollapse);
|
|
436
436
|
ot.displayName = "NavigationDrawerCollapseButton";
|
|
437
|
-
const ze =
|
|
437
|
+
const ze = P(({ children: t, className: r, context: s }) => {
|
|
438
438
|
const a = ge(t, s);
|
|
439
439
|
return /* @__PURE__ */ e.jsx("div", { className: D("flex items-center justify-between", r), children: a });
|
|
440
440
|
});
|
|
441
441
|
ze.displayName = "NavigationDrawerHeader";
|
|
442
|
-
const Le =
|
|
442
|
+
const Le = P(({ children: t, className: r, context: s, ...a }) => {
|
|
443
443
|
const c = ge(t, s);
|
|
444
444
|
return /* @__PURE__ */ e.jsx("div", { ...a, className: D("w-full flex-1 drawer-content select-none", r), children: c });
|
|
445
445
|
});
|
|
446
446
|
Le.displayName = "NavigationDrawerContent";
|
|
447
|
-
const De =
|
|
447
|
+
const De = P(({ children: t, className: r, context: s }) => {
|
|
448
448
|
const a = ge(t, s);
|
|
449
449
|
return /* @__PURE__ */ e.jsx("div", { className: D("flex items-center justify-between", r), children: a });
|
|
450
450
|
});
|
|
451
451
|
De.displayName = "NavigationDrawerFooter";
|
|
452
|
-
const lt =
|
|
452
|
+
const lt = P(({ className: t }) => /* @__PURE__ */ e.jsx("div", { className: D("w-full border-t border-neutral-strong-default ", t) }));
|
|
453
453
|
lt.displayName = "NavigationDrawerSpacer";
|
|
454
|
-
const _e =
|
|
455
|
-
const d = ge(t, s), i = de(),
|
|
454
|
+
const _e = P(be(({ children: t, className: r, context: s, modal: a, closeOnOutsideClick: c }, l) => {
|
|
455
|
+
const d = ge(t, s), i = de(), m = () => {
|
|
456
456
|
c && (i.toggleCollapse(), i.closeSidebar());
|
|
457
457
|
};
|
|
458
458
|
return /* @__PURE__ */ e.jsx(e.Fragment, { children: /* @__PURE__ */ e.jsxs("div", { id: "navigation-drawer-outlet", ref: l, className: D("flex-1 overflow-auto relative h-full max-h-dvh", r), children: [
|
|
459
|
-
a && /* @__PURE__ */ e.jsx("div", { className: "navigation-drawer-backdrop select-none", onClick:
|
|
459
|
+
a && /* @__PURE__ */ e.jsx("div", { className: "navigation-drawer-backdrop select-none", onClick: m }),
|
|
460
460
|
d
|
|
461
461
|
] }) });
|
|
462
462
|
}), (t, r) => t.children === r.children && t.className === r.className), re = Object.assign(Ye, {
|
|
@@ -534,21 +534,22 @@ const Ft = "hover:bg-neutral-medium-hover", zt = Be("", {
|
|
|
534
534
|
isSelected: l = !1,
|
|
535
535
|
hasSublinks: d,
|
|
536
536
|
subLinksCollapsed: i,
|
|
537
|
-
onToggleSublinks:
|
|
538
|
-
as:
|
|
539
|
-
onClick:
|
|
540
|
-
onAuxClick:
|
|
541
|
-
disabled:
|
|
542
|
-
tooltipText: j
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
537
|
+
onToggleSublinks: m,
|
|
538
|
+
as: h = "div",
|
|
539
|
+
onClick: b,
|
|
540
|
+
onAuxClick: p,
|
|
541
|
+
disabled: g = !1,
|
|
542
|
+
tooltipText: j,
|
|
543
|
+
selectorCss: A
|
|
544
|
+
} = t, y = (z) => {
|
|
545
|
+
g || b?.(z);
|
|
546
|
+
}, C = /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
546
547
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 items-center flex-nowrap", children: [
|
|
547
|
-
s && (j ? /* @__PURE__ */ e.jsx(Dt, { title: j, disabled:
|
|
548
|
-
/* @__PURE__ */ e.jsx("label", { className: Ut({ disabled:
|
|
548
|
+
s && (j ? /* @__PURE__ */ e.jsx(Dt, { title: j, disabled: g, children: /* @__PURE__ */ e.jsx(s, { size: 24, className: Ee({ disabled: g, isSelected: l }) }) }) : /* @__PURE__ */ e.jsx(s, { size: 24, className: Ee({ disabled: g, isSelected: l }) })),
|
|
549
|
+
/* @__PURE__ */ e.jsx("label", { className: Ut({ disabled: g, isSelected: l }), children: r })
|
|
549
550
|
] }),
|
|
550
551
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-1 items-center", children: [
|
|
551
|
-
a && a ? /* @__PURE__ */ e.jsx(Qe, { count: a, maxCount: 9, className: "badge", disabled:
|
|
552
|
+
a && a ? /* @__PURE__ */ e.jsx(Qe, { count: a, maxCount: 9, className: "badge", disabled: g }) : "",
|
|
552
553
|
d && /* @__PURE__ */ e.jsx(
|
|
553
554
|
"div",
|
|
554
555
|
{
|
|
@@ -562,49 +563,50 @@ const Ft = "hover:bg-neutral-medium-hover", zt = Be("", {
|
|
|
562
563
|
children: /* @__PURE__ */ e.jsx(
|
|
563
564
|
"button",
|
|
564
565
|
{
|
|
565
|
-
disabled:
|
|
566
|
+
disabled: g,
|
|
566
567
|
type: "button",
|
|
567
|
-
onClick:
|
|
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", Ee({ disabled:
|
|
568
|
+
onClick: m,
|
|
569
|
+
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", Ee({ disabled: g, isSelected: l }), g && "pointer-events-none"),
|
|
569
570
|
children: /* @__PURE__ */ e.jsx(At, {})
|
|
570
571
|
}
|
|
571
572
|
)
|
|
572
573
|
}
|
|
573
574
|
)
|
|
574
575
|
] })
|
|
575
|
-
] }),
|
|
576
|
+
] }), S = D(
|
|
576
577
|
"group navitem",
|
|
577
578
|
"h-12 flex-1 flex items-center p-3 rounded-lg justify-between w-full",
|
|
578
579
|
"transition-all duration-300",
|
|
579
580
|
Ft,
|
|
580
|
-
zt({ isSelected: l, disabled:
|
|
581
|
+
zt({ isSelected: l, disabled: g }),
|
|
581
582
|
c
|
|
582
583
|
);
|
|
583
|
-
if (
|
|
584
|
-
const
|
|
585
|
-
onClick:
|
|
586
|
-
onAuxClick:
|
|
587
|
-
className:
|
|
584
|
+
if (h === "a") {
|
|
585
|
+
const z = {
|
|
586
|
+
onClick: y,
|
|
587
|
+
onAuxClick: p,
|
|
588
|
+
className: S
|
|
588
589
|
};
|
|
589
|
-
return /* @__PURE__ */ e.jsx("a", { ...
|
|
590
|
+
return /* @__PURE__ */ e.jsx("a", { ...z, children: C });
|
|
590
591
|
}
|
|
591
|
-
if (
|
|
592
|
-
const
|
|
593
|
-
onClick:
|
|
592
|
+
if (h === "button") {
|
|
593
|
+
const z = {
|
|
594
|
+
onClick: y,
|
|
594
595
|
type: "button",
|
|
595
|
-
className:
|
|
596
|
+
className: S,
|
|
597
|
+
id: A
|
|
596
598
|
};
|
|
597
|
-
return /* @__PURE__ */ e.jsx("button", { ...
|
|
599
|
+
return /* @__PURE__ */ e.jsx("button", { ...z, children: C });
|
|
598
600
|
}
|
|
599
|
-
const
|
|
600
|
-
onClick:
|
|
601
|
-
className:
|
|
601
|
+
const K = {
|
|
602
|
+
onClick: y,
|
|
603
|
+
className: S
|
|
602
604
|
};
|
|
603
|
-
return /* @__PURE__ */ e.jsx("div", { ...
|
|
604
|
-
}, Ue =
|
|
605
|
+
return /* @__PURE__ */ e.jsx("div", { ...K, children: C });
|
|
606
|
+
}, Ue = P(Wt);
|
|
605
607
|
Ue.displayName = "NavigationDrawerItemBase";
|
|
606
608
|
const Ht = (t) => {
|
|
607
|
-
const { title: r, icon: s, count: a, className: c, isActive: l, onClick: d, isView: i = !0, disabled:
|
|
609
|
+
const { title: r, icon: s, count: a, className: c, isActive: l, onClick: d, isView: i = !0, disabled: m, tooltipText: h, selectorCss: b } = t;
|
|
608
610
|
return i ? /* @__PURE__ */ e.jsx(
|
|
609
611
|
Ue,
|
|
610
612
|
{
|
|
@@ -615,39 +617,40 @@ const Ht = (t) => {
|
|
|
615
617
|
className: c,
|
|
616
618
|
isSelected: l,
|
|
617
619
|
onClick: d,
|
|
618
|
-
disabled:
|
|
619
|
-
tooltipText:
|
|
620
|
+
disabled: m,
|
|
621
|
+
tooltipText: h,
|
|
622
|
+
selectorCss: b
|
|
620
623
|
}
|
|
621
624
|
) : null;
|
|
622
|
-
}, it =
|
|
625
|
+
}, it = P(Ht);
|
|
623
626
|
it.displayName = "NavigationDrawerActionItem";
|
|
624
627
|
const Vt = ({ actions: t, activeActionId: r, onActionClick: s, className: a }) => /* @__PURE__ */ e.jsx(xe, { className: D("flex flex-col gap-2 w-full ", a), scrollbarProps: { hide: !0 }, persistScroll: "navigation-actions", indicators: {
|
|
625
628
|
top: { type: "shadow", behavior: "scroll-on-hover", show: !0 },
|
|
626
629
|
bottom: { type: "shadow", behavior: "scroll-on-hover", show: !0 }
|
|
627
630
|
}, children: t?.map((c) => {
|
|
628
|
-
const { id: l, onClick: d, isView: i = !0, payload:
|
|
629
|
-
s?.(l,
|
|
631
|
+
const { id: l, onClick: d, isView: i = !0, payload: m, ...h } = c, b = l === r, p = () => {
|
|
632
|
+
s?.(l, m), d?.();
|
|
630
633
|
};
|
|
631
634
|
return i ? /* @__PURE__ */ e.jsx(
|
|
632
635
|
it,
|
|
633
636
|
{
|
|
634
|
-
...
|
|
637
|
+
...h,
|
|
635
638
|
id: l,
|
|
636
|
-
isActive:
|
|
637
|
-
onClick:
|
|
639
|
+
isActive: b,
|
|
640
|
+
onClick: p
|
|
638
641
|
},
|
|
639
642
|
l
|
|
640
643
|
) : null;
|
|
641
|
-
}) }), ct =
|
|
644
|
+
}) }), ct = P(Vt);
|
|
642
645
|
ct.displayName = "NavigationDrawerActions";
|
|
643
646
|
const qt = (t) => {
|
|
644
|
-
const { className: r, title: s, path: a, onClick: c, isSelected: l, parentPath: d } = t, i =
|
|
647
|
+
const { className: r, title: s, path: a, onClick: c, isSelected: l, parentPath: d } = t, i = x(() => {
|
|
645
648
|
c?.(a);
|
|
646
|
-
}, [a]),
|
|
649
|
+
}, [a]), m = x(() => {
|
|
647
650
|
if (a.startsWith("./")) {
|
|
648
651
|
if (!d) return;
|
|
649
|
-
const
|
|
650
|
-
window.open(
|
|
652
|
+
const h = d + a.slice(2);
|
|
653
|
+
window.open(h, "_blank");
|
|
651
654
|
} else
|
|
652
655
|
window.open(a, "_blank");
|
|
653
656
|
}, [a]);
|
|
@@ -655,7 +658,7 @@ const qt = (t) => {
|
|
|
655
658
|
"a",
|
|
656
659
|
{
|
|
657
660
|
onClick: i,
|
|
658
|
-
onAuxClick:
|
|
661
|
+
onAuxClick: m,
|
|
659
662
|
className: D(
|
|
660
663
|
"group",
|
|
661
664
|
"transition-all duration-300 ease-in-out cursor-pointer",
|
|
@@ -671,107 +674,108 @@ const qt = (t) => {
|
|
|
671
674
|
), children: s })
|
|
672
675
|
}
|
|
673
676
|
);
|
|
674
|
-
}, dt =
|
|
677
|
+
}, dt = P(qt);
|
|
675
678
|
dt.displayName = "NavItemSecondary";
|
|
676
679
|
const $t = be((t, r) => {
|
|
677
|
-
const [s, a] = J(!0), c =
|
|
678
|
-
se(() => y ? y((
|
|
679
|
-
|
|
680
|
+
const [s, a] = J(!0), c = I(null), { path: l, title: d, icon: i, count: m, className: h, isSelected: b = !1, onClick: p, sublinks: g, toggleCollapse: j, getIsCollapsed: A, subscribeToCollapse: y, isView: C = !0, disabled: S, tooltipText: K, selectorCss: z } = t;
|
|
681
|
+
se(() => y ? y((u) => {
|
|
682
|
+
u && a(!0);
|
|
680
683
|
}) : void 0, [y]);
|
|
681
|
-
const
|
|
682
|
-
a((
|
|
683
|
-
}, []),
|
|
684
|
-
a(
|
|
685
|
-
}, []),
|
|
686
|
-
toggle:
|
|
687
|
-
setIsCollapsed:
|
|
684
|
+
const k = x(() => {
|
|
685
|
+
a((_) => !_);
|
|
686
|
+
}, []), U = x((_) => {
|
|
687
|
+
a(_);
|
|
688
|
+
}, []), v = {
|
|
689
|
+
toggle: k,
|
|
690
|
+
setIsCollapsed: U,
|
|
688
691
|
get isCollapsed() {
|
|
689
692
|
return s;
|
|
690
693
|
},
|
|
691
694
|
get isDrawerCollapsed() {
|
|
692
|
-
return
|
|
695
|
+
return A?.() ?? !1;
|
|
693
696
|
},
|
|
694
697
|
toggleDrawerCollapse: j,
|
|
695
698
|
subscribeToCollapse: y
|
|
696
699
|
};
|
|
697
|
-
Re(r, () =>
|
|
698
|
-
const
|
|
699
|
-
const
|
|
700
|
-
if (
|
|
701
|
-
|
|
700
|
+
Re(r, () => v, [v, s, A, j]);
|
|
701
|
+
const q = i, G = x(() => {
|
|
702
|
+
const _ = A?.() ?? !1;
|
|
703
|
+
if (g && g.length > 0 && _) {
|
|
704
|
+
U(!1), j?.();
|
|
702
705
|
return;
|
|
703
706
|
}
|
|
704
|
-
|
|
705
|
-
}, [l,
|
|
707
|
+
p?.(l);
|
|
708
|
+
}, [l, p, g, j, U, A]), V = x(() => {
|
|
706
709
|
window.open(l, "_blank");
|
|
707
|
-
}, [l]),
|
|
708
|
-
if (!
|
|
709
|
-
if (t.subLinksRender &&
|
|
710
|
-
return t.subLinksRender(
|
|
711
|
-
const
|
|
712
|
-
if (
|
|
713
|
-
const
|
|
714
|
-
|
|
710
|
+
}, [l]), X = () => {
|
|
711
|
+
if (!g || S) return null;
|
|
712
|
+
if (t.subLinksRender && g)
|
|
713
|
+
return t.subLinksRender(g, v);
|
|
714
|
+
const _ = x((u) => {
|
|
715
|
+
if (u.startsWith("./")) {
|
|
716
|
+
const O = l + u.slice(2);
|
|
717
|
+
p?.(O);
|
|
715
718
|
} else
|
|
716
|
-
|
|
719
|
+
p?.(u);
|
|
717
720
|
}, [l]);
|
|
718
721
|
return se(() => {
|
|
719
|
-
const
|
|
720
|
-
if (!
|
|
721
|
-
const
|
|
722
|
-
|
|
723
|
-
}, []), /* @__PURE__ */ e.jsx("div", { ref: c, className: `sublinks flex flex-col gap-1 ml-8 ${s ? "collapsed" : "expanded"}`, children:
|
|
724
|
-
},
|
|
725
|
-
|
|
722
|
+
const u = c.current;
|
|
723
|
+
if (!u) return;
|
|
724
|
+
const O = u.scrollHeight;
|
|
725
|
+
u.style.setProperty("--sublinks-max-height", `${O}px`);
|
|
726
|
+
}, []), /* @__PURE__ */ e.jsx("div", { ref: c, className: `sublinks flex flex-col gap-1 ml-8 ${s ? "collapsed" : "expanded"}`, children: g.map((u) => /* @__PURE__ */ e.jsx(dt, { ...u, onClick: _, parentPath: l }, `${u.title}-${u.path}`)) });
|
|
727
|
+
}, $ = (_) => {
|
|
728
|
+
_.stopPropagation(), _.preventDefault(), k();
|
|
726
729
|
};
|
|
727
|
-
return C ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2 ", children: [
|
|
730
|
+
return C ? /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2 ", id: z, children: [
|
|
728
731
|
/* @__PURE__ */ e.jsx(
|
|
729
732
|
Ue,
|
|
730
733
|
{
|
|
731
734
|
as: "a",
|
|
732
735
|
title: d,
|
|
733
|
-
icon:
|
|
734
|
-
count:
|
|
735
|
-
className:
|
|
736
|
-
isSelected:
|
|
737
|
-
hasSublinks: !!
|
|
736
|
+
icon: q,
|
|
737
|
+
count: m,
|
|
738
|
+
className: h,
|
|
739
|
+
isSelected: b,
|
|
740
|
+
hasSublinks: !!g,
|
|
738
741
|
subLinksCollapsed: s,
|
|
739
|
-
onToggleSublinks:
|
|
740
|
-
onClick:
|
|
741
|
-
onAuxClick:
|
|
742
|
-
disabled:
|
|
743
|
-
tooltipText:
|
|
742
|
+
onToggleSublinks: $,
|
|
743
|
+
onClick: G,
|
|
744
|
+
onAuxClick: V,
|
|
745
|
+
disabled: S,
|
|
746
|
+
tooltipText: K
|
|
744
747
|
}
|
|
745
748
|
),
|
|
746
|
-
|
|
749
|
+
X()
|
|
747
750
|
] }) : null;
|
|
748
|
-
}), ut =
|
|
751
|
+
}), ut = P($t);
|
|
749
752
|
ut.displayName = "NavigationDrawerLinkItem";
|
|
750
753
|
const Kt = ({ navlinks: t, handleNavigation: r, className: s, getIsCollapsed: a, toggleCollapse: c, subscribeToCollapse: l }) => {
|
|
751
754
|
const { pathname: d } = St();
|
|
752
755
|
return /* @__PURE__ */ e.jsx(xe, { className: D("flex flex-col gap-2 w-full ", s), scrollbarProps: { hide: !0 }, persistScroll: "navigation-links", indicators: {
|
|
753
756
|
top: { type: "shadow", behavior: "scroll-on-hover", show: !0 },
|
|
754
757
|
bottom: { type: "shadow", behavior: "scroll-on-hover", show: !0 }
|
|
755
|
-
}, children: t?.map((i,
|
|
756
|
-
const
|
|
758
|
+
}, children: t?.map((i, m) => {
|
|
759
|
+
const h = i.isSelected || i.path === d || (i.relatedPaths?.some((b) => d.startsWith(b)) ?? !1) || (i.sublinks?.some((b) => b.path === d) ?? !1);
|
|
757
760
|
return /* @__PURE__ */ e.jsx(
|
|
758
761
|
ut,
|
|
759
762
|
{
|
|
760
763
|
...i,
|
|
761
|
-
isSelected:
|
|
764
|
+
isSelected: h,
|
|
762
765
|
onClick: r,
|
|
763
766
|
toggleCollapse: c,
|
|
764
767
|
getIsCollapsed: a,
|
|
765
768
|
subscribeToCollapse: l,
|
|
766
769
|
disabled: i.disabled,
|
|
767
|
-
isView: i.isView
|
|
770
|
+
isView: i.isView,
|
|
771
|
+
selectorCss: i.selectorCss
|
|
768
772
|
},
|
|
769
|
-
|
|
773
|
+
m
|
|
770
774
|
);
|
|
771
775
|
}) });
|
|
772
|
-
}, ft =
|
|
776
|
+
}, ft = P(Kt);
|
|
773
777
|
ft.displayName = "NavigationDrawerNavlinks";
|
|
774
|
-
const mt =
|
|
778
|
+
const mt = P(({ navlinks: t, handleNavigation: r, allActions: s, activeActionId: a, onActionClick: c }) => {
|
|
775
779
|
const { getIsCollapsed: l, toggleCollapse: d, subscribeToCollapse: i } = de();
|
|
776
780
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
777
781
|
/* @__PURE__ */ e.jsx(re.Spacer, { className: "pb-3" }),
|
|
@@ -804,32 +808,32 @@ const Yt = (t) => {
|
|
|
804
808
|
const { sessions: r, onSessionClick: s, secondarySlot: a, subImageUrlAccessor: c } = t;
|
|
805
809
|
if (!r || r.length === 0)
|
|
806
810
|
return null;
|
|
807
|
-
const l = (
|
|
808
|
-
s &&
|
|
809
|
-
}, d = (
|
|
811
|
+
const l = (m, h) => {
|
|
812
|
+
s && h && s(m, h);
|
|
813
|
+
}, d = (m) => {
|
|
810
814
|
if (!c)
|
|
811
815
|
return;
|
|
812
|
-
const
|
|
813
|
-
if (!
|
|
816
|
+
const h = m.metadata;
|
|
817
|
+
if (!h)
|
|
814
818
|
return;
|
|
815
|
-
const
|
|
816
|
-
if (
|
|
817
|
-
return typeof
|
|
818
|
-
}, i =
|
|
819
|
-
return /* @__PURE__ */ e.jsx("div", { className: "w-full h-full flex flex-col gap-2", children: r?.map((
|
|
820
|
-
const { auth_id:
|
|
821
|
-
return /* @__PURE__ */ e.jsx(ie, { className: " shrink-0 h-max", children: /* @__PURE__ */ e.jsx(ie.Content, { onClick: () => l(
|
|
819
|
+
const b = Se({ metadata: h }, c);
|
|
820
|
+
if (b != null)
|
|
821
|
+
return typeof b == "string" ? b : String(b);
|
|
822
|
+
}, i = x((m) => typeof a == "function" ? a(m) : a, [a]);
|
|
823
|
+
return /* @__PURE__ */ e.jsx("div", { className: "w-full h-full flex flex-col gap-2", children: r?.map((m) => {
|
|
824
|
+
const { auth_id: h } = m;
|
|
825
|
+
return /* @__PURE__ */ e.jsx(ie, { className: " shrink-0 h-max", children: /* @__PURE__ */ e.jsx(ie.Content, { onClick: () => l(m, t.userOptionsControls), className: "p-0 group-data-[expanded=true]/ticketcard:border-none", children: /* @__PURE__ */ e.jsx(
|
|
822
826
|
Ze,
|
|
823
827
|
{
|
|
824
|
-
name:
|
|
828
|
+
name: h.name,
|
|
825
829
|
avatarSize: "xxs",
|
|
826
|
-
secondarySlot: i(
|
|
827
|
-
subImageUrl: d(
|
|
828
|
-
imageUrl:
|
|
830
|
+
secondarySlot: i(m),
|
|
831
|
+
subImageUrl: d(m),
|
|
832
|
+
imageUrl: h.profile_picture,
|
|
829
833
|
className: "pyrion-navigation-drawer-user-card"
|
|
830
834
|
},
|
|
831
|
-
|
|
832
|
-
) }) },
|
|
835
|
+
m.token
|
|
836
|
+
) }) }, m.token);
|
|
833
837
|
}) });
|
|
834
838
|
}, Xt = ({
|
|
835
839
|
state: t,
|
|
@@ -840,20 +844,20 @@ const Yt = (t) => {
|
|
|
840
844
|
onLogoutClick: l,
|
|
841
845
|
onProfileClick: d,
|
|
842
846
|
options: i,
|
|
843
|
-
currentSystemId:
|
|
844
|
-
userOptionsControls:
|
|
845
|
-
mobileAppSwitcherControls:
|
|
847
|
+
currentSystemId: m,
|
|
848
|
+
userOptionsControls: h,
|
|
849
|
+
mobileAppSwitcherControls: b
|
|
846
850
|
}) => {
|
|
847
|
-
const { getIsCollapsed:
|
|
848
|
-
const y =
|
|
849
|
-
y ? (
|
|
850
|
-
}, [
|
|
851
|
+
const { getIsCollapsed: p, toggleCollapse: g, subscribeToCollapse: j } = de(), A = x(() => {
|
|
852
|
+
const y = p();
|
|
853
|
+
y ? (g(), h.current?.open()) : d?.(y);
|
|
854
|
+
}, [p, g, h, d]);
|
|
851
855
|
return se(() => j((y) => {
|
|
852
|
-
y && (
|
|
853
|
-
}), [j,
|
|
856
|
+
y && (h.current?.close(), b.current?.close());
|
|
857
|
+
}), [j, h, b]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
854
858
|
/* @__PURE__ */ e.jsx(re.Spacer, { className: "mb-3" }),
|
|
855
|
-
/* @__PURE__ */ e.jsxs(ie, { className: "", controls:
|
|
856
|
-
/* @__PURE__ */ e.jsx(ie.Content, { onClick:
|
|
859
|
+
/* @__PURE__ */ e.jsxs(ie, { className: "", controls: h, children: [
|
|
860
|
+
/* @__PURE__ */ e.jsx(ie.Content, { onClick: A, children: /* @__PURE__ */ e.jsx(
|
|
857
861
|
Ze,
|
|
858
862
|
{
|
|
859
863
|
className: "pyrion-navigation-drawer-user-card p-0",
|
|
@@ -875,8 +879,8 @@ const Yt = (t) => {
|
|
|
875
879
|
onSessionClick: c,
|
|
876
880
|
secondarySlot: a,
|
|
877
881
|
subImageUrlAccessor: i?.sessionCardOptions?.subImageUrlAccessor,
|
|
878
|
-
currentSystemId:
|
|
879
|
-
userOptionsControls:
|
|
882
|
+
currentSystemId: m,
|
|
883
|
+
userOptionsControls: h
|
|
880
884
|
}
|
|
881
885
|
) })
|
|
882
886
|
] }),
|
|
@@ -900,7 +904,7 @@ const Yt = (t) => {
|
|
|
900
904
|
] })
|
|
901
905
|
] })
|
|
902
906
|
] });
|
|
903
|
-
}, pt =
|
|
907
|
+
}, pt = P(Xt, (t, r) => {
|
|
904
908
|
const s = Object.keys(t), a = Object.keys(r);
|
|
905
909
|
if (s.length !== a.length)
|
|
906
910
|
return !1;
|
|
@@ -942,11 +946,11 @@ const Jt = ({ tabs: t, content: r, controls: s }) => /* @__PURE__ */ e.jsxs(ie,
|
|
|
942
946
|
] }),
|
|
943
947
|
/* @__PURE__ */ e.jsx("div", {})
|
|
944
948
|
] })
|
|
945
|
-
] }), Pe =
|
|
946
|
-
const a =
|
|
949
|
+
] }), Pe = P(({ enabled_systems: t, onClick: r, currentSystemId: s }) => {
|
|
950
|
+
const a = x(() => {
|
|
947
951
|
if (t) {
|
|
948
952
|
if (s) {
|
|
949
|
-
const i = t.find((
|
|
953
|
+
const i = t.find((m) => m._id === s);
|
|
950
954
|
if (i) return { coverImage: i.coverImage, thumbnail: i.thumbnail };
|
|
951
955
|
}
|
|
952
956
|
const l = window.location.origin, d = t.find((i) => i.url === l);
|
|
@@ -978,11 +982,11 @@ const Jt = ({ tabs: t, content: r, controls: s }) => /* @__PURE__ */ e.jsxs(ie,
|
|
|
978
982
|
] });
|
|
979
983
|
}, (t, r) => t.enabled_systems === r.enabled_systems && t.onClick === r.onClick && t.currentSystemId === r.currentSystemId);
|
|
980
984
|
Pe.displayName = "PyrionNavigationDrawer.SystemLogo";
|
|
981
|
-
const ht =
|
|
982
|
-
const { getIsCollapsed: l } = de(), d = Je(), i =
|
|
985
|
+
const ht = P(({ onSystemLogoClick: t, state: r, currentSystemId: s, tabs: a, mobileAppSwitcherControls: c }) => {
|
|
986
|
+
const { getIsCollapsed: l } = de(), d = Je(), i = x(() => {
|
|
983
987
|
if (t) {
|
|
984
|
-
const
|
|
985
|
-
t(
|
|
988
|
+
const m = l();
|
|
989
|
+
t(m);
|
|
986
990
|
}
|
|
987
991
|
}, [t, l]);
|
|
988
992
|
return d ? /* @__PURE__ */ e.jsx(
|
|
@@ -1019,54 +1023,54 @@ const Xe = ({ type: t }) => {
|
|
|
1019
1023
|
] }),
|
|
1020
1024
|
/* @__PURE__ */ e.jsx(ce, { shape: "rounded", className: "w-20 h-3" })
|
|
1021
1025
|
] }), Qt = ({ onCloseClick: t, onMarkAllAsRead: r, notificationsListControls: s, scrollableControls: a }) => {
|
|
1022
|
-
const [c, l] = J([]), [d, i] = J("NO_LEIDAS"), [
|
|
1023
|
-
l((
|
|
1024
|
-
const
|
|
1026
|
+
const [c, l] = J([]), [d, i] = J("NO_LEIDAS"), [m, h] = J({ isLoading: !1, type: "load_more" }), [b, p] = J({ hasError: !1 }), g = I(/* @__PURE__ */ new Set()), j = I(null), A = I(null), y = x((u, O = "top") => {
|
|
1027
|
+
l((M) => {
|
|
1028
|
+
const F = Array.isArray(u) ? O === "bottom" ? [...M, ...u] : [...u, ...M] : O === "bottom" ? [...M, u] : [u, ...M];
|
|
1025
1029
|
return queueMicrotask(() => {
|
|
1026
|
-
|
|
1027
|
-
}),
|
|
1030
|
+
g.current.forEach((Q) => Q(F, F.length));
|
|
1031
|
+
}), F;
|
|
1028
1032
|
});
|
|
1029
|
-
}, []), C =
|
|
1030
|
-
|
|
1031
|
-
}), []),
|
|
1032
|
-
l((
|
|
1033
|
-
const
|
|
1033
|
+
}, []), C = x((u) => (g.current.add(u), () => {
|
|
1034
|
+
g.current.delete(u);
|
|
1035
|
+
}), []), S = x((u) => {
|
|
1036
|
+
l((O) => {
|
|
1037
|
+
const M = Array.isArray(u) ? O.filter((F) => !u.includes(F._id)) : O.filter((F) => F._id !== u);
|
|
1034
1038
|
return queueMicrotask(() => {
|
|
1035
|
-
|
|
1036
|
-
}),
|
|
1039
|
+
g.current.forEach((F) => F(M, M.length));
|
|
1040
|
+
}), M;
|
|
1037
1041
|
});
|
|
1038
|
-
}, []),
|
|
1042
|
+
}, []), K = x(() => {
|
|
1039
1043
|
l([]), queueMicrotask(() => {
|
|
1040
|
-
|
|
1044
|
+
g.current.forEach((u) => u([], 0));
|
|
1041
1045
|
});
|
|
1042
|
-
}, []),
|
|
1043
|
-
l(
|
|
1044
|
-
|
|
1046
|
+
}, []), z = x((u) => {
|
|
1047
|
+
l(u), queueMicrotask(() => {
|
|
1048
|
+
g.current.forEach((O) => O(u, u.length));
|
|
1045
1049
|
});
|
|
1046
|
-
}, []),
|
|
1047
|
-
|
|
1048
|
-
}, []), U =
|
|
1049
|
-
|
|
1050
|
+
}, []), k = x((u, O = "load_more") => {
|
|
1051
|
+
h({ isLoading: u, type: O });
|
|
1052
|
+
}, []), U = x((u, O) => {
|
|
1053
|
+
p({ hasError: u, children: O });
|
|
1050
1054
|
}, []);
|
|
1051
1055
|
Re(s, () => ({
|
|
1052
1056
|
addNewNotification: y,
|
|
1053
1057
|
subscribeToUpdates: C,
|
|
1054
|
-
setNotifications:
|
|
1055
|
-
removeNotification:
|
|
1056
|
-
removeAllNotifications:
|
|
1057
|
-
setLoading:
|
|
1058
|
+
setNotifications: z,
|
|
1059
|
+
removeNotification: S,
|
|
1060
|
+
removeAllNotifications: K,
|
|
1061
|
+
setLoading: k,
|
|
1058
1062
|
setError: U
|
|
1059
|
-
}), [y, C,
|
|
1060
|
-
const
|
|
1061
|
-
i(
|
|
1062
|
-
},
|
|
1063
|
+
}), [y, C, z, S, K, k, U]);
|
|
1064
|
+
const v = (u) => {
|
|
1065
|
+
i(u);
|
|
1066
|
+
}, q = c.length > 0;
|
|
1063
1067
|
Ct(() => {
|
|
1064
|
-
if (j.current &&
|
|
1065
|
-
const
|
|
1066
|
-
|
|
1068
|
+
if (j.current && A.current) {
|
|
1069
|
+
const u = j.current.clientHeight;
|
|
1070
|
+
A.current.style.setProperty("height", `calc(100vh - ${u}px - 20px)`);
|
|
1067
1071
|
}
|
|
1068
1072
|
}, [j?.current]);
|
|
1069
|
-
const G = c.filter((
|
|
1073
|
+
const G = c.filter((u) => !u.read).length, { isLoading: V, type: X } = m, { hasError: $, children: _ } = b;
|
|
1070
1074
|
return /* @__PURE__ */ e.jsx(
|
|
1071
1075
|
"section",
|
|
1072
1076
|
{
|
|
@@ -1084,34 +1088,34 @@ const Xe = ({ type: t }) => {
|
|
|
1084
1088
|
It,
|
|
1085
1089
|
{
|
|
1086
1090
|
className: "px-4 md:px-2 md:pl-2 pl-2 gap-0 md:gap-0",
|
|
1087
|
-
onTabChange:
|
|
1091
|
+
onTabChange: v,
|
|
1088
1092
|
activeTab: d,
|
|
1089
1093
|
items: [
|
|
1090
1094
|
{ id: "ALL", title: "Todas" },
|
|
1091
1095
|
{ id: "NO_LEIDAS", title: "Sin leer" }
|
|
1092
1096
|
],
|
|
1093
|
-
renderTab: (
|
|
1097
|
+
renderTab: (u, O, M, F, Q, ae, Z, ve) => /* @__PURE__ */ e.jsxs("div", { className: "relative", children: [
|
|
1094
1098
|
/* @__PURE__ */ e.jsx(
|
|
1095
1099
|
Et,
|
|
1096
1100
|
{
|
|
1097
|
-
id:
|
|
1098
|
-
title:
|
|
1099
|
-
onClick:
|
|
1100
|
-
isActive:
|
|
1101
|
-
onIconClick:
|
|
1101
|
+
id: u.id,
|
|
1102
|
+
title: u.title,
|
|
1103
|
+
onClick: M,
|
|
1104
|
+
isActive: O,
|
|
1105
|
+
onIconClick: F,
|
|
1102
1106
|
onIconHover: Q,
|
|
1103
1107
|
iconTooltipProps: Z,
|
|
1104
1108
|
iconTooltipTitle: ae,
|
|
1105
1109
|
iconSize: ve
|
|
1106
1110
|
}
|
|
1107
1111
|
),
|
|
1108
|
-
G > 0 &&
|
|
1112
|
+
G > 0 && u.id === "NO_LEIDAS" && (V ? /* @__PURE__ */ e.jsx("div", { className: "absolute top-0 right-0", children: /* @__PURE__ */ e.jsx(ce, { className: "size-5.5", shape: "circle" }) }) : /* @__PURE__ */ e.jsx(Qe, { count: G, className: "absolute top-0 right-0" }))
|
|
1109
1113
|
] })
|
|
1110
1114
|
}
|
|
1111
1115
|
),
|
|
1112
|
-
r &&
|
|
1116
|
+
r && q && d === "NO_LEIDAS" && !$ && /* @__PURE__ */ e.jsx("div", { className: "flex justify-end px-4", children: /* @__PURE__ */ e.jsx(he, { disabled: V, onClick: r, label: "Marcar todas como leidas", variant: "text", animate: !1, animateIcon: !1, size: "small" }) })
|
|
1113
1117
|
] }),
|
|
1114
|
-
/* @__PURE__ */ e.jsx("div", { ref:
|
|
1118
|
+
/* @__PURE__ */ e.jsx("div", { ref: A, className: "", children: /* @__PURE__ */ e.jsxs(
|
|
1115
1119
|
xe,
|
|
1116
1120
|
{
|
|
1117
1121
|
className: "px-4 md:px-2 py-0 md:py-0 flex flex-col gap-3 h-full",
|
|
@@ -1125,13 +1129,13 @@ const Xe = ({ type: t }) => {
|
|
|
1125
1129
|
},
|
|
1126
1130
|
scrollMetadata: {
|
|
1127
1131
|
activeTab: d,
|
|
1128
|
-
isLoading:
|
|
1132
|
+
isLoading: V
|
|
1129
1133
|
},
|
|
1130
1134
|
children: [
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
+
$ && /* @__PURE__ */ e.jsx("div", { className: "w-full h-full grid place-items-center", children: typeof _ == "function" ? _() : _ }),
|
|
1136
|
+
!$ && /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1137
|
+
V && X === "skeletons" ? /* @__PURE__ */ e.jsx(Xe, { type: X }) : q ? c?.filter((u) => d === "NO_LEIDAS" ? !u.read : u)?.map((u, O) => /* @__PURE__ */ e.jsx(Ot, { ...u, className: " border-b border-neutral-strong-default rounded-b-none last:border-b-0" }, O)) : /* @__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" }),
|
|
1138
|
+
V && X === "load_more" && /* @__PURE__ */ e.jsx(Xe, { type: X })
|
|
1135
1139
|
] })
|
|
1136
1140
|
]
|
|
1137
1141
|
}
|
|
@@ -1155,24 +1159,24 @@ const Xe = ({ type: t }) => {
|
|
|
1155
1159
|
]
|
|
1156
1160
|
}
|
|
1157
1161
|
), er = ({ closeSidebar: t, options: r, helpSection: s, initialSection: a, notificationsListControls: c, scrollableControls: l }, d) => {
|
|
1158
|
-
const [i,
|
|
1162
|
+
const [i, m] = J(a ?? "notifications");
|
|
1159
1163
|
Re(d, () => ({
|
|
1160
|
-
setActiveSection:
|
|
1164
|
+
setActiveSection: m
|
|
1161
1165
|
}));
|
|
1162
|
-
const
|
|
1166
|
+
const h = () => {
|
|
1163
1167
|
t();
|
|
1164
1168
|
};
|
|
1165
1169
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1166
1170
|
i === "notifications" && !r?.notificationsDrawerOptions?.hide && /* @__PURE__ */ e.jsx(
|
|
1167
1171
|
Qt,
|
|
1168
1172
|
{
|
|
1169
|
-
onCloseClick:
|
|
1173
|
+
onCloseClick: h,
|
|
1170
1174
|
onMarkAllAsRead: r?.notificationsDrawerOptions?.onMarkAllAsRead,
|
|
1171
1175
|
notificationsListControls: c,
|
|
1172
1176
|
scrollableControls: l
|
|
1173
1177
|
}
|
|
1174
1178
|
),
|
|
1175
|
-
i === "help" && s && !r?.helpSectionDrawerOptions?.hide && /* @__PURE__ */ e.jsx(Zt, { onCloseClick:
|
|
1179
|
+
i === "help" && s && !r?.helpSectionDrawerOptions?.hide && /* @__PURE__ */ e.jsx(Zt, { onCloseClick: h, children: typeof s == "function" ? s() : s })
|
|
1176
1180
|
] });
|
|
1177
1181
|
}, bt = be(er);
|
|
1178
1182
|
bt.displayName = "SidebarContent";
|
|
@@ -1197,15 +1201,15 @@ const tr = ({
|
|
|
1197
1201
|
scrollableControls: l
|
|
1198
1202
|
}
|
|
1199
1203
|
);
|
|
1200
|
-
}, xt =
|
|
1204
|
+
}, xt = P(tr);
|
|
1201
1205
|
xt.displayName = "PyrionNavigationDrawer.Sidebar";
|
|
1202
1206
|
const rr = ({ navigationControlsRef: t }) => {
|
|
1203
1207
|
const r = de();
|
|
1204
1208
|
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
1209
|
}, sr = (t) => {
|
|
1206
|
-
const { children: r, currentAppSessions: s, resolveUserSecondarySlot: a, resolveSessionSecondarySlot: c, handleNavigation: l, allActions: d, tabs: i, navigationControlsRef:
|
|
1210
|
+
const { children: r, currentAppSessions: s, resolveUserSecondarySlot: a, resolveSessionSecondarySlot: c, handleNavigation: l, allActions: d, tabs: i, navigationControlsRef: m, sidebarContentRef: h, initialSectionRef: b, userOptionsControls: p, mobileAppSwitcherControls: g, notificationsListControls: j, scrollableControls: A, outletRef: y, ...C } = t;
|
|
1207
1211
|
return /* @__PURE__ */ e.jsxs(re, { disableDragOpen: C.options?.disableDragOpen, outletRef: y, children: [
|
|
1208
|
-
/* @__PURE__ */ e.jsx(rr, { navigationControlsRef:
|
|
1212
|
+
/* @__PURE__ */ e.jsx(rr, { navigationControlsRef: m }),
|
|
1209
1213
|
/* @__PURE__ */ e.jsx(re.Header, { className: "flex flex-col relative w-full select-none", children: /* @__PURE__ */ e.jsx(
|
|
1210
1214
|
ht,
|
|
1211
1215
|
{
|
|
@@ -1213,7 +1217,7 @@ const rr = ({ navigationControlsRef: t }) => {
|
|
|
1213
1217
|
state: C.state,
|
|
1214
1218
|
currentSystemId: C.currentSystemId,
|
|
1215
1219
|
tabs: i,
|
|
1216
|
-
mobileAppSwitcherControls:
|
|
1220
|
+
mobileAppSwitcherControls: g
|
|
1217
1221
|
}
|
|
1218
1222
|
) }, "PL-Header"),
|
|
1219
1223
|
/* @__PURE__ */ e.jsx(re.Content, { className: "overflow-hidden flex flex-col relative flex-1 md:w-auto", children: /* @__PURE__ */ e.jsx(
|
|
@@ -1237,8 +1241,8 @@ const rr = ({ navigationControlsRef: t }) => {
|
|
|
1237
1241
|
onLogoutClick: C.onLogoutClick,
|
|
1238
1242
|
options: C.options,
|
|
1239
1243
|
currentSystemId: C.currentSystemId,
|
|
1240
|
-
userOptionsControls:
|
|
1241
|
-
mobileAppSwitcherControls:
|
|
1244
|
+
userOptionsControls: p,
|
|
1245
|
+
mobileAppSwitcherControls: g,
|
|
1242
1246
|
onProfileClick: C.onProfileClick
|
|
1243
1247
|
}
|
|
1244
1248
|
) }, "PL-Footer"),
|
|
@@ -1254,51 +1258,51 @@ const rr = ({ navigationControlsRef: t }) => {
|
|
|
1254
1258
|
{
|
|
1255
1259
|
options: C.options,
|
|
1256
1260
|
helpSection: C.helpSection,
|
|
1257
|
-
sidebarContentRef:
|
|
1258
|
-
initialSectionRef:
|
|
1261
|
+
sidebarContentRef: h,
|
|
1262
|
+
initialSectionRef: b,
|
|
1259
1263
|
notificationsListControls: j,
|
|
1260
|
-
scrollableControls:
|
|
1264
|
+
scrollableControls: A
|
|
1261
1265
|
}
|
|
1262
1266
|
)
|
|
1263
1267
|
}
|
|
1264
1268
|
)
|
|
1265
1269
|
] });
|
|
1266
|
-
}, gt =
|
|
1270
|
+
}, gt = P(sr, (t, r) => {
|
|
1267
1271
|
const { children: s, ...a } = t, { children: c, ...l } = r, d = Object.keys(a), i = Object.keys(l);
|
|
1268
1272
|
if (d.length !== i.length)
|
|
1269
1273
|
return !1;
|
|
1270
|
-
for (const
|
|
1271
|
-
if (!Object.prototype.hasOwnProperty.call(l,
|
|
1274
|
+
for (const m of d) {
|
|
1275
|
+
if (!Object.prototype.hasOwnProperty.call(l, m))
|
|
1272
1276
|
return !1;
|
|
1273
|
-
const
|
|
1274
|
-
if (
|
|
1277
|
+
const h = a[m], b = l[m];
|
|
1278
|
+
if (h !== b)
|
|
1275
1279
|
return !1;
|
|
1276
1280
|
}
|
|
1277
1281
|
return !0;
|
|
1278
1282
|
});
|
|
1279
1283
|
gt.displayName = "PyrionNavigationDrawer.LayoutBase";
|
|
1280
|
-
const vt =
|
|
1284
|
+
const vt = P(({ children: t }) => /* @__PURE__ */ e.jsx(re.Outlet, { children: t }));
|
|
1281
1285
|
vt.displayName = "PyrionNavigationDrawer.IsolatedOutlet";
|
|
1282
1286
|
const wt = Me(null), Dr = () => {
|
|
1283
1287
|
const t = jt(wt);
|
|
1284
1288
|
if (!t)
|
|
1285
1289
|
throw new Error("usePyrionLayout debe usarse dentro de PyrionLayout");
|
|
1286
1290
|
return t;
|
|
1287
|
-
}, Ar = ({ children: t, helpSection: r, state: s, links: a, onLinkClick: c, onNavigate: l, onLogoutClick: d, actions: i, activeActionId:
|
|
1288
|
-
const
|
|
1291
|
+
}, Ar = ({ children: t, helpSection: r, state: s, links: a, onLinkClick: c, onNavigate: l, onLogoutClick: d, actions: i, activeActionId: m, onActionClick: h, tabsProps: b, currentSystemId: p, onSessionClick: g, onSystemLogoClick: j, onProfileClick: A, ...y }) => {
|
|
1292
|
+
const S = Object.assign({
|
|
1289
1293
|
closeDrawerOnNavigate: !0,
|
|
1290
1294
|
disableDragOpen: {
|
|
1291
1295
|
sidebar: !0,
|
|
1292
1296
|
drawer: !1
|
|
1293
1297
|
}
|
|
1294
|
-
}, y.options),
|
|
1295
|
-
if (
|
|
1298
|
+
}, y.options), K = kt(), z = Je(), k = I(null), U = I(null), v = I({}), q = I(null), G = I("notifications"), V = I(null), X = I(null), $ = I(null), [_, u] = J(0), [O, M] = J(!1), [F, Q] = J(null), ae = x((o) => {
|
|
1299
|
+
if (M(!1), c) {
|
|
1296
1300
|
c(o);
|
|
1297
1301
|
return;
|
|
1298
1302
|
}
|
|
1299
|
-
const
|
|
1300
|
-
|
|
1301
|
-
}, [c, l,
|
|
1303
|
+
const N = window.location.pathname;
|
|
1304
|
+
K(o), S.closeDrawerOnNavigate && Nt() && !v.current?.getIsCollapsed?.() && v.current?.toggleCollapse?.(), l && l(N, o);
|
|
1305
|
+
}, [c, l, K]), Z = (o) => {
|
|
1302
1306
|
o && window.open(o, "_blank");
|
|
1303
1307
|
}, we = {
|
|
1304
1308
|
system: {
|
|
@@ -1311,35 +1315,35 @@ const wt = Me(null), Dr = () => {
|
|
|
1311
1315
|
mobile: Z,
|
|
1312
1316
|
desktop: Z
|
|
1313
1317
|
}
|
|
1314
|
-
}, Ae =
|
|
1315
|
-
const
|
|
1316
|
-
we.system[
|
|
1317
|
-
}, [
|
|
1318
|
-
const
|
|
1319
|
-
we.product[
|
|
1320
|
-
}, [
|
|
1321
|
-
if (
|
|
1322
|
-
|
|
1318
|
+
}, Ae = x((o) => {
|
|
1319
|
+
const N = z ? "mobile" : "desktop", B = s.enabled_systems.find((T) => T.name === o)?.url;
|
|
1320
|
+
we.system[N](B), b?.onTabClick?.(o);
|
|
1321
|
+
}, [z, s.enabled_systems, b?.onTabClick]), We = x((o) => {
|
|
1322
|
+
const N = z ? "mobile" : "desktop", B = s.company.products?.find((T) => T.name === o)?.domain;
|
|
1323
|
+
we.product[N](B), b?.onTabClick?.(o);
|
|
1324
|
+
}, [z, s.company.products, b?.onTabClick]), ue = x((o, N) => {
|
|
1325
|
+
if (N) {
|
|
1326
|
+
N(o), b?.onTabClick?.(o);
|
|
1323
1327
|
return;
|
|
1324
1328
|
} else
|
|
1325
|
-
|
|
1326
|
-
}, [
|
|
1329
|
+
b?.onTabClick?.(o);
|
|
1330
|
+
}, [b?.onTabClick]), He = x(() => {
|
|
1327
1331
|
const o = {};
|
|
1328
|
-
s.enabled_systems.forEach((
|
|
1329
|
-
o[
|
|
1332
|
+
s.enabled_systems.forEach((B) => {
|
|
1333
|
+
o[B.url] = B.name;
|
|
1330
1334
|
});
|
|
1331
|
-
const
|
|
1332
|
-
for (const [
|
|
1333
|
-
if (
|
|
1335
|
+
const N = window.location.origin;
|
|
1336
|
+
for (const [B, T] of Object.entries(o))
|
|
1337
|
+
if (N === B)
|
|
1334
1338
|
return T;
|
|
1335
1339
|
return "";
|
|
1336
|
-
}, [s.enabled_systems]), Te =
|
|
1340
|
+
}, [s.enabled_systems]), Te = b?.currentTabName || He(), Oe = pe(
|
|
1337
1341
|
() => s.sessions || [],
|
|
1338
1342
|
[s.sessions]
|
|
1339
|
-
), ee = (o) => o == null ? null : typeof o == "string" || typeof o == "number" || typeof o == "boolean" ? String(o) : ke(o) ? o : typeof o == "object" ? JSON.stringify(o) : null, fe =
|
|
1343
|
+
), ee = (o) => o == null ? null : typeof o == "string" || typeof o == "number" || typeof o == "boolean" ? String(o) : ke(o) ? o : typeof o == "object" ? JSON.stringify(o) : null, fe = x((o, N) => {
|
|
1340
1344
|
if (!o) return null;
|
|
1341
1345
|
if (Array.isArray(o)) {
|
|
1342
|
-
const
|
|
1346
|
+
const B = o?.[0] ? Se(N, o[0]) : null, T = o?.[1] ? Se(N, o[1]) : null, ne = ee(B), Ve = ee(T);
|
|
1343
1347
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1344
1348
|
/* @__PURE__ */ e.jsx("p", { className: "prometeo-fonts-body-small text-neutral-default-default line-clamp-1 min-w-[40%] text-nowrap wrap-break-word overflow-hidden text-ellipsis", children: ne }),
|
|
1345
1349
|
Ve && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1 flex-1 grow shrink-0 min-w-max max-w-2/3 overflow-visible ", children: [
|
|
@@ -1349,112 +1353,112 @@ const wt = Me(null), Dr = () => {
|
|
|
1349
1353
|
] });
|
|
1350
1354
|
}
|
|
1351
1355
|
if (typeof o == "string") {
|
|
1352
|
-
const
|
|
1353
|
-
return ee(
|
|
1356
|
+
const B = Se(N, o);
|
|
1357
|
+
return ee(B);
|
|
1354
1358
|
}
|
|
1355
|
-
return typeof o == "function" ? ee(o(
|
|
1356
|
-
}, []), n =
|
|
1359
|
+
return typeof o == "function" ? ee(o(N)) : null;
|
|
1360
|
+
}, []), n = x(
|
|
1357
1361
|
(o) => {
|
|
1358
|
-
const
|
|
1359
|
-
if (!
|
|
1360
|
-
const
|
|
1361
|
-
return fe(
|
|
1362
|
+
const N = S?.userCardOptions?.secondarySlot;
|
|
1363
|
+
if (!N) return null;
|
|
1364
|
+
const B = s.enabled_systems?.find((ne) => ne._id === p), T = { company: s.company, user: s.user, system: B, metadata: o };
|
|
1365
|
+
return fe(N, T);
|
|
1362
1366
|
},
|
|
1363
|
-
[
|
|
1364
|
-
),
|
|
1367
|
+
[p, S?.userCardOptions?.secondarySlot, fe, s.company, s.enabled_systems, s.user]
|
|
1368
|
+
), f = x(
|
|
1365
1369
|
(o) => {
|
|
1366
|
-
const
|
|
1367
|
-
if (!
|
|
1368
|
-
const
|
|
1369
|
-
return fe(
|
|
1370
|
+
const N = S?.sessionCardOptions?.secondarySlot || S?.userCardOptions?.secondarySlot;
|
|
1371
|
+
if (!N) return null;
|
|
1372
|
+
const B = s.enabled_systems?.find((ne) => ne._id === p), T = { company: s.company, user: o.auth_id, metadata: o?.metadata, system: B };
|
|
1373
|
+
return fe(N, T);
|
|
1370
1374
|
},
|
|
1371
|
-
[
|
|
1372
|
-
),
|
|
1375
|
+
[p, S?.sessionCardOptions?.secondarySlot, S?.userCardOptions?.secondarySlot, fe, s.company, s.enabled_systems]
|
|
1376
|
+
), w = pe(() => {
|
|
1373
1377
|
const o = [];
|
|
1374
|
-
return
|
|
1375
|
-
G.current = "notifications",
|
|
1376
|
-
},
|
|
1377
|
-
G.current = "help",
|
|
1378
|
-
}, !
|
|
1378
|
+
return v.current.openNotifications = () => {
|
|
1379
|
+
G.current = "notifications", v.current.openSidebar?.(), q.current?.setActiveSection("notifications");
|
|
1380
|
+
}, v.current.openHelp = () => {
|
|
1381
|
+
G.current = "help", v.current.openSidebar?.(), q.current?.setActiveSection("help");
|
|
1382
|
+
}, !S?.notificationsDrawerOptions?.hideActionButton && !S?.notificationsDrawerOptions?.hide && o.push({
|
|
1379
1383
|
id: "notifications",
|
|
1380
1384
|
title: "Notificaciones",
|
|
1381
1385
|
icon: et,
|
|
1382
|
-
onClick:
|
|
1386
|
+
onClick: v.current.openNotifications,
|
|
1383
1387
|
count: _
|
|
1384
|
-
}), !
|
|
1388
|
+
}), !S?.helpSectionDrawerOptions?.hideActionButton && r && !S?.helpSectionDrawerOptions?.hide && o.push({
|
|
1385
1389
|
id: "help",
|
|
1386
1390
|
title: "Ayuda",
|
|
1387
1391
|
icon: tt,
|
|
1388
|
-
onClick:
|
|
1389
|
-
}),
|
|
1392
|
+
onClick: v.current.openHelp
|
|
1393
|
+
}), S?.configurationActionOptions?.onClick && !S?.configurationActionOptions?.hideActionButton && o.push({
|
|
1390
1394
|
id: "configuration",
|
|
1391
1395
|
title: "Configuracion",
|
|
1392
1396
|
icon: _t,
|
|
1393
|
-
onClick:
|
|
1397
|
+
onClick: S.configurationActionOptions?.onClick
|
|
1394
1398
|
}), o;
|
|
1395
|
-
}, [
|
|
1396
|
-
() => [...
|
|
1397
|
-
[
|
|
1398
|
-
),
|
|
1399
|
+
}, [S, r, h, _]), E = pe(
|
|
1400
|
+
() => [...w, ...i || []],
|
|
1401
|
+
[w, i]
|
|
1402
|
+
), H = pe(() => {
|
|
1399
1403
|
const o = s.enabled_systems.map((T) => ({
|
|
1400
1404
|
name: T.name,
|
|
1401
1405
|
thumbnail: T.thumbnail,
|
|
1402
1406
|
onClick: Ae,
|
|
1403
1407
|
id: T._id
|
|
1404
|
-
})) || [],
|
|
1408
|
+
})) || [], N = b?.customTabs?.map((T) => ({
|
|
1405
1409
|
...T,
|
|
1406
1410
|
onClick: () => ue(T.name, T?.onClick)
|
|
1407
|
-
})) || [],
|
|
1411
|
+
})) || [], B = s.company.products?.map((T) => ({
|
|
1408
1412
|
name: T.name,
|
|
1409
1413
|
thumbnail: T.thumbnail,
|
|
1410
1414
|
onClick: We
|
|
1411
1415
|
})) || [];
|
|
1412
|
-
return [...o, ...
|
|
1413
|
-
}, [s.enabled_systems, s.company.products,
|
|
1414
|
-
|
|
1415
|
-
}, []), te =
|
|
1416
|
-
}), []), oe =
|
|
1417
|
-
|
|
1418
|
-
}, []), me =
|
|
1419
|
-
|
|
1420
|
-
}, []), Ne =
|
|
1421
|
-
|
|
1422
|
-
}, []), ye =
|
|
1423
|
-
}), []), L =
|
|
1424
|
-
|
|
1425
|
-
}, []), Y =
|
|
1426
|
-
|
|
1427
|
-
}, []), W =
|
|
1428
|
-
|
|
1429
|
-
}, []), le =
|
|
1430
|
-
|
|
1431
|
-
}, []), Ie =
|
|
1432
|
-
|
|
1433
|
-
}, []), Ce =
|
|
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",
|
|
1435
|
-
!
|
|
1416
|
+
return [...o, ...N, ...B];
|
|
1417
|
+
}, [s.enabled_systems, s.company.products, b?.customTabs]), R = x((o, N) => {
|
|
1418
|
+
k.current?.addNewNotification ? k.current.addNewNotification(o, N) : console.warn("Notifications controls not ready yet");
|
|
1419
|
+
}, []), te = x((o) => k.current?.subscribeToUpdates ? k.current.subscribeToUpdates(o) : (console.warn("Notifications controls not ready yet"), () => {
|
|
1420
|
+
}), []), oe = x((o) => {
|
|
1421
|
+
k.current?.removeNotification ? k.current.removeNotification(o) : console.warn("Notifications controls not ready yet");
|
|
1422
|
+
}, []), me = x(() => {
|
|
1423
|
+
k.current?.removeAllNotifications ? k.current.removeAllNotifications() : console.warn("Notifications controls not ready yet");
|
|
1424
|
+
}, []), Ne = x((o) => {
|
|
1425
|
+
k.current?.setNotifications ? k.current.setNotifications(o) : console.warn("Notifications controls not ready yet");
|
|
1426
|
+
}, []), ye = x((o, N) => U.current?.subscribeToScrollTarget ? U.current.subscribeToScrollTarget(o, N) : (console.warn("Scrollable controls not ready yet"), () => {
|
|
1427
|
+
}), []), L = x((o, N = "load_more") => {
|
|
1428
|
+
k.current?.setLoading ? k.current.setLoading(o, N) : console.warn("Notifications controls not ready yet");
|
|
1429
|
+
}, []), Y = x((o, N) => {
|
|
1430
|
+
k.current?.setError ? k.current.setError(o, N) : console.warn("Notifications controls not ready yet");
|
|
1431
|
+
}, []), W = x(() => {
|
|
1432
|
+
V.current?.open();
|
|
1433
|
+
}, []), le = x(() => {
|
|
1434
|
+
V.current?.close();
|
|
1435
|
+
}, []), Ie = x(() => {
|
|
1436
|
+
V.current?.toggle();
|
|
1437
|
+
}, []), Ce = x((o, N, B) => {
|
|
1438
|
+
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", N ? "fixed" : "sticky"), children: [
|
|
1439
|
+
!B && /* @__PURE__ */ e.jsx(he, { label: "", icon: /* @__PURE__ */ e.jsx(Fe, {}), onClick: () => M(!1), variant: "text", className: "absolute top-0 right-0", size: "small", color: "secondary" }),
|
|
1436
1440
|
typeof o == "function" ? o() : o
|
|
1437
1441
|
] });
|
|
1438
1442
|
let ne;
|
|
1439
|
-
return
|
|
1440
|
-
}, [
|
|
1441
|
-
|
|
1443
|
+
return N ? ne = $e(T, document.body, `modal-error-${Date.now()}`) : $.current && (ne = $e(T, $.current, `modal-error-${Date.now()}`)), Q(ne), M(!0), T;
|
|
1444
|
+
}, [$]), je = x(() => {
|
|
1445
|
+
M(!1);
|
|
1442
1446
|
}, []);
|
|
1443
|
-
return
|
|
1444
|
-
te((o,
|
|
1445
|
-
|
|
1447
|
+
return v.current.addNewNotification = R, v.current.subscribeToNotificationsUpdates = te, v.current.removeNotification = oe, v.current.removeAllNotifications = me, v.current.setNotifications = Ne, v.current.setNotificationsError = Y, v.current.setNotificationsLoading = L, v.current.subscribeToNotificationsScroll = ye, v.current.showErrorModal = Ce, v.current.closeErrorModal = je, v.current.userCardExpand = W, v.current.userCardCollapse = le, v.current.userCardToggle = Ie, se(() => {
|
|
1448
|
+
te((o, N) => {
|
|
1449
|
+
u(N);
|
|
1446
1450
|
});
|
|
1447
|
-
}, [te]), /* @__PURE__ */ e.jsxs(wt.Provider, { value:
|
|
1448
|
-
|
|
1451
|
+
}, [te]), /* @__PURE__ */ e.jsxs(wt.Provider, { value: v.current, children: [
|
|
1452
|
+
O && F,
|
|
1449
1453
|
/* @__PURE__ */ e.jsxs("div", { className: "flex h-screen", children: [
|
|
1450
1454
|
/* @__PURE__ */ e.jsx(
|
|
1451
1455
|
Pt,
|
|
1452
1456
|
{
|
|
1453
1457
|
className: "hidden md:flex",
|
|
1454
|
-
tabs:
|
|
1458
|
+
tabs: H,
|
|
1455
1459
|
activeColor: "var(--neutral-900)",
|
|
1456
1460
|
currentTabName: Te,
|
|
1457
|
-
currentSystemId:
|
|
1461
|
+
currentSystemId: p,
|
|
1458
1462
|
isLoading: !s.enabled_systems || s.enabled_systems.length === 0
|
|
1459
1463
|
}
|
|
1460
1464
|
),
|
|
@@ -1464,28 +1468,28 @@ const wt = Me(null), Dr = () => {
|
|
|
1464
1468
|
links: a,
|
|
1465
1469
|
handleNavigation: ae,
|
|
1466
1470
|
allActions: E,
|
|
1467
|
-
activeActionId:
|
|
1468
|
-
onActionClick:
|
|
1471
|
+
activeActionId: m,
|
|
1472
|
+
onActionClick: h,
|
|
1469
1473
|
state: s,
|
|
1470
1474
|
currentAppSessions: Oe,
|
|
1471
1475
|
resolveUserSecondarySlot: n,
|
|
1472
|
-
resolveSessionSecondarySlot:
|
|
1473
|
-
onSessionClick:
|
|
1476
|
+
resolveSessionSecondarySlot: f,
|
|
1477
|
+
onSessionClick: g,
|
|
1474
1478
|
onLogoutClick: d,
|
|
1475
|
-
options:
|
|
1476
|
-
currentSystemId:
|
|
1477
|
-
userOptionsControls:
|
|
1479
|
+
options: S,
|
|
1480
|
+
currentSystemId: p,
|
|
1481
|
+
userOptionsControls: V,
|
|
1478
1482
|
mobileAppSwitcherControls: X,
|
|
1479
1483
|
onSystemLogoClick: j,
|
|
1480
|
-
tabs:
|
|
1484
|
+
tabs: H,
|
|
1481
1485
|
helpSection: r,
|
|
1482
|
-
sidebarContentRef:
|
|
1486
|
+
sidebarContentRef: q,
|
|
1483
1487
|
initialSectionRef: G,
|
|
1484
|
-
navigationControlsRef:
|
|
1485
|
-
notificationsListControls:
|
|
1488
|
+
navigationControlsRef: v,
|
|
1489
|
+
notificationsListControls: k,
|
|
1486
1490
|
scrollableControls: U,
|
|
1487
|
-
outletRef:
|
|
1488
|
-
onProfileClick:
|
|
1491
|
+
outletRef: $,
|
|
1492
|
+
onProfileClick: A,
|
|
1489
1493
|
children: t
|
|
1490
1494
|
}
|
|
1491
1495
|
)
|