mirror of
https://github.com/home-assistant/frontend.git
synced 2025-04-27 14:57:20 +00:00

* Allow rendering helper text from strings.json * Persistent helpers * Update src/components/ha-base-time-input.ts Co-authored-by: Zack Barett <zackbarett@hey.com> * Update src/components/ha-base-time-input.ts Co-authored-by: Zack Barett <zackbarett@hey.com>
41 lines
1020 B
TypeScript
41 lines
1020 B
TypeScript
import { html, LitElement } from "lit";
|
|
import { customElement, property } from "lit/decorators";
|
|
import type { DurationSelector } from "../../data/selector";
|
|
import type { HomeAssistant } from "../../types";
|
|
import "../ha-duration-input";
|
|
|
|
@customElement("ha-selector-duration")
|
|
export class HaTimeDuration extends LitElement {
|
|
@property() public hass!: HomeAssistant;
|
|
|
|
@property() public selector!: DurationSelector;
|
|
|
|
@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`
|
|
<ha-duration-input
|
|
.label=${this.label}
|
|
.helper=${this.helper}
|
|
.data=${this.value}
|
|
.disabled=${this.disabled}
|
|
.required=${this.required}
|
|
></ha-duration-input>
|
|
`;
|
|
}
|
|
}
|
|
|
|
declare global {
|
|
interface HTMLElementTagNameMap {
|
|
"ha-selector-duration": HaTimeDuration;
|
|
}
|
|
}
|