impact-nova 1.6.7 → 1.7.0

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 (29) hide show
  1. package/dist/components/ui/calendar.js +3 -2
  2. package/dist/components/ui/command-palette/command-palette.d.ts +3 -3
  3. package/dist/components/ui/command-palette/command-palette.js +193 -145
  4. package/dist/components/ui/data-table/data-table-column-list.js +107 -103
  5. package/dist/components/ui/data-table/data-table-column-state.d.ts +16 -0
  6. package/dist/components/ui/data-table/data-table-column-state.js +29 -0
  7. package/dist/components/ui/data-table/data-table-constants.d.ts +6 -3
  8. package/dist/components/ui/data-table/data-table-constants.js +3 -2
  9. package/dist/components/ui/data-table/data-table-view-menu.d.ts +16 -0
  10. package/dist/components/ui/data-table/data-table-view-menu.js +133 -0
  11. package/dist/components/ui/data-table/data-table.js +36 -27
  12. package/dist/components/ui/data-table/index.d.ts +1 -1
  13. package/dist/components/ui/data-table/index.js +24 -19
  14. package/dist/components/ui/dropdown-menu.js +10 -4
  15. package/dist/components/ui/filter-strip/filter-summary.js +198 -118
  16. package/dist/components/ui/sheet.js +57 -34
  17. package/dist/components/ui/tooltip.js +37 -26
  18. package/dist/i18n/defaultMessages.d.ts +2 -0
  19. package/dist/i18n/defaultMessages.js +6 -4
  20. package/dist/i18n/locales/de.js +2 -0
  21. package/dist/i18n/locales/es.js +2 -0
  22. package/dist/i18n/locales/hi.js +2 -0
  23. package/dist/i18n/locales/kn.js +2 -0
  24. package/dist/impact-nova.css +1 -1
  25. package/dist/index.d.ts +2 -2
  26. package/dist/index.js +287 -282
  27. package/package.json +1 -1
  28. package/dist/components/ui/data-table/data-table-view-options.d.ts +0 -8
  29. package/dist/components/ui/data-table/data-table-view-options.js +0 -97
@@ -1,89 +1,82 @@
1
- import { jsx as R } from "react/jsx-runtime";
2
- import { useState as j, useRef as w, useCallback as p, useEffect as A } from "react";
3
- import { useDataTable as B } from "./data-table-context.js";
4
- import { NestedList as H } from "../nested-list/nested-list.js";
5
- import { SelectionMode as J } from "../types/nested-list.types.js";
1
+ import { jsx as M } from "react/jsx-runtime";
2
+ import { useState as z, useRef as P, useCallback as h, useEffect as _ } from "react";
3
+ import { useDataTable as q } from "./data-table-context.js";
4
+ import { NestedList as B } from "../nested-list/nested-list.js";
5
+ import { SelectionMode as H } from "../types/nested-list.types.js";
6
+ import { mergePartialOrderedColumnState as J } from "./data-table-column-state.js";
6
7
  import { useImpactNovaI18n as K } from "../../../i18n/ImpactNovaI18nContext.js";
