@synerise/ds-table-new 1.0.5 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.0.6](https://github.com/Synerise/synerise-design/compare/@synerise/ds-table-new@1.0.5...@synerise/ds-table-new@1.0.6) (2026-04-24)
7
+
8
+ ### Bug Fixes
9
+
10
+ - **table-new:** fixes lack of text overflow on cell wrapper child dom node ([81abddf](https://github.com/Synerise/synerise-design/commit/81abddfdc4355b588e9f5345e66cf663102460f3))
11
+ - **table-new:** render skeleton when columns race behind data ([6fbde3c](https://github.com/Synerise/synerise-design/commit/6fbde3c4450aa79e1249c25b5f1de00648304edc))
12
+ - **table-new:** support pinned columns when stickyHeader is off ([1d027dd](https://github.com/Synerise/synerise-design/commit/1d027dd6c2177b75ce5739bf9df04bf25583e82c))
13
+
6
14
  ## [1.0.5](https://github.com/Synerise/synerise-design/compare/@synerise/ds-table-new@1.0.4...@synerise/ds-table-new@1.0.5) (2026-04-22)
7
15
 
8
16
  **Note:** Version bump only for package @synerise/ds-table-new
package/dist/Table.js CHANGED
@@ -33,7 +33,9 @@ const Table = ({
33
33
  return columns.length ? processColumns(columns, hasSelection, texts) : columns;
34
34
  }, [columns, hasSelection, texts]);
35
35
  const skeletonColumns = useMemo(() => getDefaultSkeletonColumns(), []);
36
- const finalColumns = !processedColumns.length && isLoading ? skeletonColumns : processedColumns;
36
+ const useSkeletonColumns = !processedColumns.length && (isLoading || data.length > 0);
37
+ const finalColumns = useSkeletonColumns ? skeletonColumns : processedColumns;
38
+ const effectiveIsLoading = isLoading || useSkeletonColumns;
37
39
  const {
38
40
  table,
39
41
  paginationProps,
@@ -70,7 +72,7 @@ const Table = ({
70
72
  table,
71
73
  getScrollContainer: () => null
72
74
  }), [table]);
73
- return /* @__PURE__ */ jsx(TableContext.Provider, { value: tableContextValue, children: /* @__PURE__ */ jsx(SelectionContext.Provider, { value: selectionConfig, children: /* @__PURE__ */ jsx(BaseTable, { texts, isLoading, hasPagination, paginationProps, tableOuterRef: wrapperRef, selectedRowKeys, columnSizing, isColumnSizingReady, searchQuery, setSearchQuery, handleSearchClear, hasBuiltInSearch, searchProps, dataSourceTotalCount: totalDataCount, ...props }) }) });
75
+ return /* @__PURE__ */ jsx(TableContext.Provider, { value: tableContextValue, children: /* @__PURE__ */ jsx(SelectionContext.Provider, { value: selectionConfig, children: /* @__PURE__ */ jsx(BaseTable, { texts, isLoading: effectiveIsLoading, hasPagination, paginationProps, tableOuterRef: wrapperRef, selectedRowKeys, columnSizing, isColumnSizingReady, searchQuery, setSearchQuery, handleSearchClear, hasBuiltInSearch, searchProps, dataSourceTotalCount: totalDataCount, ...props }) }) });
74
76
  };
75
77
  export {
76
78
  Table
@@ -444,11 +444,8 @@ export type CustomCounterArgs = {
444
444
  export type CustomCounterFn = (props: CustomCounterArgs) => ReactNode;
445
445
  export type TableBodyProps<TData, TValue> = Pick<BaseTableProps<TData, TValue>, 'infiniteScroll' | 'cellHeight' | 'emptyDataComponent' | 'onRowClick' | 'getRowProps' | 'getRowTooltipProps'> & {
446
446
  texts: TableBodyTexts;
447
- withBodyScroll?: boolean;
448
- tableBodyScrollRef?: React.MutableRefObject<HTMLElement | null>;
449
- maxHeight?: number;
450
447
  };
451
- export type TableEmptyBodyProps<TData, TValue> = Pick<TableBodyProps<TData, TValue>, 'emptyDataComponent' | 'tableBodyScrollRef'> & {
448
+ export type TableEmptyBodyProps<TData, TValue> = Pick<TableBodyProps<TData, TValue>, 'emptyDataComponent'> & {
452
449
  texts: TableEmptyBodyTexts;
453
450
  };
454
451
  export type TableCounterProps<TData, TValue> = Pick<BaseTableProps<TData, TValue>, 'renderCustomCounter' | 'isCounterLoading'> & {
@@ -54,7 +54,9 @@ const VirtualTable = ({
54
54
  return columns.length ? processColumns(columns, hasSelection, texts) : columns;
55
55
  }, [columns, hasSelection, texts]);
56
56
  const skeletonColumns = useMemo(() => getDefaultSkeletonColumns(), []);
57
- const finalColumns = !processedColumns.length && isLoading ? skeletonColumns : processedColumns;
57
+ const useSkeletonColumns = !processedColumns.length && (isLoading || data.length > 0);
58
+ const finalColumns = useSkeletonColumns ? skeletonColumns : processedColumns;
59
+ const effectiveIsLoading = isLoading || useSkeletonColumns;
58
60
  const {
59
61
  table,
60
62
  columnSizing,
@@ -243,7 +245,7 @@ const VirtualTable = ({
243
245
  rowVirtualizer.scrollToOffset(0);
244
246
  }, [onBackToTop, rowVirtualizer]);
245
247
  return /* @__PURE__ */ jsx(TableContext.Provider, { value: tableContextValue, children: /* @__PURE__ */ jsx(StickyContext.Provider, { value: stickyValue, children: /* @__PURE__ */ jsxs(SelectionContext.Provider, { value: selectionConfig, children: [
246
- /* @__PURE__ */ jsx(BaseTable, { columnSizing, isColumnSizingReady, texts, tableOuterRef, tableBodyScrollRef, withScroll: withContainerScroll, withBodyScroll, maxHeight, hasPagination: false, infiniteScroll, isLoading, searchQuery, setSearchQuery, handleSearchClear, hasBuiltInSearch, searchProps, dataSourceTotalCount: totalDataCount, cellHeight, ...props }),
248
+ /* @__PURE__ */ jsx(BaseTable, { columnSizing, isColumnSizingReady, texts, tableOuterRef, tableBodyScrollRef, withScroll: withContainerScroll, withBodyScroll, maxHeight, hasPagination: false, infiniteScroll, isLoading: effectiveIsLoading, searchQuery, setSearchQuery, handleSearchClear, hasBuiltInSearch, searchProps, dataSourceTotalCount: totalDataCount, cellHeight, ...props }),
247
249
  showBackToTopButton && /* @__PURE__ */ jsx(BackToTopButton, { label: texts.infiniteScrollBackToTop, onClick: handleBackToTop, scrollContainerRef: scrollableContainerRef, hasData: !tableIsEmpty && columns.length > 0, threshold: (stickyData.titleBarHeight || 0) + (Number.isFinite(stickyData.containerPaddingTop) ? stickyData.containerPaddingTop : 0) })
248
250
  ] }) }) });
249
251
  };
@@ -11,7 +11,7 @@ import { TableHeader } from "../TableHeader/TableHeader.js";
11
11
  import { TableHorizontalScroll } from "../TableHorizontalScroll/TableHorizontalScroll.js";
12
12
  import { TableHorizontalScrollBar } from "../TableHorizontalScrollBar/TableHorizontalScrollBar.js";
13
13
  import { TablePagination } from "../TablePagination/TablePagination.js";
14
- import { StyledTable, BaseTableWrapper, TableContainer, TableColumnsHorizontalScroll, TableBodyScrollWrapper } from "./BaseTable.styles.js";
14
+ import { StyledTable, BaseTableWrapper, TableContainer, TableBodyScrollWrapper, TableColumnsHorizontalScroll } from "./BaseTable.styles.js";
15
15
  const BaseTable = ({
16
16
  infiniteScroll,
17
17
  cellHeight = DEFAULT_CELL_HEIGHT,
@@ -101,12 +101,12 @@ const BaseTable = ({
101
101
  addNode(element);
102
102
  }, children: /* @__PURE__ */ jsxs(StyledTable, { role: "table", children: [
103
103
  !hideColumnNames && (!isEmpty || isLoading) && /* @__PURE__ */ jsx(TableColumns, { texts, disableColumnNamesLineBreak }),
104
- isLoading ? /* @__PURE__ */ jsx(TableBodySkeleton, { wrapperRef: tableBodyWrapperRef, cellHeight }, "table-body-skeleton") : /* @__PURE__ */ jsx(TableBody, { withBodyScroll, tableBodyScrollRef, maxHeight, cellHeight, infiniteScroll, emptyDataComponent, texts, onRowClick, getRowProps, getRowTooltipProps }, "table-body")
104
+ isLoading ? /* @__PURE__ */ jsx(TableBodySkeleton, { wrapperRef: tableBodyWrapperRef, cellHeight }, "table-body-skeleton") : /* @__PURE__ */ jsx(TableBody, { cellHeight, infiniteScroll, emptyDataComponent, texts, onRowClick, getRowProps, getRowTooltipProps }, "table-body")
105
105
  ] }) });
106
106
  return /* @__PURE__ */ jsxs(BaseTableWrapper, { isEmpty, columnSizing, $isColumnSizingReady: isColumnSizingReady, $size: size, children: [
107
107
  /* @__PURE__ */ jsxs(TableContainer, { ref: tableOuterRef, className, withBorderTop: headerWithBorderTop, cardStyles, withScroll, $maxHeight: maxHeight, "data-testid": "ds-table-container", children: [
108
108
  !hideTitleBar && /* @__PURE__ */ jsx(TableHeader, { itemsMenu, texts, childrenColumnName: expandable?.childrenColumnName, isCounterLoading, isLoading, rowKey, title, hideTitlePart, renderCustomCounter, renderSelectionTitle, searchComponent, filterComponent, headerButton, dataSourceTotalCount, searchQuery, setSearchQuery, handleSearchClear, hasBuiltInSearch, searchProps }),
109
- useUnifiedScroll ? unifiedTableContent : /* @__PURE__ */ jsxs(Fragment, { children: [
109
+ useUnifiedScroll ? withBodyScroll ? /* @__PURE__ */ jsx(TableBodyScrollWrapper, { ref: tableBodyScrollRef, $maxHeight: maxHeight, children: unifiedTableContent }) : unifiedTableContent : /* @__PURE__ */ jsxs(Fragment, { children: [
110
110
  !hideColumnNames && (!isEmpty || isLoading) && /* @__PURE__ */ jsx(TableColumnsHorizontalScroll, { stickyRight: table.getRightTotalSize(), stickyLeft: table.getLeftTotalSize(), stickyData: stickyContext?.stickyData, isScrolled: rowVirtualizer?.scrollOffset, ref: handleRef, children: /* @__PURE__ */ jsx(StyledTable, { role: "table", children: /* @__PURE__ */ jsx(TableColumns, { texts, disableColumnNamesLineBreak }) }) }),
111
111
  withBodyScroll ? /* @__PURE__ */ jsx(TableBodyScrollWrapper, { ref: tableBodyScrollRef, $maxHeight: maxHeight, children: tableBodyContent }) : tableBodyContent
112
112
  ] }),
@@ -1,3 +1,3 @@
1
1
  import { default as React } from 'react';
2
2
  import { TableBodyProps } from '../../Table.types';
3
- export declare const TableBody: <TData extends object, TValue>({ cellHeight, infiniteScroll, onRowClick, getRowProps, getRowTooltipProps, withBodyScroll, tableBodyScrollRef, maxHeight, emptyDataComponent, texts, }: TableBodyProps<TData, TValue>) => React.JSX.Element;
3
+ export declare const TableBody: <TData extends object, TValue>({ cellHeight, infiniteScroll, onRowClick, getRowProps, getRowTooltipProps, emptyDataComponent, texts, }: TableBodyProps<TData, TValue>) => React.JSX.Element;
@@ -11,9 +11,6 @@ const TableBody = ({
11
11
  onRowClick,
12
12
  getRowProps,
13
13
  getRowTooltipProps,
14
- withBodyScroll,
15
- tableBodyScrollRef,
16
- maxHeight,
17
14
  emptyDataComponent,
18
15
  texts
19
16
  }) => {
@@ -39,11 +36,7 @@ const TableBody = ({
39
36
  return true;
40
37
  }) : flatRows;
41
38
  const allRows = rowVirtualizer ? flatRows : nonVirtualRows;
42
- return allRows.length ? /* @__PURE__ */ jsx(TBody, { "data-testid": "ds-table-body", ref: (node) => {
43
- if (tableBodyScrollRef) {
44
- tableBodyScrollRef.current = node;
45
- }
46
- }, $maxHeight: maxHeight, withBodyScroll, role: "rowgroup", "data-popup-container": true, style: rowVirtualizer && virtualItems.length ? {
39
+ return allRows.length ? /* @__PURE__ */ jsx(TBody, { "data-testid": "ds-table-body", role: "rowgroup", "data-popup-container": true, style: rowVirtualizer && virtualItems.length ? {
47
40
  height: `${rowVirtualizer.getTotalSize()}px`,
48
41
  position: "relative"
49
42
  } : void 0, children: rowVirtualizer && virtualItems.length ? (
@@ -55,7 +48,7 @@ const TableBody = ({
55
48
  ) : (
56
49
  // Non-virtualized: render all rows in the normal flow
57
50
  allRows.map((row) => /* @__PURE__ */ jsx(TableRow, { onRowClick, getRowProps, getRowTooltipProps, row, isSelected: row.getIsSelected(), isExpanded: row.getIsExpanded(), isParentExpanded: row.getIsAllParentsExpanded() }, row.id))
58
- ) }, "virtual-table-body") : /* @__PURE__ */ jsx(TableEmptyBody, { emptyDataComponent, texts, tableBodyScrollRef });
51
+ ) }, "virtual-table-body") : /* @__PURE__ */ jsx(TableEmptyBody, { emptyDataComponent, texts });
59
52
  };
60
53
  export {
61
54
  TableBody
@@ -1,5 +1,2 @@
1
1
  export declare const Tr: import('styled-components').StyledComponent<"tr", any, {}, never>;
2
- export declare const TBody: import('styled-components').StyledComponent<"tbody", any, {
3
- $maxHeight?: number;
4
- withBodyScroll?: boolean;
5
- }, never>;
2
+ export declare const TBody: import('styled-components').StyledComponent<"tbody", any, {}, never>;
@@ -1,4 +1,4 @@
1
- import styled, { css } from "styled-components";
1
+ import styled from "styled-components";
2
2
  import { commonRowStyles } from "../../Table.styles.js";
3
3
  import { Td } from "./TableCell/TableCell.styles.js";
4
4
  const Tr = /* @__PURE__ */ styled.tr.withConfig({
@@ -8,7 +8,7 @@ const Tr = /* @__PURE__ */ styled.tr.withConfig({
8
8
  const TBody = /* @__PURE__ */ styled.tbody.withConfig({
9
9
  displayName: "TableBodystyles__TBody",
10
10
  componentId: "sc-1dty8xx-1"
11
- })(["position:relative;", ""], (props) => props.withBodyScroll && css(["display:block;max-height:", "px;overflow-y:scroll;"], props.$maxHeight ?? 800));
11
+ })(["position:relative;"]);
12
12
  export {
13
13
  TBody,
14
14
  Tr
@@ -12,7 +12,7 @@ const CellWrapper = /* @__PURE__ */ styled.div.withConfig({
12
12
  const Td = /* @__PURE__ */ styled.td.withConfig({
13
13
  displayName: "TableCellstyles__Td",
14
14
  componentId: "sc-1sq3dd7-1"
15
- })(["", " ", " text-align:", ";&&&&{", ";}", ";", ";", "{display:flex;align-items:center;justify-content:", ";width:100%;}"], commonCellStyles, commonPinnedStyles, (props) => props.$align ?? "left", (props) => props.isSorted && `background-color: ${props.theme.palette["blue-050"]}`, (props) => props.headerIndex !== void 0 ? `width: var(--col-${props.headerIndex}-width)` : props.$width && `width: ${props.$width}px`, (props) => props.$height ? `
15
+ })(["", " ", " text-align:", ";&&&&{", ";}", ";", ";", "{display:flex;align-items:center;justify-content:", ";width:100%;& > *{min-width:0;}}"], commonCellStyles, commonPinnedStyles, (props) => props.$align ?? "left", (props) => props.isSorted && `background-color: ${props.theme.palette["blue-050"]}`, (props) => props.headerIndex !== void 0 ? `width: var(--col-${props.headerIndex}-width)` : props.$width && `width: ${props.$width}px`, (props) => props.$height ? `
16
16
  padding: 0 24px;
17
17
  height: ${props.$height}px` : `
18
18
  padding: 16px 24px;
@@ -1,3 +1,3 @@
1
1
  import { default as React } from 'react';
2
2
  import { TableEmptyBodyProps } from '../../../Table.types';
3
- export declare const TableEmptyBody: <TData, TValue>({ emptyDataComponent, texts, tableBodyScrollRef, }: TableEmptyBodyProps<TData, TValue>) => React.JSX.Element;
3
+ export declare const TableEmptyBody: <TData, TValue>({ emptyDataComponent, texts, }: TableEmptyBodyProps<TData, TValue>) => React.JSX.Element;
@@ -5,18 +5,13 @@ import { useTableContext } from "../../../contexts/TableContext.js";
5
5
  import { TBody, Tr, Td, TableEmptyBodyWrapper } from "./TableEmptyBody.styles.js";
6
6
  const TableEmptyBody = ({
7
7
  emptyDataComponent,
8
- texts,
9
- tableBodyScrollRef
8
+ texts
10
9
  }) => {
11
10
  const {
12
11
  table
13
12
  } = useTableContext();
14
13
  const colSpan = table.getAllLeafColumns().length;
15
- return /* @__PURE__ */ jsx(TBody, { ref: (node) => {
16
- if (tableBodyScrollRef) {
17
- tableBodyScrollRef.current = node;
18
- }
19
- }, children: /* @__PURE__ */ jsx(Tr, { children: /* @__PURE__ */ jsx(Td, { colSpan, children: /* @__PURE__ */ jsx(TableEmptyBodyWrapper, { children: emptyDataComponent !== void 0 ? emptyDataComponent : /* @__PURE__ */ jsx(Result, { description: texts.emptyText || /* @__PURE__ */ jsx(FormattedMessage, { id: "DS.TABLE.EMPTY_TEXT" }), type: "no-results", noSearchResults: true }) }) }) }) });
14
+ return /* @__PURE__ */ jsx(TBody, { children: /* @__PURE__ */ jsx(Tr, { children: /* @__PURE__ */ jsx(Td, { colSpan, children: /* @__PURE__ */ jsx(TableEmptyBodyWrapper, { children: emptyDataComponent !== void 0 ? emptyDataComponent : /* @__PURE__ */ jsx(Result, { description: texts.emptyText || /* @__PURE__ */ jsx(FormattedMessage, { id: "DS.TABLE.EMPTY_TEXT" }), type: "no-results", noSearchResults: true }) }) }) }) });
20
15
  };
21
16
  export {
22
17
  TableEmptyBody
@@ -18,7 +18,7 @@ const TableColumns = ({
18
18
  const hasSorter = header.column.getCanSort();
19
19
  const isColumnSorted = isSorted(header.column);
20
20
  const align = header.column.columnDef.meta?.align;
21
- return /* @__PURE__ */ jsx(Th, { headerIndex: columnIndex, colSpan: header.colSpan, style: header.column.columnDef.meta?.style, isPinned: header.column.getIsPinned(), rightOffset: header.column.getStart("left"), leftOffset: header.column.getAfter("right"), isSorted: isColumnSorted, hasSorter, $align: align, "data-sticky": isSticky ? "true" : void 0, role: "columnheader", children: /* @__PURE__ */ jsxs(HeaderWrapper, { $align: align, children: [
21
+ return /* @__PURE__ */ jsx(Th, { headerIndex: columnIndex, colSpan: header.colSpan, style: header.column.columnDef.meta?.style, isPinned: header.column.getIsPinned(), leftOffset: header.column.getStart("left"), rightOffset: header.column.getAfter("right"), isSorted: isColumnSorted, hasSorter, $align: align, "data-sticky": isSticky ? "true" : void 0, role: "columnheader", children: /* @__PURE__ */ jsxs(HeaderWrapper, { $align: align, children: [
22
22
  /* @__PURE__ */ jsx(Label, { disableColumnNamesLineBreak, children: header.isPlaceholder ? null : flexRender(header.column.columnDef.header, header.getContext()) }),
23
23
  hasSorter && (header.column.columnDef.meta?.renderCustomSortButton?.(header.getContext()) || /* @__PURE__ */ jsx(TableColumnSorter, { texts, column: header.column }))
24
24
  ] }) }, id);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synerise/ds-table-new",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "TableNew UI Component for the Synerise Design System",
5
5
  "license": "ISC",
6
6
  "repository": "Synerise/synerise-design",
@@ -34,27 +34,27 @@
34
34
  "types": "dist/index.d.ts",
35
35
  "dependencies": {
36
36
  "@floating-ui/react": "^0.27.16",
37
- "@synerise/ds-badge": "^1.0.48",
38
- "@synerise/ds-button": "^1.5.22",
39
- "@synerise/ds-checkbox": "^1.2.25",
40
- "@synerise/ds-copy-icon": "^1.2.6",
41
- "@synerise/ds-dropdown": "^1.3.7",
37
+ "@synerise/ds-badge": "^1.0.49",
38
+ "@synerise/ds-button": "^1.5.23",
39
+ "@synerise/ds-checkbox": "^1.2.26",
40
+ "@synerise/ds-copy-icon": "^1.2.7",
41
+ "@synerise/ds-dropdown": "^1.3.8",
42
42
  "@synerise/ds-flag": "^1.0.10",
43
- "@synerise/ds-icon": "^1.16.0",
44
- "@synerise/ds-inline-alert": "^1.1.18",
45
- "@synerise/ds-input": "^1.7.2",
46
- "@synerise/ds-input-number": "^1.2.39",
43
+ "@synerise/ds-icon": "^1.17.0",
44
+ "@synerise/ds-inline-alert": "^1.1.19",
45
+ "@synerise/ds-input": "^1.7.3",
46
+ "@synerise/ds-input-number": "^1.2.40",
47
47
  "@synerise/ds-loader": "^1.0.15",
48
- "@synerise/ds-modal": "^1.4.6",
49
- "@synerise/ds-pagination": "^1.0.57",
50
- "@synerise/ds-result": "^1.0.53",
51
- "@synerise/ds-scrollbar": "^1.3.0",
52
- "@synerise/ds-search": "^1.5.16",
53
- "@synerise/ds-skeleton": "^1.0.49",
54
- "@synerise/ds-tag": "^1.4.22",
55
- "@synerise/ds-tags": "^1.5.33",
56
- "@synerise/ds-tooltip": "^1.4.14",
57
- "@synerise/ds-typography": "^1.1.17",
48
+ "@synerise/ds-modal": "^1.4.7",
49
+ "@synerise/ds-pagination": "^1.0.58",
50
+ "@synerise/ds-result": "^1.0.54",
51
+ "@synerise/ds-scrollbar": "^1.3.1",
52
+ "@synerise/ds-search": "^1.5.17",
53
+ "@synerise/ds-skeleton": "^1.0.50",
54
+ "@synerise/ds-tag": "^1.4.23",
55
+ "@synerise/ds-tags": "^1.5.34",
56
+ "@synerise/ds-tooltip": "^1.4.15",
57
+ "@synerise/ds-typography": "^1.1.18",
58
58
  "@synerise/ds-utils": "^1.8.0",
59
59
  "@tanstack/react-table": "^8.21.3",
60
60
  "@tanstack/react-virtual": "^3.13.12",
@@ -71,5 +71,5 @@
71
71
  "react-intl": ">= 3.12.0 <= 6.8",
72
72
  "styled-components": "^5.3.3"
73
73
  },
74
- "gitHead": "6d4f42c9a899ff73f582a7405a5a2470a4b07083"
74
+ "gitHead": "71415efab30b82d23558094f18c9551a15234be3"
75
75
  }