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