@hitachivantara/app-shell-ui 1.5.0 → 1.6.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 +8 -6
- package/dist/esm/components/AppShellProvider/AppShellProvider.js +80 -56
- package/dist/esm/components/AppShellRoutes/AppShellRoutes.js +74 -65
- package/dist/esm/components/AppShellViewProvider/AppShellViewProvider.js +13 -13
- package/dist/esm/components/CustomHooksInitializer/CustomHooksInitializer.js +9 -5
- package/dist/esm/components/GlobalStyles/GlobalStyles.js +8 -8
- package/dist/esm/components/GlobalStyles/index.js +2 -3
- package/dist/esm/components/IconUiKit/IconUiKit.js +10 -8
- package/dist/esm/components/IconUiKit/index.js +4 -5
- package/dist/esm/components/hoc/withClickAwayListener.js +19 -12
- package/dist/esm/components/hoc/withGlobalProvider.js +30 -25
- package/dist/esm/components/layout/Header/BrandLogo/BrandLogo.js +27 -16
- package/dist/esm/components/layout/Header/BrandLogo/Logos/Hitachi.js +12 -0
- package/dist/esm/components/layout/Header/BrandLogo/Logos/Lumada.js +17 -0
- package/dist/esm/components/layout/Header/BrandLogo/Logos/Pentaho.js +12 -0
- package/dist/esm/components/layout/Header/Header.js +54 -42
- package/dist/esm/components/layout/Header/HeaderActions/DynamicAction/DynamicAction.js +22 -18
- package/dist/esm/components/layout/Header/HeaderActions/DynamicAction/index.js +2 -3
- package/dist/esm/components/layout/Header/HeaderActions/HeaderActions.js +17 -14
- package/dist/esm/components/layout/Header/HeaderActions/InternalActions/AppSwitcherToggle/AppSwitcherToggle.js +59 -40
- package/dist/esm/components/layout/Header/HeaderActions/InternalActions/AppSwitcherToggle/index.js +2 -3
- package/dist/esm/components/layout/Header/HeaderActions/InternalActions/AppSwitcherToggle/styles.js +6 -6
- package/dist/esm/components/layout/Header/HeaderActions/InternalActions/ColorModeSwitcher/ColorModeSwitcher.js +19 -17
- package/dist/esm/components/layout/Header/HeaderActions/InternalActions/ColorModeSwitcher/index.js +2 -3
- package/dist/esm/components/layout/Header/HeaderActions/InternalActions/HelpButton/HelpButton.js +23 -20
- package/dist/esm/components/layout/Header/HeaderActions/InternalActions/HelpButton/index.js +2 -3
- package/dist/esm/components/layout/Header/HeaderActions/InternalActions/InternalAction/InternalAction.js +23 -21
- package/dist/esm/components/layout/Header/HeaderActions/index.js +2 -3
- package/dist/esm/components/layout/Header/styles.js +7 -7
- package/dist/esm/components/layout/Loading/Loading.js +9 -7
- package/dist/esm/components/layout/Loading/styles.js +20 -8
- package/dist/esm/components/layout/Main/Main.js +23 -22
- package/dist/esm/components/layout/Main/styles.js +17 -8
- package/dist/esm/components/layout/VerticalNavigation/VerticalNavigation.js +67 -49
- package/dist/esm/components/layout/VerticalNavigation/styles.js +15 -16
- package/dist/esm/index.js +2 -3
- package/dist/esm/lib/hooks/useClearLocationState.js +14 -14
- package/dist/esm/lib/hooks/useCustomEventListener.js +19 -14
- package/dist/esm/lib/hooks/useLocalStorage.js +22 -16
- package/dist/esm/lib/hooks/useNavigationMenuItems.js +36 -28
- package/dist/esm/lib/hooks/useNotificationsEventListener.js +47 -37
- package/dist/esm/lib/hooks/useThemeEventListener.js +25 -20
- package/dist/esm/lib/i18n/index.js +23 -19
- package/dist/esm/lib/i18n/localization/en.json.js +18 -15
- package/dist/esm/lib/i18n/localization/pt.json.js +18 -15
- package/dist/esm/lib/utils/CombinedProviders.js +19 -14
- package/dist/esm/lib/utils/basePathUtils.js +4 -3
- package/dist/esm/lib/utils/documentUtil.js +10 -6
- package/dist/esm/lib/utils/navigationUtil.js +65 -38
- package/dist/esm/lib/utils/textUtil.js +4 -3
- package/dist/esm/pages/ErrorPage/ErrorPage.js +24 -24
- package/dist/esm/pages/ErrorPage/Footer/Footer.js +47 -31
- package/dist/esm/pages/ErrorPage/Footer/styles.js +8 -8
- package/dist/esm/pages/ErrorPage/styles.js +25 -15
- package/dist/esm/pages/GenericError/500.svg.js +2 -3
- package/dist/esm/pages/GenericError/GenericError.js +13 -13
- package/dist/esm/pages/LoadingPage/LoadingPage.js +12 -12
- package/dist/esm/pages/LoadingPage/index.js +2 -3
- package/dist/esm/pages/LoadingPage/styles.js +15 -9
- package/dist/esm/pages/NotFound/404.svg.js +2 -3
- package/dist/esm/pages/NotFound/NotFound.js +11 -11
- package/dist/esm/pages/NotFound/index.js +2 -3
- package/dist/esm/pages/Root/Root.js +22 -22
- package/dist/esm/providers/BannerProvider.js +67 -57
- package/dist/esm/providers/LayoutProvider.js +19 -16
- package/dist/esm/providers/NavigationProvider.js +87 -55
- package/dist/esm/providers/hooks/useBannerContext.js +9 -7
- package/dist/esm/providers/hooks/useLayoutContext.js +9 -7
- package/dist/esm/providers/hooks/useNavigationContext.js +9 -7
- package/package.json +5 -5
- package/dist/esm/components/AppShell/AppShell.js.map +0 -1
- package/dist/esm/components/AppShellProvider/AppShellProvider.js.map +0 -1
- package/dist/esm/components/AppShellRoutes/AppShellRoutes.js.map +0 -1
- package/dist/esm/components/AppShellViewProvider/AppShellViewProvider.js.map +0 -1
- package/dist/esm/components/CustomHooksInitializer/CustomHooksInitializer.js.map +0 -1
- package/dist/esm/components/GlobalStyles/GlobalStyles.js.map +0 -1
- package/dist/esm/components/GlobalStyles/index.js.map +0 -1
- package/dist/esm/components/IconUiKit/IconUiKit.js.map +0 -1
- package/dist/esm/components/IconUiKit/index.js.map +0 -1
- package/dist/esm/components/hoc/withClickAwayListener.js.map +0 -1
- package/dist/esm/components/hoc/withGlobalProvider.js.map +0 -1
- package/dist/esm/components/layout/Header/BrandLogo/BrandLogo.js.map +0 -1
- package/dist/esm/components/layout/Header/BrandLogo/Logos/Hitachi/Hitachi.js +0 -10
- package/dist/esm/components/layout/Header/BrandLogo/Logos/Hitachi/Hitachi.js.map +0 -1
- package/dist/esm/components/layout/Header/BrandLogo/Logos/Hitachi/styles.js +0 -28
- package/dist/esm/components/layout/Header/BrandLogo/Logos/Hitachi/styles.js.map +0 -1
- package/dist/esm/components/layout/Header/BrandLogo/Logos/Lumada/Lumada.js +0 -15
- package/dist/esm/components/layout/Header/BrandLogo/Logos/Lumada/Lumada.js.map +0 -1
- package/dist/esm/components/layout/Header/BrandLogo/Logos/Lumada/styles.js +0 -34
- package/dist/esm/components/layout/Header/BrandLogo/Logos/Lumada/styles.js.map +0 -1
- package/dist/esm/components/layout/Header/Header.js.map +0 -1
- package/dist/esm/components/layout/Header/HeaderActions/DynamicAction/DynamicAction.js.map +0 -1
- package/dist/esm/components/layout/Header/HeaderActions/DynamicAction/index.js.map +0 -1
- package/dist/esm/components/layout/Header/HeaderActions/HeaderActions.js.map +0 -1
- package/dist/esm/components/layout/Header/HeaderActions/InternalActions/AppSwitcherToggle/AppSwitcherToggle.js.map +0 -1
- package/dist/esm/components/layout/Header/HeaderActions/InternalActions/AppSwitcherToggle/index.js.map +0 -1
- package/dist/esm/components/layout/Header/HeaderActions/InternalActions/AppSwitcherToggle/styles.js.map +0 -1
- package/dist/esm/components/layout/Header/HeaderActions/InternalActions/ColorModeSwitcher/ColorModeSwitcher.js.map +0 -1
- package/dist/esm/components/layout/Header/HeaderActions/InternalActions/ColorModeSwitcher/index.js.map +0 -1
- package/dist/esm/components/layout/Header/HeaderActions/InternalActions/HelpButton/HelpButton.js.map +0 -1
- package/dist/esm/components/layout/Header/HeaderActions/InternalActions/HelpButton/index.js.map +0 -1
- package/dist/esm/components/layout/Header/HeaderActions/InternalActions/InternalAction/InternalAction.js.map +0 -1
- package/dist/esm/components/layout/Header/HeaderActions/index.js.map +0 -1
- package/dist/esm/components/layout/Header/styles.js.map +0 -1
- package/dist/esm/components/layout/Loading/Loading.js.map +0 -1
- package/dist/esm/components/layout/Loading/styles.js.map +0 -1
- package/dist/esm/components/layout/Main/Main.js.map +0 -1
- package/dist/esm/components/layout/Main/styles.js.map +0 -1
- package/dist/esm/components/layout/VerticalNavigation/VerticalNavigation.js.map +0 -1
- package/dist/esm/components/layout/VerticalNavigation/styles.js.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/lib/hooks/useClearLocationState.js.map +0 -1
- package/dist/esm/lib/hooks/useCustomEventListener.js.map +0 -1
- package/dist/esm/lib/hooks/useLocalStorage.js.map +0 -1
- package/dist/esm/lib/hooks/useNavigationMenuItems.js.map +0 -1
- package/dist/esm/lib/hooks/useNotificationsEventListener.js.map +0 -1
- package/dist/esm/lib/hooks/useThemeEventListener.js.map +0 -1
- package/dist/esm/lib/i18n/index.js.map +0 -1
- package/dist/esm/lib/i18n/localization/en.json.js.map +0 -1
- package/dist/esm/lib/i18n/localization/pt.json.js.map +0 -1
- package/dist/esm/lib/utils/CombinedProviders.js.map +0 -1
- package/dist/esm/lib/utils/basePathUtils.js.map +0 -1
- package/dist/esm/lib/utils/documentUtil.js.map +0 -1
- package/dist/esm/lib/utils/navigationUtil.js.map +0 -1
- package/dist/esm/lib/utils/textUtil.js.map +0 -1
- package/dist/esm/pages/ErrorPage/ErrorPage.js.map +0 -1
- package/dist/esm/pages/ErrorPage/Footer/Footer.js.map +0 -1
- package/dist/esm/pages/ErrorPage/Footer/styles.js.map +0 -1
- package/dist/esm/pages/ErrorPage/styles.js.map +0 -1
- package/dist/esm/pages/GenericError/500.svg.js.map +0 -1
- package/dist/esm/pages/GenericError/GenericError.js.map +0 -1
- package/dist/esm/pages/LoadingPage/LoadingPage.js.map +0 -1
- package/dist/esm/pages/LoadingPage/index.js.map +0 -1
- package/dist/esm/pages/LoadingPage/styles.js.map +0 -1
- package/dist/esm/pages/NotFound/404.svg.js.map +0 -1
- package/dist/esm/pages/NotFound/NotFound.js.map +0 -1
- package/dist/esm/pages/NotFound/index.js.map +0 -1
- package/dist/esm/pages/Root/Root.js.map +0 -1
- package/dist/esm/providers/BannerProvider.js.map +0 -1
- package/dist/esm/providers/LayoutProvider.js.map +0 -1
- package/dist/esm/providers/NavigationProvider.js.map +0 -1
- package/dist/esm/providers/hooks/useBannerContext.js.map +0 -1
- package/dist/esm/providers/hooks/useLayoutContext.js.map +0 -1
- package/dist/esm/providers/hooks/useNavigationContext.js.map +0 -1
|
@@ -1,27 +1,32 @@
|
|
|
1
|
-
import { useTheme
|
|
2
|
-
import
|
|
3
|
-
const
|
|
1
|
+
import { useTheme } from "@hitachivantara/uikit-react-core";
|
|
2
|
+
import useLocalStorage from "./useLocalStorage.js";
|
|
3
|
+
const useThemeEventListener = () => {
|
|
4
4
|
const {
|
|
5
|
-
selectedTheme
|
|
6
|
-
changeTheme
|
|
7
|
-
selectedMode
|
|
8
|
-
colorModes
|
|
9
|
-
} =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
selectedTheme,
|
|
6
|
+
changeTheme,
|
|
7
|
+
selectedMode,
|
|
8
|
+
colorModes
|
|
9
|
+
} = useTheme();
|
|
10
|
+
const {
|
|
11
|
+
setStoredValue
|
|
12
|
+
} = useLocalStorage("COLOR_MODE");
|
|
13
|
+
const getNextColorMode = () => {
|
|
14
|
+
const index = colorModes.indexOf(selectedMode);
|
|
15
|
+
const nextIndex = (index + 1) % colorModes.length;
|
|
16
|
+
return colorModes[nextIndex];
|
|
17
|
+
};
|
|
18
|
+
const handleThemeEvent = (event) => {
|
|
19
|
+
const {
|
|
20
|
+
colorMode
|
|
21
|
+
} = event.detail;
|
|
22
|
+
const newColorMode = !colorMode || colorModes.indexOf(colorMode) === -1 ? getNextColorMode() : colorMode;
|
|
23
|
+
changeTheme(selectedTheme, newColorMode);
|
|
24
|
+
setStoredValue(newColorMode);
|
|
14
25
|
};
|
|
15
26
|
return {
|
|
16
|
-
handleThemeEvent
|
|
17
|
-
const {
|
|
18
|
-
colorMode: e
|
|
19
|
-
} = t.detail, n = !e || o.indexOf(e) === -1 ? l() : e;
|
|
20
|
-
d(s, n), c(n);
|
|
21
|
-
}
|
|
27
|
+
handleThemeEvent
|
|
22
28
|
};
|
|
23
29
|
};
|
|
24
30
|
export {
|
|
25
|
-
|
|
31
|
+
useThemeEventListener as default
|
|
26
32
|
};
|
|
27
|
-
//# sourceMappingURL=useThemeEventListener.js.map
|
|
@@ -1,29 +1,33 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { initReactI18next
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import i18next from "i18next";
|
|
2
|
+
import { initReactI18next } from "react-i18next";
|
|
3
|
+
import LanguageDetector from "i18next-browser-languagedetector";
|
|
4
|
+
import en from "./localization/en.json.js";
|
|
5
|
+
import pt from "./localization/pt.json.js";
|
|
6
|
+
const APP_SHELL_NAMESPACE = "appShell";
|
|
7
|
+
const addResourceBundles = (i18nInstance, bundles, namespace) => {
|
|
8
|
+
Object.entries(bundles).forEach((entry) => {
|
|
9
|
+
const [key, value] = entry;
|
|
10
|
+
i18nInstance.addResourceBundle(key, namespace ?? APP_SHELL_NAMESPACE, value);
|
|
10
11
|
});
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
};
|
|
13
|
+
const createI18Next = () => {
|
|
14
|
+
const newInstance = i18next.createInstance();
|
|
15
|
+
newInstance.use(LanguageDetector).use(initReactI18next).init({
|
|
16
|
+
defaultNS: APP_SHELL_NAMESPACE,
|
|
15
17
|
fallbackLng: "en",
|
|
16
18
|
detection: {
|
|
17
19
|
order: ["navigator"]
|
|
18
20
|
},
|
|
19
21
|
resources: {}
|
|
20
|
-
})
|
|
21
|
-
|
|
22
|
+
});
|
|
23
|
+
newInstance.addResourceBundle("en", APP_SHELL_NAMESPACE, en);
|
|
24
|
+
newInstance.addResourceBundle("pt", APP_SHELL_NAMESPACE, pt);
|
|
25
|
+
return {
|
|
26
|
+
i18n: newInstance
|
|
22
27
|
};
|
|
23
28
|
};
|
|
24
29
|
export {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
30
|
+
APP_SHELL_NAMESPACE,
|
|
31
|
+
addResourceBundles,
|
|
32
|
+
createI18Next as default
|
|
28
33
|
};
|
|
29
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const errors = {
|
|
2
2
|
missing: {
|
|
3
3
|
configuration: "Missing or incomplete configuration."
|
|
4
4
|
},
|
|
@@ -13,7 +13,8 @@ const a = {
|
|
|
13
13
|
image_description: "500 Generic error"
|
|
14
14
|
},
|
|
15
15
|
footer: "Click <navigate>here</navigate> to go back to the {{label}} page."
|
|
16
|
-
}
|
|
16
|
+
};
|
|
17
|
+
const header = {
|
|
17
18
|
helpUrl: {
|
|
18
19
|
documentationLink: "Documentation link"
|
|
19
20
|
},
|
|
@@ -28,28 +29,30 @@ const a = {
|
|
|
28
29
|
colorModeSwitcher: {
|
|
29
30
|
ariaLabel: "Switch color mode"
|
|
30
31
|
}
|
|
31
|
-
}
|
|
32
|
+
};
|
|
33
|
+
const verticalNavigation = {
|
|
32
34
|
ariaLabelNavigationTree: "Vertical navigation",
|
|
33
35
|
ariaLabelCollapse: "Collapse vertical navigation",
|
|
34
36
|
ariaLabelExpand: "Expand vertical navigation",
|
|
35
37
|
title: "Menu",
|
|
36
38
|
ariaLabelSliderForwardButton: "Navigate to submenu",
|
|
37
39
|
ariaLabelHeaderBackButton: "Back"
|
|
38
|
-
}
|
|
40
|
+
};
|
|
41
|
+
const notifications = {
|
|
39
42
|
banner: {
|
|
40
43
|
close: "Close banner"
|
|
41
44
|
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
};
|
|
46
|
+
const en = {
|
|
47
|
+
errors,
|
|
48
|
+
header,
|
|
49
|
+
verticalNavigation,
|
|
50
|
+
notifications
|
|
47
51
|
};
|
|
48
52
|
export {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
53
|
+
en as default,
|
|
54
|
+
errors,
|
|
55
|
+
header,
|
|
56
|
+
notifications,
|
|
57
|
+
verticalNavigation
|
|
54
58
|
};
|
|
55
|
-
//# sourceMappingURL=en.json.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const
|
|
1
|
+
const errors = {
|
|
2
2
|
missing: {
|
|
3
3
|
configuration: "Configuração em falta ou incompleta."
|
|
4
4
|
},
|
|
@@ -13,7 +13,8 @@ const a = {
|
|
|
13
13
|
image_description: "500 Erro genérico"
|
|
14
14
|
},
|
|
15
15
|
footer: "Carregue <navigate>aqui</navigate> para voltar à página {{label}}."
|
|
16
|
-
}
|
|
16
|
+
};
|
|
17
|
+
const header = {
|
|
17
18
|
helpUrl: {
|
|
18
19
|
documentationLink: "Link de documentação"
|
|
19
20
|
},
|
|
@@ -28,28 +29,30 @@ const a = {
|
|
|
28
29
|
colorModeSwitcher: {
|
|
29
30
|
ariaLabel: "Alternar modo de cor"
|
|
30
31
|
}
|
|
31
|
-
}
|
|
32
|
+
};
|
|
33
|
+
const verticalNavigation = {
|
|
32
34
|
ariaLabelNavigationTree: "Navegação vertical",
|
|
33
35
|
ariaLabelCollapse: "Recolher navegação vertical",
|
|
34
36
|
ariaLabelExpand: "Expandir navegação vertical",
|
|
35
37
|
title: "Menu",
|
|
36
38
|
ariaLabelSliderForwardButton: "Navegar para submenu",
|
|
37
39
|
ariaLabelHeaderBackButton: "Voltar"
|
|
38
|
-
}
|
|
40
|
+
};
|
|
41
|
+
const notifications = {
|
|
39
42
|
banner: {
|
|
40
43
|
close: "Fechar barra de notificação"
|
|
41
44
|
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
};
|
|
46
|
+
const pt = {
|
|
47
|
+
errors,
|
|
48
|
+
header,
|
|
49
|
+
verticalNavigation,
|
|
50
|
+
notifications
|
|
47
51
|
};
|
|
48
52
|
export {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
53
|
+
pt as default,
|
|
54
|
+
errors,
|
|
55
|
+
header,
|
|
56
|
+
notifications,
|
|
57
|
+
verticalNavigation
|
|
54
58
|
};
|
|
55
|
-
//# sourceMappingURL=pt.json.js.map
|
|
@@ -1,18 +1,23 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import { useCallback
|
|
3
|
-
const
|
|
4
|
-
providers
|
|
5
|
-
children:
|
|
1
|
+
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { useCallback } from "react";
|
|
3
|
+
const CombinedProviders = ({
|
|
4
|
+
providers,
|
|
5
|
+
children: mainChildren
|
|
6
6
|
}) => {
|
|
7
|
-
const
|
|
8
|
-
children
|
|
7
|
+
const Combined = useCallback(({
|
|
8
|
+
children
|
|
9
9
|
}) => {
|
|
10
|
-
let
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
},
|
|
10
|
+
let result = children;
|
|
11
|
+
if (providers && providers.length > 0) {
|
|
12
|
+
result = providers.reduceRight((Acc, Curr) => {
|
|
13
|
+
return /* @__PURE__ */ jsx(Curr, { children: Acc });
|
|
14
|
+
}, children);
|
|
15
|
+
}
|
|
16
|
+
return result;
|
|
17
|
+
}, [providers]);
|
|
18
|
+
return /* @__PURE__ */ jsx(Combined, { children: mainChildren });
|
|
19
|
+
};
|
|
20
|
+
const CombinedProviders$1 = CombinedProviders;
|
|
15
21
|
export {
|
|
16
|
-
|
|
22
|
+
CombinedProviders$1 as default
|
|
17
23
|
};
|
|
18
|
-
//# sourceMappingURL=CombinedProviders.js.map
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
3
|
-
let
|
|
4
|
-
|
|
1
|
+
const createAppContainerElement = (id) => {
|
|
2
|
+
const panelContainerId = "app-shell-panel-container";
|
|
3
|
+
let panelContainerElement = document.getElementById(id ?? panelContainerId);
|
|
4
|
+
if (!panelContainerElement) {
|
|
5
|
+
panelContainerElement = document.createElement("div");
|
|
6
|
+
panelContainerElement.id = panelContainerId;
|
|
7
|
+
document.body.appendChild(panelContainerElement);
|
|
8
|
+
}
|
|
9
|
+
return panelContainerElement;
|
|
5
10
|
};
|
|
6
11
|
export {
|
|
7
|
-
|
|
12
|
+
createAppContainerElement as default
|
|
8
13
|
};
|
|
9
|
-
//# sourceMappingURL=documentUtil.js.map
|
|
@@ -1,41 +1,68 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import IconUiKit from "../../components/IconUiKit/index.js";
|
|
3
|
+
const createNavigationMenuItems = (t, menuItems, maxDepth) => {
|
|
4
|
+
if (maxDepth !== void 0 && maxDepth <= 0) {
|
|
5
|
+
return [];
|
|
6
|
+
}
|
|
7
|
+
return menuItems?.reduce((accumulator, currentValue) => {
|
|
8
|
+
const updatedDepth = maxDepth !== void 0 ? maxDepth - 1 : void 0;
|
|
9
|
+
const navItem = {
|
|
10
|
+
...currentValue,
|
|
11
|
+
icon: currentValue.icon ? /* @__PURE__ */ jsx(IconUiKit, { name: currentValue.icon?.name || "" }) : null,
|
|
12
|
+
data: currentValue.data ? createNavigationMenuItems(t, currentValue.data, updatedDepth) : void 0
|
|
13
|
+
};
|
|
14
|
+
accumulator.push(navItem);
|
|
15
|
+
return accumulator;
|
|
16
|
+
}, []) ?? [];
|
|
17
|
+
};
|
|
18
|
+
const findItemById = (data, itemId) => {
|
|
19
|
+
let foundItem = null;
|
|
20
|
+
data.some((obj) => {
|
|
14
21
|
const {
|
|
15
|
-
id:
|
|
16
|
-
data:
|
|
17
|
-
} =
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}
|
|
22
|
+
id: objId,
|
|
23
|
+
data: childData
|
|
24
|
+
} = obj;
|
|
25
|
+
if (objId === itemId) {
|
|
26
|
+
foundItem = obj;
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
if (childData && childData.length > 0) {
|
|
30
|
+
foundItem = findItemById(childData, itemId);
|
|
31
|
+
return foundItem !== null;
|
|
32
|
+
}
|
|
33
|
+
return false;
|
|
34
|
+
});
|
|
35
|
+
return foundItem;
|
|
36
|
+
};
|
|
37
|
+
const getAppIdFromBundle = (bundle) => {
|
|
38
|
+
const bundleTokens = bundle.split("/");
|
|
39
|
+
let appId;
|
|
40
|
+
if (bundleTokens[0].startsWith("@")) {
|
|
41
|
+
appId = `${bundleTokens[0]}/${bundleTokens[1]}`;
|
|
42
|
+
} else {
|
|
43
|
+
[appId] = bundleTokens;
|
|
44
|
+
}
|
|
45
|
+
return appId;
|
|
46
|
+
};
|
|
47
|
+
const removeHrefFromMenuItemsWithChildren = (items) => {
|
|
48
|
+
return items.map((item) => {
|
|
49
|
+
const {
|
|
50
|
+
href,
|
|
51
|
+
data,
|
|
52
|
+
...rest
|
|
53
|
+
} = item;
|
|
54
|
+
if (data && data.length > 0) {
|
|
55
|
+
return {
|
|
56
|
+
...rest,
|
|
57
|
+
data: removeHrefFromMenuItemsWithChildren(data)
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
return item;
|
|
61
|
+
});
|
|
62
|
+
};
|
|
35
63
|
export {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
64
|
+
createNavigationMenuItems,
|
|
65
|
+
findItemById,
|
|
66
|
+
getAppIdFromBundle,
|
|
67
|
+
removeHrefFromMenuItemsWithChildren
|
|
40
68
|
};
|
|
41
|
-
//# sourceMappingURL=navigationUtil.js.map
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
import { jsxs
|
|
2
|
-
import { HvTypography
|
|
3
|
-
import
|
|
4
|
-
import { StyledErrorPage
|
|
5
|
-
import
|
|
6
|
-
const
|
|
7
|
-
code
|
|
8
|
-
title
|
|
9
|
-
background
|
|
10
|
-
backgroundLabel
|
|
11
|
-
fullPage
|
|
12
|
-
includeFooter
|
|
1
|
+
import { jsxs, jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { HvTypography } from "@hitachivantara/uikit-react-core";
|
|
3
|
+
import useNavigationContext from "../../providers/hooks/useNavigationContext.js";
|
|
4
|
+
import { StyledErrorPage, StyledTitleWrapper, StyledImageWrapper } from "./styles.js";
|
|
5
|
+
import Footer from "./Footer/Footer.js";
|
|
6
|
+
const ErrorPage = ({
|
|
7
|
+
code = void 0,
|
|
8
|
+
title,
|
|
9
|
+
background,
|
|
10
|
+
backgroundLabel,
|
|
11
|
+
fullPage = false,
|
|
12
|
+
includeFooter = true
|
|
13
13
|
}) => {
|
|
14
14
|
const {
|
|
15
|
-
isCompactMode
|
|
16
|
-
showHeaderSubMenu
|
|
17
|
-
} =
|
|
18
|
-
return /* @__PURE__ */
|
|
19
|
-
/* @__PURE__ */
|
|
20
|
-
|
|
21
|
-
/* @__PURE__ */
|
|
15
|
+
isCompactMode,
|
|
16
|
+
showHeaderSubMenu
|
|
17
|
+
} = useNavigationContext();
|
|
18
|
+
return /* @__PURE__ */ jsxs(StyledErrorPage, { showHeaderSubMenu, isCompactMode, fullPage, children: [
|
|
19
|
+
/* @__PURE__ */ jsxs(StyledTitleWrapper, { children: [
|
|
20
|
+
code && /* @__PURE__ */ jsx(HvTypography, { variant: "title1", children: code }),
|
|
21
|
+
/* @__PURE__ */ jsx(HvTypography, { variant: isCompactMode ? "xsTitle" : "display", children: title })
|
|
22
22
|
] }),
|
|
23
|
-
/* @__PURE__ */
|
|
24
|
-
|
|
23
|
+
/* @__PURE__ */ jsx(StyledImageWrapper, { backgroundImage: background, role: "img", "aria-label": backgroundLabel }),
|
|
24
|
+
includeFooter && /* @__PURE__ */ jsx(Footer, {})
|
|
25
25
|
] });
|
|
26
|
-
}
|
|
26
|
+
};
|
|
27
|
+
const ErrorPage$1 = ErrorPage;
|
|
27
28
|
export {
|
|
28
|
-
|
|
29
|
+
ErrorPage$1 as default
|
|
29
30
|
};
|
|
30
|
-
//# sourceMappingURL=ErrorPage.js.map
|
|
@@ -1,38 +1,54 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import { useTranslation
|
|
3
|
-
import { useErrorBoundary
|
|
4
|
-
import { HvTypography
|
|
5
|
-
import { useHvAppShellConfig
|
|
6
|
-
import { useHvNavigation
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
const
|
|
1
|
+
import { jsx } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { useTranslation, Trans } from "react-i18next";
|
|
3
|
+
import { useErrorBoundary } from "react-error-boundary";
|
|
4
|
+
import { HvTypography } from "@hitachivantara/uikit-react-core";
|
|
5
|
+
import { useHvAppShellConfig } from "@hitachivantara/app-shell-shared";
|
|
6
|
+
import { useHvNavigation } from "@hitachivantara/app-shell-navigation";
|
|
7
|
+
import useNavigationContext from "../../../providers/hooks/useNavigationContext.js";
|
|
8
|
+
import StyledFooterWrapper from "./styles.js";
|
|
9
|
+
const Footer = () => {
|
|
10
10
|
const {
|
|
11
|
-
t
|
|
12
|
-
} =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
} =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
11
|
+
t
|
|
12
|
+
} = useTranslation();
|
|
13
|
+
const {
|
|
14
|
+
navigate
|
|
15
|
+
} = useHvNavigation();
|
|
16
|
+
const {
|
|
17
|
+
navigationMode
|
|
18
|
+
} = useHvAppShellConfig();
|
|
19
|
+
const {
|
|
20
|
+
resetBoundary
|
|
21
|
+
} = useErrorBoundary();
|
|
22
|
+
const {
|
|
23
|
+
items,
|
|
24
|
+
verticalNavigationItems,
|
|
25
|
+
isCompactMode
|
|
26
|
+
} = useNavigationContext();
|
|
27
|
+
const getFirstMenuItem = () => {
|
|
28
|
+
if (!isCompactMode && navigationMode !== "ONLY_LEFT") {
|
|
29
|
+
return items.length > 0 ? items[0] : null;
|
|
27
30
|
}
|
|
31
|
+
return verticalNavigationItems.length > 0 ? verticalNavigationItems[0] : null;
|
|
28
32
|
};
|
|
29
|
-
|
|
30
|
-
|
|
33
|
+
const firstMenuItem = getFirstMenuItem();
|
|
34
|
+
const handleClick = (event) => {
|
|
35
|
+
event.preventDefault();
|
|
36
|
+
if (firstMenuItem?.href) {
|
|
37
|
+
resetBoundary();
|
|
38
|
+
let path = firstMenuItem.href;
|
|
39
|
+
if (path.startsWith(".")) {
|
|
40
|
+
path = path.substring(1);
|
|
41
|
+
}
|
|
42
|
+
navigate(path);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
return firstMenuItem && /* @__PURE__ */ jsx(StyledFooterWrapper, { children: /* @__PURE__ */ jsx(HvTypography, { variant: "body", children: /* @__PURE__ */ jsx(Trans, { t, i18nKey: "errors.footer", values: {
|
|
46
|
+
label: firstMenuItem.label
|
|
31
47
|
}, components: {
|
|
32
|
-
navigate: /* @__PURE__ */
|
|
48
|
+
navigate: /* @__PURE__ */ jsx(HvTypography, { link: true, component: "a", href: firstMenuItem.href, variant: "label", onClick: handleClick, children: firstMenuItem.label })
|
|
33
49
|
} }) }) });
|
|
34
|
-
}
|
|
50
|
+
};
|
|
51
|
+
const Footer$1 = Footer;
|
|
35
52
|
export {
|
|
36
|
-
|
|
53
|
+
Footer$1 as default
|
|
37
54
|
};
|
|
38
|
-
//# sourceMappingURL=Footer.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
function
|
|
1
|
+
import _styled from "@emotion/styled/base";
|
|
2
|
+
function _EMOTION_STRINGIFIED_CSS_ERROR__() {
|
|
3
3
|
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
|
|
4
4
|
}
|
|
5
|
-
const
|
|
5
|
+
const FooterWrapper = /* @__PURE__ */ _styled("div", process.env.NODE_ENV === "production" ? {
|
|
6
6
|
target: "e1bsjpnp0"
|
|
7
7
|
} : {
|
|
8
8
|
target: "e1bsjpnp0",
|
|
@@ -14,10 +14,10 @@ const c = /* @__PURE__ */ e("div", process.env.NODE_ENV === "production" ? {
|
|
|
14
14
|
name: "1azakc",
|
|
15
15
|
styles: "text-align:center",
|
|
16
16
|
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9fX3cvaHYtYXBwLXNoZWxsL2h2LWFwcC1zaGVsbC9jbGllbnQvcGFja2FnZXMvYXBwLXNoZWxsLXVpL3NyYy9wYWdlcy9FcnJvclBhZ2UvRm9vdGVyL3N0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFFdUMiLCJmaWxlIjoiL19fdy9odi1hcHAtc2hlbGwvaHYtYXBwLXNoZWxsL2NsaWVudC9wYWNrYWdlcy9hcHAtc2hlbGwtdWkvc3JjL3BhZ2VzL0Vycm9yUGFnZS9Gb290ZXIvc3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHN0eWxlZCBmcm9tIFwiQGVtb3Rpb24vc3R5bGVkXCI7XHJcblxyXG5leHBvcnQgY29uc3QgRm9vdGVyV3JhcHBlciA9IHN0eWxlZC5kaXZgXHJcbiAgdGV4dC1hbGlnbjogY2VudGVyO1xyXG5gO1xyXG5cclxuZXhwb3J0IGRlZmF1bHQgRm9vdGVyV3JhcHBlcjtcclxuIl19 */",
|
|
17
|
-
toString:
|
|
18
|
-
})
|
|
17
|
+
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
18
|
+
});
|
|
19
|
+
const StyledFooterWrapper = FooterWrapper;
|
|
19
20
|
export {
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
FooterWrapper,
|
|
22
|
+
StyledFooterWrapper as default
|
|
22
23
|
};
|
|
23
|
-
//# sourceMappingURL=styles.js.map
|