Use SWC for typescript, update to Lit 3, migrate decorators (#25150)

Co-authored-by: Wendelin <w@pe8.at>
This commit is contained in:
Bram Kragten
2025-04-24 14:10:35 +02:00
committed by GitHub
parent c40bf8f3cd
commit e156dd36f4
241 changed files with 1676 additions and 1388 deletions

View File

@@ -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;
}
`,
];
}