Skip to content

Commit baa468d

Browse files
committed
refactor(ui5-table): use generics for table cell types
- Background of the growing button is also set Fixes: #12765
1 parent c5f3a39 commit baa468d

File tree

6 files changed

+7
-6
lines changed

6 files changed

+7
-6
lines changed

packages/main/src/Table.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,7 +634,7 @@ class Table extends UI5Element {
634634
}
635635

636636
const widths = [];
637-
const visibleHeaderCells = this.headerRow[0]._visibleCells as TableHeaderCell[];
637+
const visibleHeaderCells = this.headerRow[0]._visibleCells;
638638

639639
// Selection Cell Width
640640
if (this._isRowSelectorRequired) {

packages/main/src/TableCustomAnnouncement.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ class TableCustomAnnouncement extends TableExtension {
202202
descriptions.push(i18nBundle.getText(TABLE_ROW_ACTIVE));
203203
}
204204

205-
const cells = [...row._visibleCells, ...row._popinCells] as TableCell[];
205+
const cells = [...row._visibleCells, ...row._popinCells];
206206
cells.flatMap(cell => {
207207
return cell._popin ? [cell._popinHeader!, cell._popinContent!] : [cell._headerCell, cell];
208208
}).forEach(node => {

packages/main/src/TableHeaderRow.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ import {
4545
*
4646
* @public
4747
*/
48-
class TableHeaderRow extends TableRowBase {
48+
class TableHeaderRow extends TableRowBase<TableHeaderCell> {
4949
/**
5050
* Defines the cells of the component.
5151
*

packages/main/src/TableRow.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import {
3535
styles: [TableRowBase.styles, TableRowCss],
3636
template: TableRowTemplate,
3737
})
38-
class TableRow extends TableRowBase {
38+
class TableRow extends TableRowBase<TableCell> {
3939
/**
4040
* Defines the cells of the component.
4141
*

packages/main/src/TableRowBase.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ import {
2525
renderer: jsxRenderer,
2626
styles: TableRowBaseCss,
2727
})
28-
abstract class TableRowBase extends UI5Element {
29-
cells!: Array<TableCellBase>;
28+
abstract class TableRowBase<TCell extends TableCellBase = TableCellBase> extends UI5Element {
29+
cells!: Array<TCell>;
3030

3131
@property({ type: Number, noAttribute: true })
3232
_invalidate = 0;

packages/main/src/themes/TableGrowing.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
flex-direction: column;
77
cursor: pointer;
88
border-bottom: 1px solid var(--sapList_BorderColor);
9+
background: var(--sapList_Background);
910
}
1011

1112
#button:focus {

0 commit comments

Comments
 (0)