impact-nova 2.5.10 → 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/expandable-list-item/expandable-list-item-attributes.js +3 -2
- package/dist/components/data/expandable-list-item/expandable-list-item-metrics.js +3 -2
- 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-components.d.ts +4 -2
- package/dist/components/data-display/calendar/calendar-day-picker-components.js +163 -152
- package/dist/components/data-display/calendar/calendar-day-picker-view.js +77 -76
- 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-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 +2 -1
- package/dist/components/data-display/calendar/calendar-week-number-cell.js +55 -41
- 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 +146 -143
- package/dist/components/data-display/calendar/calendar.types.d.ts +5 -0
- package/dist/components/data-display/calendar/use-calendar-day-picker-config.d.ts +2 -1
- package/dist/components/data-display/calendar/use-calendar-day-picker-config.js +79 -74
- 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/tooltip/tab-tooltip-render.js +3 -2
- package/dist/components/flows/command-palette/shortcut-settings.js +10 -10
- package/dist/components/flows/filter-panel/filter-panel.js +4 -4
- package/dist/components/forms/date-picker/date-picker.js +60 -58
- package/dist/components/forms/date-picker/date-picker.types.d.ts +5 -0
- package/dist/components/forms/date-picker/date-range-picker.js +66 -64
- package/dist/components/forms/date-picker/fiscal-pass-through.d.ts +1 -0
- package/dist/components/forms/date-picker/fiscal-pass-through.js +3 -2
- package/dist/components/forms/date-picker/month-picker.js +61 -59
- package/dist/components/forms/date-picker/month-range-picker.js +63 -61
- package/dist/components/forms/date-picker/multi-date-picker.js +51 -49
- package/dist/components/forms/date-picker/multi-month-picker.js +49 -47
- package/dist/components/forms/date-picker/multi-quarter-picker.js +46 -44
- package/dist/components/forms/date-picker/multi-week-picker.js +53 -51
- package/dist/components/forms/date-picker/multi-year-picker.js +48 -46
- package/dist/components/forms/date-picker/quarter-picker.js +46 -44
- package/dist/components/forms/date-picker/quarter-range-picker.js +45 -43
- package/dist/components/forms/date-picker/week-picker.js +68 -66
- package/dist/components/forms/date-picker/week-range-picker.js +82 -80
- package/dist/components/forms/date-picker/year-picker.js +47 -45
- package/dist/components/forms/date-picker/year-range-picker.js +47 -45
- package/dist/components/forms/select/components/SelectTriggerValue.js +3 -2
- package/dist/components/forms/select/components/Submenu.js +3 -2
- 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 +22 -21
- package/dist/form-react/types/fields.types.d.ts +12 -0
- package/dist/impact-nova.css +1 -1
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/package.json +1 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsx as r, jsxs as y } 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 $, CalendarMonth as ee } from "impact-nova-icons";
|
|
4
|
+
import { cn as te } from "../../../lib/utils.js";
|
|
5
|
+
import { Input as re } from "../input/input.js";
|
|
6
|
+
import { Calendar as ne } from "../../data-display/calendar/calendar.js";
|
|
7
7
|
import { Tooltip as M, TooltipTrigger as x, TooltipContent as R } 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 { formatYearInput as
|
|
14
|
-
import { viewMonthFromYear as
|
|
15
|
-
const
|
|
8
|
+
import { useImpactNovaI18n as oe } from "../../../i18n/use-impact-nova-i18n.js";
|
|
9
|
+
import { buildDateBoundsMatcher as ae } from "../../../lib/date-bounds-matcher.js";
|
|
10
|
+
import { fiscalCalendarPassThrough as ie } from "./fiscal-pass-through.js";
|
|
11
|
+
import { DatePickerShell as se } from "./date-picker-shell.js";
|
|
12
|
+
import { usePickerDismissActionsRef as ce, usePickerFooterDismissNudge as le, handleReadonlyPickerKeyDown as pe, handlePickerSurfacePointerDown as fe } from "./date-input-behavior.js";
|
|
13
|
+
import { formatYearInput as de } from "../../data-display/calendar/calendar-fiscal-labels.js";
|
|
14
|
+
import { viewMonthFromYear as ue } from "../../data-display/calendar/calendar-year-utils.js";
|
|
15
|
+
const me = n.forwardRef(
|
|
16
16
|
({
|
|
17
17
|
value: t,
|
|
18
18
|
onChange: f,
|
|
@@ -32,16 +32,17 @@ const ue = n.forwardRef(
|
|
|
32
32
|
fiscalConfig: g,
|
|
33
33
|
showPresets: j,
|
|
34
34
|
showPeriodBoundaries: F,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
autoNavigateToAvailable: L,
|
|
36
|
+
showIntervalCaption: z = !1,
|
|
37
|
+
...E
|
|
38
|
+
}, H) => {
|
|
39
|
+
const { t: a } = oe(), V = D ?? a("datePicker.selectMultipleYears"), B = g?.fyLabel ?? "fy-long", d = n.useRef(null), k = n.useRef(null);
|
|
40
|
+
n.useImperativeHandle(H, () => d.current);
|
|
41
|
+
const [i, s] = n.useState(!1), u = n.useRef(!1), P = ce(), { footerFlashKey: q, footerFlashTarget: G, popoverHandlers: J } = le(c, i, P, k), [C, l] = n.useState(t), [Q, U] = n.useState(ue(t?.[0]));
|
|
41
42
|
n.useEffect(() => {
|
|
42
43
|
i || l(t);
|
|
43
44
|
}, [i, t]);
|
|
44
|
-
const m = n.useCallback(() => s(!1), []),
|
|
45
|
+
const m = n.useCallback(() => s(!1), []), W = ie({
|
|
45
46
|
calendarKind: O,
|
|
46
47
|
fiscalMode: T,
|
|
47
48
|
granularity: w,
|
|
@@ -49,11 +50,12 @@ const ue = n.forwardRef(
|
|
|
49
50
|
fiscalYearStartMonth: K,
|
|
50
51
|
fiscalConfig: g,
|
|
51
52
|
showPresets: j,
|
|
52
|
-
showPeriodBoundaries: F
|
|
53
|
-
|
|
53
|
+
showPeriodBoundaries: F,
|
|
54
|
+
autoNavigateToAvailable: L
|
|
55
|
+
}), X = (e) => {
|
|
54
56
|
const p = Array.isArray(e) && e.length > 0 ? e : void 0;
|
|
55
57
|
l(p), c || f?.(p);
|
|
56
|
-
},
|
|
58
|
+
}, Z = () => {
|
|
57
59
|
f?.(C), m();
|
|
58
60
|
}, h = () => {
|
|
59
61
|
l(t), m();
|
|
@@ -63,9 +65,9 @@ const ue = n.forwardRef(
|
|
|
63
65
|
n.useLayoutEffect(() => {
|
|
64
66
|
P.current = { onDismiss: h, resolveFlash: () => "cancel" };
|
|
65
67
|
});
|
|
66
|
-
const
|
|
68
|
+
const _ = t && t.length > 0 ? t.length === 1 ? de(t[0], B) : a("datePicker.yearsSelected", { count: t.length }) : "";
|
|
67
69
|
return /* @__PURE__ */ r(
|
|
68
|
-
|
|
70
|
+
se,
|
|
69
71
|
{
|
|
70
72
|
open: i,
|
|
71
73
|
disabled: o,
|
|
@@ -76,26 +78,26 @@ const ue = n.forwardRef(
|
|
|
76
78
|
onOpenAutoFocus: (e) => {
|
|
77
79
|
u.current || e.preventDefault(), u.current = !1;
|
|
78
80
|
},
|
|
79
|
-
popoverHandlers:
|
|
81
|
+
popoverHandlers: J,
|
|
80
82
|
trigger: /* @__PURE__ */ r(
|
|
81
83
|
"div",
|
|
82
84
|
{
|
|
83
85
|
ref: k,
|
|
84
86
|
"data-component": "multi-year-picker",
|
|
85
87
|
"data-state": i ? "open" : "closed",
|
|
86
|
-
onPointerDown: (e) =>
|
|
88
|
+
onPointerDown: (e) => fe({
|
|
87
89
|
disabled: o,
|
|
88
90
|
event: e,
|
|
89
91
|
onOpen: () => s(!0),
|
|
90
92
|
focusField: () => d.current?.focus()
|
|
91
93
|
}),
|
|
92
94
|
children: /* @__PURE__ */ r(
|
|
93
|
-
|
|
95
|
+
re,
|
|
94
96
|
{
|
|
95
97
|
ref: d,
|
|
96
|
-
value:
|
|
98
|
+
value: _,
|
|
97
99
|
readOnly: !0,
|
|
98
|
-
onKeyDown: (e) =>
|
|
100
|
+
onKeyDown: (e) => pe(e, {
|
|
99
101
|
disabled: o,
|
|
100
102
|
open: i,
|
|
101
103
|
onOpen: () => s(!0),
|
|
@@ -105,10 +107,10 @@ const ue = n.forwardRef(
|
|
|
105
107
|
}
|
|
106
108
|
}),
|
|
107
109
|
onClick: () => !o && s(!0),
|
|
108
|
-
placeholder:
|
|
110
|
+
placeholder: V,
|
|
109
111
|
disabled: o,
|
|
110
112
|
"data-form-control": "input",
|
|
111
|
-
className:
|
|
113
|
+
className: te("cursor-pointer", I),
|
|
112
114
|
suffix: /* @__PURE__ */ y("div", { className: "flex items-center gap-1", children: [
|
|
113
115
|
t && t.length > 0 && !o ? /* @__PURE__ */ y(M, { children: [
|
|
114
116
|
/* @__PURE__ */ r(x, { asChild: !0, children: /* @__PURE__ */ r(
|
|
@@ -121,7 +123,7 @@ const ue = n.forwardRef(
|
|
|
121
123
|
e.stopPropagation(), b();
|
|
122
124
|
},
|
|
123
125
|
className: "inline-flex size-4 items-center justify-center border-none bg-transparent p-0",
|
|
124
|
-
children: /* @__PURE__ */ r(
|
|
126
|
+
children: /* @__PURE__ */ r($, { className: "size-3 hover:text-content" })
|
|
125
127
|
}
|
|
126
128
|
) }),
|
|
127
129
|
/* @__PURE__ */ r(R, { variant: "tertiary", side: "top", children: a("calendar.clear") })
|
|
@@ -138,44 +140,44 @@ const ue = n.forwardRef(
|
|
|
138
140
|
e.stopPropagation(), o || s((p) => !p);
|
|
139
141
|
},
|
|
140
142
|
className: "inline-flex items-center justify-center border-none bg-transparent p-0",
|
|
141
|
-
children: /* @__PURE__ */ r(
|
|
143
|
+
children: /* @__PURE__ */ r(ee, { className: "h-4 w-4 text-secondary-foreground" })
|
|
142
144
|
}
|
|
143
145
|
) }),
|
|
144
146
|
/* @__PURE__ */ r(R, { variant: "tertiary", side: "top", children: a("datePicker.selectMultipleYears") })
|
|
145
147
|
] })
|
|
146
148
|
] }),
|
|
147
|
-
...
|
|
149
|
+
...E
|
|
148
150
|
}
|
|
149
151
|
)
|
|
150
152
|
}
|
|
151
153
|
),
|
|
152
154
|
children: /* @__PURE__ */ r(
|
|
153
|
-
|
|
155
|
+
ne,
|
|
154
156
|
{
|
|
155
157
|
pickerType: "year",
|
|
156
158
|
yearMode: "multiple",
|
|
157
159
|
selectedYear: C,
|
|
158
|
-
footerFlashKey:
|
|
159
|
-
footerFlashTarget:
|
|
160
|
-
onYearSelect:
|
|
161
|
-
month:
|
|
162
|
-
onMonthChange:
|
|
163
|
-
disabled:
|
|
160
|
+
footerFlashKey: q,
|
|
161
|
+
footerFlashTarget: G,
|
|
162
|
+
onYearSelect: X,
|
|
163
|
+
month: Q,
|
|
164
|
+
onMonthChange: U,
|
|
165
|
+
disabled: ae(Y, N),
|
|
164
166
|
startMonth: S,
|
|
165
167
|
endMonth: A,
|
|
166
168
|
showFooter: c,
|
|
167
|
-
onApply:
|
|
169
|
+
onApply: Z,
|
|
168
170
|
onCancel: h,
|
|
169
171
|
onClear: b,
|
|
170
|
-
showIntervalCaption:
|
|
171
|
-
...
|
|
172
|
+
showIntervalCaption: z,
|
|
173
|
+
...W
|
|
172
174
|
}
|
|
173
175
|
)
|
|
174
176
|
}
|
|
175
177
|
);
|
|
176
178
|
}
|
|
177
179
|
);
|
|
178
|
-
|
|
180
|
+
me.displayName = "MultiYearPicker";
|
|
179
181
|
export {
|
|
180
|
-
|
|
182
|
+
me as MultiYearPicker
|
|
181
183
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsx as r, jsxs as y } from "react/jsx-runtime";
|
|
2
2
|
import * as t from "react";
|
|
3
|
-
import { Cross as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { Input as
|
|
6
|
-
import { Calendar as
|
|
3
|
+
import { Cross as _, CalendarMonth as $ } from "impact-nova-icons";
|
|
4
|
+
import { cn as q } from "../../../lib/utils.js";
|
|
5
|
+
import { Input as ee } from "../input/input.js";
|
|
6
|
+
import { Calendar as re } from "../../data-display/calendar/calendar.js";
|
|
7
7
|
import { Tooltip as x, TooltipTrigger as b, TooltipContent as R } 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 te } 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 fe } from "../../data-display/calendar/calendar-quarter-utils.js";
|
|
15
|
+
const ue = t.forwardRef(
|
|
16
16
|
({
|
|
17
17
|
value: n,
|
|
18
18
|
onChange: u,
|
|
@@ -32,15 +32,16 @@ const fe = t.forwardRef(
|
|
|
32
32
|
fiscalConfig: K,
|
|
33
33
|
showPresets: j,
|
|
34
34
|
showPeriodBoundaries: F,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
t
|
|
39
|
-
|
|
35
|
+
autoNavigateToAvailable: z,
|
|
36
|
+
...E
|
|
37
|
+
}, H) => {
|
|
38
|
+
const { t: a } = te(), L = D ?? a("datePicker.selectQuarter"), d = t.useRef(null), k = t.useRef(null);
|
|
39
|
+
t.useImperativeHandle(H, () => d.current);
|
|
40
|
+
const [i, c] = t.useState(!1), P = ie(), { footerFlashKey: V, footerFlashTarget: B, popoverHandlers: G } = ce(s, i, P, k), m = t.useRef(!1), [g, l] = t.useState(n), [J, U] = t.useState(fe(n));
|
|
40
41
|
t.useEffect(() => {
|
|
41
42
|
i || l(n);
|
|
42
43
|
}, [i, n]);
|
|
43
|
-
const p = t.useCallback(() => c(!1), []),
|
|
44
|
+
const p = t.useCallback(() => c(!1), []), W = oe({
|
|
44
45
|
calendarKind: I,
|
|
45
46
|
fiscalMode: O,
|
|
46
47
|
granularity: T,
|
|
@@ -48,11 +49,12 @@ const fe = t.forwardRef(
|
|
|
48
49
|
fiscalYearStartMonth: M,
|
|
49
50
|
fiscalConfig: K,
|
|
50
51
|
showPresets: j,
|
|
51
|
-
showPeriodBoundaries: F
|
|
52
|
-
|
|
52
|
+
showPeriodBoundaries: F,
|
|
53
|
+
autoNavigateToAvailable: z
|
|
54
|
+
}), X = (e) => {
|
|
53
55
|
const f = e && !Array.isArray(e) && !("from" in e) && !("to" in e) ? e : void 0;
|
|
54
56
|
l(f), s || (u?.(f), p());
|
|
55
|
-
},
|
|
57
|
+
}, Y = () => {
|
|
56
58
|
u?.(g), p();
|
|
57
59
|
}, h = () => {
|
|
58
60
|
l(n), p();
|
|
@@ -62,9 +64,9 @@ const fe = t.forwardRef(
|
|
|
62
64
|
t.useLayoutEffect(() => {
|
|
63
65
|
P.current = { onDismiss: h, resolveFlash: () => "cancel" };
|
|
64
66
|
});
|
|
65
|
-
const
|
|
67
|
+
const Z = n ? pe(n) : "";
|
|
66
68
|
return /* @__PURE__ */ r(
|
|
67
|
-
|
|
69
|
+
ae,
|
|
68
70
|
{
|
|
69
71
|
open: i,
|
|
70
72
|
disabled: o,
|
|
@@ -75,26 +77,26 @@ const fe = t.forwardRef(
|
|
|
75
77
|
onOpenAutoFocus: (e) => {
|
|
76
78
|
m.current || e.preventDefault(), m.current = !1;
|
|
77
79
|
},
|
|
78
|
-
popoverHandlers:
|
|
80
|
+
popoverHandlers: G,
|
|
79
81
|
trigger: /* @__PURE__ */ r(
|
|
80
82
|
"div",
|
|
81
83
|
{
|
|
82
84
|
ref: k,
|
|
83
85
|
"data-component": "quarter-picker",
|
|
84
86
|
"data-state": i ? "open" : "closed",
|
|
85
|
-
onPointerDown: (e) =>
|
|
87
|
+
onPointerDown: (e) => le({
|
|
86
88
|
disabled: o,
|
|
87
89
|
event: e,
|
|
88
90
|
onOpen: () => c(!0),
|
|
89
91
|
focusField: () => d.current?.focus()
|
|
90
92
|
}),
|
|
91
93
|
children: /* @__PURE__ */ r(
|
|
92
|
-
|
|
94
|
+
ee,
|
|
93
95
|
{
|
|
94
96
|
ref: d,
|
|
95
|
-
value:
|
|
97
|
+
value: Z,
|
|
96
98
|
readOnly: !0,
|
|
97
|
-
onKeyDown: (e) =>
|
|
99
|
+
onKeyDown: (e) => se(e, {
|
|
98
100
|
disabled: o,
|
|
99
101
|
open: i,
|
|
100
102
|
onOpen: () => c(!0),
|
|
@@ -104,10 +106,10 @@ const fe = t.forwardRef(
|
|
|
104
106
|
}
|
|
105
107
|
}),
|
|
106
108
|
onClick: () => !o && c(!0),
|
|
107
|
-
placeholder:
|
|
109
|
+
placeholder: L,
|
|
108
110
|
disabled: o,
|
|
109
111
|
"data-form-control": "input",
|
|
110
|
-
className:
|
|
112
|
+
className: q("cursor-pointer", A),
|
|
111
113
|
suffix: /* @__PURE__ */ y("div", { className: "flex items-center gap-1", children: [
|
|
112
114
|
n && !o ? /* @__PURE__ */ y(x, { children: [
|
|
113
115
|
/* @__PURE__ */ r(b, { asChild: !0, children: /* @__PURE__ */ r(
|
|
@@ -120,7 +122,7 @@ const fe = t.forwardRef(
|
|
|
120
122
|
e.stopPropagation(), C();
|
|
121
123
|
},
|
|
122
124
|
className: "inline-flex size-4 items-center justify-center border-none bg-transparent p-0",
|
|
123
|
-
children: /* @__PURE__ */ r(
|
|
125
|
+
children: /* @__PURE__ */ r(_, { className: "size-3 hover:text-content" })
|
|
124
126
|
}
|
|
125
127
|
) }),
|
|
126
128
|
/* @__PURE__ */ r(R, { variant: "tertiary", side: "top", children: a("calendar.clear") })
|
|
@@ -137,42 +139,42 @@ const fe = t.forwardRef(
|
|
|
137
139
|
e.stopPropagation(), o || c((f) => !f);
|
|
138
140
|
},
|
|
139
141
|
className: "inline-flex items-center justify-center border-none bg-transparent p-0",
|
|
140
|
-
children: /* @__PURE__ */ r(
|
|
142
|
+
children: /* @__PURE__ */ r($, { className: "h-4 w-4 text-secondary-foreground" })
|
|
141
143
|
}
|
|
142
144
|
) }),
|
|
143
145
|
/* @__PURE__ */ r(R, { variant: "tertiary", side: "top", children: a("datePicker.selectQuarter") })
|
|
144
146
|
] })
|
|
145
147
|
] }),
|
|
146
|
-
...
|
|
148
|
+
...E
|
|
147
149
|
}
|
|
148
150
|
)
|
|
149
151
|
}
|
|
150
152
|
),
|
|
151
153
|
children: /* @__PURE__ */ r(
|
|
152
|
-
|
|
154
|
+
re,
|
|
153
155
|
{
|
|
154
156
|
pickerType: "quarter",
|
|
155
157
|
selectedQuarters: g,
|
|
156
|
-
footerFlashKey:
|
|
157
|
-
footerFlashTarget:
|
|
158
|
-
onQuarterSelect:
|
|
159
|
-
month:
|
|
160
|
-
onMonthChange:
|
|
161
|
-
disabled:
|
|
158
|
+
footerFlashKey: V,
|
|
159
|
+
footerFlashTarget: B,
|
|
160
|
+
onQuarterSelect: X,
|
|
161
|
+
month: J,
|
|
162
|
+
onMonthChange: U,
|
|
163
|
+
disabled: ne(Q, v),
|
|
162
164
|
startMonth: N,
|
|
163
165
|
endMonth: S,
|
|
164
166
|
showFooter: s,
|
|
165
|
-
onApply:
|
|
167
|
+
onApply: Y,
|
|
166
168
|
onCancel: h,
|
|
167
169
|
onClear: C,
|
|
168
|
-
...
|
|
170
|
+
...W
|
|
169
171
|
}
|
|
170
172
|
)
|
|
171
173
|
}
|
|
172
174
|
);
|
|
173
175
|
}
|
|
174
176
|
);
|
|
175
|
-
|
|
177
|
+
ue.displayName = "QuarterPicker";
|
|
176
178
|
export {
|
|
177
|
-
|
|
179
|
+
ue as QuarterPicker
|
|
178
180
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsx as r, jsxs as g } from "react/jsx-runtime";
|
|
2
2
|
import * as t from "react";
|
|
3
|
-
import { Cross as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { Input as
|
|
6
|
-
import { Calendar as
|
|
3
|
+
import { Cross as _, CalendarMonth as q } from "impact-nova-icons";
|
|
4
|
+
import { cn as ee } from "../../../lib/utils.js";
|
|
5
|
+
import { Input as re } from "../input/input.js";
|
|
6
|
+
import { Calendar as te } from "../../data-display/calendar/calendar.js";
|
|
7
7
|
import { Tooltip as C, 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
|
|
8
|
+
import { useImpactNovaI18n as ne } from "../../../i18n/use-impact-nova-i18n.js";
|
|
9
|
+
import { buildDateBoundsMatcher as oe } from "../../../lib/date-bounds-matcher.js";
|
|
10
|
+
import { fiscalCalendarPassThrough as ae } from "./fiscal-pass-through.js";
|
|
11
|
+
import { DatePickerShell as ie } from "./date-picker-shell.js";
|
|
12
|
+
import { usePickerDismissActionsRef as ce, usePickerFooterDismissNudge as se, handleReadonlyPickerKeyDown as le, handlePickerSurfacePointerDown as fe } from "./date-input-behavior.js";
|
|
13
13
|
import { formatQuarterInput as D } from "../../data-display/calendar/calendar-fiscal-labels.js";
|
|
14
|
-
import { viewMonthFromQuarter as
|
|
15
|
-
const
|
|
14
|
+
import { viewMonthFromQuarter as pe } from "../../data-display/calendar/calendar-quarter-utils.js";
|
|
15
|
+
const de = t.forwardRef(
|
|
16
16
|
({
|
|
17
17
|
value: n,
|
|
18
18
|
onChange: d,
|
|
@@ -32,15 +32,16 @@ const pe = t.forwardRef(
|
|
|
32
32
|
fiscalConfig: j,
|
|
33
33
|
showPresets: F,
|
|
34
34
|
showPeriodBoundaries: $,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
t
|
|
39
|
-
|
|
35
|
+
autoNavigateToAvailable: z,
|
|
36
|
+
...E
|
|
37
|
+
}, H) => {
|
|
38
|
+
const { t: a } = ne(), L = Q ?? a("datePicker.selectQuarterRange"), m = t.useRef(null), y = t.useRef(null);
|
|
39
|
+
t.useImperativeHandle(H, () => m.current);
|
|
40
|
+
const [i, c] = t.useState(!1), u = t.useRef(!1), k = ce(), { footerFlashKey: V, footerFlashTarget: B, popoverHandlers: G } = se(l, i, k, y), [P, f] = t.useState(n), [J, U] = t.useState(pe(n?.from));
|
|
40
41
|
t.useEffect(() => {
|
|
41
42
|
i || f(n);
|
|
42
43
|
}, [i, n]);
|
|
43
|
-
const p = t.useCallback(() => c(!1), []),
|
|
44
|
+
const p = t.useCallback(() => c(!1), []), W = ae({
|
|
44
45
|
calendarKind: M,
|
|
45
46
|
fiscalMode: O,
|
|
46
47
|
granularity: T,
|
|
@@ -48,11 +49,12 @@ const pe = t.forwardRef(
|
|
|
48
49
|
fiscalYearStartMonth: K,
|
|
49
50
|
fiscalConfig: j,
|
|
50
51
|
showPresets: F,
|
|
51
|
-
showPeriodBoundaries:
|
|
52
|
-
|
|
52
|
+
showPeriodBoundaries: $,
|
|
53
|
+
autoNavigateToAvailable: z
|
|
54
|
+
}), X = (e) => {
|
|
53
55
|
const s = e && !Array.isArray(e) && ("from" in e || "to" in e) ? e : void 0;
|
|
54
56
|
f(s), l || (d?.(s), s?.to && p());
|
|
55
|
-
},
|
|
57
|
+
}, Y = () => {
|
|
56
58
|
d?.(P), p();
|
|
57
59
|
}, h = () => {
|
|
58
60
|
f(n), p();
|
|
@@ -62,9 +64,9 @@ const pe = t.forwardRef(
|
|
|
62
64
|
t.useLayoutEffect(() => {
|
|
63
65
|
k.current = { onDismiss: h, resolveFlash: () => "cancel" };
|
|
64
66
|
});
|
|
65
|
-
const
|
|
67
|
+
const Z = n?.from ? `${D(n.from)}${n.to ? ` – ${D(n.to)}` : ""}` : "";
|
|
66
68
|
return /* @__PURE__ */ r(
|
|
67
|
-
|
|
69
|
+
ie,
|
|
68
70
|
{
|
|
69
71
|
open: i,
|
|
70
72
|
disabled: o,
|
|
@@ -75,26 +77,26 @@ const pe = t.forwardRef(
|
|
|
75
77
|
onOpenAutoFocus: (e) => {
|
|
76
78
|
u.current || e.preventDefault(), u.current = !1;
|
|
77
79
|
},
|
|
78
|
-
popoverHandlers:
|
|
80
|
+
popoverHandlers: G,
|
|
79
81
|
trigger: /* @__PURE__ */ r(
|
|
80
82
|
"div",
|
|
81
83
|
{
|
|
82
84
|
ref: y,
|
|
83
85
|
"data-component": "quarter-range-picker",
|
|
84
86
|
"data-state": i ? "open" : "closed",
|
|
85
|
-
onPointerDown: (e) =>
|
|
87
|
+
onPointerDown: (e) => fe({
|
|
86
88
|
disabled: o,
|
|
87
89
|
event: e,
|
|
88
90
|
onOpen: () => c(!0),
|
|
89
91
|
focusField: () => m.current?.focus()
|
|
90
92
|
}),
|
|
91
93
|
children: /* @__PURE__ */ r(
|
|
92
|
-
|
|
94
|
+
re,
|
|
93
95
|
{
|
|
94
96
|
ref: m,
|
|
95
|
-
value:
|
|
97
|
+
value: Z,
|
|
96
98
|
readOnly: !0,
|
|
97
|
-
onKeyDown: (e) =>
|
|
99
|
+
onKeyDown: (e) => le(e, {
|
|
98
100
|
disabled: o,
|
|
99
101
|
open: i,
|
|
100
102
|
onOpen: () => c(!0),
|
|
@@ -104,10 +106,10 @@ const pe = t.forwardRef(
|
|
|
104
106
|
}
|
|
105
107
|
}),
|
|
106
108
|
onClick: () => !o && c(!0),
|
|
107
|
-
placeholder:
|
|
109
|
+
placeholder: L,
|
|
108
110
|
disabled: o,
|
|
109
111
|
"data-form-control": "input",
|
|
110
|
-
className:
|
|
112
|
+
className: ee("cursor-pointer", I),
|
|
111
113
|
suffix: /* @__PURE__ */ g("div", { className: "flex items-center gap-1", children: [
|
|
112
114
|
n?.from && !o ? /* @__PURE__ */ g(C, { children: [
|
|
113
115
|
/* @__PURE__ */ r(x, { asChild: !0, children: /* @__PURE__ */ r(
|
|
@@ -120,7 +122,7 @@ const pe = t.forwardRef(
|
|
|
120
122
|
e.stopPropagation(), R();
|
|
121
123
|
},
|
|
122
124
|
className: "inline-flex size-4 items-center justify-center border-none bg-transparent p-0",
|
|
123
|
-
children: /* @__PURE__ */ r(
|
|
125
|
+
children: /* @__PURE__ */ r(_, { className: "size-3 hover:text-content" })
|
|
124
126
|
}
|
|
125
127
|
) }),
|
|
126
128
|
/* @__PURE__ */ r(b, { variant: "tertiary", side: "top", children: a("calendar.clear") })
|
|
@@ -137,43 +139,43 @@ const pe = t.forwardRef(
|
|
|
137
139
|
e.stopPropagation(), o || c((s) => !s);
|
|
138
140
|
},
|
|
139
141
|
className: "inline-flex items-center justify-center border-none bg-transparent p-0",
|
|
140
|
-
children: /* @__PURE__ */ r(
|
|
142
|
+
children: /* @__PURE__ */ r(q, { className: "h-4 w-4 text-secondary-foreground" })
|
|
141
143
|
}
|
|
142
144
|
) }),
|
|
143
145
|
/* @__PURE__ */ r(b, { variant: "tertiary", side: "top", children: a("datePicker.selectQuarterRange") })
|
|
144
146
|
] })
|
|
145
147
|
] }),
|
|
146
|
-
...
|
|
148
|
+
...E
|
|
147
149
|
}
|
|
148
150
|
)
|
|
149
151
|
}
|
|
150
152
|
),
|
|
151
153
|
children: /* @__PURE__ */ r(
|
|
152
|
-
|
|
154
|
+
te,
|
|
153
155
|
{
|
|
154
156
|
pickerType: "quarter",
|
|
155
157
|
monthMode: "range",
|
|
156
158
|
selectedQuarters: P,
|
|
157
|
-
footerFlashKey:
|
|
158
|
-
footerFlashTarget:
|
|
159
|
-
onQuarterSelect:
|
|
160
|
-
month:
|
|
161
|
-
onMonthChange:
|
|
162
|
-
disabled:
|
|
159
|
+
footerFlashKey: V,
|
|
160
|
+
footerFlashTarget: B,
|
|
161
|
+
onQuarterSelect: X,
|
|
162
|
+
month: J,
|
|
163
|
+
onMonthChange: U,
|
|
164
|
+
disabled: oe(N, S),
|
|
163
165
|
startMonth: v,
|
|
164
166
|
endMonth: A,
|
|
165
167
|
showFooter: l,
|
|
166
|
-
onApply:
|
|
168
|
+
onApply: Y,
|
|
167
169
|
onCancel: h,
|
|
168
170
|
onClear: R,
|
|
169
|
-
...
|
|
171
|
+
...W
|
|
170
172
|
}
|
|
171
173
|
)
|
|
172
174
|
}
|
|
173
175
|
);
|
|
174
176
|
}
|
|
175
177
|
);
|
|
176
|
-
|
|
178
|
+
de.displayName = "QuarterRangePicker";
|
|
177
179
|
export {
|
|
178
|
-
|
|
180
|
+
de as QuarterRangePicker
|
|
179
181
|
};
|