@m4l/components 0.1.76 → 0.1.78

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 (133) hide show
  1. package/@types/export.d.ts +22 -3
  2. package/components/AccountPopover/{index.47cf6c43.js → index.7e76dbb7.js} +8 -7
  3. package/components/AppBar/{index.f04f5e45.js → index.06858422.js} +8 -7
  4. package/components/CommonActions/components/ActionCancel/{index.453c2d24.js → index.d536ccfa.js} +2 -2
  5. package/components/CommonActions/components/ActionFormCancel/{index.c2a2fd55.js → index.a915b105.js} +19 -19
  6. package/components/CommonActions/components/ActionFormIntro/{index.25d33912.js → index.14e65d6c.js} +2 -2
  7. package/components/CommonActions/components/ActionIntro/{index.c653a266.js → index.aa1648eb.js} +2 -2
  8. package/components/CommonActions/components/Actions/{index.e376a68e.js → index.52125041.js} +17 -18
  9. package/components/DataGrid/{index.ffaf000e.js → index.9fb3e6a1.js} +40 -31
  10. package/components/DataGrid/types.d.ts +5 -1
  11. package/components/DraggableWindow/{index.b08af1dc.js → index.c702d3f2.js} +1 -1
  12. package/components/DynamicFilter/constants.d.ts +1 -0
  13. package/components/DynamicFilter/contexts/DynamicFilterContext/store.d.ts +6 -1
  14. package/components/DynamicFilter/{index.d7c03a61.js → index.d1a2e2d1.js} +54 -47
  15. package/components/DynamicFilter/tests/contants.d.ts +2 -3
  16. package/components/DynamicFilter/types.d.ts +4 -0
  17. package/components/GridLayout/GridLayout.d.ts +6 -0
  18. package/components/GridLayout/Responsive/index.0905a698.js +353 -0
  19. package/components/GridLayout/WidthProvider/index.9a26dfe4.js +65 -0
  20. package/components/GridLayout/calculateUtils.d.ts +42 -0
  21. package/components/GridLayout/index.d.ts +6 -0
  22. package/components/GridLayout/index.da6fd387.js +1410 -0
  23. package/components/GridLayout/subcomponents/GridItem/index.d.ts +26 -0
  24. package/components/GridLayout/subcomponents/GridItem/types.d.ts +78 -0
  25. package/components/GridLayout/subcomponents/Responsive/index.d.ts +3 -0
  26. package/components/GridLayout/subcomponents/Responsive/responsiveUtils.d.ts +64 -0
  27. package/components/GridLayout/subcomponents/Responsive/types.d.ts +69 -0
  28. package/components/GridLayout/subcomponents/WidthProvider/index.d.ts +16 -0
  29. package/components/GridLayout/types.d.ts +355 -0
  30. package/components/GridLayout/utils.d.ts +123 -0
  31. package/components/HelperText/{index.9864f773.js → index.a019742c.js} +8 -7
  32. package/components/Icon/{index.9dae8337.js → index.9fcd1476.js} +1 -1
  33. package/components/LanguagePopover/{index.938c6675.js → index.98b63dcb.js} +8 -7
  34. package/components/LinearProgressIndeterminate/{index.d34d398f.js → index.60dabc06.js} +1 -1
  35. package/components/ModalDialog/{index.d9c5d400.js → index.d9937d46.js} +8 -56
  36. package/components/NavLink/{index.21c8fd90.js → index.a5dea6d3.js} +8 -7
  37. package/components/ObjectLogs/{index.a2709fc2.js → index.d9d20b9d.js} +27 -21
  38. package/components/ObjectLogs/types.d.ts +1 -0
  39. package/components/PaperForm/{index.5e1bc99f.js → index.ba38a0bd.js} +1 -1
  40. package/components/Period/{index.526791a3.js → index.7b94c418.js} +22 -23
  41. package/components/PropertyValue/constants.d.ts +3 -0
  42. package/components/PropertyValue/{index.8a1adf3e.js → index.45c73161.js} +17 -11
  43. package/components/PropertyValue/types.d.ts +2 -1
  44. package/components/Resizeable/{index.f6e48e56.js → index.9a9c79a4.js} +1 -1
  45. package/components/SideBar/{index.9e1a5b96.js → index.2f497e6c.js} +5 -5
  46. package/components/areas/components/AreasAdmin/classes/index.d.ts +1 -1
  47. package/components/areas/components/AreasAdmin/classes/types.d.ts +5 -0
  48. package/components/areas/components/AreasAdmin/{index.946eebb9.js → index.43ecd998.js} +167 -81
  49. package/components/areas/components/AreasAdmin/subcomponents/AreaChip/types.d.ts +0 -1
  50. package/components/areas/components/AreasAdmin/subcomponents/AreaChipMobile/subcomponents/PanelWindowPopUp/index.d.ts +3 -0
  51. package/components/areas/components/AreasAdmin/subcomponents/AreaChipMobile/subcomponents/PanelWindowPopUp/types.d.ts +3 -0
  52. package/components/areas/components/AreasViewer/classes/index.d.ts +1 -1
  53. package/components/areas/components/AreasViewer/classes/types.d.ts +3 -0
  54. package/components/areas/components/AreasViewer/{index.bf4191ea.js → index.14e62059.js} +326 -345
  55. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/{GridLayout → AreaGridLayout}/index.d.ts +1 -1
  56. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/index.d.ts +2 -2
  57. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/index.d.ts +1 -7
  58. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/subcomponents/WindowPopUpsList/index.d.ts +3 -0
  59. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/subcomponents/WindowPopUpsList/types.d.ts +2 -0
  60. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/types.d.ts +6 -0
  61. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/types.d.ts +1 -1
  62. package/components/areas/components/index.a87653a9.js +29 -0
  63. package/components/areas/contexts/AreasContext/helper.d.ts +8 -16
  64. package/components/areas/contexts/AreasContext/{index.f0397b7c.js → index.02c4e7be.js} +262 -336
  65. package/components/areas/contexts/AreasContext/types.d.ts +22 -20
  66. package/components/areas/contexts/{index.1809650a.js → index.1ff9b360.js} +1 -1
  67. package/components/areas/{dictionary.3fabae50.js → dictionary.afb7e3d9.js} +5 -2
  68. package/components/areas/dictionary.d.ts +4 -1
  69. package/components/areas/hooks/useAreas/{index.40917e99.js → index.85e4b2e2.js} +1 -1
  70. package/components/areas/{icons.19cde4b4.js → icons.8266ccc8.js} +5 -1
  71. package/components/areas/icons.d.ts +4 -0
  72. package/components/areas/{index.9bd48013.js → index.d1dcccf5.js} +12 -11
  73. package/components/areas/types.d.ts +29 -22
  74. package/components/formatters/BooleanFormatter/{index.431dc923.js → index.e8de8e4c.js} +1 -1
  75. package/components/formatters/{index.e1af75e6.js → index.67aeb049.js} +2 -2
  76. package/components/hook-form/RHFAutocomplete/{index.a063dc44.js → index.6aa51705.js} +25 -13
  77. package/components/hook-form/RHFAutocompleteAsync/{index.ddfd9cc9.js → index.1a3dfe5f.js} +1 -1
  78. package/components/hook-form/RHFCheckbox/{index.7e7f220b.js → index.a08a65b3.js} +1 -1
  79. package/components/hook-form/RHFDateTime/{index.d330709b.js → index.4d671108.js} +10 -9
  80. package/components/hook-form/RHFPeriod/{index.e2b1293b.js → index.39b4be49.js} +2 -2
  81. package/components/hook-form/RHFTextField/{index.e5336d09.js → index.9004e898.js} +5 -5
  82. package/components/hook-form/RHFUpload/{index.17e7f9eb.js → index.bed8573e.js} +9 -11
  83. package/components/index.d.ts +1 -0
  84. package/components/modal/{WindowBase.7acb9f1d.js → WindowBase.a0c0b322.js} +10 -9
  85. package/components/modal/{WindowConfirm.9b829837.js → WindowConfirm.6c063f2d.js} +19 -19
  86. package/components/modal/classes/index.d.ts +1 -0
  87. package/components/modal/classes/types.d.ts +1 -0
  88. package/components/modal/{index.1b25b61d.js → index.00efea85.js} +19 -17
  89. package/components/mui_extended/Accordion/constants.d.ts +1 -0
  90. package/components/mui_extended/Accordion/{index.3faafd8b.js → index.9877f7bf.js} +8 -9
  91. package/components/mui_extended/Accordion/types.d.ts +1 -0
  92. package/components/mui_extended/Badge/Badge.d.ts +3 -0
  93. package/components/mui_extended/Badge/classes/constants.d.ts +1 -0
  94. package/components/mui_extended/Badge/classes/index.d.ts +6 -0
  95. package/components/mui_extended/Badge/classes/types.d.ts +6 -0
  96. package/components/mui_extended/Badge/index.8c2b8b66.js +36 -0
  97. package/components/mui_extended/Badge/index.d.ts +2 -0
  98. package/components/mui_extended/Badge/tests/constants.d.ts +1 -0
  99. package/components/mui_extended/Badge/tests/utils.d.ts +2 -0
  100. package/components/mui_extended/Badge/types.d.ts +4 -0
  101. package/components/mui_extended/Button/{index.fdb5dcbd.js → index.4288f9fc.js} +8 -3
  102. package/components/mui_extended/IconButton/{index.1a9d4fa5.js → index.12f1a3c3.js} +4 -1
  103. package/components/mui_extended/MenuActions/{index.ba1da3b3.js → index.43a2e1ae.js} +41 -13
  104. package/components/mui_extended/MenuActions/index.d.ts +3 -2
  105. package/components/mui_extended/MenuActions/types.d.ts +9 -0
  106. package/components/mui_extended/Pager/{index.67bda2c5.js → index.2f6d6d7d.js} +1 -1
  107. package/components/mui_extended/Tab/constant.d.ts +1 -0
  108. package/components/mui_extended/Tab/{index.9e2f6e34.js → index.7c82e43d.js} +5 -6
  109. package/components/mui_extended/Tab/types.d.ts +1 -0
  110. package/components/mui_extended/{index.73e536de.js → index.0e2ff642.js} +8 -7
  111. package/components/mui_extended/index.d.ts +1 -0
  112. package/contexts/ModalContext/{index.699f95fa.js → index.e9a7ba4a.js} +1 -1
  113. package/hooks/useModal/{index.7b7d26ba.js → index.8e85f7ae.js} +1 -1
  114. package/index.js +228 -214
  115. package/node_modules.d73a220d.js +363 -0
  116. package/package.json +4 -3
  117. package/{react-draggable.6d7949a3.js → react-draggable.7abb5d0a.js} +3 -2
  118. package/{react-resizable.b6f8e04a.js → react-resizable.ba08699a.js} +13 -12
  119. package/test/getNameDataTestId.d.ts +1 -0
  120. package/utils/{index.008b4c2a.js → index.c43a95f4.js} +0 -15
  121. package/vendor.e353394b.js +124 -0
  122. package/components/DynamicFilter/tests/types.d.ts +0 -2
  123. package/components/DynamicFilter/tests/utils.d.ts +0 -2
  124. package/components/PropertyValue/tests/constants.d.ts +0 -1
  125. package/components/PropertyValue/tests/utils.d.ts +0 -2
  126. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/WindowPopUp/index.d.ts +0 -4
  127. package/components/areas/components/index.2bb534cb.js +0 -28
  128. package/components/modal/ModalDialog/types.d.ts +0 -7
  129. package/components/mui_extended/Accordion/tests/constants.d.ts +0 -1
  130. package/components/mui_extended/Accordion/tests/utils.d.ts +0 -2
  131. package/components/mui_extended/Tab/tests/constants.d.ts +0 -1
  132. package/components/mui_extended/Tab/tests/utils.d.ts +0 -2
  133. /package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/{GridLayout → AreaGridLayout}/types.d.ts +0 -0
