mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-17 15:06:02 +01:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user