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