@memobit/libs 3.28.2 → 3.29.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/Auth/ChangePasswordModal/ChangePasswordModal2.js +7 -7
- package/dist/components/Auth/Login/Login2.js +4 -4
- package/dist/components/Auth/MfaSetupModal/MfaSetupModal2.js +6 -6
- package/dist/components/DataView/DataView.CardView.js +84 -84
- package/dist/components/MenuHamburger/MenuHamburger2.js +14 -14
- package/dist/components/PageShell/AppFrame.js +27 -0
- package/dist/components/PageShell/BottomSheet.js +45 -0
- package/dist/components/PageShell/FilterField.css +1 -0
- package/dist/components/PageShell/FilterField2.js +294 -0
- package/dist/components/PageShell/FilterSections.js +86 -0
- package/dist/components/PageShell/PageParts.js +257 -0
- package/dist/components/PageShell/PageShell.css +1 -0
- package/dist/components/PageShell/PageShell2.js +11 -0
- package/dist/components/PageShell/WorkbenchPhone.js +139 -0
- package/dist/components/PageShell/WorkbenchShell.js +154 -0
- package/dist/components/PageShell/filterRules.js +123 -0
- package/dist/components/PageShell/filterValues.js +30 -0
- package/dist/components/PageShell/menuItems.js +9 -0
- package/dist/components/PageShell/shellText.js +39 -0
- package/dist/components/PageShell/useAppFrame.js +6 -0
- package/dist/components/PageShell/usePaging.js +23 -0
- package/dist/components/PageShell/usePruneStaleFilters.js +17 -0
- package/dist/components/PageShell/useSummaryMessages.js +17 -0
- package/dist/components/Pagination/Pagination.css +1 -1
- package/dist/components/Pagination/Pagination2.js +14 -13
- package/dist/components/ScrollToTop/ScrollToTop.css +1 -1
- package/dist/components/ScrollToTop/ScrollToTop2.js +20 -19
- package/dist/contexts/LanguageContext/libMessages.js +55 -7
- package/dist/helpers/VersionInfo.js +1 -1
- package/dist/hooks/useAccountMenu.js +6 -6
- package/dist/index.d.ts +299 -0
- package/dist/index.js +235 -213
- package/dist/version.js +2 -2
- package/dist/version.json +4 -4
- package/package.json +147 -147
|
@@ -0,0 +1,294 @@
|
|
|
1
|
+
import './FilterField.css';
|
|
2
|
+
import { Icon as D } from "../Icon/Icon2.js";
|
|
3
|
+
import { libMessages as g } from "../../contexts/LanguageContext/libMessages.js";
|
|
4
|
+
import { useMessages as b } from "../../hooks/useLanguage.js";
|
|
5
|
+
import { formatDate as L } from "../../helpers/Datetime.js";
|
|
6
|
+
import { Chip as j } from "../Chip/Chip2.js";
|
|
7
|
+
import { DatePicker as z } from "../DatePicker/DatePicker2.js";
|
|
8
|
+
import { InputSearch as F } from "../InputSearch/InputSearch2.js";
|
|
9
|
+
import { Rating as C } from "../Rating/Rating2.js";
|
|
10
|
+
import { ToggleSwitch as T } from "../ToggleSwitch/ToggleSwitch2.js";
|
|
11
|
+
import { RangeSlider as W } from "../RangeSlider/RangeSlider2.js";
|
|
12
|
+
import { getTextModes as Y, pickControl as I, toList as O, toNumber as B, toRange as E, toScalar as M, toText as V } from "./filterRules.js";
|
|
13
|
+
/* empty css */
|
|
14
|
+
import { useEffect as q, useState as w } from "react";
|
|
15
|
+
import { jsx as t, jsxs as u } from "react/jsx-runtime";
|
|
16
|
+
var N = ({ items: e, value: r, onSelect: n }) => /* @__PURE__ */ t("div", {
|
|
17
|
+
className: "filter-field__segmented",
|
|
18
|
+
children: e.map((l) => /* @__PURE__ */ t("button", {
|
|
19
|
+
type: "button",
|
|
20
|
+
className: ["filter-field__segment", l.value === r ? "filter-field__segment--selected" : ""].filter(Boolean).join(" "),
|
|
21
|
+
onClick: () => n(l.value),
|
|
22
|
+
children: l.label
|
|
23
|
+
}, String(l.value)))
|
|
24
|
+
}), x = ({ label: e, mark: r, selected: n, count: l, icon: a, onClick: c }) => /* @__PURE__ */ u("button", {
|
|
25
|
+
type: "button",
|
|
26
|
+
className: [
|
|
27
|
+
"filter-field__row",
|
|
28
|
+
n ? "filter-field__row--selected" : "",
|
|
29
|
+
l === 0 && !n ? "filter-field__row--empty" : ""
|
|
30
|
+
].filter(Boolean).join(" "),
|
|
31
|
+
onClick: c,
|
|
32
|
+
children: [
|
|
33
|
+
/* @__PURE__ */ t("span", {
|
|
34
|
+
className: `filter-field__mark filter-field__mark--${r}`,
|
|
35
|
+
children: r === "check" && n && /* @__PURE__ */ t(D, {
|
|
36
|
+
name: "checkmark",
|
|
37
|
+
size: "sm"
|
|
38
|
+
})
|
|
39
|
+
}),
|
|
40
|
+
a && /* @__PURE__ */ t(D, {
|
|
41
|
+
name: a,
|
|
42
|
+
size: "sm"
|
|
43
|
+
}),
|
|
44
|
+
/* @__PURE__ */ t("span", {
|
|
45
|
+
className: "filter-field__row-label",
|
|
46
|
+
children: e
|
|
47
|
+
}),
|
|
48
|
+
l !== void 0 && /* @__PURE__ */ t("span", {
|
|
49
|
+
className: "filter-field__count",
|
|
50
|
+
children: l
|
|
51
|
+
})
|
|
52
|
+
]
|
|
53
|
+
}), P = (e, r) => e.includes(r) ? e.filter((n) => n !== r) : [...e, r], Q = ({ spec: e, value: r, context: n, onChange: l }) => {
|
|
54
|
+
const a = b(g), [c, d] = w(""), [s, o] = w(!1), f = I(e, n), p = e.kind === "single", _ = p ? [M(r)].filter((i) => i !== null) : O(r), h = (i) => _.includes(i.value), y = (i) => {
|
|
55
|
+
if (!p) {
|
|
56
|
+
l(P(_, i.value));
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
l(h(i) && f !== "radio" ? null : i.value);
|
|
60
|
+
};
|
|
61
|
+
if (f === "segmented") {
|
|
62
|
+
const i = [{
|
|
63
|
+
value: null,
|
|
64
|
+
label: a.pageAny
|
|
65
|
+
}, ...e.options.map((m) => ({
|
|
66
|
+
value: m.value,
|
|
67
|
+
label: m.label
|
|
68
|
+
}))];
|
|
69
|
+
return /* @__PURE__ */ t(N, {
|
|
70
|
+
items: i,
|
|
71
|
+
value: _[0] ?? null,
|
|
72
|
+
onSelect: (m) => l(m)
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
if (f === "chips") return /* @__PURE__ */ t("div", {
|
|
76
|
+
className: "filter-field__chips",
|
|
77
|
+
children: e.options.map((i) => /* @__PURE__ */ t(j, {
|
|
78
|
+
color: i.color,
|
|
79
|
+
count: i.count,
|
|
80
|
+
icon: i.icon,
|
|
81
|
+
selected: h(i),
|
|
82
|
+
size: n === "sheet" ? "medium" : "small",
|
|
83
|
+
onClick: () => y(i),
|
|
84
|
+
children: i.label
|
|
85
|
+
}, i.value))
|
|
86
|
+
});
|
|
87
|
+
const R = p ? "radio" : "check", v = (i) => /* @__PURE__ */ t(x, {
|
|
88
|
+
label: i.label,
|
|
89
|
+
mark: R,
|
|
90
|
+
selected: h(i),
|
|
91
|
+
count: i.count,
|
|
92
|
+
icon: i.icon,
|
|
93
|
+
onClick: () => y(i)
|
|
94
|
+
}, i.value);
|
|
95
|
+
if (f === "search-list") {
|
|
96
|
+
const i = c.trim().toLowerCase(), m = e.options.filter(h), k = e.options.filter((A) => !h(A) && (!i || A.label.toLowerCase().includes(i)));
|
|
97
|
+
return /* @__PURE__ */ u("div", {
|
|
98
|
+
className: "filter-field__stack",
|
|
99
|
+
children: [/* @__PURE__ */ t(F, {
|
|
100
|
+
value: c,
|
|
101
|
+
placeholder: a.pageSearchOptions(e.label),
|
|
102
|
+
onChange: d
|
|
103
|
+
}), /* @__PURE__ */ u("div", {
|
|
104
|
+
className: "filter-field__options",
|
|
105
|
+
children: [
|
|
106
|
+
m.map(v),
|
|
107
|
+
m.length > 0 && k.length > 0 && /* @__PURE__ */ t("div", { className: "filter-field__divider" }),
|
|
108
|
+
k.map(v),
|
|
109
|
+
m.length === 0 && k.length === 0 && /* @__PURE__ */ t("span", {
|
|
110
|
+
className: "filter-field__empty",
|
|
111
|
+
children: a.pageNoMatches
|
|
112
|
+
})
|
|
113
|
+
]
|
|
114
|
+
})]
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
if (f === "radio") return /* @__PURE__ */ u("div", {
|
|
118
|
+
className: "filter-field__rows",
|
|
119
|
+
children: [/* @__PURE__ */ t(x, {
|
|
120
|
+
label: a.pageAny,
|
|
121
|
+
mark: "radio",
|
|
122
|
+
selected: _.length === 0,
|
|
123
|
+
onClick: () => l(null)
|
|
124
|
+
}), e.options.map(v)]
|
|
125
|
+
});
|
|
126
|
+
const S = e.options.length > 7, $ = S && !s ? e.options.filter((i, m) => m < 6 || h(i)) : e.options;
|
|
127
|
+
return /* @__PURE__ */ u("div", {
|
|
128
|
+
className: "filter-field__stack",
|
|
129
|
+
children: [/* @__PURE__ */ t("div", {
|
|
130
|
+
className: "filter-field__rows",
|
|
131
|
+
children: $.map(v)
|
|
132
|
+
}), S && /* @__PURE__ */ t("button", {
|
|
133
|
+
type: "button",
|
|
134
|
+
className: "filter-field__link",
|
|
135
|
+
onClick: () => o(!s),
|
|
136
|
+
children: s ? a.pageShowFewer : a.pageShowAll(e.options.length)
|
|
137
|
+
})]
|
|
138
|
+
});
|
|
139
|
+
}, G = ({ spec: e, value: r, onChange: n }) => {
|
|
140
|
+
const [l, a] = E(r, e.min, e.max), [c, d] = w([l, a]);
|
|
141
|
+
q(() => d([l, a]), [l, a]);
|
|
142
|
+
const s = ([o, f]) => n(o <= e.min && f >= e.max ? null : [o, f]);
|
|
143
|
+
return /* @__PURE__ */ t(W, {
|
|
144
|
+
min: e.min,
|
|
145
|
+
max: e.max,
|
|
146
|
+
step: e.step,
|
|
147
|
+
value: c,
|
|
148
|
+
showValues: !0,
|
|
149
|
+
formatValue: (o) => e.unit ? `${o} ${e.unit}` : String(o),
|
|
150
|
+
onChange: d,
|
|
151
|
+
onChangeEnd: s
|
|
152
|
+
});
|
|
153
|
+
}, J = ({ spec: e, value: r, onChange: n }) => {
|
|
154
|
+
const l = b(g), a = B(r);
|
|
155
|
+
if (e.max <= 5) {
|
|
156
|
+
const c = Array.from({ length: e.max - 1 }, (s, o) => o + 2), d = [{
|
|
157
|
+
value: 0,
|
|
158
|
+
label: l.pageAny
|
|
159
|
+
}, ...c.map((s) => ({
|
|
160
|
+
value: s,
|
|
161
|
+
label: s === e.max ? `${s}★` : `${s}★+`
|
|
162
|
+
}))];
|
|
163
|
+
return /* @__PURE__ */ t(N, {
|
|
164
|
+
items: d,
|
|
165
|
+
value: a,
|
|
166
|
+
onSelect: (s) => n(typeof s == "number" ? s : 0)
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
return /* @__PURE__ */ u("div", {
|
|
170
|
+
className: "filter-field__rating",
|
|
171
|
+
children: [/* @__PURE__ */ t(C, {
|
|
172
|
+
rating: a,
|
|
173
|
+
maxRate: e.max,
|
|
174
|
+
selectable: !0,
|
|
175
|
+
onSelect: (c) => n(c === a ? 0 : c)
|
|
176
|
+
}), a > 0 && /* @__PURE__ */ t("button", {
|
|
177
|
+
type: "button",
|
|
178
|
+
className: "filter-field__link",
|
|
179
|
+
onClick: () => n(0),
|
|
180
|
+
children: l.pageAny
|
|
181
|
+
})]
|
|
182
|
+
});
|
|
183
|
+
}, K = ({ spec: e, value: r, onChange: n }) => {
|
|
184
|
+
const l = b(g), { text: a, mode: c } = V(r), d = Y(e, {
|
|
185
|
+
anyWord: l.pageAnyWord,
|
|
186
|
+
allWords: l.pageAllWords
|
|
187
|
+
}), s = c ?? d?.[0]?.value;
|
|
188
|
+
return /* @__PURE__ */ u("div", {
|
|
189
|
+
className: "filter-field__stack",
|
|
190
|
+
children: [/* @__PURE__ */ t(F, {
|
|
191
|
+
value: a,
|
|
192
|
+
placeholder: e.placeholder,
|
|
193
|
+
onChange: (o) => n({
|
|
194
|
+
text: o,
|
|
195
|
+
mode: s
|
|
196
|
+
})
|
|
197
|
+
}), d && /* @__PURE__ */ t(N, {
|
|
198
|
+
items: d.map((o) => ({
|
|
199
|
+
value: o.value,
|
|
200
|
+
label: o.label
|
|
201
|
+
})),
|
|
202
|
+
value: s ?? null,
|
|
203
|
+
onSelect: (o) => n({
|
|
204
|
+
text: a,
|
|
205
|
+
mode: o === null ? void 0 : String(o)
|
|
206
|
+
})
|
|
207
|
+
})]
|
|
208
|
+
});
|
|
209
|
+
}, U = (e) => {
|
|
210
|
+
if (e === null) return;
|
|
211
|
+
const [r, n, l] = String(e).split("-").map(Number);
|
|
212
|
+
return r && n && l ? new Date(r, n - 1, l) : void 0;
|
|
213
|
+
}, X = ({ value: e, onChange: r }) => {
|
|
214
|
+
const n = b(g);
|
|
215
|
+
return /* @__PURE__ */ t(z, {
|
|
216
|
+
value: U(M(e)),
|
|
217
|
+
placeholder: n.selectDate,
|
|
218
|
+
clearable: !0,
|
|
219
|
+
onChange: (l) => r(l instanceof Date ? L(l, "YYYY-MM-DD") : null)
|
|
220
|
+
});
|
|
221
|
+
}, fe = ({ spec: e, value: r, context: n, onChange: l }) => {
|
|
222
|
+
const a = `filter-field filter-field--${n}`;
|
|
223
|
+
switch (e.kind) {
|
|
224
|
+
case "single":
|
|
225
|
+
case "multi":
|
|
226
|
+
return /* @__PURE__ */ t("div", {
|
|
227
|
+
className: a,
|
|
228
|
+
children: /* @__PURE__ */ t(Q, {
|
|
229
|
+
spec: e,
|
|
230
|
+
value: r,
|
|
231
|
+
context: n,
|
|
232
|
+
onChange: l
|
|
233
|
+
})
|
|
234
|
+
});
|
|
235
|
+
case "range":
|
|
236
|
+
return /* @__PURE__ */ t("div", {
|
|
237
|
+
className: a,
|
|
238
|
+
children: /* @__PURE__ */ t(G, {
|
|
239
|
+
spec: e,
|
|
240
|
+
value: r,
|
|
241
|
+
onChange: l
|
|
242
|
+
})
|
|
243
|
+
});
|
|
244
|
+
case "rating":
|
|
245
|
+
return /* @__PURE__ */ t("div", {
|
|
246
|
+
className: a,
|
|
247
|
+
children: /* @__PURE__ */ t(J, {
|
|
248
|
+
spec: e,
|
|
249
|
+
value: r,
|
|
250
|
+
onChange: l
|
|
251
|
+
})
|
|
252
|
+
});
|
|
253
|
+
case "toggle": {
|
|
254
|
+
const c = r === !0;
|
|
255
|
+
return /* @__PURE__ */ u("div", {
|
|
256
|
+
className: `${a} filter-field__switch-row`,
|
|
257
|
+
children: [/* @__PURE__ */ t("button", {
|
|
258
|
+
type: "button",
|
|
259
|
+
className: "filter-field__switch-label",
|
|
260
|
+
onClick: () => l(!c),
|
|
261
|
+
children: e.label
|
|
262
|
+
}), /* @__PURE__ */ t(T, {
|
|
263
|
+
checked: c,
|
|
264
|
+
size: "small",
|
|
265
|
+
showLabels: !1,
|
|
266
|
+
onChange: l
|
|
267
|
+
})]
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
case "text":
|
|
271
|
+
return /* @__PURE__ */ t("div", {
|
|
272
|
+
className: a,
|
|
273
|
+
children: /* @__PURE__ */ t(K, {
|
|
274
|
+
spec: e,
|
|
275
|
+
value: r,
|
|
276
|
+
onChange: l
|
|
277
|
+
})
|
|
278
|
+
});
|
|
279
|
+
case "date":
|
|
280
|
+
return /* @__PURE__ */ t("div", {
|
|
281
|
+
className: a,
|
|
282
|
+
children: /* @__PURE__ */ t(X, {
|
|
283
|
+
spec: e,
|
|
284
|
+
value: r,
|
|
285
|
+
onChange: l
|
|
286
|
+
})
|
|
287
|
+
});
|
|
288
|
+
}
|
|
289
|
+
};
|
|
290
|
+
export {
|
|
291
|
+
fe as FilterField,
|
|
292
|
+
x as OptionRow,
|
|
293
|
+
N as Segmented
|
|
294
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { Icon as _ } from "../Icon/Icon2.js";
|
|
2
|
+
import { libMessages as v } from "../../contexts/LanguageContext/libMessages.js";
|
|
3
|
+
import { useMessages as y } from "../../hooks/useLanguage.js";
|
|
4
|
+
import { Chip as b } from "../Chip/Chip2.js";
|
|
5
|
+
import { filterSummary as k, getAppliedFilters as A, isFilterActive as u } from "./filterRules.js";
|
|
6
|
+
import { FilterField as C } from "./FilterField2.js";
|
|
7
|
+
import { useSummaryMessages as h } from "./useSummaryMessages.js";
|
|
8
|
+
import { useState as F } from "react";
|
|
9
|
+
import { jsx as s, jsxs as g } from "react/jsx-runtime";
|
|
10
|
+
var S = 3, M = (r, n) => {
|
|
11
|
+
const a = r.filter((l) => l.kind !== "toggle"), i = a.filter((l) => l.priority === "pinned"), o = i.length > 0 ? i : a.slice(0, S), p = a.filter((l) => u(l, n[l.id]));
|
|
12
|
+
return new Set([...o, ...p].map((l) => l.id));
|
|
13
|
+
}, B = ({ filters: r, values: n, context: a, onFilterChange: i }) => {
|
|
14
|
+
const o = h(), [p, l] = F(() => M(r, n)), d = (e) => l((m) => {
|
|
15
|
+
const t = new Set(m);
|
|
16
|
+
return t.has(e) ? t.delete(e) : t.add(e), t;
|
|
17
|
+
});
|
|
18
|
+
return /* @__PURE__ */ s("div", {
|
|
19
|
+
className: `page-filters page-filters--${a}`,
|
|
20
|
+
children: r.map((e) => {
|
|
21
|
+
const m = n[e.id], t = /* @__PURE__ */ s(C, {
|
|
22
|
+
spec: e,
|
|
23
|
+
value: m,
|
|
24
|
+
context: a,
|
|
25
|
+
onChange: (N) => i(e.id, N)
|
|
26
|
+
});
|
|
27
|
+
if (e.kind === "toggle") return /* @__PURE__ */ s("div", {
|
|
28
|
+
className: "page-filters__flat",
|
|
29
|
+
children: t
|
|
30
|
+
}, e.id);
|
|
31
|
+
const c = p.has(e.id), f = u(e, m);
|
|
32
|
+
return /* @__PURE__ */ g("div", {
|
|
33
|
+
className: "page-filters__section",
|
|
34
|
+
children: [/* @__PURE__ */ g("button", {
|
|
35
|
+
type: "button",
|
|
36
|
+
className: "page-filters__header",
|
|
37
|
+
onClick: () => d(e.id),
|
|
38
|
+
children: [
|
|
39
|
+
/* @__PURE__ */ s("span", {
|
|
40
|
+
className: "page-filters__label",
|
|
41
|
+
children: e.label
|
|
42
|
+
}),
|
|
43
|
+
!c && f ? /* @__PURE__ */ s("span", {
|
|
44
|
+
className: "page-filters__summary",
|
|
45
|
+
children: k(e, m, o)
|
|
46
|
+
}) : /* @__PURE__ */ s("span", { className: "page-filters__spacer" }),
|
|
47
|
+
c && f && /* @__PURE__ */ s("span", { className: "page-filters__dot" }),
|
|
48
|
+
/* @__PURE__ */ s(_, {
|
|
49
|
+
name: c ? "caret-down" : "caret-right",
|
|
50
|
+
size: "sm"
|
|
51
|
+
})
|
|
52
|
+
]
|
|
53
|
+
}), c && /* @__PURE__ */ s("div", {
|
|
54
|
+
className: "page-filters__body",
|
|
55
|
+
children: t
|
|
56
|
+
})]
|
|
57
|
+
}, e.id);
|
|
58
|
+
})
|
|
59
|
+
});
|
|
60
|
+
}, D = ({ filters: r, values: n, onFilterChange: a, onClearFilters: i, scroll: o = !1 }) => {
|
|
61
|
+
const p = y(v), l = h(), d = A(r, n, l);
|
|
62
|
+
return d.length === 0 ? null : /* @__PURE__ */ g("div", {
|
|
63
|
+
className: ["page-applied", o ? "page-applied--scroll" : ""].filter(Boolean).join(" "),
|
|
64
|
+
children: [d.map((e) => /* @__PURE__ */ g(b, {
|
|
65
|
+
selected: !0,
|
|
66
|
+
size: "small",
|
|
67
|
+
onClick: () => a(e.filterId, e.next),
|
|
68
|
+
children: [/* @__PURE__ */ s("span", {
|
|
69
|
+
className: "page-applied__label",
|
|
70
|
+
children: e.label
|
|
71
|
+
}), /* @__PURE__ */ s(_, {
|
|
72
|
+
name: "clear",
|
|
73
|
+
size: "sm"
|
|
74
|
+
})]
|
|
75
|
+
}, e.key)), i && /* @__PURE__ */ s("button", {
|
|
76
|
+
type: "button",
|
|
77
|
+
className: "page-shell__link",
|
|
78
|
+
onClick: i,
|
|
79
|
+
children: p.pageClearAll
|
|
80
|
+
})]
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
export {
|
|
84
|
+
D as AppliedFilters,
|
|
85
|
+
B as FilterSections
|
|
86
|
+
};
|
|
@@ -0,0 +1,257 @@
|
|
|
1
|
+
import { Icon as d } from "../Icon/Icon2.js";
|
|
2
|
+
import { libMessages as t } from "../../contexts/LanguageContext/libMessages.js";
|
|
3
|
+
import { useMessages as c } from "../../hooks/useLanguage.js";
|
|
4
|
+
import { Button as g } from "../Button/Button2.js";
|
|
5
|
+
import { Tooltip as h } from "../Tooltip/Tooltip2.js";
|
|
6
|
+
import { Dropdown as C } from "../Dropdown/Dropdown2.js";
|
|
7
|
+
import { MenuHamburger as N } from "../MenuHamburger/MenuHamburger2.js";
|
|
8
|
+
import { OptionRow as m, Segmented as u } from "./FilterField2.js";
|
|
9
|
+
import { resolveViewModes as k } from "./shellText.js";
|
|
10
|
+
import { useState as w } from "react";
|
|
11
|
+
import { Fragment as p, jsx as l, jsxs as s } from "react/jsx-runtime";
|
|
12
|
+
var j = ({ app: e, logoOnly: n = !1 }) => {
|
|
13
|
+
const i = typeof e.logo == "string" ? /* @__PURE__ */ l("img", {
|
|
14
|
+
src: e.logo,
|
|
15
|
+
alt: e.name
|
|
16
|
+
}) : e.logo ?? (e.icon ? /* @__PURE__ */ l(d, {
|
|
17
|
+
name: e.icon,
|
|
18
|
+
size: "lg"
|
|
19
|
+
}) : null), a = /* @__PURE__ */ s(p, { children: [i && /* @__PURE__ */ l("span", {
|
|
20
|
+
className: "page-shell__logo",
|
|
21
|
+
children: i
|
|
22
|
+
}), !n && /* @__PURE__ */ l("span", {
|
|
23
|
+
className: "page-shell__app-name",
|
|
24
|
+
children: e.name
|
|
25
|
+
})] });
|
|
26
|
+
return e.onHomeClick ? /* @__PURE__ */ l("button", {
|
|
27
|
+
type: "button",
|
|
28
|
+
className: "page-shell__app page-shell__app--clickable",
|
|
29
|
+
onClick: e.onHomeClick,
|
|
30
|
+
children: a
|
|
31
|
+
}) : /* @__PURE__ */ l("span", {
|
|
32
|
+
className: "page-shell__app",
|
|
33
|
+
children: a
|
|
34
|
+
});
|
|
35
|
+
}, H = ({ action: e, fullWidth: n = !1 }) => /* @__PURE__ */ l(g, {
|
|
36
|
+
icon: e.icon,
|
|
37
|
+
variant: e.variant ?? "default",
|
|
38
|
+
disabled: e.disabled,
|
|
39
|
+
fullWidth: n,
|
|
40
|
+
onClick: e.onClick,
|
|
41
|
+
children: e.label
|
|
42
|
+
}), $ = ({ items: e }) => e.length > 0 ? /* @__PURE__ */ l(N, {
|
|
43
|
+
items: e,
|
|
44
|
+
disableResponsive: !0,
|
|
45
|
+
showLabel: !1
|
|
46
|
+
}) : null, f = ({ view: e, withLabels: n = !1 }) => {
|
|
47
|
+
const i = c(t);
|
|
48
|
+
return /* @__PURE__ */ l("div", {
|
|
49
|
+
className: ["page-shell__view-toggle", n ? "page-shell__view-toggle--labels" : ""].filter(Boolean).join(" "),
|
|
50
|
+
children: /* @__PURE__ */ l(u, {
|
|
51
|
+
items: k(e.modes, i).map((a) => ({
|
|
52
|
+
value: a.value,
|
|
53
|
+
label: n ? /* @__PURE__ */ s("span", {
|
|
54
|
+
className: "page-shell__view-option",
|
|
55
|
+
children: [/* @__PURE__ */ l(d, {
|
|
56
|
+
name: a.icon,
|
|
57
|
+
size: "sm"
|
|
58
|
+
}), a.label]
|
|
59
|
+
}) : /* @__PURE__ */ l(h, {
|
|
60
|
+
title: a.label,
|
|
61
|
+
children: /* @__PURE__ */ l(d, {
|
|
62
|
+
name: a.icon,
|
|
63
|
+
size: "sm"
|
|
64
|
+
})
|
|
65
|
+
})
|
|
66
|
+
})),
|
|
67
|
+
value: e.value,
|
|
68
|
+
onSelect: (a) => {
|
|
69
|
+
a !== null && e.onChange(String(a));
|
|
70
|
+
}
|
|
71
|
+
})
|
|
72
|
+
});
|
|
73
|
+
}, F = ({ sort: e }) => {
|
|
74
|
+
const n = c(t), i = e.value.direction === "asc";
|
|
75
|
+
return /* @__PURE__ */ s("div", {
|
|
76
|
+
className: "page-shell__sort",
|
|
77
|
+
children: [/* @__PURE__ */ l("div", {
|
|
78
|
+
className: "page-shell__sort-field",
|
|
79
|
+
children: /* @__PURE__ */ l(C, {
|
|
80
|
+
name: "page-sort",
|
|
81
|
+
options: e.fields,
|
|
82
|
+
value: e.value.field,
|
|
83
|
+
highlighted: e.highlighted,
|
|
84
|
+
clearable: !1,
|
|
85
|
+
searchable: !1,
|
|
86
|
+
usePortal: !1,
|
|
87
|
+
onChange: (a) => {
|
|
88
|
+
a && !Array.isArray(a) && e.onChange({
|
|
89
|
+
field: String(a.value),
|
|
90
|
+
direction: e.value.direction
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
})
|
|
94
|
+
}), /* @__PURE__ */ l(h, {
|
|
95
|
+
title: i ? n.pageAscending : n.pageDescending,
|
|
96
|
+
children: /* @__PURE__ */ l(g, {
|
|
97
|
+
icon: i ? "arrow-up" : "arrow-down",
|
|
98
|
+
variant: "default",
|
|
99
|
+
onClick: () => e.onChange({
|
|
100
|
+
field: e.value.field,
|
|
101
|
+
direction: i ? "desc" : "asc"
|
|
102
|
+
})
|
|
103
|
+
})
|
|
104
|
+
})]
|
|
105
|
+
});
|
|
106
|
+
}, I = ({ sort: e, view: n }) => {
|
|
107
|
+
const i = c(t);
|
|
108
|
+
return /* @__PURE__ */ s("div", {
|
|
109
|
+
className: "filter-field filter-field--sheet page-shell__sheet-stack",
|
|
110
|
+
children: [e && /* @__PURE__ */ s(p, { children: [
|
|
111
|
+
/* @__PURE__ */ l("span", {
|
|
112
|
+
className: "page-shell__group-title",
|
|
113
|
+
children: i.sortBy
|
|
114
|
+
}),
|
|
115
|
+
/* @__PURE__ */ l("div", {
|
|
116
|
+
className: "filter-field__rows",
|
|
117
|
+
children: e.fields.map((a) => /* @__PURE__ */ l(m, {
|
|
118
|
+
label: a.label,
|
|
119
|
+
mark: "radio",
|
|
120
|
+
selected: e.value.field === a.value,
|
|
121
|
+
onClick: () => e.onChange({
|
|
122
|
+
field: a.value,
|
|
123
|
+
direction: e.value.direction
|
|
124
|
+
})
|
|
125
|
+
}, a.value))
|
|
126
|
+
}),
|
|
127
|
+
/* @__PURE__ */ l(u, {
|
|
128
|
+
items: [{
|
|
129
|
+
value: "asc",
|
|
130
|
+
label: i.pageAscending
|
|
131
|
+
}, {
|
|
132
|
+
value: "desc",
|
|
133
|
+
label: i.pageDescending
|
|
134
|
+
}],
|
|
135
|
+
value: e.value.direction,
|
|
136
|
+
onSelect: (a) => e.onChange({
|
|
137
|
+
field: e.value.field,
|
|
138
|
+
direction: a === "desc" ? "desc" : "asc"
|
|
139
|
+
})
|
|
140
|
+
})
|
|
141
|
+
] }), n && /* @__PURE__ */ s(p, { children: [
|
|
142
|
+
/* @__PURE__ */ l("span", {
|
|
143
|
+
className: "page-shell__group-title",
|
|
144
|
+
children: i.pageView
|
|
145
|
+
}),
|
|
146
|
+
/* @__PURE__ */ l(f, {
|
|
147
|
+
view: n,
|
|
148
|
+
withLabels: !0
|
|
149
|
+
}),
|
|
150
|
+
n.columns && /* @__PURE__ */ l(v, {
|
|
151
|
+
columns: n.columns,
|
|
152
|
+
context: "sheet"
|
|
153
|
+
})
|
|
154
|
+
] })]
|
|
155
|
+
});
|
|
156
|
+
}, v = ({ columns: e, context: n }) => {
|
|
157
|
+
const i = c(t), [a, o] = w(!1), _ = (r) => e.onChange(e.value.includes(r) ? e.value.filter((b) => b !== r) : [...e.value, r]);
|
|
158
|
+
return /* @__PURE__ */ l("div", {
|
|
159
|
+
className: `page-filters page-filters--${n}`,
|
|
160
|
+
children: /* @__PURE__ */ s("div", {
|
|
161
|
+
className: "page-filters__section",
|
|
162
|
+
children: [/* @__PURE__ */ s("button", {
|
|
163
|
+
type: "button",
|
|
164
|
+
className: "page-filters__header",
|
|
165
|
+
onClick: () => o(!a),
|
|
166
|
+
children: [
|
|
167
|
+
/* @__PURE__ */ l("span", {
|
|
168
|
+
className: "page-filters__label",
|
|
169
|
+
children: i.columns
|
|
170
|
+
}),
|
|
171
|
+
/* @__PURE__ */ l("span", {
|
|
172
|
+
className: "page-filters__summary",
|
|
173
|
+
children: i.pageColumnsShown(e.value.length, e.options.length)
|
|
174
|
+
}),
|
|
175
|
+
/* @__PURE__ */ l(d, {
|
|
176
|
+
name: a ? "caret-down" : "caret-right",
|
|
177
|
+
size: "sm"
|
|
178
|
+
})
|
|
179
|
+
]
|
|
180
|
+
}), a && /* @__PURE__ */ l("div", {
|
|
181
|
+
className: `page-filters__body filter-field filter-field--${n}`,
|
|
182
|
+
children: /* @__PURE__ */ l("div", {
|
|
183
|
+
className: "filter-field__rows",
|
|
184
|
+
children: e.options.map((r) => /* @__PURE__ */ l(m, {
|
|
185
|
+
label: r.label,
|
|
186
|
+
mark: "check",
|
|
187
|
+
selected: e.value.includes(r.value),
|
|
188
|
+
onClick: () => _(r.value)
|
|
189
|
+
}, r.value))
|
|
190
|
+
})
|
|
191
|
+
})]
|
|
192
|
+
})
|
|
193
|
+
});
|
|
194
|
+
}, L = ({ pagination: e }) => {
|
|
195
|
+
const n = c(t);
|
|
196
|
+
if (!e || e.pageCount <= 1) return null;
|
|
197
|
+
const { page: i, pageCount: a, onChange: o } = e;
|
|
198
|
+
return /* @__PURE__ */ s("div", {
|
|
199
|
+
className: "page-shell__pager",
|
|
200
|
+
children: [
|
|
201
|
+
/* @__PURE__ */ l(h, {
|
|
202
|
+
title: n.previous,
|
|
203
|
+
children: /* @__PURE__ */ l(g, {
|
|
204
|
+
icon: "caret-left",
|
|
205
|
+
variant: "plain",
|
|
206
|
+
size: "small",
|
|
207
|
+
disabled: i <= 1,
|
|
208
|
+
onClick: () => o(i - 1)
|
|
209
|
+
})
|
|
210
|
+
}),
|
|
211
|
+
/* @__PURE__ */ l("span", {
|
|
212
|
+
className: "page-shell__pager-label",
|
|
213
|
+
children: n.pageOf(i, a)
|
|
214
|
+
}),
|
|
215
|
+
/* @__PURE__ */ l(h, {
|
|
216
|
+
title: n.next,
|
|
217
|
+
children: /* @__PURE__ */ l(g, {
|
|
218
|
+
icon: "caret-right",
|
|
219
|
+
variant: "plain",
|
|
220
|
+
size: "small",
|
|
221
|
+
disabled: i >= a,
|
|
222
|
+
onClick: () => o(i + 1)
|
|
223
|
+
})
|
|
224
|
+
})
|
|
225
|
+
]
|
|
226
|
+
});
|
|
227
|
+
}, R = ({ view: e, showToggle: n = !0 }) => {
|
|
228
|
+
const i = c(t);
|
|
229
|
+
return /* @__PURE__ */ s("div", {
|
|
230
|
+
className: "page-shell__side-group",
|
|
231
|
+
children: [
|
|
232
|
+
/* @__PURE__ */ l("span", {
|
|
233
|
+
className: "page-shell__group-title",
|
|
234
|
+
children: i.pageView
|
|
235
|
+
}),
|
|
236
|
+
n && /* @__PURE__ */ l(f, {
|
|
237
|
+
view: e,
|
|
238
|
+
withLabels: !0
|
|
239
|
+
}),
|
|
240
|
+
e.columns && /* @__PURE__ */ l(v, {
|
|
241
|
+
columns: e.columns,
|
|
242
|
+
context: "panel"
|
|
243
|
+
})
|
|
244
|
+
]
|
|
245
|
+
});
|
|
246
|
+
};
|
|
247
|
+
export {
|
|
248
|
+
H as ActionButton,
|
|
249
|
+
j as AppMark,
|
|
250
|
+
v as ColumnsSection,
|
|
251
|
+
$ as PageMenu,
|
|
252
|
+
L as PagePager,
|
|
253
|
+
F as SortDropdown,
|
|
254
|
+
I as SortSheetBody,
|
|
255
|
+
R as ViewOptions,
|
|
256
|
+
f as ViewToggle
|
|
257
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
.page-shell{min-height:100vh;color:var(--body-color);display:flex}.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;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;min-width:0;display:flex}.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{max-height:var(--spacing-32);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}.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}}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import './PageShell.css';
|
|
2
|
+
import { WorkbenchShell as o } from "./WorkbenchShell.js";
|
|
3
|
+
/* empty css */
|
|
4
|
+
import { jsx as h } from "react/jsx-runtime";
|
|
5
|
+
var i = ({ layout: r = "workbench", ...e }) => {
|
|
6
|
+
if (r === "workbench")
|
|
7
|
+
return /* @__PURE__ */ h(o, { ...e });
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
i as PageShell
|
|
11
|
+
};
|