Replace checkboxes in list items with check-list-item (#11610)

Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
This commit is contained in:
Bram Kragten 2022-02-09 16:50:48 +01:00 committed by GitHub
parent 9eea17b793
commit 4ef5f3af89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
23 changed files with 330 additions and 283 deletions

View File

@ -0,0 +1,22 @@
import { css } from "lit";
import { CheckListItemBase } from "@material/mwc-list/mwc-check-list-item-base";
import { styles } from "@material/mwc-list/mwc-control-list-item.css";
import { customElement } from "lit/decorators";
@customElement("ha-check-list-item")
export class HaCheckListItem extends CheckListItemBase {
static override styles = [
styles,
css`
:host {
--mdc-theme-secondary: var(--primary-color);
}
`,
];
}
declare global {
interface HTMLElementTagNameMap {
"ha-check-list-item": HaCheckListItem;
}
}

View File

@ -1,12 +1,18 @@
import { Checkbox } from "@material/mwc-checkbox"; import { CheckboxBase } from "@material/mwc-checkbox/mwc-checkbox-base";
import { styles } from "@material/mwc-checkbox/mwc-checkbox.css";
import { css } from "lit";
import { customElement } from "lit/decorators"; import { customElement } from "lit/decorators";
@customElement("ha-checkbox") @customElement("ha-checkbox")
export class HaCheckbox extends Checkbox { export class HaCheckbox extends CheckboxBase {
public firstUpdated() { static override styles = [
super.firstUpdated(); styles,
this.style.setProperty("--mdc-theme-secondary", "var(--primary-color)"); css`
:host {
--mdc-theme-secondary: var(--primary-color);
} }
`,
];
} }
declare global { declare global {

View File

@ -1,6 +1,7 @@
import { Dialog } from "@material/mwc-dialog"; import { DialogBase } from "@material/mwc-dialog/mwc-dialog-base";
import { styles } from "@material/mwc-dialog/mwc-dialog.css";
import { mdiClose } from "@mdi/js"; import { mdiClose } from "@mdi/js";
import { css, CSSResultGroup, html, TemplateResult } from "lit"; import { css, html, TemplateResult } from "lit";
import { customElement } from "lit/decorators"; import { customElement } from "lit/decorators";
import { computeRTLDirection } from "../common/util/compute_rtl"; import { computeRTLDirection } from "../common/util/compute_rtl";
import type { HomeAssistant } from "../types"; import type { HomeAssistant } from "../types";
@ -21,8 +22,7 @@ export const createCloseHeading = (
`; `;
@customElement("ha-dialog") @customElement("ha-dialog")
// @ts-expect-error export class HaDialog extends DialogBase {
export class HaDialog extends Dialog {
public scrollToPos(x: number, y: number) { public scrollToPos(x: number, y: number) {
this.contentElement?.scrollTo(x, y); this.contentElement?.scrollTo(x, y);
} }
@ -31,9 +31,8 @@ export class HaDialog extends Dialog {
return html`<slot name="heading"> ${super.renderHeading()} </slot>`; return html`<slot name="heading"> ${super.renderHeading()} </slot>`;
} }
protected static get styles(): CSSResultGroup { static override styles = [
return [ styles,
Dialog.styles,
css` css`
.mdc-dialog { .mdc-dialog {
--mdc-dialog-scroll-divider-color: var(--divider-color); --mdc-dialog-scroll-divider-color: var(--divider-color);
@ -102,7 +101,6 @@ export class HaDialog extends Dialog {
`, `,
]; ];
} }
}
declare global { declare global {
interface HTMLElementTagNameMap { interface HTMLElementTagNameMap {

View File

@ -1,21 +1,21 @@
import "@material/mwc-textfield";
import type { TextField } from "@material/mwc-textfield";
import { css, html, LitElement, TemplateResult, PropertyValues } from "lit"; import { css, html, LitElement, TemplateResult, PropertyValues } from "lit";
import { customElement, property, query } from "lit/decorators"; import { customElement, property, query } from "lit/decorators";
import { fireEvent } from "../../common/dom/fire_event"; import { fireEvent } from "../../common/dom/fire_event";
import type { HaTextField } from "../ha-textfield";
import "../ha-textfield";
import { HaFormElement, HaFormFloatData, HaFormFloatSchema } from "./types"; import { HaFormElement, HaFormFloatData, HaFormFloatSchema } from "./types";
@customElement("ha-form-float") @customElement("ha-form-float")
export class HaFormFloat extends LitElement implements HaFormElement { export class HaFormFloat extends LitElement implements HaFormElement {
@property() public schema!: HaFormFloatSchema; @property({ attribute: false }) public schema!: HaFormFloatSchema;
@property() public data!: HaFormFloatData; @property({ attribute: false }) public data!: HaFormFloatData;
@property() public label!: string; @property() public label!: string;
@property({ type: Boolean }) public disabled = false; @property({ type: Boolean }) public disabled = false;
@query("mwc-textfield") private _input?: HTMLElement; @query("ha-textfield") private _input?: HaTextField;
public focus() { public focus() {
if (this._input) { if (this._input) {
@ -25,7 +25,7 @@ export class HaFormFloat extends LitElement implements HaFormElement {
protected render(): TemplateResult { protected render(): TemplateResult {
return html` return html`
<mwc-textfield <ha-textfield
inputMode="decimal" inputMode="decimal"
.label=${this.label} .label=${this.label}
.value=${this.data !== undefined ? this.data : ""} .value=${this.data !== undefined ? this.data : ""}
@ -35,7 +35,7 @@ export class HaFormFloat extends LitElement implements HaFormElement {
.suffix=${this.schema.description?.suffix} .suffix=${this.schema.description?.suffix}
.validationMessage=${this.schema.required ? "Required" : undefined} .validationMessage=${this.schema.required ? "Required" : undefined}
@input=${this._valueChanged} @input=${this._valueChanged}
></mwc-textfield> ></ha-textfield>
`; `;
} }
@ -46,7 +46,7 @@ export class HaFormFloat extends LitElement implements HaFormElement {
} }
private _valueChanged(ev: Event) { private _valueChanged(ev: Event) {
const source = ev.target as TextField; const source = ev.target as HaTextField;
const rawValue = source.value.replace(",", "."); const rawValue = source.value.replace(",", ".");
let value: number | undefined; let value: number | undefined;
@ -81,7 +81,7 @@ export class HaFormFloat extends LitElement implements HaFormElement {
:host([own-margin]) { :host([own-margin]) {
margin-bottom: 5px; margin-bottom: 5px;
} }
mwc-textfield { ha-textfield {
display: block; display: block;
} }
`; `;

View File

@ -1,6 +1,3 @@
import "@material/mwc-textfield";
import type { TextField } from "@material/mwc-textfield";
import type { Slider } from "@material/mwc-slider";
import { import {
css, css,
CSSResultGroup, CSSResultGroup,
@ -14,18 +11,21 @@ import { fireEvent } from "../../common/dom/fire_event";
import { HaCheckbox } from "../ha-checkbox"; import { HaCheckbox } from "../ha-checkbox";
import { HaFormElement, HaFormIntegerData, HaFormIntegerSchema } from "./types"; import { HaFormElement, HaFormIntegerData, HaFormIntegerSchema } from "./types";
import "../ha-slider"; import "../ha-slider";
import { HaTextField } from "../ha-textfield";
@customElement("ha-form-integer") @customElement("ha-form-integer")
export class HaFormInteger extends LitElement implements HaFormElement { export class HaFormInteger extends LitElement implements HaFormElement {
@property() public schema!: HaFormIntegerSchema; @property({ attribute: false }) public schema!: HaFormIntegerSchema;
@property() public data?: HaFormIntegerData; @property({ attribute: false }) public data?: HaFormIntegerData;
@property() public label?: string; @property() public label?: string;
@property({ type: Boolean }) public disabled = false; @property({ type: Boolean }) public disabled = false;
@query("mwc-textfield ha-slider") private _input?: HTMLElement; @query("ha-textfield ha-slider") private _input?:
| HaTextField
| HTMLInputElement;
private _lastValue?: HaFormIntegerData; private _lastValue?: HaFormIntegerData;
@ -70,7 +70,7 @@ export class HaFormInteger extends LitElement implements HaFormElement {
} }
return html` return html`
<mwc-textfield <ha-textfield
type="number" type="number"
inputMode="numeric" inputMode="numeric"
.label=${this.label} .label=${this.label}
@ -81,7 +81,7 @@ export class HaFormInteger extends LitElement implements HaFormElement {
.suffix=${this.schema.description?.suffix} .suffix=${this.schema.description?.suffix}
.validationMessage=${this.schema.required ? "Required" : undefined} .validationMessage=${this.schema.required ? "Required" : undefined}
@input=${this._valueChanged} @input=${this._valueChanged}
></mwc-textfield> ></ha-textfield>
`; `;
} }
@ -138,7 +138,7 @@ export class HaFormInteger extends LitElement implements HaFormElement {
} }
private _valueChanged(ev: Event) { private _valueChanged(ev: Event) {
const source = ev.target as TextField | Slider; const source = ev.target as HaTextField | HTMLInputElement;
const rawValue = source.value; const rawValue = source.value;
let value: number | undefined; let value: number | undefined;
@ -172,7 +172,7 @@ export class HaFormInteger extends LitElement implements HaFormElement {
ha-slider { ha-slider {
flex: 1; flex: 1;
} }
mwc-textfield { ha-textfield {
display: block; display: block;
} }
`; `;

View File

@ -1,25 +1,27 @@
import "@material/mwc-select/mwc-select";
import { mdiMenuDown, mdiMenuUp } from "@mdi/js"; import { mdiMenuDown, mdiMenuUp } from "@mdi/js";
import "@material/mwc-textfield";
import "@material/mwc-formfield";
import { import {
css, css,
CSSResultGroup, CSSResultGroup,
html, html,
LitElement, LitElement,
TemplateResult,
PropertyValues, PropertyValues,
TemplateResult,
} from "lit"; } from "lit";
import { customElement, property, query, state } from "lit/decorators"; import { customElement, property, query, state } from "lit/decorators";
import { fireEvent } from "../../common/dom/fire_event"; import { fireEvent } from "../../common/dom/fire_event";
import "../ha-button-menu"; import "../ha-button-menu";
import { HaCheckListItem } from "../ha-check-list-item";
import "../ha-checkbox";
import type { HaCheckbox } from "../ha-checkbox";
import "../ha-formfield";
import "../ha-svg-icon"; import "../ha-svg-icon";
import "../ha-textfield";
import { import {
HaFormElement, HaFormElement,
HaFormMultiSelectData, HaFormMultiSelectData,
HaFormMultiSelectSchema, HaFormMultiSelectSchema,
} from "./types"; } from "./types";
import "../ha-checkbox";
import type { HaCheckbox } from "../ha-checkbox";
function optionValue(item: string | string[]): string { function optionValue(item: string | string[]): string {
return Array.isArray(item) ? item[0] : item; return Array.isArray(item) ? item[0] : item;
@ -57,23 +59,23 @@ export class HaFormMultiSelect extends LitElement implements HaFormElement {
: Object.entries(this.schema.options); : Object.entries(this.schema.options);
const data = this.data || []; const data = this.data || [];
const renderedOptions = options.map((item: string | [string, string]) => { // We will just render all checkboxes.
if (options.length < SHOW_ALL_ENTRIES_LIMIT) {
return html`<div>
${this.label}${options.map((item: string | [string, string]) => {
const value = optionValue(item); const value = optionValue(item);
return html` return html`
<mwc-formfield .label=${optionLabel(item)}> <ha-formfield .label=${optionLabel(item)}>
<ha-checkbox <ha-checkbox
.checked=${data.includes(value)} .checked=${data.includes(value)}
.value=${value} .value=${value}
.disabled=${this.disabled} .disabled=${this.disabled}
@change=${this._valueChanged} @change=${this._valueChanged}
></ha-checkbox> ></ha-checkbox>
</mwc-formfield> </ha-formfield>
`; `;
}); })}
</div> `;
// We will just render all checkboxes.
if (options.length < SHOW_ALL_ENTRIES_LIMIT) {
return html`<div>${this.label}${renderedOptions}</div> `;
} }
return html` return html`
@ -83,8 +85,10 @@ export class HaFormMultiSelect extends LitElement implements HaFormElement {
corner="BOTTOM_START" corner="BOTTOM_START"
@opened=${this._handleOpen} @opened=${this._handleOpen}
@closed=${this._handleClose} @closed=${this._handleClose}
multi
activatable
> >
<mwc-textfield <ha-textfield
slot="trigger" slot="trigger"
.label=${this.label} .label=${this.label}
.value=${data .value=${data
@ -92,12 +96,25 @@ export class HaFormMultiSelect extends LitElement implements HaFormElement {
.join(", ")} .join(", ")}
.disabled=${this.disabled} .disabled=${this.disabled}
tabindex="-1" tabindex="-1"
></mwc-textfield> ></ha-textfield>
<ha-svg-icon <ha-svg-icon
slot="trigger" slot="trigger"
.path=${this._opened ? mdiMenuUp : mdiMenuDown} .path=${this._opened ? mdiMenuUp : mdiMenuDown}
></ha-svg-icon> ></ha-svg-icon>
${renderedOptions} ${options.map((item: string | [string, string]) => {
const value = optionValue(item);
const selected = data.includes(value);
return html`<ha-check-list-item
left
.selected=${selected}
.activated=${selected}
@request-selected=${this._selectedChanged}
.value=${value}
.disabled=${this.disabled}
>
${optionLabel(item)}
</ha-check-list-item>`;
})}
</ha-button-menu> </ha-button-menu>
`; `;
} }
@ -105,7 +122,7 @@ export class HaFormMultiSelect extends LitElement implements HaFormElement {
protected firstUpdated() { protected firstUpdated() {
this.updateComplete.then(() => { this.updateComplete.then(() => {
const { formElement, mdcRoot } = const { formElement, mdcRoot } =
this.shadowRoot?.querySelector("mwc-textfield") || ({} as any); this.shadowRoot?.querySelector("ha-textfield") || ({} as any);
if (formElement) { if (formElement) {
formElement.style.textOverflow = "ellipsis"; formElement.style.textOverflow = "ellipsis";
} }
@ -125,9 +142,23 @@ export class HaFormMultiSelect extends LitElement implements HaFormElement {
} }
} }
private _selectedChanged(ev: CustomEvent): void {
ev.stopPropagation();
if (ev.detail.source === "property") {
return;
}
this._handleValueChanged(
(ev.target as HaCheckListItem).value,
ev.detail.selected
);
}
private _valueChanged(ev: CustomEvent): void { private _valueChanged(ev: CustomEvent): void {
const { value, checked } = ev.target as HaCheckbox; const { value, checked } = ev.target as HaCheckbox;
this._handleValueChanged(value, checked);
}
private _handleValueChanged(value, checked: boolean): void {
let newValue: string[]; let newValue: string[];
if (checked) { if (checked) {
@ -171,11 +202,11 @@ export class HaFormMultiSelect extends LitElement implements HaFormElement {
display: block; display: block;
cursor: pointer; cursor: pointer;
} }
mwc-formfield { ha-formfield {
display: block; display: block;
padding-right: 16px; padding-right: 16px;
} }
mwc-textfield { ha-textfield {
display: block; display: block;
pointer-events: none; pointer-events: none;
} }

View File

@ -1,17 +1,17 @@
import { mdiEye, mdiEyeOff } from "@mdi/js"; import { mdiEye, mdiEyeOff } from "@mdi/js";
import "@material/mwc-textfield";
import type { TextField } from "@material/mwc-textfield";
import { import {
css, css,
CSSResultGroup, CSSResultGroup,
html, html,
LitElement, LitElement,
TemplateResult,
PropertyValues, PropertyValues,
TemplateResult,
} from "lit"; } from "lit";
import { customElement, property, state, query } from "lit/decorators"; import { customElement, property, query, state } from "lit/decorators";
import { fireEvent } from "../../common/dom/fire_event"; import { fireEvent } from "../../common/dom/fire_event";
import "../ha-icon-button"; import "../ha-icon-button";
import "../ha-textfield";
import type { HaTextField } from "../ha-textfield";
import type { import type {
HaFormElement, HaFormElement,
HaFormStringData, HaFormStringData,
@ -32,7 +32,7 @@ export class HaFormString extends LitElement implements HaFormElement {
@state() private _unmaskedPassword = false; @state() private _unmaskedPassword = false;
@query("mwc-textfield") private _input?: HTMLElement; @query("ha-textfield") private _input?: HaTextField;
public focus(): void { public focus(): void {
if (this._input) { if (this._input) {
@ -45,7 +45,7 @@ export class HaFormString extends LitElement implements HaFormElement {
this.schema.name.includes(field) this.schema.name.includes(field)
); );
return html` return html`
<mwc-textfield <ha-textfield
.type=${!isPassword .type=${!isPassword
? this._stringType ? this._stringType
: this._unmaskedPassword : this._unmaskedPassword
@ -62,7 +62,7 @@ export class HaFormString extends LitElement implements HaFormElement {
: this.schema.description?.suffix} : this.schema.description?.suffix}
.validationMessage=${this.schema.required ? "Required" : undefined} .validationMessage=${this.schema.required ? "Required" : undefined}
@input=${this._valueChanged} @input=${this._valueChanged}
></mwc-textfield> ></ha-textfield>
${isPassword ${isPassword
? html`<ha-icon-button ? html`<ha-icon-button
toggles toggles
@ -85,7 +85,7 @@ export class HaFormString extends LitElement implements HaFormElement {
} }
private _valueChanged(ev: Event): void { private _valueChanged(ev: Event): void {
let value: string | undefined = (ev.target as TextField).value; let value: string | undefined = (ev.target as HaTextField).value;
if (this.data === value) { if (this.data === value) {
return; return;
} }
@ -118,7 +118,7 @@ export class HaFormString extends LitElement implements HaFormElement {
:host([own-margin]) { :host([own-margin]) {
margin-bottom: 5px; margin-bottom: 5px;
} }
mwc-textfield { ha-textfield {
display: block; display: block;
} }
ha-icon-button { ha-icon-button {

View File

@ -1,11 +1,11 @@
import { Formfield } from "@material/mwc-formfield"; import { FormfieldBase } from "@material/mwc-formfield/mwc-formfield-base";
import { css, CSSResultGroup } from "lit"; import { styles } from "@material/mwc-formfield/mwc-formfield.css";
import { css } from "lit";
import { customElement } from "lit/decorators"; import { customElement } from "lit/decorators";
import { fireEvent } from "../common/dom/fire_event"; import { fireEvent } from "../common/dom/fire_event";
@customElement("ha-formfield") @customElement("ha-formfield")
// @ts-expect-error export class HaFormfield extends FormfieldBase {
export class HaFormfield extends Formfield {
protected _labelClick() { protected _labelClick() {
const input = this.input; const input = this.input;
if (input) { if (input) {
@ -23,9 +23,8 @@ export class HaFormfield extends Formfield {
} }
} }
protected static get styles(): CSSResultGroup { static override styles = [
return [ styles,
Formfield.styles,
css` css`
:host(:not([alignEnd])) ::slotted(ha-switch) { :host(:not([alignEnd])) ::slotted(ha-switch) {
margin-right: 10px; margin-right: 10px;
@ -37,7 +36,6 @@ export class HaFormfield extends Formfield {
`, `,
]; ];
} }
}
declare global { declare global {
interface HTMLElementTagNameMap { interface HTMLElementTagNameMap {

View File

@ -1,7 +1,6 @@
import "@material/mwc-button/mwc-button";
import "@material/mwc-list/mwc-list-item"; import "@material/mwc-list/mwc-list-item";
import "@material/mwc-select/mwc-select"; import "@material/mwc-select/mwc-select";
import "@material/mwc-textfield/mwc-textfield";
import type { TextField } from "@material/mwc-textfield/mwc-textfield";
import { mdiCamera } from "@mdi/js"; import { mdiCamera } from "@mdi/js";
import { css, html, LitElement, PropertyValues, TemplateResult } from "lit"; import { css, html, LitElement, PropertyValues, TemplateResult } from "lit";
import { customElement, property, query, state } from "lit/decorators"; import { customElement, property, query, state } from "lit/decorators";
@ -11,7 +10,8 @@ import { stopPropagation } from "../common/dom/stop_propagation";
import { LocalizeFunc } from "../common/translations/localize"; import { LocalizeFunc } from "../common/translations/localize";
import "./ha-alert"; import "./ha-alert";
import "./ha-button-menu"; import "./ha-button-menu";
import "@material/mwc-button/mwc-button"; import "./ha-textfield";
import type { HaTextField } from "./ha-textfield";
@customElement("ha-qr-scanner") @customElement("ha-qr-scanner")
class HaQrScanner extends LitElement { class HaQrScanner extends LitElement {
@ -29,7 +29,7 @@ class HaQrScanner extends LitElement {
@query("#canvas-container", true) private _canvasContainer!: HTMLDivElement; @query("#canvas-container", true) private _canvasContainer!: HTMLDivElement;
@query("mwc-textfield") private _manualInput?: TextField; @query("ha-textfield") private _manualInput?: HaTextField;
public disconnectedCallback(): void { public disconnectedCallback(): void {
super.disconnectedCallback(); super.disconnectedCallback();
@ -102,11 +102,11 @@ class HaQrScanner extends LitElement {
</ha-alert> </ha-alert>
<p>${this.localize("ui.components.qr-scanner.manual_input")}</p> <p>${this.localize("ui.components.qr-scanner.manual_input")}</p>
<div class="row"> <div class="row">
<mwc-textfield <ha-textfield
.label=${this.localize("ui.components.qr-scanner.enter_qr_code")} .label=${this.localize("ui.components.qr-scanner.enter_qr_code")}
@keyup=${this._manualKeyup} @keyup=${this._manualKeyup}
@paste=${this._manualPaste} @paste=${this._manualPaste}
></mwc-textfield> ></ha-textfield>
<mwc-button @click=${this._manualSubmit} <mwc-button @click=${this._manualSubmit}
>${this.localize("ui.common.submit")}</mwc-button >${this.localize("ui.common.submit")}</mwc-button
> >
@ -161,7 +161,7 @@ class HaQrScanner extends LitElement {
private _manualKeyup(ev: KeyboardEvent) { private _manualKeyup(ev: KeyboardEvent) {
if (ev.key === "Enter") { if (ev.key === "Enter") {
this._qrCodeScanned((ev.target as TextField).value); this._qrCodeScanned((ev.target as HaTextField).value);
} }
} }
@ -199,7 +199,7 @@ class HaQrScanner extends LitElement {
display: flex; display: flex;
align-items: center; align-items: center;
} }
mwc-textfield { ha-textfield {
flex: 1; flex: 1;
margin-right: 8px; margin-right: 8px;
} }

View File

@ -1,12 +1,18 @@
import { Radio } from "@material/mwc-radio"; import { RadioBase } from "@material/mwc-radio/mwc-radio-base";
import { styles } from "@material/mwc-radio/mwc-radio.css";
import { css } from "lit";
import { customElement } from "lit/decorators"; import { customElement } from "lit/decorators";
@customElement("ha-radio") @customElement("ha-radio")
export class HaRadio extends Radio { export class HaRadio extends RadioBase {
public firstUpdated() { static override styles = [
super.firstUpdated(); styles,
this.style.setProperty("--mdc-theme-secondary", "var(--primary-color)"); css`
:host {
--mdc-theme-secondary: var(--primary-color);
} }
`,
];
} }
declare global { declare global {

View File

@ -5,7 +5,7 @@ import { fireEvent } from "../../common/dom/fire_event";
import { NumberSelector } from "../../data/selector"; import { NumberSelector } from "../../data/selector";
import { HomeAssistant } from "../../types"; import { HomeAssistant } from "../../types";
import "../ha-slider"; import "../ha-slider";
import "@material/mwc-textfield/mwc-textfield"; import "../ha-textfield";
@customElement("ha-selector-number") @customElement("ha-selector-number")
export class HaNumberSelector extends LitElement { export class HaNumberSelector extends LitElement {
@ -36,7 +36,7 @@ export class HaNumberSelector extends LitElement {
> >
</ha-slider>` </ha-slider>`
: ""} : ""}
<mwc-textfield <ha-textfield
inputMode="numeric" inputMode="numeric"
pattern="[0-9]+([\\.][0-9]+)?" pattern="[0-9]+([\\.][0-9]+)?"
.label=${this.selector.number.mode !== "box" ? undefined : this.label} .label=${this.selector.number.mode !== "box" ? undefined : this.label}
@ -50,13 +50,14 @@ export class HaNumberSelector extends LitElement {
.suffix=${this.selector.number.unit_of_measurement} .suffix=${this.selector.number.unit_of_measurement}
type="number" type="number"
autoValidate autoValidate
?no-spinner=${this.selector.number.mode !== "box"}
@input=${this._handleInputChange} @input=${this._handleInputChange}
> >
</mwc-textfield>`; </ha-textfield>`;
} }
private get _value() { private get _value() {
return this.value || 0; return this.value ?? 0;
} }
private _handleInputChange(ev) { private _handleInputChange(ev) {
@ -90,10 +91,11 @@ export class HaNumberSelector extends LitElement {
ha-slider { ha-slider {
flex: 1; flex: 1;
} }
mwc-textfield { ha-textfield {
width: 70px; --ha-textfield-input-width: 40px;
} }
.single { .single {
--ha-textfield-input-width: unset;
flex: 1; flex: 1;
} }
`; `;

View File

@ -1,5 +1,4 @@
import "@material/mwc-textarea/mwc-textarea"; import "@material/mwc-textarea/mwc-textarea";
import "@material/mwc-textfield/mwc-textfield";
import { mdiEye, mdiEyeOff } from "@mdi/js"; import { mdiEye, mdiEyeOff } from "@mdi/js";
import { css, CSSResultGroup, html, LitElement } from "lit"; import { css, CSSResultGroup, html, LitElement } from "lit";
import { customElement, property, state } from "lit/decorators"; import { customElement, property, state } from "lit/decorators";
@ -7,6 +6,7 @@ import { fireEvent } from "../../common/dom/fire_event";
import { StringSelector } from "../../data/selector"; import { StringSelector } from "../../data/selector";
import { HomeAssistant } from "../../types"; import { HomeAssistant } from "../../types";
import "../ha-icon-button"; import "../ha-icon-button";
import "../ha-textfield";
@customElement("ha-selector-text") @customElement("ha-selector-text")
export class HaTextSelector extends LitElement { export class HaTextSelector extends LitElement {
@ -38,7 +38,7 @@ export class HaTextSelector extends LitElement {
required required
></mwc-textarea>`; ></mwc-textarea>`;
} }
return html`<mwc-textfield return html`<ha-textfield
.value=${this.value || ""} .value=${this.value || ""}
.placeholder=${this.placeholder || ""} .placeholder=${this.placeholder || ""}
.disabled=${this.disabled} .disabled=${this.disabled}
@ -50,7 +50,7 @@ export class HaTextSelector extends LitElement {
html`<div style="width: 24px"></div>` html`<div style="width: 24px"></div>`
: this.selector.text?.suffix} : this.selector.text?.suffix}
required required
></mwc-textfield> ></ha-textfield>
${this.selector.text?.type === "password" ${this.selector.text?.type === "password"
? html`<ha-icon-button ? html`<ha-icon-button
toggles toggles
@ -79,7 +79,7 @@ export class HaTextSelector extends LitElement {
display: block; display: block;
position: relative; position: relative;
} }
mwc-textfield, ha-textfield,
mwc-textarea { mwc-textarea {
width: 100%; width: 100%;
} }

View File

@ -3,7 +3,7 @@ import "@polymer/paper-slider";
const PaperSliderClass = customElements.get("paper-slider"); const PaperSliderClass = customElements.get("paper-slider");
let subTemplate; let subTemplate;
class HaSlider extends PaperSliderClass { export class HaSlider extends PaperSliderClass {
static get template() { static get template() {
if (!subTemplate) { if (!subTemplate) {
subTemplate = PaperSliderClass.template.cloneNode(true); subTemplate = PaperSliderClass.template.cloneNode(true);

View File

@ -1,11 +1,11 @@
import { Switch } from "@material/mwc-switch/deprecated"; import { SwitchBase } from "@material/mwc-switch/deprecated/mwc-switch-base";
import { css, CSSResultGroup } from "lit"; import { styles } from "@material/mwc-switch/deprecated/mwc-switch.css";
import { css } from "lit";
import { customElement, property } from "lit/decorators"; import { customElement, property } from "lit/decorators";
import { forwardHaptic } from "../data/haptics"; import { forwardHaptic } from "../data/haptics";
@customElement("ha-switch") @customElement("ha-switch")
// @ts-expect-error export class HaSwitch extends SwitchBase {
export class HaSwitch extends Switch {
// Generate a haptic vibration. // Generate a haptic vibration.
// Only set to true if the new value of the switch is applied right away when toggling. // Only set to true if the new value of the switch is applied right away when toggling.
// Do not add haptic when a user is required to press save. // Do not add haptic when a user is required to press save.
@ -13,10 +13,6 @@ export class HaSwitch extends Switch {
protected firstUpdated() { protected firstUpdated() {
super.firstUpdated(); super.firstUpdated();
this.style.setProperty(
"--mdc-theme-secondary",
"var(--switch-checked-color)"
);
this.addEventListener("change", () => { this.addEventListener("change", () => {
if (this.haptic) { if (this.haptic) {
forwardHaptic("light"); forwardHaptic("light");
@ -24,10 +20,12 @@ export class HaSwitch extends Switch {
}); });
} }
static get styles(): CSSResultGroup { static override styles = [
return [ styles,
Switch.styles,
css` css`
:host {
--mdc-theme-secondary: var(--switch-checked-color);
}
.mdc-switch.mdc-switch--checked .mdc-switch__thumb { .mdc-switch.mdc-switch--checked .mdc-switch__thumb {
background-color: var(--switch-checked-button-color); background-color: var(--switch-checked-button-color);
border-color: var(--switch-checked-button-color); border-color: var(--switch-checked-button-color);
@ -47,7 +45,6 @@ export class HaSwitch extends Switch {
`, `,
]; ];
} }
}
declare global { declare global {
interface HTMLElementTagNameMap { interface HTMLElementTagNameMap {

View File

@ -1,9 +1,10 @@
import { TextField } from "@material/mwc-textfield"; import { TextFieldBase } from "@material/mwc-textfield/mwc-textfield-base";
import { TemplateResult, html, PropertyValues } from "lit"; import { styles } from "@material/mwc-textfield/mwc-textfield.css";
import { TemplateResult, html, PropertyValues, css } from "lit";
import { customElement, property } from "lit/decorators"; import { customElement, property } from "lit/decorators";
@customElement("ha-textfield") @customElement("ha-textfield")
export class HaTextField extends TextField { export class HaTextField extends TextFieldBase {
@property({ type: Boolean }) public invalid?: boolean; @property({ type: Boolean }) public invalid?: boolean;
@property({ attribute: "error-message" }) public errorMessage?: string; @property({ attribute: "error-message" }) public errorMessage?: string;
@ -37,6 +38,15 @@ export class HaTextField extends TextField {
</span> </span>
`; `;
} }
static override styles = [
styles,
css`
.mdc-text-field__input {
width: var(--ha-textfield-input-width, 100%);
}
`,
];
} }
declare global { declare global {

View File

@ -1,12 +1,12 @@
import "@material/mwc-button"; import "@material/mwc-button";
import "@material/mwc-textfield/mwc-textfield";
import type { TextField } from "@material/mwc-textfield/mwc-textfield";
import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit";
import { property, state } from "lit/decorators"; import { property, state } from "lit/decorators";
import { fireEvent } from "../../../../common/dom/fire_event"; import { fireEvent } from "../../../../common/dom/fire_event";
import "../../../../components/ha-alert"; import "../../../../components/ha-alert";
import "../../../../components/ha-card"; import "../../../../components/ha-card";
import type { HaSwitch } from "../../../../components/ha-switch"; import type { HaSwitch } from "../../../../components/ha-switch";
import "../../../../components/ha-textfield";
import type { HaTextField } from "../../../../components/ha-textfield";
import { CloudStatusLoggedIn, updateCloudPref } from "../../../../data/cloud"; import { CloudStatusLoggedIn, updateCloudPref } from "../../../../data/cloud";
import { syncCloudGoogleEntities } from "../../../../data/google_assistant"; import { syncCloudGoogleEntities } from "../../../../data/google_assistant";
import { showAlertDialog } from "../../../../dialogs/generic/show-dialog-box"; import { showAlertDialog } from "../../../../dialogs/generic/show-dialog-box";
@ -136,7 +136,7 @@ export class CloudGooglePref extends LitElement {
${this.hass.localize( ${this.hass.localize(
"ui.panel.config.cloud.account.google.enter_pin_info" "ui.panel.config.cloud.account.google.enter_pin_info"
)} )}
<mwc-textfield <ha-textfield
id="google_secure_devices_pin" id="google_secure_devices_pin"
.label=${this.hass.localize( .label=${this.hass.localize(
"ui.panel.config.cloud.account.google.devices_pin" "ui.panel.config.cloud.account.google.devices_pin"
@ -146,7 +146,7 @@ export class CloudGooglePref extends LitElement {
)} )}
.value=${google_secure_devices_pin || ""} .value=${google_secure_devices_pin || ""}
@change=${this._pinChanged} @change=${this._pinChanged}
></mwc-textfield> ></ha-textfield>
</div> </div>
`} `}
</div> </div>
@ -229,7 +229,7 @@ export class CloudGooglePref extends LitElement {
} }
private async _pinChanged(ev) { private async _pinChanged(ev) {
const input = ev.target as TextField; const input = ev.target as HaTextField;
try { try {
await updateCloudPref(this.hass, { await updateCloudPref(this.hass, {
[input.id]: input.value || null, [input.id]: input.value || null,
@ -260,7 +260,7 @@ export class CloudGooglePref extends LitElement {
right: auto; right: auto;
left: 24px; left: 24px;
} }
mwc-textfield { ha-textfield {
width: 250px; width: 250px;
display: block; display: block;
margin-top: 8px; margin-top: 8px;

View File

@ -1,11 +1,11 @@
import "@material/mwc-textfield/mwc-textfield";
import type { TextField } from "@material/mwc-textfield/mwc-textfield";
import { css, html, LitElement, TemplateResult } from "lit"; import { css, html, LitElement, TemplateResult } from "lit";
import { customElement, property, query, state } from "lit/decorators"; import { customElement, property, query, state } from "lit/decorators";
import { fireEvent } from "../../../../common/dom/fire_event"; import { fireEvent } from "../../../../common/dom/fire_event";
import "../../../../components/buttons/ha-progress-button"; import "../../../../components/buttons/ha-progress-button";
import "../../../../components/ha-alert"; import "../../../../components/ha-alert";
import "../../../../components/ha-card"; import "../../../../components/ha-card";
import type { HaTextField } from "../../../../components/ha-textfield";
import "../../../../components/ha-textfield";
import { cloudForgotPassword } from "../../../../data/cloud"; import { cloudForgotPassword } from "../../../../data/cloud";
import "../../../../layouts/hass-subpage"; import "../../../../layouts/hass-subpage";
import { haStyle } from "../../../../resources/styles"; import { haStyle } from "../../../../resources/styles";
@ -23,7 +23,7 @@ export class CloudForgotPassword extends LitElement {
@state() private _error?: string; @state() private _error?: string;
@query("#email", true) private _emailField!: TextField; @query("#email", true) private _emailField!: HaTextField;
protected render(): TemplateResult { protected render(): TemplateResult {
return html` return html`
@ -49,7 +49,7 @@ export class CloudForgotPassword extends LitElement {
${this._error ${this._error
? html`<ha-alert alert-type="error">${this._error}</ha-alert>` ? html`<ha-alert alert-type="error">${this._error}</ha-alert>`
: ""} : ""}
<mwc-textfield <ha-textfield
autofocus autofocus
id="email" id="email"
label=${this.hass.localize( label=${this.hass.localize(
@ -62,7 +62,7 @@ export class CloudForgotPassword extends LitElement {
.validationMessage=${this.hass.localize( .validationMessage=${this.hass.localize(
"ui.panel.config.cloud.forgot_password.email_error_msg" "ui.panel.config.cloud.forgot_password.email_error_msg"
)} )}
></mwc-textfield> ></ha-textfield>
</div> </div>
<div class="card-actions"> <div class="card-actions">
<ha-progress-button <ha-progress-button
@ -133,7 +133,7 @@ export class CloudForgotPassword extends LitElement {
h1 { h1 {
margin: 0; margin: 0;
} }
mwc-textfield { ha-textfield {
width: 100%; width: 100%;
} }
.card-actions { .card-actions {

View File

@ -1,6 +1,4 @@
import "@material/mwc-button"; import "@material/mwc-button";
import "@material/mwc-textfield/mwc-textfield";
import type { TextField } from "@material/mwc-textfield/mwc-textfield";
import "@polymer/paper-input/paper-input"; import "@polymer/paper-input/paper-input";
import "@polymer/paper-item/paper-item"; import "@polymer/paper-item/paper-item";
import "@polymer/paper-item/paper-item-body"; import "@polymer/paper-item/paper-item-body";
@ -12,6 +10,8 @@ import "../../../../components/buttons/ha-progress-button";
import "../../../../components/ha-alert"; import "../../../../components/ha-alert";
import "../../../../components/ha-card"; import "../../../../components/ha-card";
import "../../../../components/ha-icon-next"; import "../../../../components/ha-icon-next";
import type { HaTextField } from "../../../../components/ha-textfield";
import "../../../../components/ha-textfield";
import { cloudLogin } from "../../../../data/cloud"; import { cloudLogin } from "../../../../data/cloud";
import { showAlertDialog } from "../../../../dialogs/generic/show-dialog-box"; import { showAlertDialog } from "../../../../dialogs/generic/show-dialog-box";
import "../../../../layouts/hass-subpage"; import "../../../../layouts/hass-subpage";
@ -38,9 +38,9 @@ export class CloudLogin extends LitElement {
@state() private _error?: string; @state() private _error?: string;
@query("#email", true) private _emailField!: TextField; @query("#email", true) private _emailField!: HaTextField;
@query("#password", true) private _passwordField!: TextField; @query("#password", true) private _passwordField!: HaTextField;
protected render(): TemplateResult { protected render(): TemplateResult {
return html` return html`
@ -108,7 +108,7 @@ export class CloudLogin extends LitElement {
${this._error ${this._error
? html`<ha-alert alert-type="error">${this._error}</ha-alert>` ? html`<ha-alert alert-type="error">${this._error}</ha-alert>`
: ""} : ""}
<mwc-textfield <ha-textfield
.label=${this.hass.localize( .label=${this.hass.localize(
"ui.panel.config.cloud.login.email" "ui.panel.config.cloud.login.email"
)} )}
@ -121,8 +121,8 @@ export class CloudLogin extends LitElement {
.validationMessage=${this.hass.localize( .validationMessage=${this.hass.localize(
"ui.panel.config.cloud.login.email_error_msg" "ui.panel.config.cloud.login.email_error_msg"
)} )}
></mwc-textfield> ></ha-textfield>
<mwc-textfield <ha-textfield
id="password" id="password"
.label=${this.hass.localize( .label=${this.hass.localize(
"ui.panel.config.cloud.login.password" "ui.panel.config.cloud.login.password"
@ -136,7 +136,7 @@ export class CloudLogin extends LitElement {
.validationMessage=${this.hass.localize( .validationMessage=${this.hass.localize(
"ui.panel.config.cloud.login.password_error_msg" "ui.panel.config.cloud.login.password_error_msg"
)} )}
></mwc-textfield> ></ha-textfield>
<button <button
class="link pwd-forgot-link" class="link pwd-forgot-link"
.disabled=${this._requestInProgress} .disabled=${this._requestInProgress}

View File

@ -1,11 +1,11 @@
import "@material/mwc-textfield/mwc-textfield";
import type { TextField } from "@material/mwc-textfield/mwc-textfield";
import { css, html, LitElement, TemplateResult } from "lit"; import { css, html, LitElement, TemplateResult } from "lit";
import { customElement, property, query, state } from "lit/decorators"; import { customElement, property, query, state } from "lit/decorators";
import { fireEvent } from "../../../../common/dom/fire_event"; import { fireEvent } from "../../../../common/dom/fire_event";
import "../../../../components/buttons/ha-progress-button"; import "../../../../components/buttons/ha-progress-button";
import "../../../../components/ha-alert"; import "../../../../components/ha-alert";
import "../../../../components/ha-card"; import "../../../../components/ha-card";
import "../../../../components/ha-textfield";
import type { HaTextField } from "../../../../components/ha-textfield";
import { cloudRegister, cloudResendVerification } from "../../../../data/cloud"; import { cloudRegister, cloudResendVerification } from "../../../../data/cloud";
import "../../../../layouts/hass-subpage"; import "../../../../layouts/hass-subpage";
import { haStyle } from "../../../../resources/styles"; import { haStyle } from "../../../../resources/styles";
@ -28,9 +28,9 @@ export class CloudRegister extends LitElement {
@state() private _error?: string; @state() private _error?: string;
@query("#email", true) private _emailField!: TextField; @query("#email", true) private _emailField!: HaTextField;
@query("#password", true) private _passwordField!: TextField; @query("#password", true) private _passwordField!: HaTextField;
protected render(): TemplateResult { protected render(): TemplateResult {
return html` return html`
@ -128,7 +128,7 @@ export class CloudRegister extends LitElement {
${this._error ${this._error
? html`<ha-alert alert-type="error">${this._error}</ha-alert>` ? html`<ha-alert alert-type="error">${this._error}</ha-alert>`
: ""} : ""}
<mwc-textfield <ha-textfield
autofocus autofocus
id="email" id="email"
.label=${this.hass.localize( .label=${this.hass.localize(
@ -141,8 +141,8 @@ export class CloudRegister extends LitElement {
validationMessage=${this.hass.localize( validationMessage=${this.hass.localize(
"ui.panel.config.cloud.register.email_error_msg" "ui.panel.config.cloud.register.email_error_msg"
)} )}
></mwc-textfield> ></ha-textfield>
<mwc-textfield <ha-textfield
id="password" id="password"
label="Password" label="Password"
.value=${this._password} .value=${this._password}
@ -153,7 +153,7 @@ export class CloudRegister extends LitElement {
validationMessage=${this.hass.localize( validationMessage=${this.hass.localize(
"ui.panel.config.cloud.register.password_error_msg" "ui.panel.config.cloud.register.password_error_msg"
)} )}
></mwc-textfield> ></ha-textfield>
</div> </div>
<div class="card-actions"> <div class="card-actions">
<ha-progress-button <ha-progress-button

View File

@ -1,4 +1,3 @@
import "@material/mwc-list/mwc-list-item";
import type { RequestSelectedDetail } from "@material/mwc-list/mwc-list-item"; import type { RequestSelectedDetail } from "@material/mwc-list/mwc-list-item";
import { mdiCancel, mdiFilterVariant, mdiPlus } from "@mdi/js"; import { mdiCancel, mdiFilterVariant, mdiPlus } from "@mdi/js";
import "@polymer/paper-tooltip/paper-tooltip"; import "@polymer/paper-tooltip/paper-tooltip";
@ -19,6 +18,7 @@ import "../../../components/entity/ha-battery-icon";
import "../../../components/ha-button-menu"; import "../../../components/ha-button-menu";
import "../../../components/ha-fab"; import "../../../components/ha-fab";
import "../../../components/ha-icon-button"; import "../../../components/ha-icon-button";
import "../../../components/ha-check-list-item";
import { AreaRegistryEntry } from "../../../data/area_registry"; import { AreaRegistryEntry } from "../../../data/area_registry";
import { ConfigEntry } from "../../../data/config_entries"; import { ConfigEntry } from "../../../data/config_entries";
import { import {
@ -435,19 +435,15 @@ export class HaConfigDeviceDashboard extends LitElement {
)} )}
.path=${mdiFilterVariant} .path=${mdiFilterVariant}
></ha-icon-button> ></ha-icon-button>
<mwc-list-item <ha-check-list-item
left
@request-selected=${this._showDisabledChanged} @request-selected=${this._showDisabledChanged}
graphic="control"
.selected=${this._showDisabled} .selected=${this._showDisabled}
> >
<ha-checkbox
slot="graphic"
.checked=${this._showDisabled}
></ha-checkbox>
${this.hass!.localize( ${this.hass!.localize(
"ui.panel.config.devices.picker.filter.show_disabled" "ui.panel.config.devices.picker.filter.show_disabled"
)} )}
</mwc-list-item> </ha-check-list-item>
</ha-button-menu> </ha-button-menu>
</hass-tabs-subpage-data-table> </hass-tabs-subpage-data-table>
`; `;

View File

@ -1,4 +1,3 @@
import "@material/mwc-list/mwc-list-item";
import type { RequestSelectedDetail } from "@material/mwc-list/mwc-list-item"; import type { RequestSelectedDetail } from "@material/mwc-list/mwc-list-item";
import { import {
mdiAlertCircle, mdiAlertCircle,
@ -35,6 +34,7 @@ import type {
import "../../../components/ha-button-menu"; import "../../../components/ha-button-menu";
import "../../../components/ha-icon-button"; import "../../../components/ha-icon-button";
import "../../../components/ha-svg-icon"; import "../../../components/ha-svg-icon";
import "../../../components/ha-check-list-item";
import { import {
AreaRegistryEntry, AreaRegistryEntry,
subscribeAreaRegistry, subscribeAreaRegistry,
@ -586,45 +586,35 @@ export class HaConfigEntities extends SubscribeMixin(LitElement) {
)} )}
.path=${mdiFilterVariant} .path=${mdiFilterVariant}
></ha-icon-button> ></ha-icon-button>
<mwc-list-item <ha-check-list-item
@request-selected=${this._showDisabledChanged} @request-selected=${this._showDisabledChanged}
graphic="control"
.selected=${this._showDisabled} .selected=${this._showDisabled}
left
> >
<ha-checkbox
slot="graphic"
.checked=${this._showDisabled}
></ha-checkbox>
${this.hass!.localize( ${this.hass!.localize(
"ui.panel.config.entities.picker.filter.show_disabled" "ui.panel.config.entities.picker.filter.show_disabled"
)} )}
</mwc-list-item> </ha-check-list-item>
<mwc-list-item <ha-check-list-item
@request-selected=${this._showRestoredChanged} @request-selected=${this._showRestoredChanged}
graphic="control" graphic="control"
.selected=${this._showUnavailable} .selected=${this._showUnavailable}
left
> >
<ha-checkbox
slot="graphic"
.checked=${this._showUnavailable}
></ha-checkbox>
${this.hass!.localize( ${this.hass!.localize(
"ui.panel.config.entities.picker.filter.show_unavailable" "ui.panel.config.entities.picker.filter.show_unavailable"
)} )}
</mwc-list-item> </ha-check-list-item>
<mwc-list-item <ha-check-list-item
@request-selected=${this._showReadOnlyChanged} @request-selected=${this._showReadOnlyChanged}
graphic="control" graphic="control"
.selected=${this._showReadOnly} .selected=${this._showReadOnly}
left
> >
<ha-checkbox
slot="graphic"
.checked=${this._showReadOnly}
></ha-checkbox>
${this.hass!.localize( ${this.hass!.localize(
"ui.panel.config.entities.picker.filter.show_readonly" "ui.panel.config.entities.picker.filter.show_readonly"
)} )}
</mwc-list-item> </ha-check-list-item>
</ha-button-menu>`} </ha-button-menu>`}
${includeZHAFab ${includeZHAFab
? html`<a href="/config/zha/add" slot="fab"> ? html`<a href="/config/zha/add" slot="fab">

View File

@ -1,5 +1,4 @@
import { ActionDetail } from "@material/mwc-list"; import { ActionDetail } from "@material/mwc-list";
import "@material/mwc-list/mwc-list-item";
import { mdiFilterVariant, mdiPlus } from "@mdi/js"; import { mdiFilterVariant, mdiPlus } from "@mdi/js";
import Fuse from "fuse.js"; import Fuse from "fuse.js";
import type { UnsubscribeFunc } from "home-assistant-js-websocket"; import type { UnsubscribeFunc } from "home-assistant-js-websocket";
@ -26,6 +25,8 @@ import "../../../components/ha-checkbox";
import "../../../components/ha-fab"; import "../../../components/ha-fab";
import "../../../components/ha-icon-button"; import "../../../components/ha-icon-button";
import "../../../components/ha-svg-icon"; import "../../../components/ha-svg-icon";
import "../../../components/ha-check-list-item";
import { isComponentLoaded } from "../../../common/config/is_component_loaded"; import { isComponentLoaded } from "../../../common/config/is_component_loaded";
import { ConfigEntry, getConfigEntries } from "../../../data/config_entries"; import { ConfigEntry, getConfigEntries } from "../../../data/config_entries";
import { import {
@ -308,21 +309,16 @@ class HaConfigIntegrations extends SubscribeMixin(LitElement) {
.path=${mdiFilterVariant} .path=${mdiFilterVariant}
> >
</ha-icon-button> </ha-icon-button>
<mwc-list-item graphic="control" .selected=${this._showIgnored}> <ha-check-list-item left .selected=${this._showIgnored}>
<ha-checkbox slot="graphic" .checked=${this._showIgnored}></ha-checkbox>
${this.hass.localize( ${this.hass.localize(
"ui.panel.config.integrations.ignore.show_ignored" "ui.panel.config.integrations.ignore.show_ignored"
)} )}
</mwc-list-item> </ha-check-list-item>
<mwc-list-item graphic="control" .selected=${this._showDisabled}> <ha-check-list-item left .selected=${this._showDisabled}>
<ha-checkbox
slot="graphic"
.checked=${this._showDisabled}
></ha-checkbox>
${this.hass.localize( ${this.hass.localize(
"ui.panel.config.integrations.disable.show_disabled" "ui.panel.config.integrations.disable.show_disabled"
)} )}
</mwc-list-item> </ha-check-list-item>
</ha-button-menu>`; </ha-button-menu>`;
return html` return html`

View File

@ -1,5 +1,4 @@
import "@material/mwc-button/mwc-button"; import "@material/mwc-button/mwc-button";
import "@material/mwc-textfield/mwc-textfield";
import { mdiAlertCircle, mdiCheckCircle, mdiQrcodeScan } from "@mdi/js"; import { mdiAlertCircle, mdiCheckCircle, mdiQrcodeScan } from "@mdi/js";
import "@polymer/paper-input/paper-input"; import "@polymer/paper-input/paper-input";
import type { PaperInputElement } from "@polymer/paper-input/paper-input"; import type { PaperInputElement } from "@polymer/paper-input/paper-input";
@ -811,10 +810,6 @@ class DialogZWaveJSAddNode extends LitElement {
} }
} }
mwc-textfield {
width: 100%;
}
ha-svg-icon { ha-svg-icon {
width: 68px; width: 68px;
height: 48px; height: 48px;