impact-nova 2.5.11 → 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.
- package/dist/components/data/data-table/build-column-tree-from-grid.d.ts +1 -0
- package/dist/components/data/data-table/build-column-tree-from-grid.js +55 -50
- package/dist/components/data/data-table/column-picker-authority.d.ts +34 -0
- package/dist/components/data/data-table/column-picker-authority.js +116 -0
- package/dist/components/data/data-table/column-picker-drop-validation.d.ts +7 -0
- package/dist/components/data/data-table/column-picker-drop-validation.js +37 -0
- package/dist/components/data/data-table/data-table-column-apply.d.ts +2 -0
- package/dist/components/data/data-table/data-table-column-apply.js +84 -73
- package/dist/components/data/data-table/data-table-column-list-tree-apply.d.ts +10 -0
- package/dist/components/data/data-table/data-table-column-list-tree-apply.js +79 -0
- package/dist/components/data/data-table/data-table-column-list.js +94 -64
- package/dist/components/data/data-table/data-table-column-tree-cache.d.ts +12 -6
- package/dist/components/data/data-table/data-table-column-tree-cache.js +250 -131
- package/dist/components/data/data-table/data-table-flat-column-virtual-rows.d.ts +26 -0
- package/dist/components/data/data-table/data-table-flat-column-virtual-rows.js +195 -0
- package/dist/components/data/data-table/data-table-picker-column-eligibility.d.ts +1 -0
- package/dist/components/data/data-table/data-table-picker-column-eligibility.js +7 -0
- package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.d.ts +5 -0
- package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.js +28 -11
- package/dist/components/data/data-table/reconcile-column-tree-from-grid.d.ts +12 -0
- package/dist/components/data/data-table/reconcile-column-tree-from-grid.js +12 -0
- package/dist/components/data/data-table/use-data-table-column-list-sync.d.ts +10 -0
- package/dist/components/data/data-table/use-data-table-column-list-sync.js +250 -196
- package/dist/components/data/expandable-list-item/expandable-list-item-attributes.js +2 -3
- package/dist/components/data/expandable-list-item/expandable-list-item-metrics.js +2 -3
- package/dist/components/data/nested-list/components/NestedListContent.d.ts +10 -2
- package/dist/components/data/nested-list/components/NestedListContent.js +253 -138
- package/dist/components/data/nested-list/components/SortableItem.d.ts +2 -1
- package/dist/components/data/nested-list/components/SortableItem.js +62 -60
- package/dist/components/data/nested-list/hooks/useNestedListDragDrop.d.ts +10 -20
- package/dist/components/data/nested-list/hooks/useNestedListDragDrop.js +44 -233
- package/dist/components/data/nested-list/hooks/useVirtualNestedListDrag.d.ts +24 -0
- package/dist/components/data/nested-list/hooks/useVirtualNestedListDrag.js +128 -0
- package/dist/components/data/nested-list/nested-list-constants.d.ts +4 -1
- package/dist/components/data/nested-list/nested-list-constants.js +10 -4
- package/dist/components/data/nested-list/nested-list-display-utils.d.ts +11 -0
- package/dist/components/data/nested-list/nested-list-display-utils.js +74 -0
- package/dist/components/data/nested-list/nested-list-drop-engine.d.ts +31 -0
- package/dist/components/data/nested-list/nested-list-drop-engine.js +209 -0
- package/dist/components/data/nested-list/nested-list-flat-virtual-handlers.d.ts +26 -0
- package/dist/components/data/nested-list/nested-list-flat-virtual-handlers.js +67 -0
- package/dist/components/data/nested-list/nested-list-item-tree-mutations.d.ts +4 -0
- package/dist/components/data/nested-list/nested-list-item-tree-mutations.js +43 -0
- package/dist/components/data/nested-list/nested-list-lazy-flat-rows.d.ts +3 -0
- package/dist/components/data/nested-list/nested-list-lazy-flat-rows.js +34 -0
- package/dist/components/data/nested-list/nested-list-row-estimates.d.ts +9 -0
- package/dist/components/data/nested-list/nested-list-row-estimates.js +14 -0
- package/dist/components/data/nested-list/nested-list-scroll-anchor.d.ts +36 -0
- package/dist/components/data/nested-list/nested-list-scroll-anchor.js +47 -0
- package/dist/components/data/nested-list/nested-list-virtual-drop.d.ts +59 -0
- package/dist/components/data/nested-list/nested-list-virtual-drop.js +341 -0
- package/dist/components/data/nested-list/nested-list.js +322 -336
- package/dist/components/data/nested-list/nested-list.types.d.ts +17 -0
- package/dist/components/data-display/calendar/calendar-apply-validation.d.ts +0 -2
- package/dist/components/data-display/calendar/calendar-apply-validation.js +67 -64
- package/dist/components/data-display/calendar/calendar-day-picker-components.d.ts +2 -4
- package/dist/components/data-display/calendar/calendar-day-picker-components.js +152 -163
- package/dist/components/data-display/calendar/calendar-day-picker-view.js +76 -77
- package/dist/components/data-display/calendar/calendar-fiscal-period-nav.d.ts +0 -6
- package/dist/components/data-display/calendar/calendar-fiscal-period-nav.js +18 -34
- package/dist/components/data-display/calendar/calendar-month-utils.d.ts +0 -5
- package/dist/components/data-display/calendar/calendar-month-utils.js +64 -85
- package/dist/components/data-display/calendar/calendar-selection-appearance.d.ts +0 -1
- package/dist/components/data-display/calendar/calendar-selection-appearance.js +30 -31
- package/dist/components/data-display/calendar/calendar-week-number-cell.d.ts +1 -2
- package/dist/components/data-display/calendar/calendar-week-number-cell.js +41 -55
- package/dist/components/data-display/calendar/calendar-year-panes.d.ts +0 -2
- package/dist/components/data-display/calendar/calendar-year-panes.js +1 -3
- package/dist/components/data-display/calendar/calendar.js +143 -146
- package/dist/components/data-display/calendar/calendar.types.d.ts +0 -5
- package/dist/components/data-display/calendar/use-calendar-day-picker-config.d.ts +1 -2
- package/dist/components/data-display/calendar/use-calendar-day-picker-config.js +74 -79
- package/dist/components/data-display/calendar/use-calendar-state.d.ts +1 -3
- package/dist/components/data-display/calendar/use-calendar-state.js +325 -403
- package/dist/components/feedback/tooltip/tab-tooltip-render.js +2 -3
- package/dist/components/flows/command-palette/shortcut-settings.js +10 -10
- package/dist/components/flows/filter-panel/filter-panel.js +4 -4
- package/dist/components/forms/date-picker/date-picker.js +58 -60
- package/dist/components/forms/date-picker/date-picker.types.d.ts +0 -5
- package/dist/components/forms/date-picker/date-range-picker.js +64 -66
- package/dist/components/forms/date-picker/fiscal-pass-through.d.ts +0 -1
- package/dist/components/forms/date-picker/fiscal-pass-through.js +2 -3
- package/dist/components/forms/date-picker/month-picker.js +59 -61
- package/dist/components/forms/date-picker/month-range-picker.js +61 -63
- package/dist/components/forms/date-picker/multi-date-picker.js +49 -51
- package/dist/components/forms/date-picker/multi-month-picker.js +47 -49
- package/dist/components/forms/date-picker/multi-quarter-picker.js +44 -46
- package/dist/components/forms/date-picker/multi-week-picker.js +51 -53
- package/dist/components/forms/date-picker/multi-year-picker.js +46 -48
- package/dist/components/forms/date-picker/quarter-picker.js +44 -46
- package/dist/components/forms/date-picker/quarter-range-picker.js +43 -45
- package/dist/components/forms/date-picker/week-picker.js +66 -68
- package/dist/components/forms/date-picker/week-range-picker.js +80 -82
- package/dist/components/forms/date-picker/year-picker.js +45 -47
- package/dist/components/forms/date-picker/year-range-picker.js +45 -47
- package/dist/components/forms/select/components/SelectTriggerValue.js +2 -3
- package/dist/components/forms/select/components/Submenu.js +2 -3
- package/dist/form-react/Fields/DateInputField.js +50 -51
- package/dist/form-react/Fields/DateRangeField.js +13 -14
- package/dist/form-react/Fields/MonthRangeField.js +28 -29
- package/dist/form-react/Fields/MultiMonthPickerField.js +12 -13
- package/dist/form-react/Fields/MultiWeekPickerField.js +17 -18
- package/dist/form-react/Fields/WeekRangePicker.js +21 -22
- package/dist/form-react/types/fields.types.d.ts +0 -12
- package/dist/impact-nova.css +1 -1
- package/dist/lib/hash/fnv1a128.d.ts +16 -0
- package/dist/lib/hash/fnv1a128.js +21 -0
- package/dist/llms/rules/ag-grid.js +1 -1
- package/package.json +1 -1
- package/dist/components/data-display/calendar/calendar-available-view.d.ts +0 -27
- package/dist/components/data-display/calendar/calendar-available-view.js +0 -85
|
@@ -4,6 +4,7 @@ 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[];
|
|
7
8
|
}
|
|
8
9
|
export interface BuildColumnTreeLabels {
|
|
9
10
|
frozenColumns: string;
|
|
@@ -1,93 +1,98 @@
|
|
|
1
|
-
import { resolveColumnPinnedFromGridState as
|
|
2
|
-
|
|
3
|
-
|
|
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 = [];
|
|
4
5
|
let c = l.getOriginalParent();
|
|
5
6
|
for (; c; ) {
|
|
6
|
-
const
|
|
7
|
-
|
|
7
|
+
const u = c.getColGroupDef();
|
|
8
|
+
u?.headerName && u?.children && a.push(c), c = c.getOriginalParent();
|
|
8
9
|
}
|
|
9
|
-
return
|
|
10
|
+
return a.reverse(), a;
|
|
10
11
|
}
|
|
11
|
-
function
|
|
12
|
-
const c = l.getColumnState(),
|
|
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(
|
|
13
14
|
_.map((e) => [e.getColId(), e])
|
|
14
|
-
),
|
|
15
|
-
|
|
15
|
+
), h = [], m = [], v = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map();
|
|
16
|
+
p.set(h, "f"), p.set(m, "s");
|
|
16
17
|
let M = 0;
|
|
17
18
|
const x = (e) => {
|
|
18
|
-
let o =
|
|
19
|
-
return o === void 0 && (o = `n${M++}`,
|
|
19
|
+
let o = p.get(e);
|
|
20
|
+
return o === void 0 && (o = `n${M++}`, p.set(e, o)), o;
|
|
20
21
|
}, O = (e, o) => {
|
|
21
|
-
const
|
|
22
|
-
if (
|
|
23
|
-
return
|
|
24
|
-
const s =
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
id: s === 0 ? `${
|
|
28
|
-
label:
|
|
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,
|
|
29
30
|
checked: !0,
|
|
30
31
|
children: [],
|
|
31
32
|
category: "group"
|
|
32
33
|
};
|
|
33
|
-
return o.push(d),
|
|
34
|
+
return o.push(d), v.set(r, { list: o, node: d }), d;
|
|
34
35
|
};
|
|
35
|
-
let
|
|
36
|
+
let C = 0, N = 0, I = 0, S = 0;
|
|
36
37
|
c.forEach((e) => {
|
|
37
38
|
const o = F.get(e.colId) ?? l.getColumn(e.colId);
|
|
38
39
|
if (!o) return;
|
|
39
|
-
const
|
|
40
|
-
if (i != null && i.trim() === "" || e.colId
|
|
40
|
+
const t = o.getColDef(), i = t.headerName;
|
|
41
|
+
if (i != null && i.trim() === "" || !E(e.colId))
|
|
41
42
|
return;
|
|
42
|
-
const r =
|
|
43
|
-
let
|
|
44
|
-
if ((!
|
|
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() === "")
|
|
45
46
|
return;
|
|
46
|
-
const s = !e.hide,
|
|
47
|
+
const s = !e.hide, k = !!e.sort, $ = o.isFilterActive() || z === e.colId, d = B(e, o), f = {
|
|
47
48
|
id: e.colId,
|
|
48
|
-
label:
|
|
49
|
+
label: n,
|
|
49
50
|
checked: s,
|
|
50
51
|
data: {
|
|
51
|
-
hasSortApplied:
|
|
52
|
-
hasFilterApplied:
|
|
52
|
+
hasSortApplied: k,
|
|
53
|
+
hasFilterApplied: $,
|
|
53
54
|
pinned: d
|
|
54
55
|
}
|
|
55
56
|
};
|
|
56
|
-
d ? (
|
|
57
|
-
const
|
|
58
|
-
if (
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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);
|
|
63
68
|
} else
|
|
64
|
-
|
|
69
|
+
w.push(f);
|
|
65
70
|
});
|
|
66
|
-
const
|
|
71
|
+
const b = (e) => {
|
|
67
72
|
let o = e.length > 0;
|
|
68
|
-
for (const
|
|
69
|
-
|
|
73
|
+
for (const t of e)
|
|
74
|
+
t.children && (t.checked = b(t.children)), t.checked || (o = !1);
|
|
70
75
|
return o;
|
|
71
76
|
};
|
|
72
|
-
return
|
|
77
|
+
return b(h), b(m), [
|
|
73
78
|
{
|
|
74
79
|
id: "root-frozen",
|
|
75
|
-
label:
|
|
76
|
-
checked:
|
|
77
|
-
children:
|
|
80
|
+
label: a.frozenColumns,
|
|
81
|
+
checked: C > 0 && N === C,
|
|
82
|
+
children: h,
|
|
78
83
|
category: "structure",
|
|
79
84
|
isDragDisabled: !0
|
|
80
85
|
},
|
|
81
86
|
{
|
|
82
87
|
id: "root-scrollable",
|
|
83
|
-
label:
|
|
84
|
-
checked:
|
|
85
|
-
children:
|
|
88
|
+
label: a.scrollableColumns,
|
|
89
|
+
checked: I > 0 && S === I,
|
|
90
|
+
children: m,
|
|
86
91
|
category: "structure",
|
|
87
92
|
isDragDisabled: !0
|
|
88
93
|
}
|
|
89
94
|
];
|
|
90
95
|
}
|
|
91
96
|
export {
|
|
92
|
-
|
|
97
|
+
L as buildColumnTreeFromGrid
|
|
93
98
|
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ColumnState, GridApi } from 'ag-grid-community';
|
|
2
|
+
import { NormalizedColumnPin } from './data-table-column-apply';
|
|
3
|
+
export interface GroupNodeMeta {
|
|
4
|
+
groupId: string;
|
|
5
|
+
label: string;
|
|
6
|
+
parentGroupId: string | null;
|
|
7
|
+
}
|
|
8
|
+
export interface ColumnLeafMeta {
|
|
9
|
+
columnId: string;
|
|
10
|
+
label: string;
|
|
11
|
+
groupChain: string[];
|
|
12
|
+
}
|
|
13
|
+
export interface ColumnPickerAuthority {
|
|
14
|
+
readonly orderedColumnIds: readonly string[];
|
|
15
|
+
readonly visibilityByColumnId: ReadonlyMap<string, boolean>;
|
|
16
|
+
readonly pinByColumnId: ReadonlyMap<string, NormalizedColumnPin>;
|
|
17
|
+
readonly labelByColumnId: ReadonlyMap<string, string>;
|
|
18
|
+
readonly groupMetadata: ReadonlyMap<string, GroupNodeMeta>;
|
|
19
|
+
readonly columnGroupChain: ReadonlyMap<string, string[]>;
|
|
20
|
+
readonly sortAppliedByColumnId: ReadonlyMap<string, boolean>;
|
|
21
|
+
readonly filterAppliedByColumnId: ReadonlyMap<string, boolean>;
|
|
22
|
+
readonly revision: number;
|
|
23
|
+
}
|
|
24
|
+
export declare function buildAuthorityFromGrid(gridApi: GridApi): ColumnPickerAuthority | null;
|
|
25
|
+
export declare function toggleColumnVisibility(authority: ColumnPickerAuthority, columnId: string, isVisible: boolean): ColumnPickerAuthority;
|
|
26
|
+
export declare function toggleAllColumnsVisibility(authority: ColumnPickerAuthority, isVisible: boolean): ColumnPickerAuthority;
|
|
27
|
+
export declare function toggleColumnsVisibility(authority: ColumnPickerAuthority, columnIds: readonly string[], isVisible: boolean): ColumnPickerAuthority;
|
|
28
|
+
export declare function reorderColumn(authority: ColumnPickerAuthority, fromIndex: number, toIndex: number): ColumnPickerAuthority;
|
|
29
|
+
export declare function updateColumnPin(authority: ColumnPickerAuthority, columnId: string, pin: NormalizedColumnPin): ColumnPickerAuthority;
|
|
30
|
+
export declare function buildColumnStateFromAuthority(authority: ColumnPickerAuthority): ColumnState[];
|
|
31
|
+
export declare function fingerprintAuthority(authority: ColumnPickerAuthority): {
|
|
32
|
+
layout: string;
|
|
33
|
+
visibility: string;
|
|
34
|
+
};
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { resolveColumnPinnedFromGridState as D } from "./data-table-column-apply.js";
|
|
2
|
+
import { isPickerEligibleColumnId as P } from "./data-table-picker-column-eligibility.js";
|
|
3
|
+
import { buildColumnIndicatorMapsFromGrid as F } from "./patch-column-tree-indicators-from-grid.js";
|
|
4
|
+
import { Fnv1a128Hasher as G } from "../../../lib/hash/fnv1a128.js";
|
|
5
|
+
let u = 0;
|
|
6
|
+
function O(n) {
|
|
7
|
+
const o = n.getColumnState(), i = n.getAllGridColumns?.() ?? n.getColumns?.() ?? [], e = new Map(
|
|
8
|
+
i.map((t) => [t.getColId(), t])
|
|
9
|
+
), l = [], g = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Map(), b = /* @__PURE__ */ new Map(), c = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Map();
|
|
10
|
+
for (const t of o) {
|
|
11
|
+
const d = e.get(t.colId) ?? n.getColumn(t.colId);
|
|
12
|
+
if (!d) continue;
|
|
13
|
+
const a = d.getColDef(), p = a.headerName;
|
|
14
|
+
if (p != null && p.trim() === "" || !P(t.colId))
|
|
15
|
+
continue;
|
|
16
|
+
const C = a.headerName;
|
|
17
|
+
let r = typeof C == "string" && C.trim() !== "" ? C : n.getDisplayNameForColumn(d, "header");
|
|
18
|
+
if ((!r || r.trim() === "") && (r = a.field ?? t.colId), !r || r.trim() === "")
|
|
19
|
+
continue;
|
|
20
|
+
const N = D(t, d);
|
|
21
|
+
l.push(t.colId), g.set(t.colId, !t.hide), y.set(t.colId, N), b.set(t.colId, r);
|
|
22
|
+
const w = [];
|
|
23
|
+
let s = d.getOriginalParent();
|
|
24
|
+
for (; s; ) {
|
|
25
|
+
const f = s.getColGroupDef();
|
|
26
|
+
if (f?.headerName && f?.children) {
|
|
27
|
+
const m = s.getGroupId();
|
|
28
|
+
if (w.unshift(m), !c.has(m)) {
|
|
29
|
+
const I = s.getOriginalParent();
|
|
30
|
+
let h = null;
|
|
31
|
+
for (; I; ) {
|
|
32
|
+
const M = I.getColGroupDef();
|
|
33
|
+
if (M?.headerName && M?.children) {
|
|
34
|
+
h = I.getGroupId();
|
|
35
|
+
break;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
c.set(m, {
|
|
39
|
+
groupId: m,
|
|
40
|
+
label: f.headerName,
|
|
41
|
+
parentGroupId: h
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
s = s.getOriginalParent();
|
|
46
|
+
}
|
|
47
|
+
v.set(t.colId, w);
|
|
48
|
+
}
|
|
49
|
+
if (l.length === 0)
|
|
50
|
+
return null;
|
|
51
|
+
const B = F(n);
|
|
52
|
+
return {
|
|
53
|
+
orderedColumnIds: l,
|
|
54
|
+
visibilityByColumnId: g,
|
|
55
|
+
pinByColumnId: y,
|
|
56
|
+
labelByColumnId: b,
|
|
57
|
+
groupMetadata: c,
|
|
58
|
+
columnGroupChain: v,
|
|
59
|
+
sortAppliedByColumnId: B.sortAppliedByColumnId,
|
|
60
|
+
filterAppliedByColumnId: B.filterAppliedByColumnId,
|
|
61
|
+
revision: ++u
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
function S(n, o, i) {
|
|
65
|
+
const e = new Map(n.visibilityByColumnId);
|
|
66
|
+
return e.set(o, i), { ...n, visibilityByColumnId: e, revision: ++u };
|
|
67
|
+
}
|
|
68
|
+
function k(n, o) {
|
|
69
|
+
const i = /* @__PURE__ */ new Map();
|
|
70
|
+
for (const e of n.orderedColumnIds)
|
|
71
|
+
i.set(e, o);
|
|
72
|
+
return { ...n, visibilityByColumnId: i, revision: ++u };
|
|
73
|
+
}
|
|
74
|
+
function E(n, o, i) {
|
|
75
|
+
const e = new Map(n.visibilityByColumnId);
|
|
76
|
+
for (const l of o)
|
|
77
|
+
e.set(l, i);
|
|
78
|
+
return { ...n, visibilityByColumnId: e, revision: ++u };
|
|
79
|
+
}
|
|
80
|
+
function j(n, o, i) {
|
|
81
|
+
if (o === i) return n;
|
|
82
|
+
const e = [...n.orderedColumnIds], [l] = e.splice(o, 1);
|
|
83
|
+
return e.splice(i, 0, l), { ...n, orderedColumnIds: e, revision: ++u };
|
|
84
|
+
}
|
|
85
|
+
function q(n, o, i) {
|
|
86
|
+
const e = new Map(n.pinByColumnId);
|
|
87
|
+
return e.set(o, i), { ...n, pinByColumnId: e, revision: ++u };
|
|
88
|
+
}
|
|
89
|
+
function z(n) {
|
|
90
|
+
return n.orderedColumnIds.map((o) => ({
|
|
91
|
+
colId: o,
|
|
92
|
+
hide: !n.visibilityByColumnId.get(o),
|
|
93
|
+
pinned: n.pinByColumnId.get(o) ?? null
|
|
94
|
+
}));
|
|
95
|
+
}
|
|
96
|
+
function J(n) {
|
|
97
|
+
const o = new G(), i = new G();
|
|
98
|
+
for (const e of n.orderedColumnIds) {
|
|
99
|
+
const l = n.pinByColumnId.get(e) ?? "0";
|
|
100
|
+
o.update(e).update(":").update(l === null ? "0" : l).update("|"), i.update(e).update(":").update(n.visibilityByColumnId.get(e) ? "1" : "0").update("|");
|
|
101
|
+
}
|
|
102
|
+
return {
|
|
103
|
+
layout: o.digest(),
|
|
104
|
+
visibility: i.digest()
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
export {
|
|
108
|
+
O as buildAuthorityFromGrid,
|
|
109
|
+
z as buildColumnStateFromAuthority,
|
|
110
|
+
J as fingerprintAuthority,
|
|
111
|
+
j as reorderColumn,
|
|
112
|
+
k as toggleAllColumnsVisibility,
|
|
113
|
+
S as toggleColumnVisibility,
|
|
114
|
+
E as toggleColumnsVisibility,
|
|
115
|
+
q as updateColumnPin
|
|
116
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { findNestedListItemById as c, findNestedListParentId as i } from "../nested-list/nested-list-drop-engine.js";
|
|
2
|
+
import { NESTED_LIST_SECTION_IDS as l } from "../nested-list/nested-list-constants.js";
|
|
3
|
+
function f(t) {
|
|
4
|
+
const e = t.indexOf("__");
|
|
5
|
+
return e === -1 ? t : t.slice(0, e);
|
|
6
|
+
}
|
|
7
|
+
function m(t) {
|
|
8
|
+
return t?.data?.columnGroupChain ?? [];
|
|
9
|
+
}
|
|
10
|
+
function h(t, e) {
|
|
11
|
+
const n = [];
|
|
12
|
+
let r = i(t, e);
|
|
13
|
+
for (; r && !l.has(r); ) {
|
|
14
|
+
const o = c(t, r);
|
|
15
|
+
(o?.category === "group" || o?.children) && n.unshift(f(r)), r = i(t, r);
|
|
16
|
+
}
|
|
17
|
+
return n;
|
|
18
|
+
}
|
|
19
|
+
function v(t, e) {
|
|
20
|
+
return t.length !== e.length ? !1 : t.every((n, r) => n === e[r]);
|
|
21
|
+
}
|
|
22
|
+
function C(t) {
|
|
23
|
+
const { items: e, activeItemId: n, overItemId: r, insertAfter: o } = t, I = c(e, n), u = m(I);
|
|
24
|
+
if (u.length === 0)
|
|
25
|
+
return !0;
|
|
26
|
+
const d = i(e, n), p = i(e, r);
|
|
27
|
+
if (d === p)
|
|
28
|
+
return !0;
|
|
29
|
+
const a = c(e, r);
|
|
30
|
+
if (a?.category !== "group" || o === !1)
|
|
31
|
+
return !0;
|
|
32
|
+
const s = h(e, r);
|
|
33
|
+
return s.push(f(a.id)), v(u, s);
|
|
34
|
+
}
|
|
35
|
+
export {
|
|
36
|
+
C as isValidColumnPickerGroupDrop
|
|
37
|
+
};
|
|
@@ -26,6 +26,8 @@ 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;
|
|
29
31
|
/**
|
|
30
32
|
* Run after `applyColumnState` returns. AG Grid applies pin/order/hide synchronously;
|
|
31
33
|
* `queueMicrotask` lets any same-turn grid events finish before we release the panel lock.
|
|
@@ -1,119 +1,130 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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;
|
|
4
6
|
}
|
|
5
|
-
function
|
|
6
|
-
return "pinned" in
|
|
7
|
+
function s(t, e) {
|
|
8
|
+
return "pinned" in t && t.pinned !== void 0 ? a(t.pinned) : a(e.getPinned());
|
|
7
9
|
}
|
|
8
|
-
function
|
|
9
|
-
const
|
|
10
|
-
if (!
|
|
11
|
-
const
|
|
12
|
-
return
|
|
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());
|
|
13
15
|
}
|
|
14
|
-
function
|
|
15
|
-
return
|
|
16
|
-
if ((
|
|
16
|
+
function f(t, e) {
|
|
17
|
+
return t.map((r) => {
|
|
18
|
+
if ((r.category === "group" || r.children && r.children.length > 0) && r.children)
|
|
17
19
|
return {
|
|
18
|
-
...
|
|
19
|
-
children:
|
|
20
|
+
...r,
|
|
21
|
+
children: f(r.children, e)
|
|
20
22
|
};
|
|
21
|
-
const n =
|
|
22
|
-
let
|
|
23
|
-
if (
|
|
24
|
-
const
|
|
25
|
-
|
|
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;
|
|
26
28
|
}
|
|
27
29
|
return {
|
|
28
|
-
...
|
|
30
|
+
...r,
|
|
29
31
|
data: {
|
|
30
32
|
...n,
|
|
31
|
-
pinned:
|
|
33
|
+
pinned: i
|
|
32
34
|
}
|
|
33
35
|
};
|
|
34
36
|
});
|
|
35
37
|
}
|
|
36
|
-
function
|
|
37
|
-
return
|
|
38
|
-
...
|
|
39
|
-
children:
|
|
40
|
-
} :
|
|
41
|
-
...
|
|
42
|
-
children:
|
|
43
|
-
} :
|
|
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);
|
|
44
46
|
}
|
|
45
|
-
function
|
|
46
|
-
const
|
|
47
|
-
for (const
|
|
48
|
-
if (
|
|
49
|
-
|
|
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");
|
|
50
52
|
continue;
|
|
51
53
|
}
|
|
52
|
-
if (
|
|
53
|
-
|
|
54
|
+
if (i.id === "root-scrollable") {
|
|
55
|
+
i.children && r(i.children, null);
|
|
54
56
|
continue;
|
|
55
57
|
}
|
|
56
|
-
if ((
|
|
57
|
-
|
|
58
|
+
if ((i.category === "group" || i.children && i.children.length > 0) && i.children) {
|
|
59
|
+
r(i.children, n);
|
|
58
60
|
continue;
|
|
59
61
|
}
|
|
60
|
-
let
|
|
62
|
+
let d = "0";
|
|
61
63
|
if (n !== null) {
|
|
62
|
-
const c =
|
|
63
|
-
|
|
64
|
+
const c = i.data?.pinned;
|
|
65
|
+
d = c === "left" || c === "right" ? c : "left";
|
|
64
66
|
}
|
|
65
|
-
|
|
67
|
+
e.update(i.id).update(":").update(d).update("|");
|
|
66
68
|
}
|
|
67
69
|
};
|
|
68
|
-
return
|
|
70
|
+
return r(t, null), e.digest();
|
|
69
71
|
}
|
|
70
|
-
function
|
|
71
|
-
const
|
|
72
|
-
for (const n of
|
|
72
|
+
function v(t) {
|
|
73
|
+
const e = new u(), r = (l) => {
|
|
74
|
+
for (const n of l) {
|
|
73
75
|
if (n.id === "root-frozen" || n.id === "root-scrollable") {
|
|
74
|
-
n.children &&
|
|
76
|
+
n.children && r(n.children);
|
|
75
77
|
continue;
|
|
76
78
|
}
|
|
77
79
|
if ((n.category === "group" || n.children && n.children.length > 0) && n.children) {
|
|
78
|
-
|
|
80
|
+
r(n.children);
|
|
79
81
|
continue;
|
|
80
82
|
}
|
|
81
|
-
|
|
83
|
+
e.update(n.id).update(":").update(n.checked ? "1" : "0").update("|");
|
|
82
84
|
}
|
|
83
85
|
};
|
|
84
|
-
return
|
|
86
|
+
return r(t), e.digest();
|
|
85
87
|
}
|
|
86
|
-
function
|
|
87
|
-
const
|
|
88
|
-
for (const n of
|
|
88
|
+
function M(t) {
|
|
89
|
+
const e = new u(), r = (l) => {
|
|
90
|
+
for (const n of l) {
|
|
89
91
|
if (n.id === "root-frozen" || n.id === "root-scrollable") {
|
|
90
|
-
n.children &&
|
|
92
|
+
n.children && r(n.children);
|
|
91
93
|
continue;
|
|
92
94
|
}
|
|
93
95
|
if ((n.category === "group" || n.children && n.children.length > 0) && n.children) {
|
|
94
|
-
|
|
96
|
+
r(n.children);
|
|
95
97
|
continue;
|
|
96
98
|
}
|
|
97
|
-
const
|
|
98
|
-
|
|
99
|
-
`${n.id}:${l?.hasSortApplied ? "1" : "0"}:${l?.hasFilterApplied ? "1" : "0"}`
|
|
100
|
-
);
|
|
99
|
+
const o = n.data;
|
|
100
|
+
e.update(n.id).update(":").update(o?.hasSortApplied ? "1" : "0").update(":").update(o?.hasFilterApplied ? "1" : "0").update("|");
|
|
101
101
|
}
|
|
102
102
|
};
|
|
103
|
-
return
|
|
103
|
+
return r(t), e.digest();
|
|
104
104
|
}
|
|
105
|
-
function
|
|
106
|
-
|
|
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);
|
|
107
117
|
}
|
|
108
118
|
export {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
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
|
|
119
130
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { GridApi } from 'ag-grid-community';
|
|
2
|
+
import { NestedListItem } from '../nested-list/nested-list.types';
|
|
3
|
+
export interface TreeColumnChangeContext {
|
|
4
|
+
gridApi: GridApi;
|
|
5
|
+
newItems: NestedListItem[];
|
|
6
|
+
releaseLockAndRebuildTreeFromGrid: () => void;
|
|
7
|
+
applyExternalGridSync: () => void;
|
|
8
|
+
setIsUpdating: (isUpdating: boolean) => void;
|
|
9
|
+
}
|
|
10
|
+
export declare function applyTreeColumnChanges(context: TreeColumnChangeContext): void;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { mergePartialOrderedColumnState as T } from "./data-table-column-state.js";
|
|
2
|
+
import { afterSynchronousColumnApply as I, normalizeColumnPinned as C, GRID_AUTO_UNPIN_WAIT_MS as b } from "./data-table-column-apply.js";
|
|
3
|
+
import { buildColumnStateFromTree as P } from "./build-column-state-from-tree.js";
|
|
4
|
+
import { subscribeGridApiEvent as h } from "../ag-grid-react/grid-api-event-subscription.js";
|
|
5
|
+
function k(a) {
|
|
6
|
+
const {
|
|
7
|
+
gridApi: t,
|
|
8
|
+
newItems: r,
|
|
9
|
+
releaseLockAndRebuildTreeFromGrid: o,
|
|
10
|
+
applyExternalGridSync: s,
|
|
11
|
+
setIsUpdating: i
|
|
12
|
+
} = a;
|
|
13
|
+
i(!0);
|
|
14
|
+
const l = P(r);
|
|
15
|
+
if (l.length === 0) {
|
|
16
|
+
I(() => {
|
|
17
|
+
o();
|
|
18
|
+
});
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
21
|
+
const c = t.getColumnState(), d = T(c, l);
|
|
22
|
+
U({
|
|
23
|
+
gridApi: t,
|
|
24
|
+
mergedState: d,
|
|
25
|
+
releaseLockAndRebuildTreeFromGrid: o,
|
|
26
|
+
applyExternalGridSync: s,
|
|
27
|
+
setIsUpdating: i
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
function U(a) {
|
|
31
|
+
const {
|
|
32
|
+
gridApi: t,
|
|
33
|
+
mergedState: r,
|
|
34
|
+
releaseLockAndRebuildTreeFromGrid: o,
|
|
35
|
+
applyExternalGridSync: s,
|
|
36
|
+
setIsUpdating: i
|
|
37
|
+
} = a, l = t.getColumnState(), c = new Set(
|
|
38
|
+
l.filter((e) => C(e.pinned)).map((e) => e.colId)
|
|
39
|
+
), d = r.filter(
|
|
40
|
+
(e) => C(e.pinned) && !c.has(e.colId)
|
|
41
|
+
), y = new Set(d.map((e) => e.colId));
|
|
42
|
+
t.applyColumnState({ state: r, applyOrder: !0 });
|
|
43
|
+
const A = () => {
|
|
44
|
+
o();
|
|
45
|
+
};
|
|
46
|
+
if (y.size === 0) {
|
|
47
|
+
I(A);
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
let u = !1, m = null, f = null;
|
|
51
|
+
f = h(t, "columnPinned", () => {
|
|
52
|
+
if (u || t.isDestroyed())
|
|
53
|
+
return;
|
|
54
|
+
const e = t.getColumnState();
|
|
55
|
+
if (d.filter((p) => {
|
|
56
|
+
const n = e.find((S) => S.colId === p.colId);
|
|
57
|
+
return n && !n.pinned;
|
|
58
|
+
}).length > 0) {
|
|
59
|
+
u = !0, m && clearTimeout(m), f?.();
|
|
60
|
+
const p = r.filter(
|
|
61
|
+
(n) => n.pinned && !y.has(n.colId)
|
|
62
|
+
);
|
|
63
|
+
if (p.length > 0) {
|
|
64
|
+
const n = p[0], S = r.map(
|
|
65
|
+
(g) => g.colId === n.colId ? { ...g, pinned: null } : g
|
|
66
|
+
);
|
|
67
|
+
t.applyColumnState({ state: S, applyOrder: !0 });
|
|
68
|
+
}
|
|
69
|
+
I(() => {
|
|
70
|
+
i(!1), s();
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
}), m = setTimeout(() => {
|
|
74
|
+
f?.(), u || A();
|
|
75
|
+
}, b);
|
|
76
|
+
}
|
|
77
|
+
export {
|
|
78
|
+
k as applyTreeColumnChanges
|
|
79
|
+
};
|