@memobit/libs 3.35.0 → 4.0.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,43 +1,44 @@
1
1
  import { Icon as v } from "../Icon/Icon2.js";
2
- import { libMessages as T } from "../../contexts/LanguageContext/libMessages.js";
3
- import { useMessages as j } from "../../hooks/useLanguage.js";
4
- import { Button as w } from "../Button/Button2.js";
5
- import { InputSearch as L } from "../InputSearch/InputSearch2.js";
6
- import { useAppFrame as z } from "./useAppFrame.js";
7
- import { countActiveFilters as O } from "./filterRules.js";
8
- import { getHeadingText as W, getResultLabel as D } from "./shellText.js";
9
- import { AppMark as R, PageMenu as V, PagePager as H, PageTabsRow as $, SortSheetBody as q } from "./PageParts.js";
10
- import { TabBar as E } from "./AppNav.js";
11
- import { AppliedFilters as G, FilterSections as J } from "./FilterSections.js";
12
- import { getMenuItems as K, navToMenuItems as Q } from "./menuItems.js";
13
- import { BottomSheet as N } from "./BottomSheet.js";
14
- import { useCallback as U, useState as X } from "react";
15
- import { jsx as e, jsxs as n } from "react/jsx-runtime";
16
- var ue = (r) => {
17
- const { title: S, counts: p, primaryAction: l, actions: A = [], search: a, sort: o, view: m, filters: i = [], values: u = {}, onFilterChange: C = () => {
18
- }, onClearFilters: d, pagination: g, tabs: F, children: y } = r, t = j(T), s = z(), [k, f] = X(null), c = U(() => f(null), []), b = O(i, u), B = D(r, t), I = o?.fields.find((P) => P.value === o.value.field)?.label, M = [W(r, t), I].filter(Boolean).join(" · "), h = s?.nav ?? [], _ = h.length > 1 && h.length <= 5, x = [..._ ? [] : Q(h), ...K(A, s?.menuItems ?? [], !0)];
19
- return /* @__PURE__ */ n("div", {
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
- l?.variant ? `page-shell--fab-${l.variant}` : ""
26
+ a?.variant ? `page-shell--fab-${a.variant}` : ""
26
27
  ].filter(Boolean).join(" "),
27
28
  children: [
28
- /* @__PURE__ */ n("header", {
29
+ /* @__PURE__ */ i("header", {
29
30
  className: "page-shell__topbar",
30
31
  children: [
31
- s && /* @__PURE__ */ e(R, {
32
- app: s.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: S
38
+ children: y
38
39
  }),
39
40
  /* @__PURE__ */ e("span", { className: "page-shell__spacer" }),
40
- i.length > 0 && /* @__PURE__ */ n("button", {
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
- r.status ?? s?.status,
53
- /* @__PURE__ */ e(V, { items: x })
53
+ l.status ?? n?.status,
54
+ /* @__PURE__ */ e(G, { items: j })
54
55
  ]
55
56
  }),
56
- a && /* @__PURE__ */ e("div", {
57
+ o && /* @__PURE__ */ e("div", {
57
58
  className: "page-shell__search-row",
58
- children: /* @__PURE__ */ e(L, {
59
- value: a.value,
60
- placeholder: a.placeholder ?? t.search,
61
- autoFocus: a.autoFocus,
62
- onChange: a.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($, { tabs: F }),
66
- /* @__PURE__ */ e(G, {
67
- filters: i,
68
- values: u,
66
+ /* @__PURE__ */ e(K, { tabs: F }),
67
+ /* @__PURE__ */ e(Y, {
68
+ filters: r,
69
+ values: d,
69
70
  onFilterChange: C,
70
- onClearFilters: d,
71
+ onClearFilters: u,
71
72
  scroll: !0
72
73
  }),
73
- (o || m || g && g.pageCount > 1) && /* @__PURE__ */ n("div", {
74
+ (s || p || g && g.pageCount > 1) && /* @__PURE__ */ i("div", {
74
75
  className: "page-shell__result-row",
75
- children: [(o || m) && /* @__PURE__ */ n("button", {
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: M || t.pageSortAndView }), /* @__PURE__ */ e(v, {
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(H, { pagination: g })]
84
+ }), /* @__PURE__ */ e(J, { pagination: g })]
84
85
  }),
85
86
  /* @__PURE__ */ e("div", {
86
87
  className: "page-shell__content",
87
- children: y
88
+ children: B
88
89
  }),
89
- l && /* @__PURE__ */ e("button", {
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: l.disabled,
93
- onClick: l.onClick,
101
+ disabled: a.disabled,
102
+ onClick: a.onClick,
94
103
  children: /* @__PURE__ */ e(v, {
95
- name: l.icon ?? "plus",
104
+ name: a.icon ?? "plus",
96
105
  size: "lg"
97
106
  })
98
107
  }),
99
- _ && /* @__PURE__ */ e(E, { nav: h }),
100
- /* @__PURE__ */ e(N, {
101
- isOpen: k === "filters",
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 && d ? /* @__PURE__ */ e("button", {
114
+ end: b > 0 && u ? /* @__PURE__ */ e("button", {
106
115
  type: "button",
107
116
  className: "page-shell__link",
108
- onClick: d,
117
+ onClick: u,
109
118
  children: t.pageClearAll
110
119
  }) : void 0,
111
- footer: /* @__PURE__ */ e(w, {
120
+ footer: /* @__PURE__ */ e(A, {
112
121
  variant: "info",
113
122
  fullWidth: !0,
114
- disabled: p?.shown === 0,
123
+ disabled: m?.shown === 0,
115
124
  onClick: c,
116
- children: p ? B(p.shown) : t.pageDone
125
+ children: m ? x(m.shown) : t.pageDone
117
126
  }),
118
- children: /* @__PURE__ */ e(J, {
119
- filters: i,
120
- values: u,
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(N, {
126
- isOpen: k === "sort",
134
+ /* @__PURE__ */ e(S, {
135
+ isOpen: w === "sort",
127
136
  title: t.pageSortAndView,
128
137
  onClose: c,
129
- footer: /* @__PURE__ */ e(w, {
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(q, {
136
- sort: o,
137
- view: m
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
- ue as WorkbenchPhone
154
+ _e as WorkbenchPhone
145
155
  };
@@ -1,29 +1,30 @@
1
- import { libMessages as V } from "../../contexts/LanguageContext/libMessages.js";
2
- import { useMessages as L } from "../../hooks/useLanguage.js";
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";
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 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, {
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
- }), x = m > 0 && /* @__PURE__ */ e("span", {
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(S, { app: t.app }),
41
- p && /* @__PURE__ */ e(v, {
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(ee, { nav: c }),
46
- _ && /* @__PURE__ */ s("div", {
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
- x,
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
- }), F]
65
+ }), M]
65
66
  }),
66
- r && /* @__PURE__ */ e(O, { view: r })
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 && _ && /* @__PURE__ */ s(f, {
80
+ a && f && /* @__PURE__ */ s(v, {
80
81
  icon: "tune",
81
82
  variant: "default",
82
- onClick: () => d(!0),
83
- children: [l.filters, x]
83
+ onClick: () => g(!0),
84
+ children: [l.filters, S]
84
85
  }),
85
- a && t && c.length <= 1 && /* @__PURE__ */ e(S, {
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: B
94
- }), C && /* @__PURE__ */ e("p", {
94
+ children: j
95
+ }), F && /* @__PURE__ */ e("p", {
95
96
  className: "page-shell__heading",
96
- children: C
97
+ children: F
97
98
  })]
98
99
  }),
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) }),
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
- i && /* @__PURE__ */ e(E, {
105
+ o && /* @__PURE__ */ e(z, {
105
106
  className: "page-shell__search",
106
- value: i.value,
107
- placeholder: i.placeholder ?? l.search,
108
- autoFocus: i.autoFocus,
109
- onChange: i.onChange
107
+ value: o.value,
108
+ placeholder: o.placeholder ?? l.search,
109
+ autoFocus: o.autoFocus,
110
+ onChange: o.onChange
110
111
  }),
111
- b && /* @__PURE__ */ e(Y, { sort: b }),
112
- a && r && /* @__PURE__ */ e(Z, { view: r }),
113
- !a && le(g).map((M) => /* @__PURE__ */ e(v, { action: M }, M.id)),
114
- !a && k,
115
- !a && /* @__PURE__ */ e(I, { items: P(g, A, !1) })
112
+ 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(X, { tabs: W }),
119
+ /* @__PURE__ */ e(ee, { tabs: V }),
119
120
  /* @__PURE__ */ s("div", {
120
121
  className: "page-shell__status",
121
- children: [/* @__PURE__ */ e(ae, {
122
+ children: [/* @__PURE__ */ e(re, {
122
123
  filters: h,
123
124
  values: u,
124
125
  onFilterChange: w,
125
126
  onClearFilters: n
126
- }), /* @__PURE__ */ e(U, { pagination: D })]
127
+ }), /* @__PURE__ */ e($, { pagination: R })]
127
128
  }),
128
129
  /* @__PURE__ */ e("div", {
129
130
  className: "page-shell__content",
130
- children: j
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 && _ && /* @__PURE__ */ e(q, {
135
- isOpen: y,
136
- onClose: () => d(!1),
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(f, {
154
+ children: [m > 0 && n && /* @__PURE__ */ e(v, {
142
155
  variant: "default",
143
156
  onClick: n,
144
157
  children: l.pageClearAll
145
- }), N && /* @__PURE__ */ e(f, {
158
+ }), b && /* @__PURE__ */ e(v, {
146
159
  variant: "info",
147
160
  fullWidth: !0,
148
- onClick: () => d(!1),
149
- children: R(N.shown)
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: [F, r && Q(r) && /* @__PURE__ */ e(O, {
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
- ke as WorkbenchShell
178
+ Me as WorkbenchShell
165
179
  };
@@ -31,7 +31,7 @@ var i = ({ counts: e, noun: a, heading: l }, r) => [e && a ? r.pageItemCount(e.s
31
31
  icon: "map"
32
32
  };
33
33
  }
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);
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 || e.sliders?.length);
35
35
  export {
36
36
  i as getHeadingText,
37
37
  s as getResultLabel,
@@ -0,0 +1,35 @@
1
+ import { libMessages as s } from "../../contexts/LanguageContext/libMessages.js";
2
+ import { useMessages as c } from "../../hooks/useLanguage.js";
3
+ import a from "../ConfirmDialog/ConfirmDialog2.js";
4
+ import { useState as f } from "react";
5
+ import { jsx as u } from "react/jsx-runtime";
6
+ var x = (r, l) => {
7
+ const i = c(s), [n, e] = f(null), t = (o) => o.confirm ? {
8
+ ...o,
9
+ onClick: () => e(o)
10
+ } : o, m = /* @__PURE__ */ u(a, {
11
+ isOpen: n !== null,
12
+ title: n?.confirm?.title ?? n?.label ?? "",
13
+ message: n?.confirm?.message ?? "",
14
+ confirm: {
15
+ text: n?.confirm?.confirmLabel ?? i.confirm,
16
+ variant: n?.confirm?.variant ?? "danger",
17
+ onClick: () => {
18
+ n?.onClick(), e(null);
19
+ }
20
+ },
21
+ cancel: {
22
+ text: i.cancel,
23
+ onClick: () => e(null)
24
+ },
25
+ usePortal: !0
26
+ });
27
+ return {
28
+ primaryAction: r && t(r),
29
+ actions: l.map(t),
30
+ dialog: m
31
+ };
32
+ };
33
+ export {
34
+ x as useConfirmedActions
35
+ };
@@ -1,18 +1,20 @@
1
- import { AppFrame as m } from "../PageShell/AppFrame.js";
2
- import { useMemo as p } from "react";
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) => ({
1
+ import { AppFrame as i } from "../PageShell/AppFrame.js";
2
+ import { useMemo as e } from "react";
3
+ import { jsx as m } from "react/jsx-runtime";
4
+ import { matchPath as p, useLocation as d, useNavigate as f } from "react-router";
5
+ var k = ({ nav: n, app: r, ...l }) => {
6
+ const { pathname: t } = d(), a = f(), s = e(() => 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: r({
11
+ group: o.group,
12
+ color: o.color,
13
+ isActive: p({
12
14
  path: o.path,
13
15
  end: o.end ?? o.path === "/"
14
- }, t) !== null || (o.activeOn ?? []).some((i) => r({
15
- path: i,
16
+ }, t) !== null || (o.activeOn ?? []).some((u) => p({
17
+ path: u,
16
18
  end: !1
17
19
  }, t) !== null),
18
20
  onSelect: () => a(o.path)
@@ -20,19 +22,19 @@ var k = ({ nav: n, app: e, ...s }) => {
20
22
  n,
21
23
  t,
22
24
  a
23
- ]), c = n[0]?.path ?? "/", h = p(() => ({
24
- ...e,
25
- onHomeClick: e.onHomeClick ?? (t === c ? void 0 : () => a(c))
25
+ ]), c = n[0]?.path ?? "/", h = e(() => ({
26
+ ...r,
27
+ onHomeClick: r.onHomeClick ?? (t === c ? void 0 : () => a(c))
26
28
  }), [
27
- e,
29
+ r,
28
30
  t,
29
31
  c,
30
32
  a
31
33
  ]);
32
- return /* @__PURE__ */ u(m, {
33
- ...s,
34
+ return /* @__PURE__ */ m(i, {
35
+ ...l,
34
36
  app: h,
35
- nav: l
37
+ nav: s
36
38
  });
37
39
  };
38
40
  export {