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,118 +1,97 @@
|
|
|
1
|
-
import { isMonthRangeSelection as
|
|
2
|
-
function
|
|
3
|
-
return
|
|
1
|
+
import { isMonthRangeSelection as d } from "../../forms/date-picker/calendar-selection-adapters.js";
|
|
2
|
+
function l(e, n) {
|
|
3
|
+
return e.fy != null && n.fy != null && e.period != null && n.period != null ? e.fy === n.fy && e.period === n.period : e.year === n.year && e.month === n.month;
|
|
4
4
|
}
|
|
5
|
-
function g(
|
|
6
|
-
if (o === "single") return
|
|
5
|
+
function g(e, n, o) {
|
|
6
|
+
if (o === "single") return e;
|
|
7
7
|
if (o === "multiple") {
|
|
8
|
-
const
|
|
9
|
-
return
|
|
8
|
+
const a = n || [];
|
|
9
|
+
return a.some((f) => l(f, e)) ? a.filter((f) => !l(f, e)) : [...a, e];
|
|
10
10
|
}
|
|
11
|
-
const
|
|
12
|
-
if (!
|
|
13
|
-
const s = new Date(
|
|
14
|
-
return new Date(
|
|
11
|
+
const t = n;
|
|
12
|
+
if (!t?.from || t.to) return { from: e };
|
|
13
|
+
const s = new Date(t.from.year, t.from.month, 1);
|
|
14
|
+
return new Date(e.year, e.month, 1) < s ? { from: e, to: t.from } : { from: t.from, to: e };
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function m(e, 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: e, month: n, fy: e, period: n + 1 };
|
|
20
|
+
return o.some((r) => l(r, s) || r.year === e && r.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 (d(o)) {
|
|
23
|
+
const s = o, r = s.from, a = s.to;
|
|
24
|
+
if (!r && !a) return !1;
|
|
25
|
+
const i = new Date(e, n, 1).getTime();
|
|
26
|
+
if (!r) return a ? i === new Date(a.year, a.month, 1).getTime() : !1;
|
|
27
|
+
const f = new Date(r.year, r.month, 1).getTime();
|
|
28
|
+
if (!a) return i === f;
|
|
29
|
+
const u = new Date(a.year, a.month, 1).getTime();
|
|
30
|
+
return i >= f && i <= u;
|
|
31
31
|
}
|
|
32
|
-
const
|
|
33
|
-
return
|
|
32
|
+
const t = o;
|
|
33
|
+
return t.fy != null && t.period != null ? t.fy === e && t.period === n + 1 : t.year === e && t.month === n;
|
|
34
34
|
}
|
|
35
|
-
function y(
|
|
35
|
+
function y(e, 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 t = o, s = t.from, r = t.to;
|
|
39
|
+
if (!s && !r) return { isStart: !1, isEnd: !1, isMiddle: !1 };
|
|
40
|
+
const a = new Date(e, n, 1).getTime();
|
|
41
41
|
if (!s)
|
|
42
42
|
return {
|
|
43
43
|
isStart: !1,
|
|
44
|
-
isEnd:
|
|
44
|
+
isEnd: r ? a === new Date(r.year, r.month, 1).getTime() : !1,
|
|
45
45
|
isMiddle: !1
|
|
46
46
|
};
|
|
47
|
-
const
|
|
48
|
-
if (!
|
|
49
|
-
const
|
|
47
|
+
const i = new Date(s.year, s.month, 1).getTime();
|
|
48
|
+
if (!r) return { isStart: a === i, isEnd: !1, isMiddle: !1 };
|
|
49
|
+
const f = new Date(r.year, r.month, 1).getTime();
|
|
50
50
|
return {
|
|
51
|
-
isStart:
|
|
52
|
-
isEnd:
|
|
53
|
-
isMiddle:
|
|
51
|
+
isStart: a === i,
|
|
52
|
+
isEnd: a === f,
|
|
53
|
+
isMiddle: a > i && a < f
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
|
-
function
|
|
57
|
-
const
|
|
58
|
-
if (!
|
|
59
|
-
const s = new Date(
|
|
56
|
+
function D(e, n, o) {
|
|
57
|
+
const t = o;
|
|
58
|
+
if (!t || typeof t != "object" || !("before" in t) && !("after" in t)) return !1;
|
|
59
|
+
const s = new Date(e);
|
|
60
60
|
s.setHours(0, 0, 0, 0);
|
|
61
|
-
const
|
|
62
|
-
if (
|
|
63
|
-
const
|
|
64
|
-
if (
|
|
61
|
+
const r = new Date(n);
|
|
62
|
+
if (r.setHours(23, 59, 59, 999), t.before) {
|
|
63
|
+
const a = new Date(t.before);
|
|
64
|
+
if (a.setHours(0, 0, 0, 0), r < a) return !0;
|
|
65
65
|
}
|
|
66
|
-
if (
|
|
67
|
-
const
|
|
68
|
-
if (
|
|
66
|
+
if (t.after) {
|
|
67
|
+
const a = new Date(t.after);
|
|
68
|
+
if (a.setHours(23, 59, 59, 999), s > a) return !0;
|
|
69
69
|
}
|
|
70
70
|
return !1;
|
|
71
71
|
}
|
|
72
|
-
function
|
|
73
|
-
const e =
|
|
74
|
-
|
|
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);
|
|
72
|
+
function w(e, n, o) {
|
|
73
|
+
const t = new Date(e, n, 1, 0, 0, 0, 0), s = new Date(e, n + 1, 0, 23, 59, 59, 999);
|
|
74
|
+
return D(t, s, o);
|
|
94
75
|
}
|
|
95
|
-
function
|
|
96
|
-
const o =
|
|
97
|
-
for (let
|
|
98
|
-
s.push({ label:
|
|
76
|
+
function h(e, n) {
|
|
77
|
+
const o = e.getFullYear(), t = n.getFullYear(), s = [];
|
|
78
|
+
for (let r = o; r <= t; r++)
|
|
79
|
+
s.push({ label: r.toString(), value: r.toString() });
|
|
99
80
|
return s;
|
|
100
81
|
}
|
|
101
|
-
function
|
|
102
|
-
return n.map((s,
|
|
103
|
-
const
|
|
104
|
-
return !(
|
|
82
|
+
function p(e, n, o, t) {
|
|
83
|
+
return n.map((s, r) => ({ label: s, value: r.toString() })).filter((s, r) => {
|
|
84
|
+
const a = new Date(e, r, 1);
|
|
85
|
+
return !(a < new Date(o.getFullYear(), o.getMonth(), 1) || a > new Date(t.getFullYear(), t.getMonth(), 1));
|
|
105
86
|
});
|
|
106
87
|
}
|
|
107
88
|
export {
|
|
108
|
-
|
|
109
|
-
|
|
89
|
+
p as getAvailableMonths,
|
|
90
|
+
h as getAvailableYears,
|
|
110
91
|
y as getMonthRangeProps,
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
D as isWeekFullyInsideBounds,
|
|
116
|
-
b as isWeekSelectableInBounds,
|
|
92
|
+
D as isDateIntervalDisabled,
|
|
93
|
+
w as isMonthDisabled,
|
|
94
|
+
m as isMonthSelected,
|
|
95
|
+
l as isSameMonth,
|
|
117
96
|
g as nextMonthSelection
|
|
118
97
|
};
|
|
@@ -8,9 +8,7 @@ export declare function weekHasInMonthSelection(week: {
|
|
|
8
8
|
date: Date;
|
|
9
9
|
outside?: boolean;
|
|
10
10
|
}>;
|
|
11
|
-
}, isSelected?: (date: Date) => boolean
|
|
12
|
-
includeOutside?: boolean;
|
|
13
|
-
}): boolean;
|
|
11
|
+
}, isSelected?: (date: Date) => boolean): boolean;
|
|
14
12
|
export declare function weekIntervalContinues(week: {
|
|
15
13
|
days: Array<{
|
|
16
14
|
date: Date;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
function y(e) {
|
|
2
2
|
return e.days.length > 0 && e.days.every((t) => t.outside);
|
|
3
3
|
}
|
|
4
|
-
function g(e, t
|
|
5
|
-
return t ? e.days.some(
|
|
6
|
-
(a) => (r?.includeOutside || !a.outside) && t(a.date)
|
|
7
|
-
) : !1;
|
|
4
|
+
function g(e, t) {
|
|
5
|
+
return t ? e.days.some((r) => !r.outside && t(r.date)) : !1;
|
|
8
6
|
}
|
|
9
7
|
function d(e, t) {
|
|
10
8
|
return new Date(e.getFullYear(), e.getMonth(), e.getDate() + t);
|
|
@@ -14,14 +12,14 @@ function c(e, t) {
|
|
|
14
12
|
}
|
|
15
13
|
function h(e, t, r) {
|
|
16
14
|
if (!t) return { prev: !1, next: !1 };
|
|
17
|
-
const a = e.days.find((n) => !n.outside)?.date, o = r?.joinAdjacentWeek ? e.days[0]?.date : e.days.find((n) => !n.outside)?.date,
|
|
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) => {
|
|
18
16
|
if (!n || !t(n)) return !1;
|
|
19
17
|
const u = r?.periodForDate?.(n);
|
|
20
18
|
return r?.panePeriod != null && u != null ? u !== r.panePeriod : !!(a && c(n, a));
|
|
21
19
|
};
|
|
22
20
|
return {
|
|
23
|
-
prev:
|
|
24
|
-
next:
|
|
21
|
+
prev: i(f),
|
|
22
|
+
next: i(l)
|
|
25
23
|
};
|
|
26
24
|
}
|
|
27
25
|
export {
|
|
@@ -1,77 +1,78 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as s, jsx as p } from "react/jsx-runtime";
|
|
2
2
|
import "react";
|
|
3
|
-
import { cn as
|
|
4
|
-
import { Button as
|
|
5
|
-
import { intervalCaptionClassName as
|
|
6
|
-
import {
|
|
7
|
-
import { periodCellKind as
|
|
8
|
-
import { handlePeriodGridKeyDown as
|
|
9
|
-
const
|
|
3
|
+
import { cn as e } from "../../../lib/utils.js";
|
|
4
|
+
import { Button as N } from "../../primitives/button/button.js";
|
|
5
|
+
import { intervalCaptionClassName as v } from "./calendar-interval-caption.js";
|
|
6
|
+
import { SELECTION_RADIUS_END as g, SELECTION_RADIUS_START as T, SELECTION_RADIUS as I, periodRangeTrackClassName as j, periodTileAppearanceClassName as A } from "./calendar-selection-appearance.js";
|
|
7
|
+
import { periodCellKind as D } from "./calendar-selection.js";
|
|
8
|
+
import { handlePeriodGridKeyDown as S } from "./calendar-period-keyboard.js";
|
|
9
|
+
const _ = {
|
|
10
10
|
month: "h-10 w-10",
|
|
11
|
-
period: "min-h-16 h-auto
|
|
12
|
-
quarter: "h-16 min-h-16 max-h-16 min-w-0 flex-col items-center justify-center overflow-hidden whitespace-normal p-2 leading-tight",
|
|
13
|
-
year: "h-10 min-h-10 max-h-10 min-w-0 overflow-hidden",
|
|
14
|
-
"year-caption": "h-16 min-h-16 max-h-16 min-w-0 flex-col items-center justify-center gap-0.5 overflow-hidden whitespace-normal p-2 text-xs leading-tight"
|
|
11
|
+
period: "min-h-16 h-auto w-full flex-col items-center justify-center px-1 py-1",
|
|
12
|
+
quarter: "h-16 min-h-16 max-h-16 w-full min-w-0 flex-col items-center justify-center overflow-hidden whitespace-normal p-2 leading-tight",
|
|
13
|
+
year: "h-10 min-h-10 max-h-10 w-full min-w-0 overflow-hidden",
|
|
14
|
+
"year-caption": "h-16 min-h-16 max-h-16 w-full min-w-0 flex-col items-center justify-center gap-0.5 overflow-hidden whitespace-normal p-2 text-xs leading-tight"
|
|
15
15
|
};
|
|
16
|
-
function
|
|
17
|
-
selected:
|
|
16
|
+
function P({
|
|
17
|
+
selected: u,
|
|
18
18
|
disabled: n = !1,
|
|
19
19
|
isRange: i = !1,
|
|
20
|
-
isStart:
|
|
21
|
-
isEnd:
|
|
22
|
-
isMiddle:
|
|
23
|
-
hasRangeEnd:
|
|
20
|
+
isStart: t = !1,
|
|
21
|
+
isEnd: r = !1,
|
|
22
|
+
isMiddle: o = !1,
|
|
23
|
+
hasRangeEnd: d = !1,
|
|
24
24
|
size: l,
|
|
25
|
-
onClick:
|
|
26
|
-
onKeyDown:
|
|
27
|
-
children:
|
|
25
|
+
onClick: w,
|
|
26
|
+
onKeyDown: x,
|
|
27
|
+
children: y,
|
|
28
28
|
caption: m,
|
|
29
|
-
columns:
|
|
29
|
+
columns: f
|
|
30
30
|
}) {
|
|
31
|
-
const
|
|
32
|
-
return /* @__PURE__ */
|
|
31
|
+
const a = D({ selected: u, isRange: i, isStart: t, isEnd: r, isMiddle: o }), C = i && d && (o || t || r) && !n, c = l === "month";
|
|
32
|
+
return /* @__PURE__ */ s(
|
|
33
33
|
"div",
|
|
34
34
|
{
|
|
35
|
-
className:
|
|
35
|
+
className: e(
|
|
36
36
|
"group relative flex w-full items-center justify-center",
|
|
37
|
-
l === "period" || l === "quarter" || l === "year-caption" ? "min-h-16" : "h-10"
|
|
38
|
-
!o && p && !(e && a) && (e ? q : a ? K : P)
|
|
37
|
+
l === "period" || l === "quarter" || l === "year-caption" ? "min-h-16" : "h-10"
|
|
39
38
|
),
|
|
40
39
|
children: [
|
|
41
|
-
|
|
40
|
+
C ? /* @__PURE__ */ p(
|
|
42
41
|
"div",
|
|
43
42
|
{
|
|
44
|
-
className:
|
|
43
|
+
className: e(
|
|
45
44
|
"absolute inset-y-0",
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
j,
|
|
46
|
+
t && r && e("inset-x-2", I),
|
|
47
|
+
t && !r && e("left-1/2 right-0", c && "-ml-5", T),
|
|
48
|
+
r && !t && e("right-1/2 left-0", c && "-mr-5", g),
|
|
49
|
+
o && "inset-x-0"
|
|
48
50
|
)
|
|
49
51
|
}
|
|
50
52
|
) : null,
|
|
51
|
-
/* @__PURE__ */
|
|
52
|
-
|
|
53
|
+
/* @__PURE__ */ s(
|
|
54
|
+
N,
|
|
53
55
|
{
|
|
54
56
|
variant: "ghost",
|
|
55
|
-
onClick:
|
|
57
|
+
onClick: w,
|
|
56
58
|
onKeyDown: (h) => {
|
|
57
|
-
|
|
59
|
+
f && S(h, f), x?.(h);
|
|
58
60
|
},
|
|
59
61
|
disabled: n,
|
|
60
|
-
"data-selection":
|
|
62
|
+
"data-selection": a,
|
|
61
63
|
"data-period-tile": "",
|
|
62
|
-
className:
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
!o && k
|
|
64
|
+
className: e(
|
|
65
|
+
A({ kind: a, disabled: n }),
|
|
66
|
+
_[l]
|
|
66
67
|
),
|
|
67
68
|
children: [
|
|
68
|
-
|
|
69
|
-
m ? /* @__PURE__ */
|
|
69
|
+
y,
|
|
70
|
+
m ? /* @__PURE__ */ p(
|
|
70
71
|
"span",
|
|
71
72
|
{
|
|
72
73
|
"data-slot": "interval-caption",
|
|
73
|
-
className:
|
|
74
|
-
|
|
74
|
+
className: v(
|
|
75
|
+
a === "point" || a === "interval-start" || a === "interval-end"
|
|
75
76
|
),
|
|
76
77
|
children: m
|
|
77
78
|
}
|
|
@@ -84,5 +85,5 @@ function O({
|
|
|
84
85
|
);
|
|
85
86
|
}
|
|
86
87
|
export {
|
|
87
|
-
|
|
88
|
+
P as CalendarPeriodCell
|
|
88
89
|
};
|
|
@@ -1,30 +1,28 @@
|
|
|
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";
|
|
4
3
|
import { Button as u } from "../../primitives/button/button.js";
|
|
5
|
-
import { Select as
|
|
6
|
-
import { CalendarPeriodCell as
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
function X({
|
|
4
|
+
import { Select as W } from "../../forms/select/select.js";
|
|
5
|
+
import { CalendarPeriodCell as Y } from "./calendar-period-cell.js";
|
|
6
|
+
import { getQuarterRangeProps as y, isQuarterRangeSelection as A } from "./calendar-quarter-utils.js";
|
|
7
|
+
function L({
|
|
10
8
|
quarterMode: n,
|
|
11
9
|
pickerYear: g,
|
|
12
10
|
showFooter: h,
|
|
13
11
|
pendingQuarterSelection: v,
|
|
14
12
|
selectedQuarters: x,
|
|
15
|
-
resolvedStartYear:
|
|
16
|
-
resolvedEndYear:
|
|
13
|
+
resolvedStartYear: w,
|
|
14
|
+
resolvedEndYear: N,
|
|
17
15
|
yearOptions: d,
|
|
18
|
-
previousYearLabel:
|
|
19
|
-
nextYearLabel:
|
|
16
|
+
previousYearLabel: b,
|
|
17
|
+
nextYearLabel: f,
|
|
20
18
|
currentMonth: t,
|
|
21
19
|
quarterLabelsForYear: S,
|
|
22
|
-
isQuarterSelected:
|
|
23
|
-
isQuarterDisabled:
|
|
20
|
+
isQuarterSelected: k,
|
|
21
|
+
isQuarterDisabled: C,
|
|
24
22
|
onMonthChange: o,
|
|
25
|
-
onQuarterClick:
|
|
23
|
+
onQuarterClick: z
|
|
26
24
|
}) {
|
|
27
|
-
const c = h ? v : x,
|
|
25
|
+
const c = h ? v : x, R = n === "range" || n === "multiple" || n === "multi-range", m = (l = 0) => {
|
|
28
26
|
const e = g + l;
|
|
29
27
|
return /* @__PURE__ */ s(
|
|
30
28
|
"div",
|
|
@@ -39,14 +37,14 @@ function X({
|
|
|
39
37
|
variant: "ghost",
|
|
40
38
|
size: "icon",
|
|
41
39
|
className: "h-7 w-7 shrink-0",
|
|
42
|
-
"aria-label":
|
|
43
|
-
disabled: e <=
|
|
40
|
+
"aria-label": b,
|
|
41
|
+
disabled: e <= w,
|
|
44
42
|
onClick: () => o(new Date(e - 1, t.getMonth(), 1)),
|
|
45
43
|
children: /* @__PURE__ */ i(p, { size: 16, className: "rotate-180" })
|
|
46
44
|
}
|
|
47
45
|
) : /* @__PURE__ */ i("span", { className: "size-7 shrink-0", "aria-hidden": !0 }),
|
|
48
46
|
/* @__PURE__ */ i(
|
|
49
|
-
|
|
47
|
+
W,
|
|
50
48
|
{
|
|
51
49
|
value: d.find((a) => a.value === String(e)) ?? {
|
|
52
50
|
label: String(e),
|
|
@@ -68,32 +66,32 @@ function X({
|
|
|
68
66
|
variant: "ghost",
|
|
69
67
|
size: "icon",
|
|
70
68
|
className: "h-7 w-7",
|
|
71
|
-
"aria-label":
|
|
72
|
-
disabled: e >=
|
|
69
|
+
"aria-label": f,
|
|
70
|
+
disabled: e >= N,
|
|
73
71
|
onClick: () => o(new Date(e + 1, t.getMonth(), 1)),
|
|
74
72
|
children: /* @__PURE__ */ i(p, { className: "h-4 w-4" })
|
|
75
73
|
}
|
|
76
74
|
)
|
|
77
75
|
] }),
|
|
78
|
-
/* @__PURE__ */ i("div", { "data-period-grid": "", className:
|
|
79
|
-
const r =
|
|
76
|
+
/* @__PURE__ */ i("div", { "data-period-grid": "", className: "grid min-w-0 grid-cols-2 gap-2", children: S(e).map((a, j) => {
|
|
77
|
+
const r = j + 1, P = k(e, r), D = C(e, r), Q = n === "range", { isStart: B, isEnd: E, isMiddle: T } = y(
|
|
80
78
|
e,
|
|
81
79
|
r,
|
|
82
80
|
c
|
|
83
|
-
),
|
|
81
|
+
), q = A(c) && !!c.to;
|
|
84
82
|
return /* @__PURE__ */ i(
|
|
85
|
-
|
|
83
|
+
Y,
|
|
86
84
|
{
|
|
87
|
-
selected:
|
|
88
|
-
disabled:
|
|
89
|
-
isRange:
|
|
90
|
-
isStart:
|
|
91
|
-
isEnd:
|
|
92
|
-
isMiddle:
|
|
93
|
-
hasRangeEnd: !!
|
|
85
|
+
selected: P,
|
|
86
|
+
disabled: D,
|
|
87
|
+
isRange: Q,
|
|
88
|
+
isStart: B,
|
|
89
|
+
isEnd: E,
|
|
90
|
+
isMiddle: T,
|
|
91
|
+
hasRangeEnd: !!q,
|
|
94
92
|
size: "quarter",
|
|
95
93
|
columns: 2,
|
|
96
|
-
onClick: () =>
|
|
94
|
+
onClick: () => z(e, r),
|
|
97
95
|
caption: a.caption,
|
|
98
96
|
children: a.label
|
|
99
97
|
},
|
|
@@ -106,12 +104,12 @@ function X({
|
|
|
106
104
|
};
|
|
107
105
|
return /* @__PURE__ */ s("div", { "data-slot": "quarter-panes", children: [
|
|
108
106
|
m(0),
|
|
109
|
-
|
|
107
|
+
R ? /* @__PURE__ */ s("div", { "data-slot": "quarter-pane-divider-group", children: [
|
|
110
108
|
/* @__PURE__ */ i("div", { className: "my-4 w-[1px] bg-stroke-hairline" }),
|
|
111
109
|
m(1)
|
|
112
110
|
] }) : null
|
|
113
111
|
] });
|
|
114
112
|
}
|
|
115
113
|
export {
|
|
116
|
-
|
|
114
|
+
L as CalendarQuarterPanes
|
|
117
115
|
};
|
|
@@ -22,7 +22,6 @@ 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";
|
|
26
25
|
export declare const weekNumberBaseClassName: string;
|
|
27
26
|
export declare const weekNumberSelectedFillClassName = "group-data-[week-selected]/week:bg-accent";
|
|
28
27
|
export declare const weekNumberFocusClassName = "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring";
|
|
@@ -32,15 +31,6 @@ export declare const periodTileHoverClassName = "hover:border-brand hover:bg-acc
|
|
|
32
31
|
export declare const periodTileMiddleClassName = "text-accent-foreground";
|
|
33
32
|
export declare const periodTileDisabledClassName = "cursor-not-allowed text-content-placeholder opacity-50";
|
|
34
33
|
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;
|
|
44
34
|
export declare function dayButtonAppearanceClassName(kind: SelectionKind, pickerType: "date" | "week"): string;
|
|
45
35
|
export declare function periodTileAppearanceClassName(params: {
|
|
46
36
|
kind: SelectionKind;
|
|
@@ -1,86 +1,72 @@
|
|
|
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", y = "min-w-[292px]", d = "w-9 flex-shrink-0", s = "bg-accent", i = "bg-brand text-brand-foreground", c = "hover:bg-brand-strong hover:text-brand-foreground hover:border-transparent", a = "rounded-lg", I = "rounded-l-lg", k = "rounded-r-lg", u = e(
|
|
3
3
|
"flex items-center justify-center p-0 font-normal text-sm transition-colors",
|
|
4
4
|
"border border-transparent",
|
|
5
|
-
|
|
5
|
+
a,
|
|
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
|
-
),
|
|
10
|
+
), p = "hover:bg-accent hover:text-accent-foreground hover:border-transparent", m = "hover:bg-transparent hover:text-inherit hover:border-transparent", v = e(
|
|
11
11
|
i,
|
|
12
12
|
c,
|
|
13
|
-
|
|
13
|
+
a,
|
|
14
14
|
"border-transparent"
|
|
15
|
-
),
|
|
15
|
+
), b = "text-accent-foreground rounded-none border-transparent", L = 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
|
+
), C = "calendar-interval-cap-start", S = e(s, "rounded-none"), N = "calendar-interval-cap-end", A = e(s, "rounded-none"), B = C, R = N, f = "text-[11px] font-medium text-content-icon", D = "text-brand group-has-[.rdp-selected]/week:text-brand group-hover/week:text-brand", O = e(
|
|
19
19
|
"select-none flex items-center justify-center",
|
|
20
|
-
|
|
20
|
+
f,
|
|
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
|
+
a,
|
|
27
27
|
"focus-visible:ring-2 focus-visible:ring-inset focus-visible:ring-focus-ring focus-visible:ring-offset-0"
|
|
28
|
-
),
|
|
29
|
-
function
|
|
30
|
-
const
|
|
31
|
-
return
|
|
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";
|
|
28
|
+
), g = e(i, c), h = "hover:border-brand hover:bg-accent hover:text-accent-foreground", x = "text-accent-foreground", T = "cursor-not-allowed text-content-placeholder opacity-50", P = s;
|
|
29
|
+
function U(n, t) {
|
|
30
|
+
const r = n === "point" || n === "interval-start" || n === "interval-end";
|
|
31
|
+
return e(u, r ? v : n === "interval-middle" ? b : void 0, t === "week" ? r ? void 0 : m : n === "none" ? p : void 0);
|
|
38
32
|
}
|
|
39
|
-
function
|
|
40
|
-
const
|
|
41
|
-
return e(
|
|
42
|
-
}
|
|
43
|
-
function K(t) {
|
|
44
|
-
const { kind: n, disabled: r } = t;
|
|
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);
|
|
33
|
+
function F(n) {
|
|
34
|
+
const { kind: t, disabled: r } = n;
|
|
35
|
+
return r ? e(o, T) : t === "point" || t === "interval-start" || t === "interval-end" ? e(o, g) : t === "interval-middle" ? e(o, x) : e(o, h);
|
|
46
36
|
}
|
|
47
37
|
export {
|
|
48
38
|
l as DAY_CELL_SIZE,
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
F as PERIOD_RANGE_GRID_CLASSNAME,
|
|
39
|
+
y as DAY_MONTH_MIN_WIDTH,
|
|
40
|
+
s as INTERVAL_TRACK,
|
|
52
41
|
i as POINT_FILL,
|
|
53
42
|
c as POINT_FILL_HOVER,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
43
|
+
a as SELECTION_RADIUS,
|
|
44
|
+
k as SELECTION_RADIUS_END,
|
|
45
|
+
I as SELECTION_RADIUS_START,
|
|
57
46
|
d as WEEK_GUTTER_RULE,
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
K as periodTileAppearanceClassName,
|
|
47
|
+
U as dayButtonAppearanceClassName,
|
|
48
|
+
u as dayButtonBaseClassName,
|
|
49
|
+
p as dayButtonHoverClassName,
|
|
50
|
+
b as dayButtonMiddleClassName,
|
|
51
|
+
v as dayButtonPointClassName,
|
|
52
|
+
m as dayButtonWeekHoverClassName,
|
|
53
|
+
L as dayCellBaseClassName,
|
|
54
|
+
P as periodRangeTrackClassName,
|
|
55
|
+
F as periodTileAppearanceClassName,
|
|
68
56
|
o as periodTileBaseClassName,
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
B as
|
|
75
|
-
L as previewCapStartCellClassName,
|
|
57
|
+
T as periodTileDisabledClassName,
|
|
58
|
+
h as periodTileHoverClassName,
|
|
59
|
+
x as periodTileMiddleClassName,
|
|
60
|
+
g as periodTilePointClassName,
|
|
61
|
+
R as previewCapEndCellClassName,
|
|
62
|
+
B as previewCapStartCellClassName,
|
|
76
63
|
A as previewCellClassName,
|
|
77
|
-
|
|
64
|
+
N as rangeEndCellClassName,
|
|
78
65
|
S as rangeMiddleCellClassName,
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
O as weekNumberBlockedClassName,
|
|
66
|
+
C as rangeStartCellClassName,
|
|
67
|
+
O as weekNumberBaseClassName,
|
|
82
68
|
M as weekNumberFocusClassName,
|
|
83
69
|
D as weekNumberInteractiveClassName,
|
|
84
70
|
H as weekNumberSelectedFillClassName,
|
|
85
|
-
|
|
71
|
+
f as weekNumberTypeClassName
|
|
86
72
|
};
|