impact-nova 2.5.9 → 2.5.11
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/data/data-table/column-runtime-state-guard.js +42 -42
- package/dist/components/data/data-table/data-table-column-tree-cache.d.ts +15 -0
- package/dist/components/data/data-table/data-table-column-tree-cache.js +109 -80
- package/dist/components/data/data-table/use-data-table-column-list-sync.js +65 -62
- package/dist/components/data-display/calendar/calendar-apply-validation.d.ts +2 -0
- package/dist/components/data-display/calendar/calendar-apply-validation.js +64 -67
- package/dist/components/data-display/calendar/calendar-available-view.d.ts +27 -0
- package/dist/components/data-display/calendar/calendar-available-view.js +85 -0
- package/dist/components/data-display/calendar/calendar-day-picker-classnames.d.ts +6 -1
- package/dist/components/data-display/calendar/calendar-day-picker-classnames.js +31 -23
- package/dist/components/data-display/calendar/calendar-day-picker-components.d.ts +5 -2
- package/dist/components/data-display/calendar/calendar-day-picker-components.js +210 -167
- package/dist/components/data-display/calendar/calendar-day-picker-view.d.ts +3 -2
- package/dist/components/data-display/calendar/calendar-day-picker-view.js +126 -124
- package/dist/components/data-display/calendar/calendar-fiscal-period-nav.d.ts +6 -0
- package/dist/components/data-display/calendar/calendar-fiscal-period-nav.js +34 -18
- package/dist/components/data-display/calendar/calendar-month-utils.d.ts +5 -0
- package/dist/components/data-display/calendar/calendar-month-utils.js +85 -64
- package/dist/components/data-display/calendar/calendar-padding-week.utils.d.ts +5 -1
- package/dist/components/data-display/calendar/calendar-padding-week.utils.js +20 -16
- package/dist/components/data-display/calendar/calendar-selection-appearance.d.ts +1 -0
- package/dist/components/data-display/calendar/calendar-selection-appearance.js +31 -30
- package/dist/components/data-display/calendar/calendar-week-number-cell.d.ts +3 -1
- package/dist/components/data-display/calendar/calendar-week-number-cell.js +68 -53
- package/dist/components/data-display/calendar/calendar-week-utils.d.ts +6 -0
- package/dist/components/data-display/calendar/calendar-week-utils.js +51 -47
- package/dist/components/data-display/calendar/calendar-year-panes.d.ts +2 -0
- package/dist/components/data-display/calendar/calendar-year-panes.js +3 -1
- package/dist/components/data-display/calendar/calendar.js +170 -165
- package/dist/components/data-display/calendar/calendar.types.d.ts +7 -0
- package/dist/components/data-display/calendar/use-calendar-day-picker-config.d.ts +5 -2
- package/dist/components/data-display/calendar/use-calendar-day-picker-config.js +86 -76
- package/dist/components/data-display/calendar/use-calendar-state.d.ts +3 -1
- package/dist/components/data-display/calendar/use-calendar-state.js +403 -325
- package/dist/components/feedback/dialog/dialog.js +12 -12
- package/dist/components/feedback/sheet/sheet.js +22 -22
- package/dist/components/forms/date-picker/calendar-selection-adapters.d.ts +2 -0
- package/dist/components/forms/date-picker/calendar-selection-adapters.js +36 -31
- package/dist/components/forms/date-picker/date-input-behavior.d.ts +10 -0
- package/dist/components/forms/date-picker/date-input-behavior.js +111 -90
- package/dist/components/forms/date-picker/date-picker.js +74 -70
- package/dist/components/forms/date-picker/date-picker.types.d.ts +7 -0
- package/dist/components/forms/date-picker/date-range-picker.js +148 -144
- package/dist/components/forms/date-picker/fiscal-pass-through.d.ts +2 -0
- package/dist/components/forms/date-picker/fiscal-pass-through.js +4 -2
- package/dist/components/forms/date-picker/month-picker.js +84 -80
- package/dist/components/forms/date-picker/month-range-picker.js +147 -143
- package/dist/components/forms/date-picker/multi-date-picker.js +53 -49
- package/dist/components/forms/date-picker/multi-month-picker.js +51 -47
- package/dist/components/forms/date-picker/multi-quarter-picker.js +48 -44
- package/dist/components/forms/date-picker/multi-week-picker.js +55 -51
- package/dist/components/forms/date-picker/multi-year-picker.js +50 -46
- package/dist/components/forms/date-picker/picker-story-layout.d.ts +2 -0
- package/dist/components/forms/date-picker/quarter-picker.js +48 -44
- package/dist/components/forms/date-picker/quarter-range-picker.js +47 -43
- package/dist/components/forms/date-picker/week-picker.js +86 -82
- package/dist/components/forms/date-picker/week-range-picker.js +171 -164
- package/dist/components/forms/date-picker/year-picker.js +49 -45
- package/dist/components/forms/date-picker/year-range-picker.js +49 -45
- package/dist/components/forms/select/components/SelectMenuPanel.js +3 -2
- package/dist/components/forms/select/select.js +1 -0
- package/dist/form-react/Fields/DateInputField.js +51 -50
- package/dist/form-react/Fields/DateRangeField.js +14 -13
- package/dist/form-react/Fields/MonthRangeField.js +29 -28
- package/dist/form-react/Fields/MultiMonthPickerField.js +13 -12
- package/dist/form-react/Fields/MultiWeekPickerField.js +18 -17
- package/dist/form-react/Fields/WeekRangePicker.js +48 -48
- package/dist/form-react/types/fields.types.d.ts +14 -0
- package/dist/impact-nova.css +1 -1
- package/dist/lib/overlay/overlay-portal-context.js +16 -16
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/package.json +1 -1
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { jsxs as f, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import * as a from "react";
|
|
3
|
-
import { Cross as
|
|
4
|
-
import { format as
|
|
5
|
-
import { cn as
|
|
6
|
-
import { Input as
|
|
7
|
-
import { Popover as
|
|
8
|
-
import { Calendar as
|
|
3
|
+
import { Cross as _, CalendarMonth as ee } from "impact-nova-icons";
|
|
4
|
+
import { format as te } from "date-fns";
|
|
5
|
+
import { cn as re } from "../../../lib/utils.js";
|
|
6
|
+
import { Input as oe } from "../input/input.js";
|
|
7
|
+
import { Popover as ne, PopoverAnchor as ae, PopoverContent as se } from "../../feedback/popover/popover.js";
|
|
8
|
+
import { Calendar as ie } from "../../data-display/calendar/calendar.js";
|
|
9
9
|
import { Tooltip as P, TooltipTrigger as C, TooltipContent as k } from "../../feedback/tooltip/tooltip.js";
|
|
10
|
-
import { useImpactNovaI18n as
|
|
11
|
-
import { getDateFnsLocale as
|
|
12
|
-
import { coerceDateArrayApply as
|
|
13
|
-
import { usePickerDismissActionsRef as
|
|
14
|
-
import { buildDateBoundsMatcher as
|
|
15
|
-
import { fiscalCalendarPassThrough as
|
|
16
|
-
const
|
|
10
|
+
import { useImpactNovaI18n as ce } from "../../../i18n/use-impact-nova-i18n.js";
|
|
11
|
+
import { getDateFnsLocale as le } from "../../../i18n/getDateFnsLocale.js";
|
|
12
|
+
import { coerceDateArrayApply as pe, coerceDateArray as de } from "./calendar-selection-adapters.js";
|
|
13
|
+
import { usePickerDismissActionsRef as fe, usePickerFooterDismissNudge as me, handlePickerSurfacePointerDown as ue } from "./date-input-behavior.js";
|
|
14
|
+
import { buildDateBoundsMatcher as he } from "../../../lib/date-bounds-matcher.js";
|
|
15
|
+
import { fiscalCalendarPassThrough as ye } from "./fiscal-pass-through.js";
|
|
16
|
+
const ge = a.forwardRef(
|
|
17
17
|
({
|
|
18
18
|
value: t,
|
|
19
19
|
onChange: m,
|
|
@@ -33,60 +33,62 @@ const he = a.forwardRef(
|
|
|
33
33
|
fiscalYearStartMonth: j,
|
|
34
34
|
fiscalConfig: O,
|
|
35
35
|
showPresets: w,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
showPeriodBoundaries: E,
|
|
37
|
+
autoNavigateToAvailable: v,
|
|
38
|
+
comparison: z,
|
|
39
|
+
onComparisonChange: K,
|
|
40
|
+
...q
|
|
41
|
+
}, B) => {
|
|
42
|
+
const { locale: h, t: s } = ce(), H = a.useMemo(() => le(h), [h]), V = M ?? s("datePicker.selectMultipleDates"), [i, n] = a.useState(!1), u = a.useRef(null), y = fe(), { footerFlashKey: $, footerFlashTarget: G, popoverHandlers: J } = me(l, i, y, u), [p, d] = a.useState(t);
|
|
41
43
|
a.useEffect(() => {
|
|
42
44
|
d(t);
|
|
43
45
|
}, [i, t]);
|
|
44
|
-
const
|
|
45
|
-
const c =
|
|
46
|
+
const Q = (e) => {
|
|
47
|
+
const c = de(e);
|
|
46
48
|
d(c), l || m?.(c);
|
|
47
|
-
},
|
|
48
|
-
const c =
|
|
49
|
+
}, U = (e) => {
|
|
50
|
+
const c = pe(e, p);
|
|
49
51
|
m?.(c), n(!1);
|
|
50
52
|
}, g = () => {
|
|
51
53
|
d(t), n(!1);
|
|
52
54
|
}, D = () => {
|
|
53
55
|
d(void 0), m?.(void 0), l || n(!1);
|
|
54
|
-
},
|
|
56
|
+
}, W = t && t.length > 0 ? t.length === 1 ? te(t[0], x, { locale: H }) : `${t.length} dates selected` : "", X = a.useCallback(() => {
|
|
55
57
|
const e = p?.length ?? 0, c = t?.length ?? 0;
|
|
56
58
|
return e === c && (p ?? []).every(
|
|
57
|
-
(
|
|
59
|
+
(Y, Z) => Y.getTime() === t?.[Z]?.getTime()
|
|
58
60
|
) ? "dismiss" : e > 0 ? "apply" : "cancel";
|
|
59
61
|
}, [p, t]);
|
|
60
62
|
return a.useLayoutEffect(() => {
|
|
61
63
|
y.current = {
|
|
62
64
|
onDismiss: g,
|
|
63
|
-
resolveFlash:
|
|
65
|
+
resolveFlash: X
|
|
64
66
|
};
|
|
65
|
-
}), /* @__PURE__ */ f(
|
|
67
|
+
}), /* @__PURE__ */ f(ne, { open: o ? !1 : i, onOpenChange: (e) => {
|
|
66
68
|
o || !e && l || n(e);
|
|
67
69
|
}, children: [
|
|
68
|
-
/* @__PURE__ */ r(
|
|
70
|
+
/* @__PURE__ */ r(ae, { asChild: !0, children: /* @__PURE__ */ r(
|
|
69
71
|
"div",
|
|
70
72
|
{
|
|
71
73
|
ref: u,
|
|
72
|
-
onPointerDown: (e) =>
|
|
74
|
+
onPointerDown: (e) => ue({
|
|
73
75
|
disabled: o,
|
|
74
76
|
event: e,
|
|
75
77
|
onOpen: () => n(!0),
|
|
76
78
|
focusField: () => u.current?.querySelector("input")?.focus()
|
|
77
79
|
}),
|
|
78
80
|
children: /* @__PURE__ */ r(
|
|
79
|
-
|
|
81
|
+
oe,
|
|
80
82
|
{
|
|
81
|
-
ref:
|
|
82
|
-
value:
|
|
83
|
-
placeholder:
|
|
83
|
+
ref: B,
|
|
84
|
+
value: W,
|
|
85
|
+
placeholder: V,
|
|
84
86
|
readOnly: !0,
|
|
85
87
|
disabled: o,
|
|
86
88
|
onClick: () => {
|
|
87
89
|
!o && !i && n(!0);
|
|
88
90
|
},
|
|
89
|
-
className:
|
|
91
|
+
className: re("cursor-pointer", R),
|
|
90
92
|
suffix: /* @__PURE__ */ f("div", { className: "flex items-center gap-1", children: [
|
|
91
93
|
t && t.length > 0 && !o && /* @__PURE__ */ f(P, { children: [
|
|
92
94
|
/* @__PURE__ */ r(C, { asChild: !0, children: /* @__PURE__ */ r(
|
|
@@ -99,7 +101,7 @@ const he = a.forwardRef(
|
|
|
99
101
|
e.stopPropagation(), D();
|
|
100
102
|
},
|
|
101
103
|
className: "inline-flex size-4 items-center justify-center bg-transparent border-none p-0 cursor-pointer",
|
|
102
|
-
children: /* @__PURE__ */ r(
|
|
104
|
+
children: /* @__PURE__ */ r(_, { className: "size-3 hover:text-content" })
|
|
103
105
|
}
|
|
104
106
|
) }),
|
|
105
107
|
/* @__PURE__ */ r(k, { variant: "tertiary", side: "top", children: s("calendar.clear") })
|
|
@@ -119,42 +121,42 @@ const he = a.forwardRef(
|
|
|
119
121
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), o || n(!i));
|
|
120
122
|
},
|
|
121
123
|
className: "inline-flex items-center justify-center bg-transparent border-none p-0 cursor-pointer",
|
|
122
|
-
children: /* @__PURE__ */ r(
|
|
124
|
+
children: /* @__PURE__ */ r(ee, { className: "h-4 w-4 text-secondary-foreground" })
|
|
123
125
|
}
|
|
124
126
|
) }),
|
|
125
127
|
/* @__PURE__ */ r(k, { variant: "tertiary", side: "top", children: s("datePicker.selectMultipleDates") })
|
|
126
128
|
] })
|
|
127
129
|
] }),
|
|
128
|
-
...
|
|
130
|
+
...q
|
|
129
131
|
}
|
|
130
132
|
)
|
|
131
133
|
}
|
|
132
134
|
) }),
|
|
133
135
|
/* @__PURE__ */ r(
|
|
134
|
-
|
|
136
|
+
se,
|
|
135
137
|
{
|
|
136
138
|
className: "w-auto p-0",
|
|
137
139
|
align: "start",
|
|
138
140
|
"aria-label": s("datePicker.selectMultipleDates"),
|
|
139
141
|
onOpenAutoFocus: (e) => e.preventDefault(),
|
|
140
|
-
|
|
142
|
+
...J,
|
|
141
143
|
children: /* @__PURE__ */ r(
|
|
142
|
-
|
|
144
|
+
ie,
|
|
143
145
|
{
|
|
144
146
|
mode: "multiple",
|
|
145
147
|
selected: p,
|
|
146
|
-
footerFlashKey:
|
|
147
|
-
footerFlashTarget:
|
|
148
|
-
onSelect:
|
|
149
|
-
disabled:
|
|
148
|
+
footerFlashKey: $,
|
|
149
|
+
footerFlashTarget: G,
|
|
150
|
+
onSelect: Q,
|
|
151
|
+
disabled: he(A, N),
|
|
150
152
|
startMonth: b,
|
|
151
153
|
endMonth: T,
|
|
152
154
|
showFooter: l,
|
|
153
|
-
onApply:
|
|
155
|
+
onApply: U,
|
|
154
156
|
onCancel: g,
|
|
155
157
|
onClear: D,
|
|
156
158
|
captionLayout: "dropdown",
|
|
157
|
-
...
|
|
159
|
+
...ye({
|
|
158
160
|
calendarKind: S,
|
|
159
161
|
fiscalMode: F,
|
|
160
162
|
granularity: I,
|
|
@@ -162,8 +164,10 @@ const he = a.forwardRef(
|
|
|
162
164
|
fiscalYearStartMonth: j,
|
|
163
165
|
fiscalConfig: O,
|
|
164
166
|
showPresets: w,
|
|
165
|
-
|
|
166
|
-
|
|
167
|
+
showPeriodBoundaries: E,
|
|
168
|
+
autoNavigateToAvailable: v,
|
|
169
|
+
comparison: z,
|
|
170
|
+
onComparisonChange: K
|
|
167
171
|
})
|
|
168
172
|
}
|
|
169
173
|
)
|
|
@@ -172,7 +176,7 @@ const he = a.forwardRef(
|
|
|
172
176
|
] });
|
|
173
177
|
}
|
|
174
178
|
);
|
|
175
|
-
|
|
179
|
+
ge.displayName = "MultiDatePicker";
|
|
176
180
|
export {
|
|
177
|
-
|
|
181
|
+
ge as MultiDatePicker
|
|
178
182
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { jsxs as d, jsx as n } from "react/jsx-runtime";
|
|
2
2
|
import * as s from "react";
|
|
3
|
-
import { Cross as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { Input as
|
|
6
|
-
import { Popover as
|
|
7
|
-
import { Calendar as
|
|
3
|
+
import { Cross as Z, CalendarMonth as _ } from "impact-nova-icons";
|
|
4
|
+
import { cn as ee } from "../../../lib/utils.js";
|
|
5
|
+
import { Input as te } from "../input/input.js";
|
|
6
|
+
import { Popover as ne, PopoverAnchor as re, PopoverContent as oe } from "../../feedback/popover/popover.js";
|
|
7
|
+
import { Calendar as se } from "../../data-display/calendar/calendar.js";
|
|
8
8
|
import { Tooltip as D, TooltipTrigger as b, TooltipContent as x } from "../../feedback/tooltip/tooltip.js";
|
|
9
|
-
import { useImpactNovaI18n as
|
|
10
|
-
import { coerceMonthArrayApply as
|
|
11
|
-
import { usePickerDismissActionsRef as
|
|
12
|
-
import { buildDateBoundsMatcher as
|
|
13
|
-
import { fiscalCalendarPassThrough as
|
|
14
|
-
const
|
|
9
|
+
import { useImpactNovaI18n as ie } from "../../../i18n/use-impact-nova-i18n.js";
|
|
10
|
+
import { coerceMonthArrayApply as ce, coerceMonthArray as ae } from "./calendar-selection-adapters.js";
|
|
11
|
+
import { usePickerDismissActionsRef as le, usePickerFooterDismissNudge as pe, handlePickerSurfacePointerDown as fe } from "./date-input-behavior.js";
|
|
12
|
+
import { buildDateBoundsMatcher as de } from "../../../lib/date-bounds-matcher.js";
|
|
13
|
+
import { fiscalCalendarPassThrough as he } from "./fiscal-pass-through.js";
|
|
14
|
+
const ue = s.forwardRef(
|
|
15
15
|
({
|
|
16
16
|
value: t,
|
|
17
17
|
onChange: h,
|
|
@@ -30,27 +30,29 @@ const de = s.forwardRef(
|
|
|
30
30
|
fiscalYearStartMonth: w,
|
|
31
31
|
fiscalConfig: E,
|
|
32
32
|
showPresets: F,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
showPeriodBoundaries: K,
|
|
34
|
+
autoNavigateToAvailable: z,
|
|
35
|
+
comparison: L,
|
|
36
|
+
onComparisonChange: V,
|
|
37
|
+
...$
|
|
38
|
+
}, q) => {
|
|
39
|
+
const { t: i } = ie(), B = A ?? i("datePicker.selectMultipleMonths"), [c, o] = s.useState(!1), u = s.useRef(!1), m = s.useRef(null), g = le(), { footerFlashKey: H, footerFlashTarget: G, popoverHandlers: J } = pe(l, c, g, m), [p, f] = s.useState(t);
|
|
38
40
|
s.useEffect(() => {
|
|
39
41
|
f(t);
|
|
40
42
|
}, [c, t]);
|
|
41
|
-
const
|
|
42
|
-
const a =
|
|
43
|
+
const Q = (e) => {
|
|
44
|
+
const a = ae(e);
|
|
43
45
|
f(a), l || h?.(a);
|
|
44
|
-
},
|
|
45
|
-
const a =
|
|
46
|
+
}, U = (e) => {
|
|
47
|
+
const a = ce(e, p);
|
|
46
48
|
h?.(a), o(!1);
|
|
47
49
|
}, M = () => {
|
|
48
50
|
f(t), o(!1);
|
|
49
51
|
}, P = () => {
|
|
50
52
|
f(void 0), h?.(void 0), l || o(!1);
|
|
51
|
-
},
|
|
53
|
+
}, W = t && t.length > 0 ? t.length === 1 ? `${t[0].month + 1}/${t[0].year}` : i("datePicker.monthsSelected", { count: t.length }) : "", X = (e) => {
|
|
52
54
|
r || !e && l || o(e);
|
|
53
|
-
},
|
|
55
|
+
}, Y = s.useCallback(() => {
|
|
54
56
|
const e = p?.length ?? 0, a = t?.length ?? 0;
|
|
55
57
|
return e === a && (p ?? []).every(
|
|
56
58
|
(C, k) => C.month === t?.[k]?.month && C.year === t?.[k]?.year
|
|
@@ -59,31 +61,31 @@ const de = s.forwardRef(
|
|
|
59
61
|
return s.useLayoutEffect(() => {
|
|
60
62
|
g.current = {
|
|
61
63
|
onDismiss: M,
|
|
62
|
-
resolveFlash:
|
|
64
|
+
resolveFlash: Y
|
|
63
65
|
};
|
|
64
|
-
}), /* @__PURE__ */ d(
|
|
65
|
-
/* @__PURE__ */ n(
|
|
66
|
+
}), /* @__PURE__ */ d(ne, { open: r ? !1 : c, onOpenChange: X, children: [
|
|
67
|
+
/* @__PURE__ */ n(re, { asChild: !0, children: /* @__PURE__ */ n(
|
|
66
68
|
"div",
|
|
67
69
|
{
|
|
68
70
|
ref: m,
|
|
69
|
-
onPointerDown: (e) =>
|
|
71
|
+
onPointerDown: (e) => fe({
|
|
70
72
|
disabled: r,
|
|
71
73
|
event: e,
|
|
72
74
|
onOpen: () => o(!0),
|
|
73
75
|
focusField: () => m.current?.querySelector("input")?.focus()
|
|
74
76
|
}),
|
|
75
77
|
children: /* @__PURE__ */ n(
|
|
76
|
-
|
|
78
|
+
te,
|
|
77
79
|
{
|
|
78
|
-
ref:
|
|
79
|
-
value:
|
|
80
|
-
placeholder:
|
|
80
|
+
ref: q,
|
|
81
|
+
value: W,
|
|
82
|
+
placeholder: B,
|
|
81
83
|
readOnly: !0,
|
|
82
84
|
disabled: r,
|
|
83
85
|
onClick: () => {
|
|
84
86
|
!r && !c && o(!0);
|
|
85
87
|
},
|
|
86
|
-
className:
|
|
88
|
+
className: ee("cursor-pointer", S),
|
|
87
89
|
suffix: /* @__PURE__ */ d("div", { className: "flex items-center gap-1", children: [
|
|
88
90
|
t && t.length > 0 && !r && /* @__PURE__ */ d(D, { children: [
|
|
89
91
|
/* @__PURE__ */ n(b, { asChild: !0, children: /* @__PURE__ */ n(
|
|
@@ -96,7 +98,7 @@ const de = s.forwardRef(
|
|
|
96
98
|
e.stopPropagation(), P();
|
|
97
99
|
},
|
|
98
100
|
className: "inline-flex size-4 items-center justify-center bg-transparent border-none p-0 cursor-pointer",
|
|
99
|
-
children: /* @__PURE__ */ n(
|
|
101
|
+
children: /* @__PURE__ */ n(Z, { className: "size-3 hover:text-content" })
|
|
100
102
|
}
|
|
101
103
|
) }),
|
|
102
104
|
/* @__PURE__ */ n(x, { variant: "tertiary", side: "top", children: i("calendar.clear") })
|
|
@@ -116,19 +118,19 @@ const de = s.forwardRef(
|
|
|
116
118
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), r || (u.current = !0, o(!c)));
|
|
117
119
|
},
|
|
118
120
|
className: "inline-flex items-center justify-center bg-transparent border-none p-0 cursor-pointer",
|
|
119
|
-
children: /* @__PURE__ */ n(
|
|
121
|
+
children: /* @__PURE__ */ n(_, { className: "h-4 w-4 text-secondary-foreground" })
|
|
120
122
|
}
|
|
121
123
|
) }),
|
|
122
124
|
/* @__PURE__ */ n(x, { variant: "tertiary", side: "top", children: i("datePicker.selectMultipleMonths") })
|
|
123
125
|
] })
|
|
124
126
|
] }),
|
|
125
|
-
|
|
127
|
+
...$
|
|
126
128
|
}
|
|
127
129
|
)
|
|
128
130
|
}
|
|
129
131
|
) }),
|
|
130
132
|
/* @__PURE__ */ n(
|
|
131
|
-
|
|
133
|
+
oe,
|
|
132
134
|
{
|
|
133
135
|
className: "w-auto p-0",
|
|
134
136
|
align: "start",
|
|
@@ -136,26 +138,26 @@ const de = s.forwardRef(
|
|
|
136
138
|
onOpenAutoFocus: (e) => {
|
|
137
139
|
u.current || e.preventDefault(), u.current = !1;
|
|
138
140
|
},
|
|
139
|
-
...
|
|
141
|
+
...J,
|
|
140
142
|
children: /* @__PURE__ */ n(
|
|
141
|
-
|
|
143
|
+
se,
|
|
142
144
|
{
|
|
143
145
|
pickerType: "month",
|
|
144
146
|
monthMode: "multiple",
|
|
145
147
|
selectedMonths: p,
|
|
146
|
-
footerFlashKey:
|
|
147
|
-
footerFlashTarget:
|
|
148
|
-
onMonthSelect:
|
|
149
|
-
disabled:
|
|
148
|
+
footerFlashKey: H,
|
|
149
|
+
footerFlashTarget: G,
|
|
150
|
+
onMonthSelect: Q,
|
|
151
|
+
disabled: de(y, N),
|
|
150
152
|
startMonth: R,
|
|
151
153
|
endMonth: T,
|
|
152
154
|
defaultMonth: y,
|
|
153
155
|
showFooter: l,
|
|
154
|
-
onApply:
|
|
156
|
+
onApply: U,
|
|
155
157
|
onCancel: M,
|
|
156
158
|
onClear: P,
|
|
157
159
|
captionLayout: "dropdown",
|
|
158
|
-
...
|
|
160
|
+
...he({
|
|
159
161
|
calendarKind: I,
|
|
160
162
|
fiscalMode: O,
|
|
161
163
|
granularity: j,
|
|
@@ -163,8 +165,10 @@ const de = s.forwardRef(
|
|
|
163
165
|
fiscalYearStartMonth: w,
|
|
164
166
|
fiscalConfig: E,
|
|
165
167
|
showPresets: F,
|
|
166
|
-
|
|
167
|
-
|
|
168
|
+
showPeriodBoundaries: K,
|
|
169
|
+
autoNavigateToAvailable: z,
|
|
170
|
+
comparison: L,
|
|
171
|
+
onComparisonChange: V
|
|
168
172
|
})
|
|
169
173
|
}
|
|
170
174
|
)
|
|
@@ -173,7 +177,7 @@ const de = s.forwardRef(
|
|
|
173
177
|
] });
|
|
174
178
|
}
|
|
175
179
|
);
|
|
176
|
-
|
|
180
|
+
ue.displayName = "MultiMonthPicker";
|
|
177
181
|
export {
|
|
178
|
-
|
|
182
|
+
ue as MultiMonthPicker
|
|
179
183
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsx as r, jsxs as g } from "react/jsx-runtime";
|
|
2
2
|
import * as n from "react";
|
|
3
|
-
import { Cross as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { Input as
|
|
6
|
-
import { Calendar as
|
|
3
|
+
import { Cross as Z, CalendarMonth as _ } from "impact-nova-icons";
|
|
4
|
+
import { cn as $ } from "../../../lib/utils.js";
|
|
5
|
+
import { Input as ee } from "../input/input.js";
|
|
6
|
+
import { Calendar as te } from "../../data-display/calendar/calendar.js";
|
|
7
7
|
import { Tooltip as M, TooltipTrigger as x, TooltipContent as b } from "../../feedback/tooltip/tooltip.js";
|
|
8
|
-
import { useImpactNovaI18n as
|
|
9
|
-
import { buildDateBoundsMatcher as
|
|
10
|
-
import { fiscalCalendarPassThrough as
|
|
11
|
-
import { DatePickerShell as
|
|
12
|
-
import { usePickerDismissActionsRef as
|
|
13
|
-
import { formatQuarterInput as
|
|
14
|
-
import { viewMonthFromQuarter as
|
|
15
|
-
const
|
|
8
|
+
import { useImpactNovaI18n as re } from "../../../i18n/use-impact-nova-i18n.js";
|
|
9
|
+
import { buildDateBoundsMatcher as ne } from "../../../lib/date-bounds-matcher.js";
|
|
10
|
+
import { fiscalCalendarPassThrough as oe } from "./fiscal-pass-through.js";
|
|
11
|
+
import { DatePickerShell as ae } from "./date-picker-shell.js";
|
|
12
|
+
import { usePickerDismissActionsRef as ie, usePickerFooterDismissNudge as ce, handleReadonlyPickerKeyDown as se, handlePickerSurfacePointerDown as le } from "./date-input-behavior.js";
|
|
13
|
+
import { formatQuarterInput as pe } from "../../data-display/calendar/calendar-fiscal-labels.js";
|
|
14
|
+
import { viewMonthFromQuarter as ue } from "../../data-display/calendar/calendar-quarter-utils.js";
|
|
15
|
+
const fe = n.forwardRef(
|
|
16
16
|
({
|
|
17
17
|
value: t,
|
|
18
18
|
onChange: u,
|
|
@@ -31,26 +31,30 @@ const pe = n.forwardRef(
|
|
|
31
31
|
fiscalYearStartMonth: v,
|
|
32
32
|
fiscalConfig: K,
|
|
33
33
|
showPresets: j,
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const
|
|
34
|
+
showPeriodBoundaries: F,
|
|
35
|
+
autoNavigateToAvailable: z,
|
|
36
|
+
...E
|
|
37
|
+
}, H) => {
|
|
38
|
+
const { t: a } = re(), L = R ?? a("datePicker.selectMultipleQuarters"), f = n.useRef(null), y = n.useRef(null);
|
|
39
|
+
n.useImperativeHandle(H, () => f.current);
|
|
40
|
+
const [i, c] = n.useState(!1), d = n.useRef(!1), k = ie(), { footerFlashKey: V, footerFlashTarget: q, popoverHandlers: B } = ce(s, i, k, y), [P, l] = n.useState(t), [G, J] = n.useState(ue(t?.[0]));
|
|
39
41
|
n.useEffect(() => {
|
|
40
42
|
i || l(t);
|
|
41
43
|
}, [i, t]);
|
|
42
|
-
const m = n.useCallback(() => c(!1), []),
|
|
44
|
+
const m = n.useCallback(() => c(!1), []), U = oe({
|
|
43
45
|
calendarKind: I,
|
|
44
46
|
fiscalMode: O,
|
|
45
47
|
granularity: T,
|
|
46
48
|
fiscalMonthPattern: w,
|
|
47
49
|
fiscalYearStartMonth: v,
|
|
48
50
|
fiscalConfig: K,
|
|
49
|
-
showPresets: j
|
|
50
|
-
|
|
51
|
+
showPresets: j,
|
|
52
|
+
showPeriodBoundaries: F,
|
|
53
|
+
autoNavigateToAvailable: z
|
|
54
|
+
}), W = (e) => {
|
|
51
55
|
const p = Array.isArray(e) && e.length > 0 ? e : void 0;
|
|
52
56
|
l(p), s || u?.(p);
|
|
53
|
-
},
|
|
57
|
+
}, X = () => {
|
|
54
58
|
u?.(P), m();
|
|
55
59
|
}, h = () => {
|
|
56
60
|
l(t), m();
|
|
@@ -60,9 +64,9 @@ const pe = n.forwardRef(
|
|
|
60
64
|
n.useLayoutEffect(() => {
|
|
61
65
|
k.current = { onDismiss: h, resolveFlash: () => "cancel" };
|
|
62
66
|
});
|
|
63
|
-
const
|
|
67
|
+
const Y = t && t.length > 0 ? t.length === 1 ? pe(t[0]) : a("datePicker.quartersSelected", { count: t.length }) : "";
|
|
64
68
|
return /* @__PURE__ */ r(
|
|
65
|
-
|
|
69
|
+
ae,
|
|
66
70
|
{
|
|
67
71
|
open: i,
|
|
68
72
|
disabled: o,
|
|
@@ -73,26 +77,26 @@ const pe = n.forwardRef(
|
|
|
73
77
|
onOpenAutoFocus: (e) => {
|
|
74
78
|
d.current || e.preventDefault(), d.current = !1;
|
|
75
79
|
},
|
|
76
|
-
popoverHandlers:
|
|
80
|
+
popoverHandlers: B,
|
|
77
81
|
trigger: /* @__PURE__ */ r(
|
|
78
82
|
"div",
|
|
79
83
|
{
|
|
80
84
|
ref: y,
|
|
81
85
|
"data-component": "multi-quarter-picker",
|
|
82
86
|
"data-state": i ? "open" : "closed",
|
|
83
|
-
onPointerDown: (e) =>
|
|
87
|
+
onPointerDown: (e) => le({
|
|
84
88
|
disabled: o,
|
|
85
89
|
event: e,
|
|
86
90
|
onOpen: () => c(!0),
|
|
87
91
|
focusField: () => f.current?.focus()
|
|
88
92
|
}),
|
|
89
93
|
children: /* @__PURE__ */ r(
|
|
90
|
-
|
|
94
|
+
ee,
|
|
91
95
|
{
|
|
92
96
|
ref: f,
|
|
93
|
-
value:
|
|
97
|
+
value: Y,
|
|
94
98
|
readOnly: !0,
|
|
95
|
-
onKeyDown: (e) =>
|
|
99
|
+
onKeyDown: (e) => se(e, {
|
|
96
100
|
disabled: o,
|
|
97
101
|
open: i,
|
|
98
102
|
onOpen: () => c(!0),
|
|
@@ -102,10 +106,10 @@ const pe = n.forwardRef(
|
|
|
102
106
|
}
|
|
103
107
|
}),
|
|
104
108
|
onClick: () => !o && c(!0),
|
|
105
|
-
placeholder:
|
|
109
|
+
placeholder: L,
|
|
106
110
|
disabled: o,
|
|
107
111
|
"data-form-control": "input",
|
|
108
|
-
className:
|
|
112
|
+
className: $("cursor-pointer", A),
|
|
109
113
|
suffix: /* @__PURE__ */ g("div", { className: "flex items-center gap-1", children: [
|
|
110
114
|
t && t.length > 0 && !o ? /* @__PURE__ */ g(M, { children: [
|
|
111
115
|
/* @__PURE__ */ r(x, { asChild: !0, children: /* @__PURE__ */ r(
|
|
@@ -118,7 +122,7 @@ const pe = n.forwardRef(
|
|
|
118
122
|
e.stopPropagation(), C();
|
|
119
123
|
},
|
|
120
124
|
className: "inline-flex size-4 items-center justify-center border-none bg-transparent p-0",
|
|
121
|
-
children: /* @__PURE__ */ r(
|
|
125
|
+
children: /* @__PURE__ */ r(Z, { className: "size-3 hover:text-content" })
|
|
122
126
|
}
|
|
123
127
|
) }),
|
|
124
128
|
/* @__PURE__ */ r(b, { variant: "tertiary", side: "top", children: a("calendar.clear") })
|
|
@@ -135,43 +139,43 @@ const pe = n.forwardRef(
|
|
|
135
139
|
e.stopPropagation(), o || c((p) => !p);
|
|
136
140
|
},
|
|
137
141
|
className: "inline-flex items-center justify-center border-none bg-transparent p-0",
|
|
138
|
-
children: /* @__PURE__ */ r(
|
|
142
|
+
children: /* @__PURE__ */ r(_, { className: "h-4 w-4 text-secondary-foreground" })
|
|
139
143
|
}
|
|
140
144
|
) }),
|
|
141
145
|
/* @__PURE__ */ r(b, { variant: "tertiary", side: "top", children: a("datePicker.selectMultipleQuarters") })
|
|
142
146
|
] })
|
|
143
147
|
] }),
|
|
144
|
-
...
|
|
148
|
+
...E
|
|
145
149
|
}
|
|
146
150
|
)
|
|
147
151
|
}
|
|
148
152
|
),
|
|
149
153
|
children: /* @__PURE__ */ r(
|
|
150
|
-
|
|
154
|
+
te,
|
|
151
155
|
{
|
|
152
156
|
pickerType: "quarter",
|
|
153
157
|
monthMode: "multiple",
|
|
154
158
|
selectedQuarters: P,
|
|
155
|
-
footerFlashKey:
|
|
156
|
-
footerFlashTarget:
|
|
157
|
-
onQuarterSelect:
|
|
158
|
-
month:
|
|
159
|
-
onMonthChange:
|
|
160
|
-
disabled:
|
|
159
|
+
footerFlashKey: V,
|
|
160
|
+
footerFlashTarget: q,
|
|
161
|
+
onQuarterSelect: W,
|
|
162
|
+
month: G,
|
|
163
|
+
onMonthChange: J,
|
|
164
|
+
disabled: ne(D, Q),
|
|
161
165
|
startMonth: N,
|
|
162
166
|
endMonth: S,
|
|
163
167
|
showFooter: s,
|
|
164
|
-
onApply:
|
|
168
|
+
onApply: X,
|
|
165
169
|
onCancel: h,
|
|
166
170
|
onClear: C,
|
|
167
|
-
...
|
|
171
|
+
...U
|
|
168
172
|
}
|
|
169
173
|
)
|
|
170
174
|
}
|
|
171
175
|
);
|
|
172
176
|
}
|
|
173
177
|
);
|
|
174
|
-
|
|
178
|
+
fe.displayName = "MultiQuarterPicker";
|
|
175
179
|
export {
|
|
176
|
-
|
|
180
|
+
fe as MultiQuarterPicker
|
|
177
181
|
};
|