@memobit/libs 3.32.0 → 3.34.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/MenuHamburger/MenuHamburger2.js +22 -20
- package/dist/components/PageShell/AppFrame.js +48 -25
- package/dist/components/PageShell/FilterField.css +1 -1
- package/dist/components/PageShell/FilterField2.js +164 -131
- package/dist/components/PageShell/PageParts.js +114 -74
- package/dist/components/PageShell/PageShell.css +1 -1
- package/dist/components/PageShell/WorkbenchPhone.js +55 -52
- package/dist/components/PageShell/WorkbenchShell.js +86 -81
- package/dist/components/PageShell/filterRules.js +60 -48
- package/dist/components/PageShell/filterValues.js +24 -17
- package/dist/components/PageShell/liveCounts.js +21 -0
- package/dist/components/PageShell/menuItems.js +7 -6
- package/dist/components/PageShell/shellText.js +6 -5
- package/dist/components/PageShell/useSummaryMessages.js +4 -3
- package/dist/components/RouterAppFrame/RouterAppFrame.js +15 -12
- package/dist/helpers/VersionInfo.js +1 -1
- package/dist/index.d.ts +95 -5
- package/dist/index.js +135 -132
- package/dist/router.d.ts +13 -0
- package/dist/version.js +1 -1
- package/dist/version.json +4 -4
- package/package.json +1 -1
|
@@ -1,153 +1,158 @@
|
|
|
1
1
|
import { libMessages as V } from "../../contexts/LanguageContext/libMessages.js";
|
|
2
2
|
import { useMessages as L } from "../../hooks/useLanguage.js";
|
|
3
|
-
import { Button as
|
|
4
|
-
import { InputSearch as
|
|
5
|
-
import { useBreakpoint as
|
|
6
|
-
import { Drawer as
|
|
7
|
-
import { useAppFrame as
|
|
8
|
-
import { countActiveFilters as
|
|
9
|
-
import { getHeadingText as
|
|
10
|
-
import { ActionButton as v, AppMark as
|
|
11
|
-
import { NavRail as
|
|
12
|
-
import { AppliedFilters as
|
|
13
|
-
import { getButtonActions as
|
|
14
|
-
import { WorkbenchPhone as
|
|
15
|
-
import { useState as
|
|
16
|
-
import { jsx as e, jsxs as
|
|
17
|
-
var
|
|
18
|
-
const { isMobile:
|
|
19
|
-
if (
|
|
20
|
-
const { title:
|
|
21
|
-
}, onClearFilters:
|
|
3
|
+
import { Button as f } from "../Button/Button2.js";
|
|
4
|
+
import { InputSearch as E } from "../InputSearch/InputSearch2.js";
|
|
5
|
+
import { useBreakpoint as H } from "../../hooks/useBreakpoint.js";
|
|
6
|
+
import { Drawer as q } from "../Drawer/Drawer2.js";
|
|
7
|
+
import { useAppFrame as z } from "./useAppFrame.js";
|
|
8
|
+
import { countActiveFilters as G } from "./filterRules.js";
|
|
9
|
+
import { getHeadingText as J, getResultLabel as K, hasViewExtras as Q } from "./shellText.js";
|
|
10
|
+
import { ActionButton as v, AppMark as S, PageMenu as I, PagePager as U, PageTabsRow as X, SortDropdown as Y, ViewOptions as O, ViewToggle as Z } from "./PageParts.js";
|
|
11
|
+
import { NavRail as $, SideNav as ee } from "./AppNav.js";
|
|
12
|
+
import { AppliedFilters as ae, FilterSections as se } from "./FilterSections.js";
|
|
13
|
+
import { getButtonActions as le, getMenuItems as P } from "./menuItems.js";
|
|
14
|
+
import { WorkbenchPhone as te } from "./WorkbenchPhone.js";
|
|
15
|
+
import { useState as re } from "react";
|
|
16
|
+
import { jsx as e, jsxs as s } from "react/jsx-runtime";
|
|
17
|
+
var ke = (o) => {
|
|
18
|
+
const { isMobile: T, isTablet: a } = H(), l = L(V), t = z(), [y, d] = re(!1);
|
|
19
|
+
if (T) return /* @__PURE__ */ e(te, { ...o });
|
|
20
|
+
const { title: B, counts: N, primaryAction: p, actions: g = [], search: i, sort: b, view: r, filters: h = [], values: u = {}, onFilterChange: w = () => {
|
|
21
|
+
}, onClearFilters: n, pagination: D, tabs: W, children: j } = o, k = o.status ?? t?.status, C = J(o, l), R = K(o, l), m = G(h, u), _ = h.length > 0, A = t?.menuItems ?? [], c = t?.nav ?? [], F = /* @__PURE__ */ e(se, {
|
|
22
22
|
filters: h,
|
|
23
23
|
values: u,
|
|
24
24
|
context: "panel",
|
|
25
25
|
onFilterChange: w
|
|
26
|
-
}),
|
|
26
|
+
}), x = m > 0 && /* @__PURE__ */ e("span", {
|
|
27
27
|
className: "page-shell__badge",
|
|
28
28
|
children: m
|
|
29
29
|
});
|
|
30
|
-
return /* @__PURE__ */
|
|
30
|
+
return /* @__PURE__ */ s("div", {
|
|
31
31
|
className: [
|
|
32
32
|
"page-shell",
|
|
33
33
|
"page-shell--workbench",
|
|
34
|
-
|
|
34
|
+
a ? "page-shell--tablet" : "page-shell--desktop"
|
|
35
35
|
].join(" "),
|
|
36
36
|
children: [
|
|
37
|
-
!
|
|
37
|
+
!a && /* @__PURE__ */ s("aside", {
|
|
38
38
|
className: "page-shell__side",
|
|
39
39
|
children: [
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
action:
|
|
40
|
+
t && /* @__PURE__ */ e(S, { app: t.app }),
|
|
41
|
+
p && /* @__PURE__ */ e(v, {
|
|
42
|
+
action: p,
|
|
43
43
|
fullWidth: !0
|
|
44
44
|
}),
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
c.length > 1 && /* @__PURE__ */ e(ee, { nav: c }),
|
|
46
|
+
_ && /* @__PURE__ */ s("div", {
|
|
47
47
|
className: "page-shell__side-group",
|
|
48
|
-
children: [/* @__PURE__ */
|
|
48
|
+
children: [/* @__PURE__ */ s("div", {
|
|
49
49
|
className: "page-shell__side-head",
|
|
50
50
|
children: [
|
|
51
51
|
/* @__PURE__ */ e("span", {
|
|
52
52
|
className: "page-shell__group-title",
|
|
53
|
-
children:
|
|
53
|
+
children: l.filters
|
|
54
54
|
}),
|
|
55
|
-
|
|
55
|
+
x,
|
|
56
56
|
/* @__PURE__ */ e("span", { className: "page-shell__spacer" }),
|
|
57
|
-
m > 0 &&
|
|
57
|
+
m > 0 && n && /* @__PURE__ */ e("button", {
|
|
58
58
|
type: "button",
|
|
59
59
|
className: "page-shell__link",
|
|
60
|
-
onClick:
|
|
61
|
-
children:
|
|
60
|
+
onClick: n,
|
|
61
|
+
children: l.pageClearAll
|
|
62
62
|
})
|
|
63
63
|
]
|
|
64
|
-
}),
|
|
64
|
+
}), F]
|
|
65
65
|
}),
|
|
66
|
-
|
|
66
|
+
r && /* @__PURE__ */ e(O, { view: r })
|
|
67
67
|
]
|
|
68
68
|
}),
|
|
69
|
-
|
|
70
|
-
app:
|
|
71
|
-
nav:
|
|
69
|
+
a && c.length > 1 && /* @__PURE__ */ e($, {
|
|
70
|
+
app: t?.app,
|
|
71
|
+
nav: c
|
|
72
72
|
}),
|
|
73
|
-
/* @__PURE__ */
|
|
73
|
+
/* @__PURE__ */ s("div", {
|
|
74
74
|
className: "page-shell__main",
|
|
75
75
|
children: [
|
|
76
|
-
/* @__PURE__ */
|
|
76
|
+
/* @__PURE__ */ s("header", {
|
|
77
77
|
className: "page-shell__toolbar",
|
|
78
78
|
children: [
|
|
79
|
-
|
|
79
|
+
a && _ && /* @__PURE__ */ s(f, {
|
|
80
80
|
icon: "tune",
|
|
81
81
|
variant: "default",
|
|
82
|
-
onClick: () =>
|
|
83
|
-
children: [
|
|
82
|
+
onClick: () => d(!0),
|
|
83
|
+
children: [l.filters, x]
|
|
84
84
|
}),
|
|
85
|
-
|
|
86
|
-
app:
|
|
85
|
+
a && t && c.length <= 1 && /* @__PURE__ */ e(S, {
|
|
86
|
+
app: t.app,
|
|
87
87
|
logoOnly: !0
|
|
88
88
|
}),
|
|
89
|
-
/* @__PURE__ */
|
|
89
|
+
/* @__PURE__ */ s("div", {
|
|
90
90
|
className: "page-shell__titles",
|
|
91
91
|
children: [/* @__PURE__ */ e("h1", {
|
|
92
92
|
className: "page-shell__title",
|
|
93
|
-
children:
|
|
94
|
-
}),
|
|
93
|
+
children: B
|
|
94
|
+
}), C && /* @__PURE__ */ e("p", {
|
|
95
95
|
className: "page-shell__heading",
|
|
96
|
-
children:
|
|
96
|
+
children: C
|
|
97
97
|
})]
|
|
98
98
|
}),
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
99
|
+
(!i || a) && /* @__PURE__ */ e("span", { className: "page-shell__spacer" }),
|
|
100
|
+
a && p && /* @__PURE__ */ e(v, { action: p }),
|
|
101
|
+
a && k,
|
|
102
|
+
a && /* @__PURE__ */ e(I, { items: P(g, A, !0) }),
|
|
103
|
+
a && /* @__PURE__ */ e("span", { className: "page-shell__break" }),
|
|
104
|
+
i && /* @__PURE__ */ e(E, {
|
|
103
105
|
className: "page-shell__search",
|
|
104
|
-
value:
|
|
105
|
-
placeholder:
|
|
106
|
-
|
|
106
|
+
value: i.value,
|
|
107
|
+
placeholder: i.placeholder ?? l.search,
|
|
108
|
+
autoFocus: i.autoFocus,
|
|
109
|
+
onChange: i.onChange
|
|
107
110
|
}),
|
|
108
|
-
b && /* @__PURE__ */ e(
|
|
109
|
-
|
|
110
|
-
!
|
|
111
|
-
!
|
|
111
|
+
b && /* @__PURE__ */ e(Y, { sort: b }),
|
|
112
|
+
a && r && /* @__PURE__ */ e(Z, { view: r }),
|
|
113
|
+
!a && le(g).map((M) => /* @__PURE__ */ e(v, { action: M }, M.id)),
|
|
114
|
+
!a && k,
|
|
115
|
+
!a && /* @__PURE__ */ e(I, { items: P(g, A, !1) })
|
|
112
116
|
]
|
|
113
117
|
}),
|
|
114
|
-
/* @__PURE__ */
|
|
118
|
+
/* @__PURE__ */ e(X, { tabs: W }),
|
|
119
|
+
/* @__PURE__ */ s("div", {
|
|
115
120
|
className: "page-shell__status",
|
|
116
|
-
children: [/* @__PURE__ */ e(
|
|
121
|
+
children: [/* @__PURE__ */ e(ae, {
|
|
117
122
|
filters: h,
|
|
118
123
|
values: u,
|
|
119
124
|
onFilterChange: w,
|
|
120
|
-
onClearFilters:
|
|
121
|
-
}), /* @__PURE__ */ e(
|
|
125
|
+
onClearFilters: n
|
|
126
|
+
}), /* @__PURE__ */ e(U, { pagination: D })]
|
|
122
127
|
}),
|
|
123
128
|
/* @__PURE__ */ e("div", {
|
|
124
129
|
className: "page-shell__content",
|
|
125
|
-
children:
|
|
130
|
+
children: j
|
|
126
131
|
})
|
|
127
132
|
]
|
|
128
133
|
}),
|
|
129
|
-
|
|
130
|
-
isOpen:
|
|
131
|
-
onClose: () =>
|
|
134
|
+
a && _ && /* @__PURE__ */ e(q, {
|
|
135
|
+
isOpen: y,
|
|
136
|
+
onClose: () => d(!1),
|
|
132
137
|
position: "left",
|
|
133
|
-
title:
|
|
134
|
-
footer: /* @__PURE__ */
|
|
138
|
+
title: l.filters,
|
|
139
|
+
footer: /* @__PURE__ */ s("div", {
|
|
135
140
|
className: "page-shell__drawer-footer",
|
|
136
|
-
children: [m > 0 &&
|
|
141
|
+
children: [m > 0 && n && /* @__PURE__ */ e(f, {
|
|
137
142
|
variant: "default",
|
|
138
|
-
onClick:
|
|
139
|
-
children:
|
|
140
|
-
}), N && /* @__PURE__ */ e(
|
|
143
|
+
onClick: n,
|
|
144
|
+
children: l.pageClearAll
|
|
145
|
+
}), N && /* @__PURE__ */ e(f, {
|
|
141
146
|
variant: "info",
|
|
142
147
|
fullWidth: !0,
|
|
143
|
-
onClick: () =>
|
|
144
|
-
children:
|
|
148
|
+
onClick: () => d(!1),
|
|
149
|
+
children: R(N.shown)
|
|
145
150
|
})]
|
|
146
151
|
}),
|
|
147
|
-
children: /* @__PURE__ */
|
|
152
|
+
children: /* @__PURE__ */ s("div", {
|
|
148
153
|
className: "page-shell__drawer-body",
|
|
149
|
-
children: [
|
|
150
|
-
view:
|
|
154
|
+
children: [F, r && Q(r) && /* @__PURE__ */ e(O, {
|
|
155
|
+
view: r,
|
|
151
156
|
showToggle: !1
|
|
152
157
|
})]
|
|
153
158
|
})
|
|
@@ -156,5 +161,5 @@ var Ne = (n) => {
|
|
|
156
161
|
});
|
|
157
162
|
};
|
|
158
163
|
export {
|
|
159
|
-
|
|
164
|
+
ke as WorkbenchShell
|
|
160
165
|
};
|
|
@@ -1,14 +1,18 @@
|
|
|
1
|
-
import { formatAppDate as
|
|
2
|
-
var
|
|
3
|
-
const [r, i] =
|
|
1
|
+
import { formatAppDate as u } from "../../helpers/Datetime.js";
|
|
2
|
+
var $ = 4, S = 24, k = 10, M = 8, v = 14, s = (t) => typeof t == "string" || typeof t == "number", d = (t) => Array.isArray(t) ? t.filter(s) : [], f = (t) => s(t) && t !== "" ? t : null, h = (t) => typeof t == "number" ? t : 0, y = (t, n, e) => {
|
|
3
|
+
const [r, i] = d(t);
|
|
4
4
|
return [typeof r == "number" ? r : n, typeof i == "number" ? i : e];
|
|
5
|
-
},
|
|
5
|
+
}, x = (t) => {
|
|
6
|
+
const [n, e] = d(t);
|
|
7
|
+
return [typeof n == "string" ? n : "", typeof e == "string" ? e : ""];
|
|
8
|
+
}, C = (t) => typeof t == "object" && t !== null && !Array.isArray(t), g = (t) => C(t) ? t : { text: "" }, E = (t, n) => t.wordMatch ? [{
|
|
6
9
|
value: "or",
|
|
7
10
|
label: n.anyWord
|
|
8
11
|
}, {
|
|
9
12
|
value: "and",
|
|
10
13
|
label: n.allWords
|
|
11
|
-
}] : t.modes,
|
|
14
|
+
}] : t.modes, V = (t) => {
|
|
15
|
+
if (t.defaultValue !== void 0) return t.defaultValue;
|
|
12
16
|
switch (t.kind) {
|
|
13
17
|
case "multi":
|
|
14
18
|
return [];
|
|
@@ -24,100 +28,108 @@ var A = 4, y = 24, $ = 10, k = 8, v = 14, s = (t) => typeof t == "string" || typ
|
|
|
24
28
|
default:
|
|
25
29
|
return null;
|
|
26
30
|
}
|
|
27
|
-
},
|
|
31
|
+
}, c = (t) => JSON.stringify(Array.isArray(t) ? [...t].map(String).sort() : t ?? null), A = (t, n) => {
|
|
32
|
+
if (t.defaultValue !== void 0) return c(n) !== c(t.defaultValue);
|
|
28
33
|
switch (t.kind) {
|
|
29
34
|
case "single":
|
|
30
35
|
case "date":
|
|
31
|
-
return
|
|
36
|
+
return f(n) !== null;
|
|
32
37
|
case "multi":
|
|
33
|
-
return
|
|
38
|
+
return d(n).length > 0;
|
|
34
39
|
case "range": {
|
|
35
|
-
const [e, r] =
|
|
40
|
+
const [e, r] = y(n, t.min, t.max);
|
|
36
41
|
return e > t.min || r < t.max;
|
|
37
42
|
}
|
|
38
43
|
case "rating":
|
|
39
|
-
return
|
|
44
|
+
return h(n) > 0;
|
|
40
45
|
case "toggle":
|
|
41
46
|
return n === !0;
|
|
42
47
|
case "text":
|
|
43
|
-
return
|
|
48
|
+
return g(n).text.trim() !== "";
|
|
49
|
+
case "date-range":
|
|
50
|
+
return x(n).some((e) => e !== "");
|
|
44
51
|
}
|
|
45
|
-
},
|
|
52
|
+
}, w = (t, n) => t.filter((e) => A(e, n[e.id])).length, m = (t, n) => t.find((e) => e.value === n)?.label ?? String(n), D = (t, n) => {
|
|
46
53
|
if (t.kind !== "single" && t.kind !== "multi") return null;
|
|
47
54
|
if (t.control) return t.control;
|
|
48
55
|
const e = t.options.length;
|
|
49
56
|
if (t.kind === "single") {
|
|
50
|
-
if (e >
|
|
57
|
+
if (e > k) return "search-list";
|
|
51
58
|
const r = t.options.reduce((i, a) => i + a.label.length, 3);
|
|
52
|
-
return e <=
|
|
59
|
+
return e <= $ && r <= S ? "segmented" : n === "sheet" ? "chips" : "radio";
|
|
53
60
|
}
|
|
54
|
-
return e > v ? "search-list" : e <=
|
|
55
|
-
},
|
|
61
|
+
return e > v ? "search-list" : e <= M || n === "sheet" ? "chips" : "checklist";
|
|
62
|
+
}, T = (t, n, e) => {
|
|
56
63
|
switch (t.kind) {
|
|
57
64
|
case "single": {
|
|
58
|
-
const r =
|
|
59
|
-
return r === null ?
|
|
65
|
+
const r = f(n);
|
|
66
|
+
return r === null ? `${t.label}: ${e.any}` : m(t.options, r);
|
|
60
67
|
}
|
|
61
68
|
case "multi": {
|
|
62
|
-
const r =
|
|
63
|
-
return r.length === 1 ?
|
|
69
|
+
const r = d(n);
|
|
70
|
+
return r.length === 1 ? m(t.options, r[0]) : e.selectedCount(r.length);
|
|
64
71
|
}
|
|
65
72
|
case "range": {
|
|
66
|
-
const [r, i] =
|
|
73
|
+
const [r, i] = y(n, t.min, t.max), a = t.unit ? ` ${t.unit}` : "";
|
|
67
74
|
return r > t.min && i < t.max ? `${r}–${i}${a}` : r > t.min ? `≥ ${r}${a}` : `≤ ${i}${a}`;
|
|
68
75
|
}
|
|
69
76
|
case "rating":
|
|
70
|
-
return e.ratingAtLeast(
|
|
77
|
+
return e.ratingAtLeast(h(n));
|
|
71
78
|
case "toggle":
|
|
72
79
|
return t.label;
|
|
73
80
|
case "text": {
|
|
74
|
-
const { text: r, mode: i } =
|
|
75
|
-
return
|
|
81
|
+
const { text: r, mode: i } = g(n), a = E(t, e), o = a && i !== a[0]?.value ? a.find((l) => l.value === i)?.label : void 0;
|
|
82
|
+
return o ? `“${r.trim()}” · ${o}` : `“${r.trim()}”`;
|
|
76
83
|
}
|
|
77
84
|
case "date": {
|
|
78
|
-
const r =
|
|
85
|
+
const r = f(n);
|
|
79
86
|
if (r === null) return "";
|
|
80
|
-
const i =
|
|
87
|
+
const i = u(String(r));
|
|
81
88
|
return t.relation === "until" ? e.dateUntil(i) : e.dateSince(i);
|
|
82
89
|
}
|
|
90
|
+
case "date-range": {
|
|
91
|
+
const [r, i] = x(n);
|
|
92
|
+
return r && i ? `${u(r)} – ${u(i)}` : r ? e.dateSince(u(r)) : i ? e.dateUntil(u(i)) : "";
|
|
93
|
+
}
|
|
83
94
|
}
|
|
84
95
|
}, F = (t, n, e) => t.flatMap((r) => {
|
|
85
96
|
const i = n[r.id];
|
|
86
|
-
if (!
|
|
97
|
+
if (!A(r, i)) return [];
|
|
87
98
|
if (r.kind === "multi") {
|
|
88
|
-
const
|
|
89
|
-
return
|
|
90
|
-
key: `${r.id}:${
|
|
99
|
+
const o = d(i);
|
|
100
|
+
return o.map((l) => ({
|
|
101
|
+
key: `${r.id}:${l}`,
|
|
91
102
|
filterId: r.id,
|
|
92
|
-
label:
|
|
93
|
-
next:
|
|
103
|
+
label: m(r.options, l),
|
|
104
|
+
next: o.filter((b) => b !== l)
|
|
94
105
|
}));
|
|
95
106
|
}
|
|
96
107
|
const a = r.kind === "text" ? {
|
|
97
|
-
...
|
|
108
|
+
...g(i),
|
|
98
109
|
text: ""
|
|
99
|
-
} :
|
|
110
|
+
} : V(r);
|
|
100
111
|
return [{
|
|
101
112
|
key: r.id,
|
|
102
113
|
filterId: r.id,
|
|
103
|
-
label:
|
|
114
|
+
label: T(r, i, e),
|
|
104
115
|
next: a
|
|
105
116
|
}];
|
|
106
117
|
});
|
|
107
118
|
export {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
119
|
+
w as countActiveFilters,
|
|
120
|
+
V as defaultFilterValue,
|
|
121
|
+
T as filterSummary,
|
|
111
122
|
F as getAppliedFilters,
|
|
112
|
-
|
|
113
|
-
|
|
123
|
+
E as getTextModes,
|
|
124
|
+
A as isFilterActive,
|
|
114
125
|
s as isScalar,
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
126
|
+
C as isTextFilterValue,
|
|
127
|
+
m as optionLabel,
|
|
128
|
+
D as pickControl,
|
|
129
|
+
x as toDateRange,
|
|
130
|
+
d as toList,
|
|
131
|
+
h as toNumber,
|
|
132
|
+
y as toRange,
|
|
133
|
+
f as toScalar,
|
|
134
|
+
g as toText
|
|
123
135
|
};
|
|
@@ -1,30 +1,37 @@
|
|
|
1
|
-
import { isTextFilterValue as
|
|
2
|
-
var
|
|
3
|
-
const
|
|
4
|
-
return
|
|
5
|
-
}),
|
|
6
|
-
const [n, t] =
|
|
1
|
+
import { isTextFilterValue as s, toDateRange as d, toList as i, toScalar as f } from "./filterRules.js";
|
|
2
|
+
var g = (e, n) => i(e).flatMap((t) => {
|
|
3
|
+
const r = n.find((a) => a === t);
|
|
4
|
+
return r === void 0 ? [] : [r];
|
|
5
|
+
}), m = (e, n) => n.find((t) => t === e), h = (e) => {
|
|
6
|
+
const [n, t] = i(e);
|
|
7
7
|
return typeof n == "number" && typeof t == "number" ? [n, t] : null;
|
|
8
|
-
},
|
|
8
|
+
}, F = (e) => s(e) ? e : null, c = (e) => {
|
|
9
|
+
const [n, t] = d(e);
|
|
10
|
+
return {
|
|
11
|
+
from: n || null,
|
|
12
|
+
to: t || null
|
|
13
|
+
};
|
|
14
|
+
}, k = (e, n) => e.flatMap((t) => {
|
|
9
15
|
if (t.kind !== "single" && t.kind !== "multi") return [];
|
|
10
|
-
const
|
|
16
|
+
const r = new Set(t.options.map((l) => l.value)), a = n[t.id];
|
|
11
17
|
if (t.kind === "single") {
|
|
12
|
-
const l =
|
|
13
|
-
return l !== null && !
|
|
18
|
+
const l = f(a);
|
|
19
|
+
return l !== null && !r.has(l) ? [{
|
|
14
20
|
id: t.id,
|
|
15
21
|
value: null
|
|
16
22
|
}] : [];
|
|
17
23
|
}
|
|
18
|
-
const o = a
|
|
19
|
-
return
|
|
24
|
+
const o = i(a), u = o.filter((l) => r.has(l));
|
|
25
|
+
return u.length === o.length ? [] : [{
|
|
20
26
|
id: t.id,
|
|
21
|
-
value:
|
|
27
|
+
value: u
|
|
22
28
|
}];
|
|
23
29
|
});
|
|
24
30
|
export {
|
|
25
|
-
|
|
26
|
-
|
|
31
|
+
c as asFilterDateRange,
|
|
32
|
+
m as asFilterKey,
|
|
33
|
+
g as asFilterKeys,
|
|
27
34
|
h as asFilterRange,
|
|
28
|
-
|
|
29
|
-
|
|
35
|
+
F as asFilterText,
|
|
36
|
+
k as getStaleFilterChanges
|
|
30
37
|
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
var d = (a, s, i, l) => {
|
|
2
|
+
const u = Object.keys(l), v = s.map((t) => new Set(u.filter((n) => l[n](t, i[n])))), f = (t, n) => u.every((r) => r === n || v[t].has(r));
|
|
3
|
+
return a.map((t) => {
|
|
4
|
+
const n = l[t.id];
|
|
5
|
+
if (!n || t.kind !== "single" && t.kind !== "multi") return t;
|
|
6
|
+
const r = s.filter((e, o) => f(o, t.id)), k = t.options.map((e) => {
|
|
7
|
+
const o = t.kind === "multi" ? [e.value] : e.value;
|
|
8
|
+
return {
|
|
9
|
+
...e,
|
|
10
|
+
count: r.filter((m) => n(m, o)).length
|
|
11
|
+
};
|
|
12
|
+
});
|
|
13
|
+
return {
|
|
14
|
+
...t,
|
|
15
|
+
options: k
|
|
16
|
+
};
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
export {
|
|
20
|
+
d as applyLiveCounts
|
|
21
|
+
};
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
var
|
|
1
|
+
var r = (l) => l.map((e) => ({
|
|
2
2
|
label: e.label,
|
|
3
3
|
icon: e.icon,
|
|
4
4
|
onClick: e.onClick,
|
|
5
5
|
isActive: !1,
|
|
6
|
-
separator: e.separator
|
|
7
|
-
|
|
6
|
+
separator: e.separator,
|
|
7
|
+
disabled: e.disabled
|
|
8
|
+
})), s = (l) => l.filter((e) => !e.menu), i = (l, e, a) => [...r(a ? l : l.filter((n) => n.menu)), ...e], o = (l) => l.map((e) => ({
|
|
8
9
|
label: e.label,
|
|
9
10
|
icon: e.icon,
|
|
10
11
|
onClick: e.onSelect,
|
|
11
12
|
isActive: e.isActive
|
|
12
13
|
}));
|
|
13
14
|
export {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
s as getButtonActions,
|
|
16
|
+
i as getMenuItems,
|
|
17
|
+
o as navToMenuItems
|
|
17
18
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var
|
|
1
|
+
var i = ({ counts: e, noun: a, heading: l }, r) => [e && a ? r.pageItemCount(e.shown, e.total, a.one, a.other) : void 0, l].filter(Boolean).join(" · "), s = ({ noun: e, resultLabel: a }, l) => a ?? (e ? (r) => l.pageShowItems(r, e.one, e.other) : l.pageShowResults), t = (e, a) => {
|
|
2
2
|
switch (e) {
|
|
3
3
|
case "cards":
|
|
4
4
|
return {
|
|
@@ -31,9 +31,10 @@ var t = ({ counts: e, noun: a, heading: l }, r) => [e && a ? r.pageItemCount(e.s
|
|
|
31
31
|
icon: "map"
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
},
|
|
34
|
+
}, g = (e, a) => e.map((l) => typeof l == "string" ? t(l, a) : l), n = (e) => !!(e.columns || e.groupBy || e.toggles?.length || e.choices?.length);
|
|
35
35
|
export {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
i as getHeadingText,
|
|
37
|
+
s as getResultLabel,
|
|
38
|
+
n as hasViewExtras,
|
|
39
|
+
g as resolveViewModes
|
|
39
40
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { libMessages as
|
|
2
|
-
import { useMessages as
|
|
1
|
+
import { libMessages as a } from "../../contexts/LanguageContext/libMessages.js";
|
|
2
|
+
import { useMessages as t } from "../../hooks/useLanguage.js";
|
|
3
3
|
import { useMemo as s } from "react";
|
|
4
4
|
var g = () => {
|
|
5
|
-
const e = a
|
|
5
|
+
const e = t(a);
|
|
6
6
|
return s(() => ({
|
|
7
|
+
any: e.pageAny,
|
|
7
8
|
selectedCount: e.pageSelectedCount,
|
|
8
9
|
ratingAtLeast: e.pageRatingAtLeast,
|
|
9
10
|
dateSince: e.pageDateSince,
|
|
@@ -1,23 +1,26 @@
|
|
|
1
1
|
import { AppFrame as m } from "../PageShell/AppFrame.js";
|
|
2
2
|
import { useMemo as p } from "react";
|
|
3
|
-
import { jsx as
|
|
4
|
-
import { matchPath as
|
|
5
|
-
var
|
|
6
|
-
const { pathname: t } =
|
|
3
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
4
|
+
import { matchPath as r, useLocation as d, useNavigate as f } from "react-router";
|
|
5
|
+
var k = ({ nav: n, app: e, ...s }) => {
|
|
6
|
+
const { pathname: t } = d(), a = f(), l = p(() => n.map((o) => ({
|
|
7
7
|
id: o.path,
|
|
8
8
|
label: o.label,
|
|
9
9
|
icon: o.icon,
|
|
10
10
|
count: o.count,
|
|
11
|
-
isActive:
|
|
11
|
+
isActive: r({
|
|
12
12
|
path: o.path,
|
|
13
13
|
end: o.end ?? o.path === "/"
|
|
14
|
-
}, t) !== null
|
|
14
|
+
}, t) !== null || (o.activeOn ?? []).some((i) => r({
|
|
15
|
+
path: i,
|
|
16
|
+
end: !1
|
|
17
|
+
}, t) !== null),
|
|
15
18
|
onSelect: () => a(o.path)
|
|
16
19
|
})), [
|
|
17
20
|
n,
|
|
18
21
|
t,
|
|
19
22
|
a
|
|
20
|
-
]), c = n[0]?.path ?? "/",
|
|
23
|
+
]), c = n[0]?.path ?? "/", h = p(() => ({
|
|
21
24
|
...e,
|
|
22
25
|
onHomeClick: e.onHomeClick ?? (t === c ? void 0 : () => a(c))
|
|
23
26
|
}), [
|
|
@@ -26,12 +29,12 @@ var g = ({ nav: n, app: e, ...r }) => {
|
|
|
26
29
|
c,
|
|
27
30
|
a
|
|
28
31
|
]);
|
|
29
|
-
return /* @__PURE__ */
|
|
30
|
-
...
|
|
31
|
-
app:
|
|
32
|
-
nav:
|
|
32
|
+
return /* @__PURE__ */ u(m, {
|
|
33
|
+
...s,
|
|
34
|
+
app: h,
|
|
35
|
+
nav: l
|
|
33
36
|
});
|
|
34
37
|
};
|
|
35
38
|
export {
|
|
36
|
-
|
|
39
|
+
k as RouterAppFrame
|
|
37
40
|
};
|