Skip to content

Commit 53a1e67

Browse files
Merge branch 'main' into reset-paging
2 parents a947bff + ecc797f commit 53a1e67

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

projects/components/src/table/table.component.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,10 @@ $header-height: 32px;
4242
flex-direction: row;
4343
height: 44px;
4444
min-height: 44px;
45-
cursor: pointer;
45+
46+
&.selectable {
47+
cursor: pointer;
48+
}
4649

4750
&.selected-row {
4851
background: $blue-1;

projects/components/src/table/table.component.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,11 @@ import { TableColumnConfigExtended, TableService } from './table.service';
144144
*cdkRowDef="let row; columns: this.visibleColumnIds$ | async"
145145
(mouseenter)="this.onDataRowMouseEnter(row)"
146146
(mouseleave)="this.onDataRowMouseLeave()"
147-
[ngClass]="{ 'selected-row': this.shouldHighlightRowAsSelection(row), 'hovered-row': this.isHoveredRow(row) }"
147+
[ngClass]="{
148+
'selected-row': this.shouldHighlightRowAsSelection(row),
149+
'hovered-row': this.isHoveredRow(row),
150+
selectable: this.supportsRowSelection()
151+
}"
148152
class="data-row"
149153
></cdk-row>
150154
@@ -697,6 +701,10 @@ export class TableComponent
697701
return this.selectionMode === TableSelectionMode.Multiple;
698702
}
699703

704+
public supportsRowSelection(): boolean {
705+
return this.hasMultiSelect() || this.hasSingleSelect();
706+
}
707+
700708
public isRowExpanded(row: StatefulTableRow): boolean {
701709
return this.hasExpandableRows() && row.$$state.expanded;
702710
}

0 commit comments

Comments
 (0)