@hitachivantara/app-shell-ui 1.9.1 → 1.10.1
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.
- package/dist/esm/components/AppShell/AppShell.js +1 -1
- package/dist/esm/components/AppShellProvider/AppShellProvider.js +64 -36
- package/dist/esm/components/AppShellRoutes/AppShellRoutes.js +60 -36
- package/dist/esm/components/AppShellViewProvider/AppShellViewProvider.js +3 -8
- package/dist/esm/components/CustomHooksInitializer/CustomHooksInitializer.js +2 -2
- package/dist/esm/components/GlobalStyles/GlobalStyles.js +13 -15
- package/dist/esm/components/IconUiKit/IconUiKit.js +6 -8
- package/dist/esm/components/IconUiKit/index.js +2 -2
- package/dist/esm/components/SnackbarProvider/SnackbarProvider.js +16 -14
- package/dist/esm/components/hoc/withClickAwayListener.js +6 -3
- package/dist/esm/components/hoc/withGlobalProvider.js +23 -11
- package/dist/esm/components/layout/BrandLogo/BrandLogo.js +4 -8
- package/dist/esm/components/layout/BrandLogo/Logos/Hitachi.js +21 -2
- package/dist/esm/components/layout/BrandLogo/Logos/Lumada.js +39 -7
- package/dist/esm/components/layout/BrandLogo/Logos/Pentaho.js +21 -2
- package/dist/esm/components/layout/Header/Header.js +53 -37
- package/dist/esm/components/layout/Header/HeaderActions/{DynamicAction/DynamicAction.js → DynamicAction.js} +12 -15
- package/dist/esm/components/layout/Header/HeaderActions/HeaderActions.js +15 -8
- package/dist/esm/components/layout/Header/HeaderActions/InternalActions/AppSwitcherToggle/AppSwitcherToggle.js +42 -28
- package/dist/esm/components/layout/Header/HeaderActions/InternalActions/AppSwitcherToggle/styles.js +3 -8
- package/dist/esm/components/layout/Header/HeaderActions/InternalActions/{ColorModeSwitcher/ColorModeSwitcher.js → ColorModeSwitcher.js} +12 -13
- package/dist/esm/components/layout/Header/HeaderActions/InternalActions/HelpButton/HelpButton.js +17 -17
- package/dist/esm/components/layout/Header/HeaderActions/InternalActions/InternalAction/InternalAction.js +28 -25
- package/dist/esm/components/layout/Header/styles.js +6 -17
- package/dist/esm/components/layout/Loading/Loading.js +2 -4
- package/dist/esm/components/layout/Loading/styles.js +8 -30
- package/dist/esm/components/layout/Main/Main.js +32 -22
- package/dist/esm/components/layout/Main/styles.js +8 -30
- package/dist/esm/components/layout/VerticalNavigation/NavigationCollapse.js +23 -14
- package/dist/esm/components/layout/VerticalNavigation/NavigationHeader.js +2 -4
- package/dist/esm/components/layout/VerticalNavigation/VerticalNavigation.js +61 -38
- package/dist/esm/components/layout/VerticalNavigation/styles.js +24 -48
- package/dist/esm/{lib/hooks → hooks}/useClearLocationState.js +6 -10
- package/dist/esm/hooks/useCustomEventListener.js +31 -0
- package/dist/esm/{lib/hooks → hooks}/useLocalStorage.js +1 -4
- package/dist/esm/{lib/hooks → hooks}/useNavigationMenuItems.js +15 -20
- package/dist/esm/{lib/hooks → hooks}/useNotificationsEventListener.js +5 -16
- package/dist/esm/{lib/hooks → hooks}/useThemeEventListener.js +4 -15
- package/dist/esm/{lib/i18n → i18n}/index.js +8 -6
- package/dist/esm/i18n/localization/en.json.js +17 -0
- package/dist/esm/i18n/localization/pt.json.js +17 -0
- package/dist/esm/pages/ErrorPage/ErrorPage.js +27 -17
- package/dist/esm/pages/ErrorPage/Footer.js +60 -0
- package/dist/esm/pages/ErrorPage/styles.js +17 -40
- package/dist/esm/pages/GenericError/GenericError.js +14 -11
- package/dist/esm/pages/LoadingPage/LoadingPage.js +11 -7
- package/dist/esm/pages/LoadingPage/styles.js +10 -14
- package/dist/esm/pages/NotFound/NotFound.js +11 -7
- package/dist/esm/pages/Root/Root.js +7 -9
- package/dist/esm/providers/BannerProvider.js +67 -49
- package/dist/esm/providers/LayoutProvider.js +21 -12
- package/dist/esm/providers/NavigationProvider.js +48 -34
- package/dist/esm/utils/CombinedProviders.js +23 -0
- package/dist/esm/{lib/utils → utils}/navigationUtil.js +5 -15
- package/dist/types/index.d.ts +27 -0
- package/package.json +37 -48
- package/LICENSE +0 -201
- package/dist/dts/index.d.ts +0 -9
- package/dist/esm/components/layout/Header/HeaderActions/DynamicAction/index.js +0 -4
- package/dist/esm/components/layout/Header/HeaderActions/InternalActions/ColorModeSwitcher/index.js +0 -4
- package/dist/esm/lib/hooks/useCustomEventListener.js +0 -23
- package/dist/esm/lib/i18n/localization/en.json.js +0 -59
- package/dist/esm/lib/i18n/localization/pt.json.js +0 -59
- package/dist/esm/lib/utils/CombinedProviders.js +0 -22
- package/dist/esm/lib/utils/textUtil.js +0 -6
- package/dist/esm/pages/ErrorPage/Footer/Footer.js +0 -53
- package/dist/esm/pages/ErrorPage/Footer/styles.js +0 -22
- package/dist/esm/providers/hooks/useBannerContext.js +0 -12
- package/dist/esm/providers/hooks/useLayoutContext.js +0 -12
- package/dist/esm/providers/hooks/useNavigationContext.js +0 -12
- /package/dist/esm/{lib/hooks → hooks}/useResizeObserver.js +0 -0
- /package/dist/esm/{lib/utils → utils}/basePathUtils.js +0 -0
- /package/dist/esm/{lib/utils → utils}/documentUtil.js +0 -0
|
@@ -1,36 +1,24 @@
|
|
|
1
|
-
import { jsxs, jsx } from "
|
|
2
|
-
import {
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useMemo, useEffect, createContext, useContext } from "react";
|
|
3
|
+
import { useTranslation } from "react-i18next";
|
|
3
4
|
import { css } from "@emotion/css";
|
|
4
5
|
import { uid } from "uid";
|
|
5
6
|
import { useTheme, theme, HvBanner } from "@hitachivantara/uikit-react-core";
|
|
6
|
-
import {
|
|
7
|
-
import useNavigationContext from "./
|
|
8
|
-
import useLayoutContext from "./hooks/useLayoutContext.js";
|
|
7
|
+
import { useLayoutContext } from "./LayoutProvider.js";
|
|
8
|
+
import { useNavigationContext } from "./NavigationProvider.js";
|
|
9
9
|
const BannerContext = createContext({
|
|
10
10
|
show: () => {
|
|
11
11
|
},
|
|
12
12
|
dismiss: () => {
|
|
13
13
|
}
|
|
14
14
|
});
|
|
15
|
-
const BannerProvider = ({
|
|
16
|
-
|
|
17
|
-
}) => {
|
|
18
|
-
const {
|
|
19
|
-
t
|
|
20
|
-
} = useTranslation(void 0, {
|
|
15
|
+
const BannerProvider = ({ children }) => {
|
|
16
|
+
const { t } = useTranslation(void 0, {
|
|
21
17
|
keyPrefix: "notifications.banner"
|
|
22
18
|
});
|
|
23
|
-
const {
|
|
24
|
-
|
|
25
|
-
} =
|
|
26
|
-
const {
|
|
27
|
-
showHeaderSubMenu,
|
|
28
|
-
isCompactMode
|
|
29
|
-
} = useNavigationContext();
|
|
30
|
-
const {
|
|
31
|
-
verticalNavigationWidth,
|
|
32
|
-
setBannerMaxHeight
|
|
33
|
-
} = useLayoutContext();
|
|
19
|
+
const { activeTheme } = useTheme();
|
|
20
|
+
const { showHeaderSubMenu, isCompactMode } = useNavigationContext();
|
|
21
|
+
const { verticalNavigationWidth, setBannerMaxHeight } = useLayoutContext();
|
|
34
22
|
const [banners, setBanners] = useState([]);
|
|
35
23
|
const isPentahoTheme = activeTheme?.name === "pentahoPlus";
|
|
36
24
|
const show = (notification) => {
|
|
@@ -43,12 +31,17 @@ const BannerProvider = ({
|
|
|
43
31
|
setBanners((prevBanners) => [...prevBanners, newBanner]);
|
|
44
32
|
};
|
|
45
33
|
const dismiss = (id) => {
|
|
46
|
-
setBanners(
|
|
34
|
+
setBanners(
|
|
35
|
+
(prevBanners) => prevBanners.filter((banner) => banner.id !== id)
|
|
36
|
+
);
|
|
47
37
|
};
|
|
48
|
-
const value = useMemo(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
38
|
+
const value = useMemo(
|
|
39
|
+
() => ({
|
|
40
|
+
show,
|
|
41
|
+
dismiss
|
|
42
|
+
}),
|
|
43
|
+
[]
|
|
44
|
+
);
|
|
52
45
|
useEffect(() => {
|
|
53
46
|
if (banners.length > 0) {
|
|
54
47
|
const bannerHeights = banners.map((item) => {
|
|
@@ -61,15 +54,11 @@ const BannerProvider = ({
|
|
|
61
54
|
setBannerMaxHeight(0);
|
|
62
55
|
}
|
|
63
56
|
}, [banners, setBannerMaxHeight]);
|
|
64
|
-
const {
|
|
65
|
-
root,
|
|
66
|
-
topCenter,
|
|
67
|
-
bottomCenter
|
|
68
|
-
} = useMemo(() => {
|
|
57
|
+
const { root, topCenter, bottomCenter } = useMemo(() => {
|
|
69
58
|
const paddingY = theme.space.xs;
|
|
70
59
|
const paddingX = theme.space.sm;
|
|
71
60
|
return {
|
|
72
|
-
root:
|
|
61
|
+
root: css({
|
|
73
62
|
left: `calc(${verticalNavigationWidth}px + ${paddingX})`,
|
|
74
63
|
width: `calc(100% - (${verticalNavigationWidth}px + ${paddingX}) - ${paddingX})`,
|
|
75
64
|
transform: "unset",
|
|
@@ -80,29 +69,58 @@ const BannerProvider = ({
|
|
|
80
69
|
left: `calc(${verticalNavigationWidth}px + (100% - ${verticalNavigationWidth}px) / 2)`,
|
|
81
70
|
transform: `translateX(-50%)`
|
|
82
71
|
}
|
|
83
|
-
}
|
|
84
|
-
topCenter:
|
|
72
|
+
}),
|
|
73
|
+
topCenter: css({
|
|
85
74
|
marginTop: showHeaderSubMenu && !isCompactMode ? `calc(${theme.header.height} + ${theme.header.secondLevelHeight} + ${paddingY})` : `calc(${theme.header.height} + ${paddingY})`
|
|
86
|
-
}
|
|
87
|
-
bottomCenter:
|
|
75
|
+
}),
|
|
76
|
+
bottomCenter: css({
|
|
88
77
|
marginBottom: theme.space.md
|
|
89
|
-
}
|
|
78
|
+
})
|
|
90
79
|
};
|
|
91
|
-
}, [
|
|
80
|
+
}, [
|
|
81
|
+
isCompactMode,
|
|
82
|
+
isPentahoTheme,
|
|
83
|
+
showHeaderSubMenu,
|
|
84
|
+
verticalNavigationWidth
|
|
85
|
+
]);
|
|
92
86
|
return /* @__PURE__ */ jsxs(BannerContext.Provider, { value, children: [
|
|
93
|
-
banners.map((banner) => /* @__PURE__ */ jsx(
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
87
|
+
banners.map((banner) => /* @__PURE__ */ jsx(
|
|
88
|
+
HvBanner,
|
|
89
|
+
{
|
|
90
|
+
classes: {
|
|
91
|
+
root,
|
|
92
|
+
anchorOriginBottomCenter: bottomCenter,
|
|
93
|
+
anchorOriginTopCenter: topCenter
|
|
94
|
+
},
|
|
95
|
+
id: banner.id,
|
|
96
|
+
offset: 0,
|
|
97
|
+
open: true,
|
|
98
|
+
onClose: () => dismiss(banner.id),
|
|
99
|
+
variant: banner.variant,
|
|
100
|
+
label: banner.message,
|
|
101
|
+
showIcon: true,
|
|
102
|
+
actions: banner.actions,
|
|
103
|
+
actionsCallback: banner.actionsCallback,
|
|
104
|
+
bannerContentProps: {
|
|
105
|
+
actionProps: { "aria-label": t("close") }
|
|
106
|
+
},
|
|
107
|
+
anchorOrigin: isPentahoTheme ? "bottom" : void 0,
|
|
108
|
+
transitionDirection: isPentahoTheme ? "up" : void 0
|
|
109
|
+
},
|
|
110
|
+
banner.id
|
|
111
|
+
)),
|
|
102
112
|
children
|
|
103
113
|
] });
|
|
104
114
|
};
|
|
115
|
+
const useBannerContext = () => {
|
|
116
|
+
const context = useContext(BannerContext);
|
|
117
|
+
if (!context) {
|
|
118
|
+
console.error("BannerContext was used outside of its Provider");
|
|
119
|
+
}
|
|
120
|
+
return context;
|
|
121
|
+
};
|
|
105
122
|
export {
|
|
106
123
|
BannerContext,
|
|
107
|
-
BannerProvider
|
|
124
|
+
BannerProvider,
|
|
125
|
+
useBannerContext
|
|
108
126
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx } from "
|
|
2
|
-
import {
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useState, useMemo, createContext, useContext } from "react";
|
|
3
3
|
const LayoutContext = createContext({
|
|
4
4
|
bannerMaxHeight: 0,
|
|
5
5
|
setBannerMaxHeight: () => {
|
|
@@ -8,20 +8,29 @@ const LayoutContext = createContext({
|
|
|
8
8
|
setVerticalNavigationWidth: () => {
|
|
9
9
|
}
|
|
10
10
|
});
|
|
11
|
-
const LayoutProvider = ({
|
|
12
|
-
children
|
|
13
|
-
}) => {
|
|
11
|
+
const LayoutProvider = ({ children }) => {
|
|
14
12
|
const [bannerMaxHeight, setBannerMaxHeight] = useState(0);
|
|
15
13
|
const [verticalNavigationWidth, setVerticalNavigationWidth] = useState(0);
|
|
16
|
-
const value = useMemo(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
const value = useMemo(
|
|
15
|
+
() => ({
|
|
16
|
+
bannerMaxHeight,
|
|
17
|
+
setBannerMaxHeight,
|
|
18
|
+
verticalNavigationWidth,
|
|
19
|
+
setVerticalNavigationWidth
|
|
20
|
+
}),
|
|
21
|
+
[bannerMaxHeight, verticalNavigationWidth]
|
|
22
|
+
);
|
|
22
23
|
return /* @__PURE__ */ jsx(LayoutContext.Provider, { value, children });
|
|
23
24
|
};
|
|
25
|
+
const useLayoutContext = () => {
|
|
26
|
+
const context = useContext(LayoutContext);
|
|
27
|
+
if (!context) {
|
|
28
|
+
console.error("LayoutContext was used outside of its Provider");
|
|
29
|
+
}
|
|
30
|
+
return context;
|
|
31
|
+
};
|
|
24
32
|
export {
|
|
25
33
|
LayoutContext,
|
|
26
|
-
LayoutProvider
|
|
34
|
+
LayoutProvider,
|
|
35
|
+
useLayoutContext
|
|
27
36
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsx } from "
|
|
2
|
-
import { createContext, useState, useMemo, useEffect, useCallback } from "react";
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useContext, createContext, useState, useMemo, useEffect, useCallback } from "react";
|
|
3
3
|
import { useTheme, useMediaQuery } from "@mui/material";
|
|
4
4
|
import { useHvAppShellConfig } from "@hitachivantara/app-shell-shared";
|
|
5
|
-
import
|
|
6
|
-
import useNavigationMenuItems from "../
|
|
7
|
-
import
|
|
5
|
+
import useLocalStorage from "../hooks/useLocalStorage.js";
|
|
6
|
+
import useNavigationMenuItems from "../hooks/useNavigationMenuItems.js";
|
|
7
|
+
import { removeHrefFromMenuItemsWithChildren, findItemById } from "../utils/navigationUtil.js";
|
|
8
8
|
const NavigationContext = createContext({
|
|
9
9
|
selectedMenuItemId: void 0,
|
|
10
10
|
rootMenuItemId: void 0,
|
|
@@ -17,24 +17,15 @@ const NavigationContext = createContext({
|
|
|
17
17
|
switchVerticalNavigationMode: () => {
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
|
-
const NavigationProvider = ({
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
const {
|
|
24
|
-
navigationMode
|
|
25
|
-
} = useHvAppShellConfig();
|
|
26
|
-
const {
|
|
27
|
-
items,
|
|
28
|
-
selectedMenuItemId,
|
|
29
|
-
rootMenuItemId
|
|
30
|
-
} = useNavigationMenuItems();
|
|
20
|
+
const NavigationProvider = ({ children }) => {
|
|
21
|
+
const { navigationMode } = useHvAppShellConfig();
|
|
22
|
+
const { items, selectedMenuItemId, rootMenuItemId } = useNavigationMenuItems();
|
|
31
23
|
const muiTheme = useTheme();
|
|
32
24
|
const isCompactMode = useMediaQuery(muiTheme.breakpoints.down("md"));
|
|
33
|
-
const {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
const [isExpanded, setIsExpanded] = useState(storedExpanded == null ? true : storedExpanded === "true");
|
|
25
|
+
const { value: storedExpanded, setStoredValue: setStoreExpanded } = useLocalStorage("NAV_EXPANDED");
|
|
26
|
+
const [isExpanded, setIsExpanded] = useState(
|
|
27
|
+
storedExpanded == null ? true : storedExpanded === "true"
|
|
28
|
+
);
|
|
38
29
|
const [isClosed, setIsClosed] = useState(isCompactMode);
|
|
39
30
|
const [showHeaderSubMenu, setShowHeaderSubMenu] = useState(false);
|
|
40
31
|
const verticalNavigationMode = useMemo(() => {
|
|
@@ -69,7 +60,9 @@ const NavigationProvider = ({
|
|
|
69
60
|
setIsClosed(isCompactMode);
|
|
70
61
|
}, [isCompactMode]);
|
|
71
62
|
useEffect(() => {
|
|
72
|
-
setShowHeaderSubMenu(
|
|
63
|
+
setShowHeaderSubMenu(
|
|
64
|
+
navigationMode === "ONLY_TOP" && items.some((item) => item.data && item.data.length > 0)
|
|
65
|
+
);
|
|
73
66
|
}, [navigationMode, items]);
|
|
74
67
|
const switchVerticalNavigationMode = useCallback(() => {
|
|
75
68
|
if (isCompactMode) {
|
|
@@ -78,20 +71,41 @@ const NavigationProvider = ({
|
|
|
78
71
|
setIsExpanded((prevState) => !prevState);
|
|
79
72
|
}
|
|
80
73
|
}, [isCompactMode]);
|
|
81
|
-
const value = useMemo(
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
74
|
+
const value = useMemo(
|
|
75
|
+
() => ({
|
|
76
|
+
selectedMenuItemId,
|
|
77
|
+
rootMenuItemId,
|
|
78
|
+
items,
|
|
79
|
+
verticalNavigationItems,
|
|
80
|
+
hasVerticalNavigation,
|
|
81
|
+
showHeaderSubMenu,
|
|
82
|
+
isCompactMode,
|
|
83
|
+
verticalNavigationMode,
|
|
84
|
+
switchVerticalNavigationMode
|
|
85
|
+
}),
|
|
86
|
+
[
|
|
87
|
+
selectedMenuItemId,
|
|
88
|
+
rootMenuItemId,
|
|
89
|
+
items,
|
|
90
|
+
verticalNavigationItems,
|
|
91
|
+
hasVerticalNavigation,
|
|
92
|
+
showHeaderSubMenu,
|
|
93
|
+
isCompactMode,
|
|
94
|
+
verticalNavigationMode,
|
|
95
|
+
switchVerticalNavigationMode
|
|
96
|
+
]
|
|
97
|
+
);
|
|
92
98
|
return /* @__PURE__ */ jsx(NavigationContext.Provider, { value, children });
|
|
93
99
|
};
|
|
100
|
+
const useNavigationContext = () => {
|
|
101
|
+
const context = useContext(NavigationContext);
|
|
102
|
+
if (!context) {
|
|
103
|
+
console.error("NavigationContext was used outside of its Provider");
|
|
104
|
+
}
|
|
105
|
+
return context;
|
|
106
|
+
};
|
|
94
107
|
export {
|
|
95
108
|
NavigationContext,
|
|
96
|
-
NavigationProvider
|
|
109
|
+
NavigationProvider,
|
|
110
|
+
useNavigationContext
|
|
97
111
|
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback } from "react";
|
|
3
|
+
const CombinedProviders = ({
|
|
4
|
+
providers,
|
|
5
|
+
children: mainChildren
|
|
6
|
+
}) => {
|
|
7
|
+
const Combined = useCallback(
|
|
8
|
+
({ children }) => {
|
|
9
|
+
let result = children;
|
|
10
|
+
if (providers && providers.length > 0) {
|
|
11
|
+
result = providers.reduceRight((Acc, Curr) => {
|
|
12
|
+
return /* @__PURE__ */ jsx(Curr, { children: Acc });
|
|
13
|
+
}, children);
|
|
14
|
+
}
|
|
15
|
+
return result;
|
|
16
|
+
},
|
|
17
|
+
[providers]
|
|
18
|
+
);
|
|
19
|
+
return /* @__PURE__ */ jsx(Combined, { children: mainChildren });
|
|
20
|
+
};
|
|
21
|
+
export {
|
|
22
|
+
CombinedProviders as default
|
|
23
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx } from "
|
|
2
|
-
import IconUiKit from "
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import IconUiKit from "../components/IconUiKit/index.js";
|
|
3
3
|
const createNavigationMenuItems = (t, menuItems, maxDepth) => {
|
|
4
4
|
if (maxDepth !== void 0 && maxDepth <= 0) {
|
|
5
5
|
return [];
|
|
@@ -18,10 +18,7 @@ const createNavigationMenuItems = (t, menuItems, maxDepth) => {
|
|
|
18
18
|
const findItemById = (data, itemId) => {
|
|
19
19
|
let foundItem = null;
|
|
20
20
|
data.some((obj) => {
|
|
21
|
-
const {
|
|
22
|
-
id: objId,
|
|
23
|
-
data: childData
|
|
24
|
-
} = obj;
|
|
21
|
+
const { id: objId, data: childData } = obj;
|
|
25
22
|
if (objId === itemId) {
|
|
26
23
|
foundItem = obj;
|
|
27
24
|
return true;
|
|
@@ -46,16 +43,9 @@ const getAppIdFromBundle = (bundle) => {
|
|
|
46
43
|
};
|
|
47
44
|
const removeHrefFromMenuItemsWithChildren = (items) => {
|
|
48
45
|
return items.map((item) => {
|
|
49
|
-
const {
|
|
50
|
-
href,
|
|
51
|
-
data,
|
|
52
|
-
...rest
|
|
53
|
-
} = item;
|
|
46
|
+
const { href, data, ...rest } = item;
|
|
54
47
|
if (data && data.length > 0) {
|
|
55
|
-
return {
|
|
56
|
-
...rest,
|
|
57
|
-
data: removeHrefFromMenuItemsWithChildren(data)
|
|
58
|
-
};
|
|
48
|
+
return { ...rest, data: removeHrefFromMenuItemsWithChildren(data) };
|
|
59
49
|
}
|
|
60
50
|
return item;
|
|
61
51
|
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { JSX as JSX_2 } from 'react/jsx-runtime';
|
|
2
|
+
|
|
3
|
+
declare const _default: {
|
|
4
|
+
({ ...wrappedProps }: any): JSX_2.Element;
|
|
5
|
+
displayName: string;
|
|
6
|
+
};
|
|
7
|
+
export default _default;
|
|
8
|
+
|
|
9
|
+
export { }
|
|
10
|
+
|
|
11
|
+
declare namespace _default {
|
|
12
|
+
function process(sourceText: any, sourcePath: any): {
|
|
13
|
+
code: string;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
declare namespace _default {
|
|
18
|
+
function process(sourceText: any, sourcePath: any): {
|
|
19
|
+
code: string;
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
declare namespace _default {
|
|
24
|
+
function process(sourceText: any, sourcePath: any): {
|
|
25
|
+
code: string;
|
|
26
|
+
};
|
|
27
|
+
}
|
package/package.json
CHANGED
|
@@ -1,54 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hitachivantara/app-shell-ui",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "AppShell Component",
|
|
5
|
-
"author": "Hitachi Vantara - Boba Fett Team",
|
|
6
|
-
"license": "Apache-2.0",
|
|
3
|
+
"version": "1.10.1",
|
|
7
4
|
"type": "module",
|
|
5
|
+
"private": false,
|
|
6
|
+
"author": "Hitachi Vantara UI Kit Team",
|
|
7
|
+
"description": "AppShell Component",
|
|
8
|
+
"homepage": "https://github.com/lumada-design/hv-uikit-react",
|
|
8
9
|
"sideEffects": false,
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
"import": "./dist/esm/index.js",
|
|
15
|
-
"default": "./dist/esm/index.js"
|
|
16
|
-
},
|
|
17
|
-
"./package.json": "./package.json"
|
|
18
|
-
},
|
|
19
|
-
"files": [
|
|
20
|
-
"dist"
|
|
21
|
-
],
|
|
22
|
-
"publishConfig": {
|
|
23
|
-
"access": "public"
|
|
24
|
-
},
|
|
25
|
-
"scripts": {
|
|
26
|
-
"build": "npm-run-all clean build:*",
|
|
27
|
-
"build:js": "tsc -p tsconfig.prod.json && vite build",
|
|
28
|
-
"clean": "npx rimraf ./dist *.tgz tsconfig.tsbuildinfo",
|
|
29
|
-
"dev": "vite build --watch",
|
|
30
|
-
"lint-check": "npx eslint --ext .js,.jsx,.ts,.tsx src --color",
|
|
31
|
-
"lint": "npm-run-all --parallel lint:*",
|
|
32
|
-
"lint:eslint": "npm run lint-check -- --cache --fix",
|
|
33
|
-
"lint:prettier": "npx prettier --write \"src/**/*.{html,css,js,jsx,ts,tsx}\"",
|
|
34
|
-
"test": "vitest run",
|
|
35
|
-
"coverage": "vitest run --coverage"
|
|
10
|
+
"license": "Apache-2.0",
|
|
11
|
+
"repository": {
|
|
12
|
+
"type": "git",
|
|
13
|
+
"url": "git+https://github.com/lumada-design/hv-uikit-react.git",
|
|
14
|
+
"directory": "packages/app-shell-ui"
|
|
36
15
|
},
|
|
16
|
+
"bugs": "https://github.com/lumada-design/hv-uikit-react/issues",
|
|
37
17
|
"dependencies": {
|
|
38
18
|
"@emotion/css": "^11.10.5",
|
|
39
19
|
"@emotion/react": "^11.10.5",
|
|
40
20
|
"@emotion/styled": "^11.10.5",
|
|
41
|
-
"@hitachivantara/app-shell-events": "1.0
|
|
42
|
-
"@hitachivantara/app-shell-navigation": "1.
|
|
43
|
-
"@hitachivantara/app-shell-shared": "1.
|
|
44
|
-
"@hitachivantara/uikit-react-core": "^5.
|
|
45
|
-
"@hitachivantara/uikit-react-icons": "^5.
|
|
46
|
-
"@mui/material": "^5.
|
|
47
|
-
"i18next": "^
|
|
48
|
-
"i18next-browser-languagedetector": "^
|
|
21
|
+
"@hitachivantara/app-shell-events": "^1.1.0",
|
|
22
|
+
"@hitachivantara/app-shell-navigation": "^1.3.1",
|
|
23
|
+
"@hitachivantara/app-shell-shared": "^1.5.1",
|
|
24
|
+
"@hitachivantara/uikit-react-core": "^5.93.1",
|
|
25
|
+
"@hitachivantara/uikit-react-icons": "^5.15.1",
|
|
26
|
+
"@mui/material": "^5.16.14",
|
|
27
|
+
"i18next": "^24.2.2",
|
|
28
|
+
"i18next-browser-languagedetector": "^8.0.3",
|
|
49
29
|
"react-error-boundary": "^4.0.10",
|
|
50
30
|
"react-helmet-async": "^2.0.1",
|
|
51
|
-
"react-i18next": "^
|
|
31
|
+
"react-i18next": "^15.4.0",
|
|
52
32
|
"uid": "^2.0.2"
|
|
53
33
|
},
|
|
54
34
|
"peerDependencies": {
|
|
@@ -56,13 +36,22 @@
|
|
|
56
36
|
"react-dom": "^18.2.0",
|
|
57
37
|
"react-router-dom": "^6.9.0"
|
|
58
38
|
},
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
|
|
39
|
+
"files": [
|
|
40
|
+
"dist"
|
|
41
|
+
],
|
|
42
|
+
"publishConfig": {
|
|
43
|
+
"access": "public",
|
|
44
|
+
"directory": "package"
|
|
45
|
+
},
|
|
46
|
+
"gitHead": "b05a15b41bfa20c2c4e8bc248429a4a01b23784f",
|
|
47
|
+
"exports": {
|
|
48
|
+
".": {
|
|
49
|
+
"types": "./dist/types/index.d.ts",
|
|
50
|
+
"import": "./dist/esm/index.js",
|
|
51
|
+
"default": "./dist/esm/index.js"
|
|
52
|
+
},
|
|
53
|
+
"./package.json": "./package.json"
|
|
66
54
|
},
|
|
67
|
-
"
|
|
55
|
+
"types": "./dist/types/index.d.ts",
|
|
56
|
+
"module": "dist/esm/index.js"
|
|
68
57
|
}
|