Files
ox_lib/package/client/resource/interface/input.ts
davidxd33 4f69c7c5c1 feat(interface/dialog): disabled row property (#142)
* feat(interface/dialog): readonly, disabled flags

* Update TS prop types

* refactor(web/input): remove read only property

Co-authored-by: davidxd33 <dponce@gmail.com>
2022-10-27 09:17:53 +02:00

26 lines
817 B
TypeScript

import { IconName, IconPrefix } from '@fortawesome/fontawesome-common-types';
interface InputDialogRowProps {
type: 'input' | 'number' | 'checkbox' | 'select' | 'slider';
label: string;
options?: { value: string; label: string; default?: string }[];
password?: boolean;
icon?: IconName | [IconPrefix, IconName];
iconColor?: string;
placeholder?: string;
default?: string | number;
disabled?: boolean;
checked?: boolean;
min?: number;
max?: number;
step?: number;
}
type inputDialog = (
heading: string,
rows: string[] | InputDialogRowProps[]
) => Promise<Array<string | number | boolean> | undefined>;
export const inputDialog: inputDialog = async (heading, rows) => await exports.ox_lib.inputDialog(heading, rows);
export const closeInputDialog = () => exports.ox_lib.inputDialog();