Add label to collapse button in data table groups (#25653)

This commit is contained in:
Bram Kragten 2025-05-30 16:47:54 +02:00
parent aebd6350c0
commit 74f9c1551e
2 changed files with 7 additions and 3 deletions

View File

@ -740,6 +740,7 @@ export class HaDataTable extends LitElement {
}, {});
const groupedItems: DataTableRowData[] = [];
Object.entries(sorted).forEach(([groupName, rows]) => {
const collapsed = collapsedGroups.includes(groupName);
groupedItems.push({
append: true,
selectable: false,
@ -751,9 +752,10 @@ export class HaDataTable extends LitElement {
>
<ha-icon-button
.path=${mdiChevronUp}
class=${collapsedGroups.includes(groupName)
? "collapsed"
: ""}
.label=${this.hass.localize(
`ui.components.data-table.${collapsed ? "expand" : "collapse"}`
)}
class=${collapsed ? "collapsed" : ""}
>
</ha-icon-button>
${groupName === UNDEFINED_GROUP_KEY

View File

@ -902,6 +902,8 @@
"hidden": "{number} hidden",
"clear": "Clear",
"ungrouped": "Ungrouped",
"collapse": "Collapse",
"expand": "Expand",
"settings": {
"header": "Customize",
"hide": "Hide column {title}",