@m4l/components 0.1.68 → 0.1.70

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 (389) hide show
  1. package/@types/export.d.ts +24 -0
  2. package/assets/Logo.d.ts +2 -1
  3. package/components/AccountPopover/AccountPopover.d.ts +2 -1
  4. package/components/AccountPopover/style.d.ts +2 -0
  5. package/components/AccountPopover/subcomponents/PopOver/index.d.ts +2 -1
  6. package/components/AccountPopover/subcomponents/PopOver/styles.d.ts +8 -0
  7. package/components/AppBar/AppBar.d.ts +2 -1
  8. package/components/AppBar/styles.d.ts +2 -0
  9. package/components/AppBar/subcomponents/MyAvatar/index.d.ts +2 -1
  10. package/components/CommonActions/classes/constants.d.ts +1 -0
  11. package/components/CommonActions/classes/index.d.ts +4 -0
  12. package/components/CommonActions/classes/types.d.ts +11 -0
  13. package/components/CommonActions/components/ActionCancel/{index.49e5c8b2.js → index.9d521b2a.js} +4 -1
  14. package/components/CommonActions/components/ActionCancel/index.d.ts +2 -1
  15. package/components/CommonActions/components/ActionFormCancel/{index.58b30b03.js → index.4756457f.js} +27 -12
  16. package/components/CommonActions/components/ActionFormCancel/index.d.ts +2 -1
  17. package/components/CommonActions/components/ActionFormIntro/{index.a9ecbb73.js → index.40321b1b.js} +4 -1
  18. package/components/CommonActions/components/ActionFormIntro/index.d.ts +2 -1
  19. package/components/CommonActions/components/ActionIntro/{index.6605ee21.js → index.1ba5b02b.js} +5 -2
  20. package/components/CommonActions/components/ActionIntro/index.d.ts +2 -1
  21. package/components/CommonActions/components/Actions/index.154d7cb6.js +96 -0
  22. package/components/CommonActions/components/Actions/index.d.ts +2 -1
  23. package/components/CommonActions/components/Actions/styles.d.ts +2 -0
  24. package/components/DataGrid/contexts/DataGridContext/index.d.ts +1 -1
  25. package/components/DataGrid/contexts/FilterContext/index.d.ts +1 -1
  26. package/components/DataGrid/formatters/columnBooleanFormatter/index.d.ts +2 -1
  27. package/components/DataGrid/formatters/columnConcatenatedValueFormatter/index.d.ts +2 -1
  28. package/components/DataGrid/formatters/columnDateFormatter/index.d.ts +2 -1
  29. package/components/DataGrid/formatters/columnNestedValueFormatter/index.d.ts +2 -1
  30. package/components/DataGrid/formatters/columnPointsFormatter/index.d.ts +2 -1
  31. package/components/DataGrid/formatters/columnPriceFormatter/index.d.ts +2 -1
  32. package/components/DataGrid/formatters/columnUncertaintyFormatter/index.d.ts +2 -1
  33. package/components/DataGrid/{index.f4f7f858.js → index.2f4a0e64.js} +21 -19
  34. package/components/DataGrid/index.d.ts +2 -1
  35. package/components/DataGrid/styles.d.ts +3 -0
  36. package/components/DataGrid/subcomponents/Actions/index.d.ts +2 -1
  37. package/components/DataGrid/subcomponents/Actions/styles.d.ts +2 -0
  38. package/components/DataGrid/subcomponents/Actions/subcomponents/Density/index.d.ts +2 -1
  39. package/components/DataGrid/subcomponents/Actions/subcomponents/Density/styles.d.ts +3 -0
  40. package/components/DataGrid/subcomponents/Actions/subcomponents/Filter/index.d.ts +2 -1
  41. package/components/DataGrid/subcomponents/Actions/subcomponents/Filter/styles.d.ts +2 -0
  42. package/components/DataGrid/subcomponents/Actions/subcomponents/RowsCount/index.d.ts +2 -1
  43. package/components/DataGrid/subcomponents/Actions/subcomponents/RowsCount/styles.d.ts +4 -0
  44. package/components/DataGrid/subcomponents/Actions/subcomponents/Settings/index.d.ts +2 -1
  45. package/components/DataGrid/subcomponents/Actions/subcomponents/Settings/styles.d.ts +2 -0
  46. package/components/DataGrid/subcomponents/Actions/subcomponents/Settings/subcomponents/ColumnsConfig/styles.d.ts +8 -0
  47. package/components/DataGrid/subcomponents/Actions/subcomponents/Settings/subcomponents/ColumnsConfig/subcomponents/FormatterColumn/index.d.ts +2 -1
  48. package/components/DataGrid/subcomponents/Table/index.d.ts +2 -1
  49. package/components/DataGrid/subcomponents/Table/styles.d.ts +3 -0
  50. package/components/DataGrid/subcomponents/Table/subcomponents/CustomIcons.d.ts +14 -13
  51. package/components/DataGrid/subcomponents/Table/subcomponents/SkeletonFormatter/index.d.ts +2 -1
  52. package/components/DataGrid/subcomponents/Table/subcomponents/SkeletonFormatter/styles.d.ts +2 -0
  53. package/components/DataGrid/subcomponents/editors/TextEditor/index.d.ts +6 -0
  54. package/components/DraggableWindow/index.d.ts +2 -1
  55. package/components/DynamicFilter/DynamicFilter.d.ts +2 -1
  56. package/components/DynamicFilter/classes/index.d.ts +1 -1
  57. package/components/DynamicFilter/classes/types.d.ts +5 -0
  58. package/components/DynamicFilter/constants.d.ts +2 -2
  59. package/components/DynamicFilter/contexts/DynamicFilterContext/index.d.ts +1 -1
  60. package/components/DynamicFilter/contexts/DynamicFilterContext/store.d.ts +1 -1
  61. package/components/DynamicFilter/dictionary.d.ts +10 -0
  62. package/components/DynamicFilter/{index.2485b282.js → index.789ab474.js} +144 -136
  63. package/components/DynamicFilter/subcomponents/ApplyedFilters/index.d.ts +2 -1
  64. package/components/DynamicFilter/subcomponents/ApplyedFilters/styles.d.ts +3 -0
  65. package/components/DynamicFilter/subcomponents/ApplyedFilters/subcomponents/ApplyedFilter/index.d.ts +2 -1
  66. package/components/DynamicFilter/subcomponents/ApplyedFilters/subcomponents/ApplyedFilter/styles.d.ts +6 -0
  67. package/components/DynamicFilter/subcomponents/ClearFilters/index.d.ts +2 -1
  68. package/components/DynamicFilter/subcomponents/ClearFilters/styles.d.ts +3 -0
  69. package/components/DynamicFilter/subcomponents/FilterButton/index.d.ts +2 -1
  70. package/components/DynamicFilter/subcomponents/FilterButton/styles.d.ts +3 -0
  71. package/components/DynamicFilter/subcomponents/InnerForHooks/index.d.ts +2 -1
  72. package/components/DynamicFilter/subcomponents/InnerForHooks/styles.d.ts +3 -0
  73. package/components/DynamicFilter/subcomponents/InputFilter/index.d.ts +2 -1
  74. package/components/DynamicFilter/subcomponents/PopoverFilter/index.d.ts +2 -1
  75. package/components/DynamicFilter/subcomponents/PopoverFilter/styles.d.ts +2 -0
  76. package/components/DynamicFilter/subcomponents/PopoverMenuFields/index.d.ts +2 -1
  77. package/components/DynamicFilter/subcomponents/fieldstypes/BooleanFilter/index.d.ts +2 -1
  78. package/components/DynamicFilter/subcomponents/fieldstypes/BooleanFilter/styles.d.ts +2 -0
  79. package/components/DynamicFilter/subcomponents/fieldstypes/DateTimeFilter/index.d.ts +2 -1
  80. package/components/DynamicFilter/subcomponents/fieldstypes/DateTimeFilter/styles.d.ts +2 -0
  81. package/components/DynamicFilter/subcomponents/fieldstypes/NumberFilter/index.d.ts +2 -1
  82. package/components/DynamicFilter/subcomponents/fieldstypes/NumberFilter/styles.d.ts +2 -0
  83. package/components/DynamicFilter/subcomponents/fieldstypes/StringFilter/index.d.ts +2 -1
  84. package/components/DynamicFilter/subcomponents/fieldstypes/StringFilter/styles.d.ts +2 -0
  85. package/components/DynamicFilter/subcomponents/fieldstypes/factory.d.ts +2 -1
  86. package/components/HelmetPage/index.d.ts +2 -1
  87. package/components/HelperText/{index.dba051a9.js → index.a69e9509.js} +9 -9
  88. package/components/HelperText/index.d.ts +2 -1
  89. package/components/HelperText/styles.d.ts +2 -0
  90. package/components/Icon/Icon.d.ts +2 -1
  91. package/components/Icon/{index.f0a7d42d.js → index.caaed284.js} +2 -2
  92. package/components/Icon/styles.d.ts +4 -0
  93. package/components/Image/Image.d.ts +2 -1
  94. package/components/Image/{index.b216f30c.js → index.82a6cd46.js} +1 -1
  95. package/components/Image/styles.d.ts +3 -0
  96. package/components/Image/subcomponents/LazyLoadComponent/index.d.ts +2 -1
  97. package/components/Image/subcomponents/LazyLoadComponent/styles.d.ts +2 -0
  98. package/components/Image/subcomponents/Skeleton/index.d.ts +2 -1
  99. package/components/Image/subcomponents/Skeleton/styles.d.ts +2 -0
  100. package/components/LanguagePopover/LanguagePopover.d.ts +2 -1
  101. package/components/LanguagePopover/{index.8032715d.js → index.5af28b9e.js} +10 -10
  102. package/components/LanguagePopover/styles.d.ts +6 -0
  103. package/components/Loadable/index.d.ts +1 -1
  104. package/components/ModalDialog/{index.20a9b77a.js → index.cdfd1ae8.js} +5 -5
  105. package/components/NavLink/NavLink.d.ts +2 -1
  106. package/components/NavLink/{index.488dc01c.js → index.251fcf0d.js} +10 -10
  107. package/components/NavLink/styles.d.ts +2 -0
  108. package/components/NoItemSelected/{index.02c6c7ac.js → index.3b9d16e3.js} +1 -1
  109. package/components/NoItemSelected/index.d.ts +2 -1
  110. package/components/NoItemSelected/styles.d.ts +5 -0
  111. package/components/ObjectLogs/components/DetailDialog/index.d.ts +2 -1
  112. package/components/ObjectLogs/components/DetailDialog/styles.d.ts +3 -0
  113. package/components/ObjectLogs/components/DetailFormatter/index.d.ts +2 -1
  114. package/components/ObjectLogs/{index.9ff8250d.js → index.57ea68b3.js} +17 -15
  115. package/components/ObjectLogs/index.d.ts +2 -1
  116. package/components/ObjectLogs/styles.d.ts +4 -0
  117. package/components/PaperForm/components/Header.d.ts +2 -1
  118. package/components/PaperForm/index.d.ts +2 -1
  119. package/components/PaperForm/{index.0285a63f.js → index.d2d492ea.js} +1 -1
  120. package/components/PaperForm/styles.d.ts +7 -0
  121. package/components/Period/index.d.ts +2 -1
  122. package/components/Period/{index.41358ce0.js → index.fbf074d3.js} +24 -14
  123. package/components/Period/styles.d.ts +7 -0
  124. package/components/PropertyValue/index.d.ts +2 -1
  125. package/components/PropertyValue/skeleton.d.ts +2 -1
  126. package/components/PropertyValue/styles.d.ts +6 -0
  127. package/components/Resizeable/{index.18a50191.js → index.aafda79e.js} +1 -1
  128. package/components/ResizeableWindow/index.d.ts +2 -1
  129. package/components/ResizeableWindow/styles.d.ts +5 -0
  130. package/components/ScrollBar/index.d.ts +1 -1
  131. package/components/ScrollBar/styles.d.ts +8 -0
  132. package/components/SideBar/SideBar.d.ts +2 -1
  133. package/components/SideBar/classes/index.d.ts +2 -0
  134. package/components/SideBar/classes/types.d.ts +2 -4
  135. package/components/SideBar/context/sideBarContext/index.d.ts +1 -1
  136. package/components/SideBar/context/sideBarContext/types.d.ts +2 -2
  137. package/components/SideBar/{index.3ba3a821.js → index.3bc6a634.js} +190 -201
  138. package/components/SideBar/styles.d.ts +5 -0
  139. package/components/SideBar/subcomponents/ContentDesktop/index.d.ts +2 -1
  140. package/components/SideBar/subcomponents/ContentDesktop/style.d.ts +2 -0
  141. package/components/SideBar/subcomponents/ContentDesktop/subcomponents/CollapseButton/index.d.ts +2 -1
  142. package/components/SideBar/subcomponents/ContentDesktop/subcomponents/CollapseButton/styles.d.ts +3 -0
  143. package/components/SideBar/subcomponents/ContentGroups/index.d.ts +2 -1
  144. package/components/SideBar/subcomponents/ContentGroups/styles.d.ts +5 -0
  145. package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/index.d.ts +2 -1
  146. package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/styles.d.ts +2 -0
  147. package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/subcomponents/ArrowIcon/index.d.ts +2 -1
  148. package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/subcomponents/ArrowIcon/styles.d.ts +2 -0
  149. package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/subcomponents/NavItemRoot/index.d.ts +2 -1
  150. package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/subcomponents/NavItemRoot/styles.d.ts +9 -0
  151. package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/subcomponents/NavItemRoot/subcomponents/NavItemRootContent/index.d.ts +2 -1
  152. package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/subcomponents/NavItemRoot/subcomponents/NavItemRootContent/styles.d.ts +3 -0
  153. package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/subcomponents/NavItemRoot/type.d.ts +0 -1
  154. package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/subcomponents/NavListSub/index.d.ts +2 -1
  155. package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/subcomponents/NavListSub/styles.d.ts +2 -0
  156. package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/subcomponents/NavListSub/subcomponents/NavItemSub/index.d.ts +2 -1
  157. package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/subcomponents/NavListSub/subcomponents/NavItemSub/subcomponents/NavItemSubContent/index.d.ts +2 -1
  158. package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/subcomponents/NavListSub/subcomponents/NavItemSub/subcomponents/NavItemSubContent/styles.d.ts +22 -0
  159. package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/subcomponents/NavListSub/subcomponents/NavItemSub/subcomponents/NavItemSubContent/types.d.ts +3 -2
  160. package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/subcomponents/NavListSub/subcomponents/NavItemSub/types.d.ts +4 -1
  161. package/components/SideBar/subcomponents/ContentGroups/subcomponents/Skeleton/index.d.ts +2 -1
  162. package/components/SideBar/subcomponents/ContentGroups/subcomponents/Skeleton/styles.d.ts +6 -0
  163. package/components/SideBar/subcomponents/ContentMobile/index.d.ts +2 -1
  164. package/components/SideBar/subcomponents/ContentMobile/styles.d.ts +3 -0
  165. package/components/SideBar/types.d.ts +2 -0
  166. package/components/SplitLayout/index.d.ts +2 -1
  167. package/components/SplitLayout/styles.d.ts +4 -0
  168. package/components/WrapperComponent/index.d.ts +1 -0
  169. package/components/animate/LoadingScreen/index.d.ts +2 -1
  170. package/components/animate/LoadingScreen/styles.d.ts +3 -0
  171. package/components/animate/MotionContainer/index.d.ts +2 -1
  172. package/components/animate/MotionLazyContainer/index.d.ts +1 -1
  173. package/components/animate/PropagateLoader/index.d.ts +2 -1
  174. package/components/animate/PropagateLoader/syles.d.ts +2 -0
  175. package/components/areas/components/AreasAdmin/classes/index.d.ts +1 -1
  176. package/components/areas/components/AreasAdmin/classes/types.d.ts +4 -1
  177. package/components/areas/components/AreasAdmin/index.d.ts +2 -1
  178. package/components/areas/components/AreasAdmin/styles.d.ts +2 -0
  179. package/components/areas/components/AreasAdmin/subcomponents/AreaChip/index.d.ts +2 -1
  180. package/components/areas/components/AreasAdmin/subcomponents/AreaChip/types.d.ts +1 -0
  181. package/components/areas/components/AreasViewer/classes/types.d.ts +1 -0
  182. package/components/areas/components/AreasViewer/index.d.ts +2 -1
  183. package/components/areas/components/AreasViewer/styles.d.ts +2 -0
  184. package/components/areas/components/AreasViewer/subcomponents/Area/index.d.ts +3 -2
  185. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/GridLayout/index.d.ts +3 -1
  186. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/GridLayout/types.d.ts +3 -0
  187. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/InnerForHooks/index.d.ts +3 -1
  188. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/InnerForHooks/types.d.ts +3 -0
  189. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/PanelWindows/index.d.ts +3 -1
  190. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/PanelWindows/types.d.ts +3 -0
  191. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/index.d.ts +3 -3
  192. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/styles.d.ts +2 -0
  193. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Component/index.d.ts +4 -0
  194. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Component/types.d.ts +9 -0
  195. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/helper.d.ts +3 -0
  196. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/index.d.ts +9 -0
  197. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/skeleton.d.ts +2 -0
  198. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/styles.d.ts +9 -0
  199. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/subcomponents/MainActions/index.d.ts +6 -0
  200. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/MicroFrontend/index.d.ts +4 -0
  201. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/{InnerForHooks/subcomponents/MicroFrontend → MicroFrontend}/subcomponents/MFLoader/index.d.ts +3 -2
  202. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/MicroFrontend/subcomponents/MFLoader/subcomponents/LoadingMF/index.d.ts +3 -0
  203. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/MicroFrontend/subcomponents/MFLoader/subcomponents/LoadingMF/styles.d.ts +2 -0
  204. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/{InnerForHooks/subcomponents/MicroFrontend → MicroFrontend}/subcomponents/MFLoader/subcomponents/LoadingMF/subcomponents/NotFound/index.d.ts +2 -1
  205. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/MicroFrontend/subcomponents/MFLoader/subcomponents/LoadingMF/subcomponents/NotFound/styles.d.ts +2 -0
  206. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/MicroFrontend/subcomponents/MFLoader/types.d.ts +8 -0
  207. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/MicroFrontend/types.d.ts +8 -0
  208. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/types.d.ts +2 -0
  209. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/WindowModal/index.d.ts +2 -2
  210. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/WindowModal/styles.d.ts +3 -0
  211. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/WindowPopUp/index.d.ts +2 -2
  212. package/components/areas/components/AreasViewer/subcomponents/Area/types.d.ts +4 -0
  213. package/components/areas/components/index.359c2b18.js +1514 -0
  214. package/components/areas/components/index.d.ts +1 -1
  215. package/components/areas/contexts/AreasContext/helper.d.ts +59 -0
  216. package/components/areas/contexts/AreasContext/index.d.ts +1 -1
  217. package/components/areas/contexts/AreasContext/index.de8b4e78.js +1015 -0
  218. package/components/areas/contexts/AreasContext/store.d.ts +1 -2
  219. package/components/areas/contexts/AreasContext/types.d.ts +86 -13
  220. package/components/areas/contexts/DynamicMFParmsContext/index.1607c78e.js +42 -0
  221. package/components/areas/contexts/DynamicMFParmsContext/index.d.ts +8 -0
  222. package/components/areas/{components/AreasViewer/subcomponents/Area/subcomponents/Window/contexts → contexts}/DynamicMFParmsContext/store.d.ts +3 -9
  223. package/components/areas/contexts/WindowToolsMFContext/index.8f3e2a04.js +20 -0
  224. package/components/areas/{components/AreasViewer/subcomponents/Area/subcomponents/Window/contexts → contexts}/WindowToolsMFContext/index.d.ts +1 -1
  225. package/components/areas/{components/AreasViewer/subcomponents/Area/subcomponents/Window/contexts → contexts}/WindowToolsMFContext/types.d.ts +3 -2
  226. package/components/areas/contexts/index.771827bb.js +2 -0
  227. package/components/areas/contexts/index.d.ts +4 -4
  228. package/components/areas/dictionary.d.ts +1 -0
  229. package/components/areas/hooks/index.ae8d8631.js +13 -0
  230. package/components/areas/hooks/useArea/index.2adbe001.js +12 -0
  231. package/components/areas/hooks/useDynamicMFParameters/index.d.ts +3 -9
  232. package/components/areas/hooks/useDynamicMFParameters/{index.c9a35fad.js → index.e52c5392.js} +1 -1
  233. package/components/areas/hooks/useWindowToolsMF/index.d.ts +1 -1
  234. package/components/areas/icons.d.ts +4 -0
  235. package/components/areas/{index.38620c15.js → index.8a58bcbf.js} +15 -8
  236. package/components/areas/types.d.ts +32 -23
  237. package/components/formatters/BooleanFormatter/{index.083362c8.js → index.7eb0498c.js} +1 -1
  238. package/components/formatters/BooleanFormatter/index.d.ts +2 -1
  239. package/components/formatters/ConcatenatedFormatter/index.d.ts +1 -0
  240. package/components/formatters/DateFormatter/index.d.ts +2 -1
  241. package/components/formatters/PeriodFormatter/index.d.ts +1 -0
  242. package/components/formatters/PointsFormatter/index.d.ts +2 -1
  243. package/components/formatters/PriceFormatter/index.d.ts +2 -1
  244. package/components/formatters/UncertaintyFormatter/index.d.ts +2 -1
  245. package/components/formatters/{index.2d587e05.js → index.f6b9ed01.js} +2 -2
  246. package/components/hook-form/RHFAutocomplete/RHFAutocomplete.d.ts +2 -1
  247. package/components/hook-form/RHFAutocomplete/{index.6f0823fb.js → index.09c400c3.js} +11 -11
  248. package/components/hook-form/RHFAutocomplete/styles.d.ts +2 -0
  249. package/components/hook-form/RHFAutocomplete/subcomponents/RenderOption/index.d.ts +1 -1
  250. package/components/hook-form/RHFAutocomplete/subcomponents/RenderOption/styles.d.ts +2 -0
  251. package/components/hook-form/RHFAutocomplete/subcomponents/Skeleton/index.d.ts +2 -1
  252. package/components/hook-form/RHFAutocomplete/subcomponents/Skeleton/styles.d.ts +4 -0
  253. package/components/hook-form/RHFAutocompleteAsync/RHFAutocompleteAsync.d.ts +2 -1
  254. package/components/hook-form/RHFAutocompleteAsync/{index.dec5535b.js → index.e8acff04.js} +2 -2
  255. package/components/hook-form/RHFAutocompleteAsync/styles.d.ts +5 -0
  256. package/components/hook-form/RHFCheckbox/RHFCheckbox.d.ts +2 -1
  257. package/components/hook-form/RHFCheckbox/{index.7ae098fb.js → index.70310f35.js} +3 -3
  258. package/components/hook-form/RHFCheckbox/styles.d.ts +15 -0
  259. package/components/hook-form/RHFCheckbox/subcomponents/Skeleton/index.d.ts +2 -1
  260. package/components/hook-form/RHFCheckbox/subcomponents/Skeleton/styles.d.ts +3 -0
  261. package/components/hook-form/RHFDateTime/RHFDateTime.d.ts +3 -0
  262. package/components/hook-form/RHFDateTime/classes/constants.d.ts +1 -0
  263. package/components/hook-form/RHFDateTime/classes/index.d.ts +8 -0
  264. package/components/hook-form/RHFDateTime/classes/types.d.ts +13 -0
  265. package/components/hook-form/RHFDateTime/index.7b815072.js +187 -0
  266. package/components/hook-form/RHFDateTime/index.d.ts +1 -3
  267. package/components/hook-form/RHFDateTime/styles.d.ts +2 -0
  268. package/components/hook-form/RHFDateTime/subcomponents/Skeleton/index.d.ts +2 -1
  269. package/components/hook-form/RHFDateTime/subcomponents/Skeleton/styles.d.ts +2 -0
  270. package/components/hook-form/RHFDateTime/subcomponents/Skeleton/types.d.ts +3 -1
  271. package/components/hook-form/RHFDateTime/types.d.ts +13 -0
  272. package/components/hook-form/RHFMultiCheckbox/index.d.ts +2 -1
  273. package/components/hook-form/RHFPeriod/{index.81da23cf.js → index.3c7d393c.js} +2 -2
  274. package/components/hook-form/RHFPeriod/index.d.ts +2 -1
  275. package/components/hook-form/RHFPeriod/styles.d.ts +2 -0
  276. package/components/hook-form/RHFRadioGroup.d.ts +2 -1
  277. package/components/hook-form/RHFSelect.d.ts +2 -1
  278. package/components/hook-form/RHFTextField/{index.ef829e80.js → index.d4c39859.js} +6 -7
  279. package/components/hook-form/RHFTextField/styles.d.ts +3 -0
  280. package/components/hook-form/RHFTextField/subcomponents/Skeleton/index.d.ts +2 -1
  281. package/components/hook-form/RHFTextField/subcomponents/Skeleton/styles.d.ts +3 -0
  282. package/components/hook-form/RHFTextFieldPassword/RHFTextFieldPassword.d.ts +2 -1
  283. package/components/hook-form/RHFTextFieldPassword/styles.d.ts +2 -0
  284. package/components/hook-form/RHFUpload/RHFUploadImage/index.d.ts +2 -1
  285. package/components/hook-form/RHFUpload/RHFUploadImage/styles.d.ts +2 -0
  286. package/components/hook-form/RHFUpload/RHFUploadImage/subcomponents/UploadImage/index.d.ts +2 -1
  287. package/components/hook-form/RHFUpload/RHFUploadImage/subcomponents/UploadImage/styles.d.ts +12 -0
  288. package/components/hook-form/RHFUpload/RHFUploadImage/subcomponents/UploadImage/subcomponents/Skeleton/index.d.ts +2 -1
  289. package/components/hook-form/RHFUpload/RHFUploadImage/subcomponents/UploadImage/subcomponents/Skeleton/styles.d.ts +2 -0
  290. package/components/hook-form/RHFUpload/{index.0b97dc3c.js → index.31044674.js} +1 -1
  291. package/components/modal/ModalDialog/index.d.ts +2 -1
  292. package/components/modal/ModalDialog/styles.d.ts +9 -0
  293. package/components/modal/WindowBase/index.d.ts +2 -1
  294. package/components/modal/WindowBase/styles.d.ts +2 -0
  295. package/components/modal/WindowBase/subcomponents/Header/index.d.ts +2 -1
  296. package/components/modal/WindowBase/subcomponents/Header/styles.d.ts +6 -0
  297. package/components/modal/WindowBase/subcomponents/Header/types.d.ts +1 -1
  298. package/components/modal/WindowBase/types.d.ts +1 -0
  299. package/components/modal/{WindowBase.77a5aeb2.js → WindowBase.6a40a945.js} +28 -21
  300. package/components/modal/WindowConfirm/index.d.ts +2 -1
  301. package/components/modal/WindowConfirm/subcomponents/MessageIlustration/index.d.ts +2 -1
  302. package/components/modal/WindowConfirm/subcomponents/MessageIlustration/styles.d.ts +6 -0
  303. package/components/modal/{WindowConfirm.fcc6d9f8.js → WindowConfirm.e21763cb.js} +17 -15
  304. package/components/modal/index.438777d9.js +34 -0
  305. package/components/mui_extended/Accordion/components/AccordionLabel.d.ts +2 -1
  306. package/components/mui_extended/Accordion/{index.5370ebbf.js → index.437bb3f8.js} +2 -2
  307. package/components/mui_extended/Accordion/index.d.ts +2 -1
  308. package/components/mui_extended/Accordion/styles.d.ts +4 -0
  309. package/components/mui_extended/Avatar/subcomponents/SkeletonAvatar/index.d.ts +2 -1
  310. package/components/mui_extended/BoxIcon/index.d.ts +2 -1
  311. package/components/mui_extended/Breadcrumbs/components/LinkItem/index.d.ts +2 -1
  312. package/components/mui_extended/Breadcrumbs/index.d.ts +2 -1
  313. package/components/mui_extended/Button/Button.d.ts +2 -1
  314. package/components/mui_extended/Button/{index.4d13dbda.js → index.f8ce9ccd.js} +3 -3
  315. package/components/mui_extended/Button/styles.d.ts +13 -0
  316. package/components/mui_extended/CircularProgress/index.d.ts +2 -1
  317. package/components/mui_extended/IconButton/IconButton.d.ts +2 -1
  318. package/components/mui_extended/IconButton/{index.06b5c4a8.js → index.57824447.js} +1 -3
  319. package/components/mui_extended/IconButton/styles.d.ts +2 -0
  320. package/components/mui_extended/IconButton/subcomponents/SkeletonIconButton/index.d.ts +2 -1
  321. package/components/mui_extended/ImageButton/ImageButton.d.ts +2 -1
  322. package/components/mui_extended/ImageButton/styles.d.ts +2 -0
  323. package/components/mui_extended/LinearProgress/index.d.ts +2 -1
  324. package/components/mui_extended/LinkWithRoute/index.d.ts +2 -1
  325. package/components/mui_extended/LoadingButton/index.d.ts +2 -1
  326. package/components/mui_extended/LoadingButton/styles.d.ts +2 -0
  327. package/components/mui_extended/MenuActions/{index.e05e6158.js → index.37043326.js} +3 -3
  328. package/components/mui_extended/MenuActions/index.d.ts +2 -1
  329. package/components/mui_extended/MenuActions/styles.d.ts +30 -0
  330. package/components/mui_extended/Pager/components/PagerActions/index.d.ts +2 -1
  331. package/components/mui_extended/Pager/components/PagerActions/styles.d.ts +2 -0
  332. package/components/mui_extended/Pager/index.d.ts +2 -1
  333. package/components/mui_extended/Pager/{index.b9db40bc.js → index.eeed3bd5.js} +1 -1
  334. package/components/mui_extended/Pager/styles.d.ts +6 -0
  335. package/components/mui_extended/Popover/Popover.d.ts +2 -1
  336. package/components/mui_extended/Popover/{index.e271e4f0.js → index.226f247e.js} +3 -1
  337. package/components/mui_extended/Popover/styles.d.ts +1 -0
  338. package/components/mui_extended/Popover/subcomponts/ArrowIcon/index.d.ts +3 -0
  339. package/components/mui_extended/Tab/index.d.ts +2 -1
  340. package/components/mui_extended/Tab/styles.d.ts +2 -0
  341. package/components/mui_extended/Typography/Typography.d.ts +2 -1
  342. package/components/mui_extended/Typography/{index.ab4ee376.js → index.b3c6e71c.js} +1 -1
  343. package/components/mui_extended/Typography/styles.d.ts +2 -0
  344. package/components/mui_extended/Typography/subcomponents/index.d.ts +2 -1
  345. package/components/mui_extended/index.dacbb059.js +19 -0
  346. package/contexts/ModalContext/{index.fcb7d228.js → index.8e3cd7a8.js} +1 -1
  347. package/contexts/ModalContext/index.d.ts +1 -1
  348. package/contexts/RHFormContext/index.d.ts +2 -1
  349. package/contexts/RHFormContext/styles.d.ts +2 -0
  350. package/contexts/index.d.ts +1 -1
  351. package/hooks/useModal/{index.95fb6ba1.js → index.d590f506.js} +1 -1
  352. package/index.js +97 -95
  353. package/package.json +3 -4
  354. package/{react-draggable.26a0b105.js → react-draggable.0d64c8b1.js} +1 -1
  355. package/{react-resizable.3bd8013b.js → react-resizable.8307e056.js} +2 -2
  356. package/utils/{index.d4755e7e.js → index.a2312a73.js} +1 -1
  357. package/{vendor.659fcc31.js → vendor.8edaef93.js} +48 -46
  358. package/components/CommonActions/components/Actions/index.377c342e.js +0 -61
  359. package/components/areas/components/AreasViewer/subcomponents/Area/contexts/AreaContext/helper.d.ts +0 -39
  360. package/components/areas/components/AreasViewer/subcomponents/Area/contexts/AreaContext/index.d.ts +0 -20
  361. package/components/areas/components/AreasViewer/subcomponents/Area/contexts/AreaContext/store.d.ts +0 -11
  362. package/components/areas/components/AreasViewer/subcomponents/Area/contexts/AreaContext/types.d.ts +0 -82
  363. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/contexts/DynamicMFParmsContext/index.d.ts +0 -14
  364. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/contexts/WindowContext/helper.d.ts +0 -1
  365. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/contexts/WindowContext/index.d.ts +0 -13
  366. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/contexts/WindowContext/store.d.ts +0 -36
  367. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/contexts/WindowContext/types.d.ts +0 -5
  368. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/InnerForHooks/index.d.ts +0 -4
  369. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/InnerForHooks/subcomponents/Component/index.d.ts +0 -8
  370. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/InnerForHooks/subcomponents/Header/helper.d.ts +0 -3
  371. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/InnerForHooks/subcomponents/Header/index.d.ts +0 -1
  372. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/InnerForHooks/subcomponents/Header/skeleton.d.ts +0 -1
  373. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/InnerForHooks/subcomponents/Header/subcomponents/MainActions/index.d.ts +0 -1
  374. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/InnerForHooks/subcomponents/MicroFrontend/index.d.ts +0 -4
  375. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/InnerForHooks/subcomponents/MicroFrontend/subcomponents/MFLoader/subcomponents/LoadingMF/index.d.ts +0 -2
  376. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/InnerForHooks/subcomponents/MicroFrontend/types.d.ts +0 -8
  377. package/components/areas/components/index.b21d60d8.js +0 -2127
  378. package/components/areas/contexts/AreasContext/index.ded4e1bd.js +0 -230
  379. package/components/areas/contexts/index.65b0f324.js +0 -2
  380. package/components/areas/hooks/index.18cb3d8a.js +0 -26
  381. package/components/areas/hooks/useArea/index.d.ts +0 -11
  382. package/components/areas/hooks/useArea/index.d503dc0b.js +0 -34
  383. package/components/areas/hooks/useWindow/index.d.ts +0 -11
  384. package/components/hook-form/RHFDateTime/index.6c129ce4.js +0 -95
  385. package/components/modal/index.b13922a1.js +0 -24
  386. package/components/mui_extended/index.08799321.js +0 -19
  387. /package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/{InnerForHooks/subcomponents/MicroFrontend → MicroFrontend}/subcomponents/MFLoader/subcomponents/LoadingMF/subcomponents/NotFound/types.d.ts +0 -0
  388. /package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/{InnerForHooks/subcomponents/MicroFrontend → MicroFrontend}/subcomponents/MFLoader/subcomponents/LoadingMF/types.d.ts +0 -0
  389. /package/components/areas/{components/AreasViewer/subcomponents/Area/subcomponents/Window/contexts → contexts}/DynamicMFParmsContext/types.d.ts +0 -0
