Added checkbox element

This commit is contained in:
sianida26 2024-05-17 18:37:26 +07:00
parent 277391766d
commit cbfe485490

View File

@ -1,4 +1,6 @@
import {
Checkbox,
CheckboxProps,
Chip,
ChipProps,
Fieldset,
@ -49,6 +51,10 @@ type ChipType = {
type: "chip";
} & Omit<ChipProps, "type">;
type CheckboxType = {
type: "checkbox";
} & CheckboxProps;
type AcceptedInput = (
| TextInputType
| MultiSelectInputType
@ -57,6 +63,7 @@ type AcceptedInput = (
| SelectType
| ChipType
| Group
| CheckboxType
) &
GeneralInputProps;
@ -135,6 +142,16 @@ function createInputComponents(options: Options) {
/>
);
}
case "checkbox": {
return (
<Checkbox
{...input}
readOnly={options.readonlyAll || input.readOnly}
disabled={options.disableAll || input.disabled}
/>
);
}
}
};