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,22 +1,22 @@
|
|
|
1
1
|
import { jsxs as u, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import * as n from "react";
|
|
3
|
-
import { Cross as
|
|
3
|
+
import { Cross as re, CalendarMonth as ne } from "impact-nova-icons";
|
|
4
4
|
import { format as b } from "date-fns";
|
|
5
|
-
import { cn as
|
|
6
|
-
import { Input as
|
|
7
|
-
import { Popover as
|
|
8
|
-
import { Calendar as
|
|
5
|
+
import { cn as oe } from "../../../lib/utils.js";
|
|
6
|
+
import { Input as se } from "../input/input.js";
|
|
7
|
+
import { Popover as ae, PopoverAnchor as ie, PopoverContent as ce } from "../../feedback/popover/popover.js";
|
|
8
|
+
import { Calendar as le } from "../../data-display/calendar/calendar.js";
|
|
9
9
|
import { Tooltip as x, TooltipTrigger as A, TooltipContent as M } from "../../feedback/tooltip/tooltip.js";
|
|
10
|
-
import { useImpactNovaI18n as
|
|
11
|
-
import { getDateFnsLocale as
|
|
12
|
-
import { coerceWeekArrayApply as
|
|
13
|
-
import { usePickerDismissActionsRef as
|
|
14
|
-
import { buildDateBoundsMatcher as
|
|
15
|
-
import { fiscalCalendarPassThrough as
|
|
16
|
-
const
|
|
10
|
+
import { useImpactNovaI18n as pe } from "../../../i18n/use-impact-nova-i18n.js";
|
|
11
|
+
import { getDateFnsLocale as de } from "../../../i18n/getDateFnsLocale.js";
|
|
12
|
+
import { coerceWeekArrayApply as fe, coerceWeekArray as me } from "./calendar-selection-adapters.js";
|
|
13
|
+
import { usePickerDismissActionsRef as ue, usePickerFooterDismissNudge as he, handlePickerSurfacePointerDown as ye } from "./date-input-behavior.js";
|
|
14
|
+
import { buildDateBoundsMatcher as ke } from "../../../lib/date-bounds-matcher.js";
|
|
15
|
+
import { fiscalCalendarPassThrough as ge } from "./fiscal-pass-through.js";
|
|
16
|
+
const Pe = (t, a = "MM/dd/yyyy", i) => {
|
|
17
17
|
const h = b(t.startDate, a, i ? { locale: i } : {}), y = b(t.endDate, a, i ? { locale: i } : {});
|
|
18
18
|
return `${h} - ${y}`;
|
|
19
|
-
},
|
|
19
|
+
}, Ce = n.forwardRef(
|
|
20
20
|
({
|
|
21
21
|
value: t,
|
|
22
22
|
onChange: a,
|
|
@@ -36,63 +36,62 @@ const Ce = (t, a = "MM/dd/yyyy", i) => {
|
|
|
36
36
|
weekStartsOn: j = 1,
|
|
37
37
|
showPresets: F,
|
|
38
38
|
showPeriodBoundaries: E,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
onComparisonChange: z,
|
|
39
|
+
comparison: K,
|
|
40
|
+
onComparisonChange: $,
|
|
42
41
|
disabled: o,
|
|
43
|
-
className:
|
|
44
|
-
...
|
|
45
|
-
},
|
|
46
|
-
const { locale: P, t: c } =
|
|
42
|
+
className: z,
|
|
43
|
+
...V
|
|
44
|
+
}, q) => {
|
|
45
|
+
const { locale: P, t: c } = pe(), B = n.useMemo(() => de(P), [P]), H = h ?? c("datePicker.selectWeeks"), [l, s] = n.useState(!1), k = n.useRef(!1), g = n.useRef(null), C = ue(), { footerFlashKey: G, footerFlashTarget: J, popoverHandlers: Q } = he(d, l, C, g), [f, m] = n.useState(t);
|
|
47
46
|
n.useEffect(() => {
|
|
48
47
|
m(t);
|
|
49
48
|
}, [l, t]);
|
|
50
|
-
const
|
|
51
|
-
const p =
|
|
49
|
+
const U = (e) => {
|
|
50
|
+
const p = me(e);
|
|
52
51
|
m(p), d || a?.(p);
|
|
53
|
-
},
|
|
54
|
-
const p =
|
|
52
|
+
}, X = (e) => {
|
|
53
|
+
const p = fe(e, f);
|
|
55
54
|
a?.(p), s(!1);
|
|
56
55
|
}, D = () => {
|
|
57
56
|
m(t), s(!1);
|
|
58
57
|
}, W = () => {
|
|
59
58
|
m(void 0), a?.(void 0), d || s(!1);
|
|
60
|
-
},
|
|
59
|
+
}, Y = t && t.length > 0 ? t.length === 1 ? Pe(t[0], i, B) : `${t.length} weeks selected` : "", Z = (e) => {
|
|
61
60
|
o || !e && d || s(e);
|
|
62
|
-
},
|
|
61
|
+
}, _ = n.useCallback(() => {
|
|
63
62
|
const e = f?.length ?? 0, p = t?.length ?? 0;
|
|
64
63
|
return e === p && (f ?? []).every(
|
|
65
|
-
(
|
|
64
|
+
(ee, te) => ee.startDate.getTime() === t?.[te]?.startDate.getTime()
|
|
66
65
|
) ? "dismiss" : e > 0 ? "apply" : "cancel";
|
|
67
66
|
}, [f, t]);
|
|
68
67
|
return n.useLayoutEffect(() => {
|
|
69
68
|
C.current = {
|
|
70
69
|
onDismiss: D,
|
|
71
|
-
resolveFlash:
|
|
70
|
+
resolveFlash: _
|
|
72
71
|
};
|
|
73
|
-
}), /* @__PURE__ */ u(
|
|
74
|
-
/* @__PURE__ */ r(
|
|
72
|
+
}), /* @__PURE__ */ u(ae, { open: o ? !1 : l, onOpenChange: Z, children: [
|
|
73
|
+
/* @__PURE__ */ r(ie, { asChild: !0, children: /* @__PURE__ */ r(
|
|
75
74
|
"div",
|
|
76
75
|
{
|
|
77
76
|
ref: g,
|
|
78
|
-
onPointerDown: (e) =>
|
|
77
|
+
onPointerDown: (e) => ye({
|
|
79
78
|
disabled: o,
|
|
80
79
|
event: e,
|
|
81
80
|
onOpen: () => s(!0),
|
|
82
81
|
focusField: () => g.current?.querySelector("input")?.focus()
|
|
83
82
|
}),
|
|
84
83
|
children: /* @__PURE__ */ r(
|
|
85
|
-
|
|
84
|
+
se,
|
|
86
85
|
{
|
|
87
|
-
ref:
|
|
88
|
-
value:
|
|
89
|
-
placeholder:
|
|
86
|
+
ref: q,
|
|
87
|
+
value: Y,
|
|
88
|
+
placeholder: H,
|
|
90
89
|
readOnly: !0,
|
|
91
90
|
disabled: o,
|
|
92
91
|
onClick: () => {
|
|
93
92
|
!o && !l && s(!0);
|
|
94
93
|
},
|
|
95
|
-
className:
|
|
94
|
+
className: oe("cursor-pointer", z),
|
|
96
95
|
suffix: /* @__PURE__ */ u("div", { className: "flex items-center gap-1", children: [
|
|
97
96
|
t && t.length > 0 && !o && /* @__PURE__ */ u(x, { children: [
|
|
98
97
|
/* @__PURE__ */ r(A, { asChild: !0, children: /* @__PURE__ */ r(
|
|
@@ -105,7 +104,7 @@ const Ce = (t, a = "MM/dd/yyyy", i) => {
|
|
|
105
104
|
e.stopPropagation(), W();
|
|
106
105
|
},
|
|
107
106
|
className: "inline-flex size-4 items-center justify-center bg-transparent border-none p-0 cursor-pointer",
|
|
108
|
-
children: /* @__PURE__ */ r(
|
|
107
|
+
children: /* @__PURE__ */ r(re, { className: "size-3 hover:text-content" })
|
|
109
108
|
}
|
|
110
109
|
) }),
|
|
111
110
|
/* @__PURE__ */ r(M, { variant: "tertiary", side: "top", children: c("calendar.clear") })
|
|
@@ -125,19 +124,19 @@ const Ce = (t, a = "MM/dd/yyyy", i) => {
|
|
|
125
124
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), o || (k.current = !0, s(!l)));
|
|
126
125
|
},
|
|
127
126
|
className: "inline-flex items-center justify-center bg-transparent border-none p-0 cursor-pointer",
|
|
128
|
-
children: /* @__PURE__ */ r(
|
|
127
|
+
children: /* @__PURE__ */ r(ne, { className: "h-4 w-4 text-secondary-foreground" })
|
|
129
128
|
}
|
|
130
129
|
) }),
|
|
131
130
|
/* @__PURE__ */ r(M, { variant: "tertiary", side: "top", children: c("datePicker.selectWeeks") })
|
|
132
131
|
] })
|
|
133
132
|
] }),
|
|
134
|
-
...
|
|
133
|
+
...V
|
|
135
134
|
}
|
|
136
135
|
)
|
|
137
136
|
}
|
|
138
137
|
) }),
|
|
139
138
|
/* @__PURE__ */ r(
|
|
140
|
-
|
|
139
|
+
ce,
|
|
141
140
|
{
|
|
142
141
|
className: "w-auto p-0",
|
|
143
142
|
align: "start",
|
|
@@ -145,21 +144,21 @@ const Ce = (t, a = "MM/dd/yyyy", i) => {
|
|
|
145
144
|
onOpenAutoFocus: (e) => {
|
|
146
145
|
k.current || e.preventDefault(), k.current = !1;
|
|
147
146
|
},
|
|
148
|
-
...
|
|
147
|
+
...Q,
|
|
149
148
|
children: /* @__PURE__ */ r(
|
|
150
|
-
|
|
149
|
+
le,
|
|
151
150
|
{
|
|
152
151
|
pickerType: "week",
|
|
153
152
|
weekMode: "multiple",
|
|
154
153
|
selectedWeeks: f,
|
|
155
|
-
footerFlashKey:
|
|
156
|
-
footerFlashTarget:
|
|
157
|
-
onWeekSelect:
|
|
158
|
-
disabled:
|
|
154
|
+
footerFlashKey: G,
|
|
155
|
+
footerFlashTarget: J,
|
|
156
|
+
onWeekSelect: U,
|
|
157
|
+
disabled: ke(y, N),
|
|
159
158
|
startMonth: T,
|
|
160
159
|
endMonth: R,
|
|
161
160
|
showFooter: d,
|
|
162
|
-
...
|
|
161
|
+
...ge({
|
|
163
162
|
calendarKind: S,
|
|
164
163
|
fiscalMode: v,
|
|
165
164
|
granularity: w,
|
|
@@ -169,11 +168,10 @@ const Ce = (t, a = "MM/dd/yyyy", i) => {
|
|
|
169
168
|
weekStartsOn: j,
|
|
170
169
|
showPresets: F,
|
|
171
170
|
showPeriodBoundaries: E,
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
onComparisonChange: z
|
|
171
|
+
comparison: K,
|
|
172
|
+
onComparisonChange: $
|
|
175
173
|
}),
|
|
176
|
-
onApply:
|
|
174
|
+
onApply: X,
|
|
177
175
|
onCancel: D,
|
|
178
176
|
onClear: W,
|
|
179
177
|
captionLayout: "dropdown"
|
|
@@ -184,7 +182,7 @@ const Ce = (t, a = "MM/dd/yyyy", i) => {
|
|
|
184
182
|
] });
|
|
185
183
|
}
|
|
186
184
|
);
|
|
187
|
-
|
|
185
|
+
Ce.displayName = "MultiWeekPicker";
|
|
188
186
|
export {
|
|
189
|
-
|
|
187
|
+
Ce as MultiWeekPicker
|
|
190
188
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsx as r, jsxs as y } from "react/jsx-runtime";
|
|
2
2
|
import * as n from "react";
|
|
3
|
-
import { Cross as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { Input as
|
|
6
|
-
import { Calendar as
|
|
3
|
+
import { Cross as _, CalendarMonth as $ } from "impact-nova-icons";
|
|
4
|
+
import { cn as ee } from "../../../lib/utils.js";
|
|
5
|
+
import { Input as te } from "../input/input.js";
|
|
6
|
+
import { Calendar as re } from "../../data-display/calendar/calendar.js";
|
|
7
7
|
import { Tooltip as M, TooltipTrigger as x, TooltipContent as R } 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 ne } from "../../../i18n/use-impact-nova-i18n.js";
|
|
9
|
+
import { buildDateBoundsMatcher as oe } from "../../../lib/date-bounds-matcher.js";
|
|
10
|
+
import { fiscalCalendarPassThrough as ae } from "./fiscal-pass-through.js";
|
|
11
|
+
import { DatePickerShell as ie } from "./date-picker-shell.js";
|
|
12
|
+
import { usePickerDismissActionsRef as se, usePickerFooterDismissNudge as ce, handleReadonlyPickerKeyDown as le, handlePickerSurfacePointerDown as pe } from "./date-input-behavior.js";
|
|
13
|
+
import { formatYearInput as fe } from "../../data-display/calendar/calendar-fiscal-labels.js";
|
|
14
|
+
import { viewMonthFromYear as de } from "../../data-display/calendar/calendar-year-utils.js";
|
|
15
|
+
const ue = n.forwardRef(
|
|
16
16
|
({
|
|
17
17
|
value: t,
|
|
18
18
|
onChange: f,
|
|
@@ -30,34 +30,30 @@ const he = n.forwardRef(
|
|
|
30
30
|
fiscalMonthPattern: v,
|
|
31
31
|
fiscalYearStartMonth: K,
|
|
32
32
|
fiscalConfig: g,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const
|
|
41
|
-
n.useImperativeHandle(V, () => d.current);
|
|
42
|
-
const [i, s] = n.useState(!1), u = n.useRef(!1), P = le(), { footerFlashKey: G, footerFlashTarget: J, popoverHandlers: Q } = pe(c, i, P, k), [C, l] = n.useState(t), [U, W] = n.useState(me(t?.[0]));
|
|
33
|
+
showPresets: j,
|
|
34
|
+
showPeriodBoundaries: F,
|
|
35
|
+
showIntervalCaption: L = !1,
|
|
36
|
+
...z
|
|
37
|
+
}, E) => {
|
|
38
|
+
const { t: a } = ne(), H = D ?? a("datePicker.selectMultipleYears"), V = g?.fyLabel ?? "fy-long", d = n.useRef(null), k = n.useRef(null);
|
|
39
|
+
n.useImperativeHandle(E, () => d.current);
|
|
40
|
+
const [i, s] = n.useState(!1), u = n.useRef(!1), P = se(), { footerFlashKey: B, footerFlashTarget: q, popoverHandlers: G } = ce(c, i, P, k), [C, l] = n.useState(t), [J, Q] = n.useState(de(t?.[0]));
|
|
43
41
|
n.useEffect(() => {
|
|
44
42
|
i || l(t);
|
|
45
43
|
}, [i, t]);
|
|
46
|
-
const m = n.useCallback(() => s(!1), []),
|
|
44
|
+
const m = n.useCallback(() => s(!1), []), U = ae({
|
|
47
45
|
calendarKind: O,
|
|
48
46
|
fiscalMode: T,
|
|
49
47
|
granularity: w,
|
|
50
48
|
fiscalMonthPattern: v,
|
|
51
49
|
fiscalYearStartMonth: K,
|
|
52
50
|
fiscalConfig: g,
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
autoNavigateToAvailable: z
|
|
57
|
-
}), Z = (e) => {
|
|
51
|
+
showPresets: j,
|
|
52
|
+
showPeriodBoundaries: F
|
|
53
|
+
}), W = (e) => {
|
|
58
54
|
const p = Array.isArray(e) && e.length > 0 ? e : void 0;
|
|
59
55
|
l(p), c || f?.(p);
|
|
60
|
-
},
|
|
56
|
+
}, X = () => {
|
|
61
57
|
f?.(C), m();
|
|
62
58
|
}, h = () => {
|
|
63
59
|
l(t), m();
|
|
@@ -67,9 +63,9 @@ const he = n.forwardRef(
|
|
|
67
63
|
n.useLayoutEffect(() => {
|
|
68
64
|
P.current = { onDismiss: h, resolveFlash: () => "cancel" };
|
|
69
65
|
});
|
|
70
|
-
const
|
|
66
|
+
const Z = t && t.length > 0 ? t.length === 1 ? fe(t[0], V) : a("datePicker.yearsSelected", { count: t.length }) : "";
|
|
71
67
|
return /* @__PURE__ */ r(
|
|
72
|
-
|
|
68
|
+
ie,
|
|
73
69
|
{
|
|
74
70
|
open: i,
|
|
75
71
|
disabled: o,
|
|
@@ -80,26 +76,26 @@ const he = n.forwardRef(
|
|
|
80
76
|
onOpenAutoFocus: (e) => {
|
|
81
77
|
u.current || e.preventDefault(), u.current = !1;
|
|
82
78
|
},
|
|
83
|
-
popoverHandlers:
|
|
79
|
+
popoverHandlers: G,
|
|
84
80
|
trigger: /* @__PURE__ */ r(
|
|
85
81
|
"div",
|
|
86
82
|
{
|
|
87
83
|
ref: k,
|
|
88
84
|
"data-component": "multi-year-picker",
|
|
89
85
|
"data-state": i ? "open" : "closed",
|
|
90
|
-
onPointerDown: (e) =>
|
|
86
|
+
onPointerDown: (e) => pe({
|
|
91
87
|
disabled: o,
|
|
92
88
|
event: e,
|
|
93
89
|
onOpen: () => s(!0),
|
|
94
90
|
focusField: () => d.current?.focus()
|
|
95
91
|
}),
|
|
96
92
|
children: /* @__PURE__ */ r(
|
|
97
|
-
|
|
93
|
+
te,
|
|
98
94
|
{
|
|
99
95
|
ref: d,
|
|
100
|
-
value:
|
|
96
|
+
value: Z,
|
|
101
97
|
readOnly: !0,
|
|
102
|
-
onKeyDown: (e) =>
|
|
98
|
+
onKeyDown: (e) => le(e, {
|
|
103
99
|
disabled: o,
|
|
104
100
|
open: i,
|
|
105
101
|
onOpen: () => s(!0),
|
|
@@ -109,10 +105,10 @@ const he = n.forwardRef(
|
|
|
109
105
|
}
|
|
110
106
|
}),
|
|
111
107
|
onClick: () => !o && s(!0),
|
|
112
|
-
placeholder:
|
|
108
|
+
placeholder: H,
|
|
113
109
|
disabled: o,
|
|
114
110
|
"data-form-control": "input",
|
|
115
|
-
className:
|
|
111
|
+
className: ee("cursor-pointer", I),
|
|
116
112
|
suffix: /* @__PURE__ */ y("div", { className: "flex items-center gap-1", children: [
|
|
117
113
|
t && t.length > 0 && !o ? /* @__PURE__ */ y(M, { children: [
|
|
118
114
|
/* @__PURE__ */ r(x, { asChild: !0, children: /* @__PURE__ */ r(
|
|
@@ -125,7 +121,7 @@ const he = n.forwardRef(
|
|
|
125
121
|
e.stopPropagation(), b();
|
|
126
122
|
},
|
|
127
123
|
className: "inline-flex size-4 items-center justify-center border-none bg-transparent p-0",
|
|
128
|
-
children: /* @__PURE__ */ r(
|
|
124
|
+
children: /* @__PURE__ */ r(_, { className: "size-3 hover:text-content" })
|
|
129
125
|
}
|
|
130
126
|
) }),
|
|
131
127
|
/* @__PURE__ */ r(R, { variant: "tertiary", side: "top", children: a("calendar.clear") })
|
|
@@ -142,44 +138,44 @@ const he = n.forwardRef(
|
|
|
142
138
|
e.stopPropagation(), o || s((p) => !p);
|
|
143
139
|
},
|
|
144
140
|
className: "inline-flex items-center justify-center border-none bg-transparent p-0",
|
|
145
|
-
children: /* @__PURE__ */ r(
|
|
141
|
+
children: /* @__PURE__ */ r($, { className: "h-4 w-4 text-secondary-foreground" })
|
|
146
142
|
}
|
|
147
143
|
) }),
|
|
148
144
|
/* @__PURE__ */ r(R, { variant: "tertiary", side: "top", children: a("datePicker.selectMultipleYears") })
|
|
149
145
|
] })
|
|
150
146
|
] }),
|
|
151
|
-
...
|
|
147
|
+
...z
|
|
152
148
|
}
|
|
153
149
|
)
|
|
154
150
|
}
|
|
155
151
|
),
|
|
156
152
|
children: /* @__PURE__ */ r(
|
|
157
|
-
|
|
153
|
+
re,
|
|
158
154
|
{
|
|
159
155
|
pickerType: "year",
|
|
160
156
|
yearMode: "multiple",
|
|
161
157
|
selectedYear: C,
|
|
162
|
-
footerFlashKey:
|
|
163
|
-
footerFlashTarget:
|
|
164
|
-
onYearSelect:
|
|
165
|
-
month:
|
|
166
|
-
onMonthChange:
|
|
167
|
-
disabled:
|
|
158
|
+
footerFlashKey: B,
|
|
159
|
+
footerFlashTarget: q,
|
|
160
|
+
onYearSelect: W,
|
|
161
|
+
month: J,
|
|
162
|
+
onMonthChange: Q,
|
|
163
|
+
disabled: oe(Y, N),
|
|
168
164
|
startMonth: S,
|
|
169
165
|
endMonth: A,
|
|
170
166
|
showFooter: c,
|
|
171
|
-
onApply:
|
|
167
|
+
onApply: X,
|
|
172
168
|
onCancel: h,
|
|
173
169
|
onClear: b,
|
|
174
|
-
showIntervalCaption:
|
|
175
|
-
...
|
|
170
|
+
showIntervalCaption: L,
|
|
171
|
+
...U
|
|
176
172
|
}
|
|
177
173
|
)
|
|
178
174
|
}
|
|
179
175
|
);
|
|
180
176
|
}
|
|
181
177
|
);
|
|
182
|
-
|
|
178
|
+
ue.displayName = "MultiYearPicker";
|
|
183
179
|
export {
|
|
184
|
-
|
|
180
|
+
ue as MultiYearPicker
|
|
185
181
|
};
|
|
@@ -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 Z, CalendarMonth as _ } from "impact-nova-icons";
|
|
4
|
+
import { cn as $ } from "../../../lib/utils.js";
|
|
5
|
+
import { Input as q } from "../input/input.js";
|
|
6
|
+
import { Calendar as ee } from "../../data-display/calendar/calendar.js";
|
|
7
7
|
import { Tooltip as x, TooltipTrigger as b, TooltipContent as R } 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 { formatQuarterInput as
|
|
14
|
-
import { viewMonthFromQuarter 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 { formatQuarterInput as le } from "../../data-display/calendar/calendar-fiscal-labels.js";
|
|
14
|
+
import { viewMonthFromQuarter as pe } from "../../data-display/calendar/calendar-quarter-utils.js";
|
|
15
|
+
const fe = t.forwardRef(
|
|
16
16
|
({
|
|
17
17
|
value: n,
|
|
18
18
|
onChange: u,
|
|
@@ -30,33 +30,29 @@ const de = t.forwardRef(
|
|
|
30
30
|
fiscalMonthPattern: w,
|
|
31
31
|
fiscalYearStartMonth: M,
|
|
32
32
|
fiscalConfig: K,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
t.useImperativeHandle(L, () => d.current);
|
|
41
|
-
const [i, c] = t.useState(!1), P = ce(), { footerFlashKey: B, footerFlashTarget: G, popoverHandlers: J } = se(s, i, P, k), m = t.useRef(!1), [g, l] = t.useState(n), [U, W] = t.useState(ue(n));
|
|
33
|
+
showPresets: j,
|
|
34
|
+
showPeriodBoundaries: F,
|
|
35
|
+
...z
|
|
36
|
+
}, E) => {
|
|
37
|
+
const { t: a } = re(), H = D ?? a("datePicker.selectQuarter"), d = t.useRef(null), k = t.useRef(null);
|
|
38
|
+
t.useImperativeHandle(E, () => d.current);
|
|
39
|
+
const [i, c] = t.useState(!1), P = ae(), { footerFlashKey: L, footerFlashTarget: V, popoverHandlers: B } = ie(s, i, P, k), m = t.useRef(!1), [g, l] = t.useState(n), [G, J] = t.useState(pe(n));
|
|
42
40
|
t.useEffect(() => {
|
|
43
41
|
i || l(n);
|
|
44
42
|
}, [i, n]);
|
|
45
|
-
const p = t.useCallback(() => c(!1), []),
|
|
43
|
+
const p = t.useCallback(() => c(!1), []), U = ne({
|
|
46
44
|
calendarKind: I,
|
|
47
45
|
fiscalMode: O,
|
|
48
46
|
granularity: T,
|
|
49
47
|
fiscalMonthPattern: w,
|
|
50
48
|
fiscalYearStartMonth: M,
|
|
51
49
|
fiscalConfig: K,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
autoNavigateToAvailable: E
|
|
56
|
-
}), Y = (e) => {
|
|
50
|
+
showPresets: j,
|
|
51
|
+
showPeriodBoundaries: F
|
|
52
|
+
}), W = (e) => {
|
|
57
53
|
const f = e && !Array.isArray(e) && !("from" in e) && !("to" in e) ? e : void 0;
|
|
58
54
|
l(f), s || (u?.(f), p());
|
|
59
|
-
},
|
|
55
|
+
}, X = () => {
|
|
60
56
|
u?.(g), p();
|
|
61
57
|
}, h = () => {
|
|
62
58
|
l(n), p();
|
|
@@ -66,9 +62,9 @@ const de = t.forwardRef(
|
|
|
66
62
|
t.useLayoutEffect(() => {
|
|
67
63
|
P.current = { onDismiss: h, resolveFlash: () => "cancel" };
|
|
68
64
|
});
|
|
69
|
-
const
|
|
65
|
+
const Y = n ? le(n) : "";
|
|
70
66
|
return /* @__PURE__ */ r(
|
|
71
|
-
|
|
67
|
+
oe,
|
|
72
68
|
{
|
|
73
69
|
open: i,
|
|
74
70
|
disabled: o,
|
|
@@ -79,26 +75,26 @@ const de = t.forwardRef(
|
|
|
79
75
|
onOpenAutoFocus: (e) => {
|
|
80
76
|
m.current || e.preventDefault(), m.current = !1;
|
|
81
77
|
},
|
|
82
|
-
popoverHandlers:
|
|
78
|
+
popoverHandlers: B,
|
|
83
79
|
trigger: /* @__PURE__ */ r(
|
|
84
80
|
"div",
|
|
85
81
|
{
|
|
86
82
|
ref: k,
|
|
87
83
|
"data-component": "quarter-picker",
|
|
88
84
|
"data-state": i ? "open" : "closed",
|
|
89
|
-
onPointerDown: (e) =>
|
|
85
|
+
onPointerDown: (e) => se({
|
|
90
86
|
disabled: o,
|
|
91
87
|
event: e,
|
|
92
88
|
onOpen: () => c(!0),
|
|
93
89
|
focusField: () => d.current?.focus()
|
|
94
90
|
}),
|
|
95
91
|
children: /* @__PURE__ */ r(
|
|
96
|
-
|
|
92
|
+
q,
|
|
97
93
|
{
|
|
98
94
|
ref: d,
|
|
99
|
-
value:
|
|
95
|
+
value: Y,
|
|
100
96
|
readOnly: !0,
|
|
101
|
-
onKeyDown: (e) =>
|
|
97
|
+
onKeyDown: (e) => ce(e, {
|
|
102
98
|
disabled: o,
|
|
103
99
|
open: i,
|
|
104
100
|
onOpen: () => c(!0),
|
|
@@ -108,10 +104,10 @@ const de = t.forwardRef(
|
|
|
108
104
|
}
|
|
109
105
|
}),
|
|
110
106
|
onClick: () => !o && c(!0),
|
|
111
|
-
placeholder:
|
|
107
|
+
placeholder: H,
|
|
112
108
|
disabled: o,
|
|
113
109
|
"data-form-control": "input",
|
|
114
|
-
className:
|
|
110
|
+
className: $("cursor-pointer", A),
|
|
115
111
|
suffix: /* @__PURE__ */ y("div", { className: "flex items-center gap-1", children: [
|
|
116
112
|
n && !o ? /* @__PURE__ */ y(x, { children: [
|
|
117
113
|
/* @__PURE__ */ r(b, { asChild: !0, children: /* @__PURE__ */ r(
|
|
@@ -124,7 +120,7 @@ const de = t.forwardRef(
|
|
|
124
120
|
e.stopPropagation(), C();
|
|
125
121
|
},
|
|
126
122
|
className: "inline-flex size-4 items-center justify-center border-none bg-transparent p-0",
|
|
127
|
-
children: /* @__PURE__ */ r(
|
|
123
|
+
children: /* @__PURE__ */ r(Z, { className: "size-3 hover:text-content" })
|
|
128
124
|
}
|
|
129
125
|
) }),
|
|
130
126
|
/* @__PURE__ */ r(R, { variant: "tertiary", side: "top", children: a("calendar.clear") })
|
|
@@ -141,42 +137,42 @@ const de = t.forwardRef(
|
|
|
141
137
|
e.stopPropagation(), o || c((f) => !f);
|
|
142
138
|
},
|
|
143
139
|
className: "inline-flex items-center justify-center border-none bg-transparent p-0",
|
|
144
|
-
children: /* @__PURE__ */ r(
|
|
140
|
+
children: /* @__PURE__ */ r(_, { className: "h-4 w-4 text-secondary-foreground" })
|
|
145
141
|
}
|
|
146
142
|
) }),
|
|
147
143
|
/* @__PURE__ */ r(R, { variant: "tertiary", side: "top", children: a("datePicker.selectQuarter") })
|
|
148
144
|
] })
|
|
149
145
|
] }),
|
|
150
|
-
...
|
|
146
|
+
...z
|
|
151
147
|
}
|
|
152
148
|
)
|
|
153
149
|
}
|
|
154
150
|
),
|
|
155
151
|
children: /* @__PURE__ */ r(
|
|
156
|
-
|
|
152
|
+
ee,
|
|
157
153
|
{
|
|
158
154
|
pickerType: "quarter",
|
|
159
155
|
selectedQuarters: g,
|
|
160
|
-
footerFlashKey:
|
|
161
|
-
footerFlashTarget:
|
|
162
|
-
onQuarterSelect:
|
|
163
|
-
month:
|
|
164
|
-
onMonthChange:
|
|
165
|
-
disabled:
|
|
156
|
+
footerFlashKey: L,
|
|
157
|
+
footerFlashTarget: V,
|
|
158
|
+
onQuarterSelect: W,
|
|
159
|
+
month: G,
|
|
160
|
+
onMonthChange: J,
|
|
161
|
+
disabled: te(Q, v),
|
|
166
162
|
startMonth: N,
|
|
167
163
|
endMonth: S,
|
|
168
164
|
showFooter: s,
|
|
169
|
-
onApply:
|
|
165
|
+
onApply: X,
|
|
170
166
|
onCancel: h,
|
|
171
167
|
onClear: C,
|
|
172
|
-
...
|
|
168
|
+
...U
|
|
173
169
|
}
|
|
174
170
|
)
|
|
175
171
|
}
|
|
176
172
|
);
|
|
177
173
|
}
|
|
178
174
|
);
|
|
179
|
-
|
|
175
|
+
fe.displayName = "QuarterPicker";
|
|
180
176
|
export {
|
|
181
|
-
|
|
177
|
+
fe as QuarterPicker
|
|
182
178
|
};
|