@m4l/components 9.2.62-B10072025beta.1 → 9.2.62-B10072025beta.2
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/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 -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/commercial/HamburgerMenu/HamburgerMenu.js +2 -1
- package/components/hook-form/RHFColorPicker/RHFColorPicker.styles.js +2 -1
- package/components/hook-form/RHFDateTime/RHFDateTime.styles.js +2 -1
- package/components/hook-form/RHFNumberInput/RHFNumberInput.styles.js +2 -1
- package/components/hook-form/RHFPeriod/RHFPeriod.styles.js +2 -5
- package/components/hook-form/RHFPeriod/slots/RHFPeriodEnum.d.ts +1 -1
- package/components/hook-form/RHFPeriod/slots/RHFPeriodEnum.js +1 -1
- package/components/hook-form/RHFPeriod/slots/RHFPeriodSlots.d.ts +1 -1
- package/components/hook-form/RHFPeriod/slots/RHFPeriodSlots.js +6 -6
- package/components/hook-form/RHFPeriod/subcomponents/Period/Period.js +8 -7
- package/components/hook-form/RHFPeriod/subcomponents/Period/dictionary.js +4 -5
- package/components/hook-form/RHFPeriod/subcomponents/Period/types.d.ts +2 -2
- package/components/hook-form/RHFSelect/RHFSelect.styles.js +2 -1
- 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/index.js +8 -8
- package/package.json +3 -3
- 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/components/hook-form/RHFDateTime/styles.d.ts +0 -1
- 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
|
@@ -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(
|
|
@@ -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 right,
|
|
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
|
|
@@ -5,16 +5,13 @@ import { T as TEST_PROP_ID } from "../../../../../../test/constants_no_mock.js";
|
|
|
5
5
|
import { A as ArrowIcon } from "../ArrowIcon/index.js";
|
|
6
6
|
import { Collapse } from "@mui/material";
|
|
7
7
|
import { N as NodeMenuItem } from "../NodeMenuItem/index.js";
|
|
8
|
-
import {
|
|
8
|
+
import { b as CLASS_NAME_IS_ROOT } from "../../../../constants.js";
|
|
9
9
|
import clsx from "clsx";
|
|
10
10
|
import { useModuleSkeleton } from "@m4l/core";
|
|
11
|
-
import { u as useSideBar } from "../../../../hooks/useSideBar/index.js";
|
|
12
|
-
import { A as AdornmentIcon } from "../AdormentIcon/AdormentIcon.js";
|
|
13
11
|
import { u as useComponentSize } from "../../../../../../hooks/useComponentSize/useComponentSize.js";
|
|
14
12
|
import { u as useCollapse } from "../../../../hooks/useCollapse/useCollapse.js";
|
|
15
13
|
const NodeMenuItemMain = (props) => {
|
|
16
14
|
const { item, size, defaultOpen = false } = props;
|
|
17
|
-
const { urlIconPrefix } = useSideBar();
|
|
18
15
|
const { currentSize } = useComponentSize(size);
|
|
19
16
|
const { isOpen, handlerClick, hasChildren } = useCollapse(item, defaultOpen);
|
|
20
17
|
const isSkeleton = useModuleSkeleton();
|
|
@@ -34,8 +31,7 @@ const NodeMenuItemMain = (props) => {
|
|
|
34
31
|
MenuItemMainStyled,
|
|
35
32
|
{
|
|
36
33
|
label: item.title,
|
|
37
|
-
startIcon: /* @__PURE__ */ jsx(
|
|
38
|
-
endIcon: hasChildren ? /* @__PURE__ */ jsx(ArrowIcon, { openState: isOpen, active: item.active }) : null,
|
|
34
|
+
startIcon: hasChildren ? /* @__PURE__ */ jsx(ArrowIcon, { openState: isOpen, active: item.active }) : null,
|
|
39
35
|
onClick: () => handlerClick(),
|
|
40
36
|
size: currentSize
|
|
41
37
|
}
|
|
@@ -47,8 +43,7 @@ const NodeMenuItemMain = (props) => {
|
|
|
47
43
|
size: currentSize,
|
|
48
44
|
className: clsx(CLASS_NAME_IS_ROOT),
|
|
49
45
|
defaultOpen: isSkeleton ? false : true,
|
|
50
|
-
isLastSibling: item.children?.length === index + 1
|
|
51
|
-
isRoot: true
|
|
46
|
+
isLastSibling: item.children?.length === index + 1
|
|
52
47
|
},
|
|
53
48
|
child.title
|
|
54
49
|
)) })
|
|
@@ -51,6 +51,10 @@ export interface SideBarProps {
|
|
|
51
51
|
* Slogan de la empresa
|
|
52
52
|
*/
|
|
53
53
|
companySlogan?: string;
|
|
54
|
+
/**
|
|
55
|
+
* Indica la variación de estilo del componente
|
|
56
|
+
*/
|
|
57
|
+
variantStyle?: 'variantDefault' | 'variantComercial';
|
|
54
58
|
moduleSelectedId?: string | undefined;
|
|
55
59
|
onMenuItemClick: (item: MenuDataType) => void;
|
|
56
60
|
/**
|
|
@@ -70,19 +74,10 @@ export interface SideBarProps {
|
|
|
70
74
|
*/
|
|
71
75
|
urlIconPrefix?: string;
|
|
72
76
|
/**
|
|
73
|
-
*
|
|
74
|
-
*/
|
|
75
|
-
variant?: SidebarVariants;
|
|
76
|
-
/**
|
|
77
|
-
* Componente que se renderiza en el encabezado del sidebar
|
|
78
|
-
*/
|
|
79
|
-
headerComponent?: ReactElement;
|
|
80
|
-
/**
|
|
81
|
-
* Componente que se renderiza en el pie de página del sidebar
|
|
77
|
+
* Promoción del sidebar, se renderiza en el footer del sidebar
|
|
82
78
|
*/
|
|
83
|
-
|
|
79
|
+
promotion?: ReactElement;
|
|
84
80
|
}
|
|
85
|
-
export type SidebarVariants = 'host' | 'microfrontend';
|
|
86
81
|
/**
|
|
87
82
|
* Interface que representa el estado de un elemento de menú en la barra lateral.
|
|
88
83
|
*/
|
|
@@ -101,7 +96,7 @@ export type SideBarOwnerState = Pick<IMenuDataWithState, 'active' | 'itemInTreeA
|
|
|
101
96
|
export type SideBarStyles = M4LOverridesStyleRules<SideBarSlotsType, typeof SIDEBAR_KEY_COMPONENT, Theme>;
|
|
102
97
|
export type SideBarDesktopStyles = M4LOverridesStyleRules<SideBarDesktopSlots, typeof SIDEBAR_KEY_COMPONENT, Theme>;
|
|
103
98
|
export type ContentGroupsStyles = M4LOverridesStyleRules<ContentGroupsSlots, typeof SIDEBAR_KEY_COMPONENT, Theme>;
|
|
104
|
-
export type
|
|
99
|
+
export type HeaderSidebarStyles = M4LOverridesStyleRules<HeaderSidebarSlots, typeof SIDEBAR_KEY_COMPONENT, Theme>;
|
|
105
100
|
export type SideBarFooterStyles = M4LOverridesStyleRules<SideBarFooterSlots, typeof SIDEBAR_KEY_COMPONENT, Theme>;
|
|
106
101
|
export type SideBarMobileStyles = M4LOverridesStyleRules<SideBarMobileSlots, typeof SIDEBAR_KEY_COMPONENT, Theme>;
|
|
107
102
|
export type ContentComponentStyles = M4LOverridesStyleRules<ContentComponentSlots, typeof SIDEBAR_KEY_COMPONENT, Theme>;
|
|
@@ -23,11 +23,8 @@ const rhfPeriodStyles = {
|
|
|
23
23
|
/**
|
|
24
24
|
* textField class
|
|
25
25
|
*/
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
width: "43px !important",
|
|
29
|
-
border: theme.vars.palette.border.default,
|
|
30
|
-
color: theme.vars.palette.text.disabled
|
|
26
|
+
numberInput: () => ({
|
|
27
|
+
width: "43px !important"
|
|
31
28
|
}),
|
|
32
29
|
/**
|
|
33
30
|
* select class
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var RHFPeriodSlots = /* @__PURE__ */ ((RHFPeriodSlots2) => {
|
|
2
2
|
RHFPeriodSlots2["root"] = "root";
|
|
3
3
|
RHFPeriodSlots2["periodRoot"] = "periodRoot";
|
|
4
|
-
RHFPeriodSlots2["
|
|
4
|
+
RHFPeriodSlots2["numberInput"] = "numberInput";
|
|
5
5
|
RHFPeriodSlots2["select"] = "select";
|
|
6
6
|
return RHFPeriodSlots2;
|
|
7
7
|
})(RHFPeriodSlots || {});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const RHFPeriodRootStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
2
2
|
export declare const PeriodRootStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
|
|
3
|
-
export declare const
|
|
3
|
+
export declare const NumberInputStyled: import('@emotion/styled').StyledComponent<Pick<import('../../../NumberInput/types').NumberInputProps & import('react').RefAttributes<HTMLDivElement>, keyof import('react').RefAttributes<HTMLDivElement> | keyof import('../../../NumberInput/types').NumberInputProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, {}, {}>;
|
|
4
4
|
export declare const SelectStyled: import('@emotion/styled').StyledComponent<Pick<Omit<import('../../../mui_extended/Select').SelectProps<string | number, boolean | undefined>, "ref"> & import('react').RefAttributes<HTMLDivElement>, "value" | "size" | "children" | "onClose" | "title" | "name" | "error" | "input" | "options" | "rows" | "id" | "type" | "disabled" | "components" | "hidden" | "content" | "style" | "open" | "multiple" | "variant" | "margin" | "translate" | "className" | "classes" | "sx" | "slots" | "slotProps" | "label" | "slot" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "autoCapitalize" | "autoFocus" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "enterKeyHint" | "lang" | "nonce" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "prefix" | "property" | "rel" | "resource" | "rev" | "typeof" | "vocab" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "exportparts" | "part" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-braillelabel" | "aria-brailleroledescription" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-description" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerLeave" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "componentsProps" | "onOpen" | "dataTestId" | "autoComplete" | "placeholder" | "readOnly" | "required" | keyof import('react').RefAttributes<HTMLDivElement> | "maxRows" | "fullWidth" | "inputProps" | "inputRef" | "multiline" | "minRows" | "disableInjectingGlobalStyles" | "endAdornment" | "inputComponent" | "renderSuffix" | "startAdornment" | "disableUnderline" | "autoWidth" | "defaultOpen" | "displayEmpty" | "IconComponent" | "labelId" | "MenuProps" | "native" | "renderValue" | "SelectDisplayProps"> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown>, {}, {}>;
|
|
@@ -2,7 +2,7 @@ import { styled } from "@mui/material/styles";
|
|
|
2
2
|
import { R as RHF_PERIOD_KEY_COMPONENT } from "../constants.js";
|
|
3
3
|
import { r as rhfPeriodStyles } from "../RHFPeriod.styles.js";
|
|
4
4
|
import { R as RHFPeriodSlots } from "./RHFPeriodEnum.js";
|
|
5
|
-
import {
|
|
5
|
+
import { N as NumberInput } from "../../../NumberInput/NumberInput.js";
|
|
6
6
|
import { S as Select } from "../../../mui_extended/Select/Select.js";
|
|
7
7
|
const RHFPeriodRootStyled = styled("div", {
|
|
8
8
|
name: RHF_PERIOD_KEY_COMPONENT,
|
|
@@ -12,17 +12,17 @@ const PeriodRootStyled = styled("div", {
|
|
|
12
12
|
name: RHF_PERIOD_KEY_COMPONENT,
|
|
13
13
|
slot: RHFPeriodSlots.periodRoot
|
|
14
14
|
})(rhfPeriodStyles?.periodRoot);
|
|
15
|
-
const
|
|
15
|
+
const NumberInputStyled = styled(NumberInput, {
|
|
16
16
|
name: RHF_PERIOD_KEY_COMPONENT,
|
|
17
|
-
slot: RHFPeriodSlots.
|
|
18
|
-
})(rhfPeriodStyles?.
|
|
17
|
+
slot: RHFPeriodSlots.numberInput
|
|
18
|
+
})(rhfPeriodStyles?.numberInput);
|
|
19
19
|
const SelectStyled = styled(Select, {
|
|
20
20
|
name: RHF_PERIOD_KEY_COMPONENT,
|
|
21
21
|
slot: RHFPeriodSlots.select
|
|
22
22
|
})(rhfPeriodStyles?.select);
|
|
23
23
|
export {
|
|
24
|
+
NumberInputStyled as N,
|
|
24
25
|
PeriodRootStyled as P,
|
|
25
26
|
RHFPeriodRootStyled as R,
|
|
26
|
-
SelectStyled as S
|
|
27
|
-
TextFieldStyled as T
|
|
27
|
+
SelectStyled as S
|
|
28
28
|
};
|
|
@@ -4,7 +4,7 @@ import { E as ETimePeriods } from "./types.js";
|
|
|
4
4
|
import { d as dictionary } from "./dictionary.js";
|
|
5
5
|
import { useMemo } from "react";
|
|
6
6
|
import { u as useComponentSize } from "../../../../../hooks/useComponentSize/useComponentSize.js";
|
|
7
|
-
import { P as PeriodRootStyled, S as SelectStyled,
|
|
7
|
+
import { P as PeriodRootStyled, S as SelectStyled, N as NumberInputStyled } from "../../slots/RHFPeriodSlots.js";
|
|
8
8
|
import { I as Icon } from "../../../../Icon/Icon.js";
|
|
9
9
|
const Period = (props) => {
|
|
10
10
|
const {
|
|
@@ -27,7 +27,7 @@ const Period = (props) => {
|
|
|
27
27
|
);
|
|
28
28
|
const getSingleValue = (period) => {
|
|
29
29
|
if (!period) {
|
|
30
|
-
return
|
|
30
|
+
return null;
|
|
31
31
|
}
|
|
32
32
|
if (period.singleValue !== void 0) {
|
|
33
33
|
return period.singleValue;
|
|
@@ -41,7 +41,7 @@ const Period = (props) => {
|
|
|
41
41
|
if (period.days && period.days > 0) {
|
|
42
42
|
return period.days;
|
|
43
43
|
}
|
|
44
|
-
return
|
|
44
|
+
return null;
|
|
45
45
|
};
|
|
46
46
|
const getSelPeriodTime = (period) => {
|
|
47
47
|
if (!period) {
|
|
@@ -68,7 +68,7 @@ const Period = (props) => {
|
|
|
68
68
|
selPeriodTime: newPeriodTime,
|
|
69
69
|
singleValue: newValue
|
|
70
70
|
};
|
|
71
|
-
if (newValue
|
|
71
|
+
if (newValue && newValue > 0) {
|
|
72
72
|
newPeriod.years = 0;
|
|
73
73
|
newPeriod.months = 0;
|
|
74
74
|
newPeriod.days = 0;
|
|
@@ -117,13 +117,14 @@ const Period = (props) => {
|
|
|
117
117
|
}
|
|
118
118
|
),
|
|
119
119
|
/* @__PURE__ */ jsx(
|
|
120
|
-
|
|
120
|
+
NumberInputStyled,
|
|
121
121
|
{
|
|
122
122
|
type: "number",
|
|
123
123
|
variant: "outlined",
|
|
124
124
|
value: singleValue,
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
withDecimal: true,
|
|
126
|
+
onChange: (_event, newValue) => {
|
|
127
|
+
onTotalChange(selPeriodTime, newValue);
|
|
127
128
|
}
|
|
128
129
|
}
|
|
129
130
|
)
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { g as getCommonActionsDictionary } from "../../../../CommonActions/dictionary.js";
|
|
2
|
-
const DICTIONARY_KEY = "rhf_period";
|
|
3
2
|
const dictionary = {
|
|
4
|
-
LABEL_YEARS:
|
|
5
|
-
LABEL_MONTHS:
|
|
6
|
-
LABEL_DAYS:
|
|
3
|
+
LABEL_YEARS: "period.label_years",
|
|
4
|
+
LABEL_MONTHS: "period.label_months",
|
|
5
|
+
LABEL_DAYS: "period.label_days"
|
|
7
6
|
};
|
|
8
7
|
function getPeriodComponetsDictionary() {
|
|
9
|
-
return [
|
|
8
|
+
return ["period"].concat(getCommonActionsDictionary());
|
|
10
9
|
}
|
|
11
10
|
export {
|
|
12
11
|
dictionary as d,
|
|
@@ -9,8 +9,8 @@ export type PeriodTime = {
|
|
|
9
9
|
label: string;
|
|
10
10
|
};
|
|
11
11
|
export type PeriodType = {
|
|
12
|
-
selPeriodTime:
|
|
13
|
-
singleValue: number |
|
|
12
|
+
selPeriodTime: null | ETimePeriods | undefined;
|
|
13
|
+
singleValue: number | null;
|
|
14
14
|
years?: number;
|
|
15
15
|
months?: number;
|
|
16
16
|
days?: number;
|
|
@@ -94,7 +94,7 @@ const MenuItem = (props) => {
|
|
|
94
94
|
disabled
|
|
95
95
|
}
|
|
96
96
|
),
|
|
97
|
-
/* @__PURE__ */ jsxs(MenuItemContainerStyled, { ownerState: { ...ownerState },
|
|
97
|
+
/* @__PURE__ */ jsxs(MenuItemContainerStyled, { ownerState: { ...ownerState }, children: [
|
|
98
98
|
renderIcon(startIcon, "MenuItemStartIcon", getComponentSlotRoot("MenuItemStartIcon")),
|
|
99
99
|
/* @__PURE__ */ jsx(
|
|
100
100
|
MenuItemTypographyStyled,
|