@memobit/libs 3.11.2 → 3.11.3

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 (34) hide show
  1. package/dist/components/Confetti/Confetti2.js +33 -33
  2. package/dist/components/ContextToast/ContextToast2.js +53 -57
  3. package/dist/components/ContextToast/useToast.js +12 -0
  4. package/dist/components/ControlPanel/ControlPanel2.js +41 -43
  5. package/dist/components/ControlPanel/ControlPanelContext.js +16 -21
  6. package/dist/components/ControlPanel/useControlPanel.js +11 -0
  7. package/dist/components/DataView/DataView.CardView.js +83 -109
  8. package/dist/components/DataView/DataView.MiniSort.js +1 -1
  9. package/dist/components/DataView/DataView.helpers.js +34 -0
  10. package/dist/components/DataView/DataView2.js +111 -108
  11. package/dist/components/Dropdown/Dropdown2.js +108 -106
  12. package/dist/components/InputEmail/InputEmail2.js +43 -43
  13. package/dist/components/InputEmail/validateEmail.js +7 -0
  14. package/dist/components/InputMask/InputMask2.js +40 -54
  15. package/dist/components/InputMask/InputMaskPresets.js +18 -0
  16. package/dist/components/Pagination/Pagination2.js +4 -4
  17. package/dist/components/Sidebar/Sidebar2.js +1 -1
  18. package/dist/components/Sidebar/SidebarContext.js +18 -23
  19. package/dist/components/Sidebar/useSidebar.js +11 -0
  20. package/dist/components/SuggestionsList/SuggestionsList2.js +27 -27
  21. package/dist/components/TimelineMarkers/TimelineMarkers2.js +31 -49
  22. package/dist/components/TimelineMarkers/calculateTimelineMarkers.js +28 -0
  23. package/dist/components/Toolbar/Toolbar2.js +6 -6
  24. package/dist/components/Tooltip/Tooltip2.js +35 -35
  25. package/dist/contexts/AuthContext/AuthContext.context.js +5 -0
  26. package/dist/contexts/AuthContext/AuthContext.js +5 -6
  27. package/dist/helpers/VersionInfo.js +1 -1
  28. package/dist/hooks/useAppPersistence.js +20 -20
  29. package/dist/hooks/useAuth/useAuth.js +1 -1
  30. package/dist/index.d.ts +1 -1
  31. package/dist/index.js +269 -262
  32. package/dist/version.js +1 -1
  33. package/dist/version.json +4 -4
  34. package/package.json +1 -1
@@ -1,13 +1,13 @@
1
1
  import './Tooltip.css';
2
2
  /* empty css */
