blunt-ui 0.3.5 → 0.3.6
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 +22 -22
- package/dist/index.js +308 -306
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as s, jsxs as k, Fragment as Lo } from "react/jsx-runtime";
|
|
2
2
|
import i, { css as t, keyframes as F, ThemeProvider as Fo, createGlobalStyle as Bo } from "styled-components";
|
|
3
|
-
import po, { useId as
|
|
3
|
+
import po, { useId as R, useState as D, useContext as io, createContext as ao, forwardRef as ko, createElement as to, useRef as j, useEffect as A, useCallback as V, useMemo as lo } from "react";
|
|
4
4
|
import { createPortal as Co } from "react-dom";
|
|
5
|
-
const
|
|
5
|
+
const U = (o, r, n) => t`
|
|
6
6
|
background: ${r};
|
|
7
7
|
color: ${n};
|
|
8
8
|
border: ${o.brutalism.borderWidth} solid ${o.colors.neutral[900]};
|
|
@@ -31,32 +31,32 @@ const H = (o, r, n) => t`
|
|
|
31
31
|
})[o]}
|
|
32
32
|
|
|
33
33
|
${({ $variant: o, theme: r }) => r.brutalism ? {
|
|
34
|
-
primary:
|
|
34
|
+
primary: U(
|
|
35
35
|
r,
|
|
36
36
|
r.colors.primary[500],
|
|
37
37
|
r.colors.primary.contrast
|
|
38
38
|
),
|
|
39
|
-
neutral:
|
|
39
|
+
neutral: U(
|
|
40
40
|
r,
|
|
41
41
|
r.colors.neutral[200],
|
|
42
42
|
r.colors.neutral[900]
|
|
43
43
|
),
|
|
44
|
-
success:
|
|
44
|
+
success: U(
|
|
45
45
|
r,
|
|
46
46
|
r.colors.success[50],
|
|
47
47
|
r.colors.success[500]
|
|
48
48
|
),
|
|
49
|
-
error:
|
|
49
|
+
error: U(
|
|
50
50
|
r,
|
|
51
51
|
r.colors.error[50],
|
|
52
52
|
r.colors.error[500]
|
|
53
53
|
),
|
|
54
|
-
warning:
|
|
54
|
+
warning: U(
|
|
55
55
|
r,
|
|
56
56
|
r.colors.warning[50],
|
|
57
57
|
r.colors.warning[500]
|
|
58
58
|
),
|
|
59
|
-
info:
|
|
59
|
+
info: U(r, r.colors.info[50], r.colors.info[500])
|
|
60
60
|
}[o] : {
|
|
61
61
|
primary: t`
|
|
62
62
|
background: ${r.colors.primary[50]};
|
|
@@ -308,38 +308,38 @@ function qo({
|
|
|
308
308
|
error: c,
|
|
309
309
|
leftElement: d,
|
|
310
310
|
rightElement: p,
|
|
311
|
-
clearable:
|
|
312
|
-
onClear:
|
|
313
|
-
fullWidth:
|
|
314
|
-
id:
|
|
315
|
-
value:
|
|
316
|
-
defaultValue:
|
|
317
|
-
onChange:
|
|
318
|
-
...
|
|
311
|
+
clearable: $,
|
|
312
|
+
onClear: g,
|
|
313
|
+
fullWidth: w,
|
|
314
|
+
id: x,
|
|
315
|
+
value: f,
|
|
316
|
+
defaultValue: y,
|
|
317
|
+
onChange: h,
|
|
318
|
+
...z
|
|
319
319
|
}) {
|
|
320
|
-
const
|
|
321
|
-
|
|
320
|
+
const W = R(), v = x ?? W, b = `${v}-hint`, [C, I] = D(y ?? ""), S = f !== void 0, T = S ? f : C, M = typeof c == "string" ? c : void 0, P = !!(a || c), O = (N) => {
|
|
321
|
+
S || I(N.target.value), h?.(N);
|
|
322
322
|
}, K = () => {
|
|
323
|
-
|
|
323
|
+
S || I(""), g?.();
|
|
324
324
|
};
|
|
325
|
-
return /* @__PURE__ */ k(Ao, { $fullWidth:
|
|
326
|
-
l && /* @__PURE__ */ s(Ro, { htmlFor:
|
|
325
|
+
return /* @__PURE__ */ k(Ao, { $fullWidth: w, children: [
|
|
326
|
+
l && /* @__PURE__ */ s(Ro, { htmlFor: v, children: l }),
|
|
327
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: v,
|
|
333
333
|
ref: o,
|
|
334
334
|
type: r,
|
|
335
|
-
value:
|
|
336
|
-
onChange:
|
|
337
|
-
...
|
|
335
|
+
value: T,
|
|
336
|
+
onChange: O,
|
|
337
|
+
...z,
|
|
338
338
|
"aria-invalid": !!c,
|
|
339
|
-
"aria-describedby":
|
|
339
|
+
"aria-describedby": P ? b : void 0
|
|
340
340
|
}
|
|
341
341
|
),
|
|
342
|
-
|
|
342
|
+
$ && T && /* @__PURE__ */ s(
|
|
343
343
|
Ko,
|
|
344
344
|
{
|
|
345
345
|
type: "button",
|
|
@@ -350,7 +350,7 @@ function qo({
|
|
|
350
350
|
),
|
|
351
351
|
p && /* @__PURE__ */ s(fo, { children: p })
|
|
352
352
|
] }),
|
|
353
|
-
|
|
353
|
+
P && /* @__PURE__ */ s(Yo, { id: b, $error: !!c, children: M ?? 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: $,
|
|
441
|
+
onChange: g,
|
|
442
|
+
...w
|
|
443
443
|
}) {
|
|
444
|
-
const
|
|
444
|
+
const x = R(), f = d ?? x, y = `${f}-hint`, [h, z] = D($ ?? ""), W = p !== void 0, v = W ? p : h, b = typeof a == "string" ? a : void 0, C = !!(l || a);
|
|
445
445
|
return /* @__PURE__ */ k(Go, { $fullWidth: c, children: [
|
|
446
|
-
e && /* @__PURE__ */ s(Jo, { htmlFor:
|
|
446
|
+
e && /* @__PURE__ */ s(Jo, { htmlFor: f, 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: f,
|
|
451
451
|
ref: o,
|
|
452
|
-
value:
|
|
453
|
-
onChange: (
|
|
454
|
-
|
|
452
|
+
value: v,
|
|
453
|
+
onChange: (S) => {
|
|
454
|
+
W || z(S.target.value), g?.(S);
|
|
455
455
|
},
|
|
456
|
-
...
|
|
456
|
+
...w,
|
|
457
457
|
"aria-invalid": !!a,
|
|
458
|
-
"aria-describedby":
|
|
458
|
+
"aria-describedby": C ? y : void 0
|
|
459
459
|
}
|
|
460
460
|
) }),
|
|
461
|
-
|
|
461
|
+
C && /* @__PURE__ */ s(Xo, { id: y, $error: !!a, children: b ?? 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() ?? {},
|
|
494
|
+
size: $ = 24,
|
|
495
|
+
strokeWidth: g = 2,
|
|
496
|
+
absoluteStrokeWidth: w = !1,
|
|
497
|
+
color: x = "currentColor",
|
|
498
|
+
className: f = ""
|
|
499
|
+
} = er() ?? {}, y = e ?? w ? Number(n ?? g) * 24 / Number(r ?? $) : n ?? g;
|
|
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 ??
|
|
508
|
-
strokeWidth:
|
|
509
|
-
className: So("lucide",
|
|
505
|
+
width: r ?? $ ?? ro.width,
|
|
506
|
+
height: r ?? $ ?? ro.height,
|
|
507
|
+
stroke: o ?? x,
|
|
508
|
+
strokeWidth: y,
|
|
509
|
+
className: So("lucide", f, l),
|
|
510
510
|
...!a && !tr(d) && { "aria-hidden": "true" },
|
|
511
511
|
...d
|
|
512
512
|
},
|
|
513
513
|
[
|
|
514
|
-
...c.map(([
|
|
514
|
+
...c.map(([h, z]) => to(h, z)),
|
|
515
515
|
...Array.isArray(a) ? a : [a]
|
|
516
516
|
]
|
|
517
517
|
);
|
|
@@ -669,49 +669,49 @@ function Tr({
|
|
|
669
669
|
clearable: c,
|
|
670
670
|
onClear: d,
|
|
671
671
|
id: p,
|
|
672
|
-
value:
|
|
673
|
-
defaultValue:
|
|
674
|
-
onChange:
|
|
675
|
-
...
|
|
672
|
+
value: $,
|
|
673
|
+
defaultValue: g,
|
|
674
|
+
onChange: w,
|
|
675
|
+
...x
|
|
676
676
|
}) {
|
|
677
|
-
const
|
|
678
|
-
|
|
679
|
-
),
|
|
680
|
-
|
|
681
|
-
},
|
|
682
|
-
|
|
683
|
-
},
|
|
677
|
+
const f = R(), y = p ?? f, h = `${y}-hint`, z = typeof l == "string" ? l : void 0, [W, v] = D(
|
|
678
|
+
g ?? ""
|
|
679
|
+
), b = $ !== void 0, C = b ? $ : W, I = (M) => {
|
|
680
|
+
b || v(M.target.value), w?.(M);
|
|
681
|
+
}, S = () => {
|
|
682
|
+
b || v(""), d?.();
|
|
683
|
+
}, T = c && !!C;
|
|
684
684
|
return /* @__PURE__ */ k(mr, { $fullWidth: a, children: [
|
|
685
685
|
/* @__PURE__ */ k(vr, { children: [
|
|
686
686
|
/* @__PURE__ */ k(
|
|
687
687
|
Cr,
|
|
688
688
|
{
|
|
689
|
-
id:
|
|
689
|
+
id: y,
|
|
690
690
|
$size: n,
|
|
691
691
|
$variant: e,
|
|
692
692
|
$error: !!l,
|
|
693
693
|
"aria-invalid": !!l,
|
|
694
|
-
"aria-describedby":
|
|
695
|
-
value:
|
|
696
|
-
onChange:
|
|
697
|
-
...
|
|
694
|
+
"aria-describedby": z ? h : void 0,
|
|
695
|
+
value: C,
|
|
696
|
+
onChange: I,
|
|
697
|
+
...x,
|
|
698
698
|
children: [
|
|
699
699
|
r && /* @__PURE__ */ s("option", { value: "", disabled: !0, children: r }),
|
|
700
|
-
o.map((
|
|
700
|
+
o.map((M) => /* @__PURE__ */ s("option", { value: M.value, disabled: M.disabled, children: M.label }, M.value))
|
|
701
701
|
]
|
|
702
702
|
}
|
|
703
703
|
),
|
|
704
|
-
|
|
704
|
+
T ? /* @__PURE__ */ s(
|
|
705
705
|
Sr,
|
|
706
706
|
{
|
|
707
707
|
type: "button",
|
|
708
|
-
onClick:
|
|
708
|
+
onClick: S,
|
|
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
|
+
z && /* @__PURE__ */ s(kr, { id: h, $error: !0, children: z })
|
|
715
715
|
] });
|
|
716
716
|
}
|
|
717
717
|
Tr.displayName = "Select";
|
|
@@ -784,26 +784,26 @@ function Mr({
|
|
|
784
784
|
placeholder: a = "Click to edit",
|
|
785
785
|
disabled: c = !1
|
|
786
786
|
}) {
|
|
787
|
-
const d = o !== void 0, [p,
|
|
788
|
-
c || (
|
|
789
|
-
|
|
787
|
+
const d = o !== void 0, [p, $] = D(r), g = d ? o : p, [w, x] = D(!1), [f, y] = D(""), h = j(null), z = () => {
|
|
788
|
+
c || (y(g), x(!0), setTimeout(() => {
|
|
789
|
+
h.current?.focus(), h.current?.select();
|
|
790
790
|
}, 0));
|
|
791
|
-
},
|
|
792
|
-
d ||
|
|
793
|
-
},
|
|
794
|
-
l?.(
|
|
795
|
-
},
|
|
796
|
-
|
|
791
|
+
}, W = () => {
|
|
792
|
+
d || $(f), n?.(f), e?.(f), x(!1);
|
|
793
|
+
}, v = () => {
|
|
794
|
+
l?.(g), x(!1);
|
|
795
|
+
}, b = (C) => {
|
|
796
|
+
C.key === "Enter" ? W() : C.key === "Escape" && v();
|
|
797
797
|
};
|
|
798
|
-
return
|
|
798
|
+
return w ? /* @__PURE__ */ s(go, { children: /* @__PURE__ */ s(
|
|
799
799
|
Dr,
|
|
800
800
|
{
|
|
801
|
-
ref:
|
|
802
|
-
value:
|
|
803
|
-
size: Math.max(
|
|
804
|
-
onChange: (
|
|
805
|
-
onBlur:
|
|
806
|
-
onKeyDown:
|
|
801
|
+
ref: h,
|
|
802
|
+
value: f,
|
|
803
|
+
size: Math.max(f.length, a.length, 10),
|
|
804
|
+
onChange: (C) => y(C.target.value),
|
|
805
|
+
onBlur: W,
|
|
806
|
+
onKeyDown: b,
|
|
807
807
|
"aria-label": "Edit value"
|
|
808
808
|
}
|
|
809
809
|
) }) : /* @__PURE__ */ s(go, { children: /* @__PURE__ */ s(
|
|
@@ -812,10 +812,10 @@ function Mr({
|
|
|
812
812
|
role: c ? void 0 : "button",
|
|
813
813
|
tabIndex: c ? void 0 : 0,
|
|
814
814
|
$disabled: c,
|
|
815
|
-
$empty: !
|
|
816
|
-
onClick:
|
|
817
|
-
onKeyDown: (
|
|
818
|
-
children:
|
|
815
|
+
$empty: !g,
|
|
816
|
+
onClick: z,
|
|
817
|
+
onKeyDown: (C) => C.key === "Enter" && z(),
|
|
818
|
+
children: g || a
|
|
819
819
|
}
|
|
820
820
|
) });
|
|
821
821
|
}
|
|
@@ -1003,75 +1003,77 @@ function Io({
|
|
|
1003
1003
|
closeOnBackdrop: c = !0,
|
|
1004
1004
|
closeOnEscape: d = !0,
|
|
1005
1005
|
ariaLabelledBy: p,
|
|
1006
|
-
ariaDescribedBy:
|
|
1006
|
+
ariaDescribedBy: $
|
|
1007
1007
|
}) {
|
|
1008
|
-
const
|
|
1009
|
-
|
|
1008
|
+
const g = j(null), w = j(null), x = j(r);
|
|
1009
|
+
x.current = r;
|
|
1010
|
+
const f = R(), y = p ?? (n ? f : void 0), [h, z] = D(o), [W, v] = D(!1);
|
|
1011
|
+
return A(() => {
|
|
1010
1012
|
if (o)
|
|
1011
|
-
|
|
1012
|
-
else if (
|
|
1013
|
-
|
|
1014
|
-
const
|
|
1015
|
-
|
|
1013
|
+
z(!0), v(!1);
|
|
1014
|
+
else if (h) {
|
|
1015
|
+
v(!0);
|
|
1016
|
+
const b = setTimeout(() => {
|
|
1017
|
+
z(!1), v(!1);
|
|
1016
1018
|
}, 150);
|
|
1017
|
-
return () => clearTimeout(
|
|
1019
|
+
return () => clearTimeout(b);
|
|
1018
1020
|
}
|
|
1019
|
-
}, [o,
|
|
1021
|
+
}, [o, h]), A(() => {
|
|
1020
1022
|
if (!o)
|
|
1021
1023
|
return;
|
|
1022
|
-
const
|
|
1024
|
+
const b = document.body.style.overflow;
|
|
1023
1025
|
return document.body.style.overflow = "hidden", () => {
|
|
1024
|
-
document.body.style.overflow =
|
|
1026
|
+
document.body.style.overflow = b;
|
|
1025
1027
|
};
|
|
1026
|
-
}, [o]),
|
|
1027
|
-
if (!o || !
|
|
1028
|
+
}, [o]), A(() => {
|
|
1029
|
+
if (!o || !g.current)
|
|
1028
1030
|
return;
|
|
1029
|
-
const
|
|
1030
|
-
(bo(
|
|
1031
|
-
const
|
|
1032
|
-
if (
|
|
1033
|
-
|
|
1031
|
+
const b = g.current, C = document.activeElement;
|
|
1032
|
+
(bo(b)[0] ?? b).focus();
|
|
1033
|
+
const S = (T) => {
|
|
1034
|
+
if (T.key === "Escape" && d) {
|
|
1035
|
+
x.current();
|
|
1034
1036
|
return;
|
|
1035
1037
|
}
|
|
1036
|
-
if (
|
|
1038
|
+
if (T.key !== "Tab")
|
|
1037
1039
|
return;
|
|
1038
|
-
const
|
|
1039
|
-
if (
|
|
1040
|
-
|
|
1040
|
+
const M = bo(b);
|
|
1041
|
+
if (M.length === 0) {
|
|
1042
|
+
T.preventDefault();
|
|
1041
1043
|
return;
|
|
1042
1044
|
}
|
|
1043
|
-
const
|
|
1044
|
-
|
|
1045
|
+
const P = M[0], O = M[M.length - 1];
|
|
1046
|
+
T.shiftKey ? document.activeElement === P && (T.preventDefault(), O.focus()) : document.activeElement === O && (T.preventDefault(), P.focus());
|
|
1045
1047
|
};
|
|
1046
|
-
return document.addEventListener("keydown",
|
|
1047
|
-
document.removeEventListener("keydown",
|
|
1048
|
+
return document.addEventListener("keydown", S), () => {
|
|
1049
|
+
document.removeEventListener("keydown", S), C?.focus();
|
|
1048
1050
|
};
|
|
1049
|
-
}, [o, d,
|
|
1051
|
+
}, [o, d, h]), h ? Co(
|
|
1050
1052
|
/* @__PURE__ */ s(
|
|
1051
1053
|
_r,
|
|
1052
1054
|
{
|
|
1053
|
-
$closing:
|
|
1054
|
-
onMouseDown: (
|
|
1055
|
-
|
|
1055
|
+
$closing: W,
|
|
1056
|
+
onMouseDown: (b) => {
|
|
1057
|
+
w.current = b.target;
|
|
1056
1058
|
},
|
|
1057
|
-
onClick: (
|
|
1058
|
-
c &&
|
|
1059
|
+
onClick: (b) => {
|
|
1060
|
+
c && w.current === b.currentTarget && r();
|
|
1059
1061
|
},
|
|
1060
1062
|
children: /* @__PURE__ */ k(
|
|
1061
1063
|
jr,
|
|
1062
1064
|
{
|
|
1063
|
-
ref:
|
|
1065
|
+
ref: g,
|
|
1064
1066
|
role: "dialog",
|
|
1065
1067
|
"aria-modal": "true",
|
|
1066
|
-
"aria-labelledby":
|
|
1067
|
-
"aria-describedby":
|
|
1068
|
+
"aria-labelledby": y,
|
|
1069
|
+
"aria-describedby": $,
|
|
1068
1070
|
$size: a,
|
|
1069
|
-
$closing:
|
|
1071
|
+
$closing: W,
|
|
1070
1072
|
tabIndex: -1,
|
|
1071
|
-
onClick: (
|
|
1073
|
+
onClick: (b) => b.stopPropagation(),
|
|
1072
1074
|
children: [
|
|
1073
1075
|
/* @__PURE__ */ k(Ar, { children: [
|
|
1074
|
-
n && /* @__PURE__ */ s(Rr, { id:
|
|
1076
|
+
n && /* @__PURE__ */ s(Rr, { id: f, children: n }),
|
|
1075
1077
|
/* @__PURE__ */ s(Yr, { onClick: r, "aria-label": "Close modal", children: "×" })
|
|
1076
1078
|
] }),
|
|
1077
1079
|
/* @__PURE__ */ s(Hr, { children: e }),
|
|
@@ -1213,25 +1215,25 @@ function Do({
|
|
|
1213
1215
|
duration: l = 4e3,
|
|
1214
1216
|
position: a = "bottom-right"
|
|
1215
1217
|
}) {
|
|
1216
|
-
const [c, d] = D(o), [p,
|
|
1217
|
-
return
|
|
1218
|
+
const [c, d] = D(o), [p, $] = D(!1);
|
|
1219
|
+
return A(() => {
|
|
1218
1220
|
if (o)
|
|
1219
|
-
d(!0),
|
|
1221
|
+
d(!0), $(!1);
|
|
1220
1222
|
else if (c) {
|
|
1221
|
-
|
|
1222
|
-
const
|
|
1223
|
-
d(!1),
|
|
1223
|
+
$(!0);
|
|
1224
|
+
const g = setTimeout(() => {
|
|
1225
|
+
d(!1), $(!1);
|
|
1224
1226
|
}, 200);
|
|
1225
1227
|
return () => {
|
|
1226
|
-
clearTimeout(
|
|
1228
|
+
clearTimeout(g);
|
|
1227
1229
|
};
|
|
1228
1230
|
}
|
|
1229
|
-
}, [o, c]),
|
|
1231
|
+
}, [o, c]), A(() => {
|
|
1230
1232
|
if (!o || l === 0)
|
|
1231
1233
|
return;
|
|
1232
|
-
const
|
|
1234
|
+
const g = setTimeout(r, l);
|
|
1233
1235
|
return () => {
|
|
1234
|
-
clearTimeout(
|
|
1236
|
+
clearTimeout(g);
|
|
1235
1237
|
};
|
|
1236
1238
|
}, [o, l, r]), c ? Co(
|
|
1237
1239
|
/* @__PURE__ */ k(
|
|
@@ -1324,7 +1326,7 @@ function ln({
|
|
|
1324
1326
|
required: e,
|
|
1325
1327
|
children: l
|
|
1326
1328
|
}) {
|
|
1327
|
-
const a =
|
|
1329
|
+
const a = R(), c = `${a}-hint`, d = !!(r || n), p = typeof r == "string" ? r : void 0, $ = po.isValidElement(l) ? po.cloneElement(
|
|
1328
1330
|
l,
|
|
1329
1331
|
{
|
|
1330
1332
|
id: a,
|
|
@@ -1337,7 +1339,7 @@ function ln({
|
|
|
1337
1339
|
o,
|
|
1338
1340
|
e && /* @__PURE__ */ s(sn, { "aria-hidden": "true", children: " *" })
|
|
1339
1341
|
] }),
|
|
1340
|
-
|
|
1342
|
+
$,
|
|
1341
1343
|
d && /* @__PURE__ */ s(en, { id: c, $error: !!r, children: p ?? n })
|
|
1342
1344
|
] });
|
|
1343
1345
|
}
|
|
@@ -1350,81 +1352,81 @@ function wt({
|
|
|
1350
1352
|
}) {
|
|
1351
1353
|
const [l, a] = D(o), [c, d] = D(
|
|
1352
1354
|
{}
|
|
1353
|
-
), [p,
|
|
1354
|
-
|
|
1355
|
-
const
|
|
1356
|
-
(
|
|
1355
|
+
), [p, $] = D({}), [g, w] = D(!1), x = j(l);
|
|
1356
|
+
x.current = l;
|
|
1357
|
+
const f = V(
|
|
1358
|
+
(I) => {
|
|
1357
1359
|
if (!r)
|
|
1358
1360
|
return {};
|
|
1359
|
-
const
|
|
1361
|
+
const S = r(I);
|
|
1360
1362
|
return Object.fromEntries(
|
|
1361
|
-
Object.entries(
|
|
1363
|
+
Object.entries(S).filter(([, T]) => T !== void 0)
|
|
1362
1364
|
);
|
|
1363
1365
|
},
|
|
1364
1366
|
[r]
|
|
1365
|
-
),
|
|
1366
|
-
|
|
1367
|
-
const
|
|
1368
|
-
(
|
|
1369
|
-
const { name:
|
|
1370
|
-
process.env.NODE_ENV !== "production" && !
|
|
1367
|
+
), y = j(p);
|
|
1368
|
+
y.current = p;
|
|
1369
|
+
const h = V(
|
|
1370
|
+
(I) => {
|
|
1371
|
+
const { name: S, value: T } = I.target;
|
|
1372
|
+
process.env.NODE_ENV !== "production" && !S && console.warn(
|
|
1371
1373
|
"[useForm] handleChange: field is missing a `name` attribute — value will not be tracked."
|
|
1372
1374
|
);
|
|
1373
|
-
const
|
|
1374
|
-
a(
|
|
1375
|
+
const M = { ...x.current, [S]: T };
|
|
1376
|
+
a(M), y.current[S] && d(f(M));
|
|
1375
1377
|
},
|
|
1376
|
-
[
|
|
1377
|
-
),
|
|
1378
|
-
(
|
|
1379
|
-
const { name:
|
|
1380
|
-
process.env.NODE_ENV !== "production" && !
|
|
1378
|
+
[f]
|
|
1379
|
+
), z = V(
|
|
1380
|
+
(I) => {
|
|
1381
|
+
const { name: S } = I.target;
|
|
1382
|
+
process.env.NODE_ENV !== "production" && !S && console.warn(
|
|
1381
1383
|
"[useForm] handleBlur: field is missing a `name` attribute — touched state will not be tracked."
|
|
1382
|
-
),
|
|
1384
|
+
), $((T) => ({ ...T, [S]: !0 })), d(f(x.current));
|
|
1383
1385
|
},
|
|
1384
|
-
[
|
|
1385
|
-
),
|
|
1386
|
-
(
|
|
1387
|
-
|
|
1388
|
-
const
|
|
1389
|
-
(
|
|
1386
|
+
[f]
|
|
1387
|
+
), W = V(
|
|
1388
|
+
(I) => {
|
|
1389
|
+
I?.preventDefault();
|
|
1390
|
+
const S = Object.keys(x.current).reduce(
|
|
1391
|
+
(P, O) => ({ ...P, [O]: !0 }),
|
|
1390
1392
|
{}
|
|
1391
1393
|
);
|
|
1392
|
-
|
|
1393
|
-
const
|
|
1394
|
-
if (d(
|
|
1395
|
-
e?.(
|
|
1394
|
+
$(S);
|
|
1395
|
+
const T = f(x.current);
|
|
1396
|
+
if (d(T), Object.keys(T).length > 0) {
|
|
1397
|
+
e?.(T);
|
|
1396
1398
|
return;
|
|
1397
1399
|
}
|
|
1398
1400
|
(async () => {
|
|
1399
|
-
|
|
1401
|
+
w(!0);
|
|
1400
1402
|
try {
|
|
1401
|
-
await n?.(
|
|
1403
|
+
await n?.(x.current);
|
|
1402
1404
|
} finally {
|
|
1403
|
-
|
|
1405
|
+
w(!1);
|
|
1404
1406
|
}
|
|
1405
1407
|
})();
|
|
1406
1408
|
},
|
|
1407
|
-
[
|
|
1408
|
-
),
|
|
1409
|
-
a((
|
|
1410
|
-
}, []),
|
|
1411
|
-
(
|
|
1412
|
-
a(
|
|
1409
|
+
[f, n, e]
|
|
1410
|
+
), v = V((I, S) => {
|
|
1411
|
+
a((T) => ({ ...T, [I]: S }));
|
|
1412
|
+
}, []), b = V(
|
|
1413
|
+
(I) => {
|
|
1414
|
+
a(I ?? o), d({}), $({}), w(!1);
|
|
1413
1415
|
},
|
|
1414
1416
|
[o]
|
|
1415
|
-
),
|
|
1416
|
-
Object.entries(c).filter(([
|
|
1417
|
+
), C = Object.fromEntries(
|
|
1418
|
+
Object.entries(c).filter(([I]) => p[I])
|
|
1417
1419
|
);
|
|
1418
1420
|
return {
|
|
1419
1421
|
values: l,
|
|
1420
|
-
errors:
|
|
1422
|
+
errors: C,
|
|
1421
1423
|
touched: p,
|
|
1422
|
-
handleChange:
|
|
1423
|
-
handleBlur:
|
|
1424
|
-
handleSubmit:
|
|
1425
|
-
setFieldValue:
|
|
1426
|
-
reset:
|
|
1427
|
-
isSubmitting:
|
|
1424
|
+
handleChange: h,
|
|
1425
|
+
handleBlur: z,
|
|
1426
|
+
handleSubmit: W,
|
|
1427
|
+
setFieldValue: v,
|
|
1428
|
+
reset: b,
|
|
1429
|
+
isSubmitting: g
|
|
1428
1430
|
};
|
|
1429
1431
|
}
|
|
1430
1432
|
const cn = i.div`
|
|
@@ -1518,32 +1520,32 @@ function wn({
|
|
|
1518
1520
|
headerActions: c,
|
|
1519
1521
|
accentColor: d
|
|
1520
1522
|
}) {
|
|
1521
|
-
const [p,
|
|
1523
|
+
const [p, $] = D(n), g = R(), w = e !== void 0, x = w ? e : p;
|
|
1522
1524
|
return /* @__PURE__ */ k(cn, { $accentColor: d, children: [
|
|
1523
1525
|
/* @__PURE__ */ k(
|
|
1524
1526
|
dn,
|
|
1525
1527
|
{
|
|
1526
1528
|
type: "button",
|
|
1527
|
-
$open:
|
|
1529
|
+
$open: x,
|
|
1528
1530
|
$accentColor: d,
|
|
1529
|
-
"aria-expanded":
|
|
1530
|
-
"aria-controls":
|
|
1531
|
+
"aria-expanded": x,
|
|
1532
|
+
"aria-controls": g,
|
|
1531
1533
|
onClick: () => {
|
|
1532
|
-
const
|
|
1533
|
-
|
|
1534
|
+
const y = !x;
|
|
1535
|
+
w || $(y), l?.(y);
|
|
1534
1536
|
},
|
|
1535
1537
|
children: [
|
|
1536
1538
|
/* @__PURE__ */ k(un, { children: [
|
|
1537
1539
|
/* @__PURE__ */ s(pn, { children: o }),
|
|
1538
1540
|
(a || c) && /* @__PURE__ */ k($n, { children: [
|
|
1539
1541
|
a && /* @__PURE__ */ s(fn, { children: a }),
|
|
1540
|
-
c && /* @__PURE__ */ s(gn, { onClick: (
|
|
1542
|
+
c && /* @__PURE__ */ s(gn, { onClick: (y) => y.stopPropagation(), children: c })
|
|
1541
1543
|
] })
|
|
1542
1544
|
] }),
|
|
1543
1545
|
/* @__PURE__ */ s(
|
|
1544
1546
|
bn,
|
|
1545
1547
|
{
|
|
1546
|
-
$open:
|
|
1548
|
+
$open: x,
|
|
1547
1549
|
$accentColor: d,
|
|
1548
1550
|
"aria-hidden": "true",
|
|
1549
1551
|
children: /* @__PURE__ */ s(zo, { size: 18, strokeWidth: 2.5 })
|
|
@@ -1552,7 +1554,7 @@ function wn({
|
|
|
1552
1554
|
]
|
|
1553
1555
|
}
|
|
1554
1556
|
),
|
|
1555
|
-
/* @__PURE__ */ s(xn, { $open:
|
|
1557
|
+
/* @__PURE__ */ s(xn, { $open: x, children: /* @__PURE__ */ s(yn, { id: g, role: "region", "aria-label": o, children: /* @__PURE__ */ s(hn, { children: r }) }) })
|
|
1556
1558
|
] });
|
|
1557
1559
|
}
|
|
1558
1560
|
wn.displayName = "CollapsibleCard";
|
|
@@ -1610,14 +1612,14 @@ function Tn({
|
|
|
1610
1612
|
}) {
|
|
1611
1613
|
const l = r !== void 0, [a, c] = D(
|
|
1612
1614
|
n ?? null
|
|
1613
|
-
), d = l ? r ?? null : a, p = (
|
|
1614
|
-
const
|
|
1615
|
-
return l || c(
|
|
1616
|
-
},
|
|
1617
|
-
const
|
|
1618
|
-
return d.direction === "asc" ?
|
|
1615
|
+
), d = l ? r ?? null : a, p = (g) => {
|
|
1616
|
+
const w = zn(d, g);
|
|
1617
|
+
return l || c(w), e?.(w), w;
|
|
1618
|
+
}, $ = lo(() => l || !d ? o : [...o].sort((g, w) => {
|
|
1619
|
+
const x = g[d.key], f = w[d.key], y = x < f ? -1 : x > f ? 1 : 0;
|
|
1620
|
+
return d.direction === "asc" ? y : -y;
|
|
1619
1621
|
}), [o, d, l]);
|
|
1620
|
-
return { activeSort: d, sortedData:
|
|
1622
|
+
return { activeSort: d, sortedData: $, handleSort: p };
|
|
1621
1623
|
}
|
|
1622
1624
|
const In = 7, xo = 3, yo = 1;
|
|
1623
1625
|
function Dn(o, r) {
|
|
@@ -1637,15 +1639,15 @@ function Mn({
|
|
|
1637
1639
|
totalRows: l,
|
|
1638
1640
|
onPageChange: a
|
|
1639
1641
|
}) {
|
|
1640
|
-
const c = n !== void 0, [d, p] = D(e ?? 1),
|
|
1641
|
-
c || p(
|
|
1642
|
-
},
|
|
1643
|
-
if (!r ||
|
|
1642
|
+
const c = n !== void 0, [d, p] = D(e ?? 1), $ = c ? n : d, g = (h) => {
|
|
1643
|
+
c || p(h), a?.(h);
|
|
1644
|
+
}, w = c || l !== void 0, x = l ?? o.length, f = r ? Math.max(1, Math.ceil(x / r)) : 1, y = lo(() => {
|
|
1645
|
+
if (!r || w)
|
|
1644
1646
|
return o;
|
|
1645
|
-
const
|
|
1646
|
-
return o.slice(
|
|
1647
|
-
}, [o, r,
|
|
1648
|
-
return { activePage:
|
|
1647
|
+
const h = ($ - 1) * r;
|
|
1648
|
+
return o.slice(h, h + r);
|
|
1649
|
+
}, [o, r, $, w]);
|
|
1650
|
+
return { activePage: $, totalPages: f, displayData: y, handlePageChange: g };
|
|
1649
1651
|
}
|
|
1650
1652
|
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`
|
|
1651
1653
|
width: 100%;
|
|
@@ -1885,33 +1887,33 @@ function Un({
|
|
|
1885
1887
|
stickyHeader: c,
|
|
1886
1888
|
caption: d,
|
|
1887
1889
|
emptyMessage: p = "No data",
|
|
1888
|
-
loading:
|
|
1889
|
-
sort:
|
|
1890
|
-
defaultSort:
|
|
1891
|
-
onSortChange:
|
|
1892
|
-
pageSize:
|
|
1893
|
-
page:
|
|
1894
|
-
defaultPage:
|
|
1895
|
-
totalRows:
|
|
1896
|
-
onPageChange:
|
|
1897
|
-
onChange:
|
|
1898
|
-
onRowClick:
|
|
1899
|
-
borderColor:
|
|
1900
|
-
headerColor:
|
|
1901
|
-
rowColor:
|
|
1902
|
-
stripeColor:
|
|
1903
|
-
className:
|
|
1904
|
-
style:
|
|
1890
|
+
loading: $,
|
|
1891
|
+
sort: g,
|
|
1892
|
+
defaultSort: w,
|
|
1893
|
+
onSortChange: x,
|
|
1894
|
+
pageSize: f,
|
|
1895
|
+
page: y,
|
|
1896
|
+
defaultPage: h,
|
|
1897
|
+
totalRows: z,
|
|
1898
|
+
onPageChange: W,
|
|
1899
|
+
onChange: v,
|
|
1900
|
+
onRowClick: b,
|
|
1901
|
+
borderColor: C,
|
|
1902
|
+
headerColor: I,
|
|
1903
|
+
rowColor: S,
|
|
1904
|
+
stripeColor: T,
|
|
1905
|
+
className: M,
|
|
1906
|
+
style: P
|
|
1905
1907
|
}) {
|
|
1906
1908
|
const {
|
|
1907
|
-
activeSort:
|
|
1909
|
+
activeSort: O,
|
|
1908
1910
|
sortedData: K,
|
|
1909
1911
|
handleSort: N
|
|
1910
1912
|
} = Tn({
|
|
1911
1913
|
data: r,
|
|
1912
|
-
sort:
|
|
1913
|
-
defaultSort:
|
|
1914
|
-
onSortChange:
|
|
1914
|
+
sort: g,
|
|
1915
|
+
defaultSort: w,
|
|
1916
|
+
onSortChange: x
|
|
1915
1917
|
}), {
|
|
1916
1918
|
activePage: E,
|
|
1917
1919
|
totalPages: q,
|
|
@@ -1919,32 +1921,32 @@ function Un({
|
|
|
1919
1921
|
handlePageChange: B
|
|
1920
1922
|
} = Mn({
|
|
1921
1923
|
data: K,
|
|
1922
|
-
pageSize:
|
|
1923
|
-
page:
|
|
1924
|
-
defaultPage:
|
|
1925
|
-
totalRows:
|
|
1926
|
-
onPageChange:
|
|
1927
|
-
}),
|
|
1924
|
+
pageSize: f,
|
|
1925
|
+
page: y,
|
|
1926
|
+
defaultPage: h,
|
|
1927
|
+
totalRows: z,
|
|
1928
|
+
onPageChange: W
|
|
1929
|
+
}), Y = (m) => {
|
|
1928
1930
|
const L = N(m);
|
|
1929
|
-
|
|
1930
|
-
},
|
|
1931
|
-
B(m),
|
|
1932
|
-
}, Z = (m, L) => String(n ? m[n] : L), Q =
|
|
1931
|
+
v?.({ sort: L, page: E });
|
|
1932
|
+
}, H = (m) => {
|
|
1933
|
+
B(m), v?.({ sort: O, page: m });
|
|
1934
|
+
}, Z = (m, L) => String(n ? m[n] : L), Q = !$ && u.length === 0, Eo = f ?? Yn;
|
|
1933
1935
|
return /* @__PURE__ */ k(
|
|
1934
1936
|
Wn,
|
|
1935
1937
|
{
|
|
1936
|
-
$borderColor:
|
|
1938
|
+
$borderColor: C,
|
|
1937
1939
|
$stickyHeader: c,
|
|
1938
|
-
className:
|
|
1939
|
-
style:
|
|
1940
|
+
className: M,
|
|
1941
|
+
style: P,
|
|
1940
1942
|
children: [
|
|
1941
1943
|
/* @__PURE__ */ k(On, { $size: e, children: [
|
|
1942
1944
|
d && /* @__PURE__ */ s("caption", { children: d }),
|
|
1943
1945
|
/* @__PURE__ */ s(
|
|
1944
1946
|
Pn,
|
|
1945
1947
|
{
|
|
1946
|
-
$headerColor:
|
|
1947
|
-
$borderColor:
|
|
1948
|
+
$headerColor: I,
|
|
1949
|
+
$borderColor: C,
|
|
1948
1950
|
$stickyHeader: c,
|
|
1949
1951
|
children: /* @__PURE__ */ s(X, { children: o.map((m) => /* @__PURE__ */ s(
|
|
1950
1952
|
Ln,
|
|
@@ -1957,11 +1959,11 @@ function Un({
|
|
|
1957
1959
|
Fn,
|
|
1958
1960
|
{
|
|
1959
1961
|
type: "button",
|
|
1960
|
-
onClick: () =>
|
|
1961
|
-
"aria-label": `Sort by ${m.header}${
|
|
1962
|
+
onClick: () => Y(m.key),
|
|
1963
|
+
"aria-label": `Sort by ${m.header}${O?.key === m.key ? `, ${O.direction}ending` : ""}`,
|
|
1962
1964
|
children: [
|
|
1963
1965
|
m.header,
|
|
1964
|
-
/* @__PURE__ */ s(Bn, { "aria-hidden": "true", children: Hn(
|
|
1966
|
+
/* @__PURE__ */ s(Bn, { "aria-hidden": "true", children: Hn(O, m.key) })
|
|
1965
1967
|
]
|
|
1966
1968
|
}
|
|
1967
1969
|
) : m.header
|
|
@@ -1974,28 +1976,28 @@ function Un({
|
|
|
1974
1976
|
Nn,
|
|
1975
1977
|
{
|
|
1976
1978
|
$striped: l,
|
|
1977
|
-
$rowColor:
|
|
1978
|
-
$stripeColor:
|
|
1979
|
-
children:
|
|
1979
|
+
$rowColor: S,
|
|
1980
|
+
$stripeColor: T,
|
|
1981
|
+
children: $ ? Array.from({ length: Eo }).map((m, L) => /* @__PURE__ */ s(X, { children: o.map((uo) => /* @__PURE__ */ s(
|
|
1980
1982
|
jn,
|
|
1981
1983
|
{
|
|
1982
1984
|
$size: e,
|
|
1983
1985
|
$bordered: a,
|
|
1984
|
-
$borderColor:
|
|
1986
|
+
$borderColor: C,
|
|
1985
1987
|
children: /* @__PURE__ */ s(An, {})
|
|
1986
1988
|
},
|
|
1987
1989
|
uo.key
|
|
1988
1990
|
)) }, L)) : Q ? /* @__PURE__ */ s("tr", { children: /* @__PURE__ */ s(Vn, { colSpan: o.length, children: p }) }) : u.map((m, L) => /* @__PURE__ */ s(
|
|
1989
|
-
|
|
1991
|
+
b ? En : X,
|
|
1990
1992
|
{
|
|
1991
|
-
onClick:
|
|
1992
|
-
$accentColor:
|
|
1993
|
+
onClick: b ? () => b(m) : void 0,
|
|
1994
|
+
$accentColor: b ? C : void 0,
|
|
1993
1995
|
children: o.map((G) => /* @__PURE__ */ s(
|
|
1994
1996
|
Oo,
|
|
1995
1997
|
{
|
|
1996
1998
|
$size: e,
|
|
1997
1999
|
$bordered: a,
|
|
1998
|
-
$borderColor:
|
|
2000
|
+
$borderColor: C,
|
|
1999
2001
|
children: G.render ? G.render(m[G.key], m, L) : String(m[G.key] ?? "") || " "
|
|
2000
2002
|
},
|
|
2001
2003
|
G.key
|
|
@@ -2006,12 +2008,12 @@ function Un({
|
|
|
2006
2008
|
}
|
|
2007
2009
|
)
|
|
2008
2010
|
] }),
|
|
2009
|
-
|
|
2011
|
+
f && q > 1 && /* @__PURE__ */ k(Rn, { children: [
|
|
2010
2012
|
/* @__PURE__ */ s(
|
|
2011
2013
|
no,
|
|
2012
2014
|
{
|
|
2013
2015
|
type: "button",
|
|
2014
|
-
onClick: () =>
|
|
2016
|
+
onClick: () => H(E - 1),
|
|
2015
2017
|
disabled: E <= 1,
|
|
2016
2018
|
"aria-label": "Previous page",
|
|
2017
2019
|
children: "←"
|
|
@@ -2031,7 +2033,7 @@ function Un({
|
|
|
2031
2033
|
{
|
|
2032
2034
|
type: "button",
|
|
2033
2035
|
$active: m === E,
|
|
2034
|
-
onClick: () =>
|
|
2036
|
+
onClick: () => H(m),
|
|
2035
2037
|
"aria-label": `Page ${m}`,
|
|
2036
2038
|
"aria-current": m === E ? "page" : void 0,
|
|
2037
2039
|
children: m
|
|
@@ -2043,7 +2045,7 @@ function Un({
|
|
|
2043
2045
|
no,
|
|
2044
2046
|
{
|
|
2045
2047
|
type: "button",
|
|
2046
|
-
onClick: () =>
|
|
2048
|
+
onClick: () => H(E + 1),
|
|
2047
2049
|
disabled: E >= q,
|
|
2048
2050
|
"aria-label": "Next page",
|
|
2049
2051
|
children: "→"
|
|
@@ -2438,65 +2440,65 @@ function pt({
|
|
|
2438
2440
|
minDate: c,
|
|
2439
2441
|
maxDate: d,
|
|
2440
2442
|
formatDate: p,
|
|
2441
|
-
id:
|
|
2442
|
-
error:
|
|
2443
|
+
id: $,
|
|
2444
|
+
error: g
|
|
2443
2445
|
}) {
|
|
2444
|
-
const
|
|
2445
|
-
() => (o ??
|
|
2446
|
-
), [
|
|
2447
|
-
|
|
2448
|
-
if (!
|
|
2446
|
+
const w = R(), x = $ ?? w, f = /* @__PURE__ */ new Date(), [y, h] = D(!1), [z, W] = D(
|
|
2447
|
+
() => (o ?? f).getFullYear()
|
|
2448
|
+
), [v, b] = D(() => (o ?? f).getMonth()), C = j(null);
|
|
2449
|
+
A(() => {
|
|
2450
|
+
if (!y) return;
|
|
2449
2451
|
const u = (B) => {
|
|
2450
|
-
|
|
2452
|
+
C.current && !C.current.contains(B.target) && h(!1);
|
|
2451
2453
|
};
|
|
2452
2454
|
return document.addEventListener("mousedown", u), () => document.removeEventListener("mousedown", u);
|
|
2453
|
-
}, [
|
|
2454
|
-
o && (
|
|
2455
|
+
}, [y]), A(() => {
|
|
2456
|
+
o && (W(o.getFullYear()), b(o.getMonth()));
|
|
2455
2457
|
}, [o]);
|
|
2456
|
-
const
|
|
2457
|
-
r?.(new Date(
|
|
2458
|
-
},
|
|
2458
|
+
const I = o ? p ? p(o) : dt(o) : "", S = (u) => {
|
|
2459
|
+
r?.(new Date(z, v, u)), h(!1);
|
|
2460
|
+
}, T = (u) => {
|
|
2459
2461
|
u.stopPropagation(), r?.(null);
|
|
2460
|
-
},
|
|
2461
|
-
|
|
2462
|
-
},
|
|
2463
|
-
|
|
2464
|
-
},
|
|
2465
|
-
|
|
2466
|
-
|
|
2462
|
+
}, M = () => {
|
|
2463
|
+
v === 0 ? (b(11), W((u) => u - 1)) : b((u) => u - 1);
|
|
2464
|
+
}, P = () => {
|
|
2465
|
+
v === 11 ? (b(0), W((u) => u + 1)) : b((u) => u + 1);
|
|
2466
|
+
}, O = mo(z, v), K = lt(z, v), N = [], E = mo(
|
|
2467
|
+
v === 0 ? z - 1 : z,
|
|
2468
|
+
v === 0 ? 11 : v - 1
|
|
2467
2469
|
);
|
|
2468
2470
|
for (let u = K - 1; u >= 0; u--)
|
|
2469
2471
|
N.push({ day: E - u, currentMonth: !1 });
|
|
2470
|
-
for (let u = 1; u <=
|
|
2472
|
+
for (let u = 1; u <= O; u++)
|
|
2471
2473
|
N.push({ day: u, currentMonth: !0 });
|
|
2472
2474
|
const q = 42 - N.length;
|
|
2473
2475
|
for (let u = 1; u <= q; u++)
|
|
2474
2476
|
N.push({ day: u, currentMonth: !1 });
|
|
2475
|
-
return /* @__PURE__ */ k(Gn, { ref:
|
|
2477
|
+
return /* @__PURE__ */ k(Gn, { ref: C, children: [
|
|
2476
2478
|
/* @__PURE__ */ k(
|
|
2477
2479
|
Jn,
|
|
2478
2480
|
{
|
|
2479
|
-
id:
|
|
2481
|
+
id: x,
|
|
2480
2482
|
$size: e,
|
|
2481
|
-
$error: !!
|
|
2483
|
+
$error: !!g,
|
|
2482
2484
|
$disabled: l,
|
|
2483
2485
|
role: "combobox",
|
|
2484
2486
|
"aria-haspopup": "true",
|
|
2485
|
-
"aria-expanded":
|
|
2487
|
+
"aria-expanded": y,
|
|
2486
2488
|
tabIndex: l ? -1 : 0,
|
|
2487
2489
|
onClick: () => {
|
|
2488
|
-
l ||
|
|
2490
|
+
l || h((u) => !u);
|
|
2489
2491
|
},
|
|
2490
2492
|
onKeyDown: (u) => {
|
|
2491
|
-
(u.key === "Enter" || u.key === " ") && !l && (u.preventDefault(),
|
|
2493
|
+
(u.key === "Enter" || u.key === " ") && !l && (u.preventDefault(), h((B) => !B)), u.key === "Escape" && h(!1);
|
|
2492
2494
|
},
|
|
2493
2495
|
children: [
|
|
2494
|
-
/* @__PURE__ */ s(Xn, { $hasValue: !!o, children:
|
|
2496
|
+
/* @__PURE__ */ s(Xn, { $hasValue: !!o, children: I || n }),
|
|
2495
2497
|
a && o ? /* @__PURE__ */ s(
|
|
2496
2498
|
Qn,
|
|
2497
2499
|
{
|
|
2498
2500
|
type: "button",
|
|
2499
|
-
onClick:
|
|
2501
|
+
onClick: T,
|
|
2500
2502
|
"aria-label": "Clear date",
|
|
2501
2503
|
children: /* @__PURE__ */ s(co, { size: 14 })
|
|
2502
2504
|
}
|
|
@@ -2504,28 +2506,28 @@ function pt({
|
|
|
2504
2506
|
]
|
|
2505
2507
|
}
|
|
2506
2508
|
),
|
|
2507
|
-
typeof
|
|
2508
|
-
|
|
2509
|
+
typeof g == "string" && /* @__PURE__ */ s(ot, { $error: !0, children: g }),
|
|
2510
|
+
y && /* @__PURE__ */ k(rt, { role: "dialog", "aria-label": "Calendar", children: [
|
|
2509
2511
|
/* @__PURE__ */ k(nt, { children: [
|
|
2510
2512
|
/* @__PURE__ */ s(
|
|
2511
2513
|
ho,
|
|
2512
2514
|
{
|
|
2513
2515
|
type: "button",
|
|
2514
|
-
onClick:
|
|
2516
|
+
onClick: M,
|
|
2515
2517
|
"aria-label": "Previous month",
|
|
2516
2518
|
children: /* @__PURE__ */ s(xr, { size: 16 })
|
|
2517
2519
|
}
|
|
2518
2520
|
),
|
|
2519
2521
|
/* @__PURE__ */ k(tt, { children: [
|
|
2520
|
-
it[
|
|
2522
|
+
it[v],
|
|
2521
2523
|
" ",
|
|
2522
|
-
|
|
2524
|
+
z
|
|
2523
2525
|
] }),
|
|
2524
2526
|
/* @__PURE__ */ s(
|
|
2525
2527
|
ho,
|
|
2526
2528
|
{
|
|
2527
2529
|
type: "button",
|
|
2528
|
-
onClick:
|
|
2530
|
+
onClick: P,
|
|
2529
2531
|
"aria-label": "Next month",
|
|
2530
2532
|
children: /* @__PURE__ */ s(hr, { size: 16 })
|
|
2531
2533
|
}
|
|
@@ -2548,18 +2550,18 @@ function pt({
|
|
|
2548
2550
|
},
|
|
2549
2551
|
B
|
|
2550
2552
|
);
|
|
2551
|
-
const
|
|
2553
|
+
const Y = new Date(z, v, u.day), H = o ? vo(Y, o) : !1, Z = vo(Y, f), Q = ct(Y, c, d);
|
|
2552
2554
|
return /* @__PURE__ */ s(
|
|
2553
2555
|
wo,
|
|
2554
2556
|
{
|
|
2555
2557
|
type: "button",
|
|
2556
2558
|
$currentMonth: !0,
|
|
2557
|
-
$selected:
|
|
2559
|
+
$selected: H,
|
|
2558
2560
|
$today: Z,
|
|
2559
2561
|
disabled: Q,
|
|
2560
|
-
"aria-label": ut(
|
|
2561
|
-
"aria-pressed":
|
|
2562
|
-
onClick: () =>
|
|
2562
|
+
"aria-label": ut(Y),
|
|
2563
|
+
"aria-pressed": H,
|
|
2564
|
+
onClick: () => S(u.day),
|
|
2563
2565
|
children: u.day
|
|
2564
2566
|
},
|
|
2565
2567
|
B
|