@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.
Files changed (60) hide show
  1. package/dist/components/AngleSlider/AngleSlider2.js +27 -27
  2. package/dist/components/AppHeader/AppHeader2.js +39 -36
  3. package/dist/components/Auth/ChangePasswordModal/ChangePasswordModal2.js +48 -52
  4. package/dist/components/Auth/MfaSetupModal/MfaSetupModal2.js +64 -65
  5. package/dist/components/Blockquote/Blockquote2.js +14 -14
  6. package/dist/components/BulkActionBar/BulkActionBar2.js +34 -30
  7. package/dist/components/Calendar/Calendar2.js +10 -8
  8. package/dist/components/Card/Card.css +1 -1
  9. package/dist/components/Confetti/Confetti2.js +2 -3
  10. package/dist/components/ControlPanel/ControlPanelFilter.js +26 -26
  11. package/dist/components/DataView/DataView.CardView.js +8 -4
  12. package/dist/components/DataView/DataView.ColumnSelector.js +24 -21
  13. package/dist/components/DataView/DataView.MiniSort.js +18 -16
  14. package/dist/components/DataView/DataView2.js +90 -86
  15. package/dist/components/DiffViewer/DiffViewer2.js +124 -118
  16. package/dist/components/Dropdown/Dropdown2.js +0 -3
  17. package/dist/components/EventCalendar/EventCalendar.Chip.js +21 -21
  18. package/dist/components/EventCalendar/EventCalendar.Month.js +19 -19
  19. package/dist/components/FloatingWindow/FloatingWindow2.js +60 -60
  20. package/dist/components/Grid/Grid2.js +18 -18
  21. package/dist/components/InputPIN/InputPIN2.js +42 -42
  22. package/dist/components/MiniSort/MiniSort2.js +47 -43
  23. package/dist/components/MiniStatsCard/MiniStatsCard2.js +20 -20
  24. package/dist/components/Pagination/Pagination2.js +18 -18
  25. package/dist/components/Popover/Popover2.js +23 -21
  26. package/dist/components/ProtectedRoute/ProtectedRoute.css +1 -0
  27. package/dist/components/ProtectedRoute/ProtectedRoute2.js +19 -0
  28. package/dist/components/RangeSlider/RangeSlider2.js +25 -25
  29. package/dist/components/Rating/RatingIcon.js +9 -9
  30. package/dist/components/RichTextEditor/hooks/useLinkPrompt.js +7 -6
  31. package/dist/components/RollingNumber/RollingNumber2.js +33 -31
  32. package/dist/components/Separator/Separator2.js +27 -23
  33. package/dist/components/Skeleton/Skeleton2.js +6 -8
  34. package/dist/components/Slider/Slider2.js +32 -32
  35. package/dist/components/Splitter/Splitter2.js +34 -34
  36. package/dist/components/StackedBar/StackedBar2.js +36 -34
  37. package/dist/components/Stats/Stats2.js +20 -16
  38. package/dist/components/StickyBar/StickyBar2.js +26 -22
  39. package/dist/components/Timeline/Timeline2.js +53 -47
  40. package/dist/components/Tooltip/Tooltip2.js +7 -8
  41. package/dist/components/TourHud/TourHud2.js +20 -20
  42. package/dist/components/Transition/Transition2.js +20 -20
  43. package/dist/components/Tree/Tree2.js +23 -23
  44. package/dist/contexts/AuthContext/AuthContext.js +33 -32
  45. package/dist/helpers/Charts.js +18 -0
  46. package/dist/helpers/Http.js +102 -0
  47. package/dist/helpers/Images.js +19 -0
  48. package/dist/helpers/Numbers.js +5 -4
  49. package/dist/helpers/VersionInfo.js +1 -1
  50. package/dist/hooks/useAccountMenu.js +58 -0
  51. package/dist/http.d.ts +97 -0
  52. package/dist/http.js +14 -0
  53. package/dist/index.d.ts +152 -5
  54. package/dist/index.js +334 -309
  55. package/dist/node_modules/qrcode.react/lib/esm/index.js +2 -2
  56. package/dist/router.d.ts +18 -0
  57. package/dist/router.js +4 -0
  58. package/dist/version.js +2 -2
  59. package/dist/version.json +4 -4
  60. package/package.json +38 -23
@@ -1,39 +1,38 @@
1
1
  import './MfaSetupModal.css';
2
2
  import { Button as o } from "../../Button/Button2.js";
3
- import { Modal as Y } from "../../Modal/Modal2.js";
4
- import { InputText as U } from "../../InputText/InputText2.js";
5
- import { InputPassword as j } from "../../InputPassword/InputPassword2.js";
6
- import { Toast as Z } from "../../Toast/Toast2.js";
7
- import { useAuth as ee } from "../../../hooks/useAuth/useAuth.js";
8
- import { QRCodeSVG as ae } from "../../../node_modules/qrcode.react/lib/esm/index.js";
3
+ import { Modal as O } from "../../Modal/Modal2.js";
4
+ import { InputText as R } from "../../InputText/InputText2.js";
5
+ import { InputPassword as B } from "../../InputPassword/InputPassword2.js";
6
+ import { Toast as X } from "../../Toast/Toast2.js";
7
+ import { HttpMethod as F, buildRequestHeaders as Y } from "../../../helpers/Http.js";
8
+ import { useAuth as Z } from "../../../hooks/useAuth/useAuth.js";
9
+ import { QRCodeSVG as ee } from "../../../node_modules/qrcode.react/lib/esm/index.js";
9
10
  /* empty css */
