impact-nova 2.5.7 → 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.
Files changed (148) hide show
  1. package/dist/components/data/ag-grid-react/ag-grid.types.d.ts +2 -2
  2. package/dist/components/data/ag-grid-react/headers/components/date-filter-picker.d.ts +4 -2
  3. package/dist/components/data/ag-grid-react/headers/header-search-input.js +65 -65
  4. package/dist/components/data/ag-grid-react/headers/utils/date-utils.js +55 -48
  5. package/dist/components/data-display/calendar/calendar-apply-validation.d.ts +4 -2
  6. package/dist/components/data-display/calendar/calendar-apply-validation.js +80 -61
  7. package/dist/components/data-display/calendar/calendar-config.d.ts +13 -5
  8. package/dist/components/data-display/calendar/calendar-config.js +31 -20
  9. package/dist/components/data-display/calendar/calendar-day-button.js +43 -35
  10. package/dist/components/data-display/calendar/calendar-day-hover.d.ts +8 -0
  11. package/dist/components/data-display/calendar/calendar-day-hover.js +20 -0
  12. package/dist/components/data-display/calendar/calendar-day-picker-classnames.d.ts +8 -1
  13. package/dist/components/data-display/calendar/calendar-day-picker-classnames.js +40 -20
  14. package/dist/components/data-display/calendar/calendar-day-picker-components.d.ts +12 -1
  15. package/dist/components/data-display/calendar/calendar-day-picker-components.js +201 -108
  16. package/dist/components/data-display/calendar/calendar-day-picker-view.d.ts +11 -3
  17. package/dist/components/data-display/calendar/calendar-day-picker-view.js +136 -92
  18. package/dist/components/data-display/calendar/calendar-fiscal-labels.d.ts +38 -0
  19. package/dist/components/data-display/calendar/calendar-fiscal-labels.js +90 -0
  20. package/dist/components/data-display/calendar/calendar-footer-summary.d.ts +13 -4
  21. package/dist/components/data-display/calendar/calendar-footer-summary.js +101 -50
  22. package/dist/components/data-display/calendar/calendar-footer.d.ts +16 -7
  23. package/dist/components/data-display/calendar/calendar-footer.js +88 -66
  24. package/dist/components/data-display/calendar/calendar-gregorian-presets.d.ts +2 -0
  25. package/dist/components/data-display/calendar/calendar-gregorian-presets.js +26 -0
  26. package/dist/components/data-display/calendar/calendar-interval-caption.d.ts +1 -0
  27. package/dist/components/data-display/calendar/calendar-interval-caption.js +10 -0
  28. package/dist/components/data-display/calendar/calendar-interval-utils.d.ts +23 -0
  29. package/dist/components/data-display/calendar/calendar-interval-utils.js +154 -0
  30. package/dist/components/data-display/calendar/calendar-month-panes.d.ts +5 -1
  31. package/dist/components/data-display/calendar/calendar-month-panes.js +9 -7
  32. package/dist/components/data-display/calendar/calendar-month-picker-panel.d.ts +5 -1
  33. package/dist/components/data-display/calendar/calendar-month-picker-panel.js +76 -77
  34. package/dist/components/data-display/calendar/calendar-month-utils.d.ts +2 -0
  35. package/dist/components/data-display/calendar/calendar-month-utils.js +69 -60
  36. package/dist/components/data-display/calendar/calendar-padding-week.utils.d.ts +15 -0
  37. package/dist/components/data-display/calendar/calendar-padding-week.utils.js +22 -3
  38. package/dist/components/data-display/calendar/calendar-panel-context.d.ts +1 -1
  39. package/dist/components/data-display/calendar/calendar-period-cell.d.ts +18 -0
  40. package/dist/components/data-display/calendar/calendar-period-cell.js +89 -0
  41. package/dist/components/data-display/calendar/calendar-period-keyboard.d.ts +2 -0
  42. package/dist/components/data-display/calendar/calendar-period-keyboard.js +18 -0
  43. package/dist/components/data-display/calendar/calendar-preset-strip.d.ts +6 -0
  44. package/dist/components/data-display/calendar/calendar-preset-strip.js +26 -0
  45. package/dist/components/data-display/calendar/calendar-quarter-panes.d.ts +24 -0
  46. package/dist/components/data-display/calendar/calendar-quarter-panes.js +115 -0
  47. package/dist/components/data-display/calendar/calendar-quarter-utils.d.ts +19 -0
  48. package/dist/components/data-display/calendar/calendar-quarter-utils.js +95 -0
  49. package/dist/components/data-display/calendar/calendar-selection-appearance.d.ts +38 -0
  50. package/dist/components/data-display/calendar/calendar-selection-appearance.js +72 -0
  51. package/dist/components/data-display/calendar/calendar-selection.d.ts +20 -0
  52. package/dist/components/data-display/calendar/calendar-selection.js +31 -0
  53. package/dist/components/data-display/calendar/calendar-week-number-cell.d.ts +6 -1
  54. package/dist/components/data-display/calendar/calendar-week-number-cell.js +53 -38
  55. package/dist/components/data-display/calendar/calendar-week-number-header.d.ts +4 -0
  56. package/dist/components/data-display/calendar/calendar-week-number-header.js +15 -0
  57. package/dist/components/data-display/calendar/calendar-week-utils.d.ts +11 -3
  58. package/dist/components/data-display/calendar/calendar-week-utils.js +49 -42
  59. package/dist/components/data-display/calendar/calendar-year-panes.d.ts +18 -0
  60. package/dist/components/data-display/calendar/calendar-year-panes.js +98 -0
  61. package/dist/components/data-display/calendar/calendar-year-utils.d.ts +17 -0
  62. package/dist/components/data-display/calendar/calendar-year-utils.js +75 -0
  63. package/dist/components/data-display/calendar/calendar.d.ts +1 -1
  64. package/dist/components/data-display/calendar/calendar.js +303 -181
  65. package/dist/components/data-display/calendar/calendar.types.d.ts +53 -16
  66. package/dist/components/data-display/calendar/fiscal-period-caption-select.d.ts +7 -0
  67. package/dist/components/data-display/calendar/fiscal-period-caption-select.js +63 -0
  68. package/dist/components/data-display/calendar/index.d.ts +1 -1
  69. package/dist/components/data-display/calendar/use-calendar-day-picker-config.d.ts +12 -2
  70. package/dist/components/data-display/calendar/use-calendar-day-picker-config.js +92 -62
  71. package/dist/components/data-display/calendar/use-calendar-state.d.ts +31 -11
  72. package/dist/components/data-display/calendar/use-calendar-state.js +370 -163
  73. package/dist/components/data-display/calendar/use-fiscal-calendar.d.ts +5 -0
  74. package/dist/components/data-display/calendar/use-fiscal-calendar.js +24 -0
  75. package/dist/components/feedback/tooltip/overflow-tooltip.js +57 -57
  76. package/dist/components/forms/date-picker/date-input-behavior.d.ts +7 -0
  77. package/dist/components/forms/date-picker/date-input-behavior.js +28 -24
  78. package/dist/components/forms/date-picker/date-picker-shell.d.ts +13 -0
  79. package/dist/components/forms/date-picker/date-picker-shell.js +31 -0
  80. package/dist/components/forms/date-picker/date-picker.js +187 -167
  81. package/dist/components/forms/date-picker/date-picker.types.d.ts +90 -43
  82. package/dist/components/forms/date-picker/date-range-picker.js +273 -224
  83. package/dist/components/forms/date-picker/fiscal-pass-through.d.ts +13 -0
  84. package/dist/components/forms/date-picker/fiscal-pass-through.js +17 -0
  85. package/dist/components/forms/date-picker/fiscal-period-format.d.ts +9 -0
  86. package/dist/components/forms/date-picker/fiscal-period-format.js +50 -0
  87. package/dist/components/forms/date-picker/index.d.ts +12 -0
  88. package/dist/components/forms/date-picker/index.js +19 -7
  89. package/dist/components/forms/date-picker/month-picker.js +225 -182
  90. package/dist/components/forms/date-picker/month-range-picker.js +134 -110
  91. package/dist/components/forms/date-picker/multi-date-picker.js +77 -56
  92. package/dist/components/forms/date-picker/multi-month-picker.js +78 -57
  93. package/dist/components/forms/date-picker/multi-quarter-picker.d.ts +3 -0
  94. package/dist/components/forms/date-picker/multi-quarter-picker.js +177 -0
  95. package/dist/components/forms/date-picker/multi-week-picker.js +81 -70
  96. package/dist/components/forms/date-picker/multi-year-picker.d.ts +3 -0
  97. package/dist/components/forms/date-picker/multi-year-picker.js +179 -0
  98. package/dist/components/forms/date-picker/quarter-picker.d.ts +3 -0
  99. package/dist/components/forms/date-picker/quarter-picker.js +176 -0
  100. package/dist/components/forms/date-picker/quarter-range-picker.d.ts +3 -0
  101. package/dist/components/forms/date-picker/quarter-range-picker.js +177 -0
  102. package/dist/components/forms/date-picker/week-picker.js +148 -137
  103. package/dist/components/forms/date-picker/week-range-picker.js +216 -205
  104. package/dist/components/forms/date-picker/year-picker.d.ts +3 -0
  105. package/dist/components/forms/date-picker/year-picker.js +176 -0
  106. package/dist/components/forms/date-picker/year-range-picker.d.ts +3 -0
  107. package/dist/components/forms/date-picker/year-range-picker.js +179 -0
  108. package/dist/form-react/Fields/DateInputField.js +63 -58
  109. package/dist/form-react/Fields/DateRangeField.js +42 -37
  110. package/dist/form-react/Fields/MonthRangeField.js +50 -45
  111. package/dist/form-react/Fields/MultiWeekPickerField.js +7 -7
  112. package/dist/form-react/Fields/WeekRangePicker.js +44 -45
  113. package/dist/form-react/components/FieldRenderer.js +21 -23
  114. package/dist/form-react/registry/defaultFieldRegistrations.d.ts +9 -1
  115. package/dist/form-react/registry/defaultFieldRegistrations.js +27 -36
  116. package/dist/form-react/registry/resolveFieldComponent.d.ts +3 -2
  117. package/dist/form-react/registry/resolveFieldComponent.js +9 -133
  118. package/dist/form-react/types/fields.types.d.ts +19 -4
  119. package/dist/form-react/utils/date.utils.d.ts +1 -1
  120. package/dist/form-react/utils/date.utils.js +38 -38
  121. package/dist/i18n/defaultMessages.d.ts +19 -1
  122. package/dist/i18n/defaultMessages.js +37 -20
  123. package/dist/i18n/locales/de.js +18 -1
  124. package/dist/i18n/locales/es.js +18 -1
  125. package/dist/i18n/locales/hi.js +18 -1
  126. package/dist/i18n/locales/kn.js +18 -1
  127. package/dist/impact-nova-components.css +379 -3
  128. package/dist/impact-nova.css +1 -1
  129. package/dist/index.js +528 -516
  130. package/dist/lib/fiscal-calendar/build-year.d.ts +8 -0
  131. package/dist/lib/fiscal-calendar/build-year.js +173 -0
  132. package/dist/lib/fiscal-calendar/civil-date.d.ts +21 -0
  133. package/dist/lib/fiscal-calendar/civil-date.js +94 -0
  134. package/dist/lib/fiscal-calendar/index.d.ts +10 -0
  135. package/dist/lib/fiscal-calendar/index.js +40 -0
  136. package/dist/lib/fiscal-calendar/lookup.d.ts +4 -0
  137. package/dist/lib/fiscal-calendar/lookup.js +70 -0
  138. package/dist/lib/fiscal-calendar/presets.d.ts +8 -0
  139. package/dist/lib/fiscal-calendar/presets.js +99 -0
  140. package/dist/lib/fiscal-calendar/selection.d.ts +18 -0
  141. package/dist/lib/fiscal-calendar/selection.js +32 -0
  142. package/dist/lib/fiscal-calendar/types.d.ts +145 -0
  143. package/dist/lib/fiscal-calendar/types.js +10 -0
  144. package/dist/lib/fiscal-calendar/week-selection.d.ts +22 -0
  145. package/dist/lib/fiscal-calendar/week-selection.js +107 -0
  146. package/package.json +5 -1
  147. package/dist/lib/fiscal-calendar.d.ts +0 -62
  148. package/dist/lib/fiscal-calendar.js +0 -99
