wcz-layout 6.2.0 → 6.2.2

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.
@@ -123,6 +123,6 @@ export const Layout = ({ routes, colors, appVersion, user, notifications, setNot
123
123
  }, [title]);
124
124
  const toggleNavigationDrawer = () => setLeftDrawerOpen(!leftDrawerOpen);
125
125
  const hasNavigationRoutes = navigationRoutes.filter(route => route.showInMenu && !route.disabled).length > 1;
126
- return (_jsxs(ThemeProvider, { theme: theme, children: [_jsxs(Box, { sx: { display: "flex", position: "sticky" }, children: [_jsx(CssBaseline, {}), _jsx(AppBar, { position: "fixed", open: leftDrawerOpen, children: _jsxs(Toolbar, { children: [_jsx(IconButton, { color: "inherit", onClick: toggleNavigationDrawer, edge: "start", sx: { marginRight: 2, ...((leftDrawerOpen || !hasNavigationRoutes) && { display: "none" }) }, children: _jsx(Menu, {}) }), _jsx(Typography, { variant: "h6", noWrap: true, component: "div", sx: { flexGrow: 1 }, children: title }), environment !== "production" && _jsx(Chip, { sx: theme => ({ mr: 1, bgcolor: "secondary.main", color: theme.palette.primary.contrastText }), label: environment }), _jsx(NotificationMenu, { notifications: notifications, setNotifications: setNotifications }), _jsx(AccountMenu, { mode: mode, setMode: setMode, user: user })] }) }), _jsx(NavigationDrawer, { routes: navigationRoutes, appVersion: appVersion, open: leftDrawerOpen, setOpen: setLeftDrawerOpen, hasRoutes: hasNavigationRoutes }), _jsxs(Box, { component: "main", sx: { flex: 1, overflow: "auto" }, children: [_jsx(DrawerHeader, {}), (route.authenticated === false || user.isLoggedIn) && !route.disabled ? children : _jsx(Unauthorized, {})] })] }), _jsx(DevelopmentBanner, { user: user }), (isFetching || isMutating) && _jsx(LinearProgress, { sx: { position: "fixed", top: { xs: 56, sm: 64 }, left: 0, right: 0 } })] }));
126
+ return (_jsxs(ThemeProvider, { theme: theme, children: [_jsxs(Box, { sx: { display: "flex", position: "sticky" }, children: [_jsx(CssBaseline, {}), _jsx(AppBar, { position: "fixed", open: leftDrawerOpen, children: _jsxs(Toolbar, { children: [_jsx(IconButton, { color: "inherit", onClick: toggleNavigationDrawer, edge: "start", sx: { marginRight: 2, ...((leftDrawerOpen || !hasNavigationRoutes) && { display: "none" }) }, children: _jsx(Menu, {}) }), _jsx(Typography, { variant: "h6", noWrap: true, component: "div", sx: { flexGrow: 1 }, children: title }), environment !== "production" && _jsx(Chip, { sx: theme => ({ mr: 1, bgcolor: "secondary.main", color: theme.palette.primary.contrastText }), label: environment }), _jsx(NotificationMenu, { notifications: notifications, setNotifications: setNotifications }), _jsx(AccountMenu, { mode: mode, setMode: setMode, user: user })] }) }), _jsx(NavigationDrawer, { routes: navigationRoutes, appVersion: appVersion, open: leftDrawerOpen, setOpen: setLeftDrawerOpen, hasRoutes: hasNavigationRoutes }), _jsxs(Box, { component: "main", sx: { flex: 1, overflow: "auto" }, children: [_jsx(DrawerHeader, {}), (route.authenticated === false || user.isLoggedIn) && !route.disabled ? children : _jsx(Unauthorized, {})] })] }), _jsx(DevelopmentBanner, { user: user, hasNavigationRoutes: hasNavigationRoutes }), (isFetching || isMutating) && _jsx(LinearProgress, { sx: { position: "fixed", top: { xs: 56, sm: 64 }, left: 0, right: 0 } })] }));
127
127
  };
