From d0419f2b6f6703b8e629e54e59e56d2011cc3a11 Mon Sep 17 00:00:00 2001 From: Simon Lamon <32477463+silamon@users.noreply.github.com> Date: Sun, 27 Aug 2023 12:01:36 +0000 Subject: [PATCH 1/2] Replace paper-input in cast --- cast/src/launcher/layout/hc-connect.ts | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/cast/src/launcher/layout/hc-connect.ts b/cast/src/launcher/layout/hc-connect.ts index bd1a5f743606..61af7ae1ec00 100644 --- a/cast/src/launcher/layout/hc-connect.ts +++ b/cast/src/launcher/layout/hc-connect.ts @@ -1,6 +1,5 @@ import "@material/mwc-button"; import { mdiCastConnected, mdiCast } from "@mdi/js"; -import "@polymer/paper-input/paper-input"; import { Auth, Connection, @@ -24,6 +23,8 @@ import "../../../../src/components/ha-svg-icon"; import "../../../../src/layouts/hass-loading-screen"; import { registerServiceWorker } from "../../../../src/util/register-service-worker"; import "./hc-layout"; +import "../../../../src/components/ha-textfield"; +import type { HaTextField } from "../../../../src/components/ha-textfield"; const seeFAQ = (qid) => html` See the FAQ for more @@ -116,13 +117,11 @@ export class HcConnect extends LitElement { To get started, enter your Home Assistant URL and click authorize. If you want a preview instead, click the show demo button.

-

- -

+ ${this.error ? html`

${this.error}

` : ""}
@@ -196,7 +195,7 @@ export class HcConnect extends LitElement { } private async _handleConnect() { - const inputEl = this.shadowRoot!.querySelector("paper-input")!; + const inputEl = this.shadowRoot!.querySelector("ha-textfield")!; const value = inputEl.value || ""; this.error = undefined; @@ -315,6 +314,10 @@ export class HcConnect extends LitElement { .spacer { flex: 1; } + + ha-textfield { + width: 100%; + } `; } } From 8954e71422ccf353bcf2c7dbe871979b0545d8aa Mon Sep 17 00:00:00 2001 From: Simon Lamon <32477463+silamon@users.noreply.github.com> Date: Mon, 13 Nov 2023 19:39:09 +0100 Subject: [PATCH 2/2] Remove HaTextField type import --- cast/src/launcher/layout/hc-connect.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/cast/src/launcher/layout/hc-connect.ts b/cast/src/launcher/layout/hc-connect.ts index 61af7ae1ec00..0173f99c3f95 100644 --- a/cast/src/launcher/layout/hc-connect.ts +++ b/cast/src/launcher/layout/hc-connect.ts @@ -24,7 +24,6 @@ import "../../../../src/layouts/hass-loading-screen"; import { registerServiceWorker } from "../../../../src/util/register-service-worker"; import "./hc-layout"; import "../../../../src/components/ha-textfield"; -import type { HaTextField } from "../../../../src/components/ha-textfield"; const seeFAQ = (qid) => html` See the FAQ for more