${this.label}
`} ${this.selectedText ? html`${this.selectedText}
` : nothing}import { SelectBase } from "@material/mwc-select/mwc-select-base"; import { mdiMenuDown } from "@mdi/js"; import type { PropertyValues } from "lit"; import { css, html, nothing } from "lit"; import { customElement, property, query } from "lit/decorators"; import { classMap } from "lit/directives/class-map"; import { ifDefined } from "lit/directives/if-defined"; import { debounce } from "../common/util/debounce"; import { nextRender } from "../common/util/render-status"; import "./ha-icon"; import type { HaIcon } from "./ha-icon"; import "./ha-ripple"; import "./ha-svg-icon"; import type { HaSvgIcon } from "./ha-svg-icon"; import "./ha-menu"; @customElement("ha-control-select-menu") export class HaControlSelectMenu extends SelectBase { @query(".select") protected mdcRoot!: HTMLElement; @query(".select-anchor") protected anchorElement!: HTMLDivElement | null; @property({ type: Boolean, attribute: "show-arrow" }) public showArrow = false; @property({ type: Boolean, attribute: "hide-label" }) public hideLabel = false; @property() public options; protected updated(changedProps: PropertyValues) { super.updated(changedProps); if (changedProps.get("options")) { this.layoutOptions(); this.selectByValue(this.value); } } public override render() { const classes = { "select-disabled": this.disabled, "select-required": this.required, "select-invalid": !this.isUiValid, "select-no-value": !this.selectedText, }; const labelledby = this.label && !this.hideLabel ? "label" : undefined; const labelAttribute = this.label && this.hideLabel ? this.label : undefined; return html`
${this.label}
`} ${this.selectedText ? html`${this.selectedText}
` : nothing}