mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Add main column to data table (#13966)
This commit is contained in:
parent
b5c9aae1aa
commit
a70e2342a2
@ -119,6 +119,7 @@ export class HassioBackups extends LitElement {
|
|||||||
(narrow: boolean): DataTableColumnContainer => ({
|
(narrow: boolean): DataTableColumnContainer => ({
|
||||||
name: {
|
name: {
|
||||||
title: this.supervisor.localize("backup.name"),
|
title: this.supervisor.localize("backup.name"),
|
||||||
|
main: true,
|
||||||
sortable: true,
|
sortable: true,
|
||||||
filterable: true,
|
filterable: true,
|
||||||
grows: true,
|
grows: true,
|
||||||
|
@ -69,6 +69,7 @@ export interface DataTableSortColumnData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface DataTableColumnData<T = any> extends DataTableSortColumnData {
|
export interface DataTableColumnData<T = any> extends DataTableSortColumnData {
|
||||||
|
main?: boolean;
|
||||||
title: TemplateResult | string;
|
title: TemplateResult | string;
|
||||||
label?: TemplateResult | string;
|
label?: TemplateResult | string;
|
||||||
type?: "numeric" | "icon" | "icon-button" | "overflow-menu";
|
type?: "numeric" | "icon" | "icon-button" | "overflow-menu";
|
||||||
@ -406,7 +407,7 @@ export class HaDataTable extends LitElement {
|
|||||||
}
|
}
|
||||||
return html`
|
return html`
|
||||||
<div
|
<div
|
||||||
role="cell"
|
role=${column.main ? "rowheader" : "cell"}
|
||||||
class="mdc-data-table__cell ${classMap({
|
class="mdc-data-table__cell ${classMap({
|
||||||
"mdc-data-table__cell--numeric": column.type === "numeric",
|
"mdc-data-table__cell--numeric": column.type === "numeric",
|
||||||
"mdc-data-table__cell--icon": column.type === "icon",
|
"mdc-data-table__cell--icon": column.type === "icon",
|
||||||
|
@ -100,6 +100,7 @@ class HaAutomationPicker extends LitElement {
|
|||||||
title: this.hass.localize(
|
title: this.hass.localize(
|
||||||
"ui.panel.config.automation.picker.headers.name"
|
"ui.panel.config.automation.picker.headers.name"
|
||||||
),
|
),
|
||||||
|
main: true,
|
||||||
sortable: true,
|
sortable: true,
|
||||||
filterable: true,
|
filterable: true,
|
||||||
direction: "asc",
|
direction: "asc",
|
||||||
|
@ -51,6 +51,7 @@ class HaConfigBackup extends LitElement {
|
|||||||
(narrow, _language): DataTableColumnContainer => ({
|
(narrow, _language): DataTableColumnContainer => ({
|
||||||
name: {
|
name: {
|
||||||
title: this.hass.localize("ui.panel.config.backup.name"),
|
title: this.hass.localize("ui.panel.config.backup.name"),
|
||||||
|
main: true,
|
||||||
sortable: true,
|
sortable: true,
|
||||||
filterable: true,
|
filterable: true,
|
||||||
grows: true,
|
grows: true,
|
||||||
|
@ -109,6 +109,7 @@ class HaBlueprintOverview extends LitElement {
|
|||||||
title: this.hass.localize(
|
title: this.hass.localize(
|
||||||
"ui.panel.config.blueprint.overview.headers.name"
|
"ui.panel.config.blueprint.overview.headers.name"
|
||||||
),
|
),
|
||||||
|
main: true,
|
||||||
sortable: true,
|
sortable: true,
|
||||||
filterable: true,
|
filterable: true,
|
||||||
direction: "asc",
|
direction: "asc",
|
||||||
|
@ -238,6 +238,7 @@ export class HaConfigDeviceDashboard extends LitElement {
|
|||||||
const columns: DataTableColumnContainer = narrow
|
const columns: DataTableColumnContainer = narrow
|
||||||
? {
|
? {
|
||||||
name: {
|
name: {
|
||||||
|
main: true,
|
||||||
title: this.hass.localize(
|
title: this.hass.localize(
|
||||||
"ui.panel.config.devices.data_table.device"
|
"ui.panel.config.devices.data_table.device"
|
||||||
),
|
),
|
||||||
|
@ -182,6 +182,7 @@ export class HaConfigEntities extends SubscribeMixin(LitElement) {
|
|||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
name: {
|
name: {
|
||||||
|
main: true,
|
||||||
title: this.hass.localize(
|
title: this.hass.localize(
|
||||||
"ui.panel.config.entities.picker.headers.name"
|
"ui.panel.config.entities.picker.headers.name"
|
||||||
),
|
),
|
||||||
|
@ -91,6 +91,7 @@ export class HaConfigHelpers extends SubscribeMixin(LitElement) {
|
|||||||
},
|
},
|
||||||
name: {
|
name: {
|
||||||
title: localize("ui.panel.config.helpers.picker.headers.name"),
|
title: localize("ui.panel.config.helpers.picker.headers.name"),
|
||||||
|
main: true,
|
||||||
sortable: true,
|
sortable: true,
|
||||||
filterable: true,
|
filterable: true,
|
||||||
grows: true,
|
grows: true,
|
||||||
|
@ -78,6 +78,7 @@ export class HaConfigLovelaceDashboards extends LitElement {
|
|||||||
title: this.hass.localize(
|
title: this.hass.localize(
|
||||||
"ui.panel.config.lovelace.dashboards.picker.headers.title"
|
"ui.panel.config.lovelace.dashboards.picker.headers.title"
|
||||||
),
|
),
|
||||||
|
main: true,
|
||||||
sortable: true,
|
sortable: true,
|
||||||
filterable: true,
|
filterable: true,
|
||||||
grows: true,
|
grows: true,
|
||||||
|
@ -95,6 +95,7 @@ class HaSceneDashboard extends LitElement {
|
|||||||
title: this.hass.localize(
|
title: this.hass.localize(
|
||||||
"ui.panel.config.scene.picker.headers.name"
|
"ui.panel.config.scene.picker.headers.name"
|
||||||
),
|
),
|
||||||
|
main: true,
|
||||||
sortable: true,
|
sortable: true,
|
||||||
filterable: true,
|
filterable: true,
|
||||||
direction: "asc",
|
direction: "asc",
|
||||||
|
@ -93,6 +93,7 @@ class HaScriptPicker extends LitElement {
|
|||||||
},
|
},
|
||||||
name: {
|
name: {
|
||||||
title: this.hass.localize("ui.panel.config.script.picker.headers.name"),
|
title: this.hass.localize("ui.panel.config.script.picker.headers.name"),
|
||||||
|
main: true,
|
||||||
sortable: true,
|
sortable: true,
|
||||||
filterable: true,
|
filterable: true,
|
||||||
direction: "asc",
|
direction: "asc",
|
||||||
|
@ -66,6 +66,7 @@ export class HaConfigTags extends SubscribeMixin(LitElement) {
|
|||||||
},
|
},
|
||||||
display_name: {
|
display_name: {
|
||||||
title: this.hass.localize("ui.panel.config.tag.headers.name"),
|
title: this.hass.localize("ui.panel.config.tag.headers.name"),
|
||||||
|
main: true,
|
||||||
sortable: true,
|
sortable: true,
|
||||||
filterable: true,
|
filterable: true,
|
||||||
grows: true,
|
grows: true,
|
||||||
|
@ -43,6 +43,7 @@ export class HaConfigUsers extends LitElement {
|
|||||||
const columns: DataTableColumnContainer<User> = {
|
const columns: DataTableColumnContainer<User> = {
|
||||||
name: {
|
name: {
|
||||||
title: localize("ui.panel.config.users.picker.headers.name"),
|
title: localize("ui.panel.config.users.picker.headers.name"),
|
||||||
|
main: true,
|
||||||
sortable: true,
|
sortable: true,
|
||||||
filterable: true,
|
filterable: true,
|
||||||
width: "25%",
|
width: "25%",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user