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