Select Field Input Menu scrollable and add Select Field in Filter and Sort (#3656)

* - fix Select Option Menu scrollable and added search

- add select field in filter and sort operation

* Fix lint

* Fix post merge

* Fix select filter

* Fix

* Remove duplicated search input

* fix turn object into query

* Rename search inputs

* Remove debounced for options

* Simplify option filter

* Rename option to MenuItemSelectTag

* Fix test

* Infer type from field metadata item

---------

Co-authored-by: Charles Bochet <charles@twenty.com>
Co-authored-by: Thomas Trompette <thomast@twenty.com>
This commit is contained in:
Arshil Vahora
2024-03-05 22:11:41 +05:30
committed by GitHub
parent 0b889ef089
commit 6bb7042a68
22 changed files with 367 additions and 27 deletions

View File

@ -0,0 +1,40 @@
import { useTheme } from '@emotion/react';
import { Tag } from 'tsup.ui.index';
import { IconCheck } from '@/ui/display/icon';
import { ThemeColor } from '@/ui/theme/constants/MainColorNames';
import { StyledMenuItemLeftContent } from '../internals/components/StyledMenuItemBase';
import { StyledMenuItemSelect } from './MenuItemSelect';
type MenuItemSelectTagProps = {
selected: boolean;
className?: string;
onClick?: () => void;
color: ThemeColor;
text: string;
};
export const MenuItemSelectTag = ({
color,
selected,
className,
onClick,
text,
}: MenuItemSelectTagProps) => {
const theme = useTheme();
return (
<StyledMenuItemSelect
onClick={onClick}
className={className}
selected={selected}
>
<StyledMenuItemLeftContent>
<Tag color={color} text={text} />
</StyledMenuItemLeftContent>
{selected && <IconCheck size={theme.icon.size.sm} />}
</StyledMenuItemSelect>
);
};