@hitachivantara/app-shell-ui 1.6.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 -17
- package/dist/esm/components/layout/Header/BrandLogo/Logos/Hitachi.js +10 -8
- package/dist/esm/components/layout/Header/BrandLogo/Logos/Lumada.js +15 -13
- package/dist/esm/components/layout/Header/BrandLogo/Logos/Pentaho.js +10 -8
- 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 +57 -46
- 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.js.map +0 -1
- package/dist/esm/components/layout/Header/BrandLogo/Logos/Lumada.js.map +0 -1
- package/dist/esm/components/layout/Header/BrandLogo/Logos/Pentaho.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,33 +1,41 @@
|
|
|
1
|
-
import { useContext
|
|
2
|
-
import { useLocation
|
|
3
|
-
import { useHvAppShellConfig
|
|
4
|
-
import { useHvNavigation
|
|
5
|
-
import { createNavigationMenuItems
|
|
6
|
-
const
|
|
1
|
+
import { useContext, useMemo, useEffect } from "react";
|
|
2
|
+
import { useLocation } from "react-router-dom";
|
|
3
|
+
import { useHvAppShellConfig, HvAppShellRuntimeContext, CONFIG_TRANSLATIONS_NAMESPACE, useHvMenuItems } from "@hitachivantara/app-shell-shared";
|
|
4
|
+
import { useHvNavigation } from "@hitachivantara/app-shell-navigation";
|
|
5
|
+
import { createNavigationMenuItems } from "../utils/navigationUtil.js";
|
|
6
|
+
const MAX_TOP_MENU_DEPTH = 2;
|
|
7
|
+
const useNavigationMenuItems = () => {
|
|
7
8
|
const {
|
|
8
|
-
pathname
|
|
9
|
-
} =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
} =
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
9
|
+
pathname
|
|
10
|
+
} = useLocation();
|
|
11
|
+
const {
|
|
12
|
+
navigationMode
|
|
13
|
+
} = useHvAppShellConfig();
|
|
14
|
+
const {
|
|
15
|
+
navigate
|
|
16
|
+
} = useHvNavigation();
|
|
17
|
+
const {
|
|
18
|
+
i18n
|
|
19
|
+
} = useContext(HvAppShellRuntimeContext) ?? {};
|
|
20
|
+
const tConfig = useMemo(() => i18n?.getFixedT(i18n.language, CONFIG_TRANSLATIONS_NAMESPACE) ?? // should not happen, but fallback if the i18n instance is not available
|
|
21
|
+
((l) => l), [i18n]);
|
|
22
|
+
const {
|
|
23
|
+
items,
|
|
24
|
+
selectedMenuItemId,
|
|
25
|
+
rootMenuItemId
|
|
26
|
+
} = useHvMenuItems();
|
|
27
|
+
const navigationMenuItemsTmp = createNavigationMenuItems(tConfig, items, navigationMode === "ONLY_TOP" ? MAX_TOP_MENU_DEPTH : void 0);
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
if (!selectedMenuItemId && pathname === "/" && items[0]?.href) {
|
|
30
|
+
navigate(items[0].href);
|
|
31
|
+
}
|
|
32
|
+
}, [pathname, items, navigate, selectedMenuItemId]);
|
|
33
|
+
return {
|
|
34
|
+
items: navigationMenuItemsTmp,
|
|
35
|
+
selectedMenuItemId,
|
|
36
|
+
rootMenuItemId
|
|
28
37
|
};
|
|
29
38
|
};
|
|
30
39
|
export {
|
|
31
|
-
|
|
40
|
+
useNavigationMenuItems as default
|
|
32
41
|
};
|
|
33
|
-
//# sourceMappingURL=useNavigationMenuItems.js.map
|
|
@@ -1,45 +1,55 @@
|
|
|
1
|
-
import { useHvSnackbar
|
|
2
|
-
import
|
|
3
|
-
const
|
|
1
|
+
import { useHvSnackbar } from "@hitachivantara/uikit-react-core";
|
|
2
|
+
import useBannerContext from "../../providers/hooks/useBannerContext.js";
|
|
3
|
+
const useNotificationsEventListener = () => {
|
|
4
4
|
const {
|
|
5
|
-
enqueueSnackbar
|
|
6
|
-
} =
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
enqueueSnackbar
|
|
6
|
+
} = useHvSnackbar();
|
|
7
|
+
const {
|
|
8
|
+
show
|
|
9
|
+
} = useBannerContext();
|
|
10
|
+
const handleCustomEventSnackbar = (notification) => {
|
|
9
11
|
const {
|
|
10
|
-
message
|
|
11
|
-
variant
|
|
12
|
-
actions
|
|
13
|
-
actionsCallback
|
|
14
|
-
} =
|
|
15
|
-
let
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
12
|
+
message,
|
|
13
|
+
variant,
|
|
14
|
+
actions,
|
|
15
|
+
actionsCallback
|
|
16
|
+
} = notification;
|
|
17
|
+
let snackbarContentProps;
|
|
18
|
+
if (actions) {
|
|
19
|
+
snackbarContentProps = {
|
|
20
|
+
action: Array.isArray(actions) ? actions[0] : actions,
|
|
21
|
+
actionCallback: actionsCallback
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
if (message) {
|
|
25
|
+
enqueueSnackbar(message, {
|
|
26
|
+
variant: variant ?? "default",
|
|
27
|
+
snackbarContentProps
|
|
28
|
+
});
|
|
29
|
+
}
|
|
25
30
|
};
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
switch (n.type) {
|
|
30
|
-
case "snackbar":
|
|
31
|
-
i(n);
|
|
32
|
-
break;
|
|
33
|
-
case "banner":
|
|
34
|
-
c(n);
|
|
35
|
-
break;
|
|
36
|
-
default:
|
|
37
|
-
console.warn("Invalid notification type", n.type);
|
|
38
|
-
}
|
|
31
|
+
const handleCustomEventBanner = (notification) => {
|
|
32
|
+
if (notification.message) {
|
|
33
|
+
show(notification);
|
|
39
34
|
}
|
|
40
35
|
};
|
|
36
|
+
const handleNotificationEvent = (event) => {
|
|
37
|
+
const notificationEvent = event.detail;
|
|
38
|
+
switch (notificationEvent.type) {
|
|
39
|
+
case "snackbar":
|
|
40
|
+
handleCustomEventSnackbar(notificationEvent);
|
|
41
|
+
break;
|
|
42
|
+
case "banner":
|
|
43
|
+
handleCustomEventBanner(notificationEvent);
|
|
44
|
+
break;
|
|
45
|
+
default:
|
|
46
|
+
console.warn("Invalid notification type", notificationEvent.type);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
return {
|
|
50
|
+
handleNotificationEvent
|
|
51
|
+
};
|
|
41
52
|
};
|
|
42
53
|
export {
|
|
43
|
-
|
|
54
|
+
useNotificationsEventListener as default
|
|
44
55
|
};
|
|
45
|
-
//# sourceMappingURL=useNotificationsEventListener.js.map
|
|
@@ -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
|