mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-19 06:10:31 +00:00
feat: filter sellable and purchasable items.
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import React, { useCallback, useMemo } from 'react';
|
||||
import { MenuItem, Button } from '@blueprintjs/core';
|
||||
import { MenuItem } from '@blueprintjs/core';
|
||||
import classNames from 'classnames';
|
||||
import { CLASSES } from 'common/classes';
|
||||
import ListSelect from 'components/ListSelect';
|
||||
import { FormattedMessage as T } from 'react-intl';
|
||||
|
||||
@@ -9,6 +11,7 @@ export default function ContactsListField({
|
||||
selectedContactId,
|
||||
selectedContactType,
|
||||
defautlSelectText = <T id={'select_contact'} />,
|
||||
popoverFill = false,
|
||||
}) {
|
||||
// Contact item of select accounts field.
|
||||
const contactRenderer = useCallback(
|
||||
@@ -39,13 +42,16 @@ export default function ContactsListField({
|
||||
items={items}
|
||||
noResults={<MenuItem disabled={true} text="No results." />}
|
||||
itemRenderer={contactRenderer}
|
||||
popoverProps={{ minimal: true }}
|
||||
filterable={true}
|
||||
onItemSelect={onContactSelect}
|
||||
labelProp={'display_name'}
|
||||
selectedItem={`${selectedContactId}_${selectedContactType}`}
|
||||
selectedItemProp={'_id'}
|
||||
defaultText={defautlSelectText}
|
||||
popoverProps={{ minimal: true, usePortal: !popoverFill }}
|
||||
className={classNames(CLASSES.FORM_GROUP_LIST_SELECT, {
|
||||
[CLASSES.SELECT_LIST_FILL_POPOVER]: popoverFill,
|
||||
})}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user