impact-nova 1.6.7 → 1.7.1
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/README.md +15 -0
- package/dist/components/ui/calendar.js +3 -2
- package/dist/components/ui/command-palette/command-palette-context.js +19 -17
- package/dist/components/ui/command-palette/command-palette.d.ts +3 -3
- package/dist/components/ui/command-palette/command-palette.js +193 -145
- package/dist/components/ui/data-table/data-table-column-list.js +107 -103
- package/dist/components/ui/data-table/data-table-column-state.d.ts +16 -0
- package/dist/components/ui/data-table/data-table-column-state.js +29 -0
- package/dist/components/ui/data-table/data-table-constants.d.ts +6 -3
- package/dist/components/ui/data-table/data-table-constants.js +3 -2
- package/dist/components/ui/data-table/data-table-view-menu.d.ts +16 -0
- package/dist/components/ui/data-table/data-table-view-menu.js +133 -0
- package/dist/components/ui/data-table/data-table.js +36 -27
- package/dist/components/ui/data-table/index.d.ts +1 -1
- package/dist/components/ui/data-table/index.js +24 -19
- package/dist/components/ui/dropdown-menu.js +10 -4
- package/dist/components/ui/filter-strip/filter-summary.js +198 -118
- package/dist/components/ui/sheet.js +57 -34
- package/dist/components/ui/tooltip.js +37 -26
- package/dist/i18n/defaultMessages.d.ts +2 -0
- package/dist/i18n/defaultMessages.js +6 -4
- package/dist/i18n/locales/de.js +2 -0
- package/dist/i18n/locales/es.js +2 -0
- package/dist/i18n/locales/hi.js +2 -0
- package/dist/i18n/locales/kn.js +2 -0
- package/dist/impact-nova.css +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +287 -282
- package/dist/llms/index.d.ts +10 -0
- package/dist/llms/index.js +75 -0
- package/dist/llms/rules/accessibility.js +1 -0
- package/dist/llms/rules/ag-grid.js +1 -0
- package/dist/llms/rules/best-practices.js +1 -0
- package/dist/llms/rules/command-palette.js +1 -0
- package/dist/llms/rules/installation.js +1 -0
- package/dist/llms/rules/migration.js +1 -0
- package/dist/llms/rules/real-world-patterns.js +1 -0
- package/dist/llms/rules/requirements.js +1 -0
- package/dist/llms/rules/troubleshooting.js +1 -0
- package/package.json +6 -2
- package/dist/components/ui/data-table/data-table-view-options.d.ts +0 -8
- package/dist/components/ui/data-table/data-table-view-options.js +0 -97
|
@@ -1,89 +1,82 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { useDataTable as
|
|
4
|
-
import { NestedList as
|
|
5
|
-
import { SelectionMode as
|
|
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:
|
|
15
|
-
showSearch:
|
|
16
|
-
showSelectAll:
|
|
17
|
-
showCollapse:
|
|
9
|
+
enableApplyDiscard: b = !1,
|
|
10
|
+
showSearch: R = !0,
|
|
11
|
+
showSelectAll: w = !0,
|
|
12
|
+
showCollapse: L = !0
|
|
18
13
|
}) => {
|
|
19
|
-
const { gridApi:
|
|
20
|
-
if (!
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
let
|
|
26
|
-
if (
|
|
27
|
-
const
|
|
28
|
-
return
|
|
29
|
-
id:
|
|
30
|
-
label:
|
|
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
|
-
},
|
|
29
|
+
}, S.set(r, s), g.push(s), s;
|
|
35
30
|
};
|
|
36
|
-
let
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
if (!
|
|
40
|
-
let
|
|
41
|
-
if (
|
|
42
|
-
if (
|
|
43
|
-
const
|
|
44
|
-
if (
|
|
45
|
-
|
|
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 (!
|
|
42
|
+
if (!r || r.trim() === "")
|
|
48
43
|
return;
|
|
49
|
-
const
|
|
44
|
+
const s = !t.hide, f = {
|
|
50
45
|
id: t.colId,
|
|
51
|
-
label:
|
|
52
|
-
checked:
|
|
46
|
+
label: r,
|
|
47
|
+
checked: s
|
|
53
48
|
};
|
|
54
|
-
t.pinned ? (
|
|
55
|
-
const
|
|
56
|
-
|
|
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
|
|
59
|
-
let
|
|
60
|
-
for (const
|
|
61
|
-
|
|
62
|
-
return
|
|
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
|
-
|
|
65
|
-
const
|
|
66
|
-
|
|
59
|
+
k(c), k(e);
|
|
60
|
+
const y = [];
|
|
61
|
+
c.length > 0 && y.push({
|
|
67
62
|
id: "root-frozen",
|
|
68
|
-
label:
|
|
69
|
-
checked:
|
|
70
|
-
children:
|
|
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 &&
|
|
68
|
+
}), e.length > 0 && y.push({
|
|
74
69
|
id: "root-scrollable",
|
|
75
|
-
label:
|
|
76
|
-
checked:
|
|
70
|
+
label: d("dataTable.scrollableColumns"),
|
|
71
|
+
checked: I > 0 && x === I,
|
|
77
72
|
children: e,
|
|
78
73
|
category: "structure",
|
|
79
74
|
isDragDisabled: !0
|
|
80
|
-
}),
|
|
81
|
-
}, [
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
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
|
-
]
|
|
97
|
-
|
|
89
|
+
];
|
|
90
|
+
let o = null;
|
|
91
|
+
const u = () => {
|
|
92
|
+
o && clearTimeout(o), o = setTimeout(() => {
|
|
93
|
+
o = null, D();
|
|
94
|
+
}, 150);
|
|
98
95
|
};
|
|
99
|
-
return
|
|
100
|
-
clearTimeout(o),
|
|
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
|
-
}, [
|
|
103
|
-
const
|
|
104
|
-
const
|
|
105
|
-
|
|
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 &&
|
|
104
|
+
e.children && o(e.children, "left");
|
|
108
105
|
return;
|
|
109
106
|
}
|
|
110
107
|
if (e.id === "root-scrollable") {
|
|
111
|
-
e.children &&
|
|
108
|
+
e.children && o(e.children, null);
|
|
112
109
|
return;
|
|
113
110
|
}
|
|
114
|
-
e.category === "group" || e.children && e.children.length > 0 ? e.children &&
|
|
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:
|
|
113
|
+
pinned: c,
|
|
117
114
|
hide: !e.checked
|
|
118
115
|
});
|
|
119
116
|
});
|
|
120
117
|
};
|
|
121
|
-
return
|
|
122
|
-
}, [
|
|
123
|
-
if (!
|
|
124
|
-
|
|
125
|
-
const
|
|
126
|
-
|
|
127
|
-
|
|
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
|
-
|
|
134
|
+
m.current = !1;
|
|
131
135
|
}, 300);
|
|
132
|
-
}, [
|
|
133
|
-
|
|
134
|
-
}, [
|
|
135
|
-
|
|
136
|
-
}, [
|
|
137
|
-
return
|
|
138
|
-
|
|
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:
|
|
141
|
-
onChange:
|
|
142
|
-
onSubmit:
|
|
143
|
-
enableApplyDiscard:
|
|
144
|
-
enableSearch:
|
|
145
|
-
enableSelectAll:
|
|
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:
|
|
149
|
-
selectionMode:
|
|
150
|
-
searchPlaceholder:
|
|
152
|
+
enableGlobalCollapse: L,
|
|
153
|
+
selectionMode: H.CASCADE_DOWN,
|
|
154
|
+
searchPlaceholder: d("dataTable.searchColumnsPlaceholder"),
|
|
151
155
|
className: "h-full"
|
|
152
156
|
}
|
|
153
|
-
) }) : /* @__PURE__ */
|
|
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
|
|
3
|
-
*
|
|
4
|
-
*
|
|
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";
|
|
@@ -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
|
|
3
|
-
import { AgGridWrapper as
|
|
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), [
|
|
31
|
-
l.current = Math.max(0, l.current +
|
|
32
|
-
}, []), b = A((
|
|
33
|
-
d(
|
|
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
|
-
}[
|
|
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:
|
|
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":
|
|
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:
|
|
78
|
-
} = P(), {
|
|
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[
|
|
81
|
-
}), [a,
|
|
88
|
+
formatType: w[i]
|
|
89
|
+
}), [a, i]);
|
|
82
90
|
_(() => {
|
|
83
91
|
r?.resetRowHeights();
|
|
84
92
|
}, [d, r]), _(() => {
|
|
85
93
|
if (r) {
|
|
86
|
-
const
|
|
94
|
+
const n = r.getGridOption("context") || {};
|
|
87
95
|
r.setGridOption("context", {
|
|
88
|
-
...
|
|
89
|
-
formatType: w[
|
|
96
|
+
...n,
|
|
97
|
+
formatType: w[i]
|
|
90
98
|
}), r.refreshCells({ force: !0 });
|
|
91
99
|
}
|
|
92
|
-
}, [
|
|
93
|
-
const
|
|
94
|
-
e(
|
|
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
|
-
|
|
113
|
+
E,
|
|
107
114
|
{
|
|
108
|
-
...
|
|
109
|
-
columnDefs:
|
|
110
|
-
rowHeight:
|
|
111
|
-
onGridReady:
|
|
112
|
-
context:
|
|
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
|
]
|