ydb-embedded-ui 6.0.1 → 6.2.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.
Files changed (134) hide show
  1. package/dist/components/CriticalActionDialog/CriticalActionDialog.scss +0 -2
  2. package/dist/components/DateRange/DateRange.scss +7 -0
  3. package/dist/components/NodeHostWrapper/NodeHostWrapper.js +1 -1
  4. package/dist/components/NodeHostWrapper/NodeHostWrapper.scss +0 -6
  5. package/dist/components/QueryResultTable/QueryResultTable.d.ts +2 -2
  6. package/dist/components/QueryResultTable/QueryResultTable.js +2 -1
  7. package/dist/components/QueryResultTable/QueryResultTable.scss +1 -0
  8. package/dist/components/ResizeableDataTable/ResizeableDataTable.d.ts +7 -0
  9. package/dist/components/ResizeableDataTable/ResizeableDataTable.js +14 -0
  10. package/dist/components/ResizeableDataTable/ResizeableDataTable.scss +8 -0
  11. package/dist/components/VirtualTable/ResizeHandler.d.ts +8 -0
  12. package/dist/components/VirtualTable/ResizeHandler.js +62 -0
  13. package/dist/components/VirtualTable/ResizeableVirtualTable.d.ts +6 -0
  14. package/dist/components/VirtualTable/ResizeableVirtualTable.js +16 -0
  15. package/dist/components/VirtualTable/TableHead.d.ts +3 -3
  16. package/dist/components/VirtualTable/TableHead.js +16 -31
  17. package/dist/components/VirtualTable/VirtualTable.d.ts +2 -4
  18. package/dist/components/VirtualTable/VirtualTable.scss +24 -4
  19. package/dist/components/VirtualTable/types.d.ts +3 -0
  20. package/dist/components/VirtualTable/utils.d.ts +2 -0
  21. package/dist/components/VirtualTable/utils.js +21 -0
  22. package/dist/containers/ClusterModeGuard/ClusterModeGuard.js +1 -1
  23. package/dist/containers/Clusters/Clusters.js +3 -2
  24. package/dist/containers/Clusters/Clusters.scss +5 -0
  25. package/dist/containers/Clusters/columns.d.ts +1 -0
  26. package/dist/containers/Clusters/columns.js +4 -3
  27. package/dist/containers/Nodes/Nodes.js +4 -4
  28. package/dist/containers/Nodes/Nodes.scss +0 -5
  29. package/dist/containers/Nodes/VirtualNodes.js +4 -6
  30. package/dist/containers/Nodes/getNodesColumns.d.ts +1 -0
  31. package/dist/containers/Nodes/getNodesColumns.js +9 -1
  32. package/dist/containers/PDiskPage/PDiskGroups.js +3 -3
  33. package/dist/containers/PDiskPage/PDiskPage.js +6 -1
  34. package/dist/containers/Storage/Storage.scss +0 -4
  35. package/dist/containers/Storage/StorageGroups/StorageGroups.js +3 -3
  36. package/dist/containers/Storage/StorageGroups/VirtualStorageGroups.js +3 -3
  37. package/dist/containers/Storage/StorageGroups/getStorageGroupsColumns.d.ts +3 -0
  38. package/dist/containers/Storage/StorageGroups/getStorageGroupsColumns.js +7 -3
  39. package/dist/containers/Storage/StorageNodes/StorageNodes.js +3 -3
  40. package/dist/containers/Storage/StorageNodes/VirtualStorageNodes.js +3 -3
  41. package/dist/containers/Storage/StorageNodes/getStorageNodesColumns.d.ts +3 -0
  42. package/dist/containers/Storage/StorageNodes/getStorageNodesColumns.js +2 -0
  43. package/dist/containers/Tablet/Tablet.scss +0 -4
  44. package/dist/containers/Tablet/TabletTable/TabletTable.js +5 -3
  45. package/dist/containers/Tenant/Acl/Acl.js +3 -2
  46. package/dist/containers/Tenant/Acl/Acl.scss +0 -6
  47. package/dist/containers/Tenant/Diagnostics/Consumers/Consumers.js +3 -3
  48. package/dist/containers/Tenant/Diagnostics/Consumers/Consumers.scss +2 -0
  49. package/dist/containers/Tenant/Diagnostics/Consumers/columns/columns.d.ts +1 -0
  50. package/dist/containers/Tenant/Diagnostics/Consumers/columns/columns.js +2 -0
  51. package/dist/containers/Tenant/Diagnostics/HotKeys/HotKeys.js +5 -4
  52. package/dist/containers/Tenant/Diagnostics/HotKeys/HotKeys.scss +1 -5
  53. package/dist/containers/Tenant/Diagnostics/Partitions/Partitions.js +8 -4
  54. package/dist/containers/Tenant/Diagnostics/Partitions/Partitions.scss +2 -0
  55. package/dist/containers/Tenant/Diagnostics/Partitions/PartitionsControls/PartitionsControls.js +1 -1
  56. package/dist/containers/Tenant/Diagnostics/Partitions/columns/Columns.scss +0 -8
  57. package/dist/containers/Tenant/Diagnostics/Partitions/columns/columns.d.ts +1 -0
  58. package/dist/containers/Tenant/Diagnostics/Partitions/columns/columns.js +11 -4
  59. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopNodesByCpu.js +2 -2
  60. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopNodesByLoad.js +2 -2
  61. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopQueries.js +3 -2
  62. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopShards.js +2 -2
  63. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantMemory/TopNodesByMemory.js +2 -2
  64. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.scss +3 -7
  65. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverviewTableLayout.d.ts +2 -2
  66. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverviewTableLayout.js +2 -2
  67. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/TopGroups.js +2 -2
  68. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/TopTables.js +4 -2
  69. package/dist/containers/Tenant/Diagnostics/TopQueries/TopQueries.js +8 -11
  70. package/dist/containers/Tenant/Diagnostics/TopQueries/TopQueries.scss +2 -24
  71. package/dist/containers/Tenant/Diagnostics/TopQueries/getTopQueriesColumns.d.ts +1 -0
  72. package/dist/containers/Tenant/Diagnostics/TopQueries/getTopQueriesColumns.js +7 -0
  73. package/dist/containers/Tenant/Diagnostics/TopShards/Filters/Filters.d.ts +1 -2
  74. package/dist/containers/Tenant/Diagnostics/TopShards/Filters/Filters.js +3 -4
  75. package/dist/containers/Tenant/Diagnostics/TopShards/TopShards.d.ts +0 -1
  76. package/dist/containers/Tenant/Diagnostics/TopShards/TopShards.js +8 -10
  77. package/dist/containers/Tenant/Diagnostics/TopShards/TopShards.scss +4 -15
  78. package/dist/containers/Tenant/Diagnostics/TopShards/getTopShardsColumns.d.ts +1 -0
  79. package/dist/containers/Tenant/Diagnostics/TopShards/getTopShardsColumns.js +5 -0
  80. package/dist/containers/Tenant/ObjectSummary/ObjectSummary.js +1 -1
  81. package/dist/containers/Tenant/ObjectSummary/ObjectSummary.scss +0 -6
  82. package/dist/containers/Tenant/Query/ExecuteResult/ExecuteResult.scss +1 -21
  83. package/dist/containers/Tenant/Query/ExplainResult/ExplainResult.js +4 -4
  84. package/dist/containers/Tenant/Query/ExplainResult/utils.d.ts +0 -3
  85. package/dist/containers/Tenant/Query/ExplainResult/utils.js +0 -34
  86. package/dist/containers/Tenant/Query/Preview/Preview.scss +6 -3
  87. package/dist/containers/Tenant/Query/QueriesHistory/QueriesHistory.js +4 -2
  88. package/dist/containers/Tenant/Query/QueriesHistory/QueriesHistory.scss +0 -1
  89. package/dist/containers/Tenant/Query/QueryEditor/QueryEditor.js +2 -1
  90. package/dist/containers/Tenant/Query/QueryEditor/helpers.js +5 -3
  91. package/dist/containers/Tenant/Query/SavedQueries/SavedQueries.js +4 -1
  92. package/dist/containers/Tenant/Query/SavedQueries/SavedQueries.scss +0 -1
  93. package/dist/containers/Tenant/Schema/SchemaViewer/SchemaViewer.d.ts +1 -2
  94. package/dist/containers/Tenant/Schema/SchemaViewer/SchemaViewer.js +4 -3
  95. package/dist/containers/Tenant/Schema/SchemaViewer/helpers.d.ts +1 -0
  96. package/dist/containers/Tenant/Schema/SchemaViewer/helpers.js +4 -2
  97. package/dist/containers/Tenant/Tenant.js +1 -1
  98. package/dist/containers/Tenants/Tenants.js +8 -3
  99. package/dist/containers/Tenants/Tenants.scss +13 -5
  100. package/dist/containers/UserSettings/i18n/en.json +2 -0
  101. package/dist/containers/UserSettings/i18n/index.d.ts +1 -1
  102. package/dist/containers/UserSettings/settings.d.ts +1 -0
  103. package/dist/containers/UserSettings/settings.js +7 -2
  104. package/dist/containers/Versions/GroupedNodesTree/GroupedNodesTree.scss +0 -2
  105. package/dist/containers/Versions/NodesTable/NodesTable.js +14 -9
  106. package/dist/services/api.d.ts +9 -1
  107. package/dist/services/api.js +5 -0
  108. package/dist/services/settings.js +2 -1
  109. package/dist/styles/mixins.scss +0 -47
  110. package/dist/types/api/autocomplete.d.ts +21 -0
  111. package/dist/types/api/autocomplete.js +1 -0
  112. package/dist/types/api/restartPDisk.d.ts +4 -0
  113. package/dist/types/api/restartPDisk.js +1 -0
  114. package/dist/utils/constants.d.ts +26 -10
  115. package/dist/utils/constants.js +1 -0
  116. package/dist/utils/hooks/useTableResize.d.ts +2 -7
  117. package/dist/utils/hooks/useTableResize.js +12 -24
  118. package/dist/utils/monaco/index.js +2 -0
  119. package/dist/utils/monaco/{yqlSuggestions → yql}/constants.d.ts +1 -0
  120. package/dist/utils/monaco/{yqlSuggestions → yql}/constants.js +1 -0
  121. package/dist/utils/monaco/{yqlSuggestions → yql}/generateSuggestions.d.ts +3 -3
  122. package/dist/utils/monaco/{yqlSuggestions → yql}/generateSuggestions.js +124 -64
  123. package/dist/utils/monaco/yql/registerLanguage.d.ts +1 -0
  124. package/dist/utils/monaco/yql/registerLanguage.js +8 -0
  125. package/dist/utils/monaco/{yqlSuggestions/registerCompletionItemProvider.js → yql/yql.completionItemProvider.js} +3 -2
  126. package/dist/utils/monaco/yql/yql.d.ts +7 -0
  127. package/dist/utils/monaco/yql/yql.js +180 -0
  128. package/dist/utils/monaco/yql/yql.keywords.d.ts +3 -0
  129. package/dist/utils/monaco/yql/yql.keywords.js +3 -0
  130. package/dist/utils/monaco/{yqlSuggestions → yql}/yqlSuggestions.js +14 -7
  131. package/package.json +12 -12
  132. package/dist/containers/Tenant/Diagnostics/TopShards/Filters/Filters.scss +0 -8
  133. /package/dist/utils/monaco/{yqlSuggestions/registerCompletionItemProvider.d.ts → yql/yql.completionItemProvider.d.ts} +0 -0
  134. /package/dist/utils/monaco/{yqlSuggestions → yql}/yqlSuggestions.d.ts +0 -0
