File tree Expand file tree Collapse file tree 4 files changed +41
-30
lines changed Expand file tree Collapse file tree 4 files changed +41
-30
lines changed Original file line number Diff line number Diff line change @@ -438,22 +438,25 @@ export const MultiLevelTable: React.FC<MultiLevelTableProps> = ({
438
438
if ( ! children || ! expandedRows . has ( parentId ) ) return null ;
439
439
440
440
return children . map ( ( child ) => (
441
- < TableRow
442
- key = { child . id }
443
- row = { child }
444
- columns = { columns }
445
- hasChildren = { ! ! child . children && child . children . length > 0 }
446
- isExpanded = { expandedRows . has ( child . id ) }
447
- onToggle = { ( ) => onRowToggle ( child . id ) }
448
- level = { level }
449
- theme = { mergedTheme }
450
- selectable = { selectable }
451
- isRowSelected = { selectionState . selectedRows . has ( child . id ) }
452
- onRowSelect = { ( ) => onRowSelect ( child . id ) }
453
- onRowClick = { onRowClick }
454
- onDelete = { handleDeleteClick }
455
- expandIcon = { expandIcon }
456
- />
441
+ < React . Fragment key = { child . id } >
442
+ < TableRow
443
+ row = { child }
444
+ columns = { columns }
445
+ hasChildren = { ! ! child . children && child . children . length > 0 }
446
+ isExpanded = { expandedRows . has ( child . id ) }
447
+ onToggle = { ( ) => onRowToggle ( child . id ) }
448
+ level = { level }
449
+ theme = { mergedTheme }
450
+ selectable = { selectable }
451
+ isRowSelected = { selectionState . selectedRows . has ( child . id ) }
452
+ onRowSelect = { ( ) => onRowSelect ( child . id ) }
453
+ onRowClick = { onRowClick }
454
+ onDelete = { handleDeleteClick }
455
+ expandIcon = { expandIcon }
456
+ />
457
+ { /* Recursively render nested children */ }
458
+ { child . children && child . children . length > 0 && renderNestedRows ( child . id , level + 1 ) }
459
+ </ React . Fragment >
457
460
) ) ;
458
461
} ;
459
462
Original file line number Diff line number Diff line change @@ -108,14 +108,17 @@ export const TableCell: React.FC<TableCellProps> = ({
108
108
cell . render ( 'Cell' )
109
109
) : (
110
110
< >
111
- { hasChildren ? (
111
+ { /* Only show expand button in the first column when row has children */ }
112
+ { index === 0 && hasChildren ? (
112
113
< div
113
114
onClick = { handleExpandClick }
114
115
className = "expand-button"
115
116
>
116
117
{ expandIcon || < ExpandIcon isExpanded = { isExpanded } theme = { theme } mode = "expand" /> }
117
118
</ div >
118
- ) : < div className = "expand-button" /> }
119
+ ) : index === 0 ? (
120
+ < div className = "expand-button" />
121
+ ) : null }
119
122
{ cell . render ( 'Cell' ) }
120
123
</ >
121
124
) }
Original file line number Diff line number Diff line change @@ -141,14 +141,19 @@ export const TableRow: React.FC<TableRowProps> = ({
141
141
< div className = "placeholder-spacer" />
142
142
) }
143
143
144
- < div
145
- onClick = { handleExpandClick }
146
- className = { `expand-button ${ isParentRow || index !== 0 ? 'parent-row-expand-button' : 'nested-row-expand-button' } ${ hasChildren && index === 0 ? 'expand-button-visible' : 'expand-button-hidden' } ` }
147
- >
148
- { expandIcon || (
149
- < ExpandIcon isExpanded = { isExpanded } theme = { theme } mode = "expand" />
150
- ) }
151
- </ div >
144
+ { /* Only show expand button in the first column when row has children */ }
145
+ { index === 0 && (
146
+ < div
147
+ onClick = { handleExpandClick }
148
+ className = { `expand-button ${ isParentRow || index !== 0 ? 'parent-row-expand-button' : 'nested-row-expand-button' } ${ hasChildren ? 'expand-button-visible' : 'expand-button-hidden' } ` }
149
+ >
150
+ { hasChildren ? (
151
+ expandIcon || (
152
+ < ExpandIcon isExpanded = { isExpanded } theme = { theme } mode = "expand" />
153
+ )
154
+ ) : null }
155
+ </ div >
156
+ ) }
152
157
153
158
{ column . render
154
159
? column . render ( displayValue , dataItem )
Original file line number Diff line number Diff line change 92
92
.pagination-total-items {
93
93
display : block;
94
94
}
95
- }
96
-
95
+ }
96
+
97
97
/* Hide total items text on screens smaller than 798px */
98
98
@media (max-width : 797px ) {
99
99
.pagination-total-items {
100
100
display : none;
101
- }
102
-
101
+ }
102
+
103
103
.pagination-container {
104
104
min-width : 1200px ; /* Maintain minimum width */
105
105
overflow-x : auto; /* Enable horizontal scroll */
You can’t perform that action at this time.
0 commit comments