Files
frontend/src/components/ha-form/ha-form-constant.ts
Wendelin e703750136 Add and fix stylistic eslint rules (#23735)
* Fix stylistic eslint rules

* Fix eslint issues
2025-01-14 21:00:14 +01:00

33 lines
819 B
TypeScript

import type { TemplateResult } from "lit";
import { css, html, LitElement } from "lit";
import { customElement, property } from "lit/decorators";
import type { HaFormConstantSchema, HaFormElement } from "./types";
@customElement("ha-form-constant")
export class HaFormConstant extends LitElement implements HaFormElement {
@property({ attribute: false }) public schema!: HaFormConstantSchema;
@property() public label!: string;
protected render(): TemplateResult {
return html`<span class="label">${this.label}</span>${this.schema.value
? `: ${this.schema.value}`
: ""}`;
}
static styles = css`
:host {
display: block;
}
.label {
font-weight: 500;
}
`;
}
declare global {
interface HTMLElementTagNameMap {
"ha-form-constant": HaFormConstant;
}
}