impact-nova 2.5.12 → 2.5.13
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/build-column-tree-from-grid.d.ts +1 -0
- package/dist/components/data/data-table/build-column-tree-from-grid.js +55 -50
- package/dist/components/data/data-table/column-picker-authority.d.ts +34 -0
- package/dist/components/data/data-table/column-picker-authority.js +116 -0
- package/dist/components/data/data-table/column-picker-drop-validation.d.ts +7 -0
- package/dist/components/data/data-table/column-picker-drop-validation.js +37 -0
- package/dist/components/data/data-table/data-table-column-apply.d.ts +2 -0
- package/dist/components/data/data-table/data-table-column-apply.js +84 -73
- package/dist/components/data/data-table/data-table-column-list-tree-apply.d.ts +10 -0
- package/dist/components/data/data-table/data-table-column-list-tree-apply.js +79 -0
- package/dist/components/data/data-table/data-table-column-list.js +94 -64
- package/dist/components/data/data-table/data-table-column-tree-cache.d.ts +12 -6
- package/dist/components/data/data-table/data-table-column-tree-cache.js +250 -131
- package/dist/components/data/data-table/data-table-flat-column-virtual-rows.d.ts +26 -0
- package/dist/components/data/data-table/data-table-flat-column-virtual-rows.js +195 -0
- package/dist/components/data/data-table/data-table-picker-column-eligibility.d.ts +1 -0
- package/dist/components/data/data-table/data-table-picker-column-eligibility.js +7 -0
- package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.d.ts +5 -0
- package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.js +28 -11
- package/dist/components/data/data-table/reconcile-column-tree-from-grid.d.ts +12 -0
- package/dist/components/data/data-table/reconcile-column-tree-from-grid.js +12 -0
- package/dist/components/data/data-table/use-data-table-column-list-sync.d.ts +10 -0
- package/dist/components/data/data-table/use-data-table-column-list-sync.js +250 -196
- package/dist/components/data/nested-list/components/NestedListContent.d.ts +10 -2
- package/dist/components/data/nested-list/components/NestedListContent.js +253 -138
- package/dist/components/data/nested-list/components/SortableItem.d.ts +2 -1
- package/dist/components/data/nested-list/components/SortableItem.js +62 -60
- package/dist/components/data/nested-list/hooks/useNestedListDragDrop.d.ts +10 -20
- package/dist/components/data/nested-list/hooks/useNestedListDragDrop.js +44 -233
- package/dist/components/data/nested-list/hooks/useVirtualNestedListDrag.d.ts +24 -0
- package/dist/components/data/nested-list/hooks/useVirtualNestedListDrag.js +128 -0
- package/dist/components/data/nested-list/nested-list-constants.d.ts +4 -1
- package/dist/components/data/nested-list/nested-list-constants.js +10 -4
- package/dist/components/data/nested-list/nested-list-display-utils.d.ts +11 -0
- package/dist/components/data/nested-list/nested-list-display-utils.js +74 -0
- package/dist/components/data/nested-list/nested-list-drop-engine.d.ts +31 -0
- package/dist/components/data/nested-list/nested-list-drop-engine.js +209 -0
- package/dist/components/data/nested-list/nested-list-flat-virtual-handlers.d.ts +26 -0
- package/dist/components/data/nested-list/nested-list-flat-virtual-handlers.js +67 -0
- package/dist/components/data/nested-list/nested-list-item-tree-mutations.d.ts +4 -0
- package/dist/components/data/nested-list/nested-list-item-tree-mutations.js +43 -0
- package/dist/components/data/nested-list/nested-list-lazy-flat-rows.d.ts +3 -0
- package/dist/components/data/nested-list/nested-list-lazy-flat-rows.js +34 -0
- package/dist/components/data/nested-list/nested-list-row-estimates.d.ts +9 -0
- package/dist/components/data/nested-list/nested-list-row-estimates.js +14 -0
- package/dist/components/data/nested-list/nested-list-scroll-anchor.d.ts +36 -0
- package/dist/components/data/nested-list/nested-list-scroll-anchor.js +47 -0
- package/dist/components/data/nested-list/nested-list-virtual-drop.d.ts +59 -0
- package/dist/components/data/nested-list/nested-list-virtual-drop.js +341 -0
- package/dist/components/data/nested-list/nested-list.js +322 -336
- package/dist/components/data/nested-list/nested-list.types.d.ts +17 -0
- package/dist/components/data-display/calendar/calendar-apply-validation.d.ts +0 -2
- package/dist/components/data-display/calendar/calendar-apply-validation.js +67 -64
- package/dist/components/data-display/calendar/calendar-config.js +1 -1
- package/dist/components/data-display/calendar/calendar-day-picker-components.d.ts +2 -4
- package/dist/components/data-display/calendar/calendar-day-picker-components.js +164 -234
- package/dist/components/data-display/calendar/calendar-day-picker-view.js +76 -77
- package/dist/components/data-display/calendar/calendar-fiscal-period-nav.d.ts +0 -6
- package/dist/components/data-display/calendar/calendar-fiscal-period-nav.js +18 -34
- package/dist/components/data-display/calendar/calendar-footer.js +21 -21
- package/dist/components/data-display/calendar/calendar-month-picker-panel.js +49 -50
- package/dist/components/data-display/calendar/calendar-month-utils.d.ts +0 -5
- package/dist/components/data-display/calendar/calendar-month-utils.js +64 -85
- package/dist/components/data-display/calendar/calendar-padding-week.utils.d.ts +1 -3
- package/dist/components/data-display/calendar/calendar-padding-week.utils.js +5 -7
- package/dist/components/data-display/calendar/calendar-period-cell.js +46 -45
- package/dist/components/data-display/calendar/calendar-quarter-panes.js +31 -33
- package/dist/components/data-display/calendar/calendar-selection-appearance.d.ts +0 -10
- package/dist/components/data-display/calendar/calendar-selection-appearance.js +39 -53
- package/dist/components/data-display/calendar/calendar-selection.d.ts +0 -25
- package/dist/components/data-display/calendar/calendar-selection.js +23 -52
- package/dist/components/data-display/calendar/calendar-week-number-cell.d.ts +1 -2
- package/dist/components/data-display/calendar/calendar-week-number-cell.js +45 -59
- package/dist/components/data-display/calendar/calendar-week-utils.d.ts +3 -13
- package/dist/components/data-display/calendar/calendar-week-utils.js +50 -59
- package/dist/components/data-display/calendar/calendar-year-panes.d.ts +0 -3
- package/dist/components/data-display/calendar/calendar-year-panes.js +49 -53
- package/dist/components/data-display/calendar/calendar.js +143 -146
- package/dist/components/data-display/calendar/calendar.types.d.ts +0 -5
- package/dist/components/data-display/calendar/use-calendar-day-picker-config.d.ts +1 -2
- package/dist/components/data-display/calendar/use-calendar-day-picker-config.js +74 -79
- package/dist/components/data-display/calendar/use-calendar-state.d.ts +1 -3
- package/dist/components/data-display/calendar/use-calendar-state.js +325 -403
- package/dist/components/forms/date-picker/date-picker.js +58 -60
- package/dist/components/forms/date-picker/date-picker.types.d.ts +0 -5
- package/dist/components/forms/date-picker/date-range-picker.js +64 -66
- package/dist/components/forms/date-picker/fiscal-pass-through.d.ts +0 -1
- package/dist/components/forms/date-picker/fiscal-pass-through.js +2 -3
- package/dist/components/forms/date-picker/month-picker.js +59 -61
- package/dist/components/forms/date-picker/month-range-picker.js +61 -63
- package/dist/components/forms/date-picker/multi-date-picker.js +49 -51
- package/dist/components/forms/date-picker/multi-month-picker.js +47 -49
- package/dist/components/forms/date-picker/multi-quarter-picker.js +47 -51
- package/dist/components/forms/date-picker/multi-week-picker.js +51 -53
- package/dist/components/forms/date-picker/multi-year-picker.js +49 -53
- package/dist/components/forms/date-picker/quarter-picker.js +47 -51
- package/dist/components/forms/date-picker/quarter-range-picker.js +46 -50
- package/dist/components/forms/date-picker/week-picker.js +66 -68
- package/dist/components/forms/date-picker/week-range-picker.js +80 -82
- package/dist/components/forms/date-picker/year-picker.js +48 -52
- package/dist/components/forms/date-picker/year-range-picker.js +48 -52
- package/dist/form-react/Fields/DateInputField.js +50 -51
- package/dist/form-react/Fields/DateRangeField.js +13 -14
- package/dist/form-react/Fields/MonthRangeField.js +28 -29
- package/dist/form-react/Fields/MultiMonthPickerField.js +12 -13
- package/dist/form-react/Fields/MultiWeekPickerField.js +27 -35
- package/dist/form-react/Fields/WeekRangePicker.js +32 -33
- package/dist/form-react/types/fields.types.d.ts +0 -14
- package/dist/impact-nova-components.css +6 -13
- package/dist/impact-nova.css +1 -1
- package/dist/lib/fiscal-calendar/week-selection.js +2 -2
- package/dist/lib/hash/fnv1a128.d.ts +16 -0
- package/dist/lib/hash/fnv1a128.js +21 -0
- package/dist/llms/rules/ag-grid.js +1 -1
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/package.json +1 -1
- package/dist/components/data-display/calendar/calendar-available-view.d.ts +0 -27
- package/dist/components/data-display/calendar/calendar-available-view.js +0 -85
- package/dist/components/data-display/calendar/calendar-fiscal-day-cell.d.ts +0 -9
- package/dist/components/data-display/calendar/calendar-fiscal-day-cell.js +0 -45
- package/dist/components/data-display/calendar/calendar-injected-week-row.d.ts +0 -5
- package/dist/components/data-display/calendar/calendar-injected-week-row.js +0 -92
- package/dist/components/data-display/calendar/calendar-leading-week.utils.d.ts +0 -16
- package/dist/components/data-display/calendar/calendar-leading-week.utils.js +0 -51
- package/dist/components/data-display/calendar/calendar-orphan-week.d.ts +0 -23
- package/dist/components/forms/date-picker/fiscal-picker-fixtures.d.ts +0 -17
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Matcher } from 'react-day-picker';
|
|
2
1
|
export type SelectionKind = "none" | "point" | "interval-start" | "interval-middle" | "interval-end";
|
|
3
2
|
export interface SelectionModifiers {
|
|
4
3
|
selected?: boolean;
|
|
@@ -10,28 +9,6 @@ export interface SelectionModifiers {
|
|
|
10
9
|
}
|
|
11
10
|
export declare function selectionKindFromModifiers(modifiers: SelectionModifiers): SelectionKind;
|
|
12
11
|
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
|
-
};
|
|
35
12
|
export declare function isPreviewMiddle(date: Date, from: Date, hovered: Date): boolean;
|
|
36
13
|
export declare function isPreviewCap(date: Date, from: Date, hovered: Date): boolean;
|
|
37
14
|
export declare function periodCellKind(params: {
|
|
@@ -41,5 +18,3 @@ export declare function periodCellKind(params: {
|
|
|
41
18
|
isEnd: boolean;
|
|
42
19
|
isMiddle: boolean;
|
|
43
20
|
}): 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,60 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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";
|
|
1
|
+
function c(n) {
|
|
2
|
+
const e = !!n.range_start, t = !!n.range_end;
|
|
3
|
+
return e && t ? "point" : e ? "interval-start" : t ? "interval-end" : n.range_middle ? "interval-middle" : n.preview_cap ? "interval-end" : n.preview ? "interval-middle" : n.selected ? "point" : "none";
|
|
5
4
|
}
|
|
6
|
-
function
|
|
7
|
-
return
|
|
5
|
+
function o(n) {
|
|
6
|
+
return n.getFullYear() * 1e4 + (n.getMonth() + 1) * 100 + n.getDate();
|
|
8
7
|
}
|
|
9
|
-
function
|
|
10
|
-
|
|
8
|
+
function d(n, e, t) {
|
|
9
|
+
const r = o(n), i = o(e), a = o(t), l = i < a ? i : a, u = i > a ? i : a;
|
|
10
|
+
return r > l && r < u;
|
|
11
11
|
}
|
|
12
|
-
function
|
|
13
|
-
|
|
12
|
+
function s(n, e, t) {
|
|
13
|
+
const r = o(n);
|
|
14
|
+
return r === o(t) && r !== o(e);
|
|
14
15
|
}
|
|
15
|
-
function
|
|
16
|
-
const
|
|
17
|
-
return {
|
|
18
|
-
selected:
|
|
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,
|
|
16
|
+
function g(n) {
|
|
17
|
+
const { selected: e, isRange: t, isStart: r, isEnd: i, isMiddle: a } = n;
|
|
18
|
+
return t ? c({
|
|
19
|
+
selected: e,
|
|
38
20
|
range_start: r,
|
|
39
|
-
range_end:
|
|
40
|
-
range_middle:
|
|
41
|
-
}) :
|
|
42
|
-
}
|
|
43
|
-
function D(e, n, t, r) {
|
|
44
|
-
typeof e == "function" && e(
|
|
45
|
-
n,
|
|
46
|
-
t,
|
|
47
|
-
r
|
|
48
|
-
);
|
|
21
|
+
range_end: i,
|
|
22
|
+
range_middle: a
|
|
23
|
+
}) : e ? "point" : "none";
|
|
49
24
|
}
|
|
50
25
|
export {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
y as isPreviewMiddle,
|
|
57
|
-
c as isSameCalendarDay,
|
|
58
|
-
v as periodCellKind,
|
|
59
|
-
s as selectionKindFromModifiers
|
|
26
|
+
o as dayKey,
|
|
27
|
+
s as isPreviewCap,
|
|
28
|
+
d as isPreviewMiddle,
|
|
29
|
+
g as periodCellKind,
|
|
30
|
+
c as selectionKindFromModifiers
|
|
60
31
|
};
|
|
@@ -18,7 +18,6 @@ export interface CalendarWeekNumberCellProps {
|
|
|
18
18
|
getCellMeta?: (date: Date) => DateCellMeta | undefined;
|
|
19
19
|
onWeekSelect: (input: WeekPickerInput) => void;
|
|
20
20
|
blank?: boolean;
|
|
21
|
-
blocked?: boolean;
|
|
22
21
|
className?: string;
|
|
23
22
|
}
|
|
24
|
-
export declare function CalendarWeekNumberCell({ week, weekStartsOn, pickerType, calendarKind, weekNumberLabel, weekLabel, fiscalWeekNumberLabel, fiscalWeekAriaLabel, getCellMeta, onWeekSelect, blank,
|
|
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,102 +1,88 @@
|
|
|
1
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 s = e.getFullYear(),
|
|
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
13
|
weekStartsOn: n,
|
|
14
14
|
pickerType: s,
|
|
15
|
-
calendarKind:
|
|
16
|
-
weekNumberLabel:
|
|
15
|
+
calendarKind: u = "gregorian",
|
|
16
|
+
weekNumberLabel: D,
|
|
17
17
|
weekLabel: g,
|
|
18
|
-
fiscalWeekNumberLabel:
|
|
18
|
+
fiscalWeekNumberLabel: o,
|
|
19
19
|
fiscalWeekAriaLabel: c,
|
|
20
|
-
getCellMeta:
|
|
21
|
-
onWeekSelect:
|
|
22
|
-
blank:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
...v
|
|
20
|
+
getCellMeta: i,
|
|
21
|
+
onWeekSelect: N,
|
|
22
|
+
blank: m = !1,
|
|
23
|
+
className: l,
|
|
24
|
+
...C
|
|
26
25
|
}) {
|
|
27
|
-
const
|
|
28
|
-
if (
|
|
26
|
+
const d = e.days.find((f) => !f.outside)?.date;
|
|
27
|
+
if (m || !d)
|
|
29
28
|
return /* @__PURE__ */ r(
|
|
30
29
|
"th",
|
|
31
30
|
{
|
|
32
31
|
scope: "row",
|
|
33
32
|
"aria-hidden": "true",
|
|
34
|
-
className:
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
className: h(
|
|
34
|
+
y,
|
|
35
|
+
l
|
|
37
36
|
)
|
|
38
37
|
}
|
|
39
38
|
);
|
|
40
|
-
const
|
|
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);
|
|
41
40
|
if (s === "week") {
|
|
42
|
-
|
|
43
|
-
return /* @__PURE__ */ r(
|
|
44
|
-
"td",
|
|
45
|
-
{
|
|
46
|
-
"aria-label": b,
|
|
47
|
-
"aria-disabled": "true",
|
|
48
|
-
"data-week-index": u,
|
|
49
|
-
"data-week-number": m,
|
|
50
|
-
"data-fiscal-week": t,
|
|
51
|
-
className: k(h, d, M),
|
|
52
|
-
children: /* @__PURE__ */ r("div", { className: "flex h-9 w-full items-center justify-center text-center", children: D })
|
|
53
|
-
}
|
|
54
|
-
);
|
|
55
|
-
const w = () => x(f);
|
|
41
|
+
const f = () => N(d);
|
|
56
42
|
return /* @__PURE__ */ r(
|
|
57
43
|
"td",
|
|
58
44
|
{
|
|
59
|
-
"aria-label":
|
|
60
|
-
"data-week-index":
|
|
61
|
-
"data-week-number":
|
|
62
|
-
"data-fiscal-week":
|
|
45
|
+
"aria-label": x,
|
|
46
|
+
"data-week-index": p,
|
|
47
|
+
"data-week-number": k,
|
|
48
|
+
"data-fiscal-week": a,
|
|
63
49
|
"data-selection": "period-row",
|
|
64
50
|
tabIndex: 0,
|
|
65
51
|
role: "button",
|
|
66
|
-
className:
|
|
67
|
-
|
|
68
|
-
W,
|
|
52
|
+
className: h(
|
|
53
|
+
y,
|
|
69
54
|
F,
|
|
70
|
-
|
|
55
|
+
v,
|
|
56
|
+
M,
|
|
71
57
|
"cursor-pointer transition-colors",
|
|
72
|
-
|
|
58
|
+
l
|
|
73
59
|
),
|
|
74
|
-
onClick: (
|
|
75
|
-
|
|
60
|
+
onClick: (t) => {
|
|
61
|
+
t.preventDefault(), t.stopPropagation(), f();
|
|
76
62
|
},
|
|
77
|
-
onKeyDown: (
|
|
78
|
-
(
|
|
63
|
+
onKeyDown: (t) => {
|
|
64
|
+
(t.key === "Enter" || t.key === " ") && (t.preventDefault(), t.stopPropagation(), f());
|
|
79
65
|
},
|
|
80
|
-
children: /* @__PURE__ */ r("div", { className: "flex h-9 w-full items-center justify-center text-center", children:
|
|
66
|
+
children: /* @__PURE__ */ r("div", { className: "flex h-9 w-full items-center justify-center text-center", children: b })
|
|
81
67
|
}
|
|
82
68
|
);
|
|
83
69
|
}
|
|
84
70
|
return /* @__PURE__ */ r(
|
|
85
71
|
"th",
|
|
86
72
|
{
|
|
87
|
-
...
|
|
88
|
-
"aria-label":
|
|
89
|
-
"data-week-number":
|
|
90
|
-
"data-fiscal-week":
|
|
91
|
-
className:
|
|
92
|
-
|
|
93
|
-
|
|
73
|
+
...C,
|
|
74
|
+
"aria-label": x,
|
|
75
|
+
"data-week-number": k,
|
|
76
|
+
"data-fiscal-week": a,
|
|
77
|
+
className: h(
|
|
78
|
+
y,
|
|
79
|
+
l
|
|
94
80
|
),
|
|
95
81
|
scope: "row",
|
|
96
|
-
children: /* @__PURE__ */ r("div", { className: "flex h-9 w-full items-center justify-center text-center whitespace-nowrap", children:
|
|
82
|
+
children: /* @__PURE__ */ r("div", { className: "flex h-9 w-full items-center justify-center text-center whitespace-nowrap", children: b })
|
|
97
83
|
}
|
|
98
84
|
);
|
|
99
85
|
}
|
|
100
86
|
export {
|
|
101
|
-
|
|
87
|
+
P as CalendarWeekNumberCell
|
|
102
88
|
};
|
|
@@ -14,21 +14,12 @@ export declare function fiscalPeriodForWeek(week: {
|
|
|
14
14
|
}, getCellMeta?: (date: Date) => {
|
|
15
15
|
fiscalPeriod?: number;
|
|
16
16
|
} | undefined): number | undefined;
|
|
17
|
-
|
|
17
|
+
/** A fiscal week belongs to one period pane. Other panes keep a blank reserved row. */
|
|
18
|
+
export declare function isForeignFiscalWeekRow(options: {
|
|
18
19
|
calendarKind: CalendarKind;
|
|
19
20
|
weekPeriod?: number;
|
|
20
21
|
panePeriod?: number;
|
|
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;
|
|
22
|
+
}): boolean;
|
|
32
23
|
export declare function isSameWeek(w1: WeekSelection, w2: WeekSelection): boolean;
|
|
33
24
|
export declare function calculateWeekSelection(weekOrDate: WeekPickerInput, options: {
|
|
34
25
|
calendarKind: CalendarKind;
|
|
@@ -45,4 +36,3 @@ export declare function computeWeekRangeModifiers(selectedDays: Date[] | undefin
|
|
|
45
36
|
range_middle: Date[];
|
|
46
37
|
range_end: Date[];
|
|
47
38
|
};
|
|
48
|
-
export {};
|
|
@@ -1,94 +1,85 @@
|
|
|
1
1
|
import { civilFromLocalDate as l } from "../../../lib/fiscal-calendar/civil-date.js";
|
|
2
|
-
import { resolveWeekSelection as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return r?.(a)?.fiscalPeriod;
|
|
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
|
+
if (o)
|
|
6
|
+
return n?.(o)?.fiscalPeriod;
|
|
8
7
|
}
|
|
9
|
-
function
|
|
8
|
+
function A(e) {
|
|
10
9
|
return e.calendarKind !== "fiscal" || e.weekPeriod == null || e.panePeriod == null ? !1 : e.weekPeriod !== e.panePeriod;
|
|
11
10
|
}
|
|
12
|
-
function
|
|
13
|
-
return e.
|
|
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
17
|
}
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return S(a, r);
|
|
24
|
-
}
|
|
25
|
-
function H(e, r, a) {
|
|
26
|
-
if (a === "single") return e;
|
|
27
|
-
if (a === "multiple") {
|
|
28
|
-
const i = r || [];
|
|
29
|
-
return i.some((f) => d(f, e)) ? i.filter((f) => !d(f, e)) : [...i, e];
|
|
18
|
+
function E(e, n, o) {
|
|
19
|
+
if (o === "single") return e;
|
|
20
|
+
if (o === "multiple") {
|
|
21
|
+
const a = n || [];
|
|
22
|
+
return a.some((f) => m(f, e)) ? a.filter((f) => !m(f, e)) : [...a, e];
|
|
30
23
|
}
|
|
31
|
-
const t =
|
|
24
|
+
const t = n;
|
|
32
25
|
if (!t?.from || t.to) return { from: e };
|
|
33
|
-
if (
|
|
26
|
+
if (m(e, t.from)) return t;
|
|
34
27
|
const s = { from: t.from, to: e };
|
|
35
28
|
return e.startDate < t.from.startDate && (s.from = e, s.to = t.from), s;
|
|
36
29
|
}
|
|
37
|
-
function
|
|
30
|
+
function x(e) {
|
|
38
31
|
if (!e) return;
|
|
39
|
-
const
|
|
32
|
+
const n = [], o = (t) => {
|
|
40
33
|
const s = new Date(t.startDate);
|
|
41
34
|
s.setHours(0, 0, 0, 0);
|
|
42
|
-
const
|
|
43
|
-
for (
|
|
44
|
-
|
|
35
|
+
const a = new Date(t.endDate);
|
|
36
|
+
for (a.setHours(0, 0, 0, 0); s <= a; )
|
|
37
|
+
n.push(new Date(s)), s.setDate(s.getDate() + 1);
|
|
45
38
|
};
|
|
46
39
|
if (Array.isArray(e))
|
|
47
|
-
e.forEach(
|
|
40
|
+
e.forEach(o);
|
|
48
41
|
else if ("from" in e) {
|
|
49
42
|
if (e.from)
|
|
50
43
|
if (!e.to)
|
|
51
|
-
|
|
44
|
+
o(e.from);
|
|
52
45
|
else {
|
|
53
46
|
const t = new Date(e.from.startDate);
|
|
54
47
|
t.setHours(0, 0, 0, 0);
|
|
55
48
|
const s = new Date(e.to.endDate);
|
|
56
49
|
for (s.setHours(0, 0, 0, 0); t <= s; )
|
|
57
|
-
|
|
50
|
+
n.push(new Date(t)), t.setDate(t.getDate() + 1);
|
|
58
51
|
}
|
|
59
52
|
} else
|
|
60
|
-
|
|
61
|
-
return
|
|
53
|
+
o(e);
|
|
54
|
+
return n;
|
|
62
55
|
}
|
|
63
|
-
function
|
|
56
|
+
function F(e, n, o) {
|
|
64
57
|
if (!e || e.length === 0)
|
|
65
58
|
return { range_start: [], range_middle: [], range_end: [] };
|
|
66
|
-
const t = [...e].sort((
|
|
67
|
-
|
|
68
|
-
f.add(l(
|
|
59
|
+
const t = [...e].sort((r, i) => r.getTime() - i.getTime()), s = [], a = [], u = [], f = /* @__PURE__ */ new Set(), d = /* @__PURE__ */ new Set();
|
|
60
|
+
n === "multiple" && Array.isArray(o) && o.forEach((r) => {
|
|
61
|
+
f.add(l(r.startDate)), d.add(l(r.endDate));
|
|
69
62
|
});
|
|
70
|
-
const D = (
|
|
71
|
-
if (
|
|
72
|
-
const c = t[
|
|
73
|
-
return
|
|
74
|
-
}, p = (
|
|
75
|
-
return t.forEach((
|
|
76
|
-
const c = l(
|
|
77
|
-
if (
|
|
78
|
-
|
|
63
|
+
const D = (r, i) => {
|
|
64
|
+
if (i === 0) return !1;
|
|
65
|
+
const c = t[i - 1];
|
|
66
|
+
return r.getTime() - c.getTime() <= 1440 * 60 * 1e3;
|
|
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);
|
|
70
|
+
if (n === "multiple") {
|
|
71
|
+
S ? s.push(r) : y ? u.push(r) : a.push(r);
|
|
79
72
|
return;
|
|
80
73
|
}
|
|
81
|
-
!h && !g ? (s.push(
|
|
82
|
-
}), { range_start: s, range_middle:
|
|
74
|
+
!h && !g ? (s.push(r), u.push(r)) : h ? g ? a.push(r) : u.push(r) : s.push(r);
|
|
75
|
+
}), { range_start: s, range_middle: a, range_end: u };
|
|
83
76
|
}
|
|
84
77
|
export {
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
E as shouldHideCalendarWeekRow,
|
|
93
|
-
R as weekSelectionsToDates
|
|
78
|
+
_ as calculateWeekSelection,
|
|
79
|
+
F as computeWeekRangeModifiers,
|
|
80
|
+
v as fiscalPeriodForWeek,
|
|
81
|
+
A as isForeignFiscalWeekRow,
|
|
82
|
+
m as isSameWeek,
|
|
83
|
+
E as nextWeekSelection,
|
|
84
|
+
x as weekSelectionsToDates
|
|
94
85
|
};
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import { YearRange, YearSelection } from './calendar.types';
|
|
2
|
-
export declare const YEAR_PAGE_SIZE = 12;
|
|
3
|
-
export declare const YEAR_CAPTION_PAGE_SIZE = 6;
|
|
4
|
-
export declare const YEAR_PANE_WIDTH_CLASS = "w-[320px] min-w-[320px] max-w-[320px]";
|
|
5
2
|
export interface CalendarYearPanesProps {
|
|
6
3
|
pickerYear: number;
|
|
7
4
|
resolvedStartYear: number;
|
|
@@ -1,64 +1,63 @@
|
|
|
1
1
|
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { ChevronRight as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { Button as
|
|
5
|
-
import { CalendarPeriodCell as
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
pickerYear: _,
|
|
2
|
+
import { ChevronRight as v } from "impact-nova-icons";
|
|
3
|
+
import { cn as M } from "../../../lib/utils.js";
|
|
4
|
+
import { Button as w } from "../../primitives/button/button.js";
|
|
5
|
+
import { CalendarPeriodCell as Y } from "./calendar-period-cell.js";
|
|
6
|
+
import { getYearRangeProps as Z, isYearRangeSelection as O } from "./calendar-year-utils.js";
|
|
7
|
+
const T = 12, q = 6;
|
|
8
|
+
function U({
|
|
9
|
+
pickerYear: E,
|
|
11
10
|
resolvedStartYear: d,
|
|
12
11
|
resolvedEndYear: m,
|
|
13
|
-
previousYearLabel:
|
|
14
|
-
nextYearLabel:
|
|
15
|
-
yearLabels:
|
|
12
|
+
previousYearLabel: N,
|
|
13
|
+
nextYearLabel: S,
|
|
14
|
+
yearLabels: a,
|
|
16
15
|
yearCaptions: p,
|
|
17
|
-
showFooter:
|
|
18
|
-
pendingYearSelection:
|
|
19
|
-
selectedYear:
|
|
20
|
-
isYearSelected:
|
|
21
|
-
isYearDisabled:
|
|
22
|
-
onYearPageChange:
|
|
23
|
-
onYearClick:
|
|
16
|
+
showFooter: R = !0,
|
|
17
|
+
pendingYearSelection: b,
|
|
18
|
+
selectedYear: A,
|
|
19
|
+
isYearSelected: C,
|
|
20
|
+
isYearDisabled: _,
|
|
21
|
+
onYearPageChange: g,
|
|
22
|
+
onYearClick: z
|
|
24
23
|
}) {
|
|
25
|
-
const
|
|
26
|
-
(
|
|
27
|
-
),
|
|
24
|
+
const o = !!p, t = o ? q : T, i = Math.floor(E / t) * t, h = i + t - 1, s = Array.from({ length: t }, (n, l) => i + l).filter(
|
|
25
|
+
(n) => n >= d && n <= m
|
|
26
|
+
), f = s[0] ?? i, x = s[s.length - 1] ?? h, c = R ? b : A, u = O(c) ? c : void 0;
|
|
28
27
|
return /* @__PURE__ */ r(
|
|
29
28
|
"div",
|
|
30
29
|
{
|
|
31
30
|
"data-slot": "year-panes",
|
|
32
|
-
className:
|
|
31
|
+
className: "flex w-[280px] min-w-[280px] max-w-[280px] flex-col gap-4 overflow-hidden p-3",
|
|
33
32
|
children: [
|
|
34
33
|
/* @__PURE__ */ r("div", { className: "flex items-center justify-between", children: [
|
|
35
34
|
/* @__PURE__ */ e(
|
|
36
|
-
|
|
35
|
+
w,
|
|
37
36
|
{
|
|
38
37
|
variant: "ghost",
|
|
39
38
|
size: "icon",
|
|
40
39
|
className: "h-7 w-7 shrink-0",
|
|
41
|
-
"aria-label":
|
|
42
|
-
disabled:
|
|
43
|
-
onClick: () =>
|
|
44
|
-
children: /* @__PURE__ */ e(
|
|
40
|
+
"aria-label": N,
|
|
41
|
+
disabled: i <= d,
|
|
42
|
+
onClick: () => g(i - t),
|
|
43
|
+
children: /* @__PURE__ */ e(v, { size: 16, className: "rotate-180" })
|
|
45
44
|
}
|
|
46
45
|
),
|
|
47
46
|
/* @__PURE__ */ r("div", { className: "text-sm font-medium text-content", children: [
|
|
48
|
-
|
|
47
|
+
a?.(f) ?? f,
|
|
49
48
|
" – ",
|
|
50
|
-
|
|
49
|
+
a?.(x) ?? x
|
|
51
50
|
] }),
|
|
52
51
|
/* @__PURE__ */ e(
|
|
53
|
-
|
|
52
|
+
w,
|
|
54
53
|
{
|
|
55
54
|
variant: "ghost",
|
|
56
55
|
size: "icon",
|
|
57
56
|
className: "h-7 w-7",
|
|
58
|
-
"aria-label":
|
|
59
|
-
disabled:
|
|
60
|
-
onClick: () =>
|
|
61
|
-
children: /* @__PURE__ */ e(
|
|
57
|
+
"aria-label": S,
|
|
58
|
+
disabled: h >= m,
|
|
59
|
+
onClick: () => g(i + t),
|
|
60
|
+
children: /* @__PURE__ */ e(v, { className: "h-4 w-4" })
|
|
62
61
|
}
|
|
63
62
|
)
|
|
64
63
|
] }),
|
|
@@ -66,26 +65,26 @@ function V({
|
|
|
66
65
|
"div",
|
|
67
66
|
{
|
|
68
67
|
"data-period-grid": "",
|
|
69
|
-
className:
|
|
70
|
-
children: s.map((
|
|
71
|
-
const l =
|
|
68
|
+
className: M("grid min-w-0 gap-2", o ? "grid-cols-2" : "grid-cols-3"),
|
|
69
|
+
children: s.map((n) => {
|
|
70
|
+
const l = C(n), P = _(n), k = !!u, { isStart: B, isEnd: j, isMiddle: I } = Z(n, c), G = p?.(n);
|
|
72
71
|
return /* @__PURE__ */ e(
|
|
73
|
-
|
|
72
|
+
Y,
|
|
74
73
|
{
|
|
75
74
|
selected: l,
|
|
76
|
-
disabled:
|
|
75
|
+
disabled: P,
|
|
77
76
|
isRange: k,
|
|
78
77
|
isStart: B,
|
|
79
|
-
isEnd:
|
|
80
|
-
isMiddle:
|
|
81
|
-
hasRangeEnd: !!
|
|
82
|
-
size:
|
|
83
|
-
columns:
|
|
84
|
-
onClick: () =>
|
|
85
|
-
caption:
|
|
86
|
-
children:
|
|
78
|
+
isEnd: j,
|
|
79
|
+
isMiddle: I,
|
|
80
|
+
hasRangeEnd: !!u?.to,
|
|
81
|
+
size: o ? "year-caption" : "year",
|
|
82
|
+
columns: o ? 2 : 3,
|
|
83
|
+
onClick: () => z(n),
|
|
84
|
+
caption: G,
|
|
85
|
+
children: a?.(n) ?? String(n)
|
|
87
86
|
},
|
|
88
|
-
|
|
87
|
+
n
|
|
89
88
|
);
|
|
90
89
|
})
|
|
91
90
|
}
|
|
@@ -95,8 +94,5 @@ function V({
|
|
|
95
94
|
);
|
|
96
95
|
}
|
|
97
96
|
export {
|
|
98
|
-
|
|
99
|
-
H as YEAR_CAPTION_PAGE_SIZE,
|
|
100
|
-
Z as YEAR_PAGE_SIZE,
|
|
101
|
-
W as YEAR_PANE_WIDTH_CLASS
|
|
97
|
+
U as CalendarYearPanes
|
|
102
98
|
};
|