From 1519e1b90ca51c3ef4a9baf7f55b79eb1ccd723b Mon Sep 17 00:00:00 2001 From: ildar170975 <71872483+ildar170975@users.noreply.github.com> Date: Tue, 25 Mar 2025 17:51:54 +0300 Subject: [PATCH] ha-dialog-import-blueprint: add "enlarge" (#24734) * add enlarge * removed unused "createCloseHeading" * restore deleted "import" line * import ha-dialog-header --- .../blueprint/dialog-import-blueprint.ts | 35 +++++++++++++------ 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/src/panels/config/blueprint/dialog-import-blueprint.ts b/src/panels/config/blueprint/dialog-import-blueprint.ts index b8c306c869..dcf38ce41c 100644 --- a/src/panels/config/blueprint/dialog-import-blueprint.ts +++ b/src/panels/config/blueprint/dialog-import-blueprint.ts @@ -1,14 +1,15 @@ import "@material/mwc-button"; -import { mdiOpenInNew } from "@mdi/js"; +import { mdiOpenInNew, mdiClose } from "@mdi/js"; import { css, html, LitElement, nothing } from "lit"; import { customElement, property, query, state } from "lit/decorators"; import { fireEvent } from "../../../common/dom/fire_event"; import "../../../components/ha-spinner"; -import { createCloseHeading } from "../../../components/ha-dialog"; import "../../../components/ha-expansion-panel"; import "../../../components/ha-markdown"; import "../../../components/ha-alert"; import "../../../components/ha-textfield"; +import "../../../components/ha-dialog"; +import "../../../components/ha-dialog-header"; import type { HaTextField } from "../../../components/ha-textfield"; import type { BlueprintImportResult } from "../../../data/blueprint"; import { importBlueprint, saveBlueprint } from "../../../data/blueprint"; @@ -19,6 +20,8 @@ import type { HomeAssistant } from "../../../types"; class DialogImportBlueprint extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; + @property({ type: Boolean, reflect: true }) public large = false; + @state() private _params?; @state() private _importing = false; @@ -37,6 +40,7 @@ class DialogImportBlueprint extends LitElement { this._params = params; this._error = undefined; this._url = this._params.url; + this.large = false; } public closeDialog(): void { @@ -51,15 +55,18 @@ class DialogImportBlueprint extends LitElement { if (!this._params) { return nothing; } + const heading = this.hass.localize("ui.panel.config.blueprint.add.header"); return html` - + + + + ${heading} +
${this._error ? html`
${this._error}
` : ""} ${this._result @@ -198,6 +205,10 @@ class DialogImportBlueprint extends LitElement { `; } + private _enlarge() { + this.large = !this.large; + } + private async _import() { this._url = undefined; this._importing = true; @@ -259,6 +270,10 @@ class DialogImportBlueprint extends LitElement { a ha-svg-icon { --mdc-icon-size: 16px; } + :host([large]) ha-dialog { + --mdc-dialog-min-width: 90vw; + --mdc-dialog-max-width: 90vw; + } `, ]; }