impact-nova 2.5.12 → 2.5.13

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 (127) hide show
  1. package/dist/components/data/data-table/build-column-tree-from-grid.d.ts +1 -0
  2. package/dist/components/data/data-table/build-column-tree-from-grid.js +55 -50
  3. package/dist/components/data/data-table/column-picker-authority.d.ts +34 -0
  4. package/dist/components/data/data-table/column-picker-authority.js +116 -0
  5. package/dist/components/data/data-table/column-picker-drop-validation.d.ts +7 -0
  6. package/dist/components/data/data-table/column-picker-drop-validation.js +37 -0
  7. package/dist/components/data/data-table/data-table-column-apply.d.ts +2 -0
  8. package/dist/components/data/data-table/data-table-column-apply.js +84 -73
  9. package/dist/components/data/data-table/data-table-column-list-tree-apply.d.ts +10 -0
  10. package/dist/components/data/data-table/data-table-column-list-tree-apply.js +79 -0
  11. package/dist/components/data/data-table/data-table-column-list.js +94 -64
  12. package/dist/components/data/data-table/data-table-column-tree-cache.d.ts +12 -6
  13. package/dist/components/data/data-table/data-table-column-tree-cache.js +250 -131
  14. package/dist/components/data/data-table/data-table-flat-column-virtual-rows.d.ts +26 -0
  15. package/dist/components/data/data-table/data-table-flat-column-virtual-rows.js +195 -0
  16. package/dist/components/data/data-table/data-table-picker-column-eligibility.d.ts +1 -0
  17. package/dist/components/data/data-table/data-table-picker-column-eligibility.js +7 -0
  18. package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.d.ts +5 -0
  19. package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.js +28 -11
  20. package/dist/components/data/data-table/reconcile-column-tree-from-grid.d.ts +12 -0
  21. package/dist/components/data/data-table/reconcile-column-tree-from-grid.js +12 -0
  22. package/dist/components/data/data-table/use-data-table-column-list-sync.d.ts +10 -0
  23. package/dist/components/data/data-table/use-data-table-column-list-sync.js +250 -196
  24. package/dist/components/data/nested-list/components/NestedListContent.d.ts +10 -2
  25. package/dist/components/data/nested-list/components/NestedListContent.js +253 -138
  26. package/dist/components/data/nested-list/components/SortableItem.d.ts +2 -1
  27. package/dist/components/data/nested-list/components/SortableItem.js +62 -60
  28. package/dist/components/data/nested-list/hooks/useNestedListDragDrop.d.ts +10 -20
  29. package/dist/components/data/nested-list/hooks/useNestedListDragDrop.js +44 -233
  30. package/dist/components/data/nested-list/hooks/useVirtualNestedListDrag.d.ts +24 -0
  31. package/dist/components/data/nested-list/hooks/useVirtualNestedListDrag.js +128 -0
  32. package/dist/components/data/nested-list/nested-list-constants.d.ts +4 -1
  33. package/dist/components/data/nested-list/nested-list-constants.js +10 -4
  34. package/dist/components/data/nested-list/nested-list-display-utils.d.ts +11 -0
  35. package/dist/components/data/nested-list/nested-list-display-utils.js +74 -0
  36. package/dist/components/data/nested-list/nested-list-drop-engine.d.ts +31 -0
  37. package/dist/components/data/nested-list/nested-list-drop-engine.js +209 -0
  38. package/dist/components/data/nested-list/nested-list-flat-virtual-handlers.d.ts +26 -0
  39. package/dist/components/data/nested-list/nested-list-flat-virtual-handlers.js +67 -0
  40. package/dist/components/data/nested-list/nested-list-item-tree-mutations.d.ts +4 -0
  41. package/dist/components/data/nested-list/nested-list-item-tree-mutations.js +43 -0
  42. package/dist/components/data/nested-list/nested-list-lazy-flat-rows.d.ts +3 -0
  43. package/dist/components/data/nested-list/nested-list-lazy-flat-rows.js +34 -0
  44. package/dist/components/data/nested-list/nested-list-row-estimates.d.ts +9 -0
  45. package/dist/components/data/nested-list/nested-list-row-estimates.js +14 -0
  46. package/dist/components/data/nested-list/nested-list-scroll-anchor.d.ts +36 -0
  47. package/dist/components/data/nested-list/nested-list-scroll-anchor.js +47 -0
  48. package/dist/components/data/nested-list/nested-list-virtual-drop.d.ts +59 -0
  49. package/dist/components/data/nested-list/nested-list-virtual-drop.js +341 -0
  50. package/dist/components/data/nested-list/nested-list.js +322 -336
  51. package/dist/components/data/nested-list/nested-list.types.d.ts +17 -0
  52. package/dist/components/data-display/calendar/calendar-apply-validation.d.ts +0 -2
  53. package/dist/components/data-display/calendar/calendar-apply-validation.js +67 -64
  54. package/dist/components/data-display/calendar/calendar-config.js +1 -1
  55. package/dist/components/data-display/calendar/calendar-day-picker-components.d.ts +2 -4
  56. package/dist/components/data-display/calendar/calendar-day-picker-components.js +164 -234
  57. package/dist/components/data-display/calendar/calendar-day-picker-view.js +76 -77
  58. package/dist/components/data-display/calendar/calendar-fiscal-period-nav.d.ts +0 -6
  59. package/dist/components/data-display/calendar/calendar-fiscal-period-nav.js +18 -34
  60. package/dist/components/data-display/calendar/calendar-footer.js +21 -21
  61. package/dist/components/data-display/calendar/calendar-month-picker-panel.js +49 -50
  62. package/dist/components/data-display/calendar/calendar-month-utils.d.ts +0 -5
  63. package/dist/components/data-display/calendar/calendar-month-utils.js +64 -85
  64. package/dist/components/data-display/calendar/calendar-padding-week.utils.d.ts +1 -3
  65. package/dist/components/data-display/calendar/calendar-padding-week.utils.js +5 -7
  66. package/dist/components/data-display/calendar/calendar-period-cell.js +46 -45
  67. package/dist/components/data-display/calendar/calendar-quarter-panes.js +31 -33
  68. package/dist/components/data-display/calendar/calendar-selection-appearance.d.ts +0 -10
  69. package/dist/components/data-display/calendar/calendar-selection-appearance.js +39 -53
  70. package/dist/components/data-display/calendar/calendar-selection.d.ts +0 -25
  71. package/dist/components/data-display/calendar/calendar-selection.js +23 -52
  72. package/dist/components/data-display/calendar/calendar-week-number-cell.d.ts +1 -2
  73. package/dist/components/data-display/calendar/calendar-week-number-cell.js +45 -59
  74. package/dist/components/data-display/calendar/calendar-week-utils.d.ts +3 -13
  75. package/dist/components/data-display/calendar/calendar-week-utils.js +50 -59
  76. package/dist/components/data-display/calendar/calendar-year-panes.d.ts +0 -3
  77. package/dist/components/data-display/calendar/calendar-year-panes.js +49 -53
  78. package/dist/components/data-display/calendar/calendar.js +143 -146
  79. package/dist/components/data-display/calendar/calendar.types.d.ts +0 -5
  80. package/dist/components/data-display/calendar/use-calendar-day-picker-config.d.ts +1 -2
  81. package/dist/components/data-display/calendar/use-calendar-day-picker-config.js +74 -79
  82. package/dist/components/data-display/calendar/use-calendar-state.d.ts +1 -3
  83. package/dist/components/data-display/calendar/use-calendar-state.js +325 -403
  84. package/dist/components/forms/date-picker/date-picker.js +58 -60
  85. package/dist/components/forms/date-picker/date-picker.types.d.ts +0 -5
  86. package/dist/components/forms/date-picker/date-range-picker.js +64 -66
  87. package/dist/components/forms/date-picker/fiscal-pass-through.d.ts +0 -1
  88. package/dist/components/forms/date-picker/fiscal-pass-through.js +2 -3
  89. package/dist/components/forms/date-picker/month-picker.js +59 -61
  90. package/dist/components/forms/date-picker/month-range-picker.js +61 -63
  91. package/dist/components/forms/date-picker/multi-date-picker.js +49 -51
  92. package/dist/components/forms/date-picker/multi-month-picker.js +47 -49
  93. package/dist/components/forms/date-picker/multi-quarter-picker.js +47 -51
  94. package/dist/components/forms/date-picker/multi-week-picker.js +51 -53
  95. package/dist/components/forms/date-picker/multi-year-picker.js +49 -53
  96. package/dist/components/forms/date-picker/quarter-picker.js +47 -51
  97. package/dist/components/forms/date-picker/quarter-range-picker.js +46 -50
  98. package/dist/components/forms/date-picker/week-picker.js +66 -68
  99. package/dist/components/forms/date-picker/week-range-picker.js +80 -82
  100. package/dist/components/forms/date-picker/year-picker.js +48 -52
  101. package/dist/components/forms/date-picker/year-range-picker.js +48 -52
  102. package/dist/form-react/Fields/DateInputField.js +50 -51
  103. package/dist/form-react/Fields/DateRangeField.js +13 -14
  104. package/dist/form-react/Fields/MonthRangeField.js +28 -29
  105. package/dist/form-react/Fields/MultiMonthPickerField.js +12 -13
  106. package/dist/form-react/Fields/MultiWeekPickerField.js +27 -35
  107. package/dist/form-react/Fields/WeekRangePicker.js +32 -33
  108. package/dist/form-react/types/fields.types.d.ts +0 -14
  109. package/dist/impact-nova-components.css +6 -13
  110. package/dist/impact-nova.css +1 -1
  111. package/dist/lib/fiscal-calendar/week-selection.js +2 -2
  112. package/dist/lib/hash/fnv1a128.d.ts +16 -0
  113. package/dist/lib/hash/fnv1a128.js +21 -0
  114. package/dist/llms/rules/ag-grid.js +1 -1
  115. package/dist/llms/rules/installation.js +1 -1
  116. package/dist/llms/rules/requirements.js +1 -1
  117. package/package.json +1 -1
  118. package/dist/components/data-display/calendar/calendar-available-view.d.ts +0 -27
  119. package/dist/components/data-display/calendar/calendar-available-view.js +0 -85
  120. package/dist/components/data-display/calendar/calendar-fiscal-day-cell.d.ts +0 -9
  121. package/dist/components/data-display/calendar/calendar-fiscal-day-cell.js +0 -45
  122. package/dist/components/data-display/calendar/calendar-injected-week-row.d.ts +0 -5
  123. package/dist/components/data-display/calendar/calendar-injected-week-row.js +0 -92
  124. package/dist/components/data-display/calendar/calendar-leading-week.utils.d.ts +0 -16
  125. package/dist/components/data-display/calendar/calendar-leading-week.utils.js +0 -51
  126. package/dist/components/data-display/calendar/calendar-orphan-week.d.ts +0 -23
  127. package/dist/components/forms/date-picker/fiscal-picker-fixtures.d.ts +0 -17
