impact-nova 2.5.9 → 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 +194 -162
- 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-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/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/form-react/Fields/WeekRangePicker.js +47 -48
- package/dist/form-react/types/fields.types.d.ts +2 -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,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
|
};
|
|
@@ -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;
|
|
@@ -1,71 +1,74 @@
|
|
|
1
|
-
import { civilFromLocalDate as
|
|
2
|
-
import { resolveWeekSelection as
|
|
3
|
-
function
|
|
4
|
-
const o =
|
|
1
|
+
import { civilFromLocalDate as l } from "../../../lib/fiscal-calendar/civil-date.js";
|
|
2
|
+
import { resolveWeekSelection as W } from "../../../lib/fiscal-calendar/week-selection.js";
|
|
3
|
+
function v(e, n) {
|
|
4
|
+
const o = e.days[0]?.date;
|
|
5
5
|
if (o)
|
|
6
6
|
return n?.(o)?.fiscalPeriod;
|
|
7
7
|
}
|
|
8
|
-
function
|
|
9
|
-
return
|
|
8
|
+
function A(e) {
|
|
9
|
+
return e.calendarKind !== "fiscal" || e.weekPeriod == null || e.panePeriod == null ? !1 : e.weekPeriod !== e.panePeriod;
|
|
10
10
|
}
|
|
11
|
-
function
|
|
12
|
-
|
|
13
|
-
return T(o, n);
|
|
11
|
+
function m(e, n) {
|
|
12
|
+
return e.year === n.year && e.month === n.month && e.weekOfMonth === n.weekOfMonth;
|
|
14
13
|
}
|
|
15
|
-
function
|
|
16
|
-
|
|
14
|
+
function _(e, n) {
|
|
15
|
+
const o = e instanceof Date ? e : e.days.find((t) => !t.outside)?.date ?? e.days[0]?.date ?? /* @__PURE__ */ new Date();
|
|
16
|
+
return W(o, n);
|
|
17
|
+
}
|
|
18
|
+
function E(e, n, o) {
|
|
19
|
+
if (o === "single") return e;
|
|
17
20
|
if (o === "multiple") {
|
|
18
21
|
const a = n || [];
|
|
19
|
-
return a.some((f) =>
|
|
22
|
+
return a.some((f) => m(f, e)) ? a.filter((f) => !m(f, e)) : [...a, e];
|
|
20
23
|
}
|
|
21
|
-
const
|
|
22
|
-
if (!
|
|
23
|
-
if (
|
|
24
|
-
const s = { from:
|
|
25
|
-
return
|
|
24
|
+
const t = n;
|
|
25
|
+
if (!t?.from || t.to) return { from: e };
|
|
26
|
+
if (m(e, t.from)) return t;
|
|
27
|
+
const s = { from: t.from, to: e };
|
|
28
|
+
return e.startDate < t.from.startDate && (s.from = e, s.to = t.from), s;
|
|
26
29
|
}
|
|
27
|
-
function x(
|
|
28
|
-
if (!
|
|
29
|
-
const n = [], o = (
|
|
30
|
-
const s = new Date(
|
|
30
|
+
function x(e) {
|
|
31
|
+
if (!e) return;
|
|
32
|
+
const n = [], o = (t) => {
|
|
33
|
+
const s = new Date(t.startDate);
|
|
31
34
|
s.setHours(0, 0, 0, 0);
|
|
32
|
-
const a = new Date(
|
|
35
|
+
const a = new Date(t.endDate);
|
|
33
36
|
for (a.setHours(0, 0, 0, 0); s <= a; )
|
|
34
37
|
n.push(new Date(s)), s.setDate(s.getDate() + 1);
|
|
35
38
|
};
|
|
36
|
-
if (Array.isArray(
|
|
37
|
-
|
|
38
|
-
else if ("from" in
|
|
39
|
-
if (
|
|
40
|
-
if (!
|
|
41
|
-
o(
|
|
39
|
+
if (Array.isArray(e))
|
|
40
|
+
e.forEach(o);
|
|
41
|
+
else if ("from" in e) {
|
|
42
|
+
if (e.from)
|
|
43
|
+
if (!e.to)
|
|
44
|
+
o(e.from);
|
|
42
45
|
else {
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
const s = new Date(
|
|
46
|
-
for (s.setHours(0, 0, 0, 0);
|
|
47
|
-
n.push(new Date(
|
|
46
|
+
const t = new Date(e.from.startDate);
|
|
47
|
+
t.setHours(0, 0, 0, 0);
|
|
48
|
+
const s = new Date(e.to.endDate);
|
|
49
|
+
for (s.setHours(0, 0, 0, 0); t <= s; )
|
|
50
|
+
n.push(new Date(t)), t.setDate(t.getDate() + 1);
|
|
48
51
|
}
|
|
49
52
|
} else
|
|
50
|
-
o(
|
|
53
|
+
o(e);
|
|
51
54
|
return n;
|
|
52
55
|
}
|
|
53
|
-
function
|
|
54
|
-
if (!
|
|
56
|
+
function F(e, n, o) {
|
|
57
|
+
if (!e || e.length === 0)
|
|
55
58
|
return { range_start: [], range_middle: [], range_end: [] };
|
|
56
|
-
const
|
|
59
|
+
const t = [...e].sort((r, i) => r.getTime() - i.getTime()), s = [], a = [], u = [], f = /* @__PURE__ */ new Set(), d = /* @__PURE__ */ new Set();
|
|
57
60
|
n === "multiple" && Array.isArray(o) && o.forEach((r) => {
|
|
58
|
-
f.add(
|
|
61
|
+
f.add(l(r.startDate)), d.add(l(r.endDate));
|
|
59
62
|
});
|
|
60
|
-
const
|
|
63
|
+
const D = (r, i) => {
|
|
61
64
|
if (i === 0) return !1;
|
|
62
|
-
const c =
|
|
65
|
+
const c = t[i - 1];
|
|
63
66
|
return r.getTime() - c.getTime() <= 1440 * 60 * 1e3;
|
|
64
|
-
},
|
|
65
|
-
return
|
|
66
|
-
const c =
|
|
67
|
+
}, p = (r, i) => i === t.length - 1 ? !1 : t[i + 1].getTime() - r.getTime() <= 1440 * 60 * 1e3;
|
|
68
|
+
return t.forEach((r, i) => {
|
|
69
|
+
const c = l(r), S = f.has(c), y = d.has(c), h = D(r, i), g = p(r, i);
|
|
67
70
|
if (n === "multiple") {
|
|
68
|
-
|
|
71
|
+
S ? s.push(r) : y ? u.push(r) : a.push(r);
|
|
69
72
|
return;
|
|
70
73
|
}
|
|
71
74
|
!h && !g ? (s.push(r), u.push(r)) : h ? g ? a.push(r) : u.push(r) : s.push(r);
|
|
@@ -73,9 +76,10 @@ function H(t, n, o) {
|
|
|
73
76
|
}
|
|
74
77
|
export {
|
|
75
78
|
_ as calculateWeekSelection,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
+
F as computeWeekRangeModifiers,
|
|
80
|
+
v as fiscalPeriodForWeek,
|
|
81
|
+
A as isForeignFiscalWeekRow,
|
|
82
|
+
m as isSameWeek,
|
|
79
83
|
E as nextWeekSelection,
|
|
80
84
|
x as weekSelectionsToDates
|
|
81
85
|
};
|