Add min/max support for prompt dialog (e.g. used for card moving) (#17085)

This commit is contained in:
Philip Allgaier 2023-06-29 09:40:55 +02:00 committed by GitHub
parent fc86c82540
commit 82cc667012
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 0 deletions

View File

@ -81,6 +81,8 @@ class DialogBox extends LitElement {
.type=${this._params.inputType
? this._params.inputType
: "text"}
.min=${this._params.inputMin}
.max=${this._params.inputMax}
></ha-textfield>
`
: ""}

View File

@ -26,6 +26,8 @@ export interface PromptDialogParams extends BaseDialogBoxParams {
placeholder?: string;
confirm?: (out?: string) => void;
cancel?: () => void;
inputMin?: number | string;
inputMax?: number | string;
}
export interface DialogBoxParams

View File

@ -288,6 +288,7 @@ export class HuiCardOptions extends LitElement {
"ui.panel.lovelace.editor.change_position.text"
),
inputType: "number",
inputMin: "1",
placeholder: String(path[1] + 1),
});