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