@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,8 +1,8 @@
|
|
|
1
1
|
import './Confetti.css';
|
|
2
2
|
/* empty css */
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { jsx as
|
|
5
|
-
var
|
|
3
|
+
import { forwardRef as L, useCallback as E, useEffect as N, useImperativeHandle as O, useRef as v } from "react";
|
|
4
|
+
import { jsx as U } from "react/jsx-runtime";
|
|
5
|
+
var _ = [
|
|
6
6
|
"#0891b2",
|
|
7
7
|
"#06b6d4",
|
|
8
8
|
"#16a34a",
|
|
@@ -11,7 +11,7 @@ var O = [
|
|
|
11
11
|
"#8b5cf6",
|
|
12
12
|
"#ec4899",
|
|
13
13
|
"#f97316"
|
|
14
|
-
],
|
|
14
|
+
], q = (t) => {
|
|
15
15
|
if (t && t.length > 0) return t;
|
|
16
16
|
const a = getComputedStyle(document.documentElement), s = [
|
|
17
17
|
a.getPropertyValue("--body-accent-color").trim(),
|
|
@@ -25,7 +25,7 @@ var O = [
|
|
|
25
25
|
"#ec4899",
|
|
26
26
|
"#f97316",
|
|
27
27
|
"#06b6d4"
|
|
28
|
-
] :
|
|
28
|
+
] : _;
|
|
29
29
|
}, I = () => {
|
|
30
30
|
const t = Math.random();
|
|
31
31
|
return t < 0.5 ? "rect" : t < 0.8 ? "circle" : "star";
|
|
@@ -40,7 +40,7 @@ var O = [
|
|
|
40
40
|
color: b(s),
|
|
41
41
|
opacity: 1,
|
|
42
42
|
shape: I()
|
|
43
|
-
}),
|
|
43
|
+
}), B = (t, a, s) => {
|
|
44
44
|
const o = Math.random() * Math.PI * 2, c = 3 + Math.random() * 10;
|
|
45
45
|
return {
|
|
46
46
|
x: t,
|
|
@@ -82,7 +82,7 @@ var O = [
|
|
|
82
82
|
opacity: 1,
|
|
83
83
|
shape: I()
|
|
84
84
|
};
|
|
85
|
-
},
|
|
85
|
+
}, H = (t, a, s, o) => {
|
|
86
86
|
const P = o * 0.4;
|
|
87
87
|
t.beginPath();
|
|
88
88
|
for (let h = 0; h < 10; h++) {
|
|
@@ -99,40 +99,40 @@ var O = [
|
|
|
99
99
|
t.beginPath(), t.arc(0, 0, a.size / 2, 0, Math.PI * 2), t.fill();
|
|
100
100
|
break;
|
|
101
101
|
case "star":
|
|
102
|
-
|
|
102
|
+
H(t, 0, 0, a.size / 2);
|
|
103
103
|
}
|
|
104
104
|
t.restore();
|
|
105
|
-
},
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
105
|
+
}, j = {
|
|
106
|
+
confetti: 150,
|
|
107
|
+
burst: 200,
|
|
108
|
+
fireworks: 8
|
|
109
|
+
}, W = L(({ colors: t, duration: a = 3e3, scope: s = "fullscreen", variant: o = "confetti", particleCount: c }, P) => {
|
|
110
|
+
const h = v(null), f = v(0), d = v(0), M = v(!1), C = E(() => {
|
|
111
111
|
M.current = !1, cancelAnimationFrame(f.current);
|
|
112
|
-
const
|
|
113
|
-
|
|
112
|
+
const l = h.current;
|
|
113
|
+
l && l.getContext("2d")?.clearRect(0, 0, l.width, l.height);
|
|
114
114
|
}, []), R = E(() => {
|
|
115
|
-
const
|
|
116
|
-
if (!
|
|
117
|
-
const r =
|
|
115
|
+
const l = h.current;
|
|
116
|
+
if (!l || M.current) return;
|
|
117
|
+
const r = l.getContext("2d");
|
|
118
118
|
if (!r) return;
|
|
119
|
-
|
|
120
|
-
const y =
|
|
119
|
+
l.width = l.offsetWidth, l.height = l.offsetHeight;
|
|
120
|
+
const y = l.width, m = l.height, u = q(t), x = c ?? j[o];
|
|
121
121
|
M.current = !0, d.current = performance.now();
|
|
122
|
-
let
|
|
123
|
-
if (o === "confetti")
|
|
122
|
+
let i = [];
|
|
123
|
+
if (o === "confetti") i = Array.from({ length: x }, () => S(y, m, u));
|
|
124
124
|
else if (o === "burst") {
|
|
125
125
|
const k = y / 2, A = m / 2;
|
|
126
|
-
|
|
127
|
-
} else o === "fireworks" && (
|
|
126
|
+
i = Array.from({ length: x }, () => B(k, A, u));
|
|
127
|
+
} else o === "fireworks" && (i = Array.from({ length: x }, () => F(y, m, u)));
|
|
128
128
|
const z = (k) => {
|
|
129
129
|
if (!M.current) return;
|
|
130
130
|
const A = k - d.current, g = Math.min(A / a, 1);
|
|
131
|
-
if (r.clearRect(0, 0, y, m), o === "confetti" ? (g < 0.6 && Math.random() < 0.3 &&
|
|
131
|
+
if (r.clearRect(0, 0, y, m), o === "confetti" ? (g < 0.6 && Math.random() < 0.3 && i.push(S(y, m, u)), i = i.filter((e) => e.opacity > 0 && e.y < m + 20), i.forEach((e) => {
|
|
132
132
|
e.x += e.vx, e.y += e.vy, e.vy += 0.08, e.vx += (Math.random() - 0.5) * 0.1, e.angle += e.spin, g > 0.6 && (e.opacity -= 0.015), w(r, e);
|
|
133
|
-
})) : o === "burst" ? (
|
|
133
|
+
})) : o === "burst" ? (i = i.filter((e) => e.opacity > 0), i.forEach((e) => {
|
|
134
134
|
e.x += e.vx, e.y += e.vy, e.vy += 0.15, e.vx *= 0.98, e.angle += e.spin, e.opacity -= 0.012, w(r, e);
|
|
135
|
-
})) : o === "fireworks" && (g < 0.85 && Math.random() < 0.04 &&
|
|
135
|
+
})) : o === "fireworks" && (g < 0.85 && Math.random() < 0.04 && i.push(F(y, m, u)), i = i.filter((e) => e.exploded ? e.children?.some((n) => n.opacity > 0) ?? !1 : e.y > -m * 0.1), i.forEach((e) => {
|
|
136
136
|
if (e.exploded)
|
|
137
137
|
e.children?.forEach((n) => {
|
|
138
138
|
n.x += n.vx, n.y += n.vy, n.vy += 0.06, n.vx *= 0.97, n.angle += n.spin, n.opacity -= 0.014, w(r, n);
|
|
@@ -141,14 +141,14 @@ var O = [
|
|
|
141
141
|
x: e.x,
|
|
142
142
|
y: e.y
|
|
143
143
|
}), (e.trail?.length ?? 0) > 12 && e.trail?.shift(), e.trail?.forEach((n, T) => {
|
|
144
|
-
const
|
|
145
|
-
r.save(), r.globalAlpha =
|
|
144
|
+
const V = (T + 1) / (e.trail?.length ?? 1) * 0.6;
|
|
145
|
+
r.save(), r.globalAlpha = V, r.fillStyle = e.color, r.beginPath(), r.arc(n.x, n.y, 2, 0, Math.PI * 2), r.fill(), r.restore();
|
|
146
146
|
}), r.save(), r.globalAlpha = 1, r.fillStyle = e.color, r.beginPath(), r.arc(e.x, e.y, 3, 0, Math.PI * 2), r.fill(), r.restore(), e.x += e.vx, e.y += e.vy, e.vy += 0.18, e.vy >= 0) {
|
|
147
147
|
e.exploded = !0;
|
|
148
148
|
const n = 60 + Math.floor(Math.random() * 40);
|
|
149
149
|
e.children = Array.from({ length: n }, () => D(e.x, e.y, u)), r.save(), r.globalAlpha = 0.8, r.fillStyle = "#ffffff", r.beginPath(), r.arc(e.x, e.y, 12, 0, Math.PI * 2), r.fill(), r.restore();
|
|
150
150
|
}
|
|
151
|
-
})), g >= 1 ||
|
|
151
|
+
})), g >= 1 || i.length === 0) {
|
|
152
152
|
C();
|
|
153
153
|
return;
|
|
154
154
|
}
|
|
@@ -162,9 +162,9 @@ var O = [
|
|
|
162
162
|
c,
|
|
163
163
|
C
|
|
164
164
|
]);
|
|
165
|
-
return
|
|
165
|
+
return O(P, () => ({ trigger: R }), [R]), N(() => () => {
|
|
166
166
|
cancelAnimationFrame(f.current);
|
|
167
|
-
}, []), /* @__PURE__ */
|
|
167
|
+
}, []), /* @__PURE__ */ U("canvas", {
|
|
168
168
|
ref: h,
|
|
169
169
|
className: `confetti-canvas confetti-canvas--${s}`
|
|
170
170
|
});
|
|
@@ -1,47 +1,44 @@
|
|
|
1
1
|
import './ContextToast.css';
|
|
2
|
-
import { Icon as
|
|
3
|
-
import { Tooltip as
|
|
2
|
+
import { Icon as p } from "../Icon/Icon2.js";
|
|
3
|
+
import { Tooltip as v } from "../Tooltip/Tooltip2.js";
|
|
4
4
|
/* empty css */
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
return e;
|
|
11
|
-
}, $ = ({ id: e, message: r, type: n = "info", action: o, onClose: t, showDismissButton: u = !0, timeout: a = 2e3 }) => {
|
|
12
|
-
g(() => {
|
|
5
|
+
import { ToastContext as h, useToast as g } from "./useToast.js";
|
|
6
|
+
import { useCallback as T, useEffect as x, useMemo as C, useState as f } from "react";
|
|
7
|
+
import { jsx as o, jsxs as b } from "react/jsx-runtime";
|
|
8
|
+
var _ = ({ id: s, message: a, type: r = "info", action: e, onClose: t, showDismissButton: u = !0, timeout: i = 2e3 }) => {
|
|
9
|
+
x(() => {
|
|
13
10
|
const d = setTimeout(() => {
|
|
14
|
-
t(
|
|
15
|
-
},
|
|
11
|
+
t(s);
|
|
12
|
+
}, i);
|
|
16
13
|
return () => clearTimeout(d);
|
|
17
14
|
}, [
|
|
18
|
-
|
|
15
|
+
s,
|
|
19
16
|
t,
|
|
20
|
-
|
|
17
|
+
i
|
|
21
18
|
]);
|
|
22
|
-
const [
|
|
23
|
-
c(!0), setTimeout(() => t(
|
|
24
|
-
},
|
|
25
|
-
|
|
19
|
+
const [n, c] = f(!1), m = () => {
|
|
20
|
+
c(!0), setTimeout(() => t(s), 300);
|
|
21
|
+
}, l = () => {
|
|
22
|
+
e?.onClick(), m();
|
|
26
23
|
};
|
|
27
|
-
return /* @__PURE__ */
|
|
28
|
-
className: `toast toast--${
|
|
24
|
+
return /* @__PURE__ */ b("div", {
|
|
25
|
+
className: `toast toast--${r} ${n ? "toast--exiting" : ""}`,
|
|
29
26
|
children: [
|
|
30
|
-
/* @__PURE__ */
|
|
27
|
+
/* @__PURE__ */ o("div", {
|
|
31
28
|
className: "toast__message",
|
|
32
|
-
children:
|
|
29
|
+
children: a
|
|
33
30
|
}),
|
|
34
|
-
|
|
35
|
-
onClick:
|
|
31
|
+
e && /* @__PURE__ */ o("button", {
|
|
32
|
+
onClick: l,
|
|
36
33
|
className: "toast__action-button",
|
|
37
|
-
children:
|
|
34
|
+
children: e.label
|
|
38
35
|
}),
|
|
39
|
-
u && /* @__PURE__ */
|
|
36
|
+
u && /* @__PURE__ */ o(v, {
|
|
40
37
|
title: "Close",
|
|
41
|
-
children: /* @__PURE__ */
|
|
42
|
-
onClick:
|
|
38
|
+
children: /* @__PURE__ */ o("button", {
|
|
39
|
+
onClick: m,
|
|
43
40
|
className: "toast__close-button",
|
|
44
|
-
children: /* @__PURE__ */
|
|
41
|
+
children: /* @__PURE__ */ o(p, {
|
|
45
42
|
name: "clear",
|
|
46
43
|
size: "sm"
|
|
47
44
|
})
|
|
@@ -49,48 +46,47 @@ var h = p(null), N = () => {
|
|
|
49
46
|
})
|
|
50
47
|
]
|
|
51
48
|
});
|
|
52
|
-
},
|
|
53
|
-
const { toasts:
|
|
54
|
-
return /* @__PURE__ */
|
|
55
|
-
className: `toast-container toast-container--${
|
|
56
|
-
children:
|
|
49
|
+
}, I = ({ position: s = "bottom-right", showDismissButton: a = !0 }) => {
|
|
50
|
+
const { toasts: r, removeToast: e } = g();
|
|
51
|
+
return /* @__PURE__ */ o("div", {
|
|
52
|
+
className: `toast-container toast-container--${s}`,
|
|
53
|
+
children: r.map((t) => /* @__PURE__ */ o(_, {
|
|
57
54
|
id: t.id,
|
|
58
55
|
message: t.message,
|
|
59
56
|
type: t.type,
|
|
60
57
|
action: t.action,
|
|
61
|
-
showDismissButton:
|
|
58
|
+
showDismissButton: a,
|
|
62
59
|
timeout: t.timeout,
|
|
63
|
-
onClose:
|
|
60
|
+
onClose: e
|
|
64
61
|
}, t.id))
|
|
65
62
|
});
|
|
66
|
-
},
|
|
67
|
-
const [
|
|
68
|
-
|
|
69
|
-
}, []), t = T((
|
|
70
|
-
const
|
|
71
|
-
return
|
|
72
|
-
id:
|
|
73
|
-
message:
|
|
74
|
-
type:
|
|
63
|
+
}, M = ({ children: s }) => {
|
|
64
|
+
const [a, r] = f([]), e = T((i) => {
|
|
65
|
+
r((n) => n.filter((c) => c.id !== i));
|
|
66
|
+
}, []), t = T((i, n = "info", c = 1500, m) => {
|
|
67
|
+
const l = `${Date.now().toString()}-${Math.random().toString(36).slice(2, 8)}`;
|
|
68
|
+
return r((d) => [...d, {
|
|
69
|
+
id: l,
|
|
70
|
+
message: i,
|
|
71
|
+
type: n,
|
|
75
72
|
timeout: c,
|
|
76
|
-
action:
|
|
77
|
-
}]),
|
|
78
|
-
}, []), u =
|
|
79
|
-
toasts:
|
|
73
|
+
action: m
|
|
74
|
+
}]), l;
|
|
75
|
+
}, []), u = C(() => ({
|
|
76
|
+
toasts: a,
|
|
80
77
|
addToast: t,
|
|
81
|
-
removeToast:
|
|
78
|
+
removeToast: e
|
|
82
79
|
}), [
|
|
83
|
-
|
|
80
|
+
a,
|
|
84
81
|
t,
|
|
85
|
-
|
|
82
|
+
e
|
|
86
83
|
]);
|
|
87
|
-
return /* @__PURE__ */
|
|
84
|
+
return /* @__PURE__ */ o(h.Provider, {
|
|
88
85
|
value: u,
|
|
89
|
-
children:
|
|
86
|
+
children: s
|
|
90
87
|
});
|
|
91
88
|
};
|
|
92
89
|
export {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
N as useToast
|
|
90
|
+
I as ToastContainer,
|
|
91
|
+
M as ToastProvider
|
|
96
92
|
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import './ContextToast.css';
|
|
2
|
+
/* empty css */
|
|
3
|
+
import { createContext as o, useContext as e } from "react";
|
|
4
|
+
var r = o(null), a = () => {
|
|
5
|
+
const t = e(r);
|
|
6
|
+
if (!t) throw new Error("useToast must be used within a ToastProvider");
|
|
7
|
+
return t;
|
|
8
|
+
};
|
|
9
|
+
export {
|
|
10
|
+
r as ToastContext,
|
|
11
|
+
a as useToast
|
|
12
|
+
};
|
|
@@ -1,38 +1,37 @@
|
|
|
1
1
|
import './ControlPanel.css';
|
|
2
|
-
import { Button as
|
|
3
|
-
import { Tooltip as
|
|
4
|
-
import { Separator as
|
|
5
|
-
import { AppHeader as
|
|
6
|
-
import { ConfirmPopover as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { ControlPanelOptions as K } from "./ControlPanelOptions.js";
|
|
2
|
+
import { Button as H } from "../Button/Button2.js";
|
|
3
|
+
import { Tooltip as R } from "../Tooltip/Tooltip2.js";
|
|
4
|
+
import { Separator as $ } from "../Separator/Separator2.js";
|
|
5
|
+
import { AppHeader as q } from "../AppHeader/AppHeader2.js";
|
|
6
|
+
import { ConfirmPopover as D } from "../ConfirmPopover/ConfirmPopover2.js";
|
|
7
|
+
import { ControlPanelFilterItem as J } from "./ControlPanelFilter.js";
|
|
8
|
+
import { ControlPanelNav as K } from "./ControlPanelNav.js";
|
|
9
|
+
import { ControlPanelOptions as L } from "./ControlPanelOptions.js";
|
|
10
|
+
import { useControlPanelContext as Q } from "./useControlPanel.js";
|
|
12
11
|
/* empty css */
|
|
13
|
-
import { useState as
|
|
14
|
-
import { Fragment as
|
|
15
|
-
var
|
|
16
|
-
const g =
|
|
17
|
-
}),
|
|
12
|
+
import { useState as z } from "react";
|
|
13
|
+
import { Fragment as A, jsx as l, jsxs as r } from "react/jsx-runtime";
|
|
14
|
+
var mo = ({ width: o = "280px", className: a = "", isOpen: d, onClose: h, isMobile: C, showOverlay: c = !0, contained: s = !1, flush: v = !1, shadow: m = "none", header: n, navigation: b = [], actions: N = [], filters: u = [], filtersCount: p, collapsibleFilters: _ = !1, onFilterChange: F, onClearFilters: x, options: f = [], onOptionChange: M, viewToggle: k, groupBy: y, visibleColumns: P }) => {
|
|
15
|
+
const g = Q(), e = C ?? g?.isMobile ?? !1, j = d ?? (e ? g?.isOpen ?? !1 : !0), t = h ?? g?.close ?? (() => {
|
|
16
|
+
}), T = [
|
|
18
17
|
"control-panel",
|
|
19
18
|
j ? "control-panel--open" : "control-panel--closed",
|
|
20
19
|
e ? "control-panel--mobile" : "",
|
|
21
20
|
s ? "control-panel--contained" : "",
|
|
22
21
|
v ? "control-panel--flush" : "",
|
|
23
22
|
a
|
|
24
|
-
].filter(Boolean).join(" "),
|
|
23
|
+
].filter(Boolean).join(" "), V = ["control-panel__overlay", s ? "control-panel__overlay--contained" : ""].filter(Boolean).join(" "), w = {
|
|
25
24
|
"--control-panel-width": o,
|
|
26
25
|
"--control-panel-shadow": m
|
|
27
|
-
},
|
|
28
|
-
return /* @__PURE__ */ r(
|
|
29
|
-
className:
|
|
26
|
+
}, O = f.length === 0 ? [] : "type" in f[0] ? [{ options: f }] : f, B = !!(k || y || P || O.length > 0), I = u.length > 0 || p !== void 0 && p > 0, E = typeof _ == "number" ? _ : _ ? 1 : 1 / 0, S = u.length >= E, W = ["control-panel__filters", S ? "control-panel__filters--collapsible" : ""].filter(Boolean).join(" ");
|
|
27
|
+
return /* @__PURE__ */ r(A, { children: [c && e && j && /* @__PURE__ */ l("div", {
|
|
28
|
+
className: V,
|
|
30
29
|
onClick: t
|
|
31
30
|
}), /* @__PURE__ */ r("aside", {
|
|
32
|
-
className:
|
|
33
|
-
style:
|
|
31
|
+
className: T,
|
|
32
|
+
style: w,
|
|
34
33
|
children: [
|
|
35
|
-
n && /* @__PURE__ */ l(
|
|
34
|
+
n && /* @__PURE__ */ l(q, {
|
|
36
35
|
icon: n.icon,
|
|
37
36
|
emoji: n.emoji,
|
|
38
37
|
svg: n.svg,
|
|
@@ -42,19 +41,19 @@ var fo = ({ width: o = "280px", className: a = "", isOpen: d, onClose: h, isMobi
|
|
|
42
41
|
n.onClick?.(), e && t();
|
|
43
42
|
} : void 0
|
|
44
43
|
}),
|
|
45
|
-
|
|
44
|
+
N.length > 0 && /* @__PURE__ */ l("div", {
|
|
46
45
|
className: "control-panel__actions",
|
|
47
|
-
children:
|
|
46
|
+
children: N.map((i) => /* @__PURE__ */ l(U, {
|
|
48
47
|
action: i,
|
|
49
48
|
onActionComplete: e ? t : void 0
|
|
50
49
|
}, i.id))
|
|
51
50
|
}),
|
|
52
|
-
|
|
53
|
-
navigation:
|
|
51
|
+
b.length > 0 && /* @__PURE__ */ l(K, {
|
|
52
|
+
navigation: b,
|
|
54
53
|
onNavigate: e ? t : void 0
|
|
55
54
|
}),
|
|
56
|
-
|
|
57
|
-
className:
|
|
55
|
+
I && /* @__PURE__ */ r("div", {
|
|
56
|
+
className: W,
|
|
58
57
|
children: [/* @__PURE__ */ r("div", {
|
|
59
58
|
className: "control-panel__filters-header",
|
|
60
59
|
children: [/* @__PURE__ */ r("span", {
|
|
@@ -69,25 +68,25 @@ var fo = ({ width: o = "280px", className: a = "", isOpen: d, onClose: h, isMobi
|
|
|
69
68
|
onClick: () => x({ source: "control-panel" }),
|
|
70
69
|
children: "Clear filters"
|
|
71
70
|
})]
|
|
72
|
-
}), u.map((i) => /* @__PURE__ */ l(
|
|
71
|
+
}), u.map((i) => /* @__PURE__ */ l(J, {
|
|
73
72
|
filter: i,
|
|
74
73
|
collapsible: i.collapsible ?? S,
|
|
75
|
-
onChange: (
|
|
74
|
+
onChange: (G) => F?.(G)
|
|
76
75
|
}, i.id))]
|
|
77
76
|
}),
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
normalizedOptionGroups:
|
|
81
|
-
onOptionChange:
|
|
77
|
+
I && B && /* @__PURE__ */ l($, { spacing: 0 }),
|
|
78
|
+
B && /* @__PURE__ */ l(L, {
|
|
79
|
+
normalizedOptionGroups: O,
|
|
80
|
+
onOptionChange: M,
|
|
82
81
|
viewToggle: k,
|
|
83
82
|
onViewToggleComplete: e ? t : void 0,
|
|
84
|
-
groupBy:
|
|
85
|
-
visibleColumns:
|
|
83
|
+
groupBy: y,
|
|
84
|
+
visibleColumns: P
|
|
86
85
|
})
|
|
87
86
|
]
|
|
88
87
|
})] });
|
|
89
|
-
},
|
|
90
|
-
const [d, h] =
|
|
88
|
+
}, U = ({ action: o, onActionComplete: a }) => {
|
|
89
|
+
const [d, h] = z(null), [C, c] = z(!1), s = (n) => {
|
|
91
90
|
if (o.confirm) {
|
|
92
91
|
h(n.currentTarget), c(!0);
|
|
93
92
|
return;
|
|
@@ -95,7 +94,7 @@ var fo = ({ width: o = "280px", className: a = "", isOpen: d, onClose: h, isMobi
|
|
|
95
94
|
o.onClick?.(n), a?.();
|
|
96
95
|
}, v = () => {
|
|
97
96
|
o.onClick?.({}), a?.();
|
|
98
|
-
}, m = /* @__PURE__ */ l(
|
|
97
|
+
}, m = /* @__PURE__ */ l(H, {
|
|
99
98
|
className: "control-panel__action",
|
|
100
99
|
disabled: o.disabled,
|
|
101
100
|
fullWidth: o.fullWidth ?? !0,
|
|
@@ -106,11 +105,11 @@ var fo = ({ width: o = "280px", className: a = "", isOpen: d, onClose: h, isMobi
|
|
|
106
105
|
variant: o.variant ?? "default",
|
|
107
106
|
children: o.label
|
|
108
107
|
});
|
|
109
|
-
return /* @__PURE__ */ r(
|
|
108
|
+
return /* @__PURE__ */ r(A, { children: [o.tooltip ? /* @__PURE__ */ l(R, {
|
|
110
109
|
title: o.tooltip,
|
|
111
110
|
position: "right",
|
|
112
111
|
children: m
|
|
113
|
-
}) : m, o.confirm && /* @__PURE__ */ l(
|
|
112
|
+
}) : m, o.confirm && /* @__PURE__ */ l(D, {
|
|
114
113
|
visible: C,
|
|
115
114
|
onClose: () => c(!1),
|
|
116
115
|
anchorEl: d,
|
|
@@ -132,6 +131,5 @@ var fo = ({ width: o = "280px", className: a = "", isOpen: d, onClose: h, isMobi
|
|
|
132
131
|
})] });
|
|
133
132
|
};
|
|
134
133
|
export {
|
|
135
|
-
|
|
136
|
-
io as DEFAULT_DATE_RANGE_PRESETS
|
|
134
|
+
mo as ControlPanel
|
|
137
135
|
};
|
|
@@ -1,31 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const { isMobile: r } = C(), [n, o] = v(!1), s = t(() => o((c) => !c), []), l = t(() => o(!0), []), a = t(() => o(!1), []), i = p(() => ({
|
|
10
|
-
isMobile: r,
|
|
11
|
-
isOpen: n,
|
|
1
|
+
import { ControlPanelContext as m } from "./useControlPanel.js";
|
|
2
|
+
import { useBreakpoint as p } from "../../hooks/useBreakpoint.js";
|
|
3
|
+
import { useCallback as e, useMemo as u, useState as f } from "react";
|
|
4
|
+
import { jsx as v } from "react/jsx-runtime";
|
|
5
|
+
var g = ({ children: a }) => {
|
|
6
|
+
const { isMobile: t } = p(), [r, o] = f(!1), s = e(() => o((c) => !c), []), n = e(() => o(!0), []), l = e(() => o(!1), []), i = u(() => ({
|
|
7
|
+
isMobile: t,
|
|
8
|
+
isOpen: r,
|
|
12
9
|
toggle: s,
|
|
13
|
-
open:
|
|
14
|
-
close:
|
|
10
|
+
open: n,
|
|
11
|
+
close: l
|
|
15
12
|
}), [
|
|
13
|
+
t,
|
|
16
14
|
r,
|
|
17
|
-
n,
|
|
18
15
|
s,
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
n,
|
|
17
|
+
l
|
|
21
18
|
]);
|
|
22
|
-
return /* @__PURE__ */
|
|
19
|
+
return /* @__PURE__ */ v(m.Provider, {
|
|
23
20
|
value: i,
|
|
24
|
-
children:
|
|
21
|
+
children: a
|
|
25
22
|
});
|
|
26
23
|
};
|
|
27
24
|
export {
|
|
28
|
-
|
|
29
|
-
h as useControlPanel,
|
|
30
|
-
f as useControlPanelContext
|
|
25
|
+
g as ControlPanelProvider
|
|
31
26
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createContext as e, useContext as o } from "react";
|
|
2
|
+
var n = e(null), r = () => o(n), a = () => {
|
|
3
|
+
const t = r();
|
|
4
|
+
if (!t) throw new Error("useControlPanel must be used within a ControlPanelProvider");
|
|
5
|
+
return t;
|
|
6
|
+
};
|
|
7
|
+
export {
|
|
8
|
+
n as ControlPanelContext,
|
|
9
|
+
a as useControlPanel,
|
|
10
|
+
r as useControlPanelContext
|
|
11
|
+
};
|