@m4l/components 9.2.62-B08072025beta.3 → 9.2.62-B09072025beta.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/@types/types.d.ts +8 -0
- 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/ContainerFlow/ContainerFlow.d.ts +7 -0
- package/components/ContainerFlow/ContainerFlow.js +25 -0
- package/components/ContainerFlow/ContainerFlow.styles.d.ts +2 -0
- package/components/ContainerFlow/ContainerFlow.styles.js +46 -0
- package/components/ContainerFlow/constants.d.ts +8 -0
- package/components/ContainerFlow/constants.js +19 -0
- package/components/ContainerFlow/helpers/getSpacingValue/getSpacingValue.d.ts +7 -0
- package/components/ContainerFlow/helpers/getSpacingValue/getSpacingValue.js +10 -0
- package/components/ContainerFlow/helpers/getSpacingValue/getSpacingValue.test.d.ts +1 -0
- package/components/ContainerFlow/index.d.ts +2 -0
- package/components/ContainerFlow/slots/ContainerFlowEnum.d.ts +4 -0
- package/components/ContainerFlow/slots/ContainerFlowEnum.js +8 -0
- package/components/ContainerFlow/slots/ContainerFlowSlots.d.ts +6 -0
- package/components/ContainerFlow/slots/ContainerFlowSlots.js +16 -0
- package/components/ContainerFlow/slots/index.d.ts +0 -0
- package/components/ContainerFlow/tests/ContainerFlow.test.d.ts +1 -0
- package/components/ContainerFlow/types.d.ts +41 -0
- package/components/Image/Image.js +4 -2
- package/components/Image/image.styles.js +6 -3
- package/components/Image/types.d.ts +2 -0
- package/components/LoadingError/slots/LoadingErrorSlots.js +1 -1
- package/components/PropertyValue/PropertyValue.styles.js +1 -1
- 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 -103
- 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 +1 -7
- 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/commercial/HamburgerMenu/HamburgerMenu.js +2 -1
- package/components/hook-form/RHFPeriod/subcomponents/Period/dictionary.js +4 -5
- package/components/index.d.ts +1 -0
- package/components/mui_extended/Accordion/styles.js +3 -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 +4 -1
- package/components/mui_extended/TabContent/constants.d.ts +1 -0
- package/components/mui_extended/TabContent/constants.js +2 -0
- package/components/mui_extended/TabContent/types.d.ts +1 -1
- package/components/mui_extended/Typography/Typography.js +3 -1
- package/components/mui_extended/Typography/types.d.ts +5 -0
- package/components/mui_extended/Typography/typography.styles.js +7 -1
- package/index.js +32 -30
- package/package.json +3 -3
- package/storybook/components/ContainerFlow/ContainerFlow.stories.d.ts +32 -0
- package/storybook/components/ContainerFlow/subcomponents/RenderFlexColumn/index.d.ts +5 -0
- package/storybook/components/ContainerFlow/subcomponents/RenderFlexColumn1Wrappers/index.d.ts +5 -0
- package/storybook/components/ContainerFlow/subcomponents/RenderFlexColumn2Wrappers/index.d.ts +5 -0
- package/storybook/components/ContainerFlow/subcomponents/RenderFlexColumn3Wrappers/index.d.ts +5 -0
- package/storybook/components/ContainerFlow/subcomponents/RenderFlexWrap/index.d.ts +5 -0
- package/storybook/components/ContainerFlow/subcomponents/RenderGridLayout/index.d.ts +5 -0
- package/storybook/components/ContainerFlow/wrapperItems/index.d.ts +10 -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/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/HeaderComponent → ContainerFlow}/index.js +0 -0
- /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,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
|
|
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,71 +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
|
-
|
|
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
|
|
81
129
|
}
|
|
82
130
|
},
|
|
83
131
|
[`&.M4LSidebar-containerNodeMenuItem > .M4LMenuItem-root[class*="${CLASS_NAME_ITEM_IN_TREE_ACTIVE}"] .M4LIconClass-root`]: {
|
|
84
132
|
background: theme.vars.palette.text.primary
|
|
85
133
|
},
|
|
86
134
|
[`& > .M4LMenuItem-root:not(.${CLASS_NAME_IS_ROOT}).${CLASS_NAME_MENU_ACTIVE}`]: {
|
|
87
|
-
[`&.${CLASS_NAME_HAS_CHILDREN}:not(.${CLASS_NAME_ITEM_CLOSED})`]: {
|
|
88
|
-
'& [class*="M4LMenuItem-menuItemContainer"]:before': {
|
|
89
|
-
content: '""',
|
|
90
|
-
borderLeft: "3px solid",
|
|
91
|
-
borderColor: theme.vars.palette.background.default,
|
|
92
|
-
width: "3px",
|
|
93
|
-
height: "50%",
|
|
94
|
-
bottom: 0,
|
|
95
|
-
position: "absolute",
|
|
96
|
-
left: "-5px",
|
|
97
|
-
zIndex: 1
|
|
98
|
-
}
|
|
99
|
-
},
|
|
100
135
|
"&::before": {
|
|
101
136
|
content: '""',
|
|
102
137
|
position: "absolute",
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
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
|
+
}
|
|
111
148
|
},
|
|
112
|
-
"
|
|
149
|
+
"&:after": {
|
|
113
150
|
content: '""',
|
|
114
151
|
position: "absolute",
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
${theme.vars.palette.primary.opacityGradient1} 50%,
|
|
122
|
-
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
|
|
123
158
|
}
|
|
124
159
|
},
|
|
125
160
|
[`& > .M4LMenuItem-root.${CLASS_NAME_IS_ROOT}.${CLASS_NAME_MENU_ACTIVE}`]: {
|
|
126
|
-
backgroundColor: theme.vars.palette.primary.opacity
|
|
127
|
-
borderBottomLeftRadius: 0,
|
|
128
|
-
borderBottomRightRadius: 0,
|
|
129
|
-
paddingRight: "9px"
|
|
161
|
+
backgroundColor: theme.vars.palette.primary.opacity
|
|
130
162
|
},
|
|
131
163
|
"& .MuiCollapse-wrapperInner": {
|
|
132
164
|
display: "flex",
|
|
@@ -134,46 +166,14 @@ const contentComponentStyles = {
|
|
|
134
166
|
paddingLeft: 0,
|
|
135
167
|
paddingBottom: theme.vars.size.baseSpacings.sp1,
|
|
136
168
|
paddingTop: 0,
|
|
137
|
-
|
|
138
|
-
content: '""',
|
|
139
|
-
position: "absolute",
|
|
140
|
-
width: "1px",
|
|
141
|
-
top: "-4px",
|
|
142
|
-
bottom: "-4px",
|
|
143
|
-
left: "-4px",
|
|
144
|
-
backgroundColor: theme.vars.palette.background.default,
|
|
145
|
-
zIndex: 1
|
|
146
|
-
}
|
|
169
|
+
paddingRight: theme.vars.size.baseSpacings.sp1
|
|
147
170
|
},
|
|
148
171
|
[`&.${CLASS_NAME_IS_ROOT}.${CLASS_NAME_MENU_ACTIVE}`]: {
|
|
149
|
-
backgroundColor: theme.vars.palette.background.
|
|
150
|
-
borderRadius: theme.vars.size.borderRadius
|
|
151
|
-
border: theme.vars.size.borderStroke.container,
|
|
152
|
-
borderColor: theme.vars.palette.primary.selectedOpacity,
|
|
153
|
-
boxShadow: theme.vars.customShadows.z2,
|
|
154
|
-
overflow: "hidden"
|
|
155
|
-
},
|
|
156
|
-
"& .MuiCollapse-root:first-of-type": {
|
|
157
|
-
position: "relative"
|
|
158
|
-
},
|
|
159
|
-
"&.menu-active .MuiCollapse-wrapper.MuiCollapse-vertical:first-of-type:before": {
|
|
160
|
-
content: '""',
|
|
161
|
-
position: "absolute",
|
|
162
|
-
width: "1px",
|
|
163
|
-
top: "5px",
|
|
164
|
-
bottom: "5px",
|
|
165
|
-
left: "20px",
|
|
166
|
-
borderLeft: theme.vars.size.borderStroke.container,
|
|
167
|
-
borderColor: theme.vars.palette.border.secondary,
|
|
168
|
-
zIndex: 1
|
|
172
|
+
backgroundColor: theme.vars.palette.background.base,
|
|
173
|
+
borderRadius: theme.vars.size.borderRadius["r1-5"]
|
|
169
174
|
}
|
|
170
175
|
}),
|
|
171
|
-
|
|
172
|
-
* Contenedor que contiene el menu item principal.
|
|
173
|
-
*/
|
|
174
|
-
containerNodeMenuItemMain: ({ theme }) => ({
|
|
175
|
-
gap: theme.vars.size.baseSpacings.sp1
|
|
176
|
-
}),
|
|
176
|
+
containerNodeMenuItemMain: {},
|
|
177
177
|
/**
|
|
178
178
|
* Estilos del menu item principal.
|
|
179
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
|
};
|
|
@@ -9,13 +9,7 @@ const footerSideBarStyles = {
|
|
|
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(
|
|
@@ -5,7 +5,7 @@ const sideBarDesktopStyles = {
|
|
|
5
5
|
* sin que se oculte por el overflow hidden que tiene el contenido del sidebar
|
|
6
6
|
*/
|
|
7
7
|
containerDesktopContent: ({ theme, ownerState }) => {
|
|
8
|
-
const width = ownerState?.anchored ? ownerState?.expandedWidth :
|
|
8
|
+
const width = ownerState?.anchored ? ownerState?.expandedWidth : theme.vars.size.baseSpacings.sp4;
|
|
9
9
|
return {
|
|
10
10
|
height: "100%",
|
|
11
11
|
position: "relative",
|
|
@@ -17,14 +17,42 @@ const sideBarDesktopStyles = {
|
|
|
17
17
|
/**
|
|
18
18
|
* Styles applied to the root element of the `SideBar` component in desktop mode.
|
|
19
19
|
*/
|
|
20
|
-
containerDesktopRoot: ({ theme }) => ({
|
|
20
|
+
containerDesktopRoot: ({ ownerState, theme }) => ({
|
|
21
21
|
height: "100%",
|
|
22
|
-
width: "
|
|
22
|
+
width: "fit-content",
|
|
23
23
|
overflow: "visible",
|
|
24
|
-
borderRight: `1px solid ${theme.vars.palette.border.
|
|
24
|
+
borderRight: `1px solid ${theme.vars.palette.border.default}`,
|
|
25
|
+
position: !ownerState?.anchored ? "absolute" : "relative",
|
|
25
26
|
inset: 0,
|
|
26
27
|
//add hover effect
|
|
27
28
|
zIndex: 999
|
|
29
|
+
}),
|
|
30
|
+
/**
|
|
31
|
+
* Container button to achores the sidebar.
|
|
32
|
+
*/
|
|
33
|
+
containerBtnAnchored: ({ theme, ownerState }) => ({
|
|
34
|
+
position: "absolute",
|
|
35
|
+
right: "-20px",
|
|
36
|
+
top: "20px",
|
|
37
|
+
zIndex: 1e3,
|
|
38
|
+
padding: `${theme.vars.size.baseSpacings.sp10} 10px`,
|
|
39
|
+
"& .MuiButtonBase-root": {
|
|
40
|
+
...!ownerState?.anchored && {
|
|
41
|
+
"&:before": {
|
|
42
|
+
content: '""',
|
|
43
|
+
position: "absolute",
|
|
44
|
+
inset: 0,
|
|
45
|
+
backgroundColor: theme.vars.palette.background.default,
|
|
46
|
+
zIndex: -1
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"&&& .M4LIconButton-root:hover": {
|
|
51
|
+
backgroundColor: theme.vars.palette.primary.enabled,
|
|
52
|
+
"& .M4LIcon-icon": {
|
|
53
|
+
backgroundColor: `${theme.vars.palette.primary.contrastText}!important`
|
|
54
|
+
}
|
|
55
|
+
}
|
|
28
56
|
})
|
|
29
57
|
};
|
|
30
58
|
export {
|
|
@@ -4,7 +4,7 @@ import { u as useSideBar } from "../../hooks/useSideBar/index.js";
|
|
|
4
4
|
import { T as TEST_PROP_ID } from "../../../../test/constants_no_mock.js";
|
|
5
5
|
import { g as getNameDataTestId } from "../../tests/utils.js";
|
|
6
6
|
import { D as Drawer } from "./subcomponents/Drawer.js";
|
|
7
|
-
import {
|
|
7
|
+
import { g as ContainerSideBarMobileStyled } from "../../slots/SideBarSlots.js";
|
|
8
8
|
import { C as ContentComponent } from "../ContentComponent/index.js";
|
|
9
9
|
const SideBarMobile = () => {
|
|
10
10
|
const {
|
|
@@ -3,19 +3,18 @@ import { useModuleDictionary, useModuleSkeleton } from "@m4l/core";
|
|
|
3
3
|
import { u as useSideBar } from "../../hooks/useSideBar/index.js";
|
|
4
4
|
import { T as TEST_PROP_ID } from "../../../../test/constants_no_mock.js";
|
|
5
5
|
import { g as getNameDataTestId } from "../../tests/utils.js";
|
|
6
|
-
import {
|
|
6
|
+
import { h as ContainerTreeGroupItemsStyled, i as ContainerContentGroupsStyled, j as ContainerContentTitleStyled } from "../../slots/SideBarSlots.js";
|
|
7
7
|
import { N as NodeMenuItemMain } from "./subcomponents/NodeMenuItemMain/NodeMenuItemMain.js";
|
|
8
8
|
import { u as useComponentSize } from "../../../../hooks/useComponentSize/useComponentSize.js";
|
|
9
9
|
import { M as MenuItem } from "../../../mui_extended/MenuItem/MenuItem.js";
|
|
10
10
|
const TreeGroupItems = (contentGroupsProps) => {
|
|
11
|
-
const { menuData
|
|
11
|
+
const { menuData } = useSideBar();
|
|
12
12
|
const { getLabel } = useModuleDictionary();
|
|
13
13
|
const { size } = contentGroupsProps;
|
|
14
14
|
const { currentSize } = useComponentSize(size);
|
|
15
15
|
const isSkeleton = useModuleSkeleton();
|
|
16
16
|
const ownerState = {
|
|
17
|
-
noItems: menuData.length === 0
|
|
18
|
-
anchored
|
|
17
|
+
noItems: menuData.length === 0
|
|
19
18
|
};
|
|
20
19
|
const renderItemsDisabled = () => {
|
|
21
20
|
return /* @__PURE__ */ jsx(ContainerContentTitleStyled, { ownerState: { disabled: true }, children: /* @__PURE__ */ jsx(
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { g as getSizeStyles } from "../../../../utils/getSizeStyles/getSizeStyles.js";
|
|
2
1
|
const contentGroupStyles = {
|
|
3
2
|
/**
|
|
4
3
|
* Container for the group items in the sidebar
|
|
@@ -10,17 +9,9 @@ const contentGroupStyles = {
|
|
|
10
9
|
flex: 1,
|
|
11
10
|
flexDirection: "column",
|
|
12
11
|
overflowY: "auto",
|
|
12
|
+
padding: `${theme.vars.size.baseSpacings.sp3} 0px 0px 0px`,
|
|
13
13
|
alignItems: "center",
|
|
14
|
-
justifyContent: ownerState?.noItems ? "center" : "flex-start"
|
|
15
|
-
transition: "all 0.5s",
|
|
16
|
-
paddingTop: theme.vars.size.baseSpacings.sp3,
|
|
17
|
-
paddingLeft: theme.vars.size.baseSpacings.sp4,
|
|
18
|
-
paddingRight: theme.vars.size.baseSpacings.sp4,
|
|
19
|
-
gap: theme.vars.size.baseSpacings.sp4,
|
|
20
|
-
...!ownerState?.anchored && !theme.generalSettings.isMobile && {
|
|
21
|
-
transition: "all 0.5s",
|
|
22
|
-
visibility: "hidden"
|
|
23
|
-
}
|
|
14
|
+
justifyContent: ownerState?.noItems ? "center" : "flex-start"
|
|
24
15
|
}),
|
|
25
16
|
/**
|
|
26
17
|
* Wrapper for every principal item group in the sidebar
|
|
@@ -37,7 +28,6 @@ const contentGroupStyles = {
|
|
|
37
28
|
containerContentTitle: ({ theme, ownerState }) => ({
|
|
38
29
|
padding: `${theme.vars.size.baseSpacings.sp3} ${theme.vars.size.baseSpacings.sp4} ${theme.vars.size.baseSpacings.sp1}`,
|
|
39
30
|
color: theme.vars.palette.text.primary,
|
|
40
|
-
width: "100%",
|
|
41
31
|
textAlign: "left",
|
|
42
32
|
"& .MuiTypography-root": {
|
|
43
33
|
color: !ownerState?.disabled ? theme.vars.palette.text.primary : `${theme.vars.palette.text.primary} !important`
|
|
@@ -72,84 +62,6 @@ const contentGroupStyles = {
|
|
|
72
62
|
alignSelf: "center",
|
|
73
63
|
lineHeight: 0,
|
|
74
64
|
marginLeft: "auto"
|
|
75
|
-
}),
|
|
76
|
-
/**
|
|
77
|
-
* Styles applied to the container of the adornment icon in the header component
|
|
78
|
-
*/
|
|
79
|
-
containerAdornmentIcon: ({ theme, ownerState }) => ({
|
|
80
|
-
overflow: "hidden",
|
|
81
|
-
borderRadius: theme.vars.size.borderRadius["r1-5"],
|
|
82
|
-
display: "flex",
|
|
83
|
-
justifyContent: "center",
|
|
84
|
-
alignItems: "center",
|
|
85
|
-
position: "relative",
|
|
86
|
-
width: "fit-content",
|
|
87
|
-
height: "fit-content",
|
|
88
|
-
padding: "1px",
|
|
89
|
-
"& .M4LIcon-root": {
|
|
90
|
-
width: "fit-content",
|
|
91
|
-
height: "fit-content",
|
|
92
|
-
padding: theme.vars.size.baseSpacings["sp0-5"],
|
|
93
|
-
"& .M4LIcon-icon": {
|
|
94
|
-
...getSizeStyles(
|
|
95
|
-
theme,
|
|
96
|
-
ownerState?.size || "medium",
|
|
97
|
-
"case",
|
|
98
|
-
(sizeValue) => ({
|
|
99
|
-
width: `${sizeValue}!important`,
|
|
100
|
-
height: `${sizeValue}!important`,
|
|
101
|
-
minWidth: `${sizeValue}!important`,
|
|
102
|
-
minHeight: `${sizeValue}!important`
|
|
103
|
-
})
|
|
104
|
-
)
|
|
105
|
-
}
|
|
106
|
-
},
|
|
107
|
-
...ownerState?.variant !== "itemActive" && ownerState?.variant !== "normal" && {
|
|
108
|
-
"& .M4LIcon-icon": {
|
|
109
|
-
backgroundColor: `${theme.vars.palette.chips.persianGreen.contained.colorTone}!important`
|
|
110
|
-
}
|
|
111
|
-
},
|
|
112
|
-
...ownerState?.variant === "normal" && {
|
|
113
|
-
"& .M4LIcon-icon": {
|
|
114
|
-
backgroundColor: `${theme.vars.palette.text.secondary}!important`
|
|
115
|
-
}
|
|
116
|
-
},
|
|
117
|
-
...ownerState?.variant === "main" && {
|
|
118
|
-
backgroundColor: theme.vars.palette.chips.persianGreen.contained.backgroundColorTone
|
|
119
|
-
},
|
|
120
|
-
...ownerState?.variant === "root" && {
|
|
121
|
-
backgroundColor: theme.vars.palette.primary.enabled
|
|
122
|
-
},
|
|
123
|
-
...ownerState?.variant === "itemActive" && {
|
|
124
|
-
boxShadow: theme.vars.customShadows.primary2,
|
|
125
|
-
background: `linear-gradient(to bottom,
|
|
126
|
-
${theme.vars.palette.primary.opacityGradient1},
|
|
127
|
-
${theme.vars.palette.primary.opacityGradient2})`,
|
|
128
|
-
"& .M4LSideBar-backgroundAdornmentIcon": {
|
|
129
|
-
background: theme.vars.palette.background.default
|
|
130
|
-
},
|
|
131
|
-
"&::before": {
|
|
132
|
-
content: '""',
|
|
133
|
-
position: "absolute",
|
|
134
|
-
inset: "1.4px",
|
|
135
|
-
background: theme.vars.palette.primary.enabledOpacity,
|
|
136
|
-
borderRadius: "5px"
|
|
137
|
-
},
|
|
138
|
-
"& .M4LIcon-icon": {
|
|
139
|
-
backgroundColor: `${theme.vars.palette.primary.enabled}!important`
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
}),
|
|
143
|
-
/**
|
|
144
|
-
* Styles applied to the background of the adornment icon in the header component
|
|
145
|
-
*/
|
|
146
|
-
backgroundAdornmentIcon: () => ({
|
|
147
|
-
width: "100%",
|
|
148
|
-
height: "100%",
|
|
149
|
-
display: "flex",
|
|
150
|
-
justifyContent: "center",
|
|
151
|
-
alignItems: "center",
|
|
152
|
-
borderRadius: "5px"
|
|
153
65
|
})
|
|
154
66
|
};
|
|
155
67
|
export {
|
|
@@ -6,14 +6,13 @@ import { T as TEST_PROP_ID } from "../../../../../../test/constants_no_mock.js";
|
|
|
6
6
|
import { g as getNameDataTestId } from "../../../../tests/utils.js";
|
|
7
7
|
import { A as ArrowIcon } from "../ArrowIcon/index.js";
|
|
8
8
|
import { l as ContainerNodeMenuItemStyled } from "../../../../slots/SideBarSlots.js";
|
|
9
|
-
import {
|
|
9
|
+
import { c as CLASS_NAME_MENU_ACTIVE, d as CLASS_NAME_ITEM_IN_TREE_ACTIVE, e as CLASS_NAME_HAS_CHILDREN } from "../../../../constants.js";
|
|
10
10
|
import { useModuleSkeleton } from "@m4l/core";
|
|
11
|
-
import { A as AdornmentIcon } from "../AdormentIcon/AdormentIcon.js";
|
|
12
11
|
import { u as useCollapse } from "../../../../hooks/useCollapse/useCollapse.js";
|
|
13
12
|
import { u as useComponentSize } from "../../../../../../hooks/useComponentSize/useComponentSize.js";
|
|
14
13
|
import { M as MenuItem } from "../../../../../mui_extended/MenuItem/MenuItem.js";
|
|
15
14
|
function NodeMenuItem(props) {
|
|
16
|
-
const { item, size, defaultOpen = false, className, isLastSibling = false
|
|
15
|
+
const { item, size, defaultOpen = false, className, isLastSibling = false } = props;
|
|
17
16
|
const { urlIconPrefix, classes } = useSideBar();
|
|
18
17
|
const { isOpen, handlerClick, hasChildren } = useCollapse(item, defaultOpen);
|
|
19
18
|
const { currentSize } = useComponentSize(size);
|
|
@@ -41,12 +40,11 @@ function NodeMenuItem(props) {
|
|
|
41
40
|
CLASS_NAME_ITEM_STATE,
|
|
42
41
|
className,
|
|
43
42
|
item.children && item.children.length > 0 && CLASS_NAME_HAS_CHILDREN,
|
|
44
|
-
item.itemInTreeActive && CLASS_NAME_ITEM_IN_TREE_ACTIVE
|
|
45
|
-
!isOpen && CLASS_NAME_ITEM_CLOSED
|
|
43
|
+
item.itemInTreeActive && CLASS_NAME_ITEM_IN_TREE_ACTIVE
|
|
46
44
|
),
|
|
47
45
|
label: item.title,
|
|
48
46
|
selected: item.active,
|
|
49
|
-
startIcon:
|
|
47
|
+
startIcon: `${urlIconPrefix}${item.iconUrl}`,
|
|
50
48
|
endIcon: hasChildren ? /* @__PURE__ */ jsx(ArrowIcon, { openState: isOpen, active: item.active }) : null,
|
|
51
49
|
onClick: () => handlerClick(),
|
|
52
50
|
size: currentSize
|