@@ -1,34 +1,38 @@
1
1
  import { jsx as u, jsxs as D } from "react/jsx-runtime";
2
2
  import * as s from "react";
3
- import { Cross as Ne, CalendarMonth as Ae } from "impact-nova-icons";
3
+ import { Cross as qe, CalendarMonth as Le } from "impact-nova-icons";
4
4
  import { cn as z } from "../../../lib/utils.js";
5
- import { usePickerDismissActionsRef as Oe, usePickerFooterDismissNudge as Ve, createRangePickerOpenChangeHandler as Ke, parseDateInput as H, normalizeOrderedRange as ee, compareMonthSelection as V, flashRangeReorder as te, isDateInputInvalid as re, resolveRangeFieldBlur as A, resolveRangePickerDismissFlash as je, handlePickerSurfacePointerDown as $e, deferRangeInputBlur as ze, maskDateInput as oe, resolveDateInputOnBlur as O } from "./date-input-behavior.js";
6
- import { useFieldChrome as He } from "../../../lib/primitives/use-field-chrome.js";
7
- import { Popover as qe, PopoverAnchor as Le, PopoverContent as Ge } from "../../feedback/popover/popover.js";
8
- import { Calendar as Je } from "../../data-display/calendar/calendar.js";
5
+ import { usePickerDismissActionsRef as Ge, usePickerFooterDismissNudge as Je, createRangePickerOpenChangeHandler as Qe, parseDateInput as H, normalizeOrderedRange as ee, compareMonthSelection as V, flashRangeReorder as te, isDateInputInvalid as re, resolveRangeFieldBlur as A, resolveRangePickerDismissFlash as Ue, handlePickerSurfacePointerDown as We, deferRangeInputBlur as Xe, maskDateInput as oe, resolveDateInputOnBlur as O } from "./date-input-behavior.js";
6
+ import { useFieldChrome as Ze } from "../../../lib/primitives/use-field-chrome.js";
7
+ import { Popover as _e, PopoverAnchor as Fe, PopoverContent as et } from "../../feedback/popover/popover.js";
8
+ import { Calendar as tt } from "../../data-display/calendar/calendar.js";
9
9
  import { Tooltip as ne, TooltipTrigger as se, TooltipContent as ie } from "../../feedback/tooltip/tooltip.js";
