impact-nova 2.5.13 → 2.5.14

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/data-table/build-column-tree-from-grid.d.ts +0 -1
  2. package/dist/components/data/data-table/build-column-tree-from-grid.js +50 -55
  3. package/dist/components/data/data-table/data-table-column-apply.d.ts +0 -2
  4. package/dist/components/data/data-table/data-table-column-apply.js +73 -84
  5. package/dist/components/data/data-table/data-table-column-list.js +64 -94
  6. package/dist/components/data/data-table/data-table-column-tree-cache.d.ts +6 -12
  7. package/dist/components/data/data-table/data-table-column-tree-cache.js +131 -250
  8. package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.d.ts +0 -5
  9. package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.js +11 -28
  10. package/dist/components/data/data-table/use-data-table-column-list-sync.d.ts +0 -10
  11. package/dist/components/data/data-table/use-data-table-column-list-sync.js +196 -250
  12. package/dist/components/data/expandable-list-item/expandable-list-item-attributes.js +3 -2
  13. package/dist/components/data/expandable-list-item/expandable-list-item-metrics.js +3 -2
  14. package/dist/components/data/nested-list/components/NestedListContent.d.ts +2 -10
  15. package/dist/components/data/nested-list/components/NestedListContent.js +138 -253
  16. package/dist/components/data/nested-list/components/SortableItem.d.ts +1 -2
  17. package/dist/components/data/nested-list/components/SortableItem.js +60 -62
  18. package/dist/components/data/nested-list/hooks/useNestedListDragDrop.d.ts +20 -10
  19. package/dist/components/data/nested-list/hooks/useNestedListDragDrop.js +233 -44
  20. package/dist/components/data/nested-list/nested-list-constants.d.ts +1 -4
  21. package/dist/components/data/nested-list/nested-list-constants.js +4 -10
  22. package/dist/components/data/nested-list/nested-list.js +336 -322
  23. package/dist/components/data/nested-list/nested-list.types.d.ts +0 -17
  24. package/dist/components/data-display/calendar/calendar-apply-validation.d.ts +2 -0
  25. package/dist/components/data-display/calendar/calendar-apply-validation.js +64 -67
  26. package/dist/components/data-display/calendar/calendar-available-view.d.ts +27 -0
  27. package/dist/components/data-display/calendar/calendar-available-view.js +85 -0
  28. package/dist/components/data-display/calendar/calendar-config.js +1 -1
  29. package/dist/components/data-display/calendar/calendar-day-picker-components.d.ts +4 -2
  30. package/dist/components/data-display/calendar/calendar-day-picker-components.js +234 -164
  31. package/dist/components/data-display/calendar/calendar-day-picker-view.js +77 -76
  32. package/dist/components/data-display/calendar/calendar-fiscal-day-cell.d.ts +9 -0
  33. package/dist/components/data-display/calendar/calendar-fiscal-day-cell.js +45 -0
  34. package/dist/components/data-display/calendar/calendar-fiscal-period-nav.d.ts +6 -0
  35. package/dist/components/data-display/calendar/calendar-fiscal-period-nav.js +34 -18
  36. package/dist/components/data-display/calendar/calendar-footer.js +21 -21
  37. package/dist/components/data-display/calendar/calendar-injected-week-row.d.ts +5 -0
  38. package/dist/components/data-display/calendar/calendar-injected-week-row.js +92 -0
  39. package/dist/components/data-display/calendar/calendar-leading-week.utils.d.ts +16 -0
  40. package/dist/components/data-display/calendar/calendar-leading-week.utils.js +51 -0
  41. package/dist/components/data-display/calendar/calendar-month-picker-panel.js +50 -49
  42. package/dist/components/data-display/calendar/calendar-month-utils.d.ts +5 -0
  43. package/dist/components/data-display/calendar/calendar-month-utils.js +85 -64
  44. package/dist/components/data-display/calendar/calendar-orphan-week.d.ts +23 -0
  45. package/dist/components/data-display/calendar/calendar-padding-week.utils.d.ts +3 -1
  46. package/dist/components/data-display/calendar/calendar-padding-week.utils.js +7 -5
  47. package/dist/components/data-display/calendar/calendar-period-cell.js +45 -46
  48. package/dist/components/data-display/calendar/calendar-quarter-panes.js +33 -31
  49. package/dist/components/data-display/calendar/calendar-selection-appearance.d.ts +10 -0
  50. package/dist/components/data-display/calendar/calendar-selection-appearance.js +53 -39
  51. package/dist/components/data-display/calendar/calendar-selection.d.ts +25 -0
  52. package/dist/components/data-display/calendar/calendar-selection.js +52 -23
  53. package/dist/components/data-display/calendar/calendar-week-number-cell.d.ts +2 -1
  54. package/dist/components/data-display/calendar/calendar-week-number-cell.js +59 -45
  55. package/dist/components/data-display/calendar/calendar-week-utils.d.ts +15 -4
  56. package/dist/components/data-display/calendar/calendar-week-utils.js +59 -50
  57. package/dist/components/data-display/calendar/calendar-year-panes.d.ts +3 -0
  58. package/dist/components/data-display/calendar/calendar-year-panes.js +53 -49
  59. package/dist/components/data-display/calendar/calendar.js +146 -143
  60. package/dist/components/data-display/calendar/calendar.types.d.ts +5 -0
  61. package/dist/components/data-display/calendar/use-calendar-day-picker-config.d.ts +2 -1
  62. package/dist/components/data-display/calendar/use-calendar-day-picker-config.js +79 -74
  63. package/dist/components/data-display/calendar/use-calendar-state.d.ts +3 -1
  64. package/dist/components/data-display/calendar/use-calendar-state.js +394 -314
  65. package/dist/components/feedback/tooltip/tab-tooltip-render.js +3 -2
  66. package/dist/components/flows/command-palette/shortcut-settings.js +10 -10
  67. package/dist/components/flows/filter-panel/filter-panel.js +4 -4
  68. package/dist/components/forms/date-picker/date-picker.js +60 -58
  69. package/dist/components/forms/date-picker/date-picker.types.d.ts +5 -0
  70. package/dist/components/forms/date-picker/date-range-picker.js +66 -64
  71. package/dist/components/forms/date-picker/fiscal-pass-through.d.ts +1 -0
  72. package/dist/components/forms/date-picker/fiscal-pass-through.js +3 -2
  73. package/dist/components/forms/date-picker/fiscal-picker-fixtures.d.ts +17 -0
  74. package/dist/components/forms/date-picker/month-picker.js +61 -59
  75. package/dist/components/forms/date-picker/month-range-picker.js +63 -61
  76. package/dist/components/forms/date-picker/multi-date-picker.js +51 -49
  77. package/dist/components/forms/date-picker/multi-month-picker.js +49 -47
  78. package/dist/components/forms/date-picker/multi-quarter-picker.js +51 -47
  79. package/dist/components/forms/date-picker/multi-week-picker.js +53 -51
  80. package/dist/components/forms/date-picker/multi-year-picker.js +53 -49
  81. package/dist/components/forms/date-picker/quarter-picker.js +51 -47
  82. package/dist/components/forms/date-picker/quarter-range-picker.js +50 -46
  83. package/dist/components/forms/date-picker/week-picker.js +130 -126
  84. package/dist/components/forms/date-picker/week-range-picker.js +159 -155
  85. package/dist/components/forms/date-picker/year-picker.js +52 -48
  86. package/dist/components/forms/date-picker/year-range-picker.js +52 -48
  87. package/dist/components/forms/select/components/SelectTriggerValue.js +3 -2
  88. package/dist/components/forms/select/components/Submenu.js +3 -2
  89. package/dist/form-react/Fields/DateInputField.js +51 -50
  90. package/dist/form-react/Fields/DateRangeField.js +14 -13
  91. package/dist/form-react/Fields/MonthRangeField.js +29 -28
  92. package/dist/form-react/Fields/MultiMonthPickerField.js +13 -12
  93. package/dist/form-react/Fields/MultiWeekPickerField.js +35 -27
  94. package/dist/form-react/Fields/MultiYearPickerField.d.ts +8 -0
  95. package/dist/form-react/Fields/MultiYearPickerField.js +57 -0
  96. package/dist/form-react/Fields/WeekRangePicker.js +33 -32
  97. package/dist/form-react/Fields/YearPickerField.d.ts +8 -0
  98. package/dist/form-react/Fields/YearPickerField.js +57 -0
  99. package/dist/form-react/Fields/YearRangePickerField.d.ts +8 -0
  100. package/dist/form-react/Fields/YearRangePickerField.js +57 -0
  101. package/dist/form-react/registry/defaultFieldRegistrations.d.ts +1 -1
  102. package/dist/form-react/registry/defaultFieldRegistrations.js +16 -13
  103. package/dist/form-react/types/fields.types.d.ts +69 -1
  104. package/dist/form-react/types/fieldsOutput.types.d.ts +8 -2
  105. package/dist/form-react/utils/fieldDefaults.utils.js +1 -1
  106. package/dist/impact-nova-components.css +13 -6
  107. package/dist/impact-nova.css +1 -1
  108. package/dist/lib/fiscal-calendar/index.d.ts +2 -2
  109. package/dist/lib/fiscal-calendar/index.js +26 -28
  110. package/dist/lib/fiscal-calendar/types.d.ts +0 -7
  111. package/dist/lib/fiscal-calendar/week-selection.d.ts +3 -4
  112. package/dist/lib/fiscal-calendar/week-selection.js +52 -79
  113. package/dist/llms/rules/ag-grid.js +1 -1
  114. package/dist/llms/rules/installation.js +1 -1
  115. package/dist/llms/rules/requirements.js +1 -1
  116. package/package.json +1 -1
  117. package/dist/components/data/data-table/column-picker-authority.d.ts +0 -34
  118. package/dist/components/data/data-table/column-picker-authority.js +0 -116
  119. package/dist/components/data/data-table/column-picker-drop-validation.d.ts +0 -7
  120. package/dist/components/data/data-table/column-picker-drop-validation.js +0 -37
  121. package/dist/components/data/data-table/data-table-column-list-tree-apply.d.ts +0 -10
  122. package/dist/components/data/data-table/data-table-column-list-tree-apply.js +0 -79
  123. package/dist/components/data/data-table/data-table-flat-column-virtual-rows.d.ts +0 -26
  124. package/dist/components/data/data-table/data-table-flat-column-virtual-rows.js +0 -195
  125. package/dist/components/data/data-table/data-table-picker-column-eligibility.d.ts +0 -1
  126. package/dist/components/data/data-table/data-table-picker-column-eligibility.js +0 -7
  127. package/dist/components/data/data-table/reconcile-column-tree-from-grid.d.ts +0 -12
  128. package/dist/components/data/data-table/reconcile-column-tree-from-grid.js +0 -12
  129. package/dist/components/data/nested-list/hooks/useVirtualNestedListDrag.d.ts +0 -24
  130. package/dist/components/data/nested-list/hooks/useVirtualNestedListDrag.js +0 -128
  131. package/dist/components/data/nested-list/nested-list-display-utils.d.ts +0 -11
  132. package/dist/components/data/nested-list/nested-list-display-utils.js +0 -74
  133. package/dist/components/data/nested-list/nested-list-drop-engine.d.ts +0 -31
  134. package/dist/components/data/nested-list/nested-list-drop-engine.js +0 -209
  135. package/dist/components/data/nested-list/nested-list-flat-virtual-handlers.d.ts +0 -26
  136. package/dist/components/data/nested-list/nested-list-flat-virtual-handlers.js +0 -67
  137. package/dist/components/data/nested-list/nested-list-item-tree-mutations.d.ts +0 -4
  138. package/dist/components/data/nested-list/nested-list-item-tree-mutations.js +0 -43
  139. package/dist/components/data/nested-list/nested-list-lazy-flat-rows.d.ts +0 -3
  140. package/dist/components/data/nested-list/nested-list-lazy-flat-rows.js +0 -34
  141. package/dist/components/data/nested-list/nested-list-row-estimates.d.ts +0 -9
  142. package/dist/components/data/nested-list/nested-list-row-estimates.js +0 -14
  143. package/dist/components/data/nested-list/nested-list-scroll-anchor.d.ts +0 -36
  144. package/dist/components/data/nested-list/nested-list-scroll-anchor.js +0 -47
  145. package/dist/components/data/nested-list/nested-list-virtual-drop.d.ts +0 -59
  146. package/dist/components/data/nested-list/nested-list-virtual-drop.js +0 -341
  147. package/dist/lib/hash/fnv1a128.d.ts +0 -16
  148. package/dist/lib/hash/fnv1a128.js +0 -21
