@m4l/components 0.1.84 → 0.1.86

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 (109) hide show
  1. package/@types/export.d.ts +25 -4
  2. package/components/AccountPopover/{index.bbeb9142.js → index.09f33fee.js} +29 -30
  3. package/components/AppBar/{index.43f8b54f.js → index.4fac1368.js} +9 -8
  4. package/components/CommonActions/components/ActionCancel/{index.29517521.js → index.d995d986.js} +2 -2
  5. package/components/CommonActions/components/ActionFormCancel/{index.89f1ac8e.js → index.48e066b3.js} +17 -16
  6. package/components/CommonActions/components/ActionFormIntro/{index.bbc35e74.js → index.cc97ed0a.js} +2 -2
  7. package/components/CommonActions/components/ActionIntro/{index.a9420126.js → index.98eb4b3b.js} +2 -2
  8. package/components/CommonActions/components/Actions/{index.e70e8779.js → index.99a8e55e.js} +15 -14
  9. package/components/CommonActions/index.d.ts +1 -0
  10. package/components/DataGrid/{index.1d0a3dec.js → index.d38e3b49.js} +8 -7
  11. package/components/DataGrid/subcomponents/Actions/{index.a8fc9f6a.js → index.7015aadc.js} +22 -20
  12. package/components/DynamicFilter/classes/types.d.ts +1 -0
  13. package/components/DynamicFilter/contexts/DynamicFilterContext/index.d.ts +6 -2
  14. package/components/DynamicFilter/contexts/DynamicFilterContext/store.d.ts +4 -0
  15. package/components/DynamicFilter/{index.912679cc.js → index.fddefc23.js} +44 -31
  16. package/components/GridLayout/{index.c55f16eb.js → index.2383aaf9.js} +69 -10
  17. package/components/GridLayout/index.d.ts +1 -1
  18. package/components/GridLayout/subcomponents/Griditem/{index.6c68811f.js → index.58168132.js} +1 -1
  19. package/components/GridLayout/subcomponents/Responsive/{index.a6e33b8d.js → index.a6642437.js} +1 -1
  20. package/components/HelperText/{index.a47ff233.js → index.bbbe24c9.js} +9 -8
  21. package/components/Icon/{index.d1402200.js → index.435df215.js} +1 -1
  22. package/components/LanguagePopover/{index.807f5272.js → index.7d2ccfe4.js} +9 -8
  23. package/components/ModalDialog/{index.42e804cf.js → index.b66c43e7.js} +4 -4
  24. package/components/NavLink/{index.ff5a939c.js → index.abbcb9b2.js} +9 -8
  25. package/components/NoItemSelected/classes/constants.d.ts +1 -0
  26. package/components/NoItemSelected/classes/index.d.ts +6 -0
  27. package/components/NoItemSelected/classes/types.d.ts +6 -0
  28. package/components/NoItemSelected/{index.23dfc897.js → index.a2807715.js} +46 -31
  29. package/components/NoItemSelected/index.d.ts +2 -1
  30. package/components/NoItemSelected/types.d.ts +4 -0
  31. package/components/ObjectLogs/{index.dc02715d.js → index.ad313913.js} +22 -19
  32. package/components/PaperForm/{index.249c2404.js → index.ad703ab6.js} +1 -1
  33. package/components/Period/{index.e129cdec.js → index.32d475b8.js} +16 -15
  34. package/components/PropertyValue/{index.93e40532.js → index.d52295d9.js} +1 -1
  35. package/components/ScrollBar/classes/constants.d.ts +1 -0
  36. package/components/ScrollBar/classes/index.d.ts +6 -0
  37. package/components/ScrollBar/classes/types.d.ts +6 -0
  38. package/components/ScrollBar/index.65bb2930.js +121 -0
  39. package/components/SideBar/{index.327679a6.js → index.387a2fa1.js} +111 -50
  40. package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/subcomponents/NavItemRoot/type.d.ts +5 -0
  41. package/components/areas/components/AreasAdmin/classes/index.d.ts +1 -1
  42. package/components/areas/components/AreasAdmin/classes/types.d.ts +2 -0
  43. package/components/areas/components/AreasAdmin/{index.8ab71eb9.js → index.23a09c81.js} +105 -56
  44. package/components/areas/components/AreasViewer/classes/index.d.ts +1 -1
  45. package/components/areas/components/AreasViewer/classes/types.d.ts +1 -1
  46. package/components/areas/components/AreasViewer/{index.933e506b.js → index.68eb0f6b.js} +72 -126
  47. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/AreaGridLayout/subcomponents/ResizeHandle/index.d.ts +4 -0
  48. package/components/areas/components/index.296bc2a4.js +31 -0
  49. package/components/areas/contexts/AreasContext/helper.d.ts +3 -3
  50. package/components/areas/contexts/AreasContext/{index.230d1584.js → index.8af3058c.js} +91 -78
  51. package/components/areas/contexts/AreasContext/types.d.ts +20 -8
  52. package/components/areas/contexts/{index.f494e241.js → index.41c24465.js} +1 -1
  53. package/components/areas/hooks/useAreas/{index.b8449343.js → index.d1cf9820.js} +1 -1
  54. package/components/areas/{index.32db4fa7.js → index.fd46ec65.js} +13 -12
  55. package/components/formatters/BooleanFormatter/{index.b2f02bc4.js → index.14cfcbc7.js} +1 -1
  56. package/components/formatters/{index.f9ad88b4.js → index.b574dda9.js} +2 -2
  57. package/components/hook-form/RHFAutocomplete/{index.d5afb409.js → index.60c6f592.js} +10 -9
  58. package/components/hook-form/RHFAutocompleteAsync/{index.a4f00088.js → index.9a40fb06.js} +1 -1
  59. package/components/hook-form/RHFCheckbox/{index.9bf6edb0.js → index.da4ebb03.js} +10 -9
  60. package/components/hook-form/RHFDateTime/{index.a2c1ed2c.js → index.c56219ea.js} +10 -9
  61. package/components/hook-form/RHFPeriod/{index.b5204ce2.js → index.ee6a3d61.js} +2 -2
  62. package/components/hook-form/RHFTextField/{index.5a0fa776.js → index.413a74ca.js} +3 -3
  63. package/components/hook-form/RHFUpload/{index.b36539d6.js → index.03faa7f0.js} +10 -9
  64. package/components/modal/{WindowBase.37158e8d.js → WindowBase.0eea1a27.js} +27 -13
  65. package/components/modal/{WindowConfirm.a68aa0f1.js → WindowConfirm.6896f0aa.js} +25 -24
  66. package/components/modal/{index.6f281ef8.js → index.6cdf65c9.js} +17 -16
  67. package/components/modal/index.d.ts +1 -1
  68. package/components/mui_extended/Accordion/{index.46771196.js → index.d15e51bf.js} +3 -3
  69. package/components/mui_extended/Badge/classes/constants.d.ts +1 -1
  70. package/components/mui_extended/Badge/{index.cad260fe.js → index.8c2b8b66.js} +1 -1
  71. package/components/mui_extended/Button/{index.40af964e.js → index.f79eb74e.js} +2 -1
  72. package/components/mui_extended/IconButton/{index.62aea582.js → index.d88a3f2e.js} +1 -1
  73. package/components/mui_extended/MenuActions/{index.2493b1b1.js → index.c53370f6.js} +7 -4
  74. package/components/mui_extended/MenuActions/types.d.ts +1 -0
  75. package/components/mui_extended/Pager/{index.a7f87c96.js → index.d6c87c44.js} +1 -1
  76. package/components/mui_extended/Stack/Stack.d.ts +3 -0
  77. package/components/mui_extended/Stack/classes/constants.d.ts +1 -0
  78. package/components/mui_extended/Stack/classes/index.d.ts +6 -0
  79. package/components/mui_extended/Stack/classes/types.d.ts +6 -0
  80. package/components/mui_extended/Stack/index.0e53197c.js +39 -0
  81. package/components/mui_extended/Stack/index.d.ts +2 -0
  82. package/components/mui_extended/Stack/types.d.ts +2 -0
  83. package/components/mui_extended/Tab/{index.756fe693.js → index.97d04d6b.js} +42 -9
  84. package/components/mui_extended/Tabs/Tabs.d.ts +3 -0
  85. package/components/mui_extended/Tabs/classes/constants.d.ts +1 -0
  86. package/components/mui_extended/Tabs/classes/index.d.ts +6 -0
  87. package/components/mui_extended/Tabs/classes/types.d.ts +6 -0
  88. package/components/mui_extended/Tabs/index.d.ts +1 -0
  89. package/components/mui_extended/{index.ba27649e.js → index.0d5b8e73.js} +9 -8
  90. package/components/mui_extended/index.d.ts +2 -0
  91. package/contexts/ModalContext/{index.51da83de.js → index.5c908fe3.js} +1 -1
  92. package/contexts/RHFormContext/dictionary.d.ts +3 -0
  93. package/contexts/RHFormContext/{index.b9266262.js → index.ea2758ed.js} +6 -2
  94. package/contexts/index.d.ts +1 -0
  95. package/hooks/index.d.ts +1 -0
  96. package/hooks/useFormAddEdit/dictionary.d.ts +1 -0
  97. package/hooks/useFormAddEdit/index.16475afe.js +111 -0
  98. package/hooks/useFormAddEdit/index.d.ts +1 -0
  99. package/hooks/useModal/{index.7611bf21.js → index.2387ea76.js} +1 -1
  100. package/index.js +71 -67
  101. package/package.json +1 -1
  102. package/{vendor.1af105d6.js → vendor.7751caf6.js} +62 -62
  103. package/components/GridLayout/subcomponents/SizeProvider/index.bfa05dfa.js +0 -62
  104. package/components/ScrollBar/index.d4410cb5.js +0 -72
  105. package/components/areas/components/index.9e48d8ff.js +0 -30
  106. package/hooks/useFormAddEdit/index.15de3ba8.js +0 -49
  107. /package/components/GridLayout/subcomponents/{SizeProvider → WidthProvider}/index.d.ts +0 -0
  108. /package/components/areas/components/{AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header → AreasAdmin}/subcomponents/PanelWindowPopUp/index.d.ts +0 -0
  109. /package/components/areas/components/{AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header → AreasAdmin}/subcomponents/PanelWindowPopUp/types.d.ts +0 -0
