@m4l/components 9.1.29 → 9.1.30

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.
Files changed (40) hide show
  1. package/components/AccountPopover/AccountPopover.d.ts +4 -3
  2. package/components/AccountPopover/AccountPopover.js +49 -26
  3. package/components/AccountPopover/constants.d.ts +5 -0
  4. package/components/AccountPopover/constants.js +10 -0
  5. package/components/AccountPopover/slots/AccountPopoverEnum.d.ts +18 -0
  6. package/components/AccountPopover/slots/AccountPopoverEnum.js +22 -0
  7. package/components/AccountPopover/slots/AccountPopoverSlots.d.ts +16 -0
  8. package/components/AccountPopover/slots/AccountPopoverSlots.js +93 -0
  9. package/components/AccountPopover/style.d.ts +2 -1
  10. package/components/AccountPopover/style.js +241 -5
  11. package/components/AccountPopover/subcomponents/MenuPopover/MenuPopover.d.ts +11 -0
  12. package/components/AccountPopover/subcomponents/MenuPopover/MenuPopover.js +70 -0
  13. package/components/AccountPopover/subcomponents/MenuPopover/types.d.ts +11 -0
  14. package/components/AccountPopover/subcomponents/MyAvatar/{index.d.ts → MyAvatar.d.ts} +4 -0
  15. package/components/AccountPopover/subcomponents/MyAvatar/MyAvatar.js +19 -0
  16. package/components/AccountPopover/subcomponents/MyAvatar/types.d.ts +2 -2
  17. package/components/AccountPopover/tests/AccountPopover.test.d.ts +0 -0
  18. package/components/AccountPopover/tests/constants.js +4 -0
  19. package/components/AccountPopover/tests/utils.d.ts +1 -2
  20. package/components/AccountPopover/tests/utils.js +7 -0
  21. package/components/AccountPopover/types.d.ts +16 -12
  22. package/components/ModalDialog/ModalDialog.d.ts +5 -0
  23. package/components/mui_extended/LoadingButton/types.d.ts +1 -1
  24. package/hooks/useStateRef/index.d.ts +4 -0
  25. package/hooks/useStateRef/index.js +1 -1
  26. package/package.json +2 -2
  27. package/components/AccountPopover/classes/constants.d.ts +0 -1
  28. package/components/AccountPopover/classes/constants.js +0 -4
  29. package/components/AccountPopover/classes/index.d.ts +0 -31
  30. package/components/AccountPopover/classes/index.js +0 -59
  31. package/components/AccountPopover/classes/types.d.ts +0 -32
  32. package/components/AccountPopover/subcomponents/MyAvatar/index.js +0 -21
  33. package/components/AccountPopover/subcomponents/PopOver/index.d.ts +0 -7
  34. package/components/AccountPopover/subcomponents/PopOver/index.js +0 -207
  35. package/components/AccountPopover/subcomponents/PopOver/tests/constants.d.ts +0 -1
  36. package/components/AccountPopover/subcomponents/PopOver/tests/utils.d.ts +0 -2
  37. package/components/AccountPopover/subcomponents/PopOver/types.d.ts +0 -24
  38. package/components/CommonActions/tests/constants.d.ts +0 -1
  39. package/components/CommonActions/tests/utils.d.ts +0 -2
  40. package/components/mui_extended/CircularProgress/CircularProgress.test.d.ts +0 -1
@@ -18,8 +18,9 @@ import { AccountPopoverProps } from './types';
18
18
  * userData={userData}
19
19
  * className="mi-clase-css"
20
20
  * />
21
- */
22
- /**
23
- * TODO: Documentar
21
+ * @author Andrés Quintero - automatic
22
+ * @createdAt 2024-12-06 17:26:21 - automatic
23
+ * @updatedAt 2024-12-11 15:39:20 - automatic
24
+ * @updatedUser Andrés Quintero - automatic
24
25
  */
