mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 13:46:45 +00:00
feat(client): allow search by title in collection select (#1869)
This commit is contained in:
parent
29956150ba
commit
0eb1c31514
@ -35,7 +35,7 @@ export const expression: ICollectionTemplate = {
|
|||||||
title: '{{t("Collection")}}',
|
title: '{{t("Collection")}}',
|
||||||
'x-component': 'CollectionSelect',
|
'x-component': 'CollectionSelect',
|
||||||
'x-component-props': {
|
'x-component-props': {
|
||||||
multiple: true,
|
// multiple: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -28,7 +28,15 @@ export const CollectionSelect = connect(
|
|||||||
const options = useOptions(props);
|
const options = useOptions(props);
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
return <Select placeholder={t('Select collection')} {...others} options={options} />;
|
return (
|
||||||
|
<Select
|
||||||
|
placeholder={t('Select collection')}
|
||||||
|
{...others}
|
||||||
|
showSearch
|
||||||
|
filterOption={(input, option) => (option?.label ?? '').includes(input)}
|
||||||
|
options={options}
|
||||||
|
/>
|
||||||
|
);
|
||||||
},
|
},
|
||||||
mapReadPretty(
|
mapReadPretty(
|
||||||
observer((props: CollectionSelectProps) => {
|
observer((props: CollectionSelectProps) => {
|
||||||
|
@ -7,12 +7,11 @@ export const collection = {
|
|||||||
type: 'string',
|
type: 'string',
|
||||||
title: '{{t("Collection")}}',
|
title: '{{t("Collection")}}',
|
||||||
required: true,
|
required: true,
|
||||||
'x-reactions': ['{{useCollectionDataSource()}}'],
|
'x-reactions': [],
|
||||||
'x-decorator': 'FormItem',
|
'x-decorator': 'FormItem',
|
||||||
'x-component': 'Select',
|
'x-component': 'CollectionSelect',
|
||||||
'x-component-props': {
|
'x-component-props': {
|
||||||
dropdownMatchSelectWidth: false,
|
dropdownMatchSelectWidth: false,
|
||||||
placeholder: '{{t("Select collection")}}',
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user