wcz-layout 6.2.0 → 6.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/components/Button.d.ts +3 -0
- package/dist/src/components/Button.js +9 -0
- package/dist/src/components/Button.js.map +1 -0
- package/dist/src/components/Dialog.js +3 -6
- package/dist/src/components/Dialog.js.map +1 -1
- package/dist/src/components/Layout.js +1 -1
- package/dist/src/components/Layout.js.map +1 -1
- package/dist/src/components/layout/DevelopmentBanner.d.ts +1 -0
- package/dist/src/components/layout/DevelopmentBanner.js +14 -3
- package/dist/src/components/layout/DevelopmentBanner.js.map +1 -1
- package/dist/src/models/KeycloakExtendedConfig.js.map +1 -1
- package/dist/src/next/Fetches.d.ts +5 -0
- package/dist/src/next/Fetches.js +61 -0
- package/dist/src/next/Fetches.js.map +1 -0
- package/dist/src/utils/Translations.d.ts +40 -0
- package/dist/src/utils/Translations.js +41 -0
- package/dist/src/utils/Translations.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/components/Layout.tsx +1 -1
- package/src/components/layout/DevelopmentBanner.tsx +21 -9
- package/dist/src/contexts/LayoutLocalizationProvider.d.ts +0 -2
- package/dist/src/contexts/LayoutLocalizationProvider.js +0 -15
- package/dist/src/contexts/LayoutLocalizationProvider.js.map +0 -1
- package/dist/src/hooks/UseDialog.d.ts +0 -14
- package/dist/src/hooks/UseDialog.js +0 -7
- package/dist/src/hooks/UseDialog.js.map +0 -1
package/package.json
CHANGED
|
@@ -181,7 +181,7 @@ export const Layout: React.FC<LayoutProps> = ({ routes, colors, appVersion, user
|
|
|
181
181
|
</Box>
|
|
182
182
|
</Box>
|
|
183
183
|
|
|
184
|
-
<DevelopmentBanner user={user} />
|
|
184
|
+
<DevelopmentBanner user={user} hasNavigationRoutes={hasNavigationRoutes} />
|
|
185
185
|
{(isFetching || isMutating) && <LinearProgress sx={{ position: "fixed", top: { xs: 56, sm: 64 }, left: 0, right: 0 }} />}
|
|
186
186
|
</ThemeProvider>
|
|
187
187
|
);
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { Close } from "@mui/icons-material";
|
|
2
|
-
import { Fade,
|
|
2
|
+
import { Fade, Grid2, IconButton, Paper, Typography } from "@mui/material";
|
|
3
3
|
import { useEffect, useState } from "react";
|
|
4
4
|
import { useTranslation } from "react-i18next";
|
|
5
5
|
import { User } from "../../models/User";
|
|
6
6
|
import { environment } from "../../utils/Helpers";
|
|
7
7
|
import { hasRole } from "../../utils/UserService";
|
|
8
|
+
import { grey } from "@mui/material/colors";
|
|
8
9
|
|
|
9
10
|
interface DevelopmentBannerProps {
|
|
10
11
|
user: User;
|
|
12
|
+
hasNavigationRoutes: boolean;
|
|
11
13
|
}
|
|
12
14
|
|
|
13
|
-
export const DevelopmentBanner: React.FC<DevelopmentBannerProps> = ({ user }) => {
|
|
15
|
+
export const DevelopmentBanner: React.FC<DevelopmentBannerProps> = ({ user, hasNavigationRoutes }) => {
|
|
14
16
|
const { t } = useTranslation();
|
|
15
17
|
const [bannerOpen, setBannerOpen] = useState<boolean>(false);
|
|
16
18
|
|
|
@@ -23,19 +25,29 @@ export const DevelopmentBanner: React.FC<DevelopmentBannerProps> = ({ user }) =>
|
|
|
23
25
|
|
|
24
26
|
return (
|
|
25
27
|
<Fade appear={false} in={bannerOpen}>
|
|
26
|
-
<Paper square variant="outlined" tabIndex={-1} sx={
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
<Paper square variant="outlined" tabIndex={-1} sx={theme => ({
|
|
29
|
+
position: "fixed",
|
|
30
|
+
bottom: 0,
|
|
31
|
+
left: { xs: 0, sm: hasNavigationRoutes ? 68.7 : 0 },
|
|
32
|
+
right: 0,
|
|
33
|
+
m: 0,
|
|
34
|
+
p: 2,
|
|
35
|
+
borderWidth: 0,
|
|
36
|
+
borderTopWidth: 1,
|
|
37
|
+
bgcolor: theme.palette.mode === "dark" ? grey[900] : grey[100]
|
|
38
|
+
})}>
|
|
39
|
+
<Grid2 container justifyContent="space-between" alignItems="center">
|
|
40
|
+
<Grid2 size={10}>
|
|
29
41
|
<Typography fontWeight="bold">{t("Layout.DevelopmentDialogTitle")}</Typography>
|
|
30
42
|
<Typography variant="body2">{t("Layout.DevelopmentDialogContent")}</Typography>
|
|
31
|
-
</
|
|
43
|
+
</Grid2>
|
|
32
44
|
|
|
33
|
-
<
|
|
45
|
+
<Grid2 size={2} sx={{ p: 1, textAlign: "right" }}>
|
|
34
46
|
<IconButton size="small" onClick={closeBanner}>
|
|
35
47
|
<Close />
|
|
36
48
|
</IconButton>
|
|
37
|
-
</
|
|
38
|
-
</
|
|
49
|
+
</Grid2>
|
|
50
|
+
</Grid2>
|
|
39
51
|
</Paper>
|
|
40
52
|
</Fade>
|
|
41
53
|
);
|
|
@@ -1,15 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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};"]}
|
|
@@ -1,14 +0,0 @@
|
|
|
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 {};
|
|
@@ -1,7 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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};"]}
|