@hitachivantara/app-shell-ui 1.2.0 → 1.3.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/hoc/withClickAwayListener.js +8 -8
- package/dist/esm/components/hoc/withClickAwayListener.js.map +1 -1
- package/dist/esm/components/hoc/withGlobalProvider.js +12 -12
- package/dist/esm/components/hoc/withGlobalProvider.js.map +1 -1
- package/dist/esm/components/layout/VerticalNavigation/VerticalNavigation.js +37 -36
- package/dist/esm/components/layout/VerticalNavigation/VerticalNavigation.js.map +1 -1
- package/dist/esm/components/layout/VerticalNavigation/styles.js +31 -18
- package/dist/esm/components/layout/VerticalNavigation/styles.js.map +1 -1
- package/dist/esm/lib/hooks/useClearLocationState.js +5 -5
- package/dist/esm/lib/hooks/useClearLocationState.js.map +1 -1
- package/dist/esm/lib/hooks/useCustomEventListener.js +3 -3
- package/dist/esm/lib/hooks/useCustomEventListener.js.map +1 -1
- package/dist/esm/lib/hooks/useLocalStorage.js +12 -11
- package/dist/esm/lib/hooks/useLocalStorage.js.map +1 -1
- package/dist/esm/lib/hooks/useNavigationMenuItems.js +7 -7
- package/dist/esm/lib/hooks/useNavigationMenuItems.js.map +1 -1
- package/dist/esm/lib/hooks/useNotificationsEventListener.js +12 -12
- package/dist/esm/lib/hooks/useNotificationsEventListener.js.map +1 -1
- package/dist/esm/lib/hooks/useThemeEventListener.js +10 -10
- package/dist/esm/lib/hooks/useThemeEventListener.js.map +1 -1
- package/dist/esm/lib/i18n/index.js +4 -4
- package/dist/esm/lib/i18n/index.js.map +1 -1
- package/dist/esm/lib/utils/basePathUtils.js +2 -2
- package/dist/esm/lib/utils/basePathUtils.js.map +1 -1
- package/dist/esm/lib/utils/documentUtil.js +2 -2
- package/dist/esm/lib/utils/documentUtil.js.map +1 -1
- package/dist/esm/lib/utils/textUtil.js +2 -2
- package/dist/esm/lib/utils/textUtil.js.map +1 -1
- package/dist/esm/providers/NavigationProvider.js +45 -35
- package/dist/esm/providers/NavigationProvider.js.map +1 -1
- package/dist/esm/providers/hooks/useBannerContext.js +7 -7
- package/dist/esm/providers/hooks/useBannerContext.js.map +1 -1
- package/dist/esm/providers/hooks/useLayoutContext.js +6 -6
- package/dist/esm/providers/hooks/useLayoutContext.js.map +1 -1
- package/dist/esm/providers/hooks/useNavigationContext.js +6 -6
- package/dist/esm/providers/hooks/useNavigationContext.js.map +1 -1
- package/package.json +5 -5
|
@@ -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,EAAAA,IAAyBC,EAAgB,YAAY,GAC9D,CAACC,GAAcC,CAAe,IAAIC,EAEtCC,MAAS,GAEL,CAACC,GAAUC,CAAW,IAAIH,EAAkB,EAAK;AAEvDI,EAAAA,EAAU,MAAM;AACV,IAAA,CAACd,KAAeC,KAClBc,MAAM,IAAIC,IAAIf,CAAS,CAAC,EACrBgB,KAAKC,CAAUA,MACPA,EAAOC,MACf,EACAF,KAAKG,CAAAA,MAAQX,EAAgBW,CAAI,CAAC,EAClCC,MAAMC,CAAKA,MAAA;AACVC,cAAQC,MACL,mDAAkDvB,CAAU,IAC7DqB,CACF,GACAb,EAAgBE,MAAS,GACzBE,EAAY,EAAI;AAAA,IAAA,CACjB;AAAA,EACL,GACC,CAACb,GAAaC,CAAS,CAAC;AAErBwB,QAAAA,IAAgDC,EACpD,MAAM1B,KAAeQ,GACrB,CAACR,GAAaQ,CAAY,CAC5B;AAEA,MAAII;AACF,UAAMe,MAAM,iDAAiD;AAG/D,EAAIF,KAAAA,QAAAA,EAAWG,gBAEX1B,EAAAA,GACAuB,EAAUG,cACVC,CACF;AAGF,QAAM,CAACC,GAAQC,CAAS,IAAIrB,EAAgCC,MAAS,GAC/D,CAACqB,GAAWC,CAAY,IAAIvB,EAEhCC,MAAS;AAEXG,EAAAA,EAAU,MAAM;;AACVW,KAAAA,IAAAA,KAAAA,gBAAAA,EAAWS,YAAXT,QAAAA,EAAoBK,UACtBK,QAAQC,KACNX,IAAAA,EAAUS,QAAQJ,WAAlBL,gBAAAA,EAA0BY,IAAIC,CAAUA,OAElCA,MAAW,SAASA,MAAW,UAAUC,EAAWD,CAAM,KAC5D;AAAA;AAAA,MAA0BA;AAAAA,MACvBrB,KAAKuB,CAAUA,MAAAA,EAAOC,OAAO,EAC7BpB,MAAMC,CAAKA,MAAA;AACVC,cAAQC,MAAO,0BAAyBc,CAAO,YAAWhB,CAAE,EAAC;AAAA,IAAA,CAC9D,EAGT,EACGL,KAAKyB,CAAgBA,MAAA;AACpBX,MAAAA,EAAUW,EAAaC,OAAOC,CAAAA,MAAS,CAAC,CAACA,CAAK,CAAC;AAAA,IAAA,CAChD,EACAvB,MAAMC,CAAKA,MAAA;AACFE,cAAAA,MAAO,4BAA2BF,CAAE,EAAC;AAAA,IAAA,CAC9C;AAAA,EAEJ,GAAA,EAACG,IAAAA,KAAAA,gBAAAA,EAAWS,YAAXT,gBAAAA,EAAoBK,MAAM,CAAC,GAE/BhB,EAAU,MAAM;AACd,IAAIW,KAAAA,QAAAA,EAAWO,aACbG,QAAQC,IACNX,EAAUO,UAAUK,IAAIQ,CAAYA,MAC3B;AAAA;AAAA,MAA0BA,EAASP;AAAAA,MACvCrB,KAAKuB,CAAUA,MAAAA,EAAOC,OAAO,EAC7BpB,MAAMC,CAAKA,MAAA;AACVC,cAAQC,MACL,uBAAsBqB,EAASP,MAAO,aAAYhB,CAAE,EACvD;AAAA,IAAA,CACD,CACJ,CACH,EACGL,KAAK6B,CAAAA,MACJb,EAAaa,EAAgBH,OAAOE,CAAYA,MAAA,CAAC,CAACA,CAAQ,CAAC,CAC7D,EACCxB,MAAMC,CAAKA,MAAA;AACFE,cAAAA,MAAO,+BAA8BF,CAAC;AAAA,IAAA,CAC/C;AAAA,EACL,GACC,CAACG,KAAAA,gBAAAA,EAAWO,SAAS,CAAC;AAEnBe,QAAAA,IAAiBrB,EACrB,OAAO;AAAA,IACLxB,MAAAA;AAAAA,EAAAA,IAEF,CAACA,CAAI,CACP;AAEE,SAAA,CAACuB,MACAA,IAAAA,EAAUS,YAAVT,QAAAA,EAAmBK,UAAU,CAACA,KAC9BL,EAAUO,aAAa,QAAQA,MAAcrB,SAEvC,yBAINqC,EAAkB,UAAlB,EAA2B,OAAOvB,GACjC,UAAC,gBAAAwB,EAAAC,EAAyB,UAAzB,EAAkC,OAAOH,GACxC,UAAA,gBAAAE,EAACE,GACC,UAAArB,GACA,QAAOL,IAAAA,EAAUS,YAAVT,gBAAAA,EAAmBmB,OAC1B,WAAWtC,OAAwBmB,IAAAA,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,15 +1,15 @@
|
|
|
1
1
|
import { jsx as e } from "@emotion/react/jsx-runtime";
|
|
2
|
-
import { createPortal as
|
|
3
|
-
import { ClickAwayListener as
|
|
4
|
-
import
|
|
5
|
-
const
|
|
6
|
-
const a = t.displayName ?? t.name, l =
|
|
2
|
+
import { createPortal as m } from "react-dom";
|
|
3
|
+
import { ClickAwayListener as s } from "@mui/material";
|
|
4
|
+
import c from "../../lib/utils/documentUtil.js";
|
|
5
|
+
const u = (t) => {
|
|
6
|
+
const a = t.displayName ?? t.name, l = c(), i = ({
|
|
7
7
|
onClickAway: r,
|
|
8
8
|
...n
|
|
9
|
-
}) => r ?
|
|
9
|
+
}) => r ? m(/* @__PURE__ */ e(s, { onClickAway: r, children: /* @__PURE__ */ e("div", { children: /* @__PURE__ */ e(t, { ...n }) }) }), l) : /* @__PURE__ */ e(t, { ...n });
|
|
10
10
|
return i.displayName = `withClickAwayListener(${a})`, i;
|
|
11
|
-
}
|
|
11
|
+
};
|
|
12
12
|
export {
|
|
13
|
-
|
|
13
|
+
u as default
|
|
14
14
|
};
|
|
15
15
|
//# sourceMappingURL=withClickAwayListener.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withClickAwayListener.js","sources":["../../../../src/components/hoc/withClickAwayListener.tsx"],"sourcesContent":["import { createPortal } from \"react-dom\";\nimport { ClickAwayListener } from \"@mui/material\";\nimport createAppContainerElement from \"../../lib/utils/documentUtil\";\n\ninterface WithClickAwayListenerProps {\n onClickAway?: () => void;\n}\n\ntype WrappedComponentProps<T extends React.ElementType> = React.ComponentType<\n WithClickAwayListenerProps & React.ComponentProps<T>\n>;\n\nconst withClickAwayListener = <T extends React.ElementType>(\n WrappedComponent: WrappedComponentProps<T>\n) => {\n const displayName = WrappedComponent.displayName ?? WrappedComponent.name;\n\n const panelContainerElement = createAppContainerElement();\n\n const ComponentWithClickAwayListener = ({\n onClickAway,\n ...wrappedProps\n }: WithClickAwayListenerProps & React.ComponentProps<T>) => {\n if (onClickAway) {\n return createPortal(\n <ClickAwayListener onClickAway={onClickAway}>\n <div>\n <WrappedComponent {...(wrappedProps as React.ComponentProps<T>)} />\n </div>\n </ClickAwayListener>,\n panelContainerElement\n );\n }\n\n return <WrappedComponent {...(wrappedProps as React.ComponentProps<T>)} />;\n };\n\n ComponentWithClickAwayListener.displayName = `withClickAwayListener(${displayName})`;\n\n return ComponentWithClickAwayListener;\n};\n\nexport default withClickAwayListener;\n"],"names":["withClickAwayListener","WrappedComponent","displayName","name","panelContainerElement","createAppContainerElement","ComponentWithClickAwayListener","onClickAway","wrappedProps","createPortal","jsx","ClickAwayListener"
|
|
1
|
+
{"version":3,"file":"withClickAwayListener.js","sources":["../../../../src/components/hoc/withClickAwayListener.tsx"],"sourcesContent":["import { createPortal } from \"react-dom\";\nimport { ClickAwayListener } from \"@mui/material\";\nimport createAppContainerElement from \"../../lib/utils/documentUtil\";\n\ninterface WithClickAwayListenerProps {\n onClickAway?: () => void;\n}\n\ntype WrappedComponentProps<T extends React.ElementType> = React.ComponentType<\n WithClickAwayListenerProps & React.ComponentProps<T>\n>;\n\nconst withClickAwayListener = <T extends React.ElementType>(\n WrappedComponent: WrappedComponentProps<T>\n) => {\n const displayName = WrappedComponent.displayName ?? WrappedComponent.name;\n\n const panelContainerElement = createAppContainerElement();\n\n const ComponentWithClickAwayListener = ({\n onClickAway,\n ...wrappedProps\n }: WithClickAwayListenerProps & React.ComponentProps<T>) => {\n if (onClickAway) {\n return createPortal(\n <ClickAwayListener onClickAway={onClickAway}>\n <div>\n <WrappedComponent {...(wrappedProps as React.ComponentProps<T>)} />\n </div>\n </ClickAwayListener>,\n panelContainerElement\n );\n }\n\n return <WrappedComponent {...(wrappedProps as React.ComponentProps<T>)} />;\n };\n\n ComponentWithClickAwayListener.displayName = `withClickAwayListener(${displayName})`;\n\n return ComponentWithClickAwayListener;\n};\n\nexport default withClickAwayListener;\n"],"names":["withClickAwayListener","WrappedComponent","displayName","name","panelContainerElement","createAppContainerElement","ComponentWithClickAwayListener","onClickAway","wrappedProps","createPortal","jsx","ClickAwayListener"],"mappings":";;;;AAYMA,MAAAA,IAAwB,CAC5BC,MACG;AACGC,QAAAA,IAAcD,EAAiBC,eAAeD,EAAiBE,MAE/DC,IAAwBC,KAExBC,IAAiCA,CAAC;AAAA,IACtCC,aAAAA;AAAAA,IACA,GAAGC;AAAAA,EAAAA,MAECD,IACKE,EACL,gBAAAC,EAACC,GAAkB,EAAA,aAAAJ,GACjB,UAAC,gBAAAG,EAAA,OAAA,EACC,UAAC,gBAAAA,EAAAT,GAAA,EAAiB,GAAKO,EAAAA,CAAyC,EAClE,CAAA,EACF,CAAA,GACAJ,CACF,IAGK,gBAAAM,EAACT,GAAiB,EAAA,GAAKO,EAA4C,CAAA;AAG7CN,SAAAA,EAAAA,cAAe,yBAAwBA,CAAY,KAE3EI;AACT;"}
|
|
@@ -2,33 +2,33 @@ import { jsx as I, jsxs as b } from "@emotion/react/jsx-runtime";
|
|
|
2
2
|
import { css as G } from "@emotion/css";
|
|
3
3
|
import { I18nextProvider as X } from "react-i18next";
|
|
4
4
|
import { HelmetProvider as d } from "react-helmet-async";
|
|
5
|
-
import { theme as
|
|
5
|
+
import { theme as Z, HvProvider as a, HvSnackbarProvider as t } from "@hitachivantara/uikit-react-core";
|
|
6
6
|
import { ErrorBoundary as m } from "react-error-boundary";
|
|
7
7
|
import v from "../GlobalStyles/GlobalStyles.js";
|
|
8
8
|
import r from "../AppShellProvider/AppShellProvider.js";
|
|
9
9
|
import h from "../../providers/NavigationProvider.js";
|
|
10
|
-
import
|
|
11
|
-
import
|
|
10
|
+
import V from "../../lib/i18n/index.js";
|
|
11
|
+
import o from "../../providers/BannerProvider.js";
|
|
12
12
|
import W from "../../providers/LayoutProvider.js";
|
|
13
13
|
import A from "../../pages/GenericError/GenericError.js";
|
|
14
|
-
import
|
|
15
|
-
const
|
|
16
|
-
containerRoot: /* @__PURE__ */ G("margin-top:",
|
|
17
|
-
},
|
|
14
|
+
import u from "../CustomHooksInitializer/CustomHooksInitializer.js";
|
|
15
|
+
const e = {
|
|
16
|
+
containerRoot: /* @__PURE__ */ G("margin-top:", Z.header.height, ";" + (process.env.NODE_ENV === "production" ? "" : ";label:containerRoot;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9fX3cvaHYtYXBwLXNoZWxsL2h2LWFwcC1zaGVsbC9jbGllbnQvcGFja2FnZXMvYXBwLXNoZWxsLXVpL3NyYy9jb21wb25lbnRzL2hvYy93aXRoR2xvYmFsUHJvdmlkZXIudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQTJCb0IiLCJmaWxlIjoiL19fdy9odi1hcHAtc2hlbGwvaHYtYXBwLXNoZWxsL2NsaWVudC9wYWNrYWdlcy9hcHAtc2hlbGwtdWkvc3JjL2NvbXBvbmVudHMvaG9jL3dpdGhHbG9iYWxQcm92aWRlci50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBjc3MgfSBmcm9tIFwiQGVtb3Rpb24vY3NzXCI7XG5pbXBvcnQgeyBJMThuZXh0UHJvdmlkZXIgfSBmcm9tIFwicmVhY3QtaTE4bmV4dFwiO1xuaW1wb3J0IHsgSGVsbWV0UHJvdmlkZXIgfSBmcm9tIFwicmVhY3QtaGVsbWV0LWFzeW5jXCI7XG5cbmltcG9ydCB7XG4gIEh2UHJvdmlkZXIsXG4gIEh2U25hY2tiYXJQcm92aWRlcixcbiAgdGhlbWVcbn0gZnJvbSBcIkBoaXRhY2hpdmFudGFyYS91aWtpdC1yZWFjdC1jb3JlXCI7XG5cbmltcG9ydCBSZWFjdCBmcm9tIFwicmVhY3RcIjtcbmltcG9ydCB7IEVycm9yQm91bmRhcnkgfSBmcm9tIFwicmVhY3QtZXJyb3ItYm91bmRhcnlcIjtcblxuaW1wb3J0IEdsb2JhbFN0eWxlcyBmcm9tIFwiLi4vR2xvYmFsU3R5bGVzXCI7XG5pbXBvcnQgQXBwU2hlbGxQcm92aWRlciBmcm9tIFwiLi4vQXBwU2hlbGxQcm92aWRlci9BcHBTaGVsbFByb3ZpZGVyXCI7XG5pbXBvcnQgTmF2aWdhdGlvblByb3ZpZGVyIGZyb20gXCIuLi8uLi9wcm92aWRlcnMvTmF2aWdhdGlvblByb3ZpZGVyXCI7XG5pbXBvcnQgY3JlYXRlSTE4TmV4dCBmcm9tIFwiLi4vLi4vbGliL2kxOG5cIjtcbmltcG9ydCBCYW5uZXJQcm92aWRlciBmcm9tIFwiLi4vLi4vcHJvdmlkZXJzL0Jhbm5lclByb3ZpZGVyXCI7XG5pbXBvcnQgTGF5b3V0UHJvdmlkZXIgZnJvbSBcIi4uLy4uL3Byb3ZpZGVycy9MYXlvdXRQcm92aWRlclwiO1xuaW1wb3J0IEdlbmVyaWNFcnJvciBmcm9tIFwiLi4vLi4vcGFnZXMvR2VuZXJpY0Vycm9yXCI7XG5pbXBvcnQgQ3VzdG9tSG9va3NJbml0aWFsaXplciBmcm9tIFwiLi4vQ3VzdG9tSG9va3NJbml0aWFsaXplclwiO1xuXG50eXBlIFdyYXBwZWRDb21wb25lbnRQcm9wczxUIGV4dGVuZHMgUmVhY3QuRWxlbWVudFR5cGU+ID0gUmVhY3QuQ29tcG9uZW50VHlwZTxcbiAgUmVhY3QuQ29tcG9uZW50UHJvcHM8VD5cbj47XG5cbmNvbnN0IHNuYWNrYmFyQ2xhc3NlcyA9IHtcbiAgY29udGFpbmVyUm9vdDogY3NzYFxuICAgIG1hcmdpbi10b3A6ICR7dGhlbWUuaGVhZGVyLmhlaWdodH07XG4gIGBcbn07XG5cbmNvbnN0IHdpdGhHbG9iYWxQcm92aWRlciA9IDxUIGV4dGVuZHMgUmVhY3QuRWxlbWVudFR5cGU+KFxuICBXcmFwcGVkQ29tcG9uZW50OiBXcmFwcGVkQ29tcG9uZW50UHJvcHM8VD5cbikgPT4ge1xuICBjb25zdCBkaXNwbGF5TmFtZSA9IFdyYXBwZWRDb21wb25lbnQuZGlzcGxheU5hbWUgPz8gV3JhcHBlZENvbXBvbmVudC5uYW1lO1xuXG4gIGNvbnN0IHsgaTE4biB9ID0gY3JlYXRlSTE4TmV4dCgpO1xuXG4gIGNvbnN0IENvbXBvbmVudFdpdGhHbG9iYWxQcm92aWRlciA9ICh7XG4gICAgLi4ud3JhcHBlZFByb3BzXG4gIH06IFJlYWN0LkNvbXBvbmVudFByb3BzPFQ+KSA9PiB7XG4gICAgcmV0dXJuIChcbiAgICAgIDxIZWxtZXRQcm92aWRlcj5cbiAgICAgICAgPEh2UHJvdmlkZXI+XG4gICAgICAgICAgPEdsb2JhbFN0eWxlcyAvPlxuICAgICAgICAgIDxJMThuZXh0UHJvdmlkZXIgaTE4bj17aTE4bn0+XG4gICAgICAgICAgICA8RXJyb3JCb3VuZGFyeVxuICAgICAgICAgICAgICBrZXk9XCJnZW5lcmFsXCJcbiAgICAgICAgICAgICAgZmFsbGJhY2s9ezxHZW5lcmljRXJyb3IgZnVsbFBhZ2UgaW5jbHVkZUZvb3Rlcj17ZmFsc2V9IC8+fT5cbiAgICAgICAgICAgICAgPEFwcFNoZWxsUHJvdmlkZXJcbiAgICAgICAgICAgICAgICBjb25maWc9e3dyYXBwZWRQcm9wcy5jb25maWd9XG4gICAgICAgICAgICAgICAgY29uZmlnVXJsPXt3cmFwcGVkUHJvcHMuY29uZmlnVXJsfT5cbiAgICAgICAgICAgICAgICA8TGF5b3V0UHJvdmlkZXI+XG4gICAgICAgICAgICAgICAgICA8SHZTbmFja2JhclByb3ZpZGVyXG4gICAgICAgICAgICAgICAgICAgIG5vdGlzdGFja0NsYXNzZXNPdmVycmlkZT17c25hY2tiYXJDbGFzc2VzfT5cbiAgICAgICAgICAgICAgICAgICAgPEVycm9yQm91bmRhcnkgZmFsbGJhY2s9ezxHZW5lcmljRXJyb3IgZnVsbFBhZ2UgLz59PlxuICAgICAgICAgICAgICAgICAgICAgIDxOYXZpZ2F0aW9uUHJvdmlkZXI+XG4gICAgICAgICAgICAgICAgICAgICAgICA8QmFubmVyUHJvdmlkZXI+XG4gICAgICAgICAgICAgICAgICAgICAgICAgIDxDdXN0b21Ib29rc0luaXRpYWxpemVyIC8+XG4gICAgICAgICAgICAgICAgICAgICAgICAgIDxXcmFwcGVkQ29tcG9uZW50IHsuLi53cmFwcGVkUHJvcHN9IC8+XG4gICAgICAgICAgICAgICAgICAgICAgICA8L0Jhbm5lclByb3ZpZGVyPlxuICAgICAgICAgICAgICAgICAgICAgIDwvTmF2aWdhdGlvblByb3ZpZGVyPlxuICAgICAgICAgICAgICAgICAgICA8L0Vycm9yQm91bmRhcnk+XG4gICAgICAgICAgICAgICAgICA8L0h2U25hY2tiYXJQcm92aWRlcj5cbiAgICAgICAgICAgICAgICA8L0xheW91dFByb3ZpZGVyPlxuICAgICAgICAgICAgICA8L0FwcFNoZWxsUHJvdmlkZXI+XG4gICAgICAgICAgICA8L0Vycm9yQm91bmRhcnk+XG4gICAgICAgICAgPC9JMThuZXh0UHJvdmlkZXI+XG4gICAgICAgIDwvSHZQcm92aWRlcj5cbiAgICAgIDwvSGVsbWV0UHJvdmlkZXI+XG4gICAgKTtcbiAgfTtcblxuICBDb21wb25lbnRXaXRoR2xvYmFsUHJvdmlkZXIuZGlzcGxheU5hbWUgPSBgd2l0aEdsb2JhbFByb3ZpZGVyKCR7ZGlzcGxheU5hbWV9KWA7XG5cbiAgcmV0dXJuIENvbXBvbmVudFdpdGhHbG9iYWxQcm92aWRlcjtcbn07XG5cbmV4cG9ydCBkZWZhdWx0IHdpdGhHbG9iYWxQcm92aWRlcjtcbiJdfQ== */")
|
|
17
|
+
}, U = (g) => {
|
|
18
18
|
const l = g.displayName ?? g.name, {
|
|
19
19
|
i18n: i
|
|
20
|
-
} =
|
|
20
|
+
} = V(), C = ({
|
|
21
21
|
...c
|
|
22
22
|
}) => /* @__PURE__ */ I(d, { children: /* @__PURE__ */ b(a, { children: [
|
|
23
23
|
/* @__PURE__ */ I(v, {}),
|
|
24
|
-
/* @__PURE__ */ I(X, { i18n: i, children: /* @__PURE__ */ I(m, { fallback: /* @__PURE__ */ I(A, { fullPage: !0, includeFooter: !1 }), children: /* @__PURE__ */ I(r, { config: c.config, configUrl: c.configUrl, children: /* @__PURE__ */ I(W, { children: /* @__PURE__ */ I(
|
|
25
|
-
/* @__PURE__ */ I(
|
|
24
|
+
/* @__PURE__ */ I(X, { i18n: i, children: /* @__PURE__ */ I(m, { fallback: /* @__PURE__ */ I(A, { fullPage: !0, includeFooter: !1 }), children: /* @__PURE__ */ I(r, { config: c.config, configUrl: c.configUrl, children: /* @__PURE__ */ I(W, { children: /* @__PURE__ */ I(t, { notistackClassesOverride: e, children: /* @__PURE__ */ I(m, { fallback: /* @__PURE__ */ I(A, { fullPage: !0 }), children: /* @__PURE__ */ I(h, { children: /* @__PURE__ */ b(o, { children: [
|
|
25
|
+
/* @__PURE__ */ I(u, {}),
|
|
26
26
|
/* @__PURE__ */ I(g, { ...c })
|
|
27
27
|
] }) }) }) }) }) }) }, "general") })
|
|
28
28
|
] }) });
|
|
29
29
|
return C.displayName = `withGlobalProvider(${l})`, C;
|
|
30
|
-
}
|
|
30
|
+
};
|
|
31
31
|
export {
|
|
32
|
-
|
|
32
|
+
U as default
|
|
33
33
|
};
|
|
34
34
|
//# sourceMappingURL=withGlobalProvider.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withGlobalProvider.js","sources":["../../../../src/components/hoc/withGlobalProvider.tsx"],"sourcesContent":["import { css } from \"@emotion/css\";\nimport { I18nextProvider } from \"react-i18next\";\nimport { HelmetProvider } from \"react-helmet-async\";\n\nimport {\n HvProvider,\n HvSnackbarProvider,\n theme\n} from \"@hitachivantara/uikit-react-core\";\n\nimport React from \"react\";\nimport { ErrorBoundary } from \"react-error-boundary\";\n\nimport GlobalStyles from \"../GlobalStyles\";\nimport AppShellProvider from \"../AppShellProvider/AppShellProvider\";\nimport NavigationProvider from \"../../providers/NavigationProvider\";\nimport createI18Next from \"../../lib/i18n\";\nimport BannerProvider from \"../../providers/BannerProvider\";\nimport LayoutProvider from \"../../providers/LayoutProvider\";\nimport GenericError from \"../../pages/GenericError\";\nimport CustomHooksInitializer from \"../CustomHooksInitializer\";\n\ntype WrappedComponentProps<T extends React.ElementType> = React.ComponentType<\n React.ComponentProps<T>\n>;\n\nconst snackbarClasses = {\n containerRoot: css`\n margin-top: ${theme.header.height};\n `\n};\n\nconst withGlobalProvider = <T extends React.ElementType>(\n WrappedComponent: WrappedComponentProps<T>\n) => {\n const displayName = WrappedComponent.displayName ?? WrappedComponent.name;\n\n const { i18n } = createI18Next();\n\n const ComponentWithGlobalProvider = ({\n ...wrappedProps\n }: React.ComponentProps<T>) => {\n return (\n <HelmetProvider>\n <HvProvider>\n <GlobalStyles />\n <I18nextProvider i18n={i18n}>\n <ErrorBoundary\n key=\"general\"\n fallback={<GenericError fullPage includeFooter={false} />}>\n <AppShellProvider\n config={wrappedProps.config}\n configUrl={wrappedProps.configUrl}>\n <LayoutProvider>\n <HvSnackbarProvider\n notistackClassesOverride={snackbarClasses}>\n <ErrorBoundary fallback={<GenericError fullPage />}>\n <NavigationProvider>\n <BannerProvider>\n <CustomHooksInitializer />\n <WrappedComponent {...wrappedProps} />\n </BannerProvider>\n </NavigationProvider>\n </ErrorBoundary>\n </HvSnackbarProvider>\n </LayoutProvider>\n </AppShellProvider>\n </ErrorBoundary>\n </I18nextProvider>\n </HvProvider>\n </HelmetProvider>\n );\n };\n\n ComponentWithGlobalProvider.displayName = `withGlobalProvider(${displayName})`;\n\n return ComponentWithGlobalProvider;\n};\n\nexport default withGlobalProvider;\n"],"names":["snackbarClasses","containerRoot","css","theme","header","height","process","env","NODE_ENV","withGlobalProvider","WrappedComponent","displayName","name","i18n","createI18Next","ComponentWithGlobalProvider","wrappedProps","jsx","HelmetProvider","jsxs","HvProvider","GlobalStyles","I18nextProvider","ErrorBoundary","GenericError","AppShellProvider","config","configUrl","LayoutProvider","HvSnackbarProvider","NavigationProvider","BannerProvider","CustomHooksInitializer"
|
|
1
|
+
{"version":3,"file":"withGlobalProvider.js","sources":["../../../../src/components/hoc/withGlobalProvider.tsx"],"sourcesContent":["import { css } from \"@emotion/css\";\nimport { I18nextProvider } from \"react-i18next\";\nimport { HelmetProvider } from \"react-helmet-async\";\n\nimport {\n HvProvider,\n HvSnackbarProvider,\n theme\n} from \"@hitachivantara/uikit-react-core\";\n\nimport React from \"react\";\nimport { ErrorBoundary } from \"react-error-boundary\";\n\nimport GlobalStyles from \"../GlobalStyles\";\nimport AppShellProvider from \"../AppShellProvider/AppShellProvider\";\nimport NavigationProvider from \"../../providers/NavigationProvider\";\nimport createI18Next from \"../../lib/i18n\";\nimport BannerProvider from \"../../providers/BannerProvider\";\nimport LayoutProvider from \"../../providers/LayoutProvider\";\nimport GenericError from \"../../pages/GenericError\";\nimport CustomHooksInitializer from \"../CustomHooksInitializer\";\n\ntype WrappedComponentProps<T extends React.ElementType> = React.ComponentType<\n React.ComponentProps<T>\n>;\n\nconst snackbarClasses = {\n containerRoot: css`\n margin-top: ${theme.header.height};\n `\n};\n\nconst withGlobalProvider = <T extends React.ElementType>(\n WrappedComponent: WrappedComponentProps<T>\n) => {\n const displayName = WrappedComponent.displayName ?? WrappedComponent.name;\n\n const { i18n } = createI18Next();\n\n const ComponentWithGlobalProvider = ({\n ...wrappedProps\n }: React.ComponentProps<T>) => {\n return (\n <HelmetProvider>\n <HvProvider>\n <GlobalStyles />\n <I18nextProvider i18n={i18n}>\n <ErrorBoundary\n key=\"general\"\n fallback={<GenericError fullPage includeFooter={false} />}>\n <AppShellProvider\n config={wrappedProps.config}\n configUrl={wrappedProps.configUrl}>\n <LayoutProvider>\n <HvSnackbarProvider\n notistackClassesOverride={snackbarClasses}>\n <ErrorBoundary fallback={<GenericError fullPage />}>\n <NavigationProvider>\n <BannerProvider>\n <CustomHooksInitializer />\n <WrappedComponent {...wrappedProps} />\n </BannerProvider>\n </NavigationProvider>\n </ErrorBoundary>\n </HvSnackbarProvider>\n </LayoutProvider>\n </AppShellProvider>\n </ErrorBoundary>\n </I18nextProvider>\n </HvProvider>\n </HelmetProvider>\n );\n };\n\n ComponentWithGlobalProvider.displayName = `withGlobalProvider(${displayName})`;\n\n return ComponentWithGlobalProvider;\n};\n\nexport default withGlobalProvider;\n"],"names":["snackbarClasses","containerRoot","css","theme","header","height","process","env","NODE_ENV","withGlobalProvider","WrappedComponent","displayName","name","i18n","createI18Next","ComponentWithGlobalProvider","wrappedProps","jsx","HelmetProvider","jsxs","HvProvider","GlobalStyles","I18nextProvider","ErrorBoundary","GenericError","AppShellProvider","config","configUrl","LayoutProvider","HvSnackbarProvider","NavigationProvider","BannerProvider","CustomHooksInitializer"],"mappings":";;;;;;;;;;;;;;AA0BA,MAAMA,IAAkB;AAAA,EACtBC,eAAkB,gBAAAC,EAAA,eACFC,EAAMC,OAAOC,QAAM,OAAAC,QAAAC,IAAAC,aAAA,eAAA,KAAA,0BAAAF,QAAAC,IAAAC,aAAA,eAAA,KAAA,y/HAAA;AAErC,GAEMC,IAAqB,CACzBC,MACG;AACGC,QAAAA,IAAcD,EAAiBC,eAAeD,EAAiBE,MAE/D;AAAA,IAAEC,MAAAA;AAAAA,MAASC,EAAc,GAEzBC,IAA8BA,CAAC;AAAA,IACnC,GAAGC;AAAAA,EAAAA,MAGD,gBAAAC,EAACC,GACC,EAAA,UAAA,gBAAAC,EAACC,GACC,EAAA,UAAA;AAAA,IAAA,gBAAAH,EAACI,GAAY,EAAA;AAAA,sBACZC,GAAgB,EAAA,MAAAT,GACf,UAAC,gBAAAI,EAAAM,GAAA,EAEC,UAAW,gBAAAN,EAAAO,GAAA,EAAa,UAAQ,IAAC,eAAe,GAAM,CAAA,GACtD,4BAACC,GACC,EAAA,QAAQT,EAAaU,QACrB,WAAWV,EAAaW,WACxB,4BAACC,GACC,EAAA,UAAA,gBAAAX,EAACY,GACC,EAAA,0BAA0B7B,GAC1B,UAAC,gBAAAiB,EAAAM,GAAA,EAAc,UAAU,gBAAAN,EAACO,KAAa,UAAQ,GAAA,CAAA,GAC7C,UAAC,gBAAAP,EAAAa,GAAA,EACC,4BAACC,GACC,EAAA,UAAA;AAAA,MAAA,gBAAAd,EAACe,GAAsB,EAAA;AAAA,MACvB,gBAAAf,EAACP,GAAiB,EAAA,GAAIM,GAAa;AAAA,IAAA,GACrC,GACF,EACF,CAAA,EACF,CAAA,EACF,CAAA,GACF,EAAA,GAlBI,SAmBN,GACF;AAAA,EAAA,EACF,CAAA,EACF,CAAA;AAIwBL,SAAAA,EAAAA,cAAe,sBAAqBA,CAAY,KAErEI;AACT;"}
|
|
@@ -1,56 +1,57 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
1
|
+
import { jsx as r, jsxs as N } from "@emotion/react/jsx-runtime";
|
|
2
2
|
import { useRef as b, useEffect as h } from "react";
|
|
3
3
|
import { useTranslation as C } from "react-i18next";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import A from "
|
|
10
|
-
|
|
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
|
+
import w from "../../../providers/hooks/useNavigationContext.js";
|
|
8
|
+
import { classes as l } from "./styles.js";
|
|
9
|
+
import A from "../../hoc/withClickAwayListener.js";
|
|
10
|
+
import E from "../../../providers/hooks/useLayoutContext.js";
|
|
11
|
+
const M = () => {
|
|
11
12
|
const {
|
|
12
13
|
t: a
|
|
13
14
|
} = C(), {
|
|
14
|
-
selectedMenuItemId:
|
|
15
|
-
rootMenuItemId:
|
|
16
|
-
verticalNavigationItems:
|
|
17
|
-
isCompactMode:
|
|
18
|
-
verticalNavigationMode:
|
|
19
|
-
switchVerticalNavigationMode:
|
|
20
|
-
} =
|
|
15
|
+
selectedMenuItemId: d,
|
|
16
|
+
rootMenuItemId: g,
|
|
17
|
+
verticalNavigationItems: p,
|
|
18
|
+
isCompactMode: i,
|
|
19
|
+
verticalNavigationMode: s,
|
|
20
|
+
switchVerticalNavigationMode: c
|
|
21
|
+
} = w(), {
|
|
21
22
|
setVerticalNavigationWidth: o
|
|
22
|
-
} =
|
|
23
|
-
navigate:
|
|
24
|
-
} =
|
|
25
|
-
e.preventDefault(),
|
|
23
|
+
} = E(), {
|
|
24
|
+
navigate: m
|
|
25
|
+
} = I(), v = b(null), n = s === "EXPANDED", f = (e, t) => {
|
|
26
|
+
e.preventDefault(), t.href && (m(t.href, {
|
|
26
27
|
state: {
|
|
27
|
-
selectedItemId:
|
|
28
|
+
selectedItemId: t.id
|
|
28
29
|
}
|
|
29
|
-
}),
|
|
30
|
-
}, f = () => {
|
|
31
|
-
s();
|
|
30
|
+
}), i && c());
|
|
32
31
|
};
|
|
33
32
|
h(() => {
|
|
34
33
|
const {
|
|
35
34
|
current: e
|
|
36
|
-
} =
|
|
37
|
-
return o(
|
|
38
|
-
}, [
|
|
39
|
-
const
|
|
40
|
-
return /* @__PURE__ */ r("div", { ref:
|
|
41
|
-
|
|
42
|
-
|
|
35
|
+
} = v, t = e == null ? void 0 : e.childNodes[0];
|
|
36
|
+
return o(t && !i ? t.offsetWidth : 0), () => o(0);
|
|
37
|
+
}, [s, i, o]);
|
|
38
|
+
const u = a(n ? "verticalNavigation.ariaLabelCollapse" : "verticalNavigation.ariaLabelExpand");
|
|
39
|
+
return /* @__PURE__ */ r("div", { ref: v, children: /* @__PURE__ */ N(L, { className: x(l.navigation, {
|
|
40
|
+
[l.navigationCompact]: i
|
|
41
|
+
}), open: n, useIcons: !0, slider: i, children: [
|
|
42
|
+
/* @__PURE__ */ r(V, { title: a("verticalNavigation.title") ?? "", onCollapseButtonClick: i ? void 0 : c, collapseButtonProps: {
|
|
43
|
+
"aria-label": u,
|
|
43
44
|
"aria-expanded": n
|
|
44
45
|
}, backButtonProps: {
|
|
45
46
|
"aria-label": a("verticalNavigation.ariaLabelHeaderBackButton") ?? ""
|
|
46
47
|
} }),
|
|
47
|
-
/* @__PURE__ */ r(
|
|
48
|
-
navigationPopup:
|
|
49
|
-
}, sliderForwardButtonAriaLabel: a("verticalNavigation.ariaLabelSliderForwardButton") ?? "" },
|
|
50
|
-
/* @__PURE__ */ r(
|
|
48
|
+
/* @__PURE__ */ r(B, { mode: "navigation", collapsible: !0, "aria-label": a("verticalNavigation.ariaLabelNavigationTree") ?? "", selected: d ?? "", onChange: f, data: p, classes: {
|
|
49
|
+
navigationPopup: l.navigationPopup
|
|
50
|
+
}, sliderForwardButtonAriaLabel: a("verticalNavigation.ariaLabelSliderForwardButton") ?? "" }, g),
|
|
51
|
+
/* @__PURE__ */ r(H, {})
|
|
51
52
|
] }) });
|
|
52
|
-
},
|
|
53
|
+
}, X = A(M);
|
|
53
54
|
export {
|
|
54
|
-
|
|
55
|
+
X as default
|
|
55
56
|
};
|
|
56
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\";\
|
|
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,IAA+BT,MAA2B,YAE1DU,IAAgBA,CACpBC,GACAC,MACG;AAGHD,IAAAA,EAAME,eAAe,GAEjBD,EAAaE,SACfT,EAASO,EAAaE,MAAM;AAAA,MAC1BC,OAAO;AAAA,QAAEC,gBAAgBJ,EAAaK;AAAAA,MAAG;AAAA,IAAA,CAC1C,GAEGlB,KAC2BE;EAEjC;AAGFiB,EAAAA,EAAU,MAAM;AACR,UAAA;AAAA,MAAEC,SAAAA;AAAAA,IAAYZ,IAAAA,GACda,IAAaD,KAAAA,gBAAAA,EAASE,WAAW;AACnCD,WACFjB,EADEiB,KAAc,CAACrB,IACUqB,EAAWE,cAEX,CAFsB,GAK5C,MAAMnB,EAA2B,CAAC;AAAA,EACxC,GAAA,CAACH,GAAwBD,GAAeI,CAA0B,CAAC;AAEtE,QAAMoB,IACF7B,EAD4Be,IAC1B,yCACA,oCADsC;AAI1C,SAAA,gBAAAe,EAAC,SAAI,KAAKjB,GACR,4BAACkB,GACC,EAAA,WAAWC,EAAGC,EAAQC,YAAY;AAAA,IAChC,CAACD,EAAQE,iBAAiB,GAAG9B;AAAAA,EAAAA,CAC9B,GACD,MAAMU,GACN,UAAQ,IACR,QAAQV,GACR,UAAA;AAAA,IAAC,gBAAAyB,EAAAM,GAAA,EACC,OAAOpC,EAAE,0BAA0B,KAAK,IACxC,uBACGK,IAA+CgC,SAA/B9B,GAEnB,qBAAqB;AAAA,MACnB,cAAcsB;AAAAA,MACd,iBAAiBd;AAAAA,OAEnB,iBAAiB;AAAA,MACf,cACEf,EAAE,8CAA8C,KAAK;AAAA,IAAA,GACvD;AAAA,sBAGHsC,GAEC,EAAA,MAAK,cACL,aAAW,IACX,cAAYtC,EAAE,4CAA4C,KAAK,IAC/D,UAAUE,KAAsB,IAChC,UAAUc,GACV,MAAMZ,GACN,SAAS;AAAA,MAAEmC,iBAAiBN,EAAQM;AAAAA,IAAAA,GACpC,8BACEvC,EAAE,iDAAiD,KAAK,MATrDG,CAUJ;AAAA,sBAGFqC,GAA2B,EAAA;AAAA,EAAA,EAC9B,CAAA,EACF,CAAA;AAEJ,GAEeC,IAAAA,EAAsB1C,CAAkB;"}
|
|
@@ -1,21 +1,34 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
1
|
+
import { css as c } from "@emotion/css";
|
|
2
|
+
import { theme as b, verticalNavigationTreeClasses as a } from "@hitachivantara/uikit-react-core";
|
|
3
|
+
function l() {
|
|
4
|
+
return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop).";
|
|
5
|
+
}
|
|
6
|
+
const G = {
|
|
7
|
+
navigation: /* @__PURE__ */ c({
|
|
8
|
+
height: `calc(100vh - ${b.header.height})`,
|
|
9
|
+
top: b.header.height,
|
|
10
|
+
zIndex: b.zIndices.overlay,
|
|
11
|
+
position: "sticky"
|
|
12
|
+
}, process.env.NODE_ENV === "production" ? "" : ";label:navigation;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9fX3cvaHYtYXBwLXNoZWxsL2h2LWFwcC1zaGVsbC9jbGllbnQvcGFja2FnZXMvYXBwLXNoZWxsLXVpL3NyYy9jb21wb25lbnRzL2xheW91dC9WZXJ0aWNhbE5hdmlnYXRpb24vc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQU9jIiwiZmlsZSI6Ii9fX3cvaHYtYXBwLXNoZWxsL2h2LWFwcC1zaGVsbC9jbGllbnQvcGFja2FnZXMvYXBwLXNoZWxsLXVpL3NyYy9jb21wb25lbnRzL2xheW91dC9WZXJ0aWNhbE5hdmlnYXRpb24vc3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgY3NzIH0gZnJvbSBcIkBlbW90aW9uL2Nzc1wiO1xuaW1wb3J0IHtcbiAgdGhlbWUsXG4gIHZlcnRpY2FsTmF2aWdhdGlvblRyZWVDbGFzc2VzXG59IGZyb20gXCJAaGl0YWNoaXZhbnRhcmEvdWlraXQtcmVhY3QtY29yZVwiO1xuXG5leHBvcnQgY29uc3QgY2xhc3NlcyA9IHtcbiAgbmF2aWdhdGlvbjogY3NzKHtcbiAgICBoZWlnaHQ6IGBjYWxjKDEwMHZoIC0gJHt0aGVtZS5oZWFkZXIuaGVpZ2h0fSlgLFxuICAgIHRvcDogdGhlbWUuaGVhZGVyLmhlaWdodCxcbiAgICB6SW5kZXg6IHRoZW1lLnpJbmRpY2VzLm92ZXJsYXksXG4gICAgcG9zaXRpb246IFwic3RpY2t5XCJcbiAgfSksXG4gIG5hdmlnYXRpb25Db21wYWN0OiBjc3Moe1xuICAgIHBvc2l0aW9uOiBcImZpeGVkXCJcbiAgfSksXG4gIG5hdmlnYXRpb25Qb3B1cDogY3NzKHtcbiAgICBtYXhIZWlnaHQ6IGBjYWxjKDEwMHZoIC0gJHt0aGVtZS5oZWFkZXIuaGVpZ2h0fSlgLFxuICAgIG92ZXJmbG93WTogXCJhdXRvXCIsXG4gICAgYm94U2hhZG93OiB0aGVtZS5jb2xvcnMuc2hhZG93LFxuICAgIFtgJiAuJHt2ZXJ0aWNhbE5hdmlnYXRpb25UcmVlQ2xhc3Nlcy5wb3B1cH1gXTogeyBib3hTaGFkb3c6IFwibm9uZVwiIH1cbiAgfSlcbn07XG4iXX0= */"),
|
|
13
|
+
navigationCompact: /* @__PURE__ */ c(process.env.NODE_ENV === "production" ? {
|
|
14
|
+
name: "duudsh",
|
|
15
|
+
styles: "position:fixed"
|
|
16
|
+
} : {
|
|
17
|
+
name: "vmndjy-navigationCompact",
|
|
18
|
+
styles: "position:fixed;label:navigationCompact;",
|
|
19
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9fX3cvaHYtYXBwLXNoZWxsL2h2LWFwcC1zaGVsbC9jbGllbnQvcGFja2FnZXMvYXBwLXNoZWxsLXVpL3NyYy9jb21wb25lbnRzL2xheW91dC9WZXJ0aWNhbE5hdmlnYXRpb24vc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWFxQiIsImZpbGUiOiIvX193L2h2LWFwcC1zaGVsbC9odi1hcHAtc2hlbGwvY2xpZW50L3BhY2thZ2VzL2FwcC1zaGVsbC11aS9zcmMvY29tcG9uZW50cy9sYXlvdXQvVmVydGljYWxOYXZpZ2F0aW9uL3N0eWxlcy50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IGNzcyB9IGZyb20gXCJAZW1vdGlvbi9jc3NcIjtcbmltcG9ydCB7XG4gIHRoZW1lLFxuICB2ZXJ0aWNhbE5hdmlnYXRpb25UcmVlQ2xhc3Nlc1xufSBmcm9tIFwiQGhpdGFjaGl2YW50YXJhL3Vpa2l0LXJlYWN0LWNvcmVcIjtcblxuZXhwb3J0IGNvbnN0IGNsYXNzZXMgPSB7XG4gIG5hdmlnYXRpb246IGNzcyh7XG4gICAgaGVpZ2h0OiBgY2FsYygxMDB2aCAtICR7dGhlbWUuaGVhZGVyLmhlaWdodH0pYCxcbiAgICB0b3A6IHRoZW1lLmhlYWRlci5oZWlnaHQsXG4gICAgekluZGV4OiB0aGVtZS56SW5kaWNlcy5vdmVybGF5LFxuICAgIHBvc2l0aW9uOiBcInN0aWNreVwiXG4gIH0pLFxuICBuYXZpZ2F0aW9uQ29tcGFjdDogY3NzKHtcbiAgICBwb3NpdGlvbjogXCJmaXhlZFwiXG4gIH0pLFxuICBuYXZpZ2F0aW9uUG9wdXA6IGNzcyh7XG4gICAgbWF4SGVpZ2h0OiBgY2FsYygxMDB2aCAtICR7dGhlbWUuaGVhZGVyLmhlaWdodH0pYCxcbiAgICBvdmVyZmxvd1k6IFwiYXV0b1wiLFxuICAgIGJveFNoYWRvdzogdGhlbWUuY29sb3JzLnNoYWRvdyxcbiAgICBbYCYgLiR7dmVydGljYWxOYXZpZ2F0aW9uVHJlZUNsYXNzZXMucG9wdXB9YF06IHsgYm94U2hhZG93OiBcIm5vbmVcIiB9XG4gIH0pXG59O1xuIl19 */",
|
|
20
|
+
toString: l
|
|
21
|
+
}),
|
|
22
|
+
navigationPopup: /* @__PURE__ */ c({
|
|
23
|
+
maxHeight: `calc(100vh - ${b.header.height})`,
|
|
24
|
+
overflowY: "auto",
|
|
25
|
+
boxShadow: b.colors.shadow,
|
|
26
|
+
[`& .${a.popup}`]: {
|
|
27
|
+
boxShadow: "none"
|
|
28
|
+
}
|
|
29
|
+
}, process.env.NODE_ENV === "production" ? "" : ";label:navigationPopup;", process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi9fX3cvaHYtYXBwLXNoZWxsL2h2LWFwcC1zaGVsbC9jbGllbnQvcGFja2FnZXMvYXBwLXNoZWxsLXVpL3NyYy9jb21wb25lbnRzL2xheW91dC9WZXJ0aWNhbE5hdmlnYXRpb24vc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQWdCbUIiLCJmaWxlIjoiL19fdy9odi1hcHAtc2hlbGwvaHYtYXBwLXNoZWxsL2NsaWVudC9wYWNrYWdlcy9hcHAtc2hlbGwtdWkvc3JjL2NvbXBvbmVudHMvbGF5b3V0L1ZlcnRpY2FsTmF2aWdhdGlvbi9zdHlsZXMudHMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBjc3MgfSBmcm9tIFwiQGVtb3Rpb24vY3NzXCI7XG5pbXBvcnQge1xuICB0aGVtZSxcbiAgdmVydGljYWxOYXZpZ2F0aW9uVHJlZUNsYXNzZXNcbn0gZnJvbSBcIkBoaXRhY2hpdmFudGFyYS91aWtpdC1yZWFjdC1jb3JlXCI7XG5cbmV4cG9ydCBjb25zdCBjbGFzc2VzID0ge1xuICBuYXZpZ2F0aW9uOiBjc3Moe1xuICAgIGhlaWdodDogYGNhbGMoMTAwdmggLSAke3RoZW1lLmhlYWRlci5oZWlnaHR9KWAsXG4gICAgdG9wOiB0aGVtZS5oZWFkZXIuaGVpZ2h0LFxuICAgIHpJbmRleDogdGhlbWUuekluZGljZXMub3ZlcmxheSxcbiAgICBwb3NpdGlvbjogXCJzdGlja3lcIlxuICB9KSxcbiAgbmF2aWdhdGlvbkNvbXBhY3Q6IGNzcyh7XG4gICAgcG9zaXRpb246IFwiZml4ZWRcIlxuICB9KSxcbiAgbmF2aWdhdGlvblBvcHVwOiBjc3Moe1xuICAgIG1heEhlaWdodDogYGNhbGMoMTAwdmggLSAke3RoZW1lLmhlYWRlci5oZWlnaHR9KWAsXG4gICAgb3ZlcmZsb3dZOiBcImF1dG9cIixcbiAgICBib3hTaGFkb3c6IHRoZW1lLmNvbG9ycy5zaGFkb3csXG4gICAgW2AmIC4ke3ZlcnRpY2FsTmF2aWdhdGlvblRyZWVDbGFzc2VzLnBvcHVwfWBdOiB7IGJveFNoYWRvdzogXCJub25lXCIgfVxuICB9KVxufTtcbiJdfQ== */")
|
|
30
|
+
};
|
|
17
31
|
export {
|
|
18
|
-
|
|
19
|
-
I as navigationPopupStyles
|
|
32
|
+
G as classes
|
|
20
33
|
};
|
|
21
34
|
//# sourceMappingURL=styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../../../../../src/components/layout/VerticalNavigation/styles.ts"],"sourcesContent":["import { css } from \"@emotion/css\";\nimport
|
|
1
|
+
{"version":3,"file":"styles.js","sources":["../../../../../src/components/layout/VerticalNavigation/styles.ts"],"sourcesContent":["import { css } from \"@emotion/css\";\nimport {\n theme,\n verticalNavigationTreeClasses\n} from \"@hitachivantara/uikit-react-core\";\n\nexport const classes = {\n navigation: css({\n height: `calc(100vh - ${theme.header.height})`,\n top: theme.header.height,\n zIndex: theme.zIndices.overlay,\n position: \"sticky\"\n }),\n navigationCompact: css({\n position: \"fixed\"\n }),\n navigationPopup: css({\n maxHeight: `calc(100vh - ${theme.header.height})`,\n overflowY: \"auto\",\n boxShadow: theme.colors.shadow,\n [`& .${verticalNavigationTreeClasses.popup}`]: { boxShadow: \"none\" }\n })\n};\n"],"names":["classes","navigation","css","height","theme","header","top","zIndex","zIndices","overlay","position","process","env","NODE_ENV","navigationCompact","name","styles","map","toString","_EMOTION_STRINGIFIED_CSS_ERROR__","navigationPopup","maxHeight","overflowY","boxShadow","colors","shadow","verticalNavigationTreeClasses","popup"],"mappings":";;;;;AAMO,MAAMA,IAAU;AAAA,EACrBC,YAAgB,gBAAAC,EAAA;AAAA,IACdC,QAAS,gBAAeC,EAAMC,OAAOF,MAAO;AAAA,IAC5CG,KAAKF,EAAMC,OAAOF;AAAAA,IAClBI,QAAQH,EAAMI,SAASC;AAAAA,IACvBC,UAAU;AAAA,EACXC,GAAAA,QAAAC,IAAAC,aAAAF,eAAAA,KAAAA,sBAAAA,QAAAC,IAAAC,aAAC,eAAA,KAAA,6yCAAA;AAAA,EACFC,mBAAmBZ,gBAAAA,EAAGS,QAAAC,IAAAC,aAAA,eAAA;AAAA,IAAAE,MAAA;AAAA,IAAAC,QAAA;AAAA,EAAA,IAAA;AAAA,IAAAD,MAAA;AAAA,IAAAC,QAAA;AAAA,IAAAC,KAAA;AAAA,IAAAC,UAAAC;AAAAA,EAAAA,CAErB;AAAA,EACDC,iBAAqB,gBAAAlB,EAAA;AAAA,IACnBmB,WAAY,gBAAejB,EAAMC,OAAOF,MAAO;AAAA,IAC/CmB,WAAW;AAAA,IACXC,WAAWnB,EAAMoB,OAAOC;AAAAA,IACxB,CAAE,MAAKC,EAA8BC,KAAM,EAAC,GAAG;AAAA,MAAEJ,WAAW;AAAA,IAAO;AAAA,EACpEZ,GAAAA,QAAAC,IAAAC,aAAA,eAAA,KAAA,2BAAAF,QAAAC,IAAAC,aAAA,eAAA,KAAA,izCAAA;AACH;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { useCallback as a } from "react";
|
|
2
2
|
import { useLocation as e, useBeforeUnload as r } from "react-router-dom";
|
|
3
|
-
import { useHvNavigation as
|
|
4
|
-
const
|
|
3
|
+
import { useHvNavigation as i } from "@hitachivantara/app-shell-navigation";
|
|
4
|
+
const l = () => {
|
|
5
5
|
const o = e(), {
|
|
6
6
|
navigate: t
|
|
7
|
-
} =
|
|
7
|
+
} = i();
|
|
8
8
|
r(a(() => {
|
|
9
9
|
t({
|
|
10
10
|
...o
|
|
@@ -12,8 +12,8 @@ const s = () => {
|
|
|
12
12
|
replace: !0
|
|
13
13
|
});
|
|
14
14
|
}, [o, t]));
|
|
15
|
-
}
|
|
15
|
+
};
|
|
16
16
|
export {
|
|
17
|
-
|
|
17
|
+
l as default
|
|
18
18
|
};
|
|
19
19
|
//# sourceMappingURL=useClearLocationState.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useClearLocationState.js","sources":["../../../../src/lib/hooks/useClearLocationState.tsx"],"sourcesContent":["import { useCallback } from \"react\";\nimport { useBeforeUnload, useLocation } from \"react-router-dom\";\n\nimport { useHvNavigation } from \"@hitachivantara/app-shell-navigation\";\n\nconst useClearLocationState = () => {\n const location = useLocation();\n const { navigate } = useHvNavigation();\n\n // This will only be called when the user reloads the page or navigates away from the app and is required when\n // the configuration changes (refresh is mandatory) so that useLocation `state` property is reset.\n useBeforeUnload(\n useCallback(() => {\n navigate({ ...location }, { replace: true });\n }, [location, navigate])\n );\n};\n\nexport default useClearLocationState;\n"],"names":["useClearLocationState","location","useLocation","navigate","useHvNavigation","useBeforeUnload","useCallback","replace"
|
|
1
|
+
{"version":3,"file":"useClearLocationState.js","sources":["../../../../src/lib/hooks/useClearLocationState.tsx"],"sourcesContent":["import { useCallback } from \"react\";\nimport { useBeforeUnload, useLocation } from \"react-router-dom\";\n\nimport { useHvNavigation } from \"@hitachivantara/app-shell-navigation\";\n\nconst useClearLocationState = () => {\n const location = useLocation();\n const { navigate } = useHvNavigation();\n\n // This will only be called when the user reloads the page or navigates away from the app and is required when\n // the configuration changes (refresh is mandatory) so that useLocation `state` property is reset.\n useBeforeUnload(\n useCallback(() => {\n navigate({ ...location }, { replace: true });\n }, [location, navigate])\n );\n};\n\nexport default useClearLocationState;\n"],"names":["useClearLocationState","location","useLocation","navigate","useHvNavigation","useBeforeUnload","useCallback","replace"],"mappings":";;;AAKA,MAAMA,IAAwBA,MAAM;AAClC,QAAMC,IAAWC,KACX;AAAA,IAAEC,UAAAA;AAAAA,MAAaC,EAAgB;AAIrCC,EAAAA,EACEC,EAAY,MAAM;AACP,IAAAH,EAAA;AAAA,MAAE,GAAGF;AAAAA,IAAAA,GAAY;AAAA,MAAEM,SAAS;AAAA,IAAA,CAAM;AAAA,EAC1C,GAAA,CAACN,GAAUE,CAAQ,CAAC,CACzB;AACF;"}
|
|
@@ -2,7 +2,7 @@ import { useEffect as o } from "react";
|
|
|
2
2
|
import { HvAppShellEventNotificationTrigger as n, HvAppShellEventThemeTrigger as i } from "@hitachivantara/app-shell-events";
|
|
3
3
|
import r from "./useNotificationsEventListener.js";
|
|
4
4
|
import s from "./useThemeEventListener.js";
|
|
5
|
-
const
|
|
5
|
+
const E = () => {
|
|
6
6
|
const {
|
|
7
7
|
handleNotificationEvent: e
|
|
8
8
|
} = r(), {
|
|
@@ -11,8 +11,8 @@ const v = () => {
|
|
|
11
11
|
o(() => (globalThis.addEventListener(n, e), globalThis.addEventListener(i, t), () => {
|
|
12
12
|
globalThis.removeEventListener(n, e), globalThis.removeEventListener(i, t);
|
|
13
13
|
}), [e, t]);
|
|
14
|
-
}
|
|
14
|
+
};
|
|
15
15
|
export {
|
|
16
|
-
|
|
16
|
+
E as default
|
|
17
17
|
};
|
|
18
18
|
//# sourceMappingURL=useCustomEventListener.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCustomEventListener.js","sources":["../../../../src/lib/hooks/useCustomEventListener.ts"],"sourcesContent":["import { useEffect } from \"react\";\nimport {\n HvAppShellEventThemeTrigger,\n HvAppShellEventNotificationTrigger\n} from \"@hitachivantara/app-shell-events\";\nimport useNotificationsEventListener from \"./useNotificationsEventListener\";\nimport useThemeEventListener from \"./useThemeEventListener\";\n\nconst useCustomEventListener = () => {\n const { handleNotificationEvent } = useNotificationsEventListener();\n const { handleThemeEvent } = useThemeEventListener();\n\n useEffect(() => {\n globalThis.addEventListener(\n HvAppShellEventNotificationTrigger,\n handleNotificationEvent as EventListener\n );\n globalThis.addEventListener(\n HvAppShellEventThemeTrigger,\n handleThemeEvent as EventListener\n );\n\n return () => {\n globalThis.removeEventListener(\n HvAppShellEventNotificationTrigger,\n handleNotificationEvent as EventListener\n );\n globalThis.removeEventListener(\n HvAppShellEventThemeTrigger,\n handleThemeEvent as EventListener\n );\n };\n }, [handleNotificationEvent, handleThemeEvent]);\n};\n\nexport default useCustomEventListener;\n"],"names":["useCustomEventListener","handleNotificationEvent","useNotificationsEventListener","handleThemeEvent","useThemeEventListener","useEffect","addEventListener","HvAppShellEventNotificationTrigger","HvAppShellEventThemeTrigger","removeEventListener"
|
|
1
|
+
{"version":3,"file":"useCustomEventListener.js","sources":["../../../../src/lib/hooks/useCustomEventListener.ts"],"sourcesContent":["import { useEffect } from \"react\";\nimport {\n HvAppShellEventThemeTrigger,\n HvAppShellEventNotificationTrigger\n} from \"@hitachivantara/app-shell-events\";\nimport useNotificationsEventListener from \"./useNotificationsEventListener\";\nimport useThemeEventListener from \"./useThemeEventListener\";\n\nconst useCustomEventListener = () => {\n const { handleNotificationEvent } = useNotificationsEventListener();\n const { handleThemeEvent } = useThemeEventListener();\n\n useEffect(() => {\n globalThis.addEventListener(\n HvAppShellEventNotificationTrigger,\n handleNotificationEvent as EventListener\n );\n globalThis.addEventListener(\n HvAppShellEventThemeTrigger,\n handleThemeEvent as EventListener\n );\n\n return () => {\n globalThis.removeEventListener(\n HvAppShellEventNotificationTrigger,\n handleNotificationEvent as EventListener\n );\n globalThis.removeEventListener(\n HvAppShellEventThemeTrigger,\n handleThemeEvent as EventListener\n );\n };\n }, [handleNotificationEvent, handleThemeEvent]);\n};\n\nexport default useCustomEventListener;\n"],"names":["useCustomEventListener","handleNotificationEvent","useNotificationsEventListener","handleThemeEvent","useThemeEventListener","useEffect","addEventListener","HvAppShellEventNotificationTrigger","HvAppShellEventThemeTrigger","removeEventListener"],"mappings":";;;;AAQA,MAAMA,IAAyBA,MAAM;AAC7B,QAAA;AAAA,IAAEC,yBAAAA;AAAAA,MAA4BC,EAA8B,GAC5D;AAAA,IAAEC,kBAAAA;AAAAA,MAAqBC,EAAsB;AAEnDC,EAAAA,EAAU,OACGC,WAAAA,iBACTC,GACAN,CACF,GACWK,WAAAA,iBACTE,GACAL,CACF,GAEO,MAAM;AACAM,eAAAA,oBACTF,GACAN,CACF,GACWQ,WAAAA,oBACTD,GACAL,CACF;AAAA,EAAA,IAED,CAACF,GAAyBE,CAAgB,CAAC;AAChD;"}
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import { useState as
|
|
2
|
-
const
|
|
3
|
-
COLOR_MODE: "hv/user-preferences/color-mode"
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { useState as l, useEffect as c } from "react";
|
|
2
|
+
const u = {
|
|
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
9
|
return c(() => {
|
|
9
|
-
const t = (
|
|
10
|
-
|
|
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
|
-
|
|
22
|
+
u as LOCAL_STORAGE_KEYS,
|
|
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,12 +1,12 @@
|
|
|
1
|
-
import { useContext as c, useMemo as f, useEffect as
|
|
2
|
-
import { useLocation as
|
|
1
|
+
import { useContext as c, useMemo as f, useEffect as p } from "react";
|
|
2
|
+
import { useLocation as g } from "react-router-dom";
|
|
3
3
|
import { useHvAppShellConfig as v, HvAppShellRuntimeContext as M, CONFIG_TRANSLATIONS_NAMESPACE as I, useHvMenuItems as N } from "@hitachivantara/app-shell-shared";
|
|
4
4
|
import { useHvNavigation as d } from "@hitachivantara/app-shell-navigation";
|
|
5
5
|
import { createNavigationMenuItems as l } from "../utils/navigationUtil.js";
|
|
6
|
-
const A = 2,
|
|
6
|
+
const A = 2, H = () => {
|
|
7
7
|
const {
|
|
8
8
|
pathname: s
|
|
9
|
-
} =
|
|
9
|
+
} = g(), {
|
|
10
10
|
navigationMode: m
|
|
11
11
|
} = v(), {
|
|
12
12
|
navigate: i
|
|
@@ -18,7 +18,7 @@ const A = 2, T = () => {
|
|
|
18
18
|
selectedMenuItemId: n,
|
|
19
19
|
rootMenuItemId: u
|
|
20
20
|
} = N(), r = l(a, t, m === "ONLY_TOP" ? A : void 0);
|
|
21
|
-
return
|
|
21
|
+
return p(() => {
|
|
22
22
|
var o;
|
|
23
23
|
!n && s === "/" && ((o = t[0]) != null && o.href) && i(t[0].href);
|
|
24
24
|
}, [s, t, i, n]), {
|
|
@@ -26,8 +26,8 @@ const A = 2, T = () => {
|
|
|
26
26
|
selectedMenuItemId: n,
|
|
27
27
|
rootMenuItemId: u
|
|
28
28
|
};
|
|
29
|
-
}
|
|
29
|
+
};
|
|
30
30
|
export {
|
|
31
|
-
|
|
31
|
+
H as default
|
|
32
32
|
};
|
|
33
33
|
//# sourceMappingURL=useNavigationMenuItems.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNavigationMenuItems.js","sources":["../../../../src/lib/hooks/useNavigationMenuItems.tsx"],"sourcesContent":["import { useContext, useEffect, useMemo } from \"react\";\nimport { useLocation } from \"react-router-dom\";\n\nimport {\n CONFIG_TRANSLATIONS_NAMESPACE,\n HvAppShellRuntimeContext,\n useHvAppShellConfig,\n useHvMenuItems\n} from \"@hitachivantara/app-shell-shared\";\nimport { useHvNavigation } from \"@hitachivantara/app-shell-navigation\";\n\nimport { createNavigationMenuItems } from \"../utils/navigationUtil\";\nimport { MenuItemsContext } from \"../types\";\n\nconst MAX_TOP_MENU_DEPTH = 2;\n\nconst useNavigationMenuItems = (): MenuItemsContext => {\n // use the i18n instance from the app shell runtime context to ensure we're using\n // the app shell instance of i18n and not the one from the embedded app\n const { pathname } = useLocation();\n const { navigationMode } = useHvAppShellConfig();\n const { navigate } = useHvNavigation();\n const { i18n } = useContext(HvAppShellRuntimeContext) ?? {};\n const tConfig = useMemo(\n () =>\n i18n?.getFixedT(i18n.language, CONFIG_TRANSLATIONS_NAMESPACE) ??\n // should not happen, but fallback if the i18n instance is not available\n ((l: string) => l),\n [i18n]\n );\n\n const { items, selectedMenuItemId, rootMenuItemId } = useHvMenuItems();\n const navigationMenuItemsTmp = createNavigationMenuItems(\n tConfig,\n items,\n navigationMode === \"ONLY_TOP\" ? MAX_TOP_MENU_DEPTH : undefined\n );\n useEffect(() => {\n // First render (or a refresh) without written user url, then navigate to the first menu item\n if (!selectedMenuItemId && pathname === \"/\" && items[0]?.href) {\n navigate(items[0].href);\n }\n }, [pathname, items, navigate, selectedMenuItemId]);\n return {\n items: navigationMenuItemsTmp,\n selectedMenuItemId,\n rootMenuItemId\n };\n};\n\nexport default useNavigationMenuItems;\n"],"names":["MAX_TOP_MENU_DEPTH","useNavigationMenuItems","pathname","useLocation","navigationMode","useHvAppShellConfig","navigate","useHvNavigation","i18n","useContext","HvAppShellRuntimeContext","tConfig","useMemo","getFixedT","language","CONFIG_TRANSLATIONS_NAMESPACE","l","items","selectedMenuItemId","rootMenuItemId","useHvMenuItems","navigationMenuItemsTmp","createNavigationMenuItems","undefined","useEffect","href"
|
|
1
|
+
{"version":3,"file":"useNavigationMenuItems.js","sources":["../../../../src/lib/hooks/useNavigationMenuItems.tsx"],"sourcesContent":["import { useContext, useEffect, useMemo } from \"react\";\nimport { useLocation } from \"react-router-dom\";\n\nimport {\n CONFIG_TRANSLATIONS_NAMESPACE,\n HvAppShellRuntimeContext,\n useHvAppShellConfig,\n useHvMenuItems\n} from \"@hitachivantara/app-shell-shared\";\nimport { useHvNavigation } from \"@hitachivantara/app-shell-navigation\";\n\nimport { createNavigationMenuItems } from \"../utils/navigationUtil\";\nimport { MenuItemsContext } from \"../types\";\n\nconst MAX_TOP_MENU_DEPTH = 2;\n\nconst useNavigationMenuItems = (): MenuItemsContext => {\n // use the i18n instance from the app shell runtime context to ensure we're using\n // the app shell instance of i18n and not the one from the embedded app\n const { pathname } = useLocation();\n const { navigationMode } = useHvAppShellConfig();\n const { navigate } = useHvNavigation();\n const { i18n } = useContext(HvAppShellRuntimeContext) ?? {};\n const tConfig = useMemo(\n () =>\n i18n?.getFixedT(i18n.language, CONFIG_TRANSLATIONS_NAMESPACE) ??\n // should not happen, but fallback if the i18n instance is not available\n ((l: string) => l),\n [i18n]\n );\n\n const { items, selectedMenuItemId, rootMenuItemId } = useHvMenuItems();\n const navigationMenuItemsTmp = createNavigationMenuItems(\n tConfig,\n items,\n navigationMode === \"ONLY_TOP\" ? MAX_TOP_MENU_DEPTH : undefined\n );\n useEffect(() => {\n // First render (or a refresh) without written user url, then navigate to the first menu item\n if (!selectedMenuItemId && pathname === \"/\" && items[0]?.href) {\n navigate(items[0].href);\n }\n }, [pathname, items, navigate, selectedMenuItemId]);\n return {\n items: navigationMenuItemsTmp,\n selectedMenuItemId,\n rootMenuItemId\n };\n};\n\nexport default useNavigationMenuItems;\n"],"names":["MAX_TOP_MENU_DEPTH","useNavigationMenuItems","pathname","useLocation","navigationMode","useHvAppShellConfig","navigate","useHvNavigation","i18n","useContext","HvAppShellRuntimeContext","tConfig","useMemo","getFixedT","language","CONFIG_TRANSLATIONS_NAMESPACE","l","items","selectedMenuItemId","rootMenuItemId","useHvMenuItems","navigationMenuItemsTmp","createNavigationMenuItems","undefined","useEffect","href"],"mappings":";;;;;AAcA,MAAMA,IAAqB,GAErBC,IAAyBA,MAAwB;AAG/C,QAAA;AAAA,IAAEC,UAAAA;AAAAA,MAAaC,EAAY,GAC3B;AAAA,IAAEC,gBAAAA;AAAAA,MAAmBC,EAAoB,GACzC;AAAA,IAAEC,UAAAA;AAAAA,MAAaC,EAAgB,GAC/B;AAAA,IAAEC,MAAAA;AAAAA,EAAAA,IAASC,EAAWC,CAAwB,KAAK,IACnDC,IAAUC,EACd,OACEJ,KAAAA,gBAAAA,EAAMK,UAAUL,EAAKM,UAAUC;AAAAA,GAE9B,CAACC,MAAcA,IAClB,CAACR,CAAI,CACP,GAEM;AAAA,IAAES,OAAAA;AAAAA,IAAOC,oBAAAA;AAAAA,IAAoBC,gBAAAA;AAAAA,MAAmBC,EAAe,GAC/DC,IAAyBC,EAC7BX,GACAM,GACAb,MAAmB,aAAaJ,IAAqBuB,MACvD;AACAC,SAAAA,EAAU,MAAM;;AAEd,IAAI,CAACN,KAAsBhB,MAAa,SAAOe,IAAAA,EAAM,CAAC,MAAPA,QAAAA,EAAUQ,SAC9CR,EAAAA,EAAM,CAAC,EAAEQ,IAAI;AAAA,KAEvB,CAACvB,GAAUe,GAAOX,GAAUY,CAAkB,CAAC,GAC3C;AAAA,IACLD,OAAOI;AAAAA,IACPH,oBAAAA;AAAAA,IACAC,gBAAAA;AAAAA,EAAAA;AAEJ;"}
|
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import { useHvSnackbar as f } from "@hitachivantara/uikit-react-core";
|
|
2
2
|
import u from "../../providers/hooks/useBannerContext.js";
|
|
3
|
-
const
|
|
3
|
+
const k = () => {
|
|
4
4
|
const {
|
|
5
5
|
enqueueSnackbar: o
|
|
6
6
|
} = f(), {
|
|
7
7
|
show: s
|
|
8
|
-
} = u(), i = (
|
|
8
|
+
} = u(), i = (a) => {
|
|
9
9
|
const {
|
|
10
10
|
message: n,
|
|
11
11
|
variant: r,
|
|
12
|
-
actions:
|
|
12
|
+
actions: t,
|
|
13
13
|
actionsCallback: l
|
|
14
|
-
} =
|
|
14
|
+
} = a;
|
|
15
15
|
let e;
|
|
16
|
-
|
|
17
|
-
action: Array.isArray(
|
|
16
|
+
t && (e = {
|
|
17
|
+
action: Array.isArray(t) ? t[0] : t,
|
|
18
18
|
actionCallback: l
|
|
19
19
|
}), n && o(n, {
|
|
20
20
|
variant: r ?? "default",
|
|
21
21
|
snackbarContentProps: e
|
|
22
22
|
});
|
|
23
|
-
}, c = (
|
|
24
|
-
|
|
23
|
+
}, c = (a) => {
|
|
24
|
+
a.message && s(a);
|
|
25
25
|
};
|
|
26
26
|
return {
|
|
27
|
-
handleNotificationEvent: (
|
|
28
|
-
const n =
|
|
27
|
+
handleNotificationEvent: (a) => {
|
|
28
|
+
const n = a.detail;
|
|
29
29
|
switch (n.type) {
|
|
30
30
|
case "snackbar":
|
|
31
31
|
i(n);
|
|
@@ -38,8 +38,8 @@ const v = () => {
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
};
|
|
41
|
-
}
|
|
41
|
+
};
|
|
42
42
|
export {
|
|
43
|
-
|
|
43
|
+
k as default
|
|
44
44
|
};
|
|
45
45
|
//# sourceMappingURL=useNotificationsEventListener.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNotificationsEventListener.js","sources":["../../../../src/lib/hooks/useNotificationsEventListener.ts"],"sourcesContent":["import { useHvSnackbar } from \"@hitachivantara/uikit-react-core\";\nimport { HvAppShellEventNotification } from \"@hitachivantara/app-shell-events\";\n\nimport useBannerContext from \"../../providers/hooks/useBannerContext\";\n\nconst useNotificationsEventListener = () => {\n const { enqueueSnackbar } = useHvSnackbar();\n const { show } = useBannerContext();\n\n const handleCustomEventSnackbar = (\n notification: HvAppShellEventNotification\n ) => {\n const { message, variant, actions, actionsCallback } = notification;\n\n let snackbarContentProps;\n if (actions) {\n snackbarContentProps = {\n action: Array.isArray(actions) ? actions[0] : actions,\n actionCallback: actionsCallback\n };\n }\n\n if (message) {\n enqueueSnackbar(message, {\n variant: variant ?? \"default\",\n\n snackbarContentProps\n });\n }\n };\n\n const handleCustomEventBanner = (\n notification: HvAppShellEventNotification\n ) => {\n if (notification.message) {\n show(notification);\n }\n };\n\n const handleNotificationEvent = (\n event: CustomEvent<HvAppShellEventNotification>\n ) => {\n const notificationEvent = event.detail;\n switch (notificationEvent.type) {\n case \"snackbar\":\n handleCustomEventSnackbar(notificationEvent);\n break;\n case \"banner\":\n handleCustomEventBanner(notificationEvent);\n break;\n default:\n console.warn(\"Invalid notification type\", notificationEvent.type);\n }\n };\n\n return { handleNotificationEvent };\n};\n\nexport default useNotificationsEventListener;\n"],"names":["useNotificationsEventListener","enqueueSnackbar","useHvSnackbar","show","useBannerContext","handleCustomEventSnackbar","notification","message","variant","actions","actionsCallback","snackbarContentProps","action","Array","isArray","actionCallback","handleCustomEventBanner","handleNotificationEvent","event","notificationEvent","detail","type","warn"
|
|
1
|
+
{"version":3,"file":"useNotificationsEventListener.js","sources":["../../../../src/lib/hooks/useNotificationsEventListener.ts"],"sourcesContent":["import { useHvSnackbar } from \"@hitachivantara/uikit-react-core\";\nimport { HvAppShellEventNotification } from \"@hitachivantara/app-shell-events\";\n\nimport useBannerContext from \"../../providers/hooks/useBannerContext\";\n\nconst useNotificationsEventListener = () => {\n const { enqueueSnackbar } = useHvSnackbar();\n const { show } = useBannerContext();\n\n const handleCustomEventSnackbar = (\n notification: HvAppShellEventNotification\n ) => {\n const { message, variant, actions, actionsCallback } = notification;\n\n let snackbarContentProps;\n if (actions) {\n snackbarContentProps = {\n action: Array.isArray(actions) ? actions[0] : actions,\n actionCallback: actionsCallback\n };\n }\n\n if (message) {\n enqueueSnackbar(message, {\n variant: variant ?? \"default\",\n\n snackbarContentProps\n });\n }\n };\n\n const handleCustomEventBanner = (\n notification: HvAppShellEventNotification\n ) => {\n if (notification.message) {\n show(notification);\n }\n };\n\n const handleNotificationEvent = (\n event: CustomEvent<HvAppShellEventNotification>\n ) => {\n const notificationEvent = event.detail;\n switch (notificationEvent.type) {\n case \"snackbar\":\n handleCustomEventSnackbar(notificationEvent);\n break;\n case \"banner\":\n handleCustomEventBanner(notificationEvent);\n break;\n default:\n console.warn(\"Invalid notification type\", notificationEvent.type);\n }\n };\n\n return { handleNotificationEvent };\n};\n\nexport default useNotificationsEventListener;\n"],"names":["useNotificationsEventListener","enqueueSnackbar","useHvSnackbar","show","useBannerContext","handleCustomEventSnackbar","notification","message","variant","actions","actionsCallback","snackbarContentProps","action","Array","isArray","actionCallback","handleCustomEventBanner","handleNotificationEvent","event","notificationEvent","detail","type","warn"],"mappings":";;AAKA,MAAMA,IAAgCA,MAAM;AACpC,QAAA;AAAA,IAAEC,iBAAAA;AAAAA,MAAoBC,EAAc,GACpC;AAAA,IAAEC,MAAAA;AAAAA,MAASC,EAAiB,GAE5BC,IAA4BA,CAChCC,MACG;AACG,UAAA;AAAA,MAAEC,SAAAA;AAAAA,MAASC,SAAAA;AAAAA,MAASC,SAAAA;AAAAA,MAASC,iBAAAA;AAAAA,IAAoBJ,IAAAA;AAEnDK,QAAAA;AACJ,IAAIF,MACqBE,IAAA;AAAA,MACrBC,QAAQC,MAAMC,QAAQL,CAAO,IAAIA,EAAQ,CAAC,IAAIA;AAAAA,MAC9CM,gBAAgBL;AAAAA,IAAAA,IAIhBH,KACFN,EAAgBM,GAAS;AAAA,MACvBC,SAASA,KAAW;AAAA,MAEpBG,sBAAAA;AAAAA,IAAAA,CACD;AAAA,EACH,GAGIK,IAA0BA,CAC9BV,MACG;AACH,IAAIA,EAAaC,WACfJ,EAAKG,CAAY;AAAA,EACnB;AAmBK,SAAA;AAAA,IAAEW,yBAhBuBA,CAC9BC,MACG;AACH,YAAMC,IAAoBD,EAAME;AAChC,cAAQD,EAAkBE,MAAI;AAAA,QAC5B,KAAK;AACHhB,UAAAA,EAA0Bc,CAAiB;AAC3C;AAAA,QACF,KAAK;AACHH,UAAAA,EAAwBG,CAAiB;AACzC;AAAA,QACF;AACUG,kBAAAA,KAAK,6BAA6BH,EAAkBE,IAAI;AAAA,MACpE;AAAA,IAAA;AAAA,EAGOJ;AACX;"}
|
|
@@ -1,27 +1,27 @@
|
|
|
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,
|
|
7
7
|
selectedMode: r,
|
|
8
|
-
colorModes:
|
|
8
|
+
colorModes: o
|
|
9
9
|
} = h(), {
|
|
10
10
|
setStoredValue: c
|
|
11
|
-
} = m(
|
|
12
|
-
const e = (
|
|
13
|
-
return
|
|
11
|
+
} = m("COLOR_MODE"), l = () => {
|
|
12
|
+
const e = (o.indexOf(r) + 1) % o.length;
|
|
13
|
+
return o[e];
|
|
14
14
|
};
|
|
15
15
|
return {
|
|
16
|
-
handleThemeEvent: (
|
|
16
|
+
handleThemeEvent: (t) => {
|
|
17
17
|
const {
|
|
18
18
|
colorMode: e
|
|
19
|
-
} =
|
|
19
|
+
} = t.detail, n = !e || o.indexOf(e) === -1 ? l() : e;
|
|
20
20
|
d(s, n), c(n);
|
|
21
21
|
}
|
|
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;"}
|
|
@@ -3,12 +3,12 @@ import { initReactI18next as d } from "react-i18next";
|
|
|
3
3
|
import u from "i18next-browser-languagedetector";
|
|
4
4
|
import i from "./localization/en.json.js";
|
|
5
5
|
import l from "./localization/pt.json.js";
|
|
6
|
-
const t = "appShell",
|
|
6
|
+
const t = "appShell", x = (e, n, r) => {
|
|
7
7
|
Object.entries(n).forEach((o) => {
|
|
8
8
|
const [a, c] = o;
|
|
9
9
|
e.addResourceBundle(a, r ?? t, c);
|
|
10
10
|
});
|
|
11
|
-
},
|
|
11
|
+
}, B = () => {
|
|
12
12
|
const e = s.createInstance();
|
|
13
13
|
return e.use(u).use(d).init({
|
|
14
14
|
defaultNS: t,
|
|
@@ -20,10 +20,10 @@ const t = "appShell", g = (e, n, r) => {
|
|
|
20
20
|
}), e.addResourceBundle("en", t, i), e.addResourceBundle("pt", t, l), {
|
|
21
21
|
i18n: e
|
|
22
22
|
};
|
|
23
|
-
}
|
|
23
|
+
};
|
|
24
24
|
export {
|
|
25
25
|
t as APP_SHELL_NAMESPACE,
|
|
26
|
-
|
|
26
|
+
x as addResourceBundles,
|
|
27
27
|
B as default
|
|
28
28
|
};
|
|
29
29
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../../../src/lib/i18n/index.ts"],"sourcesContent":["import i18next, { i18n } from \"i18next\";\nimport { initReactI18next } from \"react-i18next\";\nimport LanguageDetector from \"i18next-browser-languagedetector\";\nimport en from \"./localization/en.json\";\nimport pt from \"./localization/pt.json\";\n\nexport const APP_SHELL_NAMESPACE = \"appShell\";\nexport const addResourceBundles = (\n i18nInstance: i18n,\n bundles: Record<string, object>,\n namespace?: string\n) => {\n Object.entries(bundles).forEach(entry => {\n const [key, value] = entry;\n i18nInstance.addResourceBundle(\n key,\n namespace ?? APP_SHELL_NAMESPACE,\n value\n );\n });\n};\n\nconst createI18Next = () => {\n const newInstance = i18next.createInstance();\n newInstance\n .use(LanguageDetector)\n .use(initReactI18next)\n .init({\n defaultNS: APP_SHELL_NAMESPACE,\n fallbackLng: \"en\",\n detection: { order: [\"navigator\"] },\n resources: {}\n });\n\n newInstance.addResourceBundle(\"en\", APP_SHELL_NAMESPACE, en);\n newInstance.addResourceBundle(\"pt\", APP_SHELL_NAMESPACE, pt);\n\n return {\n i18n: newInstance\n };\n};\n\nexport default createI18Next;\n"],"names":["APP_SHELL_NAMESPACE","addResourceBundles","i18nInstance","bundles","namespace","Object","entries","forEach","entry","key","value","addResourceBundle","createI18Next","newInstance","i18next","createInstance","use","LanguageDetector","initReactI18next","init","defaultNS","fallbackLng","detection","order","resources","en","pt","i18n"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../../../src/lib/i18n/index.ts"],"sourcesContent":["import i18next, { i18n } from \"i18next\";\nimport { initReactI18next } from \"react-i18next\";\nimport LanguageDetector from \"i18next-browser-languagedetector\";\nimport en from \"./localization/en.json\";\nimport pt from \"./localization/pt.json\";\n\nexport const APP_SHELL_NAMESPACE = \"appShell\";\nexport const addResourceBundles = (\n i18nInstance: i18n,\n bundles: Record<string, object>,\n namespace?: string\n) => {\n Object.entries(bundles).forEach(entry => {\n const [key, value] = entry;\n i18nInstance.addResourceBundle(\n key,\n namespace ?? APP_SHELL_NAMESPACE,\n value\n );\n });\n};\n\nconst createI18Next = () => {\n const newInstance = i18next.createInstance();\n newInstance\n .use(LanguageDetector)\n .use(initReactI18next)\n .init({\n defaultNS: APP_SHELL_NAMESPACE,\n fallbackLng: \"en\",\n detection: { order: [\"navigator\"] },\n resources: {}\n });\n\n newInstance.addResourceBundle(\"en\", APP_SHELL_NAMESPACE, en);\n newInstance.addResourceBundle(\"pt\", APP_SHELL_NAMESPACE, pt);\n\n return {\n i18n: newInstance\n };\n};\n\nexport default createI18Next;\n"],"names":["APP_SHELL_NAMESPACE","addResourceBundles","i18nInstance","bundles","namespace","Object","entries","forEach","entry","key","value","addResourceBundle","createI18Next","newInstance","i18next","createInstance","use","LanguageDetector","initReactI18next","init","defaultNS","fallbackLng","detection","order","resources","en","pt","i18n"],"mappings":";;;;;AAMO,MAAMA,IAAsB,YACtBC,IAAqBA,CAChCC,GACAC,GACAC,MACG;AACHC,SAAOC,QAAQH,CAAO,EAAEI,QAAQC,CAASA,MAAA;AACjC,UAAA,CAACC,GAAKC,CAAK,IAAIF;AACrBN,IAAAA,EAAaS,kBACXF,GACAL,KAAaJ,GACbU,CACF;AAAA,EAAA,CACD;AACH,GAEME,IAAgBA,MAAM;AACpBC,QAAAA,IAAcC,EAAQC;AAC5BF,SAAAA,EACGG,IAAIC,CAAgB,EACpBD,IAAIE,CAAgB,EACpBC,KAAK;AAAA,IACJC,WAAWpB;AAAAA,IACXqB,aAAa;AAAA,IACbC,WAAW;AAAA,MAAEC,OAAO,CAAC,WAAW;AAAA,IAAE;AAAA,IAClCC,WAAW,CAAC;AAAA,EAAA,CACb,GAESb,EAAAA,kBAAkB,MAAMX,GAAqByB,CAAE,GAC/Cd,EAAAA,kBAAkB,MAAMX,GAAqB0B,CAAE,GAEpD;AAAA,IACLC,MAAMd;AAAAA,EAAAA;AAEV;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"basePathUtils.js","sources":["../../../../src/lib/utils/basePathUtils.ts"],"sourcesContent":["import { HvAppShellConfig } from \"@hitachivantara/app-shell-shared\";\n\n/**\n * Returns the app base path.\n * - The path is calculated by returning the sub-path value for the main app.\n * - Main app is the first app that baseUrl matches window.location\n * - App baseUrl don't have case restrictions\n * - If the main app is not discovered, returns \"/\"\n *\n * @return The main app baseUrl, or \"/\" otherwise. Value is always returned in lowercase.\n * @param config The app configuration definition\n */\nconst getBasePath = (config: HvAppShellConfig) => {\n return config?.baseUrl ?? \"/\";\n};\n\nexport default getBasePath;\n"],"names":["getBasePath","config","baseUrl"
|
|
1
|
+
{"version":3,"file":"basePathUtils.js","sources":["../../../../src/lib/utils/basePathUtils.ts"],"sourcesContent":["import { HvAppShellConfig } from \"@hitachivantara/app-shell-shared\";\n\n/**\n * Returns the app base path.\n * - The path is calculated by returning the sub-path value for the main app.\n * - Main app is the first app that baseUrl matches window.location\n * - App baseUrl don't have case restrictions\n * - If the main app is not discovered, returns \"/\"\n *\n * @return The main app baseUrl, or \"/\" otherwise. Value is always returned in lowercase.\n * @param config The app configuration definition\n */\nconst getBasePath = (config: HvAppShellConfig) => {\n return config?.baseUrl ?? \"/\";\n};\n\nexport default getBasePath;\n"],"names":["getBasePath","config","baseUrl"],"mappings":"AAYMA,MAAAA,IAAcA,CAACC,OACZA,KAAAA,gBAAAA,EAAQC,YAAW;"}
|
|
@@ -2,8 +2,8 @@ const a = (t) => {
|
|
|
2
2
|
const n = "app-shell-panel-container";
|
|
3
3
|
let e = document.getElementById(t ?? n);
|
|
4
4
|
return e || (e = document.createElement("div"), e.id = n, document.body.appendChild(e)), e;
|
|
5
|
-
}
|
|
5
|
+
};
|
|
6
6
|
export {
|
|
7
|
-
|
|
7
|
+
a as default
|
|
8
8
|
};
|
|
9
9
|
//# sourceMappingURL=documentUtil.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"documentUtil.js","sources":["../../../../src/lib/utils/documentUtil.ts"],"sourcesContent":["const createAppContainerElement = (id?: string): HTMLElement => {\n const panelContainerId = \"app-shell-panel-container\";\n let panelContainerElement = document.getElementById(id ?? panelContainerId);\n\n if (!panelContainerElement) {\n panelContainerElement = document.createElement(\"div\");\n panelContainerElement.id = panelContainerId;\n document.body.appendChild(panelContainerElement);\n }\n\n return panelContainerElement;\n};\n\nexport default createAppContainerElement;\n"],"names":["createAppContainerElement","id","panelContainerId","panelContainerElement","document","getElementById","createElement","body","appendChild"
|
|
1
|
+
{"version":3,"file":"documentUtil.js","sources":["../../../../src/lib/utils/documentUtil.ts"],"sourcesContent":["const createAppContainerElement = (id?: string): HTMLElement => {\n const panelContainerId = \"app-shell-panel-container\";\n let panelContainerElement = document.getElementById(id ?? panelContainerId);\n\n if (!panelContainerElement) {\n panelContainerElement = document.createElement(\"div\");\n panelContainerElement.id = panelContainerId;\n document.body.appendChild(panelContainerElement);\n }\n\n return panelContainerElement;\n};\n\nexport default createAppContainerElement;\n"],"names":["createAppContainerElement","id","panelContainerId","panelContainerElement","document","getElementById","createElement","body","appendChild"],"mappings":"AAAMA,MAAAA,IAA4BA,CAACC,MAA6B;AAC9D,QAAMC,IAAmB;AACzB,MAAIC,IAAwBC,SAASC,eAAeJ,KAAMC,CAAgB;AAE1E,SAAKC,MACqBC,IAAAA,SAASE,cAAc,KAAK,GACpDH,EAAsBF,KAAKC,GAClBK,SAAAA,KAAKC,YAAYL,CAAqB,IAG1CA;AACT;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"textUtil.js","sources":["../../../../src/lib/utils/textUtil.ts"],"sourcesContent":["/**\n * Checks if a search string (can be a single character or a string sequence) may be found within the given value string.\n * @param value The string to be checked if contains the search value\n * @param searchParam The string\n */\nconst includesString = (value: string, searchParam: string): boolean => {\n return value.includes(searchParam);\n};\n\nexport default includesString;\n"],"names":["includesString","value","searchParam","includes"
|
|
1
|
+
{"version":3,"file":"textUtil.js","sources":["../../../../src/lib/utils/textUtil.ts"],"sourcesContent":["/**\n * Checks if a search string (can be a single character or a string sequence) may be found within the given value string.\n * @param value The string to be checked if contains the search value\n * @param searchParam The string\n */\nconst includesString = (value: string, searchParam: string): boolean => {\n return value.includes(searchParam);\n};\n\nexport default includesString;\n"],"names":["includesString","value","searchParam","includes"],"mappings":"AAKMA,MAAAA,IAAiBA,CAACC,GAAeC,MAC9BD,EAAME,SAASD,CAAW;"}
|
|
@@ -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,IAAyBuB,EAAgC,MACzDxB,IACKqB,IAAW,WAAW,aAExBH,IAAa,aAAa,aAChC,CAACG,GAAUrB,GAAekB,CAAU,CAAC,GAElCrB,IAA0B2B,EAAQ,MAAM;;AAC5C,QAAIxB;AACKJ,aAAAA;AAGT,QAAIS,MAAmB;AACrB,aAAOoB,EAAoC7B,CAAK;AAGlD,UAAM8B,IACH/B,OAAkBgC,IAAAA,EAAa/B,GAAOD,CAAc,MAAlCgC,gBAAAA,EAAqCC,SAAS;AAEnE,WAAOH,EAAoCC,CAAa;AAAA,KACvD,CAAC9B,GAAOS,GAAgBV,GAAgBK,CAAa,CAAC,GAEnDF,IAAwB0B,EAAQ,MAChCxB,IACK,KAGLK,MAAmB,aACd,KAGFR,KAA2BA,EAAwBgC,SAAS,GAClE,CAACxB,GAAgBR,GAAyBG,CAAa,CAAC;AAG3D8B,EAAAA,EAAU,MAAM;AACGC,IAAAA,EAAAA,OAAOb,CAAU,CAAC;AAAA,EAAA,GAClC,CAACA,GAAYF,CAAgB,CAAC,GAGjCc,EAAU,MAAM;AACdR,IAAAA,EAAYtB,CAAa;AAAA,EAAA,GACxB,CAACA,CAAa,CAAC,GAElB8B,EAAU,MAAM;AAEZzB,IAAAA,EAAAA,MAAmB,cACjBT,EAAMoC,KAAKC,CAAAA,MAAQA,EAAKL,QAAQK,EAAKL,KAAKC,SAAS,CAAC,CACxD;AAAA,EAAA,GACC,CAACxB,GAAgBT,CAAK,CAAC;AAEpBM,QAAAA,IAA+BgC,EAAY,MAAM;AACrD,IAAIlC,IACUmC,EAAAA,CAAAA,MAAa,CAACA,CAAS,IAErBA,EAAAA,CAAAA,MAAa,CAACA,CAAS;AAAA,EACvC,GACC,CAACnC,CAAa,CAAC,GAEZa,IAAQW,EACZ,OAAO;AAAA,IACL/B,oBAAAA;AAAAA,IACAE,gBAAAA;AAAAA,IACAC,OAAAA;AAAAA,IACAC,yBAAAA;AAAAA,IACAC,uBAAAA;AAAAA,IACAC,mBAAAA;AAAAA,IACAC,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;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { useContext as
|
|
2
|
-
import { BannerContext as
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
return
|
|
6
|
-
}
|
|
1
|
+
import { useContext as t } from "react";
|
|
2
|
+
import { BannerContext as e } from "../BannerProvider.js";
|
|
3
|
+
const s = () => {
|
|
4
|
+
const o = t(e);
|
|
5
|
+
return o === void 0 && console.error("BannerContext was used outside of its Provider"), o;
|
|
6
|
+
};
|
|
7
7
|
export {
|
|
8
|
-
|
|
8
|
+
s as default
|
|
9
9
|
};
|
|
10
10
|
//# sourceMappingURL=useBannerContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useBannerContext.js","sources":["../../../../src/providers/hooks/useBannerContext.tsx"],"sourcesContent":["import { useContext } from \"react\";\n\nimport { BannerContext } from \"../BannerProvider\";\n\nconst useBannerContext = () => {\n const context = useContext(BannerContext);\n\n if (context === undefined) {\n console.error(\"BannerContext was used outside of its Provider\");\n }\n\n return context;\n};\n\nexport default useBannerContext;\n"],"names":["useBannerContext","context","useContext","BannerContext","undefined","console","error"
|
|
1
|
+
{"version":3,"file":"useBannerContext.js","sources":["../../../../src/providers/hooks/useBannerContext.tsx"],"sourcesContent":["import { useContext } from \"react\";\n\nimport { BannerContext } from \"../BannerProvider\";\n\nconst useBannerContext = () => {\n const context = useContext(BannerContext);\n\n if (context === undefined) {\n console.error(\"BannerContext was used outside of its Provider\");\n }\n\n return context;\n};\n\nexport default useBannerContext;\n"],"names":["useBannerContext","context","useContext","BannerContext","undefined","console","error"],"mappings":";;AAIA,MAAMA,IAAmBA,MAAM;AACvBC,QAAAA,IAAUC,EAAWC,CAAa;AAExC,SAAIF,MAAYG,UACdC,QAAQC,MAAM,gDAAgD,GAGzDL;AACT;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { useContext as
|
|
1
|
+
import { useContext as t } from "react";
|
|
2
2
|
import { LayoutContext as e } from "../LayoutProvider.js";
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
return
|
|
6
|
-
}
|
|
3
|
+
const n = () => {
|
|
4
|
+
const o = t(e);
|
|
5
|
+
return o === void 0 && console.error("LayoutContext was used outside of its Provider"), o;
|
|
6
|
+
};
|
|
7
7
|
export {
|
|
8
|
-
|
|
8
|
+
n as default
|
|
9
9
|
};
|
|
10
10
|
//# sourceMappingURL=useLayoutContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLayoutContext.js","sources":["../../../../src/providers/hooks/useLayoutContext.tsx"],"sourcesContent":["import { useContext } from \"react\";\nimport { LayoutContext } from \"../LayoutProvider\";\n\nconst useLayoutContext = () => {\n const context = useContext(LayoutContext);\n\n if (context === undefined) {\n console.error(\"LayoutContext was used outside of its Provider\");\n }\n\n return context;\n};\n\nexport default useLayoutContext;\n"],"names":["useLayoutContext","context","useContext","LayoutContext","undefined","console","error"
|
|
1
|
+
{"version":3,"file":"useLayoutContext.js","sources":["../../../../src/providers/hooks/useLayoutContext.tsx"],"sourcesContent":["import { useContext } from \"react\";\nimport { LayoutContext } from \"../LayoutProvider\";\n\nconst useLayoutContext = () => {\n const context = useContext(LayoutContext);\n\n if (context === undefined) {\n console.error(\"LayoutContext was used outside of its Provider\");\n }\n\n return context;\n};\n\nexport default useLayoutContext;\n"],"names":["useLayoutContext","context","useContext","LayoutContext","undefined","console","error"],"mappings":";;AAGA,MAAMA,IAAmBA,MAAM;AACvBC,QAAAA,IAAUC,EAAWC,CAAa;AAExC,SAAIF,MAAYG,UACdC,QAAQC,MAAM,gDAAgD,GAGzDL;AACT;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { useContext as
|
|
1
|
+
import { useContext as t } from "react";
|
|
2
2
|
import { NavigationContext as e } from "../NavigationProvider.js";
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
return
|
|
6
|
-
}
|
|
3
|
+
const r = () => {
|
|
4
|
+
const o = t(e);
|
|
5
|
+
return o === void 0 && console.error("NavigationContext was used outside of its Provider"), o;
|
|
6
|
+
};
|
|
7
7
|
export {
|
|
8
|
-
|
|
8
|
+
r as default
|
|
9
9
|
};
|
|
10
10
|
//# sourceMappingURL=useNavigationContext.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useNavigationContext.js","sources":["../../../../src/providers/hooks/useNavigationContext.tsx"],"sourcesContent":["import { useContext } from \"react\";\n\nimport { NavigationContext } from \"../NavigationProvider\";\n\nconst useNavigationContext = () => {\n const context = useContext(NavigationContext);\n\n if (context === undefined) {\n console.error(\"NavigationContext was used outside of its Provider\");\n }\n\n return context;\n};\n\nexport default useNavigationContext;\n"],"names":["useNavigationContext","context","useContext","NavigationContext","undefined","console","error"
|
|
1
|
+
{"version":3,"file":"useNavigationContext.js","sources":["../../../../src/providers/hooks/useNavigationContext.tsx"],"sourcesContent":["import { useContext } from \"react\";\n\nimport { NavigationContext } from \"../NavigationProvider\";\n\nconst useNavigationContext = () => {\n const context = useContext(NavigationContext);\n\n if (context === undefined) {\n console.error(\"NavigationContext was used outside of its Provider\");\n }\n\n return context;\n};\n\nexport default useNavigationContext;\n"],"names":["useNavigationContext","context","useContext","NavigationContext","undefined","console","error"],"mappings":";;AAIA,MAAMA,IAAuBA,MAAM;AAC3BC,QAAAA,IAAUC,EAAWC,CAAiB;AAE5C,SAAIF,MAAYG,UACdC,QAAQC,MAAM,oDAAoD,GAG7DL;AACT;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hitachivantara/app-shell-ui",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "AppShell Component",
|
|
5
5
|
"author": "Hitachi Vantara - Boba Fett Team",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -39,10 +39,10 @@
|
|
|
39
39
|
"@emotion/react": "^11.10.5",
|
|
40
40
|
"@emotion/styled": "^11.10.5",
|
|
41
41
|
"@hitachivantara/app-shell-events": "1.0.0",
|
|
42
|
-
"@hitachivantara/app-shell-navigation": "1.2.
|
|
42
|
+
"@hitachivantara/app-shell-navigation": "1.2.2",
|
|
43
43
|
"@hitachivantara/app-shell-shared": "1.2.0",
|
|
44
|
-
"@hitachivantara/uikit-react-core": "^5.
|
|
45
|
-
"@hitachivantara/uikit-react-icons": "^5.
|
|
44
|
+
"@hitachivantara/uikit-react-core": "^5.59.0",
|
|
45
|
+
"@hitachivantara/uikit-react-icons": "^5.9.2",
|
|
46
46
|
"@mui/material": "^5.12.3",
|
|
47
47
|
"i18next": "^23.7.7",
|
|
48
48
|
"i18next-browser-languagedetector": "^7.0.1",
|
|
@@ -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": "a574a14823dd07634e7fb7514af077894597519a"
|
|
72
72
|
}
|