128
128
  //# sourceMappingURL=Layout.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Layout.js","sourceRoot":"","sources":["../../../src/components/Layout.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAC3C,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,IAAI,SAAS,EAAwC,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAClL,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,aAAa,E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AAC,IAAI,KAAC,cAAc,IAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,GAAI,IAC5G,CACnB,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { Menu } from \"@mui/icons-material\";\r\nimport { Box, Chip, CssBaseline, IconButton, LinearProgress, AppBar as MuiAppBar, AppBarProps as MuiAppBarProps, Theme, Toolbar, Typography, useMediaQuery } from \"@mui/material\";\r\nimport { grey } from \"@mui/material/colors\";\r\nimport { csCZ, enUS } from \"@mui/material/locale\";\r\nimport { ThemeProvider, createTheme, styled } from \"@mui/material/styles\";\r\nimport { csCZ as dataGridCsCz, enUS as dataGridEnUs } from \"@mui/x-data-grid-premium/locales\";\r\nimport { csCZ as datePickersCsCz, enUS as datePickersEnUs } from \"@mui/x-date-pickers-pro/locales\";\r\nimport { useIsFetching, useIsMutating } from \"@tanstack/react-query\";\r\nimport React, { Dispatch, SetStateAction, useEffect, useState } from \"react\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { matchPath, useLocation } from \"react-router-dom\";\r\nimport { LayoutPaletteColorOptions } from \"../models/LayoutPaletteColorOptions\";\r\nimport { LayoutRoute } from \"../models/LayoutRoute\";\r\nimport Notification from \"../models/Notification\";\r\nimport { User } from \"../models/User\";\r\nimport { environment } from \"../utils/Helpers\";\r\nimport { doLogin, initKeycloak, keycloak } from \"../utils/UserService\";\r\nimport { AccountMenu } from \"./layout/AccountMenu\";\r\nimport { DevelopmentBanner } from \"./layout/DevelopmentBanner\";\r\nimport { NavigationDrawer } from \"./layout/NavigationDrawer\";\r\nimport { NotificationMenu } from \"./layout/NotificationMenu\";\r\nimport { Unauthorized } from \"./layout/Unauthorized\";\r\nimport useLocalStorageState from \"use-local-storage-state\";\r\n\r\n//Drawer\r\nconst drawerWidth = 240;\r\nconst DrawerHeader = styled(\"div\")(({ theme }) => ({\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n justifyContent: \"flex-end\",\r\n padding: theme.spacing(0, 1),\r\n // necessary for content to be below app bar\r\n ...theme.mixins.toolbar,\r\n}));\r\n\r\n//AppBar\r\ninterface AppBarProps extends MuiAppBarProps {\r\n open?: boolean;\r\n}\r\n\r\nconst AppBar = styled(MuiAppBar, {\r\n shouldForwardProp: (prop) => prop !== \"open\",\r\n})<AppBarProps>(({ theme, open }) => ({\r\n zIndex: theme.zIndex.drawer + 1,\r\n transition: theme.transitions.create([\"width\", \"margin\"], {\r\n easing: theme.transitions.easing.sharp,\r\n duration: theme.transitions.duration.leavingScreen,\r\n }),\r\n ...(open && {\r\n marginLeft: drawerWidth,\r\n width: `calc(100% - ${drawerWidth}px)`,\r\n transition: theme.transitions.create([\"width\", \"margin\"], {\r\n easing: theme.transitions.easing.sharp,\r\n duration: theme.transitions.duration.enteringScreen,\r\n }),\r\n }),\r\n}));\r\n\r\nconst getAllRoutesWithPath = (routes: LayoutRoute[]): LayoutRoute[] => {\r\n let result: LayoutRoute[] = [];\r\n for (const route of routes) {\r\n if (route.path) {\r\n result.push(route);\r\n }\r\n if (route.children) {\r\n result = result.concat(getAllRoutesWithPath(route.children));\r\n }\r\n }\r\n return result;\r\n};\r\n\r\ninterface LayoutProps {\r\n routes: LayoutRoute[];\r\n appVersion: string;\r\n colors: LayoutPaletteColorOptions;\r\n children: React.ReactNode;\r\n user: User;\r\n notifications: Notification[] | undefined;\r\n setNotifications: Dispatch<SetStateAction<Notification[] | undefined>>;\r\n}\r\n\r\nexport const Layout: React.FC<LayoutProps> = ({ routes, colors, appVersion, user, notifications, setNotifications, children }) => {\r\n const prefersDarkMode: boolean = useMediaQuery(\"(prefers-color-scheme: dark)\");\r\n const [mode, setMode] = useLocalStorageState<\"light\" | \"dark\" | \"system\">(\"mui-mode\", { defaultValue: \"system\" });\r\n const [leftDrawerOpen, setLeftDrawerOpen] = useState<boolean>(false);\r\n const { i18n } = useTranslation();\r\n const isFetching = !!useIsFetching();\r\n const isMutating = !!useIsMutating();\r\n const location = useLocation();\r\n const navigationRoutes = getAllRoutesWithPath(routes);\r\n const route = navigationRoutes.find(r => matchPath(r.path!, location.pathname))!;\r\n\r\n useEffect(() => {\r\n if (route.authenticated !== false && !user.isLoggedIn)\r\n initKeycloak();\r\n }, [route, user]);\r\n\r\n keycloak.onTokenExpired = async () => {\r\n try {\r\n await keycloak.updateToken(30);\r\n } catch {\r\n if (route.authenticated !== false) {\r\n await doLogin();\r\n }\r\n }\r\n };\r\n\r\n const theme: Theme = createTheme({\r\n palette: {\r\n mode: mode === \"system\" ? prefersDarkMode ? \"dark\" : \"light\" : mode,\r\n primary: colors.primary,\r\n secondary: colors.secondary,\r\n background: colors.background ?? {},\r\n },\r\n components: {\r\n MuiCssBaseline: {\r\n styleOverrides: (theme) => ({\r\n body: {\r\n \"&::-webkit-scrollbar, & *::-webkit-scrollbar\": {\r\n width: \"0.7em\",\r\n height: \"0.7em\",\r\n },\r\n \"&::-webkit-scrollbar-track, & *::-webkit-scrollbar-track\": {\r\n backgroundColor: theme.palette.mode === \"dark\" ? grey[900] : grey[200],\r\n borderRadius: \"5px\",\r\n },\r\n \"&::-webkit-scrollbar-thumb, & *::-webkit-scrollbar-thumb\": {\r\n backgroundColor: theme.palette.mode === \"dark\" ? grey[800] : grey[400],\r\n borderRadius: \"10px\",\r\n },\r\n \"&::-webkit-scrollbar-thumb:hover, & *::-webkit-scrollbar-thumb:hover\": {\r\n backgroundColor: theme.palette.mode === \"dark\" ? grey[700] : grey[500],\r\n },\r\n \"&::-webkit-scrollbar-corner, & *::-webkit-scrollbar-corner\": {\r\n backgroundColor: \"transparent\",\r\n },\r\n },\r\n }),\r\n },\r\n },\r\n },\r\n i18n.language === \"cs\" ? datePickersCsCz : datePickersEnUs,\r\n i18n.language === \"cs\" ? dataGridCsCz : dataGridEnUs,\r\n i18n.language === \"cs\" ? csCZ : enUS\r\n );\r\n\r\n const title = route.pageTitle ?? route.title;\r\n\r\n useEffect(() => {\r\n if (title) document.title = title;\r\n }, [title]);\r\n\r\n const toggleNavigationDrawer = () => setLeftDrawerOpen(!leftDrawerOpen);\r\n\r\n const hasNavigationRoutes: boolean = navigationRoutes.filter(route => route.showInMenu && !route.disabled).length > 1;\r\n\r\n return (\r\n <ThemeProvider theme={theme}>\r\n <Box sx={{ display: \"flex\", position: \"sticky\" }}>\r\n <CssBaseline />\r\n <AppBar position=\"fixed\" open={leftDrawerOpen}>\r\n <Toolbar>\r\n <IconButton color=\"inherit\" onClick={toggleNavigationDrawer} edge=\"start\" sx={{ marginRight: 2, ...((leftDrawerOpen || !hasNavigationRoutes) && { display: \"none\" }) }} >\r\n <Menu />\r\n </IconButton>\r\n\r\n <Typography variant=\"h6\" noWrap component=\"div\" sx={{ flexGrow: 1 }}>{title}</Typography>\r\n\r\n {environment !== \"production\" && <Chip sx={theme => ({ mr: 1, bgcolor: \"secondary.main\", color: theme.palette.primary.contrastText })} label={environment} />}\r\n\r\n <NotificationMenu notifications={notifications} setNotifications={setNotifications} />\r\n <AccountMenu mode={mode} setMode={setMode} user={user} />\r\n </Toolbar>\r\n </AppBar>\r\n\r\n <NavigationDrawer routes={navigationRoutes} appVersion={appVersion} open={leftDrawerOpen} setOpen={setLeftDrawerOpen} hasRoutes={hasNavigationRoutes} />\r\n\r\n <Box component=\"main\" sx={{ flex: 1, overflow: \"auto\" }}>\r\n <DrawerHeader />\r\n {(route.authenticated === false || user.isLoggedIn) && !route.disabled ? children : <Unauthorized />}\r\n </Box>\r\n </Box>\r\n\r\n <DevelopmentBanner user={user} />\r\n {(isFetching || isMutating) && <LinearProgress sx={{ position: \"fixed\", top: { xs: 56, sm: 64 }, left: 0, right: 0 }} />}\r\n </ThemeProvider>\r\n );\r\n};\r\n"]}
