support search in Select
This commit is contained in:
1 parent
1898315095
commit
b071f735e4
1 file changed
+30
-16
@@ -600,18 +600,23 @@ const NodeInspector: FC = () => {
|
|||||||
)}
|
)}
|
||||||
{type === "enum" && (
|
{type === "enum" && (
|
||||||
<Select
|
<Select
|
||||||
|
showSearch
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
onBlur={form.submit}
|
onBlur={form.submit}
|
||||||
onChange={form.submit}
|
onChange={form.submit}
|
||||||
>
|
options={(arg.options ?? []).map((option) => {
|
||||||
{arg.options?.map((value, i) => {
|
return {
|
||||||
return (
|
value: option.value,
|
||||||
<Select.Option key={i} value={value.value}>
|
label: `${option.name}(${option.value})`,
|
||||||
{value.name}
|
};
|
||||||
</Select.Option>
|
|
||||||
);
|
|
||||||
})}
|
})}
|
||||||
</Select>
|
filterOption={(value, option) => {
|
||||||
|
value = value.toUpperCase();
|
||||||
|
return !!option?.label
|
||||||
|
.toLocaleUpperCase()
|
||||||
|
.includes(value.toUpperCase());
|
||||||
|
}}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
<MinusCircleOutlined
|
<MinusCircleOutlined
|
||||||
@@ -724,15 +729,24 @@ const NodeInspector: FC = () => {
|
|||||||
{type === "boolean" && <Switch disabled={disabled} onChange={form.submit} />}
|
{type === "boolean" && <Switch disabled={disabled} onChange={form.submit} />}
|
||||||
{type === "code" && <Input disabled={disabled} onBlur={form.submit} />}
|
{type === "code" && <Input disabled={disabled} onBlur={form.submit} />}
|
||||||
{type === "enum" && (
|
{type === "enum" && (
|
||||||
<Select disabled={disabled} onBlur={form.submit} onChange={form.submit}>
|
<Select
|
||||||
{arg.options?.map((value, index) => {
|
showSearch
|
||||||
return (
|
disabled={disabled}
|
||||||
<Select.Option key={index} value={value.value}>
|
onBlur={form.submit}
|
||||||
{value.name}
|
onChange={form.submit}
|
||||||
</Select.Option>
|
options={(arg.options ?? []).map((option) => {
|
||||||
);
|
return {
|
||||||
|
value: option.value,
|
||||||
|
label: `${option.name}(${option.value})`,
|
||||||
|
};
|
||||||
})}
|
})}
|
||||||
</Select>
|
filterOption={(value, option) => {
|
||||||
|
value = value.toUpperCase();
|
||||||
|
return !!option?.label
|
||||||
|
.toLocaleUpperCase()
|
||||||
|
.includes(value.toUpperCase());
|
||||||
|
}}
|
||||||
|
/>
|
||||||
)}
|
)}
|
||||||
</Form.Item>
|
</Form.Item>
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in new issue
Block a user