impact-nova 2.1.0-alpha.5 → 2.1.0-alpha.7

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 (40) hide show
  1. package/dist/components/data/ag-grid-react/index.js +120 -119
  2. package/dist/components/data/ag-grid-react/notify-column-indicator-sync.d.ts +7 -0
  3. package/dist/components/data/ag-grid-react/notify-column-indicator-sync.js +6 -0
  4. package/dist/components/data/ag-grid-react/theme.js +5 -4
  5. package/dist/components/data/data-table/build-column-tree-from-grid.d.ts +14 -0
  6. package/dist/components/data/data-table/build-column-tree-from-grid.js +95 -0
  7. package/dist/components/data/data-table/data-table-column-apply.d.ts +14 -1
  8. package/dist/components/data/data-table/data-table-column-apply.js +97 -13
  9. package/dist/components/data/data-table/data-table-column-def-pin.d.ts +25 -0
  10. package/dist/components/data/data-table/data-table-column-def-pin.js +66 -0
  11. package/dist/components/data/data-table/data-table-column-list-sync.d.ts +8 -0
  12. package/dist/components/data/data-table/data-table-column-list-sync.js +15 -0
  13. package/dist/components/data/data-table/data-table-column-list.d.ts +1 -1
  14. package/dist/components/data/data-table/data-table-column-list.js +73 -283
  15. package/dist/components/data/data-table/data-table-sheet.js +18 -18
  16. package/dist/components/data/data-table/data-table.js +86 -77
  17. package/dist/components/data/data-table/use-data-table-column-list-sync.d.ts +16 -0
  18. package/dist/components/data/data-table/use-data-table-column-list-sync.js +222 -0
  19. package/dist/components/forms/select/hooks/useSelectValueState.d.ts +19 -0
  20. package/dist/components/forms/select/hooks/useSelectValueState.js +41 -0
  21. package/dist/components/forms/select/index.js +4 -3
  22. package/dist/components/forms/select/select.js +163 -158
  23. package/dist/components/forms/select/select.types.d.ts +3 -2
  24. package/dist/components/forms/select/utils/select.d.ts +2 -1
  25. package/dist/components/forms/select/utils/select.js +47 -37
  26. package/dist/impact-nova-components.css +26 -17
  27. package/dist/impact-nova.css +1 -1
  28. package/dist/index.js +297 -296
  29. package/dist/lib/primitives/create-component.d.ts +1 -1
  30. package/dist/lib/primitives/create-component.js +4 -4
  31. package/dist/lib/primitives/field.js +17 -18
  32. package/dist/lib/virtualized/virtualized-list-parts.d.ts +1 -2
  33. package/dist/lib/virtualized/virtualized-list-parts.js +23 -23
  34. package/dist/lib/virtualized/virtualized.types.d.ts +10 -0
  35. package/dist/llms/rules/ag-grid.js +1 -1
  36. package/dist/llms/rules/installation.js +1 -1
  37. package/dist/llms/rules/migration.js +1 -1
  38. package/dist/llms/rules/real-world-patterns.js +1 -1
  39. package/dist/llms/rules/requirements.js +1 -1
  40. package/package.json +6 -6