@@ -0,0 +1,31 @@
1
+ import "react";
2
+ import "@m4l/core";
3
+ import "@mui/material";
4
+ import "../../Icon/index.435df215.js";
5
+ import "clsx";
6
+ import "react/jsx-runtime";
7
+ import "../../mui_extended/IconButton/index.d88a3f2e.js";
8
+ import "@m4l/graphics";
9
+ import "zustand";
10
+ import "../contexts/AreasContext/index.8af3058c.js";
11
+ import "./AreasAdmin/index.23a09c81.js";
12
+ import "zustand/shallow";
13
+ import "../../ScrollBar/index.65bb2930.js";
14
+ import "../../mui_extended/Accordion/index.d15e51bf.js";
15
+ import "../../mui_extended/Typography/index.443590d6.js";
16
+ import "../../mui_extended/Avatar/index.75e6ed57.js";
17
+ import "react-router-dom";
18
+ import "@mui/material/Button";
19
+ import "../../mui_extended/Button/index.f79eb74e.js";
20
+ import "../../mui_extended/CheckBox.38abccd8.js";
21
+ import "../../mui_extended/Badge/index.8c2b8b66.js";
22
+ import "../../Image/index.c18ebf5a.js";
23
+ import "@mui/lab";
24
+ import "../../mui_extended/MenuActions/index.c53370f6.js";
25
+ import "../../mui_extended/Popover/index.9f35d0eb.js";
26
+ import "../../mui_extended/Stack/index.0e53197c.js";
27
+ import "../../mui_extended/Tab/index.97d04d6b.js";
28
+ import "../../mui_extended/Pager/index.d6c87c44.js";
29
+ import "../../mui_extended/Tooltip/index.5a795dcd.js";
30
+ import "./AreasViewer/index.68eb0f6b.js";
31
+ import "../../LinearProgressIndeterminate/index.60dabc06.js";
@@ -2,8 +2,8 @@ import { WritableDraft } from 'immer/dist/internal';
2
2
  import type { Area, AreasStateWithActions } from './types';
