@memobit/libs 3.36.0 → 4.1.0
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/dist/components/DataView/DataView2.js +46 -46
- package/dist/components/PageShell/AppFrame.js +21 -19
- package/dist/components/PageShell/AppNav.js +119 -54
- package/dist/components/PageShell/PageShell.css +1 -1
- package/dist/components/PageShell/WorkbenchShell.js +43 -39
- package/dist/components/ThemeSettings/ThemeContext.js +26 -26
- package/dist/components/ThemeSettings/ThemeContextValue.js +2 -1
- package/dist/components/ThemeSettings/getDefaultThemeForApp.js +5 -4
- package/dist/helpers/VersionInfo.js +1 -1
- package/dist/index.d.ts +13 -2
- package/dist/router.d.ts +10 -0
- package/dist/version.js +1 -1
- package/dist/version.json +4 -4
- package/package.json +3 -3
|
@@ -20,24 +20,24 @@ import { TableView as Pt } from "./DataView.TableView.js";
|
|
|
20
20
|
/* empty css */
|
|
21
21
|
import { useCallback as Ge, useEffect as Lt, useMemo as D, useRef as Pe, useState as _ } from "react";
|
|
22
22
|
import { Fragment as Vt, jsx as r, jsxs as M } from "react/jsx-runtime";
|
|
23
|
-
function oo({ columns: l, data: A, rowKey: W, pinnedIds: g, selectable: G = !1, onSelectionChange: Le, selectedIds:
|
|
24
|
-
const f = ht(pt), { language: Ze } = gt(), { isMobile:
|
|
23
|
+
function oo({ columns: l, data: A, rowKey: W, pinnedIds: g, selectable: G = !1, onSelectionChange: Le, selectedIds: te, pageSizeOptions: Ve = De, initialPageSize: Ae = De[1], showPageSize: U = !0, card: Be, actions: oe, actionsWidth: Re, timeline: h, onRowClick: ne, rowHref: se, rowClassName: re, rowDetail: xe, empty: ie, initialSortKey: $e = null, initialSortDirection: ze = "asc", sortKey: K, sortDirection: ae, onSortChange: Fe, miniSort: B, showCardSortControls: We = !0, desktopView: le = "table", cardMaxWidth: Ue, className: k, onPageChange: ce, onPageSizeChange: Ke, currentPage: X, totalItems: de, group: i, showResultsCount: Xe, totalCount: je, itemNoun: Oe, columnSelector: j, animateChanges: He = !0, highlightIds: v }) {
|
|
24
|
+
const f = ht(pt), { language: Ze } = gt(), { isMobile: ue } = yt(), R = Pe(null), x = _t(R, {
|
|
25
25
|
enabled: He && W !== void 0,
|
|
26
26
|
highlightKeys: v
|
|
27
|
-
}), [qe, Je] = _($e), [Qe, Ye] = _(ze), [Ie, et] = _([]), m =
|
|
27
|
+
}), [qe, Je] = _($e), [Qe, Ye] = _(ze), [Ie, et] = _([]), m = te ?? Ie, [tt, ot] = _(1), O = X ?? tt, [w, nt] = _(Ae), [fe, st] = _(() => l.reduce((e, t) => (t.width && (e[t.key] = t.width), e), {})), [me, rt] = _(/* @__PURE__ */ new Set()), pe = (e) => {
|
|
28
28
|
x.forceNext(), rt((t) => {
|
|
29
29
|
const s = new Set(t);
|
|
30
30
|
return s.has(e) ? s.delete(e) : s.add(e), s;
|
|
31
31
|
});
|
|
32
32
|
}, c = Ge((e, t) => W?.(e, t) ?? t, [W]), P = Ge((e) => {
|
|
33
|
-
e !== O && x.skipNext(), X === void 0 && ot(e),
|
|
33
|
+
e !== O && x.skipNext(), X === void 0 && ot(e), ce?.(e);
|
|
34
34
|
}, [
|
|
35
35
|
X,
|
|
36
36
|
O,
|
|
37
37
|
x,
|
|
38
|
-
|
|
39
|
-
]), d = K !== void 0 ? K : qe, u =
|
|
40
|
-
K === void 0 && Je(e),
|
|
38
|
+
ce
|
|
39
|
+
]), d = K !== void 0 ? K : qe, u = ae ?? Qe, T = (e, t) => {
|
|
40
|
+
K === void 0 && Je(e), ae === void 0 && Ye(t), Fe?.({
|
|
41
41
|
key: e,
|
|
42
42
|
direction: t
|
|
43
43
|
}), P(1);
|
|
@@ -73,7 +73,7 @@ function oo({ columns: l, data: A, rowKey: W, pinnedIds: g, selectable: G = !1,
|
|
|
73
73
|
$,
|
|
74
74
|
g,
|
|
75
75
|
c
|
|
76
|
-
]), N =
|
|
76
|
+
]), N = de !== void 0, b = D(() => {
|
|
77
77
|
if (!i || N) return H;
|
|
78
78
|
const e = /* @__PURE__ */ new Map(), t = [];
|
|
79
79
|
H.forEach((o) => {
|
|
@@ -94,7 +94,7 @@ function oo({ columns: l, data: A, rowKey: W, pinnedIds: g, selectable: G = !1,
|
|
|
94
94
|
i,
|
|
95
95
|
N,
|
|
96
96
|
H
|
|
97
|
-
]), z = N ?
|
|
97
|
+
]), z = N ? de : b.length, Z = Math.max(1, Math.ceil(z / w)), E = Math.min(O, Z), S = N ? b : b.slice((E - 1) * w, E * w), ge = Pe(void 0);
|
|
98
98
|
Lt(() => {
|
|
99
99
|
if (!v || v.length === 0 || N || ge.current === v) return;
|
|
100
100
|
const e = b.findIndex((s, o) => v.includes(c(s, o)));
|
|
@@ -111,7 +111,7 @@ function oo({ columns: l, data: A, rowKey: W, pinnedIds: g, selectable: G = !1,
|
|
|
111
111
|
c,
|
|
112
112
|
E
|
|
113
113
|
]);
|
|
114
|
-
const
|
|
114
|
+
const q = Xe ?? Z > 1 ? Ct(w, z, je ?? z, E, Oe, Ze) : null, J = D(() => {
|
|
115
115
|
if (!i) return null;
|
|
116
116
|
const e = /* @__PURE__ */ new Map();
|
|
117
117
|
return b.forEach((t) => {
|
|
@@ -119,7 +119,7 @@ function oo({ columns: l, data: A, rowKey: W, pinnedIds: g, selectable: G = !1,
|
|
|
119
119
|
e.set(s, (e.get(s) ?? 0) + 1);
|
|
120
120
|
}), e;
|
|
121
121
|
}, [i, b]), he = D(() => {
|
|
122
|
-
if (!i || !
|
|
122
|
+
if (!i || !J) return null;
|
|
123
123
|
const e = /* @__PURE__ */ new Map(), t = [];
|
|
124
124
|
S.forEach((o) => {
|
|
125
125
|
const n = i.groupBy(o), a = e.get(n);
|
|
@@ -129,12 +129,12 @@ function oo({ columns: l, data: A, rowKey: W, pinnedIds: g, selectable: G = !1,
|
|
|
129
129
|
key: o,
|
|
130
130
|
label: i.groupLabel(o),
|
|
131
131
|
items: e.get(o),
|
|
132
|
-
totalCount:
|
|
132
|
+
totalCount: J.get(o) ?? 0
|
|
133
133
|
}));
|
|
134
134
|
return i.sortGroups ? s.sort(i.sortGroups) : s.sort((o, n) => o.key === null ? 1 : n.key === null ? -1 : 0), s;
|
|
135
135
|
}, [
|
|
136
136
|
i,
|
|
137
|
-
|
|
137
|
+
J,
|
|
138
138
|
S
|
|
139
139
|
]), ve = D(() => {
|
|
140
140
|
if (!h) return /* @__PURE__ */ new Map();
|
|
@@ -144,14 +144,14 @@ function oo({ columns: l, data: A, rowKey: W, pinnedIds: g, selectable: G = !1,
|
|
|
144
144
|
}));
|
|
145
145
|
return Tt(e, h.granularity);
|
|
146
146
|
}, [S, h]), F = (e) => {
|
|
147
|
-
|
|
147
|
+
te === void 0 && et(e), Le?.(A.filter((t, s) => e.includes(c(t, s))));
|
|
148
148
|
}, we = (e, t) => {
|
|
149
149
|
F(t ? [...m, e] : m.filter((s) => s !== e));
|
|
150
150
|
}, it = (e) => {
|
|
151
151
|
e.sortable && (d === e.key ? T(e.key, u === "asc" ? "desc" : "asc") : T(e.key, "asc"));
|
|
152
152
|
}, at = (e, t) => {
|
|
153
153
|
e.preventDefault();
|
|
154
|
-
const s = e.clientX, o =
|
|
154
|
+
const s = e.clientX, o = fe[t] ?? 150, n = (L) => {
|
|
155
155
|
const y = L.clientX - s, V = l.find((C) => C.key === t)?.minWidth ?? 120;
|
|
156
156
|
st((C) => ({
|
|
157
157
|
...C,
|
|
@@ -161,30 +161,30 @@ function oo({ columns: l, data: A, rowKey: W, pinnedIds: g, selectable: G = !1,
|
|
|
161
161
|
window.removeEventListener("mousemove", n), window.removeEventListener("mouseup", a);
|
|
162
162
|
};
|
|
163
163
|
window.addEventListener("mousemove", n), window.addEventListener("mouseup", a);
|
|
164
|
-
}, be = l.some((e) => e.filter),
|
|
164
|
+
}, be = l.some((e) => e.filter), Q = l.filter((e) => e.sortable), lt = Q.map((e) => ({
|
|
165
165
|
label: Nt(e),
|
|
166
166
|
value: e.key
|
|
167
|
-
})), ct =
|
|
167
|
+
})), ct = Q.length > 0, Y = d ? Q.find((e) => e.key === d) : void 0, dt = B?.align ?? "left", Se = (B?.columns ?? B?.column ?? []).length > 0 ? /* @__PURE__ */ r(Gt, {
|
|
168
168
|
columns: l,
|
|
169
169
|
config: B,
|
|
170
170
|
sortKey: d,
|
|
171
171
|
sortDirection: u,
|
|
172
172
|
onSort: T
|
|
173
|
-
}) : null, ye = j && j.options.length > 0 ? /* @__PURE__ */ r(Dt, { config: j }) : null, p = S.map(c),
|
|
173
|
+
}) : null, ye = j && j.options.length > 0 ? /* @__PURE__ */ r(Dt, { config: j }) : null, p = S.map(c), I = p.filter((e) => m.includes(e)).length, ee = !!G && p.length > 0 && I === p.length, Ce = !!G && I > 0 && I < p.length, _e = (e) => {
|
|
174
174
|
F(e ? [...m, ...p.filter((t) => !m.includes(t))] : m.filter((t) => !p.includes(t)));
|
|
175
175
|
}, ut = G && p.length > 0 ? /* @__PURE__ */ M("label", {
|
|
176
176
|
className: "data-view__select-all",
|
|
177
177
|
children: [/* @__PURE__ */ r(bt, {
|
|
178
|
-
checked:
|
|
178
|
+
checked: ee,
|
|
179
179
|
indeterminate: Ce,
|
|
180
180
|
onChange: _e
|
|
181
|
-
}), /* @__PURE__ */ r("span", { children:
|
|
182
|
-
}) : null, Me = (e) =>
|
|
181
|
+
}), /* @__PURE__ */ r("span", { children: ee ? f.clearSelection : f.selectThese(p.length) })]
|
|
182
|
+
}) : null, Me = (e) => q || Se || ye || e ? /* @__PURE__ */ M("div", {
|
|
183
183
|
className: `data-view__top-row data-view__top-row--mini-${dt}`,
|
|
184
184
|
children: [
|
|
185
|
-
|
|
185
|
+
q && /* @__PURE__ */ r("div", {
|
|
186
186
|
className: "data-view__results-count",
|
|
187
|
-
children:
|
|
187
|
+
children: q
|
|
188
188
|
}),
|
|
189
189
|
e,
|
|
190
190
|
Se,
|
|
@@ -192,7 +192,7 @@ function oo({ columns: l, data: A, rowKey: W, pinnedIds: g, selectable: G = !1,
|
|
|
192
192
|
]
|
|
193
193
|
}) : null, ke = Me(), Te = /* @__PURE__ */ r(kt, {
|
|
194
194
|
currentPage: E,
|
|
195
|
-
totalPages:
|
|
195
|
+
totalPages: Z,
|
|
196
196
|
totalItems: z,
|
|
197
197
|
onPageChange: P,
|
|
198
198
|
pageSizeOptions: U ? Ve : void 0,
|
|
@@ -201,7 +201,7 @@ function oo({ columns: l, data: A, rowKey: W, pinnedIds: g, selectable: G = !1,
|
|
|
201
201
|
x.skipNext(), nt(e), P(1), Ke?.(e);
|
|
202
202
|
} : void 0
|
|
203
203
|
});
|
|
204
|
-
if (
|
|
204
|
+
if (le !== "cards" && l.length === 0) return /* @__PURE__ */ M("div", {
|
|
205
205
|
className: `data-view${k ? ` ${k}` : ""}`,
|
|
206
206
|
ref: R,
|
|
207
207
|
children: [ke, /* @__PURE__ */ r("div", {
|
|
@@ -212,7 +212,7 @@ function oo({ columns: l, data: A, rowKey: W, pinnedIds: g, selectable: G = !1,
|
|
|
212
212
|
})
|
|
213
213
|
})]
|
|
214
214
|
});
|
|
215
|
-
if (
|
|
215
|
+
if (le === "cards") return /* @__PURE__ */ M("div", {
|
|
216
216
|
className: `data-view data-view--cards${k ? ` ${k}` : ""}`,
|
|
217
217
|
ref: R,
|
|
218
218
|
children: [
|
|
@@ -242,9 +242,9 @@ function oo({ columns: l, data: A, rowKey: W, pinnedIds: g, selectable: G = !1,
|
|
|
242
242
|
title: u === "asc" ? f.sortDescending : f.sortAscending,
|
|
243
243
|
children: /* @__PURE__ */ r(vt, {
|
|
244
244
|
className: "data-view__card-sort-direction",
|
|
245
|
-
disabled: !
|
|
245
|
+
disabled: !Y,
|
|
246
246
|
onClick: () => {
|
|
247
|
-
|
|
247
|
+
Y && T(Y.key, u === "asc" ? "desc" : "asc");
|
|
248
248
|
},
|
|
249
249
|
variant: "ghost",
|
|
250
250
|
children: /* @__PURE__ */ r(mt, { name: u === "asc" ? "arrow-up" : "arrow-down" })
|
|
@@ -263,28 +263,28 @@ function oo({ columns: l, data: A, rowKey: W, pinnedIds: g, selectable: G = !1,
|
|
|
263
263
|
columns: l,
|
|
264
264
|
rowKey: c,
|
|
265
265
|
card: Be,
|
|
266
|
-
actions:
|
|
266
|
+
actions: oe,
|
|
267
267
|
timeline: h,
|
|
268
|
-
onRowClick:
|
|
269
|
-
rowHref:
|
|
270
|
-
rowClassName:
|
|
271
|
-
empty:
|
|
268
|
+
onRowClick: ne,
|
|
269
|
+
rowHref: se,
|
|
270
|
+
rowClassName: re,
|
|
271
|
+
empty: ie,
|
|
272
272
|
selectable: G,
|
|
273
273
|
selectedIds: m,
|
|
274
274
|
pinnedIds: g,
|
|
275
275
|
cardMaxWidth: Ue,
|
|
276
|
-
isMobile:
|
|
276
|
+
isMobile: ue,
|
|
277
277
|
groups: he ?? void 0,
|
|
278
278
|
showGroupCount: i?.showCount !== !1,
|
|
279
279
|
collapsible: i?.collapsible,
|
|
280
|
-
collapsedGroups:
|
|
281
|
-
onToggleGroup:
|
|
280
|
+
collapsedGroups: me,
|
|
281
|
+
onToggleGroup: pe,
|
|
282
282
|
onToggleSelect: we
|
|
283
283
|
}),
|
|
284
284
|
Te
|
|
285
285
|
]
|
|
286
286
|
});
|
|
287
|
-
const ft = l.filter((e) => !e.hideInTable && !(
|
|
287
|
+
const ft = l.filter((e) => !e.hideInTable && !(ue && e.hideInMobile)), Ne = h && ve.size > 0, Ee = /* @__PURE__ */ M(Vt, { children: [
|
|
288
288
|
ke,
|
|
289
289
|
/* @__PURE__ */ r("div", {
|
|
290
290
|
className: "data-view__wrapper",
|
|
@@ -292,7 +292,7 @@ function oo({ columns: l, data: A, rowKey: W, pinnedIds: g, selectable: G = !1,
|
|
|
292
292
|
data: S,
|
|
293
293
|
columns: ft,
|
|
294
294
|
rowKey: c,
|
|
295
|
-
columnWidths:
|
|
295
|
+
columnWidths: fe,
|
|
296
296
|
onResizeStart: at,
|
|
297
297
|
sortKey: d,
|
|
298
298
|
sortDirection: u,
|
|
@@ -302,22 +302,22 @@ function oo({ columns: l, data: A, rowKey: W, pinnedIds: g, selectable: G = !1,
|
|
|
302
302
|
timelineMarkers: ve,
|
|
303
303
|
selectable: G,
|
|
304
304
|
selectedIds: m,
|
|
305
|
-
allVisibleSelected:
|
|
305
|
+
allVisibleSelected: ee,
|
|
306
306
|
someVisibleSelected: Ce,
|
|
307
307
|
onToggleVisibleSelection: _e,
|
|
308
308
|
onToggleSelect: we,
|
|
309
309
|
pinnedSet: $,
|
|
310
|
-
actions:
|
|
310
|
+
actions: oe,
|
|
311
311
|
actionsWidth: Re,
|
|
312
|
-
onRowClick:
|
|
313
|
-
rowHref:
|
|
314
|
-
rowClassName:
|
|
312
|
+
onRowClick: ne,
|
|
313
|
+
rowHref: se,
|
|
314
|
+
rowClassName: re,
|
|
315
315
|
rowDetail: xe,
|
|
316
|
-
empty:
|
|
316
|
+
empty: ie,
|
|
317
317
|
groups: he,
|
|
318
318
|
group: i,
|
|
319
|
-
collapsedGroups:
|
|
320
|
-
onToggleGroup:
|
|
319
|
+
collapsedGroups: me,
|
|
320
|
+
onToggleGroup: pe
|
|
321
321
|
})
|
|
322
322
|
}),
|
|
323
323
|
Te
|
|
@@ -2,43 +2,45 @@ import { ThemeSettings as u } from "../ThemeSettings/ThemeSettings2.js";
|
|
|
2
2
|
import { useAccountMenu as c } from "../../hooks/useAccountMenu.js";
|
|
3
3
|
import { AppFrameContext as l } from "./useAppFrame.js";
|
|
4
4
|
import { useMemo as f, useState as A } from "react";
|
|
5
|
-
import { jsx as o, jsxs as
|
|
6
|
-
var
|
|
7
|
-
const
|
|
5
|
+
import { jsx as o, jsxs as p } from "react/jsx-runtime";
|
|
6
|
+
var a = ({ app: e, nav: t, navOptions: r, menuItems: n, status: m, children: i }) => {
|
|
7
|
+
const s = f(() => ({
|
|
8
8
|
app: e,
|
|
9
9
|
nav: t,
|
|
10
|
-
|
|
10
|
+
navOptions: r,
|
|
11
|
+
menuItems: n,
|
|
11
12
|
status: m
|
|
12
13
|
}), [
|
|
13
14
|
e,
|
|
14
15
|
t,
|
|
15
16
|
r,
|
|
17
|
+
n,
|
|
16
18
|
m
|
|
17
19
|
]);
|
|
18
20
|
return /* @__PURE__ */ o(l.Provider, {
|
|
19
|
-
value:
|
|
20
|
-
children:
|
|
21
|
+
value: s,
|
|
22
|
+
children: i
|
|
21
23
|
});
|
|
22
|
-
}, h = ({ account: e, menuItems: t = [], children: r, ...
|
|
23
|
-
const
|
|
24
|
-
return /* @__PURE__ */ a
|
|
25
|
-
...
|
|
26
|
-
menuItems: [...t, ...
|
|
27
|
-
children: [r,
|
|
24
|
+
}, h = ({ account: e, menuItems: t = [], children: r, ...n }) => {
|
|
25
|
+
const m = c(e);
|
|
26
|
+
return /* @__PURE__ */ p(a, {
|
|
27
|
+
...n,
|
|
28
|
+
menuItems: [...t, ...m.items],
|
|
29
|
+
children: [r, m.modals]
|
|
28
30
|
});
|
|
29
|
-
}, v = ({ theme: e, menuItems: t = [], children: r, ...
|
|
30
|
-
const [
|
|
31
|
+
}, v = ({ theme: e, menuItems: t = [], children: r, ...n }) => {
|
|
32
|
+
const [m, i] = A(!1), s = {
|
|
31
33
|
label: e.label ?? "Theme",
|
|
32
34
|
icon: "theme-picker",
|
|
33
35
|
onClick: () => i(!0),
|
|
34
36
|
isActive: !1,
|
|
35
37
|
separator: !0
|
|
36
38
|
};
|
|
37
|
-
return /* @__PURE__ */ a
|
|
38
|
-
...
|
|
39
|
-
menuItems: [...t,
|
|
39
|
+
return /* @__PURE__ */ p(a, {
|
|
40
|
+
...n,
|
|
41
|
+
menuItems: [...t, s],
|
|
40
42
|
children: [r, /* @__PURE__ */ o(u, {
|
|
41
|
-
isOpen:
|
|
43
|
+
isOpen: m,
|
|
42
44
|
onClose: () => i(!1),
|
|
43
45
|
currentApp: e.appName
|
|
44
46
|
})]
|
|
@@ -49,7 +51,7 @@ var s = ({ app: e, nav: t, menuItems: r, status: m, children: n }) => {
|
|
|
49
51
|
}) : t ? /* @__PURE__ */ o(v, {
|
|
50
52
|
theme: t,
|
|
51
53
|
...r
|
|
52
|
-
}) : /* @__PURE__ */ o(
|
|
54
|
+
}) : /* @__PURE__ */ o(a, { ...r });
|
|
53
55
|
export {
|
|
54
56
|
I as AppFrame
|
|
55
57
|
};
|
|
@@ -1,66 +1,131 @@
|
|
|
1
|
-
import { Icon as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { Icon as v } from "../Icon/Icon2.js";
|
|
2
|
+
import { libMessages as G } from "../../contexts/LanguageContext/libMessages.js";
|
|
3
|
+
import { useMessages as F } from "../../hooks/useLanguage.js";
|
|
4
|
+
import { InputSearch as A } from "../InputSearch/InputSearch2.js";
|
|
5
|
+
import { AppMark as I } from "./PageParts.js";
|
|
6
|
+
import { Fragment as x, useEffect as z, useState as y } from "react";
|
|
7
|
+
import { jsx as s, jsxs as n } from "react/jsx-runtime";
|
|
8
|
+
var _ = (a, l) => [a, l.isActive ? `${a}--active` : ""].filter(Boolean).join(" "), m = ({ item: a, size: l }) => /* @__PURE__ */ s("span", {
|
|
6
9
|
className: "page-shell__nav-icon",
|
|
7
|
-
style:
|
|
8
|
-
children: /* @__PURE__ */
|
|
9
|
-
name:
|
|
10
|
-
size:
|
|
10
|
+
style: a.color ? { color: a.color } : void 0,
|
|
11
|
+
children: /* @__PURE__ */ s(v, {
|
|
12
|
+
name: a.icon,
|
|
13
|
+
size: l
|
|
11
14
|
})
|
|
12
|
-
}),
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
15
|
+
}), N = (a) => `page-shell-nav-folded:${a}`, M = (a) => {
|
|
16
|
+
if (!a) return /* @__PURE__ */ new Set();
|
|
17
|
+
try {
|
|
18
|
+
const l = JSON.parse(localStorage.getItem(N(a)) ?? "[]");
|
|
19
|
+
return new Set(Array.isArray(l) ? l.filter((r) => typeof r == "string") : []);
|
|
20
|
+
} catch {
|
|
21
|
+
return /* @__PURE__ */ new Set();
|
|
22
|
+
}
|
|
23
|
+
}, j = (a, l) => {
|
|
24
|
+
if (a)
|
|
25
|
+
try {
|
|
26
|
+
localStorage.setItem(N(a), JSON.stringify([...l]));
|
|
27
|
+
} catch {
|
|
28
|
+
}
|
|
29
|
+
}, $ = ({ nav: a, appName: l, options: r = {} }) => {
|
|
30
|
+
const d = F(G), [f, i] = y(""), [t, S] = y(() => r.collapsibleGroups ? M(l) : /* @__PURE__ */ new Set()), p = f.trim().toLowerCase(), h = p.length > 0, o = h ? a.filter((e) => e.label.toLowerCase().includes(p) || e.group?.toLowerCase().includes(p)) : a, g = r.collapsibleGroups === !0 && !h, w = (e) => g && e.group !== void 0 && t.has(e.group) && !e.isActive;
|
|
31
|
+
z(() => {
|
|
32
|
+
r.collapsibleGroups && j(l, t);
|
|
33
|
+
}, [
|
|
34
|
+
l,
|
|
35
|
+
t,
|
|
36
|
+
r.collapsibleGroups
|
|
37
|
+
]);
|
|
38
|
+
const C = (e) => S((u) => {
|
|
39
|
+
const c = new Set(u);
|
|
40
|
+
return c.delete(e) || c.add(e), c;
|
|
41
|
+
}), b = (e) => {
|
|
42
|
+
i(""), e.onSelect();
|
|
43
|
+
}, k = (e) => {
|
|
44
|
+
e.key === "Enter" && h && o[0] && b(o[0]), e.key === "Escape" && i("");
|
|
45
|
+
};
|
|
46
|
+
return /* @__PURE__ */ n("nav", {
|
|
47
|
+
className: "page-shell__side-nav",
|
|
48
|
+
children: [r.search && /* @__PURE__ */ s(A, {
|
|
49
|
+
value: f,
|
|
50
|
+
placeholder: r.search,
|
|
51
|
+
onChange: i,
|
|
52
|
+
onKeyDown: k
|
|
53
|
+
}), /* @__PURE__ */ n("div", {
|
|
54
|
+
className: "page-shell__nav-list",
|
|
55
|
+
children: [o.map((e, u) => {
|
|
56
|
+
const c = e.group !== void 0 && e.group !== o[u - 1]?.group;
|
|
57
|
+
return /* @__PURE__ */ n(x, { children: [c && e.group && /* @__PURE__ */ s(E, {
|
|
58
|
+
group: e.group,
|
|
59
|
+
isFolded: g && t.has(e.group),
|
|
60
|
+
canFold: g,
|
|
61
|
+
onToggle: C
|
|
62
|
+
}), !w(e) && /* @__PURE__ */ n("button", {
|
|
63
|
+
type: "button",
|
|
64
|
+
className: _("page-shell__nav-row", e),
|
|
65
|
+
onClick: () => b(e),
|
|
66
|
+
children: [
|
|
67
|
+
/* @__PURE__ */ s(m, {
|
|
68
|
+
item: e,
|
|
69
|
+
size: "sm"
|
|
70
|
+
}),
|
|
71
|
+
/* @__PURE__ */ s("span", {
|
|
72
|
+
className: "page-shell__nav-label",
|
|
73
|
+
children: e.label
|
|
74
|
+
}),
|
|
75
|
+
e.count !== void 0 && /* @__PURE__ */ s("span", {
|
|
76
|
+
className: "page-shell__nav-count",
|
|
77
|
+
children: e.count
|
|
78
|
+
})
|
|
79
|
+
]
|
|
80
|
+
})] }, e.id);
|
|
81
|
+
}), o.length === 0 && /* @__PURE__ */ s("span", {
|
|
82
|
+
className: "page-shell__nav-empty",
|
|
83
|
+
children: d.pageNoMatches
|
|
84
|
+
})]
|
|
85
|
+
})]
|
|
86
|
+
});
|
|
87
|
+
}, E = ({ group: a, isFolded: l, canFold: r, onToggle: d }) => r ? /* @__PURE__ */ n("button", {
|
|
88
|
+
type: "button",
|
|
89
|
+
className: "page-shell__nav-group page-shell__nav-group--toggle",
|
|
90
|
+
onClick: () => d(a),
|
|
91
|
+
children: [/* @__PURE__ */ s("span", {
|
|
92
|
+
className: "page-shell__nav-group-label",
|
|
93
|
+
children: a
|
|
94
|
+
}), /* @__PURE__ */ s(v, {
|
|
95
|
+
name: l ? "caret-right" : "caret-down",
|
|
96
|
+
size: "sm"
|
|
97
|
+
})]
|
|
98
|
+
}) : /* @__PURE__ */ s("span", {
|
|
99
|
+
className: "page-shell__nav-group",
|
|
100
|
+
children: a
|
|
101
|
+
}), q = ({ app: a, nav: l }) => /* @__PURE__ */ n("nav", {
|
|
37
102
|
className: "page-shell__rail",
|
|
38
|
-
children: [
|
|
39
|
-
app:
|
|
103
|
+
children: [a && /* @__PURE__ */ s(I, {
|
|
104
|
+
app: a,
|
|
40
105
|
logoOnly: !0
|
|
41
|
-
}),
|
|
106
|
+
}), l.map((r) => /* @__PURE__ */ n("button", {
|
|
42
107
|
type: "button",
|
|
43
|
-
className:
|
|
44
|
-
onClick:
|
|
45
|
-
children: [/* @__PURE__ */
|
|
46
|
-
item:
|
|
108
|
+
className: _("page-shell__rail-item", r),
|
|
109
|
+
onClick: r.onSelect,
|
|
110
|
+
children: [/* @__PURE__ */ s(m, {
|
|
111
|
+
item: r,
|
|
47
112
|
size: "md"
|
|
48
|
-
}), /* @__PURE__ */
|
|
49
|
-
},
|
|
50
|
-
}),
|
|
113
|
+
}), /* @__PURE__ */ s("span", { children: r.label })]
|
|
114
|
+
}, r.id))]
|
|
115
|
+
}), D = ({ nav: a }) => /* @__PURE__ */ s("nav", {
|
|
51
116
|
className: "page-shell__tabbar",
|
|
52
|
-
children:
|
|
117
|
+
children: a.map((l) => /* @__PURE__ */ n("button", {
|
|
53
118
|
type: "button",
|
|
54
|
-
className:
|
|
55
|
-
onClick:
|
|
56
|
-
children: [/* @__PURE__ */
|
|
57
|
-
name:
|
|
119
|
+
className: _("page-shell__tab", l),
|
|
120
|
+
onClick: l.onSelect,
|
|
121
|
+
children: [/* @__PURE__ */ s(v, {
|
|
122
|
+
name: l.icon,
|
|
58
123
|
size: "md"
|
|
59
|
-
}), /* @__PURE__ */
|
|
60
|
-
},
|
|
124
|
+
}), /* @__PURE__ */ s("span", { children: l.label })]
|
|
125
|
+
}, l.id))
|
|
61
126
|
});
|
|
62
127
|
export {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
128
|
+
q as NavRail,
|
|
129
|
+
$ as SideNav,
|
|
130
|
+
D as TabBar
|
|
66
131
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.page-shell{min-height:100vh;color:var(--body-color);display:flex}.page-shell,.page-shell__side,.page-shell__main,.page-shell__rail,.page-shell__toolbar,.page-shell__content{box-sizing:border-box}.page-shell__side{width:var(--spacing-300);gap:var(--spacing-16);height:100vh;padding:var(--spacing-16);background-color:var(--card-background-color);border-right:1px solid var(--card-border-color);flex-direction:column;flex:none;display:flex;position:sticky;top:0;overflow-y:auto}.page-shell__side-group{gap:var(--spacing-8);flex-direction:column;display:flex}.page-shell__side-head{align-items:center;gap:var(--spacing-8);display:flex}.page-shell__group-title{color:var(--body-color-muted);font-size:var(--font-size-xs);font-weight:var(--font-weight-semibold);text-transform:uppercase}.page-shell__main{gap:var(--spacing-16);min-width:0;padding:var(--spacing-16);flex-direction:column;flex:auto;display:flex}.page-shell__toolbar{align-items:center;gap:var(--spacing-12);padding:var(--spacing-12) var(--spacing-16);background-color:var(--card-background-color);border:1px solid var(--card-border-color);border-radius:var(--radius);box-shadow:var(--card-box-shadow);flex-wrap:wrap;display:flex}.page-shell__titles{flex-direction:column;flex:0 auto;min-width:0;max-width:40%;display:flex}.page-shell__title{color:var(--body-title-color);font-family:var(--font-family-display);font-size:var(--font-size-lg);font-weight:var(--font-weight-bold);line-height:var(--line-height-tight);text-overflow:ellipsis;white-space:nowrap;margin:0;overflow:hidden}.page-shell__heading{color:var(--body-color-muted);font-size:var(--font-size-xs);text-overflow:ellipsis;white-space:nowrap;margin:0;overflow:hidden}.page-shell__search{flex:1 1 var(--spacing-100);min-width:var(--spacing-100)}.page-shell__sort{align-items:center;gap:var(--spacing-4);flex:none;display:flex}.page-shell__sort-field{width:var(--spacing-200)}.page-shell__break{flex-basis:100%;height:0}.page-shell__content{gap:var(--spacing-16);flex-direction:column;flex:auto;min-width:0;display:flex}.page-shell__view-choice{gap:var(--spacing-6);flex-direction:column;display:flex}.page-shell__view-choice-label{color:var(--body-color);font-size:var(--font-size-sm)}.page-shell__tabs{gap:var(--spacing-8);flex-wrap:wrap;display:flex}.page-shell--phone .page-shell__tabs{padding:0 var(--spacing-8);flex-wrap:nowrap;overflow-x:auto}.page-shell__status{align-items:center;gap:var(--spacing-12);display:flex}.page-shell__status:empty{display:none}.page-shell__status .page-applied{flex:auto;min-width:0}.page-shell__pager{align-items:center;gap:var(--spacing-4);color:var(--body-color-muted);font-size:var(--font-size-sm);font-variant-numeric:tabular-nums;white-space:nowrap;flex:none;margin-left:auto;display:flex}.page-shell__spacer{flex:auto}.page-shell__badge{min-width:var(--spacing-20);height:var(--spacing-20);padding:0 var(--spacing-6);border-radius:var(--radius-full);background-color:var(--chip-selected-background-color);color:var(--chip-selected-color);font-size:var(--font-size-xs);font-weight:var(--font-weight-semibold);line-height:var(--line-height-none);justify-content:center;align-items:center;display:inline-flex}.page-shell__badge--corner{min-width:var(--spacing-16);height:var(--spacing-16);padding:0 var(--spacing-4);font-size:var(--font-size-xxs);position:absolute;top:0;right:0}.page-shell__link{color:var(--links-color);font:inherit;cursor:pointer;font-size:var(--font-size-sm);font-weight:var(--font-weight-medium);white-space:nowrap;background:0 0;border:0;padding:0}.page-shell__link:hover{color:var(--links-hover-color)}.page-shell__app{color:var(--body-title-color);font:inherit;cursor:pointer;align-items:center;gap:var(--spacing-8);min-width:0;font-size:var(--font-size-md);font-weight:var(--font-weight-bold);cursor:default;background:0 0;border:0;padding:0;display:inline-flex}.page-shell__app--clickable{cursor:pointer}.page-shell__logo{flex:none;display:inline-flex}.page-shell__logo img,.page-shell__logo svg{width:auto;height:var(--spacing-32);max-width:var(--spacing-100);display:block}.page-shell__app-name{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.page-shell__view-option{align-items:center;gap:var(--spacing-4);display:inline-flex}.page-shell--tablet .page-shell__titles{flex:auto;max-width:none}.page-shell__drawer-footer .button{white-space:nowrap;justify-content:center}.page-shell__drawer-footer{gap:var(--spacing-8);width:100%;display:flex}.page-shell__drawer-body{gap:var(--spacing-16);flex-direction:column;display:flex}.page-shell__sheet-stack{gap:var(--spacing-12)}.page-shell--phone{flex-direction:column}.page-shell__topbar{z-index:20;align-items:center;gap:var(--spacing-8);padding:var(--spacing-8) var(--spacing-8) var(--spacing-8) var(--spacing-16);background-color:var(--card-background-color);color:var(--body-color);border-bottom:1px solid var(--card-border-color);display:flex;position:sticky;top:0}.page-shell__icon-button{color:inherit;font:inherit;cursor:pointer;width:var(--spacing-40);height:var(--spacing-40);border-radius:var(--radius);background:0 0;border:0;justify-content:center;align-items:center;padding:0;display:inline-flex;position:relative}.page-shell__search-row,.page-shell--phone .page-applied{padding:var(--spacing-8) var(--spacing-16) 0}.page-shell__result-row{align-items:center;gap:var(--spacing-8);padding:var(--spacing-8) var(--spacing-8) 0 var(--spacing-16);display:flex}.page-shell__result-line{color:var(--body-color-muted);font:inherit;cursor:pointer;align-items:center;gap:var(--spacing-4);min-width:0;font-size:var(--font-size-sm);text-align:left;background:0 0;border:0;padding:0;display:flex}.page-shell__result-line span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.page-shell--phone .page-shell__content{padding:var(--spacing-8) var(--spacing-8) calc(var(--spacing-80) + env(safe-area-inset-bottom,0px))}.page-shell__fab{color:var(--button-info-color);font:inherit;cursor:pointer;right:max(var(--spacing-16), env(safe-area-inset-right,0px));bottom:calc(var(--spacing-16) + env(safe-area-inset-bottom,0px));z-index:30;width:var(--spacing-60);height:var(--spacing-60);border-radius:var(--radius-full);background:0 0;background-color:var(--button-info-background-color);box-shadow:0 var(--spacing-4) var(--spacing-12) var(--box-shadow);border:0;justify-content:center;align-items:center;padding:0;display:flex;position:fixed}.page-shell__fab:disabled{cursor:default;filter:grayscale()}.page-shell--fab-warning .page-shell__fab{background-color:var(--button-warning-background-color);color:var(--button-warning-color)}.page-shell--fab-success .page-shell__fab{background-color:var(--button-success-background-color);color:var(--button-success-color)}.page-shell--fab-danger .page-shell__fab{background-color:var(--button-danger-background-color);color:var(--button-danger-color)}.page-filters{flex-direction:column;display:flex}.page-filters__section,.page-filters__flat{border-top:1px solid var(--delimiter-color)}.page-filters__section:first-child,.page-filters__flat:first-child,.page-filters__flat+.page-filters__flat{border-top:0}.page-filters__flat{padding:var(--spacing-4) 0}.page-filters__header{color:var(--body-color);font:inherit;cursor:pointer;align-items:center;gap:var(--spacing-8);width:100%;padding:0;padding:var(--spacing-12) 0;font-size:var(--font-size-sm);font-weight:var(--font-weight-semibold);text-align:left;background:0 0;border:0;display:flex}.page-filters__label{flex:none}.page-filters__summary{min-width:0;color:var(--body-accent-color);font-size:var(--font-size-xs);font-weight:var(--font-weight-medium);text-align:right;text-overflow:ellipsis;white-space:nowrap;flex:auto;overflow:hidden}.page-filters__spacer{flex:auto}.page-filters__dot{width:var(--spacing-6);height:var(--spacing-6);border-radius:var(--radius-full);background-color:var(--body-accent-color);flex:none}.page-filters__body{padding:0 0 var(--spacing-12)}.page-filters--sheet .page-filters__header{padding:var(--spacing-16) 0;font-size:var(--font-size-md)}.page-applied{align-items:center;gap:var(--spacing-6);flex-wrap:wrap;display:flex}.page-applied--scroll{scrollbar-width:none;flex-wrap:nowrap;overflow-x:auto}.page-applied--scroll::-webkit-scrollbar{display:none}.page-applied--scroll>*{flex:none}.page-applied .chip__label{align-items:center;gap:var(--spacing-4);display:inline-flex}.page-applied__label{white-space:nowrap}.page-sheet{z-index:1100;position:fixed;inset:0}.page-sheet__backdrop{background-color:var(--backdrop-color);position:absolute;inset:0}.page-sheet__panel{max-height:85dvh;padding-bottom:env(safe-area-inset-bottom,0px);background-color:var(--modal-background-color);color:var(--modal-color);border-radius:var(--radius) var(--radius) 0 0;box-shadow:var(--modal-box-shadow);animation:page-sheet-up var(--transition-moderate);flex-direction:column;display:flex;position:absolute;bottom:0;left:0;right:0}.page-sheet__panel--tall{height:92dvh}.page-sheet__grab{width:var(--spacing-40);height:var(--spacing-4);margin:var(--spacing-8) auto 0;border-radius:var(--radius-full);background-color:var(--delimiter-color);flex:none}.page-sheet__header{align-items:center;gap:var(--spacing-8);padding:var(--spacing-8) var(--spacing-16);flex:none;display:flex}.page-sheet__title{color:var(--modal-title-color);font-family:var(--font-family-display);font-size:var(--font-size-lg);font-weight:var(--font-weight-semibold);flex:auto}.page-sheet__body{min-height:0;padding:0 var(--spacing-16) var(--spacing-16);flex:auto;overflow-y:auto}.page-sheet__footer{gap:var(--spacing-8);padding:var(--spacing-12) var(--spacing-16);border-top:1px solid var(--delimiter-color);flex:none;display:flex}.page-sheet__footer .button{justify-content:center}@keyframes page-sheet-up{0%{transform:translateY(100%)}}@media (prefers-reduced-motion:reduce){.page-sheet__panel{animation:none}}.page-shell__side-nav{gap:var(--spacing-2);flex-direction:column;display:flex}.page-shell__nav-row{color:var(--body-color-muted);font:inherit;cursor:pointer;align-items:center;gap:var(--spacing-8);width:100%;padding:0;padding:var(--spacing-8) var(--spacing-12);border-radius:var(--radius);font-size:var(--font-size-sm);font-weight:var(--font-weight-medium);text-align:left;background:0 0;border:0;display:flex}.page-shell__nav-row:hover{background-color:var(--list-hover-background-color);color:var(--body-color)}.page-shell__nav-row--active,.page-shell__nav-row--active:hover{background-color:var(--chip-selected-background-color);color:var(--chip-selected-color)}.page-shell__nav-label{text-overflow:ellipsis;white-space:nowrap;flex:auto;min-width:0;overflow:hidden}.page-shell__nav-count{font-size:var(--font-size-xs);font-variant-numeric:tabular-nums;flex:none}.page-shell__rail{align-items:center;gap:var(--spacing-8);width:var(--spacing-80);height:100vh;padding:var(--spacing-16) var(--spacing-8);background-color:var(--card-background-color);border-right:1px solid var(--card-border-color);flex-direction:column;flex:none;display:flex;position:sticky;top:0}.page-shell__rail-item{color:var(--body-color-muted);font:inherit;cursor:pointer;align-items:center;gap:var(--spacing-4);width:100%;padding:0;padding:var(--spacing-8) var(--spacing-4);border-radius:var(--radius);font-size:var(--font-size-xs);font-weight:var(--font-weight-medium);background:0 0;border:0;flex-direction:column;display:flex}.page-shell__rail-item:hover{background-color:var(--list-hover-background-color);color:var(--body-color)}.page-shell__rail-item--active,.page-shell__rail-item--active:hover{background-color:var(--chip-selected-background-color);color:var(--chip-selected-color)}.page-shell__tabbar{z-index:25;padding-bottom:env(safe-area-inset-bottom,0px);background-color:var(--card-background-color);border-top:1px solid var(--card-border-color);display:flex;position:fixed;bottom:0;left:0;right:0}.page-shell__tab{color:var(--body-color-muted);font:inherit;cursor:pointer;justify-content:center;align-items:center;gap:var(--spacing-2);height:var(--spacing-60);font-size:var(--font-size-xs);font-weight:var(--font-weight-medium);background:0 0;border:0;flex-direction:column;flex:1 1 0;padding:0;display:flex}.page-shell__tab .icon{padding:var(--spacing-2) var(--spacing-16);border-radius:var(--radius-full);transition:background-color var(--transition-fast)}.page-shell__tab--active{color:var(--body-accent-color);font-weight:var(--font-weight-semibold)}.page-shell__tab--active .icon{background-color:var(--chip-selected-background-color);color:var(--chip-selected-color)}.page-shell--with-tabs .page-shell__fab{bottom:calc(var(--spacing-60) + var(--spacing-16) + env(safe-area-inset-bottom,0px))}.page-shell--with-tabs .page-shell__content{padding-bottom:calc(var(--spacing-60) + var(--spacing-80) + env(safe-area-inset-bottom,0px))}.page-shell__nav-group{padding:var(--spacing-12) var(--spacing-12) var(--spacing-4);color:var(--body-color-muted);font-size:var(--font-size-xs);font-weight:var(--font-weight-semibold);text-transform:uppercase}.page-shell__nav-icon{flex:none;display:inline-flex}.page-shell__aside{box-sizing:border-box}.page-shell__aside--docked{width:var(--spacing-400);height:100vh;padding:var(--spacing-16);background-color:var(--card-background-color);border-left:1px solid var(--card-border-color);flex:none;position:sticky;top:0;overflow-y:auto}.page-shell__aside--stacked{padding:0 var(--spacing-16) var(--spacing-16)}.page-shell__footer{z-index:15;padding:var(--spacing-8) var(--spacing-12);background-color:var(--card-background-color);border:1px solid var(--card-border-color);border-radius:var(--radius);box-shadow:0 calc(var(--spacing-4) * -1) var(--spacing-12) var(--box-shadow);position:sticky;bottom:0}.page-shell--phone .page-shell__footer{margin:0 var(--spacing-8)}.page-shell--with-tabs .page-shell__footer{bottom:calc(var(--spacing-60) + env(safe-area-inset-bottom,0px))}.page-shell--focus{flex-direction:column}.page-shell--focus .page-shell__main{width:100%}
|
|
1
|
+
.page-shell{min-height:100vh;color:var(--body-color);display:flex}.page-shell,.page-shell__side,.page-shell__main,.page-shell__rail,.page-shell__toolbar,.page-shell__content{box-sizing:border-box}.page-shell__side{width:var(--spacing-300);gap:var(--spacing-16);height:100vh;padding:var(--spacing-16);background-color:var(--card-background-color);border-right:1px solid var(--card-border-color);flex-direction:column;flex:none;display:flex;position:sticky;top:0;overflow-y:auto}.page-shell__side-group{gap:var(--spacing-8);flex-direction:column;display:flex}.page-shell__side-head{align-items:center;gap:var(--spacing-8);display:flex}.page-shell__group-title{color:var(--body-color-muted);font-size:var(--font-size-xs);font-weight:var(--font-weight-semibold);text-transform:uppercase}.page-shell__main{gap:var(--spacing-16);min-width:0;padding:var(--spacing-16);flex-direction:column;flex:auto;display:flex}.page-shell__toolbar{align-items:center;gap:var(--spacing-12);padding:var(--spacing-12) var(--spacing-16);background-color:var(--card-background-color);border:1px solid var(--card-border-color);border-radius:var(--radius);box-shadow:var(--card-box-shadow);flex-wrap:wrap;display:flex}.page-shell__titles{flex-direction:column;flex:0 auto;min-width:0;max-width:40%;display:flex}.page-shell__title{color:var(--body-title-color);font-family:var(--font-family-display);font-size:var(--font-size-lg);font-weight:var(--font-weight-bold);line-height:var(--line-height-tight);text-overflow:ellipsis;white-space:nowrap;margin:0;overflow:hidden}.page-shell__heading{color:var(--body-color-muted);font-size:var(--font-size-xs);text-overflow:ellipsis;white-space:nowrap;margin:0;overflow:hidden}.page-shell__search{flex:1 1 var(--spacing-100);min-width:var(--spacing-100)}.page-shell__sort{align-items:center;gap:var(--spacing-4);flex:none;display:flex}.page-shell__sort-field{width:var(--spacing-200)}.page-shell__break{flex-basis:100%;height:0}.page-shell__content{gap:var(--spacing-16);flex-direction:column;flex:auto;min-width:0;display:flex}.page-shell__view-choice{gap:var(--spacing-6);flex-direction:column;display:flex}.page-shell__view-choice-label{color:var(--body-color);font-size:var(--font-size-sm)}.page-shell__tabs{gap:var(--spacing-8);flex-wrap:wrap;display:flex}.page-shell--phone .page-shell__tabs{padding:0 var(--spacing-8);flex-wrap:nowrap;overflow-x:auto}.page-shell__status{align-items:center;gap:var(--spacing-12);display:flex}.page-shell__status:empty{display:none}.page-shell__status .page-applied{flex:auto;min-width:0}.page-shell__pager{align-items:center;gap:var(--spacing-4);color:var(--body-color-muted);font-size:var(--font-size-sm);font-variant-numeric:tabular-nums;white-space:nowrap;flex:none;margin-left:auto;display:flex}.page-shell__spacer{flex:auto}.page-shell__badge{min-width:var(--spacing-20);height:var(--spacing-20);padding:0 var(--spacing-6);border-radius:var(--radius-full);background-color:var(--chip-selected-background-color);color:var(--chip-selected-color);font-size:var(--font-size-xs);font-weight:var(--font-weight-semibold);line-height:var(--line-height-none);justify-content:center;align-items:center;display:inline-flex}.page-shell__badge--corner{min-width:var(--spacing-16);height:var(--spacing-16);padding:0 var(--spacing-4);font-size:var(--font-size-xxs);position:absolute;top:0;right:0}.page-shell__link{color:var(--links-color);font:inherit;cursor:pointer;font-size:var(--font-size-sm);font-weight:var(--font-weight-medium);white-space:nowrap;background:0 0;border:0;padding:0}.page-shell__link:hover{color:var(--links-hover-color)}.page-shell__app{color:var(--body-title-color);font:inherit;cursor:pointer;align-items:center;gap:var(--spacing-8);min-width:0;font-size:var(--font-size-md);font-weight:var(--font-weight-bold);cursor:default;background:0 0;border:0;padding:0;display:inline-flex}.page-shell__app--clickable{cursor:pointer}.page-shell__logo{flex:none;display:inline-flex}.page-shell__logo img,.page-shell__logo svg{width:auto;height:var(--spacing-32);max-width:var(--spacing-100);display:block}.page-shell__app-name{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.page-shell__view-option{align-items:center;gap:var(--spacing-4);display:inline-flex}.page-shell--tablet .page-shell__titles{flex:auto;max-width:none}.page-shell__drawer-footer .button{white-space:nowrap;justify-content:center}.page-shell__drawer-footer{gap:var(--spacing-8);width:100%;display:flex}.page-shell__drawer-body{gap:var(--spacing-16);flex-direction:column;display:flex}.page-shell__sheet-stack{gap:var(--spacing-12)}.page-shell--phone{flex-direction:column}.page-shell__topbar{z-index:20;align-items:center;gap:var(--spacing-8);padding:var(--spacing-8) var(--spacing-8) var(--spacing-8) var(--spacing-16);background-color:var(--card-background-color);color:var(--body-color);border-bottom:1px solid var(--card-border-color);display:flex;position:sticky;top:0}.page-shell__icon-button{color:inherit;font:inherit;cursor:pointer;width:var(--spacing-40);height:var(--spacing-40);border-radius:var(--radius);background:0 0;border:0;justify-content:center;align-items:center;padding:0;display:inline-flex;position:relative}.page-shell__search-row,.page-shell--phone .page-applied{padding:var(--spacing-8) var(--spacing-16) 0}.page-shell__result-row{align-items:center;gap:var(--spacing-8);padding:var(--spacing-8) var(--spacing-8) 0 var(--spacing-16);display:flex}.page-shell__result-line{color:var(--body-color-muted);font:inherit;cursor:pointer;align-items:center;gap:var(--spacing-4);min-width:0;font-size:var(--font-size-sm);text-align:left;background:0 0;border:0;padding:0;display:flex}.page-shell__result-line span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.page-shell--phone .page-shell__content{padding:var(--spacing-8) var(--spacing-8) calc(var(--spacing-80) + env(safe-area-inset-bottom,0px))}.page-shell__fab{color:var(--button-info-color);font:inherit;cursor:pointer;right:max(var(--spacing-16), env(safe-area-inset-right,0px));bottom:calc(var(--spacing-16) + env(safe-area-inset-bottom,0px));z-index:30;width:var(--spacing-60);height:var(--spacing-60);border-radius:var(--radius-full);background:0 0;background-color:var(--button-info-background-color);box-shadow:0 var(--spacing-4) var(--spacing-12) var(--box-shadow);border:0;justify-content:center;align-items:center;padding:0;display:flex;position:fixed}.page-shell__fab:disabled{cursor:default;filter:grayscale()}.page-shell--fab-warning .page-shell__fab{background-color:var(--button-warning-background-color);color:var(--button-warning-color)}.page-shell--fab-success .page-shell__fab{background-color:var(--button-success-background-color);color:var(--button-success-color)}.page-shell--fab-danger .page-shell__fab{background-color:var(--button-danger-background-color);color:var(--button-danger-color)}.page-filters{flex-direction:column;display:flex}.page-filters__section,.page-filters__flat{border-top:1px solid var(--delimiter-color)}.page-filters__section:first-child,.page-filters__flat:first-child,.page-filters__flat+.page-filters__flat{border-top:0}.page-filters__flat{padding:var(--spacing-4) 0}.page-filters__header{color:var(--body-color);font:inherit;cursor:pointer;align-items:center;gap:var(--spacing-8);width:100%;padding:0;padding:var(--spacing-12) 0;font-size:var(--font-size-sm);font-weight:var(--font-weight-semibold);text-align:left;background:0 0;border:0;display:flex}.page-filters__label{flex:none}.page-filters__summary{min-width:0;color:var(--body-accent-color);font-size:var(--font-size-xs);font-weight:var(--font-weight-medium);text-align:right;text-overflow:ellipsis;white-space:nowrap;flex:auto;overflow:hidden}.page-filters__spacer{flex:auto}.page-filters__dot{width:var(--spacing-6);height:var(--spacing-6);border-radius:var(--radius-full);background-color:var(--body-accent-color);flex:none}.page-filters__body{padding:0 0 var(--spacing-12)}.page-filters--sheet .page-filters__header{padding:var(--spacing-16) 0;font-size:var(--font-size-md)}.page-applied{align-items:center;gap:var(--spacing-6);flex-wrap:wrap;display:flex}.page-applied--scroll{scrollbar-width:none;flex-wrap:nowrap;overflow-x:auto}.page-applied--scroll::-webkit-scrollbar{display:none}.page-applied--scroll>*{flex:none}.page-applied .chip__label{align-items:center;gap:var(--spacing-4);display:inline-flex}.page-applied__label{white-space:nowrap}.page-sheet{z-index:1100;position:fixed;inset:0}.page-sheet__backdrop{background-color:var(--backdrop-color);position:absolute;inset:0}.page-sheet__panel{max-height:85dvh;padding-bottom:env(safe-area-inset-bottom,0px);background-color:var(--modal-background-color);color:var(--modal-color);border-radius:var(--radius) var(--radius) 0 0;box-shadow:var(--modal-box-shadow);animation:page-sheet-up var(--transition-moderate);flex-direction:column;display:flex;position:absolute;bottom:0;left:0;right:0}.page-sheet__panel--tall{height:92dvh}.page-sheet__grab{width:var(--spacing-40);height:var(--spacing-4);margin:var(--spacing-8) auto 0;border-radius:var(--radius-full);background-color:var(--delimiter-color);flex:none}.page-sheet__header{align-items:center;gap:var(--spacing-8);padding:var(--spacing-8) var(--spacing-16);flex:none;display:flex}.page-sheet__title{color:var(--modal-title-color);font-family:var(--font-family-display);font-size:var(--font-size-lg);font-weight:var(--font-weight-semibold);flex:auto}.page-sheet__body{min-height:0;padding:0 var(--spacing-16) var(--spacing-16);flex:auto;overflow-y:auto}.page-sheet__footer{gap:var(--spacing-8);padding:var(--spacing-12) var(--spacing-16);border-top:1px solid var(--delimiter-color);flex:none;display:flex}.page-sheet__footer .button{justify-content:center}@keyframes page-sheet-up{0%{transform:translateY(100%)}}@media (prefers-reduced-motion:reduce){.page-sheet__panel{animation:none}}.page-shell__side-nav{gap:var(--spacing-8);flex-direction:column;display:flex}.page-shell__nav-list{gap:var(--spacing-2);flex-direction:column;display:flex}.page-shell__nav-empty{padding:var(--spacing-8) var(--spacing-12);color:var(--body-color-muted);font-size:var(--font-size-sm)}.page-shell__nav-row{color:var(--body-color-muted);font:inherit;cursor:pointer;align-items:center;gap:var(--spacing-8);width:100%;padding:0;padding:var(--spacing-8) var(--spacing-12);border-radius:var(--radius);font-size:var(--font-size-sm);font-weight:var(--font-weight-medium);text-align:left;background:0 0;border:0;display:flex}.page-shell__nav-row:hover{background-color:var(--list-hover-background-color);color:var(--body-color)}.page-shell__nav-row--active,.page-shell__nav-row--active:hover{background-color:var(--chip-selected-background-color);color:var(--chip-selected-color)}.page-shell__nav-label{text-overflow:ellipsis;white-space:nowrap;flex:auto;min-width:0;overflow:hidden}.page-shell__nav-count{font-size:var(--font-size-xs);font-variant-numeric:tabular-nums;flex:none}.page-shell__rail{align-items:center;gap:var(--spacing-8);width:var(--spacing-80);height:100vh;padding:var(--spacing-16) var(--spacing-8);background-color:var(--card-background-color);border-right:1px solid var(--card-border-color);flex-direction:column;flex:none;display:flex;position:sticky;top:0}.page-shell__rail-item{color:var(--body-color-muted);font:inherit;cursor:pointer;align-items:center;gap:var(--spacing-4);width:100%;padding:0;padding:var(--spacing-8) var(--spacing-4);border-radius:var(--radius);font-size:var(--font-size-xs);font-weight:var(--font-weight-medium);background:0 0;border:0;flex-direction:column;display:flex}.page-shell__rail-item:hover{background-color:var(--list-hover-background-color);color:var(--body-color)}.page-shell__rail-item--active,.page-shell__rail-item--active:hover{background-color:var(--chip-selected-background-color);color:var(--chip-selected-color)}.page-shell__tabbar{z-index:25;padding-bottom:env(safe-area-inset-bottom,0px);background-color:var(--card-background-color);border-top:1px solid var(--card-border-color);display:flex;position:fixed;bottom:0;left:0;right:0}.page-shell__tab{color:var(--body-color-muted);font:inherit;cursor:pointer;justify-content:center;align-items:center;gap:var(--spacing-2);height:var(--spacing-60);font-size:var(--font-size-xs);font-weight:var(--font-weight-medium);background:0 0;border:0;flex-direction:column;flex:1 1 0;padding:0;display:flex}.page-shell__tab .icon{padding:var(--spacing-2) var(--spacing-16);border-radius:var(--radius-full);transition:background-color var(--transition-fast)}.page-shell__tab--active{color:var(--body-accent-color);font-weight:var(--font-weight-semibold)}.page-shell__tab--active .icon{background-color:var(--chip-selected-background-color);color:var(--chip-selected-color)}.page-shell--with-tabs .page-shell__fab{bottom:calc(var(--spacing-60) + var(--spacing-16) + env(safe-area-inset-bottom,0px))}.page-shell--with-tabs .page-shell__content{padding-bottom:calc(var(--spacing-60) + var(--spacing-80) + env(safe-area-inset-bottom,0px))}.page-shell__nav-group{padding:var(--spacing-12) var(--spacing-12) var(--spacing-4);color:var(--body-color-muted);font-size:var(--font-size-xs);font-weight:var(--font-weight-semibold);text-transform:uppercase}.page-shell__nav-group--toggle{align-items:center;gap:var(--spacing-8);border-radius:var(--radius);text-align:left;cursor:pointer;background:0 0;border:0;width:100%;font-family:inherit;display:flex}.page-shell__nav-group--toggle:hover{color:var(--body-color)}.page-shell__nav-group-label{text-overflow:ellipsis;white-space:nowrap;flex:auto;min-width:0;overflow:hidden}.page-shell__nav-icon{flex:none;display:inline-flex}.page-shell__aside{box-sizing:border-box}.page-shell__aside--docked{width:var(--spacing-400);height:100vh;padding:var(--spacing-16);background-color:var(--card-background-color);border-left:1px solid var(--card-border-color);flex:none;position:sticky;top:0;overflow-y:auto}.page-shell__aside--stacked{padding:0 var(--spacing-16) var(--spacing-16)}.page-shell__footer{z-index:15;padding:var(--spacing-8) var(--spacing-12);background-color:var(--card-background-color);border:1px solid var(--card-border-color);border-radius:var(--radius);box-shadow:0 calc(var(--spacing-4) * -1) var(--spacing-12) var(--box-shadow);position:sticky;bottom:0}.page-shell--phone .page-shell__footer{margin:0 var(--spacing-8)}.page-shell--with-tabs .page-shell__footer{bottom:calc(var(--spacing-60) + env(safe-area-inset-bottom,0px))}.page-shell--focus{flex-direction:column}.page-shell--focus .page-shell__main{width:100%}
|
|
@@ -6,27 +6,27 @@ import { useBreakpoint as G } from "../../hooks/useBreakpoint.js";
|
|
|
6
6
|
import { Drawer as J } from "../Drawer/Drawer2.js";
|
|
7
7
|
import { useAppFrame as K } from "./useAppFrame.js";
|
|
8
8
|
import { countActiveFilters as Q } from "./filterRules.js";
|
|
9
|
-
import { getButtonActions as U, getMenuItems as
|
|
9
|
+
import { getButtonActions as U, getMenuItems as y } from "./menuItems.js";
|
|
10
10
|
import { getHeadingText as X, getResultLabel as Y, hasViewExtras as Z } from "./shellText.js";
|
|
11
|
-
import { ActionButton as N, AppMark as
|
|
11
|
+
import { ActionButton as N, AppMark as I, PageMenu as P, PagePager as $, PageTabsRow as ee, SortDropdown as ae, ViewOptions as T, ViewToggle as se } from "./PageParts.js";
|
|
12
12
|
import { useConfirmedActions as le } from "./useConfirmedActions.js";
|
|
13
13
|
import { NavRail as te, SideNav as ie } from "./AppNav.js";
|
|
14
|
-
import { AppliedFilters as
|
|
14
|
+
import { AppliedFilters as oe, FilterSections as re } from "./FilterSections.js";
|
|
15
15
|
import { WorkbenchPhone as ne } from "./WorkbenchPhone.js";
|
|
16
16
|
import { useState as ce } from "react";
|
|
17
17
|
import { jsx as e, jsxs as s } from "react/jsx-runtime";
|
|
18
18
|
var Me = (i) => {
|
|
19
|
-
const { isMobile: B, isTablet: a } = G(),
|
|
19
|
+
const { isMobile: B, isTablet: a } = G(), t = q(H), l = K(), [D, g] = ce(!1), { primaryAction: p, actions: _, dialog: W } = le(i.primaryAction, i.actions ?? []);
|
|
20
20
|
if (B) return /* @__PURE__ */ e(ne, { ...i });
|
|
21
|
-
const { title: j, counts: b, search:
|
|
22
|
-
}, onClearFilters: n, pagination: R, tabs: V, aside:
|
|
21
|
+
const { title: j, counts: b, search: r, sort: k, view: o, filters: h = [], values: u = {}, onFilterChange: w = () => {
|
|
22
|
+
}, onClearFilters: n, pagination: R, tabs: V, aside: m, footer: C, children: L } = i, A = i.status ?? l?.status, F = X(i, t), E = Y(i, t), d = Q(h, u), f = h.length > 0, x = l?.menuItems ?? [], c = l?.nav ?? [], M = /* @__PURE__ */ e(re, {
|
|
23
23
|
filters: h,
|
|
24
24
|
values: u,
|
|
25
25
|
context: "panel",
|
|
26
26
|
onFilterChange: w
|
|
27
|
-
}),
|
|
27
|
+
}), O = d > 0 && /* @__PURE__ */ e("span", {
|
|
28
28
|
className: "page-shell__badge",
|
|
29
|
-
children:
|
|
29
|
+
children: d
|
|
30
30
|
});
|
|
31
31
|
return /* @__PURE__ */ s("div", {
|
|
32
32
|
className: [
|
|
@@ -38,12 +38,16 @@ var Me = (i) => {
|
|
|
38
38
|
!a && /* @__PURE__ */ s("aside", {
|
|
39
39
|
className: "page-shell__side",
|
|
40
40
|
children: [
|
|
41
|
-
|
|
41
|
+
l && /* @__PURE__ */ e(I, { app: l.app }),
|
|
42
42
|
p && /* @__PURE__ */ e(N, {
|
|
43
43
|
action: p,
|
|
44
44
|
fullWidth: !0
|
|
45
45
|
}),
|
|
46
|
-
c.length > 1 && /* @__PURE__ */ e(ie, {
|
|
46
|
+
c.length > 1 && /* @__PURE__ */ e(ie, {
|
|
47
|
+
nav: c,
|
|
48
|
+
appName: l?.app.name,
|
|
49
|
+
options: l?.navOptions
|
|
50
|
+
}),
|
|
47
51
|
f && /* @__PURE__ */ s("div", {
|
|
48
52
|
className: "page-shell__side-group",
|
|
49
53
|
children: [/* @__PURE__ */ s("div", {
|
|
@@ -51,24 +55,24 @@ var Me = (i) => {
|
|
|
51
55
|
children: [
|
|
52
56
|
/* @__PURE__ */ e("span", {
|
|
53
57
|
className: "page-shell__group-title",
|
|
54
|
-
children:
|
|
58
|
+
children: t.filters
|
|
55
59
|
}),
|
|
56
|
-
|
|
60
|
+
O,
|
|
57
61
|
/* @__PURE__ */ e("span", { className: "page-shell__spacer" }),
|
|
58
|
-
|
|
62
|
+
d > 0 && n && /* @__PURE__ */ e("button", {
|
|
59
63
|
type: "button",
|
|
60
64
|
className: "page-shell__link",
|
|
61
65
|
onClick: n,
|
|
62
|
-
children:
|
|
66
|
+
children: t.pageClearAll
|
|
63
67
|
})
|
|
64
68
|
]
|
|
65
69
|
}), M]
|
|
66
70
|
}),
|
|
67
|
-
|
|
71
|
+
o && /* @__PURE__ */ e(T, { view: o })
|
|
68
72
|
]
|
|
69
73
|
}),
|
|
70
74
|
a && c.length > 1 && /* @__PURE__ */ e(te, {
|
|
71
|
-
app:
|
|
75
|
+
app: l?.app,
|
|
72
76
|
nav: c
|
|
73
77
|
}),
|
|
74
78
|
/* @__PURE__ */ s("div", {
|
|
@@ -81,10 +85,10 @@ var Me = (i) => {
|
|
|
81
85
|
icon: "tune",
|
|
82
86
|
variant: "default",
|
|
83
87
|
onClick: () => g(!0),
|
|
84
|
-
children: [
|
|
88
|
+
children: [t.filters, O]
|
|
85
89
|
}),
|
|
86
|
-
a &&
|
|
87
|
-
app:
|
|
90
|
+
a && l && c.length <= 1 && /* @__PURE__ */ e(I, {
|
|
91
|
+
app: l.app,
|
|
88
92
|
logoOnly: !0
|
|
89
93
|
}),
|
|
90
94
|
/* @__PURE__ */ s("div", {
|
|
@@ -97,29 +101,29 @@ var Me = (i) => {
|
|
|
97
101
|
children: F
|
|
98
102
|
})]
|
|
99
103
|
}),
|
|
100
|
-
(!
|
|
104
|
+
(!r || a) && /* @__PURE__ */ e("span", { className: "page-shell__spacer" }),
|
|
101
105
|
a && p && /* @__PURE__ */ e(N, { action: p }),
|
|
102
106
|
a && A,
|
|
103
|
-
a && /* @__PURE__ */ e(P, { items:
|
|
107
|
+
a && /* @__PURE__ */ e(P, { items: y(_, x, !0) }),
|
|
104
108
|
a && /* @__PURE__ */ e("span", { className: "page-shell__break" }),
|
|
105
|
-
|
|
109
|
+
r && /* @__PURE__ */ e(z, {
|
|
106
110
|
className: "page-shell__search",
|
|
107
|
-
value:
|
|
108
|
-
placeholder:
|
|
109
|
-
autoFocus:
|
|
110
|
-
onChange:
|
|
111
|
+
value: r.value,
|
|
112
|
+
placeholder: r.placeholder ?? t.search,
|
|
113
|
+
autoFocus: r.autoFocus,
|
|
114
|
+
onChange: r.onChange
|
|
111
115
|
}),
|
|
112
116
|
k && /* @__PURE__ */ e(ae, { sort: k }),
|
|
113
|
-
a &&
|
|
114
|
-
!a && U(_).map((
|
|
117
|
+
a && o && /* @__PURE__ */ e(se, { view: o }),
|
|
118
|
+
!a && U(_).map((S) => /* @__PURE__ */ e(N, { action: S }, S.id)),
|
|
115
119
|
!a && A,
|
|
116
|
-
!a && /* @__PURE__ */ e(P, { items:
|
|
120
|
+
!a && /* @__PURE__ */ e(P, { items: y(_, x, !1) })
|
|
117
121
|
]
|
|
118
122
|
}),
|
|
119
123
|
/* @__PURE__ */ e(ee, { tabs: V }),
|
|
120
124
|
/* @__PURE__ */ s("div", {
|
|
121
125
|
className: "page-shell__status",
|
|
122
|
-
children: [/* @__PURE__ */ e(
|
|
126
|
+
children: [/* @__PURE__ */ e(oe, {
|
|
123
127
|
filters: h,
|
|
124
128
|
values: u,
|
|
125
129
|
onFilterChange: w,
|
|
@@ -130,9 +134,9 @@ var Me = (i) => {
|
|
|
130
134
|
className: "page-shell__content",
|
|
131
135
|
children: L
|
|
132
136
|
}),
|
|
133
|
-
a &&
|
|
137
|
+
a && m && /* @__PURE__ */ e("div", {
|
|
134
138
|
className: "page-shell__aside page-shell__aside--stacked",
|
|
135
|
-
children:
|
|
139
|
+
children: m
|
|
136
140
|
}),
|
|
137
141
|
C && /* @__PURE__ */ e("div", {
|
|
138
142
|
className: "page-shell__footer",
|
|
@@ -140,21 +144,21 @@ var Me = (i) => {
|
|
|
140
144
|
})
|
|
141
145
|
]
|
|
142
146
|
}),
|
|
143
|
-
!a &&
|
|
147
|
+
!a && m && /* @__PURE__ */ e("aside", {
|
|
144
148
|
className: "page-shell__aside page-shell__aside--docked",
|
|
145
|
-
children:
|
|
149
|
+
children: m
|
|
146
150
|
}),
|
|
147
151
|
a && f && /* @__PURE__ */ e(J, {
|
|
148
152
|
isOpen: D,
|
|
149
153
|
onClose: () => g(!1),
|
|
150
154
|
position: "left",
|
|
151
|
-
title:
|
|
155
|
+
title: t.filters,
|
|
152
156
|
footer: /* @__PURE__ */ s("div", {
|
|
153
157
|
className: "page-shell__drawer-footer",
|
|
154
|
-
children: [
|
|
158
|
+
children: [d > 0 && n && /* @__PURE__ */ e(v, {
|
|
155
159
|
variant: "default",
|
|
156
160
|
onClick: n,
|
|
157
|
-
children:
|
|
161
|
+
children: t.pageClearAll
|
|
158
162
|
}), b && /* @__PURE__ */ e(v, {
|
|
159
163
|
variant: "info",
|
|
160
164
|
fullWidth: !0,
|
|
@@ -164,8 +168,8 @@ var Me = (i) => {
|
|
|
164
168
|
}),
|
|
165
169
|
children: /* @__PURE__ */ s("div", {
|
|
166
170
|
className: "page-shell__drawer-body",
|
|
167
|
-
children: [M,
|
|
168
|
-
view:
|
|
171
|
+
children: [M, o && Z(o) && /* @__PURE__ */ e(T, {
|
|
172
|
+
view: o,
|
|
169
173
|
showToggle: !1
|
|
170
174
|
})]
|
|
171
175
|
})
|
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
import { ThemeContext as
|
|
2
|
-
import { Tooltip as
|
|
1
|
+
import { DEFAULT_FALLBACK_THEME as F, ThemeContext as R } from "./ThemeContextValue.js";
|
|
2
|
+
import { Tooltip as j } from "../Tooltip/Tooltip2.js";
|
|
3
3
|
import { THEME_CONFIGS as c, getThemeConfig as k } from "./themeConfig.js";
|
|
4
|
-
import { useCallback as m, useEffect as I, useState as
|
|
5
|
-
import { jsx as f, jsxs as
|
|
6
|
-
var
|
|
7
|
-
const [d, l] =
|
|
4
|
+
import { useCallback as m, useEffect as I, useState as E } from "react";
|
|
5
|
+
import { jsx as f, jsxs as v } from "react/jsx-runtime";
|
|
6
|
+
var L = "theme-stylesheet", b = "theme-font-link", w = "theme-font-link-display", C = "theme-font-link-mono", J = ({ children: M, theme: y, effects: N, onSave: g, allowedThemes: s, fallbackTheme: D = F }) => {
|
|
7
|
+
const [d, l] = E(null), [P, a] = E(null), [S, T] = E(!1), U = k(y) === void 0 ? D : y, o = d ?? U, p = P ?? N;
|
|
8
8
|
I(() => {
|
|
9
9
|
document.documentElement.setAttribute("data-theme", o);
|
|
10
10
|
const i = (typeof __MEMOBIT_THEME_URLS__ > "u" ? void 0 : __MEMOBIT_THEME_URLS__)?.[o];
|
|
11
11
|
if (i !== void 0) {
|
|
12
|
-
let e = document.getElementById(
|
|
13
|
-
e || (e = document.createElement("link"), e.id =
|
|
12
|
+
let e = document.getElementById(L);
|
|
13
|
+
e || (e = document.createElement("link"), e.id = L, e.rel = "stylesheet", document.head.appendChild(e));
|
|
14
14
|
const t = new URL(i, import.meta.url).href;
|
|
15
15
|
e.href !== t && (e.href = t);
|
|
16
16
|
}
|
|
17
17
|
const r = k(o);
|
|
18
18
|
if (r) {
|
|
19
|
-
let e = document.getElementById(
|
|
20
|
-
e || (e = document.createElement("link"), e.id =
|
|
21
|
-
let t = document.getElementById(
|
|
22
|
-
r.fontUrlDisplay ? (t || (t = document.createElement("link"), t.id =
|
|
19
|
+
let e = document.getElementById(b);
|
|
20
|
+
e || (e = document.createElement("link"), e.id = b, e.rel = "stylesheet", document.head.appendChild(e)), e.href = r.fontUrl;
|
|
21
|
+
let t = document.getElementById(w);
|
|
22
|
+
r.fontUrlDisplay ? (t || (t = document.createElement("link"), t.id = w, t.rel = "stylesheet", document.head.appendChild(t)), t.href = r.fontUrlDisplay) : t?.remove();
|
|
23
23
|
let n = document.getElementById(C);
|
|
24
24
|
r.fontUrlMono ? (n || (n = document.createElement("link"), n.id = C, n.rel = "stylesheet", document.head.appendChild(n)), n.href = r.fontUrlMono) : n?.remove();
|
|
25
25
|
}
|
|
26
26
|
}, [o]);
|
|
27
|
-
const
|
|
27
|
+
const O = m((i) => {
|
|
28
28
|
l(i);
|
|
29
29
|
}, []), K = m((i) => {
|
|
30
30
|
a(i);
|
|
31
|
-
}, []),
|
|
31
|
+
}, []), A = m(() => {
|
|
32
32
|
l(null), a(null);
|
|
33
33
|
}, []);
|
|
34
34
|
I(() => {
|
|
@@ -42,8 +42,8 @@ var b = "theme-stylesheet", w = "theme-font-link", L = "theme-font-link-display"
|
|
|
42
42
|
e.preventDefault();
|
|
43
43
|
const t = c.map((u) => u.value), n = s && s.length > 0 ? t.filter((u) => s.includes(u)) : t;
|
|
44
44
|
if (n.length === 0) return;
|
|
45
|
-
const _ = n.indexOf(o),
|
|
46
|
-
l(n[
|
|
45
|
+
const _ = n.indexOf(o), H = ((_ === -1 ? 0 : _) + (e.key === "]" ? 1 : -1) + n.length) % n.length;
|
|
46
|
+
l(n[H]);
|
|
47
47
|
} else e.key === "Escape" && d && (e.preventDefault(), l(null), a(null));
|
|
48
48
|
};
|
|
49
49
|
return window.addEventListener("keydown", r), () => window.removeEventListener("keydown", r);
|
|
@@ -52,7 +52,7 @@ var b = "theme-stylesheet", w = "theme-font-link", L = "theme-font-link-display"
|
|
|
52
52
|
d,
|
|
53
53
|
s
|
|
54
54
|
]);
|
|
55
|
-
const h = c.findIndex((i) => i.value === o), x = h >= 0 ? c[h].label : o,
|
|
55
|
+
const h = c.findIndex((i) => i.value === o), x = h >= 0 ? c[h].label : o, B = m(() => {
|
|
56
56
|
g?.({
|
|
57
57
|
theme: o,
|
|
58
58
|
effects: p
|
|
@@ -62,16 +62,16 @@ var b = "theme-stylesheet", w = "theme-font-link", L = "theme-font-link-display"
|
|
|
62
62
|
p,
|
|
63
63
|
g
|
|
64
64
|
]);
|
|
65
|
-
return /* @__PURE__ */
|
|
65
|
+
return /* @__PURE__ */ v(R.Provider, {
|
|
66
66
|
value: {
|
|
67
67
|
theme: o,
|
|
68
68
|
effects: p,
|
|
69
|
-
setPreviewTheme:
|
|
69
|
+
setPreviewTheme: O,
|
|
70
70
|
setPreviewEffects: K,
|
|
71
|
-
commitPreview:
|
|
72
|
-
clearPreview:
|
|
71
|
+
commitPreview: B,
|
|
72
|
+
clearPreview: A
|
|
73
73
|
},
|
|
74
|
-
children: [M, d && /* @__PURE__ */
|
|
74
|
+
children: [M, d && /* @__PURE__ */ v("div", {
|
|
75
75
|
style: {
|
|
76
76
|
position: "fixed",
|
|
77
77
|
bottom: 16,
|
|
@@ -85,7 +85,7 @@ var b = "theme-stylesheet", w = "theme-font-link", L = "theme-font-link-display"
|
|
|
85
85
|
boxShadow: "0 4px 16px rgba(0, 0, 0, 0.3)"
|
|
86
86
|
},
|
|
87
87
|
children: [
|
|
88
|
-
/* @__PURE__ */ f(
|
|
88
|
+
/* @__PURE__ */ f(j, {
|
|
89
89
|
title: "Copy theme name",
|
|
90
90
|
children: /* @__PURE__ */ f("span", {
|
|
91
91
|
onClick: () => {
|
|
@@ -95,7 +95,7 @@ var b = "theme-stylesheet", w = "theme-font-link", L = "theme-font-link-display"
|
|
|
95
95
|
children: x
|
|
96
96
|
})
|
|
97
97
|
}),
|
|
98
|
-
/* @__PURE__ */
|
|
98
|
+
/* @__PURE__ */ v("span", {
|
|
99
99
|
style: {
|
|
100
100
|
opacity: 0.6,
|
|
101
101
|
marginLeft: 8,
|
|
@@ -116,7 +116,7 @@ var b = "theme-stylesheet", w = "theme-font-link", L = "theme-font-link-display"
|
|
|
116
116
|
},
|
|
117
117
|
children: "[ prev · ] next · Esc revert"
|
|
118
118
|
}),
|
|
119
|
-
|
|
119
|
+
S && /* @__PURE__ */ f("div", {
|
|
120
120
|
style: {
|
|
121
121
|
position: "absolute",
|
|
122
122
|
bottom: "calc(100% + 6px)",
|
|
@@ -136,5 +136,5 @@ var b = "theme-stylesheet", w = "theme-font-link", L = "theme-font-link-display"
|
|
|
136
136
|
});
|
|
137
137
|
};
|
|
138
138
|
export {
|
|
139
|
-
|
|
139
|
+
J as ThemeProvider
|
|
140
140
|
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { DEFAULT_FALLBACK_THEME as a } from "./ThemeContextValue.js";
|
|
2
|
+
import { THEME_CONFIGS as n } from "./themeConfig.js";
|
|
3
|
+
var A = (o, r = a) => {
|
|
4
|
+
const m = o.trim().toLowerCase(), e = n.find((t) => (t.recommendedApps ?? []).some((p) => p.toLowerCase() === m));
|
|
4
5
|
return e ? e.value : r;
|
|
5
6
|
};
|
|
6
7
|
export {
|
|
7
|
-
|
|
8
|
+
A as getDefaultThemeForApp
|
|
8
9
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -22,6 +22,7 @@ import { RefObject } from 'react';
|
|
|
22
22
|
import { SyntheticEvent } from 'react';
|
|
23
23
|
import { THEME_CONFIGS } from '@memobit/themes';
|
|
24
24
|
import { ThemeConfig } from '@memobit/themes';
|
|
25
|
+
import { ThemeName } from '@memobit/themes';
|
|
25
26
|
import { TouchEvent as TouchEvent_2 } from 'react';
|
|
26
27
|
|
|
27
28
|
export declare const Accordion: default_2.FC<AccordionProps>;
|
|
@@ -165,6 +166,8 @@ export declare interface AppFrameProps {
|
|
|
165
166
|
app: AppIdentity;
|
|
166
167
|
/** The app's sections. With react-router, RouterAppFrame from '@memobit/libs/router' builds these from paths. */
|
|
167
168
|
nav?: AppNavItem[];
|
|
169
|
+
/** Search and folding groups for the desktop side list. */
|
|
170
|
+
navOptions?: AppNavOptions;
|
|
168
171
|
/** Adds the account menu (theme, password, two-factor, logout) and mounts the dialogs it opens. Needs an AuthProvider above. */
|
|
169
172
|
account?: UseAccountMenuOptions;
|
|
170
173
|
/** For apps without sign-in: adds just the Theme entry and its dialog. `account` already includes it. */
|
|
@@ -225,6 +228,14 @@ export declare interface AppNavItem {
|
|
|
225
228
|
onSelect: () => void;
|
|
226
229
|
}
|
|
227
230
|
|
|
231
|
+
/** Extras for the desktop side list, for apps with many sections. */
|
|
232
|
+
export declare interface AppNavOptions {
|
|
233
|
+
/** Shows a box above the side list that narrows the sections by label or group; the text is its placeholder. */
|
|
234
|
+
search?: string;
|
|
235
|
+
/** Lets each group heading fold its sections away; remembered per app. A folded group still shows its current section. */
|
|
236
|
+
collapsibleGroups?: boolean;
|
|
237
|
+
}
|
|
238
|
+
|
|
228
239
|
export declare interface AppPersistenceDefaults<TPages, TTheme> {
|
|
229
240
|
pages?: TPages;
|
|
230
241
|
theme: TTheme;
|
|
@@ -1346,7 +1357,7 @@ export declare interface DataViewProps<T> {
|
|
|
1346
1357
|
totalItems?: number;
|
|
1347
1358
|
/** Group rows by a key. Rows render in group sections within the paginated slice. */
|
|
1348
1359
|
group?: DataViewGroupConfig<T>;
|
|
1349
|
-
/** Display the "Showing X-Y of Z" results-count label above the data.
|
|
1360
|
+
/** Display the "Showing X-Y of Z" results-count label above the data. When unset, it appears only if the list needs more than one page. `true` and `false` always show or always hide it. */
|
|
1350
1361
|
showResultsCount?: boolean;
|
|
1351
1362
|
/** Unfiltered total used to render the "filtered (... total)" form when smaller than this value. Defaults to `data.length`. */
|
|
1352
1363
|
totalCount?: number;
|
|
@@ -3912,7 +3923,7 @@ export declare interface TextFilterValue {
|
|
|
3912
3923
|
mode?: string;
|
|
3913
3924
|
}
|
|
3914
3925
|
|
|
3915
|
-
export declare type Theme =
|
|
3926
|
+
export declare type Theme = ThemeName;
|
|
3916
3927
|
|
|
3917
3928
|
export { THEME_CONFIGS }
|
|
3918
3929
|
|
package/dist/router.d.ts
CHANGED
|
@@ -13,6 +13,8 @@ declare interface AppFrameProps {
|
|
|
13
13
|
app: AppIdentity;
|
|
14
14
|
/** The app's sections. With react-router, RouterAppFrame from '@memobit/libs/router' builds these from paths. */
|
|
15
15
|
nav?: AppNavItem[];
|
|
16
|
+
/** Search and folding groups for the desktop side list. */
|
|
17
|
+
navOptions?: AppNavOptions;
|
|
16
18
|
/** Adds the account menu (theme, password, two-factor, logout) and mounts the dialogs it opens. Needs an AuthProvider above. */
|
|
17
19
|
account?: UseAccountMenuOptions;
|
|
18
20
|
/** For apps without sign-in: adds just the Theme entry and its dialog. `account` already includes it. */
|
|
@@ -53,6 +55,14 @@ declare interface AppNavItem {
|
|
|
53
55
|
onSelect: () => void;
|
|
54
56
|
}
|
|
55
57
|
|
|
58
|
+
/** Extras for the desktop side list, for apps with many sections. */
|
|
59
|
+
declare interface AppNavOptions {
|
|
60
|
+
/** Shows a box above the side list that narrows the sections by label or group; the text is its placeholder. */
|
|
61
|
+
search?: string;
|
|
62
|
+
/** Lets each group heading fold its sections away; remembered per app. A folded group still shows its current section. */
|
|
63
|
+
collapsibleGroups?: boolean;
|
|
64
|
+
}
|
|
65
|
+
|
|
56
66
|
export declare interface AppRouteNavItem {
|
|
57
67
|
path: string;
|
|
58
68
|
label: string;
|
package/dist/version.js
CHANGED
package/dist/version.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memobit/libs",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.1.0",
|
|
4
4
|
"description": "React component library powering the Memobit apps — 100+ components, helpers and hooks. Icons ship as @memobit/icons and themes as @memobit/themes. TypeScript-first, ESM-only, React 19.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"react",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"peerDependencies": {
|
|
87
87
|
"@memobit/core": "1.0.0",
|
|
88
88
|
"@memobit/icons": "^1.7.0",
|
|
89
|
-
"@memobit/themes": "^
|
|
89
|
+
"@memobit/themes": "^3.0.0",
|
|
90
90
|
"react": "19.3.0",
|
|
91
91
|
"react-dom": "19.3.0",
|
|
92
92
|
"react-router": "8.4.0"
|
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
"fast-uri@3": "3.1.9",
|
|
140
140
|
"immutable": "5.1.9",
|
|
141
141
|
"js-yaml": "4.3.2",
|
|
142
|
-
"minimatch@10": "
|
|
142
|
+
"minimatch@10": "11.0.5",
|
|
143
143
|
"nanoid@3": "3.3.18",
|
|
144
144
|
"picomatch@2": "2.3.2",
|
|
145
145
|
"postcss": "8.5.28",
|