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
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { jsx as t, jsxs as v } from "react/jsx-runtime";
|
|
2
|
+
import * as f from "react";
|
|
3
|
+
import { Select as C } from "../../forms/select/select.js";
|
|
4
|
+
import { Tooltip as O, TooltipTrigger as S, TooltipContent as b } from "../../feedback/tooltip/tooltip.js";
|
|
5
|
+
import { formatPeriodTooltip as g, formatPeriodOption as T, formatPeriodCell as x } from "./calendar-fiscal-labels.js";
|
|
6
|
+
function N({
|
|
7
|
+
periods: i,
|
|
8
|
+
selectedPeriod: o,
|
|
9
|
+
placeholder: m,
|
|
10
|
+
onPeriodChange: u
|
|
11
|
+
}) {
|
|
12
|
+
const [r, l] = f.useState(!1), [c, n] = f.useState(!1), a = o ? g(o) : void 0, d = i.map((e) => ({
|
|
13
|
+
label: T(e),
|
|
14
|
+
value: String(e.period)
|
|
15
|
+
})), p = /* @__PURE__ */ t(
|
|
16
|
+
C,
|
|
17
|
+
{
|
|
18
|
+
value: o ? { label: x(o).label, value: String(o.period) } : void 0,
|
|
19
|
+
onChange: (e) => {
|
|
20
|
+
if (e && "value" in e) {
|
|
21
|
+
const s = i.find((h) => String(h.period) === e.value);
|
|
22
|
+
s && u(s);
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
onMenuOpen: () => {
|
|
26
|
+
l(!0), n(!1);
|
|
27
|
+
},
|
|
28
|
+
onMenuClose: () => l(!1),
|
|
29
|
+
scrollToSelectedOnOpen: !0,
|
|
30
|
+
options: d,
|
|
31
|
+
className: "w-[116px] shrink-0",
|
|
32
|
+
menuWidth: "220px",
|
|
33
|
+
isSearchable: !0,
|
|
34
|
+
isClearable: !1,
|
|
35
|
+
placeholder: m
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
return a ? /* @__PURE__ */ v(
|
|
39
|
+
O,
|
|
40
|
+
{
|
|
41
|
+
delayDuration: 0,
|
|
42
|
+
disableHoverableContent: !0,
|
|
43
|
+
open: c && !r,
|
|
44
|
+
onOpenChange: (e) => {
|
|
45
|
+
r || n(e);
|
|
46
|
+
},
|
|
47
|
+
children: [
|
|
48
|
+
/* @__PURE__ */ t(S, { asChild: !0, children: /* @__PURE__ */ t(
|
|
49
|
+
"span",
|
|
50
|
+
{
|
|
51
|
+
className: "inline-flex min-w-0",
|
|
52
|
+
onPointerDown: () => n(!1),
|
|
53
|
+
children: p
|
|
54
|
+
}
|
|
55
|
+
) }),
|
|
56
|
+
/* @__PURE__ */ t(b, { variant: "tertiary", side: "top", children: a })
|
|
57
|
+
]
|
|
58
|
+
}
|
|
59
|
+
) : p;
|
|
60
|
+
}
|
|
61
|
+
export {
|
|
62
|
+
N as FiscalPeriodCaptionSelect
|
|
63
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { Calendar } from './calendar';
|
|
2
2
|
export { CalendarDayButton } from './calendar-day-button';
|
|
3
3
|
export { CalendarCaptionHeader } from './calendar-caption-header';
|
|
4
|
-
export type { CalendarApplyValue, CalendarProps, MonthRange, MonthSelection, WeekRange, WeekRangeDraft, WeekSelection, } from './calendar.types';
|
|
4
|
+
export type { CalendarApplyValue, CalendarProps, MonthRange, MonthSelection, QuarterRange, QuarterSelection, WeekRange, WeekRangeDraft, WeekSelection, YearRange, YearSelection, YoYComparison, } from './calendar.types';
|
|
@@ -1,31 +1,41 @@
|
|
|
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 { CalendarKind, FiscalCalendarConfig, FiscalPeriod, Granularity } from '../../../lib/fiscal-calendar';
|
|
4
5
|
import { WeekPickerInput } from './calendar-week-utils';
|
|
5
6
|
import * as React from "react";
|
|
6
7
|
export interface UseCalendarDayPickerConfigParams {
|
|
7
8
|
buttonVariant: React.ComponentProps<typeof Button>["variant"];
|
|
8
9
|
pickerType: "date" | "week";
|
|
9
|
-
|
|
10
|
+
calendarKind: CalendarKind;
|
|
11
|
+
granularity?: Granularity;
|
|
10
12
|
showOutsideDays: boolean;
|
|
11
13
|
classNames?: React.ComponentProps<typeof DayPicker>["classNames"];
|
|
12
14
|
currentMonth: Date;
|
|
13
15
|
monthsFull: string[];
|
|
16
|
+
monthsShort: string[];
|
|
14
17
|
resolvedStartMonth: Date;
|
|
15
18
|
resolvedEndMonth: Date;
|
|
16
19
|
availableYears: Option[];
|
|
20
|
+
fiscalPeriods?: readonly FiscalPeriod[];
|
|
21
|
+
fiscalConfig?: FiscalCalendarConfig;
|
|
17
22
|
weekStartsOn: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
18
23
|
previousMonthLabel: string;
|
|
19
24
|
nextMonthLabel: string;
|
|
20
25
|
monthPlaceholder: string;
|
|
21
26
|
yearPlaceholder: string;
|
|
22
27
|
weekNumberLabel: (weekOfMonth: number) => string;
|
|
28
|
+
weekNumberHeader: string;
|
|
23
29
|
weekLabel: (weekOfMonth: number) => string;
|
|
30
|
+
fiscalWeekNumberLabel?: (week: number) => string;
|
|
31
|
+
fiscalWeekAriaLabel?: (meta: import('../../../lib/fiscal-calendar').DateCellMeta) => string;
|
|
32
|
+
getCellMeta?: (date: Date) => import('../../../lib/fiscal-calendar').DateCellMeta | undefined;
|
|
24
33
|
onMonthChange: (month: Date) => void;
|
|
25
34
|
onWeekSelect: (input: WeekPickerInput) => void;
|
|
35
|
+
weekMode?: "single" | "multiple" | "range" | "multi-range";
|
|
26
36
|
components?: React.ComponentProps<typeof DayPicker>["components"];
|
|
27
37
|
}
|
|
28
|
-
export declare function useCalendarDayPickerConfig({ buttonVariant, pickerType,
|
|
38
|
+
export declare function useCalendarDayPickerConfig({ buttonVariant, pickerType, calendarKind, granularity, showOutsideDays, classNames, currentMonth, monthsFull, monthsShort, resolvedStartMonth, resolvedEndMonth, availableYears, fiscalPeriods, fiscalConfig, weekStartsOn, previousMonthLabel, nextMonthLabel, monthPlaceholder, yearPlaceholder, weekNumberLabel, weekNumberHeader, weekLabel, fiscalWeekNumberLabel, fiscalWeekAriaLabel, getCellMeta, onMonthChange, onWeekSelect, weekMode, components, }: UseCalendarDayPickerConfigParams): {
|
|
29
39
|
dayPickerClassNames: {
|
|
30
40
|
root: string;
|
|
31
41
|
chevron?: string | undefined;
|
|
@@ -1,80 +1,110 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import { getDefaultClassNames as
|
|
3
|
-
import { buildCalendarDayPickerComponents as
|
|
4
|
-
import { getCalendarDayPickerClassNames as
|
|
5
|
-
function
|
|
6
|
-
buttonVariant:
|
|
1
|
+
import * as F from "react";
|
|
2
|
+
import { getDefaultClassNames as i } from "react-day-picker";
|
|
3
|
+
import { buildCalendarDayPickerComponents as v } from "./calendar-day-picker-components.js";
|
|
4
|
+
import { getCalendarDayPickerClassNames as W } from "./calendar-day-picker-classnames.js";
|
|
5
|
+
function T({
|
|
6
|
+
buttonVariant: f,
|
|
7
7
|
pickerType: m,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
8
|
+
calendarKind: C,
|
|
9
|
+
granularity: V,
|
|
10
|
+
showOutsideDays: D,
|
|
11
|
+
classNames: P,
|
|
12
|
+
currentMonth: R,
|
|
13
|
+
monthsFull: g,
|
|
14
|
+
monthsShort: o,
|
|
15
|
+
resolvedStartMonth: j,
|
|
16
|
+
resolvedEndMonth: q,
|
|
17
|
+
availableYears: u,
|
|
18
|
+
fiscalPeriods: x,
|
|
19
|
+
fiscalConfig: z,
|
|
20
|
+
weekStartsOn: B,
|
|
21
|
+
previousMonthLabel: G,
|
|
22
|
+
nextMonthLabel: H,
|
|
23
|
+
monthPlaceholder: I,
|
|
24
|
+
yearPlaceholder: J,
|
|
25
|
+
weekNumberLabel: N,
|
|
26
|
+
weekNumberHeader: Q,
|
|
27
|
+
weekLabel: U,
|
|
28
|
+
fiscalWeekNumberLabel: X,
|
|
29
|
+
fiscalWeekAriaLabel: Z,
|
|
30
|
+
getCellMeta: _,
|
|
31
|
+
onMonthChange: $,
|
|
32
|
+
onWeekSelect: p,
|
|
33
|
+
weekMode: y = "single",
|
|
34
|
+
components: A
|
|
26
35
|
}) {
|
|
27
|
-
const
|
|
28
|
-
() =>
|
|
29
|
-
defaultClassNames:
|
|
36
|
+
const E = i(), s = m === "week" && C === "fiscal" && V === "period", Y = F.useMemo(
|
|
37
|
+
() => W({
|
|
38
|
+
defaultClassNames: E,
|
|
30
39
|
pickerType: m,
|
|
31
|
-
|
|
32
|
-
showOutsideDays:
|
|
33
|
-
|
|
40
|
+
calendarKind: C,
|
|
41
|
+
showOutsideDays: D,
|
|
42
|
+
periodRowHover: s,
|
|
43
|
+
classNames: P
|
|
34
44
|
}),
|
|
35
|
-
[
|
|
36
|
-
),
|
|
37
|
-
() =>
|
|
38
|
-
buttonVariant:
|
|
45
|
+
[E, m, C, D, s, P]
|
|
46
|
+
), O = F.useMemo(
|
|
47
|
+
() => v({
|
|
48
|
+
buttonVariant: f,
|
|
39
49
|
pickerType: m,
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
50
|
+
calendarKind: C,
|
|
51
|
+
currentMonth: R,
|
|
52
|
+
monthsFull: g,
|
|
53
|
+
monthsShort: o,
|
|
54
|
+
resolvedStartMonth: j,
|
|
55
|
+
resolvedEndMonth: q,
|
|
56
|
+
availableYears: u,
|
|
57
|
+
fiscalPeriods: x,
|
|
58
|
+
fiscalConfig: z,
|
|
59
|
+
weekStartsOn: B,
|
|
60
|
+
previousMonthLabel: G,
|
|
61
|
+
nextMonthLabel: H,
|
|
62
|
+
monthPlaceholder: I,
|
|
63
|
+
yearPlaceholder: J,
|
|
64
|
+
weekNumberLabel: N,
|
|
65
|
+
weekNumberHeader: Q,
|
|
66
|
+
weekLabel: U,
|
|
67
|
+
fiscalWeekNumberLabel: X,
|
|
68
|
+
fiscalWeekAriaLabel: Z,
|
|
69
|
+
getCellMeta: _,
|
|
70
|
+
onMonthChange: $,
|
|
71
|
+
onWeekSelect: p,
|
|
72
|
+
periodRowHover: s,
|
|
73
|
+
weekMode: y,
|
|
74
|
+
components: A
|
|
55
75
|
}),
|
|
56
76
|
[
|
|
57
|
-
|
|
77
|
+
f,
|
|
58
78
|
m,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
a,
|
|
79
|
+
C,
|
|
80
|
+
R,
|
|
62
81
|
g,
|
|
63
|
-
r,
|
|
64
|
-
u,
|
|
65
|
-
N,
|
|
66
82
|
o,
|
|
67
|
-
R,
|
|
68
|
-
c,
|
|
69
|
-
d,
|
|
70
83
|
j,
|
|
71
84
|
q,
|
|
85
|
+
u,
|
|
72
86
|
x,
|
|
73
|
-
z
|
|
87
|
+
z,
|
|
88
|
+
B,
|
|
89
|
+
G,
|
|
90
|
+
H,
|
|
91
|
+
I,
|
|
92
|
+
J,
|
|
93
|
+
N,
|
|
94
|
+
Q,
|
|
95
|
+
U,
|
|
96
|
+
X,
|
|
97
|
+
Z,
|
|
98
|
+
_,
|
|
99
|
+
$,
|
|
100
|
+
p,
|
|
101
|
+
s,
|
|
102
|
+
y,
|
|
103
|
+
A
|
|
74
104
|
]
|
|
75
105
|
);
|
|
76
|
-
return { dayPickerClassNames:
|
|
106
|
+
return { dayPickerClassNames: Y, dayPickerComponents: O };
|
|
77
107
|
}
|
|
78
108
|
export {
|
|
79
|
-
|
|
109
|
+
T as useCalendarDayPickerConfig
|
|
80
110
|
};
|
|
@@ -1,24 +1,34 @@
|
|
|
1
1
|
import { DateRange } from 'react-day-picker';
|
|
2
|
-
import { FiscalMode, FiscalMonthPattern } from '../../../lib/fiscal-calendar';
|
|
3
|
-
import { CalendarApplyValue, MonthRange, MonthSelection, WeekRange, WeekSelection } from './calendar.types';
|
|
2
|
+
import { FiscalCalendarConfig, FiscalMode, FiscalMonthPattern, CalendarKind, CalendarSelection, Granularity, FiscalPreset } from '../../../lib/fiscal-calendar';
|
|
3
|
+
import { CalendarApplyValue, MonthRange, MonthSelection, QuarterRange, QuarterSelection, WeekRange, WeekSelection, YearRange, YearSelection, YoYComparison } from './calendar.types';
|
|
4
4
|
export interface UseCalendarStateOptions {
|
|
5
5
|
showFooter: boolean;
|
|
6
|
-
mode: "single" | "multiple" | "range";
|
|
7
|
-
selected?: Date | Date[] | DateRange;
|
|
6
|
+
mode: "single" | "multiple" | "range" | "multi-range";
|
|
7
|
+
selected?: Date | Date[] | DateRange | DateRange[];
|
|
8
8
|
onSelect?: (date: Date | Date[] | DateRange | undefined) => void;
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
onSelectionChange?: (selection: CalendarSelection) => void;
|
|
10
|
+
pickerType: "date" | "week" | "month" | "quarter" | "year";
|
|
11
|
+
weekMode: "single" | "multiple" | "range" | "multi-range";
|
|
11
12
|
selectedWeeks?: WeekSelection | WeekSelection[] | WeekRange;
|
|
12
13
|
onWeekSelect?: (weeks: WeekSelection | WeekSelection[] | WeekRange | undefined) => void;
|
|
13
|
-
|
|
14
|
+
calendarKind: CalendarKind;
|
|
14
15
|
fiscalMode: FiscalMode;
|
|
15
|
-
|
|
16
|
+
granularity?: Granularity;
|
|
16
17
|
resolvedFiscalPattern?: FiscalMonthPattern;
|
|
18
|
+
fiscalConfig?: FiscalCalendarConfig;
|
|
17
19
|
fiscalYearStartMonth: number;
|
|
18
20
|
weekStartsOn: 0 | 1 | 2 | 3 | 4 | 5 | 6;
|
|
19
|
-
monthMode: "single" | "multiple" | "range";
|
|
21
|
+
monthMode: "single" | "multiple" | "range" | "multi-range";
|
|
20
22
|
selectedMonths?: MonthSelection | MonthSelection[] | MonthRange;
|
|
21
23
|
onMonthSelect?: (months: MonthSelection | MonthSelection[] | MonthRange | undefined) => void;
|
|
24
|
+
selectedQuarters?: QuarterSelection | QuarterSelection[] | QuarterRange;
|
|
25
|
+
onQuarterSelect?: (quarters: QuarterSelection | QuarterSelection[] | QuarterRange | undefined) => void;
|
|
26
|
+
selectedYear?: YearSelection | YearSelection[] | YearRange;
|
|
27
|
+
onYearSelect?: (year: YearSelection | YearSelection[] | YearRange | undefined) => void;
|
|
28
|
+
yearMode?: "single" | "multiple" | "range" | "multi-range";
|
|
29
|
+
comparison?: "prior-fy";
|
|
30
|
+
onComparisonChange?: (value: YoYComparison | undefined) => void;
|
|
31
|
+
onRangesChange?: (ranges: DateRange[] | undefined) => void;
|
|
22
32
|
month?: Date;
|
|
23
33
|
defaultMonth?: Date;
|
|
24
34
|
onMonthChange?: (month: Date) => void;
|
|
@@ -31,11 +41,13 @@ export interface UseCalendarStateOptions {
|
|
|
31
41
|
footerFlashKey?: number;
|
|
32
42
|
footerFlashTarget?: import('./calendar-footer-emphasis').FooterFlashTarget;
|
|
33
43
|
}
|
|
34
|
-
export declare function useCalendarState({ showFooter, selected, onSelect, pickerType, weekMode, selectedWeeks, onWeekSelect,
|
|
35
|
-
pendingSelection: Date | DateRange | Date[] | undefined;
|
|
44
|
+
export declare function useCalendarState({ showFooter, mode, selected, onSelect, onSelectionChange, pickerType, weekMode, selectedWeeks, onWeekSelect, calendarKind, fiscalMode, granularity, resolvedFiscalPattern, fiscalConfig, fiscalYearStartMonth, weekStartsOn, monthMode, selectedMonths, onMonthSelect, selectedQuarters, onQuarterSelect, selectedYear, onYearSelect, yearMode, comparison, onComparisonChange, onRangesChange, month, defaultMonth, onMonthChange, resolvedStartMonth, resolvedEndMonth, disabled, onApply, onCancel, onClear, }: UseCalendarStateOptions): {
|
|
45
|
+
pendingSelection: Date | DateRange | Date[] | DateRange[] | undefined;
|
|
36
46
|
currentMonth: Date;
|
|
37
47
|
pendingWeekSelection: WeekSelection | WeekRange | WeekSelection[] | undefined;
|
|
38
48
|
pendingMonthSelection: MonthSelection | MonthRange | MonthSelection[] | undefined;
|
|
49
|
+
pendingQuarterSelection: QuarterSelection | QuarterRange | QuarterSelection[] | undefined;
|
|
50
|
+
pendingYearSelection: YearSelection | YearRange | YearSelection[] | undefined;
|
|
39
51
|
monthPickerYear: number;
|
|
40
52
|
handleMonthChangeInternal: (newMonth: Date) => void;
|
|
41
53
|
resolveWeekFromInput: (weekOrDate: Date | {
|
|
@@ -46,8 +58,12 @@ export declare function useCalendarState({ showFooter, selected, onSelect, picke
|
|
|
46
58
|
}) => WeekSelection;
|
|
47
59
|
handleWeekClick: (week: WeekSelection) => void;
|
|
48
60
|
handleMonthClick: (year: number, monthIndex: number) => void;
|
|
61
|
+
handleQuarterClick: (year: number, quarter: 1 | 2 | 3 | 4) => void;
|
|
62
|
+
handleYearClick: (year: number) => void;
|
|
63
|
+
handlePresetSelect: (preset: FiscalPreset) => void;
|
|
49
64
|
availableYears: import('../../..').Option[];
|
|
50
65
|
selectedDaysFromWeeks: Date[] | undefined;
|
|
66
|
+
selectedDaysFromRanges: Date[] | undefined;
|
|
51
67
|
weekRangeModifiers: {
|
|
52
68
|
range_start: Date[];
|
|
53
69
|
range_middle: Date[];
|
|
@@ -64,5 +80,9 @@ export declare function useCalendarState({ showFooter, selected, onSelect, picke
|
|
|
64
80
|
isMiddle: boolean;
|
|
65
81
|
};
|
|
66
82
|
isMonthDisabled: (year: number, monthIndex: number) => boolean;
|
|
83
|
+
isQuarterSelected: (year: number, quarter: 1 | 2 | 3 | 4) => boolean;
|
|
84
|
+
isQuarterDisabled: (year: number, quarter: 1 | 2 | 3 | 4) => boolean;
|
|
85
|
+
isYearSelected: (year: number) => boolean;
|
|
86
|
+
isYearDisabled: (year: number) => boolean;
|
|
67
87
|
isApplyDisabledInternal: boolean;
|
|
68
88
|
};
|