@nice2dev/ui 1.3.16 → 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 +138 -0
- package/README.md +2 -2
- package/dist/{NiceDataGrid-aNPAHsWy.cjs → NiceDataGrid-CFibAGHt.cjs} +1 -1
- package/dist/NiceEventOrchestrator.doc-Dwtq2s_L.cjs +6 -0
- 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/docs/NiceEventOrchestrator.doc.json.mjs +19 -19
- 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 +216 -216
- package/dist/index.d.ts +192 -69
- package/dist/index.mjs +933 -926
- 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/dist/tools/NiceThemeDesigner.mjs +1359 -900
- package/dist/tools/NiceThemePreview.mjs +18 -18
- package/dist/tools/themeCatalog.mjs +50 -0
- package/dist/workflow/NiceWorkflowDesigner.mjs +452 -898
- package/package.json +4 -4
- package/dist/NiceEventOrchestrator.doc-CxjsLxBG.cjs +0 -6
- package/dist/NiceForm-BtRBLffD.cjs +0 -1
- package/dist/NiceModuleLifecyclePanel-ugNtHimh.cjs +0 -1
|
@@ -1,298 +1,319 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useNiceTranslation as
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { createPortal as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
1
|
+
import { jsx as i, jsxs as I, Fragment as tn } from "react/jsx-runtime";
|
|
2
|
+
import { useNiceTranslation as Ne, NiceThemeContext as it, useControllableState as nt, NiceIcon as ne, useRovingFocus as Yi } from "@nice2dev/ui-core";
|
|
3
|
+
import { forwardRef as rn, useState as ye, useRef as se, useEffect as ni, useCallback as ee, useMemo as B, useContext as ue, isValidElement as Ii, createContext as Re } from "react";
|
|
4
|
+
import { createPortal as tt } from "react-dom";
|
|
5
|
+
import { useTreeDragSession as xi, TreeDragSessionProvider as rt, startTreeDrag as an } from "../data/treeDragSession.mjs";
|
|
6
|
+
import { NiceTooltip as Y } from "../display/NiceTooltip.mjs";
|
|
7
|
+
import { useNavItemDrop as ti, navItemDrag as on, useNavItemDragActive as at } from "./navItemDrag.mjs";
|
|
8
|
+
import { NiceContextMenu as sn } from "./NiceContextMenu.mjs";
|
|
9
|
+
import { NiceIconRail as Qi } from "./NiceIconRail.mjs";
|
|
10
|
+
import { rootColorScope as ot, levelColorVars as st, colorsOf as ct, branchColorScope as cn, rowColors as ii, shadeRowVars as lt, shadeSourceHeadVars as dt, colorLevel as ut } from "./sidebarColors.mjs";
|
|
11
|
+
import { storableFavorite as qe, sidebarFavoriteItems as wi, sidebarFavoriteLists as vt, activeSidebarFavoriteList as bt, sidebarFavoriteListsOf as Li, storablePath as ln, sidebarFavoriteTree as ht } from "./sidebarFavorites.mjs";
|
|
12
|
+
import { walkSidebarNav as Ci, findSidebarItemByRoute as pt } from "./sidebarNavTree.mjs";
|
|
13
|
+
import { SIDEBAR_DEFAULT_FAVORITE_LIST as $e, DEFAULT_SIDEBAR_PREFS as dn, SIDEBAR_MODE_META as yi, sidebarModeLabel as ei } from "./sidebarNavTypes.mjs";
|
|
14
|
+
import { PREFS_CATEGORIES as ft } from "./sidebarPrefs/prefsCategories.mjs";
|
|
15
|
+
import { SidebarScopeSpinner as Xi, ScopeEditActions as mt, ScopePickerPanel as _t } from "./sidebarScopePicker.mjs";
|
|
16
|
+
import { normalizeSidebarSearch as Nt, filterSidebarItems as un, sidebarItemMatches as Zi } from "./sidebarSearch.mjs";
|
|
14
17
|
/* empty css */
|
|
15
|
-
function
|
|
16
|
-
return typeof e == "string" ? /* @__PURE__ */
|
|
18
|
+
function Oe(e) {
|
|
19
|
+
return typeof e == "string" ? /* @__PURE__ */ i(ne, { name: e }) : e;
|
|
17
20
|
}
|
|
18
|
-
const
|
|
19
|
-
function
|
|
20
|
-
const
|
|
21
|
-
let
|
|
22
|
-
for (let
|
|
23
|
-
|
|
24
|
-
return
|
|
21
|
+
const gt = [], St = [], Ge = /* @__PURE__ */ Re("theme"), vn = /* @__PURE__ */ Re(!0), bn = /* @__PURE__ */ Re(null), hn = /* @__PURE__ */ Re(null), pn = /* @__PURE__ */ Re(!1), mi = "__nice-shortcuts__";
|
|
22
|
+
function Wi(e, r) {
|
|
23
|
+
const u = new Set(r.map((d) => d.toLowerCase()));
|
|
24
|
+
let s = e;
|
|
25
|
+
for (let d = 2; u.has(s.toLowerCase()); d++)
|
|
26
|
+
s = `${e} ${d}`;
|
|
27
|
+
return s;
|
|
25
28
|
}
|
|
26
|
-
function
|
|
29
|
+
function fn(e) {
|
|
27
30
|
return `nice_sidebar_nav_${e ?? "_default"}`;
|
|
28
31
|
}
|
|
29
|
-
const
|
|
30
|
-
function
|
|
31
|
-
return e != null && (
|
|
32
|
+
const _i = "nice-sidebar-prefs-change";
|
|
33
|
+
function wt(e, r) {
|
|
34
|
+
return e != null && (r != null || e.activeMode !== void 0);
|
|
32
35
|
}
|
|
33
|
-
function
|
|
34
|
-
const
|
|
35
|
-
...
|
|
36
|
+
function en(e, r, u = r?.activeMode !== void 0) {
|
|
37
|
+
const s = {
|
|
38
|
+
...dn,
|
|
36
39
|
userId: e ?? "_default"
|
|
37
40
|
};
|
|
38
|
-
if (
|
|
39
|
-
return
|
|
41
|
+
if (r && Object.assign(s, r), u)
|
|
42
|
+
return s;
|
|
40
43
|
try {
|
|
41
|
-
const
|
|
42
|
-
if (
|
|
43
|
-
const
|
|
44
|
-
return Array.isArray(
|
|
45
|
-
(
|
|
46
|
-
...
|
|
47
|
-
icon: typeof
|
|
48
|
-
} :
|
|
49
|
-
)), { ...
|
|
44
|
+
const d = localStorage.getItem(fn(e));
|
|
45
|
+
if (d) {
|
|
46
|
+
const l = JSON.parse(d);
|
|
47
|
+
return Array.isArray(l.favorites) && (l.favorites = l.favorites.map(
|
|
48
|
+
(b) => b && typeof b == "object" ? {
|
|
49
|
+
...b,
|
|
50
|
+
icon: typeof b.icon == "string" || Ii(b.icon) ? b.icon : void 0
|
|
51
|
+
} : b
|
|
52
|
+
)), { ...s, ...l, userId: e ?? "_default" };
|
|
50
53
|
}
|
|
51
54
|
} catch {
|
|
52
55
|
}
|
|
53
|
-
return
|
|
56
|
+
return s;
|
|
54
57
|
}
|
|
55
|
-
function
|
|
56
|
-
if (
|
|
57
|
-
const
|
|
58
|
-
return
|
|
58
|
+
function Ni(e, r, u, s) {
|
|
59
|
+
if (r === $e) {
|
|
60
|
+
const _ = e.favorites.some((k) => k.id === u.id);
|
|
61
|
+
return s === _ ? e : {
|
|
59
62
|
...e,
|
|
60
|
-
favorites:
|
|
63
|
+
favorites: s ? [...e.favorites, { ...u, addedAt: Date.now() }] : e.favorites.filter((k) => k.id !== u.id)
|
|
61
64
|
};
|
|
62
65
|
}
|
|
63
|
-
const
|
|
64
|
-
if (!
|
|
66
|
+
const d = e.favoriteLists ?? [], l = d.find((_) => _.id === r);
|
|
67
|
+
if (!l || s === l.items.some((_) => _.id === u.id))
|
|
65
68
|
return e;
|
|
66
|
-
const
|
|
67
|
-
return { ...e, favoriteLists:
|
|
69
|
+
const b = s ? [...l.items, { ...qe(u), addedAt: Date.now() }] : l.items.filter((_) => _.id !== u.id);
|
|
70
|
+
return { ...e, favoriteLists: d.map((_) => _.id === r ? { ..._, items: b } : _) };
|
|
68
71
|
}
|
|
69
|
-
function
|
|
70
|
-
const
|
|
71
|
-
const
|
|
72
|
-
return
|
|
73
|
-
}),
|
|
74
|
-
|
|
75
|
-
!
|
|
76
|
-
}, [
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
const
|
|
80
|
-
(
|
|
81
|
-
const
|
|
82
|
-
if (o !==
|
|
83
|
-
if (
|
|
72
|
+
function Ct(e, r, u, s, d) {
|
|
73
|
+
const l = d?.controlled ?? wt(u, s), [b, _] = ye(() => {
|
|
74
|
+
const a = en(e, u, l);
|
|
75
|
+
return r !== void 0 && (a.enableModeIcons = r), a;
|
|
76
|
+
}), k = se(u);
|
|
77
|
+
ni(() => {
|
|
78
|
+
!u || k.current === u || (k.current = u, _((a) => ({ ...a, ...u })));
|
|
79
|
+
}, [u]);
|
|
80
|
+
const C = se(b);
|
|
81
|
+
C.current = b;
|
|
82
|
+
const v = ee(
|
|
83
|
+
(a) => {
|
|
84
|
+
const n = C.current, o = a(n);
|
|
85
|
+
if (o !== n) {
|
|
86
|
+
if (C.current = o, _(o), !l)
|
|
84
87
|
try {
|
|
85
|
-
const
|
|
88
|
+
const f = {
|
|
86
89
|
...o,
|
|
87
|
-
favorites: o.favorites.map((
|
|
88
|
-
favoriteLists: (o.favoriteLists ?? []).map((
|
|
89
|
-
...
|
|
90
|
-
items:
|
|
91
|
-
}))
|
|
90
|
+
favorites: o.favorites.map((g) => ({ ...g, icon: void 0 })),
|
|
91
|
+
favoriteLists: (o.favoriteLists ?? []).map((g) => ({
|
|
92
|
+
...g,
|
|
93
|
+
items: g.items.map(qe)
|
|
94
|
+
})),
|
|
95
|
+
shortcuts: (o.shortcuts ?? []).map(qe)
|
|
92
96
|
};
|
|
93
|
-
localStorage.setItem(
|
|
94
|
-
new CustomEvent(
|
|
97
|
+
localStorage.setItem(fn(e), JSON.stringify(f)), typeof window < "u" && window.dispatchEvent(
|
|
98
|
+
new CustomEvent(_i, {
|
|
95
99
|
detail: { userId: e ?? "_default" }
|
|
96
100
|
})
|
|
97
101
|
);
|
|
98
102
|
} catch {
|
|
99
103
|
}
|
|
100
|
-
if (
|
|
101
|
-
const
|
|
102
|
-
for (const
|
|
103
|
-
o[
|
|
104
|
-
|
|
104
|
+
if (s) {
|
|
105
|
+
const f = {};
|
|
106
|
+
for (const g of Object.keys(o))
|
|
107
|
+
o[g] !== n[g] && (f[g] = o[g]);
|
|
108
|
+
s(o, f);
|
|
105
109
|
}
|
|
106
110
|
}
|
|
107
111
|
},
|
|
108
|
-
[e,
|
|
112
|
+
[e, l, s]
|
|
109
113
|
);
|
|
110
|
-
|
|
111
|
-
if (typeof window > "u" ||
|
|
114
|
+
ni(() => {
|
|
115
|
+
if (typeof window > "u" || l)
|
|
112
116
|
return;
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
const
|
|
116
|
-
return
|
|
117
|
+
const a = (n) => {
|
|
118
|
+
n.detail?.userId === (e ?? "_default") && _((f) => {
|
|
119
|
+
const g = en(e, u, !1);
|
|
120
|
+
return r !== void 0 && (g.enableModeIcons = r), JSON.stringify(f) === JSON.stringify(g) ? f : g;
|
|
117
121
|
});
|
|
118
122
|
};
|
|
119
|
-
return window.addEventListener(
|
|
120
|
-
}, [e,
|
|
121
|
-
const
|
|
123
|
+
return window.addEventListener(_i, a), () => window.removeEventListener(_i, a);
|
|
124
|
+
}, [e, u, r, l]);
|
|
125
|
+
const L = B(
|
|
122
126
|
() => ({
|
|
123
|
-
setMode: (
|
|
124
|
-
setEnableModeIcons: (
|
|
125
|
-
toggleMode: (
|
|
126
|
-
if (
|
|
127
|
-
return
|
|
128
|
-
const o =
|
|
127
|
+
setMode: (a) => v((n) => ({ ...n, activeMode: a })),
|
|
128
|
+
setEnableModeIcons: (a) => v((n) => ({ ...n, enableModeIcons: a })),
|
|
129
|
+
toggleMode: (a) => v((n) => {
|
|
130
|
+
if (a === "preferences")
|
|
131
|
+
return n;
|
|
132
|
+
const o = n.enabledModes.includes(a);
|
|
129
133
|
return {
|
|
130
|
-
...
|
|
131
|
-
enabledModes: o ?
|
|
134
|
+
...n,
|
|
135
|
+
enabledModes: o ? n.enabledModes.filter((f) => f !== a) : [...n.enabledModes, a],
|
|
132
136
|
// If we're hiding the active mode, fall back to 'all'
|
|
133
|
-
activeMode: !o ||
|
|
137
|
+
activeMode: !o || n.activeMode !== a ? n.activeMode : "all"
|
|
134
138
|
};
|
|
135
139
|
}),
|
|
136
|
-
pinSource: (
|
|
140
|
+
pinSource: (a, n) => v((o) => ({
|
|
137
141
|
...o,
|
|
138
142
|
pinnedSources: {
|
|
139
143
|
...o.pinnedSources,
|
|
140
|
-
[
|
|
144
|
+
[a]: [...o.pinnedSources[a] ?? [], n]
|
|
141
145
|
}
|
|
142
146
|
})),
|
|
143
|
-
unpinSource: (
|
|
147
|
+
unpinSource: (a, n) => v((o) => ({
|
|
144
148
|
...o,
|
|
145
149
|
pinnedSources: {
|
|
146
150
|
...o.pinnedSources,
|
|
147
|
-
[
|
|
151
|
+
[a]: (o.pinnedSources[a] ?? []).filter((f) => f !== n)
|
|
148
152
|
}
|
|
149
153
|
})),
|
|
150
|
-
hideItem: (
|
|
151
|
-
...
|
|
152
|
-
hiddenItems:
|
|
154
|
+
hideItem: (a) => v((n) => ({
|
|
155
|
+
...n,
|
|
156
|
+
hiddenItems: n.hiddenItems.some((o) => o.id === a.id) ? n.hiddenItems : [...n.hiddenItems, a]
|
|
153
157
|
})),
|
|
154
|
-
restoreItem: (
|
|
155
|
-
...
|
|
156
|
-
hiddenItems:
|
|
158
|
+
restoreItem: (a) => v((n) => ({
|
|
159
|
+
...n,
|
|
160
|
+
hiddenItems: n.hiddenItems.filter((o) => o.id !== a)
|
|
157
161
|
})),
|
|
158
|
-
addFavorite: (
|
|
159
|
-
removeFavorite: (
|
|
160
|
-
toggleFavoriteInList: (
|
|
161
|
-
(o) =>
|
|
162
|
+
addFavorite: (a, n = $e) => v((o) => Ni(o, n, a, !0)),
|
|
163
|
+
removeFavorite: (a, n = $e) => v((o) => Ni(o, n, { id: a, label: a, addedAt: 0 }, !1)),
|
|
164
|
+
toggleFavoriteInList: (a, n) => v(
|
|
165
|
+
(o) => Ni(
|
|
162
166
|
o,
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
!
|
|
167
|
+
n,
|
|
168
|
+
a,
|
|
169
|
+
!wi(o, n).some((f) => f.id === a.id)
|
|
166
170
|
)
|
|
167
171
|
),
|
|
168
|
-
createFavoriteList: (
|
|
172
|
+
createFavoriteList: (a, n) => {
|
|
169
173
|
const o = `list-${Date.now().toString(36)}${Math.random().toString(36).slice(2, 6)}`;
|
|
170
|
-
return
|
|
171
|
-
(
|
|
172
|
-
...
|
|
174
|
+
return v(
|
|
175
|
+
(f) => (f.favoriteLists ?? []).some((g) => g.id === o) ? f : {
|
|
176
|
+
...f,
|
|
173
177
|
favoriteLists: [
|
|
174
|
-
...
|
|
178
|
+
...f.favoriteLists ?? [],
|
|
175
179
|
{
|
|
176
180
|
id: o,
|
|
177
|
-
label:
|
|
178
|
-
items:
|
|
181
|
+
label: a,
|
|
182
|
+
items: n ? [{ ...qe(n), addedAt: Date.now() }] : [],
|
|
179
183
|
createdAt: Date.now()
|
|
180
184
|
}
|
|
181
185
|
]
|
|
182
186
|
}
|
|
183
187
|
), o;
|
|
184
188
|
},
|
|
185
|
-
renameFavoriteList: (
|
|
189
|
+
renameFavoriteList: (a, n) => v((o) => ({
|
|
186
190
|
...o,
|
|
187
|
-
favoriteLists: (o.favoriteLists ?? []).map((
|
|
191
|
+
favoriteLists: (o.favoriteLists ?? []).map((f) => f.id === a ? { ...f, label: n } : f)
|
|
188
192
|
})),
|
|
189
|
-
removeFavoriteList: (
|
|
190
|
-
(
|
|
191
|
-
...
|
|
192
|
-
favoriteLists: (
|
|
193
|
-
activeFavoriteListId:
|
|
193
|
+
removeFavoriteList: (a) => v(
|
|
194
|
+
(n) => a === $e ? n : {
|
|
195
|
+
...n,
|
|
196
|
+
favoriteLists: (n.favoriteLists ?? []).filter((o) => o.id !== a),
|
|
197
|
+
activeFavoriteListId: n.activeFavoriteListId === a ? $e : n.activeFavoriteListId
|
|
194
198
|
}
|
|
195
199
|
),
|
|
196
|
-
setActiveFavoriteList: (
|
|
197
|
-
|
|
198
|
-
|
|
200
|
+
setActiveFavoriteList: (a) => v((n) => ({ ...n, activeFavoriteListId: a })),
|
|
201
|
+
addShortcut: (a, n) => v((o) => {
|
|
202
|
+
const f = o.shortcuts ?? [];
|
|
203
|
+
if (f.some((E) => E.id === a.id))
|
|
204
|
+
return o;
|
|
205
|
+
const g = Math.max(0, Math.min(f.length, n ?? f.length)), A = { ...qe(a), addedAt: Date.now() };
|
|
206
|
+
return { ...o, shortcuts: [...f.slice(0, g), A, ...f.slice(g)] };
|
|
207
|
+
}),
|
|
208
|
+
removeShortcut: (a) => v(
|
|
209
|
+
(n) => (n.shortcuts ?? []).some((o) => o.id === a) ? { ...n, shortcuts: (n.shortcuts ?? []).filter((o) => o.id !== a) } : n
|
|
210
|
+
),
|
|
211
|
+
moveShortcut: (a, n) => v((o) => {
|
|
212
|
+
const f = o.shortcuts ?? [], g = f.findIndex((z) => z.id === a), A = Math.max(0, Math.min(f.length - 1, n));
|
|
213
|
+
if (g < 0 || g === A)
|
|
214
|
+
return o;
|
|
215
|
+
const E = f.filter((z) => z.id !== a);
|
|
216
|
+
return E.splice(A, 0, f[g]), { ...o, shortcuts: E };
|
|
217
|
+
}),
|
|
218
|
+
setActiveGroup: (a, n) => v((o) => ({ ...o, activeGroupId: { ...o.activeGroupId, [a]: n } })),
|
|
219
|
+
setMaxDepth: (a, n) => v((o) => ({
|
|
199
220
|
...o,
|
|
200
|
-
maxDepth: { ...o.maxDepth, [
|
|
221
|
+
maxDepth: { ...o.maxDepth, [a]: Math.min(10, Math.max(1, n)) }
|
|
201
222
|
})),
|
|
202
|
-
toggleCollapse: (
|
|
203
|
-
...
|
|
204
|
-
collapsedIds:
|
|
223
|
+
toggleCollapse: (a) => v((n) => ({
|
|
224
|
+
...n,
|
|
225
|
+
collapsedIds: n.collapsedIds.includes(a) ? n.collapsedIds.filter((o) => o !== a) : [...n.collapsedIds, a]
|
|
205
226
|
})),
|
|
206
|
-
setCollapsed: (
|
|
227
|
+
setCollapsed: (a, n) => v((o) => ({
|
|
207
228
|
...o,
|
|
208
|
-
collapsedIds:
|
|
229
|
+
collapsedIds: n ? Array.from(/* @__PURE__ */ new Set([...o.collapsedIds, ...a])) : o.collapsedIds.filter((f) => !a.includes(f))
|
|
209
230
|
})),
|
|
210
|
-
setAutoExpand: (
|
|
211
|
-
setLeftClickBehavior: (
|
|
212
|
-
reorderItems: (
|
|
213
|
-
const
|
|
214
|
-
return
|
|
231
|
+
setAutoExpand: (a) => v((n) => ({ ...n, autoExpand: a })),
|
|
232
|
+
setLeftClickBehavior: (a) => v((n) => ({ ...n, leftClickBehavior: a })),
|
|
233
|
+
reorderItems: (a, n) => v((o) => {
|
|
234
|
+
const f = { ...o.itemOrder };
|
|
235
|
+
return n == null ? delete f[a] : f[a] = n, { ...o, itemOrder: f };
|
|
215
236
|
}),
|
|
216
|
-
setColorStyle: (
|
|
217
|
-
setIndent: (
|
|
218
|
-
setStickyHeaders: (
|
|
219
|
-
setPageMode: (
|
|
220
|
-
setFirstRun: (
|
|
221
|
-
const
|
|
222
|
-
return
|
|
237
|
+
setColorStyle: (a) => v((n) => ({ ...n, colorStyle: a })),
|
|
238
|
+
setIndent: (a) => v((n) => ({ ...n, indent: a })),
|
|
239
|
+
setStickyHeaders: (a) => v((n) => ({ ...n, stickyHeaders: a })),
|
|
240
|
+
setPageMode: (a) => v((n) => ({ ...n, pageMode: a })),
|
|
241
|
+
setFirstRun: (a, n) => v((o) => {
|
|
242
|
+
const f = { ...o, firstRun: a };
|
|
243
|
+
return n?.pageMode !== void 0 && (f.pageMode = n.pageMode), n?.colorStyle !== void 0 && (f.colorStyle = n.colorStyle), f;
|
|
223
244
|
}),
|
|
224
|
-
resetAll: () =>
|
|
225
|
-
...
|
|
245
|
+
resetAll: () => v(() => ({
|
|
246
|
+
...dn,
|
|
226
247
|
userId: e ?? "_default"
|
|
227
248
|
}))
|
|
228
249
|
}),
|
|
229
|
-
[
|
|
250
|
+
[v, e]
|
|
230
251
|
);
|
|
231
|
-
return [
|
|
252
|
+
return [b, L];
|
|
232
253
|
}
|
|
233
|
-
function
|
|
234
|
-
const
|
|
235
|
-
|
|
236
|
-
const
|
|
237
|
-
|
|
238
|
-
const { t:
|
|
239
|
-
...e.filter((
|
|
254
|
+
function yt({ enabledModes: e, activeMode: r, onSelect: u, collapsed: s = !1 }) {
|
|
255
|
+
const d = se(null);
|
|
256
|
+
Yi(d, { orientation: "horizontal", wrap: !0, activateOnMove: !0 });
|
|
257
|
+
const l = se(null);
|
|
258
|
+
Yi(l, { orientation: "horizontal", wrap: !0, activateOnMove: !0 });
|
|
259
|
+
const { t: b } = Ne(), _ = [
|
|
260
|
+
...e.filter((C) => C !== "preferences"),
|
|
240
261
|
"preferences"
|
|
241
|
-
],
|
|
242
|
-
if (
|
|
243
|
-
const
|
|
244
|
-
return /* @__PURE__ */
|
|
262
|
+
], k = b("sidebarNav.modeBar.label", "Navigation mode");
|
|
263
|
+
if (s) {
|
|
264
|
+
const C = Math.max(0, _.indexOf(r)), v = _[(C - 1 + _.length) % _.length], L = _[(C + 1) % _.length], a = yi[r], n = ei(b, r);
|
|
265
|
+
return /* @__PURE__ */ I(
|
|
245
266
|
"div",
|
|
246
267
|
{
|
|
247
268
|
className: "nice-sidebar-nav__mode-bar nice-sidebar-nav__mode-bar--carousel",
|
|
248
|
-
ref:
|
|
269
|
+
ref: d,
|
|
249
270
|
role: "tablist",
|
|
250
|
-
"aria-label":
|
|
271
|
+
"aria-label": k,
|
|
251
272
|
children: [
|
|
252
|
-
/* @__PURE__ */
|
|
253
|
-
|
|
273
|
+
/* @__PURE__ */ i(
|
|
274
|
+
Y,
|
|
254
275
|
{
|
|
255
|
-
content: `${
|
|
276
|
+
content: `${b("sidebarNav.modeBar.previous", "Previous mode")}: ${ei(b, v)}`,
|
|
256
277
|
position: "bottom",
|
|
257
278
|
size: "sm",
|
|
258
|
-
children: /* @__PURE__ */
|
|
279
|
+
children: /* @__PURE__ */ i(
|
|
259
280
|
"button",
|
|
260
281
|
{
|
|
261
282
|
type: "button",
|
|
262
283
|
className: "nice-sidebar-nav__mode-arrow",
|
|
263
|
-
"aria-label":
|
|
264
|
-
onClick: () =>
|
|
265
|
-
children: /* @__PURE__ */
|
|
284
|
+
"aria-label": b("sidebarNav.modeBar.previous", "Previous mode"),
|
|
285
|
+
onClick: () => u(v),
|
|
286
|
+
children: /* @__PURE__ */ i("span", { "aria-hidden": "true", children: "‹" })
|
|
266
287
|
}
|
|
267
288
|
)
|
|
268
289
|
}
|
|
269
290
|
),
|
|
270
|
-
/* @__PURE__ */
|
|
291
|
+
/* @__PURE__ */ i(Y, { content: n, position: "bottom", size: "sm", children: /* @__PURE__ */ i(
|
|
271
292
|
"button",
|
|
272
293
|
{
|
|
273
294
|
type: "button",
|
|
274
295
|
role: "tab",
|
|
275
296
|
"aria-selected": !0,
|
|
276
|
-
"aria-label":
|
|
297
|
+
"aria-label": n,
|
|
277
298
|
className: "nice-sidebar-nav__mode-pill nice-sidebar-nav__mode-pill--active nice-sidebar-nav__mode-pill--carousel",
|
|
278
|
-
onClick: () =>
|
|
279
|
-
children: /* @__PURE__ */
|
|
299
|
+
onClick: () => u(r),
|
|
300
|
+
children: /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__mode-pill-icon", "aria-hidden": "true", children: a.icon })
|
|
280
301
|
}
|
|
281
302
|
) }),
|
|
282
|
-
/* @__PURE__ */
|
|
283
|
-
|
|
303
|
+
/* @__PURE__ */ i(
|
|
304
|
+
Y,
|
|
284
305
|
{
|
|
285
|
-
content: `${
|
|
306
|
+
content: `${b("sidebarNav.modeBar.next", "Next mode")}: ${ei(b, L)}`,
|
|
286
307
|
position: "bottom",
|
|
287
308
|
size: "sm",
|
|
288
|
-
children: /* @__PURE__ */
|
|
309
|
+
children: /* @__PURE__ */ i(
|
|
289
310
|
"button",
|
|
290
311
|
{
|
|
291
312
|
type: "button",
|
|
292
313
|
className: "nice-sidebar-nav__mode-arrow",
|
|
293
|
-
"aria-label":
|
|
294
|
-
onClick: () =>
|
|
295
|
-
children: /* @__PURE__ */
|
|
314
|
+
"aria-label": b("sidebarNav.modeBar.next", "Next mode"),
|
|
315
|
+
onClick: () => u(L),
|
|
316
|
+
children: /* @__PURE__ */ i("span", { "aria-hidden": "true", children: "›" })
|
|
296
317
|
}
|
|
297
318
|
)
|
|
298
319
|
}
|
|
@@ -301,42 +322,42 @@ function hn({ enabledModes: e, activeMode: a, onSelect: b, collapsed: t = !1 })
|
|
|
301
322
|
}
|
|
302
323
|
);
|
|
303
324
|
}
|
|
304
|
-
return /* @__PURE__ */
|
|
325
|
+
return /* @__PURE__ */ i(
|
|
305
326
|
"div",
|
|
306
327
|
{
|
|
307
328
|
className: "nice-sidebar-nav__mode-bar",
|
|
308
|
-
ref:
|
|
329
|
+
ref: l,
|
|
309
330
|
role: "tablist",
|
|
310
|
-
"aria-label":
|
|
311
|
-
children:
|
|
312
|
-
const
|
|
313
|
-
return /* @__PURE__ */
|
|
331
|
+
"aria-label": k,
|
|
332
|
+
children: _.map((C) => {
|
|
333
|
+
const v = yi[C], L = ei(b, C), a = r === C;
|
|
334
|
+
return /* @__PURE__ */ i(Y, { content: L, position: "bottom", size: "sm", children: /* @__PURE__ */ I(
|
|
314
335
|
"button",
|
|
315
336
|
{
|
|
316
337
|
role: "tab",
|
|
317
|
-
"aria-selected":
|
|
318
|
-
"aria-label":
|
|
338
|
+
"aria-selected": a,
|
|
339
|
+
"aria-label": L,
|
|
319
340
|
className: [
|
|
320
341
|
"nice-sidebar-nav__mode-pill",
|
|
321
|
-
|
|
342
|
+
a ? "nice-sidebar-nav__mode-pill--active" : ""
|
|
322
343
|
].filter(Boolean).join(" "),
|
|
323
|
-
onClick: () =>
|
|
344
|
+
onClick: () => u(C),
|
|
324
345
|
children: [
|
|
325
|
-
/* @__PURE__ */
|
|
326
|
-
/* @__PURE__ */
|
|
346
|
+
/* @__PURE__ */ i("span", { className: "nice-sidebar-nav__mode-pill-icon", "aria-hidden": "true", children: v.icon }),
|
|
347
|
+
/* @__PURE__ */ i("span", { className: "nice-sidebar-nav__mode-pill-label", children: L })
|
|
327
348
|
]
|
|
328
349
|
}
|
|
329
|
-
) },
|
|
350
|
+
) }, C);
|
|
330
351
|
})
|
|
331
352
|
}
|
|
332
353
|
);
|
|
333
354
|
}
|
|
334
|
-
function
|
|
335
|
-
return /* @__PURE__ */
|
|
336
|
-
|
|
355
|
+
function Mi({ open: e, size: r = 16 }) {
|
|
356
|
+
return /* @__PURE__ */ i(
|
|
357
|
+
ne,
|
|
337
358
|
{
|
|
338
359
|
name: "chevron-down",
|
|
339
|
-
size:
|
|
360
|
+
size: r,
|
|
340
361
|
style: {
|
|
341
362
|
transition: "transform 160ms ease",
|
|
342
363
|
transform: e ? "rotate(0deg)" : "rotate(-90deg)"
|
|
@@ -344,70 +365,71 @@ function Xe({ open: e, size: a = 16 }) {
|
|
|
344
365
|
}
|
|
345
366
|
);
|
|
346
367
|
}
|
|
347
|
-
function
|
|
348
|
-
return /* @__PURE__ */
|
|
368
|
+
function mn({ size: e = 14 }) {
|
|
369
|
+
return /* @__PURE__ */ i(ne, { name: "star", size: e });
|
|
349
370
|
}
|
|
350
|
-
function
|
|
351
|
-
return /* @__PURE__ */
|
|
371
|
+
function _n({ size: e = 14 }) {
|
|
372
|
+
return /* @__PURE__ */ i(ne, { name: "star", size: e, style: { fill: "currentColor" } });
|
|
352
373
|
}
|
|
353
|
-
function
|
|
354
|
-
return /* @__PURE__ */
|
|
374
|
+
function Nn({ size: e = 14 }) {
|
|
375
|
+
return /* @__PURE__ */ i(ne, { name: "eye-off", size: e });
|
|
355
376
|
}
|
|
356
|
-
function
|
|
377
|
+
function kt({
|
|
357
378
|
size: e = 14,
|
|
358
|
-
filled:
|
|
379
|
+
filled: r = !1
|
|
359
380
|
}) {
|
|
360
|
-
return /* @__PURE__ */
|
|
381
|
+
return /* @__PURE__ */ i(ne, { name: "pin", size: e, style: r ? { fill: "currentColor" } : void 0 });
|
|
361
382
|
}
|
|
362
|
-
function
|
|
363
|
-
return /* @__PURE__ */
|
|
383
|
+
function Oi({ size: e = 12 }) {
|
|
384
|
+
return /* @__PURE__ */ i(ne, { name: "close", size: e });
|
|
364
385
|
}
|
|
365
|
-
|
|
386
|
+
const gn = /* @__PURE__ */ Re(null);
|
|
387
|
+
function Fi({
|
|
366
388
|
item: e,
|
|
367
|
-
depth:
|
|
368
|
-
maxDepth:
|
|
369
|
-
activeRoute:
|
|
370
|
-
collapsedIds:
|
|
371
|
-
hiddenIds:
|
|
372
|
-
autoExpand:
|
|
373
|
-
sidebarCollapsed:
|
|
374
|
-
expandableWhenCollapsed:
|
|
375
|
-
onNavigate:
|
|
376
|
-
onHide:
|
|
377
|
-
onToggleCollapse:
|
|
378
|
-
onAddFavorite:
|
|
379
|
-
onRemoveFavorite:
|
|
389
|
+
depth: r,
|
|
390
|
+
maxDepth: u,
|
|
391
|
+
activeRoute: s,
|
|
392
|
+
collapsedIds: d,
|
|
393
|
+
hiddenIds: l,
|
|
394
|
+
autoExpand: b,
|
|
395
|
+
sidebarCollapsed: _ = !1,
|
|
396
|
+
expandableWhenCollapsed: k = !1,
|
|
397
|
+
onNavigate: C,
|
|
398
|
+
onHide: v,
|
|
399
|
+
onToggleCollapse: L,
|
|
400
|
+
onAddFavorite: a,
|
|
401
|
+
onRemoveFavorite: n,
|
|
380
402
|
isFavorite: o,
|
|
381
|
-
leftClickBehavior:
|
|
382
|
-
routeToUrl:
|
|
383
|
-
contextMenu:
|
|
384
|
-
disabledActions:
|
|
385
|
-
colorScope:
|
|
386
|
-
shading:
|
|
387
|
-
path:
|
|
388
|
-
onRemoveFromList:
|
|
403
|
+
leftClickBehavior: f = "focus-existing",
|
|
404
|
+
routeToUrl: g,
|
|
405
|
+
contextMenu: A = !0,
|
|
406
|
+
disabledActions: E,
|
|
407
|
+
colorScope: z,
|
|
408
|
+
shading: V,
|
|
409
|
+
path: te,
|
|
410
|
+
onRemoveFromList: K
|
|
389
411
|
}) {
|
|
390
|
-
const { t:
|
|
391
|
-
const
|
|
392
|
-
|
|
393
|
-
const
|
|
394
|
-
|
|
412
|
+
const { t: y } = Ne(), q = ue(Ge), ve = ue(vn), w = ue(bn), x = ue(hn), Z = xi(), be = ue(pn), [he, G] = ye(!1), ie = se(null), $ = (e.children?.length ?? 0) > 0 && r < u, ke = d.includes(e.id), U = ue(gn)?.has(e.id) === !0 || (b ? !ke : ke), re = ee(() => {
|
|
413
|
+
const h = ie.current, P = h?.parentElement, Se = h && P && U && h.getBoundingClientRect().top - P.getBoundingClientRect().top > 1 ? h.getBoundingClientRect().top : null;
|
|
414
|
+
L(e.id), Se !== null && P && requestAnimationFrame(() => {
|
|
415
|
+
const Le = P.closest(".nice-sidebar-nav__body");
|
|
416
|
+
Le && (Le.scrollTop += P.getBoundingClientRect().top - Se);
|
|
395
417
|
});
|
|
396
|
-
}, [
|
|
397
|
-
() =>
|
|
398
|
-
[
|
|
399
|
-
),
|
|
400
|
-
() => [...
|
|
401
|
-
[
|
|
402
|
-
),
|
|
403
|
-
(
|
|
404
|
-
forceNew:
|
|
405
|
-
color:
|
|
406
|
-
branchColor:
|
|
407
|
-
path:
|
|
418
|
+
}, [U, L, e.id]), xe = !!(e.route && s && e.route === s), j = !!e.route, W = j && o(e.id), ce = j && x ? x.stateOf(e.id) : "predefined", le = ce !== "predefined", { scope: Q, vars: pe } = B(
|
|
419
|
+
() => cn(z, e, r, V),
|
|
420
|
+
[z, e, r, V]
|
|
421
|
+
), M = B(
|
|
422
|
+
() => [...te, { id: e.id, label: e.label, icon: e.icon }],
|
|
423
|
+
[te, e.id, e.label, e.icon]
|
|
424
|
+
), O = ee(
|
|
425
|
+
(h) => ({
|
|
426
|
+
forceNew: h,
|
|
427
|
+
color: ii(Q, r)?.bg,
|
|
428
|
+
branchColor: Q.branchColor,
|
|
429
|
+
path: M
|
|
408
430
|
}),
|
|
409
|
-
[
|
|
410
|
-
),
|
|
431
|
+
[Q, r, M]
|
|
432
|
+
), J = ee(
|
|
411
433
|
() => ({
|
|
412
434
|
id: e.id,
|
|
413
435
|
label: e.label,
|
|
@@ -415,511 +437,545 @@ function We({
|
|
|
415
437
|
route: e.route,
|
|
416
438
|
sourceId: e.sourceId,
|
|
417
439
|
moduleId: e.moduleId,
|
|
418
|
-
color:
|
|
440
|
+
color: Q.branchColor ?? ii(Q, r)?.bg,
|
|
419
441
|
// where it was added from, for the favourites tree
|
|
420
|
-
path:
|
|
442
|
+
path: ln(te),
|
|
421
443
|
addedAt: Date.now()
|
|
422
444
|
}),
|
|
423
|
-
[e,
|
|
424
|
-
),
|
|
425
|
-
if (
|
|
445
|
+
[e, Q, r, te]
|
|
446
|
+
), Fe = B(() => {
|
|
447
|
+
if (!A || !j || !e.route)
|
|
426
448
|
return [];
|
|
427
|
-
const
|
|
449
|
+
const h = e.route, P = [
|
|
428
450
|
{
|
|
429
451
|
id: "open",
|
|
430
|
-
label:
|
|
431
|
-
onClick: () =>
|
|
452
|
+
label: y("sidebar.menu.open", "Open"),
|
|
453
|
+
onClick: () => C?.(h, e, O(!1))
|
|
432
454
|
}
|
|
433
455
|
];
|
|
434
|
-
return
|
|
456
|
+
return ve && P.push({
|
|
435
457
|
id: "openNewTab",
|
|
436
|
-
label:
|
|
437
|
-
onClick: () =>
|
|
438
|
-
}),
|
|
458
|
+
label: y("sidebar.menu.openNewTab", "Open in new tab"),
|
|
459
|
+
onClick: () => C?.(h, e, O(!0))
|
|
460
|
+
}), g && P.push({
|
|
439
461
|
id: "openBrowserTab",
|
|
440
|
-
label:
|
|
462
|
+
label: y("sidebar.menu.openBrowserTab", "Open in new browser tab"),
|
|
441
463
|
onClick: () => {
|
|
442
|
-
typeof window < "u" && window.open(
|
|
464
|
+
typeof window < "u" && window.open(g(h), "_blank", "noopener,noreferrer");
|
|
443
465
|
}
|
|
444
|
-
}),
|
|
466
|
+
}), P.push({ id: "sep-1", divider: !0 }), K ? P.push({
|
|
445
467
|
id: "removeFromList",
|
|
446
|
-
label:
|
|
447
|
-
onClick: () =>
|
|
448
|
-
}) :
|
|
468
|
+
label: y("sidebarNav.removeFavourite", "Remove from favourites"),
|
|
469
|
+
onClick: () => K(e.id)
|
|
470
|
+
}) : W ? P.push({
|
|
449
471
|
id: "unpinFavorite",
|
|
450
|
-
label:
|
|
451
|
-
onClick: () =>
|
|
452
|
-
}) :
|
|
472
|
+
label: y("sidebar.menu.unpinFavorite", "Remove from favorites"),
|
|
473
|
+
onClick: () => n(e.id)
|
|
474
|
+
}) : P.push({
|
|
453
475
|
id: "pinFavorite",
|
|
454
|
-
label:
|
|
455
|
-
onClick: () =>
|
|
456
|
-
}),
|
|
476
|
+
label: y("sidebar.menu.pinFavorite", "Add to favorites"),
|
|
477
|
+
onClick: () => a(J())
|
|
478
|
+
}), w && P.push({
|
|
457
479
|
id: "favoriteLists",
|
|
458
|
-
label:
|
|
459
|
-
onClick: () =>
|
|
460
|
-
}),
|
|
480
|
+
label: y("sidebarNav.favLists.addTo", "Add to a list…"),
|
|
481
|
+
onClick: () => G(!0)
|
|
482
|
+
}), x && le && P.push({
|
|
483
|
+
id: ce === "user" ? "removeShortcut" : "addShortcut",
|
|
484
|
+
label: ce === "user" ? y("sidebarNav.removeShortcut", "Remove from shortcuts") : y("sidebarNav.addShortcut", "Add to shortcuts"),
|
|
485
|
+
onClick: () => x.toggle(J())
|
|
486
|
+
}), K || P.push({
|
|
461
487
|
id: "hide",
|
|
462
|
-
label:
|
|
463
|
-
disabled: !!
|
|
464
|
-
onClick: () =>
|
|
465
|
-
}),
|
|
488
|
+
label: y("sidebar.menu.hide", "Hide"),
|
|
489
|
+
disabled: !!E?.has("hide"),
|
|
490
|
+
onClick: () => v({ id: e.id, kind: e.kind, label: e.label })
|
|
491
|
+
}), g && (P.push({ id: "sep-2", divider: !0 }), P.push({
|
|
466
492
|
id: "copyLink",
|
|
467
|
-
label:
|
|
493
|
+
label: y("sidebar.menu.copyLink", "Copy link"),
|
|
468
494
|
onClick: () => {
|
|
469
|
-
typeof navigator < "u" && navigator.clipboard && navigator.clipboard.writeText(
|
|
495
|
+
typeof navigator < "u" && navigator.clipboard && navigator.clipboard.writeText(g(h));
|
|
470
496
|
}
|
|
471
|
-
})),
|
|
497
|
+
})), P;
|
|
472
498
|
}, [
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
499
|
+
A,
|
|
500
|
+
ve,
|
|
501
|
+
E,
|
|
502
|
+
j,
|
|
477
503
|
e,
|
|
478
|
-
U,
|
|
479
|
-
w,
|
|
480
|
-
g,
|
|
481
|
-
r,
|
|
482
|
-
i,
|
|
483
|
-
u,
|
|
484
|
-
Z,
|
|
485
504
|
W,
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
505
|
+
g,
|
|
506
|
+
C,
|
|
507
|
+
a,
|
|
508
|
+
n,
|
|
509
|
+
v,
|
|
510
|
+
O,
|
|
511
|
+
J,
|
|
512
|
+
w,
|
|
513
|
+
x,
|
|
514
|
+
ce,
|
|
515
|
+
le,
|
|
516
|
+
K,
|
|
517
|
+
y
|
|
489
518
|
]);
|
|
490
|
-
if (
|
|
519
|
+
if (l.has(e.id))
|
|
491
520
|
return null;
|
|
492
|
-
function
|
|
493
|
-
if (
|
|
494
|
-
|
|
521
|
+
function Pe() {
|
|
522
|
+
if ($ && !j) {
|
|
523
|
+
E?.has("collapseToggle") || re();
|
|
495
524
|
return;
|
|
496
525
|
}
|
|
497
|
-
|
|
526
|
+
j && e.route && (C?.(
|
|
498
527
|
e.route,
|
|
499
528
|
e,
|
|
500
|
-
|
|
501
|
-
),
|
|
529
|
+
O(f === "open-new")
|
|
530
|
+
), $ && !U && !E?.has("collapseToggle") && L(e.id));
|
|
502
531
|
}
|
|
503
|
-
const
|
|
504
|
-
return /* @__PURE__ */
|
|
532
|
+
const ae = ut(r), ge = ii(Q, r), Ee = q === "fill", Ue = q === "bar" && !!ge, ri = _ ? M.map((h) => h.label).join(" › ") : e.tooltip ?? e.label;
|
|
533
|
+
return /* @__PURE__ */ I(
|
|
505
534
|
"li",
|
|
506
535
|
{
|
|
507
536
|
className: [
|
|
508
537
|
"nice-sidebar-nav__node",
|
|
509
|
-
`nice-sidebar-nav__node--depth-${
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
538
|
+
`nice-sidebar-nav__node--depth-${r}`,
|
|
539
|
+
r > 4 ? "nice-sidebar-nav__node--deep" : "",
|
|
540
|
+
Ee ? ge ? "nice-sidebar-nav__node--colored" : "" : "nice-sidebar-nav__node--shaded",
|
|
541
|
+
Ue ? "nice-sidebar-nav__node--marked" : "",
|
|
542
|
+
xe ? "nice-sidebar-nav__node--active" : "",
|
|
543
|
+
$ ? "nice-sidebar-nav__node--branch" : "nice-sidebar-nav__node--leaf"
|
|
515
544
|
].filter(Boolean).join(" "),
|
|
516
|
-
"data-nice-depth":
|
|
545
|
+
"data-nice-depth": r,
|
|
517
546
|
style: {
|
|
518
|
-
...
|
|
519
|
-
"--nice-depth":
|
|
520
|
-
...
|
|
521
|
-
"--nice-row-bg": `var(--nice-sidebar-level-${
|
|
522
|
-
"--nice-row-text": `var(--nice-sidebar-level-${
|
|
523
|
-
"--nice-row-border": `var(--nice-sidebar-level-${
|
|
524
|
-
"--nice-row-hover-bg": `var(--nice-sidebar-level-${
|
|
525
|
-
"--nice-row-active-bg": `var(--nice-sidebar-level-${
|
|
547
|
+
...Ee ? pe : void 0,
|
|
548
|
+
"--nice-depth": r,
|
|
549
|
+
...Ee ? {
|
|
550
|
+
"--nice-row-bg": `var(--nice-sidebar-level-${ae}-bg, transparent)`,
|
|
551
|
+
"--nice-row-text": `var(--nice-sidebar-level-${ae}-text, inherit)`,
|
|
552
|
+
"--nice-row-border": `var(--nice-sidebar-level-${ae}-border, transparent)`,
|
|
553
|
+
"--nice-row-hover-bg": `var(--nice-sidebar-level-${ae}-hover-bg, var(--nice-hover-bg))`,
|
|
554
|
+
"--nice-row-active-bg": `var(--nice-sidebar-level-${ae}-active-bg, var(--nice-selected-bg))`,
|
|
526
555
|
// The active row's bar and label: the row's text on a coloured row, primary
|
|
527
556
|
// otherwise.
|
|
528
|
-
"--nice-row-accent": `var(--nice-sidebar-level-${
|
|
557
|
+
"--nice-row-accent": `var(--nice-sidebar-level-${ae}-text, var(--nice-color-primary, #3b82f6))`,
|
|
529
558
|
// Label and arrow: the row's readable text on a coloured row, the theme's otherwise.
|
|
530
|
-
"--nice-row-label": `var(--nice-sidebar-level-${
|
|
531
|
-
"--nice-row-muted": `var(--nice-sidebar-level-${
|
|
559
|
+
"--nice-row-label": `var(--nice-sidebar-level-${ae}-text, var(--nice-text-primary))`,
|
|
560
|
+
"--nice-row-muted": `var(--nice-sidebar-level-${ae}-text, var(--nice-text-muted))`
|
|
532
561
|
} : {
|
|
533
|
-
...
|
|
562
|
+
...lt(r, $),
|
|
534
563
|
// 'bar': the branch's colour (e.g. its database) on the left edge
|
|
535
|
-
...
|
|
564
|
+
...Ue && ge ? { "--nice-row-mark": ge.bg } : void 0
|
|
536
565
|
}
|
|
537
566
|
},
|
|
538
567
|
children: [
|
|
539
|
-
/* @__PURE__ */
|
|
540
|
-
|
|
541
|
-
|
|
568
|
+
/* @__PURE__ */ I("div", { className: "nice-sidebar-nav__node-row", ref: ie, children: [
|
|
569
|
+
$ && /* @__PURE__ */ i(
|
|
570
|
+
Y,
|
|
542
571
|
{
|
|
543
|
-
content:
|
|
572
|
+
content: U ? y("sidebarNav.collapse", "Collapse") : y("sidebarNav.expand", "Expand"),
|
|
544
573
|
position: "right",
|
|
545
574
|
size: "sm",
|
|
546
|
-
children: /* @__PURE__ */
|
|
575
|
+
children: /* @__PURE__ */ i(
|
|
547
576
|
"button",
|
|
548
577
|
{
|
|
549
578
|
className: "nice-sidebar-nav__collapse-btn",
|
|
550
|
-
"aria-label":
|
|
551
|
-
"aria-expanded":
|
|
552
|
-
disabled:
|
|
553
|
-
onClick:
|
|
554
|
-
children: /* @__PURE__ */
|
|
579
|
+
"aria-label": U ? y("sidebarNav.collapse", "Collapse") : y("sidebarNav.expand", "Expand"),
|
|
580
|
+
"aria-expanded": U,
|
|
581
|
+
disabled: E?.has("collapseToggle"),
|
|
582
|
+
onClick: re,
|
|
583
|
+
children: /* @__PURE__ */ i(Mi, { open: U, size: 20 })
|
|
555
584
|
}
|
|
556
585
|
)
|
|
557
586
|
}
|
|
558
587
|
),
|
|
559
|
-
|
|
560
|
-
/* @__PURE__ */
|
|
588
|
+
!$ && /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__collapse-spacer" }),
|
|
589
|
+
/* @__PURE__ */ i(Y, { content: ri, position: "right", size: "sm", children: /* @__PURE__ */ I(
|
|
561
590
|
"span",
|
|
562
591
|
{
|
|
563
|
-
role:
|
|
564
|
-
tabIndex:
|
|
592
|
+
role: j ? "link" : void 0,
|
|
593
|
+
tabIndex: j ? 0 : void 0,
|
|
565
594
|
className: [
|
|
566
595
|
"nice-sidebar-nav__node-content",
|
|
567
|
-
|
|
568
|
-
!
|
|
596
|
+
j ? "nice-sidebar-nav__node-content--link" : "",
|
|
597
|
+
!j && $ ? "nice-sidebar-nav__node-content--toggle" : ""
|
|
569
598
|
].filter(Boolean).join(" "),
|
|
570
|
-
onClick:
|
|
571
|
-
onKeyDown: (
|
|
599
|
+
onClick: Pe,
|
|
600
|
+
onKeyDown: (h) => (h.key === "Enter" || h.key === " ") && Pe(),
|
|
601
|
+
onPointerDown: be && Z && j ? (h) => {
|
|
602
|
+
h.pointerType !== "touch" && an(Z, h, on(J()), e.label, {
|
|
603
|
+
captureOnStart: !0
|
|
604
|
+
});
|
|
605
|
+
} : void 0,
|
|
572
606
|
children: [
|
|
573
|
-
e.icon && /* @__PURE__ */
|
|
574
|
-
/* @__PURE__ */
|
|
575
|
-
e.badge !== void 0 && /* @__PURE__ */
|
|
607
|
+
e.icon && /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__node-icon", "aria-hidden": "true", children: Oe(e.icon) }),
|
|
608
|
+
/* @__PURE__ */ i("span", { className: "nice-sidebar-nav__node-label", children: e.label }),
|
|
609
|
+
e.badge !== void 0 && /* @__PURE__ */ i(
|
|
576
610
|
"span",
|
|
577
611
|
{
|
|
578
612
|
className: "nice-sidebar-nav__node-badge",
|
|
579
|
-
"aria-label": `${e.badge} ${
|
|
613
|
+
"aria-label": `${e.badge} ${y("sidebarNav.notifications", "notifications")}`,
|
|
580
614
|
children: e.badge
|
|
581
615
|
}
|
|
582
616
|
)
|
|
583
617
|
]
|
|
584
618
|
}
|
|
585
619
|
) }),
|
|
586
|
-
/* @__PURE__ */
|
|
587
|
-
|
|
588
|
-
/* @__PURE__ */
|
|
589
|
-
|
|
620
|
+
/* @__PURE__ */ I("div", { className: "nice-sidebar-nav__node-actions", children: [
|
|
621
|
+
j && // the star opens the favourites lists (1.3.13): put the item on any of them, make one
|
|
622
|
+
/* @__PURE__ */ i(
|
|
623
|
+
Y,
|
|
590
624
|
{
|
|
591
|
-
content:
|
|
625
|
+
content: W ? y("sidebarNav.inFavorites", "In favorites") : y("sidebarNav.addFavorite", "Add to favorites"),
|
|
592
626
|
position: "top",
|
|
593
627
|
size: "sm",
|
|
594
|
-
children: /* @__PURE__ */
|
|
628
|
+
children: /* @__PURE__ */ i(
|
|
595
629
|
"button",
|
|
596
630
|
{
|
|
597
631
|
type: "button",
|
|
598
|
-
className: `nice-sidebar-nav__action-btn ${
|
|
599
|
-
"aria-label":
|
|
600
|
-
"aria-haspopup":
|
|
601
|
-
"aria-expanded":
|
|
602
|
-
onClick: (
|
|
603
|
-
|
|
632
|
+
className: `nice-sidebar-nav__action-btn ${W ? "nice-sidebar-nav__action-btn--fav-active" : "nice-sidebar-nav__action-btn--fav"}`,
|
|
633
|
+
"aria-label": W ? y("sidebarNav.inFavorites", "In favorites") : y("sidebarNav.addFavorite", "Add to favorites"),
|
|
634
|
+
"aria-haspopup": w ? "listbox" : void 0,
|
|
635
|
+
"aria-expanded": w ? he : void 0,
|
|
636
|
+
onClick: (h) => {
|
|
637
|
+
h.stopPropagation(), w ? G((P) => !P) : W || a(J());
|
|
604
638
|
},
|
|
605
|
-
children:
|
|
639
|
+
children: W ? /* @__PURE__ */ i(_n, { size: 14 }) : /* @__PURE__ */ i(mn, { size: 14 })
|
|
606
640
|
}
|
|
607
641
|
)
|
|
608
642
|
}
|
|
609
643
|
),
|
|
610
|
-
|
|
611
|
-
|
|
644
|
+
K ? j && /* @__PURE__ */ i(
|
|
645
|
+
Y,
|
|
612
646
|
{
|
|
613
|
-
content:
|
|
647
|
+
content: y("sidebarNav.removeFavourite", "Remove from favourites"),
|
|
614
648
|
position: "top",
|
|
615
649
|
size: "sm",
|
|
616
|
-
children: /* @__PURE__ */
|
|
650
|
+
children: /* @__PURE__ */ i(
|
|
617
651
|
"button",
|
|
618
652
|
{
|
|
619
653
|
type: "button",
|
|
620
654
|
className: "nice-sidebar-nav__action-btn nice-sidebar-nav__action-btn--remove",
|
|
621
|
-
"aria-label":
|
|
622
|
-
onClick: (
|
|
623
|
-
|
|
655
|
+
"aria-label": y("sidebarNav.removeFavourite", "Remove from favourites"),
|
|
656
|
+
onClick: (h) => {
|
|
657
|
+
h.stopPropagation(), K(e.id);
|
|
624
658
|
},
|
|
625
|
-
children: /* @__PURE__ */
|
|
659
|
+
children: /* @__PURE__ */ i(Oi, { size: 12 })
|
|
626
660
|
}
|
|
627
661
|
)
|
|
628
662
|
}
|
|
629
|
-
) : /* @__PURE__ */
|
|
663
|
+
) : /* @__PURE__ */ i(Y, { content: y("sidebarNav.hideItem", "Hide item"), position: "top", size: "sm", children: /* @__PURE__ */ i(
|
|
630
664
|
"button",
|
|
631
665
|
{
|
|
632
666
|
className: "nice-sidebar-nav__action-btn nice-sidebar-nav__action-btn--hide",
|
|
633
|
-
"aria-label":
|
|
634
|
-
onClick: (
|
|
635
|
-
|
|
667
|
+
"aria-label": y("sidebarNav.hideItem", "Hide item"),
|
|
668
|
+
onClick: (h) => {
|
|
669
|
+
h.stopPropagation(), v({ id: e.id, kind: e.kind, label: e.label });
|
|
636
670
|
},
|
|
637
|
-
children: /* @__PURE__ */
|
|
671
|
+
children: /* @__PURE__ */ i(Nn, { size: 14 })
|
|
638
672
|
}
|
|
639
673
|
) })
|
|
640
674
|
] })
|
|
641
675
|
] }),
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
676
|
+
Fe.length > 0 && /* @__PURE__ */ i(sn, { target: ie, items: Fe, size: "sm" }),
|
|
677
|
+
he && w && /* @__PURE__ */ i(
|
|
678
|
+
_t,
|
|
645
679
|
{
|
|
646
|
-
anchorRef:
|
|
647
|
-
onClose: () =>
|
|
680
|
+
anchorRef: ie,
|
|
681
|
+
onClose: () => G(!1),
|
|
648
682
|
multiple: !0,
|
|
649
|
-
options:
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
683
|
+
options: x && le ? [
|
|
684
|
+
...w.lists,
|
|
685
|
+
{
|
|
686
|
+
id: mi,
|
|
687
|
+
label: y("sidebarNav.shortcuts", "Shortcuts"),
|
|
688
|
+
count: x.count
|
|
689
|
+
}
|
|
690
|
+
] : w.lists,
|
|
691
|
+
selected: ce === "user" ? [...w.listsOf(e.id), mi] : w.listsOf(e.id),
|
|
692
|
+
onPick: (h) => h === mi && x ? x.toggle(J()) : w.toggle(J(), h),
|
|
693
|
+
onCreate: (h) => w.create(h, J()),
|
|
694
|
+
"aria-label": y("sidebarNav.favLists.title", "Favourites lists")
|
|
654
695
|
}
|
|
655
696
|
),
|
|
656
|
-
|
|
657
|
-
|
|
697
|
+
$ && U && /* @__PURE__ */ i("ul", { className: "nice-sidebar-nav__children", children: e.children.map((h) => /* @__PURE__ */ i(
|
|
698
|
+
Fi,
|
|
658
699
|
{
|
|
659
|
-
item:
|
|
660
|
-
depth:
|
|
661
|
-
maxDepth:
|
|
662
|
-
activeRoute:
|
|
663
|
-
collapsedIds:
|
|
664
|
-
hiddenIds:
|
|
665
|
-
autoExpand:
|
|
666
|
-
sidebarCollapsed:
|
|
667
|
-
expandableWhenCollapsed:
|
|
668
|
-
onNavigate:
|
|
669
|
-
onHide:
|
|
670
|
-
onToggleCollapse:
|
|
671
|
-
onAddFavorite:
|
|
672
|
-
onRemoveFavorite:
|
|
700
|
+
item: h,
|
|
701
|
+
depth: r + 1,
|
|
702
|
+
maxDepth: u,
|
|
703
|
+
activeRoute: s,
|
|
704
|
+
collapsedIds: d,
|
|
705
|
+
hiddenIds: l,
|
|
706
|
+
autoExpand: b,
|
|
707
|
+
sidebarCollapsed: _,
|
|
708
|
+
expandableWhenCollapsed: k,
|
|
709
|
+
onNavigate: C,
|
|
710
|
+
onHide: v,
|
|
711
|
+
onToggleCollapse: L,
|
|
712
|
+
onAddFavorite: a,
|
|
713
|
+
onRemoveFavorite: n,
|
|
673
714
|
isFavorite: o,
|
|
674
|
-
leftClickBehavior:
|
|
675
|
-
routeToUrl:
|
|
676
|
-
contextMenu:
|
|
677
|
-
disabledActions:
|
|
678
|
-
colorScope:
|
|
679
|
-
shading:
|
|
680
|
-
path:
|
|
681
|
-
onRemoveFromList:
|
|
715
|
+
leftClickBehavior: f,
|
|
716
|
+
routeToUrl: g,
|
|
717
|
+
contextMenu: A,
|
|
718
|
+
disabledActions: E,
|
|
719
|
+
colorScope: Q,
|
|
720
|
+
shading: V,
|
|
721
|
+
path: M,
|
|
722
|
+
onRemoveFromList: K
|
|
682
723
|
},
|
|
683
|
-
|
|
724
|
+
h.id
|
|
684
725
|
)) })
|
|
685
726
|
]
|
|
686
727
|
}
|
|
687
728
|
);
|
|
688
729
|
}
|
|
689
|
-
function
|
|
690
|
-
if (!
|
|
730
|
+
function nn(e, r) {
|
|
731
|
+
if (!r || r.length === 0)
|
|
691
732
|
return e;
|
|
692
|
-
const
|
|
693
|
-
return [...e].sort((
|
|
694
|
-
const
|
|
695
|
-
return
|
|
733
|
+
const u = new Map(r.map((d, l) => [d, l])), s = r.length;
|
|
734
|
+
return [...e].sort((d, l) => {
|
|
735
|
+
const b = u.has(d.id) ? u.get(d.id) : s + e.indexOf(d), _ = u.has(l.id) ? u.get(l.id) : s + e.indexOf(l);
|
|
736
|
+
return b - _;
|
|
696
737
|
});
|
|
697
738
|
}
|
|
698
|
-
function
|
|
699
|
-
return e.map((
|
|
700
|
-
id:
|
|
701
|
-
label:
|
|
702
|
-
tooltip:
|
|
703
|
-
icon:
|
|
704
|
-
route:
|
|
705
|
-
badge:
|
|
739
|
+
function Sn(e, r, u) {
|
|
740
|
+
return e.map((s) => ({
|
|
741
|
+
id: s.id,
|
|
742
|
+
label: s.label,
|
|
743
|
+
tooltip: s.tooltip,
|
|
744
|
+
icon: s.icon,
|
|
745
|
+
route: s.route,
|
|
746
|
+
badge: s.badge,
|
|
706
747
|
kind: "view",
|
|
707
|
-
sourceId:
|
|
708
|
-
moduleId:
|
|
709
|
-
color:
|
|
710
|
-
levelColors:
|
|
711
|
-
children:
|
|
748
|
+
sourceId: r,
|
|
749
|
+
moduleId: u,
|
|
750
|
+
color: s.color,
|
|
751
|
+
levelColors: s.levelColors,
|
|
752
|
+
children: s.children?.length ? Sn(s.children, r, u) : []
|
|
712
753
|
}));
|
|
713
754
|
}
|
|
714
|
-
function
|
|
755
|
+
function wn(e, r, u = e.id) {
|
|
715
756
|
return {
|
|
716
|
-
id:
|
|
757
|
+
id: u,
|
|
717
758
|
label: e.label,
|
|
718
759
|
tooltip: e.tooltip,
|
|
719
760
|
icon: e.icon,
|
|
720
761
|
kind: "module",
|
|
721
|
-
sourceId:
|
|
762
|
+
sourceId: r,
|
|
722
763
|
color: e.color,
|
|
723
764
|
levelColors: e.levelColors,
|
|
724
|
-
children:
|
|
765
|
+
children: Sn(e.views, r, e.id)
|
|
725
766
|
};
|
|
726
767
|
}
|
|
727
|
-
function
|
|
728
|
-
return e.map((
|
|
768
|
+
function It(e, r) {
|
|
769
|
+
return e.map((u) => wn(u, r));
|
|
729
770
|
}
|
|
730
|
-
function
|
|
731
|
-
return e.map((
|
|
732
|
-
id:
|
|
733
|
-
label:
|
|
734
|
-
tooltip:
|
|
735
|
-
icon:
|
|
736
|
-
kind:
|
|
737
|
-
sourceId:
|
|
738
|
-
color:
|
|
739
|
-
levelColors:
|
|
740
|
-
children:
|
|
771
|
+
function Ei(e, r, u) {
|
|
772
|
+
return e.map((s) => ({
|
|
773
|
+
id: s.id,
|
|
774
|
+
label: s.label,
|
|
775
|
+
tooltip: s.tooltip,
|
|
776
|
+
icon: s.icon,
|
|
777
|
+
kind: r,
|
|
778
|
+
sourceId: u,
|
|
779
|
+
color: s.color,
|
|
780
|
+
levelColors: s.levelColors,
|
|
781
|
+
children: s.modules.map((d) => wn(d, u, `${s.id}:${d.id}`))
|
|
741
782
|
}));
|
|
742
783
|
}
|
|
743
|
-
function
|
|
744
|
-
return
|
|
784
|
+
function xt(e, r) {
|
|
785
|
+
return Ei(e, "role", r);
|
|
745
786
|
}
|
|
746
|
-
function
|
|
747
|
-
return
|
|
787
|
+
function Lt(e, r) {
|
|
788
|
+
return Ei(e, "unit", r);
|
|
748
789
|
}
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
790
|
+
function Cn(e, r, u, s) {
|
|
791
|
+
if (r === "all")
|
|
792
|
+
return nn(It(e.modules, e.source.id), s);
|
|
793
|
+
if (u !== void 0) {
|
|
794
|
+
const d = (r === "by-role" ? e.roles : e.units).filter(
|
|
795
|
+
(l) => l.id === u
|
|
796
|
+
);
|
|
797
|
+
return Ei(d, r === "by-role" ? "role" : "unit", e.source.id).flatMap(
|
|
798
|
+
(l) => l.children ?? []
|
|
799
|
+
);
|
|
800
|
+
}
|
|
801
|
+
return nn(
|
|
802
|
+
r === "by-role" ? xt(e.roles, e.source.id) : Lt(e.units, e.source.id),
|
|
803
|
+
s
|
|
804
|
+
);
|
|
805
|
+
}
|
|
806
|
+
const gi = dt();
|
|
807
|
+
function yn(e, r, u, s) {
|
|
808
|
+
const { scope: d, vars: l } = cn(e, r, 1, u), b = ii(d, 1);
|
|
809
|
+
return s === "theme" ? { scope: d, style: gi, marked: !1 } : s === "bar" ? b ? {
|
|
810
|
+
scope: d,
|
|
754
811
|
style: {
|
|
755
|
-
...
|
|
756
|
-
"--nice-source-mark":
|
|
812
|
+
...gi,
|
|
813
|
+
"--nice-source-mark": b.bg
|
|
757
814
|
},
|
|
758
815
|
marked: !0
|
|
759
|
-
} : { scope:
|
|
760
|
-
scope:
|
|
816
|
+
} : { scope: d, style: gi, marked: !1 } : b ? {
|
|
817
|
+
scope: d,
|
|
761
818
|
style: {
|
|
762
|
-
...
|
|
763
|
-
"--nice-source-head-bg":
|
|
764
|
-
"--nice-source-head-color":
|
|
765
|
-
"--nice-source-head-bg-active":
|
|
766
|
-
"--nice-source-head-accent":
|
|
819
|
+
...l,
|
|
820
|
+
"--nice-source-head-bg": b.bg,
|
|
821
|
+
"--nice-source-head-color": b.text,
|
|
822
|
+
"--nice-source-head-bg-active": b.activeBg,
|
|
823
|
+
"--nice-source-head-accent": b.text
|
|
767
824
|
},
|
|
768
825
|
marked: !1
|
|
769
|
-
} : { scope:
|
|
826
|
+
} : { scope: d, style: l, marked: !1 };
|
|
770
827
|
}
|
|
771
|
-
function
|
|
772
|
-
for (const
|
|
773
|
-
if (
|
|
828
|
+
function ki(e, r) {
|
|
829
|
+
for (const u of e) {
|
|
830
|
+
if (u.route === r)
|
|
774
831
|
return [];
|
|
775
|
-
if (
|
|
776
|
-
const
|
|
777
|
-
if (
|
|
778
|
-
return [
|
|
832
|
+
if (u.children?.length) {
|
|
833
|
+
const s = ki(u.children, r);
|
|
834
|
+
if (s)
|
|
835
|
+
return [u.id, ...s];
|
|
779
836
|
}
|
|
780
837
|
}
|
|
781
838
|
}
|
|
782
|
-
function
|
|
839
|
+
function Mt({
|
|
783
840
|
node: e,
|
|
784
|
-
mode:
|
|
785
|
-
maxDepth:
|
|
786
|
-
isPinned:
|
|
787
|
-
prefs:
|
|
788
|
-
helpers:
|
|
789
|
-
activeRoute:
|
|
790
|
-
onNavigate:
|
|
791
|
-
sidebarCollapsed:
|
|
792
|
-
expandableWhenCollapsed:
|
|
793
|
-
routeToUrl:
|
|
794
|
-
contextMenu:
|
|
795
|
-
disabledActions:
|
|
796
|
-
showHeader:
|
|
841
|
+
mode: r,
|
|
842
|
+
maxDepth: u,
|
|
843
|
+
isPinned: s,
|
|
844
|
+
prefs: d,
|
|
845
|
+
helpers: l,
|
|
846
|
+
activeRoute: b,
|
|
847
|
+
onNavigate: _,
|
|
848
|
+
sidebarCollapsed: k = !1,
|
|
849
|
+
expandableWhenCollapsed: C = !1,
|
|
850
|
+
routeToUrl: v,
|
|
851
|
+
contextMenu: L = !0,
|
|
852
|
+
disabledActions: a,
|
|
853
|
+
showHeader: n = !0,
|
|
797
854
|
colorScope: o,
|
|
798
|
-
shading:
|
|
799
|
-
groupFilter:
|
|
800
|
-
pin:
|
|
855
|
+
shading: f,
|
|
856
|
+
groupFilter: g,
|
|
857
|
+
pin: A,
|
|
858
|
+
query: E = ""
|
|
801
859
|
}) {
|
|
802
|
-
const { t:
|
|
803
|
-
scope:
|
|
804
|
-
style:
|
|
805
|
-
marked:
|
|
806
|
-
} =
|
|
807
|
-
() =>
|
|
808
|
-
[o, e.source,
|
|
809
|
-
),
|
|
810
|
-
const
|
|
811
|
-
return
|
|
812
|
-
}, [e,
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
return
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
De(() => {
|
|
830
|
-
if (!d || K.current === d)
|
|
860
|
+
const { t: z } = Ne(), V = se(null), te = B(() => new Set(d.hiddenItems.map((M) => M.id)), [d.hiddenItems]), K = ue(Ge), {
|
|
861
|
+
scope: y,
|
|
862
|
+
style: q,
|
|
863
|
+
marked: ve
|
|
864
|
+
} = B(
|
|
865
|
+
() => yn(o, e.source, f, K),
|
|
866
|
+
[o, e.source, f, K]
|
|
867
|
+
), w = B(() => {
|
|
868
|
+
const M = [{ id: e.source.id, label: e.source.label, icon: e.source.icon }], O = g === void 0 || r === "all" ? void 0 : (r === "by-role" ? e.roles : e.units).find((J) => J.id === g);
|
|
869
|
+
return O ? [...M, { id: O.id, label: O.label, icon: O.icon }] : M;
|
|
870
|
+
}, [e, r, g]), { children: x, searchOpen: Z } = B(() => {
|
|
871
|
+
const M = Cn(
|
|
872
|
+
e,
|
|
873
|
+
r,
|
|
874
|
+
g,
|
|
875
|
+
d.itemOrder[r]
|
|
876
|
+
);
|
|
877
|
+
if (!E)
|
|
878
|
+
return { children: M, searchOpen: null };
|
|
879
|
+
const O = /* @__PURE__ */ new Set();
|
|
880
|
+
return { children: un(M, E, O), searchOpen: O };
|
|
881
|
+
}, [r, e, d.itemOrder, g, E]), be = ee(
|
|
882
|
+
(M) => Li({ favorites: d.favorites, favoriteLists: d.favoriteLists }, M).length > 0,
|
|
883
|
+
[d.favorites, d.favoriteLists]
|
|
884
|
+
), he = se(void 0);
|
|
885
|
+
ni(() => {
|
|
886
|
+
if (!b || he.current === b)
|
|
831
887
|
return;
|
|
832
|
-
const
|
|
833
|
-
if (!
|
|
888
|
+
const M = ki(x, b);
|
|
889
|
+
if (!M)
|
|
834
890
|
return;
|
|
835
|
-
|
|
836
|
-
const
|
|
837
|
-
(
|
|
891
|
+
he.current = b;
|
|
892
|
+
const O = M.filter(
|
|
893
|
+
(J) => d.autoExpand ? d.collapsedIds.includes(J) : !d.collapsedIds.includes(J)
|
|
838
894
|
);
|
|
839
|
-
|
|
840
|
-
}, [
|
|
841
|
-
const
|
|
895
|
+
O.length > 0 && l.setCollapsed(O, !d.autoExpand);
|
|
896
|
+
}, [b, x, d.autoExpand, d.collapsedIds, l]);
|
|
897
|
+
const G = B(() => L ? [
|
|
842
898
|
{
|
|
843
|
-
id:
|
|
844
|
-
label:
|
|
845
|
-
onClick: () =>
|
|
899
|
+
id: s ? "unpinSource" : "pinSource",
|
|
900
|
+
label: s ? z("sidebar.menu.unpinSource", "Unpin source") : z("sidebar.menu.pinSource", "Pin source"),
|
|
901
|
+
onClick: () => s ? l.unpinSource(r, e.source.id) : l.pinSource(r, e.source.id)
|
|
846
902
|
},
|
|
847
903
|
{
|
|
848
904
|
id: "hideSource",
|
|
849
|
-
label:
|
|
850
|
-
disabled: !!
|
|
851
|
-
onClick: () =>
|
|
905
|
+
label: z("sidebar.menu.hideSource", "Hide source"),
|
|
906
|
+
disabled: !!a?.has("hide"),
|
|
907
|
+
onClick: () => l.hideItem({
|
|
852
908
|
id: e.source.id,
|
|
853
909
|
kind: "source",
|
|
854
910
|
label: e.source.label
|
|
855
911
|
})
|
|
856
912
|
}
|
|
857
|
-
] : [], [
|
|
858
|
-
() => !!
|
|
859
|
-
[
|
|
913
|
+
] : [], [L, a, s, l, r, e.source, z]), ie = B(
|
|
914
|
+
() => !!b && ki(x, b) !== void 0,
|
|
915
|
+
[b, x]
|
|
860
916
|
);
|
|
861
|
-
if (
|
|
917
|
+
if (te.has(e.source.id))
|
|
862
918
|
return null;
|
|
863
|
-
const
|
|
864
|
-
|
|
865
|
-
},
|
|
919
|
+
const $ = d.collapsedIds.includes(e.source.id), ke = d.autoExpand ? !$ : $, Ie = x.filter((M) => (M.children?.length ?? 0) > 0).map((M) => M.id), U = Ie.length > 0, re = U && Ie.every((M) => d.collapsedIds.includes(M)), xe = U ? !re : ke, j = !n || U ? !0 : ke, W = () => {
|
|
920
|
+
a?.has("collapseToggle") || (U ? l.setCollapsed(Ie, !re) : l.toggleCollapse(e.source.id));
|
|
921
|
+
}, ce = ve ? "nice-sidebar-nav__source-section nice-sidebar-nav__source-section--marked" : "nice-sidebar-nav__source-section", le = (M) => /* @__PURE__ */ i(Y, { content: e.source.tooltip ?? e.source.label, position: "right", size: "sm", children: /* @__PURE__ */ I(
|
|
866
922
|
"div",
|
|
867
923
|
{
|
|
868
|
-
ref:
|
|
924
|
+
ref: M ? V : void 0,
|
|
869
925
|
className: "nice-sidebar-nav__source-header",
|
|
870
|
-
onClick: (
|
|
871
|
-
|
|
926
|
+
onClick: (O) => {
|
|
927
|
+
O.target.closest(".nice-sidebar-nav__source-actions") || W();
|
|
872
928
|
},
|
|
873
929
|
role: "button",
|
|
874
930
|
tabIndex: 0,
|
|
875
|
-
"aria-expanded":
|
|
876
|
-
onKeyDown: (
|
|
877
|
-
(
|
|
931
|
+
"aria-expanded": xe,
|
|
932
|
+
onKeyDown: (O) => {
|
|
933
|
+
(O.key === "Enter" || O.key === " ") && (O.preventDefault(), W());
|
|
878
934
|
},
|
|
879
935
|
children: [
|
|
880
|
-
/* @__PURE__ */
|
|
881
|
-
e.source.icon && /* @__PURE__ */
|
|
882
|
-
/* @__PURE__ */
|
|
883
|
-
/* @__PURE__ */
|
|
936
|
+
/* @__PURE__ */ i("span", { className: "nice-sidebar-nav__source-chevron", "aria-hidden": "true", children: /* @__PURE__ */ i(Mi, { open: xe, size: 16 }) }),
|
|
937
|
+
e.source.icon && /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__source-icon", "aria-hidden": "true", children: Oe(e.source.icon) }),
|
|
938
|
+
/* @__PURE__ */ i("span", { className: "nice-sidebar-nav__source-label", children: e.source.label }),
|
|
939
|
+
/* @__PURE__ */ I(
|
|
884
940
|
"div",
|
|
885
941
|
{
|
|
886
942
|
className: "nice-sidebar-nav__source-actions",
|
|
887
|
-
onClick: (
|
|
888
|
-
onKeyDown: (
|
|
889
|
-
|
|
943
|
+
onClick: (O) => O.stopPropagation(),
|
|
944
|
+
onKeyDown: (O) => {
|
|
945
|
+
O.key !== "Escape" && O.stopPropagation();
|
|
890
946
|
},
|
|
891
947
|
children: [
|
|
892
|
-
/* @__PURE__ */
|
|
893
|
-
|
|
948
|
+
/* @__PURE__ */ i(
|
|
949
|
+
Y,
|
|
894
950
|
{
|
|
895
|
-
content:
|
|
951
|
+
content: s ? z("sidebarNav.unpinSource", "Unpin source") : z("sidebarNav.pinSource", "Pin source"),
|
|
896
952
|
position: "top",
|
|
897
953
|
size: "sm",
|
|
898
|
-
children: /* @__PURE__ */
|
|
954
|
+
children: /* @__PURE__ */ i(
|
|
899
955
|
"button",
|
|
900
956
|
{
|
|
901
957
|
className: [
|
|
902
958
|
"nice-sidebar-nav__action-btn nice-sidebar-nav__action-btn--pin",
|
|
903
|
-
|
|
959
|
+
s ? "nice-sidebar-nav__action-btn--pin-active" : ""
|
|
904
960
|
].filter(Boolean).join(" "),
|
|
905
|
-
"aria-label":
|
|
906
|
-
onClick: () =>
|
|
907
|
-
children: /* @__PURE__ */
|
|
961
|
+
"aria-label": s ? z("sidebarNav.unpinSource", "Unpin source") : z("sidebarNav.pinSource", "Pin source"),
|
|
962
|
+
onClick: () => s ? l.unpinSource(r, e.source.id) : l.pinSource(r, e.source.id),
|
|
963
|
+
children: /* @__PURE__ */ i(kt, { size: 14, filled: s })
|
|
908
964
|
}
|
|
909
965
|
)
|
|
910
966
|
}
|
|
911
967
|
),
|
|
912
|
-
/* @__PURE__ */
|
|
968
|
+
/* @__PURE__ */ i(Y, { content: z("sidebarNav.hideSource", "Hide source"), position: "top", size: "sm", children: /* @__PURE__ */ i(
|
|
913
969
|
"button",
|
|
914
970
|
{
|
|
915
971
|
className: "nice-sidebar-nav__action-btn nice-sidebar-nav__action-btn--hide",
|
|
916
|
-
"aria-label":
|
|
917
|
-
onClick: () =>
|
|
972
|
+
"aria-label": z("sidebarNav.hideSource", "Hide source"),
|
|
973
|
+
onClick: () => l.hideItem({
|
|
918
974
|
id: e.source.id,
|
|
919
975
|
kind: "source",
|
|
920
976
|
label: e.source.label
|
|
921
977
|
}),
|
|
922
|
-
children: /* @__PURE__ */
|
|
978
|
+
children: /* @__PURE__ */ i(Nn, { size: 14 })
|
|
923
979
|
}
|
|
924
980
|
) })
|
|
925
981
|
]
|
|
@@ -927,874 +983,1161 @@ function Cn({
|
|
|
927
983
|
)
|
|
928
984
|
]
|
|
929
985
|
}
|
|
930
|
-
) }),
|
|
931
|
-
return /* @__PURE__ */
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
986
|
+
) }), Q = G.length > 0 ? /* @__PURE__ */ i(sn, { target: V, items: G, size: "sm" }) : null, pe = !!A?.current;
|
|
987
|
+
return /* @__PURE__ */ I("section", { className: ce, style: q, "data-source-index": A?.index, children: [
|
|
988
|
+
n && !A && /* @__PURE__ */ I(tn, { children: [
|
|
989
|
+
le(!0),
|
|
990
|
+
Q
|
|
935
991
|
] }),
|
|
936
|
-
|
|
992
|
+
n && A && A.index > 0 && /* @__PURE__ */ I(
|
|
937
993
|
"div",
|
|
938
994
|
{
|
|
939
995
|
className: "nice-sidebar-nav__source-flow",
|
|
940
|
-
inert:
|
|
941
|
-
"aria-hidden":
|
|
996
|
+
inert: pe || void 0,
|
|
997
|
+
"aria-hidden": pe || void 0,
|
|
942
998
|
children: [
|
|
943
|
-
|
|
944
|
-
!
|
|
999
|
+
le(!pe),
|
|
1000
|
+
!pe && Q
|
|
945
1001
|
]
|
|
946
1002
|
}
|
|
947
1003
|
),
|
|
948
|
-
|
|
949
|
-
/* @__PURE__ */
|
|
1004
|
+
n && pe && A?.slot && tt(
|
|
1005
|
+
/* @__PURE__ */ I(
|
|
950
1006
|
"section",
|
|
951
1007
|
{
|
|
952
1008
|
className: [
|
|
953
|
-
|
|
1009
|
+
ce,
|
|
954
1010
|
"nice-sidebar-nav__source-section--pinned",
|
|
955
|
-
|
|
1011
|
+
ie ? "nice-sidebar-nav__source-section--has-active" : ""
|
|
956
1012
|
].filter(Boolean).join(" "),
|
|
957
|
-
style:
|
|
1013
|
+
style: q,
|
|
958
1014
|
children: [
|
|
959
|
-
|
|
960
|
-
|
|
1015
|
+
le(!0),
|
|
1016
|
+
Q
|
|
961
1017
|
]
|
|
962
1018
|
}
|
|
963
1019
|
),
|
|
964
|
-
|
|
1020
|
+
A.slot
|
|
965
1021
|
),
|
|
966
|
-
|
|
967
|
-
|
|
1022
|
+
u > 1 && j && /* @__PURE__ */ i(gn.Provider, { value: Z, children: /* @__PURE__ */ i("ul", { className: "nice-sidebar-nav__tree", children: x.map((M) => /* @__PURE__ */ i(
|
|
1023
|
+
Fi,
|
|
968
1024
|
{
|
|
969
|
-
item:
|
|
1025
|
+
item: M,
|
|
970
1026
|
depth: 2,
|
|
971
|
-
maxDepth:
|
|
972
|
-
activeRoute:
|
|
973
|
-
collapsedIds:
|
|
974
|
-
hiddenIds:
|
|
975
|
-
autoExpand:
|
|
976
|
-
sidebarCollapsed:
|
|
977
|
-
expandableWhenCollapsed:
|
|
978
|
-
onNavigate:
|
|
979
|
-
onHide:
|
|
980
|
-
onToggleCollapse:
|
|
981
|
-
onAddFavorite:
|
|
982
|
-
onRemoveFavorite:
|
|
983
|
-
isFavorite:
|
|
984
|
-
leftClickBehavior:
|
|
985
|
-
routeToUrl:
|
|
986
|
-
contextMenu:
|
|
987
|
-
disabledActions:
|
|
988
|
-
colorScope:
|
|
989
|
-
shading:
|
|
990
|
-
path:
|
|
1027
|
+
maxDepth: u,
|
|
1028
|
+
activeRoute: b,
|
|
1029
|
+
collapsedIds: d.collapsedIds,
|
|
1030
|
+
hiddenIds: te,
|
|
1031
|
+
autoExpand: d.autoExpand,
|
|
1032
|
+
sidebarCollapsed: k,
|
|
1033
|
+
expandableWhenCollapsed: C,
|
|
1034
|
+
onNavigate: _,
|
|
1035
|
+
onHide: l.hideItem,
|
|
1036
|
+
onToggleCollapse: l.toggleCollapse,
|
|
1037
|
+
onAddFavorite: l.addFavorite,
|
|
1038
|
+
onRemoveFavorite: l.removeFavorite,
|
|
1039
|
+
isFavorite: be,
|
|
1040
|
+
leftClickBehavior: d.leftClickBehavior,
|
|
1041
|
+
routeToUrl: v,
|
|
1042
|
+
contextMenu: L,
|
|
1043
|
+
disabledActions: a,
|
|
1044
|
+
colorScope: y,
|
|
1045
|
+
shading: f,
|
|
1046
|
+
path: w
|
|
991
1047
|
},
|
|
992
|
-
|
|
993
|
-
)) })
|
|
1048
|
+
M.id
|
|
1049
|
+
)) }) })
|
|
994
1050
|
] });
|
|
995
1051
|
}
|
|
996
|
-
function
|
|
1052
|
+
function Ot({
|
|
997
1053
|
favorites: e,
|
|
998
|
-
activeRoute:
|
|
999
|
-
onNavigate:
|
|
1000
|
-
onRemove:
|
|
1001
|
-
collapsed:
|
|
1002
|
-
leftClickBehavior:
|
|
1054
|
+
activeRoute: r,
|
|
1055
|
+
onNavigate: u,
|
|
1056
|
+
onRemove: s,
|
|
1057
|
+
collapsed: d = !1,
|
|
1058
|
+
leftClickBehavior: l = "focus-existing"
|
|
1003
1059
|
}) {
|
|
1004
|
-
const { t:
|
|
1005
|
-
return e.length === 0 ? /* @__PURE__ */
|
|
1060
|
+
const { t: b } = Ne(), _ = ue(Ge), k = _ === "fill", C = l === "open-new";
|
|
1061
|
+
return e.length === 0 ? /* @__PURE__ */ i("p", { className: "nice-sidebar-nav__empty", children: b(
|
|
1006
1062
|
"sidebarNav.noFavourites",
|
|
1007
1063
|
"No favourites yet. Hover an item and click the star to add it."
|
|
1008
|
-
) }) : /* @__PURE__ */
|
|
1009
|
-
const
|
|
1010
|
-
forceNew:
|
|
1011
|
-
color:
|
|
1012
|
-
branchColor:
|
|
1013
|
-
},
|
|
1014
|
-
return /* @__PURE__ */
|
|
1064
|
+
) }) : /* @__PURE__ */ i("ul", { className: "nice-sidebar-nav__favorites-list", children: e.map((v) => {
|
|
1065
|
+
const L = !!(v.route && v.route === r), a = {
|
|
1066
|
+
forceNew: C,
|
|
1067
|
+
color: v.color,
|
|
1068
|
+
branchColor: v.color
|
|
1069
|
+
}, n = v.color && _ !== "theme" ? ct(v.color) : void 0;
|
|
1070
|
+
return /* @__PURE__ */ I(
|
|
1015
1071
|
"li",
|
|
1016
1072
|
{
|
|
1017
1073
|
className: [
|
|
1018
1074
|
"nice-sidebar-nav__fav-item",
|
|
1019
|
-
|
|
1020
|
-
|
|
1075
|
+
L ? "nice-sidebar-nav__fav-item--active" : "",
|
|
1076
|
+
n ? k ? "nice-sidebar-nav__fav-item--colored" : "nice-sidebar-nav__fav-item--marked" : ""
|
|
1021
1077
|
].filter(Boolean).join(" "),
|
|
1022
|
-
style:
|
|
1023
|
-
"--nice-fav-bg":
|
|
1024
|
-
"--nice-fav-text":
|
|
1025
|
-
"--nice-fav-hover-bg":
|
|
1026
|
-
} : { "--nice-fav-mark":
|
|
1078
|
+
style: n ? k ? {
|
|
1079
|
+
"--nice-fav-bg": n.bg,
|
|
1080
|
+
"--nice-fav-text": n.text,
|
|
1081
|
+
"--nice-fav-hover-bg": n.hoverBg
|
|
1082
|
+
} : { "--nice-fav-mark": n.bg } : void 0,
|
|
1027
1083
|
children: [
|
|
1028
|
-
/* @__PURE__ */
|
|
1084
|
+
/* @__PURE__ */ i(Y, { content: v.tooltip ?? v.label, position: "right", size: "sm", children: /* @__PURE__ */ I(
|
|
1029
1085
|
"span",
|
|
1030
1086
|
{
|
|
1031
1087
|
role: "link",
|
|
1032
1088
|
tabIndex: 0,
|
|
1033
1089
|
className: "nice-sidebar-nav__fav-content",
|
|
1034
1090
|
onClick: () => {
|
|
1035
|
-
|
|
1091
|
+
v.route && u?.(v.route, v, a);
|
|
1036
1092
|
},
|
|
1037
1093
|
onKeyDown: (o) => {
|
|
1038
|
-
(o.key === "Enter" || o.key === " ") &&
|
|
1094
|
+
(o.key === "Enter" || o.key === " ") && v.route && u?.(v.route, v, a);
|
|
1039
1095
|
},
|
|
1040
1096
|
children: [
|
|
1041
|
-
(typeof
|
|
1042
|
-
/* @__PURE__ */
|
|
1097
|
+
(typeof v.icon == "string" || Ii(v.icon)) && /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__fav-icon", "aria-hidden": "true", children: Oe(v.icon) }),
|
|
1098
|
+
/* @__PURE__ */ i("span", { className: "nice-sidebar-nav__fav-label", children: v.label })
|
|
1043
1099
|
]
|
|
1044
1100
|
}
|
|
1045
1101
|
) }),
|
|
1046
|
-
!
|
|
1047
|
-
|
|
1102
|
+
!d && /* @__PURE__ */ i(
|
|
1103
|
+
Y,
|
|
1048
1104
|
{
|
|
1049
|
-
content:
|
|
1105
|
+
content: b("sidebarNav.removeFavourite", "Remove from favourites"),
|
|
1050
1106
|
position: "top",
|
|
1051
1107
|
size: "sm",
|
|
1052
|
-
children: /* @__PURE__ */
|
|
1108
|
+
children: /* @__PURE__ */ i(
|
|
1053
1109
|
"button",
|
|
1054
1110
|
{
|
|
1055
1111
|
className: "nice-sidebar-nav__action-btn nice-sidebar-nav__action-btn--remove",
|
|
1056
|
-
"aria-label":
|
|
1057
|
-
onClick: () =>
|
|
1058
|
-
children: /* @__PURE__ */
|
|
1112
|
+
"aria-label": b("sidebarNav.removeFavourite", "Remove from favourites"),
|
|
1113
|
+
onClick: () => s(v.id),
|
|
1114
|
+
children: /* @__PURE__ */ i(Oi, { size: 12 })
|
|
1059
1115
|
}
|
|
1060
1116
|
)
|
|
1061
1117
|
}
|
|
1062
1118
|
)
|
|
1063
1119
|
]
|
|
1064
1120
|
},
|
|
1065
|
-
|
|
1121
|
+
v.id
|
|
1066
1122
|
);
|
|
1067
1123
|
}) });
|
|
1068
1124
|
}
|
|
1069
|
-
const
|
|
1070
|
-
function
|
|
1071
|
-
const
|
|
1125
|
+
const Si = "fav:", Ft = /* @__PURE__ */ new Set();
|
|
1126
|
+
function kn(e) {
|
|
1127
|
+
const r = e.favorite;
|
|
1072
1128
|
return {
|
|
1073
1129
|
id: e.id,
|
|
1074
1130
|
label: e.label,
|
|
1075
1131
|
icon: e.icon,
|
|
1076
|
-
tooltip:
|
|
1077
|
-
route:
|
|
1078
|
-
kind:
|
|
1079
|
-
sourceId:
|
|
1080
|
-
moduleId:
|
|
1081
|
-
children: e.children.map(
|
|
1132
|
+
tooltip: r?.tooltip,
|
|
1133
|
+
route: r?.route,
|
|
1134
|
+
kind: r ? "view" : "module",
|
|
1135
|
+
sourceId: r?.sourceId,
|
|
1136
|
+
moduleId: r?.moduleId,
|
|
1137
|
+
children: e.children.map(kn)
|
|
1082
1138
|
};
|
|
1083
1139
|
}
|
|
1084
|
-
function
|
|
1140
|
+
function Et({
|
|
1085
1141
|
favorites: e,
|
|
1086
|
-
pathOf:
|
|
1087
|
-
sources:
|
|
1088
|
-
rank:
|
|
1089
|
-
showSources:
|
|
1090
|
-
prefs:
|
|
1091
|
-
helpers:
|
|
1092
|
-
activeRoute:
|
|
1093
|
-
onNavigate:
|
|
1094
|
-
onRemove:
|
|
1095
|
-
collapsed:
|
|
1096
|
-
routeToUrl:
|
|
1097
|
-
contextMenu:
|
|
1098
|
-
disabledActions:
|
|
1142
|
+
pathOf: r,
|
|
1143
|
+
sources: u,
|
|
1144
|
+
rank: s,
|
|
1145
|
+
showSources: d,
|
|
1146
|
+
prefs: l,
|
|
1147
|
+
helpers: b,
|
|
1148
|
+
activeRoute: _,
|
|
1149
|
+
onNavigate: k,
|
|
1150
|
+
onRemove: C,
|
|
1151
|
+
collapsed: v,
|
|
1152
|
+
routeToUrl: L,
|
|
1153
|
+
contextMenu: a,
|
|
1154
|
+
disabledActions: n,
|
|
1099
1155
|
colorScope: o,
|
|
1100
|
-
shading:
|
|
1156
|
+
shading: f
|
|
1101
1157
|
}) {
|
|
1102
|
-
const { t:
|
|
1103
|
-
() =>
|
|
1104
|
-
[e,
|
|
1105
|
-
),
|
|
1106
|
-
() =>
|
|
1107
|
-
[
|
|
1108
|
-
),
|
|
1109
|
-
(
|
|
1110
|
-
[
|
|
1111
|
-
),
|
|
1112
|
-
(
|
|
1113
|
-
[
|
|
1158
|
+
const { t: g } = Ne(), A = ue(Ge), E = B(
|
|
1159
|
+
() => ht(e, r, (w) => s.get(w)),
|
|
1160
|
+
[e, r, s]
|
|
1161
|
+
), z = B(
|
|
1162
|
+
() => l.collapsedIds.filter((w) => w.startsWith(Si)).map((w) => w.slice(Si.length)),
|
|
1163
|
+
[l.collapsedIds]
|
|
1164
|
+
), V = ee(
|
|
1165
|
+
(w) => b.toggleCollapse(Si + w),
|
|
1166
|
+
[b]
|
|
1167
|
+
), te = ee(
|
|
1168
|
+
(w) => Li({ favorites: l.favorites, favoriteLists: l.favoriteLists }, w).length > 0,
|
|
1169
|
+
[l.favorites, l.favoriteLists]
|
|
1114
1170
|
);
|
|
1115
1171
|
if (e.length === 0)
|
|
1116
|
-
return /* @__PURE__ */
|
|
1172
|
+
return /* @__PURE__ */ i("p", { className: "nice-sidebar-nav__empty", children: g(
|
|
1117
1173
|
"sidebarNav.noFavourites",
|
|
1118
1174
|
"No favourites yet. Hover an item and click the star to add it."
|
|
1119
1175
|
) });
|
|
1120
|
-
const
|
|
1121
|
-
|
|
1176
|
+
const K = (w, x, Z, be) => /* @__PURE__ */ i(
|
|
1177
|
+
Fi,
|
|
1122
1178
|
{
|
|
1123
|
-
item:
|
|
1179
|
+
item: kn(w),
|
|
1124
1180
|
depth: 2,
|
|
1125
1181
|
maxDepth: Number.POSITIVE_INFINITY,
|
|
1126
|
-
activeRoute:
|
|
1127
|
-
collapsedIds:
|
|
1128
|
-
hiddenIds:
|
|
1182
|
+
activeRoute: _,
|
|
1183
|
+
collapsedIds: z,
|
|
1184
|
+
hiddenIds: Ft,
|
|
1129
1185
|
autoExpand: !0,
|
|
1130
|
-
sidebarCollapsed:
|
|
1131
|
-
onNavigate:
|
|
1132
|
-
onHide:
|
|
1133
|
-
onToggleCollapse:
|
|
1134
|
-
onAddFavorite:
|
|
1135
|
-
onRemoveFavorite:
|
|
1136
|
-
isFavorite:
|
|
1137
|
-
leftClickBehavior:
|
|
1138
|
-
routeToUrl:
|
|
1139
|
-
contextMenu:
|
|
1140
|
-
disabledActions:
|
|
1141
|
-
colorScope:
|
|
1142
|
-
shading:
|
|
1143
|
-
path:
|
|
1144
|
-
onRemoveFromList:
|
|
1186
|
+
sidebarCollapsed: v,
|
|
1187
|
+
onNavigate: k,
|
|
1188
|
+
onHide: b.hideItem,
|
|
1189
|
+
onToggleCollapse: V,
|
|
1190
|
+
onAddFavorite: b.addFavorite,
|
|
1191
|
+
onRemoveFavorite: b.removeFavorite,
|
|
1192
|
+
isFavorite: te,
|
|
1193
|
+
leftClickBehavior: l.leftClickBehavior,
|
|
1194
|
+
routeToUrl: L,
|
|
1195
|
+
contextMenu: a,
|
|
1196
|
+
disabledActions: n,
|
|
1197
|
+
colorScope: x,
|
|
1198
|
+
shading: f,
|
|
1199
|
+
path: Z,
|
|
1200
|
+
onRemoveFromList: C
|
|
1145
1201
|
},
|
|
1146
|
-
|
|
1147
|
-
),
|
|
1148
|
-
let
|
|
1149
|
-
const
|
|
1150
|
-
|
|
1151
|
-
/* @__PURE__ */
|
|
1152
|
-
),
|
|
1202
|
+
be
|
|
1203
|
+
), y = [];
|
|
1204
|
+
let q = [];
|
|
1205
|
+
const ve = () => {
|
|
1206
|
+
q.length > 0 && (y.push(
|
|
1207
|
+
/* @__PURE__ */ i("ul", { className: "nice-sidebar-nav__tree", children: q }, `rows-${y.length}`)
|
|
1208
|
+
), q = []);
|
|
1153
1209
|
};
|
|
1154
|
-
for (const
|
|
1155
|
-
const
|
|
1156
|
-
if (!
|
|
1157
|
-
|
|
1210
|
+
for (const w of E) {
|
|
1211
|
+
const x = u.get(w.id);
|
|
1212
|
+
if (!x) {
|
|
1213
|
+
q.push(K(w, o, [], w.id));
|
|
1158
1214
|
continue;
|
|
1159
1215
|
}
|
|
1160
|
-
const { scope:
|
|
1161
|
-
if (!
|
|
1162
|
-
for (const
|
|
1163
|
-
|
|
1216
|
+
const { scope: Z, style: be, marked: he } = yn(o, x, f, A), G = [{ id: x.id, label: x.label, icon: x.icon }];
|
|
1217
|
+
if (!d) {
|
|
1218
|
+
for (const $ of w.children)
|
|
1219
|
+
q.push(K($, Z, G, `${w.id}/${$.id}`));
|
|
1164
1220
|
continue;
|
|
1165
1221
|
}
|
|
1166
|
-
|
|
1167
|
-
const
|
|
1168
|
-
|
|
1169
|
-
/* @__PURE__ */
|
|
1222
|
+
ve();
|
|
1223
|
+
const ie = !z.includes(w.id);
|
|
1224
|
+
y.push(
|
|
1225
|
+
/* @__PURE__ */ I(
|
|
1170
1226
|
"section",
|
|
1171
1227
|
{
|
|
1172
|
-
className:
|
|
1173
|
-
style:
|
|
1228
|
+
className: he ? "nice-sidebar-nav__source-section nice-sidebar-nav__source-section--marked" : "nice-sidebar-nav__source-section",
|
|
1229
|
+
style: be,
|
|
1174
1230
|
children: [
|
|
1175
|
-
/* @__PURE__ */
|
|
1231
|
+
/* @__PURE__ */ i(Y, { content: x.tooltip ?? x.label, position: "right", size: "sm", children: /* @__PURE__ */ I(
|
|
1176
1232
|
"div",
|
|
1177
1233
|
{
|
|
1178
1234
|
className: "nice-sidebar-nav__source-header",
|
|
1179
1235
|
role: "button",
|
|
1180
1236
|
tabIndex: 0,
|
|
1181
|
-
"aria-expanded":
|
|
1182
|
-
onClick: () =>
|
|
1183
|
-
onKeyDown: (
|
|
1184
|
-
(
|
|
1237
|
+
"aria-expanded": ie,
|
|
1238
|
+
onClick: () => V(w.id),
|
|
1239
|
+
onKeyDown: ($) => {
|
|
1240
|
+
($.key === "Enter" || $.key === " ") && ($.preventDefault(), V(w.id));
|
|
1185
1241
|
},
|
|
1186
1242
|
children: [
|
|
1187
|
-
/* @__PURE__ */
|
|
1188
|
-
|
|
1189
|
-
/* @__PURE__ */
|
|
1243
|
+
/* @__PURE__ */ i("span", { className: "nice-sidebar-nav__source-chevron", "aria-hidden": "true", children: /* @__PURE__ */ i(Mi, { open: ie, size: 16 }) }),
|
|
1244
|
+
x.icon && /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__source-icon", "aria-hidden": "true", children: Oe(x.icon) }),
|
|
1245
|
+
/* @__PURE__ */ i("span", { className: "nice-sidebar-nav__source-label", children: x.label })
|
|
1190
1246
|
]
|
|
1191
1247
|
}
|
|
1192
1248
|
) }),
|
|
1193
|
-
|
|
1249
|
+
ie && /* @__PURE__ */ i("ul", { className: "nice-sidebar-nav__tree", children: w.children.map(($) => K($, Z, G, $.id)) })
|
|
1194
1250
|
]
|
|
1195
1251
|
},
|
|
1196
|
-
|
|
1252
|
+
w.id
|
|
1197
1253
|
)
|
|
1198
1254
|
);
|
|
1199
1255
|
}
|
|
1200
|
-
return
|
|
1256
|
+
return ve(), /* @__PURE__ */ i(tn, { children: y });
|
|
1201
1257
|
}
|
|
1202
|
-
function
|
|
1203
|
-
const
|
|
1204
|
-
return
|
|
1258
|
+
function Dt(e, r, u) {
|
|
1259
|
+
const s = [], d = /* @__PURE__ */ new Set();
|
|
1260
|
+
return Ci(
|
|
1205
1261
|
e,
|
|
1206
|
-
(
|
|
1207
|
-
if (
|
|
1262
|
+
(l) => {
|
|
1263
|
+
if (l.kind !== "view")
|
|
1208
1264
|
return;
|
|
1209
|
-
const
|
|
1210
|
-
if (
|
|
1265
|
+
const b = l.item;
|
|
1266
|
+
if (b.children?.length && !b.route)
|
|
1211
1267
|
return;
|
|
1212
|
-
const
|
|
1213
|
-
|
|
1268
|
+
const _ = `${l.sourceId}::${b.id}`;
|
|
1269
|
+
d.has(_) || (d.add(_), s.push({ view: b, breadcrumb: l.ancestors, color: l.color, branchColor: l.branchColor }));
|
|
1214
1270
|
},
|
|
1215
|
-
{ trees: ["modules", "roles", "units"], levelColors:
|
|
1216
|
-
),
|
|
1271
|
+
{ trees: ["modules", "roles", "units"], levelColors: r, shading: u }
|
|
1272
|
+
), s;
|
|
1217
1273
|
}
|
|
1218
|
-
function
|
|
1274
|
+
function At({
|
|
1219
1275
|
data: e,
|
|
1220
|
-
activeRoute:
|
|
1221
|
-
onNavigate:
|
|
1222
|
-
hiddenIds:
|
|
1223
|
-
leftClickBehavior:
|
|
1224
|
-
levelColors:
|
|
1225
|
-
shading:
|
|
1276
|
+
activeRoute: r,
|
|
1277
|
+
onNavigate: u,
|
|
1278
|
+
hiddenIds: s,
|
|
1279
|
+
leftClickBehavior: d = "focus-existing",
|
|
1280
|
+
levelColors: l,
|
|
1281
|
+
shading: b
|
|
1226
1282
|
}) {
|
|
1227
|
-
const { t:
|
|
1228
|
-
() =>
|
|
1229
|
-
[e,
|
|
1230
|
-
),
|
|
1231
|
-
const
|
|
1232
|
-
return
|
|
1233
|
-
}, [
|
|
1234
|
-
return /* @__PURE__ */
|
|
1235
|
-
/* @__PURE__ */
|
|
1236
|
-
/* @__PURE__ */
|
|
1237
|
-
/* @__PURE__ */
|
|
1283
|
+
const { t: _ } = Ne(), [k, C] = ye(""), v = d === "open-new", L = B(
|
|
1284
|
+
() => Dt(e, l, b),
|
|
1285
|
+
[e, l, b]
|
|
1286
|
+
), a = B(() => {
|
|
1287
|
+
const n = k.trim().toLowerCase();
|
|
1288
|
+
return n ? L.filter((o) => s.has(o.view.id) || o.breadcrumb.some((f) => s.has(f.id)) ? !1 : o.view.label.toLowerCase().includes(n) ? !0 : o.breadcrumb.some((f) => f.label.toLowerCase().includes(n))) : [];
|
|
1289
|
+
}, [L, k, s]);
|
|
1290
|
+
return /* @__PURE__ */ I("div", { className: "nice-sidebar-nav__search", children: [
|
|
1291
|
+
/* @__PURE__ */ I("div", { className: "nice-sidebar-nav__search-inputWrap", children: [
|
|
1292
|
+
/* @__PURE__ */ i("span", { className: "nice-sidebar-nav__search-icon", "aria-hidden": "true", children: /* @__PURE__ */ i(ne, { name: "search", size: 14 }) }),
|
|
1293
|
+
/* @__PURE__ */ i(
|
|
1238
1294
|
"input",
|
|
1239
1295
|
{
|
|
1240
1296
|
type: "text",
|
|
1241
1297
|
className: "nice-sidebar-nav__search-input",
|
|
1242
|
-
placeholder:
|
|
1243
|
-
value:
|
|
1244
|
-
onChange: (
|
|
1298
|
+
placeholder: _("sidebarNav.search.placeholder", "Search views…"),
|
|
1299
|
+
value: k,
|
|
1300
|
+
onChange: (n) => C(n.target.value),
|
|
1245
1301
|
autoFocus: !0,
|
|
1246
|
-
"aria-label":
|
|
1302
|
+
"aria-label": _("sidebarNav.search.label", "Search views")
|
|
1247
1303
|
}
|
|
1248
1304
|
),
|
|
1249
|
-
|
|
1305
|
+
k && /* @__PURE__ */ i(
|
|
1250
1306
|
"button",
|
|
1251
1307
|
{
|
|
1252
1308
|
type: "button",
|
|
1253
1309
|
className: "nice-sidebar-nav__search-clear",
|
|
1254
|
-
"aria-label":
|
|
1255
|
-
onClick: () =>
|
|
1256
|
-
children: /* @__PURE__ */
|
|
1310
|
+
"aria-label": _("common.clear", "Clear"),
|
|
1311
|
+
onClick: () => C(""),
|
|
1312
|
+
children: /* @__PURE__ */ i(Oi, { size: 12 })
|
|
1257
1313
|
}
|
|
1258
1314
|
)
|
|
1259
1315
|
] }),
|
|
1260
|
-
!
|
|
1261
|
-
|
|
1262
|
-
|
|
1316
|
+
!k.trim() && /* @__PURE__ */ i("p", { className: "nice-sidebar-nav__empty", children: _("sidebarNav.searchHint", "Type to search every view available in the panel.") }),
|
|
1317
|
+
k.trim() && a.length === 0 && /* @__PURE__ */ I("p", { className: "nice-sidebar-nav__empty", children: [
|
|
1318
|
+
_("sidebarNav.noResults", "No results for"),
|
|
1263
1319
|
" “",
|
|
1264
|
-
|
|
1320
|
+
k,
|
|
1265
1321
|
"”."
|
|
1266
1322
|
] }),
|
|
1267
|
-
|
|
1268
|
-
const
|
|
1269
|
-
return /* @__PURE__ */
|
|
1323
|
+
a.length > 0 && /* @__PURE__ */ i("ul", { className: "nice-sidebar-nav__search-results", children: a.map((n, o) => {
|
|
1324
|
+
const f = !!(n.view.route && n.view.route === r), g = !!n.view.route;
|
|
1325
|
+
return /* @__PURE__ */ i(
|
|
1270
1326
|
"li",
|
|
1271
1327
|
{
|
|
1272
1328
|
className: [
|
|
1273
1329
|
"nice-sidebar-nav__search-result",
|
|
1274
|
-
|
|
1330
|
+
f ? "nice-sidebar-nav__search-result--active" : ""
|
|
1275
1331
|
].filter(Boolean).join(" "),
|
|
1276
|
-
children: /* @__PURE__ */
|
|
1332
|
+
children: /* @__PURE__ */ I(
|
|
1277
1333
|
"button",
|
|
1278
1334
|
{
|
|
1279
1335
|
type: "button",
|
|
1280
1336
|
className: "nice-sidebar-nav__search-result-btn",
|
|
1281
|
-
disabled: !
|
|
1337
|
+
disabled: !g,
|
|
1282
1338
|
onClick: () => {
|
|
1283
|
-
|
|
1284
|
-
forceNew:
|
|
1285
|
-
color:
|
|
1286
|
-
branchColor:
|
|
1287
|
-
path: [...
|
|
1339
|
+
g && n.view.route && u?.(n.view.route, n.view, {
|
|
1340
|
+
forceNew: v,
|
|
1341
|
+
color: n.color,
|
|
1342
|
+
branchColor: n.branchColor,
|
|
1343
|
+
path: [...n.breadcrumb, { id: n.view.id, label: n.view.label }]
|
|
1288
1344
|
});
|
|
1289
1345
|
},
|
|
1290
1346
|
children: [
|
|
1291
|
-
/* @__PURE__ */
|
|
1292
|
-
|
|
1293
|
-
/* @__PURE__ */
|
|
1294
|
-
/* @__PURE__ */
|
|
1295
|
-
] }, `${
|
|
1296
|
-
/* @__PURE__ */
|
|
1297
|
-
|
|
1298
|
-
/* @__PURE__ */
|
|
1299
|
-
|
|
1347
|
+
/* @__PURE__ */ i("span", { className: "nice-sidebar-nav__search-result-breadcrumb", children: n.breadcrumb.map((A, E) => /* @__PURE__ */ I("span", { className: "nice-sidebar-nav__search-crumb", children: [
|
|
1348
|
+
A.icon && /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__search-crumb-icon", "aria-hidden": "true", children: Oe(A.icon) }),
|
|
1349
|
+
/* @__PURE__ */ i("span", { className: "nice-sidebar-nav__search-crumb-label", children: A.label }),
|
|
1350
|
+
/* @__PURE__ */ i("span", { className: "nice-sidebar-nav__search-crumb-sep", "aria-hidden": "true", children: "›" })
|
|
1351
|
+
] }, `${A.id}-${E}`)) }),
|
|
1352
|
+
/* @__PURE__ */ I("span", { className: "nice-sidebar-nav__search-result-view", children: [
|
|
1353
|
+
n.view.icon && /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__node-icon", "aria-hidden": "true", children: Oe(n.view.icon) }),
|
|
1354
|
+
/* @__PURE__ */ i("span", { className: "nice-sidebar-nav__node-label", children: n.view.label }),
|
|
1355
|
+
n.view.badge !== void 0 && /* @__PURE__ */ i("span", { className: "nice-sidebar-nav__node-badge", children: n.view.badge })
|
|
1300
1356
|
] })
|
|
1301
1357
|
]
|
|
1302
1358
|
}
|
|
1303
1359
|
)
|
|
1304
1360
|
},
|
|
1305
|
-
`${
|
|
1361
|
+
`${n.view.id}-${o}`
|
|
1306
1362
|
);
|
|
1307
1363
|
}) })
|
|
1308
1364
|
] });
|
|
1309
1365
|
}
|
|
1310
|
-
function
|
|
1366
|
+
function Tt({
|
|
1311
1367
|
activeRoute: e,
|
|
1312
|
-
onNavigate:
|
|
1313
|
-
leftClickBehavior:
|
|
1368
|
+
onNavigate: r,
|
|
1369
|
+
leftClickBehavior: u = "focus-existing"
|
|
1314
1370
|
}) {
|
|
1315
|
-
const { t } =
|
|
1316
|
-
return /* @__PURE__ */
|
|
1317
|
-
const
|
|
1318
|
-
return /* @__PURE__ */
|
|
1371
|
+
const { t: s } = Ne(), d = u === "open-new";
|
|
1372
|
+
return /* @__PURE__ */ i("ul", { className: "nice-sidebar-nav__prefs-categories", role: "list", children: ft.map((l) => {
|
|
1373
|
+
const b = s(l.labelKey, l.labelDefault), _ = e === l.route, k = { id: l.id, label: b, icon: l.icon, route: l.route };
|
|
1374
|
+
return /* @__PURE__ */ i(
|
|
1319
1375
|
"li",
|
|
1320
1376
|
{
|
|
1321
1377
|
className: [
|
|
1322
1378
|
"nice-sidebar-nav__node nice-sidebar-nav__node--leaf",
|
|
1323
|
-
|
|
1379
|
+
_ ? "nice-sidebar-nav__node--active" : ""
|
|
1324
1380
|
].filter(Boolean).join(" "),
|
|
1325
|
-
children: /* @__PURE__ */
|
|
1326
|
-
/* @__PURE__ */
|
|
1327
|
-
/* @__PURE__ */
|
|
1381
|
+
children: /* @__PURE__ */ I("div", { className: "nice-sidebar-nav__node-row", children: [
|
|
1382
|
+
/* @__PURE__ */ i("span", { className: "nice-sidebar-nav__collapse-spacer" }),
|
|
1383
|
+
/* @__PURE__ */ i(Y, { content: b, position: "right", size: "sm", children: /* @__PURE__ */ I(
|
|
1328
1384
|
"span",
|
|
1329
1385
|
{
|
|
1330
1386
|
role: "link",
|
|
1331
1387
|
tabIndex: 0,
|
|
1332
1388
|
className: "nice-sidebar-nav__node-content nice-sidebar-nav__node-content--link",
|
|
1333
|
-
onClick: () =>
|
|
1334
|
-
onKeyDown: (
|
|
1335
|
-
(
|
|
1389
|
+
onClick: () => r?.(l.route, k, { forceNew: d }),
|
|
1390
|
+
onKeyDown: (C) => {
|
|
1391
|
+
(C.key === "Enter" || C.key === " ") && (C.preventDefault(), r?.(l.route, k, { forceNew: d }));
|
|
1336
1392
|
},
|
|
1337
1393
|
children: [
|
|
1338
|
-
/* @__PURE__ */
|
|
1339
|
-
/* @__PURE__ */
|
|
1394
|
+
/* @__PURE__ */ i("span", { className: "nice-sidebar-nav__node-icon", "aria-hidden": "true", children: l.icon }),
|
|
1395
|
+
/* @__PURE__ */ i("span", { className: "nice-sidebar-nav__node-label", children: b })
|
|
1340
1396
|
]
|
|
1341
1397
|
}
|
|
1342
1398
|
) })
|
|
1343
1399
|
] })
|
|
1344
1400
|
},
|
|
1345
|
-
|
|
1401
|
+
l.id
|
|
1346
1402
|
);
|
|
1347
1403
|
}) });
|
|
1348
1404
|
}
|
|
1349
|
-
|
|
1405
|
+
function Bt({
|
|
1406
|
+
onFavorite: e,
|
|
1407
|
+
onShortcut: r
|
|
1408
|
+
}) {
|
|
1409
|
+
const { t: u } = Ne(), s = at(), d = se(null), l = se(null), b = ti(d, e), _ = ti(l, r);
|
|
1410
|
+
if (!s || !e && !r)
|
|
1411
|
+
return null;
|
|
1412
|
+
const k = (C) => `nice-sidebar-nav__drop-zone${C ? " nice-sidebar-nav__drop-zone--over" : ""}`;
|
|
1413
|
+
return /* @__PURE__ */ I("div", { className: "nice-sidebar-nav__drop-bar", "aria-hidden": "true", "data-testid": "sidebar-drop-bar", children: [
|
|
1414
|
+
e && /* @__PURE__ */ I(
|
|
1415
|
+
"div",
|
|
1416
|
+
{
|
|
1417
|
+
ref: d,
|
|
1418
|
+
className: k(b),
|
|
1419
|
+
title: u("sidebarNav.dropFavorites", "Add to favourites"),
|
|
1420
|
+
"data-testid": "sidebar-drop-favorites",
|
|
1421
|
+
children: [
|
|
1422
|
+
/* @__PURE__ */ i(mn, { size: 16 }),
|
|
1423
|
+
/* @__PURE__ */ i("span", { className: "nice-sidebar-nav__drop-label", children: u("sidebarNav.favLists.default", "Favourites") })
|
|
1424
|
+
]
|
|
1425
|
+
}
|
|
1426
|
+
),
|
|
1427
|
+
r && /* @__PURE__ */ I(
|
|
1428
|
+
"div",
|
|
1429
|
+
{
|
|
1430
|
+
ref: l,
|
|
1431
|
+
className: k(_),
|
|
1432
|
+
title: u("sidebarNav.addShortcut", "Add to shortcuts"),
|
|
1433
|
+
"data-testid": "sidebar-drop-shortcuts",
|
|
1434
|
+
children: [
|
|
1435
|
+
/* @__PURE__ */ i(ne, { name: "pin", size: 16 }),
|
|
1436
|
+
/* @__PURE__ */ i("span", { className: "nice-sidebar-nav__drop-label", children: u("sidebarNav.shortcuts", "Shortcuts") })
|
|
1437
|
+
]
|
|
1438
|
+
}
|
|
1439
|
+
)
|
|
1440
|
+
] });
|
|
1441
|
+
}
|
|
1442
|
+
const zt = /* @__PURE__ */ rn(
|
|
1350
1443
|
function({
|
|
1351
|
-
data:
|
|
1352
|
-
userId:
|
|
1353
|
-
activeRoute:
|
|
1354
|
-
onNavigate:
|
|
1355
|
-
enableModeIcons:
|
|
1356
|
-
preferences:
|
|
1357
|
-
onPreferencesChange:
|
|
1358
|
-
width:
|
|
1359
|
-
collapsedWidth:
|
|
1360
|
-
position:
|
|
1361
|
-
minimal:
|
|
1362
|
-
showModeStrip:
|
|
1363
|
-
showSources:
|
|
1444
|
+
data: r = gt,
|
|
1445
|
+
userId: u,
|
|
1446
|
+
activeRoute: s,
|
|
1447
|
+
onNavigate: d,
|
|
1448
|
+
enableModeIcons: l,
|
|
1449
|
+
preferences: b,
|
|
1450
|
+
onPreferencesChange: _,
|
|
1451
|
+
width: k = 264,
|
|
1452
|
+
collapsedWidth: C = 56,
|
|
1453
|
+
position: v = "left",
|
|
1454
|
+
minimal: L = !1,
|
|
1455
|
+
showModeStrip: a,
|
|
1456
|
+
showSources: n,
|
|
1364
1457
|
showFavorites: o,
|
|
1365
|
-
showFooterPreferences:
|
|
1366
|
-
sticky:
|
|
1367
|
-
surfaceOpacity:
|
|
1368
|
-
embedded:
|
|
1369
|
-
header:
|
|
1370
|
-
footerExtra:
|
|
1371
|
-
collapsed:
|
|
1372
|
-
onCollapsedChange:
|
|
1373
|
-
expandableWhenCollapsed:
|
|
1374
|
-
railItems:
|
|
1375
|
-
railOpen:
|
|
1376
|
-
defaultRailOpen:
|
|
1377
|
-
onRailOpenChange:
|
|
1378
|
-
railWidth:
|
|
1379
|
-
railActiveId:
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1458
|
+
showFooterPreferences: f,
|
|
1459
|
+
sticky: g = !0,
|
|
1460
|
+
surfaceOpacity: A,
|
|
1461
|
+
embedded: E = !1,
|
|
1462
|
+
header: z,
|
|
1463
|
+
footerExtra: V,
|
|
1464
|
+
collapsed: te,
|
|
1465
|
+
onCollapsedChange: K,
|
|
1466
|
+
expandableWhenCollapsed: y = !1,
|
|
1467
|
+
railItems: q,
|
|
1468
|
+
railOpen: ve,
|
|
1469
|
+
defaultRailOpen: w,
|
|
1470
|
+
onRailOpenChange: x,
|
|
1471
|
+
railWidth: Z = 76,
|
|
1472
|
+
railActiveId: be,
|
|
1473
|
+
shortcutsRail: he = !1,
|
|
1474
|
+
predefinedShortcuts: G,
|
|
1475
|
+
allowUserShortcuts: ie = !0,
|
|
1476
|
+
collapseLevel: $,
|
|
1477
|
+
defaultCollapseLevel: ke = "expanded",
|
|
1478
|
+
onCollapseLevelChange: Ie,
|
|
1479
|
+
groupPicker: U = !0,
|
|
1480
|
+
favoritesLayout: re = "list",
|
|
1481
|
+
getFavoritePath: xe,
|
|
1482
|
+
inlineSearch: j = !1,
|
|
1483
|
+
searchText: W,
|
|
1484
|
+
defaultSearchText: ce = "",
|
|
1485
|
+
onSearchChange: le,
|
|
1486
|
+
searchPlaceholder: Q,
|
|
1487
|
+
size: pe = "md",
|
|
1488
|
+
className: M,
|
|
1489
|
+
routeToUrl: O,
|
|
1490
|
+
contextMenu: J = !0,
|
|
1491
|
+
openInNewTab: Fe = !0,
|
|
1492
|
+
disabledContextMenuActions: Pe,
|
|
1493
|
+
readonly: ae = !1,
|
|
1494
|
+
levelColors: ge,
|
|
1495
|
+
levelShading: Ee = "auto",
|
|
1496
|
+
"data-testid": Ue
|
|
1497
|
+
}, ri) {
|
|
1498
|
+
const { t: h } = Ne(), P = ue(it), Se = Ee === "auto" ? P?.theme.darkMode === "dark" ? "shade" : "tint" : Ee, Le = B(() => ot(ge, Se), [ge, Se]), Di = B(() => {
|
|
1499
|
+
const t = new Set(Pe ?? []);
|
|
1500
|
+
return ae && ["hide", "reorder", "rename", "newGroup"].forEach((c) => t.add(c)), t;
|
|
1501
|
+
}, [Pe, ae]), ai = a ?? !L, oi = n ?? !L, He = o ?? !L, In = f ?? !L, De = !E && he, [si, xn] = ye(ke), Ai = $ ?? (te === void 0 ? si : te ? si === "expanded" ? "icons" : si : "expanded"), H = E ? "expanded" : Ai === "rail" && !De ? "icons" : Ai, R = H !== "expanded", Ae = ee(
|
|
1502
|
+
(t) => {
|
|
1503
|
+
if (t === H)
|
|
1504
|
+
return;
|
|
1505
|
+
xn(t), Ie?.(t);
|
|
1506
|
+
const c = t !== "expanded";
|
|
1507
|
+
c !== R && K?.(c);
|
|
1508
|
+
},
|
|
1509
|
+
[H, R, Ie, K]
|
|
1510
|
+
), Ln = ee(
|
|
1511
|
+
() => Ae(R ? "expanded" : "icons"),
|
|
1512
|
+
[R, Ae]
|
|
1513
|
+
), Te = !E && !!q && q.length > 0, [Mn, On] = nt({
|
|
1514
|
+
value: ve,
|
|
1515
|
+
defaultValue: w,
|
|
1403
1516
|
fallbackValue: !1,
|
|
1404
1517
|
componentName: "NiceSidebarNav"
|
|
1405
|
-
}),
|
|
1406
|
-
|
|
1407
|
-
},
|
|
1408
|
-
|
|
1409
|
-
},
|
|
1410
|
-
|
|
1411
|
-
},
|
|
1412
|
-
!
|
|
1413
|
-
id:
|
|
1414
|
-
label:
|
|
1415
|
-
icon:
|
|
1416
|
-
route:
|
|
1518
|
+
}), we = Te && Mn && !R, Ti = (t) => {
|
|
1519
|
+
On(t), x?.(t);
|
|
1520
|
+
}, Fn = we || H === "expanded" || H === "icons" && De, En = () => {
|
|
1521
|
+
we ? Ti(!1) : H === "expanded" ? Ae("icons") : H === "icons" && De && Ae("rail");
|
|
1522
|
+
}, Dn = R || Te && !we, An = () => {
|
|
1523
|
+
H === "rail" ? Ae("icons") : H === "icons" ? Ae("expanded") : Te && !we && Ti(!0);
|
|
1524
|
+
}, Tn = be ?? q?.find((t) => t.route && t.route === s)?.id, Bn = (t) => {
|
|
1525
|
+
!t.onClick && t.route && d?.(t.route, {
|
|
1526
|
+
id: t.id,
|
|
1527
|
+
label: t.label,
|
|
1528
|
+
icon: t.icon,
|
|
1529
|
+
route: t.route
|
|
1417
1530
|
});
|
|
1418
|
-
}, [
|
|
1531
|
+
}, [p, T] = Ct(
|
|
1532
|
+
u,
|
|
1533
|
+
l,
|
|
1419
1534
|
b,
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
const
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1535
|
+
_
|
|
1536
|
+
), [zn, $n] = ye(ce), Je = W ?? zn, Ce = j ? Nt(Je) : "", Bi = ee(
|
|
1537
|
+
(t) => {
|
|
1538
|
+
W === void 0 && $n(t), le?.(t);
|
|
1539
|
+
},
|
|
1540
|
+
[W, le]
|
|
1541
|
+
), Be = B(() => {
|
|
1542
|
+
const t = p.activeMode;
|
|
1543
|
+
if (t === "favorites" || t === "preferences" || t === "search")
|
|
1544
|
+
return r;
|
|
1545
|
+
const c = p.pinnedSources[t];
|
|
1546
|
+
return !c || c.length === 0 ? r : r.filter((N) => c.includes(N.source.id));
|
|
1547
|
+
}, [r, p.activeMode, p.pinnedSources]), ci = p.maxDepth[p.activeMode], Rn = ci == null || ci >= 10 ? Number.POSITIVE_INFINITY : ci, zi = h("sidebarNav.favLists.default", "Favourites"), je = B(
|
|
1548
|
+
() => vt(
|
|
1549
|
+
{ favorites: p.favorites, favoriteLists: p.favoriteLists },
|
|
1550
|
+
zi
|
|
1433
1551
|
),
|
|
1434
|
-
[
|
|
1435
|
-
),
|
|
1552
|
+
[p.favorites, p.favoriteLists, zi]
|
|
1553
|
+
), fe = bt(p), $i = B(
|
|
1436
1554
|
() => ({
|
|
1437
|
-
lists:
|
|
1438
|
-
listsOf: (
|
|
1439
|
-
{ favorites:
|
|
1440
|
-
|
|
1555
|
+
lists: je.map((t) => ({ id: t.id, label: t.label, count: t.items.length })),
|
|
1556
|
+
listsOf: (t) => Li(
|
|
1557
|
+
{ favorites: p.favorites, favoriteLists: p.favoriteLists },
|
|
1558
|
+
t
|
|
1441
1559
|
),
|
|
1442
|
-
toggle:
|
|
1443
|
-
create: (
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1560
|
+
toggle: T.toggleFavoriteInList,
|
|
1561
|
+
create: (t, c) => {
|
|
1562
|
+
T.createFavoriteList(
|
|
1563
|
+
Wi(
|
|
1564
|
+
t,
|
|
1565
|
+
je.map((N) => N.label)
|
|
1448
1566
|
),
|
|
1449
|
-
|
|
1567
|
+
c
|
|
1450
1568
|
);
|
|
1451
1569
|
}
|
|
1452
1570
|
}),
|
|
1453
|
-
[
|
|
1454
|
-
),
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1571
|
+
[je, p.favorites, p.favoriteLists, T]
|
|
1572
|
+
), me = ie && p.shortcuts || St, ze = De && ie, Pn = B(() => {
|
|
1573
|
+
if (!ze)
|
|
1574
|
+
return null;
|
|
1575
|
+
const t = new Set((G ?? []).map((N) => N.id)), c = new Set(me.map((N) => N.id));
|
|
1576
|
+
return {
|
|
1577
|
+
stateOf: (N) => t.has(N) ? "predefined" : c.has(N) ? "user" : null,
|
|
1578
|
+
toggle: (N) => c.has(N.id) ? T.removeShortcut(N.id) : T.addShortcut(N),
|
|
1579
|
+
count: me.length
|
|
1580
|
+
};
|
|
1581
|
+
}, [ze, G, me, T]), li = B(() => {
|
|
1582
|
+
if (H !== "rail")
|
|
1583
|
+
return { buttons: [], entries: [] };
|
|
1584
|
+
const t = /* @__PURE__ */ new Map();
|
|
1585
|
+
Ci(
|
|
1586
|
+
r,
|
|
1587
|
+
(S) => {
|
|
1588
|
+
const X = S.item.icon ?? [...S.ancestors.slice(1)].reverse().find((de) => de.icon != null)?.icon ?? null;
|
|
1589
|
+
X != null && !t.has(S.item.id) && t.set(S.item.id, X);
|
|
1590
|
+
},
|
|
1591
|
+
{ trees: ["modules", "roles", "units"] }
|
|
1592
|
+
);
|
|
1593
|
+
const c = p.leftClickBehavior === "open-new", N = /* @__PURE__ */ new Set(), D = [], m = [], F = (S, X) => {
|
|
1594
|
+
if (N.has(S.id))
|
|
1595
|
+
return;
|
|
1596
|
+
N.add(S.id), m.push({ fav: S, own: X });
|
|
1597
|
+
const de = S.icon ?? t.get(S.id) ?? [...S.path ?? []].reverse().find((Ke) => Ke.icon != null)?.icon ?? "circle", Ve = (Ke) => {
|
|
1598
|
+
S.route && d?.(S.route, S, {
|
|
1599
|
+
forceNew: Ke,
|
|
1600
|
+
color: S.color,
|
|
1601
|
+
branchColor: S.color,
|
|
1602
|
+
path: S.path
|
|
1603
|
+
});
|
|
1604
|
+
}, We = me.findIndex((Ke) => Ke.id === S.id), fi = [];
|
|
1605
|
+
Fe && S.route && fi.push({
|
|
1606
|
+
id: "openNewTab",
|
|
1607
|
+
label: h("sidebar.menu.openNewTab", "Open in new tab"),
|
|
1608
|
+
onClick: () => Ve(!0)
|
|
1609
|
+
}), X && fi.push(
|
|
1610
|
+
{
|
|
1611
|
+
id: "moveUp",
|
|
1612
|
+
label: h("sidebarNav.moveShortcutUp", "Move up"),
|
|
1613
|
+
disabled: We <= 0,
|
|
1614
|
+
onClick: () => T.moveShortcut(S.id, We - 1)
|
|
1615
|
+
},
|
|
1616
|
+
{
|
|
1617
|
+
id: "moveDown",
|
|
1618
|
+
label: h("sidebarNav.moveShortcutDown", "Move down"),
|
|
1619
|
+
disabled: We >= me.length - 1,
|
|
1620
|
+
onClick: () => T.moveShortcut(S.id, We + 1)
|
|
1621
|
+
},
|
|
1622
|
+
{
|
|
1623
|
+
id: "removeShortcut",
|
|
1624
|
+
label: h("sidebarNav.removeShortcut", "Remove from shortcuts"),
|
|
1625
|
+
onClick: () => T.removeShortcut(S.id)
|
|
1626
|
+
}
|
|
1627
|
+
), D.push({
|
|
1628
|
+
id: S.id,
|
|
1629
|
+
label: S.label,
|
|
1630
|
+
icon: Oe(de),
|
|
1631
|
+
title: typeof S.tooltip == "string" ? S.tooltip : S.label,
|
|
1632
|
+
route: S.route,
|
|
1633
|
+
onClick: () => Ve(c),
|
|
1634
|
+
menu: fi
|
|
1635
|
+
});
|
|
1636
|
+
};
|
|
1637
|
+
return (G ?? []).forEach((S) => F(S, !1)), me.forEach((S) => F(S, !0)), { buttons: D, entries: m };
|
|
1638
|
+
}, [
|
|
1639
|
+
H,
|
|
1640
|
+
r,
|
|
1641
|
+
G,
|
|
1642
|
+
me,
|
|
1643
|
+
p.leftClickBehavior,
|
|
1644
|
+
d,
|
|
1645
|
+
Fe,
|
|
1646
|
+
T,
|
|
1647
|
+
h
|
|
1648
|
+
]), di = li.buttons, ui = xi(), Ye = ee(
|
|
1649
|
+
(t) => {
|
|
1650
|
+
if (t.id)
|
|
1651
|
+
return { ...t, addedAt: Date.now() };
|
|
1652
|
+
const c = t.route ? pt(r, t.route) : void 0;
|
|
1653
|
+
return c ? {
|
|
1654
|
+
id: c.item.id,
|
|
1655
|
+
label: c.item.label,
|
|
1656
|
+
icon: c.item.icon,
|
|
1657
|
+
route: t.route,
|
|
1658
|
+
sourceId: c.sourceId,
|
|
1659
|
+
moduleId: c.moduleId,
|
|
1660
|
+
color: c.branchColor ?? c.color,
|
|
1661
|
+
path: ln(c.ancestors),
|
|
1662
|
+
addedAt: Date.now()
|
|
1663
|
+
} : { ...t, id: `route:${t.route ?? t.label}`, addedAt: Date.now() };
|
|
1664
|
+
},
|
|
1665
|
+
[r]
|
|
1666
|
+
), Ri = ee(
|
|
1667
|
+
(t) => T.addFavorite(Ye(t), fe),
|
|
1668
|
+
[T, Ye, fe]
|
|
1669
|
+
), Pi = ee(
|
|
1670
|
+
(t, c) => {
|
|
1671
|
+
const N = Ye(t);
|
|
1672
|
+
if ((G ?? []).some((m) => m.id === N.id))
|
|
1673
|
+
return;
|
|
1674
|
+
const D = me.findIndex((m) => m.id === N.id);
|
|
1675
|
+
D < 0 ? T.addShortcut(N, c) : c !== void 0 && T.moveShortcut(N.id, D < c ? c - 1 : c);
|
|
1676
|
+
},
|
|
1677
|
+
[Ye, G, me, T]
|
|
1678
|
+
), vi = se(null), [Hi, Hn] = ye(null), ji = (t) => {
|
|
1679
|
+
const c = vi.current, N = c?.getBoundingClientRect().top ?? 0, D = c ? Array.from(c.querySelectorAll(".nice-icon-rail__item")) : [], m = li.entries.flatMap(
|
|
1680
|
+
(de, Ve) => de.own && D[Ve] ? [D[Ve].getBoundingClientRect()] : []
|
|
1681
|
+
), F = m.filter((de) => de.top + de.height / 2 < t).length, S = D[D.length - 1]?.getBoundingClientRect(), X = F < m.length ? m[F].top : m.length > 0 ? m[m.length - 1].bottom : S?.bottom ?? N;
|
|
1682
|
+
return { index: F, line: X - N };
|
|
1683
|
+
}, Vi = ti(
|
|
1684
|
+
vi,
|
|
1685
|
+
H === "rail" && ze ? (t, c) => Pi(t, ji(c.y).index) : null,
|
|
1686
|
+
(t) => Hn(t ? ji(t.y).line : null)
|
|
1687
|
+
), jn = (t) => {
|
|
1688
|
+
const c = t.target.closest(".nice-icon-rail__item");
|
|
1689
|
+
if (!ui || !c || t.pointerType === "touch")
|
|
1690
|
+
return;
|
|
1691
|
+
const N = Array.from(t.currentTarget.querySelectorAll(".nice-icon-rail__item")).indexOf(
|
|
1692
|
+
c
|
|
1693
|
+
), D = li.entries[N];
|
|
1694
|
+
D?.own && an(ui, t, on(D.fav), D.fav.label, {
|
|
1695
|
+
captureOnStart: !0
|
|
1696
|
+
});
|
|
1697
|
+
}, Me = B(() => {
|
|
1698
|
+
const t = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), N = /* @__PURE__ */ new Map(), D = /* @__PURE__ */ new Map();
|
|
1699
|
+
return re !== "tree" ? { parentsOf: t, items: c, sources: N, rank: D } : (Ci(
|
|
1700
|
+
r,
|
|
1701
|
+
(m) => {
|
|
1702
|
+
const F = { id: m.item.id, label: m.item.label, icon: m.item.icon };
|
|
1703
|
+
m.kind === "source" && N.set(m.item.id, m.item);
|
|
1704
|
+
const S = m.tree === "roles" || m.tree === "units";
|
|
1705
|
+
S && m.kind === "module" ? c.set(`${m.ancestors[1].id}:${m.item.id}`, F) : c.has(m.item.id) || c.set(m.item.id, F), m.kind === "view" && !t.has(m.item.id) && t.set(
|
|
1706
|
+
m.item.id,
|
|
1707
|
+
S ? m.ancestors.map(
|
|
1708
|
+
(X, de) => de === 2 ? { ...X, id: `${m.ancestors[1].id}:${X.id}` } : X
|
|
1709
|
+
) : m.ancestors
|
|
1467
1710
|
);
|
|
1468
1711
|
},
|
|
1469
1712
|
{ trees: ["modules", "roles", "units"] }
|
|
1470
|
-
), [...
|
|
1471
|
-
}, [
|
|
1472
|
-
(
|
|
1473
|
-
const
|
|
1474
|
-
return
|
|
1713
|
+
), [...c.keys()].forEach((m, F) => D.set(m, F)), { parentsOf: t, items: c, sources: N, rank: D });
|
|
1714
|
+
}, [r, re]), Vn = ee(
|
|
1715
|
+
(t) => (xe?.(t) ?? t.path ?? Me.parentsOf.get(t.id) ?? []).map((c) => {
|
|
1716
|
+
const N = Me.items.get(c.id);
|
|
1717
|
+
return N ? { id: c.id, label: N.label, icon: N.icon ?? c.icon } : c;
|
|
1475
1718
|
}),
|
|
1476
|
-
[
|
|
1477
|
-
),
|
|
1478
|
-
() =>
|
|
1479
|
-
{ favorites:
|
|
1480
|
-
|
|
1719
|
+
[xe, Me]
|
|
1720
|
+
), Ki = B(
|
|
1721
|
+
() => re !== "tree" ? [] : wi(
|
|
1722
|
+
{ favorites: p.favorites, favoriteLists: p.favoriteLists },
|
|
1723
|
+
fe
|
|
1481
1724
|
).map(
|
|
1482
|
-
(
|
|
1725
|
+
(t) => typeof t.icon == "string" || Ii(t.icon) ? t : { ...t, icon: Me.items.get(t.id)?.icon }
|
|
1483
1726
|
),
|
|
1484
|
-
[
|
|
1485
|
-
),
|
|
1486
|
-
if (!
|
|
1727
|
+
[re, p.favorites, p.favoriteLists, fe, Me]
|
|
1728
|
+
), oe = p.activeMode === "by-role" || p.activeMode === "by-unit" ? p.activeMode : null, Qe = B(() => {
|
|
1729
|
+
if (!oe || U === !1)
|
|
1487
1730
|
return [];
|
|
1488
|
-
const
|
|
1489
|
-
for (const
|
|
1490
|
-
for (const
|
|
1491
|
-
!
|
|
1492
|
-
const
|
|
1493
|
-
const
|
|
1494
|
-
return
|
|
1731
|
+
const t = new Set(p.hiddenItems.map((m) => m.id)), c = /* @__PURE__ */ new Map();
|
|
1732
|
+
for (const m of Be)
|
|
1733
|
+
for (const F of oe === "by-role" ? m.roles : m.units)
|
|
1734
|
+
!t.has(F.id) && !c.has(F.id) && c.set(F.id, { id: F.id, label: F.label });
|
|
1735
|
+
const N = p.itemOrder[oe] ?? [], D = (m) => {
|
|
1736
|
+
const F = N.indexOf(m);
|
|
1737
|
+
return F < 0 ? N.length : F;
|
|
1495
1738
|
};
|
|
1496
|
-
return [...
|
|
1497
|
-
}, [
|
|
1498
|
-
|
|
1499
|
-
|
|
1739
|
+
return [...c.values()].map((m, F) => ({ o: m, i: F })).sort((m, F) => D(m.o.id) - D(F.o.id) || m.i - F.i).map(({ o: m }) => m);
|
|
1740
|
+
}, [oe, U, Be, p.hiddenItems, p.itemOrder]), _e = oe && Qe.length > 1 ? Qe.find((t) => t.id === p.activeGroupId?.[oe])?.id ?? Qe[0].id : void 0, Kn = p.activeMode === "all" || p.activeMode === "by-role" || p.activeMode === "by-unit", qn = new Set(p.hiddenItems.map((t) => t.id)), bi = B(() => {
|
|
1741
|
+
const t = p.activeMode;
|
|
1742
|
+
return !Ce || t === "favorites" || t === "preferences" || t === "search" ? Be : Be.filter(
|
|
1743
|
+
(c) => un(
|
|
1744
|
+
Cn(c, t, _e, p.itemOrder[t]),
|
|
1745
|
+
Ce,
|
|
1746
|
+
/* @__PURE__ */ new Set()
|
|
1747
|
+
).length > 0
|
|
1748
|
+
);
|
|
1749
|
+
}, [Ce, Be, p.activeMode, p.itemOrder, _e]), Xe = Kn ? bi.filter(
|
|
1750
|
+
(t) => !qn.has(t.source.id) && (_e === void 0 || (p.activeMode === "by-role" ? t.roles : t.units).some(
|
|
1751
|
+
(c) => c.id === _e
|
|
1500
1752
|
))
|
|
1501
|
-
) : [],
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1753
|
+
) : [], Ze = p.stickyHeaders !== "none" && oi && Xe.length > 0, [Gn, Un] = ye(null), [qi, Jn] = ye(0), hi = se(null), Yn = ti(
|
|
1754
|
+
hi,
|
|
1755
|
+
H !== "rail" && He && p.activeMode === "favorites" ? Ri : null
|
|
1756
|
+
), Qn = Xe.map((t) => t.source.id).join("|");
|
|
1757
|
+
ni(() => {
|
|
1758
|
+
const t = hi.current;
|
|
1759
|
+
if (!Ze || !t)
|
|
1505
1760
|
return;
|
|
1506
|
-
let
|
|
1507
|
-
const
|
|
1508
|
-
|
|
1509
|
-
const
|
|
1510
|
-
let
|
|
1511
|
-
|
|
1512
|
-
const
|
|
1513
|
-
|
|
1514
|
-
}),
|
|
1515
|
-
},
|
|
1516
|
-
|
|
1761
|
+
let c = 0;
|
|
1762
|
+
const N = () => {
|
|
1763
|
+
c = 0;
|
|
1764
|
+
const m = t.getBoundingClientRect().top;
|
|
1765
|
+
let F = 0;
|
|
1766
|
+
t.querySelectorAll("[data-source-index] > .nice-sidebar-nav__source-flow").forEach((S) => {
|
|
1767
|
+
const X = S.querySelector(".nice-sidebar-nav__source-header")?.getBoundingClientRect();
|
|
1768
|
+
X && X.height > 0 && X.bottom <= m && (F = Math.max(F, Number(S.parentElement?.dataset.sourceIndex ?? 0)));
|
|
1769
|
+
}), Jn(F);
|
|
1770
|
+
}, D = () => {
|
|
1771
|
+
c || (c = requestAnimationFrame(N));
|
|
1517
1772
|
};
|
|
1518
|
-
return
|
|
1519
|
-
|
|
1773
|
+
return N(), t.addEventListener("scroll", D, { passive: !0 }), () => {
|
|
1774
|
+
t.removeEventListener("scroll", D), c && cancelAnimationFrame(c);
|
|
1520
1775
|
};
|
|
1521
|
-
}, [
|
|
1522
|
-
const
|
|
1523
|
-
function
|
|
1524
|
-
const
|
|
1525
|
-
if (
|
|
1526
|
-
return
|
|
1527
|
-
|
|
1776
|
+
}, [Ze, Qn, p.activeMode]);
|
|
1777
|
+
const Xn = qi < Xe.length ? qi : 0;
|
|
1778
|
+
function Zn() {
|
|
1779
|
+
const t = p.activeMode;
|
|
1780
|
+
if (He && t === "favorites")
|
|
1781
|
+
return re === "tree" ? /* @__PURE__ */ i(
|
|
1782
|
+
Et,
|
|
1528
1783
|
{
|
|
1529
|
-
favorites:
|
|
1530
|
-
pathOf:
|
|
1531
|
-
sources:
|
|
1532
|
-
rank:
|
|
1533
|
-
showSources:
|
|
1534
|
-
prefs:
|
|
1535
|
-
helpers:
|
|
1536
|
-
activeRoute:
|
|
1537
|
-
onNavigate:
|
|
1538
|
-
onRemove: (
|
|
1539
|
-
collapsed:
|
|
1540
|
-
routeToUrl:
|
|
1541
|
-
contextMenu:
|
|
1542
|
-
disabledActions:
|
|
1543
|
-
colorScope:
|
|
1544
|
-
shading:
|
|
1784
|
+
favorites: Ce ? Ki.filter((c) => Zi(c, Ce)) : Ki,
|
|
1785
|
+
pathOf: Vn,
|
|
1786
|
+
sources: Me.sources,
|
|
1787
|
+
rank: Me.rank,
|
|
1788
|
+
showSources: oi,
|
|
1789
|
+
prefs: p,
|
|
1790
|
+
helpers: T,
|
|
1791
|
+
activeRoute: s,
|
|
1792
|
+
onNavigate: d,
|
|
1793
|
+
onRemove: (c) => T.removeFavorite(c, fe),
|
|
1794
|
+
collapsed: R,
|
|
1795
|
+
routeToUrl: O,
|
|
1796
|
+
contextMenu: J,
|
|
1797
|
+
disabledActions: Di,
|
|
1798
|
+
colorScope: Le,
|
|
1799
|
+
shading: Se
|
|
1545
1800
|
}
|
|
1546
|
-
) : /* @__PURE__ */
|
|
1547
|
-
|
|
1801
|
+
) : /* @__PURE__ */ i(
|
|
1802
|
+
Ot,
|
|
1548
1803
|
{
|
|
1549
|
-
favorites:
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1804
|
+
favorites: wi(p, fe).filter(
|
|
1805
|
+
(c) => !Ce || Zi(c, Ce)
|
|
1806
|
+
),
|
|
1807
|
+
activeRoute: s,
|
|
1808
|
+
onNavigate: d,
|
|
1809
|
+
onRemove: (c) => T.removeFavorite(c, fe),
|
|
1810
|
+
collapsed: R,
|
|
1811
|
+
leftClickBehavior: p.leftClickBehavior
|
|
1555
1812
|
}
|
|
1556
1813
|
);
|
|
1557
|
-
if (
|
|
1558
|
-
return /* @__PURE__ */
|
|
1559
|
-
|
|
1814
|
+
if (In && t === "preferences")
|
|
1815
|
+
return /* @__PURE__ */ i(
|
|
1816
|
+
Tt,
|
|
1560
1817
|
{
|
|
1561
|
-
activeRoute:
|
|
1562
|
-
onNavigate:
|
|
1563
|
-
leftClickBehavior:
|
|
1818
|
+
activeRoute: s,
|
|
1819
|
+
onNavigate: d,
|
|
1820
|
+
leftClickBehavior: p.leftClickBehavior
|
|
1564
1821
|
}
|
|
1565
1822
|
);
|
|
1566
|
-
if (
|
|
1567
|
-
const
|
|
1568
|
-
return /* @__PURE__ */
|
|
1569
|
-
|
|
1823
|
+
if (ai && t === "search") {
|
|
1824
|
+
const c = new Set(p.hiddenItems.map((N) => N.id));
|
|
1825
|
+
return /* @__PURE__ */ i(
|
|
1826
|
+
At,
|
|
1570
1827
|
{
|
|
1571
|
-
data:
|
|
1572
|
-
activeRoute:
|
|
1573
|
-
onNavigate:
|
|
1574
|
-
hiddenIds:
|
|
1575
|
-
leftClickBehavior:
|
|
1576
|
-
levelColors:
|
|
1577
|
-
shading:
|
|
1828
|
+
data: r,
|
|
1829
|
+
activeRoute: s,
|
|
1830
|
+
onNavigate: d,
|
|
1831
|
+
hiddenIds: c,
|
|
1832
|
+
leftClickBehavior: p.leftClickBehavior,
|
|
1833
|
+
levelColors: ge,
|
|
1834
|
+
shading: Se
|
|
1578
1835
|
}
|
|
1579
1836
|
);
|
|
1580
1837
|
}
|
|
1581
|
-
return
|
|
1582
|
-
|
|
1583
|
-
|
|
1838
|
+
return Be.length === 0 ? /* @__PURE__ */ i("p", { className: "nice-sidebar-nav__empty", children: h("sidebarNav.noSources", "No data sources are visible in this mode.") }) : bi.length === 0 ? /* @__PURE__ */ i("p", { className: "nice-sidebar-nav__empty", children: h("sidebarNav.noMatches", "Nothing matches “{query}”.").replace(
|
|
1839
|
+
"{query}",
|
|
1840
|
+
Je
|
|
1841
|
+
) }) : bi.map((c) => {
|
|
1842
|
+
const N = (p.pinnedSources[t] ?? []).includes(c.source.id);
|
|
1843
|
+
if (_e !== void 0 && !(t === "by-role" ? c.roles : c.units).some((m) => m.id === _e))
|
|
1584
1844
|
return null;
|
|
1585
|
-
const
|
|
1586
|
-
return /* @__PURE__ */
|
|
1587
|
-
|
|
1845
|
+
const D = Xe.indexOf(c);
|
|
1846
|
+
return /* @__PURE__ */ i(
|
|
1847
|
+
Mt,
|
|
1588
1848
|
{
|
|
1589
|
-
node:
|
|
1590
|
-
mode:
|
|
1591
|
-
maxDepth:
|
|
1592
|
-
isPinned:
|
|
1593
|
-
prefs:
|
|
1594
|
-
helpers:
|
|
1595
|
-
activeRoute:
|
|
1596
|
-
onNavigate:
|
|
1597
|
-
sidebarCollapsed:
|
|
1598
|
-
expandableWhenCollapsed:
|
|
1599
|
-
routeToUrl:
|
|
1600
|
-
contextMenu:
|
|
1601
|
-
disabledActions:
|
|
1602
|
-
showHeader:
|
|
1603
|
-
colorScope:
|
|
1604
|
-
shading:
|
|
1605
|
-
groupFilter:
|
|
1606
|
-
|
|
1849
|
+
node: c,
|
|
1850
|
+
mode: t,
|
|
1851
|
+
maxDepth: Rn,
|
|
1852
|
+
isPinned: N,
|
|
1853
|
+
prefs: p,
|
|
1854
|
+
helpers: T,
|
|
1855
|
+
activeRoute: s,
|
|
1856
|
+
onNavigate: d,
|
|
1857
|
+
sidebarCollapsed: R,
|
|
1858
|
+
expandableWhenCollapsed: y,
|
|
1859
|
+
routeToUrl: O,
|
|
1860
|
+
contextMenu: J,
|
|
1861
|
+
disabledActions: Di,
|
|
1862
|
+
showHeader: oi,
|
|
1863
|
+
colorScope: Le,
|
|
1864
|
+
shading: Se,
|
|
1865
|
+
groupFilter: _e,
|
|
1866
|
+
query: Ce,
|
|
1867
|
+
pin: Ze && D >= 0 ? { slot: Gn, index: D, current: D === Xn } : void 0
|
|
1607
1868
|
},
|
|
1608
|
-
|
|
1869
|
+
c.source.id
|
|
1609
1870
|
);
|
|
1610
1871
|
});
|
|
1611
1872
|
}
|
|
1612
|
-
let
|
|
1613
|
-
if (
|
|
1614
|
-
const
|
|
1615
|
-
|
|
1616
|
-
|
|
1873
|
+
let pi = null;
|
|
1874
|
+
if (He && p.activeMode === "favorites") {
|
|
1875
|
+
const t = je.find((c) => c.id === fe);
|
|
1876
|
+
pi = /* @__PURE__ */ i(
|
|
1877
|
+
Xi,
|
|
1617
1878
|
{
|
|
1618
|
-
options:
|
|
1619
|
-
value:
|
|
1620
|
-
onChange:
|
|
1621
|
-
collapsed:
|
|
1622
|
-
icon: /* @__PURE__ */
|
|
1623
|
-
"aria-label":
|
|
1624
|
-
onCreate: (
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1879
|
+
options: $i.lists,
|
|
1880
|
+
value: fe,
|
|
1881
|
+
onChange: T.setActiveFavoriteList,
|
|
1882
|
+
collapsed: R,
|
|
1883
|
+
icon: /* @__PURE__ */ i(_n, { size: 16 }),
|
|
1884
|
+
"aria-label": h("sidebarNav.favLists.title", "Favourites lists"),
|
|
1885
|
+
onCreate: (c) => T.setActiveFavoriteList(
|
|
1886
|
+
T.createFavoriteList(
|
|
1887
|
+
Wi(
|
|
1888
|
+
c,
|
|
1889
|
+
je.map((N) => N.label)
|
|
1629
1890
|
)
|
|
1630
1891
|
)
|
|
1631
1892
|
),
|
|
1632
|
-
renderFooter:
|
|
1633
|
-
|
|
1893
|
+
renderFooter: t && t.id !== $e ? (c) => /* @__PURE__ */ i(
|
|
1894
|
+
mt,
|
|
1634
1895
|
{
|
|
1635
|
-
label:
|
|
1636
|
-
onRename: (
|
|
1896
|
+
label: t.label,
|
|
1897
|
+
onRename: (N) => T.renameFavoriteList(t.id, N),
|
|
1637
1898
|
onRemove: () => {
|
|
1638
|
-
|
|
1899
|
+
T.removeFavoriteList(t.id), c();
|
|
1639
1900
|
}
|
|
1640
1901
|
}
|
|
1641
1902
|
) : void 0
|
|
1642
1903
|
},
|
|
1643
1904
|
"favorites"
|
|
1644
1905
|
);
|
|
1645
|
-
} else
|
|
1646
|
-
|
|
1906
|
+
} else oe && _e !== void 0 && (pi = /* @__PURE__ */ i(
|
|
1907
|
+
Xi,
|
|
1647
1908
|
{
|
|
1648
|
-
options:
|
|
1649
|
-
value:
|
|
1650
|
-
onChange: (
|
|
1651
|
-
collapsed:
|
|
1652
|
-
icon:
|
|
1653
|
-
"aria-label":
|
|
1909
|
+
options: Qe,
|
|
1910
|
+
value: _e,
|
|
1911
|
+
onChange: (t) => T.setActiveGroup(oe, t),
|
|
1912
|
+
collapsed: R,
|
|
1913
|
+
icon: yi[oe].icon,
|
|
1914
|
+
"aria-label": oe === "by-role" ? h("sidebarNav.scope.role", "Role") : h("sidebarNav.scope.unit", "Organizational unit")
|
|
1654
1915
|
},
|
|
1655
|
-
|
|
1916
|
+
oe
|
|
1656
1917
|
));
|
|
1657
|
-
const Gi = [
|
|
1918
|
+
const Gi = we ? h("sidebarNav.railHide", "Hide the bar") : H === "expanded" ? h("sidebarNav.collapseToIcons", "Collapse to icons") : h("sidebarNav.collapseToShortcuts", "Fold to the shortcuts"), Ui = H === "rail" ? h("sidebarNav.shortcutsToIcons", "Show the icons") : R ? h("sidebarNav.expand", "Expand the sidebar") : h("sidebarNav.railShow", "Show the bar"), Wn = [
|
|
1658
1919
|
"nice-sidebar-nav",
|
|
1659
|
-
`nice-sidebar-nav--${
|
|
1660
|
-
`nice-sidebar-nav--${
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1920
|
+
`nice-sidebar-nav--${pe}`,
|
|
1921
|
+
`nice-sidebar-nav--${v}`,
|
|
1922
|
+
L ? "nice-sidebar-nav--minimal" : "",
|
|
1923
|
+
E ? "nice-sidebar-nav--embedded" : "",
|
|
1924
|
+
g && !E ? "nice-sidebar-nav--sticky" : "",
|
|
1925
|
+
p.enableModeIcons && ai ? "nice-sidebar-nav--with-strip" : "",
|
|
1926
|
+
R ? "nice-sidebar-nav--collapsed" : "",
|
|
1927
|
+
R && y ? "nice-sidebar-nav--expandable-collapsed" : "",
|
|
1928
|
+
we ? "nice-sidebar-nav--with-rail" : "",
|
|
1929
|
+
H === "rail" ? "nice-sidebar-nav--shortcuts-rail" : "",
|
|
1668
1930
|
// 1.3.16: the theme's shades ('theme', 'bar'), no indentation, the sticky path
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
].filter(Boolean).join(" "),
|
|
1674
|
-
|
|
1931
|
+
p.colorStyle !== "fill" ? "nice-sidebar-nav--shaded" : "",
|
|
1932
|
+
p.indent === "none" ? "nice-sidebar-nav--flat" : "",
|
|
1933
|
+
p.stickyHeaders === "path" && !R ? "nice-sidebar-nav--sticky-path" : "",
|
|
1934
|
+
M
|
|
1935
|
+
].filter(Boolean).join(" "), Ji = {
|
|
1936
|
+
...A != null ? { "--nice-sidebar-surface-alpha": String(A) } : {},
|
|
1675
1937
|
// The whole tree's colours per level (1.3.2) — branches with their own repaint below.
|
|
1676
|
-
...
|
|
1677
|
-
},
|
|
1678
|
-
"--nice-sidebar-w": `${
|
|
1679
|
-
|
|
1680
|
-
|
|
1938
|
+
...Le.colors ? st(Le.colors, 1) : {}
|
|
1939
|
+
}, et = E ? { width: "100%", ...Ji } : {
|
|
1940
|
+
"--nice-sidebar-w": `${k}px`,
|
|
1941
|
+
// the shortcuts rail (1.3.18) is the bar's width
|
|
1942
|
+
"--nice-sidebar-w-collapsed": `${H === "rail" ? Z : C}px`,
|
|
1943
|
+
...Te ? { "--nice-sidebar-rail-w": `${Z}px` } : {},
|
|
1681
1944
|
// the bar widens the sidebar by its own width
|
|
1682
|
-
width:
|
|
1683
|
-
...
|
|
1945
|
+
width: H === "rail" ? Z : R ? C : we ? k + Z : k,
|
|
1946
|
+
...Ji
|
|
1684
1947
|
};
|
|
1685
|
-
return /* @__PURE__ */
|
|
1948
|
+
return /* @__PURE__ */ I(
|
|
1686
1949
|
"div",
|
|
1687
1950
|
{
|
|
1688
|
-
ref:
|
|
1689
|
-
className:
|
|
1690
|
-
style:
|
|
1691
|
-
"data-testid":
|
|
1692
|
-
"data-mode":
|
|
1951
|
+
ref: ri,
|
|
1952
|
+
className: Wn,
|
|
1953
|
+
style: et,
|
|
1954
|
+
"data-testid": Ue,
|
|
1955
|
+
"data-mode": p.activeMode,
|
|
1693
1956
|
children: [
|
|
1694
|
-
|
|
1695
|
-
|
|
1957
|
+
we && /* @__PURE__ */ i(
|
|
1958
|
+
Qi,
|
|
1696
1959
|
{
|
|
1697
1960
|
className: "nice-sidebar-nav__rail",
|
|
1698
|
-
items:
|
|
1699
|
-
activeId:
|
|
1700
|
-
onSelect:
|
|
1701
|
-
"aria-label":
|
|
1961
|
+
items: q,
|
|
1962
|
+
activeId: Tn,
|
|
1963
|
+
onSelect: Bn,
|
|
1964
|
+
"aria-label": h("sidebarNav.rail", "Shortcuts")
|
|
1702
1965
|
}
|
|
1703
1966
|
),
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1967
|
+
z != null && /* @__PURE__ */ i("div", { className: "nice-sidebar-nav__header", children: z }),
|
|
1968
|
+
p.enableModeIcons && ai && H !== "rail" && /* @__PURE__ */ i(
|
|
1969
|
+
yt,
|
|
1707
1970
|
{
|
|
1708
|
-
enabledModes:
|
|
1709
|
-
activeMode:
|
|
1710
|
-
onSelect:
|
|
1711
|
-
collapsed:
|
|
1971
|
+
enabledModes: j ? p.enabledModes.filter((t) => t !== "search") : p.enabledModes,
|
|
1972
|
+
activeMode: p.activeMode,
|
|
1973
|
+
onSelect: T.setMode,
|
|
1974
|
+
collapsed: R
|
|
1712
1975
|
}
|
|
1713
1976
|
),
|
|
1714
|
-
|
|
1715
|
-
/* @__PURE__ */
|
|
1716
|
-
|
|
1717
|
-
/* @__PURE__ */
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1977
|
+
H !== "rail" && pi,
|
|
1978
|
+
j && !R && /* @__PURE__ */ I("div", { className: "nice-sidebar-nav__search-box", role: "search", children: [
|
|
1979
|
+
/* @__PURE__ */ i(ne, { name: "search", size: 14 }),
|
|
1980
|
+
/* @__PURE__ */ i(
|
|
1981
|
+
"input",
|
|
1982
|
+
{
|
|
1983
|
+
type: "search",
|
|
1984
|
+
className: "nice-sidebar-nav__search-box-input",
|
|
1985
|
+
value: Je,
|
|
1986
|
+
onChange: (t) => Bi(t.target.value),
|
|
1987
|
+
onKeyDown: (t) => {
|
|
1988
|
+
t.key === "Escape" && Je && (t.stopPropagation(), Bi(""));
|
|
1989
|
+
},
|
|
1990
|
+
placeholder: Q ?? h("sidebarNav.searchPlaceholder", "Search the menu"),
|
|
1991
|
+
"aria-label": Q ?? h("sidebarNav.searchPlaceholder", "Search the menu"),
|
|
1992
|
+
"data-testid": "sidebar-inline-search"
|
|
1993
|
+
}
|
|
1994
|
+
)
|
|
1995
|
+
] }),
|
|
1996
|
+
H === "rail" ? (
|
|
1997
|
+
// the last level (1.3.18): only the shortcuts; a carried page drops in among them
|
|
1998
|
+
/* @__PURE__ */ I(
|
|
1999
|
+
"div",
|
|
2000
|
+
{
|
|
2001
|
+
ref: vi,
|
|
2002
|
+
className: [
|
|
2003
|
+
"nice-sidebar-nav__content",
|
|
2004
|
+
"nice-sidebar-nav__shortcuts",
|
|
2005
|
+
Vi ? "nice-sidebar-nav__shortcuts--drop" : ""
|
|
2006
|
+
].filter(Boolean).join(" "),
|
|
2007
|
+
onPointerDown: jn,
|
|
2008
|
+
children: [
|
|
2009
|
+
Vi && Hi !== null && /* @__PURE__ */ i(
|
|
2010
|
+
"div",
|
|
2011
|
+
{
|
|
2012
|
+
className: "nice-sidebar-nav__drop-line",
|
|
2013
|
+
style: { top: Hi },
|
|
2014
|
+
"aria-hidden": "true"
|
|
2015
|
+
}
|
|
2016
|
+
),
|
|
2017
|
+
di.length > 0 ? /* @__PURE__ */ i(
|
|
2018
|
+
Qi,
|
|
2019
|
+
{
|
|
2020
|
+
className: "nice-sidebar-nav__shortcuts-rail",
|
|
2021
|
+
items: di,
|
|
2022
|
+
activeId: di.find((t) => t.route && t.route === s)?.id ?? void 0,
|
|
2023
|
+
"aria-label": h("sidebarNav.shortcuts", "Shortcuts"),
|
|
2024
|
+
"data-testid": "sidebar-shortcuts-rail"
|
|
2025
|
+
}
|
|
2026
|
+
) : ze && /* @__PURE__ */ i("p", { className: "nice-sidebar-nav__shortcuts-empty", children: h(
|
|
2027
|
+
"sidebarNav.shortcutsEmpty",
|
|
2028
|
+
"No shortcuts yet — add them from an item’s star."
|
|
2029
|
+
) })
|
|
2030
|
+
]
|
|
2031
|
+
}
|
|
2032
|
+
)
|
|
2033
|
+
) : /* @__PURE__ */ i("div", { className: "nice-sidebar-nav__content", children: /* @__PURE__ */ i(Ge.Provider, { value: p.colorStyle, children: /* @__PURE__ */ i(vn.Provider, { value: Fe, children: /* @__PURE__ */ i(bn.Provider, { value: $i, children: /* @__PURE__ */ i(hn.Provider, { value: Pn, children: /* @__PURE__ */ I(
|
|
2034
|
+
pn.Provider,
|
|
2035
|
+
{
|
|
2036
|
+
value: !!ui && (He || ze),
|
|
2037
|
+
children: [
|
|
2038
|
+
Ze && /* @__PURE__ */ i("div", { className: "nice-sidebar-nav__pinned", ref: Un }),
|
|
2039
|
+
/* @__PURE__ */ i(
|
|
2040
|
+
"div",
|
|
2041
|
+
{
|
|
2042
|
+
className: `nice-sidebar-nav__body${Yn ? " nice-sidebar-nav__body--drop" : ""}`,
|
|
2043
|
+
ref: hi,
|
|
2044
|
+
children: Zn()
|
|
2045
|
+
}
|
|
2046
|
+
)
|
|
2047
|
+
]
|
|
2048
|
+
}
|
|
2049
|
+
) }) }) }) }) }),
|
|
2050
|
+
H !== "rail" && /* @__PURE__ */ i(
|
|
2051
|
+
Bt,
|
|
2052
|
+
{
|
|
2053
|
+
onFavorite: He ? Ri : null,
|
|
2054
|
+
onShortcut: ze ? Pi : null
|
|
2055
|
+
}
|
|
2056
|
+
),
|
|
2057
|
+
(Te || De) && /* @__PURE__ */ I("div", { className: "nice-sidebar-nav__footer nice-sidebar-nav__footer--levels", children: [
|
|
2058
|
+
Fn && /* @__PURE__ */ I(
|
|
1721
2059
|
"button",
|
|
1722
2060
|
{
|
|
1723
2061
|
type: "button",
|
|
1724
2062
|
className: "nice-sidebar-nav__footer-toggle nice-sidebar-nav__footer-toggle--down",
|
|
1725
|
-
onClick:
|
|
1726
|
-
"aria-label":
|
|
1727
|
-
title:
|
|
2063
|
+
onClick: En,
|
|
2064
|
+
"aria-label": Gi,
|
|
2065
|
+
title: Gi,
|
|
1728
2066
|
children: [
|
|
1729
|
-
/* @__PURE__ */
|
|
1730
|
-
|
|
2067
|
+
/* @__PURE__ */ i("span", { className: "nice-sidebar-nav__footer-toggle-icon", "aria-hidden": "true", children: /* @__PURE__ */ i(
|
|
2068
|
+
ne,
|
|
1731
2069
|
{
|
|
1732
|
-
name:
|
|
2070
|
+
name: v === "right" ? "chevron-right" : "chevron-left",
|
|
1733
2071
|
size: 18
|
|
1734
2072
|
}
|
|
1735
2073
|
) }),
|
|
1736
|
-
/* @__PURE__ */
|
|
2074
|
+
/* @__PURE__ */ i("span", { className: "nice-sidebar-nav__footer-toggle-label", children: h("sidebarNav.collapseShort", "Collapse") })
|
|
1737
2075
|
]
|
|
1738
2076
|
}
|
|
1739
2077
|
),
|
|
1740
|
-
/* @__PURE__ */
|
|
2078
|
+
/* @__PURE__ */ I(
|
|
1741
2079
|
"button",
|
|
1742
2080
|
{
|
|
1743
2081
|
type: "button",
|
|
1744
2082
|
className: "nice-sidebar-nav__footer-toggle nice-sidebar-nav__footer-toggle--up",
|
|
1745
|
-
onClick:
|
|
1746
|
-
disabled:
|
|
1747
|
-
"aria-label":
|
|
1748
|
-
title:
|
|
2083
|
+
onClick: An,
|
|
2084
|
+
disabled: !Dn,
|
|
2085
|
+
"aria-label": Ui,
|
|
2086
|
+
title: Ui,
|
|
1749
2087
|
children: [
|
|
1750
|
-
/* @__PURE__ */
|
|
1751
|
-
/* @__PURE__ */
|
|
1752
|
-
|
|
2088
|
+
/* @__PURE__ */ i("span", { className: "nice-sidebar-nav__footer-toggle-label", children: h("sidebarNav.expandShort", "Expand") }),
|
|
2089
|
+
/* @__PURE__ */ i("span", { className: "nice-sidebar-nav__footer-toggle-icon", "aria-hidden": "true", children: /* @__PURE__ */ i(
|
|
2090
|
+
ne,
|
|
1753
2091
|
{
|
|
1754
|
-
name:
|
|
2092
|
+
name: v === "right" ? "chevron-left" : "chevron-right",
|
|
1755
2093
|
size: 18
|
|
1756
2094
|
}
|
|
1757
2095
|
) })
|
|
1758
2096
|
]
|
|
1759
2097
|
}
|
|
1760
2098
|
),
|
|
1761
|
-
|
|
2099
|
+
V != null && /* @__PURE__ */ i("div", { className: "nice-sidebar-nav__footer-extra", children: V })
|
|
1762
2100
|
] }),
|
|
1763
|
-
!
|
|
1764
|
-
/* @__PURE__ */
|
|
2101
|
+
!E && !Te && !De && /* @__PURE__ */ I("div", { className: "nice-sidebar-nav__footer", children: [
|
|
2102
|
+
/* @__PURE__ */ I(
|
|
1765
2103
|
"button",
|
|
1766
2104
|
{
|
|
1767
2105
|
type: "button",
|
|
1768
2106
|
className: "nice-sidebar-nav__footer-toggle",
|
|
1769
|
-
onClick:
|
|
1770
|
-
"aria-label":
|
|
1771
|
-
title:
|
|
2107
|
+
onClick: Ln,
|
|
2108
|
+
"aria-label": R ? h("sidebarNav.expand", "Expand the sidebar") : h("sidebarNav.collapseToIcons", "Collapse to icons"),
|
|
2109
|
+
title: R ? h("sidebarNav.expand", "Expand the sidebar") : h("sidebarNav.collapseToIcons", "Collapse to icons"),
|
|
1772
2110
|
children: [
|
|
1773
|
-
/* @__PURE__ */
|
|
1774
|
-
|
|
2111
|
+
/* @__PURE__ */ i("span", { className: "nice-sidebar-nav__footer-toggle-icon", "aria-hidden": "true", children: /* @__PURE__ */ i(
|
|
2112
|
+
ne,
|
|
1775
2113
|
{
|
|
1776
2114
|
name: "chevron-left",
|
|
1777
2115
|
size: 18,
|
|
1778
2116
|
style: {
|
|
1779
2117
|
transition: "transform 160ms ease",
|
|
1780
|
-
transform: (
|
|
2118
|
+
transform: (v === "right" ? !R : R) ? "rotate(180deg)" : "rotate(0deg)"
|
|
1781
2119
|
}
|
|
1782
2120
|
}
|
|
1783
2121
|
) }),
|
|
1784
|
-
/* @__PURE__ */
|
|
2122
|
+
/* @__PURE__ */ i("span", { className: "nice-sidebar-nav__footer-toggle-label", children: R ? h("sidebarNav.expandShort", "Expand") : h("sidebarNav.collapseToIcons", "Collapse to icons") })
|
|
1785
2123
|
]
|
|
1786
2124
|
}
|
|
1787
2125
|
),
|
|
1788
|
-
|
|
2126
|
+
V != null && /* @__PURE__ */ i("div", { className: "nice-sidebar-nav__footer-extra", children: V })
|
|
1789
2127
|
] }),
|
|
1790
|
-
|
|
2128
|
+
E && V != null && /* @__PURE__ */ i("div", { className: "nice-sidebar-nav__footer nice-sidebar-nav__footer--embedded", children: /* @__PURE__ */ i("div", { className: "nice-sidebar-nav__footer-extra", children: V }) })
|
|
1791
2129
|
]
|
|
1792
2130
|
}
|
|
1793
2131
|
);
|
|
1794
2132
|
}
|
|
2133
|
+
), ir = /* @__PURE__ */ rn(
|
|
2134
|
+
function(r, u) {
|
|
2135
|
+
const s = xi(), d = /* @__PURE__ */ i(zt, { ...r, ref: u });
|
|
2136
|
+
return s ? d : /* @__PURE__ */ i(rt, { children: d });
|
|
2137
|
+
}
|
|
1795
2138
|
);
|
|
1796
2139
|
export {
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
2140
|
+
ir as NiceSidebarNav,
|
|
2141
|
+
wt as sidebarPrefsHostControlled,
|
|
2142
|
+
Ct as useSidebarNavPrefs
|
|
1800
2143
|
};
|