impact-nova 2.5.9 → 2.5.11
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-display/calendar/calendar-apply-validation.d.ts +2 -0
- package/dist/components/data-display/calendar/calendar-apply-validation.js +64 -67
- package/dist/components/data-display/calendar/calendar-available-view.d.ts +27 -0
- package/dist/components/data-display/calendar/calendar-available-view.js +85 -0
- package/dist/components/data-display/calendar/calendar-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 +5 -2
- package/dist/components/data-display/calendar/calendar-day-picker-components.js +210 -167
- 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 +126 -124
- package/dist/components/data-display/calendar/calendar-fiscal-period-nav.d.ts +6 -0
- package/dist/components/data-display/calendar/calendar-fiscal-period-nav.js +34 -18
- package/dist/components/data-display/calendar/calendar-month-utils.d.ts +5 -0
- package/dist/components/data-display/calendar/calendar-month-utils.js +85 -64
- package/dist/components/data-display/calendar/calendar-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-selection-appearance.d.ts +1 -0
- package/dist/components/data-display/calendar/calendar-selection-appearance.js +31 -30
- package/dist/components/data-display/calendar/calendar-week-number-cell.d.ts +3 -1
- package/dist/components/data-display/calendar/calendar-week-number-cell.js +68 -53
- 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-year-panes.d.ts +2 -0
- package/dist/components/data-display/calendar/calendar-year-panes.js +3 -1
- package/dist/components/data-display/calendar/calendar.js +170 -165
- package/dist/components/data-display/calendar/calendar.types.d.ts +7 -0
- package/dist/components/data-display/calendar/use-calendar-day-picker-config.d.ts +5 -2
- package/dist/components/data-display/calendar/use-calendar-day-picker-config.js +86 -76
- package/dist/components/data-display/calendar/use-calendar-state.d.ts +3 -1
- package/dist/components/data-display/calendar/use-calendar-state.js +403 -325
- package/dist/components/feedback/dialog/dialog.js +12 -12
- package/dist/components/feedback/sheet/sheet.js +22 -22
- 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 +74 -70
- package/dist/components/forms/date-picker/date-picker.types.d.ts +7 -0
- package/dist/components/forms/date-picker/date-range-picker.js +148 -144
- package/dist/components/forms/date-picker/fiscal-pass-through.d.ts +2 -0
- package/dist/components/forms/date-picker/fiscal-pass-through.js +4 -2
- package/dist/components/forms/date-picker/month-picker.js +84 -80
- package/dist/components/forms/date-picker/month-range-picker.js +147 -143
- package/dist/components/forms/date-picker/multi-date-picker.js +53 -49
- package/dist/components/forms/date-picker/multi-month-picker.js +51 -47
- package/dist/components/forms/date-picker/multi-quarter-picker.js +48 -44
- package/dist/components/forms/date-picker/multi-week-picker.js +55 -51
- package/dist/components/forms/date-picker/multi-year-picker.js +50 -46
- package/dist/components/forms/date-picker/picker-story-layout.d.ts +2 -0
- package/dist/components/forms/date-picker/quarter-picker.js +48 -44
- package/dist/components/forms/date-picker/quarter-range-picker.js +47 -43
- package/dist/components/forms/date-picker/week-picker.js +86 -82
- package/dist/components/forms/date-picker/week-range-picker.js +171 -164
- package/dist/components/forms/date-picker/year-picker.js +49 -45
- package/dist/components/forms/date-picker/year-range-picker.js +49 -45
- package/dist/components/forms/select/components/SelectMenuPanel.js +3 -2
- package/dist/components/forms/select/select.js +1 -0
- package/dist/form-react/Fields/DateInputField.js +51 -50
- package/dist/form-react/Fields/DateRangeField.js +14 -13
- package/dist/form-react/Fields/MonthRangeField.js +29 -28
- package/dist/form-react/Fields/MultiMonthPickerField.js +13 -12
- package/dist/form-react/Fields/MultiWeekPickerField.js +18 -17
- package/dist/form-react/Fields/WeekRangePicker.js +48 -48
- package/dist/form-react/types/fields.types.d.ts +14 -0
- package/dist/impact-nova.css +1 -1
- package/dist/lib/overlay/overlay-portal-context.js +16 -16
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/package.json +1 -1
|
@@ -1,153 +1,155 @@
|
|
|
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 x } from "react/jsx-runtime";
|
|
2
|
+
import * as B from "react";
|
|
3
|
+
import { DayPicker as pr } from "react-day-picker";
|
|
4
|
+
import { cn as ur } from "../../../lib/utils.js";
|
|
5
|
+
import { formatPeriodOption as dr } 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 u, 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: E,
|
|
12
12
|
pickerType: s,
|
|
13
|
-
mode:
|
|
14
|
-
weekMode:
|
|
15
|
-
calendarKind:
|
|
16
|
-
granularity:
|
|
13
|
+
mode: e,
|
|
14
|
+
weekMode: f,
|
|
15
|
+
calendarKind: m,
|
|
16
|
+
granularity: F,
|
|
17
17
|
showOutsideDays: d,
|
|
18
|
-
fixedWeeks:
|
|
19
|
-
captionLayout:
|
|
20
|
-
buttonVariant:
|
|
21
|
-
weekStartsOn:
|
|
22
|
-
formatters:
|
|
23
|
-
classNames:
|
|
24
|
-
components:
|
|
25
|
-
selected:
|
|
26
|
-
showFooter:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
18
|
+
fixedWeeks: g,
|
|
19
|
+
captionLayout: L,
|
|
20
|
+
buttonVariant: O,
|
|
21
|
+
weekStartsOn: v,
|
|
22
|
+
formatters: V,
|
|
23
|
+
classNames: Y,
|
|
24
|
+
components: k,
|
|
25
|
+
selected: P,
|
|
26
|
+
showFooter: _,
|
|
27
|
+
showPeriodBoundaries: p,
|
|
28
|
+
pendingSelection: y,
|
|
29
|
+
selectedDaysFromWeeks: R,
|
|
30
|
+
currentMonth: D,
|
|
31
|
+
monthsFull: $,
|
|
32
|
+
monthsShort: q,
|
|
33
|
+
weekNumberHeader: z,
|
|
33
34
|
resolvedStartMonth: w,
|
|
34
|
-
resolvedEndMonth:
|
|
35
|
-
availableYears:
|
|
36
|
-
fiscalPeriods:
|
|
37
|
-
fiscalConfig:
|
|
38
|
-
dateFnsLocale:
|
|
39
|
-
intlLocale:
|
|
40
|
-
weekRangeModifiers:
|
|
41
|
-
onSelect:
|
|
42
|
-
onMonthChange:
|
|
43
|
-
onWeekSelect:
|
|
44
|
-
previousMonthLabel:
|
|
45
|
-
nextMonthLabel:
|
|
46
|
-
monthPlaceholder:
|
|
47
|
-
yearPlaceholder:
|
|
48
|
-
weekNumberLabel:
|
|
49
|
-
weekLabel:
|
|
50
|
-
fiscalWeekAriaLabel:
|
|
51
|
-
getCellMeta:
|
|
52
|
-
formatWeekNumber:
|
|
53
|
-
disabled:
|
|
54
|
-
|
|
35
|
+
resolvedEndMonth: b,
|
|
36
|
+
availableYears: A,
|
|
37
|
+
fiscalPeriods: C,
|
|
38
|
+
fiscalConfig: G,
|
|
39
|
+
dateFnsLocale: I,
|
|
40
|
+
intlLocale: J,
|
|
41
|
+
weekRangeModifiers: M,
|
|
42
|
+
onSelect: Q,
|
|
43
|
+
onMonthChange: N,
|
|
44
|
+
onWeekSelect: U,
|
|
45
|
+
previousMonthLabel: X,
|
|
46
|
+
nextMonthLabel: Z,
|
|
47
|
+
monthPlaceholder: W,
|
|
48
|
+
yearPlaceholder: K,
|
|
49
|
+
weekNumberLabel: S,
|
|
50
|
+
weekLabel: T,
|
|
51
|
+
fiscalWeekAriaLabel: rr,
|
|
52
|
+
getCellMeta: n,
|
|
53
|
+
formatWeekNumber: or,
|
|
54
|
+
disabled: h,
|
|
55
|
+
showWeekNumber: j = !0,
|
|
56
|
+
...tr
|
|
55
57
|
}) {
|
|
56
|
-
const { dayPickerClassNames:
|
|
57
|
-
buttonVariant:
|
|
58
|
+
const { dayPickerClassNames: ar, dayPickerComponents: ir } = yr({
|
|
59
|
+
buttonVariant: O,
|
|
58
60
|
pickerType: s,
|
|
59
|
-
calendarKind:
|
|
60
|
-
granularity:
|
|
61
|
+
calendarKind: m,
|
|
62
|
+
granularity: F,
|
|
61
63
|
showOutsideDays: d,
|
|
62
|
-
classNames:
|
|
63
|
-
currentMonth:
|
|
64
|
-
monthsFull:
|
|
65
|
-
monthsShort:
|
|
66
|
-
weekNumberHeader:
|
|
64
|
+
classNames: Y,
|
|
65
|
+
currentMonth: D,
|
|
66
|
+
monthsFull: $,
|
|
67
|
+
monthsShort: q,
|
|
68
|
+
weekNumberHeader: z,
|
|
67
69
|
resolvedStartMonth: w,
|
|
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
|
-
|
|
70
|
+
resolvedEndMonth: b,
|
|
71
|
+
availableYears: A,
|
|
72
|
+
fiscalPeriods: C,
|
|
73
|
+
fiscalConfig: G,
|
|
74
|
+
weekStartsOn: v,
|
|
75
|
+
previousMonthLabel: X,
|
|
76
|
+
nextMonthLabel: Z,
|
|
77
|
+
monthPlaceholder: W,
|
|
78
|
+
yearPlaceholder: K,
|
|
79
|
+
weekNumberLabel: S,
|
|
80
|
+
weekLabel: T,
|
|
81
|
+
fiscalWeekNumberLabel: S,
|
|
82
|
+
fiscalWeekAriaLabel: rr,
|
|
83
|
+
getCellMeta: n,
|
|
84
|
+
onMonthChange: N,
|
|
85
|
+
onWeekSelect: U,
|
|
86
|
+
weekMode: f,
|
|
87
|
+
showPeriodBoundaries: p,
|
|
88
|
+
showWeekNumber: j,
|
|
89
|
+
disabled: h,
|
|
90
|
+
components: k
|
|
91
|
+
}), 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" || d, H = p && n ? {
|
|
92
|
+
fiscal_period_start: (r) => !!n(r)?.isPeriodStart,
|
|
93
|
+
fiscal_period_end: (r) => !!n(r)?.isPeriodEnd
|
|
94
|
+
} : void 0, [t, cr] = B.useState(), fr = B.useCallback((r) => {
|
|
95
|
+
cr((o) => !o && !r || o && r && o.getFullYear() === r.getFullYear() && o.getMonth() === r.getMonth() && o.getDate() === r.getDate() ? o : r);
|
|
96
|
+
}, []), 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;
|
|
97
|
+
return /* @__PURE__ */ x(gr, { onDayHover: fr, children: /* @__PURE__ */ x(
|
|
98
|
+
pr,
|
|
94
99
|
{
|
|
95
|
-
mode:
|
|
96
|
-
selected: s === "week" ?
|
|
100
|
+
mode: nr,
|
|
101
|
+
selected: s === "week" ? R : _ ? y : P,
|
|
97
102
|
onSelect: (...r) => {
|
|
98
|
-
const [
|
|
99
|
-
|
|
103
|
+
const [o, c] = r;
|
|
104
|
+
Q(o, c instanceof Date ? c : void 0);
|
|
100
105
|
},
|
|
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) =>
|
|
106
|
+
month: D,
|
|
107
|
+
onMonthChange: N,
|
|
108
|
+
fixedWeeks: g,
|
|
109
|
+
showOutsideDays: sr,
|
|
110
|
+
weekStartsOn: v,
|
|
111
|
+
modifiers: s === "week" ? { ...M, ...H } : { ...H, ...s === "date" && !!(i && !mr && t) && i && t ? {
|
|
112
|
+
preview: (r) => _r(r, i, t),
|
|
113
|
+
preview_cap: (r) => u(r, i, t),
|
|
114
|
+
preview_cap_start: (r) => u(r, i, t) && l(t) < l(i),
|
|
115
|
+
preview_cap_end: (r) => u(r, i, t) && l(t) > l(i)
|
|
111
116
|
} : void 0 },
|
|
112
117
|
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
|
|
118
|
+
...p && m === "fiscal" ? Pr : void 0,
|
|
119
|
+
...vr
|
|
118
120
|
},
|
|
119
|
-
locale:
|
|
120
|
-
className:
|
|
121
|
+
locale: I,
|
|
122
|
+
className: ur(
|
|
121
123
|
"bg-canvas group/calendar p-2 [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",
|
|
122
124
|
String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
|
|
123
125
|
String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
|
|
124
|
-
|
|
126
|
+
E
|
|
125
127
|
),
|
|
126
|
-
captionLayout:
|
|
128
|
+
captionLayout: L,
|
|
127
129
|
navLayout: "around",
|
|
128
130
|
startMonth: w,
|
|
129
|
-
endMonth:
|
|
130
|
-
disabled:
|
|
131
|
-
numberOfMonths:
|
|
132
|
-
showWeekNumber: !0,
|
|
131
|
+
endMonth: b,
|
|
132
|
+
disabled: h,
|
|
133
|
+
numberOfMonths: er,
|
|
133
134
|
formatters: {
|
|
134
135
|
formatMonthDropdown: (r) => {
|
|
135
|
-
if (
|
|
136
|
-
const
|
|
137
|
-
if (
|
|
138
|
-
if (
|
|
136
|
+
if (m === "fiscal" && n) {
|
|
137
|
+
const o = n(r), c = C?.find((lr) => lr.period === o?.fiscalPeriod);
|
|
138
|
+
if (c) return dr(c);
|
|
139
|
+
if (o?.fiscalPeriod != null) return `P${o.fiscalPeriod}`;
|
|
139
140
|
}
|
|
140
|
-
return r.toLocaleString(
|
|
141
|
+
return r.toLocaleString(J, { month: "short" });
|
|
141
142
|
},
|
|
142
|
-
formatWeekNumber:
|
|
143
|
-
...
|
|
143
|
+
formatWeekNumber: or,
|
|
144
|
+
...V
|
|
144
145
|
},
|
|
145
|
-
classNames:
|
|
146
|
-
components:
|
|
147
|
-
...
|
|
146
|
+
classNames: ar,
|
|
147
|
+
components: ir,
|
|
148
|
+
...tr,
|
|
149
|
+
showWeekNumber: j
|
|
148
150
|
}
|
|
149
151
|
) });
|
|
150
152
|
}
|
|
151
153
|
export {
|
|
152
|
-
|
|
154
|
+
Br as CalendarDayPickerView
|
|
153
155
|
};
|
|
@@ -14,3 +14,9 @@ export declare function dominantCivilMonthForPeriod(period: FiscalPeriod): {
|
|
|
14
14
|
export declare function visibleMonthForPeriod(period: FiscalPeriod, isRightPanel: boolean): Date;
|
|
15
15
|
/** Period that occupies the most days of a civil month (caption selected value). */
|
|
16
16
|
export declare function periodForCivilMonth(periods: readonly FiscalPeriod[], year: number, monthIndex: number): FiscalPeriod | undefined;
|
|
17
|
+
export declare function periodsAvailableInBounds(periods: readonly FiscalPeriod[], disabled?: unknown): FiscalPeriod[];
|
|
18
|
+
export declare function periodForFiscalYearChange(options: {
|
|
19
|
+
periods: readonly FiscalPeriod[];
|
|
20
|
+
preferredPeriod?: number;
|
|
21
|
+
disabled?: unknown;
|
|
22
|
+
}): FiscalPeriod | undefined;
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
import { setDate as m, startOfMonth as s, addMonths as
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { setDate as m, startOfMonth as s, addMonths as f } from "date-fns";
|
|
2
|
+
import { localDateFromCivil as d, parseCivilDate as h, toCivilDate as u, lastDayOfMonth as v, compareCivil as y, diffDays as p, minCivil as D, maxCivil as M } from "../../../lib/fiscal-calendar/civil-date.js";
|
|
3
|
+
import { isDateIntervalDisabled as C } from "./calendar-month-utils.js";
|
|
4
|
+
function O(t) {
|
|
4
5
|
return m(s(t), 15);
|
|
5
6
|
}
|
|
6
|
-
function
|
|
7
|
-
return s(
|
|
7
|
+
function S(t, n) {
|
|
8
|
+
return s(f(t, n));
|
|
8
9
|
}
|
|
9
10
|
function c(t, n, o, e) {
|
|
10
|
-
const r =
|
|
11
|
-
return
|
|
11
|
+
const r = u(o, e + 1, 1), a = v(o, e + 1), i = M(t, r), l = D(n, a);
|
|
12
|
+
return y(i, l) > 0 ? 0 : p(l, i) + 1;
|
|
12
13
|
}
|
|
13
|
-
function
|
|
14
|
-
const n =
|
|
14
|
+
function b(t) {
|
|
15
|
+
const n = h(t.start);
|
|
15
16
|
let o = { year: n.y, monthIndex: n.m - 1, days: 0 };
|
|
16
17
|
const e = t.gregorianMonthSpan.length > 0 ? t.gregorianMonthSpan : [{ year: n.y, month: n.m - 1 }];
|
|
17
18
|
for (const { year: r, month: a } of e) {
|
|
@@ -20,11 +21,11 @@ function C(t) {
|
|
|
20
21
|
}
|
|
21
22
|
return { year: o.year, monthIndex: o.monthIndex };
|
|
22
23
|
}
|
|
23
|
-
function
|
|
24
|
-
const { year: o, monthIndex: e } =
|
|
25
|
-
return n ?
|
|
24
|
+
function P(t, n) {
|
|
25
|
+
const { year: o, monthIndex: e } = b(t), r = s(new Date(o, e, 1));
|
|
26
|
+
return n ? f(r, -1) : r;
|
|
26
27
|
}
|
|
27
|
-
function
|
|
28
|
+
function A(t, n, o) {
|
|
28
29
|
let e, r = 0;
|
|
29
30
|
for (const a of t) {
|
|
30
31
|
const i = c(a.start, a.end, n, o);
|
|
@@ -32,10 +33,25 @@ function O(t, n, o) {
|
|
|
32
33
|
}
|
|
33
34
|
return e;
|
|
34
35
|
}
|
|
36
|
+
function g(t, n) {
|
|
37
|
+
return t.filter(
|
|
38
|
+
(o) => !C(
|
|
39
|
+
d(o.start),
|
|
40
|
+
d(o.end),
|
|
41
|
+
n
|
|
42
|
+
)
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
function E(t) {
|
|
46
|
+
const n = g(t.periods, t.disabled);
|
|
47
|
+
return n.find((o) => o.period === t.preferredPeriod) ?? n[0];
|
|
48
|
+
}
|
|
35
49
|
export {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
50
|
+
S as civilMonthAtOffset,
|
|
51
|
+
b as dominantCivilMonthForPeriod,
|
|
52
|
+
O as midMonthDate,
|
|
53
|
+
A as periodForCivilMonth,
|
|
54
|
+
E as periodForFiscalYearChange,
|
|
55
|
+
g as periodsAvailableInBounds,
|
|
56
|
+
P as visibleMonthForPeriod
|
|
41
57
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Option } from '../../forms/select';
|
|
2
|
+
import { Granularity } from '../../../lib/fiscal-calendar';
|
|
2
3
|
import { MonthRange, MonthSelection } from './calendar.types';
|
|
3
4
|
export declare function isSameMonth(m1: MonthSelection, m2: MonthSelection): boolean;
|
|
4
5
|
export declare function nextMonthSelection(selection: MonthSelection, prev: MonthSelection | MonthSelection[] | MonthRange | undefined, monthMode: "single" | "multiple" | "range"): MonthSelection | MonthSelection[] | MonthRange | undefined;
|
|
@@ -10,6 +11,10 @@ export declare function getMonthRangeProps(year: number, month: number, currentS
|
|
|
10
11
|
};
|
|
11
12
|
/** True when the interval lies completely outside `disabled.before` / `disabled.after`. */
|
|
12
13
|
export declare function isDateIntervalDisabled(start: Date, end: Date, disabled?: unknown): boolean;
|
|
14
|
+
/** True when every day of `[start, end]` is inside `disabled.before` / `disabled.after`. */
|
|
15
|
+
export declare function isWeekFullyInsideBounds(start: Date, end: Date, disabled?: unknown): boolean;
|
|
16
|
+
/** Week granularity requires every day in bounds; other granularities allow mixed weeks. */
|
|
17
|
+
export declare function isWeekSelectableInBounds(start: Date, end: Date, disabled?: unknown, granularity?: Granularity): boolean;
|
|
13
18
|
export declare function isMonthDisabled(year: number, monthIndex: number, disabled?: unknown): boolean;
|
|
14
19
|
export declare function getAvailableYears(startMonth: Date, endMonth: Date): Option[];
|
|
15
20
|
export declare function getAvailableMonths(year: number, monthsFull: string[], startMonth: Date, endMonth: Date): Option[];
|
|
@@ -1,97 +1,118 @@
|
|
|
1
|
-
import { isMonthRangeSelection as
|
|
2
|
-
function
|
|
3
|
-
return
|
|
1
|
+
import { isMonthRangeSelection as c } from "../../forms/date-picker/calendar-selection-adapters.js";
|
|
2
|
+
function u(t, n) {
|
|
3
|
+
return t.fy != null && n.fy != null && t.period != null && n.period != null ? t.fy === n.fy && t.period === n.period : t.year === n.year && t.month === n.month;
|
|
4
4
|
}
|
|
5
|
-
function g(
|
|
6
|
-
if (o === "single") return
|
|
5
|
+
function g(t, n, o) {
|
|
6
|
+
if (o === "single") return t;
|
|
7
7
|
if (o === "multiple") {
|
|
8
|
-
const
|
|
9
|
-
return
|
|
8
|
+
const r = n || [];
|
|
9
|
+
return r.some((i) => u(i, t)) ? r.filter((i) => !u(i, t)) : [...r, t];
|
|
10
10
|
}
|
|
11
|
-
const
|
|
12
|
-
if (!
|
|
13
|
-
const s = new Date(
|
|
14
|
-
return new Date(
|
|
11
|
+
const e = n;
|
|
12
|
+
if (!e?.from || e.to) return { from: t };
|
|
13
|
+
const s = new Date(e.from.year, e.from.month, 1);
|
|
14
|
+
return new Date(t.year, t.month, 1) < s ? { from: t, to: e.from } : { from: e.from, to: t };
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function w(t, n, o) {
|
|
17
17
|
if (!o) return !1;
|
|
18
18
|
if (Array.isArray(o)) {
|
|
19
|
-
const s = { year:
|
|
20
|
-
return o.some((
|
|
19
|
+
const s = { year: t, month: n, fy: t, period: n + 1 };
|
|
20
|
+
return o.some((a) => u(a, s) || a.year === t && a.month === n);
|
|
21
21
|
}
|
|
22
|
-
if (
|
|
23
|
-
const s = o,
|
|
24
|
-
if (!
|
|
25
|
-
const
|
|
26
|
-
if (!
|
|
27
|
-
const
|
|
28
|
-
if (!
|
|
29
|
-
const
|
|
30
|
-
return
|
|
22
|
+
if (c(o)) {
|
|
23
|
+
const s = o, a = s.from, r = s.to;
|
|
24
|
+
if (!a && !r) return !1;
|
|
25
|
+
const f = new Date(t, n, 1).getTime();
|
|
26
|
+
if (!a) return r ? f === new Date(r.year, r.month, 1).getTime() : !1;
|
|
27
|
+
const i = new Date(a.year, a.month, 1).getTime();
|
|
28
|
+
if (!r) return f === i;
|
|
29
|
+
const d = new Date(r.year, r.month, 1).getTime();
|
|
30
|
+
return f >= i && f <= d;
|
|
31
31
|
}
|
|
32
|
-
const
|
|
33
|
-
return
|
|
32
|
+
const e = o;
|
|
33
|
+
return e.fy != null && e.period != null ? e.fy === t && e.period === n + 1 : e.year === t && e.month === n;
|
|
34
34
|
}
|
|
35
|
-
function y(
|
|
35
|
+
function y(t, n, o) {
|
|
36
36
|
if (!o || !("from" in o))
|
|
37
37
|
return { isStart: !1, isEnd: !1, isMiddle: !1 };
|
|
38
|
-
const
|
|
39
|
-
if (!s && !
|
|
40
|
-
const
|
|
38
|
+
const e = o, s = e.from, a = e.to;
|
|
39
|
+
if (!s && !a) return { isStart: !1, isEnd: !1, isMiddle: !1 };
|
|
40
|
+
const r = new Date(t, n, 1).getTime();
|
|
41
41
|
if (!s)
|
|
42
42
|
return {
|
|
43
43
|
isStart: !1,
|
|
44
|
-
isEnd:
|
|
44
|
+
isEnd: a ? r === new Date(a.year, a.month, 1).getTime() : !1,
|
|
45
45
|
isMiddle: !1
|
|
46
46
|
};
|
|
47
|
-
const
|
|
48
|
-
if (!
|
|
49
|
-
const
|
|
47
|
+
const f = new Date(s.year, s.month, 1).getTime();
|
|
48
|
+
if (!a) return { isStart: r === f, isEnd: !1, isMiddle: !1 };
|
|
49
|
+
const i = new Date(a.year, a.month, 1).getTime();
|
|
50
50
|
return {
|
|
51
|
-
isStart:
|
|
52
|
-
isEnd:
|
|
53
|
-
isMiddle:
|
|
51
|
+
isStart: r === f,
|
|
52
|
+
isEnd: r === i,
|
|
53
|
+
isMiddle: r > f && r < i
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
|
-
function
|
|
57
|
-
const
|
|
58
|
-
if (!
|
|
59
|
-
const s = new Date(
|
|
56
|
+
function l(t, n, o) {
|
|
57
|
+
const e = o;
|
|
58
|
+
if (!e || typeof e != "object" || !("before" in e) && !("after" in e)) return !1;
|
|
59
|
+
const s = new Date(t);
|
|
60
60
|
s.setHours(0, 0, 0, 0);
|
|
61
|
-
const
|
|
62
|
-
if (
|
|
63
|
-
const
|
|
64
|
-
if (
|
|
61
|
+
const a = new Date(n);
|
|
62
|
+
if (a.setHours(23, 59, 59, 999), e.before) {
|
|
63
|
+
const r = new Date(e.before);
|
|
64
|
+
if (r.setHours(0, 0, 0, 0), a < r) return !0;
|
|
65
65
|
}
|
|
66
|
-
if (
|
|
67
|
-
const
|
|
68
|
-
if (
|
|
66
|
+
if (e.after) {
|
|
67
|
+
const r = new Date(e.after);
|
|
68
|
+
if (r.setHours(23, 59, 59, 999), s > r) return !0;
|
|
69
69
|
}
|
|
70
70
|
return !1;
|
|
71
71
|
}
|
|
72
|
-
function
|
|
73
|
-
const
|
|
74
|
-
|
|
72
|
+
function D(t, n, o) {
|
|
73
|
+
const e = o;
|
|
74
|
+
if (!e || typeof e != "object" || !("before" in e) && !("after" in e)) return !0;
|
|
75
|
+
const s = new Date(t);
|
|
76
|
+
s.setHours(0, 0, 0, 0);
|
|
77
|
+
const a = new Date(n);
|
|
78
|
+
if (a.setHours(0, 0, 0, 0), e.before) {
|
|
79
|
+
const r = new Date(e.before);
|
|
80
|
+
if (r.setHours(0, 0, 0, 0), s < r) return !1;
|
|
81
|
+
}
|
|
82
|
+
if (e.after) {
|
|
83
|
+
const r = new Date(e.after);
|
|
84
|
+
if (r.setHours(0, 0, 0, 0), a > r) return !1;
|
|
85
|
+
}
|
|
86
|
+
return !0;
|
|
87
|
+
}
|
|
88
|
+
function b(t, n, o, e) {
|
|
89
|
+
return e && e !== "week" ? !l(t, n, o) : D(t, n, o);
|
|
90
|
+
}
|
|
91
|
+
function h(t, n, o) {
|
|
92
|
+
const e = new Date(t, n, 1, 0, 0, 0, 0), s = new Date(t, n + 1, 0, 23, 59, 59, 999);
|
|
93
|
+
return l(e, s, o);
|
|
75
94
|
}
|
|
76
|
-
function
|
|
77
|
-
const o =
|
|
78
|
-
for (let
|
|
79
|
-
s.push({ label:
|
|
95
|
+
function p(t, n) {
|
|
96
|
+
const o = t.getFullYear(), e = n.getFullYear(), s = [];
|
|
97
|
+
for (let a = o; a <= e; a++)
|
|
98
|
+
s.push({ label: a.toString(), value: a.toString() });
|
|
80
99
|
return s;
|
|
81
100
|
}
|
|
82
|
-
function
|
|
83
|
-
return n.map((s,
|
|
84
|
-
const
|
|
85
|
-
return !(
|
|
101
|
+
function M(t, n, o, e) {
|
|
102
|
+
return n.map((s, a) => ({ label: s, value: a.toString() })).filter((s, a) => {
|
|
103
|
+
const r = new Date(t, a, 1);
|
|
104
|
+
return !(r < new Date(o.getFullYear(), o.getMonth(), 1) || r > new Date(e.getFullYear(), e.getMonth(), 1));
|
|
86
105
|
});
|
|
87
106
|
}
|
|
88
107
|
export {
|
|
89
|
-
|
|
90
|
-
|
|
108
|
+
M as getAvailableMonths,
|
|
109
|
+
p as getAvailableYears,
|
|
91
110
|
y as getMonthRangeProps,
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
111
|
+
l as isDateIntervalDisabled,
|
|
112
|
+
h as isMonthDisabled,
|
|
113
|
+
w as isMonthSelected,
|
|
114
|
+
u as isSameMonth,
|
|
115
|
+
D as isWeekFullyInsideBounds,
|
|
116
|
+
b as isWeekSelectableInBounds,
|
|
96
117
|
g as nextMonthSelection
|
|
97
118
|
};
|
|
@@ -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
|
};
|
|
@@ -22,6 +22,7 @@ export declare const previewCapStartCellClassName = "calendar-interval-cap-start
|
|
|
22
22
|
export declare const previewCapEndCellClassName = "calendar-interval-cap-end";
|
|
23
23
|
export declare const weekNumberTypeClassName = "text-[11px] font-medium text-content-icon";
|
|
24
24
|
export declare const weekNumberInteractiveClassName = "text-brand group-has-[.rdp-selected]/week:text-brand group-hover/week:text-brand";
|
|
25
|
+
export declare const weekNumberBlockedClassName = "cursor-not-allowed text-content-placeholder opacity-50 group-hover/week:text-content-placeholder group-has-[.rdp-selected]/week:text-content-placeholder";
|
|
25
26
|
export declare const weekNumberBaseClassName: string;
|
|
26
27
|
export declare const weekNumberSelectedFillClassName = "group-data-[week-selected]/week:bg-accent";
|
|
27
28
|
export declare const weekNumberFocusClassName = "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring";
|