impact-nova 2.5.10 → 2.5.12

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 (73) hide show
  1. package/dist/components/data-display/calendar/calendar-apply-validation.d.ts +2 -0
  2. package/dist/components/data-display/calendar/calendar-apply-validation.js +64 -67
  3. package/dist/components/data-display/calendar/calendar-available-view.d.ts +27 -0
  4. package/dist/components/data-display/calendar/calendar-available-view.js +85 -0
  5. package/dist/components/data-display/calendar/calendar-config.js +1 -1
  6. package/dist/components/data-display/calendar/calendar-day-picker-components.d.ts +4 -2
  7. package/dist/components/data-display/calendar/calendar-day-picker-components.js +234 -164
  8. package/dist/components/data-display/calendar/calendar-day-picker-view.js +77 -76
  9. package/dist/components/data-display/calendar/calendar-fiscal-day-cell.d.ts +9 -0
  10. package/dist/components/data-display/calendar/calendar-fiscal-day-cell.js +45 -0
  11. package/dist/components/data-display/calendar/calendar-fiscal-period-nav.d.ts +6 -0
  12. package/dist/components/data-display/calendar/calendar-fiscal-period-nav.js +34 -18
  13. package/dist/components/data-display/calendar/calendar-footer.js +21 -21
  14. package/dist/components/data-display/calendar/calendar-injected-week-row.d.ts +5 -0
  15. package/dist/components/data-display/calendar/calendar-injected-week-row.js +92 -0
  16. package/dist/components/data-display/calendar/calendar-leading-week.utils.d.ts +16 -0
  17. package/dist/components/data-display/calendar/calendar-leading-week.utils.js +51 -0
  18. package/dist/components/data-display/calendar/calendar-month-picker-panel.js +50 -49
  19. package/dist/components/data-display/calendar/calendar-month-utils.d.ts +5 -0
  20. package/dist/components/data-display/calendar/calendar-month-utils.js +85 -64
  21. package/dist/components/data-display/calendar/calendar-orphan-week.d.ts +23 -0
  22. package/dist/components/data-display/calendar/calendar-padding-week.utils.d.ts +3 -1
  23. package/dist/components/data-display/calendar/calendar-padding-week.utils.js +7 -5
  24. package/dist/components/data-display/calendar/calendar-period-cell.js +45 -46
  25. package/dist/components/data-display/calendar/calendar-quarter-panes.js +33 -31
  26. package/dist/components/data-display/calendar/calendar-selection-appearance.d.ts +10 -0
  27. package/dist/components/data-display/calendar/calendar-selection-appearance.js +53 -39
  28. package/dist/components/data-display/calendar/calendar-selection.d.ts +25 -0
  29. package/dist/components/data-display/calendar/calendar-selection.js +52 -23
  30. package/dist/components/data-display/calendar/calendar-week-number-cell.d.ts +2 -1
  31. package/dist/components/data-display/calendar/calendar-week-number-cell.js +59 -45
  32. package/dist/components/data-display/calendar/calendar-week-utils.d.ts +13 -3
  33. package/dist/components/data-display/calendar/calendar-week-utils.js +59 -50
  34. package/dist/components/data-display/calendar/calendar-year-panes.d.ts +3 -0
  35. package/dist/components/data-display/calendar/calendar-year-panes.js +53 -49
  36. package/dist/components/data-display/calendar/calendar.js +146 -143
  37. package/dist/components/data-display/calendar/calendar.types.d.ts +5 -0
  38. package/dist/components/data-display/calendar/use-calendar-day-picker-config.d.ts +2 -1
  39. package/dist/components/data-display/calendar/use-calendar-day-picker-config.js +79 -74
  40. package/dist/components/data-display/calendar/use-calendar-state.d.ts +3 -1
  41. package/dist/components/data-display/calendar/use-calendar-state.js +403 -325
  42. package/dist/components/forms/date-picker/date-picker.js +60 -58
  43. package/dist/components/forms/date-picker/date-picker.types.d.ts +5 -0
  44. package/dist/components/forms/date-picker/date-range-picker.js +66 -64
  45. package/dist/components/forms/date-picker/fiscal-pass-through.d.ts +1 -0
  46. package/dist/components/forms/date-picker/fiscal-pass-through.js +3 -2
  47. package/dist/components/forms/date-picker/fiscal-picker-fixtures.d.ts +17 -0
  48. package/dist/components/forms/date-picker/month-picker.js +61 -59
  49. package/dist/components/forms/date-picker/month-range-picker.js +63 -61
  50. package/dist/components/forms/date-picker/multi-date-picker.js +51 -49
  51. package/dist/components/forms/date-picker/multi-month-picker.js +49 -47
  52. package/dist/components/forms/date-picker/multi-quarter-picker.js +51 -47
  53. package/dist/components/forms/date-picker/multi-week-picker.js +53 -51
  54. package/dist/components/forms/date-picker/multi-year-picker.js +53 -49
  55. package/dist/components/forms/date-picker/quarter-picker.js +51 -47
  56. package/dist/components/forms/date-picker/quarter-range-picker.js +50 -46
  57. package/dist/components/forms/date-picker/week-picker.js +68 -66
  58. package/dist/components/forms/date-picker/week-range-picker.js +82 -80
  59. package/dist/components/forms/date-picker/year-picker.js +52 -48
  60. package/dist/components/forms/date-picker/year-range-picker.js +52 -48
  61. package/dist/form-react/Fields/DateInputField.js +51 -50
  62. package/dist/form-react/Fields/DateRangeField.js +14 -13
  63. package/dist/form-react/Fields/MonthRangeField.js +29 -28
  64. package/dist/form-react/Fields/MultiMonthPickerField.js +13 -12
  65. package/dist/form-react/Fields/MultiWeekPickerField.js +35 -27
  66. package/dist/form-react/Fields/WeekRangePicker.js +33 -32
  67. package/dist/form-react/types/fields.types.d.ts +14 -0
  68. package/dist/impact-nova-components.css +13 -6
  69. package/dist/impact-nova.css +1 -1
  70. package/dist/lib/fiscal-calendar/week-selection.js +2 -2
  71. package/dist/llms/rules/installation.js +1 -1
  72. package/dist/llms/rules/requirements.js +1 -1
  73. package/package.json +1 -1
