ydb-ui-components 3.2.1 → 3.3.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.
- package/CHANGELOG.md +19 -0
- package/build/components/NavigationTree/NavigationTree.d.ts +1 -1
- package/build/components/NavigationTree/NavigationTree.js +2 -0
- package/build/components/NavigationTree/NavigationTreeNode.d.ts +2 -1
- package/build/components/NavigationTree/NavigationTreeNode.js +7 -0
- package/build/components/NavigationTree/types.d.ts +3 -1
- package/build/components/TreeView/TreeView.css +3 -1
- package/build/components/TreeView/TreeView.d.ts +2 -1
- package/build/components/TreeView/TreeView.js +2 -1
- package/build/components/icons/ExternalDataSource.js +1 -3
- package/build/components/icons/ExternalTable.js +1 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [3.3.0](https://github.com/ydb-platform/ydb-ui-components/compare/v3.2.2...v3.3.0) (2023-08-09)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* **NavigationTree:** add additionalNodeElements to NavigationTree ([#55](https://github.com/ydb-platform/ydb-ui-components/issues/55)) ([d462aaf](https://github.com/ydb-platform/ydb-ui-components/commit/d462aafd8dd61aca3cc17b17f57419af4c7e8910))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **NavigationTree:** add new NavigationTreeNodeType 'stream' ([#57](https://github.com/ydb-platform/ydb-ui-components/issues/57)) ([270f607](https://github.com/ydb-platform/ydb-ui-components/commit/270f607e952f197c51fccd89a313390fdd8f055d))
|
|
14
|
+
|
|
15
|
+
## [3.2.2](https://github.com/ydb-platform/ydb-ui-components/compare/v3.2.1...v3.2.2) (2023-08-03)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* update icons for external table ([#53](https://github.com/ydb-platform/ydb-ui-components/issues/53)) ([928e8f7](https://github.com/ydb-platform/ydb-ui-components/commit/928e8f7d591e7557a9d939f07edbe8ae6ebcdaff))
|
|
21
|
+
|
|
3
22
|
## [3.2.1](https://github.com/ydb-platform/ydb-ui-components/compare/v3.2.0...v3.2.1) (2023-07-26)
|
|
4
23
|
|
|
5
24
|
|
|
@@ -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, activePath, onActivePathUpdate, cache, virtualize, }: NavigationTreeProps): JSX.Element;
|
|
4
|
+
export declare function NavigationTree({ rootState: partialRootState, fetchPath, getActions, renderAdditionalNodeElements, activePath, onActivePathUpdate, cache, virtualize, }: NavigationTreeProps): JSX.Element;
|
|
@@ -64,6 +64,7 @@ function NavigationTree(_ref) {
|
|
|
64
64
|
var partialRootState = _ref.rootState,
|
|
65
65
|
fetchPath = _ref.fetchPath,
|
|
66
66
|
getActions = _ref.getActions,
|
|
67
|
+
renderAdditionalNodeElements = _ref.renderAdditionalNodeElements,
|
|
67
68
|
activePath = _ref.activePath,
|
|
68
69
|
onActivePathUpdate = _ref.onActivePathUpdate,
|
|
69
70
|
_ref$cache = _ref.cache,
|
|
@@ -90,6 +91,7 @@ function NavigationTree(_ref) {
|
|
|
90
91
|
dispatch: dispatch,
|
|
91
92
|
onActivate: onActivePathUpdate,
|
|
92
93
|
getActions: getActions,
|
|
94
|
+
renderAdditionalNodeElements: renderAdditionalNodeElements,
|
|
93
95
|
cache: cache,
|
|
94
96
|
level: node.level
|
|
95
97
|
});
|
|
@@ -11,6 +11,7 @@ export interface NavigationTreeNodeProps {
|
|
|
11
11
|
children?: React.ReactNode;
|
|
12
12
|
onActivate?: (path: string) => void;
|
|
13
13
|
getActions?: NavigationTreeProps['getActions'];
|
|
14
|
+
renderAdditionalNodeElements?: NavigationTreeProps['renderAdditionalNodeElements'];
|
|
14
15
|
cache?: boolean;
|
|
15
16
|
}
|
|
16
|
-
export declare function NavigationTreeNode({ path, fetchPath, activePath, state, level, dispatch, children, onActivate, getActions, cache, }: NavigationTreeNodeProps): JSX.Element;
|
|
17
|
+
export declare function NavigationTreeNode({ path, fetchPath, activePath, state, level, dispatch, children, onActivate, getActions, renderAdditionalNodeElements, cache, }: NavigationTreeNodeProps): JSX.Element;
|
|
@@ -62,6 +62,7 @@ function renderIcon(type, collapsed) {
|
|
|
62
62
|
height: 16
|
|
63
63
|
});
|
|
64
64
|
|
|
65
|
+
case 'stream':
|
|
65
66
|
case 'topic':
|
|
66
67
|
return /*#__PURE__*/_react["default"].createElement(_Topic.TopicIcon, {
|
|
67
68
|
height: 16
|
|
@@ -92,6 +93,7 @@ function NavigationTreeNode(_ref) {
|
|
|
92
93
|
children = _ref.children,
|
|
93
94
|
onActivate = _ref.onActivate,
|
|
94
95
|
getActions = _ref.getActions,
|
|
96
|
+
renderAdditionalNodeElements = _ref.renderAdditionalNodeElements,
|
|
95
97
|
cache = _ref.cache;
|
|
96
98
|
var nodeState = state[path];
|
|
97
99
|
|
|
@@ -154,6 +156,10 @@ function NavigationTreeNode(_ref) {
|
|
|
154
156
|
});
|
|
155
157
|
}, []);
|
|
156
158
|
|
|
159
|
+
var additionalNodeElements = _react["default"].useMemo(function () {
|
|
160
|
+
return renderAdditionalNodeElements === null || renderAdditionalNodeElements === void 0 ? void 0 : renderAdditionalNodeElements(nodeState.path, nodeState.type);
|
|
161
|
+
}, [renderAdditionalNodeElements, nodeState]);
|
|
162
|
+
|
|
157
163
|
var actions = _react["default"].useMemo(function () {
|
|
158
164
|
return getActions === null || getActions === void 0 ? void 0 : getActions(nodeState.path, nodeState.type);
|
|
159
165
|
}, [getActions, nodeState]);
|
|
@@ -164,6 +170,7 @@ function NavigationTreeNode(_ref) {
|
|
|
164
170
|
collapsed: nodeState.collapsed,
|
|
165
171
|
active: nodeState.path === activePath,
|
|
166
172
|
actions: actions,
|
|
173
|
+
additionalNodeElements: additionalNodeElements,
|
|
167
174
|
hasArrow: nodeState.expandable,
|
|
168
175
|
onClick: handleClick,
|
|
169
176
|
onArrowClick: handleArrowClick,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { DropdownMenuItemMixed } from '@gravity-ui/uikit';
|
|
2
|
-
export declare type NavigationTreeNodeType = 'database' | 'directory' | 'table' | 'column_table' | 'index_table' | 'index' | 'topic' | 'external_table' | 'external_data_source';
|
|
3
|
+
export declare type NavigationTreeNodeType = 'database' | 'directory' | 'table' | 'column_table' | 'index_table' | 'index' | 'topic' | 'stream' | 'external_table' | 'external_data_source';
|
|
3
4
|
export interface NavigationTreeDataItem {
|
|
4
5
|
name: string;
|
|
5
6
|
type: NavigationTreeNodeType;
|
|
@@ -32,6 +33,7 @@ export interface NavigationTreeProps<D = any> {
|
|
|
32
33
|
rootState: NavigationTreeNodePartialState;
|
|
33
34
|
fetchPath: (path: string) => Promise<NavigationTreeDataItem[]>;
|
|
34
35
|
getActions?: (path: string, type: NavigationTreeNodeType) => DropdownMenuItemMixed<D>[];
|
|
36
|
+
renderAdditionalNodeElements?: (path: string, type: NavigationTreeNodeType) => JSX.Element | undefined;
|
|
35
37
|
activePath?: string;
|
|
36
38
|
onActivePathUpdate?: (activePath: string) => void;
|
|
37
39
|
cache?: boolean;
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
background-color: var(--yc-color-base-simple-hover);
|
|
20
20
|
}
|
|
21
21
|
.ydb-tree-view__item:hover .ydb-tree-view__actions {
|
|
22
|
-
display:
|
|
22
|
+
display: flex;
|
|
23
23
|
}
|
|
24
24
|
.ydb-tree-view__item_active {
|
|
25
25
|
font-weight: bold;
|
|
@@ -55,6 +55,8 @@
|
|
|
55
55
|
.ydb-tree-view__actions {
|
|
56
56
|
display: none;
|
|
57
57
|
margin-left: 6px;
|
|
58
|
+
align-items: center;
|
|
59
|
+
overflow: hidden;
|
|
58
60
|
}
|
|
59
61
|
.ydb-tree-view .tree-view_arrow {
|
|
60
62
|
flex-shrink: 0;
|
|
@@ -12,6 +12,7 @@ export interface TreeViewProps {
|
|
|
12
12
|
onArrowClick?: () => void;
|
|
13
13
|
hasArrow?: boolean;
|
|
14
14
|
actions?: DropdownMenuItemMixed<any>[];
|
|
15
|
+
additionalNodeElements?: JSX.Element;
|
|
15
16
|
level?: number;
|
|
16
17
|
}
|
|
17
|
-
export declare function TreeView({ children, name, title, icon, collapsed, active, onClick, onArrowClick, hasArrow, actions, level, }: TreeViewProps): JSX.Element;
|
|
18
|
+
export declare function TreeView({ children, name, title, icon, collapsed, active, onClick, onArrowClick, hasArrow, actions, additionalNodeElements, level, }: TreeViewProps): JSX.Element;
|
|
@@ -36,6 +36,7 @@ function TreeView(_ref) {
|
|
|
36
36
|
_ref$hasArrow = _ref.hasArrow,
|
|
37
37
|
hasArrow = _ref$hasArrow === void 0 ? false : _ref$hasArrow,
|
|
38
38
|
actions = _ref.actions,
|
|
39
|
+
additionalNodeElements = _ref.additionalNodeElements,
|
|
39
40
|
level = _ref.level;
|
|
40
41
|
|
|
41
42
|
var rootRef = _react["default"].useRef(null);
|
|
@@ -49,7 +50,7 @@ function TreeView(_ref) {
|
|
|
49
50
|
title: title
|
|
50
51
|
}, name), actions && actions.length > 0 && /*#__PURE__*/_react["default"].createElement("div", {
|
|
51
52
|
className: b('actions')
|
|
52
|
-
}, /*#__PURE__*/_react["default"].createElement(_uikit.DropdownMenu, {
|
|
53
|
+
}, additionalNodeElements, /*#__PURE__*/_react["default"].createElement(_uikit.DropdownMenu, {
|
|
53
54
|
defaultSwitcherProps: {
|
|
54
55
|
view: 'flat-secondary',
|
|
55
56
|
size: 's',
|
|
@@ -19,8 +19,6 @@ function ExternalDataSourceIcon(props) {
|
|
|
19
19
|
}, props), /*#__PURE__*/_react["default"].createElement("path", {
|
|
20
20
|
fillRule: "evenodd",
|
|
21
21
|
clipRule: "evenodd",
|
|
22
|
-
d: "
|
|
23
|
-
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
24
|
-
d: "M15 9.66406V10.3672C15 11.0264 13.5346 11.5391 11.75 11.5391C9.95089 11.5391 8.5 11.0264 8.5 10.3672V9.66406C8.5 9.01953 9.95089 8.49219 11.75 8.49219C13.5346 8.49219 15 9.01953 15 9.66406ZM14.202 11.6416C14.4922 11.5391 14.7824 11.3926 15 11.2314V12.7109C15 13.3701 13.5346 13.8828 11.75 13.8828C9.95089 13.8828 8.5 13.3701 8.5 12.7109V11.2314C8.70312 11.3926 8.9933 11.5391 9.28348 11.6416C9.93638 11.876 10.8069 12.0078 11.75 12.0078C12.6786 12.0078 13.5491 11.876 14.202 11.6416ZM9.28348 13.9854C9.93638 14.2197 10.8069 14.3516 11.75 14.3516C12.6786 14.3516 13.5491 14.2197 14.202 13.9854C14.4922 13.8828 14.7824 13.7363 15 13.5752V14.8203C15 15.4795 13.5346 15.9922 11.75 15.9922C9.95089 15.9922 8.5 15.4795 8.5 14.8203V13.5752C8.70312 13.7363 8.9933 13.8828 9.28348 13.9854Z"
|
|
22
|
+
d: "M0 6.75C0 6.35156 0.338542 6 0.722222 6L3.61111 6V3L0.722222 3C0.338542 3 0 2.67188 0 2.25C0 1.85156 0.338542 1.5 0.722222 1.5L3.61111 1.5V0.750001C3.61111 0.351563 3.94965 0 4.33333 0C4.73958 0 5.05556 0.351563 5.05556 0.750001H5.77778C7.53819 0.750001 8.98264 2.03906 9.32118 3.75H12V5.25H9.32118C9.29095 5.4049 9.25189 5.55606 9.20457 5.70291C9.10459 5.73587 9.00778 5.77066 8.9144 5.80723C8.505 5.96755 8.12646 6.17556 7.83841 6.44187C7.5498 6.70871 7.3 7.08678 7.3 7.56255V7.90902C6.83862 8.12843 6.32337 8.25 5.77778 8.25H5.05556C5.05556 8.67188 4.73958 9 4.33333 9C3.94965 9 3.61111 8.67188 3.61111 8.25V7.5L0.722222 7.5C0.338542 7.5 0 7.17188 0 6.75ZM16 8.5V7.5625C16 6.70312 14.1964 6 12 6C9.78571 6 8 6.70312 8 7.5625V8.5C8 9.37891 9.78571 10.0625 12 10.0625C14.1964 10.0625 16 9.37891 16 8.5ZM16 9.65234C15.7321 9.86719 15.375 10.0625 15.0179 10.1992C14.2143 10.5117 13.1429 10.6875 12 10.6875C10.8393 10.6875 9.76786 10.5117 8.96429 10.1992C8.60714 10.0625 8.25 9.86719 8 9.65234V11.625C8 12.5039 9.78571 13.1875 12 13.1875C14.1964 13.1875 16 12.5039 16 11.625V9.65234ZM12 13.8125C10.8393 13.8125 9.76786 13.6367 8.96429 13.3242C8.60714 13.1875 8.25 12.9922 8 12.7773V14.4375C8 15.3164 9.78571 16 12 16C14.1964 16 16 15.3164 16 14.4375V12.7773C15.7321 12.9922 15.375 13.1875 15.0179 13.3242C14.2143 13.6367 13.1429 13.8125 12 13.8125Z"
|
|
25
23
|
}));
|
|
26
24
|
}
|
|
@@ -19,8 +19,6 @@ function ExternalTableIcon(props) {
|
|
|
19
19
|
}, props), /*#__PURE__*/_react["default"].createElement("path", {
|
|
20
20
|
fillRule: "evenodd",
|
|
21
21
|
clipRule: "evenodd",
|
|
22
|
-
d: "
|
|
23
|
-
}), /*#__PURE__*/_react["default"].createElement("path", {
|
|
24
|
-
d: "M13.9821 9.65002C14.4802 9.65002 14.8929 10.0578 14.8929 10.55V15.05C14.8929 15.5563 14.4802 15.95 13.9821 15.95H8.51786C8.00558 15.95 7.60715 15.5563 7.60715 15.05V10.55C7.60715 10.0578 8.00558 9.65002 8.51786 9.65002H13.9821ZM10.7946 12.8V11.45H8.51786V12.8H10.7946ZM8.51786 13.7V15.05H10.7946V13.7H8.51786ZM11.7054 15.05H13.9821V13.7H11.7054V15.05ZM13.9821 12.8V11.45H11.7054V12.8H13.9821Z"
|
|
22
|
+
d: "M0 6.75C0 6.35156 0.351562 6 0.75 6L3.75 6V3L0.75 3C0.351562 3 0 2.67188 0 2.25C0 1.85156 0.351562 1.5 0.75 1.5L3.75 1.5V0.750001C3.75 0.351563 4.10156 0 4.5 0C4.92188 0 5.25 0.351563 5.25 0.750001H6C7.82812 0.750001 9.32812 2.03906 9.67969 3.75H12V5.25H9.67969C9.60376 5.62455 9.47428 5.97724 9.2995 6.30005H7.19969C6.09701 6.30005 5.26846 7.20143 5.25 8.25C5.25 8.67188 4.92188 9 4.5 9C4.10156 9 3.75 8.67188 3.75 8.25V7.5L0.75 7.5C0.351562 7.5 0 7.17188 0 6.75ZM16 8.28571C16 7.58259 15.4336 7 14.75 7H7.25C6.54688 7 6 7.58259 6 8.28571V14.7143C6 15.4375 6.54688 16 7.25 16H14.75C15.4336 16 16 15.4375 16 14.7143V8.28571ZM10.375 9.57143V11.5H7.25V9.57143H10.375ZM7.25 14.7143V12.7857H10.375V14.7143H7.25ZM14.75 14.7143H11.625V12.7857H14.75V14.7143ZM14.75 9.57143V11.5H11.625V9.57143H14.75Z"
|
|
25
23
|
}));
|
|
26
24
|
}
|