mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-19 15:26:36 +00:00
Only show "required" indicator if we have a selector label (#12241)
This commit is contained in:
parent
bbca7b762b
commit
cfa048ea4e
@ -131,7 +131,7 @@ export class HaBaseTimeInput extends LitElement {
|
|||||||
protected render(): TemplateResult {
|
protected render(): TemplateResult {
|
||||||
return html`
|
return html`
|
||||||
${this.label
|
${this.label
|
||||||
? html`<label>${this.label}${this.required ? "*" : ""}</label>`
|
? html`<label>${this.label}${this.required ? " *" : ""}</label>`
|
||||||
: ""}
|
: ""}
|
||||||
<div class="time-input-wrap">
|
<div class="time-input-wrap">
|
||||||
${this.enableDay
|
${this.enableDay
|
||||||
|
@ -53,7 +53,7 @@ class HaLabeledSlider extends PolymerElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_getTitle() {
|
_getTitle() {
|
||||||
return `${this.caption}${this.required ? "*" : ""}`;
|
return `${this.caption}${this.caption && this.required ? " *" : ""}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
static get properties() {
|
static get properties() {
|
||||||
|
@ -26,7 +26,7 @@ export class HaColorTempSelector extends LitElement {
|
|||||||
<ha-labeled-slider
|
<ha-labeled-slider
|
||||||
pin
|
pin
|
||||||
icon="hass:thermometer"
|
icon="hass:thermometer"
|
||||||
.caption=${this.label}
|
.caption=${this.label || ""}
|
||||||
.min=${this.selector.color_temp.min_mireds ?? 153}
|
.min=${this.selector.color_temp.min_mireds ?? 153}
|
||||||
.max=${this.selector.color_temp.max_mireds ?? 500}
|
.max=${this.selector.color_temp.max_mireds ?? 500}
|
||||||
.value=${this.value}
|
.value=${this.value}
|
||||||
|
@ -30,7 +30,7 @@ export class HaNumberSelector extends LitElement {
|
|||||||
const isBox = this.selector.number.mode === "box";
|
const isBox = this.selector.number.mode === "box";
|
||||||
|
|
||||||
return html`
|
return html`
|
||||||
${this.label}${this.required ? "*" : ""}
|
${this.label ? html`${this.label}${this.required ? " *" : ""}` : ""}
|
||||||
<div class="input">
|
<div class="input">
|
||||||
${!isBox
|
${!isBox
|
||||||
? html`<ha-slider
|
? html`<ha-slider
|
||||||
|
@ -61,7 +61,9 @@ export class HaYamlEditor extends LitElement {
|
|||||||
return html``;
|
return html``;
|
||||||
}
|
}
|
||||||
return html`
|
return html`
|
||||||
${this.label ? html`<p>${this.label}${this.required ? "*" : ""}</p>` : ""}
|
${this.label
|
||||||
|
? html`<p>${this.label}${this.required ? " *" : ""}</p>`
|
||||||
|
: ""}
|
||||||
<ha-code-editor
|
<ha-code-editor
|
||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
.value=${this._yaml}
|
.value=${this._yaml}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user