impact-nova 2.5.16 → 2.5.17
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 +0 -1
- package/dist/components/data/data-table/build-column-tree-from-grid.js +50 -55
- package/dist/components/data/data-table/data-table-column-apply.d.ts +0 -2
- package/dist/components/data/data-table/data-table-column-apply.js +73 -84
- package/dist/components/data/data-table/data-table-column-list.js +64 -94
- package/dist/components/data/data-table/data-table-column-tree-cache.d.ts +6 -12
- package/dist/components/data/data-table/data-table-column-tree-cache.js +131 -250
- package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.d.ts +0 -5
- package/dist/components/data/data-table/patch-column-tree-indicators-from-grid.js +11 -28
- package/dist/components/data/data-table/use-data-table-column-list-sync.d.ts +0 -10
- package/dist/components/data/data-table/use-data-table-column-list-sync.js +196 -250
- package/dist/components/data/nested-list/components/NestedListContent.d.ts +2 -10
- package/dist/components/data/nested-list/components/NestedListContent.js +138 -253
- package/dist/components/data/nested-list/components/SortableItem.d.ts +1 -2
- package/dist/components/data/nested-list/components/SortableItem.js +60 -62
- package/dist/components/data/nested-list/hooks/useNestedListDragDrop.d.ts +20 -10
- package/dist/components/data/nested-list/hooks/useNestedListDragDrop.js +233 -44
- package/dist/components/data/nested-list/nested-list-constants.d.ts +1 -4
- package/dist/components/data/nested-list/nested-list-constants.js +4 -10
- package/dist/components/data/nested-list/nested-list.js +336 -322
- package/dist/components/data/nested-list/nested-list.types.d.ts +0 -17
- package/dist/form-react/fields.d.ts +3 -0
- package/dist/form-react/fields.js +35 -29
- package/dist/impact-nova.css +1 -1
- package/dist/llms/rules/ag-grid.js +1 -1
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/package.json +1 -1
- package/dist/components/data/data-table/column-picker-authority.d.ts +0 -34
- package/dist/components/data/data-table/column-picker-authority.js +0 -116
- package/dist/components/data/data-table/column-picker-drop-validation.d.ts +0 -7
- package/dist/components/data/data-table/column-picker-drop-validation.js +0 -37
- package/dist/components/data/data-table/data-table-column-list-tree-apply.d.ts +0 -10
- package/dist/components/data/data-table/data-table-column-list-tree-apply.js +0 -79
- package/dist/components/data/data-table/data-table-flat-column-virtual-rows.d.ts +0 -26
- package/dist/components/data/data-table/data-table-flat-column-virtual-rows.js +0 -195
- package/dist/components/data/data-table/data-table-picker-column-eligibility.d.ts +0 -1
- package/dist/components/data/data-table/data-table-picker-column-eligibility.js +0 -7
- package/dist/components/data/data-table/reconcile-column-tree-from-grid.d.ts +0 -12
- package/dist/components/data/data-table/reconcile-column-tree-from-grid.js +0 -12
- package/dist/components/data/nested-list/hooks/useVirtualNestedListDrag.d.ts +0 -24
- package/dist/components/data/nested-list/hooks/useVirtualNestedListDrag.js +0 -128
- package/dist/components/data/nested-list/nested-list-display-utils.d.ts +0 -11
- package/dist/components/data/nested-list/nested-list-display-utils.js +0 -74
- package/dist/components/data/nested-list/nested-list-drop-engine.d.ts +0 -31
- package/dist/components/data/nested-list/nested-list-drop-engine.js +0 -209
- package/dist/components/data/nested-list/nested-list-flat-virtual-handlers.d.ts +0 -26
- package/dist/components/data/nested-list/nested-list-flat-virtual-handlers.js +0 -67
- package/dist/components/data/nested-list/nested-list-item-tree-mutations.d.ts +0 -4
- package/dist/components/data/nested-list/nested-list-item-tree-mutations.js +0 -43
- package/dist/components/data/nested-list/nested-list-lazy-flat-rows.d.ts +0 -3
- package/dist/components/data/nested-list/nested-list-lazy-flat-rows.js +0 -34
- package/dist/components/data/nested-list/nested-list-row-estimates.d.ts +0 -9
- package/dist/components/data/nested-list/nested-list-row-estimates.js +0 -14
- package/dist/components/data/nested-list/nested-list-scroll-anchor.d.ts +0 -36
- package/dist/components/data/nested-list/nested-list-scroll-anchor.js +0 -47
- package/dist/components/data/nested-list/nested-list-virtual-drop.d.ts +0 -59
- package/dist/components/data/nested-list/nested-list-virtual-drop.js +0 -341
- package/dist/lib/hash/fnv1a128.d.ts +0 -16
- 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
|
|
2
|
-
|
|
3
|
-
|
|
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
|
|
8
|
-
|
|
6
|
+
const a = c.getColGroupDef();
|
|
7
|
+
a?.headerName && a?.children && u.push(c), c = c.getOriginalParent();
|
|
9
8
|
}
|
|
10
|
-
return
|
|
9
|
+
return u.reverse(), u;
|
|
11
10
|
}
|
|
12
|
-
function
|
|
13
|
-
const c = l.getColumnState(),
|
|
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
|
-
),
|
|
16
|
-
|
|
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 =
|
|
20
|
-
return o === void 0 && (o = `n${M++}`,
|
|
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
|
|
23
|
-
if (
|
|
24
|
-
return
|
|
25
|
-
const s =
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
id: s === 0 ? `${
|
|
29
|
-
label:
|
|
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),
|
|
33
|
+
return o.push(d), D.set(r, { list: o, node: d }), d;
|
|
35
34
|
};
|
|
36
|
-
let
|
|
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
|
|
41
|
-
if (i != null && i.trim() === "" ||
|
|
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 =
|
|
44
|
-
let
|
|
45
|
-
if ((!
|
|
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,
|
|
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:
|
|
48
|
+
label: t,
|
|
50
49
|
checked: s,
|
|
51
50
|
data: {
|
|
52
|
-
hasSortApplied:
|
|
53
|
-
hasFilterApplied:
|
|
51
|
+
hasSortApplied: I,
|
|
52
|
+
hasFilterApplied: y,
|
|
54
53
|
pinned: d
|
|
55
54
|
}
|
|
56
55
|
};
|
|
57
|
-
d ? (
|
|
58
|
-
const
|
|
59
|
-
if (
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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
|
-
|
|
64
|
+
N.push(b);
|
|
70
65
|
});
|
|
71
|
-
const
|
|
66
|
+
const C = (e) => {
|
|
72
67
|
let o = e.length > 0;
|
|
73
|
-
for (const
|
|
74
|
-
|
|
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
|
|
72
|
+
return C(f), C(h), [
|
|
78
73
|
{
|
|
79
74
|
id: "root-frozen",
|
|
80
|
-
label:
|
|
81
|
-
checked:
|
|
82
|
-
children:
|
|
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:
|
|
89
|
-
checked:
|
|
90
|
-
children:
|
|
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
|
-
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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
|
|
8
|
-
return "pinned" in
|
|
5
|
+
function a(i, r) {
|
|
6
|
+
return "pinned" in i && i.pinned !== void 0 ? u(i.pinned) : u(r.getPinned());
|
|
9
7
|
}
|
|
10
|
-
function
|
|
11
|
-
const
|
|
12
|
-
if (!
|
|
13
|
-
const
|
|
14
|
-
return
|
|
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
|
|
17
|
-
return
|
|
18
|
-
if ((
|
|
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
|
-
...
|
|
21
|
-
children:
|
|
18
|
+
...e,
|
|
19
|
+
children: d(e.children, r)
|
|
22
20
|
};
|
|
23
|
-
const n =
|
|
24
|
-
let
|
|
25
|
-
if (
|
|
26
|
-
const
|
|
27
|
-
|
|
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
|
-
...
|
|
28
|
+
...e,
|
|
31
29
|
data: {
|
|
32
30
|
...n,
|
|
33
|
-
pinned:
|
|
31
|
+
pinned: t
|
|
34
32
|
}
|
|
35
33
|
};
|
|
36
34
|
});
|
|
37
35
|
}
|
|
38
|
-
function
|
|
39
|
-
return
|
|
40
|
-
...
|
|
41
|
-
children:
|
|
42
|
-
} :
|
|
43
|
-
...
|
|
44
|
-
children:
|
|
45
|
-
} :
|
|
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
|
|
48
|
-
const
|
|
49
|
-
for (const
|
|
50
|
-
if (
|
|
51
|
-
|
|
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 (
|
|
55
|
-
|
|
52
|
+
if (t.id === "root-scrollable") {
|
|
53
|
+
t.children && e(t.children, null);
|
|
56
54
|
continue;
|
|
57
55
|
}
|
|
58
|
-
if ((
|
|
59
|
-
|
|
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
|
|
60
|
+
let f = "0";
|
|
63
61
|
if (n !== null) {
|
|
64
|
-
const c =
|
|
65
|
-
|
|
62
|
+
const c = t.data?.pinned;
|
|
63
|
+
f = c === "left" || c === "right" ? c : "left";
|
|
66
64
|
}
|
|
67
|
-
|
|
65
|
+
r.push(`${t.id}:${f}`);
|
|
68
66
|
}
|
|
69
67
|
};
|
|
70
|
-
return
|
|
68
|
+
return e(i, null), r.join("|");
|
|
71
69
|
}
|
|
72
|
-
function
|
|
73
|
-
const
|
|
74
|
-
for (const n of
|
|
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 &&
|
|
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
|
-
|
|
78
|
+
e(n.children);
|
|
81
79
|
continue;
|
|
82
80
|
}
|
|
83
|
-
|
|
81
|
+
r.push(`${n.id}:${n.checked ? "1" : "0"}`);
|
|
84
82
|
}
|
|
85
83
|
};
|
|
86
|
-
return
|
|
84
|
+
return e(i), r.join("|");
|
|
87
85
|
}
|
|
88
|
-
function
|
|
89
|
-
const
|
|
90
|
-
for (const n of
|
|
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 &&
|
|
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
|
-
|
|
94
|
+
e(n.children);
|
|
97
95
|
continue;
|
|
98
96
|
}
|
|
99
|
-
const
|
|
100
|
-
|
|
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
|
|
103
|
+
return e(i), r.join("|");
|
|
104
104
|
}
|
|
105
|
-
function
|
|
106
|
-
|
|
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
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
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
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { useDataTable as
|
|
4
|
-
import { useDataTableSheet as
|
|
5
|
-
import { NestedList as
|
|
6
|
-
import { SelectionMode as
|
|
7
|
-
import { useImpactNovaI18n as
|
|
8
|
-
import { countNestedListLeaves as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
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:
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
-
|
|
33
|
+
c(e, o);
|
|
55
34
|
},
|
|
56
|
-
[
|
|
57
|
-
),
|
|
58
|
-
(e) =>
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
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
|
-
),
|
|
71
|
-
(e,
|
|
72
|
-
const
|
|
73
|
-
return e.category === "structure" ? e.id !==
|
|
74
|
-
|
|
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:
|
|
77
|
-
onChange: (
|
|
52
|
+
value: t?.pinned ?? null,
|
|
53
|
+
onChange: (v) => u(e.id, v),
|
|
78
54
|
className: "shrink-0"
|
|
79
55
|
}
|
|
80
56
|
);
|
|
81
57
|
},
|
|
82
|
-
[
|
|
58
|
+
[u]
|
|
83
59
|
);
|
|
84
|
-
return
|
|
85
|
-
|
|
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:
|
|
88
|
-
onChange:
|
|
89
|
-
onSubmit:
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
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:
|
|
104
|
-
selectionMode:
|
|
105
|
-
searchPlaceholder:
|
|
73
|
+
enableGlobalCollapse: f,
|
|
74
|
+
selectionMode: P.CASCADE_DOWN,
|
|
75
|
+
searchPlaceholder: r("dataTable.searchColumnsPlaceholder"),
|
|
106
76
|
className: "flex-1 min-h-0",
|
|
107
|
-
initialCollapsedItems:
|
|
77
|
+
initialCollapsedItems: T,
|
|
108
78
|
onCollapseChange: (e) => {
|
|
109
|
-
|
|
79
|
+
b.current = e, L(e);
|
|
110
80
|
}
|
|
111
81
|
}
|
|
112
|
-
) }) : /* @__PURE__ */ n("div", { className: "p-4 text-[13px] text-content-placeholder", children:
|
|
82
|
+
) }) : /* @__PURE__ */ n("div", { className: "p-4 text-[13px] text-content-placeholder", children: r("dataTable.loadingColumns") });
|
|
113
83
|
};
|
|
114
84
|
export {
|
|
115
|
-
|
|
85
|
+
te as DataTableColumnList
|
|
116
86
|
};
|
|
@@ -1,26 +1,22 @@
|
|
|
1
|
-
import {
|
|
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
|
|
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
|
};
|