@m4l/components 9.2.60 → 9.2.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/@types/types.d.ts +8 -0
- package/components/Chip/Chip.js +9 -10
- package/components/Chip/ChipStyles.js +13 -2
- package/components/Chip/constants.d.ts +9 -0
- package/components/Chip/constants.js +6 -2
- package/components/Chip/slots/ChipEnum.d.ts +3 -0
- package/components/Chip/slots/ChipEnum.js +6 -1
- package/components/Chip/slots/ChipSlots.js +1 -1
- package/components/DataGrid/DataGrid.js +17 -3
- package/components/DataGrid/Datagrid.styles.js +80 -33
- package/components/DataGrid/constants.d.ts +2 -0
- package/components/DataGrid/constants.js +7 -3
- package/components/DataGrid/contexts/DataGridContext/index.js +77 -30
- package/components/DataGrid/contexts/DataGridContext/types.d.ts +5 -2
- package/components/DataGrid/dictionary.d.ts +8 -0
- package/components/DataGrid/dictionary.js +26 -17
- package/components/DataGrid/icons.d.ts +7 -0
- package/components/DataGrid/icons.js +8 -1
- package/components/DataGrid/slots/DataGridEnum.d.ts +7 -1
- package/components/DataGrid/slots/DataGridEnum.js +6 -0
- package/components/DataGrid/slots/DataGridSlot.d.ts +6 -0
- package/components/DataGrid/slots/DataGridSlot.js +35 -5
- package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Filter/index.js +9 -1
- package/components/DataGrid/subcomponents/Table/hooks/getDragHeaderRenderer.d.ts +3 -1
- package/components/DataGrid/subcomponents/Table/hooks/getDragHeaderRenderer.js +9 -2
- package/components/DataGrid/subcomponents/Table/hooks/useHeaderMenuActions.d.ts +6 -0
- package/components/DataGrid/subcomponents/Table/hooks/useHeaderMenuActions.js +262 -0
- package/components/DataGrid/subcomponents/Table/hooks/useSortColumnsRows.d.ts +6 -4
- package/components/DataGrid/subcomponents/Table/hooks/useSortColumnsRows.js +35 -18
- package/components/DataGrid/subcomponents/Table/index.js +97 -34
- package/components/DataGrid/subcomponents/Table/subcomponents/ActionsColumn.js +1 -1
- package/components/DataGrid/subcomponents/Table/subcomponents/DraggableHeaderRenderer.d.ts +1 -0
- package/components/DataGrid/subcomponents/Table/subcomponents/DraggableHeaderRenderer.js +79 -4
- package/components/DataGrid/subcomponents/Table/subcomponents/HeaderRenderClick/HeaderRenderClick.d.ts +5 -0
- package/components/DataGrid/subcomponents/Table/subcomponents/HeaderRenderClick/HeaderRenderClick.js +146 -0
- package/components/DataGrid/subcomponents/Table/subcomponents/HeaderRenderClick/index.d.ts +1 -0
- package/components/DataGrid/subcomponents/Table/subcomponents/HeaderRenderClick/index.js +1 -0
- package/components/DataGrid/subcomponents/Table/subcomponents/HeaderRenderClick/types.d.ts +131 -0
- package/components/DataGrid/subcomponents/Table/subcomponents/SelectColumn.js +1 -1
- package/components/DataGrid/subcomponents/editors/TextEditor/index.js +1 -1
- package/components/DataGrid/tests/HeaderRenderClick.test.d.ts +1 -0
- package/components/DataGrid/tests/useHeaderMenuActions.test.d.ts +1 -0
- package/components/DataGrid/types.d.ts +53 -0
- package/components/DynamicFilter/DynamicFilter.styles.js +99 -90
- 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 +67 -28
- package/components/DynamicFilter/subcomponents/FieldTypes/BooleanFilter/index.js +2 -2
- package/components/DynamicFilter/subcomponents/FieldTypes/DateTimeFilter/index.js +2 -2
- package/components/DynamicFilter/subcomponents/FieldTypes/NumberFilter/index.js +2 -2
- package/components/DynamicFilter/subcomponents/FieldTypes/SelectAsyncFilter/index.js +2 -2
- package/components/DynamicFilter/subcomponents/FieldTypes/SelectFilter/index.js +2 -2
- package/components/DynamicFilter/subcomponents/FieldTypes/StringFilter/index.js +2 -2
- 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 +24 -18
- package/components/DynamicFilter/subcomponents/PopoverFilter/usePopoverFilter.d.ts +3 -3
- package/components/DynamicFilter/subcomponents/PopoverMenuFields/PopoverMenuFields.js +4 -1
- package/components/DynamicFilter/types.d.ts +3 -0
- package/components/DynamicSort/DynamicSort.js +10 -6
- package/components/DynamicSort/DynamicSort.styles.js +92 -90
- package/components/DynamicSort/slots/DynamicSortSlots.d.ts +0 -9
- package/components/DynamicSort/slots/DynamicSortSlots.js +7 -23
- package/components/DynamicSort/slots/SlotsEnum.d.ts +1 -4
- package/components/DynamicSort/slots/SlotsEnum.js +1 -4
- package/components/DynamicSort/store/DynamicSortContext.js +96 -67
- package/components/DynamicSort/store/DynamicSortStore.js +53 -4
- package/components/DynamicSort/store/types.d.ts +11 -0
- package/components/DynamicSort/subcomponents/FieldTypes/StringSort/index.js +2 -2
- package/components/DynamicSort/subcomponents/InputSort/InputSort.js +2 -0
- package/components/DynamicSort/subcomponents/PopoverSort/PopoverSort.js +22 -17
- package/components/DynamicSort/subcomponents/PopoverSort/usePopoverSort.d.ts +3 -3
- 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/DynamicSort/types.d.ts +4 -0
- package/components/LanguagePopover/LanguagePopover.js +7 -5
- package/components/LanguagePopover/LanguagePopover.styles.js +32 -4
- package/components/LanguagePopover/slots/LanguagePopoverSlots.d.ts +9 -3
- package/components/LanguagePopover/slots/LanguagePopoverSlots.js +1 -3
- package/components/LanguagePopover/types.d.ts +6 -1
- package/components/PaperForm/styles.js +2 -1
- package/components/PropertyValue/PropertyValue.js +2 -1
- package/components/PropertyValue/PropertyValue.styles.js +7 -4
- package/components/PropertyValue/types.d.ts +4 -0
- 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 +25 -8
- package/components/SideBar/hooks/useCollapse/index.d.ts +1 -0
- package/components/SideBar/hooks/useCollapse/index.js +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 +171 -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 +69 -0
- package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/NodeMenuItem/types.d.ts +9 -0
- package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/NodeMenuItemMain/NodeMenuItemMain.d.ts +5 -0
- package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/NodeMenuItemMain/NodeMenuItemMain.js +56 -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 +7 -1
- package/components/WindowBase/WindowBase.styles.js +50 -15
- package/components/WindowBase/constants.d.ts +1 -0
- package/components/WindowBase/constants.js +5 -1
- 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 +11 -5
- package/components/WindowBase/subcomponents/Header/types.d.ts +1 -1
- 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 +16 -0
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/Window.js +13 -0
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/hooks/useRightActions.js +26 -20
- package/components/areas/contexts/AreasContext/store.js +2 -2
- package/components/extended/React-Resizable/helpers.js +1 -1
- 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/RHFAutocomplete/RFHAutocompleteStyles.js +1 -1
- package/components/hook-form/RHFTextField/RHFTextField.js +1 -0
- package/components/hook-form/RHFTextFieldPassword/RHFTextFieldPassword.styles.js +3 -38
- package/components/hook-form/RHFormContext/index.d.ts +1 -1
- package/components/mui_extended/Accordion/styles.js +10 -2
- package/components/mui_extended/Button/Button.js +3 -1
- package/components/mui_extended/Button/ButtonStyles.js +6 -1
- package/components/mui_extended/Button/types.d.ts +1 -1
- package/components/mui_extended/CheckBox/CheckBox.styles.js +2 -1
- package/components/mui_extended/Divider/index.d.ts +1 -0
- package/components/mui_extended/Divider/index.js +1 -0
- package/components/mui_extended/NavLink/NavLink.js +3 -1
- package/components/mui_extended/NavLink/NavLink.styles.js +2 -1
- package/components/mui_extended/NavLink/types.d.ts +3 -1
- package/components/mui_extended/Tab/Tab.styles.js +2 -1
- package/components/mui_extended/TabContent/TabContent.styles.js +2 -8
- package/components/mui_extended/TextField/TextField.js +1 -1
- package/components/mui_extended/TextField/TextField.styles.js +20 -18
- package/components/mui_extended/Typography/slots/typographySlots.d.ts +1 -1
- package/components/mui_extended/index.d.ts +1 -0
- package/hooks/useDynamicFilterAndSort/styles.js +1 -1
- package/hooks/useDynamicFilterAndSort/useDynamicFilterAndSort.d.ts +3 -0
- package/hooks/useDynamicFilterAndSort/useDynamicFilterAndSort.js +334 -88
- package/index.d.ts +1 -0
- package/index.js +23 -20
- package/package.json +4 -3
- package/storybook/components/DataGrid/DataGrid.stories.d.ts +22 -0
- package/storybook/components/DataGrid/MswHandles.d.ts +1 -0
- package/storybook/components/DataGrid/helpers/filterFieldsSeedData.d.ts +5 -0
- package/storybook/components/DataGrid/helpers/getRows.d.ts +4 -0
- package/storybook/components/DataGrid/helpers/getRowsWithBackendSimulation.d.ts +9 -0
- package/storybook/components/DataGrid/helpers/sortsSeedData.d.ts +5 -0
- package/storybook/components/DataGrid/helpers/types.d.ts +1 -0
- package/storybook/components/DataGrid/helpers/useSeed.d.ts +3 -0
- package/storybook/components/DataGrid/subcomponents/DataGridRender.d.ts +2 -0
- 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/components/extended/mui/TextField/TextFieldText.stories.d.ts +1 -0
- package/utils/index.d.ts +1 -0
- 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/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
|
@@ -2,20 +2,22 @@ import { jsxs, jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useIsMobile } from "@m4l/graphics";
|
|
3
3
|
import { useEnvironment } from "@m4l/core";
|
|
4
4
|
import { u as useSideBar } from "../../hooks/useSideBar/index.js";
|
|
5
|
-
import { C as ContentComponentRootStyled, a as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { H as HeaderSidebar } from "../HeaderSidebar/index.js";
|
|
5
|
+
import { C as ContentComponentRootStyled, a as ContainerBtnAnchoredStyled, b as ContentComponentHideStyled, c as ContainerTreeItemsAndPromotionStyled } from "../../slots/SideBarSlots.js";
|
|
6
|
+
import { T as TreeGroupItems } from "../TreeGroupItems/index.js";
|
|
7
|
+
import { P as Promotion } from "../Promotion/index.js";
|
|
9
8
|
import { a as getComponentSlotRoot } from "../../../../utils/getComponentSlotRoot.js";
|
|
10
9
|
import { a as PATH_ARROW_RIGHT_ICON, C as CONTAINER_BTN_ANCHORED } from "../../constants.js";
|
|
10
|
+
import { useRef } from "react";
|
|
11
11
|
import { u as useComponentSize } from "../../../../hooks/useComponentSize/useComponentSize.js";
|
|
12
12
|
import { I as IconButton } from "../../../mui_extended/IconButton/IconButton.js";
|
|
13
13
|
const ContentComponent = () => {
|
|
14
|
-
const { anchored, onToggleAnchored,
|
|
14
|
+
const { anchored, onToggleAnchored, expandedWidth, size, classes, isHover, setIsHover } = useSideBar();
|
|
15
15
|
const ownerState = {
|
|
16
16
|
expandedWidth,
|
|
17
17
|
anchored
|
|
18
18
|
};
|
|
19
|
+
const btnAnchoredRef = useRef(null);
|
|
20
|
+
const contentRef = useRef(null);
|
|
19
21
|
const { host_static_assets, environment_assets } = useEnvironment();
|
|
20
22
|
const isDesktop = !useIsMobile();
|
|
21
23
|
const { currentSize } = useComponentSize(size);
|
|
@@ -24,34 +26,52 @@ const ContentComponent = () => {
|
|
|
24
26
|
onToggleAnchored(!anchored);
|
|
25
27
|
};
|
|
26
28
|
return /* @__PURE__ */ jsxs(ContentComponentRootStyled, { ownerState, children: [
|
|
27
|
-
/* @__PURE__ */ jsx(ContentComponentHideStyled, { ownerState: { ...ownerState, isDesktop }, role: "complementary", "aria-label": "hidden content", children: /* @__PURE__ */ jsxs(ContainerComponentStyled, { ownerState, children: [
|
|
28
|
-
/* @__PURE__ */ jsx(
|
|
29
|
-
HeaderSidebar,
|
|
30
|
-
{
|
|
31
|
-
title: companyName ?? "",
|
|
32
|
-
subtitle: companySlogan ?? "",
|
|
33
|
-
srcIcon: companyLogoSmallUrl ?? ""
|
|
34
|
-
}
|
|
35
|
-
),
|
|
36
|
-
/* @__PURE__ */ jsx(ContentGroups, { size: currentSize }),
|
|
37
|
-
/* @__PURE__ */ jsx(FooterSidebar, { onToggleAnchored, anchored })
|
|
38
|
-
] }) }),
|
|
39
29
|
isDesktop && /* @__PURE__ */ jsx(
|
|
40
30
|
ContainerBtnAnchoredStyled,
|
|
41
31
|
{
|
|
32
|
+
ref: btnAnchoredRef,
|
|
42
33
|
className: classRootBtnAnchored,
|
|
43
34
|
ownerState,
|
|
35
|
+
onMouseLeave: (event) => {
|
|
36
|
+
if (!anchored && contentRef.current && !contentRef.current.contains(event.relatedTarget)) {
|
|
37
|
+
setIsHover(false);
|
|
38
|
+
}
|
|
39
|
+
},
|
|
44
40
|
children: /* @__PURE__ */ jsx(
|
|
45
41
|
IconButton,
|
|
46
42
|
{
|
|
47
43
|
role: "anchored-button",
|
|
48
|
-
variant: "outline",
|
|
44
|
+
variant: anchored ? "contained" : "outline",
|
|
49
45
|
rotationAngle: !anchored ? 0 : 180,
|
|
50
46
|
onClick: handlerAnchoredButton,
|
|
51
|
-
src: `${host_static_assets}/${environment_assets}/${PATH_ARROW_RIGHT_ICON}
|
|
47
|
+
src: `${host_static_assets}/${environment_assets}/${PATH_ARROW_RIGHT_ICON}`,
|
|
48
|
+
color: anchored ? "primary" : "default"
|
|
52
49
|
}
|
|
53
50
|
)
|
|
54
51
|
}
|
|
52
|
+
),
|
|
53
|
+
/* @__PURE__ */ jsx(
|
|
54
|
+
ContentComponentHideStyled,
|
|
55
|
+
{
|
|
56
|
+
ref: contentRef,
|
|
57
|
+
ownerState: { ...ownerState, isDesktop, isHover },
|
|
58
|
+
className: classes.contentComponentHide,
|
|
59
|
+
role: "complementary",
|
|
60
|
+
"aria-label": "hidden content",
|
|
61
|
+
onMouseEnter: () => {
|
|
62
|
+
!anchored && setIsHover(true);
|
|
63
|
+
},
|
|
64
|
+
onMouseLeave: (event) => {
|
|
65
|
+
if (!anchored && btnAnchoredRef.current && btnAnchoredRef.current.contains(event.relatedTarget)) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
setIsHover(false);
|
|
69
|
+
},
|
|
70
|
+
children: /* @__PURE__ */ jsxs(ContainerTreeItemsAndPromotionStyled, { ownerState, children: [
|
|
71
|
+
/* @__PURE__ */ jsx(TreeGroupItems, { size: currentSize }),
|
|
72
|
+
/* @__PURE__ */ jsx(Promotion, { onToggleAnchored, anchored })
|
|
73
|
+
] })
|
|
74
|
+
}
|
|
55
75
|
)
|
|
56
76
|
] });
|
|
57
77
|
};
|
|
@@ -1,44 +1,193 @@
|
|
|
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 { 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",
|
|
40
53
|
display: "flex",
|
|
41
|
-
flexDirection: "column"
|
|
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,
|
|
88
|
+
display: "flex",
|
|
89
|
+
flexDirection: "column",
|
|
90
|
+
overflow: "visible",
|
|
91
|
+
'& [class*="M4LMenuItem-root"]:not(.menu-active)': {
|
|
92
|
+
"& .M4LTypography-root": {
|
|
93
|
+
color: `${theme.vars.palette.text.secondary}!important`
|
|
94
|
+
},
|
|
95
|
+
"& .M4LIcon-icon": {
|
|
96
|
+
backgroundColor: `${theme.vars.palette.text.secondary}!important`
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
[`&.${CLASS_NAME_IS_ROOT}`]: {
|
|
100
|
+
margin: "unset"
|
|
101
|
+
},
|
|
102
|
+
[`& > .M4LMenuItem-root:first-of-type:not(.${CLASS_NAME_MENU_ACTIVE}).${CLASS_NAME_ITEM_IN_TREE_ACTIVE}`]: {
|
|
103
|
+
borderColor: theme.vars.palette.divider,
|
|
104
|
+
// Linea de referencia vertical
|
|
105
|
+
"&::before": {
|
|
106
|
+
content: '""',
|
|
107
|
+
position: "absolute",
|
|
108
|
+
top: "-25%",
|
|
109
|
+
bottom: "-25%",
|
|
110
|
+
height: "150%",
|
|
111
|
+
left: 0,
|
|
112
|
+
width: 2,
|
|
113
|
+
borderLeft: theme.vars.size.borderStroke.container,
|
|
114
|
+
borderColor: theme.vars.palette.border.default,
|
|
115
|
+
...ownerState?.isLastSibling && !ownerState?.hasChildren && {
|
|
116
|
+
height: "75%"
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
// Linea de referencia horizontal
|
|
120
|
+
[`&:not(.${CLASS_NAME_HAS_CHILDREN}):after`]: {
|
|
121
|
+
content: '""',
|
|
122
|
+
position: "absolute",
|
|
123
|
+
margin: "0",
|
|
124
|
+
left: 1,
|
|
125
|
+
width: 4,
|
|
126
|
+
height: 1,
|
|
127
|
+
borderTop: theme.vars.size.borderStroke.container,
|
|
128
|
+
borderColor: theme.vars.palette.border.default
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
[`&.M4LSidebar-containerNodeMenuItem > .M4LMenuItem-root[class*="${CLASS_NAME_ITEM_IN_TREE_ACTIVE}"] .M4LIconClass-root`]: {
|
|
132
|
+
background: theme.vars.palette.text.primary
|
|
133
|
+
},
|
|
134
|
+
[`& > .M4LMenuItem-root:not(.${CLASS_NAME_IS_ROOT}).${CLASS_NAME_MENU_ACTIVE}`]: {
|
|
135
|
+
"&::before": {
|
|
136
|
+
content: '""',
|
|
137
|
+
position: "absolute",
|
|
138
|
+
height: "25%",
|
|
139
|
+
top: "25%",
|
|
140
|
+
bottom: 0,
|
|
141
|
+
left: 0,
|
|
142
|
+
width: 2,
|
|
143
|
+
borderLeft: theme.vars.size.borderStroke.container,
|
|
144
|
+
borderColor: theme.vars.palette.primary.enabled,
|
|
145
|
+
...!ownerState?.isLastSibling && !ownerState?.hasChildren && {
|
|
146
|
+
height: "50%"
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
"&:after": {
|
|
150
|
+
content: '""',
|
|
151
|
+
position: "absolute",
|
|
152
|
+
margin: "0",
|
|
153
|
+
left: 0,
|
|
154
|
+
width: theme.vars.size.baseSpacings.sp1,
|
|
155
|
+
height: 1,
|
|
156
|
+
borderTop: theme.vars.size.borderStroke.container,
|
|
157
|
+
borderColor: theme.vars.palette.primary.enabled
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
[`& > .M4LMenuItem-root.${CLASS_NAME_IS_ROOT}.${CLASS_NAME_MENU_ACTIVE}`]: {
|
|
161
|
+
backgroundColor: theme.vars.palette.primary.opacity
|
|
162
|
+
},
|
|
163
|
+
"& .MuiCollapse-wrapperInner": {
|
|
164
|
+
display: "flex",
|
|
165
|
+
flexDirection: "column",
|
|
166
|
+
paddingLeft: 0,
|
|
167
|
+
paddingBottom: theme.vars.size.baseSpacings.sp1,
|
|
168
|
+
paddingTop: 0,
|
|
169
|
+
paddingRight: theme.vars.size.baseSpacings.sp1
|
|
170
|
+
},
|
|
171
|
+
[`&.${CLASS_NAME_IS_ROOT}.${CLASS_NAME_MENU_ACTIVE}`]: {
|
|
172
|
+
backgroundColor: theme.vars.palette.background.base,
|
|
173
|
+
borderRadius: theme.vars.size.borderRadius["r1-5"]
|
|
174
|
+
}
|
|
175
|
+
}),
|
|
176
|
+
containerNodeMenuItemMain: {},
|
|
177
|
+
/**
|
|
178
|
+
* Estilos del menu item principal.
|
|
179
|
+
*/
|
|
180
|
+
menuItemMain: ({ theme, ownerState }) => ({
|
|
181
|
+
"& .M4LSideBar-containerArrowIconRoot": {
|
|
182
|
+
marginLeft: "unset"
|
|
183
|
+
},
|
|
184
|
+
"&&& .M4LTypography-root": {
|
|
185
|
+
...getTypographyStyles(
|
|
186
|
+
theme.generalSettings.isMobile,
|
|
187
|
+
ownerState?.size || "medium",
|
|
188
|
+
"bodyDens"
|
|
189
|
+
)
|
|
190
|
+
}
|
|
42
191
|
})
|
|
43
192
|
};
|
|
44
193
|
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;
|