impact-nova 2.5.8 → 2.5.10
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/column-runtime-state-guard.js +42 -42
- package/dist/components/data/data-table/data-table-column-tree-cache.d.ts +15 -0
- package/dist/components/data/data-table/data-table-column-tree-cache.js +109 -80
- package/dist/components/data/data-table/use-data-table-column-list-sync.js +65 -62
- 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-day-picker-classnames.d.ts +6 -1
- package/dist/components/data-display/calendar/calendar-day-picker-classnames.js +31 -23
- package/dist/components/data-display/calendar/calendar-day-picker-components.d.ts +2 -1
- package/dist/components/data-display/calendar/calendar-day-picker-components.js +197 -164
- package/dist/components/data-display/calendar/calendar-day-picker-view.d.ts +3 -2
- package/dist/components/data-display/calendar/calendar-day-picker-view.js +130 -129
- package/dist/components/data-display/calendar/calendar-fiscal-labels.js +6 -6
- 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-padding-week.utils.d.ts +5 -1
- package/dist/components/data-display/calendar/calendar-padding-week.utils.js +20 -16
- 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 +43 -42
- package/dist/components/data-display/calendar/calendar-week-utils.d.ts +6 -0
- package/dist/components/data-display/calendar/calendar-week-utils.js +51 -47
- package/dist/components/data-display/calendar/calendar.js +102 -100
- package/dist/components/data-display/calendar/calendar.types.d.ts +2 -0
- package/dist/components/data-display/calendar/use-calendar-day-picker-config.d.ts +4 -2
- package/dist/components/data-display/calendar/use-calendar-day-picker-config.js +77 -72
- package/dist/components/data-display/calendar/use-fiscal-calendar.js +16 -15
- package/dist/components/feedback/dialog/dialog.js +12 -12
- package/dist/components/feedback/sheet/sheet.js +22 -22
- 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/calendar-selection-adapters.d.ts +2 -0
- package/dist/components/forms/date-picker/calendar-selection-adapters.js +36 -31
- package/dist/components/forms/date-picker/date-input-behavior.d.ts +10 -0
- package/dist/components/forms/date-picker/date-input-behavior.js +111 -90
- package/dist/components/forms/date-picker/date-picker.js +71 -69
- package/dist/components/forms/date-picker/date-picker.types.d.ts +2 -0
- package/dist/components/forms/date-picker/date-range-picker.js +146 -144
- package/dist/components/forms/date-picker/fiscal-pass-through.d.ts +1 -0
- package/dist/components/forms/date-picker/fiscal-pass-through.js +1 -0
- package/dist/components/forms/date-picker/month-picker.js +82 -80
- package/dist/components/forms/date-picker/month-range-picker.js +145 -143
- 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 +46 -44
- package/dist/components/forms/date-picker/multi-week-picker.js +53 -51
- package/dist/components/forms/date-picker/multi-year-picker.js +48 -46
- package/dist/components/forms/date-picker/picker-story-layout.d.ts +2 -0
- package/dist/components/forms/date-picker/quarter-picker.js +46 -44
- package/dist/components/forms/date-picker/quarter-range-picker.js +45 -43
- package/dist/components/forms/date-picker/week-picker.js +82 -80
- package/dist/components/forms/date-picker/week-range-picker.js +169 -164
- package/dist/components/forms/date-picker/year-picker.js +47 -45
- package/dist/components/forms/date-picker/year-range-picker.js +47 -45
- package/dist/components/forms/select/components/SelectMenuPanel.js +3 -2
- package/dist/components/forms/select/components/SelectTriggerValue.js +2 -3
- package/dist/components/forms/select/components/Submenu.js +2 -3
- package/dist/components/forms/select/select.js +1 -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/TextField.js +25 -24
- package/dist/form-react/Fields/WeekRangePicker.js +47 -48
- package/dist/form-react/types/fields.types.d.ts +8 -0
- package/dist/impact-nova.css +1 -1
- package/dist/lib/fiscal-calendar/civil-date.js +18 -18
- package/dist/lib/overlay/overlay-portal-context.js +16 -16
- 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 +1 -1
|
@@ -1,153 +1,154 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import { DayPicker as
|
|
4
|
-
import { cn as
|
|
5
|
-
import { formatPeriodOption as
|
|
6
|
-
import { CalendarDayHoverProvider as
|
|
7
|
-
import { previewModifierClassNames as
|
|
8
|
-
import { isPreviewCap as
|
|
9
|
-
import { useCalendarDayPickerConfig as
|
|
10
|
-
function
|
|
11
|
-
className:
|
|
1
|
+
import { jsx as H } from "react/jsx-runtime";
|
|
2
|
+
import * as x from "react";
|
|
3
|
+
import { DayPicker as pr } from "react-day-picker";
|
|
4
|
+
import { cn as dr } from "../../../lib/utils.js";
|
|
5
|
+
import { formatPeriodOption as ur } from "./calendar-fiscal-labels.js";
|
|
6
|
+
import { CalendarDayHoverProvider as gr } from "./calendar-day-hover.js";
|
|
7
|
+
import { previewModifierClassNames as vr, fiscalPeriodBoundaryClassNames as Pr } from "./calendar-day-picker-classnames.js";
|
|
8
|
+
import { isPreviewCap as d, dayKey as l, isPreviewMiddle as _r } from "./calendar-selection.js";
|
|
9
|
+
import { useCalendarDayPickerConfig as yr } from "./use-calendar-day-picker-config.js";
|
|
10
|
+
function Br({
|
|
11
|
+
className: B,
|
|
12
12
|
pickerType: s,
|
|
13
|
-
mode:
|
|
14
|
-
weekMode:
|
|
15
|
-
calendarKind:
|
|
16
|
-
granularity:
|
|
17
|
-
showOutsideDays:
|
|
18
|
-
fixedWeeks:
|
|
19
|
-
captionLayout:
|
|
20
|
-
buttonVariant:
|
|
21
|
-
weekStartsOn:
|
|
22
|
-
formatters:
|
|
23
|
-
classNames:
|
|
24
|
-
components:
|
|
25
|
-
selected:
|
|
26
|
-
showFooter:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
13
|
+
mode: e,
|
|
14
|
+
weekMode: f,
|
|
15
|
+
calendarKind: m,
|
|
16
|
+
granularity: E,
|
|
17
|
+
showOutsideDays: u,
|
|
18
|
+
fixedWeeks: g,
|
|
19
|
+
captionLayout: F,
|
|
20
|
+
buttonVariant: L,
|
|
21
|
+
weekStartsOn: v,
|
|
22
|
+
formatters: O,
|
|
23
|
+
classNames: V,
|
|
24
|
+
components: Y,
|
|
25
|
+
selected: P,
|
|
26
|
+
showFooter: _,
|
|
27
|
+
showPeriodBoundaries: p,
|
|
28
|
+
pendingSelection: y,
|
|
29
|
+
selectedDaysFromWeeks: k,
|
|
30
|
+
currentMonth: D,
|
|
31
|
+
monthsFull: R,
|
|
32
|
+
monthsShort: $,
|
|
33
|
+
weekNumberHeader: q,
|
|
34
|
+
resolvedStartMonth: b,
|
|
35
|
+
resolvedEndMonth: w,
|
|
36
|
+
availableYears: z,
|
|
37
|
+
fiscalPeriods: C,
|
|
38
|
+
fiscalConfig: A,
|
|
39
|
+
dateFnsLocale: G,
|
|
40
|
+
intlLocale: I,
|
|
41
|
+
weekRangeModifiers: J,
|
|
42
|
+
onSelect: M,
|
|
43
|
+
onMonthChange: N,
|
|
44
|
+
onWeekSelect: Q,
|
|
45
|
+
previousMonthLabel: U,
|
|
46
|
+
nextMonthLabel: X,
|
|
47
|
+
monthPlaceholder: Z,
|
|
48
|
+
yearPlaceholder: W,
|
|
49
|
+
weekNumberLabel: S,
|
|
50
|
+
weekLabel: K,
|
|
51
|
+
fiscalWeekAriaLabel: T,
|
|
52
|
+
getCellMeta: n,
|
|
53
|
+
formatWeekNumber: rr,
|
|
54
|
+
disabled: or,
|
|
55
|
+
showWeekNumber: h = !0,
|
|
56
|
+
...tr
|
|
55
57
|
}) {
|
|
56
|
-
const { dayPickerClassNames:
|
|
57
|
-
buttonVariant:
|
|
58
|
+
const { dayPickerClassNames: ar, dayPickerComponents: ir } = yr({
|
|
59
|
+
buttonVariant: L,
|
|
58
60
|
pickerType: s,
|
|
59
|
-
calendarKind:
|
|
60
|
-
granularity:
|
|
61
|
-
showOutsideDays:
|
|
62
|
-
classNames:
|
|
63
|
-
currentMonth:
|
|
64
|
-
monthsFull:
|
|
65
|
-
monthsShort:
|
|
66
|
-
weekNumberHeader:
|
|
67
|
-
resolvedStartMonth:
|
|
68
|
-
resolvedEndMonth:
|
|
69
|
-
availableYears:
|
|
70
|
-
fiscalPeriods:
|
|
71
|
-
fiscalConfig:
|
|
72
|
-
weekStartsOn:
|
|
73
|
-
previousMonthLabel:
|
|
74
|
-
nextMonthLabel:
|
|
75
|
-
monthPlaceholder:
|
|
76
|
-
yearPlaceholder:
|
|
77
|
-
weekNumberLabel:
|
|
78
|
-
weekLabel:
|
|
79
|
-
fiscalWeekNumberLabel:
|
|
80
|
-
fiscalWeekAriaLabel:
|
|
81
|
-
getCellMeta:
|
|
82
|
-
onMonthChange:
|
|
83
|
-
onWeekSelect:
|
|
84
|
-
weekMode:
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
|
|
61
|
+
calendarKind: m,
|
|
62
|
+
granularity: E,
|
|
63
|
+
showOutsideDays: u,
|
|
64
|
+
classNames: V,
|
|
65
|
+
currentMonth: D,
|
|
66
|
+
monthsFull: R,
|
|
67
|
+
monthsShort: $,
|
|
68
|
+
weekNumberHeader: q,
|
|
69
|
+
resolvedStartMonth: b,
|
|
70
|
+
resolvedEndMonth: w,
|
|
71
|
+
availableYears: z,
|
|
72
|
+
fiscalPeriods: C,
|
|
73
|
+
fiscalConfig: A,
|
|
74
|
+
weekStartsOn: v,
|
|
75
|
+
previousMonthLabel: U,
|
|
76
|
+
nextMonthLabel: X,
|
|
77
|
+
monthPlaceholder: Z,
|
|
78
|
+
yearPlaceholder: W,
|
|
79
|
+
weekNumberLabel: S,
|
|
80
|
+
weekLabel: K,
|
|
81
|
+
fiscalWeekNumberLabel: S,
|
|
82
|
+
fiscalWeekAriaLabel: T,
|
|
83
|
+
getCellMeta: n,
|
|
84
|
+
onMonthChange: N,
|
|
85
|
+
onWeekSelect: Q,
|
|
86
|
+
weekMode: f,
|
|
87
|
+
showPeriodBoundaries: p,
|
|
88
|
+
showWeekNumber: h,
|
|
89
|
+
components: Y
|
|
90
|
+
}), er = e === "range" || e === "multiple" || e === "multi-range" || f === "range" || f === "multiple" || f === "multi-range" ? 2 : 1, nr = s === "week" || e === "multi-range" ? "multiple" : e, sr = g || m === "fiscal" || u, j = p && n ? {
|
|
91
|
+
fiscal_period_start: (r) => !!n(r)?.isPeriodStart,
|
|
92
|
+
fiscal_period_end: (r) => !!n(r)?.isPeriodEnd
|
|
93
|
+
} : void 0, [t, cr] = x.useState(), fr = x.useCallback((r) => {
|
|
94
|
+
cr((o) => !o && !r || o && r && o.getFullYear() === r.getFullYear() && o.getMonth() === r.getMonth() && o.getDate() === r.getDate() ? o : r);
|
|
95
|
+
}, []), a = _ ? y : P, i = e === "range" && a && typeof a == "object" && "from" in a ? a.from : void 0, mr = e === "range" && a && typeof a == "object" && "to" in a ? a.to : void 0;
|
|
96
|
+
return /* @__PURE__ */ H(gr, { onDayHover: fr, children: /* @__PURE__ */ H(
|
|
97
|
+
pr,
|
|
94
98
|
{
|
|
95
|
-
mode:
|
|
96
|
-
selected: s === "week" ?
|
|
99
|
+
mode: nr,
|
|
100
|
+
selected: s === "week" ? k : _ ? y : P,
|
|
97
101
|
onSelect: (...r) => {
|
|
98
|
-
const [
|
|
99
|
-
|
|
102
|
+
const [o, c] = r;
|
|
103
|
+
M(o, c instanceof Date ? c : void 0);
|
|
100
104
|
},
|
|
101
|
-
month:
|
|
102
|
-
onMonthChange:
|
|
103
|
-
fixedWeeks:
|
|
104
|
-
showOutsideDays:
|
|
105
|
-
weekStartsOn:
|
|
106
|
-
modifiers: s === "week" ? { ...
|
|
107
|
-
preview: (r) =>
|
|
108
|
-
preview_cap: (r) =>
|
|
109
|
-
preview_cap_start: (r) =>
|
|
110
|
-
preview_cap_end: (r) =>
|
|
105
|
+
month: D,
|
|
106
|
+
onMonthChange: N,
|
|
107
|
+
fixedWeeks: g,
|
|
108
|
+
showOutsideDays: sr,
|
|
109
|
+
weekStartsOn: v,
|
|
110
|
+
modifiers: s === "week" ? { ...J, ...j } : { ...j, ...s === "date" && !!(i && !mr && t) && i && t ? {
|
|
111
|
+
preview: (r) => _r(r, i, t),
|
|
112
|
+
preview_cap: (r) => d(r, i, t),
|
|
113
|
+
preview_cap_start: (r) => d(r, i, t) && l(t) < l(i),
|
|
114
|
+
preview_cap_end: (r) => d(r, i, t) && l(t) > l(i)
|
|
111
115
|
} : void 0 },
|
|
112
116
|
modifiersClassNames: {
|
|
113
|
-
...
|
|
114
|
-
|
|
115
|
-
fiscal_period_end: "after:pointer-events-none after:absolute after:right-0 after:top-1/2 after:-translate-y-1/2 after:content-[')'] after:text-sm after:font-normal after:text-brand"
|
|
116
|
-
} : void 0,
|
|
117
|
-
...ur
|
|
117
|
+
...p && m === "fiscal" ? Pr : void 0,
|
|
118
|
+
...vr
|
|
118
119
|
},
|
|
119
|
-
locale:
|
|
120
|
-
className:
|
|
120
|
+
locale: G,
|
|
121
|
+
className: dr(
|
|
121
122
|
"bg-canvas group/calendar p-2 [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",
|
|
122
123
|
String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
|
|
123
124
|
String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
|
|
124
|
-
|
|
125
|
+
B
|
|
125
126
|
),
|
|
126
|
-
captionLayout:
|
|
127
|
+
captionLayout: F,
|
|
127
128
|
navLayout: "around",
|
|
128
|
-
startMonth:
|
|
129
|
-
endMonth:
|
|
130
|
-
disabled:
|
|
131
|
-
numberOfMonths:
|
|
132
|
-
showWeekNumber: !0,
|
|
129
|
+
startMonth: b,
|
|
130
|
+
endMonth: w,
|
|
131
|
+
disabled: or,
|
|
132
|
+
numberOfMonths: er,
|
|
133
133
|
formatters: {
|
|
134
134
|
formatMonthDropdown: (r) => {
|
|
135
|
-
if (
|
|
136
|
-
const
|
|
137
|
-
if (
|
|
138
|
-
if (
|
|
135
|
+
if (m === "fiscal" && n) {
|
|
136
|
+
const o = n(r), c = C?.find((lr) => lr.period === o?.fiscalPeriod);
|
|
137
|
+
if (c) return ur(c);
|
|
138
|
+
if (o?.fiscalPeriod != null) return `P${o.fiscalPeriod}`;
|
|
139
139
|
}
|
|
140
|
-
return r.toLocaleString(
|
|
140
|
+
return r.toLocaleString(I, { month: "short" });
|
|
141
141
|
},
|
|
142
|
-
formatWeekNumber:
|
|
143
|
-
...
|
|
142
|
+
formatWeekNumber: rr,
|
|
143
|
+
...O
|
|
144
144
|
},
|
|
145
|
-
classNames:
|
|
146
|
-
components:
|
|
147
|
-
...
|
|
145
|
+
classNames: ar,
|
|
146
|
+
components: ir,
|
|
147
|
+
...tr,
|
|
148
|
+
showWeekNumber: h
|
|
148
149
|
}
|
|
149
150
|
) });
|
|
150
151
|
}
|
|
151
152
|
export {
|
|
152
|
-
|
|
153
|
+
Br as CalendarDayPickerView
|
|
153
154
|
};
|
|
@@ -17,7 +17,7 @@ const a = [
|
|
|
17
17
|
function u(r, t = "fy-short") {
|
|
18
18
|
return c(r, t);
|
|
19
19
|
}
|
|
20
|
-
function
|
|
20
|
+
function d(r, t) {
|
|
21
21
|
if (t)
|
|
22
22
|
try {
|
|
23
23
|
const n = f(t, r);
|
|
@@ -28,7 +28,7 @@ function p(r, t) {
|
|
|
28
28
|
}
|
|
29
29
|
function $(r, t) {
|
|
30
30
|
const n = l(r), e = l(t);
|
|
31
|
-
return n.y === e.y
|
|
31
|
+
return n.y === e.y ? `${a[n.m - 1]} ${n.d} – ${a[e.m - 1]} ${e.d}` : `${a[n.m - 1]} ${n.d} ${n.y} – ${a[e.m - 1]} ${e.d} ${e.y}`;
|
|
32
32
|
}
|
|
33
33
|
function Q(r) {
|
|
34
34
|
return `Period ${r.period} (${$(r.start, r.end)})`;
|
|
@@ -52,11 +52,11 @@ function s(r) {
|
|
|
52
52
|
function L(r, t) {
|
|
53
53
|
return `P${r} ${u(t)}`;
|
|
54
54
|
}
|
|
55
|
-
function
|
|
55
|
+
function b(r, t) {
|
|
56
56
|
return `Q${r} ${u(t)}`;
|
|
57
57
|
}
|
|
58
58
|
function P(r) {
|
|
59
|
-
return r.fy != null ?
|
|
59
|
+
return r.fy != null ? b(r.quarter, r.fy) : `Q${r.quarter} ${r.year}`;
|
|
60
60
|
}
|
|
61
61
|
function I(r, t = "fy-long") {
|
|
62
62
|
return r.fy != null ? u(r.fy, t) : String(r.year);
|
|
@@ -77,7 +77,7 @@ function R(r, t) {
|
|
|
77
77
|
}
|
|
78
78
|
export {
|
|
79
79
|
L as formatFiscalPeriodInput,
|
|
80
|
-
|
|
80
|
+
b as formatFiscalQuarterInput,
|
|
81
81
|
u as formatFiscalYearLabel,
|
|
82
82
|
m as formatPeriodCell,
|
|
83
83
|
F as formatPeriodOption,
|
|
@@ -86,5 +86,5 @@ export {
|
|
|
86
86
|
P as formatQuarterInput,
|
|
87
87
|
R as formatQuarterLabelsForYear,
|
|
88
88
|
I as formatYearInput,
|
|
89
|
-
|
|
89
|
+
d as formatYearIntervalCaption
|
|
90
90
|
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FiscalPeriod } from '../../../lib/fiscal-calendar';
|
|
2
|
+
/** Local midnight on the 15th. FY can change on the 1st of a civil month. */
|
|
3
|
+
export declare function midMonthDate(month: Date): Date;
|
|
4
|
+
export declare function civilMonthAtOffset(month: Date, offset: number): Date;
|
|
5
|
+
/** Civil month (0-indexed) where `period` has the most days. */
|
|
6
|
+
export declare function dominantCivilMonthForPeriod(period: FiscalPeriod): {
|
|
7
|
+
year: number;
|
|
8
|
+
monthIndex: number;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Month the week/date grid should show after picking a fiscal period.
|
|
12
|
+
* Dual-month range pickers pass `isRightPanel` so the period lands on the right pane.
|
|
13
|
+
*/
|
|
14
|
+
export declare function visibleMonthForPeriod(period: FiscalPeriod, isRightPanel: boolean): Date;
|
|
15
|
+
/** Period that occupies the most days of a civil month (caption selected value). */
|
|
16
|
+
export declare function periodForCivilMonth(periods: readonly FiscalPeriod[], year: number, monthIndex: number): FiscalPeriod | undefined;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { setDate as m, startOfMonth as s, addMonths as h } from "date-fns";
|
|
2
|
+
import { parseCivilDate as d, toCivilDate as l, lastDayOfMonth as y, compareCivil as u, diffDays as v, minCivil as M, maxCivil as p } from "../../../lib/fiscal-calendar/civil-date.js";
|
|
3
|
+
function x(t) {
|
|
4
|
+
return m(s(t), 15);
|
|
5
|
+
}
|
|
6
|
+
function b(t, n) {
|
|
7
|
+
return s(h(t, n));
|
|
8
|
+
}
|
|
9
|
+
function c(t, n, o, e) {
|
|
10
|
+
const r = l(o, e + 1, 1), a = y(o, e + 1), i = p(t, r), f = M(n, a);
|
|
11
|
+
return u(i, f) > 0 ? 0 : v(f, i) + 1;
|
|
12
|
+
}
|
|
13
|
+
function C(t) {
|
|
14
|
+
const n = d(t.start);
|
|
15
|
+
let o = { year: n.y, monthIndex: n.m - 1, days: 0 };
|
|
16
|
+
const e = t.gregorianMonthSpan.length > 0 ? t.gregorianMonthSpan : [{ year: n.y, month: n.m - 1 }];
|
|
17
|
+
for (const { year: r, month: a } of e) {
|
|
18
|
+
const i = c(t.start, t.end, r, a);
|
|
19
|
+
i > o.days && (o = { year: r, monthIndex: a, days: i });
|
|
20
|
+
}
|
|
21
|
+
return { year: o.year, monthIndex: o.monthIndex };
|
|
22
|
+
}
|
|
23
|
+
function I(t, n) {
|
|
24
|
+
const { year: o, monthIndex: e } = C(t), r = s(new Date(o, e, 1));
|
|
25
|
+
return n ? h(r, -1) : r;
|
|
26
|
+
}
|
|
27
|
+
function O(t, n, o) {
|
|
28
|
+
let e, r = 0;
|
|
29
|
+
for (const a of t) {
|
|
30
|
+
const i = c(a.start, a.end, n, o);
|
|
31
|
+
i > r && (e = a, r = i);
|
|
32
|
+
}
|
|
33
|
+
return e;
|
|
34
|
+
}
|
|
35
|
+
export {
|
|
36
|
+
b as civilMonthAtOffset,
|
|
37
|
+
C as dominantCivilMonthForPeriod,
|
|
38
|
+
x as midMonthDate,
|
|
39
|
+
O as periodForCivilMonth,
|
|
40
|
+
I as visibleMonthForPeriod
|
|
41
|
+
};
|
|
@@ -14,7 +14,11 @@ export declare function weekIntervalContinues(week: {
|
|
|
14
14
|
date: Date;
|
|
15
15
|
outside?: boolean;
|
|
16
16
|
}>;
|
|
17
|
-
}, isSelected?: (date: Date) => boolean
|
|
17
|
+
}, isSelected?: (date: Date) => boolean, options?: {
|
|
18
|
+
joinAdjacentWeek?: boolean;
|
|
19
|
+
panePeriod?: number;
|
|
20
|
+
periodForDate?: (date: Date) => number | undefined;
|
|
21
|
+
}): {
|
|
18
22
|
prev: boolean;
|
|
19
23
|
next: boolean;
|
|
20
24
|
};
|
|
@@ -1,25 +1,29 @@
|
|
|
1
|
-
function
|
|
2
|
-
return
|
|
1
|
+
function y(e) {
|
|
2
|
+
return e.days.length > 0 && e.days.every((t) => t.outside);
|
|
3
3
|
}
|
|
4
|
-
function
|
|
5
|
-
return
|
|
4
|
+
function g(e, t) {
|
|
5
|
+
return t ? e.days.some((r) => !r.outside && t(r.date)) : !1;
|
|
6
6
|
}
|
|
7
|
-
function
|
|
8
|
-
return new Date(
|
|
7
|
+
function d(e, t) {
|
|
8
|
+
return new Date(e.getFullYear(), e.getMonth(), e.getDate() + t);
|
|
9
9
|
}
|
|
10
|
-
function
|
|
11
|
-
return
|
|
10
|
+
function c(e, t) {
|
|
11
|
+
return e.getFullYear() !== t.getFullYear() || e.getMonth() !== t.getMonth();
|
|
12
12
|
}
|
|
13
|
-
function
|
|
14
|
-
if (!
|
|
15
|
-
const
|
|
13
|
+
function h(e, t, r) {
|
|
14
|
+
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, s = r?.joinAdjacentWeek ? e.days.at(-1)?.date : e.days.filter((n) => !n.outside).at(-1)?.date, f = o ? d(o, -1) : void 0, l = s ? d(s, 1) : void 0, i = (n) => {
|
|
16
|
+
if (!n || !t(n)) return !1;
|
|
17
|
+
const u = r?.periodForDate?.(n);
|
|
18
|
+
return r?.panePeriod != null && u != null ? u !== r.panePeriod : !!(a && c(n, a));
|
|
19
|
+
};
|
|
16
20
|
return {
|
|
17
|
-
prev:
|
|
18
|
-
next:
|
|
21
|
+
prev: i(f),
|
|
22
|
+
next: i(l)
|
|
19
23
|
};
|
|
20
24
|
}
|
|
21
25
|
export {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
26
|
+
y as isCalendarPaddingWeek,
|
|
27
|
+
g as weekHasInMonthSelection,
|
|
28
|
+
h as weekIntervalContinues
|
|
25
29
|
};
|
|
@@ -17,6 +17,7 @@ export interface CalendarWeekNumberCellProps {
|
|
|
17
17
|
fiscalWeekAriaLabel?: (meta: DateCellMeta) => string;
|
|
18
18
|
getCellMeta?: (date: Date) => DateCellMeta | undefined;
|
|
19
19
|
onWeekSelect: (input: WeekPickerInput) => void;
|
|
20
|
+
blank?: boolean;
|
|
20
21
|
className?: string;
|
|
21
22
|
}
|
|
22
|
-
export declare function CalendarWeekNumberCell({ week, weekStartsOn, pickerType, calendarKind, weekNumberLabel, weekLabel, fiscalWeekNumberLabel, fiscalWeekAriaLabel, getCellMeta, onWeekSelect, className, ...weekProps }: CalendarWeekNumberCellProps & React.HTMLAttributes<HTMLElement>): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare function CalendarWeekNumberCell({ week, weekStartsOn, pickerType, calendarKind, weekNumberLabel, weekLabel, fiscalWeekNumberLabel, fiscalWeekAriaLabel, getCellMeta, onWeekSelect, blank, className, ...weekProps }: CalendarWeekNumberCellProps & React.HTMLAttributes<HTMLElement>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,60 +1,61 @@
|
|
|
1
|
-
import { jsx as
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { cn as
|
|
4
|
-
import { weekNumberBaseClassName as
|
|
5
|
-
function
|
|
6
|
-
const
|
|
7
|
-
return
|
|
8
|
-
(
|
|
3
|
+
import { cn as h } from "../../../lib/utils.js";
|
|
4
|
+
import { weekNumberBaseClassName as y, weekNumberInteractiveClassName as M, weekNumberSelectedFillClassName as v, weekNumberFocusClassName as F } from "./calendar-selection-appearance.js";
|
|
5
|
+
function j(e, n) {
|
|
6
|
+
const s = e.getFullYear(), u = e.getMonth(), o = (new Date(s, u, 1).getDay() + 7 - n) % 7, c = new Date(s, u, 1 - o), i = new Date(e), m = (e.getDay() + 7 - n) % 7;
|
|
7
|
+
return i.setDate(e.getDate() - m), Math.round(
|
|
8
|
+
(i.getTime() - c.getTime()) / (10080 * 60 * 1e3)
|
|
9
9
|
) + 1;
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function P({
|
|
12
12
|
week: e,
|
|
13
|
-
weekStartsOn:
|
|
14
|
-
pickerType:
|
|
13
|
+
weekStartsOn: n,
|
|
14
|
+
pickerType: s,
|
|
15
15
|
calendarKind: u = "gregorian",
|
|
16
|
-
weekNumberLabel:
|
|
17
|
-
weekLabel:
|
|
18
|
-
fiscalWeekNumberLabel:
|
|
19
|
-
fiscalWeekAriaLabel:
|
|
20
|
-
getCellMeta:
|
|
21
|
-
onWeekSelect:
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
weekNumberLabel: D,
|
|
17
|
+
weekLabel: g,
|
|
18
|
+
fiscalWeekNumberLabel: o,
|
|
19
|
+
fiscalWeekAriaLabel: c,
|
|
20
|
+
getCellMeta: i,
|
|
21
|
+
onWeekSelect: N,
|
|
22
|
+
blank: m = !1,
|
|
23
|
+
className: l,
|
|
24
|
+
...C
|
|
24
25
|
}) {
|
|
25
26
|
const d = e.days.find((f) => !f.outside)?.date;
|
|
26
|
-
if (!d)
|
|
27
|
-
return /* @__PURE__ */
|
|
27
|
+
if (m || !d)
|
|
28
|
+
return /* @__PURE__ */ r(
|
|
28
29
|
"th",
|
|
29
30
|
{
|
|
30
31
|
scope: "row",
|
|
31
32
|
"aria-hidden": "true",
|
|
32
|
-
className:
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
className: h(
|
|
34
|
+
y,
|
|
35
|
+
l
|
|
35
36
|
)
|
|
36
37
|
}
|
|
37
38
|
);
|
|
38
|
-
const
|
|
39
|
-
if (
|
|
40
|
-
const f = () =>
|
|
41
|
-
return /* @__PURE__ */
|
|
39
|
+
const w = i?.(d), a = w?.fiscalWeek, p = j(d, n), k = a ?? p, b = a && o ? o(a) : D(k), x = a && w && c ? c(w) : g(p);
|
|
40
|
+
if (s === "week") {
|
|
41
|
+
const f = () => N(d);
|
|
42
|
+
return /* @__PURE__ */ r(
|
|
42
43
|
"td",
|
|
43
44
|
{
|
|
44
45
|
"aria-label": x,
|
|
45
|
-
"data-week-index":
|
|
46
|
-
"data-week-number":
|
|
46
|
+
"data-week-index": p,
|
|
47
|
+
"data-week-number": k,
|
|
47
48
|
"data-fiscal-week": a,
|
|
48
49
|
"data-selection": "period-row",
|
|
49
50
|
tabIndex: 0,
|
|
50
51
|
role: "button",
|
|
51
|
-
className:
|
|
52
|
-
|
|
52
|
+
className: h(
|
|
53
|
+
y,
|
|
54
|
+
F,
|
|
53
55
|
v,
|
|
54
56
|
M,
|
|
55
|
-
C,
|
|
56
57
|
"cursor-pointer transition-colors",
|
|
57
|
-
|
|
58
|
+
l
|
|
58
59
|
),
|
|
59
60
|
onClick: (t) => {
|
|
60
61
|
t.preventDefault(), t.stopPropagation(), f();
|
|
@@ -62,26 +63,26 @@ function O({
|
|
|
62
63
|
onKeyDown: (t) => {
|
|
63
64
|
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), t.stopPropagation(), f());
|
|
64
65
|
},
|
|
65
|
-
children: /* @__PURE__ */
|
|
66
|
+
children: /* @__PURE__ */ r("div", { className: "flex h-9 w-full items-center justify-center text-center", children: b })
|
|
66
67
|
}
|
|
67
68
|
);
|
|
68
69
|
}
|
|
69
|
-
return /* @__PURE__ */
|
|
70
|
+
return /* @__PURE__ */ r(
|
|
70
71
|
"th",
|
|
71
72
|
{
|
|
72
|
-
...
|
|
73
|
+
...C,
|
|
73
74
|
"aria-label": x,
|
|
74
|
-
"data-week-number":
|
|
75
|
+
"data-week-number": k,
|
|
75
76
|
"data-fiscal-week": a,
|
|
76
|
-
className:
|
|
77
|
-
|
|
78
|
-
|
|
77
|
+
className: h(
|
|
78
|
+
y,
|
|
79
|
+
l
|
|
79
80
|
),
|
|
80
81
|
scope: "row",
|
|
81
|
-
children: /* @__PURE__ */
|
|
82
|
+
children: /* @__PURE__ */ r("div", { className: "flex h-9 w-full items-center justify-center text-center whitespace-nowrap", children: b })
|
|
82
83
|
}
|
|
83
84
|
);
|
|
84
85
|
}
|
|
85
86
|
export {
|
|
86
|
-
|
|
87
|
+
P as CalendarWeekNumberCell
|
|
87
88
|
};
|
|
@@ -14,6 +14,12 @@ export declare function fiscalPeriodForWeek(week: {
|
|
|
14
14
|
}, getCellMeta?: (date: Date) => {
|
|
15
15
|
fiscalPeriod?: number;
|
|
16
16
|
} | undefined): number | undefined;
|
|
17
|
+
/** A fiscal week belongs to one period pane. Other panes keep a blank reserved row. */
|
|
18
|
+
export declare function isForeignFiscalWeekRow(options: {
|
|
19
|
+
calendarKind: CalendarKind;
|
|
20
|
+
weekPeriod?: number;
|
|
21
|
+
panePeriod?: number;
|
|
22
|
+
}): boolean;
|
|
17
23
|
export declare function isSameWeek(w1: WeekSelection, w2: WeekSelection): boolean;
|
|
18
24
|
export declare function calculateWeekSelection(weekOrDate: WeekPickerInput, options: {
|
|
19
25
|
calendarKind: CalendarKind;
|