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