ydb-ui-components 4.3.2 → 4.5.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.
@@ -13,6 +13,7 @@ const ExternalTable_1 = require("../icons/ExternalTable");
13
13
  const Folder_1 = require("../icons/Folder");
14
14
  const FolderOpen_1 = require("../icons/FolderOpen");
15
15
  const Index_1 = require("../icons/Index");
16
+ const ResourcePool_1 = require("../icons/ResourcePool");
16
17
  const Table_1 = require("../icons/Table");
17
18
  const Topic_1 = require("../icons/Topic");
18
19
  const View_1 = require("../icons/View");
@@ -42,6 +43,8 @@ function renderIcon(type, collapsed) {
42
43
  return (0, jsx_runtime_1.jsx)(ExternalDataSource_1.ExternalDataSourceIcon, { height: 16 });
43
44
  case 'view':
44
45
  return (0, jsx_runtime_1.jsx)(View_1.ViewIcon, { height: 16 });
46
+ case 'resource_pool':
47
+ return (0, jsx_runtime_1.jsx)(ResourcePool_1.ResourcePoolIcon, { height: 16 });
45
48
  default:
46
49
  return null;
47
50
  }
@@ -45,6 +45,9 @@ function reducer(state = {}, action) {
45
45
  path }));
46
46
  }
47
47
  }
48
+ if (!action.payload.data || action.payload.data.length === 0) {
49
+ newState[action.payload.path] = Object.assign(Object.assign({}, newState[action.payload.path]), { expandable: false, collapsed: true });
50
+ }
48
51
  return newState;
49
52
  }
50
53
  case NavigationTreeActionType.ErrorLoading:
@@ -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' | 'database' | 'directory' | 'external_data_source' | 'external_table' | 'index_table' | 'index' | 'stream' | 'table' | 'topic' | 'view';
3
+ export type NavigationTreeNodeType = 'async_replication' | 'column_table' | 'resource_pool' | 'database' | 'directory' | 'external_data_source' | 'external_table' | 'index_table' | 'index' | 'stream' | 'table' | 'topic' | 'view';
4
4
  export interface NavigationTreeDataItem {
5
5
  name: string;
6
6
  type: NavigationTreeNodeType;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare function ResourcePoolIcon(props: React.SVGProps<SVGSVGElement>): JSX.Element;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ResourcePoolIcon = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ function ResourcePoolIcon(props) {
6
+ return ((0, jsx_runtime_1.jsx)("svg", Object.assign({ xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 16 16", fill: "currentColor" }, props, { children: (0, jsx_runtime_1.jsx)("path", { d: "m1.5 3.25c0-0.41421 0.33579-0.75 0.75-0.75h1.0109c0.41421 0 0.75-0.33579 0.75-0.75s-0.33579-0.75-0.75-0.75h-1.0109c-1.2426 0-2.25 1.0074-2.25 2.25v9.5c0 1.2426 1.0074 2.25 2.25 2.25h1.0109c0.41421 0 0.75-0.3358 0.75-0.75s-0.33579-0.75-0.75-0.75h-1.0109c-0.41421 0-0.75-0.3358-0.75-0.75v-9.5zm11.239-2.25c-0.4142 0-0.75 0.33579-0.75 0.75s0.3358 0.75 0.75 0.75h1.0109c0.4142 0 0.75 0.33579 0.75 0.75v9.5c0 0.4142-0.3358 0.75-0.75 0.75h-1.0109c-0.4142 0-0.75 0.3358-0.75 0.75s0.3358 0.75 0.75 0.75h1.0109c1.2426 0 2.25-1.0074 2.25-2.25v-9.5c0-1.2426-1.0074-2.25-2.25-2.25h-1.0109zm-1.4316 6.9054c-0.9374 0.45226-2.1226 0.63619-3.3102 0.63619-1.1876 0-2.3728-0.18393-3.3103-0.63619-0.21174-0.10215-0.42044-0.22399-0.61701-0.36633v0.46091c0 1.3714 1.7583 2.0571 3.9273 2.0571 2.169 0 3.9273-0.68571 3.9273-2.0571v-0.46091c-0.1966 0.14234-0.4053 0.26418-0.6171 0.36633zm-3.3102-0.59108c2.169 0 3.9273-0.68572 3.9273-2.0571 0-1.3714-1.7583-2.0572-3.9273-2.0572-2.169 0-3.9273 0.68572-3.9273 2.0572 0 1.3714 1.7583 2.0571 3.9273 2.0571zm3.9273 3.4286c0 1.3714-1.7583 2.0571-3.9273 2.0571-2.169 0-3.9273-0.6857-3.9273-2.0571v-0.461c0.19657 0.1423 0.40527 0.2641 0.61701 0.3663 0.93748 0.4522 2.1227 0.6362 3.3103 0.6362 1.1876 0 2.3728-0.184 3.3102-0.6362 0.2118-0.1022 0.4205-0.224 0.6171-0.3663v0.461z", fill: "currentColor", clipRule: "evenodd", fillRule: "evenodd" }) })));
7
+ }
8
+ exports.ResourcePoolIcon = ResourcePoolIcon;
@@ -9,6 +9,7 @@ import { ExternalTableIcon } from '../icons/ExternalTable';
9
9
  import { FolderIcon } from '../icons/Folder';
10
10
  import { FolderOpenIcon } from '../icons/FolderOpen';
11
11
  import { IndexIcon } from '../icons/Index';
12
+ import { ResourcePoolIcon } from '../icons/ResourcePool';
12
13
  import { TableIcon } from '../icons/Table';
13
14
  import { TopicIcon } from '../icons/Topic';
14
15
  import { ViewIcon } from '../icons/View';
@@ -38,6 +39,8 @@ function renderIcon(type, collapsed) {
38
39
  return _jsx(ExternalDataSourceIcon, { height: 16 });
39
40
  case 'view':
40
41
  return _jsx(ViewIcon, { height: 16 });
42
+ case 'resource_pool':
43
+ return _jsx(ResourcePoolIcon, { height: 16 });
41
44
  default:
42
45
  return null;
43
46
  }
@@ -40,6 +40,9 @@ export function reducer(state = {}, action) {
40
40
  path }));
41
41
  }
42
42
  }
43
+ if (!action.payload.data || action.payload.data.length === 0) {
44
+ newState[action.payload.path] = Object.assign(Object.assign({}, newState[action.payload.path]), { expandable: false, collapsed: true });
45
+ }
43
46
  return newState;
44
47
  }
