@memobit/libs 3.4.3 → 3.6.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.
- package/dist/components/AngleSlider/AngleSlider2.js +27 -27
- package/dist/components/AppHeader/AppHeader2.js +39 -36
- package/dist/components/Auth/ChangePasswordModal/ChangePasswordModal2.js +48 -52
- package/dist/components/Auth/MfaSetupModal/MfaSetupModal2.js +64 -65
- package/dist/components/Blockquote/Blockquote2.js +14 -14
- package/dist/components/BulkActionBar/BulkActionBar2.js +34 -30
- package/dist/components/Calendar/Calendar2.js +10 -8
- package/dist/components/Card/Card.css +1 -1
- package/dist/components/Confetti/Confetti2.js +2 -3
- package/dist/components/ControlPanel/ControlPanelFilter.js +26 -26
- package/dist/components/DataView/DataView.CardView.js +8 -4
- package/dist/components/DataView/DataView.ColumnSelector.js +24 -21
- package/dist/components/DataView/DataView.MiniSort.js +18 -16
- package/dist/components/DataView/DataView2.js +90 -86
- package/dist/components/DiffViewer/DiffViewer2.js +124 -118
- package/dist/components/Dropdown/Dropdown2.js +0 -3
- package/dist/components/EventCalendar/EventCalendar.Chip.js +21 -21
- package/dist/components/EventCalendar/EventCalendar.Month.js +19 -19
- package/dist/components/FloatingWindow/FloatingWindow2.js +60 -60
- package/dist/components/Grid/Grid2.js +18 -18
- package/dist/components/InputPIN/InputPIN2.js +42 -42
- package/dist/components/MiniSort/MiniSort2.js +47 -43
- package/dist/components/MiniStatsCard/MiniStatsCard2.js +20 -20
- package/dist/components/Pagination/Pagination2.js +18 -18
- package/dist/components/Popover/Popover2.js +23 -21
- package/dist/components/ProtectedRoute/ProtectedRoute.css +1 -0
- package/dist/components/ProtectedRoute/ProtectedRoute2.js +19 -0
- package/dist/components/RangeSlider/RangeSlider2.js +25 -25
- package/dist/components/Rating/RatingIcon.js +9 -9
- package/dist/components/RichTextEditor/hooks/useLinkPrompt.js +7 -6
- package/dist/components/RollingNumber/RollingNumber2.js +33 -31
- package/dist/components/Separator/Separator2.js +27 -23
- package/dist/components/Skeleton/Skeleton2.js +6 -8
- package/dist/components/Slider/Slider2.js +32 -32
- package/dist/components/Splitter/Splitter2.js +34 -34
- package/dist/components/StackedBar/StackedBar2.js +36 -34
- package/dist/components/Stats/Stats2.js +20 -16
- package/dist/components/StickyBar/StickyBar2.js +26 -22
- package/dist/components/Timeline/Timeline2.js +53 -47
- package/dist/components/Tooltip/Tooltip2.js +7 -8
- package/dist/components/TourHud/TourHud2.js +20 -20
- package/dist/components/Transition/Transition2.js +20 -20
- package/dist/components/Tree/Tree2.js +23 -23
- package/dist/contexts/AuthContext/AuthContext.js +33 -32
- package/dist/helpers/Charts.js +18 -0
- package/dist/helpers/Http.js +102 -0
- package/dist/helpers/Images.js +19 -0
- package/dist/helpers/Numbers.js +5 -4
- package/dist/helpers/VersionInfo.js +1 -1
- package/dist/hooks/useAccountMenu.js +58 -0
- package/dist/http.d.ts +97 -0
- package/dist/http.js +14 -0
- package/dist/index.d.ts +152 -5
- package/dist/index.js +334 -309
- package/dist/node_modules/qrcode.react/lib/esm/index.js +2 -2
- package/dist/router.d.ts +18 -0
- package/dist/router.js +4 -0
- package/dist/version.js +2 -2
- package/dist/version.json +4 -4
- package/package.json +38 -23
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import './AngleSlider.css';
|
|
2
2
|
/* empty css */
|
|
3
|
-
import { useCallback as c, useMemo as
|
|
3
|
+
import { useCallback as c, useMemo as L, useRef as A } from "react";
|
|
4
4
|
import { jsx as f, jsxs as m } from "react/jsx-runtime";
|
|
5
|
-
var
|
|
6
|
-
x: o +
|
|
7
|
-
y: o -
|
|
8
|
-
}),
|
|
5
|
+
var y = 42, o = 50, U = 2 * Math.PI * y, D = 360, $ = (e) => e * Math.PI / 180, w = (e, d) => ({
|
|
6
|
+
x: o + d * Math.sin($(e)),
|
|
7
|
+
y: o - d * Math.cos($(e))
|
|
8
|
+
}), J = ({ disabled: e = !1, label: d, max: i = D, min: a = 0, onChange: u, size: j = 120, step: l = 1, tickStep: h = 45, keyboardStep: N, showValue: T = !0, value: p, variant: B = "accent" }) => {
|
|
9
9
|
const R = A(null), g = A(!1), P = Math.max(1, i - a), _ = c((r) => {
|
|
10
10
|
const n = l > 0 ? Math.round(r / l) * l : r;
|
|
11
11
|
return Math.min(i, Math.max(a, n));
|
|
@@ -33,7 +33,7 @@ var d = 42, o = 50, U = 2 * Math.PI * d, D = 360, $ = (e) => e * Math.PI / 180,
|
|
|
33
33
|
g.current && (r.currentTarget.releasePointerCapture(r.pointerId), g.current = !1);
|
|
34
34
|
}, []), X = c((r) => {
|
|
35
35
|
if (e) return;
|
|
36
|
-
const n =
|
|
36
|
+
const n = N ?? (l > 0 ? l : 1), t = r.key === "PageUp" ? n * 10 : r.key === "PageDown" ? -n * 10 : 0, s = r.key === "ArrowRight" || r.key === "ArrowUp" ? n : r.key === "ArrowLeft" || r.key === "ArrowDown" ? -n : 0;
|
|
37
37
|
if (r.key === "Home") {
|
|
38
38
|
r.preventDefault(), u(a);
|
|
39
39
|
return;
|
|
@@ -42,33 +42,33 @@ var d = 42, o = 50, U = 2 * Math.PI * d, D = 360, $ = (e) => e * Math.PI / 180,
|
|
|
42
42
|
r.preventDefault(), u(i);
|
|
43
43
|
return;
|
|
44
44
|
}
|
|
45
|
-
t === 0 && s === 0 || (r.preventDefault(), u(_(
|
|
45
|
+
t === 0 && s === 0 || (r.preventDefault(), u(_(p + t + s)));
|
|
46
46
|
}, [
|
|
47
47
|
_,
|
|
48
48
|
e,
|
|
49
|
-
|
|
49
|
+
N,
|
|
50
50
|
i,
|
|
51
51
|
a,
|
|
52
52
|
u,
|
|
53
53
|
l,
|
|
54
|
-
|
|
55
|
-
]), Y =
|
|
56
|
-
if (!
|
|
54
|
+
p
|
|
55
|
+
]), Y = L(() => {
|
|
56
|
+
if (!h || h <= 0) return [];
|
|
57
57
|
const r = [];
|
|
58
|
-
for (let n = a; n < a + P; n +=
|
|
58
|
+
for (let n = a; n < a + P; n += h) r.push(n);
|
|
59
59
|
return r;
|
|
60
60
|
}, [
|
|
61
61
|
a,
|
|
62
62
|
P,
|
|
63
|
-
|
|
64
|
-
]), z = (Math.min(i, Math.max(a,
|
|
63
|
+
h
|
|
64
|
+
]), z = (Math.min(i, Math.max(a, p)) - a) / P, M = w(p, y), G = [
|
|
65
|
+
"angle-slider",
|
|
66
|
+
`angle-slider--${B}`,
|
|
67
|
+
e ? "angle-slider--disabled" : ""
|
|
68
|
+
].filter(Boolean).join(" "), H = { "--_angle-size": `${j}px` };
|
|
65
69
|
return /* @__PURE__ */ m("div", {
|
|
66
|
-
className:
|
|
67
|
-
|
|
68
|
-
`angle-slider--${B}`,
|
|
69
|
-
e ? "angle-slider--disabled" : ""
|
|
70
|
-
].filter(Boolean).join(" "),
|
|
71
|
-
style: { "--_angle-size": `${j}px` },
|
|
70
|
+
className: G,
|
|
71
|
+
style: H,
|
|
72
72
|
children: [
|
|
73
73
|
/* @__PURE__ */ m("svg", {
|
|
74
74
|
className: "angle-slider__dial",
|
|
@@ -84,10 +84,10 @@ var d = 42, o = 50, U = 2 * Math.PI * d, D = 360, $ = (e) => e * Math.PI / 180,
|
|
|
84
84
|
className: "angle-slider__track",
|
|
85
85
|
cx: o,
|
|
86
86
|
cy: o,
|
|
87
|
-
r:
|
|
87
|
+
r: y
|
|
88
88
|
}),
|
|
89
89
|
Y.map((r) => {
|
|
90
|
-
const n =
|
|
90
|
+
const n = w(r, y), t = w(r, 36);
|
|
91
91
|
return /* @__PURE__ */ f("line", {
|
|
92
92
|
className: "angle-slider__tick",
|
|
93
93
|
x1: t.x,
|
|
@@ -100,7 +100,7 @@ var d = 42, o = 50, U = 2 * Math.PI * d, D = 360, $ = (e) => e * Math.PI / 180,
|
|
|
100
100
|
className: "angle-slider__progress",
|
|
101
101
|
cx: o,
|
|
102
102
|
cy: o,
|
|
103
|
-
r:
|
|
103
|
+
r: y,
|
|
104
104
|
strokeDasharray: `${U * z} ${U}`,
|
|
105
105
|
transform: `rotate(-90 ${o} ${o})`
|
|
106
106
|
}),
|
|
@@ -121,15 +121,15 @@ var d = 42, o = 50, U = 2 * Math.PI * d, D = 360, $ = (e) => e * Math.PI / 180,
|
|
|
121
121
|
}),
|
|
122
122
|
T && /* @__PURE__ */ m("span", {
|
|
123
123
|
className: "angle-slider__value",
|
|
124
|
-
children: [Math.round(
|
|
124
|
+
children: [Math.round(p), "°"]
|
|
125
125
|
}),
|
|
126
|
-
|
|
126
|
+
d && /* @__PURE__ */ f("span", {
|
|
127
127
|
className: "angle-slider__label",
|
|
128
|
-
children:
|
|
128
|
+
children: d
|
|
129
129
|
})
|
|
130
130
|
]
|
|
131
131
|
});
|
|
132
132
|
};
|
|
133
133
|
export {
|
|
134
|
-
|
|
134
|
+
J as AngleSlider
|
|
135
135
|
};
|
|
@@ -1,44 +1,47 @@
|
|
|
1
1
|
import './AppHeader.css';
|
|
2
|
-
import { Icon as
|
|
3
|
-
import { Separator as
|
|
2
|
+
import { Icon as h } from "../Icon/Icon2.js";
|
|
3
|
+
import { Separator as o } from "../Separator/Separator2.js";
|
|
4
4
|
/* empty css */
|
|
5
5
|
import "react";
|
|
6
|
-
import { Fragment as
|
|
7
|
-
var
|
|
8
|
-
|
|
6
|
+
import { Fragment as t, jsx as a, jsxs as e } from "react/jsx-runtime";
|
|
7
|
+
var v = ({ emoji: r, icon: p, svg: s, appName: c, heading: n, onClick: d, className: l = "", showSeparator: m = !0 }) => {
|
|
8
|
+
const i = [
|
|
9
9
|
"app-header",
|
|
10
10
|
d ? "app-header--clickable" : "",
|
|
11
11
|
l
|
|
12
|
-
].filter(Boolean).join(" ")
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
className: "app-
|
|
31
|
-
children: c
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
})
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
12
|
+
].filter(Boolean).join(" ");
|
|
13
|
+
return /* @__PURE__ */ e(t, { children: [/* @__PURE__ */ e("div", {
|
|
14
|
+
className: i,
|
|
15
|
+
onClick: d,
|
|
16
|
+
children: [
|
|
17
|
+
r && /* @__PURE__ */ a("span", {
|
|
18
|
+
className: "app-header__icon",
|
|
19
|
+
children: r
|
|
20
|
+
}),
|
|
21
|
+
s && /* @__PURE__ */ a("span", {
|
|
22
|
+
className: "app-header__icon",
|
|
23
|
+
children: s
|
|
24
|
+
}),
|
|
25
|
+
p && /* @__PURE__ */ a("span", {
|
|
26
|
+
className: "app-header__icon",
|
|
27
|
+
children: /* @__PURE__ */ a(h, { name: p })
|
|
28
|
+
}),
|
|
29
|
+
/* @__PURE__ */ e("div", {
|
|
30
|
+
className: "app-header__copy",
|
|
31
|
+
children: [c && /* @__PURE__ */ a("span", {
|
|
32
|
+
className: "app-header__app-name",
|
|
33
|
+
children: c
|
|
34
|
+
}), n && /* @__PURE__ */ a("span", {
|
|
35
|
+
className: "app-header__headline",
|
|
36
|
+
children: n
|
|
37
|
+
})]
|
|
38
|
+
})
|
|
39
|
+
]
|
|
40
|
+
}), m && /* @__PURE__ */ a(o, {
|
|
41
|
+
className: "app-header__separator",
|
|
42
|
+
spacing: 0
|
|
43
|
+
})] });
|
|
44
|
+
};
|
|
42
45
|
export {
|
|
43
|
-
|
|
46
|
+
v as AppHeader
|
|
44
47
|
};
|
|
@@ -1,122 +1,118 @@
|
|
|
1
1
|
import './ChangePasswordModal.css';
|
|
2
|
-
import { Modal as
|
|
3
|
-
import { InputPassword as
|
|
4
|
-
import { Toast as
|
|
2
|
+
import { Modal as y } from "../../Modal/Modal2.js";
|
|
3
|
+
import { InputPassword as h } from "../../InputPassword/InputPassword2.js";
|
|
4
|
+
import { Toast as v } from "../../Toast/Toast2.js";
|
|
5
|
+
import { HttpMethod as C, buildRequestHeaders as E, readErrorMessage as x } from "../../../helpers/Http.js";
|
|
5
6
|
import { useAuth as F } from "../../../hooks/useAuth/useAuth.js";
|
|
6
7
|
/* empty css */
|
|
7
|
-
import { useEffect as
|
|
8
|
-
import { jsx as e, jsxs as
|
|
9
|
-
function
|
|
10
|
-
const { config: b } = F(), [i,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}, [
|
|
14
|
-
const
|
|
15
|
-
if (!i || !
|
|
8
|
+
import { useEffect as k, useState as o } from "react";
|
|
9
|
+
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
10
|
+
function z({ isOpen: n, onClose: l }) {
|
|
11
|
+
const { config: b } = F(), [i, m] = o(""), [d, u] = o(""), [c, f] = o(""), [g, a] = o(""), [r, p] = o(!1), [w, P] = o(null);
|
|
12
|
+
k(() => {
|
|
13
|
+
n && (m(""), u(""), f(""), a(""));
|
|
14
|
+
}, [n]);
|
|
15
|
+
const N = async () => {
|
|
16
|
+
if (!i || !d || !c) {
|
|
16
17
|
a("All fields are required");
|
|
17
18
|
return;
|
|
18
19
|
}
|
|
19
|
-
if (
|
|
20
|
+
if (d !== c) {
|
|
20
21
|
a("New passwords do not match");
|
|
21
22
|
return;
|
|
22
23
|
}
|
|
23
|
-
if (
|
|
24
|
+
if (d.length < 8) {
|
|
24
25
|
a("New password must be at least 8 characters long");
|
|
25
26
|
return;
|
|
26
27
|
}
|
|
27
|
-
|
|
28
|
+
p(!0), a("");
|
|
28
29
|
try {
|
|
29
|
-
const s =
|
|
30
|
-
|
|
31
|
-
const N = await fetch(`${b.apiBaseUrl}/auth/changePassword`, {
|
|
32
|
-
method: "POST",
|
|
30
|
+
const s = await fetch(`${b.apiBaseUrl}/auth/changePassword`, {
|
|
31
|
+
method: C.Post,
|
|
33
32
|
credentials: "include",
|
|
34
|
-
headers:
|
|
33
|
+
headers: E(C.Post),
|
|
35
34
|
body: JSON.stringify({
|
|
36
35
|
currentPassword: i,
|
|
37
|
-
newPassword:
|
|
36
|
+
newPassword: d
|
|
38
37
|
})
|
|
39
38
|
});
|
|
40
|
-
if (!
|
|
41
|
-
const v = await N.json();
|
|
42
|
-
throw new Error(v.error || "Failed to change password");
|
|
43
|
-
}
|
|
39
|
+
if (!s.ok) throw new Error(await x(s));
|
|
44
40
|
P({
|
|
45
41
|
message: "Password changed successfully!",
|
|
46
42
|
type: "success"
|
|
47
43
|
}), setTimeout(() => {
|
|
48
|
-
|
|
44
|
+
l();
|
|
49
45
|
}, 2e3);
|
|
50
46
|
} catch (s) {
|
|
51
|
-
const
|
|
52
|
-
a(
|
|
47
|
+
const M = s instanceof Error ? s.message : "Failed to change password";
|
|
48
|
+
a(M);
|
|
53
49
|
} finally {
|
|
54
|
-
|
|
50
|
+
p(!1);
|
|
55
51
|
}
|
|
56
|
-
},
|
|
52
|
+
}, _ = () => {
|
|
57
53
|
P(null);
|
|
58
54
|
};
|
|
59
|
-
return /* @__PURE__ */
|
|
60
|
-
isOpen:
|
|
61
|
-
onClose:
|
|
55
|
+
return /* @__PURE__ */ t(y, {
|
|
56
|
+
isOpen: n,
|
|
57
|
+
onClose: l,
|
|
62
58
|
title: "Change Password",
|
|
63
59
|
size: "medium",
|
|
64
60
|
primary: {
|
|
65
61
|
text: r ? "Changing..." : "Change Password",
|
|
66
|
-
onClick:
|
|
62
|
+
onClick: N,
|
|
67
63
|
icon: "lock",
|
|
68
64
|
variant: "success",
|
|
69
65
|
disabled: r
|
|
70
66
|
},
|
|
71
67
|
secondary: {
|
|
72
68
|
text: "Cancel",
|
|
73
|
-
onClick:
|
|
69
|
+
onClick: l,
|
|
74
70
|
icon: "clear",
|
|
75
71
|
variant: "default",
|
|
76
72
|
disabled: r
|
|
77
73
|
},
|
|
78
|
-
children: [/* @__PURE__ */
|
|
74
|
+
children: [/* @__PURE__ */ t("div", {
|
|
79
75
|
className: "ChangePasswordModal",
|
|
80
76
|
children: [
|
|
81
|
-
/* @__PURE__ */
|
|
77
|
+
/* @__PURE__ */ t("div", {
|
|
82
78
|
className: "ChangePasswordModal__field",
|
|
83
79
|
children: [/* @__PURE__ */ e("label", {
|
|
84
80
|
htmlFor: "current-password",
|
|
85
81
|
className: "ChangePasswordModal__label",
|
|
86
82
|
children: "Current Password"
|
|
87
|
-
}), /* @__PURE__ */ e(
|
|
83
|
+
}), /* @__PURE__ */ e(h, {
|
|
88
84
|
id: "current-password",
|
|
89
85
|
value: i,
|
|
90
|
-
onChange: (s) =>
|
|
86
|
+
onChange: (s) => m(s),
|
|
91
87
|
placeholder: "Enter current password",
|
|
92
88
|
disabled: r,
|
|
93
89
|
autoFocus: !0
|
|
94
90
|
})]
|
|
95
91
|
}),
|
|
96
|
-
/* @__PURE__ */
|
|
92
|
+
/* @__PURE__ */ t("div", {
|
|
97
93
|
className: "ChangePasswordModal__field",
|
|
98
94
|
children: [/* @__PURE__ */ e("label", {
|
|
99
95
|
htmlFor: "new-password",
|
|
100
96
|
className: "ChangePasswordModal__label",
|
|
101
97
|
children: "New Password"
|
|
102
|
-
}), /* @__PURE__ */ e(
|
|
98
|
+
}), /* @__PURE__ */ e(h, {
|
|
103
99
|
id: "new-password",
|
|
104
|
-
value:
|
|
105
|
-
onChange: (s) =>
|
|
100
|
+
value: d,
|
|
101
|
+
onChange: (s) => u(s),
|
|
106
102
|
placeholder: "Enter new password",
|
|
107
103
|
disabled: r
|
|
108
104
|
})]
|
|
109
105
|
}),
|
|
110
|
-
/* @__PURE__ */
|
|
106
|
+
/* @__PURE__ */ t("div", {
|
|
111
107
|
className: "ChangePasswordModal__field",
|
|
112
108
|
children: [/* @__PURE__ */ e("label", {
|
|
113
109
|
htmlFor: "confirm-password",
|
|
114
110
|
className: "ChangePasswordModal__label",
|
|
115
111
|
children: "Confirm New Password"
|
|
116
|
-
}), /* @__PURE__ */ e(
|
|
112
|
+
}), /* @__PURE__ */ e(h, {
|
|
117
113
|
id: "confirm-password",
|
|
118
|
-
value:
|
|
119
|
-
onChange: (s) =>
|
|
114
|
+
value: c,
|
|
115
|
+
onChange: (s) => f(s),
|
|
120
116
|
placeholder: "Confirm new password",
|
|
121
117
|
disabled: r
|
|
122
118
|
})]
|
|
@@ -126,13 +122,13 @@ function U({ isOpen: l, onClose: c }) {
|
|
|
126
122
|
children: g
|
|
127
123
|
})
|
|
128
124
|
]
|
|
129
|
-
}),
|
|
130
|
-
message:
|
|
131
|
-
type:
|
|
132
|
-
onClose:
|
|
125
|
+
}), w && /* @__PURE__ */ e(v, {
|
|
126
|
+
message: w.message,
|
|
127
|
+
type: w.type,
|
|
128
|
+
onClose: _
|
|
133
129
|
})]
|
|
134
130
|
});
|
|
135
131
|
}
|
|
136
132
|
export {
|
|
137
|
-
|
|
133
|
+
z as ChangePasswordModal
|
|
138
134
|
};
|