impact-nova 2.5.12 → 2.5.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/dist/components/data/data-table/build-column-tree-from-grid.d.ts +1 -0
  2. package/dist/components/data/data-table/build-column-tree-from-grid.js +55 -50
  3. package/dist/components/data/data-table/column-picker-authority.d.ts +34 -0
  4. package/dist/components/data/data-table/column-picker-authority.js +116 -0
  5. package/dist/components/data/data-table/column-picker-drop-validation.d.ts +7 -0
  6. package/dist/components/data/data-table/column-picker-drop-validation.js +37 -0
  7. package/dist/components/data/data-table/data-table-column-apply.d.ts +2 -0
  8. package/dist/components/data/data-table/data-table-column-apply.js +84 -73
  9. package/dist/components/data/data-table/data-table-column-list-tree-apply.d.ts +10 -0
  10. package/dist/components/data/data-table/data-table-column-list-tree-apply.js +79 -0
  11. package/dist/components/data/data-table/data-table-column-list.js +94 -64
  12. package/dist/components/data/data-table/data-table-column-tree-cache.d.ts +12 -6
  13. package/dist/components/data/data-table/data-table-column-tree-cache.js +250 -131
  14. package/dist/components/data/data-table/data-table-flat-column-virtual-rows.d.ts +26 -0
  15. package/dist/components/data/data-table/data-table-flat-column-virtual-rows.js +195 -0
  16. package/dist/components/data/data-table/data-table-picker-column-eligibility.d.ts +1 -0
  17. package/dist/components/data/data-table/data-table-picker-column-eligibility.js +7 -0
  18. package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.d.ts +5 -0
  19. package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.js +28 -11
  20. package/dist/components/data/data-table/reconcile-column-tree-from-grid.d.ts +12 -0
  21. package/dist/components/data/data-table/reconcile-column-tree-from-grid.js +12 -0
  22. package/dist/components/data/data-table/use-data-table-column-list-sync.d.ts +10 -0
  23. package/dist/components/data/data-table/use-data-table-column-list-sync.js +250 -196
  24. package/dist/components/data/nested-list/components/NestedListContent.d.ts +10 -2
  25. package/dist/components/data/nested-list/components/NestedListContent.js +253 -138
  26. package/dist/components/data/nested-list/components/SortableItem.d.ts +2 -1
  27. package/dist/components/data/nested-list/components/SortableItem.js +62 -60
  28. package/dist/components/data/nested-list/hooks/useNestedListDragDrop.d.ts +10 -20
  29. package/dist/components/data/nested-list/hooks/useNestedListDragDrop.js +44 -233
  30. package/dist/components/data/nested-list/hooks/useVirtualNestedListDrag.d.ts +24 -0
  31. package/dist/components/data/nested-list/hooks/useVirtualNestedListDrag.js +128 -0
  32. package/dist/components/data/nested-list/nested-list-constants.d.ts +4 -1
  33. package/dist/components/data/nested-list/nested-list-constants.js +10 -4
  34. package/dist/components/data/nested-list/nested-list-display-utils.d.ts +11 -0
  35. package/dist/components/data/nested-list/nested-list-display-utils.js +74 -0
  36. package/dist/components/data/nested-list/nested-list-drop-engine.d.ts +31 -0
  37. package/dist/components/data/nested-list/nested-list-drop-engine.js +209 -0
  38. package/dist/components/data/nested-list/nested-list-flat-virtual-handlers.d.ts +26 -0
  39. package/dist/components/data/nested-list/nested-list-flat-virtual-handlers.js +67 -0
  40. package/dist/components/data/nested-list/nested-list-item-tree-mutations.d.ts +4 -0
  41. package/dist/components/data/nested-list/nested-list-item-tree-mutations.js +43 -0
  42. package/dist/components/data/nested-list/nested-list-lazy-flat-rows.d.ts +3 -0
  43. package/dist/components/data/nested-list/nested-list-lazy-flat-rows.js +34 -0
  44. package/dist/components/data/nested-list/nested-list-row-estimates.d.ts +9 -0
  45. package/dist/components/data/nested-list/nested-list-row-estimates.js +14 -0
  46. package/dist/components/data/nested-list/nested-list-scroll-anchor.d.ts +36 -0
  47. package/dist/components/data/nested-list/nested-list-scroll-anchor.js +47 -0
  48. package/dist/components/data/nested-list/nested-list-virtual-drop.d.ts +59 -0
  49. package/dist/components/data/nested-list/nested-list-virtual-drop.js +341 -0
  50. package/dist/components/data/nested-list/nested-list.js +322 -336
  51. package/dist/components/data/nested-list/nested-list.types.d.ts +17 -0
  52. package/dist/components/data-display/calendar/calendar-apply-validation.d.ts +0 -2
  53. package/dist/components/data-display/calendar/calendar-apply-validation.js +67 -64
  54. package/dist/components/data-display/calendar/calendar-config.js +1 -1
  55. package/dist/components/data-display/calendar/calendar-day-picker-components.d.ts +2 -4
  56. package/dist/components/data-display/calendar/calendar-day-picker-components.js +164 -234
  57. package/dist/components/data-display/calendar/calendar-day-picker-view.js +76 -77
  58. package/dist/components/data-display/calendar/calendar-fiscal-period-nav.d.ts +0 -6
  59. package/dist/components/data-display/calendar/calendar-fiscal-period-nav.js +18 -34
  60. package/dist/components/data-display/calendar/calendar-footer.js +21 -21
  61. package/dist/components/data-display/calendar/calendar-month-picker-panel.js +49 -50
  62. package/dist/components/data-display/calendar/calendar-month-utils.d.ts +0 -5
  63. package/dist/components/data-display/calendar/calendar-month-utils.js +64 -85
  64. package/dist/components/data-display/calendar/calendar-padding-week.utils.d.ts +1 -3
  65. package/dist/components/data-display/calendar/calendar-padding-week.utils.js +5 -7
  66. package/dist/components/data-display/calendar/calendar-period-cell.js +46 -45
  67. package/dist/components/data-display/calendar/calendar-quarter-panes.js +31 -33
  68. package/dist/components/data-display/calendar/calendar-selection-appearance.d.ts +0 -10
  69. package/dist/components/data-display/calendar/calendar-selection-appearance.js +39 -53
  70. package/dist/components/data-display/calendar/calendar-selection.d.ts +0 -25
  71. package/dist/components/data-display/calendar/calendar-selection.js +23 -52
  72. package/dist/components/data-display/calendar/calendar-week-number-cell.d.ts +1 -2
  73. package/dist/components/data-display/calendar/calendar-week-number-cell.js +45 -59
  74. package/dist/components/data-display/calendar/calendar-week-utils.d.ts +3 -13
  75. package/dist/components/data-display/calendar/calendar-week-utils.js +50 -59
  76. package/dist/components/data-display/calendar/calendar-year-panes.d.ts +0 -3
  77. package/dist/components/data-display/calendar/calendar-year-panes.js +49 -53
  78. package/dist/components/data-display/calendar/calendar.js +143 -146
  79. package/dist/components/data-display/calendar/calendar.types.d.ts +0 -5
  80. package/dist/components/data-display/calendar/use-calendar-day-picker-config.d.ts +1 -2
  81. package/dist/components/data-display/calendar/use-calendar-day-picker-config.js +74 -79
  82. package/dist/components/data-display/calendar/use-calendar-state.d.ts +1 -3
  83. package/dist/components/data-display/calendar/use-calendar-state.js +325 -403
  84. package/dist/components/forms/date-picker/date-picker.js +58 -60
  85. package/dist/components/forms/date-picker/date-picker.types.d.ts +0 -5
  86. package/dist/components/forms/date-picker/date-range-picker.js +64 -66
  87. package/dist/components/forms/date-picker/fiscal-pass-through.d.ts +0 -1
  88. package/dist/components/forms/date-picker/fiscal-pass-through.js +2 -3
  89. package/dist/components/forms/date-picker/month-picker.js +59 -61
  90. package/dist/components/forms/date-picker/month-range-picker.js +61 -63
  91. package/dist/components/forms/date-picker/multi-date-picker.js +49 -51
  92. package/dist/components/forms/date-picker/multi-month-picker.js +47 -49
  93. package/dist/components/forms/date-picker/multi-quarter-picker.js +47 -51
  94. package/dist/components/forms/date-picker/multi-week-picker.js +51 -53
  95. package/dist/components/forms/date-picker/multi-year-picker.js +49 -53
  96. package/dist/components/forms/date-picker/quarter-picker.js +47 -51
  97. package/dist/components/forms/date-picker/quarter-range-picker.js +46 -50
  98. package/dist/components/forms/date-picker/week-picker.js +66 -68
  99. package/dist/components/forms/date-picker/week-range-picker.js +80 -82
  100. package/dist/components/forms/date-picker/year-picker.js +48 -52
  101. package/dist/components/forms/date-picker/year-range-picker.js +48 -52
  102. package/dist/form-react/Fields/DateInputField.js +50 -51
  103. package/dist/form-react/Fields/DateRangeField.js +13 -14
  104. package/dist/form-react/Fields/MonthRangeField.js +28 -29
  105. package/dist/form-react/Fields/MultiMonthPickerField.js +12 -13
  106. package/dist/form-react/Fields/MultiWeekPickerField.js +27 -35
  107. package/dist/form-react/Fields/WeekRangePicker.js +32 -33
  108. package/dist/form-react/types/fields.types.d.ts +0 -14
  109. package/dist/impact-nova-components.css +6 -13
  110. package/dist/impact-nova.css +1 -1
  111. package/dist/lib/fiscal-calendar/week-selection.js +2 -2
  112. package/dist/lib/hash/fnv1a128.d.ts +16 -0
  113. package/dist/lib/hash/fnv1a128.js +21 -0
  114. package/dist/llms/rules/ag-grid.js +1 -1
  115. package/dist/llms/rules/installation.js +1 -1
  116. package/dist/llms/rules/requirements.js +1 -1
  117. package/package.json +1 -1
  118. package/dist/components/data-display/calendar/calendar-available-view.d.ts +0 -27
  119. package/dist/components/data-display/calendar/calendar-available-view.js +0 -85
  120. package/dist/components/data-display/calendar/calendar-fiscal-day-cell.d.ts +0 -9
  121. package/dist/components/data-display/calendar/calendar-fiscal-day-cell.js +0 -45
  122. package/dist/components/data-display/calendar/calendar-injected-week-row.d.ts +0 -5
  123. package/dist/components/data-display/calendar/calendar-injected-week-row.js +0 -92
  124. package/dist/components/data-display/calendar/calendar-leading-week.utils.d.ts +0 -16
  125. package/dist/components/data-display/calendar/calendar-leading-week.utils.js +0 -51
  126. package/dist/components/data-display/calendar/calendar-orphan-week.d.ts +0 -23
  127. package/dist/components/forms/date-picker/fiscal-picker-fixtures.d.ts +0 -17
