Added select create input element
This commit is contained in:
parent
20dee90f75
commit
32d2b444bf
|
|
@ -5,6 +5,8 @@ import {
|
|||
NumberInputProps,
|
||||
PasswordInput,
|
||||
PasswordInputProps,
|
||||
Select,
|
||||
SelectProps,
|
||||
TextInput,
|
||||
TextInputProps,
|
||||
} from "@mantine/core";
|
||||
|
|
@ -30,6 +32,10 @@ type NumberInputType = {
|
|||
type: "number";
|
||||
} & Omit<NumberInputProps, "type">;
|
||||
|
||||
type SelectType = {
|
||||
type: "select";
|
||||
} & SelectProps;
|
||||
|
||||
interface Options {
|
||||
disableAll?: boolean;
|
||||
readonlyAll?: boolean;
|
||||
|
|
@ -38,6 +44,7 @@ interface Options {
|
|||
| MultiSelectInputType
|
||||
| PasswordInputType
|
||||
| NumberInputType
|
||||
| SelectType
|
||||
) &
|
||||
GeneralInputProps)[];
|
||||
}
|
||||
|
|
@ -86,6 +93,14 @@ function createInputComponents(options: Options) {
|
|||
/>
|
||||
);
|
||||
break;
|
||||
case "select":
|
||||
components.push(
|
||||
<Select
|
||||
{...input}
|
||||
readOnly={options.readonlyAll || input.readOnly}
|
||||
disabled={options.disableAll || input.disabled}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user