impact-nova 2.5.13 → 2.5.14
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/build-column-tree-from-grid.d.ts +0 -1
- package/dist/components/data/data-table/build-column-tree-from-grid.js +50 -55
- package/dist/components/data/data-table/data-table-column-apply.d.ts +0 -2
- package/dist/components/data/data-table/data-table-column-apply.js +73 -84
- package/dist/components/data/data-table/data-table-column-list.js +64 -94
- package/dist/components/data/data-table/data-table-column-tree-cache.d.ts +6 -12
- package/dist/components/data/data-table/data-table-column-tree-cache.js +131 -250
- package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.d.ts +0 -5
- package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.js +11 -28
- package/dist/components/data/data-table/use-data-table-column-list-sync.d.ts +0 -10
- package/dist/components/data/data-table/use-data-table-column-list-sync.js +196 -250
- package/dist/components/data/expandable-list-item/expandable-list-item-attributes.js +3 -2
- package/dist/components/data/expandable-list-item/expandable-list-item-metrics.js +3 -2
- package/dist/components/data/nested-list/components/NestedListContent.d.ts +2 -10
- package/dist/components/data/nested-list/components/NestedListContent.js +138 -253
- package/dist/components/data/nested-list/components/SortableItem.d.ts +1 -2
- package/dist/components/data/nested-list/components/SortableItem.js +60 -62
- package/dist/components/data/nested-list/hooks/useNestedListDragDrop.d.ts +20 -10
- package/dist/components/data/nested-list/hooks/useNestedListDragDrop.js +233 -44
- package/dist/components/data/nested-list/nested-list-constants.d.ts +1 -4
- package/dist/components/data/nested-list/nested-list-constants.js +4 -10
- package/dist/components/data/nested-list/nested-list.js +336 -322
- package/dist/components/data/nested-list/nested-list.types.d.ts +0 -17
- 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-config.js +1 -1
- package/dist/components/data-display/calendar/calendar-day-picker-components.d.ts +4 -2
- package/dist/components/data-display/calendar/calendar-day-picker-components.js +234 -164
- package/dist/components/data-display/calendar/calendar-day-picker-view.js +77 -76
- package/dist/components/data-display/calendar/calendar-fiscal-day-cell.d.ts +9 -0
- package/dist/components/data-display/calendar/calendar-fiscal-day-cell.js +45 -0
- 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-footer.js +21 -21
- package/dist/components/data-display/calendar/calendar-injected-week-row.d.ts +5 -0
- package/dist/components/data-display/calendar/calendar-injected-week-row.js +92 -0
- package/dist/components/data-display/calendar/calendar-leading-week.utils.d.ts +16 -0
- package/dist/components/data-display/calendar/calendar-leading-week.utils.js +51 -0
- package/dist/components/data-display/calendar/calendar-month-picker-panel.js +50 -49
- 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-orphan-week.d.ts +23 -0
- package/dist/components/data-display/calendar/calendar-padding-week.utils.d.ts +3 -1
- package/dist/components/data-display/calendar/calendar-padding-week.utils.js +7 -5
- package/dist/components/data-display/calendar/calendar-period-cell.js +45 -46
- package/dist/components/data-display/calendar/calendar-quarter-panes.js +33 -31
- package/dist/components/data-display/calendar/calendar-selection-appearance.d.ts +10 -0
- package/dist/components/data-display/calendar/calendar-selection-appearance.js +53 -39
- package/dist/components/data-display/calendar/calendar-selection.d.ts +25 -0
- package/dist/components/data-display/calendar/calendar-selection.js +52 -23
- 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 +59 -45
- package/dist/components/data-display/calendar/calendar-week-utils.d.ts +15 -4
- package/dist/components/data-display/calendar/calendar-week-utils.js +59 -50
- package/dist/components/data-display/calendar/calendar-year-panes.d.ts +3 -0
- package/dist/components/data-display/calendar/calendar-year-panes.js +53 -49
- package/dist/components/data-display/calendar/calendar.js +146 -143
- package/dist/components/data-display/calendar/calendar.types.d.ts +5 -0
- package/dist/components/data-display/calendar/use-calendar-day-picker-config.d.ts +2 -1
- package/dist/components/data-display/calendar/use-calendar-day-picker-config.js +79 -74
- package/dist/components/data-display/calendar/use-calendar-state.d.ts +3 -1
- package/dist/components/data-display/calendar/use-calendar-state.js +394 -314
- package/dist/components/feedback/tooltip/tab-tooltip-render.js +3 -2
- 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/date-picker.js +60 -58
- package/dist/components/forms/date-picker/date-picker.types.d.ts +5 -0
- package/dist/components/forms/date-picker/date-range-picker.js +66 -64
- package/dist/components/forms/date-picker/fiscal-pass-through.d.ts +1 -0
- package/dist/components/forms/date-picker/fiscal-pass-through.js +3 -2
- package/dist/components/forms/date-picker/fiscal-picker-fixtures.d.ts +17 -0
- package/dist/components/forms/date-picker/month-picker.js +61 -59
- package/dist/components/forms/date-picker/month-range-picker.js +63 -61
- 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 +51 -47
- package/dist/components/forms/date-picker/multi-week-picker.js +53 -51
- package/dist/components/forms/date-picker/multi-year-picker.js +53 -49
- package/dist/components/forms/date-picker/quarter-picker.js +51 -47
- package/dist/components/forms/date-picker/quarter-range-picker.js +50 -46
- package/dist/components/forms/date-picker/week-picker.js +130 -126
- package/dist/components/forms/date-picker/week-range-picker.js +159 -155
- package/dist/components/forms/date-picker/year-picker.js +52 -48
- package/dist/components/forms/date-picker/year-range-picker.js +52 -48
- package/dist/components/forms/select/components/SelectTriggerValue.js +3 -2
- package/dist/components/forms/select/components/Submenu.js +3 -2
- 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 +35 -27
- package/dist/form-react/Fields/MultiYearPickerField.d.ts +8 -0
- package/dist/form-react/Fields/MultiYearPickerField.js +57 -0
- package/dist/form-react/Fields/WeekRangePicker.js +33 -32
- package/dist/form-react/Fields/YearPickerField.d.ts +8 -0
- package/dist/form-react/Fields/YearPickerField.js +57 -0
- package/dist/form-react/Fields/YearRangePickerField.d.ts +8 -0
- package/dist/form-react/Fields/YearRangePickerField.js +57 -0
- package/dist/form-react/registry/defaultFieldRegistrations.d.ts +1 -1
- package/dist/form-react/registry/defaultFieldRegistrations.js +16 -13
- package/dist/form-react/types/fields.types.d.ts +69 -1
- package/dist/form-react/types/fieldsOutput.types.d.ts +8 -2
- package/dist/form-react/utils/fieldDefaults.utils.js +1 -1
- package/dist/impact-nova-components.css +13 -6
- package/dist/impact-nova.css +1 -1
- package/dist/lib/fiscal-calendar/index.d.ts +2 -2
- package/dist/lib/fiscal-calendar/index.js +26 -28
- package/dist/lib/fiscal-calendar/types.d.ts +0 -7
- package/dist/lib/fiscal-calendar/week-selection.d.ts +3 -4
- package/dist/lib/fiscal-calendar/week-selection.js +52 -79
- package/dist/llms/rules/ag-grid.js +1 -1
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/package.json +1 -1
- package/dist/components/data/data-table/column-picker-authority.d.ts +0 -34
- package/dist/components/data/data-table/column-picker-authority.js +0 -116
- package/dist/components/data/data-table/column-picker-drop-validation.d.ts +0 -7
- package/dist/components/data/data-table/column-picker-drop-validation.js +0 -37
- package/dist/components/data/data-table/data-table-column-list-tree-apply.d.ts +0 -10
- package/dist/components/data/data-table/data-table-column-list-tree-apply.js +0 -79
- package/dist/components/data/data-table/data-table-flat-column-virtual-rows.d.ts +0 -26
- package/dist/components/data/data-table/data-table-flat-column-virtual-rows.js +0 -195
- package/dist/components/data/data-table/data-table-picker-column-eligibility.d.ts +0 -1
- package/dist/components/data/data-table/data-table-picker-column-eligibility.js +0 -7
- package/dist/components/data/data-table/reconcile-column-tree-from-grid.d.ts +0 -12
- package/dist/components/data/data-table/reconcile-column-tree-from-grid.js +0 -12
- package/dist/components/data/nested-list/hooks/useVirtualNestedListDrag.d.ts +0 -24
- package/dist/components/data/nested-list/hooks/useVirtualNestedListDrag.js +0 -128
- package/dist/components/data/nested-list/nested-list-display-utils.d.ts +0 -11
- package/dist/components/data/nested-list/nested-list-display-utils.js +0 -74
- package/dist/components/data/nested-list/nested-list-drop-engine.d.ts +0 -31
- package/dist/components/data/nested-list/nested-list-drop-engine.js +0 -209
- package/dist/components/data/nested-list/nested-list-flat-virtual-handlers.d.ts +0 -26
- package/dist/components/data/nested-list/nested-list-flat-virtual-handlers.js +0 -67
- package/dist/components/data/nested-list/nested-list-item-tree-mutations.d.ts +0 -4
- package/dist/components/data/nested-list/nested-list-item-tree-mutations.js +0 -43
- package/dist/components/data/nested-list/nested-list-lazy-flat-rows.d.ts +0 -3
- package/dist/components/data/nested-list/nested-list-lazy-flat-rows.js +0 -34
- package/dist/components/data/nested-list/nested-list-row-estimates.d.ts +0 -9
- package/dist/components/data/nested-list/nested-list-row-estimates.js +0 -14
- package/dist/components/data/nested-list/nested-list-scroll-anchor.d.ts +0 -36
- package/dist/components/data/nested-list/nested-list-scroll-anchor.js +0 -47
- package/dist/components/data/nested-list/nested-list-virtual-drop.d.ts +0 -59
- package/dist/components/data/nested-list/nested-list-virtual-drop.js +0 -341
- package/dist/lib/hash/fnv1a128.d.ts +0 -16
- package/dist/lib/hash/fnv1a128.js +0 -21
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import { jsx as h, jsxs as T } from "react/jsx-runtime";
|
|
2
2
|
import * as c from "react";
|
|
3
|
-
import { Cross as
|
|
3
|
+
import { Cross as ot, CalendarMonth as rt } from "impact-nova-icons";
|
|
4
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
|
|
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
10
|
import { Tooltip as ce, TooltipTrigger as fe, TooltipContent as de } from "../../feedback/tooltip/tooltip.js";
|
|
11
|
-
import { useImpactNovaI18n as
|
|
12
|
-
import { getDateFnsLocale as
|
|
13
|
-
import { coerceDateRangeApply as
|
|
14
|
-
import { buildDateBoundsMatcher as
|
|
15
|
-
import { fiscalCalendarPassThrough as
|
|
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
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,
|
|
@@ -41,8 +41,8 @@ const Ct = c.forwardRef(
|
|
|
41
41
|
label: ye,
|
|
42
42
|
helperText: Re,
|
|
43
43
|
helperTextPosition: De = "absolute",
|
|
44
|
-
prefix:
|
|
45
|
-
prefixClick:
|
|
44
|
+
prefix: bt,
|
|
45
|
+
prefixClick: It,
|
|
46
46
|
isError: ke,
|
|
47
47
|
error: xe,
|
|
48
48
|
size: W,
|
|
@@ -56,13 +56,14 @@ const Ct = c.forwardRef(
|
|
|
56
56
|
fiscalConfig: Be,
|
|
57
57
|
showPresets: Se,
|
|
58
58
|
showPeriodBoundaries: Ne,
|
|
59
|
-
|
|
60
|
-
|
|
59
|
+
autoNavigateToAvailable: Ae,
|
|
60
|
+
comparison: Ve,
|
|
61
|
+
onComparisonChange: Oe,
|
|
61
62
|
mode: K = "range",
|
|
62
63
|
onRangesChange: j,
|
|
63
|
-
...
|
|
64
|
-
},
|
|
65
|
-
const { locale: X, t: b } =
|
|
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({
|
|
66
67
|
label: ye,
|
|
67
68
|
helperText: Re,
|
|
68
69
|
helperTextPosition: De,
|
|
@@ -71,18 +72,18 @@ const Ct = c.forwardRef(
|
|
|
71
72
|
disabled: d ?? void 0,
|
|
72
73
|
rootClassName: "w-full min-w-[240px]"
|
|
73
74
|
}), L = c.useRef(null), $ = c.useRef(null), F = c.useRef(null), N = c.useRef(null), q = c.useRef(null);
|
|
74
|
-
c.useImperativeHandle(
|
|
75
|
-
const l = pe(i), [p, m] = c.useState(!1), ee =
|
|
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(
|
|
76
77
|
I(i) ? i : void 0
|
|
77
|
-
), [
|
|
78
|
+
), [He, z] = c.useState(
|
|
78
79
|
I(i) ? i : void 0
|
|
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 }) : ""), [
|
|
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 }) : "";
|
|
80
81
|
c.useEffect(() => {
|
|
81
82
|
const e = pe(i);
|
|
82
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);
|
|
83
84
|
}, [i, r, n]);
|
|
84
|
-
const
|
|
85
|
-
(e) =>
|
|
85
|
+
const Je = c.useCallback(
|
|
86
|
+
(e) => it({
|
|
86
87
|
disabled: d ?? void 0,
|
|
87
88
|
showFooter: g,
|
|
88
89
|
containerRef: N,
|
|
@@ -98,18 +99,18 @@ const Ct = c.forwardRef(
|
|
|
98
99
|
}
|
|
99
100
|
oe.current = p;
|
|
100
101
|
}, [p, v, r, n, u?.from, l?.from]);
|
|
101
|
-
const
|
|
102
|
+
const Qe = (e) => {
|
|
102
103
|
if (I(e)) {
|
|
103
104
|
B(e);
|
|
104
105
|
const o = e[e.length - 1];
|
|
105
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));
|
|
106
107
|
return;
|
|
107
108
|
}
|
|
108
|
-
const t =
|
|
109
|
+
const t = Dt(e);
|
|
109
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));
|
|
110
111
|
}, S = c.useCallback((e, t) => {
|
|
111
|
-
const o =
|
|
112
|
-
return o.swapped && (o.from && k(y(o.from, r, { locale: n })), o.to && x(y(o.to, r, { locale: n })),
|
|
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 };
|
|
113
114
|
}, [r, n]), re = (e) => {
|
|
114
115
|
if (K === "multi-range") {
|
|
115
116
|
const s = I(e) ? e : te;
|
|
@@ -118,15 +119,15 @@ const Ct = c.forwardRef(
|
|
|
118
119
|
f?.(a), z(s), m(!1);
|
|
119
120
|
return;
|
|
120
121
|
}
|
|
121
|
-
let t =
|
|
122
|
+
let t = Rt(e, u);
|
|
122
123
|
t?.from && !t.to && (t = { from: t.from, to: t.from });
|
|
123
124
|
const o = S(t?.from, t?.to);
|
|
124
125
|
R({ from: o.from, to: o.to }), f?.({ from: o.from, to: o.to }), m(!1);
|
|
125
126
|
}, A = () => {
|
|
126
|
-
R(l), B(
|
|
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);
|
|
127
128
|
}, H = () => {
|
|
128
129
|
R(void 0), B(void 0), z(void 0), k(""), x(""), f?.(void 0), j?.(void 0), g || m(!1);
|
|
129
|
-
},
|
|
130
|
+
}, Ue = (e) => {
|
|
130
131
|
const t = ae(e.target.value, r, v);
|
|
131
132
|
if (k(t), t === "") {
|
|
132
133
|
const a = { from: void 0, to: u?.to };
|
|
@@ -138,7 +139,7 @@ const Ct = c.forwardRef(
|
|
|
138
139
|
const a = { from: o, to: u?.to };
|
|
139
140
|
R(a), w(o), g || f?.(a);
|
|
140
141
|
}
|
|
141
|
-
},
|
|
142
|
+
}, We = (e) => {
|
|
142
143
|
const t = ae(e.target.value, r, D);
|
|
143
144
|
if (x(t), t === "") {
|
|
144
145
|
const a = { from: u?.from, to: void 0 };
|
|
@@ -151,7 +152,7 @@ const Ct = c.forwardRef(
|
|
|
151
152
|
R(a), w(o), g || f?.(a);
|
|
152
153
|
}
|
|
153
154
|
}, ne = () => {
|
|
154
|
-
|
|
155
|
+
dt(
|
|
155
156
|
N,
|
|
156
157
|
q,
|
|
157
158
|
() => {
|
|
@@ -163,7 +164,7 @@ const Ct = c.forwardRef(
|
|
|
163
164
|
R(a), g || (a ? f?.(a) : !v && !D && f?.(void 0));
|
|
164
165
|
}
|
|
165
166
|
);
|
|
166
|
-
},
|
|
167
|
+
}, Xe = () => {
|
|
167
168
|
const e = O(v, r, C, n), t = O(D, r, P, n);
|
|
168
169
|
e.resetToCommitted ? k(C) : e.parsed && k(e.display), t.resetToCommitted ? x(P) : t.parsed && x(t.display);
|
|
169
170
|
let o = e.parsed ?? u?.from ?? l?.from, s = t.parsed ?? u?.to ?? l?.to;
|
|
@@ -177,19 +178,19 @@ const Ct = c.forwardRef(
|
|
|
177
178
|
}
|
|
178
179
|
if (!p) {
|
|
179
180
|
if (g) {
|
|
180
|
-
|
|
181
|
+
Xe();
|
|
181
182
|
return;
|
|
182
183
|
}
|
|
183
184
|
const e = O(v, r, C, n), t = O(D, r, P, n);
|
|
184
185
|
if (e.parsed || t.parsed) return;
|
|
185
186
|
E.current = !0, m(!0);
|
|
186
187
|
}
|
|
187
|
-
},
|
|
188
|
+
}, Ye = v !== C, Ze = D !== P, _e = ie(v, r, n), $e = ie(D, r, n), Fe = c.useCallback(() => {
|
|
188
189
|
const e = V(v, r, C, n), t = V(D, r, P, n);
|
|
189
190
|
let o = e.parsed ? e.parsed : e.resetToCommitted ? l?.from : u?.from, s = t.parsed ? t.parsed : t.resetToCommitted ? l?.to : u?.to;
|
|
190
191
|
o && s && ({ from: o, to: s } = S(o, s));
|
|
191
192
|
const a = o || s ? { from: o, to: s } : void 0;
|
|
192
|
-
return
|
|
193
|
+
return ct({
|
|
193
194
|
startInput: v,
|
|
194
195
|
endInput: D,
|
|
195
196
|
committedStart: C,
|
|
@@ -197,7 +198,7 @@ const Ct = c.forwardRef(
|
|
|
197
198
|
committedRange: i,
|
|
198
199
|
pendingRange: u,
|
|
199
200
|
computeEffectiveRange: () => a,
|
|
200
|
-
rangesEqual: (
|
|
201
|
+
rangesEqual: (et, tt) => Ct(et, tt)
|
|
201
202
|
});
|
|
202
203
|
}, [
|
|
203
204
|
v,
|
|
@@ -215,7 +216,7 @@ const Ct = c.forwardRef(
|
|
|
215
216
|
return c.useLayoutEffect(() => {
|
|
216
217
|
ee.current = {
|
|
217
218
|
onDismiss: A,
|
|
218
|
-
resolveFlash:
|
|
219
|
+
resolveFlash: Fe
|
|
219
220
|
};
|
|
220
221
|
}), /* @__PURE__ */ h(
|
|
221
222
|
"div",
|
|
@@ -223,14 +224,14 @@ const Ct = c.forwardRef(
|
|
|
223
224
|
ref: F,
|
|
224
225
|
"data-component": "date-range-picker",
|
|
225
226
|
"data-disabled": d || void 0,
|
|
226
|
-
children:
|
|
227
|
-
/* @__PURE__ */ T(
|
|
228
|
-
/* @__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(
|
|
229
230
|
"div",
|
|
230
231
|
{
|
|
231
232
|
ref: N,
|
|
232
233
|
"data-state": p ? "open" : "closed",
|
|
233
|
-
onPointerDown: (e) =>
|
|
234
|
+
onPointerDown: (e) => ft({
|
|
234
235
|
disabled: d,
|
|
235
236
|
event: e,
|
|
236
237
|
onOpen: () => m(!0),
|
|
@@ -254,7 +255,7 @@ const Ct = c.forwardRef(
|
|
|
254
255
|
ref: L,
|
|
255
256
|
type: "text",
|
|
256
257
|
value: v,
|
|
257
|
-
onChange:
|
|
258
|
+
onChange: Ue,
|
|
258
259
|
onBlur: ne,
|
|
259
260
|
onClick: () => !d && m(!0),
|
|
260
261
|
onKeyDown: (e) => {
|
|
@@ -266,9 +267,9 @@ const Ct = c.forwardRef(
|
|
|
266
267
|
"data-field": "start",
|
|
267
268
|
className: G(
|
|
268
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",
|
|
269
|
-
|
|
270
|
+
_e ? "text-destructive" : Ye ? "text-content-placeholder" : ""
|
|
270
271
|
),
|
|
271
|
-
...
|
|
272
|
+
...Me
|
|
272
273
|
}
|
|
273
274
|
),
|
|
274
275
|
/* @__PURE__ */ h(
|
|
@@ -277,7 +278,7 @@ const Ct = c.forwardRef(
|
|
|
277
278
|
ref: $,
|
|
278
279
|
type: "text",
|
|
279
280
|
value: D,
|
|
280
|
-
onChange:
|
|
281
|
+
onChange: We,
|
|
281
282
|
onBlur: ne,
|
|
282
283
|
onClick: () => !d && m(!0),
|
|
283
284
|
onKeyDown: (e) => {
|
|
@@ -289,7 +290,7 @@ const Ct = c.forwardRef(
|
|
|
289
290
|
"data-field": "end",
|
|
290
291
|
className: G(
|
|
291
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",
|
|
292
|
-
|
|
293
|
+
$e ? "text-destructive" : Ze ? "text-content-placeholder" : ""
|
|
293
294
|
)
|
|
294
295
|
}
|
|
295
296
|
)
|
|
@@ -309,7 +310,7 @@ const Ct = c.forwardRef(
|
|
|
309
310
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), H());
|
|
310
311
|
},
|
|
311
312
|
className: "inline-flex size-4 items-center justify-center bg-transparent border-none p-0 cursor-pointer",
|
|
312
|
-
children: /* @__PURE__ */ h(
|
|
313
|
+
children: /* @__PURE__ */ h(ot, { className: "size-3 hover:text-content text-content-icon" })
|
|
313
314
|
}
|
|
314
315
|
) }),
|
|
315
316
|
/* @__PURE__ */ h(de, { variant: "tertiary", side: "top", children: b("calendar.clear") })
|
|
@@ -319,7 +320,7 @@ const Ct = c.forwardRef(
|
|
|
319
320
|
e.stopPropagation(), d || m(!p);
|
|
320
321
|
}, onKeyDown: (e) => {
|
|
321
322
|
(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(
|
|
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" }) }) }),
|
|
323
324
|
/* @__PURE__ */ h(de, { variant: "tertiary", side: "top", children: b("datePicker.selectMonthRange") })
|
|
324
325
|
] })
|
|
325
326
|
] })
|
|
@@ -327,7 +328,7 @@ const Ct = c.forwardRef(
|
|
|
327
328
|
}
|
|
328
329
|
) }),
|
|
329
330
|
/* @__PURE__ */ h(
|
|
330
|
-
|
|
331
|
+
gt,
|
|
331
332
|
{
|
|
332
333
|
ref: q,
|
|
333
334
|
className: "w-auto p-0",
|
|
@@ -336,18 +337,18 @@ const Ct = c.forwardRef(
|
|
|
336
337
|
onOpenAutoFocus: (e) => {
|
|
337
338
|
E.current || e.preventDefault(), E.current = !1;
|
|
338
339
|
},
|
|
339
|
-
...
|
|
340
|
+
...ze,
|
|
340
341
|
children: /* @__PURE__ */ h(
|
|
341
|
-
|
|
342
|
+
vt,
|
|
342
343
|
{
|
|
343
344
|
mode: K,
|
|
344
345
|
selected: K === "multi-range" ? te : u,
|
|
345
|
-
footerFlashKey:
|
|
346
|
-
footerFlashTarget:
|
|
347
|
-
onSelect:
|
|
348
|
-
month:
|
|
346
|
+
footerFlashKey: Le,
|
|
347
|
+
footerFlashTarget: qe,
|
|
348
|
+
onSelect: Qe,
|
|
349
|
+
month: Ge,
|
|
349
350
|
onMonthChange: w,
|
|
350
|
-
disabled:
|
|
351
|
+
disabled: kt(me, ge),
|
|
351
352
|
startMonth: ve,
|
|
352
353
|
endMonth: he,
|
|
353
354
|
showFooter: g,
|
|
@@ -357,7 +358,7 @@ const Ct = c.forwardRef(
|
|
|
357
358
|
onRangesChange: B,
|
|
358
359
|
captionLayout: "dropdown",
|
|
359
360
|
...U !== void 0 ? { weekStartsOn: U } : {},
|
|
360
|
-
...
|
|
361
|
+
...xt({
|
|
361
362
|
calendarKind: be,
|
|
362
363
|
fiscalMode: Ie,
|
|
363
364
|
granularity: Ee,
|
|
@@ -366,8 +367,9 @@ const Ct = c.forwardRef(
|
|
|
366
367
|
fiscalConfig: Be,
|
|
367
368
|
showPresets: Se,
|
|
368
369
|
showPeriodBoundaries: Ne,
|
|
369
|
-
|
|
370
|
-
|
|
370
|
+
autoNavigateToAvailable: Ae,
|
|
371
|
+
comparison: Ve,
|
|
372
|
+
onComparisonChange: Oe
|
|
371
373
|
})
|
|
372
374
|
}
|
|
373
375
|
)
|
|
@@ -379,7 +381,7 @@ const Ct = c.forwardRef(
|
|
|
379
381
|
);
|
|
380
382
|
}
|
|
381
383
|
);
|
|
382
|
-
|
|
384
|
+
Pt.displayName = "DateRangePicker";
|
|
383
385
|
export {
|
|
384
|
-
|
|
386
|
+
Pt as DateRangePicker
|
|
385
387
|
};
|
|
@@ -2,6 +2,7 @@ import { FiscalPickerProps } from './date-picker.types';
|
|
|
2
2
|
export declare function fiscalCalendarPassThrough(props: FiscalPickerProps): {
|
|
3
3
|
showPresets: boolean | undefined;
|
|
4
4
|
showPeriodBoundaries: boolean | undefined;
|
|
5
|
+
autoNavigateToAvailable: boolean | undefined;
|
|
5
6
|
comparison: "prior-fy" | undefined;
|
|
6
7
|
onComparisonChange: ((value: import('../../..').YoYComparison | undefined) => void) | undefined;
|
|
7
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,
|
|
@@ -9,10 +9,11 @@ function n(a) {
|
|
|
9
9
|
...a.weekStartsOn !== void 0 ? { weekStartsOn: a.weekStartsOn } : {},
|
|
10
10
|
showPresets: a.showPresets,
|
|
11
11
|
showPeriodBoundaries: a.showPeriodBoundaries,
|
|
12
|
+
autoNavigateToAvailable: a.autoNavigateToAvailable,
|
|
12
13
|
comparison: a.comparison,
|
|
13
14
|
onComparisonChange: a.onComparisonChange
|
|
14
15
|
};
|
|
15
16
|
}
|
|
16
17
|
export {
|
|
17
|
-
|
|
18
|
+
e as fiscalCalendarPassThrough
|
|
18
19
|
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Reusable fiscal picker configs. Named by pattern, week start, and FY start month. */
|
|
2
|
+
export declare const FISCAL_454_SUNDAY_FEBRUARY: {
|
|
3
|
+
calendarKind: "fiscal";
|
|
4
|
+
fiscalMode: "advanced";
|
|
5
|
+
fiscalYearStartMonth: number;
|
|
6
|
+
fiscalMonthPattern: number[];
|
|
7
|
+
weekStartsOn: 0;
|
|
8
|
+
};
|
|
9
|
+
export declare const FISCAL_454_MONDAY_JANUARY: {
|
|
10
|
+
calendarKind: "fiscal";
|
|
11
|
+
fiscalMode: "advanced";
|
|
12
|
+
fiscalYearStartMonth: number;
|
|
13
|
+
fiscalMonthPattern: number[];
|
|
14
|
+
weekStartsOn: 1;
|
|
15
|
+
};
|
|
16
|
+
/** Selectability bound only — do not copy onto startMonth. */
|
|
17
|
+
export declare const MIN_DATE_2025_08_17: Date;
|