10
- import { useImpactNovaI18n as Qe } from "../../../i18n/use-impact-nova-i18n.js";
11
- import { coerceMonthRangeApply as Ue, isMonthRangeSelection as We } from "./calendar-selection-adapters.js";
12
- import { buildDateBoundsMatcher as Xe } from "../../../lib/date-bounds-matcher.js";
10
+ import { useImpactNovaI18n as rt } from "../../../i18n/use-impact-nova-i18n.js";
11
+ import { coerceMonthRangeApply as ot, isMonthRangeSelection as nt } from "./calendar-selection-adapters.js";
12
+ import { buildDateBoundsMatcher as st } from "../../../lib/date-bounds-matcher.js";
13
+ import { fiscalCalendarPassThrough as it } from "./fiscal-pass-through.js";
14
+ import { formatFiscalPeriod as at } from "./fiscal-period-format.js";
13
15
  const h = (t, n = "MM/YYYY") => {
14
- const E = (t.month + 1).toString().padStart(2, "0");
15
- return n === "YYYY/MM" ? `${t.year}/${E}` : `${E}/${t.year}`;
16
+ const E = at(t);
17
+ if (E) return E;
18
+ const k = (t.month + 1).toString().padStart(2, "0");
19
+ return n === "YYYY/MM" ? `${t.year}/${k}` : `${k}/${t.year}`;
16
20
  };