@@ -1,295 +1,365 @@
1
- import { jsx as i, jsxs as q } from "react/jsx-runtime";
2
- import * as v from "react";
3
- import { useDayPicker as le } from "react-day-picker";
4
- import { ChevronRight as J } from "impact-nova-icons";
5
- import { cn as y } from "../../../lib/utils.js";
6
- import { Button as M } from "../../primitives/button/button.js";
7
- import { Select as Q } from "../../forms/select/select.js";
8
- import { CalendarCaptionHeader as ce } from "./calendar-caption-header.js";
9
- import { CalendarDayButton as de } from "./calendar-day-button.js";
1
+ import { jsx as s, jsxs as A } from "react/jsx-runtime";
2
+ import * as y from "react";
3
+ import { useDayPicker as ue } from "react-day-picker";
4
+ import { ChevronRight as Q } from "impact-nova-icons";
5
+ import { cn as w } from "../../../lib/utils.js";
6
+ import { Button as U } from "../../primitives/button/button.js";
7
+ import { Select as X } from "../../forms/select/select.js";
8
+ import { CalendarCaptionHeader as fe } from "./calendar-caption-header.js";
9
+ import { CalendarDayButton as me } from "./calendar-day-button.js";
10
10
  import { PanelIndexContext as P } from "./calendar-panel-context.js";