45
48
  case NavigationTreeActionType.ErrorLoading:
@@ -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' | 'database' | 'directory' | 'external_data_source' | 'external_table' | 'index_table' | 'index' | 'stream' | 'table' | 'topic' | 'view';
3
+ export type NavigationTreeNodeType = 'async_replication' | 'column_table' | 'resource_pool' | 'database' | 'directory' | 'external_data_source' | 'external_table' | 'index_table' | 'index' | 'stream' | 'table' | 'topic' | 'view';
4
4
  export interface NavigationTreeDataItem {
5
5
  name: string;
6
6
  type: NavigationTreeNodeType;
@@ -0,0 +1,2 @@
1
+ import React from 'react';
2
+ export declare function ResourcePoolIcon(props: React.SVGProps<SVGSVGElement>): JSX.Element;
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import React from 'react';
3
+ export function ResourcePoolIcon(props) {
4
+ return (_jsx("svg", Object.assign({ xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 16 16", fill: "currentColor" }, props, { children: _jsx("path", { d: "m1.5 3.25c0-0.41421 0.33579-0.75 0.75-0.75h1.0109c0.41421 0 0.75-0.33579 0.75-0.75s-0.33579-0.75-0.75-0.75h-1.0109c-1.2426 0-2.25 1.0074-2.25 2.25v9.5c0 1.2426 1.0074 2.25 2.25 2.25h1.0109c0.41421 0 0.75-0.3358 0.75-0.75s-0.33579-0.75-0.75-0.75h-1.0109c-0.41421 0-0.75-0.3358-0.75-0.75v-9.5zm11.239-2.25c-0.4142 0-0.75 0.33579-0.75 0.75s0.3358 0.75 0.75 0.75h1.0109c0.4142 0 0.75 0.33579 0.75 0.75v9.5c0 0.4142-0.3358 0.75-0.75 0.75h-1.0109c-0.4142 0-0.75 0.3358-0.75 0.75s0.3358 0.75 0.75 0.75h1.0109c1.2426 0 2.25-1.0074 2.25-2.25v-9.5c0-1.2426-1.0074-2.25-2.25-2.25h-1.0109zm-1.4316 6.9054c-0.9374 0.45226-2.1226 0.63619-3.3102 0.63619-1.1876 0-2.3728-0.18393-3.3103-0.63619-0.21174-0.10215-0.42044-0.22399-0.61701-0.36633v0.46091c0 1.3714 1.7583 2.0571 3.9273 2.0571 2.169 0 3.9273-0.68571 3.9273-2.0571v-0.46091c-0.1966 0.14234-0.4053 0.26418-0.6171 0.36633zm-3.3102-0.59108c2.169 0 3.9273-0.68572 3.9273-2.0571 0-1.3714-1.7583-2.0572-3.9273-2.0572-2.169 0-3.9273 0.68572-3.9273 2.0572 0 1.3714 1.7583 2.0571 3.9273 2.0571zm3.9273 3.4286c0 1.3714-1.7583 2.0571-3.9273 2.0571-2.169 0-3.9273-0.6857-3.9273-2.0571v-0.461c0.19657 0.1423 0.40527 0.2641 0.61701 0.3663 0.93748 0.4522 2.1227 0.6362 3.3103 0.6362 1.1876 0 2.3728-0.184 3.3102-0.6362 0.2118-0.1022 0.4205-0.224 0.6171-0.3663v0.461z", fill: "currentColor", clipRule: "evenodd", fillRule: "evenodd" }) })));
5
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ydb-ui-components",
3
- "version": "4.3.2",
3
+ "version": "4.5.0",
4
4
  "description": "",
5
5
  "license": "MIT",
6
6
  "exports": {