Added textarea element

This commit is contained in:
sianida26 2024-05-18 02:15:09 +07:00
parent cbfe485490
commit 127e2679e9

View File

@ -15,6 +15,8 @@ import {
SelectProps, SelectProps,
TextInput, TextInput,
TextInputProps, TextInputProps,
Textarea,
TextareaProps,
} from "@mantine/core"; } from "@mantine/core";
import { ReactNode } from "@tanstack/react-router"; import { ReactNode } from "@tanstack/react-router";
@ -55,6 +57,10 @@ type CheckboxType = {
type: "checkbox"; type: "checkbox";
} & CheckboxProps; } & CheckboxProps;
type TextareaType = {
type: "textarea";
} & TextareaProps;
type AcceptedInput = ( type AcceptedInput = (
| TextInputType | TextInputType
| MultiSelectInputType | MultiSelectInputType
@ -64,6 +70,7 @@ type AcceptedInput = (
| ChipType | ChipType
| Group | Group
| CheckboxType | CheckboxType
| TextareaType
) & ) &
GeneralInputProps; GeneralInputProps;
@ -152,6 +159,16 @@ function createInputComponents(options: Options) {
/> />
); );
} }
case "textarea": {
return (
<Textarea
{...input}
readOnly={options.readonlyAll || input.readOnly}
disabled={options.disableAll || input.disabled}
/>
);
}
} }
}; };