@m4l/components 0.2.36 → 1.0.0

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 (201) hide show
  1. package/components/AccountPopover/{index.a9dc9f92.js → index.efc74d5c.js} +3 -5
  2. package/components/AppBar/{index.7dee7427.js → index.fc126a22.js} +6 -5
  3. package/components/AppBar/styles.d.ts +1 -1
  4. package/components/CommonActions/components/Actions/styles.d.ts +1 -1
  5. package/components/DataGrid/styles.d.ts +1 -1
  6. package/components/DataGrid/subcomponents/Actions/subcomponents/Settings/subcomponents/ColumnsConfig/styles.d.ts +7 -7
  7. package/components/DragResizeWindow/{index.a9f25040.js → index.46b380e1.js} +3 -6
  8. package/components/DynamicFilter/dynamicFilterSlots.d.ts +76 -101
  9. package/components/DynamicFilter/{index.48d809e2.js → index.d9168c12.js} +22 -96
  10. package/components/FieldLabel/{index.2622ee40.js → index.f9cdcc27.js} +4 -4
  11. package/components/GridLayout/{index.b9c47a4c.js → index.bb3b7769.js} +23 -46
  12. package/components/GridLayout/subcomponents/Griditem/{index.69bc14e5.js → index.bb23f651.js} +4 -3
  13. package/components/GridLayout/subcomponents/Responsive/{index.094c1d09.js → index.b8a2a121.js} +2 -1
  14. package/components/GridLayout/subcomponents/SizeProvider/{index.e1d2df80.js → index.094bc6b5.js} +1 -1
  15. package/components/{commercial/index.b90488db.js → HamburgerMenu/index.5997af31.js} +4 -6
  16. package/components/HelperText/{index.81c5d349.js → index.be949cdf.js} +3 -2
  17. package/components/HelperText/styles.d.ts +1 -1
  18. package/components/Icon/index.d5fed418.js +420 -0
  19. package/components/Icon/styles.d.ts +2 -2
  20. package/components/{hook-form/RHFUpload/index.c5e5c61c.js → Image/index.36a3d440.js} +233 -32
  21. package/components/Image/styles.d.ts +1 -1
  22. package/components/LanguagePopover/{index.72f316fc.js → index.e6fa2336.js} +5 -8
  23. package/components/LanguagePopover/styles.d.ts +5 -5
  24. package/components/LinearProgressIndeterminate/{index.2ecd571e.js → index.de9d447c.js} +2 -4
  25. package/components/Loadable/{index.97fe63f9.js → index.e83cdb4e.js} +1 -1
  26. package/components/LoadingError/{index.7aaba1cf.js → index.9f00c83c.js} +8 -12
  27. package/components/LoadingError/styles.d.ts +1 -1
  28. package/components/MFLoader/{index.40c419c0.js → index.402c1acc.js} +4 -8
  29. package/components/ModalDialog/{index.42349189.js → index.ea9189c3.js} +5 -14
  30. package/components/NavLink/{index.9e847eb5.js → index.4e548cee.js} +4 -4
  31. package/components/NavLink/styles.d.ts +1 -1
  32. package/components/NoItemSelected/{index.5a8160fd.js → index.418c8316.js} +6 -15
  33. package/components/NoItemSelected/styles.d.ts +4 -4
  34. package/components/ObjectLogs/{index.6955149e.js → index.bfa7dad3.js} +10 -27
  35. package/components/ObjectLogs/styles.d.ts +3 -3
  36. package/components/PDFViewer/{index.47bb0928.js → index.bb2eca5a.js} +2 -2
  37. package/components/{mui_extended/Pager/index.1ba2d52b.js → Page/index.fdf04592.js} +134 -26
  38. package/components/PaperForm/{index.9f6fd02d.js → index.8121e3da.js} +8 -7
  39. package/components/PaperForm/styles.d.ts +6 -6
  40. package/components/Period/{index.c6d1a95a.js → index.5233694b.js} +157 -22
  41. package/components/Period/styles.d.ts +5 -5
  42. package/components/PrintingSystem/{index.f51a00f8.js → index.fb176a93.js} +14 -14
  43. package/components/PrintingSystem/subcomponents/BodyNode/{index.6792c353.js → index.c1d61038.js} +1 -1
  44. package/components/PrintingSystem/subcomponents/ChartNode/{index.eec6b4cd.js → index.18bd9bad.js} +1 -1
  45. package/components/PrintingSystem/subcomponents/DividerNode/{index.e58467c9.js → index.67d9f1b4.js} +1 -1
  46. package/components/PrintingSystem/subcomponents/FooterNode/{index.920b75c9.js → index.eaee152a.js} +1 -1
  47. package/components/PrintingSystem/subcomponents/GridNode/{index.6c1ad53c.js → index.f5f63a2a.js} +1 -1
  48. package/components/PrintingSystem/subcomponents/HeaderNode/{index.e8b151ad.js → index.7de4e411.js} +1 -1
  49. package/components/PrintingSystem/subcomponents/PaperNode/{index.bf199422.js → index.f9ccf22b.js} +1 -1
  50. package/components/PrintingSystem/subcomponents/PropertyValueNode/{index.44d436b9.js → index.f2f2e903.js} +1 -1
  51. package/components/PrintingSystem/subcomponents/SectionNode/{index.879cf13d.js → index.540a4b19.js} +1 -1
  52. package/components/PrintingSystem/subcomponents/TextBoxNode/{index.eb6af0ca.js → index.41e7fcb0.js} +1 -1
  53. package/components/PropertyValue/{index.5e59580c.js → index.9572c347.js} +4 -7
  54. package/components/Resizeable/{index.5e8e48b1.js → index.1f0c1359.js} +7 -7
  55. package/components/ResizeableWindow/styles.d.ts +1 -1
  56. package/components/ScrollBar/{index.4b965665.js → index.adf0eade.js} +2 -4
  57. package/components/SideBar/classes/index.d.ts +1 -1
  58. package/components/SideBar/{index.5d1f4a23.js → index.629ba840.js} +24 -26
  59. package/components/SideBar/styles.d.ts +2 -2
  60. package/components/SideBar/subcomponents/ContentGroups/styles.d.ts +3 -3
  61. package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/styles.d.ts +1 -1
  62. package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/subcomponents/NavListSub/subcomponents/NavItemSub/subcomponents/NavItemSubContent/styles.d.ts +2 -18
  63. package/components/SplitLayout/{index.15756f0f.js → index.74091a81.js} +1 -3
  64. package/components/ToastContainer/{index.dbd78941.js → index.f9b507b9.js} +3 -3
  65. package/components/animate/LoadingScreen/{index.1a83615a.js → index.779690a7.js} +3 -5
  66. package/components/animate/PropagateLoader/{index.76d7ea70.js → index.a9da8d00.js} +3 -2
  67. package/components/animate/PropagateLoader/syles.d.ts +1 -1
  68. package/components/animate/{index.87296638.js → index.b8497385.js} +3 -2
  69. package/components/areas/components/AreasAdmin/subcomponents/AreaChip/styles.d.ts +3 -3
  70. package/components/areas/constants.5387d83e.js +412 -0
  71. package/components/areas/contexts/AreasContext/{index.19c7b906.js → index.bb316000.js} +5 -6
  72. package/components/areas/contexts/DynamicMFParmsContext/{index.3d9ad0ad.js → index.37d1d444.js} +2 -2
  73. package/components/areas/contexts/WindowToolsMFContext/{index.992ae7a3.js → index.69d95c15.js} +2 -2
  74. package/components/areas/dictionary.7e74022a.js +286 -0
  75. package/components/areas/hooks/useAreas/{index.cedd30ee.js → index.e24bd74d.js} +1 -1
  76. package/components/areas/hooks/useDynamicMFParameters/{index.9e09e1e3.js → index.03ce6078.js} +1 -1
  77. package/components/areas/hooks/useWindowToolsMF/{index.2fbae9dc.js → index.09801b66.js} +1 -1
  78. package/components/areas/icons.504ec098.js +83 -0
  79. package/components/commercial/HamburgerMenu/styles.d.ts +1 -1
  80. package/components/commercial/SectionCommercial/styles.d.ts +4 -9
  81. package/components/hook-form/RHFAutocomplete/classes/index.d.ts +1 -1
  82. package/components/hook-form/RHFAutocomplete/styles.d.ts +1 -1
  83. package/components/hook-form/RHFAutocomplete/subcomponents/RenderOption/styles.d.ts +1 -1
  84. package/components/hook-form/RHFAutocompleteAsync/styles.d.ts +4 -4
  85. package/components/hook-form/RHFCheckbox/styles.d.ts +2 -10
  86. package/components/hook-form/RHFPeriod/styles.d.ts +1 -1
  87. package/components/hook-form/RHFTextField/styles.d.ts +2 -2
  88. package/components/hook-form/RHFTextField/subcomponents/Skeleton/styles.d.ts +2 -2
  89. package/components/hook-form/RHFTextFieldPassword/styles.d.ts +1 -1
  90. package/components/hook-form/RHFUpload/RHFUploadImage/subcomponents/UploadImage/styles.d.ts +1 -1
  91. package/components/maps/components/GpsTools/{index.4ea69dd1.js → index.75880ce0.js} +14 -136
  92. package/components/maps/components/GpsTools/subcomponents/TabsGpsTools/subcomponents/GeofencesList/styles.d.ts +4 -9
  93. package/components/maps/{components/Map/index.62b7d09b.js → index.8ec46ce4.js} +19 -194
  94. package/components/modal/{WindowBase.2414cd02.js → WindowBase.a3ac7adc.js} +3 -4
  95. package/components/modal/{WindowConfirm.48140481.js → WindowConfirm.e35da619.js} +6 -10
  96. package/components/modal/{index.81eb6def.js → index.a0e30c8b.js} +1 -5
  97. package/components/mui_extended/Accordion/styles.d.ts +3 -3
  98. package/components/mui_extended/Badge/styles.d.ts +1 -1
  99. package/components/mui_extended/Button/styles.d.ts +2 -10
  100. package/components/mui_extended/IconButton/styles.d.ts +1 -1
  101. package/components/mui_extended/ImageButton/styles.d.ts +1 -1
  102. package/components/mui_extended/MenuActions/styles.d.ts +2 -27
  103. package/components/mui_extended/Pager/styles.d.ts +1 -1
  104. package/components/mui_extended/Stack/styles.d.ts +2 -9
  105. package/components/mui_extended/Tab/styles.d.ts +2 -2
  106. package/components/mui_extended/Tabs/styles.d.ts +3 -58
  107. package/components/mui_extended/Typography/styles.d.ts +1 -1
  108. package/components/popups/PopupsProvider/{index.8fb6232a.js → index.18669fb4.js} +1 -1
  109. package/components/popups/PopupsViewer/{index.813854e4.js → index.ba354267.js} +5 -10
  110. package/contexts/ModalContext/{index.45c275cd.js → index.cf02e6bd.js} +1 -1
  111. package/contexts/RHFormContext/{index.bf3a2812.js → index.dc955a09.js} +2 -6
  112. package/hooks/useFormAddEdit/{index.9b27ca02.js → index.f156a2cd.js} +4 -8
  113. package/hooks/useModal/index.ef54bcf2.js +66 -0
  114. package/hooks/useTab/{index.f7973779.js → index.bce8b99e.js} +1 -1
  115. package/index.d.ts +0 -1
  116. package/index.js +276 -360
  117. package/package.json +3 -2
  118. package/{react-draggable.79b4c69a.js → react-draggable.5331add7.js} +1 -1
  119. package/{react-resizable.af1f31c1.js → react-resizable.37bfb965.js} +3 -5
  120. package/test/{getNameDataTestId.0faeade8.js → getNameDataTestId.aee44365.js} +2 -2
  121. package/test/index.6d4b98b9.js +4 -0
  122. package/utils/{index.0718eeac.js → index.9ee4c99a.js} +113 -3
  123. package/vendor.a1ce6777.js +6352 -0
  124. package/assets/Logo/index.109a182d.js +0 -38
  125. package/assets/Logo.d.ts +0 -6
  126. package/components/CommonActions/components/ActionCancel/index.46f636e9.js +0 -12
  127. package/components/CommonActions/components/ActionFormCancel/index.2b0bd50d.js +0 -56
  128. package/components/CommonActions/components/ActionFormIntro/index.4f212c39.js +0 -33
  129. package/components/CommonActions/components/ActionIntro/index.7406bd47.js +0 -25
  130. package/components/CommonActions/components/Actions/index.273645af.js +0 -70
  131. package/components/DataGrid/constants.e334cd50.js +0 -10
  132. package/components/DataGrid/formatters/ColumnBooleanFormatter/index.cee6b676.js +0 -26
  133. package/components/DataGrid/formatters/ColumnConcatenatedValueFormatter/index.708f3fb5.js +0 -22
  134. package/components/DataGrid/formatters/ColumnDateFormatter/index.e00d0cf2.js +0 -19
  135. package/components/DataGrid/formatters/ColumnInteractiveCheckFormatter/index.c064bb07.js +0 -23
  136. package/components/DataGrid/formatters/ColumnNestedValueFormatter/index.880e743b.js +0 -14
  137. package/components/DataGrid/formatters/ColumnPointsFormatter/index.226cc583.js +0 -10
  138. package/components/DataGrid/formatters/ColumnPriceFormatter/index.bf9d9e60.js +0 -10
  139. package/components/DataGrid/formatters/ColumnSetCheckFormatter/index.4045b2f2.js +0 -36
  140. package/components/DataGrid/formatters/ColumnUncertaintyFormatter/index.a87302d1.js +0 -10
  141. package/components/DataGrid/formatters/index.2c2f0ae4.js +0 -1
  142. package/components/DataGrid/index.304437ee.js +0 -917
  143. package/components/DataGrid/subcomponents/Actions/index.f14590d2.js +0 -595
  144. package/components/DataGrid/subcomponents/editors/TextEditor/index.3f0d9e28.js +0 -76
  145. package/components/Icon/index.ee7b85c9.js +0 -192
  146. package/components/Image/index.8cc036b1.js +0 -168
  147. package/components/Page/index.c1d4a319.js +0 -114
  148. package/components/animate/variants/index.7a912140.js +0 -1
  149. package/components/areas/components/AreasAdmin/index.f239c717.js +0 -733
  150. package/components/areas/components/AreasViewer/index.61e0538b.js +0 -1071
  151. package/components/areas/components/index.558684b3.js +0 -1
  152. package/components/areas/constants.66529246.js +0 -6
  153. package/components/areas/contexts/index.24025b97.js +0 -1
  154. package/components/areas/dictionary.08cfc4c9.js +0 -36
  155. package/components/areas/hooks/index.d9dc1e21.js +0 -1
  156. package/components/areas/icons.8266ccc8.js +0 -26
  157. package/components/areas/index.4cc6a221.js +0 -22
  158. package/components/commercial/AppBarCommercial/index.9f654f8e.js +0 -28
  159. package/components/commercial/SectionCommercial/index.3df4685b.js +0 -57
  160. package/components/commercial/TopBar/index.7aeb6ec0.js +0 -234
  161. package/components/formatters/BooleanFormatter/index.0c2d8e35.js +0 -44
  162. package/components/formatters/DateFormatter/index.2ef6f261.js +0 -43
  163. package/components/formatters/PointsFormatter/index.d8a4ee54.js +0 -25
  164. package/components/formatters/PriceFormatter/index.97f75b4b.js +0 -35
  165. package/components/formatters/UncertaintyFormatter/index.c3ffdebc.js +0 -29
  166. package/components/formatters/index.b816c6b6.js +0 -117
  167. package/components/hook-form/HelperError/index.c8b046b7.js +0 -19
  168. package/components/hook-form/RHFAutocomplete/index.ea2ac2b1.js +0 -408
  169. package/components/hook-form/RHFAutocompleteAsync/index.98dcf0de.js +0 -158
  170. package/components/hook-form/RHFCheckbox/index.c32278fa.js +0 -142
  171. package/components/hook-form/RHFColorPicker/index.8c939bfd.js +0 -191
  172. package/components/hook-form/RHFDateTime/index.ac27deab.js +0 -190
  173. package/components/hook-form/RHFMultiCheckbox/index.437e6ba3.js +0 -34
  174. package/components/hook-form/RHFPeriod/index.70cfc422.js +0 -104
  175. package/components/hook-form/RHFRadioGroup/index.11c0add8.js +0 -35
  176. package/components/hook-form/RHFSelect/index.c6c60ecc.js +0 -29
  177. package/components/hook-form/RHFTextField/index.fa97889a.js +0 -325
  178. package/components/maps/index.13bb982c.js +0 -7
  179. package/components/mui_extended/Accordion/index.d08a0361.js +0 -142
  180. package/components/mui_extended/Avatar/index.fb9ad158.js +0 -63
  181. package/components/mui_extended/Badge/index.2a3aef2c.js +0 -30
  182. package/components/mui_extended/BoxIcon/index.d61e7ac5.js +0 -22
  183. package/components/mui_extended/Breadcrumbs/index.4a44883c.js +0 -87
  184. package/components/mui_extended/Button/index.5395d101.js +0 -213
  185. package/components/mui_extended/CheckBox.256169f0.js +0 -76
  186. package/components/mui_extended/CircularProgress/index.967e70b7.js +0 -8
  187. package/components/mui_extended/IconButton/index.b0ee4965.js +0 -119
  188. package/components/mui_extended/LinearProgress/index.4092bb69.js +0 -9
  189. package/components/mui_extended/LinkWithRoute/index.288c51f3.js +0 -15
  190. package/components/mui_extended/MenuActions/index.d92ed0d6.js +0 -175
  191. package/components/mui_extended/Popover/index.4e7340b4.js +0 -142
  192. package/components/mui_extended/Stack/index.fe363ca5.js +0 -31
  193. package/components/mui_extended/Tab/index.c5ad86e2.js +0 -134
  194. package/components/mui_extended/ToggleButton/index.7fbc8614.js +0 -18
  195. package/components/mui_extended/ToggleIconButton/index.0cd347b4.js +0 -24
  196. package/components/mui_extended/Tooltip/index.49bb5ee1.js +0 -40
  197. package/components/mui_extended/Typography/index.a1e774a2.js +0 -54
  198. package/components/mui_extended/index.b606cd9d.js +0 -1
  199. package/hooks/useModal/index.30674bb7.js +0 -11
  200. package/style.css +0 -65
  201. package/test/constants_no_mock.86c553a9.js +0 -4
