addTask skeleton

This commit is contained in:
Ian Gulliver
2024-12-22 10:23:37 -08:00
parent 721b382e63
commit 3ac8302f11
21 changed files with 381 additions and 99 deletions

39
ts/slinput.ts Normal file
View File

@@ -0,0 +1,39 @@
import { SLElem } from "./slelem";
import { SLIcon } from "./slicon";
export class SLInput extends SLElem {
constructor() {
super("sl-input");
}
public addIcon(name: string, slot: "prefix" | "suffix"): SLIcon {
const icon = new SLIcon(name);
icon.setSlot(slot);
this.append(icon);
return icon;
}
public addPrefixIcon(name: string): SLIcon {
return this.addIcon(name, "prefix");
}
public addSuffixIcon(name: string): SLIcon {
return this.addIcon(name, "suffix");
}
public clear() {
(this.elem as HTMLInputElement).value = "";
}
public getValue(): string {
return (this.elem as HTMLInputElement).value;
}
public focus() {
(this.elem as HTMLInputElement).focus();
}
public setPill() {
this.setAttribute("pill", "");
}
}