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