impact-nova 2.5.12 → 2.5.13
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 +1 -0
- package/dist/components/data/data-table/build-column-tree-from-grid.js +55 -50
- package/dist/components/data/data-table/column-picker-authority.d.ts +34 -0
- package/dist/components/data/data-table/column-picker-authority.js +116 -0
- package/dist/components/data/data-table/column-picker-drop-validation.d.ts +7 -0
- package/dist/components/data/data-table/column-picker-drop-validation.js +37 -0
- package/dist/components/data/data-table/data-table-column-apply.d.ts +2 -0
- package/dist/components/data/data-table/data-table-column-apply.js +84 -73
- package/dist/components/data/data-table/data-table-column-list-tree-apply.d.ts +10 -0
- package/dist/components/data/data-table/data-table-column-list-tree-apply.js +79 -0
- package/dist/components/data/data-table/data-table-column-list.js +94 -64
- package/dist/components/data/data-table/data-table-column-tree-cache.d.ts +12 -6
- package/dist/components/data/data-table/data-table-column-tree-cache.js +250 -131
- package/dist/components/data/data-table/data-table-flat-column-virtual-rows.d.ts +26 -0
- package/dist/components/data/data-table/data-table-flat-column-virtual-rows.js +195 -0
- package/dist/components/data/data-table/data-table-picker-column-eligibility.d.ts +1 -0
- package/dist/components/data/data-table/data-table-picker-column-eligibility.js +7 -0
- package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.d.ts +5 -0
- package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.js +28 -11
- package/dist/components/data/data-table/reconcile-column-tree-from-grid.d.ts +12 -0
- package/dist/components/data/data-table/reconcile-column-tree-from-grid.js +12 -0
- package/dist/components/data/data-table/use-data-table-column-list-sync.d.ts +10 -0
- package/dist/components/data/data-table/use-data-table-column-list-sync.js +250 -196
- package/dist/components/data/nested-list/components/NestedListContent.d.ts +10 -2
- package/dist/components/data/nested-list/components/NestedListContent.js +253 -138
- package/dist/components/data/nested-list/components/SortableItem.d.ts +2 -1
- package/dist/components/data/nested-list/components/SortableItem.js +62 -60
- package/dist/components/data/nested-list/hooks/useNestedListDragDrop.d.ts +10 -20
- package/dist/components/data/nested-list/hooks/useNestedListDragDrop.js +44 -233
- package/dist/components/data/nested-list/hooks/useVirtualNestedListDrag.d.ts +24 -0
- package/dist/components/data/nested-list/hooks/useVirtualNestedListDrag.js +128 -0
- package/dist/components/data/nested-list/nested-list-constants.d.ts +4 -1
- package/dist/components/data/nested-list/nested-list-constants.js +10 -4
- package/dist/components/data/nested-list/nested-list-display-utils.d.ts +11 -0
- package/dist/components/data/nested-list/nested-list-display-utils.js +74 -0
- package/dist/components/data/nested-list/nested-list-drop-engine.d.ts +31 -0
- package/dist/components/data/nested-list/nested-list-drop-engine.js +209 -0
- package/dist/components/data/nested-list/nested-list-flat-virtual-handlers.d.ts +26 -0
- package/dist/components/data/nested-list/nested-list-flat-virtual-handlers.js +67 -0
- package/dist/components/data/nested-list/nested-list-item-tree-mutations.d.ts +4 -0
- package/dist/components/data/nested-list/nested-list-item-tree-mutations.js +43 -0
- package/dist/components/data/nested-list/nested-list-lazy-flat-rows.d.ts +3 -0
- package/dist/components/data/nested-list/nested-list-lazy-flat-rows.js +34 -0
- package/dist/components/data/nested-list/nested-list-row-estimates.d.ts +9 -0
- package/dist/components/data/nested-list/nested-list-row-estimates.js +14 -0
- package/dist/components/data/nested-list/nested-list-scroll-anchor.d.ts +36 -0
- package/dist/components/data/nested-list/nested-list-scroll-anchor.js +47 -0
- package/dist/components/data/nested-list/nested-list-virtual-drop.d.ts +59 -0
- package/dist/components/data/nested-list/nested-list-virtual-drop.js +341 -0
- package/dist/components/data/nested-list/nested-list.js +322 -336
- package/dist/components/data/nested-list/nested-list.types.d.ts +17 -0
- package/dist/components/data-display/calendar/calendar-apply-validation.d.ts +0 -2
- package/dist/components/data-display/calendar/calendar-apply-validation.js +67 -64
- package/dist/components/data-display/calendar/calendar-config.js +1 -1
- package/dist/components/data-display/calendar/calendar-day-picker-components.d.ts +2 -4
- package/dist/components/data-display/calendar/calendar-day-picker-components.js +164 -234
- package/dist/components/data-display/calendar/calendar-day-picker-view.js +76 -77
- package/dist/components/data-display/calendar/calendar-fiscal-period-nav.d.ts +0 -6
- package/dist/components/data-display/calendar/calendar-fiscal-period-nav.js +18 -34
- package/dist/components/data-display/calendar/calendar-footer.js +21 -21
- package/dist/components/data-display/calendar/calendar-month-picker-panel.js +49 -50
- package/dist/components/data-display/calendar/calendar-month-utils.d.ts +0 -5
- package/dist/components/data-display/calendar/calendar-month-utils.js +64 -85
- package/dist/components/data-display/calendar/calendar-padding-week.utils.d.ts +1 -3
- package/dist/components/data-display/calendar/calendar-padding-week.utils.js +5 -7
- package/dist/components/data-display/calendar/calendar-period-cell.js +46 -45
- package/dist/components/data-display/calendar/calendar-quarter-panes.js +31 -33
- package/dist/components/data-display/calendar/calendar-selection-appearance.d.ts +0 -10
- package/dist/components/data-display/calendar/calendar-selection-appearance.js +39 -53
- package/dist/components/data-display/calendar/calendar-selection.d.ts +0 -25
- package/dist/components/data-display/calendar/calendar-selection.js +23 -52
- package/dist/components/data-display/calendar/calendar-week-number-cell.d.ts +1 -2
- package/dist/components/data-display/calendar/calendar-week-number-cell.js +45 -59
- package/dist/components/data-display/calendar/calendar-week-utils.d.ts +3 -13
- package/dist/components/data-display/calendar/calendar-week-utils.js +50 -59
- package/dist/components/data-display/calendar/calendar-year-panes.d.ts +0 -3
- package/dist/components/data-display/calendar/calendar-year-panes.js +49 -53
- package/dist/components/data-display/calendar/calendar.js +143 -146
- package/dist/components/data-display/calendar/calendar.types.d.ts +0 -5
- package/dist/components/data-display/calendar/use-calendar-day-picker-config.d.ts +1 -2
- package/dist/components/data-display/calendar/use-calendar-day-picker-config.js +74 -79
- package/dist/components/data-display/calendar/use-calendar-state.d.ts +1 -3
- package/dist/components/data-display/calendar/use-calendar-state.js +325 -403
- package/dist/components/forms/date-picker/date-picker.js +58 -60
- package/dist/components/forms/date-picker/date-picker.types.d.ts +0 -5
- package/dist/components/forms/date-picker/date-range-picker.js +64 -66
- package/dist/components/forms/date-picker/fiscal-pass-through.d.ts +0 -1
- package/dist/components/forms/date-picker/fiscal-pass-through.js +2 -3
- package/dist/components/forms/date-picker/month-picker.js +59 -61
- package/dist/components/forms/date-picker/month-range-picker.js +61 -63
- package/dist/components/forms/date-picker/multi-date-picker.js +49 -51
- package/dist/components/forms/date-picker/multi-month-picker.js +47 -49
- package/dist/components/forms/date-picker/multi-quarter-picker.js +47 -51
- package/dist/components/forms/date-picker/multi-week-picker.js +51 -53
- package/dist/components/forms/date-picker/multi-year-picker.js +49 -53
- package/dist/components/forms/date-picker/quarter-picker.js +47 -51
- package/dist/components/forms/date-picker/quarter-range-picker.js +46 -50
- package/dist/components/forms/date-picker/week-picker.js +66 -68
- package/dist/components/forms/date-picker/week-range-picker.js +80 -82
- package/dist/components/forms/date-picker/year-picker.js +48 -52
- package/dist/components/forms/date-picker/year-range-picker.js +48 -52
- package/dist/form-react/Fields/DateInputField.js +50 -51
- package/dist/form-react/Fields/DateRangeField.js +13 -14
- package/dist/form-react/Fields/MonthRangeField.js +28 -29
- package/dist/form-react/Fields/MultiMonthPickerField.js +12 -13
- package/dist/form-react/Fields/MultiWeekPickerField.js +27 -35
- package/dist/form-react/Fields/WeekRangePicker.js +32 -33
- package/dist/form-react/types/fields.types.d.ts +0 -14
- package/dist/impact-nova-components.css +6 -13
- package/dist/impact-nova.css +1 -1
- package/dist/lib/fiscal-calendar/week-selection.js +2 -2
- package/dist/lib/hash/fnv1a128.d.ts +16 -0
- package/dist/lib/hash/fnv1a128.js +21 -0
- 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-display/calendar/calendar-available-view.d.ts +0 -27
- package/dist/components/data-display/calendar/calendar-available-view.js +0 -85
- package/dist/components/data-display/calendar/calendar-fiscal-day-cell.d.ts +0 -9
- package/dist/components/data-display/calendar/calendar-fiscal-day-cell.js +0 -45
- package/dist/components/data-display/calendar/calendar-injected-week-row.d.ts +0 -5
- package/dist/components/data-display/calendar/calendar-injected-week-row.js +0 -92
- package/dist/components/data-display/calendar/calendar-leading-week.utils.d.ts +0 -16
- package/dist/components/data-display/calendar/calendar-leading-week.utils.js +0 -51
- package/dist/components/data-display/calendar/calendar-orphan-week.d.ts +0 -23
- package/dist/components/forms/date-picker/fiscal-picker-fixtures.d.ts +0 -17
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import { jsx as u, jsxs as W } from "react/jsx-runtime";
|
|
2
2
|
import * as c from "react";
|
|
3
|
-
import { Cross as
|
|
3
|
+
import { Cross as Fe, CalendarMonth as et } from "impact-nova-icons";
|
|
4
4
|
import { format as g } from "date-fns";
|
|
5
5
|
import { cn as Q } from "../../../lib/utils.js";
|
|
6
|
-
import { usePickerDismissActionsRef as
|
|
7
|
-
import { useFieldChrome as
|
|
8
|
-
import { Popover as
|
|
9
|
-
import { Calendar as
|
|
10
|
-
import { buildDateBoundsMatcher as
|
|
6
|
+
import { usePickerDismissActionsRef as tt, usePickerFooterDismissNudge as rt, createRangePickerOpenChangeHandler as ot, parseDateInput as U, normalizeOrderedRange as nt, compareDates as st, flashRangeReorder as it, isDateInputInvalid as ce, resolveRangeFieldBlur as L, resolveRangePickerDismissFlash as ct, handlePickerEscapeKeyDown as le, handlePickerSurfacePointerDown as lt, deferRangeInputBlur as at, maskDateInput as ae, resolveDateInputOnBlur as j } from "./date-input-behavior.js";
|
|
7
|
+
import { useFieldChrome as ft } from "../../../lib/primitives/use-field-chrome.js";
|
|
8
|
+
import { Popover as dt, PopoverAnchor as pt, PopoverContent as mt } from "../../feedback/popover/popover.js";
|
|
9
|
+
import { Calendar as ut } from "../../data-display/calendar/calendar.js";
|
|
10
|
+
import { buildDateBoundsMatcher as gt } from "../../../lib/date-bounds-matcher.js";
|
|
11
11
|
import { Tooltip as fe, TooltipTrigger as de, TooltipContent as pe } from "../../feedback/tooltip/tooltip.js";
|
|
12
|
-
import { resolveWeekSelection as
|
|
13
|
-
import { useImpactNovaI18n as
|
|
14
|
-
import { getDateFnsLocale as
|
|
15
|
-
import { coerceWeekRangeApply as
|
|
16
|
-
import { fiscalCalendarPassThrough as
|
|
12
|
+
import { resolveWeekSelection as kt } from "../../../lib/fiscal-calendar/week-selection.js";
|
|
13
|
+
import { useImpactNovaI18n as Rt } from "../../../i18n/use-impact-nova-i18n.js";
|
|
14
|
+
import { getDateFnsLocale as ht } from "../../../i18n/getDateFnsLocale.js";
|
|
15
|
+
import { coerceWeekRangeApply as Dt, isWeekRangeSelection as yt } from "./calendar-selection-adapters.js";
|
|
16
|
+
import { fiscalCalendarPassThrough as vt } from "./fiscal-pass-through.js";
|
|
17
17
|
const x = (t) => t?.from ? t.to ? t.to.endDate : t.from.endDate : void 0, S = (t) => t?.from ? { from: t.from, to: t.to } : void 0;
|
|
18
18
|
function me(t, l) {
|
|
19
19
|
return !t && !l ? !0 : !t || !l ? !1 : t.startDate.getTime() === l.startDate.getTime();
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function xt(t, l) {
|
|
22
22
|
return !t && !l ? !0 : !t || !l ? !1 : me(t.from, l.from) && me(t.to, l.to);
|
|
23
23
|
}
|
|
24
|
-
const
|
|
24
|
+
const Ct = c.forwardRef(
|
|
25
25
|
({
|
|
26
26
|
value: t,
|
|
27
27
|
onChange: l,
|
|
@@ -41,41 +41,40 @@ const bt = c.forwardRef(
|
|
|
41
41
|
weekStartsOn: M = 1,
|
|
42
42
|
showPresets: ye,
|
|
43
43
|
showPeriodBoundaries: ve,
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
onComparisonChange: be,
|
|
44
|
+
comparison: xe,
|
|
45
|
+
onComparisonChange: Ce,
|
|
47
46
|
disabled: d,
|
|
48
|
-
className:
|
|
49
|
-
error:
|
|
50
|
-
isError:
|
|
47
|
+
className: be,
|
|
48
|
+
error: we,
|
|
49
|
+
isError: Ie,
|
|
51
50
|
size: X,
|
|
52
|
-
label:
|
|
53
|
-
helperText:
|
|
54
|
-
helperTextPosition:
|
|
55
|
-
required:
|
|
56
|
-
prefix:
|
|
57
|
-
prefixClick:
|
|
58
|
-
...
|
|
59
|
-
},
|
|
60
|
-
const Z =
|
|
61
|
-
label:
|
|
62
|
-
helperText:
|
|
63
|
-
helperTextPosition:
|
|
51
|
+
label: Te,
|
|
52
|
+
helperText: Ee,
|
|
53
|
+
helperTextPosition: Pe = "absolute",
|
|
54
|
+
required: We,
|
|
55
|
+
prefix: bt,
|
|
56
|
+
prefixClick: wt,
|
|
57
|
+
...Se
|
|
58
|
+
}, Be) => {
|
|
59
|
+
const Z = we ?? Ie, Ne = ft({
|
|
60
|
+
label: Te,
|
|
61
|
+
helperText: Ee,
|
|
62
|
+
helperTextPosition: Pe,
|
|
64
63
|
error: Z,
|
|
65
|
-
required:
|
|
64
|
+
required: We,
|
|
66
65
|
disabled: d ?? void 0,
|
|
67
66
|
rootClassName: "w-full min-w-[240px]"
|
|
68
|
-
}), { locale: _, t: T } =
|
|
69
|
-
c.useImperativeHandle(
|
|
70
|
-
const [p, R] = c.useState(!1), ee =
|
|
67
|
+
}), { locale: _, t: T } = Rt(), s = c.useMemo(() => ht(_), [_]), $ = ue ?? T("datePicker.selectWeekRange"), V = N === "fiscal", G = c.useRef(null), Y = c.useRef(null), F = c.useRef(null), A = c.useRef(null), J = c.useRef(null);
|
|
68
|
+
c.useImperativeHandle(Be, () => G.current);
|
|
69
|
+
const [p, R] = c.useState(!1), ee = tt(), { footerFlashKey: Ve, footerFlashTarget: Ae, popoverHandlers: Oe } = rt(k, p, ee, F), E = c.useRef(!1), [a, h] = c.useState(t), [m, D] = c.useState(t?.from ? g(t.from.startDate, n, { locale: s }) : ""), [y, v] = c.useState(x(t) ? g(x(t), n, { locale: s }) : ""), [Le, P] = c.useState(t?.from?.startDate || /* @__PURE__ */ new Date()), je = t?.from?.startDate.getTime(), qe = x(t)?.getTime(), te = c.useRef(t);
|
|
71
70
|
c.useEffect(() => {
|
|
72
71
|
te.current = t;
|
|
73
72
|
}), c.useEffect(() => {
|
|
74
73
|
const e = te.current;
|
|
75
74
|
D(e?.from ? g(e.from.startDate, n, { locale: s }) : ""), v(x(e) ? g(x(e), n, { locale: s }) : ""), h(e);
|
|
76
|
-
}, [
|
|
77
|
-
const
|
|
78
|
-
(e) =>
|
|
75
|
+
}, [je, qe, n, s]);
|
|
76
|
+
const ze = c.useCallback(
|
|
77
|
+
(e) => ot({
|
|
79
78
|
disabled: d ?? void 0,
|
|
80
79
|
showFooter: k,
|
|
81
80
|
containerRef: A,
|
|
@@ -91,11 +90,11 @@ const bt = c.forwardRef(
|
|
|
91
90
|
}
|
|
92
91
|
re.current = p;
|
|
93
92
|
}, [p, m, n, s, a?.from, t?.from, V]);
|
|
94
|
-
const
|
|
95
|
-
const r =
|
|
93
|
+
const He = (e) => {
|
|
94
|
+
const r = yt(e) ? e : void 0;
|
|
96
95
|
h(r), r?.from ? (D(g(r.from.startDate, n, { locale: s })), v(g(x(r), n, { locale: s }))) : (D(""), v("")), !k && r?.from && r?.to && r.from.startDate.getTime() !== r.to.startDate.getTime() && (l?.(r), R(!1));
|
|
97
96
|
}, C = c.useCallback(
|
|
98
|
-
(e) =>
|
|
97
|
+
(e) => kt(e, {
|
|
99
98
|
calendarKind: N,
|
|
100
99
|
fiscalMode: q,
|
|
101
100
|
granularity: z,
|
|
@@ -112,20 +111,20 @@ const bt = c.forwardRef(
|
|
|
112
111
|
M
|
|
113
112
|
]
|
|
114
113
|
), B = c.useCallback((e, r) => {
|
|
115
|
-
const o =
|
|
114
|
+
const o = nt(
|
|
116
115
|
e,
|
|
117
116
|
r,
|
|
118
|
-
(i, f) =>
|
|
117
|
+
(i, f) => st(i.startDate, f.startDate)
|
|
119
118
|
);
|
|
120
|
-
return o.swapped && (o.from && D(g(o.from.startDate, n, { locale: s })), o.to && v(g(x({ from: o.from, to: o.to }), n, { locale: s })),
|
|
119
|
+
return o.swapped && (o.from && D(g(o.from.startDate, n, { locale: s })), o.to && v(g(x({ from: o.from, to: o.to }), n, { locale: s })), it(A.current)), { from: o.from, to: o.to };
|
|
121
120
|
}, [n, s]), oe = (e) => {
|
|
122
|
-
const r =
|
|
121
|
+
const r = Dt(e, S(a)), o = B(r?.from, r?.to), i = o.from ? { from: o.from, to: o.to } : void 0;
|
|
123
122
|
h(i), l?.(i), R(!1);
|
|
124
123
|
}, O = () => {
|
|
125
124
|
h(t), D(t?.from ? g(t.from.startDate, n, { locale: s }) : ""), v(x(t) ? g(x(t), n, { locale: s }) : ""), R(!1);
|
|
126
125
|
}, ne = () => {
|
|
127
126
|
h(void 0), D(""), v(""), l?.(void 0), k || R(!1);
|
|
128
|
-
},
|
|
127
|
+
}, Ke = (e) => {
|
|
129
128
|
const r = ae(e.target.value, n, m);
|
|
130
129
|
if (D(r), r === "") {
|
|
131
130
|
const f = { to: a?.to };
|
|
@@ -137,7 +136,7 @@ const bt = c.forwardRef(
|
|
|
137
136
|
const I = { from: C(o), to: a?.to };
|
|
138
137
|
h(I), a?.to && v(g(x(I), n, { locale: s })), V || P(o), k || l?.(S(I));
|
|
139
138
|
}
|
|
140
|
-
},
|
|
139
|
+
}, Me = (e) => {
|
|
141
140
|
const r = ae(e.target.value, n, y);
|
|
142
141
|
if (v(r), r === "") {
|
|
143
142
|
const f = { from: a?.from };
|
|
@@ -149,7 +148,7 @@ const bt = c.forwardRef(
|
|
|
149
148
|
const f = C(o), I = { from: a?.from, to: f };
|
|
150
149
|
h(I), a?.from && D(g(a.from.startDate, n, { locale: s })), V || P(o), k || l?.(S(I));
|
|
151
150
|
}
|
|
152
|
-
},
|
|
151
|
+
}, Ge = () => {
|
|
153
152
|
const e = j(m, n, b, s), r = j(y, n, w, s);
|
|
154
153
|
e.resetToCommitted ? D(b) : e.parsed && D(e.display), r.resetToCommitted ? v(w) : r.parsed && v(r.display);
|
|
155
154
|
let o = e.parsed ? C(e.parsed) : a?.from, i = r.parsed ? C(r.parsed) : a?.to;
|
|
@@ -157,7 +156,7 @@ const bt = c.forwardRef(
|
|
|
157
156
|
const f = o ? { from: o, to: i } : void 0;
|
|
158
157
|
f ? (h(f), l?.(f)) : !m && !y && (h(void 0), l?.(void 0));
|
|
159
158
|
}, se = () => {
|
|
160
|
-
|
|
159
|
+
at(
|
|
161
160
|
A,
|
|
162
161
|
J,
|
|
163
162
|
() => {
|
|
@@ -176,19 +175,19 @@ const bt = c.forwardRef(
|
|
|
176
175
|
}
|
|
177
176
|
if (!p) {
|
|
178
177
|
if (k) {
|
|
179
|
-
|
|
178
|
+
Ge();
|
|
180
179
|
return;
|
|
181
180
|
}
|
|
182
181
|
const e = j(m, n, b, s), r = j(y, n, w, s);
|
|
183
182
|
if (e.parsed || r.parsed) return;
|
|
184
183
|
E.current = !0, R(!0);
|
|
185
184
|
}
|
|
186
|
-
}, b = t?.from ? g(t.from.startDate, n, { locale: s }) : "", w = x(t) ? g(x(t), n, { locale: s }) : "",
|
|
185
|
+
}, b = t?.from ? g(t.from.startDate, n, { locale: s }) : "", w = x(t) ? g(x(t), n, { locale: s }) : "", Je = b !== m, Qe = w !== y, Ue = ce(m, n, s), Xe = ce(y, n, s), Ze = "Start Date", _e = "End Date", $e = c.useCallback(() => {
|
|
187
186
|
const e = L(m, n, b, s), r = L(y, n, w, s);
|
|
188
187
|
let o = e.parsed ? C(e.parsed) : e.resetToCommitted ? t?.from : a?.from, i = r.parsed ? C(r.parsed) : r.resetToCommitted ? t?.to : a?.to;
|
|
189
188
|
o && i && ({ from: o, to: i } = B(o, i));
|
|
190
189
|
const f = o || i ? { from: o, to: i } : void 0;
|
|
191
|
-
return
|
|
190
|
+
return ct({
|
|
192
191
|
startInput: m,
|
|
193
192
|
endInput: y,
|
|
194
193
|
committedStart: b,
|
|
@@ -196,7 +195,7 @@ const bt = c.forwardRef(
|
|
|
196
195
|
committedRange: t,
|
|
197
196
|
pendingRange: S(a),
|
|
198
197
|
computeEffectiveRange: () => f,
|
|
199
|
-
rangesEqual: (I,
|
|
198
|
+
rangesEqual: (I, Ye) => xt(I, Ye)
|
|
200
199
|
});
|
|
201
200
|
}, [
|
|
202
201
|
m,
|
|
@@ -213,7 +212,7 @@ const bt = c.forwardRef(
|
|
|
213
212
|
return c.useLayoutEffect(() => {
|
|
214
213
|
ee.current = {
|
|
215
214
|
onDismiss: O,
|
|
216
|
-
resolveFlash:
|
|
215
|
+
resolveFlash: $e
|
|
217
216
|
};
|
|
218
217
|
}), /* @__PURE__ */ u(
|
|
219
218
|
"div",
|
|
@@ -221,14 +220,14 @@ const bt = c.forwardRef(
|
|
|
221
220
|
ref: F,
|
|
222
221
|
"data-component": "week-range-picker",
|
|
223
222
|
"data-disabled": d || void 0,
|
|
224
|
-
children:
|
|
225
|
-
/* @__PURE__ */ W(
|
|
226
|
-
/* @__PURE__ */ u(
|
|
223
|
+
children: Ne.wrapControl(
|
|
224
|
+
/* @__PURE__ */ W(dt, { open: d ? !1 : p, onOpenChange: ze, children: [
|
|
225
|
+
/* @__PURE__ */ u(pt, { asChild: !0, children: /* @__PURE__ */ W(
|
|
227
226
|
"div",
|
|
228
227
|
{
|
|
229
228
|
ref: A,
|
|
230
229
|
"data-state": p ? "open" : "closed",
|
|
231
|
-
onPointerDown: (e) =>
|
|
230
|
+
onPointerDown: (e) => lt({
|
|
232
231
|
disabled: d,
|
|
233
232
|
event: e,
|
|
234
233
|
onOpen: () => R(!0),
|
|
@@ -242,7 +241,7 @@ const bt = c.forwardRef(
|
|
|
242
241
|
X === "sm" ? "h-6" : X === "md" ? "h-[28px]" : "h-8",
|
|
243
242
|
d && "pointer-events-none opacity-100 bg-disabled-surface border-stroke text-disabled-foreground hover:border-stroke",
|
|
244
243
|
"cursor-pointer",
|
|
245
|
-
|
|
244
|
+
be
|
|
246
245
|
),
|
|
247
246
|
children: [
|
|
248
247
|
/* @__PURE__ */ W("div", { className: "flex items-center gap-4 flex-1 min-w-0", children: [
|
|
@@ -252,7 +251,7 @@ const bt = c.forwardRef(
|
|
|
252
251
|
ref: G,
|
|
253
252
|
type: "text",
|
|
254
253
|
value: m,
|
|
255
|
-
onChange:
|
|
254
|
+
onChange: Ke,
|
|
256
255
|
onBlur: se,
|
|
257
256
|
onClick: () => !d && R(!0),
|
|
258
257
|
onKeyDown: (e) => {
|
|
@@ -260,13 +259,13 @@ const bt = c.forwardRef(
|
|
|
260
259
|
},
|
|
261
260
|
placeholder: p ? n : $,
|
|
262
261
|
disabled: !!d,
|
|
263
|
-
"aria-label":
|
|
262
|
+
"aria-label": Ze,
|
|
264
263
|
"data-field": "start",
|
|
265
264
|
className: Q(
|
|
266
265
|
"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",
|
|
267
|
-
|
|
266
|
+
Ue ? "text-destructive" : Je ? "text-content-placeholder" : ""
|
|
268
267
|
),
|
|
269
|
-
...
|
|
268
|
+
...Se
|
|
270
269
|
}
|
|
271
270
|
),
|
|
272
271
|
/* @__PURE__ */ u(
|
|
@@ -275,7 +274,7 @@ const bt = c.forwardRef(
|
|
|
275
274
|
ref: Y,
|
|
276
275
|
type: "text",
|
|
277
276
|
value: y,
|
|
278
|
-
onChange:
|
|
277
|
+
onChange: Me,
|
|
279
278
|
onBlur: se,
|
|
280
279
|
onClick: () => !d && R(!0),
|
|
281
280
|
onKeyDown: (e) => {
|
|
@@ -283,11 +282,11 @@ const bt = c.forwardRef(
|
|
|
283
282
|
},
|
|
284
283
|
placeholder: p ? n : $,
|
|
285
284
|
disabled: !!d,
|
|
286
|
-
"aria-label":
|
|
285
|
+
"aria-label": _e,
|
|
287
286
|
"data-field": "end",
|
|
288
287
|
className: Q(
|
|
289
288
|
"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",
|
|
290
|
-
|
|
289
|
+
Xe ? "text-destructive" : Qe ? "text-content-placeholder" : ""
|
|
291
290
|
)
|
|
292
291
|
}
|
|
293
292
|
)
|
|
@@ -304,7 +303,7 @@ const bt = c.forwardRef(
|
|
|
304
303
|
e.stopPropagation(), ne();
|
|
305
304
|
},
|
|
306
305
|
className: "inline-flex size-4 items-center justify-center bg-transparent border-none p-0 cursor-pointer",
|
|
307
|
-
children: /* @__PURE__ */ u(
|
|
306
|
+
children: /* @__PURE__ */ u(Fe, { className: "size-3 hover:text-content text-content-icon" })
|
|
308
307
|
}
|
|
309
308
|
) }),
|
|
310
309
|
/* @__PURE__ */ u(pe, { variant: "tertiary", side: "top", children: T("calendar.clear") })
|
|
@@ -314,7 +313,7 @@ const bt = c.forwardRef(
|
|
|
314
313
|
e.stopPropagation(), d || R(!p);
|
|
315
314
|
}, onKeyDown: (e) => {
|
|
316
315
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), d || (E.current = !0, R(!p)));
|
|
317
|
-
}, className: "inline-flex items-center justify-center bg-transparent border-none p-0 cursor-pointer", children: /* @__PURE__ */ u(
|
|
316
|
+
}, className: "inline-flex items-center justify-center bg-transparent border-none p-0 cursor-pointer", children: /* @__PURE__ */ u(et, { className: "h-4 w-4 text-secondary-foreground" }) }) }),
|
|
318
317
|
/* @__PURE__ */ u(pe, { variant: "tertiary", side: "top", children: T("datePicker.selectWeekRange") })
|
|
319
318
|
] })
|
|
320
319
|
] })
|
|
@@ -322,7 +321,7 @@ const bt = c.forwardRef(
|
|
|
322
321
|
}
|
|
323
322
|
) }),
|
|
324
323
|
/* @__PURE__ */ u(
|
|
325
|
-
|
|
324
|
+
mt,
|
|
326
325
|
{
|
|
327
326
|
ref: J,
|
|
328
327
|
className: "w-auto p-0",
|
|
@@ -331,23 +330,23 @@ const bt = c.forwardRef(
|
|
|
331
330
|
onOpenAutoFocus: (e) => {
|
|
332
331
|
E.current || e.preventDefault(), E.current = !1;
|
|
333
332
|
},
|
|
334
|
-
...
|
|
333
|
+
...Oe,
|
|
335
334
|
children: /* @__PURE__ */ u(
|
|
336
|
-
|
|
335
|
+
ut,
|
|
337
336
|
{
|
|
338
337
|
pickerType: "week",
|
|
339
338
|
weekMode: "range",
|
|
340
339
|
selectedWeeks: S(a),
|
|
341
|
-
footerFlashKey:
|
|
342
|
-
footerFlashTarget:
|
|
343
|
-
onWeekSelect:
|
|
344
|
-
month:
|
|
340
|
+
footerFlashKey: Ve,
|
|
341
|
+
footerFlashTarget: Ae,
|
|
342
|
+
onWeekSelect: He,
|
|
343
|
+
month: Le,
|
|
345
344
|
onMonthChange: P,
|
|
346
|
-
disabled:
|
|
345
|
+
disabled: gt(ge, ke),
|
|
347
346
|
startMonth: Re,
|
|
348
347
|
endMonth: he,
|
|
349
348
|
showFooter: k,
|
|
350
|
-
...
|
|
349
|
+
...vt({
|
|
351
350
|
calendarKind: N,
|
|
352
351
|
fiscalMode: q,
|
|
353
352
|
granularity: z,
|
|
@@ -357,9 +356,8 @@ const bt = c.forwardRef(
|
|
|
357
356
|
weekStartsOn: M,
|
|
358
357
|
showPresets: ye,
|
|
359
358
|
showPeriodBoundaries: ve,
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
onComparisonChange: be
|
|
359
|
+
comparison: xe,
|
|
360
|
+
onComparisonChange: Ce
|
|
363
361
|
}),
|
|
364
362
|
onApply: oe,
|
|
365
363
|
onCancel: O,
|
|
@@ -375,7 +373,7 @@ const bt = c.forwardRef(
|
|
|
375
373
|
);
|
|
376
374
|
}
|
|
377
375
|
);
|
|
378
|
-
|
|
376
|
+
Ct.displayName = "WeekRangePicker";
|
|
379
377
|
export {
|
|
380
|
-
|
|
378
|
+
Ct as WeekRangePicker
|
|
381
379
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsx as r, jsxs as y } from "react/jsx-runtime";
|
|
2
2
|
import * as t from "react";
|
|
3
|
-
import { Cross as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { Input as
|
|
6
|
-
import { Calendar as
|
|
3
|
+
import { Cross as X, CalendarMonth as Z } from "impact-nova-icons";
|
|
4
|
+
import { cn as _ } from "../../../lib/utils.js";
|
|
5
|
+
import { Input as $ } from "../input/input.js";
|
|
6
|
+
import { Calendar as ee } from "../../data-display/calendar/calendar.js";
|
|
7
7
|
import { Tooltip as x, TooltipTrigger as R, TooltipContent as D } from "../../feedback/tooltip/tooltip.js";
|
|
8
|
-
import { useImpactNovaI18n as
|
|
9
|
-
import { buildDateBoundsMatcher as
|
|
10
|
-
import { fiscalCalendarPassThrough as
|
|
11
|
-
import { DatePickerShell as
|
|
12
|
-
import { usePickerDismissActionsRef as
|
|
13
|
-
import { formatYearInput as
|
|
14
|
-
import { viewMonthFromYear as
|
|
15
|
-
const
|
|
8
|
+
import { useImpactNovaI18n as re } from "../../../i18n/use-impact-nova-i18n.js";
|
|
9
|
+
import { buildDateBoundsMatcher as te } from "../../../lib/date-bounds-matcher.js";
|
|
10
|
+
import { fiscalCalendarPassThrough as ne } from "./fiscal-pass-through.js";
|
|
11
|
+
import { DatePickerShell as oe } from "./date-picker-shell.js";
|
|
12
|
+
import { usePickerDismissActionsRef as ae, usePickerFooterDismissNudge as ie, handleReadonlyPickerKeyDown as ce, handlePickerSurfacePointerDown as se } from "./date-input-behavior.js";
|
|
13
|
+
import { formatYearInput as le } from "../../data-display/calendar/calendar-fiscal-labels.js";
|
|
14
|
+
import { viewMonthFromYear as pe } from "../../data-display/calendar/calendar-year-utils.js";
|
|
15
|
+
const fe = t.forwardRef(
|
|
16
16
|
({
|
|
17
17
|
value: n,
|
|
18
18
|
onChange: d,
|
|
@@ -30,34 +30,30 @@ const me = t.forwardRef(
|
|
|
30
30
|
fiscalMonthPattern: M,
|
|
31
31
|
fiscalYearStartMonth: K,
|
|
32
32
|
fiscalConfig: k,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const
|
|
41
|
-
t.useImperativeHandle(V, () => m.current);
|
|
42
|
-
const [i, c] = t.useState(!1), u = t.useRef(!1), g = ce(), { footerFlashKey: q, footerFlashTarget: G, popoverHandlers: J } = se(s, i, g, P), [C, l] = t.useState(n), [Q, U] = t.useState(de(n));
|
|
33
|
+
showPresets: j,
|
|
34
|
+
showPeriodBoundaries: F,
|
|
35
|
+
showIntervalCaption: L = !1,
|
|
36
|
+
...z
|
|
37
|
+
}, E) => {
|
|
38
|
+
const { t: a } = re(), H = Y ?? a("datePicker.selectYear"), m = t.useRef(null), P = t.useRef(null);
|
|
39
|
+
t.useImperativeHandle(E, () => m.current);
|
|
40
|
+
const [i, c] = t.useState(!1), u = t.useRef(!1), g = ae(), { footerFlashKey: V, footerFlashTarget: B, popoverHandlers: q } = ie(s, i, g, P), [C, l] = t.useState(n), [G, J] = t.useState(pe(n));
|
|
43
41
|
t.useEffect(() => {
|
|
44
42
|
i || l(n);
|
|
45
43
|
}, [i, n]);
|
|
46
|
-
const p = t.useCallback(() => c(!1), []),
|
|
44
|
+
const p = t.useCallback(() => c(!1), []), Q = ne({
|
|
47
45
|
calendarKind: O,
|
|
48
46
|
fiscalMode: T,
|
|
49
47
|
granularity: w,
|
|
50
48
|
fiscalMonthPattern: M,
|
|
51
49
|
fiscalYearStartMonth: K,
|
|
52
50
|
fiscalConfig: k,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
autoNavigateToAvailable: z
|
|
57
|
-
}), X = (e) => {
|
|
51
|
+
showPresets: j,
|
|
52
|
+
showPeriodBoundaries: F
|
|
53
|
+
}), U = (e) => {
|
|
58
54
|
const f = e && !Array.isArray(e) && !("from" in e) && !("to" in e) ? e : void 0;
|
|
59
55
|
l(f), s || (d?.(f), p());
|
|
60
|
-
},
|
|
56
|
+
}, W = () => {
|
|
61
57
|
d?.(C), p();
|
|
62
58
|
}, h = () => {
|
|
63
59
|
l(n), p();
|
|
@@ -67,7 +63,7 @@ const me = t.forwardRef(
|
|
|
67
63
|
return t.useLayoutEffect(() => {
|
|
68
64
|
g.current = { onDismiss: h, resolveFlash: () => "cancel" };
|
|
69
65
|
}), /* @__PURE__ */ r(
|
|
70
|
-
|
|
66
|
+
oe,
|
|
71
67
|
{
|
|
72
68
|
open: i,
|
|
73
69
|
disabled: o,
|
|
@@ -78,26 +74,26 @@ const me = t.forwardRef(
|
|
|
78
74
|
onOpenAutoFocus: (e) => {
|
|
79
75
|
u.current || e.preventDefault(), u.current = !1;
|
|
80
76
|
},
|
|
81
|
-
popoverHandlers:
|
|
77
|
+
popoverHandlers: q,
|
|
82
78
|
trigger: /* @__PURE__ */ r(
|
|
83
79
|
"div",
|
|
84
80
|
{
|
|
85
81
|
ref: P,
|
|
86
82
|
"data-component": "year-picker",
|
|
87
83
|
"data-state": i ? "open" : "closed",
|
|
88
|
-
onPointerDown: (e) =>
|
|
84
|
+
onPointerDown: (e) => se({
|
|
89
85
|
disabled: o,
|
|
90
86
|
event: e,
|
|
91
87
|
onOpen: () => c(!0),
|
|
92
88
|
focusField: () => m.current?.focus()
|
|
93
89
|
}),
|
|
94
90
|
children: /* @__PURE__ */ r(
|
|
95
|
-
|
|
91
|
+
$,
|
|
96
92
|
{
|
|
97
93
|
ref: m,
|
|
98
|
-
value: n ?
|
|
94
|
+
value: n ? le(n, k?.fyLabel ?? "fy-long") : "",
|
|
99
95
|
readOnly: !0,
|
|
100
|
-
onKeyDown: (e) =>
|
|
96
|
+
onKeyDown: (e) => ce(e, {
|
|
101
97
|
disabled: o,
|
|
102
98
|
open: i,
|
|
103
99
|
onOpen: () => c(!0),
|
|
@@ -107,10 +103,10 @@ const me = t.forwardRef(
|
|
|
107
103
|
}
|
|
108
104
|
}),
|
|
109
105
|
onClick: () => !o && c(!0),
|
|
110
|
-
placeholder:
|
|
106
|
+
placeholder: H,
|
|
111
107
|
disabled: o,
|
|
112
108
|
"data-form-control": "input",
|
|
113
|
-
className:
|
|
109
|
+
className: _("cursor-pointer", I),
|
|
114
110
|
suffix: /* @__PURE__ */ y("div", { className: "flex items-center gap-1", children: [
|
|
115
111
|
n && !o ? /* @__PURE__ */ y(x, { children: [
|
|
116
112
|
/* @__PURE__ */ r(R, { asChild: !0, children: /* @__PURE__ */ r(
|
|
@@ -123,7 +119,7 @@ const me = t.forwardRef(
|
|
|
123
119
|
e.stopPropagation(), b();
|
|
124
120
|
},
|
|
125
121
|
className: "inline-flex size-4 items-center justify-center border-none bg-transparent p-0",
|
|
126
|
-
children: /* @__PURE__ */ r(
|
|
122
|
+
children: /* @__PURE__ */ r(X, { className: "size-3 hover:text-content" })
|
|
127
123
|
}
|
|
128
124
|
) }),
|
|
129
125
|
/* @__PURE__ */ r(D, { variant: "tertiary", side: "top", children: a("calendar.clear") })
|
|
@@ -140,43 +136,43 @@ const me = t.forwardRef(
|
|
|
140
136
|
e.stopPropagation(), o || c((f) => !f);
|
|
141
137
|
},
|
|
142
138
|
className: "inline-flex items-center justify-center border-none bg-transparent p-0",
|
|
143
|
-
children: /* @__PURE__ */ r(
|
|
139
|
+
children: /* @__PURE__ */ r(Z, { className: "h-4 w-4 text-secondary-foreground" })
|
|
144
140
|
}
|
|
145
141
|
) }),
|
|
146
142
|
/* @__PURE__ */ r(D, { variant: "tertiary", side: "top", children: a("datePicker.selectYear") })
|
|
147
143
|
] })
|
|
148
144
|
] }),
|
|
149
|
-
...
|
|
145
|
+
...z
|
|
150
146
|
}
|
|
151
147
|
)
|
|
152
148
|
}
|
|
153
149
|
),
|
|
154
150
|
children: /* @__PURE__ */ r(
|
|
155
|
-
|
|
151
|
+
ee,
|
|
156
152
|
{
|
|
157
153
|
pickerType: "year",
|
|
158
154
|
selectedYear: C,
|
|
159
|
-
footerFlashKey:
|
|
160
|
-
footerFlashTarget:
|
|
161
|
-
onYearSelect:
|
|
162
|
-
month:
|
|
163
|
-
onMonthChange:
|
|
164
|
-
disabled:
|
|
155
|
+
footerFlashKey: V,
|
|
156
|
+
footerFlashTarget: B,
|
|
157
|
+
onYearSelect: U,
|
|
158
|
+
month: G,
|
|
159
|
+
onMonthChange: J,
|
|
160
|
+
disabled: te(v, N),
|
|
165
161
|
startMonth: S,
|
|
166
162
|
endMonth: A,
|
|
167
163
|
showFooter: s,
|
|
168
|
-
onApply:
|
|
164
|
+
onApply: W,
|
|
169
165
|
onCancel: h,
|
|
170
166
|
onClear: b,
|
|
171
|
-
showIntervalCaption:
|
|
172
|
-
...
|
|
167
|
+
showIntervalCaption: L,
|
|
168
|
+
...Q
|
|
173
169
|
}
|
|
174
170
|
)
|
|
175
171
|
}
|
|
176
172
|
);
|
|
177
173
|
}
|
|
178
174
|
);
|
|
179
|
-
|
|
175
|
+
fe.displayName = "YearPicker";
|
|
180
176
|
export {
|
|
181
|
-
|
|
177
|
+
fe as YearPicker
|
|
182
178
|
};
|