@1771technologies/lytenyte-pro 1.0.5 → 1.0.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.
|
@@ -5,7 +5,7 @@ export function useColumnManager({ grid, query }) {
|
|
|
5
5
|
const filteredColumns = useMemo(() => {
|
|
6
6
|
if (!query)
|
|
7
7
|
return columns;
|
|
8
|
-
return columns.filter((c) => (c.name ?? c.id).toLowerCase().includes(query));
|
|
8
|
+
return columns.filter((c) => (c.name ?? c.id).toLowerCase().includes(query.toLowerCase()));
|
|
9
9
|
}, [columns, query]);
|
|
10
10
|
const items = useTreeViewPaths(filteredColumns, true);
|
|
11
11
|
const branchLookup = useMemo(() => {
|
|
@@ -33,5 +33,6 @@ export interface UseFilterTreeArgs<T> {
|
|
|
33
33
|
treeItemHeight?: number;
|
|
34
34
|
pivotMode?: boolean;
|
|
35
35
|
applyChangesImmediately?: boolean;
|
|
36
|
+
query?: string;
|
|
36
37
|
}
|
|
37
|
-
export declare function useFilterTree<T>({ grid, column, treeItemHeight, pivotMode, applyChangesImmediately, }: UseFilterTreeArgs<T>): UseTreeFilterReturn<T>;
|
|
38
|
+
export declare function useFilterTree<T>({ grid, column, treeItemHeight, pivotMode, applyChangesImmediately, query, }: UseFilterTreeArgs<T>): UseTreeFilterReturn<T>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useEffect, useMemo, useState } from "react";
|
|
2
2
|
import { useVirtualizedTree } from "../../tree-view/virtualized/use-virtualized-tree";
|
|
3
3
|
import { useEvent } from "@1771technologies/lytenyte-react-hooks";
|
|
4
|
-
export function useFilterTree({ grid, column, treeItemHeight = 24, pivotMode, applyChangesImmediately = false, }) {
|
|
4
|
+
export function useFilterTree({ grid, column, treeItemHeight = 24, pivotMode, applyChangesImmediately = false, query, }) {
|
|
5
5
|
const [items, setItems] = useState([]);
|
|
6
6
|
const [expansions, onExpansionChange] = useState({});
|
|
7
7
|
const [loading, setLoading] = useState(false);
|
|
@@ -41,9 +41,14 @@ export function useFilterTree({ grid, column, treeItemHeight = 24, pivotMode, ap
|
|
|
41
41
|
useEffect(() => {
|
|
42
42
|
fetchItems();
|
|
43
43
|
}, [column, fetchItems, rds]);
|
|
44
|
+
const filteredItems = useMemo(() => {
|
|
45
|
+
if (!query)
|
|
46
|
+
return items;
|
|
47
|
+
return items.filter((c) => c.label.toLowerCase().includes(query.toLowerCase()));
|
|
48
|
+
}, [items, query]);
|
|
44
49
|
const itemsWithSelectAll = useMemo(() => {
|
|
45
|
-
return [{ id: "__LNG__SELECT_ALL", label: "(Select All)", value: "" }, ...
|
|
46
|
-
}, [
|
|
50
|
+
return [{ id: "__LNG__SELECT_ALL", label: "(Select All)", value: "" }, ...filteredItems];
|
|
51
|
+
}, [filteredItems]);
|
|
47
52
|
const virt = useVirtualizedTree({
|
|
48
53
|
itemHeight: treeItemHeight,
|
|
49
54
|
paths: itemsWithSelectAll,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { getNearestRow, getRowIndexFromEl,
|
|
2
|
+
import { getNearestRow, getRowIndexFromEl, SCROLL_WIDTH_VARIABLE_USE, sizeFromCoord, } from "@1771technologies/lytenyte-shared";
|
|
3
3
|
import { useGridRoot } from "../context";
|
|
4
4
|
import { useEffect, useState } from "react";
|
|
5
5
|
import { getTabbables, isHTMLElement } from "@1771technologies/lytenyte-dom-utils";
|
|
@@ -115,17 +115,16 @@ function RowDetailImpl({ row, rowIndex }) {
|
|
|
115
115
|
}, [cx.grid.internal.rowDetailAutoHeightCache, ref?.firstElementChild, rowIndex]);
|
|
116
116
|
const isAuto = cx.grid.state.rowDetailHeight.useValue() === "auto";
|
|
117
117
|
return (_jsx("div", { ref: setRef, role: "gridcell", style: {
|
|
118
|
-
gridColumnStart: "1",
|
|
119
|
-
gridColumnEnd: "2",
|
|
120
|
-
gridRowStart: "1",
|
|
121
|
-
gridRowEnd: "2",
|
|
122
|
-
marginTop: rowHeight,
|
|
123
118
|
pointerEvents: "all",
|
|
119
|
+
position: "absolute",
|
|
120
|
+
left: 0,
|
|
121
|
+
width: SCROLL_WIDTH_VARIABLE_USE,
|
|
124
122
|
}, children: _jsx("div", { tabIndex: -1, "data-ln-row-detail": true, style: {
|
|
125
123
|
position: "sticky",
|
|
126
124
|
right: rtl ? "0px" : undefined,
|
|
127
125
|
left: rtl ? undefined : "0px",
|
|
128
|
-
|
|
126
|
+
marginTop: rowHeight,
|
|
127
|
+
width: cx.grid.state.viewportWidthInner.useValue(),
|
|
129
128
|
height: isAuto ? "auto" : height,
|
|
130
129
|
}, children: _jsx(Renderer, { grid: cx.grid, row: row, rowIndex: rowIndex }) }) }));
|
|
131
130
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@1771technologies/lytenyte-pro",
|
|
3
3
|
"description": "Blazingly fast headless React data grid with 100s of features.",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.7",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "COMMERCIAL",
|
|
7
7
|
"files": [
|
|
@@ -49,12 +49,12 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@1771technologies/atom": "^1.0.2",
|
|
52
|
-
"@1771technologies/lytenyte-core": "1.0.
|
|
53
|
-
"@1771technologies/lytenyte-shared": "1.0.
|
|
54
|
-
"@1771technologies/lytenyte-
|
|
55
|
-
"@1771technologies/lytenyte-
|
|
56
|
-
"@1771technologies/lytenyte-
|
|
57
|
-
"@1771technologies/lytenyte-react-hooks": "1.0.
|
|
52
|
+
"@1771technologies/lytenyte-core": "1.0.7",
|
|
53
|
+
"@1771technologies/lytenyte-shared": "1.0.7",
|
|
54
|
+
"@1771technologies/lytenyte-dom-utils": "1.0.7",
|
|
55
|
+
"@1771technologies/lytenyte-js-utils": "1.0.7",
|
|
56
|
+
"@1771technologies/lytenyte-dragon": "1.0.7",
|
|
57
|
+
"@1771technologies/lytenyte-react-hooks": "1.0.7"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
60
|
"react": "^18.0.0 || ^19.0.0",
|