@m4l/components 9.1.93 → 9.1.95

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 (107) hide show
  1. package/@types/types.d.ts +44 -35
  2. package/components/Chip/Chip.d.ts +2 -2
  3. package/components/Chip/ChipStyles.js +10 -10
  4. package/components/Chip/index.js +1 -0
  5. package/components/Chip/types.d.ts +3 -2
  6. package/components/Chip/types.js +1 -0
  7. package/components/Color/types.d.ts +8 -0
  8. package/components/CommonActions/components/ActionFormIntro/index.d.ts +2 -2
  9. package/components/DataGrid/dictionary.d.ts +1 -1
  10. package/components/DataGrid/subcomponents/Actions/index.d.ts +1 -1
  11. package/components/DataGrid/subcomponents/Actions/subcomponents/Density/index.d.ts +1 -1
  12. package/components/DataGrid/subcomponents/Actions/subcomponents/MobileMenuActions/index.d.ts +1 -1
  13. package/components/MenuActions/MenuActions.d.ts +1 -1
  14. package/components/MenuActions/MenuActions.js +2 -1
  15. package/components/MenuActions/MenuActions.styles.js +19 -5
  16. package/components/MenuActions/types.d.ts +10 -7
  17. package/components/Pager/Pager.d.ts +2 -2
  18. package/components/Pager/Pager.styles.js +8 -8
  19. package/components/Pager/subcomponents/CustomTablePagination/CustomTablePagination.d.ts +1 -1
  20. package/components/Pager/subcomponents/CustomTablePagination/types.d.ts +3 -3
  21. package/components/Pager/subcomponents/PagerActions/PagerActions.d.ts +1 -1
  22. package/components/PropertyValue/PropertyValue.js +1 -1
  23. package/components/ToastContainer/ToastContainer.d.ts +4 -0
  24. package/components/WindowBase/WindowBase.d.ts +1 -1
  25. package/components/WindowBase/subcomponents/Header/HeaderWindowBase.d.ts +1 -1
  26. package/components/WindowBase/types.d.ts +1 -1
  27. package/components/areas/components/AreasAdmin/AreasAdmin.d.ts +13 -0
  28. package/components/areas/components/AreasAdmin/AreasAdmin.js +163 -0
  29. package/components/areas/components/AreasAdmin/AreasAdmin.styles.d.ts +2 -0
  30. package/components/areas/components/AreasAdmin/AreasAdmin.styles.js +264 -0
  31. package/components/areas/components/AreasAdmin/classes/index.js +1 -2
  32. package/components/areas/components/AreasAdmin/constants.d.ts +1 -0
  33. package/components/areas/components/AreasAdmin/constants.js +4 -0
  34. package/components/areas/components/AreasAdmin/slots/AreasAdminEnum.d.ts +23 -0
  35. package/components/areas/components/AreasAdmin/slots/AreasAdminEnum.js +27 -0
  36. package/components/areas/components/AreasAdmin/slots/AreasAdminSlots.d.ts +63 -0
  37. package/components/areas/components/AreasAdmin/slots/AreasAdminSlots.js +116 -0
  38. package/components/areas/components/AreasAdmin/slots/index.d.ts +2 -0
  39. package/components/areas/components/AreasAdmin/slots/index.js +1 -0
  40. package/components/areas/components/AreasAdmin/subcomponents/AreaChip/{index.d.ts → AreaChip.d.ts} +4 -26
  41. package/components/areas/components/AreasAdmin/subcomponents/AreaChip/{index.js → AreaChip.js} +81 -88
  42. package/components/areas/components/AreasAdmin/subcomponents/AreaChip/subcomponents/ChipActionsMobile/ChipActionsMobile.d.ts +8 -0
  43. package/components/areas/components/AreasAdmin/subcomponents/AreaChip/subcomponents/ChipActionsMobile/ChipActionsMobile.js +53 -0
  44. package/components/areas/components/AreasAdmin/subcomponents/AreaChip/subcomponents/ChipActionsMobile/index.d.ts +1 -1
  45. package/components/areas/components/AreasAdmin/subcomponents/AreaChip/types.d.ts +18 -0
  46. package/components/areas/components/AreasAdmin/subcomponents/AreaChipMobile/{index.d.ts → AreaChipMobile.d.ts} +1 -1
  47. package/components/areas/components/AreasAdmin/subcomponents/AreaChipMobile/AreaChipMobile.js +81 -0
  48. package/components/areas/components/AreasAdmin/subcomponents/AreaChipMobile/subcomponents/ChipMobile/ChipMobile.d.ts +2 -3
  49. package/components/areas/components/AreasAdmin/subcomponents/AreaChipMobile/subcomponents/ChipMobile/ChipMobile.js +36 -78
  50. package/components/areas/components/AreasAdmin/subcomponents/AreaChipMobile/subcomponents/PanelWindowPopUp/index.d.ts +1 -1
  51. package/components/areas/components/AreasAdmin/subcomponents/PanelWindowPopUp/{index.d.ts → PanelWindowPopUp.d.ts} +1 -1
  52. package/components/areas/components/AreasAdmin/types.d.ts +47 -0
  53. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/AreaGridLayout/index.js +1 -1
  54. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/helper.d.ts +23 -3
  55. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/index.d.ts +1 -1
  56. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/index.js +7 -3
  57. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/subcomponents/WindowPopUpsList/index.d.ts +1 -1
  58. package/components/areas/components/index.d.ts +1 -1
  59. package/components/areas/contexts/AreasContext/helpers/generateModuleCount.d.ts +9 -0
  60. package/components/areas/contexts/AreasContext/helpers/generateModuleCount.js +16 -0
  61. package/components/areas/contexts/AreasContext/{helper.d.ts → helpers/helper.d.ts} +3 -3
  62. package/components/areas/contexts/AreasContext/{helper.js → helpers/helper.js} +5 -5
  63. package/components/areas/contexts/AreasContext/index.js +5 -2
  64. package/components/areas/contexts/AreasContext/store.d.ts +2 -2
  65. package/components/areas/contexts/AreasContext/store.js +175 -173
  66. package/components/areas/contexts/AreasContext/tests/AreasProvider.test.d.ts +1 -0
  67. package/components/areas/contexts/AreasContext/tests/Store.test.d.ts +1 -0
  68. package/components/areas/contexts/AreasContext/types.d.ts +6 -2
  69. package/components/areas/dictionary.d.ts +1 -0
  70. package/components/areas/dictionary.js +2 -1
  71. package/components/areas/icons.d.ts +2 -0
  72. package/components/areas/icons.js +3 -1
  73. package/components/areas/types.d.ts +6 -1
  74. package/components/hook-form/RHFAutocomplete/RFHAutocompleteStyles.js +4 -4
  75. package/components/hook-form/RHFAutocomplete/RHFAutocomplete.d.ts +2 -2
  76. package/components/hook-form/RHFCheckbox/RHFCheckbox.d.ts +5 -0
  77. package/components/hook-form/RHFDateTime/RHFDateTime.d.ts +2 -2
  78. package/components/hook-form/RHFDateTime/RHFDateTime.styles.js +2 -2
  79. package/components/maps/components/Map/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/LayersTool/hooks/useRowActionsGetter.d.ts +1 -1
  80. package/components/maps/components/MapGpsTools/subcomponents/TabsGpsTools/subcomponents/GeofencesList/hooks/useRowActionsGetter.d.ts +1 -1
  81. package/components/mui_extended/Autocomplete/Autocomplete.styles.js +22 -14
  82. package/components/mui_extended/Badge/slots/BadgeSlots.d.ts +1 -1
  83. package/components/mui_extended/CheckBox/CheckBox.d.ts +4 -0
  84. package/components/mui_extended/DateTimePicker/DateTimePicker.d.ts +2 -2
  85. package/components/mui_extended/DateTimePicker/DateTimePicker.styles.js +14 -14
  86. package/components/mui_extended/Divider/Divider.d.ts +4 -0
  87. package/components/mui_extended/IconButton/IconButton.styles.js +6 -6
  88. package/components/mui_extended/IconButton/slots/IconButtonSlots.d.ts +1 -1
  89. package/components/mui_extended/MenuItem/MenuItem.styles.js +39 -8
  90. package/components/mui_extended/MenuItem/slots/MenuItemSlots.js +1 -1
  91. package/components/mui_extended/NavLink/NavLink.d.ts +4 -0
  92. package/components/mui_extended/NavLink/NavLink.styles.js +28 -6
  93. package/components/mui_extended/Popover/Popover.styles.js +4 -4
  94. package/components/mui_extended/Select/Select.styles.js +5 -5
  95. package/components/mui_extended/Select/types.d.ts +6 -0
  96. package/components/mui_extended/Stack/Stack.d.ts +4 -0
  97. package/index.js +1 -1
  98. package/package.json +2 -2
  99. package/components/areas/components/AreasAdmin/index.d.ts +0 -10
  100. package/components/areas/components/AreasAdmin/index.js +0 -95
  101. package/components/areas/components/AreasAdmin/styles.js +0 -17
  102. package/components/areas/components/AreasAdmin/subcomponents/AreaChip/styles.js +0 -29
  103. package/components/areas/components/AreasAdmin/subcomponents/AreaChip/subcomponents/ChipActionsMobile/index.js +0 -56
  104. package/components/areas/components/AreasAdmin/subcomponents/AreaChipMobile/index.js +0 -96
  105. package/components/areas/components/AreasAdmin/subcomponents/PanelWindowPopUp/index.js +0 -54
  106. package/components/areas/utils/useOnClickOutside/index.js +0 -22
  107. /package/components/areas/{contexts/AreasContext/index.test.d.ts → components/AreasAdmin/test/AreasAdmin.test.d.ts} +0 -0
