impact-nova 2.5.13 → 2.5.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/dist/components/data/data-table/build-column-tree-from-grid.d.ts +0 -1
  2. package/dist/components/data/data-table/build-column-tree-from-grid.js +50 -55
  3. package/dist/components/data/data-table/data-table-column-apply.d.ts +0 -2
  4. package/dist/components/data/data-table/data-table-column-apply.js +73 -84
  5. package/dist/components/data/data-table/data-table-column-list.js +64 -94
  6. package/dist/components/data/data-table/data-table-column-tree-cache.d.ts +6 -12
  7. package/dist/components/data/data-table/data-table-column-tree-cache.js +131 -250
  8. package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.d.ts +0 -5
  9. package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.js +11 -28
  10. package/dist/components/data/data-table/use-data-table-column-list-sync.d.ts +0 -10
  11. package/dist/components/data/data-table/use-data-table-column-list-sync.js +196 -250
  12. package/dist/components/data/expandable-list-item/expandable-list-item-attributes.js +3 -2
  13. package/dist/components/data/expandable-list-item/expandable-list-item-metrics.js +3 -2
  14. package/dist/components/data/nested-list/components/NestedListContent.d.ts +2 -10
  15. package/dist/components/data/nested-list/components/NestedListContent.js +138 -253
  16. package/dist/components/data/nested-list/components/SortableItem.d.ts +1 -2
  17. package/dist/components/data/nested-list/components/SortableItem.js +60 -62
  18. package/dist/components/data/nested-list/hooks/useNestedListDragDrop.d.ts +20 -10
  19. package/dist/components/data/nested-list/hooks/useNestedListDragDrop.js +233 -44
  20. package/dist/components/data/nested-list/nested-list-constants.d.ts +1 -4
  21. package/dist/components/data/nested-list/nested-list-constants.js +4 -10
  22. package/dist/components/data/nested-list/nested-list.js +336 -322
  23. package/dist/components/data/nested-list/nested-list.types.d.ts +0 -17
  24. package/dist/components/data-display/calendar/calendar-apply-validation.d.ts +2 -0
  25. package/dist/components/data-display/calendar/calendar-apply-validation.js +64 -67
  26. package/dist/components/data-display/calendar/calendar-available-view.d.ts +27 -0
  27. package/dist/components/data-display/calendar/calendar-available-view.js +85 -0
  28. package/dist/components/data-display/calendar/calendar-config.js +1 -1
  29. package/dist/components/data-display/calendar/calendar-day-picker-components.d.ts +4 -2
  30. package/dist/components/data-display/calendar/calendar-day-picker-components.js +234 -164
  31. package/dist/components/data-display/calendar/calendar-day-picker-view.js +77 -76
  32. package/dist/components/data-display/calendar/calendar-fiscal-day-cell.d.ts +9 -0
  33. package/dist/components/data-display/calendar/calendar-fiscal-day-cell.js +45 -0
  34. package/dist/components/data-display/calendar/calendar-fiscal-period-nav.d.ts +6 -0
  35. package/dist/components/data-display/calendar/calendar-fiscal-period-nav.js +34 -18
  36. package/dist/components/data-display/calendar/calendar-footer.js +21 -21
  37. package/dist/components/data-display/calendar/calendar-injected-week-row.d.ts +5 -0
  38. package/dist/components/data-display/calendar/calendar-injected-week-row.js +92 -0
  39. package/dist/components/data-display/calendar/calendar-leading-week.utils.d.ts +16 -0
  40. package/dist/components/data-display/calendar/calendar-leading-week.utils.js +51 -0
  41. package/dist/components/data-display/calendar/calendar-month-picker-panel.js +50 -49
  42. package/dist/components/data-display/calendar/calendar-month-utils.d.ts +5 -0
  43. package/dist/components/data-display/calendar/calendar-month-utils.js +85 -64
  44. package/dist/components/data-display/calendar/calendar-orphan-week.d.ts +23 -0
  45. package/dist/components/data-display/calendar/calendar-padding-week.utils.d.ts +3 -1
  46. package/dist/components/data-display/calendar/calendar-padding-week.utils.js +7 -5
  47. package/dist/components/data-display/calendar/calendar-period-cell.js +45 -46
  48. package/dist/components/data-display/calendar/calendar-quarter-panes.js +33 -31
  49. package/dist/components/data-display/calendar/calendar-selection-appearance.d.ts +10 -0
  50. package/dist/components/data-display/calendar/calendar-selection-appearance.js +53 -39
  51. package/dist/components/data-display/calendar/calendar-selection.d.ts +25 -0
  52. package/dist/components/data-display/calendar/calendar-selection.js +52 -23
  53. package/dist/components/data-display/calendar/calendar-week-number-cell.d.ts +2 -1
  54. package/dist/components/data-display/calendar/calendar-week-number-cell.js +59 -45
  55. package/dist/components/data-display/calendar/calendar-week-utils.d.ts +15 -4
  56. package/dist/components/data-display/calendar/calendar-week-utils.js +59 -50
  57. package/dist/components/data-display/calendar/calendar-year-panes.d.ts +3 -0
  58. package/dist/components/data-display/calendar/calendar-year-panes.js +53 -49
  59. package/dist/components/data-display/calendar/calendar.js +146 -143
  60. package/dist/components/data-display/calendar/calendar.types.d.ts +5 -0
  61. package/dist/components/data-display/calendar/use-calendar-day-picker-config.d.ts +2 -1
  62. package/dist/components/data-display/calendar/use-calendar-day-picker-config.js +79 -74
  63. package/dist/components/data-display/calendar/use-calendar-state.d.ts +3 -1
  64. package/dist/components/data-display/calendar/use-calendar-state.js +394 -314
  65. package/dist/components/feedback/tooltip/tab-tooltip-render.js +3 -2
  66. package/dist/components/flows/command-palette/shortcut-settings.js +10 -10
  67. package/dist/components/flows/filter-panel/filter-panel.js +4 -4
  68. package/dist/components/forms/date-picker/date-picker.js +60 -58
  69. package/dist/components/forms/date-picker/date-picker.types.d.ts +5 -0
  70. package/dist/components/forms/date-picker/date-range-picker.js +66 -64
  71. package/dist/components/forms/date-picker/fiscal-pass-through.d.ts +1 -0
  72. package/dist/components/forms/date-picker/fiscal-pass-through.js +3 -2
  73. package/dist/components/forms/date-picker/fiscal-picker-fixtures.d.ts +17 -0
  74. package/dist/components/forms/date-picker/month-picker.js +61 -59
  75. package/dist/components/forms/date-picker/month-range-picker.js +63 -61
  76. package/dist/components/forms/date-picker/multi-date-picker.js +51 -49
  77. package/dist/components/forms/date-picker/multi-month-picker.js +49 -47
  78. package/dist/components/forms/date-picker/multi-quarter-picker.js +51 -47
  79. package/dist/components/forms/date-picker/multi-week-picker.js +53 -51
  80. package/dist/components/forms/date-picker/multi-year-picker.js +53 -49
  81. package/dist/components/forms/date-picker/quarter-picker.js +51 -47
  82. package/dist/components/forms/date-picker/quarter-range-picker.js +50 -46
  83. package/dist/components/forms/date-picker/week-picker.js +130 -126
  84. package/dist/components/forms/date-picker/week-range-picker.js +159 -155
  85. package/dist/components/forms/date-picker/year-picker.js +52 -48
  86. package/dist/components/forms/date-picker/year-range-picker.js +52 -48
  87. package/dist/components/forms/select/components/SelectTriggerValue.js +3 -2
  88. package/dist/components/forms/select/components/Submenu.js +3 -2
  89. package/dist/form-react/Fields/DateInputField.js +51 -50
  90. package/dist/form-react/Fields/DateRangeField.js +14 -13
  91. package/dist/form-react/Fields/MonthRangeField.js +29 -28
  92. package/dist/form-react/Fields/MultiMonthPickerField.js +13 -12
  93. package/dist/form-react/Fields/MultiWeekPickerField.js +35 -27
  94. package/dist/form-react/Fields/MultiYearPickerField.d.ts +8 -0
  95. package/dist/form-react/Fields/MultiYearPickerField.js +57 -0
  96. package/dist/form-react/Fields/WeekRangePicker.js +33 -32
  97. package/dist/form-react/Fields/YearPickerField.d.ts +8 -0
  98. package/dist/form-react/Fields/YearPickerField.js +57 -0
  99. package/dist/form-react/Fields/YearRangePickerField.d.ts +8 -0
  100. package/dist/form-react/Fields/YearRangePickerField.js +57 -0
  101. package/dist/form-react/registry/defaultFieldRegistrations.d.ts +1 -1
  102. package/dist/form-react/registry/defaultFieldRegistrations.js +16 -13
  103. package/dist/form-react/types/fields.types.d.ts +69 -1
  104. package/dist/form-react/types/fieldsOutput.types.d.ts +8 -2
  105. package/dist/form-react/utils/fieldDefaults.utils.js +1 -1
  106. package/dist/impact-nova-components.css +13 -6
  107. package/dist/impact-nova.css +1 -1
  108. package/dist/lib/fiscal-calendar/index.d.ts +2 -2
  109. package/dist/lib/fiscal-calendar/index.js +26 -28
  110. package/dist/lib/fiscal-calendar/types.d.ts +0 -7
  111. package/dist/lib/fiscal-calendar/week-selection.d.ts +3 -4
  112. package/dist/lib/fiscal-calendar/week-selection.js +52 -79
  113. package/dist/llms/rules/ag-grid.js +1 -1
  114. package/dist/llms/rules/installation.js +1 -1
  115. package/dist/llms/rules/requirements.js +1 -1
  116. package/package.json +1 -1
  117. package/dist/components/data/data-table/column-picker-authority.d.ts +0 -34
  118. package/dist/components/data/data-table/column-picker-authority.js +0 -116
  119. package/dist/components/data/data-table/column-picker-drop-validation.d.ts +0 -7
  120. package/dist/components/data/data-table/column-picker-drop-validation.js +0 -37
  121. package/dist/components/data/data-table/data-table-column-list-tree-apply.d.ts +0 -10
  122. package/dist/components/data/data-table/data-table-column-list-tree-apply.js +0 -79
  123. package/dist/components/data/data-table/data-table-flat-column-virtual-rows.d.ts +0 -26
  124. package/dist/components/data/data-table/data-table-flat-column-virtual-rows.js +0 -195
  125. package/dist/components/data/data-table/data-table-picker-column-eligibility.d.ts +0 -1
  126. package/dist/components/data/data-table/data-table-picker-column-eligibility.js +0 -7
  127. package/dist/components/data/data-table/reconcile-column-tree-from-grid.d.ts +0 -12
  128. package/dist/components/data/data-table/reconcile-column-tree-from-grid.js +0 -12
  129. package/dist/components/data/nested-list/hooks/useVirtualNestedListDrag.d.ts +0 -24
  130. package/dist/components/data/nested-list/hooks/useVirtualNestedListDrag.js +0 -128
  131. package/dist/components/data/nested-list/nested-list-display-utils.d.ts +0 -11
  132. package/dist/components/data/nested-list/nested-list-display-utils.js +0 -74
  133. package/dist/components/data/nested-list/nested-list-drop-engine.d.ts +0 -31
  134. package/dist/components/data/nested-list/nested-list-drop-engine.js +0 -209
  135. package/dist/components/data/nested-list/nested-list-flat-virtual-handlers.d.ts +0 -26
  136. package/dist/components/data/nested-list/nested-list-flat-virtual-handlers.js +0 -67
  137. package/dist/components/data/nested-list/nested-list-item-tree-mutations.d.ts +0 -4
  138. package/dist/components/data/nested-list/nested-list-item-tree-mutations.js +0 -43
  139. package/dist/components/data/nested-list/nested-list-lazy-flat-rows.d.ts +0 -3
  140. package/dist/components/data/nested-list/nested-list-lazy-flat-rows.js +0 -34
  141. package/dist/components/data/nested-list/nested-list-row-estimates.d.ts +0 -9
  142. package/dist/components/data/nested-list/nested-list-row-estimates.js +0 -14
  143. package/dist/components/data/nested-list/nested-list-scroll-anchor.d.ts +0 -36
  144. package/dist/components/data/nested-list/nested-list-scroll-anchor.js +0 -47
  145. package/dist/components/data/nested-list/nested-list-virtual-drop.d.ts +0 -59
  146. package/dist/components/data/nested-list/nested-list-virtual-drop.js +0 -341
  147. package/dist/lib/hash/fnv1a128.d.ts +0 -16
  148. package/dist/lib/hash/fnv1a128.js +0 -21
