@m4l/components 3.1.6 → 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 (203) hide show
  1. package/components/mui_extended/IconButton/index.d.ts +1 -1
  2. package/components/mui_extended/MenuActions/slots/MenuActionsSlots.d.ts +2 -4
  3. package/index.js +183 -339
  4. package/node_modules-CQtkw0uG.js +7350 -0
  5. package/package.json +1 -1
  6. package/vendor-AfIOyqRr.js +24636 -0
  7. package/components/AccountPopover/index-BdnzI23R.js +0 -334
  8. package/components/AppBar/index-Dvrx1jsr.js +0 -93
  9. package/components/BaseModule/index-BQ2UIUCy.js +0 -30
  10. package/components/CommonActions/components/ActionCancel/index-DSVEMl41.js +0 -12
  11. package/components/CommonActions/components/ActionFormCancel/index-DMsGH0wx.js +0 -56
  12. package/components/CommonActions/components/ActionFormIntro/index-C8zb7R3W.js +0 -33
  13. package/components/CommonActions/components/ActionIntro/index-BNIG3KAH.js +0 -25
  14. package/components/CommonActions/components/Actions/index-90JsZTzb.js +0 -70
  15. package/components/DataGrid/constants-8L7QgBKi.js +0 -10
  16. package/components/DataGrid/formatters/ColumnBooleanFormatter/index-ZsSxUL_T.js +0 -26
  17. package/components/DataGrid/formatters/ColumnConcatenatedValueFormatter/index-D-gZpvcm.js +0 -22
  18. package/components/DataGrid/formatters/ColumnDateFormatter/index-CKg8CJ6A.js +0 -19
  19. package/components/DataGrid/formatters/ColumnInteractiveCheckFormatter/index-kZGiDU5k.js +0 -23
  20. package/components/DataGrid/formatters/ColumnNestedValueFormatter/index-BslXGK-A.js +0 -14
  21. package/components/DataGrid/formatters/ColumnPointsFormatter/index-BXGW2CsK.js +0 -10
  22. package/components/DataGrid/formatters/ColumnPriceFormatter/index-O11tBykn.js +0 -10
  23. package/components/DataGrid/formatters/ColumnSetCheckFormatter/index-BaCawLr1.js +0 -36
  24. package/components/DataGrid/formatters/ColumnUncertaintyFormatter/index-Cq7a-jnE.js +0 -10
  25. package/components/DataGrid/formatters/index-iKq2iRoa.js +0 -13
  26. package/components/DataGrid/index-DGHnRo8z.js +0 -908
  27. package/components/DataGrid/subcomponents/Actions/index-BhBvobKS.js +0 -549
  28. package/components/DataGrid/subcomponents/editors/TextEditor/index-BIFm8akr.js +0 -80
  29. package/components/DragResizeWindow/index-D2jLYExo.js +0 -505
  30. package/components/DynamicFilter/constants-ByqmFATV.js +0 -31
  31. package/components/DynamicFilter/dictionary-D9Z9YGDb.js +0 -51
  32. package/components/DynamicFilter/index-CRmtRWlr.js +0 -116
  33. package/components/DynamicFilter/slots/SlotsEnum-cawFeNzx.js +0 -34
  34. package/components/DynamicFilter/slots/dynamicFilterSlots-CQiB8TmY.js +0 -151
  35. package/components/DynamicFilter/slots/index-l0sNRNKZ.js +0 -1
  36. package/components/DynamicFilter/store/index-DoIifWTk.js +0 -254
  37. package/components/DynamicFilter/subcomponents/AppliedFilterChip/index-DQESCg04.js +0 -60
  38. package/components/DynamicFilter/subcomponents/AppliedFilters/index-CGmflaoY.js +0 -26
  39. package/components/DynamicFilter/subcomponents/DynamicFilterBase/index-BfH6YHNi.js +0 -40
  40. package/components/DynamicFilter/subcomponents/FieldTypes/BooleanFilter/index-Dv3KjuYK.js +0 -129
  41. package/components/DynamicFilter/subcomponents/FieldTypes/DateTimeFilter/index-BnhNICK4.js +0 -171
  42. package/components/DynamicFilter/subcomponents/FieldTypes/NumberFilter/index-CNN6DeHY.js +0 -153
  43. package/components/DynamicFilter/subcomponents/FieldTypes/SelectFilter/index-C2dNPFtM.js +0 -146
  44. package/components/DynamicFilter/subcomponents/FieldTypes/StringFilter/index-B03ahaU6.js +0 -114
  45. package/components/DynamicFilter/subcomponents/FieldTypes/index-EF7A6WnZ.js +0 -38
  46. package/components/DynamicFilter/subcomponents/FilterActions/index-CQtA2ELu.js +0 -88
  47. package/components/DynamicFilter/subcomponents/InputFilter/index-EXbXDSZA.js +0 -188
  48. package/components/DynamicFilter/subcomponents/PopoverFilter/index-BX8YCh9v.js +0 -158
  49. package/components/DynamicFilter/subcomponents/PopoverMenuFields/index-DvAYf5-a.js +0 -63
  50. package/components/FieldLabel/index-C8od8D0w.js +0 -54
  51. package/components/GridLayout/index-EPw3AYiQ.js +0 -1044
  52. package/components/GridLayout/subcomponents/Griditem/index-B8Q7iMhr.js +0 -395
  53. package/components/GridLayout/subcomponents/Responsive/index-D6BbBdVx.js +0 -348
  54. package/components/GridLayout/subcomponents/SizeProvider/index-OhbtnEN4.js +0 -71
  55. package/components/HelperText/index-sLK3dYG0.js +0 -50
  56. package/components/Icon/index-BJF_0F6d.js +0 -176
  57. package/components/Image/index-BxphCFC7.js +0 -175
  58. package/components/LanguagePopover/index-CkKie1Ph.js +0 -179
  59. package/components/LinearProgressIndeterminate/index-CTvXOPRx.js +0 -55
  60. package/components/Loadable/index-BMbi9ISF.js +0 -9
  61. package/components/LoadingError/index-BaaPhmyF.js +0 -89
  62. package/components/MFIsolationApp/index-BfHLGDcN.js +0 -169
  63. package/components/MFLoader/index-B8FmSpE7.js +0 -299
  64. package/components/ModalDialog/index-WSVr5sZr.js +0 -77
  65. package/components/NavLink/index-CKgi5l5M.js +0 -55
  66. package/components/NoItemSelected/index-BKsZKc_f.js +0 -54
  67. package/components/ObjectLogs/index-BJkjYQaa.js +0 -233
  68. package/components/PDFViewer/index-Cnbioqzo.js +0 -51
  69. package/components/Page/index-DSSwuNSp.js +0 -117
  70. package/components/PaperForm/index-C1OKDnuY.js +0 -59
  71. package/components/Period/index-DYE7Bj45.js +0 -238
  72. package/components/PrintingSystem/index-BkfHXcTV.js +0 -187
  73. package/components/PrintingSystem/subcomponents/BodyNode/index-Btg2zXVQ.js +0 -49
  74. package/components/PrintingSystem/subcomponents/ChartNode/index-GLjhqKd2.js +0 -105
  75. package/components/PrintingSystem/subcomponents/DividerNode/index-D9T1MWQd.js +0 -20
  76. package/components/PrintingSystem/subcomponents/FooterNode/index-C3LET1ZY.js +0 -49
  77. package/components/PrintingSystem/subcomponents/GridNode/index-BPz7lGvC.js +0 -74
  78. package/components/PrintingSystem/subcomponents/HeaderNode/index-DY4Yci1r.js +0 -49
  79. package/components/PrintingSystem/subcomponents/PaperNode/index-BYoGJll5.js +0 -30
  80. package/components/PrintingSystem/subcomponents/PropertyValueNode/index-vFZ5Skyl.js +0 -47
  81. package/components/PrintingSystem/subcomponents/SectionNode/index-BNqGWpcj.js +0 -49
  82. package/components/PrintingSystem/subcomponents/TextBoxNode/index-wgdfWbfF.js +0 -24
  83. package/components/PropertyValue/index-dwO3Qo0Y.js +0 -264
  84. package/components/Resizeable/index-CHseEYjL.js +0 -20
  85. package/components/ScrollBar/index-BYMy_qJE.js +0 -35
  86. package/components/ScrollToTop/index-TxORk5dB.js +0 -12
  87. package/components/SideBar/index-DqKD_S9_.js +0 -758
  88. package/components/SplitLayout/index-D4lxi0ig.js +0 -89
  89. package/components/ToastContainer/index-jnQcIcV1.js +0 -191
  90. package/components/WrapperComponent/index-BHV-CsDU.js +0 -14
  91. package/components/animate/LoadingScreen/index-CTGGa4Yt.js +0 -70
  92. package/components/animate/MotionContainer/index-eartnWyO.js +0 -34
  93. package/components/animate/MotionLazyContainer/index-Be8osTiG.js +0 -9
  94. package/components/animate/PropagateLoader/index-Bkq8V2SN.js +0 -23
  95. package/components/animate/features-BbnE33u3.js +0 -5
  96. package/components/animate/index-9dC9NmWv.js +0 -89
  97. package/components/animate/variants/bounce-DanQqHAX.js +0 -101
  98. package/components/animate/variants/container-Dmpr6tg5.js +0 -22
  99. package/components/animate/variants/fade-CAOJNn06.js +0 -65
  100. package/components/animate/variants/index-l0sNRNKZ.js +0 -1
  101. package/components/animate/variants/transition-B9W5SWTa.js +0 -20
  102. package/components/areas/components/AreasAdmin/index-BU9AX60_.js +0 -699
  103. package/components/areas/components/AreasViewer/index-CPlZxIzK.js +0 -805
  104. package/components/areas/components/index-l0sNRNKZ.js +0 -1
  105. package/components/areas/constants-rqODZNZe.js +0 -6
  106. package/components/areas/contexts/AreasContext/index-DGguLxcX.js +0 -1110
  107. package/components/areas/contexts/DynamicMFParmsContext/index-22c6E7vK.js +0 -36
  108. package/components/areas/contexts/WindowToolsMFContext/index-DkE30fhm.js +0 -12
  109. package/components/areas/contexts/index-l0sNRNKZ.js +0 -1
  110. package/components/areas/dictionary-YUsP9beq.js +0 -36
  111. package/components/areas/hooks/index-l0sNRNKZ.js +0 -1
  112. package/components/areas/hooks/useAreas/index-DBXtbtIu.js +0 -11
  113. package/components/areas/hooks/useDynamicMFParameters/index-DhbcZPs9.js +0 -12
  114. package/components/areas/hooks/useSetWindowsTitle/useSetWindowsTitle-BzPD-miW.js +0 -31
  115. package/components/areas/hooks/useWindowToolsMF/index-BECQfhbC.js +0 -10
  116. package/components/areas/icons-CwFr-alN.js +0 -24
  117. package/components/areas/index-B_Odny9h.js +0 -22
  118. package/components/commercial/AppBarCommercial/index-faX1fxjn.js +0 -28
  119. package/components/commercial/SectionCommercial/index-Dspd2Hd7.js +0 -56
  120. package/components/commercial/TopBar/index-zACdM_C0.js +0 -232
  121. package/components/commercial/index-9P0yOdH4.js +0 -81
  122. package/components/formatters/BooleanFormatter/index-PoFZ3r_m.js +0 -44
  123. package/components/formatters/DateFormatter/index-CGcRZ8BA.js +0 -43
  124. package/components/formatters/PointsFormatter/index-C7sR8iqk.js +0 -25
  125. package/components/formatters/PriceFormatter/index-CsvRawmc.js +0 -35
  126. package/components/formatters/UncertaintyFormatter/index-B9ESVEVp.js +0 -29
  127. package/components/formatters/index-CEJ6VCMb.js +0 -109
  128. package/components/hook-form/HelperError/index-DRvAkpwm.js +0 -19
  129. package/components/hook-form/RHFAutocomplete/index-DS57m8AX.js +0 -657
  130. package/components/hook-form/RHFAutocompleteAsync/index-Bu6NYmG_.js +0 -226
  131. package/components/hook-form/RHFCheckbox/index-BsB42rRc.js +0 -132
  132. package/components/hook-form/RHFColorPicker/index-Dox0FPrV.js +0 -191
  133. package/components/hook-form/RHFDateTime/index-ef19Az1N.js +0 -190
  134. package/components/hook-form/RHFMultiCheckbox/index-BARudV1A.js +0 -34
  135. package/components/hook-form/RHFPeriod/index-DyRLTD0w.js +0 -98
  136. package/components/hook-form/RHFRadioGroup/index-pgTLVF9t.js +0 -52
  137. package/components/hook-form/RHFSelect/index-LdwRuFz-.js +0 -29
  138. package/components/hook-form/RHFTextField/index-BgsElxUF.js +0 -337
  139. package/components/hook-form/RHFUpload/index-B6m3ypzh.js +0 -253
  140. package/components/maps/components/GpsTools/index-CeLi75XZ.js +0 -1948
  141. package/components/maps/components/Map/index-D4B8Lfgv.js +0 -2545
  142. package/components/maps/index-Ci-7-FHg.js +0 -7
  143. package/components/modal/WindowBase-CkftshqR.js +0 -44
  144. package/components/modal/WindowConfirm-C5YnzF-B.js +0 -73
  145. package/components/modal/index-CydPIpKZ.js +0 -65
  146. package/components/mui_extended/Accordion/index-jF2uxSmi.js +0 -124
  147. package/components/mui_extended/Avatar/index-CHmsrmfc.js +0 -64
  148. package/components/mui_extended/Badge/index-B_BGIjkQ.js +0 -29
  149. package/components/mui_extended/BoxIcon/index-BUTJ2tKw.js +0 -22
  150. package/components/mui_extended/Breadcrumbs/index-DTS7rOZH.js +0 -86
  151. package/components/mui_extended/Button/index-CgvCim_g.js +0 -222
  152. package/components/mui_extended/CheckBox-H73kpinr.js +0 -76
  153. package/components/mui_extended/CircularProgress/index-Bnnti_G6.js +0 -8
  154. package/components/mui_extended/IconButton/classes/constants-ChY2jKkp.js +0 -4
  155. package/components/mui_extended/IconButton/classes/index-BxjJGAqZ.js +0 -45
  156. package/components/mui_extended/IconButton/index-B8lOMybH.js +0 -117
  157. package/components/mui_extended/IconButton/styledIconButton-fAsbGoFS.js +0 -7
  158. package/components/mui_extended/IconButton/types-l0sNRNKZ.js +0 -1
  159. package/components/mui_extended/LinearProgress/index-CGgW8jq2.js +0 -9
  160. package/components/mui_extended/LinkWithRoute/index-BC2miUjR.js +0 -15
  161. package/components/mui_extended/MenuActions/MenuActions-DA_aS7o5.js +0 -149
  162. package/components/mui_extended/MenuActions/constants-BwsU9chA.js +0 -10
  163. package/components/mui_extended/MenuActions/dictionary-Dj_07puT.js +0 -11
  164. package/components/mui_extended/MenuActions/slots/MenuActionsEnum-Bu-L6eWU.js +0 -13
  165. package/components/mui_extended/MenuActions/slots/MenuActionsSlots-BVp0M8fu.js +0 -47
  166. package/components/mui_extended/Pager/index-Dtk4aUiU.js +0 -257
  167. package/components/mui_extended/Popover/index-Dl1PwIS2.js +0 -153
  168. package/components/mui_extended/Stack/index-CRzpVi2a.js +0 -31
  169. package/components/mui_extended/Tab/index-DmrsMLOq.js +0 -129
  170. package/components/mui_extended/ToggleButton/index-CAnHC1N-.js +0 -18
  171. package/components/mui_extended/Tooltip/index-B8QUytCK.js +0 -42
  172. package/components/mui_extended/Typography/index-DXq1fG8k.js +0 -54
  173. package/components/mui_extended/index-l0sNRNKZ.js +0 -1
  174. package/components/popups/PopupsProvider/index-DhSxmtfJ.js +0 -172
  175. package/components/popups/PopupsViewer/constants-DuyD7aCn.js +0 -4
  176. package/components/popups/PopupsViewer/icons-BUujqqbu.js +0 -7
  177. package/components/popups/PopupsViewer/index-CMI1SK_O.js +0 -172
  178. package/components/popups/PopupsViewer/slots/index-B98CiRLa.js +0 -14
  179. package/components/popups/PopupsViewer/slots/popupsViewerSlots-DOkmuvnx.js +0 -46
  180. package/components/popups/index-l0sNRNKZ.js +0 -1
  181. package/contexts/ModalContext/index-Bp_s1qUm.js +0 -39
  182. package/contexts/RHFormContext/index-BQ0XWrpK.js +0 -78
  183. package/hocs/withToggle/index-C1_DMZD3.js +0 -14
  184. package/hooks/useFormAddEdit/index-dLVQB7hC.js +0 -90
  185. package/hooks/useFormReadyForUpdate/index-B3HygFCM.js +0 -20
  186. package/hooks/useModal/index-69rbrQ0v.js +0 -10
  187. package/hooks/useSizeContainer/index-D4hDjM1P.js +0 -37
  188. package/hooks/useStateRef/index-C3P6ZK3m.js +0 -15
  189. package/hooks/useTab/index-DYRxOmMI.js +0 -12
  190. package/react-data-grid-BfYuZ6AK.js +0 -2606
  191. package/react-draggable-DsCPdgQP.js +0 -811
  192. package/react-json-view-bhqIAaNg.js +0 -2576
  193. package/react-resizable-eBbFl2dX.js +0 -618
  194. package/react-spinners-TpKN9lZg.js +0 -123
  195. package/react-splitter-layout-C-JTsNGs.js +0 -158
  196. package/styles/DynamicFilter-CJFsIegc.js +0 -319
  197. package/styles/MenuActions-lTi-ynPM.js +0 -42
  198. package/styles/index-CqpubQQr.js +0 -1691
  199. package/test/constants_no_mock-CF-669v-.js +0 -4
  200. package/test/getNameDataTestId-BaBTWhBr.js +0 -10
  201. package/utils/index-DiMrtgIu.js +0 -502
  202. /package/components/GridLayout/subcomponents/{Griditem → GridItem}/index.d.ts +0 -0
  203. /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-CqpubQQr.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-DBXtbtIu.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-B8lOMybH.js";
16
- import { L as LinearProgressIndeterminate } from "../../../LinearProgressIndeterminate/index-CTvXOPRx.js";
17
- import { a as MemonizedMenuActions } from "../../../mui_extended/MenuActions/MenuActions-DA_aS7o5.js";
18
- import { I as Icon } from "../../../Icon/index-BJF_0F6d.js";
19
- import { T as Typography } from "../../../mui_extended/Typography/index-DXq1fG8k.js";
20
- import { M as MFLoader } from "../../../MFLoader/index-B8FmSpE7.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-jnQcIcV1.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-DGguLxcX.js";
27
- import { w as withSizeProvider } from "../../../GridLayout/subcomponents/SizeProvider/index-OhbtnEN4.js";
28
- import { R as Responsive } from "../../../GridLayout/subcomponents/Responsive/index-D6BbBdVx.js";
29
- import { useLocation } from "react-router-dom";
30
- import { L as LoadingError } from "../../../LoadingError/index-BaaPhmyF.js";
31
- import { a as Draggable } from "../../../../react-draggable-DsCPdgQP.js";
32
- import { R as ResizeableWindow } from "../../../Resizeable/index-CHseEYjL.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
- };