25
26
  export declare const AccountPopover: (props: AccountPopoverProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,21 +1,26 @@
1
- import { jsx } from "react/jsx-runtime";
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { useNetwork } from "@m4l/core";
3
3
  import { useState, useEffect } from "react";
4
- import { u as useAccountPopoverUtilityClasses, g as getAccountPopoverClassesUtilityClass } from "./classes/index.js";
5
4
  import { T as TEST_PROP_ID } from "../../test/constants_no_mock.js";
6
- import { A as AcountPopOverRoot } from "./style.js";
7
- import { M as MenuPopOver } from "./subcomponents/PopOver/index.js";
8
- import clsx from "clsx";
5
+ import { M as MenuPopover } from "./subcomponents/MenuPopover/MenuPopover.js";
6
+ import { A as ACCOUNT_KEY_POPOVER } from "./constants.js";
7
+ import { g as getNameDataTestId } from "./tests/utils.js";
8
+ import { A as AccountPopoverRootStyled, I as IconButtonStyled } from "./slots/AccountPopoverSlots.js";
9
+ import { M as MyAvatar } from "./subcomponents/MyAvatar/MyAvatar.js";
10
+ import { u as useStateRef } from "../../hooks/useStateRef/index.js";
11
+ import { g as getComponentSlotRoot } from "../../utils/getComponentSlotRoot.js";
9
12
  const AccountPopover = (props) => {
10
13
  const {
11
14
  itemHandleClick,
12
15
  version,
13
16
  handleLogOut,
14
17
  userData,
15
- className,
16
- settingsHandleOpen: settingHandleOpen
18
+ settingsHandleOpen,
19
+ size
17
20
  } = props;
21
+ const { avatarUrl, firstName = "firstname", lastName = "lastname" } = userData || {};
18
22
  const [asyncState, setAsyncState] = useState("unLoad");
23
+ const [open, setOpen] = useStateRef(null);
19
24
  const [menuData, setMenuData] = useState([]);
20
25
  const { networkOperation } = useNetwork();
21
26
  useEffect(() => {
@@ -34,7 +39,7 @@ const AccountPopover = (props) => {
34
39
  setMenuData(response.data);
35
40
  }
36
41
  }).catch((_error) => {
37
- console.error("AccountData network request error - get menus", _error);
42
+ setAsyncState("unLoad");
38
43
  setMenuData([]);
39
44
  });
40
45
  }
@@ -42,25 +47,43 @@ const AccountPopover = (props) => {
42
47
  mounted = false;
43
48
  };
44
49
  }, [open]);
45
- const accountPopoverClasses = useAccountPopoverUtilityClasses();
46
- return /* @__PURE__ */ jsx(
47
- AcountPopOverRoot,
50
+ const handleClose = () => {
51
+ setOpen(null);
52
+ };
53
+ const handleOpen = (event) => {
54
+ setOpen(event.currentTarget);
55
+ };
56
+ const classRoot = getComponentSlotRoot(ACCOUNT_KEY_POPOVER);
57
+ return /* @__PURE__ */ jsxs(
58
+ AccountPopoverRootStyled,
48
59
  {
49
- className: clsx(accountPopoverClasses.root, className),
50
- ...process.env.NODE_ENV !== "production" ? { [TEST_PROP_ID]: getAccountPopoverClassesUtilityClass("root") } : {},
51
- children: /* @__PURE__ */ jsx(
52
- MenuPopOver,
53
- {
54
- data: menuData,
55
- asyncState,
56
- itemHandleClick,
57
- version,
58
- handleLogOut,
59
- classes: accountPopoverClasses,
60
- userData,
61
- settingsHandleOpen: settingHandleOpen
62
- }
63
- )
60
+ ...process.env.NODE_ENV !== "production" ? { [TEST_PROP_ID]: getNameDataTestId(ACCOUNT_KEY_POPOVER) } : {},
61
+ className: classRoot,
62
+ children: [
63
+ /* @__PURE__ */ jsx(
64
+ IconButtonStyled,
65
+ {
66
+ icon: /* @__PURE__ */ jsx(MyAvatar, { size, avatarUrl, firstName, lastName }),
67
+ src: "",
68
+ onClick: handleOpen,
69
+ selected: open ? true : false
70
+ }
71
+ ),
72
+ /* @__PURE__ */ jsx(
73
+ MenuPopover,
74
+ {
75
+ data: menuData,
76
+ asyncState,
77
+ itemHandleClick,
78
+ version,
79
+ handleLogOut,
80
+ userData,
81
+ settingsHandleOpen,
82
+ open,
83
+ handleClose
84
+ }
85
+ )
86
+ ]
64
87
  }
65
88
  );
66
89
  };
