impact-nova 2.5.6 → 2.5.8
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 +82 -51
- 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 +199 -98
- package/dist/components/data-display/calendar/calendar-day-picker-view.d.ts +12 -4
- package/dist/components/data-display/calendar/calendar-day-picker-view.js +139 -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-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 +50 -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 +32 -12
- package/dist/components/data-display/calendar/use-calendar-state.js +371 -164
- package/dist/components/data-display/calendar/use-fiscal-calendar.d.ts +5 -0
- package/dist/components/data-display/calendar/use-fiscal-calendar.js +24 -0
- package/dist/components/feedback/tooltip/overflow-tooltip.js +57 -57
- package/dist/components/flows/guidance/guidance-error-boundary.js +22 -14
- package/dist/components/flows/guidance/guidance-layer.js +34 -32
- package/dist/components/flows/guidance/help-center/assets/whats-new-guide-icon.svg.js +4 -0
- package/dist/components/flows/guidance/help-center/filter-help-center-guides.js +10 -7
- package/dist/components/flows/guidance/help-center/guide-catalog-section.d.ts +7 -0
- package/dist/components/flows/guidance/help-center/guide-catalog-section.js +24 -0
- package/dist/components/flows/guidance/help-center/guide-catalog-utils.d.ts +3 -0
- package/dist/components/flows/guidance/help-center/guide-catalog-utils.js +19 -0
- package/dist/components/flows/guidance/help-center/guide-catalog.d.ts +1 -1
- package/dist/components/flows/guidance/help-center/guide-catalog.js +89 -79
- package/dist/components/flows/guidance/help-center/help-center-guide-labels.d.ts +6 -0
- package/dist/components/flows/guidance/help-center/help-center-guide-labels.js +33 -0
- package/dist/components/flows/guidance/help-center/help-center-guide-row.d.ts +12 -0
- package/dist/components/flows/guidance/help-center/help-center-guide-row.js +57 -0
- package/dist/components/flows/guidance/help-center/help-center-guide-type-icons.d.ts +9 -0
- package/dist/components/flows/guidance/help-center/help-center-guide-type-icons.js +114 -0
- package/dist/components/flows/guidance/help-center/help-center-header.d.ts +1 -1
- package/dist/components/flows/guidance/help-center/help-center-header.js +20 -16
- package/dist/components/flows/guidance/help-center/help-center.constants.d.ts +1 -1
- package/dist/components/flows/guidance/help-center/help-center.constants.js +1 -1
- package/dist/components/flows/guidance/help-center/help-center.d.ts +3 -1
- package/dist/components/flows/guidance/help-center/help-center.js +74 -51
- package/dist/components/flows/guidance/help-center/help-center.types.d.ts +9 -1
- package/dist/components/flows/guidance/help-center/renderHelpCenterGuideTypeIcon.d.ts +4 -0
- package/dist/components/flows/guidance/help-center/renderHelpCenterGuideTypeIcon.js +18 -0
- package/dist/components/flows/guidance/help-center.d.ts +4 -2
- package/dist/components/flows/guidance/help-center.js +23 -14
- package/dist/components/flows/guidance/hooks/useGuidanceOverlayGeometry.js +19 -17
- package/dist/components/flows/guidance/index.d.ts +1 -1
- package/dist/components/flows/guidance/renderers/announcement-renderer.d.ts +1 -1
- package/dist/components/flows/guidance/renderers/announcement-renderer.js +20 -12
- package/dist/components/flows/guidance/renderers/guidance-card-shared.d.ts +9 -11
- package/dist/components/flows/guidance/renderers/guidance-card-shared.js +124 -177
- package/dist/components/flows/guidance/renderers/guidance-renderer-shared.d.ts +1 -1
- package/dist/components/flows/guidance/renderers/guidance-renderer-shared.js +57 -72
- package/dist/components/flows/guidance/renderers/guidance-tour-overlay.js +23 -23
- package/dist/components/flows/wizard/wizard.js +41 -38
- 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/layout/horizontal-scroller/horizontal-scroller.js +35 -53
- 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/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 +11 -12
- 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 +22 -7
- package/dist/form-react/utils/date.utils.d.ts +3 -1
- package/dist/form-react/utils/date.utils.js +82 -53
- package/dist/i18n/defaultMessages.d.ts +29 -1
- package/dist/i18n/defaultMessages.js +54 -27
- package/dist/i18n/locales/de.js +31 -4
- package/dist/i18n/locales/es.js +31 -4
- package/dist/i18n/locales/hi.js +31 -4
- package/dist/i18n/locales/kn.js +31 -4
- 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/lib/guidance/engine/guidance-engine.d.ts +7 -5
- package/dist/lib/guidance/engine/guidance-engine.js +115 -47
- package/dist/lib/guidance/triggers/trigger-registry.js +6 -6
- package/dist/lib/guidance/types/guidance.types.d.ts +11 -1
- package/dist/llms/rules/installation.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,176 @@
|
|
|
1
|
+
import { jsx as r, jsxs as y } from "react/jsx-runtime";
|
|
2
|
+
import * as t from "react";
|
|
3
|
+
import { Cross as W, CalendarMonth as X } from "impact-nova-icons";
|
|
4
|
+
import { cn as Z } from "../../../lib/utils.js";
|
|
5
|
+
import { Input as _ } from "../input/input.js";
|
|
6
|
+
import { Calendar as $ } from "../../data-display/calendar/calendar.js";
|
|
7
|
+
import { Tooltip as x, TooltipTrigger as R, TooltipContent as D } from "../../feedback/tooltip/tooltip.js";
|
|
8
|
+
import { useImpactNovaI18n as ee } from "../../../i18n/use-impact-nova-i18n.js";
|
|
9
|
+
import { buildDateBoundsMatcher as re } from "../../../lib/date-bounds-matcher.js";
|
|
10
|
+
import { fiscalCalendarPassThrough as te } from "./fiscal-pass-through.js";
|
|
11
|
+
import { DatePickerShell as ne } from "./date-picker-shell.js";
|
|
12
|
+
import { usePickerDismissActionsRef as oe, usePickerFooterDismissNudge as ae, handleReadonlyPickerKeyDown as ie, handlePickerSurfacePointerDown as ce } from "./date-input-behavior.js";
|
|
13
|
+
import { formatYearInput as se } from "../../data-display/calendar/calendar-fiscal-labels.js";
|
|
14
|
+
import { viewMonthFromYear as le } from "../../data-display/calendar/calendar-year-utils.js";
|
|
15
|
+
const pe = t.forwardRef(
|
|
16
|
+
({
|
|
17
|
+
value: n,
|
|
18
|
+
onChange: d,
|
|
19
|
+
placeholder: Y,
|
|
20
|
+
minDate: v,
|
|
21
|
+
maxDate: N,
|
|
22
|
+
startMonth: S,
|
|
23
|
+
endMonth: A,
|
|
24
|
+
showFooter: s = !0,
|
|
25
|
+
disabled: o,
|
|
26
|
+
className: I,
|
|
27
|
+
calendarKind: O,
|
|
28
|
+
fiscalMode: T,
|
|
29
|
+
granularity: w,
|
|
30
|
+
fiscalMonthPattern: M,
|
|
31
|
+
fiscalYearStartMonth: K,
|
|
32
|
+
fiscalConfig: k,
|
|
33
|
+
showPresets: j,
|
|
34
|
+
showIntervalCaption: F = !1,
|
|
35
|
+
...L
|
|
36
|
+
}, z) => {
|
|
37
|
+
const { t: a } = ee(), E = Y ?? a("datePicker.selectYear"), m = t.useRef(null), P = t.useRef(null);
|
|
38
|
+
t.useImperativeHandle(z, () => m.current);
|
|
39
|
+
const [i, c] = t.useState(!1), u = t.useRef(!1), g = oe(), { footerFlashKey: H, footerFlashTarget: V, popoverHandlers: B } = ae(s, i, g, P), [C, l] = t.useState(n), [q, G] = t.useState(le(n));
|
|
40
|
+
t.useEffect(() => {
|
|
41
|
+
i || l(n);
|
|
42
|
+
}, [i, n]);
|
|
43
|
+
const p = t.useCallback(() => c(!1), []), J = te({
|
|
44
|
+
calendarKind: O,
|
|
45
|
+
fiscalMode: T,
|
|
46
|
+
granularity: w,
|
|
47
|
+
fiscalMonthPattern: M,
|
|
48
|
+
fiscalYearStartMonth: K,
|
|
49
|
+
fiscalConfig: k,
|
|
50
|
+
showPresets: j
|
|
51
|
+
}), Q = (e) => {
|
|
52
|
+
const f = e && !Array.isArray(e) && !("from" in e) && !("to" in e) ? e : void 0;
|
|
53
|
+
l(f), s || (d?.(f), p());
|
|
54
|
+
}, U = () => {
|
|
55
|
+
d?.(C), p();
|
|
56
|
+
}, h = () => {
|
|
57
|
+
l(n), p();
|
|
58
|
+
}, b = () => {
|
|
59
|
+
l(void 0), d?.(void 0), s || p();
|
|
60
|
+
};
|
|
61
|
+
return t.useLayoutEffect(() => {
|
|
62
|
+
g.current = { onDismiss: h, resolveFlash: () => "cancel" };
|
|
63
|
+
}), /* @__PURE__ */ r(
|
|
64
|
+
ne,
|
|
65
|
+
{
|
|
66
|
+
open: i,
|
|
67
|
+
disabled: o,
|
|
68
|
+
ariaLabel: a("datePicker.selectYear"),
|
|
69
|
+
onOpenChange: (e) => {
|
|
70
|
+
o || c(e);
|
|
71
|
+
},
|
|
72
|
+
onOpenAutoFocus: (e) => {
|
|
73
|
+
u.current || e.preventDefault(), u.current = !1;
|
|
74
|
+
},
|
|
75
|
+
popoverHandlers: B,
|
|
76
|
+
trigger: /* @__PURE__ */ r(
|
|
77
|
+
"div",
|
|
78
|
+
{
|
|
79
|
+
ref: P,
|
|
80
|
+
"data-component": "year-picker",
|
|
81
|
+
"data-state": i ? "open" : "closed",
|
|
82
|
+
onPointerDown: (e) => ce({
|
|
83
|
+
disabled: o,
|
|
84
|
+
event: e,
|
|
85
|
+
onOpen: () => c(!0),
|
|
86
|
+
focusField: () => m.current?.focus()
|
|
87
|
+
}),
|
|
88
|
+
children: /* @__PURE__ */ r(
|
|
89
|
+
_,
|
|
90
|
+
{
|
|
91
|
+
ref: m,
|
|
92
|
+
value: n ? se(n, k?.fyLabel ?? "fy-long") : "",
|
|
93
|
+
readOnly: !0,
|
|
94
|
+
onKeyDown: (e) => ie(e, {
|
|
95
|
+
disabled: o,
|
|
96
|
+
open: i,
|
|
97
|
+
onOpen: () => c(!0),
|
|
98
|
+
onCancel: h,
|
|
99
|
+
onKeyboardOpen: () => {
|
|
100
|
+
u.current = !0;
|
|
101
|
+
}
|
|
102
|
+
}),
|
|
103
|
+
onClick: () => !o && c(!0),
|
|
104
|
+
placeholder: E,
|
|
105
|
+
disabled: o,
|
|
106
|
+
"data-form-control": "input",
|
|
107
|
+
className: Z("cursor-pointer", I),
|
|
108
|
+
suffix: /* @__PURE__ */ y("div", { className: "flex items-center gap-1", children: [
|
|
109
|
+
n && !o ? /* @__PURE__ */ y(x, { children: [
|
|
110
|
+
/* @__PURE__ */ r(R, { asChild: !0, children: /* @__PURE__ */ r(
|
|
111
|
+
"button",
|
|
112
|
+
{
|
|
113
|
+
type: "button",
|
|
114
|
+
tabIndex: 0,
|
|
115
|
+
"aria-label": a("calendar.clear"),
|
|
116
|
+
onClick: (e) => {
|
|
117
|
+
e.stopPropagation(), b();
|
|
118
|
+
},
|
|
119
|
+
className: "inline-flex size-4 items-center justify-center border-none bg-transparent p-0",
|
|
120
|
+
children: /* @__PURE__ */ r(W, { className: "size-3 hover:text-content" })
|
|
121
|
+
}
|
|
122
|
+
) }),
|
|
123
|
+
/* @__PURE__ */ r(D, { variant: "tertiary", side: "top", children: a("calendar.clear") })
|
|
124
|
+
] }) : null,
|
|
125
|
+
/* @__PURE__ */ y(x, { children: [
|
|
126
|
+
/* @__PURE__ */ r(R, { asChild: !0, children: /* @__PURE__ */ r(
|
|
127
|
+
"button",
|
|
128
|
+
{
|
|
129
|
+
type: "button",
|
|
130
|
+
tabIndex: 0,
|
|
131
|
+
"data-component": "calendar-trigger",
|
|
132
|
+
"aria-label": a("datePicker.selectYear"),
|
|
133
|
+
onClick: (e) => {
|
|
134
|
+
e.stopPropagation(), o || c((f) => !f);
|
|
135
|
+
},
|
|
136
|
+
className: "inline-flex items-center justify-center border-none bg-transparent p-0",
|
|
137
|
+
children: /* @__PURE__ */ r(X, { className: "h-4 w-4 text-secondary-foreground" })
|
|
138
|
+
}
|
|
139
|
+
) }),
|
|
140
|
+
/* @__PURE__ */ r(D, { variant: "tertiary", side: "top", children: a("datePicker.selectYear") })
|
|
141
|
+
] })
|
|
142
|
+
] }),
|
|
143
|
+
...L
|
|
144
|
+
}
|
|
145
|
+
)
|
|
146
|
+
}
|
|
147
|
+
),
|
|
148
|
+
children: /* @__PURE__ */ r(
|
|
149
|
+
$,
|
|
150
|
+
{
|
|
151
|
+
pickerType: "year",
|
|
152
|
+
selectedYear: C,
|
|
153
|
+
footerFlashKey: H,
|
|
154
|
+
footerFlashTarget: V,
|
|
155
|
+
onYearSelect: Q,
|
|
156
|
+
month: q,
|
|
157
|
+
onMonthChange: G,
|
|
158
|
+
disabled: re(v, N),
|
|
159
|
+
startMonth: S,
|
|
160
|
+
endMonth: A,
|
|
161
|
+
showFooter: s,
|
|
162
|
+
onApply: U,
|
|
163
|
+
onCancel: h,
|
|
164
|
+
onClear: b,
|
|
165
|
+
showIntervalCaption: F,
|
|
166
|
+
...J
|
|
167
|
+
}
|
|
168
|
+
)
|
|
169
|
+
}
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
);
|
|
173
|
+
pe.displayName = "YearPicker";
|
|
174
|
+
export {
|
|
175
|
+
pe as YearPicker
|
|
176
|
+
};
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { jsx as r, jsxs as g } from "react/jsx-runtime";
|
|
2
|
+
import * as t from "react";
|
|
3
|
+
import { Cross as Z, CalendarMonth as _ } from "impact-nova-icons";
|
|
4
|
+
import { cn as ee } from "../../../lib/utils.js";
|
|
5
|
+
import { Input as re } from "../input/input.js";
|
|
6
|
+
import { Calendar as te } from "../../data-display/calendar/calendar.js";
|
|
7
|
+
import { Tooltip as x, TooltipTrigger as D, TooltipContent as Y } from "../../feedback/tooltip/tooltip.js";
|
|
8
|
+
import { useImpactNovaI18n as ne } from "../../../i18n/use-impact-nova-i18n.js";
|
|
9
|
+
import { buildDateBoundsMatcher as oe } from "../../../lib/date-bounds-matcher.js";
|
|
10
|
+
import { fiscalCalendarPassThrough as ae } from "./fiscal-pass-through.js";
|
|
11
|
+
import { DatePickerShell as ie } from "./date-picker-shell.js";
|
|
12
|
+
import { usePickerDismissActionsRef as ce, usePickerFooterDismissNudge as se, handleReadonlyPickerKeyDown as le, handlePickerSurfacePointerDown as fe } from "./date-input-behavior.js";
|
|
13
|
+
import { formatYearInput as N } from "../../data-display/calendar/calendar-fiscal-labels.js";
|
|
14
|
+
import { viewMonthFromYear as pe } from "../../data-display/calendar/calendar-year-utils.js";
|
|
15
|
+
const de = t.forwardRef(
|
|
16
|
+
({
|
|
17
|
+
value: n,
|
|
18
|
+
onChange: d,
|
|
19
|
+
placeholder: S,
|
|
20
|
+
minDate: v,
|
|
21
|
+
maxDate: A,
|
|
22
|
+
startMonth: I,
|
|
23
|
+
endMonth: M,
|
|
24
|
+
showFooter: l = !0,
|
|
25
|
+
disabled: o,
|
|
26
|
+
className: O,
|
|
27
|
+
calendarKind: T,
|
|
28
|
+
fiscalMode: w,
|
|
29
|
+
granularity: K,
|
|
30
|
+
fiscalMonthPattern: j,
|
|
31
|
+
fiscalYearStartMonth: F,
|
|
32
|
+
fiscalConfig: y,
|
|
33
|
+
showPresets: L,
|
|
34
|
+
showIntervalCaption: $ = !1,
|
|
35
|
+
...z
|
|
36
|
+
}, E) => {
|
|
37
|
+
const { t: a } = ne(), H = S ?? a("datePicker.selectYearRange"), k = y?.fyLabel ?? "fy-long", m = t.useRef(null), P = t.useRef(null);
|
|
38
|
+
t.useImperativeHandle(E, () => m.current);
|
|
39
|
+
const [i, c] = t.useState(!1), u = t.useRef(!1), R = ce(), { footerFlashKey: V, footerFlashTarget: B, popoverHandlers: q } = se(l, i, R, P), [C, f] = t.useState(n), [G, J] = t.useState(pe(n?.from));
|
|
40
|
+
t.useEffect(() => {
|
|
41
|
+
i || f(n);
|
|
42
|
+
}, [i, n]);
|
|
43
|
+
const p = t.useCallback(() => c(!1), []), Q = ae({
|
|
44
|
+
calendarKind: T,
|
|
45
|
+
fiscalMode: w,
|
|
46
|
+
granularity: K,
|
|
47
|
+
fiscalMonthPattern: j,
|
|
48
|
+
fiscalYearStartMonth: F,
|
|
49
|
+
fiscalConfig: y,
|
|
50
|
+
showPresets: L
|
|
51
|
+
}), U = (e) => {
|
|
52
|
+
const s = e && !Array.isArray(e) && ("from" in e || "to" in e) ? e : void 0;
|
|
53
|
+
f(s), l || (d?.(s), s?.to && p());
|
|
54
|
+
}, W = () => {
|
|
55
|
+
d?.(C), p();
|
|
56
|
+
}, h = () => {
|
|
57
|
+
f(n), p();
|
|
58
|
+
}, b = () => {
|
|
59
|
+
f(void 0), d?.(void 0), l || p();
|
|
60
|
+
};
|
|
61
|
+
t.useLayoutEffect(() => {
|
|
62
|
+
R.current = { onDismiss: h, resolveFlash: () => "cancel" };
|
|
63
|
+
});
|
|
64
|
+
const X = n?.from ? `${N(n.from, k)}${n.to ? ` – ${N(n.to, k)}` : ""}` : "";
|
|
65
|
+
return /* @__PURE__ */ r(
|
|
66
|
+
ie,
|
|
67
|
+
{
|
|
68
|
+
open: i,
|
|
69
|
+
disabled: o,
|
|
70
|
+
ariaLabel: a("datePicker.selectYearRange"),
|
|
71
|
+
onOpenChange: (e) => {
|
|
72
|
+
o || c(e);
|
|
73
|
+
},
|
|
74
|
+
onOpenAutoFocus: (e) => {
|
|
75
|
+
u.current || e.preventDefault(), u.current = !1;
|
|
76
|
+
},
|
|
77
|
+
popoverHandlers: q,
|
|
78
|
+
trigger: /* @__PURE__ */ r(
|
|
79
|
+
"div",
|
|
80
|
+
{
|
|
81
|
+
ref: P,
|
|
82
|
+
"data-component": "year-range-picker",
|
|
83
|
+
"data-state": i ? "open" : "closed",
|
|
84
|
+
onPointerDown: (e) => fe({
|
|
85
|
+
disabled: o,
|
|
86
|
+
event: e,
|
|
87
|
+
onOpen: () => c(!0),
|
|
88
|
+
focusField: () => m.current?.focus()
|
|
89
|
+
}),
|
|
90
|
+
children: /* @__PURE__ */ r(
|
|
91
|
+
re,
|
|
92
|
+
{
|
|
93
|
+
ref: m,
|
|
94
|
+
value: X,
|
|
95
|
+
readOnly: !0,
|
|
96
|
+
onKeyDown: (e) => le(e, {
|
|
97
|
+
disabled: o,
|
|
98
|
+
open: i,
|
|
99
|
+
onOpen: () => c(!0),
|
|
100
|
+
onCancel: h,
|
|
101
|
+
onKeyboardOpen: () => {
|
|
102
|
+
u.current = !0;
|
|
103
|
+
}
|
|
104
|
+
}),
|
|
105
|
+
onClick: () => !o && c(!0),
|
|
106
|
+
placeholder: H,
|
|
107
|
+
disabled: o,
|
|
108
|
+
"data-form-control": "input",
|
|
109
|
+
className: ee("cursor-pointer", O),
|
|
110
|
+
suffix: /* @__PURE__ */ g("div", { className: "flex items-center gap-1", children: [
|
|
111
|
+
n?.from && !o ? /* @__PURE__ */ g(x, { children: [
|
|
112
|
+
/* @__PURE__ */ r(D, { asChild: !0, children: /* @__PURE__ */ r(
|
|
113
|
+
"button",
|
|
114
|
+
{
|
|
115
|
+
type: "button",
|
|
116
|
+
tabIndex: 0,
|
|
117
|
+
"aria-label": a("calendar.clear"),
|
|
118
|
+
onClick: (e) => {
|
|
119
|
+
e.stopPropagation(), b();
|
|
120
|
+
},
|
|
121
|
+
className: "inline-flex size-4 items-center justify-center border-none bg-transparent p-0",
|
|
122
|
+
children: /* @__PURE__ */ r(Z, { className: "size-3 hover:text-content" })
|
|
123
|
+
}
|
|
124
|
+
) }),
|
|
125
|
+
/* @__PURE__ */ r(Y, { variant: "tertiary", side: "top", children: a("calendar.clear") })
|
|
126
|
+
] }) : null,
|
|
127
|
+
/* @__PURE__ */ g(x, { children: [
|
|
128
|
+
/* @__PURE__ */ r(D, { asChild: !0, children: /* @__PURE__ */ r(
|
|
129
|
+
"button",
|
|
130
|
+
{
|
|
131
|
+
type: "button",
|
|
132
|
+
tabIndex: 0,
|
|
133
|
+
"data-component": "calendar-trigger",
|
|
134
|
+
"aria-label": a("datePicker.selectYearRange"),
|
|
135
|
+
onClick: (e) => {
|
|
136
|
+
e.stopPropagation(), o || c((s) => !s);
|
|
137
|
+
},
|
|
138
|
+
className: "inline-flex items-center justify-center border-none bg-transparent p-0",
|
|
139
|
+
children: /* @__PURE__ */ r(_, { className: "h-4 w-4 text-secondary-foreground" })
|
|
140
|
+
}
|
|
141
|
+
) }),
|
|
142
|
+
/* @__PURE__ */ r(Y, { variant: "tertiary", side: "top", children: a("datePicker.selectYearRange") })
|
|
143
|
+
] })
|
|
144
|
+
] }),
|
|
145
|
+
...z
|
|
146
|
+
}
|
|
147
|
+
)
|
|
148
|
+
}
|
|
149
|
+
),
|
|
150
|
+
children: /* @__PURE__ */ r(
|
|
151
|
+
te,
|
|
152
|
+
{
|
|
153
|
+
pickerType: "year",
|
|
154
|
+
yearMode: "range",
|
|
155
|
+
selectedYear: C,
|
|
156
|
+
footerFlashKey: V,
|
|
157
|
+
footerFlashTarget: B,
|
|
158
|
+
onYearSelect: U,
|
|
159
|
+
month: G,
|
|
160
|
+
onMonthChange: J,
|
|
161
|
+
disabled: oe(v, A),
|
|
162
|
+
startMonth: I,
|
|
163
|
+
endMonth: M,
|
|
164
|
+
showFooter: l,
|
|
165
|
+
onApply: W,
|
|
166
|
+
onCancel: h,
|
|
167
|
+
onClear: b,
|
|
168
|
+
showIntervalCaption: $,
|
|
169
|
+
...Q
|
|
170
|
+
}
|
|
171
|
+
)
|
|
172
|
+
}
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
);
|
|
176
|
+
de.displayName = "YearRangePicker";
|
|
177
|
+
export {
|
|
178
|
+
de as YearRangePicker
|
|
179
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as i, jsx as l } from "react/jsx-runtime";
|
|
2
2
|
import * as n from "react";
|
|
3
3
|
import { ChevronRight as W } from "impact-nova-icons";
|
|
4
4
|
import { useVirtualizer as j } from "@tanstack/react-virtual";
|
|
@@ -8,25 +8,25 @@ import { useImpactNovaI18n as T } from "../../../i18n/use-impact-nova-i18n.js";
|
|
|
8
8
|
function $({
|
|
9
9
|
className: N,
|
|
10
10
|
items: d,
|
|
11
|
-
renderItem:
|
|
11
|
+
renderItem: R,
|
|
12
12
|
scrollStep: p = 200,
|
|
13
13
|
hideScrollbar: u = !0,
|
|
14
14
|
controlsPosition: v = "right",
|
|
15
15
|
renderPrevious: x,
|
|
16
16
|
renderNext: g,
|
|
17
|
-
maxWidth:
|
|
17
|
+
maxWidth: L = "100%",
|
|
18
18
|
estimateSize: m = 200,
|
|
19
|
-
overscan:
|
|
19
|
+
overscan: C = 5,
|
|
20
20
|
...B
|
|
21
21
|
}, E) {
|
|
22
|
-
const { t:
|
|
22
|
+
const { t: w } = T(), r = n.useRef(null), [o, H] = n.useState(!1), [s, I] = n.useState(!1);
|
|
23
23
|
n.useImperativeHandle(E, () => r.current);
|
|
24
24
|
const c = j({
|
|
25
25
|
count: d.length,
|
|
26
26
|
getScrollElement: () => r.current,
|
|
27
27
|
estimateSize: typeof m == "function" ? m : () => m,
|
|
28
28
|
horizontal: !0,
|
|
29
|
-
overscan:
|
|
29
|
+
overscan: C
|
|
30
30
|
}), V = c.getTotalSize(), f = n.useCallback(() => {
|
|
31
31
|
const e = r.current;
|
|
32
32
|
e && (H(e.scrollLeft > 0), I(
|
|
@@ -37,27 +37,23 @@ function $({
|
|
|
37
37
|
const e = r.current;
|
|
38
38
|
if (!e) return;
|
|
39
39
|
f();
|
|
40
|
-
const
|
|
41
|
-
e.addEventListener("scroll",
|
|
42
|
-
const
|
|
40
|
+
const t = () => f();
|
|
41
|
+
e.addEventListener("scroll", t);
|
|
42
|
+
const a = new ResizeObserver(() => {
|
|
43
43
|
f();
|
|
44
44
|
});
|
|
45
|
-
return
|
|
46
|
-
e.removeEventListener("scroll",
|
|
45
|
+
return a.observe(e), () => {
|
|
46
|
+
e.removeEventListener("scroll", t), a.disconnect();
|
|
47
47
|
};
|
|
48
48
|
}, [f, d, V]);
|
|
49
|
-
const
|
|
49
|
+
const z = () => {
|
|
50
50
|
r.current?.scrollBy({ left: -p, behavior: "smooth" });
|
|
51
|
-
},
|
|
51
|
+
}, b = () => {
|
|
52
52
|
r.current?.scrollBy({ left: p, behavior: "smooth" });
|
|
53
|
-
}, S = ({
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}) => {
|
|
58
|
-
if (i) return null;
|
|
59
|
-
const k = b(e === "left" ? "horizontalScroller.scrollLeft" : "horizontalScroller.scrollRight");
|
|
60
|
-
return /* @__PURE__ */ a(
|
|
53
|
+
}, S = (e, t, a) => {
|
|
54
|
+
if (a) return null;
|
|
55
|
+
const k = w(e === "left" ? "horizontalScroller.scrollLeft" : "horizontalScroller.scrollRight");
|
|
56
|
+
return /* @__PURE__ */ i(
|
|
61
57
|
O,
|
|
62
58
|
{
|
|
63
59
|
variant: "ghost",
|
|
@@ -65,67 +61,53 @@ function $({
|
|
|
65
61
|
className: h(
|
|
66
62
|
"h-8 w-8 rounded-md bg-canvas-muted text-content-tertiary hover:bg-brand-tint hover:text-brand"
|
|
67
63
|
),
|
|
68
|
-
onClick:
|
|
69
|
-
disabled:
|
|
64
|
+
onClick: t,
|
|
65
|
+
disabled: a,
|
|
70
66
|
"aria-label": k,
|
|
71
67
|
"data-component": e === "left" ? "horizontal-scroller-prev" : "horizontal-scroller-next",
|
|
72
68
|
children: [
|
|
73
|
-
/* @__PURE__ */
|
|
69
|
+
/* @__PURE__ */ l(
|
|
74
70
|
W,
|
|
75
71
|
{
|
|
76
72
|
className: h("h-4 w-4", e === "left" && "rotate-180")
|
|
77
73
|
}
|
|
78
74
|
),
|
|
79
|
-
/* @__PURE__ */
|
|
75
|
+
/* @__PURE__ */ l("span", { className: "sr-only", children: k })
|
|
80
76
|
]
|
|
81
77
|
}
|
|
82
78
|
);
|
|
83
79
|
}, y = (() => {
|
|
84
|
-
const e = x ? x({ onClick:
|
|
85
|
-
S,
|
|
86
|
-
{
|
|
87
|
-
direction: "left",
|
|
88
|
-
onClick: w,
|
|
89
|
-
disabled: !o
|
|
90
|
-
}
|
|
91
|
-
), l = g ? g({ onClick: z, disabled: !s }) : /* @__PURE__ */ t(
|
|
92
|
-
S,
|
|
93
|
-
{
|
|
94
|
-
direction: "right",
|
|
95
|
-
onClick: z,
|
|
96
|
-
disabled: !s
|
|
97
|
-
}
|
|
98
|
-
);
|
|
80
|
+
const e = x ? x({ onClick: z, disabled: !o }) : S("left", z, !o), t = g ? g({ onClick: b, disabled: !s }) : S("right", b, !s);
|
|
99
81
|
return v === "split" ? {
|
|
100
|
-
left: o ? /* @__PURE__ */
|
|
101
|
-
right: s ? /* @__PURE__ */
|
|
82
|
+
left: o ? /* @__PURE__ */ l("div", { className: "flex-shrink-0", children: e }) : null,
|
|
83
|
+
right: s ? /* @__PURE__ */ l("div", { className: "flex-shrink-0", children: t }) : null
|
|
102
84
|
} : v === "left" ? {
|
|
103
|
-
left: o || s ? /* @__PURE__ */
|
|
85
|
+
left: o || s ? /* @__PURE__ */ i("div", { className: "flex-shrink-0 flex items-center gap-1", children: [
|
|
104
86
|
e,
|
|
105
|
-
|
|
87
|
+
t
|
|
106
88
|
] }) : null,
|
|
107
89
|
right: null
|
|
108
90
|
} : {
|
|
109
91
|
left: null,
|
|
110
|
-
right: o || s ? /* @__PURE__ */
|
|
92
|
+
right: o || s ? /* @__PURE__ */ i("div", { className: "flex-shrink-0 flex items-center gap-1", children: [
|
|
111
93
|
e,
|
|
112
|
-
|
|
94
|
+
t
|
|
113
95
|
] }) : null
|
|
114
96
|
};
|
|
115
97
|
})();
|
|
116
|
-
return /* @__PURE__ */
|
|
98
|
+
return /* @__PURE__ */ i(
|
|
117
99
|
"div",
|
|
118
100
|
{
|
|
119
101
|
className: h(
|
|
120
102
|
"flex items-center gap-2 min-w-0 w-full bg-transparent",
|
|
121
103
|
N
|
|
122
104
|
),
|
|
123
|
-
style: { maxWidth:
|
|
105
|
+
style: { maxWidth: L },
|
|
124
106
|
"data-component": "horizontal-scroller",
|
|
125
107
|
...B,
|
|
126
108
|
children: [
|
|
127
109
|
y.left,
|
|
128
|
-
/* @__PURE__ */
|
|
110
|
+
/* @__PURE__ */ l(
|
|
129
111
|
"div",
|
|
130
112
|
{
|
|
131
113
|
ref: r,
|
|
@@ -140,7 +122,7 @@ function $({
|
|
|
140
122
|
msOverflowStyle: u ? "none" : "auto"
|
|
141
123
|
},
|
|
142
124
|
"data-component": "horizontal-scroller-viewport",
|
|
143
|
-
children: /* @__PURE__ */
|
|
125
|
+
children: /* @__PURE__ */ i(
|
|
144
126
|
"div",
|
|
145
127
|
{
|
|
146
128
|
style: {
|
|
@@ -149,7 +131,7 @@ function $({
|
|
|
149
131
|
position: "relative"
|
|
150
132
|
},
|
|
151
133
|
children: [
|
|
152
|
-
/* @__PURE__ */
|
|
134
|
+
/* @__PURE__ */ l(
|
|
153
135
|
"div",
|
|
154
136
|
{
|
|
155
137
|
style: {
|
|
@@ -158,13 +140,13 @@ function $({
|
|
|
158
140
|
}
|
|
159
141
|
}
|
|
160
142
|
),
|
|
161
|
-
c.getVirtualItems().map((e) => /* @__PURE__ */
|
|
143
|
+
c.getVirtualItems().map((e) => /* @__PURE__ */ l(
|
|
162
144
|
"div",
|
|
163
145
|
{
|
|
164
146
|
ref: c.measureElement,
|
|
165
147
|
"data-index": e.index,
|
|
166
148
|
className: "flex-shrink-0",
|
|
167
|
-
children:
|
|
149
|
+
children: R(d[e.index], e.index)
|
|
168
150
|
},
|
|
169
151
|
e.key
|
|
170
152
|
))
|