@gen-epix/ui-client-common 4.4.2 → 4.5.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/README.md +7 -6
- package/dist/@types/mui.d.ts +13 -5
- package/dist/@types/ui-client-common.d.ts +1 -0
- package/dist/_chunks/ApplicationFooter.js +44 -44
- package/dist/_chunks/ApplicationFooter.js.map +1 -1
- package/dist/_chunks/Breadcrumbs.js +13 -13
- package/dist/_chunks/Breadcrumbs.js.map +1 -1
- package/dist/_chunks/CrudPage.js +300 -300
- package/dist/_chunks/CrudPage.js.map +1 -1
- package/dist/_chunks/Notifications.js +51 -51
- package/dist/_chunks/Notifications.js.map +1 -1
- package/dist/_chunks/OutageList.js +29 -29
- package/dist/_chunks/OutageUtil.js +1 -2
- package/dist/_chunks/OutageUtil.js.map +1 -1
- package/dist/_chunks/QueryClientService.js +96 -388
- package/dist/_chunks/QueryClientService.js.map +1 -1
- package/dist/_chunks/Table.js +518 -512
- package/dist/_chunks/Table.js.map +1 -1
- package/dist/_chunks/TableUtil.js +8 -16
- package/dist/_chunks/TableUtil.js.map +1 -1
- package/dist/_chunks/TextFilter.js +14 -12
- package/dist/_chunks/TextFilter.js.map +1 -1
- package/dist/_chunks/UserInvitationsAdminPage.js +77 -77
- package/dist/_chunks/UserInvitationsAdminPage.js.map +1 -1
- package/dist/_chunks/UserManagerUtil.js +210 -209
- package/dist/_chunks/UserManagerUtil.js.map +1 -1
- package/dist/_chunks/_baseFlatten.js +8 -8
- package/dist/_chunks/_baseFlatten.js.map +1 -1
- package/dist/_chunks/_baseGet.js +280 -0
- package/dist/_chunks/_baseGet.js.map +1 -0
- package/dist/_chunks/_baseIteratee.js +274 -0
- package/dist/_chunks/_baseIteratee.js.map +1 -0
- package/dist/_chunks/_baseUnset.js +22 -299
- package/dist/_chunks/_baseUnset.js.map +1 -1
- package/dist/_chunks/last.js +13 -0
- package/dist/_chunks/last.js.map +1 -0
- package/dist/_chunks/omit.js +41 -40
- package/dist/_chunks/omit.js.map +1 -1
- package/dist/_chunks/tableStore.js +190 -183
- package/dist/_chunks/tableStore.js.map +1 -1
- package/dist/_chunks/uniq.js +44 -0
- package/dist/_chunks/uniq.js.map +1 -0
- package/dist/_chunks/useMutation.js +22 -22
- package/dist/_chunks/useMutation.js.map +1 -1
- package/dist/_chunks/useQueryMemo.js +25 -8
- package/dist/_chunks/useQueryMemo.js.map +1 -1
- package/dist/classes/abstracts/FilterAbstract/index.js +3 -1
- package/dist/classes/abstracts/FilterAbstract/index.js.map +1 -1
- package/dist/classes/filters/MultiSelectFilter.d.ts +1 -1
- package/dist/classes/services/AuthenticationService/AuthenticationService.d.ts +1 -1
- package/dist/classes/services/AuthenticationService/index.js +15 -15
- package/dist/classes/services/AuthenticationService/index.js.map +1 -1
- package/dist/classes/services/AuthorizationService/index.js +4 -4
- package/dist/classes/services/AuthorizationService/index.js.map +1 -1
- package/dist/classes/services/BackendVersionService/index.js +3 -2
- package/dist/classes/services/BackendVersionService/index.js.map +1 -1
- package/dist/classes/services/BreadcrumbService/index.js +16 -38
- package/dist/classes/services/BreadcrumbService/index.js.map +1 -1
- package/dist/classes/services/EmotionCacheService/index.js +9 -8
- package/dist/classes/services/EmotionCacheService/index.js.map +1 -1
- package/dist/classes/services/I18nService/index.js +11 -10
- package/dist/classes/services/I18nService/index.js.map +1 -1
- package/dist/classes/services/InactivityService/index.js +12 -12
- package/dist/classes/services/InactivityService/index.js.map +1 -1
- package/dist/classes/services/LogService/index.js +39 -33
- package/dist/classes/services/LogService/index.js.map +1 -1
- package/dist/classes/services/NotificationService/index.js +8 -8
- package/dist/classes/services/NotificationService/index.js.map +1 -1
- package/dist/classes/services/PageEventBusService/index.js +13 -9
- package/dist/classes/services/PageEventBusService/index.js.map +1 -1
- package/dist/classes/services/RouterService/index.js +3 -6
- package/dist/classes/services/RouterService/index.js.map +1 -1
- package/dist/components/app/App/App.d.ts +1 -1
- package/dist/components/app/App/index.js +34 -38
- package/dist/components/app/App/index.js.map +1 -1
- package/dist/components/app/ApplicationBootstrapWithAuthentication/index.js +28 -28
- package/dist/components/app/ApplicationBootstrapWithAuthentication/index.js.map +1 -1
- package/dist/components/app/ApplicationBootstrapWithoutAuthorization/index.js +47 -45
- package/dist/components/app/ApplicationBootstrapWithoutAuthorization/index.js.map +1 -1
- package/dist/components/app/AuthenticationWrapper/index.js +35 -35
- package/dist/components/app/AuthenticationWrapper/index.js.map +1 -1
- package/dist/components/app/AuthorizationWrapper/index.js +19 -19
- package/dist/components/app/AuthorizationWrapper/index.js.map +1 -1
- package/dist/components/app/RouterRoot/index.js +52 -50
- package/dist/components/app/RouterRoot/index.js.map +1 -1
- package/dist/components/epi/EpiContactDetailsDialog/index.js +21 -21
- package/dist/components/epi/EpiContactDetailsDialog/index.js.map +1 -1
- package/dist/components/filters/BooleanFilterField/index.js +5 -5
- package/dist/components/filters/DateFilterField/index.js +3 -3
- package/dist/components/filters/GeoFilterField/index.js +4 -4
- package/dist/components/filters/MultiSelectFilterField/index.js +4 -4
- package/dist/components/filters/NumberRangeFilterField/index.js +3 -3
- package/dist/components/filters/TextFilterField/index.js +3 -3
- package/dist/components/ui/ApplicationBar/index.js +188 -188
- package/dist/components/ui/ApplicationBar/index.js.map +1 -1
- package/dist/components/ui/GenericErrorMessage/index.js +29 -29
- package/dist/components/ui/GenericErrorMessage/index.js.map +1 -1
- package/dist/components/ui/LicensesDialog/index.js +38 -38
- package/dist/components/ui/LicensesDialog/index.js.map +1 -1
- package/dist/components/ui/MyPermissionsDialog/index.js +16 -16
- package/dist/components/ui/MyPermissionsDialog/index.js.map +1 -1
- package/dist/components/ui/NavLink/index.js +6 -6
- package/dist/components/ui/OrganizationSwitcherDialog/index.js +21 -21
- package/dist/components/ui/OrganizationSwitcherDialog/index.js.map +1 -1
- package/dist/components/ui/PageContainer/index.js +24 -24
- package/dist/components/ui/PageContainer/index.js.map +1 -1
- package/dist/components/ui/Sidebar/index.js +30 -30
- package/dist/components/ui/UserFeedbackDialog/index.js +12 -12
- package/dist/components/ui/UserFeedbackDialog/index.js.map +1 -1
- package/dist/components/ui/UserInactivityConfirmation/index.js.map +1 -1
- package/dist/constants/config.constants.d.ts +0 -2
- package/dist/constants/config.constants.js +2 -2
- package/dist/constants/config.constants.js.map +1 -1
- package/dist/dataHooks/useIdentifierIssuerOwnOrganizationQuery/index.js +12 -12
- package/dist/dataHooks/useIdentifierIssuerOwnOrganizationQuery/index.js.map +1 -1
- package/dist/dataHooks/useIdentifierIssuerQuery/index.js +14 -14
- package/dist/dataHooks/useIdentifierIssuerQuery/index.js.map +1 -1
- package/dist/dataHooks/useInviteUserConstraintsQuery/index.js +12 -12
- package/dist/dataHooks/useInviteUserConstraintsQuery/index.js.map +1 -1
- package/dist/dataHooks/useOrganizationAdminPoliciesQuery/index.js +13 -13
- package/dist/dataHooks/useOrganizationAdminPoliciesQuery/index.js.map +1 -1
- package/dist/dataHooks/useOrganizationIdentifierIssuerLinksQuery/index.js +4 -4
- package/dist/dataHooks/useOrganizationIdentifierIssuerLinksQuery/index.js.map +1 -1
- package/dist/dataHooks/useOrganizationsQuery/index.js +13 -13
- package/dist/dataHooks/useOrganizationsQuery/index.js.map +1 -1
- package/dist/dataHooks/useUsersQuery/index.js +10 -10
- package/dist/dataHooks/useUsersQuery/index.js.map +1 -1
- package/dist/hoc/withPermissions/index.js.map +1 -1
- package/dist/hooks/useConfig/index.js +2 -2
- package/dist/hooks/useConfig/index.js.map +1 -1
- package/dist/hooks/useCreateMutation/index.js +12 -12
- package/dist/hooks/useCreateMutation/index.js.map +1 -1
- package/dist/hooks/useDeleteMutation/index.js +16 -9
- package/dist/hooks/useDeleteMutation/index.js.map +1 -1
- package/dist/hooks/useEditMutation/index.js +48 -33
- package/dist/hooks/useEditMutation/index.js.map +1 -1
- package/dist/hooks/useItemQuery/index.js +4 -4
- package/dist/hooks/useItemQuery/index.js.map +1 -1
- package/dist/hooks/useUpdateBreadcrumb/index.js.map +1 -1
- package/dist/locale/en.json +1 -0
- package/dist/locale/nl.json +1 -0
- package/dist/models/config.models.d.ts +1 -5
- package/dist/models/theme.models.d.ts +19 -16
- package/dist/pages/AcceptInvitationPage/index.js +25 -25
- package/dist/pages/AcceptInvitationPage/index.js.map +1 -1
- package/dist/pages/AdminPage/index.js +16 -16
- package/dist/pages/AdminPage/index.js.map +1 -1
- package/dist/pages/ChooseIdentityProviderPage/index.js +21 -21
- package/dist/pages/ChooseIdentityProviderPage/index.js.map +1 -1
- package/dist/pages/IdentifierIssuersAdminPage/index.js +5 -5
- package/dist/pages/IdentifierIssuersAdminPage/index.js.map +1 -1
- package/dist/pages/OrganizationAdminPoliciesAdminPage/index.js +5 -5
- package/dist/pages/OrganizationAdminPoliciesAdminPage/index.js.map +1 -1
- package/dist/pages/OrganizationContactsAdminPage/index.js +6 -6
- package/dist/pages/OrganizationContactsAdminPage/index.js.map +1 -1
- package/dist/pages/OrganizationSitesAdminPage/index.js +9 -9
- package/dist/pages/OrganizationSitesAdminPage/index.js.map +1 -1
- package/dist/pages/OrganizationsAdminPage/index.js +13 -13
- package/dist/pages/OrganizationsAdminPage/index.js.map +1 -1
- package/dist/pages/OutagesAdminPage/index.js +20 -20
- package/dist/pages/OutagesAdminPage/index.js.map +1 -1
- package/dist/pages/PostLoginPage/index.js +6 -6
- package/dist/pages/PostLoginPage/index.js.map +1 -1
- package/dist/pages/PostLogoutPage/index.js +8 -8
- package/dist/pages/PostLogoutPage/index.js.map +1 -1
- package/dist/pages/UsersAdminPage/index.js +39 -39
- package/dist/pages/UsersAdminPage/index.js.map +1 -1
- package/dist/setup/setup.d.ts +1 -1
- package/dist/setup/setup.js +11 -4
- package/dist/setup/setup.js.map +1 -1
- package/dist/theme/demoTheme/index.js +17 -15
- package/dist/theme/demoTheme/index.js.map +1 -1
- package/dist/utils/DataHookUtil/index.js +1 -1
- package/dist/utils/DataHookUtil/index.js.map +1 -1
- package/dist/utils/DependencyContainerUtil/DependencyContainerUtil.d.ts +2 -3
- package/dist/utils/DependencyContainerUtil/index.js +10 -16
- package/dist/utils/DependencyContainerUtil/index.js.map +1 -1
- package/dist/utils/MenuDataUtil/index.js +1 -1
- package/dist/utils/MenuDataUtil/index.js.map +1 -1
- package/dist/utils/StandardConfigUtil/index.js +0 -4
- package/dist/utils/StandardConfigUtil/index.js.map +1 -1
- package/dist/utils/TimeUtil/index.js +1 -1
- package/dist/utils/TimeUtil/index.js.map +1 -1
- package/package.json +11 -14
- package/dist/context/uiClientCommonConfigContext/UiClientCommonConfigContext.d.ts +0 -9
- package/dist/context/uiClientCommonConfigContext/UiClientCommonConfigContextProvider.d.ts +0 -6
- package/dist/context/uiClientCommonConfigContext/index.d.ts +0 -3
- package/dist/context/uiClientCommonConfigContext/index.js +0 -34
- package/dist/context/uiClientCommonConfigContext/index.js.map +0 -1
- package/dist/context/uiClientCommonConfigContext/useUiClientCommonConfigContext.d.ts +0 -3
package/README.md
CHANGED
|
@@ -43,8 +43,9 @@ import { createRoot } from 'react-dom/client';
|
|
|
43
43
|
import { I18nService } from '@gen-epix/ui-client-common/classes/services/I18nService';
|
|
44
44
|
import { App } from '@gen-epix/ui-client-common/components/app/App';
|
|
45
45
|
import { DependencyContainerUtil } from '@gen-epix/ui-client-common/utils/DependencyContainerUtil';
|
|
46
|
-
import {
|
|
46
|
+
import { setupClientCommon } from '@gen-epix/ui-client-common/setup/setup';
|
|
47
47
|
import { WindowService } from '@gen-epix/ui-core/classes/services/WindowService';
|
|
48
|
+
import { container } from 'tsyringe';
|
|
48
49
|
|
|
49
50
|
const LOCAL_STORAGE_KEY_PREFERRED_LANGUAGE = 'GenEpix-preferred-language';
|
|
50
51
|
|
|
@@ -52,12 +53,12 @@ const init = async () => {
|
|
|
52
53
|
const config = {
|
|
53
54
|
// provide a ConfigBase implementation here
|
|
54
55
|
};
|
|
55
|
-
|
|
56
|
+
DependencyContainerUtil.registerConfig(config);
|
|
56
57
|
|
|
57
58
|
await container.resolve(I18nService).init({
|
|
58
59
|
getCurrentLanguageCode: async () => {
|
|
59
60
|
return Promise.resolve(
|
|
60
|
-
|
|
61
|
+
container.resolve(WindowService).window.localStorage.getItem(LOCAL_STORAGE_KEY_PREFERRED_LANGUAGE)
|
|
61
62
|
?? window.navigator.language.split('-')[0]
|
|
62
63
|
?? 'en',
|
|
63
64
|
);
|
|
@@ -68,14 +69,14 @@ const init = async () => {
|
|
|
68
69
|
],
|
|
69
70
|
setNewLanguageCode: async (code: string) => {
|
|
70
71
|
return Promise.resolve(
|
|
71
|
-
|
|
72
|
+
container.resolve(WindowService).window.localStorage.setItem(LOCAL_STORAGE_KEY_PREFERRED_LANGUAGE, code),
|
|
72
73
|
);
|
|
73
74
|
},
|
|
74
75
|
});
|
|
75
76
|
|
|
76
|
-
|
|
77
|
+
setupClientCommon();
|
|
77
78
|
|
|
78
|
-
createRoot(document.getElementById('root')!).render(<App
|
|
79
|
+
createRoot(document.getElementById('root')!).render(<App />);
|
|
79
80
|
};
|
|
80
81
|
|
|
81
82
|
init().catch((error) => {
|
package/dist/@types/mui.d.ts
CHANGED
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type {
|
|
2
|
+
GenEpixUiClientCommonFooterTheme,
|
|
3
|
+
GenEpixUiClientCommonNavbarTheme,
|
|
4
|
+
GenEpixUiClientCommonTheme,
|
|
5
|
+
} from '../models/theme.models';
|
|
2
6
|
|
|
3
7
|
declare module '@mui/material/styles' {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- Required to augment MUI's generic interface.
|
|
9
|
+
interface Components<TTheme = unknown> {
|
|
10
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
11
|
+
GenEpixUiClientCommonFooter?: GenEpixUiClientCommonFooterTheme;
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
13
|
+
GenEpixUiClientCommonNavbar?: GenEpixUiClientCommonNavbarTheme;
|
|
8
14
|
}
|
|
15
|
+
|
|
16
|
+
interface Theme extends GenEpixUiClientCommonTheme { }
|
|
9
17
|
}
|
|
@@ -1,47 +1,47 @@
|
|
|
1
1
|
import { useConfig as e } from "../hooks/useConfig/index.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import { Box as t, Container as n, IconButton as r, Link as i, Typography as a, useTheme as o } from "@mui/material";
|
|
3
|
+
import { Children as s, useCallback as c, useEffect as l, useId as u, useMemo as d, useState as f } from "react";
|
|
4
|
+
import { jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
5
5
|
import { useTranslation as h } from "react-i18next";
|
|
6
6
|
import g from "@mui/icons-material/Menu";
|
|
7
7
|
//#region src/components/ui/ApplicationFooter/ApplicationFooterLink.tsx
|
|
8
|
-
var _ = ({ children: e, href:
|
|
9
|
-
let
|
|
10
|
-
return /* @__PURE__ */
|
|
8
|
+
var _ = ({ children: e, href: n, onClick: r, ...a }) => {
|
|
9
|
+
let s = o();
|
|
10
|
+
return /* @__PURE__ */ m(t, {
|
|
11
11
|
component: "li",
|
|
12
|
-
...
|
|
13
|
-
children: [
|
|
14
|
-
href:
|
|
15
|
-
onClick:
|
|
12
|
+
...a,
|
|
13
|
+
children: [n && /* @__PURE__ */ p(i, {
|
|
14
|
+
href: n,
|
|
15
|
+
onClick: r,
|
|
16
16
|
rel: "noreferrer",
|
|
17
|
-
sx: { color:
|
|
17
|
+
sx: { color: s.components.GenEpixUiClientCommonFooter.color },
|
|
18
18
|
target: "_blank",
|
|
19
19
|
children: e
|
|
20
|
-
}), !
|
|
20
|
+
}), !n && /* @__PURE__ */ p(i, {
|
|
21
21
|
component: "button",
|
|
22
|
-
onClick:
|
|
23
|
-
sx: { color:
|
|
22
|
+
onClick: r,
|
|
23
|
+
sx: { color: s.components.GenEpixUiClientCommonFooter.color },
|
|
24
24
|
children: e
|
|
25
25
|
})]
|
|
26
26
|
});
|
|
27
27
|
}, v = ({ children: e, header: n }) => {
|
|
28
|
-
let r =
|
|
29
|
-
return
|
|
28
|
+
let r = o();
|
|
29
|
+
return s.forEach(e, (e) => {
|
|
30
30
|
if (e?.type !== _) throw Error("ApplicationFooterLinkSection only accepts ApplicationFooterLink as children");
|
|
31
|
-
}), /* @__PURE__ */
|
|
31
|
+
}), /* @__PURE__ */ m(t, {
|
|
32
32
|
sx: { padding: 2 },
|
|
33
|
-
children: [/* @__PURE__ */
|
|
33
|
+
children: [/* @__PURE__ */ p(a, {
|
|
34
34
|
component: "h2",
|
|
35
35
|
sx: {
|
|
36
|
-
borderBottom: `1px solid ${r
|
|
37
|
-
color: r
|
|
36
|
+
borderBottom: `1px solid ${r.components.GenEpixUiClientCommonFooter.sectionBorderColor}`,
|
|
37
|
+
color: r.components.GenEpixUiClientCommonFooter.color,
|
|
38
38
|
fontWeight: 500,
|
|
39
39
|
marginBottom: r.spacing(1),
|
|
40
40
|
paddingBottom: r.spacing(1)
|
|
41
41
|
},
|
|
42
42
|
variant: "h4",
|
|
43
43
|
children: n
|
|
44
|
-
}), /* @__PURE__ */
|
|
44
|
+
}), /* @__PURE__ */ p(t, {
|
|
45
45
|
component: "ul",
|
|
46
46
|
sx: {
|
|
47
47
|
listStyle: "none",
|
|
@@ -51,9 +51,9 @@ var _ = ({ children: e, href: t, onClick: n, ...r }) => {
|
|
|
51
51
|
children: e
|
|
52
52
|
})]
|
|
53
53
|
});
|
|
54
|
-
}, y = ({ fullWidth:
|
|
55
|
-
let
|
|
56
|
-
|
|
54
|
+
}, y = ({ fullWidth: i }) => {
|
|
55
|
+
let a = o(), s = u(), { t: y } = h(), b = e(), [x, S] = f(!1);
|
|
56
|
+
l(() => {
|
|
57
57
|
if (x) {
|
|
58
58
|
let e = (e) => {
|
|
59
59
|
e.key === "Escape" && S(!1);
|
|
@@ -63,47 +63,47 @@ var _ = ({ children: e, href: t, onClick: n, ...r }) => {
|
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
65
|
}, [x]);
|
|
66
|
-
let C =
|
|
66
|
+
let C = c(() => {
|
|
67
67
|
S((e) => !e);
|
|
68
|
-
}, []), w =
|
|
69
|
-
return /* @__PURE__ */
|
|
68
|
+
}, []), w = d(() => b.createFooter(), [b]);
|
|
69
|
+
return /* @__PURE__ */ m(t, {
|
|
70
70
|
component: "footer",
|
|
71
71
|
sx: {
|
|
72
|
-
background:
|
|
72
|
+
background: a.components.GenEpixUiClientCommonFooter.background,
|
|
73
73
|
position: "relative",
|
|
74
|
-
[
|
|
74
|
+
[a.breakpoints.up("md")]: { paddingBottom: a.spacing(1) }
|
|
75
75
|
},
|
|
76
|
-
children: [/* @__PURE__ */
|
|
77
|
-
"aria-controls":
|
|
76
|
+
children: [/* @__PURE__ */ p(r, {
|
|
77
|
+
"aria-controls": s,
|
|
78
78
|
"aria-label": y`Toggle footer menu`,
|
|
79
79
|
onClick: C,
|
|
80
80
|
sx: {
|
|
81
|
-
color:
|
|
82
|
-
[
|
|
81
|
+
color: a.palette.primary.contrastText,
|
|
82
|
+
[a.breakpoints.up("md")]: { display: "none" }
|
|
83
83
|
},
|
|
84
|
-
children: /* @__PURE__ */
|
|
85
|
-
}), /* @__PURE__ */
|
|
86
|
-
maxWidth: !
|
|
84
|
+
children: /* @__PURE__ */ p(g, {})
|
|
85
|
+
}), /* @__PURE__ */ p(n, {
|
|
86
|
+
maxWidth: !i && "xl",
|
|
87
87
|
sx: {
|
|
88
88
|
display: "grid",
|
|
89
89
|
gridTemplateColumns: "repeat(1, 1fr)",
|
|
90
90
|
paddingLeft: "0 !important",
|
|
91
91
|
paddingRight: "0 !important",
|
|
92
|
-
[
|
|
93
|
-
background:
|
|
94
|
-
bottom:
|
|
92
|
+
[a.breakpoints.down("md")]: {
|
|
93
|
+
background: a.components.GenEpixUiClientCommonFooter.background,
|
|
94
|
+
bottom: a.spacing(5),
|
|
95
95
|
display: x ? "block" : "none",
|
|
96
96
|
left: 0,
|
|
97
97
|
position: "absolute",
|
|
98
98
|
width: "100%",
|
|
99
|
-
zIndex:
|
|
99
|
+
zIndex: a.zIndex.appBar - 1
|
|
100
100
|
},
|
|
101
|
-
[
|
|
102
|
-
[
|
|
101
|
+
[a.breakpoints.up("md")]: { gridTemplateColumns: `repeat(${w.sections.length}, 1fr)` },
|
|
102
|
+
[a.breakpoints.up("sm")]: { gridTemplateColumns: "repeat(2, 1fr)" }
|
|
103
103
|
},
|
|
104
|
-
children: w.sections.map((e) => /* @__PURE__ */
|
|
104
|
+
children: w.sections.map((e) => /* @__PURE__ */ p(v, {
|
|
105
105
|
header: e.header,
|
|
106
|
-
children: e.items.map((e) => /* @__PURE__ */
|
|
106
|
+
children: e.items.map((e) => /* @__PURE__ */ p(_, {
|
|
107
107
|
href: e.href,
|
|
108
108
|
onClick: e.onClick,
|
|
109
109
|
sx: { mb: .5 },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApplicationFooter.js","names":["MenuIcon","ApplicationFooterLink","boxProps","theme","useTheme","Box","href","Link","ApplicationFooterLinkSection","Children","children","child","Typography","header","ApplicationFooter","navId","useId","useTranslation","config","useConfig","isMenuOpen","setIsMenuOpen","useState","handleKeyDown","event","onMenuButtonClick","useCallback","x","footer","useMemo","IconButton","Container","section","item"],"sources":["../../src/components/ui/ApplicationFooter/ApplicationFooterLink.tsx","../../src/components/ui/ApplicationFooter/ApplicationFooterLinkSection.tsx","../../src/components/ui/ApplicationFooter/ApplicationFooter.tsx"],"sourcesContent":["import type { BoxProps } from '@mui/material';\nimport {\n Box,\n Link,\n useTheme,\n} from '@mui/material';\nimport type { PropsWithChildren } from 'react';\n\nexport type ApplicationFooterLinkProps = BoxProps<'li'> & PropsWithChildren<{\n readonly href?: string;\n readonly onClick?: () => void;\n}>;\n\nexport const ApplicationFooterLink = ({ children, href, onClick, ...boxProps }: ApplicationFooterLinkProps) => {\n const theme = useTheme();\n\n return (\n <Box\n component={'li'}\n {...boxProps}\n >\n {href && (\n <Link\n href={href}\n onClick={onClick}\n rel={'noreferrer'}\n sx={{\n color: theme
|
|
1
|
+
{"version":3,"file":"ApplicationFooter.js","names":["MenuIcon","ApplicationFooterLink","boxProps","theme","useTheme","Box","href","Link","ApplicationFooterLinkSection","Children","children","child","Typography","header","ApplicationFooter","navId","useId","useTranslation","config","useConfig","isMenuOpen","setIsMenuOpen","useState","handleKeyDown","event","onMenuButtonClick","useCallback","x","footer","useMemo","IconButton","Container","section","item"],"sources":["../../src/components/ui/ApplicationFooter/ApplicationFooterLink.tsx","../../src/components/ui/ApplicationFooter/ApplicationFooterLinkSection.tsx","../../src/components/ui/ApplicationFooter/ApplicationFooter.tsx"],"sourcesContent":["import type { BoxProps } from '@mui/material';\nimport {\n Box,\n Link,\n useTheme,\n} from '@mui/material';\nimport type { PropsWithChildren } from 'react';\n\nexport type ApplicationFooterLinkProps = BoxProps<'li'> & PropsWithChildren<{\n readonly href?: string;\n readonly onClick?: () => void;\n}>;\n\nexport const ApplicationFooterLink = ({ children, href, onClick, ...boxProps }: ApplicationFooterLinkProps) => {\n const theme = useTheme();\n\n return (\n <Box\n component={'li'}\n {...boxProps}\n >\n {href && (\n <Link\n href={href}\n onClick={onClick}\n rel={'noreferrer'}\n sx={{\n color: theme.components.GenEpixUiClientCommonFooter.color,\n }}\n target={'_blank'}\n >\n {children}\n </Link>\n )}\n {!href && (\n <Link\n component={'button'}\n onClick={onClick}\n sx={{\n color: theme.components.GenEpixUiClientCommonFooter.color,\n }}\n >\n {children}\n </Link>\n )}\n </Box>\n );\n};\n","import {\n Box,\n Typography,\n useTheme,\n} from '@mui/material';\nimport { Children } from 'react';\nimport type {\n PropsWithChildren,\n ReactElement,\n} from 'react';\n\nimport { ApplicationFooterLink } from './ApplicationFooterLink';\n\nexport type ApplicationFooterLinkSectionProps = PropsWithChildren<{\n readonly header: string;\n}>;\n\nexport const ApplicationFooterLinkSection = ({ children, header }: ApplicationFooterLinkSectionProps) => {\n const theme = useTheme();\n\n // eslint-disable-next-line @eslint-react/no-children-for-each\n Children.forEach(children, (child) => {\n if ((child as ReactElement)?.type !== ApplicationFooterLink) {\n throw Error('ApplicationFooterLinkSection only accepts ApplicationFooterLink as children');\n }\n });\n\n return (\n <Box\n sx={{ padding: 2 }}\n >\n <Typography\n component={'h2'}\n sx={{\n borderBottom: `1px solid ${theme.components.GenEpixUiClientCommonFooter.sectionBorderColor}`,\n color: theme.components.GenEpixUiClientCommonFooter.color,\n fontWeight: 500,\n marginBottom: theme.spacing(1),\n paddingBottom: theme.spacing(1),\n }}\n variant={'h4'}\n >\n {header}\n </Typography>\n <Box\n component={'ul'}\n sx={{\n listStyle: 'none',\n margin: 0,\n padding: 0,\n }}\n >\n {children}\n </Box>\n </Box>\n );\n};\n","import {\n Box,\n Container,\n IconButton,\n useTheme,\n} from '@mui/material';\nimport MenuIcon from '@mui/icons-material/Menu';\nimport {\n useCallback,\n useEffect,\n useId,\n useMemo,\n useState,\n} from 'react';\nimport { useTranslation } from 'react-i18next';\n\nimport { useConfig } from '../../../hooks/useConfig';\n\nimport { ApplicationFooterLink } from './ApplicationFooterLink';\nimport { ApplicationFooterLinkSection } from './ApplicationFooterLinkSection';\n\nexport type ApplicationFooterProps = {\n readonly fullWidth?: boolean;\n};\n\nexport const ApplicationFooter = ({ fullWidth }: ApplicationFooterProps) => {\n const theme = useTheme();\n const navId = useId();\n const { t } = useTranslation();\n const config = useConfig();\n\n const [isMenuOpen, setIsMenuOpen] = useState(false);\n\n useEffect(() => {\n if (isMenuOpen) {\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key === 'Escape') {\n setIsMenuOpen(false);\n }\n };\n document.addEventListener('keydown', handleKeyDown);\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n };\n }\n }, [isMenuOpen]);\n\n const onMenuButtonClick = useCallback(() => {\n setIsMenuOpen(x => !x);\n }, []);\n\n const footer = useMemo(() => config.createFooter(), [config]);\n\n return (\n <Box\n component={'footer'}\n sx={{\n background: theme.components.GenEpixUiClientCommonFooter.background,\n position: 'relative',\n [theme.breakpoints.up('md')]: {\n paddingBottom: theme.spacing(1),\n },\n }}\n >\n <IconButton\n aria-controls={navId}\n aria-label={t`Toggle footer menu`}\n onClick={onMenuButtonClick}\n sx={{\n color: theme.palette.primary.contrastText,\n [theme.breakpoints.up('md')]: {\n display: 'none',\n },\n }}\n >\n <MenuIcon />\n </IconButton>\n <Container\n maxWidth={fullWidth ? false : 'xl'}\n sx={{\n display: 'grid',\n gridTemplateColumns: 'repeat(1, 1fr)',\n paddingLeft: '0 !important',\n paddingRight: '0 !important',\n [theme.breakpoints.down('md')]: {\n background: theme.components.GenEpixUiClientCommonFooter.background,\n bottom: theme.spacing(5),\n display: isMenuOpen ? 'block' : 'none',\n left: 0,\n position: 'absolute',\n width: '100%',\n zIndex: theme.zIndex.appBar - 1,\n },\n [theme.breakpoints.up('md')]: {\n gridTemplateColumns: `repeat(${footer.sections.length}, 1fr)`,\n },\n [theme.breakpoints.up('sm')]: {\n gridTemplateColumns: 'repeat(2, 1fr)',\n },\n }}\n >\n {footer.sections.map((section) => (\n <ApplicationFooterLinkSection\n header={section.header}\n key={section.header}\n >\n {section.items.map((item) => (\n <ApplicationFooterLink\n href={item.href}\n key={item.label}\n onClick={item.onClick}\n sx={{ mb: 0.5 }}\n >\n {item.label}\n </ApplicationFooterLink>\n ))}\n </ApplicationFooterLinkSection>\n ))}\n </Container>\n </Box>\n );\n};\n"],"mappings":"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"}
|
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
import { RouterService as e } from "../classes/services/RouterService/index.js";
|
|
2
2
|
import { BreadcrumbService as t } from "../classes/services/BreadcrumbService/index.js";
|
|
3
3
|
import { container as n } from "tsyringe";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
4
|
+
import { Breadcrumbs as r, Link as i, Typography as a, useTheme as o } from "@mui/material";
|
|
5
|
+
import { useCallback as s, useMemo as c } from "react";
|
|
6
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
7
7
|
import { TestIdUtil as u } from "@gen-epix/ui-core/utils/TestIdUtil";
|
|
8
8
|
import { useMatches as d } from "react-router-dom";
|
|
9
9
|
import { useSubscribable as f } from "@gen-epix/ui-core/hooks/useSubscribable";
|
|
10
10
|
//#region src/components/ui/Breadcrumbs/Breadcrumb.tsx
|
|
11
|
-
var p = ({ isLast:
|
|
12
|
-
let u = f(n.resolve(t)), d =
|
|
13
|
-
t.preventDefault(), await n.resolve(e).router.navigate(
|
|
14
|
-
}, [
|
|
15
|
-
return
|
|
11
|
+
var p = ({ isLast: r, item: o }) => {
|
|
12
|
+
let u = f(n.resolve(t)), d = c(() => u[o.handle.title] ? u[o.handle.title] : o.handle.title, [u, o.handle.title]), p = s(async (t) => {
|
|
13
|
+
t.preventDefault(), await n.resolve(e).router.navigate(o.pathname);
|
|
14
|
+
}, [o.pathname]);
|
|
15
|
+
return r ? /* @__PURE__ */ l(a, {
|
|
16
16
|
color: "textPrimary",
|
|
17
17
|
component: "h1",
|
|
18
18
|
children: d
|
|
19
|
-
}) : /* @__PURE__ */
|
|
19
|
+
}) : /* @__PURE__ */ l(i, {
|
|
20
20
|
color: "inherit",
|
|
21
|
-
href:
|
|
21
|
+
href: o.pathname,
|
|
22
22
|
onClick: p,
|
|
23
23
|
underline: "hover",
|
|
24
24
|
children: d
|
|
25
25
|
});
|
|
26
26
|
}, m = () => {
|
|
27
|
-
let e = d().filter((e) => !e.handle.hidden).filter((e, t, n) => !n.slice(t + 1).find((t) => t.pathname === `${e.pathname}/`)), t =
|
|
28
|
-
return /* @__PURE__ */
|
|
27
|
+
let e = d().filter((e) => !e.handle.hidden).filter((e, t, n) => !n.slice(t + 1).find((t) => t.pathname === `${e.pathname}/`)), t = o();
|
|
28
|
+
return /* @__PURE__ */ l(r, {
|
|
29
29
|
"aria-label": "breadcrumbs",
|
|
30
30
|
...u.createAttributes("Breadcrumbs"),
|
|
31
31
|
sx: { height: t.spacing(3) },
|
|
32
|
-
children: e.map((t, n) => /* @__PURE__ */
|
|
32
|
+
children: e.map((t, n) => /* @__PURE__ */ l(p, {
|
|
33
33
|
isLast: n === e.length - 1,
|
|
34
34
|
item: t
|
|
35
35
|
}, t.id))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Breadcrumbs.js","names":["
|
|
1
|
+
{"version":3,"file":"Breadcrumbs.js","names":["Breadcrumbs","MuiBreadcrumbs","Breadcrumb","breadcrumbsTitles","useSubscribable","container","BreadcrumbService","title","useMemo","item","onLinkClick","useCallback","event","RouterService","isLast","Typography","Link","Breadcrumbs$1","matches","useMatches","match","originalMatches","index","m","theme","useTheme","Breadcrumbs","TestIdUtil"],"sources":["../../src/components/ui/Breadcrumbs/Breadcrumb.tsx","../../src/components/ui/Breadcrumbs/Breadcrumbs.tsx"],"sourcesContent":["import { container } from 'tsyringe';\nimport {\n Link,\n Typography,\n} from '@mui/material';\nimport type {\n ReactElement,\n MouseEvent as ReactMouseEvent,\n} from 'react';\nimport {\n useCallback,\n useMemo,\n} from 'react';\nimport type { UIMatch } from 'react-router';\nimport { useSubscribable } from '@gen-epix/ui-core/hooks/useSubscribable';\n\nimport { BreadcrumbService } from '../../../classes/services/BreadcrumbService';\nimport { RouterService } from '../../../classes/services/RouterService';\nimport type { MyNonIndexRouteObject } from '../../../models/react-router.models';\n\ntype BreadcrumbProps = {\n readonly isLast: boolean;\n readonly item: UIMatch<unknown, MyNonIndexRouteObject['handle']>;\n};\n\nexport const Breadcrumb = ({ isLast, item }: BreadcrumbProps): ReactElement => {\n const breadcrumbsTitles = useSubscribable(container.resolve(BreadcrumbService));\n\n const title = useMemo(() => {\n if (breadcrumbsTitles[item.handle.title]) {\n return breadcrumbsTitles[item.handle.title];\n }\n return item.handle.title;\n }, [breadcrumbsTitles, item.handle.title]);\n\n const onLinkClick = useCallback(async (event: ReactMouseEvent<HTMLAnchorElement>) => {\n event.preventDefault();\n await container.resolve(RouterService).router.navigate(item.pathname);\n }, [item.pathname]);\n\n if (!isLast) {\n return (\n <Link\n color={'inherit'}\n href={item.pathname}\n onClick={onLinkClick}\n underline={'hover'}\n >\n {title}\n </Link>\n\n );\n }\n return (\n <Typography\n color={'textPrimary'}\n component={'h1'}\n >\n {title}\n </Typography>\n );\n};\n","import type { UIMatch } from 'react-router-dom';\nimport { useMatches } from 'react-router-dom';\nimport {\n Breadcrumbs as MuiBreadcrumbs,\n useTheme,\n} from '@mui/material';\nimport { TestIdUtil } from '@gen-epix/ui-core/utils/TestIdUtil';\n\nimport type { MyNonIndexRouteObject } from '../../../models/react-router.models';\n\nimport { Breadcrumb } from './Breadcrumb';\n\nexport const Breadcrumbs = () => {\n const matches = (useMatches() as UIMatch<unknown, MyNonIndexRouteObject['handle']>[])\n // remove hidden routes\n .filter((match) => !match.handle.hidden)\n // remove equal routes (must be in separate filter)\n .filter((match, index, originalMatches) => !originalMatches.slice(index + 1).find(m => m.pathname === `${match.pathname}/`));\n const theme = useTheme();\n\n return (\n <MuiBreadcrumbs\n aria-label={'breadcrumbs'}\n {...TestIdUtil.createAttributes('Breadcrumbs')}\n sx={{\n height: theme.spacing(3),\n }}\n >\n {matches.map((match, index) => (\n <Breadcrumb\n isLast={index === matches.length - 1}\n item={match}\n key={match.id}\n />\n ))}\n </MuiBreadcrumbs>\n );\n};\n"],"mappings":";;;;;;;;;;AAyBA,IAAaE,KAAc,EAAE,WAAQ,cAA0C;CAC7E,IAAMC,IAAoBC,EAAgBC,EAAU,QAAQC,CAAiB,CAAC,GAExEC,IAAQC,QACRL,EAAkBM,EAAK,OAAO,SACzBN,EAAkBM,EAAK,OAAO,SAEhCA,EAAK,OAAO,OAClB,CAACN,GAAmBM,EAAK,OAAO,KAAK,CAAC,GAEnCC,IAAcC,EAAY,OAAO,MAA8C;EAEnF,AADAC,EAAM,eAAe,GACrB,MAAMP,EAAU,QAAQQ,CAAa,CAAC,CAAC,OAAO,SAASJ,EAAK,QAAQ;CACtE,GAAG,CAACA,EAAK,QAAQ,CAAC;CAelB,OAbKK,IAcH,kBAACC,GAAD;EACE,OAAO;EACP,WAAW;EAEV,UAAAR;CACS,CAAA,IAjBV,kBAACS,GAAD;EACE,OAAO;EACP,MAAMP,EAAK;EACX,SAASC;EACT,WAAW;EAEV,UAAAH;CACG,CAAA;AAYZ,GCjDaP,UAAoB;CAC/B,IAAMkB,IAAWC,EAAW,CAAC,CAE1B,QAAQ,MAAU,CAACC,EAAM,OAAO,MAAM,CAAC,CAEvC,QAAQ,GAAO,GAAO,MAAoB,CAACC,EAAgB,MAAMC,IAAQ,CAAC,CAAC,CAAC,MAAK,MAAKC,EAAE,aAAa,GAAGH,EAAM,SAAS,EAAE,CAAC,GACvHI,IAAQC,EAAS;CAEvB,OACE,kBAACxB,GAAD;EACE,cAAY;EACZ,GAAI0B,EAAW,iBAAiB,aAAa;EAC7C,IAAI,EACF,QAAQH,EAAM,QAAQ,CAAC,EACzB;EAEC,UAAAN,EAAQ,KAAK,GAAO,MACnB,kBAAChB,GAAD;GACE,QAAQoB,MAAUJ,EAAQ,SAAS;GACnC,MAAME;EAEP,GADMA,EAAM,EACZ,CACF;CACa,CAAA;AAEpB"}
|