refactor(web/dialog): split interfaces (#68)

* tweak(interface/menu): SetNuiFocusKeepInput

Default to allow input; disable with "disableInput = false" during registration.

* refactor(web/dialog): Split interfaces

for better typing of row options for different input types

* fix(web/dialog): Use proper type for onChange event

Co-authored-by: Linden <65407488+thelindat@users.noreply.github.com>
This commit is contained in:
ANTOND
2022-08-09 23:50:14 +02:00
committed by GitHub
parent de8fb447a9
commit cb5dac6151
6 changed files with 48 additions and 32 deletions

View File

@@ -1,14 +1,30 @@
import { IconProp } from "@fortawesome/fontawesome-svg-core";
type RowType = "input" | "checkbox" | "select" | "number";
export interface Row {
type: RowType;
export interface IInput {
type: "input",
label: string;
placeholder?: string;
default?: string | number;
checked?: boolean;
options?: { value: string; label?: string }[];
default?: string;
password?: boolean;
icon?: IconProp;
}
export interface ICheckbox {
type: "checkbox",
label: string;
checked?: boolean;
}
export interface ISelect {
type: "select",
label: string;
default?: string;
options?: { value: string; label?: string }[];
}
export interface INumber {
type: "number",
label: string;
placeholder?: string;
default?: number;
}