mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 19:26:36 +00:00
Fix combobox helper (#25834)
* Fix combobox helper * Pass disabled to all helpers
This commit is contained in:
parent
b4dbfa6f70
commit
cf03e041a8
@ -271,7 +271,9 @@ export class HaBaseTimeInput extends LitElement {
|
|||||||
</ha-select>`}
|
</ha-select>`}
|
||||||
</div>
|
</div>
|
||||||
${this.helper
|
${this.helper
|
||||||
? html`<ha-input-helper-text>${this.helper}</ha-input-helper-text>`
|
? html`<ha-input-helper-text .disabled=${this.disabled}
|
||||||
|
>${this.helper}</ha-input-helper-text
|
||||||
|
>`
|
||||||
: nothing}
|
: nothing}
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,7 @@ import type { HomeAssistant } from "../types";
|
|||||||
import "./ha-combo-box-item";
|
import "./ha-combo-box-item";
|
||||||
import "./ha-combo-box-textfield";
|
import "./ha-combo-box-textfield";
|
||||||
import "./ha-icon-button";
|
import "./ha-icon-button";
|
||||||
|
import "./ha-input-helper-text";
|
||||||
import "./ha-textfield";
|
import "./ha-textfield";
|
||||||
import type { HaTextField } from "./ha-textfield";
|
import type { HaTextField } from "./ha-textfield";
|
||||||
|
|
||||||
@ -195,8 +196,6 @@ export class HaComboBox extends LitElement {
|
|||||||
></div>`}
|
></div>`}
|
||||||
.icon=${this.icon}
|
.icon=${this.icon}
|
||||||
.invalid=${this.invalid}
|
.invalid=${this.invalid}
|
||||||
.helper=${this.helper}
|
|
||||||
helperPersistent
|
|
||||||
.disableSetValue=${this._disableSetValue}
|
.disableSetValue=${this._disableSetValue}
|
||||||
>
|
>
|
||||||
<slot name="icon" slot="leadingIcon"></slot>
|
<slot name="icon" slot="leadingIcon"></slot>
|
||||||
@ -222,9 +221,18 @@ export class HaComboBox extends LitElement {
|
|||||||
@click=${this._toggleOpen}
|
@click=${this._toggleOpen}
|
||||||
></ha-svg-icon>
|
></ha-svg-icon>
|
||||||
</vaadin-combo-box-light>
|
</vaadin-combo-box-light>
|
||||||
|
${this._renderHelper()}
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private _renderHelper() {
|
||||||
|
return this.helper
|
||||||
|
? html`<ha-input-helper-text .disabled=${this.disabled}
|
||||||
|
>${this.helper}</ha-input-helper-text
|
||||||
|
>`
|
||||||
|
: "";
|
||||||
|
}
|
||||||
|
|
||||||
private _defaultRowRenderer: ComboBoxLitRenderer<
|
private _defaultRowRenderer: ComboBoxLitRenderer<
|
||||||
string | Record<string, any>
|
string | Record<string, any>
|
||||||
> = (item) => html`
|
> = (item) => html`
|
||||||
@ -398,6 +406,9 @@ export class HaComboBox extends LitElement {
|
|||||||
inset-inline-end: 36px;
|
inset-inline-end: 36px;
|
||||||
direction: var(--direction);
|
direction: var(--direction);
|
||||||
}
|
}
|
||||||
|
ha-input-helper-text {
|
||||||
|
margin-top: 4px;
|
||||||
|
}
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +71,9 @@ export class HaFormInteger extends LitElement implements HaFormElement {
|
|||||||
></ha-slider>
|
></ha-slider>
|
||||||
</div>
|
</div>
|
||||||
${this.helper
|
${this.helper
|
||||||
? html`<ha-input-helper-text>${this.helper}</ha-input-helper-text>`
|
? html`<ha-input-helper-text .disabled=${this.disabled}
|
||||||
|
>${this.helper}</ha-input-helper-text
|
||||||
|
>`
|
||||||
: ""}
|
: ""}
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
@ -19,6 +19,11 @@ class InputHelperText extends LitElement {
|
|||||||
padding-right: 16px;
|
padding-right: 16px;
|
||||||
padding-inline-start: 16px;
|
padding-inline-start: 16px;
|
||||||
padding-inline-end: 16px;
|
padding-inline-end: 16px;
|
||||||
|
letter-spacing: var(
|
||||||
|
--mdc-typography-caption-letter-spacing,
|
||||||
|
0.0333333333em
|
||||||
|
);
|
||||||
|
line-height: normal;
|
||||||
}
|
}
|
||||||
:host([disabled]) {
|
:host([disabled]) {
|
||||||
color: var(--mdc-text-field-disabled-ink-color, rgba(0, 0, 0, 0.6));
|
color: var(--mdc-text-field-disabled-ink-color, rgba(0, 0, 0, 0.6));
|
||||||
|
@ -47,7 +47,9 @@ class HaLabeledSlider extends LitElement {
|
|||||||
></ha-slider>
|
></ha-slider>
|
||||||
</div>
|
</div>
|
||||||
${this.helper
|
${this.helper
|
||||||
? html`<ha-input-helper-text> ${this.helper} </ha-input-helper-text>`
|
? html`<ha-input-helper-text .disabled=${this.disabled}>
|
||||||
|
${this.helper}
|
||||||
|
</ha-input-helper-text>`
|
||||||
: nothing}
|
: nothing}
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
@ -54,7 +54,9 @@ export class HaDateTimeSelector extends LitElement {
|
|||||||
></ha-time-input>
|
></ha-time-input>
|
||||||
</div>
|
</div>
|
||||||
${this.helper
|
${this.helper
|
||||||
? html`<ha-input-helper-text>${this.helper}</ha-input-helper-text>`
|
? html`<ha-input-helper-text .disabled=${this.disabled}
|
||||||
|
>${this.helper}</ha-input-helper-text
|
||||||
|
>`
|
||||||
: ""}
|
: ""}
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
@ -106,7 +106,9 @@ export class HaNumberSelector extends LitElement {
|
|||||||
</ha-textfield>
|
</ha-textfield>
|
||||||
</div>
|
</div>
|
||||||
${!isBox && this.helper
|
${!isBox && this.helper
|
||||||
? html`<ha-input-helper-text>${this.helper}</ha-input-helper-text>`
|
? html`<ha-input-helper-text .disabled=${this.disabled}
|
||||||
|
>${this.helper}</ha-input-helper-text
|
||||||
|
>`
|
||||||
: nothing}
|
: nothing}
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
@ -38,7 +38,9 @@ export class HaObjectSelector extends LitElement {
|
|||||||
@value-changed=${this._handleChange}
|
@value-changed=${this._handleChange}
|
||||||
></ha-yaml-editor>
|
></ha-yaml-editor>
|
||||||
${this.helper
|
${this.helper
|
||||||
? html`<ha-input-helper-text>${this.helper}</ha-input-helper-text>`
|
? html`<ha-input-helper-text .disabled=${this.disabled}
|
||||||
|
>${this.helper}</ha-input-helper-text
|
||||||
|
>`
|
||||||
: ""} `;
|
: ""} `;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -285,7 +285,9 @@ export class HaSelectSelector extends LitElement {
|
|||||||
|
|
||||||
private _renderHelper() {
|
private _renderHelper() {
|
||||||
return this.helper
|
return this.helper
|
||||||
? html`<ha-input-helper-text>${this.helper}</ha-input-helper-text>`
|
? html`<ha-input-helper-text .disabled=${this.disabled}
|
||||||
|
>${this.helper}</ha-input-helper-text
|
||||||
|
>`
|
||||||
: "";
|
: "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,7 +63,9 @@ export class HaTemplateSelector extends LitElement {
|
|||||||
linewrap
|
linewrap
|
||||||
></ha-code-editor>
|
></ha-code-editor>
|
||||||
${this.helper
|
${this.helper
|
||||||
? html`<ha-input-helper-text>${this.helper}</ha-input-helper-text>`
|
? html`<ha-input-helper-text .disabled=${this.disabled}
|
||||||
|
>${this.helper}</ha-input-helper-text
|
||||||
|
>`
|
||||||
: nothing}
|
: nothing}
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
@ -289,7 +289,9 @@ export class HaTargetPicker extends SubscribeMixin(LitElement) {
|
|||||||
${this._renderPicker()}
|
${this._renderPicker()}
|
||||||
</div>
|
</div>
|
||||||
${this.helper
|
${this.helper
|
||||||
? html`<ha-input-helper-text>${this.helper}</ha-input-helper-text>`
|
? html`<ha-input-helper-text .disabled=${this.disabled}
|
||||||
|
>${this.helper}</ha-input-helper-text
|
||||||
|
>`
|
||||||
: ""}
|
: ""}
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user