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:
@ -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>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user