Skip to content

Commit

Permalink
20241002.1 (#22189)
Browse files Browse the repository at this point in the history
  • Loading branch information
bramkragten authored Oct 2, 2024
2 parents fdf9fab + cdd2929 commit e84c3a8
Show file tree
Hide file tree
Showing 4 changed files with 611 additions and 20 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "home-assistant-frontend"
version = "20241002.0"
version = "20241002.1"
license = {text = "Apache-2.0"}
description = "The Home Assistant frontend"
readme = "README.md"
Expand Down
23 changes: 23 additions & 0 deletions src/components/data-table/ha-data-table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,29 @@ export class HaDataTable extends LitElement {
this._checkedRowsChanged();
}

public select(ids: string[], clear?: boolean): void {
if (clear) {
this._checkedRows = [];
}
ids.forEach((id) => {
const row = this._filteredData.find((data) => data[this.id] === id);
if (row?.selectable !== false && !this._checkedRows.includes(id)) {
this._checkedRows.push(id);
}
});
this._checkedRowsChanged();
}

public unselect(ids: string[]): void {
ids.forEach((id) => {
const index = this._checkedRows.indexOf(id);
if (index > -1) {
this._checkedRows.splice(index, 1);
}
});
this._checkedRowsChanged();
}

public connectedCallback() {
super.connectedCallback();
if (this._filteredData.length) {
Expand Down
Loading

0 comments on commit e84c3a8

Please sign in to comment.