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