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
|
@@ -2,7 +2,7 @@ import { jsxs as f, jsx as l } from "react/jsx-runtime";
|
|
|
2
2
|
import "react";
|
|
3
3
|
import { cn as u } from "../../../lib/utils.js";
|
|
4
4
|
import { Button as d } from "../../primitives/button/button.js";
|
|
5
|
-
import { formatDateRangeFooterSummary as
|
|
5
|
+
import { formatDateRangeFooterSummary as _, formatWeekFooterSummary as z, formatMonthFooterSummary as Y, formatQuarterFooterSummary as G, formatYearFooterSummary as I } from "./calendar-footer-summary.js";
|
|
6
6
|
const h = "relative isolate overflow-hidden animate-flash-highlight motion-reduce:animate-none", $ = {
|
|
7
7
|
"--flash-overlay": "color-mix(in srgb, white 55%, transparent)"
|
|
8
8
|
};
|
|
@@ -13,7 +13,7 @@ function a({
|
|
|
13
13
|
return /* @__PURE__ */ f(
|
|
14
14
|
"div",
|
|
15
15
|
{
|
|
16
|
-
className: "flex flex-row items-center gap-1 text-xs font-medium leading-[18px] text-content-tertiary",
|
|
16
|
+
className: "flex min-w-0 flex-row items-center gap-1 text-xs font-medium leading-[18px] text-content-tertiary",
|
|
17
17
|
"aria-live": "polite",
|
|
18
18
|
"aria-atomic": "true",
|
|
19
19
|
children: [
|
|
@@ -28,7 +28,7 @@ function O({
|
|
|
28
28
|
mode: n,
|
|
29
29
|
weekMode: i,
|
|
30
30
|
monthMode: r,
|
|
31
|
-
yearMode:
|
|
31
|
+
yearMode: m = "single",
|
|
32
32
|
calendarKind: S,
|
|
33
33
|
granularity: v,
|
|
34
34
|
resolvedFiscalPattern: B,
|
|
@@ -39,26 +39,26 @@ function O({
|
|
|
39
39
|
pendingQuarterSelection: N,
|
|
40
40
|
pendingYearSelection: P,
|
|
41
41
|
multiRangeSummary: g,
|
|
42
|
-
disableApply:
|
|
43
|
-
isApplyDisabled:
|
|
42
|
+
disableApply: w,
|
|
43
|
+
isApplyDisabled: C,
|
|
44
44
|
footerFlashKey: c = 0,
|
|
45
45
|
footerFlashTarget: p,
|
|
46
46
|
labels: e,
|
|
47
|
-
onClear:
|
|
48
|
-
onCancel:
|
|
49
|
-
onApply:
|
|
47
|
+
onClear: H,
|
|
48
|
+
onCancel: j,
|
|
49
|
+
onApply: q
|
|
50
50
|
}) {
|
|
51
|
-
const
|
|
51
|
+
const A = t === "month" && r !== "single" || t === "quarter" && r !== "single" || t === "year" && m !== "single" || n === "range" || n === "multi-range" || i === "range" || i === "multiple", s = c > 0 && p === "cancel", o = c > 0 && p === "apply";
|
|
52
52
|
return /* @__PURE__ */ f(
|
|
53
53
|
"div",
|
|
54
54
|
{
|
|
55
55
|
className: u(
|
|
56
|
-
"flex items-center gap-2 border-t p-3 pt-3",
|
|
57
|
-
|
|
56
|
+
"flex min-w-0 items-center gap-2 border-t p-3 pt-3",
|
|
57
|
+
A ? "justify-between" : "justify-end"
|
|
58
58
|
),
|
|
59
59
|
children: [
|
|
60
60
|
n === "multi-range" && g ? /* @__PURE__ */ l(a, { selectedLabel: e.selected, children: g }) : null,
|
|
61
|
-
n === "range" && t === "date" ? /* @__PURE__ */ l(a, { selectedLabel: e.selected, children:
|
|
61
|
+
n === "range" && t === "date" ? /* @__PURE__ */ l(a, { selectedLabel: e.selected, children: _(L) }) : null,
|
|
62
62
|
t === "week" && (i === "range" || i === "multiple") ? /* @__PURE__ */ l(a, { selectedLabel: e.selected, children: z({
|
|
63
63
|
selection: y,
|
|
64
64
|
calendarKind: S,
|
|
@@ -73,23 +73,23 @@ function O({
|
|
|
73
73
|
single: e.quarterSingle,
|
|
74
74
|
plural: e.quarterPlural
|
|
75
75
|
}) }) : null,
|
|
76
|
-
t === "year" && (
|
|
76
|
+
t === "year" && (m === "range" || m === "multiple") ? /* @__PURE__ */ l(a, { selectedLabel: e.selected, children: I(P, {
|
|
77
77
|
single: e.yearSingle,
|
|
78
78
|
plural: e.yearPlural
|
|
79
79
|
}) }) : null,
|
|
80
|
-
/* @__PURE__ */ f("div", { className: "flex items-center gap-2", children: [
|
|
81
|
-
/* @__PURE__ */ l(d, { variant: "link", size: "md", onClick:
|
|
80
|
+
/* @__PURE__ */ f("div", { className: "flex shrink-0 items-center gap-2", children: [
|
|
81
|
+
/* @__PURE__ */ l(d, { variant: "link", size: "md", onClick: H, children: e.clear }),
|
|
82
82
|
/* @__PURE__ */ l(
|
|
83
83
|
d,
|
|
84
84
|
{
|
|
85
85
|
variant: "outline",
|
|
86
86
|
size: "md",
|
|
87
|
-
"data-footer-flash":
|
|
88
|
-
className: u(
|
|
89
|
-
onClick:
|
|
87
|
+
"data-footer-flash": s ? "cancel" : void 0,
|
|
88
|
+
className: u(s && h),
|
|
89
|
+
onClick: j,
|
|
90
90
|
children: e.cancel
|
|
91
91
|
},
|
|
92
|
-
|
|
92
|
+
s ? `footer-cancel-${c}` : "footer-cancel"
|
|
93
93
|
),
|
|
94
94
|
/* @__PURE__ */ l(
|
|
95
95
|
d,
|
|
@@ -99,8 +99,8 @@ function O({
|
|
|
99
99
|
"data-footer-flash": o ? "apply" : void 0,
|
|
100
100
|
style: o ? $ : void 0,
|
|
101
101
|
className: u(o && h),
|
|
102
|
-
onClick:
|
|
103
|
-
disabled:
|
|
102
|
+
onClick: q,
|
|
103
|
+
disabled: w || C,
|
|
104
104
|
children: e.apply
|
|
105
105
|
},
|
|
106
106
|
o ? `footer-apply-${c}` : "footer-apply"
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { jsxs as w, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { useDayPicker as g } from "react-day-picker";
|
|
3
|
+
import { cn as D } from "../../../lib/utils.js";
|
|
4
|
+
import { fiscalWeekToCalendarWeek as N } from "./calendar-leading-week.utils.js";
|
|
5
|
+
import { injectedCalendarDayModifiers as W, callDayPickerSelect as _ } from "./calendar-selection.js";
|
|
6
|
+
function x({
|
|
7
|
+
fiscalWeek: c,
|
|
8
|
+
displayMonth: n
|
|
9
|
+
}) {
|
|
10
|
+
const {
|
|
11
|
+
classNames: t,
|
|
12
|
+
components: s,
|
|
13
|
+
formatters: m,
|
|
14
|
+
getModifiers: u,
|
|
15
|
+
isSelected: f,
|
|
16
|
+
select: k,
|
|
17
|
+
dayPickerProps: a
|
|
18
|
+
} = g(), o = N(c, n), b = a.showWeekNumber !== !1;
|
|
19
|
+
return /* @__PURE__ */ w(
|
|
20
|
+
s.Week,
|
|
21
|
+
{
|
|
22
|
+
className: t.week,
|
|
23
|
+
week: o,
|
|
24
|
+
"data-fiscal-injected": "true",
|
|
25
|
+
children: [
|
|
26
|
+
b ? /* @__PURE__ */ r(
|
|
27
|
+
s.WeekNumber,
|
|
28
|
+
{
|
|
29
|
+
week: o,
|
|
30
|
+
className: t.week_number,
|
|
31
|
+
scope: "row",
|
|
32
|
+
role: "rowheader"
|
|
33
|
+
}
|
|
34
|
+
) : null,
|
|
35
|
+
o.days.map((d) => {
|
|
36
|
+
const i = u(d), l = W({
|
|
37
|
+
date: d.date,
|
|
38
|
+
disabled: a.disabled,
|
|
39
|
+
today: a.today,
|
|
40
|
+
isSelected: f,
|
|
41
|
+
customModifiers: a.modifiers
|
|
42
|
+
}), e = {
|
|
43
|
+
...i,
|
|
44
|
+
...l,
|
|
45
|
+
outside: d.outside || i.outside,
|
|
46
|
+
selected: l.selected || i.selected
|
|
47
|
+
};
|
|
48
|
+
return /* @__PURE__ */ r(
|
|
49
|
+
s.Day,
|
|
50
|
+
{
|
|
51
|
+
day: d,
|
|
52
|
+
modifiers: e,
|
|
53
|
+
className: D(
|
|
54
|
+
t.day,
|
|
55
|
+
e.outside && t.outside,
|
|
56
|
+
e.selected && t.selected,
|
|
57
|
+
e.disabled && t.disabled,
|
|
58
|
+
e.today && t.today,
|
|
59
|
+
e.range_start && t.range_start,
|
|
60
|
+
e.range_middle && t.range_middle,
|
|
61
|
+
e.range_end && t.range_end
|
|
62
|
+
),
|
|
63
|
+
role: "gridcell",
|
|
64
|
+
"data-day": d.isoDate,
|
|
65
|
+
"data-outside": d.outside || void 0,
|
|
66
|
+
"data-selected": e.selected || void 0,
|
|
67
|
+
"data-disabled": e.disabled || void 0,
|
|
68
|
+
children: /* @__PURE__ */ r(
|
|
69
|
+
s.DayButton,
|
|
70
|
+
{
|
|
71
|
+
className: t.day_button,
|
|
72
|
+
type: "button",
|
|
73
|
+
day: d,
|
|
74
|
+
modifiers: e,
|
|
75
|
+
disabled: e.disabled || void 0,
|
|
76
|
+
onClick: (p) => {
|
|
77
|
+
e.disabled || _(k, d.date, e, p);
|
|
78
|
+
},
|
|
79
|
+
children: m.formatDay(d.date)
|
|
80
|
+
}
|
|
81
|
+
)
|
|
82
|
+
},
|
|
83
|
+
d.isoDate
|
|
84
|
+
);
|
|
85
|
+
})
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
);
|
|
89
|
+
}
|
|
90
|
+
export {
|
|
91
|
+
x as InjectedFiscalWeekRow
|
|
92
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CalendarWeek } from 'react-day-picker';
|
|
2
|
+
import { FiscalCalendarConfig, FiscalWeek } from '../../../lib/fiscal-calendar';
|
|
3
|
+
/** Fiscal weeks owned by this pane that DayPicker never puts in this civil month. */
|
|
4
|
+
export declare function ownedWeeksOutsidePane(options: {
|
|
5
|
+
paneYear: number;
|
|
6
|
+
paneMonthIndex: number;
|
|
7
|
+
panePeriod?: number;
|
|
8
|
+
fiscalConfig?: FiscalCalendarConfig;
|
|
9
|
+
fy?: number;
|
|
10
|
+
}): {
|
|
11
|
+
leading: FiscalWeek[];
|
|
12
|
+
trailing: FiscalWeek[];
|
|
13
|
+
};
|
|
14
|
+
/** Static Tailwind classes — JIT cannot see dynamic nth-last-child counts. */
|
|
15
|
+
export declare function injectedWeekCollapseClass(count: number): string | undefined;
|
|
16
|
+
export declare function fiscalWeekToCalendarWeek(week: FiscalWeek, displayMonth: Date): CalendarWeek;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { CalendarDay as f, CalendarWeek as u } from "react-day-picker";
|
|
2
|
+
import { localDateFromCivil as c, addDays as h, parseCivilDate as s } from "../../../lib/fiscal-calendar/civil-date.js";
|
|
3
|
+
import { buildFiscalYear as m } from "../../../lib/fiscal-calendar/build-year.js";
|
|
4
|
+
function p(e, i, n, r) {
|
|
5
|
+
const t = (l) => {
|
|
6
|
+
const { y: d, m: o } = s(l);
|
|
7
|
+
return d < n || d === n && o - 1 < r;
|
|
8
|
+
};
|
|
9
|
+
return t(e) && t(i);
|
|
10
|
+
}
|
|
11
|
+
function C(e, i, n, r) {
|
|
12
|
+
const t = (l) => {
|
|
13
|
+
const { y: d, m: o } = s(l);
|
|
14
|
+
return d > n || d === n && o - 1 > r;
|
|
15
|
+
};
|
|
16
|
+
return t(e) && t(i);
|
|
17
|
+
}
|
|
18
|
+
function W(e) {
|
|
19
|
+
const { paneYear: i, paneMonthIndex: n, panePeriod: r, fiscalConfig: t, fy: l } = e;
|
|
20
|
+
if (r == null || !t || l == null)
|
|
21
|
+
return { leading: [], trailing: [] };
|
|
22
|
+
try {
|
|
23
|
+
const o = m(t, l).weeks.filter((a) => a.period === r);
|
|
24
|
+
return {
|
|
25
|
+
leading: o.filter(
|
|
26
|
+
(a) => p(a.start, a.end, i, n)
|
|
27
|
+
),
|
|
28
|
+
trailing: o.filter(
|
|
29
|
+
(a) => C(a.start, a.end, i, n)
|
|
30
|
+
)
|
|
31
|
+
};
|
|
32
|
+
} catch {
|
|
33
|
+
return { leading: [], trailing: [] };
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
function k(e) {
|
|
37
|
+
if (!(e <= 0))
|
|
38
|
+
return e === 1 ? "[&>tr[aria-hidden]:last-child]:hidden" : e === 2 ? "[&>tr[aria-hidden]:nth-last-child(-n+2)]:hidden" : "[&>tr[aria-hidden]:nth-last-child(-n+3)]:hidden";
|
|
39
|
+
}
|
|
40
|
+
function D(e, i) {
|
|
41
|
+
const n = [];
|
|
42
|
+
let r = e.start;
|
|
43
|
+
for (let t = 0; t < 7; t += 1)
|
|
44
|
+
n.push(new f(c(r), i)), r = h(r, 1);
|
|
45
|
+
return new u(e.week, n);
|
|
46
|
+
}
|
|
47
|
+
export {
|
|
48
|
+
D as fiscalWeekToCalendarWeek,
|
|
49
|
+
k as injectedWeekCollapseClass,
|
|
50
|
+
W as ownedWeeksOutsidePane
|
|
51
|
+
};
|
|
@@ -1,56 +1,57 @@
|
|
|
1
1
|
import { jsxs as d, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { ChevronRight as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { Button as
|
|
5
|
-
import { Select as
|
|
6
|
-
import { isMonthRangeSelection as
|
|
7
|
-
import { CalendarPeriodCell as
|
|
2
|
+
import { ChevronRight as f } from "impact-nova-icons";
|
|
3
|
+
import { cn as T } from "../../../lib/utils.js";
|
|
4
|
+
import { Button as g } from "../../primitives/button/button.js";
|
|
5
|
+
import { Select as B } from "../../forms/select/select.js";
|
|
6
|
+
import { isMonthRangeSelection as W } from "../../forms/date-picker/calendar-selection-adapters.js";
|
|
7
|
+
import { CalendarPeriodCell as q } from "./calendar-period-cell.js";
|
|
8
|
+
import { PERIOD_RANGE_GRID_CLASSNAME as F } from "./calendar-selection-appearance.js";
|
|
8
9
|
function Z({
|
|
9
|
-
yearOffset:
|
|
10
|
+
yearOffset: c = 0,
|
|
10
11
|
displayYear: e,
|
|
11
12
|
monthMode: s,
|
|
12
13
|
monthsShort: u,
|
|
13
|
-
showFooter:
|
|
14
|
+
showFooter: N,
|
|
14
15
|
pendingMonthSelection: v,
|
|
15
|
-
selectedMonths:
|
|
16
|
-
resolvedStartYear:
|
|
17
|
-
resolvedEndYear:
|
|
16
|
+
selectedMonths: p,
|
|
17
|
+
resolvedStartYear: C,
|
|
18
|
+
resolvedEndYear: S,
|
|
18
19
|
yearOptions: l,
|
|
19
|
-
previousYearLabel:
|
|
20
|
-
nextYearLabel:
|
|
21
|
-
isMonthSelected:
|
|
22
|
-
getMonthRangeProps:
|
|
23
|
-
isMonthDisabled:
|
|
24
|
-
onPreviousYear:
|
|
25
|
-
onNextYear:
|
|
26
|
-
onYearSelect:
|
|
27
|
-
onMonthClick:
|
|
20
|
+
previousYearLabel: r,
|
|
21
|
+
nextYearLabel: a,
|
|
22
|
+
isMonthSelected: x,
|
|
23
|
+
getMonthRangeProps: R,
|
|
24
|
+
isMonthDisabled: k,
|
|
25
|
+
onPreviousYear: w,
|
|
26
|
+
onNextYear: j,
|
|
27
|
+
onYearSelect: z,
|
|
28
|
+
onMonthClick: E,
|
|
28
29
|
periodLabels: i
|
|
29
30
|
}) {
|
|
30
31
|
return /* @__PURE__ */ d("div", { className: "flex flex-col gap-4 p-3 min-w-[280px]", children: [
|
|
31
32
|
/* @__PURE__ */ d("div", { className: "flex items-center justify-between", children: [
|
|
32
|
-
|
|
33
|
-
|
|
33
|
+
c === 0 ? /* @__PURE__ */ t(
|
|
34
|
+
g,
|
|
34
35
|
{
|
|
35
36
|
variant: "ghost",
|
|
36
37
|
size: "icon",
|
|
37
38
|
className: "h-7 w-7 shrink-0",
|
|
38
|
-
"aria-label":
|
|
39
|
-
title:
|
|
40
|
-
disabled: e <=
|
|
41
|
-
onClick: () =>
|
|
42
|
-
children: /* @__PURE__ */ t(
|
|
39
|
+
"aria-label": r,
|
|
40
|
+
title: r,
|
|
41
|
+
disabled: e <= C,
|
|
42
|
+
onClick: () => w(e),
|
|
43
|
+
children: /* @__PURE__ */ t(f, { size: 16, className: "rotate-180" })
|
|
43
44
|
}
|
|
44
45
|
) : /* @__PURE__ */ t("span", { className: "size-7 shrink-0", "aria-hidden": !0 }),
|
|
45
46
|
/* @__PURE__ */ t("div", { className: "flex flex-1 items-center justify-center", children: /* @__PURE__ */ t(
|
|
46
|
-
|
|
47
|
+
B,
|
|
47
48
|
{
|
|
48
49
|
value: l.find((n) => n.value === e.toString()) ?? {
|
|
49
50
|
label: e.toString(),
|
|
50
51
|
value: e.toString()
|
|
51
52
|
},
|
|
52
53
|
onChange: (n) => {
|
|
53
|
-
n && "value" in n &&
|
|
54
|
+
n && "value" in n && z(parseInt(n.value), c);
|
|
54
55
|
},
|
|
55
56
|
scrollToSelectedOnOpen: !0,
|
|
56
57
|
options: l,
|
|
@@ -59,17 +60,17 @@ function Z({
|
|
|
59
60
|
menuWidth: "140px"
|
|
60
61
|
}
|
|
61
62
|
) }),
|
|
62
|
-
(s === "single" ||
|
|
63
|
-
|
|
63
|
+
(s === "single" || c === 1) && /* @__PURE__ */ t(
|
|
64
|
+
g,
|
|
64
65
|
{
|
|
65
66
|
variant: "ghost",
|
|
66
67
|
size: "icon",
|
|
67
68
|
className: "h-7 w-7",
|
|
68
|
-
"aria-label":
|
|
69
|
-
title:
|
|
70
|
-
disabled: e >=
|
|
71
|
-
onClick: () =>
|
|
72
|
-
children: /* @__PURE__ */ t(
|
|
69
|
+
"aria-label": a,
|
|
70
|
+
title: a,
|
|
71
|
+
disabled: e >= S,
|
|
72
|
+
onClick: () => j(e),
|
|
73
|
+
children: /* @__PURE__ */ t(f, { className: "h-4 w-4" })
|
|
73
74
|
}
|
|
74
75
|
)
|
|
75
76
|
] }),
|
|
@@ -77,23 +78,23 @@ function Z({
|
|
|
77
78
|
"div",
|
|
78
79
|
{
|
|
79
80
|
"data-period-grid": "",
|
|
80
|
-
className:
|
|
81
|
-
children: (i ?? u.map((n) => ({ label: n }))).map((n,
|
|
82
|
-
const m = n.label,
|
|
81
|
+
className: T(F, i ? "grid-cols-3" : "grid-cols-4"),
|
|
82
|
+
children: (i ?? u.map((n) => ({ label: n }))).map((n, o) => {
|
|
83
|
+
const m = n.label, b = x(e, o), { isStart: P, isEnd: A, isMiddle: I } = R(e, o), M = s === "range", h = N ? v : p, _ = W(h) && !!h.to, D = k(e, o), G = "caption" in n && typeof n.caption == "string" ? n.caption : void 0;
|
|
83
84
|
return /* @__PURE__ */ t(
|
|
84
|
-
|
|
85
|
+
q,
|
|
85
86
|
{
|
|
86
|
-
selected:
|
|
87
|
-
disabled:
|
|
88
|
-
isRange:
|
|
89
|
-
isStart:
|
|
90
|
-
isEnd:
|
|
91
|
-
isMiddle:
|
|
92
|
-
hasRangeEnd:
|
|
87
|
+
selected: b,
|
|
88
|
+
disabled: D,
|
|
89
|
+
isRange: M,
|
|
90
|
+
isStart: P,
|
|
91
|
+
isEnd: A,
|
|
92
|
+
isMiddle: I,
|
|
93
|
+
hasRangeEnd: _,
|
|
93
94
|
size: i ? "period" : "month",
|
|
94
95
|
columns: i ? 3 : 4,
|
|
95
|
-
onClick: () =>
|
|
96
|
-
caption:
|
|
96
|
+
onClick: () => E(e, o),
|
|
97
|
+
caption: G,
|
|
97
98
|
children: m
|
|
98
99
|
},
|
|
99
100
|
m
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { FiscalCalendarConfig } from '../../../lib/fiscal-calendar';
|
|
2
|
+
export type FiscalOrphanWeek = {
|
|
3
|
+
fy: number;
|
|
4
|
+
period: number;
|
|
5
|
+
week: number;
|
|
6
|
+
weekStart: string;
|
|
7
|
+
weekEnd: string;
|
|
8
|
+
periodStart: string;
|
|
9
|
+
periodEnd: string;
|
|
10
|
+
weekCount: number;
|
|
11
|
+
dominantMonth: string;
|
|
12
|
+
paneMonth: string;
|
|
13
|
+
side: "leading" | "trailing";
|
|
14
|
+
};
|
|
15
|
+
export declare function retailFiscalConfig(pattern: "4-4-5" | "4-5-4" | "5-4-4", weekStartsOn: 0 | 1, fyStartMonth: number, leapWeekPolicy?: "append-last-period" | "period-13"): FiscalCalendarConfig;
|
|
16
|
+
/** Last week sits fully in November; dominant civil month is October. P2 owns November. */
|
|
17
|
+
export declare const TRAILING_ORPHAN_CUSTOM_TABLE: FiscalCalendarConfig;
|
|
18
|
+
export declare function scanFiscalOrphanWeeks(config: FiscalCalendarConfig, fy: number): FiscalOrphanWeek[];
|
|
19
|
+
export declare function civilDayNumbers(start: string, end: string): string[];
|
|
20
|
+
export declare function parseYearMonth(value: string): {
|
|
21
|
+
year: number;
|
|
22
|
+
monthIndex: number;
|
|
23
|
+
};
|
|
@@ -8,7 +8,9 @@ export declare function weekHasInMonthSelection(week: {
|
|
|
8
8
|
date: Date;
|
|
9
9
|
outside?: boolean;
|
|
10
10
|
}>;
|
|
11
|
-
}, isSelected?: (date: Date) => boolean
|
|
11
|
+
}, isSelected?: (date: Date) => boolean, options?: {
|
|
12
|
+
includeOutside?: boolean;
|
|
13
|
+
}): boolean;
|
|
12
14
|
export declare function weekIntervalContinues(week: {
|
|
13
15
|
days: Array<{
|
|
14
16
|
date: Date;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
function y(e) {
|
|
2
2
|
return e.days.length > 0 && e.days.every((t) => t.outside);
|
|
3
3
|
}
|
|
4
|
-
function g(e, t) {
|
|
5
|
-
return t ? e.days.some(
|
|
4
|
+
function g(e, t, r) {
|
|
5
|
+
return t ? e.days.some(
|
|
6
|
+
(a) => (r?.includeOutside || !a.outside) && t(a.date)
|
|
7
|
+
) : !1;
|
|
6
8
|
}
|
|
7
9
|
function d(e, t) {
|
|
8
10
|
return new Date(e.getFullYear(), e.getMonth(), e.getDate() + t);
|
|
@@ -12,14 +14,14 @@ function c(e, t) {
|
|
|
12
14
|
}
|
|
13
15
|
function h(e, t, r) {
|
|
14
16
|
if (!t) return { prev: !1, next: !1 };
|
|
15
|
-
const a = e.days.find((n) => !n.outside)?.date, o = r?.joinAdjacentWeek ? e.days[0]?.date : e.days.find((n) => !n.outside)?.date,
|
|
17
|
+
const a = e.days.find((n) => !n.outside)?.date, o = r?.joinAdjacentWeek ? e.days[0]?.date : e.days.find((n) => !n.outside)?.date, i = r?.joinAdjacentWeek ? e.days.at(-1)?.date : e.days.filter((n) => !n.outside).at(-1)?.date, f = o ? d(o, -1) : void 0, l = i ? d(i, 1) : void 0, s = (n) => {
|
|
16
18
|
if (!n || !t(n)) return !1;
|
|
17
19
|
const u = r?.periodForDate?.(n);
|
|
18
20
|
return r?.panePeriod != null && u != null ? u !== r.panePeriod : !!(a && c(n, a));
|
|
19
21
|
};
|
|
20
22
|
return {
|
|
21
|
-
prev:
|
|
22
|
-
next:
|
|
23
|
+
prev: s(f),
|
|
24
|
+
next: s(l)
|
|
23
25
|
};
|
|
24
26
|
}
|
|
25
27
|
export {
|
|
@@ -1,78 +1,77 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as f, jsx as d } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { cn as
|
|
4
|
-
import { Button as
|
|
5
|
-
import { intervalCaptionClassName as
|
|
6
|
-
import {
|
|
7
|
-
import { periodCellKind as
|
|
8
|
-
import { handlePeriodGridKeyDown as
|
|
9
|
-
const
|
|
3
|
+
import { cn as t } from "../../../lib/utils.js";
|
|
4
|
+
import { Button as g } from "../../primitives/button/button.js";
|
|
5
|
+
import { intervalCaptionClassName as y } from "./calendar-interval-caption.js";
|
|
6
|
+
import { periodRangeTrackPositionClassName as v, periodRangeTrackClassName as T, periodTileInsetClassName as k, periodTileAppearanceClassName as j, rangeStartCellClassName as q, rangeEndCellClassName as K, rangeMiddleCellClassName as P } from "./calendar-selection-appearance.js";
|
|
7
|
+
import { periodCellKind as A } from "./calendar-selection.js";
|
|
8
|
+
import { handlePeriodGridKeyDown as D } from "./calendar-period-keyboard.js";
|
|
9
|
+
const I = {
|
|
10
10
|
month: "h-10 w-10",
|
|
11
|
-
period: "min-h-16 h-auto w-
|
|
12
|
-
quarter: "h-16 min-h-16 max-h-16
|
|
13
|
-
year: "h-10 min-h-10 max-h-10
|
|
14
|
-
"year-caption": "h-16 min-h-16 max-h-16
|
|
11
|
+
period: "min-h-16 h-auto min-w-0 flex-col items-center justify-center px-1 py-1",
|
|
12
|
+
quarter: "h-16 min-h-16 max-h-16 min-w-0 flex-col items-center justify-center overflow-hidden whitespace-normal p-2 leading-tight",
|
|
13
|
+
year: "h-10 min-h-10 max-h-10 min-w-0 overflow-hidden",
|
|
14
|
+
"year-caption": "h-16 min-h-16 max-h-16 min-w-0 flex-col items-center justify-center gap-0.5 overflow-hidden whitespace-normal p-2 text-xs leading-tight"
|
|
15
15
|
};
|
|
16
|
-
function
|
|
17
|
-
selected:
|
|
16
|
+
function O({
|
|
17
|
+
selected: C,
|
|
18
18
|
disabled: n = !1,
|
|
19
19
|
isRange: i = !1,
|
|
20
|
-
isStart:
|
|
21
|
-
isEnd:
|
|
22
|
-
isMiddle:
|
|
23
|
-
hasRangeEnd:
|
|
20
|
+
isStart: e = !1,
|
|
21
|
+
isEnd: a = !1,
|
|
22
|
+
isMiddle: s = !1,
|
|
23
|
+
hasRangeEnd: w = !1,
|
|
24
24
|
size: l,
|
|
25
|
-
onClick:
|
|
26
|
-
onKeyDown:
|
|
27
|
-
children:
|
|
25
|
+
onClick: u,
|
|
26
|
+
onKeyDown: N,
|
|
27
|
+
children: x,
|
|
28
28
|
caption: m,
|
|
29
|
-
columns:
|
|
29
|
+
columns: c
|
|
30
30
|
}) {
|
|
31
|
-
const
|
|
32
|
-
return /* @__PURE__ */
|
|
31
|
+
const r = A({ selected: C, isRange: i, isStart: e, isEnd: a, isMiddle: s }), p = i && w && (s || e || a) && !n, o = l === "month";
|
|
32
|
+
return /* @__PURE__ */ f(
|
|
33
33
|
"div",
|
|
34
34
|
{
|
|
35
|
-
className:
|
|
35
|
+
className: t(
|
|
36
36
|
"group relative flex w-full items-center justify-center",
|
|
37
|
-
l === "period" || l === "quarter" || l === "year-caption" ? "min-h-16" : "h-10"
|
|
37
|
+
l === "period" || l === "quarter" || l === "year-caption" ? "min-h-16" : "h-10",
|
|
38
|
+
!o && p && !(e && a) && (e ? q : a ? K : P)
|
|
38
39
|
),
|
|
39
40
|
children: [
|
|
40
|
-
|
|
41
|
+
o && p ? /* @__PURE__ */ d(
|
|
41
42
|
"div",
|
|
42
43
|
{
|
|
43
|
-
className:
|
|
44
|
+
className: t(
|
|
44
45
|
"absolute inset-y-0",
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
t && !r && e("left-1/2 right-0", c && "-ml-5", T),
|
|
48
|
-
r && !t && e("right-1/2 left-0", c && "-mr-5", g),
|
|
49
|
-
o && "inset-x-0"
|
|
46
|
+
T,
|
|
47
|
+
v({ isStart: e, isEnd: a })
|
|
50
48
|
)
|
|
51
49
|
}
|
|
52
50
|
) : null,
|
|
53
|
-
/* @__PURE__ */
|
|
54
|
-
|
|
51
|
+
/* @__PURE__ */ f(
|
|
52
|
+
g,
|
|
55
53
|
{
|
|
56
54
|
variant: "ghost",
|
|
57
|
-
onClick:
|
|
55
|
+
onClick: u,
|
|
58
56
|
onKeyDown: (h) => {
|
|
59
|
-
|
|
57
|
+
c && D(h, c), N?.(h);
|
|
60
58
|
},
|
|
61
59
|
disabled: n,
|
|
62
|
-
"data-selection":
|
|
60
|
+
"data-selection": r,
|
|
63
61
|
"data-period-tile": "",
|
|
64
|
-
className:
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
className: t(
|
|
63
|
+
j({ kind: r, disabled: n }),
|
|
64
|
+
I[l],
|
|
65
|
+
!o && k
|
|
67
66
|
),
|
|
68
67
|
children: [
|
|
69
|
-
|
|
70
|
-
m ? /* @__PURE__ */
|
|
68
|
+
x,
|
|
69
|
+
m ? /* @__PURE__ */ d(
|
|
71
70
|
"span",
|
|
72
71
|
{
|
|
73
72
|
"data-slot": "interval-caption",
|
|
74
|
-
className:
|
|
75
|
-
|
|
73
|
+
className: y(
|
|
74
|
+
r === "point" || r === "interval-start" || r === "interval-end"
|
|
76
75
|
),
|
|
77
76
|
children: m
|
|
78
77
|
}
|
|
@@ -85,5 +84,5 @@ function P({
|
|
|
85
84
|
);
|
|
86
85
|
}
|
|
87
86
|
export {
|
|
88
|
-
|
|
87
|
+
O as CalendarPeriodCell
|
|
89
88
|
};
|