Fix formfield display (#6245)

This commit is contained in:
Paulus Schoutsen 2020-06-26 12:17:27 -07:00 committed by GitHub
parent 7395d19489
commit 2cd367f29f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 76 additions and 62 deletions

View File

@ -143,15 +143,17 @@ class CloudGoogleAssistant extends LitElement {
</ha-formfield> </ha-formfield>
${entity.might_2fa ${entity.might_2fa
? html` ? html`
<ha-formfield
.label=${this.hass!.localize(
"ui.panel.config.cloud.google.disable_2FA"
)}
>
<ha-switch <ha-switch
.entityId=${entity.entity_id} .entityId=${entity.entity_id}
.checked=${Boolean(config.disable_2fa)} .checked=${Boolean(config.disable_2fa)}
@change=${this._disable2FAChanged} @change=${this._disable2FAChanged}
> ></ha-switch>
${this.hass!.localize( </ha-formfield>
"ui.panel.config.cloud.google.disable_2FA"
)}
</ha-switch>
` `
: ""} : ""}
</div> </div>
@ -375,6 +377,9 @@ class CloudGoogleAssistant extends LitElement {
state-info { state-info {
cursor: pointer; cursor: pointer;
} }
ha-formfield {
display: block;
}
ha-switch { ha-switch {
padding: 8px 0; padding: 8px 0;
} }

View File

@ -232,6 +232,9 @@ class DialogMQTTDeviceDebugInfo extends LitElement {
.triggerlistitem { .triggerlistitem {
margin-bottom: 12px; margin-bottom: 12px;
} }
ha-formfield {
display: block;
}
`, `,
]; ];
} }

View File

@ -318,6 +318,9 @@ export class DialogLovelaceDashboardDetail extends LitElement {
ha-switch { ha-switch {
padding: 16px 0; padding: 16px 0;
} }
ha-formfield {
display: block;
}
`, `,
]; ];
} }

View File

@ -136,33 +136,35 @@ export class HuiButtonCardEditor extends LitElement
"ui.panel.lovelace.editor.card.config.optional" "ui.panel.lovelace.editor.card.config.optional"
)})" )})"
.value=${this._icon} .value=${this._icon}
.placeholder=${ .placeholder=${this._icon ||
this._icon || stateIcon(this.hass.states[this._entity]) stateIcon(this.hass.states[this._entity])}
}
.configValue=${"icon"} .configValue=${"icon"}
@value-changed=${this._valueChanged} @value-changed=${this._valueChanged}
></ha-icon-input> ></ha-icon-input>
</div> </div>
<div class="side-by-side"> <div class="side-by-side">
<ha-formfield .label=${this.hass.localize( <ha-formfield
.label=${this.hass.localize(
"ui.panel.lovelace.editor.card.generic.show_name" "ui.panel.lovelace.editor.card.generic.show_name"
)}> )}
>
<ha-switch <ha-switch
.checked="${this._config!.show_name !== false}" .checked="${this._config!.show_name !== false}"
.configValue="${"show_name"}" .configValue="${"show_name"}"
@change="${this._valueChanged}" @change="${this._valueChanged}"
></ha-switch ></ha-switch>
>
</ha-formfield> </ha-formfield>
<ha-formfield .label=${this.hass.localize( <ha-formfield
.label=${this.hass.localize(
"ui.panel.lovelace.editor.card.generic.show_icon" "ui.panel.lovelace.editor.card.generic.show_icon"
)}> )}
>
<ha-switch <ha-switch
.checked="${this._config!.show_icon !== false}" .checked="${this._config!.show_icon !== false}"
.configValue="${"show_icon"}" .configValue="${"show_icon"}"
@change="${this._valueChanged}" @change="${this._valueChanged}"
></ha-switch ></ha-switch>
></ha-formfield> </ha-formfield>
</div> </div>
<div class="side-by-side"> <div class="side-by-side">
<paper-input <paper-input
@ -183,8 +185,6 @@ export class HuiButtonCardEditor extends LitElement
.configValue="${"theme"}" .configValue="${"theme"}"
@value-changed="${this._valueChanged}" @value-changed="${this._valueChanged}"
></hui-theme-select-editor> ></hui-theme-select-editor>
</paper-input>
</div> </div>
<div class="side-by-side"> <div class="side-by-side">
<hui-action-editor <hui-action-editor

View File

@ -133,11 +133,11 @@ export class HuiViewEditor extends LitElement {
@change=${this._valueChanged} @change=${this._valueChanged}
></ha-switch ></ha-switch
></ha-formfield> ></ha-formfield>
<span class="panel" <span class="panel">
>${this.hass.localize( ${this.hass.localize(
"ui.panel.lovelace.editor.view.panel_mode.description" "ui.panel.lovelace.editor.view.panel_mode.description"
)}</span )}
> </span>
</div> </div>
`; `;
} }
@ -181,6 +181,9 @@ export class HuiViewEditor extends LitElement {
.panel { .panel {
color: var(--secondary-text-color); color: var(--secondary-text-color);
} }
ha-formfield {
display: block;
}
`; `;
} }
} }