@geotab/zenith 1.26.4-beta.0 → 1.26.4
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.
|
@@ -15,11 +15,19 @@ const getMenuItems = (entity, isNested, render, primaryActions) => {
|
|
|
15
15
|
return null;
|
|
16
16
|
}
|
|
17
17
|
const result = render === null || render === void 0 ? void 0 : render(entity, isNested);
|
|
18
|
-
if (result) {
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
if (!result) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
if (result.type === menu_1.Menu.Item) {
|
|
22
|
+
return primaryActions ? [...primaryActions.props.children, result] : [result];
|
|
23
|
+
}
|
|
24
|
+
if (!result.props.children) {
|
|
25
|
+
return null;
|
|
21
26
|
}
|
|
22
|
-
|
|
27
|
+
const menuItems = ((Array.isArray(result.props.children)
|
|
28
|
+
? result.props.children
|
|
29
|
+
: [result.props.children]) || []);
|
|
30
|
+
return primaryActions ? [...primaryActions.props.children, ...menuItems] : menuItems;
|
|
23
31
|
};
|
|
24
32
|
const getErrorItem = (id, onClick) => ((0, jsx_runtime_1.jsx)(menuErrorItem_1.MenuErrorItem, { id: id, onClick: onClick }));
|
|
25
33
|
const ActionsMenu = ({ entity, isNested, render, renderAsync, primaryActions }) => {
|