@@ -0,0 +1,5 @@
1
+ export declare const ACCOUNT_KEY_POPOVER = "M4LAccountPopover";
2
+ export declare const PATH_EMAIL = "frontend/components/account_popover/assets/icons/email.svg";
3
+ export declare const PATH_VERSION = "frontend/components/account_popover/assets/icons/version.svg";
4
+ export declare const PATH_CONFIGURATION = "frontend/components/account_popover/assets/icons/configuration.svg";
5
+ export declare const PATH_SIGN_OFF = "frontend/components/account_popover/assets/icons/sign_off.svg";
@@ -0,0 +1,10 @@
1
+ const ACCOUNT_KEY_POPOVER = "M4LAccountPopover";
2
+ const PATH_VERSION = "frontend/components/account_popover/assets/icons/version.svg";
3
+ const PATH_CONFIGURATION = "frontend/components/account_popover/assets/icons/configuration.svg";
4
+ const PATH_SIGN_OFF = "frontend/components/account_popover/assets/icons/sign_off.svg";
5
+ export {
6
+ ACCOUNT_KEY_POPOVER as A,
7
+ PATH_VERSION as P,
8
+ PATH_CONFIGURATION as a,
9
+ PATH_SIGN_OFF as b
10
+ };
@@ -0,0 +1,18 @@
1
+ export declare enum AccountPopoverSlots {
2
+ accountPopoverRoot = "accountPopoverRoot",
3
+ avatar = "avatar",
4
+ popover = "popover",
5
+ userDataContainer = "userDataContainer",
6
+ userNameEmail = "userNameEmail",
7
+ divider = "divider",
8
+ circularPropress = "circularPropress",
9
+ menuItemSetting = "menuItemSetting",
10
+ menuItem = "menuItem",
11
+ menuItemLogout = "menuItemLogout",
12
+ iconButton = "iconButton",
13
+ fullName = "fullName",
14
+ email = "email",
15
+ versionContainer = "versionContainer",
16
+ version = "version",
17
+ versionIcon = "versionIcon"
18
+ }
@@ -0,0 +1,22 @@
1
+ var AccountPopoverSlots = /* @__PURE__ */ ((AccountPopoverSlots2) => {
2
+ AccountPopoverSlots2["accountPopoverRoot"] = "accountPopoverRoot";
3
+ AccountPopoverSlots2["avatar"] = "avatar";
4
+ AccountPopoverSlots2["popover"] = "popover";
5
+ AccountPopoverSlots2["userDataContainer"] = "userDataContainer";
6
+ AccountPopoverSlots2["userNameEmail"] = "userNameEmail";
7
+ AccountPopoverSlots2["divider"] = "divider";
8
+ AccountPopoverSlots2["circularPropress"] = "circularPropress";
9
+ AccountPopoverSlots2["menuItemSetting"] = "menuItemSetting";
10
+ AccountPopoverSlots2["menuItem"] = "menuItem";
11
+ AccountPopoverSlots2["menuItemLogout"] = "menuItemLogout";
12
+ AccountPopoverSlots2["iconButton"] = "iconButton";
13
+ AccountPopoverSlots2["fullName"] = "fullName";
14
+ AccountPopoverSlots2["email"] = "email";
15
+ AccountPopoverSlots2["versionContainer"] = "versionContainer";
16
+ AccountPopoverSlots2["version"] = "version";
17
+ AccountPopoverSlots2["versionIcon"] = "versionIcon";
18
+ return AccountPopoverSlots2;
19
+ })(AccountPopoverSlots || {});
20
+ export {
21
+ AccountPopoverSlots as A
22
+ };
@@ -0,0 +1,16 @@
1
+ export declare const AccountPopoverRootStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
2
+ export declare const IconButtonStyled: import('@emotion/styled').StyledComponent<Pick<import('../../mui_extended/IconButton/types').IconButtonProps, keyof import('../../mui_extended/IconButton/types').IconButtonProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, {}, {}>;
3
+ export declare const AvatarStyled: import('@emotion/styled').StyledComponent<Pick<Omit<import('../../mui_extended/Avatar').AvatarProps, "ref"> & import('react').RefAttributes<HTMLDivElement>, "children" | "title" | "component" | "id" | "hidden" | "color" | "content" | "style" | "variant" | "className" | "classes" | "onChange" | "sx" | "translate" | "slots" | "slotProps" | "slot" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onResize" | "onResizeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "src" | "dataTestId" | "alt" | keyof import('react').RefAttributes<HTMLDivElement> | "sizes" | "srcSet" | "imgProps"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, {}, {}>;
4
+ export declare const PopoverStyled: import('@emotion/styled').StyledComponent<Pick<import('../../mui_extended/Popover/types').PopoverProps, keyof import('../../mui_extended/Popover/types').PopoverProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, {}, {}>;
5
+ export declare const UserDataContainerStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
6
+ export declare const UserNameEmailStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
7
+ export declare const DividerStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
8
+ export declare const CircularProgressStyled: import('@emotion/styled').StyledComponent<Pick<import('../../mui_extended/CircularProgress/types').CircularProgressProps, keyof import('../../mui_extended/CircularProgress/types').CircularProgressProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, {}, {}>;
9
+ export declare const MenuItemSettingsStyled: import('@emotion/styled').StyledComponent<Pick<import('../../mui_extended/MenuItem').MenuItemProps, keyof import('../../mui_extended/MenuItem').MenuItemProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, {}, {}>;
10
+ export declare const MenuItemLogoutStyled: import('@emotion/styled').StyledComponent<Pick<import('../../mui_extended/MenuItem').MenuItemProps, keyof import('../../mui_extended/MenuItem').MenuItemProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, {}, {}>;
11
+ export declare const MenuItemStyled: import('@emotion/styled').StyledComponent<Pick<import('../../mui_extended/MenuItem').MenuItemProps, keyof import('../../mui_extended/MenuItem').MenuItemProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, {}, {}>;
12
+ export declare const FullNametStyled: import('@emotion/styled').StyledComponent<Pick<import('../../mui_extended/Typography/types').TypographyProps, keyof import('../../mui_extended/Typography/types').TypographyProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, {}, {}>;
13
+ export declare const EmailtStyled: import('@emotion/styled').StyledComponent<Pick<import('../../mui_extended/Typography/types').TypographyProps, keyof import('../../mui_extended/Typography/types').TypographyProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, {}, {}>;
14
+ export declare const VersionContainerStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
15
+ export declare const VersionStyled: import('@emotion/styled').StyledComponent<Pick<import('../../mui_extended/Typography/types').TypographyProps, keyof import('../../mui_extended/Typography/types').TypographyProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, {}, {}>;
16
+ export declare const VersionIconStyled: import('@emotion/styled').StyledComponent<Pick<import('../../Icon').IconProps, keyof import('../../Icon').IconProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, {}, {}>;
@@ -0,0 +1,93 @@
1
+ import { styled } from "@mui/material/styles";
2
+ import { A as ACCOUNT_KEY_POPOVER } from "../constants.js";
3
+ import { A as AccountPopoverSlots } from "./AccountPopoverEnum.js";
4
+ import { a as accountPopoverStyles } from "../style.js";
5
+ import { I as IconButton } from "../../mui_extended/IconButton/IconButton.js";
6
+ import { A as Avatar } from "../../mui_extended/Avatar/Avatar.js";
7
+ import { T as Typography } from "../../mui_extended/Typography/Typography.js";
8
+ import { P as Popover } from "../../mui_extended/Popover/Popover.js";
9
+ import { C as CircularProgress } from "../../mui_extended/CircularProgress/CircularProgress.js";
10
+ import { M as MenuItem } from "../../mui_extended/MenuItem/MenuItem.js";
11
+ import { I as Icon } from "../../Icon/Icon.js";
12
+ const AccountPopoverRootStyled = styled("div", {
13
+ name: ACCOUNT_KEY_POPOVER,
14
+ slot: AccountPopoverSlots.accountPopoverRoot
15
+ })(accountPopoverStyles?.accountPopoverRoot);
16
+ const IconButtonStyled = styled(IconButton, {
17
+ name: ACCOUNT_KEY_POPOVER,
18
+ slot: AccountPopoverSlots.iconButton
19
+ })(accountPopoverStyles?.iconButton);
20
+ const AvatarStyled = styled(Avatar, {
21
+ name: ACCOUNT_KEY_POPOVER,
22
+ slot: AccountPopoverSlots.avatar
23
+ })(accountPopoverStyles?.avatar);
24
+ const PopoverStyled = styled(Popover, {
25
+ name: ACCOUNT_KEY_POPOVER,
26
+ slot: AccountPopoverSlots.popover
27
+ })(accountPopoverStyles?.popover);
28
+ const UserDataContainerStyled = styled("div", {
29
+ name: ACCOUNT_KEY_POPOVER,
30
+ slot: AccountPopoverSlots.userDataContainer
31
+ })(accountPopoverStyles?.userDataContainer);
32
+ const UserNameEmailStyled = styled("div", {
33
+ name: ACCOUNT_KEY_POPOVER,
34
+ slot: AccountPopoverSlots.userNameEmail
35
+ })(accountPopoverStyles?.userNameEmail);
36
+ const DividerStyled = styled("div", {
37
+ name: ACCOUNT_KEY_POPOVER,
38
+ slot: AccountPopoverSlots.divider
39
+ })(accountPopoverStyles?.divider);
40
+ const CircularProgressStyled = styled(CircularProgress, {
41
+ name: ACCOUNT_KEY_POPOVER,
42
+ slot: AccountPopoverSlots.circularPropress
43
+ })(accountPopoverStyles?.circularPropress);
44
+ const MenuItemSettingsStyled = styled(MenuItem, {
45
+ name: ACCOUNT_KEY_POPOVER,
46
+ slot: AccountPopoverSlots.menuItemSetting
47
+ })(accountPopoverStyles?.menuItemSetting);
48
+ const MenuItemLogoutStyled = styled(MenuItem, {
49
+ name: ACCOUNT_KEY_POPOVER,
50
+ slot: AccountPopoverSlots.menuItemLogout
51
+ })(accountPopoverStyles?.menuItemLogout);
52
+ const MenuItemStyled = styled(MenuItem, {
53
+ name: ACCOUNT_KEY_POPOVER,
54
+ slot: AccountPopoverSlots.menuItem
55
+ })(accountPopoverStyles?.menuItem);
56
+ const FullNametStyled = styled(Typography, {
57
+ name: ACCOUNT_KEY_POPOVER,
58
+ slot: AccountPopoverSlots.fullName
59
+ })(accountPopoverStyles?.fullName);
60
+ const EmailtStyled = styled(Typography, {
61
+ name: ACCOUNT_KEY_POPOVER,
62
+ slot: AccountPopoverSlots.email
63
+ })(accountPopoverStyles?.email);
64
+ const VersionContainerStyled = styled("div", {
65
+ name: ACCOUNT_KEY_POPOVER,
66
+ slot: AccountPopoverSlots.versionContainer
67
+ })(accountPopoverStyles?.versionContainer);
68
+ const VersionStyled = styled(Typography, {
69
+ name: ACCOUNT_KEY_POPOVER,
70
+ slot: AccountPopoverSlots.version
71
+ })(accountPopoverStyles?.version);
72
+ const VersionIconStyled = styled(Icon, {
73
+ name: ACCOUNT_KEY_POPOVER,
74
+ slot: AccountPopoverSlots.versionIcon
75
+ })(accountPopoverStyles?.versionIcon);
76
+ export {
77
+ AccountPopoverRootStyled as A,
78
+ CircularProgressStyled as C,
79
+ DividerStyled as D,
80
+ EmailtStyled as E,
81
+ FullNametStyled as F,
82
+ IconButtonStyled as I,
83
+ MenuItemSettingsStyled as M,
84
+ PopoverStyled as P,
85
+ UserDataContainerStyled as U,
86
+ VersionContainerStyled as V,
87
+ AvatarStyled as a,
88
+ UserNameEmailStyled as b,
89
+ VersionStyled as c,
90
+ VersionIconStyled as d,
91
+ MenuItemStyled as e,
92
+ MenuItemLogoutStyled as f
93
+ };
@@ -1 +1,2 @@
1
- export declare const AcountPopOverRoot: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
1
+ import { AccountPopoverStyles } from './types';
2
+ export declare const accountPopoverStyles: AccountPopoverStyles;
@@ -1,7 +1,243 @@
1
- import { styled } from "@mui/material";
2
- const AcountPopOverRoot = styled("div")(({ theme }) => ({
3
- ...theme.components?.M4LAccountPopover?.styleOverrides || {}
4
- }));
1
+ const accountPopoverStyles = {
2
+ accountPopoverRoot: () => ({}),
3
+ /**
4
+ * ***************************************************************
5
+ * Estilos para el icono de usuario que se muestra en el popover.
6
+ * ***************************************************************
7
+ * @author Andrés Quintero - automatic
8
+ * @createdAt 2024-12-10 17:27:34 - automatic
9
+ * @updatedAt 2024-12-11 15:39:20 - automatic
10
+ * @updatedUser Andrés Quintero - automatic
11
+ */
12
+ iconButton: ({ theme }) => ({
13
+ width: theme.vars.size.baseSpacings.sp6,
14
+ height: theme.vars.size.baseSpacings.sp6,
15
+ "& .M4LAvatar-root": {
16
+ aspectRatio: "1/1",
17
+ "& .MuiAvatar-root": {
18
+ width: "100% !important",
19
+ height: "100% !important",
20
+ background: "transparent"
21
+ }
22
+ }
23
+ }),
24
+ /**
25
+ * ******************************************************************
26
+ * Estilos para el avatar del usuario que se muestra en el popover.
27
+ * ******************************************************************
28
+ * @author Andrés Quintero - automatic
29
+ * @createdAt 2024-12-10 08:05:25 - automatic
30
+ * @updatedAt 2024-12-11 15:39:20 - automatic
31
+ * @updatedUser Andrés Quintero - automatic
32
+ */
33
+ avatar: () => ({
34
+ "&.M4LAvatar-root": {
35
+ width: "100% !important",
36
+ height: "100% !important",
37
+ "& .MuiAvatar-root": {
38
+ boxShadow: "none !important"
39
+ }
40
+ }
41
+ }),
42
+ /**
43
+ * *******************************************************************
44
+ * Estilos para el popover que se muestra al hacer clic en el avatar.
45
+ * *******************************************************************
46
+ * @author Andrés Quintero - automatic
47
+ * @createdAt 2024-12-10 17:27:34 - automatic
48
+ * @updatedAt 2024-12-11 15:39:20 - automatic
49
+ * @updatedUser Andrés Quintero - automatic
50
+ */
51
+ popover: ({ theme }) => ({
52
+ "& .MuiPaper-root": {
53
+ marginTop: "5px",
54
+ padding: `${theme.vars.size.baseSpacings.sp2} !important`
55
+ }
56
+ }),
57
+ /**
58
+ * ********************************************************************
59
+ * Estilos para el contenedor de los datos del usuario en el popover.
60
+ * ********************************************************************
61
+ * @author Andrés Quintero - automatic
62
+ * @createdAt 2024-12-09 17:45:48 - automatic
63
+ * @updatedAt 2024-12-11 15:39:20 - automatic
64
+ * @updatedUser Andrés Quintero - automatic
65
+ */
66
+ userDataContainer: ({ theme }) => ({
67
+ display: "flex",
68
+ flexDirection: "row",
69
+ flexWrap: "nowrap",
70
+ gap: theme.vars.size.baseSpacings.sp3,
71
+ width: "100%",
72
+ alignItems: "center",
73
+ padding: `${theme.vars.size.baseSpacings.sp2} ${theme.vars.size.baseSpacings.sp1} ${theme.vars.size.baseSpacings.sp5} ${theme.vars.size.baseSpacings.sp1}`,
74
+ "& .M4LAvatar-root": {
75
+ "& .MuiAvatar-root": {
76
+ width: `${theme.vars.size[theme.generalSettings.isMobile ? "mobile" : "desktop"].medium.container} !important`,
77
+ height: `${theme.vars.size[theme.generalSettings.isMobile ? "mobile" : "desktop"].medium.container} !important`,
78
+ background: "transparent"
79
+ }
80
+ }
81
+ }),
82
+ /**
83
+ * ************************************************************************
84
+ * Estilos para el contenedor de nombre y correo del usuario en el popover.
85
+ * ************************************************************************
86
+ * @author Andrés Quintero - automatic
87
+ * @createdAt 2024-12-09 17:45:48 - automatic
88
+ * @updatedAt 2024-12-11 15:39:20 - automatic
89
+ * @updatedUser Andrés Quintero - automatic
90
+ */
91
+ userNameEmail: ({ theme }) => ({
92
+ display: "flex",
93
+ flexDirection: "column",
94
+ justifyContent: "flex-start",
95
+ gap: theme.vars.size.baseSpacings.sp2
96
+ }),
97
+ /**
98
+ * ***********************************************************
99
+ * Estilos para el nombre completo del usuario en el popover.
100
+ * ***********************************************************
101
+ * @author Andrés Quintero - automatic
102
+ * @createdAt 2024-12-09 17:45:48 - automatic
103
+ * @updatedAt 2024-12-11 15:39:20 - automatic
104
+ * @updatedUser Andrés Quintero - automatic
105
+ */
106
+ fullName: () => ({}),
107
+ /**
108
+ * ********************************************************
109
+ * Estilos para el correo del usuario en el popover.
110
+ * ********************************************************
111
+ * @author Andrés Quintero - automatic
112
+ * @createdAt 2024-12-09 17:45:48 - automatic
113
+ * @updatedAt 2024-12-11 15:39:20 - automatic
114
+ * @updatedUser Andrés Quintero - automatic
115
+ */
116
+ email: ({ theme }) => ({
117
+ "&.M4lclassCssSpecificity": {
118
+ color: theme.vars.palette.text.secondary
119
+ }
120
+ }),
121
+ /**
122
+ * ***********************************************************************
123
+ * Estilos para el contenedor de la versión que se muestra en el popover.
124
+ * ***********************************************************************
125
+ * @author Andrés Quintero - automatic
126
+ * @createdAt 2024-12-09 17:45:48 - automatic
127
+ * @updatedAt 2024-12-11 15:39:20 - automatic
128
+ * @updatedUser Andrés Quintero - automatic
129
+ */
130
+ versionContainer: ({ theme }) => ({
131
+ display: "flex",
132
+ flexDirection: "row",
133
+ flexWrap: "nowrap",
134
+ minHeight: theme.vars.size.baseSpacings.sp6,
135
+ padding: `${theme.vars.size.baseSpacings.sp1} !important`,
136
+ justifyContent: "space-between",
137
+ alignItems: "center"
138
+ }),
139
+ /**
140
+ * ************************************************************
141
+ * Estilos para la versión que se muestra en el popover.
142
+ * ************************************************************
143
+ * @author Andrés Quintero - automatic
144
+ * @createdAt 2024-12-09 17:45:48 - automatic
145
+ * @updatedAt 2024-12-11 15:39:20 - automatic
146
+ * @updatedUser Andrés Quintero - automatic
147
+ */
148
+ version: ({ theme }) => ({
149
+ "&.MuiTypography-root": {
150
+ color: theme.vars.palette.text.disabled,
151
+ fontSize: theme.typography.body.fontSize
152
+ }
153
+ }),
154
+ /**
155
+ * ******************************************************************
156
+ * Estilos para el contenedor de los elementos del menú del popover.
157
+ * ******************************************************************
158
+ * @author Andrés Quintero - automatic
159
+ * @createdAt 2024-12-11 15:39:20 - automatic
160
+ * @updatedAt 2024-12-11 15:39:20 - automatic
161
+ * @updatedUser Andrés Quintero - automatic
162
+ */
163
+ menuItemSetting: ({ theme }) => ({
164
+ padding: `${theme.vars.size.baseSpacings.sp1} !important`
165
+ }),
166
+ /**
167
+ * ****************************************************************
168
+ * Estilos para el icono de la versión que se muestra en el popover.
169
+ * ****************************************************************
170
+ * @author Andrés Quintero - automatic
171
+ * @createdAt 2024-12-09 17:45:48 - automatic
172
+ * @updatedAt 2024-12-11 15:39:20 - automatic
173
+ * @updatedUser Andrés Quintero - automatic
174
+ */
175
+ versionIcon: ({ theme }) => ({
176
+ "& > div": {
177
+ background: theme.vars.palette.text.disabled
178
+ }
179
+ }),
180
+ /**
181
+ * ********************************************************
182
+ * Estilos para los items que se cargan como opciones
183
+ * adicionales del MenuPopover.
184
+ * ********************************************************
185
+ * @author Andrés Quintero - automatic
186
+ * @createdAt 2024-12-11 15:39:20 - automatic
187
+ * @updatedAt 2024-12-11 15:39:20 - automatic
188
+ * @updatedUser Andrés Quintero - automatic
189
+ */
190
+ menuItem: ({ theme }) => ({
191
+ padding: `${theme.vars.size.baseSpacings.sp1} !important`
192
+ }),
193
+ /**
194
+ * ********************************************************
195
+ * Estilos para el divisor que se muestra en el popover.
196
+ * ********************************************************
197
+ * @author Andrés Quintero - automatic
198
+ * @createdAt 2024-12-10 08:05:25 - automatic
199
+ * @updatedAt 2024-12-11 15:39:20 - automatic
200
+ * @updatedUser Andrés Quintero - automatic
201
+ */
202
+ divider: ({ theme }) => ({
203
+ padding: `${theme.vars.size.baseSpacings.sp1} 0px`,
204
+ justifyContent: "center",
205
+ position: "relative",
206
+ "&::after": {
207
+ content: '""',
208
+ position: "absolute",
209
+ top: "50%",
210
+ left: 0,
211
+ right: 0,
212
+ height: "1px",
213
+ transform: "translateY(-50%)",
214
+ background: theme.vars.palette.border.secondary
215
+ }
216
+ }),
217
+ /**
218
+ * ************************************************************
219
+ * Estilos para el circular progress que se muestra
220
+ * cuando la carga de las opciones adicionales está en loading
221
+ * *************************************************************
222
+ * @author Andrés Quintero - automatic
223
+ * @createdAt 2024-12-11 15:39:20 - automatic
224
+ * @updatedAt 2024-12-11 15:39:20 - automatic
225
+ * @updatedUser Andrés Quintero - automatic
226
+ */
227
+ circularPropress: () => ({}),
228
+ /**
229
+ * ********************************************************
230
+ * Estilos para el item de logout del MenuPopover.
231
+ * ********************************************************
232
+ * @author Andrés Quintero - automatic
233
+ * @createdAt 2024-12-11 15:39:20 - automatic
234
+ * @updatedAt 2024-12-11 15:39:20 - automatic
235
+ * @updatedUser Andrés Quintero - automatic
236
+ */
237
+ menuItemLogout: ({ theme }) => ({
238
+ padding: `${theme.vars.size.baseSpacings.sp1} !important`
239
+ })
240
+ };
5
241
  export {
6
- AcountPopOverRoot as A
242
+ accountPopoverStyles as a
7
243
  };
