impact-nova 2.5.21 → 2.5.22

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 (27) 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 +52 -50
  3. package/dist/components/data/data-table/column-picker-authority.d.ts +1 -0
  4. package/dist/components/data/data-table/column-picker-authority.js +61 -59
  5. package/dist/components/data/data-table/column-savability.d.ts +3 -0
  6. package/dist/components/data/data-table/column-savability.js +10 -0
  7. package/dist/components/data/data-table/data-table-column-list.js +117 -89
  8. package/dist/components/data/data-table/data-table-flat-column-virtual-rows.d.ts +1 -0
  9. package/dist/components/data/data-table/data-table-flat-column-virtual-rows.js +23 -22
  10. package/dist/components/data/data-table/index.d.ts +2 -0
  11. package/dist/components/data/data-table/index.js +32 -28
  12. package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.js +14 -13
  13. package/dist/components/data/expandable-list-item/expandable-list-item-attributes.js +3 -2
  14. package/dist/components/data/expandable-list-item/expandable-list-item-metrics.js +3 -2
  15. package/dist/components/data-display/calendar/calendar-year-panes.js +68 -58
  16. package/dist/components/data-display/calendar/calendar-year-utils.d.ts +13 -0
  17. package/dist/components/data-display/calendar/calendar-year-utils.js +60 -51
  18. package/dist/components/feedback/tooltip/tab-tooltip-render.js +3 -2
  19. package/dist/components/flows/command-palette/shortcut-settings.js +10 -10
  20. package/dist/components/flows/filter-panel/filter-panel.js +4 -4
  21. package/dist/components/forms/select/components/SelectTriggerValue.js +3 -2
  22. package/dist/components/forms/select/components/Submenu.js +3 -2
  23. package/dist/index.js +273 -269
  24. package/dist/llms/rules/ag-grid.js +1 -1
  25. package/dist/llms/rules/installation.js +1 -1
  26. package/dist/llms/rules/requirements.js +1 -1
  27. package/package.json +1 -1
@@ -1,13 +1,13 @@
1
1
  import { getSectionIdFromDroppable as S } from "../nested-list/nested-list-drop-engine.js";
2
2
  import { NESTED_LIST_ROOT_FROZEN_ID as d, NESTED_LIST_ROOT_SCROLLABLE_ID as u } from "../nested-list/nested-list-constants.js";
3
- import { updateColumnPin as h, reorderColumn as k } from "./column-picker-authority.js";
3
+ import { updateColumnPin as b, reorderColumn as k } from "./column-picker-authority.js";
4
4
  function g(e) {
5
5
  const n = [], t = [];
6
6
  for (const l of e.orderedColumnIds)
7
7
  e.pinByColumnId.get(l) ? n.push(l) : t.push(l);
8
8
  return { frozenColumnIds: n, scrollableColumnIds: t };
9
9
  }
10
- function b(e, n, t) {
10
+ function h(e, n, t) {
11
11
  const l = t.trim().toLowerCase();
12
12
  return l === "" ? [...n] : n.filter((r) => (e.labelByColumnId.get(r) ?? r).toLowerCase().includes(l));
13
13
  }
@@ -23,7 +23,7 @@ function C(e, n) {
23
23
  };
24
24
  }