@@ -1,22 +1,18 @@
1
- import { jsxs, Fragment, jsx } from "react/jsx-runtime";
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
2
  import { useEnvironment, useModuleDictionary } from "@m4l/core";
3
3
  import { useState, useRef, useMemo } from "react";
4
4
  import * as Yup from "yup";
5
- import { useTheme } from "@mui/material";
6
5
  import { shallow } from "zustand/shallow";
7
6
  import TouchRipple from "@mui/material/ButtonBase/TouchRipple";
8
7
  import { u as useAreasStore } from "../../../../../../hooks/useAreas/index.js";
9
- import { useResponsiveDesktop } from "@m4l/graphics";
10
8
  import { g as getAreasDictionary, A as AREAS_DICCTIONARY } from "../../../../../../dictionary.js";
11
- import { a as areasAdminClasses } from "../../../../classes/index.js";
12
- import clsx from "clsx";
13
9
  import { I as ICONS } from "../../../../../../icons.js";
14
- import { C as ChipActionsMobile } from "../../../AreaChip/subcomponents/ChipActionsMobile/index.js";
15
- import { E as EditAreaHeader } from "../../../AreaChip/styles.js";
16
- import { I as IconButton } from "../../../../../../../mui_extended/IconButton/IconButton.js";
10
+ import { C as ChipActionsMobile } from "../../../AreaChip/subcomponents/ChipActionsMobile/ChipActionsMobile.js";
11
+ import { l as ChipMobileRootStyled, m as ChipMobileContentStyled, N as NameChipMobileStyled, n as EditAreaChipMobileContainerStyled } from "../../../../slots/AreasAdminSlots.js";
17
12
  import { R as RHFormProvider } from "../../../../../../../hook-form/RHFormContext/index.js";
