Add helpers to all selectors (#12230)

This commit is contained in:
Paulus Schoutsen
2022-04-05 13:26:52 -07:00
committed by GitHub
parent 358f91c2a9
commit 59595aabde
35 changed files with 239 additions and 75 deletions

View File

@@ -58,6 +58,7 @@ export class HaSelectSelector extends LitElement {
`
)}
</div>
${this._renderHelper()}
`;
}
@@ -76,6 +77,7 @@ export class HaSelectSelector extends LitElement {
`
)}
</div>
${this._renderHelper()}
`;
}
@@ -107,6 +109,7 @@ export class HaSelectSelector extends LitElement {
item-label-path="label"
.hass=${this.hass}
.label=${this.label}
.helper=${this.helper}
.disabled=${this.disabled}
.required=${this.required && !value.length}
.value=${this._filter}
@@ -131,6 +134,7 @@ export class HaSelectSelector extends LitElement {
item-label-path="label"
.hass=${this.hass}
.label=${this.label}
.helper=${this.helper}
.disabled=${this.disabled}
.required=${this.required}
.items=${options}
@@ -161,6 +165,12 @@ export class HaSelectSelector extends LitElement {
`;
}
private _renderHelper() {
return this.helper
? html`<ha-input-helper-text>${this.helper}</ha-input-helper-text>`
: "";
}
private get _mode(): "list" | "dropdown" {
return (
this.selector.select.mode ||