@@ -1,2127 +0,0 @@
1
- import { I as IconButton } from "../../mui_extended/IconButton/index.06b5c4a8.js";
2
- import { u as useAreasStore, a as useArea, b as useAreas, c as useAreaStore } from "../hooks/useArea/index.d503dc0b.js";
3
- import { useEnvironment, useNetwork, useModuleDictionary, useModuleSkeleton, useHostTools, axiosOperation } from "@m4l/core";
4
- import { shallow } from "zustand/shallow";
5
- import { A as AREAS_VIEWER_CLASS_NAME, a as AREAS_ADMIN_CLASS_NAME, I as ICONS, g as getAreasDictionary } from "../index.38620c15.js";
6
- import { jsxs, jsx, Fragment } from "react/jsx-runtime";
7
- import React__default, { createContext, useRef, useEffect, useMemo, useState, useCallback } from "react";
8
- import { generateUtilityClasses, Skeleton, styled as styled$1, Typography as Typography$1, Dialog } from "@mui/material";
9
- import { I as Icon } from "../../Icon/index.f0a7d42d.js";
10
- import clsx from "clsx";
11
- import { createStore, useStore } from "zustand";
12
- import "../contexts/AreasContext/index.ded4e1bd.js";
13
- import "../../mui_extended/Accordion/index.5370ebbf.js";
14
- import "../../mui_extended/Avatar/index.fe06afd7.js";
15
- import "react-router-dom";
16
- import "@mui/material/Button";
17
- import { B as Button } from "../../mui_extended/Button/index.4d13dbda.js";
18
- import { I as Image } from "../../Image/index.b216f30c.js";
19
- import "@mui/lab";
20
- import { T as Typography } from "../../mui_extended/Typography/index.ab4ee376.js";
21
- import "../../mui_extended/Popover/index.e271e4f0.js";
22
- import { M as MenuActions } from "../../mui_extended/MenuActions/index.e05e6158.js";
23
- import "../../mui_extended/Pager/index.b9db40bc.js";
24
- import "../../mui_extended/Tab/index.e0653a0a.js";
25
- import { unstable_composeClasses } from "@mui/base";
26
- import { g as getComponentUtilityClass } from "../../../utils/index.d4755e7e.js";
27
- import { styled } from "@mui/material/styles";
28
- import { r as react_resizable_css } from "../../../react-resizable.3bd8013b.js";
29
- import { immer } from "zustand/middleware/immer";
30
- import { devtools } from "zustand/middleware";
31
- import debounce from "lodash/debounce";
32
- import cloneDeep from "lodash.clonedeep";
33
- import { useResponsiveDesktop, useFirstRender, useHostTheme, useFormatter, useLocales } from "@m4l/graphics";
34
- import { WidthProvider, Responsive } from "react-grid-layout";
35
- import { m } from "framer-motion";
36
- import "../../animate/LoadingScreen/index.1d0c4307.js";
37
- import "../../animate/PropagateLoader/index.be5b02c3.js";
38
- import "react-hook-form";
39
- import "../../hook-form/RHFAutocomplete/index.6f0823fb.js";
40
- import "../../HelperText/index.dba051a9.js";
41
- import "../../hook-form/RHFAutocompleteAsync/index.dec5535b.js";
42
- import "../../hook-form/RHFCheckbox/index.7ae098fb.js";
43
- import "@mui/x-date-pickers";
44
- import "../../hook-form/RHFDateTime/index.6c129ce4.js";
45
- import "../../hook-form/RHFTextField/index.ef829e80.js";
46
- import "../../hook-form/RHFPeriod/index.81da23cf.js";
47
- import "../../Period/index.41358ce0.js";
48
- import "../../CommonActions/components/Actions/index.377c342e.js";
49
- import "../../../contexts/ModalContext/index.fcb7d228.js";
50
- import { c as cjs } from "../../../react-draggable.26a0b105.js";
51
- import "../../ModalDialog/index.20a9b77a.js";
52
- import { R as ResizeableWindow } from "../../Resizeable/index.18a50191.js";
53
- import "../../modal/WindowConfirm.fcc6d9f8.js";
54
- import "../../modal/WindowBase.77a5aeb2.js";
55
- import "lodash/isString";
56
- import "react-dropzone";
57
- import "../../hook-form/RHFUpload/index.0b97dc3c.js";
58
- import "../../DataGrid/index.f4f7f858.js";
59
- import "react-dnd";
60
- import "react-dnd-html5-backend";
61
- import "../../DynamicFilter/index.2485b282.js";
62
- import "../../ScrollBar/index.bbe48f4d.js";
63
- import "yup";
64
- import "@hookform/resolvers/yup";
65
- import "../../../contexts/RHFormContext/index.a7511399.js";
66
- import { D as DraggableWindow } from "../../../vendor.659fcc31.js";
67
- import "../../LanguagePopover/index.8032715d.js";
68
- import "../../NavLink/index.488dc01c.js";
69
- import "../../NoItemSelected/index.02c6c7ac.js";
70
- import "../../ObjectLogs/index.9ff8250d.js";
71
- import "../../../react-json-view.57125fcf.js";
72
- import "../../PaperForm/index.0285a63f.js";
73
- import "../../Page/index.4237c241.js";
74
- import "../../PropertyValue/index.dfcfe1ba.js";
75
- import "../../../react-splitter-layout.8b1655c8.js";
76
- import "../../SplitLayout/index.5a8355d8.js";
77
- import "../../SideBar/index.3ba3a821.js";
78
- import { a as useWindow, b as useWindowStore } from "../hooks/index.18cb3d8a.js";
79
- import { L as LinearProgress } from "../../mui_extended/LinearProgress/index.c92b9ba9.js";
80
- import { v as varBounce } from "../../animate/variants/bounce.784aaaaa.js";
81
- const areasViewerClasses = generateUtilityClasses(AREAS_VIEWER_CLASS_NAME, [
82
- "root",
83
- "areaRoot",
84
- "areaGridLayoutPanelContainer",
85
- "areaGridLayout",
86
- "areaGridLayoutPopupsContainer",
87
- "windowRoot",
88
- "windowHeader",
89
- "windowHeaderTitle",
90
- "windowHeaderMainActions",
91
- "windowContent",
92
- "windowPopupRoot",
93
- "windowModalRoot",
94
- "panelWindowsRoot",
95
- "panelWindowsButtonContainer",
96
- "selected",
97
- "isMobile"
98
- ], AREAS_VIEWER_CLASS_NAME);
99
- const useAreasViewerUtilityClasses = (ownerState) => {
100
- const slots = {
101
- root: ["root", ownerState.status, ownerState.isMobile && "isMobile", ownerState.isSkeleton && "isSkeleton"],
102
- areaRoot: ["areaRoot"],
103
- areaGridLayoutPanelContainer: ["areaGridLayoutPanelContainer"],
104
- areaGridLayout: ["areaGridLayout"],
105
- areaGridLayoutPopupsContainer: ["areaGridLayoutPopupsContainer"],
106
- windowRoot: ["windowRoot"],
107
- windowHeader: ["windowHeader"],
108
- windowHeaderTitle: ["windowHeaderTitle"],
109
- windowHeaderMainActions: ["windowHeaderMainActions"],
110
- windowContent: ["windowContent"],
111
- windowPopupRoot: ["windowPopupRoot"],
112
- windowModalRoot: ["windowModalRoot"],
113
- panelWindowsRoot: ["panelWindowsRoot"],
114
- panelWindowsButtonContainer: ["panelWindowsButtonContainer"]
115
- };
116
- return unstable_composeClasses(slots, getComponentUtilityClass(AREAS_VIEWER_CLASS_NAME), {});
117
- };
118
- const areasAdminClasses = generateUtilityClasses(AREAS_ADMIN_CLASS_NAME, [
119
- "root",
120
- "areaChipRoot",
121
- "areaChipTitle",
122
- "areaChipDeleteButton",
123
- "areaChipEditButton",
124
- "areasAddButton",
125
- "selected",
126
- "isMobile"
127
- ], AREAS_ADMIN_CLASS_NAME);
128
- const useAreasAdminUtilityClasses = (ownerState) => {
129
- const slots = {
130
- root: ["root", ownerState.status, ownerState.isMobile && "isMobile", ownerState.isSkeleton && "isSkeleton"],
131
- areaChipRoot: ["areaChipRoot"],
132
- areaChipTitle: ["areaChipTitle"],
133
- areaChipDeleteButton: ["areaChipDeleteButton"],
134
- areaChipEditButton: ["areaChipEditButton"],
135
- areasAddButton: ["areasAddButton"]
136
- };
137
- return unstable_composeClasses(slots, getComponentUtilityClass(AREAS_ADMIN_CLASS_NAME), {});
138
- };
139
- const AreaChip = (props) => {
140
- const {
141
- areaId,
142
- selected,
143
- areaName
144
- } = props;
145
- const {
146
- host_static_assets,
147
- environment_assets
148
- } = useEnvironment();
149
- const {
150
- deleteArea,
151
- selectArea
152
- } = useAreasStore((state) => state.actions);
153
- const onClickDeleteArea = (e) => {
154
- e.stopPropagation();
155
- deleteArea(areaId);
156
- };
157
- return /* @__PURE__ */ jsxs("div", {
158
- role: "presentation",
159
- className: clsx(areasAdminClasses.areaChipRoot, selected ? areasAdminClasses.selected : null),
160
- onClick: () => {
161
- selectArea(areaId);
162
- },
163
- children: [/* @__PURE__ */ jsx("span", {
164
- className: areasAdminClasses.areaChipTitle,
165
- children: areaName
166
- }), /* @__PURE__ */ jsx(IconButton, {
167
- className: areasAdminClasses.areaChipDeleteButton,
168
- src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.DELETE_AREA}`,
169
- size: "small",
170
- onClick: onClickDeleteArea
171
- })]
172
- });
173
- };
174
- AreaChip.displayName = "AreaButtons";
175
- const AreasAdminRoot = styled("div")`
176
- display: flex;
177
- position: relative;
178
-
179
- //areaRoot
180
- & .${areasAdminClasses.areaChipRoot} {
181
- display: flex;
182
- }
183
-
184
- & .${areasAdminClasses.areaChipRoot}.${areasAdminClasses.selected}::before {
185
- content: "";
186
- background-color: ${(props) => props.theme.palette.primary.main};
187
- height: 100%;
188
- width: 8px;
189
- },
190
-
191
- ${(props) => props.theme.components?.M4LAreasAdmin}
192
-
193
- `;
194
- function AreasAdmin() {
195
- const areas = useAreasStore((state) => state.areas, shallow);
196
- const currentArea = useAreasStore((state) => state.currentArea, shallow);
197
- const status = useAreasStore((state) => state.ownerState.status);
198
- const classesRoot = useAreasStore((state) => state.adminClasses.root);
199
- const {
200
- addArea
201
- } = useAreasStore((state) => state.actions, shallow);
202
- const {
203
- host_static_assets,
204
- environment_assets
205
- } = useEnvironment();
206
- console.log("Render AreasAdmin", status, areas);
207
- if (status !== "loaded") {
208
- return null;
209
- }
210
- return /* @__PURE__ */ jsxs(AreasAdminRoot, {
211
- className: classesRoot,
212
- children: [areas.map((area) => /* @__PURE__ */ jsx(AreaChip, {
213
- areaId: area.id,
214
- selected: area.id === currentArea,
215
- areaName: area.name
216
- }, area.id)), /* @__PURE__ */ jsx(IconButton, {
217
- className: areasAdminClasses.areasAddButton,
218
- src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.ADD_AREA}`,
219
- size: "small",
220
- onClick: addArea
221
- })]
222
- });
223
- }
224
- const AreasViewerRoot = styled("div")`
225
-
226
- /* display: flex; */
227
- width: 100%;
228
- height: 100%;
229
- overflow: hidden;
230
- /* flex-grow: 1; */
231
- position: relative;
232
-
233
-
234
-
235
- //areaRoot
236
- & .${areasViewerClasses.areaRoot} {
237
- display: none;
238
- position: absolute;
239
- /* flex-grow: 1; */
240
- flex-direction: row;
241
- inset: 0;
242
- /* width: 100%; */
243
- overflow: hidden;
244
- justify-content: top;
245
- align-items: flex-start;
246
-
247
- visibility: hidden;
248
- }
249
-
250
- & .${areasViewerClasses.areaRoot}.${areasViewerClasses.selected} {
251
- display: block;
252
- visibility: visible;
253
- }
254
-
255
- &.${areasViewerClasses.isMobile} .${areasViewerClasses.areaRoot} {
256
-
257
- }
258
-
259
- // areaGridLayoutPanelContainer
260
- & .${areasViewerClasses.areaGridLayoutPanelContainer} {
261
- display: flex;
262
- flex-direction: row;
263
- height: 100%;
264
- width: 100%;
265
- overflow: hidden;
266
- }
267
- &.${areasViewerClasses.isMobile} .${areasViewerClasses.areaGridLayoutPanelContainer} {
268
- flex-direction: column-reverse;
269
- }
270
- // areaGridLayout
271
- & .${areasViewerClasses.areaGridLayout} {
272
- height: 100%!important;
273
- overflow: auto;
274
- flex-grow: 1;
275
- }
276
- &.${areasViewerClasses.isMobile} .${areasViewerClasses.areaGridLayout} {
277
- flex-direction: column-reverse;
278
- height: unset;
279
- width: 100%;
280
- }
281
- // areaGridLayoutPopupsContainer
282
- & .${areasViewerClasses.areaGridLayoutPopupsContainer} {
283
- z-index: 1; //Garantizar q el contenedor de los popus este por encima de los layouts
284
- // // ' .react-draggable': {
285
- // // position: 'absolute',
286
- // // },
287
- }
288
-
289
- // PanelWindowsRoot
290
- & .${areasViewerClasses.panelWindowsRoot} {
291
- display: flex;
292
- flex-direction: column;
293
- position: relative;
294
- }
295
- &.${areasViewerClasses.isMobile} .${areasViewerClasses.panelWindowsRoot} {
296
- flex-direction: row;
297
- }
298
- & .${areasViewerClasses.panelWindowsButtonContainer}.${areasViewerClasses.selected} {
299
- border: 1px solid red;
300
- }
301
-
302
- // windowRoot
303
- & .${areasViewerClasses.windowRoot} {
304
- inset:0;
305
- position: absolute;
306
- display: flex;
307
- flex-direction: column;
308
- /* height: 100%; */
309
- /* width: 100%; */
310
- overflow: hidden;
311
- border: 1px solid gray;
312
-
313
- background-color: ${(props) => props.theme.palette.background.default};
314
- padding: ${(props) => props.theme.spacing(0)};
315
- }
316
-
317
- & .${areasViewerClasses.windowRoot}.${areasViewerClasses.selected} {
318
- border-top: 1px solid green;
319
- }
320
- // windowHeader
321
- & .${areasViewerClasses.windowHeader} {
322
- display: flex;
323
- gap: 4px;
324
-
325
- align-items: center;
326
- position: relative;
327
-
328
- padding: 8px;
329
- justify-content: end;
330
- min-height: ${(props) => props.theme.spacing(5)} ;
331
-
332
- border-bottom: 1px solid ${(props) => props.theme.palette.divider},
333
- overflow: hidden;
334
- cursor: move;
335
- height: 60px;
336
-
337
-
338
-
339
- > span: {
340
- margin-right: 12px;
341
- }
342
- }
343
- // windowHeaderTitle
344
- & .${areasViewerClasses.windowHeaderTitle} {
345
- width: 100%;
346
- max-width: 100%;
347
- overflow: hidden;
348
- white-space: nowrap;
349
- color: ${(props) => props.theme.palette.text.primary};
350
- margin-left: 12px;
351
- margin-right: 24px;
352
- text-overflow: ellipsis;
353
- }
354
- // windowHeaderMainActions
355
- & .${areasViewerClasses.windowHeaderMainActions} {
356
- display: flex;
357
-
358
- gap: 4px;
359
- }
360
-
361
-
362
- // windowHeaderMainActions
363
- & .${areasViewerClasses.windowContent} {
364
- flex-grow: 1;
365
- position: relative;
366
- }
367
-
368
- // windowModalRoot
369
- & .${areasViewerClasses.windowModalRoot} .${areasViewerClasses.windowRoot}{
370
- padding: 16px;
371
- }
372
-
373
- .react-grid-layout {
374
- position: relative;
375
- transition: height 200ms ease;
376
- }
377
- .react-grid-item {
378
- transition: all 200ms ease;
379
- transition-property: left, top;
380
- }
381
- .react-grid-item img {
382
- pointer-events: none;
383
- user-select: none;
384
- }
385
- .react-grid-item.cssTransforms {
386
- transition-property: transform;
387
- }
388
- .react-grid-item.resizing {
389
- z-index: 1;
390
- will-change: width, height;
391
- }
392
-
393
- .react-grid-item.react-draggable-dragging {
394
- transition: none;
395
- z-index: 3;
396
- will-change: transform;
397
- }
398
-
399
- .react-grid-item.dropping {
400
- visibility: hidden;
401
- }
402
-
403
- .react-grid-item.react-grid-placeholder {
404
- background: green;
405
- opacity: 0.2;
406
- transition-duration: 100ms;
407
- z-index: 2;
408
- -webkit-user-select: none;
409
- -moz-user-select: none;
410
- -ms-user-select: none;
411
- -o-user-select: none;
412
- user-select: none;
413
- }
414
-
415
- .react-grid-item > .react-resizable-handle {
416
- position: absolute;
417
- width: 20px;
418
- height: 20px;
419
- }
420
-
421
- .react-grid-item > .react-resizable-handle::after {
422
- content: "";
423
- position: absolute;
424
- right: 3px;
425
- bottom: 3px;
426
- width: 5px;
427
- height: 5px;
428
- border-right: 2px solid rgba(0, 0, 0, 0.4);
429
- border-bottom: 2px solid rgba(0, 0, 0, 0.4);
430
- }
431
-
432
- .react-resizable-hide > .react-resizable-handle {
433
- display: none;
434
- }
435
-
436
- .react-grid-item > .react-resizable-handle.react-resizable-handle-sw {
437
- bottom: 0;
438
- left: 0;
439
- cursor: sw-resize;
440
- transform: rotate(90deg);
441
- }
442
- .react-grid-item > .react-resizable-handle.react-resizable-handle-se {
443
- bottom: 0;
444
- right: 0;
445
- cursor: se-resize;
446
- }
447
- .react-grid-item > .react-resizable-handle.react-resizable-handle-nw {
448
- top: 0;
449
- left: 0;
450
- cursor: nw-resize;
451
- transform: rotate(180deg);
452
- }
453
- .react-grid-item > .react-resizable-handle.react-resizable-handle-ne {
454
- top: 0;
455
- right: 0;
456
- cursor: ne-resize;
457
- transform: rotate(270deg);
458
- }
459
- .react-grid-item > .react-resizable-handle.react-resizable-handle-w,
460
- .react-grid-item > .react-resizable-handle.react-resizable-handle-e {
461
- top: 50%;
462
- margin-top: -10px;
463
- cursor: ew-resize;
464
- }
465
- .react-grid-item > .react-resizable-handle.react-resizable-handle-w {
466
- left: 0;
467
- transform: rotate(135deg);
468
- }
469
- .react-grid-item > .react-resizable-handle.react-resizable-handle-e {
470
- right: 0;
471
- transform: rotate(315deg);
472
- }
473
- .react-grid-item > .react-resizable-handle.react-resizable-handle-n,
474
- .react-grid-item > .react-resizable-handle.react-resizable-handle-s {
475
- left: 50%;
476
- margin-left: -10px;
477
- cursor: ns-resize;
478
- }
479
- .react-grid-item > .react-resizable-handle.react-resizable-handle-n {
480
- top: 0;
481
- transform: rotate(225deg);
482
- }
483
- .react-grid-item > .react-resizable-handle.react-resizable-handle-s {
484
- bottom: 0;
485
- transform: rotate(45deg);
486
- }
487
-
488
-
489
- ${react_resizable_css}
490
-
491
-
492
- ${(props) => props.theme.components?.M4LAreasViewer}
493
-
494
-
495
- `;
496
- const ROW_HEIGTH_GRIDLAYOUT = 100;
497
- const CONTAINER_PADDING_GRIDLAYOUT = 3;
498
- const DEBOUCED_SAVE_TIME = 500;
499
- const COOKIE_BREAKPOINT_LAYOUTS = "layoutPros";
500
- const COOKIE_WINDOWS = "windows";
501
- const NORMALIZED_BREAKPOINTS = { lg: 1200, md: 996, sm: 768, xs: 480, xxs: 0 };
502
- const NORMALIZED_COLS = { lg: 24, md: 20, sm: 12, xs: 8, xxs: 2 };
503
- const MAXIMIZED_COLS = { lg: 24, md: 20, sm: 12, xs: 8, xxs: 2 };
504
- const getParmsFromValue = (key, data) => {
505
- try {
506
- if (Array.isArray(data)) {
507
- let ob = data.find((f) => f.id === key);
508
- if (ob) {
509
- ob = JSON.parse(ob.value);
510
- }
511
- return ob;
512
- }
513
- } catch (error) {
514
- }
515
- return void 0;
516
- };
517
- function setAddBreakPoints(state, newLayout) {
518
- const layoutsBreakPoints = state.breakpointsLayouts;
519
- const beforeMaximizebreakpointsLayouts = state.beforeMaximizebreakpointsLayouts;
520
- for (const key in layoutsBreakPoints) {
521
- const layoutBreakpoint = layoutsBreakPoints[key];
522
- layoutBreakpoint.push(newLayout);
523
- }
524
- if (state.viewMode === "single") {
525
- for (const key in beforeMaximizebreakpointsLayouts) {
526
- const beforeLayoutBreakpoint = beforeMaximizebreakpointsLayouts[key];
527
- beforeLayoutBreakpoint.push(newLayout);
528
- }
529
- }
530
- return layoutsBreakPoints;
531
- }
532
- function setBreakPointsMaximized(state, layoutId) {
533
- const layoutsBreakPoints = state.breakpointsLayouts;
534
- const container = document.getElementsByClassName(`${areasViewerClasses.areaRoot}`)[0];
535
- console.log(`Setting breakpoints`, container);
536
- if (container) {
537
- const clientHeight = container.clientHeight;
538
- for (const key in layoutsBreakPoints) {
539
- const layoutBreakpoint = layoutsBreakPoints[key];
540
- const cols = key in MAXIMIZED_COLS ? MAXIMIZED_COLS[key] : 1;
541
- const heigth_by_rowheigth = clientHeight / (ROW_HEIGTH_GRIDLAYOUT + 2 * CONTAINER_PADDING_GRIDLAYOUT);
542
- for (let index = 0; index < layoutBreakpoint.length; index++) {
543
- const l = layoutBreakpoint[index];
544
- if (l.i === layoutId) {
545
- l.x = 0;
546
- l.y = 0;
547
- l.h = heigth_by_rowheigth;
548
- l.w = cols;
549
- l.minW = 0;
550
- l.maxW = cols;
551
- l.minH = 0;
552
- l.maxH = heigth_by_rowheigth;
553
- l.isResizable = false;
554
- l.isDraggable = false;
555
- } else {
556
- l.x = 0;
557
- l.y = 1;
558
- l.h = 0;
559
- l.w = 0;
560
- l.minW = 0;
561
- l.maxW = 0;
562
- l.minH = 0;
563
- l.maxH = 0;
564
- }
565
- l.isResizable = false;
566
- l.isDraggable = false;
567
- }
568
- }
569
- }
570
- return layoutsBreakPoints;
571
- }
572
- function getDataFromResponse(data, state) {
573
- const newBreakPointsLayouts = getParmsFromValue(COOKIE_BREAKPOINT_LAYOUTS, data);
574
- const windows = getParmsFromValue(COOKIE_WINDOWS, data);
575
- const newGridLayouts = [];
576
- const newHashWindowLayouts = {};
577
- if (windows) {
578
- for (const key in windows) {
579
- const element = windows[key];
580
- if (element && element["layoutProps"] && element["mfProps"] && element["emergeType"] === "layout" && element["winType"] === "microfrontend") {
581
- element["layoutProps"].i = key;
582
- newGridLayouts.push(element["layoutProps"]);
583
- newHashWindowLayouts[key] = {
584
- ...element,
585
- windowId: key,
586
- emergeType: "layout",
587
- onClose: state.actions.closeWindowLayout
588
- };
589
- }
590
- }
591
- }
592
- return {
593
- newBreakPointsLayouts,
594
- newGridLayouts,
595
- newHashWindowLayouts
596
- };
597
- }
598
- const createAreaStore = (initProps) => {
599
- const startProps = {
600
- zPopUpIndex: 999,
601
- status: "init",
602
- breakpointsLayouts: {},
603
- beforeMaximizebreakpointsLayouts: {},
604
- gridLayouts: [],
605
- windowModal: null,
606
- windowsPopUps: [],
607
- hashWindowsPopups: {},
608
- hashWindowsLayouts: {},
609
- currentLayoutId: "",
610
- currentPopUpId: "",
611
- viewMode: initProps.isDesktop ? "multiple" : "single",
612
- breakpoints: NORMALIZED_BREAKPOINTS,
613
- cols: NORMALIZED_COLS,
614
- ...initProps
615
- };
616
- return createStore(
617
- devtools(
618
- immer((set, get) => ({
619
- ...startProps,
620
- actions: {
621
- addWindow: (newWindowProps) => {
622
- const windowId = `${get().id}_window_${new Date().getTime()}_${(Math.random() * 1e3).toFixed(0)}`;
623
- console.log("addWindow", newWindowProps.emergeType);
624
- if (newWindowProps.emergeType === "layout") {
625
- get().actions.addWindowLayout(windowId, newWindowProps);
626
- } else if (newWindowProps.emergeType === "popup") {
627
- get().actions.addWindowPopUp(windowId, newWindowProps);
628
- } else if (newWindowProps.emergeType === "modal") {
629
- get().actions.addWindowModal(windowId, newWindowProps);
630
- }
631
- },
632
- closeWindowModal: () => {
633
- set((state) => {
634
- state.windowModal = void 0;
635
- });
636
- },
637
- addWindowModal: (container_id, newWindowModalProps) => {
638
- set((state) => {
639
- state.windowModal = { ...newWindowModalProps, windowId: container_id };
640
- });
641
- },
642
- closeWindowPopUp: (removePopUpId) => {
643
- set((state) => {
644
- const removeIndex = state.windowsPopUps.findIndex(
645
- (wpId) => wpId === removePopUpId
646
- );
647
- if (removeIndex > -1) {
648
- state.windowsPopUps.splice(removeIndex, 1);
649
- }
650
- delete state.hashWindowsPopups[removePopUpId];
651
- });
652
- },
653
- addWindowPopUp: (windowId, newWindowPopupProps) => {
654
- let popUpId = windowId;
655
- set((state) => {
656
- if (newWindowPopupProps.replaceMeId) {
657
- for (const key in state.hashWindowsPopups) {
658
- const WindoPopUp = state.hashWindowsPopups[key];
659
- if (WindoPopUp.replaceMeId === newWindowPopupProps.replaceMeId) {
660
- popUpId = key;
661
- state.hashWindowsPopups[key].dynamicParams = newWindowPopupProps.dynamicParams;
662
- break;
663
- }
664
- }
665
- }
666
- if (popUpId === windowId) {
667
- state.windowsPopUps.push(windowId);
668
- state.hashWindowsPopups[windowId] = {
669
- ...newWindowPopupProps,
670
- emergeType: "popup",
671
- windowId,
672
- onClose: get().actions.closeWindowPopUp,
673
- zIndex: state.zPopUpIndex
674
- };
675
- state.currentPopUpId = windowId;
676
- }
677
- });
678
- get().actions.selectWindowPopUp(popUpId);
679
- },
680
- closeWindowLayout: (removeLayoutId) => {
681
- set((state) => {
682
- const removeIndex = state.gridLayouts.findIndex(
683
- (gl) => gl.i === removeLayoutId
684
- );
685
- if (removeIndex > -1) {
686
- state.gridLayouts.splice(removeIndex, 1);
687
- }
688
- delete state.hashWindowsLayouts[removeLayoutId];
689
- });
690
- get().actions.saveLayouts();
691
- if (get().singleId === removeLayoutId) {
692
- get().actions.maximizeLayout();
693
- }
694
- },
695
- addWindowLayout: (windowId, newWindow) => {
696
- const newLayout = {
697
- ...newWindow.layoutProps,
698
- i: windowId,
699
- isDraggable: true,
700
- isResizable: true,
701
- winType: newWindow.winType
702
- };
703
- set((state) => {
704
- state.gridLayouts.push(newLayout);
705
- state.hashWindowsLayouts[windowId] = {
706
- ...newWindow,
707
- windowId,
708
- emergeType: "layout",
709
- onClose: get().actions.closeWindowLayout
710
- };
711
- setAddBreakPoints(state, newLayout);
712
- });
713
- get().actions.selectWindowLayout(windowId);
714
- if (get().viewMode === "single") {
715
- get().actions.maximizeLayout(windowId);
716
- }
717
- get().actions.saveLayouts();
718
- get().actions.bouncedSaveBreakpointsLayouts();
719
- },
720
- saveLayouts: () => {
721
- let nrKeys = 0;
722
- const saveObjetc = {};
723
- for (const key in get().hashWindowsLayouts) {
724
- const element = get().hashWindowsLayouts[key];
725
- if (element.winType === "microfrontend") {
726
- const newElement = { ...element };
727
- delete newElement.onClose;
728
- delete newElement.devCookies;
729
- saveObjetc[key] = newElement;
730
- nrKeys++;
731
- }
732
- }
733
- if (nrKeys > 0) {
734
- get().networkOperation({
735
- method: "PUT",
736
- endPoint: `cookies/${get().id}/${COOKIE_WINDOWS}`,
737
- data: {
738
- value: JSON.stringify(saveObjetc)
739
- },
740
- toastSuccess: false,
741
- toastError: false
742
- });
743
- } else {
744
- get().networkOperation({
745
- method: "DELETE",
746
- endPoint: `cookies`,
747
- data: { f: [{ n: "container_id", o: "c", o1: get().id }] },
748
- toastSuccess: false,
749
- toastError: false
750
- });
751
- }
752
- },
753
- bouncedSaveBreakpointsLayouts: debounce(
754
- () => {
755
- const purgedLayouts = {
756
- ...get().viewMode === "multiple" ? get().breakpointsLayouts : get().beforeMaximizebreakpointsLayouts
757
- };
758
- const finalLayouts = {};
759
- for (const key in purgedLayouts) {
760
- const element = purgedLayouts[key];
761
- purgedLayouts[key] = element.filter((l) => {
762
- if (l.i === "none") {
763
- return false;
764
- }
765
- if (get().hashWindowsLayouts[l.i]) {
766
- return true;
767
- }
768
- return false;
769
- });
770
- if (purgedLayouts[key].length > 0) {
771
- finalLayouts[key] = purgedLayouts[key];
772
- }
773
- }
774
- if (Object.keys(finalLayouts).length > 0) {
775
- get().networkOperation({
776
- method: "PUT",
777
- endPoint: `cookies/${get().id}/${COOKIE_BREAKPOINT_LAYOUTS}`,
778
- data: {
779
- value: JSON.stringify(finalLayouts)
780
- },
781
- toastSuccess: false,
782
- toastError: false
783
- });
784
- }
785
- },
786
- DEBOUCED_SAVE_TIME
787
- ),
788
- onBreakpointsLayoutsChange: (_currentLayouts, newAllLayouts) => {
789
- set((state) => {
790
- state.breakpointsLayouts = newAllLayouts;
791
- });
792
- if (!get().singleId) {
793
- get().actions.bouncedSaveBreakpointsLayouts();
794
- }
795
- },
796
- selectWindowLayout: (layoutId) => {
797
- set((state) => {
798
- state.currentLayoutId = layoutId;
799
- if (state.currentPopUpId !== "" && state.hashWindowsPopups[state.currentPopUpId]) {
800
- const windowPopup = state.hashWindowsPopups[state.currentPopUpId];
801
- if (windowPopup.parentLayoutId !== layoutId) {
802
- state.currentPopUpId = "";
803
- }
804
- }
805
- });
806
- },
807
- selectWindowPopUp: (popUpId) => {
808
- set((state) => {
809
- state.zPopUpIndex++;
810
- state.currentPopUpId = popUpId;
811
- state.zPopUpIndex++;
812
- state.currentPopUpId = popUpId;
813
- state.hashWindowsPopups[popUpId].zIndex = state.zPopUpIndex;
814
- if (state.hashWindowsPopups[popUpId].parentLayoutId && state.hashWindowsPopups[popUpId].parentLayoutId !== "") {
815
- state.currentLayoutId = state.hashWindowsPopups[popUpId].parentLayoutId;
816
- } else {
817
- state.currentLayoutId = "";
818
- }
819
- });
820
- setTimeout(() => {
821
- const container = document.getElementsByClassName(
822
- `${areasViewerClasses.areaGridLayoutPanelContainer}-${get().id}`
823
- )[0];
824
- const element = document.getElementsByClassName(
825
- `${areasViewerClasses.windowPopupRoot}-${popUpId}`
826
- )[0];
827
- if (element && container) {
828
- const { top, left } = element.getBoundingClientRect();
829
- const { top: containerTop, left: containerLeft } = container.getBoundingClientRect();
830
- container.scrollTop = container.scrollTop + top - containerTop;
831
- container.scrollLeft = container.scrollLeft + left - containerLeft;
832
- }
833
- }, 100);
834
- },
835
- maximizeLayout: (layoutId) => {
836
- let finalLayoutId = layoutId;
837
- set((state) => {
838
- if (state.viewMode === "multiple") {
839
- state.beforeMaximizebreakpointsLayouts = cloneDeep(
840
- state.breakpointsLayouts
841
- );
842
- }
843
- if (!finalLayoutId) {
844
- if (state.gridLayouts.length > 0) {
845
- finalLayoutId = state.gridLayouts[0].i;
846
- }
847
- }
848
- state.viewMode = "single";
849
- state.singleId = finalLayoutId;
850
- setBreakPointsMaximized(state, finalLayoutId);
851
- });
852
- if (finalLayoutId) {
853
- get().actions.selectWindowLayout(finalLayoutId);
854
- }
855
- },
856
- normalizeLayouts: () => {
857
- set((state) => {
858
- if (!state.isDesktop)
859
- return;
860
- if (state.isDesktop && state.viewMode === "single") {
861
- state.viewMode = "multiple";
862
- state.singleId = void 0;
863
- state.breakpointsLayouts = state.beforeMaximizebreakpointsLayouts;
864
- }
865
- });
866
- }
867
- },
868
- internalActions: {
869
- loadFromApi: () => {
870
- if (get().status !== "init") {
871
- return;
872
- }
873
- if (!get().loadAreasFromNetwork || !get().loadWindows) {
874
- set((state) => {
875
- state.status = "loaded";
876
- });
877
- return;
878
- }
879
- get().networkOperation({
880
- method: "GET",
881
- endPoint: `cookies`,
882
- parms: { f: [{ n: "container_id", o: "e", o1: get().id }] },
883
- toastSuccess: false,
884
- toastError: false
885
- }).then((response) => {
886
- set((state) => {
887
- const {
888
- newBreakPointsLayouts,
889
- newGridLayouts,
890
- newHashWindowLayouts
891
- } = getDataFromResponse(response.data, state);
892
- if (state.viewMode === "multiple") {
893
- state.breakpointsLayouts = newBreakPointsLayouts;
894
- } else {
895
- state.breakpointsLayouts = newBreakPointsLayouts;
896
- state.beforeMaximizebreakpointsLayouts = newBreakPointsLayouts;
897
- }
898
- state.gridLayouts = newGridLayouts;
899
- state.hashWindowsLayouts = newHashWindowLayouts;
900
- state.status = "loaded";
901
- });
902
- console.log("loadFromApi", get().viewMode);
903
- if (get().viewMode === "single") {
904
- get().actions.maximizeLayout();
905
- }
906
- }).catch((_response) => {
907
- set((state) => {
908
- state.status = "loaded";
909
- });
910
- });
911
- },
912
- changeDesktopBreakpoint: (isDesktop) => {
913
- const previousState = get().isDesktop;
914
- set((state) => {
915
- state.isDesktop = isDesktop;
916
- });
917
- if (previousState != isDesktop) {
918
- if (isDesktop) {
919
- get().actions.normalizeLayouts();
920
- } else {
921
- if (get().viewMode === "multiple") {
922
- if (get().gridLayouts.length > 0) {
923
- get().actions.maximizeLayout(get().gridLayouts[0].i);
924
- }
925
- }
926
- }
927
- }
928
- }
929
- }
930
- })),
931
- { name: `Area state ${initProps.id}` }
932
- )
933
- );
934
- };
935
- const AreaContext = createContext(null);
936
- const AreaProvider = (props) => {
937
- const {
938
- children,
939
- id,
940
- selected: active,
941
- loadWindows = true
942
- } = props;
943
- const [loadAreasFromNetwork, loadCookiesFromNetwork] = useAreasStore((state) => [state.loadAreasFromNetwork, state.loadCookiesFromNetwork], shallow);
944
- const {
945
- setAreaLink
946
- } = useAreasStore((state) => state.internalActions);
947
- const isDesktop = useResponsiveDesktop();
948
- const isFirstRender = useFirstRender([isDesktop]);
949
- const {
950
- networkOperation
951
- } = useNetwork();
952
- const areaStoreRef = useRef();
953
- if (!areaStoreRef.current) {
954
- areaStoreRef.current = createAreaStore({
955
- id,
956
- networkOperation,
957
- loadAreasFromNetwork,
958
- loadCookiesFromNetwork,
959
- loadWindows,
960
- isDesktop: !!isDesktop
961
- });
962
- }
963
- const {
964
- loadFromApi,
965
- changeDesktopBreakpoint
966
- } = useStore(areaStoreRef.current, (state) => state.internalActions, shallow);
967
- const status = useStore(areaStoreRef.current, (state) => state.status, shallow);
968
- useEffect(() => {
969
- if (!isFirstRender) {
970
- changeDesktopBreakpoint(!!isDesktop);
971
- }
972
- }, [isDesktop]);
973
- useEffect(() => {
974
- if (areaStoreRef.current) {
975
- setAreaLink(id, areaStoreRef.current);
976
- }
977
- return () => {
978
- };
979
- }, []);
980
- useEffect(() => {
981
- if (active && status === "init") {
982
- loadFromApi();
983
- }
984
- }, [active]);
985
- return /* @__PURE__ */ jsx(AreaContext.Provider, {
986
- value: areaStoreRef.current,
987
- children
988
- });
989
- };
990
- if (process.env.NODE_ENV !== "production") {
991
- AreaProvider.displayName = "AreaProvider";
992
- }
993
- React__default.memo(AreaProvider);
994
- const WindowToolsMFContext = createContext(null);
995
- function WindowToolsMFProvider(props) {
996
- const {
997
- children,
998
- ...other
999
- } = props;
1000
- return /* @__PURE__ */ jsx(WindowToolsMFContext.Provider, {
1001
- value: {
1002
- ...other
1003
- },
1004
- children
1005
- });
1006
- }
1007
- React__default.memo(WindowToolsMFProvider);
1008
- const DynamicMFParmsContext = createContext(null);
1009
- function DynamicMFParmsProvider(props) {
1010
- const {
1011
- children,
1012
- store
1013
- } = props;
1014
- return /* @__PURE__ */ jsx(DynamicMFParmsContext.Provider, {
1015
- value: store,
1016
- children
1017
- });
1018
- }
1019
- const MemonizedDynamicMFParmsProvider = React__default.memo(DynamicMFParmsProvider);
1020
- const createDynamicMFStore = (initProps) => {
1021
- const startProps = {
1022
- ...initProps
1023
- };
1024
- return createStore(
1025
- devtools(
1026
- immer((set, _get) => ({
1027
- ...startProps,
1028
- actions: {
1029
- changeData: (newDynamicMFState) => {
1030
- set((state) => {
1031
- state.dynamicMFParameters = newDynamicMFState;
1032
- });
1033
- }
1034
- }
1035
- })),
1036
- { name: `dyamic store ${initProps.windowId}` }
1037
- )
1038
- );
1039
- };
1040
- function getCookiesContainer(data, containerId) {
1041
- const cookies = {};
1042
- try {
1043
- if (Array.isArray(data)) {
1044
- for (let i = 0; i < data.length; i++) {
1045
- if (data[i]?.container_id === containerId && data[i]?.id) {
1046
- cookies[data[i]?.id] = JSON.parse(data[i].value);
1047
- }
1048
- }
1049
- }
1050
- } catch (error) {
1051
- }
1052
- return cookies;
1053
- }
1054
- const createWindowStore = (initProps) => {
1055
- const startProps = {
1056
- status: "init",
1057
- moduleActions: [],
1058
- cookies: initProps.devCookies || { moduleCookies: {}, windowCookies: {} },
1059
- ...initProps
1060
- };
1061
- delete startProps.devCookies;
1062
- return createStore(
1063
- devtools(
1064
- immer((set, get, _api) => ({
1065
- ...startProps,
1066
- actions: {
1067
- setActions: (newActions, version) => {
1068
- set((state) => {
1069
- state.moduleActions = cloneDeep(newActions);
1070
- state.version = version;
1071
- console.log("LLEGO Version", version);
1072
- });
1073
- },
1074
- close: () => {
1075
- const onClose = get().onClose;
1076
- if (onClose) {
1077
- onClose(get().windowId);
1078
- }
1079
- },
1080
- getWindowId: () => {
1081
- return get().windowId;
1082
- },
1083
- getCookie: (id) => {
1084
- return get().cookies.windowCookies[id] || get().cookies.moduleCookies[id];
1085
- },
1086
- getCookies: (type) => {
1087
- if (type === "window") {
1088
- return get().cookies.windowCookies;
1089
- } else {
1090
- return get().cookies.moduleCookies;
1091
- }
1092
- },
1093
- setCookie: (id, type, cookie) => {
1094
- get().networkOperation({
1095
- method: "PUT",
1096
- endPoint: `cookies/${type === "module" ? get().moduleId : get().windowId}/${id}`,
1097
- data: {
1098
- value: JSON.stringify(cookie)
1099
- },
1100
- toastSuccess: false,
1101
- toastError: false
1102
- });
1103
- set((state) => {
1104
- if (type === "window") {
1105
- state.cookies.windowCookies[id] = cookie;
1106
- } else {
1107
- state.cookies.moduleCookies[id] = cookie;
1108
- }
1109
- });
1110
- }
1111
- },
1112
- internalActions: {
1113
- loadCookiesFromApi: () => {
1114
- if (get().status === "init") {
1115
- get().networkOperation({
1116
- method: "GET",
1117
- endPoint: `cookies`,
1118
- parms: {
1119
- f: [
1120
- { n: "container_id", o: "e", o1: get().windowId },
1121
- { n: "container_id", o: "e", o1: get().moduleId }
1122
- ]
1123
- },
1124
- toastSuccess: false,
1125
- toastError: false
1126
- }).then((response) => {
1127
- set((state) => {
1128
- state.cookies.moduleCookies = getCookiesContainer(
1129
- response.data,
1130
- state.moduleId
1131
- );
1132
- state.cookies.windowCookies = getCookiesContainer(
1133
- response.data,
1134
- state.windowId
1135
- );
1136
- state.status = "loaded";
1137
- });
1138
- }).catch((_response) => {
1139
- set((state) => {
1140
- state.status = "loaded";
1141
- });
1142
- });
1143
- }
1144
- },
1145
- saveModuleCookies: () => {
1146
- for (const key in get().cookies.windowCookies) {
1147
- const cookie = get().cookies.windowCookies[key];
1148
- get().networkOperation({
1149
- method: "PUT",
1150
- endPoint: `cookies/${get().moduleId}/${key}`,
1151
- data: {
1152
- value: JSON.stringify(cookie)
1153
- },
1154
- toastSuccess: false,
1155
- toastError: false
1156
- });
1157
- }
1158
- }
1159
- }
1160
- })),
1161
- {
1162
- name: `window store ${initProps.windowId}`,
1163
- store: `window dev store ${initProps.windowId}`,
1164
- trace: true
1165
- }
1166
- )
1167
- );
1168
- };
1169
- const WindowContext = createContext(null);
1170
- function WindowMFProvider(props) {
1171
- const {
1172
- children,
1173
- ...other
1174
- } = props;
1175
- const {
1176
- networkOperation
1177
- } = useNetwork();
1178
- const windowStoreRef = useRef();
1179
- const dynamicMFStoreRef = useRef();
1180
- const areaStore = useArea();
1181
- const areasStore = useAreas();
1182
- if (!dynamicMFStoreRef.current) {
1183
- dynamicMFStoreRef.current = createDynamicMFStore({
1184
- dynamicMFParameters: props.dynamicParams,
1185
- windowId: props.windowId
1186
- });
1187
- }
1188
- if (!windowStoreRef.current) {
1189
- windowStoreRef.current = createWindowStore({
1190
- ...other,
1191
- dynamicMFStore: dynamicMFStoreRef.current,
1192
- networkOperation,
1193
- areaStore,
1194
- areasStore
1195
- });
1196
- }
1197
- useEffect(() => {
1198
- windowStoreRef.current?.getState().internalActions.loadCookiesFromApi();
1199
- return () => {
1200
- console.debug("useEffect cleanUP WindowMFProvider", props.windowId, windowStoreRef.current);
1201
- };
1202
- }, []);
1203
- useEffect(() => {
1204
- if (windowStoreRef.current?.getState().status === "loaded") {
1205
- dynamicMFStoreRef.current?.getState().actions.changeData(props.dynamicParams);
1206
- }
1207
- }, [props.dynamicParams]);
1208
- return /* @__PURE__ */ jsx(WindowContext.Provider, {
1209
- value: windowStoreRef.current,
1210
- children
1211
- });
1212
- }
1213
- const Component = (props) => {
1214
- const {
1215
- component
1216
- } = props;
1217
- const store = useWindow();
1218
- const dynamicMFStore = useWindowStore((state) => state.dynamicMFStore);
1219
- const actions = useWindowStore((state) => state.actions, shallow);
1220
- return /* @__PURE__ */ jsx(WindowToolsMFProvider, {
1221
- ...actions,
1222
- children: /* @__PURE__ */ jsx(DynamicMFParmsProvider, {
1223
- store: dynamicMFStore,
1224
- children: typeof component === "function" ? component(store) : component
1225
- })
1226
- });
1227
- };
1228
- React__default.memo(Component);
1229
- styled("div")(({
1230
- theme
1231
- }) => ({
1232
- display: "flex",
1233
- alignItems: "center",
1234
- position: "relative",
1235
- justifyContent: "space-between",
1236
- minHeight: theme.spacing(5),
1237
- borderBottom: `1px solid ${theme.palette.divider}`,
1238
- overflow: "hidden",
1239
- cursor: "move",
1240
- height: "60px",
1241
- " > span": {
1242
- marginRight: "12px"
1243
- },
1244
- "& > h5": {
1245
- paddingRight: theme.spacing(3),
1246
- borderRight: `1px solid ${theme.palette.divider}`
1247
- },
1248
- " > nav": {
1249
- marginRight: "12px",
1250
- flexGrow: 1
1251
- },
1252
- "& .splitactions.Mui-disabled": {
1253
- color: theme.palette.primary.main
1254
- },
1255
- "& svg ": {
1256
- width: "20px",
1257
- height: "20px"
1258
- }
1259
- }));
1260
- styled("div")(({
1261
- theme
1262
- }) => ({
1263
- display: "flex",
1264
- alignItems: "center",
1265
- position: "relative",
1266
- borderBottom: `1px solid ${theme.palette.divider}`,
1267
- height: "60px",
1268
- minHeight: "60px",
1269
- " > span": {
1270
- marginRight: "12px"
1271
- },
1272
- "& > h5": {
1273
- paddingRight: theme.spacing(3),
1274
- borderRight: `1px solid ${theme.palette.divider}`
1275
- },
1276
- " > nav": {
1277
- marginRight: "12px",
1278
- flexGrow: 1
1279
- },
1280
- "& .splitactions.Mui-disabled": {
1281
- color: theme.palette.primary.main
1282
- },
1283
- "& svg ": {
1284
- width: "20px",
1285
- height: "20px"
1286
- }
1287
- }));
1288
- const Wrapper = styled("div")(({
1289
- theme
1290
- }) => ({
1291
- display: "flex",
1292
- justifyContent: "space-between",
1293
- padding: `0 0`,
1294
- borderBottom: `1px solid ${theme.palette.divider}`,
1295
- minHeight: "60px"
1296
- }));
1297
- const ModuleTitleContent = styled("div")(({
1298
- theme
1299
- }) => ({
1300
- display: "grid",
1301
- gridTemplateColumns: "auto",
1302
- gridGap: theme.spacing(1.75),
1303
- alignItems: "center",
1304
- width: "auto",
1305
- height: "auto",
1306
- [theme.breakpoints.up("sm")]: {
1307
- gridTemplateColumns: "repeat(3, auto)"
1308
- }
1309
- }));
1310
- const ModuleTitle = styled("div")(({
1311
- theme
1312
- }) => ({
1313
- display: "grid",
1314
- gridTemplateColumns: `${theme.spacing(3)} auto`,
1315
- gridGap: theme.spacing(2),
1316
- alignItems: "center",
1317
- width: "auto",
1318
- height: "auto"
1319
- }));
1320
- const Separator = styled("div")(({
1321
- theme
1322
- }) => ({
1323
- display: "none",
1324
- alignItems: "center",
1325
- width: "1px",
1326
- background: theme.palette.divider,
1327
- height: "100%",
1328
- margin: `0 ${theme.spacing(2)}`,
1329
- [theme.breakpoints.up("sm")]: {
1330
- display: "flex"
1331
- }
1332
- }));
1333
- const Breadcrumbs = styled("div")(({
1334
- theme
1335
- }) => ({
1336
- display: "grid",
1337
- alignItems: "center",
1338
- gridTemplateColumns: `repeat(3, auto)`,
1339
- gridGap: theme.spacing(2)
1340
- }));
1341
- const ModuleActions = styled("div")(({
1342
- theme
1343
- }) => ({
1344
- display: "grid",
1345
- gridTemplateColumns: "auto",
1346
- alignItems: "center",
1347
- width: "auto",
1348
- height: "auto",
1349
- [theme.breakpoints.up("sm")]: {
1350
- gridTemplateColumns: `repeat(3, ${theme.spacing(3)})`,
1351
- gridGap: theme.spacing(2)
1352
- }
1353
- }));
1354
- function SKTModuleHeader() {
1355
- const isDesktop = useResponsiveDesktop();
1356
- return /* @__PURE__ */ jsxs(Wrapper, {
1357
- id: "HeaderSkeleton",
1358
- children: [/* @__PURE__ */ jsxs(ModuleTitleContent, {
1359
- children: [/* @__PURE__ */ jsxs(ModuleTitle, {
1360
- children: [/* @__PURE__ */ jsx(Skeleton, {
1361
- variant: "circular",
1362
- width: 24,
1363
- height: 24
1364
- }), /* @__PURE__ */ jsx(Skeleton, {
1365
- variant: "text",
1366
- width: 120,
1367
- height: 14
1368
- })]
1369
- }), /* @__PURE__ */ jsx(Separator, {}), /* @__PURE__ */ jsxs(Breadcrumbs, {
1370
- children: [/* @__PURE__ */ jsx(Skeleton, {
1371
- variant: "text",
1372
- width: 68,
1373
- height: 14
1374
- }), /* @__PURE__ */ jsx(Skeleton, {
1375
- variant: "circular",
1376
- width: 4,
1377
- height: 4
1378
- }), /* @__PURE__ */ jsx(Skeleton, {
1379
- variant: "text",
1380
- width: 68,
1381
- height: 14
1382
- })]
1383
- })]
1384
- }), /* @__PURE__ */ jsx(ModuleActions, {
1385
- children: isDesktop ? /* @__PURE__ */ jsxs(Fragment, {
1386
- children: [/* @__PURE__ */ jsx(Skeleton, {
1387
- variant: "circular",
1388
- width: 24,
1389
- height: 24
1390
- }), /* @__PURE__ */ jsx(Skeleton, {
1391
- variant: "circular",
1392
- width: 24,
1393
- height: 24
1394
- }), /* @__PURE__ */ jsx(Skeleton, {
1395
- variant: "circular",
1396
- width: 24,
1397
- height: 24
1398
- })]
1399
- }) : /* @__PURE__ */ jsx(Skeleton, {
1400
- variant: "circular",
1401
- width: 24,
1402
- height: 24
1403
- })
1404
- })]
1405
- });
1406
- }
1407
- function getMainActions(isDesktop, moduleActions) {
1408
- let mainActions = [];
1409
- if (isDesktop !== void 0 && isDesktop) {
1410
- mainActions = mainActions.concat(
1411
- moduleActions.filter((action) => action.visibility === "main")
1412
- );
1413
- }
1414
- mainActions = mainActions.concat(
1415
- moduleActions.filter((action) => action.visibility === "allways")
1416
- );
1417
- return mainActions;
1418
- }
1419
- function getMenuActions(isDesktop, moduleActions, urlPrefix, saveModuleCookies, version) {
1420
- let menuActions = [...moduleActions.filter((action) => action.visibility !== "allways")];
1421
- if (isDesktop !== void 0 && isDesktop) {
1422
- menuActions = menuActions.filter((action) => action.visibility === "normal");
1423
- }
1424
- console.log("getMenuActions", version);
1425
- const savePropsAction = {
1426
- urlIcon: `${urlPrefix}/frontend/components/areas/assets/icons/split_vertical.svg`,
1427
- onClick: () => saveModuleCookies,
1428
- disabled: false,
1429
- visibility: "normal",
1430
- dictionaryId: getAreasDictionary("label_persist_module_cookies"),
1431
- key: "save_props"
1432
- };
1433
- menuActions.push(savePropsAction);
1434
- if (version) {
1435
- const versionAction = {
1436
- urlIcon: `${urlPrefix}/frontend/components/areas/assets/icons/version.svg`,
1437
- onClick: () => {
1438
- },
1439
- disabled: true,
1440
- visibility: "normal",
1441
- label: version,
1442
- key: "version"
1443
- };
1444
- menuActions.push(versionAction);
1445
- }
1446
- return menuActions;
1447
- }
1448
- function MainActions() {
1449
- const [moduleActions] = useWindowStore((state) => [state.moduleActions], shallow);
1450
- const {
1451
- getLabel
1452
- } = useModuleDictionary();
1453
- const isDesktop = useResponsiveDesktop();
1454
- const mainActions = useMemo(() => {
1455
- return getMainActions(isDesktop, moduleActions);
1456
- }, [moduleActions, isDesktop]);
1457
- return /* @__PURE__ */ jsx("div", {
1458
- className: areasViewerClasses.windowHeaderMainActions,
1459
- children: mainActions.map((mainAction) => {
1460
- const tooltip = mainAction.label !== void 0 ? mainAction.label : getLabel(mainAction.dictionaryId || "");
1461
- return /* @__PURE__ */ jsx(IconButton, {
1462
- src: mainAction.urlIcon,
1463
- className: mainAction.className,
1464
- onClick: mainAction.onClick,
1465
- "aria-label": mainAction.label,
1466
- disabled: mainAction.disabled,
1467
- tooltip
1468
- }, mainAction.key);
1469
- })
1470
- });
1471
- }
1472
- function Header() {
1473
- const [url_icon, title, moduleActions, onClose, container_id, version] = useWindowStore((state) => [state.url_icon, state.title, state.moduleActions, state.onClose, state.windowId, state.version], shallow);
1474
- const {
1475
- saveModuleCookies
1476
- } = useWindowStore((state) => state.internalActions);
1477
- const emergeType = useWindowStore((state) => state.emergeType);
1478
- const maximizedId = useAreaStore((state) => state.singleId);
1479
- const {
1480
- maximizeLayout,
1481
- normalizeLayouts
1482
- } = useAreaStore((state) => state.actions, shallow);
1483
- const {
1484
- host_static_assets,
1485
- environment_assets
1486
- } = useEnvironment();
1487
- const isDesktop = useResponsiveDesktop();
1488
- const isSkeleton = useModuleSkeleton();
1489
- const urlPrefix = `${host_static_assets}/${environment_assets}`;
1490
- const menuActions = useMemo(() => {
1491
- return getMenuActions(isDesktop, moduleActions, urlPrefix, saveModuleCookies, version);
1492
- }, [moduleActions, isDesktop]);
1493
- const onCloseLocal = () => {
1494
- onClose && onClose(container_id);
1495
- };
1496
- const maxNormalize = () => {
1497
- if (maximizedId) {
1498
- normalizeLayouts();
1499
- } else {
1500
- maximizeLayout(container_id);
1501
- }
1502
- };
1503
- if (isSkeleton) {
1504
- return /* @__PURE__ */ jsx(SKTModuleHeader, {});
1505
- }
1506
- return /* @__PURE__ */ jsxs("div", {
1507
- className: clsx(areasViewerClasses.windowHeader, "m4l_draggable_handle"),
1508
- children: [/* @__PURE__ */ jsx(Icon, {
1509
- src: url_icon,
1510
- size: "medium"
1511
- }), /* @__PURE__ */ jsx(Typography, {
1512
- className: areasViewerClasses.windowHeaderTitle,
1513
- variant: "h5",
1514
- children: `${title}`
1515
- }), /* @__PURE__ */ jsx(MainActions, {}), isDesktop && emergeType === "layout" && /* @__PURE__ */ jsx(IconButton, {
1516
- onClick: maxNormalize,
1517
- "aria-label": "click",
1518
- src: maximizedId ? `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.NORMALIZE}` : `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.MAXIMIZE}`
1519
- }), menuActions.length > 0 && /* @__PURE__ */ jsx(MenuActions, {
1520
- arrowType: "no-arrow",
1521
- marginTop: "12px!important",
1522
- marginLeft: "14px!important",
1523
- anchorOrigin: {
1524
- vertical: "bottom",
1525
- horizontal: "right"
1526
- },
1527
- transformOrigin: {
1528
- vertical: "top",
1529
- horizontal: "right"
1530
- },
1531
- menuActions
1532
- }), onClose && /* @__PURE__ */ jsx(IconButton, {
1533
- onClick: onCloseLocal,
1534
- "aria-label": "click",
1535
- src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.CLOSE}`
1536
- })]
1537
- });
1538
- }
1539
- const WrapperLinearProgress = styled$1("div")(() => ({
1540
- width: "70%",
1541
- margin: "auto auto"
1542
- }));
1543
- const WrapperFallBackNotFound = styled$1("div")(({
1544
- theme
1545
- }) => ({
1546
- width: "100%",
1547
- height: "100%",
1548
- display: "flex",
1549
- flexDirection: "column",
1550
- justifyContent: "center",
1551
- alignItems: "center",
1552
- gap: theme.spacing(3)
1553
- }));
1554
- function FallBackNotFound(props) {
1555
- const {
1556
- setNetworkRefresh
1557
- } = props;
1558
- const {
1559
- getLabel
1560
- } = useModuleDictionary();
1561
- const {
1562
- host_static_assets,
1563
- environment_assets
1564
- } = useEnvironment();
1565
- const handlerClick = () => {
1566
- setNetworkRefresh((prop) => !prop);
1567
- };
1568
- return /* @__PURE__ */ jsxs(WrapperFallBackNotFound, {
1569
- children: [/* @__PURE__ */ jsx(m.div, {
1570
- variants: varBounce().in,
1571
- children: /* @__PURE__ */ jsx(Typography$1, {
1572
- variant: "h3",
1573
- paragraph: true,
1574
- children: getLabel("loading_mf_title")
1575
- })
1576
- }), /* @__PURE__ */ jsx(Typography$1, {
1577
- sx: {
1578
- color: "text.secondary"
1579
- },
1580
- children: getLabel("loading_mf_description")
1581
- }), /* @__PURE__ */ jsx(m.div, {
1582
- variants: varBounce().in,
1583
- children: /* @__PURE__ */ jsx(Image, {
1584
- src: `${host_static_assets}/${environment_assets}/frontend/domain/host/commons/assets/img/illustration_noauth.png`,
1585
- ratio: "1:1"
1586
- })
1587
- }), /* @__PURE__ */ jsx(Button, {
1588
- size: "medium",
1589
- variant: "contained",
1590
- onClick: handlerClick,
1591
- children: getLabel("loading_mf_intro")
1592
- })]
1593
- });
1594
- }
1595
- const LoadingMF = (props) => {
1596
- const {
1597
- loadingProgress,
1598
- setNetworkRefresh
1599
- } = props;
1600
- if (loadingProgress !== -1) {
1601
- return /* @__PURE__ */ jsx(WrapperLinearProgress, {
1602
- id: "WrapperLinearProgress",
1603
- children: /* @__PURE__ */ jsx(LinearProgress, {
1604
- variant: "determinate",
1605
- value: loadingProgress
1606
- })
1607
- });
1608
- }
1609
- return /* @__PURE__ */ jsx(FallBackNotFound, {
1610
- setNetworkRefresh
1611
- });
1612
- };
1613
- function getDivScritId(prefix, moduleId) {
1614
- const rotational_id = `${Math.round(new Date().getTime() / 1e3)}_rnd_${Math.round(Math.random() * 1e3)}`;
1615
- return {
1616
- divContainerId: `container_${prefix}_${moduleId}_${rotational_id}`,
1617
- scriptId: `script_${moduleId}_${rotational_id}`,
1618
- moduleId
1619
- };
1620
- }
1621
- function MFLoader(props) {
1622
- const {
1623
- prefix,
1624
- moduleId,
1625
- cache = true,
1626
- debug_port,
1627
- dynamicMFStore,
1628
- windowTools
1629
- } = props;
1630
- const {
1631
- hostThemeOptions,
1632
- fnComponentsOverrides
1633
- } = useHostTheme();
1634
- const {
1635
- networkOperation
1636
- } = useNetwork();
1637
- const environment = useEnvironment();
1638
- const hostTools = useHostTools();
1639
- const formatter = useFormatter();
1640
- const [isLoading, setIsLoading] = useState(true);
1641
- const [networkProgress, setNetworkProgress] = useState(-1);
1642
- const [_networkRefresh, setNetworkRefresh] = useState(false);
1643
- const {
1644
- currentLocale
1645
- } = useLocales();
1646
- const [divScript, setDivScript] = useState(getDivScritId(prefix, moduleId));
1647
- const refTime = useRef(0);
1648
- const isFirstRender = useFirstRender([moduleId]);
1649
- const final_host = environment.isLocalhost ? `https://localhost:${debug_port}` : `https://${window.location.host}/mf/${moduleId}`;
1650
- function cleanUp(dScript) {
1651
- try {
1652
- if (window[`unmount_${prefix}_${dScript.moduleId}`]) {
1653
- window[`unmount_${prefix}_${dScript.moduleId}`](dScript.divContainerId);
1654
- }
1655
- } catch (error) {
1656
- }
1657
- if (!cache) {
1658
- const script = document.getElementById(dScript.scriptId);
1659
- if (script) {
1660
- try {
1661
- document.head.removeChild(script);
1662
- delete window[`render_${prefix}_${dScript.moduleId}`];
1663
- delete window[`unmount_${prefix}_${dScript.moduleId}`];
1664
- } catch (error) {
1665
- }
1666
- }
1667
- }
1668
- }
1669
- const renderMicroFrontend = useCallback((newDScript) => {
1670
- try {
1671
- setIsLoading(false);
1672
- window[`render_${prefix}_${newDScript.moduleId}`](newDScript.divContainerId, environment, hostTools, currentLocale, {
1673
- hostThemeOptions,
1674
- fnComponentsOverrides
1675
- }, axiosOperation, formatter, dynamicMFStore, windowTools);
1676
- } catch (error) {
1677
- }
1678
- }, [hostThemeOptions, currentLocale, formatter]);
1679
- const debouncedSetDivScript = useCallback(debounce((newName) => {
1680
- const newDivScript = getDivScritId(prefix, newName);
1681
- if (newName !== divScript.moduleId) {
1682
- setDivScript({
1683
- ...newDivScript
1684
- });
1685
- }
1686
- }, 200), [divScript]);
1687
- useEffect(() => {
1688
- if (!isFirstRender) {
1689
- debouncedSetDivScript(moduleId + "");
1690
- if (moduleId !== divScript.moduleId)
1691
- ;
1692
- }
1693
- return () => {
1694
- };
1695
- }, [moduleId]);
1696
- useEffect(() => {
1697
- setIsLoading(true);
1698
- let mounted = true;
1699
- const controller = new AbortController();
1700
- const dsScript = {
1701
- ...divScript
1702
- };
1703
- const loadIfNotLoaded = async () => {
1704
- if (!window[`render_${prefix}_${moduleId}`]) {
1705
- let urlFile = "";
1706
- setNetworkProgress(0);
1707
- const manifest = await fetch(`${final_host}/manifest.json?rnd=${Math.random()}`).then((res) => res.json()).catch(() => {
1708
- console.debug("Error fetching manifest", `${final_host}/manifest.json`);
1709
- return void 0;
1710
- });
1711
- if (!manifest) {
1712
- return;
1713
- }
1714
- setNetworkProgress(10);
1715
- if (mounted) {
1716
- urlFile = `${final_host}/${manifest["src/index.tsx"]["file"]}?rnd=${Math.random()}`;
1717
- refTime.current = 0;
1718
- await networkOperation({
1719
- method: "GET",
1720
- endPoint: urlFile,
1721
- isRemote: !environment.isLocalhost,
1722
- headers: {
1723
- "Content-Type": "application/json"
1724
- },
1725
- onDownloadProgress: (progressEvent) => {
1726
- let percentCompleted = 0;
1727
- try {
1728
- if (progressEvent.lengthComputable) {
1729
- percentCompleted = 10 + Math.round(progressEvent.loaded * 90 / progressEvent.total);
1730
- } else {
1731
- if (refTime.current === 0) {
1732
- refTime.current = new Date().getTime();
1733
- }
1734
- percentCompleted = 10 + progressEvent.loaded / 15e5 * 90;
1735
- if (percentCompleted > 95)
1736
- percentCompleted = 95;
1737
- }
1738
- } catch (error) {
1739
- }
1740
- if (mounted) {
1741
- setNetworkProgress(percentCompleted);
1742
- }
1743
- },
1744
- isExternalUrl: true,
1745
- responseType: "text",
1746
- signal: controller.signal
1747
- }).then(() => {
1748
- if (mounted) {
1749
- setNetworkProgress(100);
1750
- }
1751
- }).catch(() => {
1752
- });
1753
- if (mounted) {
1754
- const script = document.createElement("script");
1755
- script.id = divScript.scriptId;
1756
- script.crossOrigin = "";
1757
- script.type = "module";
1758
- script.src = urlFile || "";
1759
- script.onload = () => {
1760
- if (mounted) {
1761
- console.debug("Script loaded", new Date().getTime());
1762
- setNetworkProgress(100);
1763
- renderMicroFrontend(dsScript);
1764
- }
1765
- };
1766
- document.head.appendChild(script);
1767
- console.debug("Script appened", new Date().getTime());
1768
- }
1769
- }
1770
- } else {
1771
- if (mounted) {
1772
- renderMicroFrontend(dsScript);
1773
- }
1774
- }
1775
- };
1776
- loadIfNotLoaded();
1777
- return () => {
1778
- mounted = false;
1779
- controller.abort();
1780
- cleanUp(dsScript);
1781
- };
1782
- }, [divScript]);
1783
- return /* @__PURE__ */ jsxs(Fragment, {
1784
- children: [/* @__PURE__ */ jsx("div", {
1785
- id: divScript.divContainerId
1786
- }), isLoading ? /* @__PURE__ */ jsx(LoadingMF, {
1787
- loadingProgress: networkProgress,
1788
- setNetworkRefresh
1789
- }) : null]
1790
- });
1791
- }
1792
- MFLoader.defaultProps = {
1793
- document,
1794
- window
1795
- };
1796
- const MicroFrontend = (props) => {
1797
- const dynamicMFStore = useWindowStore((state) => state.dynamicMFStore, shallow);
1798
- const moduleId = useWindowStore((state) => state.moduleId, shallow);
1799
- const actions = useWindowStore((state) => state.actions, shallow);
1800
- return /* @__PURE__ */ jsx(MFLoader, {
1801
- ...props,
1802
- moduleId,
1803
- dynamicMFStore,
1804
- windowTools: {
1805
- ...actions
1806
- }
1807
- });
1808
- };
1809
- React__default.memo(MicroFrontend);
1810
- const InnerForHooks$1 = (props) => {
1811
- const {
1812
- winType
1813
- } = props;
1814
- const status = useWindowStore((state) => state.status);
1815
- if (status !== "loaded") {
1816
- return null;
1817
- }
1818
- return /* @__PURE__ */ jsxs(Fragment, {
1819
- children: [/* @__PURE__ */ jsx(Header, {}), /* @__PURE__ */ jsx("div", {
1820
- className: areasViewerClasses.windowContent,
1821
- children: winType === "microfrontend" ? /* @__PURE__ */ jsx(MicroFrontend, {
1822
- ...props.mfProps
1823
- }) : /* @__PURE__ */ jsx(Component, {
1824
- component: props.component
1825
- })
1826
- })]
1827
- });
1828
- };
1829
- React__default.memo(InnerForHooks$1);
1830
- const Window = (props) => {
1831
- const {
1832
- emergeType
1833
- } = props;
1834
- const selected = useAreaStore((state) => emergeType === "layout" ? state.currentLayoutId : state.currentPopUpId) === props.windowId;
1835
- const {
1836
- selectWindowPopUp,
1837
- selectWindowLayout
1838
- } = useAreaStore((state) => state.actions);
1839
- const onTouch = () => {
1840
- if (!selected) {
1841
- if (emergeType === "popup") {
1842
- selectWindowPopUp(props.windowId);
1843
- } else if (emergeType === "layout") {
1844
- selectWindowLayout(props.windowId);
1845
- }
1846
- }
1847
- };
1848
- return /* @__PURE__ */ jsx("div", {
1849
- role: "presentation",
1850
- className: clsx(areasViewerClasses.windowRoot, selected ? areasViewerClasses.selected : null),
1851
- onMouseDown: onTouch,
1852
- children: /* @__PURE__ */ jsx(WindowMFProvider, {
1853
- ...props,
1854
- children: /* @__PURE__ */ jsx(InnerForHooks$1, {
1855
- ...props
1856
- })
1857
- })
1858
- });
1859
- };
1860
- const MemonizedWindow = React__default.memo(Window);
1861
- const WindowPopUp = (props) => {
1862
- const {
1863
- windowProps,
1864
- windowId
1865
- } = props;
1866
- const {
1867
- selectWindowPopUp
1868
- } = useAreaStore((store) => store.actions);
1869
- const selectedPopUpId = useAreaStore((store) => store.currentPopUpId);
1870
- const zIndex = useAreaStore((store) => store.hashWindowsPopups[props.windowId].zIndex);
1871
- const isSelected = props.windowId === selectedPopUpId;
1872
- const onTouch = () => {
1873
- if (!isSelected) {
1874
- selectWindowPopUp(props.windowId);
1875
- }
1876
- };
1877
- return /* @__PURE__ */ jsx(DraggableWindow, {
1878
- handle: ".m4l_draggable_handle",
1879
- cancel: "",
1880
- defaultPosition: windowProps,
1881
- children: /* @__PURE__ */ jsx(ResizeableWindow, {
1882
- className: clsx(areasViewerClasses.windowPopupRoot, `${areasViewerClasses.windowPopupRoot}-${windowId}`),
1883
- width: windowProps.width,
1884
- height: windowProps.height,
1885
- style: {
1886
- zIndex,
1887
- position: "absolute"
1888
- },
1889
- onResizeStart: () => {
1890
- onTouch();
1891
- },
1892
- children: /* @__PURE__ */ jsx(Window, {
1893
- ...props
1894
- })
1895
- })
1896
- });
1897
- };
1898
- const MemonizedWindowPopUp = React__default.memo(WindowPopUp);
1899
- styled("div")(({ theme }) => ({
1900
- display: "flex",
1901
- flexDirection: "column",
1902
- height: "100%",
1903
- overflow: "hidden",
1904
- padding: theme.spacing(3)
1905
- }));
1906
- const WrapperWindowModal = styled(Dialog)(() => ({
1907
- "& .MuiDialog-container": {},
1908
- "&.m4l_selected": {
1909
- borderTop: "1px solid green"
1910
- }
1911
- }));
1912
- const WindowModal = (props) => {
1913
- const {
1914
- closeWindowModal
1915
- } = useAreaStore((state) => state.actions);
1916
- const isDesktop = useResponsiveDesktop();
1917
- const onClose = () => {
1918
- closeWindowModal();
1919
- };
1920
- const DragabblePaperComponent = (_props) => {
1921
- return /* @__PURE__ */ jsx(cjs.exports, {
1922
- handle: ".m4l_draggable_handle",
1923
- bounds: "parent",
1924
- children: /* @__PURE__ */ jsx(ResizeableWindow, {
1925
- className: areasViewerClasses.windowModalRoot,
1926
- width: props.width,
1927
- height: props.height,
1928
- children: /* @__PURE__ */ jsx(Window, {
1929
- ...props,
1930
- onClose
1931
- })
1932
- })
1933
- });
1934
- };
1935
- function PaperComponent(_props) {
1936
- return /* @__PURE__ */ jsx(Window, {
1937
- ...props,
1938
- onClose
1939
- });
1940
- }
1941
- return /* @__PURE__ */ jsx(WrapperWindowModal, {
1942
- open: true,
1943
- disablePortal: true,
1944
- scroll: "paper",
1945
- onKeyDown: (event) => {
1946
- if (event.key === "Escape") {
1947
- onClose();
1948
- }
1949
- },
1950
- "aria-labelledby": "child-modal-title",
1951
- "aria-describedby": "child-modal-description",
1952
- PaperComponent: isDesktop ? DragabblePaperComponent : PaperComponent,
1953
- maxWidth: false,
1954
- fullWidth: !isDesktop,
1955
- fullScreen: false,
1956
- disableEnforceFocus: true
1957
- });
1958
- };
1959
- const MemonizedWindowModal = React__default.memo(WindowModal);
1960
- const ResponsiveGridLayout = WidthProvider(Responsive);
1961
- const GridLayout = () => {
1962
- const gridLayouts = useAreaStore((state) => state.gridLayouts, shallow);
1963
- const hashWindowsPopups = useAreaStore((state) => state.hashWindowsPopups, shallow);
1964
- const hashWindowsLayouts = useAreaStore((state) => state.hashWindowsLayouts, shallow);
1965
- const breakPointsLayouts = useAreaStore((state) => state.breakpointsLayouts, shallow);
1966
- const windowsPopUps = useAreaStore((state) => state.windowsPopUps, shallow);
1967
- const windowModal = useAreaStore((state) => state.windowModal, shallow);
1968
- const breakpoints = useAreaStore((state) => state.breakpoints, shallow);
1969
- const viewMode = useAreaStore((state) => state.viewMode, shallow);
1970
- const cols = useAreaStore((state) => state.cols, shallow);
1971
- const {
1972
- onBreakpointsLayoutsChange
1973
- } = useAreaStore((state) => state.actions);
1974
- function onBreakpointChange(_newBreakpoint, _newCols) {
1975
- }
1976
- useEffect(() => {
1977
- console.log("ResponsiveGridLayout resize");
1978
- window.dispatchEvent(new Event("resize"));
1979
- }, [viewMode, gridLayouts]);
1980
- return /* @__PURE__ */ jsxs(Fragment, {
1981
- children: [/* @__PURE__ */ jsxs(ResponsiveGridLayout, {
1982
- autoSize: false,
1983
- compactType: "vertical",
1984
- measureBeforeMount: true,
1985
- resizeHandles: ["nw", "se"],
1986
- className: areasViewerClasses.areaGridLayout,
1987
- layouts: breakPointsLayouts,
1988
- onLayoutChange: onBreakpointsLayoutsChange,
1989
- onBreakpointChange,
1990
- breakpoints,
1991
- cols,
1992
- rowHeight: ROW_HEIGTH_GRIDLAYOUT,
1993
- margin: [5, 5],
1994
- containerPadding: [CONTAINER_PADDING_GRIDLAYOUT, CONTAINER_PADDING_GRIDLAYOUT],
1995
- draggableHandle: ".m4l_draggable_handle",
1996
- isBounded: false,
1997
- preventCollision: false,
1998
- children: [/* @__PURE__ */ jsx("div", {
1999
- className: areasViewerClasses.areaGridLayoutPopupsContainer,
2000
- "data-grid": {
2001
- i: "none",
2002
- x: 0,
2003
- y: 0,
2004
- w: 0,
2005
- h: 0,
2006
- maxW: 0,
2007
- maxH: 0,
2008
- minW: 0,
2009
- minH: 0,
2010
- static: true,
2011
- isDraggable: false,
2012
- isResizable: false
2013
- },
2014
- children: windowsPopUps.map((wp) => {
2015
- if (hashWindowsPopups[wp]) {
2016
- return /* @__PURE__ */ jsx(MemonizedWindowPopUp, {
2017
- ...hashWindowsPopups[wp]
2018
- }, hashWindowsPopups[wp].windowId);
2019
- }
2020
- return null;
2021
- })
2022
- }, "none"), gridLayouts.map((l) => {
2023
- if (hashWindowsLayouts[l.i]) {
2024
- return /* @__PURE__ */ jsx("div", {
2025
- children: /* @__PURE__ */ jsx(MemonizedWindow, {
2026
- ...hashWindowsLayouts[l.i]
2027
- })
2028
- }, l.i);
2029
- }
2030
- return null;
2031
- })]
2032
- }), windowModal && /* @__PURE__ */ jsx(MemonizedWindowModal, {
2033
- ...windowModal
2034
- })]
2035
- });
2036
- };
2037
- const InnerForHooks = () => {
2038
- const status = useAreaStore((state) => state.status);
2039
- if (status === "loaded") {
2040
- return /* @__PURE__ */ jsx(GridLayout, {});
2041
- } else {
2042
- return /* @__PURE__ */ jsx("div", {
2043
- children: "Loading.. Intentar si falla."
2044
- });
2045
- }
2046
- };
2047
- const PanelWindows = () => {
2048
- const status = useAreaStore((state) => state.status);
2049
- const mode = useAreaStore((state) => state.viewMode);
2050
- const singleId = useAreaStore((state) => state.singleId);
2051
- const gridLayouts = useAreaStore((state) => state.gridLayouts, shallow);
2052
- const hashWindowsLayouts = useAreaStore((state) => state.hashWindowsLayouts, shallow);
2053
- const {
2054
- maximizeLayout
2055
- } = useAreaStore((state) => state.actions);
2056
- const onTouched = (layoutId) => {
2057
- maximizeLayout(layoutId);
2058
- };
2059
- if (status === "loaded") {
2060
- if (mode !== "single" || gridLayouts.length < 2) {
2061
- return null;
2062
- }
2063
- return /* @__PURE__ */ jsx("div", {
2064
- className: areasViewerClasses.panelWindowsRoot,
2065
- children: gridLayouts.map((l) => {
2066
- return /* @__PURE__ */ jsx("div", {
2067
- className: clsx(areasViewerClasses.panelWindowsButtonContainer, singleId === l.i ? areasViewerClasses.selected : null),
2068
- children: /* @__PURE__ */ jsx(IconButton, {
2069
- src: hashWindowsLayouts[l.i].url_icon,
2070
- size: "small",
2071
- onClick: () => onTouched(l.i)
2072
- })
2073
- }, l.i);
2074
- })
2075
- });
2076
- } else {
2077
- return null;
2078
- }
2079
- };
2080
- const Area = (props) => {
2081
- const {
2082
- selected
2083
- } = props;
2084
- const classesAreaRoot = useAreasStore((state) => state.viwerClasses.areaRoot);
2085
- return /* @__PURE__ */ jsx("div", {
2086
- className: clsx(classesAreaRoot, selected ? areasViewerClasses.selected : null),
2087
- children: /* @__PURE__ */ jsx(AreaProvider, {
2088
- ...props,
2089
- children: /* @__PURE__ */ jsxs("div", {
2090
- className: clsx(areasViewerClasses.areaGridLayoutPanelContainer, `${areasViewerClasses.areaGridLayoutPanelContainer}-${props.id}`),
2091
- children: [/* @__PURE__ */ jsx(InnerForHooks, {}), /* @__PURE__ */ jsx(PanelWindows, {})]
2092
- })
2093
- })
2094
- });
2095
- };
2096
- Area.displayName = "Area";
2097
- function AreasViewer() {
2098
- const areas = useAreasStore((state) => state.areas);
2099
- const currentArea = useAreasStore((state) => state.currentArea);
2100
- const status = useAreasStore((state) => state.ownerState.status);
2101
- const classesRoot = useAreasStore((state) => state.viwerClasses.root);
2102
- return /* @__PURE__ */ jsx(AreasViewerRoot, {
2103
- className: classesRoot,
2104
- children: status === "loaded" ? areas.map((area) => {
2105
- return /* @__PURE__ */ jsx(Area, {
2106
- id: area.id,
2107
- selected: currentArea === area.id,
2108
- loadWindows: area.loadWindows
2109
- }, area.id);
2110
- }) : /* @__PURE__ */ jsx(Fragment, {
2111
- children: "Bruce cargando"
2112
- })
2113
- });
2114
- }
2115
- export {
2116
- AreaContext as A,
2117
- DynamicMFParmsContext as D,
2118
- MemonizedDynamicMFParmsProvider as M,
2119
- WindowContext as W,
2120
- useAreasAdminUtilityClasses as a,
2121
- WindowToolsMFContext as b,
2122
- AreasAdmin as c,
2123
- AreasViewer as d,
2124
- WindowToolsMFProvider as e,
2125
- DynamicMFParmsProvider as f,
2126
- useAreasViewerUtilityClasses as u
2127
- };