@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.
@@ -1,289 +1,342 @@
1
1
  import './FilterField.css';
2
- import { Icon as M } from "../Icon/Icon2.js";
3
- import { libMessages as v } from "../../contexts/LanguageContext/libMessages.js";
4
- import { useMessages as g } from "../../hooks/useLanguage.js";
5
- import { formatDate as w } from "../../helpers/Datetime.js";
6
- import { Chip as z } from "../Chip/Chip2.js";
7
- import { DatePicker as R } 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 I, pickControl as O, toDateRange as B, toList as E, toNumber as V, toRange as q, toScalar as $, toText as P } from "./filterRules.js";
2
+ import { Icon as Y } from "../Icon/Icon2.js";
3
+ import { libMessages as N } from "../../contexts/LanguageContext/libMessages.js";
4
+ import { useMessages as k } from "../../hooks/useLanguage.js";
5
+ import { Tooltip as W } from "../Tooltip/Tooltip2.js";
6
+ import { formatDate as D } from "../../helpers/Datetime.js";
7
+ import { Chip as j } from "../Chip/Chip2.js";
8
+ import { InputNumber as F } from "../InputNumber/InputNumber2.js";
9
+ import { DatePicker as $ } from "../DatePicker/DatePicker2.js";
10
+ import { InputSearch as C } from "../InputSearch/InputSearch2.js";
11
+ import { Rating as O } from "../Rating/Rating2.js";
12
+ import { ToggleSwitch as U } from "../ToggleSwitch/ToggleSwitch2.js";
13
+ import { RangeSlider as E } from "../RangeSlider/RangeSlider2.js";
14
+ import { getTextModes as B, pickControl as V, toDateRange as q, toList as P, toNumber as Q, toRange as G, toScalar as z, toText as H } from "./filterRules.js";
13
15
  /* empty css */
