Skip to content

Commit

Permalink
Updated the react-menu library to the latest version. #8061
Browse files Browse the repository at this point in the history
  • Loading branch information
pravesh-sharma committed Oct 24, 2024
1 parent 8b354ae commit 4e6a689
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 19 deletions.
2 changes: 1 addition & 1 deletion web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"@mui/x-date-pickers": "^7.7.1",
"@projectstorm/react-diagrams": "^7.0.4",
"@simonwep/pickr": "^1.5.1",
"@szhsin/react-menu": "^2.2.0",
"@szhsin/react-menu": "^4.2.2",
"@tanstack/react-query": "5.37.1",
"@tanstack/react-table": "^8.16.0",
"@tanstack/react-virtual": "^3.8.4",
Expand Down
11 changes: 7 additions & 4 deletions web/pgadmin/static/js/components/Menu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import PropTypes from 'prop-types';
import {
MenuItem,
ControlledMenu,
applyStatics,
Menu,
SubMenu,
} from '@szhsin/react-menu';
Expand Down Expand Up @@ -48,13 +47,17 @@ PgMenu.propTypes = {
menuButton: PropTypes.element,
};

export const PgSubMenu = applyStatics(SubMenu)(({label, ...props})=>{
export const PgSubMenu = (({label, ...props})=>{
return (
<SubMenu label={label} itemProps={{'data-label': label}} {...props} />
);
});

export const PgMenuItem = applyStatics(MenuItem)(({hasCheck=false, checked=false, accesskey, shortcut, children, closeOnCheck=false, ...props})=>{
PgSubMenu.propTypes = {
label: PropTypes.string
};

export const PgMenuItem = (({hasCheck=false, checked=false, accesskey, shortcut, children, closeOnCheck=false, ...props})=>{

let onClick = props.onClick;
if(hasCheck) {
Expand Down Expand Up @@ -83,7 +86,7 @@ PgMenuItem.propTypes = {
children: CustomPropTypes.children,
closeOnCheck: PropTypes.bool,
onClick: PropTypes.func,
dataLabel: PropTypes.string,
datalabel: PropTypes.string,
};

export function usePgMenuGroup() {
Expand Down
28 changes: 14 additions & 14 deletions web/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3033,16 +3033,16 @@ __metadata:
languageName: node
linkType: hard

"@szhsin/react-menu@npm:^2.2.0":
version: 2.3.4
resolution: "@szhsin/react-menu@npm:2.3.4"
"@szhsin/react-menu@npm:^4.2.2":
version: 4.2.2
resolution: "@szhsin/react-menu@npm:4.2.2"
dependencies:
prop-types: ^15.7.2
react-transition-state: ^1.1.3
react-transition-state: ^2.1.0
peerDependencies:
react: ">=16.8.0"
react-dom: ">=16.8.0"
checksum: 94d8b78166a69816852b53e1cf7929ffbbbb54010958d9124e48fcea4a72bc0572b242efb176d3c3cec003014ef7d26b9d191f5baf11825bedabf13ff1c525a9
react: ">=16.14.0"
react-dom: ">=16.14.0"
checksum: b65c231e5a5fb258aa3211c6acc93b805df2992b55dcbd791535745b1a1670ce4ee3ecdf83e271621cfc3f78fed5e8768c32004fc0fe3d1ef4f93c6a53b41086
languageName: node
linkType: hard

Expand Down Expand Up @@ -13364,13 +13364,13 @@ __metadata:
languageName: node
linkType: hard

"react-transition-state@npm:^1.1.3":
version: 1.1.5
resolution: "react-transition-state@npm:1.1.5"
"react-transition-state@npm:^2.1.0":
version: 2.1.3
resolution: "react-transition-state@npm:2.1.3"
peerDependencies:
react: ">=16.8.0"
react-dom: ">=16.8.0"
checksum: 4ca616583cd12825706be94886cf1512e0995170709435971787c7d5adf3d95d6349df17f45d74e805453e338a220e2ebe1b54a5d696bcad4617a71e24e02c59
checksum: 6a5fd4d729695b42fc220903f0ea6faf19fe2ed576350cf58fdfcffb98e838ed1ea789b707996297fcf13b7e4b052cfc84004d90e5b9667fe01538226aa2cec6
languageName: node
linkType: hard

Expand Down Expand Up @@ -13824,7 +13824,7 @@ __metadata:
"@projectstorm/react-diagrams": ^7.0.4
"@simonwep/pickr": ^1.5.1
"@svgr/webpack": ^8.1.0
"@szhsin/react-menu": ^2.2.0
"@szhsin/react-menu": ^4.2.2
"@tanstack/react-query": 5.37.1
"@tanstack/react-table": ^8.16.0
"@tanstack/react-virtual": ^3.8.4
Expand Down Expand Up @@ -15489,11 +15489,11 @@ __metadata:

"typescript@patch:typescript@^5.4.5#~builtin<compat/typescript>":
version: 5.6.2
resolution: "typescript@patch:typescript@npm%3A5.6.2#~builtin<compat/typescript>::version=5.6.2&hash=8c6c40"
resolution: "typescript@patch:typescript@npm%3A5.6.2#~builtin<compat/typescript>::version=5.6.2&hash=379a07"
bin:
tsc: bin/tsc
tsserver: bin/tsserver
checksum: be6138b734b2d5f6aa9844b760d6a9e853d395e55ec4570ff1026cca195e5968849e38907c18f9c5b35f6a38e4e18ec29937f1c2ae03c6405e9874ad45d810b1
checksum: c084ee1ab865f108c787e6233a5f63c126c482c0c8e87ec998ac5288a2ad54b603e1ea8b8b272355823b833eb31b9fabb99e8c6152283e1cb47e3a76bd6faf6c
languageName: node
linkType: hard

Expand Down

0 comments on commit 4e6a689

Please sign in to comment.