wcz-layout 6.2.1 → 6.2.3

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.
@@ -1,16 +1,19 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Close } from "@mui/icons-material";
3
- import { AppBar, DialogActions, DialogContent, DialogTitle, Grid, IconButton, Dialog as MaterialDialog, Toolbar, Typography, useMediaQuery } from "@mui/material";
3
+ import { AppBar, Dialog as MaterialDialog, DialogActions, DialogContent, DialogTitle, Grid, IconButton, LinearProgress, Toolbar, Typography, useMediaQuery } from "@mui/material";
4
4
  import { useTheme } from "@mui/material/styles";
5
+ import { useIsFetching, useIsMutating } from "@tanstack/react-query";
5
6
  import { Fragment } from "react";
6
7
  import { LayoutSnackbar } from "./LayoutSnackbar";
7
8
  export const Dialog = ({ open, onClose, title, subtitle, children, color, maxWidth, actions, disablePadding, disableAutoClose }) => {
8
9
  const theme = useTheme();
9
10
  const fullScreen = useMediaQuery(theme.breakpoints.down("sm"));
11
+ const isFetching = !!useIsFetching();
12
+ const isMutating = !!useIsMutating();
10
13
  return (_jsxs(MaterialDialog, { open: open, onClose: disableAutoClose ? undefined : onClose, fullScreen: fullScreen, fullWidth: true, maxWidth: maxWidth, children: [fullScreen ?
11
- _jsx(Fragment, { children: _jsx(AppBar, { sx: { position: "relative", bgcolor: `${color}.main` }, children: _jsxs(Toolbar, { children: [_jsxs(Typography, { sx: { flex: 1 }, variant: "h6", children: [title, subtitle && _jsx(Typography, { variant: "body2", sx: { opacity: 0.5 }, children: subtitle })] }), _jsx(IconButton, { edge: "start", onClick: onClose, children: _jsx(Close, { sx: { color: `${color}.contrastText` } }) })] }) }) })
14
+ _jsxs(Fragment, { children: [_jsx(AppBar, { sx: { position: "relative", bgcolor: `${color}.main` }, children: _jsxs(Toolbar, { children: [_jsxs(Typography, { sx: { flex: 1 }, variant: "h6", children: [title, subtitle && _jsx(Typography, { variant: "body2", sx: { opacity: 0.5 }, children: subtitle })] }), _jsx(IconButton, { edge: "start", onClick: onClose, children: _jsx(Close, { sx: { color: `${color}.contrastText` } }) })] }) }), (isFetching || isMutating) && _jsx(LinearProgress, { color: color === "default" ? undefined : color })] })
12
15
  :
13
- _jsx(Fragment, { children: _jsxs(Grid, { container: true, justifyContent: "space-between", sx: { bgcolor: `${color}.main`, color: `${color}.contrastText` }, children: [_jsx(Grid, { item: true, xs: true, children: _jsxs(DialogTitle, { children: [title, subtitle && _jsx(Typography, { variant: "body2", sx: { opacity: 0.5 }, children: subtitle })] }) }), _jsx(Grid, { item: true, xs: 2, sx: { p: 1, textAlign: "right" }, children: _jsx(IconButton, { onClick: onClose, children: _jsx(Close, { fontSize: "small", sx: { color: `${color}.contrastText` } }) }) })] }) }), disablePadding ? children : _jsx(DialogContent, { children: children }), actions &&
16
+ _jsxs(Fragment, { children: [_jsxs(Grid, { container: true, justifyContent: "space-between", sx: { bgcolor: `${color}.main`, color: `${color}.contrastText` }, children: [_jsx(Grid, { item: true, xs: true, children: _jsxs(DialogTitle, { children: [title, subtitle && _jsx(Typography, { variant: "body2", sx: { opacity: 0.5 }, children: subtitle })] }) }), _jsx(Grid, { item: true, xs: 2, sx: { p: 1, textAlign: "right" }, children: _jsx(IconButton, { onClick: onClose, children: _jsx(Close, { fontSize: "small", sx: { color: `${color}.contrastText` } }) }) })] }), (isFetching || isMutating) && _jsx(LinearProgress, { color: color === "default" ? undefined : color })] }), disablePadding ? children : _jsx(DialogContent, { children: children }), actions &&
14
17
  _jsx(DialogActions, { children: actions.map(action => action) }), _jsx(LayoutSnackbar, {})] }));
15
18
  };
