@m4l/components 9.2.59 → 9.2.60-13062025.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/.storybook/decorators/WithAppearanceContext/WithAppearanceContext.d.ts +1 -1
- package/.storybook/decorators/WithWindowsToolsAndParmsMFContexts/WithWindowsToolsAndParmsMFContexts.d.ts +5 -0
- package/components/DataGrid/Datagrid.styles.js +4 -12
- package/components/DataGrid/contexts/DataGridContext/types.d.ts +4 -0
- package/components/DataGrid/subcomponents/Table/hooks/useSortColumnsRows.js +2 -0
- package/components/DynamicFilter/DynamicFilter.styles.js +87 -91
- package/components/DynamicFilter/slots/SlotsEnum.d.ts +0 -3
- package/components/DynamicFilter/slots/SlotsEnum.js +0 -3
- package/components/DynamicFilter/slots/dynamicFilterSlots.d.ts +0 -9
- package/components/DynamicFilter/slots/dynamicFilterSlots.js +3 -19
- package/components/DynamicFilter/store/DynamicFilterContext.js +5 -6
- package/components/DynamicFilter/subcomponents/FilterActions/FilterActions.js +1 -1
- package/components/DynamicFilter/subcomponents/FilterActions/useFilterActions.d.ts +1 -0
- package/components/DynamicFilter/subcomponents/FilterActions/useFilterActions.js +2 -1
- package/components/DynamicFilter/subcomponents/InputFilter/InputFilter.js +2 -0
- package/components/DynamicFilter/subcomponents/PopoverFilter/PopoverFilter.js +23 -18
- package/components/DynamicFilter/subcomponents/PopoverMenuFields/PopoverMenuFields.js +4 -1
- package/components/DynamicSort/DynamicSort.styles.js +86 -87
- package/components/DynamicSort/slots/DynamicSortSlots.d.ts +0 -9
- package/components/DynamicSort/slots/DynamicSortSlots.js +5 -21
- package/components/DynamicSort/slots/SlotsEnum.d.ts +1 -4
- package/components/DynamicSort/slots/SlotsEnum.js +1 -4
- package/components/DynamicSort/subcomponents/InputSort/InputSort.js +2 -0
- package/components/DynamicSort/subcomponents/PopoverSort/PopoverSort.js +21 -17
- package/components/DynamicSort/subcomponents/SortActions/SortActions.js +2 -2
- package/components/DynamicSort/subcomponents/SortActions/useSortActions.d.ts +2 -0
- package/components/DynamicSort/subcomponents/SortActions/useSortActions.js +2 -1
- package/components/NumberInput/hooks/useNumberInput/useNumberInput.js +2 -0
- package/components/PaperForm/styles.js +2 -1
- package/components/PropertyValue/PropertyValue.styles.js +2 -1
- package/components/SideBar/SideBar.js +4 -2
- package/components/SideBar/constants.d.ts +26 -2
- package/components/SideBar/constants.js +19 -7
- package/components/SideBar/context/sideBarContext/index.js +19 -5
- package/components/SideBar/context/sideBarContext/types.d.ts +22 -1
- package/components/SideBar/helpers/getMenuDataWithState/index.js +22 -8
- package/components/SideBar/hooks/useCollapse/index.d.ts +1 -0
- package/components/SideBar/hooks/useCollapse/useCollapse.d.ts +11 -0
- package/components/SideBar/hooks/useCollapse/useCollapse.js +23 -0
- package/components/SideBar/slots/SideBarEnum.d.ts +5 -5
- package/components/SideBar/slots/SideBarEnum.js +9 -11
- package/components/SideBar/slots/SideBarSlots.d.ts +9 -3
- package/components/SideBar/slots/SideBarSlots.js +36 -28
- package/components/SideBar/styles.js +2 -4
- package/components/SideBar/subcomponents/ContentComponent/index.js +39 -19
- package/components/SideBar/subcomponents/ContentComponent/style.js +166 -22
- package/components/SideBar/subcomponents/{FooterSidebar → Promotion}/index.d.ts +2 -2
- package/components/SideBar/subcomponents/{FooterSidebar → Promotion}/index.js +8 -15
- package/components/SideBar/subcomponents/{FooterSidebar → Promotion}/styles.js +2 -2
- package/components/SideBar/subcomponents/Promotion/types.d.ts +5 -0
- package/components/SideBar/subcomponents/SideBarDesktop/index.js +1 -1
- package/components/SideBar/subcomponents/SideBarDesktop/styles.js +10 -14
- package/components/SideBar/subcomponents/SideBarMobile/index.js +1 -1
- package/components/SideBar/subcomponents/TreeGroupItems/index.d.ts +5 -0
- package/components/SideBar/subcomponents/{ContentGroups → TreeGroupItems}/index.js +16 -18
- package/components/SideBar/subcomponents/{ContentGroups → TreeGroupItems}/styles.js +5 -7
- package/components/SideBar/subcomponents/{ContentGroups/subcomponents/ContainerMenuItemsMain → TreeGroupItems}/subcomponents/ArrowIcon/index.js +10 -7
- package/components/SideBar/subcomponents/{ContentGroups/subcomponents/ContainerMenuItemsMain → TreeGroupItems/subcomponents/NodeMenuItem}/index.d.ts +3 -3
- package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/NodeMenuItem/index.js +53 -0
- package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/NodeMenuItem/types.d.ts +8 -0
- package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/NodeMenuItemMain/NodeMenuItemMain.d.ts +5 -0
- package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/NodeMenuItemMain/NodeMenuItemMain.js +55 -0
- package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/NodeMenuItemMain/index.d.ts +1 -0
- package/components/SideBar/subcomponents/TreeGroupItems/types.d.ts +4 -0
- package/components/SideBar/types.d.ts +7 -3
- package/components/WindowBase/WindowBase.js +4 -1
- package/components/WindowBase/WindowBase.styles.js +48 -13
- package/components/WindowBase/contexts/WindowToolsMFContext/types.d.ts +10 -0
- package/components/WindowBase/hooks/useDynamicMFParameters/index.js +2 -2
- package/components/WindowBase/slots/WindowBaseEnum.d.ts +2 -1
- package/components/WindowBase/slots/WindowBaseEnum.js +1 -0
- package/components/WindowBase/slots/WindowBaseSlots.d.ts +3 -0
- package/components/WindowBase/slots/WindowBaseSlots.js +6 -1
- package/components/WindowBase/subcomponents/Header/HeaderWindowBase.js +5 -3
- package/components/WindowBase/subcomponents/Header/useButtonActions.js +4 -2
- package/components/WindowBase/subcomponents/MemoizedIconButton/MemoizedIconButton.d.ts +1 -1
- package/components/WindowBase/subcomponents/MemoizedIconButton/MemoizedIconButton.js +1 -1
- package/components/WindowBase/subcomponents/MemoizedIconButton/types.d.ts +5 -0
- package/components/WindowBase/types.d.ts +11 -0
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/Window.js +17 -0
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/hooks/useRightActions.js +1 -0
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/hooks/useWindow.d.ts +2 -0
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/hooks/useWindow.js +8 -5
- package/components/areas/contexts/AreasContext/store.js +18 -2
- package/components/areas/contexts/AreasContext/types.d.ts +2 -0
- package/components/areas/hooks/index.d.ts +0 -1
- package/components/areas/types.d.ts +4 -0
- package/components/extended/React-resizable-panels/SplitLayout.js +6 -3
- package/components/extended/React-resizable-panels/SplitLayout.styles.js +78 -36
- package/components/extended/React-resizable-panels/constants.d.ts +6 -0
- package/components/extended/React-resizable-panels/constants.js +5 -1
- package/components/extended/React-resizable-panels/slots/SplitLayoutEnum.d.ts +2 -1
- package/components/extended/React-resizable-panels/slots/SplitLayoutEnum.js +1 -0
- package/components/extended/React-resizable-panels/slots/SplitLayoutSlots.d.ts +3 -0
- package/components/extended/React-resizable-panels/slots/SplitLayoutSlots.js +7 -1
- package/components/hook-form/RHFAutocompleteAsync/reducer/RHFAutocompleteReducer.js +5 -0
- package/components/mui_extended/Accordion/styles.js +1 -0
- package/components/mui_extended/Divider/index.d.ts +1 -0
- package/components/mui_extended/Divider/index.js +1 -0
- package/components/mui_extended/TabContent/TabContent.styles.js +2 -2
- package/components/mui_extended/Typography/slots/typographySlots.d.ts +1 -1
- package/components/mui_extended/index.d.ts +1 -0
- package/components/popups/components/PopupsProvider/hooks/usePopups.js +2 -1
- package/hooks/useDynamicFilterAndSort/styles.js +1 -1
- package/index.js +67 -67
- package/package.json +19 -18
- package/storybook/components/DynamicFilter/DynamicFilter.stories.d.ts +27 -11
- package/storybook/components/DynamicSort/DynamicSort.stories.d.ts +26 -10
- package/storybook/components/SideBar/subcomponents/FooterPromotion/FooterPromotion.d.ts +4 -0
- package/storybook/components/SideBar/subcomponents/FooterPromotion/constants.d.ts +3 -0
- package/storybook/components/SideBar/subcomponents/FooterPromotion/index.d.ts +1 -0
- package/storybook/components/extended/mui/IconButton/IconButton.stories.d.ts +1 -0
- package/.storybook/decorators/WithWindowsToolsContext/WithContextWindowTools.d.ts +0 -5
- package/components/SideBar/subcomponents/ContentGroups/index.d.ts +0 -5
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/ContainerMenuItemsMain/index.js +0 -63
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/ContainerMenuItemsMain/styles.d.ts +0 -2
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/ContainerMenuItemsMain/styles.js +0 -47
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/ContainerMenuItemsMain/types.d.ts +0 -7
- package/components/SideBar/subcomponents/ContentGroups/types.d.ts +0 -4
- package/components/SideBar/subcomponents/FooterSidebar/types.d.ts +0 -5
- package/components/SideBar/subcomponents/HeaderSidebar/index.js +0 -25
- package/components/areas/hooks/useSetWindowsTitle/index.d.ts +0 -1
- package/components/areas/hooks/useSetWindowsTitle/useSetWindowsTitle.d.ts +0 -6
- package/components/areas/hooks/useSetWindowsTitle/useSetWindowsTitle.js +0 -31
- package/storybook/components/WindowBase/subcomponents/WithContextWindowToolsProvider.d.ts +0 -5
- package/storybook/components/commonActions/components/ActionFormCancel/WindowToolsMFProvider.d.ts +0 -5
- /package/components/{areas/hooks/useSetWindowsTitle → SideBar/hooks/useCollapse}/index.js +0 -0
- /package/components/SideBar/subcomponents/{FooterSidebar → Promotion}/styles.d.ts +0 -0
- /package/components/SideBar/subcomponents/{ContentGroups → TreeGroupItems}/styles.d.ts +0 -0
- /package/components/SideBar/subcomponents/{ContentGroups/subcomponents/ContainerMenuItemsMain → TreeGroupItems}/subcomponents/ArrowIcon/index.d.ts +0 -0
- /package/components/SideBar/subcomponents/{ContentGroups/subcomponents/ContainerMenuItemsMain → TreeGroupItems}/subcomponents/ArrowIcon/types.d.ts +0 -0
|
@@ -1,44 +1,188 @@
|
|
|
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
|
+
import { g as getTypographyStyles } from "../../../../utils/getTypographyStyles.js";
|
|
3
|
+
import { a as getHeightSizeStyles, g as getSizeStyles } from "../../../../utils/getSizeStyles/getSizeStyles.js";
|
|
1
4
|
const contentComponentStyles = {
|
|
2
5
|
/**
|
|
3
6
|
* Estilos del contenedor principal del sidebar
|
|
4
7
|
*/
|
|
5
8
|
contentComponentRoot: ({ theme }) => ({
|
|
6
9
|
position: "relative",
|
|
7
|
-
height: "100%",
|
|
8
|
-
width: "auto",
|
|
9
|
-
backgroundColor: theme.vars.palette.background.default,
|
|
10
10
|
display: "flex",
|
|
11
|
-
flexDirection: "column"
|
|
11
|
+
flexDirection: "column",
|
|
12
|
+
height: "100%",
|
|
13
|
+
width: "fit-content",
|
|
14
|
+
backgroundColor: theme.vars.palette.background.default
|
|
12
15
|
}),
|
|
13
16
|
/**
|
|
14
17
|
* Estilos del contenedor que oculta el contenido cuando se encuentra des anclado.
|
|
15
18
|
*/
|
|
16
|
-
contentComponentHide: ({ theme, ownerState }) =>
|
|
17
|
-
width:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
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
|
+
}
|
|
30
41
|
}
|
|
31
42
|
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
43
|
+
};
|
|
44
|
+
},
|
|
34
45
|
/**
|
|
35
46
|
* Contenedor que abraza el contenido del menu en primer lugar.
|
|
36
47
|
*/
|
|
37
|
-
|
|
48
|
+
containerTreeItemsAndPromotion: ({ theme, ownerState }) => ({
|
|
38
49
|
height: "100%",
|
|
39
50
|
width: ownerState?.expandedWidth,
|
|
51
|
+
flex: 1,
|
|
52
|
+
overflow: "hidden",
|
|
53
|
+
display: "flex",
|
|
54
|
+
flexDirection: "column",
|
|
55
|
+
paddingLeft: theme.vars.size.baseSpacings.sp4,
|
|
56
|
+
paddingRight: theme.vars.size.baseSpacings.sp4,
|
|
57
|
+
'& [class*="M4LMenuItem-root"], & [class*="M4LMenuItem-skeletonMenuItem"]': {
|
|
58
|
+
...getSizeStyles(
|
|
59
|
+
theme,
|
|
60
|
+
ownerState?.size || "medium",
|
|
61
|
+
"container",
|
|
62
|
+
(size) => ({
|
|
63
|
+
height: size,
|
|
64
|
+
minHeight: size,
|
|
65
|
+
maxHeight: size
|
|
66
|
+
})
|
|
67
|
+
)
|
|
68
|
+
},
|
|
69
|
+
"& .M4LMenuItem-root": {
|
|
70
|
+
border: "unset",
|
|
71
|
+
paddingLeft: theme.vars.size.baseSpacings.sp2,
|
|
72
|
+
paddingRight: theme.vars.size.baseSpacings.sp2,
|
|
73
|
+
"& .M4LTypography-root": {
|
|
74
|
+
paddingLeft: `${theme.vars.size.baseSpacings.sp2} !important`,
|
|
75
|
+
...getTypographyStyles(
|
|
76
|
+
theme.generalSettings.isMobile,
|
|
77
|
+
ownerState?.size || "medium",
|
|
78
|
+
"caption"
|
|
79
|
+
)
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}),
|
|
83
|
+
/**
|
|
84
|
+
* Contenedor que contiene grupo menu item desplegable.
|
|
85
|
+
*/
|
|
86
|
+
containerNodeMenuItem: ({ theme, ownerState }) => ({
|
|
87
|
+
marginLeft: theme.vars.size.baseSpacings.sp4,
|
|
40
88
|
display: "flex",
|
|
41
|
-
flexDirection: "column"
|
|
89
|
+
flexDirection: "column",
|
|
90
|
+
overflow: "hidden",
|
|
91
|
+
gap: theme.vars.size.baseSpacings.sp1,
|
|
92
|
+
...getHeightSizeStyles(
|
|
93
|
+
theme.generalSettings.isMobile,
|
|
94
|
+
ownerState?.size || "medium",
|
|
95
|
+
"container",
|
|
96
|
+
(height) => {
|
|
97
|
+
return {
|
|
98
|
+
height: "auto",
|
|
99
|
+
minHeight: height
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
),
|
|
103
|
+
[`&.${CLASS_NAME_IS_ROOT}`]: {
|
|
104
|
+
margin: "unset"
|
|
105
|
+
},
|
|
106
|
+
[`& > .M4LMenuItem-root:first-of-type:not(.${CLASS_NAME_MENU_ACTIVE}).${CLASS_NAME_ITEM_IN_TREE_ACTIVE}`]: {
|
|
107
|
+
borderColor: theme.vars.palette.divider,
|
|
108
|
+
"&::before": {
|
|
109
|
+
content: '""',
|
|
110
|
+
position: "absolute",
|
|
111
|
+
top: 0,
|
|
112
|
+
bottom: 0,
|
|
113
|
+
left: 0,
|
|
114
|
+
width: 2,
|
|
115
|
+
borderLeft: theme.vars.size.borderStroke.container,
|
|
116
|
+
borderColor: theme.vars.palette.border.default
|
|
117
|
+
},
|
|
118
|
+
[`&:not(.${CLASS_NAME_HAS_CHILDREN}):after`]: {
|
|
119
|
+
content: '""',
|
|
120
|
+
position: "absolute",
|
|
121
|
+
margin: "0",
|
|
122
|
+
left: 1,
|
|
123
|
+
width: 4,
|
|
124
|
+
height: 1,
|
|
125
|
+
borderTop: theme.vars.size.borderStroke.container,
|
|
126
|
+
borderColor: theme.vars.palette.border.default
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
[`&.M4LSidebar-containerNodeMenuItem > .M4LMenuItem-root[class*="${CLASS_NAME_ITEM_IN_TREE_ACTIVE}"] .M4LIconClass-root`]: {
|
|
130
|
+
background: theme.vars.palette.text.primary
|
|
131
|
+
},
|
|
132
|
+
[`& > .M4LMenuItem-root:not(.${CLASS_NAME_IS_ROOT}).${CLASS_NAME_MENU_ACTIVE}`]: {
|
|
133
|
+
"&::before": {
|
|
134
|
+
content: '""',
|
|
135
|
+
position: "absolute",
|
|
136
|
+
height: "50%",
|
|
137
|
+
top: 0,
|
|
138
|
+
bottom: 0,
|
|
139
|
+
left: 0,
|
|
140
|
+
width: 2,
|
|
141
|
+
borderLeft: theme.vars.size.borderStroke.container,
|
|
142
|
+
borderColor: theme.vars.palette.primary.enabled
|
|
143
|
+
},
|
|
144
|
+
"&:after": {
|
|
145
|
+
content: '""',
|
|
146
|
+
position: "absolute",
|
|
147
|
+
margin: "0",
|
|
148
|
+
left: 0,
|
|
149
|
+
width: theme.vars.size.baseSpacings.sp1,
|
|
150
|
+
height: 1,
|
|
151
|
+
borderTop: theme.vars.size.borderStroke.container,
|
|
152
|
+
borderColor: theme.vars.palette.primary.enabled
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
[`& > .M4LMenuItem-root.${CLASS_NAME_IS_ROOT}.${CLASS_NAME_MENU_ACTIVE}`]: {
|
|
156
|
+
backgroundColor: theme.vars.palette.primary.opacity
|
|
157
|
+
},
|
|
158
|
+
"& .MuiCollapse-wrapperInner": {
|
|
159
|
+
display: "flex",
|
|
160
|
+
flexDirection: "column",
|
|
161
|
+
paddingLeft: 0,
|
|
162
|
+
paddingBottom: theme.vars.size.baseSpacings.sp1,
|
|
163
|
+
paddingTop: 0,
|
|
164
|
+
paddingRight: theme.vars.size.baseSpacings.sp1
|
|
165
|
+
},
|
|
166
|
+
[`&.${CLASS_NAME_IS_ROOT}.${CLASS_NAME_MENU_ACTIVE}`]: {
|
|
167
|
+
backgroundColor: theme.vars.palette.background.base,
|
|
168
|
+
borderRadius: theme.vars.size.borderRadius["r1-5"]
|
|
169
|
+
}
|
|
170
|
+
}),
|
|
171
|
+
containerNodeMenuItemMain: {},
|
|
172
|
+
/**
|
|
173
|
+
* Estilos del menu item principal.
|
|
174
|
+
*/
|
|
175
|
+
menuItemMain: ({ theme, ownerState }) => ({
|
|
176
|
+
"& .M4LSideBar-containerArrowIconRoot": {
|
|
177
|
+
marginLeft: "unset"
|
|
178
|
+
},
|
|
179
|
+
"&&& .M4LTypography-root": {
|
|
180
|
+
...getTypographyStyles(
|
|
181
|
+
theme.generalSettings.isMobile,
|
|
182
|
+
ownerState?.size || "medium",
|
|
183
|
+
"bodyDens"
|
|
184
|
+
)
|
|
185
|
+
}
|
|
42
186
|
})
|
|
43
187
|
};
|
|
44
188
|
export {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { PromotionProps } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* Renderiza el footer del sidebar
|
|
4
4
|
* @param {CollapseButtonProps} props - Propiedades del componente
|
|
@@ -6,4 +6,4 @@ import { FooterSidebarProps } 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,32 +2,25 @@ 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
|
-
|
|
7
|
-
|
|
8
|
-
const { companyLogoNormalUrl } = useSideBar();
|
|
5
|
+
import { d as ContainerFooterStyled } from "../../slots/SideBarSlots.js";
|
|
6
|
+
function Promotion({ anchored }) {
|
|
7
|
+
const { promotion } = useSideBar();
|
|
9
8
|
const ownerState = {
|
|
10
9
|
anchored
|
|
11
10
|
};
|
|
11
|
+
if (!promotion) {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
12
14
|
return /* @__PURE__ */ jsx(
|
|
13
15
|
ContainerFooterStyled,
|
|
14
16
|
{
|
|
15
17
|
ownerState,
|
|
16
18
|
role: "footer",
|
|
17
19
|
...process.env.NODE_ENV !== "production" ? { [TEST_PROP_ID]: getNameDataTestId("footer") } : {},
|
|
18
|
-
children:
|
|
19
|
-
Image,
|
|
20
|
-
{
|
|
21
|
-
width: "auto",
|
|
22
|
-
height: "40px",
|
|
23
|
-
src: companyLogoNormalUrl || "",
|
|
24
|
-
alt: "logo"
|
|
25
|
-
},
|
|
26
|
-
"Logo"
|
|
27
|
-
)
|
|
20
|
+
children: promotion
|
|
28
21
|
}
|
|
29
22
|
);
|
|
30
23
|
}
|
|
31
24
|
export {
|
|
32
|
-
|
|
25
|
+
Promotion as P
|
|
33
26
|
};
|
|
@@ -6,10 +6,10 @@ const footerSideBarStyles = {
|
|
|
6
6
|
height: "auto",
|
|
7
7
|
display: "grid",
|
|
8
8
|
placeItems: "center",
|
|
9
|
-
padding: `${theme.vars.size.baseSpacings.sp4} ${theme.vars.size.baseSpacings.sp12}`,
|
|
10
9
|
borderTop: `${theme.vars.size.baseSpacings["sp0-5"]} solid ${theme.vars.palette.border.secondary}`,
|
|
11
10
|
borderWidth: ownerState?.anchored ? theme.vars.size.baseSpacings["sp0-5"] : theme.vars.size.baseSpacings.sp0,
|
|
12
|
-
transition: "all 0.5s"
|
|
11
|
+
transition: "all 0.5s",
|
|
12
|
+
paddingBottom: theme.vars.size.baseSpacings.sp2
|
|
13
13
|
})
|
|
14
14
|
};
|
|
15
15
|
export {
|
|
@@ -1,7 +1,7 @@
|
|
|
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";
|
|
@@ -30,14 +30,22 @@ const sideBarDesktopStyles = {
|
|
|
30
30
|
/**
|
|
31
31
|
* Container button to achores the sidebar.
|
|
32
32
|
*/
|
|
33
|
-
containerBtnAnchored: ({ theme }) => ({
|
|
33
|
+
containerBtnAnchored: ({ theme, ownerState }) => ({
|
|
34
34
|
position: "absolute",
|
|
35
35
|
right: "-20px",
|
|
36
36
|
top: "20px",
|
|
37
37
|
zIndex: 1e3,
|
|
38
38
|
padding: `${theme.vars.size.baseSpacings.sp10} 10px`,
|
|
39
39
|
"& .MuiButtonBase-root": {
|
|
40
|
-
|
|
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
|
+
}
|
|
41
49
|
},
|
|
42
50
|
"&&& .M4LIconButton-root:hover": {
|
|
43
51
|
backgroundColor: theme.vars.palette.primary.enabled,
|
|
@@ -45,18 +53,6 @@ const sideBarDesktopStyles = {
|
|
|
45
53
|
backgroundColor: `${theme.vars.palette.primary.contrastText}!important`
|
|
46
54
|
}
|
|
47
55
|
}
|
|
48
|
-
// '&:hover': {
|
|
49
|
-
// '& .MuiButtonBase-root': {
|
|
50
|
-
// border: `1px solid ${theme.palette.border.default}`,
|
|
51
|
-
// background: theme.vars.palette.primary.enabled,
|
|
52
|
-
// '& [class*="M4LIcon-root"] > div':{
|
|
53
|
-
// backgroundColor: theme.vars.palette.background.default,
|
|
54
|
-
// },
|
|
55
|
-
// },
|
|
56
|
-
// '& .MuiButtonBase-root:active': {
|
|
57
|
-
// background: theme.vars.palette.primary.active,
|
|
58
|
-
// },
|
|
59
|
-
// },
|
|
60
56
|
})
|
|
61
57
|
};
|
|
62
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 {
|
|
@@ -1,27 +1,21 @@
|
|
|
1
|
-
import { jsx
|
|
2
|
-
import { useModuleDictionary } from "@m4l/core";
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
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 {
|
|
7
|
-
import {
|
|
6
|
+
import { h as ContainerTreeGroupItemsStyled, i as ContainerContentGroupsStyled, j as ContainerContentTitleStyled } from "../../slots/SideBarSlots.js";
|
|
7
|
+
import { N as NodeMenuItemMain } from "./subcomponents/NodeMenuItemMain/NodeMenuItemMain.js";
|
|
8
8
|
import { u as useComponentSize } from "../../../../hooks/useComponentSize/useComponentSize.js";
|
|
9
|
-
import { T as Typography } from "../../../mui_extended/Typography/Typography.js";
|
|
10
9
|
import { M as MenuItem } from "../../../mui_extended/MenuItem/MenuItem.js";
|
|
11
|
-
const
|
|
10
|
+
const TreeGroupItems = (contentGroupsProps) => {
|
|
12
11
|
const { menuData } = useSideBar();
|
|
13
12
|
const { getLabel } = useModuleDictionary();
|
|
14
13
|
const { size } = contentGroupsProps;
|
|
15
14
|
const { currentSize } = useComponentSize(size);
|
|
15
|
+
const isSkeleton = useModuleSkeleton();
|
|
16
16
|
const ownerState = {
|
|
17
17
|
noItems: menuData.length === 0
|
|
18
18
|
};
|
|
19
|
-
const renderTitle = (title) => {
|
|
20
|
-
return /* @__PURE__ */ jsx(ContainerContentTitleStyled, { children: /* @__PURE__ */ jsx(Typography, { variant: "bodyDens", skeletonWidth: "100px", children: title }) });
|
|
21
|
-
};
|
|
22
|
-
const renderItems = (item) => {
|
|
23
|
-
return /* @__PURE__ */ jsx(ContainerContentNavItemsStyled, { children: item?.map((list) => /* @__PURE__ */ jsx(ContainerMenuItemsMain, { item: list, openSubItem: true, size: currentSize }, list.title)) });
|
|
24
|
-
};
|
|
25
19
|
const renderItemsDisabled = () => {
|
|
26
20
|
return /* @__PURE__ */ jsx(ContainerContentTitleStyled, { ownerState: { disabled: true }, children: /* @__PURE__ */ jsx(
|
|
27
21
|
MenuItem,
|
|
@@ -32,21 +26,25 @@ const ContentGroups = (contentGroupsProps) => {
|
|
|
32
26
|
) });
|
|
33
27
|
};
|
|
34
28
|
return /* @__PURE__ */ jsx(
|
|
35
|
-
|
|
29
|
+
ContainerTreeGroupItemsStyled,
|
|
36
30
|
{
|
|
37
31
|
ownerState,
|
|
38
32
|
role: "bodysidebar",
|
|
39
33
|
...process.env.NODE_ENV !== "production" ? { [TEST_PROP_ID]: getNameDataTestId("content-groups") } : {},
|
|
40
34
|
children: menuData.length > 0 ? menuData.map((itemGroup) => (
|
|
41
35
|
/* Render title section in menusidebar */
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
36
|
+
/* @__PURE__ */ jsx(ContainerContentGroupsStyled, { children: /* @__PURE__ */ jsx(
|
|
37
|
+
NodeMenuItemMain,
|
|
38
|
+
{
|
|
39
|
+
item: itemGroup,
|
|
40
|
+
size: currentSize,
|
|
41
|
+
defaultOpen: isSkeleton ? false : true
|
|
42
|
+
}
|
|
43
|
+
) }, itemGroup.title)
|
|
46
44
|
)) : renderItemsDisabled()
|
|
47
45
|
}
|
|
48
46
|
);
|
|
49
47
|
};
|
|
50
48
|
export {
|
|
51
|
-
|
|
49
|
+
TreeGroupItems as T
|
|
52
50
|
};
|
|
@@ -2,10 +2,11 @@ const contentGroupStyles = {
|
|
|
2
2
|
/**
|
|
3
3
|
* Container for the group items in the sidebar
|
|
4
4
|
*/
|
|
5
|
-
|
|
5
|
+
containerTreeGroupItems: ({ theme, ownerState }) => ({
|
|
6
6
|
display: "flex",
|
|
7
7
|
width: "100%",
|
|
8
8
|
height: "100%",
|
|
9
|
+
flex: 1,
|
|
9
10
|
flexDirection: "column",
|
|
10
11
|
overflowY: "auto",
|
|
11
12
|
padding: `${theme.vars.size.baseSpacings.sp3} 0px 0px 0px`,
|
|
@@ -15,14 +16,11 @@ const contentGroupStyles = {
|
|
|
15
16
|
/**
|
|
16
17
|
* Wrapper for every principal item group in the sidebar
|
|
17
18
|
*/
|
|
18
|
-
containerContentGroups: (
|
|
19
|
+
containerContentGroups: () => ({
|
|
19
20
|
display: "flex",
|
|
20
21
|
width: "100%",
|
|
21
|
-
height: "
|
|
22
|
-
flexDirection: "column"
|
|
23
|
-
padding: `${theme.vars.size.baseSpacings.sp3} 0px`,
|
|
24
|
-
flex: 1,
|
|
25
|
-
overflow: "auto"
|
|
22
|
+
height: "auto",
|
|
23
|
+
flexDirection: "column"
|
|
26
24
|
}),
|
|
27
25
|
/**
|
|
28
26
|
* Title wrapper for every principal item group in the sidebar
|
|
@@ -1,23 +1,26 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useEnvironment } from "@m4l/core";
|
|
3
|
-
import { T as TEST_PROP_ID } from "
|
|
4
|
-
import { g as getNameDataTestId } from "
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
3
|
+
import { T as TEST_PROP_ID } from "../../../../../../test/constants_no_mock.js";
|
|
4
|
+
import { g as getNameDataTestId } from "../../../../tests/utils.js";
|
|
5
|
+
import { f as PATH_ARROW_DOWN_ICON } from "../../../../constants.js";
|
|
6
|
+
import { k as ContainerArrowIconRootStyled } from "../../../../slots/SideBarSlots.js";
|
|
7
|
+
import { u as useSideBar } from "../../../../hooks/useSideBar/index.js";
|
|
8
|
+
import { I as Icon } from "../../../../../Icon/Icon.js";
|
|
8
9
|
function ArrowIcon(props) {
|
|
9
10
|
const { openState, active } = props;
|
|
10
11
|
const { host_static_assets, environment_assets } = useEnvironment();
|
|
12
|
+
const { classes } = useSideBar();
|
|
11
13
|
return /* @__PURE__ */ jsx(
|
|
12
14
|
ContainerArrowIconRootStyled,
|
|
13
15
|
{
|
|
16
|
+
className: classes.containerArrowIconRoot,
|
|
14
17
|
...process.env.NODE_ENV !== "production" ? { [TEST_PROP_ID]: getNameDataTestId("arrowIconRoot") } : {},
|
|
15
18
|
children: /* @__PURE__ */ jsx(
|
|
16
|
-
|
|
19
|
+
Icon,
|
|
17
20
|
{
|
|
18
21
|
src: `${host_static_assets}/${environment_assets}/${PATH_ARROW_DOWN_ICON}`,
|
|
19
22
|
rotationAngle: openState ? 270 : 90,
|
|
20
|
-
color: active ? "primary" : "
|
|
23
|
+
color: active ? "primary.enabled" : "text.primary"
|
|
21
24
|
}
|
|
22
25
|
)
|
|
23
26
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NodeMenuItemProps } from './types';
|
|
2
2
|
/**
|
|
3
3
|
* MenuItems component renderiza los items del menu con sus respectivos hijos y estados
|
|
4
|
-
* @param {
|
|
4
|
+
* @param {NodeMenuItemProps} props - Propiedades del componente
|
|
5
5
|
* @param {MenuDataType} props.item - Datos del item del menu
|
|
6
6
|
* @param {boolean} props.openSubItem - Estado del item del menu: Abierto - cerrado
|
|
7
7
|
*/
|
|
8
|
-
export declare function
|
|
8
|
+
export declare function NodeMenuItem(props: NodeMenuItemProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Collapse } from "@mui/material";
|
|
3
|
+
import clsx from "clsx";
|
|
4
|
+
import { u as useSideBar } from "../../../../hooks/useSideBar/index.js";
|
|
5
|
+
import { T as TEST_PROP_ID } from "../../../../../../test/constants_no_mock.js";
|
|
6
|
+
import { g as getNameDataTestId } from "../../../../tests/utils.js";
|
|
7
|
+
import { A as ArrowIcon } from "../ArrowIcon/index.js";
|
|
8
|
+
import { l as ContainerNodeMenuItemStyled } from "../../../../slots/SideBarSlots.js";
|
|
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
|
+
import { useModuleSkeleton } from "@m4l/core";
|
|
11
|
+
import { u as useCollapse } from "../../../../hooks/useCollapse/useCollapse.js";
|
|
12
|
+
import { u as useComponentSize } from "../../../../../../hooks/useComponentSize/useComponentSize.js";
|
|
13
|
+
import { M as MenuItem } from "../../../../../mui_extended/MenuItem/MenuItem.js";
|
|
14
|
+
function NodeMenuItem(props) {
|
|
15
|
+
const { item, size, defaultOpen = false, className } = props;
|
|
16
|
+
const { urlIconPrefix, classes } = useSideBar();
|
|
17
|
+
const { isOpen, handlerClick, hasChildren } = useCollapse(item, defaultOpen);
|
|
18
|
+
const { currentSize } = useComponentSize(size);
|
|
19
|
+
const isSkeleton = useModuleSkeleton();
|
|
20
|
+
const ownerState = {
|
|
21
|
+
active: item.active,
|
|
22
|
+
itemInTreeActive: item.itemInTreeActive,
|
|
23
|
+
sidebarSize: currentSize
|
|
24
|
+
};
|
|
25
|
+
const CLASS_NAME_ITEM_STATE = clsx(item.active && CLASS_NAME_MENU_ACTIVE, item.itemInTreeActive && CLASS_NAME_ITEM_IN_TREE_ACTIVE);
|
|
26
|
+
return /* @__PURE__ */ jsxs(
|
|
27
|
+
ContainerNodeMenuItemStyled,
|
|
28
|
+
{
|
|
29
|
+
className: clsx(classes.containerNodeMenuItem, CLASS_NAME_ITEM_STATE, className),
|
|
30
|
+
role: "listitem",
|
|
31
|
+
ownerState,
|
|
32
|
+
...process.env.NODE_ENV !== "production" ? { [TEST_PROP_ID]: getNameDataTestId("menuItems") } : {},
|
|
33
|
+
children: [
|
|
34
|
+
/* @__PURE__ */ jsx(
|
|
35
|
+
MenuItem,
|
|
36
|
+
{
|
|
37
|
+
className: clsx(CLASS_NAME_ITEM_STATE, className, item.children && item.children.length > 0 && CLASS_NAME_HAS_CHILDREN),
|
|
38
|
+
label: item.title,
|
|
39
|
+
selected: item.active,
|
|
40
|
+
startIcon: `${urlIconPrefix}${item.iconUrl}`,
|
|
41
|
+
endIcon: hasChildren ? /* @__PURE__ */ jsx(ArrowIcon, { openState: isOpen, active: item.active }) : null,
|
|
42
|
+
onClick: () => handlerClick(),
|
|
43
|
+
size: currentSize
|
|
44
|
+
}
|
|
45
|
+
),
|
|
46
|
+
hasChildren ? /* @__PURE__ */ jsx(Collapse, { in: isOpen, timeout: "auto", unmountOnExit: true, children: (item.children || []).map((child) => /* @__PURE__ */ jsx(NodeMenuItem, { item: child, size: currentSize, defaultOpen: isSkeleton ? false : child.active }, child.title)) }) : null
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
export {
|
|
52
|
+
NodeMenuItem as N
|
|
53
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { m as ContainerNodeMenuItemMainStyled, M as MenuItemMainStyled } from "../../../../slots/SideBarSlots.js";
|
|
3
|
+
import { g as getNameDataTestId } from "../../../../tests/utils.js";
|
|
4
|
+
import { T as TEST_PROP_ID } from "../../../../../../test/constants_no_mock.js";
|
|
5
|
+
import { A as ArrowIcon } from "../ArrowIcon/index.js";
|
|
6
|
+
import { Collapse } from "@mui/material";
|
|
7
|
+
import { N as NodeMenuItem } from "../NodeMenuItem/index.js";
|
|
8
|
+
import { b as CLASS_NAME_IS_ROOT } from "../../../../constants.js";
|
|
9
|
+
import clsx from "clsx";
|
|
10
|
+
import { useModuleSkeleton } from "@m4l/core";
|
|
11
|
+
import { u as useComponentSize } from "../../../../../../hooks/useComponentSize/useComponentSize.js";
|
|
12
|
+
import { u as useCollapse } from "../../../../hooks/useCollapse/useCollapse.js";
|
|
13
|
+
const NodeMenuItemMain = (props) => {
|
|
14
|
+
const { item, size, defaultOpen = false } = props;
|
|
15
|
+
const { currentSize } = useComponentSize(size);
|
|
16
|
+
const { isOpen, handlerClick, hasChildren } = useCollapse(item, defaultOpen);
|
|
17
|
+
const isSkeleton = useModuleSkeleton();
|
|
18
|
+
const ownerState = {
|
|
19
|
+
active: item.active,
|
|
20
|
+
itemInTreeActive: item.itemInTreeActive,
|
|
21
|
+
sidebarSize: currentSize
|
|
22
|
+
};
|
|
23
|
+
return /* @__PURE__ */ jsxs(
|
|
24
|
+
ContainerNodeMenuItemMainStyled,
|
|
25
|
+
{
|
|
26
|
+
role: "treeitem",
|
|
27
|
+
ownerState,
|
|
28
|
+
...process.env.NODE_ENV !== "production" ? { [TEST_PROP_ID]: getNameDataTestId("menuItems") } : {},
|
|
29
|
+
children: [
|
|
30
|
+
/* @__PURE__ */ jsx(
|
|
31
|
+
MenuItemMainStyled,
|
|
32
|
+
{
|
|
33
|
+
label: item.title,
|
|
34
|
+
startIcon: hasChildren ? /* @__PURE__ */ jsx(ArrowIcon, { openState: isOpen, active: item.active }) : null,
|
|
35
|
+
onClick: () => handlerClick(),
|
|
36
|
+
size: currentSize
|
|
37
|
+
}
|
|
38
|
+
),
|
|
39
|
+
/* @__PURE__ */ jsx(Collapse, { in: isOpen, timeout: "auto", unmountOnExit: true, children: (item.children || []).map((child) => /* @__PURE__ */ jsx(
|
|
40
|
+
NodeMenuItem,
|
|
41
|
+
{
|
|
42
|
+
item: child,
|
|
43
|
+
size: currentSize,
|
|
44
|
+
className: clsx(CLASS_NAME_IS_ROOT),
|
|
45
|
+
defaultOpen: isSkeleton ? false : true
|
|
46
|
+
},
|
|
47
|
+
child.title
|
|
48
|
+
)) })
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
export {
|
|
54
|
+
NodeMenuItemMain as N
|
|
55
|
+
};
|
package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/NodeMenuItemMain/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { NodeMenuItemMain } from './NodeMenuItemMain';
|