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
|
@@ -3,8 +3,7 @@ import { Badge as s } from "../../data-display/badge/badge.js";
|
|
|
3
3
|
import { FilterPopoverContent as u } from "../../flows/filter-strip/filter-tag-list.js";
|
|
4
4
|
import { Popover as b, PopoverTrigger as f } from "../../feedback/popover/popover.js";
|
|
5
5
|
import { Tooltip as g, TooltipTrigger as v, TooltipContent as x } from "../../feedback/tooltip/tooltip.js";
|
|
6
|
-
|
|
7
|
-
function I({
|
|
6
|
+
function w({
|
|
8
7
|
tags: o,
|
|
9
8
|
title: l = "Attributes",
|
|
10
9
|
maxVisibleTags: n = 4,
|
|
@@ -71,5 +70,5 @@ function I({
|
|
|
71
70
|
);
|
|
72
71
|
}
|
|
73
72
|
export {
|
|
74
|
-
|
|
73
|
+
w as ExpandableListItemAttributes
|
|
75
74
|
};
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import { jsx as e, jsxs as s } from "react/jsx-runtime";
|
|
2
2
|
import { ScrollOverflowAffordance as o } from "../../layout/horizontal-scroller/scroll-overflow-affordance.js";
|
|
3
|
-
import "react";
|
|
4
3
|
import { OverflowTooltip as r } from "../../feedback/tooltip/overflow-tooltip.js";
|
|
5
4
|
const m = 128;
|
|
6
|
-
function
|
|
5
|
+
function x({
|
|
7
6
|
columns: i,
|
|
8
7
|
sectionId: l = "metrics"
|
|
9
8
|
}) {
|
|
@@ -51,5 +50,5 @@ function f({
|
|
|
51
50
|
);
|
|
52
51
|
}
|
|
53
52
|
export {
|
|
54
|
-
|
|
53
|
+
x as ExpandableListItemMetrics
|
|
55
54
|
};
|
|
@@ -1,92 +1,98 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
1
|
+
import { jsx as s, jsxs as A } from "react/jsx-runtime";
|
|
2
|
+
import * as y from "react";
|
|
3
3
|
import { useDayPicker as ue } from "react-day-picker";
|
|
4
4
|
import { ChevronRight as Q } from "impact-nova-icons";
|
|
5
|
-
import { cn as
|
|
5
|
+
import { cn as w } from "../../../lib/utils.js";
|
|
6
6
|
import { Button as U } from "../../primitives/button/button.js";
|
|
7
7
|
import { Select as X } from "../../forms/select/select.js";
|
|
8
|
-
import { CalendarCaptionHeader as
|
|
9
|
-
import { CalendarDayButton as
|
|
10
|
-
import { PanelIndexContext as
|
|
11
|
-
import { CalendarWeekNumberCell as
|
|
12
|
-
import { paneCivilMonthIndex as
|
|
13
|
-
import { buildFiscalYear as
|
|
14
|
-
import { civilMonthAtOffset as
|
|
15
|
-
import { getAvailableMonths as
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
|
|
8
|
+
import { CalendarCaptionHeader as fe } from "./calendar-caption-header.js";
|
|
9
|
+
import { CalendarDayButton as me } from "./calendar-day-button.js";
|
|
10
|
+
import { PanelIndexContext as P } from "./calendar-panel-context.js";
|
|
11
|
+
import { CalendarWeekNumberCell as pe } from "./calendar-week-number-cell.js";
|
|
12
|
+
import { paneCivilMonthIndex as he } from "./calendar-week-number-header.js";
|
|
13
|
+
import { buildFiscalYear as ve } from "../../../lib/fiscal-calendar/build-year.js";
|
|
14
|
+
import { civilMonthAtOffset as S, midMonthDate as N, periodForFiscalYearChange as xe, visibleMonthForPeriod as Z, periodsAvailableInBounds as ye, periodForCivilMonth as $ } from "./calendar-fiscal-period-nav.js";
|
|
15
|
+
import { getAvailableMonths as ke, isWeekSelectableInBounds as we } from "./calendar-month-utils.js";
|
|
16
|
+
import { weekHasInMonthSelection as Pe, weekIntervalContinues as We } from "./calendar-padding-week.utils.js";
|
|
17
|
+
import { shouldHideCalendarWeekRow as L, fiscalPeriodForWeek as T, isOwnedFiscalWeekRow as De } from "./calendar-week-utils.js";
|
|
18
|
+
import { InjectedFiscalWeekRow as V } from "./calendar-injected-week-row.js";
|
|
19
|
+
import { FiscalDayCell as Ie } from "./calendar-fiscal-day-cell.js";
|
|
20
|
+
import { ownedWeeksOutsidePane as be, injectedWeekCollapseClass as ge } from "./calendar-leading-week.utils.js";
|
|
21
|
+
import { FiscalPeriodCaptionSelect as Fe } from "./fiscal-period-caption-select.js";
|
|
22
|
+
function O(m, v, d) {
|
|
23
|
+
if (v != null && m)
|
|
21
24
|
try {
|
|
22
|
-
return
|
|
25
|
+
return ve(m, v).periods;
|
|
23
26
|
} catch {
|
|
24
27
|
}
|
|
25
|
-
return
|
|
28
|
+
return d ?? [];
|
|
26
29
|
}
|
|
27
|
-
function K(
|
|
28
|
-
const
|
|
29
|
-
return !
|
|
30
|
+
function K(m, v, d) {
|
|
31
|
+
const I = m.days[0]?.date, x = m.days[m.days.length - 1]?.date;
|
|
32
|
+
return !I || !x ? !1 : we(I, x, v, d);
|
|
30
33
|
}
|
|
31
|
-
function
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
function Se(m) {
|
|
35
|
+
return y.isValidElement(m) && !!m.props["aria-hidden"];
|
|
36
|
+
}
|
|
37
|
+
function Le({
|
|
38
|
+
buttonVariant: m,
|
|
39
|
+
pickerType: v,
|
|
40
|
+
calendarKind: d,
|
|
41
|
+
granularity: I,
|
|
42
|
+
currentMonth: x,
|
|
43
|
+
monthsFull: R,
|
|
38
44
|
monthsShort: ee,
|
|
39
45
|
resolvedStartMonth: te,
|
|
40
46
|
resolvedEndMonth: oe,
|
|
41
|
-
availableYears:
|
|
42
|
-
fiscalPeriods:
|
|
43
|
-
fiscalConfig:
|
|
47
|
+
availableYears: j,
|
|
48
|
+
fiscalPeriods: C,
|
|
49
|
+
fiscalConfig: k,
|
|
44
50
|
weekStartsOn: ne,
|
|
45
51
|
previousMonthLabel: B,
|
|
46
|
-
nextMonthLabel:
|
|
47
|
-
monthPlaceholder:
|
|
52
|
+
nextMonthLabel: z,
|
|
53
|
+
monthPlaceholder: _,
|
|
48
54
|
yearPlaceholder: re,
|
|
49
55
|
weekNumberLabel: ie,
|
|
50
|
-
weekNumberHeader:
|
|
56
|
+
weekNumberHeader: E,
|
|
51
57
|
weekLabel: se,
|
|
52
58
|
fiscalWeekNumberLabel: ae,
|
|
53
59
|
fiscalWeekAriaLabel: le,
|
|
54
|
-
getCellMeta:
|
|
55
|
-
onMonthChange:
|
|
56
|
-
onWeekSelect:
|
|
57
|
-
periodRowHover:
|
|
58
|
-
weekMode:
|
|
59
|
-
showPeriodBoundaries:
|
|
60
|
-
disabled:
|
|
61
|
-
components:
|
|
60
|
+
getCellMeta: u,
|
|
61
|
+
onMonthChange: W,
|
|
62
|
+
onWeekSelect: H,
|
|
63
|
+
periodRowHover: G = !1,
|
|
64
|
+
weekMode: M = "single",
|
|
65
|
+
showPeriodBoundaries: de = !1,
|
|
66
|
+
disabled: F,
|
|
67
|
+
components: ce
|
|
62
68
|
}) {
|
|
63
|
-
function
|
|
64
|
-
if (
|
|
65
|
-
const t =
|
|
69
|
+
function Y(e) {
|
|
70
|
+
if (d !== "fiscal") return;
|
|
71
|
+
const t = S(x, e);
|
|
66
72
|
return $(
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
73
|
+
O(
|
|
74
|
+
k,
|
|
75
|
+
u?.(N(t))?.fy ?? u?.(t)?.fy,
|
|
76
|
+
C
|
|
71
77
|
),
|
|
72
78
|
t.getFullYear(),
|
|
73
79
|
t.getMonth()
|
|
74
80
|
)?.period;
|
|
75
81
|
}
|
|
76
82
|
return {
|
|
77
|
-
Root: ({ className: e, rootRef: t, ...o }) => /* @__PURE__ */
|
|
78
|
-
Chevron: ({ className: e, orientation: t, ...o }) => t === "left" ? /* @__PURE__ */
|
|
83
|
+
Root: ({ className: e, rootRef: t, ...o }) => /* @__PURE__ */ s("div", { "data-slot": "calendar", ref: t, className: w(e), ...o }),
|
|
84
|
+
Chevron: ({ className: e, orientation: t, ...o }) => t === "left" ? /* @__PURE__ */ s(
|
|
79
85
|
Q,
|
|
80
86
|
{
|
|
81
87
|
size: 16,
|
|
82
|
-
className:
|
|
88
|
+
className: w("rotate-180 text-content", e),
|
|
83
89
|
...o
|
|
84
90
|
}
|
|
85
|
-
) : t === "right" ? /* @__PURE__ */
|
|
86
|
-
PreviousMonthButton: (e) => /* @__PURE__ */
|
|
91
|
+
) : t === "right" ? /* @__PURE__ */ s(Q, { size: 16, className: w("text-content", e), ...o }) : /* @__PURE__ */ s("span", {}),
|
|
92
|
+
PreviousMonthButton: (e) => /* @__PURE__ */ s(
|
|
87
93
|
U,
|
|
88
94
|
{
|
|
89
|
-
variant:
|
|
95
|
+
variant: m,
|
|
90
96
|
size: "icon",
|
|
91
97
|
className: "h-7 w-7",
|
|
92
98
|
"aria-label": B,
|
|
@@ -94,83 +100,127 @@ function Je({
|
|
|
94
100
|
...e
|
|
95
101
|
}
|
|
96
102
|
),
|
|
97
|
-
NextMonthButton: (e) => /* @__PURE__ */
|
|
103
|
+
NextMonthButton: (e) => /* @__PURE__ */ s(
|
|
98
104
|
U,
|
|
99
105
|
{
|
|
100
|
-
variant:
|
|
106
|
+
variant: m,
|
|
101
107
|
size: "icon",
|
|
102
108
|
className: "h-7 w-7",
|
|
103
|
-
"aria-label":
|
|
104
|
-
title:
|
|
109
|
+
"aria-label": z,
|
|
110
|
+
title: z,
|
|
105
111
|
...e
|
|
106
112
|
}
|
|
107
113
|
),
|
|
108
|
-
MonthCaption: ({ displayIndex: e, calendarMonth: t, ...o }) => /* @__PURE__ */
|
|
109
|
-
Month: ({ calendarMonth: e, displayIndex: t, className: o, children: r, ...
|
|
110
|
-
const c =
|
|
111
|
-
return /* @__PURE__ */
|
|
112
|
-
a.length > 0 ? /* @__PURE__ */
|
|
114
|
+
MonthCaption: ({ displayIndex: e, calendarMonth: t, ...o }) => /* @__PURE__ */ s("div", { ...o }),
|
|
115
|
+
Month: ({ calendarMonth: e, displayIndex: t, className: o, children: r, ...i }) => {
|
|
116
|
+
const c = y.Children.toArray(r), p = c[c.length - 1], a = c.slice(0, -1);
|
|
117
|
+
return /* @__PURE__ */ s(P.Provider, { value: t, children: /* @__PURE__ */ A("div", { className: w(o), ...i, children: [
|
|
118
|
+
a.length > 0 ? /* @__PURE__ */ s(fe, { children: a }) : null,
|
|
113
119
|
p
|
|
114
120
|
] }) });
|
|
115
121
|
},
|
|
116
|
-
|
|
122
|
+
Weeks: ({ className: e, children: t, ...o }) => {
|
|
123
|
+
const r = y.useContext(P);
|
|
124
|
+
if (d !== "fiscal" || !k)
|
|
125
|
+
return /* @__PURE__ */ s("tbody", { className: e, ...o, children: t });
|
|
126
|
+
const i = S(x, r), c = Y(r), p = u?.(N(i))?.fy ?? u?.(i)?.fy, { leading: a, trailing: n } = be({
|
|
127
|
+
paneYear: i.getFullYear(),
|
|
128
|
+
paneMonthIndex: i.getMonth(),
|
|
129
|
+
panePeriod: c,
|
|
130
|
+
fiscalConfig: k,
|
|
131
|
+
fy: p
|
|
132
|
+
}), f = y.Children.toArray(t), l = [], D = [];
|
|
133
|
+
for (const h of f)
|
|
134
|
+
Se(h) ? D.push(h) : l.push(h);
|
|
135
|
+
const b = a.length + n.length;
|
|
136
|
+
return /* @__PURE__ */ A(
|
|
137
|
+
"tbody",
|
|
138
|
+
{
|
|
139
|
+
className: w(e, ge(b)),
|
|
140
|
+
"data-leading-week-count": a.length || void 0,
|
|
141
|
+
"data-trailing-week-count": n.length || void 0,
|
|
142
|
+
...o,
|
|
143
|
+
children: [
|
|
144
|
+
a.map((h) => /* @__PURE__ */ s(
|
|
145
|
+
V,
|
|
146
|
+
{
|
|
147
|
+
fiscalWeek: h,
|
|
148
|
+
displayMonth: i
|
|
149
|
+
},
|
|
150
|
+
h.start
|
|
151
|
+
)),
|
|
152
|
+
l,
|
|
153
|
+
n.map((h) => /* @__PURE__ */ s(
|
|
154
|
+
V,
|
|
155
|
+
{
|
|
156
|
+
fiscalWeek: h,
|
|
157
|
+
displayMonth: i
|
|
158
|
+
},
|
|
159
|
+
h.start
|
|
160
|
+
)),
|
|
161
|
+
D
|
|
162
|
+
]
|
|
163
|
+
}
|
|
164
|
+
);
|
|
165
|
+
},
|
|
166
|
+
Months: ({ className: e, children: t, ...o }) => /* @__PURE__ */ s(
|
|
117
167
|
"div",
|
|
118
168
|
{
|
|
119
169
|
"data-slot": "day-months",
|
|
120
|
-
"data-period-row-hover":
|
|
121
|
-
"data-week-gutter-track":
|
|
122
|
-
className:
|
|
170
|
+
"data-period-row-hover": G ? "true" : void 0,
|
|
171
|
+
"data-week-gutter-track": v === "week" ? "true" : void 0,
|
|
172
|
+
className: w(e),
|
|
123
173
|
...o,
|
|
124
174
|
children: t
|
|
125
175
|
}
|
|
126
176
|
),
|
|
127
177
|
DropdownNav: ({ children: e, className: t, ...o }) => {
|
|
128
|
-
if (
|
|
129
|
-
return /* @__PURE__ */
|
|
130
|
-
const r =
|
|
131
|
-
const
|
|
132
|
-
return !
|
|
178
|
+
if (d !== "fiscal")
|
|
179
|
+
return /* @__PURE__ */ s("div", { className: t, ...o, children: e });
|
|
180
|
+
const r = y.Children.toArray(e), i = (n) => y.isValidElement(n) && n.key != null ? String(n.key) : "", c = r.find((n) => i(n).endsWith("year")), p = r.find((n) => i(n).endsWith("month")), a = r.filter((n) => {
|
|
181
|
+
const f = i(n);
|
|
182
|
+
return !f.endsWith("year") && !f.endsWith("month");
|
|
133
183
|
});
|
|
134
|
-
return /* @__PURE__ */
|
|
184
|
+
return /* @__PURE__ */ A("div", { className: t, ...o, children: [
|
|
135
185
|
c,
|
|
136
186
|
p,
|
|
137
187
|
a
|
|
138
188
|
] });
|
|
139
189
|
},
|
|
140
190
|
MonthsDropdown: ({ value: e }) => {
|
|
141
|
-
const t =
|
|
142
|
-
if (
|
|
143
|
-
const a =
|
|
191
|
+
const t = y.useContext(P), o = t > 0, r = S(x, t), i = r.getFullYear();
|
|
192
|
+
if (d === "fiscal" && k) {
|
|
193
|
+
const a = u?.(N(r)) ?? u?.(r), n = O(k, a?.fy, C), f = ye(n, F), l = $(
|
|
144
194
|
n,
|
|
145
195
|
r.getFullYear(),
|
|
146
196
|
r.getMonth()
|
|
147
197
|
);
|
|
148
|
-
return /* @__PURE__ */
|
|
149
|
-
|
|
198
|
+
return /* @__PURE__ */ s(
|
|
199
|
+
Fe,
|
|
150
200
|
{
|
|
151
|
-
periods:
|
|
152
|
-
selectedPeriod:
|
|
153
|
-
placeholder:
|
|
154
|
-
onPeriodChange: (
|
|
155
|
-
|
|
201
|
+
periods: f,
|
|
202
|
+
selectedPeriod: l,
|
|
203
|
+
placeholder: _,
|
|
204
|
+
onPeriodChange: (D) => {
|
|
205
|
+
W(Z(D, o));
|
|
156
206
|
}
|
|
157
207
|
}
|
|
158
208
|
);
|
|
159
209
|
}
|
|
160
|
-
const p =
|
|
161
|
-
|
|
162
|
-
|
|
210
|
+
const p = ke(
|
|
211
|
+
i,
|
|
212
|
+
R,
|
|
163
213
|
te,
|
|
164
214
|
oe
|
|
165
215
|
);
|
|
166
|
-
return /* @__PURE__ */
|
|
216
|
+
return /* @__PURE__ */ s(
|
|
167
217
|
X,
|
|
168
218
|
{
|
|
169
219
|
value: p.find((a) => a.value === e?.toString()),
|
|
170
220
|
onChange: (a) => {
|
|
171
221
|
if (a && "value" in a) {
|
|
172
222
|
const n = parseInt(a.value);
|
|
173
|
-
|
|
223
|
+
W(o ? new Date(i, n - 1, 1) : new Date(i, n, 1));
|
|
174
224
|
}
|
|
175
225
|
},
|
|
176
226
|
scrollToSelectedOnOpen: !0,
|
|
@@ -179,41 +229,41 @@ function Je({
|
|
|
179
229
|
menuWidth: "160px",
|
|
180
230
|
isSearchable: !0,
|
|
181
231
|
isClearable: !1,
|
|
182
|
-
placeholder:
|
|
232
|
+
placeholder: _
|
|
183
233
|
}
|
|
184
234
|
);
|
|
185
235
|
},
|
|
186
236
|
YearsDropdown: ({ value: e }) => {
|
|
187
|
-
const t =
|
|
188
|
-
return /* @__PURE__ */
|
|
237
|
+
const t = y.useContext(P), o = t > 0, r = d === "fiscal" && k, i = S(x, t), c = r ? u?.(N(i)) ?? u?.(i) : void 0, p = r && c?.fy != null ? String(c.fy) : e?.toString();
|
|
238
|
+
return /* @__PURE__ */ s(
|
|
189
239
|
X,
|
|
190
240
|
{
|
|
191
|
-
value:
|
|
241
|
+
value: j.find((n) => n.value === p),
|
|
192
242
|
onChange: (n) => {
|
|
193
243
|
if (n && "value" in n) {
|
|
194
|
-
const
|
|
244
|
+
const f = parseInt(n.value);
|
|
195
245
|
if (r) {
|
|
196
|
-
const
|
|
197
|
-
periods:
|
|
246
|
+
const l = xe({
|
|
247
|
+
periods: O(k, f, C),
|
|
198
248
|
preferredPeriod: c?.fiscalPeriod,
|
|
199
|
-
disabled:
|
|
249
|
+
disabled: F
|
|
200
250
|
});
|
|
201
|
-
|
|
251
|
+
l && W(Z(l, o));
|
|
202
252
|
return;
|
|
203
253
|
}
|
|
204
254
|
if (o) {
|
|
205
|
-
const
|
|
206
|
-
|
|
207
|
-
|
|
255
|
+
const l = new Date(
|
|
256
|
+
x.getFullYear(),
|
|
257
|
+
x.getMonth() + 1,
|
|
208
258
|
1
|
|
209
259
|
).getMonth();
|
|
210
|
-
|
|
260
|
+
W(new Date(f, l - 1, 1));
|
|
211
261
|
} else
|
|
212
|
-
|
|
262
|
+
W(new Date(f, x.getMonth(), 1));
|
|
213
263
|
}
|
|
214
264
|
},
|
|
215
265
|
scrollToSelectedOnOpen: !0,
|
|
216
|
-
options:
|
|
266
|
+
options: j,
|
|
217
267
|
className: "w-[116px] shrink-0",
|
|
218
268
|
menuWidth: "140px",
|
|
219
269
|
isSearchable: !0,
|
|
@@ -222,85 +272,94 @@ function Je({
|
|
|
222
272
|
}
|
|
223
273
|
);
|
|
224
274
|
},
|
|
225
|
-
|
|
226
|
-
|
|
275
|
+
Day: (e) => {
|
|
276
|
+
if (d !== "fiscal") {
|
|
277
|
+
const { day: t, modifiers: o, children: r, ...i } = e;
|
|
278
|
+
return /* @__PURE__ */ s("td", { ...i, children: r });
|
|
279
|
+
}
|
|
280
|
+
return /* @__PURE__ */ s(Ie, { ...e });
|
|
281
|
+
},
|
|
282
|
+
DayButton: (e) => /* @__PURE__ */ s(
|
|
283
|
+
me,
|
|
227
284
|
{
|
|
228
285
|
...e,
|
|
229
|
-
pickerType:
|
|
286
|
+
pickerType: v,
|
|
230
287
|
modifiers: {
|
|
231
288
|
...e.modifiers,
|
|
232
|
-
...
|
|
233
|
-
fiscal_period_start: !!
|
|
234
|
-
fiscal_period_end: !!
|
|
289
|
+
...de ? {
|
|
290
|
+
fiscal_period_start: !!u?.(e.day.date)?.isPeriodStart,
|
|
291
|
+
fiscal_period_end: !!u?.(e.day.date)?.isPeriodEnd
|
|
235
292
|
} : {}
|
|
236
293
|
}
|
|
237
294
|
}
|
|
238
295
|
),
|
|
239
|
-
Week: ({ week: e, className: t, children: o, onClick: r, ...
|
|
240
|
-
const { isSelected: c } = ue(), p =
|
|
241
|
-
calendarKind:
|
|
242
|
-
weekPeriod:
|
|
243
|
-
panePeriod:
|
|
244
|
-
}),
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
296
|
+
Week: ({ week: e, className: t, children: o, onClick: r, ...i }) => {
|
|
297
|
+
const { isSelected: c } = ue(), p = y.useContext(P), a = v === "week", n = T(e, u), f = Y(p), l = L(e, {
|
|
298
|
+
calendarKind: d,
|
|
299
|
+
weekPeriod: n,
|
|
300
|
+
panePeriod: f
|
|
301
|
+
}), D = G && !l ? n : void 0, b = a && !l && !K(e, F, I), h = !l && !b && Pe(e, c, {
|
|
302
|
+
includeOutside: De({ calendarKind: d, weekPeriod: n, panePeriod: f })
|
|
303
|
+
}), q = v === "week" && M !== "multiple" && M !== "multi-range" && h ? We(e, c, {
|
|
304
|
+
joinAdjacentWeek: d === "fiscal",
|
|
305
|
+
panePeriod: f,
|
|
306
|
+
periodForDate: (g) => u?.(g)?.fiscalPeriod
|
|
248
307
|
}) : { prev: !1, next: !1 };
|
|
249
|
-
return /* @__PURE__ */
|
|
308
|
+
return /* @__PURE__ */ s(
|
|
250
309
|
"tr",
|
|
251
310
|
{
|
|
252
|
-
className:
|
|
311
|
+
className: w(
|
|
253
312
|
t,
|
|
254
|
-
|
|
255
|
-
|
|
313
|
+
l && "invisible order-last",
|
|
314
|
+
a && !l && !b && "cursor-pointer"
|
|
256
315
|
),
|
|
257
|
-
...
|
|
258
|
-
"aria-hidden":
|
|
259
|
-
"data-fiscal-period":
|
|
260
|
-
"data-week-selected":
|
|
316
|
+
...i,
|
|
317
|
+
"aria-hidden": l || void 0,
|
|
318
|
+
"data-fiscal-period": D,
|
|
319
|
+
"data-week-selected": h ? !0 : void 0,
|
|
261
320
|
"data-week-continues-next": q.next || void 0,
|
|
262
321
|
"data-week-continues-prev": q.prev || void 0,
|
|
263
|
-
onClick:
|
|
264
|
-
if (r?.(
|
|
265
|
-
const J =
|
|
266
|
-
J.closest("button") || J.closest("[data-week-number]") ||
|
|
322
|
+
onClick: a && !l && !b ? (g) => {
|
|
323
|
+
if (r?.(g), g.defaultPrevented) return;
|
|
324
|
+
const J = g.target;
|
|
325
|
+
J.closest("button") || J.closest("[data-week-number]") || H(e);
|
|
267
326
|
} : r,
|
|
268
327
|
children: o
|
|
269
328
|
}
|
|
270
329
|
);
|
|
271
330
|
},
|
|
272
331
|
WeekNumber: ({ week: e, ...t }) => {
|
|
273
|
-
const o =
|
|
274
|
-
calendarKind:
|
|
275
|
-
weekPeriod:
|
|
276
|
-
panePeriod:
|
|
332
|
+
const o = y.useContext(P), r = L(e, {
|
|
333
|
+
calendarKind: d,
|
|
334
|
+
weekPeriod: T(e, u),
|
|
335
|
+
panePeriod: Y(o)
|
|
277
336
|
});
|
|
278
|
-
return /* @__PURE__ */
|
|
279
|
-
|
|
337
|
+
return /* @__PURE__ */ s(
|
|
338
|
+
pe,
|
|
280
339
|
{
|
|
281
340
|
week: e,
|
|
282
341
|
weekStartsOn: ne,
|
|
283
|
-
pickerType:
|
|
284
|
-
calendarKind:
|
|
342
|
+
pickerType: v,
|
|
343
|
+
calendarKind: d,
|
|
285
344
|
weekNumberLabel: ie,
|
|
286
345
|
weekLabel: se,
|
|
287
346
|
fiscalWeekNumberLabel: ae,
|
|
288
347
|
fiscalWeekAriaLabel: le,
|
|
289
|
-
getCellMeta:
|
|
290
|
-
onWeekSelect:
|
|
348
|
+
getCellMeta: u,
|
|
349
|
+
onWeekSelect: H,
|
|
291
350
|
...t,
|
|
292
351
|
blank: r,
|
|
293
|
-
blocked:
|
|
352
|
+
blocked: v === "week" && !K(e, F, I)
|
|
294
353
|
}
|
|
295
354
|
);
|
|
296
355
|
},
|
|
297
356
|
WeekNumberHeader: (e) => {
|
|
298
|
-
const t =
|
|
299
|
-
return /* @__PURE__ */
|
|
357
|
+
const t = y.useContext(P), o = he(d, x, t), r = o === void 0 ? E : ee[o], i = o === void 0 ? E : R[o];
|
|
358
|
+
return /* @__PURE__ */ s("th", { ...e, "aria-label": i, children: r });
|
|
300
359
|
},
|
|
301
|
-
...
|
|
360
|
+
...ce
|
|
302
361
|
};
|
|
303
362
|
}
|
|
304
363
|
export {
|
|
305
|
-
|
|
364
|
+
Le as buildCalendarDayPickerComponents
|
|
306
365
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { CalendarDay } from 'react-day-picker';
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
/** DayPicker hides days before startMonth. Fiscal first-week July days still belong in the August grid. */
|
|
4
|
+
export declare function FiscalDayCell({ day, modifiers, children, className, ...tdProps }: {
|
|
5
|
+
day: CalendarDay;
|
|
6
|
+
modifiers: Record<string, boolean>;
|
|
7
|
+
children?: React.ReactNode;
|
|
8
|
+
className?: string;
|
|
9
|
+
} & React.TdHTMLAttributes<HTMLTableCellElement>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { useDayPicker as m } from "react-day-picker";
|
|
4
|
+
import { cn as h } from "../../../lib/utils.js";
|
|
5
|
+
import { callDayPickerSelect as p } from "./calendar-selection.js";
|
|
6
|
+
function b(t) {
|
|
7
|
+
return t && (t.split(/\s+/).filter((i) => i !== "invisible" && i !== "rdp-hidden" && i !== "hidden").join(" ") || void 0);
|
|
8
|
+
}
|
|
9
|
+
function B({
|
|
10
|
+
day: t,
|
|
11
|
+
modifiers: e,
|
|
12
|
+
children: i,
|
|
13
|
+
className: o,
|
|
14
|
+
...d
|
|
15
|
+
}) {
|
|
16
|
+
const l = !!(e.hidden && t.outside), { classNames: r, components: c, formatters: a, select: u } = m();
|
|
17
|
+
if (!l)
|
|
18
|
+
return /* @__PURE__ */ n("td", { className: o, ...d, children: i });
|
|
19
|
+
const s = { ...e, hidden: !1 };
|
|
20
|
+
return /* @__PURE__ */ n(
|
|
21
|
+
"td",
|
|
22
|
+
{
|
|
23
|
+
...d,
|
|
24
|
+
"data-hidden": void 0,
|
|
25
|
+
className: h(b(o), r.outside),
|
|
26
|
+
children: /* @__PURE__ */ n(
|
|
27
|
+
c.DayButton,
|
|
28
|
+
{
|
|
29
|
+
className: r.day_button,
|
|
30
|
+
type: "button",
|
|
31
|
+
day: t,
|
|
32
|
+
modifiers: s,
|
|
33
|
+
disabled: e.disabled || void 0,
|
|
34
|
+
onClick: (f) => {
|
|
35
|
+
p(u, t.date, s, f);
|
|
36
|
+
},
|
|
37
|
+
children: a.formatDay(t.date)
|
|
38
|
+
}
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
export {
|
|
44
|
+
B as FiscalDayCell
|
|
45
|
+
};
|