@cloud-ru/ds-table 1.0.2-preview-cd0cd6fb.0 → 1.0.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.
Files changed (94) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +3 -3
  3. package/dist/cjs/components/Table/Table.js +4 -12
  4. package/dist/cjs/components/Table/hooks/useColumnOrderByDrag/useColumnOrderByDrag.d.ts +0 -2
  5. package/dist/cjs/components/Table/hooks/useColumnOrderByDrag/useColumnOrderByDrag.js +3 -20
  6. package/dist/cjs/components/Table/hooks/useColumnSettings/utils/createColumnsSettingsOption.d.ts +2 -2
  7. package/dist/cjs/components/Table/hooks/useColumnSettings/utils/createColumnsSettingsOption.js +2 -2
  8. package/dist/cjs/components/Table/hooks/useColumnSettings/utils/index.d.ts +0 -1
  9. package/dist/cjs/components/Table/hooks/useColumnSettings/utils/index.js +0 -1
  10. package/dist/cjs/components/Table/hooks/useColumnSettings/utils/isColumnEnabledInitially.js +4 -3
  11. package/dist/cjs/components/Table/hooks/useColumnSettings/utils/isColumnVisibilityConfigurable.js +15 -3
  12. package/dist/cjs/components/Table/hooks/useColumnSettings/utils/isFilterableColumn.js +2 -4
  13. package/dist/cjs/components/Table/hooks/useTableScroll.js +1 -15
  14. package/dist/cjs/components/Table/styles.module.css +1 -19
  15. package/dist/cjs/components/Table/utils/index.d.ts +0 -1
  16. package/dist/cjs/components/Table/utils/index.js +0 -1
  17. package/dist/cjs/constants.d.ts +1 -1
  18. package/dist/cjs/constants.js +1 -1
  19. package/dist/cjs/helperComponents/Cells/BodyCell/BodyCell.js +4 -4
  20. package/dist/cjs/helperComponents/Cells/HeaderCell/HeaderCell.js +6 -7
  21. package/dist/cjs/helperComponents/Cells/HeaderCell/ResizeHandle.js +1 -1
  22. package/dist/cjs/helperComponents/Cells/styles.module.css +0 -3
  23. package/dist/cjs/helperComponents/Rows/styles.module.css +0 -4
  24. package/dist/cjs/helperComponents/TableEmptyState/hooks.js +1 -0
  25. package/dist/cjs/helperComponents/TableEmptyState/styles.module.css +1 -3
  26. package/dist/cjs/hooks/useCellSizes.d.ts +1 -0
  27. package/dist/cjs/hooks/useCellSizes.js +4 -1
  28. package/dist/cjs/locale/index.d.ts +4 -0
  29. package/dist/cjs/locale/index.js +2 -0
  30. package/dist/cjs/style.css +2 -29
  31. package/dist/cjs/types.d.ts +0 -1
  32. package/dist/esm/components/Table/Table.js +7 -15
  33. package/dist/esm/components/Table/hooks/useColumnOrderByDrag/useColumnOrderByDrag.d.ts +0 -2
  34. package/dist/esm/components/Table/hooks/useColumnOrderByDrag/useColumnOrderByDrag.js +4 -21
  35. package/dist/esm/components/Table/hooks/useColumnSettings/utils/createColumnsSettingsOption.d.ts +2 -2
  36. package/dist/esm/components/Table/hooks/useColumnSettings/utils/createColumnsSettingsOption.js +2 -2
  37. package/dist/esm/components/Table/hooks/useColumnSettings/utils/index.d.ts +0 -1
  38. package/dist/esm/components/Table/hooks/useColumnSettings/utils/index.js +0 -1
  39. package/dist/esm/components/Table/hooks/useColumnSettings/utils/isColumnEnabledInitially.js +4 -3
  40. package/dist/esm/components/Table/hooks/useColumnSettings/utils/isColumnVisibilityConfigurable.js +15 -3
  41. package/dist/esm/components/Table/hooks/useColumnSettings/utils/isFilterableColumn.js +2 -4
  42. package/dist/esm/components/Table/hooks/useTableScroll.js +1 -15
  43. package/dist/esm/components/Table/styles.module.css +1 -19
  44. package/dist/esm/components/Table/utils/index.d.ts +0 -1
  45. package/dist/esm/components/Table/utils/index.js +0 -1
  46. package/dist/esm/constants.d.ts +1 -1
  47. package/dist/esm/constants.js +1 -1
  48. package/dist/esm/helperComponents/Cells/BodyCell/BodyCell.js +4 -4
  49. package/dist/esm/helperComponents/Cells/HeaderCell/HeaderCell.js +6 -7
  50. package/dist/esm/helperComponents/Cells/HeaderCell/ResizeHandle.js +1 -1
  51. package/dist/esm/helperComponents/Cells/styles.module.css +0 -3
  52. package/dist/esm/helperComponents/Rows/styles.module.css +0 -4
  53. package/dist/esm/helperComponents/TableEmptyState/hooks.js +1 -0
  54. package/dist/esm/helperComponents/TableEmptyState/styles.module.css +1 -3
  55. package/dist/esm/hooks/useCellSizes.d.ts +1 -0
  56. package/dist/esm/hooks/useCellSizes.js +4 -1
  57. package/dist/esm/locale/index.d.ts +4 -0
  58. package/dist/esm/locale/index.js +2 -0
  59. package/dist/esm/style.css +2 -29
  60. package/dist/esm/types.d.ts +0 -1
  61. package/dist/tsconfig.cjs.tsbuildinfo +1 -1
  62. package/dist/tsconfig.esm.tsbuildinfo +1 -1
  63. package/package.json +20 -21
  64. package/src/components/Table/Table.tsx +26 -53
  65. package/src/components/Table/hooks/useColumnOrderByDrag/useColumnOrderByDrag.ts +7 -31
  66. package/src/components/Table/hooks/useColumnSettings/utils/createColumnsSettingsOption.ts +2 -2
  67. package/src/components/Table/hooks/useColumnSettings/utils/index.ts +0 -1
  68. package/src/components/Table/hooks/useColumnSettings/utils/isColumnEnabledInitially.ts +5 -3
  69. package/src/components/Table/hooks/useColumnSettings/utils/isColumnVisibilityConfigurable.ts +18 -3
  70. package/src/components/Table/hooks/useColumnSettings/utils/isFilterableColumn.ts +2 -4
  71. package/src/components/Table/hooks/useTableScroll.ts +1 -21
  72. package/src/components/Table/styles.module.scss +1 -23
  73. package/src/components/Table/utils/index.ts +0 -1
  74. package/src/constants.ts +1 -1
  75. package/src/helperComponents/Cells/BodyCell/BodyCell.tsx +2 -5
  76. package/src/helperComponents/Cells/HeaderCell/HeaderCell.tsx +7 -10
  77. package/src/helperComponents/Cells/HeaderCell/ResizeHandle.tsx +2 -1
  78. package/src/helperComponents/Cells/styles.module.scss +0 -11
  79. package/src/helperComponents/Rows/styles.module.scss +0 -5
  80. package/src/helperComponents/TableEmptyState/hooks.ts +1 -0
  81. package/src/helperComponents/TableEmptyState/styles.module.scss +1 -5
  82. package/src/hooks/useCellSizes.ts +5 -1
  83. package/src/locale/index.ts +2 -0
  84. package/src/types.ts +5 -3
  85. package/dist/cjs/components/Table/hooks/useColumnSettings/utils/getColumnSettingsMode.d.ts +0 -8
  86. package/dist/cjs/components/Table/hooks/useColumnSettings/utils/getColumnSettingsMode.js +0 -15
  87. package/dist/cjs/components/Table/utils/alignOverlayToHeader.d.ts +0 -6
  88. package/dist/cjs/components/Table/utils/alignOverlayToHeader.js +0 -28
  89. package/dist/esm/components/Table/hooks/useColumnSettings/utils/getColumnSettingsMode.d.ts +0 -8
  90. package/dist/esm/components/Table/hooks/useColumnSettings/utils/getColumnSettingsMode.js +0 -11
  91. package/dist/esm/components/Table/utils/alignOverlayToHeader.d.ts +0 -6
  92. package/dist/esm/components/Table/utils/alignOverlayToHeader.js +0 -24
  93. package/src/components/Table/hooks/useColumnSettings/utils/getColumnSettingsMode.ts +0 -18
  94. package/src/components/Table/utils/alignOverlayToHeader.ts +0 -36