3
3
  import type { WindowState, WindowStateProps } from '../../types';
4
4
  export declare const ROW_HEIGTH_GRIDLAYOUT = 20;
5
- export declare const PADDING_GRIDLAYOUT = 3;
6
- export declare const MARGIN_GRIDLAYOUT = 3;
5
+ export declare const PADDING_GRIDLAYOUT = 4;
6
+ export declare const MARGIN_GRIDLAYOUT = 4;
7
7
  export declare const DEBOUCED_SAVE_TIME = 500;
8
8
  export declare const THROTTLE_RESIZE_TIME = 300;
9
9
  export declare const COOKIE_BREAKPOINT_LAYOUTS = "layoutPros";
@@ -31,7 +31,7 @@ export declare const DEFAULT_LAYOUTS: {
31
31
  };
32
32
  import { Layouts } from '../../../GridLayout/types';
33
33
  export declare const DEFAULT_WINDOW: Pick<WindowState, 'status' | 'moduleActions' | 'cookies' | 'loading' | 'toasties' | 'toastyCount' | 'hashToasties'>;
34
- export declare const DEFAULT_AREA: Omit<Area, 'id' | 'name' | 'loadWindows' | 'viewMode'>;
34
+ export declare const DEFAULT_AREA: Omit<Area, 'id' | 'name' | 'viewMode'>;
35
35
  /**
36
36
  * @description Función de apoyo que crea un área de trabajo,
37
37
  * El Id del area sale de concatenar la fecha actual con un número aleeatorio de 3 digitos
@@ -5,19 +5,20 @@ import { useResponsiveDesktop, useFirstRender } from "@m4l/graphics";
5
5
  import { useHostTools, useModuleDictionary, useNetwork, useModuleSkeleton, EmitEvents } from "@m4l/core";
6
6
  import { devtools } from "zustand/middleware";
7
7
  import { immer } from "zustand/middleware/immer";
8
- import { u as useAreasViewerUtilityClasses } from "../../components/AreasViewer/index.933e506b.js";
9
- import { u as useAreasAdminUtilityClasses } from "../../components/AreasAdmin/index.8ab71eb9.js";
8
+ import { u as useAreasViewerUtilityClasses } from "../../components/AreasViewer/index.68eb0f6b.js";
9
+ import { u as useAreasAdminUtilityClasses } from "../../components/AreasAdmin/index.23a09c81.js";
10
10
  import { c as createDynamicMFStore } from "../DynamicMFParmsContext/index.1607c78e.js";
11
11
  import { g as getAreasDictionary, D as DICCTIONARY } from "../../dictionary.afb7e3d9.js";
12
12
  import "clsx";
13
- import "../../../GridLayout/subcomponents/Griditem/index.6c68811f.js";
14
- import { z as isEqualLayouts } from "../../../GridLayout/index.c55f16eb.js";
13
+ import "../../../GridLayout/subcomponents/Griditem/index.58168132.js";
14
+ import { z as isEqualLayouts } from "../../../GridLayout/index.2383aaf9.js";
15
15
  import { jsx } from "react/jsx-runtime";
16
- import { a as addLayoutItemToBreakPointIfNoExists, b as addLayoutItemToBreakPoints, c as cloneLayouts } from "../../../GridLayout/subcomponents/Responsive/index.a6e33b8d.js";
16
+ import { a as addLayoutItemToBreakPointIfNoExists, b as addLayoutItemToBreakPoints, c as cloneLayouts } from "../../../GridLayout/subcomponents/Responsive/index.a6642437.js";
17
17
  import { debounce, cloneDeep } from "lodash";
18
+ import { useNavigate } from "react-router-dom";
18
19
  const ROW_HEIGTH_GRIDLAYOUT = 20;
19
- const PADDING_GRIDLAYOUT = 3;
20
- const MARGIN_GRIDLAYOUT = 3;
20
+ const PADDING_GRIDLAYOUT = 4;
21
+ const MARGIN_GRIDLAYOUT = 4;
21
22
  const DEBOUCED_SAVE_TIME = 500;
22
23
  const COOKIE_BREAKPOINT_LAYOUTS = "layoutPros";
23
24
  const COOKIE_WINDOWS = "windows";
@@ -41,18 +42,19 @@ const DEFAULT_AREA = {
41
42
  currentLayoutId: "",
42
43
  currentPopUpId: "",
43
44
  breakpoints: BREAKPOINT_SIZES,
44
- cols: NORMALIZED_COLS
45
+ cols: NORMALIZED_COLS,
46
+ loadWindows: false
45
47
  };
46
48
  const addArea = (state) => {
47
49
  const areaId = `area_${new Date().getTime()}_${(Math.random() * 1e3).toFixed(0)}`;
48
50
  const labelNewArea = state.getLabel(getAreasDictionary(DICCTIONARY.label_new_area));
49
51
  let isFree;
50
52
  let name = `${labelNewArea} 1`;
51
- for (let indexNames = 1; indexNames <= state.areas.length + 1; indexNames++) {
52
- name = `${labelNewArea} ${indexNames + state.areas.length}`;
53
+ for (let indexNames = 1; indexNames <= state.areasIds.length + 1; indexNames++) {
54
+ name = `${labelNewArea} ${indexNames + state.areasIds.length}`;
53
55
  isFree = true;
54
- for (let index = 0; index < state.areas.length; index++) {
55
- if (state.hashAreas[state.areas[index]].name === name) {
56
+ for (let index = 0; index < state.areasIds.length; index++) {
57
+ if (state.hashAreas[state.areasIds[index]].name === name) {
56
58
  isFree = false;
57
59
  break;
58
60
  }
@@ -64,11 +66,11 @@ const addArea = (state) => {
64
66
  const newArea = {
65
67
  id: areaId,
66
68
  name,
67
- loadWindows: false,
68
69
  ...DEFAULT_AREA
69
70
  };
70
- state.areas.push(areaId);
71
+ state.areasIds.push(areaId);
71
72
  state.hashAreas[areaId] = newArea;
73
+ state.currentModuleId = "";
72
74
  if (state.loadAreasFromNetwork) {
73
75
  state.networkOperation({
74
76
  method: "POST",
@@ -250,7 +252,7 @@ const createAreasStore = (initProps) => {
250
252
  adminClasses: useAreasAdminUtilityClasses(initProps.ownerState),
251
253
  currentAreaId: "",
252
254
  currentModuleId: "",
253
- areas: [],
255
+ areasIds: [],
254
256
  hashAreas: {},
255
257
  hashWindows: {},
256
258
  hashWindowsModals: {},
@@ -263,63 +265,49 @@ const createAreasStore = (initProps) => {
263
265
  ...startProps,
264
266
  areasActions: {
265
267
  init: () => {
266
- if (get().ownerState.status === "init") {
267
- if (!get().loadAreasFromNetwork) {
268
- get().areasActions.addArea();
269
- set((state) => {
270
- state.ownerState.status = "loaded";
271
- updateOwnerStateClasses(state);
272
- });
273
- } else {
274
- set((state) => {
275
- state.ownerState.status = "loading";
276
- updateOwnerStateClasses(state);
277
- state.networkOperation({
278
- method: "GET",
279
- endPoint: `areas`,
280
- parms: {},
281
- toastSuccess: false
282
- }).then((response) => {
283
- set((otherState) => {
284
- if (response?.data && Array.isArray(response.data) && response.data.length > 0) {
285
- for (let i = 0; i < response.data.length; i++) {
286
- const newArea = {
287
- ...DEFAULT_AREA,
288
- ...response.data[i],
289
- loadWindows: true
290
- };
291
- otherState.hashAreas[newArea.id] = newArea;
292
- otherState.areas.push(newArea.id);
293
- }
294
- } else {
295
- addArea(otherState);
296
- }
297
- });
298
- }).finally(() => {
299
- set((state2) => {
300
- state2.ownerState.status = "loaded";
301
- updateOwnerStateClasses(state2);
302
- });
303
- if (get().areas.length > 0) {
304
- get().areasActions.selectArea(get().areas[0]);
305
- }
306
- });
307
- });
308
- }
268
+ if (get().ownerState.status !== "init") {
269
+ return;
270
+ }
271
+ if (!get().loadAreasFromNetwork) {
272
+ get().areasActions.addArea();
273
+ set((state) => {
274
+ state.ownerState.status = "loaded";
275
+ updateOwnerStateClasses(state);
276
+ });
277
+ return;
309
278
  }
310
- },
311
- editArea: (areaId, newName) => {
312
279
  set((state) => {
313
- if (state.hashAreas[areaId]) {
314
- purgeToastsArea(state, areaId);
315
- state.hashAreas[areaId].name = newName;
316
- state.networkOperation({
317
- method: "PATCH",
318
- endPoint: `areas/${areaId}`,
319
- data: { name: newName },
320
- toastSuccess: false,
321
- toastError: false
322
- });
280
+ state.ownerState.status = "loading";
281
+ updateOwnerStateClasses(state);
282
+ });
283
+ get().networkOperation({
284
+ method: "GET",
285
+ endPoint: `areas`,
286
+ parms: {},
287
+ toastSuccess: false
288
+ }).then((response) => {
289
+ set((state) => {
290
+ if (response?.data && Array.isArray(response.data) && response.data.length > 0) {
291
+ for (let i = 0; i < response.data.length; i++) {
292
+ const newArea = {
293
+ ...DEFAULT_AREA,
294
+ ...response.data[i],
295
+ loadWindows: true
296
+ };
297
+ state.hashAreas[newArea.id] = newArea;
298
+ state.areasIds.push(newArea.id);
299
+ }
300
+ } else {
301
+ addArea(state);
302
+ }
303
+ });
304
+ }).finally(() => {
305
+ set((state) => {
306
+ state.ownerState.status = "loaded";
307
+ updateOwnerStateClasses(state);
308
+ });
309
+ if (get().areasIds.length > 0 && get().currentAreaId === "") {
310
+ get().areasActions.selectArea(get().areasIds[0]);
323
311
  }
324
312
  });
325
313
  },
@@ -331,25 +319,42 @@ const createAreasStore = (initProps) => {
331
319
  get().areasActions.selectArea(newId);
332
320
  return newId;
333
321
  },
322
+ editArea: (areaId, newName) => {
323
+ set((state) => {
324
+ if (state.hashAreas[areaId]) {
325
+ state.hashAreas[areaId].name = newName;
326
+ if (state.loadAreasFromNetwork) {
327
+ state.networkOperation({
328
+ method: "PATCH",
329
+ endPoint: `areas/${areaId}`,
330
+ data: { name: newName },
331
+ toastSuccess: false,
332
+ toastError: false
333
+ });
334
+ }
335
+ }
336
+ });
337
+ },
334
338
  deleteArea: (areaId) => {
335
339
  let selectNewAreaId = "";
336
340
  set((state) => {
337
- const removeIndex = state.areas.indexOf(areaId);
341
+ const ha = state.hashAreas[areaId];
342
+ if (!ha || state.areasIds.length < 2) {
343
+ return;
344
+ }
345
+ purgeToastsArea(state, areaId);
346
+ const removeIndex = state.areasIds.indexOf(areaId);
338
347
  if (removeIndex > -1) {
339
348
  for (const key in state.hashWindows) {
340
349
  if (state.hashWindows[key].areaId === areaId) {
341
350
  delete state.hashWindows[key];
342
351
  }
343
352
  }
344
- state.areas.splice(removeIndex, 1);
353
+ state.areasIds.splice(removeIndex, 1);
345
354
  delete state.hashAreas[areaId];
346
355
  }
347
356
  if (state.currentAreaId === areaId) {
348
- if (state.areas.length > 0) {
349
- selectNewAreaId = state.areas[0];
350
- } else {
351
- state.currentAreaId = "";
352
- }
357
+ selectNewAreaId = state.areasIds[0];
353
358
  }
354
359
  if (state.loadAreasFromNetwork) {
355
360
  state.networkOperation({
@@ -652,6 +657,12 @@ const createAreasStore = (initProps) => {
652
657
  selectLayout: (areaId, layoutId) => {
653
658
  set((state) => {
654
659
  const area = state.hashAreas[areaId];
660
+ const moduleId = state.hashWindows[layoutId].moduleId;
661
+ const searchParams = new URLSearchParams(window.location.search);
662
+ searchParams.set("module", moduleId);
663
+ state.navigate({
664
+ search: `?${searchParams.toString()}`
665
+ });
655
666
  if (state.hashWindows[layoutId].emergeType === "layout") {
656
667
  area.currentLayoutId = layoutId;
657
668
  state.currentModuleId = state.hashWindows[layoutId].moduleId;
@@ -1035,6 +1046,7 @@ function AreasProvider(props) {
1035
1046
  } = useNetwork();
1036
1047
  const isDesktop = useResponsiveDesktop();
1037
1048
  const isSkeleton = useModuleSkeleton();
1049
+ const navigate = useNavigate();
1038
1050
  const isFirstRender = useFirstRender([getLabel]);
1039
1051
  const areasStoreRef = useRef();
1040
1052
  if (!areasStoreRef.current) {
@@ -1043,6 +1055,7 @@ function AreasProvider(props) {
1043
1055
  loadAreasFromNetwork,
1044
1056
  loadCookiesFromNetwork,
1045
1057
  networkOperation,
1058
+ navigate,
1046
1059
  ownerState: {
1047
1060
  status: "init",
1048
1061
  isMobile: !isDesktop,
@@ -1061,7 +1074,7 @@ function AreasProvider(props) {
1061
1074
  } = useStore(areasStoreRef.current, (state) => state.areasActions, shallow);
1062
1075
  const addWindow = useCallback((newWindow) => {
1063
1076
  const currentAreaId = areasStoreRef.current?.getState().currentAreaId;
1064
- const areas = areasStoreRef.current?.getState().areas;
1077
+ const areas = areasStoreRef.current?.getState().areasIds;
1065
1078
  if (currentAreaId && areas) {
1066
1079
  areasStoreRef.current?.getState().areaActions.addWindow(newWindow);
1067
1080
  }
@@ -7,6 +7,7 @@ import { DebouncedFunc } from 'lodash';
7
7
  import { LayoutItem } from '../../../GridLayout';
8
8
  import { ContainerChangeEvent } from '../../../GridLayout/subcomponents/Responsive/types';
9
9
  import { Layout, Breakpoint, Layouts } from '../../../GridLayout/types';
10
+ import { NavigateFunction } from 'react-router-dom';
10
11
  export declare type WinLayoutItem = LayoutItem & {
11
12
  winType: WinType;
12
13
  };
@@ -107,9 +108,9 @@ export interface AreasState {
107
108
  hashWindowsModals: HashWindowsByModals;
108
109
  windowModal?: ModalStateProps;
109
110
  /**
110
- * "areas" Areas de trabajo
111
+ * "areasIds" Areas de trabajo para saber en que orden se muestran en el AreasAdmin
111
112
  */
