|
@@ -11,7 +11,7 @@
|
|
* specific language governing permissions and limitations under the License.
|
|
* specific language governing permissions and limitations under the License.
|
|
*/
|
|
*/
|
|
|
|
|
|
-import React, { useCallback, useMemo, useState, MouseEvent, CSSProperties } from "react";
|
|
|
|
|
|
+import React, { useCallback, useMemo, useState, MouseEvent, CSSProperties,useEffect } from "react";
|
|
import MenuIco from "@mui/icons-material/Menu";
|
|
import MenuIco from "@mui/icons-material/Menu";
|
|
import ListItemButton from "@mui/material/ListItemButton";
|
|
import ListItemButton from "@mui/material/ListItemButton";
|
|
import Drawer from "@mui/material/Drawer";
|
|
import Drawer from "@mui/material/Drawer";
|
|
@@ -36,9 +36,12 @@ const avatarSx = { bgcolor: (theme: Theme) => theme.palette.text.primary };
|
|
const baseTitleProps = { noWrap: true, variant: "h6" } as const;
|
|
const baseTitleProps = { noWrap: true, variant: "h6" } as const;
|
|
|
|
|
|
const Menu = (props: MenuProps) => {
|
|
const Menu = (props: MenuProps) => {
|
|
- const { label, onAction = "", lov, width, inactiveIds = emptyArray, active = true } = props;
|
|
|
|
|
|
+ const { label, onAction = "", lov, width, inactiveIds = emptyArray, active = true, expanded = false } = props;
|
|
const [selectedValue, setSelectedValue] = useState<string>("");
|
|
const [selectedValue, setSelectedValue] = useState<string>("");
|
|
- const [opened, setOpened] = useState(false);
|
|
|
|
|
|
+ const [opened, setOpened] = useState(expanded);
|
|
|
|
+ useEffect(() => {
|
|
|
|
+ setOpened(expanded);
|
|
|
|
+ }, [expanded]);
|
|
const dispatch = useDispatch();
|
|
const dispatch = useDispatch();
|
|
const theme = useTheme();
|
|
const theme = useTheme();
|
|
const module = useModule();
|
|
const module = useModule();
|