@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,21 +1,17 @@
|
|
|
1
|
-
import { jsx } from "
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useContext, useState, useEffect, useMemo } from "react";
|
|
3
|
-
import { HvAppShellContext, HvAppShellRuntimeContext, HvAppShellCombinedProvidersContext, CONFIG_TRANSLATIONS_NAMESPACE } from "@hitachivantara/app-shell-shared";
|
|
4
3
|
import { I18nContext } from "react-i18next";
|
|
4
|
+
import { HvAppShellContext, HvAppShellRuntimeContext, HvAppShellCombinedProvidersContext, CONFIG_TRANSLATIONS_NAMESPACE } from "@hitachivantara/app-shell-shared";
|
|
5
5
|
import { themes, HvProvider } from "@hitachivantara/uikit-react-core";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
6
|
+
import useLocalStorage from "../../hooks/useLocalStorage.js";
|
|
7
|
+
import { addResourceBundles } from "../../i18n/index.js";
|
|
8
8
|
const AppShellProvider = ({
|
|
9
9
|
children,
|
|
10
10
|
config: localConfig,
|
|
11
11
|
configUrl
|
|
12
12
|
}) => {
|
|
13
|
-
const {
|
|
14
|
-
|
|
15
|
-
} = useContext(I18nContext);
|
|
16
|
-
const {
|
|
17
|
-
value: storedColorModeValue
|
|
18
|
-
} = useLocalStorage("COLOR_MODE");
|
|
13
|
+
const { i18n } = useContext(I18nContext);
|
|
14
|
+
const { value: storedColorModeValue } = useLocalStorage("COLOR_MODE");
|
|
19
15
|
const [loadedConfig, setLoadedConfig] = useState(void 0);
|
|
20
16
|
const [hasError, setHasError] = useState(false);
|
|
21
17
|
useEffect(() => {
|
|
@@ -23,31 +19,43 @@ const AppShellProvider = ({
|
|
|
23
19
|
fetch(new URL(configUrl)).then((result) => {
|
|
24
20
|
return result.json();
|
|
25
21
|
}).then((data) => setLoadedConfig(data)).catch((e) => {
|
|
26
|
-
console.error(
|
|
22
|
+
console.error(
|
|
23
|
+
`It was not possible to obtain the context from: ${configUrl}`,
|
|
24
|
+
e
|
|
25
|
+
);
|
|
27
26
|
setLoadedConfig(void 0);
|
|
28
27
|
setHasError(true);
|
|
29
28
|
});
|
|
30
29
|
}
|
|
31
30
|
}, [localConfig, configUrl]);
|
|
32
|
-
const theConfig = useMemo(
|
|
31
|
+
const theConfig = useMemo(
|
|
32
|
+
() => localConfig ?? loadedConfig,
|
|
33
|
+
[localConfig, loadedConfig]
|
|
34
|
+
);
|
|
33
35
|
if (hasError) {
|
|
34
36
|
throw Error("It was not possible to obtain the configuration");
|
|
35
37
|
}
|
|
36
38
|
if (theConfig?.translations) {
|
|
37
|
-
addResourceBundles(
|
|
39
|
+
addResourceBundles(
|
|
40
|
+
i18n,
|
|
41
|
+
theConfig.translations,
|
|
42
|
+
CONFIG_TRANSLATIONS_NAMESPACE
|
|
43
|
+
);
|
|
38
44
|
}
|
|
39
45
|
const [themes$1, setThemes] = useState(void 0);
|
|
40
46
|
const [providers, setProviders] = useState(void 0);
|
|
41
47
|
useEffect(() => {
|
|
42
48
|
if (theConfig?.theming?.themes) {
|
|
43
|
-
Promise.all(
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
Promise.all(
|
|
50
|
+
theConfig.theming.themes?.map((bundle) => {
|
|
51
|
+
return themes[bundle] ?? import(
|
|
52
|
+
/* @vite-ignore */
|
|
53
|
+
bundle
|
|
54
|
+
).then((module) => module.default).catch((e) => {
|
|
55
|
+
console.error(`Import of theme bundle ${bundle} failed! ${e}`);
|
|
56
|
+
});
|
|
57
|
+
})
|
|
58
|
+
).then((loadedThemes) => {
|
|
51
59
|
setThemes(loadedThemes.filter((theme) => !!theme));
|
|
52
60
|
}).catch((e) => {
|
|
53
61
|
console.error(`Import of themes failed! ${e}`);
|
|
@@ -56,28 +64,48 @@ const AppShellProvider = ({
|
|
|
56
64
|
}, [theConfig?.theming?.themes]);
|
|
57
65
|
useEffect(() => {
|
|
58
66
|
if (theConfig?.providers) {
|
|
59
|
-
Promise.all(
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
+
Promise.all(
|
|
68
|
+
theConfig.providers.map((provider) => {
|
|
69
|
+
return import(
|
|
70
|
+
/* @vite-ignore */
|
|
71
|
+
provider.bundle
|
|
72
|
+
).then((module) => module.default).catch((e) => {
|
|
73
|
+
console.error(
|
|
74
|
+
`Import of provider '${provider.bundle}' failed! ${e}`
|
|
75
|
+
);
|
|
76
|
+
});
|
|
77
|
+
})
|
|
78
|
+
).then(
|
|
79
|
+
(loadedProviders) => setProviders(loadedProviders.filter((provider) => !!provider))
|
|
80
|
+
).catch((e) => {
|
|
67
81
|
console.error(`Import of providers failed!`, e);
|
|
68
82
|
});
|
|
69
83
|
}
|
|
70
84
|
}, [theConfig?.providers]);
|
|
71
|
-
const runtimeContext = useMemo(
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
85
|
+
const runtimeContext = useMemo(
|
|
86
|
+
() => ({
|
|
87
|
+
i18n
|
|
88
|
+
}),
|
|
89
|
+
[i18n]
|
|
90
|
+
);
|
|
91
|
+
const providersContext = useMemo(
|
|
92
|
+
() => ({
|
|
93
|
+
providers
|
|
94
|
+
}),
|
|
95
|
+
[providers]
|
|
96
|
+
);
|
|
77
97
|
if (!theConfig || theConfig.theming?.themes && !themes$1 || theConfig.providers != null && providers === void 0) {
|
|
78
98
|
return null;
|
|
79
99
|
}
|
|
80
|
-
return /* @__PURE__ */ jsx(HvAppShellContext.Provider, { value: theConfig, children: /* @__PURE__ */ jsx(HvAppShellRuntimeContext.Provider, { value: runtimeContext, children: /* @__PURE__ */ jsx(
|
|
100
|
+
return /* @__PURE__ */ jsx(HvAppShellContext.Provider, { value: theConfig, children: /* @__PURE__ */ jsx(HvAppShellRuntimeContext.Provider, { value: runtimeContext, children: /* @__PURE__ */ jsx(
|
|
101
|
+
HvProvider,
|
|
102
|
+
{
|
|
103
|
+
themes: themes$1,
|
|
104
|
+
theme: theConfig.theming?.theme,
|
|
105
|
+
colorMode: storedColorModeValue ?? theConfig.theming?.colorMode,
|
|
106
|
+
children: /* @__PURE__ */ jsx(HvAppShellCombinedProvidersContext.Provider, { value: providersContext, children })
|
|
107
|
+
}
|
|
108
|
+
) }) });
|
|
81
109
|
};
|
|
82
110
|
export {
|
|
83
111
|
AppShellProvider as default
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { jsx } from "
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { lazy } from "react";
|
|
3
|
-
import { RouterProvider, createBrowserRouter, Outlet } from "react-router-dom";
|
|
4
3
|
import { ErrorBoundary } from "react-error-boundary";
|
|
5
|
-
import {
|
|
4
|
+
import { RouterProvider, createBrowserRouter, Outlet } from "react-router-dom";
|
|
6
5
|
import { useHvAppShellConfig, useHvAppShellCombinedProviders } from "@hitachivantara/app-shell-shared";
|
|
6
|
+
import { HvContainer } from "@hitachivantara/uikit-react-core";
|
|
7
7
|
import LoadingPage from "../../pages/LoadingPage/LoadingPage.js";
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import Root from "../../pages/Root/Root.js";
|
|
8
|
+
import getBasePath from "../../utils/basePathUtils.js";
|
|
9
|
+
import { getAppIdFromBundle } from "../../utils/navigationUtil.js";
|
|
11
10
|
import GenericError from "../../pages/GenericError/GenericError.js";
|
|
11
|
+
import Root from "../../pages/Root/Root.js";
|
|
12
12
|
import AppShellViewProvider from "../AppShellViewProvider/AppShellViewProvider.js";
|
|
13
13
|
const NotFound = lazy(() => import("../../pages/NotFound/index.js"));
|
|
14
14
|
function renderNestedRoutes(views) {
|
|
@@ -16,9 +16,7 @@ function renderNestedRoutes(views) {
|
|
|
16
16
|
return void 0;
|
|
17
17
|
}
|
|
18
18
|
return views.map((view) => {
|
|
19
|
-
const {
|
|
20
|
-
bundle
|
|
21
|
-
} = view;
|
|
19
|
+
const { bundle } = view;
|
|
22
20
|
const appId = getAppIdFromBundle(bundle);
|
|
23
21
|
const RouteComponent = lazy(() => import(
|
|
24
22
|
/* @vite-ignore */
|
|
@@ -28,7 +26,14 @@ function renderNestedRoutes(views) {
|
|
|
28
26
|
return {
|
|
29
27
|
path,
|
|
30
28
|
// "Component" used instead of "element" due to lazy loading
|
|
31
|
-
Component: () => /* @__PURE__ */ jsx(AppShellViewProvider, { id: appId, children: /* @__PURE__ */ jsx(
|
|
29
|
+
Component: () => /* @__PURE__ */ jsx(AppShellViewProvider, { id: appId, children: /* @__PURE__ */ jsx(
|
|
30
|
+
ErrorBoundary,
|
|
31
|
+
{
|
|
32
|
+
fallback: /* @__PURE__ */ jsx(GenericError, { fullPage: false }),
|
|
33
|
+
children: /* @__PURE__ */ jsx(RouteComponent, { ...view.config, children: view.views != null ? /* @__PURE__ */ jsx(Outlet, {}) : null })
|
|
34
|
+
},
|
|
35
|
+
view.route
|
|
36
|
+
) }),
|
|
32
37
|
children: renderNestedRoutes(view.views)
|
|
33
38
|
};
|
|
34
39
|
});
|
|
@@ -37,11 +42,7 @@ function renderRoutes(mainPanel) {
|
|
|
37
42
|
if (mainPanel == null || mainPanel.views == null) {
|
|
38
43
|
return [];
|
|
39
44
|
}
|
|
40
|
-
const {
|
|
41
|
-
views,
|
|
42
|
-
maxWidth = "xl",
|
|
43
|
-
...mainContainerProps
|
|
44
|
-
} = mainPanel;
|
|
45
|
+
const { views, maxWidth = "xl", ...mainContainerProps } = mainPanel;
|
|
45
46
|
return views.map((view) => {
|
|
46
47
|
const {
|
|
47
48
|
bundle,
|
|
@@ -59,35 +60,58 @@ function renderRoutes(mainPanel) {
|
|
|
59
60
|
return {
|
|
60
61
|
path: route,
|
|
61
62
|
// "Component" used instead of "element" due to lazy loading
|
|
62
|
-
Component: () => /* @__PURE__ */ jsx(
|
|
63
|
+
Component: () => /* @__PURE__ */ jsx(
|
|
64
|
+
HvContainer,
|
|
65
|
+
{
|
|
66
|
+
maxWidth: viewMaxWidth ?? maxWidth,
|
|
67
|
+
...mainContainerProps,
|
|
68
|
+
...viewContainerProps,
|
|
69
|
+
children: /* @__PURE__ */ jsx(AppShellViewProvider, { id: appId, children: /* @__PURE__ */ jsx(
|
|
70
|
+
ErrorBoundary,
|
|
71
|
+
{
|
|
72
|
+
fallback: /* @__PURE__ */ jsx(GenericError, { fullPage: false }),
|
|
73
|
+
children: /* @__PURE__ */ jsx(RouteComponent, { ...config, children: nestedViews != null ? /* @__PURE__ */ jsx(Outlet, {}) : null })
|
|
74
|
+
},
|
|
75
|
+
route
|
|
76
|
+
) })
|
|
77
|
+
}
|
|
78
|
+
),
|
|
63
79
|
children: renderNestedRoutes(nestedViews)
|
|
64
80
|
};
|
|
65
81
|
});
|
|
66
82
|
}
|
|
67
83
|
function renderErrorRoutes(mainPanel) {
|
|
68
|
-
const {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
element: /* @__PURE__ */ jsx(HvContainer, { maxWidth, ...mainContainerProps, children: /* @__PURE__ */ jsx(NotFound, {}) })
|
|
76
|
-
}];
|
|
84
|
+
const { views, maxWidth = "xl", ...mainContainerProps } = mainPanel ?? {};
|
|
85
|
+
return [
|
|
86
|
+
{
|
|
87
|
+
path: "*",
|
|
88
|
+
element: /* @__PURE__ */ jsx(HvContainer, { maxWidth, ...mainContainerProps, children: /* @__PURE__ */ jsx(NotFound, {}) })
|
|
89
|
+
}
|
|
90
|
+
];
|
|
77
91
|
}
|
|
78
92
|
const AppShellRoutes = () => {
|
|
79
93
|
const config = useHvAppShellConfig();
|
|
80
|
-
const {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
94
|
+
const { providers } = useHvAppShellCombinedProviders();
|
|
95
|
+
return /* @__PURE__ */ jsx(
|
|
96
|
+
RouterProvider,
|
|
97
|
+
{
|
|
98
|
+
fallbackElement: /* @__PURE__ */ jsx(LoadingPage, {}),
|
|
99
|
+
router: createBrowserRouter(
|
|
100
|
+
[
|
|
101
|
+
{
|
|
102
|
+
element: /* @__PURE__ */ jsx(Root, { providers }),
|
|
103
|
+
// All routes live inside `RootRoute`
|
|
104
|
+
errorElement: /* @__PURE__ */ jsx(GenericError, { fullPage: true }),
|
|
105
|
+
children: [
|
|
106
|
+
...renderRoutes(config.mainPanel),
|
|
107
|
+
...renderErrorRoutes(config.mainPanel)
|
|
108
|
+
]
|
|
109
|
+
}
|
|
110
|
+
],
|
|
111
|
+
{ basename: getBasePath(config) }
|
|
112
|
+
)
|
|
113
|
+
}
|
|
114
|
+
);
|
|
91
115
|
};
|
|
92
116
|
export {
|
|
93
117
|
AppShellRoutes as default
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
import { jsx } from "
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo } from "react";
|
|
3
3
|
import { HvAppShellViewContext } from "@hitachivantara/app-shell-shared";
|
|
4
|
-
const AppShellViewProvider = ({
|
|
5
|
-
|
|
6
|
-
id
|
|
7
|
-
}) => {
|
|
8
|
-
const value = useMemo(() => ({
|
|
9
|
-
id
|
|
10
|
-
}), [id]);
|
|
4
|
+
const AppShellViewProvider = ({ children, id }) => {
|
|
5
|
+
const value = useMemo(() => ({ id }), [id]);
|
|
11
6
|
return /* @__PURE__ */ jsx(HvAppShellViewContext.Provider, { value, children });
|
|
12
7
|
};
|
|
13
8
|
export {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import useClearLocationState from "../../
|
|
2
|
-
import useCustomEventListener from "../../
|
|
1
|
+
import useClearLocationState from "../../hooks/useClearLocationState.js";
|
|
2
|
+
import useCustomEventListener from "../../hooks/useCustomEventListener.js";
|
|
3
3
|
const CustomHooksInitializer = () => {
|
|
4
4
|
useCustomEventListener();
|
|
5
5
|
useClearLocationState();
|
|
@@ -1,18 +1,16 @@
|
|
|
1
|
-
import { jsx } from "
|
|
2
|
-
import { Global } from "@emotion/react";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
};
|
|
15
|
-
const GlobalStyles = () => /* @__PURE__ */ jsx(Global, { styles: _ref });
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Global, css } from "@emotion/react";
|
|
3
|
+
const GlobalStyles = () => /* @__PURE__ */ jsx(
|
|
4
|
+
Global,
|
|
5
|
+
{
|
|
6
|
+
styles: css`
|
|
7
|
+
html,
|
|
8
|
+
body {
|
|
9
|
+
height: unset;
|
|
10
|
+
}
|
|
11
|
+
`
|
|
12
|
+
}
|
|
13
|
+
);
|
|
16
14
|
export {
|
|
17
15
|
GlobalStyles as default
|
|
18
16
|
};
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { jsx } from "
|
|
2
|
-
import {
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
...others
|
|
7
|
-
}) => {
|
|
8
|
-
return /* @__PURE__ */ jsx(HvIconSprite, { spriteUrl: spriteUri, iconName: name, color: "currentcolor", ...others });
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { icons } from "@hitachivantara/uikit-react-icons";
|
|
3
|
+
const IconUiKit = ({ name, ...others }) => {
|
|
4
|
+
const Icon = icons[name];
|
|
5
|
+
if (!Icon) return null;
|
|
6
|
+
return /* @__PURE__ */ jsx(Icon, { ...others });
|
|
9
7
|
};
|
|
10
8
|
export {
|
|
11
9
|
IconUiKit as default
|
|
@@ -1,21 +1,23 @@
|
|
|
1
|
-
import { jsx } from "
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { css } from "@emotion/css";
|
|
3
|
-
import {
|
|
3
|
+
import { useTheme, HvSnackbarProvider, theme } from "@hitachivantara/uikit-react-core";
|
|
4
4
|
const snackbarClasses = {
|
|
5
|
-
containerRoot:
|
|
5
|
+
containerRoot: css`
|
|
6
|
+
margin-top: ${theme.header.height};
|
|
7
|
+
`
|
|
6
8
|
};
|
|
7
|
-
const SnackbarProvider = ({
|
|
8
|
-
|
|
9
|
-
}) => {
|
|
10
|
-
const {
|
|
11
|
-
activeTheme
|
|
12
|
-
} = useTheme();
|
|
9
|
+
const SnackbarProvider = ({ children }) => {
|
|
10
|
+
const { activeTheme } = useTheme();
|
|
13
11
|
const isPentahoTheme = activeTheme?.name === "pentahoPlus";
|
|
14
|
-
const anchorOrigin = isPentahoTheme ? {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
12
|
+
const anchorOrigin = isPentahoTheme ? { vertical: "bottom", horizontal: "center" } : void 0;
|
|
13
|
+
return /* @__PURE__ */ jsx(
|
|
14
|
+
HvSnackbarProvider,
|
|
15
|
+
{
|
|
16
|
+
anchorOrigin,
|
|
17
|
+
notistackClassesOverride: anchorOrigin ? void 0 : snackbarClasses,
|
|
18
|
+
children
|
|
19
|
+
}
|
|
20
|
+
);
|
|
19
21
|
};
|
|
20
22
|
export {
|
|
21
23
|
SnackbarProvider as default
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsx } from "
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { createPortal } from "react-dom";
|
|
3
3
|
import { ClickAwayListener } from "@mui/material";
|
|
4
|
-
import createAppContainerElement from "../../
|
|
4
|
+
import createAppContainerElement from "../../utils/documentUtil.js";
|
|
5
5
|
const withClickAwayListener = (WrappedComponent) => {
|
|
6
6
|
const displayName = WrappedComponent.displayName ?? WrappedComponent.name;
|
|
7
7
|
const panelContainerElement = createAppContainerElement();
|
|
@@ -10,7 +10,10 @@ const withClickAwayListener = (WrappedComponent) => {
|
|
|
10
10
|
...wrappedProps
|
|
11
11
|
}) => {
|
|
12
12
|
if (onClickAway) {
|
|
13
|
-
return createPortal(
|
|
13
|
+
return createPortal(
|
|
14
|
+
/* @__PURE__ */ jsx(ClickAwayListener, { onClickAway, children: /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(WrappedComponent, { ...wrappedProps }) }) }),
|
|
15
|
+
panelContainerElement
|
|
16
|
+
);
|
|
14
17
|
}
|
|
15
18
|
return /* @__PURE__ */ jsx(WrappedComponent, { ...wrappedProps });
|
|
16
19
|
};
|
|
@@ -1,25 +1,37 @@
|
|
|
1
|
-
import { jsx, jsxs } from "
|
|
2
|
-
import {
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ErrorBoundary } from "react-error-boundary";
|
|
3
3
|
import { HelmetProvider } from "react-helmet-async";
|
|
4
|
+
import { I18nextProvider } from "react-i18next";
|
|
4
5
|
import { HvProvider } from "@hitachivantara/uikit-react-core";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
6
|
+
import createI18Next from "../../i18n/index.js";
|
|
7
|
+
import { LayoutProvider } from "../../providers/LayoutProvider.js";
|
|
7
8
|
import AppShellProvider from "../AppShellProvider/AppShellProvider.js";
|
|
8
|
-
import
|
|
9
|
-
import LayoutProvider from "../../providers/LayoutProvider.js";
|
|
10
|
-
import GenericError from "../../pages/GenericError/GenericError.js";
|
|
9
|
+
import GlobalStyles from "../GlobalStyles/GlobalStyles.js";
|
|
11
10
|
import SnackbarProvider from "../SnackbarProvider/SnackbarProvider.js";
|
|
11
|
+
import GenericError from "../../pages/GenericError/GenericError.js";
|
|
12
12
|
const withGlobalProvider = (WrappedComponent) => {
|
|
13
13
|
const displayName = WrappedComponent.displayName ?? WrappedComponent.name;
|
|
14
|
-
const {
|
|
15
|
-
i18n
|
|
16
|
-
} = createI18Next();
|
|
14
|
+
const { i18n } = createI18Next();
|
|
17
15
|
const ComponentWithGlobalProvider = ({
|
|
18
16
|
...wrappedProps
|
|
19
17
|
}) => {
|
|
20
18
|
return /* @__PURE__ */ jsx(HelmetProvider, { children: /* @__PURE__ */ jsxs(HvProvider, { children: [
|
|
21
19
|
/* @__PURE__ */ jsx(GlobalStyles, {}),
|
|
22
|
-
/* @__PURE__ */ jsx(I18nextProvider, { i18n, children: /* @__PURE__ */ jsx(
|
|
20
|
+
/* @__PURE__ */ jsx(I18nextProvider, { i18n, children: /* @__PURE__ */ jsx(
|
|
21
|
+
ErrorBoundary,
|
|
22
|
+
{
|
|
23
|
+
fallback: /* @__PURE__ */ jsx(GenericError, { fullPage: true, includeFooter: false }),
|
|
24
|
+
children: /* @__PURE__ */ jsx(
|
|
25
|
+
AppShellProvider,
|
|
26
|
+
{
|
|
27
|
+
config: wrappedProps.config,
|
|
28
|
+
configUrl: wrappedProps.configUrl,
|
|
29
|
+
children: /* @__PURE__ */ jsx(LayoutProvider, { children: /* @__PURE__ */ jsx(SnackbarProvider, { children: /* @__PURE__ */ jsx(WrappedComponent, { ...wrappedProps }) }) })
|
|
30
|
+
}
|
|
31
|
+
)
|
|
32
|
+
},
|
|
33
|
+
"general"
|
|
34
|
+
) })
|
|
23
35
|
] }) });
|
|
24
36
|
};
|
|
25
37
|
ComponentWithGlobalProvider.displayName = `withGlobalProvider(${displayName})`;
|
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import { jsx } from "
|
|
2
|
-
import { CONFIG_TRANSLATIONS_NAMESPACE } from "@hitachivantara/app-shell-shared";
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
2
|
import { useTranslation } from "react-i18next";
|
|
3
|
+
import { CONFIG_TRANSLATIONS_NAMESPACE } from "@hitachivantara/app-shell-shared";
|
|
4
4
|
import Hitachi from "./Logos/Hitachi.js";
|
|
5
5
|
import Lumada from "./Logos/Lumada.js";
|
|
6
6
|
import Pentaho from "./Logos/Pentaho.js";
|
|
7
|
-
const BrandLogo = ({
|
|
8
|
-
|
|
9
|
-
}) => {
|
|
10
|
-
const {
|
|
11
|
-
t: tConfig
|
|
12
|
-
} = useTranslation(CONFIG_TRANSLATIONS_NAMESPACE);
|
|
7
|
+
const BrandLogo = ({ logo }) => {
|
|
8
|
+
const { t: tConfig } = useTranslation(CONFIG_TRANSLATIONS_NAMESPACE);
|
|
13
9
|
if (!logo) {
|
|
14
10
|
if (logo === null) {
|
|
15
11
|
return null;
|
|
@@ -1,10 +1,29 @@
|
|
|
1
|
-
import { jsx } from "
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { theme } from "@hitachivantara/uikit-react-core";
|
|
3
3
|
const Hitachi = ({
|
|
4
4
|
description = "Hitachi logo",
|
|
5
5
|
letteringColor
|
|
6
6
|
}) => {
|
|
7
|
-
return /* @__PURE__ */ jsx(
|
|
7
|
+
return /* @__PURE__ */ jsx(
|
|
8
|
+
"svg",
|
|
9
|
+
{
|
|
10
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
11
|
+
x: 0,
|
|
12
|
+
y: 0,
|
|
13
|
+
width: "72px",
|
|
14
|
+
height: "20px",
|
|
15
|
+
viewBox: "0 0 80.5 16.9",
|
|
16
|
+
xmlSpace: "preserve",
|
|
17
|
+
"aria-label": description,
|
|
18
|
+
children: /* @__PURE__ */ jsx(
|
|
19
|
+
"path",
|
|
20
|
+
{
|
|
21
|
+
fill: letteringColor ?? theme.colors.secondary,
|
|
22
|
+
d: "M63.6 2.5v4.7H70V2.5h3.1v11.9H70V9.2h-6.3v5.2h-3.1V2.5h3zM33.9 2.5v2h-4.8v9.8H26V4.5h-4.8v-2h12.7zM46 14.3h-3.5l-1-2.6h-5.9l-1 2.6h-3.5l5.5-11.9h3.8L46 14.3zm-7.4-9.8-2.2 5.4h4.4l-2.2-5.4M75.6 2.5h3.1v11.9h-3.1zM4.9 2.5v4.7h6.3V2.5h3.1v11.9h-3.1V9.2H4.9v5.2H1.7V2.5h3.2zM16.9 2.5H20v11.9h-3.1zM45.9 11c-.3-.8-.4-1.6-.4-2.5 0-1.2.2-2.4.8-3.4.6-1 1.5-1.8 2.7-2.2 1.1-.4 2.2-.6 3.5-.6 1.4 0 2.7.3 4 .8 1.1.5 2 1.5 2.2 2.7.1.3.1.5.1.8h-3.3c0-.3-.1-.6-.2-.9-.3-.6-.8-1.2-1.5-1.4-.4-.1-.9-.2-1.4-.2-.5 0-1.1.1-1.5.3-.8.3-1.4.9-1.7 1.7-.3.8-.4 1.6-.4 2.5 0 .7.1 1.4.3 2.1.2.9.9 1.6 1.7 1.9.5.2 1.1.3 1.7.3.5 0 1-.1 1.5-.2.6-.2 1.1-.6 1.4-1.2.2-.4.3-.8.3-1.3H59c0 .4-.1.8-.2 1.1-.3 1.2-1.1 2.2-2.2 2.6-1.2.5-2.6.8-4 .8-1.1 0-2.2-.2-3.2-.5-1.6-.6-2.9-1.7-3.5-3.2z"
|
|
23
|
+
}
|
|
24
|
+
)
|
|
25
|
+
}
|
|
26
|
+
);
|
|
8
27
|
};
|
|
9
28
|
export {
|
|
10
29
|
Hitachi as default
|
|
@@ -1,15 +1,47 @@
|
|
|
1
|
-
import { jsxs, jsx } from "
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { theme } from "@hitachivantara/uikit-react-core";
|
|
3
3
|
const Lumada = ({
|
|
4
4
|
description = "Lumada logo",
|
|
5
5
|
letteringColor
|
|
6
6
|
}) => {
|
|
7
|
-
return /* @__PURE__ */ jsxs(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
return /* @__PURE__ */ jsxs(
|
|
8
|
+
"svg",
|
|
9
|
+
{
|
|
10
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
11
|
+
viewBox: "0 0 300.41 69.38",
|
|
12
|
+
"aria-label": description,
|
|
13
|
+
children: [
|
|
14
|
+
/* @__PURE__ */ jsx(
|
|
15
|
+
"path",
|
|
16
|
+
{
|
|
17
|
+
fill: "#c00",
|
|
18
|
+
d: "M55.1 31.44 53.91 27l2.94-3a24.86 24.86 0 0 0-2.06-3.57l-4 1.08-3.26-3.27 1.08-4A24.19 24.19 0 0 0 45 12.2l-2.94 2.94L37.62 14l-1.08-4a24.64 24.64 0 0 0-4.12 0l-1.08 4-4.46 1.19-2.94-2.99a24.8 24.8 0 0 0-3.57 2.05l1.08 4-3.27 3.27-4-1.08A23.58 23.58 0 0 0 12.1 24l2.9 3-1.19 4.46-4 1.08a24.52 24.52 0 0 0 0 4.11l4 1.08L15 42.16l-2.9 2.94a24.27 24.27 0 0 0 2.05 3.57l4-1.07 3.27 3.26-1.08 4A24.46 24.46 0 0 0 23.92 57l2.95-3 4.46 1.2 1 3.78h4.25l1-3.78 4.48-1.2L45 57a25.26 25.26 0 0 0 3.57-2.06l-1.07-4 3.26-3.26 4 1.08a24.19 24.19 0 0 0 2.06-3.57l-3-2.94 1.2-4.46 4-1.08a24.65 24.65 0 0 0 0-4.12ZM52.38 39a18.44 18.44 0 1 1-13.52-22.33A18.44 18.44 0 0 1 52.38 39"
|
|
19
|
+
}
|
|
20
|
+
),
|
|
21
|
+
/* @__PURE__ */ jsx(
|
|
22
|
+
"path",
|
|
23
|
+
{
|
|
24
|
+
fill: letteringColor ?? theme.colors.secondary,
|
|
25
|
+
d: "M38.14 19.59a15.43 15.43 0 1 0 11.32 18.65 15.42 15.42 0 0 0-11.32-18.65m8.33 18.2a12.42 12.42 0 1 1-8.78-15.21 12.44 12.44 0 0 1 8.78 15.21"
|
|
26
|
+
}
|
|
27
|
+
),
|
|
28
|
+
/* @__PURE__ */ jsx(
|
|
29
|
+
"path",
|
|
30
|
+
{
|
|
31
|
+
fill: "#c00",
|
|
32
|
+
d: "M34.68 0a1.49 1.49 0 0 0-1.49 1.48v4.6a1.49 1.49 0 1 0 3 0V1.47A1.48 1.48 0 0 0 34.68 0M34.68 61.81a1.48 1.48 0 0 0-1.49 1.48v4.6a1.49 1.49 0 1 0 3 0v-4.6a1.48 1.48 0 0 0-1.48-1.49M59 10.18a1.48 1.48 0 0 0-2.1 0l-3.27 3.24a1.48 1.48 0 1 0 2.09 2.11L59 12.28a1.48 1.48 0 0 0 0-2.1M15.5 53.27a1.48 1.48 0 0 0-2.1 0l-3.27 3.23a1.48 1.48 0 1 0 2.09 2.11l3.27-3.24a1.48 1.48 0 0 0 0-2.1M68.78 34.53A1.49 1.49 0 0 0 67.3 33h-4.61a1.49 1.49 0 0 0 0 3h4.61a1.48 1.48 0 0 0 1.49-1.48M7.58 34.28a1.5 1.5 0 0 0-1.48-1.5H1.49A1.49 1.49 0 0 0 0 34.24a1.5 1.5 0 0 0 1.48 1.5h4.6a1.48 1.48 0 0 0 1.5-1.47M58.75 58.81a1.48 1.48 0 0 0 0-2.1l-3.24-3.27a1.48 1.48 0 1 0-2.11 2.09l3.24 3.27a1.48 1.48 0 0 0 2.1 0M15.66 15.35a1.49 1.49 0 0 0 0-2.1L12.42 10a1.48 1.48 0 1 0-2.11 2.09l3.25 3.27a1.48 1.48 0 0 0 2.1 0"
|
|
33
|
+
}
|
|
34
|
+
),
|
|
35
|
+
/* @__PURE__ */ jsx(
|
|
36
|
+
"path",
|
|
37
|
+
{
|
|
38
|
+
fill: letteringColor ?? theme.colors.secondary,
|
|
39
|
+
d: "M79.31 15.58h3.45v32H99v3.09H79.31ZM108.89 15.58h3.49v22.8c0 6 3.89 9.68 9.93 9.68s10-3.64 10-9.78v-22.7h3.45v22.85c0 7.78-5.44 12.82-13.37 12.82s-13.47-5-13.47-12.82ZM152.13 15.58h3.59l9.18 20.61c.8 1.79 1.7 4.29 1.7 4.29h.1s.94-2.5 1.74-4.29l9.18-20.61h3.54L184 50.65h-3.45l-1.94-24.54c-.15-1.9-.1-4.89-.1-4.89h-.1s-1.05 3.09-1.85 4.89l-8.23 18h-3.24l-8.23-18c-.8-1.75-1.89-5-1.89-5h-.1s0 3.09-.1 5l-1.95 24.54h-3.44ZM215.32 39.48h-14.11l-4 11.17h-3.64l12.87-35.07h3.69L223 50.65h-3.65Zm-7.08-20.25s-.75 2.89-1.35 4.54l-4.68 12.72h12.07l-4.59-12.72c-.6-1.65-1.35-4.54-1.35-4.54ZM233.73 15.58h11.32c10.52 0 17.61 6.44 17.61 17.51s-7.09 17.56-17.61 17.56h-11.32Zm11 32c8.63 0 14.36-5.09 14.36-14.47s-5.78-14.41-14.36-14.41h-7.53v28.86ZM292.73 39.48h-14.12l-4 11.17H271l12.87-35.07h3.69l12.87 35.07h-3.64Zm-7.08-20.25s-.75 2.89-1.35 4.54l-4.69 12.72h12.07l-4.59-12.72c-.6-1.65-1.34-4.54-1.34-4.54Z"
|
|
40
|
+
}
|
|
41
|
+
)
|
|
42
|
+
]
|
|
43
|
+
}
|
|
44
|
+
);
|
|
13
45
|
};
|
|
14
46
|
export {
|
|
15
47
|
Lumada as default
|