7
- function Q(d, I) {
8
- let f = null;
9
- return ((...v) => {
10
- f && clearTimeout(f), f = setTimeout(() => d(...v), I);
11
- });
12
- }
13
8
  const le = ({
14
- enableApplyDiscard: d = !1,
15
- showSearch: I = !0,
16
- showSelectAll: f = !0,
17
- showCollapse: v = !0
9
+ enableApplyDiscard: b = !1,
10
+ showSearch: R = !0,
11
+ showSelectAll: w = !0,
12
+ showCollapse: L = !0
18
13
  }) => {
19
- const { gridApi: r } = B(), { t: h } = K(), [F, x] = j([]), [U, V] = j(!1), S = w(!1), W = w(/* @__PURE__ */ new Map()), g = p(() => {
20
- if (!r || S.current) return;
21
- const o = r.getColumnState(), n = new Map(o.map((t) => [t.colId, t]));
22
- W.current = n;
23
- const s = r.getColumns() || [], i = new Map(s.map((t) => [t.getColId(), t])), u = [], e = [], y = /* @__PURE__ */ new Map(), T = (t, c) => {
24
- const l = t.getGroupId();
25
- let a = y.get(l);
26
- if (a) return a;
27
- const m = t.getOriginalParent(), b = m ? T(m, c).children : c, D = t.getColGroupDef();
28
- return a = {
29
- id: l,
30
- label: D?.headerName || l,
14
+ const { gridApi: l } = q(), { t: d } = K(), [j, N] = z([]), [A, F] = z(!1), m = P(!1), U = P(/* @__PURE__ */ new Map()), D = h(() => {
15
+ if (!l || m.current) return;
16
+ const n = l.getColumnState(), a = new Map(n.map((t) => [t.colId, t]));
17
+ U.current = a;
18
+ const o = l.getColumns() || [], u = new Map(o.map((t) => [t.getColId(), t])), c = [], e = [], S = /* @__PURE__ */ new Map(), T = (t, i) => {
19
+ const r = t.getGroupId();
20
+ let s = S.get(r);
21
+ if (s) return s;
22
+ const f = t.getOriginalParent(), g = f ? T(f, i).children : i, C = t.getColGroupDef();
23
+ return s = {
24
+ id: r,
25
+ label: C?.headerName || r,
31
26
  checked: !0,
32
27
  children: [],
33
28
  category: "group"
34
- }, y.set(l, a), b.push(a), a;
29
+ }, S.set(r, s), g.push(s), s;
35
30
  };
36
- let k = 0, L = 0, G = 0, P = 0;
37
- o.forEach((t) => {
38
- const c = i.get(t.colId);
39
- if (!c) return;
40
- let l = r.getDisplayNameForColumn(c, "header");
41
- if (l === "") return;
42
- if (l == null) {
43
- const E = c.getColDef();
44
- if (E.headerName === "") return;
45
- l = E.headerName || E.field || t.colId;
31
+ let v = 0, O = 0, I = 0, x = 0;
32
+ n.forEach((t) => {
33
+ const i = u.get(t.colId);
34
+ if (!i) return;
35
+ let r = l.getDisplayNameForColumn(i, "header");
36
+ if (r === "") return;
37
+ if (r == null) {
38
+ const G = i.getColDef();
39
+ if (G.headerName === "") return;
40
+ r = G.headerName || G.field || t.colId;
46
41
  }
47
- if (!l || l.trim() === "")
42
+ if (!r || r.trim() === "")
48
43
  return;
49
- const a = !t.hide, m = {
44
+ const s = !t.hide, f = {
50
45
  id: t.colId,
51
- label: l,
52
- checked: a
46
+ label: r,
47
+ checked: s
53
48
  };
54
- t.pinned ? (k++, a && L++) : (G++, a && P++);
55
- const b = t.pinned ? u : e, D = c.getOriginalParent();
56
- D?.getColGroupDef().children ? T(D, b).children.push(m) : b.push(m);
49
+ t.pinned ? (v++, s && O++) : (I++, s && x++);
50
+ const g = t.pinned ? c : e, C = i.getOriginalParent();
51
+ C?.getColGroupDef().children ? T(C, g).children.push(f) : g.push(f);
57
52
  });
58
- const M = (t) => {
59
- let c = t.length > 0;
60
- for (const l of t)
61
- l.children && (l.checked = M(l.children)), l.checked || (c = !1);
62
- return c;
53
+ const k = (t) => {
54
+ let i = t.length > 0;
55
+ for (const r of t)
56
+ r.children && (r.checked = k(r.children)), r.checked || (i = !1);
57
+ return i;
63
58
  };
64
- M(u), M(e);
65
- const N = [];
66
- u.length > 0 && N.push({
59
+ k(c), k(e);
60
+ const y = [];
61
+ c.length > 0 && y.push({
67
62
  id: "root-frozen",
68
- label: h("dataTable.frozenColumns"),
69
- checked: k > 0 && L === k,
70
- children: u,
63
+ label: d("dataTable.frozenColumns"),
64
+ checked: v > 0 && O === v,
65
+ children: c,
71
66
  category: "structure",
72
67
  isDragDisabled: !0
73
- }), e.length > 0 && N.push({
68
+ }), e.length > 0 && y.push({
74
69
  id: "root-scrollable",
75
- label: h("dataTable.scrollableColumns"),
76
- checked: G > 0 && P === G,
70
+ label: d("dataTable.scrollableColumns"),
71
+ checked: I > 0 && x === I,
77
72
  children: e,
78
73
  category: "structure",
79
74
  isDragDisabled: !0
80
- }), x(N), V(!0);
81
- }, [r, h]), z = w(null);
82
- A(() => {
83
- z.current = Q(g, 150);
84
- }, [g]), A(() => {
85
- if (!r) return;
86
- const o = setTimeout(() => g(), 0), n = [
75
+ }), N(y), F(!0);
76
+ }, [l, d]);
77
+ _(() => {
78
+ if (!l) return;
79
+ const n = setTimeout(() => D(), 0), a = [
87
80
  "columnVisible",
88
81
  "columnPinned",
89
82
  "columnMoved",
@@ -93,64 +86,75 @@ const le = ({
93
86
  "columnRowGroupChanged",
94
87
  "columnPivotModeChanged",
95
88
  "columnEverythingChanged"
96
- ], s = () => {
97
- z.current?.();
89
+ ];
90
+ let o = null;
91
+ const u = () => {
92
+ o && clearTimeout(o), o = setTimeout(() => {
93
+ o = null, D();
94
+ }, 150);
98
95
  };
99
- return r.isDestroyed() || n.forEach((i) => r.addEventListener(i, s)), () => {
100
- clearTimeout(o), r.isDestroyed() || n.forEach((i) => r.removeEventListener(i, s));
96
+ return l.isDestroyed() || a.forEach((c) => l.addEventListener(c, u)), () => {
97
+ clearTimeout(n), o && clearTimeout(o), l.isDestroyed() || a.forEach((c) => l.removeEventListener(c, u));
101
98
  };
102
- }, [r, g]);
103
- const O = p((o) => {
104
- const n = [], s = (i, u) => {
105
- i.forEach((e) => {
99
+ }, [l, D]);
100
+ const E = h((n) => {
101
+ const a = [], o = (u, c) => {
102
+ u.forEach((e) => {
106
103
  if (e.id === "root-frozen") {
107
- e.children && s(e.children, "left");
104
+ e.children && o(e.children, "left");
108
105
  return;
109
106
  }
110
107
  if (e.id === "root-scrollable") {
111
- e.children && s(e.children, null);
108
+ e.children && o(e.children, null);
112
109
  return;
113
110
  }
114
- e.category === "group" || e.children && e.children.length > 0 ? e.children && s(e.children, u) : r?.getColumn(e.id) && n.push({
111
+ e.category === "group" || e.children && e.children.length > 0 ? e.children && o(e.children, c) : l?.getColumn(e.id) && a.push({
115
112
  colId: e.id,
116
- pinned: u,
113
+ pinned: c,
117
114
  hide: !e.checked
118
115
  });
119
116
  });
120
117
  };
121
- return s(o, null), n;
122
- }, [r]), C = p((o) => {
123
- if (!r) return;
124
- S.current = !0;
125
- const n = O(o);
126
- n.length > 0 && r.applyColumnState({
127
- state: n,
118
+ return o(n, null), a;
119
+ }, [l]), p = h((n) => {
120
+ if (!l) return;
121
+ m.current = !0;
122
+ const a = E(n);
123
+ if (a.length === 0) {
124
+ setTimeout(() => {
125
+ m.current = !1;
126
+ }, 300);
127
+ return;
128
+ }
129
+ const o = l.getColumnState(), u = J(o, a);
130
+ l.applyColumnState({
131
+ state: u,
128
132
  applyOrder: !0
129
133
  }), setTimeout(() => {
130
- S.current = !1;
134
+ m.current = !1;
131
135
  }, 300);
132
- }, [r, O]), _ = p((o) => {
133
- C(o);
134
- }, [C]), q = p((o) => {
135
- d || C(o), x(o);
136
- }, [d, C]);
137
- return U ? /* @__PURE__ */ R("div", { className: "flex flex-col h-full bg-canvas-elevated", children: /* @__PURE__ */ R(
138
- H,
136
+ }, [l, E]), V = h((n) => {
137
+ p(n);
138
+ }, [p]), W = h((n) => {
139
+ b || p(n), N(n);
140
+ }, [b, p]);
141
+ return A ? /* @__PURE__ */ M("div", { className: "flex flex-col h-full bg-canvas-elevated", children: /* @__PURE__ */ M(
142
+ B,
139
143
  {
140
- items: F,
141
- onChange: q,
142
- onSubmit: _,
143
- enableApplyDiscard: d,
144
- enableSearch: I,
145
- enableSelectAll: f,
144
+ items: j,
145
+ onChange: W,
146
+ onSubmit: V,
147
+ enableApplyDiscard: b,
148
+ enableSearch: R,
149
+ enableSelectAll: w,
146
150
  enableDragDrop: !0,
147
151
  enableCollapse: !0,
148
- enableGlobalCollapse: v,
149
- selectionMode: J.CASCADE_DOWN,
150
- searchPlaceholder: h("dataTable.searchColumnsPlaceholder"),
152
+ enableGlobalCollapse: L,
153
+ selectionMode: H.CASCADE_DOWN,
154
+ searchPlaceholder: d("dataTable.searchColumnsPlaceholder"),
151
155
  className: "h-full"
152
156
  }
153
- ) }) : /* @__PURE__ */ R("div", { className: "p-4 text-[13px] text-content-placeholder", children: h("dataTable.loadingColumns") });
157
+ ) }) : /* @__PURE__ */ M("div", { className: "p-4 text-[13px] text-content-placeholder", children: d("dataTable.loadingColumns") });
154
158
  };
155
159
  export {
156
160
  le as DataTableColumnList
@@ -0,0 +1,16 @@
1
+ import { ColumnState } from 'ag-grid-community';
2
+ /**
3
+ * AG Grid’s documented flow for programmatic column changes is:
4
+ * `getColumnState()` → adjust the fields you care about (order, hide, pinned, …) →
5
+ * `applyColumnState({ state, applyOrder: true })`.
6
+ *
7
+ * The column-picker UI only edits visibility, pinning, and order for columns it lists.
8
+ * This helper merges that **partial** ordered slice with the existing full state so every
9
+ * column stays represented (sort index, width, flex, pivot state, etc.) and `applyOrder`
10
+ * receives a complete ordered array — as intended for `applyColumnState`, without relying
11
+ * on incidental merge behaviour inside the grid.
12
+ *
13
+ * Complexity: O(N) time, O(N) extra map/set memory for one pass over `prevState` and
14
+ * `partial` (unavoidable when applying global order for N columns).
15
+ */
16
+ export declare function mergePartialOrderedColumnState(prevState: ColumnState[], partial: ColumnState[]): ColumnState[];
@@ -0,0 +1,29 @@
1
+ function f(e, t) {
2
+ if (t.length === 0)
3
+ return e;
4
+ const c = /* @__PURE__ */ new Map();
5
+ for (let n = 0; n < e.length; n++) {
6
+ const o = e[n];
7
+ c.set(o.colId, o);
8
+ }
9
+ const l = /* @__PURE__ */ new Set();
10
+ for (let n = 0; n < t.length; n++)
11
+ l.add(t[n].colId);
12
+ let d = 0;
13
+ for (let n = 0; n < e.length; n++)
14
+ l.has(e[n].colId) || d++;
15
+ const s = new Array(t.length + d);
16
+ let g = 0;
17
+ for (let n = 0; n < t.length; n++) {
18
+ const o = t[n], i = c.get(o.colId);
19
+ s[g++] = i !== void 0 ? Object.assign({}, i, o) : Object.assign({}, o);
20
+ }
21
+ for (let n = 0; n < e.length; n++) {
22
+ const o = e[n];
23
+ l.has(o.colId) || (s[g++] = o);
24
+ }
25
+ return s;
26
+ }
27
+ export {
28
+ f as mergePartialOrderedColumnState
29
+ };
@@ -1,6 +1,9 @@
1
1
  /**
2
- * Minimum height (px) for the `DataTableContent` region (grid + sheet portal host).
3
- * The scoped settings sheet portals into `absolute inset-0` over this area; the host must be
4
- * at least this tall or the overlay is clipped and cannot show a usable panel.
2
+ * Minimum height (px) for the **scoped sheet portal host** (`sheetTarget`), not the grid
3
+ * flex child. Applied only while a sheet is open so the overlay can extend to this height
4
+ * without resizing the grid’s own layout box (avoids unnecessary layout-driven grid
5
+ * refreshes on sheet open/close).
5
6
  */
6
7
  export declare const DATA_TABLE_SCOPED_SHEET_HOST_MIN_HEIGHT_PX = 400;
8
+ /** DOM class toggled imperatively for viewport-fill table shell (styles in `src/index.scss`). */
9
+ export declare const TABLE_VIEWPORT_SHELL_EXPANDED_CLASS: "table-viewport-shell--expanded";
@@ -1,4 +1,5 @@
1
- const _ = 400;
1
+ const _ = 400, E = "table-viewport-shell--expanded";
2
2
  export {
3
- _ as DATA_TABLE_SCOPED_SHEET_HOST_MIN_HEIGHT_PX
3
+ _ as DATA_TABLE_SCOPED_SHEET_HOST_MIN_HEIGHT_PX,
4
+ E as TABLE_VIEWPORT_SHELL_EXPANDED_CLASS
4
5
  };
@@ -0,0 +1,16 @@
1
+ import { DropdownMenuTrigger } from '../dropdown-menu';
2
+ import * as React from "react";
3
+ export declare const DataTableViewMenuTrigger: {
4
+ ({ asChild, children, ...props }: React.ComponentPropsWithoutRef<typeof DropdownMenuTrigger>): import("react/jsx-runtime").JSX.Element;
5
+ displayName: string;
6
+ };
7
+ export declare const DataTableViewMenuContent: React.ForwardRefExoticComponent<Omit<Omit<import('@radix-ui/react-dropdown-menu').DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & {
8
+ portalled?: boolean;
9
+ } & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
10
+ export declare const DataTableViewMenuSettingsItem: () => import("react/jsx-runtime").JSX.Element;
11
+ export declare const DataTableViewMenuDensity: () => import("react/jsx-runtime").JSX.Element;
12
+ export interface DataTableViewMenuViewportExpandProps {
13
+ expanded: boolean;
14
+ onExpandedChange: (expanded: boolean) => void;
15
+ }
16
+ export declare const DataTableViewMenuViewportExpand: ({ expanded, onExpandedChange, }: DataTableViewMenuViewportExpandProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,133 @@
1
+ import { jsx as t, jsxs as o } from "react/jsx-runtime";
2
+ import * as p from "react";
3
+ import { DropdownMenuContent as m, DropdownMenuSub as d, DropdownMenuSubTrigger as u, DropdownMenuSubContent as g, DropdownMenuRadioGroup as f, DropdownMenuRadioItem as l, DropdownMenuItem as c, DropdownMenuTrigger as h } from "../dropdown-menu.js";
4
+ import { Button as x } from "../button.js";
5
+ import { cn as b } from "../../../lib/utils.js";
6
+ import { Density as T, Stack as D, StackCompact as N, StackComfort as w, Settings as C, ThreeDots as M, Collapse as S, Expand as v } from "../../../icons/index.js";
7
+ import { useDataTable as P } from "./data-table-context.js";
8
+ import { DataTableSheetTrigger as y } from "./data-table-sheet.js";
9
+ import { useImpactNovaI18n as r } from "../../../i18n/ImpactNovaI18nContext.js";
10
+ const k = ({
11
+ asChild: a,
12
+ children: n,
13
+ ...s
14
+ }) => {
15
+ const { t: e } = r(), i = a ?? !!n;
16
+ return /* @__PURE__ */ t(h, { asChild: i, ...s, children: i ? n : /* @__PURE__ */ o(x, { variant: "secondary", size: "icon", "aria-label": e("dataTable.more"), children: [
17
+ /* @__PURE__ */ t(M, { size: "sm" }),
18
+ /* @__PURE__ */ t("span", { className: "sr-only", children: e("dataTable.openMenu") })
19
+ ] }) });
20
+ };
21
+ k.displayName = "DataTableViewMenuTrigger";
22
+ const z = p.forwardRef(({ className: a, align: n = "end", ...s }, e) => /* @__PURE__ */ t(
23
+ m,
24
+ {
25
+ ref: e,
26
+ align: n,
27
+ className: b("w-[240px] flex flex-col gap-[2px]", a),
28
+ ...s
29
+ }
30
+ ));
31
+ z.displayName = "DataTableViewMenuContent";
32
+ const G = () => {
33
+ const { t: a } = r();
34
+ return /* @__PURE__ */ t(y, { asChild: !0, children: /* @__PURE__ */ t(
35
+ c,
36
+ {
37
+ className: "flex cursor-pointer gap-2",
38
+ onClick: (n) => n.stopPropagation(),
39
+ onSelect: (n) => n.stopPropagation(),
40
+ children: /* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
41
+ /* @__PURE__ */ t(C, { size: "sm", className: "text-content-muted" }),
42
+ /* @__PURE__ */ t("span", { children: a("dataTable.tableSettings") })
43
+ ] })
44
+ }
45
+ ) });
46
+ }, q = () => {
47
+ const { t: a } = r(), { rowHeight: n, setRowHeight: s } = P();
48
+ return /* @__PURE__ */ o(d, { children: [
49
+ /* @__PURE__ */ o(
50
+ u,
51
+ {
52
+ className: "flex items-center gap-2 cursor-pointer",
53
+ onClick: (e) => e.stopPropagation(),
54
+ children: [
55
+ /* @__PURE__ */ t(T, { size: "sm", className: "text-content-muted" }),
56
+ /* @__PURE__ */ t("span", { children: a("dataTable.contentDensity") })
57
+ ]
58
+ }
59
+ ),
60
+ /* @__PURE__ */ t(g, { className: "w-[190px]", children: /* @__PURE__ */ o(
61
+ f,
62
+ {
63
+ value: n,
64
+ onValueChange: (e) => s(e),
65
+ className: "flex flex-col gap-0.5",
66
+ children: [
67
+ /* @__PURE__ */ t(
68
+ l,
69
+ {
70
+ value: "default",
71
+ onClick: (e) => e.stopPropagation(),
72
+ onSelect: (e) => e.stopPropagation(),
73
+ children: /* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
74
+ /* @__PURE__ */ t(D, { size: "sm", className: "text-content-muted" }),
75
+ a("dataTable.densityDefault")
76
+ ] })
77
+ }
78
+ ),
79
+ /* @__PURE__ */ t(
80
+ l,
81
+ {
82
+ value: "compact",
83
+ onClick: (e) => e.stopPropagation(),
84
+ onSelect: (e) => e.stopPropagation(),
85
+ children: /* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
86
+ /* @__PURE__ */ t(N, { size: "sm", className: "text-content-muted" }),
87
+ a("dataTable.densityCompact")
88
+ ] })
89
+ }
90
+ ),
91
+ /* @__PURE__ */ t(
92
+ l,
93
+ {
94
+ value: "comfort",
95
+ onClick: (e) => e.stopPropagation(),
96
+ onSelect: (e) => e.stopPropagation(),
97
+ children: /* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
98
+ /* @__PURE__ */ t(w, { size: "sm", className: "text-content-muted" }),
99
+ a("dataTable.densityComfort")
100
+ ] })
101
+ }
102
+ )
103
+ ]
104
+ }
105
+ ) })
106
+ ] });
107
+ }, F = ({
108
+ expanded: a,
109
+ onExpandedChange: n
110
+ }) => {
111
+ const { t: s } = r();
112
+ return /* @__PURE__ */ t(
113
+ c,
114
+ {
115
+ className: "flex cursor-pointer gap-2",
116
+ onClick: (e) => e.stopPropagation(),
117
+ onSelect: (e) => {
118
+ e.stopPropagation(), n(!a);
119
+ },
120
+ children: /* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
121
+ a ? /* @__PURE__ */ t(S, { size: "sm", className: "text-content-muted" }) : /* @__PURE__ */ t(v, { size: "sm", className: "text-content-muted" }),
122
+ /* @__PURE__ */ t("span", { children: s(a ? "dataTable.tableCollapse" : "dataTable.tableExpand") })
123
+ ] })
124
+ }
125
+ );
126
+ };
127
+ export {
128
+ z as DataTableViewMenuContent,
129
+ q as DataTableViewMenuDensity,
130
+ G as DataTableViewMenuSettingsItem,
131
+ k as DataTableViewMenuTrigger,
132
+ F as DataTableViewMenuViewportExpand
133
+ };
@@ -1,6 +1,6 @@
1
1
  import { jsx as c, jsxs as C } from "react/jsx-runtime";
2
- import { useState as s, useRef as E, useCallback as A, useMemo as H, useEffect as _ } from "react";
3
- import { AgGridWrapper as O } from "../ag-grid-react/index.js";
2
+ import { useState as s, useRef as O, useCallback as A, useMemo as H, useEffect as _ } from "react";
3
+ import { AgGridWrapper as E } from "../ag-grid-react/index.js";
4
4
  import { cn as y } from "../../../lib/utils.js";
5
5
  import { DataTableContext as D, useDataTable as P } from "./data-table-context.js";
6
6
  import { DATA_TABLE_SCOPED_SHEET_HOST_MIN_HEIGHT_PX as F } from "./data-table-constants.js";
@@ -27,15 +27,15 @@ const R = {
27
27
  children: o,
28
28
  className: e
29
29
  }) => {
30
- const [t, d] = s(null), [r, u] = s(null), [n, p] = s("medium"), [f, h] = s("full"), [a, m] = s("default"), [g, x] = s(!1), l = E(0), T = A((S) => {
31
- l.current = Math.max(0, l.current + S), x(l.current > 0);
32
- }, []), b = A((S) => {
33
- d(S);
30
+ const [t, d] = s(null), [r, u] = s(null), [i, p] = s("medium"), [f, h] = s("full"), [a, m] = s("default"), [g, x] = s(!1), l = O(0), T = A((n) => {
31
+ l.current = Math.max(0, l.current + n), x(l.current > 0);
32
+ }, []), b = A((n) => {
33
+ d(n);
34
34
  }, []), v = {
35
35
  small: "12px",
36
36
  medium: "14px",
37
37
  large: "16px"
38
- }[n], i = `${R[a]}px`;
38
+ }[i], S = `${R[a]}px`;
39
39
  return /* @__PURE__ */ c(D.Provider, { value: {
40
40
  gridApi: t,
41
41
  registerApi: b,
@@ -43,7 +43,7 @@ const R = {
43
43
  setSheetTarget: u,
44
44
  scopedSheetOpen: g,
45
45
  registerScopedSheetDepth: T,
46
- fontSize: n,
46
+ fontSize: i,
47
47
  setFontSize: p,
48
48
  numericFormat: f,
49
49
  setNumericFormat: h,
@@ -56,7 +56,7 @@ const R = {
56
56
  className: y("flex flex-col w-full min-h-0 rounded-[inherit]", e),
57
57
  style: {
58
58
  "--ag-font-size": v,
59
- "--ag-row-height": i
59
+ "--ag-row-height": S
60
60
  },
61
61
  children: o
62
62
  }
@@ -74,24 +74,32 @@ function X(o) {
74
74
  rowHeight: d,
75
75
  gridApi: r,
76
76
  scopedSheetOpen: u,
77
- numericFormat: n
78
- } = P(), { className: p, onGridReady: f, rowHeight: h, context: a, columnDefs: m, ...g } = o, x = R[d], l = h ?? x, T = H(() => G(m), [m]), b = H(() => ({
77
+ numericFormat: i
78
+ } = P(), {
79
+ className: p,
80
+ onGridReady: f,
81
+ rowHeight: h,
82
+ context: a,
83
+ columnDefs: m,
84
+ maintainColumnOrder: g = !0,
85
+ ...x
86
+ } = o, l = R[d], T = h ?? l, b = H(() => G(m), [m]), v = H(() => ({
79
87
  ...a,
80
- formatType: w[n]
81
- }), [a, n]);
88
+ formatType: w[i]
89
+ }), [a, i]);
82
90
  _(() => {
83
91
  r?.resetRowHeights();
84
92
  }, [d, r]), _(() => {
85
93
  if (r) {
86
- const i = r.getGridOption("context") || {};
94
+ const n = r.getGridOption("context") || {};
87
95
  r.setGridOption("context", {
88
- ...i,
89
- formatType: w[n]
96
+ ...n,
97
+ formatType: w[i]
90
98
  }), r.refreshCells({ force: !0 });
91
99
  }
92
- }, [n, r]);
93
- const v = (i) => {
94
- e(i.api), f?.(i);
100
+ }, [i, r]);
101
+ const S = (n) => {
102
+ e(n.api), f?.(n);
95
103
  };
96
104
  return /* @__PURE__ */ C(
97
105
  "div",
@@ -100,23 +108,24 @@ function X(o) {
100
108
  "relative flex-1 min-h-0 w-full bg-canvas-elevated rounded-b-[inherit] grid-rounded-bottom",
101
109
  p
102
110
  ),
103
- style: u ? { minHeight: F } : void 0,
104
111
  children: [
105
112
  /* @__PURE__ */ c(
106
- O,
113
+ E,
107
114
  {
108
- ...g,
109
- columnDefs: T,
110
- rowHeight: l,
111
- onGridReady: v,
112
- context: b
115
+ ...x,
116
+ columnDefs: b,
117
+ rowHeight: T,
118
+ onGridReady: S,
119
+ context: v,
120
+ maintainColumnOrder: g
113
121
  }
114
122
  ),
115
123
  /* @__PURE__ */ c(
116
124
  "div",
117
125
  {
118
126
  ref: t,
119
- className: "absolute inset-0 pointer-events-none z-[39] flex overflow-x-hidden overflow-y-visible"
127
+ className: "absolute inset-0 pointer-events-none z-[39] flex overflow-x-hidden overflow-y-visible",
128
+ style: u ? { minHeight: F } : void 0
120
129
  }
121
130
  )
122
131
  ]
@@ -4,4 +4,4 @@ export * from './data-table-column-list';
4
4
  export * from './data-table-context';
5
5
  export * from './data-table-format-options';
6
6
  export * from './data-table-sheet';
7
- export * from './data-table-view-options';
7
+ export * from './data-table-view-menu';