1
+ {"version":3,"file":"Layout.js","sourceRoot":"","sources":["../../../src/components/Layout.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,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EAAE,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,aACnD,KAAC,YAAY,KAAG,EACf,CAAC,KAAK,CAAC,aAAa,KAAK,KAAK,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAC,YAAY,KAAG,IAClG,IACJ,EAEN,KAAC,iBAAiB,IAAC,IAAI,EAAE,IAAI,EAAE,mBAAmB,EAAE,mBAAmB,GAAI,EAC1E,CAAC,UAAU,IAAI,UAAU,CAAC,IAAI,KAAC,cAAc,IAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,GAAI,IAC5G,CACnB,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { Menu } from \"@mui/icons-material\";\r\nimport { Box, Chip, CssBaseline, IconButton, LinearProgress, AppBar as MuiAppBar, AppBarProps as MuiAppBarProps, Theme, Toolbar, Typography, useMediaQuery } from \"@mui/material\";\r\nimport { grey } from \"@mui/material/colors\";\r\nimport { csCZ, enUS } from \"@mui/material/locale\";\r\nimport { ThemeProvider, createTheme, styled } from \"@mui/material/styles\";\r\nimport { csCZ as dataGridCsCz, enUS as dataGridEnUs } from \"@mui/x-data-grid-premium/locales\";\r\nimport { csCZ as datePickersCsCz, enUS as datePickersEnUs } from \"@mui/x-date-pickers-pro/locales\";\r\nimport { useIsFetching, useIsMutating } from \"@tanstack/react-query\";\r\nimport React, { Dispatch, SetStateAction, useEffect, useState } from \"react\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { matchPath, useLocation } from \"react-router-dom\";\r\nimport { LayoutPaletteColorOptions } from \"../models/LayoutPaletteColorOptions\";\r\nimport { LayoutRoute } from \"../models/LayoutRoute\";\r\nimport Notification from \"../models/Notification\";\r\nimport { User } from \"../models/User\";\r\nimport { environment } from \"../utils/Helpers\";\r\nimport { doLogin, initKeycloak, keycloak } from \"../utils/UserService\";\r\nimport { AccountMenu } from \"./layout/AccountMenu\";\r\nimport { DevelopmentBanner } from \"./layout/DevelopmentBanner\";\r\nimport { NavigationDrawer } from \"./layout/NavigationDrawer\";\r\nimport { NotificationMenu } from \"./layout/NotificationMenu\";\r\nimport { Unauthorized } from \"./layout/Unauthorized\";\r\nimport useLocalStorageState from \"use-local-storage-state\";\r\n\r\n//Drawer\r\nconst drawerWidth = 240;\r\nconst DrawerHeader = styled(\"div\")(({ theme }) => ({\r\n display: \"flex\",\r\n alignItems: \"center\",\r\n justifyContent: \"flex-end\",\r\n padding: theme.spacing(0, 1),\r\n // necessary for content to be below app bar\r\n ...theme.mixins.toolbar,\r\n}));\r\n\r\n//AppBar\r\ninterface AppBarProps extends MuiAppBarProps {\r\n open?: boolean;\r\n}\r\n\r\nconst AppBar = styled(MuiAppBar, {\r\n shouldForwardProp: (prop) => prop !== \"open\",\r\n})<AppBarProps>(({ theme, open }) => ({\r\n zIndex: theme.zIndex.drawer + 1,\r\n transition: theme.transitions.create([\"width\", \"margin\"], {\r\n easing: theme.transitions.easing.sharp,\r\n duration: theme.transitions.duration.leavingScreen,\r\n }),\r\n ...(open && {\r\n marginLeft: drawerWidth,\r\n width: `calc(100% - ${drawerWidth}px)`,\r\n transition: theme.transitions.create([\"width\", \"margin\"], {\r\n easing: theme.transitions.easing.sharp,\r\n duration: theme.transitions.duration.enteringScreen,\r\n }),\r\n }),\r\n}));\r\n\r\nconst getAllRoutesWithPath = (routes: LayoutRoute[]): LayoutRoute[] => {\r\n let result: LayoutRoute[] = [];\r\n for (const route of routes) {\r\n if (route.path) {\r\n result.push(route);\r\n }\r\n if (route.children) {\r\n result = result.concat(getAllRoutesWithPath(route.children));\r\n }\r\n }\r\n return result;\r\n};\r\n\r\ninterface LayoutProps {\r\n routes: LayoutRoute[];\r\n appVersion: string;\r\n colors: LayoutPaletteColorOptions;\r\n children: React.ReactNode;\r\n user: User;\r\n notifications: Notification[] | undefined;\r\n setNotifications: Dispatch<SetStateAction<Notification[] | undefined>>;\r\n}\r\n\r\nexport const Layout: React.FC<LayoutProps> = ({ routes, colors, appVersion, user, notifications, setNotifications, children }) => {\r\n const prefersDarkMode: boolean = useMediaQuery(\"(prefers-color-scheme: dark)\");\r\n const [mode, setMode] = useLocalStorageState<\"light\" | \"dark\" | \"system\">(\"mui-mode\", { defaultValue: \"system\" });\r\n const [leftDrawerOpen, setLeftDrawerOpen] = useState<boolean>(false);\r\n const { i18n } = useTranslation();\r\n const isFetching = !!useIsFetching();\r\n const isMutating = !!useIsMutating();\r\n const location = useLocation();\r\n const navigationRoutes = getAllRoutesWithPath(routes);\r\n const route = navigationRoutes.find(r => matchPath(r.path!, location.pathname))!;\r\n\r\n useEffect(() => {\r\n if (route.authenticated !== false && !user.isLoggedIn)\r\n initKeycloak();\r\n }, [route, user]);\r\n\r\n keycloak.onTokenExpired = async () => {\r\n try {\r\n await keycloak.updateToken(30);\r\n } catch {\r\n if (route.authenticated !== false) {\r\n await doLogin();\r\n }\r\n }\r\n };\r\n\r\n const theme: Theme = createTheme({\r\n palette: {\r\n mode: mode === \"system\" ? prefersDarkMode ? \"dark\" : \"light\" : mode,\r\n primary: colors.primary,\r\n secondary: colors.secondary,\r\n background: colors.background ?? {},\r\n },\r\n components: {\r\n MuiCssBaseline: {\r\n styleOverrides: (theme) => ({\r\n body: {\r\n \"&::-webkit-scrollbar, & *::-webkit-scrollbar\": {\r\n width: \"0.7em\",\r\n height: \"0.7em\",\r\n },\r\n \"&::-webkit-scrollbar-track, & *::-webkit-scrollbar-track\": {\r\n backgroundColor: theme.palette.mode === \"dark\" ? grey[900] : grey[200],\r\n borderRadius: \"5px\",\r\n },\r\n \"&::-webkit-scrollbar-thumb, & *::-webkit-scrollbar-thumb\": {\r\n backgroundColor: theme.palette.mode === \"dark\" ? grey[800] : grey[400],\r\n borderRadius: \"10px\",\r\n },\r\n \"&::-webkit-scrollbar-thumb:hover, & *::-webkit-scrollbar-thumb:hover\": {\r\n backgroundColor: theme.palette.mode === \"dark\" ? grey[700] : grey[500],\r\n },\r\n \"&::-webkit-scrollbar-corner, & *::-webkit-scrollbar-corner\": {\r\n backgroundColor: \"transparent\",\r\n },\r\n },\r\n }),\r\n },\r\n },\r\n },\r\n i18n.language === \"cs\" ? datePickersCsCz : datePickersEnUs,\r\n i18n.language === \"cs\" ? dataGridCsCz : dataGridEnUs,\r\n i18n.language === \"cs\" ? csCZ : enUS\r\n );\r\n\r\n const title = route.pageTitle ?? route.title;\r\n\r\n useEffect(() => {\r\n if (title) document.title = title;\r\n }, [title]);\r\n\r\n const toggleNavigationDrawer = () => setLeftDrawerOpen(!leftDrawerOpen);\r\n\r\n const hasNavigationRoutes: boolean = navigationRoutes.filter(route => route.showInMenu && !route.disabled).length > 1;\r\n\r\n return (\r\n <ThemeProvider theme={theme}>\r\n <Box sx={{ display: \"flex\", position: \"sticky\" }}>\r\n <CssBaseline />\r\n <AppBar position=\"fixed\" open={leftDrawerOpen}>\r\n <Toolbar>\r\n <IconButton color=\"inherit\" onClick={toggleNavigationDrawer} edge=\"start\" sx={{ marginRight: 2, ...((leftDrawerOpen || !hasNavigationRoutes) && { display: \"none\" }) }} >\r\n <Menu />\r\n </IconButton>\r\n\r\n <Typography variant=\"h6\" noWrap component=\"div\" sx={{ flexGrow: 1 }}>{title}</Typography>\r\n\r\n {environment !== \"production\" && <Chip sx={theme => ({ mr: 1, bgcolor: \"secondary.main\", color: theme.palette.primary.contrastText })} label={environment} />}\r\n\r\n <NotificationMenu notifications={notifications} setNotifications={setNotifications} />\r\n <AccountMenu mode={mode} setMode={setMode} user={user} />\r\n </Toolbar>\r\n </AppBar>\r\n\r\n <NavigationDrawer routes={navigationRoutes} appVersion={appVersion} open={leftDrawerOpen} setOpen={setLeftDrawerOpen} hasRoutes={hasNavigationRoutes} />\r\n\r\n <Box component=\"main\" sx={{ flex: 1, overflow: \"auto\" }}>\r\n <DrawerHeader />\r\n {(route.authenticated === false || user.isLoggedIn) && !route.disabled ? children : <Unauthorized />}\r\n </Box>\r\n </Box>\r\n\r\n <DevelopmentBanner user={user} hasNavigationRoutes={hasNavigationRoutes} />\r\n {(isFetching || isMutating) && <LinearProgress sx={{ position: \"fixed\", top: { xs: 56, sm: 64 }, left: 0, right: 0 }} />}\r\n </ThemeProvider>\r\n );\r\n};\r\n"]}
@@ -1,6 +1,7 @@
1
1
  import { User } from "../../models/User";
