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