@m4l/components 9.2.64 → 9.2.65
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 +12 -10
- package/components/AppBar/constants.d.ts +1 -1
- package/components/AppBar/constants.js +1 -1
- package/components/AppBar/slots/AppBarEnum.d.ts +1 -5
- package/components/AppBar/slots/AppBarEnum.js +0 -4
- package/components/AppBar/slots/AppBarSlots.d.ts +4 -18
- package/components/AppBar/slots/AppBarSlots.js +3 -27
- package/components/AppBar/styles.js +0 -42
- package/components/AppBar/types.d.ts +8 -0
- package/components/Chip/ChipStyles.js +1 -1
- package/components/LoadingError/slots/LoadingErrorSlots.js +1 -1
- package/components/SideBar/SideBar.js +6 -2
- package/components/SideBar/constants.d.ts +8 -6
- package/components/SideBar/constants.js +8 -8
- package/components/SideBar/context/sideBarContext/index.js +9 -10
- package/components/SideBar/context/sideBarContext/types.d.ts +2 -10
- package/components/SideBar/slots/SideBarEnum.d.ts +8 -7
- package/components/SideBar/slots/SideBarEnum.js +6 -5
- package/components/SideBar/slots/SideBarSlots.d.ts +12 -9
- package/components/SideBar/slots/SideBarSlots.js +36 -28
- package/components/SideBar/styles.js +3 -3
- package/components/SideBar/subcomponents/ContentComponent/index.js +12 -68
- package/components/SideBar/subcomponents/ContentComponent/style.js +134 -107
- package/components/SideBar/subcomponents/{Promotion → FooterComponent}/index.d.ts +1 -1
- package/components/SideBar/subcomponents/{Promotion → FooterComponent}/index.js +4 -4
- package/components/SideBar/subcomponents/{Promotion → FooterComponent}/styles.js +8 -2
- package/components/SideBar/subcomponents/HeaderComponent/HeaderComponent.d.ts +5 -0
- package/components/SideBar/subcomponents/HeaderComponent/HeaderComponent.js +37 -0
- package/components/SideBar/subcomponents/HeaderComponent/index.d.ts +1 -0
- package/components/SideBar/subcomponents/HeaderComponent/index.js +1 -0
- package/components/SideBar/subcomponents/HeaderComponent/styles.d.ts +2 -0
- package/components/SideBar/subcomponents/HeaderComponent/styles.js +40 -0
- package/components/SideBar/subcomponents/SideBarDesktop/index.js +4 -3
- package/components/SideBar/subcomponents/SideBarDesktop/styles.js +4 -32
- package/components/SideBar/subcomponents/SideBarMobile/index.js +1 -1
- package/components/SideBar/subcomponents/TreeGroupItems/index.js +4 -3
- package/components/SideBar/subcomponents/TreeGroupItems/styles.js +112 -2
- package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/AdormentIcon/AdormentIcon.d.ts +7 -0
- package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/AdormentIcon/AdormentIcon.js +12 -0
- package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/AdormentIcon/types.d.ts +4 -0
- package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/NodeMenuItem/index.js +9 -7
- package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/NodeMenuItem/types.d.ts +1 -0
- package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/NodeMenuItemMain/NodeMenuItemMain.js +11 -6
- package/components/SideBar/types.d.ts +12 -7
- package/components/commercial/HamburgerMenu/HamburgerMenu.js +1 -2
- package/components/hook-form/RHFPeriod/subcomponents/Period/Period.js +4 -4
- package/components/hook-form/RHFPeriod/subcomponents/Period/dictionary.d.ts +1 -1
- package/components/hook-form/RHFPeriod/subcomponents/Period/dictionary.js +7 -6
- 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 +13 -1
- package/package.json +1 -1
- package/storybook/components/SideBar/SideBar.stories.d.ts +5 -11
- package/storybook/components/SideBar/subcomponents/FooterComponentHost/FooterComponentHost.d.ts +4 -0
- package/storybook/components/SideBar/subcomponents/FooterComponentHost/index.d.ts +1 -0
- package/storybook/components/SideBar/subcomponents/FooterComponentMicrofrontend/FooterComponentMicrofrontend.d.ts +4 -0
- package/storybook/components/SideBar/subcomponents/FooterComponentMicrofrontend/FooterComponentMicrofrontend.stories.d.ts +14 -0
- package/storybook/components/SideBar/subcomponents/FooterComponentMicrofrontend/constants.d.ts +1 -0
- package/storybook/components/SideBar/subcomponents/FooterComponentMicrofrontend/index.d.ts +1 -0
- package/storybook/components/SideBar/subcomponents/HeaderComponentHost/HeaderComponentHost.d.ts +5 -0
- package/storybook/components/SideBar/subcomponents/HeaderComponentHost/constants.d.ts +1 -0
- package/storybook/components/SideBar/subcomponents/HeaderComponentMicrofrontend/HeaderComponentMicrofrontend.d.ts +5 -0
- package/storybook/components/SideBar/subcomponents/HeaderComponentMicrofrontend/constants.d.ts +1 -0
- package/utils/getSizeStyles/getSizeStyles.d.ts +1 -1
- package/components/SideBar/subcomponents/HeaderSidebar/index.d.ts +0 -6
- package/components/SideBar/subcomponents/HeaderSidebar/styles.d.ts +0 -2
- package/components/SideBar/subcomponents/HeaderSidebar/styles.js +0 -24
- package/components/SideBar/subcomponents/HeaderSidebar/types.d.ts +0 -5
- package/storybook/components/SideBar/subcomponents/FooterPromotion/FooterPromotion.d.ts +0 -4
- package/storybook/components/SideBar/subcomponents/FooterPromotion/index.d.ts +0 -1
- /package/components/SideBar/subcomponents/{Promotion → FooterComponent}/styles.d.ts +0 -0
- /package/components/SideBar/subcomponents/{Promotion → FooterComponent}/types.d.ts +0 -0
- /package/storybook/components/SideBar/subcomponents/{FooterPromotion → FooterComponentHost}/constants.d.ts +0 -0
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { u as useSideBar } from "../../hooks/useSideBar/index.js";
|
|
3
|
+
import { H as HeaderContainerComponentStyled, B as ButtonAnchoredStyled } from "../../slots/SideBarSlots.js";
|
|
4
|
+
import { useEnvironment } from "@m4l/core";
|
|
5
|
+
import { e as PATH_ARROW_RIGHT_ICON } from "../../constants.js";
|
|
6
|
+
import { useIsMobile } from "@m4l/graphics";
|
|
7
|
+
const HeaderComponent = () => {
|
|
8
|
+
const {
|
|
9
|
+
headerComponent,
|
|
10
|
+
onToggleAnchored,
|
|
11
|
+
anchored,
|
|
12
|
+
variant,
|
|
13
|
+
classes
|
|
14
|
+
} = useSideBar();
|
|
15
|
+
const { host_static_assets, environment_assets } = useEnvironment();
|
|
16
|
+
const isDesktop = !useIsMobile();
|
|
17
|
+
const handleToggleAnchored = () => {
|
|
18
|
+
onToggleAnchored(!anchored);
|
|
19
|
+
};
|
|
20
|
+
return /* @__PURE__ */ jsxs(HeaderContainerComponentStyled, { ownerState: { anchored, variant }, children: [
|
|
21
|
+
headerComponent && headerComponent,
|
|
22
|
+
variant === "microfrontend" && isDesktop && /* @__PURE__ */ jsx(
|
|
23
|
+
ButtonAnchoredStyled,
|
|
24
|
+
{
|
|
25
|
+
icon: `${host_static_assets}/${environment_assets}/${PATH_ARROW_RIGHT_ICON}`,
|
|
26
|
+
onClick: handleToggleAnchored,
|
|
27
|
+
rotationAngle: anchored ? 0 : 180,
|
|
28
|
+
className: classes.buttonAnchored,
|
|
29
|
+
variant: "contained",
|
|
30
|
+
role: "anchored-button"
|
|
31
|
+
}
|
|
32
|
+
)
|
|
33
|
+
] });
|
|
34
|
+
};
|
|
35
|
+
export {
|
|
36
|
+
HeaderComponent as H
|
|
37
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { HeaderComponent } from './HeaderComponent';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
const headerComponentStyles = {
|
|
2
|
+
/**
|
|
3
|
+
* Wrapper para el encabezado del sidebar
|
|
4
|
+
*/
|
|
5
|
+
headerContainerComponent: ({ theme, ownerState }) => ({
|
|
6
|
+
display: "flex",
|
|
7
|
+
flexDirection: "row",
|
|
8
|
+
justifyContent: "space-between",
|
|
9
|
+
alignItems: "center",
|
|
10
|
+
width: "100%",
|
|
11
|
+
gap: theme.vars.size.baseSpacings.sp3,
|
|
12
|
+
paddingLeft: theme.vars.size.baseSpacings.sp4,
|
|
13
|
+
paddingRight: theme.vars.size.baseSpacings.sp4,
|
|
14
|
+
paddingBottom: theme.vars.size.baseSpacings.sp3,
|
|
15
|
+
transition: "all 0.5s",
|
|
16
|
+
"& > div": {
|
|
17
|
+
transition: "all 0.5s"
|
|
18
|
+
},
|
|
19
|
+
...!ownerState?.anchored && ownerState?.variant !== "host" && {
|
|
20
|
+
transition: "all 0.5s",
|
|
21
|
+
height: theme.vars.size.baseSpacings.sp14,
|
|
22
|
+
justifyContent: "center",
|
|
23
|
+
alignItems: "center",
|
|
24
|
+
paddingLeft: theme.vars.size.baseSpacings.sp2,
|
|
25
|
+
paddingRight: theme.vars.size.baseSpacings.sp2,
|
|
26
|
+
gap: "unset",
|
|
27
|
+
"& > div:not(.M4LSideBar-buttonAnchored)": {
|
|
28
|
+
visibility: "hidden",
|
|
29
|
+
transition: "all 0.5s"
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}),
|
|
33
|
+
/**
|
|
34
|
+
* Styles applied to the button anchored in the header component
|
|
35
|
+
*/
|
|
36
|
+
buttonAnchored: {}
|
|
37
|
+
};
|
|
38
|
+
export {
|
|
39
|
+
headerComponentStyles as h
|
|
40
|
+
};
|
|
@@ -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 { c as ContainerDesktopContentStyled, d 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 } = useSideBar();
|
|
10
|
+
const { anchored, expandedWidth, variant } = useSideBar();
|
|
11
11
|
const [eventAnchored, setEventAnchored] = useState(anchored);
|
|
12
12
|
const isFirstRender = useFirstRender([anchored]);
|
|
13
13
|
useEffect(() => {
|
|
@@ -18,7 +18,8 @@ const SideBarDesktop = () => {
|
|
|
18
18
|
}, [anchored]);
|
|
19
19
|
const ownerState = {
|
|
20
20
|
anchored: eventAnchored,
|
|
21
|
-
expandedWidth
|
|
21
|
+
expandedWidth,
|
|
22
|
+
variant
|
|
22
23
|
};
|
|
23
24
|
const classRoot = getComponentSlotRoot(SIDEBAR_KEY_COMPONENT);
|
|
24
25
|
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 : theme.vars.size.baseSpacings.
|
|
8
|
+
const width = ownerState?.anchored ? ownerState?.expandedWidth : ownerState?.variant === "host" ? 0 : theme.vars.size.baseSpacings.sp10;
|
|
9
9
|
return {
|
|
10
10
|
height: "100%",
|
|
11
11
|
position: "relative",
|
|
@@ -17,42 +17,14 @@ const sideBarDesktopStyles = {
|
|
|
17
17
|
/**
|
|
18
18
|
* Styles applied to the root element of the `SideBar` component in desktop mode.
|
|
19
19
|
*/
|
|
20
|
-
containerDesktopRoot: ({
|
|
20
|
+
containerDesktopRoot: ({ theme }) => ({
|
|
21
21
|
height: "100%",
|
|
22
|
-
width: "
|
|
22
|
+
width: "100%",
|
|
23
23
|
overflow: "visible",
|
|
24
|
-
borderRight: `1px solid ${theme.vars.palette.border.
|
|
25
|
-
position: !ownerState?.anchored ? "absolute" : "relative",
|
|
24
|
+
borderRight: `1px solid ${theme.vars.palette.border.secondary}`,
|
|
26
25
|
inset: 0,
|
|
27
26
|
//add hover effect
|
|
28
27
|
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
|
-
}
|
|
56
28
|
})
|
|
57
29
|
};
|
|
58
30
|
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 { e as ContainerSideBarMobileStyled } from "../../slots/SideBarSlots.js";
|
|
8
8
|
import { C as ContentComponent } from "../ContentComponent/index.js";
|
|
9
9
|
const SideBarMobile = () => {
|
|
10
10
|
const {
|
|
@@ -3,18 +3,19 @@ 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 { f as ContainerTreeGroupItemsStyled, g as ContainerContentGroupsStyled, h 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 } = useSideBar();
|
|
11
|
+
const { menuData, anchored } = 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
|
|
17
|
+
noItems: menuData.length === 0,
|
|
18
|
+
anchored
|
|
18
19
|
};
|
|
19
20
|
const renderItemsDisabled = () => {
|
|
20
21
|
return /* @__PURE__ */ jsx(ContainerContentTitleStyled, { ownerState: { disabled: true }, children: /* @__PURE__ */ jsx(
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { g as getSizeStyles } from "../../../../utils/getSizeStyles/getSizeStyles.js";
|
|
1
2
|
const contentGroupStyles = {
|
|
2
3
|
/**
|
|
3
4
|
* Container for the group items in the sidebar
|
|
@@ -9,9 +10,17 @@ const contentGroupStyles = {
|
|
|
9
10
|
flex: 1,
|
|
10
11
|
flexDirection: "column",
|
|
11
12
|
overflowY: "auto",
|
|
12
|
-
padding: `${theme.vars.size.baseSpacings.sp3} 0px 0px 0px`,
|
|
13
13
|
alignItems: "center",
|
|
14
|
-
justifyContent: ownerState?.noItems ? "center" : "flex-start"
|
|
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
|
+
}
|
|
15
24
|
}),
|
|
16
25
|
/**
|
|
17
26
|
* Wrapper for every principal item group in the sidebar
|
|
@@ -28,6 +37,7 @@ const contentGroupStyles = {
|
|
|
28
37
|
containerContentTitle: ({ theme, ownerState }) => ({
|
|
29
38
|
padding: `${theme.vars.size.baseSpacings.sp3} ${theme.vars.size.baseSpacings.sp4} ${theme.vars.size.baseSpacings.sp1}`,
|
|
30
39
|
color: theme.vars.palette.text.primary,
|
|
40
|
+
width: "100%",
|
|
31
41
|
textAlign: "left",
|
|
32
42
|
"& .MuiTypography-root": {
|
|
33
43
|
color: !ownerState?.disabled ? theme.vars.palette.text.primary : `${theme.vars.palette.text.primary} !important`
|
|
@@ -62,6 +72,106 @@ const contentGroupStyles = {
|
|
|
62
72
|
alignSelf: "center",
|
|
63
73
|
lineHeight: 0,
|
|
64
74
|
marginLeft: "auto"
|
|
75
|
+
}),
|
|
76
|
+
/**
|
|
77
|
+
* Wrapper for the menu item
|
|
78
|
+
*/
|
|
79
|
+
wrapperMenuItem: ({ theme, ownerState }) => ({
|
|
80
|
+
display: "flex",
|
|
81
|
+
position: "relative",
|
|
82
|
+
paddingTop: theme.vars.size.baseSpacings.sp2,
|
|
83
|
+
paddingBottom: theme.vars.size.baseSpacings.sp2,
|
|
84
|
+
paddingLeft: theme.vars.size.baseSpacings.sp2,
|
|
85
|
+
paddingRight: theme.vars.size.baseSpacings.sp2,
|
|
86
|
+
...getSizeStyles(
|
|
87
|
+
theme,
|
|
88
|
+
ownerState?.size || "medium",
|
|
89
|
+
"container",
|
|
90
|
+
(size) => ({
|
|
91
|
+
minHeight: size,
|
|
92
|
+
height: "auto"
|
|
93
|
+
})
|
|
94
|
+
)
|
|
95
|
+
}),
|
|
96
|
+
/**
|
|
97
|
+
* Styles applied to the container of the adornment icon in the header component
|
|
98
|
+
*/
|
|
99
|
+
containerAdornmentIcon: ({ theme, ownerState }) => ({
|
|
100
|
+
overflow: "hidden",
|
|
101
|
+
borderRadius: theme.vars.size.borderRadius["r1-5"],
|
|
102
|
+
display: "flex",
|
|
103
|
+
justifyContent: "center",
|
|
104
|
+
alignItems: "center",
|
|
105
|
+
position: "relative",
|
|
106
|
+
width: "fit-content",
|
|
107
|
+
height: "fit-content",
|
|
108
|
+
minWidth: "fit-content",
|
|
109
|
+
minHeight: "fit-content",
|
|
110
|
+
padding: "1px",
|
|
111
|
+
"& .M4LIcon-root": {
|
|
112
|
+
width: "fit-content",
|
|
113
|
+
height: "fit-content",
|
|
114
|
+
padding: theme.vars.size.baseSpacings["sp0-5"],
|
|
115
|
+
"& .M4LIcon-icon": {
|
|
116
|
+
...getSizeStyles(
|
|
117
|
+
theme,
|
|
118
|
+
ownerState?.size || "medium",
|
|
119
|
+
"case",
|
|
120
|
+
(sizeValue) => ({
|
|
121
|
+
width: `${sizeValue}!important`,
|
|
122
|
+
height: `${sizeValue}!important`,
|
|
123
|
+
minWidth: `${sizeValue}!important`,
|
|
124
|
+
minHeight: `${sizeValue}!important`
|
|
125
|
+
})
|
|
126
|
+
)
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
...ownerState?.variant !== "itemActive" && ownerState?.variant !== "normal" && {
|
|
130
|
+
"& .M4LIcon-icon": {
|
|
131
|
+
backgroundColor: `${theme.vars.palette.chips.persianGreen.contained.colorTone}!important`
|
|
132
|
+
}
|
|
133
|
+
},
|
|
134
|
+
...ownerState?.variant === "normal" && {
|
|
135
|
+
"& .M4LIcon-icon": {
|
|
136
|
+
backgroundColor: `${theme.vars.palette.text.secondary}!important`
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
...ownerState?.variant === "main" && {
|
|
140
|
+
backgroundColor: theme.vars.palette.chips.persianGreen.contained.backgroundColorTone
|
|
141
|
+
},
|
|
142
|
+
...ownerState?.variant === "root" && {
|
|
143
|
+
backgroundColor: theme.vars.palette.primary.enabled
|
|
144
|
+
},
|
|
145
|
+
...ownerState?.variant === "itemActive" && {
|
|
146
|
+
boxShadow: theme.vars.customShadows.primary2,
|
|
147
|
+
background: `linear-gradient(to right,
|
|
148
|
+
${theme.vars.palette.primary.opacityGradient1},
|
|
149
|
+
${theme.vars.palette.primary.opacityGradient2})`,
|
|
150
|
+
"& .M4LSideBar-backgroundAdornmentIcon": {
|
|
151
|
+
background: theme.vars.palette.background.default
|
|
152
|
+
},
|
|
153
|
+
"&::before": {
|
|
154
|
+
content: '""',
|
|
155
|
+
position: "absolute",
|
|
156
|
+
inset: "1.4px",
|
|
157
|
+
background: theme.vars.palette.primary.enabledOpacity,
|
|
158
|
+
borderRadius: "5px"
|
|
159
|
+
},
|
|
160
|
+
"& .M4LIcon-icon": {
|
|
161
|
+
backgroundColor: `${theme.vars.palette.primary.enabled}!important`
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}),
|
|
165
|
+
/**
|
|
166
|
+
* Styles applied to the background of the adornment icon in the header component
|
|
167
|
+
*/
|
|
168
|
+
backgroundAdornmentIcon: () => ({
|
|
169
|
+
width: "100%",
|
|
170
|
+
height: "100%",
|
|
171
|
+
display: "flex",
|
|
172
|
+
justifyContent: "center",
|
|
173
|
+
alignItems: "center",
|
|
174
|
+
borderRadius: "5px"
|
|
65
175
|
})
|
|
66
176
|
};
|
|
67
177
|
export {
|
package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/AdormentIcon/AdormentIcon.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { AdornmentIconProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Adornment icon component
|
|
4
|
+
* @param props - Adornment icon props
|
|
5
|
+
* @returns Adornment icon component
|
|
6
|
+
*/
|
|
7
|
+
export declare const AdornmentIcon: (props: AdornmentIconProps) => import("react/jsx-runtime").JSX.Element;
|
package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/AdormentIcon/AdormentIcon.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { u as useSideBar } from "../../../../hooks/useSideBar/index.js";
|
|
3
|
+
import { i as ContainerAdornmentIconStyled, j as BackgroundAdornmentIconStyled } from "../../../../slots/SideBarSlots.js";
|
|
4
|
+
import { I as Icon } from "../../../../../Icon/Icon.js";
|
|
5
|
+
const AdornmentIcon = (props) => {
|
|
6
|
+
const { icon, variant = "main" } = props;
|
|
7
|
+
const { classes } = useSideBar();
|
|
8
|
+
return /* @__PURE__ */ jsx(ContainerAdornmentIconStyled, { ownerState: { variant }, children: /* @__PURE__ */ jsx(BackgroundAdornmentIconStyled, { className: classes.backgroundAdornmentIcon, children: /* @__PURE__ */ jsx(Icon, { src: icon }) }) });
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
AdornmentIcon as A
|
|
12
|
+
};
|
|
@@ -5,14 +5,15 @@ import { u as useSideBar } from "../../../../hooks/useSideBar/index.js";
|
|
|
5
5
|
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
|
-
import { l as ContainerNodeMenuItemStyled } from "../../../../slots/SideBarSlots.js";
|
|
9
|
-
import {
|
|
8
|
+
import { l as ContainerNodeMenuItemStyled, W as WrapperMenuItemStyled } from "../../../../slots/SideBarSlots.js";
|
|
9
|
+
import { a as CLASS_NAME_MENU_ACTIVE, b as CLASS_NAME_ITEM_IN_TREE_ACTIVE, c as CLASS_NAME_HAS_CHILDREN, d as CLASS_NAME_ITEM_CLOSED } from "../../../../constants.js";
|
|
10
10
|
import { useModuleSkeleton } from "@m4l/core";
|
|
11
|
+
import { A as AdornmentIcon } from "../AdormentIcon/AdormentIcon.js";
|
|
11
12
|
import { u as useCollapse } from "../../../../hooks/useCollapse/useCollapse.js";
|
|
12
13
|
import { u as useComponentSize } from "../../../../../../hooks/useComponentSize/useComponentSize.js";
|
|
13
14
|
import { M as MenuItem } from "../../../../../mui_extended/MenuItem/MenuItem.js";
|
|
14
15
|
function NodeMenuItem(props) {
|
|
15
|
-
const { item, size, defaultOpen = false, className, isLastSibling = false } = props;
|
|
16
|
+
const { item, size, defaultOpen = false, className, isLastSibling = false, isRoot = false } = props;
|
|
16
17
|
const { urlIconPrefix, classes } = useSideBar();
|
|
17
18
|
const { isOpen, handlerClick, hasChildren } = useCollapse(item, defaultOpen);
|
|
18
19
|
const { currentSize } = useComponentSize(size);
|
|
@@ -33,23 +34,24 @@ function NodeMenuItem(props) {
|
|
|
33
34
|
ownerState,
|
|
34
35
|
...process.env.NODE_ENV !== "production" ? { [TEST_PROP_ID]: getNameDataTestId("menuItems") } : {},
|
|
35
36
|
children: [
|
|
36
|
-
/* @__PURE__ */ jsx(
|
|
37
|
+
/* @__PURE__ */ jsx(WrapperMenuItemStyled, { ownerState, className: classes.wrapperMenuItem, children: /* @__PURE__ */ jsx(
|
|
37
38
|
MenuItem,
|
|
38
39
|
{
|
|
39
40
|
className: clsx(
|
|
40
41
|
CLASS_NAME_ITEM_STATE,
|
|
41
42
|
className,
|
|
42
43
|
item.children && item.children.length > 0 && CLASS_NAME_HAS_CHILDREN,
|
|
43
|
-
item.itemInTreeActive && CLASS_NAME_ITEM_IN_TREE_ACTIVE
|
|
44
|
+
item.itemInTreeActive && CLASS_NAME_ITEM_IN_TREE_ACTIVE,
|
|
45
|
+
!isOpen && CLASS_NAME_ITEM_CLOSED
|
|
44
46
|
),
|
|
45
47
|
label: item.title,
|
|
46
48
|
selected: item.active,
|
|
47
|
-
startIcon: `${urlIconPrefix}${item.iconUrl}`,
|
|
49
|
+
startIcon: /* @__PURE__ */ jsx(AdornmentIcon, { icon: `${urlIconPrefix}${item.iconUrl}`, variant: isRoot && item.itemInTreeActive ? "root" : item.active ? "itemActive" : "normal" }),
|
|
48
50
|
endIcon: hasChildren ? /* @__PURE__ */ jsx(ArrowIcon, { openState: isOpen, active: item.active }) : null,
|
|
49
51
|
onClick: () => handlerClick(),
|
|
50
52
|
size: currentSize
|
|
51
53
|
}
|
|
52
|
-
),
|
|
54
|
+
) }),
|
|
53
55
|
hasChildren ? /* @__PURE__ */ jsx(Collapse, { in: isOpen, timeout: "auto", unmountOnExit: true, children: (item.children || []).map((child, index) => /* @__PURE__ */ jsx(
|
|
54
56
|
NodeMenuItem,
|
|
55
57
|
{
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { m as ContainerNodeMenuItemMainStyled, M as MenuItemMainStyled } from "../../../../slots/SideBarSlots.js";
|
|
2
|
+
import { m as ContainerNodeMenuItemMainStyled, W as WrapperMenuItemStyled, M as MenuItemMainStyled } from "../../../../slots/SideBarSlots.js";
|
|
3
3
|
import { g as getNameDataTestId } from "../../../../tests/utils.js";
|
|
4
4
|
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 { C 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";
|
|
11
13
|
import { u as useComponentSize } from "../../../../../../hooks/useComponentSize/useComponentSize.js";
|
|
12
14
|
import { u as useCollapse } from "../../../../hooks/useCollapse/useCollapse.js";
|
|
13
15
|
const NodeMenuItemMain = (props) => {
|
|
14
16
|
const { item, size, defaultOpen = false } = props;
|
|
17
|
+
const { urlIconPrefix, classes } = useSideBar();
|
|
15
18
|
const { currentSize } = useComponentSize(size);
|
|
16
19
|
const { isOpen, handlerClick, hasChildren } = useCollapse(item, defaultOpen);
|
|
17
20
|
const isSkeleton = useModuleSkeleton();
|
|
@@ -27,15 +30,16 @@ const NodeMenuItemMain = (props) => {
|
|
|
27
30
|
ownerState,
|
|
28
31
|
...process.env.NODE_ENV !== "production" ? { [TEST_PROP_ID]: getNameDataTestId("menuItems") } : {},
|
|
29
32
|
children: [
|
|
30
|
-
/* @__PURE__ */ jsx(
|
|
33
|
+
/* @__PURE__ */ jsx(WrapperMenuItemStyled, { ownerState, className: classes.wrapperMenuItem, children: /* @__PURE__ */ jsx(
|
|
31
34
|
MenuItemMainStyled,
|
|
32
35
|
{
|
|
33
36
|
label: item.title,
|
|
34
|
-
startIcon:
|
|
37
|
+
startIcon: /* @__PURE__ */ jsx(AdornmentIcon, { icon: `${urlIconPrefix}${item.iconUrl}`, variant: "main" }),
|
|
38
|
+
endIcon: hasChildren ? /* @__PURE__ */ jsx(ArrowIcon, { openState: isOpen, active: item.active }) : null,
|
|
35
39
|
onClick: () => handlerClick(),
|
|
36
40
|
size: currentSize
|
|
37
41
|
}
|
|
38
|
-
),
|
|
42
|
+
) }),
|
|
39
43
|
/* @__PURE__ */ jsx(Collapse, { in: isOpen, timeout: "auto", unmountOnExit: true, children: (item.children || []).map((child, index) => /* @__PURE__ */ jsx(
|
|
40
44
|
NodeMenuItem,
|
|
41
45
|
{
|
|
@@ -43,7 +47,8 @@ const NodeMenuItemMain = (props) => {
|
|
|
43
47
|
size: currentSize,
|
|
44
48
|
className: clsx(CLASS_NAME_IS_ROOT),
|
|
45
49
|
defaultOpen: isSkeleton ? false : true,
|
|
46
|
-
isLastSibling: item.children?.length === index + 1
|
|
50
|
+
isLastSibling: item.children?.length === index + 1,
|
|
51
|
+
isRoot: true
|
|
47
52
|
},
|
|
48
53
|
child.title
|
|
49
54
|
)) })
|
|
@@ -51,10 +51,6 @@ 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';
|
|
58
54
|
moduleSelectedId?: string | undefined;
|
|
59
55
|
onMenuItemClick: (item: MenuDataType) => void;
|
|
60
56
|
/**
|
|
@@ -74,10 +70,19 @@ export interface SideBarProps {
|
|
|
74
70
|
*/
|
|
75
71
|
urlIconPrefix?: string;
|
|
76
72
|
/**
|
|
77
|
-
*
|
|
73
|
+
* Variación del componente, puede ser uno de los valores definidos en 'variantDefault' , 'variantComercial'
|
|
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
|
|
78
82
|
*/
|
|
79
|
-
|
|
83
|
+
footerComponent?: ReactElement;
|
|
80
84
|
}
|
|
85
|
+
export type SidebarVariants = 'host' | 'microfrontend';
|
|
81
86
|
/**
|
|
82
87
|
* Interface que representa el estado de un elemento de menú en la barra lateral.
|
|
83
88
|
*/
|
|
@@ -96,7 +101,7 @@ export type SideBarOwnerState = Pick<IMenuDataWithState, 'active' | 'itemInTreeA
|
|
|
96
101
|
export type SideBarStyles = M4LOverridesStyleRules<SideBarSlotsType, typeof SIDEBAR_KEY_COMPONENT, Theme>;
|
|
97
102
|
export type SideBarDesktopStyles = M4LOverridesStyleRules<SideBarDesktopSlots, typeof SIDEBAR_KEY_COMPONENT, Theme>;
|
|
98
103
|
export type ContentGroupsStyles = M4LOverridesStyleRules<ContentGroupsSlots, typeof SIDEBAR_KEY_COMPONENT, Theme>;
|
|
99
|
-
export type
|
|
104
|
+
export type HeaderComponentStyles = M4LOverridesStyleRules<HeaderSidebarSlots, typeof SIDEBAR_KEY_COMPONENT, Theme>;
|
|
100
105
|
export type SideBarFooterStyles = M4LOverridesStyleRules<SideBarFooterSlots, typeof SIDEBAR_KEY_COMPONENT, Theme>;
|
|
101
106
|
export type SideBarMobileStyles = M4LOverridesStyleRules<SideBarMobileSlots, typeof SIDEBAR_KEY_COMPONENT, Theme>;
|
|
102
107
|
export type ContentComponentStyles = M4LOverridesStyleRules<ContentComponentSlots, typeof SIDEBAR_KEY_COMPONENT, Theme>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useModuleDictionary, useEnvironment } from "@m4l/core";
|
|
3
3
|
import { E as ETimePeriods } from "./types.js";
|
|
4
|
-
import {
|
|
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
7
|
import { P as PeriodRootStyled, S as SelectStyled, T as TextFieldStyled } from "../../slots/RHFPeriodSlots.js";
|
|
@@ -19,9 +19,9 @@ const Period = (props) => {
|
|
|
19
19
|
const { host_static_assets, environment_assets } = useEnvironment();
|
|
20
20
|
const options = useMemo(
|
|
21
21
|
() => [
|
|
22
|
-
{ id: ETimePeriods.YEARS.toString(), label: getLabel(
|
|
23
|
-
{ id: ETimePeriods.MONTHS.toString(), label: getLabel(
|
|
24
|
-
{ id: ETimePeriods.DAYS.toString(), label: getLabel(
|
|
22
|
+
{ id: ETimePeriods.YEARS.toString(), label: getLabel(DICTIONARY.LABEL_YEARS) },
|
|
23
|
+
{ id: ETimePeriods.MONTHS.toString(), label: getLabel(DICTIONARY.LABEL_MONTHS) },
|
|
24
|
+
{ id: ETimePeriods.DAYS.toString(), label: getLabel(DICTIONARY.LABEL_DAYS) }
|
|
25
25
|
],
|
|
26
26
|
[getLabel]
|
|
27
27
|
);
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { g as getCommonActionsDictionary } from "../../../../CommonActions/dictionary.js";
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
const DICTIONARY_KEY = "rhf_period";
|
|
3
|
+
const DICTIONARY = {
|
|
4
|
+
LABEL_YEARS: `${DICTIONARY_KEY}.label_years`,
|
|
5
|
+
LABEL_MONTHS: `${DICTIONARY_KEY}.label_months`,
|
|
6
|
+
LABEL_DAYS: `${DICTIONARY_KEY}.label_days`
|
|
6
7
|
};
|
|
7
8
|
function getPeriodComponetsDictionary() {
|
|
8
|
-
return [
|
|
9
|
+
return [DICTIONARY_KEY].concat(getCommonActionsDictionary());
|
|
9
10
|
}
|
|
10
11
|
export {
|
|
11
|
-
|
|
12
|
+
DICTIONARY as D,
|
|
12
13
|
getPeriodComponetsDictionary as g
|
|
13
14
|
};
|
|
@@ -94,7 +94,7 @@ const MenuItem = (props) => {
|
|
|
94
94
|
disabled
|
|
95
95
|
}
|
|
96
96
|
),
|
|
97
|
-
/* @__PURE__ */ jsxs(MenuItemContainerStyled, { ownerState: { ...ownerState }, children: [
|
|
97
|
+
/* @__PURE__ */ jsxs(MenuItemContainerStyled, { ownerState: { ...ownerState }, className: MENUITEM_CLASSES.menuItemContainer, children: [
|
|
98
98
|
renderIcon(startIcon, "MenuItemStartIcon", getComponentSlotRoot("MenuItemStartIcon")),
|
|
99
99
|
/* @__PURE__ */ jsx(
|
|
100
100
|
MenuItemTypographyStyled,
|
|
@@ -3,9 +3,9 @@ import { a as getComponentSlotRoot } from "../../../utils/getComponentSlotRoot.j
|
|
|
3
3
|
import { T as TAB_CONTENT_KEY_COMPONENT } from "./constants.js";
|
|
4
4
|
import { T as TabContentRootStyled } from "./slots/TabContentSlots.js";
|
|
5
5
|
const TabContent = (props) => {
|
|
6
|
-
const { children, className,
|
|
6
|
+
const { children, className, hasBackground = false, ...others } = props;
|
|
7
7
|
const root = getComponentSlotRoot(TAB_CONTENT_KEY_COMPONENT);
|
|
8
|
-
return /* @__PURE__ */ jsx(TabContentRootStyled, { className: root, ownerState: {
|
|
8
|
+
return /* @__PURE__ */ jsx(TabContentRootStyled, { className: root, ownerState: { hasBackground }, ...others, children });
|
|
9
9
|
};
|
|
10
10
|
export {
|
|
11
11
|
TabContent as T
|
|
@@ -23,7 +23,7 @@ const tabContentStyles = {
|
|
|
23
23
|
boxSizing: "border-box",
|
|
24
24
|
zIndex: "0",
|
|
25
25
|
top: "-1px",
|
|
26
|
-
...ownerState?.
|
|
26
|
+
...ownerState?.hasBackground ? {
|
|
27
27
|
backgroundColor: theme.vars.palette.background.base,
|
|
28
28
|
paddingLeft: theme.vars.size.baseSpacings.sp2,
|
|
29
29
|
paddingRight: theme.vars.size.baseSpacings.sp2,
|
|
@@ -4,9 +4,21 @@ import { TABS_KEY_COMPONENT } from '../Tabs/constants';
|
|
|
4
4
|
import { TabContentSlots } from './slots/TabContentEnum';
|
|
5
5
|
import { M4LOverridesStyleRules } from '../../../@types/augmentations';
|
|
6
6
|
export interface TabContentProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
7
|
+
/**
|
|
8
|
+
* Contenido del tab.
|
|
9
|
+
*/
|
|
7
10
|
children: React.ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* Estilos personalizados para el contenido del tab.
|
|
13
|
+
*/
|
|
8
14
|
style?: React.CSSProperties;
|
|
15
|
+
/**
|
|
16
|
+
* Clave única para el contenido del tab.
|
|
17
|
+
*/
|
|
9
18
|
key?: Key | null | undefined;
|
|
10
|
-
|
|
19
|
+
/**
|
|
20
|
+
* Si es verdadero, el contenido del tab se mostrará con un fondo que contrasta con el fondo de la app.
|
|
21
|
+
*/
|
|
22
|
+
hasBackground?: boolean;
|
|
11
23
|
}
|
|
12
24
|
export type TabContentStyles = M4LOverridesStyleRules<keyof typeof TabContentSlots, typeof TABS_KEY_COMPONENT, Theme>;
|