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