@synerise/ds-table-new 1.3.0 → 1.3.1
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,12 @@
|
|
|
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.3.1](https://github.com/Synerise/synerise-design/compare/@synerise/ds-table-new@1.3.0...@synerise/ds-table-new@1.3.1) (2026-05-19)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- **table-new:** reinstate optional indent without expander ([015517a](https://github.com/Synerise/synerise-design/commit/015517a00a7d9dd1a4b50e7dad20c7fb71ede2d8))
|
|
11
|
+
|
|
6
12
|
# [1.3.0](https://github.com/Synerise/synerise-design/compare/@synerise/ds-table-new@1.2.0...@synerise/ds-table-new@1.3.0) (2026-05-15)
|
|
7
13
|
|
|
8
14
|
### Features
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { TreeTableProps } from './TreeTable.types';
|
|
3
|
-
export declare const TreeTable: <TData extends object, TValue>({ data, columns, childrenColumnName, defaultExpandAllRows, expandedRowKeys: controlledExpandedKeys, onExpandRow, expandIconColumnIndex, rowKey, ...props }: TreeTableProps<TData, TValue>) => React.JSX.Element;
|
|
3
|
+
export declare const TreeTable: <TData extends object, TValue>({ data, columns, childrenColumnName, defaultExpandAllRows, expandedRowKeys: controlledExpandedKeys, onExpandRow, expandIconColumnIndex, hideExpandIcon, rowKey, ...props }: TreeTableProps<TData, TValue>) => React.JSX.Element;
|
|
@@ -27,6 +27,7 @@ const TreeTable = ({
|
|
|
27
27
|
expandedRowKeys: controlledExpandedKeys,
|
|
28
28
|
onExpandRow,
|
|
29
29
|
expandIconColumnIndex = 0,
|
|
30
|
+
hideExpandIcon = false,
|
|
30
31
|
rowKey,
|
|
31
32
|
...props
|
|
32
33
|
}) => {
|
|
@@ -84,18 +85,20 @@ const TreeTable = ({
|
|
|
84
85
|
length: depth
|
|
85
86
|
}, (_, i) => /* @__PURE__ */ jsx(IndentBar, { $level: i, $active: i + 1 === depth }, i));
|
|
86
87
|
const originalCell = typeof col.cell === "function" ? col.cell(info) : info.getValue();
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
88
|
+
const rowPrefix = isParent && !hideExpandIcon ? /* @__PURE__ */ jsx(Expander, { expanded: isExpanded, onClick: (e) => {
|
|
89
|
+
e.stopPropagation();
|
|
90
|
+
toggleExpand(rowId);
|
|
91
|
+
} }) : depth > 0 ? /* @__PURE__ */ jsx(Icon, { component: /* @__PURE__ */ jsx(ChildRowLeftDownM, {}), color: theme.palette["grey-400"] }) : null;
|
|
92
|
+
const finalDepth = hideExpandIcon && depth > 0 ? depth - 1 : depth;
|
|
93
|
+
return /* @__PURE__ */ jsxs(TreeCellWrapper, { $indentWidth: finalDepth * INDENT_SIZE, children: [
|
|
94
|
+
depth > 0 && !hideExpandIcon && /* @__PURE__ */ jsx(IndentsContainer, { $depth: depth, children: indents }),
|
|
95
|
+
rowPrefix && /* @__PURE__ */ jsx(ExpanderWrapper, { children: rowPrefix }),
|
|
93
96
|
originalCell
|
|
94
97
|
] });
|
|
95
98
|
}
|
|
96
99
|
};
|
|
97
100
|
});
|
|
98
|
-
}, [columns, expandIconColumnIndex, getRowKey, hasChildren, expandedKeys, toggleExpand]);
|
|
101
|
+
}, [columns, expandIconColumnIndex, getRowKey, hasChildren, expandedKeys, toggleExpand, hideExpandIcon]);
|
|
99
102
|
return /* @__PURE__ */ jsx(TreeTableRoot, { children: /* @__PURE__ */ jsx(Table, { data, columns: treeColumns, rowKey, expandable: {
|
|
100
103
|
childrenColumnName: childrenKey,
|
|
101
104
|
expandedRowKeys: expandedKeys
|
|
@@ -19,8 +19,17 @@ export type TreeTableProps<TData, TValue> = Omit<TableProps<TData, TValue>, 'exp
|
|
|
19
19
|
onExpandRow?: (key: string, expanded: boolean) => void;
|
|
20
20
|
/**
|
|
21
21
|
* Index of the column where the expand icon is rendered.
|
|
22
|
-
* Set to -1 to hide the expand icon entirely.
|
|
22
|
+
* Set to -1 to hide the expand icon and skip indentation entirely.
|
|
23
23
|
* @default 0
|
|
24
24
|
*/
|
|
25
25
|
expandIconColumnIndex?: number;
|
|
26
|
+
/**
|
|
27
|
+
* Suppress the expander button on parent rows while still rendering
|
|
28
|
+
* indentation and the leaf glyph (ChildRowLeftDownM) on every indented row.
|
|
29
|
+
* Use when expand/collapse is not user-controllable but you still want
|
|
30
|
+
* visual hierarchy matching the legacy antd table.
|
|
31
|
+
* Ignored when `expandIconColumnIndex` is negative.
|
|
32
|
+
* @default false
|
|
33
|
+
*/
|
|
34
|
+
hideExpandIcon?: boolean;
|
|
26
35
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@synerise/ds-table-new",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "TableNew UI Component for the Synerise Design System",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"repository": "Synerise/synerise-design",
|
|
@@ -80,5 +80,5 @@
|
|
|
80
80
|
"react-intl": ">= 3.12.0 <= 6.8",
|
|
81
81
|
"styled-components": "^5.3.3"
|
|
82
82
|
},
|
|
83
|
-
"gitHead": "
|
|
83
|
+
"gitHead": "b757d8f81066fcba3d1a739dfbbcdb49c13b9f90"
|
|
84
84
|
}
|