impact-nova 2.5.7 → 2.5.9
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/ag-grid-react/ag-grid.types.d.ts +2 -2
- package/dist/components/data/ag-grid-react/headers/components/date-filter-picker.d.ts +4 -2
- package/dist/components/data/ag-grid-react/headers/header-search-input.js +65 -65
- package/dist/components/data/ag-grid-react/headers/utils/date-utils.js +55 -48
- package/dist/components/data-display/calendar/calendar-apply-validation.d.ts +4 -2
- package/dist/components/data-display/calendar/calendar-apply-validation.js +80 -61
- package/dist/components/data-display/calendar/calendar-config.d.ts +13 -5
- package/dist/components/data-display/calendar/calendar-config.js +31 -20
- package/dist/components/data-display/calendar/calendar-day-button.js +43 -35
- package/dist/components/data-display/calendar/calendar-day-hover.d.ts +8 -0
- package/dist/components/data-display/calendar/calendar-day-hover.js +20 -0
- package/dist/components/data-display/calendar/calendar-day-picker-classnames.d.ts +8 -1
- package/dist/components/data-display/calendar/calendar-day-picker-classnames.js +40 -20
- package/dist/components/data-display/calendar/calendar-day-picker-components.d.ts +12 -1
- package/dist/components/data-display/calendar/calendar-day-picker-components.js +196 -102
- package/dist/components/data-display/calendar/calendar-day-picker-view.d.ts +11 -3
- package/dist/components/data-display/calendar/calendar-day-picker-view.js +136 -92
- package/dist/components/data-display/calendar/calendar-fiscal-labels.d.ts +38 -0
- package/dist/components/data-display/calendar/calendar-fiscal-labels.js +90 -0
- package/dist/components/data-display/calendar/calendar-fiscal-period-nav.d.ts +16 -0
- package/dist/components/data-display/calendar/calendar-fiscal-period-nav.js +41 -0
- package/dist/components/data-display/calendar/calendar-footer-summary.d.ts +13 -4
- package/dist/components/data-display/calendar/calendar-footer-summary.js +101 -50
- package/dist/components/data-display/calendar/calendar-footer.d.ts +16 -7
- package/dist/components/data-display/calendar/calendar-footer.js +88 -66
- package/dist/components/data-display/calendar/calendar-gregorian-presets.d.ts +2 -0
- package/dist/components/data-display/calendar/calendar-gregorian-presets.js +26 -0
- package/dist/components/data-display/calendar/calendar-interval-caption.d.ts +1 -0
- package/dist/components/data-display/calendar/calendar-interval-caption.js +10 -0
- package/dist/components/data-display/calendar/calendar-interval-utils.d.ts +23 -0
- package/dist/components/data-display/calendar/calendar-interval-utils.js +154 -0
- package/dist/components/data-display/calendar/calendar-month-panes.d.ts +5 -1
- package/dist/components/data-display/calendar/calendar-month-panes.js +9 -7
- package/dist/components/data-display/calendar/calendar-month-picker-panel.d.ts +5 -1
- package/dist/components/data-display/calendar/calendar-month-picker-panel.js +76 -77
- package/dist/components/data-display/calendar/calendar-month-utils.d.ts +2 -0
- package/dist/components/data-display/calendar/calendar-month-utils.js +69 -60
- package/dist/components/data-display/calendar/calendar-padding-week.utils.d.ts +15 -0
- package/dist/components/data-display/calendar/calendar-padding-week.utils.js +22 -3
- package/dist/components/data-display/calendar/calendar-panel-context.d.ts +1 -1
- package/dist/components/data-display/calendar/calendar-period-cell.d.ts +18 -0
- package/dist/components/data-display/calendar/calendar-period-cell.js +89 -0
- package/dist/components/data-display/calendar/calendar-period-keyboard.d.ts +2 -0
- package/dist/components/data-display/calendar/calendar-period-keyboard.js +18 -0
- package/dist/components/data-display/calendar/calendar-preset-strip.d.ts +6 -0
- package/dist/components/data-display/calendar/calendar-preset-strip.js +26 -0
- package/dist/components/data-display/calendar/calendar-quarter-panes.d.ts +24 -0
- package/dist/components/data-display/calendar/calendar-quarter-panes.js +115 -0
- package/dist/components/data-display/calendar/calendar-quarter-utils.d.ts +19 -0
- package/dist/components/data-display/calendar/calendar-quarter-utils.js +95 -0
- package/dist/components/data-display/calendar/calendar-selection-appearance.d.ts +38 -0
- package/dist/components/data-display/calendar/calendar-selection-appearance.js +72 -0
- package/dist/components/data-display/calendar/calendar-selection.d.ts +20 -0
- package/dist/components/data-display/calendar/calendar-selection.js +31 -0
- package/dist/components/data-display/calendar/calendar-week-number-cell.d.ts +6 -1
- package/dist/components/data-display/calendar/calendar-week-number-cell.js +53 -38
- package/dist/components/data-display/calendar/calendar-week-number-header.d.ts +4 -0
- package/dist/components/data-display/calendar/calendar-week-number-header.js +15 -0
- package/dist/components/data-display/calendar/calendar-week-utils.d.ts +11 -3
- package/dist/components/data-display/calendar/calendar-week-utils.js +49 -42
- package/dist/components/data-display/calendar/calendar-year-panes.d.ts +18 -0
- package/dist/components/data-display/calendar/calendar-year-panes.js +98 -0
- package/dist/components/data-display/calendar/calendar-year-utils.d.ts +17 -0
- package/dist/components/data-display/calendar/calendar-year-utils.js +75 -0
- package/dist/components/data-display/calendar/calendar.d.ts +1 -1
- package/dist/components/data-display/calendar/calendar.js +303 -181
- package/dist/components/data-display/calendar/calendar.types.d.ts +53 -16
- package/dist/components/data-display/calendar/fiscal-period-caption-select.d.ts +7 -0
- package/dist/components/data-display/calendar/fiscal-period-caption-select.js +63 -0
- package/dist/components/data-display/calendar/index.d.ts +1 -1
- package/dist/components/data-display/calendar/use-calendar-day-picker-config.d.ts +12 -2
- package/dist/components/data-display/calendar/use-calendar-day-picker-config.js +92 -62
- package/dist/components/data-display/calendar/use-calendar-state.d.ts +31 -11
- package/dist/components/data-display/calendar/use-calendar-state.js +370 -163
- package/dist/components/data-display/calendar/use-fiscal-calendar.d.ts +5 -0
- package/dist/components/data-display/calendar/use-fiscal-calendar.js +25 -0
- package/dist/components/feedback/tooltip/overflow-tooltip.js +57 -57
- package/dist/components/forms/date-picker/date-input-behavior.d.ts +7 -0
- package/dist/components/forms/date-picker/date-input-behavior.js +28 -24
- package/dist/components/forms/date-picker/date-picker-shell.d.ts +13 -0
- package/dist/components/forms/date-picker/date-picker-shell.js +31 -0
- package/dist/components/forms/date-picker/date-picker.js +187 -167
- package/dist/components/forms/date-picker/date-picker.types.d.ts +90 -43
- package/dist/components/forms/date-picker/date-range-picker.js +273 -224
- package/dist/components/forms/date-picker/fiscal-pass-through.d.ts +13 -0
- package/dist/components/forms/date-picker/fiscal-pass-through.js +17 -0
- package/dist/components/forms/date-picker/fiscal-period-format.d.ts +9 -0
- package/dist/components/forms/date-picker/fiscal-period-format.js +50 -0
- package/dist/components/forms/date-picker/index.d.ts +12 -0
- package/dist/components/forms/date-picker/index.js +19 -7
- package/dist/components/forms/date-picker/month-picker.js +225 -182
- package/dist/components/forms/date-picker/month-range-picker.js +134 -110
- package/dist/components/forms/date-picker/multi-date-picker.js +77 -56
- package/dist/components/forms/date-picker/multi-month-picker.js +78 -57
- package/dist/components/forms/date-picker/multi-quarter-picker.d.ts +3 -0
- package/dist/components/forms/date-picker/multi-quarter-picker.js +177 -0
- package/dist/components/forms/date-picker/multi-week-picker.js +81 -70
- package/dist/components/forms/date-picker/multi-year-picker.d.ts +3 -0
- package/dist/components/forms/date-picker/multi-year-picker.js +179 -0
- package/dist/components/forms/date-picker/quarter-picker.d.ts +3 -0
- package/dist/components/forms/date-picker/quarter-picker.js +176 -0
- package/dist/components/forms/date-picker/quarter-range-picker.d.ts +3 -0
- package/dist/components/forms/date-picker/quarter-range-picker.js +177 -0
- package/dist/components/forms/date-picker/week-picker.js +148 -137
- package/dist/components/forms/date-picker/week-range-picker.js +216 -205
- package/dist/components/forms/date-picker/year-picker.d.ts +3 -0
- package/dist/components/forms/date-picker/year-picker.js +176 -0
- package/dist/components/forms/date-picker/year-range-picker.d.ts +3 -0
- package/dist/components/forms/date-picker/year-range-picker.js +179 -0
- package/dist/components/forms/smart-input/smart-input.js +106 -85
- package/dist/components/forms/smart-input/smart-input.types.d.ts +5 -0
- package/dist/components/forms/textarea/textarea.js +29 -28
- package/dist/components/forms/textarea/textarea.types.d.ts +1 -0
- package/dist/form-react/Fields/DateInputField.js +63 -58
- package/dist/form-react/Fields/DateRangeField.js +42 -37
- package/dist/form-react/Fields/MonthRangeField.js +50 -45
- package/dist/form-react/Fields/MultiWeekPickerField.js +7 -7
- package/dist/form-react/Fields/TextField.js +25 -24
- package/dist/form-react/Fields/WeekRangePicker.js +44 -45
- package/dist/form-react/components/FieldRenderer.js +21 -23
- package/dist/form-react/registry/defaultFieldRegistrations.d.ts +9 -1
- package/dist/form-react/registry/defaultFieldRegistrations.js +27 -36
- package/dist/form-react/registry/resolveFieldComponent.d.ts +3 -2
- package/dist/form-react/registry/resolveFieldComponent.js +9 -133
- package/dist/form-react/types/fields.types.d.ts +25 -4
- package/dist/form-react/utils/date.utils.d.ts +1 -1
- package/dist/form-react/utils/date.utils.js +38 -38
- package/dist/i18n/defaultMessages.d.ts +19 -1
- package/dist/i18n/defaultMessages.js +37 -20
- package/dist/i18n/locales/de.js +18 -1
- package/dist/i18n/locales/es.js +18 -1
- package/dist/i18n/locales/hi.js +18 -1
- package/dist/i18n/locales/kn.js +18 -1
- package/dist/impact-nova-components.css +379 -3
- package/dist/impact-nova.css +1 -1
- package/dist/index.js +528 -516
- package/dist/lib/fiscal-calendar/build-year.d.ts +8 -0
- package/dist/lib/fiscal-calendar/build-year.js +173 -0
- package/dist/lib/fiscal-calendar/civil-date.d.ts +21 -0
- package/dist/lib/fiscal-calendar/civil-date.js +94 -0
- package/dist/lib/fiscal-calendar/index.d.ts +10 -0
- package/dist/lib/fiscal-calendar/index.js +40 -0
- package/dist/lib/fiscal-calendar/lookup.d.ts +4 -0
- package/dist/lib/fiscal-calendar/lookup.js +70 -0
- package/dist/lib/fiscal-calendar/presets.d.ts +8 -0
- package/dist/lib/fiscal-calendar/presets.js +99 -0
- package/dist/lib/fiscal-calendar/selection.d.ts +18 -0
- package/dist/lib/fiscal-calendar/selection.js +32 -0
- package/dist/lib/fiscal-calendar/types.d.ts +145 -0
- package/dist/lib/fiscal-calendar/types.js +10 -0
- package/dist/lib/fiscal-calendar/week-selection.d.ts +22 -0
- package/dist/lib/fiscal-calendar/week-selection.js +107 -0
- package/dist/llms/rules/best-practices.js +1 -1
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/real-world-patterns.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/package.json +5 -1
- package/dist/lib/fiscal-calendar.d.ts +0 -62
- package/dist/lib/fiscal-calendar.js +0 -99
|
@@ -1,77 +1,96 @@
|
|
|
1
|
-
import { isMonthDisabled as
|
|
2
|
-
function u(
|
|
3
|
-
return new Date(
|
|
1
|
+
import { isMonthDisabled as S, isDateIntervalDisabled as b } from "./calendar-month-utils.js";
|
|
2
|
+
function u(e) {
|
|
3
|
+
return new Date(e.getFullYear(), e.getMonth(), e.getDate());
|
|
4
4
|
}
|
|
5
|
-
function
|
|
6
|
-
const
|
|
7
|
-
if (
|
|
8
|
-
const
|
|
9
|
-
if (
|
|
5
|
+
function c(e, i, t) {
|
|
6
|
+
const f = u(e);
|
|
7
|
+
if (i) {
|
|
8
|
+
const o = u(i);
|
|
9
|
+
if (f < o) return !0;
|
|
10
10
|
}
|
|
11
|
-
if (
|
|
12
|
-
const
|
|
13
|
-
if (
|
|
11
|
+
if (t) {
|
|
12
|
+
const o = u(t);
|
|
13
|
+
if (f > o) return !0;
|
|
14
14
|
}
|
|
15
15
|
return !1;
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
const
|
|
19
|
-
return !!(
|
|
17
|
+
function O(e, i, t, f) {
|
|
18
|
+
const o = u(e), g = u(i);
|
|
19
|
+
return !!(t && g < u(t) || f && o > u(f));
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function p(e, i, t) {
|
|
22
|
+
return !e || !i ? !1 : b(e, i, t);
|
|
23
|
+
}
|
|
24
|
+
function d(e, i) {
|
|
25
|
+
if (Array.isArray(e)) return e.some(i);
|
|
26
|
+
if (typeof e == "object" && e !== null && "from" in e) {
|
|
27
|
+
const t = e;
|
|
28
|
+
return !!(t.from && i(t.from) || t.to && i(t.to));
|
|
29
|
+
}
|
|
30
|
+
return i(e);
|
|
31
|
+
}
|
|
32
|
+
function v(e) {
|
|
22
33
|
const {
|
|
23
|
-
showFooter:
|
|
24
|
-
pickerType:
|
|
25
|
-
disabled:
|
|
26
|
-
pendingSelection:
|
|
27
|
-
pendingWeekSelection:
|
|
28
|
-
pendingMonthSelection: y
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
34
|
+
showFooter: i,
|
|
35
|
+
pickerType: t,
|
|
36
|
+
disabled: f,
|
|
37
|
+
pendingSelection: o,
|
|
38
|
+
pendingWeekSelection: g,
|
|
39
|
+
pendingMonthSelection: y,
|
|
40
|
+
pendingQuarterSelection: D,
|
|
41
|
+
pendingYearSelection: m
|
|
42
|
+
} = e;
|
|
43
|
+
if (!i) return !1;
|
|
44
|
+
const a = f;
|
|
32
45
|
if (!a || typeof a != "object" || !("before" in a) && !("after" in a)) return !1;
|
|
33
|
-
const
|
|
34
|
-
if (
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const t = e;
|
|
41
|
-
return !!(t.from && r(t.from) || t.to && r(t.to));
|
|
42
|
-
}
|
|
43
|
-
return r(e);
|
|
46
|
+
const s = a.before, l = a.after;
|
|
47
|
+
if (t === "month") {
|
|
48
|
+
const r = y;
|
|
49
|
+
return r ? d(
|
|
50
|
+
r,
|
|
51
|
+
(n) => S(n.year, n.month, f)
|
|
52
|
+
) : !1;
|
|
44
53
|
}
|
|
45
|
-
if (
|
|
46
|
-
const
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
54
|
+
if (t === "quarter") {
|
|
55
|
+
const r = D;
|
|
56
|
+
return r ? d(
|
|
57
|
+
r,
|
|
58
|
+
(n) => p(n.start, n.end, f)
|
|
59
|
+
) : !1;
|
|
60
|
+
}
|
|
61
|
+
if (t === "year") {
|
|
62
|
+
const r = m;
|
|
63
|
+
return r ? d(
|
|
64
|
+
r,
|
|
65
|
+
(n) => p(n.start, n.end, f)
|
|
66
|
+
) : !1;
|
|
67
|
+
}
|
|
68
|
+
if (t === "week") {
|
|
69
|
+
const r = g;
|
|
70
|
+
return r ? d(
|
|
71
|
+
r,
|
|
72
|
+
(n) => O(
|
|
73
|
+
n.startDate,
|
|
74
|
+
n.endDate,
|
|
75
|
+
s,
|
|
76
|
+
l
|
|
77
|
+
)
|
|
78
|
+
) : !1;
|
|
60
79
|
}
|
|
61
|
-
if (
|
|
62
|
-
const
|
|
63
|
-
if (!
|
|
64
|
-
if (Array.isArray(
|
|
65
|
-
return
|
|
66
|
-
if (
|
|
67
|
-
return
|
|
68
|
-
if ("from" in
|
|
69
|
-
const
|
|
70
|
-
if (
|
|
80
|
+
if (t === "date") {
|
|
81
|
+
const r = o;
|
|
82
|
+
if (!r) return !1;
|
|
83
|
+
if (Array.isArray(r))
|
|
84
|
+
return r.some((n) => c(n, s, l));
|
|
85
|
+
if (r instanceof Date)
|
|
86
|
+
return c(r, s, l);
|
|
87
|
+
if ("from" in r) {
|
|
88
|
+
const n = r;
|
|
89
|
+
if (n.from && c(n.from, s, l) || n.to && c(n.to, s, l)) return !0;
|
|
71
90
|
}
|
|
72
91
|
}
|
|
73
92
|
return !1;
|
|
74
93
|
}
|
|
75
94
|
export {
|
|
76
|
-
|
|
95
|
+
v as isCalendarApplyDisabled
|
|
77
96
|
};
|
|
@@ -1,13 +1,21 @@
|
|
|
1
|
-
import { FiscalMode, FiscalMonthPattern } from '../../../lib/fiscal-calendar';
|
|
1
|
+
import { CalendarKind, FiscalCalendarConfig, FiscalMode, FiscalMonthPattern } from '../../../lib/fiscal-calendar';
|
|
2
2
|
export declare const CALENDAR_DEFAULT_START_MONTH: Date;
|
|
3
3
|
export declare const CALENDAR_DEFAULT_END_MONTH: Date;
|
|
4
|
+
export declare function resolveFiscalConfig(params: {
|
|
5
|
+
fiscalConfig?: FiscalCalendarConfig;
|
|
6
|
+
calendarKind?: CalendarKind;
|
|
7
|
+
fiscalMode?: FiscalMode;
|
|
8
|
+
fiscalMonthPattern?: FiscalMonthPattern;
|
|
9
|
+
fiscalYearStartMonth?: number;
|
|
10
|
+
weekStartsOn?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
11
|
+
}): FiscalCalendarConfig | undefined;
|
|
4
12
|
export declare function resolveFiscalPattern(params: {
|
|
5
|
-
|
|
13
|
+
calendarKind: CalendarKind;
|
|
6
14
|
fiscalMode: FiscalMode;
|
|
7
15
|
fiscalMonthPattern?: FiscalMonthPattern;
|
|
8
16
|
}): FiscalMonthPattern | undefined;
|
|
9
17
|
export declare function getMonthNamesLong(intlLocale: string): string[];
|
|
10
18
|
export declare function getMonthNamesShort(intlLocale: string): string[];
|
|
11
|
-
export declare function getCalendarMonthLayoutAttr(pickerType: "date" | "week" | "month", monthMode: "single" | "multiple" | "range"): "dual" | "single" | undefined;
|
|
12
|
-
export declare function getCalendarDayLayoutAttr(pickerType: "date" | "week" | "month", mode: "single" | "multiple" | "range", weekMode: "single" | "multiple" | "range"): "dual" | "single" | undefined;
|
|
13
|
-
export declare function getCalendarNumberOfMonths(mode: "single" | "multiple" | "range", weekMode: "single" | "multiple" | "range"): 1 | 2;
|
|
19
|
+
export declare function getCalendarMonthLayoutAttr(pickerType: "date" | "week" | "month" | "quarter" | "year", monthMode: "single" | "multiple" | "range" | "multi-range"): "dual" | "single" | undefined;
|
|
20
|
+
export declare function getCalendarDayLayoutAttr(pickerType: "date" | "week" | "month" | "quarter" | "year", mode: "single" | "multiple" | "range" | "multi-range", weekMode: "single" | "multiple" | "range" | "multi-range"): "dual" | "single" | undefined;
|
|
21
|
+
export declare function getCalendarNumberOfMonths(mode: "single" | "multiple" | "range" | "multi-range", weekMode: "single" | "multiple" | "range" | "multi-range"): 1 | 2;
|
|
@@ -1,38 +1,49 @@
|
|
|
1
|
-
import { FISCAL_PATTERNS as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { FISCAL_PATTERNS as a } from "../../../lib/fiscal-calendar/types.js";
|
|
2
|
+
import { toFiscalCalendarConfig as i } from "../../../lib/fiscal-calendar/week-selection.js";
|
|
3
|
+
const f = new Date(1900, 0, 1), u = new Date(2100, 11, 31);
|
|
4
|
+
function c(t) {
|
|
5
|
+
return t.fiscalConfig ? t.fiscalConfig : i({
|
|
6
|
+
calendarKind: t.calendarKind,
|
|
7
|
+
fiscalMode: t.fiscalMode,
|
|
8
|
+
fiscalMonthPattern: t.fiscalMonthPattern,
|
|
9
|
+
fiscalYearStartMonth: t.fiscalYearStartMonth,
|
|
10
|
+
weekStartsOn: t.weekStartsOn
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
function g(t) {
|
|
14
|
+
const { calendarKind: n, fiscalMode: r, fiscalMonthPattern: e } = t;
|
|
5
15
|
if (n === "fiscal") {
|
|
6
16
|
if (e) return e;
|
|
7
|
-
if (r === "advanced") return
|
|
17
|
+
if (r === "advanced") return a["4-4-5"];
|
|
8
18
|
}
|
|
9
19
|
}
|
|
10
|
-
function
|
|
20
|
+
function s(t) {
|
|
11
21
|
return Array.from(
|
|
12
22
|
{ length: 12 },
|
|
13
23
|
(n, r) => new Date(2024, r, 1).toLocaleString(t, { month: "long" })
|
|
14
24
|
);
|
|
15
25
|
}
|
|
16
|
-
function
|
|
26
|
+
function d(t) {
|
|
17
27
|
return Array.from(
|
|
18
28
|
{ length: 12 },
|
|
19
29
|
(n, r) => new Date(2024, r, 1).toLocaleString(t, { month: "short" })
|
|
20
30
|
);
|
|
21
31
|
}
|
|
22
|
-
function
|
|
23
|
-
if (t
|
|
24
|
-
return n === "range" || n === "multiple" ? "dual" : "single";
|
|
32
|
+
function h(t, n) {
|
|
33
|
+
if (!(t !== "month" && t !== "quarter"))
|
|
34
|
+
return n === "range" || n === "multiple" || n === "multi-range" ? "dual" : "single";
|
|
25
35
|
}
|
|
26
|
-
function
|
|
27
|
-
if (t
|
|
28
|
-
return n === "range" || n === "multiple" || r === "range" || r === "multiple" ? "dual" : "single";
|
|
36
|
+
function A(t, n, r) {
|
|
37
|
+
if (!(t === "month" || t === "quarter" || t === "year"))
|
|
38
|
+
return n === "range" || n === "multiple" || n === "multi-range" || r === "range" || r === "multiple" || r === "multi-range" ? "dual" : "single";
|
|
29
39
|
}
|
|
30
40
|
export {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
41
|
+
u as CALENDAR_DEFAULT_END_MONTH,
|
|
42
|
+
f as CALENDAR_DEFAULT_START_MONTH,
|
|
43
|
+
A as getCalendarDayLayoutAttr,
|
|
44
|
+
h as getCalendarMonthLayoutAttr,
|
|
45
|
+
s as getMonthNamesLong,
|
|
46
|
+
d as getMonthNamesShort,
|
|
47
|
+
c as resolveFiscalConfig,
|
|
48
|
+
g as resolveFiscalPattern
|
|
38
49
|
};
|
|
@@ -1,49 +1,57 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
1
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import * as s from "react";
|
|
3
3
|
import "react-day-picker";
|
|
4
|
-
import { cn as
|
|
5
|
-
import { Button as
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
import { cn as p } from "../../../lib/utils.js";
|
|
5
|
+
import { Button as v } from "../../primitives/button/button.js";
|
|
6
|
+
import { useCalendarDayHover as g } from "./calendar-day-hover.js";
|
|
7
|
+
import { dayButtonAppearanceClassName as _ } from "./calendar-selection-appearance.js";
|
|
8
|
+
import { selectionKindFromModifiers as y } from "./calendar-selection.js";
|
|
9
|
+
function B({
|
|
10
|
+
className: r,
|
|
11
|
+
day: n,
|
|
12
|
+
modifiers: a,
|
|
13
|
+
pickerType: c,
|
|
14
|
+
...t
|
|
12
15
|
}) {
|
|
13
|
-
const o = g.useCallback(
|
|
14
|
-
(
|
|
15
|
-
|
|
16
|
+
const o = g(), d = y(a), l = s.useCallback(
|
|
17
|
+
(e) => {
|
|
18
|
+
e && a.focused && e.focus({ preventScroll: !0 });
|
|
16
19
|
},
|
|
17
|
-
[
|
|
20
|
+
[a.focused]
|
|
18
21
|
);
|
|
19
|
-
return /* @__PURE__ */
|
|
20
|
-
|
|
22
|
+
return /* @__PURE__ */ u(
|
|
23
|
+
v,
|
|
21
24
|
{
|
|
22
|
-
|
|
23
|
-
|
|
25
|
+
...t,
|
|
26
|
+
ref: l,
|
|
27
|
+
tabIndex: a.focused ? 0 : -1,
|
|
24
28
|
variant: "ghost",
|
|
25
29
|
size: "sm",
|
|
26
|
-
"data-day":
|
|
27
|
-
"data-
|
|
28
|
-
"data-
|
|
29
|
-
"data-
|
|
30
|
-
"data-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
"data-[range-middle=true]:text-accent-foreground data-[range-middle=true]:rounded-none",
|
|
39
|
-
n
|
|
30
|
+
"data-day": n.date.toLocaleDateString(),
|
|
31
|
+
"data-selection": d,
|
|
32
|
+
"data-preview": a.preview || a.preview_cap ? !0 : void 0,
|
|
33
|
+
"data-today": a.today || void 0,
|
|
34
|
+
"data-selected-single": a.selected && !a.range_start && !a.range_end && !a.range_middle,
|
|
35
|
+
"data-range-start": a.range_start,
|
|
36
|
+
"data-range-end": a.range_end,
|
|
37
|
+
"data-range-middle": a.range_middle,
|
|
38
|
+
"aria-current": a.today ? "date" : void 0,
|
|
39
|
+
className: p(
|
|
40
|
+
_(d, c === "week" ? "week" : "date"),
|
|
41
|
+
r
|
|
40
42
|
),
|
|
41
43
|
"data-component": "calendar-day",
|
|
42
|
-
|
|
43
|
-
|
|
44
|
+
onMouseEnter: (e) => {
|
|
45
|
+
t.onMouseEnter?.(e), o(n.date);
|
|
46
|
+
},
|
|
47
|
+
onMouseLeave: (e) => {
|
|
48
|
+
t.onMouseLeave?.(e), o(void 0);
|
|
49
|
+
},
|
|
50
|
+
"data-period-boundary": a.fiscal_period_start ? "start" : a.fiscal_period_end ? "end" : void 0,
|
|
51
|
+
disabled: t.disabled || a.disabled
|
|
44
52
|
}
|
|
45
53
|
);
|
|
46
54
|
}
|
|
47
55
|
export {
|
|
48
|
-
|
|
56
|
+
B as CalendarDayButton
|
|
49
57
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
type HoverHandler = (date: Date | undefined) => void;
|
|
3
|
+
export declare function CalendarDayHoverProvider({ onDayHover, children, }: {
|
|
4
|
+
onDayHover: HoverHandler;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}): React.FunctionComponentElement<React.ProviderProps<HoverHandler>>;
|
|
7
|
+
export declare function useCalendarDayHover(): HoverHandler;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as e from "react";
|
|
2
|
+
const r = e.createContext(() => {
|
|
3
|
+
});
|
|
4
|
+
function n({
|
|
5
|
+
onDayHover: t,
|
|
6
|
+
children: a
|
|
7
|
+
}) {
|
|
8
|
+
return e.createElement(
|
|
9
|
+
r.Provider,
|
|
10
|
+
{ value: t },
|
|
11
|
+
a
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
function o() {
|
|
15
|
+
return e.useContext(r);
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
n as CalendarDayHoverProvider,
|
|
19
|
+
o as useCalendarDayHover
|
|
20
|
+
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { getDefaultClassNames } from 'react-day-picker';
|
|
2
|
+
import { CalendarKind } from '../../../lib/fiscal-calendar';
|
|
2
3
|
type DefaultClassNames = ReturnType<typeof getDefaultClassNames>;
|
|
3
4
|
export declare function getCalendarDayPickerClassNames(params: {
|
|
4
5
|
defaultClassNames: DefaultClassNames;
|
|
5
6
|
pickerType: "date" | "week" | "month";
|
|
6
|
-
|
|
7
|
+
calendarKind: CalendarKind;
|
|
7
8
|
showOutsideDays: boolean;
|
|
9
|
+
periodRowHover?: boolean;
|
|
8
10
|
classNames?: Partial<DefaultClassNames>;
|
|
9
11
|
}): {
|
|
10
12
|
root: string;
|
|
@@ -50,4 +52,9 @@ export declare function getCalendarDayPickerClassNames(params: {
|
|
|
50
52
|
caption_before_exit?: string | undefined;
|
|
51
53
|
table: string;
|
|
52
54
|
};
|
|
55
|
+
export declare const previewModifierClassNames: {
|
|
56
|
+
preview: string;
|
|
57
|
+
preview_cap_start: string;
|
|
58
|
+
preview_cap_end: string;
|
|
59
|
+
};
|
|
53
60
|
export {};
|
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
import "react-day-picker";
|
|
2
2
|
import { cn as e } from "../../../lib/utils.js";
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
import { previewCapEndCellClassName as m, previewCapStartCellClassName as f, previewCellClassName as p, rangeEndCellClassName as w, rangeMiddleCellClassName as u, rangeStartCellClassName as b, dayCellBaseClassName as h, weekNumberInteractiveClassName as k, weekNumberSelectedFillClassName as x, weekNumberBaseClassName as s, DAY_MONTH_MIN_WIDTH as _ } from "./calendar-selection-appearance.js";
|
|
4
|
+
function v(l) {
|
|
5
|
+
const {
|
|
6
|
+
defaultClassNames: t,
|
|
7
|
+
pickerType: o,
|
|
8
|
+
calendarKind: i,
|
|
9
|
+
showOutsideDays: d,
|
|
10
|
+
periodRowHover: c = !1,
|
|
11
|
+
classNames: r
|
|
12
|
+
} = l, a = o === "week", n = a && !c;
|
|
5
13
|
return {
|
|
6
14
|
root: e("w-fit", t.root),
|
|
7
15
|
months: e("relative", t.months),
|
|
8
16
|
month: e(
|
|
9
|
-
"relative flex flex-1
|
|
17
|
+
"relative flex flex-1",
|
|
18
|
+
_,
|
|
19
|
+
"flex-col gap-2 after:absolute after:top-[5.5rem] after:bottom-0 after:left-9 after:w-[1px] after:bg-stroke-hairline",
|
|
10
20
|
t.month
|
|
11
21
|
),
|
|
12
22
|
button_previous: e(
|
|
@@ -28,7 +38,7 @@ function s(o) {
|
|
|
28
38
|
caption_label: e("select-none font-medium text-sm", t.caption_label),
|
|
29
39
|
table: "w-full border-collapse",
|
|
30
40
|
weekdays: e(
|
|
31
|
-
"flex w-full relative after:absolute after:bottom-0 after:right-0 after:h-[1px] after:bg-stroke-hairline after:left-
|
|
41
|
+
"flex w-full relative after:absolute after:bottom-0 after:right-0 after:h-[1px] after:bg-stroke-hairline after:left-9",
|
|
32
42
|
t.weekdays
|
|
33
43
|
),
|
|
34
44
|
weekday: e(
|
|
@@ -37,37 +47,47 @@ function s(o) {
|
|
|
37
47
|
"[&:nth-child(2)]:pl-2",
|
|
38
48
|
t.weekday
|
|
39
49
|
),
|
|
40
|
-
week: e(
|
|
50
|
+
week: e(
|
|
51
|
+
a ? "flex w-full items-stretch group/week" : "mt-1 flex w-full items-stretch group/week",
|
|
52
|
+
t.week
|
|
53
|
+
),
|
|
41
54
|
week_number_header: e(
|
|
42
|
-
"select-none
|
|
43
|
-
|
|
55
|
+
"select-none text-center flex items-center justify-center",
|
|
56
|
+
s,
|
|
44
57
|
t.week_number_header
|
|
45
58
|
),
|
|
46
59
|
week_number: e(
|
|
47
|
-
|
|
48
|
-
"
|
|
49
|
-
|
|
60
|
+
s,
|
|
61
|
+
"whitespace-nowrap transition-colors",
|
|
62
|
+
n && "group-hover/week:bg-accent",
|
|
63
|
+
a && x,
|
|
64
|
+
a && k,
|
|
50
65
|
t.week_number
|
|
51
66
|
),
|
|
52
67
|
day: e(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
r
|
|
56
|
-
n?.day
|
|
68
|
+
h,
|
|
69
|
+
n && "group-hover/week:bg-accent",
|
|
70
|
+
r?.day
|
|
57
71
|
),
|
|
58
|
-
range_start: e(
|
|
59
|
-
range_middle: e(
|
|
60
|
-
range_end: e(
|
|
72
|
+
range_start: e(b, t.range_start),
|
|
73
|
+
range_middle: e(u, t.range_middle),
|
|
74
|
+
range_end: e(w, t.range_end),
|
|
61
75
|
today: e("text-brand", t.today),
|
|
62
76
|
outside: e(
|
|
63
|
-
|
|
77
|
+
i === "fiscal" || d ? "text-secondary-foreground opacity-50" : "invisible",
|
|
64
78
|
t.outside
|
|
65
79
|
),
|
|
66
80
|
disabled: e("text-secondary-foreground opacity-50", t.disabled),
|
|
67
81
|
hidden: e("invisible", t.hidden),
|
|
68
|
-
...
|
|
82
|
+
...r
|
|
69
83
|
};
|
|
70
84
|
}
|
|
85
|
+
const N = {
|
|
86
|
+
preview: p,
|
|
87
|
+
preview_cap_start: f,
|
|
88
|
+
preview_cap_end: m
|
|
89
|
+
};
|
|
71
90
|
export {
|
|
72
|
-
|
|
91
|
+
v as getCalendarDayPickerClassNames,
|
|
92
|
+
N as previewModifierClassNames
|
|
73
93
|
};
|
|
@@ -1,25 +1,36 @@
|
|
|
1
1
|
import { DayPicker } from 'react-day-picker';
|
|
2
2
|
import { Button } from '../../primitives/button/button';
|
|
3
3
|
import { Option } from '../../forms/select';
|
|
4
|
+
import { FiscalCalendarConfig, FiscalPeriod, CalendarKind } from '../../../lib/fiscal-calendar';
|
|
4
5
|
import { WeekPickerInput } from './calendar-week-utils';
|
|
5
6
|
import * as React from "react";
|
|
6
7
|
export interface BuildCalendarDayPickerComponentsParams {
|
|
7
8
|
buttonVariant: React.ComponentProps<typeof Button>["variant"];
|
|
8
9
|
pickerType: "date" | "week" | "month";
|
|
10
|
+
calendarKind: CalendarKind;
|
|
9
11
|
currentMonth: Date;
|
|
10
12
|
monthsFull: string[];
|
|
13
|
+
monthsShort: string[];
|
|
11
14
|
resolvedStartMonth: Date;
|
|
12
15
|
resolvedEndMonth: Date;
|
|
13
16
|
availableYears: Option[];
|
|
17
|
+
fiscalPeriods?: readonly FiscalPeriod[];
|
|
18
|
+
fiscalConfig?: FiscalCalendarConfig;
|
|
14
19
|
weekStartsOn: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
15
20
|
previousMonthLabel: string;
|
|
16
21
|
nextMonthLabel: string;
|
|
17
22
|
monthPlaceholder: string;
|
|
18
23
|
yearPlaceholder: string;
|
|
19
24
|
weekNumberLabel: (weekOfMonth: number) => string;
|
|
25
|
+
weekNumberHeader: string;
|
|
20
26
|
weekLabel: (weekOfMonth: number) => string;
|
|
27
|
+
fiscalWeekNumberLabel?: (week: number) => string;
|
|
28
|
+
fiscalWeekAriaLabel?: (meta: import('../../../lib/fiscal-calendar').DateCellMeta) => string;
|
|
29
|
+
getCellMeta?: (date: Date) => import('../../../lib/fiscal-calendar').DateCellMeta | undefined;
|
|
21
30
|
onMonthChange: (month: Date) => void;
|
|
22
31
|
onWeekSelect: (input: WeekPickerInput) => void;
|
|
32
|
+
periodRowHover?: boolean;
|
|
33
|
+
weekMode?: "single" | "multiple" | "range" | "multi-range";
|
|
23
34
|
components?: React.ComponentProps<typeof DayPicker>["components"];
|
|
24
35
|
}
|
|
25
|
-
export declare function buildCalendarDayPickerComponents({ buttonVariant, pickerType, currentMonth, monthsFull, resolvedStartMonth, resolvedEndMonth, availableYears, weekStartsOn, previousMonthLabel, nextMonthLabel, monthPlaceholder, yearPlaceholder, weekNumberLabel, weekLabel, onMonthChange, onWeekSelect, components, }: BuildCalendarDayPickerComponentsParams): React.ComponentProps<typeof DayPicker>["components"];
|
|
36
|
+
export declare function buildCalendarDayPickerComponents({ buttonVariant, pickerType, calendarKind, currentMonth, monthsFull, monthsShort, resolvedStartMonth, resolvedEndMonth, availableYears, fiscalPeriods, fiscalConfig, weekStartsOn, previousMonthLabel, nextMonthLabel, monthPlaceholder, yearPlaceholder, weekNumberLabel, weekNumberHeader, weekLabel, fiscalWeekNumberLabel, fiscalWeekAriaLabel, getCellMeta, onMonthChange, onWeekSelect, periodRowHover, weekMode, components, }: BuildCalendarDayPickerComponentsParams): React.ComponentProps<typeof DayPicker>["components"];
|