@@ -1,1071 +0,0 @@
1
- import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
- import { generateUtilityClasses, styled, Skeleton, Dialog } from "@mui/material";
3
- import { r as react_resizable_css } from "../../../../react-resizable.af1f31c1.js";
4
- import { unstable_composeClasses } from "@mui/base";
5
- import { g as getComponentUtilityClass } from "../../../../utils/index.0718eeac.js";
6
- import { a as AREAS_VIEWER_CLASS_NAME } from "../../constants.66529246.js";
7
- import { shallow } from "zustand/shallow";
8
- import React__default, { useMemo, useEffect } from "react";
9
- import clsx from "clsx";
10
- import { u as useAreasStore } from "../../hooks/useAreas/index.cedd30ee.js";
11
- import { useModuleDictionary, useEnvironment, useModuleSkeleton } from "@m4l/core";
12
- import { a as MemonizedMenuActions } from "../../../mui_extended/MenuActions/index.d92ed0d6.js";
13
- import { useResponsiveDesktop } from "@m4l/graphics";
14
- import { I as ICONS } from "../../icons.8266ccc8.js";
15
- import { g as getAreasDictionary, D as DICCTIONARY } from "../../dictionary.08cfc4c9.js";
16
- import { I as IconButton } from "../../../mui_extended/IconButton/index.b0ee4965.js";
17
- import { L as LinearProgressIndeterminate } from "../../../LinearProgressIndeterminate/index.2ecd571e.js";
18
- import { I as Icon } from "../../../Icon/index.ee7b85c9.js";
19
- import { T as Typography } from "../../../mui_extended/Typography/index.a1e774a2.js";
20
- import { M as MFLoader } from "../../../MFLoader/index.40c419c0.js";
21
- import { W as WindowToolsMFProvider } from "../../contexts/WindowToolsMFContext/index.992ae7a3.js";
22
- import { D as DynamicMFParmsProvider } from "../../contexts/DynamicMFParmsContext/index.3d9ad0ad.js";
23
- import { L as LinearProgress } from "../../../mui_extended/LinearProgress/index.4092bb69.js";
24
- import { T as TEST_PROP_ID } from "../../../../test/constants_no_mock.86c553a9.js";
25
- import { g as getNameDataTestId } from "../../../../test/getNameDataTestId.0faeade8.js";
26
- import { R as RESPONSIVE_COLAPSED_HEIGHTS, a as RESPONSIVE_ROW_HEIGHTS, M as MARGIN_GRIDLAYOUT, P as PADDING_GRIDLAYOUT } from "../../contexts/AreasContext/index.19c7b906.js";
27
- import { w as withSizeProvider } from "../../../GridLayout/subcomponents/SizeProvider/index.e1d2df80.js";
28
- import { R as Responsive } from "../../../GridLayout/subcomponents/Responsive/index.094c1d09.js";
29
- import { useLocation } from "react-router-dom";
30
- import { L as LoadingError } from "../../../LoadingError/index.7aaba1cf.js";
31
- import { c as cjs } from "../../../../react-draggable.79b4c69a.js";
32
- import { R as ResizeableWindow } from "../../../Resizeable/index.5e8e48b1.js";
33
- const areasViewerClasses = generateUtilityClasses(
34
- AREAS_VIEWER_CLASS_NAME,
35
- [
36
- "root",
37
- "areaRoot",
38
- "areaGridLayoutPanelContainer",
39
- "areaGridLayout",
40
- "areaGridLayoutPopupsContainer",
41
- "areasWindowPopUpList",
42
- "windowRoot",
43
- "windowHeader",
44
- "windowHeaderContent",
45
- "windowHeaderTitle",
46
- "windowHeaderMainActions",
47
- "windowHeaderCancelHandle",
48
- "windowContent",
49
- "windowPopupRoot",
50
- "windowModalRoot",
51
- "windowLinearProgressRoot",
52
- "windowLinearProgressBar",
53
- "windowRootContainer",
54
- "windowToastiesContainer",
55
- "windowToastiesContainerTostys",
56
- "windowToastyContainer",
57
- "windowToastyMeesageButtonsContainer",
58
- "windowToastyMessage",
59
- "windowToastyButtonsContainer",
60
- "windowToastyPin",
61
- "windowToastyClose",
62
- "panelWindowsRoot",
63
- "panelWindowsButtonContainer",
64
- "containerLinearProgress",
65
- "resizeHandle",
66
- "loaderContainer",
67
- "containerComponent",
68
- "selected",
69
- "colapsed",
70
- "selectedWindow",
71
- "isMobile",
72
- "loading",
73
- "pinIn",
74
- "success",
75
- "info",
76
- "warning",
77
- "error"
78
- ],
79
- AREAS_VIEWER_CLASS_NAME
80
- );
81
- const useAreasViewerUtilityClasses = (ownerState) => {
82
- const slots = {
83
- root: [
84
- "root",
85
- ownerState.status,
86
- ownerState.isMobile && "isMobile",
87
- ownerState.isSkeleton && "isSkeleton"
88
- ],
89
- areaRoot: ["areaRoot"],
90
- areasLoadingErrorRoot: ["areasLoadingErrorRoot"],
91
- areasLoadingErrorLoading: ["areasLoadingErrorLoading"],
92
- areasLoadingError: ["areasLoadingError"],
93
- areasLoadingErrorIcon: ["areasLoadingErrorIcon"],
94
- areasLoadingErrorTitle: ["areasLoadingErrorTitle"],
95
- areasLoadingErrorDescription: ["areasLoadingErrorDescription"],
96
- areasLoadingErrorDivider: ["areasLoadingErrorDivider"],
97
- areaGridLayoutPanelContainer: ["areaGridLayoutPanelContainer"],
98
- areaGridLayout: ["areaGridLayout"],
99
- areaGridLayoutPopupsContainer: ["areaGridLayoutPopupsContainer"],
100
- areasWindowPopUpList: ["areasWindowPopUpList"],
101
- windowRoot: ["windowRoot"],
102
- windowRootContainer: ["windowRootContainer"],
103
- windowHeader: ["windowHeader"],
104
- windowHeaderTitle: ["windowHeaderTitle"],
105
- windowHeaderMainActions: ["windowHeaderMainActions"],
106
- windowHeaderCancelHandle: ["windowHeaderCancelHandle"],
107
- windowContent: ["windowContent"],
108
- windowLinearProgressRoot: ["windowLinearProgressRoot"],
109
- windowLinearProgressBar: ["windowLinearProgressBar"],
110
- windowPopupRoot: ["windowPopupRoot"],
111
- windowModalRoot: ["windowModalRoot"],
112
- selectedWindow: ["selectedWindow"],
113
- windowToastiesContainer: ["windowToastiesContainer"],
114
- windowToastiesContainerTostys: ["windowToastiesContainerTostys"],
115
- windowToastyContainer: ["windowToastiesContainer"],
116
- windowToastyMeesageButtonsContainer: ["windowToastyMeesageButtonsContainer"],
117
- windowToastyMessage: ["windowToastyMessage"],
118
- windowToastyButtonsContainer: ["windowToastyButtonsContainer"],
119
- windowToastyPin: ["windowToastyPin"],
120
- windowToastyClose: ["windowToastyClose"],
121
- panelWindowsRoot: ["panelWindowsRoot"],
122
- panelWindowsButtonContainer: ["panelWindowsButtonContainer"],
123
- resizeHandle: ["resizeHandle"],
124
- loaderContainer: ["loaderContainer"],
125
- containerComponent: ["containerComponent"]
126
- };
127
- return unstable_composeClasses(slots, getComponentUtilityClass(AREAS_VIEWER_CLASS_NAME), {});
128
- };
129
- const AreasViewerRoot = styled("div")`
130
- /* display: flex; */
131
- width: 100%;
132
- height: 100%;
133
- overflow: hidden;
134
- /* flex-grow: 1; */
135
- position: relative;
136
-
137
- //areaRoot
138
- & .${areasViewerClasses.areaRoot} {
139
- display: none;
140
- position: absolute;
141
- /* flex-grow: 1; */
142
- flex-direction: row;
143
- inset: 0;
144
- /* width: 100%; */
145
- overflow: hidden;
146
- justify-content: top;
147
- align-items: flex-start;
148
-
149
- visibility: hidden;
150
- }
151
-
152
- & .${areasViewerClasses.areaRoot}.${areasViewerClasses.selected} {
153
- display: block;
154
- visibility: visible;
155
- }
156
-
157
- &.${areasViewerClasses.isMobile} .${areasViewerClasses.areaRoot} {
158
- }
159
-
160
- // areaGridLayoutPanelContainer
161
- & .${areasViewerClasses.areaGridLayoutPanelContainer} {
162
- display: flex;
163
- flex-direction: row;
164
- height: 100%;
165
- width: 100%;
166
- overflow: hidden;
167
- }
168
- &.${areasViewerClasses.isMobile} .${areasViewerClasses.areaGridLayoutPanelContainer} {
169
- flex-direction: column-reverse;
170
- }
171
- // areaGridLayout
172
- & .${areasViewerClasses.areaGridLayout} {
173
- height: 100% !important;
174
- overflow: auto;
175
- flex-grow: 1;
176
- }
177
- &.${areasViewerClasses.isMobile} .${areasViewerClasses.areaGridLayout} {
178
- flex-direction: column-reverse;
179
- height: unset;
180
- width: 100%;
181
- }
182
- // areaGridLayoutPopupsContainer
183
- & .${areasViewerClasses.areaGridLayoutPopupsContainer} {
184
- z-index: 1; //Garantizar q el contenedor de los popus este por encima de los layouts
185
- // // ' .react-draggable': {
186
- // // position: 'absolute',
187
- // // },
188
- }
189
-
190
- // PanelWindowsRoot
191
- & .${areasViewerClasses.panelWindowsRoot} {
192
- display: flex;
193
- flex-direction: column;
194
- position: relative;
195
- }
196
- &.${areasViewerClasses.isMobile} .${areasViewerClasses.panelWindowsRoot} {
197
- flex-direction: row;
198
- }
199
-
200
- // windowRoot
201
- & .${areasViewerClasses.windowRoot} {
202
- inset: 0;
203
- position: absolute;
204
- display: flex;
205
- flex-direction: column;
206
- /* height: 100%; */
207
- /* width: 100%; */
208
- overflow: hidden;
209
- border: 1px solid gray;
210
-
211
- background-color: ${(props) => props.theme.palette.background.default};
212
- padding: ${(props) => props.theme.spacing(0)};
213
- }
214
-
215
- & .${areasViewerClasses.windowRoot}.${areasViewerClasses.selected} {
216
- border-top: 1px solid green;
217
- }
218
- // windowHeaderTitle
219
- & .${areasViewerClasses.windowHeaderTitle} {
220
- width: 100%;
221
- max-width: 100%;
222
- overflow: hidden;
223
- white-space: nowrap;
224
- color: ${(props) => props.theme.palette.text.primary};
225
- text-overflow: ellipsis;
226
- }
227
- // windowHeaderMainActions
228
- & .${areasViewerClasses.windowHeaderMainActions} {
229
- display: flex;
230
-
231
- gap: 4px;
232
- }
233
-
234
- // windowHeaderMainActions
235
- & .${areasViewerClasses.windowContent} {
236
- flex-grow: 1;
237
- position: relative;
238
- }
239
-
240
- // windowModalRoot
241
- & .${areasViewerClasses.windowModalRoot} {
242
- padding: 16px;
243
- }
244
-
245
- ${react_resizable_css}
246
-
247
- ${(props) => props.theme.components?.M4LAreasViewer?.styleOverrides}
248
- `;
249
- function WindowHeaderSkeleton(props) {
250
- const { colapsed } = props;
251
- return /* @__PURE__ */ jsx("div", { className: clsx(areasViewerClasses.windowHeader), children: /* @__PURE__ */ jsxs("div", { className: areasViewerClasses.windowHeaderContent, children: [
252
- /* @__PURE__ */ jsx(
253
- Skeleton,
254
- {
255
- variant: "circular",
256
- sx: { margin: "0 5px", minWidth: "18px", minHeight: "18px" }
257
- }
258
- ),
259
- /* @__PURE__ */ jsx("div", { style: { width: "100%" }, children: /* @__PURE__ */ jsx(Skeleton, { variant: "text", width: 80, height: 16 }) }),
260
- /* @__PURE__ */ jsx("div", { className: areasViewerClasses.windowHeaderCancelHandle, children: !colapsed && /* @__PURE__ */ jsxs(Fragment, { children: [
261
- /* @__PURE__ */ jsx(
262
- Skeleton,
263
- {
264
- variant: "circular",
265
- sx: { margin: "0 5px", minWidth: "16px", minHeight: "16px" }
266
- }
267
- ),
268
- /* @__PURE__ */ jsx(
269
- Skeleton,
270
- {
271
- variant: "circular",
272
- sx: { margin: "0 5px", minWidth: "16px", minHeight: "16px" }
273
- }
274
- ),
275
- /* @__PURE__ */ jsx(
276
- Skeleton,
277
- {
278
- variant: "circular",
279
- sx: { margin: "0 5px", minWidth: "16px", minHeight: "16px" }
280
- }
281
- )
282
- ] }) }),
283
- /* @__PURE__ */ jsx(
284
- Skeleton,
285
- {
286
- variant: "circular",
287
- sx: { margin: "0 5px", minWidth: "16px", minHeight: "16px" }
288
- }
289
- ),
290
- /* @__PURE__ */ jsx(
291
- Skeleton,
292
- {
293
- variant: "circular",
294
- sx: { margin: "0 5px", minWidth: "16px", minHeight: "16px" }
295
- }
296
- )
297
- ] }) });
298
- }
299
- function getMainActions(isDesktop, moduleActions) {
300
- let mainActions = [];
301
- if (isDesktop !== void 0 && isDesktop) {
302
- mainActions = mainActions.concat(moduleActions.filter((action) => action.visibility === "main"));
303
- }
304
- mainActions = mainActions.concat(moduleActions.filter((action) => action.visibility === "allways"));
305
- return mainActions;
306
- }
307
- function getMenuActions(options) {
308
- const {
309
- windowId,
310
- isDesktop,
311
- moduleActions,
312
- urlPrefix,
313
- saveModuleCookies,
314
- resetModuleCookies,
315
- version,
316
- windowOptions = { allowPersistCookies: false },
317
- getLabel
318
- } = options;
319
- let menuActions = [...moduleActions.filter((action) => action.visibility !== "allways")];
320
- if (isDesktop !== void 0 && isDesktop) {
321
- menuActions = menuActions.filter((action) => action.visibility === "normal");
322
- }
323
- if (windowOptions.allowPersistCookies) {
324
- const saveCookiesAction = {
325
- urlIcon: `${urlPrefix}/frontend/components/areas/assets/icons/${ICONS.SAVE_COOKIES}`,
326
- onClick: () => saveModuleCookies(windowId),
327
- disabled: false,
328
- visibility: "normal",
329
- label: getLabel(getAreasDictionary(DICCTIONARY.label_persist_module_cookies)),
330
- key: "save_cookies"
331
- };
332
- menuActions.push(saveCookiesAction);
333
- const resetCookiesAction = {
334
- urlIcon: `${urlPrefix}/frontend/components/areas/assets/icons/${ICONS.RESET_COOKIES}`,
335
- onClick: () => resetModuleCookies(windowId),
336
- disabled: false,
337
- visibility: "normal",
338
- label: getLabel(getAreasDictionary(DICCTIONARY.label_reset_module_cookies)),
339
- key: "reset_cookes"
340
- };
341
- menuActions.push(resetCookiesAction);
342
- }
343
- if (version) {
344
- const versionAction = {
345
- urlIcon: `${urlPrefix}/frontend/components/areas/assets/icons/${ICONS.VERSION}`,
346
- onClick: () => {
347
- },
348
- disabled: true,
349
- visibility: "normal",
350
- label: version,
351
- key: "version"
352
- };
353
- menuActions.push(versionAction);
354
- }
355
- return menuActions;
356
- }
357
- function MainActions(props) {
358
- const { windowId } = props;
359
- const moduleActions = useAreasStore((state) => {
360
- const window = state.hashWindows[windowId];
361
- return window?.moduleActions || [];
362
- }, shallow);
363
- const { getLabel } = useModuleDictionary();
364
- const isDesktop = useResponsiveDesktop();
365
- const mainActions = useMemo(() => {
366
- return getMainActions(isDesktop, moduleActions);
367
- }, [moduleActions, isDesktop]);
368
- return /* @__PURE__ */ jsx("div", { className: areasViewerClasses.windowHeaderMainActions, children: mainActions.map((mainAction) => {
369
- const tooltip = mainAction.label !== void 0 ? mainAction.label : getLabel(mainAction.dictionaryId || "");
370
- const onClick = (e) => {
371
- mainAction.onClick(e);
372
- e.stopPropagation();
373
- };
374
- return /* @__PURE__ */ jsx(
375
- IconButton,
376
- {
377
- src: mainAction.urlIcon || "",
378
- className: clsx(mainAction.className, "m4l_draggableCancel"),
379
- onClick,
380
- "aria-label": mainAction.label,
381
- disabled: mainAction.disabled,
382
- tooltip
383
- },
384
- mainAction.key
385
- );
386
- }) });
387
- }
388
- function Header(props) {
389
- const { areaId, windowId, emergeType } = props;
390
- const [url_icon, title, moduleActions, onClose, version, windowOptions, fnQueryClose] = useAreasStore((state) => {
391
- const window = state.hashWindows[windowId];
392
- return [
393
- window.url_icon,
394
- window.title,
395
- window.moduleActions,
396
- window.onClose,
397
- window.version,
398
- window.windowOptions,
399
- window.fnQueryClose
400
- ];
401
- }, shallow);
402
- const { saveModuleCookies, resetModuleCookies } = useAreasStore(
403
- (state) => state.windowActions,
404
- shallow
405
- );
406
- const maximizedId = useAreasStore((state) => state.hashAreas[areaId].maximizedId, shallow);
407
- const colapsed = useAreasStore((state) => {
408
- const currentBreakpoint = state.hashAreas[areaId].currentBreakpoint;
409
- if (currentBreakpoint) {
410
- return state.hashAreas[areaId].layouts[currentBreakpoint].find((li) => li.i === windowId)?.colapsed;
411
- }
412
- return false;
413
- }, shallow);
414
- const { maximizeLayout, normalizeLayouts, colapseLayoutItem, unColapseLayoutItem } = useAreasStore((state) => state.areaActions, shallow);
415
- const { host_static_assets, environment_assets } = useEnvironment();
416
- const isDesktop = useResponsiveDesktop();
417
- const isSkeleton = useModuleSkeleton();
418
- const { getLabel } = useModuleDictionary();
419
- const urlPrefix = `${host_static_assets}/${environment_assets}`;
420
- const menuActions = useMemo(() => {
421
- return getMenuActions({
422
- windowId,
423
- isDesktop,
424
- moduleActions,
425
- urlPrefix,
426
- saveModuleCookies,
427
- resetModuleCookies,
428
- version,
429
- windowOptions,
430
- getLabel
431
- });
432
- }, [moduleActions, isDesktop]);
433
- const onCloseLocal = () => {
434
- const fnClose = fnQueryClose || onClose;
435
- fnClose && fnClose(windowId);
436
- };
437
- const maxNormalize = (e) => {
438
- if (maximizedId === windowId) {
439
- normalizeLayouts(areaId);
440
- } else {
441
- maximizeLayout(areaId, windowId);
442
- }
443
- e.stopPropagation();
444
- };
445
- const colapedToggle = (e) => {
446
- if (!colapsed) {
447
- colapseLayoutItem(areaId, windowId);
448
- } else {
449
- unColapseLayoutItem(areaId, windowId);
450
- }
451
- e.stopPropagation();
452
- };
453
- if (isSkeleton) {
454
- return /* @__PURE__ */ jsx(WindowHeaderSkeleton, {});
455
- }
456
- return /* @__PURE__ */ jsxs("div", { className: clsx(areasViewerClasses.windowHeader, "m4l_draggable_handle"), children: [
457
- /* @__PURE__ */ jsx(LinearProgressIndeterminate, {}),
458
- /* @__PURE__ */ jsxs("div", { className: areasViewerClasses.windowHeaderContent, children: [
459
- /* @__PURE__ */ jsx(Icon, { src: url_icon, size: "medium" }),
460
- /* @__PURE__ */ jsx(Typography, { className: areasViewerClasses.windowHeaderTitle, variant: "h5", children: `${title}` }),
461
- /* @__PURE__ */ jsxs("div", { className: areasViewerClasses.windowHeaderCancelHandle, children: [
462
- !colapsed && /* @__PURE__ */ jsx(MainActions, { windowId }),
463
- !colapsed && menuActions.length > 0 && /* @__PURE__ */ jsx(
464
- MemonizedMenuActions,
465
- {
466
- arrowType: "no-arrow",
467
- marginTop: "12px!important",
468
- marginLeft: "14px!important",
469
- anchorOrigin: { vertical: "bottom", horizontal: "right" },
470
- transformOrigin: { vertical: "top", horizontal: "right" },
471
- menuActions,
472
- toolTip: getLabel(getAreasDictionary(DICCTIONARY.label_module_actions))
473
- }
474
- ),
475
- !colapsed && (emergeType === "layout" || emergeType === "popup") && /* @__PURE__ */ jsx(
476
- IconButton,
477
- {
478
- className: "m4l_draggableCancel",
479
- onClick: maxNormalize,
480
- "aria-label": "click",
481
- src: maximizedId === windowId ? `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.NORMALIZE}` : `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.MAXIMIZE}`,
482
- tooltip: getLabel(
483
- getAreasDictionary(
484
- maximizedId === windowId ? DICCTIONARY.label_minimize_window : DICCTIONARY.label_maximize_window
485
- )
486
- )
487
- }
488
- ),
489
- !maximizedId && (emergeType === "layout" || emergeType === "popup") && /* @__PURE__ */ jsx(
490
- IconButton,
491
- {
492
- className: "m4l_draggableCancel",
493
- onClick: colapedToggle,
494
- "aria-label": "click",
495
- src: !colapsed ? `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.COLAPSE}` : `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.UNCOLPASE}`,
496
- tooltip: getLabel(
497
- getAreasDictionary(
498
- !colapsed ? DICCTIONARY.label_collapse_window : DICCTIONARY.label_uncollapse_window
499
- )
500
- )
501
- }
502
- ),
503
- onClose && /* @__PURE__ */ jsx(
504
- IconButton,
505
- {
506
- className: "m4l_draggableCancel",
507
- onPointerDown: onCloseLocal,
508
- "aria-label": "click",
509
- src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.CLOSE}`,
510
- tooltip: getLabel(getAreasDictionary(DICCTIONARY.label_close_window))
511
- }
512
- )
513
- ] })
514
- ] })
515
- ] });
516
- }
517
- const MicroFrontend = (props) => {
518
- return /* @__PURE__ */ jsx(MFLoader, { ...props });
519
- };
520
- const MemonizedMicroFrontend = React__default.memo(MicroFrontend);
521
- const Component = (props) => {
522
- const { component, dynamicMFStore, windowTools } = props;
523
- return /* @__PURE__ */ jsx(WindowToolsMFProvider, { ...windowTools, children: /* @__PURE__ */ jsx(DynamicMFParmsProvider, { store: dynamicMFStore, children: /* @__PURE__ */ jsx("div", { className: areasViewerClasses.containerComponent, children: typeof component === "function" ? component({ windowTools, dynamicMFStore }) : component }) }) });
524
- };
525
- React__default.memo(Component);
526
- const WindowRoot = styled("div")`
527
- inset: 0;
528
- position: absolute;
529
- display: flex;
530
- flex-direction: column;
531
- /* height: 100%; */
532
- /* width: 100%; */
533
- overflow: hidden;
534
- border: 1px solid gray;
535
-
536
- background-color: ${(props) => props.theme.palette.background.default};
537
- padding: ${(props) => props.theme.spacing(0)};
538
- &.${areasViewerClasses.selected} {
539
- border-top: 1px solid green;
540
- }
541
-
542
- // windowHeader
543
- /*
544
- &.${areasViewerClasses.loading} .${areasViewerClasses.windowHeader} {
545
- border-bottom: 2px solid red !important;
546
- }
547
- */
548
- // windowHeaderTitle
549
- & .${areasViewerClasses.windowHeaderTitle} {
550
- width: 100%;
551
- max-width: 100%;
552
- overflow: hidden;
553
- white-space: nowrap;
554
- color: ${(props) => props.theme.palette.text.primary};
555
- text-overflow: ellipsis;
556
- }
557
-
558
- & .${areasViewerClasses.windowHeaderCancelHandle} {
559
- display: flex;
560
- cursor: default;
561
- }
562
-
563
- // windowHeaderMainActions
564
- & .${areasViewerClasses.windowHeaderMainActions} {
565
- display: flex;
566
-
567
- gap: 4px;
568
- }
569
-
570
- // windowHeaderMainActions
571
- & .${areasViewerClasses.windowContent} {
572
- flex-grow: 1;
573
- position: relative;
574
- }
575
-
576
- & .${areasViewerClasses.windowContent}.${areasViewerClasses.colapsed} {
577
- display: none !important;
578
- }
579
- // windowModalRoot
580
- & .${areasViewerClasses.windowModalRoot} {
581
- padding: 16px;
582
- }
583
-
584
- // windowToastiesContainer
585
- & .${areasViewerClasses.windowToastiesContainer} {
586
- padding: 4px;
587
- }
588
-
589
- // windowToastyContainer
590
- & .${areasViewerClasses.windowToastyContainer} {
591
- display: flex;
592
- flex-direction: column;
593
- }
594
- // windowToastyContainer
595
- & .${areasViewerClasses.windowToastyContainer}.${areasViewerClasses.success} {
596
- background-color: ${(props) => props.theme.palette.success.main};
597
- }
598
-
599
- // windowToastyMeesageButtonsContainer
600
- & .${areasViewerClasses.windowToastyMeesageButtonsContainer} {
601
- display: flex;
602
- }
603
- & .MuiLinearProgress-root {
604
- width: 100%;
605
- }
606
-
607
- // windowToastyMessage
608
- & .${areasViewerClasses.windowToastyMessage} {
609
- flex-grow: 1;
610
- }
611
-
612
- // windowToastyContainer
613
- & .${areasViewerClasses.windowToastyPin}.${areasViewerClasses.pinIn} {
614
- border: 1px solid red;
615
- }
616
-
617
- ${(props) => props.theme.components?.M4LAreasViewerWindow?.styleOverrides}
618
- `;
619
- function Toasty(props) {
620
- const { windowId, toastyId } = props;
621
- const toasty = useAreasStore(
622
- (state) => state.hashWindows[windowId].hashToasties[toastyId],
623
- shallow
624
- );
625
- const { pinToast: pinToasty, closeToast: closeToasty } = useAreasStore(
626
- (state) => state.windowActions,
627
- shallow
628
- );
629
- const { host_static_assets, environment_assets } = useEnvironment();
630
- return /* @__PURE__ */ jsx(
631
- "div",
632
- {
633
- className: clsx(areasViewerClasses.windowToastyContainer, areasViewerClasses[toasty.type]),
634
- children: /* @__PURE__ */ jsxs("div", { className: areasViewerClasses.windowToastyMeesageButtonsContainer, children: [
635
- /* @__PURE__ */ jsxs("div", { className: areasViewerClasses.windowToastyMessage, children: [
636
- toasty.timer ? /* @__PURE__ */ jsx(LinearProgress, { variant: "determinate", value: toasty.percentExecuted }) : null,
637
- toasty.message
638
- ] }),
639
- /* @__PURE__ */ jsxs("div", { className: areasViewerClasses.windowToastyButtonsContainer, children: [
640
- /* @__PURE__ */ jsx(
641
- IconButton,
642
- {
643
- className: clsx(
644
- areasViewerClasses.windowToastyPin,
645
- toasty.timer ? null : areasViewerClasses.pinIn
646
- ),
647
- onClick: () => {
648
- pinToasty(windowId, toastyId);
649
- },
650
- src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.TOASTY_PIN}`
651
- }
652
- ),
653
- /* @__PURE__ */ jsx(
654
- IconButton,
655
- {
656
- className: areasViewerClasses.windowToastyClose,
657
- onClick: () => {
658
- closeToasty(windowId, toastyId);
659
- },
660
- src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.TOASTY_CLOSE}`
661
- }
662
- )
663
- ] })
664
- ] })
665
- }
666
- );
667
- }
668
- function Toasties(props) {
669
- const { windowId } = props;
670
- const tosties = useAreasStore((state) => state.hashWindows[windowId].toasties, shallow);
671
- if (tosties.length === 0) {
672
- return null;
673
- }
674
- return /* @__PURE__ */ jsx("div", { className: areasViewerClasses.windowToastiesContainer, children: /* @__PURE__ */ jsx("div", { className: areasViewerClasses.windowToastiesContainerTostys, children: tosties.map((t) => {
675
- return /* @__PURE__ */ jsx(Toasty, { windowId, toastyId: t.id }, t.id);
676
- }) }) });
677
- }
678
- const Window = (props) => {
679
- const { areaId, windowId } = props;
680
- const [emergeType, moduleId, winType] = useAreasStore((state) => {
681
- return [
682
- state.hashWindows[windowId]?.emergeType,
683
- state.hashWindows[windowId]?.moduleId,
684
- state.hashWindows[windowId]?.winType
685
- ];
686
- }, shallow);
687
- const selected = useAreasStore((state) => {
688
- return emergeType === "layout" ? state.hashAreas[areaId]?.currentLayoutId : state.hashAreas[areaId]?.currentPopUpId;
689
- }) === windowId;
690
- const mfProps = useAreasStore((state) => state.hashWindows[windowId]?.mfProps, shallow);
691
- const component = useAreasStore(
692
- (state) => state.hashWindows[windowId]?.component,
693
- shallow
694
- );
695
- const loading = useAreasStore((state) => state.hashWindows[windowId]?.loading, shallow);
696
- const status = useAreasStore((state) => state.hashWindows[windowId]?.status, shallow);
697
- const dynamicMFStore = useAreasStore(
698
- (state) => state.hashWindows[windowId]?.dynamicMFStore,
699
- shallow
700
- );
701
- const {
702
- setActions,
703
- getCookie,
704
- getCookies,
705
- setCookie,
706
- close,
707
- startProgress,
708
- stopProgress,
709
- toast,
710
- setFnQueryClose
711
- } = useAreasStore((state) => state.windowActions, shallow);
712
- const { selectLayout } = useAreasStore((state) => state.areaActions, shallow);
713
- const { loadCookiesFromApi } = useAreasStore((state) => state.windowActions, shallow);
714
- const onTouch = () => {
715
- if (!selected) {
716
- selectLayout(areaId, props.windowId);
717
- }
718
- };
719
- const windowTools = useMemo(
720
- () => ({
721
- getWindowId: () => windowId,
722
- setActions: (newActions, version) => {
723
- setActions(windowId, newActions, version);
724
- },
725
- getCookie: (id) => getCookie(windowId, id),
726
- getCookies: (type) => getCookies(windowId, type),
727
- setCookie: (id, type, cookie) => {
728
- setCookie(windowId, id, type, cookie);
729
- },
730
- close: () => close(windowId),
731
- startProgress: () => startProgress(windowId),
732
- stopProgress: () => stopProgress(windowId),
733
- setFnQueryClose: (fnQueryClose) => {
734
- setFnQueryClose(windowId, fnQueryClose);
735
- },
736
- toast: (toastyOptions) => {
737
- toast(windowId, toastyOptions);
738
- }
739
- }),
740
- []
741
- );
742
- useEffect(() => {
743
- if (status === "init") {
744
- loadCookiesFromApi(windowId);
745
- }
746
- }, [status]);
747
- if (status === void 0) {
748
- return null;
749
- }
750
- return /* @__PURE__ */ jsx(
751
- WindowRoot,
752
- {
753
- role: "presentation",
754
- className: clsx(
755
- areasViewerClasses.windowRoot,
756
- selected ? areasViewerClasses.selectedWindow : null,
757
- loading ? areasViewerClasses.loading : null,
758
- emergeType === "popup" ? areasViewerClasses.windowPopupRoot : null,
759
- emergeType === "modal" ? areasViewerClasses.windowModalRoot : null
760
- ),
761
- onMouseDown: onTouch,
762
- ...process.env.NODE_ENV !== "production" ? {
763
- [TEST_PROP_ID]: getNameDataTestId(
764
- AREAS_VIEWER_CLASS_NAME,
765
- "windowRoot",
766
- `${emergeType}`
767
- )
768
- } : {},
769
- children: /* @__PURE__ */ jsxs("div", { className: areasViewerClasses.windowRootContainer, children: [
770
- /* @__PURE__ */ jsx(Header, { areaId, windowId, emergeType }),
771
- /* @__PURE__ */ jsx(Toasties, { windowId }),
772
- /* @__PURE__ */ jsxs(
773
- "div",
774
- {
775
- className: clsx(
776
- areasViewerClasses.windowContent
777
- ),
778
- children: [
779
- status === "init" ? /* @__PURE__ */ jsx(Fragment, { children: "Cargando..." }) : null,
780
- status === "loaded" ? winType === "microfrontend" ? /* @__PURE__ */ jsx(
781
- MemonizedMicroFrontend,
782
- {
783
- moduleId,
784
- dynamicMFStore,
785
- windowTools,
786
- ...mfProps
787
- }
788
- ) : /* @__PURE__ */ jsx(
789
- Component,
790
- {
791
- moduleId,
792
- dynamicMFStore,
793
- windowTools,
794
- component
795
- }
796
- ) : null
797
- ]
798
- }
799
- )
800
- ] })
801
- }
802
- );
803
- };
804
- React__default.memo(Window);
805
- const ResizeHandle = React__default.forwardRef(
806
- (props, ref) => {
807
- const { handleAxis, ...restProps } = props;
808
- return /* @__PURE__ */ jsx(
809
- "div",
810
- {
811
- ref,
812
- className: clsx(
813
- `react-resizable-handle react-resizable-handle-${handleAxis}`,
814
- areasViewerClasses.resizeHandle
815
- ),
816
- ...restProps
817
- }
818
- );
819
- }
820
- );
821
- const ResponsiveGridLayout = withSizeProvider(Responsive);
822
- const AreaGridLayout = (props) => {
823
- const { areaId } = props;
824
- const hashLayoutItems = useAreasStore((state) => state.hashAreas[areaId].layoutItemsIds, shallow);
825
- const layouts = useAreasStore((state) => state.hashAreas[areaId].layouts, shallow);
826
- const breakpoints = useAreasStore((state) => state.hashAreas[areaId].breakpoints, shallow);
827
- const maximizedId = useAreasStore((state) => state.hashAreas[areaId].maximizedId, shallow);
828
- const cols = useAreasStore((state) => state.hashAreas[areaId].cols, shallow);
829
- const { onBreakpointsLayoutsChange, onContainerChange } = useAreasStore(
830
- (state) => state.areaActions,
831
- shallow
832
- );
833
- return /* @__PURE__ */ jsx(
834
- ResponsiveGridLayout,
835
- {
836
- autoSize: false,
837
- compactType: "vertical",
838
- measureBeforeMount: true,
839
- resizeHandles: ["nw", "se"],
840
- className: clsx(
841
- areasViewerClasses.areaGridLayout,
842
- `${areasViewerClasses.areaGridLayout}-${areaId}`
843
- ),
844
- layouts,
845
- onLayoutChange: (layout, newLayouts) => onBreakpointsLayoutsChange(areaId, layout, newLayouts),
846
- draggableHandle: ".m4l_draggable_handle",
847
- draggableCancel: `.${areasViewerClasses.windowHeaderCancelHandle}`,
848
- layoutItemRender: (p) => {
849
- if (hashLayoutItems.indexOf(p.i) === -1) {
850
- return /* @__PURE__ */ jsx(Fragment, {});
851
- }
852
- if (p.type === "placeholder") {
853
- return /* @__PURE__ */ jsx("div", {});
854
- }
855
- return /* @__PURE__ */ jsx(Window, { windowId: p.i, areaId });
856
- },
857
- breakpoints,
858
- colapsedHeight: RESPONSIVE_COLAPSED_HEIGHTS,
859
- rowHeight: RESPONSIVE_ROW_HEIGHTS,
860
- cols,
861
- containerMargin: [MARGIN_GRIDLAYOUT, MARGIN_GRIDLAYOUT],
862
- containerPadding: [PADDING_GRIDLAYOUT, PADDING_GRIDLAYOUT],
863
- onContainerChange: (e) => {
864
- onContainerChange(areaId, e);
865
- },
866
- preventCollision: false,
867
- maximizeId: maximizedId,
868
- resizeHandle: /* @__PURE__ */ jsx(ResizeHandle, {})
869
- }
870
- );
871
- };
872
- const PanelWindows = (props) => {
873
- const { areaId } = props;
874
- const status = useAreasStore((state) => state.hashAreas[areaId].status);
875
- const maximizedId = useAreasStore((state) => state.hashAreas[areaId].maximizedId);
876
- const maximizedIdParent = useAreasStore(
877
- (state) => state.hashWindows[maximizedId || ""]?.parentLayoutId || void 0
878
- );
879
- const hashLayoutItems = useAreasStore(
880
- (state) => state.hashAreas[areaId].layoutItemsIds.filter((itemId) => state.hashWindows[itemId].emergeType === "layout").map((key) => ({
881
- i: key,
882
- url_icon: state.hashWindows[key].url_icon,
883
- title: state.hashWindows[key].title,
884
- moduleId: state.hashWindows[key].moduleId,
885
- emergeType: state.hashWindows[key].emergeType,
886
- windowId: state.hashWindows[key].windowId
887
- })),
888
- shallow
889
- );
890
- const { maximizeLayout } = useAreasStore((state) => state.areaActions);
891
- const onTouched = (layoutId) => {
892
- maximizeLayout(areaId, layoutId);
893
- };
894
- const location = useLocation();
895
- const searchParams = new URLSearchParams(location.search);
896
- const currentParam = searchParams.get("module");
897
- if (status === "loaded") {
898
- if (!maximizedId || hashLayoutItems.length < 2) {
899
- return null;
900
- }
901
- return /* @__PURE__ */ jsx("div", { className: areasViewerClasses.panelWindowsRoot, children: hashLayoutItems.map((kl) => {
902
- return /* @__PURE__ */ jsx(
903
- "div",
904
- {
905
- className: clsx(
906
- areasViewerClasses.panelWindowsButtonContainer,
907
- maximizedId === kl.i && kl.emergeType !== "popup" || maximizedIdParent === kl.windowId && kl.moduleId === currentParam ? areasViewerClasses.selected : null
908
- ),
909
- children: /* @__PURE__ */ jsx(
910
- IconButton,
911
- {
912
- src: kl.url_icon,
913
- size: "small",
914
- onClick: () => onTouched(kl.i),
915
- tooltip: maximizedId !== kl.i ? kl.title : void 0
916
- }
917
- )
918
- },
919
- kl.i
920
- );
921
- }) });
922
- } else {
923
- return null;
924
- }
925
- };
926
- const InnerForHooks = (props) => {
927
- const { areaId } = props;
928
- const isDesktop = useResponsiveDesktop();
929
- const status = useAreasStore((state) => state.hashAreas[areaId].status);
930
- return /* @__PURE__ */ jsxs(
931
- "div",
932
- {
933
- className: clsx(
934
- areasViewerClasses.areaGridLayoutPanelContainer,
935
- `${areasViewerClasses.areaGridLayoutPanelContainer}-${areaId}`
936
- ),
937
- children: [
938
- status === "loaded" ? /* @__PURE__ */ jsx(AreaGridLayout, { areaId }) : /* @__PURE__ */ jsx(LoadingError, { status, action: () => {
939
- } }),
940
- isDesktop ? /* @__PURE__ */ jsx(PanelWindows, { areaId }) : null
941
- ]
942
- }
943
- );
944
- };
945
- const Area = (props) => {
946
- const { selected, areaId } = props;
947
- const classesAreaRoot = useAreasStore((state) => state.viwerClasses.areaRoot);
948
- const status = useAreasStore((state) => state.hashAreas[areaId].status);
949
- if (status === "init") {
950
- return null;
951
- }
952
- return /* @__PURE__ */ jsx(
953
- "div",
954
- {
955
- className: clsx(
956
- classesAreaRoot,
957
- selected ? areasViewerClasses.selected : null,
958
- status === "loading" ? areasViewerClasses.loading : null
959
- ),
960
- children: /* @__PURE__ */ jsx(InnerForHooks, { areaId })
961
- }
962
- );
963
- };
964
- Area.displayName = "Area";
965
- styled("div")(({ theme }) => ({
966
- display: "flex",
967
- flexDirection: "column",
968
- height: "100%",
969
- overflow: "hidden",
970
- padding: theme.spacing(3)
971
- }));
972
- const WrapperWindowModal = styled(Dialog)(({ theme }) => ({
973
- hola: 1,
974
- backgroundColor: theme.palette.background.paper,
975
- "& .MuiDialog-container": {},
976
- "&.m4l_selected": {
977
- borderTop: "1px solid green"
978
- },
979
- ...theme.components?.M4LAreasViewerModal?.styleOverrides
980
- }));
981
- const WindowModal = (props) => {
982
- const { windowId } = props;
983
- const { onClose } = useAreasStore((state) => state.hashWindowsModals[windowId]);
984
- const { host_static_assets, environment_assets } = useEnvironment();
985
- const isDesktop = useResponsiveDesktop();
986
- const DragabblePaperComponent = (_props) => {
987
- return /* @__PURE__ */ jsx(
988
- cjs.exports,
989
- {
990
- handle: ".m4l_draggable_handle",
991
- bounds: "parent",
992
- children: /* @__PURE__ */ jsx(
993
- ResizeableWindow,
994
- {
995
- width: props.windowProps?.width || 400,
996
- height: props.windowProps?.height || 300,
997
- handle: (resizeHandle, ref) => /* @__PURE__ */ jsx("div", { ref, children: /* @__PURE__ */ jsx(
998
- Icon,
999
- {
1000
- src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.RESIZE}`,
1001
- className: `custom-handle custom-handle-${resizeHandle}`
1002
- }
1003
- ) }, resizeHandle),
1004
- children: /* @__PURE__ */ jsx(Window, { ...props })
1005
- }
1006
- )
1007
- }
1008
- );
1009
- };
1010
- function PaperComponent(_props) {
1011
- return /* @__PURE__ */ jsx(Window, { ...props });
1012
- }
1013
- return /* @__PURE__ */ jsx(
1014
- WrapperWindowModal,
1015
- {
1016
- className: areasViewerClasses.windowModalRoot,
1017
- open: true,
1018
- scroll: "paper",
1019
- onKeyDown: (event) => {
1020
- if (event.key === "Escape") {
1021
- onClose && onClose(windowId);
1022
- }
1023
- },
1024
- "aria-labelledby": "child-modal-title",
1025
- "aria-describedby": "child-modal-description",
1026
- PaperComponent: isDesktop ? DragabblePaperComponent : PaperComponent,
1027
- maxWidth: false,
1028
- fullWidth: !isDesktop,
1029
- fullScreen: false,
1030
- disableEnforceFocus: true
1031
- }
1032
- );
1033
- };
1034
- const MemonizedWindowModal = React__default.memo(WindowModal);
1035
- function AreasViewer() {
1036
- const areas = useAreasStore((state) => state.areasIds, shallow);
1037
- const windowsModals = useAreasStore((state) => state.windowsModals);
1038
- const hashWindowsModals = useAreasStore((state) => state.hashWindowsModals);
1039
- const currentArea = useAreasStore((state) => state.currentAreaId);
1040
- const status = useAreasStore((state) => state.ownerState.status);
1041
- const classesRoot = useAreasStore((state) => state.viwerClasses.root);
1042
- const { init } = useAreasStore((state) => state.areasActions);
1043
- return /* @__PURE__ */ jsxs(Fragment, { children: [
1044
- /* @__PURE__ */ jsx(
1045
- AreasViewerRoot,
1046
- {
1047
- className: classesRoot,
1048
- ...process.env.NODE_ENV !== "production" ? {
1049
- [TEST_PROP_ID]: getNameDataTestId(
1050
- AREAS_VIEWER_CLASS_NAME,
1051
- "root",
1052
- ""
1053
- )
1054
- } : {},
1055
- children: status === "loaded" ? areas.map((area) => {
1056
- return /* @__PURE__ */ jsx(Area, { areaId: area, selected: currentArea === area }, area);
1057
- }) : /* @__PURE__ */ jsx(LoadingError, { status, action: () => init() })
1058
- }
1059
- ),
1060
- windowsModals.map((wm) => {
1061
- if (hashWindowsModals[wm]) {
1062
- return /* @__PURE__ */ jsx(MemonizedWindowModal, { ...hashWindowsModals[wm] }, wm);
1063
- }
1064
- return null;
1065
- })
1066
- ] });
1067
- }
1068
- export {
1069
- AreasViewer as A,
1070
- useAreasViewerUtilityClasses as u
1071
- };