@@ -0,0 +1,11 @@
1
+ import { MenuPopoverProps } from './types';
2
+ /**
3
+ * MenuPopOver: Es el subcomponente de AccountPopover encargado de crear el menú popover y su contenido.
4
+ * Se debe refactorizar el componente PopOver para recibir la propr de size.
5
+ * @param props
6
+ * @author Andrés Quintero - automatic
7
+ * @createdAt 2024-12-06 17:26:21 - automatic
8
+ * @updatedAt 2024-12-11 15:39:20 - automatic
9
+ * @updatedUser Andrés Quintero - automatic
10
+ */
11
+ export declare const MenuPopover: (props: MenuPopoverProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,70 @@
1
+ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
+ import { useEnvironment, useModuleDictionary } from "@m4l/core";
3
+ import { T as TEST_PROP_ID } from "../../../../test/constants_no_mock.js";
4
+ import { P as PATH_VERSION, a as PATH_CONFIGURATION, b as PATH_SIGN_OFF } from "../../constants.js";
5
+ import { P as PopoverStyled, U as UserDataContainerStyled, a as AvatarStyled, b as UserNameEmailStyled, F as FullNametStyled, E as EmailtStyled, V as VersionContainerStyled, c as VersionStyled, d as VersionIconStyled, D as DividerStyled, C as CircularProgressStyled, M as MenuItemSettingsStyled, e as MenuItemStyled, f as MenuItemLogoutStyled } from "../../slots/AccountPopoverSlots.js";
6
+ import { g as getNameDataTestId } from "../../tests/utils.js";
7
+ const MenuPopover = (props) => {
8
+ const {
9
+ version,
10
+ handleClose,
11
+ open,
12
+ userData,
13
+ settingsHandleOpen,
14
+ handleLogOut,
15
+ itemHandleClick,
16
+ data = [],
17
+ asyncState
18
+ } = props;
19
+ const { host_static_assets, environment_assets } = useEnvironment();
20
+ const { firstName, lastName, email, avatarUrl } = userData || {};
21
+ const { getLabel } = useModuleDictionary();
22
+ const handleItemClick = (item) => {
23
+ itemHandleClick(item);
24
+ handleClose();
25
+ };
26
+ const handleClickSetting = () => {
27
+ settingsHandleOpen();
28
+ handleClose();
29
+ };
30
+ const handleLogout = () => {
31
+ handleLogOut();
32
+ handleClose();
33
+ };
34
+ return /* @__PURE__ */ jsxs(
35
+ PopoverStyled,
36
+ {
37
+ ownerState: {},
38
+ open: Boolean(open),
39
+ anchorEl: open,
40
+ onClose: handleClose,
41
+ arrowType: "no-arrow",
42
+ anchorOrigin: { vertical: "bottom", horizontal: "right" },
43
+ transformOrigin: { vertical: "top", horizontal: "right" },
44
+ ...process.env.NODE_ENV !== "production" ? { [TEST_PROP_ID]: getNameDataTestId("popover") } : {},
45
+ children: [
46
+ /* @__PURE__ */ jsxs(UserDataContainerStyled, { children: [
47
+ /* @__PURE__ */ jsx(AvatarStyled, { src: avatarUrl ?? "" }),
48
+ /* @__PURE__ */ jsxs(UserNameEmailStyled, { children: [
49
+ /* @__PURE__ */ jsx(FullNametStyled, { variant: "paragraphDens", children: `${firstName} ${lastName}` }),
50
+ /* @__PURE__ */ jsx(EmailtStyled, { variant: "body", children: email })
51
+ ] })
52
+ ] }),
53
+ /* @__PURE__ */ jsxs(VersionContainerStyled, { children: [
54
+ /* @__PURE__ */ jsx(VersionStyled, { children: `${getLabel("account_popover.label_version")} ${version}` }),
55
+ /* @__PURE__ */ jsx(VersionIconStyled, { src: `${host_static_assets}/${environment_assets}/${PATH_VERSION}` })
56
+ ] }),
57
+ /* @__PURE__ */ jsx(DividerStyled, {}),
58
+ asyncState === "loading" ? /* @__PURE__ */ jsx(CircularProgressStyled, {}) : /* @__PURE__ */ jsxs(Fragment, { children: [
59
+ /* @__PURE__ */ jsx(MenuItemSettingsStyled, { onClick: handleClickSetting, label: getLabel("account_popover.label_settings"), endIcon: `${host_static_assets}/${environment_assets}/${PATH_CONFIGURATION}` }),
60
+ data.map((option) => /* @__PURE__ */ jsx(MenuItemStyled, { onClick: () => handleItemClick(option), label: option.title }, `${option.title}-${option.module_id}`)),
61
+ /* @__PURE__ */ jsx(DividerStyled, {})
62
+ ] }),
63
+ /* @__PURE__ */ jsx(MenuItemLogoutStyled, { onClick: handleLogout, label: getLabel("account_popover.label_logout"), endIcon: `${host_static_assets}/${environment_assets}/${PATH_SIGN_OFF}` })
64
+ ]
65
+ }
66
+ );
67
+ };
68
+ export {
69
+ MenuPopover as M
70
+ };