@m4l/components 9.2.56-beta.2 → 9.2.56-beta.4

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.
Files changed (59) hide show
  1. package/.storybook/decorators/WithWindowsToolsContext/WithContextWindowTools.d.ts +5 -0
  2. package/components/DataGrid/DataGrid.js +8 -1
  3. package/components/DataGrid/Datagrid.styles.js +15 -3
  4. package/components/DataGrid/contexts/DataGridContext/index.js +39 -8
  5. package/components/DataGrid/contexts/DataGridContext/types.d.ts +1 -2
  6. package/components/DataGrid/dictionary.d.ts +2 -1
  7. package/components/DataGrid/dictionary.js +22 -21
  8. package/components/DataGrid/subcomponents/HeaderActions/index.js +4 -3
  9. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Density/index.js +5 -5
  10. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Filter/index.js +2 -2
  11. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/MobileMenuActions/index.d.ts +4 -1
  12. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/MobileMenuActions/index.js +3 -2
  13. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Settings/index.d.ts +2 -1
  14. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Settings/index.js +3 -2
  15. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Settings/subcomponents/ColumnsConfig/index.js +26 -26
  16. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Settings/subcomponents/ColumnsConfig/types.d.ts +2 -0
  17. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/Settings/types.d.ts +4 -0
  18. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/hooks/useModalSettings/index.d.ts +2 -1
  19. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/hooks/useModalSettings/index.js +3 -2
  20. package/components/DataGrid/subcomponents/HeaderActions/types.d.ts +1 -0
  21. package/components/DataGrid/types.d.ts +1 -1
  22. package/components/DynamicFilter/dictionary.d.ts +1 -0
  23. package/components/DynamicFilter/dictionary.js +2 -1
  24. package/components/DynamicFilter/types.d.ts +1 -1
  25. package/components/WindowBase/WindowBase.js +4 -1
  26. package/components/WindowBase/WindowBase.styles.js +54 -27
  27. package/components/WindowBase/subcomponents/Header/HeaderWindowBase.js +2 -0
  28. package/components/WindowBase/subcomponents/Header/types.d.ts +1 -1
  29. package/components/WindowBase/types.d.ts +6 -0
  30. package/components/areas/components/AreasViewer/AreasViewer.js +5 -2
  31. package/components/areas/components/AreasViewer/AreasViewer.styles.js +5 -3
  32. package/components/areas/components/AreasViewer/subcomponents/Area/Area.js +2 -2
  33. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/AreaGridLayout/AreaGridLayout.js +20 -4
  34. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/AreaGridLayout/types.d.ts +2 -0
  35. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/BaseArea/BaseArea.js +7 -2
  36. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/BaseArea/types.d.ts +2 -0
  37. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/Window.js +1 -0
  38. package/components/areas/components/AreasViewer/subcomponents/Area/types.d.ts +2 -0
  39. package/components/areas/components/AreasViewer/types.d.ts +5 -0
  40. package/components/areas/contexts/AreasContext/helpers/helper.d.ts +2 -9
  41. package/components/areas/contexts/AreasContext/helpers/helper.js +14 -16
  42. package/components/areas/contexts/AreasContext/store.js +3 -3
  43. package/components/formatters/BooleanFormatter/BooleanFormatter.styles.js +2 -2
  44. package/components/hook-form/RHFAutocompleteAsync/RHFAutocompleteAsync.d.ts +2 -1
  45. package/components/hook-form/RHFAutocompleteAsync/reducer/RHFAutocompleteReducer.js +2 -1
  46. package/components/mui_extended/Accordion/Accordion.js +1 -1
  47. package/components/mui_extended/Accordion/styles.js +12 -8
  48. package/components/mui_extended/Autocomplete/renderOptions/index.d.ts +3 -1
  49. package/components/mui_extended/Autocomplete/renderOptions/index.js +3 -2
  50. package/components/mui_extended/Tab/Tab.styles.js +3 -3
  51. package/components/mui_extended/TabContent/TabContent.js +2 -2
  52. package/components/mui_extended/TabContent/TabContent.styles.js +4 -2
  53. package/components/mui_extended/TabContent/types.d.ts +1 -0
  54. package/components/popups/components/PopupsViewer/PopupsViewer.styles.js +2 -2
  55. package/hooks/useDynamicFilterAndSort/icons.d.ts +2 -2
  56. package/hooks/useDynamicFilterAndSort/icons.js +2 -2
  57. package/hooks/useDynamicFilterAndSort/useDynamicFilterAndSort.js +15 -8
  58. package/package.json +3 -3
  59. package/components/DataGrid/subcomponents/HeaderActions/subcomponents/types.d.ts +0 -2
