Fix width of application creds page (#12806)

This commit is contained in:
Bram Kragten 2022-05-26 23:59:26 +02:00 committed by GitHub
parent 93f4ae1bea
commit cbb962f084
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 11 deletions

View File

@ -1,13 +1,17 @@
import "@material/mwc-list/mwc-list-item"; import "@material/mwc-list/mwc-list-item";
import { mdiClose, mdiMenuDown, mdiMenuUp } from "@mdi/js"; import { mdiClose, mdiMenuDown, mdiMenuUp } from "@mdi/js";
import "@vaadin/combo-box/theme/material/vaadin-combo-box-light"; import "@vaadin/combo-box/theme/material/vaadin-combo-box-light";
import type { ComboBoxLight } from "@vaadin/combo-box/vaadin-combo-box-light"; import type {
ComboBoxLight,
ComboBoxLightFilterChangedEvent,
ComboBoxLightOpenedChangedEvent,
ComboBoxLightValueChangedEvent,
} from "@vaadin/combo-box/vaadin-combo-box-light";
import { registerStyles } from "@vaadin/vaadin-themable-mixin/register-styles"; import { registerStyles } from "@vaadin/vaadin-themable-mixin/register-styles";
import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit";
import { ComboBoxLitRenderer, comboBoxRenderer } from "lit-vaadin-helpers"; import { ComboBoxLitRenderer, comboBoxRenderer } from "lit-vaadin-helpers";
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 { PolymerChangedEvent } from "../polymer-types";
import { HomeAssistant } from "../types"; import { HomeAssistant } from "../types";
import "./ha-icon-button"; import "./ha-icon-button";
import "./ha-textfield"; import "./ha-textfield";
@ -203,7 +207,7 @@ export class HaComboBox extends LitElement {
} }
} }
private _openedChanged(ev: PolymerChangedEvent<boolean>) { private _openedChanged(ev: ComboBoxLightOpenedChangedEvent) {
const opened = ev.detail.value; const opened = ev.detail.value;
// delay this so we can handle click event before setting _opened // delay this so we can handle click event before setting _opened
setTimeout(() => { setTimeout(() => {
@ -229,14 +233,12 @@ export class HaComboBox extends LitElement {
mutations.forEach((mutation) => { mutations.forEach((mutation) => {
if ( if (
mutation.type === "attributes" && mutation.type === "attributes" &&
mutation.attributeName === "inert" && mutation.attributeName === "inert"
// @ts-expect-error
overlay.inert === true
) { ) {
// @ts-expect-error
overlay.inert = false;
this._overlayMutationObserver?.disconnect(); this._overlayMutationObserver?.disconnect();
this._overlayMutationObserver = undefined; this._overlayMutationObserver = undefined;
// @ts-expect-error
overlay.inert = false;
} else if (mutation.type === "childList") { } else if (mutation.type === "childList") {
mutation.removedNodes.forEach((node) => { mutation.removedNodes.forEach((node) => {
if (node.nodeName === "VAADIN-COMBO-BOX-OVERLAY") { if (node.nodeName === "VAADIN-COMBO-BOX-OVERLAY") {
@ -257,12 +259,12 @@ export class HaComboBox extends LitElement {
} }
} }
private _filterChanged(ev: PolymerChangedEvent<string>) { private _filterChanged(ev: ComboBoxLightFilterChangedEvent) {
// @ts-ignore // @ts-ignore
fireEvent(this, ev.type, ev.detail, { composed: false }); fireEvent(this, ev.type, ev.detail, { composed: false });
} }
private _valueChanged(ev: PolymerChangedEvent<string>) { private _valueChanged(ev: ComboBoxLightValueChangedEvent) {
ev.stopPropagation(); ev.stopPropagation();
const newValue = ev.detail.value; const newValue = ev.detail.value;

View File

@ -53,7 +53,6 @@ export class HaConfigApplicationCredentials extends LitElement {
title: localize( title: localize(
"ui.panel.config.application_credentials.picker.headers.name" "ui.panel.config.application_credentials.picker.headers.name"
), ),
width: "40%",
direction: "asc", direction: "asc",
grows: true, grows: true,
template: (_, entry: ApplicationCredential) => html`${entry.name}`, template: (_, entry: ApplicationCredential) => html`${entry.name}`,