feat(web/input): multi-select row

This commit is contained in:
Luke
2023-01-15 11:54:15 +01:00
parent 8c4d770e46
commit 779ed8dd07
3 changed files with 45 additions and 20 deletions

View File

@@ -73,7 +73,7 @@ const InputDialog: React.FC = () => {
} || { value: null }
);
// Backwards compat with new Select data type
if (row.type === 'select') {
if (row.type === 'select' || row.type === 'multi-select') {
row.options = row.options.map((option) =>
!option.label ? { ...option, label: option.value } : option
) as Array<OptionValue>;
@@ -140,7 +140,9 @@ const InputDialog: React.FC = () => {
index={index}
/>
)}
{row.type === 'select' && <SelectField row={row} index={index} control={form.control} />}
{(row.type === 'select' || row.type === 'multi-select') && (
<SelectField row={row} index={index} control={form.control} />
)}
{row.type === 'number' && <NumberField control={form.control} row={row} index={index} />}
{row.type === 'slider' && <SliderField control={form.control} row={row} index={index} />}
{row.type === 'color' && <ColorField control={form.control} row={row} index={index} />}