hassio fixes (#11688)

This commit is contained in:
Bram Kragten 2022-02-14 22:33:12 +01:00 committed by GitHub
parent 523afe2f6f
commit fc654d86c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 26 additions and 21 deletions

View File

@ -221,13 +221,14 @@ class HassioAddonStore extends LitElement {
margin-top: 24px; margin-top: 24px;
} }
.search { .search {
padding: 0 16px; position: sticky;
background: var(--sidebar-background-color); top: 0;
border-bottom: 1px solid var(--divider-color); z-index: 2;
} }
.search search-input { search-input {
position: relative; display: block;
top: 2px; --mdc-text-field-fill-color: var(--sidebar-background-color);
--mdc-text-field-idle-line-color: var(--divider-color);
} }
.advanced { .advanced {
padding: 12px; padding: 12px;

View File

@ -56,8 +56,8 @@ class HassioAddonAudio 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>`
: ""} : ""}
${this._inputDevices &&
<mwc-select html`<mwc-select
.label=${this.supervisor.localize( .label=${this.supervisor.localize(
"addon.configuration.audio.input" "addon.configuration.audio.input"
)} )}
@ -67,16 +67,16 @@ class HassioAddonAudio extends LitElement {
naturalMenuWidth naturalMenuWidth
.value=${this._selectedInput!} .value=${this._selectedInput!}
> >
${this._inputDevices && ${this._inputDevices.map(
this._inputDevices.map(
(item) => html` (item) => html`
<mwc-list-item .value=${item.device || ""}> <mwc-list-item .value=${item.device || ""}>
${item.name} ${item.name}
</mwc-list-item> </mwc-list-item>
` `
)} )}
</mwc-select> </mwc-select>`}
<mwc-select ${this._outputDevices &&
html`<mwc-select
.label=${this.supervisor.localize( .label=${this.supervisor.localize(
"addon.configuration.audio.output" "addon.configuration.audio.output"
)} )}
@ -86,15 +86,14 @@ class HassioAddonAudio extends LitElement {
naturalMenuWidth naturalMenuWidth
.value=${this._selectedOutput!} .value=${this._selectedOutput!}
> >
${this._outputDevices && ${this._outputDevices.map(
this._outputDevices.map(
(item) => html` (item) => html`
<mwc-list-item .value=${item.device || ""} <mwc-list-item .value=${item.device || ""}
>${item.name}</mwc-list-item >${item.name}</mwc-list-item
> >
` `
)} )}
</mwc-select> </mwc-select>`}
</div> </div>
<div class="card-actions"> <div class="card-actions">
<ha-progress-button @click=${this._saveSettings}> <ha-progress-button @click=${this._saveSettings}>
@ -121,12 +120,18 @@ class HassioAddonAudio extends LitElement {
.card-actions { .card-actions {
text-align: right; text-align: right;
} }
mwc-select {
width: 100%;
}
mwc-select:last-child {
margin-top: 8px;
}
`, `,
]; ];
} }
protected update(changedProperties: PropertyValues): void { protected willUpdate(changedProperties: PropertyValues): void {
super.update(changedProperties); super.willUpdate(changedProperties);
if (changedProperties.has("addon")) { if (changedProperties.has("addon")) {
this._addonChanged(); this._addonChanged();
} }

View File

@ -178,7 +178,7 @@ class HassioHardwareDialog extends LitElement {
padding: 0.2em 0.4em; padding: 0.2em 0.4em;
} }
search-input { search-input {
margin: 0 16px; margin: 8px 16px 0;
display: block; display: block;
} }
.device-property { .device-property {

View File

@ -146,8 +146,8 @@ class HassioSupervisorLog extends LitElement {
white-space: pre-wrap; white-space: pre-wrap;
} }
mwc-select { mwc-select {
padding: 0 2%; width: 100%;
width: 96%; margin-bottom: 4px;
} }
`, `,
]; ];

View File

@ -10,7 +10,6 @@ import {
import { customElement, property, state } from "lit/decorators"; import { customElement, property, state } from "lit/decorators";
import memoizeOne from "memoize-one"; import memoizeOne from "memoize-one";
import { fireEvent } from "../../../src/common/dom/fire_event"; import { fireEvent } from "../../../src/common/dom/fire_event";
import "../../../src/common/search/search-input";
import "../../../src/components/buttons/ha-progress-button"; import "../../../src/components/buttons/ha-progress-button";
import "../../../src/components/ha-alert"; import "../../../src/components/ha-alert";
import "../../../src/components/ha-button-menu"; import "../../../src/components/ha-button-menu";