2
2
  interface DevelopmentBannerProps {
3
3
  user: User;
4
+ hasNavigationRoutes: boolean;
4
5
  }
5
6
  export declare const DevelopmentBanner: React.FC<DevelopmentBannerProps>;
6
7
  export {};
@@ -1,11 +1,12 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Close } from "@mui/icons-material";
3
- import { Fade, Grid, IconButton, Paper, Typography } from "@mui/material";
3
+ import { Fade, Grid2, IconButton, Paper, Typography } from "@mui/material";
4
4
  import { useEffect, useState } from "react";
5
5
  import { useTranslation } from "react-i18next";
6
6
  import { environment } from "../../utils/Helpers";
7
7
  import { hasRole } from "../../utils/UserService";
8
- export const DevelopmentBanner = ({ user }) => {
8
+ import { grey } from "@mui/material/colors";
9
+ export const DevelopmentBanner = ({ user, hasNavigationRoutes }) => {
9
10
  const { t } = useTranslation();
10
11
  const [bannerOpen, setBannerOpen] = useState(false);
11
12
  useEffect(() => {
@@ -13,6 +14,16 @@ export const DevelopmentBanner = ({ user }) => {
13
14
  setBannerOpen(true);
14
15
  }, [user.isLoggedIn]);
15
16
  const closeBanner = () => setBannerOpen(false);
16
- return (_jsx(Fade, { appear: false, in: bannerOpen, children: _jsx(Paper, { square: true, variant: "outlined", tabIndex: -1, sx: { position: "fixed", bottom: 0, left: { xs: 0, sm: 67.7 }, right: 0, m: 0, p: 2, borderWidth: 0, borderTopWidth: 1 }, children: _jsxs(Grid, { container: true, justifyContent: "space-between", alignItems: "center", children: [_jsxs(Grid, { item: true, xs: true, children: [_jsx(Typography, { fontWeight: "bold", children: t("Layout.DevelopmentDialogTitle") }), _jsx(Typography, { variant: "body2", children: t("Layout.DevelopmentDialogContent") })] }), _jsx(Grid, { item: true, xs: 2, sx: { p: 1, textAlign: "right" }, children: _jsx(IconButton, { size: "small", onClick: closeBanner, children: _jsx(Close, {}) }) })] }) }) }));
17
+ return (_jsx(Fade, { appear: false, in: bannerOpen, children: _jsx(Paper, { square: true, variant: "outlined", tabIndex: -1, sx: theme => ({
18
+ position: "fixed",
19
+ bottom: 0,
20
+ left: { xs: 0, sm: hasNavigationRoutes ? 68.7 : 0 },
21
+ right: 0,
22
+ m: 0,
23
+ p: 2,
24
+ borderWidth: 0,
25
+ borderTopWidth: 1,
26
+ bgcolor: theme.palette.mode === "dark" ? grey[900] : grey[100]
27
+ }), children: _jsxs(Grid2, { container: true, justifyContent: "space-between", alignItems: "center", children: [_jsxs(Grid2, { size: 10, children: [_jsx(Typography, { fontWeight: "bold", children: t("Layout.DevelopmentDialogTitle") }), _jsx(Typography, { variant: "body2", children: t("Layout.DevelopmentDialogContent") })] }), _jsx(Grid2, { size: 2, sx: { p: 1, textAlign: "right" }, children: _jsx(IconButton, { size: "small", onClick: closeBanner, children: _jsx(Close, {}) }) })] }) }) }));
17
28
  };
18
29
  //# sourceMappingURL=DevelopmentBanner.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DevelopmentBanner.js","sourceRoot":"","sources":["../../../../src/components/layout/DevelopmentBanner.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,OAAO,EA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,GAAc,EAC/E,KAAC,UAAU,IAAC,OAAO,EAAC,OAAO,YAAE,CAAC,CAAC,iCAAiC,CAAC,GAAc,IAC5E,EAEP,KAAC,IAAI,IAAC,IAAI,QAAC,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,YAC9C,KAAC,UAAU,IAAC,IAAI,EAAC,OAAO,EAAC,OAAO,EAAE,WAAW,YACzC,KAAC,KAAK,KAAG,GACA,GACV,IACJ,GACH,GACL,CACV,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { Close } from \"@mui/icons-material\";\r\nimport { Fade, Grid, IconButton, Paper, Typography } from \"@mui/material\";\r\nimport { useEffect, useState } from \"react\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { User } from \"../../models/User\";\r\nimport { environment } from \"../../utils/Helpers\";\r\nimport { hasRole } from \"../../utils/UserService\";\r\n\r\ninterface DevelopmentBannerProps {\r\n user: User;\r\n}\r\n\r\nexport const DevelopmentBanner: React.FC<DevelopmentBannerProps> = ({ user }) => {\r\n const { t } = useTranslation();\r\n const [bannerOpen, setBannerOpen] = useState<boolean>(false);\r\n\r\n useEffect(() => {\r\n if (user.isLoggedIn && !hasRole([\"wcz-developers\"]) && environment === \"development\")\r\n setBannerOpen(true);\r\n }, [user.isLoggedIn]);\r\n\r\n const closeBanner = () => setBannerOpen(false);\r\n\r\n return (\r\n <Fade appear={false} in={bannerOpen}>\r\n <Paper square variant=\"outlined\" tabIndex={-1} sx={{ position: \"fixed\", bottom: 0, left: { xs: 0, sm: 67.7 }, right: 0, m: 0, p: 2, borderWidth: 0, borderTopWidth: 1 }} >\r\n <Grid container justifyContent=\"space-between\" alignItems=\"center\">\r\n <Grid item xs>\r\n <Typography fontWeight=\"bold\">{t(\"Layout.DevelopmentDialogTitle\")}</Typography>\r\n <Typography variant=\"body2\">{t(\"Layout.DevelopmentDialogContent\")}</Typography>\r\n </Grid>\r\n\r\n <Grid item xs={2} sx={{ p: 1, textAlign: \"right\" }}>\r\n <IconButton size=\"small\" onClick={closeBanner}>\r\n <Close />\r\n </IconButton>\r\n </Grid>\r\n </Grid>\r\n </Paper>\r\n </Fade>\r\n );\r\n};"]}
1
+ {"version":3,"file":"DevelopmentBanner.js","sourceRoot":"","sources":["../../../../src/components/layout/DevelopmentBanner.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAC;AAO5C,MAAM,CAAC,MAAM,iBAAiB,GAAqC,CAAC,EAAE,IAAI,EAAE,mBAAmB,EAAE,EAAE,EAAE;IACjG,MAAM,EAAE,CAAC,EAAE,GAAG,cAAc,EAAE,CAAC;IAC/B,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAU,KAAK,CAAC,CAAC;IAE7D,SAAS,CAAC,GAAG,EAAE;QACX,IAAI,IAAI,CAAC,UAAU,IAAI,CAAC,OAAO,CAAC,CAAC,gBAAgB,CAAC,CAAC,IAAI,WAAW,KAAK,aAAa;YAChF,aAAa,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;IAEtB,MAAM,WAAW,GAAG,GAAG,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAE/C,OAAO,CACH,KAAC,IAAI,IAAC,MAAM,E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paper, Typography } from \"@mui/material\";\r\nimport { useEffect, useState } from \"react\";\r\nimport { useTranslation } from \"react-i18next\";\r\nimport { User } from \"../../models/User\";\r\nimport { environment } from \"../../utils/Helpers\";\r\nimport { hasRole } from \"../../utils/UserService\";\r\nimport { grey } from \"@mui/material/colors\";\r\n\r\ninterface DevelopmentBannerProps {\r\n user: User;\r\n hasNavigationRoutes: boolean;\r\n}\r\n\r\nexport const DevelopmentBanner: React.FC<DevelopmentBannerProps> = ({ user, hasNavigationRoutes }) => {\r\n const { t } = useTranslation();\r\n const [bannerOpen, setBannerOpen] = useState<boolean>(false);\r\n\r\n useEffect(() => {\r\n if (user.isLoggedIn && !hasRole([\"wcz-developers\"]) && environment === \"development\")\r\n setBannerOpen(true);\r\n }, [user.isLoggedIn]);\r\n\r\n const closeBanner = () => setBannerOpen(false);\r\n\r\n return (\r\n <Fade appear={false} in={bannerOpen}>\r\n <Paper square variant=\"outlined\" tabIndex={-1} sx={theme => ({\r\n position: \"fixed\",\r\n bottom: 0,\r\n left: { xs: 0, sm: hasNavigationRoutes ? 68.7 : 0 },\r\n right: 0,\r\n m: 0,\r\n p: 2,\r\n borderWidth: 0,\r\n borderTopWidth: 1,\r\n bgcolor: theme.palette.mode === \"dark\" ? grey[900] : grey[100]\r\n })}>\r\n <Grid2 container justifyContent=\"space-between\" alignItems=\"center\">\r\n <Grid2 size={10}>\r\n <Typography fontWeight=\"bold\">{t(\"Layout.DevelopmentDialogTitle\")}</Typography>\r\n <Typography variant=\"body2\">{t(\"Layout.DevelopmentDialogContent\")}</Typography>\r\n </Grid2>\r\n\r\n <Grid2 size={2} sx={{ p: 1, textAlign: \"right\" }}>\r\n <IconButton size=\"small\" onClick={closeBanner}>\r\n <Close />\r\n </IconButton>\r\n </Grid2>\r\n </Grid2>\r\n </Paper>\r\n </Fade>\r\n );\r\n};"]}
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Stack, Typography } from "@mui/material";
3
3
  const stackSxProps = [
4
- "margin", "marginTop", "marginRight", "marginBottom", "marginLeft", "m", "mt", "mr", "mb", "ml",
5
- "padding", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft", "p", "pt", "pr", "pb", "pl",
4
+ "margin", "marginTop", "marginRight", "marginBottom", "marginLeft", "m", "mt", "mr", "mb", "ml", "mx", "my",
5
+ "padding", "paddingTop", "paddingRight", "paddingBottom", "paddingLeft", "p", "pt", "pr", "pb", "pl", "px", "py",
6
6
  "flexGrow", "flexShrink", "flexBasis", "flexDirection", "alignItems", "justifyContent",
7
7
  "position", "zIndex", "top", "right", "bottom", "left",
8
8
  "gridGap", "gridColumnGap", "gridRowGap", "gridColumn", "gridRow", "gridAutoFlow",
@@ -1 +1 @@
1
- {"version":3,"file":"TypographyWithIcon.js","sourceRoot":"","sources":["../../../../src/components/layout/TypographyWithIcon.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAkB,UAAU,EAAmB,MAAM,eAAe,CAAC;AAEnF,MAAM,YAAY,GAAG;IACjB,QAAQ,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,EAAE,YAAY,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;IAC/F,SAAS,EAAE,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,aAAa,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;IACpG,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,YAAY,EAAE,gBAAgB;IACtF,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM;IACtD,SAAS,EAAE,eAAe,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,cAAc;IACjF,KAAK,EAAE,WAAW,EAAE,QAAQ;CAC/B,CAAC;AAOF,MAAM,CAAC,MAAM,kBAAkB,GAAsC,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,YAAY,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IAClI,MAAM,MAAM,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC;IAEzB,MAAM,WAAW,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;QAClD,IAAI,MAAM,IAAK,MAAc,CAAC,IAAI,CAAC,EAAE,CAAC;YACjC,GAAW,CAAC,IAAI,CAAC,GAAI,MAAc,CAAC,IAAI,CAAC,CAAC;YAC3C,OAAQ,MAAc,CAAC,IAAI,CAAC,CAAC;QACjC,CAAC;QACD,OAAO,GAAG,CAAC;IACf,CAAC,EAAE,EAAoB,CAAC,CAAC;IAEzB,OAAO,CACH,MAAC,KAAK,IAAC,SAAS,EAAC,KAAK,EAAC,UAAU,EAAC,QAAQ,EAAC,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,aACjG,SAAS,IAAI,SAAS,EACvB,KAAC,UAAU,OAAK,KAAK,EAAE,EAAE,EAAE,MAAM,YAAG,QAAQ,GAAc,EACzD,OAAO,IAAI,OAAO,IACf,CACX,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { Stack, SxProps, Theme, Typography, TypographyProps } from \"@mui/material\";\r\n\r\nconst stackSxProps = [\r\n \"margin\", \"marginTop\", \"marginRight\", \"marginBottom\", \"marginLeft\", \"m\", \"mt\", \"mr\", \"mb\", \"ml\",\r\n \"padding\", \"paddingTop\", \"paddingRight\", \"paddingBottom\", \"paddingLeft\", \"p\", \"pt\", \"pr\", \"pb\", \"pl\",\r\n \"flexGrow\", \"flexShrink\", \"flexBasis\", \"flexDirection\", \"alignItems\", \"justifyContent\",\r\n \"position\", \"zIndex\", \"top\", \"right\", \"bottom\", \"left\",\r\n \"gridGap\", \"gridColumnGap\", \"gridRowGap\", \"gridColumn\", \"gridRow\", \"gridAutoFlow\",\r\n \"gap\", \"columnGap\", \"rowGap\"\r\n];\r\n\r\ninterface TypographyWithIconProps extends TypographyProps {\r\n startIcon?: React.ReactNode;\r\n endIcon?: React.ReactNode;\r\n}\r\n\r\nexport const TypographyWithIcon: React.FC<TypographyWithIconProps> = ({ startIcon, endIcon, children, sx, gutterBottom, ...props }) => {\r\n const sxCopy = { ...sx };\r\n\r\n const stackStyles = stackSxProps.reduce((acc, curr) => {\r\n if (sxCopy && (sxCopy as any)[curr]) {\r\n (acc as any)[curr] = (sxCopy as any)[curr];\r\n delete (sxCopy as any)[curr];\r\n }\r\n return acc;\r\n }, {} as SxProps<Theme>);\r\n\r\n return (\r\n <Stack direction=\"row\" alignItems=\"center\" gap={1} sx={stackStyles} mb={gutterBottom ? 0.7 : undefined}>\r\n {startIcon && startIcon}\r\n <Typography {...props} sx={sxCopy}>{children}</Typography>\r\n {endIcon && endIcon}\r\n </Stack>\r\n );\r\n};"]}
1
+ {"version":3,"file":"TypographyWithIcon.js","sourceRoot":"","sources":["../../../../src/components/layout/TypographyWithIcon.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAkB,UAAU,EAAmB,MAAM,eAAe,CAAC;AAEnF,MAAM,YAAY,GAAG;IACjB,QAAQ,EAAE,WAAW,EAAE,aAAa,EAAE,cAAc,EAAE,YAAY,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;IAC3G,SAAS,EAAE,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,aAAa,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI;IAChH,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,YAAY,EAAE,gBAAgB;IACtF,UAAU,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM;IACtD,SAAS,EAAE,eAAe,EAAE,YAAY,EAAE,YAAY,EAAE,SAAS,EAAE,cAAc;IACjF,KAAK,EAAE,WAAW,EAAE,QAAQ;CAC/B,CAAC;AAOF,MAAM,CAAC,MAAM,kBAAkB,GAAsC,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,YAAY,EAAE,GAAG,KAAK,EAAE,EAAE,EAAE;IAClI,MAAM,MAAM,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC;IAEzB,MAAM,WAAW,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE;QAClD,IAAI,MAAM,IAAK,MAAc,CAAC,IAAI,CAAC,EAAE,CAAC;YACjC,GAAW,CAAC,IAAI,CAAC,GAAI,MAAc,CAAC,IAAI,CAAC,CAAC;YAC3C,OAAQ,MAAc,CAAC,IAAI,CAAC,CAAC;QACjC,CAAC;QACD,OAAO,GAAG,CAAC;IACf,CAAC,EAAE,EAAoB,CAAC,CAAC;IAEzB,OAAO,CACH,MAAC,KAAK,IAAC,SAAS,EAAC,KAAK,EAAC,UAAU,EAAC,QAAQ,EAAC,GAAG,EAAE,CAAC,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,aACjG,SAAS,IAAI,SAAS,EACvB,KAAC,UAAU,OAAK,KAAK,EAAE,EAAE,EAAE,MAAM,YAAG,QAAQ,GAAc,EACzD,OAAO,IAAI,OAAO,IACf,CACX,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { Stack, SxProps, Theme, Typography, TypographyProps } from \"@mui/material\";\r\n\r\nconst stackSxProps = [\r\n \"margin\", \"marginTop\", \"marginRight\", \"marginBottom\", \"marginLeft\", \"m\", \"mt\", \"mr\", \"mb\", \"ml\", \"mx\", \"my\",\r\n \"padding\", \"paddingTop\", \"paddingRight\", \"paddingBottom\", \"paddingLeft\", \"p\", \"pt\", \"pr\", \"pb\", \"pl\", \"px\", \"py\",\r\n \"flexGrow\", \"flexShrink\", \"flexBasis\", \"flexDirection\", \"alignItems\", \"justifyContent\",\r\n \"position\", \"zIndex\", \"top\", \"right\", \"bottom\", \"left\",\r\n \"gridGap\", \"gridColumnGap\", \"gridRowGap\", \"gridColumn\", \"gridRow\", \"gridAutoFlow\",\r\n \"gap\", \"columnGap\", \"rowGap\"\r\n];\r\n\r\ninterface TypographyWithIconProps extends TypographyProps {\r\n startIcon?: React.ReactNode;\r\n endIcon?: React.ReactNode;\r\n}\r\n\r\nexport const TypographyWithIcon: React.FC<TypographyWithIconProps> = ({ startIcon, endIcon, children, sx, gutterBottom, ...props }) => {\r\n const sxCopy = { ...sx };\r\n\r\n const stackStyles = stackSxProps.reduce((acc, curr) => {\r\n if (sxCopy && (sxCopy as any)[curr]) {\r\n (acc as any)[curr] = (sxCopy as any)[curr];\r\n delete (sxCopy as any)[curr];\r\n }\r\n return acc;\r\n }, {} as SxProps<Theme>);\r\n\r\n return (\r\n <Stack direction=\"row\" alignItems=\"center\" gap={1} sx={stackStyles} mb={gutterBottom ? 0.7 : undefined}>\r\n {startIcon && startIcon}\r\n <Typography {...props} sx={sxCopy}>{children}</Typography>\r\n {endIcon && endIcon}\r\n </Stack>\r\n );\r\n};"]}