@memobit/libs 3.28.2 → 3.30.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.
Files changed (39) hide show
  1. package/dist/components/Auth/ChangePasswordModal/ChangePasswordModal2.js +7 -7
  2. package/dist/components/Auth/Login/Login2.js +4 -4
  3. package/dist/components/Auth/MfaSetupModal/MfaSetupModal2.js +6 -6
  4. package/dist/components/DataView/DataView.CardView.js +84 -84
  5. package/dist/components/MenuHamburger/MenuHamburger2.js +14 -14
  6. package/dist/components/PageShell/AppFrame.js +32 -0
  7. package/dist/components/PageShell/AppNav.js +55 -0
  8. package/dist/components/PageShell/BottomSheet.js +45 -0
  9. package/dist/components/PageShell/FilterField.css +1 -0
  10. package/dist/components/PageShell/FilterField2.js +294 -0
  11. package/dist/components/PageShell/FilterSections.js +86 -0
  12. package/dist/components/PageShell/PageParts.js +316 -0
  13. package/dist/components/PageShell/PageShell.css +1 -0
  14. package/dist/components/PageShell/PageShell2.js +11 -0
  15. package/dist/components/PageShell/WorkbenchPhone.js +142 -0
  16. package/dist/components/PageShell/WorkbenchShell.js +160 -0
  17. package/dist/components/PageShell/filterRules.js +123 -0
  18. package/dist/components/PageShell/filterValues.js +30 -0
  19. package/dist/components/PageShell/menuItems.js +17 -0
  20. package/dist/components/PageShell/shellText.js +39 -0
  21. package/dist/components/PageShell/useAppFrame.js +6 -0
  22. package/dist/components/PageShell/usePaging.js +23 -0
  23. package/dist/components/PageShell/usePruneStaleFilters.js +17 -0
  24. package/dist/components/PageShell/useSummaryMessages.js +17 -0
  25. package/dist/components/Pagination/Pagination.css +1 -1
  26. package/dist/components/Pagination/Pagination2.js +14 -13
  27. package/dist/components/RouterAppFrame/RouterAppFrame.js +37 -0
  28. package/dist/components/ScrollToTop/ScrollToTop.css +1 -1
  29. package/dist/components/ScrollToTop/ScrollToTop2.js +20 -19
  30. package/dist/contexts/LanguageContext/libMessages.js +57 -7
  31. package/dist/helpers/VersionInfo.js +1 -1
  32. package/dist/hooks/useAccountMenu.js +6 -6
  33. package/dist/index.d.ts +335 -0
  34. package/dist/index.js +235 -213
  35. package/dist/router.d.ts +68 -0
  36. package/dist/router.js +4 -2
  37. package/dist/version.js +1 -1
  38. package/dist/version.json +4 -4
  39. package/package.json +147 -147
@@ -1,29 +1,29 @@
1
1
  import './Pagination.css';
2
2
  import { libMessages as y } from "../../contexts/LanguageContext/libMessages.js";
3
3
  import { useMessages as L } from "../../hooks/useLanguage.js";
4
- import { Button as p } from "../Button/Button2.js";
4
+ import { Button as h } from "../Button/Button2.js";
5
5
  import { Dropdown as O } from "../Dropdown/Dropdown2.js";
6
6
  import { useBreakpoint as I } from "../../hooks/useBreakpoint.js";
7
7
  /* empty css */
8
- import { useCallback as R, useEffect as V, useRef as j, useState as C } from "react";
8
+ import { useCallback as R, useEffect as V, useRef as $, useState as j } from "react";
9
9
  import { jsx as t, jsxs as m } from "react/jsx-runtime";
