Initial move

This commit is contained in:
2024-09-03 14:50:33 +02:00
parent adb6be0006
commit 9fa656ed5e
138 changed files with 13117 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
import { UINode } from "./node";
export class ListItem extends UINode {
private listElement: HTMLLIElement;
public constructor(title: string) {
super(title);
this.listElement = document.createElement("li");
this.listElement.innerText = this.title;
this.listElement.setAttribute("tabindex", "-1");
this.element.appendChild(this.listElement);
this.listElement.setAttribute("aria-label", this.title);
this.listElement.setAttribute("role", "option");
}
public focus() {
this.listElement.focus();
return this;
}
public click() {
this.listElement.click();
return this;
}
public getElement(): HTMLElement {
return this.listElement;
}
public setText(text: string) {
this.title = text;
this.listElement.innerText = text;
this.element.setAttribute("aria-label", this.title);
this.listElement.setAttribute("aria-label", this.title);
return this;
}
}