impact-nova 2.5.13 → 2.5.15

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 (141) 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/nested-list/components/NestedListContent.d.ts +2 -10
  13. package/dist/components/data/nested-list/components/NestedListContent.js +138 -253
  14. package/dist/components/data/nested-list/components/SortableItem.d.ts +1 -2
  15. package/dist/components/data/nested-list/components/SortableItem.js +60 -62
  16. package/dist/components/data/nested-list/hooks/useNestedListDragDrop.d.ts +20 -10
  17. package/dist/components/data/nested-list/hooks/useNestedListDragDrop.js +233 -44
  18. package/dist/components/data/nested-list/nested-list-constants.d.ts +1 -4
  19. package/dist/components/data/nested-list/nested-list-constants.js +4 -10
  20. package/dist/components/data/nested-list/nested-list.js +336 -322
  21. package/dist/components/data/nested-list/nested-list.types.d.ts +0 -17
  22. package/dist/components/data-display/calendar/calendar-apply-validation.d.ts +2 -0
  23. package/dist/components/data-display/calendar/calendar-apply-validation.js +64 -67
  24. package/dist/components/data-display/calendar/calendar-available-view.d.ts +27 -0
  25. package/dist/components/data-display/calendar/calendar-available-view.js +85 -0
  26. package/dist/components/data-display/calendar/calendar-config.js +1 -1
  27. package/dist/components/data-display/calendar/calendar-day-picker-components.d.ts +4 -2
  28. package/dist/components/data-display/calendar/calendar-day-picker-components.js +234 -164
  29. package/dist/components/data-display/calendar/calendar-day-picker-view.js +77 -76
  30. package/dist/components/data-display/calendar/calendar-fiscal-day-cell.d.ts +9 -0
  31. package/dist/components/data-display/calendar/calendar-fiscal-day-cell.js +45 -0
  32. package/dist/components/data-display/calendar/calendar-fiscal-period-nav.d.ts +6 -0
  33. package/dist/components/data-display/calendar/calendar-fiscal-period-nav.js +34 -18
  34. package/dist/components/data-display/calendar/calendar-footer.js +21 -21
  35. package/dist/components/data-display/calendar/calendar-injected-week-row.d.ts +5 -0
  36. package/dist/components/data-display/calendar/calendar-injected-week-row.js +92 -0
  37. package/dist/components/data-display/calendar/calendar-leading-week.utils.d.ts +16 -0
  38. package/dist/components/data-display/calendar/calendar-leading-week.utils.js +51 -0
  39. package/dist/components/data-display/calendar/calendar-month-picker-panel.js +50 -49
  40. package/dist/components/data-display/calendar/calendar-month-utils.d.ts +5 -0
  41. package/dist/components/data-display/calendar/calendar-month-utils.js +85 -64
  42. package/dist/components/data-display/calendar/calendar-orphan-week.d.ts +23 -0
  43. package/dist/components/data-display/calendar/calendar-padding-week.utils.d.ts +3 -1
  44. package/dist/components/data-display/calendar/calendar-padding-week.utils.js +7 -5
  45. package/dist/components/data-display/calendar/calendar-period-cell.js +45 -46
  46. package/dist/components/data-display/calendar/calendar-quarter-panes.js +33 -31
  47. package/dist/components/data-display/calendar/calendar-selection-appearance.d.ts +10 -0
  48. package/dist/components/data-display/calendar/calendar-selection-appearance.js +53 -39
  49. package/dist/components/data-display/calendar/calendar-selection.d.ts +25 -0
  50. package/dist/components/data-display/calendar/calendar-selection.js +52 -23
  51. package/dist/components/data-display/calendar/calendar-week-number-cell.d.ts +2 -1
  52. package/dist/components/data-display/calendar/calendar-week-number-cell.js +59 -45
  53. package/dist/components/data-display/calendar/calendar-week-utils.d.ts +15 -4
  54. package/dist/components/data-display/calendar/calendar-week-utils.js +59 -50
  55. package/dist/components/data-display/calendar/calendar-year-panes.d.ts +3 -0
  56. package/dist/components/data-display/calendar/calendar-year-panes.js +53 -49
  57. package/dist/components/data-display/calendar/calendar.js +146 -143
  58. package/dist/components/data-display/calendar/calendar.types.d.ts +5 -0
  59. package/dist/components/data-display/calendar/use-calendar-day-picker-config.d.ts +2 -1
  60. package/dist/components/data-display/calendar/use-calendar-day-picker-config.js +79 -74
  61. package/dist/components/data-display/calendar/use-calendar-state.d.ts +3 -1
  62. package/dist/components/data-display/calendar/use-calendar-state.js +394 -314
  63. package/dist/components/forms/date-picker/date-picker.js +60 -58
  64. package/dist/components/forms/date-picker/date-picker.types.d.ts +5 -0
  65. package/dist/components/forms/date-picker/date-range-picker.js +66 -64
  66. package/dist/components/forms/date-picker/fiscal-pass-through.d.ts +1 -0
  67. package/dist/components/forms/date-picker/fiscal-pass-through.js +3 -2
  68. package/dist/components/forms/date-picker/fiscal-picker-fixtures.d.ts +17 -0
  69. package/dist/components/forms/date-picker/month-picker.js +61 -59
  70. package/dist/components/forms/date-picker/month-range-picker.js +63 -61
  71. package/dist/components/forms/date-picker/multi-date-picker.js +51 -49
  72. package/dist/components/forms/date-picker/multi-month-picker.js +49 -47
  73. package/dist/components/forms/date-picker/multi-quarter-picker.js +51 -47
  74. package/dist/components/forms/date-picker/multi-week-picker.js +53 -51
  75. package/dist/components/forms/date-picker/multi-year-picker.js +53 -49
  76. package/dist/components/forms/date-picker/quarter-picker.js +51 -47
  77. package/dist/components/forms/date-picker/quarter-range-picker.js +50 -46
  78. package/dist/components/forms/date-picker/week-picker.js +130 -126
  79. package/dist/components/forms/date-picker/week-range-picker.js +159 -155
  80. package/dist/components/forms/date-picker/year-picker.js +52 -48
  81. package/dist/components/forms/date-picker/year-range-picker.js +52 -48
  82. package/dist/form-react/Fields/DateInputField.js +51 -50
  83. package/dist/form-react/Fields/DateRangeField.js +14 -13
  84. package/dist/form-react/Fields/MonthRangeField.js +29 -28
  85. package/dist/form-react/Fields/MultiMonthPickerField.js +13 -12
  86. package/dist/form-react/Fields/MultiWeekPickerField.js +35 -27
  87. package/dist/form-react/Fields/MultiYearPickerField.d.ts +8 -0
  88. package/dist/form-react/Fields/MultiYearPickerField.js +58 -0
  89. package/dist/form-react/Fields/WeekRangePicker.js +33 -32
  90. package/dist/form-react/Fields/YearPickerField.d.ts +8 -0
  91. package/dist/form-react/Fields/YearPickerField.js +58 -0
  92. package/dist/form-react/Fields/YearRangePickerField.d.ts +8 -0
  93. package/dist/form-react/Fields/YearRangePickerField.js +58 -0
  94. package/dist/form-react/registry/defaultFieldRegistrations.d.ts +1 -1
  95. package/dist/form-react/registry/defaultFieldRegistrations.js +16 -13
  96. package/dist/form-react/types/fields.types.d.ts +72 -1
  97. package/dist/form-react/types/fieldsOutput.types.d.ts +8 -2
  98. package/dist/form-react/utils/fieldDefaults.utils.js +1 -1
  99. package/dist/impact-nova-components.css +13 -6
  100. package/dist/impact-nova.css +1 -1
  101. package/dist/lib/fiscal-calendar/index.d.ts +2 -2
  102. package/dist/lib/fiscal-calendar/index.js +26 -28
  103. package/dist/lib/fiscal-calendar/types.d.ts +0 -7
  104. package/dist/lib/fiscal-calendar/week-selection.d.ts +3 -4
  105. package/dist/lib/fiscal-calendar/week-selection.js +52 -79
  106. package/dist/llms/rules/ag-grid.js +1 -1
  107. package/dist/llms/rules/installation.js +1 -1
  108. package/dist/llms/rules/requirements.js +1 -1
  109. package/package.json +1 -1
  110. package/dist/components/data/data-table/column-picker-authority.d.ts +0 -34
  111. package/dist/components/data/data-table/column-picker-authority.js +0 -116
  112. package/dist/components/data/data-table/column-picker-drop-validation.d.ts +0 -7
  113. package/dist/components/data/data-table/column-picker-drop-validation.js +0 -37
  114. package/dist/components/data/data-table/data-table-column-list-tree-apply.d.ts +0 -10
  115. package/dist/components/data/data-table/data-table-column-list-tree-apply.js +0 -79
  116. package/dist/components/data/data-table/data-table-flat-column-virtual-rows.d.ts +0 -26
  117. package/dist/components/data/data-table/data-table-flat-column-virtual-rows.js +0 -195
  118. package/dist/components/data/data-table/data-table-picker-column-eligibility.d.ts +0 -1
  119. package/dist/components/data/data-table/data-table-picker-column-eligibility.js +0 -7
  120. package/dist/components/data/data-table/reconcile-column-tree-from-grid.d.ts +0 -12
  121. package/dist/components/data/data-table/reconcile-column-tree-from-grid.js +0 -12
  122. package/dist/components/data/nested-list/hooks/useVirtualNestedListDrag.d.ts +0 -24
  123. package/dist/components/data/nested-list/hooks/useVirtualNestedListDrag.js +0 -128
  124. package/dist/components/data/nested-list/nested-list-display-utils.d.ts +0 -11
  125. package/dist/components/data/nested-list/nested-list-display-utils.js +0 -74
  126. package/dist/components/data/nested-list/nested-list-drop-engine.d.ts +0 -31
  127. package/dist/components/data/nested-list/nested-list-drop-engine.js +0 -209
  128. package/dist/components/data/nested-list/nested-list-flat-virtual-handlers.d.ts +0 -26
  129. package/dist/components/data/nested-list/nested-list-flat-virtual-handlers.js +0 -67
  130. package/dist/components/data/nested-list/nested-list-item-tree-mutations.d.ts +0 -4
  131. package/dist/components/data/nested-list/nested-list-item-tree-mutations.js +0 -43
  132. package/dist/components/data/nested-list/nested-list-lazy-flat-rows.d.ts +0 -3
  133. package/dist/components/data/nested-list/nested-list-lazy-flat-rows.js +0 -34
  134. package/dist/components/data/nested-list/nested-list-row-estimates.d.ts +0 -9
  135. package/dist/components/data/nested-list/nested-list-row-estimates.js +0 -14
  136. package/dist/components/data/nested-list/nested-list-scroll-anchor.d.ts +0 -36
  137. package/dist/components/data/nested-list/nested-list-scroll-anchor.js +0 -47
  138. package/dist/components/data/nested-list/nested-list-virtual-drop.d.ts +0 -59
  139. package/dist/components/data/nested-list/nested-list-virtual-drop.js +0 -341
  140. package/dist/lib/hash/fnv1a128.d.ts +0 -16
  141. package/dist/lib/hash/fnv1a128.js +0 -21