18
13
  import { T as Typography } from "../../../../../../../mui_extended/Typography/Typography.js";
19
14
  import { A as ActionsContainer } from "../../../../../../../CommonActions/components/ActionsContainer/ActionsContainer.js";
15
+ import { M as MenuActions } from "../../../../../../../MenuActions/MenuActions.js";
20
16
  import { P as Popover } from "../../../../../../../mui_extended/Popover/Popover.js";
21
17
  import { R as RHFTextField } from "../../../../../../../hook-form/RHFTextField/RHFTextField.js";
22
18
  import { A as ActionCancel } from "../../../../../../../CommonActions/components/ActionCancel/ActionCancel.js";
@@ -25,29 +21,23 @@ const ChipMobile = (props) => {
25
21
  const { areaId, selected, disabled, setAnchorMenuAreas } = props;
26
22
  const { host_static_assets, environment_assets } = useEnvironment();
27
23
  const { deleteArea, selectArea, editArea } = useAreasStore((state) => state.areasActions);
28
- const { setFocus } = useAreasStore((state) => state.areaAdminActions);
29
24
  const areaName = useAreasStore((state) => state.hashAreas[areaId].name, shallow);
30
25
  const listAreas = useAreasStore((state) => state.areasIds, shallow);
31
26
  const [open, setOpen] = useState(false);
32
27
  const { getLabel } = useModuleDictionary();
33
- const isDesktop = useResponsiveDesktop();
34
28
  const anchorRef = useRef(null);
35
- const theme = useTheme();
36
29
  const onClickDeleteArea = (e) => {
37
30
  if (listAreas.length > 1) {
38
31
  e.stopPropagation();
39
- setFocus(true);
40
32
  deleteArea(areaId);
41
33
  }
42
34
  };
43
35
  const onSubmit = (data) => {
44
36
  editArea(areaId, data.inputEditArea);
45
37
  setOpen(false);
46
- setFocus(false);
47
38
  };
48
39
  const handlerOpenPopoverEditArea = (e) => {
49
40
  e?.stopPropagation();
50
- setFocus(true);
51
41
  setOpen(true);
52
42
  };
53
43
  const initialValues = {
@@ -66,67 +56,55 @@ const ChipMobile = (props) => {
66
56
  selectArea(areaId);
67
57
  };
68
58
  const rippleRef = useRef(null);
69
- const onRippleStart = (e) => {
70
- if (rippleRef.current) {
71
- rippleRef.current.start(e);
72
- }
73
- };
74
59
  const onRippleStop = (e) => {
75
60
  if (rippleRef.current) {
76
61
  rippleRef.current.stop(e);
77
62
  }
78
63
  };
79
- return /* @__PURE__ */ jsxs(Fragment, { children: [
64
+ const menuActions = [
65
+ {
66
+ type: "menuItem",
67
+ startIcon: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.EDIT_AREA}`,
68
+ label: `${getLabel(getAreasDictionary(AREAS_DICCTIONARY.label_edit_area))}`,
69
+ onClick: handlerOpenPopoverEditArea
70
+ },
71
+ {
72
+ type: "menuItem",
73
+ startIcon: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.DELETE_AREA}`,
74
+ label: `${getLabel(getAreasDictionary(AREAS_DICCTIONARY.label_delete_area))}`,
75
+ onClick: onClickDeleteArea
76
+ }
77
+ ];
78
+ return /* @__PURE__ */ jsxs(ChipMobileRootStyled, { selected, disabled, ownerState: {}, children: [
80
79
  /* @__PURE__ */ jsxs(
81
- "div",
80
+ ChipMobileContentStyled,
82
81
  {
82
+ ownerState: {},
83
83
  role: "presentation",
84
84
  ref: anchorRef,
85
- onMouseDown: onRippleStart,
86
85
  onMouseUp: onRippleStop,
87
- className: clsx(
88
- areasAdminClasses.areaChipRoot,
89
- selected ? areasAdminClasses.selected : null,
90
- disabled ? areasAdminClasses.disabled : null
91
- ),
92
86
  onClick: (e) => {
93
87
  handlerOnClick(e);
94
88
  },
95
89
  children: [
96
- /* @__PURE__ */ jsx(TouchRipple, { ref: rippleRef, center: false, style: { position: "absolute", inset: "0" } }),
97
- /* @__PURE__ */ jsx("div", { className: areasAdminClasses.areaChipTitle, children: areaName })
90
+ /* @__PURE__ */ jsx(TouchRipple, { ref: rippleRef, center: false }),
91
+ /* @__PURE__ */ jsx(NameChipMobileStyled, { ownerState: {}, variant: "body", children: `${areaName}` }),
92
+ /* @__PURE__ */ jsx(
93
+ MenuActions,
94
+ {
95
+ icon: `${host_static_assets}/${environment_assets}/frontend/components/window_base/assets/icons/${ICONS.MORE_VERTICAL}`,
96
+ arrowType: "no-arrow",
97
+ anchorOrigin: { vertical: "bottom", horizontal: "right" },
98
+ transformOrigin: { vertical: "top", horizontal: "right" },
99
+ menuActions
100
+ }
101
+ )
98
102
  ]
99
103
  }
100
104
  ),
101
- isDesktop ? /* @__PURE__ */ jsxs("div", { className: areasAdminClasses.areaContainerChipEditButton, children: [
102
- /* @__PURE__ */ jsx(
103
- IconButton,
104
- {
105
- className: areasAdminClasses.areaChipEditButton,
106
- src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.EDIT_AREA}`,
107
- size: "small",
108
- onClick: (e) => {
109
- handlerOpenPopoverEditArea(e);
110
- }
111
- }
112
- ),
113
- /* @__PURE__ */ jsx(
114
- IconButton,
115
- {
116
- className: areasAdminClasses.areaChipDeleteButton,
117
- src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.DELETE_AREA}`,
118
- size: "small",
119
- onClick: (e) => {
120
- onClickDeleteArea(e);
121
- }
122
- }
123
- )
124
- ] }) : /* @__PURE__ */ jsx(
105
+ /* @__PURE__ */ jsx(
125
106
  ChipActionsMobile,
126
- {
127
- areaId,
128
- handlerOpenPopoverEditArea
129
- }
107
+ {}
130
108
  ),
131
109
  /* @__PURE__ */ jsx(
132
110
  "div",
@@ -140,18 +118,12 @@ const ChipMobile = (props) => {
140
118
  {
141
119
  arrowType: "top-center",
142
120
  open,
143
- className: areasAdminClasses.areaEditPopover,
144
121
  anchorEl: anchorRef.current,
145
122
  anchorOrigin: { vertical: "bottom", horizontal: "center" },
146
123
  transformOrigin: { vertical: "top", horizontal: "center" },
147
124
  onClose: () => {
148
- setFocus(false);
149
125
  setOpen(false);
150
126
  },
151
- sx: {
152
- mt: "10px",
153
- ...theme.components?.M4LAreasAdminEditPopover?.styleOverrides || {}
154
- },
155
127
  children: /* @__PURE__ */ jsxs(
156
128
  RHFormProvider,
157
129
  {
@@ -159,20 +131,7 @@ const ChipMobile = (props) => {
159
131
  values: initialValues,
160
132
  validationSchema,
161
133
  children: [
162
- /* @__PURE__ */ jsxs(EditAreaHeader, { children: [
163
- /* @__PURE__ */ jsx(Typography, { children: getLabel(getAreasDictionary(AREAS_DICCTIONARY.label_edit_area)) }),
164
- /* @__PURE__ */ jsx(
165
- IconButton,
166
- {
167
- src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.CLOSE}`,
168
- size: "small",
169
- onClick: () => {
170
- setFocus(false);
171
- setOpen(false);
172
- }
173
- }
174
- )
175
- ] }),
134
+ /* @__PURE__ */ jsx(EditAreaChipMobileContainerStyled, { ownerState: {}, children: /* @__PURE__ */ jsx(Typography, { children: getLabel(getAreasDictionary(AREAS_DICCTIONARY.label_edit_area)) }) }),
176
135
  /* @__PURE__ */ jsx(
177
136
  RHFTextField,
178
137
  {
@@ -186,7 +145,6 @@ const ChipMobile = (props) => {
186
145
  {
187
146
  onClick: () => {
188
147
  setOpen(false);
189
- setFocus(false);
190
148
  },
191
149
  variant: "outlined"
192
150
  }
@@ -3,7 +3,7 @@ import { PanelWindowPopUpProps } from './types';
3
3
  * TODO: Documentar
4
4
  * @author Andrés Quintero - automatic
5
5
  * @createdAt 2024-12-27 08:27:31 - automatic
6
- * @updatedAt 2025-01-22 08:50:39 - automatic
6
+ * @updatedAt 2025-01-31 11:37:44 - automatic
7
7
  * @updatedUser cesar - automatic
8
8
  */
9
9
  export declare const PanelWindowPopUp: (props: PanelWindowPopUpProps) => import("react/jsx-runtime").JSX.Element;
@@ -3,7 +3,7 @@ import { PanelWindowPopUpProps } from './types';
3
3
  * TODO: Documentar
4
4
  * @author Andrés Quintero - automatic
5
5
  * @createdAt 2024-12-27 08:27:31 - automatic
6
- * @updatedAt 2025-01-22 08:50:39 - automatic
6
+ * @updatedAt 2025-01-31 11:37:44 - automatic
7
7
  * @updatedUser cesar - automatic
8
8
  */
9
9
  export declare const PanelWindowPopUp: (props: PanelWindowPopUpProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,47 @@
1
+ import { Theme } from '@mui/material';
2
+ import { AreasAdminSlots } from './slots/AreasAdminEnum';
3
+ import { AREAS_ADMIN_KEY_COMPONENT } from './constants';
4
+ import { ComponentPalletColor, Sizes } from '@m4l/styles';
5
+ import { M4LOverridesStyleRules } from '../../../../../src/@types/augmentations';
6
+ export type AreasAdminType = keyof typeof AreasAdminSlots;
7
+ export interface AreasAdminProps {
8
+ /**
9
+ * Clase CSS personalizada que se aplicará al componente
10
+ */
11
+ color?: Extract<ComponentPalletColor, 'primary'>;
12
+ /**
13
+ * Opciones de tamaño del componente.
14
+ */
15
+ size?: Extract<Sizes, 'small' | 'medium'>;
16
+ /**
17
+ * data-testid para pruebas unitarias.
18
+ */
19
+ dataTestId?: string;
20
+ /**
21
+ * Clase CSS para sobrescribir los estilos predeterminados del loader.
22
+ */
23
+ className?: string;
24
+ /**
25
+ * Props adicionales que se pueden pasar al loader.
26
+ */
27
+ [key: string]: unknown;
28
+ }
29
+ export interface AreasAdminOwnerState {
30
+ /**
31
+ * Indica si el dispositivo es móvil.
32
+ */
33
+ isMobile: boolean;
34
+ /**
35
+ * Tamaño del campo de texto.
36
+ */
37
+ size: AreasAdminProps['size'];
38
+ /**
39
+ * Color del componente.
40
+ */
41
+ color: AreasAdminProps['color'];
42
+ /**
43
+ * Props adicionales que se pueden pasar al loader.
44
+ */
45
+ [key: string]: unknown;
46
+ }
47
+ export type AreasAdminStyles = M4LOverridesStyleRules<AreasAdminType, typeof AREAS_ADMIN_KEY_COMPONENT, Theme>;
@@ -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);
@@ -3,16 +3,36 @@ import { AreaWindowAction, WindowOptions } from '../../../../../../../../types';
3
3
  /**
4
4
  * TODO: Documentar
5
5
  * @updatedUser cesar - automatic
6
- * @updatedAt 2025-01-21 14:45:38 - automatic
6
+ * @updatedAt 2025-01-31 11:37:44 - automatic
7
+ * @createdAt 2025-01-31 11:37:43 - automatic
8
+ * @author cesar - automatic
9
+ * @updatedUser cesar - automatic
10
+ * @updatedAt 2025-01-31 11:37:44 - automatic
11
+ * @createdAt 2025-01-31 11:36:54 - automatic
12
+ * @author cesar - automatic
13
+ * @updatedUser cesar - automatic
14
+ * @updatedAt 2025-01-31 11:37:44 - automatic
15
+ * @createdAt 2025-01-31 11:36:15 - automatic
16
+ * @author cesar - automatic
17
+ * @updatedUser cesar - automatic
18
+ * @updatedAt 2025-01-31 11:37:44 - automatic
19
+ * @createdAt 2025-01-31 11:35:35 - automatic
20
+ * @author cesar - automatic
21
+ * @updatedUser cesar - automatic
22
+ * @updatedAt 2025-01-31 11:37:44 - automatic
23
+ * @createdAt 2025-01-31 11:34:36 - automatic
24
+ * @author cesar - automatic
25
+ * @updatedUser cesar - automatic
26
+ * @updatedAt 2025-01-31 11:37:44 - automatic
7
27
  * @createdAt 2025-01-21 14:45:38 - automatic
8
28
  * @author cesar - automatic
9
29
  * @updatedUser cesar - automatic
10
- * @updatedAt 2025-01-21 14:45:38 - automatic
30
+ * @updatedAt 2025-01-31 11:37:44 - automatic
11
31
  * @createdAt 2025-01-18 21:23:13 - automatic
12
32
  * @author cesar - automatic
13
33
  * @author cesar - automatic
14
34
  * @createdAt 2025-01-18 21:23:13 - automatic
15
- * @updatedAt 2025-01-21 14:45:38 - automatic
35
+ * @updatedAt 2025-01-31 11:37:44 - automatic
16
36
  * @updatedUser cesar - automatic
17
37
  */
18
38
  export declare function getMainActions(isDesktop: boolean | undefined, moduleActions: AreaWindowAction[]): AreaWindowAction[];
@@ -3,7 +3,7 @@ import { HeaderProps } from './types';
3
3
  * TODO: Documentar
4
4
  * @author Andrés Quintero - automatic
5
5
  * @createdAt 2024-12-27 08:27:31 - automatic
6
- * @updatedAt 2025-01-22 08:48:47 - automatic
6
+ * @updatedAt 2025-01-31 11:37:44 - automatic
7
7
  * @updatedUser cesar - automatic
8
8
  */
9
9
  export declare function Header(props: HeaderProps): import("react/jsx-runtime").JSX.Element;
@@ -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__ */ jsx(Typography, { className: areasViewerClasses.windowHeaderTitle, variant: "h5", children: title }),
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(
@@ -3,7 +3,7 @@ import { WindowPopUpsListProps } from './types';
3
3
  * TODO: Documentar
4
4
  * @author Andrés Quintero - automatic
5
5
  * @createdAt 2024-12-27 08:27:31 - automatic
6
- * @updatedAt 2025-01-21 14:45:38 - automatic
6
+ * @updatedAt 2025-01-31 11:37:44 - automatic
7
7
  * @updatedUser cesar - automatic
8
8
  */
9
9
  export declare const WindowPopUpsList: (props: WindowPopUpsListProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -1,3 +1,3 @@
1
- export * from './AreasAdmin';
1
+ export * from './AreasAdmin/AreasAdmin';
2
2
  export * from './AreasViewer';
3
3
  export type { NewWindowProps as NewWindow } from '../types';
@@ -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 './types';
3
- import { WindowState } from '../../types';
4
- import { Layouts } from '../../../GridLayout/types';
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 "../../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";
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({
@@ -23,11 +24,11 @@ function AreasProvider(props) {
23
24
  networkOperation,
24
25
  ownerState: {
25
26
  status: "init",
27
+ readyForHooks: false,
26
28
  isMobile: !isDesktop,
27
29
  isSkeleton,
28
30
  focus: false
29
31
  }
30
- // onLoad,
31
32
  });
32
33
  areasStoreRef.current?.getState().areasActions.init();
33
34
  }
@@ -49,6 +50,7 @@ function AreasProvider(props) {
49
50
  useEffect(() => {
50
51
  if (status === "loaded") {
51
52
  onLoad && onLoad();
53
+ addFlag(CommonFlags.FLAG_AREAS_LOADED);
52
54
  }
53
55
  }, [status]);
54
56
  useEffect(() => {
@@ -66,6 +68,7 @@ function AreasProvider(props) {
66
68
  }, [getLabel]);
67
69
  useEffect(() => {
68
70
  events_add_listener(EmitEvents.EMMIT_EVENT_HOST_EMERGE_WINDOW, addWindow);
71
+ setExternalState({ readyForHooks: true });
69
72
  return () => {
70
73
  events_remove_listener(EmitEvents.EMMIT_EVENT_HOST_EMERGE_WINDOW, addWindow);
71
74
  };
@@ -5,8 +5,8 @@ import { AreasStateWithActions, InitialAreasStoreProps } from './types';
5
5
  * @returns
6
6
  * @author Bruce Escobar - automatic
7
7
  * @createdAt 2024-10-22 09:41:31 - automatic
8
- * @updatedAt 2024-12-30 14:36:10 - automatic
9
- * @updatedUser Andrés Quintero - automatic
8
+ * @updatedAt 2025-01-29 16:33:53 - automatic
9
+ * @updatedUser cesar - automatic
10
10
  */
11
11
  export declare const createAreasStore: (initProps: InitialAreasStoreProps) => Omit<Omit<import('zustand').StoreApi<AreasStateWithActions>, "setState"> & {
12
12
  setState<A extends string | {