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,482 +1,404 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { parseCivilDate as
|
|
3
|
-
import { buildFiscalYear as
|
|
4
|
-
import { isCalendarApplyDisabled as
|
|
5
|
-
import {
|
|
6
|
-
import { calculateWeekSelection as
|
|
7
|
-
import { priorFyComparison as
|
|
8
|
-
import { nextQuarterSelection as
|
|
9
|
-
import { nextYearSelection as
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
numberOfMonths: Vn(i.pickerType, i.mode, i.weekMode),
|
|
38
|
-
hasSelection: $n(
|
|
39
|
-
i.pickerType,
|
|
40
|
-
i.selected,
|
|
41
|
-
i.selectedWeeks,
|
|
42
|
-
i.selectedMonths,
|
|
43
|
-
i.selectedQuarters,
|
|
44
|
-
i.selectedYear
|
|
45
|
-
),
|
|
46
|
-
autoNavigateToAvailable: i.autoNavigateToAvailable,
|
|
47
|
-
yearPageSize: i.yearPageSize
|
|
48
|
-
});
|
|
49
|
-
}
|
|
50
|
-
function Un({
|
|
51
|
-
showFooter: n,
|
|
52
|
-
mode: i,
|
|
53
|
-
selected: a,
|
|
54
|
-
onSelect: l,
|
|
55
|
-
onSelectionChange: k,
|
|
56
|
-
pickerType: f,
|
|
57
|
-
weekMode: x,
|
|
58
|
-
selectedWeeks: v,
|
|
59
|
-
onWeekSelect: j,
|
|
60
|
-
calendarKind: P,
|
|
61
|
-
fiscalMode: lt,
|
|
62
|
-
granularity: z,
|
|
63
|
-
resolvedFiscalPattern: mt,
|
|
64
|
-
fiscalConfig: c,
|
|
65
|
-
fiscalYearStartMonth: ct,
|
|
66
|
-
weekStartsOn: Dt,
|
|
67
|
-
monthMode: $,
|
|
68
|
-
selectedMonths: S,
|
|
69
|
-
onMonthSelect: q,
|
|
70
|
-
selectedQuarters: E,
|
|
71
|
-
onQuarterSelect: y,
|
|
72
|
-
selectedYear: I,
|
|
73
|
-
onYearSelect: B,
|
|
74
|
-
yearMode: w = "single",
|
|
75
|
-
comparison: h,
|
|
76
|
-
onComparisonChange: C,
|
|
1
|
+
import * as n from "react";
|
|
2
|
+
import { parseCivilDate as Wi, localDateFromCivil as V } from "../../../lib/fiscal-calendar/civil-date.js";
|
|
3
|
+
import { buildFiscalYear as w } from "../../../lib/fiscal-calendar/build-year.js";
|
|
4
|
+
import { isCalendarApplyDisabled as Ki } from "./calendar-apply-validation.js";
|
|
5
|
+
import { nextMonthSelection as Ri, getAvailableYears as ei, isMonthSelected as Ti, getMonthRangeProps as pi, isMonthDisabled as Fi } from "./calendar-month-utils.js";
|
|
6
|
+
import { calculateWeekSelection as wi, nextWeekSelection as yi, weekSelectionsToDates as hi, computeWeekRangeModifiers as di } from "./calendar-week-utils.js";
|
|
7
|
+
import { priorFyComparison as it, flattenDateRanges as tt, multiRangeModifiers as nt, isDateRangeArray as h, dateSelectToCalendarSelection as rt, presetIntervalToDateRange as Si, asDayPickerSelection as Ii, isMultiRangeComplete as ut, asRangeSelection as at, nextMultiRangeDateSelection as st } from "./calendar-interval-utils.js";
|
|
8
|
+
import { nextQuarterSelection as $i, isQuarterSelected as ft, isQuarterDisabledForBounds as lt } from "./calendar-quarter-utils.js";
|
|
9
|
+
import { nextYearSelection as ji, isYearSelectedForSelection as mt, isYearDisabledForBounds as ct } from "./calendar-year-utils.js";
|
|
10
|
+
function yt({
|
|
11
|
+
showFooter: r,
|
|
12
|
+
mode: x,
|
|
13
|
+
selected: s,
|
|
14
|
+
onSelect: g,
|
|
15
|
+
onSelectionChange: d,
|
|
16
|
+
pickerType: u,
|
|
17
|
+
weekMode: y,
|
|
18
|
+
selectedWeeks: A,
|
|
19
|
+
onWeekSelect: I,
|
|
20
|
+
calendarKind: v,
|
|
21
|
+
fiscalMode: ii,
|
|
22
|
+
granularity: ti,
|
|
23
|
+
resolvedFiscalPattern: ni,
|
|
24
|
+
fiscalConfig: l,
|
|
25
|
+
fiscalYearStartMonth: ri,
|
|
26
|
+
weekStartsOn: ui,
|
|
27
|
+
monthMode: S,
|
|
28
|
+
selectedMonths: $,
|
|
29
|
+
onMonthSelect: j,
|
|
30
|
+
selectedQuarters: _,
|
|
31
|
+
onQuarterSelect: C,
|
|
32
|
+
selectedYear: q,
|
|
33
|
+
onYearSelect: Y,
|
|
34
|
+
yearMode: K = "single",
|
|
35
|
+
comparison: e,
|
|
36
|
+
onComparisonChange: E,
|
|
77
37
|
onRangesChange: X,
|
|
78
|
-
month:
|
|
79
|
-
defaultMonth:
|
|
80
|
-
onMonthChange:
|
|
81
|
-
resolvedStartMonth:
|
|
82
|
-
resolvedEndMonth:
|
|
83
|
-
disabled:
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
onCancel: vt,
|
|
88
|
-
onClear: At
|
|
38
|
+
month: O,
|
|
39
|
+
defaultMonth: ai,
|
|
40
|
+
onMonthChange: si,
|
|
41
|
+
resolvedStartMonth: fi,
|
|
42
|
+
resolvedEndMonth: li,
|
|
43
|
+
disabled: B,
|
|
44
|
+
onApply: N,
|
|
45
|
+
onCancel: mi,
|
|
46
|
+
onClear: ci
|
|
89
47
|
}) {
|
|
90
|
-
const
|
|
91
|
-
()
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
yearPageSize: d
|
|
103
|
-
})
|
|
104
|
-
), [_, M] = r.useState(v), [G, W] = r.useState(S), [L, K] = r.useState(E), [O, o] = r.useState(I), [Nt, rt] = r.useState(
|
|
105
|
-
xt.getFullYear()
|
|
106
|
-
);
|
|
107
|
-
r.useEffect(() => {
|
|
108
|
-
Rt.current = e;
|
|
109
|
-
}, [e]), r.useEffect(() => {
|
|
110
|
-
if (!N) return;
|
|
111
|
-
if (tt.current) {
|
|
112
|
-
tt.current = !1, nt(N), rt(N.getFullYear());
|
|
113
|
-
return;
|
|
48
|
+
const [f, U] = n.useState(s), [Di, bi] = n.useState(() => {
|
|
49
|
+
if (O) return O;
|
|
50
|
+
if (ai) return ai;
|
|
51
|
+
if (s) {
|
|
52
|
+
if (Array.isArray(s)) {
|
|
53
|
+
const i = s[0];
|
|
54
|
+
return i instanceof Date ? i : /* @__PURE__ */ new Date();
|
|
55
|
+
}
|
|
56
|
+
if (s instanceof Date)
|
|
57
|
+
return s;
|
|
58
|
+
if ("from" in s && s.from)
|
|
59
|
+
return s.from;
|
|
114
60
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
});
|
|
128
|
-
nt(t), rt(t.getFullYear()), Sn(t, N) || Rt.current?.(t);
|
|
129
|
-
}, [
|
|
130
|
-
N,
|
|
131
|
-
A,
|
|
132
|
-
p,
|
|
133
|
-
f,
|
|
134
|
-
i,
|
|
135
|
-
x,
|
|
136
|
-
a,
|
|
137
|
-
v,
|
|
138
|
-
S,
|
|
139
|
-
E,
|
|
140
|
-
I,
|
|
141
|
-
d
|
|
142
|
-
]), r.useEffect(() => {
|
|
143
|
-
H(a), M(v), W(S), K(E), o(I);
|
|
144
|
-
}, [a, v, S, E, I]);
|
|
145
|
-
const Yt = r.useCallback(
|
|
146
|
-
(t) => {
|
|
147
|
-
tt.current = !0, nt(t), rt(t.getFullYear()), e?.(t);
|
|
61
|
+
return /* @__PURE__ */ new Date();
|
|
62
|
+
}), [P, Z] = n.useState(A), [z, k] = n.useState($), [G, Q] = n.useState(_), [H, o] = n.useState(q), [_i, gi] = n.useState(
|
|
63
|
+
Di.getFullYear()
|
|
64
|
+
);
|
|
65
|
+
n.useEffect(() => {
|
|
66
|
+
O && (bi(O), gi(O.getFullYear()));
|
|
67
|
+
}, [O]), n.useEffect(() => {
|
|
68
|
+
U(s), Z(A), k($), Q(_), o(q);
|
|
69
|
+
}, [s, A, $, _, q]);
|
|
70
|
+
const qi = n.useCallback(
|
|
71
|
+
(i) => {
|
|
72
|
+
bi(i), gi(i.getFullYear()), si?.(i);
|
|
148
73
|
},
|
|
149
|
-
[
|
|
150
|
-
),
|
|
74
|
+
[si]
|
|
75
|
+
), vi = n.useMemo(
|
|
151
76
|
() => ({
|
|
152
|
-
calendarKind:
|
|
153
|
-
fiscalMode:
|
|
154
|
-
granularity:
|
|
155
|
-
fiscalMonthPattern:
|
|
156
|
-
fiscalYearStartMonth:
|
|
157
|
-
weekStartsOn:
|
|
77
|
+
calendarKind: v,
|
|
78
|
+
fiscalMode: ii,
|
|
79
|
+
granularity: ti,
|
|
80
|
+
fiscalMonthPattern: ni,
|
|
81
|
+
fiscalYearStartMonth: ri,
|
|
82
|
+
weekStartsOn: ui
|
|
158
83
|
}),
|
|
159
84
|
[
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
85
|
+
v,
|
|
86
|
+
ii,
|
|
87
|
+
ti,
|
|
88
|
+
ni,
|
|
89
|
+
ri,
|
|
90
|
+
ui
|
|
166
91
|
]
|
|
167
|
-
),
|
|
168
|
-
(
|
|
169
|
-
[
|
|
170
|
-
),
|
|
171
|
-
(
|
|
172
|
-
if (
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
return j?.(D), D;
|
|
92
|
+
), T = n.useCallback(
|
|
93
|
+
(i) => wi(i, vi),
|
|
94
|
+
[vi]
|
|
95
|
+
), p = n.useCallback(
|
|
96
|
+
(i) => {
|
|
97
|
+
if (r) {
|
|
98
|
+
Z((a) => {
|
|
99
|
+
const m = yi(i, a, y === "multi-range" ? "range" : y);
|
|
100
|
+
return I?.(m), m;
|
|
177
101
|
});
|
|
178
102
|
return;
|
|
179
103
|
}
|
|
180
|
-
const
|
|
181
|
-
|
|
182
|
-
|
|
104
|
+
const t = yi(i, A, y === "multi-range" ? "range" : y);
|
|
105
|
+
I?.(
|
|
106
|
+
y === "multiple" ? Array.isArray(t) && t.length > 0 ? t : void 0 : t
|
|
183
107
|
);
|
|
184
108
|
},
|
|
185
|
-
[
|
|
186
|
-
),
|
|
187
|
-
(
|
|
188
|
-
let
|
|
189
|
-
if (
|
|
109
|
+
[y, r, A, I]
|
|
110
|
+
), Bi = n.useCallback(
|
|
111
|
+
(i, t) => {
|
|
112
|
+
let a = { year: i, month: t };
|
|
113
|
+
if (v === "fiscal" && l)
|
|
190
114
|
try {
|
|
191
|
-
const
|
|
192
|
-
if (
|
|
193
|
-
const
|
|
194
|
-
|
|
195
|
-
year:
|
|
196
|
-
month:
|
|
197
|
-
fy:
|
|
198
|
-
period:
|
|
199
|
-
start:
|
|
200
|
-
end:
|
|
115
|
+
const c = w(l, i).periods[t];
|
|
116
|
+
if (c) {
|
|
117
|
+
const b = Wi(c.start);
|
|
118
|
+
a = {
|
|
119
|
+
year: b.y,
|
|
120
|
+
month: b.m - 1,
|
|
121
|
+
fy: c.fy,
|
|
122
|
+
period: c.period,
|
|
123
|
+
start: V(c.start),
|
|
124
|
+
end: V(c.end)
|
|
201
125
|
};
|
|
202
126
|
}
|
|
203
127
|
} catch {
|
|
204
128
|
}
|
|
205
|
-
if (
|
|
206
|
-
|
|
207
|
-
const
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
129
|
+
if (r) {
|
|
130
|
+
k((D) => {
|
|
131
|
+
const c = Ri(
|
|
132
|
+
a,
|
|
133
|
+
D,
|
|
134
|
+
S === "multi-range" ? "range" : S
|
|
211
135
|
);
|
|
212
|
-
return
|
|
136
|
+
return j?.(c), c;
|
|
213
137
|
});
|
|
214
138
|
return;
|
|
215
139
|
}
|
|
216
|
-
const
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
140
|
+
const m = Ri(
|
|
141
|
+
a,
|
|
142
|
+
$,
|
|
143
|
+
S === "multi-range" ? "range" : S
|
|
220
144
|
);
|
|
221
|
-
|
|
222
|
-
|
|
145
|
+
j?.(
|
|
146
|
+
S === "multiple" ? Array.isArray(m) && m.length > 0 ? m : void 0 : m
|
|
223
147
|
);
|
|
224
148
|
},
|
|
225
|
-
[
|
|
226
|
-
),
|
|
227
|
-
(
|
|
228
|
-
let
|
|
229
|
-
year:
|
|
230
|
-
quarter:
|
|
231
|
-
start: new Date(
|
|
232
|
-
end: new Date(
|
|
149
|
+
[S, r, $, j, v, l]
|
|
150
|
+
), Ci = n.useCallback(
|
|
151
|
+
(i, t) => {
|
|
152
|
+
let a = {
|
|
153
|
+
year: i,
|
|
154
|
+
quarter: t,
|
|
155
|
+
start: new Date(i, (t - 1) * 3, 1),
|
|
156
|
+
end: new Date(i, t * 3, 0)
|
|
233
157
|
};
|
|
234
|
-
if (
|
|
158
|
+
if (v === "fiscal" && l)
|
|
235
159
|
try {
|
|
236
|
-
const
|
|
237
|
-
|
|
238
|
-
year:
|
|
239
|
-
quarter:
|
|
240
|
-
fy:
|
|
241
|
-
start:
|
|
242
|
-
end:
|
|
160
|
+
const D = w(l, i).quarters.find((c) => c.quarter === t);
|
|
161
|
+
D && (a = {
|
|
162
|
+
year: i,
|
|
163
|
+
quarter: t,
|
|
164
|
+
fy: D.fy,
|
|
165
|
+
start: V(D.start),
|
|
166
|
+
end: V(D.end)
|
|
243
167
|
});
|
|
244
168
|
} catch {
|
|
245
169
|
}
|
|
246
|
-
if (
|
|
247
|
-
|
|
248
|
-
const
|
|
249
|
-
return
|
|
170
|
+
if (r) {
|
|
171
|
+
Q((m) => {
|
|
172
|
+
const D = $i(a, m, S);
|
|
173
|
+
return C?.(D), D;
|
|
250
174
|
});
|
|
251
175
|
return;
|
|
252
176
|
}
|
|
253
|
-
|
|
177
|
+
C?.($i(a, _, S));
|
|
254
178
|
},
|
|
255
|
-
[
|
|
256
|
-
),
|
|
257
|
-
(
|
|
258
|
-
let
|
|
259
|
-
year:
|
|
260
|
-
start: new Date(
|
|
261
|
-
end: new Date(
|
|
179
|
+
[v, l, S, C, _, r]
|
|
180
|
+
), Yi = n.useCallback(
|
|
181
|
+
(i) => {
|
|
182
|
+
let t = {
|
|
183
|
+
year: i,
|
|
184
|
+
start: new Date(i, 0, 1),
|
|
185
|
+
end: new Date(i, 11, 31)
|
|
262
186
|
};
|
|
263
|
-
if (
|
|
187
|
+
if (v === "fiscal" && l)
|
|
264
188
|
try {
|
|
265
|
-
const
|
|
266
|
-
|
|
267
|
-
year:
|
|
268
|
-
fy:
|
|
269
|
-
start:
|
|
270
|
-
end:
|
|
189
|
+
const a = w(l, i);
|
|
190
|
+
t = {
|
|
191
|
+
year: a.fy,
|
|
192
|
+
fy: a.fy,
|
|
193
|
+
start: V(a.start),
|
|
194
|
+
end: V(a.end)
|
|
271
195
|
};
|
|
272
196
|
} catch {
|
|
273
197
|
}
|
|
274
|
-
if (
|
|
275
|
-
o((
|
|
276
|
-
const
|
|
277
|
-
return
|
|
198
|
+
if (r) {
|
|
199
|
+
o((a) => {
|
|
200
|
+
const m = ji(t, a, K);
|
|
201
|
+
return Y?.(m), m;
|
|
278
202
|
});
|
|
279
203
|
return;
|
|
280
204
|
}
|
|
281
|
-
|
|
205
|
+
Y?.(ji(t, q, K));
|
|
282
206
|
},
|
|
283
|
-
[
|
|
284
|
-
),
|
|
285
|
-
(
|
|
286
|
-
if (
|
|
287
|
-
|
|
207
|
+
[v, l, Y, q, r, K]
|
|
208
|
+
), J = n.useCallback(
|
|
209
|
+
(i) => {
|
|
210
|
+
if (e !== "prior-fy" || !l || !i?.from || !i.to) {
|
|
211
|
+
e === "prior-fy" && E?.(void 0);
|
|
288
212
|
return;
|
|
289
213
|
}
|
|
290
|
-
|
|
214
|
+
E?.(it(l, i.from, i.to));
|
|
291
215
|
},
|
|
292
|
-
[
|
|
293
|
-
),
|
|
294
|
-
() =>
|
|
295
|
-
[
|
|
296
|
-
),
|
|
297
|
-
if (
|
|
298
|
-
return
|
|
299
|
-
}, [
|
|
300
|
-
if (
|
|
301
|
-
const
|
|
302
|
-
return
|
|
303
|
-
}, [
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
]),
|
|
312
|
-
(
|
|
313
|
-
|
|
216
|
+
[e, l, E]
|
|
217
|
+
), Ei = n.useMemo(
|
|
218
|
+
() => ei(fi, li),
|
|
219
|
+
[fi, li]
|
|
220
|
+
), F = n.useMemo(() => u !== "week" ? void 0 : hi(r ? P : A), [u, r, P, A]), Ni = n.useMemo(() => {
|
|
221
|
+
if (x === "multi-range")
|
|
222
|
+
return tt(r ? f : s);
|
|
223
|
+
}, [x, r, f, s]), Ai = n.useMemo(() => {
|
|
224
|
+
if (x !== "multi-range") return;
|
|
225
|
+
const i = r ? f : s;
|
|
226
|
+
return nt(h(i) ? i : void 0);
|
|
227
|
+
}, [x, r, f, s]), zi = n.useMemo(() => u !== "week" ? Ai ?? { range_start: [], range_middle: [], range_end: [] } : di(F, y === "multi-range" ? "range" : y, r ? P : A), [
|
|
228
|
+
u,
|
|
229
|
+
F,
|
|
230
|
+
y,
|
|
231
|
+
r,
|
|
232
|
+
P,
|
|
233
|
+
A,
|
|
234
|
+
Ai
|
|
235
|
+
]), R = n.useCallback(
|
|
236
|
+
(i) => {
|
|
237
|
+
d?.(rt(x, i));
|
|
314
238
|
},
|
|
315
|
-
[
|
|
316
|
-
),
|
|
317
|
-
(
|
|
318
|
-
if (
|
|
319
|
-
const
|
|
320
|
-
if (
|
|
321
|
-
|
|
239
|
+
[x, d]
|
|
240
|
+
), Gi = n.useCallback(
|
|
241
|
+
(i, t) => {
|
|
242
|
+
if (u === "week" && i) {
|
|
243
|
+
const a = t ?? (Array.isArray(i) ? i[i.length - 1] : i instanceof Date ? i : void 0);
|
|
244
|
+
if (a) {
|
|
245
|
+
p(T(a));
|
|
322
246
|
return;
|
|
323
247
|
}
|
|
324
248
|
}
|
|
325
|
-
if (
|
|
326
|
-
const
|
|
327
|
-
if (!
|
|
328
|
-
const
|
|
329
|
-
const
|
|
330
|
-
return
|
|
249
|
+
if (x === "multi-range") {
|
|
250
|
+
const a = t ?? (i instanceof Date ? i : Array.isArray(i) ? i[i.length - 1] : i && "from" in i ? i.to ?? i.from : void 0);
|
|
251
|
+
if (!a) return;
|
|
252
|
+
const m = (b) => {
|
|
253
|
+
const L = h(b) ? b : b && typeof b == "object" && !(b instanceof Date) && !Array.isArray(b) && "from" in b ? [b] : void 0;
|
|
254
|
+
return st(a, L);
|
|
331
255
|
};
|
|
332
|
-
if (
|
|
333
|
-
|
|
334
|
-
const
|
|
335
|
-
return
|
|
256
|
+
if (r) {
|
|
257
|
+
U((b) => {
|
|
258
|
+
const L = m(b), W = L[L.length - 1];
|
|
259
|
+
return g?.(W), X?.(L), R(L), W?.from && W.to && J(W), L;
|
|
336
260
|
});
|
|
337
261
|
return;
|
|
338
262
|
}
|
|
339
|
-
const
|
|
340
|
-
|
|
263
|
+
const D = m(s), c = D[D.length - 1];
|
|
264
|
+
g?.(c), X?.(D), R(D), c?.from && c.to && J(c);
|
|
341
265
|
return;
|
|
342
266
|
}
|
|
343
|
-
|
|
267
|
+
r ? (U(i), g?.(i), R(i), i && typeof i == "object" && !(i instanceof Date) && !Array.isArray(i) && i.from && i.to && J(i)) : (g?.(i), R(i), i && typeof i == "object" && !(i instanceof Date) && !Array.isArray(i) && i.from && i.to && J(i));
|
|
344
268
|
},
|
|
345
|
-
[
|
|
346
|
-
),
|
|
347
|
-
(
|
|
348
|
-
const
|
|
349
|
-
|
|
350
|
-
primary:
|
|
351
|
-
comparison:
|
|
352
|
-
}) :
|
|
269
|
+
[r, g, X, R, u, T, p, x, s, J]
|
|
270
|
+
), Hi = n.useCallback(
|
|
271
|
+
(i) => {
|
|
272
|
+
const t = Si(i.interval);
|
|
273
|
+
r && U(t), g?.(t), R(t), i.comparison ? E?.({
|
|
274
|
+
primary: t,
|
|
275
|
+
comparison: Si(i.comparison)
|
|
276
|
+
}) : J(t);
|
|
353
277
|
},
|
|
354
|
-
[
|
|
355
|
-
),
|
|
356
|
-
if (
|
|
357
|
-
|
|
358
|
-
else if (
|
|
359
|
-
|
|
360
|
-
else if (
|
|
361
|
-
|
|
362
|
-
else if (
|
|
363
|
-
|
|
364
|
-
else if (
|
|
365
|
-
const
|
|
366
|
-
|
|
278
|
+
[J, R, E, g, r]
|
|
279
|
+
), Ji = n.useCallback(() => {
|
|
280
|
+
if (u === "week")
|
|
281
|
+
I?.(P), N?.(P);
|
|
282
|
+
else if (u === "month")
|
|
283
|
+
j?.(z), N?.(z);
|
|
284
|
+
else if (u === "quarter")
|
|
285
|
+
C?.(G), N?.(G);
|
|
286
|
+
else if (u === "year")
|
|
287
|
+
Y?.(H), N?.(H);
|
|
288
|
+
else if (h(f)) {
|
|
289
|
+
const i = f[f.length - 1];
|
|
290
|
+
g?.(i), X?.(f), R(f), N?.(f);
|
|
367
291
|
} else
|
|
368
|
-
|
|
292
|
+
g?.(Ii(f)), R(f), N?.(f);
|
|
369
293
|
}, [
|
|
370
|
-
|
|
371
|
-
|
|
294
|
+
f,
|
|
295
|
+
P,
|
|
296
|
+
z,
|
|
372
297
|
G,
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
298
|
+
H,
|
|
299
|
+
g,
|
|
300
|
+
I,
|
|
376
301
|
j,
|
|
377
|
-
|
|
378
|
-
y,
|
|
379
|
-
B,
|
|
302
|
+
C,
|
|
380
303
|
Y,
|
|
304
|
+
N,
|
|
381
305
|
X,
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
]),
|
|
385
|
-
|
|
386
|
-
}, [
|
|
387
|
-
|
|
306
|
+
R,
|
|
307
|
+
u
|
|
308
|
+
]), Li = n.useCallback(() => {
|
|
309
|
+
u === "week" ? Z(A) : u === "month" ? k($) : u === "quarter" ? Q(_) : u === "year" ? o(q) : U(s), mi?.();
|
|
310
|
+
}, [s, A, $, _, q, mi, u]), Oi = n.useCallback(() => {
|
|
311
|
+
u === "week" ? (Z(void 0), r || I?.(void 0)) : u === "month" ? (k(void 0), r || j?.(void 0)) : u === "quarter" ? (Q(void 0), r || C?.(void 0)) : u === "year" ? (o(void 0), r || Y?.(void 0)) : (U(void 0), r || g?.(void 0)), E?.(void 0), ci?.();
|
|
388
312
|
}, [
|
|
389
|
-
|
|
390
|
-
|
|
313
|
+
r,
|
|
314
|
+
g,
|
|
315
|
+
I,
|
|
391
316
|
j,
|
|
392
|
-
q,
|
|
393
|
-
y,
|
|
394
|
-
B,
|
|
395
317
|
C,
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
318
|
+
Y,
|
|
319
|
+
E,
|
|
320
|
+
ci,
|
|
321
|
+
u
|
|
322
|
+
]), M = r ? z : $, xi = r ? G : _, Ui = n.useCallback(
|
|
323
|
+
(i, t) => Ti(i, t, M),
|
|
324
|
+
[M]
|
|
325
|
+
), Vi = n.useCallback(
|
|
326
|
+
(i, t) => pi(i, t, M),
|
|
327
|
+
[M]
|
|
328
|
+
), Xi = n.useCallback(
|
|
329
|
+
(i, t) => Fi(i, t, B),
|
|
330
|
+
[B]
|
|
331
|
+
), Zi = n.useCallback(
|
|
332
|
+
(i, t) => ft(i, t, xi),
|
|
333
|
+
[xi]
|
|
334
|
+
), ki = n.useCallback(
|
|
335
|
+
(i, t) => lt(i, t, B, {
|
|
336
|
+
calendarKind: v,
|
|
337
|
+
fiscalConfig: l
|
|
414
338
|
}),
|
|
415
|
-
[
|
|
416
|
-
),
|
|
417
|
-
(
|
|
418
|
-
[
|
|
419
|
-
),
|
|
420
|
-
(
|
|
421
|
-
calendarKind:
|
|
422
|
-
fiscalConfig:
|
|
339
|
+
[v, B, l]
|
|
340
|
+
), Pi = r ? H : q, Qi = n.useCallback(
|
|
341
|
+
(i) => mt(i, Pi),
|
|
342
|
+
[Pi]
|
|
343
|
+
), oi = n.useCallback(
|
|
344
|
+
(i) => ct(i, B, {
|
|
345
|
+
calendarKind: v,
|
|
346
|
+
fiscalConfig: l
|
|
423
347
|
}),
|
|
424
|
-
[
|
|
425
|
-
),
|
|
426
|
-
showFooter:
|
|
427
|
-
pickerType:
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
pendingYearSelection: O
|
|
348
|
+
[v, B, l]
|
|
349
|
+
), Mi = n.useMemo(() => x === "multi-range" && r && !ut(at(f)) ? !0 : Ki({
|
|
350
|
+
showFooter: r,
|
|
351
|
+
pickerType: u,
|
|
352
|
+
disabled: B,
|
|
353
|
+
pendingSelection: Ii(f),
|
|
354
|
+
pendingWeekSelection: P,
|
|
355
|
+
pendingMonthSelection: z,
|
|
356
|
+
pendingQuarterSelection: G,
|
|
357
|
+
pendingYearSelection: H
|
|
435
358
|
}), [
|
|
436
|
-
|
|
359
|
+
r,
|
|
360
|
+
u,
|
|
361
|
+
B,
|
|
437
362
|
f,
|
|
363
|
+
P,
|
|
438
364
|
z,
|
|
439
|
-
A,
|
|
440
|
-
m,
|
|
441
|
-
_,
|
|
442
365
|
G,
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
i
|
|
366
|
+
H,
|
|
367
|
+
x
|
|
446
368
|
]);
|
|
447
369
|
return {
|
|
448
|
-
pendingSelection:
|
|
449
|
-
currentMonth:
|
|
450
|
-
pendingWeekSelection:
|
|
451
|
-
pendingMonthSelection:
|
|
452
|
-
pendingQuarterSelection:
|
|
453
|
-
pendingYearSelection:
|
|
454
|
-
monthPickerYear:
|
|
455
|
-
handleMonthChangeInternal:
|
|
456
|
-
resolveWeekFromInput:
|
|
457
|
-
handleWeekClick:
|
|
458
|
-
handleMonthClick:
|
|
459
|
-
handleQuarterClick:
|
|
460
|
-
handleYearClick:
|
|
461
|
-
handlePresetSelect:
|
|
462
|
-
availableYears:
|
|
463
|
-
selectedDaysFromWeeks:
|
|
464
|
-
selectedDaysFromRanges:
|
|
465
|
-
weekRangeModifiers:
|
|
466
|
-
handleInternalSelect:
|
|
467
|
-
handleApply:
|
|
468
|
-
handleCancel:
|
|
469
|
-
handleClear:
|
|
470
|
-
isMonthSelected:
|
|
471
|
-
getMonthRangeProps:
|
|
472
|
-
isMonthDisabled:
|
|
473
|
-
isQuarterSelected:
|
|
474
|
-
isQuarterDisabled:
|
|
475
|
-
isYearSelected:
|
|
476
|
-
isYearDisabled:
|
|
477
|
-
isApplyDisabledInternal:
|
|
370
|
+
pendingSelection: f,
|
|
371
|
+
currentMonth: Di,
|
|
372
|
+
pendingWeekSelection: P,
|
|
373
|
+
pendingMonthSelection: z,
|
|
374
|
+
pendingQuarterSelection: G,
|
|
375
|
+
pendingYearSelection: H,
|
|
376
|
+
monthPickerYear: _i,
|
|
377
|
+
handleMonthChangeInternal: qi,
|
|
378
|
+
resolveWeekFromInput: T,
|
|
379
|
+
handleWeekClick: p,
|
|
380
|
+
handleMonthClick: Bi,
|
|
381
|
+
handleQuarterClick: Ci,
|
|
382
|
+
handleYearClick: Yi,
|
|
383
|
+
handlePresetSelect: Hi,
|
|
384
|
+
availableYears: Ei,
|
|
385
|
+
selectedDaysFromWeeks: F,
|
|
386
|
+
selectedDaysFromRanges: Ni,
|
|
387
|
+
weekRangeModifiers: zi,
|
|
388
|
+
handleInternalSelect: Gi,
|
|
389
|
+
handleApply: Ji,
|
|
390
|
+
handleCancel: Li,
|
|
391
|
+
handleClear: Oi,
|
|
392
|
+
isMonthSelected: Ui,
|
|
393
|
+
getMonthRangeProps: Vi,
|
|
394
|
+
isMonthDisabled: Xi,
|
|
395
|
+
isQuarterSelected: Zi,
|
|
396
|
+
isQuarterDisabled: ki,
|
|
397
|
+
isYearSelected: Qi,
|
|
398
|
+
isYearDisabled: oi,
|
|
399
|
+
isApplyDisabledInternal: Mi
|
|
478
400
|
};
|
|
479
401
|
}
|
|
480
402
|
export {
|
|
481
|
-
|
|
403
|
+
yt as useCalendarState
|
|
482
404
|
};
|