@1771technologies/lytenyte-pro 1.0.6 → 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,
|
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-
|
|
53
|
-
"@1771technologies/lytenyte-
|
|
54
|
-
"@1771technologies/lytenyte-
|
|
55
|
-
"@1771technologies/lytenyte-
|
|
56
|
-
"@1771technologies/lytenyte-
|
|
57
|
-
"@1771technologies/lytenyte-
|
|
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",
|