@@ -15,7 +15,5 @@
15
15
  &__body {
16
16
  display: flex;
17
17
  align-items: center;
18
-
19
- padding: 16px 16px 0;
20
18
  }
21
19
  }
@@ -1,11 +1,18 @@
1
1
  .date-range {
2
2
  &__input {
3
3
  min-width: 190px;
4
+ height: 28px;
4
5
  padding: 5px 8px;
5
6
 
6
7
  color: var(--g-color-text-primary);
7
8
  border: 1px solid var(--g-color-line-generic);
8
9
  border-radius: var(--g-border-radius-m);
10
+ outline: none;
9
11
  background: transparent;
10
12
  }
13
+
14
+ &__input:focus,
15
+ &__input:focus-visible {
16
+ border: 1px solid var(--g-color-line-generic-hover);
17
+ }
11
18
  }
@@ -20,5 +20,5 @@ export const NodeHostWrapper = ({ node, getNodeRef }) => {
20
20
  tenantName: node.TenantName,
21
21
  })
22
22
  : undefined;
23
- return (_jsx(CellWithPopover, { disabled: !isNodeAvailable, content: _jsx(NodeEndpointsTooltipContent, { data: node }), placement: ['top', 'bottom'], behavior: PopoverBehavior.Immediate, children: _jsxs("div", { className: b('host-wrapper'), children: [_jsx(EntityStatus, { name: node.Host, status: node.SystemState, path: nodePath, hasClipboardButton: true, className: b('host') }), nodeRef && (_jsx(Button, { size: "s", href: nodeRef, className: b('external-button'), target: "_blank", children: _jsx(Icon, { name: "external" }) }))] }) }));
23
+ return (_jsxs(CellWithPopover, { disabled: !isNodeAvailable, content: _jsx(NodeEndpointsTooltipContent, { data: node }), placement: ['top', 'bottom'], behavior: PopoverBehavior.Immediate, children: [_jsx(EntityStatus, { name: node.Host, status: node.SystemState, path: nodePath, hasClipboardButton: true, className: b('host') }), nodeRef && (_jsx(Button, { size: "s", href: nodeRef, className: b('external-button'), target: "_blank", children: _jsx(Icon, { name: "external" }) }))] }));
24
24
  };
