mirror of
https://github.com/home-assistant/frontend.git
synced 2025-12-24 04:39:01 +00:00
Add prefix support to text selector (#17335)
This commit is contained in:
@@ -65,6 +65,7 @@ export class HaTextSelector extends LitElement {
|
|||||||
.type=${this._unmaskedPassword ? "text" : this.selector.text?.type}
|
.type=${this._unmaskedPassword ? "text" : this.selector.text?.type}
|
||||||
@input=${this._handleChange}
|
@input=${this._handleChange}
|
||||||
.label=${this.label || ""}
|
.label=${this.label || ""}
|
||||||
|
.prefix=${this.selector.text?.prefix}
|
||||||
.suffix=${this.selector.text?.type === "password"
|
.suffix=${this.selector.text?.type === "password"
|
||||||
? // reserve some space for the icon.
|
? // reserve some space for the icon.
|
||||||
html`<div style="width: 24px"></div>`
|
html`<div style="width: 24px"></div>`
|
||||||
|
|||||||
@@ -329,6 +329,7 @@ export interface StringSelector {
|
|||||||
| "time"
|
| "time"
|
||||||
| "datetime-local"
|
| "datetime-local"
|
||||||
| "color";
|
| "color";
|
||||||
|
prefix?: string;
|
||||||
suffix?: string;
|
suffix?: string;
|
||||||
autocomplete?: string;
|
autocomplete?: string;
|
||||||
} | null;
|
} | null;
|
||||||
|
|||||||
@@ -122,7 +122,9 @@ export class HaScriptEditor extends KeyboardShortcutMixin(LitElement) {
|
|||||||
{
|
{
|
||||||
name: "id",
|
name: "id",
|
||||||
selector: {
|
selector: {
|
||||||
text: {},
|
text: {
|
||||||
|
prefix: "script.",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
] as const)
|
] as const)
|
||||||
|
|||||||
Reference in New Issue
Block a user