@memobit/libs 3.29.0 → 3.30.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/PageShell/AppFrame.js +21 -16
- package/dist/components/PageShell/AppNav.js +55 -0
- package/dist/components/PageShell/PageParts.js +186 -127
- package/dist/components/PageShell/PageShell.css +1 -1
- package/dist/components/PageShell/WorkbenchPhone.js +74 -71
- package/dist/components/PageShell/WorkbenchShell.js +71 -65
- package/dist/components/PageShell/menuItems.js +11 -3
- package/dist/components/RouterAppFrame/RouterAppFrame.js +37 -0
- package/dist/components/ScrollToTop/ScrollToTop.css +1 -1
- package/dist/contexts/LanguageContext/libMessages.js +2 -0
- package/dist/helpers/VersionInfo.js +1 -1
- package/dist/index.d.ts +36 -0
- package/dist/router.d.ts +68 -0
- package/dist/router.js +4 -2
- package/dist/version.js +2 -2
- package/dist/version.json +4 -4
- package/package.json +1 -1
|
@@ -1,139 +1,142 @@
|
|
|
1
|
-
import { Icon as
|
|
2
|
-
import { libMessages as
|
|
3
|
-
import { useMessages as
|
|
4
|
-
import { Button as
|
|
5
|
-
import { InputSearch as
|
|
6
|
-
import { useAppFrame as
|
|
7
|
-
import { countActiveFilters as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import { Icon as v } from "../Icon/Icon2.js";
|
|
2
|
+
import { libMessages as j } from "../../contexts/LanguageContext/libMessages.js";
|
|
3
|
+
import { useMessages as L } from "../../hooks/useLanguage.js";
|
|
4
|
+
import { Button as N } from "../Button/Button2.js";
|
|
5
|
+
import { InputSearch as P } from "../InputSearch/InputSearch2.js";
|
|
6
|
+
import { useAppFrame as T } from "./useAppFrame.js";
|
|
7
|
+
import { countActiveFilters as z } from "./filterRules.js";
|
|
8
|
+
import { getHeadingText as O, getResultLabel as W } from "./shellText.js";
|
|
9
|
+
import { AppMark as D, PageMenu as V, PagePager as H, SortSheetBody as R } from "./PageParts.js";
|
|
10
|
+
import { TabBar as $ } from "./AppNav.js";
|
|
11
|
+
import { AppliedFilters as q, FilterSections as E } from "./FilterSections.js";
|
|
12
|
+
import { getMenuItems as G, navToMenuItems as J } from "./menuItems.js";
|
|
13
|
+
import { BottomSheet as w } from "./BottomSheet.js";
|
|
14
|
+
import { useCallback as K, useState as Q } from "react";
|
|
15
|
+
import { jsx as e, jsxs as o } from "react/jsx-runtime";
|
|
16
|
+
var pe = (h) => {
|
|
17
|
+
const { title: S, counts: p, primaryAction: l, actions: A = [], search: n, sort: a, view: m, filters: s = [], values: d = {}, onFilterChange: C = () => {
|
|
18
|
+
}, onClearFilters: u, pagination: g, children: y } = h, t = L(j), r = T(), [k, f] = Q(null), i = K(() => f(null), []), b = z(s, d), B = W(h, t), F = a?.fields.find((x) => x.value === a.value.field)?.label, I = [O(h, t), F].filter(Boolean).join(" · "), c = r?.nav ?? [], _ = c.length > 1 && c.length <= 5, M = [..._ ? [] : J(c), ...G(A, r?.menuItems ?? [], !0)];
|
|
19
|
+
return /* @__PURE__ */ o("div", {
|
|
19
20
|
className: [
|
|
20
21
|
"page-shell",
|
|
21
22
|
"page-shell--workbench",
|
|
22
23
|
"page-shell--phone",
|
|
23
|
-
|
|
24
|
+
_ ? "page-shell--with-tabs" : "",
|
|
25
|
+
l?.variant ? `page-shell--fab-${l.variant}` : ""
|
|
24
26
|
].filter(Boolean).join(" "),
|
|
25
27
|
children: [
|
|
26
|
-
/* @__PURE__ */
|
|
28
|
+
/* @__PURE__ */ o("header", {
|
|
27
29
|
className: "page-shell__topbar",
|
|
28
30
|
children: [
|
|
29
|
-
|
|
30
|
-
app:
|
|
31
|
+
r && /* @__PURE__ */ e(D, {
|
|
32
|
+
app: r.app,
|
|
31
33
|
logoOnly: !0
|
|
32
34
|
}),
|
|
33
35
|
/* @__PURE__ */ e("h1", {
|
|
34
36
|
className: "page-shell__title",
|
|
35
|
-
children:
|
|
37
|
+
children: S
|
|
36
38
|
}),
|
|
37
39
|
/* @__PURE__ */ e("span", { className: "page-shell__spacer" }),
|
|
38
|
-
s.length > 0 && /* @__PURE__ */
|
|
40
|
+
s.length > 0 && /* @__PURE__ */ o("button", {
|
|
39
41
|
type: "button",
|
|
40
42
|
className: "page-shell__icon-button",
|
|
41
|
-
onClick: () =>
|
|
42
|
-
children: [/* @__PURE__ */ e(
|
|
43
|
+
onClick: () => f("filters"),
|
|
44
|
+
children: [/* @__PURE__ */ e(v, {
|
|
43
45
|
name: "tune",
|
|
44
46
|
size: "md"
|
|
45
|
-
}),
|
|
47
|
+
}), b > 0 && /* @__PURE__ */ e("span", {
|
|
46
48
|
className: "page-shell__badge page-shell__badge--corner",
|
|
47
|
-
children:
|
|
49
|
+
children: b
|
|
48
50
|
})]
|
|
49
51
|
}),
|
|
50
|
-
/* @__PURE__ */ e(
|
|
52
|
+
/* @__PURE__ */ e(V, { items: M })
|
|
51
53
|
]
|
|
52
54
|
}),
|
|
53
55
|
n && /* @__PURE__ */ e("div", {
|
|
54
56
|
className: "page-shell__search-row",
|
|
55
|
-
children: /* @__PURE__ */ e(
|
|
57
|
+
children: /* @__PURE__ */ e(P, {
|
|
56
58
|
value: n.value,
|
|
57
|
-
placeholder: n.placeholder ??
|
|
59
|
+
placeholder: n.placeholder ?? t.search,
|
|
58
60
|
onChange: n.onChange
|
|
59
61
|
})
|
|
60
62
|
}),
|
|
61
|
-
/* @__PURE__ */ e(
|
|
63
|
+
/* @__PURE__ */ e(q, {
|
|
62
64
|
filters: s,
|
|
63
|
-
values:
|
|
64
|
-
onFilterChange:
|
|
65
|
-
onClearFilters:
|
|
65
|
+
values: d,
|
|
66
|
+
onFilterChange: C,
|
|
67
|
+
onClearFilters: u,
|
|
66
68
|
scroll: !0
|
|
67
69
|
}),
|
|
68
|
-
(
|
|
70
|
+
(a || m || g && g.pageCount > 1) && /* @__PURE__ */ o("div", {
|
|
69
71
|
className: "page-shell__result-row",
|
|
70
|
-
children: [(
|
|
72
|
+
children: [(a || m) && /* @__PURE__ */ o("button", {
|
|
71
73
|
type: "button",
|
|
72
74
|
className: "page-shell__result-line",
|
|
73
|
-
onClick: () =>
|
|
74
|
-
children: [/* @__PURE__ */ e("span", { children:
|
|
75
|
+
onClick: () => f("sort"),
|
|
76
|
+
children: [/* @__PURE__ */ e("span", { children: I || t.pageSortAndView }), /* @__PURE__ */ e(v, {
|
|
75
77
|
name: "caret-down",
|
|
76
78
|
size: "sm"
|
|
77
79
|
})]
|
|
78
|
-
}), /* @__PURE__ */ e(
|
|
80
|
+
}), /* @__PURE__ */ e(H, { pagination: g })]
|
|
79
81
|
}),
|
|
80
82
|
/* @__PURE__ */ e("div", {
|
|
81
83
|
className: "page-shell__content",
|
|
82
|
-
children:
|
|
84
|
+
children: y
|
|
83
85
|
}),
|
|
84
|
-
|
|
86
|
+
l && /* @__PURE__ */ e("button", {
|
|
85
87
|
type: "button",
|
|
86
88
|
className: "page-shell__fab",
|
|
87
|
-
disabled:
|
|
88
|
-
onClick:
|
|
89
|
-
children: /* @__PURE__ */ e(
|
|
90
|
-
name:
|
|
89
|
+
disabled: l.disabled,
|
|
90
|
+
onClick: l.onClick,
|
|
91
|
+
children: /* @__PURE__ */ e(v, {
|
|
92
|
+
name: l.icon ?? "plus",
|
|
91
93
|
size: "lg"
|
|
92
94
|
})
|
|
93
95
|
}),
|
|
94
|
-
/* @__PURE__ */ e(
|
|
95
|
-
|
|
96
|
+
_ && /* @__PURE__ */ e($, { nav: c }),
|
|
97
|
+
/* @__PURE__ */ e(w, {
|
|
98
|
+
isOpen: k === "filters",
|
|
96
99
|
tall: !0,
|
|
97
|
-
title:
|
|
98
|
-
onClose:
|
|
99
|
-
end:
|
|
100
|
+
title: t.filters,
|
|
101
|
+
onClose: i,
|
|
102
|
+
end: b > 0 && u ? /* @__PURE__ */ e("button", {
|
|
100
103
|
type: "button",
|
|
101
104
|
className: "page-shell__link",
|
|
102
|
-
onClick:
|
|
103
|
-
children:
|
|
105
|
+
onClick: u,
|
|
106
|
+
children: t.pageClearAll
|
|
104
107
|
}) : void 0,
|
|
105
|
-
footer: /* @__PURE__ */ e(
|
|
108
|
+
footer: /* @__PURE__ */ e(N, {
|
|
106
109
|
variant: "info",
|
|
107
110
|
fullWidth: !0,
|
|
108
|
-
disabled:
|
|
109
|
-
onClick:
|
|
110
|
-
children:
|
|
111
|
+
disabled: p?.shown === 0,
|
|
112
|
+
onClick: i,
|
|
113
|
+
children: p ? B(p.shown) : t.pageDone
|
|
111
114
|
}),
|
|
112
|
-
children: /* @__PURE__ */ e(
|
|
115
|
+
children: /* @__PURE__ */ e(E, {
|
|
113
116
|
filters: s,
|
|
114
|
-
values:
|
|
117
|
+
values: d,
|
|
115
118
|
context: "sheet",
|
|
116
|
-
onFilterChange:
|
|
119
|
+
onFilterChange: C
|
|
117
120
|
})
|
|
118
121
|
}),
|
|
119
|
-
/* @__PURE__ */ e(
|
|
120
|
-
isOpen:
|
|
121
|
-
title:
|
|
122
|
-
onClose:
|
|
123
|
-
footer: /* @__PURE__ */ e(
|
|
122
|
+
/* @__PURE__ */ e(w, {
|
|
123
|
+
isOpen: k === "sort",
|
|
124
|
+
title: t.pageSortAndView,
|
|
125
|
+
onClose: i,
|
|
126
|
+
footer: /* @__PURE__ */ e(N, {
|
|
124
127
|
variant: "info",
|
|
125
128
|
fullWidth: !0,
|
|
126
|
-
onClick:
|
|
127
|
-
children:
|
|
129
|
+
onClick: i,
|
|
130
|
+
children: t.pageDone
|
|
128
131
|
}),
|
|
129
|
-
children: /* @__PURE__ */ e(
|
|
130
|
-
sort:
|
|
131
|
-
view:
|
|
132
|
+
children: /* @__PURE__ */ e(R, {
|
|
133
|
+
sort: a,
|
|
134
|
+
view: m
|
|
132
135
|
})
|
|
133
136
|
})
|
|
134
137
|
]
|
|
135
138
|
});
|
|
136
139
|
};
|
|
137
140
|
export {
|
|
138
|
-
|
|
141
|
+
pe as WorkbenchPhone
|
|
139
142
|
};
|
|
@@ -1,30 +1,31 @@
|
|
|
1
|
-
import { libMessages as
|
|
2
|
-
import { useMessages as
|
|
1
|
+
import { libMessages as V } from "../../contexts/LanguageContext/libMessages.js";
|
|
2
|
+
import { useMessages as L } from "../../hooks/useLanguage.js";
|
|
3
3
|
import { Button as _ } from "../Button/Button2.js";
|
|
4
|
-
import { InputSearch as
|
|
5
|
-
import { useBreakpoint as
|
|
6
|
-
import { Drawer as
|
|
7
|
-
import { useAppFrame as
|
|
8
|
-
import { countActiveFilters as
|
|
9
|
-
import { AppliedFilters as q, FilterSections as z } from "./FilterSections.js";
|
|
10
|
-
import { toMenuItems as E } from "./menuItems.js";
|
|
4
|
+
import { InputSearch as R } from "../InputSearch/InputSearch2.js";
|
|
5
|
+
import { useBreakpoint as E } from "../../hooks/useBreakpoint.js";
|
|
6
|
+
import { Drawer as H } from "../Drawer/Drawer2.js";
|
|
7
|
+
import { useAppFrame as q } from "./useAppFrame.js";
|
|
8
|
+
import { countActiveFilters as z } from "./filterRules.js";
|
|
11
9
|
import { getHeadingText as G, getResultLabel as J } from "./shellText.js";
|
|
12
|
-
import { ActionButton as
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
10
|
+
import { ActionButton as v, AppMark as B, PageMenu as M, PagePager as K, SortDropdown as Q, ViewOptions as S, ViewToggle as U } from "./PageParts.js";
|
|
11
|
+
import { NavRail as X, SideNav as Y } from "./AppNav.js";
|
|
12
|
+
import { AppliedFilters as Z, FilterSections as $ } from "./FilterSections.js";
|
|
13
|
+
import { getButtonActions as ee, getMenuItems as y } from "./menuItems.js";
|
|
14
|
+
import { WorkbenchPhone as le } from "./WorkbenchPhone.js";
|
|
15
|
+
import { useState as ae } from "react";
|
|
15
16
|
import { jsx as e, jsxs as a } from "react/jsx-runtime";
|
|
16
|
-
var
|
|
17
|
-
const { isMobile:
|
|
18
|
-
if (
|
|
19
|
-
const { title:
|
|
20
|
-
}, onClearFilters: i, pagination:
|
|
21
|
-
filters:
|
|
22
|
-
values:
|
|
17
|
+
var Ne = (n) => {
|
|
18
|
+
const { isMobile: I, isTablet: l } = E(), t = L(V), r = q(), [O, g] = ae(!1);
|
|
19
|
+
if (I) return /* @__PURE__ */ e(le, { ...n });
|
|
20
|
+
const { title: D, counts: N, primaryAction: c, actions: d = [], search: p, sort: b, view: s, filters: h = [], values: u = {}, onFilterChange: w = () => {
|
|
21
|
+
}, onClearFilters: i, pagination: P, children: T } = n, k = G(n, t), W = J(n, t), m = z(h, u), f = h.length > 0, C = r?.menuItems ?? [], o = r?.nav ?? [], j = !!(s && (s.columns || s.groupBy || s.toggles?.length)), A = /* @__PURE__ */ e($, {
|
|
22
|
+
filters: h,
|
|
23
|
+
values: u,
|
|
23
24
|
context: "panel",
|
|
24
|
-
onFilterChange:
|
|
25
|
-
}),
|
|
25
|
+
onFilterChange: w
|
|
26
|
+
}), F = m > 0 && /* @__PURE__ */ e("span", {
|
|
26
27
|
className: "page-shell__badge",
|
|
27
|
-
children:
|
|
28
|
+
children: m
|
|
28
29
|
});
|
|
29
30
|
return /* @__PURE__ */ a("div", {
|
|
30
31
|
className: [
|
|
@@ -36,47 +37,52 @@ var de = (o) => {
|
|
|
36
37
|
!l && /* @__PURE__ */ a("aside", {
|
|
37
38
|
className: "page-shell__side",
|
|
38
39
|
children: [
|
|
39
|
-
r && /* @__PURE__ */ e(
|
|
40
|
-
|
|
41
|
-
action:
|
|
40
|
+
r && /* @__PURE__ */ e(B, { app: r.app }),
|
|
41
|
+
c && /* @__PURE__ */ e(v, {
|
|
42
|
+
action: c,
|
|
42
43
|
fullWidth: !0
|
|
43
44
|
}),
|
|
44
|
-
|
|
45
|
+
o.length > 1 && /* @__PURE__ */ e(Y, { nav: o }),
|
|
46
|
+
f && /* @__PURE__ */ a("div", {
|
|
45
47
|
className: "page-shell__side-group",
|
|
46
48
|
children: [/* @__PURE__ */ a("div", {
|
|
47
49
|
className: "page-shell__side-head",
|
|
48
50
|
children: [
|
|
49
51
|
/* @__PURE__ */ e("span", {
|
|
50
52
|
className: "page-shell__group-title",
|
|
51
|
-
children:
|
|
53
|
+
children: t.filters
|
|
52
54
|
}),
|
|
53
|
-
|
|
55
|
+
F,
|
|
54
56
|
/* @__PURE__ */ e("span", { className: "page-shell__spacer" }),
|
|
55
|
-
|
|
57
|
+
m > 0 && i && /* @__PURE__ */ e("button", {
|
|
56
58
|
type: "button",
|
|
57
59
|
className: "page-shell__link",
|
|
58
60
|
onClick: i,
|
|
59
|
-
children:
|
|
61
|
+
children: t.pageClearAll
|
|
60
62
|
})
|
|
61
63
|
]
|
|
62
|
-
}),
|
|
64
|
+
}), A]
|
|
63
65
|
}),
|
|
64
|
-
|
|
66
|
+
s && /* @__PURE__ */ e(S, { view: s })
|
|
65
67
|
]
|
|
66
68
|
}),
|
|
69
|
+
l && o.length > 1 && /* @__PURE__ */ e(X, {
|
|
70
|
+
app: r?.app,
|
|
71
|
+
nav: o
|
|
72
|
+
}),
|
|
67
73
|
/* @__PURE__ */ a("div", {
|
|
68
74
|
className: "page-shell__main",
|
|
69
75
|
children: [
|
|
70
76
|
/* @__PURE__ */ a("header", {
|
|
71
77
|
className: "page-shell__toolbar",
|
|
72
78
|
children: [
|
|
73
|
-
l &&
|
|
79
|
+
l && f && /* @__PURE__ */ a(_, {
|
|
74
80
|
icon: "tune",
|
|
75
81
|
variant: "default",
|
|
76
|
-
onClick: () =>
|
|
77
|
-
children: [
|
|
82
|
+
onClick: () => g(!0),
|
|
83
|
+
children: [t.filters, F]
|
|
78
84
|
}),
|
|
79
|
-
l && r && /* @__PURE__ */ e(
|
|
85
|
+
l && r && o.length <= 1 && /* @__PURE__ */ e(B, {
|
|
80
86
|
app: r.app,
|
|
81
87
|
logoOnly: !0
|
|
82
88
|
}),
|
|
@@ -84,64 +90,64 @@ var de = (o) => {
|
|
|
84
90
|
className: "page-shell__titles",
|
|
85
91
|
children: [/* @__PURE__ */ e("h1", {
|
|
86
92
|
className: "page-shell__title",
|
|
87
|
-
children:
|
|
93
|
+
children: D
|
|
88
94
|
}), k && /* @__PURE__ */ e("p", {
|
|
89
95
|
className: "page-shell__heading",
|
|
90
96
|
children: k
|
|
91
97
|
})]
|
|
92
98
|
}),
|
|
93
|
-
l &&
|
|
94
|
-
l && /* @__PURE__ */ e(
|
|
99
|
+
l && c && /* @__PURE__ */ e(v, { action: c }),
|
|
100
|
+
l && /* @__PURE__ */ e(M, { items: y(d, C, !0) }),
|
|
95
101
|
l && /* @__PURE__ */ e("span", { className: "page-shell__break" }),
|
|
96
|
-
|
|
102
|
+
p && /* @__PURE__ */ e(R, {
|
|
97
103
|
className: "page-shell__search",
|
|
98
|
-
value:
|
|
99
|
-
placeholder:
|
|
100
|
-
onChange:
|
|
104
|
+
value: p.value,
|
|
105
|
+
placeholder: p.placeholder ?? t.search,
|
|
106
|
+
onChange: p.onChange
|
|
101
107
|
}),
|
|
102
|
-
|
|
103
|
-
l &&
|
|
104
|
-
!l &&
|
|
105
|
-
!l && /* @__PURE__ */ e(
|
|
108
|
+
b && /* @__PURE__ */ e(Q, { sort: b }),
|
|
109
|
+
l && s && /* @__PURE__ */ e(U, { view: s }),
|
|
110
|
+
!l && ee(d).map((x) => /* @__PURE__ */ e(v, { action: x }, x.id)),
|
|
111
|
+
!l && /* @__PURE__ */ e(M, { items: y(d, C, !1) })
|
|
106
112
|
]
|
|
107
113
|
}),
|
|
108
114
|
/* @__PURE__ */ a("div", {
|
|
109
115
|
className: "page-shell__status",
|
|
110
|
-
children: [/* @__PURE__ */ e(
|
|
111
|
-
filters:
|
|
112
|
-
values:
|
|
113
|
-
onFilterChange:
|
|
116
|
+
children: [/* @__PURE__ */ e(Z, {
|
|
117
|
+
filters: h,
|
|
118
|
+
values: u,
|
|
119
|
+
onFilterChange: w,
|
|
114
120
|
onClearFilters: i
|
|
115
|
-
}), /* @__PURE__ */ e(K, { pagination:
|
|
121
|
+
}), /* @__PURE__ */ e(K, { pagination: P })]
|
|
116
122
|
}),
|
|
117
123
|
/* @__PURE__ */ e("div", {
|
|
118
124
|
className: "page-shell__content",
|
|
119
|
-
children:
|
|
125
|
+
children: T
|
|
120
126
|
})
|
|
121
127
|
]
|
|
122
128
|
}),
|
|
123
|
-
l &&
|
|
124
|
-
isOpen:
|
|
125
|
-
onClose: () =>
|
|
129
|
+
l && f && /* @__PURE__ */ e(H, {
|
|
130
|
+
isOpen: O,
|
|
131
|
+
onClose: () => g(!1),
|
|
126
132
|
position: "left",
|
|
127
|
-
title:
|
|
133
|
+
title: t.filters,
|
|
128
134
|
footer: /* @__PURE__ */ a("div", {
|
|
129
135
|
className: "page-shell__drawer-footer",
|
|
130
|
-
children: [
|
|
136
|
+
children: [m > 0 && i && /* @__PURE__ */ e(_, {
|
|
131
137
|
variant: "default",
|
|
132
138
|
onClick: i,
|
|
133
|
-
children:
|
|
134
|
-
}),
|
|
139
|
+
children: t.pageClearAll
|
|
140
|
+
}), N && /* @__PURE__ */ e(_, {
|
|
135
141
|
variant: "info",
|
|
136
142
|
fullWidth: !0,
|
|
137
|
-
onClick: () =>
|
|
138
|
-
children:
|
|
143
|
+
onClick: () => g(!1),
|
|
144
|
+
children: W(N.shown)
|
|
139
145
|
})]
|
|
140
146
|
}),
|
|
141
147
|
children: /* @__PURE__ */ a("div", {
|
|
142
148
|
className: "page-shell__drawer-body",
|
|
143
|
-
children: [
|
|
144
|
-
view:
|
|
149
|
+
children: [A, s && j && /* @__PURE__ */ e(S, {
|
|
150
|
+
view: s,
|
|
145
151
|
showToggle: !1
|
|
146
152
|
})]
|
|
147
153
|
})
|
|
@@ -150,5 +156,5 @@ var de = (o) => {
|
|
|
150
156
|
});
|
|
151
157
|
};
|
|
152
158
|
export {
|
|
153
|
-
|
|
159
|
+
Ne as WorkbenchShell
|
|
154
160
|
};
|
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
var
|
|
1
|
+
var o = (l) => l.map((e) => ({
|
|
2
2
|
label: e.label,
|
|
3
3
|
icon: e.icon,
|
|
4
4
|
onClick: e.onClick,
|
|
5
|
-
isActive: !1
|
|
5
|
+
isActive: !1,
|
|
6
|
+
separator: e.separator
|
|
7
|
+
})), r = (l) => l.filter((e) => !e.menu), t = (l, e, a) => [...o(a ? l : l.filter((n) => n.menu)), ...e], i = (l) => l.map((e) => ({
|
|
8
|
+
label: e.label,
|
|
9
|
+
icon: e.icon,
|
|
10
|
+
onClick: e.onSelect,
|
|
11
|
+
isActive: e.isActive
|
|
6
12
|
}));
|
|
7
13
|
export {
|
|
8
|
-
|
|
14
|
+
r as getButtonActions,
|
|
15
|
+
t as getMenuItems,
|
|
16
|
+
i as navToMenuItems
|
|
9
17
|
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { AppFrame as m } from "../PageShell/AppFrame.js";
|
|
2
|
+
import { useMemo as p } from "react";
|
|
3
|
+
import { jsx as s } from "react/jsx-runtime";
|
|
4
|
+
import { matchPath as l, useLocation as u, useNavigate as d } from "react-router";
|
|
5
|
+
var g = ({ nav: n, app: e, ...r }) => {
|
|
6
|
+
const { pathname: t } = u(), a = d(), h = p(() => n.map((o) => ({
|
|
7
|
+
id: o.path,
|
|
8
|
+
label: o.label,
|
|
9
|
+
icon: o.icon,
|
|
10
|
+
count: o.count,
|
|
11
|
+
isActive: l({
|
|
12
|
+
path: o.path,
|
|
13
|
+
end: o.end ?? o.path === "/"
|
|
14
|
+
}, t) !== null,
|
|
15
|
+
onSelect: () => a(o.path)
|
|
16
|
+
})), [
|
|
17
|
+
n,
|
|
18
|
+
t,
|
|
19
|
+
a
|
|
20
|
+
]), c = n[0]?.path ?? "/", i = p(() => ({
|
|
21
|
+
...e,
|
|
22
|
+
onHomeClick: e.onHomeClick ?? (t === c ? void 0 : () => a(c))
|
|
23
|
+
}), [
|
|
24
|
+
e,
|
|
25
|
+
t,
|
|
26
|
+
c,
|
|
27
|
+
a
|
|
28
|
+
]);
|
|
29
|
+
return /* @__PURE__ */ s(m, {
|
|
30
|
+
...r,
|
|
31
|
+
app: i,
|
|
32
|
+
nav: h
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
export {
|
|
36
|
+
g as RouterAppFrame
|
|
37
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.scroll-to-top{bottom:var(--spacing-24);right:var(--spacing-24);z-index:999;width:var(--spacing-48);height:var(--spacing-48);border-radius:var(--radius-full);background-color:var(--card-background-color);color:var(--body-accent-color);border:var(--spacing-1) solid var(--card-border-color);cursor:pointer;box-shadow:0 var(--spacing-4) var(--spacing-12) var(--box-shadow);transition:transform var(--transition-fast);animation:scrollToTopFadeIn var(--transition-moderate);justify-content:center;align-items:center;display:flex;position:fixed}.scroll-to-top:hover{transform:scale(1.1)}.scroll-to-top:active{transform:scale(.95)}body:has(.float-button-container) .scroll-to-top{right:calc(var(--spacing-24) + var(--spacing-4));bottom:calc(var(--spacing-24) + 66px)}body:has(.page-shell__fab) .scroll-to-top{right:calc(var(--spacing-16) + var(--spacing-6));bottom:calc(var(--spacing-16) + var(--spacing-60) + var(--spacing-12) + env(safe-area-inset-bottom,0px))}@keyframes scrollToTopFadeIn{0%{opacity:0;transform:translateY(var(--spacing-12))}to{opacity:1;transform:translateY(0)}}@media (width<=768px){.scroll-to-top{bottom:var(--spacing-16);right:var(--spacing-16)}body:has(.float-button-container) .scroll-to-top{bottom:calc(var(--spacing-16) + 58px)}}
|
|
1
|
+
.scroll-to-top{bottom:var(--spacing-24);right:var(--spacing-24);z-index:999;width:var(--spacing-48);height:var(--spacing-48);border-radius:var(--radius-full);background-color:var(--card-background-color);color:var(--body-accent-color);border:var(--spacing-1) solid var(--card-border-color);cursor:pointer;box-shadow:0 var(--spacing-4) var(--spacing-12) var(--box-shadow);transition:transform var(--transition-fast);animation:scrollToTopFadeIn var(--transition-moderate);justify-content:center;align-items:center;display:flex;position:fixed}.scroll-to-top:hover{transform:scale(1.1)}.scroll-to-top:active{transform:scale(.95)}body:has(.float-button-container) .scroll-to-top{right:calc(var(--spacing-24) + var(--spacing-4));bottom:calc(var(--spacing-24) + 66px)}body:has(.page-shell__fab) .scroll-to-top{right:calc(var(--spacing-16) + var(--spacing-6));bottom:calc(var(--spacing-16) + var(--spacing-60) + var(--spacing-12) + env(safe-area-inset-bottom,0px))}@keyframes scrollToTopFadeIn{0%{opacity:0;transform:translateY(var(--spacing-12))}to{opacity:1;transform:translateY(0)}}@media (width<=768px){.scroll-to-top{bottom:var(--spacing-16);right:var(--spacing-16)}body:has(.float-button-container) .scroll-to-top{bottom:calc(var(--spacing-16) + 58px)}}body:has(.page-shell--with-tabs) .scroll-to-top{bottom:calc(var(--spacing-60) + var(--spacing-16) + env(safe-area-inset-bottom,0px))}body:has(.page-shell--with-tabs .page-shell__fab) .scroll-to-top{bottom:calc(var(--spacing-60) + var(--spacing-16) + var(--spacing-60) + var(--spacing-12) + env(safe-area-inset-bottom,0px))}
|
|
@@ -75,6 +75,7 @@ var l = {
|
|
|
75
75
|
pageAllWords: "All words",
|
|
76
76
|
pageViewCalendar: "Calendar",
|
|
77
77
|
pageViewMap: "Map",
|
|
78
|
+
pageGroupNone: "None",
|
|
78
79
|
selectDate: "Select date...",
|
|
79
80
|
monthNames: [
|
|
80
81
|
"January",
|
|
@@ -215,6 +216,7 @@ var l = {
|
|
|
215
216
|
pageAllWords: "Toate cuvintele",
|
|
216
217
|
pageViewCalendar: "Calendar",
|
|
217
218
|
pageViewMap: "Hartă",
|
|
219
|
+
pageGroupNone: "Fără grupare",
|
|
218
220
|
selectDate: "Alege data...",
|
|
219
221
|
monthNames: [
|
|
220
222
|
"Ianuarie",
|
package/dist/index.d.ts
CHANGED
|
@@ -163,6 +163,8 @@ declare type AppFrameContextValue = Omit<AppFrameProps, 'children'>;
|
|
|
163
163
|
|
|
164
164
|
export declare interface AppFrameProps {
|
|
165
165
|
app: AppIdentity;
|
|
166
|
+
/** The app's sections. With react-router, RouterAppFrame from '@memobit/libs/router' builds these from paths. */
|
|
167
|
+
nav?: AppNavItem[];
|
|
166
168
|
/** Adds the account menu (theme, password, two-factor, logout) and mounts the dialogs it opens. Needs an AuthProvider above. */
|
|
167
169
|
account?: UseAccountMenuOptions;
|
|
168
170
|
/** App-specific menu entries, listed before the account ones. Page actions join them on small screens. */
|
|
@@ -191,6 +193,16 @@ export declare interface AppIdentity {
|
|
|
191
193
|
onHomeClick?: () => void;
|
|
192
194
|
}
|
|
193
195
|
|
|
196
|
+
/** One of the app's sections. Shown as a side list on desktop, an icon rail on tablet and a bottom tab bar on phone. */
|
|
197
|
+
export declare interface AppNavItem {
|
|
198
|
+
id: string;
|
|
199
|
+
label: string;
|
|
200
|
+
icon: IconName;
|
|
201
|
+
count?: number;
|
|
202
|
+
isActive: boolean;
|
|
203
|
+
onSelect: () => void;
|
|
204
|
+
}
|
|
205
|
+
|
|
194
206
|
export declare interface AppPersistenceDefaults<TPages, TTheme> {
|
|
195
207
|
pages?: TPages;
|
|
196
208
|
theme: TTheme;
|
|
@@ -2971,6 +2983,10 @@ export declare interface PageAction {
|
|
|
2971
2983
|
icon?: IconName;
|
|
2972
2984
|
variant?: ButtonVariant;
|
|
2973
2985
|
disabled?: boolean;
|
|
2986
|
+
/** Always listed in the page menu, never as a button: for occasional actions such as "Manage locations". */
|
|
2987
|
+
menu?: boolean;
|
|
2988
|
+
/** In the menu, draws a divider above this action to start a new group. */
|
|
2989
|
+
separator?: boolean;
|
|
2974
2990
|
onClick: () => void;
|
|
2975
2991
|
}
|
|
2976
2992
|
|
|
@@ -2993,6 +3009,16 @@ export declare interface PageCounts {
|
|
|
2993
3009
|
|
|
2994
3010
|
export declare type PageFilterValues = Record<string, FilterValue | undefined>;
|
|
2995
3011
|
|
|
3012
|
+
export declare interface PageGroupBy {
|
|
3013
|
+
options: Array<{
|
|
3014
|
+
value: string;
|
|
3015
|
+
label: string;
|
|
3016
|
+
}>;
|
|
3017
|
+
/** The grouping field, or null for no grouping. */
|
|
3018
|
+
value: string | null;
|
|
3019
|
+
onChange: (value: string | null) => void;
|
|
3020
|
+
}
|
|
3021
|
+
|
|
2996
3022
|
/** What the list holds, singular and plural, in the app's language: { one: 'recipe', other: 'recipes' }. */
|
|
2997
3023
|
export declare interface PageNoun {
|
|
2998
3024
|
one: string;
|
|
@@ -3067,6 +3093,8 @@ export declare interface PageView {
|
|
|
3067
3093
|
onChange: (value: string) => void;
|
|
3068
3094
|
/** Optional fields the user can show or hide. Listed with the view options, closed until opened. */
|
|
3069
3095
|
columns?: PageColumns;
|
|
3096
|
+
groupBy?: PageGroupBy;
|
|
3097
|
+
toggles?: PageViewToggle[];
|
|
3070
3098
|
}
|
|
3071
3099
|
|
|
3072
3100
|
export declare interface PageViewMode {
|
|
@@ -3075,6 +3103,14 @@ export declare interface PageViewMode {
|
|
|
3075
3103
|
icon: IconName;
|
|
3076
3104
|
}
|
|
3077
3105
|
|
|
3106
|
+
/** An on/off display preference shown with the view options, e.g. "Hide empty fields in cards". */
|
|
3107
|
+
export declare interface PageViewToggle {
|
|
3108
|
+
id: string;
|
|
3109
|
+
label: string;
|
|
3110
|
+
value: boolean;
|
|
3111
|
+
onChange: (value: boolean) => void;
|
|
3112
|
+
}
|
|
3113
|
+
|
|
3078
3114
|
export declare const Pagination: FC<PaginationProps>;
|
|
3079
3115
|
|
|
3080
3116
|
declare interface PaginationProps {
|