11
- import { CalendarWeekNumberCell as me } from "./calendar-week-number-cell.js";
12
- import { paneCivilMonthIndex as fe } from "./calendar-week-number-header.js";
13
- import { buildFiscalYear as ue } from "../../../lib/fiscal-calendar/build-year.js";
14
- import { civilMonthAtOffset as N, midMonthDate as F, visibleMonthForPeriod as U, periodForCivilMonth as X } from "./calendar-fiscal-period-nav.js";
15
- import { getAvailableMonths as pe } from "./calendar-month-utils.js";
16
- import { isCalendarPaddingWeek as Z, weekHasInMonthSelection as he, weekIntervalContinues as ve } from "./calendar-padding-week.utils.js";
17
- import { isForeignFiscalWeekRow as $, fiscalPeriodForWeek as L } from "./calendar-week-utils.js";
18
- import { FiscalPeriodCaptionSelect as xe } from "./fiscal-period-caption-select.js";
19
- function I(D, h, d) {
20
- if (h != null && D)
11
+ import { CalendarWeekNumberCell as pe } from "./calendar-week-number-cell.js";
12
+ import { paneCivilMonthIndex as he } from "./calendar-week-number-header.js";
13
+ import { buildFiscalYear as ve } from "../../../lib/fiscal-calendar/build-year.js";
14
+ import { civilMonthAtOffset as S, midMonthDate as N, periodForFiscalYearChange as xe, visibleMonthForPeriod as Z, periodsAvailableInBounds as ye, periodForCivilMonth as $ } from "./calendar-fiscal-period-nav.js";
15
+ import { getAvailableMonths as ke, isWeekSelectableInBounds as we } from "./calendar-month-utils.js";
16
+ import { weekHasInMonthSelection as Pe, weekIntervalContinues as We } from "./calendar-padding-week.utils.js";
17
+ import { shouldHideCalendarWeekRow as L, fiscalPeriodForWeek as T, isOwnedFiscalWeekRow as De } from "./calendar-week-utils.js";
18
+ import { InjectedFiscalWeekRow as V } from "./calendar-injected-week-row.js";
19
+ import { FiscalDayCell as Ie } from "./calendar-fiscal-day-cell.js";
20
+ import { ownedWeeksOutsidePane as be, injectedWeekCollapseClass as ge } from "./calendar-leading-week.utils.js";
21
+ import { FiscalPeriodCaptionSelect as Fe } from "./fiscal-period-caption-select.js";
22
+ function O(m, v, d) {
23
+ if (v != null && m)
21
24
  try {
22
- return ue(D, h).periods;
25
+ return ve(m, v).periods;
23
26
  } catch {
24
27
  }
25
28
  return d ?? [];
26
29
  }
27
- function ze({
28
- buttonVariant: D,
29
- pickerType: h,
30
+ function K(m, v, d) {
31
+ const I = m.days[0]?.date, x = m.days[m.days.length - 1]?.date;
32
+ return !I || !x ? !1 : we(I, x, v, d);
33
+ }
34
+ function Se(m) {
35
+ return y.isValidElement(m) && !!m.props["aria-hidden"];
36
+ }
37
+ function Le({
38
+ buttonVariant: m,
39
+ pickerType: v,
30
40
  calendarKind: d,
41
+ granularity: I,
31
42
  currentMonth: x,
32
- monthsFull: g,
33
- monthsShort: T,
34
- resolvedStartMonth: V,
35
- resolvedEndMonth: K,
36
- availableYears: C,
37
- fiscalPeriods: S,
38
- fiscalConfig: W,
39
- weekStartsOn: ee,
40
- previousMonthLabel: A,
41
- nextMonthLabel: Y,
42
- monthPlaceholder: j,
43
- yearPlaceholder: te,
44
- weekNumberLabel: oe,
45
- weekNumberHeader: O,
46
- weekLabel: ne,
47
- fiscalWeekNumberLabel: re,
48
- fiscalWeekAriaLabel: ie,
49
- getCellMeta: c,
50
- onMonthChange: k,
51
- onWeekSelect: R,
52
- periodRowHover: z = !1,
53
- weekMode: B = "single",
54
- showPeriodBoundaries: se = !1,
55
- components: ae
43
+ monthsFull: R,
44
+ monthsShort: ee,
45
+ resolvedStartMonth: te,
46
+ resolvedEndMonth: oe,
47
+ availableYears: j,
48
+ fiscalPeriods: C,
49
+ fiscalConfig: k,
50
+ weekStartsOn: ne,
51
+ previousMonthLabel: B,
52
+ nextMonthLabel: z,
53
+ monthPlaceholder: _,
54
+ yearPlaceholder: re,
55
+ weekNumberLabel: ie,
56
+ weekNumberHeader: E,
57
+ weekLabel: se,
58
+ fiscalWeekNumberLabel: ae,
59
+ fiscalWeekAriaLabel: le,
60
+ getCellMeta: u,
61
+ onMonthChange: W,
62
+ onWeekSelect: H,
63
+ periodRowHover: G = !1,
64
+ weekMode: M = "single",
65
+ showPeriodBoundaries: de = !1,
66
+ disabled: F,
67
+ components: ce
56
68
  }) {
57
- function _(e) {
69
+ function Y(e) {
58
70
  if (d !== "fiscal") return;
59
- const t = N(x, e);
60
- return X(
61
- I(
62
- W,
63
- c?.(F(t))?.fy ?? c?.(t)?.fy,
64
- S
71
+ const t = S(x, e);
72
+ return $(
73
+ O(
74
+ k,
75
+ u?.(N(t))?.fy ?? u?.(t)?.fy,
76
+ C
65
77
  ),
66
78
  t.getFullYear(),
67
79
  t.getMonth()
68
80
  )?.period;
69
81
  }
70
82
  return {
71
- Root: ({ className: e, rootRef: t, ...o }) => /* @__PURE__ */ i("div", { "data-slot": "calendar", ref: t, className: y(e), ...o }),
72
- Chevron: ({ className: e, orientation: t, ...o }) => t === "left" ? /* @__PURE__ */ i(
73
- J,
83
+ Root: ({ className: e, rootRef: t, ...o }) => /* @__PURE__ */ s("div", { "data-slot": "calendar", ref: t, className: w(e), ...o }),
84
+ Chevron: ({ className: e, orientation: t, ...o }) => t === "left" ? /* @__PURE__ */ s(
85
+ Q,
74
86
  {
75
87
  size: 16,
76
- className: y("rotate-180 text-content", e),
88
+ className: w("rotate-180 text-content", e),
77
89
  ...o
78
90
  }
79
- ) : t === "right" ? /* @__PURE__ */ i(J, { size: 16, className: y("text-content", e), ...o }) : /* @__PURE__ */ i("span", {}),
80
- PreviousMonthButton: (e) => /* @__PURE__ */ i(
81
- M,
91
+ ) : t === "right" ? /* @__PURE__ */ s(Q, { size: 16, className: w("text-content", e), ...o }) : /* @__PURE__ */ s("span", {}),
92
+ PreviousMonthButton: (e) => /* @__PURE__ */ s(
93
+ U,
82
94
  {
83
- variant: D,
95
+ variant: m,
84
96
  size: "icon",
85
97
  className: "h-7 w-7",
86
- "aria-label": A,
87
- title: A,
98
+ "aria-label": B,
99
+ title: B,
88
100
  ...e
89
101
  }
90
102
  ),
91
- NextMonthButton: (e) => /* @__PURE__ */ i(
92
- M,
103
+ NextMonthButton: (e) => /* @__PURE__ */ s(
104
+ U,
93
105
  {
94
- variant: D,
106
+ variant: m,
95
107
  size: "icon",
96
108
  className: "h-7 w-7",
97
- "aria-label": Y,
98
- title: Y,
109
+ "aria-label": z,
110
+ title: z,
99
111
  ...e
100
112
  }
101
113
  ),
102
- MonthCaption: ({ displayIndex: e, calendarMonth: t, ...o }) => /* @__PURE__ */ i("div", { ...o }),
103
- Month: ({ calendarMonth: e, displayIndex: t, className: o, children: r, ...s }) => {
104
- const l = v.Children.toArray(r), f = l[l.length - 1], a = l.slice(0, -1);
105
- return /* @__PURE__ */ i(P.Provider, { value: t, children: /* @__PURE__ */ q("div", { className: y(o), ...s, children: [
106
- a.length > 0 ? /* @__PURE__ */ i(ce, { children: a }) : null,
107
- f
114
+ MonthCaption: ({ displayIndex: e, calendarMonth: t, ...o }) => /* @__PURE__ */ s("div", { ...o }),
115
+ Month: ({ calendarMonth: e, displayIndex: t, className: o, children: r, ...i }) => {
116
+ const c = y.Children.toArray(r), p = c[c.length - 1], a = c.slice(0, -1);
117
+ return /* @__PURE__ */ s(P.Provider, { value: t, children: /* @__PURE__ */ A("div", { className: w(o), ...i, children: [
118
+ a.length > 0 ? /* @__PURE__ */ s(fe, { children: a }) : null,
119
+ p
108
120
  ] }) });
109
121
  },
110
- Months: ({ className: e, children: t, ...o }) => /* @__PURE__ */ i(
122
+ Weeks: ({ className: e, children: t, ...o }) => {
123
+ const r = y.useContext(P);
124
+ if (d !== "fiscal" || !k)
125
+ return /* @__PURE__ */ s("tbody", { className: e, ...o, children: t });
126
+ const i = S(x, r), c = Y(r), p = u?.(N(i))?.fy ?? u?.(i)?.fy, { leading: a, trailing: n } = be({
127
+ paneYear: i.getFullYear(),
128
+ paneMonthIndex: i.getMonth(),
129
+ panePeriod: c,
130
+ fiscalConfig: k,
131
+ fy: p
132
+ }), f = y.Children.toArray(t), l = [], D = [];
133
+ for (const h of f)
134
+ Se(h) ? D.push(h) : l.push(h);
135
+ const b = a.length + n.length;
136
+ return /* @__PURE__ */ A(
137
+ "tbody",
138
+ {
139
+ className: w(e, ge(b)),
140
+ "data-leading-week-count": a.length || void 0,
141
+ "data-trailing-week-count": n.length || void 0,
142
+ ...o,
143
+ children: [
144
+ a.map((h) => /* @__PURE__ */ s(
145
+ V,
146
+ {
147
+ fiscalWeek: h,
148
+ displayMonth: i
149
+ },
150
+ h.start
151
+ )),
152
+ l,
153
+ n.map((h) => /* @__PURE__ */ s(
154
+ V,
155
+ {
156
+ fiscalWeek: h,
157
+ displayMonth: i
158
+ },
159
+ h.start
160
+ )),
161
+ D
162
+ ]
163
+ }
164
+ );
165
+ },
166
+ Months: ({ className: e, children: t, ...o }) => /* @__PURE__ */ s(
111
167
  "div",
112
168
  {
113
169
  "data-slot": "day-months",
114
- "data-period-row-hover": z ? "true" : void 0,
115
- "data-week-gutter-track": h === "week" ? "true" : void 0,
116
- className: y(e),
170
+ "data-period-row-hover": G ? "true" : void 0,
171
+ "data-week-gutter-track": v === "week" ? "true" : void 0,
172
+ className: w(e),
117
173
  ...o,
118
174
  children: t
119
175
  }
120
176
  ),
121
177
  DropdownNav: ({ children: e, className: t, ...o }) => {
122
178
  if (d !== "fiscal")
123
- return /* @__PURE__ */ i("div", { className: t, ...o, children: e });
124
- const r = v.Children.toArray(e), s = (n) => v.isValidElement(n) && n.key != null ? String(n.key) : "", l = r.find((n) => s(n).endsWith("year")), f = r.find((n) => s(n).endsWith("month")), a = r.filter((n) => {
125
- const m = s(n);
126
- return !m.endsWith("year") && !m.endsWith("month");
179
+ return /* @__PURE__ */ s("div", { className: t, ...o, children: e });
180
+ const r = y.Children.toArray(e), i = (n) => y.isValidElement(n) && n.key != null ? String(n.key) : "", c = r.find((n) => i(n).endsWith("year")), p = r.find((n) => i(n).endsWith("month")), a = r.filter((n) => {
181
+ const f = i(n);
182
+ return !f.endsWith("year") && !f.endsWith("month");
127
183
  });
128
- return /* @__PURE__ */ q("div", { className: t, ...o, children: [
129
- l,
130
- f,
184
+ return /* @__PURE__ */ A("div", { className: t, ...o, children: [
185
+ c,
186
+ p,
131
187
  a
132
188
  ] });
133
189
  },
134
190
  MonthsDropdown: ({ value: e }) => {
135
- const t = v.useContext(P), o = t > 0, r = N(x, t), s = r.getFullYear();
136
- if (d === "fiscal" && W) {
137
- const a = c?.(F(r)) ?? c?.(r), n = I(W, a?.fy, S), m = X(
191
+ const t = y.useContext(P), o = t > 0, r = S(x, t), i = r.getFullYear();
192
+ if (d === "fiscal" && k) {
193
+ const a = u?.(N(r)) ?? u?.(r), n = O(k, a?.fy, C), f = ye(n, F), l = $(
138
194
  n,
139
195
  r.getFullYear(),
140
196
  r.getMonth()
141
197
  );
142
- return /* @__PURE__ */ i(
143
- xe,
198
+ return /* @__PURE__ */ s(
199
+ Fe,
144
200
  {
145
- periods: n,
146
- selectedPeriod: m,
147
- placeholder: j,
148
- onPeriodChange: (u) => {
149
- k(U(u, o));
201
+ periods: f,
202
+ selectedPeriod: l,
203
+ placeholder: _,
204
+ onPeriodChange: (D) => {
205
+ W(Z(D, o));
150
206
  }
151
207
  }
152
208
  );
153
209
  }
154
- const f = pe(
155
- s,
156
- g,
157
- V,
158
- K
210
+ const p = ke(
211
+ i,
212
+ R,
213
+ te,
214
+ oe
159
215
  );
160
- return /* @__PURE__ */ i(
161
- Q,
216
+ return /* @__PURE__ */ s(
217
+ X,
162
218
  {
163
- value: f.find((a) => a.value === e?.toString()),
219
+ value: p.find((a) => a.value === e?.toString()),
164
220
  onChange: (a) => {
165
221
  if (a && "value" in a) {
166
222
  const n = parseInt(a.value);
167
- k(o ? new Date(s, n - 1, 1) : new Date(s, n, 1));
223
+ W(o ? new Date(i, n - 1, 1) : new Date(i, n, 1));
168
224
  }
169
225
  },
170
226
  scrollToSelectedOnOpen: !0,
171
- options: f,
227
+ options: p,
172
228
  className: "w-[116px] shrink-0",
173
229
  menuWidth: "160px",
174
230
  isSearchable: !0,
175
231
  isClearable: !1,
176
- placeholder: j
232
+ placeholder: _
177
233
  }
178
234
  );
179
235
  },
180
236
  YearsDropdown: ({ value: e }) => {
181
- const t = v.useContext(P), o = t > 0, r = d === "fiscal" && W, s = N(x, t), l = r ? c?.(F(s)) ?? c?.(s) : void 0, f = r && l?.fy != null ? String(l.fy) : e?.toString();
182
- return /* @__PURE__ */ i(
183
- Q,
237
+ const t = y.useContext(P), o = t > 0, r = d === "fiscal" && k, i = S(x, t), c = r ? u?.(N(i)) ?? u?.(i) : void 0, p = r && c?.fy != null ? String(c.fy) : e?.toString();
238
+ return /* @__PURE__ */ s(
239
+ X,
184
240
  {
185
- value: C.find((n) => n.value === f),
241
+ value: j.find((n) => n.value === p),
186
242
  onChange: (n) => {
187
243
  if (n && "value" in n) {
188
- const m = parseInt(n.value);
244
+ const f = parseInt(n.value);
189
245
  if (r) {
190
- const u = I(W, m, S), p = u.find((b) => b.period === l?.fiscalPeriod) ?? u[0];
191
- p && k(U(p, o));
246
+ const l = xe({
247
+ periods: O(k, f, C),
248
+ preferredPeriod: c?.fiscalPeriod,
249
+ disabled: F
250
+ });
251
+ l && W(Z(l, o));
192
252
  return;
193
253
  }
194
254
  if (o) {
195
- const u = new Date(
255
+ const l = new Date(
196
256
  x.getFullYear(),
197
257
  x.getMonth() + 1,
198
258
  1
199
259
  ).getMonth();
200
- k(new Date(m, u - 1, 1));
260
+ W(new Date(f, l - 1, 1));
201
261
  } else
202
- k(new Date(m, x.getMonth(), 1));
262
+ W(new Date(f, x.getMonth(), 1));
203
263
  }
204
264
  },
205
265
  scrollToSelectedOnOpen: !0,
206
- options: C,
266
+ options: j,
207
267
  className: "w-[116px] shrink-0",
208
268
  menuWidth: "140px",
209
269
  isSearchable: !0,
210
270
  isClearable: !1,
211
- placeholder: te
271
+ placeholder: re
212
272
  }
213
273
  );
214
274
  },
215
- DayButton: (e) => /* @__PURE__ */ i(
216
- de,
275
+ Day: (e) => {
276
+ if (d !== "fiscal") {
277
+ const { day: t, modifiers: o, children: r, ...i } = e;
278
+ return /* @__PURE__ */ s("td", { ...i, children: r });
279
+ }
280
+ return /* @__PURE__ */ s(Ie, { ...e });
281
+ },
282
+ DayButton: (e) => /* @__PURE__ */ s(
283
+ me,
217
284
  {
218
285
  ...e,
219
- pickerType: h,
286
+ pickerType: v,
220
287
  modifiers: {
221
288
  ...e.modifiers,
222
- ...se ? {
223
- fiscal_period_start: !!c?.(e.day.date)?.isPeriodStart,
224
- fiscal_period_end: !!c?.(e.day.date)?.isPeriodEnd
289
+ ...de ? {
290
+ fiscal_period_start: !!u?.(e.day.date)?.isPeriodStart,
291
+ fiscal_period_end: !!u?.(e.day.date)?.isPeriodEnd
225
292
  } : {}
226
293
  }
227
294
  }
228
295
  ),
229
- Week: ({ week: e, className: t, children: o, onClick: r, ...s }) => {
230
- const { isSelected: l } = le(), f = v.useContext(P), a = Z(e), n = h === "week", m = L(e, c), u = _(f), p = a || $({
296
+ Week: ({ week: e, className: t, children: o, onClick: r, ...i }) => {
297
+ const { isSelected: c } = ue(), p = y.useContext(P), a = v === "week", n = T(e, u), f = Y(p), l = L(e, {
231
298
  calendarKind: d,
232
- weekPeriod: m,
233
- panePeriod: u
234
- }), b = z && !p ? m : void 0, E = !p && he(e, l), G = h === "week" && B !== "multiple" && B !== "multi-range" && E ? ve(e, l, {
299
+ weekPeriod: n,
300
+ panePeriod: f
301
+ }), D = G && !l ? n : void 0, b = a && !l && !K(e, F, I), h = !l && !b && Pe(e, c, {
302
+ includeOutside: De({ calendarKind: d, weekPeriod: n, panePeriod: f })
303
+ }), q = v === "week" && M !== "multiple" && M !== "multi-range" && h ? We(e, c, {
235
304
  joinAdjacentWeek: d === "fiscal",
236
- panePeriod: u,
237
- periodForDate: (w) => c?.(w)?.fiscalPeriod
305
+ panePeriod: f,
306
+ periodForDate: (g) => u?.(g)?.fiscalPeriod
238
307
  }) : { prev: !1, next: !1 };
239
- return /* @__PURE__ */ i(
308
+ return /* @__PURE__ */ s(
240
309
  "tr",
241
310
  {
242
- className: y(
311
+ className: w(
243
312
  t,
244
- p && "invisible order-last",
245
- n && !p && "cursor-pointer"
313
+ l && "invisible order-last",
314
+ a && !l && !b && "cursor-pointer"
246
315
  ),
247
- ...s,
248
- "aria-hidden": p || void 0,
249
- "data-fiscal-period": b,
250
- "data-week-selected": E ? !0 : void 0,
251
- "data-week-continues-next": G.next || void 0,
252
- "data-week-continues-prev": G.prev || void 0,
253
- onClick: n && !p ? (w) => {
254
- if (r?.(w), w.defaultPrevented) return;
255
- const H = w.target;
256
- H.closest("button") || H.closest("[data-week-number]") || R(e);
316
+ ...i,
317
+ "aria-hidden": l || void 0,
318
+ "data-fiscal-period": D,
319
+ "data-week-selected": h ? !0 : void 0,
320
+ "data-week-continues-next": q.next || void 0,
321
+ "data-week-continues-prev": q.prev || void 0,
322
+ onClick: a && !l && !b ? (g) => {
323
+ if (r?.(g), g.defaultPrevented) return;
324
+ const J = g.target;
325
+ J.closest("button") || J.closest("[data-week-number]") || H(e);
257
326
  } : r,
258
327
  children: o
259
328
  }
260
329
  );
261
330
  },
262
331
  WeekNumber: ({ week: e, ...t }) => {
263
- const o = v.useContext(P), r = Z(e) || $({
332
+ const o = y.useContext(P), r = L(e, {
264
333
  calendarKind: d,
265
- weekPeriod: L(e, c),
266
- panePeriod: _(o)
334
+ weekPeriod: T(e, u),
335
+ panePeriod: Y(o)
267
336
  });
268
- return /* @__PURE__ */ i(
269
- me,
337
+ return /* @__PURE__ */ s(
338
+ pe,
270
339
  {
271
340
  week: e,
272
- weekStartsOn: ee,
273
- pickerType: h,
341
+ weekStartsOn: ne,
342
+ pickerType: v,
274
343
  calendarKind: d,
275
- weekNumberLabel: oe,
276
- weekLabel: ne,
277
- fiscalWeekNumberLabel: re,
278
- fiscalWeekAriaLabel: ie,
279
- getCellMeta: c,
280
- onWeekSelect: R,
344
+ weekNumberLabel: ie,
345
+ weekLabel: se,
346
+ fiscalWeekNumberLabel: ae,
347
+ fiscalWeekAriaLabel: le,
348
+ getCellMeta: u,
349
+ onWeekSelect: H,
281
350
  ...t,
282
- blank: r
351
+ blank: r,
352
+ blocked: v === "week" && !K(e, F, I)
283
353
  }
284
354
  );
285
355
  },
286
356
  WeekNumberHeader: (e) => {
287
- const t = v.useContext(P), o = fe(d, x, t), r = o === void 0 ? O : T[o], s = o === void 0 ? O : g[o];
288
- return /* @__PURE__ */ i("th", { ...e, "aria-label": s, children: r });
357
+ const t = y.useContext(P), o = he(d, x, t), r = o === void 0 ? E : ee[o], i = o === void 0 ? E : R[o];
358
+ return /* @__PURE__ */ s("th", { ...e, "aria-label": i, children: r });
289
359
  },
290
- ...ae
360
+ ...ce
291
361
  };
292
362
  }
293
363
  export {
294
- ze as buildCalendarDayPickerComponents
364
+ Le as buildCalendarDayPickerComponents
295
365
  };