@nice2dev/ui 1.4.1 → 1.4.2
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/CHANGELOG.md +44 -0
- package/dist/NiceCodeEditor-DhdjnDLV.cjs +289 -0
- package/dist/{NiceDataGrid-BT6iCUgP.cjs → NiceDataGrid-CrKDzMM1.cjs} +1 -1
- package/dist/{NiceForm-Bysp66Ef.cjs → NiceForm-CT9hEXpc.cjs} +1 -1
- package/dist/NiceLoginForm-C2-WgRn0.cjs +1 -0
- package/dist/NiceMention-BZEHqPrf.cjs +432 -0
- package/dist/NiceModuleLifecyclePanel-DKlqKPy2.cjs +1 -0
- package/dist/{NiceSavedQueryPanel-BbznsXFd.cjs → NiceSavedQueryPanel-C5Ab_NWx.cjs} +1 -1
- package/dist/NiceScheduler-BZQAKEVF.cjs +5 -0
- package/dist/{NiceWindow-pgR4c-kQ.cjs → NiceWindow-BklnkBpu.cjs} +1 -1
- package/dist/charts/NiceLinearGauge.mjs +96 -83
- package/dist/charts/NicePolarChart.mjs +47 -47
- package/dist/charts-BzlvCCg9.cjs +768 -0
- package/dist/charts.cjs +1 -1
- package/dist/{core-lazy-CL4ZIxF-.cjs → core-lazy-VTd5zfoZ.cjs} +1 -1
- package/dist/data.cjs +1 -1
- package/dist/display/NiceAvatar.mjs +40 -24
- package/dist/editors/pickers/NiceDateRangeBox.mjs +92 -92
- package/dist/editors/pickers/NiceDateTimePicker.mjs +173 -173
- package/dist/editors/rich/NiceCodeEditor.mjs +645 -584
- package/dist/editors/rich/NiceDocumentEditor.mjs +277 -254
- package/dist/editors.cjs +1 -1
- package/dist/feedback/NiceDrawer.mjs +15 -15
- package/dist/feedback.cjs +1 -1
- package/dist/index.cjs +202 -202
- package/dist/index.d.ts +18 -0
- package/dist/lazy.cjs +1 -1
- package/dist/navigation/NiceNavShell.mjs +646 -593
- package/dist/navigation/NiceSidebarNav.mjs +844 -823
- package/dist/navigation.cjs +1 -1
- package/dist/overlays/NiceWindow.mjs +91 -91
- package/dist/overlays.cjs +1 -1
- package/dist/planning/NiceScheduler.mjs +170 -169
- package/dist/planning/NiceSchedulerViews.mjs +242 -233
- package/dist/style.css +2 -2
- package/dist/utility/intlNames.mjs +26 -16
- package/package.json +4 -4
- package/dist/NiceCodeEditor-D0QZW88r.cjs +0 -268
- package/dist/NiceLoginForm-FGf32sro.cjs +0 -1
- package/dist/NiceMention-sc8W-DwH.cjs +0 -430
- package/dist/NiceModuleLifecyclePanel-DBQPCa_V.cjs +0 -1
- package/dist/NiceScheduler-3Ez0zSQJ.cjs +0 -5
- package/dist/charts-B0tHOpJ7.cjs +0 -768
|
@@ -1,25 +1,26 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useNiceTranslation as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { TreeDragSessionProvider as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
1
|
+
import { jsx as s, jsxs as le, Fragment as Rt } from "react/jsx-runtime";
|
|
2
|
+
import { useNiceTranslation as Cn, useInputEngine as Ot, useIntent as Lt, focusCandidates as Gn, useMediaQuery as Bt, useControllableState as Dt, NiceIcon as W, NiceInputHintBar as Wn, NiceSpatialNavProvider as At, useRovingFocus as qn, useOverlayFocus as Ht } from "@nice2dev/ui-core";
|
|
3
|
+
import { forwardRef as Et, useRef as ie, useCallback as w, useMemo as z, useState as V, useEffect as xe, useLayoutEffect as Jn, Fragment as Qn } from "react";
|
|
4
|
+
import { TreeDragSessionProvider as Ft, useTreeDragSession as $t } from "../data/treeDragSession.mjs";
|
|
5
|
+
import { NiceDrawer as Kt } from "../feedback/NiceDrawer.mjs";
|
|
6
|
+
import { NiceOnScreenKeyboardHost as zt } from "../input/NiceOnScreenKeyboard.mjs";
|
|
7
|
+
import { NiceTutorial as Yt } from "../overlays/NiceTutorial.mjs";
|
|
8
|
+
import { navItemDrag as Xt } from "./navItemDrag.mjs";
|
|
9
|
+
import { NiceNavShellPaneContext as et } from "./navShellPane.mjs";
|
|
10
|
+
import { NiceFirstRunPreferences as jt } from "./NiceFirstRunPreferences.mjs";
|
|
11
|
+
import { NiceIconRail as Ut } from "./NiceIconRail.mjs";
|
|
12
|
+
import { NiceNavShellHome as Vt } from "./NiceNavShellHome.mjs";
|
|
13
|
+
import { useSidebarNavPrefs as Gt, sidebarPrefsHostControlled as Wt, NiceSidebarNav as Zn } from "./NiceSidebarNav.mjs";
|
|
14
|
+
import { NiceTopNav as qt } from "./NiceTopNav.mjs";
|
|
15
|
+
import { useDisplayMode as Jt, resolvePageMode as Qt } from "./pageMode.mjs";
|
|
16
|
+
import { buildSidebarPrefsRoutes as Zt } from "./sidebarPrefs/niceSidebarPrefsRoutes.mjs";
|
|
17
|
+
import { SidebarPrefsScopeProvider as eo } from "./sidebarPrefs/SidebarUserIdContext.mjs";
|
|
17
18
|
/* empty css */
|
|
18
|
-
function
|
|
19
|
+
function nt(a) {
|
|
19
20
|
return typeof window > "u" ? null : a === "localStorage" ? window.localStorage : a === "session" ? window.sessionStorage : null;
|
|
20
21
|
}
|
|
21
|
-
function
|
|
22
|
-
const d =
|
|
22
|
+
function no(a, u) {
|
|
23
|
+
const d = nt(a);
|
|
23
24
|
if (!d)
|
|
24
25
|
return null;
|
|
25
26
|
try {
|
|
@@ -27,17 +28,17 @@ function Wt(a, u) {
|
|
|
27
28
|
if (!m)
|
|
28
29
|
return null;
|
|
29
30
|
const N = JSON.parse(m);
|
|
30
|
-
return Array.isArray(N) ?
|
|
31
|
+
return Array.isArray(N) ? tt(N, !0) : null;
|
|
31
32
|
} catch {
|
|
32
33
|
return null;
|
|
33
34
|
}
|
|
34
35
|
}
|
|
35
|
-
const
|
|
36
|
-
function
|
|
36
|
+
const to = ["columns", "rows", "grid"];
|
|
37
|
+
function tt(a, u) {
|
|
37
38
|
return a.filter(
|
|
38
39
|
(d) => !!d && typeof d == "object" && typeof d.id == "string" && typeof d.route == "string"
|
|
39
40
|
).map((d) => {
|
|
40
|
-
const m = u && Array.isArray(d.panes) ?
|
|
41
|
+
const m = u && Array.isArray(d.panes) ? tt(d.panes, !1) : [];
|
|
41
42
|
return {
|
|
42
43
|
id: d.id,
|
|
43
44
|
route: d.route,
|
|
@@ -48,12 +49,12 @@ function qn(a, u) {
|
|
|
48
49
|
color: typeof d.color == "string" ? d.color : void 0,
|
|
49
50
|
...m.length > 1 ? {
|
|
50
51
|
panes: m,
|
|
51
|
-
layout:
|
|
52
|
+
layout: to.includes(d.layout) ? d.layout : void 0
|
|
52
53
|
} : {}
|
|
53
54
|
};
|
|
54
55
|
});
|
|
55
56
|
}
|
|
56
|
-
function
|
|
57
|
+
function ot(a) {
|
|
57
58
|
return {
|
|
58
59
|
id: a.id,
|
|
59
60
|
route: a.route,
|
|
@@ -61,75 +62,75 @@ function Jn(a) {
|
|
|
61
62
|
dirty: a.dirty,
|
|
62
63
|
closable: a.closable,
|
|
63
64
|
color: a.color,
|
|
64
|
-
...a.panes && a.panes.length > 0 ? { layout: a.layout, panes: a.panes.map(
|
|
65
|
+
...a.panes && a.panes.length > 0 ? { layout: a.layout, panes: a.panes.map(ot) } : {}
|
|
65
66
|
};
|
|
66
67
|
}
|
|
67
|
-
const
|
|
68
|
-
function
|
|
68
|
+
const lt = (a) => a.panes && a.panes.length > 0 ? a.panes : [a], Be = (a, u) => u != null && (a.route === u || !!a.panes?.some((d) => d.route === u));
|
|
69
|
+
function it(a, u, d) {
|
|
69
70
|
return {
|
|
70
71
|
...a,
|
|
71
72
|
label: a.panes ? void 0 : u(a.route),
|
|
72
73
|
icon: a.panes ? void 0 : d(a.route),
|
|
73
|
-
...a.panes ? { panes: a.panes.map((m) =>
|
|
74
|
+
...a.panes ? { panes: a.panes.map((m) => it(m, u, d)) } : {}
|
|
74
75
|
};
|
|
75
76
|
}
|
|
76
|
-
function
|
|
77
|
-
const N = new Set(u),
|
|
78
|
-
if (
|
|
77
|
+
function oo(a, u, d, m) {
|
|
78
|
+
const N = new Set(u), P = a.filter((S) => N.has(S.id)).flatMap(lt).map(({ panes: S, layout: q, ...A }) => ({ ...A, pinned: void 0 }));
|
|
79
|
+
if (P.length < 2)
|
|
79
80
|
return { tabs: a };
|
|
80
|
-
const
|
|
81
|
-
id: `split:${
|
|
82
|
-
route:
|
|
81
|
+
const k = {
|
|
82
|
+
id: `split:${P.map((S) => S.id).join("+")}`,
|
|
83
|
+
route: P.some((S) => S.route === m) ? m : P[0].route,
|
|
83
84
|
label: void 0,
|
|
84
|
-
panes:
|
|
85
|
+
panes: P,
|
|
85
86
|
layout: d
|
|
86
|
-
},
|
|
87
|
-
return { tabs: [...
|
|
87
|
+
}, R = a.findIndex((S) => N.has(S.id)), G = a.slice(0, R).filter((S) => !N.has(S.id)), L = a.slice(R).filter((S) => !N.has(S.id));
|
|
88
|
+
return { tabs: [...G, k, ...L], merged: k };
|
|
88
89
|
}
|
|
89
|
-
function
|
|
90
|
-
const m =
|
|
90
|
+
function lo(a, u, d) {
|
|
91
|
+
const m = nt(a);
|
|
91
92
|
if (m)
|
|
92
93
|
try {
|
|
93
|
-
m.setItem(u, JSON.stringify(d.map(
|
|
94
|
+
m.setItem(u, JSON.stringify(d.map(ot)));
|
|
94
95
|
} catch {
|
|
95
96
|
}
|
|
96
97
|
}
|
|
97
98
|
function he(a, u, d) {
|
|
98
99
|
return u && a in u ? u[a] : d ?? a;
|
|
99
100
|
}
|
|
100
|
-
const
|
|
101
|
+
const io = 5, un = 28, Ge = {
|
|
101
102
|
columns: "columns",
|
|
102
103
|
rows: "list",
|
|
103
104
|
grid: "grid"
|
|
104
105
|
};
|
|
105
|
-
function
|
|
106
|
-
const { t: u } =
|
|
106
|
+
function ao(a) {
|
|
107
|
+
const { t: u } = Cn(), {
|
|
107
108
|
tabs: d,
|
|
108
109
|
activeId: m,
|
|
109
110
|
scrollable: N,
|
|
110
|
-
closable:
|
|
111
|
-
pinnable:
|
|
112
|
-
reorderable:
|
|
113
|
-
mergeable:
|
|
111
|
+
closable: P,
|
|
112
|
+
pinnable: k,
|
|
113
|
+
reorderable: R,
|
|
114
|
+
mergeable: G,
|
|
114
115
|
contextMenu: L,
|
|
115
|
-
routeLabels:
|
|
116
|
-
routeIcons:
|
|
116
|
+
routeLabels: S,
|
|
117
|
+
routeIcons: q,
|
|
117
118
|
canMerge: A,
|
|
118
|
-
colorStyle:
|
|
119
|
-
onActivate:
|
|
120
|
-
onClose:
|
|
119
|
+
colorStyle: J,
|
|
120
|
+
onActivate: Me,
|
|
121
|
+
onClose: Q,
|
|
121
122
|
onCloseOthers: be,
|
|
122
|
-
onCloseAll:
|
|
123
|
+
onCloseAll: _e,
|
|
123
124
|
onPin: ae,
|
|
124
|
-
onReorder:
|
|
125
|
-
onMerge:
|
|
125
|
+
onReorder: Ie,
|
|
126
|
+
onMerge: M,
|
|
126
127
|
onSplit: H,
|
|
127
|
-
onLayout:
|
|
128
|
-
} = a, X = ie(null), [
|
|
129
|
-
|
|
128
|
+
onLayout: Z
|
|
129
|
+
} = a, X = ie(null), [We, De] = V({ left: !1, right: !1 }), [T, se] = V(null), we = ie(null), re = ie(null), [ce, Ae] = V(null), j = $t(), Pe = ie(!1), [qe, de] = V([]), ve = ie(null);
|
|
130
|
+
qn(X, {
|
|
130
131
|
orientation: "horizontal",
|
|
131
132
|
onMove: (e) => e.click()
|
|
132
|
-
}),
|
|
133
|
+
}), Ht(we, { open: T !== null, modal: !1, onClose: () => se(null) }), qn(we, { orientation: "vertical", wrap: !0, enabled: T !== null });
|
|
133
134
|
const F = w(() => {
|
|
134
135
|
const e = X.current;
|
|
135
136
|
e && De({
|
|
@@ -137,12 +138,12 @@ function eo(a) {
|
|
|
137
138
|
right: e.scrollLeft + e.clientWidth < e.scrollWidth - 2
|
|
138
139
|
});
|
|
139
140
|
}, []);
|
|
140
|
-
|
|
141
|
+
Jn(() => {
|
|
141
142
|
F();
|
|
142
|
-
}, [d.length, F]),
|
|
143
|
+
}, [d.length, F]), xe(() => {
|
|
143
144
|
if (!(typeof window > "u"))
|
|
144
145
|
return window.addEventListener("resize", F), () => window.removeEventListener("resize", F);
|
|
145
|
-
}, [F]),
|
|
146
|
+
}, [F]), xe(() => {
|
|
146
147
|
if (!m)
|
|
147
148
|
return;
|
|
148
149
|
const e = X.current?.querySelector(
|
|
@@ -150,93 +151,93 @@ function eo(a) {
|
|
|
150
151
|
);
|
|
151
152
|
e && typeof e.scrollIntoView == "function" && e.scrollIntoView({ inline: "nearest", block: "nearest", behavior: "smooth" });
|
|
152
153
|
}, [m]);
|
|
153
|
-
const
|
|
154
|
+
const fn = w(
|
|
154
155
|
(e) => {
|
|
155
156
|
if (!N)
|
|
156
157
|
return;
|
|
157
158
|
const l = X.current;
|
|
158
159
|
if (!l)
|
|
159
160
|
return;
|
|
160
|
-
const
|
|
161
|
-
|
|
161
|
+
const r = Math.abs(e.deltaY) > Math.abs(e.deltaX) ? e.deltaY : e.deltaX;
|
|
162
|
+
r !== 0 && (l.scrollLeft += r, F());
|
|
162
163
|
},
|
|
163
164
|
[N, F]
|
|
164
|
-
),
|
|
165
|
+
), Je = w(
|
|
165
166
|
(e) => {
|
|
166
167
|
const l = X.current;
|
|
167
168
|
l && (l.scrollBy({ left: e * Math.max(120, l.clientWidth * 0.6), behavior: "smooth" }), window.setTimeout(F, 220));
|
|
168
169
|
},
|
|
169
170
|
[F]
|
|
170
171
|
);
|
|
171
|
-
|
|
172
|
-
const e =
|
|
173
|
-
if (!
|
|
172
|
+
Jn(() => {
|
|
173
|
+
const e = we.current;
|
|
174
|
+
if (!T || !e || typeof window > "u")
|
|
174
175
|
return;
|
|
175
|
-
const l = e.getBoundingClientRect(),
|
|
176
|
-
(
|
|
177
|
-
}, [
|
|
178
|
-
if (!
|
|
176
|
+
const l = e.getBoundingClientRect(), r = Math.max(8, Math.min(T.x, window.innerWidth - l.width - 8)), v = Math.max(8, Math.min(T.y, window.innerHeight - l.height - 8));
|
|
177
|
+
(r !== T.x || v !== T.y) && se({ ...T, x: r, y: v });
|
|
178
|
+
}, [T]), xe(() => {
|
|
179
|
+
if (!T)
|
|
179
180
|
return;
|
|
180
181
|
const e = (l) => {
|
|
181
|
-
l.target.closest(".nice-nav-shell__tab-menu") ||
|
|
182
|
+
l.target.closest(".nice-nav-shell__tab-menu") || se(null);
|
|
182
183
|
};
|
|
183
184
|
return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
|
|
184
|
-
}, [
|
|
185
|
-
const E =
|
|
186
|
-
const e = d.filter((
|
|
185
|
+
}, [T]);
|
|
186
|
+
const E = z(() => {
|
|
187
|
+
const e = d.filter((r) => r.pinned), l = d.filter((r) => !r.pinned);
|
|
187
188
|
return [...e, ...l];
|
|
188
|
-
}, [d]),
|
|
189
|
-
() => E.filter((e) =>
|
|
190
|
-
[E,
|
|
191
|
-
),
|
|
189
|
+
}, [d]), ee = z(
|
|
190
|
+
() => E.filter((e) => qe.includes(e.id)).map((e) => e.id),
|
|
191
|
+
[E, qe]
|
|
192
|
+
), Ne = w(
|
|
192
193
|
(e, l) => {
|
|
193
|
-
const
|
|
194
|
-
|
|
194
|
+
const r = E.findIndex((I) => I.id === e), v = E[r + l];
|
|
195
|
+
r >= 0 && v && !!v.pinned == !!E[r].pinned && Ie(e, v.id);
|
|
195
196
|
},
|
|
196
|
-
[E,
|
|
197
|
-
),
|
|
198
|
-
const l =
|
|
197
|
+
[E, Ie]
|
|
198
|
+
), ne = (e) => e.label ?? he(e.route, S, e.route), C = (e) => {
|
|
199
|
+
const l = ne(e);
|
|
199
200
|
return typeof l == "string" ? l : e.route;
|
|
200
|
-
},
|
|
201
|
-
if (
|
|
202
|
-
|
|
201
|
+
}, Qe = (e, l) => {
|
|
202
|
+
if (Pe.current) {
|
|
203
|
+
Pe.current = !1;
|
|
203
204
|
return;
|
|
204
205
|
}
|
|
205
|
-
if (
|
|
206
|
+
if (G && A(l) && (e.shiftKey || e.ctrlKey || e.metaKey)) {
|
|
206
207
|
if (e.preventDefault(), e.shiftKey) {
|
|
207
|
-
const
|
|
208
|
+
const r = ve.current ?? m ?? l.id, v = E.findIndex((O) => O.id === r), I = E.findIndex((O) => O.id === l.id), [te, ge] = v < 0 ? [I, I] : [Math.min(v, I), Math.max(v, I)];
|
|
208
209
|
de(
|
|
209
|
-
E.slice(
|
|
210
|
+
E.slice(te, ge + 1).filter(A).map((O) => O.id)
|
|
210
211
|
);
|
|
211
212
|
} else
|
|
212
|
-
|
|
213
|
+
Ze(l);
|
|
213
214
|
return;
|
|
214
215
|
}
|
|
215
|
-
de([]), ve.current = l.id,
|
|
216
|
-
},
|
|
217
|
-
const l = E.find((
|
|
218
|
-
de((
|
|
219
|
-
const v =
|
|
220
|
-
return v.includes(e.id) ? v.filter((
|
|
216
|
+
de([]), ve.current = l.id, Me(l);
|
|
217
|
+
}, Ze = (e) => {
|
|
218
|
+
const l = E.find((r) => r.id === m);
|
|
219
|
+
de((r) => {
|
|
220
|
+
const v = r.length === 0 && l && l.id !== e.id && A(l) ? [l.id] : r;
|
|
221
|
+
return v.includes(e.id) ? v.filter((I) => I !== e.id) : [...v, e.id];
|
|
221
222
|
}), ve.current = e.id;
|
|
222
|
-
},
|
|
223
|
-
!e.carry || !j || (e.carry.x = l, e.carry.y =
|
|
224
|
-
}, Ee = (e, l,
|
|
223
|
+
}, ke = (e) => !!j && !!e && !!e.route && !e.panes?.length, He = (e, l, r) => {
|
|
224
|
+
!e.carry || !j || (e.carry.x = l, e.carry.y = r, j.setGhost({ label: e.carry.label, x: l, y: r }), j.emit({ type: "move", payload: e.carry.payload, x: l, y: r }));
|
|
225
|
+
}, Ee = (e, l, r, v) => {
|
|
225
226
|
e.carry = {
|
|
226
|
-
payload:
|
|
227
|
+
payload: Xt({
|
|
227
228
|
id: "",
|
|
228
229
|
// the sidebar finds the item by its route
|
|
229
|
-
label:
|
|
230
|
+
label: C(l),
|
|
230
231
|
route: l.route,
|
|
231
|
-
icon: l.icon ??
|
|
232
|
+
icon: l.icon ?? q?.[l.route],
|
|
232
233
|
color: l.color
|
|
233
234
|
}),
|
|
234
|
-
label:
|
|
235
|
-
x:
|
|
235
|
+
label: C(l),
|
|
236
|
+
x: r,
|
|
236
237
|
y: v
|
|
237
|
-
}, Ae(null), He(e,
|
|
238
|
+
}, Ae(null), He(e, r, v);
|
|
238
239
|
}, Fe = (e, l) => {
|
|
239
|
-
!
|
|
240
|
+
!R && !ke(l) || e.button !== 0 || e.pointerType === "touch" || e.shiftKey || e.ctrlKey || e.metaKey || e.target.closest(".nice-nav-shell__tab-close") || (re.current = {
|
|
240
241
|
id: l.id,
|
|
241
242
|
pointerId: e.pointerId,
|
|
242
243
|
startX: e.clientX,
|
|
@@ -248,26 +249,26 @@ function eo(a) {
|
|
|
248
249
|
from: -1,
|
|
249
250
|
to: -1
|
|
250
251
|
});
|
|
251
|
-
},
|
|
252
|
-
const l =
|
|
253
|
-
if (!l || !
|
|
252
|
+
}, Re = (e) => {
|
|
253
|
+
const l = re.current, r = X.current;
|
|
254
|
+
if (!l || !r || e.pointerId !== l.pointerId)
|
|
254
255
|
return;
|
|
255
|
-
const v = e.clientX - l.startX + (
|
|
256
|
+
const v = e.clientX - l.startX + (r.scrollLeft - l.startScroll), I = e.clientY - l.startY;
|
|
256
257
|
if (l.carry) {
|
|
257
258
|
He(l, e.clientX, e.clientY);
|
|
258
259
|
return;
|
|
259
260
|
}
|
|
260
261
|
if (!l.started) {
|
|
261
|
-
if (Math.max(Math.abs(v), Math.abs(
|
|
262
|
+
if (Math.max(Math.abs(v), Math.abs(I)) < io)
|
|
262
263
|
return;
|
|
263
264
|
const B = E.find((U) => U.id === l.id);
|
|
264
265
|
if (!B) {
|
|
265
|
-
|
|
266
|
+
re.current = null;
|
|
266
267
|
return;
|
|
267
268
|
}
|
|
268
|
-
if (!
|
|
269
|
-
if (!
|
|
270
|
-
|
|
269
|
+
if (!R || Math.abs(I) > Math.abs(v)) {
|
|
270
|
+
if (!ke(B)) {
|
|
271
|
+
re.current = null;
|
|
271
272
|
return;
|
|
272
273
|
}
|
|
273
274
|
l.started = !0, e.currentTarget.setPointerCapture?.(e.pointerId), Ee(l, B, e.clientX, e.clientY);
|
|
@@ -275,69 +276,69 @@ function eo(a) {
|
|
|
275
276
|
}
|
|
276
277
|
const c = E.filter((U) => !!U.pinned == !!B.pinned);
|
|
277
278
|
l.order = c.map((U) => U.id), l.boxes = c.map((U) => {
|
|
278
|
-
const
|
|
279
|
-
return { left: (
|
|
279
|
+
const en = r.querySelector(`[data-tab-id="${CSS.escape(U.id)}"]`)?.getBoundingClientRect();
|
|
280
|
+
return { left: (en?.left ?? 0) + r.scrollLeft, width: en?.width ?? 0 };
|
|
280
281
|
}), l.from = l.order.indexOf(l.id), l.to = l.from, l.started = !0, e.currentTarget.setPointerCapture?.(e.pointerId);
|
|
281
282
|
}
|
|
282
|
-
const
|
|
283
|
-
if (
|
|
283
|
+
const te = r.getBoundingClientRect(), ge = E.find((B) => B.id === l.id);
|
|
284
|
+
if (ke(ge) && (e.clientY < te.top - un || e.clientY > te.bottom + un)) {
|
|
284
285
|
Ee(l, ge, e.clientX, e.clientY);
|
|
285
286
|
return;
|
|
286
287
|
}
|
|
287
|
-
e.clientX <
|
|
288
|
-
const
|
|
288
|
+
e.clientX < te.left + un ? r.scrollLeft -= 12 : e.clientX > te.right - un && (r.scrollLeft += 12);
|
|
289
|
+
const O = l.boxes[l.from], Te = O.left + v + O.width / 2;
|
|
289
290
|
let K = 0;
|
|
290
291
|
l.boxes.forEach((B, c) => {
|
|
291
|
-
c !== l.from && B.left + B.width / 2 <
|
|
292
|
+
c !== l.from && B.left + B.width / 2 < Te && K++;
|
|
292
293
|
}), l.to = K;
|
|
293
294
|
const ue = {};
|
|
294
295
|
l.order.forEach((B, c) => {
|
|
295
|
-
l.from < K && c > l.from && c <= K ? ue[B] = -
|
|
296
|
+
l.from < K && c > l.from && c <= K ? ue[B] = -O.width : l.from > K && c >= K && c < l.from && (ue[B] = O.width);
|
|
296
297
|
}), Ae({ id: l.id, dx: v, shifts: ue });
|
|
297
|
-
},
|
|
298
|
-
const l =
|
|
299
|
-
|
|
298
|
+
}, Oe = (e) => {
|
|
299
|
+
const l = re.current;
|
|
300
|
+
re.current = null, l?.started && (l.carry && j ? (j.setGhost(null), j.emit({
|
|
300
301
|
type: "end",
|
|
301
302
|
payload: l.carry.payload,
|
|
302
303
|
x: l.carry.x,
|
|
303
304
|
y: l.carry.y,
|
|
304
305
|
commit: e
|
|
305
|
-
})) : e && l.to !== l.from &&
|
|
306
|
-
|
|
306
|
+
})) : e && l.to !== l.from && Ie(l.id, l.order[l.to]), Pe.current = !0, window.setTimeout(() => {
|
|
307
|
+
Pe.current = !1;
|
|
307
308
|
}, 0)), Ae(null);
|
|
308
|
-
}, $ =
|
|
309
|
-
if (
|
|
310
|
-
if (me.length > 1 &&
|
|
309
|
+
}, $ = T ? d.find((e) => e.id === T.id) : void 0, me = T && G && ee.length > 1 && ee.includes(T.id) ? ee : [], Le = [];
|
|
310
|
+
if (T && $) {
|
|
311
|
+
if (me.length > 1 && Le.push([
|
|
311
312
|
{
|
|
312
313
|
key: "merge-columns",
|
|
313
314
|
label: u("nav.tabMergeColumns", "Merge side by side"),
|
|
314
|
-
icon:
|
|
315
|
-
onSelect: () =>
|
|
315
|
+
icon: Ge.columns,
|
|
316
|
+
onSelect: () => M(me, "columns")
|
|
316
317
|
},
|
|
317
318
|
{
|
|
318
319
|
key: "merge-rows",
|
|
319
320
|
label: u("nav.tabMergeRows", "Merge one under another"),
|
|
320
|
-
icon:
|
|
321
|
-
onSelect: () =>
|
|
321
|
+
icon: Ge.rows,
|
|
322
|
+
onSelect: () => M(me, "rows")
|
|
322
323
|
},
|
|
323
324
|
{
|
|
324
325
|
key: "merge-grid",
|
|
325
326
|
label: u("nav.tabMergeGrid", "Merge into a grid"),
|
|
326
|
-
icon:
|
|
327
|
-
onSelect: () =>
|
|
327
|
+
icon: Ge.grid,
|
|
328
|
+
onSelect: () => M(me, "grid")
|
|
328
329
|
}
|
|
329
330
|
]), $.panes) {
|
|
330
|
-
const l = $.layout ?? "columns",
|
|
331
|
+
const l = $.layout ?? "columns", r = (v, I) => ({
|
|
331
332
|
key: `layout-${v}`,
|
|
332
|
-
label:
|
|
333
|
-
icon:
|
|
333
|
+
label: I,
|
|
334
|
+
icon: Ge[v],
|
|
334
335
|
checked: l === v,
|
|
335
|
-
onSelect: () =>
|
|
336
|
+
onSelect: () => Z($.id, v)
|
|
336
337
|
});
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
338
|
+
Le.push([
|
|
339
|
+
r("columns", u("nav.tabLayoutColumns", "Side by side")),
|
|
340
|
+
r("rows", u("nav.tabLayoutRows", "One under another")),
|
|
341
|
+
r("grid", u("nav.tabLayoutGrid", "Grid")),
|
|
341
342
|
{
|
|
342
343
|
key: "split",
|
|
343
344
|
label: u("nav.tabSplit", "Split into tabs"),
|
|
@@ -347,30 +348,30 @@ function eo(a) {
|
|
|
347
348
|
]);
|
|
348
349
|
}
|
|
349
350
|
const e = [
|
|
350
|
-
{ key: "close", label: u("nav.tabClose", "Close"), onSelect: () =>
|
|
351
|
+
{ key: "close", label: u("nav.tabClose", "Close"), onSelect: () => Q($.id) },
|
|
351
352
|
{
|
|
352
353
|
key: "close-others",
|
|
353
354
|
label: u("nav.tabCloseOthers", "Close others"),
|
|
354
355
|
onSelect: () => be($.id)
|
|
355
356
|
},
|
|
356
|
-
{ key: "close-all", label: u("nav.tabCloseAll", "Close all"), onSelect: () =>
|
|
357
|
+
{ key: "close-all", label: u("nav.tabCloseAll", "Close all"), onSelect: () => _e() }
|
|
357
358
|
];
|
|
358
|
-
|
|
359
|
+
R && e.push(
|
|
359
360
|
{
|
|
360
361
|
key: "move-left",
|
|
361
362
|
label: u("nav.tabMoveLeft", "Move left"),
|
|
362
|
-
onSelect: () =>
|
|
363
|
+
onSelect: () => Ne($.id, -1)
|
|
363
364
|
},
|
|
364
365
|
{
|
|
365
366
|
key: "move-right",
|
|
366
367
|
label: u("nav.tabMoveRight", "Move right"),
|
|
367
|
-
onSelect: () =>
|
|
368
|
+
onSelect: () => Ne($.id, 1)
|
|
368
369
|
}
|
|
369
|
-
),
|
|
370
|
+
), k && e.push({
|
|
370
371
|
key: "pin",
|
|
371
372
|
label: $.pinned ? u("navShell.unpin", "Unpin") : u("navShell.pin", "Pin"),
|
|
372
373
|
onSelect: () => ae($.id, !$.pinned)
|
|
373
|
-
}),
|
|
374
|
+
}), Le.push(e);
|
|
374
375
|
}
|
|
375
376
|
return /* @__PURE__ */ le(
|
|
376
377
|
"div",
|
|
@@ -379,29 +380,29 @@ function eo(a) {
|
|
|
379
380
|
"data-testid": "nice-nav-shell-tabs",
|
|
380
381
|
"data-nice-region": u("navShell.region.tabs", "Tabs"),
|
|
381
382
|
children: [
|
|
382
|
-
N &&
|
|
383
|
+
N && We.left && /* @__PURE__ */ s(
|
|
383
384
|
"button",
|
|
384
385
|
{
|
|
385
386
|
type: "button",
|
|
386
387
|
className: "nice-nav-shell__tab-arrow nice-nav-shell__tab-arrow--left",
|
|
387
388
|
"aria-label": u("nav.scrollTabsLeft", "Scroll tabs left"),
|
|
388
|
-
onClick: () =>
|
|
389
|
-
children: /* @__PURE__ */
|
|
389
|
+
onClick: () => Je(-1),
|
|
390
|
+
children: /* @__PURE__ */ s(W, { name: "chevron-left", size: 16 })
|
|
390
391
|
}
|
|
391
392
|
),
|
|
392
|
-
/* @__PURE__ */
|
|
393
|
+
/* @__PURE__ */ s(
|
|
393
394
|
"div",
|
|
394
395
|
{
|
|
395
396
|
ref: X,
|
|
396
397
|
className: `nice-nav-shell__tab-strip${ce ? " nice-nav-shell__tab-strip--dragging" : ""}`,
|
|
397
398
|
role: "tablist",
|
|
398
399
|
onScroll: F,
|
|
399
|
-
onWheel:
|
|
400
|
+
onWheel: fn,
|
|
400
401
|
children: E.map((e) => {
|
|
401
|
-
const l = e.id === m,
|
|
402
|
-
U > 0 && /* @__PURE__ */
|
|
403
|
-
|
|
404
|
-
] }, c.id)) }) :
|
|
402
|
+
const l = e.id === m, r = ee.includes(e.id), v = (e.closable ?? P) && !(e.pinned && !k), I = !!e.panes && e.panes.length > 0, te = I ? /* @__PURE__ */ s(Rt, { children: e.panes.map((c, U) => /* @__PURE__ */ le(Qn, { children: [
|
|
403
|
+
U > 0 && /* @__PURE__ */ s("span", { className: "nice-nav-shell__tab-sep", "aria-hidden": "true" }),
|
|
404
|
+
ne(c)
|
|
405
|
+
] }, c.id)) }) : ne(e), ge = I ? e.panes.map(C).join(" + ") : C(e), O = I ? /* @__PURE__ */ s(W, { name: Ge[e.layout ?? "columns"], size: 14 }) : e.icon ?? q?.[e.route], Te = I ? e.panes.some((c) => c.dirty) : e.dirty, K = ce ? ce.id === e.id ? ce.dx : ce.shifts[e.id] : void 0, ue = J === "theme" ? void 0 : e.color, B = {
|
|
405
406
|
...ue ? { "--nice-tab-color": ue } : {},
|
|
406
407
|
...K !== void 0 ? { transform: `translateX(${K}px)` } : {}
|
|
407
408
|
};
|
|
@@ -411,48 +412,48 @@ function eo(a) {
|
|
|
411
412
|
role: "tab",
|
|
412
413
|
"aria-selected": l,
|
|
413
414
|
"data-tab-id": e.id,
|
|
414
|
-
"data-selected":
|
|
415
|
+
"data-selected": r || void 0,
|
|
415
416
|
className: [
|
|
416
417
|
"nice-nav-shell__tab",
|
|
417
418
|
l ? "nice-nav-shell__tab--active" : "",
|
|
418
|
-
|
|
419
|
-
|
|
419
|
+
r ? "nice-nav-shell__tab--selected" : "",
|
|
420
|
+
I ? "nice-nav-shell__tab--merged" : "",
|
|
420
421
|
e.pinned ? "nice-nav-shell__tab--pinned" : "",
|
|
421
|
-
|
|
422
|
-
ue ?
|
|
422
|
+
Te ? "nice-nav-shell__tab--dirty" : "",
|
|
423
|
+
ue ? J === "fill" ? "nice-nav-shell__tab--colored" : "nice-nav-shell__tab--marked" : "",
|
|
423
424
|
ce ? ce.id === e.id ? "nice-nav-shell__tab--dragging" : "nice-nav-shell__tab--shifting" : ""
|
|
424
425
|
].filter(Boolean).join(" "),
|
|
425
426
|
style: Object.keys(B).length > 0 ? B : void 0,
|
|
426
|
-
onClick: (c) =>
|
|
427
|
+
onClick: (c) => Qe(c, e),
|
|
427
428
|
onPointerDown: (c) => Fe(c, e),
|
|
428
|
-
onPointerMove:
|
|
429
|
-
onPointerUp: () =>
|
|
430
|
-
onPointerCancel: () =>
|
|
429
|
+
onPointerMove: Re,
|
|
430
|
+
onPointerUp: () => Oe(!0),
|
|
431
|
+
onPointerCancel: () => Oe(!1),
|
|
431
432
|
tabIndex: l ? 0 : -1,
|
|
432
433
|
onKeyDown: (c) => {
|
|
433
|
-
c.target === c.currentTarget && (c.key === "Escape" && (
|
|
434
|
+
c.target === c.currentTarget && (c.key === "Escape" && (re.current?.started || ee.length > 0) ? (c.preventDefault(), Oe(!1), de([])) : G && (c.ctrlKey || c.metaKey) && c.key === " " ? (c.preventDefault(), A(e) && Ze(e)) : c.key === "Enter" || c.key === " " ? (c.preventDefault(), Me(e)) : R && c.ctrlKey && c.shiftKey && (c.key === "ArrowLeft" || c.key === "ArrowRight") ? (c.preventDefault(), Ne(e.id, c.key === "ArrowLeft" ? -1 : 1)) : c.key === "Delete" && (e.closable ?? P) && (c.preventDefault(), Q(e.id)));
|
|
434
435
|
},
|
|
435
436
|
onAuxClick: (c) => {
|
|
436
|
-
c.button === 1 && (e.closable ??
|
|
437
|
+
c.button === 1 && (e.closable ?? P) && (c.preventDefault(), Q(e.id));
|
|
437
438
|
},
|
|
438
439
|
onContextMenu: (c) => {
|
|
439
|
-
L && (c.preventDefault(),
|
|
440
|
+
L && (c.preventDefault(), ee.includes(e.id) || de([]), se({ id: e.id, x: c.clientX, y: c.clientY }));
|
|
440
441
|
},
|
|
441
442
|
title: ge,
|
|
442
443
|
children: [
|
|
443
|
-
|
|
444
|
-
/* @__PURE__ */
|
|
445
|
-
|
|
446
|
-
v && /* @__PURE__ */
|
|
444
|
+
O != null && /* @__PURE__ */ s("span", { className: "nice-nav-shell__tab-icon", "aria-hidden": "true", children: O }),
|
|
445
|
+
/* @__PURE__ */ s("span", { className: "nice-nav-shell__tab-label", children: te }),
|
|
446
|
+
Te && /* @__PURE__ */ s("span", { className: "nice-nav-shell__tab-dot", "aria-label": "unsaved" }),
|
|
447
|
+
v && /* @__PURE__ */ s(
|
|
447
448
|
"button",
|
|
448
449
|
{
|
|
449
450
|
type: "button",
|
|
450
451
|
className: "nice-nav-shell__tab-close",
|
|
451
452
|
"aria-label": u("nav.closeTab", "Close tab"),
|
|
452
453
|
onClick: (c) => {
|
|
453
|
-
c.stopPropagation(),
|
|
454
|
+
c.stopPropagation(), Q(e.id);
|
|
454
455
|
},
|
|
455
|
-
children: /* @__PURE__ */
|
|
456
|
+
children: /* @__PURE__ */ s(W, { name: "close", size: 14 })
|
|
456
457
|
}
|
|
457
458
|
)
|
|
458
459
|
]
|
|
@@ -462,41 +463,41 @@ function eo(a) {
|
|
|
462
463
|
})
|
|
463
464
|
}
|
|
464
465
|
),
|
|
465
|
-
N &&
|
|
466
|
+
N && We.right && /* @__PURE__ */ s(
|
|
466
467
|
"button",
|
|
467
468
|
{
|
|
468
469
|
type: "button",
|
|
469
470
|
className: "nice-nav-shell__tab-arrow nice-nav-shell__tab-arrow--right",
|
|
470
471
|
"aria-label": u("nav.scrollTabsRight", "Scroll tabs right"),
|
|
471
|
-
onClick: () =>
|
|
472
|
-
children: /* @__PURE__ */
|
|
472
|
+
onClick: () => Je(1),
|
|
473
|
+
children: /* @__PURE__ */ s(W, { name: "chevron-right", size: 16 })
|
|
473
474
|
}
|
|
474
475
|
),
|
|
475
|
-
|
|
476
|
+
T && /* @__PURE__ */ s(
|
|
476
477
|
"ul",
|
|
477
478
|
{
|
|
478
|
-
ref:
|
|
479
|
+
ref: we,
|
|
479
480
|
className: "nice-nav-shell__tab-menu",
|
|
480
481
|
role: "menu",
|
|
481
|
-
style: { position: "fixed", top:
|
|
482
|
-
children:
|
|
483
|
-
l > 0 && /* @__PURE__ */
|
|
484
|
-
e.map((
|
|
482
|
+
style: { position: "fixed", top: T.y, left: T.x, zIndex: 1e3 },
|
|
483
|
+
children: Le.map((e, l) => /* @__PURE__ */ le(Qn, { children: [
|
|
484
|
+
l > 0 && /* @__PURE__ */ s("li", { role: "separator", className: "nice-nav-shell__tab-menu-sep" }),
|
|
485
|
+
e.map((r) => /* @__PURE__ */ s("li", { children: /* @__PURE__ */ le(
|
|
485
486
|
"button",
|
|
486
487
|
{
|
|
487
488
|
type: "button",
|
|
488
|
-
role:
|
|
489
|
-
"aria-checked":
|
|
489
|
+
role: r.checked === void 0 ? "menuitem" : "menuitemradio",
|
|
490
|
+
"aria-checked": r.checked,
|
|
490
491
|
onClick: () => {
|
|
491
|
-
|
|
492
|
+
r.onSelect(), se(null), r.key.startsWith("merge-") && de([]);
|
|
492
493
|
},
|
|
493
494
|
children: [
|
|
494
|
-
|
|
495
|
-
/* @__PURE__ */
|
|
496
|
-
|
|
495
|
+
r.icon && /* @__PURE__ */ s(W, { name: r.icon, size: 14 }),
|
|
496
|
+
/* @__PURE__ */ s("span", { children: r.label }),
|
|
497
|
+
r.checked && /* @__PURE__ */ s(W, { name: "check", size: 14 })
|
|
497
498
|
]
|
|
498
499
|
}
|
|
499
|
-
) },
|
|
500
|
+
) }, r.key))
|
|
500
501
|
] }, l))
|
|
501
502
|
}
|
|
502
503
|
)
|
|
@@ -504,298 +505,298 @@ function eo(a) {
|
|
|
504
505
|
}
|
|
505
506
|
);
|
|
506
507
|
}
|
|
507
|
-
function
|
|
508
|
+
function so({
|
|
508
509
|
tab: a,
|
|
509
510
|
activeRoute: u,
|
|
510
511
|
routeLabels: d,
|
|
511
512
|
routeIcons: m,
|
|
512
513
|
closable: N,
|
|
513
|
-
renderRoute:
|
|
514
|
-
onFocusPane:
|
|
515
|
-
onDetachPane:
|
|
516
|
-
onClosePane:
|
|
514
|
+
renderRoute: P,
|
|
515
|
+
onFocusPane: k,
|
|
516
|
+
onDetachPane: R,
|
|
517
|
+
onClosePane: G
|
|
517
518
|
}) {
|
|
518
|
-
const L = a.panes ?? [],
|
|
519
|
-
return /* @__PURE__ */
|
|
519
|
+
const L = a.panes ?? [], S = a.layout ?? "columns", q = S === "columns" ? L.length : S === "rows" ? 1 : Math.ceil(Math.sqrt(L.length)), A = Math.ceil(L.length / q);
|
|
520
|
+
return /* @__PURE__ */ s(
|
|
520
521
|
"div",
|
|
521
522
|
{
|
|
522
|
-
className: `nice-nav-shell__split nice-nav-shell__split--${
|
|
523
|
+
className: `nice-nav-shell__split nice-nav-shell__split--${S}`,
|
|
523
524
|
style: {
|
|
524
|
-
"--nice-split-cols": String(
|
|
525
|
+
"--nice-split-cols": String(q),
|
|
525
526
|
"--nice-split-rows": String(A)
|
|
526
527
|
},
|
|
527
528
|
"data-testid": "nice-nav-shell-split",
|
|
528
|
-
children: L.map((
|
|
529
|
-
|
|
529
|
+
children: L.map((J) => /* @__PURE__ */ s(
|
|
530
|
+
ro,
|
|
530
531
|
{
|
|
531
|
-
pane:
|
|
532
|
-
focused:
|
|
532
|
+
pane: J,
|
|
533
|
+
focused: J.route === u,
|
|
533
534
|
routeLabels: d,
|
|
534
535
|
routeIcons: m,
|
|
535
536
|
closable: N,
|
|
536
|
-
renderRoute:
|
|
537
|
-
onFocusPane:
|
|
538
|
-
onDetachPane:
|
|
539
|
-
onClosePane:
|
|
537
|
+
renderRoute: P,
|
|
538
|
+
onFocusPane: k,
|
|
539
|
+
onDetachPane: R,
|
|
540
|
+
onClosePane: G
|
|
540
541
|
},
|
|
541
|
-
|
|
542
|
+
J.id
|
|
542
543
|
))
|
|
543
544
|
}
|
|
544
545
|
);
|
|
545
546
|
}
|
|
546
|
-
function
|
|
547
|
+
function ro({
|
|
547
548
|
pane: a,
|
|
548
549
|
focused: u,
|
|
549
550
|
routeLabels: d,
|
|
550
551
|
routeIcons: m,
|
|
551
552
|
closable: N,
|
|
552
|
-
renderRoute:
|
|
553
|
-
onFocusPane:
|
|
554
|
-
onDetachPane:
|
|
555
|
-
onClosePane:
|
|
553
|
+
renderRoute: P,
|
|
554
|
+
onFocusPane: k,
|
|
555
|
+
onDetachPane: R,
|
|
556
|
+
onClosePane: G
|
|
556
557
|
}) {
|
|
557
|
-
const { t: L } =
|
|
558
|
-
() => ({ route: a.route, inSplit: !0, focused: u, footerSlot:
|
|
559
|
-
[a.route, u,
|
|
560
|
-
),
|
|
561
|
-
u ||
|
|
558
|
+
const { t: L } = Cn(), [S, q] = V(null), [A, J] = V(null), Me = z(
|
|
559
|
+
() => ({ route: a.route, inSplit: !0, focused: u, footerSlot: S, headerSlot: A }),
|
|
560
|
+
[a.route, u, S, A]
|
|
561
|
+
), Q = a.label ?? he(a.route, d, a.route), be = a.icon ?? m?.[a.route], _e = typeof Q == "string" ? Q : a.route, ae = () => {
|
|
562
|
+
u || k(a.route);
|
|
562
563
|
};
|
|
563
564
|
return /* @__PURE__ */ le(
|
|
564
565
|
"section",
|
|
565
566
|
{
|
|
566
567
|
className: `nice-nav-shell__pane${u ? " nice-nav-shell__pane--focused" : ""}`,
|
|
567
|
-
"aria-label":
|
|
568
|
+
"aria-label": _e,
|
|
568
569
|
"data-pane-route": a.route,
|
|
569
570
|
onPointerDownCapture: ae,
|
|
570
571
|
onFocusCapture: ae,
|
|
571
572
|
children: [
|
|
572
573
|
/* @__PURE__ */ le("header", { className: "nice-nav-shell__pane-header", children: [
|
|
573
|
-
be != null && /* @__PURE__ */
|
|
574
|
-
/* @__PURE__ */
|
|
575
|
-
a.dirty && /* @__PURE__ */
|
|
576
|
-
/* @__PURE__ */
|
|
574
|
+
be != null && /* @__PURE__ */ s("span", { className: "nice-nav-shell__tab-icon", "aria-hidden": "true", children: be }),
|
|
575
|
+
/* @__PURE__ */ s("span", { className: "nice-nav-shell__pane-title", children: Q }),
|
|
576
|
+
a.dirty && /* @__PURE__ */ s("span", { className: "nice-nav-shell__tab-dot", "aria-label": "unsaved" }),
|
|
577
|
+
/* @__PURE__ */ s(
|
|
577
578
|
"button",
|
|
578
579
|
{
|
|
579
580
|
type: "button",
|
|
580
581
|
className: "nice-nav-shell__pane-button",
|
|
581
|
-
"aria-label": `${L("nav.paneDetach", "Open in its own tab")}: ${
|
|
582
|
+
"aria-label": `${L("nav.paneDetach", "Open in its own tab")}: ${_e}`,
|
|
582
583
|
title: L("nav.paneDetach", "Open in its own tab"),
|
|
583
|
-
onClick: () =>
|
|
584
|
-
children: /* @__PURE__ */
|
|
584
|
+
onClick: () => R(a.id),
|
|
585
|
+
children: /* @__PURE__ */ s(W, { name: "external-link", size: 14 })
|
|
585
586
|
}
|
|
586
587
|
),
|
|
587
|
-
(a.closable ?? N) && /* @__PURE__ */
|
|
588
|
+
(a.closable ?? N) && /* @__PURE__ */ s(
|
|
588
589
|
"button",
|
|
589
590
|
{
|
|
590
591
|
type: "button",
|
|
591
592
|
className: "nice-nav-shell__pane-button nice-nav-shell__pane-button--close",
|
|
592
|
-
"aria-label": `${L("nav.closeTab", "Close tab")}: ${
|
|
593
|
+
"aria-label": `${L("nav.closeTab", "Close tab")}: ${_e}`,
|
|
593
594
|
title: L("nav.closeTab", "Close tab"),
|
|
594
|
-
onClick: () =>
|
|
595
|
-
children: /* @__PURE__ */
|
|
595
|
+
onClick: () => G(a.id),
|
|
596
|
+
children: /* @__PURE__ */ s(W, { name: "close", size: 14 })
|
|
596
597
|
}
|
|
597
598
|
)
|
|
598
599
|
] }),
|
|
599
|
-
/* @__PURE__ */
|
|
600
|
-
/* @__PURE__ */
|
|
601
|
-
/* @__PURE__ */
|
|
600
|
+
/* @__PURE__ */ s("div", { className: "nice-nav-shell__pane-sticky", ref: J }),
|
|
601
|
+
/* @__PURE__ */ s("div", { className: "nice-nav-shell__pane-body", children: /* @__PURE__ */ s(et.Provider, { value: Me, children: P(a.route) }) }),
|
|
602
|
+
/* @__PURE__ */ s("div", { className: "nice-nav-shell__pane-footer", ref: q })
|
|
602
603
|
]
|
|
603
604
|
}
|
|
604
605
|
);
|
|
605
606
|
}
|
|
606
|
-
function
|
|
607
|
-
return /* @__PURE__ */
|
|
607
|
+
function co() {
|
|
608
|
+
return /* @__PURE__ */ s(W, { name: "home", size: 16 });
|
|
608
609
|
}
|
|
609
|
-
const
|
|
610
|
-
/* @__PURE__ */
|
|
610
|
+
const uo = {}, Po = /* @__PURE__ */ Object.assign(
|
|
611
|
+
/* @__PURE__ */ Et(function(u, d) {
|
|
611
612
|
const {
|
|
612
613
|
topNav: m,
|
|
613
614
|
topNavProps: N,
|
|
614
|
-
sidebar:
|
|
615
|
-
sidebarData:
|
|
616
|
-
sidebarUserId:
|
|
617
|
-
sidebarActiveRoute:
|
|
615
|
+
sidebar: P,
|
|
616
|
+
sidebarData: k,
|
|
617
|
+
sidebarUserId: R,
|
|
618
|
+
sidebarActiveRoute: G,
|
|
618
619
|
onSidebarNavigate: L,
|
|
619
|
-
sidebarPreferences:
|
|
620
|
-
onSidebarPreferencesChange:
|
|
620
|
+
sidebarPreferences: S,
|
|
621
|
+
onSidebarPreferencesChange: q,
|
|
621
622
|
firstRunPreferences: A,
|
|
622
|
-
onFirstRunSave:
|
|
623
|
-
mobileBreakpoint:
|
|
624
|
-
forceMobileLayout:
|
|
625
|
-
routes: be =
|
|
626
|
-
defaultRoute:
|
|
623
|
+
onFirstRunSave: J,
|
|
624
|
+
mobileBreakpoint: Me = 720,
|
|
625
|
+
forceMobileLayout: Q = !1,
|
|
626
|
+
routes: be = uo,
|
|
627
|
+
defaultRoute: _e,
|
|
627
628
|
activeRoute: ae,
|
|
628
|
-
onRouteChange:
|
|
629
|
-
routeLabels:
|
|
629
|
+
onRouteChange: Ie,
|
|
630
|
+
routeLabels: M,
|
|
630
631
|
routeIcons: H,
|
|
631
|
-
fallback:
|
|
632
|
+
fallback: Z = null,
|
|
632
633
|
emptyState: X,
|
|
633
|
-
tabsMode:
|
|
634
|
+
tabsMode: We = "disabled",
|
|
634
635
|
pageMode: De,
|
|
635
|
-
allowDuplicateTabs:
|
|
636
|
-
maxTabs:
|
|
637
|
-
closableTabs:
|
|
638
|
-
pinnableTabs:
|
|
636
|
+
allowDuplicateTabs: T = !1,
|
|
637
|
+
maxTabs: se,
|
|
638
|
+
closableTabs: we = !0,
|
|
639
|
+
pinnableTabs: re = !0,
|
|
639
640
|
reorderableTabs: ce = !1,
|
|
640
641
|
mergeableTabs: Ae = !0,
|
|
641
642
|
topBarItems: j,
|
|
642
|
-
topBarOpen:
|
|
643
|
-
defaultTopBarOpen:
|
|
643
|
+
topBarOpen: Pe,
|
|
644
|
+
defaultTopBarOpen: qe,
|
|
644
645
|
onTopBarOpenChange: de,
|
|
645
646
|
persistTabs: ve = "memory",
|
|
646
647
|
persistKey: F = "nice-nav-shell:tabs",
|
|
647
|
-
tabsScrollable:
|
|
648
|
-
tabsContextMenu:
|
|
648
|
+
tabsScrollable: fn = !0,
|
|
649
|
+
tabsContextMenu: Je = !0,
|
|
649
650
|
tabsAnimation: E = "fade",
|
|
650
|
-
initialTabs:
|
|
651
|
-
pinnedRoutes:
|
|
652
|
-
showHomeTab:
|
|
653
|
-
homeRoute:
|
|
654
|
-
homeIcon:
|
|
655
|
-
homeLabel:
|
|
656
|
-
homeContent:
|
|
651
|
+
initialTabs: ee,
|
|
652
|
+
pinnedRoutes: Ne,
|
|
653
|
+
showHomeTab: ne = !0,
|
|
654
|
+
homeRoute: C = "home",
|
|
655
|
+
homeIcon: Qe,
|
|
656
|
+
homeLabel: Ze,
|
|
657
|
+
homeContent: ke,
|
|
657
658
|
homeUserName: He,
|
|
658
659
|
homeDashboardProps: Ee,
|
|
659
660
|
showHelpButton: Fe = !1,
|
|
660
|
-
helpSteps:
|
|
661
|
-
helpStepsExclude:
|
|
661
|
+
helpSteps: Re,
|
|
662
|
+
helpStepsExclude: Oe,
|
|
662
663
|
autoOpenSidebarRoutes: $,
|
|
663
664
|
tabColors: me = "none",
|
|
664
|
-
colorStyle:
|
|
665
|
+
colorStyle: Le,
|
|
665
666
|
sidebarProps: e,
|
|
666
667
|
routeToUrl: l,
|
|
667
|
-
includeSidebarPreferenceRoutes:
|
|
668
|
+
includeSidebarPreferenceRoutes: r,
|
|
668
669
|
showStickyHeader: v = !1,
|
|
669
|
-
stickyHeaderContent:
|
|
670
|
-
showStickyFooter:
|
|
670
|
+
stickyHeaderContent: I,
|
|
671
|
+
showStickyFooter: te = !1,
|
|
671
672
|
stickyFooterContent: ge,
|
|
672
|
-
surfaceOpacity:
|
|
673
|
-
height:
|
|
673
|
+
surfaceOpacity: O,
|
|
674
|
+
height: Te,
|
|
674
675
|
contentPadding: K,
|
|
675
676
|
spatialNavigation: ue = !1,
|
|
676
677
|
spatialNavigationProps: B,
|
|
677
678
|
contentArrows: c = "spatial",
|
|
678
679
|
hintBar: U = "bottom",
|
|
679
|
-
tv:
|
|
680
|
-
focusContentOnNavigate:
|
|
681
|
-
className:
|
|
682
|
-
contentClassName:
|
|
683
|
-
"data-testid":
|
|
684
|
-
} = u, { t: h } =
|
|
685
|
-
|
|
680
|
+
tv: en = !1,
|
|
681
|
+
focusContentOnNavigate: xn = !0,
|
|
682
|
+
className: at,
|
|
683
|
+
contentClassName: st,
|
|
684
|
+
"data-testid": rt
|
|
685
|
+
} = u, { t: h } = Cn(), $e = e?.preferences ?? S, Ke = e?.onPreferencesChange ?? q, [ze, Mn] = Gt(
|
|
686
|
+
R,
|
|
686
687
|
void 0,
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
{ controlled:
|
|
690
|
-
),
|
|
688
|
+
$e,
|
|
689
|
+
Ke,
|
|
690
|
+
{ controlled: Wt($e, Ke) }
|
|
691
|
+
), In = typeof A == "object" ? A : void 0, ct = Le ?? ze.colorStyle, Ye = Ot(), Pn = ie(null), Rn = ie(null), dt = w(
|
|
691
692
|
(n) => {
|
|
692
|
-
|
|
693
|
+
Pn.current = n, typeof d == "function" ? d(n) : d && (d.current = n);
|
|
693
694
|
},
|
|
694
695
|
[d]
|
|
695
|
-
),
|
|
696
|
-
const n =
|
|
696
|
+
), ut = Jt(), nn = We === "enabled", y = nn && Qt(De ?? ze.pageMode, ut) === "tabs", ye = nn && ne, tn = z(() => Qe ?? /* @__PURE__ */ s(co, {}), [Qe]), on = Ze ?? "", On = w(() => {
|
|
697
|
+
const n = no(ve, F);
|
|
697
698
|
if (n && n.length > 0) {
|
|
698
699
|
const t = n.map(
|
|
699
|
-
(i) =>
|
|
700
|
+
(i) => it(
|
|
700
701
|
i,
|
|
701
|
-
(p) =>
|
|
702
|
-
(p) =>
|
|
702
|
+
(p) => ne && p === C ? on : he(p, M, p),
|
|
703
|
+
(p) => ne && p === C ? tn : H?.[p]
|
|
703
704
|
)
|
|
704
705
|
);
|
|
705
|
-
return
|
|
706
|
-
id:
|
|
707
|
-
route:
|
|
708
|
-
label:
|
|
709
|
-
icon:
|
|
706
|
+
return ne && !t.some((i) => i.route === C) && t.unshift({
|
|
707
|
+
id: C,
|
|
708
|
+
route: C,
|
|
709
|
+
label: on,
|
|
710
|
+
icon: tn,
|
|
710
711
|
pinned: !0,
|
|
711
712
|
closable: !1
|
|
712
713
|
}), t;
|
|
713
714
|
}
|
|
714
715
|
const o = [];
|
|
715
|
-
if (
|
|
716
|
-
id:
|
|
717
|
-
route:
|
|
718
|
-
label:
|
|
719
|
-
icon:
|
|
716
|
+
if (ne && o.push({
|
|
717
|
+
id: C,
|
|
718
|
+
route: C,
|
|
719
|
+
label: on,
|
|
720
|
+
icon: tn,
|
|
720
721
|
pinned: !0,
|
|
721
722
|
closable: !1
|
|
722
|
-
}),
|
|
723
|
-
for (const t of
|
|
723
|
+
}), Ne)
|
|
724
|
+
for (const t of Ne)
|
|
724
725
|
o.some((i) => i.id === t) || o.push({
|
|
725
726
|
id: t,
|
|
726
727
|
route: t,
|
|
727
|
-
label: he(t,
|
|
728
|
+
label: he(t, M, t),
|
|
728
729
|
icon: H?.[t],
|
|
729
730
|
pinned: !0,
|
|
730
731
|
closable: !1
|
|
731
732
|
});
|
|
732
|
-
if (
|
|
733
|
-
for (const t of
|
|
733
|
+
if (ee)
|
|
734
|
+
for (const t of ee)
|
|
734
735
|
o.some((i) => i.id === t.id) || o.push({
|
|
735
736
|
...t,
|
|
736
|
-
label: t.label ?? he(t.route,
|
|
737
|
+
label: t.label ?? he(t.route, M, t.route),
|
|
737
738
|
icon: t.icon ?? H?.[t.route]
|
|
738
739
|
});
|
|
739
740
|
return o;
|
|
740
741
|
}, [
|
|
741
742
|
ve,
|
|
742
743
|
F,
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
744
|
+
ne,
|
|
745
|
+
C,
|
|
746
|
+
on,
|
|
747
|
+
tn,
|
|
748
|
+
M,
|
|
748
749
|
H,
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
]), [b,
|
|
752
|
-
ae ??
|
|
753
|
-
), f = ae ??
|
|
754
|
-
|
|
755
|
-
const o = n.length > 0 ? n :
|
|
756
|
-
if (f == null || o.some((i) =>
|
|
750
|
+
Ne,
|
|
751
|
+
ee
|
|
752
|
+
]), [b, Y] = V(() => y ? On() : []), [ft, pt] = V(
|
|
753
|
+
ae ?? _e ?? (ye ? C : b[0]?.route)
|
|
754
|
+
), f = ae ?? ft, [Ln, ht] = V(null), [bt, vt] = V(y);
|
|
755
|
+
bt !== y && (vt(y), y && Y((n) => {
|
|
756
|
+
const o = n.length > 0 ? n : On();
|
|
757
|
+
if (f == null || o.some((i) => Be(i, f)))
|
|
757
758
|
return o;
|
|
758
|
-
const t =
|
|
759
|
+
const t = Ln?.route === f ? Ln : null;
|
|
759
760
|
return [
|
|
760
761
|
...o,
|
|
761
762
|
{
|
|
762
763
|
id: f,
|
|
763
764
|
route: f,
|
|
764
|
-
label: t?.label ?? he(f,
|
|
765
|
+
label: t?.label ?? he(f, M, f),
|
|
765
766
|
icon: t?.icon ?? H?.[f],
|
|
766
767
|
color: t?.color
|
|
767
768
|
}
|
|
768
769
|
];
|
|
769
770
|
}));
|
|
770
|
-
const
|
|
771
|
+
const x = w(
|
|
771
772
|
(n) => {
|
|
772
|
-
ae === void 0 &&
|
|
773
|
+
ae === void 0 && pt(n), n !== void 0 && Ie?.(n);
|
|
773
774
|
},
|
|
774
|
-
[ae,
|
|
775
|
+
[ae, Ie]
|
|
775
776
|
);
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
}, [b,
|
|
777
|
+
xe(() => {
|
|
778
|
+
y && lo(ve, F, b);
|
|
779
|
+
}, [b, y, ve, F]);
|
|
779
780
|
const fe = w(
|
|
780
781
|
(n, o) => {
|
|
781
|
-
if (!
|
|
782
|
-
|
|
782
|
+
if (!y) {
|
|
783
|
+
ht({
|
|
783
784
|
id: n,
|
|
784
785
|
route: n,
|
|
785
|
-
label: o?.label ?? he(n,
|
|
786
|
+
label: o?.label ?? he(n, M, n),
|
|
786
787
|
icon: o?.icon ?? H?.[n],
|
|
787
788
|
color: o?.color
|
|
788
|
-
}),
|
|
789
|
+
}), x(n);
|
|
789
790
|
return;
|
|
790
791
|
}
|
|
791
|
-
|
|
792
|
-
const i = !
|
|
792
|
+
Y((t) => {
|
|
793
|
+
const i = !T && !o?.forceNew ? t.find((g) => Be(g, n)) : void 0;
|
|
793
794
|
if (i)
|
|
794
795
|
return i.panes ? i.route === n ? t : t.map((g) => g === i ? { ...g, route: n } : g) : o?.color !== void 0 && o.color !== i.color ? t.map((g) => g === i ? { ...g, color: o.color } : g) : t;
|
|
795
796
|
const p = o?.id ?? `${n}#${t.length + 1}`, _ = {
|
|
796
797
|
id: p,
|
|
797
798
|
route: n,
|
|
798
|
-
label: o?.label ?? he(n,
|
|
799
|
+
label: o?.label ?? he(n, M, n),
|
|
799
800
|
icon: o?.icon ?? H?.[n],
|
|
800
801
|
pinned: o?.pinned,
|
|
801
802
|
dirty: o?.dirty,
|
|
@@ -803,15 +804,15 @@ const lo = {}, No = /* @__PURE__ */ Object.assign(
|
|
|
803
804
|
color: o?.color
|
|
804
805
|
};
|
|
805
806
|
let D = [...t, _];
|
|
806
|
-
if (typeof
|
|
807
|
-
const g = D.findIndex((
|
|
807
|
+
if (typeof se == "number" && D.length > se) {
|
|
808
|
+
const g = D.findIndex((Ve) => !Ve.pinned && Ve.id !== p);
|
|
808
809
|
g >= 0 && (D = [...D.slice(0, g), ...D.slice(g + 1)]);
|
|
809
810
|
}
|
|
810
811
|
return D;
|
|
811
|
-
}),
|
|
812
|
+
}), x(n);
|
|
812
813
|
},
|
|
813
|
-
[
|
|
814
|
-
),
|
|
814
|
+
[y, T, se, M, H, x]
|
|
815
|
+
), pn = ie(!1), ln = w(
|
|
815
816
|
(n, o, t) => {
|
|
816
817
|
const i = b.find((g) => g.id === n), p = i?.panes?.find((g) => g.id === o);
|
|
817
818
|
if (!i?.panes || !p)
|
|
@@ -821,92 +822,92 @@ const lo = {}, No = /* @__PURE__ */ Object.assign(
|
|
|
821
822
|
panes: _,
|
|
822
823
|
route: _.some((g) => g.route === i.route) ? i.route : _[0].route
|
|
823
824
|
};
|
|
824
|
-
|
|
825
|
-
(g) => g.flatMap((
|
|
826
|
-
), t ?
|
|
825
|
+
Y(
|
|
826
|
+
(g) => g.flatMap((Ve) => Ve.id !== n ? [Ve] : t ? [D, p] : [D])
|
|
827
|
+
), t ? x(p.route) : p.route === f && x(D.route);
|
|
827
828
|
},
|
|
828
|
-
[b, f,
|
|
829
|
-
),
|
|
829
|
+
[b, f, x]
|
|
830
|
+
), hn = w(
|
|
830
831
|
(n, o = "columns") => {
|
|
831
|
-
const t =
|
|
832
|
-
t.merged && (
|
|
832
|
+
const t = oo(b, n, o, f);
|
|
833
|
+
t.merged && (Y(t.tabs), x(t.merged.route));
|
|
833
834
|
},
|
|
834
|
-
[b, f,
|
|
835
|
-
),
|
|
836
|
-
|
|
837
|
-
}, []),
|
|
838
|
-
|
|
839
|
-
}, []),
|
|
835
|
+
[b, f, x]
|
|
836
|
+
), bn = w((n) => {
|
|
837
|
+
Y((o) => o.flatMap((t) => t.id === n && t.panes ? t.panes : [t]));
|
|
838
|
+
}, []), mt = w((n, o) => {
|
|
839
|
+
Y((t) => t.map((i) => i.id === n ? { ...i, layout: o } : i));
|
|
840
|
+
}, []), gt = w(
|
|
840
841
|
(n, o) => {
|
|
841
|
-
|
|
842
|
+
Y((t) => t.map((i) => i.id === n ? { ...i, route: o } : i)), pn.current = !0, x(o);
|
|
842
843
|
},
|
|
843
|
-
[
|
|
844
|
-
),
|
|
844
|
+
[x]
|
|
845
|
+
), Xe = w(
|
|
845
846
|
(n) => {
|
|
846
847
|
if (!b.some((o) => o.id === n)) {
|
|
847
848
|
const o = b.find((t) => t.panes?.some((i) => i.id === n));
|
|
848
849
|
if (o) {
|
|
849
|
-
|
|
850
|
+
ln(o.id, n, !1);
|
|
850
851
|
return;
|
|
851
852
|
}
|
|
852
853
|
}
|
|
853
|
-
|
|
854
|
+
Y((o) => {
|
|
854
855
|
const t = o.findIndex((_) => _.id === n);
|
|
855
856
|
if (t < 0)
|
|
856
857
|
return o;
|
|
857
858
|
const i = o[t], p = [...o.slice(0, t), ...o.slice(t + 1)];
|
|
858
|
-
if (
|
|
859
|
+
if (Be(i, f)) {
|
|
859
860
|
const _ = p[t] ?? p[t - 1] ?? p[0];
|
|
860
|
-
_ ?
|
|
861
|
+
_ ? x(_.route) : y && x(void 0);
|
|
861
862
|
}
|
|
862
863
|
return p;
|
|
863
864
|
});
|
|
864
865
|
},
|
|
865
|
-
[b,
|
|
866
|
-
),
|
|
866
|
+
[b, ln, f, x, y]
|
|
867
|
+
), vn = w(
|
|
867
868
|
(n) => {
|
|
868
|
-
|
|
869
|
+
Y((o) => {
|
|
869
870
|
const t = o.filter((p) => p.id === n || p.pinned);
|
|
870
|
-
if (!t.some((p) =>
|
|
871
|
+
if (!t.some((p) => Be(p, f))) {
|
|
871
872
|
const p = t.find((_) => _.id === n);
|
|
872
|
-
p &&
|
|
873
|
+
p && x(p.route);
|
|
873
874
|
}
|
|
874
875
|
return t;
|
|
875
876
|
});
|
|
876
877
|
},
|
|
877
|
-
[f,
|
|
878
|
-
),
|
|
879
|
-
|
|
878
|
+
[f, x]
|
|
879
|
+
), mn = w(() => {
|
|
880
|
+
Y((n) => {
|
|
880
881
|
const o = n.filter((t) => t.pinned);
|
|
881
|
-
return o.length > 0 && !o.some((t) =>
|
|
882
|
+
return o.length > 0 && !o.some((t) => Be(t, f)) && x(o[0].route), o;
|
|
882
883
|
});
|
|
883
|
-
}, [f,
|
|
884
|
-
|
|
885
|
-
}, []),
|
|
884
|
+
}, [f, x]), gn = w((n, o) => {
|
|
885
|
+
Y((t) => t.map((i) => i.id === n ? { ...i, pinned: o ?? !i.pinned } : i));
|
|
886
|
+
}, []), Bn = w((n, o) => {
|
|
886
887
|
const t = (i) => i.id === n ? { ...i, dirty: o ?? !i.dirty } : i.panes?.some((p) => p.id === n) ? { ...i, panes: i.panes.map(t) } : i;
|
|
887
|
-
|
|
888
|
-
}, []),
|
|
889
|
-
|
|
888
|
+
Y((i) => i.map(t));
|
|
889
|
+
}, []), yt = w((n, o) => {
|
|
890
|
+
Y((t) => {
|
|
890
891
|
const i = t.findIndex((g) => g.id === n), p = t.findIndex((g) => g.id === o);
|
|
891
892
|
if (i < 0 || p < 0 || i === p)
|
|
892
893
|
return t;
|
|
893
894
|
const _ = [...t], [D] = _.splice(i, 1);
|
|
894
895
|
return _.splice(p, 0, D), _;
|
|
895
896
|
});
|
|
896
|
-
}, []), pe =
|
|
897
|
-
if (!(!
|
|
898
|
-
return b.find((n) =>
|
|
899
|
-
}, [
|
|
897
|
+
}, []), pe = z(() => {
|
|
898
|
+
if (!(!y || f == null))
|
|
899
|
+
return b.find((n) => Be(n, f))?.id;
|
|
900
|
+
}, [y, f, b]), oe = z(() => {
|
|
900
901
|
const n = pe ? b.find((o) => o.id === pe) : void 0;
|
|
901
902
|
return n?.panes && n.panes.length > 1 ? n : void 0;
|
|
902
903
|
}, [pe, b]);
|
|
903
|
-
|
|
904
|
-
if (!
|
|
904
|
+
xe(() => {
|
|
905
|
+
if (!y)
|
|
905
906
|
return;
|
|
906
907
|
const n = (o) => {
|
|
907
908
|
if (o.ctrlKey || o.metaKey) {
|
|
908
909
|
if (o.key.toLowerCase() === "w" && pe) {
|
|
909
|
-
o.preventDefault(),
|
|
910
|
+
o.preventDefault(), Xe(pe);
|
|
910
911
|
return;
|
|
911
912
|
}
|
|
912
913
|
if (o.key === "Tab") {
|
|
@@ -915,90 +916,90 @@ const lo = {}, No = /* @__PURE__ */ Object.assign(
|
|
|
915
916
|
if (t < 0)
|
|
916
917
|
return;
|
|
917
918
|
const i = o.shiftKey ? -1 : 1, p = (t + i + b.length) % b.length, _ = b[p];
|
|
918
|
-
_ &&
|
|
919
|
+
_ && x(_.route);
|
|
919
920
|
return;
|
|
920
921
|
}
|
|
921
922
|
if (/^[1-9]$/.test(o.key)) {
|
|
922
923
|
const t = parseInt(o.key, 10) - 1, i = b[t];
|
|
923
|
-
i && (o.preventDefault(),
|
|
924
|
+
i && (o.preventDefault(), x(i.route));
|
|
924
925
|
}
|
|
925
926
|
}
|
|
926
927
|
};
|
|
927
928
|
return window.addEventListener("keydown", n), () => window.removeEventListener("keydown", n);
|
|
928
|
-
}, [
|
|
929
|
+
}, [y, b, pe, Xe, x]), Lt(
|
|
929
930
|
["sectionPrev", "sectionNext"],
|
|
930
931
|
(n) => {
|
|
931
|
-
if (!
|
|
932
|
+
if (!y || b.length < 2)
|
|
932
933
|
return !1;
|
|
933
934
|
const o = b.findIndex((p) => p.id === pe), t = n.intent === "sectionNext" ? 1 : -1, i = b[(o + t + b.length) % b.length];
|
|
934
|
-
return i &&
|
|
935
|
+
return i && x(i.route), !0;
|
|
935
936
|
},
|
|
936
|
-
{ ref:
|
|
937
|
+
{ ref: Pn }
|
|
937
938
|
);
|
|
938
|
-
const
|
|
939
|
+
const Dn = ie(/* @__PURE__ */ new Map()), An = ie(f), St = w(
|
|
939
940
|
(n) => {
|
|
940
941
|
if (f != null) {
|
|
941
|
-
const o =
|
|
942
|
-
o >= 0 &&
|
|
942
|
+
const o = Gn(n.currentTarget).indexOf(n.target);
|
|
943
|
+
o >= 0 && Dn.current.set(f, o);
|
|
943
944
|
}
|
|
944
945
|
},
|
|
945
946
|
[f]
|
|
946
947
|
);
|
|
947
|
-
|
|
948
|
-
const n =
|
|
949
|
-
if (
|
|
950
|
-
|
|
948
|
+
xe(() => {
|
|
949
|
+
const n = An.current;
|
|
950
|
+
if (An.current = f, pn.current) {
|
|
951
|
+
pn.current = !1;
|
|
951
952
|
return;
|
|
952
953
|
}
|
|
953
|
-
const o =
|
|
954
|
-
if (!
|
|
954
|
+
const o = Ye?.getState().method;
|
|
955
|
+
if (!xn || !Ye || n === f || f == null || o === "pointer" || o === "touch")
|
|
955
956
|
return;
|
|
956
|
-
const t =
|
|
957
|
+
const t = Rn.current;
|
|
957
958
|
if (!t || document.activeElement?.closest(".nice-nav-shell__tabs"))
|
|
958
959
|
return;
|
|
959
|
-
const i =
|
|
960
|
-
_ &&
|
|
961
|
-
const D = he(f,
|
|
962
|
-
|
|
960
|
+
const i = Gn(t), p = Dn.current.get(f), _ = (p !== void 0 ? i[p] : void 0) ?? i[0];
|
|
961
|
+
_ && Ye.focusElement(_);
|
|
962
|
+
const D = he(f, M, f);
|
|
963
|
+
Ye.announce(
|
|
963
964
|
h("a11y.navigatedTo", "Navigated to: {pageTitle}").replace(
|
|
964
965
|
"{pageTitle}",
|
|
965
966
|
typeof D == "string" ? D : f
|
|
966
967
|
)
|
|
967
968
|
);
|
|
968
|
-
}, [f,
|
|
969
|
-
const
|
|
969
|
+
}, [f, Ye, xn, M, h]);
|
|
970
|
+
const Hn = r ?? (k != null || S != null), yn = z(() => Hn ? { ...Zt(), ...be } : be, [be, Hn]), Sn = w(
|
|
970
971
|
(n) => {
|
|
971
|
-
const o =
|
|
972
|
-
return o != null ? typeof o == "function" ? o() : o : ye && n ===
|
|
973
|
-
|
|
972
|
+
const o = yn[n];
|
|
973
|
+
return o != null ? typeof o == "function" ? o() : o : ye && n === C ? ke ?? /* @__PURE__ */ s(
|
|
974
|
+
Vt,
|
|
974
975
|
{
|
|
975
976
|
userName: He,
|
|
976
|
-
userId:
|
|
977
|
-
openTabs: b.flatMap(
|
|
978
|
-
routes:
|
|
979
|
-
routeLabels:
|
|
977
|
+
userId: R,
|
|
978
|
+
openTabs: b.flatMap(lt).filter((t) => t.route !== C),
|
|
979
|
+
routes: yn,
|
|
980
|
+
routeLabels: M,
|
|
980
981
|
routeIcons: H,
|
|
981
982
|
onNavigate: (t) => fe(t),
|
|
982
983
|
...Ee
|
|
983
984
|
}
|
|
984
|
-
) : typeof
|
|
985
|
+
) : typeof Z == "function" ? Z(n) : Z;
|
|
985
986
|
},
|
|
986
987
|
[
|
|
987
|
-
|
|
988
|
-
|
|
988
|
+
yn,
|
|
989
|
+
Z,
|
|
989
990
|
ye,
|
|
990
|
-
|
|
991
|
-
|
|
991
|
+
C,
|
|
992
|
+
ke,
|
|
992
993
|
He,
|
|
993
994
|
Ee,
|
|
994
|
-
|
|
995
|
+
R,
|
|
995
996
|
b,
|
|
996
|
-
|
|
997
|
+
M,
|
|
997
998
|
H,
|
|
998
999
|
fe
|
|
999
1000
|
]
|
|
1000
|
-
),
|
|
1001
|
-
|
|
1001
|
+
), _t = z(() => oe ? null : f == null ? X !== void 0 ? X : Z != null && typeof Z != "function" ? Z : /* @__PURE__ */ s("div", { className: "nice-nav-shell__empty", "aria-hidden": "true" }) : /* @__PURE__ */ s(
|
|
1002
|
+
et.Provider,
|
|
1002
1003
|
{
|
|
1003
1004
|
value: {
|
|
1004
1005
|
route: f,
|
|
@@ -1007,73 +1008,96 @@ const lo = {}, No = /* @__PURE__ */ Object.assign(
|
|
|
1007
1008
|
footerSlot: null,
|
|
1008
1009
|
headerSlot: null
|
|
1009
1010
|
},
|
|
1010
|
-
children:
|
|
1011
|
+
children: Sn(f)
|
|
1011
1012
|
}
|
|
1012
|
-
), [
|
|
1013
|
+
), [oe, f, X, Z, Sn]), wt = Bt(`(max-width: ${Me}px)`), Se = Q || wt, an = w(
|
|
1013
1014
|
(n, o, t) => {
|
|
1014
1015
|
const i = me === "branch" ? t?.branchColor : me === "level" ? t?.color ?? t?.branchColor : void 0;
|
|
1015
1016
|
fe(n, {
|
|
1016
1017
|
forceNew: t?.forceNew,
|
|
1017
|
-
label:
|
|
1018
|
+
label: M && n in M ? void 0 : o?.label,
|
|
1018
1019
|
icon: H?.[n] ? void 0 : o?.icon,
|
|
1019
1020
|
color: i
|
|
1020
1021
|
});
|
|
1021
1022
|
},
|
|
1022
|
-
[me, fe,
|
|
1023
|
-
),
|
|
1024
|
-
value:
|
|
1025
|
-
defaultValue:
|
|
1023
|
+
[me, fe, M, H]
|
|
1024
|
+
), sn = !!j && j.length > 0, [Nt, En] = Dt({
|
|
1025
|
+
value: Pe,
|
|
1026
|
+
defaultValue: qe,
|
|
1026
1027
|
fallbackValue: !1,
|
|
1027
1028
|
componentName: "NiceNavShell"
|
|
1028
|
-
}), Ce =
|
|
1029
|
+
}), Ce = sn && Nt, rn = w(
|
|
1029
1030
|
(n) => {
|
|
1030
|
-
|
|
1031
|
+
En(n), de?.(n);
|
|
1031
1032
|
},
|
|
1032
|
-
[
|
|
1033
|
-
),
|
|
1033
|
+
[En, de]
|
|
1034
|
+
), je = Se && m != null && (P != null || k != null), [_n, Ue] = V(!1), wn = je && _n;
|
|
1035
|
+
xe(() => {
|
|
1036
|
+
je || Ue(!1);
|
|
1037
|
+
}, [je]);
|
|
1038
|
+
const Fn = z(
|
|
1039
|
+
() => je ? /* @__PURE__ */ s(
|
|
1040
|
+
"button",
|
|
1041
|
+
{
|
|
1042
|
+
type: "button",
|
|
1043
|
+
className: "nice-nav-shell__menu-button",
|
|
1044
|
+
"aria-label": h("nav.toggleMenu", "Toggle menu"),
|
|
1045
|
+
"aria-expanded": _n,
|
|
1046
|
+
onClick: () => Ue((n) => !n),
|
|
1047
|
+
"data-testid": "nice-nav-shell-menu-button",
|
|
1048
|
+
children: /* @__PURE__ */ s(W, { name: "menu", size: 20 })
|
|
1049
|
+
}
|
|
1050
|
+
) : null,
|
|
1051
|
+
[je, _n, h]
|
|
1052
|
+
), kt = z(
|
|
1034
1053
|
() => ({
|
|
1035
1054
|
activeRoute: f,
|
|
1036
1055
|
tabs: b,
|
|
1037
|
-
isMobile:
|
|
1056
|
+
isMobile: Se,
|
|
1057
|
+
mobileMenuButton: Fn,
|
|
1058
|
+
mobileMenuOpen: wn,
|
|
1059
|
+
setMobileMenuOpen: Ue,
|
|
1038
1060
|
openRoute: fe,
|
|
1039
|
-
openFromSidebar:
|
|
1040
|
-
closeTab:
|
|
1041
|
-
closeOthers:
|
|
1042
|
-
closeAll:
|
|
1043
|
-
pinTab:
|
|
1044
|
-
setDirty:
|
|
1045
|
-
mergeTabs:
|
|
1046
|
-
splitTab:
|
|
1061
|
+
openFromSidebar: an,
|
|
1062
|
+
closeTab: Xe,
|
|
1063
|
+
closeOthers: vn,
|
|
1064
|
+
closeAll: mn,
|
|
1065
|
+
pinTab: gn,
|
|
1066
|
+
setDirty: Bn,
|
|
1067
|
+
mergeTabs: hn,
|
|
1068
|
+
splitTab: bn,
|
|
1047
1069
|
topBarOpen: Ce,
|
|
1048
|
-
setTopBarOpen:
|
|
1070
|
+
setTopBarOpen: rn
|
|
1049
1071
|
}),
|
|
1050
1072
|
[
|
|
1051
1073
|
f,
|
|
1052
1074
|
b,
|
|
1053
|
-
|
|
1075
|
+
Se,
|
|
1076
|
+
Fn,
|
|
1077
|
+
wn,
|
|
1054
1078
|
fe,
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1079
|
+
an,
|
|
1080
|
+
Xe,
|
|
1081
|
+
vn,
|
|
1082
|
+
mn,
|
|
1083
|
+
gn,
|
|
1084
|
+
Bn,
|
|
1059
1085
|
hn,
|
|
1060
|
-
|
|
1061
|
-
dn,
|
|
1062
|
-
un,
|
|
1086
|
+
bn,
|
|
1063
1087
|
Ce,
|
|
1064
|
-
|
|
1088
|
+
rn
|
|
1065
1089
|
]
|
|
1066
|
-
),
|
|
1067
|
-
(n) => !(ye && n.route ===
|
|
1068
|
-
[ye,
|
|
1069
|
-
),
|
|
1070
|
-
if (
|
|
1071
|
-
return
|
|
1072
|
-
const n = new Set(
|
|
1090
|
+
), Tt = w(
|
|
1091
|
+
(n) => !(ye && n.route === C),
|
|
1092
|
+
[ye, C]
|
|
1093
|
+
), Nn = (n) => typeof n == "function" ? n(kt) : n ?? null, cn = G ?? f, [Ct, kn] = V(!1), $n = m != null || N != null, Kn = !Se && (P != null || k != null), xt = P != null || k != null, Mt = ye && b.length === 1 && b[0].route === C, Tn = y && b.length > 0 && !(Mt && !xt), zn = z(() => {
|
|
1094
|
+
if (Re && Re.length > 0)
|
|
1095
|
+
return Re;
|
|
1096
|
+
const n = new Set(Oe ?? []);
|
|
1073
1097
|
return [
|
|
1074
1098
|
{
|
|
1075
1099
|
key: "topNav",
|
|
1076
|
-
visible:
|
|
1100
|
+
visible: $n,
|
|
1077
1101
|
step: {
|
|
1078
1102
|
target: ".nice-nav-shell__topnav",
|
|
1079
1103
|
title: h("navShell.help.topNav.title", "Top navigation"),
|
|
@@ -1086,11 +1110,11 @@ const lo = {}, No = /* @__PURE__ */ Object.assign(
|
|
|
1086
1110
|
},
|
|
1087
1111
|
{
|
|
1088
1112
|
key: "sidebar",
|
|
1089
|
-
visible:
|
|
1113
|
+
visible: Kn,
|
|
1090
1114
|
step: {
|
|
1091
1115
|
target: ".nice-nav-shell__sidebar",
|
|
1092
1116
|
title: h("navShell.help.sidebar.title", "Sidebar"),
|
|
1093
|
-
content:
|
|
1117
|
+
content: y ? h(
|
|
1094
1118
|
"navShell.help.sidebar.body",
|
|
1095
1119
|
"Browse the available views grouped by section. Pick a view to open it in a new tab."
|
|
1096
1120
|
) : h(
|
|
@@ -1102,7 +1126,7 @@ const lo = {}, No = /* @__PURE__ */ Object.assign(
|
|
|
1102
1126
|
},
|
|
1103
1127
|
{
|
|
1104
1128
|
key: "tabs",
|
|
1105
|
-
visible:
|
|
1129
|
+
visible: Tn,
|
|
1106
1130
|
step: {
|
|
1107
1131
|
target: '[data-testid="nice-nav-shell-tabs"]',
|
|
1108
1132
|
title: h("navShell.help.tabs.title", "Tabs"),
|
|
@@ -1119,7 +1143,7 @@ const lo = {}, No = /* @__PURE__ */ Object.assign(
|
|
|
1119
1143
|
step: {
|
|
1120
1144
|
target: ".nice-nav-shell__content",
|
|
1121
1145
|
title: h("navShell.help.content.title", "Workspace"),
|
|
1122
|
-
content:
|
|
1146
|
+
content: y ? h(
|
|
1123
1147
|
"navShell.help.content.body",
|
|
1124
1148
|
"The main area shows the active view. Switching tabs or sidebar entries swaps the content here."
|
|
1125
1149
|
) : h(
|
|
@@ -1130,7 +1154,7 @@ const lo = {}, No = /* @__PURE__ */ Object.assign(
|
|
|
1130
1154
|
}
|
|
1131
1155
|
}
|
|
1132
1156
|
].filter((t) => t.visible && !n.has(t.key)).map((t) => t.step);
|
|
1133
|
-
}, [
|
|
1157
|
+
}, [Re, Oe, $n, Kn, Tn, y, h]), It = z(
|
|
1134
1158
|
() => ({
|
|
1135
1159
|
next: h("navShell.help.next", "Next"),
|
|
1136
1160
|
back: h("navShell.help.back", "Back"),
|
|
@@ -1143,101 +1167,101 @@ const lo = {}, No = /* @__PURE__ */ Object.assign(
|
|
|
1143
1167
|
close: h("tutorial.close", "Close")
|
|
1144
1168
|
}),
|
|
1145
1169
|
[h]
|
|
1146
|
-
),
|
|
1147
|
-
|
|
1148
|
-
} : L, [
|
|
1149
|
-
if (!N && !
|
|
1170
|
+
), Yn = $ ?? nn, dn = z(() => Yn ? (n, o, t) => {
|
|
1171
|
+
an(n, o, t), L?.(n, o, t);
|
|
1172
|
+
} : L, [Yn, L, an]), Xn = z(() => {
|
|
1173
|
+
if (!N && !k && !Fe && !sn)
|
|
1150
1174
|
return N;
|
|
1151
1175
|
const n = N ?? {}, o = {
|
|
1152
1176
|
...n,
|
|
1153
|
-
sidebarData: n.sidebarData ??
|
|
1154
|
-
sidebarUserId: n.sidebarUserId ??
|
|
1155
|
-
sidebarActiveRoute: n.sidebarActiveRoute ??
|
|
1156
|
-
onSidebarNavigate: n.onSidebarNavigate ??
|
|
1157
|
-
sidebarOpenInNewTab: n.sidebarOpenInNewTab ??
|
|
1158
|
-
forceMobileLayout: n.forceMobileLayout ??
|
|
1177
|
+
sidebarData: n.sidebarData ?? k,
|
|
1178
|
+
sidebarUserId: n.sidebarUserId ?? R,
|
|
1179
|
+
sidebarActiveRoute: n.sidebarActiveRoute ?? cn,
|
|
1180
|
+
onSidebarNavigate: n.onSidebarNavigate ?? dn,
|
|
1181
|
+
sidebarOpenInNewTab: n.sidebarOpenInNewTab ?? y,
|
|
1182
|
+
forceMobileLayout: n.forceMobileLayout ?? Se
|
|
1159
1183
|
};
|
|
1160
|
-
if (ye && !
|
|
1184
|
+
if (ye && !y && !n.onBrandClick && !n.brandHref && (o.onBrandClick = () => fe(C)), Fe) {
|
|
1161
1185
|
o.showHelpButton = !0;
|
|
1162
1186
|
const t = n.onHelpClick;
|
|
1163
1187
|
o.onHelpClick = () => {
|
|
1164
|
-
t?.(),
|
|
1188
|
+
t?.(), kn(!0);
|
|
1165
1189
|
}, o.helpLabel = n.helpLabel ?? h("nav.help", "Help");
|
|
1166
1190
|
}
|
|
1167
|
-
return
|
|
1191
|
+
return sn && (o.extraActions = [
|
|
1168
1192
|
...n.extraActions ?? [],
|
|
1169
1193
|
{
|
|
1170
1194
|
id: "nice-nav-shell-top-bar",
|
|
1171
1195
|
label: Ce ? h("navShell.topBarHide", "Hide the toolbar") : h("navShell.topBarShow", "Show the toolbar"),
|
|
1172
|
-
icon: /* @__PURE__ */
|
|
1173
|
-
onClick: () =>
|
|
1196
|
+
icon: /* @__PURE__ */ s(W, { name: Ce ? "chevron-up" : "chevron-down", size: 18 }),
|
|
1197
|
+
onClick: () => rn(!Ce)
|
|
1174
1198
|
}
|
|
1175
1199
|
]), o;
|
|
1176
1200
|
}, [
|
|
1177
|
-
|
|
1201
|
+
sn,
|
|
1178
1202
|
Ce,
|
|
1179
|
-
|
|
1203
|
+
rn,
|
|
1180
1204
|
N,
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1205
|
+
k,
|
|
1206
|
+
R,
|
|
1207
|
+
cn,
|
|
1208
|
+
dn,
|
|
1209
|
+
Se,
|
|
1210
|
+
y,
|
|
1187
1211
|
ye,
|
|
1188
|
-
|
|
1212
|
+
C,
|
|
1189
1213
|
fe,
|
|
1190
1214
|
Fe,
|
|
1191
1215
|
h
|
|
1192
|
-
]),
|
|
1193
|
-
|
|
1216
|
+
]), jn = Se ? null : P != null ? Nn(P) : k ? /* @__PURE__ */ s(
|
|
1217
|
+
Zn,
|
|
1194
1218
|
{
|
|
1195
1219
|
...e,
|
|
1196
|
-
openInNewTab: e?.openInNewTab ??
|
|
1197
|
-
data:
|
|
1198
|
-
userId:
|
|
1199
|
-
preferences:
|
|
1200
|
-
onPreferencesChange:
|
|
1201
|
-
activeRoute:
|
|
1202
|
-
onNavigate:
|
|
1220
|
+
openInNewTab: e?.openInNewTab ?? y,
|
|
1221
|
+
data: k,
|
|
1222
|
+
userId: R,
|
|
1223
|
+
preferences: $e,
|
|
1224
|
+
onPreferencesChange: Ke,
|
|
1225
|
+
activeRoute: cn,
|
|
1226
|
+
onNavigate: dn,
|
|
1203
1227
|
routeToUrl: l,
|
|
1204
1228
|
sticky: !1,
|
|
1205
|
-
surfaceOpacity:
|
|
1229
|
+
surfaceOpacity: O
|
|
1206
1230
|
}
|
|
1207
|
-
) : null,
|
|
1231
|
+
) : null, Un = h("navShell.region.top", "Top bar"), Vn = /* @__PURE__ */ le(
|
|
1208
1232
|
"div",
|
|
1209
1233
|
{
|
|
1210
|
-
ref:
|
|
1211
|
-
className: ["nice-nav-shell",
|
|
1212
|
-
style:
|
|
1213
|
-
height:
|
|
1214
|
-
"--nice-shell-surface-alpha":
|
|
1234
|
+
ref: dt,
|
|
1235
|
+
className: ["nice-nav-shell", Se ? "nice-nav-shell--mobile" : "", at].filter(Boolean).join(" "),
|
|
1236
|
+
style: O != null || Te != null || K != null ? {
|
|
1237
|
+
height: Te,
|
|
1238
|
+
"--nice-shell-surface-alpha": O != null ? String(O) : void 0,
|
|
1215
1239
|
"--nice-nav-shell-content-padding": typeof K == "number" ? `${K}px` : K
|
|
1216
1240
|
} : void 0,
|
|
1217
|
-
"data-testid":
|
|
1241
|
+
"data-testid": rt,
|
|
1218
1242
|
"data-nice-focus-scope": "spatial",
|
|
1219
1243
|
"data-nice-arrows": "spatial",
|
|
1220
|
-
"data-nice-tv":
|
|
1244
|
+
"data-nice-tv": en ? "on" : void 0,
|
|
1221
1245
|
children: [
|
|
1222
|
-
m != null ? /* @__PURE__ */
|
|
1246
|
+
m != null ? /* @__PURE__ */ s(
|
|
1223
1247
|
"div",
|
|
1224
1248
|
{
|
|
1225
1249
|
className: "nice-nav-shell__topnav",
|
|
1226
1250
|
"data-nice-focus-scope": "spatial",
|
|
1227
|
-
"data-nice-region":
|
|
1228
|
-
children:
|
|
1251
|
+
"data-nice-region": Un,
|
|
1252
|
+
children: Nn(m)
|
|
1229
1253
|
}
|
|
1230
|
-
) :
|
|
1254
|
+
) : Xn ? /* @__PURE__ */ s(
|
|
1231
1255
|
"div",
|
|
1232
1256
|
{
|
|
1233
1257
|
className: "nice-nav-shell__topnav",
|
|
1234
1258
|
"data-nice-focus-scope": "spatial",
|
|
1235
|
-
"data-nice-region":
|
|
1236
|
-
children: /* @__PURE__ */
|
|
1259
|
+
"data-nice-region": Un,
|
|
1260
|
+
children: /* @__PURE__ */ s(qt, { ...Xn, surfaceOpacity: O })
|
|
1237
1261
|
}
|
|
1238
1262
|
) : null,
|
|
1239
|
-
Ce && /* @__PURE__ */
|
|
1240
|
-
|
|
1263
|
+
Ce && /* @__PURE__ */ s("div", { className: "nice-nav-shell__topbar", children: /* @__PURE__ */ s(
|
|
1264
|
+
Ut,
|
|
1241
1265
|
{
|
|
1242
1266
|
orientation: "horizontal",
|
|
1243
1267
|
items: j,
|
|
@@ -1248,85 +1272,114 @@ const lo = {}, No = /* @__PURE__ */ Object.assign(
|
|
|
1248
1272
|
"aria-label": h("navShell.topBar", "Toolbar")
|
|
1249
1273
|
}
|
|
1250
1274
|
) }),
|
|
1251
|
-
|
|
1275
|
+
wn && /* @__PURE__ */ s(
|
|
1276
|
+
Kt,
|
|
1277
|
+
{
|
|
1278
|
+
open: !0,
|
|
1279
|
+
onClose: () => Ue(!1),
|
|
1280
|
+
title: h("nav.menu", "Menu"),
|
|
1281
|
+
position: "left",
|
|
1282
|
+
size: "sm",
|
|
1283
|
+
className: "nice-nav-shell__menu-drawer",
|
|
1284
|
+
children: k ? /* @__PURE__ */ s(
|
|
1285
|
+
Zn,
|
|
1286
|
+
{
|
|
1287
|
+
...e,
|
|
1288
|
+
embedded: !0,
|
|
1289
|
+
openInNewTab: e?.openInNewTab ?? y,
|
|
1290
|
+
data: k,
|
|
1291
|
+
userId: R,
|
|
1292
|
+
preferences: $e,
|
|
1293
|
+
onPreferencesChange: Ke,
|
|
1294
|
+
activeRoute: cn,
|
|
1295
|
+
onNavigate: (n, o, t) => {
|
|
1296
|
+
Ue(!1), dn?.(n, o, t);
|
|
1297
|
+
},
|
|
1298
|
+
routeToUrl: l,
|
|
1299
|
+
sticky: !1
|
|
1300
|
+
}
|
|
1301
|
+
) : Nn(P)
|
|
1302
|
+
}
|
|
1303
|
+
),
|
|
1304
|
+
U === "top" && /* @__PURE__ */ s(Wn, { visibility: "pad", position: "top", className: "nice-nav-shell__hint-bar" }),
|
|
1252
1305
|
/* @__PURE__ */ le("div", { className: "nice-nav-shell__body", children: [
|
|
1253
|
-
|
|
1306
|
+
jn != null && /* @__PURE__ */ s(
|
|
1254
1307
|
"div",
|
|
1255
1308
|
{
|
|
1256
1309
|
className: "nice-nav-shell__sidebar",
|
|
1257
1310
|
"data-nice-focus-scope": "vertical",
|
|
1258
1311
|
"data-nice-region": h("navShell.region.sidebar", "Navigation"),
|
|
1259
|
-
children:
|
|
1312
|
+
children: jn
|
|
1260
1313
|
}
|
|
1261
1314
|
),
|
|
1262
1315
|
/* @__PURE__ */ le("div", { className: "nice-nav-shell__main", children: [
|
|
1263
|
-
|
|
1264
|
-
|
|
1316
|
+
Tn && /* @__PURE__ */ s(
|
|
1317
|
+
ao,
|
|
1265
1318
|
{
|
|
1266
1319
|
tabs: b,
|
|
1267
1320
|
activeId: pe,
|
|
1268
|
-
scrollable:
|
|
1269
|
-
closable:
|
|
1270
|
-
pinnable:
|
|
1321
|
+
scrollable: fn,
|
|
1322
|
+
closable: we,
|
|
1323
|
+
pinnable: re,
|
|
1271
1324
|
reorderable: ce,
|
|
1272
1325
|
mergeable: Ae,
|
|
1273
|
-
contextMenu:
|
|
1274
|
-
routeLabels:
|
|
1326
|
+
contextMenu: Je,
|
|
1327
|
+
routeLabels: M,
|
|
1275
1328
|
routeIcons: H,
|
|
1276
|
-
canMerge:
|
|
1277
|
-
colorStyle:
|
|
1278
|
-
onActivate: (n) =>
|
|
1279
|
-
onClose:
|
|
1280
|
-
onCloseOthers:
|
|
1281
|
-
onCloseAll:
|
|
1282
|
-
onPin:
|
|
1283
|
-
onReorder:
|
|
1284
|
-
onMerge:
|
|
1285
|
-
onSplit:
|
|
1286
|
-
onLayout:
|
|
1329
|
+
canMerge: Tt,
|
|
1330
|
+
colorStyle: ct,
|
|
1331
|
+
onActivate: (n) => x(n.route),
|
|
1332
|
+
onClose: Xe,
|
|
1333
|
+
onCloseOthers: vn,
|
|
1334
|
+
onCloseAll: mn,
|
|
1335
|
+
onPin: gn,
|
|
1336
|
+
onReorder: yt,
|
|
1337
|
+
onMerge: hn,
|
|
1338
|
+
onSplit: bn,
|
|
1339
|
+
onLayout: mt
|
|
1287
1340
|
}
|
|
1288
1341
|
),
|
|
1289
|
-
v && /* @__PURE__ */
|
|
1342
|
+
v && /* @__PURE__ */ s(
|
|
1290
1343
|
"div",
|
|
1291
1344
|
{
|
|
1292
1345
|
className: "nice-nav-shell__sticky-header",
|
|
1293
1346
|
role: "region",
|
|
1294
1347
|
"aria-label": h("navShell.pageHeader", "page header"),
|
|
1295
|
-
children:
|
|
1348
|
+
children: I
|
|
1296
1349
|
}
|
|
1297
1350
|
),
|
|
1298
|
-
/* @__PURE__ */
|
|
1351
|
+
/* @__PURE__ */ s(
|
|
1299
1352
|
"div",
|
|
1300
1353
|
{
|
|
1301
|
-
ref:
|
|
1354
|
+
ref: Rn,
|
|
1302
1355
|
className: [
|
|
1303
1356
|
"nice-nav-shell__content",
|
|
1304
1357
|
`nice-nav-shell__content--anim-${E}`,
|
|
1305
|
-
|
|
1306
|
-
|
|
1358
|
+
oe ? "nice-nav-shell__content--split" : "",
|
|
1359
|
+
st
|
|
1307
1360
|
].filter(Boolean).join(" "),
|
|
1308
1361
|
"data-nice-focus-scope": "spatial",
|
|
1309
1362
|
"data-nice-region": h("navShell.region.content", "Content"),
|
|
1310
1363
|
"data-nice-arrows": c === "native" ? "native" : void 0,
|
|
1311
|
-
onFocus:
|
|
1312
|
-
children:
|
|
1313
|
-
|
|
1364
|
+
onFocus: St,
|
|
1365
|
+
children: oe ? /* @__PURE__ */ s(
|
|
1366
|
+
so,
|
|
1314
1367
|
{
|
|
1315
|
-
tab:
|
|
1368
|
+
tab: oe,
|
|
1316
1369
|
activeRoute: f,
|
|
1317
|
-
routeLabels:
|
|
1370
|
+
routeLabels: M,
|
|
1318
1371
|
routeIcons: H,
|
|
1319
|
-
closable:
|
|
1320
|
-
renderRoute:
|
|
1321
|
-
onFocusPane: (n) =>
|
|
1322
|
-
onDetachPane: (n) =>
|
|
1323
|
-
onClosePane: (n) =>
|
|
1372
|
+
closable: we,
|
|
1373
|
+
renderRoute: Sn,
|
|
1374
|
+
onFocusPane: (n) => gt(oe.id, n),
|
|
1375
|
+
onDetachPane: (n) => ln(oe.id, n, !0),
|
|
1376
|
+
onClosePane: (n) => ln(oe.id, n, !1)
|
|
1324
1377
|
}
|
|
1325
|
-
) :
|
|
1378
|
+
) : _t
|
|
1326
1379
|
},
|
|
1327
|
-
|
|
1380
|
+
oe ? oe.id : f
|
|
1328
1381
|
),
|
|
1329
|
-
|
|
1382
|
+
te && /* @__PURE__ */ s(
|
|
1330
1383
|
"div",
|
|
1331
1384
|
{
|
|
1332
1385
|
className: "nice-nav-shell__sticky-footer",
|
|
@@ -1337,62 +1390,62 @@ const lo = {}, No = /* @__PURE__ */ Object.assign(
|
|
|
1337
1390
|
)
|
|
1338
1391
|
] })
|
|
1339
1392
|
] }),
|
|
1340
|
-
U === "bottom" && /* @__PURE__ */
|
|
1341
|
-
|
|
1393
|
+
U === "bottom" && /* @__PURE__ */ s(
|
|
1394
|
+
Wn,
|
|
1342
1395
|
{
|
|
1343
1396
|
visibility: "pad",
|
|
1344
1397
|
position: "bottom",
|
|
1345
1398
|
className: "nice-nav-shell__hint-bar"
|
|
1346
1399
|
}
|
|
1347
1400
|
),
|
|
1348
|
-
/* @__PURE__ */
|
|
1349
|
-
|
|
1350
|
-
|
|
1401
|
+
/* @__PURE__ */ s(zt, {}),
|
|
1402
|
+
zn.length > 0 && /* @__PURE__ */ s(
|
|
1403
|
+
Yt,
|
|
1351
1404
|
{
|
|
1352
|
-
active:
|
|
1353
|
-
steps:
|
|
1354
|
-
labels:
|
|
1355
|
-
onFinish: () =>
|
|
1356
|
-
onSkip: () =>
|
|
1405
|
+
active: Ct,
|
|
1406
|
+
steps: zn,
|
|
1407
|
+
labels: It,
|
|
1408
|
+
onFinish: () => kn(!1),
|
|
1409
|
+
onSkip: () => kn(!1)
|
|
1357
1410
|
}
|
|
1358
1411
|
),
|
|
1359
|
-
A !== !1 && A !== void 0 && /* @__PURE__ */
|
|
1360
|
-
|
|
1412
|
+
A !== !1 && A !== void 0 && /* @__PURE__ */ s(
|
|
1413
|
+
jt,
|
|
1361
1414
|
{
|
|
1362
|
-
...
|
|
1363
|
-
open:
|
|
1415
|
+
...In,
|
|
1416
|
+
open: ze.firstRun === void 0,
|
|
1364
1417
|
value: {
|
|
1365
|
-
pageMode: De ??
|
|
1366
|
-
colorStyle:
|
|
1367
|
-
...
|
|
1418
|
+
pageMode: De ?? ze.pageMode,
|
|
1419
|
+
colorStyle: ze.colorStyle,
|
|
1420
|
+
...In?.value
|
|
1368
1421
|
},
|
|
1369
1422
|
onSave: (n) => {
|
|
1370
|
-
|
|
1423
|
+
Mn.setFirstRun("done", {
|
|
1371
1424
|
pageMode: n.pageMode,
|
|
1372
1425
|
colorStyle: n.colorStyle
|
|
1373
|
-
}),
|
|
1426
|
+
}), J?.(n);
|
|
1374
1427
|
},
|
|
1375
|
-
onSkip: () =>
|
|
1428
|
+
onSkip: () => Mn.setFirstRun("skipped")
|
|
1376
1429
|
}
|
|
1377
1430
|
)
|
|
1378
1431
|
]
|
|
1379
1432
|
}
|
|
1380
|
-
),
|
|
1381
|
-
return /* @__PURE__ */
|
|
1382
|
-
|
|
1433
|
+
), Pt = ue ? /* @__PURE__ */ s(At, { ...B, children: Vn }) : Vn;
|
|
1434
|
+
return /* @__PURE__ */ s(
|
|
1435
|
+
eo,
|
|
1383
1436
|
{
|
|
1384
|
-
userId:
|
|
1385
|
-
data:
|
|
1386
|
-
tabsAvailable:
|
|
1437
|
+
userId: R,
|
|
1438
|
+
data: k,
|
|
1439
|
+
tabsAvailable: nn,
|
|
1387
1440
|
pageMode: De,
|
|
1388
|
-
preferences:
|
|
1389
|
-
onPreferencesChange:
|
|
1390
|
-
children: /* @__PURE__ */
|
|
1441
|
+
preferences: $e,
|
|
1442
|
+
onPreferencesChange: Ke,
|
|
1443
|
+
children: /* @__PURE__ */ s(Ft, { children: Pt })
|
|
1391
1444
|
}
|
|
1392
1445
|
);
|
|
1393
1446
|
}),
|
|
1394
1447
|
{ displayName: "NiceNavShell" }
|
|
1395
1448
|
);
|
|
1396
1449
|
export {
|
|
1397
|
-
|
|
1450
|
+
Po as NiceNavShell
|
|
1398
1451
|
};
|