phonograph/components/src/sel-item.ts
2025-07-08 14:37:03 -07:00

28 lines
750 B
TypeScript

import { html, LitElement } from "lit";
import { customElement, property } from "lit/decorators.js";
@customElement("sel-item")
export class SelItem extends LitElement {
@property({ attribute: "display-type", type: Object, reflect: true })
displayType?: unknown;
@property({ attribute: true, type: Boolean, reflect: true })
visible!: boolean;
@property({ attribute: true, type: String, reflect: true })
label?: string;
private _handleDelete() {
this.dispatchEvent(
new Event("sel-item-deleted", { bubbles: true, composed: true }),
);
}
protected override render() {
return html`
<div class="sel-item">
<button class="remove" @click="${this._handleDelete}">del</button>
</div>
`;
}
}