@m4l/components 9.1.94 → 9.1.96
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/DynamicFilter/subcomponents/AppliedFilters/AppliedFilters.js +1 -1
- package/components/ObjectLogs/components/DetailDialog/index.js +1 -1
- package/components/ScrollBar/{index.d.ts → ScrollBar.d.ts} +1 -4
- package/components/ScrollBar/ScrollBar.js +46 -0
- package/components/ScrollBar/ScrollBar.styles.d.ts +2 -0
- package/components/ScrollBar/ScrollBar.styles.js +65 -0
- package/components/ScrollBar/constants.d.ts +2 -0
- package/components/ScrollBar/constants.js +7 -0
- package/components/ScrollBar/slots/ScrollBarEnum.d.ts +4 -0
- package/components/ScrollBar/slots/ScrollBarEnum.js +8 -0
- package/components/ScrollBar/slots/ScrollBarSlots.d.ts +6 -0
- package/components/ScrollBar/slots/ScrollBarSlots.js +17 -0
- package/components/ScrollBar/slots/index.d.ts +2 -0
- package/components/ScrollBar/slots/index.js +1 -0
- package/components/ScrollBar/types.d.ts +43 -1
- package/components/areas/components/AreasAdmin/AreasAdmin.js +1 -1
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/AreaGridLayout/index.js +1 -1
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/index.js +7 -3
- package/components/areas/contexts/AreasContext/helpers/generateModuleCount.d.ts +9 -0
- package/components/areas/contexts/AreasContext/helpers/generateModuleCount.js +16 -0
- package/components/areas/contexts/AreasContext/{helper.d.ts → helpers/helper.d.ts} +3 -3
- package/components/areas/contexts/AreasContext/{helper.js → helpers/helper.js} +5 -5
- package/components/areas/contexts/AreasContext/index.js +3 -2
- package/components/areas/contexts/AreasContext/store.js +13 -11
- package/components/areas/contexts/AreasContext/tests/Store.test.d.ts +1 -0
- package/components/areas/types.d.ts +5 -0
- package/components/index.d.ts +1 -1
- package/index.js +1 -1
- package/package.json +2 -2
- package/components/ScrollBar/classes/constants.d.ts +0 -1
- package/components/ScrollBar/classes/constants.js +0 -4
- package/components/ScrollBar/classes/index.d.ts +0 -9
- package/components/ScrollBar/classes/index.js +0 -23
- package/components/ScrollBar/classes/types.d.ts +0 -6
- package/components/ScrollBar/index.js +0 -17
- package/components/ScrollBar/styles.d.ts +0 -3
- package/components/ScrollBar/styles.js +0 -46
- /package/components/areas/contexts/AreasContext/{index.test.d.ts → tests/AreasProvider.test.d.ts} +0 -0
package/@types/types.d.ts
CHANGED
|
@@ -144,6 +144,7 @@ import { MenuDividerOwnerState, MenuDividerSlotsType } from '../components/mui_e
|
|
|
144
144
|
import { NavLinkOwnerState, NavLinkSlotsType } from '../components/mui_extended/NavLink/types';
|
|
145
145
|
|
|
146
146
|
import { RHFSelectSlotsType, RHFSelectOwnerState } from '../components/hook-form/RHFSelect/types';
|
|
147
|
+
import { ScrollBarSlotsType, ScrollBarOwnerState } from '../components/ScrollBar/types';
|
|
147
148
|
import { StackOwnerState, StackSlotsType } from '../components/mui_extended/Stack/types';
|
|
148
149
|
import { RHFCheckBoxOwnerState, RHFCheckBoxSlotsType } from '../components/hook-form/RHFCheckbox/types';
|
|
149
150
|
import { AreasAdminOwnerState, AreasAdminType } from '../components/areas/components/AreasAdmin/types';
|
|
@@ -210,6 +211,7 @@ declare module '@mui/material/styles' {
|
|
|
210
211
|
M4LMenuDivider: MenuDividerSlotsType;
|
|
211
212
|
M4LNavLink: NavLinkSlotsType;
|
|
212
213
|
M4LRHFSelect: RHFSelectSlotsType;
|
|
214
|
+
M4LScrollBar: ScrollBarSlotsType;
|
|
213
215
|
M4LAreasAdmin: AreasAdminType;
|
|
214
216
|
M4LStack: StackSlotsType;
|
|
215
217
|
M4LDateTimePicker: DateTimePickerSlotsType;
|
|
@@ -274,6 +276,7 @@ declare module '@mui/material/styles' {
|
|
|
274
276
|
M4LMenuDivider: Partial<MenuDividerOwnerState>;
|
|
275
277
|
M4LNavLink: Partial<NavLinkOwnerState>;
|
|
276
278
|
M4LRHFSelect: Partial<RHFSelectOwnerState>;
|
|
279
|
+
M4LScrollBar: Partial<ScrollBarOwnerState>;
|
|
277
280
|
M4LAreasAdmin: Partial<AreasAdminOwnerState>;
|
|
278
281
|
M4LStack: Partial<StackOwnerState>;
|
|
279
282
|
M4LDateTimePicker: Partial<DateTimePickerOwnerState>;
|
|
@@ -562,6 +565,10 @@ declare module '@mui/material/styles' {
|
|
|
562
565
|
styleOverrides?: ComponentsOverrides<Theme>['M4LRHFSelect'];
|
|
563
566
|
variants?: ComponentsVariants['M4LRHFSelect'];
|
|
564
567
|
};
|
|
568
|
+
M4LScrollBar?: {
|
|
569
|
+
defaultProps?: ComponentsPropsList['M4LScrollBar'];
|
|
570
|
+
styleOverrides?: ComponentsOverrides<Theme>['M4LScrollBar'];
|
|
571
|
+
variants?: ComponentsVariants['M4LScrollBar'];
|
|
565
572
|
M4LAreasAdmin?: {
|
|
566
573
|
defaultProps?: ComponentsPropsList['M4LAreasAdmin'];
|
|
567
574
|
styleOverrides?: ComponentsOverrides<Theme>['M4LAreasAdmin'];
|
|
@@ -583,5 +590,6 @@ declare module '@mui/material/styles' {
|
|
|
583
590
|
styleOverrides?: ComponentsOverrides<Theme>['M4LDivider'];
|
|
584
591
|
variants?: ComponentsVariants['M4LDivider'];
|
|
585
592
|
};
|
|
593
|
+
}
|
|
586
594
|
}
|
|
587
595
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { S as ScrollBar } from "../../../ScrollBar/
|
|
2
|
+
import { S as ScrollBar } from "../../../ScrollBar/ScrollBar.js";
|
|
3
3
|
import { u as useAppliedFilters } from "./useAppliedFilters.js";
|
|
4
4
|
import { g as AppliedFiltersStyled, h as AppliedFilterInnerContainerStyled } from "../../slots/dynamicFilterSlots.js";
|
|
5
5
|
import { A as AppliedFilterChip } from "../AppliedFilterChip/AppliedFilterChip.js";
|
|
@@ -3,7 +3,7 @@ import { useState, useEffect } from "react";
|
|
|
3
3
|
import { useNetwork } from "@m4l/core";
|
|
4
4
|
import { useHostTheme } from "@m4l/graphics";
|
|
5
5
|
import ReactJson from "@microlink/react-json-view";
|
|
6
|
-
import { S as ScrollBar } from "../../../ScrollBar/
|
|
6
|
+
import { S as ScrollBar } from "../../../ScrollBar/ScrollBar.js";
|
|
7
7
|
function DetailDialog(props) {
|
|
8
8
|
const { log_id } = props;
|
|
9
9
|
const { networkOperation } = useNetwork();
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Box } from "@mui/material";
|
|
3
|
+
import { useIsMobile } from "@m4l/graphics";
|
|
4
|
+
import clsx from "clsx";
|
|
5
|
+
import { c as classScrollRoot, S as SCROLL_KEY_COMPONENT } from "./constants.js";
|
|
6
|
+
import { g as getPropDataTestId } from "../../test/getNameDataTestId.js";
|
|
7
|
+
import { R as RootScrollBar, S as SimpleBarStyled } from "./slots/ScrollBarSlots.js";
|
|
8
|
+
import { S as ScrollBarSlots } from "./slots/ScrollBarEnum.js";
|
|
9
|
+
function ScrollBar(props) {
|
|
10
|
+
const {
|
|
11
|
+
orientation,
|
|
12
|
+
children,
|
|
13
|
+
className,
|
|
14
|
+
dataTestId
|
|
15
|
+
} = props;
|
|
16
|
+
const isMobile = useIsMobile();
|
|
17
|
+
const ownerState = {
|
|
18
|
+
orientation,
|
|
19
|
+
children
|
|
20
|
+
};
|
|
21
|
+
if (isMobile) {
|
|
22
|
+
return /* @__PURE__ */ jsx(Box, { sx: { overflowX: "auto", width: "100%" }, children });
|
|
23
|
+
}
|
|
24
|
+
return /* @__PURE__ */ jsx(
|
|
25
|
+
RootScrollBar,
|
|
26
|
+
{
|
|
27
|
+
ownerState: { ...ownerState },
|
|
28
|
+
id: "RootStyle",
|
|
29
|
+
className: clsx(classScrollRoot, className),
|
|
30
|
+
...getPropDataTestId(SCROLL_KEY_COMPONENT, ScrollBarSlots.root, dataTestId),
|
|
31
|
+
children: /* @__PURE__ */ jsx(
|
|
32
|
+
SimpleBarStyled,
|
|
33
|
+
{
|
|
34
|
+
orientation: props.orientation,
|
|
35
|
+
autoHide: false,
|
|
36
|
+
ownerState: {},
|
|
37
|
+
className: "simplebar",
|
|
38
|
+
children
|
|
39
|
+
}
|
|
40
|
+
)
|
|
41
|
+
}
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
export {
|
|
45
|
+
ScrollBar as S
|
|
46
|
+
};
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import "simplebar-react/dist/simplebar.min.css";
|
|
2
|
+
const scrollBarStyles = {
|
|
3
|
+
/**
|
|
4
|
+
* 👾 Estilos para el Componente ScrollBar 👾
|
|
5
|
+
*/
|
|
6
|
+
root: ({ theme }) => ({
|
|
7
|
+
flexGrow: "1",
|
|
8
|
+
width: "100%",
|
|
9
|
+
height: "100%",
|
|
10
|
+
overflow: "hidden",
|
|
11
|
+
minHeight: "inherit",
|
|
12
|
+
"& .simplebar-scrollbar.simplebar-visible:before": {
|
|
13
|
+
opacity: "1"
|
|
14
|
+
},
|
|
15
|
+
'& .simplebar-content-wrapper[style*="overflow: hidden scroll;"] .simplebar-content': {},
|
|
16
|
+
'& .simplebar-content-wrapper[style*="overflow: scroll hidden;"] .simplebar-content': {
|
|
17
|
+
marginBottom: "9px"
|
|
18
|
+
},
|
|
19
|
+
"& .simplebar-track.simplebar-horizontal .simplebar-scrollbar:before": {
|
|
20
|
+
backgroundColor: theme.vars.palette.default.focusOpacity,
|
|
21
|
+
borderRadius: "2px",
|
|
22
|
+
height: "5px"
|
|
23
|
+
},
|
|
24
|
+
"& .simplebar-track.simplebar-vertical .simplebar-scrollbar:before": {
|
|
25
|
+
background: theme.vars.palette.general.scrollBar,
|
|
26
|
+
borderRadius: "2px"
|
|
27
|
+
}
|
|
28
|
+
}),
|
|
29
|
+
/**
|
|
30
|
+
* 👾 Estilos para el Componente ScrollBar 👾
|
|
31
|
+
*/
|
|
32
|
+
scrollBar: () => ({
|
|
33
|
+
height: "100%",
|
|
34
|
+
"& .simplebar-scrollbar": {
|
|
35
|
+
"&:before": {
|
|
36
|
+
// backgroundColor: alpha(theme.colorSchemes.finalTheme.palette.grey[600], 0.48),
|
|
37
|
+
},
|
|
38
|
+
"&.simplebar-visible:before": {
|
|
39
|
+
opacity: 1
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"& .simplebar-track.simplebar-vertical": {
|
|
43
|
+
width: 10
|
|
44
|
+
},
|
|
45
|
+
"& .simplebar-track.simplebar-horizontal .simplebar-scrollbar": {
|
|
46
|
+
height: 6
|
|
47
|
+
},
|
|
48
|
+
"& .simplebar-mask": {
|
|
49
|
+
zIndex: "inherit"
|
|
50
|
+
},
|
|
51
|
+
"& .simplebar-content": {
|
|
52
|
+
display: "flex",
|
|
53
|
+
flexDirection: "column",
|
|
54
|
+
height: "100%"
|
|
55
|
+
},
|
|
56
|
+
'& .simplebar-content-wrapper[style*="overflow: hidden scroll;"] ': {
|
|
57
|
+
"& .simplebar-content": {
|
|
58
|
+
marginRight: "12px"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
})
|
|
62
|
+
};
|
|
63
|
+
export {
|
|
64
|
+
scrollBarStyles as s
|
|
65
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const RootScrollBar: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Partial<import('../types').ScrollBarProps> & Record<string, unknown> & {
|
|
2
|
+
ownerState: Partial<import('../types').ScrollBarProps> & Record<string, unknown>;
|
|
3
|
+
}, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').HTMLAttributes<HTMLDivElement> | keyof import('react').ClassAttributes<HTMLDivElement>>, {}>;
|
|
4
|
+
export declare const SimpleBarStyled: import('@emotion/styled').StyledComponent<Pick<import('simplebar-react').Props & import('react').RefAttributes<import('simplebar-core').default | null>, keyof import('simplebar-react').Props | keyof import('react').RefAttributes<import('simplebar-core').default | null>> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Partial<import('../types').ScrollBarProps> & Record<string, unknown> & {
|
|
5
|
+
ownerState: Partial<import('../types').ScrollBarProps> & Record<string, unknown>;
|
|
6
|
+
}, {}, {}>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { styled } from "@mui/material/styles";
|
|
2
|
+
import SimpleBarReact from "simplebar-react";
|
|
3
|
+
import { S as SCROLL_KEY_COMPONENT } from "../constants.js";
|
|
4
|
+
import { S as ScrollBarSlots } from "./ScrollBarEnum.js";
|
|
5
|
+
import { s as scrollBarStyles } from "../ScrollBar.styles.js";
|
|
6
|
+
const RootScrollBar = styled("div", {
|
|
7
|
+
name: SCROLL_KEY_COMPONENT,
|
|
8
|
+
slot: ScrollBarSlots.root
|
|
9
|
+
})(scrollBarStyles?.root);
|
|
10
|
+
const SimpleBarStyled = styled(SimpleBarReact, {
|
|
11
|
+
name: SCROLL_KEY_COMPONENT,
|
|
12
|
+
slot: ScrollBarSlots.scrollBar
|
|
13
|
+
})(scrollBarStyles?.scrollBar);
|
|
14
|
+
export {
|
|
15
|
+
RootScrollBar as R,
|
|
16
|
+
SimpleBarStyled as S
|
|
17
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -1,7 +1,49 @@
|
|
|
1
|
-
import { SxProps } from '@mui/material';
|
|
1
|
+
import { SxProps, Theme } from '@mui/material';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import { Props as SimpleProps } from 'simplebar-react';
|
|
4
|
+
import { SCROLL_KEY_COMPONENT } from './constants';
|
|
5
|
+
import { OverridesStyleRules } from '@mui/material/styles/overrides';
|
|
6
|
+
import { ScrollBarSlots } from './slots';
|
|
7
|
+
/**
|
|
8
|
+
* Props for the ScrollBar component.
|
|
9
|
+
*/
|
|
4
10
|
export interface ScrollBarProps extends SimpleProps {
|
|
11
|
+
/**
|
|
12
|
+
* The content of the ScrollBar.
|
|
13
|
+
*/
|
|
5
14
|
children: ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* The system prop that allows defining system overrides as well as additional CSS styles.
|
|
17
|
+
*/
|
|
6
18
|
sx?: SxProps;
|
|
19
|
+
/**
|
|
20
|
+
* The orientation of the ScrollBar.
|
|
21
|
+
* @default 'vertical'
|
|
22
|
+
*/
|
|
23
|
+
orientation?: 'vertical' | 'horizontal';
|
|
24
|
+
/**
|
|
25
|
+
* The class name of the ScrollBar.
|
|
26
|
+
*/
|
|
27
|
+
className?: string;
|
|
28
|
+
/**
|
|
29
|
+
* The data-testid attribute for testing purposes.
|
|
30
|
+
*/
|
|
31
|
+
dataTestId?: string;
|
|
7
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* The owner state for the ScrollBar component.
|
|
35
|
+
*/
|
|
36
|
+
export type ownerState = ScrollBarProps;
|
|
37
|
+
/**
|
|
38
|
+
* The owner state for the ScrollBar component.
|
|
39
|
+
* @deprecated This type is redundant and can be removed.
|
|
40
|
+
*/
|
|
41
|
+
export type ScrollBarOwnerState = ScrollBarProps & {};
|
|
42
|
+
/**
|
|
43
|
+
* The type for the ScrollBar slots.
|
|
44
|
+
*/
|
|
45
|
+
export type ScrollBarSlotsType = keyof typeof ScrollBarSlots;
|
|
46
|
+
/**
|
|
47
|
+
* The styles for the ScrollBar component.
|
|
48
|
+
*/
|
|
49
|
+
export type ScrollBarStyles = OverridesStyleRules<ScrollBarSlots, typeof SCROLL_KEY_COMPONENT, Theme>;
|
|
@@ -5,7 +5,6 @@ import clsx from "clsx";
|
|
|
5
5
|
import { A as AreaChip } from "./subcomponents/AreaChip/AreaChip.js";
|
|
6
6
|
import { shallow } from "zustand/shallow";
|
|
7
7
|
import { I as ICONS } from "../../icons.js";
|
|
8
|
-
import { S as ScrollBar } from "../../../ScrollBar/index.js";
|
|
9
8
|
import { A as AreaChipMobile } from "./subcomponents/AreaChipMobile/AreaChipMobile.js";
|
|
10
9
|
import { useRef } from "react";
|
|
11
10
|
import { g as getAreasDictionary, A as AREAS_DICCTIONARY } from "../../dictionary.js";
|
|
@@ -14,6 +13,7 @@ import { useIsMobile } from "@m4l/graphics";
|
|
|
14
13
|
import { A as AREAS_ADMIN_KEY_COMPONENT } from "./constants.js";
|
|
15
14
|
import { a as getComponentSlotRoot } from "../../../../utils/getComponentSlotRoot.js";
|
|
16
15
|
import { g as getPropDataTestId } from "../../../../test/getNameDataTestId.js";
|
|
16
|
+
import { S as ScrollBar } from "../../../ScrollBar/ScrollBar.js";
|
|
17
17
|
import { u as useComponentSize } from "../../../../hooks/useComponentSize/useComponentSize.js";
|
|
18
18
|
import { T as Typography } from "../../../mui_extended/Typography/Typography.js";
|
|
19
19
|
import { A as AreasAdminSlots } from "./slots/AreasAdminEnum.js";
|
|
@@ -4,7 +4,7 @@ import { W as Window } from "../Window/index.js";
|
|
|
4
4
|
import { u as useAreasStore } from "../../../../../../hooks/useAreas/index.js";
|
|
5
5
|
import { a as areasViewerClasses } from "../../../../classes/index.js";
|
|
6
6
|
import clsx from "clsx";
|
|
7
|
-
import { R as RESPONSIVE_COLAPSED_HEIGHTS, a as RESPONSIVE_ROW_HEIGHTS, M as MARGIN_GRIDLAYOUT, P as PADDING_GRIDLAYOUT } from "../../../../../../contexts/AreasContext/helper.js";
|
|
7
|
+
import { R as RESPONSIVE_COLAPSED_HEIGHTS, a as RESPONSIVE_ROW_HEIGHTS, M as MARGIN_GRIDLAYOUT, P as PADDING_GRIDLAYOUT } from "../../../../../../contexts/AreasContext/helpers/helper.js";
|
|
8
8
|
import { w as withSizeProvider } from "../../../../../../../GridLayout/subcomponents/withSizeProvider/index.js";
|
|
9
9
|
import { R as Responsive } from "../../../../../../../GridLayout/subcomponents/Responsive/index.js";
|
|
10
10
|
const ResponsiveGridLayout = withSizeProvider(Responsive);
|
|
@@ -18,7 +18,7 @@ import { I as IconButton } from "../../../../../../../../../mui_extended/IconBut
|
|
|
18
18
|
import { I as Icon } from "../../../../../../../../../Icon/Icon.js";
|
|
19
19
|
function Header(props) {
|
|
20
20
|
const { areaId, windowId, emergeType } = props;
|
|
21
|
-
const [url_icon, title, moduleActions, onClose, version, windowOptions, fnQueryClose] = useAreasStore((state) => {
|
|
21
|
+
const [url_icon, title, moduleActions, onClose, version, windowOptions, fnQueryClose, moduleCount] = useAreasStore((state) => {
|
|
22
22
|
const window = state.hashWindows[windowId];
|
|
23
23
|
return [
|
|
24
24
|
window.iconUrl,
|
|
@@ -27,7 +27,8 @@ function Header(props) {
|
|
|
27
27
|
window.onClose,
|
|
28
28
|
window.version,
|
|
29
29
|
window.windowOptions,
|
|
30
|
-
window.fnQueryClose
|
|
30
|
+
window.fnQueryClose,
|
|
31
|
+
window.moduleCount
|
|
31
32
|
];
|
|
32
33
|
}, shallow);
|
|
33
34
|
const { saveModuleCookies, resetModuleCookies } = useAreasStore(
|
|
@@ -88,7 +89,10 @@ function Header(props) {
|
|
|
88
89
|
/* @__PURE__ */ jsx(LinearProgressIndeterminate, {}),
|
|
89
90
|
/* @__PURE__ */ jsxs("div", { className: areasViewerClasses.windowHeaderContent, children: [
|
|
90
91
|
/* @__PURE__ */ jsx(Icon, { src: url_icon, size: "medium" }),
|
|
91
|
-
/* @__PURE__ */
|
|
92
|
+
/* @__PURE__ */ jsxs(Typography, { className: areasViewerClasses.windowHeaderTitle, variant: "h5", children: [
|
|
93
|
+
title,
|
|
94
|
+
moduleCount ? `:${moduleCount}` : null
|
|
95
|
+
] }),
|
|
92
96
|
/* @__PURE__ */ jsxs("div", { className: areasViewerClasses.windowHeaderCancelHandle, children: [
|
|
93
97
|
!collapsed && /* @__PURE__ */ jsx(MainActions, { windowId }),
|
|
94
98
|
!collapsed && menuActions.length > 0 && /* @__PURE__ */ jsx(
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { WindowStateProps } from '../../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Función que genera un string con el número de módulos repetidos en una misma área.
|
|
4
|
+
* Esta función recibe un hash de ventanas y evalúa cada ventana para contar cuántas veces se repite un módulo en una misma área
|
|
5
|
+
* y genera un number que representa el 'moduleCount' de la ventana.
|
|
6
|
+
* @param hashWindows
|
|
7
|
+
* @returns number con el número de módulos repetidos en una mista area
|
|
8
|
+
*/
|
|
9
|
+
export declare const generateModuleCount: (areaId: string, moduleId: string, hashWindows: Record<string, WindowStateProps>) => number;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const generateModuleCount = (areaId, moduleId, hashWindows) => {
|
|
2
|
+
let moduleCount = 1;
|
|
3
|
+
const windows = Object.values(hashWindows);
|
|
4
|
+
const windowsInArea = windows.filter((window) => window.areaId === areaId);
|
|
5
|
+
const sameWindows = windowsInArea.filter((window) => window.moduleId === moduleId);
|
|
6
|
+
sameWindows.sort((a, b) => (a?.moduleCount ?? 0) - (b?.moduleCount ?? 0));
|
|
7
|
+
sameWindows.forEach((window) => {
|
|
8
|
+
if (window?.moduleCount === moduleCount) {
|
|
9
|
+
moduleCount++;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
return moduleCount;
|
|
13
|
+
};
|
|
14
|
+
export {
|
|
15
|
+
generateModuleCount as g
|
|
16
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { WritableDraft } from 'immer/dist/internal';
|
|
2
|
-
import { Area, AreasStateWithActions } from '
|
|
3
|
-
import { WindowState } from '
|
|
4
|
-
import { Layouts } from '
|
|
2
|
+
import { Area, AreasStateWithActions } from '../types';
|
|
3
|
+
import { WindowState } from '../../../types';
|
|
4
|
+
import { Layouts } from '../../../../GridLayout/types';
|
|
5
5
|
export declare const PADDING_GRIDLAYOUT = 11;
|
|
6
6
|
export declare const MARGIN_GRIDLAYOUT = 11;
|
|
7
7
|
export declare const DEBOUCED_SAVE_TIME = 500;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { u as useAreasViewerUtilityClasses } from "
|
|
2
|
-
import { u as useAreasAdminUtilityClasses } from "
|
|
3
|
-
import { c as createDynamicMFStore } from "
|
|
4
|
-
import { g as getAreasDictionary, A as AREAS_DICCTIONARY } from "
|
|
5
|
-
import { c as addLayoutItemToBreakPointIfNoExists } from "
|
|
1
|
+
import { u as useAreasViewerUtilityClasses } from "../../../components/AreasViewer/classes/index.js";
|
|
2
|
+
import { u as useAreasAdminUtilityClasses } from "../../../components/AreasAdmin/classes/index.js";
|
|
3
|
+
import { c as createDynamicMFStore } from "../../DynamicMFParmsContext/store.js";
|
|
4
|
+
import { g as getAreasDictionary, A as AREAS_DICCTIONARY } from "../../../dictionary.js";
|
|
5
|
+
import { c as addLayoutItemToBreakPointIfNoExists } from "../../../../GridLayout/subcomponents/Responsive/responsiveUtils.js";
|
|
6
6
|
const PADDING_GRIDLAYOUT = 11;
|
|
7
7
|
const MARGIN_GRIDLAYOUT = 11;
|
|
8
8
|
const DEBOUCED_SAVE_TIME = 500;
|
|
@@ -3,7 +3,7 @@ import { createContext, useRef, useCallback, useEffect } from "react";
|
|
|
3
3
|
import { useStore } from "zustand";
|
|
4
4
|
import { shallow } from "zustand/shallow";
|
|
5
5
|
import { useResponsiveDesktop, useFirstRender } from "@m4l/graphics";
|
|
6
|
-
import { useHostTools, useModuleDictionary, useNetwork, useModuleSkeleton, EmitEvents } from "@m4l/core";
|
|
6
|
+
import { useHostTools, useModuleDictionary, useNetwork, useModuleSkeleton, useFlagsStore, CommonFlags, EmitEvents } from "@m4l/core";
|
|
7
7
|
import { c as createAreasStore } from "./store.js";
|
|
8
8
|
const AreasContext = createContext(null);
|
|
9
9
|
function AreasProvider(props) {
|
|
@@ -14,6 +14,7 @@ function AreasProvider(props) {
|
|
|
14
14
|
const isDesktop = useResponsiveDesktop();
|
|
15
15
|
const isSkeleton = useModuleSkeleton();
|
|
16
16
|
const isFirstRender = useFirstRender([getLabel]);
|
|
17
|
+
const { addFlag } = useFlagsStore((state) => state.flagsActions);
|
|
17
18
|
const areasStoreRef = useRef();
|
|
18
19
|
if (!areasStoreRef.current) {
|
|
19
20
|
areasStoreRef.current = createAreasStore({
|
|
@@ -28,7 +29,6 @@ function AreasProvider(props) {
|
|
|
28
29
|
isSkeleton,
|
|
29
30
|
focus: false
|
|
30
31
|
}
|
|
31
|
-
// onLoad,
|
|
32
32
|
});
|
|
33
33
|
areasStoreRef.current?.getState().areasActions.init();
|
|
34
34
|
}
|
|
@@ -50,6 +50,7 @@ function AreasProvider(props) {
|
|
|
50
50
|
useEffect(() => {
|
|
51
51
|
if (status === "loaded") {
|
|
52
52
|
onLoad && onLoad();
|
|
53
|
+
addFlag(CommonFlags.FLAG_AREAS_LOADED);
|
|
53
54
|
}
|
|
54
55
|
}, [status]);
|
|
55
56
|
useEffect(() => {
|
|
@@ -3,10 +3,11 @@ import { devtools } from "zustand/middleware";
|
|
|
3
3
|
import { immer } from "zustand/middleware/immer";
|
|
4
4
|
import { u as useAreasViewerUtilityClasses } from "../../components/AreasViewer/classes/index.js";
|
|
5
5
|
import { u as useAreasAdminUtilityClasses } from "../../components/AreasAdmin/classes/index.js";
|
|
6
|
-
import { u as updateOwnerStateClasses, C as COOKIE_AREAS_ADMIN_CONTAINER_ID, b as COOKIE_AREAS_ADMIN_ID, D as DEFAULT_AREA, c as addArea, g as getSelectedAreaIdFromCookies, d as DEFAULT_WINDOW, a as RESPONSIVE_ROW_HEIGHTS, P as PADDING_GRIDLAYOUT, M as MARGIN_GRIDLAYOUT, N as NORMALIZED_COLS, e as deleteLayoutFromBreakPoints, f as COOKIE_WINDOWS, h as COOKIE_BREAKPOINT_LAYOUTS, i as DEBOUCED_SAVE_TIME, s as setColapsedLayoutBreakPoints, j as getDataFromResponse, k as getCookiesContainer } from "./helper.js";
|
|
6
|
+
import { u as updateOwnerStateClasses, C as COOKIE_AREAS_ADMIN_CONTAINER_ID, b as COOKIE_AREAS_ADMIN_ID, D as DEFAULT_AREA, c as addArea, g as getSelectedAreaIdFromCookies, d as DEFAULT_WINDOW, a as RESPONSIVE_ROW_HEIGHTS, P as PADDING_GRIDLAYOUT, M as MARGIN_GRIDLAYOUT, N as NORMALIZED_COLS, e as deleteLayoutFromBreakPoints, f as COOKIE_WINDOWS, h as COOKIE_BREAKPOINT_LAYOUTS, i as DEBOUCED_SAVE_TIME, s as setColapsedLayoutBreakPoints, j as getDataFromResponse, k as getCookiesContainer } from "./helpers/helper.js";
|
|
7
7
|
import { c as createDynamicMFStore } from "../DynamicMFParmsContext/store.js";
|
|
8
8
|
import cloneDeep from "lodash-es/cloneDeep";
|
|
9
9
|
import debounce from "lodash-es/debounce";
|
|
10
|
+
import { g as generateModuleCount } from "./helpers/generateModuleCount.js";
|
|
10
11
|
import { g as getCookie, s as setCookie, d as deleteCookie } from "../../../../helpers/cookies/cookies.js";
|
|
11
12
|
import { d as addLayoutItemToBreakPoints, e as cloneLayouts } from "../../../GridLayout/subcomponents/Responsive/responsiveUtils.js";
|
|
12
13
|
import { k as isEqualLayouts } from "../../../GridLayout/utils.js";
|
|
@@ -102,11 +103,7 @@ const createAreasStore = (initProps) => {
|
|
|
102
103
|
});
|
|
103
104
|
},
|
|
104
105
|
/**
|
|
105
|
-
*
|
|
106
|
-
* @createdAt 2024-12-30 14:36:06 - automatic
|
|
107
|
-
* @updatedAt 2025-01-29 16:33:53 - automatic
|
|
108
|
-
* @updatedUser cesar - automatic
|
|
109
|
-
* @author cesar - automatic
|
|
106
|
+
* Acción encargada de añadir un área de trabajo en blanco
|
|
110
107
|
*/
|
|
111
108
|
addArea: () => {
|
|
112
109
|
let newId = "";
|
|
@@ -160,11 +157,12 @@ const createAreasStore = (initProps) => {
|
|
|
160
157
|
delete state.hashWindows[key];
|
|
161
158
|
}
|
|
162
159
|
}
|
|
160
|
+
const indexDeleteArea = state.areasIds.findIndex((elementAreaId) => elementAreaId === areaId);
|
|
163
161
|
state.areasIds.splice(removeIndex, 1);
|
|
164
162
|
delete state.hashAreas[areaId];
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
163
|
+
if (state.currentAreaId === areaId) {
|
|
164
|
+
selectNewAreaId = state.areasIds[indexDeleteArea <= state.areasIds.length - 1 ? indexDeleteArea : state.areasIds.length - 1];
|
|
165
|
+
}
|
|
168
166
|
}
|
|
169
167
|
if (state.loadAreasFromNetwork) {
|
|
170
168
|
state.networkOperation({
|
|
@@ -264,6 +262,7 @@ const createAreasStore = (initProps) => {
|
|
|
264
262
|
addLayout: (areaId, windowId, newWindowProps) => {
|
|
265
263
|
let previousId = windowId;
|
|
266
264
|
const freeMove = newWindowProps.emergeType === "popup";
|
|
265
|
+
const moduleCount = generateModuleCount(get().currentAreaId, newWindowProps.moduleId, get().hashWindows);
|
|
267
266
|
const newLayoutItem = {
|
|
268
267
|
...newWindowProps.layoutProps,
|
|
269
268
|
i: windowId,
|
|
@@ -300,7 +299,8 @@ const createAreasStore = (initProps) => {
|
|
|
300
299
|
get().areaActions.closeLayout(areaId, removeLayoutId);
|
|
301
300
|
},
|
|
302
301
|
...DEFAULT_WINDOW,
|
|
303
|
-
dynamicMFStore
|
|
302
|
+
dynamicMFStore,
|
|
303
|
+
moduleCount
|
|
304
304
|
};
|
|
305
305
|
area.layoutItemsIds.push(windowId);
|
|
306
306
|
if (newWindowProps.emergeType === "layout") {
|
|
@@ -442,13 +442,15 @@ const createAreasStore = (initProps) => {
|
|
|
442
442
|
windowId
|
|
443
443
|
});
|
|
444
444
|
state.windowsModals.push(windowId);
|
|
445
|
+
const moduleCount = generateModuleCount(get().currentAreaId, newWindowModalProps.moduleId, get().hashWindows);
|
|
445
446
|
state.hashWindowsModals[windowId] = {
|
|
446
447
|
...newWindowModalProps,
|
|
447
448
|
areaId,
|
|
448
449
|
windowId,
|
|
449
450
|
...DEFAULT_WINDOW,
|
|
450
451
|
onClose: get().areaActions.closeWindowModal,
|
|
451
|
-
dynamicMFStore
|
|
452
|
+
dynamicMFStore,
|
|
453
|
+
moduleCount
|
|
452
454
|
};
|
|
453
455
|
state.hashWindows[windowId] = state.hashWindowsModals[windowId];
|
|
454
456
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -111,6 +111,11 @@ export type WindowState = {
|
|
|
111
111
|
* @updatedUser cesar - automatic
|
|
112
112
|
*/
|
|
113
113
|
fnQueryClose?: () => void;
|
|
114
|
+
/**
|
|
115
|
+
* moduleCount representa el identificador de
|
|
116
|
+
* la ventana cuando se repite un módulo en una misma área
|
|
117
|
+
*/
|
|
118
|
+
moduleCount?: number;
|
|
114
119
|
};
|
|
115
120
|
/**
|
|
116
121
|
* Opciones para la ventana.
|
package/components/index.d.ts
CHANGED
|
@@ -41,7 +41,7 @@ export * from './PropertyValue/PropertyValue';
|
|
|
41
41
|
export * from './MenuActions';
|
|
42
42
|
export type { MenuAction, ComponentActionProps } from './MenuActions/types';
|
|
43
43
|
export * from './extended/React-Resizable';
|
|
44
|
-
export * from './ScrollBar';
|
|
44
|
+
export * from './ScrollBar/ScrollBar';
|
|
45
45
|
export { ScrollToTop } from './ScrollToTop';
|
|
46
46
|
export * from './extended/React-Splitter/SplitLayout/SplitLayout';
|
|
47
47
|
export * from './ToastContainer';
|
package/index.js
CHANGED
|
@@ -130,7 +130,7 @@ import { a as a9 } from "./components/MenuActions/dictionary.js";
|
|
|
130
130
|
import { a as a10, M as M11 } from "./components/MenuActions/MenuActions.js";
|
|
131
131
|
import { R as R16 } from "./components/extended/React-Resizable/Resizable/Resizable.js";
|
|
132
132
|
import { R as R17 } from "./components/extended/React-Resizable/ResizableBox/ResizableBox.js";
|
|
133
|
-
import { S as S3 } from "./components/ScrollBar/
|
|
133
|
+
import { S as S3 } from "./components/ScrollBar/ScrollBar.js";
|
|
134
134
|
import { S as S4 } from "./components/extended/React-Splitter/SplitLayout/SplitLayout.js";
|
|
135
135
|
import { T as T3 } from "./components/ToastContainer/ToastContainer.js";
|
|
136
136
|
import { T as T4 } from "./components/ToastContainer/subcomponents/ToastMessage/ToastMessage.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m4l/components",
|
|
3
|
-
"version": "9.1.
|
|
3
|
+
"version": "9.1.96",
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"lint-staged": {
|
|
6
6
|
"*.{js,ts,tsx}": "eslint --fix --max-warnings 0"
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"zustand": "4.3.6"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@m4l/core": "^2.0.
|
|
56
|
+
"@m4l/core": "^2.0.18",
|
|
57
57
|
"@m4l/graphics": "^7.0.8",
|
|
58
58
|
"@m4l/styles": "^7.1.18",
|
|
59
59
|
"@mui/lab": "5.0.0-alpha.173",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const componentName = "M4LScrollBar";
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ScrollBarClassesType } from './types';
|
|
2
|
-
export declare const scrollBarClasses: ScrollBarClassesType;
|
|
3
|
-
export declare function getScrollBarUtilityClass(slot: string): string;
|
|
4
|
-
/**
|
|
5
|
-
* TODO: Documentar
|
|
6
|
-
*/
|
|
7
|
-
export declare const getScrollBarUtilityClasses: () => {
|
|
8
|
-
root: string;
|
|
9
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { generateUtilityClasses, generateUtilityClass } from "@mui/material";
|
|
2
|
-
import { unstable_composeClasses } from "@mui/base";
|
|
3
|
-
import { c as componentName } from "./constants.js";
|
|
4
|
-
generateUtilityClasses(componentName, [
|
|
5
|
-
/* elements */
|
|
6
|
-
"root"
|
|
7
|
-
/* states or variants of elements */
|
|
8
|
-
]);
|
|
9
|
-
function getScrollBarUtilityClass(slot) {
|
|
10
|
-
return generateUtilityClass(componentName, slot);
|
|
11
|
-
}
|
|
12
|
-
const getScrollBarUtilityClasses = () => {
|
|
13
|
-
const slots = {
|
|
14
|
-
root: ["root"]
|
|
15
|
-
};
|
|
16
|
-
const composedClasses = unstable_composeClasses(slots, getScrollBarUtilityClass, {});
|
|
17
|
-
return {
|
|
18
|
-
...composedClasses
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
export {
|
|
22
|
-
getScrollBarUtilityClasses as g
|
|
23
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Box } from "@mui/material";
|
|
3
|
-
import { R as RootStyle, S as SimpleBarStyle } from "./styles.js";
|
|
4
|
-
import { g as getScrollBarUtilityClasses } from "./classes/index.js";
|
|
5
|
-
function ScrollBar(props) {
|
|
6
|
-
const { children } = props;
|
|
7
|
-
const userAgent = typeof navigator === "undefined" ? "SSR" : navigator.userAgent;
|
|
8
|
-
const isMobile = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(userAgent);
|
|
9
|
-
if (isMobile) {
|
|
10
|
-
return /* @__PURE__ */ jsx(Box, { sx: { overflowX: "auto", width: "100%" }, children });
|
|
11
|
-
}
|
|
12
|
-
const classes = getScrollBarUtilityClasses();
|
|
13
|
-
return /* @__PURE__ */ jsx(RootStyle, { id: "RootStyle", className: classes.root, children: /* @__PURE__ */ jsx(SimpleBarStyle, { autoHide: false, children }) });
|
|
14
|
-
}
|
|
15
|
-
export {
|
|
16
|
-
ScrollBar as S
|
|
17
|
-
};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
export declare const RootStyle: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme>, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
2
|
-
export declare const SimpleBarStyle: import('@emotion/styled').StyledComponent<import('simplebar-react').Props & import('react').RefAttributes<import('simplebar-core').default | null> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme>, {}, {}>;
|
|
3
|
-
export declare const SimpleBarStyle2: import('@emotion/styled').StyledComponent<import('simplebar-react').Props & import('react').RefAttributes<import('simplebar-core').default | null> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme>, {}, {}>;
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { styled, alpha } from "@mui/material/styles";
|
|
2
|
-
import SimpleBarReact from "simplebar-react";
|
|
3
|
-
import "simplebar-react/dist/simplebar.min.css";
|
|
4
|
-
const RootStyle = styled("div")(({ theme }) => ({
|
|
5
|
-
flexGrow: "1",
|
|
6
|
-
height: "100%",
|
|
7
|
-
overflow: "hidden",
|
|
8
|
-
...theme.components?.M4LScrollBar?.styleOverrides || {}
|
|
9
|
-
}));
|
|
10
|
-
const SimpleBarStyle = styled(SimpleBarReact)`
|
|
11
|
-
height: 100%;
|
|
12
|
-
`;
|
|
13
|
-
styled(SimpleBarReact)(({ theme }) => ({
|
|
14
|
-
height: "100%",
|
|
15
|
-
"& .simplebar-scrollbar": {
|
|
16
|
-
"&:before": {
|
|
17
|
-
backgroundColor: alpha(theme.colorSchemes.finalTheme.palette.grey[600], 0.48)
|
|
18
|
-
},
|
|
19
|
-
"&.simplebar-visible:before": {
|
|
20
|
-
opacity: 1
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
"& .simplebar-track.simplebar-vertical": {
|
|
24
|
-
width: 10
|
|
25
|
-
},
|
|
26
|
-
"& .simplebar-track.simplebar-horizontal .simplebar-scrollbar": {
|
|
27
|
-
height: 6
|
|
28
|
-
},
|
|
29
|
-
"& .simplebar-mask": {
|
|
30
|
-
zIndex: "inherit"
|
|
31
|
-
},
|
|
32
|
-
"& .simplebar-content": {
|
|
33
|
-
display: "flex",
|
|
34
|
-
flexDirection: "column",
|
|
35
|
-
height: "100%"
|
|
36
|
-
},
|
|
37
|
-
'& .simplebar-content-wrapper[style*="overflow: hidden scroll;"] ': {
|
|
38
|
-
"& .simplebar-content": {
|
|
39
|
-
marginRight: "12px"
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}));
|
|
43
|
-
export {
|
|
44
|
-
RootStyle as R,
|
|
45
|
-
SimpleBarStyle as S
|
|
46
|
-
};
|
/package/components/areas/contexts/AreasContext/{index.test.d.ts → tests/AreasProvider.test.d.ts}
RENAMED
|
File without changes
|