@memobit/libs 3.34.0 → 3.36.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/AppNav.js +38 -27
- package/dist/components/PageShell/FilterField.css +1 -1
- package/dist/components/PageShell/FilterField2.js +243 -190
- package/dist/components/PageShell/FocusShell.js +60 -0
- package/dist/components/PageShell/PageParts.js +176 -155
- package/dist/components/PageShell/PageShell.css +1 -1
- package/dist/components/PageShell/PageShell2.js +11 -6
- package/dist/components/PageShell/WorkbenchPhone.js +75 -65
- package/dist/components/PageShell/WorkbenchShell.js +78 -64
- package/dist/components/PageShell/filterRules.js +64 -51
- package/dist/components/PageShell/shellText.js +1 -1
- package/dist/components/PageShell/useConfirmedActions.js +35 -0
- package/dist/components/PageShell/useSummaryMessages.js +4 -3
- package/dist/components/RouterAppFrame/RouterAppFrame.js +18 -16
- package/dist/contexts/LanguageContext/libMessages.js +2 -0
- package/dist/helpers/VersionInfo.js +1 -1
- package/dist/index.d.ts +62 -7
- package/dist/router.d.ts +11 -2
- package/dist/version.js +1 -1
- package/dist/version.json +4 -4
- package/package.json +1 -1
|
@@ -1,43 +1,44 @@
|
|
|
1
1
|
import { Icon as v } from "../Icon/Icon2.js";
|
|
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
|
-
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
2
|
+
import { libMessages as z } from "../../contexts/LanguageContext/libMessages.js";
|
|
3
|
+
import { useMessages as O } from "../../hooks/useLanguage.js";
|
|
4
|
+
import { Button as A } from "../Button/Button2.js";
|
|
5
|
+
import { InputSearch as W } from "../InputSearch/InputSearch2.js";
|
|
6
|
+
import { useAppFrame as D } from "./useAppFrame.js";
|
|
7
|
+
import { countActiveFilters as R } from "./filterRules.js";
|
|
8
|
+
import { getMenuItems as V, navToMenuItems as H } from "./menuItems.js";
|
|
9
|
+
import { getHeadingText as $, getResultLabel as q } from "./shellText.js";
|
|
10
|
+
import { AppMark as E, PageMenu as G, PagePager as J, PageTabsRow as K, SortSheetBody as Q } from "./PageParts.js";
|
|
11
|
+
import { useConfirmedActions as U } from "./useConfirmedActions.js";
|
|
12
|
+
import { TabBar as X } from "./AppNav.js";
|
|
13
|
+
import { AppliedFilters as Y, FilterSections as Z } from "./FilterSections.js";
|
|
14
|
+
import { BottomSheet as S } from "./BottomSheet.js";
|
|
15
|
+
import { useCallback as ee, useState as te } from "react";
|
|
16
|
+
import { jsx as e, jsxs as i } from "react/jsx-runtime";
|
|
17
|
+
var _e = (l) => {
|
|
18
|
+
const { title: y, counts: m, search: o, sort: s, view: p, filters: r = [], values: d = {}, onFilterChange: C = () => {
|
|
19
|
+
}, onClearFilters: u, pagination: g, tabs: F, aside: N, footer: k, children: B } = l, t = O(z), { primaryAction: a, actions: I, dialog: M } = U(l.primaryAction, l.actions ?? []), n = D(), [w, f] = te(null), c = ee(() => f(null), []), b = R(r, d), x = q(l, t), P = s?.fields.find((L) => L.value === s.value.field)?.label, T = [$(l, t), P].filter(Boolean).join(" · "), h = n?.nav ?? [], _ = h.length > 1 && h.length <= 5, j = [..._ ? [] : H(h), ...V(I, n?.menuItems ?? [], !0)];
|
|
20
|
+
return /* @__PURE__ */ i("div", {
|
|
20
21
|
className: [
|
|
21
22
|
"page-shell",
|
|
22
23
|
"page-shell--workbench",
|
|
23
24
|
"page-shell--phone",
|
|
24
25
|
_ ? "page-shell--with-tabs" : "",
|
|
25
|
-
|
|
26
|
+
a?.variant ? `page-shell--fab-${a.variant}` : ""
|
|
26
27
|
].filter(Boolean).join(" "),
|
|
27
28
|
children: [
|
|
28
|
-
/* @__PURE__ */
|
|
29
|
+
/* @__PURE__ */ i("header", {
|
|
29
30
|
className: "page-shell__topbar",
|
|
30
31
|
children: [
|
|
31
|
-
|
|
32
|
-
app:
|
|
32
|
+
n && /* @__PURE__ */ e(E, {
|
|
33
|
+
app: n.app,
|
|
33
34
|
logoOnly: !0
|
|
34
35
|
}),
|
|
35
36
|
/* @__PURE__ */ e("h1", {
|
|
36
37
|
className: "page-shell__title",
|
|
37
|
-
children:
|
|
38
|
+
children: y
|
|
38
39
|
}),
|
|
39
40
|
/* @__PURE__ */ e("span", { className: "page-shell__spacer" }),
|
|
40
|
-
|
|
41
|
+
r.length > 0 && /* @__PURE__ */ i("button", {
|
|
41
42
|
type: "button",
|
|
42
43
|
className: "page-shell__icon-button",
|
|
43
44
|
onClick: () => f("filters"),
|
|
@@ -49,97 +50,106 @@ var ue = (r) => {
|
|
|
49
50
|
children: b
|
|
50
51
|
})]
|
|
51
52
|
}),
|
|
52
|
-
|
|
53
|
-
/* @__PURE__ */ e(
|
|
53
|
+
l.status ?? n?.status,
|
|
54
|
+
/* @__PURE__ */ e(G, { items: j })
|
|
54
55
|
]
|
|
55
56
|
}),
|
|
56
|
-
|
|
57
|
+
o && /* @__PURE__ */ e("div", {
|
|
57
58
|
className: "page-shell__search-row",
|
|
58
|
-
children: /* @__PURE__ */ e(
|
|
59
|
-
value:
|
|
60
|
-
placeholder:
|
|
61
|
-
autoFocus:
|
|
62
|
-
onChange:
|
|
59
|
+
children: /* @__PURE__ */ e(W, {
|
|
60
|
+
value: o.value,
|
|
61
|
+
placeholder: o.placeholder ?? t.search,
|
|
62
|
+
autoFocus: o.autoFocus,
|
|
63
|
+
onChange: o.onChange
|
|
63
64
|
})
|
|
64
65
|
}),
|
|
65
|
-
/* @__PURE__ */ e(
|
|
66
|
-
/* @__PURE__ */ e(
|
|
67
|
-
filters:
|
|
68
|
-
values:
|
|
66
|
+
/* @__PURE__ */ e(K, { tabs: F }),
|
|
67
|
+
/* @__PURE__ */ e(Y, {
|
|
68
|
+
filters: r,
|
|
69
|
+
values: d,
|
|
69
70
|
onFilterChange: C,
|
|
70
|
-
onClearFilters:
|
|
71
|
+
onClearFilters: u,
|
|
71
72
|
scroll: !0
|
|
72
73
|
}),
|
|
73
|
-
(
|
|
74
|
+
(s || p || g && g.pageCount > 1) && /* @__PURE__ */ i("div", {
|
|
74
75
|
className: "page-shell__result-row",
|
|
75
|
-
children: [(
|
|
76
|
+
children: [(s || p) && /* @__PURE__ */ i("button", {
|
|
76
77
|
type: "button",
|
|
77
78
|
className: "page-shell__result-line",
|
|
78
79
|
onClick: () => f("sort"),
|
|
79
|
-
children: [/* @__PURE__ */ e("span", { children:
|
|
80
|
+
children: [/* @__PURE__ */ e("span", { children: T || t.pageSortAndView }), /* @__PURE__ */ e(v, {
|
|
80
81
|
name: "caret-down",
|
|
81
82
|
size: "sm"
|
|
82
83
|
})]
|
|
83
|
-
}), /* @__PURE__ */ e(
|
|
84
|
+
}), /* @__PURE__ */ e(J, { pagination: g })]
|
|
84
85
|
}),
|
|
85
86
|
/* @__PURE__ */ e("div", {
|
|
86
87
|
className: "page-shell__content",
|
|
87
|
-
children:
|
|
88
|
+
children: B
|
|
88
89
|
}),
|
|
89
|
-
|
|
90
|
+
N && /* @__PURE__ */ e("div", {
|
|
91
|
+
className: "page-shell__aside page-shell__aside--stacked",
|
|
92
|
+
children: N
|
|
93
|
+
}),
|
|
94
|
+
k && /* @__PURE__ */ e("div", {
|
|
95
|
+
className: "page-shell__footer",
|
|
96
|
+
children: k
|
|
97
|
+
}),
|
|
98
|
+
a && /* @__PURE__ */ e("button", {
|
|
90
99
|
type: "button",
|
|
91
100
|
className: "page-shell__fab",
|
|
92
|
-
disabled:
|
|
93
|
-
onClick:
|
|
101
|
+
disabled: a.disabled,
|
|
102
|
+
onClick: a.onClick,
|
|
94
103
|
children: /* @__PURE__ */ e(v, {
|
|
95
|
-
name:
|
|
104
|
+
name: a.icon ?? "plus",
|
|
96
105
|
size: "lg"
|
|
97
106
|
})
|
|
98
107
|
}),
|
|
99
|
-
_ && /* @__PURE__ */ e(
|
|
100
|
-
/* @__PURE__ */ e(
|
|
101
|
-
isOpen:
|
|
108
|
+
_ && /* @__PURE__ */ e(X, { nav: h }),
|
|
109
|
+
/* @__PURE__ */ e(S, {
|
|
110
|
+
isOpen: w === "filters",
|
|
102
111
|
tall: !0,
|
|
103
112
|
title: t.filters,
|
|
104
113
|
onClose: c,
|
|
105
|
-
end: b > 0 &&
|
|
114
|
+
end: b > 0 && u ? /* @__PURE__ */ e("button", {
|
|
106
115
|
type: "button",
|
|
107
116
|
className: "page-shell__link",
|
|
108
|
-
onClick:
|
|
117
|
+
onClick: u,
|
|
109
118
|
children: t.pageClearAll
|
|
110
119
|
}) : void 0,
|
|
111
|
-
footer: /* @__PURE__ */ e(
|
|
120
|
+
footer: /* @__PURE__ */ e(A, {
|
|
112
121
|
variant: "info",
|
|
113
122
|
fullWidth: !0,
|
|
114
|
-
disabled:
|
|
123
|
+
disabled: m?.shown === 0,
|
|
115
124
|
onClick: c,
|
|
116
|
-
children:
|
|
125
|
+
children: m ? x(m.shown) : t.pageDone
|
|
117
126
|
}),
|
|
118
|
-
children: /* @__PURE__ */ e(
|
|
119
|
-
filters:
|
|
120
|
-
values:
|
|
127
|
+
children: /* @__PURE__ */ e(Z, {
|
|
128
|
+
filters: r,
|
|
129
|
+
values: d,
|
|
121
130
|
context: "sheet",
|
|
122
131
|
onFilterChange: C
|
|
123
132
|
})
|
|
124
133
|
}),
|
|
125
|
-
/* @__PURE__ */ e(
|
|
126
|
-
isOpen:
|
|
134
|
+
/* @__PURE__ */ e(S, {
|
|
135
|
+
isOpen: w === "sort",
|
|
127
136
|
title: t.pageSortAndView,
|
|
128
137
|
onClose: c,
|
|
129
|
-
footer: /* @__PURE__ */ e(
|
|
138
|
+
footer: /* @__PURE__ */ e(A, {
|
|
130
139
|
variant: "info",
|
|
131
140
|
fullWidth: !0,
|
|
132
141
|
onClick: c,
|
|
133
142
|
children: t.pageDone
|
|
134
143
|
}),
|
|
135
|
-
children: /* @__PURE__ */ e(
|
|
136
|
-
sort:
|
|
137
|
-
view:
|
|
144
|
+
children: /* @__PURE__ */ e(Q, {
|
|
145
|
+
sort: s,
|
|
146
|
+
view: p
|
|
138
147
|
})
|
|
139
|
-
})
|
|
148
|
+
}),
|
|
149
|
+
M
|
|
140
150
|
]
|
|
141
151
|
});
|
|
142
152
|
};
|
|
143
153
|
export {
|
|
144
|
-
|
|
154
|
+
_e as WorkbenchPhone
|
|
145
155
|
};
|
|
@@ -1,29 +1,30 @@
|
|
|
1
|
-
import { libMessages as
|
|
2
|
-
import { useMessages as
|
|
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 {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
1
|
+
import { libMessages as H } from "../../contexts/LanguageContext/libMessages.js";
|
|
2
|
+
import { useMessages as q } from "../../hooks/useLanguage.js";
|
|
3
|
+
import { Button as v } from "../Button/Button2.js";
|
|
4
|
+
import { InputSearch as z } from "../InputSearch/InputSearch2.js";
|
|
5
|
+
import { useBreakpoint as G } from "../../hooks/useBreakpoint.js";
|
|
6
|
+
import { Drawer as J } from "../Drawer/Drawer2.js";
|
|
7
|
+
import { useAppFrame as K } from "./useAppFrame.js";
|
|
8
|
+
import { countActiveFilters as Q } from "./filterRules.js";
|
|
9
|
+
import { getButtonActions as U, getMenuItems as I } from "./menuItems.js";
|
|
10
|
+
import { getHeadingText as X, getResultLabel as Y, hasViewExtras as Z } from "./shellText.js";
|
|
11
|
+
import { ActionButton as N, AppMark as O, PageMenu as P, PagePager as $, PageTabsRow as ee, SortDropdown as ae, ViewOptions as T, ViewToggle as se } from "./PageParts.js";
|
|
12
|
+
import { useConfirmedActions as le } from "./useConfirmedActions.js";
|
|
13
|
+
import { NavRail as te, SideNav as ie } from "./AppNav.js";
|
|
14
|
+
import { AppliedFilters as re, FilterSections as oe } from "./FilterSections.js";
|
|
15
|
+
import { WorkbenchPhone as ne } from "./WorkbenchPhone.js";
|
|
16
|
+
import { useState as ce } from "react";
|
|
16
17
|
import { jsx as e, jsxs as s } from "react/jsx-runtime";
|
|
17
|
-
var
|
|
18
|
-
const { isMobile:
|
|
19
|
-
if (
|
|
20
|
-
const { title:
|
|
21
|
-
}, onClearFilters: n, pagination:
|
|
18
|
+
var Me = (i) => {
|
|
19
|
+
const { isMobile: B, isTablet: a } = G(), l = q(H), t = K(), [D, g] = ce(!1), { primaryAction: p, actions: _, dialog: W } = le(i.primaryAction, i.actions ?? []);
|
|
20
|
+
if (B) return /* @__PURE__ */ e(ne, { ...i });
|
|
21
|
+
const { title: j, counts: b, search: o, sort: k, view: r, filters: h = [], values: u = {}, onFilterChange: w = () => {
|
|
22
|
+
}, onClearFilters: n, pagination: R, tabs: V, aside: d, footer: C, children: L } = i, A = i.status ?? t?.status, F = X(i, l), E = Y(i, l), m = Q(h, u), f = h.length > 0, x = t?.menuItems ?? [], c = t?.nav ?? [], M = /* @__PURE__ */ e(oe, {
|
|
22
23
|
filters: h,
|
|
23
24
|
values: u,
|
|
24
25
|
context: "panel",
|
|
25
26
|
onFilterChange: w
|
|
26
|
-
}),
|
|
27
|
+
}), S = m > 0 && /* @__PURE__ */ e("span", {
|
|
27
28
|
className: "page-shell__badge",
|
|
28
29
|
children: m
|
|
29
30
|
});
|
|
@@ -37,13 +38,13 @@ var ke = (o) => {
|
|
|
37
38
|
!a && /* @__PURE__ */ s("aside", {
|
|
38
39
|
className: "page-shell__side",
|
|
39
40
|
children: [
|
|
40
|
-
t && /* @__PURE__ */ e(
|
|
41
|
-
p && /* @__PURE__ */ e(
|
|
41
|
+
t && /* @__PURE__ */ e(O, { app: t.app }),
|
|
42
|
+
p && /* @__PURE__ */ e(N, {
|
|
42
43
|
action: p,
|
|
43
44
|
fullWidth: !0
|
|
44
45
|
}),
|
|
45
|
-
c.length > 1 && /* @__PURE__ */ e(
|
|
46
|
-
|
|
46
|
+
c.length > 1 && /* @__PURE__ */ e(ie, { nav: c }),
|
|
47
|
+
f && /* @__PURE__ */ s("div", {
|
|
47
48
|
className: "page-shell__side-group",
|
|
48
49
|
children: [/* @__PURE__ */ s("div", {
|
|
49
50
|
className: "page-shell__side-head",
|
|
@@ -52,7 +53,7 @@ var ke = (o) => {
|
|
|
52
53
|
className: "page-shell__group-title",
|
|
53
54
|
children: l.filters
|
|
54
55
|
}),
|
|
55
|
-
|
|
56
|
+
S,
|
|
56
57
|
/* @__PURE__ */ e("span", { className: "page-shell__spacer" }),
|
|
57
58
|
m > 0 && n && /* @__PURE__ */ e("button", {
|
|
58
59
|
type: "button",
|
|
@@ -61,12 +62,12 @@ var ke = (o) => {
|
|
|
61
62
|
children: l.pageClearAll
|
|
62
63
|
})
|
|
63
64
|
]
|
|
64
|
-
}),
|
|
65
|
+
}), M]
|
|
65
66
|
}),
|
|
66
|
-
r && /* @__PURE__ */ e(
|
|
67
|
+
r && /* @__PURE__ */ e(T, { view: r })
|
|
67
68
|
]
|
|
68
69
|
}),
|
|
69
|
-
a && c.length > 1 && /* @__PURE__ */ e(
|
|
70
|
+
a && c.length > 1 && /* @__PURE__ */ e(te, {
|
|
70
71
|
app: t?.app,
|
|
71
72
|
nav: c
|
|
72
73
|
}),
|
|
@@ -76,13 +77,13 @@ var ke = (o) => {
|
|
|
76
77
|
/* @__PURE__ */ s("header", {
|
|
77
78
|
className: "page-shell__toolbar",
|
|
78
79
|
children: [
|
|
79
|
-
a &&
|
|
80
|
+
a && f && /* @__PURE__ */ s(v, {
|
|
80
81
|
icon: "tune",
|
|
81
82
|
variant: "default",
|
|
82
|
-
onClick: () =>
|
|
83
|
-
children: [l.filters,
|
|
83
|
+
onClick: () => g(!0),
|
|
84
|
+
children: [l.filters, S]
|
|
84
85
|
}),
|
|
85
|
-
a && t && c.length <= 1 && /* @__PURE__ */ e(
|
|
86
|
+
a && t && c.length <= 1 && /* @__PURE__ */ e(O, {
|
|
86
87
|
app: t.app,
|
|
87
88
|
logoOnly: !0
|
|
88
89
|
}),
|
|
@@ -90,76 +91,89 @@ var ke = (o) => {
|
|
|
90
91
|
className: "page-shell__titles",
|
|
91
92
|
children: [/* @__PURE__ */ e("h1", {
|
|
92
93
|
className: "page-shell__title",
|
|
93
|
-
children:
|
|
94
|
-
}),
|
|
94
|
+
children: j
|
|
95
|
+
}), F && /* @__PURE__ */ e("p", {
|
|
95
96
|
className: "page-shell__heading",
|
|
96
|
-
children:
|
|
97
|
+
children: F
|
|
97
98
|
})]
|
|
98
99
|
}),
|
|
99
|
-
(!
|
|
100
|
-
a && p && /* @__PURE__ */ e(
|
|
101
|
-
a &&
|
|
102
|
-
a && /* @__PURE__ */ e(
|
|
100
|
+
(!o || a) && /* @__PURE__ */ e("span", { className: "page-shell__spacer" }),
|
|
101
|
+
a && p && /* @__PURE__ */ e(N, { action: p }),
|
|
102
|
+
a && A,
|
|
103
|
+
a && /* @__PURE__ */ e(P, { items: I(_, x, !0) }),
|
|
103
104
|
a && /* @__PURE__ */ e("span", { className: "page-shell__break" }),
|
|
104
|
-
|
|
105
|
+
o && /* @__PURE__ */ e(z, {
|
|
105
106
|
className: "page-shell__search",
|
|
106
|
-
value:
|
|
107
|
-
placeholder:
|
|
108
|
-
autoFocus:
|
|
109
|
-
onChange:
|
|
107
|
+
value: o.value,
|
|
108
|
+
placeholder: o.placeholder ?? l.search,
|
|
109
|
+
autoFocus: o.autoFocus,
|
|
110
|
+
onChange: o.onChange
|
|
110
111
|
}),
|
|
111
|
-
|
|
112
|
-
a && r && /* @__PURE__ */ e(
|
|
113
|
-
!a &&
|
|
114
|
-
!a &&
|
|
115
|
-
!a && /* @__PURE__ */ e(
|
|
112
|
+
k && /* @__PURE__ */ e(ae, { sort: k }),
|
|
113
|
+
a && r && /* @__PURE__ */ e(se, { view: r }),
|
|
114
|
+
!a && U(_).map((y) => /* @__PURE__ */ e(N, { action: y }, y.id)),
|
|
115
|
+
!a && A,
|
|
116
|
+
!a && /* @__PURE__ */ e(P, { items: I(_, x, !1) })
|
|
116
117
|
]
|
|
117
118
|
}),
|
|
118
|
-
/* @__PURE__ */ e(
|
|
119
|
+
/* @__PURE__ */ e(ee, { tabs: V }),
|
|
119
120
|
/* @__PURE__ */ s("div", {
|
|
120
121
|
className: "page-shell__status",
|
|
121
|
-
children: [/* @__PURE__ */ e(
|
|
122
|
+
children: [/* @__PURE__ */ e(re, {
|
|
122
123
|
filters: h,
|
|
123
124
|
values: u,
|
|
124
125
|
onFilterChange: w,
|
|
125
126
|
onClearFilters: n
|
|
126
|
-
}), /* @__PURE__ */ e(
|
|
127
|
+
}), /* @__PURE__ */ e($, { pagination: R })]
|
|
127
128
|
}),
|
|
128
129
|
/* @__PURE__ */ e("div", {
|
|
129
130
|
className: "page-shell__content",
|
|
130
|
-
children:
|
|
131
|
+
children: L
|
|
132
|
+
}),
|
|
133
|
+
a && d && /* @__PURE__ */ e("div", {
|
|
134
|
+
className: "page-shell__aside page-shell__aside--stacked",
|
|
135
|
+
children: d
|
|
136
|
+
}),
|
|
137
|
+
C && /* @__PURE__ */ e("div", {
|
|
138
|
+
className: "page-shell__footer",
|
|
139
|
+
children: C
|
|
131
140
|
})
|
|
132
141
|
]
|
|
133
142
|
}),
|
|
134
|
-
a &&
|
|
135
|
-
|
|
136
|
-
|
|
143
|
+
!a && d && /* @__PURE__ */ e("aside", {
|
|
144
|
+
className: "page-shell__aside page-shell__aside--docked",
|
|
145
|
+
children: d
|
|
146
|
+
}),
|
|
147
|
+
a && f && /* @__PURE__ */ e(J, {
|
|
148
|
+
isOpen: D,
|
|
149
|
+
onClose: () => g(!1),
|
|
137
150
|
position: "left",
|
|
138
151
|
title: l.filters,
|
|
139
152
|
footer: /* @__PURE__ */ s("div", {
|
|
140
153
|
className: "page-shell__drawer-footer",
|
|
141
|
-
children: [m > 0 && n && /* @__PURE__ */ e(
|
|
154
|
+
children: [m > 0 && n && /* @__PURE__ */ e(v, {
|
|
142
155
|
variant: "default",
|
|
143
156
|
onClick: n,
|
|
144
157
|
children: l.pageClearAll
|
|
145
|
-
}),
|
|
158
|
+
}), b && /* @__PURE__ */ e(v, {
|
|
146
159
|
variant: "info",
|
|
147
160
|
fullWidth: !0,
|
|
148
|
-
onClick: () =>
|
|
149
|
-
children:
|
|
161
|
+
onClick: () => g(!1),
|
|
162
|
+
children: E(b.shown)
|
|
150
163
|
})]
|
|
151
164
|
}),
|
|
152
165
|
children: /* @__PURE__ */ s("div", {
|
|
153
166
|
className: "page-shell__drawer-body",
|
|
154
|
-
children: [
|
|
167
|
+
children: [M, r && Z(r) && /* @__PURE__ */ e(T, {
|
|
155
168
|
view: r,
|
|
156
169
|
showToggle: !1
|
|
157
170
|
})]
|
|
158
171
|
})
|
|
159
|
-
})
|
|
172
|
+
}),
|
|
173
|
+
W
|
|
160
174
|
]
|
|
161
175
|
});
|
|
162
176
|
};
|
|
163
177
|
export {
|
|
164
|
-
|
|
178
|
+
Me as WorkbenchShell
|
|
165
179
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import { formatAppDate as
|
|
2
|
-
var
|
|
3
|
-
const [r, i] =
|
|
1
|
+
import { formatAppDate as d } from "../../helpers/Datetime.js";
|
|
2
|
+
var A = 4, k = 24, v = 10, S = 8, M = 14, h = (t) => typeof t == "string" || typeof t == "number", u = (t) => Array.isArray(t) ? t.filter(h) : [], f = (t) => h(t) && t !== "" ? t : null, x = (t) => typeof t == "number" ? t : 0, y = (t, n, e) => {
|
|
3
|
+
const [r, i] = u(t);
|
|
4
4
|
return [typeof r == "number" ? r : n, typeof i == "number" ? i : e];
|
|
5
|
-
},
|
|
6
|
-
const [n, e] =
|
|
5
|
+
}, b = (t) => {
|
|
6
|
+
const [n, e] = u(t);
|
|
7
7
|
return [typeof n == "string" ? n : "", typeof e == "string" ? e : ""];
|
|
8
|
-
}, C = (t) => typeof t == "object" && t !== null && !Array.isArray(t),
|
|
8
|
+
}, C = (t) => typeof t == "object" && t !== null && !Array.isArray(t), c = (t) => C(t) ? t : { text: "" }, w = (t, n) => t.wordMatch ? [{
|
|
9
9
|
value: "or",
|
|
10
10
|
label: n.anyWord
|
|
11
11
|
}, {
|
|
12
12
|
value: "and",
|
|
13
13
|
label: n.allWords
|
|
14
|
-
}] : t.modes,
|
|
14
|
+
}] : t.modes, E = (t) => {
|
|
15
15
|
if (t.defaultValue !== void 0) return t.defaultValue;
|
|
16
16
|
switch (t.kind) {
|
|
17
17
|
case "multi":
|
|
@@ -28,108 +28,121 @@ var $ = 4, S = 24, k = 10, M = 8, v = 14, s = (t) => typeof t == "string" || typ
|
|
|
28
28
|
default:
|
|
29
29
|
return null;
|
|
30
30
|
}
|
|
31
|
-
},
|
|
32
|
-
if (t.defaultValue !== void 0) return
|
|
31
|
+
}, g = (t) => JSON.stringify(Array.isArray(t) ? [...t].map(String).sort() : t ?? null), $ = (t, n) => {
|
|
32
|
+
if (t.defaultValue !== void 0) return g(n) !== g(t.defaultValue);
|
|
33
33
|
switch (t.kind) {
|
|
34
34
|
case "single":
|
|
35
35
|
case "date":
|
|
36
36
|
return f(n) !== null;
|
|
37
37
|
case "multi":
|
|
38
|
-
return
|
|
38
|
+
return u(n).length > 0;
|
|
39
39
|
case "range": {
|
|
40
40
|
const [e, r] = y(n, t.min, t.max);
|
|
41
41
|
return e > t.min || r < t.max;
|
|
42
42
|
}
|
|
43
43
|
case "rating":
|
|
44
|
-
return
|
|
44
|
+
return x(n) > 0;
|
|
45
45
|
case "toggle":
|
|
46
46
|
return n === !0;
|
|
47
47
|
case "text":
|
|
48
|
-
return
|
|
48
|
+
return c(n).text.trim() !== "";
|
|
49
49
|
case "date-range":
|
|
50
|
-
return
|
|
50
|
+
return b(n).some((e) => e !== "");
|
|
51
51
|
}
|
|
52
|
-
},
|
|
52
|
+
}, T = (t, n) => t.filter((e) => $(e, n[e.id])).length, m = (t, n) => t.find((e) => e.value === n)?.label ?? String(n), _ = (t, n) => {
|
|
53
53
|
if (t.kind !== "single" && t.kind !== "multi") return null;
|
|
54
54
|
if (t.control) return t.control;
|
|
55
55
|
const e = t.options.length;
|
|
56
56
|
if (t.kind === "single") {
|
|
57
|
-
if (e >
|
|
58
|
-
const r = t.options.reduce((i,
|
|
59
|
-
return e <=
|
|
57
|
+
if (e > v) return "search-list";
|
|
58
|
+
const r = t.options.reduce((i, l) => i + l.label.length, 3);
|
|
59
|
+
return e <= A && r <= k ? "segmented" : n === "sheet" ? "chips" : "radio";
|
|
60
60
|
}
|
|
61
|
-
return e >
|
|
62
|
-
},
|
|
61
|
+
return e > M ? "search-list" : e <= S || n === "sheet" ? "chips" : "checklist";
|
|
62
|
+
}, V = (t, n, e) => {
|
|
63
63
|
switch (t.kind) {
|
|
64
64
|
case "single": {
|
|
65
65
|
const r = f(n);
|
|
66
66
|
return r === null ? `${t.label}: ${e.any}` : m(t.options, r);
|
|
67
67
|
}
|
|
68
68
|
case "multi": {
|
|
69
|
-
const r =
|
|
69
|
+
const r = u(n);
|
|
70
|
+
if (t.chips === "excluded") {
|
|
71
|
+
const i = t.options.filter((l) => !r.includes(l.value));
|
|
72
|
+
return i.length === 1 ? e.without(i[0].label) : e.selectedCount(r.length);
|
|
73
|
+
}
|
|
70
74
|
return r.length === 1 ? m(t.options, r[0]) : e.selectedCount(r.length);
|
|
71
75
|
}
|
|
72
76
|
case "range": {
|
|
73
|
-
const [r, i] = y(n, t.min, t.max),
|
|
74
|
-
return r > t.min && i < t.max ? `${r}–${i}${
|
|
77
|
+
const [r, i] = y(n, t.min, t.max), l = t.unit ? ` ${t.unit}` : "";
|
|
78
|
+
return r > t.min && i < t.max ? `${r}–${i}${l}` : r > t.min ? `≥ ${r}${l}` : `≤ ${i}${l}`;
|
|
75
79
|
}
|
|
76
80
|
case "rating":
|
|
77
|
-
return e.ratingAtLeast(
|
|
81
|
+
return e.ratingAtLeast(x(n));
|
|
78
82
|
case "toggle":
|
|
79
83
|
return t.label;
|
|
80
84
|
case "text": {
|
|
81
|
-
const { text: r, mode: i } =
|
|
85
|
+
const { text: r, mode: i } = c(n), l = w(t, e), o = l && i !== l[0]?.value ? l.find((a) => a.value === i)?.label : void 0;
|
|
82
86
|
return o ? `“${r.trim()}” · ${o}` : `“${r.trim()}”`;
|
|
83
87
|
}
|
|
84
88
|
case "date": {
|
|
85
89
|
const r = f(n);
|
|
86
90
|
if (r === null) return "";
|
|
87
|
-
const i =
|
|
91
|
+
const i = d(String(r));
|
|
88
92
|
return t.relation === "until" ? e.dateUntil(i) : e.dateSince(i);
|
|
89
93
|
}
|
|
90
94
|
case "date-range": {
|
|
91
|
-
const [r, i] =
|
|
92
|
-
return r && i ? `${
|
|
95
|
+
const [r, i] = b(n);
|
|
96
|
+
return r && i ? `${d(r)} – ${d(i)}` : r ? e.dateSince(d(r)) : i ? e.dateUntil(d(i)) : "";
|
|
93
97
|
}
|
|
94
98
|
}
|
|
95
|
-
},
|
|
99
|
+
}, D = (t, n, e) => t.flatMap((r) => {
|
|
96
100
|
const i = n[r.id];
|
|
97
|
-
if (
|
|
101
|
+
if (!$(r, i)) return [];
|
|
102
|
+
if (r.kind === "multi" && r.chips === "excluded") {
|
|
103
|
+
const o = u(i);
|
|
104
|
+
return r.options.filter((a) => !o.includes(a.value)).map((a) => ({
|
|
105
|
+
key: `${r.id}:${a.value}`,
|
|
106
|
+
filterId: r.id,
|
|
107
|
+
label: e.without(a.label),
|
|
108
|
+
next: [...o, a.value]
|
|
109
|
+
}));
|
|
110
|
+
}
|
|
98
111
|
if (r.kind === "multi") {
|
|
99
|
-
const o =
|
|
100
|
-
return o.map((
|
|
101
|
-
key: `${r.id}:${
|
|
112
|
+
const o = u(i);
|
|
113
|
+
return o.map((a) => ({
|
|
114
|
+
key: `${r.id}:${a}`,
|
|
102
115
|
filterId: r.id,
|
|
103
|
-
label: m(r.options,
|
|
104
|
-
next: o.filter((
|
|
116
|
+
label: m(r.options, a),
|
|
117
|
+
next: o.filter((s) => s !== a)
|
|
105
118
|
}));
|
|
106
119
|
}
|
|
107
|
-
const
|
|
108
|
-
...
|
|
120
|
+
const l = r.kind === "text" ? {
|
|
121
|
+
...c(i),
|
|
109
122
|
text: ""
|
|
110
|
-
} :
|
|
123
|
+
} : E(r);
|
|
111
124
|
return [{
|
|
112
125
|
key: r.id,
|
|
113
126
|
filterId: r.id,
|
|
114
|
-
label:
|
|
115
|
-
next:
|
|
127
|
+
label: V(r, i, e),
|
|
128
|
+
next: l
|
|
116
129
|
}];
|
|
117
130
|
});
|
|
118
131
|
export {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
132
|
+
T as countActiveFilters,
|
|
133
|
+
E as defaultFilterValue,
|
|
134
|
+
V as filterSummary,
|
|
135
|
+
D as getAppliedFilters,
|
|
136
|
+
w as getTextModes,
|
|
137
|
+
$ as isFilterActive,
|
|
138
|
+
h as isScalar,
|
|
126
139
|
C as isTextFilterValue,
|
|
127
140
|
m as optionLabel,
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
141
|
+
_ as pickControl,
|
|
142
|
+
b as toDateRange,
|
|
143
|
+
u as toList,
|
|
144
|
+
x as toNumber,
|
|
132
145
|
y as toRange,
|
|
133
146
|
f as toScalar,
|
|
134
|
-
|
|
147
|
+
c as toText
|
|
135
148
|
};
|