From 2ab4608884c3e3f76bdc5adb67dd63584244ed30 Mon Sep 17 00:00:00 2001 From: Paul Bottein Date: Wed, 9 Jul 2025 09:49:44 +0200 Subject: [PATCH] Delete dashboard dialog --- .../lovelace/dialogs/hui-dialog-dashboard.ts | 85 ------------------- .../lovelace/dialogs/show-dashboard-dialog.ts | 19 ----- 2 files changed, 104 deletions(-) delete mode 100644 src/panels/lovelace/dialogs/hui-dialog-dashboard.ts delete mode 100644 src/panels/lovelace/dialogs/show-dashboard-dialog.ts diff --git a/src/panels/lovelace/dialogs/hui-dialog-dashboard.ts b/src/panels/lovelace/dialogs/hui-dialog-dashboard.ts deleted file mode 100644 index 5ae972946a..0000000000 --- a/src/panels/lovelace/dialogs/hui-dialog-dashboard.ts +++ /dev/null @@ -1,85 +0,0 @@ -import { mdiClose } from "@mdi/js"; -import { css, html, LitElement, nothing } from "lit"; -import { customElement, property, state } from "lit/decorators"; -import { repeat } from "lit/directives/repeat"; -import { fireEvent } from "../../../common/dom/fire_event"; -import "../../../components/ha-dialog"; -import "../../../components/ha-dialog-header"; -import "../../../components/ha-header-bar"; -import { haStyleDialog } from "../../../resources/styles"; -import type { HomeAssistant } from "../../../types"; -import "../sections/hui-section"; -import type { DashboardDialogParams } from "./show-dashboard-dialog"; -import type { LovelaceSectionConfig } from "../../../data/lovelace/config/section"; - -@customElement("hui-dialog-dashboard") -class HuiDashboardDialog extends LitElement { - @property({ attribute: false }) public hass!: HomeAssistant; - - @state() private _params?: DashboardDialogParams; - - public async showDialog(params: DashboardDialogParams): Promise { - this._params = params; - } - - public async closeDialog(): Promise { - this._params = undefined; - fireEvent(this, "dialog-closed", { dialog: this.localName }); - } - - protected render() { - if (!this._params) { - return nothing; - } - - return html` - - - - ${this._params.title} - ${this._params.subtitle - ? html`${this._params.subtitle}` - : nothing} - -
- ${repeat( - this._params.sections, - (section) => section, - (section: LovelaceSectionConfig) => html` - - ` - )} -
-
- `; - } - - static styles = [ - haStyleDialog, - css` - ha-dialog { - --dialog-content-padding: 0; - } - .content { - padding: 0 16px 16px 16px; - } - `, - ]; -} - -declare global { - interface HTMLElementTagNameMap { - "hui-dialog-dashboard": HuiDashboardDialog; - } -} diff --git a/src/panels/lovelace/dialogs/show-dashboard-dialog.ts b/src/panels/lovelace/dialogs/show-dashboard-dialog.ts deleted file mode 100644 index d18d3a9e84..0000000000 --- a/src/panels/lovelace/dialogs/show-dashboard-dialog.ts +++ /dev/null @@ -1,19 +0,0 @@ -import { fireEvent } from "../../../common/dom/fire_event"; -import type { LovelaceSectionConfig } from "../../../data/lovelace/config/section"; - -export interface DashboardDialogParams { - sections: LovelaceSectionConfig[]; - title: string; - subtitle?: string; -} - -export const showDashboardDialog = ( - element: HTMLElement, - dialogParams: DashboardDialogParams -) => { - fireEvent(element, "show-dialog", { - dialogTag: "hui-dialog-dashboard", - dialogImport: () => import("./hui-dialog-dashboard"), - dialogParams: dialogParams, - }); -};