@hitachivantara/app-shell-ui 1.2.1 → 1.4.0
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/AppShellProvider/AppShellProvider.js +25 -25
- package/dist/esm/components/AppShellProvider/AppShellProvider.js.map +1 -1
- package/dist/esm/components/layout/Header/Header.js +37 -30
- package/dist/esm/components/layout/Header/Header.js.map +1 -1
- package/dist/esm/components/layout/Header/HeaderActions/HeaderActions.js +14 -27
- package/dist/esm/components/layout/Header/HeaderActions/HeaderActions.js.map +1 -1
- package/dist/esm/components/layout/Header/HeaderActions/InternalActions/AppSwitcherToggle/AppSwitcherToggle.js +29 -32
- package/dist/esm/components/layout/Header/HeaderActions/InternalActions/AppSwitcherToggle/AppSwitcherToggle.js.map +1 -1
- package/dist/esm/components/layout/Header/HeaderActions/InternalActions/ColorModeSwitcher/ColorModeSwitcher.js +6 -6
- package/dist/esm/components/layout/Header/HeaderActions/InternalActions/ColorModeSwitcher/ColorModeSwitcher.js.map +1 -1
- package/dist/esm/components/layout/Header/HeaderActions/InternalActions/HelpButton/HelpButton.js +9 -9
- package/dist/esm/components/layout/Header/HeaderActions/InternalActions/HelpButton/HelpButton.js.map +1 -1
- package/dist/esm/components/layout/VerticalNavigation/VerticalNavigation.js +16 -18
- package/dist/esm/components/layout/VerticalNavigation/VerticalNavigation.js.map +1 -1
- package/dist/esm/lib/hooks/useLocalStorage.js +10 -9
- package/dist/esm/lib/hooks/useLocalStorage.js.map +1 -1
- package/dist/esm/lib/hooks/useThemeEventListener.js +4 -4
- package/dist/esm/lib/hooks/useThemeEventListener.js.map +1 -1
- package/dist/esm/providers/NavigationProvider.js +45 -35
- package/dist/esm/providers/NavigationProvider.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
import { jsx as i } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import { useContext as
|
|
3
|
-
import { HvAppShellContext as
|
|
4
|
-
import { BrowserRouter as
|
|
5
|
-
import { I18nContext as
|
|
6
|
-
import { themes as T, HvProvider as
|
|
2
|
+
import { useContext as w, useState as d, useEffect as l, useMemo as S } from "react";
|
|
3
|
+
import { HvAppShellContext as L, HvAppShellRuntimeContext as O, CONFIG_TRANSLATIONS_NAMESPACE as H } from "@hitachivantara/app-shell-shared";
|
|
4
|
+
import { BrowserRouter as N } from "react-router-dom";
|
|
5
|
+
import { I18nContext as B } from "react-i18next";
|
|
6
|
+
import { themes as T, HvProvider as _ } from "@hitachivantara/uikit-react-core";
|
|
7
7
|
import j from "../../lib/utils/basePathUtils.js";
|
|
8
|
-
import { addResourceBundles as
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
const
|
|
12
|
-
children:
|
|
8
|
+
import { addResourceBundles as D } from "../../lib/i18n/index.js";
|
|
9
|
+
import F from "../../lib/hooks/useLocalStorage.js";
|
|
10
|
+
import G from "../../lib/utils/CombinedProviders.js";
|
|
11
|
+
const V = ({
|
|
12
|
+
children: x,
|
|
13
13
|
config: m,
|
|
14
14
|
configUrl: n
|
|
15
15
|
}) => {
|
|
16
|
-
var v, f, P,
|
|
16
|
+
var v, f, P, I;
|
|
17
17
|
const {
|
|
18
18
|
i18n: a
|
|
19
|
-
} =
|
|
20
|
-
value:
|
|
21
|
-
} =
|
|
19
|
+
} = w(B), {
|
|
20
|
+
value: A
|
|
21
|
+
} = F("COLOR_MODE"), [p, h] = d(void 0), [$, E] = d(!1);
|
|
22
22
|
l(() => {
|
|
23
23
|
!m && n && fetch(new URL(n)).then((r) => r.json()).then((r) => h(r)).catch((r) => {
|
|
24
|
-
console.error(`It was not possible to obtain the context from: ${n}`, r), h(void 0),
|
|
24
|
+
console.error(`It was not possible to obtain the context from: ${n}`, r), h(void 0), E(!0);
|
|
25
25
|
});
|
|
26
26
|
}, [m, n]);
|
|
27
|
-
const e =
|
|
28
|
-
if (
|
|
27
|
+
const e = S(() => m ?? p, [m, p]);
|
|
28
|
+
if ($)
|
|
29
29
|
throw Error("It was not possible to obtain the configuration");
|
|
30
|
-
e != null && e.translations &&
|
|
31
|
-
const [c,
|
|
30
|
+
e != null && e.translations && D(a, e.translations, H);
|
|
31
|
+
const [c, M] = d(void 0), [u, R] = d(void 0);
|
|
32
32
|
l(() => {
|
|
33
33
|
var r, t;
|
|
34
34
|
(r = e == null ? void 0 : e.theming) != null && r.themes && Promise.all((t = e.theming.themes) == null ? void 0 : t.map((o) => (o === "ds3" || o === "ds5") && T[o] || import(
|
|
@@ -37,7 +37,7 @@ const K = ({
|
|
|
37
37
|
).then((s) => s.default).catch((s) => {
|
|
38
38
|
console.error(`Import of theme bundle ${o} failed! ${s}`);
|
|
39
39
|
}))).then((o) => {
|
|
40
|
-
|
|
40
|
+
M(o.filter((s) => !!s));
|
|
41
41
|
}).catch((o) => {
|
|
42
42
|
console.error(`Import of themes failed! ${o}`);
|
|
43
43
|
});
|
|
@@ -47,16 +47,16 @@ const K = ({
|
|
|
47
47
|
r.bundle
|
|
48
48
|
).then((t) => t.default).catch((t) => {
|
|
49
49
|
console.error(`Import of provider '${r.bundle}' failed! ${t}`);
|
|
50
|
-
}))).then((r) =>
|
|
50
|
+
}))).then((r) => R(r.filter((t) => !!t))).catch((r) => {
|
|
51
51
|
console.error("Import of providers failed!", r);
|
|
52
52
|
});
|
|
53
53
|
}, [e == null ? void 0 : e.providers]);
|
|
54
|
-
const
|
|
54
|
+
const b = S(() => ({
|
|
55
55
|
i18n: a
|
|
56
56
|
}), [a]);
|
|
57
|
-
return !e || (f = e.theming) != null && f.themes && !c || e.providers != null && u === void 0 ? null : /* @__PURE__ */ i(
|
|
58
|
-
},
|
|
57
|
+
return !e || (f = e.theming) != null && f.themes && !c || e.providers != null && u === void 0 ? null : /* @__PURE__ */ i(L.Provider, { value: e, children: /* @__PURE__ */ i(O.Provider, { value: b, children: /* @__PURE__ */ i(_, { themes: c, theme: (P = e.theming) == null ? void 0 : P.theme, colorMode: A ?? ((I = e.theming) == null ? void 0 : I.colorMode), children: /* @__PURE__ */ i(N, { basename: j(e), children: /* @__PURE__ */ i(G, { providers: u, children: x }) }) }) }) });
|
|
58
|
+
}, Y = V;
|
|
59
59
|
export {
|
|
60
|
-
|
|
60
|
+
Y as default
|
|
61
61
|
};
|
|
62
62
|
//# sourceMappingURL=AppShellProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppShellProvider.js","sources":["../../../../src/components/AppShellProvider/AppShellProvider.tsx"],"sourcesContent":["import {\n ComponentType,\n ReactNode,\n useContext,\n useEffect,\n useMemo,\n useState\n} from \"react\";\nimport {\n CONFIG_TRANSLATIONS_NAMESPACE,\n HvAppShellConfig,\n HvAppShellContext,\n HvAppShellContextValue,\n HvAppShellRuntimeContext\n} from \"@hitachivantara/app-shell-shared\";\nimport { BrowserRouter } from \"react-router-dom\";\nimport { I18nContext } from \"react-i18next\";\n\nimport {\n HvProvider,\n HvTheme,\n themes as baseThemes\n} from \"@hitachivantara/uikit-react-core\";\n\nimport getBasePath from \"../../lib/utils/basePathUtils\";\nimport { addResourceBundles } from \"../../lib/i18n\";\nimport useLocalStorage
|
|
1
|
+
{"version":3,"file":"AppShellProvider.js","sources":["../../../../src/components/AppShellProvider/AppShellProvider.tsx"],"sourcesContent":["import {\n ComponentType,\n ReactNode,\n useContext,\n useEffect,\n useMemo,\n useState\n} from \"react\";\nimport {\n CONFIG_TRANSLATIONS_NAMESPACE,\n HvAppShellConfig,\n HvAppShellContext,\n HvAppShellContextValue,\n HvAppShellRuntimeContext\n} from \"@hitachivantara/app-shell-shared\";\nimport { BrowserRouter } from \"react-router-dom\";\nimport { I18nContext } from \"react-i18next\";\n\nimport {\n HvProvider,\n HvTheme,\n themes as baseThemes\n} from \"@hitachivantara/uikit-react-core\";\n\nimport getBasePath from \"../../lib/utils/basePathUtils\";\nimport { addResourceBundles } from \"../../lib/i18n\";\nimport useLocalStorage from \"../../lib/hooks/useLocalStorage\";\nimport CombinedProviders from \"../../lib/utils/CombinedProviders\";\n\nexport type AppShellProviderProps = {\n children: ReactNode;\n config?: Partial<HvAppShellConfig>;\n configUrl?: string;\n};\n\nconst AppShellProvider = ({\n children,\n config: localConfig,\n configUrl\n}: AppShellProviderProps) => {\n const { i18n } = useContext(I18nContext);\n const { value: storedColorModeValue } = useLocalStorage(\"COLOR_MODE\");\n const [loadedConfig, setLoadedConfig] = useState<\n HvAppShellConfig | undefined\n >(undefined);\n\n const [hasError, setHasError] = useState<boolean>(false);\n\n useEffect(() => {\n if (!localConfig && configUrl) {\n fetch(new URL(configUrl))\n .then(result => {\n return result.json();\n })\n .then(data => setLoadedConfig(data))\n .catch(e => {\n console.error(\n `It was not possible to obtain the context from: ${configUrl}`,\n e\n );\n setLoadedConfig(undefined);\n setHasError(true);\n });\n }\n }, [localConfig, configUrl]);\n\n const theConfig: HvAppShellContextValue | undefined = useMemo(\n () => localConfig ?? loadedConfig,\n [localConfig, loadedConfig]\n );\n\n if (hasError) {\n throw Error(\"It was not possible to obtain the configuration\");\n }\n\n if (theConfig?.translations) {\n addResourceBundles(\n i18n,\n theConfig.translations,\n CONFIG_TRANSLATIONS_NAMESPACE\n );\n }\n\n const [themes, setThemes] = useState<HvTheme[] | undefined>(undefined);\n const [providers, setProviders] = useState<\n ComponentType<{ children: ReactNode }>[] | undefined\n >(undefined);\n\n useEffect(() => {\n if (theConfig?.theming?.themes) {\n Promise.all(\n theConfig.theming.themes?.map(bundle => {\n return (\n ((bundle === \"ds3\" || bundle === \"ds5\") && baseThemes[bundle]) ||\n import(/* @vite-ignore */ bundle)\n .then(module => module.default)\n .catch(e => {\n console.error(`Import of theme bundle ${bundle} failed! ${e}`);\n })\n );\n })\n )\n .then(loadedThemes => {\n setThemes(loadedThemes.filter(theme => !!theme));\n })\n .catch(e => {\n console.error(`Import of themes failed! ${e}`);\n });\n }\n }, [theConfig?.theming?.themes]);\n\n useEffect(() => {\n if (theConfig?.providers) {\n Promise.all(\n theConfig.providers.map(provider => {\n return import(/* @vite-ignore */ provider.bundle)\n .then(module => module.default)\n .catch(e => {\n console.error(\n `Import of provider '${provider.bundle}' failed! ${e}`\n );\n });\n })\n )\n .then(loadedProviders =>\n setProviders(loadedProviders.filter(provider => !!provider))\n )\n .catch(e => {\n console.error(`Import of providers failed!`, e);\n });\n }\n }, [theConfig?.providers]);\n\n const runtimeContext = useMemo(\n () => ({\n i18n\n }),\n [i18n]\n );\n if (\n !theConfig ||\n (theConfig.theming?.themes && !themes) ||\n (theConfig.providers != null && providers === undefined)\n ) {\n return null;\n }\n\n return (\n <HvAppShellContext.Provider value={theConfig}>\n <HvAppShellRuntimeContext.Provider value={runtimeContext}>\n <HvProvider\n themes={themes}\n theme={theConfig.theming?.theme}\n colorMode={storedColorModeValue ?? theConfig.theming?.colorMode}>\n <BrowserRouter basename={getBasePath(theConfig)}>\n <CombinedProviders providers={providers}>\n {children}\n </CombinedProviders>\n </BrowserRouter>\n </HvProvider>\n </HvAppShellRuntimeContext.Provider>\n </HvAppShellContext.Provider>\n );\n};\n\nexport default AppShellProvider;\n"],"names":["AppShellProvider","children","config","localConfig","configUrl","i18n","useContext","I18nContext","value","storedColorModeValue","useLocalStorage","loadedConfig","setLoadedConfig","useState","undefined","hasError","setHasError","useEffect","fetch","URL","then","result","json","data","catch","e","console","error","theConfig","useMemo","Error","translations","CONFIG_TRANSLATIONS_NAMESPACE","themes","setThemes","providers","setProviders","theming","Promise","all","map","bundle","baseThemes","module","default","loadedThemes","filter","theme","provider","loadedProviders","runtimeContext","HvAppShellContext","jsx","HvAppShellRuntimeContext","HvProvider","colorMode","BrowserRouter","getBasePath","CombinedProviders","AppShellProvider$1"],"mappings":";;;;;;;;;;AAmCA,MAAMA,IAAmBA,CAAC;AAAA,EACxBC,UAAAA;AAAAA,EACAC,QAAQC;AAAAA,EACRC,WAAAA;AACqB,MAAM;;AACrB,QAAA;AAAA,IAAEC,MAAAA;AAAAA,EAAAA,IAASC,EAAWC,CAAW,GACjC;AAAA,IAAEC,OAAOC;AAAAA,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AAAA,EAAUS,YAAVT,gBAAAA,EAAmB2B,YACtD,UAAA,gBAAAH,EAACI,KAAc,UAAUC,EAAY7B,CAAS,GAC5C,4BAAC8B,GAAkB,EAAA,WAAAvB,GAChBlC,UAAAA,GACH,EACF,CAAA,EACF,CAAA,GACF,EACF,CAAA;AAEJ,GAEA0D,IAAe3D;"}
|
|
@@ -1,38 +1,45 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { Helmet as
|
|
3
|
-
import { useTranslation as
|
|
4
|
-
import { HvHeader as
|
|
5
|
-
import { CONFIG_TRANSLATIONS_NAMESPACE as
|
|
6
|
-
import { useHvNavigation as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
|
|
1
|
+
import { jsxs as u, jsx as o } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { Helmet as M } from "react-helmet-async";
|
|
3
|
+
import { useTranslation as d } from "react-i18next";
|
|
4
|
+
import { HvHeader as I, HvButton as O, HvHeaderBrand as S, HvHeaderNavigation as x } from "@hitachivantara/uikit-react-core";
|
|
5
|
+
import { CONFIG_TRANSLATIONS_NAMESPACE as A, useHvAppShellConfig as L } from "@hitachivantara/app-shell-shared";
|
|
6
|
+
import { useHvNavigation as T } from "@hitachivantara/app-shell-navigation";
|
|
7
|
+
import B from "./styles.js";
|
|
8
|
+
import E from "../../../providers/hooks/useNavigationContext.js";
|
|
9
|
+
import P from "../../IconUiKit/index.js";
|
|
10
|
+
import _ from "./HeaderActions/HeaderActions.js";
|
|
11
|
+
import w from "./BrandLogo/BrandLogo.js";
|
|
12
|
+
const V = () => {
|
|
12
13
|
const {
|
|
13
|
-
t:
|
|
14
|
-
} =
|
|
15
|
-
|
|
16
|
-
} =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
14
|
+
t: n
|
|
15
|
+
} = d(), {
|
|
16
|
+
t: c
|
|
17
|
+
} = d(A), e = L(), {
|
|
18
|
+
navigate: m
|
|
19
|
+
} = T(), {
|
|
20
|
+
items: a,
|
|
21
|
+
selectedMenuItemId: g,
|
|
22
|
+
rootMenuItemId: v,
|
|
23
|
+
isCompactMode: r,
|
|
24
|
+
switchVerticalNavigationMode: p,
|
|
25
|
+
verticalNavigationMode: f,
|
|
26
|
+
verticalNavigationItems: h
|
|
27
|
+
} = E(), l = e.navigationMode === "ONLY_TOP", N = !r && e.navigationMode !== "ONLY_LEFT" && a.length > 0, t = f === "CLOSED", C = r && h.length > 0, H = (j, i) => {
|
|
28
|
+
i.href && m(i.href, {
|
|
23
29
|
state: {
|
|
24
|
-
selectedItemId:
|
|
30
|
+
selectedItemId: i.id
|
|
25
31
|
}
|
|
26
32
|
});
|
|
27
|
-
},
|
|
28
|
-
return /* @__PURE__ */
|
|
29
|
-
/* @__PURE__ */ o(
|
|
30
|
-
/* @__PURE__ */ o(
|
|
31
|
-
|
|
32
|
-
/* @__PURE__ */ o(
|
|
33
|
+
}, s = e.name ? c(e.name) : "";
|
|
34
|
+
return /* @__PURE__ */ u(I, { position: "fixed", children: [
|
|
35
|
+
/* @__PURE__ */ o(M, { children: /* @__PURE__ */ o("title", { children: s }) }),
|
|
36
|
+
C && /* @__PURE__ */ o(O, { icon: !0, "aria-label": n(t ? "header.navigation.openNavigationPanel" : "header.navigation.closeNavigationPanel"), "aria-expanded": !t, onClick: p, children: /* @__PURE__ */ o(P, { name: t ? "Menu" : "Close" }) }),
|
|
37
|
+
/* @__PURE__ */ o(S, { logo: /* @__PURE__ */ o(B, { children: /* @__PURE__ */ o(w, { logo: e.logo }) }), name: s }),
|
|
38
|
+
N && /* @__PURE__ */ o(x, { data: a, selected: l ? g : v, onClick: H, levels: l ? 2 : 1 }),
|
|
39
|
+
/* @__PURE__ */ o(_, {})
|
|
33
40
|
] });
|
|
34
|
-
},
|
|
41
|
+
}, $ = V;
|
|
35
42
|
export {
|
|
36
|
-
|
|
43
|
+
$ as default
|
|
37
44
|
};
|
|
38
45
|
//# sourceMappingURL=Header.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.js","sources":["../../../../../src/components/layout/Header/Header.tsx"],"sourcesContent":["import { Helmet } from \"react-helmet-async\";\nimport { useTranslation } from \"react-i18next\";\n\nimport {\n HvHeader,\n HvHeaderBrand,\n HvHeaderNavigation,\n
|
|
1
|
+
{"version":3,"file":"Header.js","sources":["../../../../../src/components/layout/Header/Header.tsx"],"sourcesContent":["import { Helmet } from \"react-helmet-async\";\nimport { useTranslation } from \"react-i18next\";\n\nimport {\n HvButton,\n HvHeader,\n HvHeaderBrand,\n HvHeaderNavigation,\n HvHeaderNavigationProps\n} from \"@hitachivantara/uikit-react-core\";\n\nimport {\n CONFIG_TRANSLATIONS_NAMESPACE,\n useHvAppShellConfig\n} from \"@hitachivantara/app-shell-shared\";\nimport { useHvNavigation } from \"@hitachivantara/app-shell-navigation\";\n\nimport BrandLogo from \"./BrandLogo\";\nimport StyledIconWrapper from \"./styles\";\n\nimport useNavigationContext from \"../../../providers/hooks/useNavigationContext\";\nimport IconUiKit from \"../../IconUiKit\";\nimport HeaderActions from \"./HeaderActions\";\n\nconst Header = () => {\n const { t } = useTranslation();\n const { t: tConfig } = useTranslation(CONFIG_TRANSLATIONS_NAMESPACE);\n const appShellConfig = useHvAppShellConfig();\n const { navigate } = useHvNavigation();\n\n const {\n items,\n selectedMenuItemId,\n rootMenuItemId,\n isCompactMode,\n switchVerticalNavigationMode,\n verticalNavigationMode,\n verticalNavigationItems\n } = useNavigationContext();\n\n const isOnlyTopMode = appShellConfig.navigationMode === \"ONLY_TOP\";\n const showNavigation =\n !isCompactMode &&\n appShellConfig.navigationMode !== \"ONLY_LEFT\" &&\n items.length > 0;\n const isVerticalNavigationClosed = verticalNavigationMode === \"CLOSED\";\n const showVerticalNavigationButton =\n isCompactMode && verticalNavigationItems.length > 0;\n\n const handleNavigationChange: HvHeaderNavigationProps[\"onClick\"] = (\n event,\n selectedItem\n ) => {\n if (selectedItem.href) {\n navigate(selectedItem.href, {\n state: { selectedItemId: selectedItem.id }\n });\n }\n };\n\n const name = appShellConfig.name ? tConfig(appShellConfig.name) : \"\";\n\n return (\n <HvHeader position=\"fixed\">\n <Helmet>\n <title>{name}</title>\n </Helmet>\n\n {showVerticalNavigationButton && (\n <HvButton\n icon\n aria-label={\n isVerticalNavigationClosed\n ? t(\"header.navigation.openNavigationPanel\")\n : t(\"header.navigation.closeNavigationPanel\")\n }\n aria-expanded={!isVerticalNavigationClosed}\n onClick={switchVerticalNavigationMode}>\n <IconUiKit name={isVerticalNavigationClosed ? \"Menu\" : \"Close\"} />\n </HvButton>\n )}\n\n <HvHeaderBrand\n logo={\n <StyledIconWrapper>\n <BrandLogo logo={appShellConfig.logo} />\n </StyledIconWrapper>\n }\n name={name}\n />\n {showNavigation && (\n <HvHeaderNavigation\n data={items}\n selected={isOnlyTopMode ? selectedMenuItemId : rootMenuItemId}\n onClick={handleNavigationChange}\n levels={isOnlyTopMode ? 2 : 1}\n />\n )}\n\n <HeaderActions />\n </HvHeader>\n );\n};\n\nexport default Header;\n"],"names":["Header","t","useTranslation","tConfig","CONFIG_TRANSLATIONS_NAMESPACE","appShellConfig","useHvAppShellConfig","navigate","useHvNavigation","items","selectedMenuItemId","rootMenuItemId","isCompactMode","switchVerticalNavigationMode","verticalNavigationMode","verticalNavigationItems","useNavigationContext","isOnlyTopMode","navigationMode","showNavigation","length","isVerticalNavigationClosed","showVerticalNavigationButton","handleNavigationChange","event","selectedItem","href","state","selectedItemId","id","name","jsxs","HvHeader","jsx","Helmet","HvButton","IconUiKit","HvHeaderBrand","StyledIconWrapper","BrandLogo","logo","HvHeaderNavigation","HeaderActions","Header$1"],"mappings":";;;;;;;;;;;AAwBA,MAAMA,IAASA,MAAM;AACb,QAAA;AAAA,IAAEC,GAAAA;AAAAA,MAAMC,EAAe,GACvB;AAAA,IAAED,GAAGE;AAAAA,EAAAA,IAAYD,EAAeE,CAA6B,GAC7DC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GACT,QAAQN,IAAgB,IAAI,GAE/B;AAAA,sBAEAyB,GAAa,EAAA;AAAA,EAChB,EAAA,CAAA;AAEJ,GAEAC,IAAe3C;"}
|
|
@@ -1,31 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
import b from "./DynamicAction/DynamicAction.js";
|
|
8
|
-
import C, { internalActions as H } from "./InternalActions/InternalAction/InternalAction.js";
|
|
9
|
-
const x = () => {
|
|
1
|
+
import { jsx as r } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { HvHeaderActions as d } from "@hitachivantara/uikit-react-core";
|
|
3
|
+
import { useHvAppShellConfig as l } from "@hitachivantara/app-shell-shared";
|
|
4
|
+
import m from "./DynamicAction/DynamicAction.js";
|
|
5
|
+
import s, { internalActions as u } from "./InternalActions/InternalAction/InternalAction.js";
|
|
6
|
+
const c = () => {
|
|
10
7
|
const {
|
|
11
|
-
|
|
12
|
-
} =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
verticalNavigationItems: l
|
|
19
|
-
} = A(), i = c === "CLOSED", d = r && l.length > 0;
|
|
20
|
-
return /* @__PURE__ */ v(f, { children: [
|
|
21
|
-
t == null ? void 0 : t.actions.map((n, m) => {
|
|
22
|
-
const a = `headerAction_${m}`;
|
|
23
|
-
return H.find((u) => u.bundle === n.bundle) ? /* @__PURE__ */ o(C, { bundle: n.bundle, ...n.config }, a) : /* @__PURE__ */ o(b, { bundle: n.bundle, ...n.config }, a);
|
|
24
|
-
}),
|
|
25
|
-
d && /* @__PURE__ */ o(g, { icon: !0, onClick: () => s(), variant: "secondaryGhost", "aria-label": i ? e("header.navigation.openNavigationPanel") ?? "" : e("header.navigation.closeNavigationPanel") ?? "", "aria-expanded": !i, children: /* @__PURE__ */ o(N, { name: i ? "Menu" : "Close" }) })
|
|
26
|
-
] });
|
|
27
|
-
}, K = x;
|
|
8
|
+
header: e
|
|
9
|
+
} = l();
|
|
10
|
+
return /* @__PURE__ */ r(d, { children: e == null ? void 0 : e.actions.map((n, t) => {
|
|
11
|
+
const o = `${n.bundle}${t}`;
|
|
12
|
+
return u.find((i) => i.bundle === n.bundle) ? /* @__PURE__ */ r(s, { bundle: n.bundle, ...n.config }, o) : /* @__PURE__ */ r(m, { bundle: n.bundle, ...n.config }, o);
|
|
13
|
+
}) });
|
|
14
|
+
}, H = c;
|
|
28
15
|
export {
|
|
29
|
-
|
|
16
|
+
H as default
|
|
30
17
|
};
|
|
31
18
|
//# sourceMappingURL=HeaderActions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HeaderActions.js","sources":["../../../../../../src/components/layout/Header/HeaderActions/HeaderActions.tsx"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"HeaderActions.js","sources":["../../../../../../src/components/layout/Header/HeaderActions/HeaderActions.tsx"],"sourcesContent":["import { HvHeaderActions } from \"@hitachivantara/uikit-react-core\";\nimport { useHvAppShellConfig } from \"@hitachivantara/app-shell-shared\";\n\nimport DynamicAction from \"./DynamicAction\";\nimport InternalAction, {\n internalActions\n} from \"./InternalActions/InternalAction/InternalAction\";\n\nconst HeaderActions = () => {\n const { header } = useHvAppShellConfig();\n\n return (\n <HvHeaderActions>\n {header?.actions.map((action, index) => {\n const headerActionKey = `${action.bundle}${index}`;\n if (\n !internalActions.find(\n internalAction => internalAction.bundle === action.bundle\n )\n ) {\n return (\n <DynamicAction\n key={headerActionKey}\n bundle={action.bundle}\n {...action.config}\n />\n );\n }\n return (\n <InternalAction\n key={headerActionKey}\n bundle={action.bundle}\n {...action.config}\n />\n );\n })}\n </HvHeaderActions>\n );\n};\n\nexport default HeaderActions;\n"],"names":["HeaderActions","header","useHvAppShellConfig","HvHeaderActions","actions","map","action","index","headerActionKey","bundle","internalActions","find","internalAction","jsx","InternalAction","config","DynamicAction","HeaderActions$1"],"mappings":";;;;;AAQA,MAAMA,IAAgBA,MAAM;AACpB,QAAA;AAAA,IAAEC,QAAAA;AAAAA,MAAWC,EAAoB;AAEvC,2BACGC,GACEF,EAAAA,UAAAA,KAAAA,gBAAAA,EAAQG,QAAQC,IAAI,CAACC,GAAQC,MAAU;AACtC,UAAMC,IAAmB,GAAEF,EAAOG,MAAO,GAAEF,CAAM;AAE/C,WAACG,EAAgBC,KACfC,CAAAA,MAAkBA,EAAeH,WAAWH,EAAOG,MACrD,IAWA,gBAAAI,EAACC,KAEC,QAAQR,EAAOG,WACXH,EAAOS,UAFNP,CAGL,IAZA,gBAAAK,EAACG,KAEC,QAAQV,EAAOG,WACXH,EAAOS,UAFNP,CAGL;AAAA,EAUP,GACH,CAAA;AAEJ,GAEAS,IAAejB;"}
|
|
@@ -1,52 +1,49 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as g } from "react";
|
|
3
|
-
import { useTranslation as
|
|
1
|
+
import { jsx as t, jsxs as A } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { useState as u, useId as g } from "react";
|
|
3
|
+
import { useTranslation as p } from "react-i18next";
|
|
4
4
|
import { createPortal as w } from "react-dom";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { HvButton as k, HvAppSwitcher as v, HvTypography as y } from "@hitachivantara/uikit-react-core";
|
|
5
|
+
import { ClickAwayListener as C } from "@mui/material";
|
|
6
|
+
import { HvIconButton as k, HvAppSwitcher as I, HvTypography as P } from "@hitachivantara/uikit-react-core";
|
|
8
7
|
import { CONFIG_TRANSLATIONS_NAMESPACE as b } from "@hitachivantara/app-shell-shared";
|
|
9
|
-
import
|
|
8
|
+
import y from "./styles.js";
|
|
10
9
|
import d from "../../../../../IconUiKit/index.js";
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
const
|
|
14
|
-
title:
|
|
15
|
-
apps:
|
|
10
|
+
import T from "../../../../../../lib/utils/textUtil.js";
|
|
11
|
+
import v from "../../../../../../lib/utils/documentUtil.js";
|
|
12
|
+
const x = ({
|
|
13
|
+
title: l,
|
|
14
|
+
apps: r
|
|
16
15
|
}) => {
|
|
17
16
|
const {
|
|
18
|
-
t:
|
|
19
|
-
} =
|
|
17
|
+
t: a
|
|
18
|
+
} = p(), {
|
|
20
19
|
t: i
|
|
21
|
-
} =
|
|
20
|
+
} = p(b), [n, c] = u(!1), s = g(), h = () => r ? r.map((e) => ({
|
|
22
21
|
name: i(e.label),
|
|
23
22
|
description: e.description ? i(e.description).toString() : void 0,
|
|
24
|
-
url:
|
|
23
|
+
url: T(e.url, ":") ? e.url : i(e.url).toString(),
|
|
25
24
|
target: e.target === "NEW" ? "_blank" : "_top",
|
|
26
|
-
iconElement: e.icon && /* @__PURE__ */
|
|
27
|
-
})) : [],
|
|
28
|
-
|
|
25
|
+
iconElement: e.icon && /* @__PURE__ */ t(d, { name: e.icon.name })
|
|
26
|
+
})) : [], m = () => {
|
|
27
|
+
c(!1);
|
|
29
28
|
}, S = () => {
|
|
30
|
-
|
|
29
|
+
m();
|
|
31
30
|
}, f = () => {
|
|
32
|
-
|
|
31
|
+
c(!n);
|
|
33
32
|
};
|
|
34
|
-
if (!
|
|
33
|
+
if (!r || r.length === 0)
|
|
35
34
|
return null;
|
|
36
|
-
const
|
|
37
|
-
|
|
38
|
-
"aria-controls": p
|
|
39
|
-
} : {}
|
|
40
|
-
};
|
|
41
|
-
return /* @__PURE__ */ r(P, { onClickAway: c, children: /* @__PURE__ */ u("div", { style: {
|
|
35
|
+
const o = l ? i(l) : a("header.appSwitcher.title");
|
|
36
|
+
return /* @__PURE__ */ t(C, { onClickAway: m, children: /* @__PURE__ */ A("div", { style: {
|
|
42
37
|
display: "flex",
|
|
43
38
|
margin: 0
|
|
44
39
|
}, children: [
|
|
45
|
-
/* @__PURE__ */
|
|
46
|
-
|
|
40
|
+
/* @__PURE__ */ t(k, { title: o, "aria-label": o, "aria-expanded": n, onClick: f, ...n && {
|
|
41
|
+
"aria-controls": s
|
|
42
|
+
}, children: /* @__PURE__ */ t(d, { name: "AppSwitcher" }) }),
|
|
43
|
+
n && w(/* @__PURE__ */ t(y, { id: s, role: "region", "aria-label": a("header.appSwitcher.ariaLabel") ?? "", children: /* @__PURE__ */ t(I, { applications: h(), onActionClickedCallback: S, header: /* @__PURE__ */ t(P, { variant: "label", children: o }) }) }), v())
|
|
47
44
|
] }) });
|
|
48
|
-
},
|
|
45
|
+
}, K = x;
|
|
49
46
|
export {
|
|
50
|
-
|
|
47
|
+
K as default
|
|
51
48
|
};
|
|
52
49
|
//# sourceMappingURL=AppSwitcherToggle.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AppSwitcherToggle.js","sources":["../../../../../../../../src/components/layout/Header/HeaderActions/InternalActions/AppSwitcherToggle/AppSwitcherToggle.tsx"],"sourcesContent":["import { useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { createPortal } from \"react-dom\";\nimport {
|
|
1
|
+
{"version":3,"file":"AppSwitcherToggle.js","sources":["../../../../../../../../src/components/layout/Header/HeaderActions/InternalActions/AppSwitcherToggle/AppSwitcherToggle.tsx"],"sourcesContent":["import { useId, useState } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { createPortal } from \"react-dom\";\nimport { ClickAwayListener } from \"@mui/material\";\n\nimport {\n HvAppSwitcherActionApplication,\n HvAppSwitcher,\n HvTypography,\n HvIconButton\n} from \"@hitachivantara/uikit-react-core\";\n\nimport {\n CONFIG_TRANSLATIONS_NAMESPACE,\n HvAppShellAppSwitcherConfig,\n HvAppShellAppSwitcherItemConfig\n} from \"@hitachivantara/app-shell-shared\";\n\nimport StyledAppShellPanelWrapper from \"./styles\";\nimport IconUiKit from \"../../../../../IconUiKit\";\nimport includesString from \"../../../../../../lib/utils/textUtil\";\nimport createAppContainerElement from \"../../../../../../lib/utils/documentUtil\";\n\nconst AppSwitcherToggle: React.FC<HvAppShellAppSwitcherConfig> = ({\n title,\n apps\n}) => {\n const { t } = useTranslation();\n const { t: tConfig } = useTranslation(CONFIG_TRANSLATIONS_NAMESPACE);\n const [isPanelOpen, setIsPanelOpen] = useState(false);\n const appSwitcherPanelId = useId();\n\n /**\n * Creates the apps list to be sent to the HvAppSwitcherPanel.\n *\n * @memberof AppSwitcherToggle\n */\n const createAppsList = (): HvAppSwitcherActionApplication[] => {\n return apps\n ? apps.map((app: HvAppShellAppSwitcherItemConfig) => ({\n name: tConfig(app.label),\n description: app.description\n ? tConfig(app.description).toString()\n : undefined,\n url: includesString(app.url, \":\")\n ? app.url\n : tConfig(app.url).toString(),\n target: app.target === \"NEW\" ? \"_blank\" : \"_top\",\n iconElement: app.icon && <IconUiKit name={app.icon.name} />\n }))\n : [];\n };\n\n /**\n * Closes the apps panel.\n *\n * @memberof AppSwitcherToggle\n */\n const closeAppSwitcherPanel = () => {\n setIsPanelOpen(false);\n };\n\n /**\n * Handles action clicked event from the AppSwitcherPanel items\n *\n * @memberof AppSwitcherToggle\n */\n const handleAppSwitcherPanelItemClicked = () => {\n closeAppSwitcherPanel();\n };\n\n /**\n * Handles the click on the AppSwitcher button.\n *\n * @memberof AppSwitcherToggle\n */\n const handleAppSwitcherButtonClick = () => {\n setIsPanelOpen(!isPanelOpen);\n };\n\n if (!apps || apps.length === 0) {\n return null;\n }\n\n const finalTitle: string = title\n ? tConfig(title)\n : t(\"header.appSwitcher.title\");\n\n return (\n <ClickAwayListener onClickAway={closeAppSwitcherPanel}>\n <div style={{ display: \"flex\", margin: 0 }}>\n <HvIconButton\n title={finalTitle}\n aria-label={finalTitle}\n aria-expanded={isPanelOpen}\n onClick={handleAppSwitcherButtonClick}\n {...(isPanelOpen && { \"aria-controls\": appSwitcherPanelId })}>\n <IconUiKit name=\"AppSwitcher\" />\n </HvIconButton>\n {isPanelOpen &&\n createPortal(\n <StyledAppShellPanelWrapper\n id={appSwitcherPanelId}\n role=\"region\"\n aria-label={t(\"header.appSwitcher.ariaLabel\") ?? \"\"}>\n <HvAppSwitcher\n applications={createAppsList()}\n onActionClickedCallback={handleAppSwitcherPanelItemClicked}\n header={\n <HvTypography variant=\"label\">{finalTitle}</HvTypography>\n }\n />\n </StyledAppShellPanelWrapper>,\n createAppContainerElement()\n )}\n </div>\n </ClickAwayListener>\n );\n};\n\nexport default AppSwitcherToggle;\n"],"names":["AppSwitcherToggle","title","apps","t","useTranslation","tConfig","CONFIG_TRANSLATIONS_NAMESPACE","isPanelOpen","setIsPanelOpen","useState","appSwitcherPanelId","useId","createAppsList","map","app","name","label","description","toString","undefined","url","includesString","target","iconElement","icon","jsx","IconUiKit","closeAppSwitcherPanel","handleAppSwitcherPanelItemClicked","handleAppSwitcherButtonClick","length","finalTitle","ClickAwayListener","jsxs","display","margin","HvIconButton","createPortal","StyledAppShellPanelWrapper","HvAppSwitcher","HvTypography","createAppContainerElement","AppSwitcherToggle$1"],"mappings":";;;;;;;;;;;AAuBA,MAAMA,IAA2DA,CAAC;AAAA,EAChEC,OAAAA;AAAAA,EACAC,MAAAA;AACF,MAAM;AACE,QAAA;AAAA,IAAEC,GAAAA;AAAAA,MAAMC,EAAe,GACvB;AAAA,IAAED,GAAGE;AAAAA,EAAAA,IAAYD,EAAeE,CAA6B,GAC7D,CAACC,GAAaC,CAAc,IAAIC,EAAS,EAAK,GAC9CC,IAAqBC,KAOrBC,IAAiBA,MACdV,IACHA,EAAKW,IAAI,CAACC,OAA0C;AAAA,IAClDC,MAAMV,EAAQS,EAAIE,KAAK;AAAA,IACvBC,aAAaH,EAAIG,cACbZ,EAAQS,EAAIG,WAAW,EAAEC,SACzBC,IAAAA;AAAAA,IACJC,KAAKC,EAAeP,EAAIM,KAAK,GAAG,IAC5BN,EAAIM,MACJf,EAAQS,EAAIM,GAAG,EAAEF,SAAS;AAAA,IAC9BI,QAAQR,EAAIQ,WAAW,QAAQ,WAAW;AAAA,IAC1CC,aAAaT,EAAIU,QAAQ,gBAAAC,EAACC,KAAU,MAAMZ,EAAIU,KAAKT,MAAK;AAAA,EAAA,EACxD,IACF,CAAA,GAQAY,IAAwBA,MAAM;AAClCnB,IAAAA,EAAe,EAAK;AAAA,EAAA,GAQhBoB,IAAoCA,MAAM;AACxB,IAAAD;EAAA,GAQlBE,IAA+BA,MAAM;AACzCrB,IAAAA,EAAe,CAACD,CAAW;AAAA,EAAA;AAG7B,MAAI,CAACL,KAAQA,EAAK4B,WAAW;AACpB,WAAA;AAGT,QAAMC,IAAqB9B,IACvBI,EAAQJ,CAAK,IACbE,EAAE,0BAA0B;AAEhC,2BACG6B,GAAkB,EAAA,aAAaL,GAC9B,UAAA,gBAAAM,EAAC,SAAI,OAAO;AAAA,IAAEC,SAAS;AAAA,IAAQC,QAAQ;AAAA,EACrC,GAAA,UAAA;AAAA,IAAC,gBAAAV,EAAAW,GAAA,EACC,OAAOL,GACP,cAAYA,GACZ,iBAAexB,GACf,SAASsB,GACT,GAAKtB,KAAe;AAAA,MAAE,iBAAiBG;AAAAA,IAAAA,GACvC,UAAA,gBAAAe,EAACC,GAAU,EAAA,MAAK,cAAa,CAAA,GAC/B;AAAA,IACCnB,KACC8B,EACG,gBAAAZ,EAAAa,GAAA,EACC,IAAI5B,GACJ,MAAK,UACL,cAAYP,EAAE,8BAA8B,KAAK,IACjD,UAAC,gBAAAsB,EAAAc,GAAA,EACC,cAAc3B,EACd,GAAA,yBAAyBgB,GACzB,QACG,gBAAAH,EAAAe,GAAA,EAAa,SAAQ,SAAST,UAAWA,EAAA,CAAA,EAC3C,CAAA,EAEL,CAAA,GACAU,GACF;AAAA,EAAA,EACJ,CAAA,EACF,CAAA;AAEJ,GAEAC,IAAe1C;"}
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
import { jsx as o } from "@emotion/react/jsx-runtime";
|
|
2
2
|
import { useTranslation as i } from "react-i18next";
|
|
3
|
-
import { useTheme as l,
|
|
4
|
-
import { HvAppShellEventThemeTrigger as
|
|
3
|
+
import { useTheme as l, HvIconButton as c } from "@hitachivantara/uikit-react-core";
|
|
4
|
+
import { HvAppShellEventThemeTrigger as m } from "@hitachivantara/app-shell-events";
|
|
5
5
|
import s from "../../../../../IconUiKit/index.js";
|
|
6
|
-
const
|
|
6
|
+
const a = () => {
|
|
7
7
|
const {
|
|
8
8
|
t: e
|
|
9
9
|
} = i(), {
|
|
10
10
|
colorModes: t
|
|
11
11
|
} = l(), r = () => {
|
|
12
|
-
const n = new CustomEvent(
|
|
12
|
+
const n = new CustomEvent(m, {
|
|
13
13
|
detail: {
|
|
14
14
|
colorMode: void 0
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
17
|
globalThis.dispatchEvent(n);
|
|
18
18
|
};
|
|
19
|
-
return t.length > 1 && /* @__PURE__ */ o(c, {
|
|
20
|
-
}, f =
|
|
19
|
+
return t.length > 1 && /* @__PURE__ */ o(c, { onClick: r, title: e("header.colorModeSwitcher.ariaLabel"), children: /* @__PURE__ */ o(s, { name: "ThemeSwitcher" }) }) || null;
|
|
20
|
+
}, f = a;
|
|
21
21
|
export {
|
|
22
22
|
f as default
|
|
23
23
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorModeSwitcher.js","sources":["../../../../../../../../src/components/layout/Header/HeaderActions/InternalActions/ColorModeSwitcher/ColorModeSwitcher.tsx"],"sourcesContent":["import { useTranslation } from \"react-i18next\";\n\nimport {
|
|
1
|
+
{"version":3,"file":"ColorModeSwitcher.js","sources":["../../../../../../../../src/components/layout/Header/HeaderActions/InternalActions/ColorModeSwitcher/ColorModeSwitcher.tsx"],"sourcesContent":["import { useTranslation } from \"react-i18next\";\n\nimport { HvIconButton, useTheme } from \"@hitachivantara/uikit-react-core\";\nimport {\n HvAppShellEventThemeTrigger,\n HvAppShellEventTheme\n} from \"@hitachivantara/app-shell-events\";\n\nimport IconUiKit from \"../../../../../IconUiKit\";\n\nconst ColorModeSwitcher: React.FC = () => {\n const { t } = useTranslation();\n const { colorModes } = useTheme();\n\n const changeColorModeHandler = () => {\n const customEvent = new CustomEvent<HvAppShellEventTheme>(\n HvAppShellEventThemeTrigger,\n {\n detail: {\n colorMode: undefined\n }\n }\n );\n globalThis.dispatchEvent(customEvent);\n };\n\n return (\n (colorModes.length > 1 && (\n <HvIconButton\n onClick={changeColorModeHandler}\n title={t(\"header.colorModeSwitcher.ariaLabel\")}>\n <IconUiKit name=\"ThemeSwitcher\" />\n </HvIconButton>\n )) ||\n null\n );\n};\n\nexport default ColorModeSwitcher;\n"],"names":["ColorModeSwitcher","t","useTranslation","colorModes","useTheme","changeColorModeHandler","customEvent","CustomEvent","HvAppShellEventThemeTrigger","detail","colorMode","undefined","globalThis","dispatchEvent","length","jsx","HvIconButton","IconUiKit","ColorModeSwitcher$1"],"mappings":";;;;;AAUA,MAAMA,IAA8BA,MAAM;AAClC,QAAA;AAAA,IAAEC,GAAAA;AAAAA,MAAMC,EAAe,GACvB;AAAA,IAAEC,YAAAA;AAAAA,MAAeC,EAAS,GAE1BC,IAAyBA,MAAM;AAC7BC,UAAAA,IAAc,IAAIC,YACtBC,GACA;AAAA,MACEC,QAAQ;AAAA,QACNC,WAAWC;AAAAA,MACb;AAAA,IAAA,CAEJ;AACAC,eAAWC,cAAcP,CAAW;AAAA,EAAA;AAGtC,SACGH,EAAWW,SAAS,KAClB,gBAAAC,EAAAC,GAAA,EACC,SAASX,GACT,OAAOJ,EAAE,oCAAoC,GAC7C,UAAC,gBAAAc,EAAAE,GAAA,EAAU,MAAK,gBAAe,CAAA,GACjC,KAEF;AAEJ,GAEAC,IAAelB;"}
|
package/dist/esm/components/layout/Header/HeaderActions/InternalActions/HelpButton/HelpButton.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as r } from "@emotion/react/jsx-runtime";
|
|
2
2
|
import { useTranslation as e } from "react-i18next";
|
|
3
|
-
import {
|
|
4
|
-
import { CONFIG_TRANSLATIONS_NAMESPACE as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
3
|
+
import { HvIconButton as f } from "@hitachivantara/uikit-react-core";
|
|
4
|
+
import { CONFIG_TRANSLATIONS_NAMESPACE as p } from "@hitachivantara/app-shell-shared";
|
|
5
|
+
import a from "../../../../../../lib/utils/textUtil.js";
|
|
6
|
+
import c from "../../../../../IconUiKit/index.js";
|
|
7
7
|
const s = ({
|
|
8
8
|
url: t,
|
|
9
9
|
description: o
|
|
@@ -12,13 +12,13 @@ const s = ({
|
|
|
12
12
|
t: i
|
|
13
13
|
} = e(), {
|
|
14
14
|
t: n
|
|
15
|
-
} = e(
|
|
15
|
+
} = e(p);
|
|
16
16
|
if (!t)
|
|
17
17
|
return null;
|
|
18
|
-
const
|
|
19
|
-
return /* @__PURE__ */ r(
|
|
20
|
-
},
|
|
18
|
+
const m = a(t, ":") ? t : n(t), l = o ? n(o) : i("header.helpUrl.documentationLink");
|
|
19
|
+
return /* @__PURE__ */ r(f, { component: "a", href: m, target: "_blank", title: l, rel: "noopener,noreferrer", children: /* @__PURE__ */ r(c, { name: "Help" }) });
|
|
20
|
+
}, N = s;
|
|
21
21
|
export {
|
|
22
|
-
|
|
22
|
+
N as default
|
|
23
23
|
};
|
|
24
24
|
//# sourceMappingURL=HelpButton.js.map
|
package/dist/esm/components/layout/Header/HeaderActions/InternalActions/HelpButton/HelpButton.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HelpButton.js","sources":["../../../../../../../../src/components/layout/Header/HeaderActions/InternalActions/HelpButton/HelpButton.tsx"],"sourcesContent":["import { useTranslation } from \"react-i18next\";\n\nimport {
|
|
1
|
+
{"version":3,"file":"HelpButton.js","sources":["../../../../../../../../src/components/layout/Header/HeaderActions/InternalActions/HelpButton/HelpButton.tsx"],"sourcesContent":["import { useTranslation } from \"react-i18next\";\n\nimport { HvIconButton } from \"@hitachivantara/uikit-react-core\";\nimport {\n CONFIG_TRANSLATIONS_NAMESPACE,\n HvAppShellHelp\n} from \"@hitachivantara/app-shell-shared\";\n\nimport includesString from \"../../../../../../lib/utils/textUtil\";\nimport IconUiKit from \"../../../../../IconUiKit\";\n\nconst HelpButton: React.FC<HvAppShellHelp> = ({ url, description }) => {\n const { t } = useTranslation();\n const { t: tConfig } = useTranslation(CONFIG_TRANSLATIONS_NAMESPACE);\n\n if (!url) {\n return null;\n }\n\n const finalUrl = includesString(url, \":\") ? url : tConfig(url);\n\n const finalDescription = description\n ? tConfig(description)\n : t(\"header.helpUrl.documentationLink\");\n\n return (\n <HvIconButton\n component=\"a\"\n href={finalUrl}\n target=\"_blank\"\n title={finalDescription}\n rel=\"noopener,noreferrer\">\n <IconUiKit name=\"Help\" />\n </HvIconButton>\n );\n};\n\nexport default HelpButton;\n"],"names":["HelpButton","url","description","t","useTranslation","tConfig","CONFIG_TRANSLATIONS_NAMESPACE","finalUrl","includesString","finalDescription","HvIconButton","jsx","IconUiKit","HelpButton$1"],"mappings":";;;;;;AAWA,MAAMA,IAAuCA,CAAC;AAAA,EAAEC,KAAAA;AAAAA,EAAKC,aAAAA;AAAY,MAAM;AAC/D,QAAA;AAAA,IAAEC,GAAAA;AAAAA,MAAMC,EAAe,GACvB;AAAA,IAAED,GAAGE;AAAAA,EAAAA,IAAYD,EAAeE,CAA6B;AAEnE,MAAI,CAACL;AACI,WAAA;AAGT,QAAMM,IAAWC,EAAeP,GAAK,GAAG,IAAIA,IAAMI,EAAQJ,CAAG,GAEvDQ,IAAmBP,IACrBG,EAAQH,CAAW,IACnBC,EAAE,kCAAkC;AAExC,2BACGO,GACC,EAAA,WAAU,KACV,MAAMH,GACN,QAAO,UACP,OAAOE,GACP,KAAI,uBACJ,UAAA,gBAAAE,EAACC,GAAU,EAAA,MAAK,QAAM,EACxB,CAAA;AAEJ,GAEAC,IAAeb;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
2
|
-
import { useRef as
|
|
3
|
-
import { useTranslation as
|
|
4
|
-
import { cx as
|
|
5
|
-
import { HvVerticalNavigation as L, HvVerticalNavigationHeader as V, HvVerticalNavigationTree as B, HvVerticalNavigationActions as
|
|
6
|
-
import { useHvNavigation as
|
|
1
|
+
import { jsx as r, jsxs as N } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { useRef as b, useEffect as h } from "react";
|
|
3
|
+
import { useTranslation as C } from "react-i18next";
|
|
4
|
+
import { cx as x } from "@emotion/css";
|
|
5
|
+
import { HvVerticalNavigation as L, HvVerticalNavigationHeader as V, HvVerticalNavigationTree as B, HvVerticalNavigationActions as H } from "@hitachivantara/uikit-react-core";
|
|
6
|
+
import { useHvNavigation as I } from "@hitachivantara/app-shell-navigation";
|
|
7
7
|
import w from "../../../providers/hooks/useNavigationContext.js";
|
|
8
8
|
import { classes as l } from "./styles.js";
|
|
9
9
|
import A from "../../hoc/withClickAwayListener.js";
|
|
@@ -11,7 +11,7 @@ import E from "../../../providers/hooks/useLayoutContext.js";
|
|
|
11
11
|
const M = () => {
|
|
12
12
|
const {
|
|
13
13
|
t: a
|
|
14
|
-
} =
|
|
14
|
+
} = C(), {
|
|
15
15
|
selectedMenuItemId: d,
|
|
16
16
|
rootMenuItemId: g,
|
|
17
17
|
verticalNavigationItems: p,
|
|
@@ -22,27 +22,25 @@ const M = () => {
|
|
|
22
22
|
setVerticalNavigationWidth: o
|
|
23
23
|
} = E(), {
|
|
24
24
|
navigate: m
|
|
25
|
-
} =
|
|
25
|
+
} = I(), v = b(null), n = s === "EXPANDED", f = (e, t) => {
|
|
26
26
|
e.preventDefault(), t.href && (m(t.href, {
|
|
27
27
|
state: {
|
|
28
28
|
selectedItemId: t.id
|
|
29
29
|
}
|
|
30
30
|
}), i && c());
|
|
31
|
-
}, u = () => {
|
|
32
|
-
c();
|
|
33
31
|
};
|
|
34
|
-
|
|
32
|
+
h(() => {
|
|
35
33
|
const {
|
|
36
34
|
current: e
|
|
37
35
|
} = v, t = e == null ? void 0 : e.childNodes[0];
|
|
38
36
|
return o(t && !i ? t.offsetWidth : 0), () => o(0);
|
|
39
37
|
}, [s, i, o]);
|
|
40
|
-
const
|
|
41
|
-
return /* @__PURE__ */ r("div", { ref: v, children: /* @__PURE__ */
|
|
38
|
+
const u = a(n ? "verticalNavigation.ariaLabelCollapse" : "verticalNavigation.ariaLabelExpand");
|
|
39
|
+
return /* @__PURE__ */ r("div", { ref: v, children: /* @__PURE__ */ N(L, { className: x(l.navigation, {
|
|
42
40
|
[l.navigationCompact]: i
|
|
43
41
|
}), open: n, useIcons: !0, slider: i, children: [
|
|
44
|
-
/* @__PURE__ */ r(V, { title: a("verticalNavigation.title") ?? "", onCollapseButtonClick: i ? void 0 :
|
|
45
|
-
"aria-label":
|
|
42
|
+
/* @__PURE__ */ r(V, { title: a("verticalNavigation.title") ?? "", onCollapseButtonClick: i ? void 0 : c, collapseButtonProps: {
|
|
43
|
+
"aria-label": u,
|
|
46
44
|
"aria-expanded": n
|
|
47
45
|
}, backButtonProps: {
|
|
48
46
|
"aria-label": a("verticalNavigation.ariaLabelHeaderBackButton") ?? ""
|
|
@@ -50,10 +48,10 @@ const M = () => {
|
|
|
50
48
|
/* @__PURE__ */ r(B, { mode: "navigation", collapsible: !0, "aria-label": a("verticalNavigation.ariaLabelNavigationTree") ?? "", selected: d ?? "", onChange: f, data: p, classes: {
|
|
51
49
|
navigationPopup: l.navigationPopup
|
|
52
50
|
}, sliderForwardButtonAriaLabel: a("verticalNavigation.ariaLabelSliderForwardButton") ?? "" }, g),
|
|
53
|
-
/* @__PURE__ */ r(
|
|
51
|
+
/* @__PURE__ */ r(H, {})
|
|
54
52
|
] }) });
|
|
55
|
-
},
|
|
53
|
+
}, X = A(M);
|
|
56
54
|
export {
|
|
57
|
-
|
|
55
|
+
X as default
|
|
58
56
|
};
|
|
59
57
|
//# sourceMappingURL=VerticalNavigation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VerticalNavigation.js","sources":["../../../../../src/components/layout/VerticalNavigation/VerticalNavigation.tsx"],"sourcesContent":["import { useEffect, useRef } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { cx } from \"@emotion/css\";\nimport {\n HvVerticalNavigation,\n HvVerticalNavigationActions,\n HvVerticalNavigationHeader,\n HvVerticalNavigationTree\n} from \"@hitachivantara/uikit-react-core\";\n\nimport { useHvNavigation } from \"@hitachivantara/app-shell-navigation\";\n\nimport { NavigationMenuItem } from \"../../../lib/types\";\nimport useNavigationContext from \"../../../providers/hooks/useNavigationContext\";\nimport { classes } from \"./styles\";\n\nimport withClickAwayListener from \"../../hoc/withClickAwayListener\";\nimport useLayoutContext from \"../../../providers/hooks/useLayoutContext\";\n\nconst VerticalNavigation = () => {\n const { t } = useTranslation();\n const {\n selectedMenuItemId,\n rootMenuItemId,\n verticalNavigationItems,\n isCompactMode,\n verticalNavigationMode,\n switchVerticalNavigationMode\n } = useNavigationContext();\n const { setVerticalNavigationWidth } = useLayoutContext();\n const { navigate } = useHvNavigation();\n const verticalNavigationRef = useRef<HTMLDivElement>(null);\n const isVerticalNavigationExpanded = verticalNavigationMode === \"EXPANDED\";\n\n const changeHandler = (\n event: React.SyntheticEvent<Element, Event>,\n selectedItem: NavigationMenuItem\n ) => {\n // Due to the change from buttons to links on the navigation tree, we need to prevent the default behaviour of\n // the event to avoid full refreshes when clicking on the links.\n event.preventDefault();\n\n if (selectedItem.href) {\n navigate(selectedItem.href, {\n state: { selectedItemId: selectedItem.id }\n });\n\n if (isCompactMode) {\n switchVerticalNavigationMode();\n }\n }\n };\n\n
|
|
1
|
+
{"version":3,"file":"VerticalNavigation.js","sources":["../../../../../src/components/layout/VerticalNavigation/VerticalNavigation.tsx"],"sourcesContent":["import { useEffect, useRef } from \"react\";\nimport { useTranslation } from \"react-i18next\";\nimport { cx } from \"@emotion/css\";\nimport {\n HvVerticalNavigation,\n HvVerticalNavigationActions,\n HvVerticalNavigationHeader,\n HvVerticalNavigationTree\n} from \"@hitachivantara/uikit-react-core\";\n\nimport { useHvNavigation } from \"@hitachivantara/app-shell-navigation\";\n\nimport { NavigationMenuItem } from \"../../../lib/types\";\nimport useNavigationContext from \"../../../providers/hooks/useNavigationContext\";\nimport { classes } from \"./styles\";\n\nimport withClickAwayListener from \"../../hoc/withClickAwayListener\";\nimport useLayoutContext from \"../../../providers/hooks/useLayoutContext\";\n\nconst VerticalNavigation = () => {\n const { t } = useTranslation();\n const {\n selectedMenuItemId,\n rootMenuItemId,\n verticalNavigationItems,\n isCompactMode,\n verticalNavigationMode,\n switchVerticalNavigationMode\n } = useNavigationContext();\n const { setVerticalNavigationWidth } = useLayoutContext();\n const { navigate } = useHvNavigation();\n const verticalNavigationRef = useRef<HTMLDivElement>(null);\n const isVerticalNavigationExpanded = verticalNavigationMode === \"EXPANDED\";\n\n const changeHandler = (\n event: React.SyntheticEvent<Element, Event>,\n selectedItem: NavigationMenuItem\n ) => {\n // Due to the change from buttons to links on the navigation tree, we need to prevent the default behaviour of\n // the event to avoid full refreshes when clicking on the links.\n event.preventDefault();\n\n if (selectedItem.href) {\n navigate(selectedItem.href, {\n state: { selectedItemId: selectedItem.id }\n });\n\n if (isCompactMode) {\n switchVerticalNavigationMode();\n }\n }\n };\n\n useEffect(() => {\n const { current } = verticalNavigationRef;\n const firstChild = current?.childNodes[0] as HTMLElement;\n if (firstChild && !isCompactMode) {\n setVerticalNavigationWidth(firstChild.offsetWidth);\n } else {\n setVerticalNavigationWidth(0);\n }\n\n return () => setVerticalNavigationWidth(0);\n }, [verticalNavigationMode, isCompactMode, setVerticalNavigationWidth]);\n\n const collapseButtonAriaLabel = isVerticalNavigationExpanded\n ? t(\"verticalNavigation.ariaLabelCollapse\")\n : t(\"verticalNavigation.ariaLabelExpand\");\n\n return (\n <div ref={verticalNavigationRef}>\n <HvVerticalNavigation\n className={cx(classes.navigation, {\n [classes.navigationCompact]: isCompactMode\n })}\n open={isVerticalNavigationExpanded}\n useIcons\n slider={isCompactMode}>\n <HvVerticalNavigationHeader\n title={t(\"verticalNavigation.title\") ?? \"\"}\n onCollapseButtonClick={\n !isCompactMode ? switchVerticalNavigationMode : undefined\n }\n collapseButtonProps={{\n \"aria-label\": collapseButtonAriaLabel,\n \"aria-expanded\": isVerticalNavigationExpanded\n }}\n backButtonProps={{\n \"aria-label\":\n t(\"verticalNavigation.ariaLabelHeaderBackButton\") ?? \"\"\n }}\n />\n\n <HvVerticalNavigationTree\n key={rootMenuItemId}\n mode=\"navigation\"\n collapsible\n aria-label={t(\"verticalNavigation.ariaLabelNavigationTree\") ?? \"\"}\n selected={selectedMenuItemId ?? \"\"}\n onChange={changeHandler}\n data={verticalNavigationItems}\n classes={{ navigationPopup: classes.navigationPopup }}\n sliderForwardButtonAriaLabel={\n t(\"verticalNavigation.ariaLabelSliderForwardButton\") ?? \"\"\n }\n />\n\n <HvVerticalNavigationActions />\n </HvVerticalNavigation>\n </div>\n );\n};\n\nexport default withClickAwayListener(VerticalNavigation);\n"],"names":["VerticalNavigation","t","useTranslation","selectedMenuItemId","rootMenuItemId","verticalNavigationItems","isCompactMode","verticalNavigationMode","switchVerticalNavigationMode","useNavigationContext","setVerticalNavigationWidth","useLayoutContext","navigate","useHvNavigation","verticalNavigationRef","useRef","isVerticalNavigationExpanded","changeHandler","event","selectedItem","preventDefault","href","state","selectedItemId","id","useEffect","current","firstChild","childNodes","offsetWidth","collapseButtonAriaLabel","jsx","HvVerticalNavigation","cx","classes","navigation","navigationCompact","HvVerticalNavigationHeader","undefined","HvVerticalNavigationTree","navigationPopup","HvVerticalNavigationActions","withClickAwayListener"],"mappings":";;;;;;;;;;AAmBA,MAAMA,IAAqBA,MAAM;AACzB,QAAA;AAAA,IAAEC,GAAAA;AAAAA,MAAMC,EAAe,GACvB;AAAA,IACJC,oBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,IACAC,yBAAAA;AAAAA,IACAC,eAAAA;AAAAA,IACAC,wBAAAA;AAAAA,IACAC,8BAAAA;AAAAA,MACEC,EAAqB,GACnB;AAAA,IAAEC,4BAAAA;AAAAA,MAA+BC,EAAiB,GAClD;AAAA,IAAEC,UAAAA;AAAAA,MAAaC,EAAgB,GAC/BC,IAAwBC,EAAuB,IAAI,GACnDC,IA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AA2B,EAAA;AAAA,EAAA,EAC9B,CAAA,EACF,CAAA;AAEJ,GAEeC,IAAAA,EAAsB1C,CAAkB;"}
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import { useState as
|
|
1
|
+
import { useState as l, useEffect as c } from "react";
|
|
2
2
|
const u = {
|
|
3
|
-
COLOR_MODE: "hv/user-preferences/color-mode"
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
COLOR_MODE: "hv/user-preferences/color-mode",
|
|
4
|
+
NAV_EXPANDED: "hv/app-shell/expanded"
|
|
5
|
+
}, E = (o) => {
|
|
6
|
+
const e = u[o] || o, [r, s] = l(() => localStorage.getItem(e)), n = (t) => {
|
|
6
7
|
localStorage.setItem(e, t);
|
|
7
8
|
};
|
|
8
|
-
return
|
|
9
|
-
const t = (
|
|
10
|
-
|
|
9
|
+
return c(() => {
|
|
10
|
+
const t = (a) => {
|
|
11
|
+
a.key === e && s(a.newValue);
|
|
11
12
|
};
|
|
12
13
|
return window.addEventListener("storage", t), () => {
|
|
13
14
|
window.removeEventListener("storage", t);
|
|
14
15
|
};
|
|
15
16
|
}, [e]), {
|
|
16
17
|
value: r,
|
|
17
|
-
setStoredValue:
|
|
18
|
+
setStoredValue: n
|
|
18
19
|
};
|
|
19
20
|
};
|
|
20
21
|
export {
|
|
21
22
|
u as LOCAL_STORAGE_KEYS,
|
|
22
|
-
|
|
23
|
+
E as default
|
|
23
24
|
};
|
|
24
25
|
//# sourceMappingURL=useLocalStorage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLocalStorage.js","sources":["../../../../src/lib/hooks/useLocalStorage.ts"],"sourcesContent":["import { useState, useEffect } from \"react\";\n\nexport const LOCAL_STORAGE_KEYS = {\n COLOR_MODE: \"hv/user-preferences/color-mode\"\n};\n\nconst useLocalStorage = (
|
|
1
|
+
{"version":3,"file":"useLocalStorage.js","sources":["../../../../src/lib/hooks/useLocalStorage.ts"],"sourcesContent":["import { useState, useEffect } from \"react\";\n\nexport const LOCAL_STORAGE_KEYS = {\n COLOR_MODE: \"hv/user-preferences/color-mode\",\n NAV_EXPANDED: \"hv/app-shell/expanded\"\n} satisfies Record<string, string>;\n\ntype StorageKey = keyof typeof LOCAL_STORAGE_KEYS;\n\nconst useLocalStorage = (storageKey: StorageKey) => {\n const key = LOCAL_STORAGE_KEYS[storageKey] || storageKey;\n const [value, setValue] = useState(() => localStorage.getItem(key));\n\n const setStoredValue = (newValue: string) => {\n localStorage.setItem(key, newValue);\n };\n\n useEffect(() => {\n const handleStorageChange = (event: StorageEvent) => {\n if (event.key === key) {\n setValue(event.newValue);\n }\n };\n\n window.addEventListener(\"storage\", handleStorageChange);\n\n return () => {\n window.removeEventListener(\"storage\", handleStorageChange);\n };\n }, [key]);\n\n return { value, setStoredValue } as const;\n};\n\nexport default useLocalStorage;\n"],"names":["LOCAL_STORAGE_KEYS","COLOR_MODE","NAV_EXPANDED","useLocalStorage","storageKey","key","value","setValue","useState","localStorage","getItem","setStoredValue","newValue","setItem","useEffect","handleStorageChange","event","addEventListener","removeEventListener"],"mappings":";AAEO,MAAMA,IAAqB;AAAA,EAChCC,YAAY;AAAA,EACZC,cAAc;AAChB,GAIMC,IAAkBA,CAACC,MAA2B;AAC5CC,QAAAA,IAAML,EAAmBI,CAAU,KAAKA,GACxC,CAACE,GAAOC,CAAQ,IAAIC,EAAS,MAAMC,aAAaC,QAAQL,CAAG,CAAC,GAE5DM,IAAiBA,CAACC,MAAqB;AAC9BC,iBAAAA,QAAQR,GAAKO,CAAQ;AAAA,EAAA;AAGpCE,SAAAA,EAAU,MAAM;AACRC,UAAAA,IAAsBA,CAACC,MAAwB;AAC/CA,MAAAA,EAAMX,QAAQA,KAChBE,EAASS,EAAMJ,QAAQ;AAAA,IACzB;AAGKK,kBAAAA,iBAAiB,WAAWF,CAAmB,GAE/C,MAAM;AACJG,aAAAA,oBAAoB,WAAWH,CAAmB;AAAA,IAAA;AAAA,EAC3D,GACC,CAACV,CAAG,CAAC,GAED;AAAA,IAAEC,OAAAA;AAAAA,IAAOK,gBAAAA;AAAAA,EAAAA;AAClB;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useTheme as h } from "@hitachivantara/uikit-react-core";
|
|
2
|
-
import m
|
|
3
|
-
const
|
|
2
|
+
import m from "./useLocalStorage.js";
|
|
3
|
+
const u = () => {
|
|
4
4
|
const {
|
|
5
5
|
selectedTheme: s,
|
|
6
6
|
changeTheme: d,
|
|
@@ -8,7 +8,7 @@ const O = () => {
|
|
|
8
8
|
colorModes: o
|
|
9
9
|
} = h(), {
|
|
10
10
|
setStoredValue: c
|
|
11
|
-
} = m(
|
|
11
|
+
} = m("COLOR_MODE"), l = () => {
|
|
12
12
|
const e = (o.indexOf(r) + 1) % o.length;
|
|
13
13
|
return o[e];
|
|
14
14
|
};
|
|
@@ -22,6 +22,6 @@ const O = () => {
|
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
24
|
export {
|
|
25
|
-
|
|
25
|
+
u as default
|
|
26
26
|
};
|
|
27
27
|
//# sourceMappingURL=useThemeEventListener.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useThemeEventListener.js","sources":["../../../../src/lib/hooks/useThemeEventListener.ts"],"sourcesContent":["import { useTheme } from \"@hitachivantara/uikit-react-core\";\n\nimport { HvAppShellEventTheme } from \"@hitachivantara/app-shell-events\";\nimport useLocalStorage
|
|
1
|
+
{"version":3,"file":"useThemeEventListener.js","sources":["../../../../src/lib/hooks/useThemeEventListener.ts"],"sourcesContent":["import { useTheme } from \"@hitachivantara/uikit-react-core\";\n\nimport { HvAppShellEventTheme } from \"@hitachivantara/app-shell-events\";\nimport useLocalStorage from \"./useLocalStorage\";\n\nconst useThemeEventListener = () => {\n const { selectedTheme, changeTheme, selectedMode, colorModes } = useTheme();\n const { setStoredValue } = useLocalStorage(\"COLOR_MODE\");\n\n const getNextColorMode = () => {\n const index = colorModes.indexOf(selectedMode);\n\n const nextIndex = (index + 1) % colorModes.length;\n return colorModes[nextIndex];\n };\n\n const handleThemeEvent = (event: CustomEvent<HvAppShellEventTheme>) => {\n const { colorMode } = event.detail;\n const newColorMode =\n !colorMode || colorModes.indexOf(colorMode) === -1\n ? getNextColorMode()\n : colorMode;\n\n // For now we only want to change the colorMode\n changeTheme(selectedTheme, newColorMode);\n setStoredValue(newColorMode);\n };\n\n return { handleThemeEvent };\n};\n\nexport default useThemeEventListener;\n"],"names":["useThemeEventListener","selectedTheme","changeTheme","selectedMode","colorModes","useTheme","setStoredValue","useLocalStorage","getNextColorMode","nextIndex","indexOf","length","handleThemeEvent","event","colorMode","detail","newColorMode"],"mappings":";;AAKA,MAAMA,IAAwBA,MAAM;AAC5B,QAAA;AAAA,IAAEC,eAAAA;AAAAA,IAAeC,aAAAA;AAAAA,IAAaC,cAAAA;AAAAA,IAAcC,YAAAA;AAAAA,MAAeC,EAAS,GACpE;AAAA,IAAEC,gBAAAA;AAAAA,EAAAA,IAAmBC,EAAgB,YAAY,GAEjDC,IAAmBA,MAAM;AAGvBC,UAAAA,KAFQL,EAAWM,QAAQP,CAAY,IAElB,KAAKC,EAAWO;AAC3C,WAAOP,EAAWK,CAAS;AAAA,EAAA;AAetB,SAAA;AAAA,IAAEG,kBAZgBA,CAACC,MAA6C;AAC/D,YAAA;AAAA,QAAEC,WAAAA;AAAAA,MAAAA,IAAcD,EAAME,QACtBC,IACJ,CAACF,KAAaV,EAAWM,QAAQI,CAAS,MAAM,KAC5CN,EACAM,IAAAA;AAGNZ,MAAAA,EAAYD,GAAee,CAAY,GACvCV,EAAeU,CAAY;AAAA,IAAA;AAAA,EAGpBJ;AACX;"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { useTheme as
|
|
4
|
-
import { useHvAppShellConfig as
|
|
5
|
-
import { removeHrefFromMenuItemsWithChildren as
|
|
6
|
-
import
|
|
7
|
-
|
|
1
|
+
import { jsx as x } from "@emotion/react/jsx-runtime";
|
|
2
|
+
import { createContext as L, useState as d, useMemo as s, useEffect as u, useCallback as A } from "react";
|
|
3
|
+
import { useTheme as O, useMediaQuery as w } from "@mui/material";
|
|
4
|
+
import { useHvAppShellConfig as T } from "@hitachivantara/app-shell-shared";
|
|
5
|
+
import { removeHrefFromMenuItemsWithChildren as I, findItemById as V } from "../lib/utils/navigationUtil.js";
|
|
6
|
+
import b from "../lib/hooks/useNavigationMenuItems.js";
|
|
7
|
+
import H from "../lib/hooks/useLocalStorage.js";
|
|
8
|
+
const X = L({
|
|
8
9
|
selectedMenuItemId: void 0,
|
|
9
10
|
rootMenuItemId: void 0,
|
|
10
11
|
items: [],
|
|
@@ -15,42 +16,51 @@ const w = C({
|
|
|
15
16
|
verticalNavigationMode: "EXPANDED",
|
|
16
17
|
switchVerticalNavigationMode: () => {
|
|
17
18
|
}
|
|
18
|
-
}),
|
|
19
|
-
children:
|
|
19
|
+
}), _ = ({
|
|
20
|
+
children: h
|
|
20
21
|
}) => {
|
|
21
22
|
const {
|
|
22
|
-
navigationMode:
|
|
23
|
-
} =
|
|
23
|
+
navigationMode: a
|
|
24
|
+
} = T(), {
|
|
24
25
|
items: t,
|
|
25
|
-
selectedMenuItemId:
|
|
26
|
-
rootMenuItemId:
|
|
27
|
-
} =
|
|
28
|
-
|
|
26
|
+
selectedMenuItemId: c,
|
|
27
|
+
rootMenuItemId: i
|
|
28
|
+
} = b(), S = O(), e = w(S.breakpoints.down("md")), {
|
|
29
|
+
value: m,
|
|
30
|
+
setStoredValue: l
|
|
31
|
+
} = H("NAV_EXPANDED"), [n, C] = d(m == null ? !0 : m === "true"), [v, f] = d(e), [N, D] = d(!1), g = s(() => e ? v ? "CLOSED" : "EXPANDED" : n ? "EXPANDED" : "COLLAPSED", [v, e, n]), r = s(() => {
|
|
32
|
+
var E;
|
|
29
33
|
if (e)
|
|
30
34
|
return t;
|
|
31
|
-
if (
|
|
32
|
-
return
|
|
33
|
-
const o =
|
|
34
|
-
return
|
|
35
|
-
}, [t,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
if (a === "ONLY_LEFT")
|
|
36
|
+
return I(t);
|
|
37
|
+
const o = i && ((E = V(t, i)) == null ? void 0 : E.data) || [];
|
|
38
|
+
return I(o);
|
|
39
|
+
}, [t, a, i, e]), M = s(() => e ? !0 : a === "ONLY_TOP" ? !1 : r && r.length > 0, [a, r, e]);
|
|
40
|
+
u(() => {
|
|
41
|
+
l(String(n));
|
|
42
|
+
}, [n, l]), u(() => {
|
|
43
|
+
f(e);
|
|
44
|
+
}, [e]), u(() => {
|
|
45
|
+
D(a === "ONLY_TOP" && t.some((o) => o.data && o.data.length > 0));
|
|
46
|
+
}, [a, t]);
|
|
47
|
+
const p = A(() => {
|
|
48
|
+
e ? f((o) => !o) : C((o) => !o);
|
|
49
|
+
}, [e]), P = s(() => ({
|
|
50
|
+
selectedMenuItemId: c,
|
|
51
|
+
rootMenuItemId: i,
|
|
42
52
|
items: t,
|
|
43
53
|
verticalNavigationItems: r,
|
|
44
|
-
hasVerticalNavigation:
|
|
45
|
-
showHeaderSubMenu:
|
|
54
|
+
hasVerticalNavigation: M,
|
|
55
|
+
showHeaderSubMenu: N,
|
|
46
56
|
isCompactMode: e,
|
|
47
|
-
verticalNavigationMode:
|
|
48
|
-
switchVerticalNavigationMode:
|
|
49
|
-
}), [
|
|
50
|
-
return /* @__PURE__ */
|
|
51
|
-
},
|
|
57
|
+
verticalNavigationMode: g,
|
|
58
|
+
switchVerticalNavigationMode: p
|
|
59
|
+
}), [c, i, t, r, M, N, e, g, p]);
|
|
60
|
+
return /* @__PURE__ */ x(X.Provider, { value: P, children: h });
|
|
61
|
+
}, R = _;
|
|
52
62
|
export {
|
|
53
|
-
|
|
54
|
-
|
|
63
|
+
X as NavigationContext,
|
|
64
|
+
R as default
|
|
55
65
|
};
|
|
56
66
|
//# sourceMappingURL=NavigationProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationProvider.js","sources":["../../../src/providers/NavigationProvider.tsx"],"sourcesContent":["import {\n createContext,\n ReactNode,\n useCallback,\n useEffect,\n useMemo,\n useState\n} from \"react\";\nimport { useMediaQuery, useTheme } from \"@mui/material\";\n\nimport { useHvAppShellConfig } from \"@hitachivantara/app-shell-shared\";\n\nimport {\n findItemById,\n removeHrefFromMenuItemsWithChildren\n} from \"../lib/utils/navigationUtil\";\nimport { NavigationMenuItem } from \"../lib/types\";\nimport useNavigationMenuItems from \"../lib/hooks/useNavigationMenuItems\";\n\nexport type NavigationProviderProps = {\n children: ReactNode;\n};\n\nexport type VerticalNavigationMode = \"EXPANDED\" | \"COLLAPSED\" | \"CLOSED\";\n\nexport interface NavigationContextValue {\n selectedMenuItemId: string | undefined;\n rootMenuItemId: string | undefined;\n items: NavigationMenuItem[];\n verticalNavigationItems: NavigationMenuItem[];\n hasVerticalNavigation: boolean;\n showHeaderSubMenu: boolean;\n isCompactMode: boolean;\n verticalNavigationMode: VerticalNavigationMode;\n switchVerticalNavigationMode: () => void;\n}\n\nexport const NavigationContext = createContext<NavigationContextValue>({\n selectedMenuItemId: undefined,\n rootMenuItemId: undefined,\n items: [],\n verticalNavigationItems: [],\n hasVerticalNavigation: false,\n showHeaderSubMenu: false,\n isCompactMode: false,\n verticalNavigationMode: \"EXPANDED\",\n switchVerticalNavigationMode: () => {\n // Empty function\n }\n});\n\nconst NavigationProvider = ({ children }: NavigationProviderProps) => {\n const { navigationMode } = useHvAppShellConfig();\n const { items, selectedMenuItemId, rootMenuItemId } =\n useNavigationMenuItems();\n const muiTheme = useTheme();\n\n const isCompactMode = useMediaQuery(muiTheme.breakpoints.down(\"md\"));\n const [
|
|
1
|
+
{"version":3,"file":"NavigationProvider.js","sources":["../../../src/providers/NavigationProvider.tsx"],"sourcesContent":["import {\n createContext,\n ReactNode,\n useCallback,\n useEffect,\n useMemo,\n useState\n} from \"react\";\nimport { useMediaQuery, useTheme } from \"@mui/material\";\n\nimport { useHvAppShellConfig } from \"@hitachivantara/app-shell-shared\";\n\nimport {\n findItemById,\n removeHrefFromMenuItemsWithChildren\n} from \"../lib/utils/navigationUtil\";\nimport { NavigationMenuItem } from \"../lib/types\";\nimport useNavigationMenuItems from \"../lib/hooks/useNavigationMenuItems\";\nimport useLocalStorage from \"../lib/hooks/useLocalStorage\";\n\nexport type NavigationProviderProps = {\n children: ReactNode;\n};\n\nexport type VerticalNavigationMode = \"EXPANDED\" | \"COLLAPSED\" | \"CLOSED\";\n\nexport interface NavigationContextValue {\n selectedMenuItemId: string | undefined;\n rootMenuItemId: string | undefined;\n /** Items visible in the header */\n items: NavigationMenuItem[];\n /** Items visible in the vertical navigation */\n verticalNavigationItems: NavigationMenuItem[];\n hasVerticalNavigation: boolean;\n showHeaderSubMenu: boolean;\n isCompactMode: boolean;\n verticalNavigationMode: VerticalNavigationMode;\n switchVerticalNavigationMode: () => void;\n}\n\nexport const NavigationContext = createContext<NavigationContextValue>({\n selectedMenuItemId: undefined,\n rootMenuItemId: undefined,\n items: [],\n verticalNavigationItems: [],\n hasVerticalNavigation: false,\n showHeaderSubMenu: false,\n isCompactMode: false,\n verticalNavigationMode: \"EXPANDED\",\n switchVerticalNavigationMode: () => {\n // Empty function\n }\n});\n\nconst NavigationProvider = ({ children }: NavigationProviderProps) => {\n const { navigationMode } = useHvAppShellConfig();\n const { items, selectedMenuItemId, rootMenuItemId } =\n useNavigationMenuItems();\n const muiTheme = useTheme();\n\n const isCompactMode = useMediaQuery(muiTheme.breakpoints.down(\"md\"));\n const { value: storedExpanded, setStoredValue: setStoreExpanded } =\n useLocalStorage(\"NAV_EXPANDED\");\n const [isExpanded, setIsExpanded] = useState(\n storedExpanded == null ? true : storedExpanded === \"true\"\n );\n const [isClosed, setIsClosed] = useState(isCompactMode);\n const [showHeaderSubMenu, setShowHeaderSubMenu] = useState(false);\n\n const verticalNavigationMode = useMemo<VerticalNavigationMode>(() => {\n if (isCompactMode) {\n return isClosed ? \"CLOSED\" : \"EXPANDED\";\n }\n return isExpanded ? \"EXPANDED\" : \"COLLAPSED\";\n }, [isClosed, isCompactMode, isExpanded]);\n\n const verticalNavigationItems = useMemo(() => {\n if (isCompactMode) {\n return items;\n }\n\n if (navigationMode === \"ONLY_LEFT\") {\n return removeHrefFromMenuItemsWithChildren(items);\n }\n\n const itemsToReturn =\n (rootMenuItemId && findItemById(items, rootMenuItemId)?.data) || [];\n\n return removeHrefFromMenuItemsWithChildren(itemsToReturn);\n }, [items, navigationMode, rootMenuItemId, isCompactMode]);\n\n const hasVerticalNavigation = useMemo(() => {\n if (isCompactMode) {\n return true;\n }\n\n if (navigationMode === \"ONLY_TOP\") {\n return false;\n }\n\n return verticalNavigationItems && verticalNavigationItems.length > 0;\n }, [navigationMode, verticalNavigationItems, isCompactMode]);\n\n // sync isMinimized with the stored value\n useEffect(() => {\n setStoreExpanded(String(isExpanded));\n }, [isExpanded, setStoreExpanded]);\n\n // sync isCompactMode media query\n useEffect(() => {\n setIsClosed(isCompactMode);\n }, [isCompactMode]);\n\n useEffect(() => {\n setShowHeaderSubMenu(\n navigationMode === \"ONLY_TOP\" &&\n items.some(item => item.data && item.data.length > 0)\n );\n }, [navigationMode, items]);\n\n const switchVerticalNavigationMode = useCallback(() => {\n if (isCompactMode) {\n setIsClosed(prevState => !prevState);\n } else {\n setIsExpanded(prevState => !prevState);\n }\n }, [isCompactMode]);\n\n const value = useMemo(\n () => ({\n selectedMenuItemId,\n rootMenuItemId,\n items,\n verticalNavigationItems,\n hasVerticalNavigation,\n showHeaderSubMenu,\n isCompactMode,\n verticalNavigationMode,\n switchVerticalNavigationMode\n }),\n [\n selectedMenuItemId,\n rootMenuItemId,\n items,\n verticalNavigationItems,\n hasVerticalNavigation,\n showHeaderSubMenu,\n isCompactMode,\n verticalNavigationMode,\n switchVerticalNavigationMode\n ]\n );\n\n return (\n <NavigationContext.Provider value={value}>\n {children}\n </NavigationContext.Provider>\n );\n};\n\nexport default NavigationProvider;\n"],"names":["NavigationContext","createContext","selectedMenuItemId","undefined","rootMenuItemId","items","verticalNavigationItems","hasVerticalNavigation","showHeaderSubMenu","isCompactMode","verticalNavigationMode","switchVerticalNavigationMode","NavigationProvider","children","navigationMode","useHvAppShellConfig","useNavigationMenuItems","muiTheme","useTheme","useMediaQuery","breakpoints","down","value","storedExpanded","setStoredValue","setStoreExpanded","useLocalStorage","isExpanded","setIsExpanded","useState","isClosed","setIsClosed","setShowHeaderSubMenu","useMemo","removeHrefFromMenuItemsWithChildren","itemsToReturn","findItemById","data","length","useEffect","String","some","item","useCallback","prevState","jsx","NavigationProvider$1"],"mappings":";;;;;;;AAwCO,MAAMA,IAAoBC,EAAsC;AAAA,EACrEC,oBAAoBC;AAAAA,EACpBC,gBAAgBD;AAAAA,EAChBE,OAAO,CAAE;AAAA,EACTC,yBAAyB,CAAE;AAAA,EAC3BC,uBAAuB;AAAA,EACvBC,mBAAmB;AAAA,EACnBC,eAAe;AAAA,EACfC,wBAAwB;AAAA,EACxBC,8BAA8BA,MAAM;AAAA,EAClC;AAEJ,CAAC,GAEKC,IAAqBA,CAAC;AAAA,EAAEC,UAAAA;AAAkC,MAAM;AAC9D,QAAA;AAAA,IAAEC,gBAAAA;AAAAA,MAAmBC,EAAoB,GACzC;AAAA,IAAEV,OAAAA;AAAAA,IAAOH,oBAAAA;AAAAA,IAAoBE,gBAAAA;AAAAA,MACjCY,EAAuB,GACnBC,IAAWC,KAEXT,IAAgBU,EAAcF,EAASG,YAAYC,KAAK,IAAI,CAAC,GAC7D;AAAA,IAAEC,OAAOC;AAAAA,IAAgBC,gBAAgBC;AAAAA,EAAAA,IAC7CC,EAAgB,cAAc,GAC1B,CAACC,GAAYC,CAAa,IAAIC,EAClCN,KAAkB,OAAO,KAAOA,MAAmB,MACrD,GACM,CAACO,GAAUC,CAAW,IAAIF,EAASpB,CAAa,GAChD,CAACD,GAAmBwB,CAAoB,IAAIH,EAAS,EAAK,GAE1DnB,IA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ACAC,eAAAA;AAAAA,IACAC,wBAAAA;AAAAA,IACAC,8BAAAA;AAAAA,EACF,IACA,CACET,GACAE,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,GACAC,CAA4B,CAEhC;AAEA,SACG,gBAAAkC,EAAA7C,EAAkB,UAAlB,EAA2B,OAAAsB,GACzBT,UAAAA,EACH,CAAA;AAEJ,GAEAiC,IAAelC;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hitachivantara/app-shell-ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "AppShell Component",
|
|
5
5
|
"author": "Hitachi Vantara - Boba Fett Team",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"vite-plugin-dts": "^3.6.4",
|
|
69
69
|
"vite-tsconfig-paths": "^4.0.5"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "21d20a365cf4718324c6e0c628cf28cffd2cf444"
|
|
72
72
|
}
|