impact-nova 2.5.7 → 2.5.9
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 +196 -102
- 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-fiscal-period-nav.d.ts +16 -0
- package/dist/components/data-display/calendar/calendar-fiscal-period-nav.js +41 -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 +25 -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/components/forms/smart-input/smart-input.js +106 -85
- package/dist/components/forms/smart-input/smart-input.types.d.ts +5 -0
- package/dist/components/forms/textarea/textarea.js +29 -28
- package/dist/components/forms/textarea/textarea.types.d.ts +1 -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/TextField.js +25 -24
- 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 +25 -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/dist/llms/rules/best-practices.js +1 -1
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/real-world-patterns.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/package.json +5 -1
- package/dist/lib/fiscal-calendar.d.ts +0 -62
- package/dist/lib/fiscal-calendar.js +0 -99
|
@@ -1,169 +1,263 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import "react-day-picker";
|
|
4
|
-
import { ChevronRight as
|
|
5
|
-
import { cn as
|
|
6
|
-
import { Button as
|
|
7
|
-
import { Select as
|
|
8
|
-
import { CalendarCaptionHeader as
|
|
9
|
-
import { CalendarDayButton as
|
|
10
|
-
import { PanelIndexContext as
|
|
11
|
-
import { CalendarWeekNumberCell as
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
1
|
+
import { jsx as i, jsxs as z } from "react/jsx-runtime";
|
|
2
|
+
import * as x from "react";
|
|
3
|
+
import { useDayPicker as V } from "react-day-picker";
|
|
4
|
+
import { ChevronRight as B } from "impact-nova-icons";
|
|
5
|
+
import { cn as k } from "../../../lib/utils.js";
|
|
6
|
+
import { Button as M } from "../../primitives/button/button.js";
|
|
7
|
+
import { Select as R } from "../../forms/select/select.js";
|
|
8
|
+
import { CalendarCaptionHeader as ee } from "./calendar-caption-header.js";
|
|
9
|
+
import { CalendarDayButton as te } from "./calendar-day-button.js";
|
|
10
|
+
import { PanelIndexContext as N } from "./calendar-panel-context.js";
|
|
11
|
+
import { CalendarWeekNumberCell as re } from "./calendar-week-number-cell.js";
|
|
12
|
+
import { paneCivilMonthIndex as ne } from "./calendar-week-number-header.js";
|
|
13
|
+
import { buildFiscalYear as oe } from "../../../lib/fiscal-calendar/build-year.js";
|
|
14
|
+
import { civilMonthAtOffset as _, midMonthDate as E, visibleMonthForPeriod as G, periodForCivilMonth as ie } from "./calendar-fiscal-period-nav.js";
|
|
15
|
+
import { getAvailableMonths as ae } from "./calendar-month-utils.js";
|
|
16
|
+
import { isCalendarPaddingWeek as se, weekHasInMonthSelection as le, weekIntervalContinues as de } from "./calendar-padding-week.utils.js";
|
|
17
|
+
import { fiscalPeriodForWeek as ce } from "./calendar-week-utils.js";
|
|
18
|
+
import { FiscalPeriodCaptionSelect as me } from "./fiscal-period-caption-select.js";
|
|
19
|
+
function H(y, m, u) {
|
|
20
|
+
if (m != null && y)
|
|
21
|
+
try {
|
|
22
|
+
return oe(y, m).periods;
|
|
23
|
+
} catch {
|
|
24
|
+
}
|
|
25
|
+
return u ?? [];
|
|
26
|
+
}
|
|
27
|
+
function Ie({
|
|
28
|
+
buttonVariant: y,
|
|
29
|
+
pickerType: m,
|
|
30
|
+
calendarKind: u,
|
|
31
|
+
currentMonth: h,
|
|
18
32
|
monthsFull: b,
|
|
19
|
-
|
|
20
|
-
|
|
33
|
+
monthsShort: q,
|
|
34
|
+
resolvedStartMonth: J,
|
|
35
|
+
resolvedEndMonth: Q,
|
|
21
36
|
availableYears: g,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
37
|
+
fiscalPeriods: C,
|
|
38
|
+
fiscalConfig: w,
|
|
39
|
+
weekStartsOn: U,
|
|
40
|
+
previousMonthLabel: P,
|
|
41
|
+
nextMonthLabel: W,
|
|
42
|
+
monthPlaceholder: I,
|
|
43
|
+
yearPlaceholder: X,
|
|
44
|
+
weekNumberLabel: Z,
|
|
45
|
+
weekNumberHeader: F,
|
|
46
|
+
weekLabel: $,
|
|
47
|
+
fiscalWeekNumberLabel: L,
|
|
48
|
+
fiscalWeekAriaLabel: T,
|
|
49
|
+
getCellMeta: f,
|
|
50
|
+
onMonthChange: v,
|
|
51
|
+
onWeekSelect: A,
|
|
52
|
+
periodRowHover: Y = !1,
|
|
53
|
+
weekMode: O = "single",
|
|
54
|
+
components: K
|
|
32
55
|
}) {
|
|
33
56
|
return {
|
|
34
|
-
Root: ({ className: e, rootRef:
|
|
35
|
-
Chevron: ({ className: e, orientation:
|
|
36
|
-
|
|
57
|
+
Root: ({ className: e, rootRef: r, ...t }) => /* @__PURE__ */ i("div", { "data-slot": "calendar", ref: r, className: k(e), ...t }),
|
|
58
|
+
Chevron: ({ className: e, orientation: r, ...t }) => r === "left" ? /* @__PURE__ */ i(
|
|
59
|
+
B,
|
|
37
60
|
{
|
|
38
61
|
size: 16,
|
|
39
|
-
className:
|
|
40
|
-
...
|
|
62
|
+
className: k("rotate-180 text-content", e),
|
|
63
|
+
...t
|
|
41
64
|
}
|
|
42
|
-
) :
|
|
43
|
-
PreviousMonthButton: (e) => /* @__PURE__ */
|
|
44
|
-
|
|
65
|
+
) : r === "right" ? /* @__PURE__ */ i(B, { size: 16, className: k("text-content", e), ...t }) : /* @__PURE__ */ i("span", {}),
|
|
66
|
+
PreviousMonthButton: (e) => /* @__PURE__ */ i(
|
|
67
|
+
M,
|
|
45
68
|
{
|
|
46
|
-
variant:
|
|
69
|
+
variant: y,
|
|
47
70
|
size: "icon",
|
|
48
71
|
className: "h-7 w-7",
|
|
49
|
-
"aria-label":
|
|
50
|
-
title:
|
|
72
|
+
"aria-label": P,
|
|
73
|
+
title: P,
|
|
51
74
|
...e
|
|
52
75
|
}
|
|
53
76
|
),
|
|
54
|
-
NextMonthButton: (e) => /* @__PURE__ */
|
|
55
|
-
|
|
77
|
+
NextMonthButton: (e) => /* @__PURE__ */ i(
|
|
78
|
+
M,
|
|
56
79
|
{
|
|
57
|
-
variant:
|
|
80
|
+
variant: y,
|
|
58
81
|
size: "icon",
|
|
59
82
|
className: "h-7 w-7",
|
|
60
|
-
"aria-label":
|
|
61
|
-
title:
|
|
83
|
+
"aria-label": W,
|
|
84
|
+
title: W,
|
|
62
85
|
...e
|
|
63
86
|
}
|
|
64
87
|
),
|
|
65
|
-
MonthCaption: ({ displayIndex: e, calendarMonth:
|
|
66
|
-
Month: ({ calendarMonth: e, displayIndex:
|
|
67
|
-
const
|
|
68
|
-
return /* @__PURE__ */
|
|
69
|
-
|
|
88
|
+
MonthCaption: ({ displayIndex: e, calendarMonth: r, ...t }) => /* @__PURE__ */ i("div", { ...t }),
|
|
89
|
+
Month: ({ calendarMonth: e, displayIndex: r, className: t, children: o, ...a }) => {
|
|
90
|
+
const d = x.Children.toArray(o), l = d[d.length - 1], s = d.slice(0, -1);
|
|
91
|
+
return /* @__PURE__ */ i(N.Provider, { value: r, children: /* @__PURE__ */ z("div", { className: k(t), ...a, children: [
|
|
92
|
+
s.length > 0 ? /* @__PURE__ */ i(ee, { children: s }) : null,
|
|
93
|
+
l
|
|
94
|
+
] }) });
|
|
95
|
+
},
|
|
96
|
+
Months: ({ className: e, children: r, ...t }) => /* @__PURE__ */ i(
|
|
97
|
+
"div",
|
|
98
|
+
{
|
|
99
|
+
"data-slot": "day-months",
|
|
100
|
+
"data-period-row-hover": Y ? "true" : void 0,
|
|
101
|
+
"data-week-gutter-track": m === "week" ? "true" : void 0,
|
|
102
|
+
className: k(e),
|
|
103
|
+
...t,
|
|
104
|
+
children: r
|
|
105
|
+
}
|
|
106
|
+
),
|
|
107
|
+
DropdownNav: ({ children: e, className: r, ...t }) => {
|
|
108
|
+
if (u !== "fiscal")
|
|
109
|
+
return /* @__PURE__ */ i("div", { className: r, ...t, children: e });
|
|
110
|
+
const o = x.Children.toArray(e), a = (n) => x.isValidElement(n) && n.key != null ? String(n.key) : "", d = o.find((n) => a(n).endsWith("year")), l = o.find((n) => a(n).endsWith("month")), s = o.filter((n) => {
|
|
111
|
+
const c = a(n);
|
|
112
|
+
return !c.endsWith("year") && !c.endsWith("month");
|
|
113
|
+
});
|
|
114
|
+
return /* @__PURE__ */ z("div", { className: r, ...t, children: [
|
|
115
|
+
d,
|
|
116
|
+
l,
|
|
70
117
|
s
|
|
71
118
|
] });
|
|
72
119
|
},
|
|
73
|
-
Months: ({ className: e, children: t, ...a }) => /* @__PURE__ */ n("div", { "data-slot": "day-months", className: d(e), ...a, children: t }),
|
|
74
120
|
MonthsDropdown: ({ value: e }) => {
|
|
75
|
-
const
|
|
76
|
-
|
|
121
|
+
const r = x.useContext(N), t = r > 0, o = _(h, r), a = o.getFullYear();
|
|
122
|
+
if (u === "fiscal" && w) {
|
|
123
|
+
const s = f?.(E(o)) ?? f?.(o), n = H(w, s?.fy, C), c = ie(
|
|
124
|
+
n,
|
|
125
|
+
o.getFullYear(),
|
|
126
|
+
o.getMonth()
|
|
127
|
+
);
|
|
128
|
+
return /* @__PURE__ */ i(
|
|
129
|
+
me,
|
|
130
|
+
{
|
|
131
|
+
periods: n,
|
|
132
|
+
selectedPeriod: c,
|
|
133
|
+
placeholder: I,
|
|
134
|
+
onPeriodChange: (p) => {
|
|
135
|
+
v(G(p, t));
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
);
|
|
139
|
+
}
|
|
140
|
+
const l = ae(
|
|
141
|
+
a,
|
|
77
142
|
b,
|
|
78
|
-
|
|
79
|
-
|
|
143
|
+
J,
|
|
144
|
+
Q
|
|
80
145
|
);
|
|
81
|
-
return /* @__PURE__ */
|
|
82
|
-
|
|
146
|
+
return /* @__PURE__ */ i(
|
|
147
|
+
R,
|
|
83
148
|
{
|
|
84
|
-
value:
|
|
149
|
+
value: l.find((s) => s.value === e?.toString()),
|
|
85
150
|
onChange: (s) => {
|
|
86
151
|
if (s && "value" in s) {
|
|
87
|
-
const
|
|
88
|
-
|
|
152
|
+
const n = parseInt(s.value);
|
|
153
|
+
v(t ? new Date(a, n - 1, 1) : new Date(a, n, 1));
|
|
89
154
|
}
|
|
90
155
|
},
|
|
91
156
|
scrollToSelectedOnOpen: !0,
|
|
92
|
-
options:
|
|
157
|
+
options: l,
|
|
93
158
|
className: "w-[116px] shrink-0",
|
|
94
159
|
menuWidth: "160px",
|
|
95
160
|
isSearchable: !0,
|
|
96
161
|
isClearable: !1,
|
|
97
|
-
placeholder:
|
|
162
|
+
placeholder: I
|
|
98
163
|
}
|
|
99
164
|
);
|
|
100
165
|
},
|
|
101
166
|
YearsDropdown: ({ value: e }) => {
|
|
102
|
-
const
|
|
103
|
-
return /* @__PURE__ */
|
|
104
|
-
|
|
167
|
+
const r = x.useContext(N), t = r > 0, o = u === "fiscal" && w, a = _(h, r), d = o ? f?.(E(a)) ?? f?.(a) : void 0, l = o && d?.fy != null ? String(d.fy) : e?.toString();
|
|
168
|
+
return /* @__PURE__ */ i(
|
|
169
|
+
R,
|
|
105
170
|
{
|
|
106
|
-
value: g.find((
|
|
107
|
-
onChange: (
|
|
108
|
-
if (
|
|
109
|
-
const
|
|
110
|
-
if (
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
|
|
171
|
+
value: g.find((n) => n.value === l),
|
|
172
|
+
onChange: (n) => {
|
|
173
|
+
if (n && "value" in n) {
|
|
174
|
+
const c = parseInt(n.value);
|
|
175
|
+
if (o) {
|
|
176
|
+
const p = H(w, c, C), D = p.find((S) => S.period === d?.fiscalPeriod) ?? p[0];
|
|
177
|
+
D && v(G(D, t));
|
|
178
|
+
return;
|
|
179
|
+
}
|
|
180
|
+
if (t) {
|
|
181
|
+
const p = new Date(
|
|
182
|
+
h.getFullYear(),
|
|
183
|
+
h.getMonth() + 1,
|
|
114
184
|
1
|
|
115
185
|
).getMonth();
|
|
116
|
-
|
|
186
|
+
v(new Date(c, p - 1, 1));
|
|
117
187
|
} else
|
|
118
|
-
|
|
188
|
+
v(new Date(c, h.getMonth(), 1));
|
|
119
189
|
}
|
|
120
190
|
},
|
|
121
191
|
scrollToSelectedOnOpen: !0,
|
|
122
192
|
options: g,
|
|
123
|
-
className: "w-[
|
|
193
|
+
className: "w-[116px] shrink-0",
|
|
124
194
|
menuWidth: "140px",
|
|
125
195
|
isSearchable: !0,
|
|
126
196
|
isClearable: !1,
|
|
127
|
-
placeholder:
|
|
197
|
+
placeholder: X
|
|
128
198
|
}
|
|
129
199
|
);
|
|
130
200
|
},
|
|
131
|
-
DayButton: (e) => /* @__PURE__ */
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
201
|
+
DayButton: (e) => /* @__PURE__ */ i(
|
|
202
|
+
te,
|
|
203
|
+
{
|
|
204
|
+
...e,
|
|
205
|
+
pickerType: m,
|
|
206
|
+
modifiers: {
|
|
207
|
+
...e.modifiers,
|
|
208
|
+
fiscal_period_start: !!f?.(e.day.date)?.isPeriodStart,
|
|
209
|
+
fiscal_period_end: !!f?.(e.day.date)?.isPeriodEnd
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
),
|
|
213
|
+
Week: ({ week: e, className: r, children: t, onClick: o, ...a }) => {
|
|
214
|
+
const { isSelected: d } = V(), l = se(e), s = m === "week", n = Y && !l ? ce(e, f) : void 0, c = !l && le(e, d), D = m === "week" && O !== "multiple" && O !== "multi-range" && c ? de(e, d) : { prev: !1, next: !1 };
|
|
215
|
+
return /* @__PURE__ */ i(
|
|
135
216
|
"tr",
|
|
136
217
|
{
|
|
137
|
-
className:
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
218
|
+
className: k(
|
|
219
|
+
r,
|
|
220
|
+
l && "invisible",
|
|
221
|
+
s && !l && "cursor-pointer"
|
|
141
222
|
),
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
223
|
+
...a,
|
|
224
|
+
"aria-hidden": l || void 0,
|
|
225
|
+
"data-fiscal-period": n,
|
|
226
|
+
"data-week-selected": c ? !0 : void 0,
|
|
227
|
+
"data-week-continues-next": D.next || void 0,
|
|
228
|
+
"data-week-continues-prev": D.prev || void 0,
|
|
229
|
+
onClick: s && !l ? (S) => {
|
|
230
|
+
if (o?.(S), S.defaultPrevented) return;
|
|
231
|
+
const j = S.target;
|
|
232
|
+
j.closest("button") || j.closest("[data-week-number]") || A(e);
|
|
233
|
+
} : o,
|
|
234
|
+
children: t
|
|
149
235
|
}
|
|
150
236
|
);
|
|
151
237
|
},
|
|
152
|
-
WeekNumber: ({ week: e, ...
|
|
153
|
-
|
|
238
|
+
WeekNumber: ({ week: e, ...r }) => /* @__PURE__ */ i(
|
|
239
|
+
re,
|
|
154
240
|
{
|
|
155
241
|
week: e,
|
|
156
|
-
weekStartsOn:
|
|
157
|
-
pickerType:
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
242
|
+
weekStartsOn: U,
|
|
243
|
+
pickerType: m,
|
|
244
|
+
calendarKind: u,
|
|
245
|
+
weekNumberLabel: Z,
|
|
246
|
+
weekLabel: $,
|
|
247
|
+
fiscalWeekNumberLabel: L,
|
|
248
|
+
fiscalWeekAriaLabel: T,
|
|
249
|
+
getCellMeta: f,
|
|
250
|
+
onWeekSelect: A,
|
|
251
|
+
...r
|
|
162
252
|
}
|
|
163
253
|
),
|
|
164
|
-
|
|
254
|
+
WeekNumberHeader: (e) => {
|
|
255
|
+
const r = x.useContext(N), t = ne(u, h, r), o = t === void 0 ? F : q[t], a = t === void 0 ? F : b[t];
|
|
256
|
+
return /* @__PURE__ */ i("th", { ...e, "aria-label": a, children: o });
|
|
257
|
+
},
|
|
258
|
+
...K
|
|
165
259
|
};
|
|
166
260
|
}
|
|
167
261
|
export {
|
|
168
|
-
|
|
262
|
+
Ie as buildCalendarDayPickerComponents
|
|
169
263
|
};
|
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
import { DayPicker, DateRange } from 'react-day-picker';
|
|
2
2
|
import { Button } from '../../primitives/button/button';
|
|
3
3
|
import { Option } from '../../forms/select';
|
|
4
|
+
import { FiscalCalendarConfig, FiscalPeriod } from '../../../lib/fiscal-calendar';
|
|
4
5
|
import { CalendarProps } from './calendar.types';
|
|
5
6
|
import { WeekPickerInput } from './calendar-week-utils';
|
|
6
7
|
import * as React from "react";
|
|
7
8
|
type DayPickerProps = React.ComponentProps<typeof DayPicker>;
|
|
8
|
-
export interface CalendarDayPickerViewProps extends Omit<CalendarProps, "showFooter" | "disableApply" | "onApply" | "onCancel" | "onClear" | "pickerType" | "weekMode" | "selectedWeeks" | "onWeekSelect" | "monthMode" | "selectedMonths" | "onMonthSelect" | "defaultMonth" | "fiscalMode" | "fiscalMonthPattern" | "fiscalYearStartMonth" | "
|
|
9
|
+
export interface CalendarDayPickerViewProps extends Omit<CalendarProps, "showFooter" | "disableApply" | "onApply" | "onCancel" | "onClear" | "pickerType" | "weekMode" | "selectedWeeks" | "onWeekSelect" | "monthMode" | "selectedMonths" | "onMonthSelect" | "defaultMonth" | "fiscalMode" | "fiscalMonthPattern" | "fiscalYearStartMonth" | "buttonVariant" | "components" | "classNames" | "formatters" | "captionLayout" | "showOutsideDays" | "fixedWeeks" | "calendarKind" | "fiscalConfig" | "granularity" | "showPresets" | "comparison" | "onComparisonChange" | "onSelectionChange" | "selectedQuarters" | "onQuarterSelect" | "selectedYear" | "onYearSelect" | "weekStartsOn" | "startMonth" | "endMonth" | "month" | "onMonthChange" | "selected" | "onSelect" | "mode"> {
|
|
9
10
|
pickerType: "date" | "week";
|
|
10
11
|
mode: NonNullable<CalendarProps["mode"]>;
|
|
11
12
|
weekMode: NonNullable<CalendarProps["weekMode"]>;
|
|
12
|
-
|
|
13
|
+
calendarKind: NonNullable<CalendarProps["calendarKind"]>;
|
|
14
|
+
granularity?: CalendarProps["granularity"];
|
|
13
15
|
showOutsideDays: boolean;
|
|
14
16
|
fixedWeeks: boolean;
|
|
15
17
|
captionLayout: NonNullable<CalendarProps["captionLayout"]>;
|
|
@@ -24,9 +26,13 @@ export interface CalendarDayPickerViewProps extends Omit<CalendarProps, "showFoo
|
|
|
24
26
|
selectedDaysFromWeeks?: Date[];
|
|
25
27
|
currentMonth: Date;
|
|
26
28
|
monthsFull: string[];
|
|
29
|
+
monthsShort: string[];
|
|
30
|
+
weekNumberHeader: string;
|
|
27
31
|
resolvedStartMonth: Date;
|
|
28
32
|
resolvedEndMonth: Date;
|
|
29
33
|
availableYears: Option[];
|
|
34
|
+
fiscalPeriods?: readonly FiscalPeriod[];
|
|
35
|
+
fiscalConfig?: FiscalCalendarConfig;
|
|
30
36
|
dateFnsLocale: DayPickerProps["locale"];
|
|
31
37
|
intlLocale: string;
|
|
32
38
|
weekRangeModifiers?: DayPickerProps["modifiers"];
|
|
@@ -39,7 +45,9 @@ export interface CalendarDayPickerViewProps extends Omit<CalendarProps, "showFoo
|
|
|
39
45
|
yearPlaceholder: string;
|
|
40
46
|
weekNumberLabel: (weekOfMonth: number) => string;
|
|
41
47
|
weekLabel: (weekOfMonth: number) => string;
|
|
48
|
+
fiscalWeekAriaLabel?: (meta: import('../../../lib/fiscal-calendar').DateCellMeta) => string;
|
|
49
|
+
getCellMeta?: (date: Date) => import('../../../lib/fiscal-calendar').DateCellMeta | undefined;
|
|
42
50
|
formatWeekNumber: (weekNumber: number) => string;
|
|
43
51
|
}
|
|
44
|
-
export declare function CalendarDayPickerView({ className, pickerType, mode, weekMode,
|
|
52
|
+
export declare function CalendarDayPickerView({ className, pickerType, mode, weekMode, calendarKind, granularity, showOutsideDays, fixedWeeks, captionLayout, buttonVariant, weekStartsOn, formatters, classNames, components, selected, showFooter, pendingSelection, selectedDaysFromWeeks, currentMonth, monthsFull, monthsShort, weekNumberHeader, resolvedStartMonth, resolvedEndMonth, availableYears, fiscalPeriods, fiscalConfig, dateFnsLocale, intlLocale, weekRangeModifiers, onSelect, onMonthChange, onWeekSelect, previousMonthLabel, nextMonthLabel, monthPlaceholder, yearPlaceholder, weekNumberLabel, weekLabel, fiscalWeekAriaLabel, getCellMeta, formatWeekNumber, disabled, ...props }: CalendarDayPickerViewProps): import("react/jsx-runtime").JSX.Element;
|
|
45
53
|
export {};
|