10
- var H = 120, U = 45, $ = 8, G = 4, Y = ({ currentPage: i, totalPages: n, totalItems: u, onPageChange: f, showPagesNumbers: D = !1, pageSizeOptions: o, pageSize: v, onPageSizeChange: b, pageSizeLabel: N, horizontalAlign: k = "left" }) => {
11
- const a = L(y), { isAtLeast: l, isMobile: w } = I(), d = j(null), [c, A] = C(w ? 0 : 2), h = R(() => {
10
+ var C = 120, H = 45, U = 8, G = 4, Y = ({ currentPage: i, totalPages: n, totalItems: u, onPageChange: f, showPagesNumbers: D = !1, pageSizeOptions: o, pageSize: v, onPageSizeChange: b, pageSizeLabel: N, horizontalAlign: k = "left" }) => {
11
+ const a = L(y), { isAtLeast: l, isMobile: w } = I(), d = $(null), [c, A] = j(w ? 0 : 2), p = R(() => {
12
12
  const s = d.current, e = s?.parentElement;
13
13
  if (!s || !e) return;
14
14
  let r = 0;
15
- for (const x of e.children) x !== s && (r += x.offsetWidth + $);
16
- const W = e.clientWidth - r - ((l("desktop") ? H : U) * 2 + 90 + 90 + 48), B = Math.floor(W / 53), E = Math.min(G, Math.max(0, Math.floor(B / 2)));
15
+ for (const x of e.children) x !== s && (r += x.offsetWidth + U);
16
+ const W = e.clientWidth - r - ((l("desktop") ? C : H) * 2 + 90 + 90 + 48), B = Math.floor(W / 53), E = Math.min(G, Math.max(0, Math.floor(B / 2)));
17
17
  A(E);
18
18
  }, [l]);
19
19
  V(() => {
20
20
  const s = d.current, e = s?.parentElement;
21
21
  if (!s || !e) return;
22
22
  const r = new ResizeObserver(() => {
23
- h();
23
+ p();
24
24
  });
25
- return r.observe(s), r.observe(e), h(), () => r.disconnect();
26
- }, [h]);
25
+ return r.observe(s), r.observe(e), p(), () => r.disconnect();
26
+ }, [p]);
27
27
  const M = o && v !== void 0 && b, _ = o?.map((s) => ({
28
28
  label: `${s}`,
29
29
  value: s
@@ -33,13 +33,13 @@ var H = 120, U = 45, $ = 8, G = 4, Y = ({ currentPage: i, totalPages: n, totalIt
33
33
  return i - c > 2 ? e.push(1, "...") : e.push(1), e.push(...s), i + c < n - 1 ? e.push("...", n) : n > 1 && e.push(n), e;
34
34
  };
35
35
  return u !== void 0 && o?.length && u <= Math.min(...o) || n <= 1 && !M ? null : /* @__PURE__ */ m("div", {
36
- className: `pagination pagination--${k}`,
36
+ className: `pagination pagination--${k}${n <= 1 ? " pagination--single" : ""}`,
37
37
  children: [
38
38
  n > 1 && /* @__PURE__ */ m("div", {
39
39
  className: "pagination__pages",
40
40
  ref: d,
41
41
  children: [
42
- /* @__PURE__ */ t(p, {
42
+ /* @__PURE__ */ t(h, {
43
43
  variant: "default",
44
44
  borders: "sharp",
45
45
  disabled: i === 1,
@@ -47,14 +47,14 @@ var H = 120, U = 45, $ = 8, G = 4, Y = ({ currentPage: i, totalPages: n, totalIt
47
47
  onClick: () => f(i - 1),
48
48
  children: l("desktop") ? a.previous : ""
49
49
  }),
50
- T().map((s, e) => /* @__PURE__ */ t(p, {
50
+ T().map((s, e) => /* @__PURE__ */ t(h, {
51
51
  borders: "sharp",
52
52
  variant: s === i ? "warning" : "default",
53
53
  disabled: typeof s == "string",
54
54
  onClick: () => typeof s == "number" && f(s),
55
55
  children: s
56
56
  }, e)),
57
- /* @__PURE__ */ t(p, {
57
+ /* @__PURE__ */ t(h, {
58
58
  variant: "default",
59
59
  borders: "sharp",
60
60
  disabled: i === n,
@@ -70,6 +70,7 @@ var H = 120, U = 45, $ = 8, G = 4, Y = ({ currentPage: i, totalPages: n, totalIt
70
70
  name: "pageSize",
71
71
  options: _,
72
72
  value: v,
73
+ clearable: !1,
73
74
  searchable: !1,
74
75
  usePortal: !1,
75
76
  onChange: (s) => {
@@ -0,0 +1,37 @@
1
+ import { AppFrame as m } from "../PageShell/AppFrame.js";
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) => ({
7
+ id: o.path,
8
+ label: o.label,
9
+ icon: o.icon,
10
+ count: o.count,
11
+ isActive: l({
12
+ path: o.path,
13
+ end: o.end ?? o.path === "/"
14
+ }, t) !== null,
15
+ onSelect: () => a(o.path)
16
+ })), [
17
+ n,
18
+ t,
19
+ a
20
+ ]), c = n[0]?.path ?? "/", i = p(() => ({
21
+ ...e,
22
+ onHomeClick: e.onHomeClick ?? (t === c ? void 0 : () => a(c))
23
+ }), [
24
+ e,
25
+ t,
26
+ c,
27
+ a
28
+ ]);
29
+ return /* @__PURE__ */ s(m, {
30
+ ...r,
31
+ app: i,
32
+ nav: h
33
+ });
34
+ };
35
+ export {
36
+ g as RouterAppFrame
37
+ };
@@ -1 +1 @@
1
- .scroll-to-top{bottom:var(--spacing-24);right:var(--spacing-24);z-index:999;border-radius:var(--spacing-16);background-color:var(--button-default-background-color);width:56px;height:56px;color:var(--button-default-color);border:var(--spacing-1) solid var(--button-default-border-color);cursor:pointer;box-shadow:0 var(--spacing-4) var(--spacing-12) var(--box-shadow);justify-content:center;align-items:center;transition:all .3s;animation:.3s scrollToTopFadeIn;display:flex;position:fixed}.scroll-to-top:hover{background-color:var(--button-default-hover-background-color);transform:scale(1.1)}.scroll-to-top:active{transform:scale(.95)}.scroll-to-top__icon{font-size:var(--font-size-sm);line-height:1}body:has(.float-button-container) .scroll-to-top{bottom:calc(var(--spacing-24) + 66px)}@keyframes scrollToTopFadeIn{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}@media (width<=768px){.scroll-to-top{bottom:var(--spacing-16);right:var(--spacing-16);width:var(--spacing-48);height:var(--spacing-48)}body:has(.float-button-container) .scroll-to-top{bottom:calc(var(--spacing-16) + 58px)}}
1
+ .scroll-to-top{bottom:var(--spacing-24);right:var(--spacing-24);z-index:999;width:var(--spacing-48);height:var(--spacing-48);border-radius:var(--radius-full);background-color:var(--card-background-color);color:var(--body-accent-color);border:var(--spacing-1) solid var(--card-border-color);cursor:pointer;box-shadow:0 var(--spacing-4) var(--spacing-12) var(--box-shadow);transition:transform var(--transition-fast);animation:scrollToTopFadeIn var(--transition-moderate);justify-content:center;align-items:center;display:flex;position:fixed}.scroll-to-top:hover{transform:scale(1.1)}.scroll-to-top:active{transform:scale(.95)}body:has(.float-button-container) .scroll-to-top{right:calc(var(--spacing-24) + var(--spacing-4));bottom:calc(var(--spacing-24) + 66px)}body:has(.page-shell__fab) .scroll-to-top{right:calc(var(--spacing-16) + var(--spacing-6));bottom:calc(var(--spacing-16) + var(--spacing-60) + var(--spacing-12) + env(safe-area-inset-bottom,0px))}@keyframes scrollToTopFadeIn{0%{opacity:0;transform:translateY(var(--spacing-12))}to{opacity:1;transform:translateY(0)}}@media (width<=768px){.scroll-to-top{bottom:var(--spacing-16);right:var(--spacing-16)}body:has(.float-button-container) .scroll-to-top{bottom:calc(var(--spacing-16) + 58px)}}body:has(.page-shell--with-tabs) .scroll-to-top{bottom:calc(var(--spacing-60) + var(--spacing-16) + env(safe-area-inset-bottom,0px))}body:has(.page-shell--with-tabs .page-shell__fab) .scroll-to-top{bottom:calc(var(--spacing-60) + var(--spacing-16) + var(--spacing-60) + var(--spacing-12) + env(safe-area-inset-bottom,0px))}
@@ -1,22 +1,23 @@
1
1
  import './ScrollToTop.css';
2
- import { libMessages as a } from "../../contexts/LanguageContext/libMessages.js";
3
- import { useMessages as f } from "../../hooks/useLanguage.js";
4
- import { Tooltip as u } from "../Tooltip/Tooltip2.js";
2
+ import { Icon as f } from "../Icon/Icon2.js";
3
+ import { libMessages as u } from "../../contexts/LanguageContext/libMessages.js";
4
+ import { useMessages as a } from "../../hooks/useLanguage.js";
5
+ import { Tooltip as T } from "../Tooltip/Tooltip2.js";
5
6
  /* empty css */
6
- import { useCallback as T, useEffect as d, useState as v } from "react";
7
+ import { useCallback as v, useEffect as b, useState as d } from "react";
7
8
  import { jsx as t } from "react/jsx-runtime";
8
- var k = ({ scrollContainer: o, scrollThreshold: s = 200, className: e }) => {
9
- const i = f(a), [c, p] = v(!1);
10
- d(() => {
11
- const l = o ?? window, r = () => {
9
+ var L = ({ scrollContainer: o, scrollThreshold: e = 200, className: s }) => {
10
+ const i = a(u), [p, c] = d(!1);
11
+ b(() => {
12
+ const r = o ?? window, l = () => {
12
13
  const n = o ? o.scrollTop : window.scrollY;
13
- p(n > s);
14
+ c(n > e);
14
15
  };
15
- return l.addEventListener("scroll", r, { passive: !0 }), () => {
16
- l.removeEventListener("scroll", r);
16
+ return r.addEventListener("scroll", l, { passive: !0 }), () => {
17
+ r.removeEventListener("scroll", l);
17
18
  };
18
- }, [o, s]);
19
- const m = T(() => {
19
+ }, [o, e]);
20
+ const m = v(() => {
20
21
  o ? o.scrollTo({
21
22
  top: 0,
22
23
  behavior: "smooth"
@@ -25,18 +26,18 @@ var k = ({ scrollContainer: o, scrollThreshold: s = 200, className: e }) => {
25
26
  behavior: "smooth"
26
27
  });
27
28
  }, [o]);
28
- return c ? /* @__PURE__ */ t(u, {
29
+ return p ? /* @__PURE__ */ t(T, {
29
30
  title: i.scrollToTop,
30
31
  children: /* @__PURE__ */ t("button", {
31
- className: `scroll-to-top${e ? ` ${e}` : ""}`,
32
+ className: `scroll-to-top${s ? ` ${s}` : ""}`,
32
33
  onClick: m,
33
- children: /* @__PURE__ */ t("span", {
34
- className: "scroll-to-top__icon",
35
- children: "▲"
34
+ children: /* @__PURE__ */ t(f, {
35
+ name: "arrow-up",
36
+ size: "lg"
36
37
  })
37
38
  })
38
39
  }) : null;
39
40
  };
40
41
  export {
41
- k as ScrollToTop
42
+ L as ScrollToTop
42
43
  };
@@ -1,4 +1,4 @@
1
- import { roCount as n, roNumberBeforeNoun as i } from "../../helpers/Language.js";
1
+ import { roCount as r, roNumberBeforeNoun as i } from "../../helpers/Language.js";
2
2
  var l = {
3
3
  cancel: "Cancel",
4
4
  clear: "Clear",
@@ -22,7 +22,7 @@ var l = {
22
22
  sortAscending: "Sort ascending",
23
23
  sortDescending: "Sort descending",
24
24
  resultsCount: (e, a, t, o) => `Showing ${e}-${a} of ${t}${o}`,
25
- resultsCountFiltered: (e, a, t, o, r) => `Showing ${e}-${a} of ${t} filtered${r} (${o} total)`,
25
+ resultsCountFiltered: (e, a, t, o, n) => `Showing ${e}-${a} of ${t} filtered${n} (${o} total)`,
26
26
  rows: "Rows",
27
27
  previous: "Previous",
28
28
  next: "Next",
@@ -51,6 +51,31 @@ var l = {
51
51
  search: "Search",
52
52
  showToolbar: "Show the toolbar",
53
53
  hideToolbar: "Hide the toolbar",
54
+ pageAny: "Any",
55
+ pageClearAll: "Clear all",
56
+ pageShowAll: (e) => `Show all ${e}`,
57
+ pageShowFewer: "Show fewer",
58
+ pageNoMatches: "No matches",
59
+ pageSearchOptions: (e) => `Search ${e.toLowerCase()}`,
60
+ pageSelectedCount: (e) => `${e} selected`,
61
+ pageRatingAtLeast: (e) => `${e}★ and up`,
62
+ pageDateSince: (e) => `since ${e}`,
63
+ pageDateUntil: (e) => `until ${e}`,
64
+ pageShowResults: (e) => e === 0 ? "No results" : `Show ${e} result${e === 1 ? "" : "s"}`,
65
+ pageSortAndView: "Sort and view",
66
+ pageView: "View",
67
+ pageAscending: "Ascending",
68
+ pageDescending: "Descending",
69
+ pageMenu: "Menu",
70
+ pageDone: "Done",
71
+ pageColumnsShown: (e, a) => `${e} of ${a} shown`,
72
+ pageItemCount: (e, a, t, o) => e === a ? `${a} ${a === 1 ? t : o}` : `${e} of ${a} ${a === 1 ? t : o}`,
73
+ pageShowItems: (e, a, t) => e === 0 ? `No ${t} match` : `Show ${e} ${e === 1 ? a : t}`,
74
+ pageAnyWord: "Any word",
75
+ pageAllWords: "All words",
76
+ pageViewCalendar: "Calendar",
77
+ pageViewMap: "Map",
78
+ pageGroupNone: "None",
54
79
  selectDate: "Select date...",
55
80
  monthNames: [
56
81
  "January",
@@ -138,7 +163,7 @@ var l = {
138
163
  sortAscending: "Sortează crescător",
139
164
  sortDescending: "Sortează descrescător",
140
165
  resultsCount: (e, a, t, o) => `Se afișează ${e}-${a} din ${o ? i(t) : t}${o}`,
141
- resultsCountFiltered: (e, a, t, o, r) => `Se afișează ${e}-${a} din ${r ? i(t) : t}${r} filtrate (${o} în total)`,
166
+ resultsCountFiltered: (e, a, t, o, n) => `Se afișează ${e}-${a} din ${n ? i(t) : t}${n} filtrate (${o} în total)`,
142
167
  rows: "Rânduri",
143
168
  previous: "Anterioara",
144
169
  next: "Următoarea",
@@ -167,6 +192,31 @@ var l = {
167
192
  search: "Caută",
168
193
  showToolbar: "Arată bara de instrumente",
169
194
  hideToolbar: "Ascunde bara de instrumente",
195
+ pageAny: "Oricare",
196
+ pageClearAll: "Șterge tot",
197
+ pageShowAll: (e) => `Arată toate cele ${e}`,
198
+ pageShowFewer: "Arată mai puține",
199
+ pageNoMatches: "Nicio potrivire",
200
+ pageSearchOptions: (e) => `Caută în ${e.toLowerCase()}`,
201
+ pageSelectedCount: (e) => `${e} selectate`,
202
+ pageRatingAtLeast: (e) => `${e}★ sau mai mult`,
203
+ pageDateSince: (e) => `din ${e}`,
204
+ pageDateUntil: (e) => `până la ${e}`,
205
+ pageShowResults: (e) => e === 0 ? "Niciun rezultat" : `Arată ${r(e, "rezultat", "rezultate")}`,
206
+ pageSortAndView: "Sortare și afișare",
207
+ pageView: "Afișare",
208
+ pageAscending: "Crescător",
209
+ pageDescending: "Descrescător",
210
+ pageMenu: "Meniu",
211
+ pageDone: "Gata",
212
+ pageColumnsShown: (e, a) => `${e} din ${a} afișate`,
213
+ pageItemCount: (e, a, t, o) => e === a ? r(a, t, o) : `${e} din ${r(a, t, o)}`,
214
+ pageShowItems: (e, a, t) => e === 0 ? "Niciun rezultat" : `Arată ${r(e, a, t)}`,
215
+ pageAnyWord: "Oricare cuvânt",
216
+ pageAllWords: "Toate cuvintele",
217
+ pageViewCalendar: "Calendar",
218
+ pageViewMap: "Hartă",
219
+ pageGroupNone: "Fără grupare",
170
220
  selectDate: "Alege data...",
171
221
  monthNames: [
172
222
  "Ianuarie",
@@ -199,8 +249,8 @@ var l = {
199
249
  nextMonth: "Luna următoare",
200
250
  today: "Azi",
201
251
  selectOption: "Alege o opțiune",
202
- selectedCount: (e) => n(e, "selectată", "selectate"),
203
- selectedWithOthers: (e, a) => `${e} (+${n(a, "alta", "altele")})`,
252
+ selectedCount: (e) => r(e, "selectată", "selectate"),
253
+ selectedWithOthers: (e, a) => `${e} (+${r(a, "alta", "altele")})`,
204
254
  createOption: (e) => `Creează „${e}”`,
205
255
  noOptions: "Nu s-au găsit opțiuni",
206
256
  remove: "Elimină",
@@ -231,10 +281,10 @@ var l = {
231
281
  scrollToTop: "Mergi sus",
232
282
  tipOfTheDay: "Sfatul zilei",
233
283
  dismiss: "Închide"
234
- }, u = {
284
+ }, p = {
235
285
  en: l,
236
286
  ro: s
237
287
  };
238
288
  export {
239
- u as libMessages
289
+ p as libMessages
240
290
  };
@@ -23,7 +23,7 @@ var r = (i) => {
23
23
  const o = {
24
24
  ...i,
25
25
  lib: d,
26
- libBuildNumber: 635,
26
+ libBuildNumber: 653,
27
27
  libCommit: n,
28
28
  libBuildDate: t
29
29
  };
@@ -1,10 +1,10 @@
1
- import { ThemeSettings as d } from "../components/ThemeSettings/ThemeSettings2.js";
2
- import { useAuth as w } from "./useAuth/useAuth.js";
3
- import { ChangePasswordModal as A } from "../components/Auth/ChangePasswordModal/ChangePasswordModal2.js";
1
+ import { useAuth as d } from "./useAuth/useAuth.js";
2
+ import { ChangePasswordModal as w } from "../components/Auth/ChangePasswordModal/ChangePasswordModal2.js";
3
+ import { ThemeSettings as A } from "../components/ThemeSettings/ThemeSettings2.js";
4
4
  import { useState as s } from "react";
5
5
  import { Fragment as k, jsx as o, jsxs as v } from "react/jsx-runtime";
6
6
  var j = ({ appName: l, mfaModal: e, themeLabel: c = "Theme", loginPath: m = "/login" }) => {
7
- const { user: u, logout: p } = w(), [f, t] = s(!1), [h, n] = s(!1), [g, a] = s(!1), C = async () => {
7
+ const { user: u, logout: p } = d(), [f, t] = s(!1), [h, n] = s(!1), [g, a] = s(!1), C = async () => {
8
8
  await p(), window.location.href = m;
9
9
  }, i = {
10
10
  label: c,
@@ -32,12 +32,12 @@ var j = ({ appName: l, mfaModal: e, themeLabel: c = "Theme", loginPath: m = "/lo
32
32
  isActive: !1
33
33
  }
34
34
  ], O = /* @__PURE__ */ v(k, { children: [
35
- /* @__PURE__ */ o(d, {
35
+ /* @__PURE__ */ o(A, {
36
36
  isOpen: f,
37
37
  onClose: () => t(!1),
38
38
  currentApp: l
39
39
  }),
40
- /* @__PURE__ */ o(A, {
40
+ /* @__PURE__ */ o(w, {
41
41
  isOpen: h,
42
42
  onClose: () => n(!1)
43
43
  }),