@@ -442,8 +442,7 @@
442
442
  flex:1 1 auto;
443
443
  flex-direction:column;
444
444
  width:100%;
445
- min-width:-moz-max-content;
446
- min-width:max-content;
445
+ min-width:0;
447
446
  min-height:100%;
448
447
  }
449
448
 
@@ -577,23 +576,6 @@
577
576
  width:100%;
578
577
  max-width:100%;
579
578
  }
580
-
581
- .columnDragPreview{
582
- display:flex;
583
- align-items:center;
584
- box-sizing:border-box;
585
- height:var(--sn-table-anatomy-content-tableCell-minHeight, var(--sn-primitive-dimension-40, 40px));
586
- padding:var(--sn-table-anatomy-content-tableHead-paddingTop, var(--sn-primitive-dimension-6, 6px)) var(--sn-table-anatomy-content-tableHead-paddingRight, var(--sn-primitive-dimension-12, 12px)) var(--sn-table-anatomy-content-tableHead-paddingBottom, var(--sn-primitive-dimension-6, 6px)) var(--sn-table-anatomy-content-tableHead-paddingLeft, var(--sn-primitive-dimension-12, 12px));
587
- border-radius:var(--sn-table-anatomy-content-borderRadius, var(--sn-brand-anatomy-radius-table-m, var(--sn-primitive-dimension-4, 4px)));
588
- color:var(--sn-theme-color-available-version-textTertiary, var(--sn-brand-color-text-version-tertiary, rgba(65, 66, 78, 0.5490196078)));
589
- white-space:nowrap;
590
- font-family:var(--sn-regular-body-m-fontFamily, var(--sn-brand-font-fontFamily-regular-body, var(--sn-primitive-fontFamily-brandA-sans, SB Sans Interface)));
591
- font-weight:var(--sn-regular-body-m-fontWeight, var(--sn-theme-typography-fontWeight-regular-body-m, var(--sn-brand-font-fontWeight-light-regular-body-m, var(--sn-primitive-font-fontWeightValue-400, 400))));
592
- line-height:var(--sn-regular-body-m-lineHeight, var(--sn-density-typography-roleBody-lineHeightM, var(--sn-primitive-font-lineHeight-by16, 24px)));
593
- font-size:var(--sn-regular-body-m-fontSize, var(--sn-density-typography-roleBody-fontSizeM, var(--sn-primitive-font-fontSize-16, 16px)));
594
- letter-spacing:var(--sn-regular-body-m-letterSpacing, var(--sn-primitive-font-letterSpacing-m, 0.1px));
595
- paragraph-spacing:var(--sn-regular-body-m-paragraphSpacing, var(--sn-primitive-font-paragraphSpacing-byFontSize14, 7px));
596
- }
597
579
  .tableBodyCell{
598
580
  gap:var(--sn-table-anatomy-content-tableCell-contentWrapper-slot-gap, var(--sn-primitive-dimension-2, 2px));
599
581
  padding:calc(var(--sn-table-anatomy-content-tableCell-paddingTop, var(--sn-primitive-dimension-6, 6px)) + var(--sn-table-anatomy-content-tableCell-contentWrapper-paddingTop, var(--sn-primitive-dimension-2, 2px))) var(--sn-table-anatomy-content-tableCell-paddingRight, var(--sn-primitive-dimension-12, 12px)) calc(var(--sn-table-anatomy-content-tableCell-paddingBottom, var(--sn-primitive-dimension-6, 6px)) + var(--sn-table-anatomy-content-tableCell-contentWrapper-paddingBottom, var(--sn-primitive-dimension-2, 2px))) var(--sn-table-anatomy-content-tableCell-paddingLeft, var(--sn-primitive-dimension-12, 12px));
@@ -1023,9 +1005,6 @@
1023
1005
  width:100%;
1024
1006
  background-color:transparent;
1025
1007
  }
1026
- .tableCell[data-dragging]{
1027
- box-shadow:inset var(--sn-table-anatomy-content-tableLine-background-interaction-borderVerticalWidth, var(--sn-primitive-strokeWeight-strokeRegular, 1px)) 0 0 0 var(--sn-theme-color-available-borderColor, var(--sn-brand-color-state-neutralBorder-forLightMode-default-borderColor, rgba(159, 166, 198, 0.3019607843))), inset calc(-1 * var(--sn-table-anatomy-content-tableLine-background-interaction-borderVerticalWidth, var(--sn-primitive-strokeWeight-strokeRegular, 1px))) 0 0 0 var(--sn-theme-color-available-borderColor, var(--sn-brand-color-state-neutralBorder-forLightMode-default-borderColor, rgba(159, 166, 198, 0.3019607843)));
1028
- }
1029
1008
  @charset "UTF-8";
1030
1009
  .surface{
1031
1010
  isolation:isolate;
@@ -1298,10 +1277,6 @@
1298
1277
  width:var(--sn-table-anatomy-content-tableLine-background-interaction-borderVerticalWidth, var(--sn-primitive-strokeWeight-strokeRegular, 1px));
1299
1278
  }
1300
1279
 
1301
- .tableHeader .rowPinnedCells::after{
1302
- bottom:0;
1303
- }
1304
-
1305
1280
  .rowPinnedCells[data-position=left]{
1306
1281
  left:0;
1307
1282
  }
@@ -1550,15 +1525,13 @@
1550
1525
  padding:0;
1551
1526
  }
1552
1527
  .tableEmptyStateWrapper{
1553
- position:sticky;
1554
- left:0;
1555
1528
  display:flex;
1556
1529
  flex:1 1 auto;
1557
1530
  flex-direction:column;
1558
1531
  align-items:center;
1559
1532
  justify-content:center;
1560
1533
  box-sizing:border-box;
1561
- width:var(--table-viewport-width, 100%);
1534
+ width:100%;
1562
1535
  min-height:304px;
1563
1536
  padding:var(--sn-primitive-dimension-24, 24px);
1564
1537
  }