@@ -5,89 +5,90 @@ var __publicField = (obj, key, value) => {
5
5
  return value;
6
6
  };
7
7
  import { styled } from "@mui/material/styles";
8
- import { r as react_resizable_css } from "../../../../react-resizable.b6f8e04a.js";
9
- import { generateUtilityClasses, Skeleton, Dialog } from "@mui/material";
8
+ import { r as react_resizable_css } from "../../../../react-resizable.ba08699a.js";
9
+ import { generateUtilityClasses, Skeleton, useTheme, Dialog } from "@mui/material";
10
10
  import { unstable_composeClasses } from "@mui/base";
11
- import { g as getComponentUtilityClass } from "../../../../utils/index.008b4c2a.js";
11
+ import { g as getComponentUtilityClass } from "../../../../utils/index.c43a95f4.js";
12
12
  import { a as AREAS_VIEWER_CLASS_NAME } from "../../constants.66529246.js";
13
- import React__default, { useMemo, useState, useCallback, useEffect } from "react";
14
- import { WidthProvider, Responsive } from "react-grid-layout";
15
13
  import { shallow } from "zustand/shallow";
16
- import "../../../animate/index.1f8eadd4.js";
17
- import "framer-motion";
18
- import { jsxs, jsx, Fragment } from "react/jsx-runtime";
19
- import "react-router-dom";
20
- import "../../../animate/LoadingScreen/index.1d0c4307.js";
21
- import "../../../animate/PropagateLoader/index.7fab43c8.js";
22
- import { useModuleDictionary, useEnvironment, useModuleSkeleton, useNetwork, useHostTools, axiosOperation } from "@m4l/core";
23
- import { I as Icon } from "../../../Icon/index.9dae8337.js";
24
- import { I as IconButton } from "../../../mui_extended/IconButton/index.1a9d4fa5.js";
14
+ import React__default, { useMemo, useState, useCallback, useEffect } from "react";
25
15
  import clsx from "clsx";
26
- import { useResponsiveDesktop, useHostTheme, useFormatter, useLocales, useFirstRender, useResizeObserver } from "@m4l/graphics";
27
- import { u as useAreasStore } from "../../hooks/useAreas/index.40917e99.js";
28
- import "../AreasAdmin/index.946eebb9.js";
29
- import { I as ICONS } from "../../icons.19cde4b4.js";
30
- import "../../../ScrollBar/index.bbe48f4d.js";
31
- import "../../../mui_extended/Accordion/index.3faafd8b.js";
16
+ import { u as useAreasStore } from "../../hooks/useAreas/index.85e4b2e2.js";
17
+ import { useModuleDictionary, useEnvironment, useModuleSkeleton, useNetwork, useHostTools, axiosOperation } from "@m4l/core";
18
+ import { I as IconButton } from "../../../mui_extended/IconButton/index.12f1a3c3.js";
19
+ import "../../../mui_extended/Accordion/index.9877f7bf.js";
20
+ import { I as Icon } from "../../../Icon/index.9fcd1476.js";
32
21
  import { T as Typography } from "../../../mui_extended/Typography/index.443590d6.js";
22
+ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
33
23
  import "../../../mui_extended/Avatar/index.75e6ed57.js";
24
+ import "react-router-dom";
34
25
  import "@mui/material/Button";
35
- import { B as Button } from "../../../mui_extended/Button/index.fdb5dcbd.js";
26
+ import { B as Button } from "../../../mui_extended/Button/index.4288f9fc.js";
27
+ import "../../../mui_extended/Badge/index.8c2b8b66.js";
36
28
  import "../../../Image/index.c18ebf5a.js";
37
29
  import "@mui/lab";
30
+ import { M as MenuActions, a as MemonizedMenuActions } from "../../../mui_extended/MenuActions/index.43a2e1ae.js";
38
31
  import "../../../mui_extended/Popover/index.9f35d0eb.js";
39
- import { M as MenuActions } from "../../../mui_extended/MenuActions/index.ba1da3b3.js";
40
- import "../../../mui_extended/Pager/index.67bda2c5.js";
41
- import "../../../mui_extended/Tab/index.9e2f6e34.js";
32
+ import "../../../mui_extended/Pager/index.2f6d6d7d.js";
33
+ import "../../../mui_extended/Tab/index.7c82e43d.js";
42
34
  import "../../../mui_extended/Tooltip/index.5a795dcd.js";
43
- import { L as LinearProgressIndeterminate } from "../../../LinearProgressIndeterminate/index.d34d398f.js";
44
- import { R as ROW_HEIGTH_GRIDLAYOUT, M as MARGIN_GRIDLAYOUT, C as CONTAINER_PADDING_GRIDLAYOUT, T as THROTTLE_RESIZE_TIME } from "../../contexts/AreasContext/index.f0397b7c.js";
35
+ import { useResponsiveDesktop, useHostTheme, useFormatter, useLocales, useFirstRender } from "@m4l/graphics";
36
+ import { I as ICONS } from "../../icons.8266ccc8.js";
37
+ import { g as getAreasDictionary, D as DICCTIONARY } from "../../dictionary.afb7e3d9.js";
38
+ import { L as LinearProgressIndeterminate } from "../../../LinearProgressIndeterminate/index.60dabc06.js";
39
+ import debounce from "lodash/debounce";
40
+ import { L as LinearProgress } from "../../../mui_extended/LinearProgress/index.c92b9ba9.js";
45
41
  import { W as WindowToolsMFProvider } from "../../contexts/WindowToolsMFContext/index.8f3e2a04.js";
