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