@@ -1,10 +1,4 @@
1
1
  .ydb-node-host-wrapper {
2
- &__host-wrapper {
3
- display: flex;
4
-
5
- width: 330px;
6
- }
7
-
8
2
  &__host {
9
3
  overflow: hidden;
10
4
  }
@@ -1,8 +1,8 @@
1
- import type { DataTableProps } from '@gravity-ui/react-data-table';
2
1
  import type { ColumnType, KeyValueRow } from '../../types/api/query';
2
+ import type { ResizeableDataTableProps } from '../ResizeableDataTable/ResizeableDataTable';
3
3
  import './QueryResultTable.scss';
4
4
  export declare const b: import("@bem-react/classname").ClassNameFormatter;
5
- interface QueryResultTableProps extends Omit<DataTableProps<KeyValueRow>, 'data' | 'columns' | 'theme'> {
5
+ interface QueryResultTableProps extends Omit<ResizeableDataTableProps<KeyValueRow>, 'data' | 'columns'> {
6
6
  data?: KeyValueRow[];
7
7
  columns?: ColumnType[];
8
8
  }
@@ -6,6 +6,7 @@ import { cn } from '../../utils/cn';
6
6
  import { DEFAULT_TABLE_SETTINGS } from '../../utils/constants';
7
7
  import { getColumnType, prepareQueryResponse } from '../../utils/query';
8
8
  import { isNumeric } from '../../utils/utils';
9
+ import { ResizeableDataTable } from '../ResizeableDataTable/ResizeableDataTable';
9
10
  import { Cell } from './Cell';
10
11
  import i18n from './i18n';
11
12
  import './QueryResultTable.scss';
@@ -62,7 +63,7 @@ export const QueryResultTable = (props) => {
62
63
  if (!columns.length) {
63
64
  return _jsx("div", { className: b('message'), children: i18n('empty') });
64
65
  }
65
- return (_jsx(DataTable, Object.assign({ theme: "yandex-cloud", data: data, columns: columns, settings: settings,
66
+ return (_jsx(ResizeableDataTable, Object.assign({ data: data, columns: columns, settings: settings,
66
67
  // prevent accessing row.id in case it is present but is not the PK (i.e. may repeat)
67
68
  rowKey: getRowIndex }, restProps)));
68
69
  };
@@ -2,6 +2,7 @@
2
2
 
3
3
  .ydb-query-result-table {
4
4
  &__cell {
5
+ width: 100%;
5
6
  @include cell-container;
6
7
  }
7
8
 
@@ -0,0 +1,7 @@
1
+ import type { DataTableProps } from '@gravity-ui/react-data-table';
2
+ import './ResizeableDataTable.scss';
3
+ export interface ResizeableDataTableProps<T> extends Omit<DataTableProps<T>, 'theme' | 'onResize'> {
4
+ columnsWidthLSKey?: string;
5
+ wrapperClassName?: string;
6
+ }
7
+ export declare function ResizeableDataTable<T>({ columnsWidthLSKey, columns, settings, wrapperClassName, ...props }: ResizeableDataTableProps<T>): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import { __rest } from "tslib";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import DataTable, { updateColumnsWidth } from '@gravity-ui/react-data-table';
4
+ import { cn } from '../../utils/cn';
5
+ import { useTableResize } from '../../utils/hooks/useTableResize';
6
+ import './ResizeableDataTable.scss';
7
+ const b = cn('ydb-resizeable-data-table');
8
+ export function ResizeableDataTable(_a) {
9
+ var { columnsWidthLSKey, columns, settings, wrapperClassName } = _a, props = __rest(_a, ["columnsWidthLSKey", "columns", "settings", "wrapperClassName"]);
10
+ const [tableColumnsWidth, setTableColumnsWidth] = useTableResize(columnsWidthLSKey);
11
+ const updatedColumns = updateColumnsWidth(columns, tableColumnsWidth);
12
+ const newSettings = Object.assign(Object.assign({}, settings), { defaultResizeable: true });
13
+ return (_jsx("div", { className: b(null, wrapperClassName), children: _jsx(DataTable, Object.assign({ theme: "yandex-cloud", columns: updatedColumns, onResize: setTableColumnsWidth, settings: newSettings }, props)) }));
14
+ }
@@ -0,0 +1,8 @@
1
+ .ydb-resizeable-data-table {
2
+ display: flex;
3
+
4
+ width: max-content;
5
+
6
+ // padding for easier resize of the last column
7
+ padding-right: 20px;
8
+ }
@@ -0,0 +1,8 @@
1
+ interface ResizeHandlerProps {
2
+ maxWidth?: number;
3
+ minWidth?: number;
4
+ getCurrentColumnWidth: () => number | undefined;
5
+ onResize?: (width: number) => void;
6
+ }
7
+ export declare function ResizeHandler({ minWidth, maxWidth, getCurrentColumnWidth, onResize, }: ResizeHandlerProps): import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,62 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import React from 'react';
3
+ import { b } from './shared';
4
+ import { calculateColumnWidth, rafThrottle } from './utils';
5
+ export function ResizeHandler({ minWidth, maxWidth, getCurrentColumnWidth, onResize, }) {
6
+ const elementRef = React.useRef(null);
7
+ const [resizing, setResizing] = React.useState(false);
8
+ React.useEffect(() => {
9
+ const element = elementRef.current;
10
+ if (!element) {
11
+ return undefined;
12
+ }
13
+ let mouseXPosition;
14
+ let initialColumnWidth;
15
+ let currentColumnWidth;
16
+ const onMouseMove = rafThrottle((e) => {
17
+ restrictMouseEvent(e);
18
+ if (typeof mouseXPosition !== 'number' || typeof initialColumnWidth !== 'number') {
19
+ return;
20
+ }
21
+ const xDiff = e.clientX - mouseXPosition;
22
+ const newWidth = calculateColumnWidth(initialColumnWidth + xDiff, minWidth, maxWidth);
23
+ if (newWidth === currentColumnWidth) {
24
+ return;
25
+ }
26
+ currentColumnWidth = newWidth;
27
+ onResize === null || onResize === void 0 ? void 0 : onResize(currentColumnWidth);
28
+ });
29
+ const onMouseUp = (e) => {
30
+ restrictMouseEvent(e);
31
+ if (currentColumnWidth !== undefined) {
32
+ onResize === null || onResize === void 0 ? void 0 : onResize(currentColumnWidth);
33
+ }
34
+ setResizing(false);
35
+ mouseXPosition = undefined;
36
+ document.removeEventListener('mousemove', onMouseMove);
37
+ document.removeEventListener('mouseup', onMouseUp);
38
+ };
39
+ const onMouseDown = (e) => {
40
+ initialColumnWidth = getCurrentColumnWidth();
41
+ restrictMouseEvent(e);
42
+ mouseXPosition = e.clientX;
43
+ setResizing(true);
44
+ document.addEventListener('mousemove', onMouseMove);
45
+ document.addEventListener('mouseup', onMouseUp);
46
+ };
47
+ element.addEventListener('mousedown', onMouseDown);
48
+ return () => {
49
+ element.removeEventListener('mousedown', onMouseDown);
50
+ document.removeEventListener('mousemove', onMouseMove);
51
+ document.removeEventListener('mouseup', onMouseUp);
52
+ };
53
+ }, [onResize, minWidth, maxWidth, getCurrentColumnWidth]);
54
+ return (_jsx("span", { ref: elementRef, className: b('resize-handler', { resizing }),
55
+ // Prevent sort trigger on resize
56
+ onClick: (e) => restrictMouseEvent(e) }));
57
+ }
58
+ // Prevent sort trigger and text selection on resize
59
+ function restrictMouseEvent(e) {
60
+ e.preventDefault();
61
+ e.stopPropagation();
62
+ }
@@ -0,0 +1,6 @@
1
+ import type { VirtualTableProps } from './VirtualTable';
2
+ interface ResizeableVirtualTableProps<T> extends Omit<VirtualTableProps<T>, 'onColumnsResize'> {
3
+ columnsWidthLSKey: string;
4
+ }
5
+ export declare function ResizeableVirtualTable<T>({ columnsWidthLSKey, columns, ...props }: ResizeableVirtualTableProps<T>): import("react/jsx-runtime").JSX.Element;
6
+ export {};
@@ -0,0 +1,16 @@
1
+ import { __rest } from "tslib";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { useTableResize } from '../../utils/hooks/useTableResize';
4
+ import { VirtualTable } from './VirtualTable';
5
+ function updateColumnsWidth(columns, columnsWidthSetup) {
6
+ return columns.map((column) => {
7
+ var _a;
8
+ return Object.assign(Object.assign({}, column), { width: (_a = columnsWidthSetup[column.name]) !== null && _a !== void 0 ? _a : column.width });
9
+ });
10
+ }
11
+ export function ResizeableVirtualTable(_a) {
12
+ var { columnsWidthLSKey, columns } = _a, props = __rest(_a, ["columnsWidthLSKey", "columns"]);
13
+ const [tableColumnsWidth, setTableColumnsWidth] = useTableResize(columnsWidthLSKey);
14
+ const updatedColumns = updateColumnsWidth(columns, tableColumnsWidth);
15
+ return (_jsx(VirtualTable, Object.assign({ columns: updatedColumns, onColumnsResize: setTableColumnsWidth }, props)));
16
+ }
@@ -1,5 +1,4 @@
1
- import type { HandleTableColumnsResize } from '../../utils/hooks/useTableResize';
2
- import type { Column, OnSort, SortOrderType } from './types';
1
+ import type { Column, HandleTableColumnsResize, OnSort, SortOrderType } from './types';
3
2
  interface TableHeadCellProps<T> {
4
3
  column: Column<T>;
5
4
  resizeable?: boolean;
@@ -9,8 +8,9 @@ interface TableHeadCellProps<T> {
9
8
  rowHeight: number;
10
9
  onCellMount?: (element: Element) => void;
11
10
  onCellUnMount?: (element: Element) => void;
11
+ onColumnsResize?: HandleTableColumnsResize;
12
12
  }
13
- export declare const TableHeadCell: <T>({ column, resizeable, sortOrder, defaultSortOrder, onSort, rowHeight, onCellMount, onCellUnMount, }: TableHeadCellProps<T>) => import("react/jsx-runtime").JSX.Element;
13
+ export declare const TableHeadCell: <T>({ column, resizeable, sortOrder, defaultSortOrder, onSort, rowHeight, onCellMount, onCellUnMount, onColumnsResize, }: TableHeadCellProps<T>) => import("react/jsx-runtime").JSX.Element;
14
14
  interface TableHeadProps<T> {
15
15
  columns: Column<T>[];
16
16
  onSort?: OnSort;
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React from 'react';
3
+ import { ResizeHandler } from './ResizeHandler';
3
4
  import { ASCENDING, DEFAULT_RESIZEABLE, DEFAULT_SORT_ORDER, DEFAULT_TABLE_ROW_HEIGHT, DESCENDING, } from './constants';
4
5
  import { b } from './shared';
5
- const COLUMN_NAME_HTML_ATTRIBUTE = 'data-columnname';
6
6
  // Icon similar to original DataTable icons to keep the same tables across diferent pages and tabs
7
7
  const SortIcon = ({ order }) => {
8
8
  return (_jsx("svg", { className: b('sort-icon', { desc: order === DESCENDING }), viewBox: "0 0 10 6", width: "10", height: "6", children: _jsx("path", { fill: "currentColor", d: "M0 5h10l-5 -5z" }) }));
@@ -15,7 +15,7 @@ const ColumnSortIcon = ({ sortOrder, sortable, defaultSortOrder }) => {
15
15
  return null;
16
16
  }
17
17
  };
18
- export const TableHeadCell = ({ column, resizeable, sortOrder, defaultSortOrder, onSort, rowHeight, onCellMount, onCellUnMount, }) => {
18
+ export const TableHeadCell = ({ column, resizeable, sortOrder, defaultSortOrder, onSort, rowHeight, onCellMount, onCellUnMount, onColumnsResize, }) => {
19
19
  var _a;
20
20
  const cellWrapperRef = React.useRef(null);
21
21
  React.useEffect(() => {
@@ -29,40 +29,25 @@ export const TableHeadCell = ({ column, resizeable, sortOrder, defaultSortOrder,
29
29
  }
30
30
  };
31
31
  }, [onCellMount, onCellUnMount]);
32
+ const getCurrentColumnWidth = React.useCallback(() => {
33
+ var _a;
34
+ return (_a = cellWrapperRef.current) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect().width;
35
+ }, []);
36
+ const handleResize = React.useCallback((newWidth) => {
37
+ onColumnsResize === null || onColumnsResize === void 0 ? void 0 : onColumnsResize(column.name, newWidth);
38
+ }, [onColumnsResize, column.name]);
32
39
  const content = (_a = column.header) !== null && _a !== void 0 ? _a : column.name;
33
- return (_jsx("th", { children: _jsx("div", { ref: cellWrapperRef, className: b('head-cell-wrapper', { resizeable }), style: {
40
+ return (_jsx("th", { children: _jsxs("div", { ref: cellWrapperRef, className: b('head-cell-wrapper'), style: {
34
41
  height: `${rowHeight}px`,
35
42
  width: `${column.width}px`,
36
- }, [COLUMN_NAME_HTML_ATTRIBUTE]: column.name, children: _jsxs("div", { className: b('head-cell', { align: column.align, sortable: column.sortable }, column.className), onClick: () => {
37
- if (column.sortable) {
38
- onSort === null || onSort === void 0 ? void 0 : onSort(column.name);
39
- }
40
- }, children: [_jsx("div", { className: b('head-cell-content'), children: content }), _jsx(ColumnSortIcon, { sortOrder: sortOrder, sortable: column.sortable, defaultSortOrder: defaultSortOrder })] }) }) }));
43
+ }, children: [_jsxs("div", { className: b('head-cell', { align: column.align, sortable: column.sortable }, column.className), onClick: () => {
44
+ if (column.sortable) {
45
+ onSort === null || onSort === void 0 ? void 0 : onSort(column.name);
46
+ }
47
+ }, children: [_jsx("div", { className: b('head-cell-content'), children: content }), _jsx(ColumnSortIcon, { sortOrder: sortOrder, sortable: column.sortable, defaultSortOrder: defaultSortOrder })] }), resizeable ? (_jsx(ResizeHandler, { maxWidth: column.resizeMaxWidth, minWidth: column.resizeMinWidth, getCurrentColumnWidth: getCurrentColumnWidth, onResize: handleResize })) : null] }) }));
41
48
  };
42
49
  export const TableHead = ({ columns, onSort, onColumnsResize, defaultSortOrder = DEFAULT_SORT_ORDER, rowHeight = DEFAULT_TABLE_ROW_HEIGHT, }) => {
43
50
  const [sortParams, setSortParams] = React.useState({});
44
- const isTableResizeable = Boolean(onColumnsResize);
45
- const resizeObserver = React.useMemo(() => {
46
- if (!isTableResizeable) {
47
- return undefined;
48
- }
49
- return new ResizeObserver((entries) => {
50
- const columnsWidth = {};
51
- entries.forEach((entry) => {
52
- var _a;
53
- // @ts-expect-error ignore custrom property usage
54
- const id = (_a = entry.target.attributes[COLUMN_NAME_HTML_ATTRIBUTE]) === null || _a === void 0 ? void 0 : _a.value;
55
- columnsWidth[id] = entry.contentRect.width;
56
- });
57
- onColumnsResize === null || onColumnsResize === void 0 ? void 0 : onColumnsResize(columnsWidth);
58
- });
59
- }, [onColumnsResize, isTableResizeable]);
60
- const handleCellMount = React.useCallback((element) => {
61
- resizeObserver === null || resizeObserver === void 0 ? void 0 : resizeObserver.observe(element);
62
- }, [resizeObserver]);
63
- const handleCellUnMount = React.useCallback((element) => {
64
- resizeObserver === null || resizeObserver === void 0 ? void 0 : resizeObserver.unobserve(element);
65
- }, [resizeObserver]);
66
51
  const handleSort = (columnId) => {
67
52
  let newSortParams = {};
68
53
  // Order is changed in following order:
@@ -100,7 +85,7 @@ export const TableHead = ({ columns, onSort, onColumnsResize, defaultSortOrder =
100
85
  var _a;
101
86
  const sortOrder = sortParams.columnId === column.name ? sortParams.sortOrder : undefined;
102
87
  const resizeable = onColumnsResize && ((_a = column.resizeable) !== null && _a !== void 0 ? _a : DEFAULT_RESIZEABLE);
103
- return (_jsx(TableHeadCell, { column: column, resizeable: resizeable, sortOrder: sortOrder, defaultSortOrder: defaultSortOrder, onSort: handleSort, rowHeight: rowHeight, onCellMount: handleCellMount, onCellUnMount: handleCellUnMount }, column.name));
88
+ return (_jsx(TableHeadCell, { column: column, resizeable: resizeable, sortOrder: sortOrder, defaultSortOrder: defaultSortOrder, onSort: handleSort, rowHeight: rowHeight, onColumnsResize: onColumnsResize }, column.name));
104
89
  }) }) }));
105
90
  };
106
91
  return (_jsxs(React.Fragment, { children: [renderTableColGroups(), renderTableHead()] }));
@@ -1,7 +1,6 @@
1
- import type { HandleTableColumnsResize } from '../../utils/hooks/useTableResize';
2
- import type { Column, FetchData, GetRowClassName, RenderControls, RenderEmptyDataMessage, RenderErrorMessage, SortParams } from './types';
1
+ import type { Column, FetchData, GetRowClassName, HandleTableColumnsResize, RenderControls, RenderEmptyDataMessage, RenderErrorMessage, SortParams } from './types';
3
2
  import './VirtualTable.scss';
4
- interface VirtualTableProps<T> {
3
+ export interface VirtualTableProps<T> {
5
4
  limit: number;
6
5
  fetchData: FetchData<T>;
7
6
  columns: Column<T>[];
@@ -16,4 +15,3 @@ interface VirtualTableProps<T> {
16
15
  dependencyArray?: unknown[];
17
16
  }
18
17
  export declare const VirtualTable: <T>({ limit, fetchData, columns, getRowClassName, rowHeight, parentContainer, initialSortParams, onColumnsResize, renderControls, renderEmptyDataMessage, renderErrorMessage, dependencyArray, }: VirtualTableProps<T>) => import("react/jsx-runtime").JSX.Element;
19
- export {};
@@ -60,14 +60,12 @@
60
60
  }
61
61
 
62
62
  &__head-cell-wrapper {
63
+ position: relative;
64
+
63
65
  display: flex;
64
66
  overflow-x: hidden;
65
67
 
66
68
  border-bottom: $cell-border;
67
-
68
- &_resizeable {
69
- resize: horizontal;
70
- }
71
69
  }
72
70
 
73
71
  &__head-cell {
@@ -145,4 +143,26 @@
145
143
  }
146
144
  }
147
145
  }
146
+
147
+ &__resize-handler {
148
+ position: absolute;
149
+ top: 0;
150
+ right: 0;
151
+
152
+ visibility: hidden;
153
+
154
+ width: 6px;
155
+ height: 100%;
156
+
157
+ cursor: col-resize;
158
+
159
+ background-color: var(--g-color-base-generic);
160
+
161
+ &_resizing {
162
+ visibility: visible;
163
+ }
164
+ }
165
+ &__head-cell-wrapper:hover > &__resize-handler {
166
+ visibility: visible;
167
+ }
148
168
  }
@@ -18,6 +18,7 @@ export type SortParams = {
18
18
  sortOrder?: SortOrderType;
19
19
  };
20
20
  export type OnSort = (params: SortParams) => void;
21
+ export type HandleTableColumnsResize = (columnId: string, width: number) => void;
21
22
  export interface Column<T> {
22
23
  name: string;
23
24
  header?: React.ReactNode;
@@ -29,6 +30,8 @@ export interface Column<T> {
29
30
  index: number;
30
31
  }) => React.ReactNode;
31
32
  width: number;
33
+ resizeMaxWidth?: number;
34
+ resizeMinWidth?: number;
32
35
  align: AlignType;
33
36
  }
34
37
  export interface VirtualTableData<T> {
@@ -0,0 +1,2 @@
1
+ export declare function rafThrottle<Fn extends (...args: any[]) => any>(fn: Fn): (...args: Parameters<Fn>) => void;
2
+ export declare function calculateColumnWidth(newWidth: number, minWidth?: number, maxWidth?: number): number;
@@ -0,0 +1,21 @@
1
+ // invoke passed function at most once per animation frame
2
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
3
+ export function rafThrottle(fn) {
4
+ let rafId = null;
5
+ let latestArgs;
6
+ return function throttled(...args) {
7
+ // call throttled function with latest args
8
+ latestArgs = args;
9
+ if (typeof rafId === 'number') {
10
+ return;
11
+ }
12
+ rafId = requestAnimationFrame(() => {
13
+ fn(...latestArgs);
14
+ rafId = null;
15
+ });
16
+ };
17
+ }
18
+ // 40px minWidth so sort icon won't overlap wrapped column title
19
+ export function calculateColumnWidth(newWidth, minWidth = 40, maxWidth = Infinity) {
20
+ return Math.max(minWidth, Math.min(newWidth, maxWidth));
21
+ }
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import React from 'react';
3
- import { useTypedSelector } from '../../lib';
3
+ import { useTypedSelector } from '../../utils/hooks';
4
4
  export function ClusterModeGuard({ children, mode }) {
5
5
  const shouldRender = useTypedSelector((state) => mode === 'single' ? state.singleClusterMode : !state.singleClusterMode);
6
6
  return shouldRender ? _jsx(React.Fragment, { children: children }) : null;
@@ -5,6 +5,7 @@ import { Select, TableColumnSetup } from '@gravity-ui/uikit';
5
5
  import { Helmet } from 'react-helmet-async';
6
6
  import { ResponseError } from '../../components/Errors/ResponseError';
7
7
  import { Loader } from '../../components/Loader';
8
+ import { ResizeableDataTable } from '../../components/ResizeableDataTable/ResizeableDataTable';
8
9
  import { Search } from '../../components/Search';
9
10
  import { changeClustersFilters, clustersApi } from '../../store/reducers/clusters/clusters';
10
11
  import { aggregateClustersInfo, filterClusters, selectClusterNameFilter, selectServiceFilter, selectStatusFilter, selectVersionFilter, } from '../../store/reducers/clusters/selectors';
@@ -12,7 +13,7 @@ import { DEFAULT_POLLING_INTERVAL, DEFAULT_TABLE_SETTINGS } from '../../utils/co
12
13
  import { useTypedDispatch, useTypedSelector } from '../../utils/hooks';
13
14
  import { getMinorVersion } from '../../utils/versions';
14
15
  import { ClustersStatistics } from './ClustersStatistics';
15
- import { CLUSTERS_COLUMNS } from './columns';
16
+ import { CLUSTERS_COLUMNS, CLUSTERS_COLUMNS_WIDTH_LS_KEY } from './columns';
16
17
  import { CLUSTER_STATUSES, COLUMNS_NAMES, COLUMNS_TITLES, DEFAULT_COLUMNS, SELECTED_COLUMNS_KEY, } from './constants';
17
18
  import i18n from './i18n';
18
19
  import { b } from './shared';
@@ -69,7 +70,7 @@ export function Clusters() {
69
70
  if (query.isLoading) {
70
71
  return _jsx(Loader, { size: "l" });
71
72
  }
72
- return (_jsxs("div", { className: b(), children: [_jsx(Helmet, { children: _jsx("title", { children: i18n('page_title') }) }), _jsx(ClustersStatistics, { stats: aggregation, count: filteredClusters.length }), _jsxs("div", { className: b('controls'), children: [_jsx("div", { className: b('control', { wide: true }), children: _jsx(Search, { placeholder: i18n('controls_search-placeholder'), onChange: changeClusterName, value: clusterName }) }), _jsx("div", { className: b('control'), children: _jsx(Select, { multiple: true, filterable: true, hasClear: true, placeholder: i18n('controls_select-placeholder'), label: i18n('controls_status-select-label'), value: status, options: CLUSTER_STATUSES, onUpdate: changeStatus, width: "max" }) }), _jsx("div", { className: b('control'), children: _jsx(Select, { multiple: true, filterable: true, hasClear: true, placeholder: i18n('controls_select-placeholder'), label: i18n('controls_service-select-label'), value: service, options: servicesToSelect, onUpdate: changeService, width: "max" }) }), _jsx("div", { className: b('control'), children: _jsx(Select, { multiple: true, filterable: true, hasClear: true, placeholder: i18n('controls_select-placeholder'), label: i18n('controls_version-select-label'), value: version, options: versions, onUpdate: changeVersion, width: "max" }) }), _jsx("div", { className: b('control'), children: _jsx(TableColumnSetup, { popupWidth: 242, items: columnsToSelect, showStatus: true, onUpdate: setColumns, sortable: false }, "TableColumnSetup") })] }), query.isError ? _jsx(ResponseError, { error: query.error, className: b('error') }) : null, _jsx("div", { className: b('table-wrapper'), children: _jsx("div", { className: b('table-content'), children: _jsx(DataTable, { theme: "yandex-cloud", data: filteredClusters, columns: columnsToShow, settings: Object.assign(Object.assign({}, DEFAULT_TABLE_SETTINGS), { dynamicRender: false }), initialSortOrder: {
73
+ return (_jsxs("div", { className: b(), children: [_jsx(Helmet, { children: _jsx("title", { children: i18n('page_title') }) }), _jsx(ClustersStatistics, { stats: aggregation, count: filteredClusters.length }), _jsxs("div", { className: b('controls'), children: [_jsx("div", { className: b('control', { wide: true }), children: _jsx(Search, { placeholder: i18n('controls_search-placeholder'), onChange: changeClusterName, value: clusterName }) }), _jsx("div", { className: b('control'), children: _jsx(Select, { multiple: true, filterable: true, hasClear: true, placeholder: i18n('controls_select-placeholder'), label: i18n('controls_status-select-label'), value: status, options: CLUSTER_STATUSES, onUpdate: changeStatus, width: "max" }) }), _jsx("div", { className: b('control'), children: _jsx(Select, { multiple: true, filterable: true, hasClear: true, placeholder: i18n('controls_select-placeholder'), label: i18n('controls_service-select-label'), value: service, options: servicesToSelect, onUpdate: changeService, width: "max" }) }), _jsx("div", { className: b('control'), children: _jsx(Select, { multiple: true, filterable: true, hasClear: true, placeholder: i18n('controls_select-placeholder'), label: i18n('controls_version-select-label'), value: version, options: versions, onUpdate: changeVersion, width: "max" }) }), _jsx("div", { className: b('control'), children: _jsx(TableColumnSetup, { popupWidth: 242, items: columnsToSelect, showStatus: true, onUpdate: setColumns, sortable: false }, "TableColumnSetup") })] }), query.isError ? _jsx(ResponseError, { error: query.error, className: b('error') }) : null, _jsx("div", { className: b('table-wrapper'), children: _jsx("div", { className: b('table-content'), children: _jsx(ResizeableDataTable, { columnsWidthLSKey: CLUSTERS_COLUMNS_WIDTH_LS_KEY, wrapperClassName: b('table'), data: filteredClusters, columns: columnsToShow, settings: Object.assign(Object.assign({}, DEFAULT_TABLE_SETTINGS), { dynamicRender: false }), initialSortOrder: {
73
74
  columnId: COLUMNS_NAMES.TITLE,
74
75
  order: DataTable.ASCENDING,
75
76
  } }) }) })] }));
@@ -151,8 +151,13 @@
151
151
  &__table-content {
152
152
  overflow: auto;
153
153
 
154
+ height: 100%;
155
+ }
156
+
157
+ &__table {
154
158
  @include mixins.freeze-nth-column(1);
155
159
  }
160
+
156
161
  &__balancer-cell {
157
162
  display: flex;
158
163
  flex-direction: row;
@@ -1,3 +1,4 @@
1
1
  import type { Column } from '@gravity-ui/react-data-table';
2
2
  import type { PreparedCluster } from '../../store/reducers/clusters/types';
3
+ export declare const CLUSTERS_COLUMNS_WIDTH_LS_KEY = "clustersTableColumnsWidth";
3
4
  export declare const CLUSTERS_COLUMNS: Column<PreparedCluster>[];
@@ -11,6 +11,7 @@ import { clusterTabsIds, getClusterPath } from '../Cluster/utils';
11
11
  import { COLUMNS_NAMES, COLUMNS_TITLES } from './constants';
12
12
  import i18n from './i18n';
13
13
  import { b } from './shared';
14
+ export const CLUSTERS_COLUMNS_WIDTH_LS_KEY = 'clustersTableColumnsWidth';
14
15
  const EMPTY_CELL = _jsx("span", { className: b('empty-cell'), children: "\u2014" });
15
16
  export const CLUSTERS_COLUMNS = [
16
17
  {
@@ -83,7 +84,7 @@ export const CLUSTERS_COLUMNS = [
83
84
  {
84
85
  name: COLUMNS_NAMES.NODES,
85
86
  header: COLUMNS_TITLES[COLUMNS_NAMES.NODES],
86
- width: 150,
87
+ resizeMinWidth: 140,
87
88
  defaultOrder: DataTable.DESCENDING,
88
89
  sortAccessor: ({ cluster = {} }) => {
89
90
  const { NodesTotal = 0 } = cluster;
@@ -100,7 +101,7 @@ export const CLUSTERS_COLUMNS = [
100
101
  {
101
102
  name: COLUMNS_NAMES.LOAD,
102
103
  header: COLUMNS_TITLES[COLUMNS_NAMES.LOAD],
103
- width: 150,
104
+ resizeMinWidth: 140,
104
105
  defaultOrder: DataTable.DESCENDING,
105
106
  sortAccessor: ({ cluster }) => {
106
107
  return cluster === null || cluster === void 0 ? void 0 : cluster.NumberOfCpus;
@@ -116,7 +117,7 @@ export const CLUSTERS_COLUMNS = [
116
117
  {
117
118
  name: COLUMNS_NAMES.STORAGE,
118
119
  header: COLUMNS_TITLES[COLUMNS_NAMES.STORAGE],
119
- width: 150,
120
+ resizeMinWidth: 140,
120
121
  defaultOrder: DataTable.DESCENDING,
121
122
  sortAccessor: ({ cluster }) => {
122
123
  return Number(cluster === null || cluster === void 0 ? void 0 : cluster.StorageTotal);
@@ -1,6 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React from 'react';
3
- import DataTable from '@gravity-ui/react-data-table';
4
3
  import { ASCENDING } from '@gravity-ui/react-data-table/build/esm/lib/constants';
5
4
  import { skipToken } from '@reduxjs/toolkit/query';
6
5
  import { EntitiesCount } from '../../components/EntitiesCount';
@@ -8,6 +7,7 @@ import { AccessDenied } from '../../components/Errors/403';
8
7
  import { ResponseError } from '../../components/Errors/ResponseError';
9
8
  import { Illustration } from '../../components/Illustration';
10
9
  import { ProblemFilter } from '../../components/ProblemFilter';
10
+ import { ResizeableDataTable } from '../../components/ResizeableDataTable/ResizeableDataTable';
11
11
  import { Search } from '../../components/Search';
12
12
  import { TableWithControlsLayout } from '../../components/TableWithControlsLayout/TableWithControlsLayout';
13
13
  import { UptimeFilter } from '../../components/UptimeFIlter';
@@ -18,7 +18,7 @@ import { cn } from '../../utils/cn';
18
18
  import { DEFAULT_POLLING_INTERVAL, DEFAULT_TABLE_SETTINGS, USE_NODES_ENDPOINT_IN_DIAGNOSTICS_KEY, } from '../../utils/constants';
19
19
  import { useSetting, useTableSort, useTypedDispatch, useTypedSelector } from '../../utils/hooks';
20
20
  import { NodesUptimeFilterValues, isSortableNodesProperty, isUnavailableNode, } from '../../utils/nodes';
21
- import { getNodesColumns } from './getNodesColumns';
21
+ import { NODES_COLUMNS_WIDTH_LS_KEY, getNodesColumns } from './getNodesColumns';
22
22
  import i18n from './i18n';
23
23
  import './Nodes.scss';
24
24
  const b = cn('ydb-nodes');
@@ -78,7 +78,7 @@ export const Nodes = ({ path, additionalNodesProps = {} }) => {
78
78
  return _jsx(Illustration, { name: "thumbsUp", width: "200" });
79
79
  }
80
80
  }
81
- return (_jsx(DataTable, { theme: "yandex-cloud", data: nodes || [], columns: columns, settings: DEFAULT_TABLE_SETTINGS, sortOrder: sort, onSort: handleSort, emptyDataMessage: i18n('empty.default'), rowClassName: (row) => b('node', { unavailable: isUnavailableNode(row) }) }));
81
+ return (_jsx(ResizeableDataTable, { columnsWidthLSKey: NODES_COLUMNS_WIDTH_LS_KEY, data: nodes || [], columns: columns, settings: DEFAULT_TABLE_SETTINGS, sortOrder: sort, onSort: handleSort, emptyDataMessage: i18n('empty.default'), rowClassName: (row) => b('node', { unavailable: isUnavailableNode(row) }) }));
82
82
  };
83
83
  if (error) {
84
84
  if (error.status === 403) {
@@ -86,5 +86,5 @@ export const Nodes = ({ path, additionalNodesProps = {} }) => {
86
86
  }
87
87
  return _jsx(ResponseError, { error: error });
88
88
  }
89
- return (_jsxs(TableWithControlsLayout, { children: [_jsx(TableWithControlsLayout.Controls, { children: renderControls() }), _jsx(TableWithControlsLayout.Table, { loading: isLoading, className: b('table'), children: renderTable() })] }));
89
+ return (_jsxs(TableWithControlsLayout, { children: [_jsx(TableWithControlsLayout.Controls, { children: renderControls() }), _jsx(TableWithControlsLayout.Table, { loading: isLoading, children: renderTable() })] }));
90
90
  };
@@ -12,11 +12,6 @@
12
12
  margin-bottom: 15px;
13
13
  }
14
14
 
15
- &__table {
16
- @include table-styles;
17
- @include table-sticky-styles;
18
- }
19
-
20
15
  &__node_unavailable {
21
16
  opacity: 0.6;
22
17
  }
@@ -7,13 +7,12 @@ import { Illustration } from '../../components/Illustration';
7
7
  import { ProblemFilter } from '../../components/ProblemFilter';
8
8
  import { Search } from '../../components/Search';
9
9
  import { UptimeFilter } from '../../components/UptimeFIlter';
10
- import { VirtualTable } from '../../components/VirtualTable';
10
+ import { ResizeableVirtualTable } from '../../components/VirtualTable/ResizeableVirtualTable';
11
11
  import { ProblemFilterValues } from '../../store/reducers/settings/settings';
12
12
  import { cn } from '../../utils/cn';
13
- import { updateColumnsWidth, useTableResize } from '../../utils/hooks/useTableResize';
14
13
  import { NodesUptimeFilterValues, getProblemParamValue, getUptimeParamValue, isSortableNodesProperty, isUnavailableNode, } from '../../utils/nodes';
15
14
  import { getNodes } from './getNodes';
16
- import { getNodesColumns } from './getNodesColumns';
15
+ import { NODES_COLUMNS_WIDTH_LS_KEY, getNodesColumns } from './getNodesColumns';
17
16
  import i18n from './i18n';
18
17
  import './Nodes.scss';
19
18
  const b = cn('ydb-nodes');
@@ -21,7 +20,6 @@ export const VirtualNodes = ({ path, parentContainer, additionalNodesProps }) =>
21
20
  const [searchValue, setSearchValue] = React.useState('');
22
21
  const [problemFilter, setProblemFilter] = React.useState(ProblemFilterValues.ALL);
23
22
  const [uptimeFilter, setUptimeFilter] = React.useState(NodesUptimeFilterValues.All);
24
- const [tableColumnsWidthSetup, setTableColumnsWidth] = useTableResize('nodesTableColumnsWidth');
25
23
  const filters = React.useMemo(() => {
26
24
  return [path, searchValue, problemFilter, uptimeFilter];
27
25
  }, [path, searchValue, problemFilter, uptimeFilter]);
@@ -59,8 +57,8 @@ export const VirtualNodes = ({ path, parentContainer, additionalNodesProps }) =>
59
57
  const rawColumns = getNodesColumns({
60
58
  getNodeRef: additionalNodesProps === null || additionalNodesProps === void 0 ? void 0 : additionalNodesProps.getNodeRef,
61
59
  });
62
- const columns = updateColumnsWidth(rawColumns, tableColumnsWidthSetup).map((column) => {
60
+ const columns = rawColumns.map((column) => {
63
61
  return Object.assign(Object.assign({}, column), { sortable: isSortableNodesProperty(column.name) });
64
62
  });
65
- return (_jsx(VirtualTable, { parentContainer: parentContainer, columns: columns, fetchData: fetchData, limit: 50, renderControls: renderControls, renderErrorMessage: renderErrorMessage, renderEmptyDataMessage: renderEmptyDataMessage, dependencyArray: filters, getRowClassName: getRowClassName, onColumnsResize: setTableColumnsWidth }));
63
+ return (_jsx(ResizeableVirtualTable, { columnsWidthLSKey: NODES_COLUMNS_WIDTH_LS_KEY, parentContainer: parentContainer, columns: columns, fetchData: fetchData, limit: 50, renderControls: renderControls, renderErrorMessage: renderErrorMessage, renderEmptyDataMessage: renderEmptyDataMessage, dependencyArray: filters, getRowClassName: getRowClassName }));
66
64
  };
@@ -2,6 +2,7 @@ import type { Column as DataTableColumn } from '@gravity-ui/react-data-table';
2
2
  import type { Column as VirtualTableColumn } from '../../components/VirtualTable';
3
3
  import type { NodesPreparedEntity } from '../../store/reducers/nodes/types';
4
4
  import type { GetNodeRefFunc } from '../../types/additionalProps';
5
+ export declare const NODES_COLUMNS_WIDTH_LS_KEY = "nodesTableColumnsWidth";
5
6
  interface GetNodesColumnsProps {
6
7
  tabletsPath?: string;
7
8
  getNodeRef?: GetNodeRefFunc;