16
19
  //# sourceMappingURL=Dialog.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Dialog.js","sourceRoot":"","sources":["../../../src/components/Dialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAc,aAAa,EAAE,aAAa,E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AAC,OAAO,EAAE,OAAO,YACrC,KAAC,KAAK,IAAC,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,KAAK,eAAe,EAAE,GAAI,GACxC,IACP,GACL,GACF;gBACX,CAAC;oBACD,KAAC,QAAQ,cACL,MAAC,IAAI,IAAC,SAAS,QAAC,cAAc,EAAC,eAAe,EAAC,EAAE,EAAE,EAAE,OAAO,EAAE,GAAG,KAAK,OAAO,EAAE,KAAK,EAAE,GAAG,KAAK,eAAe,EAAE,aAC3G,KAAC,IAAI,IAAC,IAAI,QAAC,EAAE,kBACT,MAAC,WAAW,eACP,KAAK,EACL,QAAQ,IAAI,KAAC,UAAU,IAAC,OAAO,EAAC,OAAO,EAAC,EAAE,EAAE,EAAE,OAAO,EAAE,GAAG,EAAE,YAAG,QAAQ,GAAc,IAC5E,GACX,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,OAAO,EAAE,OAAO,YACxB,KAAC,KAAK,IAAC,QAAQ,EAAC,OAAO,EAAC,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,KAAK,eAAe,EAAE,GAAI,GACzD,GACV,IACJ,GACA,EAGd,cAAc,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAC,aAAa,cAAE,QAAQ,GAAiB,EAErE,OAAO;gBACJ,KAAC,aAAa,cACT,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,GAClB,EAGpB,KAAC,cAAc,KAAG,IACL,CACpB,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { Close } from \"@mui/icons-material\";\r\nimport { AppBar, Breakpoint, DialogActions, DialogContent, DialogTitle, Grid, IconButton, Dialog as MaterialDialog, Toolbar, Typography, useMediaQuery } from \"@mui/material\";\r\nimport { useTheme } from \"@mui/material/styles\";\r\nimport { Fragment, ReactNode } from \"react\";\r\nimport { LayoutSnackbar } from \"./LayoutSnackbar\";\r\n\r\ninterface DialogProps {\r\n children?: ReactNode,\r\n title: string | ReactNode;\r\n subtitle?: string | ReactNode;\r\n open: boolean;\r\n onClose: () => void;\r\n color?: \"success\" | \"info\" | \"warning\" | \"error\" | \"primary\" | \"secondary\" | \"inherit\" | \"default\";\r\n maxWidth?: Breakpoint;\r\n actions?: ReactNode[];\r\n disablePadding?: boolean;\r\n disableAutoClose?: boolean;\r\n}\r\n\r\nexport const Dialog: React.FC<DialogProps> = ({ open, onClose, title, subtitle, children, color, maxWidth, actions, disablePadding, disableAutoClose }) => {\r\n const theme = useTheme();\r\n const fullScreen = useMediaQuery(theme.breakpoints.down(\"sm\"));\r\n\r\n return (\r\n <MaterialDialog open={open} onClose={disableAutoClose ? undefined : onClose} fullScreen={fullScreen} fullWidth maxWidth={maxWidth}>\r\n {fullScreen ?\r\n <Fragment>\r\n <AppBar sx={{ position: \"relative\", bgcolor: `${color}.main` }}>\r\n <Toolbar>\r\n <Typography sx={{ flex: 1 }} variant=\"h6\">\r\n {title}\r\n {subtitle && <Typography variant=\"body2\" sx={{ opacity: 0.5 }}>{subtitle}</Typography>}\r\n </Typography>\r\n <IconButton edge=\"start\" onClick={onClose}>\r\n <Close sx={{ color: `${color}.contrastText` }} />\r\n </IconButton>\r\n </Toolbar>\r\n </AppBar>\r\n </Fragment>\r\n :\r\n <Fragment>\r\n <Grid container justifyContent=\"space-between\" sx={{ bgcolor: `${color}.main`, color: `${color}.contrastText` }}>\r\n <Grid item xs>\r\n <DialogTitle>\r\n {title}\r\n {subtitle && <Typography variant=\"body2\" sx={{ opacity: 0.5 }}>{subtitle}</Typography>}\r\n </DialogTitle>\r\n </Grid>\r\n\r\n <Grid item xs={2} sx={{ p: 1, textAlign: \"right\" }}>\r\n <IconButton onClick={onClose}>\r\n <Close fontSize=\"small\" sx={{ color: `${color}.contrastText` }} />\r\n </IconButton>\r\n </Grid>\r\n </Grid>\r\n </Fragment>\r\n }\r\n\r\n {disablePadding ? children : <DialogContent>{children}</DialogContent>}\r\n\r\n {actions &&\r\n <DialogActions>\r\n {actions.map(action => action)}\r\n </DialogActions>\r\n }\r\n\r\n <LayoutSnackbar />\r\n </MaterialDialog>\r\n );\r\n};\r\n"]}
