impact-nova 2.5.7 → 2.5.8
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/ag-grid-react/ag-grid.types.d.ts +2 -2
- package/dist/components/data/ag-grid-react/headers/components/date-filter-picker.d.ts +4 -2
- package/dist/components/data/ag-grid-react/headers/header-search-input.js +65 -65
- package/dist/components/data/ag-grid-react/headers/utils/date-utils.js +55 -48
- package/dist/components/data-display/calendar/calendar-apply-validation.d.ts +4 -2
- package/dist/components/data-display/calendar/calendar-apply-validation.js +80 -61
- package/dist/components/data-display/calendar/calendar-config.d.ts +13 -5
- package/dist/components/data-display/calendar/calendar-config.js +31 -20
- package/dist/components/data-display/calendar/calendar-day-button.js +43 -35
- package/dist/components/data-display/calendar/calendar-day-hover.d.ts +8 -0
- package/dist/components/data-display/calendar/calendar-day-hover.js +20 -0
- package/dist/components/data-display/calendar/calendar-day-picker-classnames.d.ts +8 -1
- package/dist/components/data-display/calendar/calendar-day-picker-classnames.js +40 -20
- package/dist/components/data-display/calendar/calendar-day-picker-components.d.ts +12 -1
- package/dist/components/data-display/calendar/calendar-day-picker-components.js +201 -108
- package/dist/components/data-display/calendar/calendar-day-picker-view.d.ts +11 -3
- package/dist/components/data-display/calendar/calendar-day-picker-view.js +136 -92
- package/dist/components/data-display/calendar/calendar-fiscal-labels.d.ts +38 -0
- package/dist/components/data-display/calendar/calendar-fiscal-labels.js +90 -0
- package/dist/components/data-display/calendar/calendar-footer-summary.d.ts +13 -4
- package/dist/components/data-display/calendar/calendar-footer-summary.js +101 -50
- package/dist/components/data-display/calendar/calendar-footer.d.ts +16 -7
- package/dist/components/data-display/calendar/calendar-footer.js +88 -66
- package/dist/components/data-display/calendar/calendar-gregorian-presets.d.ts +2 -0
- package/dist/components/data-display/calendar/calendar-gregorian-presets.js +26 -0
- package/dist/components/data-display/calendar/calendar-interval-caption.d.ts +1 -0
- package/dist/components/data-display/calendar/calendar-interval-caption.js +10 -0
- package/dist/components/data-display/calendar/calendar-interval-utils.d.ts +23 -0
- package/dist/components/data-display/calendar/calendar-interval-utils.js +154 -0
- package/dist/components/data-display/calendar/calendar-month-panes.d.ts +5 -1
- package/dist/components/data-display/calendar/calendar-month-panes.js +9 -7
- package/dist/components/data-display/calendar/calendar-month-picker-panel.d.ts +5 -1
- package/dist/components/data-display/calendar/calendar-month-picker-panel.js +76 -77
- package/dist/components/data-display/calendar/calendar-month-utils.d.ts +2 -0
- package/dist/components/data-display/calendar/calendar-month-utils.js +69 -60
- package/dist/components/data-display/calendar/calendar-padding-week.utils.d.ts +15 -0
- package/dist/components/data-display/calendar/calendar-padding-week.utils.js +22 -3
- package/dist/components/data-display/calendar/calendar-panel-context.d.ts +1 -1
- package/dist/components/data-display/calendar/calendar-period-cell.d.ts +18 -0
- package/dist/components/data-display/calendar/calendar-period-cell.js +89 -0
- package/dist/components/data-display/calendar/calendar-period-keyboard.d.ts +2 -0
- package/dist/components/data-display/calendar/calendar-period-keyboard.js +18 -0
- package/dist/components/data-display/calendar/calendar-preset-strip.d.ts +6 -0
- package/dist/components/data-display/calendar/calendar-preset-strip.js +26 -0
- package/dist/components/data-display/calendar/calendar-quarter-panes.d.ts +24 -0
- package/dist/components/data-display/calendar/calendar-quarter-panes.js +115 -0
- package/dist/components/data-display/calendar/calendar-quarter-utils.d.ts +19 -0
- package/dist/components/data-display/calendar/calendar-quarter-utils.js +95 -0
- package/dist/components/data-display/calendar/calendar-selection-appearance.d.ts +38 -0
- package/dist/components/data-display/calendar/calendar-selection-appearance.js +72 -0
- package/dist/components/data-display/calendar/calendar-selection.d.ts +20 -0
- package/dist/components/data-display/calendar/calendar-selection.js +31 -0
- package/dist/components/data-display/calendar/calendar-week-number-cell.d.ts +6 -1
- package/dist/components/data-display/calendar/calendar-week-number-cell.js +53 -38
- package/dist/components/data-display/calendar/calendar-week-number-header.d.ts +4 -0
- package/dist/components/data-display/calendar/calendar-week-number-header.js +15 -0
- package/dist/components/data-display/calendar/calendar-week-utils.d.ts +11 -3
- package/dist/components/data-display/calendar/calendar-week-utils.js +49 -42
- package/dist/components/data-display/calendar/calendar-year-panes.d.ts +18 -0
- package/dist/components/data-display/calendar/calendar-year-panes.js +98 -0
- package/dist/components/data-display/calendar/calendar-year-utils.d.ts +17 -0
- package/dist/components/data-display/calendar/calendar-year-utils.js +75 -0
- package/dist/components/data-display/calendar/calendar.d.ts +1 -1
- package/dist/components/data-display/calendar/calendar.js +303 -181
- package/dist/components/data-display/calendar/calendar.types.d.ts +53 -16
- package/dist/components/data-display/calendar/fiscal-period-caption-select.d.ts +7 -0
- package/dist/components/data-display/calendar/fiscal-period-caption-select.js +63 -0
- package/dist/components/data-display/calendar/index.d.ts +1 -1
- package/dist/components/data-display/calendar/use-calendar-day-picker-config.d.ts +12 -2
- package/dist/components/data-display/calendar/use-calendar-day-picker-config.js +92 -62
- package/dist/components/data-display/calendar/use-calendar-state.d.ts +31 -11
- package/dist/components/data-display/calendar/use-calendar-state.js +370 -163
- package/dist/components/data-display/calendar/use-fiscal-calendar.d.ts +5 -0
- package/dist/components/data-display/calendar/use-fiscal-calendar.js +24 -0
- package/dist/components/feedback/tooltip/overflow-tooltip.js +57 -57
- package/dist/components/forms/date-picker/date-input-behavior.d.ts +7 -0
- package/dist/components/forms/date-picker/date-input-behavior.js +28 -24
- package/dist/components/forms/date-picker/date-picker-shell.d.ts +13 -0
- package/dist/components/forms/date-picker/date-picker-shell.js +31 -0
- package/dist/components/forms/date-picker/date-picker.js +187 -167
- package/dist/components/forms/date-picker/date-picker.types.d.ts +90 -43
- package/dist/components/forms/date-picker/date-range-picker.js +273 -224
- package/dist/components/forms/date-picker/fiscal-pass-through.d.ts +13 -0
- package/dist/components/forms/date-picker/fiscal-pass-through.js +17 -0
- package/dist/components/forms/date-picker/fiscal-period-format.d.ts +9 -0
- package/dist/components/forms/date-picker/fiscal-period-format.js +50 -0
- package/dist/components/forms/date-picker/index.d.ts +12 -0
- package/dist/components/forms/date-picker/index.js +19 -7
- package/dist/components/forms/date-picker/month-picker.js +225 -182
- package/dist/components/forms/date-picker/month-range-picker.js +134 -110
- package/dist/components/forms/date-picker/multi-date-picker.js +77 -56
- package/dist/components/forms/date-picker/multi-month-picker.js +78 -57
- package/dist/components/forms/date-picker/multi-quarter-picker.d.ts +3 -0
- package/dist/components/forms/date-picker/multi-quarter-picker.js +177 -0
- package/dist/components/forms/date-picker/multi-week-picker.js +81 -70
- package/dist/components/forms/date-picker/multi-year-picker.d.ts +3 -0
- package/dist/components/forms/date-picker/multi-year-picker.js +179 -0
- package/dist/components/forms/date-picker/quarter-picker.d.ts +3 -0
- package/dist/components/forms/date-picker/quarter-picker.js +176 -0
- package/dist/components/forms/date-picker/quarter-range-picker.d.ts +3 -0
- package/dist/components/forms/date-picker/quarter-range-picker.js +177 -0
- package/dist/components/forms/date-picker/week-picker.js +148 -137
- package/dist/components/forms/date-picker/week-range-picker.js +216 -205
- package/dist/components/forms/date-picker/year-picker.d.ts +3 -0
- package/dist/components/forms/date-picker/year-picker.js +176 -0
- package/dist/components/forms/date-picker/year-range-picker.d.ts +3 -0
- package/dist/components/forms/date-picker/year-range-picker.js +179 -0
- package/dist/form-react/Fields/DateInputField.js +63 -58
- package/dist/form-react/Fields/DateRangeField.js +42 -37
- package/dist/form-react/Fields/MonthRangeField.js +50 -45
- package/dist/form-react/Fields/MultiWeekPickerField.js +7 -7
- package/dist/form-react/Fields/WeekRangePicker.js +44 -45
- package/dist/form-react/components/FieldRenderer.js +21 -23
- package/dist/form-react/registry/defaultFieldRegistrations.d.ts +9 -1
- package/dist/form-react/registry/defaultFieldRegistrations.js +27 -36
- package/dist/form-react/registry/resolveFieldComponent.d.ts +3 -2
- package/dist/form-react/registry/resolveFieldComponent.js +9 -133
- package/dist/form-react/types/fields.types.d.ts +19 -4
- package/dist/form-react/utils/date.utils.d.ts +1 -1
- package/dist/form-react/utils/date.utils.js +38 -38
- package/dist/i18n/defaultMessages.d.ts +19 -1
- package/dist/i18n/defaultMessages.js +37 -20
- package/dist/i18n/locales/de.js +18 -1
- package/dist/i18n/locales/es.js +18 -1
- package/dist/i18n/locales/hi.js +18 -1
- package/dist/i18n/locales/kn.js +18 -1
- package/dist/impact-nova-components.css +379 -3
- package/dist/impact-nova.css +1 -1
- package/dist/index.js +528 -516
- package/dist/lib/fiscal-calendar/build-year.d.ts +8 -0
- package/dist/lib/fiscal-calendar/build-year.js +173 -0
- package/dist/lib/fiscal-calendar/civil-date.d.ts +21 -0
- package/dist/lib/fiscal-calendar/civil-date.js +94 -0
- package/dist/lib/fiscal-calendar/index.d.ts +10 -0
- package/dist/lib/fiscal-calendar/index.js +40 -0
- package/dist/lib/fiscal-calendar/lookup.d.ts +4 -0
- package/dist/lib/fiscal-calendar/lookup.js +70 -0
- package/dist/lib/fiscal-calendar/presets.d.ts +8 -0
- package/dist/lib/fiscal-calendar/presets.js +99 -0
- package/dist/lib/fiscal-calendar/selection.d.ts +18 -0
- package/dist/lib/fiscal-calendar/selection.js +32 -0
- package/dist/lib/fiscal-calendar/types.d.ts +145 -0
- package/dist/lib/fiscal-calendar/types.js +10 -0
- package/dist/lib/fiscal-calendar/week-selection.d.ts +22 -0
- package/dist/lib/fiscal-calendar/week-selection.js +107 -0
- package/package.json +5 -1
- package/dist/lib/fiscal-calendar.d.ts +0 -62
- package/dist/lib/fiscal-calendar.js +0 -99
|
@@ -1,87 +1,109 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as f, jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { cn as
|
|
4
|
-
import { Button as
|
|
5
|
-
import { formatDateRangeFooterSummary as
|
|
6
|
-
const
|
|
3
|
+
import { cn as u } from "../../../lib/utils.js";
|
|
4
|
+
import { Button as d } from "../../primitives/button/button.js";
|
|
5
|
+
import { formatDateRangeFooterSummary as w, formatWeekFooterSummary as z, formatMonthFooterSummary as Y, formatQuarterFooterSummary as G, formatYearFooterSummary as I } from "./calendar-footer-summary.js";
|
|
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
|
};
|
|
9
|
-
function
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
9
|
+
function a({
|
|
10
|
+
selectedLabel: t,
|
|
11
|
+
children: n
|
|
12
|
+
}) {
|
|
13
|
+
return /* @__PURE__ */ f(
|
|
14
|
+
"div",
|
|
15
|
+
{
|
|
16
|
+
className: "flex flex-row items-center gap-1 text-xs font-medium leading-[18px] text-content-tertiary",
|
|
17
|
+
"aria-live": "polite",
|
|
18
|
+
"aria-atomic": "true",
|
|
19
|
+
children: [
|
|
20
|
+
t,
|
|
21
|
+
/* @__PURE__ */ l("span", { className: "font-semibold text-content", children: n })
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
function O({
|
|
27
|
+
pickerType: t,
|
|
28
|
+
mode: n,
|
|
29
|
+
weekMode: i,
|
|
30
|
+
monthMode: r,
|
|
31
|
+
yearMode: s = "single",
|
|
32
|
+
calendarKind: S,
|
|
33
|
+
granularity: v,
|
|
34
|
+
resolvedFiscalPattern: B,
|
|
35
|
+
fiscalConfig: x,
|
|
36
|
+
pendingSelection: L,
|
|
37
|
+
pendingWeekSelection: y,
|
|
38
|
+
pendingMonthSelection: F,
|
|
39
|
+
pendingQuarterSelection: N,
|
|
40
|
+
pendingYearSelection: P,
|
|
41
|
+
multiRangeSummary: g,
|
|
42
|
+
disableApply: C,
|
|
43
|
+
isApplyDisabled: H,
|
|
44
|
+
footerFlashKey: c = 0,
|
|
45
|
+
footerFlashTarget: p,
|
|
24
46
|
labels: e,
|
|
25
|
-
onClear:
|
|
26
|
-
onCancel:
|
|
27
|
-
onApply:
|
|
47
|
+
onClear: j,
|
|
48
|
+
onCancel: q,
|
|
49
|
+
onApply: A
|
|
28
50
|
}) {
|
|
29
|
-
const
|
|
30
|
-
return /* @__PURE__ */
|
|
51
|
+
const _ = t === "month" && r !== "single" || t === "quarter" && r !== "single" || t === "year" && s !== "single" || n === "range" || n === "multi-range" || i === "range" || i === "multiple", m = c > 0 && p === "cancel", o = c > 0 && p === "apply";
|
|
52
|
+
return /* @__PURE__ */ f(
|
|
31
53
|
"div",
|
|
32
54
|
{
|
|
33
|
-
className:
|
|
55
|
+
className: u(
|
|
34
56
|
"flex items-center gap-2 border-t p-3 pt-3",
|
|
35
|
-
|
|
57
|
+
_ ? "justify-between" : "justify-end"
|
|
36
58
|
),
|
|
37
59
|
children: [
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
e.
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
/* @__PURE__ */
|
|
59
|
-
/* @__PURE__ */
|
|
60
|
-
/* @__PURE__ */
|
|
61
|
-
|
|
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: w(L) }) : null,
|
|
62
|
+
t === "week" && (i === "range" || i === "multiple") ? /* @__PURE__ */ l(a, { selectedLabel: e.selected, children: z({
|
|
63
|
+
selection: y,
|
|
64
|
+
calendarKind: S,
|
|
65
|
+
granularity: v,
|
|
66
|
+
fiscalConfig: x
|
|
67
|
+
}) }) : null,
|
|
68
|
+
t === "month" && (r === "range" || r === "multiple") ? /* @__PURE__ */ l(a, { selectedLabel: e.selected, children: Y(F, {
|
|
69
|
+
single: e.monthSingle,
|
|
70
|
+
plural: e.monthPlural
|
|
71
|
+
}) }) : null,
|
|
72
|
+
t === "quarter" && (r === "range" || r === "multiple") ? /* @__PURE__ */ l(a, { selectedLabel: e.selected, children: G(N, {
|
|
73
|
+
single: e.quarterSingle,
|
|
74
|
+
plural: e.quarterPlural
|
|
75
|
+
}) }) : null,
|
|
76
|
+
t === "year" && (s === "range" || s === "multiple") ? /* @__PURE__ */ l(a, { selectedLabel: e.selected, children: I(P, {
|
|
77
|
+
single: e.yearSingle,
|
|
78
|
+
plural: e.yearPlural
|
|
79
|
+
}) }) : null,
|
|
80
|
+
/* @__PURE__ */ f("div", { className: "flex items-center gap-2", children: [
|
|
81
|
+
/* @__PURE__ */ l(d, { variant: "link", size: "md", onClick: j, children: e.clear }),
|
|
82
|
+
/* @__PURE__ */ l(
|
|
83
|
+
d,
|
|
62
84
|
{
|
|
63
85
|
variant: "outline",
|
|
64
|
-
size: "
|
|
65
|
-
"data-footer-flash":
|
|
66
|
-
className:
|
|
67
|
-
onClick:
|
|
86
|
+
size: "md",
|
|
87
|
+
"data-footer-flash": m ? "cancel" : void 0,
|
|
88
|
+
className: u(m && h),
|
|
89
|
+
onClick: q,
|
|
68
90
|
children: e.cancel
|
|
69
91
|
},
|
|
70
|
-
|
|
92
|
+
m ? `footer-cancel-${c}` : "footer-cancel"
|
|
71
93
|
),
|
|
72
|
-
/* @__PURE__ */
|
|
73
|
-
|
|
94
|
+
/* @__PURE__ */ l(
|
|
95
|
+
d,
|
|
74
96
|
{
|
|
75
97
|
variant: "default",
|
|
76
|
-
size: "
|
|
77
|
-
"data-footer-flash":
|
|
78
|
-
style:
|
|
79
|
-
className:
|
|
80
|
-
onClick:
|
|
81
|
-
disabled:
|
|
98
|
+
size: "md",
|
|
99
|
+
"data-footer-flash": o ? "apply" : void 0,
|
|
100
|
+
style: o ? $ : void 0,
|
|
101
|
+
className: u(o && h),
|
|
102
|
+
onClick: A,
|
|
103
|
+
disabled: C || H,
|
|
82
104
|
children: e.apply
|
|
83
105
|
},
|
|
84
|
-
|
|
106
|
+
o ? `footer-apply-${c}` : "footer-apply"
|
|
85
107
|
)
|
|
86
108
|
] })
|
|
87
109
|
]
|
|
@@ -89,5 +111,5 @@ function $({
|
|
|
89
111
|
);
|
|
90
112
|
}
|
|
91
113
|
export {
|
|
92
|
-
|
|
114
|
+
O as CalendarFooter
|
|
93
115
|
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { parseCivilDate as b, addDays as i, toCivilDate as r, lastDayOfMonth as d } from "../../../lib/fiscal-calendar/civil-date.js";
|
|
2
|
+
function e(t, a, s) {
|
|
3
|
+
return { start: t, end: a, granularity: s };
|
|
4
|
+
}
|
|
5
|
+
function M(t) {
|
|
6
|
+
const { y: a, m: s } = b(t), n = i(t, -1), o = i(t, -6), y = i(t, -29), h = r(a, s, 1), c = d(a, s), l = s === 1 ? { y: a - 1, m: 12 } : { y: a, m: s - 1 }, m = r(l.y, l.m, 1), v = d(l.y, l.m);
|
|
7
|
+
return [
|
|
8
|
+
{ id: "today", label: "Today", interval: e(t, t, "day") },
|
|
9
|
+
{ id: "yesterday", label: "Yesterday", interval: e(n, n, "day") },
|
|
10
|
+
{ id: "last-7-days", label: "Last 7 days", interval: e(o, t, "day") },
|
|
11
|
+
{ id: "last-30-days", label: "Last 30 days", interval: e(y, t, "day") },
|
|
12
|
+
{
|
|
13
|
+
id: "this-month",
|
|
14
|
+
label: "This month",
|
|
15
|
+
interval: e(h, c, "period")
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
id: "last-month",
|
|
19
|
+
label: "Last month",
|
|
20
|
+
interval: e(m, v, "period")
|
|
21
|
+
}
|
|
22
|
+
];
|
|
23
|
+
}
|
|
24
|
+
export {
|
|
25
|
+
M as getGregorianPresets
|
|
26
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function intervalCaptionClassName(selected: boolean): string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { cn as e } from "../../../lib/utils.js";
|
|
2
|
+
function r(t) {
|
|
3
|
+
return e(
|
|
4
|
+
"block w-full whitespace-normal text-center text-[10px] font-normal leading-tight",
|
|
5
|
+
t ? "text-brand-foreground/80" : "text-secondary-foreground"
|
|
6
|
+
);
|
|
7
|
+
}
|
|
8
|
+
export {
|
|
9
|
+
r as intervalCaptionClassName
|
|
10
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { DateRange } from 'react-day-picker';
|
|
2
|
+
import { CalendarInterval, CalendarSelection, FiscalCalendarConfig } from '../../../lib/fiscal-calendar';
|
|
3
|
+
import { YoYComparison } from './calendar.types';
|
|
4
|
+
export declare function isDateRangeArray(value: Date | Date[] | DateRange | DateRange[] | undefined): value is DateRange[];
|
|
5
|
+
export declare function asDayPickerSelection(value: Date | Date[] | DateRange | DateRange[] | undefined): Date | Date[] | DateRange | undefined;
|
|
6
|
+
export declare function asRangeSelection(value: Date | Date[] | DateRange | DateRange[] | undefined): DateRange | DateRange[] | undefined;
|
|
7
|
+
export declare function dateToDayInterval(date: Date): CalendarInterval;
|
|
8
|
+
export declare function intervalToDateRange(interval: CalendarInterval): DateRange;
|
|
9
|
+
export declare function nextMultiRangeDateSelection(clicked: Date, prev: DateRange[] | DateRange | undefined): DateRange[];
|
|
10
|
+
export declare function flattenDateRanges(selection: Date | Date[] | DateRange | DateRange[] | undefined): Date[] | undefined;
|
|
11
|
+
export declare function multiRangeModifiers(selection: DateRange[] | undefined): {
|
|
12
|
+
range_start: Date[];
|
|
13
|
+
range_end: Date[];
|
|
14
|
+
range_middle: Date[];
|
|
15
|
+
};
|
|
16
|
+
export declare function formatMultiRangeFooterSummary(selection: DateRange[] | DateRange | undefined): string;
|
|
17
|
+
export declare function priorFyComparison(config: FiscalCalendarConfig, from: Date, to: Date): YoYComparison | undefined;
|
|
18
|
+
export declare function presetIntervalToDateRange(interval: {
|
|
19
|
+
start: string;
|
|
20
|
+
end: string;
|
|
21
|
+
}): DateRange;
|
|
22
|
+
export declare function isMultiRangeComplete(selection: DateRange[] | DateRange | undefined): boolean;
|
|
23
|
+
export declare function dateSelectToCalendarSelection(mode: "single" | "multiple" | "range" | "multi-range", selected: Date | Date[] | DateRange | DateRange[] | undefined): CalendarSelection;
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { civilFromLocalDate as s, diffDays as D, localDateFromCivil as i, addDays as c } from "../../../lib/fiscal-calendar/civil-date.js";
|
|
2
|
+
import { buildFiscalYear as l } from "../../../lib/fiscal-calendar/build-year.js";
|
|
3
|
+
import { getFiscalYearForDate as p } from "../../../lib/fiscal-calendar/lookup.js";
|
|
4
|
+
import { nextIntervalSelection as h } from "../../../lib/fiscal-calendar/selection.js";
|
|
5
|
+
function u(r) {
|
|
6
|
+
return Array.isArray(r) && r.length > 0 && typeof r[0] == "object" && r[0] !== null && !(r[0] instanceof Date) && "from" in r[0];
|
|
7
|
+
}
|
|
8
|
+
function b(r) {
|
|
9
|
+
if (!(!r || u(r)))
|
|
10
|
+
return r;
|
|
11
|
+
}
|
|
12
|
+
function C(r) {
|
|
13
|
+
if (u(r) || r && typeof r == "object" && !Array.isArray(r) && "from" in r)
|
|
14
|
+
return r;
|
|
15
|
+
}
|
|
16
|
+
function e(r) {
|
|
17
|
+
const t = s(r);
|
|
18
|
+
return { start: t, end: t, granularity: "day" };
|
|
19
|
+
}
|
|
20
|
+
function y(r) {
|
|
21
|
+
return {
|
|
22
|
+
from: i(r.start),
|
|
23
|
+
to: i(r.end)
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function A(r) {
|
|
27
|
+
return (r ? Array.isArray(r) && u(r) ? r : [r] : []).filter((o) => o?.from).map((o) => ({
|
|
28
|
+
from: e(o.from),
|
|
29
|
+
...o.to ? { to: e(o.to) } : {}
|
|
30
|
+
}));
|
|
31
|
+
}
|
|
32
|
+
function d(r) {
|
|
33
|
+
return r ? Array.isArray(r) ? r.map((t) => {
|
|
34
|
+
if (t && typeof t == "object" && "from" in t) {
|
|
35
|
+
const o = t;
|
|
36
|
+
return {
|
|
37
|
+
from: i(o.from.start),
|
|
38
|
+
...o.to ? { to: i(o.to.end) } : {}
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
return y(t);
|
|
42
|
+
}) : "from" in r ? [
|
|
43
|
+
{
|
|
44
|
+
from: i(r.from.start),
|
|
45
|
+
...r.to ? { to: i(r.to.end) } : {}
|
|
46
|
+
}
|
|
47
|
+
] : [y(r)] : [];
|
|
48
|
+
}
|
|
49
|
+
function T(r, t) {
|
|
50
|
+
const o = h(
|
|
51
|
+
e(r),
|
|
52
|
+
A(t),
|
|
53
|
+
"multi-range"
|
|
54
|
+
);
|
|
55
|
+
return d(o);
|
|
56
|
+
}
|
|
57
|
+
function F(r) {
|
|
58
|
+
if (!r) return;
|
|
59
|
+
if (r instanceof Date) return [r];
|
|
60
|
+
if (Array.isArray(r) && r[0] instanceof Date) return r;
|
|
61
|
+
const t = u(r) ? r : "from" in r ? [r] : [], o = [];
|
|
62
|
+
for (const a of t) {
|
|
63
|
+
if (!a.from) continue;
|
|
64
|
+
const n = a.to ?? a.from, f = new Date(a.from.getFullYear(), a.from.getMonth(), a.from.getDate()), m = new Date(n.getFullYear(), n.getMonth(), n.getDate());
|
|
65
|
+
for (; f <= m; )
|
|
66
|
+
o.push(new Date(f)), f.setDate(f.getDate() + 1);
|
|
67
|
+
}
|
|
68
|
+
return o;
|
|
69
|
+
}
|
|
70
|
+
function Y(r) {
|
|
71
|
+
const t = [], o = [], a = [];
|
|
72
|
+
if (!r) return { range_start: t, range_end: o, range_middle: a };
|
|
73
|
+
for (const n of r) {
|
|
74
|
+
if (!n.from) continue;
|
|
75
|
+
if (!n.to) {
|
|
76
|
+
t.push(n.from);
|
|
77
|
+
continue;
|
|
78
|
+
}
|
|
79
|
+
t.push(n.from), o.push(n.to);
|
|
80
|
+
const f = new Date(n.from.getFullYear(), n.from.getMonth(), n.from.getDate() + 1), m = new Date(n.to.getFullYear(), n.to.getMonth(), n.to.getDate());
|
|
81
|
+
for (; f < m; )
|
|
82
|
+
a.push(new Date(f)), f.setDate(f.getDate() + 1);
|
|
83
|
+
}
|
|
84
|
+
return { range_start: t, range_end: o, range_middle: a };
|
|
85
|
+
}
|
|
86
|
+
function j(r) {
|
|
87
|
+
const o = (r ? u(r) ? r : [r] : []).filter((f) => f.from && f.to), a = F(o)?.length ?? 0, n = o.length;
|
|
88
|
+
return `${n} range${n !== 1 ? "s" : ""} · ${a} day${a !== 1 ? "s" : ""}`;
|
|
89
|
+
}
|
|
90
|
+
function I(r, t, o) {
|
|
91
|
+
const a = s(t), n = s(o), f = p(r, a);
|
|
92
|
+
if (f)
|
|
93
|
+
try {
|
|
94
|
+
const m = l(r, f.fy - 1), g = D(f.start, m.start);
|
|
95
|
+
return {
|
|
96
|
+
primary: { from: t, to: o },
|
|
97
|
+
comparison: {
|
|
98
|
+
from: i(c(a, -g)),
|
|
99
|
+
to: i(c(n, -g))
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
} catch {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
function $(r) {
|
|
107
|
+
return {
|
|
108
|
+
from: i(r.start),
|
|
109
|
+
to: i(r.end)
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
function v(r) {
|
|
113
|
+
const t = r ? u(r) ? r : [r] : [];
|
|
114
|
+
return t.length > 0 && t.every((o) => !!(o.from && o.to));
|
|
115
|
+
}
|
|
116
|
+
function _(r, t) {
|
|
117
|
+
if (r === "multi-range")
|
|
118
|
+
return {
|
|
119
|
+
mode: "multi-range",
|
|
120
|
+
value: (u(t) ? t : t && typeof t == "object" && !Array.isArray(t) && "from" in t ? [t] : []).filter((n) => !!(n.from && n.to)).map((n) => ({
|
|
121
|
+
from: e(n.from),
|
|
122
|
+
to: e(n.to)
|
|
123
|
+
}))
|
|
124
|
+
};
|
|
125
|
+
if (r === "multiple")
|
|
126
|
+
return { mode: "multiple", value: (Array.isArray(t) && (t.length === 0 || t[0] instanceof Date) ? t : t instanceof Date ? [t] : []).map(e) };
|
|
127
|
+
if (r === "range") {
|
|
128
|
+
const a = t && typeof t == "object" && !Array.isArray(t) && "from" in t ? t : void 0;
|
|
129
|
+
return {
|
|
130
|
+
mode: "range",
|
|
131
|
+
value: a?.from ? {
|
|
132
|
+
from: e(a.from),
|
|
133
|
+
...a.to ? { to: e(a.to) } : {}
|
|
134
|
+
} : null
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
const o = t instanceof Date ? t : void 0;
|
|
138
|
+
return { mode: "single", value: o ? e(o) : null };
|
|
139
|
+
}
|
|
140
|
+
export {
|
|
141
|
+
b as asDayPickerSelection,
|
|
142
|
+
C as asRangeSelection,
|
|
143
|
+
_ as dateSelectToCalendarSelection,
|
|
144
|
+
e as dateToDayInterval,
|
|
145
|
+
F as flattenDateRanges,
|
|
146
|
+
j as formatMultiRangeFooterSummary,
|
|
147
|
+
y as intervalToDateRange,
|
|
148
|
+
u as isDateRangeArray,
|
|
149
|
+
v as isMultiRangeComplete,
|
|
150
|
+
Y as multiRangeModifiers,
|
|
151
|
+
T as nextMultiRangeDateSelection,
|
|
152
|
+
$ as presetIntervalToDateRange,
|
|
153
|
+
I as priorFyComparison
|
|
154
|
+
};
|
|
@@ -22,5 +22,9 @@ export interface CalendarMonthPanesProps {
|
|
|
22
22
|
isMonthDisabled: (year: number, month: number) => boolean;
|
|
23
23
|
onMonthChange: (month: Date) => void;
|
|
24
24
|
onMonthClick: (year: number, month: number) => void;
|
|
25
|
+
periodLabels?: Array<{
|
|
26
|
+
label: string;
|
|
27
|
+
caption?: string;
|
|
28
|
+
}>;
|
|
25
29
|
}
|
|
26
|
-
export declare function CalendarMonthPanes({ monthMode, monthPickerYear, monthsShort, showFooter, pendingMonthSelection, selectedMonths, resolvedStartYear, resolvedEndYear, yearOptions, previousYearLabel, nextYearLabel, currentMonth, isMonthSelected, getMonthRangeProps, isMonthDisabled, onMonthChange, onMonthClick, }: CalendarMonthPanesProps): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
export declare function CalendarMonthPanes({ monthMode, monthPickerYear, monthsShort, showFooter, pendingMonthSelection, selectedMonths, resolvedStartYear, resolvedEndYear, yearOptions, previousYearLabel, nextYearLabel, currentMonth, isMonthSelected, getMonthRangeProps, isMonthDisabled, onMonthChange, onMonthClick, periodLabels, }: CalendarMonthPanesProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as l, jsx as o } from "react/jsx-runtime";
|
|
2
|
-
import { CalendarMonthPickerPanel as
|
|
3
|
-
function
|
|
2
|
+
import { CalendarMonthPickerPanel as N } from "./calendar-month-picker-panel.js";
|
|
3
|
+
function y({
|
|
4
4
|
monthMode: a,
|
|
5
5
|
monthPickerYear: s,
|
|
6
6
|
monthsShort: d,
|
|
@@ -17,10 +17,11 @@ function f({
|
|
|
17
17
|
getMonthRangeProps: u,
|
|
18
18
|
isMonthDisabled: D,
|
|
19
19
|
onMonthChange: t,
|
|
20
|
-
onMonthClick: h
|
|
20
|
+
onMonthClick: h,
|
|
21
|
+
periodLabels: j
|
|
21
22
|
}) {
|
|
22
23
|
const n = (i = 0) => /* @__PURE__ */ o(
|
|
23
|
-
|
|
24
|
+
N,
|
|
24
25
|
{
|
|
25
26
|
yearOffset: i,
|
|
26
27
|
displayYear: s + i,
|
|
@@ -39,8 +40,9 @@ function f({
|
|
|
39
40
|
isMonthDisabled: D,
|
|
40
41
|
onPreviousYear: (e) => t(new Date(e - 1, r.getMonth(), 1)),
|
|
41
42
|
onNextYear: (e) => t(new Date(e + 1, r.getMonth(), 1)),
|
|
42
|
-
onYearSelect: (e,
|
|
43
|
-
onMonthClick: h
|
|
43
|
+
onYearSelect: (e, k) => t(new Date(e - k, r.getMonth(), 1)),
|
|
44
|
+
onMonthClick: h,
|
|
45
|
+
periodLabels: j
|
|
44
46
|
}
|
|
45
47
|
);
|
|
46
48
|
return /* @__PURE__ */ l("div", { "data-slot": "month-panes", children: [
|
|
@@ -52,5 +54,5 @@ function f({
|
|
|
52
54
|
] });
|
|
53
55
|
}
|
|
54
56
|
export {
|
|
55
|
-
|
|
57
|
+
y as CalendarMonthPanes
|
|
56
58
|
};
|
|
@@ -24,5 +24,9 @@ export interface CalendarMonthPickerPanelProps {
|
|
|
24
24
|
onNextYear: (displayYear: number) => void;
|
|
25
25
|
onYearSelect: (newYear: number, yearOffset: number) => void;
|
|
26
26
|
onMonthClick: (year: number, month: number) => void;
|
|
27
|
+
periodLabels?: Array<{
|
|
28
|
+
label: string;
|
|
29
|
+
caption?: string;
|
|
30
|
+
}>;
|
|
27
31
|
}
|
|
28
|
-
export declare function CalendarMonthPickerPanel({ yearOffset, displayYear, monthMode, monthsShort, showFooter, pendingMonthSelection, selectedMonths, resolvedStartYear, resolvedEndYear, yearOptions, previousYearLabel, nextYearLabel, isMonthSelected, getMonthRangeProps, isMonthDisabled, onPreviousYear, onNextYear, onYearSelect, onMonthClick, }: CalendarMonthPickerPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
32
|
+
export declare function CalendarMonthPickerPanel({ yearOffset, displayYear, monthMode, monthsShort, showFooter, pendingMonthSelection, selectedMonths, resolvedStartYear, resolvedEndYear, yearOptions, previousYearLabel, nextYearLabel, isMonthSelected, getMonthRangeProps, isMonthDisabled, onPreviousYear, onNextYear, onYearSelect, onMonthClick, periodLabels, }: CalendarMonthPickerPanelProps): import("react/jsx-runtime").JSX.Element;
|