46
- import "zustand";
47
42
  import { D as DynamicMFParmsProvider } from "../../contexts/DynamicMFParmsContext/index.1607c78e.js";
43
+ import "../../../../contexts/ModalContext/index.e9a7ba4a.js";
44
+ import "../../../../contexts/RHFormContext/index.fe175bab.js";
45
+ import "../../../GridLayout/index.da6fd387.js";
46
+ import { R as Responsive } from "../../../GridLayout/Responsive/index.0905a698.js";
47
+ import { W as WidthProvider } from "../../../GridLayout/WidthProvider/index.9a26dfe4.js";
48
+ import { R as ROW_HEIGTH_GRIDLAYOUT, M as MARGIN_GRIDLAYOUT, P as PADDING_GRIDLAYOUT } from "../../contexts/AreasContext/index.02c4e7be.js";
49
+ import "../../../animate/index.1f8eadd4.js";
50
+ import "framer-motion";
51
+ import "../../../animate/LoadingScreen/index.1d0c4307.js";
52
+ import "../../../animate/PropagateLoader/index.7fab43c8.js";
53
+ import "../AreasAdmin/index.43ecd998.js";
54
+ import "../../../ScrollBar/index.bbe48f4d.js";
55
+ import "zustand";
48
56
  import "react-hook-form";
49
- import "../../../hook-form/RHFAutocomplete/index.a063dc44.js";
50
- import "../../../HelperText/index.9864f773.js";
51
- import debounce from "lodash/debounce";
52
- import "../../../hook-form/RHFAutocompleteAsync/index.ddfd9cc9.js";
53
- import "../../../hook-form/RHFCheckbox/index.7e7f220b.js";
57
+ import "../../../hook-form/RHFAutocomplete/index.6aa51705.js";
58
+ import "../../../HelperText/index.a019742c.js";
59
+ import "../../../hook-form/RHFAutocompleteAsync/index.1a3dfe5f.js";
60
+ import "../../../hook-form/RHFCheckbox/index.a08a65b3.js";
54
61
  import "@mui/x-date-pickers";
55
- import "../../../hook-form/RHFDateTime/index.d330709b.js";
56
- import "../../../hook-form/RHFTextField/index.e5336d09.js";
57
- import "../../../hook-form/RHFPeriod/index.e2b1293b.js";
58
- import "../../../Period/index.526791a3.js";
59
- import "../../../CommonActions/components/Actions/index.e376a68e.js";
60
- import "../../../../contexts/ModalContext/index.699f95fa.js";
61
- import { c as cjs } from "../../../../react-draggable.6d7949a3.js";
62
- import "../../../ModalDialog/index.d9c5d400.js";
63
- import { R as ResizeableWindow } from "../../../Resizeable/index.f6e48e56.js";
64
- import "../../../modal/index.1b25b61d.js";
62
+ import "../../../hook-form/RHFDateTime/index.4d671108.js";
63
+ import "../../../hook-form/RHFTextField/index.9004e898.js";
64
+ import "../../../hook-form/RHFPeriod/index.39b4be49.js";
65
+ import "../../../Period/index.7b94c418.js";
66
+ import "../../../CommonActions/components/Actions/index.52125041.js";
67
+ import { c as cjs } from "../../../../react-draggable.7abb5d0a.js";
68
+ import { R as ResizeableWindow } from "../../../Resizeable/index.9a9c79a4.js";
69
+ import "../../../modal/index.00efea85.js";
65
70
  import "lodash/isString";
66
71
  import "react-dropzone";
67
- import "../../../hook-form/RHFUpload/index.17e7f9eb.js";
68
- import "../../../DataGrid/index.ffaf000e.js";
72
+ import "../../../hook-form/RHFUpload/index.bed8573e.js";
73
+ import "../../../DataGrid/index.9fb3e6a1.js";
69
74
  import "react-dnd";
70
75
  import "react-dnd-html5-backend";
71
- import "../../../DynamicFilter/index.d7c03a61.js";
76
+ import "../../../DynamicFilter/index.d1a2e2d1.js";
72
77
  import "yup";
73
- import "../../../../contexts/RHFormContext/index.fe175bab.js";
74
- import "../../../LanguagePopover/index.938c6675.js";
75
- import "../../../NavLink/index.21c8fd90.js";
78
+ import "lodash";
79
+ import "../../../LanguagePopover/index.98b63dcb.js";
80
+ import "../../../NavLink/index.a5dea6d3.js";
76
81
  import "../../../NoItemSelected/index.23dfc897.js";
77
- import "../../../ObjectLogs/index.a2709fc2.js";
82
+ import "../../../ObjectLogs/index.d9d20b9d.js";
78
83
  import "../../../../react-json-view.57125fcf.js";
79
- import "../../../PaperForm/index.5e1bc99f.js";
84
+ import "../../../PaperForm/index.ba38a0bd.js";
80
85
  import "../../../Page/index.4237c241.js";
81
- import "../../../PropertyValue/index.8a1adf3e.js";
86
+ import "../../../PropertyValue/index.45c73161.js";
82
87
  import "../../../SplitLayout/index.9ef430f6.js";
83
88
  import "../../../../react-splitter-layout.8b1655c8.js";