@@ -1,365 +1,295 @@
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";
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";
10
10
  import { PanelIndexContext as P } from "./calendar-panel-context.js";
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)
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)
24
21
  try {
25
- return ve(m, v).periods;
22
+ return ue(D, h).periods;
26
23
  } catch {
27
24
  }
28
25
  return d ?? [];
29
26
  }
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,
27
+ function ze({
28
+ buttonVariant: D,
29
+ pickerType: h,
40
30
  calendarKind: d,
41
- granularity: I,
42
31
  currentMonth: x,
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
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
68
56
  }) {
69
- function Y(e) {
57
+ function _(e) {
70
58
  if (d !== "fiscal") return;
71
- const t = S(x, e);
72
- return $(
73
- O(
74
- k,
75
- u?.(N(t))?.fy ?? u?.(t)?.fy,
76
- C
59
+ const t = N(x, e);
60
+ return X(
61
+ I(
62
+ W,
63
+ c?.(F(t))?.fy ?? c?.(t)?.fy,
64
+ S
77
65
  ),
78
66
  t.getFullYear(),
79
67
  t.getMonth()
80
68
  )?.period;
81
69
  }
82
70
  return {
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,
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,
86
74
  {
87
75
  size: 16,
88
- className: w("rotate-180 text-content", e),
76
+ className: y("rotate-180 text-content", e),
89
77
  ...o
90
78
  }
91
- ) : t === "right" ? /* @__PURE__ */ s(Q, { size: 16, className: w("text-content", e), ...o }) : /* @__PURE__ */ s("span", {}),
92
- PreviousMonthButton: (e) => /* @__PURE__ */ s(
93
- U,
79
+ ) : t === "right" ? /* @__PURE__ */ i(J, { size: 16, className: y("text-content", e), ...o }) : /* @__PURE__ */ i("span", {}),
80
+ PreviousMonthButton: (e) => /* @__PURE__ */ i(
81
+ M,
94
82
  {
95
- variant: m,
83
+ variant: D,
96
84
  size: "icon",
97
85
  className: "h-7 w-7",
98
- "aria-label": B,
99
- title: B,
86
+ "aria-label": A,
87
+ title: A,
100
88
  ...e
101
89
  }
102
90
  ),
103
- NextMonthButton: (e) => /* @__PURE__ */ s(
104
- U,
91
+ NextMonthButton: (e) => /* @__PURE__ */ i(
92
+ M,
105
93
  {
106
- variant: m,
94
+ variant: D,
107
95
  size: "icon",
108
96
  className: "h-7 w-7",
109
- "aria-label": z,
110
- title: z,
97
+ "aria-label": Y,
98
+ title: Y,
111
99
  ...e
112
100
  }
113
101
  ),
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
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
120
108
  ] }) });
