@m4l/components 3.1.7 → 3.1.8

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/index.js +183 -340
  2. package/node_modules-CQtkw0uG.js +7350 -0
  3. package/package.json +1 -1
  4. package/vendor-AfIOyqRr.js +24636 -0
  5. package/components/AccountPopover/index-Dm2-k-Mv.js +0 -334
  6. package/components/AppBar/index-i0rhG3J1.js +0 -93
  7. package/components/BaseModule/index-CiNNlxzS.js +0 -30
  8. package/components/CommonActions/components/ActionCancel/index-CIdpDXkr.js +0 -12
  9. package/components/CommonActions/components/ActionFormCancel/index-CpyASN3q.js +0 -56
  10. package/components/CommonActions/components/ActionFormIntro/index-7KKtcUra.js +0 -33
  11. package/components/CommonActions/components/ActionIntro/index-CqqDZZcG.js +0 -25
  12. package/components/CommonActions/components/Actions/index-CuG1pnXW.js +0 -70
  13. package/components/DataGrid/constants-8L7QgBKi.js +0 -10
  14. package/components/DataGrid/formatters/ColumnBooleanFormatter/index-CveSCbq_.js +0 -26
  15. package/components/DataGrid/formatters/ColumnConcatenatedValueFormatter/index-CHqvieM2.js +0 -22
  16. package/components/DataGrid/formatters/ColumnDateFormatter/index-CKg8CJ6A.js +0 -19
  17. package/components/DataGrid/formatters/ColumnInteractiveCheckFormatter/index-DE6bwaKP.js +0 -23
  18. package/components/DataGrid/formatters/ColumnNestedValueFormatter/index-BslXGK-A.js +0 -14
  19. package/components/DataGrid/formatters/ColumnPointsFormatter/index-BXGW2CsK.js +0 -10
  20. package/components/DataGrid/formatters/ColumnPriceFormatter/index-O11tBykn.js +0 -10
  21. package/components/DataGrid/formatters/ColumnSetCheckFormatter/index-BaCawLr1.js +0 -36
  22. package/components/DataGrid/formatters/ColumnUncertaintyFormatter/index-Cq7a-jnE.js +0 -10
  23. package/components/DataGrid/formatters/index-CrZXPa0e.js +0 -13
  24. package/components/DataGrid/index-BZ-lbmuU.js +0 -908
  25. package/components/DataGrid/subcomponents/Actions/index-CHvPZ4Ru.js +0 -549
  26. package/components/DataGrid/subcomponents/editors/TextEditor/index-BIFm8akr.js +0 -80
  27. package/components/DragResizeWindow/index-D2jLYExo.js +0 -505
  28. package/components/DynamicFilter/constants-ByqmFATV.js +0 -31
  29. package/components/DynamicFilter/dictionary-PrbXU3VZ.js +0 -51
  30. package/components/DynamicFilter/index-DZiJc9h7.js +0 -116
  31. package/components/DynamicFilter/slots/SlotsEnum-cawFeNzx.js +0 -34
  32. package/components/DynamicFilter/slots/dynamicFilterSlots-DHxelhXP.js +0 -151
  33. package/components/DynamicFilter/slots/index-l0sNRNKZ.js +0 -1
  34. package/components/DynamicFilter/store/index-BT-eWVnJ.js +0 -254
  35. package/components/DynamicFilter/subcomponents/AppliedFilterChip/index-B32bAzi-.js +0 -60
  36. package/components/DynamicFilter/subcomponents/AppliedFilters/index-Bha19drV.js +0 -26
  37. package/components/DynamicFilter/subcomponents/DynamicFilterBase/index-BmvzoHit.js +0 -40
  38. package/components/DynamicFilter/subcomponents/FieldTypes/BooleanFilter/index-BcO3SlP5.js +0 -129
  39. package/components/DynamicFilter/subcomponents/FieldTypes/DateTimeFilter/index-BCJhpNS8.js +0 -171
  40. package/components/DynamicFilter/subcomponents/FieldTypes/NumberFilter/index-DCNhz68u.js +0 -153
  41. package/components/DynamicFilter/subcomponents/FieldTypes/SelectFilter/index-BdypjM1Y.js +0 -146
  42. package/components/DynamicFilter/subcomponents/FieldTypes/StringFilter/index-D-NFIVnK.js +0 -114
  43. package/components/DynamicFilter/subcomponents/FieldTypes/index-BwQHJqk9.js +0 -38
  44. package/components/DynamicFilter/subcomponents/FilterActions/index-B9UWmk07.js +0 -88
  45. package/components/DynamicFilter/subcomponents/InputFilter/index-CfGb1TfV.js +0 -188
  46. package/components/DynamicFilter/subcomponents/PopoverFilter/index-DkfRGrlO.js +0 -158
  47. package/components/DynamicFilter/subcomponents/PopoverMenuFields/index-DSegwAm2.js +0 -63
  48. package/components/FieldLabel/index-CI57EizR.js +0 -54
  49. package/components/GridLayout/index-C4HyxNYX.js +0 -1044
  50. package/components/GridLayout/subcomponents/Griditem/index-C7jT4s8t.js +0 -395
  51. package/components/GridLayout/subcomponents/Responsive/index-BKcU2OnF.js +0 -348
  52. package/components/GridLayout/subcomponents/SizeProvider/index-1aJ-e_54.js +0 -71
  53. package/components/HelperText/index-Crn_XIPF.js +0 -50
  54. package/components/Icon/index-C89MAkeH.js +0 -176
  55. package/components/Image/index-COp8vP0X.js +0 -175
  56. package/components/LanguagePopover/index-BA2Igs9L.js +0 -179
  57. package/components/LinearProgressIndeterminate/index-BwI756Mb.js +0 -55
  58. package/components/Loadable/index-BMbi9ISF.js +0 -9
  59. package/components/LoadingError/index-Cf0oGUrL.js +0 -89
  60. package/components/MFIsolationApp/index-V4R55hNU.js +0 -169
  61. package/components/MFLoader/index-BI8vQZSH.js +0 -299
  62. package/components/ModalDialog/index-CEVQBQ7W.js +0 -77
  63. package/components/NavLink/index-D1S_vtFO.js +0 -55
  64. package/components/NoItemSelected/index-B9oM26AX.js +0 -54
  65. package/components/ObjectLogs/index-CiXOJpS4.js +0 -233
  66. package/components/PDFViewer/index-GVN2rfd6.js +0 -51
  67. package/components/Page/index-DZMkYmr4.js +0 -117
  68. package/components/PaperForm/index-DwgAfjci.js +0 -59
  69. package/components/Period/index-2pJG3VmY.js +0 -238
  70. package/components/PrintingSystem/index-B2qcnfw0.js +0 -187
  71. package/components/PrintingSystem/subcomponents/BodyNode/index-Cv2aoy8S.js +0 -49
  72. package/components/PrintingSystem/subcomponents/ChartNode/index-BmJm8v_C.js +0 -105
  73. package/components/PrintingSystem/subcomponents/DividerNode/index-MpFhE-H0.js +0 -20
  74. package/components/PrintingSystem/subcomponents/FooterNode/index-ZEcWdMSM.js +0 -49
  75. package/components/PrintingSystem/subcomponents/GridNode/index-SsKax2xu.js +0 -74
  76. package/components/PrintingSystem/subcomponents/HeaderNode/index-Cs8TOOBL.js +0 -49
  77. package/components/PrintingSystem/subcomponents/PaperNode/index-DBb25Ecg.js +0 -30
  78. package/components/PrintingSystem/subcomponents/PropertyValueNode/index-CTVn7J9Q.js +0 -47
  79. package/components/PrintingSystem/subcomponents/SectionNode/index-iYPM3EaS.js +0 -49
  80. package/components/PrintingSystem/subcomponents/TextBoxNode/index-DGjXCFKJ.js +0 -24
  81. package/components/PropertyValue/index-Bh-Jnrte.js +0 -264
  82. package/components/Resizeable/index-DdP1xfE9.js +0 -20
  83. package/components/ScrollBar/index-f2URPPE2.js +0 -35
  84. package/components/ScrollToTop/index-TxORk5dB.js +0 -12
  85. package/components/SideBar/index-PUBBe0yH.js +0 -758
  86. package/components/SplitLayout/index-Bu1hcO6G.js +0 -89
  87. package/components/ToastContainer/index-DK1d8NNd.js +0 -191
  88. package/components/WrapperComponent/index-BHV-CsDU.js +0 -14
  89. package/components/animate/LoadingScreen/index-CkVLOrMz.js +0 -70
  90. package/components/animate/MotionContainer/index-eartnWyO.js +0 -34
  91. package/components/animate/MotionLazyContainer/index-Be8osTiG.js +0 -9
  92. package/components/animate/PropagateLoader/index-Bkq8V2SN.js +0 -23
  93. package/components/animate/features-BbnE33u3.js +0 -5
  94. package/components/animate/index-BsWiJfzp.js +0 -89
  95. package/components/animate/variants/bounce-DanQqHAX.js +0 -101
  96. package/components/animate/variants/container-Dmpr6tg5.js +0 -22
  97. package/components/animate/variants/fade-CAOJNn06.js +0 -65
  98. package/components/animate/variants/index-l0sNRNKZ.js +0 -1
  99. package/components/animate/variants/transition-B9W5SWTa.js +0 -20
  100. package/components/areas/components/AreasAdmin/index-OxQU3P8Y.js +0 -699
  101. package/components/areas/components/AreasViewer/index-DQ0aPioP.js +0 -805
  102. package/components/areas/components/index-l0sNRNKZ.js +0 -1
  103. package/components/areas/constants-rqODZNZe.js +0 -6
  104. package/components/areas/contexts/AreasContext/index-BqRlA7JA.js +0 -1110
  105. package/components/areas/contexts/DynamicMFParmsContext/index-22c6E7vK.js +0 -36
  106. package/components/areas/contexts/WindowToolsMFContext/index-DkE30fhm.js +0 -12
  107. package/components/areas/contexts/index-l0sNRNKZ.js +0 -1
  108. package/components/areas/dictionary-YUsP9beq.js +0 -36
  109. package/components/areas/hooks/index-l0sNRNKZ.js +0 -1
  110. package/components/areas/hooks/useAreas/index-BSbwbJLS.js +0 -11
  111. package/components/areas/hooks/useDynamicMFParameters/index-DhbcZPs9.js +0 -12
  112. package/components/areas/hooks/useSetWindowsTitle/useSetWindowsTitle-BzPD-miW.js +0 -31
  113. package/components/areas/hooks/useWindowToolsMF/index-BECQfhbC.js +0 -10
  114. package/components/areas/icons-CwFr-alN.js +0 -24
  115. package/components/areas/index-B_Odny9h.js +0 -22
  116. package/components/commercial/AppBarCommercial/index-CHq3P3GY.js +0 -28
  117. package/components/commercial/SectionCommercial/index-BeABGtdr.js +0 -56
  118. package/components/commercial/TopBar/index-F1repmti.js +0 -232
  119. package/components/commercial/index-CxDzs6Ax.js +0 -81
  120. package/components/formatters/BooleanFormatter/index-DktIidqW.js +0 -44
  121. package/components/formatters/DateFormatter/index-CGcRZ8BA.js +0 -43
  122. package/components/formatters/PointsFormatter/index-C7sR8iqk.js +0 -25
  123. package/components/formatters/PriceFormatter/index-CsvRawmc.js +0 -35
  124. package/components/formatters/UncertaintyFormatter/index-B9ESVEVp.js +0 -29
  125. package/components/formatters/index-pnJhDYKe.js +0 -109
  126. package/components/hook-form/HelperError/index-BVnmUazV.js +0 -19
  127. package/components/hook-form/RHFAutocomplete/index-BtPL16HR.js +0 -657
  128. package/components/hook-form/RHFAutocompleteAsync/index-BfzjLHG8.js +0 -226
  129. package/components/hook-form/RHFCheckbox/index-Vyttu8Vx.js +0 -132
  130. package/components/hook-form/RHFColorPicker/index-Cxxb5Wa_.js +0 -191
  131. package/components/hook-form/RHFDateTime/index-CW1Slb-f.js +0 -190
  132. package/components/hook-form/RHFMultiCheckbox/index-BARudV1A.js +0 -34
  133. package/components/hook-form/RHFPeriod/index-r-HeIOoZ.js +0 -98
  134. package/components/hook-form/RHFRadioGroup/index-CTD-0zKo.js +0 -52
  135. package/components/hook-form/RHFSelect/index-LdwRuFz-.js +0 -29
  136. package/components/hook-form/RHFTextField/index-B6ufruSB.js +0 -337
  137. package/components/hook-form/RHFUpload/index-CDPbm8NR.js +0 -253
  138. package/components/maps/components/GpsTools/index-5MXlhIEt.js +0 -1948
  139. package/components/maps/components/Map/index-2Lx5ARXa.js +0 -2546
  140. package/components/maps/index-Ci-7-FHg.js +0 -7
  141. package/components/modal/WindowBase-Gd27v5FU.js +0 -44
  142. package/components/modal/WindowConfirm-u6vAMFo7.js +0 -73
  143. package/components/modal/index-CydPIpKZ.js +0 -65
  144. package/components/mui_extended/Accordion/index-DMLYJL7o.js +0 -124
  145. package/components/mui_extended/Avatar/index-ClBa-6eF.js +0 -64
  146. package/components/mui_extended/Badge/index-zI-F_Qkq.js +0 -29
  147. package/components/mui_extended/BoxIcon/index-BUTJ2tKw.js +0 -22
  148. package/components/mui_extended/Breadcrumbs/index-DTS7rOZH.js +0 -86
  149. package/components/mui_extended/Button/index-CGfZbaea.js +0 -222
  150. package/components/mui_extended/CheckBox-BXUrbonB.js +0 -76
  151. package/components/mui_extended/CircularProgress/index-Bnnti_G6.js +0 -8
  152. package/components/mui_extended/IconButton/classes/constants-ChY2jKkp.js +0 -4
  153. package/components/mui_extended/IconButton/classes/index-BxjJGAqZ.js +0 -45
  154. package/components/mui_extended/IconButton/index-CusYFjie.js +0 -97
  155. package/components/mui_extended/IconButton/styledIconButton-fAsbGoFS.js +0 -7
  156. package/components/mui_extended/LinearProgress/index-CGgW8jq2.js +0 -9
  157. package/components/mui_extended/LinkWithRoute/index-BC2miUjR.js +0 -15
  158. package/components/mui_extended/MenuActions/MenuActions-C6CjSU6C.js +0 -149
  159. package/components/mui_extended/MenuActions/constants-BwsU9chA.js +0 -10
  160. package/components/mui_extended/MenuActions/dictionary-Dj_07puT.js +0 -11
  161. package/components/mui_extended/MenuActions/slots/MenuActionsEnum-Bu-L6eWU.js +0 -13
  162. package/components/mui_extended/MenuActions/slots/MenuActionsSlots-D65KZAKF.js +0 -46
  163. package/components/mui_extended/Pager/index-DCbxiTZA.js +0 -257
  164. package/components/mui_extended/Popover/index-DfrJAQkV.js +0 -153
  165. package/components/mui_extended/Stack/index-DzEeCYfp.js +0 -31
  166. package/components/mui_extended/Tab/index-Bu3dPidV.js +0 -129
  167. package/components/mui_extended/ToggleButton/index-C9cBkT1V.js +0 -18
  168. package/components/mui_extended/ToggleIconButton/index--0b3Td6C.js +0 -26
  169. package/components/mui_extended/Tooltip/index-B8QUytCK.js +0 -42
  170. package/components/mui_extended/Typography/index-Cf_4Zw8f.js +0 -54
  171. package/components/mui_extended/index-l0sNRNKZ.js +0 -1
  172. package/components/popups/PopupsProvider/index-DhSxmtfJ.js +0 -172
  173. package/components/popups/PopupsViewer/constants-DuyD7aCn.js +0 -4
  174. package/components/popups/PopupsViewer/icons-BUujqqbu.js +0 -7
  175. package/components/popups/PopupsViewer/index-BecevSns.js +0 -172
  176. package/components/popups/PopupsViewer/slots/index-B98CiRLa.js +0 -14
  177. package/components/popups/PopupsViewer/slots/popupsViewerSlots-BXH77nCF.js +0 -46
  178. package/components/popups/index-l0sNRNKZ.js +0 -1
  179. package/contexts/ModalContext/index-CPfNnfTL.js +0 -39
  180. package/contexts/RHFormContext/index-D_nK759o.js +0 -78
  181. package/hocs/withToggle/index-C1_DMZD3.js +0 -14
  182. package/hooks/useFormAddEdit/index-D9oSjUn1.js +0 -90
  183. package/hooks/useFormReadyForUpdate/index-B3HygFCM.js +0 -20
  184. package/hooks/useModal/index-BJSQOX3U.js +0 -10
  185. package/hooks/useSizeContainer/index-D4hDjM1P.js +0 -37
  186. package/hooks/useStateRef/index-C3P6ZK3m.js +0 -15
  187. package/hooks/useTab/index-B_GEQFOP.js +0 -12
  188. package/react-data-grid-BfYuZ6AK.js +0 -2606
  189. package/react-draggable-DsCPdgQP.js +0 -811
  190. package/react-json-view-bhqIAaNg.js +0 -2576
  191. package/react-resizable-eBbFl2dX.js +0 -618
  192. package/react-spinners-TpKN9lZg.js +0 -123
  193. package/react-splitter-layout-C-JTsNGs.js +0 -158
  194. package/styles/DynamicFilter-CJFsIegc.js +0 -319
  195. package/styles/MenuActions-lTi-ynPM.js +0 -42
  196. package/styles/index-DKj6m8SL.js +0 -1691
  197. package/test/constants_no_mock-CF-669v-.js +0 -4
  198. package/test/getNameDataTestId-BaBTWhBr.js +0 -10
  199. package/utils/index-DiMrtgIu.js +0 -502
  200. /package/components/GridLayout/subcomponents/{Griditem → GridItem}/index.d.ts +0 -0
  201. /package/components/GridLayout/subcomponents/{Griditem → GridItem}/types.d.ts +0 -0
