@m4l/components 9.2.62-B10072025beta.1 → 9.2.62-JT08072025.beta.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/components/AppBar/AppBar.js +10 -12
- package/components/AppBar/constants.d.ts +1 -1
- package/components/AppBar/constants.js +1 -1
- package/components/AppBar/slots/AppBarEnum.d.ts +5 -1
- package/components/AppBar/slots/AppBarEnum.js +4 -0
- package/components/AppBar/slots/AppBarSlots.d.ts +18 -4
- package/components/AppBar/slots/AppBarSlots.js +27 -3
- package/components/AppBar/styles.js +42 -0
- package/components/AppBar/types.d.ts +0 -8
- package/components/DataGrid/Datagrid.styles.js +12 -0
- package/components/DataGrid/formatters/ColumnIconFormatter/formatter.d.ts +2 -1
- package/components/DataGrid/formatters/ColumnIconFormatter/formatter.js +6 -42
- package/components/DataGrid/formatters/ColumnIconFormatter/helpers/renderIcon.d.ts +8 -0
- package/components/DataGrid/formatters/ColumnIconFormatter/helpers/renderIcon.js +58 -0
- package/components/DataGrid/formatters/ColumnIconFormatter/helpers/renderMultipleIcons.d.ts +7 -0
- package/components/DataGrid/formatters/ColumnIconFormatter/helpers/renderMultipleIcons.js +19 -0
- package/components/DataGrid/formatters/ColumnIconFormatter/types.d.ts +10 -3
- package/components/DataGrid/formatters/ColumnIconFormatter/useColumnIcon.d.ts +2 -2
- package/components/DataGrid/slots/DataGridEnum.d.ts +3 -0
- package/components/DataGrid/slots/DataGridEnum.js +6 -1
- package/components/DataGrid/slots/DataGridSlot.d.ts +6 -0
- package/components/DataGrid/slots/DataGridSlot.js +24 -19
- package/components/DataGrid/subcomponents/ControlNavigate/ControlNavigate.js +1 -1
- package/components/DataGrid/subcomponents/HeaderActions/index.js +1 -1
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Density/index.js +2 -1
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/RowsCount/index.js +1 -1
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Settings/subcomponents/ColumnsConfig/index.js +1 -1
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/hooks/useModalSettings/index.js +1 -1
- package/components/DataGrid/subcomponents/Table/hooks/useHeaderMenuActions.js +2 -1
- package/components/DataGrid/subcomponents/Table/hooks/useSortColumnsRows.js +0 -2
- package/components/DataGrid/subcomponents/Table/index.js +1 -1
- package/components/DataGrid/subcomponents/Table/subcomponents/DraggableHeaderRenderer.js +1 -1
- package/components/DataGrid/subcomponents/Table/subcomponents/HeaderRenderClick/HeaderRenderClick.js +1 -1
- package/components/DataGrid/subcomponents/editors/TextEditor/index.js +1 -1
- package/components/DataGrid/types.d.ts +3 -2
- package/components/LoadingError/slots/LoadingErrorSlots.js +1 -1
- package/components/NumberInput/hooks/useNumberInput/useNumberInput.js +0 -2
- package/components/ObjectLogs/ObjectLogs.styles.js +2 -1
- package/components/ObjectLogs/slots/ObjectLogsEnum.d.ts +1 -0
- package/components/ObjectLogs/slots/ObjectLogsEnum.js +1 -0
- package/components/ObjectLogs/slots/ObjectLogsSlots.d.ts +3 -0
- package/components/ObjectLogs/slots/ObjectLogsSlots.js +7 -2
- package/components/SideBar/SideBar.js +2 -6
- package/components/SideBar/constants.d.ts +6 -7
- package/components/SideBar/constants.js +7 -7
- package/components/SideBar/context/sideBarContext/index.js +10 -9
- package/components/SideBar/context/sideBarContext/types.d.ts +10 -2
- package/components/SideBar/slots/SideBarEnum.d.ts +7 -7
- package/components/SideBar/slots/SideBarEnum.js +5 -5
- package/components/SideBar/slots/SideBarSlots.d.ts +9 -9
- package/components/SideBar/slots/SideBarSlots.js +28 -31
- package/components/SideBar/styles.js +3 -3
- package/components/SideBar/subcomponents/ContentComponent/index.js +68 -12
- package/components/SideBar/subcomponents/ContentComponent/style.js +103 -122
- package/components/SideBar/subcomponents/HeaderSidebar/index.d.ts +6 -0
- package/components/SideBar/subcomponents/HeaderSidebar/styles.d.ts +2 -0
- package/components/SideBar/subcomponents/HeaderSidebar/styles.js +24 -0
- package/components/SideBar/subcomponents/HeaderSidebar/types.d.ts +5 -0
- package/components/SideBar/subcomponents/{FooterComponent → Promotion}/index.d.ts +1 -1
- package/components/SideBar/subcomponents/{FooterComponent → Promotion}/index.js +4 -4
- package/components/SideBar/subcomponents/{FooterComponent → Promotion}/styles.js +2 -8
- package/components/SideBar/subcomponents/SideBarDesktop/index.js +3 -4
- package/components/SideBar/subcomponents/SideBarDesktop/styles.js +32 -4
- package/components/SideBar/subcomponents/SideBarMobile/index.js +1 -1
- package/components/SideBar/subcomponents/TreeGroupItems/index.js +3 -4
- package/components/SideBar/subcomponents/TreeGroupItems/styles.js +2 -90
- package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/NodeMenuItem/index.js +4 -6
- package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/NodeMenuItem/types.d.ts +0 -1
- package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/NodeMenuItemMain/NodeMenuItemMain.js +3 -8
- package/components/SideBar/types.d.ts +7 -12
- package/components/areas/contexts/AreasContext/store.js +2 -2
- package/components/commercial/HamburgerMenu/HamburgerMenu.js +2 -1
- package/components/formatters/BooleanFormatter/BooleanFormatter.js +7 -4
- package/components/formatters/BooleanFormatter/BooleanFormatter.styles.js +9 -1
- package/components/formatters/BooleanFormatter/slots/BooleanFormatterEnum.d.ts +2 -1
- package/components/formatters/BooleanFormatter/slots/BooleanFormatterEnum.js +1 -0
- package/components/formatters/BooleanFormatter/slots/BooleanFormatterSlots.d.ts +3 -0
- package/components/formatters/BooleanFormatter/slots/BooleanFormatterSlots.js +6 -1
- package/components/formatters/BooleanFormatter/types.d.ts +1 -1
- package/components/hook-form/RHFAutocompleteAsync/reducer/RHFAutocompleteReducer.js +0 -5
- package/components/hook-form/RHFPeriod/subcomponents/Period/dictionary.js +4 -5
- package/components/mui_extended/MenuItem/MenuItem.js +1 -1
- package/components/mui_extended/TabContent/TabContent.js +2 -2
- package/components/mui_extended/TabContent/TabContent.styles.js +1 -1
- package/components/mui_extended/TabContent/types.d.ts +1 -1
- package/hooks/useDynamicFilterAndSort/useDynamicFilterAndSort.js +1 -1
- package/package.json +3 -3
- package/storybook/components/DataGrid/DataGrid.stories.d.ts +4 -0
- package/storybook/components/DataGrid/helpers/icons.d.ts +6 -0
- package/storybook/components/DataGrid/helpers/types.d.ts +9 -0
- package/storybook/components/SideBar/SideBar.stories.d.ts +11 -5
- package/storybook/components/SideBar/subcomponents/FooterPromotion/FooterPromotion.d.ts +4 -0
- package/storybook/components/SideBar/subcomponents/FooterPromotion/index.d.ts +1 -0
- package/utils/getSizeStyles/getSizeStyles.d.ts +1 -1
- package/components/SideBar/subcomponents/HeaderComponent/HeaderComponent.d.ts +0 -5
- package/components/SideBar/subcomponents/HeaderComponent/HeaderComponent.js +0 -37
- package/components/SideBar/subcomponents/HeaderComponent/index.d.ts +0 -1
- package/components/SideBar/subcomponents/HeaderComponent/index.js +0 -1
- package/components/SideBar/subcomponents/HeaderComponent/styles.d.ts +0 -2
- package/components/SideBar/subcomponents/HeaderComponent/styles.js +0 -44
- package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/AdormentIcon/AdormentIcon.d.ts +0 -7
- package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/AdormentIcon/AdormentIcon.js +0 -12
- package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/AdormentIcon/types.d.ts +0 -4
- package/storybook/components/SideBar/subcomponents/FooterComponentHost/FooterComponentHost.d.ts +0 -4
- package/storybook/components/SideBar/subcomponents/FooterComponentHost/index.d.ts +0 -1
- package/storybook/components/SideBar/subcomponents/FooterComponentMicrofrontend/FooterComponentMicrofrontend.d.ts +0 -4
- package/storybook/components/SideBar/subcomponents/FooterComponentMicrofrontend/FooterComponentMicrofrontend.stories.d.ts +0 -14
- package/storybook/components/SideBar/subcomponents/FooterComponentMicrofrontend/constants.d.ts +0 -1
- package/storybook/components/SideBar/subcomponents/FooterComponentMicrofrontend/index.d.ts +0 -1
- package/storybook/components/SideBar/subcomponents/HeaderComponentHost/HeaderComponentHost.d.ts +0 -5
- package/storybook/components/SideBar/subcomponents/HeaderComponentHost/constants.d.ts +0 -1
- package/storybook/components/SideBar/subcomponents/HeaderComponentMicrofrontend/HeaderComponentMicrofrontend.d.ts +0 -5
- package/storybook/components/SideBar/subcomponents/HeaderComponentMicrofrontend/constants.d.ts +0 -1
- /package/components/SideBar/subcomponents/{FooterComponent → Promotion}/styles.d.ts +0 -0
- /package/components/SideBar/subcomponents/{FooterComponent → Promotion}/types.d.ts +0 -0
- /package/storybook/components/SideBar/subcomponents/{FooterComponentHost → FooterPromotion}/constants.d.ts +0 -0
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { styled } from "@mui/material/styles";
|
|
2
|
-
import { c as SideBarDesktopSlots, b as SideBarMobileSlots, C as ContentComponentSlots, S as SideBarFooterSlots,
|
|
2
|
+
import { c as SideBarDesktopSlots, b as SideBarMobileSlots, C as ContentComponentSlots, S as SideBarFooterSlots, a as ContentGroupsSlots, H as HeaderSidebarSlots } from "./SideBarEnum.js";
|
|
3
3
|
import { S as SIDEBAR_KEY_COMPONENT } from "../constants.js";
|
|
4
4
|
import { s as sideBarStyles } from "../styles.js";
|
|
5
|
-
import { I as IconButton } from "../../mui_extended/IconButton/IconButton.js";
|
|
6
5
|
import { M as MenuItem } from "../../mui_extended/MenuItem/MenuItem.js";
|
|
7
6
|
const ContainerDesktopRootStyled = styled("section", {
|
|
8
7
|
name: SIDEBAR_KEY_COMPONENT,
|
|
@@ -12,6 +11,10 @@ const ContainerDesktopContentStyled = styled("div", {
|
|
|
12
11
|
name: SIDEBAR_KEY_COMPONENT,
|
|
13
12
|
slot: SideBarDesktopSlots.containerDesktopContent
|
|
14
13
|
})(sideBarStyles?.containerDesktopContent);
|
|
14
|
+
const ContainerBtnAnchoredStyled = styled("div", {
|
|
15
|
+
name: SIDEBAR_KEY_COMPONENT,
|
|
16
|
+
slot: SideBarDesktopSlots.containerBtnAnchored
|
|
17
|
+
})(sideBarStyles?.containerBtnAnchored);
|
|
15
18
|
const ContainerTreeGroupItemsStyled = styled("section", {
|
|
16
19
|
name: SIDEBAR_KEY_COMPONENT,
|
|
17
20
|
slot: ContentGroupsSlots.containerTreeGroupItems
|
|
@@ -36,22 +39,14 @@ const ContainerArrowIconRootStyled = styled("div", {
|
|
|
36
39
|
name: SIDEBAR_KEY_COMPONENT,
|
|
37
40
|
slot: ContentGroupsSlots.containerArrowIconRoot
|
|
38
41
|
})(sideBarStyles?.containerArrowIconRoot);
|
|
39
|
-
|
|
40
|
-
name: SIDEBAR_KEY_COMPONENT,
|
|
41
|
-
slot: HeaderSidebarSlots.headerContainerComponent
|
|
42
|
-
})(sideBarStyles?.headerContainerComponent);
|
|
43
|
-
const ContainerAdornmentIconStyled = styled("div", {
|
|
44
|
-
name: SIDEBAR_KEY_COMPONENT,
|
|
45
|
-
slot: ContentGroupsSlots.containerAdornmentIcon
|
|
46
|
-
})(sideBarStyles?.containerAdornmentIcon);
|
|
47
|
-
const BackgroundAdornmentIconStyled = styled("div", {
|
|
42
|
+
styled("section", {
|
|
48
43
|
name: SIDEBAR_KEY_COMPONENT,
|
|
49
|
-
slot:
|
|
50
|
-
})(sideBarStyles?.
|
|
51
|
-
|
|
44
|
+
slot: HeaderSidebarSlots.containerHeaderSidebarRoot
|
|
45
|
+
})(sideBarStyles?.containerHeaderSidebarRoot);
|
|
46
|
+
styled("div", {
|
|
52
47
|
name: SIDEBAR_KEY_COMPONENT,
|
|
53
|
-
slot: HeaderSidebarSlots.
|
|
54
|
-
})(sideBarStyles?.
|
|
48
|
+
slot: HeaderSidebarSlots.containerTitleSubtitle
|
|
49
|
+
})(sideBarStyles?.containerTitleSubtitle);
|
|
55
50
|
const ContainerFooterStyled = styled("div", {
|
|
56
51
|
name: SIDEBAR_KEY_COMPONENT,
|
|
57
52
|
slot: SideBarFooterSlots.containerFooter
|
|
@@ -64,10 +59,14 @@ const ContentComponentRootStyled = styled("div", {
|
|
|
64
59
|
name: SIDEBAR_KEY_COMPONENT,
|
|
65
60
|
slot: ContentComponentSlots.contentComponentRoot
|
|
66
61
|
})(sideBarStyles?.contentComponentRoot);
|
|
67
|
-
const
|
|
62
|
+
const ContentComponentHideStyled = styled("div", {
|
|
63
|
+
name: SIDEBAR_KEY_COMPONENT,
|
|
64
|
+
slot: ContentComponentSlots.contentComponentHide
|
|
65
|
+
})(sideBarStyles?.contentComponentHide);
|
|
66
|
+
const ContainerTreeItemsAndPromotionStyled = styled("div", {
|
|
68
67
|
name: SIDEBAR_KEY_COMPONENT,
|
|
69
|
-
slot: ContentComponentSlots.
|
|
70
|
-
})(sideBarStyles?.
|
|
68
|
+
slot: ContentComponentSlots.containerTreeItemsAndPromotion
|
|
69
|
+
})(sideBarStyles?.containerTreeItemsAndPromotion);
|
|
71
70
|
const ContainerNodeMenuItemStyled = styled("div", {
|
|
72
71
|
name: SIDEBAR_KEY_COMPONENT,
|
|
73
72
|
slot: ContentComponentSlots.containerNodeMenuItem
|
|
@@ -81,20 +80,18 @@ const MenuItemMainStyled = styled(MenuItem, {
|
|
|
81
80
|
slot: ContentComponentSlots.menuItemMain
|
|
82
81
|
})(sideBarStyles?.menuItemMain);
|
|
83
82
|
export {
|
|
84
|
-
ButtonAnchoredStyled as B,
|
|
85
83
|
ContentComponentRootStyled as C,
|
|
86
|
-
HeaderContainerComponentStyled as H,
|
|
87
84
|
MenuItemMainStyled as M,
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
85
|
+
ContainerBtnAnchoredStyled as a,
|
|
86
|
+
ContentComponentHideStyled as b,
|
|
87
|
+
ContainerTreeItemsAndPromotionStyled as c,
|
|
88
|
+
ContainerFooterStyled as d,
|
|
89
|
+
ContainerDesktopContentStyled as e,
|
|
90
|
+
ContainerDesktopRootStyled as f,
|
|
91
|
+
ContainerSideBarMobileStyled as g,
|
|
92
|
+
ContainerTreeGroupItemsStyled as h,
|
|
93
|
+
ContainerContentGroupsStyled as i,
|
|
94
|
+
ContainerContentTitleStyled as j,
|
|
98
95
|
ContainerArrowIconRootStyled as k,
|
|
99
96
|
ContainerNodeMenuItemStyled as l,
|
|
100
97
|
ContainerNodeMenuItemMainStyled as m
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { s as sideBarDesktopStyles } from "./subcomponents/SideBarDesktop/styles.js";
|
|
2
2
|
import { c as contentGroupStyles } from "./subcomponents/TreeGroupItems/styles.js";
|
|
3
|
-
import { h as
|
|
4
|
-
import { f as footerSideBarStyles } from "./subcomponents/
|
|
3
|
+
import { h as headerSidebarStyles } from "./subcomponents/HeaderSidebar/styles.js";
|
|
4
|
+
import { f as footerSideBarStyles } from "./subcomponents/Promotion/styles.js";
|
|
5
5
|
import { c as contentComponentStyles } from "./subcomponents/ContentComponent/style.js";
|
|
6
6
|
import { s as sideBarMobileStyles } from "./subcomponents/SideBarMobile/styles.js";
|
|
7
7
|
const sideBarStyles = {
|
|
8
8
|
...sideBarDesktopStyles,
|
|
9
9
|
...sideBarMobileStyles,
|
|
10
10
|
...contentGroupStyles,
|
|
11
|
-
...
|
|
11
|
+
...headerSidebarStyles,
|
|
12
12
|
...footerSideBarStyles,
|
|
13
13
|
...contentComponentStyles
|
|
14
14
|
};
|
|
@@ -1,23 +1,79 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useIsMobile } from "@m4l/graphics";
|
|
3
|
+
import { useEnvironment } from "@m4l/core";
|
|
2
4
|
import { u as useSideBar } from "../../hooks/useSideBar/index.js";
|
|
3
|
-
import { C as ContentComponentRootStyled, a as
|
|
5
|
+
import { C as ContentComponentRootStyled, a as ContainerBtnAnchoredStyled, b as ContentComponentHideStyled, c as ContainerTreeItemsAndPromotionStyled } from "../../slots/SideBarSlots.js";
|
|
4
6
|
import { T as TreeGroupItems } from "../TreeGroupItems/index.js";
|
|
5
|
-
import {
|
|
7
|
+
import { P as Promotion } from "../Promotion/index.js";
|
|
8
|
+
import { a as getComponentSlotRoot } from "../../../../utils/getComponentSlotRoot.js";
|
|
9
|
+
import { a as PATH_ARROW_RIGHT_ICON, C as CONTAINER_BTN_ANCHORED } from "../../constants.js";
|
|
10
|
+
import { useRef } from "react";
|
|
6
11
|
import { u as useComponentSize } from "../../../../hooks/useComponentSize/useComponentSize.js";
|
|
7
|
-
import {
|
|
12
|
+
import { I as IconButton } from "../../../mui_extended/IconButton/IconButton.js";
|
|
8
13
|
const ContentComponent = () => {
|
|
9
|
-
const { anchored, onToggleAnchored, expandedWidth, size,
|
|
14
|
+
const { anchored, onToggleAnchored, expandedWidth, size, classes, isHover, setIsHover } = useSideBar();
|
|
10
15
|
const ownerState = {
|
|
11
16
|
expandedWidth,
|
|
12
|
-
anchored
|
|
13
|
-
variant
|
|
17
|
+
anchored
|
|
14
18
|
};
|
|
19
|
+
const btnAnchoredRef = useRef(null);
|
|
20
|
+
const contentRef = useRef(null);
|
|
21
|
+
const { host_static_assets, environment_assets } = useEnvironment();
|
|
22
|
+
const isDesktop = !useIsMobile();
|
|
15
23
|
const { currentSize } = useComponentSize(size);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
24
|
+
const classRootBtnAnchored = getComponentSlotRoot(CONTAINER_BTN_ANCHORED);
|
|
25
|
+
const handlerAnchoredButton = () => {
|
|
26
|
+
onToggleAnchored(!anchored);
|
|
27
|
+
};
|
|
28
|
+
return /* @__PURE__ */ jsxs(ContentComponentRootStyled, { ownerState, children: [
|
|
29
|
+
isDesktop && /* @__PURE__ */ jsx(
|
|
30
|
+
ContainerBtnAnchoredStyled,
|
|
31
|
+
{
|
|
32
|
+
ref: btnAnchoredRef,
|
|
33
|
+
className: classRootBtnAnchored,
|
|
34
|
+
ownerState,
|
|
35
|
+
onMouseLeave: (event) => {
|
|
36
|
+
if (!anchored && contentRef.current && !contentRef.current.contains(event.relatedTarget)) {
|
|
37
|
+
setIsHover(false);
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
children: /* @__PURE__ */ jsx(
|
|
41
|
+
IconButton,
|
|
42
|
+
{
|
|
43
|
+
role: "anchored-button",
|
|
44
|
+
variant: anchored ? "contained" : "outline",
|
|
45
|
+
rotationAngle: !anchored ? 0 : 180,
|
|
46
|
+
onClick: handlerAnchoredButton,
|
|
47
|
+
src: `${host_static_assets}/${environment_assets}/${PATH_ARROW_RIGHT_ICON}`,
|
|
48
|
+
color: anchored ? "primary" : "default"
|
|
49
|
+
}
|
|
50
|
+
)
|
|
51
|
+
}
|
|
52
|
+
),
|
|
53
|
+
/* @__PURE__ */ jsx(
|
|
54
|
+
ContentComponentHideStyled,
|
|
55
|
+
{
|
|
56
|
+
ref: contentRef,
|
|
57
|
+
ownerState: { ...ownerState, isDesktop, isHover },
|
|
58
|
+
className: classes.contentComponentHide,
|
|
59
|
+
role: "complementary",
|
|
60
|
+
"aria-label": "hidden content",
|
|
61
|
+
onMouseEnter: () => {
|
|
62
|
+
!anchored && setIsHover(true);
|
|
63
|
+
},
|
|
64
|
+
onMouseLeave: (event) => {
|
|
65
|
+
if (!anchored && btnAnchoredRef.current && btnAnchoredRef.current.contains(event.relatedTarget)) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
setIsHover(false);
|
|
69
|
+
},
|
|
70
|
+
children: /* @__PURE__ */ jsxs(ContainerTreeItemsAndPromotionStyled, { ownerState, children: [
|
|
71
|
+
/* @__PURE__ */ jsx(TreeGroupItems, { size: currentSize }),
|
|
72
|
+
/* @__PURE__ */ jsx(Promotion, { onToggleAnchored, anchored })
|
|
73
|
+
] })
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
] });
|
|
21
77
|
};
|
|
22
78
|
export {
|
|
23
79
|
ContentComponent as C
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { b as CLASS_NAME_IS_ROOT, c as CLASS_NAME_MENU_ACTIVE, d as CLASS_NAME_ITEM_IN_TREE_ACTIVE, e as CLASS_NAME_HAS_CHILDREN } from "../../constants.js";
|
|
2
2
|
import { g as getTypographyStyles } from "../../../../utils/getTypographyStyles.js";
|
|
3
|
+
import { g as getSizeStyles } from "../../../../utils/getSizeStyles/getSizeStyles.js";
|
|
3
4
|
const contentComponentStyles = {
|
|
4
5
|
/**
|
|
5
6
|
* Estilos del contenedor principal del sidebar
|
|
@@ -9,48 +10,68 @@ const contentComponentStyles = {
|
|
|
9
10
|
display: "flex",
|
|
10
11
|
flexDirection: "column",
|
|
11
12
|
height: "100%",
|
|
12
|
-
width: "
|
|
13
|
+
width: "fit-content",
|
|
13
14
|
backgroundColor: theme.vars.palette.background.default
|
|
14
15
|
}),
|
|
16
|
+
/**
|
|
17
|
+
* Estilos del contenedor que oculta el contenido cuando se encuentra des anclado.
|
|
18
|
+
*/
|
|
19
|
+
contentComponentHide: ({ theme, ownerState }) => {
|
|
20
|
+
const width = ownerState?.anchored ? ownerState?.expandedWidth : theme.vars.size.baseSpacings.sp4;
|
|
21
|
+
return {
|
|
22
|
+
width: "100%",
|
|
23
|
+
height: "100%",
|
|
24
|
+
overflow: "hidden",
|
|
25
|
+
flex: 1,
|
|
26
|
+
display: "flex",
|
|
27
|
+
flexDirection: "column",
|
|
28
|
+
transition: "all 0.5s",
|
|
29
|
+
...!ownerState?.anchored && !theme.generalSettings.isMobile && {
|
|
30
|
+
width: ownerState?.anchored && ownerState?.isDesktop ? ownerState?.expandedWidth : !ownerState?.isDesktop ? "100%" : theme.vars.size.baseSpacings.sp4,
|
|
31
|
+
minWidth: width,
|
|
32
|
+
maxWidth: width,
|
|
33
|
+
...ownerState?.isHover && !theme.generalSettings.isMobile && {
|
|
34
|
+
transition: "all 0.5s",
|
|
35
|
+
width: `${ownerState?.expandedWidth}!important`,
|
|
36
|
+
maxWidth: `${ownerState?.expandedWidth}!important`,
|
|
37
|
+
contentVisibility: "visible",
|
|
38
|
+
'& [class*="containerFooter"]': {
|
|
39
|
+
borderWidth: theme.vars.size.baseSpacings["sp0-5"]
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
},
|
|
15
45
|
/**
|
|
16
46
|
* Contenedor que abraza el contenido del menu en primer lugar.
|
|
17
47
|
*/
|
|
18
|
-
|
|
48
|
+
containerTreeItemsAndPromotion: ({ theme, ownerState }) => ({
|
|
19
49
|
height: "100%",
|
|
20
|
-
width:
|
|
50
|
+
width: ownerState?.expandedWidth,
|
|
21
51
|
flex: 1,
|
|
22
52
|
overflow: "hidden",
|
|
23
53
|
display: "flex",
|
|
24
54
|
flexDirection: "column",
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
paddingBottom: theme.vars.size.baseSpacings.sp4,
|
|
28
|
-
...!ownerState?.anchored && ownerState?.variant !== "host" && {
|
|
29
|
-
transition: "all 0.5s",
|
|
30
|
-
paddingLeft: "unset",
|
|
31
|
-
paddingRight: "unset"
|
|
32
|
-
},
|
|
55
|
+
paddingLeft: theme.vars.size.baseSpacings.sp4,
|
|
56
|
+
paddingRight: theme.vars.size.baseSpacings.sp4,
|
|
33
57
|
'& [class*="M4LMenuItem-root"], & [class*="M4LMenuItem-skeletonMenuItem"]': {
|
|
34
|
-
|
|
58
|
+
...getSizeStyles(
|
|
59
|
+
theme,
|
|
60
|
+
ownerState?.size || "medium",
|
|
61
|
+
"container",
|
|
62
|
+
(size) => ({
|
|
63
|
+
height: size,
|
|
64
|
+
minHeight: size,
|
|
65
|
+
maxHeight: size
|
|
66
|
+
})
|
|
67
|
+
)
|
|
35
68
|
},
|
|
36
69
|
"& .M4LMenuItem-root": {
|
|
37
70
|
border: "unset",
|
|
38
|
-
paddingTop: theme.vars.size.baseSpacings.sp2,
|
|
39
|
-
paddingBottom: theme.vars.size.baseSpacings.sp2,
|
|
40
71
|
paddingLeft: theme.vars.size.baseSpacings.sp2,
|
|
41
72
|
paddingRight: theme.vars.size.baseSpacings.sp2,
|
|
42
|
-
borderRadius: theme.vars.size.borderRadius["r1-5"],
|
|
43
|
-
'& [class*="M4LMenuItem-menuItemContainer"]': {
|
|
44
|
-
gap: theme.vars.size.baseSpacings["sp2-5"],
|
|
45
|
-
overflow: "visible"
|
|
46
|
-
},
|
|
47
|
-
"&.menu-active": {
|
|
48
|
-
"& .M4LTypography-root": {
|
|
49
|
-
color: `${theme.vars.palette.primary.semanticText}!important`
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
73
|
"& .M4LTypography-root": {
|
|
53
|
-
paddingLeft:
|
|
74
|
+
paddingLeft: `${theme.vars.size.baseSpacings.sp2} !important`,
|
|
54
75
|
...getTypographyStyles(
|
|
55
76
|
theme.generalSettings.isMobile,
|
|
56
77
|
ownerState?.size || "medium",
|
|
@@ -62,90 +83,82 @@ const contentComponentStyles = {
|
|
|
62
83
|
/**
|
|
63
84
|
* Contenedor que contiene grupo menu item desplegable.
|
|
64
85
|
*/
|
|
65
|
-
containerNodeMenuItem: ({ theme }) => ({
|
|
66
|
-
marginLeft: theme.vars.size.baseSpacings.
|
|
86
|
+
containerNodeMenuItem: ({ theme, ownerState }) => ({
|
|
87
|
+
marginLeft: theme.vars.size.baseSpacings.sp4,
|
|
67
88
|
display: "flex",
|
|
68
89
|
flexDirection: "column",
|
|
69
90
|
overflow: "visible",
|
|
70
|
-
position: "relative",
|
|
71
|
-
gap: theme.vars.size.baseSpacings.sp1,
|
|
72
91
|
'& [class*="M4LMenuItem-root"]:not(.menu-active)': {
|
|
73
92
|
"& .M4LTypography-root": {
|
|
74
93
|
color: `${theme.vars.palette.text.secondary}!important`
|
|
94
|
+
},
|
|
95
|
+
"& .M4LIcon-icon": {
|
|
96
|
+
backgroundColor: `${theme.vars.palette.text.secondary}!important`
|
|
75
97
|
}
|
|
76
98
|
},
|
|
77
99
|
[`&.${CLASS_NAME_IS_ROOT}`]: {
|
|
78
|
-
margin: "unset"
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
100
|
+
margin: "unset"
|
|
101
|
+
},
|
|
102
|
+
[`& > .M4LMenuItem-root:first-of-type:not(.${CLASS_NAME_MENU_ACTIVE}).${CLASS_NAME_ITEM_IN_TREE_ACTIVE}`]: {
|
|
103
|
+
borderColor: theme.vars.palette.divider,
|
|
104
|
+
// Linea de referencia vertical
|
|
105
|
+
"&::before": {
|
|
106
|
+
content: '""',
|
|
107
|
+
position: "absolute",
|
|
108
|
+
top: "-25%",
|
|
109
|
+
bottom: "-25%",
|
|
110
|
+
height: "150%",
|
|
111
|
+
left: 0,
|
|
112
|
+
width: 2,
|
|
113
|
+
borderLeft: theme.vars.size.borderStroke.container,
|
|
114
|
+
borderColor: theme.vars.palette.border.default,
|
|
115
|
+
...ownerState?.isLastSibling && !ownerState?.hasChildren && {
|
|
116
|
+
height: "75%"
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
// Linea de referencia horizontal
|
|
120
|
+
[`&:not(.${CLASS_NAME_HAS_CHILDREN}):after`]: {
|
|
121
|
+
content: '""',
|
|
122
|
+
position: "absolute",
|
|
123
|
+
margin: "0",
|
|
124
|
+
left: 1,
|
|
125
|
+
width: 4,
|
|
126
|
+
height: 1,
|
|
127
|
+
borderTop: theme.vars.size.borderStroke.container,
|
|
128
|
+
borderColor: theme.vars.palette.border.default
|
|
83
129
|
}
|
|
84
130
|
},
|
|
85
131
|
[`&.M4LSidebar-containerNodeMenuItem > .M4LMenuItem-root[class*="${CLASS_NAME_ITEM_IN_TREE_ACTIVE}"] .M4LIconClass-root`]: {
|
|
86
132
|
background: theme.vars.palette.text.primary
|
|
87
133
|
},
|
|
88
|
-
[`& > .MuiCollapse-root > .MuiCollapse-wrapper .MuiCollapse-wrapperInner > .M4LSideBar-containerNodeMenuItem:last-child > .M4LMenuItem-root:not(.${CLASS_NAME_IS_ROOT}).${CLASS_NAME_MENU_ACTIVE}`]: {
|
|
89
|
-
"& .M4LMenuItem-menuItemContainer": {
|
|
90
|
-
"&::before": {
|
|
91
|
-
content: '""',
|
|
92
|
-
borderLeft: "3px solid",
|
|
93
|
-
borderColor: theme.vars.palette.background.default,
|
|
94
|
-
width: "3px",
|
|
95
|
-
height: "50%",
|
|
96
|
-
bottom: 0,
|
|
97
|
-
position: "absolute",
|
|
98
|
-
left: "-5px",
|
|
99
|
-
zIndex: 1
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
},
|
|
103
134
|
[`& > .M4LMenuItem-root:not(.${CLASS_NAME_IS_ROOT}).${CLASS_NAME_MENU_ACTIVE}`]: {
|
|
104
|
-
[`&.${CLASS_NAME_HAS_CHILDREN}:not(.${CLASS_NAME_ITEM_CLOSED})`]: {
|
|
105
|
-
'& [class*="M4LMenuItem-menuItemContainer"]:before': {
|
|
106
|
-
content: '""',
|
|
107
|
-
borderLeft: "3px solid",
|
|
108
|
-
borderColor: theme.vars.palette.background.default,
|
|
109
|
-
width: "3px",
|
|
110
|
-
height: "50%",
|
|
111
|
-
bottom: 0,
|
|
112
|
-
position: "absolute",
|
|
113
|
-
left: "-5px",
|
|
114
|
-
zIndex: 1
|
|
115
|
-
}
|
|
116
|
-
},
|
|
117
135
|
"&::before": {
|
|
118
136
|
content: '""',
|
|
119
137
|
position: "absolute",
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
138
|
+
height: "25%",
|
|
139
|
+
top: "25%",
|
|
140
|
+
bottom: 0,
|
|
141
|
+
left: 0,
|
|
142
|
+
width: 2,
|
|
143
|
+
borderLeft: theme.vars.size.borderStroke.container,
|
|
144
|
+
borderColor: theme.vars.palette.primary.enabled,
|
|
145
|
+
...!ownerState?.isLastSibling && !ownerState?.hasChildren && {
|
|
146
|
+
height: "50%"
|
|
147
|
+
}
|
|
128
148
|
},
|
|
129
|
-
"
|
|
149
|
+
"&:after": {
|
|
130
150
|
content: '""',
|
|
131
151
|
position: "absolute",
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
${theme.vars.palette.primary.opacityGradient1} 50%,
|
|
139
|
-
transparent 100%)`
|
|
152
|
+
margin: "0",
|
|
153
|
+
left: 0,
|
|
154
|
+
width: theme.vars.size.baseSpacings.sp1,
|
|
155
|
+
height: 1,
|
|
156
|
+
borderTop: theme.vars.size.borderStroke.container,
|
|
157
|
+
borderColor: theme.vars.palette.primary.enabled
|
|
140
158
|
}
|
|
141
159
|
},
|
|
142
|
-
[`& > .M4LMenuItem-root.${CLASS_NAME_IS_ROOT}`]: {
|
|
143
|
-
paddingRight: "11px"
|
|
144
|
-
},
|
|
145
160
|
[`& > .M4LMenuItem-root.${CLASS_NAME_IS_ROOT}.${CLASS_NAME_MENU_ACTIVE}`]: {
|
|
146
|
-
backgroundColor: theme.vars.palette.primary.opacity
|
|
147
|
-
borderBottomLeftRadius: 0,
|
|
148
|
-
borderBottomRightRadius: 0
|
|
161
|
+
backgroundColor: theme.vars.palette.primary.opacity
|
|
149
162
|
},
|
|
150
163
|
"& .MuiCollapse-wrapperInner": {
|
|
151
164
|
display: "flex",
|
|
@@ -153,46 +166,14 @@ const contentComponentStyles = {
|
|
|
153
166
|
paddingLeft: 0,
|
|
154
167
|
paddingBottom: theme.vars.size.baseSpacings.sp1,
|
|
155
168
|
paddingTop: 0,
|
|
156
|
-
|
|
157
|
-
content: '""',
|
|
158
|
-
position: "absolute",
|
|
159
|
-
width: "1px",
|
|
160
|
-
top: "-4px",
|
|
161
|
-
bottom: "-4px",
|
|
162
|
-
left: "-4px",
|
|
163
|
-
backgroundColor: theme.vars.palette.background.default,
|
|
164
|
-
zIndex: 1
|
|
165
|
-
}
|
|
169
|
+
paddingRight: theme.vars.size.baseSpacings.sp1
|
|
166
170
|
},
|
|
167
171
|
[`&.${CLASS_NAME_IS_ROOT}.${CLASS_NAME_MENU_ACTIVE}`]: {
|
|
168
|
-
backgroundColor: theme.vars.palette.background.
|
|
169
|
-
borderRadius: theme.vars.size.borderRadius
|
|
170
|
-
border: theme.vars.size.borderStroke.container,
|
|
171
|
-
borderColor: theme.vars.palette.primary.selectedOpacity,
|
|
172
|
-
boxShadow: theme.vars.customShadows.z2,
|
|
173
|
-
overflow: "hidden"
|
|
174
|
-
},
|
|
175
|
-
"& .MuiCollapse-root:first-of-type": {
|
|
176
|
-
position: "relative"
|
|
177
|
-
},
|
|
178
|
-
"&.menu-active .MuiCollapse-wrapper.MuiCollapse-vertical:first-of-type:before": {
|
|
179
|
-
content: '""',
|
|
180
|
-
position: "absolute",
|
|
181
|
-
width: "1px",
|
|
182
|
-
top: "5px",
|
|
183
|
-
bottom: "5px",
|
|
184
|
-
left: "20px",
|
|
185
|
-
borderLeft: theme.vars.size.borderStroke.container,
|
|
186
|
-
borderColor: theme.vars.palette.border.secondary,
|
|
187
|
-
zIndex: 1
|
|
172
|
+
backgroundColor: theme.vars.palette.background.base,
|
|
173
|
+
borderRadius: theme.vars.size.borderRadius["r1-5"]
|
|
188
174
|
}
|
|
189
175
|
}),
|
|
190
|
-
|
|
191
|
-
* Contenedor que contiene el menu item principal.
|
|
192
|
-
*/
|
|
193
|
-
containerNodeMenuItemMain: ({ theme }) => ({
|
|
194
|
-
gap: theme.vars.size.baseSpacings.sp1
|
|
195
|
-
}),
|
|
176
|
+
containerNodeMenuItemMain: {},
|
|
196
177
|
/**
|
|
197
178
|
* Estilos del menu item principal.
|
|
198
179
|
*/
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { HeaderSidebarProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Component HeaderSidebar representa el encabezado de la barra lateral.<
|
|
4
|
+
*/
|
|
5
|
+
declare const HeaderSidebar: ({ srcIcon, title, subtitle }: HeaderSidebarProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export default HeaderSidebar;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
const headerSidebarStyles = {
|
|
2
|
+
/**
|
|
3
|
+
* Container del header del sidebar
|
|
4
|
+
*/
|
|
5
|
+
containerHeaderSidebarRoot: ({ theme }) => ({
|
|
6
|
+
display: "flex",
|
|
7
|
+
flexDirection: "row",
|
|
8
|
+
alignItems: "center",
|
|
9
|
+
padding: `${theme.vars.size.baseSpacings.sp6} ${theme.vars.size.baseSpacings.sp5}`,
|
|
10
|
+
gap: `${theme.vars.size.baseSpacings.sp2}`
|
|
11
|
+
}),
|
|
12
|
+
/**
|
|
13
|
+
* Contenedor del título y subtítulo del sidebar
|
|
14
|
+
*/
|
|
15
|
+
containerTitleSubtitle: ({ theme }) => ({
|
|
16
|
+
display: "flex",
|
|
17
|
+
flexDirection: "column",
|
|
18
|
+
alignItems: "start",
|
|
19
|
+
gap: `${theme.vars.size.baseSpacings.sp1}`
|
|
20
|
+
})
|
|
21
|
+
};
|
|
22
|
+
export {
|
|
23
|
+
headerSidebarStyles as h
|
|
24
|
+
};
|
|
@@ -6,4 +6,4 @@ import { PromotionProps } from './types';
|
|
|
6
6
|
* @param {VoidFunction} props.collapsed - Variable que guarda el estado de colapsado en desktop
|
|
7
7
|
* @returns
|
|
8
8
|
*/
|
|
9
|
-
export default function
|
|
9
|
+
export default function Promotion({ anchored }: PromotionProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -2,9 +2,9 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { u as useSideBar } from "../../hooks/useSideBar/index.js";
|
|
3
3
|
import { T as TEST_PROP_ID } from "../../../../test/constants_no_mock.js";
|
|
4
4
|
import { g as getNameDataTestId } from "../../tests/utils.js";
|
|
5
|
-
import {
|
|
6
|
-
function
|
|
7
|
-
const {
|
|
5
|
+
import { d as ContainerFooterStyled } from "../../slots/SideBarSlots.js";
|
|
6
|
+
function Promotion({ anchored }) {
|
|
7
|
+
const { promotion } = useSideBar();
|
|
8
8
|
const ownerState = {
|
|
9
9
|
anchored
|
|
10
10
|
};
|
|
@@ -22,5 +22,5 @@ function FooterComponent({ anchored }) {
|
|
|
22
22
|
);
|
|
23
23
|
}
|
|
24
24
|
export {
|
|
25
|
-
|
|
25
|
+
Promotion as P
|
|
26
26
|
};
|
|
@@ -6,16 +6,10 @@ const footerSideBarStyles = {
|
|
|
6
6
|
height: "auto",
|
|
7
7
|
display: "grid",
|
|
8
8
|
placeItems: "center",
|
|
9
|
-
|
|
9
|
+
borderTop: `${theme.vars.size.baseSpacings["sp0-5"]} solid ${theme.vars.palette.border.secondary}`,
|
|
10
10
|
borderWidth: ownerState?.anchored ? theme.vars.size.baseSpacings["sp0-5"] : theme.vars.size.baseSpacings.sp0,
|
|
11
11
|
transition: "all 0.5s",
|
|
12
|
-
paddingBottom: theme.vars.size.baseSpacings.sp2
|
|
13
|
-
marginLeft: theme.vars.size.baseSpacings.sp4,
|
|
14
|
-
marginRight: theme.vars.size.baseSpacings.sp4,
|
|
15
|
-
...!ownerState?.anchored && !theme.generalSettings.isMobile && {
|
|
16
|
-
transition: "all 0.5s",
|
|
17
|
-
visibility: "hidden"
|
|
18
|
-
}
|
|
12
|
+
paddingBottom: theme.vars.size.baseSpacings.sp2
|
|
19
13
|
})
|
|
20
14
|
};
|
|
21
15
|
export {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useFirstRender } from "@m4l/graphics";
|
|
3
3
|
import { u as useSideBar } from "../../hooks/useSideBar/index.js";
|
|
4
|
-
import {
|
|
4
|
+
import { e as ContainerDesktopContentStyled, f as ContainerDesktopRootStyled } from "../../slots/SideBarSlots.js";
|
|
5
5
|
import { S as SIDEBAR_KEY_COMPONENT } from "../../constants.js";
|
|
6
6
|
import { C as ContentComponent } from "../ContentComponent/index.js";
|
|
7
7
|
import { useState, useEffect } from "react";
|
|
8
8
|
import { a as getComponentSlotRoot } from "../../../../utils/getComponentSlotRoot.js";
|
|
9
9
|
const SideBarDesktop = () => {
|
|
10
|
-
const { anchored, expandedWidth
|
|
10
|
+
const { anchored, expandedWidth } = useSideBar();
|
|
11
11
|
const [eventAnchored, setEventAnchored] = useState(anchored);
|
|
12
12
|
const isFirstRender = useFirstRender([anchored]);
|
|
13
13
|
useEffect(() => {
|
|
@@ -18,8 +18,7 @@ const SideBarDesktop = () => {
|
|
|
18
18
|
}, [anchored]);
|
|
19
19
|
const ownerState = {
|
|
20
20
|
anchored: eventAnchored,
|
|
21
|
-
expandedWidth
|
|
22
|
-
variant
|
|
21
|
+
expandedWidth
|
|
23
22
|
};
|
|
24
23
|
const classRoot = getComponentSlotRoot(SIDEBAR_KEY_COMPONENT);
|
|
25
24
|
return /* @__PURE__ */ jsx(
|