1
+ {"version":3,"file":"Dialog.js","sourceRoot":"","sources":["../../../src/components/Dialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAC5C,OAAO,EAAE,MAAM,EAAc,MAAM,IAAI,cAAc,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,IAAI,EAAE,UAAU,EAAE,cAAc,EAAE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9L,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,EAAE,QAAQ,EAAa,MAAM,OAAO,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAelD,MAAM,CAAC,MAAM,MAAM,GAA0B,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,cAAc,EAAE,gBAAgB,EAAE,EAAE,EAAE;IACtJ,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,MAAM,UAAU,GAAG,aAAa,CAAC,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC/D,MAAM,UAAU,GAAG,CAAC,CAAC,aAAa,EAAE,CAAC;IACrC,MAAM,UAAU,GAAG,CAAC,CAAC,aAAa,EAAE,CAAC;IAErC,OAAO,CACH,MAAC,cAAc,IAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,gB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,IAAC,IAAI,QAAC,EAAE,EAAE,CAAC,EAAE,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE,SAAS,EAAE,OAAO,EAAE,YAC9C,KAAC,UAAU,IAAC,OAAO,EAAE,OAAO,YACxB,KAAC,KAAK,IAAC,QAAQ,EAAC,OAAO,EAAC,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,KAAK,eAAe,EAAE,GAAI,GACzD,GACV,IACJ,EACN,CAAC,UAAU,IAAI,UAAU,CAAC,IAAI,KAAC,cAAc,IAAC,KAAK,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,GAAI,IAC1F,EAGd,cAAc,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAC,aAAa,cAAE,QAAQ,GAAiB,EAErE,OAAO;gBACJ,KAAC,aAAa,cACT,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,GAClB,EAGpB,KAAC,cAAc,KAAG,IACL,CACpB,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { Close } from \"@mui/icons-material\";\r\nimport { AppBar, Breakpoint, Dialog as MaterialDialog, DialogActions, DialogContent, DialogTitle, Grid, IconButton, LinearProgress, Toolbar, Typography, useMediaQuery } from \"@mui/material\";\r\nimport { useTheme } from \"@mui/material/styles\";\r\nimport { useIsFetching, useIsMutating } from \"@tanstack/react-query\";\r\nimport { Fragment, ReactNode } from \"react\";\r\nimport { LayoutSnackbar } from \"./LayoutSnackbar\";\r\n\r\ninterface DialogProps {\r\n children?: ReactNode,\r\n title: string | ReactNode;\r\n subtitle?: string | ReactNode;\r\n open: boolean;\r\n onClose: () => void;\r\n color?: \"success\" | \"info\" | \"warning\" | \"error\" | \"primary\" | \"secondary\" | \"inherit\" | \"default\";\r\n maxWidth?: Breakpoint;\r\n actions?: ReactNode[];\r\n disablePadding?: boolean;\r\n disableAutoClose?: boolean;\r\n}\r\n\r\nexport const Dialog: React.FC<DialogProps> = ({ open, onClose, title, subtitle, children, color, maxWidth, actions, disablePadding, disableAutoClose }) => {\r\n const theme = useTheme();\r\n const fullScreen = useMediaQuery(theme.breakpoints.down(\"sm\"));\r\n const isFetching = !!useIsFetching();\r\n const isMutating = !!useIsMutating();\r\n\r\n return (\r\n <MaterialDialog open={open} onClose={disableAutoClose ? undefined : onClose} fullScreen={fullScreen} fullWidth maxWidth={maxWidth}>\r\n {fullScreen ?\r\n <Fragment>\r\n <AppBar sx={{ position: \"relative\", bgcolor: `${color}.main` }}>\r\n <Toolbar>\r\n <Typography sx={{ flex: 1 }} variant=\"h6\">\r\n {title}\r\n {subtitle && <Typography variant=\"body2\" sx={{ opacity: 0.5 }}>{subtitle}</Typography>}\r\n </Typography>\r\n <IconButton edge=\"start\" onClick={onClose}>\r\n <Close sx={{ color: `${color}.contrastText` }} />\r\n </IconButton>\r\n </Toolbar>\r\n </AppBar>\r\n {(isFetching || isMutating) && <LinearProgress color={color === \"default\" ? undefined : color} />}\r\n </Fragment>\r\n :\r\n <Fragment>\r\n <Grid container justifyContent=\"space-between\" sx={{ bgcolor: `${color}.main`, color: `${color}.contrastText` }}>\r\n <Grid item xs>\r\n <DialogTitle>\r\n {title}\r\n {subtitle && <Typography variant=\"body2\" sx={{ opacity: 0.5 }}>{subtitle}</Typography>}\r\n </DialogTitle>\r\n </Grid>\r\n\r\n <Grid item xs={2} sx={{ p: 1, textAlign: \"right\" }}>\r\n <IconButton onClick={onClose}>\r\n <Close fontSize=\"small\" sx={{ color: `${color}.contrastText` }} />\r\n </IconButton>\r\n </Grid>\r\n </Grid>\r\n {(isFetching || isMutating) && <LinearProgress color={color === \"default\" ? undefined : color} />}\r\n </Fragment>\r\n }\r\n\r\n {disablePadding ? children : <DialogContent>{children}</DialogContent>}\r\n\r\n {actions &&\r\n <DialogActions>\r\n {actions.map(action => action)}\r\n </DialogActions>\r\n }\r\n\r\n <LayoutSnackbar />\r\n </MaterialDialog>\r\n );\r\n};\r\n"]}
@@ -58,7 +58,7 @@ const getAllRoutesWithPath = (routes) => {
58
58
  return result;
59
59
  };