84
- import "../../../SideBar/index.9e1a5b96.js";
85
- import "../../../AppBar/index.f04f5e45.js";
86
- import "../../../AccountPopover/index.47cf6c43.js";
87
- import { g as getAreasDictionary, D as DICCTIONARY } from "../../dictionary.3fabae50.js";
88
- import { L as LinearProgress } from "../../../mui_extended/LinearProgress/index.c92b9ba9.js";
89
- import { D as DraggableWindow } from "../../../DraggableWindow/index.b08af1dc.js";
90
- import { throttle } from "lodash";
89
+ import "../../../SideBar/index.2f497e6c.js";
90
+ import "../../../AppBar/index.06858422.js";
91
+ import "../../../AccountPopover/index.7e76dbb7.js";
91
92
  const areasViewerClasses = generateUtilityClasses(AREAS_VIEWER_CLASS_NAME, [
92
93
  "root",
93
94
  "areaRoot",
@@ -102,11 +103,13 @@ const areasViewerClasses = generateUtilityClasses(AREAS_VIEWER_CLASS_NAME, [
102
103
  "areaGridLayoutPanelContainer",
103
104
  "areaGridLayout",
104
105
  "areaGridLayoutPopupsContainer",
106
+ "areasWindowPopUpList",
105
107
  "windowRoot",
106
108
  "windowHeader",
107
109
  "windowHeaderContent",
108
110
  "windowHeaderTitle",
109
111
  "windowHeaderMainActions",
112
+ "windowHeaderCancelHandle",
110
113
  "windowContent",
111
114
  "windowPopupRoot",
112
115
  "windowModalRoot",
@@ -125,6 +128,7 @@ const areasViewerClasses = generateUtilityClasses(AREAS_VIEWER_CLASS_NAME, [
125
128
  "panelWindowsButtonContainer",
126
129
  "containerLinearProgress",
127
130
  "selected",
131
+ "colapsed",
128
132
  "selectedWindow",
129
133
  "isMobile",
130
134
  "loading",
@@ -148,11 +152,13 @@ const useAreasViewerUtilityClasses = (ownerState) => {
148
152
  areaGridLayoutPanelContainer: ["areaGridLayoutPanelContainer"],
149
153
  areaGridLayout: ["areaGridLayout"],
150
154
  areaGridLayoutPopupsContainer: ["areaGridLayoutPopupsContainer"],
155
+ areasWindowPopUpList: ["areasWindowPopUpList"],
151
156
  windowRoot: ["windowRoot"],
152
157
  windowRootContainer: ["windowRootContainer"],
153
158
  windowHeader: ["windowHeader"],
154
159
  windowHeaderTitle: ["windowHeaderTitle"],
155
160
  windowHeaderMainActions: ["windowHeaderMainActions"],
161
+ windowHeaderCancelHandle: ["windowHeaderCancelHandle"],
156
162
  windowContent: ["windowContent"],
157
163
  windowLinearProgressRoot: ["windowLinearProgressRoot"],
158
164
  windowLinearProgressBar: ["windowLinearProgressBar"],
@@ -409,37 +415,6 @@ const AreasViewerRoot = styled("div")`
409
415
 
410
416
  ${(props) => props.theme.components?.M4LAreasViewer?.styleOverrides}
411
417
  `;
412
- styled("div")(({
413
- theme
414
- }) => ({
415
- display: "flex",
416
- alignItems: "center",
417
- position: "relative",
418
- justifyContent: "space-between",
419
- minHeight: theme.spacing(5),
420
- borderBottom: `1px solid ${theme.palette.divider}`,
421
- overflow: "hidden",
422
- cursor: "move",
423
- height: "60px",
424
- " > span": {
425
- marginRight: "12px"
426
- },
427
- "& > h5": {
428
- paddingRight: theme.spacing(3),
429
- borderRight: `1px solid ${theme.palette.divider}`
430
- },
431
- " > nav": {
432
- marginRight: "12px",
433
- flexGrow: 1
434
- },
435
- "& .splitactions.Mui-disabled": {
436
- color: theme.palette.primary.main
437
- },
438
- "& svg ": {
439
- width: "20px",
440
- height: "20px"
441
- }
442
- }));
443
418
  styled("div")(({
444
419
  theme
445
420
  }) => ({
@@ -620,7 +595,7 @@ function getMenuActions(options) {
620
595
  onClick: () => saveModuleCookies(windowId),
621
596
  disabled: false,
622
597
  visibility: "normal",
623
- dictionaryId: getAreasDictionary("label_persist_module_cookies"),
598
+ dictionaryId: getAreasDictionary(DICCTIONARY.label_persist_module_cookies),
624
599
  key: "save_cookies"
625
600
  };
626
601
  menuActions.push(saveCookiesAction);
@@ -629,7 +604,7 @@ function getMenuActions(options) {
629
604
  onClick: () => resetModuleCookies(windowId),
630
605
  disabled: false,
631
606
  visibility: "normal",
632
- dictionaryId: getAreasDictionary("label_reset_module_cookies"),
607
+ dictionaryId: getAreasDictionary(DICCTIONARY.label_reset_module_cookies),
633
608
  key: "reset_cookes"
634
609
  };
635
610
  menuActions.push(resetCookiesAction);
@@ -667,10 +642,15 @@ function MainActions(props) {
667
642
  className: areasViewerClasses.windowHeaderMainActions,
668
643
  children: mainActions.map((mainAction) => {
669
644
  const tooltip = mainAction.label !== void 0 ? mainAction.label : getLabel(mainAction.dictionaryId || "");
645
+ const onClick = (e) => {
646
+ console.log("onClick MainActions");
647
+ mainAction.onClick(e);
648
+ e.stopPropagation();
649
+ };
670
650
  return /* @__PURE__ */ jsx(IconButton, {
671
651
  src: mainAction.urlIcon || "",
672
- className: mainAction.className,
673
- onClick: mainAction.onClick,
652
+ className: clsx(mainAction.className, "m4l_draggableCancel"),
653
+ onClick,
674
654
  "aria-label": mainAction.label,
675
655
  disabled: mainAction.disabled,
676
656
  tooltip
@@ -678,23 +658,95 @@ function MainActions(props) {
678
658
  })
679
659
  });
680
660
  }
661
+ const WindowPopUpsList = (props) => {
662
+ const {
663
+ areaId,
664
+ windowId
665
+ } = props;
666
+ const {
667
+ host_static_assets,
668
+ environment_assets
669
+ } = useEnvironment();
670
+ const windowsPopUps = useAreasStore((state) => state.hashAreas[areaId].layoutItemsIds.filter((li) => state.hashWindows[li].parentLayoutId === windowId && state.hashWindows[li].emergeType === "popup").map((lim) => {
671
+ const w = state.hashWindows[lim];
672
+ return {
673
+ i: w.windowId,
674
+ url_icon: w.url_icon,
675
+ title: w.title
676
+ };
677
+ }), shallow);
678
+ const theme = useTheme();
679
+ const {
680
+ maximizeLayout
681
+ } = useAreasStore((state) => state.areaActions);
682
+ const onTouched = (layoutId) => {
683
+ maximizeLayout(areaId, layoutId);
684
+ };
685
+ const menuActions = windowsPopUps ? windowsPopUps.map((element) => {
686
+ return {
687
+ onClick: () => onTouched(element.i),
688
+ label: element.title,
689
+ urlIcon: element.url_icon
690
+ };
691
+ }) : null;
692
+ if (menuActions && menuActions.length > 0) {
693
+ return /* @__PURE__ */ jsx(MenuActions, {
694
+ urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.POPUP}`,
695
+ arrowType: "no-arrow",
696
+ marginTop: "12px!important",
697
+ marginLeft: "14px!important",
698
+ anchorOrigin: {
699
+ vertical: "bottom",
700
+ horizontal: "right"
701
+ },
702
+ transformOrigin: {
703
+ vertical: "top",
704
+ horizontal: "right"
705
+ },
706
+ menuActions,
707
+ className: areasViewerClasses.areasWindowPopUpList,
708
+ menuActionSx: theme.components?.M4LAreasViewerWindowPopUpList?.styleOverrides,
709
+ withBadge: true,
710
+ badgeContent: menuActions.length.toString()
711
+ });
712
+ } else {
713
+ return null;
714
+ }
715
+ };
681
716
  function Header(props) {
682
717
  const {
683
718
  areaId,
684
719
  windowId,
685
720
  emergeType
686
721
  } = props;
687
- const [url_icon, title, moduleActions, onClose, version, windowOptions, singleId] = useAreasStore((state) => {
722
+ const [url_icon, title, moduleActions, onClose, version, windowOptions] = useAreasStore((state) => {
688
723
  const window2 = state.hashWindows[windowId];
689
- return [window2.url_icon, window2.title, window2.moduleActions, window2.onClose, window2.version, window2.windowOptions, state.hashAreas[areaId].singleId];
724
+ return [
725
+ window2.url_icon,
726
+ window2.title,
727
+ window2.moduleActions,
728
+ window2.onClose,
729
+ window2.version,
730
+ window2.windowOptions
731
+ ];
690
732
  }, shallow);
691
733
  const {
692
734
  saveModuleCookies,
693
735
  resetModuleCookies
694
736
  } = useAreasStore((state) => state.windowActions, shallow);
737
+ const maximizedId = useAreasStore((state) => state.hashAreas[areaId].maximizedId, shallow);
738
+ const colapsed = useAreasStore((state) => {
739
+ const currentBreakpoint = state.hashAreas[areaId].currentBreakpoint;
740
+ if (currentBreakpoint) {
741
+ return state.hashAreas[areaId].layouts[currentBreakpoint].find((li) => li.i === windowId)?.colapsed;
742
+ }
743
+ return false;
744
+ }, shallow);
695
745
  const {
696
746
  maximizeLayout,
697
- normalizeLayouts
747
+ normalizeLayouts,
748
+ colapseLayoutItem,
749
+ unColapseLayoutItem
698
750
  } = useAreasStore((state) => state.areaActions, shallow);
699
751
  const {
700
752
  host_static_assets,
@@ -718,12 +770,21 @@ function Header(props) {
718
770
  const onCloseLocal = () => {
719
771
  onClose && onClose(windowId);
720
772
  };
721
- const maxNormalize = () => {
722
- if (singleId) {
773
+ const maxNormalize = (e) => {
774
+ if (maximizedId === windowId) {
723
775
  normalizeLayouts(areaId);
724
776
  } else {
725
777
  maximizeLayout(areaId, windowId);
726
778
  }
779
+ e.stopPropagation();
780
+ };
781
+ const colapedToggle = (e) => {
782
+ if (!colapsed) {
783
+ colapseLayoutItem(areaId, windowId);
784
+ } else {
785
+ unColapseLayoutItem(areaId, windowId);
786
+ }
787
+ e.stopPropagation();
727
788
  };
728
789
  if (isSkeleton) {
729
790
  return /* @__PURE__ */ jsx(SKTModuleHeader, {});
@@ -739,47 +800,63 @@ function Header(props) {
739
800
  className: areasViewerClasses.windowHeaderTitle,
740
801
  variant: "h5",
741
802
  children: `${title}`
742
- }), /* @__PURE__ */ jsx(MainActions, {
743
- windowId
744
- }), isDesktop && emergeType === "layout" && /* @__PURE__ */ jsx(IconButton, {
745
- onClick: maxNormalize,
746
- "aria-label": "click",
747
- src: singleId ? `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.NORMALIZE}` : `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.MAXIMIZE}`
748
- }), menuActions.length > 0 && /* @__PURE__ */ jsx(MenuActions, {
749
- arrowType: "no-arrow",
750
- marginTop: "12px!important",
751
- marginLeft: "14px!important",
752
- anchorOrigin: {
753
- vertical: "bottom",
754
- horizontal: "right"
755
- },
756
- transformOrigin: {
757
- vertical: "top",
758
- horizontal: "right"
759
- },
760
- menuActions
761
- }), onClose && /* @__PURE__ */ jsx(IconButton, {
762
- onClick: onCloseLocal,
763
- "aria-label": "click",
764
- src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.CLOSE}`
803
+ }), /* @__PURE__ */ jsxs("div", {
804
+ className: areasViewerClasses.windowHeaderCancelHandle,
805
+ children: [/* @__PURE__ */ jsx(MainActions, {
806
+ windowId
807
+ }), emergeType === "layout" ? /* @__PURE__ */ jsx(WindowPopUpsList, {
808
+ areaId,
809
+ windowId
810
+ }) : null, menuActions.length > 0 && /* @__PURE__ */ jsx(MemonizedMenuActions, {
811
+ arrowType: "no-arrow",
812
+ marginTop: "12px!important",
813
+ marginLeft: "14px!important",
814
+ anchorOrigin: {
815
+ vertical: "bottom",
816
+ horizontal: "right"
817
+ },
818
+ transformOrigin: {
819
+ vertical: "top",
820
+ horizontal: "right"
821
+ },
822
+ menuActions
823
+ }), !colapsed && (emergeType === "layout" || emergeType === "popup") && /* @__PURE__ */ jsx(IconButton, {
824
+ className: "m4l_draggableCancel",
825
+ onClick: maxNormalize,
826
+ "aria-label": "click",
827
+ src: maximizedId === windowId ? `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.NORMALIZE}` : `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.MAXIMIZE}`
828
+ }), !maximizedId && (emergeType === "layout" || emergeType === "popup") && /* @__PURE__ */ jsx(IconButton, {
829
+ className: "m4l_draggableCancel",
830
+ onClick: colapedToggle,
831
+ "aria-label": "click",
832
+ src: !colapsed ? `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.COLAPSE}` : `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.UNCOLPASE}`,
833
+ dictionaryTooltipId: "pendiente"
834
+ }), onClose && /* @__PURE__ */ jsx(IconButton, {
835
+ className: "m4l_draggableCancel",
836
+ onPointerDown: onCloseLocal,
837
+ "aria-label": "click",
838
+ src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.CLOSE}`
839
+ })]
765
840
  })]
766
841
  })]
767
842
  });
768
843
  }
769
844
  const ProggessLoadingMF = (props) => {
770
- const {
771
- loadingProgress
772
- } = props;
773
- if (loadingProgress >= 0 && loadingProgress <= 100) {
774
- return /* @__PURE__ */ jsx("div", {
775
- className: areasViewerClasses.containerLinearProgress,
776
- children: /* @__PURE__ */ jsx(LinearProgress, {
777
- variant: "determinate",
778
- value: loadingProgress
779
- })
780
- });
781
- } else {
782
- console.log("LoadingMF***************************************", loadingProgress);
845
+ try {
846
+ const {
847
+ loadingProgress
848
+ } = props;
849
+ if (loadingProgress >= 0 && loadingProgress <= 100) {
850
+ return /* @__PURE__ */ jsx("div", {
851
+ className: areasViewerClasses.containerLinearProgress,
852
+ children: /* @__PURE__ */ jsx(LinearProgress, {
853
+ variant: "determinate",
854
+ value: loadingProgress
855
+ })
856
+ });
857
+ } else {
858
+ }
859
+ } catch (error) {
783
860
  }
784
861
  return null;
785
862
  };
@@ -797,7 +874,6 @@ class ObservableLoaderMF {
797
874
  this.networkOperation = networkOperation;
798
875
  this.isRemote = isRemote;
799
876
  this.eventStatus = "progress";
800
- console.log("ObservableLoaderMF constructor", this.host, scriptId);
801
877
  this.start = this.start.bind(this);
802
878
  this.subscribe = this.subscribe.bind(this);
803
879
  this.unsubscribe = this.unsubscribe.bind(this);
@@ -806,7 +882,6 @@ class ObservableLoaderMF {
806
882
  setTimeout(this.start, 100);
807
883
  }
808
884
  tryAgain() {
809
- console.log("start tryAgain");
810
885
  if (this.eventStatus === "error") {
811
886
  setTimeout(this.start, 100);
812
887
  new Promise((resolve) => {
@@ -815,25 +890,20 @@ class ObservableLoaderMF {
815
890
  this.start();
816
891
  });
817
892
  }
818
- console.log("end tryAgain");
819
893
  }
820
894
  async start() {
821
895
  let percentCompleted = 0;
822
896
  this.notify("progress", percentCompleted);
823
- console.log("ObservableLoaderMF start", this.host);
824
897
  const manifest = await fetch(`${this.host}/manifest.json?rnd=${Math.random()}`).then((res) => res.json()).catch(() => {
825
- console.debug("Error fetching manifest", `${this.host}/manifest.json`);
826
- this.notify("error", 0);
898
+ setTimeout(() => this.notify("error", 0), 300);
827
899
  return void 0;
828
900
  });
829
- console.log("ObservableLoaderMF cargado de manifest");
830
901
  if (!manifest) {
831
902
  return;
832
903
  }
833
904
  percentCompleted = 10;
834
905
  this.notify("progress", percentCompleted);
835
906
  const urlFile = `${this.host}/${manifest["src/index.tsx"]["file"]}?rnd=${Math.random()}`;
836
- console.log("ObservableLoaderMF file", urlFile);
837
907
  const controller = new AbortController();
838
908
  const ret = await this.networkOperation({
839
909
  method: "GET",
@@ -870,7 +940,6 @@ class ObservableLoaderMF {
870
940
  script.type = "module";
871
941
  script.src = urlFile || "";
872
942
  script.onload = () => {
873
- console.debug("Completed", new Date().getTime(), new Date().getTime() - startTime);
874
943
  this.notify("complete", 100);
875
944
  };
876
945
  document.head.appendChild(script);
@@ -891,7 +960,7 @@ class ObservableLoaderMF {
891
960
  notify(newEvent, progress) {
892
961
  this.eventStatus = newEvent;
893
962
  this.subscribers.forEach((subscriber) => {
894
- subscriber(newEvent, progress);
963
+ setTimeout(() => subscriber(newEvent, progress), 1);
895
964
  });
896
965
  }
897
966
  }
@@ -907,7 +976,6 @@ const AreasLoadingError = (props) => {
907
976
  const {
908
977
  getLabel
909
978
  } = useModuleDictionary();
910
- console.log("test status view", status);
911
979
  return /* @__PURE__ */ jsx("div", {
912
980
  className: areasViewerClasses.areasLoadingErrorRoot,
913
981
  children: status !== "error" ? /* @__PURE__ */ jsx("div", {
@@ -922,22 +990,22 @@ const AreasLoadingError = (props) => {
922
990
  variant: "h3",
923
991
  skeletonWidth: "100px",
924
992
  className: areasViewerClasses.areasLoadingErrorTitle,
925
- children: getLabel(DICCTIONARY.area_error_title)
993
+ children: getLabel(getAreasDictionary(DICCTIONARY.area_error_title))
926
994
  }), /* @__PURE__ */ jsx(Typography, {
927
995
  variant: "subtitle",
928
996
  skeletonWidth: "100px",
929
997
  className: areasViewerClasses.areasLoadingErrorDescription,
930
- children: getLabel(DICCTIONARY.area_error_description)
998
+ children: getLabel(getAreasDictionary(DICCTIONARY.area_error_description))
931
999
  }), /* @__PURE__ */ jsx("div", {
932
1000
  className: areasViewerClasses.areasLoadingErrorDivider
933
1001
  }), /* @__PURE__ */ jsx(Typography, {
934
1002
  variant: "paragraph",
935
1003
  skeletonWidth: "100px",
936
1004
  className: areasViewerClasses.areasLoadingErrorTextAction,
937
- children: getLabel(DICCTIONARY.area_error_recommendation)
1005
+ children: getLabel(getAreasDictionary(DICCTIONARY.area_error_recommendation))
938
1006
  }), /* @__PURE__ */ jsx(Button, {
939
1007
  onClick: action,
940
- children: getLabel(DICCTIONARY.area_error_intro)
1008
+ children: getLabel(getAreasDictionary(DICCTIONARY.area_error_intro))
941
1009
  })]
942
1010
  })
943
1011
  });
@@ -1026,20 +1094,17 @@ function MFLoader(props) {
1026
1094
  window[`observable_${prefix}_${moduleId}`]?.tryAgain();
1027
1095
  }, []);
1028
1096
  useEffect(() => {
1029
- const dsScript = {
1097
+ const dsNowScript = {
1030
1098
  ...divScript
1031
1099
  };
1032
1100
  const observableDownload = (event, progress) => {
1033
1101
  setLoadingProgress(progress);
1034
1102
  setStatusLoader(event);
1035
- if (event === "complete") {
1036
- renderMicroFrontend(dsScript);
1037
- }
1038
1103
  };
1039
1104
  if (!window[`render_${prefix}_${moduleId}`]) {
1040
1105
  let observableLoaderMF;
1041
1106
  if (!window[`observable_${prefix}_${moduleId}`]) {
1042
- observableLoaderMF = new ObservableLoaderMF(final_host, dsScript.scriptId, networkOperation, !environment.isLocalhost);
1107
+ observableLoaderMF = new ObservableLoaderMF(final_host, dsNowScript.scriptId, networkOperation, !environment.isLocalhost);
1043
1108
  window[`observable_${prefix}_${moduleId}`] = observableLoaderMF;
1044
1109
  } else {
1045
1110
  observableLoaderMF = window[`observable_${prefix}_${moduleId}`];
@@ -1047,13 +1112,17 @@ function MFLoader(props) {
1047
1112
  observableLoaderMF.subscribe(observableDownload);
1048
1113
  } else {
1049
1114
  setStatusLoader("complete");
1050
- renderMicroFrontend(dsScript);
1051
1115
  }
1052
1116
  return () => {
1053
1117
  window[`observable_${prefix}_${moduleId}`].unsubscribe(observableDownload);
1054
- cleanUp(dsScript);
1118
+ cleanUp(dsNowScript);
1055
1119
  };
1056
1120
  }, [divScript]);
1121
+ useEffect(() => {
1122
+ if (statusLoader === "complete") {
1123
+ renderMicroFrontend(divScript);
1124
+ }
1125
+ }, [statusLoader]);
1057
1126
  return /* @__PURE__ */ jsxs("div", {
1058
1127
  id: divScript.divContainerId,
1059
1128
  style: {
@@ -1097,8 +1166,7 @@ const Component = (props) => {
1097
1166
  };
1098
1167
  React__default.memo(Component);
1099
1168
  const WindowRoot = styled("div")`
1100
-
1101
- inset:0;
1169
+ inset: 0;
1102
1170
  position: absolute;
1103
1171
  display: flex;
1104
1172
  flex-direction: column;
@@ -1130,6 +1198,12 @@ const WindowRoot = styled("div")`
1130
1198
  margin-right: 24px;
1131
1199
  text-overflow: ellipsis;
1132
1200
  }
1201
+
1202
+ & .${areasViewerClasses.windowHeaderCancelHandle} {
1203
+ display: flex;
1204
+ cursor: default;
1205
+ }
1206
+
1133
1207
  // windowHeaderMainActions
1134
1208
  & .${areasViewerClasses.windowHeaderMainActions} {
1135
1209
  display: flex;
@@ -1137,13 +1211,15 @@ const WindowRoot = styled("div")`
1137
1211
  gap: 4px;
1138
1212
  }
1139
1213
 
1140
-
1141
1214
  // windowHeaderMainActions
1142
1215
  & .${areasViewerClasses.windowContent} {
1143
1216
  flex-grow: 1;
1144
1217
  position: relative;
1145
1218
  }
1146
1219
 
1220
+ & .${areasViewerClasses.windowContent}.${areasViewerClasses.colapsed} {
1221
+ display: none !important;
1222
+ }
1147
1223
  // windowModalRoot
1148
1224
  & .${areasViewerClasses.windowModalRoot} {
1149
1225
  padding: 16px;
@@ -1160,37 +1236,29 @@ const WindowRoot = styled("div")`
1160
1236
  flex-direction: column;
1161
1237
  }
1162
1238
  // windowToastyContainer
1163
- & .${areasViewerClasses.windowToastyContainer}.${areasViewerClasses.success} {
1164
- background-color: ${(props) => props.theme.palette.success.main}
1239
+ & .${areasViewerClasses.windowToastyContainer}.${areasViewerClasses.success} {
1240
+ background-color: ${(props) => props.theme.palette.success.main};
1165
1241
  }
1166
1242
 
1167
1243
  // windowToastyMeesageButtonsContainer
1168
1244
  & .${areasViewerClasses.windowToastyMeesageButtonsContainer} {
1169
1245
  display: flex;
1170
-
1171
1246
  }
1172
1247
  & .MuiLinearProgress-root {
1173
1248
  width: 100%;
1174
1249
  }
1175
1250
 
1176
-
1177
-
1178
-
1179
1251
  // windowToastyMessage
1180
1252
  & .${areasViewerClasses.windowToastyMessage} {
1181
1253
  flex-grow: 1;
1182
1254
  }
1183
1255
 
1184
- // windowToastyContainer
1256
+ // windowToastyContainer
1185
1257
  & .${areasViewerClasses.windowToastyPin}.${areasViewerClasses.pinIn} {
1186
1258
  border: 1px solid red;
1187
1259
  }
1188
1260
 
1189
-
1190
-
1191
1261
  ${(props) => props.theme.components?.M4LAreasViewerWindow?.styleOverrides}
1192
-
1193
-
1194
1262
  `;
1195
1263
  function Toasty(props) {
1196
1264
  const {
@@ -1198,7 +1266,6 @@ function Toasty(props) {
1198
1266
  toastyId
1199
1267
  } = props;
1200
1268
  const toasty = useAreasStore((state) => state.hashWindows[windowId].hashToasties[toastyId], shallow);
1201
- console.log("percentExecuted", toasty.percentExecuted, toasty.timer);
1202
1269
  const {
1203
1270
  pinToast: pinToasty,
1204
1271
  closeToast: closeToasty
@@ -1259,15 +1326,20 @@ function Toasties(props) {
1259
1326
  }
1260
1327
  const Window = (props) => {
1261
1328
  const {
1262
- emergeType,
1263
- windowId,
1264
- moduleId,
1265
- areaId
1329
+ areaId,
1330
+ windowId
1266
1331
  } = props;
1267
- const selected = useAreasStore((state) => emergeType === "layout" ? state.hashAreas[areaId].currentLayoutId : state.hashAreas[areaId].currentPopUpId) === windowId;
1268
- const viewMode = useAreasStore((state) => state.hashAreas[areaId].viewMode, shallow);
1269
- const singleId = useAreasStore((state) => state.hashAreas[areaId].singleId, shallow);
1270
- const wd = useAreasStore((state) => state.hashWindows[windowId], shallow);
1332
+ const [emergeType, moduleId, winType] = useAreasStore((state) => {
1333
+ return [state.hashWindows[windowId]?.emergeType, state.hashWindows[windowId]?.moduleId, state.hashWindows[windowId]?.winType];
1334
+ }, shallow);
1335
+ const selected = useAreasStore((state) => {
1336
+ return emergeType === "layout" ? state.hashAreas[areaId]?.currentLayoutId : state.hashAreas[areaId]?.currentPopUpId;
1337
+ }) === windowId;
1338
+ const mfProps = useAreasStore((state) => state.hashWindows[windowId]?.mfProps, shallow);
1339
+ const component = useAreasStore((state) => state.hashWindows[windowId]?.component, shallow);
1340
+ const loading = useAreasStore((state) => state.hashWindows[windowId]?.loading, shallow);
1341
+ const status = useAreasStore((state) => state.hashWindows[windowId]?.status, shallow);
1342
+ const dynamicMFStore = useAreasStore((state) => state.hashWindows[windowId]?.dynamicMFStore, shallow);
1271
1343
  const {
1272
1344
  setActions,
1273
1345
  getCookie,
@@ -1279,19 +1351,14 @@ const Window = (props) => {
1279
1351
  toast
1280
1352
  } = useAreasStore((state) => state.windowActions, shallow);
1281
1353
  const {
1282
- selectWindowPopUp,
1283
- selectWindowLayout
1284
- } = useAreasStore((state) => state.areaActions);
1354
+ selectLayout
1355
+ } = useAreasStore((state) => state.areaActions, shallow);
1285
1356
  const {
1286
1357
  loadCookiesFromApi
1287
- } = useAreasStore((state) => state.windowActions);
1358
+ } = useAreasStore((state) => state.windowActions, shallow);
1288
1359
  const onTouch = () => {
1289
1360
  if (!selected) {
1290
- if (emergeType === "popup") {
1291
- selectWindowPopUp(areaId, props.windowId);
1292
- } else if (emergeType === "layout") {
1293
- selectWindowLayout(areaId, props.windowId);
1294
- }
1361
+ selectLayout(areaId, props.windowId);
1295
1362
  }
1296
1363
  };
1297
1364
  const windowTools = useMemo(() => ({
@@ -1312,16 +1379,16 @@ const Window = (props) => {
1312
1379
  }
1313
1380
  }), []);
1314
1381
  useEffect(() => {
1315
- if (viewMode === "multiple" && wd.status === "init") {
1316
- loadCookiesFromApi(windowId);
1317
- }
1318
- if (viewMode === "single" && wd.status === "init" && singleId === windowId) {
1382
+ if (status === "init") {
1319
1383
  loadCookiesFromApi(windowId);
1320
1384
  }
1321
- }, [wd, viewMode, singleId]);
1385
+ }, [status]);
1386
+ if (status === void 0) {
1387
+ return null;
1388
+ }
1322
1389
  return /* @__PURE__ */ jsx(WindowRoot, {
1323
1390
  role: "presentation",
1324
- className: clsx(areasViewerClasses.windowRoot, selected ? areasViewerClasses.selectedWindow : null, wd.loading ? areasViewerClasses.loading : null),
1391
+ className: clsx(areasViewerClasses.windowRoot, selected ? areasViewerClasses.selectedWindow : null, loading ? areasViewerClasses.loading : null, emergeType === "popup" ? areasViewerClasses.windowPopupRoot : null, emergeType === "modal" ? areasViewerClasses.windowModalRoot : null),
1325
1392
  onMouseDown: onTouch,
1326
1393
  children: /* @__PURE__ */ jsxs("div", {
1327
1394
  className: areasViewerClasses.windowRootContainer,
@@ -1331,100 +1398,43 @@ const Window = (props) => {
1331
1398
  emergeType
1332
1399
  }), /* @__PURE__ */ jsx(Toasties, {
1333
1400
  windowId
1334
- }), /* @__PURE__ */ jsx("div", {
1335
- className: areasViewerClasses.windowContent,
1336
- children: wd.status === "init" ? /* @__PURE__ */ jsx(Fragment, {
1337
- children: "...Componente de carga"
1338
- }) : wd.winType === "microfrontend" ? /* @__PURE__ */ jsx(MemonizedMicroFrontend, {
1401
+ }), /* @__PURE__ */ jsxs("div", {
1402
+ className: clsx(
1403
+ areasViewerClasses.windowContent
1404
+ ),
1405
+ children: [status === "init" ? /* @__PURE__ */ jsx(Fragment, {
1406
+ children: "...Brucee porr analizar Componente de carga"
1407
+ }) : null, status === "loaded" ? winType === "microfrontend" ? /* @__PURE__ */ jsx(MemonizedMicroFrontend, {
1339
1408
  moduleId,
1340
- dynamicMFStore: wd.dynamicMFStore,
1409
+ dynamicMFStore,
1341
1410
  windowTools,
1342
- ...wd.mfProps
1411
+ ...mfProps
1343
1412
  }) : /* @__PURE__ */ jsx(Component, {
1344
1413
  moduleId,
1345
- dynamicMFStore: wd.dynamicMFStore,
1414
+ dynamicMFStore,
1346
1415
  windowTools,
1347
- component: wd.component
1348
- })
1416
+ component
1417
+ }) : null]
1349
1418
  })]
1350
1419
  })
1351
1420
  });
1352
1421
  };
1353
- const MemonizedWindow = React__default.memo(Window);
1354
- const WindowPopUp = (props) => {
1355
- const {
1356
- areaId,
1357
- windowProps,
1358
- windowId
1359
- } = props;
1360
- const {
1361
- host_static_assets,
1362
- environment_assets
1363
- } = useEnvironment();
1364
- const {
1365
- selectWindowPopUp
1366
- } = useAreasStore((store) => store.areaActions);
1367
- const selectedPopUpId = useAreasStore((store) => store.hashAreas[areaId].currentPopUpId);
1368
- const zIndex = useAreasStore((store) => store.hashAreas[areaId].hashWindowsPopups[props.windowId].zIndex);
1369
- const isSelected = props.windowId === selectedPopUpId;
1370
- const onTouch = () => {
1371
- if (!isSelected) {
1372
- selectWindowPopUp(areaId, props.windowId);
1373
- }
1374
- };
1375
- return /* @__PURE__ */ jsx(DraggableWindow, {
1376
- handle: ".m4l_draggable_handle",
1377
- cancel: "",
1378
- defaultPosition: windowProps,
1379
- children: /* @__PURE__ */ jsx(ResizeableWindow, {
1380
- className: clsx(areasViewerClasses.windowPopupRoot, `${areasViewerClasses.windowPopupRoot}-${windowId}`),
1381
- width: windowProps.width,
1382
- height: windowProps.height,
1383
- style: {
1384
- zIndex,
1385
- position: "absolute"
1386
- },
1387
- onResizeStart: () => {
1388
- onTouch();
1389
- },
1390
- handle: (resizeHandle, ref) => /* @__PURE__ */ jsx("div", {
1391
- ref,
1392
- children: /* @__PURE__ */ jsx(Icon, {
1393
- src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.RESIZE}`,
1394
- className: `custom-handle custom-handle-${resizeHandle}`
1395
- })
1396
- }, resizeHandle),
1397
- children: /* @__PURE__ */ jsx(Window, {
1398
- ...props
1399
- })
1400
- })
1401
- });
1402
- };
1403
- const MemonizedWindowPopUp = React__default.memo(WindowPopUp);
1422
+ React__default.memo(Window);
1404
1423
  const ResponsiveGridLayout = WidthProvider(Responsive);
1405
- const GridLayout = (props) => {
1424
+ const AreaGridLayout = (props) => {
1406
1425
  const {
1407
1426
  areaId
1408
1427
  } = props;
1409
- const windowsLayouts = useAreasStore((state) => state.hashAreas[areaId].windowsLayouts, shallow);
1410
- const hashWindowsPopups = useAreasStore((state) => state.hashAreas[areaId].hashWindowsPopups, shallow);
1411
- const hashWindowsLayouts = useAreasStore((state) => state.hashAreas[areaId].hashWindowsLayouts, shallow);
1412
- const breakPointsLayouts = useAreasStore((state) => state.hashAreas[areaId].breakPointsLayouts, shallow);
1413
- const windowsPopUps = useAreasStore((state) => state.hashAreas[areaId].windowsPopUps, shallow);
1428
+ const hashLayoutItems = useAreasStore((state) => state.hashAreas[areaId].layoutItemsIds, shallow);
1429
+ const layouts = useAreasStore((state) => state.hashAreas[areaId].layouts, shallow);
1414
1430
  const breakpoints = useAreasStore((state) => state.hashAreas[areaId].breakpoints, shallow);
1415
- const viewMode = useAreasStore((state) => state.hashAreas[areaId].viewMode, shallow);
1431
+ const maximizedId = useAreasStore((state) => state.hashAreas[areaId].maximizedId, shallow);
1416
1432
  const cols = useAreasStore((state) => state.hashAreas[areaId].cols, shallow);
1417
1433
  const {
1418
- onBreakpointsLayoutsChange
1434
+ onBreakpointsLayoutsChange,
1435
+ onContainerChange
1419
1436
  } = useAreasStore((state) => state.areaActions, shallow);
1420
- function onBreakpointChange(_newBreakpoint, _newCols) {
1421
- }
1422
- useEffect(() => {
1423
- setTimeout(() => {
1424
- window.dispatchEvent(new Event("resize"));
1425
- }, 100);
1426
- }, [viewMode, windowsLayouts]);
1427
- return /* @__PURE__ */ jsxs(
1437
+ return /* @__PURE__ */ jsx(
1428
1438
  ResponsiveGridLayout,
1429
1439
  {
1430
1440
  autoSize: false,
@@ -1432,54 +1442,37 @@ const GridLayout = (props) => {
1432
1442
  measureBeforeMount: true,
1433
1443
  resizeHandles: ["nw", "se"],
1434
1444
  className: clsx(areasViewerClasses.areaGridLayout, `${areasViewerClasses.areaGridLayout}-${areaId}`),
1435
- layouts: breakPointsLayouts,
1436
- onLayoutChange: (currentLayouts, newAllLayouts) => onBreakpointsLayoutsChange(areaId, currentLayouts, newAllLayouts),
1437
- onBreakpointChange,
1445
+ layouts,
1446
+ onLayoutChange: (layout, newLayouts) => onBreakpointsLayoutsChange(areaId, layout, newLayouts),
1447
+ draggableHandle: ".m4l_draggable_handle",
1448
+ draggableCancel: `.${areasViewerClasses.windowHeaderCancelHandle}`,
1449
+ layoutItemRender: (p) => {
1450
+ if (hashLayoutItems.indexOf(p.i) === -1) {
1451
+ console.debug("NO EXISTE window", hashLayoutItems, p.i);
1452
+ return /* @__PURE__ */ jsx(Fragment, {});
1453
+ }
1454
+ if (p.type === "placeholder") {
1455
+ return /* @__PURE__ */ jsx("div", {
1456
+ children: "Place holder"
1457
+ });
1458
+ }
1459
+ console.debug("layoutItemRender window", hashLayoutItems, p.i, p.type);
1460
+ return /* @__PURE__ */ jsx(Window, {
1461
+ windowId: p.i,
1462
+ areaId
1463
+ });
1464
+ },
1438
1465
  breakpoints,
1439
1466
  cols,
1440
1467
  rowHeight: ROW_HEIGTH_GRIDLAYOUT,
1441
- margin: [MARGIN_GRIDLAYOUT, MARGIN_GRIDLAYOUT],
1442
- containerPadding: [CONTAINER_PADDING_GRIDLAYOUT, CONTAINER_PADDING_GRIDLAYOUT],
1443
- draggableHandle: ".m4l_draggable_handle",
1444
- onWidthChange: () => {
1445
- console.log("onWidthChange", areaId);
1468
+ containerMargin: [MARGIN_GRIDLAYOUT, MARGIN_GRIDLAYOUT],
1469
+ containerPadding: [PADDING_GRIDLAYOUT, PADDING_GRIDLAYOUT],
1470
+ onContainerChange: (e) => {
1471
+ onContainerChange(areaId, e);
1446
1472
  },
1447
1473
  preventCollision: false,
1448
1474
  verticalCompact: true,
1449
- children: [/* @__PURE__ */ jsx("div", {
1450
- className: areasViewerClasses.areaGridLayoutPopupsContainer,
1451
- "data-grid": {
1452
- i: "none",
1453
- x: 0,
1454
- y: 0,
1455
- w: 0,
1456
- h: 0,
1457
- maxW: 0,
1458
- maxH: 0,
1459
- minW: 0,
1460
- minH: 0,
1461
- static: true,
1462
- isDraggable: false,
1463
- isResizable: false
1464
- },
1465
- children: windowsPopUps.map((wp) => {
1466
- if (hashWindowsPopups[wp]) {
1467
- return /* @__PURE__ */ jsx(MemonizedWindowPopUp, {
1468
- ...hashWindowsPopups[wp]
1469
- }, hashWindowsPopups[wp].windowId);
1470
- }
1471
- return null;
1472
- })
1473
- }, "none"), windowsLayouts.map((l) => {
1474
- if (hashWindowsLayouts[l.i]) {
1475
- return /* @__PURE__ */ jsx("div", {
1476
- children: /* @__PURE__ */ jsx(MemonizedWindow, {
1477
- ...hashWindowsLayouts[l.i]
1478
- })
1479
- }, l.i);
1480
- }
1481
- return null;
1482
- })]
1475
+ maximizeId: maximizedId
1483
1476
  }
1484
1477
  );
1485
1478
  };
@@ -1488,10 +1481,12 @@ const PanelWindows = (props) => {
1488
1481
  areaId
1489
1482
  } = props;
1490
1483
  const status = useAreasStore((state) => state.hashAreas[areaId].status);
1491
- const mode = useAreasStore((state) => state.hashAreas[areaId].viewMode);
1492
- const singleId = useAreasStore((state) => state.hashAreas[areaId].singleId);
1493
- const windowsLayouts = useAreasStore((state) => state.hashAreas[areaId].windowsLayouts, shallow);
1494
- const hashWindowsLayouts = useAreasStore((state) => state.hashAreas[areaId].hashWindowsLayouts, shallow);
1484
+ const maximizedId = useAreasStore((state) => state.hashAreas[areaId].maximizedId);
1485
+ const hashLayoutItems = useAreasStore((state) => state.hashAreas[areaId].layoutItemsIds.filter((itemId) => state.hashWindows[itemId].emergeType === "layout").map((key) => ({
1486
+ i: key,
1487
+ url_icon: state.hashWindows[key].url_icon,
1488
+ title: state.hashWindows[key].title
1489
+ })), shallow);
1495
1490
  const {
1496
1491
  maximizeLayout
1497
1492
  } = useAreasStore((state) => state.areaActions);
@@ -1499,21 +1494,21 @@ const PanelWindows = (props) => {
1499
1494
  maximizeLayout(areaId, layoutId);
1500
1495
  };
1501
1496
  if (status === "loaded") {
1502
- if (mode !== "single" || windowsLayouts.length < 2) {
1497
+ if (!maximizedId || hashLayoutItems.length < 2) {
1503
1498
  return null;
1504
1499
  }
1505
1500
  return /* @__PURE__ */ jsx("div", {
1506
1501
  className: areasViewerClasses.panelWindowsRoot,
1507
- children: windowsLayouts.map((l) => {
1502
+ children: hashLayoutItems.map((kl) => {
1508
1503
  return /* @__PURE__ */ jsx("div", {
1509
- className: clsx(areasViewerClasses.panelWindowsButtonContainer, singleId === l.i ? areasViewerClasses.selected : null),
1504
+ className: clsx(areasViewerClasses.panelWindowsButtonContainer, maximizedId === kl.i ? areasViewerClasses.selected : null),
1510
1505
  children: /* @__PURE__ */ jsx(IconButton, {
1511
- src: hashWindowsLayouts[l.i].url_icon,
1506
+ src: kl.url_icon,
1512
1507
  size: "small",
1513
- onClick: () => onTouched(l.i),
1514
- tooltip: singleId !== l.i ? hashWindowsLayouts[l.i].title : void 0
1508
+ onClick: () => onTouched(kl.i),
1509
+ tooltip: maximizedId !== kl.i ? kl.title : void 0
1515
1510
  })
1516
- }, l.i);
1511
+ }, kl.i);
1517
1512
  })
1518
1513
  });
1519
1514
  } else {
@@ -1524,20 +1519,21 @@ const InnerForHooks = (props) => {
1524
1519
  const {
1525
1520
  areaId
1526
1521
  } = props;
1522
+ const isDesktop = useResponsiveDesktop();
1527
1523
  const status = useAreasStore((state) => state.hashAreas[areaId].status);
1528
1524
  return /* @__PURE__ */ jsxs("div", {
1529
1525
  className: clsx(areasViewerClasses.areaGridLayoutPanelContainer, `${areasViewerClasses.areaGridLayoutPanelContainer}-${areaId}`),
1530
1526
  children: [
1531
- status === "loaded" ? /* @__PURE__ */ jsx(GridLayout, {
1527
+ status === "loaded" ? /* @__PURE__ */ jsx(AreaGridLayout, {
1532
1528
  areaId
1533
1529
  }) : /* @__PURE__ */ jsx(AreasLoadingError, {
1534
1530
  status,
1535
1531
  action: () => {
1536
1532
  }
1537
1533
  }),
1538
- /* @__PURE__ */ jsx(PanelWindows, {
1534
+ isDesktop ? /* @__PURE__ */ jsx(PanelWindows, {
1539
1535
  areaId
1540
- })
1536
+ }) : null
1541
1537
  ]
1542
1538
  });
1543
1539
  };
@@ -1548,25 +1544,11 @@ const Area = (props) => {
1548
1544
  } = props;
1549
1545
  const classesAreaRoot = useAreasStore((state) => state.viwerClasses.areaRoot);
1550
1546
  const status = useAreasStore((state) => state.hashAreas[areaId].status);
1551
- const {
1552
- resizeMaximixedLayout
1553
- } = useAreasStore((state) => state.areaActions, shallow);
1554
- const throttleResizeMaximixedLayout = throttle(() => {
1555
- console.log("throttleResizeMaximixedLayout", areaId);
1556
- resizeMaximixedLayout(areaId);
1557
- }, THROTTLE_RESIZE_TIME, {
1558
- leading: false
1559
- });
1560
- const onResize = useCallback((_target) => {
1561
- throttleResizeMaximixedLayout();
1562
- }, []);
1563
- const ref = useResizeObserver(onResize);
1564
1547
  if (status === "init") {
1565
1548
  return null;
1566
1549
  }
1567
1550
  return /* @__PURE__ */ jsx("div", {
1568
1551
  className: clsx(classesAreaRoot, selected ? areasViewerClasses.selected : null, status === "loading" ? areasViewerClasses.loading : null),
1569
- ref,
1570
1552
  children: /* @__PURE__ */ jsx(InnerForHooks, {
1571
1553
  areaId
1572
1554
  })
@@ -1660,9 +1642,9 @@ function AreasViewer() {
1660
1642
  className: classesRoot,
1661
1643
  children: status === "loaded" ? areas.map((area) => {
1662
1644
  return /* @__PURE__ */ jsx(Area, {
1663
- areaId: area.id,
1664
- selected: currentArea === area.id
1665
- }, area.id);
1645
+ areaId: area,
1646
+ selected: currentArea === area
1647
+ }, area);
1666
1648
  }) : /* @__PURE__ */ jsx(AreasLoadingError, {
1667
1649
  status,
1668
1650
  action: () => init()
@@ -1679,6 +1661,5 @@ function AreasViewer() {
1679
1661
  }
1680
1662
  export {
1681
1663
  AreasViewer as A,
1682
- areasViewerClasses as a,
1683
1664
  useAreasViewerUtilityClasses as u
1684
1665
  };