Add initial expose UI (#16138)

Co-authored-by: Paul Bottein <paul.bottein@gmail.com>
This commit is contained in:
Bram Kragten
2023-04-12 18:33:40 +02:00
committed by GitHub
parent a5edb4caaf
commit 442f73b8c5
35 changed files with 2514 additions and 2155 deletions

View File

@@ -73,7 +73,7 @@ export interface DataTableColumnData<T = any> extends DataTableSortColumnData {
main?: boolean;
title: TemplateResult | string;
label?: TemplateResult | string;
type?: "numeric" | "icon" | "icon-button" | "overflow-menu";
type?: "numeric" | "icon" | "icon-button" | "overflow-menu" | "flex";
template?: (data: any, row: T) => TemplateResult | string | typeof nothing;
width?: string;
maxWidth?: string;
@@ -359,10 +359,10 @@ export class HaDataTable extends LitElement {
return nothing;
}
if (row.append) {
return html` <div class="mdc-data-table__row">${row.content}</div> `;
return html`<div class="mdc-data-table__row">${row.content}</div>`;
}
if (row.empty) {
return html` <div class="mdc-data-table__row"></div> `;
return html`<div class="mdc-data-table__row"></div>`;
}
return html`
<div
@@ -406,6 +406,7 @@ export class HaDataTable extends LitElement {
<div
role=${column.main ? "rowheader" : "cell"}
class="mdc-data-table__cell ${classMap({
"mdc-data-table__cell--flex": column.type === "flex",
"mdc-data-table__cell--numeric": column.type === "numeric",
"mdc-data-table__cell--icon": column.type === "icon",
"mdc-data-table__cell--icon-button":
@@ -663,6 +664,10 @@ export class HaDataTable extends LitElement {
box-sizing: border-box;
}
.mdc-data-table__cell.mdc-data-table__cell--flex {
display: flex;
}
.mdc-data-table__cell.mdc-data-table__cell--icon {
overflow: initial;
}