@bytebrand/fe-ui-core 4.1.56 → 4.1.58

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bytebrand/fe-ui-core",
3
- "version": "4.1.56",
3
+ "version": "4.1.58",
4
4
  "description": "UI components for the auto.de project",
5
5
  "main": "index.ts",
6
6
  "module": "dist/common.js",
@@ -46,8 +46,7 @@
46
46
  font-weight: 700
47
47
 
48
48
  .sorting
49
- flex-basis: 20%
50
- min-width: 140px
49
+ min-width: 180px;
51
50
  [class*='MuiPaper-root'], [class*='MuiOutlinedInput-root']
52
51
  font-size: 14px !important
53
52
 
@@ -61,6 +61,10 @@ export const AmountBlock = styled('span')({
61
61
  fontWeight: 'bold'
62
62
  });
63
63
 
64
+ export const HeaderComponent = styled('div')({
65
+ cursor: 'pointer'
66
+ });
67
+
64
68
  export const FlexContainer = styled('div')({
65
69
  display: 'flex'
66
70
  });
@@ -2,7 +2,7 @@ import React, { useState, useRef } from 'react';
2
2
  import Menu from '@mui/material/Menu';
3
3
  import ListItem from './MaterialMenuItem';
4
4
  import { ThemeProvider } from '@mui/material/styles';
5
- import { Theme, FlexContainer } from './MaterialMenu.styled';
5
+ import { Theme, FlexContainer, HeaderComponent } from './MaterialMenu.styled';
6
6
  import IconSVG from '../IconSVG/IconSVG';
7
7
 
8
8
  export interface ILoggedInUserInfoProps {
@@ -36,29 +36,29 @@ const MaterialMenu = ({ menuItems, headerComponent, onChange, isLang, containerC
36
36
  }
37
37
  };
38
38
 
39
- const containerRef = useRef(null);
40
-
41
39
  return (
42
40
  <ThemeProvider theme={Theme}>
43
- <div className={containerClassname} ref={containerRef} onClick={handleClick} onMouseEnter={handleClick}>
44
- {headerComponent && headerComponent}
45
- {(isLang && !!value) &&
46
- <FlexContainer>
47
- <IconSVG
48
- customDimensions
49
- width='42px'
50
- height='27px'
51
- name={`new_lang_${value}`}
52
- />
53
- </FlexContainer>
54
- }
41
+ <div className={containerClassname}>
42
+ <HeaderComponent
43
+ onClick={handleClick}
44
+ >
45
+ {headerComponent && headerComponent}
46
+ {(isLang && !!value) &&
47
+ <FlexContainer>
48
+ <IconSVG
49
+ customDimensions
50
+ width='42px'
51
+ height='27px'
52
+ name={`new_lang_${value}`}
53
+ />
54
+ </FlexContainer>
55
+ }
56
+ </HeaderComponent>
55
57
  <Menu
56
58
  anchorEl={anchorEl}
57
59
  open={open}
58
60
  onClose={handleClose}
59
- onClick={handleClose}
60
61
  PaperProps={{
61
- onMouseLeave: handleClose,
62
62
  elevation: 0
63
63
  }}
64
64
  transformOrigin={{ horizontal: 'right', vertical: 'top' }}
@@ -69,7 +69,10 @@ const MaterialMenu = ({ menuItems, headerComponent, onChange, isLang, containerC
69
69
  <ListItem
70
70
  key={listItemProps.text}
71
71
  selected={index === selectedIndex}
72
- onClick={() => onHandleChange(listItemProps.value, index)}
72
+ onClick={() => {
73
+ onHandleChange(listItemProps.value, index);
74
+ handleClose();
75
+ }}
73
76
  isSelect={isSelect}
74
77
  Link={Link}
75
78
  { ...listItemProps }