@@ -14,6 +14,7 @@ const WindowBase = (props) => {
14
14
  children,
15
15
  size = "medium",
16
16
  selected = false,
17
+ maximized,
17
18
  variant = "outlined",
18
19
  version,
19
20
  buildTime,
@@ -32,7 +33,8 @@ const WindowBase = (props) => {
32
33
  selected,
33
34
  variant,
34
35
  size: currentSize,
35
- type
36
+ type,
37
+ maximized
36
38
  };
37
39
  return /* @__PURE__ */ jsx(AppearanceComponentProvider, { defaultSize: currentSize, children: /* @__PURE__ */ jsxs(
38
40
  WindowBaseStyled,
@@ -51,6 +53,7 @@ const WindowBase = (props) => {
51
53
  size,
52
54
  variant,
53
55
  selected,
56
+ maximized,
54
57
  onClose,
55
58
  type,
56
59
  ...other
@@ -5,32 +5,59 @@ const windowBaseStyles = {
5
5
  * Styles for the window base wrapper component.
6
6
  */
7
7
  wrapperWindowBase: ({ theme, ownerState }) => ({
8
- position: "relative",
9
- height: "100%",
10
- width: "100%",
11
- display: "flex",
12
- flexDirection: "column",
13
- borderRadius: ownerState?.variant === "outlined" ? theme.vars.size.borderRadius.r2 : "unset",
14
- backgroundColor: theme.vars.palette.background.default,
15
- overflow: "hidden",
16
- ...ownerState?.variant === "outlined" && {
17
- ...ownerState?.selected ? {
18
- ...ownerState?.type === "layout" ? {
19
- background: `linear-gradient(to bottom,
20
- ${alpha(theme.palette.primary.opacity, 0.25)},
21
- ${alpha(theme.palette.primary.opacity, 0.1)})`,
22
- "&::before": {
23
- content: '""',
24
- position: "absolute",
25
- inset: "2px",
26
- background: theme.vars.palette.background.default,
27
- borderRadius: "6.7px"
8
+ "&": {
9
+ position: "relative",
10
+ height: "100%",
11
+ width: "100%",
12
+ display: "flex",
13
+ flexDirection: "column",
14
+ borderRadius: ownerState?.variant === "outlined" ? theme.vars.size.borderRadius.r2 : "unset",
15
+ backgroundColor: theme.vars.palette.background.default,
16
+ overflow: "hidden",
17
+ padding: ownerState?.maximized ? theme.vars.size.baseSpacings.sp3 : 0,
18
+ ...ownerState?.variant === "outlined" && {
19
+ ...ownerState?.selected ? {
20
+ ...ownerState?.type === "layout" ? {
21
+ background: `linear-gradient(to bottom,
22
+ ${alpha(theme.palette.primary.opacity, 0.25)},
23
+ ${alpha(theme.palette.primary.opacity, 0.1)})`,
24
+ "&::before": {
25
+ content: '""',
26
+ position: "absolute",
27
+ inset: "1px",
28
+ background: theme.vars.palette.background.default,
29
+ borderRadius: "6.7px"
30
+ }
31
+ } : {
32
+ boxShadow: `inset 0px 0px 0 1px ${theme.vars.palette?.border.main}`
28
33
  }
29
34
  } : {
30
- boxShadow: `inset 0px 0px 0 1.6px ${theme.vars.palette?.border.main}`
35
+ boxShadow: ownerState?.type === "layout" ? `inset 0px 0px 0 1px ${theme.vars.palette?.border.secondary}` : "unset"
31
36
  }
32
- } : {
33
- boxShadow: ownerState?.type === "popup" || ownerState?.type === "layout" ? `inset 0px 0px 0 1.6px ${theme.vars.palette?.border.default}` : "unset"
37
+ },
38
+ ...ownerState?.type === "popup" && {
39
+ "&&&": {
40
+ boxShadow: theme.vars.customShadows.z1,
41
+ border: `1px solid ${theme.vars.palette?.border.secondary}`,
42
+ borderRadius: theme.vars.size.borderRadius.r1,
43
+ ...ownerState?.selected && {
44
+ boxShadow: theme.vars.customShadows.z4,
45
+ border: `1px solid ${theme.vars.palette?.border.main}`
46
+ }
47
+ }
48
+ },
49
+ ...ownerState?.maximized && {
50
+ padding: theme.vars.size.baseSpacings.sp3,
51
+ paddingTop: theme.vars.size.baseSpacings.sp2,
52
+ paddingBottom: 0
53
+ },
54
+ ...ownerState?.type === "layout" && {
55
+ ...ownerState?.selected && {
56
+ boxShadow: theme.vars.customShadows.primary
57
+ }
58
+ },
59
+ ...ownerState?.type === "modal" && {
60
+ boxShadow: `${theme.vars.customShadows.z3}!important`
34
61
  }
35
62
  }
36
63
  }),
@@ -125,7 +152,7 @@ const windowBaseStyles = {
125
152
  */
126
153
  headerTitleWindowBase: ({ theme, ownerState }) => ({
127
154
  minWidth: "30px",
128
- ...ownerState?.selected && ownerState?.type !== "modal" && ownerState?.variant === "outlined" ? {
155
+ ...ownerState?.selected && ownerState?.type !== "modal" ? {
129
156
  color: `${theme.vars.palette["primary"].semanticText} !important`
130
157
  } : {
131
158
  color: `${theme.vars.palette.text.secondary} !important`
@@ -133,7 +160,7 @@ const windowBaseStyles = {
133
160
  whiteSpace: "nowrap",
134
161
  overflow: "hidden",
135
162
  textOverflow: "ellipsis",
136
- paddingLeft: theme.vars.size.baseSpacings.sp1,
163
+ paddingLeft: theme.vars.size.baseSpacings.sp2,
137
164
  userSelect: "none",
138
165
  cursor: "all-scroll"
139
166
  }),
@@ -158,7 +185,7 @@ const windowBaseStyles = {
158
185
  headerSubTitleWindowBase: ({ theme, ownerState }) => ({
159
186
  width: "auto !important",
160
187
  height: "auto !important",
161
- ...ownerState?.selected && ownerState?.type !== "modal" && ownerState?.variant === "outlined" ? {
188
+ ...ownerState?.selected && ownerState?.type !== "modal" ? {
162
189
  color: `${theme.vars.palette["primary"].semanticText} !important`
163
190
  } : {
164
191
  color: `${theme.vars.palette.text.secondary} !important`
@@ -174,7 +201,7 @@ const windowBaseStyles = {
174
201
  */
175
202
  headerIconWindowBase: ({ theme, ownerState }) => ({
176
203
  "& .M4LIcon-icon": {
177
- ...ownerState?.selected && ownerState?.type !== "modal" && ownerState?.variant === "outlined" ? {
204
+ ...ownerState?.selected && ownerState?.type !== "modal" ? {
178
205
  backgroundColor: `${theme.vars.palette["primary"].semanticText} !important`
179
206
  } : {
180
207
  backgroundColor: `${theme.vars.palette.text.secondary} !important`
@@ -16,6 +16,7 @@ const HeaderWindowBase = (props) => {
16
16
  iconUrl,
17
17
  size,
18
18
  selected,
19
+ maximized,
19
20
  version,
20
21
  buildTime,
21
22
  variant,
@@ -95,6 +96,7 @@ const HeaderWindowBase = (props) => {
95
96
  }, [insideActions, version, host_static_assets, environment_assets, buildTime, dateFormatter]);
96
97
  const ownerState = {
97
98
  selected,
99
+ maximized,
98
100
  variant,
99
101
  size,
100
102
  type
@@ -32,7 +32,7 @@ import { WindowBaseAction, WindowBaseProps } from '../../types';
32
32
  * - `selected` modifies the visual appearance to indicate the selected state.
33
33
  * @see WindowBaseProps - General properties for the window base.
34
34
  */
35
- export type HeaderProps = Pick<WindowBaseProps, 'title' | 'subTitle' | 'iconUrl' | 'onClose' | 'version' | 'selected' | 'variant' | 'type' | 'buildTime'> & {
35
+ export type HeaderProps = Pick<WindowBaseProps, 'title' | 'subTitle' | 'iconUrl' | 'onClose' | 'version' | 'selected' | 'variant' | 'type' | 'buildTime' | 'maximized'> & {
36
36
  actions?: WindowBaseAction[];
37
37
  };
38
38
  /**
@@ -122,6 +122,11 @@ export interface WindowBaseProps {
122
122
  * When `true`, the window may display a visual indicator to denote selection.
123
123
  */
124
124
  selected?: boolean;
125
+ /**
126
+ * Indicates if the window is maximized.
127
+ * When `true`, the window may display a visual indicator to denote maximization.
128
+ */
129
+ maximized?: boolean;
125
130
  /**
126
131
  * The version label for the window.
127
132
  * Useful for displaying version information (e.g., `1.0.0`) in the header or footer.
@@ -193,6 +198,7 @@ export type WindowBaseType = keyof typeof WindowBaseSlots;
193
198
  */
194
199
  export type WindowBaseOwnerState = Pick<WindowBaseProps, 'size'> & {
195
200
  selected?: WindowBaseProps['selected'];
201
+ maximized?: WindowBaseProps['maximized'];
196
202
  variant?: WindowBaseProps['variant'];
197
203
  size?: WindowBaseProps['size'];
198
204
  type?: WindowBaseProps['type'];
@@ -13,16 +13,19 @@ import { a as getComponentSlotRoot } from "../../../../utils/getComponentSlotRoo
13
13
  import { A as AreasViewerSlots } from "./slots/AreasViewerEnum.js";
14
14
  import clsx from "clsx";
15
15
  import { forwardRef } from "react";
16
+ import { u as useComponentSize } from "../../../../hooks/useComponentSize/useComponentSize.js";
16
17
  const AreasViewer = forwardRef((props, ref) => {
17
18
  const {
18
19
  dataTestId,
19
- className
20
+ className,
21
+ size
20
22
  } = props;
21
23
  const areas = useAreasStore((state) => state.areasIds, shallow);
22
24
  const windowsModals = useAreasStore((state) => state.windowsModalsIds);
23
25
  const currentArea = useAreasStore((state) => state.currentAreaId);
24
26
  const status = useAreasStore((state) => state.ownerState?.status);
25
27
  const { init } = useAreasStore((state) => state.areasActions);
28
+ const { currentSize } = useComponentSize(size);
26
29
  const ownerState = {
27
30
  selected: !!currentArea
28
31
  };
@@ -42,7 +45,7 @@ const AreasViewer = forwardRef((props, ref) => {
42
45
  )
43
46
  } : {},
44
47
  children: status === "loaded" ? areas.map((area) => {
45
- return /* @__PURE__ */ jsx(Area, { areaId: area, selected: currentArea === area }, area);
48
+ return /* @__PURE__ */ jsx(Area, { areaId: area, selected: currentArea === area, size: currentSize }, area);
46
49
  }) : /* @__PURE__ */ jsx(LoadingError, { status, action: () => init() })
47
50
  }
48
51
  ),
@@ -8,7 +8,7 @@ const areasViewerStyles = {
8
8
  height: "100%",
9
9
  overflow: "hidden",
10
10
  position: "relative",
11
- background: theme.vars.palette.background.default,
11
+ background: theme.vars.palette.background.base,
12
12
  // areaGridLayout
13
13
  "& .M4LAreasViewer-areaGridLayout": {
14
14
  height: "100% !important",
@@ -41,12 +41,14 @@ const areasViewerStyles = {
41
41
  /**
42
42
  * Inner for hooks Styles
43
43
  */
44
- baseArea: () => ({
44
+ baseArea: ({ theme, ownerState }) => ({
45
45
  display: "flex",
46
46
  flexDirection: "row",
47
47
  height: "100%",
48
48
  width: "100%",
49
- overflow: "hidden"
49
+ overflow: "hidden",
50
+ padding: theme.vars.size.baseSpacings.sp3,
51
+ ...ownerState?.maximizedId ? { padding: 0 } : {}
50
52
  }),
51
53
  /**
52
54
  * Wrapper window modal Styles
@@ -3,12 +3,12 @@ import { B as BaseArea } from "./subcomponents/BaseArea/BaseArea.js";
3
3
  import { u as useAreasStore } from "../../../../hooks/useAreas/index.js";
4
4
  import { a as AreaRootStyled } from "../../slots/AreasViewerSlots.js";
5
5
  const Area = (props) => {
6
- const { selected, areaId } = props;
6
+ const { selected, areaId, size } = props;
7
7
  const status = useAreasStore((state) => state.hashAreas[areaId].status);
8
8
  if (status === "init") {
9
9
  return null;
10
10
  }
11
- return /* @__PURE__ */ jsx(AreaRootStyled, { ownerState: { selected }, children: /* @__PURE__ */ jsx(BaseArea, { areaId }) });
11
+ return /* @__PURE__ */ jsx(AreaRootStyled, { ownerState: { selected }, children: /* @__PURE__ */ jsx(BaseArea, { areaId, size }) });
12
12
  };
13
13
  Area.displayName = "Area";
14
14
  export {
@@ -4,15 +4,17 @@ import { W as Window } from "../Window/Window.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 { P as PADDING_GRIDLAYOUT, M as MARGIN_GRIDLAYOUT, R as RESPONSIVE_ROW_HEIGHTS, a as RESPONSIVE_COLAPSED_HEIGHTS } from "../../../../../../contexts/AreasContext/helpers/helper.js";
7
+ import { P as PADDING_GRIDLAYOUT, M as MARGIN_GRIDLAYOUT, R as RESPONSIVE_ROW_HEIGHTS } from "../../../../../../contexts/AreasContext/helpers/helper.js";
8
8
  import { M as MemonizePopupsViewer } from "../../../../../../../popups/components/PopupsViewer/PopupsViewer.js";
9
- import { useState } from "react";
9
+ import { useState, useMemo } from "react";
10
10
  import { d as dragResizeWindowRNDClasses } from "../../../../../../../DragResizeWindowRND/classes/index.js";
11
+ import { useTheme } from "@mui/material";
12
+ import { u as useComponentSize } from "../../../../../../../../hooks/useComponentSize/useComponentSize.js";
11
13
  import { w as withSizeProvider } from "../../../../../../../GridLayout/subcomponents/withSizeProvider/index.js";
12
14
  import { R as Responsive } from "../../../../../../../GridLayout/subcomponents/Responsive/index.js";
13
15
  const ResponsiveGridLayout = withSizeProvider(Responsive);
14
16
  const AreaGridLayout = (props) => {
15
- const { areaId } = props;
17
+ const { areaId, size } = props;
16
18
  const hashLayoutItems = useAreasStore((state) => state.hashAreas[areaId].layoutItemsIds, shallow);
17
19
  const layouts = useAreasStore((state) => state.hashAreas[areaId].layouts, shallow);
18
20
  const breakpoints = useAreasStore((state) => state.hashAreas[areaId].breakpoints, shallow);
@@ -22,6 +24,8 @@ const AreaGridLayout = (props) => {
22
24
  (state) => state.areaActions,
23
25
  shallow
24
26
  );
27
+ const theme = useTheme();
28
+ const { currentSize } = useComponentSize(size);
25
29
  const [gridLayouContainer, setGridLayouContainer] = useState(void 0);
26
30
  const onResizeStart = () => {
27
31
  if (gridLayouContainer) {
@@ -48,6 +52,18 @@ const AreaGridLayout = (props) => {
48
52
  setGridLayouContainer(nodeElement);
49
53
  }
50
54
  };
55
+ const RESPONSIVE_HEIGHT_VALUES = useMemo(() => {
56
+ const dynamicHeight = theme?.size?.[theme?.generalSettings?.isMobile ? "mobile" : "desktop"]?.[currentSize]?.container;
57
+ const parsedHeight = parseInt(dynamicHeight);
58
+ const safeHeight = isNaN(parsedHeight) ? 32 : parsedHeight;
59
+ return {
60
+ xxs: safeHeight,
61
+ xs: safeHeight,
62
+ sm: safeHeight,
63
+ md: safeHeight,
64
+ lg: safeHeight
65
+ };
66
+ }, [theme, currentSize]);
51
67
  return /* @__PURE__ */ jsx(
52
68
  ResponsiveGridLayout,
53
69
  {
@@ -74,7 +90,7 @@ const AreaGridLayout = (props) => {
74
90
  return /* @__PURE__ */ jsx(Window, { windowId: p.i, areaId });
75
91
  },
76
92
  breakpoints,
77
- colapsedHeight: RESPONSIVE_COLAPSED_HEIGHTS,
93
+ colapsedHeight: RESPONSIVE_HEIGHT_VALUES,
78
94
  rowHeight: RESPONSIVE_ROW_HEIGHTS,
79
95
  cols,
80
96
  containerMargin: [MARGIN_GRIDLAYOUT, MARGIN_GRIDLAYOUT],
@@ -1,3 +1,5 @@
1
+ import { AreasViewerProps } from '../../../../types';
1
2
  export type GridLayoutProps = {
2
3
  areaId: string;
4
+ size: AreasViewerProps['size'];
3
5
  };
@@ -3,10 +3,15 @@ import { A as AreaGridLayout } from "../AreaGridLayout/AreaGridLayout.js";
3
3
  import { u as useAreasStore } from "../../../../../../hooks/useAreas/index.js";
4
4
  import { L as LoadingError } from "../../../../../../../LoadingError/LoadingError.js";
5
5
  import { B as BaseAreaStyled } from "../../../../slots/AreasViewerSlots.js";
6
+ import { shallow } from "zustand/shallow";
6
7
  const BaseArea = (props) => {
7
- const { areaId } = props;
8
+ const { areaId, size } = props;
8
9
  const status = useAreasStore((state) => state.hashAreas[areaId].status);
9
- return /* @__PURE__ */ jsx(BaseAreaStyled, { children: status === "loaded" ? /* @__PURE__ */ jsx(AreaGridLayout, { areaId }) : /* @__PURE__ */ jsx(LoadingError, { status, action: () => {
10
+ const maximizedId = useAreasStore(
11
+ (state) => areaId ? state.hashAreas[areaId]?.maximizedId : void 0,
12
+ shallow
13
+ );
14
+ return /* @__PURE__ */ jsx(BaseAreaStyled, { ownerState: { maximizedId }, children: status === "loaded" ? /* @__PURE__ */ jsx(AreaGridLayout, { areaId, size }) : /* @__PURE__ */ jsx(LoadingError, { status, action: () => {
10
15
  } }) });
11
16
  };
12
17
  export {
@@ -1,3 +1,5 @@
1
+ import { AreasViewerProps } from '../../../../types';
1
2
  export type InnerForHooksProps = {
2
3
  areaId: string;
4
+ size: AreasViewerProps['size'];
3
5
  };
@@ -49,6 +49,7 @@ const Window = (props) => {
49
49
  actions: memoizedActions,
50
50
  windowId,
51
51
  selected,
52
+ maximized: !!maximizedId,
52
53
  onMouseDown: onTouch,
53
54
  type: emergeType,
54
55
  variant: maximizedId ? "text" : "outlined",
@@ -1,4 +1,6 @@
1
+ import { AreasViewerProps } from '../../types';
1
2
  export type AreaProps = {
2
3
  areaId: string;
3
4
  selected: boolean;
5
+ size: AreasViewerProps['size'];
4
6
  };
@@ -3,6 +3,7 @@ import { AreasViewerSlots } from './slots/AreasViewerEnum';
3
3
  import { Theme } from '@mui/material';
4
4
  import { AREAS_VIEWER_KEY_COMPONENT } from './constants';
5
5
  import { AreaProps } from './subcomponents/Area/types';
6
+ import { Sizes } from '@m4l/styles';
6
7
  export type AreasViewerType = keyof typeof AreasViewerSlots;
7
8
  export interface AreasViewerProps {
8
9
  /**
@@ -13,6 +14,10 @@ export interface AreasViewerProps {
13
14
  * Clase CSS para sobrescribir los estilos predeterminados.
14
15
  */
15
16
  className?: string;
17
+ /**
18
+ * Tamaño del componente.
19
+ */
20
+ size?: Extract<Sizes, 'small' | 'medium'>;
16
21
  /**
17
22
  * Props adicionales que se pueden pasar.
18
23
  */
@@ -2,8 +2,8 @@ import { WritableDraft } from 'immer/dist/internal';
2
2
  import { Area, AreasStoreStateWithActions } from '../types';
3
3
  import { WindowState } from '../../../types';
4
4
  import { Layouts } from '../../../../GridLayout/types';
5
- export declare const PADDING_GRIDLAYOUT = 11;
6
- export declare const MARGIN_GRIDLAYOUT = 11;
5
+ export declare const PADDING_GRIDLAYOUT = 0;
6
+ export declare const MARGIN_GRIDLAYOUT = 10;
7
7
  export declare const DEBOUCED_SAVE_TIME = 500;
8
8
  export declare const THROTTLE_RESIZE_TIME = 300;
9
9
  export declare const COOKIE_AREAS_ADMIN_CONTAINER_ID = "areas";
@@ -32,13 +32,6 @@ export declare const DEFAULT_LAYOUTS: {
32
32
  xs: never[];
33
33
  xxs: never[];
34
34
  };
35
- export declare const RESPONSIVE_COLAPSED_HEIGHTS: {
36
- xxs: number;
37
- xs: number;
38
- sm: number;
39
- md: number;
40
- lg: number;
41
- };
42
35
  export declare const RESPONSIVE_ROW_HEIGHTS: {
43
36
  xxs: number;
44
37
  xs: number;
@@ -1,8 +1,8 @@
1
1
  import { c as createDynamicMFStore } from "../../../../WindowBase/contexts/DynamicMFParmsContext/store.js";
2
2
  import { g as getAreasDictionary, A as AREAS_DICCTIONARY } from "../../../dictionary.js";
3
3
  import { c as addLayoutItemToBreakPointIfNoExists } from "../../../../GridLayout/subcomponents/Responsive/responsiveUtils.js";
4
- const PADDING_GRIDLAYOUT = 11;
5
- const MARGIN_GRIDLAYOUT = 11;
4
+ const PADDING_GRIDLAYOUT = 0;
5
+ const MARGIN_GRIDLAYOUT = 10;
6
6
  const DEBOUCED_SAVE_TIME = 500;
7
7
  const COOKIE_AREAS_ADMIN_CONTAINER_ID = "areas";
8
8
  const COOKIE_AREAS_ADMIN_ID = "admin";
@@ -12,8 +12,7 @@ const COOKIE_WINDOW_SELECTED = "windowSelected";
12
12
  const BREAKPOINT_SIZES = { lg: 1200, md: 996, sm: 768, xs: 480, xxs: 1 };
13
13
  const NORMALIZED_COLS = { lg: 64, md: 48, sm: 32, xs: 24, xxs: 1 };
14
14
  const DEFAULT_LAYOUTS = { lg: [], md: [], sm: [], xs: [], xxs: [] };
15
- const RESPONSIVE_COLAPSED_HEIGHTS = { xxs: 48, xs: 48, sm: 40, md: 40, lg: 40 };
16
- const RESPONSIVE_ROW_HEIGHTS = { xxs: 48, xs: 48, sm: 48, md: 40, lg: 40 };
15
+ const RESPONSIVE_ROW_HEIGHTS = { xxs: 32, xs: 32, sm: 32, md: 32, lg: 32 };
17
16
  const DEFAULT_WINDOW = {
18
17
  status: "init",
19
18
  moduleActions: [],
@@ -197,18 +196,17 @@ export {
197
196
  NORMALIZED_COLS as N,
198
197
  PADDING_GRIDLAYOUT as P,
199
198
  RESPONSIVE_ROW_HEIGHTS as R,
200
- RESPONSIVE_COLAPSED_HEIGHTS as a,
201
- getDataFromResponse as b,
202
- getParmsFromValue as c,
203
- COOKIE_BREAKPOINT_LAYOUTS as d,
204
- DEFAULT_WINDOW as e,
205
- COOKIE_WINDOWS as f,
199
+ getDataFromResponse as a,
200
+ getParmsFromValue as b,
201
+ COOKIE_BREAKPOINT_LAYOUTS as c,
202
+ DEFAULT_WINDOW as d,
203
+ COOKIE_WINDOWS as e,
204
+ deleteLayoutFromBreakPoints as f,
206
205
  getCookiesContainer as g,
207
- deleteLayoutFromBreakPoints as h,
208
- addArea as i,
209
- DEFAULT_AREA as j,
210
- getSelectedAreaIdFromCookies as k,
211
- COOKIE_AREAS_ADMIN_CONTAINER_ID as l,
212
- COOKIE_AREAS_ADMIN_ID as m,
206
+ addArea as h,
207
+ DEFAULT_AREA as i,
208
+ getSelectedAreaIdFromCookies as j,
209
+ COOKIE_AREAS_ADMIN_CONTAINER_ID as k,
210
+ COOKIE_AREAS_ADMIN_ID as l,
213
211
  setColapsedLayoutBreakPoints as s
214
212
  };
@@ -1,7 +1,7 @@
1
1
  import { createStore } from "zustand";
2
2
  import { devtools } from "zustand/middleware";
3
3
  import { immer } from "zustand/middleware/immer";
4
- import { g as getCookiesContainer, b as getDataFromResponse, c as getParmsFromValue, s as setColapsedLayoutBreakPoints, d as COOKIE_BREAKPOINT_LAYOUTS, D as DEBOUCED_SAVE_TIME, e as DEFAULT_WINDOW, M as MARGIN_GRIDLAYOUT, f as COOKIE_WINDOWS, h as deleteLayoutFromBreakPoints, R as RESPONSIVE_ROW_HEIGHTS, P as PADDING_GRIDLAYOUT, N as NORMALIZED_COLS, i as addArea, j as DEFAULT_AREA, k as getSelectedAreaIdFromCookies, C as COOKIE_WINDOW_SELECTED, l as COOKIE_AREAS_ADMIN_CONTAINER_ID, m as COOKIE_AREAS_ADMIN_ID } from "./helpers/helper.js";
4
+ import { g as getCookiesContainer, a as getDataFromResponse, b as getParmsFromValue, s as setColapsedLayoutBreakPoints, c as COOKIE_BREAKPOINT_LAYOUTS, D as DEBOUCED_SAVE_TIME, d as DEFAULT_WINDOW, M as MARGIN_GRIDLAYOUT, e as COOKIE_WINDOWS, f as deleteLayoutFromBreakPoints, R as RESPONSIVE_ROW_HEIGHTS, P as PADDING_GRIDLAYOUT, N as NORMALIZED_COLS, h as addArea, i as DEFAULT_AREA, j as getSelectedAreaIdFromCookies, C as COOKIE_WINDOW_SELECTED, k as COOKIE_AREAS_ADMIN_CONTAINER_ID, l as COOKIE_AREAS_ADMIN_ID } from "./helpers/helper.js";
5
5
  import { c as createDynamicMFStore } from "../../../WindowBase/contexts/DynamicMFParmsContext/store.js";
6
6
  import cloneDeep from "lodash-es/cloneDeep";
7
7
  import debounce from "lodash-es/debounce";
@@ -441,8 +441,8 @@ const createAreasStore = (initProps, storeDevtoolsEnabled = false) => {
441
441
  bounds: {
442
442
  left: MARGIN_GRIDLAYOUT,
443
443
  top: MARGIN_GRIDLAYOUT,
444
- right: -11,
445
- bottom: -11
444
+ right: -10,
445
+ bottom: -10
446
446
  }
447
447
  });
448
448
  }
@@ -11,9 +11,9 @@ const booleanFormatterStyles = {
11
11
  /**
12
12
  * Styled del icono
13
13
  */
14
- icon: ({ theme }) => ({
14
+ icon: ({ theme, ownerState }) => ({
15
15
  "& .M4LIcon-icon": {
16
- backgroundColor: theme.vars.palette.text.primary
16
+ backgroundColor: ownerState?.value ? theme.vars.palette.primary.enabled : theme.vars.palette.text.secondary
17
17
  }
18
18
  }),
19
19
  chip: {}
@@ -11,7 +11,8 @@ import { RHFAutocompleteAsyncProps } from './types';
11
11
  * - Si al componente se le define onChangeFilterParms
12
12
  * - (Test OK) Solo cuando se abre el combo se debe hacer el request .
13
13
  * - (Test OK) Si se abre el combo varias veces, solo se hace el request la primera vez si no han cambiado los parms.
14
- * - (Test OK) Si cambian los parms (Normalmente cuando el componente depende de otro componente), al volver a abrir el combo se debe volver a hacer el request.
14
+ * - (Test OK in reducer) Si cambian los parms (Normalmente cuando el componente depende de otro componente), las opciones de deben limpiar
15
+ * - (Test OK) Si cambian los parms (Normalmente cuando el componente depende de otro componente) cuando se vuelve a abrir el combo se debe volver a hacer el request .
15
16
  * - (Test OK) Si el request esta en curso y se cierra el combo, se debe dejar terminar el request para no perder la respuesta.
16
17
  * - (Test OK) Si el request genera un error, debe dejar las mismas opciones y en el proximo open se debe volver a hacer el request.
17
18
  * - Si es multiple = false
@@ -30,7 +30,8 @@ const RHFAutocompleteAsyncReducer = (onChangeFilterParms) => (state, action) =>
30
30
  ...state,
31
31
  parms: action.payload,
32
32
  fireFetchCount: 0,
33
- firstOpen: true
33
+ firstOpen: true,
34
+ options: []
34
35
  };
35
36
  case actionsType.SET_QUERY_PARAMS:
36
37
  if (deepEqual(state.queryParams, action.payload)) {
@@ -72,7 +72,7 @@ const Accordion = forwardRef((props, ref) => {
72
72
  {
73
73
  ownerState,
74
74
  size,
75
- variant: "body",
75
+ variant: "caption",
76
76
  skeletonWidth: skeletonLabelWidth,
77
77
  children: label
78
78
  }
@@ -8,8 +8,8 @@ const accordionStyles = {
8
8
  accordionRoot: ({ theme, ownerState }) => ({
9
9
  "&&&": {
10
10
  ...ownerState?.variant === "outlined" && {
11
- border: `${theme.size.borderStroke.container} ${theme.vars.palette.border.default}`,
12
- borderRadius: ownerState?.variant === "outlined" ? theme.size.borderRadius["r1-5"] : "unset"
11
+ border: `${theme.size.borderStroke.container} ${theme.vars.palette.border.secondary}`,
12
+ borderRadius: ownerState?.variant === "outlined" ? theme.size.borderRadius.r2 : "unset"
13
13
  },
14
14
  ...ownerState?.variant === "text" && {
15
15
  borderBottom: ownerState?.expanded ? `${theme.size.borderStroke.container} ${theme.vars.palette.border.default}` : `${theme.size.borderStroke.container} ${theme.vars.palette.border.default}`,
@@ -27,22 +27,25 @@ const accordionStyles = {
27
27
  accordionSummary: ({ theme, ownerState }) => ({
28
28
  "&&&": {
29
29
  paddingLeft: theme.vars.size.baseSpacings.sp2,
30
- paddingRight: theme.vars.size.baseSpacings.sp1,
30
+ paddingRight: theme.vars.size.baseSpacings.sp2,
31
31
  gap: theme.vars.size.baseSpacings.sp2,
32
32
  display: "flex",
33
33
  flexDirection: "row",
34
34
  justifyContent: "flex-start",
35
35
  alignItems: "center",
36
- ...getSizeStyles(theme, ownerState?.size ?? "medium", "container"),
36
+ ...getSizeStyles(theme, ownerState?.size ?? "medium", "container", (size) => ({
37
+ minHeight: size,
38
+ height: size
39
+ })),
37
40
  background: theme.vars.palette.background.default,
38
41
  overflow: "hidden",
39
42
  borderBottom: ownerState?.expanded && ownerState?.variant === "outlined" ? `${theme.size.borderStroke.container} ${theme.vars.palette.border.disabled}` : "unset",
40
43
  borderRadius: "unset",
41
44
  ...ownerState?.variant === "outlined" && {
42
- borderTopLeftRadius: theme.size.borderRadius["r1-5"],
43
- borderTopRightRadius: theme.size.borderRadius["r1-5"],
44
- borderBottomLeftRadius: !ownerState?.expanded ? theme.size.borderRadius["r1-5"] : "unset",
45
- borderBottomRightRadius: !ownerState?.expanded ? theme.size.borderRadius["r1-5"] : "unset"
45
+ borderTopLeftRadius: theme.size.borderRadius.r2,
46
+ borderTopRightRadius: theme.size.borderRadius.r2,
47
+ borderBottomLeftRadius: !ownerState?.expanded ? theme.size.borderRadius.r2 : "unset",
48
+ borderBottomRightRadius: !ownerState?.expanded ? theme.size.borderRadius.r2 : "unset"
46
49
  },
47
50
  "&:hover": {
48
51
  background: theme.vars.palette.default.hoverOpacity
@@ -57,6 +60,7 @@ const accordionStyles = {
57
60
  "& .MuiAccordionSummary-content": {
58
61
  gap: `${theme.vars.size.baseSpacings.sp1}`,
59
62
  overflow: "hidden",
63
+ paddingLeft: theme.vars.size.baseSpacings.sp1,
60
64
  "& .MuiTypography-root": {
61
65
  overflow: "hidden",
62
66
  textOverflow: "ellipsis",
@@ -16,5 +16,7 @@ type OptionType<T> = T & {
16
16
  /**
17
17
  * Render option for Autocomplete.
18
18
  */
19
- export declare const renderOption: <T>(optionProps: HTMLAttributes<HTMLLIElement>, option: OptionType<T>) => import("react/jsx-runtime").JSX.Element;
19
+ export declare const renderOption: <T>(optionProps: HTMLAttributes<HTMLLIElement> & {
20
+ key: string;
21
+ }, option: OptionType<T>) => import("react/jsx-runtime").JSX.Element;
20
22
  export {};
@@ -3,7 +3,7 @@ import { memo } from "react";
3
3
  import { M as MenuItem } from "../../MenuItem/MenuItem.js";
4
4
  const MemoizedMenuItem = memo(MenuItem);
5
5
  const renderOption = (optionProps, option) => {
6
- const { className, ...otherOptionProps } = optionProps;
6
+ const { className, key, ...otherOptionProps } = optionProps;
7
7
  return /* @__PURE__ */ jsx(
8
8
  MemoizedMenuItem,
9
9
  {
@@ -15,7 +15,8 @@ const renderOption = (optionProps, option) => {
15
15
  startIcon: option.startAdornment,
16
16
  endIcon: option.endAdornment,
17
17
  size: option.size
18
- }
18
+ },
19
+ option.label
19
20
  );
20
21
  };
21
22
  export {
@@ -75,12 +75,12 @@ const tabStyles = {
75
75
  background: theme.vars.palette.background.default,
76
76
  border: "unset",
77
77
  ".M4LTab-icon div": {
78
- backgroundColor: ownerState?.tabDisabled ? theme.vars.palette.text.disabled : theme.vars.palette.primary.enabled
78
+ backgroundColor: ownerState?.tabDisabled ? theme.vars.palette.text.disabled : theme.vars.palette.primary.semanticText
79
79
  },
80
80
  ".M4LTab-tipography": {
81
- color: ownerState?.tabDisabled ? theme.vars.palette.text.disabled : theme.vars.palette.primary.enabled
81
+ color: ownerState?.tabDisabled ? theme.vars.palette.text.disabled : theme.vars.palette.primary.semanticText
82
82
  },
83
- // Efecto ripple en estado seleccionado
83
+ // Efecto ripple en estado seleccionado`
84
84
  "& .MuiTouchRipple-root": {
85
85
  borderTopLeftRadius: theme.vars.size.baseSpacings["sp0-5"],
86
86
  borderTopRightRadius: theme.vars.size.baseSpacings["sp0-5"]