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