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,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
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Option } from '../../forms/select';
|
|
2
|
+
import { Granularity } from '../../../lib/fiscal-calendar';
|
|
2
3
|
import { MonthRange, MonthSelection } from './calendar.types';
|
|
3
4
|
export declare function isSameMonth(m1: MonthSelection, m2: MonthSelection): boolean;
|
|
4
5
|
export declare function nextMonthSelection(selection: MonthSelection, prev: MonthSelection | MonthSelection[] | MonthRange | undefined, monthMode: "single" | "multiple" | "range"): MonthSelection | MonthSelection[] | MonthRange | undefined;
|
|
@@ -10,6 +11,10 @@ export declare function getMonthRangeProps(year: number, month: number, currentS
|
|
|
10
11
|
};
|
|
11
12
|
/** True when the interval lies completely outside `disabled.before` / `disabled.after`. */
|
|
12
13
|
export declare function isDateIntervalDisabled(start: Date, end: Date, disabled?: unknown): boolean;
|
|
14
|
+
/** True when every day of `[start, end]` is inside `disabled.before` / `disabled.after`. */
|
|
15
|
+
export declare function isWeekFullyInsideBounds(start: Date, end: Date, disabled?: unknown): boolean;
|
|
16
|
+
/** Week granularity requires every day in bounds; other granularities allow mixed weeks. */
|
|
17
|
+
export declare function isWeekSelectableInBounds(start: Date, end: Date, disabled?: unknown, granularity?: Granularity): boolean;
|
|
13
18
|
export declare function isMonthDisabled(year: number, monthIndex: number, disabled?: unknown): boolean;
|
|
14
19
|
export declare function getAvailableYears(startMonth: Date, endMonth: Date): Option[];
|
|
15
20
|
export declare function getAvailableMonths(year: number, monthsFull: string[], startMonth: Date, endMonth: Date): Option[];
|
|
@@ -1,97 +1,118 @@
|
|
|
1
|
-
import { isMonthRangeSelection as
|
|
2
|
-
function
|
|
3
|
-
return
|
|
1
|
+
import { isMonthRangeSelection as c } from "../../forms/date-picker/calendar-selection-adapters.js";
|
|
2
|
+
function u(t, n) {
|
|
3
|
+
return t.fy != null && n.fy != null && t.period != null && n.period != null ? t.fy === n.fy && t.period === n.period : t.year === n.year && t.month === n.month;
|
|
4
4
|
}
|
|
5
|
-
function g(
|
|
6
|
-
if (o === "single") return
|
|
5
|
+
function g(t, n, o) {
|
|
6
|
+
if (o === "single") return t;
|
|
7
7
|
if (o === "multiple") {
|
|
8
|
-
const
|
|
9
|
-
return
|
|
8
|
+
const r = n || [];
|
|
9
|
+
return r.some((i) => u(i, t)) ? r.filter((i) => !u(i, t)) : [...r, t];
|
|
10
10
|
}
|
|
11
|
-
const
|
|
12
|
-
if (!
|
|
13
|
-
const s = new Date(
|
|
14
|
-
return new Date(
|
|
11
|
+
const e = n;
|
|
12
|
+
if (!e?.from || e.to) return { from: t };
|
|
13
|
+
const s = new Date(e.from.year, e.from.month, 1);
|
|
14
|
+
return new Date(t.year, t.month, 1) < s ? { from: t, to: e.from } : { from: e.from, to: t };
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function w(t, n, o) {
|
|
17
17
|
if (!o) return !1;
|
|
18
18
|
if (Array.isArray(o)) {
|
|
19
|
-
const s = { year:
|
|
20
|
-
return o.some((
|
|
19
|
+
const s = { year: t, month: n, fy: t, period: n + 1 };
|
|
20
|
+
return o.some((a) => u(a, s) || a.year === t && a.month === n);
|
|
21
21
|
}
|
|
22
|
-
if (
|
|
23
|
-
const s = o,
|
|
24
|
-
if (!
|
|
25
|
-
const
|
|
26
|
-
if (!
|
|
27
|
-
const
|
|
28
|
-
if (!
|
|
29
|
-
const
|
|
30
|
-
return
|
|
22
|
+
if (c(o)) {
|
|
23
|
+
const s = o, a = s.from, r = s.to;
|
|
24
|
+
if (!a && !r) return !1;
|
|
25
|
+
const f = new Date(t, n, 1).getTime();
|
|
26
|
+
if (!a) return r ? f === new Date(r.year, r.month, 1).getTime() : !1;
|
|
27
|
+
const i = new Date(a.year, a.month, 1).getTime();
|
|
28
|
+
if (!r) return f === i;
|
|
29
|
+
const d = new Date(r.year, r.month, 1).getTime();
|
|
30
|
+
return f >= i && f <= d;
|
|
31
31
|
}
|
|
32
|
-
const
|
|
33
|
-
return
|
|
32
|
+
const e = o;
|
|
33
|
+
return e.fy != null && e.period != null ? e.fy === t && e.period === n + 1 : e.year === t && e.month === n;
|
|
34
34
|
}
|
|
35
|
-
function y(
|
|
35
|
+
function y(t, n, o) {
|
|
36
36
|
if (!o || !("from" in o))
|
|
37
37
|
return { isStart: !1, isEnd: !1, isMiddle: !1 };
|
|
38
|
-
const
|
|
39
|
-
if (!s && !
|
|
40
|
-
const
|
|
38
|
+
const e = o, s = e.from, a = e.to;
|
|
39
|
+
if (!s && !a) return { isStart: !1, isEnd: !1, isMiddle: !1 };
|
|
40
|
+
const r = new Date(t, n, 1).getTime();
|
|
41
41
|
if (!s)
|
|
42
42
|
return {
|
|
43
43
|
isStart: !1,
|
|
44
|
-
isEnd:
|
|
44
|
+
isEnd: a ? r === new Date(a.year, a.month, 1).getTime() : !1,
|
|
45
45
|
isMiddle: !1
|
|
46
46
|
};
|
|
47
|
-
const
|
|
48
|
-
if (!
|
|
49
|
-
const
|
|
47
|
+
const f = new Date(s.year, s.month, 1).getTime();
|
|
48
|
+
if (!a) return { isStart: r === f, isEnd: !1, isMiddle: !1 };
|
|
49
|
+
const i = new Date(a.year, a.month, 1).getTime();
|
|
50
50
|
return {
|
|
51
|
-
isStart:
|
|
52
|
-
isEnd:
|
|
53
|
-
isMiddle:
|
|
51
|
+
isStart: r === f,
|
|
52
|
+
isEnd: r === i,
|
|
53
|
+
isMiddle: r > f && r < i
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
|
-
function
|
|
57
|
-
const
|
|
58
|
-
if (!
|
|
59
|
-
const s = new Date(
|
|
56
|
+
function l(t, n, o) {
|
|
57
|
+
const e = o;
|
|
58
|
+
if (!e || typeof e != "object" || !("before" in e) && !("after" in e)) return !1;
|
|
59
|
+
const s = new Date(t);
|
|
60
60
|
s.setHours(0, 0, 0, 0);
|
|
61
|
-
const
|
|
62
|
-
if (
|
|
63
|
-
const
|
|
64
|
-
if (
|
|
61
|
+
const a = new Date(n);
|
|
62
|
+
if (a.setHours(23, 59, 59, 999), e.before) {
|
|
63
|
+
const r = new Date(e.before);
|
|
64
|
+
if (r.setHours(0, 0, 0, 0), a < r) return !0;
|
|
65
65
|
}
|
|
66
|
-
if (
|
|
67
|
-
const
|
|
68
|
-
if (
|
|
66
|
+
if (e.after) {
|
|
67
|
+
const r = new Date(e.after);
|
|
68
|
+
if (r.setHours(23, 59, 59, 999), s > r) return !0;
|
|
69
69
|
}
|
|
70
70
|
return !1;
|
|
71
71
|
}
|
|
72
|
-
function
|
|
73
|
-
const
|
|
74
|
-
|
|
72
|
+
function D(t, n, o) {
|
|
73
|
+
const e = o;
|
|
74
|
+
if (!e || typeof e != "object" || !("before" in e) && !("after" in e)) return !0;
|
|
75
|
+
const s = new Date(t);
|
|
76
|
+
s.setHours(0, 0, 0, 0);
|
|
77
|
+
const a = new Date(n);
|
|
78
|
+
if (a.setHours(0, 0, 0, 0), e.before) {
|
|
79
|
+
const r = new Date(e.before);
|
|
80
|
+
if (r.setHours(0, 0, 0, 0), s < r) return !1;
|
|
81
|
+
}
|
|
82
|
+
if (e.after) {
|
|
83
|
+
const r = new Date(e.after);
|
|
84
|
+
if (r.setHours(0, 0, 0, 0), a > r) return !1;
|
|
85
|
+
}
|
|
86
|
+
return !0;
|
|
87
|
+
}
|
|
88
|
+
function b(t, n, o, e) {
|
|
89
|
+
return e && e !== "week" ? !l(t, n, o) : D(t, n, o);
|
|
90
|
+
}
|
|
91
|
+
function h(t, n, o) {
|
|
92
|
+
const e = new Date(t, n, 1, 0, 0, 0, 0), s = new Date(t, n + 1, 0, 23, 59, 59, 999);
|
|
93
|
+
return l(e, s, o);
|
|
75
94
|
}
|
|
76
|
-
function
|
|
77
|
-
const o =
|
|
78
|
-
for (let
|
|
79
|
-
s.push({ label:
|
|
95
|
+
function p(t, n) {
|
|
96
|
+
const o = t.getFullYear(), e = n.getFullYear(), s = [];
|
|
97
|
+
for (let a = o; a <= e; a++)
|
|
98
|
+
s.push({ label: a.toString(), value: a.toString() });
|
|
80
99
|
return s;
|
|
81
100
|
}
|
|
82
|
-
function
|
|
83
|
-
return n.map((s,
|
|
84
|
-
const
|
|
85
|
-
return !(
|
|
101
|
+
function M(t, n, o, e) {
|
|
102
|
+
return n.map((s, a) => ({ label: s, value: a.toString() })).filter((s, a) => {
|
|
103
|
+
const r = new Date(t, a, 1);
|
|
104
|
+
return !(r < new Date(o.getFullYear(), o.getMonth(), 1) || r > new Date(e.getFullYear(), e.getMonth(), 1));
|
|
86
105
|
});
|
|
87
106
|
}
|
|
88
107
|
export {
|
|
89
|
-
|
|
90
|
-
|
|
108
|
+
M as getAvailableMonths,
|
|
109
|
+
p as getAvailableYears,
|
|
91
110
|
y as getMonthRangeProps,
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
111
|
+
l as isDateIntervalDisabled,
|
|
112
|
+
h as isMonthDisabled,
|
|
113
|
+
w as isMonthSelected,
|
|
114
|
+
u as isSameMonth,
|
|
115
|
+
D as isWeekFullyInsideBounds,
|
|
116
|
+
b as isWeekSelectableInBounds,
|
|
96
117
|
g as nextMonthSelection
|
|
97
118
|
};
|
|
@@ -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
|
};
|