@@ -1,18 +1,102 @@
1
- const e = 150, o = 300;
2
- function u(n) {
3
- return n === "left" || n === !0 ? "left" : n === "right" ? "right" : null;
1
+ const p = 150, s = 300;
2
+ function c(e) {
3
+ return e === "left" || e === !0 ? "left" : e === "right" ? "right" : null;
4
4
  }
5
- function l(n, r) {
6
- const t = n.getColumn(r);
7
- return t ? u(t.getPinned()) : null;
5
+ function f(e, n) {
6
+ return "pinned" in e && e.pinned !== void 0 ? c(e.pinned) : c(n.getPinned());
8
7
  }
9
- function i(n) {
10
- queueMicrotask(n);
8
+ function g(e, n) {
9
+ const r = e.getColumn(n);
10
+ if (!r) return null;
11
+ const l = e.getColumnState().find((t) => t.colId === n);
12
+ return l ? f(l, r) : c(r.getPinned());
13
+ }
14
+ function d(e, n) {
15
+ return e.map((r) => {
16
+ if ((r.category === "group" || r.children && r.children.length > 0) && r.children)
17
+ return {
18
+ ...r,
19
+ children: d(r.children, n)
20
+ };
21
+ const t = r.data ?? {};
22
+ let i = null;
23
+ if (n !== null) {
24
+ const o = t.pinned;
25
+ i = o === "left" || o === "right" ? o : n;
26
+ }
27
+ return {
28
+ ...r,
29
+ data: {
30
+ ...t,
31
+ pinned: i
32
+ }
33
+ };
34
+ });
35
+ }
36
+ function m(e) {
37
+ return e.map((n) => n.id === "root-frozen" ? {
38
+ ...n,
39
+ children: n.children ? d(n.children, "left") : []
40
+ } : n.id === "root-scrollable" ? {
41
+ ...n,
42
+ children: n.children ? d(n.children, null) : []
43
+ } : n);
44
+ }
45
+ function C(e) {
46
+ const n = [], r = (l, t) => {
47
+ for (const i of l) {
48
+ if (i.id === "root-frozen") {
49
+ i.children && r(i.children, "left");
50
+ continue;
51
+ }
52
+ if (i.id === "root-scrollable") {
53
+ i.children && r(i.children, null);
54
+ continue;
55
+ }
56
+ if ((i.category === "group" || i.children && i.children.length > 0) && i.children) {
57
+ r(i.children, t);
58
+ continue;
59
+ }
60
+ let a = "0";
61
+ if (t !== null) {
62
+ const u = i.data?.pinned;
63
+ a = u === "left" || u === "right" ? u : "left";
64
+ }
65
+ n.push(`${i.id}:${a}:${i.checked ? "1" : "0"}`);
66
+ }
67
+ };
68
+ return r(e, null), n.join("|");
69
+ }
70
+ function G(e) {
71
+ const n = [], r = (l) => {
72
+ for (const t of l) {
73
+ if (t.id === "root-frozen" || t.id === "root-scrollable") {
74
+ t.children && r(t.children);
75
+ continue;
76
+ }
77
+ if ((t.category === "group" || t.children && t.children.length > 0) && t.children) {
78
+ r(t.children);
79
+ continue;
80
+ }
81
+ const o = t.data;
82
+ n.push(
83
+ `${t.id}:${o?.hasSortApplied ? "1" : "0"}:${o?.hasFilterApplied ? "1" : "0"}`
84
+ );
85
+ }
86
+ };
87
+ return r(e), n.join("|");
88
+ }
89
+ function S(e) {
90
+ queueMicrotask(e);
11
91
  }
12
92
  export {
13
- e as EXTERNAL_SYNC_DEBOUNCE_MS,
14
- o as GRID_AUTO_UNPIN_WAIT_MS,
15
- i as afterSynchronousColumnApply,
16
- u as normalizeColumnPinned,
17
- l as readGridColumnPinned
93
+ p as EXTERNAL_SYNC_DEBOUNCE_MS,
94
+ s as GRID_AUTO_UNPIN_WAIT_MS,
95
+ S as afterSynchronousColumnApply,
96
+ m as alignColumnTreePinMetadata,
97
+ G as fingerprintColumnTreeIndicators,
98
+ C as fingerprintColumnTreeItems,
99
+ c as normalizeColumnPinned,
100
+ g as readGridColumnPinned,
101
+ f as resolveColumnPinnedFromGridState
18
102
  };
@@ -0,0 +1,25 @@
1
+ import { ColDef, ColGroupDef, GridState } from 'ag-grid-community';
2
+ export interface ExtractedColumnPinning {
3
+ leftColIds: string[];
4
+ rightColIds: string[];
5
+ }
6
+ export interface ExtractedColumnVisibility {
7
+ hiddenColIds: string[];
8
+ }
9
+ export interface ExtractedColumnRuntimeDefaults {
10
+ columnPinning: ExtractedColumnPinning;
11
+ columnVisibility: ExtractedColumnVisibility;
12
+ }
13
+ export interface RuntimeColumnDefsResult {
14
+ runtimeColumnDefs: (ColDef | ColGroupDef)[];
15
+ extractedRuntimeDefaults: ExtractedColumnRuntimeDefaults;
16
+ }
17
+ /**
18
+ * AG Grid reapplies `colDef.pinned` / `colDef.hide` on column-definition refresh.
19
+ * User changes belong in runtime column state / `initialState`, not on defs.
20
+ */
21
+ export declare function extractRuntimeColumnDefs(columnDefs: (ColDef | ColGroupDef)[] | undefined): RuntimeColumnDefsResult;
22
+ /** @deprecated Use `extractedRuntimeDefaults.columnPinning` from `extractRuntimeColumnDefs`. */
23
+ export declare function getExtractedColumnPinning(result: RuntimeColumnDefsResult): ExtractedColumnPinning;
24
+ export declare function mergeInitialColumnPinningState(userInitialState: GridState | undefined, extractedColumnPinning: ExtractedColumnPinning): GridState | undefined;
25
+ export declare function mergeInitialGridRuntimeState(userInitialState: GridState | undefined, extractedRuntimeDefaults: ExtractedColumnRuntimeDefaults): GridState | undefined;
@@ -0,0 +1,66 @@
1
+ function d(n) {
2
+ const i = n.colId ?? n.field;
3
+ return typeof i == "string" && i.length > 0 ? i : void 0;
4
+ }
5
+ function s(n, i, r) {
6
+ if (i === "left" || i === !0) {
7
+ r.leftColIds.push(n);
8
+ return;
9
+ }
10
+ i === "right" && r.rightColIds.push(n);
11
+ }
12
+ function h(n, i) {
13
+ const r = d(n);
14
+ if (r && (n.pinned != null && s(r, n.pinned, i.columnPinning), n.hide === !0 && i.columnVisibility.hiddenColIds.push(r)), n.pinned === void 0 && n.hide === void 0)
15
+ return n;
16
+ const { pinned: e, hide: t, ...o } = n;
17
+ return o;
18
+ }
19
+ function u(n, i) {
20
+ let r = !1;
21
+ const e = n.map((t) => {
22
+ if ("children" in t && t.children) {
23
+ const l = u(
24
+ t.children,
25
+ i
26
+ );
27
+ return l === t.children ? t : (r = !0, {
28
+ ...t,
29
+ children: l
30
+ });
31
+ }
32
+ const o = h(
33
+ t,
34
+ i
35
+ );
36
+ return o !== t && (r = !0), o;
37
+ });
38
+ return r ? e : n;
39
+ }
40
+ function c() {
41
+ return {
42
+ columnPinning: { leftColIds: [], rightColIds: [] },
43
+ columnVisibility: { hiddenColIds: [] }
44
+ };
45
+ }
46
+ function m(n) {
47
+ const i = c();
48
+ return !n || n.length === 0 ? { runtimeColumnDefs: [], extractedRuntimeDefaults: i } : {
49
+ runtimeColumnDefs: u(
50
+ n,
51
+ i
52
+ ),
53
+ extractedRuntimeDefaults: i
54
+ };
55
+ }
56
+ function g(n, i) {
57
+ const r = i.columnPinning.leftColIds.length > 0 || i.columnPinning.rightColIds.length > 0, e = i.columnVisibility.hiddenColIds.length > 0;
58
+ if (!n && !r && !e)
59
+ return;
60
+ const t = { ...n };
61
+ return !n?.columnPinning && r && (t.columnPinning = i.columnPinning), !n?.columnVisibility && e && (t.columnVisibility = i.columnVisibility), !t.columnPinning && !t.columnVisibility && Object.keys(t).length === 0 ? n : Object.keys(t).length > 0 ? t : void 0;
62
+ }
63
+ export {
64
+ m as extractRuntimeColumnDefs,
65
+ g as mergeInitialGridRuntimeState
66
+ };
@@ -0,0 +1,8 @@
1
+ import { NestedListItem } from '../nested-list/nested-list.types';
2
+ export type ColumnListSyncMode = 'skip' | 'indicators-only' | 'structural';
3
+ export interface ColumnListSyncFingerprints {
4
+ structural: string;
5
+ indicators: string;
6
+ }
7
+ export declare function computeColumnListSyncFingerprints(rootItems: NestedListItem[]): ColumnListSyncFingerprints;
8
+ export declare function resolveColumnListSyncMode(rootItems: NestedListItem[], previousStructuralFingerprint: string, previousIndicatorsFingerprint: string): ColumnListSyncMode;
@@ -0,0 +1,15 @@
1
+ import { fingerprintColumnTreeIndicators as u, fingerprintColumnTreeItems as s } from "./data-table-column-apply.js";
2
+ function c(n) {
3
+ return {
4
+ structural: s(n),
5
+ indicators: u(n)
6
+ };
7
+ }
8
+ function l(n, t, i) {
9
+ const r = c(n), e = r.structural !== t, o = r.indicators !== i;
10
+ return e ? "structural" : o ? "indicators-only" : "skip";
11
+ }
12
+ export {
13
+ c as computeColumnListSyncFingerprints,
14
+ l as resolveColumnListSyncMode
15
+ };
@@ -15,4 +15,4 @@ export type DataTableColumnListProps = {
15
15
  /** Show collapse/expand controls on nested column group headers. Default `true`. */
16
16
  showCollapse?: boolean;
17
17
  };
18
- export declare const DataTableColumnList: ({ enableApplyDiscard, showSearch, showSelectAll, showCollapse }: DataTableColumnListProps) => import("react/jsx-runtime").JSX.Element;
18
+ export declare const DataTableColumnList: ({ enableApplyDiscard, showSearch, showSelectAll, showCollapse, }: DataTableColumnListProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,295 +1,85 @@
1
- import { jsxs as ae, jsx as v } from "react/jsx-runtime";
2
- import { useState as K, useRef as L, useCallback as C, useEffect as J } from "react";
3
- import { useDataTable as ue } from "./data-table-context.js";
4
- import { NestedList as de } from "../nested-list/nested-list.js";
5
- import { SelectionMode as fe } from "../nested-list/nested-list.types.js";
6
- import { useImpactNovaI18n as pe } from "../../../i18n/use-impact-nova-i18n.js";
7
- import { mergePartialOrderedColumnState as Q } from "./data-table-column-state.js";
8
- import { afterSynchronousColumnApply as U, GRID_AUTO_UNPIN_WAIT_MS as he, readGridColumnPinned as me, EXTERNAL_SYNC_DEBOUNCE_MS as ge } from "./data-table-column-apply.js";
9
- import { subscribeGridApiEvents as Ce, subscribeGridApiEvent as be } from "../ag-grid-react/grid-api-event-subscription.js";
10
- import { PinSwitch as Se } from "./pin-switch.js";
11
- import { ColumnIndicator as Z } from "./column-indicator.js";
12
- import { IndicatorLegend as Ie } from "./indicator-legend.js";
13
- function ye(P) {
14
- const E = [];
15
- let b = P.getOriginalParent();
16
- for (; b; ) {
17
- const M = b.getColGroupDef();
18
- M?.headerName && M?.children && E.push(b), b = b.getOriginalParent();
19
- }
20
- return E.reverse(), E;
21
- }
22
- const Me = ({
23
- enableApplyDiscard: P = !1,
24
- showSearch: E = !0,
25
- showSelectAll: b = !0,
26
- showCollapse: M = !0
1
+ import { jsxs as A, jsx as n } from "react/jsx-runtime";
2
+ import { useRef as T, useState as z, useCallback as o } from "react";
3
+ import { useDataTable as D } from "./data-table-context.js";
4
+ import { NestedList as F } from "../nested-list/nested-list.js";
5
+ import { SelectionMode as P } from "../nested-list/nested-list.types.js";
6
+ import { useImpactNovaI18n as R } from "../../../i18n/use-impact-nova-i18n.js";
7
+ import { PinSwitch as k } from "./pin-switch.js";
8
+ import { ColumnIndicator as c } from "./column-indicator.js";
9
+ import { IndicatorLegend as j } from "./indicator-legend.js";
10
+ import { useDataTableColumnListSync as E } from "./use-data-table-column-list-sync.js";
11
+ const Q = ({
12
+ enableApplyDiscard: a = !1,
13
+ showSearch: u = !0,
14
+ showSelectAll: d = !0,
15
+ showCollapse: m = !0
27
16
  }) => {
28
- const { gridApi: n } = ue(), { t: x } = pe(), [ee, $] = K([]), [te, ne] = K(!1), m = L(!1), j = L(null), O = L(0), V = L({}), [X, re] = K(!1), S = C(() => {
29
- if (!n || m.current) return;
30
- const e = n.getColumnState(), t = n.getAllGridColumns?.() ?? n.getColumns() ?? [], o = new Map(t.map((l) => [l.getColId(), l])), i = [], u = [], r = /* @__PURE__ */ new Map(), g = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
31
- s.set(i, "f"), s.set(u, "s");
32
- let p = 0;
33
- const A = (l) => {
34
- let c = s.get(l);
35
- return c === void 0 && (c = `n${p++}`, s.set(l, c)), c;
36
- }, h = (l, c) => {
37
- const a = l.getGroupId(), y = A(c), T = `${a}::${y}`, k = r.get(T);
38
- if (k && k.list === c && c[c.length - 1] === k.node)
39
- return k.node;
40
- const D = g.get(T) || 0;
41
- g.set(T, D + 1);
42
- const w = l.getColGroupDef(), N = {
43
- id: D === 0 ? `${a}__${y}` : `${a}__${y}__${D}`,
44
- label: w?.headerName || a,
45
- checked: !0,
46
- children: [],
47
- category: "group"
48
- };
49
- return c.push(N), r.set(T, { list: c, node: N }), N;
50
- };
51
- let z = 0, d = 0, F = 0, I = 0;
52
- e.forEach((l) => {
53
- const c = o.get(l.colId) ?? n.getColumn(l.colId);
54
- if (!c) return;
55
- let a = n.getDisplayNameForColumn(c, "header");
56
- if (a === "") return;
57
- if (a == null) {
58
- const G = c.getColDef();
59
- if (G.headerName === "") return;
60
- a = G.headerName || G.field || l.colId;
61
- }
62
- if (!a || a.trim() === "")
63
- return;
64
- const y = !l.hide, T = !!l.sort, k = c.isFilterActive(), D = l.pinned ?? c.getPinned() ?? null, w = D === "left" ? "left" : D === "right" ? "right" : null, q = {
65
- id: l.colId,
66
- label: a,
67
- checked: y,
68
- data: {
69
- hasSortApplied: T,
70
- hasFilterApplied: k,
71
- pinned: w
72
- }
73
- };
74
- w ? (z++, y && d++) : (F++, y && I++);
75
- const N = w ? i : u, W = ye(c);
76
- if (W.length > 0) {
77
- let G = N, B = null;
78
- for (const se of W)
79
- B = h(se, G), G = B.children;
80
- B.children.push(q);
81
- } else
82
- N.push(q);
83
- });
84
- const f = (l) => {
85
- let c = l.length > 0;
86
- for (const a of l)
87
- a.children && (a.checked = f(a.children)), a.checked || (c = !1);
88
- return c;
89
- };
90
- f(i), f(u);
91
- const _ = [
92
- {
93
- id: "root-frozen",
94
- label: x("dataTable.frozenColumns"),
95
- checked: z > 0 && d === z,
96
- children: i,
97
- category: "structure",
98
- isDragDisabled: !0
99
- },
100
- {
101
- id: "root-scrollable",
102
- label: x("dataTable.scrollableColumns"),
103
- checked: F > 0 && I === F,
104
- children: u,
105
- category: "structure",
106
- isDragDisabled: !0
107
- }
108
- ];
109
- $(_), ne(!0);
110
- }, [n, x]);
111
- J(() => {
112
- if (!n) return;
113
- queueMicrotask(() => S());
114
- const e = [
115
- "columnVisible",
116
- "columnPinned",
117
- "columnMoved",
118
- "newColumnsLoaded",
119
- "gridReady",
120
- "columnGroupOpened",
121
- "columnRowGroupChanged",
122
- "columnPivotModeChanged",
123
- "columnEverythingChanged",
124
- "dragStopped",
125
- "columnValueChanged",
126
- "displayedColumnsChanged",
127
- "sortChanged",
128
- "filterChanged"
129
- ];
130
- let t = null;
131
- const o = () => {
132
- m.current || (t && clearTimeout(t), t = setTimeout(() => {
133
- if (t = null, m.current) return;
134
- const i = j.current?.querySelector('[data-component="nested-list"] .overflow-y-auto');
135
- i && (O.current = i.scrollTop), S(), re((u) => !u);
136
- }, ge));
137
- };
138
- if (!n.isDestroyed()) {
139
- const i = Ce(n, e, o);
140
- return () => {
141
- t && clearTimeout(t), i();
142
- };
143
- }
144
- return () => {
145
- t && clearTimeout(t);
146
- };
147
- }, [n, S]), J(() => {
148
- if (O.current === 0) return;
149
- const e = requestAnimationFrame(() => {
150
- const t = j.current?.querySelector('[data-component="nested-list"] .overflow-y-auto');
151
- t && (t.scrollTop = O.current, O.current = 0);
152
- });
153
- return () => cancelAnimationFrame(e);
154
- }, [X]);
155
- const Y = C((e) => {
156
- const t = [], o = (i, u) => {
157
- i.forEach((r) => {
158
- if (r.id === "root-frozen") {
159
- r.children && o(r.children, "left");
160
- return;
161
- }
162
- if (r.id === "root-scrollable") {
163
- r.children && o(r.children, null);
164
- return;
165
- }
166
- if (r.category === "group" || r.children && r.children.length > 0)
167
- r.children && o(r.children, u);
168
- else if (n?.getColumn(r.id)) {
169
- let p;
170
- if (u === null)
171
- p = null;
172
- else {
173
- const h = r.data?.pinned;
174
- p = h === "left" || h === "right" ? h : u;
175
- }
176
- t.push({
177
- colId: r.id,
178
- pinned: p,
179
- hide: !r.checked
180
- });
181
- }
182
- });
183
- };
184
- return o(e, null), t;
185
- }, [n]), R = C((e) => {
186
- if (!n) return;
187
- m.current = !0;
188
- const t = Y(e);
189
- if (t.length === 0) {
190
- U(() => {
191
- m.current = !1;
192
- });
193
- return;
194
- }
195
- const o = n.getColumnState(), i = Q(o, t), u = new Set(o.filter((d) => d.pinned).map((d) => d.colId)), r = i.filter((d) => d.pinned && !u.has(d.colId)), g = new Set(r.map((d) => d.colId));
196
- n.applyColumnState({ state: i, applyOrder: !0 });
197
- const s = () => {
198
- m.current = !1, S();
199
- };
200
- if (g.size === 0) {
201
- U(s);
202
- return;
203
- }
204
- let p = !1, A = null, h = null;
205
- h = be(n, "columnPinned", () => {
206
- if (p || n.isDestroyed()) return;
207
- const d = n.getColumnState();
208
- if (r.filter((I) => {
209
- const f = d.find((_) => _.colId === I.colId);
210
- return f && !f.pinned;
211
- }).length > 0) {
212
- p = !0, A && clearTimeout(A), h?.();
213
- const I = i.filter((f) => f.pinned && !g.has(f.colId));
214
- if (I.length > 0) {
215
- const f = I[0], _ = i.map(
216
- (l) => l.colId === f.colId ? { ...l, pinned: null } : l
217
- );
218
- n.applyColumnState({ state: _, applyOrder: !0 });
219
- }
220
- U(s);
221
- }
222
- }), A = setTimeout(() => {
223
- h?.(), p || s();
224
- }, he);
225
- }, [n, Y, S]), le = C((e) => {
226
- R(e);
227
- }, [R]), oe = C((e) => {
228
- P || R(e), $(e);
229
- }, [P, R]), H = C((e, t) => {
230
- if ($((u) => {
231
- const r = (g) => g.map((s) => s.id === e ? {
232
- ...s,
233
- data: {
234
- ...s.data,
235
- pinned: t
17
+ const { gridApi: p } = D(), { t } = R(), f = T({}), [h, C] = z({}), {
18
+ items: b,
19
+ isReady: g,
20
+ externalSyncKey: S,
21
+ listWrapperRef: x,
22
+ handleChange: s,
23
+ handleSubmit: I,
24
+ handlePinChange: i
25
+ } = E({
26
+ gridApi: p,
27
+ frozenColumnsLabel: t("dataTable.frozenColumns"),
28
+ scrollableColumnsLabel: t("dataTable.scrollableColumns")
29
+ }), L = o(
30
+ (e) => {
31
+ s(e, a);
32
+ },
33
+ [a, s]
34
+ ), N = o(
35
+ (e, r) => {
36
+ if (!r.isLeaf) return null;
37
+ const l = e.data;
38
+ return !l?.hasSortApplied && !l?.hasFilterApplied ? null : /* @__PURE__ */ A("span", { className: "inline-flex items-center gap-1 ml-1.5 shrink-0", children: [
39
+ l?.hasSortApplied && /* @__PURE__ */ n(c, { type: "sort" }),
40
+ l?.hasFilterApplied && /* @__PURE__ */ n(c, { type: "filter" })
41
+ ] });
42
+ },
43
+ []
44
+ ), v = o(
45
+ (e, r) => {
46
+ const l = e.data;
47
+ return e.category === "structure" ? e.id !== "root-frozen" ? null : /* @__PURE__ */ n(j, {}) : !r.isLeaf || !(l?.pinned === "left" || l?.pinned === "right") ? null : /* @__PURE__ */ n(
48
+ k,
49
+ {
50
+ value: l?.pinned ?? null,
51
+ onChange: (y) => i(e.id, y),
52
+ className: "shrink-0"
236
53
  }
237
- } : s.children ? {
238
- ...s,
239
- children: r(s.children)
240
- } : s);
241
- return r(u);
242
- }), !n) return;
243
- m.current = !0;
244
- const o = n.getColumnState(), i = Q(o, [
245
- { colId: e, pinned: t }
246
- ]);
247
- n.applyColumnState({ state: i, applyOrder: !0 }), U(() => {
248
- m.current = !1, me(n, e) !== t && S();
249
- });
250
- }, [n, S]), ce = C((e, t) => {
251
- if (!t.isLeaf) return null;
252
- const o = e.data;
253
- return !o?.hasSortApplied && !o?.hasFilterApplied ? null : /* @__PURE__ */ ae("span", { className: "inline-flex items-center gap-1 ml-1.5 shrink-0", children: [
254
- o?.hasSortApplied && /* @__PURE__ */ v(Z, { type: "sort" }),
255
- o?.hasFilterApplied && /* @__PURE__ */ v(Z, { type: "filter" })
256
- ] });
257
- }, []), ie = C((e, t) => {
258
- const o = e.data;
259
- return e.category === "structure" ? e.id !== "root-frozen" ? null : /* @__PURE__ */ v(Ie, {}) : !t.isLeaf || !(o?.pinned === "left" || o?.pinned === "right") ? null : /* @__PURE__ */ v(
260
- Se,
261
- {
262
- value: o?.pinned ?? null,
263
- onChange: (u) => H(e.id, u),
264
- className: "shrink-0"
265
- }
266
- );
267
- }, [H]);
268
- return te ? /* @__PURE__ */ v("div", { ref: j, className: "flex flex-col h-full bg-canvas-elevated", children: /* @__PURE__ */ v(
269
- de,
54
+ );
55
+ },
56
+ [i]
57
+ );
58
+ return g ? /* @__PURE__ */ n("div", { ref: x, className: "flex flex-col h-full bg-canvas-elevated", children: /* @__PURE__ */ n(
59
+ F,
270
60
  {
271
- items: ee,
272
- onChange: oe,
273
- onSubmit: le,
274
- renderLabelExtras: ce,
275
- renderActions: ie,
276
- enableApplyDiscard: P,
277
- enableSearch: E,
278
- enableSelectAll: b,
61
+ items: b,
62
+ onChange: L,
63
+ onSubmit: I,
64
+ renderLabelExtras: N,
65
+ renderActions: v,
66
+ enableApplyDiscard: a,
67
+ enableSearch: u,
68
+ enableSelectAll: d,
279
69
  enableDragDrop: !0,
280
70
  enableCollapse: !0,
281
- enableGlobalCollapse: M,
282
- selectionMode: fe.CASCADE_DOWN,
283
- searchPlaceholder: x("dataTable.searchColumnsPlaceholder"),
71
+ enableGlobalCollapse: m,
72
+ selectionMode: P.CASCADE_DOWN,
73
+ searchPlaceholder: t("dataTable.searchColumnsPlaceholder"),
284
74
  className: "h-full",
285
- initialCollapsedItems: V.current,
75
+ initialCollapsedItems: h,
286
76
  onCollapseChange: (e) => {
287
- V.current = e;
77
+ f.current = e, C(e);
288
78
  }
289
79
  },
290
- X ? "sync-a" : "sync-b"
291
- ) }) : /* @__PURE__ */ v("div", { className: "p-4 text-[13px] text-content-placeholder", children: x("dataTable.loadingColumns") });
80
+ S ? "sync-a" : "sync-b"
81
+ ) }) : /* @__PURE__ */ n("div", { className: "p-4 text-[13px] text-content-placeholder", children: t("dataTable.loadingColumns") });
292
82
  };
293
83
  export {
294
- Me as DataTableColumnList
84
+ Q as DataTableColumnList
295
85
  };