60
60
  export const Layout = ({ routes, colors, appVersion, user, notifications, setNotifications, children }) => {
61
- var _a, _b;
61
+ var _a, _b, _c, _d, _e;
62
62
  const prefersDarkMode = useMediaQuery("(prefers-color-scheme: dark)");
63
63
  const [mode, setMode] = useLocalStorageState("mui-mode", { defaultValue: "system" });
64
64
  const [leftDrawerOpen, setLeftDrawerOpen] = useState(false);
@@ -82,12 +82,13 @@ export const Layout = ({ routes, colors, appVersion, user, notifications, setNot
82
82
  }
83
83
  }
84
84
  };
85
+ const resolvedMode = mode === "system" ? (prefersDarkMode ? "dark" : "light") : mode;
85
86
  const theme = createTheme({
86
87
  palette: {
87
- mode: mode === "system" ? prefersDarkMode ? "dark" : "light" : mode,
88
- primary: colors.primary,
89
- secondary: colors.secondary,
90
- background: (_a = colors.background) !== null && _a !== void 0 ? _a : {},
88
+ mode: resolvedMode,
89
+ primary: { main: ((_a = colors.primary) === null || _a === void 0 ? void 0 : _a[resolvedMode]) || ((_b = colors.primary) === null || _b === void 0 ? void 0 : _b.main), },
90
+ secondary: { main: ((_c = colors.secondary) === null || _c === void 0 ? void 0 : _c[resolvedMode]) || ((_d = colors.secondary) === null || _d === void 0 ? void 0 : _d.main), },
91
+ background: resolvedMode === "light" && colors.background ? { default: colors.background.default, paper: colors.background.paper, } : {},
91
92
  },
92
93
  components: {
93
94
  MuiCssBaseline: {
@@ -116,7 +117,7 @@ export const Layout = ({ routes, colors, appVersion, user, notifications, setNot
116
117
  },
117
118
  },
118
119
  }, i18n.language === "cs" ? datePickersCsCz : datePickersEnUs, i18n.language === "cs" ? dataGridCsCz : dataGridEnUs, i18n.language === "cs" ? csCZ : enUS);
119
- const title = (_b = route.pageTitle) !== null && _b !== void 0 ? _b : route.title;
120
+ const title = (_e = route.pageTitle) !== null && _e !== void 0 ? _e : route.title;
120
121
  useEffect(() => {
121
122
  if (title)
122
123
  document.title = title;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AiB,EAAE,SAAS,EAAE,mBAAmB,GAAI,EAExJ,MAAC,GAAG,IAAC,SAAS,EAAC,MAAM,EAAC,EAAE,EAAE,EAAE,IAAI,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
+ {"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,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,EAAE,IAAI,IAAI,YAAY,EAAE,IAAI,IAAI,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAC9F,OAAO,EAAE,IAAI,IAAI,eAAe,EAAE,IAAI,IAAI,eAAe,EAAE,MAAM,iCAAiC,CAAC;AACnG,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAc,EAA4B,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC7E,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EA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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 resolvedMode = mode === \"system\" ? (prefersDarkMode ? \"dark\" : \"light\") : mode;\r\n\r\n const theme: Theme = createTheme({\r\n palette: {\r\n mode: resolvedMode,\r\n primary: { main: (colors.primary as any)?.[resolvedMode] || (colors.primary as any)?.main, },\r\n secondary: { main: (colors.secondary as any)?.[resolvedMode] || (colors.secondary as any)?.main, },\r\n background: resolvedMode === \"light\" && colors.background ? { default: colors.background.default, paper: colors.background.paper, } : {},\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,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,I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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};"]}
@@ -0,0 +1,2 @@
1
+ import "moment/locale/cs";
2
+ export declare const LayoutLocalizationProvider: React.FC;
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { LocalizationProvider } from "@mui/x-date-pickers-pro";
3
+ import { AdapterMoment } from "@mui/x-date-pickers-pro/AdapterMoment";
4
+ import moment from "moment";
5
+ import "moment/locale/cs";
6
+ import { Outlet } from "react-router-dom";
7
+ import { useLayout } from "./LayoutContext";
8
+ export const LayoutLocalizationProvider = () => {
9
+ const { i18n } = useLayout();
10
+ if (moment.locale() !== i18n.resolvedLanguage) {
11
+ moment.locale(i18n.resolvedLanguage);
12
+ }
13
+ return (_jsx(LocalizationProvider, { dateAdapter: AdapterMoment, adapterLocale: i18n.resolvedLanguage, children: _jsx(Outlet, {}) }));
14
+ };
15
+ //# sourceMappingURL=LayoutLocalizationProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LayoutLocalizationProvider.js","sourceRoot":"","sources":["../../../src/contexts/LayoutLocalizationProvider.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,uCAAuC,CAAC;AACtE,OAAO,MAAM,MAAM,QAAQ,CAAC;AAC5B,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,MAAM,CAAC,MAAM,0BAA0B,GAAa,GAAG,EAAE;IACrD,MAAM,EAAE,IAAI,EAAE,GAAG,SAAS,EAAE,CAAC;IAE7B,IAAI,MAAM,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAC5C,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;IACzC,CAAC;IAED,OAAO,CACH,KAAC,oBAAoB,IAAC,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,IAAI,CAAC,gBAAgB,YAClF,KAAC,MAAM,KAAG,GACS,CAC1B,CAAC;AACN,CAAC,CAAC","sourcesContent":["import { LocalizationProvider } from \"@mui/x-date-pickers-pro\";\r\nimport { AdapterMoment } from \"@mui/x-date-pickers-pro/AdapterMoment\";\r\nimport moment from \"moment\";\r\nimport \"moment/locale/cs\";\r\nimport { Outlet } from \"react-router-dom\";\r\nimport { useLayout } from \"./LayoutContext\";\r\n\r\nexport const LayoutLocalizationProvider: React.FC = () => {\r\n const { i18n } = useLayout();\r\n\r\n if (moment.locale() !== i18n.resolvedLanguage) {\r\n moment.locale(i18n.resolvedLanguage);\r\n }\r\n\r\n return (\r\n <LocalizationProvider dateAdapter={AdapterMoment} adapterLocale={i18n.resolvedLanguage}>\r\n <Outlet />\r\n </LocalizationProvider>\r\n );\r\n};"]}
@@ -0,0 +1,14 @@
1
+ import { Breakpoint } from "@mui/material";
2
+ import { ReactNode } from "react";
3
+ interface UseDialogProps {
4
+ open: boolean;
5
+ onClose: () => void;
6
+ title: string | ReactNode;
7
+ color?: "success" | "info" | "warning" | "error" | "primary" | "secondary" | "inherit" | "default";
8
+ maxWidth?: Breakpoint;
9
+ }
10
+ interface LayoutDialogProps {
11
+ children?: ReactNode;
12
+ }
13
+ export declare const useDialog: ({ open, onClose, title, color, maxWidth }: UseDialogProps) => React.FC<LayoutDialogProps>;
14
+ export {};
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { LayoutDialog } from "../components/layout/LayoutDialog";
3
+ export const useDialog = ({ open, onClose, title, color, maxWidth }) => {
4
+ const Dialog = ({ children }) => (_jsx(LayoutDialog, { open: open, onClose: onClose, title: title, color: color, maxWidth: maxWidth, children: children }));
5
+ return Dialog;
6
+ };
7
+ //# sourceMappingURL=UseDialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UseDialog.js","sourceRoot":"","sources":["../../../src/hooks/UseDialog.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAcjE,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAkB,EAA+B,EAAE;IAEhH,MAAM,MAAM,GAAgC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAC1D,KAAC,YAAY,IAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,YACrF,QAAQ,GACE,CAClB,CAAC;IAEF,OAAO,MAAM,CAAC;AAClB,CAAC,CAAC","sourcesContent":["import { Breakpoint } from \"@mui/material\";\r\nimport { ReactNode } from \"react\";\r\nimport { LayoutDialog } from \"../components/layout/LayoutDialog\";\r\n\r\ninterface UseDialogProps {\r\n open: boolean;\r\n onClose: () => void;\r\n title: string | ReactNode;\r\n color?: \"success\" | \"info\" | \"warning\" | \"error\" | \"primary\" | \"secondary\" | \"inherit\" | \"default\";\r\n maxWidth?: Breakpoint;\r\n}\r\n\r\ninterface LayoutDialogProps {\r\n children?: ReactNode;\r\n}\r\n\r\nexport const useDialog = ({ open, onClose, title, color, maxWidth }: UseDialogProps): React.FC<LayoutDialogProps> => {\r\n\r\n const Dialog: React.FC<LayoutDialogProps> = ({ children }) => (\r\n <LayoutDialog open={open} onClose={onClose} title={title} color={color} maxWidth={maxWidth}>\r\n {children}\r\n </LayoutDialog>\r\n );\r\n\r\n return Dialog;\r\n};"]}
@@ -1 +1 @@
1
- {"version":3,"file":"KeycloakExtendedConfig.js","sourceRoot":"","sources":["../../../src/models/KeycloakExtendedConfig.ts"],"names":[],"mappings":"","sourcesContent":["export default interface KeycloakExtendedConfig {\n autoLogin?: boolean,\n confidential?: Confidential,\n realm: string,\n \"auth-server-url\": string,\n idpHint?: string\n}\n\nexport interface Confidential {\n client: string,\n secret: string\n}"]}
1
+ {"version":3,"file":"KeycloakExtendedConfig.js","sourceRoot":"","sources":["../../../src/models/KeycloakExtendedConfig.ts"],"names":[],"mappings":"","sourcesContent":["export default interface KeycloakExtendedConfig {\r\n autoLogin?: boolean,\r\n confidential?: Confidential,\r\n realm: string,\r\n \"auth-server-url\": string,\r\n idpHint?: string\r\n}\r\n\r\nexport interface Confidential {\r\n client: string,\r\n secret: string\r\n}"]}