blunt-ui 0.3.3 → 0.3.4
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/index.cjs +32 -29
- package/dist/index.js +368 -360
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as s, jsxs as
|
|
2
|
-
import i, { css as t, keyframes as
|
|
3
|
-
import po, { useId as A, useState as
|
|
1
|
+
import { jsx as s, jsxs as k, Fragment as Lo } from "react/jsx-runtime";
|
|
2
|
+
import i, { css as t, keyframes as F, ThemeProvider as Fo, createGlobalStyle as Bo } from "styled-components";
|
|
3
|
+
import po, { useId as A, useState as D, useContext as io, createContext as ao, forwardRef as ko, createElement as to, useRef as U, useEffect as j, useCallback as V, useMemo as lo } from "react";
|
|
4
4
|
import { createPortal as Co } from "react-dom";
|
|
5
5
|
const H = (o, r, n) => t`
|
|
6
6
|
background: ${r};
|
|
@@ -308,49 +308,49 @@ function qo({
|
|
|
308
308
|
error: c,
|
|
309
309
|
leftElement: d,
|
|
310
310
|
rightElement: p,
|
|
311
|
-
clearable:
|
|
312
|
-
onClear:
|
|
313
|
-
fullWidth:
|
|
314
|
-
id:
|
|
315
|
-
value:
|
|
311
|
+
clearable: g,
|
|
312
|
+
onClear: b,
|
|
313
|
+
fullWidth: h,
|
|
314
|
+
id: y,
|
|
315
|
+
value: $,
|
|
316
316
|
defaultValue: x,
|
|
317
|
-
onChange:
|
|
318
|
-
...
|
|
317
|
+
onChange: v,
|
|
318
|
+
...C
|
|
319
319
|
}) {
|
|
320
|
-
const
|
|
321
|
-
|
|
322
|
-
},
|
|
323
|
-
|
|
320
|
+
const M = A(), f = y ?? M, T = `${f}-hint`, [S, z] = D(x ?? ""), w = $ !== void 0, I = w ? $ : S, W = typeof c == "string" ? c : void 0, O = !!(a || c), P = (N) => {
|
|
321
|
+
w || z(N.target.value), v?.(N);
|
|
322
|
+
}, K = () => {
|
|
323
|
+
w || z(""), b?.();
|
|
324
324
|
};
|
|
325
|
-
return /* @__PURE__ */
|
|
326
|
-
l && /* @__PURE__ */ s(Ro, { htmlFor:
|
|
327
|
-
/* @__PURE__ */
|
|
325
|
+
return /* @__PURE__ */ k(Ao, { $fullWidth: h, children: [
|
|
326
|
+
l && /* @__PURE__ */ s(Ro, { htmlFor: f, children: l }),
|
|
327
|
+
/* @__PURE__ */ k(Ho, { $size: n, $variant: e, $error: !!c, children: [
|
|
328
328
|
d && /* @__PURE__ */ s(fo, { children: d }),
|
|
329
329
|
/* @__PURE__ */ s(
|
|
330
330
|
Uo,
|
|
331
331
|
{
|
|
332
|
-
id:
|
|
332
|
+
id: f,
|
|
333
333
|
ref: o,
|
|
334
334
|
type: r,
|
|
335
|
-
value:
|
|
336
|
-
onChange:
|
|
337
|
-
...
|
|
335
|
+
value: I,
|
|
336
|
+
onChange: P,
|
|
337
|
+
...C,
|
|
338
338
|
"aria-invalid": !!c,
|
|
339
|
-
"aria-describedby":
|
|
339
|
+
"aria-describedby": O ? T : void 0
|
|
340
340
|
}
|
|
341
341
|
),
|
|
342
|
-
|
|
342
|
+
g && I && /* @__PURE__ */ s(
|
|
343
343
|
Ko,
|
|
344
344
|
{
|
|
345
345
|
type: "button",
|
|
346
|
-
onClick:
|
|
346
|
+
onClick: K,
|
|
347
347
|
"aria-label": "Clear input",
|
|
348
348
|
children: "✕"
|
|
349
349
|
}
|
|
350
350
|
),
|
|
351
351
|
p && /* @__PURE__ */ s(fo, { children: p })
|
|
352
352
|
] }),
|
|
353
|
-
|
|
353
|
+
O && /* @__PURE__ */ s(Yo, { id: T, $error: !!c, children: W ?? a })
|
|
354
354
|
] });
|
|
355
355
|
}
|
|
356
356
|
qo.displayName = "Input";
|
|
@@ -437,28 +437,28 @@ function or({
|
|
|
437
437
|
fullWidth: c,
|
|
438
438
|
id: d,
|
|
439
439
|
value: p,
|
|
440
|
-
defaultValue:
|
|
441
|
-
onChange:
|
|
442
|
-
...
|
|
440
|
+
defaultValue: g,
|
|
441
|
+
onChange: b,
|
|
442
|
+
...h
|
|
443
443
|
}) {
|
|
444
|
-
const
|
|
445
|
-
return /* @__PURE__ */
|
|
446
|
-
e && /* @__PURE__ */ s(Jo, { htmlFor:
|
|
444
|
+
const y = A(), $ = d ?? y, x = `${$}-hint`, [v, C] = D(g ?? ""), M = p !== void 0, f = M ? p : v, T = typeof a == "string" ? a : void 0, S = !!(l || a);
|
|
445
|
+
return /* @__PURE__ */ k(Go, { $fullWidth: c, children: [
|
|
446
|
+
e && /* @__PURE__ */ s(Jo, { htmlFor: $, children: e }),
|
|
447
447
|
/* @__PURE__ */ s(Zo, { $size: r, $variant: n, $error: !!a, children: /* @__PURE__ */ s(
|
|
448
448
|
Qo,
|
|
449
449
|
{
|
|
450
|
-
id:
|
|
450
|
+
id: $,
|
|
451
451
|
ref: o,
|
|
452
|
-
value:
|
|
453
|
-
onChange: (
|
|
454
|
-
|
|
452
|
+
value: f,
|
|
453
|
+
onChange: (w) => {
|
|
454
|
+
M || C(w.target.value), b?.(w);
|
|
455
455
|
},
|
|
456
|
-
...
|
|
456
|
+
...h,
|
|
457
457
|
"aria-invalid": !!a,
|
|
458
|
-
"aria-describedby":
|
|
458
|
+
"aria-describedby": S ? x : void 0
|
|
459
459
|
}
|
|
460
460
|
) }),
|
|
461
|
-
|
|
461
|
+
S && /* @__PURE__ */ s(Xo, { id: x, $error: !!a, children: T ?? l })
|
|
462
462
|
] });
|
|
463
463
|
}
|
|
464
464
|
or.displayName = "Textarea";
|
|
@@ -491,27 +491,27 @@ const tr = (o) => {
|
|
|
491
491
|
}, sr = ao({}), er = () => io(sr), ir = ko(
|
|
492
492
|
({ color: o, size: r, strokeWidth: n, absoluteStrokeWidth: e, className: l = "", children: a, iconNode: c, ...d }, p) => {
|
|
493
493
|
const {
|
|
494
|
-
size:
|
|
495
|
-
strokeWidth:
|
|
496
|
-
absoluteStrokeWidth:
|
|
497
|
-
color:
|
|
498
|
-
className:
|
|
499
|
-
} = er() ?? {}, x = e ??
|
|
494
|
+
size: g = 24,
|
|
495
|
+
strokeWidth: b = 2,
|
|
496
|
+
absoluteStrokeWidth: h = !1,
|
|
497
|
+
color: y = "currentColor",
|
|
498
|
+
className: $ = ""
|
|
499
|
+
} = er() ?? {}, x = e ?? h ? Number(n ?? b) * 24 / Number(r ?? g) : n ?? b;
|
|
500
500
|
return to(
|
|
501
501
|
"svg",
|
|
502
502
|
{
|
|
503
503
|
ref: p,
|
|
504
504
|
...ro,
|
|
505
|
-
width: r ??
|
|
506
|
-
height: r ??
|
|
507
|
-
stroke: o ??
|
|
505
|
+
width: r ?? g ?? ro.width,
|
|
506
|
+
height: r ?? g ?? ro.height,
|
|
507
|
+
stroke: o ?? y,
|
|
508
508
|
strokeWidth: x,
|
|
509
|
-
className: So("lucide",
|
|
509
|
+
className: So("lucide", $, l),
|
|
510
510
|
...!a && !tr(d) && { "aria-hidden": "true" },
|
|
511
511
|
...d
|
|
512
512
|
},
|
|
513
513
|
[
|
|
514
|
-
...c.map(([
|
|
514
|
+
...c.map(([v, C]) => to(v, C)),
|
|
515
515
|
...Array.isArray(a) ? a : [a]
|
|
516
516
|
]
|
|
517
517
|
);
|
|
@@ -669,21 +669,21 @@ function Tr({
|
|
|
669
669
|
clearable: c,
|
|
670
670
|
onClear: d,
|
|
671
671
|
id: p,
|
|
672
|
-
value:
|
|
673
|
-
defaultValue:
|
|
674
|
-
onChange:
|
|
675
|
-
...
|
|
672
|
+
value: g,
|
|
673
|
+
defaultValue: b,
|
|
674
|
+
onChange: h,
|
|
675
|
+
...y
|
|
676
676
|
}) {
|
|
677
|
-
const
|
|
678
|
-
|
|
679
|
-
),
|
|
680
|
-
|
|
681
|
-
},
|
|
682
|
-
|
|
683
|
-
},
|
|
684
|
-
return /* @__PURE__ */
|
|
685
|
-
/* @__PURE__ */
|
|
686
|
-
/* @__PURE__ */
|
|
677
|
+
const $ = A(), x = p ?? $, v = `${x}-hint`, C = typeof l == "string" ? l : void 0, [M, f] = D(
|
|
678
|
+
b ?? ""
|
|
679
|
+
), T = g !== void 0, S = T ? g : M, z = (W) => {
|
|
680
|
+
T || f(W.target.value), h?.(W);
|
|
681
|
+
}, w = () => {
|
|
682
|
+
T || f(""), d?.();
|
|
683
|
+
}, I = c && !!S;
|
|
684
|
+
return /* @__PURE__ */ k(mr, { $fullWidth: a, children: [
|
|
685
|
+
/* @__PURE__ */ k(vr, { children: [
|
|
686
|
+
/* @__PURE__ */ k(
|
|
687
687
|
Cr,
|
|
688
688
|
{
|
|
689
689
|
id: x,
|
|
@@ -691,27 +691,27 @@ function Tr({
|
|
|
691
691
|
$variant: e,
|
|
692
692
|
$error: !!l,
|
|
693
693
|
"aria-invalid": !!l,
|
|
694
|
-
"aria-describedby":
|
|
695
|
-
value:
|
|
696
|
-
onChange:
|
|
697
|
-
...
|
|
694
|
+
"aria-describedby": C ? v : void 0,
|
|
695
|
+
value: S,
|
|
696
|
+
onChange: z,
|
|
697
|
+
...y,
|
|
698
698
|
children: [
|
|
699
699
|
r && /* @__PURE__ */ s("option", { value: "", disabled: !0, children: r }),
|
|
700
700
|
o.map((W) => /* @__PURE__ */ s("option", { value: W.value, disabled: W.disabled, children: W.label }, W.value))
|
|
701
701
|
]
|
|
702
702
|
}
|
|
703
703
|
),
|
|
704
|
-
|
|
704
|
+
I ? /* @__PURE__ */ s(
|
|
705
705
|
Sr,
|
|
706
706
|
{
|
|
707
707
|
type: "button",
|
|
708
|
-
onClick:
|
|
708
|
+
onClick: w,
|
|
709
709
|
"aria-label": "Clear selection",
|
|
710
710
|
children: /* @__PURE__ */ s(co, { size: 14 })
|
|
711
711
|
}
|
|
712
712
|
) : /* @__PURE__ */ s(zr, { "aria-hidden": "true", children: /* @__PURE__ */ s(zo, { size: 14 }) })
|
|
713
713
|
] }),
|
|
714
|
-
|
|
714
|
+
C && /* @__PURE__ */ s(kr, { id: v, $error: !0, children: C })
|
|
715
715
|
] });
|
|
716
716
|
}
|
|
717
717
|
Tr.displayName = "Select";
|
|
@@ -734,6 +734,9 @@ const go = i.span`
|
|
|
734
734
|
opacity: 0.5;
|
|
735
735
|
` : t`
|
|
736
736
|
cursor: text;
|
|
737
|
+
transition:
|
|
738
|
+
border-color 0.15s ease,
|
|
739
|
+
box-shadow 0.15s ease;
|
|
737
740
|
|
|
738
741
|
&:hover {
|
|
739
742
|
${r.brutalism ? t`
|
|
@@ -752,7 +755,7 @@ const go = i.span`
|
|
|
752
755
|
box-shadow: ${r.shadows.focusRing};
|
|
753
756
|
}
|
|
754
757
|
`}
|
|
755
|
-
`,
|
|
758
|
+
`, Dr = i.input`
|
|
756
759
|
display: inline-block;
|
|
757
760
|
min-width: 60px;
|
|
758
761
|
padding: ${({ theme: o }) => `${o.spacing[1]} ${o.spacing[2]}`};
|
|
@@ -772,7 +775,7 @@ const go = i.span`
|
|
|
772
775
|
box-shadow: ${o.shadows.focusRing};
|
|
773
776
|
`}
|
|
774
777
|
`;
|
|
775
|
-
function
|
|
778
|
+
function Mr({
|
|
776
779
|
value: o,
|
|
777
780
|
defaultValue: r = "",
|
|
778
781
|
onChange: n,
|
|
@@ -781,26 +784,26 @@ function Dr({
|
|
|
781
784
|
placeholder: a = "Click to edit",
|
|
782
785
|
disabled: c = !1
|
|
783
786
|
}) {
|
|
784
|
-
const d = o !== void 0, [p,
|
|
785
|
-
c || (x(
|
|
786
|
-
|
|
787
|
+
const d = o !== void 0, [p, g] = D(r), b = d ? o : p, [h, y] = D(!1), [$, x] = D(""), v = U(null), C = () => {
|
|
788
|
+
c || (x(b), y(!0), setTimeout(() => {
|
|
789
|
+
v.current?.focus(), v.current?.select();
|
|
787
790
|
}, 0));
|
|
788
|
-
},
|
|
789
|
-
d || $
|
|
790
|
-
},
|
|
791
|
-
l?.(
|
|
792
|
-
},
|
|
793
|
-
|
|
791
|
+
}, M = () => {
|
|
792
|
+
d || g($), n?.($), e?.($), y(!1);
|
|
793
|
+
}, f = () => {
|
|
794
|
+
l?.(b), y(!1);
|
|
795
|
+
}, T = (S) => {
|
|
796
|
+
S.key === "Enter" ? M() : S.key === "Escape" && f();
|
|
794
797
|
};
|
|
795
|
-
return
|
|
796
|
-
|
|
798
|
+
return h ? /* @__PURE__ */ s(go, { children: /* @__PURE__ */ s(
|
|
799
|
+
Dr,
|
|
797
800
|
{
|
|
798
|
-
ref:
|
|
799
|
-
value:
|
|
800
|
-
size: Math.max(
|
|
801
|
-
onChange: (
|
|
802
|
-
onBlur:
|
|
803
|
-
onKeyDown:
|
|
801
|
+
ref: v,
|
|
802
|
+
value: $,
|
|
803
|
+
size: Math.max($.length, a.length, 10),
|
|
804
|
+
onChange: (S) => x(S.target.value),
|
|
805
|
+
onBlur: M,
|
|
806
|
+
onKeyDown: T,
|
|
804
807
|
"aria-label": "Edit value"
|
|
805
808
|
}
|
|
806
809
|
) }) : /* @__PURE__ */ s(go, { children: /* @__PURE__ */ s(
|
|
@@ -809,14 +812,14 @@ function Dr({
|
|
|
809
812
|
role: c ? void 0 : "button",
|
|
810
813
|
tabIndex: c ? void 0 : 0,
|
|
811
814
|
$disabled: c,
|
|
812
|
-
$empty: !
|
|
813
|
-
onClick:
|
|
814
|
-
onKeyDown: (
|
|
815
|
-
children:
|
|
815
|
+
$empty: !b,
|
|
816
|
+
onClick: C,
|
|
817
|
+
onKeyDown: (S) => S.key === "Enter" && C(),
|
|
818
|
+
children: b || a
|
|
816
819
|
}
|
|
817
820
|
) });
|
|
818
821
|
}
|
|
819
|
-
|
|
822
|
+
Mr.displayName = "Editable";
|
|
820
823
|
const Wr = i.a`
|
|
821
824
|
text-decoration: underline;
|
|
822
825
|
text-underline-offset: 2px;
|
|
@@ -873,22 +876,22 @@ const Or = i.div`
|
|
|
873
876
|
color: ${({ theme: o }) => o.colors.neutral[900]};
|
|
874
877
|
`;
|
|
875
878
|
function Er({ label: o, value: r, href: n }) {
|
|
876
|
-
return /* @__PURE__ */
|
|
879
|
+
return /* @__PURE__ */ k(Or, { children: [
|
|
877
880
|
/* @__PURE__ */ s(Pr, { children: o }),
|
|
878
881
|
n ? /* @__PURE__ */ s(To, { href: n, external: !0, children: r }) : /* @__PURE__ */ s(Nr, { children: r ?? "—" })
|
|
879
882
|
] });
|
|
880
883
|
}
|
|
881
884
|
Er.displayName = "Field";
|
|
882
|
-
const Lr =
|
|
885
|
+
const Lr = F`
|
|
883
886
|
from { opacity: 0; }
|
|
884
887
|
to { opacity: 1; }
|
|
885
|
-
`, Fr =
|
|
888
|
+
`, Fr = F`
|
|
886
889
|
from { opacity: 1; }
|
|
887
890
|
to { opacity: 0; }
|
|
888
|
-
`, Br =
|
|
891
|
+
`, Br = F`
|
|
889
892
|
from { opacity: 0; transform: scale(0.95) translateY(-8px); }
|
|
890
893
|
to { opacity: 1; transform: scale(1) translateY(0); }
|
|
891
|
-
`, Vr =
|
|
894
|
+
`, Vr = F`
|
|
892
895
|
from { opacity: 1; transform: scale(1) translateY(0); }
|
|
893
896
|
to { opacity: 0; transform: scale(0.95) translateY(-8px); }
|
|
894
897
|
`, _r = i.div`
|
|
@@ -1000,69 +1003,74 @@ function Io({
|
|
|
1000
1003
|
closeOnBackdrop: c = !0,
|
|
1001
1004
|
closeOnEscape: d = !0,
|
|
1002
1005
|
ariaLabelledBy: p,
|
|
1003
|
-
ariaDescribedBy:
|
|
1006
|
+
ariaDescribedBy: g
|
|
1004
1007
|
}) {
|
|
1005
|
-
const
|
|
1008
|
+
const b = U(null), h = U(null), y = A(), $ = p ?? (n ? y : void 0), [x, v] = D(o), [C, M] = D(!1);
|
|
1006
1009
|
return j(() => {
|
|
1007
1010
|
if (o)
|
|
1008
|
-
|
|
1009
|
-
else if (
|
|
1010
|
-
|
|
1011
|
-
const
|
|
1012
|
-
|
|
1011
|
+
v(!0), M(!1);
|
|
1012
|
+
else if (x) {
|
|
1013
|
+
M(!0);
|
|
1014
|
+
const f = setTimeout(() => {
|
|
1015
|
+
v(!1), M(!1);
|
|
1013
1016
|
}, 150);
|
|
1014
|
-
return () => clearTimeout(
|
|
1017
|
+
return () => clearTimeout(f);
|
|
1015
1018
|
}
|
|
1016
|
-
}, [o,
|
|
1019
|
+
}, [o, x]), j(() => {
|
|
1017
1020
|
if (!o)
|
|
1018
1021
|
return;
|
|
1019
|
-
const
|
|
1022
|
+
const f = document.body.style.overflow;
|
|
1020
1023
|
return document.body.style.overflow = "hidden", () => {
|
|
1021
|
-
document.body.style.overflow =
|
|
1024
|
+
document.body.style.overflow = f;
|
|
1022
1025
|
};
|
|
1023
1026
|
}, [o]), j(() => {
|
|
1024
|
-
if (!o || !
|
|
1027
|
+
if (!o || !b.current)
|
|
1025
1028
|
return;
|
|
1026
|
-
const
|
|
1027
|
-
(bo(
|
|
1028
|
-
const
|
|
1029
|
-
if (
|
|
1029
|
+
const f = b.current, T = document.activeElement;
|
|
1030
|
+
(bo(f)[0] ?? f).focus();
|
|
1031
|
+
const z = (w) => {
|
|
1032
|
+
if (w.key === "Escape" && d) {
|
|
1030
1033
|
r();
|
|
1031
1034
|
return;
|
|
1032
1035
|
}
|
|
1033
|
-
if (
|
|
1036
|
+
if (w.key !== "Tab")
|
|
1034
1037
|
return;
|
|
1035
|
-
const
|
|
1036
|
-
if (
|
|
1037
|
-
|
|
1038
|
+
const I = bo(f);
|
|
1039
|
+
if (I.length === 0) {
|
|
1040
|
+
w.preventDefault();
|
|
1038
1041
|
return;
|
|
1039
1042
|
}
|
|
1040
|
-
const
|
|
1041
|
-
|
|
1043
|
+
const W = I[0], O = I[I.length - 1];
|
|
1044
|
+
w.shiftKey ? document.activeElement === W && (w.preventDefault(), O.focus()) : document.activeElement === O && (w.preventDefault(), W.focus());
|
|
1042
1045
|
};
|
|
1043
|
-
return document.addEventListener("keydown",
|
|
1044
|
-
document.removeEventListener("keydown",
|
|
1046
|
+
return document.addEventListener("keydown", z), () => {
|
|
1047
|
+
document.removeEventListener("keydown", z), T?.focus();
|
|
1045
1048
|
};
|
|
1046
|
-
}, [o, d, r,
|
|
1049
|
+
}, [o, d, r, x]), x ? Co(
|
|
1047
1050
|
/* @__PURE__ */ s(
|
|
1048
1051
|
_r,
|
|
1049
1052
|
{
|
|
1050
|
-
$closing:
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
+
$closing: C,
|
|
1054
|
+
onMouseDown: (f) => {
|
|
1055
|
+
h.current = f.target;
|
|
1056
|
+
},
|
|
1057
|
+
onClick: (f) => {
|
|
1058
|
+
c && h.current === f.currentTarget && r();
|
|
1059
|
+
},
|
|
1060
|
+
children: /* @__PURE__ */ k(
|
|
1053
1061
|
jr,
|
|
1054
1062
|
{
|
|
1055
|
-
ref:
|
|
1063
|
+
ref: b,
|
|
1056
1064
|
role: "dialog",
|
|
1057
1065
|
"aria-modal": "true",
|
|
1058
|
-
"aria-labelledby":
|
|
1059
|
-
"aria-describedby":
|
|
1066
|
+
"aria-labelledby": $,
|
|
1067
|
+
"aria-describedby": g,
|
|
1060
1068
|
$size: a,
|
|
1061
|
-
$closing:
|
|
1069
|
+
$closing: C,
|
|
1062
1070
|
tabIndex: -1,
|
|
1063
|
-
onClick: (
|
|
1071
|
+
onClick: (f) => f.stopPropagation(),
|
|
1064
1072
|
children: [
|
|
1065
|
-
/* @__PURE__ */
|
|
1073
|
+
/* @__PURE__ */ k(Ar, { children: [
|
|
1066
1074
|
n && /* @__PURE__ */ s(Rr, { id: y, children: n }),
|
|
1067
1075
|
/* @__PURE__ */ s(Yr, { onClick: r, "aria-label": "Close modal", children: "×" })
|
|
1068
1076
|
] }),
|
|
@@ -1077,13 +1085,13 @@ function Io({
|
|
|
1077
1085
|
) : null;
|
|
1078
1086
|
}
|
|
1079
1087
|
Io.displayName = "Modal";
|
|
1080
|
-
const qr =
|
|
1088
|
+
const qr = F`
|
|
1081
1089
|
from { opacity: 0; transform: translateY(12px); }
|
|
1082
1090
|
to { opacity: 1; transform: translateY(0); }
|
|
1083
|
-
`, Gr =
|
|
1091
|
+
`, Gr = F`
|
|
1084
1092
|
from { opacity: 0; transform: translateY(-12px); }
|
|
1085
1093
|
to { opacity: 1; transform: translateY(0); }
|
|
1086
|
-
`, Jr =
|
|
1094
|
+
`, Jr = F`
|
|
1087
1095
|
from { opacity: 1; }
|
|
1088
1096
|
to { opacity: 0; }
|
|
1089
1097
|
`, Xr = i.div`
|
|
@@ -1197,7 +1205,7 @@ const qr = L`
|
|
|
1197
1205
|
outline-offset: 2px;
|
|
1198
1206
|
}
|
|
1199
1207
|
`;
|
|
1200
|
-
function
|
|
1208
|
+
function Do({
|
|
1201
1209
|
open: o,
|
|
1202
1210
|
onClose: r,
|
|
1203
1211
|
message: n,
|
|
@@ -1205,28 +1213,28 @@ function Mo({
|
|
|
1205
1213
|
duration: l = 4e3,
|
|
1206
1214
|
position: a = "bottom-right"
|
|
1207
1215
|
}) {
|
|
1208
|
-
const [c, d] =
|
|
1216
|
+
const [c, d] = D(o), [p, g] = D(!1);
|
|
1209
1217
|
return j(() => {
|
|
1210
1218
|
if (o)
|
|
1211
|
-
d(!0),
|
|
1219
|
+
d(!0), g(!1);
|
|
1212
1220
|
else if (c) {
|
|
1213
|
-
|
|
1214
|
-
const
|
|
1215
|
-
d(!1),
|
|
1221
|
+
g(!0);
|
|
1222
|
+
const b = setTimeout(() => {
|
|
1223
|
+
d(!1), g(!1);
|
|
1216
1224
|
}, 200);
|
|
1217
1225
|
return () => {
|
|
1218
|
-
clearTimeout(
|
|
1226
|
+
clearTimeout(b);
|
|
1219
1227
|
};
|
|
1220
1228
|
}
|
|
1221
1229
|
}, [o, c]), j(() => {
|
|
1222
1230
|
if (!o || l === 0)
|
|
1223
1231
|
return;
|
|
1224
|
-
const
|
|
1232
|
+
const b = setTimeout(r, l);
|
|
1225
1233
|
return () => {
|
|
1226
|
-
clearTimeout(
|
|
1234
|
+
clearTimeout(b);
|
|
1227
1235
|
};
|
|
1228
1236
|
}, [o, l, r]), c ? Co(
|
|
1229
|
-
/* @__PURE__ */
|
|
1237
|
+
/* @__PURE__ */ k(
|
|
1230
1238
|
Zr,
|
|
1231
1239
|
{
|
|
1232
1240
|
$position: a,
|
|
@@ -1243,10 +1251,10 @@ function Mo({
|
|
|
1243
1251
|
document.body
|
|
1244
1252
|
) : null;
|
|
1245
1253
|
}
|
|
1246
|
-
|
|
1247
|
-
const
|
|
1254
|
+
Do.displayName = "Toast";
|
|
1255
|
+
const Mo = ao(null);
|
|
1248
1256
|
function yt({ children: o }) {
|
|
1249
|
-
const [r, n] =
|
|
1257
|
+
const [r, n] = D(null), e = V((a) => {
|
|
1250
1258
|
n({ ...a, id: Date.now() });
|
|
1251
1259
|
}, []), l = lo(() => Object.assign((a) => e(a), {
|
|
1252
1260
|
success: (a, c) => e({ ...c, message: a, variant: "success" }),
|
|
@@ -1254,10 +1262,10 @@ function yt({ children: o }) {
|
|
|
1254
1262
|
warning: (a, c) => e({ ...c, message: a, variant: "warning" }),
|
|
1255
1263
|
info: (a, c) => e({ ...c, message: a, variant: "info" })
|
|
1256
1264
|
}), [e]);
|
|
1257
|
-
return /* @__PURE__ */
|
|
1265
|
+
return /* @__PURE__ */ k(Mo.Provider, { value: { toast: l }, children: [
|
|
1258
1266
|
o,
|
|
1259
1267
|
r && /* @__PURE__ */ s(
|
|
1260
|
-
|
|
1268
|
+
Do,
|
|
1261
1269
|
{
|
|
1262
1270
|
open: !0,
|
|
1263
1271
|
onClose: () => n(null),
|
|
@@ -1271,7 +1279,7 @@ function yt({ children: o }) {
|
|
|
1271
1279
|
] });
|
|
1272
1280
|
}
|
|
1273
1281
|
function ht() {
|
|
1274
|
-
const o = io(
|
|
1282
|
+
const o = io(Mo);
|
|
1275
1283
|
if (!o)
|
|
1276
1284
|
throw new Error("useToast must be used within a ToastProvider");
|
|
1277
1285
|
return o;
|
|
@@ -1316,7 +1324,7 @@ function ln({
|
|
|
1316
1324
|
required: e,
|
|
1317
1325
|
children: l
|
|
1318
1326
|
}) {
|
|
1319
|
-
const a = A(), c = `${a}-hint`, d = !!(r || n), p = typeof r == "string" ? r : void 0,
|
|
1327
|
+
const a = A(), c = `${a}-hint`, d = !!(r || n), p = typeof r == "string" ? r : void 0, g = po.isValidElement(l) ? po.cloneElement(
|
|
1320
1328
|
l,
|
|
1321
1329
|
{
|
|
1322
1330
|
id: a,
|
|
@@ -1324,12 +1332,12 @@ function ln({
|
|
|
1324
1332
|
...r && { "aria-invalid": !0 }
|
|
1325
1333
|
}
|
|
1326
1334
|
) : l;
|
|
1327
|
-
return /* @__PURE__ */
|
|
1328
|
-
o && /* @__PURE__ */
|
|
1335
|
+
return /* @__PURE__ */ k(nn, { children: [
|
|
1336
|
+
o && /* @__PURE__ */ k(tn, { htmlFor: a, children: [
|
|
1329
1337
|
o,
|
|
1330
1338
|
e && /* @__PURE__ */ s(sn, { "aria-hidden": "true", children: " *" })
|
|
1331
1339
|
] }),
|
|
1332
|
-
|
|
1340
|
+
g,
|
|
1333
1341
|
d && /* @__PURE__ */ s(en, { id: c, $error: !!r, children: p ?? n })
|
|
1334
1342
|
] });
|
|
1335
1343
|
}
|
|
@@ -1340,83 +1348,83 @@ function wt({
|
|
|
1340
1348
|
onSubmit: n,
|
|
1341
1349
|
onError: e
|
|
1342
1350
|
}) {
|
|
1343
|
-
const [l, a] =
|
|
1351
|
+
const [l, a] = D(o), [c, d] = D(
|
|
1344
1352
|
{}
|
|
1345
|
-
), [p,
|
|
1346
|
-
|
|
1347
|
-
const
|
|
1348
|
-
(
|
|
1353
|
+
), [p, g] = D({}), [b, h] = D(!1), y = U(l);
|
|
1354
|
+
y.current = l;
|
|
1355
|
+
const $ = V(
|
|
1356
|
+
(z) => {
|
|
1349
1357
|
if (!r)
|
|
1350
1358
|
return {};
|
|
1351
|
-
const
|
|
1359
|
+
const w = r(z);
|
|
1352
1360
|
return Object.fromEntries(
|
|
1353
|
-
Object.entries(
|
|
1361
|
+
Object.entries(w).filter(([, I]) => I !== void 0)
|
|
1354
1362
|
);
|
|
1355
1363
|
},
|
|
1356
1364
|
[r]
|
|
1357
|
-
), x =
|
|
1365
|
+
), x = U(p);
|
|
1358
1366
|
x.current = p;
|
|
1359
|
-
const
|
|
1360
|
-
(
|
|
1361
|
-
const { name:
|
|
1362
|
-
process.env.NODE_ENV !== "production" && !
|
|
1367
|
+
const v = V(
|
|
1368
|
+
(z) => {
|
|
1369
|
+
const { name: w, value: I } = z.target;
|
|
1370
|
+
process.env.NODE_ENV !== "production" && !w && console.warn(
|
|
1363
1371
|
"[useForm] handleChange: field is missing a `name` attribute — value will not be tracked."
|
|
1364
1372
|
);
|
|
1365
|
-
const W = { ...
|
|
1366
|
-
a(W), x.current[
|
|
1373
|
+
const W = { ...y.current, [w]: I };
|
|
1374
|
+
a(W), x.current[w] && d($(W));
|
|
1367
1375
|
},
|
|
1368
|
-
[
|
|
1369
|
-
),
|
|
1370
|
-
(
|
|
1371
|
-
const { name:
|
|
1372
|
-
process.env.NODE_ENV !== "production" && !
|
|
1376
|
+
[$]
|
|
1377
|
+
), C = V(
|
|
1378
|
+
(z) => {
|
|
1379
|
+
const { name: w } = z.target;
|
|
1380
|
+
process.env.NODE_ENV !== "production" && !w && console.warn(
|
|
1373
1381
|
"[useForm] handleBlur: field is missing a `name` attribute — touched state will not be tracked."
|
|
1374
|
-
),
|
|
1382
|
+
), g((I) => ({ ...I, [w]: !0 })), d($(y.current));
|
|
1375
1383
|
},
|
|
1376
|
-
[
|
|
1377
|
-
),
|
|
1378
|
-
(
|
|
1379
|
-
|
|
1380
|
-
const
|
|
1381
|
-
(
|
|
1384
|
+
[$]
|
|
1385
|
+
), M = V(
|
|
1386
|
+
(z) => {
|
|
1387
|
+
z?.preventDefault();
|
|
1388
|
+
const w = Object.keys(y.current).reduce(
|
|
1389
|
+
(O, P) => ({ ...O, [P]: !0 }),
|
|
1382
1390
|
{}
|
|
1383
1391
|
);
|
|
1384
|
-
|
|
1385
|
-
const
|
|
1386
|
-
if (d(
|
|
1387
|
-
e?.(
|
|
1392
|
+
g(w);
|
|
1393
|
+
const I = $(y.current);
|
|
1394
|
+
if (d(I), Object.keys(I).length > 0) {
|
|
1395
|
+
e?.(I);
|
|
1388
1396
|
return;
|
|
1389
1397
|
}
|
|
1390
1398
|
(async () => {
|
|
1391
|
-
|
|
1399
|
+
h(!0);
|
|
1392
1400
|
try {
|
|
1393
|
-
await n?.(
|
|
1401
|
+
await n?.(y.current);
|
|
1394
1402
|
} finally {
|
|
1395
|
-
|
|
1403
|
+
h(!1);
|
|
1396
1404
|
}
|
|
1397
1405
|
})();
|
|
1398
1406
|
},
|
|
1399
|
-
[
|
|
1400
|
-
),
|
|
1401
|
-
a((
|
|
1402
|
-
}, []),
|
|
1403
|
-
(
|
|
1404
|
-
a(
|
|
1407
|
+
[$, n, e]
|
|
1408
|
+
), f = V((z, w) => {
|
|
1409
|
+
a((I) => ({ ...I, [z]: w }));
|
|
1410
|
+
}, []), T = V(
|
|
1411
|
+
(z) => {
|
|
1412
|
+
a(z ?? o), d({}), g({}), h(!1);
|
|
1405
1413
|
},
|
|
1406
1414
|
[o]
|
|
1407
|
-
),
|
|
1408
|
-
Object.entries(c).filter(([
|
|
1415
|
+
), S = Object.fromEntries(
|
|
1416
|
+
Object.entries(c).filter(([z]) => p[z])
|
|
1409
1417
|
);
|
|
1410
1418
|
return {
|
|
1411
1419
|
values: l,
|
|
1412
|
-
errors:
|
|
1420
|
+
errors: S,
|
|
1413
1421
|
touched: p,
|
|
1414
|
-
handleChange:
|
|
1415
|
-
handleBlur:
|
|
1416
|
-
handleSubmit:
|
|
1417
|
-
setFieldValue:
|
|
1418
|
-
reset:
|
|
1419
|
-
isSubmitting:
|
|
1422
|
+
handleChange: v,
|
|
1423
|
+
handleBlur: C,
|
|
1424
|
+
handleSubmit: M,
|
|
1425
|
+
setFieldValue: f,
|
|
1426
|
+
reset: T,
|
|
1427
|
+
isSubmitting: b
|
|
1420
1428
|
};
|
|
1421
1429
|
}
|
|
1422
1430
|
const cn = i.div`
|
|
@@ -1510,24 +1518,24 @@ function wn({
|
|
|
1510
1518
|
headerActions: c,
|
|
1511
1519
|
accentColor: d
|
|
1512
1520
|
}) {
|
|
1513
|
-
const [p,
|
|
1514
|
-
return /* @__PURE__ */
|
|
1515
|
-
/* @__PURE__ */
|
|
1521
|
+
const [p, g] = D(n), b = A(), h = e !== void 0, y = h ? e : p;
|
|
1522
|
+
return /* @__PURE__ */ k(cn, { $accentColor: d, children: [
|
|
1523
|
+
/* @__PURE__ */ k(
|
|
1516
1524
|
dn,
|
|
1517
1525
|
{
|
|
1518
1526
|
type: "button",
|
|
1519
|
-
$open:
|
|
1527
|
+
$open: y,
|
|
1520
1528
|
$accentColor: d,
|
|
1521
|
-
"aria-expanded":
|
|
1522
|
-
"aria-controls":
|
|
1529
|
+
"aria-expanded": y,
|
|
1530
|
+
"aria-controls": b,
|
|
1523
1531
|
onClick: () => {
|
|
1524
|
-
const x = !
|
|
1525
|
-
|
|
1532
|
+
const x = !y;
|
|
1533
|
+
h || g(x), l?.(x);
|
|
1526
1534
|
},
|
|
1527
1535
|
children: [
|
|
1528
|
-
/* @__PURE__ */
|
|
1536
|
+
/* @__PURE__ */ k(un, { children: [
|
|
1529
1537
|
/* @__PURE__ */ s(pn, { children: o }),
|
|
1530
|
-
(a || c) && /* @__PURE__ */
|
|
1538
|
+
(a || c) && /* @__PURE__ */ k($n, { children: [
|
|
1531
1539
|
a && /* @__PURE__ */ s(fn, { children: a }),
|
|
1532
1540
|
c && /* @__PURE__ */ s(gn, { onClick: (x) => x.stopPropagation(), children: c })
|
|
1533
1541
|
] })
|
|
@@ -1535,7 +1543,7 @@ function wn({
|
|
|
1535
1543
|
/* @__PURE__ */ s(
|
|
1536
1544
|
bn,
|
|
1537
1545
|
{
|
|
1538
|
-
$open:
|
|
1546
|
+
$open: y,
|
|
1539
1547
|
$accentColor: d,
|
|
1540
1548
|
"aria-hidden": "true",
|
|
1541
1549
|
children: /* @__PURE__ */ s(zo, { size: 18, strokeWidth: 2.5 })
|
|
@@ -1544,11 +1552,11 @@ function wn({
|
|
|
1544
1552
|
]
|
|
1545
1553
|
}
|
|
1546
1554
|
),
|
|
1547
|
-
/* @__PURE__ */ s(xn, { $open:
|
|
1555
|
+
/* @__PURE__ */ s(xn, { $open: y, children: /* @__PURE__ */ s(yn, { id: b, role: "region", "aria-label": o, children: /* @__PURE__ */ s(hn, { children: r }) }) })
|
|
1548
1556
|
] });
|
|
1549
1557
|
}
|
|
1550
1558
|
wn.displayName = "CollapsibleCard";
|
|
1551
|
-
const mn =
|
|
1559
|
+
const mn = F`
|
|
1552
1560
|
to { transform: rotate(360deg); }
|
|
1553
1561
|
`, vn = {
|
|
1554
1562
|
sm: "16px",
|
|
@@ -1600,19 +1608,19 @@ function Tn({
|
|
|
1600
1608
|
defaultSort: n,
|
|
1601
1609
|
onSortChange: e
|
|
1602
1610
|
}) {
|
|
1603
|
-
const l = r !== void 0, [a, c] =
|
|
1611
|
+
const l = r !== void 0, [a, c] = D(
|
|
1604
1612
|
n ?? null
|
|
1605
|
-
), d = l ? r ?? null : a, p = (
|
|
1606
|
-
const
|
|
1607
|
-
return l || c(
|
|
1608
|
-
},
|
|
1609
|
-
const
|
|
1613
|
+
), d = l ? r ?? null : a, p = (b) => {
|
|
1614
|
+
const h = zn(d, b);
|
|
1615
|
+
return l || c(h), e?.(h), h;
|
|
1616
|
+
}, g = lo(() => l || !d ? o : [...o].sort((b, h) => {
|
|
1617
|
+
const y = b[d.key], $ = h[d.key], x = y < $ ? -1 : y > $ ? 1 : 0;
|
|
1610
1618
|
return d.direction === "asc" ? x : -x;
|
|
1611
1619
|
}), [o, d, l]);
|
|
1612
|
-
return { activeSort: d, sortedData:
|
|
1620
|
+
return { activeSort: d, sortedData: g, handleSort: p };
|
|
1613
1621
|
}
|
|
1614
1622
|
const In = 7, xo = 3, yo = 1;
|
|
1615
|
-
function
|
|
1623
|
+
function Dn(o, r) {
|
|
1616
1624
|
if (r <= In)
|
|
1617
1625
|
return Array.from({ length: r }, (e, l) => l + 1);
|
|
1618
1626
|
const n = [1];
|
|
@@ -1621,7 +1629,7 @@ function Mn(o, r) {
|
|
|
1621
1629
|
n.push(e);
|
|
1622
1630
|
return o < r - xo + 1 && n.push("..."), n.push(r), n;
|
|
1623
1631
|
}
|
|
1624
|
-
function
|
|
1632
|
+
function Mn({
|
|
1625
1633
|
data: o,
|
|
1626
1634
|
pageSize: r,
|
|
1627
1635
|
page: n,
|
|
@@ -1629,15 +1637,15 @@ function Dn({
|
|
|
1629
1637
|
totalRows: l,
|
|
1630
1638
|
onPageChange: a
|
|
1631
1639
|
}) {
|
|
1632
|
-
const c = n !== void 0, [d, p] =
|
|
1633
|
-
c || p(
|
|
1634
|
-
},
|
|
1635
|
-
if (!r ||
|
|
1640
|
+
const c = n !== void 0, [d, p] = D(e ?? 1), g = c ? n : d, b = (v) => {
|
|
1641
|
+
c || p(v), a?.(v);
|
|
1642
|
+
}, h = c || l !== void 0, y = l ?? o.length, $ = r ? Math.max(1, Math.ceil(y / r)) : 1, x = lo(() => {
|
|
1643
|
+
if (!r || h)
|
|
1636
1644
|
return o;
|
|
1637
|
-
const
|
|
1638
|
-
return o.slice(
|
|
1639
|
-
}, [o, r,
|
|
1640
|
-
return { activePage:
|
|
1645
|
+
const v = (g - 1) * r;
|
|
1646
|
+
return o.slice(v, v + r);
|
|
1647
|
+
}, [o, r, g, h]);
|
|
1648
|
+
return { activePage: g, totalPages: $, displayData: x, handlePageChange: b };
|
|
1641
1649
|
}
|
|
1642
1650
|
const Wo = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg" ? `${r.spacing[3]} ${r.spacing[4]}` : `${r.spacing[2]} ${r.spacing[3]}`, Wn = i.div`
|
|
1643
1651
|
width: 100%;
|
|
@@ -1793,7 +1801,7 @@ const Wo = (o, r) => o === "sm" ? `${r.spacing[1]} ${r.spacing[2]}` : o === "lg"
|
|
|
1793
1801
|
padding: ${({ theme: o }) => `${o.spacing[4]} ${o.spacing[3]}`};
|
|
1794
1802
|
font-size: ${({ theme: o }) => o.fontSizes.sm};
|
|
1795
1803
|
border-bottom: none;
|
|
1796
|
-
`, _n =
|
|
1804
|
+
`, _n = F`
|
|
1797
1805
|
0% { background-position: -400px 0; }
|
|
1798
1806
|
100% { background-position: 400px 0; }
|
|
1799
1807
|
`, jn = i(Oo)``, An = i.div`
|
|
@@ -1877,88 +1885,88 @@ function Un({
|
|
|
1877
1885
|
stickyHeader: c,
|
|
1878
1886
|
caption: d,
|
|
1879
1887
|
emptyMessage: p = "No data",
|
|
1880
|
-
loading:
|
|
1881
|
-
sort:
|
|
1882
|
-
defaultSort:
|
|
1883
|
-
onSortChange:
|
|
1884
|
-
pageSize:
|
|
1888
|
+
loading: g,
|
|
1889
|
+
sort: b,
|
|
1890
|
+
defaultSort: h,
|
|
1891
|
+
onSortChange: y,
|
|
1892
|
+
pageSize: $,
|
|
1885
1893
|
page: x,
|
|
1886
|
-
defaultPage:
|
|
1887
|
-
totalRows:
|
|
1888
|
-
onPageChange:
|
|
1889
|
-
onChange:
|
|
1890
|
-
onRowClick:
|
|
1891
|
-
borderColor:
|
|
1892
|
-
headerColor:
|
|
1893
|
-
rowColor:
|
|
1894
|
-
stripeColor:
|
|
1894
|
+
defaultPage: v,
|
|
1895
|
+
totalRows: C,
|
|
1896
|
+
onPageChange: M,
|
|
1897
|
+
onChange: f,
|
|
1898
|
+
onRowClick: T,
|
|
1899
|
+
borderColor: S,
|
|
1900
|
+
headerColor: z,
|
|
1901
|
+
rowColor: w,
|
|
1902
|
+
stripeColor: I,
|
|
1895
1903
|
className: W,
|
|
1896
|
-
style:
|
|
1904
|
+
style: O
|
|
1897
1905
|
}) {
|
|
1898
1906
|
const {
|
|
1899
|
-
activeSort:
|
|
1900
|
-
sortedData:
|
|
1901
|
-
handleSort:
|
|
1907
|
+
activeSort: P,
|
|
1908
|
+
sortedData: K,
|
|
1909
|
+
handleSort: N
|
|
1902
1910
|
} = Tn({
|
|
1903
1911
|
data: r,
|
|
1904
|
-
sort:
|
|
1905
|
-
defaultSort:
|
|
1906
|
-
onSortChange:
|
|
1912
|
+
sort: b,
|
|
1913
|
+
defaultSort: h,
|
|
1914
|
+
onSortChange: y
|
|
1907
1915
|
}), {
|
|
1908
|
-
activePage:
|
|
1909
|
-
totalPages:
|
|
1916
|
+
activePage: E,
|
|
1917
|
+
totalPages: q,
|
|
1910
1918
|
displayData: u,
|
|
1911
1919
|
handlePageChange: B
|
|
1912
|
-
} =
|
|
1913
|
-
data:
|
|
1914
|
-
pageSize:
|
|
1920
|
+
} = Mn({
|
|
1921
|
+
data: K,
|
|
1922
|
+
pageSize: $,
|
|
1915
1923
|
page: x,
|
|
1916
|
-
defaultPage:
|
|
1917
|
-
totalRows:
|
|
1918
|
-
onPageChange:
|
|
1919
|
-
}), R = (
|
|
1920
|
-
const
|
|
1921
|
-
|
|
1922
|
-
}, Y = (
|
|
1923
|
-
B(
|
|
1924
|
-
}, Z = (
|
|
1925
|
-
return /* @__PURE__ */
|
|
1924
|
+
defaultPage: v,
|
|
1925
|
+
totalRows: C,
|
|
1926
|
+
onPageChange: M
|
|
1927
|
+
}), R = (m) => {
|
|
1928
|
+
const L = N(m);
|
|
1929
|
+
f?.({ sort: L, page: E });
|
|
1930
|
+
}, Y = (m) => {
|
|
1931
|
+
B(m), f?.({ sort: P, page: m });
|
|
1932
|
+
}, Z = (m, L) => String(n ? m[n] : L), Q = !g && u.length === 0, Eo = $ ?? Yn;
|
|
1933
|
+
return /* @__PURE__ */ k(
|
|
1926
1934
|
Wn,
|
|
1927
1935
|
{
|
|
1928
|
-
$borderColor:
|
|
1936
|
+
$borderColor: S,
|
|
1929
1937
|
$stickyHeader: c,
|
|
1930
1938
|
className: W,
|
|
1931
|
-
style:
|
|
1939
|
+
style: O,
|
|
1932
1940
|
children: [
|
|
1933
|
-
/* @__PURE__ */
|
|
1941
|
+
/* @__PURE__ */ k(On, { $size: e, children: [
|
|
1934
1942
|
d && /* @__PURE__ */ s("caption", { children: d }),
|
|
1935
1943
|
/* @__PURE__ */ s(
|
|
1936
1944
|
Pn,
|
|
1937
1945
|
{
|
|
1938
|
-
$headerColor:
|
|
1939
|
-
$borderColor:
|
|
1946
|
+
$headerColor: z,
|
|
1947
|
+
$borderColor: S,
|
|
1940
1948
|
$stickyHeader: c,
|
|
1941
|
-
children: /* @__PURE__ */ s(X, { children: o.map((
|
|
1949
|
+
children: /* @__PURE__ */ s(X, { children: o.map((m) => /* @__PURE__ */ s(
|
|
1942
1950
|
Ln,
|
|
1943
1951
|
{
|
|
1944
1952
|
$size: e,
|
|
1945
1953
|
$bordered: a,
|
|
1946
1954
|
scope: "col",
|
|
1947
|
-
style:
|
|
1948
|
-
children:
|
|
1955
|
+
style: m.width ? { width: m.width } : void 0,
|
|
1956
|
+
children: m.sortable ? /* @__PURE__ */ k(
|
|
1949
1957
|
Fn,
|
|
1950
1958
|
{
|
|
1951
1959
|
type: "button",
|
|
1952
|
-
onClick: () => R(
|
|
1953
|
-
"aria-label": `Sort by ${
|
|
1960
|
+
onClick: () => R(m.key),
|
|
1961
|
+
"aria-label": `Sort by ${m.header}${P?.key === m.key ? `, ${P.direction}ending` : ""}`,
|
|
1954
1962
|
children: [
|
|
1955
|
-
|
|
1956
|
-
/* @__PURE__ */ s(Bn, { "aria-hidden": "true", children: Hn(
|
|
1963
|
+
m.header,
|
|
1964
|
+
/* @__PURE__ */ s(Bn, { "aria-hidden": "true", children: Hn(P, m.key) })
|
|
1957
1965
|
]
|
|
1958
1966
|
}
|
|
1959
|
-
) :
|
|
1967
|
+
) : m.header
|
|
1960
1968
|
},
|
|
1961
|
-
|
|
1969
|
+
m.key
|
|
1962
1970
|
)) })
|
|
1963
1971
|
}
|
|
1964
1972
|
),
|
|
@@ -1966,77 +1974,77 @@ function Un({
|
|
|
1966
1974
|
Nn,
|
|
1967
1975
|
{
|
|
1968
1976
|
$striped: l,
|
|
1969
|
-
$rowColor:
|
|
1970
|
-
$stripeColor:
|
|
1971
|
-
children:
|
|
1977
|
+
$rowColor: w,
|
|
1978
|
+
$stripeColor: I,
|
|
1979
|
+
children: g ? Array.from({ length: Eo }).map((m, L) => /* @__PURE__ */ s(X, { children: o.map((uo) => /* @__PURE__ */ s(
|
|
1972
1980
|
jn,
|
|
1973
1981
|
{
|
|
1974
1982
|
$size: e,
|
|
1975
1983
|
$bordered: a,
|
|
1976
|
-
$borderColor:
|
|
1984
|
+
$borderColor: S,
|
|
1977
1985
|
children: /* @__PURE__ */ s(An, {})
|
|
1978
1986
|
},
|
|
1979
1987
|
uo.key
|
|
1980
|
-
)) },
|
|
1981
|
-
|
|
1988
|
+
)) }, L)) : Q ? /* @__PURE__ */ s("tr", { children: /* @__PURE__ */ s(Vn, { colSpan: o.length, children: p }) }) : u.map((m, L) => /* @__PURE__ */ s(
|
|
1989
|
+
T ? En : X,
|
|
1982
1990
|
{
|
|
1983
|
-
onClick:
|
|
1984
|
-
$accentColor:
|
|
1985
|
-
children: o.map((
|
|
1991
|
+
onClick: T ? () => T(m) : void 0,
|
|
1992
|
+
$accentColor: T ? S : void 0,
|
|
1993
|
+
children: o.map((G) => /* @__PURE__ */ s(
|
|
1986
1994
|
Oo,
|
|
1987
1995
|
{
|
|
1988
1996
|
$size: e,
|
|
1989
1997
|
$bordered: a,
|
|
1990
|
-
$borderColor:
|
|
1991
|
-
children:
|
|
1998
|
+
$borderColor: S,
|
|
1999
|
+
children: G.render ? G.render(m[G.key], m, L) : String(m[G.key] ?? "") || " "
|
|
1992
2000
|
},
|
|
1993
|
-
|
|
2001
|
+
G.key
|
|
1994
2002
|
))
|
|
1995
2003
|
},
|
|
1996
|
-
Z(
|
|
2004
|
+
Z(m, L)
|
|
1997
2005
|
))
|
|
1998
2006
|
}
|
|
1999
2007
|
)
|
|
2000
2008
|
] }),
|
|
2001
|
-
|
|
2009
|
+
$ && q > 1 && /* @__PURE__ */ k(Rn, { children: [
|
|
2002
2010
|
/* @__PURE__ */ s(
|
|
2003
2011
|
no,
|
|
2004
2012
|
{
|
|
2005
2013
|
type: "button",
|
|
2006
|
-
onClick: () => Y(
|
|
2007
|
-
disabled:
|
|
2014
|
+
onClick: () => Y(E - 1),
|
|
2015
|
+
disabled: E <= 1,
|
|
2008
2016
|
"aria-label": "Previous page",
|
|
2009
2017
|
children: "←"
|
|
2010
2018
|
}
|
|
2011
2019
|
),
|
|
2012
|
-
|
|
2013
|
-
(
|
|
2020
|
+
Dn(E, q).map(
|
|
2021
|
+
(m, L) => m === "..." ? /* @__PURE__ */ s(
|
|
2014
2022
|
"span",
|
|
2015
2023
|
{
|
|
2016
2024
|
"aria-hidden": "true",
|
|
2017
2025
|
style: { padding: "0 4px" },
|
|
2018
2026
|
children: "…"
|
|
2019
2027
|
},
|
|
2020
|
-
`e${
|
|
2028
|
+
`e${L}`
|
|
2021
2029
|
) : /* @__PURE__ */ s(
|
|
2022
2030
|
no,
|
|
2023
2031
|
{
|
|
2024
2032
|
type: "button",
|
|
2025
|
-
$active:
|
|
2026
|
-
onClick: () => Y(
|
|
2027
|
-
"aria-label": `Page ${
|
|
2028
|
-
"aria-current":
|
|
2029
|
-
children:
|
|
2033
|
+
$active: m === E,
|
|
2034
|
+
onClick: () => Y(m),
|
|
2035
|
+
"aria-label": `Page ${m}`,
|
|
2036
|
+
"aria-current": m === E ? "page" : void 0,
|
|
2037
|
+
children: m
|
|
2030
2038
|
},
|
|
2031
|
-
|
|
2039
|
+
m
|
|
2032
2040
|
)
|
|
2033
2041
|
),
|
|
2034
2042
|
/* @__PURE__ */ s(
|
|
2035
2043
|
no,
|
|
2036
2044
|
{
|
|
2037
2045
|
type: "button",
|
|
2038
|
-
onClick: () => Y(
|
|
2039
|
-
disabled:
|
|
2046
|
+
onClick: () => Y(E + 1),
|
|
2047
|
+
disabled: E >= q,
|
|
2040
2048
|
"aria-label": "Next page",
|
|
2041
2049
|
children: "→"
|
|
2042
2050
|
}
|
|
@@ -2051,7 +2059,7 @@ function mt({
|
|
|
2051
2059
|
defaultSort: o,
|
|
2052
2060
|
defaultPage: r = 1
|
|
2053
2061
|
} = {}) {
|
|
2054
|
-
const [n, e] =
|
|
2062
|
+
const [n, e] = D(o ?? null), [l, a] = D(r);
|
|
2055
2063
|
return { sort: n, page: l, onSortChange: (p) => {
|
|
2056
2064
|
e(p), a(1);
|
|
2057
2065
|
}, onPageChange: (p) => {
|
|
@@ -2123,7 +2131,7 @@ function Po({
|
|
|
2123
2131
|
title: r,
|
|
2124
2132
|
size: c,
|
|
2125
2133
|
closeOnBackdrop: !1,
|
|
2126
|
-
footer: /* @__PURE__ */
|
|
2134
|
+
footer: /* @__PURE__ */ k(Lo, { children: [
|
|
2127
2135
|
/* @__PURE__ */ s(so, { variant: "outline", onClick: p, children: l }),
|
|
2128
2136
|
a === "danger" ? /* @__PURE__ */ s(qn, { type: "button", onClick: d, children: e }) : /* @__PURE__ */ s(so, { variant: "primary", onClick: d, children: e })
|
|
2129
2137
|
] }),
|
|
@@ -2134,14 +2142,14 @@ function Po({
|
|
|
2134
2142
|
Po.displayName = "ConfirmDialog";
|
|
2135
2143
|
const No = ao(null);
|
|
2136
2144
|
function vt({ children: o }) {
|
|
2137
|
-
const [r, n] =
|
|
2145
|
+
const [r, n] = D(null), e = V((c) => new Promise((d) => {
|
|
2138
2146
|
n({ ...c, resolve: d });
|
|
2139
2147
|
}), []), l = () => {
|
|
2140
2148
|
r?.resolve(!0), n(null);
|
|
2141
2149
|
}, a = () => {
|
|
2142
2150
|
r?.resolve(!1), n(null);
|
|
2143
2151
|
};
|
|
2144
|
-
return /* @__PURE__ */
|
|
2152
|
+
return /* @__PURE__ */ k(No.Provider, { value: { confirm: e }, children: [
|
|
2145
2153
|
o,
|
|
2146
2154
|
r && /* @__PURE__ */ s(
|
|
2147
2155
|
Po,
|
|
@@ -2430,65 +2438,65 @@ function pt({
|
|
|
2430
2438
|
minDate: c,
|
|
2431
2439
|
maxDate: d,
|
|
2432
2440
|
formatDate: p,
|
|
2433
|
-
id:
|
|
2434
|
-
error:
|
|
2441
|
+
id: g,
|
|
2442
|
+
error: b
|
|
2435
2443
|
}) {
|
|
2436
|
-
const
|
|
2437
|
-
() => (o ??
|
|
2438
|
-
), [
|
|
2444
|
+
const h = A(), y = g ?? h, $ = /* @__PURE__ */ new Date(), [x, v] = D(!1), [C, M] = D(
|
|
2445
|
+
() => (o ?? $).getFullYear()
|
|
2446
|
+
), [f, T] = D(() => (o ?? $).getMonth()), S = U(null);
|
|
2439
2447
|
j(() => {
|
|
2440
2448
|
if (!x) return;
|
|
2441
2449
|
const u = (B) => {
|
|
2442
|
-
|
|
2450
|
+
S.current && !S.current.contains(B.target) && v(!1);
|
|
2443
2451
|
};
|
|
2444
2452
|
return document.addEventListener("mousedown", u), () => document.removeEventListener("mousedown", u);
|
|
2445
2453
|
}, [x]), j(() => {
|
|
2446
|
-
o && (
|
|
2454
|
+
o && (M(o.getFullYear()), T(o.getMonth()));
|
|
2447
2455
|
}, [o]);
|
|
2448
|
-
const
|
|
2449
|
-
r?.(new Date(
|
|
2450
|
-
},
|
|
2456
|
+
const z = o ? p ? p(o) : dt(o) : "", w = (u) => {
|
|
2457
|
+
r?.(new Date(C, f, u)), v(!1);
|
|
2458
|
+
}, I = (u) => {
|
|
2451
2459
|
u.stopPropagation(), r?.(null);
|
|
2452
2460
|
}, W = () => {
|
|
2453
|
-
|
|
2454
|
-
},
|
|
2455
|
-
|
|
2456
|
-
},
|
|
2457
|
-
|
|
2458
|
-
|
|
2461
|
+
f === 0 ? (T(11), M((u) => u - 1)) : T((u) => u - 1);
|
|
2462
|
+
}, O = () => {
|
|
2463
|
+
f === 11 ? (T(0), M((u) => u + 1)) : T((u) => u + 1);
|
|
2464
|
+
}, P = mo(C, f), K = lt(C, f), N = [], E = mo(
|
|
2465
|
+
f === 0 ? C - 1 : C,
|
|
2466
|
+
f === 0 ? 11 : f - 1
|
|
2459
2467
|
);
|
|
2460
|
-
for (let u =
|
|
2461
|
-
|
|
2462
|
-
for (let u = 1; u <=
|
|
2463
|
-
|
|
2464
|
-
const
|
|
2465
|
-
for (let u = 1; u <=
|
|
2466
|
-
|
|
2467
|
-
return /* @__PURE__ */
|
|
2468
|
-
/* @__PURE__ */
|
|
2468
|
+
for (let u = K - 1; u >= 0; u--)
|
|
2469
|
+
N.push({ day: E - u, currentMonth: !1 });
|
|
2470
|
+
for (let u = 1; u <= P; u++)
|
|
2471
|
+
N.push({ day: u, currentMonth: !0 });
|
|
2472
|
+
const q = 42 - N.length;
|
|
2473
|
+
for (let u = 1; u <= q; u++)
|
|
2474
|
+
N.push({ day: u, currentMonth: !1 });
|
|
2475
|
+
return /* @__PURE__ */ k(Gn, { ref: S, children: [
|
|
2476
|
+
/* @__PURE__ */ k(
|
|
2469
2477
|
Jn,
|
|
2470
2478
|
{
|
|
2471
|
-
id:
|
|
2479
|
+
id: y,
|
|
2472
2480
|
$size: e,
|
|
2473
|
-
$error: !!
|
|
2481
|
+
$error: !!b,
|
|
2474
2482
|
$disabled: l,
|
|
2475
2483
|
role: "combobox",
|
|
2476
2484
|
"aria-haspopup": "true",
|
|
2477
2485
|
"aria-expanded": x,
|
|
2478
2486
|
tabIndex: l ? -1 : 0,
|
|
2479
2487
|
onClick: () => {
|
|
2480
|
-
l ||
|
|
2488
|
+
l || v((u) => !u);
|
|
2481
2489
|
},
|
|
2482
2490
|
onKeyDown: (u) => {
|
|
2483
|
-
(u.key === "Enter" || u.key === " ") && !l && (u.preventDefault(),
|
|
2491
|
+
(u.key === "Enter" || u.key === " ") && !l && (u.preventDefault(), v((B) => !B)), u.key === "Escape" && v(!1);
|
|
2484
2492
|
},
|
|
2485
2493
|
children: [
|
|
2486
|
-
/* @__PURE__ */ s(Xn, { $hasValue: !!o, children:
|
|
2494
|
+
/* @__PURE__ */ s(Xn, { $hasValue: !!o, children: z || n }),
|
|
2487
2495
|
a && o ? /* @__PURE__ */ s(
|
|
2488
2496
|
Qn,
|
|
2489
2497
|
{
|
|
2490
2498
|
type: "button",
|
|
2491
|
-
onClick:
|
|
2499
|
+
onClick: I,
|
|
2492
2500
|
"aria-label": "Clear date",
|
|
2493
2501
|
children: /* @__PURE__ */ s(co, { size: 14 })
|
|
2494
2502
|
}
|
|
@@ -2496,9 +2504,9 @@ function pt({
|
|
|
2496
2504
|
]
|
|
2497
2505
|
}
|
|
2498
2506
|
),
|
|
2499
|
-
typeof
|
|
2500
|
-
x && /* @__PURE__ */
|
|
2501
|
-
/* @__PURE__ */
|
|
2507
|
+
typeof b == "string" && /* @__PURE__ */ s(ot, { $error: !0, children: b }),
|
|
2508
|
+
x && /* @__PURE__ */ k(rt, { role: "dialog", "aria-label": "Calendar", children: [
|
|
2509
|
+
/* @__PURE__ */ k(nt, { children: [
|
|
2502
2510
|
/* @__PURE__ */ s(
|
|
2503
2511
|
ho,
|
|
2504
2512
|
{
|
|
@@ -2508,24 +2516,24 @@ function pt({
|
|
|
2508
2516
|
children: /* @__PURE__ */ s(xr, { size: 16 })
|
|
2509
2517
|
}
|
|
2510
2518
|
),
|
|
2511
|
-
/* @__PURE__ */
|
|
2512
|
-
it[
|
|
2519
|
+
/* @__PURE__ */ k(tt, { children: [
|
|
2520
|
+
it[f],
|
|
2513
2521
|
" ",
|
|
2514
|
-
|
|
2522
|
+
C
|
|
2515
2523
|
] }),
|
|
2516
2524
|
/* @__PURE__ */ s(
|
|
2517
2525
|
ho,
|
|
2518
2526
|
{
|
|
2519
2527
|
type: "button",
|
|
2520
|
-
onClick:
|
|
2528
|
+
onClick: O,
|
|
2521
2529
|
"aria-label": "Next month",
|
|
2522
2530
|
children: /* @__PURE__ */ s(hr, { size: 16 })
|
|
2523
2531
|
}
|
|
2524
2532
|
)
|
|
2525
2533
|
] }),
|
|
2526
|
-
/* @__PURE__ */
|
|
2534
|
+
/* @__PURE__ */ k(st, { children: [
|
|
2527
2535
|
at.map((u) => /* @__PURE__ */ s(et, { children: u }, u)),
|
|
2528
|
-
|
|
2536
|
+
N.map((u, B) => {
|
|
2529
2537
|
if (!u.currentMonth)
|
|
2530
2538
|
return /* @__PURE__ */ s(
|
|
2531
2539
|
wo,
|
|
@@ -2540,7 +2548,7 @@ function pt({
|
|
|
2540
2548
|
},
|
|
2541
2549
|
B
|
|
2542
2550
|
);
|
|
2543
|
-
const R = new Date(
|
|
2551
|
+
const R = new Date(C, f, u.day), Y = o ? vo(R, o) : !1, Z = vo(R, $), Q = ct(R, c, d);
|
|
2544
2552
|
return /* @__PURE__ */ s(
|
|
2545
2553
|
wo,
|
|
2546
2554
|
{
|
|
@@ -2551,7 +2559,7 @@ function pt({
|
|
|
2551
2559
|
disabled: Q,
|
|
2552
2560
|
"aria-label": ut(R),
|
|
2553
2561
|
"aria-pressed": Y,
|
|
2554
|
-
onClick: () =>
|
|
2562
|
+
onClick: () => w(u.day),
|
|
2555
2563
|
children: u.day
|
|
2556
2564
|
},
|
|
2557
2565
|
B
|
|
@@ -2641,7 +2649,7 @@ export {
|
|
|
2641
2649
|
Po as ConfirmDialog,
|
|
2642
2650
|
vt as ConfirmProvider,
|
|
2643
2651
|
pt as DatePicker,
|
|
2644
|
-
|
|
2652
|
+
Mr as Editable,
|
|
2645
2653
|
Er as Field,
|
|
2646
2654
|
an as Form,
|
|
2647
2655
|
ln as FormField,
|
|
@@ -2654,7 +2662,7 @@ export {
|
|
|
2654
2662
|
Un as Table,
|
|
2655
2663
|
or as Textarea,
|
|
2656
2664
|
St as ThemeProvider,
|
|
2657
|
-
|
|
2665
|
+
Do as Toast,
|
|
2658
2666
|
yt as ToastProvider,
|
|
2659
2667
|
Ct as createNeoBrutalTheme,
|
|
2660
2668
|
eo as neoBrutalTheme,
|