pcm-shared-components 0.0.88 → 0.0.91
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.
|
@@ -218,8 +218,11 @@ export const GenericAppBar = props => {
|
|
|
218
218
|
}), menu.display_divider ? menu_divider : /*#__PURE__*/React.createElement("div", {
|
|
219
219
|
className: "mr-12"
|
|
220
220
|
})) : /*#__PURE__*/React.createElement("div", {
|
|
221
|
-
|
|
222
|
-
}, /*#__PURE__*/React.createElement(
|
|
221
|
+
key: `main_menu_item_${idx}`
|
|
222
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
223
|
+
className: "flex flex-row",
|
|
224
|
+
key: `main_sub_items_${new Date()}`
|
|
225
|
+
}, " ", /*#__PURE__*/React.createElement(Tooltip, {
|
|
223
226
|
title: menu.name
|
|
224
227
|
}, menu.isButton ? /*#__PURE__*/React.createElement(Button // className={classes.menuButton}
|
|
225
228
|
, {
|
|
@@ -247,7 +250,7 @@ export const GenericAppBar = props => {
|
|
|
247
250
|
style: {
|
|
248
251
|
marginRight: 24
|
|
249
252
|
}
|
|
250
|
-
}))); //? ------------------------------------------------
|
|
253
|
+
})))); //? ------------------------------------------------
|
|
251
254
|
//! Mobile menu
|
|
252
255
|
//? ------------------------------------------------
|
|
253
256
|
|
|
@@ -81,20 +81,18 @@ export const GenericDialogWindow = props => {
|
|
|
81
81
|
return obj;
|
|
82
82
|
};
|
|
83
83
|
|
|
84
|
-
const setMenuOnClickCallback =
|
|
84
|
+
const setMenuOnClickCallback = (id, onClick) => {
|
|
85
85
|
//Used to set the onClick callback on a specific menu matching the id provided.
|
|
86
86
|
//Example: Used by the children component to set the onClick of a menu.
|
|
87
87
|
// A menu must have a unique id object matching the id on which we are searching for and a callback function must be provided
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
}
|
|
97
|
-
}, [appBarMenu]);
|
|
88
|
+
//Need to filter out previous ids and add the new ones
|
|
89
|
+
setOnClickOverride(previousState => {
|
|
90
|
+
return [...previousState.filter(ps => ps.id !== id), {
|
|
91
|
+
id: id,
|
|
92
|
+
onClick: onClick
|
|
93
|
+
}];
|
|
94
|
+
});
|
|
95
|
+
};
|
|
98
96
|
|
|
99
97
|
const setOverrides = () => {
|
|
100
98
|
try {
|
|
@@ -131,8 +129,7 @@ export const GenericDialogWindow = props => {
|
|
|
131
129
|
})]
|
|
132
130
|
}); // If we have a mainMenu item with the id='save' then override the onClick event to use the onSave function which reaches into the child ref
|
|
133
131
|
//Need to re-apply any onClick override to ensure they are still properly set by what was overridden from the child component.
|
|
134
|
-
|
|
135
|
-
setOverrides();
|
|
132
|
+
// setOverrides();
|
|
136
133
|
}
|
|
137
134
|
}, [appBarMenu, can_save, showSaveButton, save_button_label]); // -----------------------------------------
|
|
138
135
|
// Note make sure to include disableEnforceFocus or else I'll have infinite error/warnings on Uncaught RangeError.
|