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
|
@@ -1,28 +1,30 @@
|
|
|
1
1
|
import { jsxs as s, jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { ChevronRight as p } from "impact-nova-icons";
|
|
3
|
+
import { cn as G } from "../../../lib/utils.js";
|
|
3
4
|
import { Button as u } from "../../primitives/button/button.js";
|
|
4
|
-
import { Select as
|
|
5
|
-
import { CalendarPeriodCell as
|
|
6
|
-
import {
|
|
7
|
-
|
|
5
|
+
import { Select as I } from "../../forms/select/select.js";
|
|
6
|
+
import { CalendarPeriodCell as T } from "./calendar-period-cell.js";
|
|
7
|
+
import { PERIOD_RANGE_GRID_CLASSNAME as q } from "./calendar-selection-appearance.js";
|
|
8
|
+
import { getQuarterRangeProps as L, isQuarterRangeSelection as W } from "./calendar-quarter-utils.js";
|
|
9
|
+
function X({
|
|
8
10
|
quarterMode: n,
|
|
9
11
|
pickerYear: g,
|
|
10
12
|
showFooter: h,
|
|
11
13
|
pendingQuarterSelection: v,
|
|
12
14
|
selectedQuarters: x,
|
|
13
|
-
resolvedStartYear:
|
|
14
|
-
resolvedEndYear:
|
|
15
|
+
resolvedStartYear: N,
|
|
16
|
+
resolvedEndYear: f,
|
|
15
17
|
yearOptions: d,
|
|
16
|
-
previousYearLabel:
|
|
17
|
-
nextYearLabel:
|
|
18
|
+
previousYearLabel: w,
|
|
19
|
+
nextYearLabel: b,
|
|
18
20
|
currentMonth: t,
|
|
19
21
|
quarterLabelsForYear: S,
|
|
20
|
-
isQuarterSelected:
|
|
21
|
-
isQuarterDisabled:
|
|
22
|
+
isQuarterSelected: C,
|
|
23
|
+
isQuarterDisabled: R,
|
|
22
24
|
onMonthChange: o,
|
|
23
|
-
onQuarterClick:
|
|
25
|
+
onQuarterClick: k
|
|
24
26
|
}) {
|
|
25
|
-
const c = h ? v : x,
|
|
27
|
+
const c = h ? v : x, z = n === "range" || n === "multiple" || n === "multi-range", m = (l = 0) => {
|
|
26
28
|
const e = g + l;
|
|
27
29
|
return /* @__PURE__ */ s(
|
|
28
30
|
"div",
|
|
@@ -37,14 +39,14 @@ function L({
|
|
|
37
39
|
variant: "ghost",
|
|
38
40
|
size: "icon",
|
|
39
41
|
className: "h-7 w-7 shrink-0",
|
|
40
|
-
"aria-label":
|
|
41
|
-
disabled: e <=
|
|
42
|
+
"aria-label": w,
|
|
43
|
+
disabled: e <= N,
|
|
42
44
|
onClick: () => o(new Date(e - 1, t.getMonth(), 1)),
|
|
43
45
|
children: /* @__PURE__ */ i(p, { size: 16, className: "rotate-180" })
|
|
44
46
|
}
|
|
45
47
|
) : /* @__PURE__ */ i("span", { className: "size-7 shrink-0", "aria-hidden": !0 }),
|
|
46
48
|
/* @__PURE__ */ i(
|
|
47
|
-
|
|
49
|
+
I,
|
|
48
50
|
{
|
|
49
51
|
value: d.find((a) => a.value === String(e)) ?? {
|
|
50
52
|
label: String(e),
|
|
@@ -66,32 +68,32 @@ function L({
|
|
|
66
68
|
variant: "ghost",
|
|
67
69
|
size: "icon",
|
|
68
70
|
className: "h-7 w-7",
|
|
69
|
-
"aria-label":
|
|
70
|
-
disabled: e >=
|
|
71
|
+
"aria-label": b,
|
|
72
|
+
disabled: e >= f,
|
|
71
73
|
onClick: () => o(new Date(e + 1, t.getMonth(), 1)),
|
|
72
74
|
children: /* @__PURE__ */ i(p, { className: "h-4 w-4" })
|
|
73
75
|
}
|
|
74
76
|
)
|
|
75
77
|
] }),
|
|
76
|
-
/* @__PURE__ */ i("div", { "data-period-grid": "", className: "grid
|
|
77
|
-
const r =
|
|
78
|
+
/* @__PURE__ */ i("div", { "data-period-grid": "", className: G(q, "grid-cols-2"), children: S(e).map((a, D) => {
|
|
79
|
+
const r = D + 1, E = C(e, r), P = R(e, r), j = n === "range", { isStart: A, isEnd: Q, isMiddle: _ } = L(
|
|
78
80
|
e,
|
|
79
81
|
r,
|
|
80
82
|
c
|
|
81
|
-
),
|
|
83
|
+
), B = W(c) && !!c.to;
|
|
82
84
|
return /* @__PURE__ */ i(
|
|
83
|
-
|
|
85
|
+
T,
|
|
84
86
|
{
|
|
85
|
-
selected:
|
|
86
|
-
disabled:
|
|
87
|
-
isRange:
|
|
88
|
-
isStart:
|
|
89
|
-
isEnd:
|
|
90
|
-
isMiddle:
|
|
91
|
-
hasRangeEnd: !!
|
|
87
|
+
selected: E,
|
|
88
|
+
disabled: P,
|
|
89
|
+
isRange: j,
|
|
90
|
+
isStart: A,
|
|
91
|
+
isEnd: Q,
|
|
92
|
+
isMiddle: _,
|
|
93
|
+
hasRangeEnd: !!B,
|
|
92
94
|
size: "quarter",
|
|
93
95
|
columns: 2,
|
|
94
|
-
onClick: () =>
|
|
96
|
+
onClick: () => k(e, r),
|
|
95
97
|
caption: a.caption,
|
|
96
98
|
children: a.label
|
|
97
99
|
},
|
|
@@ -104,12 +106,12 @@ function L({
|
|
|
104
106
|
};
|
|
105
107
|
return /* @__PURE__ */ s("div", { "data-slot": "quarter-panes", children: [
|
|
106
108
|
m(0),
|
|
107
|
-
|
|
109
|
+
z ? /* @__PURE__ */ s("div", { "data-slot": "quarter-pane-divider-group", children: [
|
|
108
110
|
/* @__PURE__ */ i("div", { className: "my-4 w-[1px] bg-stroke-hairline" }),
|
|
109
111
|
m(1)
|
|
110
112
|
] }) : null
|
|
111
113
|
] });
|
|
112
114
|
}
|
|
113
115
|
export {
|
|
114
|
-
|
|
116
|
+
X as CalendarQuarterPanes
|
|
115
117
|
};
|
|
@@ -32,6 +32,15 @@ export declare const periodTileHoverClassName = "hover:border-brand hover:bg-acc
|
|
|
32
32
|
export declare const periodTileMiddleClassName = "text-accent-foreground";
|
|
33
33
|
export declare const periodTileDisabledClassName = "cursor-not-allowed text-content-placeholder opacity-50";
|
|
34
34
|
export declare const periodRangeTrackClassName = "bg-accent";
|
|
35
|
+
/** Flush cells like the day grid. Pills inset inside the cell; range track lives on the cell. */
|
|
36
|
+
export declare const PERIOD_RANGE_GRID_CLASSNAME = "grid min-w-0 gap-x-0 gap-y-4";
|
|
37
|
+
/** Same job as a 36px day button in a wider cell — keeps adjacent brand fills from fusing. */
|
|
38
|
+
export declare const periodTileInsetClassName = "mx-1 flex-1";
|
|
39
|
+
export declare function periodRangeTrackPositionClassName(params: {
|
|
40
|
+
isStart: boolean;
|
|
41
|
+
isEnd: boolean;
|
|
42
|
+
squareTile: boolean;
|
|
43
|
+
}): string;
|
|
35
44
|
export declare function dayButtonAppearanceClassName(kind: SelectionKind, pickerType: "date" | "week"): string;
|
|
36
45
|
export declare function periodTileAppearanceClassName(params: {
|
|
37
46
|
kind: SelectionKind;
|
|
@@ -1,73 +1,86 @@
|
|
|
1
1
|
import { cn as e } from "../../../lib/utils.js";
|
|
2
|
-
const l = "h-9 w-9 min-h-9 min-w-9",
|
|
2
|
+
const l = "h-9 w-9 min-h-9 min-w-9", k = "min-w-[292px]", d = "w-9 flex-shrink-0", a = "bg-accent", i = "bg-brand text-brand-foreground", c = "hover:bg-brand-strong hover:text-brand-foreground hover:border-transparent", s = "rounded-lg", u = "rounded-l-lg", p = "rounded-r-lg", m = e(
|
|
3
3
|
"flex items-center justify-center p-0 font-normal text-sm transition-colors",
|
|
4
4
|
"border border-transparent",
|
|
5
|
-
|
|
5
|
+
s,
|
|
6
6
|
"focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring",
|
|
7
7
|
"disabled:pointer-events-none",
|
|
8
8
|
l,
|
|
9
9
|
"rdp-day rdp-day_button"
|
|
10
|
-
),
|
|
11
|
-
c,
|
|
10
|
+
), v = "hover:bg-accent hover:text-accent-foreground hover:border-transparent", b = "hover:bg-transparent hover:text-inherit hover:border-transparent", f = e(
|
|
12
11
|
i,
|
|
13
|
-
|
|
12
|
+
c,
|
|
13
|
+
s,
|
|
14
14
|
"border-transparent"
|
|
15
|
-
),
|
|
15
|
+
), N = "text-accent-foreground rounded-none border-transparent", R = e(
|
|
16
16
|
"group/day relative select-none p-0 text-center flex-1 flex items-center justify-center",
|
|
17
17
|
"h-9 [&:nth-child(2)]:pl-2 rdp-day"
|
|
18
|
-
),
|
|
18
|
+
), g = "calendar-interval-cap-start", S = e(a, "rounded-none"), C = "calendar-interval-cap-end", A = e(a, "rounded-none"), L = g, B = C, x = "text-[11px] font-medium text-content-icon", D = "text-brand group-has-[.rdp-selected]/week:text-brand group-hover/week:text-brand", O = "cursor-not-allowed text-content-placeholder opacity-50 group-hover/week:text-content-placeholder group-has-[.rdp-selected]/week:text-content-placeholder", P = e(
|
|
19
19
|
"select-none flex items-center justify-center",
|
|
20
|
-
|
|
20
|
+
x,
|
|
21
21
|
l,
|
|
22
22
|
d,
|
|
23
23
|
"rdp-week_number"
|
|
24
|
-
),
|
|
24
|
+
), H = "group-data-[week-selected]/week:bg-accent", M = "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring", o = e(
|
|
25
25
|
"relative z-10 border border-transparent p-0 text-sm font-normal transition-colors",
|
|
26
|
-
|
|
26
|
+
s,
|
|
27
27
|
"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus-ring focus-visible:ring-offset-0"
|
|
28
|
-
),
|
|
29
|
-
function
|
|
28
|
+
), h = e(i, c), w = "hover:border-brand hover:bg-accent hover:text-accent-foreground", T = "text-accent-foreground", E = "cursor-not-allowed text-content-placeholder opacity-50", U = a, F = "grid min-w-0 gap-x-0 gap-y-4", j = "mx-1 flex-1";
|
|
29
|
+
function G(t) {
|
|
30
|
+
const { isStart: n, isEnd: r } = t;
|
|
31
|
+
return n && r ? e("inset-x-2", s) : n ? e(
|
|
32
|
+
"left-1/2 right-0 -ml-5",
|
|
33
|
+
u
|
|
34
|
+
) : r ? e(
|
|
35
|
+
"right-1/2 left-0 -mr-5",
|
|
36
|
+
p
|
|
37
|
+
) : "inset-x-0";
|
|
38
|
+
}
|
|
39
|
+
function W(t, n) {
|
|
30
40
|
const r = t === "point" || t === "interval-start" || t === "interval-end";
|
|
31
|
-
return e(
|
|
41
|
+
return e(m, r ? f : t === "interval-middle" ? N : void 0, n === "week" ? r ? void 0 : b : t === "none" ? v : void 0);
|
|
32
42
|
}
|
|
33
|
-
function
|
|
43
|
+
function K(t) {
|
|
34
44
|
const { kind: n, disabled: r } = t;
|
|
35
|
-
return r ? e(o,
|
|
45
|
+
return r ? e(o, E) : n === "point" || n === "interval-start" || n === "interval-end" ? e(o, h) : n === "interval-middle" ? e(o, T) : e(o, w);
|
|
36
46
|
}
|
|
37
47
|
export {
|
|
38
48
|
l as DAY_CELL_SIZE,
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
i as
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
49
|
+
k as DAY_MONTH_MIN_WIDTH,
|
|
50
|
+
a as INTERVAL_TRACK,
|
|
51
|
+
F as PERIOD_RANGE_GRID_CLASSNAME,
|
|
52
|
+
i as POINT_FILL,
|
|
53
|
+
c as POINT_FILL_HOVER,
|
|
54
|
+
s as SELECTION_RADIUS,
|
|
55
|
+
p as SELECTION_RADIUS_END,
|
|
56
|
+
u as SELECTION_RADIUS_START,
|
|
46
57
|
d as WEEK_GUTTER_RULE,
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
58
|
+
W as dayButtonAppearanceClassName,
|
|
59
|
+
m as dayButtonBaseClassName,
|
|
60
|
+
v as dayButtonHoverClassName,
|
|
61
|
+
N as dayButtonMiddleClassName,
|
|
62
|
+
f as dayButtonPointClassName,
|
|
63
|
+
b as dayButtonWeekHoverClassName,
|
|
64
|
+
R as dayCellBaseClassName,
|
|
54
65
|
U as periodRangeTrackClassName,
|
|
55
|
-
|
|
66
|
+
G as periodRangeTrackPositionClassName,
|
|
67
|
+
K as periodTileAppearanceClassName,
|
|
56
68
|
o as periodTileBaseClassName,
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
69
|
+
E as periodTileDisabledClassName,
|
|
70
|
+
w as periodTileHoverClassName,
|
|
71
|
+
j as periodTileInsetClassName,
|
|
72
|
+
T as periodTileMiddleClassName,
|
|
73
|
+
h as periodTilePointClassName,
|
|
74
|
+
B as previewCapEndCellClassName,
|
|
75
|
+
L as previewCapStartCellClassName,
|
|
76
|
+
A as previewCellClassName,
|
|
64
77
|
C as rangeEndCellClassName,
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
78
|
+
S as rangeMiddleCellClassName,
|
|
79
|
+
g as rangeStartCellClassName,
|
|
80
|
+
P as weekNumberBaseClassName,
|
|
68
81
|
O as weekNumberBlockedClassName,
|
|
69
|
-
|
|
82
|
+
M as weekNumberFocusClassName,
|
|
70
83
|
D as weekNumberInteractiveClassName,
|
|
71
|
-
|
|
72
|
-
|
|
84
|
+
H as weekNumberSelectedFillClassName,
|
|
85
|
+
x as weekNumberTypeClassName
|
|
73
86
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Matcher } from 'react-day-picker';
|
|
1
2
|
export type SelectionKind = "none" | "point" | "interval-start" | "interval-middle" | "interval-end";
|
|
2
3
|
export interface SelectionModifiers {
|
|
3
4
|
selected?: boolean;
|
|
@@ -9,6 +10,28 @@ export interface SelectionModifiers {
|
|
|
9
10
|
}
|
|
10
11
|
export declare function selectionKindFromModifiers(modifiers: SelectionModifiers): SelectionKind;
|
|
11
12
|
export declare function dayKey(date: Date): number;
|
|
13
|
+
export declare function isSameCalendarDay(left: Date, right: Date): boolean;
|
|
14
|
+
/** DayPicker precomputes modifiers only for days it generated. Injected weeks match the Date[] matchers themselves. */
|
|
15
|
+
export declare function dateMatchesModifier(matcher: unknown, date: Date): boolean;
|
|
16
|
+
/** Injected CalendarDays are not in DayPicker's identity map. Re-run the same matchers DayPicker uses. */
|
|
17
|
+
export declare function injectedCalendarDayModifiers(params: {
|
|
18
|
+
date: Date;
|
|
19
|
+
disabled?: Matcher | Matcher[];
|
|
20
|
+
today?: Date;
|
|
21
|
+
isSelected?: (date: Date) => boolean;
|
|
22
|
+
customModifiers?: {
|
|
23
|
+
range_start?: unknown;
|
|
24
|
+
range_middle?: unknown;
|
|
25
|
+
range_end?: unknown;
|
|
26
|
+
};
|
|
27
|
+
}): {
|
|
28
|
+
selected: boolean;
|
|
29
|
+
disabled: boolean;
|
|
30
|
+
today: boolean;
|
|
31
|
+
range_start: boolean;
|
|
32
|
+
range_middle: boolean;
|
|
33
|
+
range_end: boolean;
|
|
34
|
+
};
|
|
12
35
|
export declare function isPreviewMiddle(date: Date, from: Date, hovered: Date): boolean;
|
|
13
36
|
export declare function isPreviewCap(date: Date, from: Date, hovered: Date): boolean;
|
|
14
37
|
export declare function periodCellKind(params: {
|
|
@@ -18,3 +41,5 @@ export declare function periodCellKind(params: {
|
|
|
18
41
|
isEnd: boolean;
|
|
19
42
|
isMiddle: boolean;
|
|
20
43
|
}): SelectionKind;
|
|
44
|
+
/** useDayPicker().select is `never` unless the hook is parameterized with `mode`. */
|
|
45
|
+
export declare function callDayPickerSelect(select: unknown, date: Date, modifiers: Record<string, boolean>, event: unknown): void;
|
|
@@ -1,31 +1,60 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { dateMatchModifiers as a } from "react-day-picker";
|
|
2
|
+
function s(e) {
|
|
3
|
+
const n = !!e.range_start, t = !!e.range_end;
|
|
4
|
+
return n && t ? "point" : n ? "interval-start" : t ? "interval-end" : e.range_middle ? "interval-middle" : e.preview_cap ? "interval-end" : e.preview ? "interval-middle" : e.selected ? "point" : "none";
|
|
4
5
|
}
|
|
5
|
-
function
|
|
6
|
-
return
|
|
6
|
+
function i(e) {
|
|
7
|
+
return e.getFullYear() * 1e4 + (e.getMonth() + 1) * 100 + e.getDate();
|
|
7
8
|
}
|
|
8
|
-
function
|
|
9
|
-
|
|
10
|
-
return r > l && r < u;
|
|
9
|
+
function c(e, n) {
|
|
10
|
+
return i(e) === i(n);
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
return r === o(t) && r !== o(e);
|
|
12
|
+
function l(e, n) {
|
|
13
|
+
return e == null || e === !1 ? !1 : e === !0 ? !0 : e instanceof Date ? i(e) === i(n) : typeof e == "function" ? !!e(n) : Array.isArray(e) ? e.some((t) => l(t, n)) : !1;
|
|
15
14
|
}
|
|
16
|
-
function
|
|
17
|
-
const
|
|
18
|
-
return
|
|
19
|
-
selected: e,
|
|
15
|
+
function _(e) {
|
|
16
|
+
const n = e.today ?? /* @__PURE__ */ new Date();
|
|
17
|
+
return {
|
|
18
|
+
selected: !!e.isSelected?.(e.date),
|
|
19
|
+
disabled: e.disabled == null ? !1 : a(e.date, e.disabled),
|
|
20
|
+
today: c(e.date, n),
|
|
21
|
+
range_start: l(e.customModifiers?.range_start, e.date),
|
|
22
|
+
range_middle: l(e.customModifiers?.range_middle, e.date),
|
|
23
|
+
range_end: l(e.customModifiers?.range_end, e.date)
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function y(e, n, t) {
|
|
27
|
+
const r = i(e), o = i(n), d = i(t), u = o < d ? o : d, f = o > d ? o : d;
|
|
28
|
+
return r > u && r < f;
|
|
29
|
+
}
|
|
30
|
+
function M(e, n, t) {
|
|
31
|
+
const r = i(e);
|
|
32
|
+
return r === i(t) && r !== i(n);
|
|
33
|
+
}
|
|
34
|
+
function v(e) {
|
|
35
|
+
const { selected: n, isRange: t, isStart: r, isEnd: o, isMiddle: d } = e;
|
|
36
|
+
return t ? s({
|
|
37
|
+
selected: n,
|
|
20
38
|
range_start: r,
|
|
21
|
-
range_end:
|
|
22
|
-
range_middle:
|
|
23
|
-
}) :
|
|
39
|
+
range_end: o,
|
|
40
|
+
range_middle: d
|
|
41
|
+
}) : n ? "point" : "none";
|
|
42
|
+
}
|
|
43
|
+
function D(e, n, t, r) {
|
|
44
|
+
typeof e == "function" && e(
|
|
45
|
+
n,
|
|
46
|
+
t,
|
|
47
|
+
r
|
|
48
|
+
);
|
|
24
49
|
}
|
|
25
50
|
export {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
51
|
+
D as callDayPickerSelect,
|
|
52
|
+
l as dateMatchesModifier,
|
|
53
|
+
i as dayKey,
|
|
54
|
+
_ as injectedCalendarDayModifiers,
|
|
55
|
+
M as isPreviewCap,
|
|
56
|
+
y as isPreviewMiddle,
|
|
57
|
+
c as isSameCalendarDay,
|
|
58
|
+
v as periodCellKind,
|
|
59
|
+
s as selectionKindFromModifiers
|
|
31
60
|
};
|
|
@@ -1,43 +1,43 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { cn as
|
|
4
|
-
import { weekNumberBaseClassName as
|
|
3
|
+
import { cn as k } from "../../../lib/utils.js";
|
|
4
|
+
import { weekNumberBaseClassName as h, weekNumberBlockedClassName as M, weekNumberInteractiveClassName as j, weekNumberSelectedFillClassName as F, weekNumberFocusClassName as W } from "./calendar-selection-appearance.js";
|
|
5
5
|
function B(e, n) {
|
|
6
|
-
const s = e.getFullYear(),
|
|
7
|
-
return
|
|
8
|
-
(
|
|
6
|
+
const s = e.getFullYear(), o = e.getMonth(), i = (new Date(s, o, 1).getDay() + 7 - n) % 7, c = new Date(s, o, 1 - i), l = new Date(e), p = (e.getDay() + 7 - n) % 7;
|
|
7
|
+
return l.setDate(e.getDate() - p), Math.round(
|
|
8
|
+
(l.getTime() - c.getTime()) / (10080 * 60 * 1e3)
|
|
9
9
|
) + 1;
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function T({
|
|
12
12
|
week: e,
|
|
13
13
|
weekStartsOn: n,
|
|
14
14
|
pickerType: s,
|
|
15
|
-
calendarKind:
|
|
15
|
+
calendarKind: o = "gregorian",
|
|
16
16
|
weekNumberLabel: N,
|
|
17
17
|
weekLabel: g,
|
|
18
|
-
fiscalWeekNumberLabel:
|
|
19
|
-
fiscalWeekAriaLabel:
|
|
20
|
-
getCellMeta:
|
|
18
|
+
fiscalWeekNumberLabel: i,
|
|
19
|
+
fiscalWeekAriaLabel: c,
|
|
20
|
+
getCellMeta: l,
|
|
21
21
|
onWeekSelect: x,
|
|
22
22
|
blank: p = !1,
|
|
23
23
|
blocked: C = !1,
|
|
24
|
-
className:
|
|
24
|
+
className: d,
|
|
25
25
|
...v
|
|
26
26
|
}) {
|
|
27
|
-
const
|
|
28
|
-
if (p || !
|
|
27
|
+
const f = e.days.find((w) => !w.outside)?.date ?? (o === "fiscal" ? e.days[0]?.date : void 0);
|
|
28
|
+
if (p || !f)
|
|
29
29
|
return /* @__PURE__ */ r(
|
|
30
30
|
"th",
|
|
31
31
|
{
|
|
32
32
|
scope: "row",
|
|
33
33
|
"aria-hidden": "true",
|
|
34
|
-
className:
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
className: k(
|
|
35
|
+
h,
|
|
36
|
+
d
|
|
37
37
|
)
|
|
38
38
|
}
|
|
39
39
|
);
|
|
40
|
-
const y =
|
|
40
|
+
const y = l?.(f), t = y?.fiscalWeek, u = B(f, n), m = t ?? u, D = t && i ? i(t) : N(m), b = t && y && c ? c(y) : g(u);
|
|
41
41
|
if (s === "week") {
|
|
42
42
|
if (C)
|
|
43
43
|
return /* @__PURE__ */ r(
|
|
@@ -45,37 +45,37 @@ function S({
|
|
|
45
45
|
{
|
|
46
46
|
"aria-label": b,
|
|
47
47
|
"aria-disabled": "true",
|
|
48
|
-
"data-week-index":
|
|
49
|
-
"data-week-number":
|
|
48
|
+
"data-week-index": u,
|
|
49
|
+
"data-week-number": m,
|
|
50
50
|
"data-fiscal-week": t,
|
|
51
|
-
className:
|
|
51
|
+
className: k(h, d, M),
|
|
52
52
|
children: /* @__PURE__ */ r("div", { className: "flex h-9 w-full items-center justify-center text-center", children: D })
|
|
53
53
|
}
|
|
54
54
|
);
|
|
55
|
-
const
|
|
55
|
+
const w = () => x(f);
|
|
56
56
|
return /* @__PURE__ */ r(
|
|
57
57
|
"td",
|
|
58
58
|
{
|
|
59
59
|
"aria-label": b,
|
|
60
|
-
"data-week-index":
|
|
61
|
-
"data-week-number":
|
|
60
|
+
"data-week-index": u,
|
|
61
|
+
"data-week-number": m,
|
|
62
62
|
"data-fiscal-week": t,
|
|
63
63
|
"data-selection": "period-row",
|
|
64
64
|
tabIndex: 0,
|
|
65
65
|
role: "button",
|
|
66
|
-
className:
|
|
67
|
-
|
|
66
|
+
className: k(
|
|
67
|
+
h,
|
|
68
68
|
W,
|
|
69
69
|
F,
|
|
70
70
|
j,
|
|
71
71
|
"cursor-pointer transition-colors",
|
|
72
|
-
|
|
72
|
+
d
|
|
73
73
|
),
|
|
74
74
|
onClick: (a) => {
|
|
75
|
-
a.preventDefault(), a.stopPropagation(),
|
|
75
|
+
a.preventDefault(), a.stopPropagation(), w();
|
|
76
76
|
},
|
|
77
77
|
onKeyDown: (a) => {
|
|
78
|
-
(a.key === "Enter" || a.key === " ") && (a.preventDefault(), a.stopPropagation(),
|
|
78
|
+
(a.key === "Enter" || a.key === " ") && (a.preventDefault(), a.stopPropagation(), w());
|
|
79
79
|
},
|
|
80
80
|
children: /* @__PURE__ */ r("div", { className: "flex h-9 w-full items-center justify-center text-center", children: D })
|
|
81
81
|
}
|
|
@@ -86,11 +86,11 @@ function S({
|
|
|
86
86
|
{
|
|
87
87
|
...v,
|
|
88
88
|
"aria-label": b,
|
|
89
|
-
"data-week-number":
|
|
89
|
+
"data-week-number": m,
|
|
90
90
|
"data-fiscal-week": t,
|
|
91
|
-
className:
|
|
92
|
-
|
|
93
|
-
|
|
91
|
+
className: k(
|
|
92
|
+
h,
|
|
93
|
+
d
|
|
94
94
|
),
|
|
95
95
|
scope: "row",
|
|
96
96
|
children: /* @__PURE__ */ r("div", { className: "flex h-9 w-full items-center justify-center text-center whitespace-nowrap", children: D })
|
|
@@ -98,5 +98,5 @@ function S({
|
|
|
98
98
|
);
|
|
99
99
|
}
|
|
100
100
|
export {
|
|
101
|
-
|
|
101
|
+
T as CalendarWeekNumberCell
|
|
102
102
|
};
|
|
@@ -14,12 +14,21 @@ export declare function fiscalPeriodForWeek(week: {
|
|
|
14
14
|
}, getCellMeta?: (date: Date) => {
|
|
15
15
|
fiscalPeriod?: number;
|
|
16
16
|
} | undefined): number | undefined;
|
|
17
|
-
|
|
18
|
-
export declare function isForeignFiscalWeekRow(options: {
|
|
17
|
+
type FiscalWeekRowOptions = {
|
|
19
18
|
calendarKind: CalendarKind;
|
|
20
19
|
weekPeriod?: number;
|
|
21
20
|
panePeriod?: number;
|
|
22
|
-
}
|
|
21
|
+
};
|
|
22
|
+
/** A fiscal week belongs to one period pane. Other panes keep a blank reserved row. */
|
|
23
|
+
export declare function isForeignFiscalWeekRow(options: FiscalWeekRowOptions): boolean;
|
|
24
|
+
export declare function isOwnedFiscalWeekRow(options: FiscalWeekRowOptions): boolean;
|
|
25
|
+
/** Owned fiscal weeks stay visible even when every civil day is outside the pane month.
|
|
26
|
+
* Foreign weeks hide in this pane — the owning pane injects leading weeks DayPicker omits. */
|
|
27
|
+
export declare function shouldHideCalendarWeekRow(week: {
|
|
28
|
+
days: Array<{
|
|
29
|
+
outside?: boolean;
|
|
30
|
+
}>;
|
|
31
|
+
}, options: FiscalWeekRowOptions): boolean;
|
|
23
32
|
export declare function isSameWeek(w1: WeekSelection, w2: WeekSelection): boolean;
|
|
24
33
|
export declare function calculateWeekSelection(weekOrDate: WeekPickerInput, options: {
|
|
25
34
|
calendarKind: CalendarKind;
|
|
@@ -36,3 +45,4 @@ export declare function computeWeekRangeModifiers(selectedDays: Date[] | undefin
|
|
|
36
45
|
range_middle: Date[];
|
|
37
46
|
range_end: Date[];
|
|
38
47
|
};
|
|
48
|
+
export {};
|