impact-nova 2.5.9 → 2.5.10
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/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-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 +2 -1
- package/dist/components/data-display/calendar/calendar-day-picker-components.js +194 -162
- 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 +130 -129
- 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-week-number-cell.d.ts +2 -1
- package/dist/components/data-display/calendar/calendar-week-number-cell.js +43 -42
- 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.js +102 -100
- package/dist/components/data-display/calendar/calendar.types.d.ts +2 -0
- package/dist/components/data-display/calendar/use-calendar-day-picker-config.d.ts +4 -2
- package/dist/components/data-display/calendar/use-calendar-day-picker-config.js +77 -72
- package/dist/components/feedback/dialog/dialog.js +12 -12
- package/dist/components/feedback/sheet/sheet.js +22 -22
- 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/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 +71 -69
- package/dist/components/forms/date-picker/date-picker.types.d.ts +2 -0
- package/dist/components/forms/date-picker/date-range-picker.js +146 -144
- package/dist/components/forms/date-picker/fiscal-pass-through.d.ts +1 -0
- package/dist/components/forms/date-picker/fiscal-pass-through.js +1 -0
- package/dist/components/forms/date-picker/month-picker.js +82 -80
- package/dist/components/forms/date-picker/month-range-picker.js +145 -143
- 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/picker-story-layout.d.ts +2 -0
- 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 +82 -80
- package/dist/components/forms/date-picker/week-range-picker.js +169 -164
- 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/SelectMenuPanel.js +3 -2
- package/dist/components/forms/select/components/SelectTriggerValue.js +2 -3
- package/dist/components/forms/select/components/Submenu.js +2 -3
- package/dist/components/forms/select/select.js +1 -0
- package/dist/form-react/Fields/WeekRangePicker.js +47 -48
- package/dist/form-react/types/fields.types.d.ts +2 -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,24 +1,24 @@
|
|
|
1
1
|
import { jsx as u, jsxs as D } from "react/jsx-runtime";
|
|
2
2
|
import * as s from "react";
|
|
3
|
-
import { Cross as
|
|
3
|
+
import { Cross as Ge, CalendarMonth as Je } from "impact-nova-icons";
|
|
4
4
|
import { cn as z } from "../../../lib/utils.js";
|
|
5
|
-
import { usePickerDismissActionsRef as
|
|
6
|
-
import { useFieldChrome as
|
|
7
|
-
import { Popover as
|
|
8
|
-
import { Calendar as
|
|
9
|
-
import { Tooltip as
|
|
10
|
-
import { useImpactNovaI18n as
|
|
11
|
-
import { coerceMonthRangeApply as
|
|
12
|
-
import { buildDateBoundsMatcher as
|
|
13
|
-
import { fiscalCalendarPassThrough as
|
|
14
|
-
import { formatFiscalPeriod as
|
|
5
|
+
import { usePickerDismissActionsRef as Qe, usePickerFooterDismissNudge as Ue, createRangePickerOpenChangeHandler as We, parseDateInput as H, normalizeOrderedRange as ee, compareMonthSelection as V, flashRangeReorder as te, isDateInputInvalid as re, resolveRangeFieldBlur as A, resolveRangePickerDismissFlash as Xe, handlePickerEscapeKeyDown as oe, handlePickerSurfacePointerDown as Ze, deferRangeInputBlur as _e, maskDateInput as ne, resolveDateInputOnBlur as O } from "./date-input-behavior.js";
|
|
6
|
+
import { useFieldChrome as Fe } from "../../../lib/primitives/use-field-chrome.js";
|
|
7
|
+
import { Popover as et, PopoverAnchor as tt, PopoverContent as rt } from "../../feedback/popover/popover.js";
|
|
8
|
+
import { Calendar as ot } from "../../data-display/calendar/calendar.js";
|
|
9
|
+
import { Tooltip as se, TooltipTrigger as ie, TooltipContent as ae } from "../../feedback/tooltip/tooltip.js";
|
|
10
|
+
import { useImpactNovaI18n as nt } from "../../../i18n/use-impact-nova-i18n.js";
|
|
11
|
+
import { coerceMonthRangeApply as st, isMonthRangeSelection as it } from "./calendar-selection-adapters.js";
|
|
12
|
+
import { buildDateBoundsMatcher as at } from "../../../lib/date-bounds-matcher.js";
|
|
13
|
+
import { fiscalCalendarPassThrough as ct } from "./fiscal-pass-through.js";
|
|
14
|
+
import { formatFiscalPeriod as ft } from "./fiscal-period-format.js";
|
|
15
15
|
const h = (t, n = "MM/YYYY") => {
|
|
16
|
-
const E =
|
|
16
|
+
const E = ft(t);
|
|
17
17
|
if (E) return E;
|
|
18
18
|
const k = (t.month + 1).toString().padStart(2, "0");
|
|
19
19
|
return n === "YYYY/MM" ? `${t.year}/${k}` : `${k}/${t.year}`;
|
|
20
20
|
};
|
|
21
|
-
function
|
|
21
|
+
function dt(t, n) {
|
|
22
22
|
if (!t && !n) return !0;
|
|
23
23
|
if (!t || !n) return !1;
|
|
24
24
|
const E = t.from === void 0 && n.from === void 0 || t.from !== void 0 && n.from !== void 0 && V(t.from, n.from) === 0, k = t.to === void 0 && n.to === void 0 || t.to !== void 0 && n.to !== void 0 && V(t.to, n.to) === 0;
|
|
@@ -27,58 +27,59 @@ function ct(t, n) {
|
|
|
27
27
|
function b(t) {
|
|
28
28
|
return { month: t.getMonth(), year: t.getFullYear() };
|
|
29
29
|
}
|
|
30
|
-
const
|
|
30
|
+
const lt = s.forwardRef(
|
|
31
31
|
({
|
|
32
32
|
value: t,
|
|
33
33
|
onChange: n,
|
|
34
34
|
placeholder: E,
|
|
35
35
|
minDate: k,
|
|
36
|
-
maxDate:
|
|
37
|
-
startMonth:
|
|
38
|
-
endMonth:
|
|
36
|
+
maxDate: ce,
|
|
37
|
+
startMonth: fe,
|
|
38
|
+
endMonth: de,
|
|
39
39
|
showFooter: g = !0,
|
|
40
40
|
disabled: c,
|
|
41
|
-
className:
|
|
42
|
-
error:
|
|
43
|
-
isError:
|
|
41
|
+
className: le,
|
|
42
|
+
error: me,
|
|
43
|
+
isError: pe,
|
|
44
44
|
size: q,
|
|
45
|
-
label:
|
|
46
|
-
helperText:
|
|
47
|
-
helperTextPosition:
|
|
48
|
-
required:
|
|
49
|
-
prefix:
|
|
50
|
-
prefixClick:
|
|
45
|
+
label: ue,
|
|
46
|
+
helperText: he,
|
|
47
|
+
helperTextPosition: ge = "absolute",
|
|
48
|
+
required: Me,
|
|
49
|
+
prefix: mt,
|
|
50
|
+
prefixClick: pt,
|
|
51
51
|
displayFormat: i = "MM/YYYY",
|
|
52
|
-
calendarKind:
|
|
53
|
-
fiscalMode:
|
|
54
|
-
granularity:
|
|
55
|
-
fiscalMonthPattern:
|
|
56
|
-
fiscalYearStartMonth:
|
|
57
|
-
fiscalConfig:
|
|
52
|
+
calendarKind: Re,
|
|
53
|
+
fiscalMode: ye,
|
|
54
|
+
granularity: ke,
|
|
55
|
+
fiscalMonthPattern: ve,
|
|
56
|
+
fiscalYearStartMonth: xe,
|
|
57
|
+
fiscalConfig: Ce,
|
|
58
58
|
showPresets: Ye,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
59
|
+
showPeriodBoundaries: Pe,
|
|
60
|
+
comparison: be,
|
|
61
|
+
onComparisonChange: we,
|
|
62
|
+
...Ie
|
|
63
|
+
}, De) => {
|
|
64
|
+
const L = me ?? pe, Ee = Fe({
|
|
65
|
+
label: ue,
|
|
66
|
+
helperText: he,
|
|
67
|
+
helperTextPosition: ge,
|
|
67
68
|
error: L,
|
|
68
|
-
required:
|
|
69
|
+
required: Me,
|
|
69
70
|
disabled: c ?? void 0,
|
|
70
71
|
rootClassName: "w-full min-w-[240px]"
|
|
71
|
-
}), { t:
|
|
72
|
+
}), { t: C } = nt(), K = s.useRef(null), G = s.useRef(null), J = s.useRef(null), S = s.useRef(null), j = s.useRef(null), l = s.useMemo(
|
|
72
73
|
() => i === "YYYY/MM" ? "yyyy/MM" : "MM/yyyy",
|
|
73
74
|
[i]
|
|
74
75
|
);
|
|
75
|
-
s.useImperativeHandle(
|
|
76
|
-
const [
|
|
76
|
+
s.useImperativeHandle(De, () => K.current);
|
|
77
|
+
const [f, M] = s.useState(!1), Q = Qe(), { footerFlashKey: Se, footerFlashTarget: Te, popoverHandlers: Be } = Ue(g, f, Q, J), I = s.useRef(!1), [d, R] = s.useState(t), [p, v] = s.useState(t?.from ? h(t.from, i) : ""), [y, x] = s.useState(t?.to ? h(t.to, i) : ""), [Ne, w] = s.useState(() => t?.from ? new Date(t.from.year, t.from.month, 1) : k || /* @__PURE__ */ new Date());
|
|
77
78
|
s.useEffect(() => {
|
|
78
79
|
v(t?.from ? h(t.from, i) : ""), x(t?.to ? h(t.to, i) : ""), R(t);
|
|
79
80
|
}, [t, i]);
|
|
80
|
-
const
|
|
81
|
-
(e) =>
|
|
81
|
+
const Ae = s.useCallback(
|
|
82
|
+
(e) => We({
|
|
82
83
|
disabled: c ?? void 0,
|
|
83
84
|
showFooter: g,
|
|
84
85
|
containerRef: S,
|
|
@@ -88,113 +89,113 @@ const ft = s.forwardRef(
|
|
|
88
89
|
[c, g]
|
|
89
90
|
), U = s.useRef(!1);
|
|
90
91
|
s.useEffect(() => {
|
|
91
|
-
if (
|
|
92
|
-
const e = H(p,
|
|
93
|
-
e.parsed ? w(e.parsed) :
|
|
92
|
+
if (f && !U.current) {
|
|
93
|
+
const e = H(p, l);
|
|
94
|
+
e.parsed ? w(e.parsed) : d?.from ? w(new Date(d.from.year, d.from.month, 1)) : t?.from ? w(new Date(t.from.year, t.from.month, 1)) : k && w(k);
|
|
94
95
|
}
|
|
95
|
-
U.current =
|
|
96
|
-
}, [
|
|
97
|
-
const
|
|
98
|
-
const r =
|
|
96
|
+
U.current = f;
|
|
97
|
+
}, [f, p, l, d?.from, t?.from, k]);
|
|
98
|
+
const Oe = (e) => {
|
|
99
|
+
const r = it(e) ? e : void 0;
|
|
99
100
|
R(r), r?.from && v(h(r.from, i)), r?.to && x(h(r.to, i)), !g && r?.from && r?.to && (r.from.month !== r.to.month || r.from.year !== r.to.year) && (n?.(r), M(!1));
|
|
100
101
|
}, W = (e) => {
|
|
101
|
-
const r =
|
|
102
|
+
const r = st(e, d), o = ee(r?.from, r?.to, V);
|
|
102
103
|
o.swapped && (o.from && v(h(o.from, i)), o.to && x(h(o.to, i)), R({ from: o.from, to: o.to }), te(S.current)), n?.({ from: o.from, to: o.to }), M(!1);
|
|
103
104
|
}, B = () => {
|
|
104
105
|
R(t), v(t?.from ? h(t.from, i) : ""), x(t?.to ? h(t.to, i) : ""), M(!1);
|
|
105
106
|
}, $ = () => {
|
|
106
107
|
R(void 0), v(""), x(""), n?.(void 0), g || M(!1);
|
|
107
|
-
},
|
|
108
|
-
const r =
|
|
108
|
+
}, Ve = (e) => {
|
|
109
|
+
const r = ne(e.target.value, l, p);
|
|
109
110
|
if (v(r), r === "") {
|
|
110
|
-
const
|
|
111
|
-
R(
|
|
111
|
+
const m = { from: void 0, to: d?.to };
|
|
112
|
+
R(m), g || n?.(m);
|
|
112
113
|
return;
|
|
113
114
|
}
|
|
114
|
-
const { parsed: o, isValid: a } = H(r,
|
|
115
|
+
const { parsed: o, isValid: a } = H(r, l);
|
|
115
116
|
if (a && o) {
|
|
116
|
-
const T = { from: b(o), to:
|
|
117
|
+
const T = { from: b(o), to: d?.to };
|
|
117
118
|
R(T), w(o), g || n?.(T);
|
|
118
119
|
}
|
|
119
|
-
},
|
|
120
|
-
const r =
|
|
120
|
+
}, Ke = (e) => {
|
|
121
|
+
const r = ne(e.target.value, l, y);
|
|
121
122
|
if (x(r), r === "") {
|
|
122
|
-
const
|
|
123
|
-
R(
|
|
123
|
+
const m = { from: d?.from, to: void 0 };
|
|
124
|
+
R(m), g || n?.(m);
|
|
124
125
|
return;
|
|
125
126
|
}
|
|
126
|
-
const { parsed: o, isValid: a } = H(r,
|
|
127
|
+
const { parsed: o, isValid: a } = H(r, l);
|
|
127
128
|
if (a && o) {
|
|
128
|
-
const
|
|
129
|
+
const m = b(o), T = { from: d?.from, to: m };
|
|
129
130
|
R(T), w(o), g || n?.(T);
|
|
130
131
|
}
|
|
131
132
|
}, N = s.useCallback((e, r) => {
|
|
132
133
|
const o = ee(e, r, V);
|
|
133
134
|
return o.swapped && (o.from && v(h(o.from, i)), o.to && x(h(o.to, i)), te(S.current)), { from: o.from, to: o.to };
|
|
134
|
-
}, [i]),
|
|
135
|
-
const e = O(p,
|
|
136
|
-
e.resetToCommitted ? v(
|
|
137
|
-
let o = e.parsed ? b(e.parsed) :
|
|
135
|
+
}, [i]), je = () => {
|
|
136
|
+
const e = O(p, l, Y), r = O(y, l, P);
|
|
137
|
+
e.resetToCommitted ? v(Y) : e.parsed && v(e.display), r.resetToCommitted ? x(P) : r.parsed && x(r.display);
|
|
138
|
+
let o = e.parsed ? b(e.parsed) : d?.from, a = r.parsed ? b(r.parsed) : d?.to;
|
|
138
139
|
if ({ from: o, to: a } = N(o, a), o || a) {
|
|
139
|
-
const
|
|
140
|
-
R(
|
|
140
|
+
const m = { from: o, to: a };
|
|
141
|
+
R(m), n?.(m);
|
|
141
142
|
} else !p && !y && (R(void 0), n?.(void 0));
|
|
142
143
|
}, X = () => {
|
|
143
|
-
|
|
144
|
+
_e(
|
|
144
145
|
S,
|
|
145
146
|
j,
|
|
146
147
|
() => {
|
|
147
|
-
const e = A(p,
|
|
148
|
-
e.resetToCommitted ? v(
|
|
149
|
-
let o = e.parsed ? b(e.parsed) : e.resetToCommitted ? t?.from :
|
|
148
|
+
const e = A(p, l, Y), r = A(y, l, P);
|
|
149
|
+
e.resetToCommitted ? v(Y) : e.parsed && v(e.display), r.resetToCommitted ? x(P) : r.parsed && x(r.display);
|
|
150
|
+
let o = e.parsed ? b(e.parsed) : e.resetToCommitted ? t?.from : d?.from, a = r.parsed ? b(r.parsed) : r.resetToCommitted ? t?.to : d?.to;
|
|
150
151
|
o && a && ({ from: o, to: a } = N(o, a));
|
|
151
|
-
const
|
|
152
|
-
R(
|
|
152
|
+
const m = o || a ? { from: o, to: a } : void 0;
|
|
153
|
+
R(m), g || (m ? n?.(m) : !p && !y && n?.(void 0));
|
|
153
154
|
}
|
|
154
155
|
);
|
|
155
156
|
}, Z = () => {
|
|
156
|
-
if (
|
|
157
|
+
if (f && g) {
|
|
157
158
|
W();
|
|
158
159
|
return;
|
|
159
160
|
}
|
|
160
|
-
if (!
|
|
161
|
+
if (!f) {
|
|
161
162
|
if (g) {
|
|
162
|
-
|
|
163
|
+
je();
|
|
163
164
|
return;
|
|
164
165
|
}
|
|
165
|
-
const e = O(p,
|
|
166
|
+
const e = O(p, l, Y), r = O(y, l, P);
|
|
166
167
|
if (e.parsed || r.parsed) return;
|
|
167
168
|
I.current = !0, M(!0);
|
|
168
169
|
}
|
|
169
|
-
},
|
|
170
|
-
const e = A(p,
|
|
171
|
-
let o = e.parsed ? b(e.parsed) : e.resetToCommitted ? t?.from :
|
|
170
|
+
}, Y = t?.from ? h(t.from, i) : "", P = t?.to ? h(t.to, i) : "", $e = p !== Y, ze = y !== P, He = re(p, l), qe = re(y, l), _ = C("datePicker.startMonth"), F = C("datePicker.endMonth"), Le = s.useCallback(() => {
|
|
171
|
+
const e = A(p, l, Y), r = A(y, l, P);
|
|
172
|
+
let o = e.parsed ? b(e.parsed) : e.resetToCommitted ? t?.from : d?.from, a = r.parsed ? b(r.parsed) : r.resetToCommitted ? t?.to : d?.to;
|
|
172
173
|
o && a && ({ from: o, to: a } = N(o, a));
|
|
173
|
-
const
|
|
174
|
-
return
|
|
174
|
+
const m = o || a ? { from: o, to: a } : void 0;
|
|
175
|
+
return Xe({
|
|
175
176
|
startInput: p,
|
|
176
177
|
endInput: y,
|
|
177
|
-
committedStart:
|
|
178
|
+
committedStart: Y,
|
|
178
179
|
committedEnd: P,
|
|
179
180
|
committedRange: t,
|
|
180
|
-
pendingRange:
|
|
181
|
-
computeEffectiveRange: () =>
|
|
182
|
-
rangesEqual:
|
|
181
|
+
pendingRange: d,
|
|
182
|
+
computeEffectiveRange: () => m,
|
|
183
|
+
rangesEqual: dt
|
|
183
184
|
});
|
|
184
185
|
}, [
|
|
185
186
|
p,
|
|
186
187
|
y,
|
|
187
|
-
|
|
188
|
+
Y,
|
|
188
189
|
P,
|
|
189
190
|
t,
|
|
190
|
-
f,
|
|
191
191
|
d,
|
|
192
|
+
l,
|
|
192
193
|
N
|
|
193
194
|
]);
|
|
194
195
|
return s.useLayoutEffect(() => {
|
|
195
196
|
Q.current = {
|
|
196
197
|
onDismiss: B,
|
|
197
|
-
resolveFlash:
|
|
198
|
+
resolveFlash: Le
|
|
198
199
|
};
|
|
199
200
|
}), /* @__PURE__ */ u(
|
|
200
201
|
"div",
|
|
@@ -202,14 +203,14 @@ const ft = s.forwardRef(
|
|
|
202
203
|
ref: J,
|
|
203
204
|
"data-component": "month-range-picker",
|
|
204
205
|
"data-disabled": c || void 0,
|
|
205
|
-
children:
|
|
206
|
-
/* @__PURE__ */ D(
|
|
207
|
-
/* @__PURE__ */ u(
|
|
206
|
+
children: Ee.wrapControl(
|
|
207
|
+
/* @__PURE__ */ D(et, { open: c ? !1 : f, onOpenChange: Ae, children: [
|
|
208
|
+
/* @__PURE__ */ u(tt, { asChild: !0, children: /* @__PURE__ */ D(
|
|
208
209
|
"div",
|
|
209
210
|
{
|
|
210
211
|
ref: S,
|
|
211
|
-
"data-state":
|
|
212
|
-
onPointerDown: (e) =>
|
|
212
|
+
"data-state": f ? "open" : "closed",
|
|
213
|
+
onPointerDown: (e) => Ze({
|
|
213
214
|
disabled: c,
|
|
214
215
|
event: e,
|
|
215
216
|
onOpen: () => M(!0),
|
|
@@ -223,7 +224,7 @@ const ft = s.forwardRef(
|
|
|
223
224
|
q === "sm" ? "h-6" : q === "md" ? "h-[28px]" : "h-8",
|
|
224
225
|
c && "pointer-events-none opacity-100 bg-disabled-surface border-stroke text-disabled-foreground hover:border-stroke",
|
|
225
226
|
"cursor-pointer",
|
|
226
|
-
|
|
227
|
+
le
|
|
227
228
|
),
|
|
228
229
|
children: [
|
|
229
230
|
/* @__PURE__ */ D("div", { className: "flex items-center gap-4 flex-1 min-w-0", children: [
|
|
@@ -233,21 +234,21 @@ const ft = s.forwardRef(
|
|
|
233
234
|
ref: K,
|
|
234
235
|
type: "text",
|
|
235
236
|
value: p,
|
|
236
|
-
onChange:
|
|
237
|
+
onChange: Ve,
|
|
237
238
|
onBlur: X,
|
|
238
239
|
onClick: () => !c && M(!0),
|
|
239
240
|
onKeyDown: (e) => {
|
|
240
|
-
e.key === "Enter" && !c && (e.preventDefault(), Z()), e.key === "ArrowDown" && !
|
|
241
|
+
e.key === "Enter" && !c && (e.preventDefault(), Z()), e.key === "ArrowDown" && !f && !c && (e.preventDefault(), I.current = !0, M(!0)), e.key === "Escape" && f && oe(e, { open: f, onCancel: B });
|
|
241
242
|
},
|
|
242
|
-
placeholder:
|
|
243
|
+
placeholder: f ? i === "YYYY/MM" ? "YYYY/MM" : C("datePicker.monthYearFormat") : _,
|
|
243
244
|
disabled: !!c,
|
|
244
245
|
"aria-label": _,
|
|
245
246
|
"data-field": "start",
|
|
246
247
|
className: z(
|
|
247
248
|
"flex-1 min-w-0 bg-transparent p-0 text-sm font-medium outline-none placeholder:font-medium placeholder:text-content-empty disabled:cursor-not-allowed disabled:opacity-50",
|
|
248
|
-
|
|
249
|
+
He ? "text-destructive" : $e ? "text-content-placeholder" : ""
|
|
249
250
|
),
|
|
250
|
-
...
|
|
251
|
+
...Ie
|
|
251
252
|
}
|
|
252
253
|
),
|
|
253
254
|
/* @__PURE__ */ u(
|
|
@@ -256,31 +257,31 @@ const ft = s.forwardRef(
|
|
|
256
257
|
ref: G,
|
|
257
258
|
type: "text",
|
|
258
259
|
value: y,
|
|
259
|
-
onChange:
|
|
260
|
+
onChange: Ke,
|
|
260
261
|
onBlur: X,
|
|
261
262
|
onClick: () => !c && M(!0),
|
|
262
263
|
onKeyDown: (e) => {
|
|
263
|
-
e.key === "Enter" && !c && (e.preventDefault(), Z()), e.key === "ArrowDown" && !
|
|
264
|
+
e.key === "Enter" && !c && (e.preventDefault(), Z()), e.key === "ArrowDown" && !f && !c && (e.preventDefault(), I.current = !0, M(!0)), e.key === "Escape" && f && oe(e, { open: f, onCancel: B });
|
|
264
265
|
},
|
|
265
|
-
placeholder:
|
|
266
|
+
placeholder: f ? i === "YYYY/MM" ? "YYYY/MM" : C("datePicker.monthYearFormat") : F,
|
|
266
267
|
disabled: !!c,
|
|
267
268
|
"aria-label": F,
|
|
268
269
|
"data-field": "end",
|
|
269
270
|
className: z(
|
|
270
271
|
"flex-1 min-w-0 bg-transparent p-0 text-sm font-medium outline-none placeholder:font-medium placeholder:text-content-empty disabled:cursor-not-allowed disabled:opacity-50",
|
|
271
|
-
|
|
272
|
+
qe ? "text-destructive" : ze ? "text-content-placeholder" : ""
|
|
272
273
|
)
|
|
273
274
|
}
|
|
274
275
|
)
|
|
275
276
|
] }),
|
|
276
277
|
/* @__PURE__ */ D("div", { className: "flex items-center gap-1 shrink-0", children: [
|
|
277
|
-
t?.from && !c && /* @__PURE__ */ D(
|
|
278
|
-
/* @__PURE__ */ u(
|
|
278
|
+
t?.from && !c && /* @__PURE__ */ D(se, { children: [
|
|
279
|
+
/* @__PURE__ */ u(ie, { asChild: !0, children: /* @__PURE__ */ u(
|
|
279
280
|
"button",
|
|
280
281
|
{
|
|
281
282
|
type: "button",
|
|
282
283
|
tabIndex: 0,
|
|
283
|
-
"aria-label":
|
|
284
|
+
"aria-label": C("calendar.clear"),
|
|
284
285
|
onClick: (e) => {
|
|
285
286
|
e.stopPropagation(), $();
|
|
286
287
|
},
|
|
@@ -288,62 +289,63 @@ const ft = s.forwardRef(
|
|
|
288
289
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), $());
|
|
289
290
|
},
|
|
290
291
|
className: "inline-flex size-4 items-center justify-center bg-transparent border-none p-0 cursor-pointer",
|
|
291
|
-
children: /* @__PURE__ */ u(
|
|
292
|
+
children: /* @__PURE__ */ u(Ge, { className: "size-3 hover:text-content text-content-icon" })
|
|
292
293
|
}
|
|
293
294
|
) }),
|
|
294
|
-
/* @__PURE__ */ u(
|
|
295
|
+
/* @__PURE__ */ u(ae, { variant: "tertiary", side: "top", children: C("calendar.clear") })
|
|
295
296
|
] }),
|
|
296
|
-
/* @__PURE__ */ D(
|
|
297
|
-
/* @__PURE__ */ u(
|
|
298
|
-
e.stopPropagation(), c || M(!
|
|
297
|
+
/* @__PURE__ */ D(se, { children: [
|
|
298
|
+
/* @__PURE__ */ u(ie, { asChild: !0, children: /* @__PURE__ */ u("button", { type: "button", tabIndex: 0, "aria-label": C("datePicker.selectMonthRange"), onClick: (e) => {
|
|
299
|
+
e.stopPropagation(), c || M(!f);
|
|
299
300
|
}, onKeyDown: (e) => {
|
|
300
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), c || (I.current = !0, M(!
|
|
301
|
-
}, className: "inline-flex items-center justify-center bg-transparent border-none p-0 cursor-pointer", children: /* @__PURE__ */ u(
|
|
302
|
-
/* @__PURE__ */ u(
|
|
301
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), c || (I.current = !0, M(!f)));
|
|
302
|
+
}, className: "inline-flex items-center justify-center bg-transparent border-none p-0 cursor-pointer", children: /* @__PURE__ */ u(Je, { className: "h-4 w-4 text-secondary-foreground" }) }) }),
|
|
303
|
+
/* @__PURE__ */ u(ae, { variant: "tertiary", side: "top", children: C("datePicker.selectMonthRange") })
|
|
303
304
|
] })
|
|
304
305
|
] })
|
|
305
306
|
]
|
|
306
307
|
}
|
|
307
308
|
) }),
|
|
308
309
|
/* @__PURE__ */ u(
|
|
309
|
-
|
|
310
|
+
rt,
|
|
310
311
|
{
|
|
311
312
|
ref: j,
|
|
312
313
|
className: "w-auto p-0",
|
|
313
314
|
align: "start",
|
|
314
|
-
"aria-label":
|
|
315
|
+
"aria-label": C("datePicker.selectMonthRange"),
|
|
315
316
|
onOpenAutoFocus: (e) => {
|
|
316
317
|
I.current || e.preventDefault(), I.current = !1;
|
|
317
318
|
},
|
|
318
|
-
...
|
|
319
|
+
...Be,
|
|
319
320
|
children: /* @__PURE__ */ u(
|
|
320
|
-
|
|
321
|
+
ot,
|
|
321
322
|
{
|
|
322
323
|
pickerType: "month",
|
|
323
324
|
monthMode: "range",
|
|
324
|
-
selectedMonths:
|
|
325
|
-
footerFlashKey:
|
|
326
|
-
footerFlashTarget:
|
|
327
|
-
onMonthSelect:
|
|
328
|
-
month:
|
|
325
|
+
selectedMonths: d,
|
|
326
|
+
footerFlashKey: Se,
|
|
327
|
+
footerFlashTarget: Te,
|
|
328
|
+
onMonthSelect: Oe,
|
|
329
|
+
month: Ne,
|
|
329
330
|
onMonthChange: w,
|
|
330
|
-
disabled:
|
|
331
|
-
startMonth:
|
|
332
|
-
endMonth:
|
|
331
|
+
disabled: at(k, ce),
|
|
332
|
+
startMonth: fe,
|
|
333
|
+
endMonth: de,
|
|
333
334
|
showFooter: g,
|
|
334
335
|
onApply: W,
|
|
335
336
|
onCancel: B,
|
|
336
337
|
onClear: $,
|
|
337
|
-
...
|
|
338
|
-
calendarKind:
|
|
339
|
-
fiscalMode:
|
|
340
|
-
granularity:
|
|
341
|
-
fiscalMonthPattern:
|
|
342
|
-
fiscalYearStartMonth:
|
|
343
|
-
fiscalConfig:
|
|
338
|
+
...ct({
|
|
339
|
+
calendarKind: Re,
|
|
340
|
+
fiscalMode: ye,
|
|
341
|
+
granularity: ke,
|
|
342
|
+
fiscalMonthPattern: ve,
|
|
343
|
+
fiscalYearStartMonth: xe,
|
|
344
|
+
fiscalConfig: Ce,
|
|
344
345
|
showPresets: Ye,
|
|
345
|
-
|
|
346
|
-
|
|
346
|
+
showPeriodBoundaries: Pe,
|
|
347
|
+
comparison: be,
|
|
348
|
+
onComparisonChange: we
|
|
347
349
|
})
|
|
348
350
|
}
|
|
349
351
|
)
|
|
@@ -355,7 +357,7 @@ const ft = s.forwardRef(
|
|
|
355
357
|
);
|
|
356
358
|
}
|
|
357
359
|
);
|
|
358
|
-
|
|
360
|
+
lt.displayName = "MonthRangePicker";
|
|
359
361
|
export {
|
|
360
|
-
|
|
362
|
+
lt as MonthRangePicker
|
|
361
363
|
};
|