pcm-shared-components 0.0.87 → 0.0.90
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.
|
@@ -2,6 +2,7 @@ import React, { Fragment, useState, useEffect } from "react";
|
|
|
2
2
|
import { Typography, Button, Tooltip, IconButton, Toolbar, MenuItem, Menu, AppBar, Badge } from "@mui/material";
|
|
3
3
|
import { makeStyles } from '@mui/styles';
|
|
4
4
|
import ArrowBackIcon from '@mui/icons-material/ArrowBack';
|
|
5
|
+
import Divider from '@mui/material/Divider';
|
|
5
6
|
import { ThemeProvider } from '@mui/system';
|
|
6
7
|
import { createTheme, useTheme } from '@mui/material/styles';
|
|
7
8
|
import MoreIcon from "@mui/icons-material/MoreVert";
|
|
@@ -98,7 +99,7 @@ export const GenericAppBar = props => {
|
|
|
98
99
|
borderLeft: "0.1em solid #aeaeae",
|
|
99
100
|
padding: "0.5em",
|
|
100
101
|
margin: "10px 10px 10px 10px",
|
|
101
|
-
height:
|
|
102
|
+
height: 5
|
|
102
103
|
},
|
|
103
104
|
mobile_divider: {
|
|
104
105
|
borderBottom: "0.1em solid #aeaeae",
|
|
@@ -221,7 +222,7 @@ export const GenericAppBar = props => {
|
|
|
221
222
|
}, /*#__PURE__*/React.createElement("div", {
|
|
222
223
|
className: "flex flex-row",
|
|
223
224
|
key: `main_sub_items_${new Date()}`
|
|
224
|
-
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
225
|
+
}, " ", /*#__PURE__*/React.createElement(Tooltip, {
|
|
225
226
|
title: menu.name
|
|
226
227
|
}, menu.isButton ? /*#__PURE__*/React.createElement(Button // className={classes.menuButton}
|
|
227
228
|
, {
|
|
@@ -238,8 +239,17 @@ export const GenericAppBar = props => {
|
|
|
238
239
|
onClick: () => {
|
|
239
240
|
menu.onClick();
|
|
240
241
|
}
|
|
241
|
-
}, menu.icon)), menu.display_divider ?
|
|
242
|
-
|
|
242
|
+
}, menu.icon)), menu.display_divider ? /*#__PURE__*/React.createElement(Divider, {
|
|
243
|
+
style: {
|
|
244
|
+
marginRight: 24,
|
|
245
|
+
marginLeft: 6
|
|
246
|
+
},
|
|
247
|
+
orientation: "vertical",
|
|
248
|
+
flexItem: true
|
|
249
|
+
}) : /*#__PURE__*/React.createElement("div", {
|
|
250
|
+
style: {
|
|
251
|
+
marginRight: 24
|
|
252
|
+
}
|
|
243
253
|
})))); //? ------------------------------------------------
|
|
244
254
|
//! Mobile menu
|
|
245
255
|
//? ------------------------------------------------
|
|
@@ -270,10 +280,7 @@ export const GenericAppBar = props => {
|
|
|
270
280
|
//? ------------------------------------------------
|
|
271
281
|
|
|
272
282
|
const MainItems = () => {
|
|
273
|
-
return /*#__PURE__*/React.createElement(
|
|
274
|
-
className: "flex flex-row",
|
|
275
|
-
key: `main_items_${new Date()}`
|
|
276
|
-
}, (appBarMenu.mainMenu || []).filter(mn => !(mn.hideMenu && mn.hideMenu === true)).map((menu, idx) => /*#__PURE__*/React.createElement(DesktopItemMenu, {
|
|
283
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, (appBarMenu.mainMenu || []).filter(mn => !(mn.hideMenu && mn.hideMenu === true)).map((menu, idx) => /*#__PURE__*/React.createElement(DesktopItemMenu, {
|
|
277
284
|
key: `desktop_item_menu_${idx}`,
|
|
278
285
|
menu: menu,
|
|
279
286
|
idx: idx
|
|
@@ -99,6 +99,13 @@ export const GenericDialogWindow = props => {
|
|
|
99
99
|
const setOverrides = () => {
|
|
100
100
|
try {
|
|
101
101
|
//Loop over all our on click overrides and apply the onClick callback for each id found in the onClickOverride state
|
|
102
|
+
onClickOverride.forEach(item => {
|
|
103
|
+
setManagedAppBarMenu(previousState => {
|
|
104
|
+
return { ...previousState,
|
|
105
|
+
mainMenu: updateObjectByID(previousState.mainMenu, item.id, undefined)
|
|
106
|
+
};
|
|
107
|
+
});
|
|
108
|
+
});
|
|
102
109
|
onClickOverride.forEach(item => {
|
|
103
110
|
setManagedAppBarMenu(previousState => {
|
|
104
111
|
return { ...previousState,
|