impact-nova 1.5.14 → 1.6.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/ui/accordion.d.ts +4 -1
- package/dist/components/ui/accordion.js +28 -22
- package/dist/components/ui/ag-grid-react/cell-renderers/badge-cell-renderer.js +11 -11
- package/dist/components/ui/ag-grid-react/cell-renderers/checkbox-display-renderer.js +12 -12
- package/dist/components/ui/ag-grid-react/cell-renderers/date-display-renderer.js +13 -13
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/date-cell-editor.js +13 -13
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/input-cell-editor.js +30 -30
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/percent-progress-cell-editor.js +13 -13
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/split-cell-editor.js +16 -16
- package/dist/components/ui/ag-grid-react/cell-renderers/editors/textarea-cell-editor.js +17 -17
- package/dist/components/ui/ag-grid-react/cell-renderers/input-display-renderer.js +11 -11
- package/dist/components/ui/ag-grid-react/cell-renderers/link-with-batch-cell-renderer.js +2 -2
- package/dist/components/ui/ag-grid-react/cell-renderers/percent-progress-display-renderer.js +11 -13
- package/dist/components/ui/ag-grid-react/cell-renderers/select-display-renderer.js +8 -8
- package/dist/components/ui/ag-grid-react/cell-renderers/split-cell-renderer.js +6 -6
- package/dist/components/ui/ag-grid-react/cell-renderers/status-badge-renderer.d.ts +1 -1
- package/dist/components/ui/ag-grid-react/cell-renderers/status-badge-renderer.js +14 -14
- package/dist/components/ui/ag-grid-react/cell-renderers/switch-display-renderer.js +18 -18
- package/dist/components/ui/ag-grid-react/cell-renderers/textarea-display-renderer.js +6 -6
- package/dist/components/ui/ag-grid-react/headers/advanced-filter/advanced-filter-dialog.js +14 -14
- package/dist/components/ui/ag-grid-react/headers/advanced-filter/column-filter-section.js +35 -35
- package/dist/components/ui/ag-grid-react/headers/column-menu/column-settings-menu.js +49 -49
- package/dist/components/ui/ag-grid-react/headers/components/header-info.js +29 -29
- package/dist/components/ui/ag-grid-react/headers/components/info-modal.js +9 -9
- package/dist/components/ui/ag-grid-react/headers/components/section-renderers.js +20 -20
- package/dist/components/ui/ag-grid-react/headers/custom-header-group.js +10 -10
- package/dist/components/ui/ag-grid-react/headers/custom-header.js +76 -76
- package/dist/components/ui/ag-grid-react/headers/header-search-input.js +118 -118
- package/dist/components/ui/ag-grid-react/index.js +121 -102
- package/dist/components/ui/alert-dialog.js +6 -6
- package/dist/components/ui/alert.d.ts +4 -3
- package/dist/components/ui/alert.js +182 -64
- package/dist/components/ui/avatar.js +5 -5
- package/dist/components/ui/badge.d.ts +7 -2
- package/dist/components/ui/badge.js +105 -32
- package/dist/components/ui/breadcrumb.js +26 -21
- package/dist/components/ui/button-group.d.ts +7 -0
- package/dist/components/ui/button-group.js +116 -91
- package/dist/components/ui/button-variants.d.ts +7 -2
- package/dist/components/ui/button-variants.js +31 -16
- package/dist/components/ui/button.d.ts +2 -2
- package/dist/components/ui/button.js +10 -10
- package/dist/components/ui/calendar.js +185 -184
- package/dist/components/ui/card.js +24 -24
- package/dist/components/ui/chart/chart.js +27 -27
- package/dist/components/ui/chart/chart.utils.js +50 -50
- package/dist/components/ui/checkbox.js +22 -22
- package/dist/components/ui/chips.d.ts +19 -3
- package/dist/components/ui/chips.js +140 -41
- package/dist/components/ui/command-palette/command-palette-layout.d.ts +28 -0
- package/dist/components/ui/command-palette/command-palette-layout.js +59 -0
- package/dist/components/ui/command-palette/command-palette.js +254 -264
- package/dist/components/ui/command-palette/index.d.ts +1 -1
- package/dist/components/ui/command-palette/index.js +42 -41
- package/dist/components/ui/command-palette/kbd.js +18 -18
- package/dist/components/ui/command-palette/shortcut-settings.d.ts +3 -3
- package/dist/components/ui/command-palette/shortcut-settings.js +105 -111
- package/dist/components/ui/command-palette/utils.d.ts +6 -1
- package/dist/components/ui/command-palette/utils.js +81 -74
- package/dist/components/ui/data-table/data-table-column-list.js +31 -31
- package/dist/components/ui/data-table/data-table-constants.d.ts +6 -0
- package/dist/components/ui/data-table/data-table-constants.js +4 -0
- package/dist/components/ui/data-table/data-table-context.d.ts +4 -0
- package/dist/components/ui/data-table/data-table-format-options.js +35 -35
- package/dist/components/ui/data-table/data-table-sheet.d.ts +4 -4
- package/dist/components/ui/data-table/data-table-sheet.js +91 -58
- package/dist/components/ui/data-table/data-table-view-options.js +29 -29
- package/dist/components/ui/data-table/data-table.js +84 -52
- package/dist/components/ui/data-table/index.d.ts +1 -0
- package/dist/components/ui/data-table/index.js +15 -13
- package/dist/components/ui/date-picker/date-picker.js +35 -35
- package/dist/components/ui/date-picker/date-range-picker.js +166 -164
- package/dist/components/ui/date-picker/month-picker.js +14 -14
- package/dist/components/ui/date-picker/month-range-picker.js +198 -189
- package/dist/components/ui/date-picker/multi-date-picker.js +14 -14
- package/dist/components/ui/date-picker/multi-month-picker.js +1 -1
- package/dist/components/ui/date-picker/multi-week-picker.js +1 -1
- package/dist/components/ui/date-picker/week-picker.js +2 -2
- package/dist/components/ui/date-picker/week-range-picker.js +164 -162
- package/dist/components/ui/dialog.js +25 -28
- package/dist/components/ui/drawer.js +40 -40
- package/dist/components/ui/dropdown-menu.js +72 -72
- package/dist/components/ui/empty-container.js +73 -69
- package/dist/components/ui/file-upload.js +137 -135
- package/dist/components/ui/filter-panel/filter-panel.d.ts +2 -2
- package/dist/components/ui/filter-panel/filter-panel.js +175 -97
- package/dist/components/ui/filter-strip/filter-strip.d.ts +1 -1
- package/dist/components/ui/filter-strip/filter-strip.js +63 -50
- package/dist/components/ui/filter-strip/filter-summary.d.ts +4 -1
- package/dist/components/ui/filter-strip/filter-summary.js +230 -146
- package/dist/components/ui/filter-strip/filter-tag-list.js +125 -91
- package/dist/components/ui/header.d.ts +7 -3
- package/dist/components/ui/header.js +87 -79
- package/dist/components/ui/horizontal-scroller/horizontal-scroller.js +44 -44
- package/dist/components/ui/hover-card.js +10 -10
- package/dist/components/ui/input.js +79 -70
- package/dist/components/ui/loader.js +16 -16
- package/dist/components/ui/nested-list/components/NestedListCategoryFilters.js +16 -16
- package/dist/components/ui/nested-list/components/NestedListHeader.js +27 -27
- package/dist/components/ui/nested-list/components/SortableItem.js +58 -58
- package/dist/components/ui/notification-panel/notification-item.js +32 -32
- package/dist/components/ui/notification-panel/notification-list.js +24 -24
- package/dist/components/ui/notification-panel/notification-panel.js +26 -26
- package/dist/components/ui/popover.js +22 -22
- package/dist/components/ui/progress.js +34 -34
- package/dist/components/ui/prompt.js +48 -48
- package/dist/components/ui/radio-group.js +63 -54
- package/dist/components/ui/select/components/LabelWithSequence.js +6 -6
- package/dist/components/ui/select/components/Submenu.js +33 -33
- package/dist/components/ui/select/select.js +425 -376
- package/dist/components/ui/sheet.js +88 -66
- package/dist/components/ui/sidebar.js +342 -296
- package/dist/components/ui/skeleton.js +6 -6
- package/dist/components/ui/slider.js +17 -17
- package/dist/components/ui/statistics-card.d.ts +86 -0
- package/dist/components/ui/statistics-card.hooks.d.ts +150 -0
- package/dist/components/ui/statistics-card.hooks.js +100 -0
- package/dist/components/ui/statistics-card.js +259 -0
- package/dist/components/ui/stepper.js +51 -51
- package/dist/components/ui/switch.js +7 -7
- package/dist/components/ui/tabs.js +70 -70
- package/dist/components/ui/tag-group.d.ts +1 -0
- package/dist/components/ui/tag-group.js +14 -13
- package/dist/components/ui/tag.js +43 -43
- package/dist/components/ui/textarea.js +86 -58
- package/dist/components/ui/toast.js +39 -39
- package/dist/components/ui/tooltip.js +23 -23
- package/dist/components/ui/types/date-picker.types.d.ts +1 -0
- package/dist/components/ui/types/filter-panel.types.d.ts +3 -0
- package/dist/components/ui/types/filter-strip.types.d.ts +14 -0
- package/dist/components/ui/types/horizontal-scroller.types.d.ts +1 -1
- package/dist/components/ui/types/statistics-card.types.d.ts +1 -0
- package/dist/i18n/defaultMessages.d.ts +8 -0
- package/dist/i18n/defaultMessages.js +15 -9
- package/dist/i18n/locales/de.js +7 -1
- package/dist/i18n/locales/es.js +7 -1
- package/dist/i18n/locales/hi.js +7 -1
- package/dist/i18n/locales/kn.js +7 -1
- package/dist/icons/assets/bulk-edit.svg.js +5 -0
- package/dist/icons/assets/clock.svg.js +5 -0
- package/dist/icons/assets/statistics.svg.js +5 -0
- package/dist/icons/index.d.ts +3 -0
- package/dist/icons/index.js +254 -206
- package/dist/impact-nova.css +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +361 -347
- package/package.json +3 -2
- package/tailwind.config.js +259 -152
- /package/dist/icons/assets/{PivotMode.svg.js → pivotMode.svg.js} +0 -0
|
@@ -1,218 +1,227 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { X as
|
|
4
|
-
import { CalendarMonth as
|
|
5
|
-
import { isValid as
|
|
6
|
-
import { cn as
|
|
7
|
-
import { Popover as
|
|
8
|
-
import { Calendar as
|
|
9
|
-
import { Tooltip as
|
|
10
|
-
import { useImpactNovaI18n as
|
|
11
|
-
const
|
|
1
|
+
import { jsxs as p, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import * as a from "react";
|
|
3
|
+
import { X as ft } from "lucide-react";
|
|
4
|
+
import { CalendarMonth as mt, Info as pt } from "../../../icons/index.js";
|
|
5
|
+
import { isValid as P, parse as S } from "date-fns";
|
|
6
|
+
import { cn as y, padValidDateString as j, maskDate as B } from "../../../lib/utils.js";
|
|
7
|
+
import { Popover as ht, PopoverTrigger as ut, PopoverContent as xt } from "../popover.js";
|
|
8
|
+
import { Calendar as gt } from "../calendar.js";
|
|
9
|
+
import { Tooltip as O, TooltipTrigger as z, TooltipContent as H } from "../tooltip.js";
|
|
10
|
+
import { useImpactNovaI18n as Mt } from "../../../i18n/ImpactNovaI18nContext.js";
|
|
11
|
+
const r = (t, i = "MM/YYYY") => {
|
|
12
|
+
const I = (t.month + 1).toString().padStart(2, "0");
|
|
13
|
+
return i === "YYYY/MM" ? `${t.year}/${I}` : `${I}/${t.year}`;
|
|
14
|
+
}, Yt = a.forwardRef(
|
|
12
15
|
({
|
|
13
16
|
value: t,
|
|
14
|
-
onChange:
|
|
15
|
-
placeholder:
|
|
16
|
-
minDate:
|
|
17
|
-
maxDate:
|
|
18
|
-
startMonth:
|
|
19
|
-
endMonth:
|
|
20
|
-
showFooter:
|
|
21
|
-
disabled:
|
|
22
|
-
className:
|
|
23
|
-
isError:
|
|
24
|
-
size:
|
|
25
|
-
label:
|
|
26
|
-
helperText:
|
|
27
|
-
required:
|
|
28
|
-
prefix:
|
|
29
|
-
prefixClick:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
},
|
|
49
|
-
i(void 0
|
|
50
|
-
},
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
17
|
+
onChange: i,
|
|
18
|
+
placeholder: I,
|
|
19
|
+
minDate: X,
|
|
20
|
+
maxDate: q,
|
|
21
|
+
startMonth: G,
|
|
22
|
+
endMonth: J,
|
|
23
|
+
showFooter: u = !0,
|
|
24
|
+
disabled: w,
|
|
25
|
+
className: K,
|
|
26
|
+
isError: N,
|
|
27
|
+
size: D,
|
|
28
|
+
label: V,
|
|
29
|
+
helperText: E,
|
|
30
|
+
required: L,
|
|
31
|
+
prefix: wt,
|
|
32
|
+
prefixClick: bt,
|
|
33
|
+
displayFormat: n = "MM/YYYY",
|
|
34
|
+
...Q
|
|
35
|
+
}, U) => {
|
|
36
|
+
const { t: M } = Mt();
|
|
37
|
+
I ?? M("datePicker.selectMonthRange");
|
|
38
|
+
const T = a.useRef(null), W = a.useRef(null), l = a.useMemo(
|
|
39
|
+
() => n === "YYYY/MM" ? "yyyy/MM" : "MM/yyyy",
|
|
40
|
+
[n]
|
|
41
|
+
);
|
|
42
|
+
a.useImperativeHandle(U, () => T.current);
|
|
43
|
+
const [d, C] = a.useState(!1), [A, f] = a.useState(t), [b, x] = a.useState(t?.from ? r(t.from, n) : ""), [k, g] = a.useState(t?.to ? r(t.to, n) : ""), [Z, R] = a.useState(() => t?.from ? new Date(t.from.year, t.from.month, 1) : /* @__PURE__ */ new Date());
|
|
44
|
+
a.useEffect(() => {
|
|
45
|
+
d || (x(t?.from ? r(t.from, n) : ""), g(t?.to ? r(t.to, n) : ""), f(t));
|
|
46
|
+
}, [d, t, n]), a.useEffect(() => {
|
|
47
|
+
d && (f(t), x(t?.from ? r(t.from, n) : ""), g(t?.to ? r(t.to, n) : ""), R(t?.from ? new Date(t.from.year, t.from.month, 1) : /* @__PURE__ */ new Date()));
|
|
48
|
+
}, [d, t, n]);
|
|
49
|
+
const _ = (e) => {
|
|
50
|
+
f(e), e?.from && x(r(e.from, n)), e?.to && g(r(e.to, n)), !u && e?.from && e?.to && (e.from.month !== e.to.month || e.from.year !== e.to.year) && (i?.(e), C(!1));
|
|
51
|
+
}, F = (e) => {
|
|
52
|
+
i?.(e !== void 0 ? e : A), C(!1);
|
|
53
|
+
}, tt = () => {
|
|
54
|
+
f(t), x(t?.from ? r(t.from, n) : ""), g(t?.to ? r(t.to, n) : ""), C(!1);
|
|
55
|
+
}, v = () => {
|
|
56
|
+
f(void 0), x(""), g(""), i?.(void 0), u || C(!1);
|
|
57
|
+
}, et = (e) => {
|
|
58
|
+
const h = e.target.value, s = B(h, l, b);
|
|
59
|
+
if (x(s), s === "") {
|
|
60
|
+
const m = { from: void 0, to: t?.to };
|
|
61
|
+
f(m), u || i?.(m);
|
|
55
62
|
return;
|
|
56
63
|
}
|
|
57
|
-
const
|
|
58
|
-
if (
|
|
59
|
-
const
|
|
60
|
-
|
|
64
|
+
const c = S(s, l, /* @__PURE__ */ new Date());
|
|
65
|
+
if (P(c) && s.length === 7) {
|
|
66
|
+
const Y = { from: { month: c.getMonth(), year: c.getFullYear() }, to: t?.to };
|
|
67
|
+
f(Y), R(c), u || i?.(Y);
|
|
61
68
|
}
|
|
62
|
-
},
|
|
63
|
-
const
|
|
64
|
-
if (
|
|
65
|
-
const
|
|
66
|
-
|
|
69
|
+
}, nt = (e) => {
|
|
70
|
+
const h = e.target.value, s = B(h, l, k);
|
|
71
|
+
if (g(s), s === "") {
|
|
72
|
+
const m = { from: t?.from, to: void 0 };
|
|
73
|
+
f(m), u || i?.(m);
|
|
67
74
|
return;
|
|
68
75
|
}
|
|
69
|
-
const
|
|
70
|
-
if (
|
|
71
|
-
const
|
|
72
|
-
|
|
76
|
+
const c = S(s, l, /* @__PURE__ */ new Date());
|
|
77
|
+
if (P(c) && s.length === 7) {
|
|
78
|
+
const m = { month: c.getMonth(), year: c.getFullYear() }, Y = { from: t?.from, to: m };
|
|
79
|
+
f(Y), R(c), u || i?.(Y);
|
|
73
80
|
}
|
|
74
|
-
},
|
|
75
|
-
if (
|
|
76
|
-
const e =
|
|
77
|
-
!
|
|
78
|
-
from: { month:
|
|
79
|
-
to: { month:
|
|
81
|
+
}, $ = () => {
|
|
82
|
+
if (d) return;
|
|
83
|
+
const e = j(b, l), h = j(k, l), s = S(e, l, /* @__PURE__ */ new Date()), c = S(h, l, /* @__PURE__ */ new Date()), m = P(s) && e.length === 7, Y = P(c) && h.length === 7;
|
|
84
|
+
!m || !Y ? (x(t?.from ? r(t.from, n) : ""), g(t?.to ? r(t.to, n) : ""), f(t)) : (x(e), g(h), u || i?.({
|
|
85
|
+
from: { month: s.getMonth(), year: s.getFullYear() },
|
|
86
|
+
to: { month: c.getMonth(), year: c.getFullYear() }
|
|
80
87
|
}));
|
|
81
|
-
},
|
|
82
|
-
return /* @__PURE__ */
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
className: P(
|
|
87
|
-
"text-xs font-medium leading-[18px] text-[#60697d]",
|
|
88
|
-
x && "opacity-70",
|
|
89
|
-
k && "text-destructive"
|
|
90
|
-
),
|
|
91
|
-
children: [
|
|
92
|
-
I,
|
|
93
|
-
" ",
|
|
94
|
-
G && /* @__PURE__ */ o("span", { className: "text-destructive", children: "*" })
|
|
95
|
-
]
|
|
96
|
-
}
|
|
97
|
-
),
|
|
98
|
-
/* @__PURE__ */ f(ft, { open: s, onOpenChange: R, children: [
|
|
99
|
-
/* @__PURE__ */ o(pt, { asChild: !0, children: /* @__PURE__ */ f(
|
|
100
|
-
"div",
|
|
88
|
+
}, ot = t?.from ? r(t.from, n) : "", rt = t?.to ? r(t.to, n) : "", st = b !== ot, ct = k !== rt, at = b.length === 7 && !P(S(b, l, /* @__PURE__ */ new Date())), dt = k.length === 7 && !P(S(k, l, /* @__PURE__ */ new Date())), it = M("datePicker.startMonth"), lt = M("datePicker.endMonth");
|
|
89
|
+
return /* @__PURE__ */ p("div", { className: "flex w-full min-w-[240px] flex-col gap-[6px]", "data-component": "month-range-picker", "data-disabled": w || void 0, children: [
|
|
90
|
+
/* @__PURE__ */ p("div", { className: "flex flex-col gap-[6px]", children: [
|
|
91
|
+
V && /* @__PURE__ */ p(
|
|
92
|
+
"label",
|
|
101
93
|
{
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
N === "sm" ? "h-6" : N === "md" ? "h-[28px]" : "h-8",
|
|
107
|
-
x && "pointer-events-none opacity-100 bg-disabled-secondary-bg border-border text-disabled-text hover:border-border",
|
|
108
|
-
"cursor-pointer",
|
|
109
|
-
F
|
|
94
|
+
className: y(
|
|
95
|
+
"text-xs font-medium leading-[18px] text-content-tertiary",
|
|
96
|
+
w && "opacity-70",
|
|
97
|
+
N && "text-destructive"
|
|
110
98
|
),
|
|
111
99
|
children: [
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
/* @__PURE__ */
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
ref: L,
|
|
136
|
-
type: "text",
|
|
137
|
-
value: b,
|
|
138
|
-
onChange: tt,
|
|
139
|
-
onBlur: Y,
|
|
140
|
-
onClick: (e) => s && e.stopPropagation(),
|
|
141
|
-
placeholder: s ? u("datePicker.monthYearFormat") : it,
|
|
142
|
-
disabled: !!x,
|
|
143
|
-
"data-field": "end",
|
|
144
|
-
className: P(
|
|
145
|
-
"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",
|
|
146
|
-
dt ? "text-destructive" : rt ? "text-muted-foreground" : ""
|
|
147
|
-
)
|
|
148
|
-
}
|
|
149
|
-
)
|
|
150
|
-
] }),
|
|
151
|
-
/* @__PURE__ */ f("div", { className: "flex items-center gap-1 shrink-0", children: [
|
|
152
|
-
t?.from && !x && /* @__PURE__ */ f(B, { children: [
|
|
153
|
-
/* @__PURE__ */ o(O, { asChild: !0, children: /* @__PURE__ */ o(
|
|
154
|
-
ct,
|
|
100
|
+
V,
|
|
101
|
+
" ",
|
|
102
|
+
L && /* @__PURE__ */ o("span", { className: "text-destructive", children: "*" })
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
),
|
|
106
|
+
/* @__PURE__ */ p(ht, { open: d, onOpenChange: C, children: [
|
|
107
|
+
/* @__PURE__ */ o(ut, { asChild: !0, children: /* @__PURE__ */ p(
|
|
108
|
+
"div",
|
|
109
|
+
{
|
|
110
|
+
"data-state": d ? "open" : "closed",
|
|
111
|
+
className: y(
|
|
112
|
+
"flex w-full items-center justify-between gap-2 rounded-md border bg-canvas-elevated px-3 text-sm shadow-sm transition-colors hover:border-brand disabled:cursor-not-allowed disabled:bg-disabled-surface disabled:text-disabled-foreground disabled:border-stroke",
|
|
113
|
+
N ? "border-destructive hover:border-destructive" : "border-field",
|
|
114
|
+
D === "sm" ? "h-6" : D === "md" ? "h-[28px]" : "h-8",
|
|
115
|
+
w && "pointer-events-none opacity-100 bg-disabled-surface border-stroke text-disabled-foreground hover:border-stroke",
|
|
116
|
+
"cursor-pointer",
|
|
117
|
+
K
|
|
118
|
+
),
|
|
119
|
+
children: [
|
|
120
|
+
/* @__PURE__ */ p("div", { className: "flex items-center gap-4 flex-1 min-w-0", children: [
|
|
121
|
+
/* @__PURE__ */ o(
|
|
122
|
+
"input",
|
|
155
123
|
{
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
124
|
+
ref: T,
|
|
125
|
+
type: "text",
|
|
126
|
+
value: b,
|
|
127
|
+
onChange: et,
|
|
128
|
+
onBlur: $,
|
|
129
|
+
onClick: (e) => d && e.stopPropagation(),
|
|
130
|
+
placeholder: d ? n === "YYYY/MM" ? "YYYY/MM" : M("datePicker.monthYearFormat") : it,
|
|
131
|
+
disabled: !!w,
|
|
132
|
+
"data-field": "start",
|
|
133
|
+
className: y(
|
|
134
|
+
"flex-1 min-w-0 bg-transparent p-0 text-sm font-medium outline-none placeholder:font-medium placeholder:text-content-empty disabled:cursor-not-allowed disabled:opacity-50",
|
|
135
|
+
at ? "text-destructive" : st ? "text-content-muted" : ""
|
|
136
|
+
),
|
|
137
|
+
...Q
|
|
160
138
|
}
|
|
161
|
-
)
|
|
162
|
-
/* @__PURE__ */ o(
|
|
139
|
+
),
|
|
140
|
+
/* @__PURE__ */ o(
|
|
141
|
+
"input",
|
|
142
|
+
{
|
|
143
|
+
ref: W,
|
|
144
|
+
type: "text",
|
|
145
|
+
value: k,
|
|
146
|
+
onChange: nt,
|
|
147
|
+
onBlur: $,
|
|
148
|
+
onClick: (e) => d && e.stopPropagation(),
|
|
149
|
+
placeholder: d ? n === "YYYY/MM" ? "YYYY/MM" : M("datePicker.monthYearFormat") : lt,
|
|
150
|
+
disabled: !!w,
|
|
151
|
+
"data-field": "end",
|
|
152
|
+
className: y(
|
|
153
|
+
"flex-1 min-w-0 bg-transparent p-0 text-sm font-medium outline-none placeholder:font-medium placeholder:text-content-empty disabled:cursor-not-allowed disabled:opacity-50",
|
|
154
|
+
dt ? "text-destructive" : ct ? "text-content-muted" : ""
|
|
155
|
+
)
|
|
156
|
+
}
|
|
157
|
+
)
|
|
163
158
|
] }),
|
|
164
|
-
/* @__PURE__ */
|
|
165
|
-
|
|
166
|
-
|
|
159
|
+
/* @__PURE__ */ p("div", { className: "flex items-center gap-1 shrink-0", children: [
|
|
160
|
+
t?.from && !w && /* @__PURE__ */ p(O, { children: [
|
|
161
|
+
/* @__PURE__ */ o(z, { asChild: !0, children: /* @__PURE__ */ o(
|
|
162
|
+
ft,
|
|
163
|
+
{
|
|
164
|
+
className: "h-4 w-4 cursor-pointer hover:text-content text-content-muted",
|
|
165
|
+
onClick: (e) => {
|
|
166
|
+
e.stopPropagation(), v();
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
) }),
|
|
170
|
+
/* @__PURE__ */ o(H, { variant: "tertiary", side: "top", children: M("calendar.clear") })
|
|
171
|
+
] }),
|
|
172
|
+
/* @__PURE__ */ p(O, { children: [
|
|
173
|
+
/* @__PURE__ */ o(z, { asChild: !0, children: /* @__PURE__ */ o(mt, { className: "h-4 w-4 text-secondary-foreground" }) }),
|
|
174
|
+
/* @__PURE__ */ o(H, { variant: "tertiary", side: "top", children: M("datePicker.selectMonthRange") })
|
|
175
|
+
] })
|
|
167
176
|
] })
|
|
168
|
-
]
|
|
169
|
-
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
)
|
|
177
|
+
]
|
|
178
|
+
}
|
|
179
|
+
) }),
|
|
180
|
+
/* @__PURE__ */ o(
|
|
181
|
+
xt,
|
|
182
|
+
{
|
|
183
|
+
className: "w-auto p-0",
|
|
184
|
+
align: "start",
|
|
185
|
+
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
186
|
+
children: /* @__PURE__ */ o(
|
|
187
|
+
gt,
|
|
188
|
+
{
|
|
189
|
+
pickerType: "month",
|
|
190
|
+
monthMode: "range",
|
|
191
|
+
selectedMonths: A,
|
|
192
|
+
onMonthSelect: _,
|
|
193
|
+
month: Z,
|
|
194
|
+
onMonthChange: R,
|
|
195
|
+
disabled: { before: X, after: q },
|
|
196
|
+
startMonth: G,
|
|
197
|
+
endMonth: J,
|
|
198
|
+
showFooter: u,
|
|
199
|
+
onApply: F,
|
|
200
|
+
onCancel: tt,
|
|
201
|
+
onClear: v
|
|
202
|
+
}
|
|
203
|
+
)
|
|
204
|
+
}
|
|
205
|
+
)
|
|
206
|
+
] })
|
|
198
207
|
] }),
|
|
199
|
-
|
|
200
|
-
!
|
|
208
|
+
E && /* @__PURE__ */ p("div", { className: y("flex items-center gap-[6px]", N && "text-destructive"), children: [
|
|
209
|
+
!N && /* @__PURE__ */ o(pt, { size: 10, className: "shrink-0 text-content-muted" }),
|
|
201
210
|
/* @__PURE__ */ o(
|
|
202
211
|
"p",
|
|
203
212
|
{
|
|
204
|
-
className:
|
|
205
|
-
"text-[10px] text-
|
|
206
|
-
|
|
213
|
+
className: y(
|
|
214
|
+
"text-[10px] leading-4 text-navigation-muted",
|
|
215
|
+
N && "text-destructive"
|
|
207
216
|
),
|
|
208
|
-
children:
|
|
217
|
+
children: E
|
|
209
218
|
}
|
|
210
219
|
)
|
|
211
220
|
] })
|
|
212
221
|
] });
|
|
213
222
|
}
|
|
214
223
|
);
|
|
215
|
-
|
|
224
|
+
Yt.displayName = "MonthRangePicker";
|
|
216
225
|
export {
|
|
217
|
-
|
|
226
|
+
Yt as MonthRangePicker
|
|
218
227
|
};
|
|
@@ -7,7 +7,7 @@ import { cn as E } from "../../../lib/utils.js";
|
|
|
7
7
|
import { Input as F } from "../input.js";
|
|
8
8
|
import { Popover as V, PopoverTrigger as X, PopoverContent as $ } from "../popover.js";
|
|
9
9
|
import { Calendar as q } from "../calendar.js";
|
|
10
|
-
import { Tooltip as u, TooltipTrigger as
|
|
10
|
+
import { Tooltip as u, TooltipTrigger as y, TooltipContent as g } from "../tooltip.js";
|
|
11
11
|
import { getDateFnsLocale as z } from "../../../i18n/getDateFnsLocale.js";
|
|
12
12
|
import { useImpactNovaI18n as B } from "../../../i18n/ImpactNovaI18nContext.js";
|
|
13
13
|
const G = r.forwardRef(
|
|
@@ -20,23 +20,23 @@ const G = r.forwardRef(
|
|
|
20
20
|
maxDate: x,
|
|
21
21
|
startMonth: D,
|
|
22
22
|
endMonth: N,
|
|
23
|
-
showFooter:
|
|
24
|
-
disabled:
|
|
23
|
+
showFooter: c = !0,
|
|
24
|
+
disabled: p,
|
|
25
25
|
className: T,
|
|
26
26
|
...k
|
|
27
27
|
}, A) => {
|
|
28
|
-
const { locale:
|
|
28
|
+
const { locale: d, t: s } = B(), v = r.useMemo(() => z(d), [d]), L = P ?? s("datePicker.selectMultipleDates"), [m, n] = r.useState(!1), [f, a] = r.useState(e);
|
|
29
29
|
r.useEffect(() => {
|
|
30
30
|
a(e);
|
|
31
31
|
}, [m, e]);
|
|
32
32
|
const O = (o) => {
|
|
33
|
-
a(o),
|
|
33
|
+
a(o), c || i?.(o);
|
|
34
34
|
}, S = (o) => {
|
|
35
35
|
i?.(o !== void 0 ? o : f), n(!1);
|
|
36
36
|
}, w = () => {
|
|
37
37
|
a(e), n(!1);
|
|
38
38
|
}, h = () => {
|
|
39
|
-
a(void 0), i?.(void 0),
|
|
39
|
+
a(void 0), i?.(void 0), c || n(!1);
|
|
40
40
|
}, I = e && e.length > 0 ? e.length === 1 ? b(e[0], C, { locale: v }) : `${e.length} dates selected` : "";
|
|
41
41
|
return /* @__PURE__ */ l(V, { open: m, onOpenChange: n, children: [
|
|
42
42
|
/* @__PURE__ */ t(X, { asChild: !0, children: /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(
|
|
@@ -46,24 +46,24 @@ const G = r.forwardRef(
|
|
|
46
46
|
value: I,
|
|
47
47
|
placeholder: L,
|
|
48
48
|
readOnly: !0,
|
|
49
|
-
disabled:
|
|
49
|
+
disabled: p,
|
|
50
50
|
className: E("cursor-pointer", T),
|
|
51
51
|
suffix: /* @__PURE__ */ l("div", { className: "flex items-center gap-1", children: [
|
|
52
|
-
e && e.length > 0 && !
|
|
53
|
-
/* @__PURE__ */ t(
|
|
52
|
+
e && e.length > 0 && !p && /* @__PURE__ */ l(u, { children: [
|
|
53
|
+
/* @__PURE__ */ t(y, { asChild: !0, children: /* @__PURE__ */ t(
|
|
54
54
|
j,
|
|
55
55
|
{
|
|
56
|
-
className: "h-4 w-4 cursor-pointer hover:text-
|
|
56
|
+
className: "h-4 w-4 cursor-pointer hover:text-content",
|
|
57
57
|
onClick: (o) => {
|
|
58
58
|
o.stopPropagation(), h();
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
) }),
|
|
62
|
-
/* @__PURE__ */ t(
|
|
62
|
+
/* @__PURE__ */ t(g, { variant: "tertiary", side: "top", children: s("calendar.clear") })
|
|
63
63
|
] }),
|
|
64
64
|
/* @__PURE__ */ l(u, { children: [
|
|
65
|
-
/* @__PURE__ */ t(
|
|
66
|
-
/* @__PURE__ */ t(
|
|
65
|
+
/* @__PURE__ */ t(y, { asChild: !0, children: /* @__PURE__ */ t(R, { className: "h-4 w-4 text-secondary-foreground" }) }),
|
|
66
|
+
/* @__PURE__ */ t(g, { variant: "tertiary", side: "top", children: s("datePicker.selectMultipleDates") })
|
|
67
67
|
] })
|
|
68
68
|
] }),
|
|
69
69
|
...k
|
|
@@ -84,7 +84,7 @@ const G = r.forwardRef(
|
|
|
84
84
|
disabled: { before: M, after: x },
|
|
85
85
|
startMonth: D,
|
|
86
86
|
endMonth: N,
|
|
87
|
-
showFooter:
|
|
87
|
+
showFooter: c,
|
|
88
88
|
onApply: S,
|
|
89
89
|
onCancel: w,
|
|
90
90
|
onClear: h,
|
|
@@ -50,7 +50,7 @@ const X = c.forwardRef(
|
|
|
50
50
|
/* @__PURE__ */ t(u, { asChild: !0, children: /* @__PURE__ */ t(
|
|
51
51
|
I,
|
|
52
52
|
{
|
|
53
|
-
className: "h-4 w-4 cursor-pointer hover:text-
|
|
53
|
+
className: "h-4 w-4 cursor-pointer hover:text-content",
|
|
54
54
|
onClick: (o) => {
|
|
55
55
|
o.stopPropagation(), m();
|
|
56
56
|
}
|
|
@@ -62,7 +62,7 @@ const U = (e, o = "MM/dd/yyyy", n) => {
|
|
|
62
62
|
/* @__PURE__ */ t(M, { asChild: !0, children: /* @__PURE__ */ t(
|
|
63
63
|
X,
|
|
64
64
|
{
|
|
65
|
-
className: "h-4 w-4 cursor-pointer hover:text-
|
|
65
|
+
className: "h-4 w-4 cursor-pointer hover:text-content",
|
|
66
66
|
onClick: (r) => {
|
|
67
67
|
r.stopPropagation(), u();
|
|
68
68
|
}
|
|
@@ -93,7 +93,7 @@ const a = (e, s = "MM/dd/yyyy", n) => {
|
|
|
93
93
|
"data-form-control": "input",
|
|
94
94
|
className: re(
|
|
95
95
|
"cursor-pointer",
|
|
96
|
-
ne ? "text-destructive" : j ? "text-muted
|
|
96
|
+
ne ? "text-destructive" : j ? "text-content-muted" : "",
|
|
97
97
|
G
|
|
98
98
|
),
|
|
99
99
|
suffix: /* @__PURE__ */ g("div", { className: "flex items-center gap-1", children: [
|
|
@@ -101,7 +101,7 @@ const a = (e, s = "MM/dd/yyyy", n) => {
|
|
|
101
101
|
/* @__PURE__ */ r($, { asChild: !0, children: /* @__PURE__ */ r(
|
|
102
102
|
te,
|
|
103
103
|
{
|
|
104
|
-
className: "h-4 w-4 cursor-pointer hover:text-
|
|
104
|
+
className: "h-4 w-4 cursor-pointer hover:text-content",
|
|
105
105
|
onClick: (t) => {
|
|
106
106
|
t.stopPropagation(), v();
|
|
107
107
|
}
|