@@ -1,151 +1,152 @@
1
- import { jsx as H } from "react/jsx-runtime";
2
- import * as x from "react";
1
+ import { jsx as x } from "react/jsx-runtime";
2
+ import * as B from "react";
3
3
  import { DayPicker as pr } from "react-day-picker";
4
- import { cn as dr } from "../../../lib/utils.js";
5
- import { formatPeriodOption as ur } from "./calendar-fiscal-labels.js";
4
+ import { cn as ur } from "../../../lib/utils.js";
5
+ import { formatPeriodOption as dr } from "./calendar-fiscal-labels.js";
6
6
  import { CalendarDayHoverProvider as gr } from "./calendar-day-hover.js";
7
7
  import { previewModifierClassNames as vr, fiscalPeriodBoundaryClassNames as Pr } from "./calendar-day-picker-classnames.js";
8
- import { isPreviewCap as d, dayKey as l, isPreviewMiddle as _r } from "./calendar-selection.js";
8
+ import { isPreviewCap as u, dayKey as l, isPreviewMiddle as _r } from "./calendar-selection.js";
9
9
  import { useCalendarDayPickerConfig as yr } from "./use-calendar-day-picker-config.js";
10
10
  function Br({
11
- className: B,
11
+ className: E,
12
12
  pickerType: s,
13
13
  mode: e,
14
14
  weekMode: f,
15
15
  calendarKind: m,
16
- granularity: E,
17
- showOutsideDays: u,
16
+ granularity: F,
17
+ showOutsideDays: d,
18
18
  fixedWeeks: g,
19
- captionLayout: F,
20
- buttonVariant: L,
19
+ captionLayout: L,
20
+ buttonVariant: O,
21
21
  weekStartsOn: v,
22
- formatters: O,
23
- classNames: V,
24
- components: Y,
22
+ formatters: V,
23
+ classNames: Y,
24
+ components: k,
25
25
  selected: P,
26
26
  showFooter: _,
27
27
  showPeriodBoundaries: p,
28
28
  pendingSelection: y,
29
- selectedDaysFromWeeks: k,
29
+ selectedDaysFromWeeks: R,
30
30
  currentMonth: D,
31
- monthsFull: R,
32
- monthsShort: $,
33
- weekNumberHeader: q,
34
- resolvedStartMonth: b,
35
- resolvedEndMonth: w,
36
- availableYears: z,
31
+ monthsFull: $,
32
+ monthsShort: q,
33
+ weekNumberHeader: z,
34
+ resolvedStartMonth: w,
35
+ resolvedEndMonth: b,
36
+ availableYears: A,
37
37
  fiscalPeriods: C,
38
- fiscalConfig: A,
39
- dateFnsLocale: G,
40
- intlLocale: I,
41
- weekRangeModifiers: J,
42
- onSelect: M,
38
+ fiscalConfig: G,
39
+ dateFnsLocale: I,
40
+ intlLocale: J,
41
+ weekRangeModifiers: M,
42
+ onSelect: Q,
43
43
  onMonthChange: N,
44
- onWeekSelect: Q,
45
- previousMonthLabel: U,
46
- nextMonthLabel: X,
47
- monthPlaceholder: Z,
48
- yearPlaceholder: W,
44
+ onWeekSelect: U,
45
+ previousMonthLabel: X,
46
+ nextMonthLabel: Z,
47
+ monthPlaceholder: W,
48
+ yearPlaceholder: K,
49
49
  weekNumberLabel: S,
50
- weekLabel: K,
51
- fiscalWeekAriaLabel: T,
50
+ weekLabel: T,
51
+ fiscalWeekAriaLabel: rr,
52
52
  getCellMeta: n,
53
- formatWeekNumber: rr,
54
- disabled: or,
55
- showWeekNumber: h = !0,
53
+ formatWeekNumber: or,
54
+ disabled: h,
55
+ showWeekNumber: j = !0,
56
56
  ...tr
57
57
  }) {
58
58
  const { dayPickerClassNames: ar, dayPickerComponents: ir } = yr({
59
- buttonVariant: L,
59
+ buttonVariant: O,
60
60
  pickerType: s,
61
61
  calendarKind: m,
62
- granularity: E,
63
- showOutsideDays: u,
64
- classNames: V,
62
+ granularity: F,
63
+ showOutsideDays: d,
64
+ classNames: Y,
65
65
  currentMonth: D,
66
- monthsFull: R,
67
- monthsShort: $,
68
- weekNumberHeader: q,
69
- resolvedStartMonth: b,
70
- resolvedEndMonth: w,
71
- availableYears: z,
66
+ monthsFull: $,
67
+ monthsShort: q,
68
+ weekNumberHeader: z,
69
+ resolvedStartMonth: w,
70
+ resolvedEndMonth: b,
71
+ availableYears: A,
72
72
  fiscalPeriods: C,
73
- fiscalConfig: A,
73
+ fiscalConfig: G,
74
74
  weekStartsOn: v,
75
- previousMonthLabel: U,
76
- nextMonthLabel: X,
77
- monthPlaceholder: Z,
78
- yearPlaceholder: W,
75
+ previousMonthLabel: X,
76
+ nextMonthLabel: Z,
77
+ monthPlaceholder: W,
78
+ yearPlaceholder: K,
79
79
  weekNumberLabel: S,
80
- weekLabel: K,
80
+ weekLabel: T,
81
81
  fiscalWeekNumberLabel: S,
82
- fiscalWeekAriaLabel: T,
82
+ fiscalWeekAriaLabel: rr,
83
83
  getCellMeta: n,
84
84
  onMonthChange: N,
85
- onWeekSelect: Q,
85
+ onWeekSelect: U,
86
86
  weekMode: f,
87
87
  showPeriodBoundaries: p,
88
- showWeekNumber: h,
89
- components: Y
90
- }), er = e === "range" || e === "multiple" || e === "multi-range" || f === "range" || f === "multiple" || f === "multi-range" ? 2 : 1, nr = s === "week" || e === "multi-range" ? "multiple" : e, sr = g || m === "fiscal" || u, j = p && n ? {
88
+ showWeekNumber: j,
89
+ disabled: h,
90
+ components: k
91
+ }), er = e === "range" || e === "multiple" || e === "multi-range" || f === "range" || f === "multiple" || f === "multi-range" ? 2 : 1, nr = s === "week" || e === "multi-range" ? "multiple" : e, sr = g || m === "fiscal" || d, H = p && n ? {
91
92
  fiscal_period_start: (r) => !!n(r)?.isPeriodStart,
92
93
  fiscal_period_end: (r) => !!n(r)?.isPeriodEnd
93
- } : void 0, [t, cr] = x.useState(), fr = x.useCallback((r) => {
94
+ } : void 0, [t, cr] = B.useState(), fr = B.useCallback((r) => {
94
95
  cr((o) => !o && !r || o && r && o.getFullYear() === r.getFullYear() && o.getMonth() === r.getMonth() && o.getDate() === r.getDate() ? o : r);
95
96
  }, []), a = _ ? y : P, i = e === "range" && a && typeof a == "object" && "from" in a ? a.from : void 0, mr = e === "range" && a && typeof a == "object" && "to" in a ? a.to : void 0;
96
- return /* @__PURE__ */ H(gr, { onDayHover: fr, children: /* @__PURE__ */ H(
97
+ return /* @__PURE__ */ x(gr, { onDayHover: fr, children: /* @__PURE__ */ x(
97
98
  pr,
98
99
  {
99
100
  mode: nr,
100
- selected: s === "week" ? k : _ ? y : P,
101
+ selected: s === "week" ? R : _ ? y : P,
101
102
  onSelect: (...r) => {
102
103
  const [o, c] = r;
103
- M(o, c instanceof Date ? c : void 0);
104
+ Q(o, c instanceof Date ? c : void 0);
104
105
  },
105
106
  month: D,
106
107
  onMonthChange: N,
107
108
  fixedWeeks: g,
108
109
  showOutsideDays: sr,
109
110
  weekStartsOn: v,
110
- modifiers: s === "week" ? { ...J, ...j } : { ...j, ...s === "date" && !!(i && !mr && t) && i && t ? {
111
+ modifiers: s === "week" ? { ...M, ...H } : { ...H, ...s === "date" && !!(i && !mr && t) && i && t ? {
111
112
  preview: (r) => _r(r, i, t),
112
- preview_cap: (r) => d(r, i, t),
113
- preview_cap_start: (r) => d(r, i, t) && l(t) < l(i),
114
- preview_cap_end: (r) => d(r, i, t) && l(t) > l(i)
113
+ preview_cap: (r) => u(r, i, t),
114
+ preview_cap_start: (r) => u(r, i, t) && l(t) < l(i),
115
+ preview_cap_end: (r) => u(r, i, t) && l(t) > l(i)
115
116
  } : void 0 },
116
117
  modifiersClassNames: {
117
118
  ...p && m === "fiscal" ? Pr : void 0,
118
119
  ...vr
119
120
  },
120
- locale: G,
121
- className: dr(
121
+ locale: I,
122
+ className: ur(
122
123
  "bg-canvas group/calendar p-2 [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",
123
124
  String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
124
125
  String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
125
- B
126
+ E
126
127
  ),
127
- captionLayout: F,
128
+ captionLayout: L,
128
129
  navLayout: "around",
129
- startMonth: b,
130
- endMonth: w,
131
- disabled: or,
130
+ startMonth: w,
131
+ endMonth: b,
132
+ disabled: h,
132
133
  numberOfMonths: er,
133
134
  formatters: {
134
135
  formatMonthDropdown: (r) => {
135
136
  if (m === "fiscal" && n) {
136
137
  const o = n(r), c = C?.find((lr) => lr.period === o?.fiscalPeriod);
137
- if (c) return ur(c);
138
+ if (c) return dr(c);
138
139
  if (o?.fiscalPeriod != null) return `P${o.fiscalPeriod}`;
139
140
  }
140
- return r.toLocaleString(I, { month: "short" });
141
+ return r.toLocaleString(J, { month: "short" });
141
142
  },
142
- formatWeekNumber: rr,
143
- ...O
143
+ formatWeekNumber: or,
144
+ ...V
144
145
  },
145
146
  classNames: ar,
146
147
  components: ir,
147
148
  ...tr,
148
- showWeekNumber: h
149
+ showWeekNumber: j
149
150
  }
150
151
  ) });
151
152
  }
@@ -0,0 +1,9 @@
1
+ import { CalendarDay } from 'react-day-picker';
2
+ import * as React from "react";
3
+ /** DayPicker hides days before startMonth. Fiscal first-week July days still belong in the August grid. */
4
+ export declare function FiscalDayCell({ day, modifiers, children, className, ...tdProps }: {
5
+ day: CalendarDay;
6
+ modifiers: Record<string, boolean>;
7
+ children?: React.ReactNode;
8
+ className?: string;
9
+ } & React.TdHTMLAttributes<HTMLTableCellElement>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,45 @@
1
+ import { jsx as n } from "react/jsx-runtime";
2
+ import "react";
3
+ import { useDayPicker as m } from "react-day-picker";
4
+ import { cn as h } from "../../../lib/utils.js";
5
+ import { callDayPickerSelect as p } from "./calendar-selection.js";
6
+ function b(t) {
7
+ return t && (t.split(/\s+/).filter((i) => i !== "invisible" && i !== "rdp-hidden" && i !== "hidden").join(" ") || void 0);
8
+ }
9
+ function B({
10
+ day: t,
11
+ modifiers: e,
12
+ children: i,
13
+ className: o,
14
+ ...d
15
+ }) {
16
+ const l = !!(e.hidden && t.outside), { classNames: r, components: c, formatters: a, select: u } = m();
17
+ if (!l)
18
+ return /* @__PURE__ */ n("td", { className: o, ...d, children: i });
19
+ const s = { ...e, hidden: !1 };
20
+ return /* @__PURE__ */ n(
21
+ "td",
22
+ {
23
+ ...d,
24
+ "data-hidden": void 0,
25
+ className: h(b(o), r.outside),
26
+ children: /* @__PURE__ */ n(
27
+ c.DayButton,
28
+ {
29
+ className: r.day_button,
30
+ type: "button",
31
+ day: t,
32
+ modifiers: s,
33
+ disabled: e.disabled || void 0,
34
+ onClick: (f) => {
35
+ p(u, t.date, s, f);
36
+ },
37
+ children: a.formatDay(t.date)
38
+ }
39
+ )
40
+ }
41
+ );
42
+ }
43
+ export {
44
+ B as FiscalDayCell
45
+ };
@@ -14,3 +14,9 @@ export declare function dominantCivilMonthForPeriod(period: FiscalPeriod): {
14
14
  export declare function visibleMonthForPeriod(period: FiscalPeriod, isRightPanel: boolean): Date;
15
15
  /** Period that occupies the most days of a civil month (caption selected value). */
16
16
  export declare function periodForCivilMonth(periods: readonly FiscalPeriod[], year: number, monthIndex: number): FiscalPeriod | undefined;
17
+ export declare function periodsAvailableInBounds(periods: readonly FiscalPeriod[], disabled?: unknown): FiscalPeriod[];
18
+ export declare function periodForFiscalYearChange(options: {
19
+ periods: readonly FiscalPeriod[];
20
+ preferredPeriod?: number;
21
+ disabled?: unknown;
22
+ }): FiscalPeriod | undefined;
@@ -1,17 +1,18 @@
1
- import { setDate as m, startOfMonth as s, addMonths as h } from "date-fns";
2
- import { parseCivilDate as d, toCivilDate as l, lastDayOfMonth as y, compareCivil as u, diffDays as v, minCivil as M, maxCivil as p } from "../../../lib/fiscal-calendar/civil-date.js";
3
- function x(t) {
1
+ import { setDate as m, startOfMonth as s, addMonths as f } from "date-fns";
2
+ import { localDateFromCivil as d, parseCivilDate as h, toCivilDate as u, lastDayOfMonth as v, compareCivil as y, diffDays as p, minCivil as D, maxCivil as M } from "../../../lib/fiscal-calendar/civil-date.js";
3
+ import { isDateIntervalDisabled as C } from "./calendar-month-utils.js";
4
+ function O(t) {
4
5
  return m(s(t), 15);
5
6
  }
6
- function b(t, n) {
7
- return s(h(t, n));
7
+ function S(t, n) {
8
+ return s(f(t, n));
8
9
  }
9
10
  function c(t, n, o, e) {
10
- const r = l(o, e + 1, 1), a = y(o, e + 1), i = p(t, r), f = M(n, a);
11
- return u(i, f) > 0 ? 0 : v(f, i) + 1;
11
+ const r = u(o, e + 1, 1), a = v(o, e + 1), i = M(t, r), l = D(n, a);
12
+ return y(i, l) > 0 ? 0 : p(l, i) + 1;
12
13
  }
13
- function C(t) {
14
- const n = d(t.start);
14
+ function b(t) {
15
+ const n = h(t.start);
15
16
  let o = { year: n.y, monthIndex: n.m - 1, days: 0 };
16
17
  const e = t.gregorianMonthSpan.length > 0 ? t.gregorianMonthSpan : [{ year: n.y, month: n.m - 1 }];
17
18
  for (const { year: r, month: a } of e) {
@@ -20,11 +21,11 @@ function C(t) {
20
21
  }
21
22
  return { year: o.year, monthIndex: o.monthIndex };
22
23
  }
23
- function I(t, n) {
24
- const { year: o, monthIndex: e } = C(t), r = s(new Date(o, e, 1));
25
- return n ? h(r, -1) : r;
24
+ function P(t, n) {
25
+ const { year: o, monthIndex: e } = b(t), r = s(new Date(o, e, 1));
26
+ return n ? f(r, -1) : r;
26
27
  }
27
- function O(t, n, o) {
28
+ function A(t, n, o) {
28
29
  let e, r = 0;
29
30
  for (const a of t) {
30
31
  const i = c(a.start, a.end, n, o);
@@ -32,10 +33,25 @@ function O(t, n, o) {
32
33
  }
33
34
  return e;
34
35
  }
36
+ function g(t, n) {
37
+ return t.filter(
38
+ (o) => !C(
39
+ d(o.start),
40
+ d(o.end),
41
+ n
42
+ )
43
+ );
44
+ }
45
+ function E(t) {
46
+ const n = g(t.periods, t.disabled);
47
+ return n.find((o) => o.period === t.preferredPeriod) ?? n[0];
48
+ }
35
49
  export {
36
- b as civilMonthAtOffset,
37
- C as dominantCivilMonthForPeriod,
38
- x as midMonthDate,
39
- O as periodForCivilMonth,
40
- I as visibleMonthForPeriod
50
+ S as civilMonthAtOffset,
51
+ b as dominantCivilMonthForPeriod,
52
+ O as midMonthDate,
53
+ A as periodForCivilMonth,
54
+ E as periodForFiscalYearChange,
55
+ g as periodsAvailableInBounds,
56
+ P as visibleMonthForPeriod
41
57
  };
@@ -2,7 +2,7 @@ import { jsxs as f, jsx as l } from "react/jsx-runtime";
2
2
  import "react";
3
3
  import { cn as u } from "../../../lib/utils.js";
4
4
  import { Button as d } from "../../primitives/button/button.js";
5
- import { formatDateRangeFooterSummary as w, formatWeekFooterSummary as z, formatMonthFooterSummary as Y, formatQuarterFooterSummary as G, formatYearFooterSummary as I } from "./calendar-footer-summary.js";
5
+ import { formatDateRangeFooterSummary as _, formatWeekFooterSummary as z, formatMonthFooterSummary as Y, formatQuarterFooterSummary as G, formatYearFooterSummary as I } from "./calendar-footer-summary.js";
6
6
  const h = "relative isolate overflow-hidden animate-flash-highlight motion-reduce:animate-none", $ = {
7
7
  "--flash-overlay": "color-mix(in srgb, white 55%, transparent)"
8
8
  };
@@ -13,7 +13,7 @@ function a({
13
13
  return /* @__PURE__ */ f(
14
14
  "div",
15
15
  {
16
- className: "flex flex-row items-center gap-1 text-xs font-medium leading-[18px] text-content-tertiary",
16
+ className: "flex min-w-0 flex-row items-center gap-1 text-xs font-medium leading-[18px] text-content-tertiary",
17
17
  "aria-live": "polite",
18
18
  "aria-atomic": "true",
19
19
  children: [
@@ -28,7 +28,7 @@ function O({
28
28
  mode: n,
29
29
  weekMode: i,
30
30
  monthMode: r,
31
- yearMode: s = "single",
31
+ yearMode: m = "single",
32
32
  calendarKind: S,
33
33
  granularity: v,
34
34
  resolvedFiscalPattern: B,
@@ -39,26 +39,26 @@ function O({
39
39
  pendingQuarterSelection: N,
40
40
  pendingYearSelection: P,
41
41
  multiRangeSummary: g,
42
- disableApply: C,
43
- isApplyDisabled: H,
42
+ disableApply: w,
43
+ isApplyDisabled: C,
44
44
  footerFlashKey: c = 0,
45
45
  footerFlashTarget: p,
46
46
  labels: e,
47
- onClear: j,
48
- onCancel: q,
49
- onApply: A
47
+ onClear: H,
48
+ onCancel: j,
49
+ onApply: q
50
50
  }) {
51
- const _ = t === "month" && r !== "single" || t === "quarter" && r !== "single" || t === "year" && s !== "single" || n === "range" || n === "multi-range" || i === "range" || i === "multiple", m = c > 0 && p === "cancel", o = c > 0 && p === "apply";
51
+ const A = t === "month" && r !== "single" || t === "quarter" && r !== "single" || t === "year" && m !== "single" || n === "range" || n === "multi-range" || i === "range" || i === "multiple", s = c > 0 && p === "cancel", o = c > 0 && p === "apply";
52
52
  return /* @__PURE__ */ f(
53
53
  "div",
54
54
  {
55
55
  className: u(
56
- "flex items-center gap-2 border-t p-3 pt-3",
57
- _ ? "justify-between" : "justify-end"
56
+ "flex min-w-0 items-center gap-2 border-t p-3 pt-3",
57
+ A ? "justify-between" : "justify-end"
58
58
  ),
59
59
  children: [
60
60
  n === "multi-range" && g ? /* @__PURE__ */ l(a, { selectedLabel: e.selected, children: g }) : null,
61
- n === "range" && t === "date" ? /* @__PURE__ */ l(a, { selectedLabel: e.selected, children: w(L) }) : null,
61
+ n === "range" && t === "date" ? /* @__PURE__ */ l(a, { selectedLabel: e.selected, children: _(L) }) : null,
62
62
  t === "week" && (i === "range" || i === "multiple") ? /* @__PURE__ */ l(a, { selectedLabel: e.selected, children: z({
63
63
  selection: y,
64
64
  calendarKind: S,
@@ -73,23 +73,23 @@ function O({
73
73
  single: e.quarterSingle,
74
74
  plural: e.quarterPlural
75
75
  }) }) : null,
76
- t === "year" && (s === "range" || s === "multiple") ? /* @__PURE__ */ l(a, { selectedLabel: e.selected, children: I(P, {
76
+ t === "year" && (m === "range" || m === "multiple") ? /* @__PURE__ */ l(a, { selectedLabel: e.selected, children: I(P, {
77
77
  single: e.yearSingle,
78
78
  plural: e.yearPlural
79
79
  }) }) : null,
80
- /* @__PURE__ */ f("div", { className: "flex items-center gap-2", children: [
81
- /* @__PURE__ */ l(d, { variant: "link", size: "md", onClick: j, children: e.clear }),
80
+ /* @__PURE__ */ f("div", { className: "flex shrink-0 items-center gap-2", children: [
81
+ /* @__PURE__ */ l(d, { variant: "link", size: "md", onClick: H, children: e.clear }),
82
82
  /* @__PURE__ */ l(
83
83
  d,
84
84
  {
85
85
  variant: "outline",
86
86
  size: "md",
87
- "data-footer-flash": m ? "cancel" : void 0,
88
- className: u(m && h),
89
- onClick: q,
87
+ "data-footer-flash": s ? "cancel" : void 0,
88
+ className: u(s && h),
89
+ onClick: j,
90
90
  children: e.cancel
91
91
  },
92
- m ? `footer-cancel-${c}` : "footer-cancel"
92
+ s ? `footer-cancel-${c}` : "footer-cancel"
93
93
  ),
94
94
  /* @__PURE__ */ l(
95
95
  d,
@@ -99,8 +99,8 @@ function O({
99
99
  "data-footer-flash": o ? "apply" : void 0,
100
100
  style: o ? $ : void 0,
101
101
  className: u(o && h),
102
- onClick: A,
103
- disabled: C || H,
102
+ onClick: q,
103
+ disabled: w || C,
104
104
  children: e.apply
105
105
  },
106
106
  o ? `footer-apply-${c}` : "footer-apply"
@@ -0,0 +1,5 @@
1
+ import { FiscalWeek } from '../../../lib/fiscal-calendar';
2
+ export declare function InjectedFiscalWeekRow({ fiscalWeek, displayMonth, }: {
3
+ fiscalWeek: FiscalWeek;
4
+ displayMonth: Date;
5
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,92 @@
1
+ import { jsxs as w, jsx as r } from "react/jsx-runtime";
2
+ import { useDayPicker as g } from "react-day-picker";
3
+ import { cn as D } from "../../../lib/utils.js";
4
+ import { fiscalWeekToCalendarWeek as N } from "./calendar-leading-week.utils.js";
5
+ import { injectedCalendarDayModifiers as W, callDayPickerSelect as _ } from "./calendar-selection.js";
6
+ function x({
7
+ fiscalWeek: c,
8
+ displayMonth: n
9
+ }) {
10
+ const {
11
+ classNames: t,
12
+ components: s,
13
+ formatters: m,
14
+ getModifiers: u,
15
+ isSelected: f,
16
+ select: k,
17
+ dayPickerProps: a
18
+ } = g(), o = N(c, n), b = a.showWeekNumber !== !1;
19
+ return /* @__PURE__ */ w(
20
+ s.Week,
21
+ {
22
+ className: t.week,
23
+ week: o,
24
+ "data-fiscal-injected": "true",
25
+ children: [
26
+ b ? /* @__PURE__ */ r(
27
+ s.WeekNumber,
28
+ {
29
+ week: o,
30
+ className: t.week_number,
31
+ scope: "row",
32
+ role: "rowheader"
33
+ }
34
+ ) : null,
35
+ o.days.map((d) => {
36
+ const i = u(d), l = W({
37
+ date: d.date,
38
+ disabled: a.disabled,
39
+ today: a.today,
40
+ isSelected: f,
41
+ customModifiers: a.modifiers
42
+ }), e = {
43
+ ...i,
44
+ ...l,
45
+ outside: d.outside || i.outside,
46
+ selected: l.selected || i.selected
47
+ };
48
+ return /* @__PURE__ */ r(
49
+ s.Day,
50
+ {
51
+ day: d,
52
+ modifiers: e,
53
+ className: D(
54
+ t.day,
55
+ e.outside && t.outside,
56
+ e.selected && t.selected,
57
+ e.disabled && t.disabled,
58
+ e.today && t.today,
59
+ e.range_start && t.range_start,
60
+ e.range_middle && t.range_middle,
61
+ e.range_end && t.range_end
62
+ ),
63
+ role: "gridcell",
64
+ "data-day": d.isoDate,
65
+ "data-outside": d.outside || void 0,
66
+ "data-selected": e.selected || void 0,
67
+ "data-disabled": e.disabled || void 0,
68
+ children: /* @__PURE__ */ r(
69
+ s.DayButton,
70
+ {
71
+ className: t.day_button,
72
+ type: "button",
73
+ day: d,
74
+ modifiers: e,
75
+ disabled: e.disabled || void 0,
76
+ onClick: (p) => {
77
+ e.disabled || _(k, d.date, e, p);
78
+ },
79
+ children: m.formatDay(d.date)
80
+ }
81
+ )
82
+ },
83
+ d.isoDate
84
+ );
85
+ })
86
+ ]
87
+ }
88
+ );
89
+ }
90
+ export {
91
+ x as InjectedFiscalWeekRow
92
+ };
@@ -0,0 +1,16 @@
1
+ import { CalendarWeek } from 'react-day-picker';
2
+ import { FiscalCalendarConfig, FiscalWeek } from '../../../lib/fiscal-calendar';
3
+ /** Fiscal weeks owned by this pane that DayPicker never puts in this civil month. */
4
+ export declare function ownedWeeksOutsidePane(options: {
5
+ paneYear: number;
6
+ paneMonthIndex: number;
7
+ panePeriod?: number;
8
+ fiscalConfig?: FiscalCalendarConfig;
9
+ fy?: number;
10
+ }): {
11
+ leading: FiscalWeek[];
12
+ trailing: FiscalWeek[];
13
+ };
14
+ /** Static Tailwind classes — JIT cannot see dynamic nth-last-child counts. */
15
+ export declare function injectedWeekCollapseClass(count: number): string | undefined;
16
+ export declare function fiscalWeekToCalendarWeek(week: FiscalWeek, displayMonth: Date): CalendarWeek;
@@ -0,0 +1,51 @@
1
+ import { CalendarDay as f, CalendarWeek as u } from "react-day-picker";
2
+ import { localDateFromCivil as c, addDays as h, parseCivilDate as s } from "../../../lib/fiscal-calendar/civil-date.js";
3
+ import { buildFiscalYear as m } from "../../../lib/fiscal-calendar/build-year.js";
4
+ function p(e, i, n, r) {
5
+ const t = (l) => {
6
+ const { y: d, m: o } = s(l);
7
+ return d < n || d === n && o - 1 < r;
8
+ };
9
+ return t(e) && t(i);
10
+ }
11
+ function C(e, i, n, r) {
12
+ const t = (l) => {
13
+ const { y: d, m: o } = s(l);
14
+ return d > n || d === n && o - 1 > r;
15
+ };
16
+ return t(e) && t(i);
17
+ }
18
+ function W(e) {
19
+ const { paneYear: i, paneMonthIndex: n, panePeriod: r, fiscalConfig: t, fy: l } = e;
20
+ if (r == null || !t || l == null)
21
+ return { leading: [], trailing: [] };
22
+ try {
23
+ const o = m(t, l).weeks.filter((a) => a.period === r);
24
+ return {
25
+ leading: o.filter(
26
+ (a) => p(a.start, a.end, i, n)
27
+ ),
28
+ trailing: o.filter(
29
+ (a) => C(a.start, a.end, i, n)
30
+ )
31
+ };
32
+ } catch {
33
+ return { leading: [], trailing: [] };
34
+ }
35
+ }
36
+ function k(e) {
37
+ if (!(e <= 0))
38
+ return e === 1 ? "[&>tr[aria-hidden]:last-child]:hidden" : e === 2 ? "[&>tr[aria-hidden]:nth-last-child(-n+2)]:hidden" : "[&>tr[aria-hidden]:nth-last-child(-n+3)]:hidden";
39
+ }
40
+ function D(e, i) {
41
+ const n = [];
42
+ let r = e.start;
43
+ for (let t = 0; t < 7; t += 1)
44
+ n.push(new f(c(r), i)), r = h(r, 1);
45
+ return new u(e.week, n);
46
+ }
47
+ export {
48
+ D as fiscalWeekToCalendarWeek,
49
+ k as injectedWeekCollapseClass,
50
+ W as ownedWeeksOutsidePane
51
+ };