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