perf: workflow&plugins json config import and export (#2592)

This commit is contained in:
papapatrick
2024-09-02 15:05:58 +08:00
committed by GitHub
parent 84de95d294
commit 036097243a
11 changed files with 302 additions and 71 deletions

View File

@@ -23,6 +23,7 @@ export type Props = {
trigger?: 'hover' | 'click';
iconSize?: string;
iconRadius?: string;
menuItemStyles?: MenuItemProps;
placement?: PlacementWithLogical;
menuList: {
label?: string;
@@ -45,7 +46,15 @@ const MyMenu = ({
Button,
menuList,
iconRadius,
placement = 'bottom-start'
placement = 'bottom-start',
menuItemStyles = {
borderRadius: 'sm',
py: 2,
px: 3,
display: 'flex',
alignItems: 'center',
fontSize: 'sm'
}
}: Props) => {
const typeMapStyle: Record<MenuItemType, MenuItemProps> = {
primary: {
@@ -75,14 +84,6 @@ const MyMenu = ({
}
}
};
const menuItemStyles: MenuItemProps = {
borderRadius: 'sm',
py: 2,
px: 3,
display: 'flex',
alignItems: 'center',
fontSize: 'sm'
};
const { isPc } = useSystem();
const ref = useRef<HTMLDivElement>(null);
@@ -167,7 +168,7 @@ const MyMenu = ({
<MenuItem
key={index}
{...menuItemStyles}
onClickCapture={(e) => {
onClick={(e) => {
e.stopPropagation();
setIsOpen(false);
child.onClick && child.onClick();
@@ -185,12 +186,16 @@ const MyMenu = ({
mr={3}
/>
)}
<Box>
<Box color={child.description ? 'myGray.900' : 'inherit'} fontSize={'sm'}>
<Box w={'100%'}>
<Box
w={'100%'}
color={child.description ? 'myGray.900' : 'inherit'}
fontSize={'sm'}
>
{child.label}
</Box>
{child.description && (
<Box color={'myGray.500'} fontSize={'mini'}>
<Box color={'myGray.500'} fontSize={'mini'} w={'100%'}>
{child.description}
</Box>
)}