Add main column to data table (#13966)

This commit is contained in:
Bram Kragten 2022-10-03 13:37:00 +02:00 committed by GitHub
parent b5c9aae1aa
commit a70e2342a2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 14 additions and 1 deletions

View File

@ -119,6 +119,7 @@ export class HassioBackups extends LitElement {
(narrow: boolean): DataTableColumnContainer => ({
name: {
title: this.supervisor.localize("backup.name"),
main: true,
sortable: true,
filterable: true,
grows: true,

View File

@ -69,6 +69,7 @@ export interface DataTableSortColumnData {
}
export interface DataTableColumnData<T = any> extends DataTableSortColumnData {
main?: boolean;
title: TemplateResult | string;
label?: TemplateResult | string;
type?: "numeric" | "icon" | "icon-button" | "overflow-menu";
@ -406,7 +407,7 @@ export class HaDataTable extends LitElement {
}
return html`
<div
role="cell"
role=${column.main ? "rowheader" : "cell"}
class="mdc-data-table__cell ${classMap({
"mdc-data-table__cell--numeric": column.type === "numeric",
"mdc-data-table__cell--icon": column.type === "icon",

View File

@ -100,6 +100,7 @@ class HaAutomationPicker extends LitElement {
title: this.hass.localize(
"ui.panel.config.automation.picker.headers.name"
),
main: true,
sortable: true,
filterable: true,
direction: "asc",

View File

@ -51,6 +51,7 @@ class HaConfigBackup extends LitElement {
(narrow, _language): DataTableColumnContainer => ({
name: {
title: this.hass.localize("ui.panel.config.backup.name"),
main: true,
sortable: true,
filterable: true,
grows: true,

View File

@ -109,6 +109,7 @@ class HaBlueprintOverview extends LitElement {
title: this.hass.localize(
"ui.panel.config.blueprint.overview.headers.name"
),
main: true,
sortable: true,
filterable: true,
direction: "asc",

View File

@ -238,6 +238,7 @@ export class HaConfigDeviceDashboard extends LitElement {
const columns: DataTableColumnContainer = narrow
? {
name: {
main: true,
title: this.hass.localize(
"ui.panel.config.devices.data_table.device"
),

View File

@ -182,6 +182,7 @@ export class HaConfigEntities extends SubscribeMixin(LitElement) {
`,
},
name: {
main: true,
title: this.hass.localize(
"ui.panel.config.entities.picker.headers.name"
),

View File

@ -91,6 +91,7 @@ export class HaConfigHelpers extends SubscribeMixin(LitElement) {
},
name: {
title: localize("ui.panel.config.helpers.picker.headers.name"),
main: true,
sortable: true,
filterable: true,
grows: true,

View File

@ -78,6 +78,7 @@ export class HaConfigLovelaceDashboards extends LitElement {
title: this.hass.localize(
"ui.panel.config.lovelace.dashboards.picker.headers.title"
),
main: true,
sortable: true,
filterable: true,
grows: true,

View File

@ -95,6 +95,7 @@ class HaSceneDashboard extends LitElement {
title: this.hass.localize(
"ui.panel.config.scene.picker.headers.name"
),
main: true,
sortable: true,
filterable: true,
direction: "asc",

View File

@ -93,6 +93,7 @@ class HaScriptPicker extends LitElement {
},
name: {
title: this.hass.localize("ui.panel.config.script.picker.headers.name"),
main: true,
sortable: true,
filterable: true,
direction: "asc",

View File

@ -66,6 +66,7 @@ export class HaConfigTags extends SubscribeMixin(LitElement) {
},
display_name: {
title: this.hass.localize("ui.panel.config.tag.headers.name"),
main: true,
sortable: true,
filterable: true,
grows: true,

View File

@ -43,6 +43,7 @@ export class HaConfigUsers extends LitElement {
const columns: DataTableColumnContainer<User> = {
name: {
title: localize("ui.panel.config.users.picker.headers.name"),
main: true,
sortable: true,
filterable: true,
width: "25%",