@@ -1,3 +1,8 @@
1
1
  import { GridApi } from 'ag-grid-community';
2
2
  import { NestedListItem } from '../nested-list/nested-list.types';
3
+ export interface ColumnIndicatorMaps {
4
+ sortAppliedByColumnId: Map<string, boolean>;
5
+ filterAppliedByColumnId: Map<string, boolean>;
6
+ }
7
+ export declare function buildColumnIndicatorMapsFromGrid(gridApi: GridApi): ColumnIndicatorMaps;
3
8
  export declare function patchColumnTreeIndicatorsFromGrid(rootItems: NestedListItem[], gridApi: GridApi): NestedListItem[];
@@ -1,24 +1,41 @@
1
- function h(n, c) {
2
- const e = c.getGridOption("context"), a = typeof e?.activeSearchColumnId == "string" ? e.activeSearchColumnId : null, o = new Map(
3
- c.getColumnState().map((r) => [r.colId, r])
4
- ), i = (r) => r.map((t) => {
1
+ function p(l) {
2
+ const o = l.getGridOption("context"), r = typeof o?.activeSearchColumnId == "string" ? o.activeSearchColumnId : null, s = /* @__PURE__ */ new Map();
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) {
7
+ const c = n.getColId();
8
+ a.set(
9
+ c,
10
+ n.isFilterActive() === !0 || r === c
11
+ );
12
+ }
13
+ return { sortAppliedByColumnId: s, filterAppliedByColumnId: a };
14
+ }
15
+ function I(l, o) {
16
+ const r = o.getGridOption("context"), s = typeof r?.activeSearchColumnId == "string" ? r.activeSearchColumnId : null, a = new Map(
17
+ o.getColumnState().map((e) => [e.colId, e])
18
+ ), u = o.getAllGridColumns?.() ?? o.getColumns?.() ?? [], n = new Map(
19
+ u.map((e) => [e.getColId(), e])
20
+ ), c = (e) => e.map((t) => {
5
21
  if ((t.category === "group" || t.children && t.children.length > 0) && t.children)
6
22
  return {
7
23
  ...t,
8
- children: i(t.children)
24
+ children: c(t.children)
9
25
  };
10
- const l = c.getColumn(t.id), s = o.get(t.id), u = t.data;
26
+ const i = n.get(t.id), m = a.get(t.id), d = t.data;
11
27
  return {
12
28
  ...t,
13
29
  data: {
14
- ...u,
15
- hasSortApplied: !!s?.sort,
16
- hasFilterApplied: l?.isFilterActive() === !0 || a === t.id
30
+ ...d,
31
+ hasSortApplied: !!m?.sort,
32
+ hasFilterApplied: i?.isFilterActive() === !0 || s === t.id
17
33
  }
18
34
  };
19
35
  });
20
- return i(n);
36
+ return c(l);
21
37
  }
22
38
  export {
23
- h as patchColumnTreeIndicatorsFromGrid
39
+ p as buildColumnIndicatorMapsFromGrid,
40
+ I as patchColumnTreeIndicatorsFromGrid
24
41
  };
@@ -0,0 +1,12 @@
1
+ import { GridApi } from 'ag-grid-community';
2
+ import { NestedListItem } from '../nested-list/nested-list.types';
3
+ import { ColumnListSyncFingerprints } from './data-table-column-list-sync';
4
+ import { BuildColumnTreeLabels } from './build-column-tree-from-grid';
5
+ export declare function rebuildColumnTreeFromGrid(gridApi: GridApi, labels: BuildColumnTreeLabels): NestedListItem[] | null;
6
+ export declare function commitRebuiltColumnTreeFromGrid(options: {
7
+ gridApi: GridApi;
8
+ labels: BuildColumnTreeLabels;
9
+ }): {
10
+ tree: NestedListItem[];
11
+ fingerprints: ColumnListSyncFingerprints;
12
+ } | null;
@@ -0,0 +1,12 @@
1
+ import { buildColumnTreeFromGrid as m } from "./build-column-tree-from-grid.js";
2
+ import { writeColumnTreeCache as t } from "./data-table-column-tree-cache.js";
3
+ function l(r) {
4
+ const e = m(r.gridApi, r.labels);
5
+ if (!e)
6
+ return null;
7
+ const i = t(r.gridApi, e);
8
+ return { tree: e, fingerprints: i };
9
+ }
10
+ export {
11
+ l as commitRebuiltColumnTreeFromGrid
12
+ };
@@ -1,5 +1,7 @@
1
1
  import { GridApi } from 'ag-grid-community';
2
2
  import { NestedListItem } from '../nested-list/nested-list.types';
3
+ import { ColumnPickerMode } from './data-table-column-tree-cache';
4
+ import { ColumnPickerAuthority } from './column-picker-authority';
3
5
  export interface UseDataTableColumnListSyncOptions {
4
6
  gridApi: GridApi | null;
5
7
  frozenColumnsLabel: string;
@@ -8,9 +10,17 @@ export interface UseDataTableColumnListSyncOptions {
8
10
  }
9
11
  export declare function useDataTableColumnListSync({ gridApi, frozenColumnsLabel, scrollableColumnsLabel, isSyncActive, }: UseDataTableColumnListSyncOptions): {
10
12
  items: NestedListItem[];
13
+ columnPickerAuthority: ColumnPickerAuthority | null;
14
+ pickerMode: ColumnPickerMode;
11
15
  isReady: boolean;
12
16
  listWrapperRef: import('react').RefObject<HTMLDivElement | null>;
13
17
  handleChange: (currentItems: NestedListItem[], enableApplyDiscard: boolean) => void;
14
18
  handleSubmit: (finalItems: NestedListItem[]) => void;
15
19
  handlePinChange: (itemId: string, newPinned: "left" | "right" | null) => void;
20
+ handleAuthorityItemToggle: (toggleChanges: Array<{
21
+ itemId: string;
22
+ checked: boolean;
23
+ }>) => void;
24
+ handleAuthorityVirtualDrop: (activeId: string, overId: string, insertAfter: boolean) => void;
25
+ handleAuthoritySelectAll: (shouldSelectAll: boolean) => void;
16
26
  };
@@ -1,129 +1,128 @@
1
- import { useState as W, useRef as p, useEffect as j, useCallback as f, useLayoutEffect as $ } from "react";
2
- import { mergePartialOrderedColumnState as q } from "./data-table-column-state.js";
3
- import { afterSynchronousColumnApply as k, normalizeColumnPinned as z, GRID_AUTO_UNPIN_WAIT_MS as A, alignColumnTreePinMetadata as V, EXTERNAL_SYNC_DEBOUNCE_MS as ee, readGridColumnPinned as ne } from "./data-table-column-apply.js";
4
- import { buildColumnStateFromTree as te } from "./build-column-state-from-tree.js";
5
- import { isColumnRuntimeStateGuardUpdating as g } from "./column-runtime-state-guard.js";
6
- import { computeColumnListSyncFingerprints as re } from "./data-table-column-list-sync.js";
7
- import { writeColumnTreeCache as B, resolveColumnTreeFromCacheOrGrid as oe, peekColumnListSyncWouldSkip as ue, readColumnTreeCache as se, isGridColumnSetDifferentFromCachedLeaves as ce } from "./data-table-column-tree-cache.js";
8
- import { patchColumnTreeIndicatorsFromGrid as le } from "./patch-column-tree-indicators-from-grid.js";
9
- import { subscribeGridApiEvent as X } from "../ag-grid-react/grid-api-event-subscription.js";
10
- import { subscribeColumnIndicatorSync as ae } from "../ag-grid-react/column-indicator-sync-bus.js";
11
- function Y(e, C, h) {
1
+ import { useState as M, useRef as h, useEffect as v, useCallback as c, useLayoutEffect as A } from "react";
2
+ import { mergePartialOrderedColumnState as B } from "./data-table-column-state.js";
3
+ import { afterSynchronousColumnApply as U, alignColumnTreePinMetadata as w, readGridColumnPinned as W, EXTERNAL_SYNC_DEBOUNCE_MS as tt } from "./data-table-column-apply.js";
4
+ import { isColumnRuntimeStateGuardUpdating as D } from "./column-runtime-state-guard.js";
5
+ import { resolveColumnTreeFromCacheOrGrid as et, peekColumnListSyncWouldSkip as rt, writeColumnTreeAuthorityCache as nt } from "./data-table-column-tree-cache.js";
6
+ import { buildColumnStateFromAuthority as ot, toggleColumnsVisibility as ut, toggleColumnVisibility as lt, updateColumnPin as ct, toggleAllColumnsVisibility as st } from "./column-picker-authority.js";
7
+ import { NESTED_LIST_ROOT_FROZEN_ID as q, NESTED_LIST_ROOT_SCROLLABLE_ID as at } from "../nested-list/nested-list-constants.js";
8
+ import { buildAuthorityFlatShellItems as V, buildFlatColumnVirtualRowModel as it, applyFlatVirtualDropToAuthority as mt } from "./data-table-flat-column-virtual-rows.js";
9
+ import { subscribeGridApiEvent as ft } from "../ag-grid-react/grid-api-event-subscription.js";
10
+ import { subscribeColumnIndicatorSync as dt } from "../ag-grid-react/column-indicator-sync-bus.js";
11
+ import { commitRebuiltColumnTreeFromGrid as ht } from "./reconcile-column-tree-from-grid.js";
12
+ import { applyTreeColumnChanges as yt } from "./data-table-column-list-tree-apply.js";
13
+ function z(e, p, b) {
12
14
  return {
13
15
  layout: e.current,
14
- visibility: C.current,
15
- indicators: h.current
16
+ visibility: p.current,
17
+ indicators: b.current
16
18
  };
17
19
  }
18
- function w(e, C, h, c) {
19
- C.current = e.layout, h.current = e.visibility, c.current = e.indicators;
20
+ function Ct(e, p, b, a) {
21
+ p.current = e.layout, b.current = e.visibility, a.current = e.indicators;
20
22
  }
21
- function Re({
23
+ function Gt({
22
24
  gridApi: e,
23
- frozenColumnsLabel: C,
24
- scrollableColumnsLabel: h,
25
- isSyncActive: c = !0
25
+ frozenColumnsLabel: p,
26
+ scrollableColumnsLabel: b,
27
+ isSyncActive: a = !0
26
28
  }) {
27
- const [R, F] = W([]), [H, M] = W(!1), l = p(!1), J = p(null), x = p(R), S = p(""), I = p(""), b = p(""), N = p(c);
28
- j(() => {
29
- x.current = R;
30
- }, [R]);
31
- const E = f(
29
+ const [T, y] = M([]), [I, E] = M(null), [O, X] = M("tree"), [Y, F] = M(!1), o = h(!1), Z = h(null), x = h(T), S = h(I), G = h(""), _ = h(""), L = h(""), P = h(a);
30
+ v(() => {
31
+ x.current = T;
32
+ }, [T]), v(() => {
33
+ S.current = I;
34
+ }, [I]);
35
+ const l = c(
32
36
  () => ({
33
- frozenColumns: C,
34
- scrollableColumns: h
37
+ frozenColumns: p,
38
+ scrollableColumns: b
35
39
  }),
36
- [C, h]
37
- ), y = f(
38
- (n) => {
39
- w(
40
- re(n),
41
- S,
42
- I,
43
- b
44
- );
45
- },
46
- []
47
- ), T = f(
48
- (n) => {
40
+ [p, b]
41
+ ), f = c((t) => {
42
+ Ct(
43
+ t,
44
+ G,
45
+ _,
46
+ L
47
+ );
48
+ }, []), d = c(
49
+ (t, r) => {
49
50
  if (!e) {
50
- l.current = !1;
51
+ r?.();
51
52
  return;
52
53
  }
53
- l.current = !1, B(e, n), y(n);
54
+ const n = ot(t), u = B(
55
+ e.getColumnState(),
56
+ n
57
+ );
58
+ e.applyColumnState({ state: u, applyOrder: !0 }), U(() => {
59
+ const m = nt(e, t);
60
+ f(m), E(t), y(V(t, l())), r?.();
61
+ });
54
62
  },
55
- [e, y]
56
- ), a = f(() => {
57
- if (!e || l.current || g(e))
63
+ [e, l, f]
64
+ ), k = c(() => {
65
+ if (!e) {
66
+ o.current = !1;
67
+ return;
68
+ }
69
+ o.current = !1;
70
+ const t = ht({
71
+ gridApi: e,
72
+ labels: l()
73
+ });
74
+ t && (y(t.tree), f(t.fingerprints));
75
+ }, [e, l, f]), i = c(() => {
76
+ if (!e || o.current || D(e))
58
77
  return;
59
- const n = oe({
78
+ const t = et({
60
79
  gridApi: e,
61
- labels: E(),
62
- previousFingerprints: Y(
63
- S,
64
- I,
65
- b
80
+ labels: l(),
81
+ previousFingerprints: z(
82
+ G,
83
+ _,
84
+ L
66
85
  )
67
86
  });
68
- if (n.syncMode === "skip" || !n.rootItems) {
69
- n.syncMode !== "skip" && M(!0);
87
+ if (X(t.pickerMode), t.syncMode === "skip") {
88
+ f(t.fingerprints), t.pickerMode === "authority-flat" && t.authority && (E(t.authority), y(V(t.authority, l()))), F(!0);
70
89
  return;
71
90
  }
72
- w(
73
- n.fingerprints,
74
- S,
75
- I,
76
- b
77
- ), F(n.rootItems), M(!0);
78
- }, [e, E]);
79
- $(() => {
80
- const n = c && !N.current;
81
- if (N.current = c, !e || !c) return;
82
- const t = E(), r = Y(
83
- S,
84
- I,
85
- b
91
+ if (t.pickerMode === "authority-flat" && t.authority) {
92
+ f(t.fingerprints), E(t.authority), y(
93
+ t.rootItems ?? V(t.authority, l())
94
+ ), F(!0);
95
+ return;
96
+ }
97
+ if (E(null), !t.rootItems) {
98
+ F(!0);
99
+ return;
100
+ }
101
+ f(t.fingerprints), y(t.rootItems), F(!0);
102
+ }, [e, l, f]);
103
+ A(() => {
104
+ const t = a && !P.current;
105
+ if (P.current = a, !e || !a) return;
106
+ const r = l(), n = z(
107
+ G,
108
+ _,
109
+ L
86
110
  );
87
- if (!(!n && r.layout !== "" && ue({
111
+ !t && n.layout !== "" && rt({
88
112
  gridApi: e,
89
- labels: t,
90
- previousFingerprints: r
91
- }))) {
92
- if (n) {
93
- queueMicrotask(() => {
94
- const o = se(e, t);
95
- if (o && !ce(
96
- e,
97
- o.leafColumnIds
98
- )) {
99
- const i = le(
100
- o.items,
101
- e
102
- );
103
- w(
104
- B(e, i),
105
- S,
106
- I,
107
- b
108
- ), F(i), M(!0);
109
- return;
110
- }
111
- a();
112
- });
113
- return;
114
- }
115
- queueMicrotask(() => {
116
- a();
117
- });
118
- }
113
+ labels: r,
114
+ previousFingerprints: n
115
+ }) || queueMicrotask(() => {
116
+ i();
117
+ });
119
118
  }, [
120
119
  e,
121
- c,
122
- E,
123
- a
124
- ]), j(() => {
125
- if (!e || !c) return;
126
- const n = [
120
+ a,
121
+ l,
122
+ i
123
+ ]), v(() => {
124
+ if (!e || !a) return;
125
+ const t = [
127
126
  "columnVisible",
128
127
  "columnPinned",
129
128
  "columnMoved",
@@ -139,120 +138,175 @@ function Re({
139
138
  "filterChanged",
140
139
  "newColumnsLoaded"
141
140
  ];
142
- let t = null;
143
- const r = () => {
144
- l.current || g(e) || (t && clearTimeout(t), t = setTimeout(() => {
145
- t = null, !(l.current || g(e) || e.isDestroyed()) && a();
146
- }, ee));
147
- }, o = n.map(
148
- (m) => X(e, m, () => {
149
- r();
141
+ let r = null;
142
+ const n = () => {
143
+ o.current || D(e) || (r && clearTimeout(r), r = setTimeout(() => {
144
+ r = null, !(o.current || D(e) || e.isDestroyed()) && i();
145
+ }, tt));
146
+ }, u = t.map(
147
+ (s) => ft(e, s, () => {
148
+ n();
150
149
  })
151
- ), i = ae(() => {
152
- r();
150
+ ), m = dt(() => {
151
+ n();
153
152
  });
154
153
  return () => {
155
- t && clearTimeout(t), o.forEach((m) => m()), i();
154
+ r && clearTimeout(r), u.forEach((s) => s()), m();
156
155
  };
157
- }, [e, c, a]);
158
- const v = f(
159
- (n) => {
160
- if (!e) return;
161
- l.current = !0;
162
- const t = te(n);
163
- if (t.length === 0) {
164
- k(() => {
165
- T(n);
166
- });
156
+ }, [e, a, i]);
157
+ const j = c(
158
+ (t) => {
159
+ const r = S.current;
160
+ if (!e || !r || t.length === 0)
167
161
  return;
162
+ o.current = !0;
163
+ let n = r;
164
+ for (const u of t) {
165
+ if (u.itemId === q || u.itemId === at) {
166
+ const m = n.orderedColumnIds.filter((s) => {
167
+ const R = !!n.pinByColumnId.get(s);
168
+ return u.itemId === q ? R : !R;
169
+ });
170
+ n = ut(
171
+ n,
172
+ m,
173
+ u.checked
174
+ );
175
+ continue;
176
+ }
177
+ n = lt(
178
+ n,
179
+ u.itemId,
180
+ u.checked
181
+ );
168
182
  }
169
- const r = e.getColumnState(), o = q(r, t), i = new Set(
170
- r.filter((s) => z(s.pinned)).map((s) => s.colId)
171
- ), m = o.filter(
172
- (s) => z(s.pinned) && !i.has(s.colId)
173
- ), P = new Set(m.map((s) => s.colId));
174
- e.applyColumnState({ state: o, applyOrder: !0 });
175
- const u = () => {
176
- T(n);
177
- };
178
- if (P.size === 0) {
179
- k(u);
183
+ d(n, () => {
184
+ o.current = !1;
185
+ });
186
+ },
187
+ [e, d]
188
+ ), H = c(
189
+ (t, r, n) => {
190
+ const u = S.current;
191
+ if (!e || !u)
180
192
  return;
181
- }
182
- let O = !1, U = null, L = null;
183
- L = X(e, "columnPinned", () => {
184
- if (O || e.isDestroyed()) return;
185
- const s = e.getColumnState();
186
- if (m.filter((G) => {
187
- const d = s.find((_) => _.colId === G.colId);
188
- return d && !d.pinned;
189
- }).length > 0) {
190
- O = !0, U && clearTimeout(U), L?.();
191
- const G = o.filter(
192
- (d) => d.pinned && !P.has(d.colId)
193
- );
194
- if (G.length > 0) {
195
- const d = G[0], _ = o.map(
196
- (D) => D.colId === d.colId ? { ...D, pinned: null } : D
197
- );
198
- e.applyColumnState({ state: _, applyOrder: !0 });
199
- }
200
- k(() => {
201
- l.current = !1, a();
202
- });
193
+ const m = it(
194
+ u,
195
+ l()
196
+ ), s = mt(
197
+ u,
198
+ m,
199
+ {
200
+ draggedColumnId: t,
201
+ overId: r,
202
+ insertAfter: n
203
+ }
204
+ );
205
+ s && (o.current = !0, d(s, () => {
206
+ o.current = !1;
207
+ }));
208
+ },
209
+ [e, l, d]
210
+ ), g = c(
211
+ (t) => {
212
+ e && yt({
213
+ gridApi: e,
214
+ newItems: t,
215
+ releaseLockAndRebuildTreeFromGrid: k,
216
+ applyExternalGridSync: i,
217
+ setIsUpdating: (r) => {
218
+ o.current = r;
203
219
  }
204
- }), U = setTimeout(() => {
205
- L?.(), O || u();
206
- }, A);
220
+ });
207
221
  },
208
- [e, T, a]
209
- ), K = f(
210
- (n) => {
211
- v(V(n));
222
+ [e, k, i]
223
+ ), J = c(
224
+ (t) => {
225
+ g(w(t));
212
226
  },
213
- [v]
214
- ), Q = f(
215
- (n, t) => {
216
- const r = V(n);
217
- t || v(r), F(r), y(r);
227
+ [g]
228
+ ), K = c(
229
+ (t, r) => {
230
+ const n = w(t);
231
+ if (!r) {
232
+ g(n);
233
+ return;
234
+ }
235
+ y(n);
218
236
  },
219
- [v, y]
220
- ), Z = f(
221
- (n, t) => {
222
- const r = (P) => P.map((u) => u.id === n ? {
223
- ...u,
237
+ [g]
238
+ ), Q = c(
239
+ (t, r) => {
240
+ const n = S.current;
241
+ if (O === "authority-flat" && n && e) {
242
+ o.current = !0;
243
+ const R = ct(n, t, r);
244
+ d(R, () => {
245
+ if (W(e, t) !== r) {
246
+ o.current = !1, i();
247
+ return;
248
+ }
249
+ o.current = !1;
250
+ });
251
+ return;
252
+ }
253
+ const u = (R) => R.map((C) => C.id === t ? {
254
+ ...C,
224
255
  data: {
225
- ...u.data,
226
- pinned: t
256
+ ...C.data,
257
+ pinned: r
227
258
  }
228
- } : u.children ? {
229
- ...u,
230
- children: r(u.children)
231
- } : u), o = r(x.current);
232
- if (F(o), y(o), !e) return;
233
- l.current = !0;
234
- const i = e.getColumnState(), m = q(i, [
235
- { colId: n, pinned: t }
259
+ } : C.children ? {
260
+ ...C,
261
+ children: u(C.children)
262
+ } : C), m = u(x.current);
263
+ if (y(m), !e) return;
264
+ o.current = !0;
265
+ const s = e.getColumnState(), N = B(s, [
266
+ { colId: t, pinned: r }
236
267
  ]);
237
- e.applyColumnState({ state: m, applyOrder: !0 }), k(() => {
238
- if (ne(e, n) !== t) {
239
- l.current = !1, a();
268
+ e.applyColumnState({ state: N, applyOrder: !0 }), U(() => {
269
+ if (W(e, t) !== r) {
270
+ o.current = !1, i();
240
271
  return;
241
272
  }
242
- T(o);
273
+ k();
274
+ });
275
+ },
276
+ [
277
+ e,
278
+ O,
279
+ d,
280
+ k,
281
+ i
282
+ ]
283
+ ), $ = c(
284
+ (t) => {
285
+ const r = S.current;
286
+ if (!e || !r)
287
+ return;
288
+ o.current = !0;
289
+ const n = st(r, t);
290
+ d(n, () => {
291
+ o.current = !1;
243
292
  });
244
293
  },
245
- [e, y, T, a]
294
+ [e, d]
246
295
  );
247
296
  return {
248
- items: R,
249
- isReady: H,
250
- listWrapperRef: J,
251
- handleChange: Q,
252
- handleSubmit: K,
253
- handlePinChange: Z
297
+ items: T,
298
+ columnPickerAuthority: I,
299
+ pickerMode: O,
300
+ isReady: Y,
301
+ listWrapperRef: Z,
302
+ handleChange: K,
303
+ handleSubmit: J,
304
+ handlePinChange: Q,
305
+ handleAuthorityItemToggle: j,
306
+ handleAuthorityVirtualDrop: H,
307
+ handleAuthoritySelectAll: $
254
308
  };
255
309
  }
256
310
  export {
257
- Re as useDataTableColumnListSync
311
+ Gt as useDataTableColumnListSync
258
312
  };
@@ -1,21 +1,29 @@
1
1
  import { default as React } from 'react';
2
2
  import { useSensors, DragStartEvent, DragOverEvent, DragEndEvent } from '@dnd-kit/core';
3
- import { NestedListItem } from '../nested-list.types';
3
+ import { NestedListItem, NestedListDragMode, FlatVirtualRowModel } from '../nested-list.types';
4
4
  interface NestedListContentProps {
5
5
  isListCollapsed: boolean;
6
6
  enableDragDrop: boolean;
7
+ dragMode?: NestedListDragMode;
7
8
  sensors: ReturnType<typeof useSensors>;
8
9
  items: {
9
10
  item: NestedListItem;
10
11
  level: number;
11
12
  indentLevel: number;
12
13
  }[];
13
- renderItem: (item: NestedListItem, level: number, indentLevel: number) => React.ReactNode;
14
+ flatVirtualRowModel?: FlatVirtualRowModel | null;
15
+ renderItem: (item: NestedListItem, level: number, indentLevel: number, context?: {
16
+ isAnyDragging?: boolean;
17
+ }) => React.ReactNode;
14
18
  onDragStart: (event: DragStartEvent) => void;
15
19
  onDragOver: (event: DragOverEvent) => void;
16
20
  onDragEnd: (event: DragEndEvent) => void;
17
21
  onDragCancel: () => void;
18
22
  activeId: string | null;
23
+ onToggleCollapse: (itemId: string) => void;
24
+ toggleCollapseHandlerRef: React.MutableRefObject<(itemId: string) => void>;
25
+ collapsedItems?: Record<string, boolean>;
26
+ onVirtualDrop?: (activeId: string, overId: string, insertAfter: boolean) => void;
19
27
  }
20
28
  export declare const NestedListContent: React.FC<NestedListContentProps>;
21
29
  export {};