25
25
  function D(e, n, t) {
26
- const l = t.searchQuery ?? "", { frozenColumnIds: r, scrollableColumnIds: c } = g(e), s = b(e, r, l), o = b(e, c, l), i = C(s, e), f = C(o, e), m = [
26
+ const l = t.searchQuery ?? "", { frozenColumnIds: r, scrollableColumnIds: c } = g(e), s = h(e, r, l), o = h(e, c, l), i = C(s, e), m = C(o, e), f = [
27
27
  {
28
28
  kind: "structure",
29
29
  sectionId: d,
@@ -34,21 +34,21 @@ function D(e, n, t) {
34
34
  }
35
35
  ];
36
36
  for (const a of s)
37
- m.push({ kind: "column", columnId: a, sectionId: d });
38
- m.push({
37
+ f.push({ kind: "column", columnId: a, sectionId: d });
38
+ f.push({
39
39
  kind: "structure",
40
40
  sectionId: u,
41
41
  label: n.scrollableColumns,
42
- checked: f.checked,
43
- indeterminate: f.indeterminate,
42
+ checked: m.checked,
43
+ indeterminate: m.indeterminate,
44
44
  hasVirtualColumnChildren: o.length > 0
45
45
  });
46
46
  for (const a of o)
47
- m.push({ kind: "column", columnId: a, sectionId: u });
48
- return m;
47
+ f.push({ kind: "column", columnId: a, sectionId: u });
48
+ return f;
49
49
  }
50
50
  function z(e, n, t) {
51
- const l = e.pinByColumnId.get(n) ?? null, r = e.visibilityByColumnId.get(n) ?? !0, c = e.labelByColumnId.get(n) ?? n, s = t.sortAppliedByColumnId?.get(n) ?? !1, o = t.filterAppliedByColumnId?.get(n) ?? !1;
51
+ const l = e.pinByColumnId.get(n) ?? null, r = e.visibilityByColumnId.get(n) ?? !0, c = e.labelByColumnId.get(n) ?? n, s = t.sortAppliedByColumnId?.get(n) ?? !1, o = t.filterAppliedByColumnId?.get(n) ?? !1, i = t.nonSavableByColumnId?.get(n) ?? !1;
52
52
  return {
53
53
  item: {
54
54
  id: n,
@@ -57,6 +57,7 @@ function z(e, n, t) {
57
57
  data: {
58
58
  hasSortApplied: s,
59
59
  hasFilterApplied: o,
60
+ isNonSavable: i,
60
61
  pinned: l
61
62
  }
62
63
  },
@@ -64,7 +65,7 @@ function z(e, n, t) {
64
65
  indentLevel: 1
65
66
  };
66
67
  }
67
- function F(e) {
68
+ function B(e) {
68
69
  return {
69
70
  item: {
70
71
  id: e.sectionId,
@@ -80,7 +81,7 @@ function F(e) {
80
81
  indentLevel: 0
81
82
  };
82
83
  }
83
- function v(e, n, t = {}) {
84
+ function L(e, n, t = {}) {
84
85
  const l = D(e, n, t), r = /* @__PURE__ */ new Map();
85
86
  for (let o = 0; o < l.length; o += 1) {
86
87
  const i = l[o];
@@ -95,7 +96,7 @@ function v(e, n, t = {}) {
95
96
  const i = l[o];
96
97
  if (!i)
97
98
  throw new RangeError(`Flat column virtual row index out of bounds: ${o}`);
98
- return i.kind === "structure" ? F(i) : z(e, i.columnId, t);
99
+ return i.kind === "structure" ? B(i) : z(e, i.columnId, t);
99
100
  },
100
101
  getColumnIdAt: (o) => {
101
102
  const i = l[o];
@@ -137,16 +138,16 @@ function V(e, n) {
137
138
  }
138
139
  return !0;
139
140
  }
140
- function A(e, n) {
141
+ function F(e, n) {
141
142
  const t = e.pinByColumnId.get(n);
142
143
  return t === "left" || t === "right";
143
144
  }
144
- function B(e, n) {
145
+ function A(e, n) {
145
146
  if (n === d)
146
147
  return 0;
147
148
  for (let t = 0; t < e.orderedColumnIds.length; t += 1) {
148
149
  const l = e.orderedColumnIds[t];
149
- if (!A(e, l))
150
+ if (!F(e, l))
150
151
  return t;
151
152
  }
152
153
  return e.orderedColumnIds.length;
@@ -163,7 +164,7 @@ function R(e, n, t, l) {
163
164
  const i = l ? o + 1 : o;
164
165
  return s.splice(i, 0, n), r === i ? e : k(e, r, i);
165
166
  }
166
- function O(e, n) {
167
+ function v(e, n) {
167
168
  const t = S(e);
168
169
  return t === d || t === u ? t : e === d || e === u ? e : n.frozenColumnIds.includes(e) ? d : n.scrollableColumnIds.includes(e) ? u : null;
169
170
  }
@@ -171,15 +172,15 @@ function _(e, n, t) {
171
172
  const { draggedColumnId: l, overId: r, insertAfter: c } = t;
172
173
  if (l === r || !e.orderedColumnIds.includes(l))
173
174
  return null;
174
- const s = O(r, n);
175
+ const s = v(r, n);
175
176
  if (s) {
176
177
  if (S(r) !== null || r === d || r === u) {
177
- const I = h(e, l, s === d ? "left" : null), x = B(I, s), p = I.orderedColumnIds.indexOf(l);
178
+ const I = b(e, l, s === d ? "left" : null), x = A(I, s), p = I.orderedColumnIds.indexOf(l);
178
179
  return p === -1 ? null : k(I, p, x);
179
180
  }
180
- const i = n.frozenColumnIds.includes(l), f = s === d ? "left" : null, m = i === (f === "left") ? e : h(e, l, f);
181
+ const i = n.frozenColumnIds.includes(l), m = s === d ? "left" : null, f = i === (m === "left") ? e : b(e, l, m);
181
182
  return R(
182
- m,
183
+ f,
183
184
  l,
184
185
  r,
185
186
  c
@@ -190,6 +191,6 @@ function _(e, n, t) {
190
191
  export {
191
192
  _ as applyFlatVirtualDropToAuthority,
192
193
  P as buildAuthorityFlatShellItems,
193
- v as buildFlatColumnVirtualRowModel,
194
+ L as buildFlatColumnVirtualRowModel,
194
195
  V as isFlatLargeColumnPicker
195
196
  };
@@ -12,4 +12,6 @@ export * from './data-table-saved-views';
12
12
  export * from './pin-switch';
13
13
  export * from './column-indicator';
14
14
  export * from './indicator-legend';
15
+ export * from './column-savability';
16
+ export { mergePartialOrderedColumnState } from './data-table-column-state';
15
17
  export type { SavedTableViewItem, TableViewTypeOption, DataTableSavedViewsProps, DataTableSavedViewsActionContext, DataTableSavedViewsCancelContext, } from '../data-table/data-table-saved-views.types';
@@ -1,54 +1,58 @@
1
- import { DataTable as t, DataTableContent as o, DataTableToolbar as r } from "./data-table.js";
2
- import { deferColumnRuntimeStateGuard as l, isColumnRuntimeStateGuardDeferred as n, isColumnRuntimeStateGuardUpdating as D, rebuildColumnTreeCacheFromGrid as S, scheduleColumnRuntimeStateGuard as b } from "./column-runtime-state-guard.js";
3
- import { DATA_TABLE_SCOPED_SHEET_HOST_MIN_HEIGHT_PX as m, DATA_TABLE_SHEET_SLIDE_TRANSITION_MS as u, TABLE_VIEWPORT_SHELL_EXPANDED_CLASS as p } from "./data-table-constants.js";
4
- import { DataTableColumnList as h } from "./data-table-column-list.js";
5
- import { DataTableContext as f, DataTableSheetPortalStoreContext as s, useDataTable as _, useDataTableSheetPortal as C, useDataTableSheetPortalStore as E } from "./data-table-context.js";
1
+ import { DataTable as t, DataTableContent as r, DataTableToolbar as o } from "./data-table.js";
2
+ import { deferColumnRuntimeStateGuard as T, isColumnRuntimeStateGuardDeferred as n, isColumnRuntimeStateGuardUpdating as S, rebuildColumnTreeCacheFromGrid as D, scheduleColumnRuntimeStateGuard as b } from "./column-runtime-state-guard.js";
3
+ import { DATA_TABLE_SCOPED_SHEET_HOST_MIN_HEIGHT_PX as i, DATA_TABLE_SHEET_SLIDE_TRANSITION_MS as u, TABLE_VIEWPORT_SHELL_EXPANDED_CLASS as p } from "./data-table-constants.js";
4
+ import { DataTableColumnList as x } from "./data-table-column-list.js";
5
+ import { DataTableContext as h, DataTableSheetPortalStoreContext as s, useDataTable as C, useDataTableSheetPortal as _, useDataTableSheetPortalStore as E } from "./data-table-context.js";
6
6
  import { DataTableFormatOptions as L } from "./data-table-format-options.js";
7
- import { DataTableSheet as P, DataTableSheetContent as w, DataTableSheetHeader as V, DataTableSheetTrigger as g } from "./data-table-sheet.js";
8
- import { DataTableSheetBody as M, DataTableSheetSection as c, DataTableSheetTabPanel as G, DataTableSheetTabs as R, DataTableSheetTabsList as O } from "./data-table-sheet-layout.js";
9
- import { useDataTableSheet as N, useDataTableSheetApi as y } from "./data-table-sheet-context.js";
10
- import { DataTableViewMenuContent as X, DataTableViewMenuDensity as v, DataTableViewMenuSettingsItem as U, DataTableViewMenuTrigger as W, DataTableViewMenuViewportExpand as j } from "./data-table-view-menu.js";
7
+ import { DataTableSheet as I, DataTableSheetContent as g, DataTableSheetHeader as w, DataTableSheetTrigger as V } from "./data-table-sheet.js";
8
+ import { DataTableSheetBody as M, DataTableSheetSection as c, DataTableSheetTabPanel as G, DataTableSheetTabs as O, DataTableSheetTabsList as R } from "./data-table-sheet-layout.js";
9
+ import { useDataTableSheet as N, useDataTableSheetApi as v } from "./data-table-sheet-context.js";
10
+ import { DataTableViewMenuContent as F, DataTableViewMenuDensity as X, DataTableViewMenuSettingsItem as U, DataTableViewMenuTrigger as W, DataTableViewMenuViewportExpand as j } from "./data-table-view-menu.js";
11
11
  import { DataTableSavedViews as q } from "./data-table-saved-views.js";
12
12
  import { PinSwitch as J } from "./pin-switch.js";
13
13
  import { ColumnIndicator as Q } from "./column-indicator.js";
14
14
  import { IndicatorLegend as Z } from "./indicator-legend.js";
15
+ import { resolveColumnSavability as ee } from "./column-savability.js";
16
+ import { mergePartialOrderedColumnState as te } from "./data-table-column-state.js";
15
17
  export {
16
18
  Q as ColumnIndicator,
17
- m as DATA_TABLE_SCOPED_SHEET_HOST_MIN_HEIGHT_PX,
19
+ i as DATA_TABLE_SCOPED_SHEET_HOST_MIN_HEIGHT_PX,
18
20
  u as DATA_TABLE_SHEET_SLIDE_TRANSITION_MS,
19
21
  t as DataTable,
20
- h as DataTableColumnList,
21
- o as DataTableContent,
22
- f as DataTableContext,
22
+ x as DataTableColumnList,
23
+ r as DataTableContent,
24
+ h as DataTableContext,
23
25
  L as DataTableFormatOptions,
24
26
  q as DataTableSavedViews,
25
- P as DataTableSheet,
27
+ I as DataTableSheet,
26
28
  M as DataTableSheetBody,
27
- w as DataTableSheetContent,
28
- V as DataTableSheetHeader,
29
+ g as DataTableSheetContent,
30
+ w as DataTableSheetHeader,
29
31
  s as DataTableSheetPortalStoreContext,
30
32
  c as DataTableSheetSection,
31
33
  G as DataTableSheetTabPanel,
32
- R as DataTableSheetTabs,
33
- O as DataTableSheetTabsList,
34
- g as DataTableSheetTrigger,
35
- r as DataTableToolbar,
36
- X as DataTableViewMenuContent,
37
- v as DataTableViewMenuDensity,
34
+ O as DataTableSheetTabs,
35
+ R as DataTableSheetTabsList,
36
+ V as DataTableSheetTrigger,
37
+ o as DataTableToolbar,
38
+ F as DataTableViewMenuContent,
39
+ X as DataTableViewMenuDensity,
38
40
  U as DataTableViewMenuSettingsItem,
39
41
  W as DataTableViewMenuTrigger,
40
42
  j as DataTableViewMenuViewportExpand,
41
43
  Z as IndicatorLegend,
42
44
  J as PinSwitch,
43
45
  p as TABLE_VIEWPORT_SHELL_EXPANDED_CLASS,
44
- l as deferColumnRuntimeStateGuard,
46
+ T as deferColumnRuntimeStateGuard,
45
47
  n as isColumnRuntimeStateGuardDeferred,
46
- D as isColumnRuntimeStateGuardUpdating,
47
- S as rebuildColumnTreeCacheFromGrid,
48
+ S as isColumnRuntimeStateGuardUpdating,
49
+ te as mergePartialOrderedColumnState,
50
+ D as rebuildColumnTreeCacheFromGrid,
51
+ ee as resolveColumnSavability,
48
52
  b as scheduleColumnRuntimeStateGuard,
49
- _ as useDataTable,
53
+ C as useDataTable,
50
54
  N as useDataTableSheet,
51
- y as useDataTableSheetApi,
52
- C as useDataTableSheetPortal,
55
+ v as useDataTableSheetApi,
56
+ _ as useDataTableSheetPortal,
53
57
  E as useDataTableSheetPortalStore
54
58
  };
@@ -1,35 +1,36 @@
1
1
  function p(l) {
2
- const o = l.getGridOption("context"), r = typeof o?.activeSearchColumnId == "string" ? o.activeSearchColumnId : null, s = /* @__PURE__ */ new Map();
2
+ const o = l.getGridOption("context"), r = typeof o?.activeSearchColumnId == "string" ? o.activeSearchColumnId : null, a = /* @__PURE__ */ new Map();
3
3
  for (const n of l.getColumnState())
4
- s.set(n.colId, !!n.sort);
5
- const a = /* @__PURE__ */ new Map(), u = l.getAllGridColumns?.() ?? l.getColumns?.() ?? [];
6
- for (const n of u) {
4
+ a.set(n.colId, !!n.sort);
5
+ const s = /* @__PURE__ */ new Map(), i = l.getAllGridColumns?.() ?? l.getColumns?.() ?? [];
6
+ for (const n of i) {
7
7
  const c = n.getColId();
8
- a.set(
8
+ s.set(
9
9
  c,
10
10
  n.isFilterActive() === !0 || r === c
11
11
  );
12
12
  }
13
- return { sortAppliedByColumnId: s, filterAppliedByColumnId: a };
13
+ return { sortAppliedByColumnId: a, filterAppliedByColumnId: s };
14
14
  }
15
15
  function I(l, o) {
16
- const r = o.getGridOption("context"), s = typeof r?.activeSearchColumnId == "string" ? r.activeSearchColumnId : null, a = new Map(
16
+ const r = o.getGridOption("context"), a = typeof r?.activeSearchColumnId == "string" ? r.activeSearchColumnId : null, s = new Map(
17
17
  o.getColumnState().map((e) => [e.colId, e])
18
- ), u = o.getAllGridColumns?.() ?? o.getColumns?.() ?? [], n = new Map(
19
- u.map((e) => [e.getColId(), e])
18
+ ), i = o.getAllGridColumns?.() ?? o.getColumns?.() ?? [], n = new Map(
19
+ i.map((e) => [e.getColId(), e])
20
20
  ), c = (e) => e.map((t) => {
21
21
  if ((t.category === "group" || t.children && t.children.length > 0) && t.children)
22
22
  return {
23
23
  ...t,
24
24
  children: c(t.children)
25
25
  };
26
- const i = n.get(t.id), m = a.get(t.id), d = t.data;
26
+ const m = n.get(t.id), d = s.get(t.id), u = t.data;
27
27
  return {
28
28
  ...t,
29
29
  data: {
30
- ...d,
31
- hasSortApplied: !!m?.sort,
32
- hasFilterApplied: i?.isFilterActive() === !0 || s === t.id
30
+ ...u,
31
+ hasSortApplied: !!d?.sort,
32
+ hasFilterApplied: m?.isFilterActive() === !0 || a === t.id,
33
+ isNonSavable: u?.isNonSavable
33
34
  }
34
35
  };
35
36
  });
@@ -3,7 +3,8 @@ import { Badge as s } from "../../data-display/badge/badge.js";
3
3
  import { FilterPopoverContent as u } from "../../flows/filter-strip/filter-tag-list.js";
4
4
  import { Popover as b, PopoverTrigger as f } from "../../feedback/popover/popover.js";
5
5
  import { Tooltip as g, TooltipTrigger as v, TooltipContent as x } from "../../feedback/tooltip/tooltip.js";
6
- function w({
6
+ import "react";
7
+ function I({
7
8
  tags: o,
8
9
  title: l = "Attributes",
9
10
  maxVisibleTags: n = 4,
@@ -70,5 +71,5 @@ function w({
70
71
  );
71
72
  }
72
73
  export {
73
- w as ExpandableListItemAttributes
74
+ I as ExpandableListItemAttributes
74
75
  };
@@ -1,8 +1,9 @@
1
1
  import { jsx as e, jsxs as s } from "react/jsx-runtime";
2
2
  import { ScrollOverflowAffordance as o } from "../../layout/horizontal-scroller/scroll-overflow-affordance.js";
3
+ import "react";
3
4
  import { OverflowTooltip as r } from "../../feedback/tooltip/overflow-tooltip.js";
4
5
  const m = 128;
5
- function x({
6
+ function f({
6
7
  columns: i,
7
8
  sectionId: l = "metrics"
8
9
  }) {
@@ -50,5 +51,5 @@ function x({
50
51
  );
51
52
  }
52
53
  export {
53
- x as ExpandableListItemMetrics
54
+ f as ExpandableListItemMetrics
54
55
  };
@@ -1,64 +1,74 @@
1
- import { jsxs as r, jsx as e } from "react/jsx-runtime";
2
- import { ChevronRight as A } from "impact-nova-icons";
3
- import { cn as N } from "../../../lib/utils.js";
4
- import { Button as S } from "../../primitives/button/button.js";
5
- import { CalendarPeriodCell as M } from "./calendar-period-cell.js";
6
- import { PERIOD_RANGE_GRID_CLASSNAME as Y } from "./calendar-selection-appearance.js";
7
- import { getYearRangeProps as O, isYearRangeSelection as T } from "./calendar-year-utils.js";
8
- const Z = 12, H = 6, W = "w-[320px] min-w-[320px] max-w-[320px]";
9
- function V({
10
- pickerYear: _,
11
- resolvedStartYear: d,
12
- resolvedEndYear: m,
1
+ import { jsxs as m, jsx as e } from "react/jsx-runtime";
2
+ import { ChevronRight as u } from "impact-nova-icons";
3
+ import { cn as S } from "../../../lib/utils.js";
4
+ import { Button as x } from "../../primitives/button/button.js";
5
+ import { CalendarPeriodCell as Y } from "./calendar-period-cell.js";
6
+ import { PERIOD_RANGE_GRID_CLASSNAME as Z } from "./calendar-selection-appearance.js";
7
+ import { getYearPageYears as D, yearPageHasSelectableYear as E, getYearRangeProps as W, isYearRangeSelection as q } from "./calendar-year-utils.js";
8
+ const F = 12, J = 6, K = "w-[320px] min-w-[320px] max-w-[320px]";
9
+ function ot({
10
+ pickerYear: A,
11
+ resolvedStartYear: c,
12
+ resolvedEndYear: a,
13
13
  previousYearLabel: R,
14
- nextYearLabel: u,
15
- yearLabels: c,
14
+ nextYearLabel: _,
15
+ yearLabels: l,
16
16
  yearCaptions: p,
17
17
  showFooter: v = !0,
18
- pendingYearSelection: w,
19
- selectedYear: C,
20
- isYearSelected: P,
21
- isYearDisabled: b,
22
- onYearPageChange: h,
23
- onYearClick: I
18
+ pendingYearSelection: P,
19
+ selectedYear: w,
20
+ isYearSelected: C,
21
+ isYearDisabled: r,
22
+ onYearPageChange: g,
23
+ onYearClick: B
24
24
  }) {
25
- const i = !!p, n = i ? H : Z, o = Math.floor(_ / n) * n, f = o + n - 1, s = Array.from({ length: n }, (t, l) => o + l).filter(
26
- (t) => t >= d && t <= m
27
- ), g = s[0] ?? o, E = s[s.length - 1] ?? f, a = v ? w : C, x = T(a) ? a : void 0;
28
- return /* @__PURE__ */ r(
25
+ const s = !!p, t = s ? J : F, n = Math.floor(A / t) * t, G = n + t - 1, i = D(n, t), h = i[0] ?? n, f = i[i.length - 1] ?? G, d = v ? P : w, N = q(d) ? d : void 0, I = E({
26
+ pageStart: n - t,
27
+ pageSize: t,
28
+ resolvedStartYear: c,
29
+ resolvedEndYear: a,
30
+ isYearDisabled: r
31
+ }), b = E({
32
+ pageStart: n + t,
33
+ pageSize: t,
34
+ resolvedStartYear: c,
35
+ resolvedEndYear: a,
36
+ isYearDisabled: r
37
+ });
38
+ return /* @__PURE__ */ m(
29
39
  "div",
30
40
  {
31
41
  "data-slot": "year-panes",
32
- className: N("flex flex-col gap-4 overflow-hidden p-3", W),
42
+ className: S("flex flex-col gap-4 overflow-hidden p-3", K),
33
43
  children: [
34
- /* @__PURE__ */ r("div", { className: "flex items-center justify-between", children: [
44
+ /* @__PURE__ */ m("div", { className: "flex items-center justify-between", children: [
35
45
  /* @__PURE__ */ e(
36
- S,
46
+ x,
37
47
  {
38
48
  variant: "ghost",
39
49
  size: "icon",
40
50
  className: "h-7 w-7 shrink-0",
41
51
  "aria-label": R,
42
- disabled: o <= d,
43
- onClick: () => h(o - n),
44
- children: /* @__PURE__ */ e(A, { size: 16, className: "rotate-180" })
52
+ disabled: !I,
53
+ onClick: () => g(n - t),
54
+ children: /* @__PURE__ */ e(u, { size: 16, className: "rotate-180" })
45
55
  }
46
56
  ),
47
- /* @__PURE__ */ r("div", { className: "text-sm font-medium text-content", children: [
48
- c?.(g) ?? g,
57
+ /* @__PURE__ */ m("div", { className: "text-sm font-medium text-content", children: [
58
+ l?.(h) ?? h,
49
59
  " – ",
50
- c?.(E) ?? E
60
+ l?.(f) ?? f
51
61
  ] }),
52
62
  /* @__PURE__ */ e(
53
- S,
63
+ x,
54
64
  {
55
65
  variant: "ghost",
56
66
  size: "icon",
57
67
  className: "h-7 w-7",
58
- "aria-label": u,
59
- disabled: f >= m,
60
- onClick: () => h(o + n),
61
- children: /* @__PURE__ */ e(A, { className: "h-4 w-4" })
68
+ "aria-label": _,
69
+ disabled: !b,
70
+ onClick: () => g(n + t),
71
+ children: /* @__PURE__ */ e(u, { className: "h-4 w-4" })
62
72
  }
63
73
  )
64
74
  ] }),
@@ -66,26 +76,26 @@ function V({
66
76
  "div",
67
77
  {
68
78
  "data-period-grid": "",
69
- className: N(Y, i ? "grid-cols-2" : "grid-cols-3"),
70
- children: s.map((t) => {
71
- const l = P(t), z = b(t), k = !!x, { isStart: B, isEnd: G, isMiddle: j } = O(t, a), D = p?.(t);
79
+ className: S(Z, s ? "grid-cols-2" : "grid-cols-3"),
80
+ children: i.map((o) => {
81
+ const z = o < c || o > a || r(o), k = C(o), O = !!N, { isStart: j, isEnd: M, isMiddle: H } = W(o, d), T = p?.(o);
72
82
  return /* @__PURE__ */ e(
73
- M,
83
+ Y,
74
84
  {
75
- selected: l,
85
+ selected: k,
76
86
  disabled: z,
77
- isRange: k,
78
- isStart: B,
79
- isEnd: G,
80
- isMiddle: j,
81
- hasRangeEnd: !!x?.to,
82
- size: i ? "year-caption" : "year",
83
- columns: i ? 2 : 3,
84
- onClick: () => I(t),
85
- caption: D,
86
- children: c?.(t) ?? String(t)
87
+ isRange: O,
88
+ isStart: j,
89
+ isEnd: M,
90
+ isMiddle: H,
91
+ hasRangeEnd: !!N?.to,
92
+ size: s ? "year-caption" : "year",
93
+ columns: s ? 2 : 3,
94
+ onClick: () => B(o),
95
+ caption: T,
96
+ children: l?.(o) ?? String(o)
87
97
  },
88
- t
98
+ o
89
99
  );
90
100
  })
91
101
  }
@@ -95,8 +105,8 @@ function V({
95
105
  );
96
106
  }
97
107
  export {
98
- V as CalendarYearPanes,
99
- H as YEAR_CAPTION_PAGE_SIZE,
100
- Z as YEAR_PAGE_SIZE,
101
- W as YEAR_PANE_WIDTH_CLASS
108
+ ot as CalendarYearPanes,
109
+ J as YEAR_CAPTION_PAGE_SIZE,
110
+ F as YEAR_PAGE_SIZE,
111
+ K as YEAR_PANE_WIDTH_CLASS
102
112
  };
@@ -11,6 +11,19 @@ export declare function getYearRangeProps(year: number, currentSelection: YearSe
11
11
  };
12
12
  export declare function nextYearSelection(selection: YearSelection, prev: YearSelection | YearSelection[] | YearRange | undefined, yearMode: "single" | "multiple" | "range" | "multi-range"): YearSelection | YearSelection[] | YearRange | undefined;
13
13
  export declare function isYearSelectedForSelection(year: number, currentSelection: YearSelection | YearSelection[] | YearRange | undefined): boolean;
14
+ /** Full page of years (never shrink the grid when bounds are tight). */
15
+ export declare function getYearPageYears(pageStart: number, pageSize: number): number[];
16
+ /**
17
+ * Prev/next stay enabled only when the target page has at least one selectable year.
18
+ * Disabled / out-of-nav years still render on the current page.
19
+ */
20
+ export declare function yearPageHasSelectableYear(options: {
21
+ pageStart: number;
22
+ pageSize: number;
23
+ resolvedStartYear: number;
24
+ resolvedEndYear: number;
25
+ isYearDisabled: (year: number) => boolean;
26
+ }): boolean;
14
27
  export declare function isYearDisabledForBounds(year: number, disabled?: unknown, options?: {
15
28
  calendarKind?: "gregorian" | "fiscal";
16
29
  fiscalConfig?: FiscalCalendarConfig;
@@ -1,75 +1,84 @@
1
1
  import { localDateFromCivil as d } from "../../../lib/fiscal-calendar/civil-date.js";
2
- import { buildFiscalYear as m } from "../../../lib/fiscal-calendar/build-year.js";
3
- import { isDateIntervalDisabled as u } from "./calendar-month-utils.js";
4
- function g(r) {
2
+ import { buildFiscalYear as u } from "../../../lib/fiscal-calendar/build-year.js";
3
+ import { isDateIntervalDisabled as m } from "./calendar-month-utils.js";
4
+ function A(r) {
5
5
  return r ? new Date(r.fy ?? r.year, 0, 1) : /* @__PURE__ */ new Date();
6
6
  }
7
- function n(r) {
7
+ function e(r) {
8
8
  return r.fy ?? r.year;
9
9
  }
10
- function e(r, f) {
11
- return n(r) === n(f);
10
+ function o(r, s) {
11
+ return e(r) === e(s);
12
12
  }
13
13
  function l(r) {
14
14
  return !!(r && !Array.isArray(r) && ("from" in r || "to" in r));
15
15
  }
16
- function A(r, f) {
17
- if (!l(f))
16
+ function E(r, s) {
17
+ if (!l(s))
18
18
  return { isStart: !1, isEnd: !1, isMiddle: !1 };
19
- const i = f.from, t = f.to;
20
- if (!i && !t) return { isStart: !1, isEnd: !1, isMiddle: !1 };
21
- if (!i)
22
- return { isStart: !1, isEnd: t ? n(t) === r : !1, isMiddle: !1 };
23
- const s = n(i);
24
- if (!t) return { isStart: r === s, isEnd: !1, isMiddle: !1 };
25
- const o = n(t);
19
+ const f = s.from, t = s.to;
20
+ if (!f && !t) return { isStart: !1, isEnd: !1, isMiddle: !1 };
21
+ if (!f)
22
+ return { isStart: !1, isEnd: t ? e(t) === r : !1, isMiddle: !1 };
23
+ const n = e(f);
24
+ if (!t) return { isStart: r === n, isEnd: !1, isMiddle: !1 };
25
+ const i = e(t);
26
26
  return {
27
- isStart: r === s,
28
- isEnd: r === o,
29
- isMiddle: r > s && r < o
27
+ isStart: r === n,
28
+ isEnd: r === i,
29
+ isMiddle: r > n && r < i
30
30
  };
31
31
  }
32
- function w(r, f, i) {
33
- if (i === "single") return r;
34
- if (i === "multiple") {
35
- const s = Array.isArray(f) ? f : [];
36
- return s.some((a) => e(a, r)) ? s.filter((a) => !e(a, r)) : [...s, r];
32
+ function b(r, s, f) {
33
+ if (f === "single") return r;
34
+ if (f === "multiple") {
35
+ const n = Array.isArray(s) ? s : [];
36
+ return n.some((a) => o(a, r)) ? n.filter((a) => !o(a, r)) : [...n, r];
37
37
  }
38
- const t = f;
39
- return !t?.from || t.to ? { from: r } : e(r, t.from) ? t : n(r) < n(t.from) ? { from: r, to: t.from } : { from: t.from, to: r };
38
+ const t = s;
39
+ return !t?.from || t.to ? { from: r } : o(r, t.from) ? t : e(r) < e(t.from) ? { from: r, to: t.from } : { from: t.from, to: r };
40
40
  }
41
- function E(r, f) {
42
- if (!f) return !1;
43
- const i = { year: r, fy: r };
44
- if (Array.isArray(f))
45
- return f.some((t) => n(t) === r);
46
- if (l(f)) {
47
- const t = f.from, s = f.to;
48
- if (!t) return s ? n(s) === r : !1;
49
- const o = n(t);
50
- if (!s) return r === o;
51
- const a = n(s);
52
- return r >= o && r <= a;
41
+ function w(r, s) {
42
+ if (!s) return !1;
43
+ const f = { year: r, fy: r };
44
+ if (Array.isArray(s))
45
+ return s.some((t) => e(t) === r);
46
+ if (l(s)) {
47
+ const t = s.from, n = s.to;
48
+ if (!t) return n ? e(n) === r : !1;
49
+ const i = e(t);
50
+ if (!n) return r === i;
51
+ const a = e(n);
52
+ return r >= i && r <= a;
53
53
  }
54
- return e(f, i) || f.year === r;
54
+ return o(s, f) || s.year === r;
55
55
  }
56
- function F(r, f, i) {
57
- let t = new Date(r, 0, 1), s = new Date(r, 11, 31, 23, 59, 59, 999);
58
- if (i?.calendarKind === "fiscal" && i.fiscalConfig)
56
+ function c(r, s) {
57
+ return Array.from({ length: s }, (f, t) => r + t);
58
+ }
59
+ function F(r) {
60
+ const { pageStart: s, pageSize: f, resolvedStartYear: t, resolvedEndYear: n, isYearDisabled: i } = r;
61
+ return c(s, f).some((a) => a < t || a > n ? !1 : !i(a));
62
+ }
63
+ function M(r, s, f) {
64
+ let t = new Date(r, 0, 1), n = new Date(r, 11, 31, 23, 59, 59, 999);
65
+ if (f?.calendarKind === "fiscal" && f.fiscalConfig)
59
66
  try {
60
- const o = m(i.fiscalConfig, r);
61
- t = d(o.start), s = d(o.end);
67
+ const i = u(f.fiscalConfig, r);
68
+ t = d(i.start), n = d(i.end);
62
69
  } catch {
63
70
  }
64
- return u(t, s, f);
71
+ return m(t, n, s);
65
72
  }
66
73
  export {
67
- A as getYearRangeProps,
68
- e as isSameYear,
69
- F as isYearDisabledForBounds,
74
+ c as getYearPageYears,
75
+ E as getYearRangeProps,
76
+ o as isSameYear,
77
+ M as isYearDisabledForBounds,
70
78
  l as isYearRangeSelection,
71
- E as isYearSelectedForSelection,
72
- w as nextYearSelection,
73
- g as viewMonthFromYear,
74
- n as yearKey
79
+ w as isYearSelectedForSelection,
80
+ b as nextYearSelection,
81
+ A as viewMonthFromYear,
82
+ e as yearKey,
83
+ F as yearPageHasSelectableYear
75
84
  };