impact-nova 0.1.13 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/layout/dashboard-layout.d.ts +21 -6
- package/dist/components/ui/accordion-nested-list/accordion-nested-list.js +32 -33
- package/dist/components/ui/accordion.js +25 -23
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/split-cell-editor.d.ts +5 -0
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/split-cell-editor.js +50 -52
- package/dist/components/ui/ag-grid-react/cell-renderers/input-display-renderer.d.ts +1 -1
- package/dist/components/ui/ag-grid-react/cell-renderers/split-cell-renderer.js +34 -34
- package/dist/components/ui/ag-grid-react/headers/advanced-filter/column-filter-section.js +8 -11
- package/dist/components/ui/ag-grid-react/headers/column-menu/column-settings-menu.js +17 -17
- package/dist/components/ui/ag-grid-react/headers/header-search-input.js +3 -3
- package/dist/components/ui/alert-dialog.js +45 -40
- package/dist/components/ui/alert.d.ts +21 -4
- package/dist/components/ui/alert.js +45 -25
- package/dist/components/ui/avatar.js +19 -16
- package/dist/components/ui/badge.js +8 -1
- package/dist/components/ui/breadcrumb.js +1 -0
- package/dist/components/ui/button-group.d.ts +1 -1
- package/dist/components/ui/button-group.js +27 -32
- package/dist/components/ui/button-variants.d.ts +1 -1
- package/dist/components/ui/button.d.ts +11 -0
- package/dist/components/ui/button.js +11 -9
- package/dist/components/ui/calendar.d.ts +14 -2
- package/dist/components/ui/calendar.js +443 -376
- package/dist/components/ui/card.js +7 -6
- package/dist/components/ui/checkbox.js +64 -48
- package/dist/components/ui/chips.d.ts +1 -0
- package/dist/components/ui/chips.js +27 -19
- package/dist/components/ui/data-table/data-table-column-list.d.ts +4 -1
- package/dist/components/ui/data-table/data-table-column-list.js +58 -54
- package/dist/components/ui/data-table/data-table-sheet.d.ts +1 -1
- package/dist/components/ui/data-table/data-table-sheet.js +43 -40
- package/dist/components/ui/data-table/data-table-view-options.js +17 -17
- package/dist/components/ui/data-table/data-table.js +21 -20
- package/dist/components/ui/date-picker/date-picker.js +83 -87
- package/dist/components/ui/date-picker/date-range-picker.js +129 -125
- package/dist/components/ui/date-picker/month-picker.js +90 -93
- package/dist/components/ui/date-picker/month-range-picker.js +132 -129
- package/dist/components/ui/date-picker/multi-date-picker.js +37 -38
- package/dist/components/ui/date-picker/multi-month-picker.js +29 -30
- package/dist/components/ui/date-picker/multi-week-picker.js +49 -38
- package/dist/components/ui/date-picker/week-picker.js +116 -112
- package/dist/components/ui/date-picker/week-range-picker.js +153 -142
- package/dist/components/ui/dialog.js +15 -6
- package/dist/components/ui/drawer.js +16 -13
- package/dist/components/ui/dropdown-menu.js +4 -2
- package/dist/components/ui/dynamic-layout.d.ts +2 -2
- package/dist/components/ui/dynamic-layout.js +18 -15
- package/dist/components/ui/empty-container.js +69 -64
- package/dist/components/ui/file-upload.js +113 -106
- package/dist/components/ui/filter-panel/filter-panel.js +49 -46
- package/dist/components/ui/filter-strip/filter-strip.js +41 -37
- package/dist/components/ui/header.js +26 -25
- package/dist/components/ui/horizontal-scroller/horizontal-scroller.js +43 -40
- package/dist/components/ui/hover-card.js +6 -5
- package/dist/components/ui/input.d.ts +1 -1
- package/dist/components/ui/input.js +79 -68
- package/dist/components/ui/loader.d.ts +1 -0
- package/dist/components/ui/loader.js +23 -13
- package/dist/components/ui/nested-list/components/NestedListContent.d.ts +1 -3
- package/dist/components/ui/nested-list/components/NestedListContent.js +16 -15
- package/dist/components/ui/nested-list/components/SortableItem.js +116 -80
- package/dist/components/ui/nested-list/hooks/useNestedListDragDrop.d.ts +13 -1
- package/dist/components/ui/nested-list/hooks/useNestedListDragDrop.js +162 -112
- package/dist/components/ui/nested-list/nested-list.js +182 -189
- package/dist/components/ui/notification-panel/notification-item.js +19 -17
- package/dist/components/ui/notification-panel/notification-list.js +21 -21
- package/dist/components/ui/notification-panel/notification-panel.js +25 -25
- package/dist/components/ui/popover.js +37 -34
- package/dist/components/ui/progress.js +12 -10
- package/dist/components/ui/prompt.js +29 -27
- package/dist/components/ui/radio-group.js +55 -46
- package/dist/components/ui/select/components/Submenu.d.ts +1 -2
- package/dist/components/ui/select/components/Submenu.js +52 -48
- package/dist/components/ui/select/select.js +321 -324
- package/dist/components/ui/sheet.js +18 -15
- package/dist/components/ui/sidebar.d.ts +2 -2
- package/dist/components/ui/sidebar.js +3 -3
- package/dist/components/ui/skeleton.d.ts +2 -1
- package/dist/components/ui/skeleton.js +12 -11
- package/dist/components/ui/slider.js +39 -12
- package/dist/components/ui/smart-input.js +44 -39
- package/dist/components/ui/stepper.js +33 -29
- package/dist/components/ui/switch.js +6 -4
- package/dist/components/ui/tabs.js +50 -45
- package/dist/components/ui/tag-group.d.ts +2 -1
- package/dist/components/ui/tag-group.js +29 -25
- package/dist/components/ui/tag.d.ts +1 -0
- package/dist/components/ui/tag.js +26 -20
- package/dist/components/ui/textarea.js +18 -17
- package/dist/components/ui/toast.d.ts +1 -1
- package/dist/components/ui/toast.js +47 -41
- package/dist/components/ui/toaster.js +42 -42
- package/dist/components/ui/tooltip.js +18 -16
- package/dist/components/ui/types/date-picker.types.d.ts +33 -0
- package/dist/components/ui/types/empty-container.types.d.ts +5 -0
- package/dist/components/ui/types/nested-list.types.d.ts +1 -0
- package/dist/components/ui/types/select.types.d.ts +0 -1
- package/dist/icons/assets/bookmark.svg.js +4 -0
- package/dist/icons/assets/bookmark.svg2.js +5 -0
- package/dist/icons/assets/bookmarkFilled.svg.js +4 -0
- package/dist/icons/assets/bookmarkFilled.svg2.js +5 -0
- package/dist/icons/assets/download.svg.js +4 -0
- package/dist/icons/assets/download.svg2.js +5 -0
- package/dist/icons/index.d.ts +20 -6
- package/dist/icons/index.js +398 -370
- package/dist/impact-nova.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +318 -314
- package/dist/lib/fiscal-calendar.d.ts +62 -0
- package/dist/lib/fiscal-calendar.js +99 -0
- package/package.json +5 -5
- package/dist/components/ui/select/hooks/useClickOutside.d.ts +0 -15
- package/dist/components/ui/select/hooks/useClickOutside.js +0 -43
- package/dist/components/ui/select/hooks/useMenuPosition.d.ts +0 -2
- package/dist/components/ui/select/hooks/useMenuPosition.js +0 -89
|
@@ -1,79 +1,78 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as m, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import * as a from "react";
|
|
3
|
-
import { X as
|
|
3
|
+
import { X as O } from "lucide-react";
|
|
4
4
|
import { CalendarMonth as k } from "../../../icons/index.js";
|
|
5
|
-
import { format as
|
|
6
|
-
import { cn as
|
|
7
|
-
import { Input as
|
|
8
|
-
import { Popover as
|
|
9
|
-
import { Calendar as
|
|
5
|
+
import { format as w } from "date-fns";
|
|
6
|
+
import { cn as T } from "../../../lib/utils.js";
|
|
7
|
+
import { Input as j } from "../input.js";
|
|
8
|
+
import { Popover as v, PopoverTrigger as R, PopoverContent as E } from "../popover.js";
|
|
9
|
+
import { Calendar as I } from "../calendar.js";
|
|
10
10
|
const L = a.forwardRef(
|
|
11
11
|
({
|
|
12
|
-
value:
|
|
12
|
+
value: e,
|
|
13
13
|
onChange: s,
|
|
14
|
-
format:
|
|
15
|
-
placeholder:
|
|
16
|
-
minDate:
|
|
14
|
+
format: f = "MM/dd/yyyy",
|
|
15
|
+
placeholder: h = "Select Dates",
|
|
16
|
+
minDate: u,
|
|
17
17
|
maxDate: y,
|
|
18
18
|
fromYear: g,
|
|
19
19
|
toYear: C,
|
|
20
20
|
showFooter: l = !0,
|
|
21
21
|
disabled: c,
|
|
22
|
-
className:
|
|
23
|
-
...
|
|
22
|
+
className: x,
|
|
23
|
+
...D
|
|
24
24
|
}, P) => {
|
|
25
|
-
const [i, r] = a.useState(!1), [p, n] = a.useState(
|
|
25
|
+
const [i, r] = a.useState(!1), [p, n] = a.useState(e);
|
|
26
26
|
a.useEffect(() => {
|
|
27
|
-
i && n(
|
|
27
|
+
i && n(e);
|
|
28
28
|
}, [i]);
|
|
29
|
-
const N = (
|
|
30
|
-
n(
|
|
31
|
-
}, A = (
|
|
32
|
-
s?.(
|
|
29
|
+
const N = (t) => {
|
|
30
|
+
n(t), l || s?.(t);
|
|
31
|
+
}, A = (t) => {
|
|
32
|
+
s?.(t !== void 0 ? t : p), r(!1);
|
|
33
33
|
}, M = () => {
|
|
34
|
-
n(
|
|
34
|
+
n(e), r(!1);
|
|
35
35
|
}, d = () => {
|
|
36
36
|
n(void 0), s?.(void 0), l || r(!1);
|
|
37
|
-
},
|
|
38
|
-
return /* @__PURE__ */
|
|
39
|
-
/* @__PURE__ */ o(
|
|
40
|
-
|
|
37
|
+
}, S = e && e.length > 0 ? e.length === 1 ? w(e[0], f) : `${e.length} dates selected` : "";
|
|
38
|
+
return /* @__PURE__ */ m(v, { open: i, onOpenChange: r, children: [
|
|
39
|
+
/* @__PURE__ */ o(R, { asChild: !0, children: /* @__PURE__ */ o("div", { children: /* @__PURE__ */ o(
|
|
40
|
+
j,
|
|
41
41
|
{
|
|
42
42
|
ref: P,
|
|
43
|
-
value:
|
|
44
|
-
placeholder:
|
|
43
|
+
value: S,
|
|
44
|
+
placeholder: h,
|
|
45
45
|
readOnly: !0,
|
|
46
46
|
disabled: c,
|
|
47
|
-
className:
|
|
48
|
-
suffix: /* @__PURE__ */
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
className: T("cursor-pointer", x),
|
|
48
|
+
suffix: /* @__PURE__ */ m("div", { className: "flex items-center gap-1", children: [
|
|
49
|
+
e && e.length > 0 && !c && /* @__PURE__ */ o(
|
|
50
|
+
O,
|
|
51
51
|
{
|
|
52
52
|
className: "h-4 w-4 cursor-pointer hover:text-foreground",
|
|
53
|
-
onClick: (
|
|
54
|
-
|
|
53
|
+
onClick: (t) => {
|
|
54
|
+
t.stopPropagation(), d();
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
),
|
|
58
58
|
/* @__PURE__ */ o(k, { className: "h-4 w-4 text-secondary-foreground" })
|
|
59
59
|
] }),
|
|
60
|
-
...
|
|
60
|
+
...D
|
|
61
61
|
}
|
|
62
62
|
) }) }),
|
|
63
63
|
/* @__PURE__ */ o(
|
|
64
|
-
|
|
64
|
+
E,
|
|
65
65
|
{
|
|
66
66
|
className: "w-auto p-0",
|
|
67
67
|
align: "start",
|
|
68
|
-
onOpenAutoFocus: (
|
|
69
|
-
onInteractOutside: (e) => e.preventDefault(),
|
|
68
|
+
onOpenAutoFocus: (t) => t.preventDefault(),
|
|
70
69
|
children: /* @__PURE__ */ o(
|
|
71
|
-
|
|
70
|
+
I,
|
|
72
71
|
{
|
|
73
72
|
mode: "multiple",
|
|
74
73
|
selected: p,
|
|
75
74
|
onSelect: N,
|
|
76
|
-
fromDate:
|
|
75
|
+
fromDate: u,
|
|
77
76
|
toDate: y,
|
|
78
77
|
fromYear: g,
|
|
79
78
|
toYear: C,
|
|
@@ -1,51 +1,51 @@
|
|
|
1
1
|
import { jsxs as d, jsx as o } 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
|
|
7
|
-
import { Popover as
|
|
8
|
-
import { Calendar as
|
|
9
|
-
const
|
|
3
|
+
import { X as k } from "lucide-react";
|
|
4
|
+
import { CalendarMonth as O } from "../../../icons/index.js";
|
|
5
|
+
import { cn as T } from "../../../lib/utils.js";
|
|
6
|
+
import { Input as w } from "../input.js";
|
|
7
|
+
import { Popover as D, PopoverTrigger as $, PopoverContent as j } from "../popover.js";
|
|
8
|
+
import { Calendar as R } from "../calendar.js";
|
|
9
|
+
const v = s.forwardRef(
|
|
10
10
|
({
|
|
11
11
|
value: e,
|
|
12
|
-
onChange:
|
|
12
|
+
onChange: c,
|
|
13
13
|
placeholder: f = "Select Months",
|
|
14
14
|
minDate: h,
|
|
15
15
|
maxDate: u,
|
|
16
16
|
fromYear: g,
|
|
17
17
|
toYear: y,
|
|
18
|
-
showFooter:
|
|
19
|
-
disabled:
|
|
18
|
+
showFooter: i = !0,
|
|
19
|
+
disabled: a,
|
|
20
20
|
className: M,
|
|
21
21
|
...C
|
|
22
22
|
}, x) => {
|
|
23
|
-
const [
|
|
23
|
+
const [l, n] = s.useState(!1), [p, r] = s.useState(e);
|
|
24
24
|
s.useEffect(() => {
|
|
25
|
-
|
|
26
|
-
}, [
|
|
25
|
+
l && r(e);
|
|
26
|
+
}, [l]);
|
|
27
27
|
const P = (t) => {
|
|
28
|
-
r(t),
|
|
28
|
+
r(t), i || c?.(t);
|
|
29
29
|
}, N = (t) => {
|
|
30
|
-
|
|
30
|
+
c?.(t !== void 0 ? t : p), n(!1);
|
|
31
31
|
}, A = () => {
|
|
32
32
|
r(e), n(!1);
|
|
33
33
|
}, m = () => {
|
|
34
|
-
r(void 0),
|
|
35
|
-
},
|
|
36
|
-
return /* @__PURE__ */ d(
|
|
34
|
+
r(void 0), c?.(void 0), i || n(!1);
|
|
35
|
+
}, S = e && e.length > 0 ? e.length === 1 ? `${e[0].month + 1}/${e[0].year}` : `${e.length} months selected` : "";
|
|
36
|
+
return /* @__PURE__ */ d(D, { open: l, onOpenChange: n, children: [
|
|
37
37
|
/* @__PURE__ */ o($, { asChild: !0, children: /* @__PURE__ */ o("div", { children: /* @__PURE__ */ o(
|
|
38
|
-
|
|
38
|
+
w,
|
|
39
39
|
{
|
|
40
40
|
ref: x,
|
|
41
|
-
value:
|
|
41
|
+
value: S,
|
|
42
42
|
placeholder: f,
|
|
43
43
|
readOnly: !0,
|
|
44
|
-
disabled:
|
|
45
|
-
className:
|
|
44
|
+
disabled: a,
|
|
45
|
+
className: T("cursor-pointer", M),
|
|
46
46
|
suffix: /* @__PURE__ */ d("div", { className: "flex items-center gap-1", children: [
|
|
47
|
-
e && e.length > 0 && !
|
|
48
|
-
|
|
47
|
+
e && e.length > 0 && !a && /* @__PURE__ */ o(
|
|
48
|
+
k,
|
|
49
49
|
{
|
|
50
50
|
className: "h-4 w-4 cursor-pointer hover:text-foreground",
|
|
51
51
|
onClick: (t) => {
|
|
@@ -53,7 +53,7 @@ const I = s.forwardRef(
|
|
|
53
53
|
}
|
|
54
54
|
}
|
|
55
55
|
),
|
|
56
|
-
/* @__PURE__ */ o(
|
|
56
|
+
/* @__PURE__ */ o(O, { className: "h-4 w-4 text-secondary-foreground" })
|
|
57
57
|
] }),
|
|
58
58
|
...C
|
|
59
59
|
}
|
|
@@ -64,9 +64,8 @@ const I = s.forwardRef(
|
|
|
64
64
|
className: "w-auto p-0",
|
|
65
65
|
align: "start",
|
|
66
66
|
onOpenAutoFocus: (t) => t.preventDefault(),
|
|
67
|
-
onInteractOutside: (t) => t.preventDefault(),
|
|
68
67
|
children: /* @__PURE__ */ o(
|
|
69
|
-
|
|
68
|
+
R,
|
|
70
69
|
{
|
|
71
70
|
pickerType: "month",
|
|
72
71
|
monthMode: "multiple",
|
|
@@ -76,7 +75,7 @@ const I = s.forwardRef(
|
|
|
76
75
|
toDate: u,
|
|
77
76
|
fromYear: g,
|
|
78
77
|
toYear: y,
|
|
79
|
-
showFooter:
|
|
78
|
+
showFooter: i,
|
|
80
79
|
onApply: N,
|
|
81
80
|
onCancel: A,
|
|
82
81
|
onClear: m,
|
|
@@ -88,7 +87,7 @@ const I = s.forwardRef(
|
|
|
88
87
|
] });
|
|
89
88
|
}
|
|
90
89
|
);
|
|
91
|
-
|
|
90
|
+
v.displayName = "MultiMonthPicker";
|
|
92
91
|
export {
|
|
93
|
-
|
|
92
|
+
v as MultiMonthPicker
|
|
94
93
|
};
|
|
@@ -1,56 +1,62 @@
|
|
|
1
1
|
import { jsxs as y, jsx as o } from "react/jsx-runtime";
|
|
2
2
|
import * as a from "react";
|
|
3
|
-
import { X as
|
|
4
|
-
import { CalendarMonth as
|
|
5
|
-
import { format as
|
|
6
|
-
import { cn as
|
|
7
|
-
import { Input as
|
|
8
|
-
import { Popover as
|
|
9
|
-
import { Calendar as
|
|
10
|
-
const
|
|
11
|
-
const c =
|
|
3
|
+
import { X as v } from "lucide-react";
|
|
4
|
+
import { CalendarMonth as R } from "../../../icons/index.js";
|
|
5
|
+
import { format as h } from "date-fns";
|
|
6
|
+
import { cn as E } from "../../../lib/utils.js";
|
|
7
|
+
import { Input as I } from "../input.js";
|
|
8
|
+
import { Popover as L, PopoverTrigger as V, PopoverContent as X } from "../popover.js";
|
|
9
|
+
import { Calendar as b } from "../calendar.js";
|
|
10
|
+
const q = (e, r = "MM/dd/yyyy") => {
|
|
11
|
+
const c = h(e.startDate, r), i = h(e.endDate, r);
|
|
12
12
|
return `${c} - ${i}`;
|
|
13
|
-
},
|
|
13
|
+
}, z = a.forwardRef(
|
|
14
14
|
({
|
|
15
15
|
value: e,
|
|
16
16
|
onChange: r,
|
|
17
17
|
format: c = "MM/dd/yyyy",
|
|
18
18
|
placeholder: i = "Select Weeks",
|
|
19
|
-
minDate:
|
|
20
|
-
maxDate:
|
|
19
|
+
minDate: k,
|
|
20
|
+
maxDate: u,
|
|
21
21
|
fromYear: g,
|
|
22
22
|
toYear: C,
|
|
23
23
|
showFooter: l = !0,
|
|
24
|
+
calendarType: M = "calendar",
|
|
25
|
+
fiscalMode: w = "basic",
|
|
26
|
+
selectionMode: x = "week",
|
|
27
|
+
fiscalMonthPattern: P,
|
|
28
|
+
fiscalYearStartMonth: S = 1,
|
|
29
|
+
weekStartsOn: W = 1,
|
|
24
30
|
disabled: d,
|
|
25
|
-
className:
|
|
26
|
-
...
|
|
27
|
-
},
|
|
31
|
+
className: N,
|
|
32
|
+
...A
|
|
33
|
+
}, D) => {
|
|
28
34
|
const [p, n] = a.useState(!1), [f, s] = a.useState(e);
|
|
29
35
|
a.useEffect(() => {
|
|
30
36
|
p && s(e);
|
|
31
37
|
}, [p]);
|
|
32
|
-
const
|
|
38
|
+
const O = (t) => {
|
|
33
39
|
s(t), l || r?.(t);
|
|
34
|
-
},
|
|
40
|
+
}, T = (t) => {
|
|
35
41
|
r?.(t !== void 0 ? t : f), n(!1);
|
|
36
|
-
},
|
|
42
|
+
}, $ = () => {
|
|
37
43
|
s(e), n(!1);
|
|
38
44
|
}, m = () => {
|
|
39
45
|
s(void 0), r?.(void 0), l || n(!1);
|
|
40
|
-
},
|
|
41
|
-
return /* @__PURE__ */ y(
|
|
42
|
-
/* @__PURE__ */ o(
|
|
43
|
-
|
|
46
|
+
}, j = e && e.length > 0 ? e.length === 1 ? q(e[0], c) : `${e.length} weeks selected` : "";
|
|
47
|
+
return /* @__PURE__ */ y(L, { open: p, onOpenChange: n, children: [
|
|
48
|
+
/* @__PURE__ */ o(V, { asChild: !0, children: /* @__PURE__ */ o("div", { children: /* @__PURE__ */ o(
|
|
49
|
+
I,
|
|
44
50
|
{
|
|
45
|
-
ref:
|
|
46
|
-
value:
|
|
51
|
+
ref: D,
|
|
52
|
+
value: j,
|
|
47
53
|
placeholder: i,
|
|
48
54
|
readOnly: !0,
|
|
49
55
|
disabled: d,
|
|
50
|
-
className:
|
|
56
|
+
className: E("cursor-pointer", N),
|
|
51
57
|
suffix: /* @__PURE__ */ y("div", { className: "flex items-center gap-1", children: [
|
|
52
58
|
e && e.length > 0 && !d && /* @__PURE__ */ o(
|
|
53
|
-
|
|
59
|
+
v,
|
|
54
60
|
{
|
|
55
61
|
className: "h-4 w-4 cursor-pointer hover:text-foreground",
|
|
56
62
|
onClick: (t) => {
|
|
@@ -58,32 +64,37 @@ const R = (e, r = "MM/dd/yyyy") => {
|
|
|
58
64
|
}
|
|
59
65
|
}
|
|
60
66
|
),
|
|
61
|
-
/* @__PURE__ */ o(
|
|
67
|
+
/* @__PURE__ */ o(R, { className: "h-4 w-4 text-secondary-foreground" })
|
|
62
68
|
] }),
|
|
63
|
-
...
|
|
69
|
+
...A
|
|
64
70
|
}
|
|
65
71
|
) }) }),
|
|
66
72
|
/* @__PURE__ */ o(
|
|
67
|
-
|
|
73
|
+
X,
|
|
68
74
|
{
|
|
69
75
|
className: "w-auto p-0",
|
|
70
76
|
align: "start",
|
|
71
77
|
onOpenAutoFocus: (t) => t.preventDefault(),
|
|
72
|
-
onInteractOutside: (t) => t.preventDefault(),
|
|
73
78
|
children: /* @__PURE__ */ o(
|
|
74
|
-
|
|
79
|
+
b,
|
|
75
80
|
{
|
|
76
81
|
pickerType: "week",
|
|
77
82
|
weekMode: "multiple",
|
|
78
83
|
selectedWeeks: f,
|
|
79
|
-
onWeekSelect:
|
|
80
|
-
fromDate:
|
|
81
|
-
toDate:
|
|
84
|
+
onWeekSelect: O,
|
|
85
|
+
fromDate: k,
|
|
86
|
+
toDate: u,
|
|
82
87
|
fromYear: g,
|
|
83
88
|
toYear: C,
|
|
84
89
|
showFooter: l,
|
|
85
|
-
|
|
86
|
-
|
|
90
|
+
calendarType: M,
|
|
91
|
+
fiscalMode: w,
|
|
92
|
+
selectionMode: x,
|
|
93
|
+
fiscalMonthPattern: P,
|
|
94
|
+
fiscalYearStartMonth: S,
|
|
95
|
+
weekStartsOn: W,
|
|
96
|
+
onApply: T,
|
|
97
|
+
onCancel: $,
|
|
87
98
|
onClear: m,
|
|
88
99
|
captionLayout: "dropdown"
|
|
89
100
|
}
|
|
@@ -93,7 +104,7 @@ const R = (e, r = "MM/dd/yyyy") => {
|
|
|
93
104
|
] });
|
|
94
105
|
}
|
|
95
106
|
);
|
|
96
|
-
|
|
107
|
+
z.displayName = "MultiWeekPicker";
|
|
97
108
|
export {
|
|
98
|
-
|
|
109
|
+
z as MultiWeekPicker
|
|
99
110
|
};
|
|
@@ -1,131 +1,135 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { X as
|
|
4
|
-
import { CalendarMonth as
|
|
5
|
-
import { format as
|
|
6
|
-
import { cn as
|
|
7
|
-
import { Input as
|
|
8
|
-
import { Popover as
|
|
9
|
-
import { Calendar as
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
1
|
+
import { jsxs as A, jsx as i } from "react/jsx-runtime";
|
|
2
|
+
import * as a from "react";
|
|
3
|
+
import { X as H } from "lucide-react";
|
|
4
|
+
import { CalendarMonth as J } from "../../../icons/index.js";
|
|
5
|
+
import { format as M, parse as K, isValid as Q } from "date-fns";
|
|
6
|
+
import { cn as U, maskDate as Z } from "../../../lib/utils.js";
|
|
7
|
+
import { Input as _ } from "../input.js";
|
|
8
|
+
import { Popover as Y, PopoverTrigger as F, PopoverContent as ee } from "../popover.js";
|
|
9
|
+
import { Calendar as te } from "../calendar.js";
|
|
10
|
+
import { resolveWeekSelection as ne } from "../../../lib/fiscal-calendar.js";
|
|
11
|
+
const f = (t, r = "MM/dd/yyyy") => {
|
|
12
|
+
const n = M(t.startDate, r), m = M(t.endDate, r);
|
|
13
|
+
return `${n} - ${m}`;
|
|
14
|
+
}, oe = a.forwardRef(
|
|
14
15
|
({
|
|
15
|
-
value:
|
|
16
|
-
onChange:
|
|
17
|
-
format:
|
|
18
|
-
placeholder:
|
|
19
|
-
minDate:
|
|
20
|
-
maxDate:
|
|
21
|
-
fromYear:
|
|
22
|
-
toYear:
|
|
23
|
-
showFooter:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
},
|
|
43
|
-
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
16
|
+
value: t,
|
|
17
|
+
onChange: r,
|
|
18
|
+
format: n = "MM/dd/yyyy",
|
|
19
|
+
placeholder: m = "Select Week",
|
|
20
|
+
minDate: V,
|
|
21
|
+
maxDate: I,
|
|
22
|
+
fromYear: $,
|
|
23
|
+
toYear: T,
|
|
24
|
+
showFooter: c = !0,
|
|
25
|
+
calendarType: D = "calendar",
|
|
26
|
+
fiscalMode: C = "basic",
|
|
27
|
+
selectionMode: W = "week",
|
|
28
|
+
fiscalMonthPattern: S,
|
|
29
|
+
fiscalYearStartMonth: v = 1,
|
|
30
|
+
weekStartsOn: w = 1,
|
|
31
|
+
disabled: x,
|
|
32
|
+
className: j,
|
|
33
|
+
...B
|
|
34
|
+
}, E) => {
|
|
35
|
+
const [o, l] = a.useState(!1), [s, p] = a.useState(t), [k, d] = a.useState(t ? f(t, n) : ""), [L, y] = a.useState(t?.startDate || /* @__PURE__ */ new Date());
|
|
36
|
+
a.useEffect(() => {
|
|
37
|
+
d(t ? f(t, n) : "");
|
|
38
|
+
}, [t, n]), a.useEffect(() => {
|
|
39
|
+
o && (p(t), y(t?.startDate || /* @__PURE__ */ new Date()));
|
|
40
|
+
}, [o]);
|
|
41
|
+
const O = (e) => {
|
|
42
|
+
p(e), c || (r?.(e), l(!1));
|
|
43
|
+
}, R = (e) => {
|
|
44
|
+
r?.(e !== void 0 ? e : s), l(!1);
|
|
45
|
+
}, X = () => {
|
|
46
|
+
p(t), l(!1);
|
|
47
|
+
}, g = () => {
|
|
48
|
+
p(void 0), d(""), r?.(void 0), c || l(!1);
|
|
49
|
+
}, b = (e) => ne(e, {
|
|
50
|
+
calendarType: D,
|
|
51
|
+
fiscalMode: C,
|
|
52
|
+
selectionMode: W,
|
|
53
|
+
fiscalMonthPattern: S,
|
|
54
|
+
fiscalYearStartMonth: v,
|
|
55
|
+
weekStartsOn: w
|
|
56
|
+
}), q = (e) => {
|
|
57
|
+
const u = Z(e.target.value, n);
|
|
58
|
+
if (d(u), u === "") {
|
|
59
|
+
p(void 0), c || r?.(void 0);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const h = K(u, n, /* @__PURE__ */ new Date());
|
|
63
|
+
if (Q(h)) {
|
|
64
|
+
const N = b(h);
|
|
65
|
+
p(N), y(h), c || r?.(N);
|
|
66
|
+
}
|
|
67
|
+
}, z = () => {
|
|
68
|
+
if (!o) {
|
|
69
|
+
if (k === "") {
|
|
70
|
+
g();
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
d(s ? f(s, n) : "");
|
|
74
|
+
}
|
|
75
|
+
}, P = c && o && (s ? f(s, n) : "") !== k, G = c && o ? s ? f(s, n) : "" : k;
|
|
76
|
+
return /* @__PURE__ */ A(Y, { open: o, onOpenChange: l, children: [
|
|
77
|
+
/* @__PURE__ */ i(F, { asChild: !0, children: /* @__PURE__ */ i("div", { "data-component": "week-picker", "data-state": o ? "open" : "closed", "data-pending": P || void 0, children: /* @__PURE__ */ i(
|
|
78
|
+
_,
|
|
63
79
|
{
|
|
64
|
-
ref:
|
|
65
|
-
value:
|
|
66
|
-
onChange:
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
|
-
onBlur: () => {
|
|
79
|
-
if (W === "") {
|
|
80
|
-
D();
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
g(l ? h(l, o) : "");
|
|
84
|
-
},
|
|
85
|
-
onClick: (e) => c && e.stopPropagation(),
|
|
86
|
-
placeholder: c ? `${o} - ${o}` : k,
|
|
87
|
-
disabled: m,
|
|
88
|
-
className: z("cursor-pointer", v),
|
|
89
|
-
suffix: /* @__PURE__ */ M("div", { className: "flex items-center gap-1", children: [
|
|
90
|
-
n && !m && /* @__PURE__ */ r(
|
|
91
|
-
R,
|
|
80
|
+
ref: E,
|
|
81
|
+
value: G,
|
|
82
|
+
onChange: q,
|
|
83
|
+
onBlur: z,
|
|
84
|
+
onClick: (e) => o && e.stopPropagation(),
|
|
85
|
+
placeholder: o ? `${n} - ${n}` : m,
|
|
86
|
+
disabled: x,
|
|
87
|
+
"data-form-control": "input",
|
|
88
|
+
className: U("cursor-pointer", P && "text-muted-foreground", j),
|
|
89
|
+
suffix: /* @__PURE__ */ A("div", { className: "flex items-center gap-1", children: [
|
|
90
|
+
t && !x && /* @__PURE__ */ i(
|
|
91
|
+
H,
|
|
92
92
|
{
|
|
93
93
|
className: "h-4 w-4 cursor-pointer hover:text-foreground",
|
|
94
94
|
onClick: (e) => {
|
|
95
|
-
e.stopPropagation(),
|
|
95
|
+
e.stopPropagation(), g();
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
),
|
|
99
|
-
/* @__PURE__ */
|
|
99
|
+
/* @__PURE__ */ i(J, { className: "h-4 w-4 text-secondary-foreground" })
|
|
100
100
|
] }),
|
|
101
|
-
...
|
|
101
|
+
...B
|
|
102
102
|
}
|
|
103
103
|
) }) }),
|
|
104
|
-
/* @__PURE__ */
|
|
105
|
-
|
|
104
|
+
/* @__PURE__ */ i(
|
|
105
|
+
ee,
|
|
106
106
|
{
|
|
107
107
|
className: "w-auto p-0",
|
|
108
108
|
align: "start",
|
|
109
109
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
U,
|
|
110
|
+
children: /* @__PURE__ */ i(
|
|
111
|
+
te,
|
|
113
112
|
{
|
|
114
113
|
pickerType: "week",
|
|
115
114
|
weekMode: "single",
|
|
116
|
-
selectedWeeks:
|
|
117
|
-
onWeekSelect:
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
115
|
+
selectedWeeks: s,
|
|
116
|
+
onWeekSelect: O,
|
|
117
|
+
month: L,
|
|
118
|
+
onMonthChange: y,
|
|
119
|
+
fromDate: V,
|
|
120
|
+
toDate: I,
|
|
121
|
+
fromYear: $,
|
|
122
|
+
toYear: T,
|
|
123
|
+
showFooter: c,
|
|
124
|
+
calendarType: D,
|
|
125
|
+
fiscalMode: C,
|
|
126
|
+
selectionMode: W,
|
|
127
|
+
fiscalMonthPattern: S,
|
|
128
|
+
fiscalYearStartMonth: v,
|
|
129
|
+
weekStartsOn: w,
|
|
130
|
+
onApply: R,
|
|
131
|
+
onCancel: X,
|
|
132
|
+
onClear: g,
|
|
129
133
|
captionLayout: "dropdown"
|
|
130
134
|
}
|
|
131
135
|
)
|
|
@@ -134,7 +138,7 @@ const h = (n, a = "MM/dd/yyyy") => {
|
|
|
134
138
|
] });
|
|
135
139
|
}
|
|
136
140
|
);
|
|
137
|
-
|
|
141
|
+
oe.displayName = "WeekPicker";
|
|
138
142
|
export {
|
|
139
|
-
|
|
143
|
+
oe as WeekPicker
|
|
140
144
|
};
|