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,152 +1,151 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
1
|
+
import { jsx as H } from "react/jsx-runtime";
|
|
2
|
+
import * as x from "react";
|
|
3
3
|
import { DayPicker as pr } from "react-day-picker";
|
|
4
|
-
import { cn as
|
|
5
|
-
import { formatPeriodOption as
|
|
4
|
+
import { cn as dr } from "../../../lib/utils.js";
|
|
5
|
+
import { formatPeriodOption as ur } from "./calendar-fiscal-labels.js";
|
|
6
6
|
import { CalendarDayHoverProvider as gr } from "./calendar-day-hover.js";
|
|
7
7
|
import { previewModifierClassNames as vr, fiscalPeriodBoundaryClassNames as Pr } from "./calendar-day-picker-classnames.js";
|
|
8
|
-
import { isPreviewCap as
|
|
8
|
+
import { isPreviewCap as d, dayKey as l, isPreviewMiddle as _r } from "./calendar-selection.js";
|
|
9
9
|
import { useCalendarDayPickerConfig as yr } from "./use-calendar-day-picker-config.js";
|
|
10
10
|
function Br({
|
|
11
|
-
className:
|
|
11
|
+
className: B,
|
|
12
12
|
pickerType: s,
|
|
13
13
|
mode: e,
|
|
14
14
|
weekMode: f,
|
|
15
15
|
calendarKind: m,
|
|
16
|
-
granularity:
|
|
17
|
-
showOutsideDays:
|
|
16
|
+
granularity: E,
|
|
17
|
+
showOutsideDays: u,
|
|
18
18
|
fixedWeeks: g,
|
|
19
|
-
captionLayout:
|
|
20
|
-
buttonVariant:
|
|
19
|
+
captionLayout: F,
|
|
20
|
+
buttonVariant: L,
|
|
21
21
|
weekStartsOn: v,
|
|
22
|
-
formatters:
|
|
23
|
-
classNames:
|
|
24
|
-
components:
|
|
22
|
+
formatters: O,
|
|
23
|
+
classNames: V,
|
|
24
|
+
components: Y,
|
|
25
25
|
selected: P,
|
|
26
26
|
showFooter: _,
|
|
27
27
|
showPeriodBoundaries: p,
|
|
28
28
|
pendingSelection: y,
|
|
29
|
-
selectedDaysFromWeeks:
|
|
29
|
+
selectedDaysFromWeeks: k,
|
|
30
30
|
currentMonth: D,
|
|
31
|
-
monthsFull:
|
|
32
|
-
monthsShort:
|
|
33
|
-
weekNumberHeader:
|
|
34
|
-
resolvedStartMonth:
|
|
35
|
-
resolvedEndMonth:
|
|
36
|
-
availableYears:
|
|
31
|
+
monthsFull: R,
|
|
32
|
+
monthsShort: $,
|
|
33
|
+
weekNumberHeader: q,
|
|
34
|
+
resolvedStartMonth: b,
|
|
35
|
+
resolvedEndMonth: w,
|
|
36
|
+
availableYears: z,
|
|
37
37
|
fiscalPeriods: C,
|
|
38
|
-
fiscalConfig:
|
|
39
|
-
dateFnsLocale:
|
|
40
|
-
intlLocale:
|
|
41
|
-
weekRangeModifiers:
|
|
42
|
-
onSelect:
|
|
38
|
+
fiscalConfig: A,
|
|
39
|
+
dateFnsLocale: G,
|
|
40
|
+
intlLocale: I,
|
|
41
|
+
weekRangeModifiers: J,
|
|
42
|
+
onSelect: M,
|
|
43
43
|
onMonthChange: N,
|
|
44
|
-
onWeekSelect:
|
|
45
|
-
previousMonthLabel:
|
|
46
|
-
nextMonthLabel:
|
|
47
|
-
monthPlaceholder:
|
|
48
|
-
yearPlaceholder:
|
|
44
|
+
onWeekSelect: Q,
|
|
45
|
+
previousMonthLabel: U,
|
|
46
|
+
nextMonthLabel: X,
|
|
47
|
+
monthPlaceholder: Z,
|
|
48
|
+
yearPlaceholder: W,
|
|
49
49
|
weekNumberLabel: S,
|
|
50
|
-
weekLabel:
|
|
51
|
-
fiscalWeekAriaLabel:
|
|
50
|
+
weekLabel: K,
|
|
51
|
+
fiscalWeekAriaLabel: T,
|
|
52
52
|
getCellMeta: n,
|
|
53
|
-
formatWeekNumber:
|
|
54
|
-
disabled:
|
|
55
|
-
showWeekNumber:
|
|
53
|
+
formatWeekNumber: rr,
|
|
54
|
+
disabled: or,
|
|
55
|
+
showWeekNumber: h = !0,
|
|
56
56
|
...tr
|
|
57
57
|
}) {
|
|
58
58
|
const { dayPickerClassNames: ar, dayPickerComponents: ir } = yr({
|
|
59
|
-
buttonVariant:
|
|
59
|
+
buttonVariant: L,
|
|
60
60
|
pickerType: s,
|
|
61
61
|
calendarKind: m,
|
|
62
|
-
granularity:
|
|
63
|
-
showOutsideDays:
|
|
64
|
-
classNames:
|
|
62
|
+
granularity: E,
|
|
63
|
+
showOutsideDays: u,
|
|
64
|
+
classNames: V,
|
|
65
65
|
currentMonth: D,
|
|
66
|
-
monthsFull:
|
|
67
|
-
monthsShort:
|
|
68
|
-
weekNumberHeader:
|
|
69
|
-
resolvedStartMonth:
|
|
70
|
-
resolvedEndMonth:
|
|
71
|
-
availableYears:
|
|
66
|
+
monthsFull: R,
|
|
67
|
+
monthsShort: $,
|
|
68
|
+
weekNumberHeader: q,
|
|
69
|
+
resolvedStartMonth: b,
|
|
70
|
+
resolvedEndMonth: w,
|
|
71
|
+
availableYears: z,
|
|
72
72
|
fiscalPeriods: C,
|
|
73
|
-
fiscalConfig:
|
|
73
|
+
fiscalConfig: A,
|
|
74
74
|
weekStartsOn: v,
|
|
75
|
-
previousMonthLabel:
|
|
76
|
-
nextMonthLabel:
|
|
77
|
-
monthPlaceholder:
|
|
78
|
-
yearPlaceholder:
|
|
75
|
+
previousMonthLabel: U,
|
|
76
|
+
nextMonthLabel: X,
|
|
77
|
+
monthPlaceholder: Z,
|
|
78
|
+
yearPlaceholder: W,
|
|
79
79
|
weekNumberLabel: S,
|
|
80
|
-
weekLabel:
|
|
80
|
+
weekLabel: K,
|
|
81
81
|
fiscalWeekNumberLabel: S,
|
|
82
|
-
fiscalWeekAriaLabel:
|
|
82
|
+
fiscalWeekAriaLabel: T,
|
|
83
83
|
getCellMeta: n,
|
|
84
84
|
onMonthChange: N,
|
|
85
|
-
onWeekSelect:
|
|
85
|
+
onWeekSelect: Q,
|
|
86
86
|
weekMode: f,
|
|
87
87
|
showPeriodBoundaries: p,
|
|
88
|
-
showWeekNumber:
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}), er = e === "range" || e === "multiple" || e === "multi-range" || f === "range" || f === "multiple" || f === "multi-range" ? 2 : 1, nr = s === "week" || e === "multi-range" ? "multiple" : e, sr = g || m === "fiscal" || d, H = p && n ? {
|
|
88
|
+
showWeekNumber: h,
|
|
89
|
+
components: Y
|
|
90
|
+
}), er = e === "range" || e === "multiple" || e === "multi-range" || f === "range" || f === "multiple" || f === "multi-range" ? 2 : 1, nr = s === "week" || e === "multi-range" ? "multiple" : e, sr = g || m === "fiscal" || u, j = p && n ? {
|
|
92
91
|
fiscal_period_start: (r) => !!n(r)?.isPeriodStart,
|
|
93
92
|
fiscal_period_end: (r) => !!n(r)?.isPeriodEnd
|
|
94
|
-
} : void 0, [t, cr] =
|
|
93
|
+
} : void 0, [t, cr] = x.useState(), fr = x.useCallback((r) => {
|
|
95
94
|
cr((o) => !o && !r || o && r && o.getFullYear() === r.getFullYear() && o.getMonth() === r.getMonth() && o.getDate() === r.getDate() ? o : r);
|
|
96
95
|
}, []), a = _ ? y : P, i = e === "range" && a && typeof a == "object" && "from" in a ? a.from : void 0, mr = e === "range" && a && typeof a == "object" && "to" in a ? a.to : void 0;
|
|
97
|
-
return /* @__PURE__ */
|
|
96
|
+
return /* @__PURE__ */ H(gr, { onDayHover: fr, children: /* @__PURE__ */ H(
|
|
98
97
|
pr,
|
|
99
98
|
{
|
|
100
99
|
mode: nr,
|
|
101
|
-
selected: s === "week" ?
|
|
100
|
+
selected: s === "week" ? k : _ ? y : P,
|
|
102
101
|
onSelect: (...r) => {
|
|
103
102
|
const [o, c] = r;
|
|
104
|
-
|
|
103
|
+
M(o, c instanceof Date ? c : void 0);
|
|
105
104
|
},
|
|
106
105
|
month: D,
|
|
107
106
|
onMonthChange: N,
|
|
108
107
|
fixedWeeks: g,
|
|
109
108
|
showOutsideDays: sr,
|
|
110
109
|
weekStartsOn: v,
|
|
111
|
-
modifiers: s === "week" ? { ...
|
|
110
|
+
modifiers: s === "week" ? { ...J, ...j } : { ...j, ...s === "date" && !!(i && !mr && t) && i && t ? {
|
|
112
111
|
preview: (r) => _r(r, i, t),
|
|
113
|
-
preview_cap: (r) =>
|
|
114
|
-
preview_cap_start: (r) =>
|
|
115
|
-
preview_cap_end: (r) =>
|
|
112
|
+
preview_cap: (r) => d(r, i, t),
|
|
113
|
+
preview_cap_start: (r) => d(r, i, t) && l(t) < l(i),
|
|
114
|
+
preview_cap_end: (r) => d(r, i, t) && l(t) > l(i)
|
|
116
115
|
} : void 0 },
|
|
117
116
|
modifiersClassNames: {
|
|
118
117
|
...p && m === "fiscal" ? Pr : void 0,
|
|
119
118
|
...vr
|
|
120
119
|
},
|
|
121
|
-
locale:
|
|
122
|
-
className:
|
|
120
|
+
locale: G,
|
|
121
|
+
className: dr(
|
|
123
122
|
"bg-canvas group/calendar p-2 [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",
|
|
124
123
|
String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
|
|
125
124
|
String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
|
|
126
|
-
|
|
125
|
+
B
|
|
127
126
|
),
|
|
128
|
-
captionLayout:
|
|
127
|
+
captionLayout: F,
|
|
129
128
|
navLayout: "around",
|
|
130
|
-
startMonth:
|
|
131
|
-
endMonth:
|
|
132
|
-
disabled:
|
|
129
|
+
startMonth: b,
|
|
130
|
+
endMonth: w,
|
|
131
|
+
disabled: or,
|
|
133
132
|
numberOfMonths: er,
|
|
134
133
|
formatters: {
|
|
135
134
|
formatMonthDropdown: (r) => {
|
|
136
135
|
if (m === "fiscal" && n) {
|
|
137
136
|
const o = n(r), c = C?.find((lr) => lr.period === o?.fiscalPeriod);
|
|
138
|
-
if (c) return
|
|
137
|
+
if (c) return ur(c);
|
|
139
138
|
if (o?.fiscalPeriod != null) return `P${o.fiscalPeriod}`;
|
|
140
139
|
}
|
|
141
|
-
return r.toLocaleString(
|
|
140
|
+
return r.toLocaleString(I, { month: "short" });
|
|
142
141
|
},
|
|
143
|
-
formatWeekNumber:
|
|
144
|
-
...
|
|
142
|
+
formatWeekNumber: rr,
|
|
143
|
+
...O
|
|
145
144
|
},
|
|
146
145
|
classNames: ar,
|
|
147
146
|
components: ir,
|
|
148
147
|
...tr,
|
|
149
|
-
showWeekNumber:
|
|
148
|
+
showWeekNumber: h
|
|
150
149
|
}
|
|
151
150
|
) });
|
|
152
151
|
}
|
|
@@ -14,9 +14,3 @@ export declare function dominantCivilMonthForPeriod(period: FiscalPeriod): {
|
|
|
14
14
|
export declare function visibleMonthForPeriod(period: FiscalPeriod, isRightPanel: boolean): Date;
|
|
15
15
|
/** Period that occupies the most days of a civil month (caption selected value). */
|
|
16
16
|
export declare function periodForCivilMonth(periods: readonly FiscalPeriod[], year: number, monthIndex: number): FiscalPeriod | undefined;
|
|
17
|
-
export declare function periodsAvailableInBounds(periods: readonly FiscalPeriod[], disabled?: unknown): FiscalPeriod[];
|
|
18
|
-
export declare function periodForFiscalYearChange(options: {
|
|
19
|
-
periods: readonly FiscalPeriod[];
|
|
20
|
-
preferredPeriod?: number;
|
|
21
|
-
disabled?: unknown;
|
|
22
|
-
}): FiscalPeriod | undefined;
|
|
@@ -1,18 +1,17 @@
|
|
|
1
|
-
import { setDate as m, startOfMonth as s, addMonths as
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
function O(t) {
|
|
1
|
+
import { setDate as m, startOfMonth as s, addMonths as h } from "date-fns";
|
|
2
|
+
import { parseCivilDate as d, toCivilDate as l, lastDayOfMonth as y, compareCivil as u, diffDays as v, minCivil as M, maxCivil as p } from "../../../lib/fiscal-calendar/civil-date.js";
|
|
3
|
+
function x(t) {
|
|
5
4
|
return m(s(t), 15);
|
|
6
5
|
}
|
|
7
|
-
function
|
|
8
|
-
return s(
|
|
6
|
+
function b(t, n) {
|
|
7
|
+
return s(h(t, n));
|
|
9
8
|
}
|
|
10
9
|
function c(t, n, o, e) {
|
|
11
|
-
const r =
|
|
12
|
-
return
|
|
10
|
+
const r = l(o, e + 1, 1), a = y(o, e + 1), i = p(t, r), f = M(n, a);
|
|
11
|
+
return u(i, f) > 0 ? 0 : v(f, i) + 1;
|
|
13
12
|
}
|
|
14
|
-
function
|
|
15
|
-
const n =
|
|
13
|
+
function C(t) {
|
|
14
|
+
const n = d(t.start);
|
|
16
15
|
let o = { year: n.y, monthIndex: n.m - 1, days: 0 };
|
|
17
16
|
const e = t.gregorianMonthSpan.length > 0 ? t.gregorianMonthSpan : [{ year: n.y, month: n.m - 1 }];
|
|
18
17
|
for (const { year: r, month: a } of e) {
|
|
@@ -21,11 +20,11 @@ function b(t) {
|
|
|
21
20
|
}
|
|
22
21
|
return { year: o.year, monthIndex: o.monthIndex };
|
|
23
22
|
}
|
|
24
|
-
function
|
|
25
|
-
const { year: o, monthIndex: e } =
|
|
26
|
-
return n ?
|
|
23
|
+
function I(t, n) {
|
|
24
|
+
const { year: o, monthIndex: e } = C(t), r = s(new Date(o, e, 1));
|
|
25
|
+
return n ? h(r, -1) : r;
|
|
27
26
|
}
|
|
28
|
-
function
|
|
27
|
+
function O(t, n, o) {
|
|
29
28
|
let e, r = 0;
|
|
30
29
|
for (const a of t) {
|
|
31
30
|
const i = c(a.start, a.end, n, o);
|
|
@@ -33,25 +32,10 @@ function A(t, n, o) {
|
|
|
33
32
|
}
|
|
34
33
|
return e;
|
|
35
34
|
}
|
|
36
|
-
function g(t, n) {
|
|
37
|
-
return t.filter(
|
|
38
|
-
(o) => !C(
|
|
39
|
-
d(o.start),
|
|
40
|
-
d(o.end),
|
|
41
|
-
n
|
|
42
|
-
)
|
|
43
|
-
);
|
|
44
|
-
}
|
|
45
|
-
function E(t) {
|
|
46
|
-
const n = g(t.periods, t.disabled);
|
|
47
|
-
return n.find((o) => o.period === t.preferredPeriod) ?? n[0];
|
|
48
|
-
}
|
|
49
35
|
export {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
g as periodsAvailableInBounds,
|
|
56
|
-
P as visibleMonthForPeriod
|
|
36
|
+
b as civilMonthAtOffset,
|
|
37
|
+
C as dominantCivilMonthForPeriod,
|
|
38
|
+
x as midMonthDate,
|
|
39
|
+
O as periodForCivilMonth,
|
|
40
|
+
I as visibleMonthForPeriod
|
|
57
41
|
};
|
|
@@ -2,7 +2,7 @@ import { jsxs as f, jsx as l } from "react/jsx-runtime";
|
|
|
2
2
|
import "react";
|
|
3
3
|
import { cn as u } from "../../../lib/utils.js";
|
|
4
4
|
import { Button as d } from "../../primitives/button/button.js";
|
|
5
|
-
import { formatDateRangeFooterSummary as
|
|
5
|
+
import { formatDateRangeFooterSummary as w, formatWeekFooterSummary as z, formatMonthFooterSummary as Y, formatQuarterFooterSummary as G, formatYearFooterSummary as I } from "./calendar-footer-summary.js";
|
|
6
6
|
const h = "relative isolate overflow-hidden animate-flash-highlight motion-reduce:animate-none", $ = {
|
|
7
7
|
"--flash-overlay": "color-mix(in srgb, white 55%, transparent)"
|
|
8
8
|
};
|
|
@@ -13,7 +13,7 @@ function a({
|
|
|
13
13
|
return /* @__PURE__ */ f(
|
|
14
14
|
"div",
|
|
15
15
|
{
|
|
16
|
-
className: "flex
|
|
16
|
+
className: "flex flex-row items-center gap-1 text-xs font-medium leading-[18px] text-content-tertiary",
|
|
17
17
|
"aria-live": "polite",
|
|
18
18
|
"aria-atomic": "true",
|
|
19
19
|
children: [
|
|
@@ -28,7 +28,7 @@ function O({
|
|
|
28
28
|
mode: n,
|
|
29
29
|
weekMode: i,
|
|
30
30
|
monthMode: r,
|
|
31
|
-
yearMode:
|
|
31
|
+
yearMode: s = "single",
|
|
32
32
|
calendarKind: S,
|
|
33
33
|
granularity: v,
|
|
34
34
|
resolvedFiscalPattern: B,
|
|
@@ -39,26 +39,26 @@ function O({
|
|
|
39
39
|
pendingQuarterSelection: N,
|
|
40
40
|
pendingYearSelection: P,
|
|
41
41
|
multiRangeSummary: g,
|
|
42
|
-
disableApply:
|
|
43
|
-
isApplyDisabled:
|
|
42
|
+
disableApply: C,
|
|
43
|
+
isApplyDisabled: H,
|
|
44
44
|
footerFlashKey: c = 0,
|
|
45
45
|
footerFlashTarget: p,
|
|
46
46
|
labels: e,
|
|
47
|
-
onClear:
|
|
48
|
-
onCancel:
|
|
49
|
-
onApply:
|
|
47
|
+
onClear: j,
|
|
48
|
+
onCancel: q,
|
|
49
|
+
onApply: A
|
|
50
50
|
}) {
|
|
51
|
-
const
|
|
51
|
+
const _ = t === "month" && r !== "single" || t === "quarter" && r !== "single" || t === "year" && s !== "single" || n === "range" || n === "multi-range" || i === "range" || i === "multiple", m = c > 0 && p === "cancel", o = c > 0 && p === "apply";
|
|
52
52
|
return /* @__PURE__ */ f(
|
|
53
53
|
"div",
|
|
54
54
|
{
|
|
55
55
|
className: u(
|
|
56
|
-
"flex
|
|
57
|
-
|
|
56
|
+
"flex items-center gap-2 border-t p-3 pt-3",
|
|
57
|
+
_ ? "justify-between" : "justify-end"
|
|
58
58
|
),
|
|
59
59
|
children: [
|
|
60
60
|
n === "multi-range" && g ? /* @__PURE__ */ l(a, { selectedLabel: e.selected, children: g }) : null,
|
|
61
|
-
n === "range" && t === "date" ? /* @__PURE__ */ l(a, { selectedLabel: e.selected, children:
|
|
61
|
+
n === "range" && t === "date" ? /* @__PURE__ */ l(a, { selectedLabel: e.selected, children: w(L) }) : null,
|
|
62
62
|
t === "week" && (i === "range" || i === "multiple") ? /* @__PURE__ */ l(a, { selectedLabel: e.selected, children: z({
|
|
63
63
|
selection: y,
|
|
64
64
|
calendarKind: S,
|
|
@@ -73,23 +73,23 @@ function O({
|
|
|
73
73
|
single: e.quarterSingle,
|
|
74
74
|
plural: e.quarterPlural
|
|
75
75
|
}) }) : null,
|
|
76
|
-
t === "year" && (
|
|
76
|
+
t === "year" && (s === "range" || s === "multiple") ? /* @__PURE__ */ l(a, { selectedLabel: e.selected, children: I(P, {
|
|
77
77
|
single: e.yearSingle,
|
|
78
78
|
plural: e.yearPlural
|
|
79
79
|
}) }) : null,
|
|
80
|
-
/* @__PURE__ */ f("div", { className: "flex
|
|
81
|
-
/* @__PURE__ */ l(d, { variant: "link", size: "md", onClick:
|
|
80
|
+
/* @__PURE__ */ f("div", { className: "flex items-center gap-2", children: [
|
|
81
|
+
/* @__PURE__ */ l(d, { variant: "link", size: "md", onClick: j, children: e.clear }),
|
|
82
82
|
/* @__PURE__ */ l(
|
|
83
83
|
d,
|
|
84
84
|
{
|
|
85
85
|
variant: "outline",
|
|
86
86
|
size: "md",
|
|
87
|
-
"data-footer-flash":
|
|
88
|
-
className: u(
|
|
89
|
-
onClick:
|
|
87
|
+
"data-footer-flash": m ? "cancel" : void 0,
|
|
88
|
+
className: u(m && h),
|
|
89
|
+
onClick: q,
|
|
90
90
|
children: e.cancel
|
|
91
91
|
},
|
|
92
|
-
|
|
92
|
+
m ? `footer-cancel-${c}` : "footer-cancel"
|
|
93
93
|
),
|
|
94
94
|
/* @__PURE__ */ l(
|
|
95
95
|
d,
|
|
@@ -99,8 +99,8 @@ function O({
|
|
|
99
99
|
"data-footer-flash": o ? "apply" : void 0,
|
|
100
100
|
style: o ? $ : void 0,
|
|
101
101
|
className: u(o && h),
|
|
102
|
-
onClick:
|
|
103
|
-
disabled:
|
|
102
|
+
onClick: A,
|
|
103
|
+
disabled: C || H,
|
|
104
104
|
children: e.apply
|
|
105
105
|
},
|
|
106
106
|
o ? `footer-apply-${c}` : "footer-apply"
|
|
@@ -1,57 +1,56 @@
|
|
|
1
1
|
import { jsxs as d, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { ChevronRight as
|
|
3
|
-
import { cn as
|
|
4
|
-
import { Button as
|
|
5
|
-
import { Select as
|
|
6
|
-
import { isMonthRangeSelection as
|
|
7
|
-
import { CalendarPeriodCell as
|
|
8
|
-
import { PERIOD_RANGE_GRID_CLASSNAME as F } from "./calendar-selection-appearance.js";
|
|
2
|
+
import { ChevronRight as g } from "impact-nova-icons";
|
|
3
|
+
import { cn as A } from "../../../lib/utils.js";
|
|
4
|
+
import { Button as f } from "../../primitives/button/button.js";
|
|
5
|
+
import { Select as D } from "../../forms/select/select.js";
|
|
6
|
+
import { isMonthRangeSelection as F } from "../../forms/date-picker/calendar-selection-adapters.js";
|
|
7
|
+
import { CalendarPeriodCell as G } from "./calendar-period-cell.js";
|
|
9
8
|
function Z({
|
|
10
|
-
yearOffset:
|
|
9
|
+
yearOffset: o = 0,
|
|
11
10
|
displayYear: e,
|
|
12
11
|
monthMode: s,
|
|
13
12
|
monthsShort: u,
|
|
14
|
-
showFooter:
|
|
13
|
+
showFooter: p,
|
|
15
14
|
pendingMonthSelection: v,
|
|
16
|
-
selectedMonths:
|
|
17
|
-
resolvedStartYear:
|
|
18
|
-
resolvedEndYear:
|
|
15
|
+
selectedMonths: N,
|
|
16
|
+
resolvedStartYear: x,
|
|
17
|
+
resolvedEndYear: C,
|
|
19
18
|
yearOptions: l,
|
|
20
|
-
previousYearLabel:
|
|
21
|
-
nextYearLabel:
|
|
22
|
-
isMonthSelected:
|
|
23
|
-
getMonthRangeProps:
|
|
24
|
-
isMonthDisabled:
|
|
25
|
-
onPreviousYear:
|
|
26
|
-
onNextYear:
|
|
27
|
-
onYearSelect:
|
|
28
|
-
onMonthClick:
|
|
19
|
+
previousYearLabel: a,
|
|
20
|
+
nextYearLabel: r,
|
|
21
|
+
isMonthSelected: S,
|
|
22
|
+
getMonthRangeProps: k,
|
|
23
|
+
isMonthDisabled: w,
|
|
24
|
+
onPreviousYear: j,
|
|
25
|
+
onNextYear: z,
|
|
26
|
+
onYearSelect: b,
|
|
27
|
+
onMonthClick: R,
|
|
29
28
|
periodLabels: i
|
|
30
29
|
}) {
|
|
31
30
|
return /* @__PURE__ */ d("div", { className: "flex flex-col gap-4 p-3 min-w-[280px]", children: [
|
|
32
31
|
/* @__PURE__ */ d("div", { className: "flex items-center justify-between", children: [
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
o === 0 ? /* @__PURE__ */ t(
|
|
33
|
+
f,
|
|
35
34
|
{
|
|
36
35
|
variant: "ghost",
|
|
37
36
|
size: "icon",
|
|
38
37
|
className: "h-7 w-7 shrink-0",
|
|
39
|
-
"aria-label":
|
|
40
|
-
title:
|
|
41
|
-
disabled: e <=
|
|
42
|
-
onClick: () =>
|
|
43
|
-
children: /* @__PURE__ */ t(
|
|
38
|
+
"aria-label": a,
|
|
39
|
+
title: a,
|
|
40
|
+
disabled: e <= x,
|
|
41
|
+
onClick: () => j(e),
|
|
42
|
+
children: /* @__PURE__ */ t(g, { size: 16, className: "rotate-180" })
|
|
44
43
|
}
|
|
45
44
|
) : /* @__PURE__ */ t("span", { className: "size-7 shrink-0", "aria-hidden": !0 }),
|
|
46
45
|
/* @__PURE__ */ t("div", { className: "flex flex-1 items-center justify-center", children: /* @__PURE__ */ t(
|
|
47
|
-
|
|
46
|
+
D,
|
|
48
47
|
{
|
|
49
48
|
value: l.find((n) => n.value === e.toString()) ?? {
|
|
50
49
|
label: e.toString(),
|
|
51
50
|
value: e.toString()
|
|
52
51
|
},
|
|
53
52
|
onChange: (n) => {
|
|
54
|
-
n && "value" in n &&
|
|
53
|
+
n && "value" in n && b(parseInt(n.value), o);
|
|
55
54
|
},
|
|
56
55
|
scrollToSelectedOnOpen: !0,
|
|
57
56
|
options: l,
|
|
@@ -60,17 +59,17 @@ function Z({
|
|
|
60
59
|
menuWidth: "140px"
|
|
61
60
|
}
|
|
62
61
|
) }),
|
|
63
|
-
(s === "single" ||
|
|
64
|
-
|
|
62
|
+
(s === "single" || o === 1) && /* @__PURE__ */ t(
|
|
63
|
+
f,
|
|
65
64
|
{
|
|
66
65
|
variant: "ghost",
|
|
67
66
|
size: "icon",
|
|
68
67
|
className: "h-7 w-7",
|
|
69
|
-
"aria-label":
|
|
70
|
-
title:
|
|
71
|
-
disabled: e >=
|
|
72
|
-
onClick: () =>
|
|
73
|
-
children: /* @__PURE__ */ t(
|
|
68
|
+
"aria-label": r,
|
|
69
|
+
title: r,
|
|
70
|
+
disabled: e >= C,
|
|
71
|
+
onClick: () => z(e),
|
|
72
|
+
children: /* @__PURE__ */ t(g, { className: "h-4 w-4" })
|
|
74
73
|
}
|
|
75
74
|
)
|
|
76
75
|
] }),
|
|
@@ -78,23 +77,23 @@ function Z({
|
|
|
78
77
|
"div",
|
|
79
78
|
{
|
|
80
79
|
"data-period-grid": "",
|
|
81
|
-
className:
|
|
82
|
-
children: (i ?? u.map((n) => ({ label: n }))).map((n,
|
|
83
|
-
const m = n.label,
|
|
80
|
+
className: A("grid gap-x-0 gap-y-4", i ? "grid-cols-3" : "grid-cols-4"),
|
|
81
|
+
children: (i ?? u.map((n) => ({ label: n }))).map((n, c) => {
|
|
82
|
+
const m = n.label, P = S(e, c), { isStart: E, isEnd: M, isMiddle: T } = k(e, c), B = s === "range", h = p ? v : N, I = F(h) && !!h.to, W = w(e, c), q = "caption" in n && typeof n.caption == "string" ? n.caption : void 0;
|
|
84
83
|
return /* @__PURE__ */ t(
|
|
85
|
-
|
|
84
|
+
G,
|
|
86
85
|
{
|
|
87
|
-
selected:
|
|
88
|
-
disabled:
|
|
89
|
-
isRange:
|
|
90
|
-
isStart:
|
|
91
|
-
isEnd:
|
|
92
|
-
isMiddle:
|
|
93
|
-
hasRangeEnd:
|
|
86
|
+
selected: P,
|
|
87
|
+
disabled: W,
|
|
88
|
+
isRange: B,
|
|
89
|
+
isStart: E,
|
|
90
|
+
isEnd: M,
|
|
91
|
+
isMiddle: T,
|
|
92
|
+
hasRangeEnd: I,
|
|
94
93
|
size: i ? "period" : "month",
|
|
95
94
|
columns: i ? 3 : 4,
|
|
96
|
-
onClick: () =>
|
|
97
|
-
caption:
|
|
95
|
+
onClick: () => R(e, c),
|
|
96
|
+
caption: q,
|
|
98
97
|
children: m
|
|
99
98
|
},
|
|
100
99
|
m
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Option } from '../../forms/select';
|
|
2
|
-
import { Granularity } from '../../../lib/fiscal-calendar';
|
|
3
2
|
import { MonthRange, MonthSelection } from './calendar.types';
|
|
4
3
|
export declare function isSameMonth(m1: MonthSelection, m2: MonthSelection): boolean;
|
|
5
4
|
export declare function nextMonthSelection(selection: MonthSelection, prev: MonthSelection | MonthSelection[] | MonthRange | undefined, monthMode: "single" | "multiple" | "range"): MonthSelection | MonthSelection[] | MonthRange | undefined;
|
|
@@ -11,10 +10,6 @@ export declare function getMonthRangeProps(year: number, month: number, currentS
|
|
|
11
10
|
};
|
|
12
11
|
/** True when the interval lies completely outside `disabled.before` / `disabled.after`. */
|
|
13
12
|
export declare function isDateIntervalDisabled(start: Date, end: Date, disabled?: unknown): boolean;
|
|
14
|
-
/** True when every day of `[start, end]` is inside `disabled.before` / `disabled.after`. */
|
|
15
|
-
export declare function isWeekFullyInsideBounds(start: Date, end: Date, disabled?: unknown): boolean;
|
|
16
|
-
/** Week granularity requires every day in bounds; other granularities allow mixed weeks. */
|
|
17
|
-
export declare function isWeekSelectableInBounds(start: Date, end: Date, disabled?: unknown, granularity?: Granularity): boolean;
|
|
18
13
|
export declare function isMonthDisabled(year: number, monthIndex: number, disabled?: unknown): boolean;
|
|
19
14
|
export declare function getAvailableYears(startMonth: Date, endMonth: Date): Option[];
|
|
20
15
|
export declare function getAvailableMonths(year: number, monthsFull: string[], startMonth: Date, endMonth: Date): Option[];
|