import { html, LitElement } from "lit"; import { customElement, property } from "lit/decorators.js"; @customElement("setting-number") export class SettingNumber extends LitElement { @property() label = "Setting"; @property() description = ""; @property({ type: Number }) value = 0; @property({ type: Number }) min = 0; @property({ type: Number }) max = 100; @property({ type: Boolean }) easter = false; createRenderRoot() { return this; } private handleInput(e: Event) { const input = e.target as HTMLInputElement; const newValue = Number(input.value); this.value = newValue; this.dispatchEvent( new CustomEvent("change", { bubbles: true, composed: true, detail: { value: newValue }, }), ); } render() { return html`
${this.description}
`; } }