10
- import { useCallback as A, useEffect as te, useState as n } from "react";
11
- import { Fragment as D, jsx as e, jsxs as s } from "react/jsx-runtime";
12
- function pe({ isOpen: M, onClose: $ }) {
13
- const { config: f } = ee(), [x, i] = n("loading"), [C, I] = n(!1), [_, P] = n(null), [V, z] = n(""), [S, G] = n(""), [p, l] = n(""), [m, d] = n(""), [b, v] = n([]), [k, u] = n(""), [a, N] = n(!1), [g, y] = n(null), c = A(async (t, h) => {
14
- const W = document.cookie.match(/(?:^|;\s*)csrf_token=([^;]+)/), E = W ? decodeURIComponent(W[1]) : null, R = { "Content-Type": "application/json" };
15
- E && (R["X-CSRF-Token"] = E);
16
- const F = await fetch(`${f.apiBaseUrl}${t}`, {
17
- method: "POST",
11
+ import { useCallback as U, useEffect as ae, useState as r } from "react";
12
+ import { Fragment as A, jsx as e, jsxs as s } from "react/jsx-runtime";
13
+ function pe({ isOpen: M, onClose: D }) {
14
+ const { config: f } = Z(), [$, i] = r("loading"), [C, j] = r(!1), [_, x] = r(null), [P, I] = r(""), [b, V] = r(""), [p, c] = r(""), [m, d] = r(""), [S, v] = r([]), [k, u] = r(""), [a, N] = r(!1), [g, y] = r(null), l = U(async (t, h) => {
15
+ const E = await fetch(`${f.apiBaseUrl}${t}`, {
16
+ method: F.Post,
18
17
  credentials: "include",
19
- headers: R,
18
+ headers: Y(F.Post),
20
19
  body: h ? JSON.stringify(h) : void 0
21
- }), B = await F.json().catch(() => ({}));
22
- if (!F.ok) throw new Error(B.error || "Request failed");
23
- return B;
24
- }, [f.apiBaseUrl]), w = A(async () => {
20
+ }), T = await E.json().catch(() => ({}));
21
+ if (!E.ok) throw new Error(T.error || "Request failed");
22
+ return T;
23
+ }, [f.apiBaseUrl]), w = U(async () => {
25
24
  i("loading"), u("");
26
25
  try {
27
26
  const t = await (await fetch(`${f.apiBaseUrl}/auth/mfaStatus`, { credentials: "include" })).json();
28
- I(!!t.enabled), P(t.method ?? null), i("overview");
27
+ j(!!t.enabled), x(t.method ?? null), i("overview");
29
28
  } catch {
30
29
  u("Could not load MFA status."), i("overview");
31
30
  }
32
31
  }, [f.apiBaseUrl]);
33
- te(() => {
34
- M && (l(""), d(""), u(""), v([]), w());
32
+ ae(() => {
33
+ M && (c(""), d(""), u(""), v([]), w());
35
34
  }, [M, w]);
36
- const r = async (t) => {
35
+ const n = async (t) => {
37
36
  N(!0), u("");
38
37
  try {
39
38
  await t();
@@ -42,47 +41,47 @@ function pe({ isOpen: M, onClose: $ }) {
42
41
  } finally {
43
42
  N(!1);
44
43
  }
45
- }, q = () => r(async () => {
46
- const t = await c("/auth/mfaSetupTotp");
47
- z(t.secret || ""), G(t.otpauthUri || ""), l(""), i("totp-setup");
48
- }), J = () => r(async () => {
49
- const t = await c("/auth/mfaConfirmTotp", { code: p.trim() });
44
+ }, q = () => n(async () => {
45
+ const t = await l("/auth/mfaSetupTotp");
46
+ I(t.secret || ""), V(t.otpauthUri || ""), c(""), i("totp-setup");
47
+ }), z = () => n(async () => {
48
+ const t = await l("/auth/mfaConfirmTotp", { code: p.trim() });
50
49
  v(t.recoveryCodes || []), i("recovery");
51
- }), T = () => r(async () => {
52
- await c("/auth/mfaEnableEmail"), l(""), i("email-setup");
53
- }), L = () => r(async () => {
54
- const t = await c("/auth/mfaConfirmEmail", { code: p.trim() });
50
+ }), W = () => n(async () => {
51
+ await l("/auth/mfaEnableEmail"), c(""), i("email-setup");
52
+ }), G = () => n(async () => {
53
+ const t = await l("/auth/mfaConfirmEmail", { code: p.trim() });
55
54
  v(t.recoveryCodes || []), i("recovery");
56
- }), O = () => r(async () => {
57
- await c("/auth/mfaDisable", { password: m }), y({
55
+ }), H = () => n(async () => {
56
+ await l("/auth/mfaDisable", { password: m }), y({
58
57
  message: "Two-factor authentication disabled.",
59
58
  type: "success"
60
59
  }), d(""), await w();
61
- }), Q = () => r(async () => {
62
- const t = await c("/auth/mfaRegenRecovery", { password: m });
60
+ }), J = () => n(async () => {
61
+ const t = await l("/auth/mfaRegenRecovery", { password: m });
63
62
  v(t.recoveryCodes || []), d(""), i("recovery");
64
- }), X = () => r(async () => {
65
- await c("/auth/mfaForgetDevices"), y({
63
+ }), L = () => n(async () => {
64
+ await l("/auth/mfaForgetDevices"), y({
66
65
  message: "All trusted devices have been signed out.",
67
66
  type: "success"
68
67
  });
69
- }), H = () => {
70
- navigator.clipboard?.writeText(b.join(`
68
+ }), Q = () => {
69
+ navigator.clipboard?.writeText(S.join(`
71
70
  `)), y({
72
71
  message: "Recovery codes copied.",
73
72
  type: "success"
74
73
  });
75
- }, K = V.replace(/(.{4})/g, "$1 ").trim();
76
- return /* @__PURE__ */ s(Y, {
74
+ }, K = P.replace(/(.{4})/g, "$1 ").trim();
75
+ return /* @__PURE__ */ s(O, {
77
76
  isOpen: M,
78
- onClose: $,
77
+ onClose: D,
79
78
  title: "Two-factor authentication",
80
79
  titleIcon: "key",
81
80
  size: "medium",
82
81
  children: [/* @__PURE__ */ s("div", {
83
82
  className: "MfaSetupModal",
84
83
  children: [(() => {
85
- switch (x) {
84
+ switch ($) {
86
85
  case "loading":
87
86
  return /* @__PURE__ */ e("p", {
88
87
  className: "MfaSetupModal__hint",
@@ -94,7 +93,7 @@ function pe({ isOpen: M, onClose: $ }) {
94
93
  children: [/* @__PURE__ */ s("p", {
95
94
  className: "MfaSetupModal__status",
96
95
  children: ["Status: ", /* @__PURE__ */ e("strong", { children: C ? `Enabled (${_ === "email" ? "email codes" : "authenticator app"})` : "Disabled" })]
97
- }), C ? /* @__PURE__ */ s(D, { children: [
96
+ }), C ? /* @__PURE__ */ s(A, { children: [
98
97
  /* @__PURE__ */ e(o, {
99
98
  variant: "default",
100
99
  fullWidth: !0,
@@ -106,7 +105,7 @@ function pe({ isOpen: M, onClose: $ }) {
106
105
  variant: "default",
107
106
  fullWidth: !0,
108
107
  disabled: a,
109
- onClick: () => r(X),
108
+ onClick: () => n(L),
110
109
  children: "Sign out trusted devices"
111
110
  }),
112
111
  /* @__PURE__ */ e(o, {
@@ -117,7 +116,7 @@ function pe({ isOpen: M, onClose: $ }) {
117
116
  onClick: () => i("disable"),
118
117
  children: "Disable two-factor"
119
118
  })
120
- ] }) : /* @__PURE__ */ s(D, { children: [
119
+ ] }) : /* @__PURE__ */ s(A, { children: [
121
120
  /* @__PURE__ */ e("p", {
122
121
  className: "MfaSetupModal__hint",
123
122
  children: "Add a second step at sign-in. Choose a method:"
@@ -133,7 +132,7 @@ function pe({ isOpen: M, onClose: $ }) {
133
132
  variant: "default",
134
133
  fullWidth: !0,
135
134
  disabled: a,
136
- onClick: T,
135
+ onClick: W,
137
136
  children: "Set up email codes"
138
137
  })
139
138
  ] })]
@@ -146,10 +145,10 @@ function pe({ isOpen: M, onClose: $ }) {
146
145
  className: "MfaSetupModal__hint",
147
146
  children: "Scan this with your authenticator app (Google Authenticator, Aegis, 1Password…)."
148
147
  }),
149
- S && /* @__PURE__ */ e("div", {
148
+ b && /* @__PURE__ */ e("div", {
150
149
  className: "MfaSetupModal__qr",
151
- children: /* @__PURE__ */ e(ae, {
152
- value: S,
150
+ children: /* @__PURE__ */ e(ee, {
151
+ value: b,
153
152
  size: 192,
154
153
  marginSize: 2
155
154
  })
@@ -162,10 +161,10 @@ function pe({ isOpen: M, onClose: $ }) {
162
161
  className: "MfaSetupModal__secret",
163
162
  children: K
164
163
  }),
165
- /* @__PURE__ */ e(U, {
164
+ /* @__PURE__ */ e(R, {
166
165
  placeholder: "6-digit code from the app",
167
166
  value: p,
168
- onChange: l,
167
+ onChange: c,
169
168
  autoFocus: !0,
170
169
  disabled: a
171
170
  }),
@@ -174,7 +173,7 @@ function pe({ isOpen: M, onClose: $ }) {
174
173
  icon: "key",
175
174
  fullWidth: !0,
176
175
  loading: a,
177
- onClick: J,
176
+ onClick: z,
178
177
  children: "Verify & enable"
179
178
  })
180
179
  ]
@@ -187,10 +186,10 @@ function pe({ isOpen: M, onClose: $ }) {
187
186
  className: "MfaSetupModal__hint",
188
187
  children: "We emailed you a 6-digit code. Enter it below to enable email verification."
189
188
  }),
190
- /* @__PURE__ */ e(U, {
189
+ /* @__PURE__ */ e(R, {
191
190
  placeholder: "6-digit code",
192
191
  value: p,
193
- onChange: l,
192
+ onChange: c,
194
193
  autoFocus: !0,
195
194
  disabled: a
196
195
  }),
@@ -199,14 +198,14 @@ function pe({ isOpen: M, onClose: $ }) {
199
198
  icon: "key",
200
199
  fullWidth: !0,
201
200
  loading: a,
202
- onClick: L,
201
+ onClick: G,
203
202
  children: "Verify & enable"
204
203
  }),
205
204
  /* @__PURE__ */ e(o, {
206
205
  variant: "default",
207
206
  fullWidth: !0,
208
207
  disabled: a,
209
- onClick: T,
208
+ onClick: W,
210
209
  children: "Resend code"
211
210
  })
212
211
  ]
@@ -226,13 +225,13 @@ function pe({ isOpen: M, onClose: $ }) {
226
225
  }),
227
226
  /* @__PURE__ */ e("ul", {
228
227
  className: "MfaSetupModal__codes",
229
- children: b.map((t) => /* @__PURE__ */ e("li", { children: t }, t))
228
+ children: S.map((t) => /* @__PURE__ */ e("li", { children: t }, t))
230
229
  }),
231
230
  /* @__PURE__ */ e(o, {
232
231
  variant: "default",
233
232
  fullWidth: !0,
234
233
  disabled: a,
235
- onClick: H,
234
+ onClick: Q,
236
235
  children: "Copy codes"
237
236
  }),
238
237
  /* @__PURE__ */ e(o, {
@@ -252,7 +251,7 @@ function pe({ isOpen: M, onClose: $ }) {
252
251
  className: "MfaSetupModal__hint",
253
252
  children: "Confirm your password to disable two-factor authentication."
254
253
  }),
255
- /* @__PURE__ */ e(j, {
254
+ /* @__PURE__ */ e(B, {
256
255
  placeholder: "Current password",
257
256
  value: m,
258
257
  onChange: d,
@@ -264,7 +263,7 @@ function pe({ isOpen: M, onClose: $ }) {
264
263
  icon: "lock",
265
264
  fullWidth: !0,
266
265
  loading: a,
267
- onClick: O,
266
+ onClick: H,
268
267
  children: "Disable two-factor"
269
268
  }),
270
269
  /* @__PURE__ */ e(o, {
@@ -285,7 +284,7 @@ function pe({ isOpen: M, onClose: $ }) {
285
284
  className: "MfaSetupModal__hint",
286
285
  children: "Confirm your password to generate a new set of recovery codes. The old codes stop working."
287
286
  }),
288
- /* @__PURE__ */ e(j, {
287
+ /* @__PURE__ */ e(B, {
289
288
  placeholder: "Current password",
290
289
  value: m,
291
290
  onChange: d,
@@ -297,7 +296,7 @@ function pe({ isOpen: M, onClose: $ }) {
297
296
  icon: "key",
298
297
  fullWidth: !0,
299
298
  loading: a,
300
- onClick: Q,
299
+ onClick: J,
301
300
  children: "Generate new codes"
302
301
  }),
303
302
  /* @__PURE__ */ e(o, {
@@ -315,7 +314,7 @@ function pe({ isOpen: M, onClose: $ }) {
315
314
  className: "MfaSetupModal__error",
316
315
  children: k
317
316
  })]
318
- }), g && /* @__PURE__ */ e(Z, {
317
+ }), g && /* @__PURE__ */ e(X, {
319
318
  message: g.message,
320
319
  type: g.type,
321
320
  onClose: () => y(null)
@@ -1,19 +1,19 @@
1
1
  import './Blockquote.css';
2
- import { Icon as _ } from "../Icon/Icon2.js";
2
+ import { Icon as d } from "../Icon/Icon2.js";
3
3
  /* empty css */
4
4
  import { jsx as e, jsxs as c } from "react/jsx-runtime";
5
- var p = ({ align: r, appearance: a = "bar", author: l, children: i, className: u = "", href: t, icon: s, showQuoteMark: n = !1, size: b = "md", source: o, variant: m = "default" }) => {
6
- const k = !!(l || o), q = r ?? (a === "pull" ? "center" : "left");
5
+ var g = ({ align: r, appearance: a = "bar", author: l, children: i, className: u = "", href: t, icon: s, showQuoteMark: n = !1, size: b = "md", source: o, variant: m = "default" }) => {
6
+ const k = !!(l || o), q = r ?? (a === "pull" ? "center" : "left"), _ = [
7
+ "blockquote",
8
+ `blockquote--${a}`,
9
+ `blockquote--${m}`,
10
+ `blockquote--${b}`,
11
+ `blockquote--align-${q}`,
12
+ n ? "blockquote--marked" : "",
13
+ u
14
+ ].filter(Boolean).join(" ");
7
15
  return /* @__PURE__ */ c("figure", {
8
- className: [
9
- "blockquote",
10
- `blockquote--${a}`,
11
- `blockquote--${m}`,
12
- `blockquote--${b}`,
13
- `blockquote--align-${q}`,
14
- n ? "blockquote--marked" : "",
15
- u
16
- ].filter(Boolean).join(" "),
16
+ className: _,
17
17
  children: [
18
18
  n && /* @__PURE__ */ e("span", {
19
19
  className: "blockquote__mark",
@@ -22,7 +22,7 @@ var p = ({ align: r, appearance: a = "bar", author: l, children: i, className: u
22
22
  /* @__PURE__ */ c("blockquote", {
23
23
  className: "blockquote__quote",
24
24
  cite: t,
25
- children: [s && /* @__PURE__ */ e(_, {
25
+ children: [s && /* @__PURE__ */ e(d, {
26
26
  className: "blockquote__icon",
27
27
  name: s,
28
28
  size: "sm"
@@ -51,5 +51,5 @@ var p = ({ align: r, appearance: a = "bar", author: l, children: i, className: u
51
51
  });
52
52
  };
53
53
  export {
54
- p as Blockquote
54
+ g as Blockquote
55
55
  };
@@ -1,39 +1,43 @@
1
1
  import './BulkActionBar.css';
2
- import { Button as m } from "../Button/Button2.js";
2
+ import { Button as o } from "../Button/Button2.js";
3
3
  /* empty css */
4
4
  import "react";
5
- import { jsx as e, jsxs as n } from "react/jsx-runtime";
6
- var v = (i) => i.label ? `${i.label} ${i.done}/${i.total}` : `Running ${i.done}/${i.total}`, B = ({ selectionCount: i, visible: o, label: d, progress: a, actions: r, onClear: t, clearLabel: b = "Clear", position: c = "bottom", className: u }) => o ?? i > 0 ? /* @__PURE__ */ n("div", {
7
- className: [
5
+ import { jsx as e, jsxs as m } from "react/jsx-runtime";
6
+ var s = (i) => i.label ? `${i.label} ${i.done}/${i.total}` : `Running ${i.done}/${i.total}`, _ = ({ selectionCount: i, visible: n, label: d, progress: a, actions: r, onClear: t, clearLabel: b = "Clear", position: c = "bottom", className: u }) => {
7
+ if (!(n ?? i > 0)) return null;
8
+ const v = [
8
9
  "memobit-bulk-action-bar",
9
10
  `memobit-bulk-action-bar--${c}`,
10
11
  u
11
- ].filter(Boolean).join(" "),
12
- children: [/* @__PURE__ */ e("div", {
13
- className: "memobit-bulk-action-bar__label",
14
- children: a ? v(a) : d ?? `${i} selected`
15
- }), /* @__PURE__ */ n("div", {
16
- className: "memobit-bulk-action-bar__actions",
17
- children: [r.map((l) => /* @__PURE__ */ e(m, {
18
- disabled: l.disabled,
19
- icon: l.icon,
20
- onClick: () => {
21
- l.onClick();
22
- },
23
- size: "medium",
24
- title: l.title,
25
- variant: l.variant ?? "default",
26
- children: l.label
27
- }, l.key)), t && /* @__PURE__ */ e(m, {
28
- disabled: a !== void 0,
29
- icon: "clear",
30
- onClick: t,
31
- size: "medium",
32
- variant: "ghost",
33
- children: b
12
+ ].filter(Boolean).join(" "), k = a ? s(a) : d ?? `${i} selected`;
13
+ return /* @__PURE__ */ m("div", {
14
+ className: v,
15
+ children: [/* @__PURE__ */ e("div", {
16
+ className: "memobit-bulk-action-bar__label",
17
+ children: k
18
+ }), /* @__PURE__ */ m("div", {
19
+ className: "memobit-bulk-action-bar__actions",
20
+ children: [r.map((l) => /* @__PURE__ */ e(o, {
21
+ disabled: l.disabled,
22
+ icon: l.icon,
23
+ onClick: () => {
24
+ l.onClick();
25
+ },
26
+ size: "medium",
27
+ title: l.title,
28
+ variant: l.variant ?? "default",
29
+ children: l.label
30
+ }, l.key)), t && /* @__PURE__ */ e(o, {
31
+ disabled: a !== void 0,
32
+ icon: "clear",
33
+ onClick: t,
34
+ size: "medium",
35
+ variant: "ghost",
36
+ children: b
37
+ })]
34
38
  })]
35
- })]
36
- }) : null;
39
+ });
40
+ };
37
41
  export {
38
- B as BulkActionBar
42
+ _ as BulkActionBar
39
43
  };
@@ -61,14 +61,16 @@ var d = 12, T = [
61
61
  }, K = (e) => i === "range" && o ? e.getTime() > o.getTime() : !1, L = (e) => e.getMonth() === a.getMonth(), Q = (e) => {
62
62
  if (!k(e)) {
63
63
  if (i === "single") m?.(e);
64
- else if (i === "range") if (!o) Y ? Y(e) : (E(e), m?.(void 0));
65
- else {
66
- const t = x(e, o) ? e : o, l = x(e, o) ? o : e;
67
- m?.({
68
- start: t,
69
- end: l
70
- }), Y ? Y(null) : E(null);
71
- }
64
+ else if (i === "range")
65
+ if (!o)
66
+ Y ? Y(e) : (E(e), m?.(void 0));
67
+ else {
68
+ const t = x(e, o) ? e : o, l = x(e, o) ? o : e;
69
+ m?.({
70
+ start: t,
71
+ end: l
72
+ }), Y ? Y(null) : E(null);
73
+ }
72
74
  else if (i === "multiple") {
73
75
  const t = Array.isArray(r) ? r : [], l = t.findIndex((s) => _(s, e));
74
76
  if (l >= 0) {
@@ -1 +1 @@
1
- .card{background:var(--card-background-color);-webkit-backdrop-filter:var(--card-backdrop-filter,none);border:var(--spacing-1) solid;border-color:var(--card-border-color);column-gap:var(--spacing-16);padding:var(--spacing-16);border-radius:var(--radius);color:var(--card-color);box-shadow:var(--card-surface-box-shadow,var(--card-box-shadow));flex-direction:column;display:flex;position:relative}.card:hover{border-color:var(--card-hover-border-color)}.card.no-padding{padding:0}.card.is-highlighted{background-color:var(--card-background-accent-color);border-left:var(--spacing-4) solid var(--card-border-accent-color);color:var(--card-accent-color)}.card.card-variant-success{border-left:var(--spacing-4) solid var(--rating-color-success);background-image:var(--card-tint-success-background,radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--rating-color-success) 14%, transparent) 0%, transparent 70%))}.card.card-variant-warning{border-left:var(--spacing-4) solid var(--rating-color-warning);background-image:var(--card-tint-warning-background,radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--rating-color-warning) 14%, transparent) 0%, transparent 70%))}.card.card-variant-danger{border-left:var(--spacing-4) solid var(--rating-color-danger);background-image:var(--card-tint-danger-background,radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--rating-color-danger) 14%, transparent) 0%, transparent 70%))}.card.card-variant-info{border-left:var(--spacing-4) solid var(--rating-color-info);background-image:var(--card-tint-info-background,radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--rating-color-info) 14%, transparent) 0%, transparent 70%))}.card.is-clickable:hover{cursor:pointer}.card h3{margin:0 0 var(--spacing-16) 0;color:var(--card-title-color,inherit);font-family:var(--card-title-font-family,var(--font-family,sans-serif));font-size:var(--card-title-font-size,var(--font-size-md));font-style:var(--card-title-font-style,normal);font-weight:var(--card-title-font-weight,var(--font-weight-bold));letter-spacing:var(--card-title-letter-spacing,normal);text-transform:var(--card-title-text-transform,none);column-gap:var(--spacing-16);flex-direction:row;justify-content:space-between;align-items:center;display:flex}.card h3 .card-title-content{align-items:center;gap:var(--spacing-8);min-width:0;display:inline-flex}.card h3.card-content-hidden{margin:0}.card h3 .opener-button:hover{cursor:pointer}.card h3 .opener-button svg{transition:transform .2s ease-in-out}.card h3 .opener-button.opener-button-extended svg{transform:rotate(180deg)}.card .card-content{height:fit-content;transition:all .5s}.card .card-content.card-content-collapsed{height:0;overflow:hidden}.card .card-footer{background-color:var(--card-footer-background-color);border-radius:0 0 var(--radius) var(--radius)}.card .card-footer.card-footer-collapsed{display:none}@media (width<=768px){.card{padding:var(--spacing-8)}}
1
+ .card{background:var(--card-background-color);-webkit-backdrop-filter:var(--card-backdrop-filter,none);border:var(--spacing-1) solid;border-color:var(--card-border-color);column-gap:var(--spacing-16);padding:var(--spacing-16);border-radius:var(--radius);color:var(--card-color);box-shadow:var(--card-surface-box-shadow,var(--card-box-shadow));transition:border-color var(--transition-slow);flex-direction:column;display:flex;position:relative}.card:hover{border-color:var(--card-hover-border-color)}.card:has(.card:hover){border-color:var(--card-border-color)}.card.no-padding{padding:0}.card.is-highlighted{background-color:var(--card-background-accent-color);border-left:var(--spacing-4) solid var(--card-border-accent-color);color:var(--card-accent-color)}.card.card-variant-success{border-left:var(--spacing-4) solid var(--rating-color-success);background-image:var(--card-tint-success-background,radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--rating-color-success) 14%, transparent) 0%, transparent 70%))}.card.card-variant-warning{border-left:var(--spacing-4) solid var(--rating-color-warning);background-image:var(--card-tint-warning-background,radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--rating-color-warning) 14%, transparent) 0%, transparent 70%))}.card.card-variant-danger{border-left:var(--spacing-4) solid var(--rating-color-danger);background-image:var(--card-tint-danger-background,radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--rating-color-danger) 14%, transparent) 0%, transparent 70%))}.card.card-variant-info{border-left:var(--spacing-4) solid var(--rating-color-info);background-image:var(--card-tint-info-background,radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--rating-color-info) 14%, transparent) 0%, transparent 70%))}.card.is-clickable:hover{cursor:pointer}.card h3{margin:0 0 var(--spacing-16) 0;color:var(--card-title-color,inherit);font-family:var(--card-title-font-family,var(--font-family,sans-serif));font-size:var(--card-title-font-size,var(--font-size-md));font-style:var(--card-title-font-style,normal);font-weight:var(--card-title-font-weight,var(--font-weight-bold));letter-spacing:var(--card-title-letter-spacing,normal);text-transform:var(--card-title-text-transform,none);column-gap:var(--spacing-16);flex-direction:row;justify-content:space-between;align-items:center;display:flex}.card h3 .card-title-content{align-items:center;gap:var(--spacing-8);min-width:0;display:inline-flex}.card h3.card-content-hidden{margin:0}.card h3 .opener-button:hover{cursor:pointer}.card h3 .opener-button svg{transition:transform .2s ease-in-out}.card h3 .opener-button.opener-button-extended svg{transform:rotate(180deg)}.card .card-content{height:fit-content;transition:all .5s}.card .card-content.card-content-collapsed{height:0;overflow:hidden}.card .card-footer{background-color:var(--card-footer-background-color);border-radius:0 0 var(--radius) var(--radius)}.card .card-footer.card-footer-collapsed{display:none}@media (width<=768px){.card{padding:var(--spacing-8)}}
@@ -100,10 +100,9 @@ var _ = [
100
100
  break;
101
101
  case "star":
102
102
  U(t, 0, 0, a.size / 2);
103
- break;
104
103
  }
105
104
  t.restore();
106
- }, G = B(({ colors: t, duration: a = 3e3, scope: s = "fullscreen", variant: o = "confetti", particleCount: c }, P) => {
105
+ }, J = B(({ colors: t, duration: a = 3e3, scope: s = "fullscreen", variant: o = "confetti", particleCount: c }, P) => {
107
106
  const h = v(null), f = v(0), d = v(0), M = v(!1), V = {
108
107
  confetti: 150,
109
108
  burst: 200,
@@ -171,5 +170,5 @@ var _ = [
171
170
  });
172
171
  });
173
172
  export {
174
- G as Confetti
173
+ J as Confetti
175
174
  };
@@ -40,18 +40,18 @@ var H = 3, f = (e) => Array.isArray(e) ? e : e == null || typeof e == "boolean"
40
40
  e.icon && /* @__PURE__ */ n(b, { name: e.icon }),
41
41
  e.label
42
42
  ]
43
- });
43
+ }), l = [
44
+ "control-panel__filter",
45
+ e.type === "checkbox" ? "control-panel__filter--checkbox" : "",
46
+ t ? "control-panel__filter--collapsible" : "",
47
+ t && !s ? "control-panel__filter--collapsed" : ""
48
+ ].filter(Boolean).join(" ");
44
49
  return /* @__PURE__ */ _("div", {
45
- className: [
46
- "control-panel__filter",
47
- e.type === "checkbox" ? "control-panel__filter--checkbox" : "",
48
- t ? "control-panel__filter--collapsible" : "",
49
- t && !s ? "control-panel__filter--collapsed" : ""
50
- ].filter(Boolean).join(" "),
50
+ className: l,
51
51
  children: [t ? /* @__PURE__ */ _("button", {
52
52
  className: "control-panel__filter-toggle",
53
53
  type: "button",
54
- onClick: () => d((l) => !l),
54
+ onClick: () => d((p) => !p),
55
55
  children: [
56
56
  i,
57
57
  !s && a && /* @__PURE__ */ n("span", {
@@ -151,7 +151,7 @@ var H = 3, f = (e) => Array.isArray(e) ? e : e == null || typeof e == "boolean"
151
151
  })
152
152
  });
153
153
  if (e.type === "range") {
154
- const a = Array.isArray(e.value) ? e.value : [], i = a[0], l = a[1], m = i !== void 0 && l !== void 0 && i > l, p = (u, v) => r({
154
+ const a = Array.isArray(e.value) ? e.value : [], i = a[0], l = a[1], p = i !== void 0 && l !== void 0 && i > l, m = (u, v) => r({
155
155
  filterId: e.id,
156
156
  type: e.type,
157
157
  value: [u, v]
@@ -165,8 +165,8 @@ var H = 3, f = (e) => Array.isArray(e) ? e : e == null || typeof e == "boolean"
165
165
  step: e.step,
166
166
  placeholder: "Min",
167
167
  value: i,
168
- error: m ? "Min exceeds max" : void 0,
169
- onChange: (u) => p(u, l)
168
+ error: p ? "Min exceeds max" : void 0,
169
+ onChange: (u) => m(u, l)
170
170
  }),
171
171
  /* @__PURE__ */ n("span", {
172
172
  className: "control-panel__filter-range-sep",
@@ -178,14 +178,14 @@ var H = 3, f = (e) => Array.isArray(e) ? e : e == null || typeof e == "boolean"
178
178
  step: e.step,
179
179
  placeholder: "Max",
180
180
  value: l,
181
- error: m ? "Max is below min" : void 0,
182
- onChange: (u) => p(i, u)
181
+ error: p ? "Max is below min" : void 0,
182
+ onChange: (u) => m(i, u)
183
183
  })
184
184
  ]
185
185
  });
186
186
  }
187
187
  if (e.type === "date-range") {
188
- const a = Array.isArray(e.value) ? e.value : [], i = a[0] || void 0, l = a[1] || void 0, m = e.presets ?? T, p = (c) => {
188
+ const a = Array.isArray(e.value) ? e.value : [], i = a[0] || void 0, l = a[1] || void 0, p = e.presets ?? T, m = (c) => {
189
189
  if (!c) return;
190
190
  const [h, g, $] = c.split("-").map(Number);
191
191
  return new Date(h, g - 1, $);
@@ -194,16 +194,16 @@ var H = 3, f = (e) => Array.isArray(e) ? e : e == null || typeof e == "boolean"
194
194
  type: e.type,
195
195
  value: [c ?? "", h ?? ""]
196
196
  }), y = (c) => {
197
- const h = e.maxDate ? p(e.maxDate) : /* @__PURE__ */ new Date();
197
+ const h = e.maxDate ? m(e.maxDate) : /* @__PURE__ */ new Date();
198
198
  if (!h) return;
199
199
  const g = new Date(h);
200
200
  g.setDate(g.getDate() - c), v(u(g), u(h));
201
201
  };
202
202
  return /* @__PURE__ */ _("div", {
203
203
  className: "control-panel__filter-date-range",
204
- children: [m.length > 0 && /* @__PURE__ */ n("div", {
204
+ children: [p.length > 0 && /* @__PURE__ */ n("div", {
205
205
  className: "control-panel__filter-date-presets",
206
- children: m.map((c) => /* @__PURE__ */ n(C, {
206
+ children: p.map((c) => /* @__PURE__ */ n(C, {
207
207
  size: "small",
208
208
  variant: "default",
209
209
  onClick: () => y(c.days),
@@ -211,12 +211,12 @@ var H = 3, f = (e) => Array.isArray(e) ? e : e == null || typeof e == "boolean"
211
211
  }, c.days))
212
212
  }), /* @__PURE__ */ n(R, {
213
213
  mode: "range",
214
- minDate: p(e.minDate),
215
- maxDate: p(e.maxDate),
214
+ minDate: m(e.minDate),
215
+ maxDate: m(e.maxDate),
216
216
  placeholder: e.placeholder ?? "Select range",
217
217
  value: i && l ? {
218
- start: p(i),
219
- end: p(l)
218
+ start: m(i),
219
+ end: m(l)
220
220
  } : void 0,
221
221
  onChange: (c) => {
222
222
  if (c && typeof c == "object" && !Array.isArray(c) && "start" in c) {
@@ -306,15 +306,15 @@ var H = 3, f = (e) => Array.isArray(e) ? e : e == null || typeof e == "boolean"
306
306
  overflowY: "auto"
307
307
  } : void 0,
308
308
  children: i.map((l) => {
309
- const m = o.includes(l.value), p = /* @__PURE__ */ _(S, {
309
+ const p = o.includes(l.value), m = /* @__PURE__ */ _(S, {
310
310
  color: l.color,
311
311
  count: l.count,
312
312
  disabled: l.disabled,
313
313
  icon: l.icon,
314
- selected: m,
314
+ selected: p,
315
315
  onClick: () => {
316
316
  if (l.disabled) return;
317
- const u = e.multiple === !1, v = u ? m ? [] : [l.value] : m ? o.filter((y) => y !== l.value) : [...o, l.value];
317
+ const u = e.multiple === !1, v = u ? p ? [] : [l.value] : p ? o.filter((y) => y !== l.value) : [...o, l.value];
318
318
  r({
319
319
  filterId: e.id,
320
320
  type: e.type,
@@ -331,8 +331,8 @@ var H = 3, f = (e) => Array.isArray(e) ? e : e == null || typeof e == "boolean"
331
331
  });
332
332
  return l.tooltip ? /* @__PURE__ */ n(k, {
333
333
  title: l.tooltip,
334
- children: p
335
- }, l.value) : /* @__PURE__ */ n(P, { children: p }, l.value);
334
+ children: m
335
+ }, l.value) : /* @__PURE__ */ n(P, { children: m }, l.value);
336
336
  })
337
337
  })]
338
338
  });
@@ -31,10 +31,14 @@ var la = [
31
31
  }) : n;
32
32
  };
33
33
  function _a({ data: t, columns: l, rowKey: h, card: n, actions: g, timeline: o, onRowClick: _, rowHref: j, rowClassName: D, empty: r, selectable: w, selectedIds: V = [], pinnedIds: $, onToggleSelect: p, cardMaxWidth: C, isMobile: G = !1, groups: I, showGroupCount: T = !0, collapsible: N = !1, collapsedGroups: U, onToggleGroup: Z }) {
34
- const P = l.filter((e) => !e.hideInCard && !(G && e.hideInMobile)), q = M(() => new Set($ ?? []), [$]), S = `data-view__cards${C !== void 0 ? " data-view__cards--grid" : ""}`, A = C !== void 0 ? { "--data-view-card-max-width": W(C) } : void 0, B = M(() => o ? X(t.map((e) => ({
35
- id: o.idAccessor(e),
36
- date: o.dateAccessor(e)
37
- })), o.granularity) : /* @__PURE__ */ new Map(), [t, o]);
34
+ const P = l.filter((e) => !e.hideInCard && !(G && e.hideInMobile)), q = M(() => new Set($ ?? []), [$]), S = `data-view__cards${C !== void 0 ? " data-view__cards--grid" : ""}`, A = C !== void 0 ? { "--data-view-card-max-width": W(C) } : void 0, B = M(() => {
35
+ if (!o) return /* @__PURE__ */ new Map();
36
+ const e = t.map((s) => ({
37
+ id: o.idAccessor(s),
38
+ date: o.dateAccessor(s)
39
+ }));
40
+ return X(e, o.granularity);
41
+ }, [t, o]);
38
42
  if (t.length === 0)
39
43
  return r ? /* @__PURE__ */ a(L, {
40
44
  title: r.title,