ydb-ui-components 5.2.0 → 5.4.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.
@@ -34,6 +34,8 @@ function renderIcon(type, collapsed) {
34
34
  return (0, jsx_runtime_1.jsx)(icons_1.ExternalTableIcon, {});
35
35
  case 'external_data_source':
36
36
  return (0, jsx_runtime_1.jsx)(icons_1.ExternalDataSourceIcon, {});
37
+ case 'streaming_query':
38
+ return (0, jsx_runtime_1.jsx)(icons_1.StreamingQueryIcon, {});
37
39
  case 'view':
38
40
  return (0, jsx_runtime_1.jsx)(icons_1.ViewIcon, {});
39
41
  case 'resource_pool':
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import type { DropdownMenuItemMixed } from '@gravity-ui/uikit';
3
- export type NavigationTreeNodeType = 'async_replication' | 'column_table' | 'resource_pool' | 'database' | 'directory' | 'external_data_source' | 'external_table' | 'index_table' | 'index' | 'stream' | 'system_table' | 'table' | 'topic' | 'transfer' | 'view';
3
+ export type NavigationTreeNodeType = 'async_replication' | 'column_table' | 'resource_pool' | 'database' | 'directory' | 'external_data_source' | 'external_table' | 'index_table' | 'index' | 'stream' | 'system_table' | 'streaming_query' | 'table' | 'topic' | 'transfer' | 'view';
4
4
  export interface NavigationTreeDataItem<M = unknown> {
5
5
  name: string;
6
6
  type: NavigationTreeNodeType;
@@ -32,6 +32,7 @@
32
32
  flex-grow: 1;
33
33
  display: flex;
34
34
  align-items: center;
35
+ justify-content: space-between;
35
36
  overflow: hidden;
36
37
  }
37
38
  .ydb-tree-view__icon {
@@ -46,8 +47,12 @@
46
47
  .ydb-tree-view__icon svg {
47
48
  display: block;
48
49
  }
50
+ .ydb-tree-view__label {
51
+ display: inline-flex;
52
+ align-items: center;
53
+ min-width: 0;
54
+ }
49
55
  .ydb-tree-view__text {
50
- flex-grow: 1;
51
56
  white-space: nowrap;
52
57
  overflow: hidden;
53
58
  text-overflow: ellipsis;
@@ -35,10 +35,12 @@ function TreeView({ children, name, title, icon, collapsed = true, active = fals
35
35
  arrowClassName += ' tree-view_arrow-collapsed';
36
36
  containerClassName += ' tree-view_children-collapsed';
37
37
  }
38
+ const tooltipContent = title !== null && title !== void 0 ? title : (typeof name === 'string' ? name : '');
39
+ const isTooltipDisabled = tooltipContent.trim().length === 0;
38
40
  return ((0, jsx_runtime_1.jsx)("div", { className: b(), style: { [TREE_LEVEL_CSS_VAR]: level }, children: (0, jsx_runtime_1.jsxs)("div", { className: "tree-view", children: [(0, jsx_runtime_1.jsxs)("div", { className: `${itemClassName} ${b('item', { active })}`, onClick: handleClick, children: [(0, jsx_runtime_1.jsx)("button", { type: "button", className: `${arrowClassName} ${b('arrow', {
39
41
  collapsed,
40
42
  hidden: !hasArrow,
41
- })}`, disabled: !handleArrowClick, onClick: handleArrowClick }), (0, jsx_runtime_1.jsxs)("div", { className: b('content'), children: [icon && (0, jsx_runtime_1.jsx)("div", { className: b('icon'), children: icon }), (0, jsx_runtime_1.jsx)("div", { className: b('text'), title: title, children: name }), actions && actions.length > 0 && ((0, jsx_runtime_1.jsxs)("div", { className: b('actions'), children: [additionalNodeElements, (0, jsx_runtime_1.jsx)(uikit_1.DropdownMenu, { onOpenToggle: onActionsOpenToggle, defaultSwitcherProps: {
43
+ })}`, disabled: !handleArrowClick, onClick: handleArrowClick }), (0, jsx_runtime_1.jsxs)("div", { className: b('content'), children: [(0, jsx_runtime_1.jsx)(uikit_1.ActionTooltip, { title: tooltipContent, disabled: isTooltipDisabled, children: (0, jsx_runtime_1.jsxs)("div", { className: b('label'), children: [icon && (0, jsx_runtime_1.jsx)("div", { className: b('icon'), children: icon }), (0, jsx_runtime_1.jsx)("div", { className: b('text'), children: name })] }) }), actions && actions.length > 0 && ((0, jsx_runtime_1.jsxs)("div", { className: b('actions'), children: [additionalNodeElements, (0, jsx_runtime_1.jsx)(uikit_1.DropdownMenu, { onOpenToggle: onActionsOpenToggle, defaultSwitcherProps: {
42
44
  view: 'flat-secondary',
43
45
  size: 's',
44
46
  pin: 'brick-brick',
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare function StreamingQueryIcon(props: React.SVGProps<SVGSVGElement>): JSX.Element;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StreamingQueryIcon = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ function StreamingQueryIcon(props) {
6
+ return ((0, jsx_runtime_1.jsxs)("svg", Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: 16, height: 16, viewBox: "0 0 16 16", fill: "currentColor" }, props, { children: [(0, jsx_runtime_1.jsx)("path", { d: "M1.74736 10.2865C3.06151 9.1017 4.5271 8.93752 5.7625 9.14443C6.9676 9.34634 7.98265 9.90421 8.49297 10.1889C9.08861 10.5211 9.83649 10.9101 10.6673 11.0311C11.4608 11.1467 12.3492 11.0208 13.2747 10.2636C13.5952 10.0013 14.068 10.0481 14.3304 10.3685C14.5927 10.6891 14.5454 11.1619 14.2249 11.4242C12.9391 12.4764 11.6157 12.6852 10.451 12.5155C9.32352 12.3513 8.36538 11.8355 7.76201 11.4989C7.2599 11.2188 6.44194 10.7793 5.51445 10.6239C4.61708 10.4736 3.64946 10.5919 2.75225 11.4008C2.44461 11.678 1.97 11.6537 1.69268 11.3461C1.41543 11.0385 1.43991 10.5639 1.74736 10.2865Z" }), (0, jsx_runtime_1.jsx)("path", { d: "M1.74736 4.62734C3.06151 3.44252 4.52711 3.27834 5.7625 3.48525C6.96757 3.68716 7.98264 4.24502 8.49297 4.52968C9.08861 4.86192 9.8365 5.25091 10.6673 5.37196C11.4608 5.48752 12.3492 5.36169 13.2747 4.60439C13.5952 4.34209 14.068 4.38896 14.3304 4.70937C14.5927 5.02991 14.5454 5.50269 14.2249 5.76503C12.9391 6.81728 11.6157 7.02598 10.451 6.85634C9.32352 6.69207 8.36538 6.17629 7.76201 5.83974C7.2599 5.55967 6.44192 5.1201 5.51445 4.96474C4.61709 4.81446 3.64946 4.93275 2.75225 5.74159C2.44461 6.01886 1.97001 5.99449 1.69268 5.68691C1.41547 5.37931 1.43989 4.90468 1.74736 4.62734Z" })] })));
7
+ }
8
+ exports.StreamingQueryIcon = StreamingQueryIcon;
@@ -11,3 +11,4 @@ export { TableIndexIcon } from './TableIndex';
11
11
  export { TopicIcon } from './Topic';
12
12
  export { TransferIcon } from './Transfer';
13
13
  export { ViewIcon } from './View';
14
+ export { StreamingQueryIcon } from './StreamingQuery';
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ViewIcon = exports.TransferIcon = exports.TopicIcon = exports.TableIndexIcon = exports.TableIcon = exports.ResourcePoolIcon = exports.FolderOpenIcon = exports.FolderIcon = exports.ExternalTableIcon = exports.ExternalDataSourceIcon = exports.DatabaseIcon = exports.ColumnTableIcon = exports.AsyncReplicationIcon = void 0;
3
+ exports.StreamingQueryIcon = exports.ViewIcon = exports.TransferIcon = exports.TopicIcon = exports.TableIndexIcon = exports.TableIcon = exports.ResourcePoolIcon = exports.FolderOpenIcon = exports.FolderIcon = exports.ExternalTableIcon = exports.ExternalDataSourceIcon = exports.DatabaseIcon = exports.ColumnTableIcon = exports.AsyncReplicationIcon = void 0;
4
4
  var AsyncReplication_1 = require("./AsyncReplication");
5
5
  Object.defineProperty(exports, "AsyncReplicationIcon", { enumerable: true, get: function () { return AsyncReplication_1.AsyncReplicationIcon; } });
6
6
  var ColumnTable_1 = require("./ColumnTable");
@@ -27,3 +27,5 @@ var Transfer_1 = require("./Transfer");
27
27
  Object.defineProperty(exports, "TransferIcon", { enumerable: true, get: function () { return Transfer_1.TransferIcon; } });
28
28
  var View_1 = require("./View");
29
29
  Object.defineProperty(exports, "ViewIcon", { enumerable: true, get: function () { return View_1.ViewIcon; } });
30
+ var StreamingQuery_1 = require("./StreamingQuery");
31
+ Object.defineProperty(exports, "StreamingQueryIcon", { enumerable: true, get: function () { return StreamingQuery_1.StreamingQueryIcon; } });
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import React from 'react';
3
3
  import { TreeView } from '../TreeView/TreeView';
4
- import { AsyncReplicationIcon, ColumnTableIcon, DatabaseIcon, ExternalDataSourceIcon, ExternalTableIcon, FolderIcon, FolderOpenIcon, ResourcePoolIcon, TableIcon, TableIndexIcon, TopicIcon, TransferIcon, ViewIcon, } from '../icons';
4
+ import { AsyncReplicationIcon, ColumnTableIcon, DatabaseIcon, ExternalDataSourceIcon, ExternalTableIcon, FolderIcon, FolderOpenIcon, ResourcePoolIcon, StreamingQueryIcon, TableIcon, TableIndexIcon, TopicIcon, TransferIcon, ViewIcon, } from '../icons';
5
5
  import { NavigationTreeActionType } from './state';
6
6
  function renderIcon(type, collapsed) {
7
7
  switch (type) {
@@ -28,6 +28,8 @@ function renderIcon(type, collapsed) {
28
28
  return _jsx(ExternalTableIcon, {});
29
29
  case 'external_data_source':
30
30
  return _jsx(ExternalDataSourceIcon, {});
31
+ case 'streaming_query':
32
+ return _jsx(StreamingQueryIcon, {});
31
33
  case 'view':
32
34
  return _jsx(ViewIcon, {});
33
35
  case 'resource_pool':
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import type { DropdownMenuItemMixed } from '@gravity-ui/uikit';
3
- export type NavigationTreeNodeType = 'async_replication' | 'column_table' | 'resource_pool' | 'database' | 'directory' | 'external_data_source' | 'external_table' | 'index_table' | 'index' | 'stream' | 'system_table' | 'table' | 'topic' | 'transfer' | 'view';
3
+ export type NavigationTreeNodeType = 'async_replication' | 'column_table' | 'resource_pool' | 'database' | 'directory' | 'external_data_source' | 'external_table' | 'index_table' | 'index' | 'stream' | 'system_table' | 'streaming_query' | 'table' | 'topic' | 'transfer' | 'view';
4
4
  export interface NavigationTreeDataItem<M = unknown> {
5
5
  name: string;
6
6
  type: NavigationTreeNodeType;
@@ -32,6 +32,7 @@
32
32
  flex-grow: 1;
33
33
  display: flex;
34
34
  align-items: center;
35
+ justify-content: space-between;
35
36
  overflow: hidden;
36
37
  }
37
38
  .ydb-tree-view__icon {
@@ -46,8 +47,12 @@
46
47
  .ydb-tree-view__icon svg {
47
48
  display: block;
48
49
  }
50
+ .ydb-tree-view__label {
51
+ display: inline-flex;
52
+ align-items: center;
53
+ min-width: 0;
54
+ }
49
55
  .ydb-tree-view__text {
50
- flex-grow: 1;
51
56
  white-space: nowrap;
52
57
  overflow: hidden;
53
58
  text-overflow: ellipsis;
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React from 'react';
3
- import { DropdownMenu } from '@gravity-ui/uikit';
3
+ import { ActionTooltip, DropdownMenu } from '@gravity-ui/uikit';
4
4
  import { block } from '../../utils/cn';
5
5
  import './TreeView.css';
6
6
  const TREE_LEVEL_CSS_VAR = '--ydb-tree-view-level';
@@ -29,10 +29,12 @@ export function TreeView({ children, name, title, icon, collapsed = true, active
29
29
  arrowClassName += ' tree-view_arrow-collapsed';
30
30
  containerClassName += ' tree-view_children-collapsed';
31
31
  }
32
+ const tooltipContent = title !== null && title !== void 0 ? title : (typeof name === 'string' ? name : '');
33
+ const isTooltipDisabled = tooltipContent.trim().length === 0;
32
34
  return (_jsx("div", { className: b(), style: { [TREE_LEVEL_CSS_VAR]: level }, children: _jsxs("div", { className: "tree-view", children: [_jsxs("div", { className: `${itemClassName} ${b('item', { active })}`, onClick: handleClick, children: [_jsx("button", { type: "button", className: `${arrowClassName} ${b('arrow', {
33
35
  collapsed,
34
36
  hidden: !hasArrow,
35
- })}`, disabled: !handleArrowClick, onClick: handleArrowClick }), _jsxs("div", { className: b('content'), children: [icon && _jsx("div", { className: b('icon'), children: icon }), _jsx("div", { className: b('text'), title: title, children: name }), actions && actions.length > 0 && (_jsxs("div", { className: b('actions'), children: [additionalNodeElements, _jsx(DropdownMenu, { onOpenToggle: onActionsOpenToggle, defaultSwitcherProps: {
37
+ })}`, disabled: !handleArrowClick, onClick: handleArrowClick }), _jsxs("div", { className: b('content'), children: [_jsx(ActionTooltip, { title: tooltipContent, disabled: isTooltipDisabled, children: _jsxs("div", { className: b('label'), children: [icon && _jsx("div", { className: b('icon'), children: icon }), _jsx("div", { className: b('text'), children: name })] }) }), actions && actions.length > 0 && (_jsxs("div", { className: b('actions'), children: [additionalNodeElements, _jsx(DropdownMenu, { onOpenToggle: onActionsOpenToggle, defaultSwitcherProps: {
36
38
  view: 'flat-secondary',
37
39
  size: 's',
38
40
  pin: 'brick-brick',
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare function StreamingQueryIcon(props: React.SVGProps<SVGSVGElement>): JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React from 'react';
3
+ export function StreamingQueryIcon(props) {
4
+ return (_jsxs("svg", Object.assign({ xmlns: "http://www.w3.org/2000/svg", width: 16, height: 16, viewBox: "0 0 16 16", fill: "currentColor" }, props, { children: [_jsx("path", { d: "M1.74736 10.2865C3.06151 9.1017 4.5271 8.93752 5.7625 9.14443C6.9676 9.34634 7.98265 9.90421 8.49297 10.1889C9.08861 10.5211 9.83649 10.9101 10.6673 11.0311C11.4608 11.1467 12.3492 11.0208 13.2747 10.2636C13.5952 10.0013 14.068 10.0481 14.3304 10.3685C14.5927 10.6891 14.5454 11.1619 14.2249 11.4242C12.9391 12.4764 11.6157 12.6852 10.451 12.5155C9.32352 12.3513 8.36538 11.8355 7.76201 11.4989C7.2599 11.2188 6.44194 10.7793 5.51445 10.6239C4.61708 10.4736 3.64946 10.5919 2.75225 11.4008C2.44461 11.678 1.97 11.6537 1.69268 11.3461C1.41543 11.0385 1.43991 10.5639 1.74736 10.2865Z" }), _jsx("path", { d: "M1.74736 4.62734C3.06151 3.44252 4.52711 3.27834 5.7625 3.48525C6.96757 3.68716 7.98264 4.24502 8.49297 4.52968C9.08861 4.86192 9.8365 5.25091 10.6673 5.37196C11.4608 5.48752 12.3492 5.36169 13.2747 4.60439C13.5952 4.34209 14.068 4.38896 14.3304 4.70937C14.5927 5.02991 14.5454 5.50269 14.2249 5.76503C12.9391 6.81728 11.6157 7.02598 10.451 6.85634C9.32352 6.69207 8.36538 6.17629 7.76201 5.83974C7.2599 5.55967 6.44192 5.1201 5.51445 4.96474C4.61709 4.81446 3.64946 4.93275 2.75225 5.74159C2.44461 6.01886 1.97001 5.99449 1.69268 5.68691C1.41547 5.37931 1.43989 4.90468 1.74736 4.62734Z" })] })));
5
+ }
@@ -11,3 +11,4 @@ export { TableIndexIcon } from './TableIndex';
11
11
  export { TopicIcon } from './Topic';
12
12
  export { TransferIcon } from './Transfer';
13
13
  export { ViewIcon } from './View';
14
+ export { StreamingQueryIcon } from './StreamingQuery';
@@ -11,3 +11,4 @@ export { TableIndexIcon } from './TableIndex';
11
11
  export { TopicIcon } from './Topic';
12
12
  export { TransferIcon } from './Transfer';
13
13
  export { ViewIcon } from './View';
14
+ export { StreamingQueryIcon } from './StreamingQuery';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ydb-ui-components",
3
- "version": "5.2.0",
3
+ "version": "5.4.0",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "exports": {