112
- areas: string[];
113
+ areasIds: string[];
113
114
  /**
114
115
  * "hashAreas" Areas de trabajo
115
116
  */
@@ -122,6 +123,10 @@ export interface AreasState {
122
123
  * "networkOperation" funcion que usará el Store para enviar las peticiones de red
123
124
  */
124
125
  networkOperation: (props: NetworkProps) => Promise<any>;
126
+ /**
127
+ * "navigate" Funcion para modificar la ruta de navegación de la pápina
128
+ */
129
+ navigate: NavigateFunction;
125
130
  /**
126
131
  * "getLabel" funcion que usará para traducir las etiquetas de diccionario
127
132
  */
@@ -130,27 +135,34 @@ export interface AreasState {
130
135
  export interface AreasStateWithActions extends AreasState {
131
136
  areasActions: {
132
137
  /**
133
- * @description inicializa el componente, si la función onLoad está seteada, se invoca
138
+ * @description inicializa el store cargando las áreas de trabajo.
139
+ * Una vez termina el proceso, actualiza el estado de carga (ownerState.status) a "loaded".
140
+ * Normalmente es asyncrono en producción por el llamado al endpoint áreas.
134
141
  */
135
142
  init: () => void;
136
143
  /**
137
- * @description Agrega un area de trabajo, si esta activa "loadAreasFromNetwork" llama al API de agregado
144
+ * @description Arega un area de trabajo y la selecciona. Adiconalmente limpia el currentModuleId
145
+ * Si esta habilitado "loadAreasFromNetwork" invoca al endpoint de POST de areas
138
146
  * @returns id del ara de trabajo
139
147
  */
140
148
  addArea: () => string;
141
149
  /**
142
- * @description Edita el nombre del área de trabajo y sincroniza los cambios en la API.
150
+ * @description Edita el nombre del área de trabajo.
151
+ * Si está habilitado y sincroniza los cambios en la API.
143
152
  * @returns nombre del area de trabajo
144
153
  */
145
154
  editArea: (idArea: string, newName: string) => void;
146
155
  /**
147
- *
156
+ * Selecciona el area y adicionalmente notifica si el camnbio de modulo para que
157
+ * Actualiza el currentModuleId por el layout seleccionado que tenga el area actualmente.
158
+ * Con el fin de poder lanzar el cambio de módulo y se vea reflejado en el menu.
159
+ * Carga adicionalmente las ventanas cuando se seleccione por primera vez si eestá habilitado el uso de API (loadAreasFromNetwork)
148
160
  * @param newAreaId Id de area a seleccionar
149
161
  * @returns
150
162
  */
151
163
  selectArea: (newAreaId: string) => void;
152
164
  /**
153
- * @description Borra un area de trabajo, si esta activa "loadAreasFromNetwork" llama al API
165
+ * @description Borra un area de trabajo, si esta activa "loadAreasFromNetwork" llama a la API.
154
166
  * @param areaId Id de area a borrar
155
167
  * @returns void
156
168
  */
@@ -207,7 +219,7 @@ export interface AreasStateWithActions extends AreasState {
207
219
  };
208
220
  }
209
221
  export declare type DefaultAreasStoreProps = Omit<AreasState, 'currentArea'>;
210
- export declare type InitialAreasStoreProps = Pick<AreasState, 'networkOperation' | 'loadAreasFromNetwork' | 'loadCookiesFromNetwork' | 'getLabel' | 'ownerState'> & Partial<DefaultAreasStoreProps>;
222
+ export declare type InitialAreasStoreProps = Pick<AreasState, 'networkOperation' | 'loadAreasFromNetwork' | 'loadCookiesFromNetwork' | 'getLabel' | 'navigate' | 'ownerState'> & Partial<DefaultAreasStoreProps>;
211
223
  export interface AreasProviderProps {
212
224
  children: ReactNode;
213
225
  loadAreasFromNetwork: boolean;
@@ -1,2 +1,2 @@
1
- import "./AreasContext/index.230d1584.js";
1
+ import "./AreasContext/index.8af3058c.js";
2
2
  import "./WindowToolsMFContext/index.8f3e2a04.js";
@@ -1,6 +1,6 @@
1
1
  import { useContext } from "react";
2
2
  import { useStore } from "zustand";
3
- import { A as AreasContext } from "../../contexts/AreasContext/index.230d1584.js";
3
+ import { A as AreasContext } from "../../contexts/AreasContext/index.8af3058c.js";
4
4
  function useAreasStore(selector, equalityFn) {
5
5
  const context = useContext(AreasContext);
6
6
  if (!context)
@@ -1,32 +1,33 @@
1
1
  import { useEffect } from "react";
2
2
  import "@m4l/core";
3
3
  import "@mui/material";
4
- import "../Icon/index.d1402200.js";
4
+ import "../Icon/index.435df215.js";
5
5
  import "clsx";
6
6
  import "react/jsx-runtime";
7
- import "../mui_extended/IconButton/index.62aea582.js";
7
+ import "../mui_extended/IconButton/index.d88a3f2e.js";
8
8
  import "@m4l/graphics";
9
9
  import "zustand";
10
- import "./contexts/AreasContext/index.230d1584.js";
11
- import "./components/AreasAdmin/index.8ab71eb9.js";
10
+ import "./contexts/AreasContext/index.8af3058c.js";
11
+ import "./components/AreasAdmin/index.23a09c81.js";
12
12
  import "zustand/shallow";
13
- import "../ScrollBar/index.d4410cb5.js";
14
- import "../mui_extended/Accordion/index.46771196.js";
13
+ import "../ScrollBar/index.65bb2930.js";
14
+ import "../mui_extended/Accordion/index.d15e51bf.js";
15
15
  import "../mui_extended/Typography/index.443590d6.js";
16
16
  import "../mui_extended/Avatar/index.75e6ed57.js";
17
17
  import "react-router-dom";
18
18
  import "@mui/material/Button";
19
- import "../mui_extended/Button/index.40af964e.js";
19
+ import "../mui_extended/Button/index.f79eb74e.js";
20
20
  import "../mui_extended/CheckBox.38abccd8.js";
21
- import "../mui_extended/Badge/index.cad260fe.js";
21
+ import "../mui_extended/Badge/index.8c2b8b66.js";
22
22
  import "../Image/index.c18ebf5a.js";
23
23
  import "@mui/lab";
24
- import "../mui_extended/MenuActions/index.2493b1b1.js";
24
+ import "../mui_extended/MenuActions/index.c53370f6.js";
25
25
  import "../mui_extended/Popover/index.9f35d0eb.js";
26
- import "../mui_extended/Pager/index.a7f87c96.js";
27
- import "../mui_extended/Tab/index.756fe693.js";
26
+ import "../mui_extended/Stack/index.0e53197c.js";
27
+ import "../mui_extended/Tab/index.97d04d6b.js";
28
+ import "../mui_extended/Pager/index.d6c87c44.js";
28
29
  import "../mui_extended/Tooltip/index.5a795dcd.js";
29
- import "./components/AreasViewer/index.933e506b.js";
30
+ import "./components/AreasViewer/index.68eb0f6b.js";
30
31
  import "../LinearProgressIndeterminate/index.60dabc06.js";
31
32
  import "./contexts/WindowToolsMFContext/index.8f3e2a04.js";
32
33
  import "./contexts/DynamicMFParmsContext/index.1607c78e.js";
@@ -1,6 +1,6 @@
1
1
  import { useMemo } from "react";
2
2
  import { useModuleDictionary, useEnvironment } from "@m4l/core";
3
- import { I as Icon } from "../../Icon/index.d1402200.js";
3
+ import { I as Icon } from "../../Icon/index.435df215.js";
4
4
  import { W as WrapperComponent } from "../../WrapperComponent/index.5e872594.js";
5
5
  import { jsx } from "react/jsx-runtime";
6
6
  const BOOLEAN_FORMATTER_DICTIONARY_KEY = `boolean_formatter`;
@@ -2,11 +2,11 @@ import { W as WrapperComponent } from "../WrapperComponent/index.5e872594.js";
2
2
  import { jsx } from "react/jsx-runtime";
3
3
  import { useModuleDictionary } from "@m4l/core";
4
4
  import "react";
5
- import "../Icon/index.d1402200.js";
5
+ import "../Icon/index.435df215.js";
6
6
  import "@mui/material";
7
7
  import "clsx";
8
8
  import "@m4l/graphics";
9
- import { a as BOOLEAN_FORMATTER_DICTIONARY_KEY, b as BOOLEAN_FORMATTER_DICTIONARY_LABELS } from "./BooleanFormatter/index.b2f02bc4.js";
9
+ import { a as BOOLEAN_FORMATTER_DICTIONARY_KEY, b as BOOLEAN_FORMATTER_DICTIONARY_LABELS } from "./BooleanFormatter/index.14cfcbc7.js";
10
10
  function getFormatConcatenated(values, separator) {
11
11
  const returnSymbol = "";
12
12
  if (values === null)
@@ -6,25 +6,26 @@ import { useMemo, useRef, useState, useEffect } from "react";
6
6
  import { T as TEST_PROP_ID } from "../../../test/constants_no_mock.86c553a9.js";
7
7
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
8
8
  import { T as Typography } from "../../mui_extended/Typography/index.443590d6.js";
9
- import { H as HelperText } from "../../HelperText/index.a47ff233.js";
10
- import { I as IconButton } from "../../mui_extended/IconButton/index.62aea582.js";
9
+ import { H as HelperText } from "../../HelperText/index.bbbe24c9.js";
10
+ import { I as IconButton } from "../../mui_extended/IconButton/index.d88a3f2e.js";
11
11
  import { useResponsiveDesktop } from "@m4l/graphics";
12
12
  import { styled } from "@mui/material/styles";
13
13
  import "clsx";
14
14
  import { unstable_composeClasses } from "@mui/base";
15
- import "../../Icon/index.d1402200.js";
16
- import "../../mui_extended/Accordion/index.46771196.js";
15
+ import "../../Icon/index.435df215.js";
16
+ import "../../mui_extended/Accordion/index.d15e51bf.js";
17
17
  import "../../mui_extended/Avatar/index.75e6ed57.js";
18
18
  import "react-router-dom";
19
19
  import "@mui/material/Button";
20
- import "../../mui_extended/Button/index.40af964e.js";
20
+ import "../../mui_extended/Button/index.f79eb74e.js";
21
21
  import "../../mui_extended/CheckBox.38abccd8.js";
22
- import "../../mui_extended/Badge/index.cad260fe.js";
22
+ import "../../mui_extended/Badge/index.8c2b8b66.js";
23
23
  import "@mui/lab";
24
- import "../../mui_extended/MenuActions/index.2493b1b1.js";
24
+ import "../../mui_extended/MenuActions/index.c53370f6.js";
25
25
  import "../../mui_extended/Popover/index.9f35d0eb.js";
26
- import "../../mui_extended/Pager/index.a7f87c96.js";
27
- import "../../mui_extended/Tab/index.756fe693.js";
26
+ import "../../mui_extended/Stack/index.0e53197c.js";
27
+ import "../../mui_extended/Tab/index.97d04d6b.js";
28
+ import "../../mui_extended/Pager/index.d6c87c44.js";
28
29
  import "../../mui_extended/Tooltip/index.5a795dcd.js";
29
30
  const AutocompleteRoot = styled("div")(({
30
31
  theme
@@ -5,7 +5,7 @@ import { styled } from "@mui/material/styles";
5
5
  import { generateUtilityClasses, generateUtilityClass } from "@mui/material";
6
6
  import { unstable_composeClasses } from "@mui/base";
7
7
  import { T as TEST_PROP_ID } from "../../../test/constants_no_mock.86c553a9.js";
8
- import { R as RHFAutocomplete, g as getRHFAutocompleteComponentsDictionary } from "../RHFAutocomplete/index.d5afb409.js";
8
+ import { R as RHFAutocomplete, g as getRHFAutocompleteComponentsDictionary } from "../RHFAutocomplete/index.60c6f592.js";
9
9
  import { jsx } from "react/jsx-runtime";
10
10
  styled("div")(() => ({
11
11
  display: "flex",
@@ -2,29 +2,30 @@ import { useFormContext, Controller } from "react-hook-form";
2
2
  import { styled } from "@mui/material/styles";
3
3
  import { Skeleton, generateUtilityClasses, generateUtilityClass } from "@mui/material";
4
4
  import { unstable_composeClasses } from "@mui/base";
5
- import { H as HelperText } from "../../HelperText/index.a47ff233.js";
5
+ import { H as HelperText } from "../../HelperText/index.bbbe24c9.js";
6
6
  import { T as TEST_PROP_ID } from "../../../test/constants_no_mock.86c553a9.js";
7
7
  import { useResponsiveDesktop } from "@m4l/graphics";
8
8
  import "react";
9
9
  import "@m4l/core";
10
- import "../../Icon/index.d1402200.js";
10
+ import "../../Icon/index.435df215.js";
11
11
  import "clsx";
12
12
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
13
- import "../../mui_extended/IconButton/index.62aea582.js";
14
- import "../../mui_extended/Accordion/index.46771196.js";
13
+ import "../../mui_extended/IconButton/index.d88a3f2e.js";
14
+ import "../../mui_extended/Accordion/index.d15e51bf.js";
15
15
  import "../../mui_extended/Typography/index.443590d6.js";
16
16
  import "../../mui_extended/Avatar/index.75e6ed57.js";
17
17
  import "react-router-dom";
18
18
  import "@mui/material/Button";
19
- import "../../mui_extended/Button/index.40af964e.js";
19
+ import "../../mui_extended/Button/index.f79eb74e.js";
20
20
  import { C as CheckBox } from "../../mui_extended/CheckBox.38abccd8.js";
21
- import "../../mui_extended/Badge/index.cad260fe.js";
21
+ import "../../mui_extended/Badge/index.8c2b8b66.js";
22
22
  import "../../Image/index.c18ebf5a.js";
23
23
  import "@mui/lab";
24
- import "../../mui_extended/MenuActions/index.2493b1b1.js";
24
+ import "../../mui_extended/MenuActions/index.c53370f6.js";
25
25
  import "../../mui_extended/Popover/index.9f35d0eb.js";
26
- import "../../mui_extended/Pager/index.a7f87c96.js";
27
- import "../../mui_extended/Tab/index.756fe693.js";
26
+ import "../../mui_extended/Stack/index.0e53197c.js";
27
+ import "../../mui_extended/Tab/index.97d04d6b.js";
28
+ import "../../mui_extended/Pager/index.d6c87c44.js";
28
29
  import "../../mui_extended/Tooltip/index.5a795dcd.js";
29
30
  const RHFCheckboxRoot = styled("div")(({
30
31
  theme
@@ -6,25 +6,26 @@ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
6
6
  import { useFormatter, useResponsiveDesktop } from "@m4l/graphics";
7
7
  import { useState, useEffect } from "react";
8
8
  import clsx from "clsx";
9
- import "../../Icon/index.d1402200.js";
9
+ import "../../Icon/index.435df215.js";
10
10
  import { T as TEST_PROP_ID } from "../../../test/constants_no_mock.86c553a9.js";
11
- import "../../mui_extended/IconButton/index.62aea582.js";
12
- import "../../mui_extended/Accordion/index.46771196.js";
11
+ import "../../mui_extended/IconButton/index.d88a3f2e.js";
12
+ import "../../mui_extended/Accordion/index.d15e51bf.js";
13
13
  import { T as Typography } from "../../mui_extended/Typography/index.443590d6.js";
14
14
  import "../../mui_extended/Avatar/index.75e6ed57.js";
15
15
  import "react-router-dom";
16
16
  import "@mui/material/Button";
17
- import "../../mui_extended/Button/index.40af964e.js";
17
+ import "../../mui_extended/Button/index.f79eb74e.js";
18
18
  import "../../mui_extended/CheckBox.38abccd8.js";
19
- import "../../mui_extended/Badge/index.cad260fe.js";
19
+ import "../../mui_extended/Badge/index.8c2b8b66.js";
20
20
  import "../../Image/index.c18ebf5a.js";
21
21
  import "@mui/lab";
22
- import "../../mui_extended/MenuActions/index.2493b1b1.js";
22
+ import "../../mui_extended/MenuActions/index.c53370f6.js";
23
23
  import "../../mui_extended/Popover/index.9f35d0eb.js";
24
- import "../../mui_extended/Pager/index.a7f87c96.js";
25
- import "../../mui_extended/Tab/index.756fe693.js";
24
+ import "../../mui_extended/Stack/index.0e53197c.js";
25
+ import "../../mui_extended/Tab/index.97d04d6b.js";
26
+ import "../../mui_extended/Pager/index.d6c87c44.js";
26
27
  import "../../mui_extended/Tooltip/index.5a795dcd.js";
27
- import { H as HelperText } from "../../HelperText/index.a47ff233.js";
28
+ import { H as HelperText } from "../../HelperText/index.bbbe24c9.js";
28
29
  import { styled } from "@mui/material/styles";
29
30
  import { unstable_composeClasses } from "@mui/base";
30
31
  const SKTRHFWrapperTextField = styled("div")(({
@@ -1,7 +1,7 @@
1
1
  import { styled, generateUtilityClasses, generateUtilityClass } from "@mui/material";
2
2
  import { useFormContext, Controller } from "react-hook-form";
3
- import { H as HelperText } from "../../HelperText/index.a47ff233.js";
4
- import { P as Period } from "../../Period/index.e129cdec.js";
3
+ import { H as HelperText } from "../../HelperText/index.bbbe24c9.js";
4
+ import { P as Period } from "../../Period/index.32d475b8.js";
5
5
  import { unstable_composeClasses } from "@mui/base";
6
6
  import { jsx, jsxs } from "react/jsx-runtime";
7
7
  const RHFPeriodRoot = styled("div")(({