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