mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Add min/max support for prompt dialog (e.g. used for card moving) (#17085)
This commit is contained in:
parent
fc86c82540
commit
82cc667012
@ -81,6 +81,8 @@ class DialogBox extends LitElement {
|
|||||||
.type=${this._params.inputType
|
.type=${this._params.inputType
|
||||||
? this._params.inputType
|
? this._params.inputType
|
||||||
: "text"}
|
: "text"}
|
||||||
|
.min=${this._params.inputMin}
|
||||||
|
.max=${this._params.inputMax}
|
||||||
></ha-textfield>
|
></ha-textfield>
|
||||||
`
|
`
|
||||||
: ""}
|
: ""}
|
||||||
|
@ -26,6 +26,8 @@ export interface PromptDialogParams extends BaseDialogBoxParams {
|
|||||||
placeholder?: string;
|
placeholder?: string;
|
||||||
confirm?: (out?: string) => void;
|
confirm?: (out?: string) => void;
|
||||||
cancel?: () => void;
|
cancel?: () => void;
|
||||||
|
inputMin?: number | string;
|
||||||
|
inputMax?: number | string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DialogBoxParams
|
export interface DialogBoxParams
|
||||||
|
@ -288,6 +288,7 @@ export class HuiCardOptions extends LitElement {
|
|||||||
"ui.panel.lovelace.editor.change_position.text"
|
"ui.panel.lovelace.editor.change_position.text"
|
||||||
),
|
),
|
||||||
inputType: "number",
|
inputType: "number",
|
||||||
|
inputMin: "1",
|
||||||
placeholder: String(path[1] + 1),
|
placeholder: String(path[1] + 1),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user