Added create chip element
This commit is contained in:
parent
1184a44c57
commit
277391766d
|
|
@ -1,4 +1,6 @@
|
|||
import {
|
||||
Chip,
|
||||
ChipProps,
|
||||
Fieldset,
|
||||
FieldsetProps,
|
||||
MultiSelect,
|
||||
|
|
@ -43,12 +45,17 @@ type Group = {
|
|||
inputs: AcceptedInput[];
|
||||
} & FieldsetProps;
|
||||
|
||||
type ChipType = {
|
||||
type: "chip";
|
||||
} & Omit<ChipProps, "type">;
|
||||
|
||||
type AcceptedInput = (
|
||||
| TextInputType
|
||||
| MultiSelectInputType
|
||||
| PasswordInputType
|
||||
| NumberInputType
|
||||
| SelectType
|
||||
| ChipType
|
||||
| Group
|
||||
) &
|
||||
GeneralInputProps;
|
||||
|
|
@ -117,6 +124,17 @@ function createInputComponents(options: Options) {
|
|||
|
||||
return <Fieldset {...input}>{localComponents}</Fieldset>;
|
||||
}
|
||||
|
||||
case "chip": {
|
||||
return (
|
||||
<Chip
|
||||
{...input}
|
||||
type="checkbox"
|
||||
readOnly={options.readonlyAll || input.readOnly}
|
||||
disabled={options.disableAll || input.disabled}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user