17
- function Ze(t, n) {
21
+ function ct(t, n) {
18
22
  if (!t && !n) return !0;
19
23
  if (!t || !n) return !1;
20
- const E = t.from === void 0 && n.from === void 0 || t.from !== void 0 && n.from !== void 0 && V(t.from, n.from) === 0, b = t.to === void 0 && n.to === void 0 || t.to !== void 0 && n.to !== void 0 && V(t.to, n.to) === 0;
21
- return E && b;
24
+ const E = t.from === void 0 && n.from === void 0 || t.from !== void 0 && n.from !== void 0 && V(t.from, n.from) === 0, k = t.to === void 0 && n.to === void 0 || t.to !== void 0 && n.to !== void 0 && V(t.to, n.to) === 0;
25
+ return E && k;
22
26
  }
23
- function P(t) {
27
+ function b(t) {
24
28
  return { month: t.getMonth(), year: t.getFullYear() };
25
29
  }
26
- const _e = s.forwardRef(
30
+ const ft = s.forwardRef(
27
31
  ({
28
32
  value: t,
29
33
  onChange: n,
30
34
  placeholder: E,
31
- minDate: b,
35
+ minDate: k,
32
36
  maxDate: ae,
33
37
  startMonth: ce,
34
38
  endMonth: fe,
@@ -36,36 +40,45 @@ const _e = s.forwardRef(
36
40
  disabled: c,
37
41
  className: de,
38
42
  error: le,
39
- isError: pe,
43
+ isError: me,
40
44
  size: q,
41
- label: me,
45
+ label: pe,
42
46
  helperText: ue,
43
47
  helperTextPosition: he = "absolute",
44
48
  required: ge,
45
- prefix: Fe,
46
- prefixClick: et,
49
+ prefix: dt,
50
+ prefixClick: lt,
47
51
  displayFormat: i = "MM/YYYY",
48
- ...Me
49
- }, Re) => {
50
- const L = le ?? pe, ye = He({
51
- label: me,
52
+ calendarKind: Me,
53
+ fiscalMode: Re,
54
+ granularity: ye,
55
+ fiscalMonthPattern: ke,
56
+ fiscalYearStartMonth: ve,
57
+ fiscalConfig: xe,
58
+ showPresets: Ye,
59
+ comparison: Ce,
60
+ onComparisonChange: Pe,
61
+ ...be
62
+ }, we) => {
63
+ const L = le ?? me, Ie = Ze({
64
+ label: pe,
52
65
  helperText: ue,
53
66
  helperTextPosition: he,
54
67
  error: L,
55
68
  required: ge,
56
69
  disabled: c ?? void 0,
57
70
  rootClassName: "w-full min-w-[240px]"
58
- }), { t: x } = Qe(), K = s.useRef(null), G = s.useRef(null), J = s.useRef(null), S = s.useRef(null), j = s.useRef(null), d = s.useMemo(
71
+ }), { t: Y } = rt(), K = s.useRef(null), G = s.useRef(null), J = s.useRef(null), S = s.useRef(null), j = s.useRef(null), d = s.useMemo(
59
72
  () => i === "YYYY/MM" ? "yyyy/MM" : "MM/yyyy",
60
73
  [i]
61
74
  );
62
- s.useImperativeHandle(Re, () => K.current);
63
- const [p, M] = s.useState(!1), Q = Oe(), { footerFlashKey: ke, footerFlashTarget: ve, popoverHandlers: xe } = Ve(g, p, Q, J), I = s.useRef(!1), [f, R] = s.useState(t), [m, k] = s.useState(t?.from ? h(t.from, i) : ""), [y, v] = s.useState(t?.to ? h(t.to, i) : ""), [Ye, w] = s.useState(() => t?.from ? new Date(t.from.year, t.from.month, 1) : b || /* @__PURE__ */ new Date());
75
+ s.useImperativeHandle(we, () => K.current);
76
+ const [m, M] = s.useState(!1), Q = Ge(), { footerFlashKey: De, footerFlashTarget: Ee, popoverHandlers: Se } = Je(g, m, Q, J), I = s.useRef(!1), [f, R] = s.useState(t), [p, v] = s.useState(t?.from ? h(t.from, i) : ""), [y, x] = s.useState(t?.to ? h(t.to, i) : ""), [Te, w] = s.useState(() => t?.from ? new Date(t.from.year, t.from.month, 1) : k || /* @__PURE__ */ new Date());
64
77
  s.useEffect(() => {
65
- k(t?.from ? h(t.from, i) : ""), v(t?.to ? h(t.to, i) : ""), R(t);
78
+ v(t?.from ? h(t.from, i) : ""), x(t?.to ? h(t.to, i) : ""), R(t);
66
79
  }, [t, i]);
67
- const Ce = s.useCallback(
68
- (e) => Ke({
80
+ const Be = s.useCallback(
81
+ (e) => Qe({
69
82
  disabled: c ?? void 0,
70
83
  showFooter: g,
71
84
  containerRef: S,
@@ -75,104 +88,104 @@ const _e = s.forwardRef(
75
88
  [c, g]
76
89
  ), U = s.useRef(!1);
77
90
  s.useEffect(() => {
78
- if (p && !U.current) {
79
- const e = H(m, d);
80
- e.parsed ? w(e.parsed) : f?.from ? w(new Date(f.from.year, f.from.month, 1)) : t?.from ? w(new Date(t.from.year, t.from.month, 1)) : b && w(b);
91
+ if (m && !U.current) {
92
+ const e = H(p, d);
93
+ e.parsed ? w(e.parsed) : f?.from ? w(new Date(f.from.year, f.from.month, 1)) : t?.from ? w(new Date(t.from.year, t.from.month, 1)) : k && w(k);
81
94
  }
82
- U.current = p;
83
- }, [p, m, d, f?.from, t?.from, b]);
84
- const be = (e) => {
85
- const r = We(e) ? e : void 0;
86
- R(r), r?.from && k(h(r.from, i)), r?.to && v(h(r.to, i)), !g && r?.from && r?.to && (r.from.month !== r.to.month || r.from.year !== r.to.year) && (n?.(r), M(!1));
95
+ U.current = m;
96
+ }, [m, p, d, f?.from, t?.from, k]);
97
+ const Ne = (e) => {
98
+ const r = nt(e) ? e : void 0;
99
+ R(r), r?.from && v(h(r.from, i)), r?.to && x(h(r.to, i)), !g && r?.from && r?.to && (r.from.month !== r.to.month || r.from.year !== r.to.year) && (n?.(r), M(!1));
87
100
  }, W = (e) => {
88
- const r = Ue(e, f), o = ee(r?.from, r?.to, V);
89
- o.swapped && (o.from && k(h(o.from, i)), o.to && v(h(o.to, i)), R({ from: o.from, to: o.to }), te(S.current)), n?.({ from: o.from, to: o.to }), M(!1);
101
+ const r = ot(e, f), o = ee(r?.from, r?.to, V);
102
+ o.swapped && (o.from && v(h(o.from, i)), o.to && x(h(o.to, i)), R({ from: o.from, to: o.to }), te(S.current)), n?.({ from: o.from, to: o.to }), M(!1);
90
103
  }, B = () => {
91
- R(t), k(t?.from ? h(t.from, i) : ""), v(t?.to ? h(t.to, i) : ""), M(!1);
104
+ R(t), v(t?.from ? h(t.from, i) : ""), x(t?.to ? h(t.to, i) : ""), M(!1);
92
105
  }, $ = () => {
93
- R(void 0), k(""), v(""), n?.(void 0), g || M(!1);
94
- }, Pe = (e) => {
95
- const r = oe(e.target.value, d, m);
96
- if (k(r), r === "") {
106
+ R(void 0), v(""), x(""), n?.(void 0), g || M(!1);
107
+ }, Ae = (e) => {
108
+ const r = oe(e.target.value, d, p);
109
+ if (v(r), r === "") {
97
110
  const l = { from: void 0, to: f?.to };
98
111
  R(l), g || n?.(l);
99
112
  return;
100
113
  }
101
114
  const { parsed: o, isValid: a } = H(r, d);
102
115
  if (a && o) {
103
- const T = { from: P(o), to: f?.to };
116
+ const T = { from: b(o), to: f?.to };
104
117
  R(T), w(o), g || n?.(T);
105
118
  }
106
- }, we = (e) => {
119
+ }, Oe = (e) => {
107
120
  const r = oe(e.target.value, d, y);
108
- if (v(r), r === "") {
121
+ if (x(r), r === "") {
109
122
  const l = { from: f?.from, to: void 0 };
110
123
  R(l), g || n?.(l);
111
124
  return;
112
125
  }
113
126
  const { parsed: o, isValid: a } = H(r, d);
114
127
  if (a && o) {
115
- const l = P(o), T = { from: f?.from, to: l };
128
+ const l = b(o), T = { from: f?.from, to: l };
116
129
  R(T), w(o), g || n?.(T);
117
130
  }
118
131
  }, N = s.useCallback((e, r) => {
119
132
  const o = ee(e, r, V);
120
- return o.swapped && (o.from && k(h(o.from, i)), o.to && v(h(o.to, i)), te(S.current)), { from: o.from, to: o.to };
121
- }, [i]), Ie = () => {
122
- const e = O(m, d, Y), r = O(y, d, C);
123
- e.resetToCommitted ? k(Y) : e.parsed && k(e.display), r.resetToCommitted ? v(C) : r.parsed && v(r.display);
124
- let o = e.parsed ? P(e.parsed) : f?.from, a = r.parsed ? P(r.parsed) : f?.to;
133
+ return o.swapped && (o.from && v(h(o.from, i)), o.to && x(h(o.to, i)), te(S.current)), { from: o.from, to: o.to };
134
+ }, [i]), Ve = () => {
135
+ const e = O(p, d, C), r = O(y, d, P);
136
+ e.resetToCommitted ? v(C) : e.parsed && v(e.display), r.resetToCommitted ? x(P) : r.parsed && x(r.display);
137
+ let o = e.parsed ? b(e.parsed) : f?.from, a = r.parsed ? b(r.parsed) : f?.to;
125
138
  if ({ from: o, to: a } = N(o, a), o || a) {
126
139
  const l = { from: o, to: a };
127
140
  R(l), n?.(l);
128
- } else !m && !y && (R(void 0), n?.(void 0));
141
+ } else !p && !y && (R(void 0), n?.(void 0));
129
142
  }, X = () => {
130
- ze(
143
+ Xe(
131
144
  S,
132
145
  j,
133
146
  () => {
134
- const e = A(m, d, Y), r = A(y, d, C);
135
- e.resetToCommitted ? k(Y) : e.parsed && k(e.display), r.resetToCommitted ? v(C) : r.parsed && v(r.display);
136
- let o = e.parsed ? P(e.parsed) : e.resetToCommitted ? t?.from : f?.from, a = r.parsed ? P(r.parsed) : r.resetToCommitted ? t?.to : f?.to;
147
+ const e = A(p, d, C), r = A(y, d, P);
148
+ e.resetToCommitted ? v(C) : e.parsed && v(e.display), r.resetToCommitted ? x(P) : r.parsed && x(r.display);
149
+ let o = e.parsed ? b(e.parsed) : e.resetToCommitted ? t?.from : f?.from, a = r.parsed ? b(r.parsed) : r.resetToCommitted ? t?.to : f?.to;
137
150
  o && a && ({ from: o, to: a } = N(o, a));
138
151
  const l = o || a ? { from: o, to: a } : void 0;
139
- R(l), g || (l ? n?.(l) : !m && !y && n?.(void 0));
152
+ R(l), g || (l ? n?.(l) : !p && !y && n?.(void 0));
140
153
  }
141
154
  );
142
155
  }, Z = () => {
143
- if (p && g) {
156
+ if (m && g) {
144
157
  W();
145
158
  return;
146
159
  }
147
- if (!p) {
160
+ if (!m) {
148
161
  if (g) {
149
- Ie();
162
+ Ve();
150
163
  return;
151
164
  }
152
- const e = O(m, d, Y), r = O(y, d, C);
165
+ const e = O(p, d, C), r = O(y, d, P);
153
166
  if (e.parsed || r.parsed) return;
154
167
  I.current = !0, M(!0);
155
168
  }
156
- }, Y = t?.from ? h(t.from, i) : "", C = t?.to ? h(t.to, i) : "", De = m !== Y, Ee = y !== C, Se = re(m, d), Te = re(y, d), _ = x("datePicker.startMonth"), F = x("datePicker.endMonth"), Be = s.useCallback(() => {
157
- const e = A(m, d, Y), r = A(y, d, C);
158
- let o = e.parsed ? P(e.parsed) : e.resetToCommitted ? t?.from : f?.from, a = r.parsed ? P(r.parsed) : r.resetToCommitted ? t?.to : f?.to;
169
+ }, C = t?.from ? h(t.from, i) : "", P = t?.to ? h(t.to, i) : "", Ke = p !== C, je = y !== P, $e = re(p, d), ze = re(y, d), _ = Y("datePicker.startMonth"), F = Y("datePicker.endMonth"), He = s.useCallback(() => {
170
+ const e = A(p, d, C), r = A(y, d, P);
171
+ let o = e.parsed ? b(e.parsed) : e.resetToCommitted ? t?.from : f?.from, a = r.parsed ? b(r.parsed) : r.resetToCommitted ? t?.to : f?.to;
159
172
  o && a && ({ from: o, to: a } = N(o, a));
160
173
  const l = o || a ? { from: o, to: a } : void 0;
161
- return je({
162
- startInput: m,
174
+ return Ue({
175
+ startInput: p,
163
176
  endInput: y,
164
- committedStart: Y,
165
- committedEnd: C,
177
+ committedStart: C,
178
+ committedEnd: P,
166
179
  committedRange: t,
167
180
  pendingRange: f,
168
181
  computeEffectiveRange: () => l,
169
- rangesEqual: Ze
182
+ rangesEqual: ct
170
183
  });
171
184
  }, [
172
- m,
185
+ p,
173
186
  y,
174
- Y,
175
187
  C,
188
+ P,
176
189
  t,
177
190
  f,
178
191
  d,
@@ -181,7 +194,7 @@ const _e = s.forwardRef(
181
194
  return s.useLayoutEffect(() => {
182
195
  Q.current = {
183
196
  onDismiss: B,
184
- resolveFlash: Be
197
+ resolveFlash: He
185
198
  };
186
199
  }), /* @__PURE__ */ u(
187
200
  "div",
@@ -189,14 +202,14 @@ const _e = s.forwardRef(
189
202
  ref: J,
190
203
  "data-component": "month-range-picker",
191
204
  "data-disabled": c || void 0,
192
- children: ye.wrapControl(
193
- /* @__PURE__ */ D(qe, { open: c ? !1 : p, onOpenChange: Ce, children: [
194
- /* @__PURE__ */ u(Le, { asChild: !0, children: /* @__PURE__ */ D(
205
+ children: Ie.wrapControl(
206
+ /* @__PURE__ */ D(_e, { open: c ? !1 : m, onOpenChange: Be, children: [
207
+ /* @__PURE__ */ u(Fe, { asChild: !0, children: /* @__PURE__ */ D(
195
208
  "div",
196
209
  {
197
210
  ref: S,
198
- "data-state": p ? "open" : "closed",
199
- onPointerDown: (e) => $e({
211
+ "data-state": m ? "open" : "closed",
212
+ onPointerDown: (e) => We({
200
213
  disabled: c,
201
214
  event: e,
202
215
  onOpen: () => M(!0),
@@ -219,22 +232,22 @@ const _e = s.forwardRef(
219
232
  {
220
233
  ref: K,
221
234
  type: "text",
222
- value: m,
223
- onChange: Pe,
235
+ value: p,
236
+ onChange: Ae,
224
237
  onBlur: X,
225
238
  onClick: () => !c && M(!0),
226
239
  onKeyDown: (e) => {
227
- e.key === "Enter" && !c && (e.preventDefault(), Z()), e.key === "ArrowDown" && !p && !c && (e.preventDefault(), I.current = !0, M(!0)), e.key === "Escape" && p && (e.preventDefault(), B());
240
+ e.key === "Enter" && !c && (e.preventDefault(), Z()), e.key === "ArrowDown" && !m && !c && (e.preventDefault(), I.current = !0, M(!0)), e.key === "Escape" && m && (e.preventDefault(), B());
228
241
  },
229
- placeholder: p ? i === "YYYY/MM" ? "YYYY/MM" : x("datePicker.monthYearFormat") : _,
242
+ placeholder: m ? i === "YYYY/MM" ? "YYYY/MM" : Y("datePicker.monthYearFormat") : _,
230
243
  disabled: !!c,
231
244
  "aria-label": _,
232
245
  "data-field": "start",
233
246
  className: z(
234
247
  "flex-1 min-w-0 bg-transparent p-0 text-sm font-medium outline-none placeholder:font-medium placeholder:text-content-empty disabled:cursor-not-allowed disabled:opacity-50",
235
- Se ? "text-destructive" : De ? "text-content-placeholder" : ""
248
+ $e ? "text-destructive" : Ke ? "text-content-placeholder" : ""
236
249
  ),
237
- ...Me
250
+ ...be
238
251
  }
239
252
  ),
240
253
  /* @__PURE__ */ u(
@@ -243,19 +256,19 @@ const _e = s.forwardRef(
243
256
  ref: G,
244
257
  type: "text",
245
258
  value: y,
246
- onChange: we,
259
+ onChange: Oe,
247
260
  onBlur: X,
248
261
  onClick: () => !c && M(!0),
249
262
  onKeyDown: (e) => {
250
- e.key === "Enter" && !c && (e.preventDefault(), Z()), e.key === "ArrowDown" && !p && !c && (e.preventDefault(), I.current = !0, M(!0)), e.key === "Escape" && p && (e.preventDefault(), B());
263
+ e.key === "Enter" && !c && (e.preventDefault(), Z()), e.key === "ArrowDown" && !m && !c && (e.preventDefault(), I.current = !0, M(!0)), e.key === "Escape" && m && (e.preventDefault(), B());
251
264
  },
252
- placeholder: p ? i === "YYYY/MM" ? "YYYY/MM" : x("datePicker.monthYearFormat") : F,
265
+ placeholder: m ? i === "YYYY/MM" ? "YYYY/MM" : Y("datePicker.monthYearFormat") : F,
253
266
  disabled: !!c,
254
267
  "aria-label": F,
255
268
  "data-field": "end",
256
269
  className: z(
257
270
  "flex-1 min-w-0 bg-transparent p-0 text-sm font-medium outline-none placeholder:font-medium placeholder:text-content-empty disabled:cursor-not-allowed disabled:opacity-50",
258
- Te ? "text-destructive" : Ee ? "text-content-placeholder" : ""
271
+ ze ? "text-destructive" : je ? "text-content-placeholder" : ""
259
272
  )
260
273
  }
261
274
  )
@@ -267,7 +280,7 @@ const _e = s.forwardRef(
267
280
  {
268
281
  type: "button",
269
282
  tabIndex: 0,
270
- "aria-label": x("calendar.clear"),
283
+ "aria-label": Y("calendar.clear"),
271
284
  onClick: (e) => {
272
285
  e.stopPropagation(), $();
273
286
  },
@@ -275,52 +288,63 @@ const _e = s.forwardRef(
275
288
  (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), $());
276
289
  },
277
290
  className: "inline-flex size-4 items-center justify-center bg-transparent border-none p-0 cursor-pointer",
278
- children: /* @__PURE__ */ u(Ne, { className: "size-3 hover:text-content text-content-icon" })
291
+ children: /* @__PURE__ */ u(qe, { className: "size-3 hover:text-content text-content-icon" })
279
292
  }
280
293
  ) }),
281
- /* @__PURE__ */ u(ie, { variant: "tertiary", side: "top", children: x("calendar.clear") })
294
+ /* @__PURE__ */ u(ie, { variant: "tertiary", side: "top", children: Y("calendar.clear") })
282
295
  ] }),
283
296
  /* @__PURE__ */ D(ne, { children: [
284
- /* @__PURE__ */ u(se, { asChild: !0, children: /* @__PURE__ */ u("button", { type: "button", tabIndex: 0, "aria-label": x("datePicker.selectMonthRange"), onClick: (e) => {
285
- e.stopPropagation(), c || M(!p);
297
+ /* @__PURE__ */ u(se, { asChild: !0, children: /* @__PURE__ */ u("button", { type: "button", tabIndex: 0, "aria-label": Y("datePicker.selectMonthRange"), onClick: (e) => {
298
+ e.stopPropagation(), c || M(!m);
286
299
  }, onKeyDown: (e) => {
287
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), c || (I.current = !0, M(!p)));
288
- }, className: "inline-flex items-center justify-center bg-transparent border-none p-0 cursor-pointer", children: /* @__PURE__ */ u(Ae, { className: "h-4 w-4 text-secondary-foreground" }) }) }),
289
- /* @__PURE__ */ u(ie, { variant: "tertiary", side: "top", children: x("datePicker.selectMonthRange") })
300
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), e.stopPropagation(), c || (I.current = !0, M(!m)));
301
+ }, className: "inline-flex items-center justify-center bg-transparent border-none p-0 cursor-pointer", children: /* @__PURE__ */ u(Le, { className: "h-4 w-4 text-secondary-foreground" }) }) }),
302
+ /* @__PURE__ */ u(ie, { variant: "tertiary", side: "top", children: Y("datePicker.selectMonthRange") })
290
303
  ] })
291
304
  ] })
292
305
  ]
293
306
  }
294
307
  ) }),
295
308
  /* @__PURE__ */ u(
296
- Ge,
309
+ et,
297
310
  {
298
311
  ref: j,
299
312
  className: "w-auto p-0",
300
313
  align: "start",
301
- "aria-label": x("datePicker.selectMonthRange"),
314
+ "aria-label": Y("datePicker.selectMonthRange"),
302
315
  onOpenAutoFocus: (e) => {
303
316
  I.current || e.preventDefault(), I.current = !1;
304
317
  },
305
- ...xe,
318
+ ...Se,
306
319
  children: /* @__PURE__ */ u(
307
- Je,
320
+ tt,
308
321
  {
309
322
  pickerType: "month",
310
323
  monthMode: "range",
311
324
  selectedMonths: f,
312
- footerFlashKey: ke,
313
- footerFlashTarget: ve,
314
- onMonthSelect: be,
315
- month: Ye,
325
+ footerFlashKey: De,
326
+ footerFlashTarget: Ee,
327
+ onMonthSelect: Ne,
328
+ month: Te,
316
329
  onMonthChange: w,
317
- disabled: Xe(b, ae),
330
+ disabled: st(k, ae),
318
331
  startMonth: ce,
319
332
  endMonth: fe,
320
333
  showFooter: g,
321
334
  onApply: W,
322
335
  onCancel: B,
323
- onClear: $
336
+ onClear: $,
337
+ ...it({
338
+ calendarKind: Me,
339
+ fiscalMode: Re,
340
+ granularity: ye,
341
+ fiscalMonthPattern: ke,
342
+ fiscalYearStartMonth: ve,
343
+ fiscalConfig: xe,
344
+ showPresets: Ye,
345
+ comparison: Ce,
346
+ onComparisonChange: Pe
347
+ })
324
348
  }
325
349
  )
326
350
  }
@@ -331,7 +355,7 @@ const _e = s.forwardRef(
331
355
  );
332
356
  }
333
357
  );
334
- _e.displayName = "MonthRangePicker";
358
+ ft.displayName = "MonthRangePicker";
335
359
  export {
336
- _e as MonthRangePicker
360
+ ft as MonthRangePicker
337
361
  };