ydb-ui-components 4.3.0 → 4.3.2
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/build/cjs/components/NavigationTree/NavigationTree.d.ts +1 -1
- package/build/cjs/components/NavigationTree/NavigationTree.js +2 -2
- package/build/cjs/components/NavigationTree/types.d.ts +1 -1
- package/build/esm/components/NavigationTree/NavigationTree.d.ts +1 -1
- package/build/esm/components/NavigationTree/NavigationTree.js +2 -2
- package/build/esm/components/NavigationTree/types.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { NavigationTreeProps } from './types';
|
|
3
3
|
export type { NavigationTreeProps };
|
|
4
|
-
export declare function NavigationTree({ rootState: partialRootState, fetchPath, getActions, renderAdditionalNodeElements, activePath, onActivePathUpdate, cache, virtualize, }: NavigationTreeProps): JSX.Element;
|
|
4
|
+
export declare function NavigationTree({ rootState: partialRootState, fetchPath, getActions, renderAdditionalNodeElements, activePath, onActionsOpenToggle, onActivePathUpdate, cache, virtualize, }: NavigationTreeProps): JSX.Element;
|
|
@@ -21,13 +21,13 @@ const renderServiceNode = (node) => {
|
|
|
21
21
|
}
|
|
22
22
|
return (0, jsx_runtime_1.jsx)(EmptyView_1.EmptyView, { level: node.level }, key);
|
|
23
23
|
};
|
|
24
|
-
function NavigationTree({ rootState: partialRootState, fetchPath, getActions, renderAdditionalNodeElements, activePath, onActivePathUpdate, cache = true, virtualize = false, }) {
|
|
24
|
+
function NavigationTree({ rootState: partialRootState, fetchPath, getActions, renderAdditionalNodeElements, activePath, onActionsOpenToggle, onActivePathUpdate, cache = true, virtualize = false, }) {
|
|
25
25
|
const [state, dispatch] = react_1.default.useReducer(state_1.reducer, {
|
|
26
26
|
[partialRootState.path]: (0, state_1.getNodeState)(partialRootState),
|
|
27
27
|
});
|
|
28
28
|
const nodesList = react_1.default.useMemo(() => (0, state_1.selectTreeAsList)(state, partialRootState.path), [partialRootState.path, state]);
|
|
29
29
|
const renderNode = (node) => {
|
|
30
|
-
return ((0, jsx_runtime_1.jsx)(NavigationTreeNode_1.NavigationTreeNode, { state: state, path: node.path, activePath: activePath, fetchPath: fetchPath, dispatch: dispatch, onActivate: onActivePathUpdate, getActions: getActions, renderAdditionalNodeElements: renderAdditionalNodeElements, cache: cache, level: node.level }, node.path));
|
|
30
|
+
return ((0, jsx_runtime_1.jsx)(NavigationTreeNode_1.NavigationTreeNode, { state: state, path: node.path, activePath: activePath, fetchPath: fetchPath, dispatch: dispatch, onActivate: onActivePathUpdate, getActions: getActions, onActionsOpenToggle: onActionsOpenToggle, renderAdditionalNodeElements: renderAdditionalNodeElements, cache: cache, level: node.level }, node.path));
|
|
31
31
|
};
|
|
32
32
|
const renderVirtualizedTree = () => ((0, jsx_runtime_1.jsx)(react_list_1.default, { type: "uniform", length: nodesList.length, useStaticSize: true, itemRenderer: (index) => {
|
|
33
33
|
const node = nodesList[index];
|
|
@@ -36,7 +36,7 @@ export interface NavigationTreeProps<D = any> {
|
|
|
36
36
|
path: string;
|
|
37
37
|
type: NavigationTreeNodeType;
|
|
38
38
|
isOpen: boolean;
|
|
39
|
-
}) =>
|
|
39
|
+
}) => void;
|
|
40
40
|
getActions?: (path: string, type: NavigationTreeNodeType) => DropdownMenuItemMixed<D>[];
|
|
41
41
|
renderAdditionalNodeElements?: (path: string, type: NavigationTreeNodeType) => JSX.Element | undefined;
|
|
42
42
|
activePath?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { NavigationTreeProps } from './types';
|
|
3
3
|
export type { NavigationTreeProps };
|
|
4
|
-
export declare function NavigationTree({ rootState: partialRootState, fetchPath, getActions, renderAdditionalNodeElements, activePath, onActivePathUpdate, cache, virtualize, }: NavigationTreeProps): JSX.Element;
|
|
4
|
+
export declare function NavigationTree({ rootState: partialRootState, fetchPath, getActions, renderAdditionalNodeElements, activePath, onActionsOpenToggle, onActivePathUpdate, cache, virtualize, }: NavigationTreeProps): JSX.Element;
|
|
@@ -17,13 +17,13 @@ const renderServiceNode = (node) => {
|
|
|
17
17
|
}
|
|
18
18
|
return _jsx(EmptyView, { level: node.level }, key);
|
|
19
19
|
};
|
|
20
|
-
export function NavigationTree({ rootState: partialRootState, fetchPath, getActions, renderAdditionalNodeElements, activePath, onActivePathUpdate, cache = true, virtualize = false, }) {
|
|
20
|
+
export function NavigationTree({ rootState: partialRootState, fetchPath, getActions, renderAdditionalNodeElements, activePath, onActionsOpenToggle, onActivePathUpdate, cache = true, virtualize = false, }) {
|
|
21
21
|
const [state, dispatch] = React.useReducer(reducer, {
|
|
22
22
|
[partialRootState.path]: getNodeState(partialRootState),
|
|
23
23
|
});
|
|
24
24
|
const nodesList = React.useMemo(() => selectTreeAsList(state, partialRootState.path), [partialRootState.path, state]);
|
|
25
25
|
const renderNode = (node) => {
|
|
26
|
-
return (_jsx(NavigationTreeNode, { state: state, path: node.path, activePath: activePath, fetchPath: fetchPath, dispatch: dispatch, onActivate: onActivePathUpdate, getActions: getActions, renderAdditionalNodeElements: renderAdditionalNodeElements, cache: cache, level: node.level }, node.path));
|
|
26
|
+
return (_jsx(NavigationTreeNode, { state: state, path: node.path, activePath: activePath, fetchPath: fetchPath, dispatch: dispatch, onActivate: onActivePathUpdate, getActions: getActions, onActionsOpenToggle: onActionsOpenToggle, renderAdditionalNodeElements: renderAdditionalNodeElements, cache: cache, level: node.level }, node.path));
|
|
27
27
|
};
|
|
28
28
|
const renderVirtualizedTree = () => (_jsx(ReactList, { type: "uniform", length: nodesList.length, useStaticSize: true, itemRenderer: (index) => {
|
|
29
29
|
const node = nodesList[index];
|
|
@@ -36,7 +36,7 @@ export interface NavigationTreeProps<D = any> {
|
|
|
36
36
|
path: string;
|
|
37
37
|
type: NavigationTreeNodeType;
|
|
38
38
|
isOpen: boolean;
|
|
39
|
-
}) =>
|
|
39
|
+
}) => void;
|
|
40
40
|
getActions?: (path: string, type: NavigationTreeNodeType) => DropdownMenuItemMixed<D>[];
|
|
41
41
|
renderAdditionalNodeElements?: (path: string, type: NavigationTreeNodeType) => JSX.Element | undefined;
|
|
42
42
|
activePath?: string;
|