diff --git a/gallery/src/pages/components/ha-selector.ts b/gallery/src/pages/components/ha-selector.ts index 972c7d7f26..6ce04e0995 100644 --- a/gallery/src/pages/components/ha-selector.ts +++ b/gallery/src/pages/components/ha-selector.ts @@ -170,6 +170,7 @@ const SCHEMAS: { select: { options: ["Option 1", "Option 2"], mode: "list" }, }, }, + template: { name: "Template", selector: { template: {} } }, select: { name: "Select", selector: { diff --git a/src/components/ha-selector/ha-selector-template.ts b/src/components/ha-selector/ha-selector-template.ts new file mode 100644 index 0000000000..1140ec83a7 --- /dev/null +++ b/src/components/ha-selector/ha-selector-template.ts @@ -0,0 +1,56 @@ +import { html, LitElement } from "lit"; +import { customElement, property } from "lit/decorators"; +import { fireEvent } from "../../common/dom/fire_event"; +import { HomeAssistant } from "../../types"; +import "../ha-code-editor"; +import "../ha-input-helper-text"; + +@customElement("ha-selector-template") +export class HaTemplateSelector extends LitElement { + @property() public hass!: HomeAssistant; + + @property() public value?: string; + + @property() public label?: string; + + @property() public helper?: string; + + @property({ type: Boolean }) public disabled = false; + + @property({ type: Boolean }) public required = true; + + protected render() { + return html` + ${this.label + ? html`
${this.label}${this.required ? " *" : ""}
` + : ""} +