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