121
109
  },
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(
110
+ Months: ({ className: e, children: t, ...o }) => /* @__PURE__ */ i(
167
111
  "div",
168
112
  {
169
113
  "data-slot": "day-months",
170
- "data-period-row-hover": G ? "true" : void 0,
171
- "data-week-gutter-track": v === "week" ? "true" : void 0,
172
- className: w(e),
114
+ "data-period-row-hover": z ? "true" : void 0,
115
+ "data-week-gutter-track": h === "week" ? "true" : void 0,
116
+ className: y(e),
173
117
  ...o,
174
118
  children: t
175
119
  }
176
120
  ),
177
121
  DropdownNav: ({ children: e, className: t, ...o }) => {
178
122
  if (d !== "fiscal")
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");
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");
183
127
  });
184
- return /* @__PURE__ */ A("div", { className: t, ...o, children: [
185
- c,
186
- p,
128
+ return /* @__PURE__ */ q("div", { className: t, ...o, children: [
129
+ l,
130
+ f,
187
131
  a
188
132
  ] });
189
133
  },
190
134
  MonthsDropdown: ({ value: e }) => {
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 = $(
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(
194
138
  n,
195
139
  r.getFullYear(),
196
140
  r.getMonth()
197
141
  );
198
- return /* @__PURE__ */ s(
199
- Fe,
142
+ return /* @__PURE__ */ i(
143
+ xe,
200
144
  {
201
- periods: f,
202
- selectedPeriod: l,
203
- placeholder: _,
204
- onPeriodChange: (D) => {
205
- W(Z(D, o));
145
+ periods: n,
146
+ selectedPeriod: m,
147
+ placeholder: j,
148
+ onPeriodChange: (u) => {
149
+ k(U(u, o));
206
150
  }
207
151
  }
208
152
  );
209
153
  }
210
- const p = ke(
211
- i,
212
- R,
213
- te,
214
- oe
154
+ const f = pe(
155
+ s,
156
+ g,
157
+ V,
158
+ K
215
159
  );
216
- return /* @__PURE__ */ s(
217
- X,
160
+ return /* @__PURE__ */ i(
161
+ Q,
218
162
  {
219
- value: p.find((a) => a.value === e?.toString()),
163
+ value: f.find((a) => a.value === e?.toString()),
220
164
  onChange: (a) => {
221
165
  if (a && "value" in a) {
222
166
  const n = parseInt(a.value);
223
- W(o ? new Date(i, n - 1, 1) : new Date(i, n, 1));
167
+ k(o ? new Date(s, n - 1, 1) : new Date(s, n, 1));
224
168
  }
225
169
  },
226
170
  scrollToSelectedOnOpen: !0,
227
- options: p,
171
+ options: f,
228
172
  className: "w-[116px] shrink-0",
229
173
  menuWidth: "160px",
230
174
  isSearchable: !0,
231
175
  isClearable: !1,
232
- placeholder: _
176
+ placeholder: j
233
177
  }
234
178
  );
235
179
  },
236
180
  YearsDropdown: ({ value: e }) => {
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,
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,
240
184
  {
241
- value: j.find((n) => n.value === p),
185
+ value: C.find((n) => n.value === f),
242
186
  onChange: (n) => {
243
187
  if (n && "value" in n) {
244
- const f = parseInt(n.value);
188
+ const m = parseInt(n.value);
245
189
  if (r) {
246
- const l = xe({
247
- periods: O(k, f, C),
248
- preferredPeriod: c?.fiscalPeriod,
249
- disabled: F
250
- });
251
- l && W(Z(l, o));
190
+ const u = I(W, m, S), p = u.find((b) => b.period === l?.fiscalPeriod) ?? u[0];
191
+ p && k(U(p, o));
252
192
  return;
253
193
  }
254
194
  if (o) {
255
- const l = new Date(
195
+ const u = new Date(
256
196
  x.getFullYear(),
257
197
  x.getMonth() + 1,
258
198
  1
259
199
  ).getMonth();
260
- W(new Date(f, l - 1, 1));
200
+ k(new Date(m, u - 1, 1));
261
201
  } else
262
- W(new Date(f, x.getMonth(), 1));
202
+ k(new Date(m, x.getMonth(), 1));
263
203
  }
264
204
  },
265
205
  scrollToSelectedOnOpen: !0,
266
- options: j,
206
+ options: C,
267
207
  className: "w-[116px] shrink-0",
268
208
  menuWidth: "140px",
269
209
  isSearchable: !0,
270
210
  isClearable: !1,
271
- placeholder: re
211
+ placeholder: te
272
212
  }
273
213
  );
274
214
  },
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,
215
+ DayButton: (e) => /* @__PURE__ */ i(
216
+ de,
284
217
  {
285
218
  ...e,
286
- pickerType: v,
219
+ pickerType: h,
287
220
  modifiers: {
288
221
  ...e.modifiers,
289
- ...de ? {
290
- fiscal_period_start: !!u?.(e.day.date)?.isPeriodStart,
291
- fiscal_period_end: !!u?.(e.day.date)?.isPeriodEnd
222
+ ...se ? {
223
+ fiscal_period_start: !!c?.(e.day.date)?.isPeriodStart,
224
+ fiscal_period_end: !!c?.(e.day.date)?.isPeriodEnd
292
225
  } : {}
293
226
  }
294
227
  }
295
228
  ),
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, {
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 || $({
298
231
  calendarKind: d,
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, {
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, {
304
235
  joinAdjacentWeek: d === "fiscal",
305
- panePeriod: f,
306
- periodForDate: (g) => u?.(g)?.fiscalPeriod
236
+ panePeriod: u,
237
+ periodForDate: (w) => c?.(w)?.fiscalPeriod
307
238
  }) : { prev: !1, next: !1 };
308
- return /* @__PURE__ */ s(
239
+ return /* @__PURE__ */ i(
309
240
  "tr",
310
241
  {
311
- className: w(
242
+ className: y(
312
243
  t,
313
- l && "invisible order-last",
314
- a && !l && !b && "cursor-pointer"
244
+ p && "invisible order-last",
245
+ n && !p && "cursor-pointer"
315
246
  ),
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);
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);
326
257
  } : r,
327
258
  children: o
328
259
  }
329
260
  );
330
261
  },
331
262
  WeekNumber: ({ week: e, ...t }) => {
332
- const o = y.useContext(P), r = L(e, {
263
+ const o = v.useContext(P), r = Z(e) || $({
333
264
  calendarKind: d,
334
- weekPeriod: T(e, u),
335
- panePeriod: Y(o)
265
+ weekPeriod: L(e, c),
266
+ panePeriod: _(o)
336
267
  });
337
- return /* @__PURE__ */ s(
338
- pe,
268
+ return /* @__PURE__ */ i(
269
+ me,
339
270
  {
340
271
  week: e,
341
- weekStartsOn: ne,
342
- pickerType: v,
272
+ weekStartsOn: ee,
273
+ pickerType: h,
343
274
  calendarKind: d,
344
- weekNumberLabel: ie,
345
- weekLabel: se,
346
- fiscalWeekNumberLabel: ae,
347
- fiscalWeekAriaLabel: le,
348
- getCellMeta: u,
349
- onWeekSelect: H,
275
+ weekNumberLabel: oe,
276
+ weekLabel: ne,
277
+ fiscalWeekNumberLabel: re,
278
+ fiscalWeekAriaLabel: ie,
279
+ getCellMeta: c,
280
+ onWeekSelect: R,
350
281
  ...t,
351
- blank: r,
352
- blocked: v === "week" && !K(e, F, I)
282
+ blank: r
353
283
  }
354
284
  );
355
285
  },
356
286
  WeekNumberHeader: (e) => {
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 });
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 });
359
289
  },
360
- ...ce
290
+ ...ae
361
291
  };
362
292
  }
363
293
  export {
364
- Le as buildCalendarDayPickerComponents
294
+ ze as buildCalendarDayPickerComponents
365
295
  };