@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,8 +1,8 @@
1
1
  import './Confetti.css';
2
2
  /* empty css */
3
- import { forwardRef as B, useCallback as E, useEffect as H, useImperativeHandle as L, useRef as v } from "react";
4
- import { jsx as N } from "react/jsx-runtime";
5
- var O = [
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
- ], _ = (t) => {
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
- ] : O;
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
- }), j = (t, a, s) => {
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
- }, U = (t, a, s, o) => {
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
- U(t, 0, 0, a.size / 2);
102
+ H(t, 0, 0, a.size / 2);
103
103
  }
104
104
  t.restore();
105
- }, W = B(({ colors: t, duration: a = 3e3, scope: s = "fullscreen", variant: o = "confetti", particleCount: c }, P) => {
106
- const h = v(null), f = v(0), d = v(0), M = v(!1), V = {
107
- confetti: 150,
108
- burst: 200,
109
- fireworks: 8
110
- }, C = E(() => {
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 i = h.current;
113
- i && i.getContext("2d")?.clearRect(0, 0, i.width, i.height);
112
+ const l = h.current;
113
+ l && l.getContext("2d")?.clearRect(0, 0, l.width, l.height);
114
114
  }, []), R = E(() => {
115
- const i = h.current;
116
- if (!i || M.current) return;
117
- const r = i.getContext("2d");
115
+ const l = h.current;
116
+ if (!l || M.current) return;
117
+ const r = l.getContext("2d");
118
118
  if (!r) return;
119
- i.width = i.offsetWidth, i.height = i.offsetHeight;
120
- const y = i.width, m = i.height, u = _(t), x = c ?? V[o];
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 l = [];
123
- if (o === "confetti") l = Array.from({ length: x }, () => S(y, m, u));
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
- l = Array.from({ length: x }, () => j(k, A, u));
127
- } else o === "fireworks" && (l = Array.from({ length: x }, () => F(y, m, u)));
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 && l.push(S(y, m, u)), l = l.filter((e) => e.opacity > 0 && e.y < m + 20), l.forEach((e) => {
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" ? (l = l.filter((e) => e.opacity > 0), l.forEach((e) => {
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 && l.push(F(y, m, u)), l = l.filter((e) => e.exploded ? e.children?.some((n) => n.opacity > 0) ?? !1 : e.y > -m * 0.1), l.forEach((e) => {
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 q = (T + 1) / (e.trail?.length ?? 1) * 0.6;
145
- r.save(), r.globalAlpha = q, r.fillStyle = e.color, r.beginPath(), r.arc(n.x, n.y, 2, 0, Math.PI * 2), r.fill(), r.restore();
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 || l.length === 0) {
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 L(P, () => ({ trigger: R }), [R]), H(() => () => {
165
+ return O(P, () => ({ trigger: R }), [R]), N(() => () => {
166
166
  cancelAnimationFrame(f.current);
167
- }, []), /* @__PURE__ */ N("canvas", {
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 f } from "../Icon/Icon2.js";
3
- import { Tooltip as x } from "../Tooltip/Tooltip2.js";
2
+ import { Icon as p } from "../Icon/Icon2.js";
3
+ import { Tooltip as v } from "../Tooltip/Tooltip2.js";
4
4
  /* empty css */
5
- import { createContext as p, useCallback as T, useContext as C, useEffect as g, useMemo as b, useState as v } from "react";
6
- import { jsx as s, jsxs as _ } from "react/jsx-runtime";
7
- var h = p(null), N = () => {
8
- const e = C(h);
9
- if (!e) throw new Error("useToast must be used within a ToastProvider");
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(e);
15
- }, a);
11
+ t(s);
12
+ }, i);
16
13
  return () => clearTimeout(d);
17
14
  }, [
18
- e,
15
+ s,
19
16
  t,
20
- a
17
+ i
21
18
  ]);
22
- const [i, c] = v(!1), l = () => {
23
- c(!0), setTimeout(() => t(e), 300);
24
- }, m = () => {
25
- o?.onClick(), l();
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__ */ _("div", {
28
- className: `toast toast--${n} ${i ? "toast--exiting" : ""}`,
24
+ return /* @__PURE__ */ b("div", {
25
+ className: `toast toast--${r} ${n ? "toast--exiting" : ""}`,
29
26
  children: [
30
- /* @__PURE__ */ s("div", {
27
+ /* @__PURE__ */ o("div", {
31
28
  className: "toast__message",
32
- children: r
29
+ children: a
33
30
  }),
34
- o && /* @__PURE__ */ s("button", {
35
- onClick: m,
31
+ e && /* @__PURE__ */ o("button", {
32
+ onClick: l,
36
33
  className: "toast__action-button",
37
- children: o.label
34
+ children: e.label
38
35
  }),
39
- u && /* @__PURE__ */ s(x, {
36
+ u && /* @__PURE__ */ o(v, {
40
37
  title: "Close",
41
- children: /* @__PURE__ */ s("button", {
42
- onClick: l,
38
+ children: /* @__PURE__ */ o("button", {
39
+ onClick: m,
43
40
  className: "toast__close-button",
44
- children: /* @__PURE__ */ s(f, {
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
- }, y = ({ position: e = "bottom-right", showDismissButton: r = !0 }) => {
53
- const { toasts: n, removeToast: o } = N();
54
- return /* @__PURE__ */ s("div", {
55
- className: `toast-container toast-container--${e}`,
56
- children: n.map((t) => /* @__PURE__ */ s($, {
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: r,
58
+ showDismissButton: a,
62
59
  timeout: t.timeout,
63
- onClose: o
60
+ onClose: e
64
61
  }, t.id))
65
62
  });
66
- }, I = ({ children: e }) => {
67
- const [r, n] = v([]), o = T((a) => {
68
- n((i) => i.filter((c) => c.id !== a));
69
- }, []), t = T((a, i = "info", c = 1500, l) => {
70
- const m = `${Date.now().toString()}-${Math.random().toString(36).slice(2, 8)}`;
71
- return n((d) => [...d, {
72
- id: m,
73
- message: a,
74
- type: i,
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: l
77
- }]), m;
78
- }, []), u = b(() => ({
79
- toasts: r,
73
+ action: m
74
+ }]), l;
75
+ }, []), u = C(() => ({
76
+ toasts: a,
80
77
  addToast: t,
81
- removeToast: o
78
+ removeToast: e
82
79
  }), [
83
- r,
80
+ a,
84
81
  t,
85
- o
82
+ e
86
83
  ]);
87
- return /* @__PURE__ */ s(h.Provider, {
84
+ return /* @__PURE__ */ o(h.Provider, {
88
85
  value: u,
89
- children: e
86
+ children: s
90
87
  });
91
88
  };
92
89
  export {
93
- y as ToastContainer,
94
- I as ToastProvider,
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 G } from "../Button/Button2.js";
3
- import { Tooltip as W } from "../Tooltip/Tooltip2.js";
4
- import { Separator as H } from "../Separator/Separator2.js";
5
- import { AppHeader as L } from "../AppHeader/AppHeader2.js";
6
- import { ConfirmPopover as U } from "../ConfirmPopover/ConfirmPopover2.js";
7
- import { useControlPanelContext as $ } from "./ControlPanelContext.js";
8
- import { DEFAULT_DATE_RANGE_PRESETS as io } from "./ControlPanel.types.js";
9
- import { ControlPanelFilterItem as q } from "./ControlPanelFilter.js";
10
- import { ControlPanelNav as J } from "./ControlPanelNav.js";
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 T } from "react";
14
- import { Fragment as B, jsx as l, jsxs as r } from "react/jsx-runtime";
15
- var fo = ({ 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: N = [], actions: b = [], filters: u = [], filtersCount: p, collapsibleFilters: _ = !1, onFilterChange: F, onClearFilters: x, options: f = [], onOptionChange: I, viewToggle: k, groupBy: P, visibleColumns: y }) => {
16
- const g = $(), e = C ?? g?.isMobile ?? !1, j = d ?? (e ? g?.isOpen ?? !1 : !0), t = h ?? g?.close ?? (() => {
17
- }), z = [
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(" "), M = ["control-panel__overlay", s ? "control-panel__overlay--contained" : ""].filter(Boolean).join(" "), R = {
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
- }, E = f.length === 0 ? [] : "type" in f[0] ? [{ options: f }] : f, A = !!(k || P || y || E.length > 0), O = u.length > 0 || p !== void 0 && p > 0, V = typeof _ == "number" ? _ : _ ? 1 : 1 / 0, S = u.length >= V, w = ["control-panel__filters", S ? "control-panel__filters--collapsible" : ""].filter(Boolean).join(" ");
28
- return /* @__PURE__ */ r(B, { children: [c && e && j && /* @__PURE__ */ l("div", {
29
- className: M,
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: z,
33
- style: R,
31
+ className: T,
32
+ style: w,
34
33
  children: [
35
- n && /* @__PURE__ */ l(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
- b.length > 0 && /* @__PURE__ */ l("div", {
44
+ N.length > 0 && /* @__PURE__ */ l("div", {
46
45
  className: "control-panel__actions",
47
- children: b.map((i) => /* @__PURE__ */ l(Q, {
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
- N.length > 0 && /* @__PURE__ */ l(J, {
53
- navigation: N,
51
+ b.length > 0 && /* @__PURE__ */ l(K, {
52
+ navigation: b,
54
53
  onNavigate: e ? t : void 0
55
54
  }),
56
- O && /* @__PURE__ */ r("div", {
57
- className: w,
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(q, {
71
+ }), u.map((i) => /* @__PURE__ */ l(J, {
73
72
  filter: i,
74
73
  collapsible: i.collapsible ?? S,
75
- onChange: (D) => F?.(D)
74
+ onChange: (G) => F?.(G)
76
75
  }, i.id))]
77
76
  }),
78
- O && A && /* @__PURE__ */ l(H, { spacing: 0 }),
79
- A && /* @__PURE__ */ l(K, {
80
- normalizedOptionGroups: E,
81
- onOptionChange: I,
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: P,
85
- visibleColumns: y
83
+ groupBy: y,
84
+ visibleColumns: P
86
85
  })
87
86
  ]
88
87
  })] });
89
- }, Q = ({ action: o, onActionComplete: a }) => {
90
- const [d, h] = T(null), [C, c] = T(!1), s = (n) => {
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(G, {
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(B, { children: [o.tooltip ? /* @__PURE__ */ l(W, {
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(U, {
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
- fo as ControlPanel,
136
- io as DEFAULT_DATE_RANGE_PRESETS
134
+ mo as ControlPanel
137
135
  };
@@ -1,31 +1,26 @@
1
- import { useBreakpoint as C } from "../../hooks/useBreakpoint.js";
2
- import { createContext as P, useCallback as t, useContext as m, useMemo as p, useState as v } from "react";
3
- import { jsx as x } from "react/jsx-runtime";
4
- var u = P(null), f = () => m(u), h = () => {
5
- const e = f();
6
- if (!e) throw new Error("useControlPanel must be used within a ControlPanelProvider");
7
- return e;
8
- }, k = ({ children: e }) => {
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: l,
14
- close: a
10
+ open: n,
11
+ close: l
15
12
  }), [
13
+ t,
16
14
  r,
17
- n,
18
15
  s,
19
- l,
20
- a
16
+ n,
17
+ l
21
18
  ]);
22
- return /* @__PURE__ */ x(u.Provider, {
19
+ return /* @__PURE__ */ v(m.Provider, {
23
20
  value: i,
24
- children: e
21
+ children: a
25
22
  });
26
23
  };
27
24
  export {
28
- k as ControlPanelProvider,
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
+ };