@bytebrand/fe-ui-core 4.2.9 → 4.2.11
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
|
@@ -75,7 +75,7 @@ const MaterialMenu = ({ menuItems, headerComponent, onChange, isLang, containerC
|
|
|
75
75
|
{menuItems.map((listItemProps: any, index: number) => {
|
|
76
76
|
if (!!listItemProps && listItemProps.nestedItems && listItemProps.nestedItems.length > 0) {
|
|
77
77
|
return (
|
|
78
|
-
<NestedMenu {...listItemProps} />
|
|
78
|
+
<NestedMenu key={index} {...listItemProps} />
|
|
79
79
|
);
|
|
80
80
|
}
|
|
81
81
|
return !!listItemProps &&
|
|
@@ -10,15 +10,16 @@ interface IListItem {
|
|
|
10
10
|
label: any;
|
|
11
11
|
amount?: number;
|
|
12
12
|
divider?: boolean;
|
|
13
|
-
onClick?: () => void;
|
|
13
|
+
onClick?: (e: React.MouseEvent<HTMLSpanElement>) => void;
|
|
14
14
|
href?: string;
|
|
15
15
|
isComponent?: boolean;
|
|
16
16
|
isSelect?: boolean;
|
|
17
17
|
Link?: any;
|
|
18
18
|
handleClose?: () => void;
|
|
19
|
+
isActive?: boolean;
|
|
19
20
|
}
|
|
20
21
|
|
|
21
|
-
const ListItem = ({ icon, label, amount, divider, onClick, href, isComponent, Link, handleClose }: IListItem) => {
|
|
22
|
+
const ListItem = ({ icon, label, amount, divider, onClick, href, isComponent, Link, handleClose, isActive }: IListItem) => {
|
|
22
23
|
return !!href ? (
|
|
23
24
|
<Link color='#4C4E64DE' variant='caption' to={href} underline='none' onClick={onClick}>
|
|
24
25
|
<MenuItem
|
|
@@ -33,12 +34,13 @@ const ListItem = ({ icon, label, amount, divider, onClick, href, isComponent, Li
|
|
|
33
34
|
</Link>
|
|
34
35
|
) : (
|
|
35
36
|
<MenuItem
|
|
36
|
-
onClick={() => {
|
|
37
|
-
onClick();
|
|
37
|
+
onClick={(e: React.MouseEvent<HTMLSpanElement>) => {
|
|
38
|
+
onClick(e);
|
|
38
39
|
handleClose();
|
|
39
40
|
}}
|
|
40
41
|
divider={divider}
|
|
41
42
|
disableRipple={isComponent ? true : false}
|
|
43
|
+
isactive={!!isActive ? isActive.toString() : 'false'}
|
|
42
44
|
>
|
|
43
45
|
{icon && <ListItemIcon><IconSVG customDimensions name={icon} /></ListItemIcon>}
|
|
44
46
|
<ListItemText>
|
|
@@ -42,10 +42,11 @@ const NestedMenu = ({ nestedItems, label, icon, amount }: INestedMenuProps) => {
|
|
|
42
42
|
transformOrigin={{ horizontal: 'right', vertical: 'center' }}
|
|
43
43
|
anchorOrigin={{ horizontal: 'left', vertical: 'center' }}
|
|
44
44
|
>
|
|
45
|
-
{nestedItems.map((nestedListItemProps: any,
|
|
45
|
+
{nestedItems.map((nestedListItemProps: any, index: number) => {
|
|
46
46
|
return (
|
|
47
47
|
<ListItem
|
|
48
|
-
key={
|
|
48
|
+
key={index}
|
|
49
|
+
handleClose={() => {}}
|
|
49
50
|
{ ...nestedListItemProps }
|
|
50
51
|
/>
|
|
51
52
|
);
|