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,114 +1,111 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { X as
|
|
4
|
-
import { CalendarMonth as
|
|
5
|
-
import { parse as
|
|
6
|
-
import { cn as
|
|
7
|
-
import { Input as
|
|
8
|
-
import { Popover as
|
|
9
|
-
import { Calendar as
|
|
10
|
-
const
|
|
1
|
+
import { jsxs as C, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import * as s from "react";
|
|
3
|
+
import { X as E } from "lucide-react";
|
|
4
|
+
import { CalendarMonth as R } from "../../../icons/index.js";
|
|
5
|
+
import { parse as $, isValid as X } from "date-fns";
|
|
6
|
+
import { cn as q, maskDate as z } from "../../../lib/utils.js";
|
|
7
|
+
import { Input as G } from "../input.js";
|
|
8
|
+
import { Popover as H, PopoverTrigger as J, PopoverContent as K } from "../popover.js";
|
|
9
|
+
import { Calendar as L } from "../calendar.js";
|
|
10
|
+
const d = (t) => `${(t.month + 1).toString().padStart(2, "0")}/${t.year}`, Q = s.forwardRef(
|
|
11
11
|
({
|
|
12
|
-
value:
|
|
13
|
-
onChange:
|
|
14
|
-
placeholder:
|
|
15
|
-
minDate:
|
|
16
|
-
maxDate:
|
|
17
|
-
fromYear:
|
|
12
|
+
value: t,
|
|
13
|
+
onChange: i,
|
|
14
|
+
placeholder: D = "Select Month",
|
|
15
|
+
minDate: P,
|
|
16
|
+
maxDate: x,
|
|
17
|
+
fromYear: k,
|
|
18
18
|
toYear: w,
|
|
19
|
-
showFooter:
|
|
20
|
-
disabled:
|
|
21
|
-
className:
|
|
22
|
-
...
|
|
23
|
-
},
|
|
24
|
-
const [
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}, [
|
|
28
|
-
|
|
29
|
-
}, [
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
h(t ? f(t) : "");
|
|
35
|
-
}, V = (n) => {
|
|
36
|
-
const t = n !== void 0 ? n : c;
|
|
37
|
-
console.log("[MonthPicker] handleApply called, appliedMonth:", n, "pendingMonth:", c, "using:", t), a?.(t), p(!1);
|
|
19
|
+
showFooter: r = !0,
|
|
20
|
+
disabled: M,
|
|
21
|
+
className: N,
|
|
22
|
+
...A
|
|
23
|
+
}, V) => {
|
|
24
|
+
const [n, p] = s.useState(!1), [o, c] = s.useState(t), [h, l] = s.useState(t ? d(t) : ""), [Y, u] = s.useState(() => t ? new Date(t.year, t.month, 1) : /* @__PURE__ */ new Date());
|
|
25
|
+
s.useEffect(() => {
|
|
26
|
+
l(t ? d(t) : "");
|
|
27
|
+
}, [t]), s.useEffect(() => {
|
|
28
|
+
n && (c(t), u(t ? new Date(t.year, t.month, 1) : /* @__PURE__ */ new Date()));
|
|
29
|
+
}, [n]);
|
|
30
|
+
const I = (e) => {
|
|
31
|
+
c(e), r || (i?.(e), p(!1));
|
|
32
|
+
}, T = (e) => {
|
|
33
|
+
i?.(e !== void 0 ? e : o), p(!1);
|
|
38
34
|
}, v = () => {
|
|
39
|
-
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
35
|
+
c(t), p(!1);
|
|
36
|
+
}, y = () => {
|
|
37
|
+
c(void 0), l(""), i?.(void 0), r || p(!1);
|
|
38
|
+
}, O = (e) => {
|
|
39
|
+
const m = z(e.target.value, "MM/yyyy");
|
|
40
|
+
if (l(m), m === "") {
|
|
41
|
+
c(void 0), r || i?.(void 0);
|
|
42
|
+
return;
|
|
43
|
+
}
|
|
44
|
+
const f = $(m, "MM/yyyy", /* @__PURE__ */ new Date());
|
|
45
|
+
if (X(f)) {
|
|
46
|
+
const S = { month: f.getMonth(), year: f.getFullYear() };
|
|
47
|
+
c(S), u(f), r || i?.(S);
|
|
48
|
+
}
|
|
49
|
+
}, j = () => {
|
|
50
|
+
if (!n) {
|
|
51
|
+
if (h === "") {
|
|
52
|
+
y();
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
l(o ? d(o) : "");
|
|
56
|
+
}
|
|
57
|
+
}, g = r && n && (o ? d(o) : "") !== h, B = r && n ? o ? d(o) : "" : h;
|
|
58
|
+
return /* @__PURE__ */ C(H, { open: n, onOpenChange: p, children: [
|
|
59
|
+
/* @__PURE__ */ a(J, { asChild: !0, children: /* @__PURE__ */ a("div", { "data-component": "month-picker", "data-state": n ? "open" : "closed", "data-pending": g || void 0, children: /* @__PURE__ */ a(
|
|
60
|
+
G,
|
|
46
61
|
{
|
|
47
|
-
ref:
|
|
48
|
-
value:
|
|
49
|
-
onChange:
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
onBlur: () => {
|
|
62
|
-
if (M === "") {
|
|
63
|
-
g();
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
h(c ? f(c) : "");
|
|
67
|
-
},
|
|
68
|
-
onClick: (n) => l && n.stopPropagation(),
|
|
69
|
-
placeholder: l ? "MM/YYYY" : C,
|
|
70
|
-
disabled: u,
|
|
71
|
-
className: R("cursor-pointer", x),
|
|
72
|
-
suffix: /* @__PURE__ */ P("div", { className: "flex items-center gap-1", children: [
|
|
73
|
-
e && !u && /* @__PURE__ */ o(
|
|
74
|
-
B,
|
|
62
|
+
ref: V,
|
|
63
|
+
value: B,
|
|
64
|
+
onChange: O,
|
|
65
|
+
onBlur: j,
|
|
66
|
+
onClick: (e) => n && e.stopPropagation(),
|
|
67
|
+
placeholder: n ? "MM/YYYY" : D,
|
|
68
|
+
disabled: M,
|
|
69
|
+
"data-form-control": "input",
|
|
70
|
+
className: q("cursor-pointer", g && "text-muted-foreground", N),
|
|
71
|
+
suffix: /* @__PURE__ */ C("div", { className: "flex items-center gap-1", children: [
|
|
72
|
+
t && !M && /* @__PURE__ */ a(
|
|
73
|
+
E,
|
|
75
74
|
{
|
|
76
75
|
className: "h-4 w-4 cursor-pointer hover:text-foreground",
|
|
77
|
-
onClick: (
|
|
78
|
-
|
|
76
|
+
onClick: (e) => {
|
|
77
|
+
e.stopPropagation(), y();
|
|
79
78
|
}
|
|
80
79
|
}
|
|
81
80
|
),
|
|
82
|
-
/* @__PURE__ */
|
|
81
|
+
/* @__PURE__ */ a(R, { className: "h-4 w-4 text-secondary-foreground" })
|
|
83
82
|
] }),
|
|
84
|
-
...
|
|
83
|
+
...A
|
|
85
84
|
}
|
|
86
85
|
) }) }),
|
|
87
|
-
/* @__PURE__ */
|
|
88
|
-
|
|
86
|
+
/* @__PURE__ */ a(
|
|
87
|
+
K,
|
|
89
88
|
{
|
|
90
89
|
className: "w-auto p-0",
|
|
91
90
|
align: "start",
|
|
92
|
-
onOpenAutoFocus: (
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
H,
|
|
91
|
+
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
92
|
+
children: /* @__PURE__ */ a(
|
|
93
|
+
L,
|
|
96
94
|
{
|
|
97
95
|
pickerType: "month",
|
|
98
96
|
monthMode: "single",
|
|
99
|
-
selectedMonths:
|
|
100
|
-
onMonthSelect:
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
fromYear: D,
|
|
97
|
+
selectedMonths: o,
|
|
98
|
+
onMonthSelect: I,
|
|
99
|
+
month: Y,
|
|
100
|
+
onMonthChange: u,
|
|
101
|
+
fromDate: P,
|
|
102
|
+
toDate: x,
|
|
103
|
+
fromYear: k,
|
|
107
104
|
toYear: w,
|
|
108
|
-
showFooter:
|
|
109
|
-
onApply:
|
|
105
|
+
showFooter: r,
|
|
106
|
+
onApply: T,
|
|
110
107
|
onCancel: v,
|
|
111
|
-
onClear:
|
|
108
|
+
onClear: y
|
|
112
109
|
}
|
|
113
110
|
)
|
|
114
111
|
}
|
|
@@ -116,7 +113,7 @@ const f = (e) => `${(e.month + 1).toString().padStart(2, "0")}/${e.year}`, J = r
|
|
|
116
113
|
] });
|
|
117
114
|
}
|
|
118
115
|
);
|
|
119
|
-
|
|
116
|
+
Q.displayName = "MonthPicker";
|
|
120
117
|
export {
|
|
121
|
-
|
|
118
|
+
Q as MonthPicker
|
|
122
119
|
};
|
|
@@ -1,198 +1,201 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { X as
|
|
4
|
-
import { CalendarMonth as
|
|
5
|
-
import { parse as
|
|
6
|
-
import { cn as
|
|
7
|
-
import { Popover as
|
|
8
|
-
import { Calendar as
|
|
9
|
-
const
|
|
1
|
+
import { jsxs as p, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import * as f from "react";
|
|
3
|
+
import { X as _ } from "lucide-react";
|
|
4
|
+
import { CalendarMonth as F, Info as tt } from "../../../icons/index.js";
|
|
5
|
+
import { parse as R, isValid as I } from "date-fns";
|
|
6
|
+
import { cn as u, maskDate as v } from "../../../lib/utils.js";
|
|
7
|
+
import { Popover as et, PopoverTrigger as ot, PopoverContent as nt } from "../popover.js";
|
|
8
|
+
import { Calendar as rt } from "../calendar.js";
|
|
9
|
+
const s = (t) => `${(t.month + 1).toString().padStart(2, "0")}/${t.year}`, at = f.forwardRef(
|
|
10
10
|
({
|
|
11
|
-
value:
|
|
12
|
-
onChange:
|
|
13
|
-
placeholder:
|
|
14
|
-
minDate:
|
|
15
|
-
maxDate:
|
|
16
|
-
fromYear:
|
|
17
|
-
toYear:
|
|
18
|
-
showFooter:
|
|
11
|
+
value: t,
|
|
12
|
+
onChange: m,
|
|
13
|
+
placeholder: st = "Select Month Range",
|
|
14
|
+
minDate: V,
|
|
15
|
+
maxDate: A,
|
|
16
|
+
fromYear: E,
|
|
17
|
+
toYear: j,
|
|
18
|
+
showFooter: r = !0,
|
|
19
19
|
disabled: h,
|
|
20
|
-
className:
|
|
21
|
-
isError:
|
|
22
|
-
size:
|
|
23
|
-
label:
|
|
24
|
-
helperText:
|
|
25
|
-
required:
|
|
26
|
-
prefix:
|
|
27
|
-
prefixClick:
|
|
28
|
-
...
|
|
29
|
-
},
|
|
30
|
-
const [
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
}, [
|
|
34
|
-
|
|
35
|
-
}, [
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
},
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
},
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
const n = D(t.target.value, "MM/yyyy");
|
|
50
|
-
if (y(n), n === "") {
|
|
51
|
-
const i = { from: void 0, to: e?.to };
|
|
52
|
-
l(i), p || a?.(i);
|
|
20
|
+
className: B,
|
|
21
|
+
isError: y,
|
|
22
|
+
size: S,
|
|
23
|
+
label: N,
|
|
24
|
+
helperText: C,
|
|
25
|
+
required: O,
|
|
26
|
+
prefix: dt,
|
|
27
|
+
prefixClick: it,
|
|
28
|
+
...T
|
|
29
|
+
}, $) => {
|
|
30
|
+
const [n, x] = f.useState(!1), [o, c] = f.useState(t), [z, M] = f.useState(t?.from ? s(t.from) : ""), [X, b] = f.useState(t?.to ? s(t.to) : ""), [q, w] = f.useState(() => t?.from ? new Date(t.from.year, t.from.month, 1) : /* @__PURE__ */ new Date());
|
|
31
|
+
f.useEffect(() => {
|
|
32
|
+
M(t?.from ? s(t.from) : ""), b(t?.to ? s(t.to) : "");
|
|
33
|
+
}, [t]), f.useEffect(() => {
|
|
34
|
+
n && (c(t), w(t?.from ? new Date(t.from.year, t.from.month, 1) : /* @__PURE__ */ new Date()));
|
|
35
|
+
}, [n]);
|
|
36
|
+
const G = (e) => {
|
|
37
|
+
c(e), !r && e?.from && e?.to && (e.from.month !== e.to.month || e.from.year !== e.to.year) && (m?.(e), x(!1));
|
|
38
|
+
}, H = (e) => {
|
|
39
|
+
m?.(e !== void 0 ? e : o), x(!1);
|
|
40
|
+
}, J = () => {
|
|
41
|
+
c(t), x(!1);
|
|
42
|
+
}, D = () => {
|
|
43
|
+
c(void 0), M(""), b(""), m?.(void 0), r || x(!1);
|
|
44
|
+
}, K = (e) => {
|
|
45
|
+
const d = v(e.target.value, "MM/yyyy");
|
|
46
|
+
if (M(d), d === "") {
|
|
47
|
+
const l = { from: void 0, to: t?.to };
|
|
48
|
+
c(l), r || m?.(l);
|
|
53
49
|
return;
|
|
54
50
|
}
|
|
55
|
-
const
|
|
56
|
-
if (
|
|
57
|
-
const
|
|
58
|
-
|
|
51
|
+
const i = R(d, "MM/yyyy", /* @__PURE__ */ new Date());
|
|
52
|
+
if (I(i)) {
|
|
53
|
+
const g = { from: { month: i.getMonth(), year: i.getFullYear() }, to: t?.to };
|
|
54
|
+
c(g), w(i), r || m?.(g);
|
|
59
55
|
}
|
|
60
|
-
},
|
|
61
|
-
const
|
|
62
|
-
if (
|
|
63
|
-
const
|
|
64
|
-
l
|
|
56
|
+
}, L = (e) => {
|
|
57
|
+
const d = v(e.target.value, "MM/yyyy");
|
|
58
|
+
if (b(d), d === "") {
|
|
59
|
+
const l = { from: t?.from, to: void 0 };
|
|
60
|
+
c(l), r || m?.(l);
|
|
65
61
|
return;
|
|
66
62
|
}
|
|
67
|
-
const
|
|
68
|
-
if (
|
|
69
|
-
const
|
|
70
|
-
|
|
63
|
+
const i = R(d, "MM/yyyy", /* @__PURE__ */ new Date());
|
|
64
|
+
if (I(i)) {
|
|
65
|
+
const l = { month: i.getMonth(), year: i.getFullYear() }, g = { from: t?.from, to: l };
|
|
66
|
+
c(g), w(i), r || m?.(g);
|
|
71
67
|
}
|
|
72
|
-
},
|
|
73
|
-
|
|
74
|
-
};
|
|
75
|
-
return /* @__PURE__ */
|
|
76
|
-
|
|
68
|
+
}, k = () => {
|
|
69
|
+
n || (M(o?.from ? s(o.from) : ""), b(o?.to ? s(o.to) : ""));
|
|
70
|
+
}, Q = t?.from ? s(t.from) : "", U = t?.to ? s(t.to) : "", P = r && n ? o?.from ? s(o.from) : "" : z, Y = r && n ? o?.to && (o.to.month !== o.from?.month || o.to.year !== o.from?.year) ? s(o.to) : "" : X, W = r && n && P !== Q, Z = r && n && Y !== U;
|
|
71
|
+
return /* @__PURE__ */ p("div", { className: "w-full space-y-1.5 min-w-[240px]", "data-component": "month-range-picker", "data-disabled": h || void 0, children: [
|
|
72
|
+
N && /* @__PURE__ */ p(
|
|
77
73
|
"label",
|
|
78
74
|
{
|
|
79
|
-
className:
|
|
75
|
+
className: u(
|
|
80
76
|
"text-xs font-medium leading-[18px] text-[#60697d]",
|
|
81
77
|
h && "opacity-70",
|
|
82
|
-
|
|
78
|
+
y && "text-destructive"
|
|
83
79
|
),
|
|
84
80
|
children: [
|
|
85
|
-
|
|
81
|
+
N,
|
|
86
82
|
" ",
|
|
87
|
-
|
|
83
|
+
O && /* @__PURE__ */ a("span", { className: "text-destructive", children: "*" })
|
|
88
84
|
]
|
|
89
85
|
}
|
|
90
86
|
),
|
|
91
|
-
/* @__PURE__ */
|
|
92
|
-
/* @__PURE__ */
|
|
87
|
+
/* @__PURE__ */ p(et, { open: n, onOpenChange: x, children: [
|
|
88
|
+
/* @__PURE__ */ a(ot, { asChild: !0, children: /* @__PURE__ */ p(
|
|
93
89
|
"div",
|
|
94
90
|
{
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
91
|
+
"data-state": n ? "open" : "closed",
|
|
92
|
+
className: u(
|
|
93
|
+
"flex w-full items-center justify-between gap-2 rounded-md border bg-white px-3 text-sm shadow-sm transition-colors hover:border-primary disabled:cursor-not-allowed disabled:bg-disabled-secondary-bg disabled:text-disabled-text disabled:border-border",
|
|
94
|
+
y ? "border-destructive hover:border-destructive" : "border-input",
|
|
95
|
+
S === "sm" ? "h-6" : S === "md" ? "h-[28px]" : "h-8",
|
|
99
96
|
h && "pointer-events-none opacity-100 bg-disabled-secondary-bg border-border text-disabled-text hover:border-border",
|
|
100
97
|
"cursor-pointer",
|
|
101
|
-
|
|
98
|
+
B
|
|
102
99
|
),
|
|
103
100
|
children: [
|
|
104
|
-
/* @__PURE__ */
|
|
105
|
-
/* @__PURE__ */
|
|
101
|
+
/* @__PURE__ */ p("div", { className: "flex items-center gap-4 flex-1 min-w-0", children: [
|
|
102
|
+
/* @__PURE__ */ a(
|
|
106
103
|
"input",
|
|
107
104
|
{
|
|
108
|
-
ref:
|
|
105
|
+
ref: $,
|
|
109
106
|
type: "text",
|
|
110
|
-
value:
|
|
111
|
-
onChange:
|
|
112
|
-
onBlur:
|
|
113
|
-
onClick: (
|
|
114
|
-
placeholder:
|
|
107
|
+
value: P,
|
|
108
|
+
onChange: K,
|
|
109
|
+
onBlur: k,
|
|
110
|
+
onClick: (e) => n && e.stopPropagation(),
|
|
111
|
+
placeholder: n ? "MM/YYYY" : "Start Month",
|
|
115
112
|
disabled: !!h,
|
|
116
|
-
|
|
117
|
-
|
|
113
|
+
"data-field": "start",
|
|
114
|
+
className: u(
|
|
115
|
+
"flex-1 min-w-0 bg-transparent p-0 text-sm font-medium outline-none placeholder:font-medium placeholder:text-[#dfe2e7] disabled:cursor-not-allowed disabled:opacity-50",
|
|
116
|
+
W && "text-muted-foreground"
|
|
117
|
+
),
|
|
118
|
+
...T
|
|
118
119
|
}
|
|
119
120
|
),
|
|
120
|
-
/* @__PURE__ */
|
|
121
|
+
/* @__PURE__ */ a(
|
|
121
122
|
"input",
|
|
122
123
|
{
|
|
123
124
|
type: "text",
|
|
124
|
-
value:
|
|
125
|
-
onChange:
|
|
126
|
-
onBlur:
|
|
127
|
-
onClick: (
|
|
128
|
-
placeholder:
|
|
125
|
+
value: Y,
|
|
126
|
+
onChange: L,
|
|
127
|
+
onBlur: k,
|
|
128
|
+
onClick: (e) => n && e.stopPropagation(),
|
|
129
|
+
placeholder: n ? "MM/YYYY" : "End Month",
|
|
129
130
|
disabled: !!h,
|
|
130
|
-
|
|
131
|
+
"data-field": "end",
|
|
132
|
+
className: u(
|
|
133
|
+
"flex-1 min-w-0 bg-transparent p-0 text-sm font-medium outline-none placeholder:font-medium placeholder:text-[#dfe2e7] disabled:cursor-not-allowed disabled:opacity-50",
|
|
134
|
+
Z && "text-muted-foreground"
|
|
135
|
+
)
|
|
131
136
|
}
|
|
132
137
|
)
|
|
133
138
|
] }),
|
|
134
|
-
/* @__PURE__ */
|
|
135
|
-
|
|
136
|
-
|
|
139
|
+
/* @__PURE__ */ p("div", { className: "flex items-center gap-1 shrink-0", children: [
|
|
140
|
+
t?.from && !h && /* @__PURE__ */ a(
|
|
141
|
+
_,
|
|
137
142
|
{
|
|
138
143
|
className: "h-4 w-4 cursor-pointer hover:text-foreground text-muted-foreground",
|
|
139
|
-
onClick: (
|
|
140
|
-
|
|
144
|
+
onClick: (e) => {
|
|
145
|
+
e.stopPropagation(), D();
|
|
141
146
|
}
|
|
142
147
|
}
|
|
143
148
|
),
|
|
144
|
-
/* @__PURE__ */
|
|
149
|
+
/* @__PURE__ */ a(F, { className: "h-4 w-4 text-secondary-foreground" })
|
|
145
150
|
] })
|
|
146
151
|
]
|
|
147
152
|
}
|
|
148
153
|
) }),
|
|
149
|
-
/* @__PURE__ */
|
|
150
|
-
|
|
154
|
+
/* @__PURE__ */ a(
|
|
155
|
+
nt,
|
|
151
156
|
{
|
|
152
157
|
className: "w-auto p-0",
|
|
153
158
|
align: "start",
|
|
154
|
-
onOpenAutoFocus: (
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
_,
|
|
159
|
+
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
160
|
+
children: /* @__PURE__ */ a(
|
|
161
|
+
rt,
|
|
158
162
|
{
|
|
159
163
|
pickerType: "month",
|
|
160
164
|
monthMode: "range",
|
|
161
|
-
selectedMonths:
|
|
162
|
-
onMonthSelect:
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
onClear: C
|
|
165
|
+
selectedMonths: o,
|
|
166
|
+
onMonthSelect: G,
|
|
167
|
+
month: q,
|
|
168
|
+
onMonthChange: w,
|
|
169
|
+
fromDate: V,
|
|
170
|
+
toDate: A,
|
|
171
|
+
fromYear: E,
|
|
172
|
+
toYear: j,
|
|
173
|
+
showFooter: r,
|
|
174
|
+
onApply: H,
|
|
175
|
+
onCancel: J,
|
|
176
|
+
onClear: D
|
|
174
177
|
}
|
|
175
178
|
)
|
|
176
179
|
}
|
|
177
180
|
)
|
|
178
181
|
] }),
|
|
179
|
-
|
|
180
|
-
!
|
|
181
|
-
/* @__PURE__ */
|
|
182
|
+
C && /* @__PURE__ */ p("div", { className: u("flex items-center gap-1", y && "text-destructive"), children: [
|
|
183
|
+
!y && /* @__PURE__ */ a(tt, { size: 10, className: "shrink-0 text-muted-foreground" }),
|
|
184
|
+
/* @__PURE__ */ a(
|
|
182
185
|
"p",
|
|
183
186
|
{
|
|
184
|
-
className:
|
|
187
|
+
className: u(
|
|
185
188
|
"text-[10px] text-[#7a8294]",
|
|
186
|
-
|
|
189
|
+
y && "text-destructive"
|
|
187
190
|
),
|
|
188
|
-
children:
|
|
191
|
+
children: C
|
|
189
192
|
}
|
|
190
193
|
)
|
|
191
194
|
] })
|
|
192
195
|
] });
|
|
193
196
|
}
|
|
194
197
|
);
|
|
195
|
-
|
|
198
|
+
at.displayName = "MonthRangePicker";
|
|
196
199
|
export {
|
|
197
|
-
|
|
200
|
+
at as MonthRangePicker
|
|
198
201
|
};
|