From a70e2342a2b6f88a99e14bf61c3f900b1da2ce32 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Mon, 3 Oct 2022 13:37:00 +0200 Subject: [PATCH] Add main column to data table (#13966) --- hassio/src/backups/hassio-backups.ts | 1 + src/components/data-table/ha-data-table.ts | 3 ++- src/panels/config/automation/ha-automation-picker.ts | 1 + src/panels/config/backup/ha-config-backup.ts | 1 + src/panels/config/blueprint/ha-blueprint-overview.ts | 1 + src/panels/config/devices/ha-config-devices-dashboard.ts | 1 + src/panels/config/entities/ha-config-entities.ts | 1 + src/panels/config/helpers/ha-config-helpers.ts | 1 + .../lovelace/dashboards/ha-config-lovelace-dashboards.ts | 1 + src/panels/config/scene/ha-scene-dashboard.ts | 1 + src/panels/config/script/ha-script-picker.ts | 1 + src/panels/config/tags/ha-config-tags.ts | 1 + src/panels/config/users/ha-config-users.ts | 1 + 13 files changed, 14 insertions(+), 1 deletion(-) diff --git a/hassio/src/backups/hassio-backups.ts b/hassio/src/backups/hassio-backups.ts index f2b0466623..abd17be598 100644 --- a/hassio/src/backups/hassio-backups.ts +++ b/hassio/src/backups/hassio-backups.ts @@ -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, diff --git a/src/components/data-table/ha-data-table.ts b/src/components/data-table/ha-data-table.ts index a9fa5ba391..8f18a0b77c 100644 --- a/src/components/data-table/ha-data-table.ts +++ b/src/components/data-table/ha-data-table.ts @@ -69,6 +69,7 @@ export interface DataTableSortColumnData { } export interface DataTableColumnData 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`
({ name: { title: this.hass.localize("ui.panel.config.backup.name"), + main: true, sortable: true, filterable: true, grows: true, diff --git a/src/panels/config/blueprint/ha-blueprint-overview.ts b/src/panels/config/blueprint/ha-blueprint-overview.ts index 3a395312af..0ed6081d61 100644 --- a/src/panels/config/blueprint/ha-blueprint-overview.ts +++ b/src/panels/config/blueprint/ha-blueprint-overview.ts @@ -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", diff --git a/src/panels/config/devices/ha-config-devices-dashboard.ts b/src/panels/config/devices/ha-config-devices-dashboard.ts index 078ec02f79..46ba34fe88 100644 --- a/src/panels/config/devices/ha-config-devices-dashboard.ts +++ b/src/panels/config/devices/ha-config-devices-dashboard.ts @@ -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" ), diff --git a/src/panels/config/entities/ha-config-entities.ts b/src/panels/config/entities/ha-config-entities.ts index 8e3448994f..9479740dbb 100644 --- a/src/panels/config/entities/ha-config-entities.ts +++ b/src/panels/config/entities/ha-config-entities.ts @@ -182,6 +182,7 @@ export class HaConfigEntities extends SubscribeMixin(LitElement) { `, }, name: { + main: true, title: this.hass.localize( "ui.panel.config.entities.picker.headers.name" ), diff --git a/src/panels/config/helpers/ha-config-helpers.ts b/src/panels/config/helpers/ha-config-helpers.ts index 2fd9747c86..e77202eb6c 100644 --- a/src/panels/config/helpers/ha-config-helpers.ts +++ b/src/panels/config/helpers/ha-config-helpers.ts @@ -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, diff --git a/src/panels/config/lovelace/dashboards/ha-config-lovelace-dashboards.ts b/src/panels/config/lovelace/dashboards/ha-config-lovelace-dashboards.ts index 55af2f7899..afa5d71126 100644 --- a/src/panels/config/lovelace/dashboards/ha-config-lovelace-dashboards.ts +++ b/src/panels/config/lovelace/dashboards/ha-config-lovelace-dashboards.ts @@ -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, diff --git a/src/panels/config/scene/ha-scene-dashboard.ts b/src/panels/config/scene/ha-scene-dashboard.ts index afebd61588..76e857a7f3 100644 --- a/src/panels/config/scene/ha-scene-dashboard.ts +++ b/src/panels/config/scene/ha-scene-dashboard.ts @@ -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", diff --git a/src/panels/config/script/ha-script-picker.ts b/src/panels/config/script/ha-script-picker.ts index a4f4891ae3..97ef655d18 100644 --- a/src/panels/config/script/ha-script-picker.ts +++ b/src/panels/config/script/ha-script-picker.ts @@ -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", diff --git a/src/panels/config/tags/ha-config-tags.ts b/src/panels/config/tags/ha-config-tags.ts index 87a4b01b18..e566aff75d 100644 --- a/src/panels/config/tags/ha-config-tags.ts +++ b/src/panels/config/tags/ha-config-tags.ts @@ -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, diff --git a/src/panels/config/users/ha-config-users.ts b/src/panels/config/users/ha-config-users.ts index b192716e43..54c949f7d7 100644 --- a/src/panels/config/users/ha-config-users.ts +++ b/src/panels/config/users/ha-config-users.ts @@ -43,6 +43,7 @@ export class HaConfigUsers extends LitElement { const columns: DataTableColumnContainer = { name: { title: localize("ui.panel.config.users.picker.headers.name"), + main: true, sortable: true, filterable: true, width: "25%",