impact-nova 1.2.0 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ui/calendar.js +214 -199
- package/dist/components/ui/data-table/data-table-view-options.js +63 -42
- package/dist/components/ui/data-table/data-table.js +1 -1
- package/dist/components/ui/date-picker/date-picker.js +1 -1
- package/dist/components/ui/date-picker/date-range-picker.js +7 -7
- package/dist/components/ui/date-picker/month-picker.js +1 -1
- package/dist/components/ui/date-picker/month-range-picker.js +1 -1
- package/dist/components/ui/date-picker/multi-date-picker.js +26 -26
- package/dist/components/ui/date-picker/multi-month-picker.js +20 -20
- package/dist/components/ui/date-picker/multi-week-picker.js +11 -11
- package/dist/components/ui/date-picker/week-picker.js +1 -1
- package/dist/components/ui/date-picker/week-range-picker.js +7 -7
- package/dist/components/ui/prompt.js +4 -4
- package/dist/impact-nova.css +1 -1
- package/package.json +1 -1
|
@@ -1,64 +1,85 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as t, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { DropdownMenu as c, DropdownMenuTrigger as
|
|
4
|
-
import { Button as
|
|
5
|
-
import { ThreeDots as
|
|
6
|
-
import { useDataTable as
|
|
7
|
-
import { DataTableSheetTrigger as
|
|
8
|
-
const
|
|
9
|
-
enableTableSettings:
|
|
10
|
-
enableContentDensity:
|
|
11
|
-
trigger:
|
|
3
|
+
import { DropdownMenu as c, DropdownMenuTrigger as p, DropdownMenuContent as m, DropdownMenuItem as d, DropdownMenuSub as u, DropdownMenuSubTrigger as g, DropdownMenuSubContent as h, DropdownMenuRadioGroup as f, DropdownMenuRadioItem as a } from "../dropdown-menu.js";
|
|
4
|
+
import { Button as x } from "../button.js";
|
|
5
|
+
import { ThreeDots as C, Settings as D, Density as N, Stack as w, StackCompact as S, StackComfort as M } from "../../../icons/index.js";
|
|
6
|
+
import { useDataTable as v } from "./data-table-context.js";
|
|
7
|
+
import { DataTableSheetTrigger as P } from "./data-table-sheet.js";
|
|
8
|
+
const H = ({
|
|
9
|
+
enableTableSettings: n = !0,
|
|
10
|
+
enableContentDensity: r = !0,
|
|
11
|
+
trigger: s
|
|
12
12
|
}) => {
|
|
13
|
-
const { rowHeight:
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
-
/* @__PURE__ */
|
|
16
|
-
/* @__PURE__ */
|
|
17
|
-
/* @__PURE__ */
|
|
13
|
+
const { rowHeight: i, setRowHeight: l } = v();
|
|
14
|
+
return /* @__PURE__ */ t(c, { children: [
|
|
15
|
+
/* @__PURE__ */ o(p, { asChild: !0, children: s || /* @__PURE__ */ t(x, { variant: "secondary", size: "icon", "aria-label": "More", children: [
|
|
16
|
+
/* @__PURE__ */ o(C, { size: "sm" }),
|
|
17
|
+
/* @__PURE__ */ o("span", { className: "sr-only", children: "Open menu" })
|
|
18
18
|
] }) }),
|
|
19
|
-
/* @__PURE__ */
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
/* @__PURE__ */
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
19
|
+
/* @__PURE__ */ t(m, { align: "end", className: "w-[240px] flex flex-col gap-[2px]", children: [
|
|
20
|
+
n && /* @__PURE__ */ o(P, { asChild: !0, children: /* @__PURE__ */ o(
|
|
21
|
+
d,
|
|
22
|
+
{
|
|
23
|
+
className: "flex cursor-pointer gap-2",
|
|
24
|
+
onClick: (e) => e.stopPropagation(),
|
|
25
|
+
onSelect: (e) => e.stopPropagation(),
|
|
26
|
+
children: /* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: [
|
|
27
|
+
/* @__PURE__ */ o(D, { size: "sm", className: "text-slate-500" }),
|
|
28
|
+
/* @__PURE__ */ o("span", { children: "Table Settings" })
|
|
29
|
+
] })
|
|
30
|
+
}
|
|
31
|
+
) }),
|
|
32
|
+
r && /* @__PURE__ */ t(u, { children: [
|
|
33
|
+
/* @__PURE__ */ t(
|
|
34
|
+
g,
|
|
31
35
|
{
|
|
32
|
-
|
|
33
|
-
|
|
36
|
+
className: "flex items-center gap-2 cursor-pointer",
|
|
37
|
+
onClick: (e) => e.stopPropagation(),
|
|
38
|
+
children: [
|
|
39
|
+
/* @__PURE__ */ o(N, { size: "sm", className: "text-slate-500" }),
|
|
40
|
+
/* @__PURE__ */ o("span", { children: "Content density" })
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
),
|
|
44
|
+
/* @__PURE__ */ o(h, { className: "w-[190px]", children: /* @__PURE__ */ t(
|
|
45
|
+
f,
|
|
46
|
+
{
|
|
47
|
+
value: i,
|
|
48
|
+
onValueChange: (e) => l(e),
|
|
34
49
|
className: "flex flex-col gap-0.5",
|
|
35
50
|
children: [
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
|
|
51
|
+
/* @__PURE__ */ o(
|
|
52
|
+
a,
|
|
38
53
|
{
|
|
39
54
|
value: "default",
|
|
40
|
-
|
|
41
|
-
|
|
55
|
+
onClick: (e) => e.stopPropagation(),
|
|
56
|
+
onSelect: (e) => e.stopPropagation(),
|
|
57
|
+
children: /* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: [
|
|
58
|
+
/* @__PURE__ */ o(w, { size: "sm", className: "text-slate-500" }),
|
|
42
59
|
"Default"
|
|
43
60
|
] })
|
|
44
61
|
}
|
|
45
62
|
),
|
|
46
|
-
/* @__PURE__ */
|
|
47
|
-
|
|
63
|
+
/* @__PURE__ */ o(
|
|
64
|
+
a,
|
|
48
65
|
{
|
|
49
66
|
value: "compact",
|
|
50
|
-
|
|
51
|
-
|
|
67
|
+
onClick: (e) => e.stopPropagation(),
|
|
68
|
+
onSelect: (e) => e.stopPropagation(),
|
|
69
|
+
children: /* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: [
|
|
70
|
+
/* @__PURE__ */ o(S, { size: "sm", className: "text-slate-500" }),
|
|
52
71
|
"Compact"
|
|
53
72
|
] })
|
|
54
73
|
}
|
|
55
74
|
),
|
|
56
|
-
/* @__PURE__ */
|
|
57
|
-
|
|
75
|
+
/* @__PURE__ */ o(
|
|
76
|
+
a,
|
|
58
77
|
{
|
|
59
78
|
value: "comfort",
|
|
60
|
-
|
|
61
|
-
|
|
79
|
+
onClick: (e) => e.stopPropagation(),
|
|
80
|
+
onSelect: (e) => e.stopPropagation(),
|
|
81
|
+
children: /* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: [
|
|
82
|
+
/* @__PURE__ */ o(M, { size: "sm", className: "text-slate-500" }),
|
|
62
83
|
"Comfort"
|
|
63
84
|
] })
|
|
64
85
|
}
|
|
@@ -71,5 +92,5 @@ const I = ({
|
|
|
71
92
|
] });
|
|
72
93
|
};
|
|
73
94
|
export {
|
|
74
|
-
|
|
95
|
+
H as DataTableViewOptions
|
|
75
96
|
};
|
|
@@ -33,7 +33,7 @@ const R = ({
|
|
|
33
33
|
"div",
|
|
34
34
|
{
|
|
35
35
|
"data-component": "data-table",
|
|
36
|
-
className: l("flex flex-col w-full
|
|
36
|
+
className: l("flex flex-col w-full min-h-0 rounded-[inherit]", t),
|
|
37
37
|
style: {
|
|
38
38
|
"--ag-font-size": g,
|
|
39
39
|
"--ag-row-height": b
|
|
@@ -29,7 +29,7 @@ const ee = i.forwardRef(
|
|
|
29
29
|
i.useEffect(() => {
|
|
30
30
|
h.current && g.current !== null && (h.current.setSelectionRange(g.current, g.current), g.current = null);
|
|
31
31
|
}, [c]), i.useEffect(() => {
|
|
32
|
-
|
|
32
|
+
o || (l(e ? f(e, t) : ""), s(e));
|
|
33
33
|
}, [e, t, o]), i.useEffect(() => {
|
|
34
34
|
o && (s(e), C(e || /* @__PURE__ */ new Date()));
|
|
35
35
|
}, [o, e]);
|
|
@@ -34,7 +34,7 @@ const ue = d.forwardRef(
|
|
|
34
34
|
d.useRef(null), d.useRef(null), d.useImperativeHandle(U, () => E.current);
|
|
35
35
|
const [c, R] = d.useState(!1), [b, a] = d.useState(e), [w, u] = d.useState(e?.from ? i(e.from, t) : ""), [y, g] = d.useState(e?.to ? i(e.to, t) : ""), [Y, I] = d.useState(e?.from || /* @__PURE__ */ new Date());
|
|
36
36
|
d.useEffect(() => {
|
|
37
|
-
|
|
37
|
+
c || (u(e?.from ? i(e.from, t) : ""), g(e?.to ? i(e.to, t) : ""), a(e));
|
|
38
38
|
}, [e, t, c]), d.useEffect(() => {
|
|
39
39
|
c && (a(e), u(e?.from ? i(e.from, t) : ""), g(e?.to ? i(e.to, t) : ""), I(e?.from || /* @__PURE__ */ new Date()));
|
|
40
40
|
}, [c, e]);
|
|
@@ -45,7 +45,7 @@ const ue = d.forwardRef(
|
|
|
45
45
|
o?.from && !o.to && (o = { from: o.from, to: o.from }), m?.(o), R(!1);
|
|
46
46
|
}, _ = () => {
|
|
47
47
|
a(e), u(e?.from ? i(e.from, t) : ""), g(e?.to ? i(e.to, t) : ""), R(!1);
|
|
48
|
-
},
|
|
48
|
+
}, v = () => {
|
|
49
49
|
a(void 0), u(""), g(""), m?.(void 0), h || R(!1);
|
|
50
50
|
}, F = (n) => {
|
|
51
51
|
const o = n.target.value, l = A(o, t, w);
|
|
@@ -71,7 +71,7 @@ const ue = d.forwardRef(
|
|
|
71
71
|
const s = { from: b?.from, to: f };
|
|
72
72
|
a(s), f && I(f), h || m?.(s);
|
|
73
73
|
}
|
|
74
|
-
},
|
|
74
|
+
}, T = () => {
|
|
75
75
|
if (c) return;
|
|
76
76
|
const n = M(w, t), o = M(y, t), l = S(n, t, /* @__PURE__ */ new Date()), f = S(o, t, /* @__PURE__ */ new Date()), s = C(l) && n.length === t.length, de = C(f) && o.length === t.length;
|
|
77
77
|
!s || !de ? (u(e?.from ? i(e.from, t) : ""), g(e?.to ? i(e.to, t) : ""), a(e)) : (u(n), g(o), h || m?.({ from: l, to: f }));
|
|
@@ -114,7 +114,7 @@ const ue = d.forwardRef(
|
|
|
114
114
|
type: "text",
|
|
115
115
|
value: w,
|
|
116
116
|
onChange: F,
|
|
117
|
-
onBlur:
|
|
117
|
+
onBlur: T,
|
|
118
118
|
onClick: (n) => c && n.stopPropagation(),
|
|
119
119
|
placeholder: c ? t : z,
|
|
120
120
|
disabled: !!x,
|
|
@@ -133,7 +133,7 @@ const ue = d.forwardRef(
|
|
|
133
133
|
type: "text",
|
|
134
134
|
value: y,
|
|
135
135
|
onChange: ee,
|
|
136
|
-
onBlur:
|
|
136
|
+
onBlur: T,
|
|
137
137
|
onClick: (n) => c && n.stopPropagation(),
|
|
138
138
|
placeholder: c ? t : H,
|
|
139
139
|
disabled: !!x,
|
|
@@ -152,7 +152,7 @@ const ue = d.forwardRef(
|
|
|
152
152
|
{
|
|
153
153
|
className: "h-4 w-4 cursor-pointer hover:text-foreground text-muted-foreground",
|
|
154
154
|
onClick: (n) => {
|
|
155
|
-
n.stopPropagation(),
|
|
155
|
+
n.stopPropagation(), v();
|
|
156
156
|
}
|
|
157
157
|
}
|
|
158
158
|
) }),
|
|
@@ -186,7 +186,7 @@ const ue = d.forwardRef(
|
|
|
186
186
|
showFooter: h,
|
|
187
187
|
onApply: $,
|
|
188
188
|
onCancel: _,
|
|
189
|
-
onClear:
|
|
189
|
+
onClear: v,
|
|
190
190
|
captionLayout: "dropdown"
|
|
191
191
|
}
|
|
192
192
|
)
|
|
@@ -26,7 +26,7 @@ const c = (t) => `${(t.month + 1).toString().padStart(2, "0")}/${t.year}`, v = o
|
|
|
26
26
|
o.useRef(null), o.useImperativeHandle(B, () => S.current);
|
|
27
27
|
const [r, h] = o.useState(!1), [w, i] = o.useState(t), [p, a] = o.useState(t ? c(t) : ""), [E, M] = o.useState(t ? new Date(t.year, t.month) : /* @__PURE__ */ new Date());
|
|
28
28
|
o.useEffect(() => {
|
|
29
|
-
|
|
29
|
+
r || (a(t ? c(t) : ""), i(t));
|
|
30
30
|
}, [r, t]), o.useEffect(() => {
|
|
31
31
|
r && (i(t), M(t ? new Date(t.year, t.month) : /* @__PURE__ */ new Date()), a(t ? c(t) : ""));
|
|
32
32
|
}, [r, t]);
|
|
@@ -32,7 +32,7 @@ const n = (t) => `${(t.month + 1).toString().padStart(2, "0")}/${t.year}`, ft =
|
|
|
32
32
|
s.useRef(null), s.useRef(null), s.useImperativeHandle(K, () => Y.current);
|
|
33
33
|
const [a, P] = s.useState(!1), [k, i] = s.useState(t), [x, h] = s.useState(t?.from ? n(t.from) : ""), [M, y] = s.useState(t?.to ? n(t.to) : ""), [Q, R] = s.useState(() => t?.from ? new Date(t.from.year, t.from.month, 1) : /* @__PURE__ */ new Date());
|
|
34
34
|
s.useEffect(() => {
|
|
35
|
-
|
|
35
|
+
a || (h(t?.from ? n(t.from) : ""), y(t?.to ? n(t.to) : ""), i(t));
|
|
36
36
|
}, [a, t]), s.useEffect(() => {
|
|
37
37
|
a && (i(t), h(t?.from ? n(t.from) : ""), y(t?.to ? n(t.to) : ""), R(t?.from ? new Date(t.from.year, t.from.month, 1) : /* @__PURE__ */ new Date()));
|
|
38
38
|
}, [a, t]);
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { jsxs as i, jsx as
|
|
1
|
+
import { jsxs as i, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import * as a from "react";
|
|
3
|
-
import { X as
|
|
3
|
+
import { X as v } from "lucide-react";
|
|
4
4
|
import { CalendarMonth as w } from "../../../icons/index.js";
|
|
5
5
|
import { format as j } from "date-fns";
|
|
6
6
|
import { cn as R } from "../../../lib/utils.js";
|
|
7
7
|
import { Input as b } from "../input.js";
|
|
8
8
|
import { Popover as E, PopoverTrigger as I, PopoverContent as L } from "../popover.js";
|
|
9
9
|
import { Calendar as V } from "../calendar.js";
|
|
10
|
-
import { Tooltip as
|
|
10
|
+
import { Tooltip as f, TooltipTrigger as h, TooltipContent as u } from "../tooltip.js";
|
|
11
11
|
const X = a.forwardRef(
|
|
12
12
|
({
|
|
13
|
-
value:
|
|
13
|
+
value: e,
|
|
14
14
|
onChange: l,
|
|
15
15
|
format: y = "MM/dd/yyyy",
|
|
16
16
|
placeholder: g = "Select Dates",
|
|
@@ -19,61 +19,61 @@ const X = a.forwardRef(
|
|
|
19
19
|
startMonth: x,
|
|
20
20
|
endMonth: T,
|
|
21
21
|
showFooter: s = !0,
|
|
22
|
-
disabled:
|
|
22
|
+
disabled: c,
|
|
23
23
|
className: N,
|
|
24
24
|
...A
|
|
25
25
|
}, D) => {
|
|
26
|
-
const [
|
|
26
|
+
const [d, o] = a.useState(!1), [p, n] = a.useState(e);
|
|
27
27
|
a.useEffect(() => {
|
|
28
|
-
|
|
29
|
-
}, [
|
|
28
|
+
n(e);
|
|
29
|
+
}, [d, e]);
|
|
30
30
|
const M = (r) => {
|
|
31
31
|
n(r), s || l?.(r);
|
|
32
32
|
}, S = (r) => {
|
|
33
33
|
l?.(r !== void 0 ? r : p), o(!1);
|
|
34
34
|
}, k = () => {
|
|
35
|
-
n(
|
|
36
|
-
},
|
|
35
|
+
n(e), o(!1);
|
|
36
|
+
}, m = () => {
|
|
37
37
|
n(void 0), l?.(void 0), s || o(!1);
|
|
38
|
-
},
|
|
39
|
-
return /* @__PURE__ */ i(E, { open:
|
|
40
|
-
/* @__PURE__ */
|
|
38
|
+
}, O = e && e.length > 0 ? e.length === 1 ? j(e[0], y) : `${e.length} dates selected` : "";
|
|
39
|
+
return /* @__PURE__ */ i(E, { open: d, onOpenChange: o, children: [
|
|
40
|
+
/* @__PURE__ */ t(I, { asChild: !0, children: /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
|
|
41
41
|
b,
|
|
42
42
|
{
|
|
43
43
|
ref: D,
|
|
44
|
-
value:
|
|
44
|
+
value: O,
|
|
45
45
|
placeholder: g,
|
|
46
46
|
readOnly: !0,
|
|
47
|
-
disabled:
|
|
47
|
+
disabled: c,
|
|
48
48
|
className: R("cursor-pointer", N),
|
|
49
49
|
suffix: /* @__PURE__ */ i("div", { className: "flex items-center gap-1", children: [
|
|
50
|
-
|
|
51
|
-
/* @__PURE__ */
|
|
52
|
-
|
|
50
|
+
e && e.length > 0 && !c && /* @__PURE__ */ i(f, { children: [
|
|
51
|
+
/* @__PURE__ */ t(h, { asChild: !0, children: /* @__PURE__ */ t(
|
|
52
|
+
v,
|
|
53
53
|
{
|
|
54
54
|
className: "h-4 w-4 cursor-pointer hover:text-foreground",
|
|
55
55
|
onClick: (r) => {
|
|
56
|
-
r.stopPropagation(),
|
|
56
|
+
r.stopPropagation(), m();
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
) }),
|
|
60
|
-
/* @__PURE__ */
|
|
60
|
+
/* @__PURE__ */ t(u, { variant: "tertiary", side: "top", children: "Clear" })
|
|
61
61
|
] }),
|
|
62
|
-
/* @__PURE__ */ i(
|
|
63
|
-
/* @__PURE__ */
|
|
64
|
-
/* @__PURE__ */
|
|
62
|
+
/* @__PURE__ */ i(f, { children: [
|
|
63
|
+
/* @__PURE__ */ t(h, { asChild: !0, children: /* @__PURE__ */ t(w, { className: "h-4 w-4 text-secondary-foreground" }) }),
|
|
64
|
+
/* @__PURE__ */ t(u, { variant: "tertiary", side: "top", children: "Pick dates" })
|
|
65
65
|
] })
|
|
66
66
|
] }),
|
|
67
67
|
...A
|
|
68
68
|
}
|
|
69
69
|
) }) }),
|
|
70
|
-
/* @__PURE__ */
|
|
70
|
+
/* @__PURE__ */ t(
|
|
71
71
|
L,
|
|
72
72
|
{
|
|
73
73
|
className: "w-auto p-0",
|
|
74
74
|
align: "start",
|
|
75
75
|
onOpenAutoFocus: (r) => r.preventDefault(),
|
|
76
|
-
children: /* @__PURE__ */
|
|
76
|
+
children: /* @__PURE__ */ t(
|
|
77
77
|
V,
|
|
78
78
|
{
|
|
79
79
|
mode: "multiple",
|
|
@@ -85,7 +85,7 @@ const X = a.forwardRef(
|
|
|
85
85
|
showFooter: s,
|
|
86
86
|
onApply: S,
|
|
87
87
|
onCancel: k,
|
|
88
|
-
onClear:
|
|
88
|
+
onClear: m,
|
|
89
89
|
captionLayout: "dropdown"
|
|
90
90
|
}
|
|
91
91
|
)
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import { jsxs as i, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import * as s from "react";
|
|
3
|
-
import { X as
|
|
4
|
-
import { CalendarMonth as
|
|
5
|
-
import { cn as
|
|
6
|
-
import { Input as
|
|
3
|
+
import { X as w } from "lucide-react";
|
|
4
|
+
import { CalendarMonth as $ } from "../../../icons/index.js";
|
|
5
|
+
import { cn as j } from "../../../lib/utils.js";
|
|
6
|
+
import { Input as v } from "../input.js";
|
|
7
7
|
import { Popover as R, PopoverTrigger as b, PopoverContent as D } from "../popover.js";
|
|
8
8
|
import { Calendar as E } from "../calendar.js";
|
|
9
|
-
import { Tooltip as m, TooltipTrigger as f, TooltipContent as
|
|
9
|
+
import { Tooltip as m, TooltipTrigger as f, TooltipContent as g } from "../tooltip.js";
|
|
10
10
|
const I = s.forwardRef(
|
|
11
11
|
({
|
|
12
12
|
value: e,
|
|
13
13
|
onChange: l,
|
|
14
|
-
placeholder:
|
|
14
|
+
placeholder: u = "Select Months",
|
|
15
15
|
minDate: y,
|
|
16
16
|
maxDate: C,
|
|
17
17
|
startMonth: M,
|
|
18
18
|
endMonth: P,
|
|
19
19
|
showFooter: a = !0,
|
|
20
|
-
disabled:
|
|
20
|
+
disabled: c,
|
|
21
21
|
className: T,
|
|
22
22
|
...x
|
|
23
23
|
}, N) => {
|
|
24
|
-
const [
|
|
24
|
+
const [p, r] = s.useState(!1), [d, n] = s.useState(e);
|
|
25
25
|
s.useEffect(() => {
|
|
26
|
-
|
|
27
|
-
}, [
|
|
26
|
+
n(e);
|
|
27
|
+
}, [p, e]);
|
|
28
28
|
const k = (o) => {
|
|
29
29
|
n(o), a || l?.(o);
|
|
30
30
|
}, A = (o) => {
|
|
@@ -34,20 +34,20 @@ const I = s.forwardRef(
|
|
|
34
34
|
}, h = () => {
|
|
35
35
|
n(void 0), l?.(void 0), a || r(!1);
|
|
36
36
|
}, O = e && e.length > 0 ? e.length === 1 ? `${e[0].month + 1}/${e[0].year}` : `${e.length} months selected` : "";
|
|
37
|
-
return /* @__PURE__ */ i(R, { open:
|
|
37
|
+
return /* @__PURE__ */ i(R, { open: p, onOpenChange: r, children: [
|
|
38
38
|
/* @__PURE__ */ t(b, { asChild: !0, children: /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
|
|
39
|
-
|
|
39
|
+
v,
|
|
40
40
|
{
|
|
41
41
|
ref: N,
|
|
42
42
|
value: O,
|
|
43
|
-
placeholder:
|
|
43
|
+
placeholder: u,
|
|
44
44
|
readOnly: !0,
|
|
45
|
-
disabled:
|
|
46
|
-
className:
|
|
45
|
+
disabled: c,
|
|
46
|
+
className: j("cursor-pointer", T),
|
|
47
47
|
suffix: /* @__PURE__ */ i("div", { className: "flex items-center gap-1", children: [
|
|
48
|
-
e && e.length > 0 && !
|
|
48
|
+
e && e.length > 0 && !c && /* @__PURE__ */ i(m, { children: [
|
|
49
49
|
/* @__PURE__ */ t(f, { asChild: !0, children: /* @__PURE__ */ t(
|
|
50
|
-
|
|
50
|
+
w,
|
|
51
51
|
{
|
|
52
52
|
className: "h-4 w-4 cursor-pointer hover:text-foreground",
|
|
53
53
|
onClick: (o) => {
|
|
@@ -55,11 +55,11 @@ const I = s.forwardRef(
|
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
) }),
|
|
58
|
-
/* @__PURE__ */ t(
|
|
58
|
+
/* @__PURE__ */ t(g, { variant: "tertiary", side: "top", children: "Clear" })
|
|
59
59
|
] }),
|
|
60
60
|
/* @__PURE__ */ i(m, { children: [
|
|
61
|
-
/* @__PURE__ */ t(f, { asChild: !0, children: /* @__PURE__ */ t(
|
|
62
|
-
/* @__PURE__ */ t(
|
|
61
|
+
/* @__PURE__ */ t(f, { asChild: !0, children: /* @__PURE__ */ t($, { className: "h-4 w-4 text-secondary-foreground" }) }),
|
|
62
|
+
/* @__PURE__ */ t(g, { variant: "tertiary", side: "top", children: "Pick months" })
|
|
63
63
|
] })
|
|
64
64
|
] }),
|
|
65
65
|
...x
|
|
@@ -28,14 +28,14 @@ const G = (e, o = "MM/dd/yyyy") => {
|
|
|
28
28
|
fiscalMonthPattern: W,
|
|
29
29
|
fiscalYearStartMonth: N = 1,
|
|
30
30
|
weekStartsOn: A = 1,
|
|
31
|
-
disabled:
|
|
32
|
-
className:
|
|
33
|
-
...
|
|
31
|
+
disabled: p,
|
|
32
|
+
className: O,
|
|
33
|
+
...v
|
|
34
34
|
}, D) => {
|
|
35
|
-
const [
|
|
35
|
+
const [f, n] = a.useState(!1), [m, i] = a.useState(e);
|
|
36
36
|
a.useEffect(() => {
|
|
37
|
-
|
|
38
|
-
}, [
|
|
37
|
+
i(e);
|
|
38
|
+
}, [f, e]);
|
|
39
39
|
const $ = (r) => {
|
|
40
40
|
i(r), d || o?.(r);
|
|
41
41
|
}, b = (r) => {
|
|
@@ -45,7 +45,7 @@ const G = (e, o = "MM/dd/yyyy") => {
|
|
|
45
45
|
}, h = () => {
|
|
46
46
|
i(void 0), o?.(void 0), d || n(!1);
|
|
47
47
|
}, R = e && e.length > 0 ? e.length === 1 ? G(e[0], l) : `${e.length} weeks selected` : "";
|
|
48
|
-
return /* @__PURE__ */ s(X, { open:
|
|
48
|
+
return /* @__PURE__ */ s(X, { open: f, onOpenChange: n, children: [
|
|
49
49
|
/* @__PURE__ */ t(q, { asChild: !0, children: /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
|
|
50
50
|
V,
|
|
51
51
|
{
|
|
@@ -53,10 +53,10 @@ const G = (e, o = "MM/dd/yyyy") => {
|
|
|
53
53
|
value: R,
|
|
54
54
|
placeholder: c,
|
|
55
55
|
readOnly: !0,
|
|
56
|
-
disabled:
|
|
57
|
-
className: L("cursor-pointer",
|
|
56
|
+
disabled: p,
|
|
57
|
+
className: L("cursor-pointer", O),
|
|
58
58
|
suffix: /* @__PURE__ */ s("div", { className: "flex items-center gap-1", children: [
|
|
59
|
-
e && e.length > 0 && !
|
|
59
|
+
e && e.length > 0 && !p && /* @__PURE__ */ s(k, { children: [
|
|
60
60
|
/* @__PURE__ */ t(u, { asChild: !0, children: /* @__PURE__ */ t(
|
|
61
61
|
E,
|
|
62
62
|
{
|
|
@@ -73,7 +73,7 @@ const G = (e, o = "MM/dd/yyyy") => {
|
|
|
73
73
|
/* @__PURE__ */ t(g, { variant: "tertiary", side: "top", children: "Pick weeks" })
|
|
74
74
|
] })
|
|
75
75
|
] }),
|
|
76
|
-
...
|
|
76
|
+
...v
|
|
77
77
|
}
|
|
78
78
|
) }) }),
|
|
79
79
|
/* @__PURE__ */ t(
|
|
@@ -37,7 +37,7 @@ const p = (e, i = "MM/dd/yyyy") => {
|
|
|
37
37
|
o.useRef(null), o.useImperativeHandle(z, () => I.current);
|
|
38
38
|
const [s, h] = o.useState(!1), [N, c] = o.useState(e), [a, l] = o.useState(e ? p(e, t) : ""), [G, m] = o.useState(e?.startDate || /* @__PURE__ */ new Date());
|
|
39
39
|
o.useEffect(() => {
|
|
40
|
-
|
|
40
|
+
s || (l(e ? p(e, t) : ""), c(e));
|
|
41
41
|
}, [s, e, t]), o.useEffect(() => {
|
|
42
42
|
s && (c(e), m(e?.startDate || /* @__PURE__ */ new Date()), l(e ? p(e, t) : ""));
|
|
43
43
|
}, [s, e, t]);
|
|
@@ -22,8 +22,8 @@ const g = (e, i = "MM/dd/yyyy") => {
|
|
|
22
22
|
startMonth: Z,
|
|
23
23
|
endMonth: Y,
|
|
24
24
|
showFooter: m = !0,
|
|
25
|
-
calendarType:
|
|
26
|
-
fiscalMode:
|
|
25
|
+
calendarType: v = "calendar",
|
|
26
|
+
fiscalMode: T = "basic",
|
|
27
27
|
selectionMode: E = "week",
|
|
28
28
|
fiscalMonthPattern: A,
|
|
29
29
|
fiscalYearStartMonth: M = 1,
|
|
@@ -43,7 +43,7 @@ const g = (e, i = "MM/dd/yyyy") => {
|
|
|
43
43
|
r.useRef(null), r.useRef(null), r.useImperativeHandle(te, () => $.current);
|
|
44
44
|
const [d, I] = r.useState(!1), [y, c] = r.useState(e), [k, u] = r.useState(e?.from ? x(e.from.startDate, t) : ""), [D, h] = r.useState(e?.to ? x(e.to.endDate, t) : ""), [oe, V] = r.useState(e?.from?.startDate || /* @__PURE__ */ new Date());
|
|
45
45
|
r.useEffect(() => {
|
|
46
|
-
|
|
46
|
+
d || (u(e?.from ? x(e.from.startDate, t) : ""), h(e?.to ? x(e.to.endDate, t) : ""), c(e));
|
|
47
47
|
}, [e, t, d]), r.useEffect(() => {
|
|
48
48
|
d && (c(e), u(e?.from ? x(e.from.startDate, t) : ""), h(e?.to ? x(e.to.endDate, t) : ""), V(e?.from?.startDate || /* @__PURE__ */ new Date()));
|
|
49
49
|
}, [d, e, t]);
|
|
@@ -56,8 +56,8 @@ const g = (e, i = "MM/dd/yyyy") => {
|
|
|
56
56
|
}, z = () => {
|
|
57
57
|
c(void 0), u(""), h(""), i?.(void 0), m || I(!1);
|
|
58
58
|
}, P = (n) => De(n, {
|
|
59
|
-
calendarType:
|
|
60
|
-
fiscalMode:
|
|
59
|
+
calendarType: v,
|
|
60
|
+
fiscalMode: T,
|
|
61
61
|
selectionMode: E,
|
|
62
62
|
fiscalMonthPattern: A,
|
|
63
63
|
fiscalYearStartMonth: M,
|
|
@@ -205,8 +205,8 @@ const g = (e, i = "MM/dd/yyyy") => {
|
|
|
205
205
|
startMonth: Z,
|
|
206
206
|
endMonth: Y,
|
|
207
207
|
showFooter: m,
|
|
208
|
-
calendarType:
|
|
209
|
-
fiscalMode:
|
|
208
|
+
calendarType: v,
|
|
209
|
+
fiscalMode: T,
|
|
210
210
|
selectionMode: E,
|
|
211
211
|
fiscalMonthPattern: A,
|
|
212
212
|
fiscalYearStartMonth: M,
|
|
@@ -70,7 +70,7 @@ const M = m.forwardRef(
|
|
|
70
70
|
},
|
|
71
71
|
className: r(
|
|
72
72
|
"max-w-[400px] gap-0",
|
|
73
|
-
s && "flex flex-col items-center p-6 pt-
|
|
73
|
+
s && "flex flex-col items-center p-6 pt-6 text-center",
|
|
74
74
|
N
|
|
75
75
|
),
|
|
76
76
|
"data-component": "prompt",
|
|
@@ -80,7 +80,7 @@ const M = m.forwardRef(
|
|
|
80
80
|
"div",
|
|
81
81
|
{
|
|
82
82
|
className: r(
|
|
83
|
-
"
|
|
83
|
+
"flex h-12 w-12 items-center justify-center rounded-xl",
|
|
84
84
|
t === "info" && "bg-[#eceefd] text-[#4259ee]",
|
|
85
85
|
t === "success" && "bg-[#ebf7f1] text-[#10b981]",
|
|
86
86
|
t === "warning" && "bg-[#f6ebbf] text-[#d97706]",
|
|
@@ -97,7 +97,7 @@ const M = m.forwardRef(
|
|
|
97
97
|
/* @__PURE__ */ o(
|
|
98
98
|
E,
|
|
99
99
|
{
|
|
100
|
-
className: r(s && "
|
|
100
|
+
className: r(s && "space-y-2 items-center bg-white border-none"),
|
|
101
101
|
children: [
|
|
102
102
|
/* @__PURE__ */ e(
|
|
103
103
|
G,
|
|
@@ -118,7 +118,7 @@ const M = m.forwardRef(
|
|
|
118
118
|
]
|
|
119
119
|
}
|
|
120
120
|
),
|
|
121
|
-
d && /* @__PURE__ */ e("div", { className: r("w-full py-
|
|
121
|
+
d && /* @__PURE__ */ e("div", { className: r("w-full py-2", s && "text-center"), children: d }),
|
|
122
122
|
n ? /* @__PURE__ */ e("div", { className: "w-full", children: n }) : /* @__PURE__ */ o(
|
|
123
123
|
K,
|
|
124
124
|
{
|