@@ -4,7 +4,6 @@ export interface ColumnItemData extends Record<string, unknown> {
4
4
  hasSortApplied?: boolean;
5
5
  hasFilterApplied?: boolean;
6
6
  pinned?: 'left' | 'right' | null;
7
- columnGroupChain?: readonly string[];
8
7
  }
9
8
  export interface BuildColumnTreeLabels {
10
9
  frozenColumns: string;
@@ -1,98 +1,93 @@
1
- import { resolveColumnPinnedFromGridState as B } from "./data-table-column-apply.js";
2
- import { isPickerEligibleColumnId as E } from "./data-table-picker-column-eligibility.js";
3
- function H(l) {
4
- const a = [];
1
+ import { resolveColumnPinnedFromGridState as T } from "./data-table-column-apply.js";
2
+ function B(l) {
3
+ const u = [];
5
4
  let c = l.getOriginalParent();
6
5
  for (; c; ) {
7
- const u = c.getColGroupDef();
8
- u?.headerName && u?.children && a.push(c), c = c.getOriginalParent();
6
+ const a = c.getColGroupDef();
7
+ a?.headerName && a?.children && u.push(c), c = c.getOriginalParent();
9
8
  }
10
- return a.reverse(), a;
9
+ return u.reverse(), u;
11
10
  }
12
- function L(l, a) {
13
- const c = l.getColumnState(), u = l.getGridOption("context"), z = typeof u?.activeSearchColumnId == "string" ? u.activeSearchColumnId : null, _ = l.getAllGridColumns?.() ?? l.getColumns() ?? [], F = new Map(
11
+ function q(l, u) {
12
+ const c = l.getColumnState(), a = l.getGridOption("context"), z = typeof a?.activeSearchColumnId == "string" ? a.activeSearchColumnId : null, _ = l.getAllGridColumns?.() ?? l.getColumns() ?? [], F = new Map(
14
13
  _.map((e) => [e.getColId(), e])
15
- ), h = [], m = [], v = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map();
16
- p.set(h, "f"), p.set(m, "s");
14
+ ), f = [], h = [], D = /* @__PURE__ */ new Map(), G = /* @__PURE__ */ new Map(), m = /* @__PURE__ */ new Map();
15
+ m.set(f, "f"), m.set(h, "s");
17
16
  let M = 0;
18
17
  const x = (e) => {
19
- let o = p.get(e);
20
- return o === void 0 && (o = `n${M++}`, p.set(e, o)), o;
18
+ let o = m.get(e);
19
+ return o === void 0 && (o = `n${M++}`, m.set(e, o)), o;
21
20
  }, O = (e, o) => {
22
- const t = e.getGroupId(), i = x(o), r = `${t}::${i}`, n = v.get(r);
23
- if (n && n.list === o && o[o.length - 1] === n.node)
24
- return n.node;
25
- const s = y.get(r) || 0;
26
- y.set(r, s + 1);
27
- const k = e.getColGroupDef(), d = {
28
- id: s === 0 ? `${t}__${i}` : `${t}__${i}__${s}`,
29
- label: k?.headerName || t,
21
+ const n = e.getGroupId(), i = x(o), r = `${n}::${i}`, t = D.get(r);
22
+ if (t && t.list === o && o[o.length - 1] === t.node)
23
+ return t.node;
24
+ const s = G.get(r) || 0;
25
+ G.set(r, s + 1);
26
+ const I = e.getColGroupDef(), d = {
27
+ id: s === 0 ? `${n}__${i}` : `${n}__${i}__${s}`,
28
+ label: I?.headerName || n,
30
29
  checked: !0,
31
30
  children: [],
32
31
  category: "group"
33
32
  };
34
- return o.push(d), v.set(r, { list: o, node: d }), d;
33
+ return o.push(d), D.set(r, { list: o, node: d }), d;
35
34
  };
36
- let C = 0, N = 0, I = 0, S = 0;
35
+ let p = 0, S = 0, g = 0, v = 0;
37
36
  c.forEach((e) => {
38
37
  const o = F.get(e.colId) ?? l.getColumn(e.colId);
39
38
  if (!o) return;
40
- const t = o.getColDef(), i = t.headerName;
41
- if (i != null && i.trim() === "" || !E(e.colId))
39
+ const n = o.getColDef(), i = n.headerName;
40
+ if (i != null && i.trim() === "" || e.colId === "ag-Grid-SelectionColumn")
42
41
  return;
43
- const r = t.headerName;
44
- let n = typeof r == "string" && r.trim() !== "" ? r : l.getDisplayNameForColumn(o, "header");
45
- if ((!n || n.trim() === "") && (n = t.field ?? e.colId), !n || n.trim() === "")
42
+ const r = n.headerName;
43
+ let t = typeof r == "string" && r.trim() !== "" ? r : l.getDisplayNameForColumn(o, "header");
44
+ if ((!t || t.trim() === "") && (t = n.field ?? e.colId), !t || t.trim() === "")
46
45
  return;
47
- const s = !e.hide, k = !!e.sort, $ = o.isFilterActive() || z === e.colId, d = B(e, o), f = {
46
+ const s = !e.hide, I = !!e.sort, y = o.isFilterActive() || z === e.colId, d = T(e, o), b = {
48
47
  id: e.colId,
49
- label: n,
48
+ label: t,
50
49
  checked: s,
51
50
  data: {
52
- hasSortApplied: k,
53
- hasFilterApplied: $,
51
+ hasSortApplied: I,
52
+ hasFilterApplied: y,
54
53
  pinned: d
55
54
  }
56
55
  };
57
- d ? (C++, s && N++) : (I++, s && S++);
58
- const w = d ? h : m, G = H(o), P = G.map((g) => g.getGroupId());
59
- if (G.length > 0) {
60
- f.data = {
61
- ...f.data,
62
- columnGroupChain: P
63
- };
64
- let g = w, D = null;
65
- for (const T of G)
66
- D = O(T, g), g = D.children;
67
- D.children.push(f);
56
+ d ? (p++, s && S++) : (g++, s && v++);
57
+ const N = d ? f : h, $ = B(o);
58
+ if ($.length > 0) {
59
+ let w = N, k = null;
60
+ for (const P of $)
61
+ k = O(P, w), w = k.children;
62
+ k.children.push(b);
68
63
  } else
69
- w.push(f);
64
+ N.push(b);
70
65
  });
71
- const b = (e) => {
66
+ const C = (e) => {
72
67
  let o = e.length > 0;
73
- for (const t of e)
74
- t.children && (t.checked = b(t.children)), t.checked || (o = !1);
68
+ for (const n of e)
69
+ n.children && (n.checked = C(n.children)), n.checked || (o = !1);
75
70
  return o;
76
71
  };
77
- return b(h), b(m), [
72
+ return C(f), C(h), [
78
73
  {
79
74
  id: "root-frozen",
80
- label: a.frozenColumns,
81
- checked: C > 0 && N === C,
82
- children: h,
75
+ label: u.frozenColumns,
76
+ checked: p > 0 && S === p,
77
+ children: f,
83
78
  category: "structure",
84
79
  isDragDisabled: !0
85
80
  },
86
81
  {
87
82
  id: "root-scrollable",
88
- label: a.scrollableColumns,
89
- checked: I > 0 && S === I,
90
- children: m,
83
+ label: u.scrollableColumns,
84
+ checked: g > 0 && v === g,
85
+ children: h,
91
86
  category: "structure",
92
87
  isDragDisabled: !0
93
88
  }
94
89
  ];
95
90
  }
96
91
  export {
97
- L as buildColumnTreeFromGrid
92
+ q as buildColumnTreeFromGrid
98
93
  };
@@ -26,8 +26,6 @@ export declare function fingerprintColumnTreeVisibility(items: NestedListItem[])
26
26
  export declare function fingerprintColumnTreeItems(items: NestedListItem[]): string;
27
27
  /** Fingerprint for sort/filter indicator badges on column-picker leaves. */
28
28
  export declare function fingerprintColumnTreeIndicators(items: NestedListItem[]): string;
29
- /** Grid-only sort/filter indicator fingerprint — no tree walk, no per-column isFilterActive. */
30
- export declare function fingerprintGridColumnIndicators(gridApi: GridApi): string;
31
29
  /**
32
30
  * Run after `applyColumnState` returns. AG Grid applies pin/order/hide synchronously;
33
31
  * `queueMicrotask` lets any same-turn grid events finish before we release the panel lock.
@@ -1,130 +1,119 @@
1
- import { Fnv1a128Hasher as u } from "../../../lib/hash/fnv1a128.js";
2
- import { isPickerEligibleColumnId as h } from "./data-table-picker-column-eligibility.js";
3
- const C = 150, I = 300;
4
- function a(t) {
5
- return t === "left" || t === !0 ? "left" : t === "right" ? "right" : null;
1
+ const s = 150, p = 300;
2
+ function u(i) {
3
+ return i === "left" || i === !0 ? "left" : i === "right" ? "right" : null;
6
4
  }
7
- function s(t, e) {
8
- return "pinned" in t && t.pinned !== void 0 ? a(t.pinned) : a(e.getPinned());
5
+ function a(i, r) {
6
+ return "pinned" in i && i.pinned !== void 0 ? u(i.pinned) : u(r.getPinned());
9
7
  }
10
- function G(t, e) {
11
- const r = t.getColumn(e);
12
- if (!r) return null;
13
- const l = t.getColumnState().find((n) => n.colId === e);
14
- return l ? s(l, r) : a(r.getPinned());
8
+ function g(i, r) {
9
+ const e = i.getColumn(r);
10
+ if (!e) return null;
11
+ const o = i.getColumnState().find((n) => n.colId === r);
12
+ return o ? a(o, e) : u(e.getPinned());
15
13
  }
16
- function f(t, e) {
17
- return t.map((r) => {
18
- if ((r.category === "group" || r.children && r.children.length > 0) && r.children)
14
+ function d(i, r) {
15
+ return i.map((e) => {
16
+ if ((e.category === "group" || e.children && e.children.length > 0) && e.children)
19
17
  return {
20
- ...r,
21
- children: f(r.children, e)
18
+ ...e,
19
+ children: d(e.children, r)
22
20
  };
23
- const n = r.data ?? {};
24
- let i = null;
25
- if (e !== null) {
26
- const o = n.pinned;
27
- i = o === "left" || o === "right" ? o : e;
21
+ const n = e.data ?? {};
22
+ let t = null;
23
+ if (r !== null) {
24
+ const l = n.pinned;
25
+ t = l === "left" || l === "right" ? l : r;
28
26
  }
29
27
  return {
30
- ...r,
28
+ ...e,
31
29
  data: {
32
30
  ...n,
33
- pinned: i
31
+ pinned: t
34
32
  }
35
33
  };
36
34
  });
37
35
  }
38
- function S(t) {
39
- return t.map((e) => e.id === "root-frozen" ? {
40
- ...e,
41
- children: e.children ? f(e.children, "left") : []
42
- } : e.id === "root-scrollable" ? {
43
- ...e,
44
- children: e.children ? f(e.children, null) : []
45
- } : e);
36
+ function m(i) {
37
+ return i.map((r) => r.id === "root-frozen" ? {
38
+ ...r,
39
+ children: r.children ? d(r.children, "left") : []
40
+ } : r.id === "root-scrollable" ? {
41
+ ...r,
42
+ children: r.children ? d(r.children, null) : []
43
+ } : r);
46
44
  }
47
- function y(t) {
48
- const e = new u(), r = (l, n) => {
49
- for (const i of l) {
50
- if (i.id === "root-frozen") {
51
- i.children && r(i.children, "left");
45
+ function C(i) {
46
+ const r = [], e = (o, n) => {
47
+ for (const t of o) {
48
+ if (t.id === "root-frozen") {
49
+ t.children && e(t.children, "left");
52
50
  continue;
53
51
  }
54
- if (i.id === "root-scrollable") {
55
- i.children && r(i.children, null);
52
+ if (t.id === "root-scrollable") {
53
+ t.children && e(t.children, null);
56
54
  continue;
57
55
  }
58
- if ((i.category === "group" || i.children && i.children.length > 0) && i.children) {
59
- r(i.children, n);
56
+ if ((t.category === "group" || t.children && t.children.length > 0) && t.children) {
57
+ e(t.children, n);
60
58
  continue;
61
59
  }
62
- let d = "0";
60
+ let f = "0";
63
61
  if (n !== null) {
64
- const c = i.data?.pinned;
65
- d = c === "left" || c === "right" ? c : "left";
62
+ const c = t.data?.pinned;
63
+ f = c === "left" || c === "right" ? c : "left";
66
64
  }
67
- e.update(i.id).update(":").update(d).update("|");
65
+ r.push(`${t.id}:${f}`);
68
66
  }
69
67
  };
70
- return r(t, null), e.digest();
68
+ return e(i, null), r.join("|");
71
69
  }
72
- function v(t) {
73
- const e = new u(), r = (l) => {
74
- for (const n of l) {
70
+ function G(i) {
71
+ const r = [], e = (o) => {
72
+ for (const n of o) {
75
73
  if (n.id === "root-frozen" || n.id === "root-scrollable") {
76
- n.children && r(n.children);
74
+ n.children && e(n.children);
77
75
  continue;
78
76
  }
79
77
  if ((n.category === "group" || n.children && n.children.length > 0) && n.children) {
80
- r(n.children);
78
+ e(n.children);
81
79
  continue;
82
80
  }
83
- e.update(n.id).update(":").update(n.checked ? "1" : "0").update("|");
81
+ r.push(`${n.id}:${n.checked ? "1" : "0"}`);
84
82
  }
85
83
  };
86
- return r(t), e.digest();
84
+ return e(i), r.join("|");
87
85
  }
88
- function M(t) {
89
- const e = new u(), r = (l) => {
90
- for (const n of l) {
86
+ function y(i) {
87
+ const r = [], e = (o) => {
88
+ for (const n of o) {
91
89
  if (n.id === "root-frozen" || n.id === "root-scrollable") {
92
- n.children && r(n.children);
90
+ n.children && e(n.children);
93
91
  continue;
94
92
  }
95
93
  if ((n.category === "group" || n.children && n.children.length > 0) && n.children) {
96
- r(n.children);
94
+ e(n.children);
97
95
  continue;
98
96
  }
99
- const o = n.data;
100
- e.update(n.id).update(":").update(o?.hasSortApplied ? "1" : "0").update(":").update(o?.hasFilterApplied ? "1" : "0").update("|");
97
+ const l = n.data;
98
+ r.push(
99
+ `${n.id}:${l?.hasSortApplied ? "1" : "0"}:${l?.hasFilterApplied ? "1" : "0"}`
100
+ );
101
101
  }
102
102
  };
103
- return r(t), e.digest();
103
+ return e(i), r.join("|");
104
104
  }
105
- function P(t) {
106
- const e = t.getGridOption("context"), r = typeof e?.activeSearchColumnId == "string" ? e.activeSearchColumnId : null, l = typeof t.getFilterModel == "function" ? t.getFilterModel() : {}, n = new Set(Object.keys(l ?? {})), i = new u();
107
- for (const o of t.getColumnState()) {
108
- if (!h(o.colId))
109
- continue;
110
- const d = n.has(o.colId) || r === o.colId;
111
- i.update(o.colId).update(":").update(o.sort ? "1" : "0").update(":").update(d ? "1" : "0").update("|");
112
- }
113
- return i.digest();
114
- }
115
- function T(t) {
116
- queueMicrotask(t);
105
+ function S(i) {
106
+ queueMicrotask(i);
117
107
  }
118
108
  export {
119
- C as EXTERNAL_SYNC_DEBOUNCE_MS,
120
- I as GRID_AUTO_UNPIN_WAIT_MS,
121
- T as afterSynchronousColumnApply,
122
- S as alignColumnTreePinMetadata,
123
- M as fingerprintColumnTreeIndicators,
124
- y as fingerprintColumnTreeLayout,
125
- v as fingerprintColumnTreeVisibility,
126
- P as fingerprintGridColumnIndicators,
127
- a as normalizeColumnPinned,
128
- G as readGridColumnPinned,
129
- s as resolveColumnPinnedFromGridState
109
+ s as EXTERNAL_SYNC_DEBOUNCE_MS,
110
+ p as GRID_AUTO_UNPIN_WAIT_MS,
111
+ S as afterSynchronousColumnApply,
112
+ m as alignColumnTreePinMetadata,
113
+ y as fingerprintColumnTreeIndicators,
114
+ C as fingerprintColumnTreeLayout,
115
+ G as fingerprintColumnTreeVisibility,
116
+ u as normalizeColumnPinned,
117
+ g as readGridColumnPinned,
118
+ a as resolveColumnPinnedFromGridState
130
119
  };
@@ -1,116 +1,86 @@
1
- import { jsxs as z, jsx as n } from "react/jsx-runtime";
2
- import { useRef as B, useState as H, useMemo as m, useCallback as s } from "react";
3
- import { useDataTable as j } from "./data-table-context.js";
4
- import { useDataTableSheet as G } from "./data-table-sheet-context.js";
5
- import { NestedList as U } from "../nested-list/nested-list.js";
6
- import { SelectionMode as W } from "../nested-list/nested-list.types.js";
7
- import { useImpactNovaI18n as Z } from "../../../i18n/use-impact-nova-i18n.js";
8
- import { countNestedListLeaves as q, buildCollapsedStateForAllGroups as J } from "../nested-list/nested-list-tree-utils.js";
9
- import { NESTED_LIST_VIRTUALIZATION_THRESHOLD as K, NESTED_LIST_ROOT_FROZEN_ID as Q } from "../nested-list/nested-list-constants.js";
10
- import { PinSwitch as X } from "./pin-switch.js";
11
- import { ColumnIndicator as C } from "./column-indicator.js";
12
- import { IndicatorLegend as Y } from "./indicator-legend.js";
13
- import { useDataTableColumnListSync as $ } from "./use-data-table-column-list-sync.js";
14
- import { buildFlatColumnVirtualRowModel as ee } from "./data-table-flat-column-virtual-rows.js";
15
- import { isValidColumnPickerGroupDrop as te } from "./column-picker-drop-validation.js";
16
- const le = 100, Le = ({
17
- enableApplyDiscard: c = !1,
18
- showSearch: A = !0,
19
- showSelectAll: b = !0,
20
- showCollapse: L = !0
1
+ import { jsxs as D, jsx as n } from "react/jsx-runtime";
2
+ import { useRef as _, useState as F, useMemo as O, useCallback as i } from "react";
3
+ import { useDataTable as E } from "./data-table-context.js";
4
+ import { useDataTableSheet as y } from "./data-table-sheet-context.js";
5
+ import { NestedList as z } from "../nested-list/nested-list.js";
6
+ import { SelectionMode as P } from "../nested-list/nested-list.types.js";
7
+ import { useImpactNovaI18n as R } from "../../../i18n/use-impact-nova-i18n.js";
8
+ import { countNestedListLeaves as k, buildCollapsedStateForAllGroups as M } from "../nested-list/nested-list-tree-utils.js";
9
+ import { PinSwitch as j } from "./pin-switch.js";
10
+ import { ColumnIndicator as m } from "./column-indicator.js";
11
+ import { IndicatorLegend as G } from "./indicator-legend.js";
12
+ import { useDataTableColumnListSync as H } from "./use-data-table-column-list-sync.js";
13
+ const U = 100, te = ({
14
+ enableApplyDiscard: o = !1,
15
+ showSearch: d = !0,
16
+ showSelectAll: p = !0,
17
+ showCollapse: f = !0
21
18
  }) => {
22
- const { gridApi: S } = j(), { open: g } = G(), { t: i } = Z(), T = B({}), [a, I] = H({}), u = m(
23
- () => ({
24
- frozenColumns: i("dataTable.frozenColumns"),
25
- scrollableColumns: i("dataTable.scrollableColumns")
26
- }),
27
- [i]
28
- ), {
29
- items: o,
30
- columnPickerAuthority: l,
31
- pickerMode: v,
32
- isReady: D,
33
- listWrapperRef: y,
34
- handleChange: f,
35
- handleSubmit: R,
36
- handlePinChange: h,
37
- handleAuthorityItemToggle: _,
38
- handleAuthorityVirtualDrop: N,
39
- handleAuthoritySelectAll: x
40
- } = $({
41
- gridApi: S,
42
- frozenColumnsLabel: u.frozenColumns,
43
- scrollableColumnsLabel: u.scrollableColumns,
44
- isSyncActive: g
45
- }), t = v === "authority-flat" && l != null, d = m(() => t && l ? l.orderedColumnIds.length : q(o), [t, l, o]), E = m(() => t || Object.keys(a).length > 0 || o.length === 0 || d <= le ? a : J(o), [a, d, t, o]), O = m(() => d >= K ? "virtual-index" : "sortable", [d]), F = s(
46
- (e) => l ? ee(l, u, {
47
- searchQuery: e,
48
- sortAppliedByColumnId: l.sortAppliedByColumnId,
49
- filterAppliedByColumnId: l.filterAppliedByColumnId
50
- }) : { rowCount: 0, getRowAt: () => ({ item: o[0], level: 0, indentLevel: 0 }) },
51
- [l, u, o]
52
- ), V = s(
19
+ const { gridApi: h } = E(), { open: C } = y(), { t: r } = R(), b = _({}), [l, L] = F({}), {
20
+ items: a,
21
+ isReady: S,
22
+ listWrapperRef: g,
23
+ handleChange: c,
24
+ handleSubmit: A,
25
+ handlePinChange: u
26
+ } = H({
27
+ gridApi: h,
28
+ frozenColumnsLabel: r("dataTable.frozenColumns"),
29
+ scrollableColumnsLabel: r("dataTable.scrollableColumns"),
30
+ isSyncActive: C
31
+ }), T = O(() => Object.keys(l).length > 0 || a.length === 0 || k(a) <= U ? l : M(a), [l, a]), x = i(
53
32
  (e) => {
54
- f(e, c);
33
+ c(e, o);
55
34
  },
56
- [c, f]
57
- ), M = s(
58
- (e) => t ? !0 : te(e),
59
- [t]
60
- ), k = s(
61
- (e, p) => {
62
- if (!p.isLeaf) return null;
63
- const r = e.data;
64
- return !r?.hasSortApplied && !r?.hasFilterApplied ? null : /* @__PURE__ */ z("span", { className: "inline-flex items-center gap-1 shrink-0", children: [
65
- r?.hasSortApplied && /* @__PURE__ */ n(C, { type: "sort" }),
66
- r?.hasFilterApplied && /* @__PURE__ */ n(C, { type: "filter" })
35
+ [o, c]
36
+ ), I = i(
37
+ (e, s) => {
38
+ if (!s.isLeaf) return null;
39
+ const t = e.data;
40
+ return !t?.hasSortApplied && !t?.hasFilterApplied ? null : /* @__PURE__ */ D("span", { className: "inline-flex items-center gap-1 shrink-0", children: [
41
+ t?.hasSortApplied && /* @__PURE__ */ n(m, { type: "sort" }),
42
+ t?.hasFilterApplied && /* @__PURE__ */ n(m, { type: "filter" })
67
43
  ] });
68
44
  },
69
45
  []
70
- ), P = s(
71
- (e, p) => {
72
- const r = e.data;
73
- return e.category === "structure" ? e.id !== Q ? null : /* @__PURE__ */ n(Y, {}) : !p.isLeaf || !(r?.pinned === "left" || r?.pinned === "right") ? null : /* @__PURE__ */ n(
74
- X,
46
+ ), N = i(
47
+ (e, s) => {
48
+ const t = e.data;
49
+ return e.category === "structure" ? e.id !== "root-frozen" ? null : /* @__PURE__ */ n(G, {}) : !s.isLeaf || !(t?.pinned === "left" || t?.pinned === "right") ? null : /* @__PURE__ */ n(
50
+ j,
75
51
  {
76
- value: r?.pinned ?? null,
77
- onChange: (w) => h(e.id, w),
52
+ value: t?.pinned ?? null,
53
+ onChange: (v) => u(e.id, v),
78
54
  className: "shrink-0"
79
55
  }
80
56
  );
81
57
  },
82
- [h]
58
+ [u]
83
59
  );
84
- return D ? /* @__PURE__ */ n("div", { ref: y, className: "flex flex-col flex-1 min-h-0 bg-canvas-elevated", children: /* @__PURE__ */ n(
85
- U,
60
+ return S ? /* @__PURE__ */ n("div", { ref: g, className: "flex flex-col flex-1 min-h-0 bg-canvas-elevated", children: /* @__PURE__ */ n(
61
+ z,
86
62
  {
87
- items: o,
88
- onChange: V,
89
- onSubmit: R,
90
- onItemToggle: t ? _ : void 0,
91
- onVirtualDrop: t ? N : void 0,
92
- flatVirtualRowResolver: t ? F : void 0,
93
- onFlatVirtualSelectAll: t ? x : void 0,
94
- isValidDropTarget: t ? void 0 : M,
95
- renderLabelExtras: k,
96
- renderActions: P,
97
- enableApplyDiscard: c,
98
- enableSearch: A,
99
- enableSelectAll: b,
63
+ items: a,
64
+ onChange: x,
65
+ onSubmit: A,
66
+ renderLabelExtras: I,
67
+ renderActions: N,
68
+ enableApplyDiscard: o,
69
+ enableSearch: d,
70
+ enableSelectAll: p,
100
71
  enableDragDrop: !0,
101
- dragMode: O,
102
72
  enableCollapse: !0,
103
- enableGlobalCollapse: L,
104
- selectionMode: W.CASCADE_DOWN,
105
- searchPlaceholder: i("dataTable.searchColumnsPlaceholder"),
73
+ enableGlobalCollapse: f,
74
+ selectionMode: P.CASCADE_DOWN,
75
+ searchPlaceholder: r("dataTable.searchColumnsPlaceholder"),
106
76
  className: "flex-1 min-h-0",
107
- initialCollapsedItems: E,
77
+ initialCollapsedItems: T,
108
78
  onCollapseChange: (e) => {
109
- T.current = e, I(e);
79
+ b.current = e, L(e);
110
80
  }
111
81
  }
112
- ) }) : /* @__PURE__ */ n("div", { className: "p-4 text-[13px] text-content-placeholder", children: i("dataTable.loadingColumns") });
82
+ ) }) : /* @__PURE__ */ n("div", { className: "p-4 text-[13px] text-content-placeholder", children: r("dataTable.loadingColumns") });
113
83
  };
114
84
  export {
115
- Le as DataTableColumnList
85
+ te as DataTableColumnList
116
86
  };
@@ -1,26 +1,22 @@
1
- import { ColumnState, GridApi } from 'ag-grid-community';
1
+ import { GridApi } from 'ag-grid-community';
2
2
  import { NestedListItem } from '../nested-list/nested-list.types';
3
3
  import { BuildColumnTreeLabels } from './build-column-tree-from-grid';
4
4
  import { ColumnListSyncFingerprints, ColumnListSyncMode } from './data-table-column-list-sync';
5
- import { ColumnPickerAuthority } from './column-picker-authority';
6
- export type ColumnPickerMode = 'tree' | 'authority-flat';
7
5
  interface ColumnTreeCacheEntry {
8
6
  fingerprints: ColumnListSyncFingerprints;
9
7
  items: NestedListItem[];
10
- pickerMode: ColumnPickerMode;
11
- authority: ColumnPickerAuthority | null;
12
8
  gridLayoutFingerprint: string;
13
9
  gridVisibilityFingerprint: string;
10
+ /**
11
+ * Leaf column ids captured at write time (single tree walk here) so the
12
+ * structural stale-check at read time needs no tree traversal.
13
+ */
14
14
  leafColumnIds: ReadonlySet<string>;
15
15
  }
16
16
  export declare function readGridLayoutFingerprint(gridApi: GridApi): string;
17
17
  export declare function readGridVisibilityFingerprint(gridApi: GridApi): string;
18
- export declare function hasColumnTreeCache(gridApi: GridApi): boolean;
19
- /** Column counts at or above this threshold prewarm immediately instead of on idle. */
20
- export declare const LARGE_COLUMN_PREWARM_THRESHOLD = 5000;
21
18
  export declare function readColumnTreeCache(gridApi: GridApi, labels: BuildColumnTreeLabels): ColumnTreeCacheEntry | null;
22
19
  export declare function writeColumnTreeCache(gridApi: GridApi, rootItems: NestedListItem[]): ColumnListSyncFingerprints;
23
- export declare function writeColumnTreeAuthorityCache(gridApi: GridApi, authority: ColumnPickerAuthority): ColumnListSyncFingerprints;
24
20
  export declare function buildColumnTreeWithCache(gridApi: GridApi, labels: BuildColumnTreeLabels): NestedListItem[] | null;
25
21
  /**
26
22
  * True when the live grid's column-id set differs from the cached tree's leaf ids.
@@ -31,15 +27,13 @@ export declare function buildColumnTreeWithCache(gridApi: GridApi, labels: Build
31
27
  * ({@link writeColumnTreeCache}), so this does no tree traversal at read time;
32
28
  * it only scans `getColumnState()`, which callers already fetch for fingerprints.
33
29
  */
34
- export declare function isGridColumnSetDifferentFromCachedLeaves(gridApi: GridApi, cachedLeafColumnIds: ReadonlySet<string>, precomputedColumnState?: ColumnState[]): boolean;
30
+ export declare function isGridColumnSetDifferentFromCachedLeaves(gridApi: GridApi, cachedLeafColumnIds: ReadonlySet<string>): boolean;
35
31
  export declare function resolveColumnTreeFromCacheOrGrid(options: {
36
32
  gridApi: GridApi;
37
33
  labels: BuildColumnTreeLabels;
38
34
  previousFingerprints: ColumnListSyncFingerprints;
39
35
  }): {
40
36
  rootItems: NestedListItem[] | null;
41
- authority: ColumnPickerAuthority | null;
42
- pickerMode: ColumnPickerMode;
43
37
  syncMode: ColumnListSyncMode;
44
38
  fingerprints: ColumnListSyncFingerprints;
45
39
  };