@@ -1,56 +1,57 @@
1
1
  import { jsxs as d, jsx as t } from "react/jsx-runtime";
2
- import { ChevronRight as g } from "impact-nova-icons";
3
- import { cn as A } from "../../../lib/utils.js";
4
- import { Button as f } from "../../primitives/button/button.js";
5
- import { Select as D } from "../../forms/select/select.js";
6
- import { isMonthRangeSelection as F } from "../../forms/date-picker/calendar-selection-adapters.js";
7
- import { CalendarPeriodCell as G } from "./calendar-period-cell.js";
2
+ import { ChevronRight as f } from "impact-nova-icons";
3
+ import { cn as T } from "../../../lib/utils.js";
4
+ import { Button as g } from "../../primitives/button/button.js";
5
+ import { Select as B } from "../../forms/select/select.js";
6
+ import { isMonthRangeSelection as W } from "../../forms/date-picker/calendar-selection-adapters.js";
7
+ import { CalendarPeriodCell as q } from "./calendar-period-cell.js";
8
+ import { PERIOD_RANGE_GRID_CLASSNAME as F } from "./calendar-selection-appearance.js";
8
9
  function Z({
9
- yearOffset: o = 0,
10
+ yearOffset: c = 0,
10
11
  displayYear: e,
11
12
  monthMode: s,
12
13
  monthsShort: u,
13
- showFooter: p,
14
+ showFooter: N,
14
15
  pendingMonthSelection: v,
15
- selectedMonths: N,
16
- resolvedStartYear: x,
17
- resolvedEndYear: C,
16
+ selectedMonths: p,
17
+ resolvedStartYear: C,
18
+ resolvedEndYear: S,
18
19
  yearOptions: l,
19
- previousYearLabel: a,
20
- nextYearLabel: r,
21
- isMonthSelected: S,
22
- getMonthRangeProps: k,
23
- isMonthDisabled: w,
24
- onPreviousYear: j,
25
- onNextYear: z,
26
- onYearSelect: b,
27
- onMonthClick: R,
20
+ previousYearLabel: r,
21
+ nextYearLabel: a,
22
+ isMonthSelected: x,
23
+ getMonthRangeProps: R,
24
+ isMonthDisabled: k,
25
+ onPreviousYear: w,
26
+ onNextYear: j,
27
+ onYearSelect: z,
28
+ onMonthClick: E,
28
29
  periodLabels: i
29
30
  }) {
30
31
  return /* @__PURE__ */ d("div", { className: "flex flex-col gap-4 p-3 min-w-[280px]", children: [
31
32
  /* @__PURE__ */ d("div", { className: "flex items-center justify-between", children: [
32
- o === 0 ? /* @__PURE__ */ t(
33
- f,
33
+ c === 0 ? /* @__PURE__ */ t(
34
+ g,
34
35
  {
35
36
  variant: "ghost",
36
37
  size: "icon",
37
38
  className: "h-7 w-7 shrink-0",
38
- "aria-label": a,
39
- title: a,
40
- disabled: e <= x,
41
- onClick: () => j(e),
42
- children: /* @__PURE__ */ t(g, { size: 16, className: "rotate-180" })
39
+ "aria-label": r,
40
+ title: r,
41
+ disabled: e <= C,
42
+ onClick: () => w(e),
43
+ children: /* @__PURE__ */ t(f, { size: 16, className: "rotate-180" })
43
44
  }
44
45
  ) : /* @__PURE__ */ t("span", { className: "size-7 shrink-0", "aria-hidden": !0 }),
45
46
  /* @__PURE__ */ t("div", { className: "flex flex-1 items-center justify-center", children: /* @__PURE__ */ t(
46
- D,
47
+ B,
47
48
  {
48
49
  value: l.find((n) => n.value === e.toString()) ?? {
49
50
  label: e.toString(),
50
51
  value: e.toString()
51
52
  },
52
53
  onChange: (n) => {
53
- n && "value" in n && b(parseInt(n.value), o);
54
+ n && "value" in n && z(parseInt(n.value), c);
54
55
  },
55
56
  scrollToSelectedOnOpen: !0,
56
57
  options: l,
@@ -59,17 +60,17 @@ function Z({
59
60
  menuWidth: "140px"
60
61
  }
61
62
  ) }),
62
- (s === "single" || o === 1) && /* @__PURE__ */ t(
63
- f,
63
+ (s === "single" || c === 1) && /* @__PURE__ */ t(
64
+ g,
64
65
  {
65
66
  variant: "ghost",
66
67
  size: "icon",
67
68
  className: "h-7 w-7",
68
- "aria-label": r,
69
- title: r,
70
- disabled: e >= C,
71
- onClick: () => z(e),
72
- children: /* @__PURE__ */ t(g, { className: "h-4 w-4" })
69
+ "aria-label": a,
70
+ title: a,
71
+ disabled: e >= S,
72
+ onClick: () => j(e),
73
+ children: /* @__PURE__ */ t(f, { className: "h-4 w-4" })
73
74
  }
74
75
  )
75
76
  ] }),
@@ -77,23 +78,23 @@ function Z({
77
78
  "div",
78
79
  {
79
80
  "data-period-grid": "",
80
- className: A("grid gap-x-0 gap-y-4", i ? "grid-cols-3" : "grid-cols-4"),
81
- children: (i ?? u.map((n) => ({ label: n }))).map((n, c) => {
82
- const m = n.label, P = S(e, c), { isStart: E, isEnd: M, isMiddle: T } = k(e, c), B = s === "range", h = p ? v : N, I = F(h) && !!h.to, W = w(e, c), q = "caption" in n && typeof n.caption == "string" ? n.caption : void 0;
81
+ className: T(F, i ? "grid-cols-3" : "grid-cols-4"),
82
+ children: (i ?? u.map((n) => ({ label: n }))).map((n, o) => {
83
+ const m = n.label, b = x(e, o), { isStart: P, isEnd: A, isMiddle: I } = R(e, o), M = s === "range", h = N ? v : p, _ = W(h) && !!h.to, D = k(e, o), G = "caption" in n && typeof n.caption == "string" ? n.caption : void 0;
83
84
  return /* @__PURE__ */ t(
84
- G,
85
+ q,
85
86
  {
86
- selected: P,
87
- disabled: W,
88
- isRange: B,
89
- isStart: E,
90
- isEnd: M,
91
- isMiddle: T,
92
- hasRangeEnd: I,
87
+ selected: b,
88
+ disabled: D,
89
+ isRange: M,
90
+ isStart: P,
91
+ isEnd: A,
92
+ isMiddle: I,
93
+ hasRangeEnd: _,
93
94
  size: i ? "period" : "month",
94
95
  columns: i ? 3 : 4,
95
- onClick: () => R(e, c),
96
- caption: q,
96
+ onClick: () => E(e, o),
97
+ caption: G,
97
98
  children: m
98
99
  },
99
100
  m
@@ -1,4 +1,5 @@
1
1
  import { Option } from '../../forms/select';
2
+ import { Granularity } from '../../../lib/fiscal-calendar';
2
3
  import { MonthRange, MonthSelection } from './calendar.types';
3
4
  export declare function isSameMonth(m1: MonthSelection, m2: MonthSelection): boolean;
4
5
  export declare function nextMonthSelection(selection: MonthSelection, prev: MonthSelection | MonthSelection[] | MonthRange | undefined, monthMode: "single" | "multiple" | "range"): MonthSelection | MonthSelection[] | MonthRange | undefined;
@@ -10,6 +11,10 @@ export declare function getMonthRangeProps(year: number, month: number, currentS
10
11
  };
11
12
  /** True when the interval lies completely outside `disabled.before` / `disabled.after`. */
12
13
  export declare function isDateIntervalDisabled(start: Date, end: Date, disabled?: unknown): boolean;
14
+ /** True when every day of `[start, end]` is inside `disabled.before` / `disabled.after`. */
15
+ export declare function isWeekFullyInsideBounds(start: Date, end: Date, disabled?: unknown): boolean;
16
+ /** Week granularity requires every day in bounds; other granularities allow mixed weeks. */
17
+ export declare function isWeekSelectableInBounds(start: Date, end: Date, disabled?: unknown, granularity?: Granularity): boolean;
13
18
  export declare function isMonthDisabled(year: number, monthIndex: number, disabled?: unknown): boolean;
14
19
  export declare function getAvailableYears(startMonth: Date, endMonth: Date): Option[];
15
20
  export declare function getAvailableMonths(year: number, monthsFull: string[], startMonth: Date, endMonth: Date): Option[];
@@ -1,97 +1,118 @@
1
- import { isMonthRangeSelection as d } from "../../forms/date-picker/calendar-selection-adapters.js";
2
- function l(e, n) {
3
- return e.fy != null && n.fy != null && e.period != null && n.period != null ? e.fy === n.fy && e.period === n.period : e.year === n.year && e.month === n.month;
1
+ import { isMonthRangeSelection as c } from "../../forms/date-picker/calendar-selection-adapters.js";
2
+ function u(t, n) {
3
+ return t.fy != null && n.fy != null && t.period != null && n.period != null ? t.fy === n.fy && t.period === n.period : t.year === n.year && t.month === n.month;
4
4
  }
5
- function g(e, n, o) {
6
- if (o === "single") return e;
5
+ function g(t, n, o) {
6
+ if (o === "single") return t;
7
7
  if (o === "multiple") {
8
- const a = n || [];
9
- return a.some((f) => l(f, e)) ? a.filter((f) => !l(f, e)) : [...a, e];
8
+ const r = n || [];
9
+ return r.some((i) => u(i, t)) ? r.filter((i) => !u(i, t)) : [...r, t];
10
10
  }
11
- const t = n;
12
- if (!t?.from || t.to) return { from: e };
13
- const s = new Date(t.from.year, t.from.month, 1);
14
- return new Date(e.year, e.month, 1) < s ? { from: e, to: t.from } : { from: t.from, to: e };
11
+ const e = n;
12
+ if (!e?.from || e.to) return { from: t };
13
+ const s = new Date(e.from.year, e.from.month, 1);
14
+ return new Date(t.year, t.month, 1) < s ? { from: t, to: e.from } : { from: e.from, to: t };
15
15
  }
16
- function m(e, n, o) {
16
+ function w(t, n, o) {
17
17
  if (!o) return !1;
18
18
  if (Array.isArray(o)) {
19
- const s = { year: e, month: n, fy: e, period: n + 1 };
20
- return o.some((r) => l(r, s) || r.year === e && r.month === n);
19
+ const s = { year: t, month: n, fy: t, period: n + 1 };
20
+ return o.some((a) => u(a, s) || a.year === t && a.month === n);
21
21
  }
22
- if (d(o)) {
23
- const s = o, r = s.from, a = s.to;
24
- if (!r && !a) return !1;
25
- const i = new Date(e, n, 1).getTime();
26
- if (!r) return a ? i === new Date(a.year, a.month, 1).getTime() : !1;
27
- const f = new Date(r.year, r.month, 1).getTime();
28
- if (!a) return i === f;
29
- const u = new Date(a.year, a.month, 1).getTime();
30
- return i >= f && i <= u;
22
+ if (c(o)) {
23
+ const s = o, a = s.from, r = s.to;
24
+ if (!a && !r) return !1;
25
+ const f = new Date(t, n, 1).getTime();
26
+ if (!a) return r ? f === new Date(r.year, r.month, 1).getTime() : !1;
27
+ const i = new Date(a.year, a.month, 1).getTime();
28
+ if (!r) return f === i;
29
+ const d = new Date(r.year, r.month, 1).getTime();
30
+ return f >= i && f <= d;
31
31
  }
32
- const t = o;
33
- return t.fy != null && t.period != null ? t.fy === e && t.period === n + 1 : t.year === e && t.month === n;
32
+ const e = o;
33
+ return e.fy != null && e.period != null ? e.fy === t && e.period === n + 1 : e.year === t && e.month === n;
34
34
  }
35
- function y(e, n, o) {
35
+ function y(t, n, o) {
36
36
  if (!o || !("from" in o))
37
37
  return { isStart: !1, isEnd: !1, isMiddle: !1 };
38
- const t = o, s = t.from, r = t.to;
39
- if (!s && !r) return { isStart: !1, isEnd: !1, isMiddle: !1 };
40
- const a = new Date(e, n, 1).getTime();
38
+ const e = o, s = e.from, a = e.to;
39
+ if (!s && !a) return { isStart: !1, isEnd: !1, isMiddle: !1 };
40
+ const r = new Date(t, n, 1).getTime();
41
41
  if (!s)
42
42
  return {
43
43
  isStart: !1,
44
- isEnd: r ? a === new Date(r.year, r.month, 1).getTime() : !1,
44
+ isEnd: a ? r === new Date(a.year, a.month, 1).getTime() : !1,
45
45
  isMiddle: !1
46
46
  };
47
- const i = new Date(s.year, s.month, 1).getTime();
48
- if (!r) return { isStart: a === i, isEnd: !1, isMiddle: !1 };
49
- const f = new Date(r.year, r.month, 1).getTime();
47
+ const f = new Date(s.year, s.month, 1).getTime();
48
+ if (!a) return { isStart: r === f, isEnd: !1, isMiddle: !1 };
49
+ const i = new Date(a.year, a.month, 1).getTime();
50
50
  return {
51
- isStart: a === i,
52
- isEnd: a === f,
53
- isMiddle: a > i && a < f
51
+ isStart: r === f,
52
+ isEnd: r === i,
53
+ isMiddle: r > f && r < i
54
54
  };
55
55
  }
56
- function D(e, n, o) {
57
- const t = o;
58
- if (!t || typeof t != "object" || !("before" in t) && !("after" in t)) return !1;
59
- const s = new Date(e);
56
+ function l(t, n, o) {
57
+ const e = o;
58
+ if (!e || typeof e != "object" || !("before" in e) && !("after" in e)) return !1;
59
+ const s = new Date(t);
60
60
  s.setHours(0, 0, 0, 0);
61
- const r = new Date(n);
62
- if (r.setHours(23, 59, 59, 999), t.before) {
63
- const a = new Date(t.before);
64
- if (a.setHours(0, 0, 0, 0), r < a) return !0;
61
+ const a = new Date(n);
62
+ if (a.setHours(23, 59, 59, 999), e.before) {
63
+ const r = new Date(e.before);
64
+ if (r.setHours(0, 0, 0, 0), a < r) return !0;
65
65
  }
66
- if (t.after) {
67
- const a = new Date(t.after);
68
- if (a.setHours(23, 59, 59, 999), s > a) return !0;
66
+ if (e.after) {
67
+ const r = new Date(e.after);
68
+ if (r.setHours(23, 59, 59, 999), s > r) return !0;
69
69
  }
70
70
  return !1;
71
71
  }
72
- function w(e, n, o) {
73
- const t = new Date(e, n, 1, 0, 0, 0, 0), s = new Date(e, n + 1, 0, 23, 59, 59, 999);
74
- return D(t, s, o);
72
+ function D(t, n, o) {
73
+ const e = o;
74
+ if (!e || typeof e != "object" || !("before" in e) && !("after" in e)) return !0;
75
+ const s = new Date(t);
76
+ s.setHours(0, 0, 0, 0);
77
+ const a = new Date(n);
78
+ if (a.setHours(0, 0, 0, 0), e.before) {
79
+ const r = new Date(e.before);
80
+ if (r.setHours(0, 0, 0, 0), s < r) return !1;
81
+ }
82
+ if (e.after) {
83
+ const r = new Date(e.after);
84
+ if (r.setHours(0, 0, 0, 0), a > r) return !1;
85
+ }
86
+ return !0;
87
+ }
88
+ function b(t, n, o, e) {
89
+ return e && e !== "week" ? !l(t, n, o) : D(t, n, o);
90
+ }
91
+ function h(t, n, o) {
92
+ const e = new Date(t, n, 1, 0, 0, 0, 0), s = new Date(t, n + 1, 0, 23, 59, 59, 999);
93
+ return l(e, s, o);
75
94
  }
76
- function h(e, n) {
77
- const o = e.getFullYear(), t = n.getFullYear(), s = [];
78
- for (let r = o; r <= t; r++)
79
- s.push({ label: r.toString(), value: r.toString() });
95
+ function p(t, n) {
96
+ const o = t.getFullYear(), e = n.getFullYear(), s = [];
97
+ for (let a = o; a <= e; a++)
98
+ s.push({ label: a.toString(), value: a.toString() });
80
99
  return s;
81
100
  }
82
- function p(e, n, o, t) {
83
- return n.map((s, r) => ({ label: s, value: r.toString() })).filter((s, r) => {
84
- const a = new Date(e, r, 1);
85
- return !(a < new Date(o.getFullYear(), o.getMonth(), 1) || a > new Date(t.getFullYear(), t.getMonth(), 1));
101
+ function M(t, n, o, e) {
102
+ return n.map((s, a) => ({ label: s, value: a.toString() })).filter((s, a) => {
103
+ const r = new Date(t, a, 1);
104
+ return !(r < new Date(o.getFullYear(), o.getMonth(), 1) || r > new Date(e.getFullYear(), e.getMonth(), 1));
86
105
  });
87
106
  }
88
107
  export {
89
- p as getAvailableMonths,
90
- h as getAvailableYears,
108
+ M as getAvailableMonths,
109
+ p as getAvailableYears,
91
110
  y as getMonthRangeProps,
92
- D as isDateIntervalDisabled,
93
- w as isMonthDisabled,
94
- m as isMonthSelected,
95
- l as isSameMonth,
111
+ l as isDateIntervalDisabled,
112
+ h as isMonthDisabled,
113
+ w as isMonthSelected,
114
+ u as isSameMonth,
115
+ D as isWeekFullyInsideBounds,
116
+ b as isWeekSelectableInBounds,
96
117
  g as nextMonthSelection
97
118
  };
@@ -0,0 +1,23 @@
1
+ import { FiscalCalendarConfig } from '../../../lib/fiscal-calendar';
2
+ export type FiscalOrphanWeek = {
3
+ fy: number;
4
+ period: number;
5
+ week: number;
6
+ weekStart: string;
7
+ weekEnd: string;
8
+ periodStart: string;
9
+ periodEnd: string;
10
+ weekCount: number;
11
+ dominantMonth: string;
12
+ paneMonth: string;
13
+ side: "leading" | "trailing";
14
+ };
15
+ export declare function retailFiscalConfig(pattern: "4-4-5" | "4-5-4" | "5-4-4", weekStartsOn: 0 | 1, fyStartMonth: number, leapWeekPolicy?: "append-last-period" | "period-13"): FiscalCalendarConfig;
16
+ /** Last week sits fully in November; dominant civil month is October. P2 owns November. */
17
+ export declare const TRAILING_ORPHAN_CUSTOM_TABLE: FiscalCalendarConfig;
18
+ export declare function scanFiscalOrphanWeeks(config: FiscalCalendarConfig, fy: number): FiscalOrphanWeek[];
19
+ export declare function civilDayNumbers(start: string, end: string): string[];
20
+ export declare function parseYearMonth(value: string): {
21
+ year: number;
22
+ monthIndex: number;
23
+ };
@@ -8,7 +8,9 @@ export declare function weekHasInMonthSelection(week: {
8
8
  date: Date;
9
9
  outside?: boolean;
10
10
  }>;
11
- }, isSelected?: (date: Date) => boolean): boolean;
11
+ }, isSelected?: (date: Date) => boolean, options?: {
12
+ includeOutside?: boolean;
13
+ }): boolean;
12
14
  export declare function weekIntervalContinues(week: {
13
15
  days: Array<{
14
16
  date: Date;
@@ -1,8 +1,10 @@
1
1
  function y(e) {
2
2
  return e.days.length > 0 && e.days.every((t) => t.outside);
3
3
  }
4
- function g(e, t) {
5
- return t ? e.days.some((r) => !r.outside && t(r.date)) : !1;
4
+ function g(e, t, r) {
5
+ return t ? e.days.some(
6
+ (a) => (r?.includeOutside || !a.outside) && t(a.date)
7
+ ) : !1;
6
8
  }
7
9
  function d(e, t) {
8
10
  return new Date(e.getFullYear(), e.getMonth(), e.getDate() + t);
@@ -12,14 +14,14 @@ function c(e, t) {
12
14
  }
13
15
  function h(e, t, r) {
14
16
  if (!t) return { prev: !1, next: !1 };
15
- const a = e.days.find((n) => !n.outside)?.date, o = r?.joinAdjacentWeek ? e.days[0]?.date : e.days.find((n) => !n.outside)?.date, s = r?.joinAdjacentWeek ? e.days.at(-1)?.date : e.days.filter((n) => !n.outside).at(-1)?.date, f = o ? d(o, -1) : void 0, l = s ? d(s, 1) : void 0, i = (n) => {
17
+ const a = e.days.find((n) => !n.outside)?.date, o = r?.joinAdjacentWeek ? e.days[0]?.date : e.days.find((n) => !n.outside)?.date, i = r?.joinAdjacentWeek ? e.days.at(-1)?.date : e.days.filter((n) => !n.outside).at(-1)?.date, f = o ? d(o, -1) : void 0, l = i ? d(i, 1) : void 0, s = (n) => {
16
18
  if (!n || !t(n)) return !1;
17
19
  const u = r?.periodForDate?.(n);
18
20
  return r?.panePeriod != null && u != null ? u !== r.panePeriod : !!(a && c(n, a));
19
21
  };
20
22
  return {
21
- prev: i(f),
22
- next: i(l)
23
+ prev: s(f),
24
+ next: s(l)
23
25
  };
24
26
  }
25
27
  export {
@@ -1,78 +1,77 @@
1
- import { jsxs as s, jsx as p } from "react/jsx-runtime";
1
+ import { jsxs as f, jsx as d } from "react/jsx-runtime";
2
2
  import "react";
3
- import { cn as e } from "../../../lib/utils.js";
4
- import { Button as N } from "../../primitives/button/button.js";
5
- import { intervalCaptionClassName as v } from "./calendar-interval-caption.js";
6
- import { SELECTION_RADIUS_END as g, SELECTION_RADIUS_START as T, SELECTION_RADIUS as I, periodRangeTrackClassName as j, periodTileAppearanceClassName as A } from "./calendar-selection-appearance.js";
7
- import { periodCellKind as D } from "./calendar-selection.js";
8
- import { handlePeriodGridKeyDown as S } from "./calendar-period-keyboard.js";
9
- const _ = {
3
+ import { cn as t } from "../../../lib/utils.js";
4
+ import { Button as g } from "../../primitives/button/button.js";
5
+ import { intervalCaptionClassName as y } from "./calendar-interval-caption.js";
6
+ import { periodRangeTrackPositionClassName as v, periodRangeTrackClassName as T, periodTileInsetClassName as k, periodTileAppearanceClassName as j, rangeStartCellClassName as q, rangeEndCellClassName as K, rangeMiddleCellClassName as P } from "./calendar-selection-appearance.js";
7
+ import { periodCellKind as A } from "./calendar-selection.js";
8
+ import { handlePeriodGridKeyDown as D } from "./calendar-period-keyboard.js";
9
+ const I = {
10
10
  month: "h-10 w-10",
11
- period: "min-h-16 h-auto w-full flex-col items-center justify-center px-1 py-1",
12
- quarter: "h-16 min-h-16 max-h-16 w-full min-w-0 flex-col items-center justify-center overflow-hidden whitespace-normal p-2 leading-tight",
13
- year: "h-10 min-h-10 max-h-10 w-full min-w-0 overflow-hidden",
14
- "year-caption": "h-16 min-h-16 max-h-16 w-full min-w-0 flex-col items-center justify-center gap-0.5 overflow-hidden whitespace-normal p-2 text-xs leading-tight"
11
+ period: "min-h-16 h-auto min-w-0 flex-col items-center justify-center px-1 py-1",
12
+ quarter: "h-16 min-h-16 max-h-16 min-w-0 flex-col items-center justify-center overflow-hidden whitespace-normal p-2 leading-tight",
13
+ year: "h-10 min-h-10 max-h-10 min-w-0 overflow-hidden",
14
+ "year-caption": "h-16 min-h-16 max-h-16 min-w-0 flex-col items-center justify-center gap-0.5 overflow-hidden whitespace-normal p-2 text-xs leading-tight"
15
15
  };
16
- function P({
17
- selected: u,
16
+ function O({
17
+ selected: C,
18
18
  disabled: n = !1,
19
19
  isRange: i = !1,
20
- isStart: t = !1,
21
- isEnd: r = !1,
22
- isMiddle: o = !1,
23
- hasRangeEnd: d = !1,
20
+ isStart: e = !1,
21
+ isEnd: a = !1,
22
+ isMiddle: s = !1,
23
+ hasRangeEnd: w = !1,
24
24
  size: l,
25
- onClick: w,
26
- onKeyDown: x,
27
- children: y,
25
+ onClick: u,
26
+ onKeyDown: N,
27
+ children: x,
28
28
  caption: m,
29
- columns: f
29
+ columns: c
30
30
  }) {
31
- const a = D({ selected: u, isRange: i, isStart: t, isEnd: r, isMiddle: o }), C = i && d && (o || t || r) && !n, c = l === "month";
32
- return /* @__PURE__ */ s(
31
+ const r = A({ selected: C, isRange: i, isStart: e, isEnd: a, isMiddle: s }), p = i && w && (s || e || a) && !n, o = l === "month";
32
+ return /* @__PURE__ */ f(
33
33
  "div",
34
34
  {
35
- className: e(
35
+ className: t(
36
36
  "group relative flex w-full items-center justify-center",
37
- l === "period" || l === "quarter" || l === "year-caption" ? "min-h-16" : "h-10"
37
+ l === "period" || l === "quarter" || l === "year-caption" ? "min-h-16" : "h-10",
38
+ !o && p && !(e && a) && (e ? q : a ? K : P)
38
39
  ),
39
40
  children: [
40
- C ? /* @__PURE__ */ p(
41
+ o && p ? /* @__PURE__ */ d(
41
42
  "div",
42
43
  {
43
- className: e(
44
+ className: t(
44
45
  "absolute inset-y-0",
45
- j,
46
- t && r && e("inset-x-2", I),
47
- t && !r && e("left-1/2 right-0", c && "-ml-5", T),
48
- r && !t && e("right-1/2 left-0", c && "-mr-5", g),
49
- o && "inset-x-0"
46
+ T,
47
+ v({ isStart: e, isEnd: a })
50
48
  )
51
49
  }
52
50
  ) : null,
53
- /* @__PURE__ */ s(
54
- N,
51
+ /* @__PURE__ */ f(
52
+ g,
55
53
  {
56
54
  variant: "ghost",
57
- onClick: w,
55
+ onClick: u,
58
56
  onKeyDown: (h) => {
59
- f && S(h, f), x?.(h);
57
+ c && D(h, c), N?.(h);
60
58
  },
61
59
  disabled: n,
62
- "data-selection": a,
60
+ "data-selection": r,
63
61
  "data-period-tile": "",
64
- className: e(
65
- A({ kind: a, disabled: n }),
66
- _[l]
62
+ className: t(
63
+ j({ kind: r, disabled: n }),
64
+ I[l],
65
+ !o && k
67
66
  ),
68
67
  children: [
69
- y,
70
- m ? /* @__PURE__ */ p(
68
+ x,
69
+ m ? /* @__PURE__ */ d(
71
70
  "span",
72
71
  {
73
72
  "data-slot": "interval-caption",
74
- className: v(
75
- a === "point" || a === "interval-start" || a === "interval-end"
73
+ className: y(
74
+ r === "point" || r === "interval-start" || r === "interval-end"
76
75
  ),
77
76
  children: m
78
77
  }
@@ -85,5 +84,5 @@ function P({
85
84
  );
86
85
  }
87
86
  export {
88
- P as CalendarPeriodCell
87
+ O as CalendarPeriodCell
89
88
  };