@@ -43,7 +43,6 @@ type FilterableProps = {
43
43
  columnSettings?: {
44
44
  /** Название колонки в настройках таблицы */
45
45
  label?: string;
46
- /** Поведение колонки в меню настроек. По умолчанию `defaultVisible` */
47
46
  mode?: ColumnSettingsMode;
48
47
  };
49
48
  } & ({
@@ -1,14 +1,12 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { DndContext, DragOverlay } from '@dnd-kit/core';
2
+ import { DndContext } from '@dnd-kit/core';
3
3
  import { isMobileLayout, mergePresets, useAdaptiveLayout, useLayoutDefaults } from '@cloud-ru/ds-adaptive';
4
- import { DragPreview } from '@cloud-ru/ds-drag-and-drop';
5
4
  import { BACKGROUND_PREDEFINED_FILL } from '@cloud-ru/ds-materials';
6
5
  import { useThemeClassnames } from '@cloud-ru/ds-theme';
7
6
  import { extractSupportProps } from '@cloud-ru/ds-utils';
8
- import { flexRender } from '@tanstack/react-table';
9
7
  import cn from 'classnames';
10
8
  import { useEffect, useMemo } from 'react';
11
- import { DEFAULT_EXPANDED, DEFAULT_PAGE_SIZE, DEFAULT_ROW_SELECTION, DEFAULT_SORTING, DEFAULT_VIEW, TABLE_COLUMN_CSS_VARS, VIEW, } from '../../constants.js';
9
+ import { DEFAULT_EXPANDED, DEFAULT_PAGE_SIZE, DEFAULT_ROW_SELECTION, DEFAULT_SORTING, DEFAULT_VIEW, VIEW, } from '../../constants.js';
12
10
  import { CellAutoResizeContext, TableContext, useCellAutoResizeController } from '../../contexts/index.js';
13
11
  import { getControlsAcrylicAttrs, getRowActionsColumnDef, getStatusColumnDef, HeaderRow, LoadMoreButton, STATUS_APPEARANCE, TableEmptyState, TablePagination, useEmptyState, } from '../../helperComponents/index.js';
14
12
  import { ToolbarCheckBoxMode } from '../types.js';
@@ -21,7 +19,7 @@ import { TableToolbar } from './components/TableToolbar/index.js';
21
19
  import { buildAllTableColumns, buildColumnPinning, useColumnOrderByDrag, useColumnSettings, useColumnSizes, useColumnVirtualizer, useFilters, usePageReset, useRowVirtualizer, useStateControl, useTableInstance, useTableScroll, useTableToolbar, useTableView, } from './hooks/index.js';
22
20
  import { isFilterableColumn } from './hooks/useColumnSettings/utils/index.js';
23
21
  import styles from './styles.module.css';
24
- import { alignOverlayToHeader, getColumnIdentifier, getPinnedGroups } from './utils/index.js';
22
+ import { getColumnIdentifier, getPinnedGroups } from './utils/index.js';
25
23
  const TABLE_CONTENT_ACRYLIC = getControlsAcrylicAttrs(BACKGROUND_PREDEFINED_FILL.NeutralBackground1Level);
26
24
  const BASE_STICKY_CONTROLS = {
27
25
  enabled: false,
@@ -100,7 +98,7 @@ export function Table({ data, rowPinning = {
100
98
  onSortingChange([]);
101
99
  }
102
100
  }, [areColumnsSettingsEnabled, enabledColumns, hideableColumnIds, onSortingChange, sorting]);
103
- const { columnOrder, setColumnOrder, dndContextProps, enableColumnsOrderSortByDrag, draggingColumnId } = useColumnOrderByDrag({
101
+ const { columnOrder, setColumnOrder, dndContextProps, enableColumnsOrderSortByDrag } = useColumnOrderByDrag({
104
102
  tableColumns: allTableColumns,
105
103
  savedState,
106
104
  columnSettings: columnsSettingsProp,
@@ -259,12 +257,6 @@ export function Table({ data, rowPinning = {
259
257
  // но скрывает при dataError. Загрузка и непустое тело — шапка всегда.
260
258
  const showTableHeader = showHeader &&
261
259
  (isLoadingState || centerRows.length > 0 || filteredTopRows.length > 0 || (isEmptyBody && !dataError));
262
- const draggingHeader = draggingColumnId
263
- ? table.getFlatHeaders().find(header => header.column.id === draggingColumnId)
264
- : undefined;
265
- // Копия колонки едет за курсором в портале: внутри скролла она растила бы его ширину
266
- // и ныряла под закреплённые колонки.
267
- const draggingColumnPreview = (_jsx(DragOverlay, { dropAnimation: null, modifiers: [alignOverlayToHeader], children: draggingHeader ? (_jsx(DragPreview, { className: styles.columnDragPreview, style: { width: `var(${TABLE_COLUMN_CSS_VARS.size(draggingHeader.column.id)})` }, children: flexRender(draggingHeader.column.columnDef.header, draggingHeader.getContext()) })) : null }));
268
260
  const tableHeaderElement = showTableHeader ? (_jsx(HeaderRow, { rowAutoHeight: rowAutoHeight, columnOrder: columnOrder, enableColumnsOrderSortByDrag: enableColumnsOrderSortByDrag, suppressSticky: usePageStickyHeader })) : null;
269
261
  const tableRowsContent = (_jsx(TableRowsBody, { filteredTopRows: filteredTopRows, centerRows: centerRows, rowVirtualizer: rowVirtualizer, columnOrder: columnOrder, rowAutoHeight: rowAutoHeight, onRowClick: onRowClick, enableColumnsOrderSortByDrag: enableColumnsOrderSortByDrag, rowSelectionAppearance: rowSelectionProp?.appearance, emptyState: tableEmptyState, showInfiniteLoadingTail: showInfiniteLoadingTail, loadingTableRows: loadingTableRows, loadMoreButton: loadMoreButtonNode }));
270
262
  const cardsContentBody = (_jsx(TableCardsBody, { filteredTopRows: filteredTopRows, centerRows: centerRows, table: table, headlineId: headlineId, cardSelection: cardSelection, rowSelectionAppearance: rowSelectionProp?.appearance, suppressHeader: suppressHeader, onRowClick: onRowClick, renderCard: renderCard, cardsListProps: cardsListProps, emptyState: tableEmptyState, showInfiniteLoadingTail: showInfiniteLoadingTail, loadingTableRows: loadingTableRows, loadingTable: loadingTable, loadMoreButton: loadMoreButtonNode }));
@@ -301,8 +293,8 @@ export function Table({ data, rowPinning = {
301
293
  const themeClassName = useThemeClassnames({ density: isMobile ? 'comfort' : 'compact' });
302
294
  const controlsAcrylic = useMemo(() => (isStickyControls ? getControlsAcrylicAttrs(stickyControlsBackgroundPredefined) : null), [isStickyControls, stickyControlsBackgroundPredefined]);
303
295
  const scrollPaddingAbsolute = isStickyControls && !isCardsView;
304
- const tableScrollContent = (_jsx("div", { className: styles.body, "data-empty-body": isEmptyBody || undefined, style: columnSizes.vars, children: _jsx(CellAutoResizeContext.Provider, { value: { updateCellMap, removeCellFromMap }, children: tableScrollRows }) }));
305
- const tableContentWithProviders = (_jsx("div", { className: styles.body, "data-empty-body": isEmptyBody || undefined, style: columnSizes.vars, children: _jsx(CellAutoResizeContext.Provider, { value: { updateCellMap, removeCellFromMap }, children: tableBody }) }));
296
+ const tableScrollContent = (_jsx("div", { className: styles.body, "data-empty-body": isEmptyBody || undefined, style: columnSizes.vars, children: _jsx(CellAutoResizeContext.Provider, { value: { updateCellMap, removeCellFromMap }, children: _jsx(DndContext, { ...dndContextProps, children: tableScrollRows }) }) }));
297
+ const tableContentWithProviders = (_jsx("div", { className: styles.body, "data-empty-body": isEmptyBody || undefined, style: columnSizes.vars, children: _jsx(CellAutoResizeContext.Provider, { value: { updateCellMap, removeCellFromMap }, children: _jsx(DndContext, { ...dndContextProps, children: tableBody }) }) }));
306
298
  let scrollContent = tableContentWithProviders;
307
299
  if (isMobile && isCardsView) {
308
300
  scrollContent = tableBody;
@@ -330,7 +322,7 @@ export function Table({ data, rowPinning = {
330
322
  paginationChrome =
331
323
  isStickyControls && controlsAcrylic ? (_jsx(TableChrome, { variant: 'footer', acrylic: controlsAcrylic, children: pagination })) : (pagination);
332
324
  }
333
- return (_jsx("div", { ref: wrapperRef, className: cn(styles.wrapper, className, themeClassName), "data-view": view, "data-layout-type": layoutType, "data-sticky-controls": isStickyControls || undefined, "data-with-toolbar": showToolbar || undefined, "data-empty-body": isEmptyBody || undefined, "data-fit-content": !resolvedFullWidth || undefined, ...extractSupportProps(rest), children: _jsxs(TableContext.Provider, { value: tableContextValue, children: [toolbarChrome, _jsxs("div", { className: styles.tableView, children: [_jsxs("div", { className: styles.content, "data-outline": !isCardsView && outline ? true : undefined, "data-page-sticky-header": !isCardsView && usePageStickyHeader ? true : undefined, ...(!isCardsView ? TABLE_CONTENT_ACRYLIC : {}), children: [!isCardsView ? _jsx("span", { className: styles.contentAcrylic, "data-acrylic-background": true, "aria-hidden": true }) : null, hasMobileToolbarMounts ? (_jsxs("div", { className: styles.mobileToolbarMounts, children: [sortingToolbarSlot.mobileMount, columnsSettingsToolbarSlot.mobileMount] })) : null, _jsxs(DndContext, { ...dndContextProps, children: [draggingColumnPreview, _jsx(TableScrollHost, { view: view, isMobile: isMobile, isCardsView: isCardsView, usePageStickyHeader: usePageStickyHeader, scrollOverflow: scrollOverflow, scrollPaddingAbsolute: scrollPaddingAbsolute, internalScrollRef: internalScrollRef, scrollRef: scrollRef, scrollContainerRef: scrollContainerRef, handleScrollInitialized: handleScrollInitialized, syncHeaderHorizontalScroll: syncHeaderHorizontalScroll, tableHeaderElement: tableHeaderElement, columnSizeVars: columnSizes.vars, children: scrollContent })] }), !isCardsView && outline ? _jsx("span", { className: styles.contentBorder, "aria-hidden": true }) : null] }), paginationChrome] })] }) }));
325
+ return (_jsx("div", { ref: wrapperRef, className: cn(styles.wrapper, className, themeClassName), "data-view": view, "data-layout-type": layoutType, "data-sticky-controls": isStickyControls || undefined, "data-with-toolbar": showToolbar || undefined, "data-empty-body": isEmptyBody || undefined, "data-fit-content": !resolvedFullWidth || undefined, ...extractSupportProps(rest), children: _jsxs(TableContext.Provider, { value: tableContextValue, children: [toolbarChrome, _jsxs("div", { className: styles.tableView, children: [_jsxs("div", { className: styles.content, "data-outline": !isCardsView && outline ? true : undefined, "data-page-sticky-header": !isCardsView && usePageStickyHeader ? true : undefined, ...(!isCardsView ? TABLE_CONTENT_ACRYLIC : {}), children: [!isCardsView ? _jsx("span", { className: styles.contentAcrylic, "data-acrylic-background": true, "aria-hidden": true }) : null, hasMobileToolbarMounts ? (_jsxs("div", { className: styles.mobileToolbarMounts, children: [sortingToolbarSlot.mobileMount, columnsSettingsToolbarSlot.mobileMount] })) : null, _jsx(TableScrollHost, { view: view, isMobile: isMobile, isCardsView: isCardsView, usePageStickyHeader: usePageStickyHeader, scrollOverflow: scrollOverflow, scrollPaddingAbsolute: scrollPaddingAbsolute, internalScrollRef: internalScrollRef, scrollRef: scrollRef, scrollContainerRef: scrollContainerRef, handleScrollInitialized: handleScrollInitialized, syncHeaderHorizontalScroll: syncHeaderHorizontalScroll, tableHeaderElement: tableHeaderElement, columnSizeVars: columnSizes.vars, children: scrollContent }), !isCardsView && outline ? _jsx("span", { className: styles.contentBorder, "aria-hidden": true }) : null] }), paginationChrome] })] }) }));
334
326
  }
335
327
  Table.getStatusColumnDef = getStatusColumnDef;
336
328
  Table.statusAppearances = STATUS_APPEARANCE;
@@ -12,7 +12,5 @@ export declare function useColumnOrderByDrag<TData extends object>({ tableColumn
12
12
  setColumnOrder: Dispatch<SetStateAction<string[]>>;
13
13
  dndContextProps: DndContextProps;
14
14
  enableColumnsOrderSortByDrag: boolean;
15
- /** Колонка под курсором прямо сейчас: по ней рендерится копия в портале. */
16
- draggingColumnId?: string;
17
15
  };
18
16
  export {};
@@ -1,4 +1,4 @@
1
- import { closestCenter, MouseSensor, TouchSensor, useSensor, useSensors, } from '@dnd-kit/core';
1
+ import { closestCenter, KeyboardSensor, MouseSensor, TouchSensor, useSensor, useSensors, } from '@dnd-kit/core';
2
2
  import { restrictToHorizontalAxis } from '@dnd-kit/modifiers';
3
3
  import { arrayMove } from '@dnd-kit/sortable';
4
4
  import { isBrowser } from '@cloud-ru/ds-utils';
@@ -12,7 +12,6 @@ const draggingOptions = {
12
12
  };
13
13
  export function useColumnOrderByDrag({ tableColumns, savedState, columnSettings, }) {
14
14
  const [columnOrder, setColumnOrderState] = useState(() => prepareInitialState(tableColumns, savedState));
15
- const [draggingColumnId, setDraggingColumnId] = useState();
16
15
  useEffect(() => {
17
16
  setColumnOrderState(prev => {
18
17
  const currentIds = tableColumns
@@ -40,14 +39,7 @@ export function useColumnOrderByDrag({ tableColumns, savedState, columnSettings,
40
39
  }
41
40
  setColumnOrderState(updatedOrder);
42
41
  }, [columnOrder, savedState]);
43
- const handleDragStart = useCallback(({ active }) => {
44
- setDraggingColumnId(String(active.id));
45
- }, []);
46
- const handleDragCancel = useCallback(() => {
47
- setDraggingColumnId(undefined);
48
- }, []);
49
42
  const handleDragEnd = useCallback(({ active, over }) => {
50
- setDraggingColumnId(undefined);
51
43
  if (!active || !over) {
52
44
  return;
53
45
  }
@@ -65,32 +57,23 @@ export function useColumnOrderByDrag({ tableColumns, savedState, columnSettings,
65
57
  return arrayMove(columnOrder, oldIndex, newIndex);
66
58
  });
67
59
  }, [columnOrder, setColumnOrder]);
68
- // `over` вне SortableContext сбрасывает transform'ы всей сортировки — колонка рывком
69
- // возвращается на место. Держим `over` внутри колонок сортировки.
70
- const collisionDetection = useCallback(args => closestCenter({
71
- ...args,
72
- droppableContainers: args.droppableContainers.filter(container => columnOrder.includes(String(container.id))),
73
- }), [columnOrder]);
74
- const sensors = useSensors(useSensor(MouseSensor, draggingOptions), useSensor(TouchSensor, {}));
60
+ const sensors = useSensors(useSensor(MouseSensor, draggingOptions), useSensor(TouchSensor, {}), useSensor(KeyboardSensor, {}));
75
61
  const enableColumnsOrderSortByDrag = Boolean(columnSettings?.enableDrag);
76
62
  const dndContextProps = useMemo(() => {
77
63
  if (!enableColumnsOrderSortByDrag) {
78
64
  return {};
79
65
  }
80
66
  return {
81
- collisionDetection,
67
+ collisionDetection: closestCenter,
82
68
  modifiers: [restrictToHorizontalAxis],
83
- onDragStart: handleDragStart,
84
- onDragCancel: handleDragCancel,
85
69
  onDragEnd: handleDragEnd,
86
70
  sensors,
87
71
  };
88
- }, [collisionDetection, enableColumnsOrderSortByDrag, handleDragCancel, handleDragEnd, handleDragStart, sensors]);
72
+ }, [enableColumnsOrderSortByDrag, handleDragEnd, sensors]);
89
73
  return {
90
74
  columnOrder,
91
75
  setColumnOrder,
92
76
  dndContextProps,
93
77
  enableColumnsOrderSortByDrag,
94
- draggingColumnId,
95
78
  };
96
79
  }
@@ -2,11 +2,11 @@ import { SimpleItem } from '@cloud-ru/ds-list';
2
2
  import { ColumnDefinition } from '../../../../../types.js';
3
3
  /**
4
4
  * Колонка попадает в меню настроек: есть id/accessorKey и это не selection/row-actions.
5
- * Включая `mode: locked` (рендерится disabled).
5
+ * Включая `mode: locked` и колонки без `columnSettings` (они рендерятся disabled).
6
6
  */
7
7
  export declare function isColumnsSettingsMenuItem<TData extends object>(colDef: ColumnDefinition<TData>): boolean;
8
8
  /**
9
- * Пункт меню настроек колонок. Неактивные (`mode: locked` и служебные колонки) —
9
+ * Пункт меню настроек колонок. Неактивные (нет `columnSettings` / `mode: locked`) —
10
10
  * `disabled` + всегда включённый switch (`checked: true`); драг при этом остаётся
11
11
  * доступным. Видимость через `enabledColumns` не управляется.
12
12
  */
@@ -5,7 +5,7 @@ import { isFilterableColumn } from './isFilterableColumn.js';
5
5
  const SETTINGS_MENU_EXCLUDED_IDS = new Set([DefaultColumns.Selection, DefaultColumns.RowActions]);
6
6
  /**
7
7
  * Колонка попадает в меню настроек: есть id/accessorKey и это не selection/row-actions.
8
- * Включая `mode: locked` (рендерится disabled).
8
+ * Включая `mode: locked` и колонки без `columnSettings` (они рендерятся disabled).
9
9
  */
10
10
  export function isColumnsSettingsMenuItem(colDef) {
11
11
  if (!('id' in colDef || 'accessorKey' in colDef)) {
@@ -26,7 +26,7 @@ function getColumnsSettingsOptionLabel(columnDefinition) {
26
26
  return getColumnIdentifier(columnDefinition);
27
27
  }
28
28
  /**
29
- * Пункт меню настроек колонок. Неактивные (`mode: locked` и служебные колонки) —
29
+ * Пункт меню настроек колонок. Неактивные (нет `columnSettings` / `mode: locked`) —
30
30
  * `disabled` + всегда включённый switch (`checked: true`); драг при этом остаётся
31
31
  * доступным. Видимость через `enabledColumns` не управляется.
32
32
  */
@@ -1,4 +1,3 @@
1
- export * from './getColumnSettingsMode.js';
2
1
  export * from './isFilterableColumn.js';
3
2
  export * from './isColumnEnabledInitially.js';
4
3
  export * from './isColumnVisibilityConfigurable.js';
@@ -1,4 +1,3 @@
1
- export * from './getColumnSettingsMode.js';
2
1
  export * from './isFilterableColumn.js';
3
2
  export * from './isColumnEnabledInitially.js';
4
3
  export * from './isColumnVisibilityConfigurable.js';
@@ -1,9 +1,10 @@
1
- import { COLUMN_SETTINGS_MODE } from '../../../../../constants.js';
2
- import { getColumnSettingsMode } from './getColumnSettingsMode.js';
3
1
  /**
4
2
  * Проверка на то, должна ли колонка быть включена по умолчанию
5
3
  * @function isColumnEnabledInitially
6
4
  */
7
5
  export function isColumnEnabledInitially(colDef) {
8
- return getColumnSettingsMode(colDef) !== COLUMN_SETTINGS_MODE.DefaultHidden;
6
+ if ('columnSettings' in colDef && colDef.columnSettings !== undefined) {
7
+ return colDef.columnSettings?.mode !== 'defaultHidden';
8
+ }
9
+ return true;
9
10
  }
@@ -1,9 +1,21 @@
1
- import { COLUMN_SETTINGS_MODE } from '../../../../../constants.js';
2
- import { getColumnSettingsMode } from './getColumnSettingsMode.js';
3
1
  /**
4
2
  * Проверка на то, должна ли колонка отображаться в настройках колонок
5
3
  * @function isColumnVisibilityConfigurable
6
4
  */
7
5
  export function isColumnVisibilityConfigurable(colDef) {
8
- return getColumnSettingsMode(colDef) !== COLUMN_SETTINGS_MODE.Locked;
6
+ if ('columnSettings' in colDef && colDef.columnSettings !== undefined) {
7
+ const { mode } = colDef.columnSettings;
8
+ if (!mode) {
9
+ return true;
10
+ }
11
+ switch (mode) {
12
+ case 'locked':
13
+ return false;
14
+ case 'defaultVisible':
15
+ case 'defaultHidden':
16
+ default:
17
+ return true;
18
+ }
19
+ }
20
+ return true;
9
21
  }
@@ -1,11 +1,9 @@
1
- import { COLUMN_SETTINGS_MODE } from '../../../../../constants.js';
2
- import { getColumnSettingsMode, isServiceColumn } from './getColumnSettingsMode.js';
3
1
  /**
4
2
  * Проверка на то, должна ли колонка отображаться в таблице
5
3
  * @function isFilterableColumn
6
4
  */
7
5
  export function isFilterableColumn(colDef) {
8
6
  return (('id' in colDef || 'accessorKey' in colDef) &&
9
- !isServiceColumn(colDef) &&
10
- getColumnSettingsMode(colDef) !== COLUMN_SETTINGS_MODE.Locked);
7
+ 'columnSettings' in colDef &&
8
+ colDef.columnSettings?.mode !== 'locked');
11
9
  }
@@ -31,6 +31,7 @@ export function useTableScroll({ usePageStickyHeader, isStickyControls, stickyCo
31
31
  const wrapper = wrapperRef.current;
32
32
  if (!usePageStickyHeader) {
33
33
  wrapper?.style.removeProperty(TABLE_CSS_VARS.headerScrollLeft);
34
+ wrapper?.style.removeProperty(TABLE_CSS_VARS.viewportWidth);
34
35
  return;
35
36
  }
36
37
  const viewport = internalScrollRef.current;
@@ -42,21 +43,6 @@ export function useTableScroll({ usePageStickyHeader, isStickyControls, stickyCo
42
43
  observer.observe(viewport);
43
44
  return () => observer.disconnect();
44
45
  }, [usePageStickyHeader, isScrollReady, columnSizeVars, syncHeaderHorizontalScroll, view, isLoadingState]);
45
- // Ширина вьюпорта нужна не только sticky-шапке: по ней центрируется пустое состояние.
46
- useLayoutEffect(() => {
47
- const wrapper = wrapperRef.current;
48
- const viewport = internalScrollRef.current;
49
- if (!wrapper || !viewport) {
50
- return;
51
- }
52
- const syncViewportWidth = () => {
53
- wrapper.style.setProperty(TABLE_CSS_VARS.viewportWidth, `${viewport.clientWidth}px`);
54
- };
55
- syncViewportWidth();
56
- const observer = new ResizeObserver(syncViewportWidth);
57
- observer.observe(viewport);
58
- return () => observer.disconnect();
59
- }, [isScrollReady, usePageStickyHeader, view, isCardsView, isLoadingState]);
60
46
  useLayoutEffect(() => {
61
47
  if (!usePageStickyHeader || !showToolbar) {
62
48
  wrapperRef.current?.style.removeProperty(TABLE_CSS_VARS.stickyToolbarOffset);
@@ -442,8 +442,7 @@
442
442
  flex:1 1 auto;
443
443
  flex-direction:column;
444
444
  width:100%;
445
- min-width:-moz-max-content;
446
- min-width:max-content;
445
+ min-width:0;
447
446
  min-height:100%;
448
447
  }
449
448
 
@@ -576,21 +575,4 @@
576
575
  flex:1 1 auto;
577
576
  width:100%;
578
577
  max-width:100%;
579
- }
580
-
581
- .columnDragPreview{
582
- display:flex;
583
- align-items:center;
584
- box-sizing:border-box;
585
- height:var(--sn-table-anatomy-content-tableCell-minHeight, var(--sn-primitive-dimension-40, 40px));
586
- padding:var(--sn-table-anatomy-content-tableHead-paddingTop, var(--sn-primitive-dimension-6, 6px)) var(--sn-table-anatomy-content-tableHead-paddingRight, var(--sn-primitive-dimension-12, 12px)) var(--sn-table-anatomy-content-tableHead-paddingBottom, var(--sn-primitive-dimension-6, 6px)) var(--sn-table-anatomy-content-tableHead-paddingLeft, var(--sn-primitive-dimension-12, 12px));
587
- border-radius:var(--sn-table-anatomy-content-borderRadius, var(--sn-brand-anatomy-radius-table-m, var(--sn-primitive-dimension-4, 4px)));
588
- color:var(--sn-theme-color-available-version-textTertiary, var(--sn-brand-color-text-version-tertiary, rgba(65, 66, 78, 0.5490196078)));
589
- white-space:nowrap;
590
- font-family:var(--sn-regular-body-m-fontFamily, var(--sn-brand-font-fontFamily-regular-body, var(--sn-primitive-fontFamily-brandA-sans, SB Sans Interface)));
591
- font-weight:var(--sn-regular-body-m-fontWeight, var(--sn-theme-typography-fontWeight-regular-body-m, var(--sn-brand-font-fontWeight-light-regular-body-m, var(--sn-primitive-font-fontWeightValue-400, 400))));
592
- line-height:var(--sn-regular-body-m-lineHeight, var(--sn-density-typography-roleBody-lineHeightM, var(--sn-primitive-font-lineHeight-by16, 24px)));
593
- font-size:var(--sn-regular-body-m-fontSize, var(--sn-density-typography-roleBody-fontSizeM, var(--sn-primitive-font-fontSize-16, 16px)));
594
- letter-spacing:var(--sn-regular-body-m-letterSpacing, var(--sn-primitive-font-letterSpacing-m, 0.1px));
595
- paragraph-spacing:var(--sn-regular-body-m-paragraphSpacing, var(--sn-primitive-font-paragraphSpacing-byFontSize14, 7px));
596
578
  }
@@ -1,4 +1,3 @@
1
- export * from './alignOverlayToHeader.js';
2
1
  export * from './columnSize.js';
3
2
  export * from './getColumnIdentifier.js';
4
3
  export * from './getColumnStyleVars.js';
@@ -1,4 +1,3 @@
1
- export * from './alignOverlayToHeader.js';
2
1
  export * from './columnSize.js';
3
2
  export * from './getColumnIdentifier.js';
4
3
  export * from './getColumnStyleVars.js';
@@ -10,7 +10,7 @@ export declare const COLUMN_ALIGN: {
10
10
  export declare const COLUMN_SETTINGS_MODE: {
11
11
  /** В меню настроек `Switch` заблокирован, колонка всегда видима */
12
12
  readonly Locked: "locked";
13
- /** В меню, по умолчанию включена. Режим по умолчанию для любой колонки */
13
+ /** В меню, по умолчанию включена */
14
14
  readonly DefaultVisible: "defaultVisible";
15
15
  /** В меню, по умолчанию выключена */
16
16
  readonly DefaultHidden: "defaultHidden";
@@ -9,7 +9,7 @@ export const COLUMN_ALIGN = {
9
9
  export const COLUMN_SETTINGS_MODE = {
10
10
  /** В меню настроек `Switch` заблокирован, колонка всегда видима */
11
11
  Locked: 'locked',
12
- /** В меню, по умолчанию включена. Режим по умолчанию для любой колонки */
12
+ /** В меню, по умолчанию включена */
13
13
  DefaultVisible: 'defaultVisible',
14
14
  /** В меню, по умолчанию выключена */
15
15
  DefaultHidden: 'defaultHidden',
@@ -6,9 +6,9 @@ import { TEST_IDS } from '../../../constants.js';
6
6
  import { useCellSizes } from '../../../hooks/index.js';
7
7
  import { Cell } from '../Cell.js';
8
8
  import styles from './styles.module.css';
9
- function BodyCellView({ cell, className, rowAutoHeight, style, setNodeRef, isDragging, ...props }) {
9
+ function BodyCellView({ cell, className, rowAutoHeight, style, setNodeRef, ...props }) {
10
10
  const columnDef = cell.column.columnDef;
11
- return (_jsx(Cell, { ...props, ref: setNodeRef, style: style, className: cn(styles.tableBodyCell, className, columnDef.cellClassName), "data-row-auto-height": rowAutoHeight || undefined, "data-align": columnDef.align, "data-no-padding": columnDef.noBodyCellPadding || undefined, "data-column-id": cell.column.id, "data-dragging": isDragging || undefined, "data-test-id": TEST_IDS.bodyCell, children: flexRender(columnDef.cell, cell.getContext()) }));
11
+ return (_jsx(Cell, { ...props, ref: setNodeRef, style: style, className: cn(styles.tableBodyCell, className, columnDef.cellClassName), "data-row-auto-height": rowAutoHeight || undefined, "data-align": columnDef.align, "data-no-padding": columnDef.noBodyCellPadding || undefined, "data-column-id": cell.column.id, "data-test-id": TEST_IDS.bodyCell, children: flexRender(columnDef.cell, cell.getContext()) }));
12
12
  }
13
13
  function StaticBodyCell(props) {
14
14
  const style = useCellSizes(props.cell);
@@ -16,8 +16,8 @@ function StaticBodyCell(props) {
16
16
  }
17
17
  function DraggableBodyCell(props) {
18
18
  const { setNodeRef, isDragging, transform } = useSortable({ id: props.cell.column.id });
19
- const style = useCellSizes(props.cell, { isDraggable: true, transform });
20
- return _jsx(BodyCellView, { ...props, style: style, setNodeRef: setNodeRef, isDragging: isDragging });
19
+ const style = useCellSizes(props.cell, { isDraggable: true, isDragging, transform });
20
+ return _jsx(BodyCellView, { ...props, style: style, setNodeRef: setNodeRef });
21
21
  }
22
22
  export function BodyCell({ isDraggable, ...props }) {
23
23
  if (isDraggable) {
@@ -1,6 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { useSortable } from '@dnd-kit/sortable';
3
- import { DRAG_MODE, DragGhost } from '@cloud-ru/ds-drag-and-drop';
4
3
  import { TruncateString } from '@cloud-ru/ds-truncate-string';
5
4
  import { flexRender } from '@tanstack/react-table';
6
5
  import cn from 'classnames';
@@ -21,8 +20,8 @@ export function HeaderCell({ header, pinPosition, className, rowAutoHeight, isDr
21
20
  const columnSizingInfo = header.getContext().table.getState().columnSizingInfo;
22
21
  const isSomeColumnResizing = columnSizingInfo.isResizingColumn;
23
22
  const columnDef = header.column.columnDef;
24
- const { listeners, setNodeRef, isDragging, transform } = useSortable({ id: header.column.id });
25
- const style = useCellSizes(header, { isDraggable, transform });
23
+ const { attributes, listeners, setNodeRef, isDragging, transform } = useSortable({ id: header.column.id });
24
+ const style = useCellSizes(header, { isDraggable, isDragging, transform });
26
25
  const sortingHandler = (e) => {
27
26
  if (isSomeColumnResizing)
28
27
  return;
@@ -33,12 +32,12 @@ export function HeaderCell({ header, pinPosition, className, rowAutoHeight, isDr
33
32
  if (!isDraggable || DEFAULT_COLUMNS.includes(header.column.id)) {
34
33
  return {};
35
34
  }
36
- return listeners;
37
- }, [header.column.id, isDraggable, listeners]);
38
- return (_jsxs(Cell, { style: style, onClick: sortingHandler, "data-sortable": isSortable || undefined, "data-draggable": isDraggable || undefined, "data-no-padding": columnDef.noHeaderCellPadding || undefined, "data-no-offset": columnDef.noHeaderCellBorderOffset || undefined, "data-test-id": TEST_IDS.headerCell, "data-header-id": header.id, "data-resizing": isResizing || undefined, "data-dragging": (isDraggable && isDragging) || undefined, "data-pin-position": pinPosition || undefined, "data-row-auto-height": rowAutoHeight || undefined, role: 'columnheader', className: cn(styles.tableHeaderCell, className, columnDef.headerClassName), ref: element => {
35
+ return { ...attributes, ...listeners };
36
+ }, [attributes, header.column.id, isDraggable, listeners]);
37
+ return (_jsxs(Cell, { style: style, onClick: sortingHandler, "data-sortable": isSortable || undefined, "data-draggable": isDraggable || undefined, "data-no-padding": columnDef.noHeaderCellPadding || undefined, "data-no-offset": columnDef.noHeaderCellBorderOffset || undefined, "data-test-id": TEST_IDS.headerCell, "data-header-id": header.id, "data-resizing": isResizing || undefined, "data-pin-position": pinPosition || undefined, "data-row-auto-height": rowAutoHeight || undefined, role: 'columnheader', className: cn(styles.tableHeaderCell, className, columnDef.headerClassName), ref: element => {
39
38
  if (isDraggable) {
40
39
  setNodeRef(element);
41
40
  }
42
41
  cellRef.current = element;
43
- }, children: [_jsx(DragGhost, { dragging: isDraggable && isDragging, mode: DRAG_MODE.Dynamic, className: styles.tableHeaderCellDragWrapper, ...draggableProps, children: _jsxs("div", { className: styles.tableHeaderCellMain, "data-align": columnDef.headerAlign || undefined, children: [columnDef.header && (_jsx("div", { className: styles.tableHeaderCellName, children: rowAutoHeight || typeof renderedHeader !== 'string' ? (renderedHeader) : (_jsx(TruncateString, { text: renderedHeader })) })), Boolean(sortIcon) && (_jsx("div", { className: styles.tableHeaderIcon, "data-sort-direction": sortDirection, "data-test-id": TEST_IDS.headerSortIndicator, children: sortIcon }))] }) }), Boolean(isResizable) && _jsx(ResizeHandle, { header: header, cellRef: cellRef })] }));
42
+ }, children: [_jsx("div", { className: styles.tableHeaderCellDragWrapper, "data-dragging": (isDraggable && isDragging) || undefined, ...draggableProps, children: _jsxs("div", { className: styles.tableHeaderCellMain, "data-align": columnDef.headerAlign || undefined, children: [columnDef.header && (_jsx("div", { className: styles.tableHeaderCellName, children: rowAutoHeight || typeof renderedHeader !== 'string' ? (renderedHeader) : (_jsx(TruncateString, { text: renderedHeader })) })), Boolean(sortIcon) && (_jsx("div", { className: styles.tableHeaderIcon, "data-sort-direction": sortDirection, "data-test-id": TEST_IDS.headerSortIndicator, children: sortIcon }))] }) }), Boolean(isResizable) && _jsx(ResizeHandle, { header: header, cellRef: cellRef })] }));
44
43
  }
@@ -31,5 +31,5 @@ export function ResizeHandle({ header, cellRef }) {
31
31
  resizeHandler(event);
32
32
  };
33
33
  const offset = isResizing ? getResizeIndicatorOffset({ header, cellRef }) : 0;
34
- return (_jsxs(_Fragment, { children: [_jsx("div", { "aria-hidden": true, className: cn(styles.tableHeaderIcon, styles.tableHeaderResizeHandle), "data-resizing": isResizing || undefined, onMouseDown: handleMouseDown, onTouchStart: resizeHandler, onMouseUp: stopEventPropagation }), isResizing && (_jsx("div", { "data-test-id": TEST_IDS.headerResizeHandleMovingPart, className: styles.tableHeaderResizeIndicator, style: { '--offset': `${offset}px` } }))] }));
34
+ return (_jsxs(_Fragment, { children: [_jsx("div", { role: 'button', tabIndex: 0, className: cn(styles.tableHeaderIcon, styles.tableHeaderResizeHandle), "data-resizing": isResizing || undefined, onMouseDown: handleMouseDown, onTouchStart: resizeHandler, onMouseUp: stopEventPropagation }), isResizing && (_jsx("div", { "data-test-id": TEST_IDS.headerResizeHandleMovingPart, className: styles.tableHeaderResizeIndicator, style: { '--offset': `${offset}px` } }))] }));
35
35
  }
@@ -10,7 +10,4 @@
10
10
  box-sizing:border-box;
11
11
  width:100%;
12
12
  background-color:transparent;
13
- }
14
- .tableCell[data-dragging]{
15
- box-shadow:inset var(--sn-table-anatomy-content-tableLine-background-interaction-borderVerticalWidth, var(--sn-primitive-strokeWeight-strokeRegular, 1px)) 0 0 0 var(--sn-theme-color-available-borderColor, var(--sn-brand-color-state-neutralBorder-forLightMode-default-borderColor, rgba(159, 166, 198, 0.3019607843))), inset calc(-1 * var(--sn-table-anatomy-content-tableLine-background-interaction-borderVerticalWidth, var(--sn-primitive-strokeWeight-strokeRegular, 1px))) 0 0 0 var(--sn-theme-color-available-borderColor, var(--sn-brand-color-state-neutralBorder-forLightMode-default-borderColor, rgba(159, 166, 198, 0.3019607843)));
16
13
  }
@@ -43,10 +43,6 @@
43
43
  width:var(--sn-table-anatomy-content-tableLine-background-interaction-borderVerticalWidth, var(--sn-primitive-strokeWeight-strokeRegular, 1px));
44
44
  }
45
45
 
46
- .tableHeader .rowPinnedCells::after{
47
- bottom:0;
48
- }
49
-
50
46
  .rowPinnedCells[data-position=left]{
51
47
  left:0;
52
48
  }
@@ -7,6 +7,7 @@ export function useEmptyState({ noDataState: noDataStateProp, noResultsState: no
7
7
  const noDataState = {
8
8
  icon: { icon: SearchSVG, appearance: 'neutral', background: true },
9
9
  title: t('noData.title'),
10
+ content: t('noData.content'),
10
11
  ...noDataStateProp,
11
12
  };
12
13
  const noResultsState = {
@@ -1,13 +1,11 @@
1
1
  .tableEmptyStateWrapper{
2
- position:sticky;
3
- left:0;
4
2
  display:flex;
5
3
  flex:1 1 auto;
6
4
  flex-direction:column;
7
5
  align-items:center;
8
6
  justify-content:center;
9
7
  box-sizing:border-box;
10
- width:var(--table-viewport-width, 100%);
8
+ width:100%;
11
9
  min-height:304px;
12
10
  padding:var(--sn-primitive-dimension-24, 24px);
13
11
  }
@@ -3,6 +3,7 @@ import { Cell, Header } from '@tanstack/react-table';
3
3
  import { CSSProperties } from 'react';
4
4
  type CellSizesOptions = {
5
5
  isDraggable?: boolean;
6
+ isDragging?: boolean;
6
7
  transform?: Transform | null;
7
8
  };
8
9
  export declare function useCellSizes<TData>(element: Cell<TData, unknown> | Header<TData, unknown>, options?: CellSizesOptions): CSSProperties;
@@ -3,6 +3,7 @@ import { useMemo } from 'react';
3
3
  import { TABLE_COLUMN_CSS_VARS } from '../constants.js';
4
4
  export function useCellSizes(element, options) {
5
5
  const column = element.column;
6
+ const isDragging = options?.isDragging ?? false;
6
7
  const transform = options?.transform ?? null;
7
8
  const minWidth = column.columnDef.minSize;
8
9
  const maxWidth = column.columnDef.maxSize;
@@ -17,12 +18,14 @@ export function useCellSizes(element, options) {
17
18
  flexShrink,
18
19
  };
19
20
  if (options?.isDraggable) {
21
+ styles.opacity = isDragging ? 0.8 : 1;
20
22
  styles.position = 'relative';
21
23
  styles.transform = CSS.Translate.toString(transform);
24
+ styles.zIndex = isDragging ? 1 : undefined;
22
25
  if (isHeaderCell) {
23
26
  styles.whiteSpace = 'nowrap';
24
27
  }
25
28
  }
26
29
  return styles;
27
- }, [options?.isDraggable, flexShrink, isHeaderCell, maxWidth, minWidth, transform, width]);
30
+ }, [options?.isDraggable, flexShrink, isDragging, isHeaderCell, maxWidth, minWidth, transform, width]);
28
31
  }
@@ -13,6 +13,7 @@ declare const TABLE_MESSAGES: {
13
13
  };
14
14
  readonly noData: {
15
15
  readonly title: "No data";
16
+ readonly content: "Try refreshing the page";
16
17
  };
17
18
  readonly noResults: {
18
19
  readonly title: "Nothing found";
@@ -37,6 +38,7 @@ declare const TABLE_MESSAGES: {
37
38
  };
38
39
  readonly noData: {
39
40
  readonly title: "Нет данных";
41
+ readonly content: "Обновите страницу";
40
42
  };
41
43
  readonly noResults: {
42
44
  readonly title: "Ничего не найдено";
@@ -65,6 +67,7 @@ export declare const tableLocale: import("@cloud-ru/ds-locale").DefinedLocale<{
65
67
  };
66
68
  readonly noData: {
67
69
  readonly title: "No data";
70
+ readonly content: "Try refreshing the page";
68
71
  };
69
72
  readonly noResults: {
70
73
  readonly title: "Nothing found";
@@ -89,6 +92,7 @@ export declare const tableLocale: import("@cloud-ru/ds-locale").DefinedLocale<{
89
92
  };
90
93
  readonly noData: {
91
94
  readonly title: "Нет данных";
95
+ readonly content: "Обновите страницу";
92
96
  };
93
97
  readonly noResults: {
94
98
  readonly title: "Ничего не найдено";