New "clickable" property for <ha-data-table> (#7351)

This commit is contained in:
Philip Allgaier
2020-10-15 15:57:05 +02:00
committed by GitHub
parent ce80285f8d
commit 47f0d74812
11 changed files with 22 additions and 0 deletions

View File

@@ -94,6 +94,8 @@ export class HaDataTable extends LitElement {
@property({ type: Boolean }) public selectable = false;
@property({ type: Boolean }) public clickable = false;
@property({ type: Boolean }) public hasFab = false;
@property({ type: Boolean, attribute: "auto-height" })
@@ -333,6 +335,7 @@ export class HaDataTable extends LitElement {
"mdc-data-table__row--selected": this._checkedRows.includes(
String(row[this.id])
),
clickable: this.clickable,
})}"
aria-selected=${ifDefined(
this._checkedRows.includes(String(row[this.id]))
@@ -886,6 +889,9 @@ export class HaDataTable extends LitElement {
.forceLTR {
direction: ltr;
}
.clickable {
cursor: pointer;
}
`;
}
}