mirror of
https://github.com/home-assistant/frontend.git
synced 2025-11-09 10:59:50 +00:00
Use SWC for typescript, update to Lit 3, migrate decorators (#25150)
Co-authored-by: Wendelin <w@pe8.at>
This commit is contained in:
@@ -12,6 +12,7 @@ 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 {
|
||||
@@ -91,6 +92,27 @@ export class HaControlSelectMenu extends SelectBase {
|
||||
`;
|
||||
}
|
||||
|
||||
protected override renderMenu() {
|
||||
const classes = this.getMenuClasses();
|
||||
return html`<ha-menu
|
||||
innerRole="listbox"
|
||||
wrapFocus
|
||||
class=${classMap(classes)}
|
||||
activatable
|
||||
.fullwidth=${this.fixedMenuPosition ? false : !this.naturalMenuWidth}
|
||||
.open=${this.menuOpen}
|
||||
.anchor=${this.anchorElement}
|
||||
.fixed=${this.fixedMenuPosition}
|
||||
@selected=${this.onSelected}
|
||||
@opened=${this.onOpened}
|
||||
@closed=${this.onClosed}
|
||||
@items-updated=${this.onItemsUpdated}
|
||||
@keydown=${this.handleTypeahead}
|
||||
>
|
||||
${this.renderMenuContent()}
|
||||
</ha-menu>`;
|
||||
}
|
||||
|
||||
private _renderArrow() {
|
||||
if (!this.showArrow) return nothing;
|
||||
|
||||
@@ -240,13 +262,6 @@ export class HaControlSelectMenu extends SelectBase {
|
||||
cursor: not-allowed;
|
||||
color: var(--disabled-color);
|
||||
}
|
||||
|
||||
mwc-menu {
|
||||
--mdc-shape-medium: 8px;
|
||||
}
|
||||
mwc-list {
|
||||
--mdc-list-vertical-padding: 0;
|
||||
}
|
||||
`,
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user