3
- import { useEffect as b, useRef as h, useState as B } from "react";
4
- import { Fragment as S, jsx as N, jsxs as D } from "react/jsx-runtime";
5
- import { createPortal as V } from "react-dom";
6
- var K = ({ title: L, position: T = "top", delay: _ = 200, children: k, disabled: $ = !1, className: F = "", maxWidth: p, maxHeight: a }) => {
7
- const [f, u] = B(!1), [M, I] = B({
3
+ import { useCallback as S, useEffect as b, useRef as h, useState as B } from "react";
4
+ import { Fragment as V, jsx as N, jsxs as k } from "react/jsx-runtime";
5
+ import { createPortal as O } from "react-dom";
6
+ var Q = ({ title: L, position: p = "top", delay: D = 200, children: _, disabled: $ = !1, className: F = "", maxWidth: g, maxHeight: a }) => {
7
+ const [f, s] = B(!1), [M, I] = B({
8
8
  top: 0,
9
9
  left: 0
10
- }), c = h(null), r = h(null), l = h(null), d = h(null), g = h(!1), w = a !== void 0, v = w ? 150 : 0, R = () => {
10
+ }), c = h(null), r = h(null), l = h(null), d = h(null), w = h(!1), m = a !== void 0, R = m ? 150 : 0, T = S(() => {
11
11
  if (!l.current || !d.current) return;
12
12
  const t = l.current.firstElementChild?.getBoundingClientRect();
13
13
  let e = t && t.width > 0 ? t : l.current.getBoundingClientRect();
@@ -17,60 +17,60 @@ var K = ({ title: L, position: T = "top", delay: _ = 200, children: k, disabled:
17
17
  const E = C.getBoundingClientRect();
18
18
  (E.width > 0 || E.height > 0) && (e = E);
19
19
  }
20
- const n = d.current.getBoundingClientRect(), m = 8;
20
+ const n = d.current.getBoundingClientRect(), v = 8;
21
21
  let o = 0, i = 0;
22
- switch (T) {
22
+ switch (p) {
23
23
  case "top":
24
- o = e.top - n.height - m, i = e.left + e.width / 2 - n.width / 2;
24
+ o = e.top - n.height - v, i = e.left + e.width / 2 - n.width / 2;
25
25
  break;
26
26
  case "bottom":
27
- o = e.bottom + m, i = e.left + e.width / 2 - n.width / 2;
27
+ o = e.bottom + v, i = e.left + e.width / 2 - n.width / 2;
28
28
  break;
29
29
  case "left":
30
- o = e.top + e.height / 2 - n.height / 2, i = e.left - n.width - m;
30
+ o = e.top + e.height / 2 - n.height / 2, i = e.left - n.width - v;
31
31
  break;
32
32
  case "right":
33
- o = e.top + e.height / 2 - n.height / 2, i = e.right + m;
33
+ o = e.top + e.height / 2 - n.height / 2, i = e.right + v;
34
34
  }
35
- const s = 8;
36
- i < s && (i = s), i + n.width > window.innerWidth - s && (i = window.innerWidth - n.width - s), o < s && (o = s), o + n.height > window.innerHeight - s && (o = window.innerHeight - n.height - s), I({
35
+ const u = 8;
36
+ i < u && (i = u), i + n.width > window.innerWidth - u && (i = window.innerWidth - n.width - u), o < u && (o = u), o + n.height > window.innerHeight - u && (o = window.innerHeight - n.height - u), I({
37
37
  top: o,
38
38
  left: i
39
39
  });
40
- }, P = () => {
41
- $ || g.current || (r.current && (clearTimeout(r.current), r.current = null), c.current = setTimeout(() => {
42
- u(!0);
43
- }, _));
40
+ }, [p]), P = () => {
41
+ $ || w.current || (r.current && (clearTimeout(r.current), r.current = null), c.current = setTimeout(() => {
42
+ s(!0);
43
+ }, D));
44
44
  }, y = () => {
45
- g.current || (c.current && clearTimeout(c.current), v > 0 ? r.current = setTimeout(() => u(!1), v) : u(!1));
45
+ w.current || (c.current && clearTimeout(c.current), R > 0 ? r.current = setTimeout(() => s(!1), R) : s(!1));
46
46
  }, j = (t) => {
47
- t.pointerType !== "touch" && t.pointerType !== "pen" || $ || (g.current = !0, c.current && (clearTimeout(c.current), c.current = null), t.stopPropagation(), u((e) => !e));
47
+ t.pointerType !== "touch" && t.pointerType !== "pen" || $ || (w.current = !0, c.current && (clearTimeout(c.current), c.current = null), t.stopPropagation(), s((e) => !e));
48
48
  };
49
49
  b(() => {
50
50
  if (!f) return;
51
51
  const t = (e) => {
52
- e.target instanceof Node && d.current?.contains(e.target) || u(!1);
52
+ e.target instanceof Node && d.current?.contains(e.target) || s(!1);
53
53
  };
54
- return R(), window.addEventListener("scroll", t, !0), window.addEventListener("resize", R), () => {
55
- window.removeEventListener("scroll", t, !0), window.removeEventListener("resize", R);
54
+ return T(), window.addEventListener("scroll", t, !0), window.addEventListener("resize", T), () => {
55
+ window.removeEventListener("scroll", t, !0), window.removeEventListener("resize", T);
56
56
  };
57
- }, [f]), b(() => {
57
+ }, [f, T]), b(() => {
58
58
  if (!f) return;
59
59
  const t = (e) => {
60
- l.current?.contains(e.target) || d.current?.contains(e.target) || u(!1);
60
+ l.current?.contains(e.target) || d.current?.contains(e.target) || s(!1);
61
61
  };
62
62
  return document.addEventListener("pointerdown", t), () => {
63
- document.removeEventListener("pointerdown", t), g.current = !1;
63
+ document.removeEventListener("pointerdown", t), w.current = !1;
64
64
  };
65
65
  }, [f]), b(() => () => {
66
66
  c.current && clearTimeout(c.current), r.current && clearTimeout(r.current);
67
67
  }, []);
68
68
  const x = () => {
69
- w && r.current && (clearTimeout(r.current), r.current = null);
69
+ m && r.current && (clearTimeout(r.current), r.current = null);
70
70
  }, z = () => {
71
- w && (r.current = setTimeout(() => u(!1), v));
71
+ m && (r.current = setTimeout(() => s(!1), R));
72
72
  };
73
- return /* @__PURE__ */ D(S, { children: [/* @__PURE__ */ N("span", {
73
+ return /* @__PURE__ */ k(V, { children: [/* @__PURE__ */ N("span", {
74
74
  ref: l,
75
75
  className: "tooltip-trigger",
76
76
  onMouseEnter: P,
@@ -78,21 +78,21 @@ var K = ({ title: L, position: T = "top", delay: _ = 200, children: k, disabled:
78
78
  onFocus: P,
79
79
  onBlur: y,
80
80
  onPointerDown: j,
81
- children: k
82
- }), f && L && V(/* @__PURE__ */ D("div", {
81
+ children: _
82
+ }), f && L && O(/* @__PURE__ */ k("div", {
83
83
  ref: d,
84
- className: `tooltip tooltip--${T} ${w ? "tooltip--scrollable" : ""} ${F}`,
84
+ className: `tooltip tooltip--${p} ${m ? "tooltip--scrollable" : ""} ${F}`,
85
85
  style: {
86
86
  top: `${M.top}px`,
87
87
  left: `${M.left}px`,
88
- ...p !== void 0 && { maxWidth: typeof p == "number" ? `${p}px` : p },
88
+ ...g !== void 0 && { maxWidth: typeof g == "number" ? `${g}px` : g },
89
89
  ...a !== void 0 && { maxHeight: typeof a == "number" ? `${a}px` : a }
90
90
  },
91
91
  onMouseEnter: x,
92
92
  onMouseLeave: z,
93
- children: [L, /* @__PURE__ */ N("div", { className: `tooltip__arrow tooltip__arrow--${T}` })]
93
+ children: [L, /* @__PURE__ */ N("div", { className: `tooltip__arrow tooltip__arrow--${p}` })]
94
94
  }), document.body)] });
95
95
  };
96
96
  export {
97
- K as Tooltip
97
+ Q as Tooltip
98
98
  };
@@ -0,0 +1,5 @@
1
+ import { createContext as t } from "react";
2
+ var e = t(void 0);
3
+ export {
4
+ e as AuthContext
5
+ };
@@ -1,8 +1,8 @@
1
1
  import { HttpMethod as s, buildRequestHeaders as w } from "../../helpers/Http.js";
2
- import { createContext as A, useCallback as i, useEffect as U, useState as d } from "react";
2
+ import { AuthContext as A } from "./AuthContext.context.js";
3
+ import { useCallback as i, useEffect as U, useState as d } from "react";
3
4
  import { jsx as j } from "react/jsx-runtime";
4
- var v = A(void 0);
5
- function P({ children: h, config: a }) {
5
+ function C({ children: h, config: a }) {
6
6
  const [c, l] = d(null), [f, o] = d(!0);
7
7
  U(() => {
8
8
  (async () => {
@@ -95,7 +95,7 @@ function P({ children: h, config: a }) {
95
95
  l(null);
96
96
  }
97
97
  }, [a.apiBaseUrl]);
98
- return /* @__PURE__ */ j(v.Provider, {
98
+ return /* @__PURE__ */ j(A.Provider, {
99
99
  value: {
100
100
  user: c,
101
101
  isAuthenticated: !!c,
@@ -109,6 +109,5 @@ function P({ children: h, config: a }) {
109
109
  });
110
110
  }
111
111
  export {
112
- v as AuthContext,
113
- P as AuthProvider
112
+ C as AuthProvider
114
113
  };
@@ -23,7 +23,7 @@ var r = (i) => {
23
23
  const o = {
24
24
  ...i,
25
25
  lib: d,
26
- libBuildNumber: 509,
26
+ libBuildNumber: 512,
27
27
  libCommit: n,
28
28
  libBuildDate: t
29
29
  };
@@ -1,11 +1,11 @@
1
- import { AppPersistenceStorage as o } from "../helpers/AppPersistenceStorage.js";
2
- import { useCallback as a, useState as A } from "react";
1
+ import { AppPersistenceStorage as r } from "../helpers/AppPersistenceStorage.js";
2
+ import { useCallback as c, useState as u } from "react";
3
3
  function S(e, g) {
4
- const c = {
4
+ const [o] = u(() => ({
5
5
  pages: g.pages ?? {},
6
6
  theme: g.theme
7
- }, [l, r] = A(() => o.load(e, c)), u = a((s, n) => {
8
- r((t) => {
7
+ })), [l, a] = u(() => r.load(e, o)), h = c((s, n) => {
8
+ a((t) => {
9
9
  const m = {
10
10
  ...t,
11
11
  pages: {
@@ -13,37 +13,37 @@ function S(e, g) {
13
13
  [s]: n
14
14
  }
15
15
  };
16
- return o.save(e, m), m;
16
+ return r.save(e, m), m;
17
17
  });
18
- }, [e]), h = a((s) => {
19
- r((n) => {
18
+ }, [e]), i = c((s) => {
19
+ a((n) => {
20
20
  const t = {
21
21
  ...n,
22
22
  theme: s
23
23
  };
24
- return o.save(e, t), t;
24
+ return r.save(e, t), t;
25
25
  });
26
- }, [e]), i = a((s) => {
27
- r((n) => {
26
+ }, [e]), x = c((s) => {
27
+ a((n) => {
28
28
  const t = {
29
29
  ...n,
30
30
  pages: {
31
31
  ...n.pages,
32
- [s]: c.pages[s]
32
+ [s]: o.pages[s]
33
33
  }
34
34
  };
35
- return o.save(e, t), t;
35
+ return r.save(e, t), t;
36
36
  });
37
- }, [e]), x = a(() => {
38
- r(c), o.clearAll(e);
39
- }, [e]);
37
+ }, [e, o]), A = c(() => {
38
+ a(o), r.clearAll(e);
39
+ }, [e, o]);
40
40
  return {
41
41
  pages: l.pages,
42
42
  theme: l.theme,
43
- setPage: u,
44
- setTheme: h,
45
- clearPage: i,
46
- clearAll: x
43
+ setPage: h,
44
+ setTheme: i,
45
+ clearPage: x,
46
+ clearAll: A
47
47
  };
48
48
  }
49
49
  export {
@@ -1,4 +1,4 @@
1
- import { AuthContext as r } from "../../contexts/AuthContext/AuthContext.js";
1
+ import { AuthContext as r } from "../../contexts/AuthContext/AuthContext.context.js";
2
2
  import { useContext as o } from "react";
3
3
  var n = () => {
4
4
  const t = o(r);
package/dist/index.d.ts CHANGED
@@ -176,7 +176,7 @@ export declare interface AuthConfig {
176
176
  appName?: string;
177
177
  }
178
178
 
179
- export declare const AuthContext: default_2.Context<AuthContextValue | undefined>;
179
+ export declare const AuthContext: Context<AuthContextValue | undefined>;
180
180
 
181
181
  export declare interface AuthContextValue {
182
182
  user: User | null;