@m4l/components 0.1.74 → 0.1.75
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/@types/export.d.ts +46 -1
- package/components/AccountPopover/classes/constants.d.ts +1 -1
- package/components/AccountPopover/classes/index.d.ts +7 -1
- package/components/AccountPopover/classes/types.d.ts +9 -1
- package/components/AccountPopover/index.93aefccd.js +265 -0
- package/components/AccountPopover/subcomponents/PopOver/types.d.ts +2 -1
- package/components/AccountPopover/types.d.ts +13 -0
- package/components/AppBar/classes/index.d.ts +3 -1
- package/components/AppBar/classes/types.d.ts +4 -0
- package/components/AppBar/index.cc974d56.js +85 -0
- package/components/AppBar/tests/constants.d.ts +1 -1
- package/components/AppBar/types.d.ts +3 -2
- package/components/CommonActions/classes/index.d.ts +1 -1
- package/components/CommonActions/classes/types.d.ts +3 -2
- package/components/CommonActions/components/ActionCancel/{index.fad4a0dc.js → index.574ea031.js} +3 -3
- package/components/CommonActions/components/ActionFormCancel/{index.a26820a9.js → index.e62db5d3.js} +20 -20
- package/components/CommonActions/components/ActionFormIntro/{index.403d8952.js → index.304da410.js} +4 -4
- package/components/CommonActions/components/ActionIntro/{index.0fb6efbe.js → index.d635cbc4.js} +4 -4
- package/components/CommonActions/components/Actions/{index.51b9c92a.js → index.37ffde59.js} +35 -25
- package/components/CommonActions/tests/constants.d.ts +1 -0
- package/components/CommonActions/tests/utils.d.ts +2 -0
- package/components/DataGrid/{index.dbae54dd.js → index.c0c626cd.js} +20 -20
- package/components/DraggableWindow/index.b95a678e.js +39 -0
- package/components/DynamicFilter/{index.cb7fd1b6.js → index.3034c6ba.js} +32 -32
- package/components/HelperText/{index.d449d124.js → index.ec9b3e6a.js} +9 -9
- package/components/Icon/{index.d214a74d.js → index.f9119f5e.js} +6 -63
- package/components/Image/{index.1af119da.js → index.8aae9322.js} +1 -1
- package/components/LanguagePopover/classes/index.d.ts +1 -1
- package/components/LanguagePopover/{index.4fef99ac.js → index.491e1306.js} +10 -10
- package/components/Loadable/{index.117eaced.js → index.e994fc3e.js} +1 -1
- package/components/ModalDialog/{index.6c35e653.js → index.f652ea12.js} +6 -6
- package/components/NavLink/{index.9e56bcd3.js → index.f8aee9f4.js} +10 -10
- package/components/NoItemSelected/{index.cd842b62.js → index.cce86db4.js} +1 -1
- package/components/ObjectLogs/{index.e1a1b27c.js → index.c31b3f8b.js} +16 -16
- package/components/PaperForm/{index.76bd3a6d.js → index.d79c6f76.js} +1 -1
- package/components/Period/{index.b93d22fa.js → index.ff110093.js} +19 -19
- package/components/Resizeable/{index.834a9144.js → index.41a8048b.js} +1 -1
- package/components/SideBar/classes/index.d.ts +1 -1
- package/components/SideBar/{index.ff7cbe91.js → index.1ae13a73.js} +6 -6
- package/components/SplitLayout/SplitLayout.d.ts +3 -0
- package/components/SplitLayout/classes/constants.d.ts +1 -0
- package/components/SplitLayout/classes/index.d.ts +9 -0
- package/components/SplitLayout/classes/types.d.ts +10 -0
- package/components/SplitLayout/index.9ef430f6.js +99 -0
- package/components/SplitLayout/index.d.ts +2 -3
- package/components/SplitLayout/styles.d.ts +1 -1
- package/components/SplitLayout/tests/constants.d.ts +1 -0
- package/components/SplitLayout/tests/utils.d.ts +2 -0
- package/components/SplitLayout/types.d.ts +2 -0
- package/components/animate/PropagateLoader/{index.be5b02c3.js → index.7fab43c8.js} +1 -1
- package/components/animate/index.1f8eadd4.js +66 -0
- package/components/areas/components/AreasAdmin/{index.1eda80b9.js → index.158621e0.js} +31 -31
- package/components/areas/components/AreasViewer/{index.eddc9945.js → index.621c0de4.js} +50 -44
- package/components/areas/components/index.2ed9d60b.js +14 -0
- package/components/areas/contexts/AreasContext/{index.a88b73a6.js → index.d98b89fc.js} +2 -2
- package/components/areas/contexts/{index.7dd01403.js → index.79d1912d.js} +1 -1
- package/components/areas/hooks/useAreas/{index.7a37ede8.js → index.a7b597fb.js} +1 -1
- package/components/areas/{index.95c4ed37.js → index.d6b8e205.js} +5 -5
- package/components/formatters/BooleanFormatter/{index.820a2130.js → index.60aa1c9d.js} +1 -1
- package/components/formatters/{index.0c692a4b.js → index.1f0efb32.js} +2 -2
- package/components/hook-form/RHFAutocomplete/{index.72437d8a.js → index.af3296ac.js} +11 -11
- package/components/hook-form/RHFAutocompleteAsync/{index.2a84f2b2.js → index.76864056.js} +2 -2
- package/components/hook-form/RHFCheckbox/{index.6e6389e7.js → index.865ba239.js} +3 -3
- package/components/hook-form/RHFDateTime/classes/index.d.ts +1 -1
- package/components/hook-form/RHFDateTime/{index.745b101b.js → index.fd9c5aca.js} +65 -57
- package/components/hook-form/RHFDateTime/test/constants.d.ts +1 -0
- package/components/hook-form/RHFDateTime/test/utils.d.ts +2 -0
- package/components/hook-form/RHFPeriod/{index.6969af99.js → index.77486f61.js} +2 -2
- package/components/hook-form/RHFTextField/{index.ca7393a7.js → index.abcbc2d3.js} +6 -6
- package/components/hook-form/RHFUpload/{index.d74ca00d.js → index.522bcad5.js} +1 -1
- package/components/index.d.ts +1 -1
- package/components/modal/{WindowBase.9b93578e.js → WindowBase.c223e4da.js} +11 -11
- package/components/modal/{WindowConfirm.7ec9dcd3.js → WindowConfirm.023e293f.js} +16 -16
- package/components/modal/index.dbce0cab.js +36 -0
- package/components/mui_extended/Accordion/{index.09a89d3d.js → index.03bd0e2a.js} +2 -2
- package/components/mui_extended/Avatar/{index.d.ts → Avatar.d.ts} +0 -1
- package/components/mui_extended/Avatar/classes/constants.d.ts +1 -0
- package/components/mui_extended/Avatar/classes/index.d.ts +7 -0
- package/components/mui_extended/Avatar/classes/types.d.ts +7 -0
- package/components/mui_extended/Avatar/index.1e1a91a3.js +69 -0
- package/components/mui_extended/Avatar/styles.d.ts +2 -0
- package/components/mui_extended/Avatar/subcomponents/SkeletonAvatar/index.d.ts +2 -1
- package/components/mui_extended/Avatar/subcomponents/SkeletonAvatar/types.d.ts +3 -0
- package/components/mui_extended/Avatar/tests/constants.d.ts +1 -0
- package/components/mui_extended/Avatar/tests/utils.d.ts +2 -0
- package/components/mui_extended/Avatar/types.d.ts +1 -5
- package/components/mui_extended/Button/{index.f9d54780.js → index.aebbab34.js} +5 -4
- package/components/mui_extended/IconButton/{index.822cdaac.js → index.3b05af71.js} +1 -1
- package/components/mui_extended/MenuActions/{index.03403529.js → index.ca5ce35a.js} +2 -2
- package/components/mui_extended/Pager/{index.6428b07c.js → index.80ec975a.js} +1 -1
- package/components/mui_extended/Typography/{index.e2d9e3f2.js → index.443590d6.js} +1 -1
- package/components/mui_extended/index.6dcdbb1f.js +20 -0
- package/components/mui_extended/index.d.ts +1 -1
- package/contexts/ModalContext/{index.0484ca54.js → index.a0de81f0.js} +1 -1
- package/hooks/useModal/{index.c6069beb.js → index.26075cdd.js} +1 -1
- package/index.js +207 -203
- package/package.json +1 -1
- package/{react-draggable.17b4ec8a.js → react-draggable.e625b0d1.js} +1 -1
- package/{react-resizable.ffd7c2aa.js → react-resizable.24367d77.js} +2 -2
- package/test/constants_no_mock.86c553a9.js +4 -0
- package/utils/{index.aca80f3a.js → index.b61dccbe.js} +0 -5
- package/components/AccountPopover/subcomponents/PopOver/styles.d.ts +0 -8
- package/components/SplitLayout/index.5a8355d8.js +0 -133
- package/components/areas/components/index.f3a98b6d.js +0 -14
- package/components/modal/index.dba72820.js +0 -36
- package/components/mui_extended/Avatar/index.fe06afd7.js +0 -51
- package/components/mui_extended/index.b4ced9e3.js +0 -20
- package/vendor.99e0c856.js +0 -456
- /package/components/{AppBar → AccountPopover}/subcomponents/MyAvatar/createAvatar.d.ts +0 -0
- /package/components/{AppBar → AccountPopover}/subcomponents/MyAvatar/index.d.ts +0 -0
- /package/{node_modules.416f1da3.js → react-spinners.342a6578.js} +0 -0
package/@types/export.d.ts
CHANGED
|
@@ -35,6 +35,9 @@ import { RHFDateTimeProps } from '../components/hook-form/RHFDateTime/types';
|
|
|
35
35
|
import { RHFDateTimeClassesKey } from '../components/hook-form/RHFDateTime/classes/types';
|
|
36
36
|
import { AreasAdminClassesKey } from '../components/areas/components/AreasAdmin/classes/types';
|
|
37
37
|
import { AreasViewerClassesKey } from '../components/areas/components/AreasViewer/classes/types';
|
|
38
|
+
import { AppBarProps } from 'src/components/AppBar/types';
|
|
39
|
+
import { AccountPopoverProps } from 'src/components/AccountPopover/types';
|
|
40
|
+
import { SplitLayoutProps } from 'src/components/SplitLayout';
|
|
38
41
|
|
|
39
42
|
export {};
|
|
40
43
|
|
|
@@ -47,6 +50,7 @@ declare module '@mui/material/styles' {
|
|
|
47
50
|
M4LRHFTextFieldPassword: RHFTextFieldPasswordProps;
|
|
48
51
|
M4LRHFAutocomplete: RHFAutocompleteProps;
|
|
49
52
|
M4LRHFAutocompleteAsync: RHFAutocompleteAsyncProps;
|
|
53
|
+
M4LRHFDateTime: RHFDateTimeProps;
|
|
50
54
|
M4LIcon: IconProps;
|
|
51
55
|
M4LIconButton: IconButtonProps;
|
|
52
56
|
M4LanguagePopover: undefined;
|
|
@@ -60,7 +64,11 @@ declare module '@mui/material/styles' {
|
|
|
60
64
|
M4LoadingButton: MuiLabLoadingButtonProps;
|
|
61
65
|
M4LNavLink: NavLinkProps;
|
|
62
66
|
M4LSideBar: SideBarProps;
|
|
63
|
-
|
|
67
|
+
M4LAppBar: AppBarProps;
|
|
68
|
+
M4LAvatar: AvatarProps;
|
|
69
|
+
M4LAccountPopover: AccountPopoverProps;
|
|
70
|
+
M4LSplitLayout: SplitLayoutProps;
|
|
71
|
+
|
|
64
72
|
}
|
|
65
73
|
|
|
66
74
|
interface ComponentNameToClassKey {
|
|
@@ -84,11 +92,19 @@ declare module '@mui/material/styles' {
|
|
|
84
92
|
M4LoadingButton: LoadingbuttonClassesKey;
|
|
85
93
|
M4LNavLink: ButtonBaseClassKey;
|
|
86
94
|
M4LSideBar: SideBarClassesKey;
|
|
95
|
+
M4LAppBar: AppBarClassesKey;
|
|
87
96
|
M4LSideBarPopover: SideBarClassesKey;
|
|
88
97
|
M4LSideBarDrawer: SideBarClassesKey;
|
|
89
98
|
M4LRHFDateTime: RHFDateTimeClassesKey;
|
|
90
99
|
M4LAreasViewer: AreasViewerClassesKey;
|
|
91
100
|
M4LAreasAdmin: AreasAdminClassesKey;
|
|
101
|
+
M4LAvatar: AvatarClassesKey;
|
|
102
|
+
M4LAccountPopover: AccountPopoverClassesKey;
|
|
103
|
+
M4LAccountPopoverPopover: AccountPopoverClassesKey;
|
|
104
|
+
M4LModuleLayout: ModuleLayoutClassesKey;
|
|
105
|
+
M4LMasterDetailLayout: MasterDetailLayoutClassesKey;
|
|
106
|
+
M4LSplitLayout: SplitLayoutClassesKey;
|
|
107
|
+
M4LCommonActions: CommonActionsClassesKey;
|
|
92
108
|
}
|
|
93
109
|
|
|
94
110
|
interface Components {
|
|
@@ -184,6 +200,10 @@ declare module '@mui/material/styles' {
|
|
|
184
200
|
styleOverrides?: ComponentsOverrides<Theme>['M4LSideBar'];
|
|
185
201
|
defaultProps?: ComponentsProps['M4LSideBar'];
|
|
186
202
|
};
|
|
203
|
+
M4LAppBar?: {
|
|
204
|
+
styleOverrides?: ComponentsOverrides<Theme>['M4LAppBar'];
|
|
205
|
+
defaultProps?: ComponentsProps['M4LAppBar'];
|
|
206
|
+
};
|
|
187
207
|
M4LSideBarPopover?: {
|
|
188
208
|
styleOverrides?: ComponentsOverrides<Theme>['M4LSideBarPopover'];
|
|
189
209
|
defaultProps?: ComponentsProps['M4LSideBarPopover'];
|
|
@@ -204,5 +224,30 @@ declare module '@mui/material/styles' {
|
|
|
204
224
|
M4LAreasAdmin?: {
|
|
205
225
|
styleOverrides?: ComponentsOverrides<Theme>['M4LAreasAdmin'];
|
|
206
226
|
};
|
|
227
|
+
M4LAvatar?: {
|
|
228
|
+
styleOverrides?: ComponentsOverrides<Theme>['M4LAvatar'];
|
|
229
|
+
defaultProps?: ComponentsProps['M4LAvatar'];
|
|
230
|
+
};
|
|
231
|
+
M4LAccountPopover?: {
|
|
232
|
+
styleOverrides?: ComponentsOverrides<Theme>['M4LAccountPopover'];
|
|
233
|
+
defaultProps?: ComponentsProps['M4LAccountPopover'];
|
|
234
|
+
};
|
|
235
|
+
M4LAccountPopoverPopover?: {
|
|
236
|
+
styleOverrides?: ComponentsOverrides<Theme>['M4LAccountPopoverPopover'];
|
|
237
|
+
};
|
|
238
|
+
M4LModuleLayout?: {
|
|
239
|
+
styleOverrides?: ComponentsOverrides<Theme>['M4LModuleLayout'];
|
|
240
|
+
};
|
|
241
|
+
M4LMasterDetailLayout?: {
|
|
242
|
+
styleOverrides?: ComponentsOverrides<Theme>['MasterDetailLayout'];
|
|
243
|
+
};
|
|
244
|
+
M4LSplitLayout?: {
|
|
245
|
+
styleOverrides?: ComponentsOverrides<Theme>['M4LSplitLayout'];
|
|
246
|
+
defaultProps?: ComponentsProps['M4LSplitLayout'];
|
|
247
|
+
};
|
|
248
|
+
M4LCommonActions?: {
|
|
249
|
+
styleOverrides?: ComponentsOverrides<Theme>['M4LCommonActions'];
|
|
250
|
+
defaultProps?: ComponentsProps['M4LCommonActions'];
|
|
251
|
+
};
|
|
207
252
|
}
|
|
208
253
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const componentName = "
|
|
1
|
+
export declare const componentName = "M4LAccountPopover";
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { AccountPopoverClassesType } from './types';
|
|
2
2
|
export declare const accountPopoverClasses: AccountPopoverClassesType;
|
|
3
3
|
export declare function getAccountPopoverClassesUtilityClass(slot: string): string;
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const useAccountPopoverUtilityClasses: () => {
|
|
5
5
|
root: string;
|
|
6
6
|
containerUserInfo: string;
|
|
7
|
+
popover: string;
|
|
8
|
+
containerAppVersion: string;
|
|
9
|
+
containerMenuItems: string;
|
|
10
|
+
containerProgress: string;
|
|
11
|
+
logOut: string;
|
|
12
|
+
menuItem: string;
|
|
7
13
|
};
|
|
@@ -1,5 +1,13 @@
|
|
|
1
|
+
import { useAccountPopoverUtilityClasses } from ".";
|
|
1
2
|
export interface AccountPopoverClassesType {
|
|
2
3
|
root: string;
|
|
3
4
|
containerUserInfo: string;
|
|
5
|
+
popover: string;
|
|
6
|
+
containerAppVersion: string;
|
|
7
|
+
containerMenuItems: string;
|
|
8
|
+
containerProgress: string;
|
|
9
|
+
logOut: string;
|
|
10
|
+
menuItem: string;
|
|
4
11
|
}
|
|
5
|
-
export declare type
|
|
12
|
+
export declare type AccountPopoverClassesKey = keyof AccountPopoverClassesType;
|
|
13
|
+
export declare type Classes = ReturnType<typeof useAccountPopoverUtilityClasses>;
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
import { useModuleDictionary, useNetwork } from "@m4l/core";
|
|
2
|
+
import { useState, useEffect } from "react";
|
|
3
|
+
import { styled, generateUtilityClasses, generateUtilityClass, useTheme } from "@mui/material";
|
|
4
|
+
import "../Icon/index.f9119f5e.js";
|
|
5
|
+
import "clsx";
|
|
6
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
import "../mui_extended/IconButton/index.3b05af71.js";
|
|
8
|
+
import "@m4l/graphics";
|
|
9
|
+
import "../mui_extended/Accordion/index.03bd0e2a.js";
|
|
10
|
+
import { A as Avatar } from "../mui_extended/Avatar/index.1e1a91a3.js";
|
|
11
|
+
import "react-router-dom";
|
|
12
|
+
import "@mui/material/Button";
|
|
13
|
+
import "../mui_extended/Button/index.aebbab34.js";
|
|
14
|
+
import "../Image/index.8aae9322.js";
|
|
15
|
+
import "@mui/lab";
|
|
16
|
+
import { T as Typography } from "../mui_extended/Typography/index.443590d6.js";
|
|
17
|
+
import { P as Popover } from "../mui_extended/Popover/index.9f35d0eb.js";
|
|
18
|
+
import "../mui_extended/MenuActions/index.ca5ce35a.js";
|
|
19
|
+
import "../mui_extended/Pager/index.80ec975a.js";
|
|
20
|
+
import "../mui_extended/Tab/index.e0653a0a.js";
|
|
21
|
+
import { T as TEST_PROP_ID } from "../../test/constants_no_mock.86c553a9.js";
|
|
22
|
+
import { C as CircularProgress } from "../mui_extended/CircularProgress/index.ad569afd.js";
|
|
23
|
+
import { unstable_composeClasses } from "@mui/base";
|
|
24
|
+
const PRIMARY_NAME = ["A", "N", "H", "L", "Q", "9", "8"];
|
|
25
|
+
const INFO_NAME = ["F", "G", "T", "I", "J", "1", "2", "3"];
|
|
26
|
+
const SUCCESS_NAME = ["K", "D", "Y", "B", "O", "4", "5"];
|
|
27
|
+
const WARNING_NAME = ["P", "E", "R", "S", "C", "U", "6", "7"];
|
|
28
|
+
const ERROR_NAME = ["V", "W", "X", "M", "Z"];
|
|
29
|
+
function getFirstCharacter(name) {
|
|
30
|
+
return name && name.charAt(0).toUpperCase();
|
|
31
|
+
}
|
|
32
|
+
function getAvatarColor(name) {
|
|
33
|
+
if (PRIMARY_NAME.includes(getFirstCharacter(name)))
|
|
34
|
+
return "primary";
|
|
35
|
+
if (INFO_NAME.includes(getFirstCharacter(name)))
|
|
36
|
+
return "info";
|
|
37
|
+
if (SUCCESS_NAME.includes(getFirstCharacter(name)))
|
|
38
|
+
return "success";
|
|
39
|
+
if (WARNING_NAME.includes(getFirstCharacter(name)))
|
|
40
|
+
return "warning";
|
|
41
|
+
if (ERROR_NAME.includes(getFirstCharacter(name)))
|
|
42
|
+
return "error";
|
|
43
|
+
return "default";
|
|
44
|
+
}
|
|
45
|
+
function createAvatar(name) {
|
|
46
|
+
return {
|
|
47
|
+
name: getFirstCharacter(name),
|
|
48
|
+
color: getAvatarColor(name)
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
function MyAvatar({
|
|
52
|
+
...other
|
|
53
|
+
}) {
|
|
54
|
+
return /* @__PURE__ */ jsx(
|
|
55
|
+
Avatar,
|
|
56
|
+
{
|
|
57
|
+
src: "",
|
|
58
|
+
alt: "full_name",
|
|
59
|
+
color: "default",
|
|
60
|
+
...other,
|
|
61
|
+
children: createAvatar("").name
|
|
62
|
+
}
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
const AcountPopOverRoot = styled("div")(({
|
|
66
|
+
theme
|
|
67
|
+
}) => ({
|
|
68
|
+
...theme.components?.M4LAccountPopover?.styleOverrides
|
|
69
|
+
}));
|
|
70
|
+
const componentName = "M4LAccountPopover";
|
|
71
|
+
generateUtilityClasses(componentName, [
|
|
72
|
+
"root",
|
|
73
|
+
"containerUserInfo",
|
|
74
|
+
"popover",
|
|
75
|
+
"containerAppVersion",
|
|
76
|
+
"containerMenuItems",
|
|
77
|
+
"containerProgress",
|
|
78
|
+
"logOut",
|
|
79
|
+
"menuItem"
|
|
80
|
+
]);
|
|
81
|
+
function getAccountPopoverClassesUtilityClass(slot) {
|
|
82
|
+
return generateUtilityClass(componentName, slot);
|
|
83
|
+
}
|
|
84
|
+
const useAccountPopoverUtilityClasses = () => {
|
|
85
|
+
const slots = {
|
|
86
|
+
root: ["root"],
|
|
87
|
+
containerUserInfo: ["containerUserInfo"],
|
|
88
|
+
popover: ["popover"],
|
|
89
|
+
containerAppVersion: ["containerAppVersion"],
|
|
90
|
+
containerMenuItems: ["containerMenuItems"],
|
|
91
|
+
containerProgress: ["containerProgress"],
|
|
92
|
+
logOut: ["logOut"],
|
|
93
|
+
menuItem: ["menuItem"]
|
|
94
|
+
};
|
|
95
|
+
const composedClasses = unstable_composeClasses(slots, getAccountPopoverClassesUtilityClass, {});
|
|
96
|
+
return {
|
|
97
|
+
...composedClasses
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
const MenuPopOver = (props) => {
|
|
101
|
+
const {
|
|
102
|
+
setOpen,
|
|
103
|
+
open,
|
|
104
|
+
data,
|
|
105
|
+
handleClick: onClick,
|
|
106
|
+
version,
|
|
107
|
+
handleLogOut,
|
|
108
|
+
classes,
|
|
109
|
+
userData
|
|
110
|
+
} = props;
|
|
111
|
+
const {
|
|
112
|
+
getLabel
|
|
113
|
+
} = useModuleDictionary();
|
|
114
|
+
const theme = useTheme();
|
|
115
|
+
const handleClick = (item) => {
|
|
116
|
+
onClick(item);
|
|
117
|
+
handleClose();
|
|
118
|
+
};
|
|
119
|
+
const handleClose = () => {
|
|
120
|
+
setOpen(null);
|
|
121
|
+
};
|
|
122
|
+
return /* @__PURE__ */ jsxs(Popover, {
|
|
123
|
+
open: Boolean(open),
|
|
124
|
+
anchorEl: open,
|
|
125
|
+
onClose: handleClose,
|
|
126
|
+
onBlur: handleClose,
|
|
127
|
+
className: classes.popover,
|
|
128
|
+
arrowType: "top-right",
|
|
129
|
+
anchorOrigin: {
|
|
130
|
+
vertical: "bottom",
|
|
131
|
+
horizontal: "center"
|
|
132
|
+
},
|
|
133
|
+
transformOrigin: {
|
|
134
|
+
vertical: "top",
|
|
135
|
+
horizontal: "right"
|
|
136
|
+
},
|
|
137
|
+
...process.env.NODE_ENV !== "production" ? {
|
|
138
|
+
[TEST_PROP_ID]: getAccountPopoverClassesUtilityClass("popover")
|
|
139
|
+
} : {},
|
|
140
|
+
sx: {
|
|
141
|
+
ml: "26px",
|
|
142
|
+
mt: "10px",
|
|
143
|
+
maxWidth: "200px",
|
|
144
|
+
width: "200px",
|
|
145
|
+
...theme.components?.M4LAccountPopoverPopover?.styleOverrides
|
|
146
|
+
},
|
|
147
|
+
children: [/* @__PURE__ */ jsxs("div", {
|
|
148
|
+
className: classes.containerUserInfo,
|
|
149
|
+
...process.env.NODE_ENV !== "production" ? {
|
|
150
|
+
[TEST_PROP_ID]: getAccountPopoverClassesUtilityClass("containerUserInfo")
|
|
151
|
+
} : {},
|
|
152
|
+
children: [/* @__PURE__ */ jsx(Typography, {
|
|
153
|
+
variant: "subtitle2",
|
|
154
|
+
noWrap: true,
|
|
155
|
+
children: `${userData?.first_name} ${userData?.last_name}`
|
|
156
|
+
}), /* @__PURE__ */ jsx(Typography, {
|
|
157
|
+
variant: "body2",
|
|
158
|
+
sx: {
|
|
159
|
+
color: "text.secondary"
|
|
160
|
+
},
|
|
161
|
+
noWrap: true,
|
|
162
|
+
children: userData?.email
|
|
163
|
+
})]
|
|
164
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
165
|
+
className: classes.containerAppVersion,
|
|
166
|
+
...process.env.NODE_ENV !== "production" ? {
|
|
167
|
+
[TEST_PROP_ID]: getAccountPopoverClassesUtilityClass("containerAppVersion")
|
|
168
|
+
} : {},
|
|
169
|
+
children: /* @__PURE__ */ jsx(Typography, {
|
|
170
|
+
variant: "subtitle2",
|
|
171
|
+
noWrap: true,
|
|
172
|
+
children: `${getLabel("version")} ${version}`
|
|
173
|
+
})
|
|
174
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
175
|
+
className: classes.containerMenuItems,
|
|
176
|
+
...process.env.NODE_ENV !== "production" ? {
|
|
177
|
+
[TEST_PROP_ID]: getAccountPopoverClassesUtilityClass("containerMenuItems")
|
|
178
|
+
} : {},
|
|
179
|
+
children: data ? data.length !== 0 && data.map((option) => /* @__PURE__ */ jsx("div", {
|
|
180
|
+
onClick: () => handleClick(option),
|
|
181
|
+
className: classes.menuItem,
|
|
182
|
+
...process.env.NODE_ENV !== "production" ? {
|
|
183
|
+
[TEST_PROP_ID]: getAccountPopoverClassesUtilityClass("menuItem")
|
|
184
|
+
} : {},
|
|
185
|
+
children: option.title
|
|
186
|
+
}, option.title)) : /* @__PURE__ */ jsx("div", {
|
|
187
|
+
className: classes.containerProgress,
|
|
188
|
+
...process.env.NODE_ENV !== "production" ? {
|
|
189
|
+
[TEST_PROP_ID]: getAccountPopoverClassesUtilityClass("containerProgress")
|
|
190
|
+
} : {},
|
|
191
|
+
children: /* @__PURE__ */ jsx(CircularProgress, {
|
|
192
|
+
size: "20px"
|
|
193
|
+
})
|
|
194
|
+
})
|
|
195
|
+
}), /* @__PURE__ */ jsx("div", {
|
|
196
|
+
onClick: handleLogOut,
|
|
197
|
+
className: classes.logOut,
|
|
198
|
+
...process.env.NODE_ENV !== "production" ? {
|
|
199
|
+
[TEST_PROP_ID]: getAccountPopoverClassesUtilityClass("logOut")
|
|
200
|
+
} : {},
|
|
201
|
+
children: getLabel("logout")
|
|
202
|
+
})]
|
|
203
|
+
});
|
|
204
|
+
};
|
|
205
|
+
const AccountPopover = (props) => {
|
|
206
|
+
const {
|
|
207
|
+
handleClick,
|
|
208
|
+
version,
|
|
209
|
+
handleLogOut,
|
|
210
|
+
userData
|
|
211
|
+
} = props;
|
|
212
|
+
const [open, setOpen] = useState(null);
|
|
213
|
+
const [asyncState, setAsyncState] = useState("unLoad");
|
|
214
|
+
const [menuData, setMenuData] = useState([]);
|
|
215
|
+
const {
|
|
216
|
+
networkOperation
|
|
217
|
+
} = useNetwork();
|
|
218
|
+
useEffect(() => {
|
|
219
|
+
let mounted = true;
|
|
220
|
+
if (open && asyncState === "unLoad") {
|
|
221
|
+
setAsyncState("loading");
|
|
222
|
+
networkOperation({
|
|
223
|
+
method: "GET",
|
|
224
|
+
endPoint: `menus`,
|
|
225
|
+
parms: {
|
|
226
|
+
position: 1
|
|
227
|
+
}
|
|
228
|
+
}).then((response) => {
|
|
229
|
+
if (mounted) {
|
|
230
|
+
setAsyncState("loaded");
|
|
231
|
+
setMenuData(response.data);
|
|
232
|
+
}
|
|
233
|
+
}).catch((_error) => {
|
|
234
|
+
console.error("AccountData network request error - get menus", _error);
|
|
235
|
+
});
|
|
236
|
+
}
|
|
237
|
+
return function cleanUp() {
|
|
238
|
+
mounted = false;
|
|
239
|
+
};
|
|
240
|
+
}, [open]);
|
|
241
|
+
const handleOpen = (event) => {
|
|
242
|
+
setOpen(event.currentTarget);
|
|
243
|
+
};
|
|
244
|
+
const classes = useAccountPopoverUtilityClasses();
|
|
245
|
+
return /* @__PURE__ */ jsxs(AcountPopOverRoot, {
|
|
246
|
+
className: classes.root,
|
|
247
|
+
...process.env.NODE_ENV !== "production" ? {
|
|
248
|
+
[TEST_PROP_ID]: getAccountPopoverClassesUtilityClass("root")
|
|
249
|
+
} : {},
|
|
250
|
+
onClick: handleOpen,
|
|
251
|
+
children: [/* @__PURE__ */ jsx(MyAvatar, {}), /* @__PURE__ */ jsx(MenuPopOver, {
|
|
252
|
+
open,
|
|
253
|
+
setOpen,
|
|
254
|
+
data: menuData,
|
|
255
|
+
handleClick,
|
|
256
|
+
version,
|
|
257
|
+
handleLogOut,
|
|
258
|
+
classes,
|
|
259
|
+
userData
|
|
260
|
+
})]
|
|
261
|
+
});
|
|
262
|
+
};
|
|
263
|
+
export {
|
|
264
|
+
AccountPopover as A
|
|
265
|
+
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { Classes } from "../../classes/types";
|
|
1
2
|
import { AccountPopoverProps, UserMenuData } from "../../types";
|
|
2
3
|
declare type open = HTMLElement | null;
|
|
3
4
|
export interface PopOverProps extends AccountPopoverProps {
|
|
4
5
|
setOpen: (element: open) => void;
|
|
5
6
|
open: open;
|
|
6
7
|
data: Array<UserMenuData> | [];
|
|
7
|
-
classes:
|
|
8
|
+
classes: Classes;
|
|
8
9
|
}
|
|
9
10
|
export {};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Maybe } from "@m4l/core";
|
|
1
2
|
import { DomainCountry } from "@m4l/core";
|
|
2
3
|
export declare type asyncTypes = 'unLoad' | 'loading' | 'loaded';
|
|
3
4
|
export interface UserMenuData {
|
|
@@ -21,8 +22,20 @@ export interface userData {
|
|
|
21
22
|
entry_application_id: number;
|
|
22
23
|
avatar_url: string;
|
|
23
24
|
}
|
|
25
|
+
interface User {
|
|
26
|
+
email: string;
|
|
27
|
+
id: number;
|
|
28
|
+
first_name: string;
|
|
29
|
+
last_name: string;
|
|
30
|
+
account_id: number;
|
|
31
|
+
domain_country: DomainCountry;
|
|
32
|
+
avatar_url?: Maybe<string>;
|
|
33
|
+
}
|
|
34
|
+
declare type AuthUser = Maybe<User>;
|
|
24
35
|
export interface AccountPopoverProps {
|
|
25
36
|
handleClick: (item: UserMenuData) => void;
|
|
26
37
|
handleLogOut: VoidFunction;
|
|
27
38
|
version: string;
|
|
39
|
+
userData: AuthUser;
|
|
28
40
|
}
|
|
41
|
+
export {};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { AppBarClassesType } from './types';
|
|
2
2
|
export declare const appBarClasses: AppBarClassesType;
|
|
3
3
|
export declare function getAppBarClassesUtilityClass(slot: string): string;
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const useAppBarUtilityClasses: () => {
|
|
5
5
|
root: string;
|
|
6
|
+
containerChilds: string;
|
|
7
|
+
iconMenuToggle: string;
|
|
6
8
|
};
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
import { useAppBarUtilityClasses } from ".";
|
|
1
2
|
export interface AppBarClassesType {
|
|
2
3
|
root: string;
|
|
4
|
+
containerChilds: string;
|
|
5
|
+
iconMenuToggle: string;
|
|
3
6
|
}
|
|
4
7
|
export declare type AppBarClassesKey = keyof AppBarClassesType;
|
|
8
|
+
export declare type Classes = ReturnType<typeof useAppBarUtilityClasses>;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { useResponsiveDesktop } from "@m4l/graphics";
|
|
2
|
+
import { useEnvironment } from "@m4l/core";
|
|
3
|
+
import { T as TEST_PROP_ID } from "../../test/constants_no_mock.86c553a9.js";
|
|
4
|
+
import { generateUtilityClasses, generateUtilityClass } from "@mui/material";
|
|
5
|
+
import { I as IconButton } from "../mui_extended/IconButton/index.3b05af71.js";
|
|
6
|
+
import "../Icon/index.f9119f5e.js";
|
|
7
|
+
import "react";
|
|
8
|
+
import "clsx";
|
|
9
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
10
|
+
import "../mui_extended/Accordion/index.03bd0e2a.js";
|
|
11
|
+
import "../mui_extended/Avatar/index.1e1a91a3.js";
|
|
12
|
+
import "react-router-dom";
|
|
13
|
+
import "@mui/material/Button";
|
|
14
|
+
import "../mui_extended/Button/index.aebbab34.js";
|
|
15
|
+
import "../Image/index.8aae9322.js";
|
|
16
|
+
import "@mui/lab";
|
|
17
|
+
import "../mui_extended/Typography/index.443590d6.js";
|
|
18
|
+
import "../mui_extended/Popover/index.9f35d0eb.js";
|
|
19
|
+
import "../mui_extended/MenuActions/index.ca5ce35a.js";
|
|
20
|
+
import "../mui_extended/Pager/index.80ec975a.js";
|
|
21
|
+
import "../mui_extended/Tab/index.e0653a0a.js";
|
|
22
|
+
import { styled } from "@mui/material/styles";
|
|
23
|
+
import { unstable_composeClasses } from "@mui/base";
|
|
24
|
+
const AppBarRoot = styled("header")(({
|
|
25
|
+
theme
|
|
26
|
+
}) => ({
|
|
27
|
+
...theme.components?.M4LAppBar?.styleOverrides
|
|
28
|
+
}));
|
|
29
|
+
const APPBAR_PREFIX = "M4LAppBar";
|
|
30
|
+
const getNameDataTestId = (KEY) => {
|
|
31
|
+
return `${APPBAR_PREFIX}-${KEY}`;
|
|
32
|
+
};
|
|
33
|
+
const componentName = "M4LAppBar";
|
|
34
|
+
generateUtilityClasses(componentName, [
|
|
35
|
+
"root",
|
|
36
|
+
"containerChilds",
|
|
37
|
+
"iconMenuToggle"
|
|
38
|
+
]);
|
|
39
|
+
function getAppBarClassesUtilityClass(slot) {
|
|
40
|
+
return generateUtilityClass(componentName, slot);
|
|
41
|
+
}
|
|
42
|
+
const useAppBarUtilityClasses = () => {
|
|
43
|
+
const slots = {
|
|
44
|
+
root: ["root"],
|
|
45
|
+
containerChilds: ["containerChilds"],
|
|
46
|
+
iconMenuToggle: ["iconMenuToggle"]
|
|
47
|
+
};
|
|
48
|
+
const composedClasses = unstable_composeClasses(slots, getAppBarClassesUtilityClass, {});
|
|
49
|
+
return {
|
|
50
|
+
...composedClasses
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
const AppBar = (props) => {
|
|
54
|
+
const {
|
|
55
|
+
onToggleVisible,
|
|
56
|
+
children
|
|
57
|
+
} = props;
|
|
58
|
+
const isDesktop = useResponsiveDesktop();
|
|
59
|
+
const {
|
|
60
|
+
host_static_assets,
|
|
61
|
+
environment_assets
|
|
62
|
+
} = useEnvironment();
|
|
63
|
+
const classes = useAppBarUtilityClasses();
|
|
64
|
+
return /* @__PURE__ */ jsxs(AppBarRoot, {
|
|
65
|
+
className: classes.root,
|
|
66
|
+
...process.env.NODE_ENV !== "production" ? {
|
|
67
|
+
[TEST_PROP_ID]: getNameDataTestId("root")
|
|
68
|
+
} : {},
|
|
69
|
+
children: [!isDesktop ? /* @__PURE__ */ jsx(IconButton, {
|
|
70
|
+
tooltip: "test",
|
|
71
|
+
className: classes.iconMenuToggle,
|
|
72
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/settings/assets/icons/options.svg`,
|
|
73
|
+
onClick: onToggleVisible
|
|
74
|
+
}) : null, /* @__PURE__ */ jsx("div", {
|
|
75
|
+
className: classes.containerChilds,
|
|
76
|
+
...process.env.NODE_ENV !== "production" ? {
|
|
77
|
+
[TEST_PROP_ID]: getNameDataTestId("containerChilds")
|
|
78
|
+
} : {},
|
|
79
|
+
children
|
|
80
|
+
})]
|
|
81
|
+
});
|
|
82
|
+
};
|
|
83
|
+
export {
|
|
84
|
+
AppBar as A
|
|
85
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const APPBAR_PREFIX = "M4LAppBar";
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
2
|
export declare type RootStyleProps = {
|
|
3
3
|
isCollapse: boolean;
|
|
4
4
|
isOffset: boolean;
|
|
5
5
|
isSideBarVisible: boolean;
|
|
6
6
|
};
|
|
7
|
-
export interface AppBarProps
|
|
7
|
+
export interface AppBarProps {
|
|
8
8
|
onToggleVisible: VoidFunction;
|
|
9
|
+
children: ReactNode;
|
|
9
10
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { CommonActionsClassesType } from './types';
|
|
2
2
|
export declare const commonActionsClasses: CommonActionsClassesType;
|
|
3
3
|
export declare function getCommonActionsUtilityClass(slot: string): string;
|
|
4
|
-
export declare const
|
|
4
|
+
export declare const useCommonActionsUtilityClasses: () => Record<"root" | "skeleton" | "actionCancel" | "actionFormCancel" | "actionFormIntro" | "actionIntro" | "wrapperActions", string>;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useCommonActionsUtilityClasses } from ".";
|
|
2
2
|
export interface CommonActionsClassesType {
|
|
3
3
|
root: string;
|
|
4
4
|
actionCancel: string;
|
|
5
5
|
actionFormCancel: string;
|
|
6
|
+
actionFormIntro: string;
|
|
6
7
|
actionIntro: string;
|
|
7
8
|
wrapperActions: string;
|
|
8
9
|
skeleton: string;
|
|
9
10
|
}
|
|
10
11
|
export declare type CommonActionsClassesKey = keyof CommonActionsClassesType;
|
|
11
|
-
export declare type Classes = ReturnType<typeof
|
|
12
|
+
export declare type Classes = ReturnType<typeof useCommonActionsUtilityClasses>;
|
package/components/CommonActions/components/ActionCancel/{index.fad4a0dc.js → index.574ea031.js}
RENAMED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { useModuleDictionary } from "@m4l/core";
|
|
2
|
-
import { B as Button } from "../../../mui_extended/Button/index.
|
|
3
|
-
import { u as
|
|
2
|
+
import { B as Button } from "../../../mui_extended/Button/index.aebbab34.js";
|
|
3
|
+
import { u as useCommonActionsUtilityClasses } from "../Actions/index.37ffde59.js";
|
|
4
4
|
import { jsx } from "react/jsx-runtime";
|
|
5
5
|
const ActionCancel = (props) => {
|
|
6
6
|
const {
|
|
7
7
|
getLabel
|
|
8
8
|
} = useModuleDictionary();
|
|
9
|
-
const classes =
|
|
9
|
+
const classes = useCommonActionsUtilityClasses();
|
|
10
10
|
return /* @__PURE__ */ jsx(Button, {
|
|
11
11
|
variant: "outlined",
|
|
12
12
|
color: "inherit",
|
package/components/CommonActions/components/ActionFormCancel/{index.a26820a9.js → index.e62db5d3.js}
RENAMED
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
import { useFormContext, useFormState } from "react-hook-form";
|
|
2
2
|
import { useModuleDictionary, useModuleSkeleton } from "@m4l/core";
|
|
3
3
|
import { Skeleton } from "@mui/material";
|
|
4
|
-
import { B as Button } from "../../../mui_extended/Button/index.
|
|
4
|
+
import { B as Button } from "../../../mui_extended/Button/index.aebbab34.js";
|
|
5
5
|
import { useCallback } from "react";
|
|
6
|
-
import { u as useModal } from "../../../../hooks/useModal/index.
|
|
7
|
-
import "../../../../react-draggable.
|
|
8
|
-
import "../../../ModalDialog/index.
|
|
9
|
-
import "../../../Resizeable/index.
|
|
6
|
+
import { u as useModal } from "../../../../hooks/useModal/index.26075cdd.js";
|
|
7
|
+
import "../../../../react-draggable.e625b0d1.js";
|
|
8
|
+
import "../../../ModalDialog/index.f652ea12.js";
|
|
9
|
+
import "../../../Resizeable/index.41a8048b.js";
|
|
10
10
|
import { jsx } from "react/jsx-runtime";
|
|
11
11
|
import "@m4l/graphics";
|
|
12
|
-
import "../../../Icon/index.
|
|
12
|
+
import "../../../Icon/index.f9119f5e.js";
|
|
13
13
|
import "clsx";
|
|
14
|
-
import { W as WindowConfirm } from "../../../modal/WindowConfirm.
|
|
15
|
-
import "../../../modal/WindowBase.
|
|
16
|
-
import "../../../mui_extended/IconButton/index.
|
|
17
|
-
import "../../../mui_extended/Accordion/index.
|
|
18
|
-
import "../../../mui_extended/Avatar/index.
|
|
14
|
+
import { W as WindowConfirm } from "../../../modal/WindowConfirm.023e293f.js";
|
|
15
|
+
import "../../../modal/WindowBase.c223e4da.js";
|
|
16
|
+
import "../../../mui_extended/IconButton/index.3b05af71.js";
|
|
17
|
+
import "../../../mui_extended/Accordion/index.03bd0e2a.js";
|
|
18
|
+
import "../../../mui_extended/Avatar/index.1e1a91a3.js";
|
|
19
19
|
import "react-router-dom";
|
|
20
|
-
import "../../../Image/index.
|
|
20
|
+
import "../../../Image/index.8aae9322.js";
|
|
21
21
|
import "@mui/lab";
|
|
22
|
-
import "../../../mui_extended/Typography/index.
|
|
22
|
+
import "../../../mui_extended/Typography/index.443590d6.js";
|
|
23
23
|
import "../../../mui_extended/Popover/index.9f35d0eb.js";
|
|
24
|
-
import "../../../mui_extended/MenuActions/index.
|
|
25
|
-
import "../../../mui_extended/Pager/index.
|
|
24
|
+
import "../../../mui_extended/MenuActions/index.ca5ce35a.js";
|
|
25
|
+
import "../../../mui_extended/Pager/index.80ec975a.js";
|
|
26
26
|
import "../../../mui_extended/Tab/index.e0653a0a.js";
|
|
27
27
|
import "zustand";
|
|
28
|
-
import "../../../areas/contexts/AreasContext/index.
|
|
29
|
-
import "../../../areas/components/AreasAdmin/index.
|
|
28
|
+
import "../../../areas/contexts/AreasContext/index.d98b89fc.js";
|
|
29
|
+
import "../../../areas/components/AreasAdmin/index.158621e0.js";
|
|
30
30
|
import "zustand/shallow";
|
|
31
31
|
import "../../../ScrollBar/index.bbe48f4d.js";
|
|
32
|
-
import "../../../areas/components/AreasViewer/index.
|
|
32
|
+
import "../../../areas/components/AreasViewer/index.621c0de4.js";
|
|
33
33
|
import "../../../areas/contexts/WindowToolsMFContext/index.8f3e2a04.js";
|
|
34
34
|
import "../../../areas/contexts/DynamicMFParmsContext/index.1607c78e.js";
|
|
35
35
|
import { u as useWindowToolsMF } from "../../../areas/hooks/useWindowToolsMF/index.b7afaf88.js";
|
|
36
|
-
import { u as
|
|
36
|
+
import { u as useCommonActionsUtilityClasses } from "../Actions/index.37ffde59.js";
|
|
37
37
|
function ActionFormCancel() {
|
|
38
38
|
const {
|
|
39
39
|
getLabel
|
|
@@ -70,7 +70,7 @@ function ActionFormCancel() {
|
|
|
70
70
|
onConfirmQuit();
|
|
71
71
|
}
|
|
72
72
|
}, [getLabel, isDirty, openModal]);
|
|
73
|
-
const classes =
|
|
73
|
+
const classes = useCommonActionsUtilityClasses();
|
|
74
74
|
if (isSkeleton) {
|
|
75
75
|
return /* @__PURE__ */ jsx(Skeleton, {
|
|
76
76
|
variant: "text",
|