@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.
- package/dist/components/Confetti/Confetti2.js +33 -33
- package/dist/components/ContextToast/ContextToast2.js +53 -57
- package/dist/components/ContextToast/useToast.js +12 -0
- package/dist/components/ControlPanel/ControlPanel2.js +41 -43
- package/dist/components/ControlPanel/ControlPanelContext.js +16 -21
- package/dist/components/ControlPanel/useControlPanel.js +11 -0
- package/dist/components/DataView/DataView.CardView.js +83 -109
- package/dist/components/DataView/DataView.MiniSort.js +1 -1
- package/dist/components/DataView/DataView.helpers.js +34 -0
- package/dist/components/DataView/DataView2.js +111 -108
- package/dist/components/Dropdown/Dropdown2.js +108 -106
- package/dist/components/InputEmail/InputEmail2.js +43 -43
- package/dist/components/InputEmail/validateEmail.js +7 -0
- package/dist/components/InputMask/InputMask2.js +40 -54
- package/dist/components/InputMask/InputMaskPresets.js +18 -0
- package/dist/components/Pagination/Pagination2.js +4 -4
- package/dist/components/Sidebar/Sidebar2.js +1 -1
- package/dist/components/Sidebar/SidebarContext.js +18 -23
- package/dist/components/Sidebar/useSidebar.js +11 -0
- package/dist/components/SuggestionsList/SuggestionsList2.js +27 -27
- package/dist/components/TimelineMarkers/TimelineMarkers2.js +31 -49
- package/dist/components/TimelineMarkers/calculateTimelineMarkers.js +28 -0
- package/dist/components/Toolbar/Toolbar2.js +6 -6
- package/dist/components/Tooltip/Tooltip2.js +35 -35
- package/dist/contexts/AuthContext/AuthContext.context.js +5 -0
- package/dist/contexts/AuthContext/AuthContext.js +5 -6
- package/dist/helpers/VersionInfo.js +1 -1
- package/dist/hooks/useAppPersistence.js +20 -20
- package/dist/hooks/useAuth/useAuth.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +269 -262
- package/dist/version.js +1 -1
- package/dist/version.json +4 -4
- 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
|
|
5
|
-
import { createPortal as
|
|
6
|
-
var
|
|
7
|
-
const [f,
|
|
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),
|
|
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(),
|
|
20
|
+
const n = d.current.getBoundingClientRect(), v = 8;
|
|
21
21
|
let o = 0, i = 0;
|
|
22
|
-
switch (
|
|
22
|
+
switch (p) {
|
|
23
23
|
case "top":
|
|
24
|
-
o = e.top - n.height -
|
|
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 +
|
|
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 -
|
|
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 +
|
|
33
|
+
o = e.top + e.height / 2 - n.height / 2, i = e.right + v;
|
|
34
34
|
}
|
|
35
|
-
const
|
|
36
|
-
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
|
-
$ ||
|
|
42
|
-
|
|
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
|
-
|
|
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" || $ || (
|
|
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) ||
|
|
52
|
+
e.target instanceof Node && d.current?.contains(e.target) || s(!1);
|
|
53
53
|
};
|
|
54
|
-
return
|
|
55
|
-
window.removeEventListener("scroll", t, !0), window.removeEventListener("resize",
|
|
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) ||
|
|
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),
|
|
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
|
-
|
|
69
|
+
m && r.current && (clearTimeout(r.current), r.current = null);
|
|
70
70
|
}, z = () => {
|
|
71
|
-
|
|
71
|
+
m && (r.current = setTimeout(() => s(!1), R));
|
|
72
72
|
};
|
|
73
|
-
return /* @__PURE__ */
|
|
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:
|
|
82
|
-
}), f && L &&
|
|
81
|
+
children: _
|
|
82
|
+
}), f && L && O(/* @__PURE__ */ k("div", {
|
|
83
83
|
ref: d,
|
|
84
|
-
className: `tooltip tooltip--${
|
|
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
|
-
...
|
|
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--${
|
|
93
|
+
children: [L, /* @__PURE__ */ N("div", { className: `tooltip__arrow tooltip__arrow--${p}` })]
|
|
94
94
|
}), document.body)] });
|
|
95
95
|
};
|
|
96
96
|
export {
|
|
97
|
-
|
|
97
|
+
Q as Tooltip
|
|
98
98
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { HttpMethod as s, buildRequestHeaders as w } from "../../helpers/Http.js";
|
|
2
|
-
import {
|
|
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
|
-
|
|
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(
|
|
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
|
-
|
|
113
|
-
P as AuthProvider
|
|
112
|
+
C as AuthProvider
|
|
114
113
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { AppPersistenceStorage as
|
|
2
|
-
import { useCallback as
|
|
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
|
|
4
|
+
const [o] = u(() => ({
|
|
5
5
|
pages: g.pages ?? {},
|
|
6
6
|
theme: g.theme
|
|
7
|
-
}, [l,
|
|
8
|
-
|
|
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
|
|
16
|
+
return r.save(e, m), m;
|
|
17
17
|
});
|
|
18
|
-
}, [e]),
|
|
19
|
-
|
|
18
|
+
}, [e]), i = c((s) => {
|
|
19
|
+
a((n) => {
|
|
20
20
|
const t = {
|
|
21
21
|
...n,
|
|
22
22
|
theme: s
|
|
23
23
|
};
|
|
24
|
-
return
|
|
24
|
+
return r.save(e, t), t;
|
|
25
25
|
});
|
|
26
|
-
}, [e]),
|
|
27
|
-
|
|
26
|
+
}, [e]), x = c((s) => {
|
|
27
|
+
a((n) => {
|
|
28
28
|
const t = {
|
|
29
29
|
...n,
|
|
30
30
|
pages: {
|
|
31
31
|
...n.pages,
|
|
32
|
-
[s]:
|
|
32
|
+
[s]: o.pages[s]
|
|
33
33
|
}
|
|
34
34
|
};
|
|
35
|
-
return
|
|
35
|
+
return r.save(e, t), t;
|
|
36
36
|
});
|
|
37
|
-
}, [e]),
|
|
38
|
-
|
|
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:
|
|
44
|
-
setTheme:
|
|
45
|
-
clearPage:
|
|
46
|
-
clearAll:
|
|
43
|
+
setPage: h,
|
|
44
|
+
setTheme: i,
|
|
45
|
+
clearPage: x,
|
|
46
|
+
clearAll: A
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
49
|
export {
|
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:
|
|
179
|
+
export declare const AuthContext: Context<AuthContextValue | undefined>;
|
|
180
180
|
|
|
181
181
|
export declare interface AuthContextValue {
|
|
182
182
|
user: User | null;
|