impact-nova 2.5.11 → 2.5.12
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/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-display/calendar/calendar-config.js +1 -1
- package/dist/components/data-display/calendar/calendar-day-picker-components.js +205 -146
- 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-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-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 +9 -0
- package/dist/components/data-display/calendar/calendar-selection-appearance.js +56 -43
- 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.js +33 -33
- package/dist/components/data-display/calendar/calendar-week-utils.d.ts +13 -3
- package/dist/components/data-display/calendar/calendar-week-utils.js +59 -50
- package/dist/components/data-display/calendar/calendar-year-panes.d.ts +1 -0
- package/dist/components/data-display/calendar/calendar-year-panes.js +53 -51
- 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/fiscal-picker-fixtures.d.ts +17 -0
- package/dist/components/forms/date-picker/multi-quarter-picker.js +51 -49
- package/dist/components/forms/date-picker/multi-year-picker.js +53 -51
- package/dist/components/forms/date-picker/quarter-picker.js +51 -49
- package/dist/components/forms/date-picker/quarter-range-picker.js +50 -48
- package/dist/components/forms/date-picker/year-picker.js +52 -50
- package/dist/components/forms/date-picker/year-range-picker.js +52 -50
- 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/MultiWeekPickerField.js +33 -26
- package/dist/form-react/Fields/WeekRangePicker.js +16 -16
- package/dist/form-react/types/fields.types.d.ts +2 -0
- package/dist/impact-nova-components.css +13 -6
- package/dist/impact-nova.css +1 -1
- package/dist/lib/fiscal-calendar/week-selection.js +2 -2
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/package.json +1 -1
|
@@ -1,85 +1,94 @@
|
|
|
1
1
|
import { civilFromLocalDate as l } from "../../../lib/fiscal-calendar/civil-date.js";
|
|
2
|
-
import { resolveWeekSelection as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
import { resolveWeekSelection as S } from "../../../lib/fiscal-calendar/week-selection.js";
|
|
3
|
+
import { isCalendarPaddingWeek as y } from "./calendar-padding-week.utils.js";
|
|
4
|
+
function _(e, r) {
|
|
5
|
+
const a = e.days[0]?.date;
|
|
6
|
+
if (a)
|
|
7
|
+
return r?.(a)?.fiscalPeriod;
|
|
7
8
|
}
|
|
8
|
-
function
|
|
9
|
+
function T(e) {
|
|
9
10
|
return e.calendarKind !== "fiscal" || e.weekPeriod == null || e.panePeriod == null ? !1 : e.weekPeriod !== e.panePeriod;
|
|
10
11
|
}
|
|
11
|
-
function
|
|
12
|
-
return e.
|
|
12
|
+
function k(e) {
|
|
13
|
+
return e.calendarKind !== "fiscal" || e.weekPeriod == null || e.panePeriod == null ? !1 : e.weekPeriod === e.panePeriod;
|
|
13
14
|
}
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
return W(o, n);
|
|
15
|
+
function E(e, r) {
|
|
16
|
+
return k(r) ? !1 : y(e) || T(r);
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
18
|
+
function d(e, r) {
|
|
19
|
+
return e.year === r.year && e.month === r.month && e.weekOfMonth === r.weekOfMonth;
|
|
20
|
+
}
|
|
21
|
+
function F(e, r) {
|
|
22
|
+
const a = e instanceof Date ? e : e.days.find((t) => !t.outside)?.date ?? e.days[0]?.date ?? /* @__PURE__ */ new Date();
|
|
23
|
+
return S(a, r);
|
|
24
|
+
}
|
|
25
|
+
function H(e, r, a) {
|
|
26
|
+
if (a === "single") return e;
|
|
27
|
+
if (a === "multiple") {
|
|
28
|
+
const i = r || [];
|
|
29
|
+
return i.some((f) => d(f, e)) ? i.filter((f) => !d(f, e)) : [...i, e];
|
|
23
30
|
}
|
|
24
|
-
const t =
|
|
31
|
+
const t = r;
|
|
25
32
|
if (!t?.from || t.to) return { from: e };
|
|
26
|
-
if (
|
|
33
|
+
if (d(e, t.from)) return t;
|
|
27
34
|
const s = { from: t.from, to: e };
|
|
28
35
|
return e.startDate < t.from.startDate && (s.from = e, s.to = t.from), s;
|
|
29
36
|
}
|
|
30
|
-
function
|
|
37
|
+
function R(e) {
|
|
31
38
|
if (!e) return;
|
|
32
|
-
const
|
|
39
|
+
const r = [], a = (t) => {
|
|
33
40
|
const s = new Date(t.startDate);
|
|
34
41
|
s.setHours(0, 0, 0, 0);
|
|
35
|
-
const
|
|
36
|
-
for (
|
|
37
|
-
|
|
42
|
+
const i = new Date(t.endDate);
|
|
43
|
+
for (i.setHours(0, 0, 0, 0); s <= i; )
|
|
44
|
+
r.push(new Date(s)), s.setDate(s.getDate() + 1);
|
|
38
45
|
};
|
|
39
46
|
if (Array.isArray(e))
|
|
40
|
-
e.forEach(
|
|
47
|
+
e.forEach(a);
|
|
41
48
|
else if ("from" in e) {
|
|
42
49
|
if (e.from)
|
|
43
50
|
if (!e.to)
|
|
44
|
-
|
|
51
|
+
a(e.from);
|
|
45
52
|
else {
|
|
46
53
|
const t = new Date(e.from.startDate);
|
|
47
54
|
t.setHours(0, 0, 0, 0);
|
|
48
55
|
const s = new Date(e.to.endDate);
|
|
49
56
|
for (s.setHours(0, 0, 0, 0); t <= s; )
|
|
50
|
-
|
|
57
|
+
r.push(new Date(t)), t.setDate(t.getDate() + 1);
|
|
51
58
|
}
|
|
52
59
|
} else
|
|
53
|
-
|
|
54
|
-
return
|
|
60
|
+
a(e);
|
|
61
|
+
return r;
|
|
55
62
|
}
|
|
56
|
-
function
|
|
63
|
+
function x(e, r, a) {
|
|
57
64
|
if (!e || e.length === 0)
|
|
58
65
|
return { range_start: [], range_middle: [], range_end: [] };
|
|
59
|
-
const t = [...e].sort((
|
|
60
|
-
|
|
61
|
-
f.add(l(
|
|
66
|
+
const t = [...e].sort((n, o) => n.getTime() - o.getTime()), s = [], i = [], u = [], f = /* @__PURE__ */ new Set(), m = /* @__PURE__ */ new Set();
|
|
67
|
+
r === "multiple" && Array.isArray(a) && a.forEach((n) => {
|
|
68
|
+
f.add(l(n.startDate)), m.add(l(n.endDate));
|
|
62
69
|
});
|
|
63
|
-
const D = (
|
|
64
|
-
if (
|
|
65
|
-
const c = t[
|
|
66
|
-
return
|
|
67
|
-
}, p = (
|
|
68
|
-
return t.forEach((
|
|
69
|
-
const c = l(
|
|
70
|
-
if (
|
|
71
|
-
|
|
70
|
+
const D = (n, o) => {
|
|
71
|
+
if (o === 0) return !1;
|
|
72
|
+
const c = t[o - 1];
|
|
73
|
+
return n.getTime() - c.getTime() <= 1440 * 60 * 1e3;
|
|
74
|
+
}, p = (n, o) => o === t.length - 1 ? !1 : t[o + 1].getTime() - n.getTime() <= 1440 * 60 * 1e3;
|
|
75
|
+
return t.forEach((n, o) => {
|
|
76
|
+
const c = l(n), W = f.has(c), P = m.has(c), h = D(n, o), g = p(n, o);
|
|
77
|
+
if (r === "multiple") {
|
|
78
|
+
W ? s.push(n) : P ? u.push(n) : i.push(n);
|
|
72
79
|
return;
|
|
73
80
|
}
|
|
74
|
-
!h && !g ? (s.push(
|
|
75
|
-
}), { range_start: s, range_middle:
|
|
81
|
+
!h && !g ? (s.push(n), u.push(n)) : h ? g ? i.push(n) : u.push(n) : s.push(n);
|
|
82
|
+
}), { range_start: s, range_middle: i, range_end: u };
|
|
76
83
|
}
|
|
77
84
|
export {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
+
F as calculateWeekSelection,
|
|
86
|
+
x as computeWeekRangeModifiers,
|
|
87
|
+
_ as fiscalPeriodForWeek,
|
|
88
|
+
T as isForeignFiscalWeekRow,
|
|
89
|
+
k as isOwnedFiscalWeekRow,
|
|
90
|
+
d as isSameWeek,
|
|
91
|
+
H as nextWeekSelection,
|
|
92
|
+
E as shouldHideCalendarWeekRow,
|
|
93
|
+
R as weekSelectionsToDates
|
|
85
94
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { YearRange, YearSelection } from './calendar.types';
|
|
2
2
|
export declare const YEAR_PAGE_SIZE = 12;
|
|
3
3
|
export declare const YEAR_CAPTION_PAGE_SIZE = 6;
|
|
4
|
+
export declare const YEAR_PANE_WIDTH_CLASS = "w-[320px] min-w-[320px] max-w-[320px]";
|
|
4
5
|
export interface CalendarYearPanesProps {
|
|
5
6
|
pickerYear: number;
|
|
6
7
|
resolvedStartYear: number;
|
|
@@ -1,63 +1,64 @@
|
|
|
1
1
|
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { ChevronRight as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { Button as
|
|
5
|
-
import { CalendarPeriodCell as
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
import { ChevronRight as A } from "impact-nova-icons";
|
|
3
|
+
import { cn as N } from "../../../lib/utils.js";
|
|
4
|
+
import { Button as S } from "../../primitives/button/button.js";
|
|
5
|
+
import { CalendarPeriodCell as M } from "./calendar-period-cell.js";
|
|
6
|
+
import { PERIOD_RANGE_GRID_CLASSNAME as Y } from "./calendar-selection-appearance.js";
|
|
7
|
+
import { getYearRangeProps as O, isYearRangeSelection as T } from "./calendar-year-utils.js";
|
|
8
|
+
const Z = 12, H = 6, W = "w-[320px] min-w-[320px] max-w-[320px]";
|
|
9
|
+
function V({
|
|
10
|
+
pickerYear: _,
|
|
10
11
|
resolvedStartYear: d,
|
|
11
12
|
resolvedEndYear: m,
|
|
12
|
-
previousYearLabel:
|
|
13
|
-
nextYearLabel:
|
|
14
|
-
yearLabels:
|
|
13
|
+
previousYearLabel: R,
|
|
14
|
+
nextYearLabel: u,
|
|
15
|
+
yearLabels: c,
|
|
15
16
|
yearCaptions: p,
|
|
16
|
-
showFooter:
|
|
17
|
-
pendingYearSelection:
|
|
18
|
-
selectedYear:
|
|
19
|
-
isYearSelected:
|
|
20
|
-
isYearDisabled:
|
|
21
|
-
onYearPageChange:
|
|
22
|
-
onYearClick:
|
|
17
|
+
showFooter: v = !0,
|
|
18
|
+
pendingYearSelection: w,
|
|
19
|
+
selectedYear: C,
|
|
20
|
+
isYearSelected: P,
|
|
21
|
+
isYearDisabled: b,
|
|
22
|
+
onYearPageChange: h,
|
|
23
|
+
onYearClick: I
|
|
23
24
|
}) {
|
|
24
|
-
const
|
|
25
|
-
(
|
|
26
|
-
),
|
|
25
|
+
const i = !!p, n = i ? H : Z, o = Math.floor(_ / n) * n, f = o + n - 1, s = Array.from({ length: n }, (t, l) => o + l).filter(
|
|
26
|
+
(t) => t >= d && t <= m
|
|
27
|
+
), g = s[0] ?? o, E = s[s.length - 1] ?? f, a = v ? w : C, x = T(a) ? a : void 0;
|
|
27
28
|
return /* @__PURE__ */ r(
|
|
28
29
|
"div",
|
|
29
30
|
{
|
|
30
31
|
"data-slot": "year-panes",
|
|
31
|
-
className: "flex
|
|
32
|
+
className: N("flex flex-col gap-4 overflow-hidden p-3", W),
|
|
32
33
|
children: [
|
|
33
34
|
/* @__PURE__ */ r("div", { className: "flex items-center justify-between", children: [
|
|
34
35
|
/* @__PURE__ */ e(
|
|
35
|
-
|
|
36
|
+
S,
|
|
36
37
|
{
|
|
37
38
|
variant: "ghost",
|
|
38
39
|
size: "icon",
|
|
39
40
|
className: "h-7 w-7 shrink-0",
|
|
40
|
-
"aria-label":
|
|
41
|
-
disabled:
|
|
42
|
-
onClick: () =>
|
|
43
|
-
children: /* @__PURE__ */ e(
|
|
41
|
+
"aria-label": R,
|
|
42
|
+
disabled: o <= d,
|
|
43
|
+
onClick: () => h(o - n),
|
|
44
|
+
children: /* @__PURE__ */ e(A, { size: 16, className: "rotate-180" })
|
|
44
45
|
}
|
|
45
46
|
),
|
|
46
47
|
/* @__PURE__ */ r("div", { className: "text-sm font-medium text-content", children: [
|
|
47
|
-
|
|
48
|
+
c?.(g) ?? g,
|
|
48
49
|
" – ",
|
|
49
|
-
|
|
50
|
+
c?.(E) ?? E
|
|
50
51
|
] }),
|
|
51
52
|
/* @__PURE__ */ e(
|
|
52
|
-
|
|
53
|
+
S,
|
|
53
54
|
{
|
|
54
55
|
variant: "ghost",
|
|
55
56
|
size: "icon",
|
|
56
57
|
className: "h-7 w-7",
|
|
57
|
-
"aria-label":
|
|
58
|
-
disabled:
|
|
59
|
-
onClick: () =>
|
|
60
|
-
children: /* @__PURE__ */ e(
|
|
58
|
+
"aria-label": u,
|
|
59
|
+
disabled: f >= m,
|
|
60
|
+
onClick: () => h(o + n),
|
|
61
|
+
children: /* @__PURE__ */ e(A, { className: "h-4 w-4" })
|
|
61
62
|
}
|
|
62
63
|
)
|
|
63
64
|
] }),
|
|
@@ -65,26 +66,26 @@ function U({
|
|
|
65
66
|
"div",
|
|
66
67
|
{
|
|
67
68
|
"data-period-grid": "",
|
|
68
|
-
className:
|
|
69
|
-
children: s.map((
|
|
70
|
-
const l =
|
|
69
|
+
className: N(Y, i ? "grid-cols-2" : "grid-cols-3"),
|
|
70
|
+
children: s.map((t) => {
|
|
71
|
+
const l = P(t), z = b(t), k = !!x, { isStart: B, isEnd: G, isMiddle: j } = O(t, a), D = p?.(t);
|
|
71
72
|
return /* @__PURE__ */ e(
|
|
72
|
-
|
|
73
|
+
M,
|
|
73
74
|
{
|
|
74
75
|
selected: l,
|
|
75
|
-
disabled:
|
|
76
|
+
disabled: z,
|
|
76
77
|
isRange: k,
|
|
77
78
|
isStart: B,
|
|
78
|
-
isEnd:
|
|
79
|
-
isMiddle:
|
|
80
|
-
hasRangeEnd: !!
|
|
81
|
-
size:
|
|
82
|
-
columns:
|
|
83
|
-
onClick: () =>
|
|
84
|
-
caption:
|
|
85
|
-
children:
|
|
79
|
+
isEnd: G,
|
|
80
|
+
isMiddle: j,
|
|
81
|
+
hasRangeEnd: !!x?.to,
|
|
82
|
+
size: i ? "year-caption" : "year",
|
|
83
|
+
columns: i ? 2 : 3,
|
|
84
|
+
onClick: () => I(t),
|
|
85
|
+
caption: D,
|
|
86
|
+
children: c?.(t) ?? String(t)
|
|
86
87
|
},
|
|
87
|
-
|
|
88
|
+
t
|
|
88
89
|
);
|
|
89
90
|
})
|
|
90
91
|
}
|
|
@@ -94,7 +95,8 @@ function U({
|
|
|
94
95
|
);
|
|
95
96
|
}
|
|
96
97
|
export {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
V as CalendarYearPanes,
|
|
99
|
+
H as YEAR_CAPTION_PAGE_SIZE,
|
|
100
|
+
Z as YEAR_PAGE_SIZE,
|
|
101
|
+
W as YEAR_PANE_WIDTH_CLASS
|
|
100
102
|
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { Tooltip as l, TooltipTrigger as n, TooltipContent as o } from "./tooltip.js";
|
|
3
|
-
|
|
4
|
-
const p = (i, r, a) => /* @__PURE__ */ t(l, { children: [
|
|
3
|
+
const d = (i, r, a) => /* @__PURE__ */ t(l, { children: [
|
|
5
4
|
/* @__PURE__ */ e(n, { asChild: !0, children: /* @__PURE__ */ e("span", { className: "inline-flex items-center justify-center h-full w-full", children: i }) }),
|
|
6
5
|
/* @__PURE__ */ e(o, { variant: "tertiary", className: a, children: r })
|
|
7
6
|
] }), h = (i, r) => /* @__PURE__ */ t(l, { children: [
|
|
@@ -10,5 +9,5 @@ const p = (i, r, a) => /* @__PURE__ */ t(l, { children: [
|
|
|
10
9
|
] });
|
|
11
10
|
export {
|
|
12
11
|
h as defaultAccordionTooltipRender,
|
|
13
|
-
|
|
12
|
+
d as defaultTabTooltipRender
|
|
14
13
|
};
|
|
@@ -2,17 +2,17 @@ import { jsx as r, jsxs as h, Fragment as z } from "react/jsx-runtime";
|
|
|
2
2
|
import * as o from "react";
|
|
3
3
|
import { Person as G, Monitor as U, PriorityAlert as q, Locked as O, Reset as B } from "impact-nova-icons";
|
|
4
4
|
import { cn as p } from "../../../lib/utils.js";
|
|
5
|
-
import { Kbd as $ } from "../../primitives/kbd/kbd.js";
|
|
6
|
-
import { keybindingToString as H } from "../../primitives/kbd/keybinding-display.js";
|
|
7
5
|
import { OverflowTooltip as A } from "../../feedback/tooltip/overflow-tooltip.js";
|
|
8
|
-
import { ModuleRegistry as
|
|
9
|
-
import { AllEnterpriseModule as
|
|
10
|
-
import { DataTable as
|
|
6
|
+
import { ModuleRegistry as $, AllCommunityModule as H } from "ag-grid-community";
|
|
7
|
+
import { AllEnterpriseModule as V } from "ag-grid-enterprise";
|
|
8
|
+
import { DataTable as J, DataTableContent as Q } from "../../data/data-table/data-table.js";
|
|
11
9
|
import { AG_CELL_NO_PADDING as F } from "../../data/ag-grid-react/cell-renderers/index.js";
|
|
10
|
+
import { Kbd as X } from "../../primitives/kbd/kbd.js";
|
|
11
|
+
import { keybindingToString as Y } from "../../primitives/kbd/keybinding-display.js";
|
|
12
12
|
import { useCommandPalette as Z } from "./use-command-palette.js";
|
|
13
13
|
import { COMMAND_SOURCE_LABELS as m, keybindingFromEvent as W, isReservedShortcut as ee } from "./utils.js";
|
|
14
14
|
import { BadgeCellRenderer as te } from "../../data/ag-grid-react/cell-renderers/badge-cell-renderer.js";
|
|
15
|
-
|
|
15
|
+
$.registerModules([H, V]);
|
|
16
16
|
function re(a) {
|
|
17
17
|
const t = a.data;
|
|
18
18
|
return t ? /* @__PURE__ */ h("div", { className: "flex items-center gap-2 min-w-0 h-full", children: [
|
|
@@ -69,7 +69,7 @@ function ne(a) {
|
|
|
69
69
|
"flex items-center justify-end h-full w-full text-end",
|
|
70
70
|
t.customisable ? "cursor-pointer" : "cursor-default opacity-70"
|
|
71
71
|
),
|
|
72
|
-
children: /* @__PURE__ */ r(
|
|
72
|
+
children: /* @__PURE__ */ r(X, { keybinding: t.keybinding, size: "sm" })
|
|
73
73
|
}
|
|
74
74
|
) : t.customisable ? /* @__PURE__ */ r(
|
|
75
75
|
"button",
|
|
@@ -133,7 +133,7 @@ function le({
|
|
|
133
133
|
description: e.description || "",
|
|
134
134
|
category: e.category || "General",
|
|
135
135
|
keybinding: i,
|
|
136
|
-
keybindingDisplay: i ?
|
|
136
|
+
keybindingDisplay: i ? Y(i) : "",
|
|
137
137
|
scope: e.scope,
|
|
138
138
|
source: D,
|
|
139
139
|
sourceColor: T ? "primary" : "neutral",
|
|
@@ -278,10 +278,10 @@ function le({
|
|
|
278
278
|
u?.type === "conflict" ? /* @__PURE__ */ r(q, { className: "h-3.5 w-3.5 shrink-0" }) : u?.type === "reserved" ? /* @__PURE__ */ r(O, { className: "h-3.5 w-3.5 shrink-0" }) : c ? /* @__PURE__ */ r("span", { className: "shrink-0 text-base", children: "⌨️" }) : null,
|
|
279
279
|
/* @__PURE__ */ r("span", { children: u ? u.text : L })
|
|
280
280
|
] }) : null;
|
|
281
|
-
return /* @__PURE__ */ h(
|
|
281
|
+
return /* @__PURE__ */ h(J, { className: p("flex flex-col w-full h-full border-t-0", a), children: [
|
|
282
282
|
s ? s(E) : E,
|
|
283
283
|
/* @__PURE__ */ r(
|
|
284
|
-
|
|
284
|
+
Q,
|
|
285
285
|
{
|
|
286
286
|
rowData: y,
|
|
287
287
|
columnDefs: I,
|
|
@@ -6,8 +6,8 @@ import { cn as o } from "../../../lib/utils.js";
|
|
|
6
6
|
import { MultiColorFilter as F, Cross as P, InfoBadge as u } from "impact-nova-icons";
|
|
7
7
|
import { Button as D } from "../../primitives/button/button.js";
|
|
8
8
|
import { Tooltip as c, TooltipTrigger as f, TooltipContent as h } from "../../feedback/tooltip/tooltip.js";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
9
|
+
import { OverflowTooltip as S } from "../../feedback/tooltip/overflow-tooltip.js";
|
|
10
|
+
import { Kbd as j } from "../../primitives/kbd/kbd.js";
|
|
11
11
|
import { useImpactNovaI18n as v } from "../../../i18n/use-impact-nova-i18n.js";
|
|
12
12
|
import { useOverlayHostDismissNestedLayersOnNavigation as I } from "../../../lib/overlay/overlay-portal-context.js";
|
|
13
13
|
import { preventDismissOnTooltipOutside as x } from "../../../lib/overlay/prevent-dismiss-on-tooltip-outside.js";
|
|
@@ -145,14 +145,14 @@ const O = ({
|
|
|
145
145
|
),
|
|
146
146
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-1 min-w-0", children: [
|
|
147
147
|
/* @__PURE__ */ e(
|
|
148
|
-
|
|
148
|
+
S,
|
|
149
149
|
{
|
|
150
150
|
triggerClassName: "truncate font-['Manrope'] block min-w-0",
|
|
151
151
|
content: t.tooltipKeybinding ? /* @__PURE__ */ a("span", { className: "flex items-center gap-2", children: [
|
|
152
152
|
t.label,
|
|
153
153
|
" ",
|
|
154
154
|
/* @__PURE__ */ e(
|
|
155
|
-
|
|
155
|
+
j,
|
|
156
156
|
{
|
|
157
157
|
keybinding: t.tooltipKeybinding,
|
|
158
158
|
size: "sm"
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** Reusable fiscal picker configs. Named by pattern, week start, and FY start month. */
|
|
2
|
+
export declare const FISCAL_454_SUNDAY_FEBRUARY: {
|
|
3
|
+
calendarKind: "fiscal";
|
|
4
|
+
fiscalMode: "advanced";
|
|
5
|
+
fiscalYearStartMonth: number;
|
|
6
|
+
fiscalMonthPattern: number[];
|
|
7
|
+
weekStartsOn: 0;
|
|
8
|
+
};
|
|
9
|
+
export declare const FISCAL_454_MONDAY_JANUARY: {
|
|
10
|
+
calendarKind: "fiscal";
|
|
11
|
+
fiscalMode: "advanced";
|
|
12
|
+
fiscalYearStartMonth: number;
|
|
13
|
+
fiscalMonthPattern: number[];
|
|
14
|
+
weekStartsOn: 1;
|
|
15
|
+
};
|
|
16
|
+
/** Selectability bound only — do not copy onto startMonth. */
|
|
17
|
+
export declare const MIN_DATE_2025_08_17: Date;
|
|
@@ -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,31 +30,33 @@ const fe = n.forwardRef(
|
|
|
30
30
|
fiscalMonthPattern: w,
|
|
31
31
|
fiscalYearStartMonth: v,
|
|
32
32
|
fiscalConfig: K,
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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]));
|
|
41
42
|
n.useEffect(() => {
|
|
42
43
|
i || l(t);
|
|
43
44
|
}, [i, t]);
|
|
44
|
-
const m = n.useCallback(() => c(!1), []),
|
|
45
|
+
const m = n.useCallback(() => c(!1), []), W = ae({
|
|
45
46
|
calendarKind: I,
|
|
46
47
|
fiscalMode: O,
|
|
47
48
|
granularity: T,
|
|
48
49
|
fiscalMonthPattern: w,
|
|
49
50
|
fiscalYearStartMonth: v,
|
|
50
51
|
fiscalConfig: K,
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
weekStartsOn: j,
|
|
53
|
+
showPresets: F,
|
|
54
|
+
showPeriodBoundaries: z,
|
|
55
|
+
autoNavigateToAvailable: E
|
|
56
|
+
}), X = (e) => {
|
|
55
57
|
const p = Array.isArray(e) && e.length > 0 ? e : void 0;
|
|
56
58
|
l(p), s || u?.(p);
|
|
57
|
-
},
|
|
59
|
+
}, Y = () => {
|
|
58
60
|
u?.(P), m();
|
|
59
61
|
}, h = () => {
|
|
60
62
|
l(t), m();
|
|
@@ -64,9 +66,9 @@ const fe = n.forwardRef(
|
|
|
64
66
|
n.useLayoutEffect(() => {
|
|
65
67
|
k.current = { onDismiss: h, resolveFlash: () => "cancel" };
|
|
66
68
|
});
|
|
67
|
-
const
|
|
69
|
+
const Z = t && t.length > 0 ? t.length === 1 ? ue(t[0]) : a("datePicker.quartersSelected", { count: t.length }) : "";
|
|
68
70
|
return /* @__PURE__ */ r(
|
|
69
|
-
|
|
71
|
+
ie,
|
|
70
72
|
{
|
|
71
73
|
open: i,
|
|
72
74
|
disabled: o,
|
|
@@ -77,26 +79,26 @@ const fe = n.forwardRef(
|
|
|
77
79
|
onOpenAutoFocus: (e) => {
|
|
78
80
|
d.current || e.preventDefault(), d.current = !1;
|
|
79
81
|
},
|
|
80
|
-
popoverHandlers:
|
|
82
|
+
popoverHandlers: G,
|
|
81
83
|
trigger: /* @__PURE__ */ r(
|
|
82
84
|
"div",
|
|
83
85
|
{
|
|
84
86
|
ref: y,
|
|
85
87
|
"data-component": "multi-quarter-picker",
|
|
86
88
|
"data-state": i ? "open" : "closed",
|
|
87
|
-
onPointerDown: (e) =>
|
|
89
|
+
onPointerDown: (e) => pe({
|
|
88
90
|
disabled: o,
|
|
89
91
|
event: e,
|
|
90
92
|
onOpen: () => c(!0),
|
|
91
93
|
focusField: () => f.current?.focus()
|
|
92
94
|
}),
|
|
93
95
|
children: /* @__PURE__ */ r(
|
|
94
|
-
|
|
96
|
+
te,
|
|
95
97
|
{
|
|
96
98
|
ref: f,
|
|
97
|
-
value:
|
|
99
|
+
value: Z,
|
|
98
100
|
readOnly: !0,
|
|
99
|
-
onKeyDown: (e) =>
|
|
101
|
+
onKeyDown: (e) => le(e, {
|
|
100
102
|
disabled: o,
|
|
101
103
|
open: i,
|
|
102
104
|
onOpen: () => c(!0),
|
|
@@ -106,10 +108,10 @@ const fe = n.forwardRef(
|
|
|
106
108
|
}
|
|
107
109
|
}),
|
|
108
110
|
onClick: () => !o && c(!0),
|
|
109
|
-
placeholder:
|
|
111
|
+
placeholder: V,
|
|
110
112
|
disabled: o,
|
|
111
113
|
"data-form-control": "input",
|
|
112
|
-
className:
|
|
114
|
+
className: ee("cursor-pointer", A),
|
|
113
115
|
suffix: /* @__PURE__ */ g("div", { className: "flex items-center gap-1", children: [
|
|
114
116
|
t && t.length > 0 && !o ? /* @__PURE__ */ g(M, { children: [
|
|
115
117
|
/* @__PURE__ */ r(x, { asChild: !0, children: /* @__PURE__ */ r(
|
|
@@ -122,7 +124,7 @@ const fe = n.forwardRef(
|
|
|
122
124
|
e.stopPropagation(), C();
|
|
123
125
|
},
|
|
124
126
|
className: "inline-flex size-4 items-center justify-center border-none bg-transparent p-0",
|
|
125
|
-
children: /* @__PURE__ */ r(
|
|
127
|
+
children: /* @__PURE__ */ r(_, { className: "size-3 hover:text-content" })
|
|
126
128
|
}
|
|
127
129
|
) }),
|
|
128
130
|
/* @__PURE__ */ r(b, { variant: "tertiary", side: "top", children: a("calendar.clear") })
|
|
@@ -139,43 +141,43 @@ const fe = n.forwardRef(
|
|
|
139
141
|
e.stopPropagation(), o || c((p) => !p);
|
|
140
142
|
},
|
|
141
143
|
className: "inline-flex items-center justify-center border-none bg-transparent p-0",
|
|
142
|
-
children: /* @__PURE__ */ r(
|
|
144
|
+
children: /* @__PURE__ */ r($, { className: "h-4 w-4 text-secondary-foreground" })
|
|
143
145
|
}
|
|
144
146
|
) }),
|
|
145
147
|
/* @__PURE__ */ r(b, { variant: "tertiary", side: "top", children: a("datePicker.selectMultipleQuarters") })
|
|
146
148
|
] })
|
|
147
149
|
] }),
|
|
148
|
-
...
|
|
150
|
+
...H
|
|
149
151
|
}
|
|
150
152
|
)
|
|
151
153
|
}
|
|
152
154
|
),
|
|
153
155
|
children: /* @__PURE__ */ r(
|
|
154
|
-
|
|
156
|
+
re,
|
|
155
157
|
{
|
|
156
158
|
pickerType: "quarter",
|
|
157
159
|
monthMode: "multiple",
|
|
158
160
|
selectedQuarters: P,
|
|
159
|
-
footerFlashKey:
|
|
160
|
-
footerFlashTarget:
|
|
161
|
-
onQuarterSelect:
|
|
162
|
-
month:
|
|
163
|
-
onMonthChange:
|
|
164
|
-
disabled:
|
|
161
|
+
footerFlashKey: q,
|
|
162
|
+
footerFlashTarget: B,
|
|
163
|
+
onQuarterSelect: X,
|
|
164
|
+
month: J,
|
|
165
|
+
onMonthChange: U,
|
|
166
|
+
disabled: oe(D, Q),
|
|
165
167
|
startMonth: N,
|
|
166
168
|
endMonth: S,
|
|
167
169
|
showFooter: s,
|
|
168
|
-
onApply:
|
|
170
|
+
onApply: Y,
|
|
169
171
|
onCancel: h,
|
|
170
172
|
onClear: C,
|
|
171
|
-
...
|
|
173
|
+
...W
|
|
172
174
|
}
|
|
173
175
|
)
|
|
174
176
|
}
|
|
175
177
|
);
|
|
176
178
|
}
|
|
177
179
|
);
|
|
178
|
-
|
|
180
|
+
de.displayName = "MultiQuarterPicker";
|
|
179
181
|
export {
|
|
180
|
-
|
|
182
|
+
de as MultiQuarterPicker
|
|
181
183
|
};
|