impact-nova 2.1.0-alpha.5 → 2.1.0-alpha.6
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/ag-grid-react/index.js +120 -119
- package/dist/components/data/ag-grid-react/notify-column-indicator-sync.d.ts +7 -0
- package/dist/components/data/ag-grid-react/notify-column-indicator-sync.js +6 -0
- package/dist/components/data/ag-grid-react/theme.js +5 -4
- package/dist/components/data/data-table/build-column-tree-from-grid.d.ts +14 -0
- package/dist/components/data/data-table/build-column-tree-from-grid.js +95 -0
- package/dist/components/data/data-table/data-table-column-apply.d.ts +14 -1
- package/dist/components/data/data-table/data-table-column-apply.js +97 -13
- package/dist/components/data/data-table/data-table-column-def-pin.d.ts +25 -0
- package/dist/components/data/data-table/data-table-column-def-pin.js +66 -0
- package/dist/components/data/data-table/data-table-column-list-sync.d.ts +8 -0
- package/dist/components/data/data-table/data-table-column-list-sync.js +15 -0
- package/dist/components/data/data-table/data-table-column-list.d.ts +1 -1
- package/dist/components/data/data-table/data-table-column-list.js +73 -283
- package/dist/components/data/data-table/data-table-sheet.js +3 -1
- package/dist/components/data/data-table/data-table.js +80 -71
- package/dist/components/data/data-table/use-data-table-column-list-sync.d.ts +16 -0
- package/dist/components/data/data-table/use-data-table-column-list-sync.js +222 -0
- package/dist/components/forms/select/hooks/useSelectValueState.d.ts +19 -0
- package/dist/components/forms/select/hooks/useSelectValueState.js +41 -0
- package/dist/components/forms/select/index.js +4 -3
- package/dist/components/forms/select/select.js +163 -158
- package/dist/components/forms/select/select.types.d.ts +3 -2
- package/dist/components/forms/select/utils/select.d.ts +2 -1
- package/dist/components/forms/select/utils/select.js +47 -37
- package/dist/impact-nova-components.css +26 -17
- package/dist/impact-nova.css +1 -1
- package/dist/index.js +297 -296
- package/dist/llms/rules/ag-grid.js +1 -1
- package/dist/llms/rules/installation.js +1 -1
- package/dist/llms/rules/migration.js +1 -1
- package/dist/llms/rules/real-world-patterns.js +1 -1
- package/dist/llms/rules/requirements.js +1 -1
- package/package.json +5 -5
|
@@ -1,36 +1,37 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { lazy as
|
|
3
|
-
import { ModuleRegistry as
|
|
4
|
-
import { AllEnterpriseModule as
|
|
5
|
-
import { AgGridReact as
|
|
6
|
-
import { customAgGridTheme as
|
|
7
|
-
import { CustomHeader as
|
|
8
|
-
import { CustomHeaderGroup as
|
|
9
|
-
import { DefaultTextCellRenderer as
|
|
10
|
-
import { GridHeaderContext as
|
|
11
|
-
import { convertToAgGridFilterModel as
|
|
12
|
-
import { ColumnSettingsMenu as
|
|
13
|
-
import { AG_GRID_VALUE_FORMATTERS as
|
|
14
|
-
import { useGridAutoSizeStrategyOnResize as
|
|
15
|
-
import { subscribeGridApiEvent as
|
|
1
|
+
import { jsxs as ye, jsx as v } from "react/jsx-runtime";
|
|
2
|
+
import { lazy as ve, useRef as S, useState as j, useCallback as f, useMemo as y, useEffect as be, Suspense as xe } from "react";
|
|
3
|
+
import { ModuleRegistry as Se, AllCommunityModule as Fe, ValidationModule as Me } from "ag-grid-community";
|
|
4
|
+
import { AllEnterpriseModule as Ee } from "ag-grid-enterprise";
|
|
5
|
+
import { AgGridReact as Ae } from "ag-grid-react";
|
|
6
|
+
import { customAgGridTheme as Re } from "./theme.js";
|
|
7
|
+
import { CustomHeader as Ge } from "./headers/custom-header.js";
|
|
8
|
+
import { CustomHeaderGroup as ke } from "./headers/custom-header-group.js";
|
|
9
|
+
import { DefaultTextCellRenderer as we } from "./cell-renderers/default-text-cell-renderer.js";
|
|
10
|
+
import { GridHeaderContext as je } from "./headers/context/grid-header-context.js";
|
|
11
|
+
import { convertToAgGridFilterModel as Ie, getMultiFilterIndices as Te, convertFromAgGridFilterModel as Oe } from "./headers/utils/filter-utils.js";
|
|
12
|
+
import { ColumnSettingsMenu as Pe } from "./headers/column-menu/column-settings-menu.js";
|
|
13
|
+
import { AG_GRID_VALUE_FORMATTERS as De } from "./value-formatters.js";
|
|
14
|
+
import { useGridAutoSizeStrategyOnResize as He } from "./useGridAutoSizeStrategyOnResize.js";
|
|
15
|
+
import { subscribeGridApiEvent as it, subscribeGridApiEvents as st } from "./grid-api-event-subscription.js";
|
|
16
|
+
import { notifyColumnIndicatorSync as $ } from "./notify-column-indicator-sync.js";
|
|
16
17
|
/* empty css */
|
|
17
|
-
const
|
|
18
|
+
const Le = ve(
|
|
18
19
|
() => import("./headers/advanced-filter/advanced-filter-dialog.js").then((l) => ({
|
|
19
20
|
default: l.AdvancedFilterDialog
|
|
20
21
|
}))
|
|
21
22
|
);
|
|
22
|
-
|
|
23
|
+
Se.registerModules([Fe, Ee, Me]);
|
|
23
24
|
const F = "", N = "";
|
|
24
|
-
function
|
|
25
|
+
function q(l) {
|
|
25
26
|
return l.getColumns()?.some((n) => n.getColDef().headerCheckboxSelection) ?? !1;
|
|
26
27
|
}
|
|
27
|
-
const
|
|
28
|
+
const z = (l) => {
|
|
28
29
|
if (!l) return;
|
|
29
30
|
const n = l.cellRendererParams?.splits;
|
|
30
31
|
if (Array.isArray(n) && n.length > 0) return n;
|
|
31
32
|
const i = l.cellEditorParams?.splits;
|
|
32
33
|
if (Array.isArray(i) && i.length > 0) return i;
|
|
33
|
-
},
|
|
34
|
+
}, B = (l, n) => {
|
|
34
35
|
const i = [];
|
|
35
36
|
for (const g of n) {
|
|
36
37
|
const m = g?.field?.split(".").pop();
|
|
@@ -38,30 +39,30 @@ const q = (l) => {
|
|
|
38
39
|
i.push("");
|
|
39
40
|
continue;
|
|
40
41
|
}
|
|
41
|
-
const
|
|
42
|
-
if (
|
|
42
|
+
const c = l[m];
|
|
43
|
+
if (c == null) {
|
|
43
44
|
i.push("");
|
|
44
45
|
continue;
|
|
45
46
|
}
|
|
46
|
-
if (typeof
|
|
47
|
-
const u =
|
|
47
|
+
if (typeof c == "object" && "value" in c) {
|
|
48
|
+
const u = c.value;
|
|
48
49
|
i.push(u == null ? "" : String(u));
|
|
49
50
|
continue;
|
|
50
51
|
}
|
|
51
|
-
if (typeof
|
|
52
|
-
i.push(String(
|
|
52
|
+
if (typeof c != "object") {
|
|
53
|
+
i.push(String(c));
|
|
53
54
|
continue;
|
|
54
55
|
}
|
|
55
56
|
i.push("");
|
|
56
57
|
}
|
|
57
58
|
return i;
|
|
58
|
-
},
|
|
59
|
+
}, J = (l) => {
|
|
59
60
|
if (typeof navigator < "u" && navigator.clipboard?.writeText) {
|
|
60
|
-
navigator.clipboard.writeText(l).catch(() =>
|
|
61
|
+
navigator.clipboard.writeText(l).catch(() => X(l));
|
|
61
62
|
return;
|
|
62
63
|
}
|
|
63
|
-
|
|
64
|
-
},
|
|
64
|
+
X(l);
|
|
65
|
+
}, X = (l) => {
|
|
65
66
|
if (typeof document > "u") return;
|
|
66
67
|
const n = document.createElement("textarea");
|
|
67
68
|
n.value = l, n.setAttribute("readonly", ""), n.style.position = "fixed", n.style.top = "0", n.style.left = "0", n.style.opacity = "0", n.style.pointerEvents = "none", document.body.appendChild(n);
|
|
@@ -71,28 +72,28 @@ const q = (l) => {
|
|
|
71
72
|
document.body.removeChild(n);
|
|
72
73
|
}
|
|
73
74
|
};
|
|
74
|
-
function
|
|
75
|
+
function nt({
|
|
75
76
|
children: l,
|
|
76
77
|
defaultColDef: n,
|
|
77
78
|
defaultColGroupDef: i,
|
|
78
79
|
columnDefs: g,
|
|
79
80
|
valueFormatters: m,
|
|
80
|
-
onGridReady:
|
|
81
|
+
onGridReady: c,
|
|
81
82
|
onGridPreDestroyed: u,
|
|
82
83
|
onFilterChanged: b,
|
|
83
84
|
onSelectionChanged: h,
|
|
84
85
|
onModelUpdated: M,
|
|
85
|
-
ensureDomOrder:
|
|
86
|
-
autoSizeStrategy:
|
|
86
|
+
ensureDomOrder: I = !1,
|
|
87
|
+
autoSizeStrategy: T,
|
|
87
88
|
tooltipShowMode: O = "whenTruncated",
|
|
88
89
|
tooltipShowDelay: P = 500,
|
|
89
|
-
tooltipHideDelay:
|
|
90
|
-
tooltipInteraction:
|
|
90
|
+
tooltipHideDelay: Q = 5e3,
|
|
91
|
+
tooltipInteraction: Y = !0,
|
|
91
92
|
...C
|
|
92
93
|
}) {
|
|
93
|
-
const
|
|
94
|
-
|
|
95
|
-
const [
|
|
94
|
+
const a = S(null), D = S(null), [H, _] = j(null);
|
|
95
|
+
He(H, D, T);
|
|
96
|
+
const [Z, V] = j(!1), [ee, W] = j(null), [te, K] = j(!1), E = S(null), L = S(null), A = S(null), re = f(() => [], []), ne = y(() => ({
|
|
96
97
|
numericColumn: {
|
|
97
98
|
cellClass: "ag-right-aligned-cell",
|
|
98
99
|
headerClass: "ag-right-aligned-header",
|
|
@@ -115,14 +116,14 @@ function tt({
|
|
|
115
116
|
}
|
|
116
117
|
}), []), R = y(() => ({
|
|
117
118
|
openSearch: (e) => {
|
|
118
|
-
if (!
|
|
119
|
-
const t =
|
|
120
|
-
|
|
119
|
+
if (!a.current) return;
|
|
120
|
+
const t = a.current.getGridOption("context") || {};
|
|
121
|
+
a.current.setGridOption("context", { ...t, activeSearchColumnId: e }), a.current.refreshHeader(), $(a.current);
|
|
121
122
|
},
|
|
122
123
|
closeSearch: () => {
|
|
123
|
-
if (!
|
|
124
|
-
const e =
|
|
125
|
-
|
|
124
|
+
if (!a.current) return;
|
|
125
|
+
const e = a.current.getGridOption("context") || {};
|
|
126
|
+
a.current.setGridOption("context", { ...e, activeSearchColumnId: null }), a.current.refreshHeader(), $(a.current);
|
|
126
127
|
},
|
|
127
128
|
openAdvancedFilter: (e) => {
|
|
128
129
|
W(e || null), V(!0);
|
|
@@ -131,9 +132,9 @@ function tt({
|
|
|
131
132
|
V(!1), W(null);
|
|
132
133
|
},
|
|
133
134
|
applyAdvancedFilter: (e) => {
|
|
134
|
-
if (!
|
|
135
|
-
const t =
|
|
136
|
-
|
|
135
|
+
if (!a.current) return;
|
|
136
|
+
const t = Ie(e);
|
|
137
|
+
a.current.setFilterModel(t), a.current.onFilterChanged(), a.current.refreshHeader();
|
|
137
138
|
},
|
|
138
139
|
openMenu: (e, t, o = "column") => {
|
|
139
140
|
E.current = e, L.current = t, A.current = o, K(!0);
|
|
@@ -148,32 +149,32 @@ function tt({
|
|
|
148
149
|
get activeMenuVariant() {
|
|
149
150
|
return A.current;
|
|
150
151
|
}
|
|
151
|
-
}), []),
|
|
152
|
-
|
|
152
|
+
}), []), oe = f((e) => {
|
|
153
|
+
a.current = e.api, _(e.api);
|
|
153
154
|
const t = e.api.getGridOption("context") || {};
|
|
154
|
-
e.api.setGridOption("context", { ...t, activeSearchColumnId: null }),
|
|
155
|
-
}, [
|
|
155
|
+
e.api.setGridOption("context", { ...t, activeSearchColumnId: null }), c && c(e);
|
|
156
|
+
}, [c]), le = f(
|
|
156
157
|
(e) => {
|
|
157
|
-
|
|
158
|
+
a.current = null, _(null), u?.(e);
|
|
158
159
|
},
|
|
159
160
|
[u]
|
|
160
|
-
),
|
|
161
|
+
), ie = f(
|
|
161
162
|
(e) => {
|
|
162
163
|
e.api.getGridOption("context")?.activeSearchColumnId || e.api.refreshHeader(), b?.(e);
|
|
163
164
|
},
|
|
164
165
|
[b]
|
|
165
|
-
),
|
|
166
|
+
), se = f(
|
|
166
167
|
(e) => {
|
|
167
|
-
|
|
168
|
+
q(e.api) && e.api.refreshHeader(), h?.(e);
|
|
168
169
|
},
|
|
169
170
|
[h]
|
|
170
|
-
),
|
|
171
|
+
), ae = f(
|
|
171
172
|
(e) => {
|
|
172
|
-
e.api.getGridOption("rowModelType") !== "serverSide" &&
|
|
173
|
+
e.api.getGridOption("rowModelType") !== "serverSide" && q(e.api) && e.api.refreshHeader(), M?.(e);
|
|
173
174
|
},
|
|
174
175
|
[M]
|
|
175
176
|
);
|
|
176
|
-
|
|
177
|
+
be(() => {
|
|
177
178
|
const e = D.current;
|
|
178
179
|
if (!e) return;
|
|
179
180
|
const t = (o) => {
|
|
@@ -187,12 +188,12 @@ function tt({
|
|
|
187
188
|
};
|
|
188
189
|
return e.addEventListener("keydown", t, !0), () => e.removeEventListener("keydown", t, !0);
|
|
189
190
|
}, []);
|
|
190
|
-
const
|
|
191
|
-
headerComponent:
|
|
191
|
+
const ce = y(() => ({
|
|
192
|
+
headerComponent: Ge,
|
|
192
193
|
// Default cell renderer wraps text in a span so display:flex centering
|
|
193
194
|
// and text-overflow:ellipsis both work (ellipsis doesn't work on
|
|
194
195
|
// anonymous flex text nodes, but works on flex child elements).
|
|
195
|
-
cellRenderer:
|
|
196
|
+
cellRenderer: we,
|
|
196
197
|
...n,
|
|
197
198
|
suppressHeaderKeyboardEvent: (e) => {
|
|
198
199
|
const { event: t } = e, o = t.target;
|
|
@@ -211,25 +212,25 @@ function tt({
|
|
|
211
212
|
headerComponentParams: {
|
|
212
213
|
...n?.headerComponentParams
|
|
213
214
|
}
|
|
214
|
-
}), [n]),
|
|
215
|
-
headerGroupComponent:
|
|
215
|
+
}), [n]), ue = y(() => ({
|
|
216
|
+
headerGroupComponent: ke,
|
|
216
217
|
...i,
|
|
217
218
|
headerGroupComponentParams: {
|
|
218
219
|
...i?.headerGroupComponentParams
|
|
219
220
|
}
|
|
220
|
-
}), [i]),
|
|
221
|
-
...
|
|
221
|
+
}), [i]), de = y(() => ({
|
|
222
|
+
...De,
|
|
222
223
|
// Always available - value formatters
|
|
223
224
|
...C.components,
|
|
224
225
|
// User components override
|
|
225
226
|
...m
|
|
226
227
|
// Optional custom formatters override defaults
|
|
227
|
-
}), [m, C.components]),
|
|
228
|
+
}), [m, C.components]), pe = f((e) => {
|
|
228
229
|
const t = e.value;
|
|
229
230
|
if (t == null || typeof t != "object") return t;
|
|
230
|
-
const o =
|
|
231
|
+
const o = z(e.column?.getColDef());
|
|
231
232
|
if (o && o.length > 0) {
|
|
232
|
-
const r =
|
|
233
|
+
const r = B(t, o);
|
|
233
234
|
if (o.length === 1) {
|
|
234
235
|
const d = o[0]?.field?.split(".").pop(), x = d ? t[d] : void 0;
|
|
235
236
|
return x && typeof x == "object" && "value" in x ? x.value ?? "" : r[0];
|
|
@@ -238,7 +239,7 @@ function tt({
|
|
|
238
239
|
}
|
|
239
240
|
const s = Object.entries(t).map(([, r]) => r && typeof r == "object" && "value" in r ? r.value : typeof r != "object" && typeof r < "u" ? r : null).filter((r) => r != null);
|
|
240
241
|
return s.length === 0 ? "" : s.length === 1 ? s[0] : s.join(F);
|
|
241
|
-
}, []),
|
|
242
|
+
}, []), fe = f((e) => {
|
|
242
243
|
if (typeof e.value == "string") {
|
|
243
244
|
const t = e.value.trim();
|
|
244
245
|
if (t.startsWith("{") || t.startsWith("["))
|
|
@@ -249,10 +250,10 @@ function tt({
|
|
|
249
250
|
}
|
|
250
251
|
}
|
|
251
252
|
return e.value;
|
|
252
|
-
}, []),
|
|
253
|
+
}, []), me = f((e) => {
|
|
253
254
|
const t = e?.data ?? "";
|
|
254
255
|
if (!t.includes(F) && !t.includes(N)) {
|
|
255
|
-
|
|
256
|
+
J(t);
|
|
256
257
|
return;
|
|
257
258
|
}
|
|
258
259
|
const o = [], s = t.split(`
|
|
@@ -269,19 +270,19 @@ function tt({
|
|
|
269
270
|
continue;
|
|
270
271
|
}
|
|
271
272
|
for (let p = 0; p < U; p++) {
|
|
272
|
-
const
|
|
273
|
-
o.push(
|
|
273
|
+
const Ce = k.map((w) => !w.isSplit && w.slots.length === 1 ? w.slots[0] : w.slots[p] ?? "");
|
|
274
|
+
o.push(Ce.join(" "));
|
|
274
275
|
}
|
|
275
276
|
}
|
|
276
|
-
|
|
277
|
+
J(o.join(`
|
|
277
278
|
`));
|
|
278
279
|
}, []), G = f((e) => {
|
|
279
280
|
const t = e.value;
|
|
280
281
|
if (t == null) return "";
|
|
281
282
|
if (typeof t != "object") return String(t);
|
|
282
|
-
const o =
|
|
283
|
+
const o = z(e.column?.getColDef());
|
|
283
284
|
if (o && o.length > 0) {
|
|
284
|
-
const r =
|
|
285
|
+
const r = B(t, o);
|
|
285
286
|
return o.length === 1 ? r[0] : r.join(`
|
|
286
287
|
`);
|
|
287
288
|
}
|
|
@@ -297,64 +298,64 @@ function tt({
|
|
|
297
298
|
}
|
|
298
299
|
return s.length === 0 ? "" : s.length === 1 ? s[0] : s.join(`
|
|
299
300
|
`);
|
|
300
|
-
}, []),
|
|
301
|
+
}, []), ge = y(() => ({
|
|
301
302
|
processCellCallback: G,
|
|
302
303
|
...C.defaultCsvExportParams ?? {}
|
|
303
|
-
}), [G, C.defaultCsvExportParams]),
|
|
304
|
+
}), [G, C.defaultCsvExportParams]), he = y(() => ({
|
|
304
305
|
processCellCallback: G,
|
|
305
306
|
...C.defaultExcelExportParams ?? {}
|
|
306
307
|
}), [G, C.defaultExcelExportParams]);
|
|
307
|
-
return /* @__PURE__ */
|
|
308
|
+
return /* @__PURE__ */ ye(je.Provider, { value: R, children: [
|
|
308
309
|
/* @__PURE__ */ v("div", { ref: D, "data-component": "ag-grid-react", style: { width: "100%", height: "100%" }, children: /* @__PURE__ */ v(
|
|
309
|
-
|
|
310
|
+
Ae,
|
|
310
311
|
{
|
|
311
|
-
theme:
|
|
312
|
-
defaultColDef:
|
|
312
|
+
theme: Re,
|
|
313
|
+
defaultColDef: ce,
|
|
313
314
|
columnDefs: g,
|
|
314
315
|
cellSelection: !0,
|
|
315
|
-
defaultColGroupDef:
|
|
316
|
-
onGridReady:
|
|
317
|
-
onGridPreDestroyed:
|
|
318
|
-
onFilterChanged:
|
|
319
|
-
onSelectionChanged:
|
|
320
|
-
onModelUpdated:
|
|
321
|
-
components:
|
|
316
|
+
defaultColGroupDef: ue,
|
|
317
|
+
onGridReady: oe,
|
|
318
|
+
onGridPreDestroyed: le,
|
|
319
|
+
onFilterChanged: ie,
|
|
320
|
+
onSelectionChanged: se,
|
|
321
|
+
onModelUpdated: ae,
|
|
322
|
+
components: de,
|
|
322
323
|
tooltipShowMode: O,
|
|
323
324
|
tooltipShowDelay: P,
|
|
324
|
-
tooltipHideDelay:
|
|
325
|
-
tooltipInteraction:
|
|
326
|
-
processCellForClipboard:
|
|
327
|
-
processCellFromClipboard:
|
|
328
|
-
sendToClipboard:
|
|
329
|
-
ensureDomOrder:
|
|
325
|
+
tooltipHideDelay: Q,
|
|
326
|
+
tooltipInteraction: Y,
|
|
327
|
+
processCellForClipboard: pe,
|
|
328
|
+
processCellFromClipboard: fe,
|
|
329
|
+
sendToClipboard: me,
|
|
330
|
+
ensureDomOrder: I,
|
|
330
331
|
suppressHeaderFocus: !1,
|
|
331
332
|
suppressFocusAfterRefresh: !0,
|
|
332
333
|
suppressGroupRowsSticky: !0,
|
|
333
334
|
hidePaddedHeaderRows: !0,
|
|
334
335
|
suppressServerSideFullWidthLoadingRow: !0,
|
|
335
|
-
columnTypes:
|
|
336
|
-
autoSizeStrategy:
|
|
336
|
+
columnTypes: ne,
|
|
337
|
+
autoSizeStrategy: T,
|
|
337
338
|
...C,
|
|
338
|
-
defaultCsvExportParams:
|
|
339
|
-
defaultExcelExportParams:
|
|
340
|
-
getMainMenuItems:
|
|
339
|
+
defaultCsvExportParams: ge,
|
|
340
|
+
defaultExcelExportParams: he,
|
|
341
|
+
getMainMenuItems: re
|
|
341
342
|
}
|
|
342
343
|
) }),
|
|
343
344
|
l,
|
|
344
345
|
/* @__PURE__ */ v(
|
|
345
|
-
|
|
346
|
+
Ne,
|
|
346
347
|
{
|
|
347
|
-
isOpen:
|
|
348
|
-
columnId:
|
|
348
|
+
isOpen: Z,
|
|
349
|
+
columnId: ee,
|
|
349
350
|
gridApi: H,
|
|
350
351
|
onClose: R.closeAdvancedFilter,
|
|
351
352
|
onApply: R.applyAdvancedFilter
|
|
352
353
|
}
|
|
353
354
|
),
|
|
354
355
|
/* @__PURE__ */ v(
|
|
355
|
-
|
|
356
|
+
_e,
|
|
356
357
|
{
|
|
357
|
-
isOpen:
|
|
358
|
+
isOpen: te,
|
|
358
359
|
columnId: E.current,
|
|
359
360
|
gridApi: H,
|
|
360
361
|
anchor: L.current,
|
|
@@ -364,7 +365,7 @@ function tt({
|
|
|
364
365
|
)
|
|
365
366
|
] });
|
|
366
367
|
}
|
|
367
|
-
function
|
|
368
|
+
function Ne({
|
|
368
369
|
isOpen: l,
|
|
369
370
|
columnId: n,
|
|
370
371
|
gridApi: i,
|
|
@@ -372,11 +373,11 @@ function Le({
|
|
|
372
373
|
onApply: m
|
|
373
374
|
}) {
|
|
374
375
|
if (!l || !n || !i) return null;
|
|
375
|
-
const
|
|
376
|
-
if (!
|
|
377
|
-
const u =
|
|
378
|
-
return /* @__PURE__ */ v(
|
|
379
|
-
|
|
376
|
+
const c = i.getColumn(n);
|
|
377
|
+
if (!c) return null;
|
|
378
|
+
const u = c.getColDef(), b = u.headerComponentParams, h = Te(u), M = h.text !== -1 || h.number !== -1 || h.date !== -1, I = h.set !== -1, O = u.filter === "agMultiColumnFilter" && (M || I) ? "multi" : u.filter === "agNumberColumnFilter" ? "number" : u.filter === "agDateColumnFilter" ? "date" : u.filter === "agSetColumnFilter" || b?.selectOptions ? "select" : "text", P = Oe(i.getFilterModel());
|
|
379
|
+
return /* @__PURE__ */ v(xe, { fallback: null, children: /* @__PURE__ */ v(
|
|
380
|
+
Le,
|
|
380
381
|
{
|
|
381
382
|
isOpen: l,
|
|
382
383
|
onClose: g,
|
|
@@ -391,28 +392,28 @@ function Le({
|
|
|
391
392
|
}
|
|
392
393
|
) });
|
|
393
394
|
}
|
|
394
|
-
function
|
|
395
|
+
function _e({
|
|
395
396
|
isOpen: l,
|
|
396
397
|
columnId: n,
|
|
397
398
|
gridApi: i,
|
|
398
399
|
anchor: g,
|
|
399
400
|
variant: m,
|
|
400
|
-
onClose:
|
|
401
|
+
onClose: c
|
|
401
402
|
}) {
|
|
402
403
|
return !l || !n || !i ? null : /* @__PURE__ */ v(
|
|
403
|
-
|
|
404
|
+
Pe,
|
|
404
405
|
{
|
|
405
406
|
isOpen: l,
|
|
406
407
|
columnId: n,
|
|
407
408
|
gridApi: i,
|
|
408
409
|
anchor: g,
|
|
409
410
|
variant: m || "column",
|
|
410
|
-
onClose:
|
|
411
|
+
onClose: c
|
|
411
412
|
}
|
|
412
413
|
);
|
|
413
414
|
}
|
|
414
415
|
export {
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
416
|
+
nt as AgGridWrapper,
|
|
417
|
+
it as subscribeGridApiEvent,
|
|
418
|
+
st as subscribeGridApiEvents
|
|
418
419
|
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { GridApi } from 'ag-grid-community';
|
|
2
|
+
/**
|
|
3
|
+
* Column-picker indicators read `activeSearchColumnId` from grid context.
|
|
4
|
+
* Opening/closing inline header search only updates context + refreshHeader,
|
|
5
|
+
* so notify indicator listeners through the existing filterChanged channel.
|
|
6
|
+
*/
|
|
7
|
+
export declare function notifyColumnIndicatorSync<TData = unknown>(gridApi: GridApi<TData>): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { themeQuartz as e, iconSetMaterial as r } from "ag-grid-enterprise";
|
|
2
|
-
const
|
|
2
|
+
const t = e.withPart(r).withParams({
|
|
3
3
|
accentColor: "#4259EE",
|
|
4
4
|
advancedFilterBuilderButtonBarBorder: !0,
|
|
5
5
|
borderColor: "#D9DDE7",
|
|
@@ -15,6 +15,7 @@ const d = e.withPart(r).withParams({
|
|
|
15
15
|
columnBorder: !0,
|
|
16
16
|
columnDropCellBorder: !0,
|
|
17
17
|
fontFamily: "inherit",
|
|
18
|
+
fontWeight: "inherit",
|
|
18
19
|
footerRowBorder: !0,
|
|
19
20
|
foregroundColor: "#0D152C",
|
|
20
21
|
headerBackgroundColor: "#F5F6FA",
|
|
@@ -23,7 +24,7 @@ const d = e.withPart(r).withParams({
|
|
|
23
24
|
headerFontSize: 14,
|
|
24
25
|
headerHeight: 40,
|
|
25
26
|
headerFontWeight: 700,
|
|
26
|
-
headerRowBorder:
|
|
27
|
+
headerRowBorder: { style: "solid", width: 1, color: "#D9DDE7" },
|
|
27
28
|
headerVerticalPaddingScale: 1,
|
|
28
29
|
headerColumnResizeHandleWidth: 0,
|
|
29
30
|
inputBorder: !1,
|
|
@@ -31,7 +32,7 @@ const d = e.withPart(r).withParams({
|
|
|
31
32
|
inputFocusBorder: !1,
|
|
32
33
|
inputFocusShadow: "none",
|
|
33
34
|
focusShadow: "none",
|
|
34
|
-
rowBorder:
|
|
35
|
+
rowBorder: { style: "solid", width: 1, color: "#D9DDE7" },
|
|
35
36
|
tabBarBorder: !0,
|
|
36
37
|
wrapperBorder: !0,
|
|
37
38
|
wrapperBorderRadius: 0,
|
|
@@ -48,5 +49,5 @@ const d = e.withPart(r).withParams({
|
|
|
48
49
|
pinnedRowBorder: !1
|
|
49
50
|
});
|
|
50
51
|
export {
|
|
51
|
-
|
|
52
|
+
t as customAgGridTheme
|
|
52
53
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { GridApi } from 'ag-grid-community';
|
|
2
|
+
import { NestedListItem } from '../nested-list/nested-list.types';
|
|
3
|
+
export interface ColumnItemData extends Record<string, unknown> {
|
|
4
|
+
hasSortApplied?: boolean;
|
|
5
|
+
hasFilterApplied?: boolean;
|
|
6
|
+
pinned?: 'left' | 'right' | null;
|
|
7
|
+
}
|
|
8
|
+
export interface BuildColumnTreeLabels {
|
|
9
|
+
frozenColumns: string;
|
|
10
|
+
scrollableColumns: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function buildColumnTreeFromGrid(gridApi: GridApi, labels: BuildColumnTreeLabels): NestedListItem[] | null;
|
|
13
|
+
export declare function findColumnTreeLeaf(items: NestedListItem[], columnId: string): NestedListItem | undefined;
|
|
14
|
+
export declare function countPinnedNestedColumns(gridApi: GridApi, prefix?: string): number;
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { resolveColumnPinnedFromGridState as O } from "./data-table-column-apply.js";
|
|
2
|
+
function x(t) {
|
|
3
|
+
const i = [];
|
|
4
|
+
let l = t.getOriginalParent();
|
|
5
|
+
for (; l; ) {
|
|
6
|
+
const f = l.getColGroupDef();
|
|
7
|
+
f?.headerName && f?.children && i.push(l), l = l.getOriginalParent();
|
|
8
|
+
}
|
|
9
|
+
return i.reverse(), i;
|
|
10
|
+
}
|
|
11
|
+
function T(t, i) {
|
|
12
|
+
const l = t.getColumnState(), f = t.getGridOption("context"), y = typeof f?.activeSearchColumnId == "string" ? f.activeSearchColumnId : null, z = t.getAllGridColumns?.() ?? t.getColumns() ?? [], N = new Map(
|
|
13
|
+
z.map((o) => [o.getColId(), o])
|
|
14
|
+
), h = [], m = [], G = /* @__PURE__ */ new Map(), v = /* @__PURE__ */ new Map(), p = /* @__PURE__ */ new Map();
|
|
15
|
+
p.set(h, "f"), p.set(m, "s");
|
|
16
|
+
let _ = 0;
|
|
17
|
+
const w = (o) => {
|
|
18
|
+
let e = p.get(o);
|
|
19
|
+
return e === void 0 && (e = `n${_++}`, p.set(o, e)), e;
|
|
20
|
+
}, F = (o, e) => {
|
|
21
|
+
const n = o.getGroupId(), r = w(e), d = `${n}::${r}`, u = G.get(d);
|
|
22
|
+
if (u && u.list === e && e[e.length - 1] === u.node)
|
|
23
|
+
return u.node;
|
|
24
|
+
const c = v.get(d) || 0;
|
|
25
|
+
v.set(d, c + 1);
|
|
26
|
+
const C = o.getColGroupDef(), a = {
|
|
27
|
+
id: c === 0 ? `${n}__${r}` : `${n}__${r}__${c}`,
|
|
28
|
+
label: C?.headerName || n,
|
|
29
|
+
checked: !0,
|
|
30
|
+
children: [],
|
|
31
|
+
category: "group"
|
|
32
|
+
};
|
|
33
|
+
return e.push(a), G.set(d, { list: e, node: a }), a;
|
|
34
|
+
};
|
|
35
|
+
let g = 0, S = 0, I = 0, $ = 0;
|
|
36
|
+
l.forEach((o) => {
|
|
37
|
+
const e = N.get(o.colId) ?? t.getColumn(o.colId);
|
|
38
|
+
if (!e) return;
|
|
39
|
+
let n = t.getDisplayNameForColumn(e, "header");
|
|
40
|
+
if (n === "") return;
|
|
41
|
+
if (n == null) {
|
|
42
|
+
const s = e.getColDef();
|
|
43
|
+
if (s.headerName === "") return;
|
|
44
|
+
n = s.headerName || s.field || o.colId;
|
|
45
|
+
}
|
|
46
|
+
if (!n || n.trim() === "")
|
|
47
|
+
return;
|
|
48
|
+
const r = !o.hide, d = !!o.sort, u = e.isFilterActive() || y === o.colId, c = O(o, e), C = {
|
|
49
|
+
id: o.colId,
|
|
50
|
+
label: n,
|
|
51
|
+
checked: r,
|
|
52
|
+
data: {
|
|
53
|
+
hasSortApplied: d,
|
|
54
|
+
hasFilterApplied: u,
|
|
55
|
+
pinned: c
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
c ? (g++, r && S++) : (I++, r && $++);
|
|
59
|
+
const k = c ? h : m, a = x(e);
|
|
60
|
+
if (a.length > 0) {
|
|
61
|
+
let s = k, D = null;
|
|
62
|
+
for (const M of a)
|
|
63
|
+
D = F(M, s), s = D.children;
|
|
64
|
+
D.children.push(C);
|
|
65
|
+
} else
|
|
66
|
+
k.push(C);
|
|
67
|
+
});
|
|
68
|
+
const b = (o) => {
|
|
69
|
+
let e = o.length > 0;
|
|
70
|
+
for (const n of o)
|
|
71
|
+
n.children && (n.checked = b(n.children)), n.checked || (e = !1);
|
|
72
|
+
return e;
|
|
73
|
+
};
|
|
74
|
+
return b(h), b(m), [
|
|
75
|
+
{
|
|
76
|
+
id: "root-frozen",
|
|
77
|
+
label: i.frozenColumns,
|
|
78
|
+
checked: g > 0 && S === g,
|
|
79
|
+
children: h,
|
|
80
|
+
category: "structure",
|
|
81
|
+
isDragDisabled: !0
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
id: "root-scrollable",
|
|
85
|
+
label: i.scrollableColumns,
|
|
86
|
+
checked: I > 0 && $ === I,
|
|
87
|
+
children: m,
|
|
88
|
+
category: "structure",
|
|
89
|
+
isDragDisabled: !0
|
|
90
|
+
}
|
|
91
|
+
];
|
|
92
|
+
}
|
|
93
|
+
export {
|
|
94
|
+
T as buildColumnTreeFromGrid
|
|
95
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ColumnPinnedType, GridApi } from 'ag-grid-community';
|
|
1
|
+
import { Column, ColumnPinnedType, ColumnState, GridApi } from 'ag-grid-community';
|
|
2
|
+
import { NestedListItem } from '../nested-list/nested-list.types';
|
|
2
3
|
/** Debounce window for coalescing external grid column events into one UI sync. */
|
|
3
4
|
export declare const EXTERNAL_SYNC_DEBOUNCE_MS = 150;
|
|
4
5
|
/**
|
|
@@ -8,7 +9,19 @@ export declare const EXTERNAL_SYNC_DEBOUNCE_MS = 150;
|
|
|
8
9
|
export declare const GRID_AUTO_UNPIN_WAIT_MS = 300;
|
|
9
10
|
export type NormalizedColumnPin = 'left' | 'right' | null;
|
|
10
11
|
export declare function normalizeColumnPinned(pinned: ColumnPinnedType | boolean | null | undefined): NormalizedColumnPin;
|
|
12
|
+
/**
|
|
13
|
+
* Prefer runtime column state from `getColumnState()`. Only fall back to
|
|
14
|
+
* `column.getPinned()` when the state object omits `pinned` entirely.
|
|
15
|
+
*/
|
|
16
|
+
export declare function resolveColumnPinnedFromGridState(state: ColumnState, column: Column): NormalizedColumnPin;
|
|
11
17
|
export declare function readGridColumnPinned(gridApi: GridApi, columnId: string): NormalizedColumnPin;
|
|
18
|
+
export declare function pinnedColumnIdsFromState(state: ColumnState[]): Set<string>;
|
|
19
|
+
/** Align `data.pinned` on leaves with frozen/scrollable section placement. */
|
|
20
|
+
export declare function alignColumnTreePinMetadata(items: NestedListItem[]): NestedListItem[];
|
|
21
|
+
/** Cheap structural fingerprint for column-tree equality (order, pin, visibility). */
|
|
22
|
+
export declare function fingerprintColumnTreeItems(items: NestedListItem[]): string;
|
|
23
|
+
/** Fingerprint for sort/filter indicator badges on column-picker leaves. */
|
|
24
|
+
export declare function fingerprintColumnTreeIndicators(items: NestedListItem[]): string;
|
|
12
25
|
/**
|
|
13
26
|
* Run after `applyColumnState` returns. AG Grid applies pin/order/hide synchronously;
|
|
14
27
|
* `queueMicrotask` lets any same-turn grid events finish before we release the panel lock.
|