@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,699 +0,0 @@
1
- import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
- import { u as useAreasStore } from "../../hooks/useAreas/index-BSbwbJLS.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-DKj6m8SL.js";
14
- import { useResponsiveDesktop } from "@m4l/graphics";
15
- import { shallow } from "zustand/shallow";
16
- import { M as MenuActions } from "../../../mui_extended/MenuActions/MenuActions-C6CjSU6C.js";
17
- import { R as RHFormProvider } from "../../../../contexts/RHFormContext/index-D_nK759o.js";
18
- import { R as RHFTextField } from "../../../hook-form/RHFTextField/index-B6ufruSB.js";
19
- import { A as Actions } from "../../../CommonActions/components/Actions/index-CuG1pnXW.js";
20
- import { A as ActionCancel } from "../../../CommonActions/components/ActionCancel/index-CIdpDXkr.js";
21
- import { A as ActionIntro } from "../../../CommonActions/components/ActionIntro/index-CqqDZZcG.js";
22
- import { I as IconButton } from "../../../mui_extended/IconButton/index-CusYFjie.js";
23
- import { P as Popover } from "../../../mui_extended/Popover/index-DfrJAQkV.js";
24
- import { T as Typography } from "../../../mui_extended/Typography/index-Cf_4Zw8f.js";
25
- import { S as ScrollBar } from "../../../ScrollBar/index-f2URPPE2.js";
26
- import TouchRipple from "@mui/material/ButtonBase/TouchRipple";
27
- import { B as Button } from "../../../mui_extended/Button/index-CGfZbaea.js";
28
- import { I as Icon } from "../../../Icon/index-C89MAkeH.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
- };