@@ -1,805 +0,0 @@
1
- import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
- import { a8 as WindowRoot, a9 as WrapperWindowModal, aa as AreasViewerRoot } from "../../../../styles/index-DKj6m8SL.js";
3
- import { shallow } from "zustand/shallow";
4
- import React__default, { useMemo, useEffect } from "react";
5
- import clsx from "clsx";
6
- import { u as useAreasStore } from "../../hooks/useAreas/index-BSbwbJLS.js";
7
- import { generateUtilityClasses, Skeleton } from "@mui/material";
8
- import { unstable_composeClasses } from "@mui/base";
9
- import { g as getComponentUtilityClass } from "../../../../utils/index-DiMrtgIu.js";
10
- import { a as AREAS_VIEWER_CLASS_NAME } from "../../constants-rqODZNZe.js";
11
- import { useModuleDictionary, useEnvironment, useModuleSkeleton } from "@m4l/core";
12
- import { useResponsiveDesktop } from "@m4l/graphics";
13
- import { I as ICONS } from "../../icons-CwFr-alN.js";
14
- import { g as getAreasDictionary, D as DICCTIONARY } from "../../dictionary-YUsP9beq.js";
15
- import { I as IconButton } from "../../../mui_extended/IconButton/index-CusYFjie.js";
16
- import { L as LinearProgressIndeterminate } from "../../../LinearProgressIndeterminate/index-BwI756Mb.js";
17
- import { a as MemonizedMenuActions } from "../../../mui_extended/MenuActions/MenuActions-C6CjSU6C.js";
18
- import { I as Icon } from "../../../Icon/index-C89MAkeH.js";
19
- import { T as Typography } from "../../../mui_extended/Typography/index-Cf_4Zw8f.js";
20
- import { M as MFLoader } from "../../../MFLoader/index-BI8vQZSH.js";
21
- import { W as WindowToolsMFProvider } from "../../contexts/WindowToolsMFContext/index-DkE30fhm.js";
22
- import { D as DynamicMFParmsProvider } from "../../contexts/DynamicMFParmsContext/index-22c6E7vK.js";
23
- import { T as TEST_PROP_ID } from "../../../../test/constants_no_mock-CF-669v-.js";
24
- import { g as getNameDataTestId } from "../../../../test/getNameDataTestId-BaBTWhBr.js";
25
- import { c as createToaster, T as ToastContainer } from "../../../ToastContainer/index-DK1d8NNd.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-BqRlA7JA.js";
27
- import { w as withSizeProvider } from "../../../GridLayout/subcomponents/SizeProvider/index-1aJ-e_54.js";
28
- import { R as Responsive } from "../../../GridLayout/subcomponents/Responsive/index-BKcU2OnF.js";
29
- import { useLocation } from "react-router-dom";
30
- import { L as LoadingError } from "../../../LoadingError/index-Cf0oGUrL.js";
31
- import { a as Draggable } from "../../../../react-draggable-DsCPdgQP.js";
32
- import { R as ResizeableWindow } from "../../../Resizeable/index-DdP1xfE9.js";
33
- const areasViewerClasses = generateUtilityClasses(
34
- AREAS_VIEWER_CLASS_NAME,
35
- [
36
- /* elements */
37
- "root",
38
- "areaRoot",
39
- "areaGridLayoutPanelContainer",
40
- "areaGridLayout",
41
- "areaGridLayoutPopupsContainer",
42
- "areasWindowPopUpList",
43
- "windowRoot",
44
- "windowHeader",
45
- "windowHeaderContent",
46
- "windowHeaderTitle",
47
- "windowHeaderMainActions",
48
- "windowHeaderCancelHandle",
49
- "windowContent",
50
- "windowPopupRoot",
51
- "windowModalRoot",
52
- "windowLinearProgressRoot",
53
- "windowLinearProgressBar",
54
- "windowRootContainer",
55
- "panelWindowsRoot",
56
- "panelWindowsButtonContainer",
57
- "panelWindowsSeparator",
58
- "containerLinearProgress",
59
- "resizeHandle",
60
- "loaderContainer",
61
- "containerComponent",
62
- /* states or variants of elements */
63
- // 'active',
64
- "selected",
65
- "colapsed",
66
- "selectedWindow",
67
- "isMobile",
68
- "loading",
69
- "pinIn",
70
- "success",
71
- "info",
72
- "warning",
73
- "error"
74
- ],
75
- AREAS_VIEWER_CLASS_NAME
76
- );
77
- const useAreasViewerUtilityClasses = (ownerState) => {
78
- const slots = {
79
- root: [
80
- "root",
81
- ownerState.status,
82
- ownerState.isMobile && "isMobile",
83
- ownerState.isSkeleton && "isSkeleton"
84
- ],
85
- areaRoot: ["areaRoot"],
86
- areasLoadingErrorRoot: ["areasLoadingErrorRoot"],
87
- areasLoadingErrorLoading: ["areasLoadingErrorLoading"],
88
- areasLoadingError: ["areasLoadingError"],
89
- areasLoadingErrorIcon: ["areasLoadingErrorIcon"],
90
- areasLoadingErrorTitle: ["areasLoadingErrorTitle"],
91
- areasLoadingErrorDescription: ["areasLoadingErrorDescription"],
92
- areasLoadingErrorDivider: ["areasLoadingErrorDivider"],
93
- areaGridLayoutPanelContainer: ["areaGridLayoutPanelContainer"],
94
- areaGridLayout: ["areaGridLayout"],
95
- areaGridLayoutPopupsContainer: ["areaGridLayoutPopupsContainer"],
96
- areasWindowPopUpList: ["areasWindowPopUpList"],
97
- windowRoot: ["windowRoot"],
98
- windowRootContainer: ["windowRootContainer"],
99
- windowHeader: ["windowHeader"],
100
- windowHeaderTitle: ["windowHeaderTitle"],
101
- windowHeaderMainActions: ["windowHeaderMainActions"],
102
- windowHeaderCancelHandle: ["windowHeaderCancelHandle"],
103
- windowContent: ["windowContent"],
104
- windowLinearProgressRoot: ["windowLinearProgressRoot"],
105
- windowLinearProgressBar: ["windowLinearProgressBar"],
106
- windowPopupRoot: ["windowPopupRoot"],
107
- windowModalRoot: ["windowModalRoot"],
108
- selectedWindow: ["selectedWindow"],
109
- panelWindowsRoot: ["panelWindowsRoot"],
110
- panelWindowsButtonContainer: ["panelWindowsButtonContainer"],
111
- panelWindowsSeparator: ["panelWindowsSeparator"],
112
- resizeHandle: ["resizeHandle"],
113
- loaderContainer: ["loaderContainer"],
114
- containerComponent: ["containerComponent"]
115
- };
116
- return unstable_composeClasses(slots, getComponentUtilityClass(AREAS_VIEWER_CLASS_NAME), {});
117
- };
118
- function WindowHeaderSkeleton(props) {
119
- const { colapsed } = props;
120
- return /* @__PURE__ */ jsx("div", { className: clsx(areasViewerClasses.windowHeader), children: /* @__PURE__ */ jsxs("div", { className: areasViewerClasses.windowHeaderContent, children: [
121
- /* @__PURE__ */ jsx(
122
- Skeleton,
123
- {
124
- variant: "circular",
125
- sx: { margin: "0 5px", minWidth: "18px", minHeight: "18px" }
126
- }
127
- ),
128
- /* @__PURE__ */ jsx("div", { style: { width: "100%" }, children: /* @__PURE__ */ jsx(Skeleton, { variant: "text", width: 80, height: 16 }) }),
129
- /* @__PURE__ */ jsx("div", { className: areasViewerClasses.windowHeaderCancelHandle, children: !colapsed && /* @__PURE__ */ jsxs(Fragment, { children: [
130
- /* @__PURE__ */ jsx(
131
- Skeleton,
132
- {
133
- variant: "circular",
134
- sx: { margin: "0 5px", minWidth: "16px", minHeight: "16px" }
135
- }
136
- ),
137
- /* @__PURE__ */ jsx(
138
- Skeleton,
139
- {
140
- variant: "circular",
141
- sx: { margin: "0 5px", minWidth: "16px", minHeight: "16px" }
142
- }
143
- ),
144
- /* @__PURE__ */ jsx(
145
- Skeleton,
146
- {
147
- variant: "circular",
148
- sx: { margin: "0 5px", minWidth: "16px", minHeight: "16px" }
149
- }
150
- )
151
- ] }) }),
152
- /* @__PURE__ */ jsx(
153
- Skeleton,
154
- {
155
- variant: "circular",
156
- sx: { margin: "0 5px", minWidth: "16px", minHeight: "16px" }
157
- }
158
- ),
159
- /* @__PURE__ */ jsx(
160
- Skeleton,
161
- {
162
- variant: "circular",
163
- sx: { margin: "0 5px", minWidth: "16px", minHeight: "16px" }
164
- }
165
- )
166
- ] }) });
167
- }
168
- function getMainActions(isDesktop, moduleActions) {
169
- let mainActions = [];
170
- if (isDesktop !== void 0 && isDesktop) {
171
- mainActions = mainActions.concat(moduleActions.filter((action) => action.visibility === "main"));
172
- }
173
- mainActions = mainActions.concat(moduleActions.filter((action) => action.visibility === "allways"));
174
- return mainActions;
175
- }
176
- function getMenuActions(options) {
177
- const {
178
- windowId,
179
- isDesktop,
180
- moduleActions,
181
- urlPrefix,
182
- saveModuleCookies,
183
- resetModuleCookies,
184
- version,
185
- windowOptions = { allowPersistCookies: false },
186
- getLabel
187
- } = options;
188
- let menuActions = [...moduleActions.filter((action) => action.visibility !== "allways")];
189
- if (isDesktop !== void 0 && isDesktop) {
190
- menuActions = menuActions.filter((action) => action.visibility === "normal");
191
- }
192
- if (windowOptions.allowPersistCookies) {
193
- const saveCookiesAction = {
194
- urlIcon: `${urlPrefix}/frontend/components/areas/assets/icons/${ICONS.SAVE_COOKIES}`,
195
- onClick: () => saveModuleCookies(windowId),
196
- disabled: false,
197
- visibility: "normal",
198
- /* dictionaryId: getAreasDictionary(DICCTIONARY.label_persist_module_cookies), */
199
- label: getLabel(getAreasDictionary(DICCTIONARY.label_persist_module_cookies)),
200
- key: "save_cookies"
201
- };
202
- menuActions.push(saveCookiesAction);
203
- const resetCookiesAction = {
204
- urlIcon: `${urlPrefix}/frontend/components/areas/assets/icons/${ICONS.RESET_COOKIES}`,
205
- onClick: () => resetModuleCookies(windowId),
206
- disabled: false,
207
- visibility: "normal",
208
- label: getLabel(getAreasDictionary(DICCTIONARY.label_reset_module_cookies)),
209
- /* dictionaryId: getAreasDictionary(DICCTIONARY.label_reset_module_cookies), */
210
- key: "reset_cookes"
211
- };
212
- menuActions.push(resetCookiesAction);
213
- }
214
- if (version) {
215
- const versionAction = {
216
- urlIcon: `${urlPrefix}/frontend/components/areas/assets/icons/${ICONS.VERSION}`,
217
- onClick: () => {
218
- },
219
- disabled: true,
220
- visibility: "normal",
221
- label: version,
222
- key: "version"
223
- };
224
- menuActions.push(versionAction);
225
- }
226
- return menuActions;
227
- }
228
- function MainActions(props) {
229
- const { windowId } = props;
230
- const moduleActions = useAreasStore((state) => {
231
- const window = state.hashWindows[windowId];
232
- return window?.moduleActions || [];
233
- }, shallow);
234
- const { getLabel } = useModuleDictionary();
235
- const isDesktop = useResponsiveDesktop();
236
- const mainActions = useMemo(() => {
237
- return getMainActions(isDesktop, moduleActions);
238
- }, [moduleActions, isDesktop]);
239
- return /* @__PURE__ */ jsx("div", { className: areasViewerClasses.windowHeaderMainActions, children: mainActions.map((mainAction) => {
240
- const tooltip = mainAction.label !== void 0 ? mainAction.label : getLabel(mainAction.dictionaryId || "");
241
- const onClick = (e) => {
242
- mainAction.onClick(e);
243
- e.stopPropagation();
244
- };
245
- return /* @__PURE__ */ jsx(
246
- IconButton,
247
- {
248
- src: mainAction.urlIcon || "",
249
- className: clsx(mainAction.className, "m4l_draggableCancel"),
250
- onClick,
251
- "aria-label": mainAction.label,
252
- disabled: mainAction.disabled,
253
- tooltip
254
- },
255
- mainAction.key
256
- );
257
- }) });
258
- }
259
- function Header(props) {
260
- const { areaId, windowId, emergeType } = props;
261
- const [url_icon, title, moduleActions, onClose, version, windowOptions, fnQueryClose] = useAreasStore((state) => {
262
- const window = state.hashWindows[windowId];
263
- return [
264
- window.url_icon,
265
- window.title,
266
- window.moduleActions,
267
- window.onClose,
268
- window.version,
269
- window.windowOptions,
270
- window.fnQueryClose
271
- ];
272
- }, shallow);
273
- const { saveModuleCookies, resetModuleCookies } = useAreasStore(
274
- (state) => state.windowActions,
275
- shallow
276
- );
277
- const maximizedId = useAreasStore((state) => state.hashAreas[areaId].maximizedId, shallow);
278
- const collapsed = useAreasStore((state) => {
279
- const currentBreakpoint = state.hashAreas[areaId].currentBreakpoint;
280
- if (currentBreakpoint) {
281
- return state.hashAreas[areaId].layouts[currentBreakpoint].find((li) => li.i === windowId)?.colapsed;
282
- }
283
- return false;
284
- }, shallow);
285
- const { maximizeLayout, normalizeLayouts, colapseLayoutItem, unColapseLayoutItem } = useAreasStore((state) => state.areaActions, shallow);
286
- const { host_static_assets, environment_assets } = useEnvironment();
287
- const isDesktop = useResponsiveDesktop();
288
- const isSkeleton = useModuleSkeleton();
289
- const { getLabel } = useModuleDictionary();
290
- const urlPrefix = `${host_static_assets}/${environment_assets}`;
291
- const menuActions = useMemo(() => {
292
- return getMenuActions({
293
- windowId,
294
- isDesktop,
295
- moduleActions,
296
- urlPrefix,
297
- saveModuleCookies,
298
- resetModuleCookies,
299
- version,
300
- windowOptions,
301
- getLabel
302
- });
303
- }, [moduleActions, isDesktop]);
304
- const onCloseLocal = () => {
305
- const fnClose = fnQueryClose || onClose;
306
- fnClose && fnClose(windowId);
307
- };
308
- const maxNormalize = (e) => {
309
- if (maximizedId === windowId) {
310
- normalizeLayouts(areaId);
311
- } else {
312
- maximizeLayout(areaId, windowId);
313
- }
314
- e.stopPropagation();
315
- };
316
- const collapsedToggle = (e) => {
317
- if (!collapsed) {
318
- colapseLayoutItem(areaId, windowId);
319
- } else {
320
- unColapseLayoutItem(areaId, windowId);
321
- }
322
- e.stopPropagation();
323
- };
324
- if (isSkeleton) {
325
- return /* @__PURE__ */ jsx(WindowHeaderSkeleton, {});
326
- }
327
- return /* @__PURE__ */ jsxs("div", { className: clsx(areasViewerClasses.windowHeader, "m4l_draggable_handle"), children: [
328
- /* @__PURE__ */ jsx(LinearProgressIndeterminate, {}),
329
- /* @__PURE__ */ jsxs("div", { className: areasViewerClasses.windowHeaderContent, children: [
330
- /* @__PURE__ */ jsx(Icon, { src: url_icon, size: "medium" }),
331
- /* @__PURE__ */ jsx(Typography, { className: areasViewerClasses.windowHeaderTitle, variant: "h5", children: title }),
332
- /* @__PURE__ */ jsxs("div", { className: areasViewerClasses.windowHeaderCancelHandle, children: [
333
- !collapsed && /* @__PURE__ */ jsx(MainActions, { windowId }),
334
- !collapsed && menuActions.length > 0 && /* @__PURE__ */ jsx(
335
- MemonizedMenuActions,
336
- {
337
- arrowType: "no-arrow",
338
- marginTop: "12px!important",
339
- marginLeft: "14px!important",
340
- anchorOrigin: { vertical: "bottom", horizontal: "right" },
341
- transformOrigin: { vertical: "top", horizontal: "right" },
342
- menuActions,
343
- toolTip: getLabel(getAreasDictionary(DICCTIONARY.label_module_actions))
344
- }
345
- ),
346
- !collapsed && (emergeType === "layout" || emergeType === "popup") && /* @__PURE__ */ jsx(
347
- IconButton,
348
- {
349
- className: "m4l_draggableCancel",
350
- onClick: maxNormalize,
351
- "aria-label": "click",
352
- 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}`,
353
- tooltip: getLabel(
354
- getAreasDictionary(
355
- maximizedId === windowId ? DICCTIONARY.label_minimize_window : DICCTIONARY.label_maximize_window
356
- )
357
- )
358
- }
359
- ),
360
- !maximizedId && (emergeType === "layout" || emergeType === "popup") && /* @__PURE__ */ jsx(
361
- IconButton,
362
- {
363
- className: "m4l_draggableCancel",
364
- onClick: collapsedToggle,
365
- "aria-label": "click",
366
- src: !collapsed ? `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.COLAPSE}` : `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.UNCOLPASE}`,
367
- tooltip: getLabel(
368
- getAreasDictionary(
369
- !collapsed ? DICCTIONARY.label_collapse_window : DICCTIONARY.label_uncollapse_window
370
- )
371
- )
372
- }
373
- ),
374
- onClose && /* @__PURE__ */ jsx(
375
- IconButton,
376
- {
377
- className: "m4l_draggableCancel",
378
- onPointerDown: onCloseLocal,
379
- "aria-label": "click",
380
- src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.CLOSE}`,
381
- tooltip: getLabel(getAreasDictionary(DICCTIONARY.label_close_window))
382
- }
383
- )
384
- ] })
385
- ] })
386
- ] });
387
- }
388
- const MicroFrontend = (props) => {
389
- return /* @__PURE__ */ jsx(MFLoader, { ...props });
390
- };
391
- const MemonizedMicroFrontend = React__default.memo(MicroFrontend);
392
- const Component = (props) => {
393
- const { component, dynamicMFStore, windowTools } = props;
394
- 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 }) }) });
395
- };
396
- React__default.memo(Component);
397
- const Window = (props) => {
398
- const { areaId, windowId } = props;
399
- const [emergeType, moduleId, winType] = useAreasStore((state) => {
400
- return [
401
- state.hashWindows[windowId]?.emergeType,
402
- state.hashWindows[windowId]?.moduleId,
403
- state.hashWindows[windowId]?.winType
404
- ];
405
- }, shallow);
406
- const selected = useAreasStore((state) => {
407
- return emergeType === "layout" ? state.hashAreas[areaId]?.currentLayoutId : state.hashAreas[areaId]?.currentPopUpId;
408
- }) === windowId;
409
- const mfProps = useAreasStore((state) => state.hashWindows[windowId]?.mfProps, shallow);
410
- const component = useAreasStore(
411
- (state) => state.hashWindows[windowId]?.component,
412
- shallow
413
- );
414
- const loading = useAreasStore((state) => state.hashWindows[windowId]?.loading, shallow);
415
- const status = useAreasStore((state) => state.hashWindows[windowId]?.status, shallow);
416
- const dynamicMFStore = useAreasStore(
417
- (state) => state.hashWindows[windowId]?.dynamicMFStore,
418
- shallow
419
- );
420
- const {
421
- setActions,
422
- getCookie,
423
- getCookies,
424
- setCookie,
425
- close,
426
- startProgress,
427
- stopProgress,
428
- setFnQueryClose,
429
- setWindowTitle
430
- } = useAreasStore((state) => state.windowActions, shallow);
431
- const { selectLayout } = useAreasStore((state) => state.areaActions, shallow);
432
- const { loadCookiesFromApi } = useAreasStore((state) => state.windowActions, shallow);
433
- const onTouch = () => {
434
- if (!selected) {
435
- selectLayout(areaId, props.windowId);
436
- }
437
- };
438
- const windowTools = useMemo(
439
- () => ({
440
- getWindowId: () => windowId,
441
- setActions: (newActions, version) => {
442
- setActions(windowId, newActions, version);
443
- },
444
- getCookie: (id) => getCookie(windowId, id),
445
- getCookies: (type) => getCookies(windowId, type),
446
- setCookie: (id, type, cookie) => {
447
- setCookie(windowId, id, type, cookie);
448
- },
449
- close: () => close(windowId),
450
- startProgress: () => startProgress(windowId),
451
- stopProgress: () => stopProgress(windowId),
452
- setFnQueryClose: (fnQueryClose) => {
453
- setFnQueryClose(windowId, fnQueryClose);
454
- },
455
- toast: createToaster(windowId),
456
- setWindowTitle: (title) => setWindowTitle(windowId, title)
457
- }),
458
- []
459
- );
460
- useEffect(() => {
461
- if (status === "init") {
462
- loadCookiesFromApi(windowId);
463
- }
464
- }, [status]);
465
- if (status === void 0) {
466
- return null;
467
- }
468
- return /* @__PURE__ */ jsx(
469
- WindowRoot,
470
- {
471
- role: "presentation",
472
- className: clsx(
473
- areasViewerClasses.windowRoot,
474
- selected ? areasViewerClasses.selectedWindow : null,
475
- loading ? areasViewerClasses.loading : null,
476
- emergeType === "popup" ? areasViewerClasses.windowPopupRoot : null,
477
- emergeType === "modal" ? areasViewerClasses.windowModalRoot : null
478
- ),
479
- onMouseDown: onTouch,
480
- ...process.env.NODE_ENV !== "production" ? {
481
- [TEST_PROP_ID]: getNameDataTestId(
482
- AREAS_VIEWER_CLASS_NAME,
483
- "windowRoot",
484
- `${emergeType}`
485
- )
486
- } : {},
487
- children: /* @__PURE__ */ jsxs("div", { className: areasViewerClasses.windowRootContainer, children: [
488
- /* @__PURE__ */ jsx(Header, { areaId, windowId, emergeType }),
489
- /* @__PURE__ */ jsx(ToastContainer, { fixed: false, position: "top-center", containerId: windowId }),
490
- /* @__PURE__ */ jsxs("div", { className: clsx(areasViewerClasses.windowContent), children: [
491
- status === "init" ? (
492
- /* validar uso */
493
- /* Todo: Validar agregar nuevo componente de carga. */
494
- /* @__PURE__ */ jsx(Fragment, { children: "Cargando..." })
495
- ) : null,
496
- status === "loaded" ? winType === "microfrontend" ? /* @__PURE__ */ jsx(
497
- MemonizedMicroFrontend,
498
- {
499
- moduleId,
500
- dynamicMFStore,
501
- windowTools,
502
- ...mfProps
503
- }
504
- ) : /* @__PURE__ */ jsx(
505
- Component,
506
- {
507
- moduleId,
508
- dynamicMFStore,
509
- windowTools,
510
- component
511
- }
512
- ) : null
513
- ] })
514
- ] })
515
- }
516
- );
517
- };
518
- React__default.memo(Window);
519
- const ResizeHandle = React__default.forwardRef(
520
- (props, ref) => {
521
- const { handleAxis, ...restProps } = props;
522
- return /* @__PURE__ */ jsx(
523
- "div",
524
- {
525
- ref,
526
- className: clsx(
527
- `react-resizable-handle react-resizable-handle-${handleAxis}`,
528
- areasViewerClasses.resizeHandle
529
- ),
530
- ...restProps
531
- }
532
- );
533
- }
534
- );
535
- const ResponsiveGridLayout = withSizeProvider(Responsive);
536
- const AreaGridLayout = (props) => {
537
- const { areaId } = props;
538
- const hashLayoutItems = useAreasStore((state) => state.hashAreas[areaId].layoutItemsIds, shallow);
539
- const layouts = useAreasStore((state) => state.hashAreas[areaId].layouts, shallow);
540
- const breakpoints = useAreasStore((state) => state.hashAreas[areaId].breakpoints, shallow);
541
- const maximizedId = useAreasStore((state) => state.hashAreas[areaId].maximizedId, shallow);
542
- const cols = useAreasStore((state) => state.hashAreas[areaId].cols, shallow);
543
- const { onBreakpointsLayoutsChange, onContainerChange } = useAreasStore(
544
- (state) => state.areaActions,
545
- shallow
546
- );
547
- return /* @__PURE__ */ jsx(
548
- ResponsiveGridLayout,
549
- {
550
- autoSize: false,
551
- compactType: "vertical",
552
- measureBeforeMount: true,
553
- resizeHandles: ["nw", "se"],
554
- className: clsx(
555
- areasViewerClasses.areaGridLayout,
556
- `${areasViewerClasses.areaGridLayout}-${areaId}`
557
- ),
558
- layouts,
559
- onLayoutChange: (layout, newLayouts) => onBreakpointsLayoutsChange(areaId, layout, newLayouts),
560
- draggableHandle: ".m4l_draggable_handle",
561
- draggableCancel: `.${areasViewerClasses.windowHeaderCancelHandle}`,
562
- layoutItemRender: (p) => {
563
- if (hashLayoutItems.indexOf(p.i) === -1) {
564
- return /* @__PURE__ */ jsx(Fragment, {});
565
- }
566
- if (p.type === "placeholder") {
567
- return /* @__PURE__ */ jsx("div", {});
568
- }
569
- return /* @__PURE__ */ jsx(Window, { windowId: p.i, areaId });
570
- },
571
- breakpoints,
572
- colapsedHeight: RESPONSIVE_COLAPSED_HEIGHTS,
573
- rowHeight: RESPONSIVE_ROW_HEIGHTS,
574
- cols,
575
- containerMargin: [MARGIN_GRIDLAYOUT, MARGIN_GRIDLAYOUT],
576
- containerPadding: [PADDING_GRIDLAYOUT, PADDING_GRIDLAYOUT],
577
- onContainerChange: (e) => {
578
- onContainerChange(areaId, e);
579
- },
580
- preventCollision: false,
581
- maximizeId: maximizedId,
582
- resizeHandle: /* @__PURE__ */ jsx(ResizeHandle, {})
583
- }
584
- );
585
- };
586
- const PanelWindows = (props) => {
587
- const { areaId } = props;
588
- const status = useAreasStore((state) => state.hashAreas[areaId].status);
589
- const maximizedId = useAreasStore((state) => state.hashAreas[areaId].maximizedId);
590
- const maximizedIdParent = useAreasStore(
591
- (state) => state.hashWindows[maximizedId || ""]?.parentLayoutId || void 0
592
- );
593
- const hashLayoutItems = useAreasStore(
594
- (state) => state.hashAreas[areaId].layoutItemsIds.filter((itemId) => state.hashWindows[itemId].emergeType === "layout").map((key) => ({
595
- i: key,
596
- url_icon: state.hashWindows[key].url_icon,
597
- title: state.hashWindows[key].title,
598
- moduleId: state.hashWindows[key].moduleId,
599
- emergeType: state.hashWindows[key].emergeType,
600
- windowId: state.hashWindows[key].windowId
601
- })),
602
- shallow
603
- );
604
- const hashPopuosItems = useAreasStore(
605
- (state) => state.hashAreas[areaId].layoutItemsIds.filter((itemId) => state.hashWindows[itemId].emergeType === "popup").map((key) => ({
606
- i: key,
607
- url_icon: state.hashWindows[key].url_icon,
608
- title: state.hashWindows[key].title,
609
- moduleId: state.hashWindows[key].moduleId,
610
- emergeType: state.hashWindows[key].emergeType,
611
- windowId: state.hashWindows[key].windowId
612
- })),
613
- shallow
614
- );
615
- const { maximizeLayout } = useAreasStore((state) => state.areaActions);
616
- const onTouched = (layoutId) => {
617
- maximizeLayout(areaId, layoutId);
618
- };
619
- const location = useLocation();
620
- const searchParams = new URLSearchParams(location.search);
621
- const currentParam = searchParams.get("module");
622
- if (status === "loaded") {
623
- if (!maximizedId || hashLayoutItems.length < 2) {
624
- return null;
625
- }
626
- return /* @__PURE__ */ jsxs("div", { className: areasViewerClasses.panelWindowsRoot, children: [
627
- hashLayoutItems.map((kl) => {
628
- return /* @__PURE__ */ jsx(
629
- "div",
630
- {
631
- className: clsx(
632
- areasViewerClasses.panelWindowsButtonContainer,
633
- maximizedId === kl.i && kl.emergeType !== "popup" || maximizedIdParent === kl.windowId && kl.moduleId === currentParam ? areasViewerClasses.selected : null
634
- ),
635
- children: /* @__PURE__ */ jsx(
636
- IconButton,
637
- {
638
- src: kl.url_icon,
639
- size: "small",
640
- onClick: () => onTouched(kl.i),
641
- tooltip: maximizedId !== kl.i ? kl.title : void 0
642
- }
643
- )
644
- },
645
- kl.i
646
- );
647
- }),
648
- hashPopuosItems.length > 0 && /* @__PURE__ */ jsx("div", { className: areasViewerClasses.panelWindowsSeparator }),
649
- hashPopuosItems.map((kl) => {
650
- return /* @__PURE__ */ jsx(
651
- "div",
652
- {
653
- className: clsx(
654
- areasViewerClasses.panelWindowsButtonContainer,
655
- maximizedId === kl.i && kl.emergeType !== "popup" || maximizedIdParent === kl.windowId && kl.moduleId === currentParam ? areasViewerClasses.selected : null
656
- ),
657
- children: /* @__PURE__ */ jsx(
658
- IconButton,
659
- {
660
- src: kl.url_icon,
661
- size: "small",
662
- onClick: () => onTouched(kl.i),
663
- tooltip: maximizedId !== kl.i ? kl.title : void 0
664
- }
665
- )
666
- },
667
- kl.i
668
- );
669
- })
670
- ] });
671
- } else {
672
- return null;
673
- }
674
- };
675
- const InnerForHooks = (props) => {
676
- const { areaId } = props;
677
- const isDesktop = useResponsiveDesktop();
678
- const status = useAreasStore((state) => state.hashAreas[areaId].status);
679
- return /* @__PURE__ */ jsxs(
680
- "div",
681
- {
682
- className: clsx(
683
- areasViewerClasses.areaGridLayoutPanelContainer,
684
- `${areasViewerClasses.areaGridLayoutPanelContainer}-${areaId}`
685
- ),
686
- children: [
687
- status === "loaded" ? /* @__PURE__ */ jsx(AreaGridLayout, { areaId }) : /* @__PURE__ */ jsx(LoadingError, { status, action: () => {
688
- } }),
689
- isDesktop ? /* @__PURE__ */ jsx(PanelWindows, { areaId }) : null
690
- ]
691
- }
692
- );
693
- };
694
- const Area = (props) => {
695
- const { selected, areaId } = props;
696
- const classesAreaRoot = useAreasStore((state) => state.viwerClasses.areaRoot);
697
- const status = useAreasStore((state) => state.hashAreas[areaId].status);
698
- if (status === "init") {
699
- return null;
700
- }
701
- return /* @__PURE__ */ jsx(
702
- "div",
703
- {
704
- className: clsx(
705
- classesAreaRoot,
706
- selected ? areasViewerClasses.selected : null,
707
- status === "loading" ? areasViewerClasses.loading : null
708
- ),
709
- children: /* @__PURE__ */ jsx(InnerForHooks, { areaId })
710
- }
711
- );
712
- };
713
- Area.displayName = "Area";
714
- const WindowModal = (props) => {
715
- const { windowId } = props;
716
- const { onClose } = useAreasStore((state) => state.hashWindowsModals[windowId]);
717
- const { host_static_assets, environment_assets } = useEnvironment();
718
- const isDesktop = useResponsiveDesktop();
719
- const DragabblePaperComponent = (_props) => {
720
- return /* @__PURE__ */ jsx(
721
- Draggable,
722
- {
723
- handle: ".m4l_draggable_handle",
724
- bounds: "parent",
725
- children: /* @__PURE__ */ jsx(
726
- ResizeableWindow,
727
- {
728
- width: props.windowProps?.width || 400,
729
- height: props.windowProps?.height || 300,
730
- handle: (resizeHandle, ref) => /* @__PURE__ */ jsx("div", { ref, children: /* @__PURE__ */ jsx(
731
- Icon,
732
- {
733
- src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.RESIZE}`,
734
- className: `custom-handle custom-handle-${resizeHandle}`
735
- }
736
- ) }, resizeHandle),
737
- children: /* @__PURE__ */ jsx(Window, { ...props })
738
- }
739
- )
740
- }
741
- );
742
- };
743
- function PaperComponent(_props) {
744
- return /* @__PURE__ */ jsx(Window, { ...props });
745
- }
746
- return /* @__PURE__ */ jsx(
747
- WrapperWindowModal,
748
- {
749
- className: areasViewerClasses.windowModalRoot,
750
- open: true,
751
- scroll: "paper",
752
- onKeyDown: (event) => {
753
- if (event.key === "Escape") {
754
- onClose && onClose(windowId);
755
- }
756
- },
757
- "aria-labelledby": "child-modal-title",
758
- "aria-describedby": "child-modal-description",
759
- PaperComponent: isDesktop ? DragabblePaperComponent : PaperComponent,
760
- maxWidth: false,
761
- fullWidth: !isDesktop,
762
- fullScreen: false,
763
- disableEnforceFocus: true
764
- }
765
- );
766
- };
767
- const MemonizedWindowModal = React__default.memo(WindowModal);
768
- function AreasViewer() {
769
- const areas = useAreasStore((state) => state.areasIds, shallow);
770
- const windowsModals = useAreasStore((state) => state.windowsModals);
771
- const hashWindowsModals = useAreasStore((state) => state.hashWindowsModals);
772
- const currentArea = useAreasStore((state) => state.currentAreaId);
773
- const status = useAreasStore((state) => state.ownerState.status);
774
- const classesRoot = useAreasStore((state) => state.viwerClasses.root);
775
- const { init } = useAreasStore((state) => state.areasActions);
776
- return /* @__PURE__ */ jsxs(Fragment, { children: [
777
- /* @__PURE__ */ jsx(
778
- AreasViewerRoot,
779
- {
780
- className: classesRoot,
781
- ...process.env.NODE_ENV !== "production" ? {
782
- [TEST_PROP_ID]: getNameDataTestId(
783
- AREAS_VIEWER_CLASS_NAME,
784
- "root",
785
- ""
786
- )
787
- } : {},
788
- children: status === "loaded" ? areas.map((area) => {
789
- return /* @__PURE__ */ jsx(Area, { areaId: area, selected: currentArea === area }, area);
790
- }) : /* @__PURE__ */ jsx(LoadingError, { status, action: () => init() })
791
- }
792
- ),
793
- windowsModals.map((wm) => {
794
- if (hashWindowsModals[wm]) {
795
- return /* @__PURE__ */ jsx(MemonizedWindowModal, { ...hashWindowsModals[wm] }, wm);
796
- }
797
- return null;
798
- })
799
- ] });
800
- }
801
- export {
802
- AreasViewer as A,
803
- areasViewerClasses as a,
804
- useAreasViewerUtilityClasses as u
805
- };