14
- import { useEffect as Q, useState as y } from "react";
15
- import { jsx as l, jsxs as u } from "react/jsx-runtime";
16
- var D = ({ items: e, value: a, onSelect: n }) => /* @__PURE__ */ l("div", {
16
+ import { useEffect as J, useState as S } from "react";
17
+ import { Fragment as K, jsx as l, jsxs as f } from "react/jsx-runtime";
18
+ var x = ({ items: e, value: r, onSelect: n }) => /* @__PURE__ */ l("div", {
17
19
  className: "filter-field__segmented",
18
20
  children: e.map((t) => /* @__PURE__ */ l("button", {
19
21
  type: "button",
20
- className: ["filter-field__segment", t.value === a ? "filter-field__segment--selected" : ""].filter(Boolean).join(" "),
22
+ className: ["filter-field__segment", t.value === r ? "filter-field__segment--selected" : ""].filter(Boolean).join(" "),
21
23
  onClick: () => n(t.value),
22
24
  children: t.label
23
25
  }, String(t.value)))
24
- }), x = ({ label: e, mark: a, selected: n, count: t, icon: r, onClick: c }) => /* @__PURE__ */ u("button", {
25
- type: "button",
26
- className: [
27
- "filter-field__row",
28
- n ? "filter-field__row--selected" : "",
29
- t === 0 && !n ? "filter-field__row--empty" : ""
30
- ].filter(Boolean).join(" "),
31
- onClick: c,
32
- children: [
33
- /* @__PURE__ */ l("span", {
34
- className: `filter-field__mark filter-field__mark--${a}`,
35
- children: a === "check" && n && /* @__PURE__ */ l(M, {
36
- name: "checkmark",
26
+ }), I = ({ src: e }) => /* @__PURE__ */ l("img", {
27
+ className: "filter-field__avatar",
28
+ src: e,
29
+ alt: "",
30
+ loading: "lazy"
31
+ }), L = ({ hint: e, children: r }) => e ? /* @__PURE__ */ l(W, {
32
+ title: e,
33
+ children: r
34
+ }) : /* @__PURE__ */ l(K, { children: r }), R = ({ label: e, mark: r, selected: n, count: t, icon: i, imageUrl: s, hint: m, onClick: o }) => /* @__PURE__ */ l(L, {
35
+ hint: m,
36
+ children: /* @__PURE__ */ f("button", {
37
+ type: "button",
38
+ className: [
39
+ "filter-field__row",
40
+ n ? "filter-field__row--selected" : "",
41
+ t === 0 && !n ? "filter-field__row--empty" : ""
42
+ ].filter(Boolean).join(" "),
43
+ onClick: o,
44
+ children: [
45
+ /* @__PURE__ */ l("span", {
46
+ className: `filter-field__mark filter-field__mark--${r}`,
47
+ children: r === "check" && n && /* @__PURE__ */ l(Y, {
48
+ name: "checkmark",
49
+ size: "sm"
50
+ })
51
+ }),
52
+ s ? /* @__PURE__ */ l(I, { src: s }) : i && /* @__PURE__ */ l(Y, {
53
+ name: i,
37
54
  size: "sm"
55
+ }),
56
+ /* @__PURE__ */ l("span", {
57
+ className: "filter-field__row-label",
58
+ children: e
59
+ }),
60
+ t !== void 0 && /* @__PURE__ */ l("span", {
61
+ className: "filter-field__count",
62
+ children: t
38
63
  })
39
- }),
40
- r && /* @__PURE__ */ l(M, {
41
- name: r,
42
- size: "sm"
43
- }),
44
- /* @__PURE__ */ l("span", {
45
- className: "filter-field__row-label",
46
- children: e
47
- }),
48
- t !== void 0 && /* @__PURE__ */ l("span", {
49
- className: "filter-field__count",
50
- children: t
51
- })
52
- ]
53
- }), G = (e, a) => e.includes(a) ? e.filter((n) => n !== a) : [...e, a], J = ({ spec: e, value: a, context: n, onChange: t }) => {
54
- const r = g(v), [c, d] = y(""), [s, o] = y(!1), f = O(e, n), k = e.kind === "single", b = k ? [$(a)].filter((i) => i !== null) : E(a), h = (i) => b.includes(i.value), S = (i) => {
55
- if (!k) {
56
- t(G(b, i.value));
64
+ ]
65
+ })
66
+ }), X = (e, r) => e.includes(r) ? e.filter((n) => n !== r) : [...e, r], Z = ({ spec: e, value: r, context: n, onChange: t }) => {
67
+ const i = k(N), [s, m] = S(""), [o, d] = S(!1), v = V(e, n), c = e.kind === "single", h = c ? [z(r)].filter((a) => a !== null) : P(r), _ = (a) => h.includes(a.value), b = (a) => {
68
+ if (!c) {
69
+ t(X(h, a.value));
57
70
  return;
58
71
  }
59
- t(h(i) && f !== "radio" ? null : i.value);
72
+ t(_(a) && v !== "radio" ? null : a.value);
60
73
  };
61
- if (f === "segmented") {
62
- const i = [{
74
+ if (v === "segmented") {
75
+ const a = [{
63
76
  value: null,
64
- label: r.pageAny
65
- }, ...e.options.map((m) => ({
66
- value: m.value,
67
- label: m.label
77
+ label: i.pageAny
78
+ }, ...e.options.map((u) => ({
79
+ value: u.value,
80
+ label: u.label
68
81
  }))];
69
- return /* @__PURE__ */ l(D, {
70
- items: i,
71
- value: b[0] ?? null,
72
- onSelect: (m) => t(m)
82
+ return /* @__PURE__ */ l(x, {
83
+ items: a,
84
+ value: h[0] ?? null,
85
+ onSelect: (u) => t(u)
73
86
  });
74
87
  }
75
- if (f === "chips") return /* @__PURE__ */ l("div", {
88
+ if (v === "chips") return /* @__PURE__ */ l("div", {
76
89
  className: "filter-field__chips",
77
- children: e.options.map((i) => /* @__PURE__ */ l(z, {
78
- className: i.count === 0 && !h(i) ? "filter-field__chip--empty" : void 0,
79
- color: i.color,
80
- count: i.count,
81
- icon: i.icon,
82
- selected: h(i),
83
- size: n === "sheet" ? "medium" : "small",
84
- onClick: () => S(i),
85
- children: i.label
86
- }, i.value))
90
+ children: e.options.map((a) => /* @__PURE__ */ l(L, {
91
+ hint: a.hint,
92
+ children: /* @__PURE__ */ l(j, {
93
+ className: a.count === 0 && !_(a) ? "filter-field__chip--empty" : void 0,
94
+ color: a.color,
95
+ count: a.count,
96
+ icon: a.imageUrl ? void 0 : a.icon,
97
+ selected: _(a),
98
+ size: n === "sheet" ? "medium" : "small",
99
+ onClick: () => b(a),
100
+ children: a.imageUrl ? /* @__PURE__ */ f("span", {
101
+ className: "filter-field__chip-label",
102
+ children: [/* @__PURE__ */ l(I, { src: a.imageUrl }), a.label]
103
+ }) : a.label
104
+ })
105
+ }, a.value))
87
106
  });
88
- const L = k ? "radio" : "check", N = (i) => /* @__PURE__ */ l(x, {
89
- label: i.label,
90
- mark: L,
91
- selected: h(i),
92
- count: i.count,
93
- icon: i.icon,
94
- onClick: () => S(i)
95
- }, i.value);
96
- if (f === "search-list") {
97
- const i = c.trim().toLowerCase(), m = e.options.filter(h), p = e.options.filter((Y) => !h(Y) && (!i || Y.label.toLowerCase().includes(i)));
98
- return /* @__PURE__ */ u("div", {
107
+ const w = c ? "radio" : "check", y = (a) => /* @__PURE__ */ l(R, {
108
+ label: a.label,
109
+ mark: w,
110
+ selected: _(a),
111
+ count: a.count,
112
+ icon: a.icon,
113
+ imageUrl: a.imageUrl,
114
+ hint: a.hint,
115
+ onClick: () => b(a)
116
+ }, a.value);
117
+ if (v === "search-list") {
118
+ const a = s.trim().toLowerCase(), u = e.options.filter(_), p = e.options.filter((A) => !_(A) && (!a || A.label.toLowerCase().includes(a)));
119
+ return /* @__PURE__ */ f("div", {
99
120
  className: "filter-field__stack",
100
- children: [/* @__PURE__ */ l(F, {
101
- value: c,
102
- placeholder: r.pageSearchOptions(e.label),
103
- onChange: d
104
- }), /* @__PURE__ */ u("div", {
121
+ children: [/* @__PURE__ */ l(C, {
122
+ value: s,
123
+ placeholder: i.pageSearchOptions(e.label),
124
+ onChange: m
125
+ }), /* @__PURE__ */ f("div", {
105
126
  className: "filter-field__options",
106
127
  children: [
107
- m.map(N),
108
- m.length > 0 && p.length > 0 && /* @__PURE__ */ l("div", { className: "filter-field__divider" }),
109
- p.map(N),
110
- m.length === 0 && p.length === 0 && /* @__PURE__ */ l("span", {
128
+ u.map(y),
129
+ u.length > 0 && p.length > 0 && /* @__PURE__ */ l("div", { className: "filter-field__divider" }),
130
+ p.map(y),
131
+ u.length === 0 && p.length === 0 && /* @__PURE__ */ l("span", {
111
132
  className: "filter-field__empty",
112
- children: r.pageNoMatches
133
+ children: i.pageNoMatches
113
134
  })
114
135
  ]
115
136
  })]
116
137
  });
117
138
  }
118
- if (f === "radio") return /* @__PURE__ */ u("div", {
139
+ if (v === "radio") return /* @__PURE__ */ f("div", {
119
140
  className: "filter-field__rows",
120
- children: [/* @__PURE__ */ l(x, {
121
- label: r.pageAny,
141
+ children: [/* @__PURE__ */ l(R, {
142
+ label: i.pageAny,
122
143
  mark: "radio",
123
- selected: b.length === 0,
144
+ selected: h.length === 0,
124
145
  onClick: () => t(null)
125
- }), e.options.map(N)]
146
+ }), e.options.map(y)]
126
147
  });
127
- const A = e.options.length > 7, j = A && !s ? e.options.filter((i, m) => m < 6 || h(i)) : e.options;
128
- return /* @__PURE__ */ u("div", {
148
+ const M = e.options.length > 7, T = M && !o ? e.options.filter((a, u) => u < 6 || _(a)) : e.options;
149
+ return /* @__PURE__ */ f("div", {
129
150
  className: "filter-field__stack",
130
151
  children: [/* @__PURE__ */ l("div", {
131
152
  className: "filter-field__rows",
132
- children: j.map(N)
133
- }), A && /* @__PURE__ */ l("button", {
153
+ children: T.map(y)
154
+ }), M && /* @__PURE__ */ l("button", {
134
155
  type: "button",
135
156
  className: "filter-field__link",
136
- onClick: () => o(!s),
137
- children: s ? r.pageShowFewer : r.pageShowAll(e.options.length)
157
+ onClick: () => d(!o),
158
+ children: o ? i.pageShowFewer : i.pageShowAll(e.options.length)
138
159
  })]
139
160
  });
140
- }, K = ({ spec: e, value: a, onChange: n }) => {
141
- const [t, r] = q(a, e.min, e.max), [c, d] = y([t, r]);
142
- Q(() => d([t, r]), [t, r]);
143
- const s = ([o, f]) => n(o <= e.min && f >= e.max ? null : [o, f]);
144
- return /* @__PURE__ */ l(W, {
161
+ }, ee = ({ spec: e, value: r, onChange: n }) => {
162
+ const [t, i] = G(r, e.min, e.max), [s, m] = S([t, i]);
163
+ J(() => m([t, i]), [t, i]);
164
+ const o = ([c, h]) => n(c <= e.min && h >= e.max ? null : [c, h]), d = (c, h) => {
165
+ const _ = c === 0 ? e.min : e.max, b = Math.min(Math.max(h ?? _, e.min), e.max), w = c === 0 ? [Math.min(b, s[1]), s[1]] : [s[0], Math.max(b, s[0])];
166
+ m(w), o(w);
167
+ }, v = /* @__PURE__ */ l(E, {
145
168
  min: e.min,
146
169
  max: e.max,
147
170
  step: e.step,
148
- value: c,
149
- showValues: !0,
150
- formatValue: (o) => e.unit ? `${o} ${e.unit}` : String(o),
151
- onChange: d,
152
- onChangeEnd: s
171
+ value: s,
172
+ showValues: !e.inputs,
173
+ formatValue: (c) => e.unit ? `${c} ${e.unit}` : String(c),
174
+ onChange: m,
175
+ onChangeEnd: o
153
176
  });
154
- }, U = ({ spec: e, value: a, onChange: n }) => {
155
- const t = g(v), r = V(a);
177
+ return e.inputs ? /* @__PURE__ */ f("div", {
178
+ className: "filter-field__stack",
179
+ children: [v, /* @__PURE__ */ f("div", {
180
+ className: "filter-field__range-inputs",
181
+ children: [
182
+ /* @__PURE__ */ l(F, {
183
+ value: s[0],
184
+ min: e.min,
185
+ max: s[1],
186
+ step: e.step,
187
+ onChange: (c) => d(0, c)
188
+ }),
189
+ /* @__PURE__ */ l("span", {
190
+ className: "filter-field__range-dash",
191
+ children: "–"
192
+ }),
193
+ /* @__PURE__ */ l(F, {
194
+ value: s[1],
195
+ min: s[0],
196
+ max: e.max,
197
+ step: e.step,
198
+ onChange: (c) => d(1, c)
199
+ }),
200
+ e.unit && /* @__PURE__ */ l("span", {
201
+ className: "filter-field__count",
202
+ children: e.unit
203
+ })
204
+ ]
205
+ })]
206
+ }) : v;
207
+ }, le = ({ spec: e, value: r, onChange: n }) => {
208
+ const t = k(N), i = Q(r);
156
209
  if (e.max <= 5) {
157
- const c = Array.from({ length: e.max - 1 }, (s, o) => o + 2), d = [{
210
+ const s = Array.from({ length: e.max - 1 }, (o, d) => d + 2), m = [{
158
211
  value: 0,
159
212
  label: t.pageAny
160
- }, ...c.map((s) => ({
161
- value: s,
162
- label: s === e.max ? `${s}★` : `${s}★+`
213
+ }, ...s.map((o) => ({
214
+ value: o,
215
+ label: o === e.max ? `${o}★` : `${o}★+`
163
216
  }))];
164
- return /* @__PURE__ */ l(D, {
165
- items: d,
166
- value: r,
167
- onSelect: (s) => n(typeof s == "number" ? s : 0)
217
+ return /* @__PURE__ */ l(x, {
218
+ items: m,
219
+ value: i,
220
+ onSelect: (o) => n(typeof o == "number" ? o : 0)
168
221
  });
169
222
  }
170
- return /* @__PURE__ */ u("div", {
223
+ return /* @__PURE__ */ f("div", {
171
224
  className: "filter-field__rating",
172
- children: [/* @__PURE__ */ l(C, {
173
- rating: r,
225
+ children: [/* @__PURE__ */ l(O, {
226
+ rating: i,
174
227
  maxRate: e.max,
175
228
  selectable: !0,
176
- onSelect: (c) => n(c === r ? 0 : c)
177
- }), r > 0 && /* @__PURE__ */ l("button", {
229
+ onSelect: (s) => n(s === i ? 0 : s)
230
+ }), i > 0 && /* @__PURE__ */ l("button", {
178
231
  type: "button",
179
232
  className: "filter-field__link",
180
233
  onClick: () => n(0),
181
234
  children: t.pageAny
182
235
  })]
183
236
  });
184
- }, X = ({ spec: e, value: a, onChange: n }) => {
185
- const t = g(v), { text: r, mode: c } = P(a), d = I(e, {
237
+ }, te = ({ spec: e, value: r, onChange: n }) => {
238
+ const t = k(N), { text: i, mode: s } = H(r), m = B(e, {
186
239
  anyWord: t.pageAnyWord,
187
240
  allWords: t.pageAllWords
188
- }), s = c ?? d?.[0]?.value;
189
- return /* @__PURE__ */ u("div", {
241
+ }), o = s ?? m?.[0]?.value;
242
+ return /* @__PURE__ */ f("div", {
190
243
  className: "filter-field__stack",
191
- children: [/* @__PURE__ */ l(F, {
192
- value: r,
244
+ children: [/* @__PURE__ */ l(C, {
245
+ value: i,
193
246
  placeholder: e.placeholder,
194
- onChange: (o) => n({
195
- text: o,
196
- mode: s
247
+ onChange: (d) => n({
248
+ text: d,
249
+ mode: o
197
250
  })
198
- }), d && /* @__PURE__ */ l(D, {
199
- items: d.map((o) => ({
200
- value: o.value,
201
- label: o.label
251
+ }), m && /* @__PURE__ */ l(x, {
252
+ items: m.map((d) => ({
253
+ value: d.value,
254
+ label: d.label
202
255
  })),
203
- value: s ?? null,
204
- onSelect: (o) => n({
205
- text: r,
206
- mode: o === null ? void 0 : String(o)
256
+ value: o ?? null,
257
+ onSelect: (d) => n({
258
+ text: i,
259
+ mode: d === null ? void 0 : String(d)
207
260
  })
208
261
  })]
209
262
  });
210
- }, _ = (e) => {
263
+ }, g = (e) => {
211
264
  if (e === null) return;
212
- const [a, n, t] = String(e).split("-").map(Number);
213
- return a && n && t ? new Date(a, n - 1, t) : void 0;
214
- }, Z = ({ spec: e, value: a, onChange: n }) => {
215
- const t = g(v);
216
- return /* @__PURE__ */ l(R, {
217
- value: _($(a)),
218
- minDate: _(e.min ?? null),
219
- maxDate: _(e.max ?? null),
265
+ const [r, n, t] = String(e).split("-").map(Number);
266
+ return r && n && t ? new Date(r, n - 1, t) : void 0;
267
+ }, ae = ({ spec: e, value: r, onChange: n }) => {
268
+ const t = k(N);
269
+ return /* @__PURE__ */ l($, {
270
+ value: g(z(r)),
271
+ minDate: g(e.min ?? null),
272
+ maxDate: g(e.max ?? null),
220
273
  placeholder: t.selectDate,
221
274
  clearable: !0,
222
- onChange: (r) => n(r instanceof Date ? w(r, "YYYY-MM-DD") : null)
275
+ onChange: (i) => n(i instanceof Date ? D(i, "YYYY-MM-DD") : null)
223
276
  });
224
- }, H = ({ spec: e, value: a, onChange: n }) => {
225
- const t = g(v), [r, c] = B(a), d = _(r || null), s = _(c || null);
226
- return /* @__PURE__ */ l(R, {
277
+ }, re = ({ spec: e, value: r, onChange: n }) => {
278
+ const t = k(N), [i, s] = q(r), m = g(i || null), o = g(s || null);
279
+ return /* @__PURE__ */ l($, {
227
280
  mode: "range",
228
- value: d && s ? {
229
- start: d,
230
- end: s
281
+ value: m && o ? {
282
+ start: m,
283
+ end: o
231
284
  } : void 0,
232
- minDate: _(e.min ?? null),
233
- maxDate: _(e.max ?? null),
285
+ minDate: g(e.min ?? null),
286
+ maxDate: g(e.max ?? null),
234
287
  placeholder: t.selectDate,
235
288
  clearable: !0,
236
- onChange: (o) => n(o && !(o instanceof Date) && !Array.isArray(o) ? [w(o.start, "YYYY-MM-DD"), w(o.end, "YYYY-MM-DD")] : null)
289
+ onChange: (d) => n(d && !(d instanceof Date) && !Array.isArray(d) ? [D(d.start, "YYYY-MM-DD"), D(d.end, "YYYY-MM-DD")] : null)
237
290
  });
238
- }, he = ({ spec: e, value: a, context: n, onChange: t }) => {
239
- const r = `filter-field filter-field--${n}`;
291
+ }, we = ({ spec: e, value: r, context: n, onChange: t }) => {
292
+ const i = `filter-field filter-field--${n}`;
240
293
  switch (e.kind) {
241
294
  case "single":
242
295
  case "multi":
243
296
  return /* @__PURE__ */ l("div", {
244
- className: r,
245
- children: /* @__PURE__ */ l(J, {
297
+ className: i,
298
+ children: /* @__PURE__ */ l(Z, {
246
299
  spec: e,
247
- value: a,
300
+ value: r,
248
301
  context: n,
249
302
  onChange: t
250
303
  })
251
304
  });
252
305
  case "range":
253
306
  return /* @__PURE__ */ l("div", {
254
- className: r,
255
- children: /* @__PURE__ */ l(K, {
307
+ className: i,
308
+ children: /* @__PURE__ */ l(ee, {
256
309
  spec: e,
257
- value: a,
310
+ value: r,
258
311
  onChange: t
259
312
  })
260
313
  });
261
314
  case "rating":
262
315
  return /* @__PURE__ */ l("div", {
263
- className: r,
264
- children: /* @__PURE__ */ l(U, {
316
+ className: i,
317
+ children: /* @__PURE__ */ l(le, {
265
318
  spec: e,
266
- value: a,
319
+ value: r,
267
320
  onChange: t
268
321
  })
269
322
  });
270
323
  case "toggle": {
271
- const c = a === !0;
272
- return /* @__PURE__ */ u("div", {
273
- className: `${r} filter-field__switch-row`,
324
+ const s = r === !0;
325
+ return /* @__PURE__ */ f("div", {
326
+ className: `${i} filter-field__switch-row`,
274
327
  children: [
275
328
  /* @__PURE__ */ l("button", {
276
329
  type: "button",
277
330
  className: "filter-field__switch-label",
278
- onClick: () => t(!c),
331
+ onClick: () => t(!s),
279
332
  children: e.label
280
333
  }),
281
334
  e.count !== void 0 && /* @__PURE__ */ l("span", {
282
335
  className: "filter-field__count",
283
336
  children: e.count
284
337
  }),
285
- /* @__PURE__ */ l(T, {
286
- checked: c,
338
+ /* @__PURE__ */ l(U, {
339
+ checked: s,
287
340
  size: "small",
288
341
  showLabels: !1,
289
342
  onChange: t
@@ -293,35 +346,35 @@ var D = ({ items: e, value: a, onSelect: n }) => /* @__PURE__ */ l("div", {
293
346
  }
294
347
  case "text":
295
348
  return /* @__PURE__ */ l("div", {
296
- className: r,
297
- children: /* @__PURE__ */ l(X, {
349
+ className: i,
350
+ children: /* @__PURE__ */ l(te, {
298
351
  spec: e,
299
- value: a,
352
+ value: r,
300
353
  onChange: t
301
354
  })
302
355
  });
303
356
  case "date":
304
357
  return /* @__PURE__ */ l("div", {
305
- className: r,
306
- children: /* @__PURE__ */ l(Z, {
358
+ className: i,
359
+ children: /* @__PURE__ */ l(ae, {
307
360
  spec: e,
308
- value: a,
361
+ value: r,
309
362
  onChange: t
310
363
  })
311
364
  });
312
365
  case "date-range":
313
366
  return /* @__PURE__ */ l("div", {
314
- className: r,
315
- children: /* @__PURE__ */ l(H, {
367
+ className: i,
368
+ children: /* @__PURE__ */ l(re, {
316
369
  spec: e,
317
- value: a,
370
+ value: r,
318
371
  onChange: t
319
372
  })
320
373
  });
321
374
  }
322
375
  };
323
376
  export {
324
- he as FilterField,
325
- x as OptionRow,
326
- D as Segmented
377
+ we as FilterField,
378
+ R as OptionRow,
379
+ x as Segmented
327
380
  };
@@ -0,0 +1,60 @@
1
+ import { libMessages as f } from "../../contexts/LanguageContext/libMessages.js";
2
+ import { useMessages as N } from "../../hooks/useLanguage.js";
3
+ import { useBreakpoint as v } from "../../hooks/useBreakpoint.js";
4
+ import { useAppFrame as A } from "./useAppFrame.js";
5
+ import { getButtonActions as M, getMenuItems as b, navToMenuItems as x } from "./menuItems.js";
6
+ import { getHeadingText as I } from "./shellText.js";
7
+ import { ActionButton as c, AppMark as j, PageMenu as k, PageTabsRow as y } from "./PageParts.js";
8
+ import { useConfirmedActions as B } from "./useConfirmedActions.js";
9
+ import { jsx as e, jsxs as t } from "react/jsx-runtime";
10
+ var q = (s) => {
11
+ const { title: p, tabs: h, footer: o, children: g } = s, { isMobile: l } = v(), d = N(f), a = A(), { primaryAction: i, actions: n, dialog: u } = B(s.primaryAction, s.actions ?? []), m = I(s, d), _ = [...x(a?.nav ?? []), ...b(n, a?.menuItems ?? [], l)];
12
+ return /* @__PURE__ */ t("div", {
13
+ className: [
14
+ "page-shell",
15
+ "page-shell--focus",
16
+ l ? "page-shell--phone" : "page-shell--desktop"
17
+ ].join(" "),
18
+ children: [/* @__PURE__ */ t("div", {
19
+ className: "page-shell__main",
20
+ children: [
21
+ /* @__PURE__ */ t("header", {
22
+ className: "page-shell__toolbar",
23
+ children: [
24
+ a && /* @__PURE__ */ e(j, {
25
+ app: a.app,
26
+ logoOnly: !0
27
+ }),
28
+ /* @__PURE__ */ t("div", {
29
+ className: "page-shell__titles",
30
+ children: [/* @__PURE__ */ e("h1", {
31
+ className: "page-shell__title",
32
+ children: p
33
+ }), m && /* @__PURE__ */ e("p", {
34
+ className: "page-shell__heading",
35
+ children: m
36
+ })]
37
+ }),
38
+ /* @__PURE__ */ e("span", { className: "page-shell__spacer" }),
39
+ !l && M(n).map((r) => /* @__PURE__ */ e(c, { action: r }, r.id)),
40
+ i && /* @__PURE__ */ e(c, { action: i }),
41
+ s.status ?? a?.status,
42
+ /* @__PURE__ */ e(k, { items: _ })
43
+ ]
44
+ }),
45
+ /* @__PURE__ */ e(y, { tabs: h }),
46
+ /* @__PURE__ */ e("div", {
47
+ className: "page-shell__content",
48
+ children: g
49
+ }),
50
+ o && /* @__PURE__ */ e("div", {
51
+ className: "page-shell__footer",
52
+ children: o
53
+ })
54
+ ]
55
+ }), u]
56
+ });
57
+ };
58
+ export {
59
+ q as FocusShell
60
+ };