@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,699 +0,0 @@
1
- import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
- import { u as useAreasStore } from "../../hooks/useAreas/index-DBXtbtIu.js";
3
- import { useEnvironment, useModuleDictionary } from "@m4l/core";
4
- import { useState, useRef, useMemo } from "react";
5
- import * as Yup from "yup";
6
- import clsx from "clsx";
7
- import { generateUtilityClasses, useTheme } 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_ADMIN_CLASS_NAME } from "../../constants-rqODZNZe.js";
11
- import { I as ICONS } from "../../icons-CwFr-alN.js";
12
- import { g as getAreasDictionary, D as DICCTIONARY } from "../../dictionary-YUsP9beq.js";
13
- import { a6 as EditAreaHeader, a7 as AreasAdminRoot } from "../../../../styles/index-CqpubQQr.js";
14
- import { useResponsiveDesktop } from "@m4l/graphics";
15
- import { shallow } from "zustand/shallow";
16
- import { M as MenuActions } from "../../../mui_extended/MenuActions/MenuActions-DA_aS7o5.js";
17
- import { R as RHFormProvider } from "../../../../contexts/RHFormContext/index-BQ0XWrpK.js";
18
- import { R as RHFTextField } from "../../../hook-form/RHFTextField/index-BgsElxUF.js";
19
- import { A as Actions } from "../../../CommonActions/components/Actions/index-90JsZTzb.js";
20
- import { A as ActionCancel } from "../../../CommonActions/components/ActionCancel/index-DSVEMl41.js";
21
- import { A as ActionIntro } from "../../../CommonActions/components/ActionIntro/index-BNIG3KAH.js";
22
- import { I as IconButton } from "../../../mui_extended/IconButton/index-B8lOMybH.js";
23
- import { P as Popover } from "../../../mui_extended/Popover/index-Dl1PwIS2.js";
24
- import { T as Typography } from "../../../mui_extended/Typography/index-DXq1fG8k.js";
25
- import { S as ScrollBar } from "../../../ScrollBar/index-BYMy_qJE.js";
26
- import TouchRipple from "@mui/material/ButtonBase/TouchRipple";
27
- import { B as Button } from "../../../mui_extended/Button/index-CgvCim_g.js";
28
- import { I as Icon } from "../../../Icon/index-BJF_0F6d.js";
29
- import { u as useOnClickOutside } from "../../index-B_Odny9h.js";
30
- const areasAdminClasses = generateUtilityClasses(
31
- AREAS_ADMIN_CLASS_NAME,
32
- [
33
- /* elements */
34
- "root",
35
- "rootContent",
36
- "areaChipRoot",
37
- "areaChipTitle",
38
- "areaChipDeleteButton",
39
- "areasAddButton",
40
- "areaContainerChipEditButton",
41
- "areaContainerChips",
42
- "areaContainerContentChips",
43
- "areaContainerChipsIcon",
44
- "areaEditPopover",
45
- "areaChipMobileRoot",
46
- "areaChipMobileIconContainer",
47
- "areaIconLayer",
48
- "areaIconLayerContent",
49
- "areaChipEditButton",
50
- "areasPopoverMobileOptions",
51
- "areasPopoverListWindows",
52
- "areasPopoverListWindowsIcon",
53
- "areaContentChips",
54
- /* states or variants of elements */
55
- "selected",
56
- "isMobile",
57
- "disabled",
58
- "isFocus"
59
- ],
60
- AREAS_ADMIN_CLASS_NAME
61
- );
62
- const useAreasAdminUtilityClasses = (ownerState) => {
63
- const slots = {
64
- root: [
65
- "root",
66
- ownerState.status,
67
- ownerState.isMobile && "isMobile",
68
- ownerState.isSkeleton && "isSkeleton",
69
- ownerState.focus && "isFocus"
70
- ],
71
- rootContent: ["rootContent"],
72
- areaChipRoot: ["areaChipRoot"],
73
- areaIconLayer: ["areaIconLayer"],
74
- areaContainerChipsIcon: ["areaContainerChipsIcon"],
75
- areaContainerChips: ["areaContainerChips"],
76
- areaContainerContentChips: ["areaContainerContentChips"],
77
- areaEditPopover: ["areaEditPopover"],
78
- areaChipMobileRoot: ["areaChipMobileRoot"],
79
- areaChipMobileIconContainer: ["areaChipMobileIconContainer"],
80
- areaChipTitle: ["areaChipTitle"],
81
- areaContainerChipEditButton: ["areaContainerChipEditButton"],
82
- areaChipDeleteButton: ["areaChipDeleteButton"],
83
- areaChipEditButton: ["areaChipEditButton"],
84
- areasAddButton: ["areasAddButton"],
85
- areasPopoverMobileOptions: ["areasPopoverMobileOptions"],
86
- areasPopoverListWindows: ["areasPopoverListWindows"],
87
- areasPopoverListWindowsIcon: ["areasPopoverListWindowsIcon"],
88
- areaContentChips: ["areaContentChips"]
89
- };
90
- return unstable_composeClasses(slots, getComponentUtilityClass(AREAS_ADMIN_CLASS_NAME), {});
91
- };
92
- const ChipActionsMobile = (props) => {
93
- const { handlerOpenPopoverEditArea, areaId } = props;
94
- const { deleteArea } = useAreasStore((state) => state.areasActions);
95
- const { setFocus } = useAreasStore((state) => state.areaAdminActions, shallow);
96
- const listAreas = useAreasStore((state) => state.areasIds, shallow);
97
- const { host_static_assets, environment_assets } = useEnvironment();
98
- const { getLabel } = useModuleDictionary();
99
- const menuActions = [
100
- {
101
- urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.EDIT_AREA}`,
102
- onClick: handlerOpenPopoverEditArea,
103
- label: getLabel(getAreasDictionary(DICCTIONARY.label_edit_area))
104
- }
105
- ];
106
- if (listAreas.length > 1) {
107
- menuActions.push({
108
- urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.DELETE_AREA}`,
109
- onClick: () => {
110
- deleteArea(areaId);
111
- setFocus(false);
112
- },
113
- label: getLabel(getAreasDictionary(DICCTIONARY.label_delete_area))
114
- });
115
- }
116
- return /* @__PURE__ */ jsx(
117
- MenuActions,
118
- {
119
- urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.SHOW_OPTIONS}`,
120
- arrowType: "no-arrow",
121
- marginTop: "12px",
122
- anchorOrigin: { vertical: "bottom", horizontal: "right" },
123
- transformOrigin: { vertical: "top", horizontal: "right" },
124
- menuActions,
125
- externalClose: () => setFocus(false)
126
- }
127
- );
128
- };
129
- const AreaChip = (props) => {
130
- const { areaId, selected, disabled, setAnchorMenuAreas } = props;
131
- const { host_static_assets, environment_assets } = useEnvironment();
132
- const { deleteArea, selectArea, editArea } = useAreasStore((state) => state.areasActions);
133
- const { setFocus } = useAreasStore((state) => state.areaAdminActions);
134
- const areaName = useAreasStore((state) => state.hashAreas[areaId].name, shallow);
135
- const listAreas = useAreasStore((state) => state.areasIds, shallow);
136
- const [open, setOpen] = useState(false);
137
- const { getLabel } = useModuleDictionary();
138
- const isDesktop = useResponsiveDesktop();
139
- const anchorRef = useRef(null);
140
- const theme = useTheme();
141
- const onClickDeleteArea = (e) => {
142
- if (listAreas.length > 1) {
143
- e.stopPropagation();
144
- setFocus(true);
145
- deleteArea(areaId);
146
- }
147
- };
148
- const onSubmit = (data) => {
149
- editArea(areaId, data.inputEditArea);
150
- setOpen(false);
151
- setFocus(false);
152
- };
153
- const handlerOpenPopoverEditArea = (e) => {
154
- e?.stopPropagation();
155
- setFocus(true);
156
- setOpen(true);
157
- };
158
- const initialValues = {
159
- inputEditArea: areaName
160
- };
161
- const validationSchema = useMemo(
162
- () => Yup.object().shape({
163
- inputEditArea: Yup.string().required(
164
- getLabel(getAreasDictionary(DICCTIONARY.validation_edit_area))
165
- )
166
- }),
167
- [getLabel]
168
- );
169
- const handlerOnClick = (e) => {
170
- setAnchorMenuAreas && setAnchorMenuAreas(e.currentTarget);
171
- selectArea(areaId);
172
- };
173
- const rippleRef = useRef(null);
174
- const onRippleStart = (e) => {
175
- if (rippleRef.current) {
176
- rippleRef.current.start(e);
177
- }
178
- };
179
- const onRippleStop = (e) => {
180
- if (rippleRef.current) {
181
- rippleRef.current.stop(e);
182
- }
183
- };
184
- return /* @__PURE__ */ jsxs(Fragment, { children: [
185
- /* @__PURE__ */ jsxs(
186
- "div",
187
- {
188
- role: "presentation",
189
- ref: anchorRef,
190
- onMouseDown: onRippleStart,
191
- onMouseUp: onRippleStop,
192
- className: clsx(
193
- areasAdminClasses.areaChipRoot,
194
- selected ? areasAdminClasses.selected : null,
195
- disabled ? areasAdminClasses.disabled : null
196
- ),
197
- onClick: (e) => {
198
- handlerOnClick(e);
199
- },
200
- children: [
201
- /* @__PURE__ */ jsx("div", { className: areasAdminClasses.areaChipTitle, children: areaName }),
202
- isDesktop ? /* @__PURE__ */ jsxs("div", { className: areasAdminClasses.areaContainerChipEditButton, children: [
203
- /* @__PURE__ */ jsx(
204
- IconButton,
205
- {
206
- className: areasAdminClasses.areaChipEditButton,
207
- src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.EDIT_AREA}`,
208
- size: "small",
209
- onClick: (e) => {
210
- handlerOpenPopoverEditArea(e);
211
- },
212
- tooltip: getLabel(getAreasDictionary(DICCTIONARY.label_edit_area))
213
- }
214
- ),
215
- /* @__PURE__ */ jsx(
216
- IconButton,
217
- {
218
- className: areasAdminClasses.areaChipDeleteButton,
219
- src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.DELETE_AREA}`,
220
- size: "small",
221
- onClick: (e) => {
222
- onClickDeleteArea(e);
223
- },
224
- tooltip: getLabel(getAreasDictionary(DICCTIONARY.label_delete_area))
225
- }
226
- )
227
- ] }) : /* @__PURE__ */ jsx(
228
- ChipActionsMobile,
229
- {
230
- areaId,
231
- handlerOpenPopoverEditArea
232
- }
233
- )
234
- ]
235
- }
236
- ),
237
- /* @__PURE__ */ jsx(
238
- "div",
239
- {
240
- role: "presentation",
241
- onClick: (e) => {
242
- e.stopPropagation();
243
- },
244
- children: /* @__PURE__ */ jsx(
245
- Popover,
246
- {
247
- arrowType: "top-center",
248
- open,
249
- className: areasAdminClasses.areaEditPopover,
250
- anchorEl: anchorRef.current,
251
- anchorOrigin: { vertical: "bottom", horizontal: "center" },
252
- transformOrigin: { vertical: "top", horizontal: "center" },
253
- onClose: () => {
254
- setFocus(false);
255
- setOpen(false);
256
- },
257
- sx: {
258
- mt: "10px",
259
- ...theme.components?.M4LAreasAdminEditPopover?.styleOverrides
260
- },
261
- children: /* @__PURE__ */ jsxs(
262
- RHFormProvider,
263
- {
264
- onSubmit,
265
- values: initialValues,
266
- validationSchema,
267
- children: [
268
- /* @__PURE__ */ jsxs(EditAreaHeader, { children: [
269
- /* @__PURE__ */ jsx(Typography, { children: getLabel(getAreasDictionary(DICCTIONARY.label_edit_area)) }),
270
- /* @__PURE__ */ jsx(
271
- IconButton,
272
- {
273
- src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.CLOSE}`,
274
- size: "small",
275
- onClick: () => {
276
- setFocus(false);
277
- setOpen(false);
278
- }
279
- }
280
- )
281
- ] }),
282
- /* @__PURE__ */ jsx(
283
- RHFTextField,
284
- {
285
- name: "inputEditArea",
286
- skeletonWidth: "70%",
287
- skeletonHeight: "18px",
288
- sx: { mt: "20px" }
289
- }
290
- ),
291
- /* @__PURE__ */ jsxs(Actions, { children: [
292
- /* @__PURE__ */ jsx(
293
- ActionCancel,
294
- {
295
- onClick: () => {
296
- setOpen(false);
297
- setFocus(false);
298
- },
299
- variant: "outlined",
300
- skeletonWidth: "100%"
301
- }
302
- ),
303
- /* @__PURE__ */ jsx(ActionIntro, { skeletonWidth: "100%" })
304
- ] })
305
- ]
306
- }
307
- )
308
- }
309
- )
310
- }
311
- )
312
- ] });
313
- };
314
- AreaChip.displayName = "AreaButtons";
315
- const ChipMobile = (props) => {
316
- const { areaId, selected, disabled, setAnchorMenuAreas } = props;
317
- const { host_static_assets, environment_assets } = useEnvironment();
318
- const { deleteArea, selectArea, editArea } = useAreasStore((state) => state.areasActions);
319
- const { setFocus } = useAreasStore((state) => state.areaAdminActions);
320
- const areaName = useAreasStore((state) => state.hashAreas[areaId].name, shallow);
321
- const listAreas = useAreasStore((state) => state.areasIds, shallow);
322
- const [open, setOpen] = useState(false);
323
- const { getLabel } = useModuleDictionary();
324
- const isDesktop = useResponsiveDesktop();
325
- const anchorRef = useRef(null);
326
- const theme = useTheme();
327
- const onClickDeleteArea = (e) => {
328
- if (listAreas.length > 1) {
329
- e.stopPropagation();
330
- setFocus(true);
331
- deleteArea(areaId);
332
- }
333
- };
334
- const onSubmit = (data) => {
335
- editArea(areaId, data.inputEditArea);
336
- setOpen(false);
337
- setFocus(false);
338
- };
339
- const handlerOpenPopoverEditArea = (e) => {
340
- e?.stopPropagation();
341
- setFocus(true);
342
- setOpen(true);
343
- };
344
- const initialValues = {
345
- inputEditArea: areaName
346
- };
347
- const validationSchema = useMemo(
348
- () => Yup.object().shape({
349
- inputEditArea: Yup.string().required(
350
- getLabel(getAreasDictionary(DICCTIONARY.validation_edit_area))
351
- )
352
- }),
353
- [getLabel]
354
- );
355
- const handlerOnClick = (e) => {
356
- setAnchorMenuAreas && setAnchorMenuAreas(e.currentTarget);
357
- selectArea(areaId);
358
- };
359
- const rippleRef = useRef(null);
360
- const onRippleStart = (e) => {
361
- if (rippleRef.current) {
362
- rippleRef.current.start(e);
363
- }
364
- };
365
- const onRippleStop = (e) => {
366
- if (rippleRef.current) {
367
- rippleRef.current.stop(e);
368
- }
369
- };
370
- return /* @__PURE__ */ jsxs(Fragment, { children: [
371
- /* @__PURE__ */ jsxs(
372
- "div",
373
- {
374
- role: "presentation",
375
- ref: anchorRef,
376
- onMouseDown: onRippleStart,
377
- onMouseUp: onRippleStop,
378
- className: clsx(
379
- areasAdminClasses.areaChipRoot,
380
- selected ? areasAdminClasses.selected : null,
381
- disabled ? areasAdminClasses.disabled : null
382
- ),
383
- onClick: (e) => {
384
- handlerOnClick(e);
385
- },
386
- children: [
387
- /* @__PURE__ */ jsx(TouchRipple, { ref: rippleRef, center: false, style: { position: "absolute", inset: "0" } }),
388
- /* @__PURE__ */ jsx("div", { className: areasAdminClasses.areaChipTitle, children: areaName })
389
- ]
390
- }
391
- ),
392
- isDesktop ? /* @__PURE__ */ jsxs("div", { className: areasAdminClasses.areaContainerChipEditButton, children: [
393
- /* @__PURE__ */ jsx(
394
- IconButton,
395
- {
396
- className: areasAdminClasses.areaChipEditButton,
397
- src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.EDIT_AREA}`,
398
- size: "small",
399
- onClick: (e) => {
400
- handlerOpenPopoverEditArea(e);
401
- }
402
- }
403
- ),
404
- /* @__PURE__ */ jsx(
405
- IconButton,
406
- {
407
- className: areasAdminClasses.areaChipDeleteButton,
408
- src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.DELETE_AREA}`,
409
- size: "small",
410
- onClick: (e) => {
411
- onClickDeleteArea(e);
412
- }
413
- }
414
- )
415
- ] }) : /* @__PURE__ */ jsx(
416
- ChipActionsMobile,
417
- {
418
- areaId,
419
- handlerOpenPopoverEditArea
420
- }
421
- ),
422
- /* @__PURE__ */ jsx(
423
- "div",
424
- {
425
- role: "presentation",
426
- onClick: (e) => {
427
- e.stopPropagation();
428
- },
429
- children: /* @__PURE__ */ jsx(
430
- Popover,
431
- {
432
- arrowType: "top-center",
433
- open,
434
- className: areasAdminClasses.areaEditPopover,
435
- anchorEl: anchorRef.current,
436
- anchorOrigin: { vertical: "bottom", horizontal: "center" },
437
- transformOrigin: { vertical: "top", horizontal: "center" },
438
- onClose: () => {
439
- setFocus(false);
440
- setOpen(false);
441
- },
442
- sx: {
443
- mt: "10px",
444
- ...theme.components?.M4LAreasAdminEditPopover?.styleOverrides
445
- },
446
- children: /* @__PURE__ */ jsxs(
447
- RHFormProvider,
448
- {
449
- onSubmit,
450
- values: initialValues,
451
- validationSchema,
452
- children: [
453
- /* @__PURE__ */ jsxs(EditAreaHeader, { children: [
454
- /* @__PURE__ */ jsx(Typography, { children: getLabel(getAreasDictionary(DICCTIONARY.label_edit_area)) }),
455
- /* @__PURE__ */ jsx(
456
- IconButton,
457
- {
458
- src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.CLOSE}`,
459
- size: "small",
460
- onClick: () => {
461
- setFocus(false);
462
- setOpen(false);
463
- }
464
- }
465
- )
466
- ] }),
467
- /* @__PURE__ */ jsx(
468
- RHFTextField,
469
- {
470
- name: "inputEditArea",
471
- skeletonWidth: "70%",
472
- skeletonHeight: "18px",
473
- sx: { mt: "20px" }
474
- }
475
- ),
476
- /* @__PURE__ */ jsxs(Actions, { children: [
477
- /* @__PURE__ */ jsx(
478
- ActionCancel,
479
- {
480
- onClick: () => {
481
- setOpen(false);
482
- setFocus(false);
483
- },
484
- variant: "outlined",
485
- skeletonWidth: "100%"
486
- }
487
- ),
488
- /* @__PURE__ */ jsx(ActionIntro, { skeletonWidth: "100%" })
489
- ] })
490
- ]
491
- }
492
- )
493
- }
494
- )
495
- }
496
- )
497
- ] });
498
- };
499
- ChipMobile.displayName = "AreaButtons";
500
- const AreaChipMobile = () => {
501
- const areas = useAreasStore(
502
- (state) => state.areasIds.map((a) => ({ id: a, name: state.hashAreas[a].name })),
503
- shallow
504
- );
505
- const { selectArea } = useAreasStore((state) => state.areasActions);
506
- const currentAreaId = useAreasStore((state) => state.currentAreaId, shallow);
507
- const { addArea } = useAreasStore((state) => state.areasActions, shallow);
508
- const { setFocus } = useAreasStore((state) => state.areaAdminActions, shallow);
509
- const [anchorMenuAreas, setAnchorMenuAreas] = useState(null);
510
- const { getLabel } = useModuleDictionary();
511
- const theme = useTheme();
512
- const currentArea = areas.find((area) => area.id === currentAreaId);
513
- const { host_static_assets, environment_assets } = useEnvironment();
514
- const menuActions = useMemo(
515
- () => areas.filter((area) => area.id !== currentAreaId).map((area) => {
516
- return {
517
- urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.LAYERS}`,
518
- onClick: () => {
519
- selectArea(area.id);
520
- setFocus(false);
521
- },
522
- label: area.name
523
- };
524
- }),
525
- [areas, currentAreaId]
526
- );
527
- const handlerSetAnchorMenuAreas = (element) => {
528
- setFocus(false);
529
- setAnchorMenuAreas(element);
530
- };
531
- return /* @__PURE__ */ jsx("div", { className: areasAdminClasses.areaChipMobileRoot, children: /* @__PURE__ */ jsxs("div", { className: areasAdminClasses.areaContainerContentChips, children: [
532
- currentArea ? /* @__PURE__ */ jsx(
533
- ChipMobile,
534
- {
535
- areaId: currentArea.id,
536
- selected: true,
537
- disabled: true,
538
- setAnchorMenuAreas
539
- },
540
- currentArea.id
541
- ) : null,
542
- menuActions.length >= 0 ? /* @__PURE__ */ jsx("div", { className: areasAdminClasses.areaChipMobileIconContainer, children: /* @__PURE__ */ jsx(
543
- MenuActions,
544
- {
545
- urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.CHEVRON_DOWN}`,
546
- arrowType: "no-arrow",
547
- marginTop: "12px!important",
548
- marginLeft: "14px!important",
549
- anchorOrigin: { vertical: "bottom", horizontal: "right" },
550
- transformOrigin: { vertical: "top", horizontal: "right" },
551
- menuActions,
552
- externalOpen: anchorMenuAreas,
553
- externalClose: handlerSetAnchorMenuAreas,
554
- className: areasAdminClasses.areasPopoverMobileOptions,
555
- menuActionSx: theme.components?.M4LAreasAdminMobilePopoverOptions?.styleOverrides,
556
- endListElement: /* @__PURE__ */ jsx(
557
- Button,
558
- {
559
- onClick: () => {
560
- addArea();
561
- setAnchorMenuAreas(null);
562
- },
563
- variant: "outlined",
564
- startIcon: /* @__PURE__ */ jsx(
565
- Icon,
566
- {
567
- src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.ADD_AREA}`
568
- }
569
- ),
570
- children: getLabel(getAreasDictionary(DICCTIONARY.area_add_new))
571
- }
572
- )
573
- }
574
- ) }) : null
575
- ] }) });
576
- };
577
- const PanelWindowPopUp = (props) => {
578
- const { currentAreaId } = props;
579
- const { host_static_assets, environment_assets } = useEnvironment();
580
- const windowsLayouts = useAreasStore(
581
- (state) => state.hashAreas[currentAreaId].layoutItemsIds.filter((li) => state.hashWindows[li].emergeType === "layout").map((lim) => {
582
- const w = state.hashWindows[lim];
583
- return {
584
- i: w.windowId,
585
- url_icon: w.url_icon,
586
- title: w.title
587
- };
588
- }),
589
- shallow
590
- );
591
- const theme = useTheme();
592
- const { maximizeLayout } = useAreasStore((state) => state.areaActions);
593
- const onTouched = (layoutId) => {
594
- maximizeLayout(currentAreaId, layoutId);
595
- };
596
- const menuActions = windowsLayouts.map((element) => {
597
- return {
598
- onClick: () => onTouched(element.i),
599
- label: element.title,
600
- urlIcon: element.url_icon
601
- };
602
- });
603
- return menuActions.length > 0 ? /* @__PURE__ */ jsx(
604
- MenuActions,
605
- {
606
- urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.LAYERS}`,
607
- arrowType: "no-arrow",
608
- marginTop: "12px!important",
609
- marginLeft: "14px!important",
610
- anchorOrigin: { vertical: "bottom", horizontal: "right" },
611
- transformOrigin: { vertical: "top", horizontal: "right" },
612
- menuActions,
613
- className: areasAdminClasses.areasPopoverListWindows,
614
- iconButtonClassName: areasAdminClasses.areasPopoverListWindowsIcon,
615
- menuActionSx: theme.components?.M4LAreasAdminMobilePopoverOptions?.styleOverrides
616
- }
617
- ) : null;
618
- };
619
- function AreasAdmin() {
620
- const areas = useAreasStore((state) => state.areasIds, shallow);
621
- const currentArea = useAreasStore((state) => state.currentAreaId, shallow);
622
- const status = useAreasStore((state) => state.ownerState.status);
623
- const { setFocus } = useAreasStore((state) => state.areaAdminActions, shallow);
624
- const classesRoot = useAreasStore((state) => state.adminClasses.root);
625
- const areasLength = useAreasStore((state) => state.areasIds.length);
626
- const isDesktop = useResponsiveDesktop();
627
- const { addArea } = useAreasStore((state) => state.areasActions, shallow);
628
- const maximizedId = useAreasStore(
629
- (state) => state.hashAreas[currentArea] ? state.hashAreas[currentArea].maximizedId : false,
630
- shallow
631
- );
632
- const { host_static_assets, environment_assets } = useEnvironment();
633
- const { getLabel } = useModuleDictionary();
634
- const divRef = useRef(null);
635
- const divRefOut = useRef(null);
636
- const handleClickOutsideFn = () => {
637
- setFocus(false);
638
- };
639
- useOnClickOutside(divRef, handleClickOutsideFn, divRefOut);
640
- const rippleRef = useRef(null);
641
- const onRippleStart = (e) => {
642
- if (rippleRef.current) {
643
- rippleRef.current.start(e);
644
- }
645
- };
646
- const onRippleStop = (e) => {
647
- if (rippleRef.current) {
648
- rippleRef.current.stop(e);
649
- }
650
- };
651
- if (status !== "loaded") {
652
- return null;
653
- }
654
- return /* @__PURE__ */ jsx(
655
- AreasAdminRoot,
656
- {
657
- ref: divRefOut,
658
- onMouseDown: onRippleStart,
659
- onMouseUp: onRippleStop,
660
- className: classesRoot,
661
- children: /* @__PURE__ */ jsxs(
662
- "div",
663
- {
664
- role: "presentation",
665
- ref: divRef,
666
- className: areasAdminClasses.rootContent,
667
- onClick: () => setFocus(true),
668
- children: [
669
- /* @__PURE__ */ jsx("div", { className: areasAdminClasses.areaContainerChipsIcon, children: /* @__PURE__ */ jsx("div", { className: areasAdminClasses.areaContainerChips, children: /* @__PURE__ */ jsx("div", { className: areasAdminClasses.areaContainerContentChips, children: isDesktop ? /* @__PURE__ */ jsx(ScrollBar, { children: /* @__PURE__ */ jsx("div", { className: areasAdminClasses.areaContentChips, children: areas.map((area) => /* @__PURE__ */ jsx(
670
- AreaChip,
671
- {
672
- areaId: area,
673
- selected: area === currentArea,
674
- disabled: areasLength === 1
675
- },
676
- area
677
- )) }) }) : /* @__PURE__ */ jsx(AreaChipMobile, {}) }) }) }),
678
- isDesktop ? /* @__PURE__ */ jsx(
679
- IconButton,
680
- {
681
- className: areasAdminClasses.areasAddButton,
682
- src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.ADD_AREA}`,
683
- size: "small",
684
- onClick: addArea,
685
- tooltip: getLabel(getAreasDictionary(DICCTIONARY.area_add_new))
686
- }
687
- ) : null,
688
- !isDesktop && maximizedId ? /* @__PURE__ */ jsx(PanelWindowPopUp, { currentAreaId: currentArea }) : null
689
- ]
690
- }
691
- )
692
- }
693
- );
694
- }
695
- export {
696
- AreasAdmin as A,
697
- areasAdminClasses as a,
698
- useAreasAdminUtilityClasses as u
699
- };