@memobit/libs 3.11.1 → 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/memobit-icons.json +41 -1
- package/dist/version.js +2 -2
- package/dist/version.json +4 -4
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import './InputMask.css';
|
|
2
2
|
/* empty css */
|
|
3
3
|
import A, { forwardRef as U, useCallback as W, useId as X, useImperativeHandle as Y, useRef as O, useState as C } from "react";
|
|
4
|
-
import { jsx as m, jsxs as
|
|
4
|
+
import { jsx as m, jsxs as N } from "react/jsx-runtime";
|
|
5
5
|
var D = {
|
|
6
6
|
9: /\d/,
|
|
7
7
|
a: /[a-zA-Z]/,
|
|
@@ -25,80 +25,80 @@ function te(e) {
|
|
|
25
25
|
}), t++);
|
|
26
26
|
return n;
|
|
27
27
|
}
|
|
28
|
-
function
|
|
29
|
-
let
|
|
30
|
-
for (const
|
|
31
|
-
else if (
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
} else
|
|
28
|
+
function v(e, n, t) {
|
|
29
|
+
let r = 0, u = "", p = "";
|
|
30
|
+
for (const f of n) if (f.type === "literal") u += f.char;
|
|
31
|
+
else if (r < e.length) {
|
|
32
|
+
const c = e[r];
|
|
33
|
+
u += c, p += c, r++;
|
|
34
|
+
} else u += t;
|
|
35
35
|
return {
|
|
36
|
-
masked:
|
|
36
|
+
masked: u,
|
|
37
37
|
rawAccepted: p
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
function ne(e) {
|
|
41
41
|
return e.filter((n) => n.type === "token").length;
|
|
42
42
|
}
|
|
43
|
-
var se = U(({ mask: e, value: n, onChange: t, onComplete:
|
|
44
|
-
const i = A.useMemo(() => te(e), [e]),
|
|
45
|
-
Y(
|
|
43
|
+
var se = U(({ mask: e, value: n, onChange: t, onComplete: r, placeholder: u, label: p, hint: f, error: c, highlighted: S, size: $ = "md", variant: B = "default", disabled: h = !1, readOnly: k = !1, maskChar: a = "_", mono: V = !0, icon: y, suffix: g, className: z = "", id: E, name: F, autoComplete: T }, Z) => {
|
|
44
|
+
const i = A.useMemo(() => te(e), [e]), d = A.useMemo(() => ne(i), [i]), b = X(), x = E ?? b, [l, w] = C(() => n !== void 0 ? n : ""), I = O(null);
|
|
45
|
+
Y(Z, () => ({
|
|
46
46
|
focus: () => I.current?.focus(),
|
|
47
47
|
clear: () => {
|
|
48
48
|
w(""), t?.("", "");
|
|
49
49
|
},
|
|
50
|
-
getRawValue: () =>
|
|
50
|
+
getRawValue: () => l
|
|
51
51
|
}));
|
|
52
|
-
const { masked:
|
|
52
|
+
const { masked: M } = v(l, i, a), H = M.includes(a) ? M.replace(new RegExp(a.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"), a) : M, L = c ? "danger" : B, P = [
|
|
53
53
|
"input-mask",
|
|
54
54
|
`input-mask--${$}`,
|
|
55
|
-
`input-mask--${
|
|
55
|
+
`input-mask--${L}`,
|
|
56
56
|
S ? "input-mask--highlighted" : "",
|
|
57
57
|
h ? "input-mask--disabled" : "",
|
|
58
58
|
k ? "input-mask--readonly" : "",
|
|
59
|
-
|
|
59
|
+
V ? "input-mask--mono" : "",
|
|
60
60
|
y ? "input-mask--has-icon" : "",
|
|
61
61
|
g ? "input-mask--has-suffix" : "",
|
|
62
|
-
|
|
62
|
+
z
|
|
63
63
|
].filter(Boolean).join(" "), q = W((s) => {
|
|
64
64
|
if (h || k) return;
|
|
65
65
|
if (s.key === "Backspace") {
|
|
66
66
|
s.preventDefault();
|
|
67
|
-
const o =
|
|
67
|
+
const o = l.slice(0, -1), { masked: Q } = v(o, i, a);
|
|
68
68
|
w(o), t?.(o, Q);
|
|
69
69
|
return;
|
|
70
70
|
}
|
|
71
|
-
if (s.key.length !== 1 || s.ctrlKey || s.metaKey || (s.preventDefault(),
|
|
71
|
+
if (s.key.length !== 1 || s.ctrlKey || s.metaKey || (s.preventDefault(), l.length >= d)) return;
|
|
72
72
|
const R = s.key;
|
|
73
73
|
let K = 0;
|
|
74
74
|
for (const o of i) if (o.type === "token") {
|
|
75
|
-
if (K ===
|
|
75
|
+
if (K === l.length) {
|
|
76
76
|
if (!D[o.key].test(R)) return;
|
|
77
77
|
break;
|
|
78
78
|
}
|
|
79
79
|
K++;
|
|
80
80
|
}
|
|
81
|
-
const { masked: j, rawAccepted: _ } =
|
|
82
|
-
w(_), t?.(_, j), _.length ===
|
|
81
|
+
const { masked: j, rawAccepted: _ } = v(l + R, i, a);
|
|
82
|
+
w(_), t?.(_, j), _.length === d && r?.(_, j);
|
|
83
83
|
}, [
|
|
84
84
|
h,
|
|
85
85
|
k,
|
|
86
|
-
a,
|
|
87
|
-
i,
|
|
88
86
|
l,
|
|
89
|
-
|
|
87
|
+
i,
|
|
88
|
+
a,
|
|
89
|
+
d,
|
|
90
90
|
t,
|
|
91
|
-
|
|
92
|
-
]), G =
|
|
93
|
-
return /* @__PURE__ */
|
|
94
|
-
className:
|
|
91
|
+
r
|
|
92
|
+
]), G = u ?? i.map((s) => s.type === "literal" ? s.char : a).join(""), J = l.length === d;
|
|
93
|
+
return /* @__PURE__ */ N("div", {
|
|
94
|
+
className: P,
|
|
95
95
|
children: [
|
|
96
96
|
p && /* @__PURE__ */ m("label", {
|
|
97
97
|
className: "input-mask__label",
|
|
98
98
|
htmlFor: x,
|
|
99
99
|
children: p
|
|
100
100
|
}),
|
|
101
|
-
/* @__PURE__ */
|
|
101
|
+
/* @__PURE__ */ N("div", {
|
|
102
102
|
className: "input-mask__field",
|
|
103
103
|
children: [
|
|
104
104
|
y && /* @__PURE__ */ m("span", {
|
|
@@ -108,12 +108,12 @@ var se = U(({ mask: e, value: n, onChange: t, onComplete: u, placeholder: c, lab
|
|
|
108
108
|
/* @__PURE__ */ m("input", {
|
|
109
109
|
ref: I,
|
|
110
110
|
id: x,
|
|
111
|
-
name:
|
|
111
|
+
name: F,
|
|
112
112
|
type: "text",
|
|
113
113
|
inputMode: "text",
|
|
114
|
-
autoComplete:
|
|
114
|
+
autoComplete: T,
|
|
115
115
|
className: ["input-mask__input", J ? "input-mask__input--filled" : ""].filter(Boolean).join(" "),
|
|
116
|
-
value:
|
|
116
|
+
value: H,
|
|
117
117
|
placeholder: G,
|
|
118
118
|
disabled: h,
|
|
119
119
|
readOnly: k,
|
|
@@ -122,12 +122,12 @@ var se = U(({ mask: e, value: n, onChange: t, onComplete: u, placeholder: c, lab
|
|
|
122
122
|
},
|
|
123
123
|
onKeyDown: q
|
|
124
124
|
}),
|
|
125
|
-
/* @__PURE__ */
|
|
125
|
+
/* @__PURE__ */ N("span", {
|
|
126
126
|
className: "input-mask__counter",
|
|
127
127
|
children: [
|
|
128
|
-
|
|
128
|
+
l.length,
|
|
129
129
|
"/",
|
|
130
|
-
|
|
130
|
+
d
|
|
131
131
|
]
|
|
132
132
|
}),
|
|
133
133
|
g && /* @__PURE__ */ m("span", {
|
|
@@ -136,28 +136,14 @@ var se = U(({ mask: e, value: n, onChange: t, onComplete: u, placeholder: c, lab
|
|
|
136
136
|
})
|
|
137
137
|
]
|
|
138
138
|
}),
|
|
139
|
-
(
|
|
140
|
-
className:
|
|
141
|
-
children:
|
|
139
|
+
(f || c) && /* @__PURE__ */ m("p", {
|
|
140
|
+
className: c ? "input-mask__error" : "input-mask__hint",
|
|
141
|
+
children: c ?? f
|
|
142
142
|
})
|
|
143
143
|
]
|
|
144
144
|
});
|
|
145
145
|
});
|
|
146
146
|
se.displayName = "InputMask";
|
|
147
|
-
var re = {
|
|
148
|
-
creditCard: "9999 9999 9999 9999",
|
|
149
|
-
iban: "aa99 9999 9999 9999 9999 99",
|
|
150
|
-
cvv: "999",
|
|
151
|
-
expiry: "99/99",
|
|
152
|
-
phone: "+99 (999) 999-9999",
|
|
153
|
-
ssn: "999-99-9999",
|
|
154
|
-
ipv4: "999.999.999.999",
|
|
155
|
-
serialNumber: "***-***-***-***",
|
|
156
|
-
date: "99/99/9999",
|
|
157
|
-
time: "99:99",
|
|
158
|
-
uuid: "********-****-****-****-************"
|
|
159
|
-
};
|
|
160
147
|
export {
|
|
161
|
-
se as InputMask
|
|
162
|
-
re as InputMaskPresets
|
|
148
|
+
se as InputMask
|
|
163
149
|
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import './InputMask.css';
|
|
2
|
+
/* empty css */
|
|
3
|
+
var r = {
|
|
4
|
+
creditCard: "9999 9999 9999 9999",
|
|
5
|
+
iban: "aa99 9999 9999 9999 9999 99",
|
|
6
|
+
cvv: "999",
|
|
7
|
+
expiry: "99/99",
|
|
8
|
+
phone: "+99 (999) 999-9999",
|
|
9
|
+
ssn: "999-99-9999",
|
|
10
|
+
ipv4: "999.999.999.999",
|
|
11
|
+
serialNumber: "***-***-***-***",
|
|
12
|
+
date: "99/99/9999",
|
|
13
|
+
time: "99:99",
|
|
14
|
+
uuid: "********-****-****-****-************"
|
|
15
|
+
};
|
|
16
|
+
export {
|
|
17
|
+
r as InputMaskPresets
|
|
18
|
+
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import './Pagination.css';
|
|
2
2
|
import { Button as u } from "../Button/Button2.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { Dropdown as E } from "../Dropdown/Dropdown2.js";
|
|
4
|
+
import { useBreakpoint as y } from "../../hooks/useBreakpoint.js";
|
|
5
5
|
/* empty css */
|
|
6
6
|
import { useCallback as L, useEffect as R, useRef as I, useState as O } from "react";
|
|
7
7
|
import { jsx as t, jsxs as c } from "react/jsx-runtime";
|
|
8
8
|
var V = 120, j = 45, C = 8, H = 4, z = ({ currentPage: i, totalPages: r, totalItems: p, onPageChange: d, showPagesNumbers: N = !1, pageSizeOptions: o, pageSize: m, onPageSizeChange: v, pageSizeLabel: x = "Rows", horizontalAlign: D = "left" }) => {
|
|
9
|
-
const { isAtLeast: a, isMobile: k } =
|
|
9
|
+
const { isAtLeast: a, isMobile: k } = y(), f = I(null), [l, w] = O(k ? 0 : 2), h = L(() => {
|
|
10
10
|
const s = f.current, e = s?.parentElement;
|
|
11
11
|
if (!s || !e) return;
|
|
12
12
|
let n = 0;
|
|
@@ -64,7 +64,7 @@ var V = 120, j = 45, C = 8, H = 4, z = ({ currentPage: i, totalPages: r, totalIt
|
|
|
64
64
|
}),
|
|
65
65
|
b && M && /* @__PURE__ */ c("div", {
|
|
66
66
|
className: "pagination__page-size",
|
|
67
|
-
children: [/* @__PURE__ */ t("span", { children: x }), /* @__PURE__ */ t(
|
|
67
|
+
children: [/* @__PURE__ */ t("span", { children: x }), /* @__PURE__ */ t(E, {
|
|
68
68
|
name: "pageSize",
|
|
69
69
|
options: M,
|
|
70
70
|
value: m,
|
|
@@ -3,7 +3,7 @@ import { Icon as N } from "../Icon/Icon2.js";
|
|
|
3
3
|
import { Tooltip as M } from "../Tooltip/Tooltip2.js";
|
|
4
4
|
import { AppHeader as O } from "../AppHeader/AppHeader2.js";
|
|
5
5
|
import { InputSearch as A } from "../InputSearch/InputSearch2.js";
|
|
6
|
-
import { useSidebarContext as F } from "./
|
|
6
|
+
import { useSidebarContext as F } from "./useSidebar.js";
|
|
7
7
|
/* empty css */
|
|
8
8
|
import { useState as I } from "react";
|
|
9
9
|
import { Fragment as Q, jsx as a, jsxs as i } from "react/jsx-runtime";
|
|
@@ -1,31 +1,26 @@
|
|
|
1
|
-
import { useBreakpoint as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
toggle: n,
|
|
13
|
-
open: a,
|
|
14
|
-
close: i
|
|
1
|
+
import { useBreakpoint as p } from "../../hooks/useBreakpoint.js";
|
|
2
|
+
import { SidebarContext as l } from "./useSidebar.js";
|
|
3
|
+
import { useCallback as o, useMemo as u, useState as f } from "react";
|
|
4
|
+
import { jsx as b } from "react/jsx-runtime";
|
|
5
|
+
var k = ({ children: a }) => {
|
|
6
|
+
const { isMobile: t } = p(), [r, e] = f(!1), s = o(() => e((m) => !m), []), i = o(() => e(!0), []), n = o(() => e(!1), []), c = u(() => ({
|
|
7
|
+
isMobile: t,
|
|
8
|
+
isOpen: r,
|
|
9
|
+
toggle: s,
|
|
10
|
+
open: i,
|
|
11
|
+
close: n
|
|
15
12
|
}), [
|
|
16
|
-
|
|
13
|
+
t,
|
|
14
|
+
r,
|
|
17
15
|
s,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
i
|
|
16
|
+
i,
|
|
17
|
+
n
|
|
21
18
|
]);
|
|
22
|
-
return /* @__PURE__ */
|
|
19
|
+
return /* @__PURE__ */ b(l.Provider, {
|
|
23
20
|
value: c,
|
|
24
|
-
children:
|
|
21
|
+
children: a
|
|
25
22
|
});
|
|
26
23
|
};
|
|
27
24
|
export {
|
|
28
|
-
|
|
29
|
-
g as useSidebar,
|
|
30
|
-
S as useSidebarContext
|
|
25
|
+
k as SidebarProvider
|
|
31
26
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createContext as r, useContext as t } from "react";
|
|
2
|
+
var o = r(null), a = () => t(o), n = () => {
|
|
3
|
+
const e = a();
|
|
4
|
+
if (!e) throw new Error("useSidebar must be used within a SidebarProvider");
|
|
5
|
+
return e;
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
o as SidebarContext,
|
|
9
|
+
n as useSidebar,
|
|
10
|
+
a as useSidebarContext
|
|
11
|
+
};
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import './SuggestionsList.css';
|
|
2
|
-
import { Icon as
|
|
3
|
-
import { Button as
|
|
4
|
-
import { Tooltip as
|
|
5
|
-
import { InputSearch as
|
|
6
|
-
import { format2Digits as
|
|
2
|
+
import { Icon as T } from "../Icon/Icon2.js";
|
|
3
|
+
import { Button as B } from "../Button/Button2.js";
|
|
4
|
+
import { Tooltip as H } from "../Tooltip/Tooltip2.js";
|
|
5
|
+
import { InputSearch as q } from "../InputSearch/InputSearch2.js";
|
|
6
|
+
import { format2Digits as z } from "../../helpers/Numbers.js";
|
|
7
7
|
/* empty css */
|
|
8
|
-
import { useCallback as
|
|
8
|
+
import { useCallback as V, useMemo as h, useState as g } from "react";
|
|
9
9
|
import { jsx as e, jsxs as t } from "react/jsx-runtime";
|
|
10
|
-
function
|
|
10
|
+
function k({ state: n }) {
|
|
11
11
|
return /* @__PURE__ */ e("span", {
|
|
12
12
|
className: `suggestions-list__sort-icon suggestions-list__sort-icon--${n}`,
|
|
13
|
-
children: /* @__PURE__ */ e(
|
|
13
|
+
children: /* @__PURE__ */ e(T, { name: n === "asc" ? "arrow-up" : n === "desc" ? "arrow-down" : "arrow-bidirectional-vertical" })
|
|
14
14
|
});
|
|
15
15
|
}
|
|
16
|
-
var
|
|
17
|
-
const [d,
|
|
16
|
+
var I = 10, W = ({ data: n, label: x, title: N, tooltip: w, enableSearch: y = !1, onRowClick: o }) => {
|
|
17
|
+
const [d, M] = g(!1), [r, _] = g(!1), [c, E] = g(""), [i, K] = g(null), [u, D] = g("asc"), p = h(() => c.trim() ? n.filter((s) => s.name.toLowerCase().includes(c.toLowerCase())) : n, [n, c]), m = h(() => {
|
|
18
18
|
if (!i) return p;
|
|
19
19
|
const s = [...p].sort((l, a) => {
|
|
20
20
|
const S = i === "name" ? l.name : l.value, b = i === "name" ? a.name : a.value;
|
|
@@ -25,24 +25,24 @@ var k = 10, W = ({ data: n, label: I, title: N, tooltip: w, enableSearch: y = !1
|
|
|
25
25
|
p,
|
|
26
26
|
i,
|
|
27
27
|
u
|
|
28
|
-
]), v = h(() => r ? [...m] : m.slice(0,
|
|
29
|
-
|
|
30
|
-
}, L =
|
|
31
|
-
|
|
32
|
-
}, [r]), f = (s) => {
|
|
33
|
-
i === s ? D((l) => l === "asc" ? "desc" : "asc") : (
|
|
34
|
-
},
|
|
28
|
+
]), v = h(() => r ? [...m] : m.slice(0, I), [m, r]), C = m.length > I, $ = () => {
|
|
29
|
+
M(!d);
|
|
30
|
+
}, L = V(() => {
|
|
31
|
+
_(!r);
|
|
32
|
+
}, [r]), f = V((s) => {
|
|
33
|
+
i === s ? D((l) => l === "asc" ? "desc" : "asc") : (K(s), D("asc"));
|
|
34
|
+
}, [i]), j = h(() => /* @__PURE__ */ t("div", {
|
|
35
35
|
className: "list-suggestions-list",
|
|
36
36
|
children: [
|
|
37
|
-
/* @__PURE__ */ e(
|
|
37
|
+
/* @__PURE__ */ e(H, {
|
|
38
38
|
title: w,
|
|
39
39
|
children: /* @__PURE__ */ e("legend", { children: N || "Suggestions" })
|
|
40
40
|
}),
|
|
41
41
|
y && /* @__PURE__ */ e("div", {
|
|
42
42
|
className: "list-suggestions-list-search",
|
|
43
|
-
children: /* @__PURE__ */ e(
|
|
43
|
+
children: /* @__PURE__ */ e(q, {
|
|
44
44
|
value: c,
|
|
45
|
-
onChange:
|
|
45
|
+
onChange: E,
|
|
46
46
|
placeholder: "Search suggestions..."
|
|
47
47
|
})
|
|
48
48
|
}),
|
|
@@ -55,12 +55,12 @@ var k = 10, W = ({ data: n, label: I, title: N, tooltip: w, enableSearch: y = !1
|
|
|
55
55
|
type: "button",
|
|
56
56
|
className: "list-suggestions-list-header-cell list-suggestions-list-header-cell--name",
|
|
57
57
|
onClick: () => f("name"),
|
|
58
|
-
children: ["Name", /* @__PURE__ */ e(
|
|
58
|
+
children: ["Name", /* @__PURE__ */ e(k, { state: i === "name" ? u : "unsorted" })]
|
|
59
59
|
}), /* @__PURE__ */ t("button", {
|
|
60
60
|
type: "button",
|
|
61
61
|
className: "list-suggestions-list-header-cell list-suggestions-list-header-cell--value",
|
|
62
62
|
onClick: () => f("value"),
|
|
63
|
-
children: ["Value", /* @__PURE__ */ e(
|
|
63
|
+
children: ["Value", /* @__PURE__ */ e(k, { state: i === "value" ? u : "unsorted" })]
|
|
64
64
|
})]
|
|
65
65
|
}),
|
|
66
66
|
v.map((s, l) => /* @__PURE__ */ t("div", {
|
|
@@ -71,7 +71,7 @@ var k = 10, W = ({ data: n, label: I, title: N, tooltip: w, enableSearch: y = !1
|
|
|
71
71
|
o && (a.key === "Enter" || a.key === " ") && (a.preventDefault(), o(s));
|
|
72
72
|
},
|
|
73
73
|
children: [/* @__PURE__ */ e("div", { children: s.name }), /* @__PURE__ */ t("div", { children: [
|
|
74
|
-
typeof s.value == "number" &&
|
|
74
|
+
typeof s.value == "number" && z(s.value),
|
|
75
75
|
typeof s.value == "string" && s.value,
|
|
76
76
|
s.unit
|
|
77
77
|
] })]
|
|
@@ -104,16 +104,16 @@ var k = 10, W = ({ data: n, label: I, title: N, tooltip: w, enableSearch: y = !1
|
|
|
104
104
|
]);
|
|
105
105
|
return /* @__PURE__ */ t("div", {
|
|
106
106
|
className: "suggestions-list",
|
|
107
|
-
children: [/* @__PURE__ */ e("div", { children: /* @__PURE__ */ t(
|
|
107
|
+
children: [/* @__PURE__ */ e("div", { children: /* @__PURE__ */ t(B, {
|
|
108
108
|
icon: d ? "caret-up" : "caret-down",
|
|
109
|
-
onClick:
|
|
109
|
+
onClick: $,
|
|
110
110
|
children: [
|
|
111
111
|
d ? "Hide" : "Show",
|
|
112
112
|
" ",
|
|
113
|
-
|
|
113
|
+
x,
|
|
114
114
|
" suggestions"
|
|
115
115
|
]
|
|
116
|
-
}) }), d &&
|
|
116
|
+
}) }), d && j]
|
|
117
117
|
});
|
|
118
118
|
};
|
|
119
119
|
export {
|
|
@@ -1,73 +1,55 @@
|
|
|
1
1
|
import './TimelineMarkers.css';
|
|
2
2
|
/* empty css */
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
day: "2-digit",
|
|
10
|
-
month: "short"
|
|
11
|
-
}), v = (e, a) => a === "month" ? `${e.getFullYear()}-${e.getMonth()}` : `${e.getFullYear()}-${e.getMonth()}-${e.getDate()}`, b = (e) => e.getFullYear().toString(), g = (e, a = "day") => {
|
|
12
|
-
const r = /* @__PURE__ */ new Map();
|
|
13
|
-
let l = null, i = null;
|
|
14
|
-
return e.forEach((o, n) => {
|
|
15
|
-
const s = u(o.date), c = b(s), _ = v(s, a), d = c !== l, k = _ !== i;
|
|
16
|
-
r.set(n, {
|
|
17
|
-
showYear: d,
|
|
18
|
-
showDate: k,
|
|
19
|
-
yearLabel: d ? s.getFullYear().toString() : "",
|
|
20
|
-
dateLabel: k ? p(s, a) : ""
|
|
21
|
-
}), l = c, i = _;
|
|
22
|
-
}), r;
|
|
23
|
-
}, f = ({ marker: e, onClick: a }) => {
|
|
24
|
-
const r = (l) => {
|
|
25
|
-
l.stopPropagation(), a?.(l);
|
|
3
|
+
import { calculateTimelineMarkers as _ } from "./calculateTimelineMarkers.js";
|
|
4
|
+
import { useMemo as d } from "react";
|
|
5
|
+
import { jsx as r, jsxs as l } from "react/jsx-runtime";
|
|
6
|
+
var p = ({ marker: e, onClick: m }) => {
|
|
7
|
+
const a = (i) => {
|
|
8
|
+
i.stopPropagation(), m?.(i);
|
|
26
9
|
};
|
|
27
|
-
return e.showYear ? /* @__PURE__ */
|
|
10
|
+
return e.showYear ? /* @__PURE__ */ l("div", {
|
|
28
11
|
className: "timeline-markers__marker timeline-markers__marker--year",
|
|
29
|
-
onClick:
|
|
30
|
-
children: [/* @__PURE__ */
|
|
12
|
+
onClick: a,
|
|
13
|
+
children: [/* @__PURE__ */ l("div", {
|
|
31
14
|
className: "timeline-markers__labels",
|
|
32
|
-
children: [/* @__PURE__ */
|
|
15
|
+
children: [/* @__PURE__ */ r("span", {
|
|
33
16
|
className: "timeline-markers__label timeline-markers__label--year",
|
|
34
17
|
children: e.yearLabel
|
|
35
|
-
}), /* @__PURE__ */
|
|
18
|
+
}), /* @__PURE__ */ r("span", {
|
|
36
19
|
className: "timeline-markers__label timeline-markers__label--date",
|
|
37
20
|
children: e.dateLabel
|
|
38
21
|
})]
|
|
39
|
-
}), /* @__PURE__ */
|
|
40
|
-
}) : e.showDate ? /* @__PURE__ */
|
|
22
|
+
}), /* @__PURE__ */ r("div", { className: "timeline-markers__dot timeline-markers__dot--year" })]
|
|
23
|
+
}) : e.showDate ? /* @__PURE__ */ l("div", {
|
|
41
24
|
className: "timeline-markers__marker timeline-markers__marker--date",
|
|
42
|
-
onClick:
|
|
43
|
-
children: [/* @__PURE__ */
|
|
25
|
+
onClick: a,
|
|
26
|
+
children: [/* @__PURE__ */ r("span", {
|
|
44
27
|
className: "timeline-markers__label timeline-markers__label--date",
|
|
45
28
|
children: e.dateLabel
|
|
46
|
-
}), /* @__PURE__ */
|
|
47
|
-
}) : /* @__PURE__ */
|
|
29
|
+
}), /* @__PURE__ */ r("div", { className: "timeline-markers__dot timeline-markers__dot--date" })]
|
|
30
|
+
}) : /* @__PURE__ */ r("div", {
|
|
48
31
|
className: "timeline-markers__marker timeline-markers__marker--empty",
|
|
49
|
-
onClick:
|
|
50
|
-
children: /* @__PURE__ */
|
|
32
|
+
onClick: a,
|
|
33
|
+
children: /* @__PURE__ */ r("div", { className: "timeline-markers__dot timeline-markers__dot--small" })
|
|
51
34
|
});
|
|
52
|
-
},
|
|
35
|
+
}, b = ({ marker: e }) => !e.showYear && !e.showDate ? null : /* @__PURE__ */ r("div", {
|
|
53
36
|
className: "timeline-markers__separator",
|
|
54
|
-
children: /* @__PURE__ */
|
|
37
|
+
children: /* @__PURE__ */ r("span", {
|
|
55
38
|
className: "timeline-markers__separator-label",
|
|
56
39
|
children: e.showYear ? e.yearLabel : e.dateLabel
|
|
57
40
|
})
|
|
58
|
-
}),
|
|
59
|
-
const
|
|
60
|
-
return /* @__PURE__ */
|
|
61
|
-
className: `timeline-markers${
|
|
62
|
-
children: [/* @__PURE__ */
|
|
63
|
-
const
|
|
64
|
-
return
|
|
41
|
+
}), v = ({ items: e, renderItem: m, className: a }) => {
|
|
42
|
+
const i = d(() => _(e), [e]);
|
|
43
|
+
return /* @__PURE__ */ l("div", {
|
|
44
|
+
className: `timeline-markers${a ? ` ${a}` : ""}`,
|
|
45
|
+
children: [/* @__PURE__ */ r("div", { className: "timeline-markers__track" }), e.map((t, n) => {
|
|
46
|
+
const s = i.get(n);
|
|
47
|
+
return s ? m(t, s) : null;
|
|
65
48
|
})]
|
|
66
49
|
});
|
|
67
50
|
};
|
|
68
51
|
export {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
g as calculateTimelineMarkers
|
|
52
|
+
p as TimelineMarkerDot,
|
|
53
|
+
v as TimelineMarkers,
|
|
54
|
+
b as TimelineMobileSeparator
|
|
73
55
|
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import './TimelineMarkers.css';
|
|
2
|
+
/* empty css */
|
|
3
|
+
var m = (e) => {
|
|
4
|
+
const [t, a, r] = e.split("-").map(Number);
|
|
5
|
+
return new Date(t, a - 1, r);
|
|
6
|
+
}, h = (e, t) => t === "month" ? e.toLocaleDateString("en-US", { month: "long" }) : e.toLocaleDateString("en-US", {
|
|
7
|
+
day: "2-digit",
|
|
8
|
+
month: "short"
|
|
9
|
+
}), y = (e, t) => t === "month" ? `${e.getFullYear()}-${e.getMonth()}` : `${e.getFullYear()}-${e.getMonth()}-${e.getDate()}`, D = (e) => e.getFullYear().toString(), p = (e, t = "day") => {
|
|
10
|
+
const a = /* @__PURE__ */ new Map();
|
|
11
|
+
let r = null, o = null;
|
|
12
|
+
return e.forEach((i, u) => {
|
|
13
|
+
const n = m(i.date), l = D(n), s = y(n, t), g = l !== r, c = s !== o;
|
|
14
|
+
a.set(u, {
|
|
15
|
+
showYear: g,
|
|
16
|
+
showDate: c,
|
|
17
|
+
yearLabel: g ? n.getFullYear().toString() : "",
|
|
18
|
+
dateLabel: c ? h(n, t) : ""
|
|
19
|
+
}), r = l, o = s;
|
|
20
|
+
}), a;
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
p as calculateTimelineMarkers,
|
|
24
|
+
h as formatTimelineDate,
|
|
25
|
+
y as getDateKey,
|
|
26
|
+
D as getYearKey,
|
|
27
|
+
m as parseLocalDate
|
|
28
|
+
};
|
|
@@ -2,9 +2,9 @@ import './Toolbar.css';
|
|
|
2
2
|
import { Icon as S } from "../Icon/Icon2.js";
|
|
3
3
|
import { Button as w } from "../Button/Button2.js";
|
|
4
4
|
import { Tooltip as x } from "../Tooltip/Tooltip2.js";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
5
|
+
import { Dropdown as I } from "../Dropdown/Dropdown2.js";
|
|
6
|
+
import { InputSearch as y } from "../InputSearch/InputSearch2.js";
|
|
7
|
+
import { useControlPanelContext as B } from "../ControlPanel/useControlPanel.js";
|
|
8
8
|
import { MenuHamburger as $ } from "../MenuHamburger/MenuHamburger2.js";
|
|
9
9
|
import { NotificationPanel as R } from "../NotificationPanel/NotificationPanel2.js";
|
|
10
10
|
/* empty css */
|
|
@@ -19,7 +19,7 @@ var c = "::", k = (e) => typeof e == "object" ? e.label : void 0, M = (e) => "fi
|
|
|
19
19
|
label: i.label,
|
|
20
20
|
suffixIcon: "arrow-down"
|
|
21
21
|
}]) : e.options, O = (e) => "fields" in e ? e.value ? `${e.value.field}${c}${e.value.direction}` : null : e.value, J = ({ children: e, className: i = "", controlPanelToggle: n, heading: l, noCard: f = !1, menuItems: _, notifications: r, search: s, sort: o }) => {
|
|
22
|
-
const u =
|
|
22
|
+
const u = B(), v = !!(n && u?.isMobile), d = typeof n == "object" ? n.count ?? 0 : 0, h = [
|
|
23
23
|
"memobit-toolbar",
|
|
24
24
|
f ? "memobit-toolbar--no-card" : "",
|
|
25
25
|
i
|
|
@@ -83,7 +83,7 @@ var c = "::", k = (e) => typeof e == "object" ? e.label : void 0, M = (e) => "fi
|
|
|
83
83
|
children: [
|
|
84
84
|
s && /* @__PURE__ */ a("div", {
|
|
85
85
|
className: "memobit-toolbar__search",
|
|
86
|
-
children: /* @__PURE__ */ a(
|
|
86
|
+
children: /* @__PURE__ */ a(y, {
|
|
87
87
|
...s,
|
|
88
88
|
className: ["memobit-toolbar__search-input", s.className].filter(Boolean).join(" ")
|
|
89
89
|
})
|
|
@@ -94,7 +94,7 @@ var c = "::", k = (e) => typeof e == "object" ? e.label : void 0, M = (e) => "fi
|
|
|
94
94
|
}),
|
|
95
95
|
o && /* @__PURE__ */ a("div", {
|
|
96
96
|
className: ["memobit-toolbar__sort", o.className].filter(Boolean).join(" "),
|
|
97
|
-
children: /* @__PURE__ */ a(
|
|
97
|
+
children: /* @__PURE__ */ a(I, {
|
|
98
98
|
highlighted: o.highlighted,
|
|
99
99
|
label: o.label,
|
|
100
100
|
name: o.name ?? "toolbar-sort",
|