@m4l/components 0.2.36 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (201) hide show
  1. package/components/AccountPopover/{index.a9dc9f92.js → index.efc74d5c.js} +3 -5
  2. package/components/AppBar/{index.7dee7427.js → index.fc126a22.js} +6 -5
  3. package/components/AppBar/styles.d.ts +1 -1
  4. package/components/CommonActions/components/Actions/styles.d.ts +1 -1
  5. package/components/DataGrid/styles.d.ts +1 -1
  6. package/components/DataGrid/subcomponents/Actions/subcomponents/Settings/subcomponents/ColumnsConfig/styles.d.ts +7 -7
  7. package/components/DragResizeWindow/{index.a9f25040.js → index.46b380e1.js} +3 -6
  8. package/components/DynamicFilter/dynamicFilterSlots.d.ts +76 -101
  9. package/components/DynamicFilter/{index.48d809e2.js → index.d9168c12.js} +22 -96
  10. package/components/FieldLabel/{index.2622ee40.js → index.f9cdcc27.js} +4 -4
  11. package/components/GridLayout/{index.b9c47a4c.js → index.bb3b7769.js} +23 -46
  12. package/components/GridLayout/subcomponents/Griditem/{index.69bc14e5.js → index.bb23f651.js} +4 -3
  13. package/components/GridLayout/subcomponents/Responsive/{index.094c1d09.js → index.b8a2a121.js} +2 -1
  14. package/components/GridLayout/subcomponents/SizeProvider/{index.e1d2df80.js → index.094bc6b5.js} +1 -1
  15. package/components/{commercial/index.b90488db.js → HamburgerMenu/index.5997af31.js} +4 -6
  16. package/components/HelperText/{index.81c5d349.js → index.be949cdf.js} +3 -2
  17. package/components/HelperText/styles.d.ts +1 -1
  18. package/components/Icon/index.d5fed418.js +420 -0
  19. package/components/Icon/styles.d.ts +2 -2
  20. package/components/{hook-form/RHFUpload/index.c5e5c61c.js → Image/index.36a3d440.js} +233 -32
  21. package/components/Image/styles.d.ts +1 -1
  22. package/components/LanguagePopover/{index.72f316fc.js → index.e6fa2336.js} +5 -8
  23. package/components/LanguagePopover/styles.d.ts +5 -5
  24. package/components/LinearProgressIndeterminate/{index.2ecd571e.js → index.de9d447c.js} +2 -4
  25. package/components/Loadable/{index.97fe63f9.js → index.e83cdb4e.js} +1 -1
  26. package/components/LoadingError/{index.7aaba1cf.js → index.9f00c83c.js} +8 -12
  27. package/components/LoadingError/styles.d.ts +1 -1
  28. package/components/MFLoader/{index.40c419c0.js → index.402c1acc.js} +4 -8
  29. package/components/ModalDialog/{index.42349189.js → index.ea9189c3.js} +5 -14
  30. package/components/NavLink/{index.9e847eb5.js → index.4e548cee.js} +4 -4
  31. package/components/NavLink/styles.d.ts +1 -1
  32. package/components/NoItemSelected/{index.5a8160fd.js → index.418c8316.js} +6 -15
  33. package/components/NoItemSelected/styles.d.ts +4 -4
  34. package/components/ObjectLogs/{index.6955149e.js → index.bfa7dad3.js} +10 -27
  35. package/components/ObjectLogs/styles.d.ts +3 -3
  36. package/components/PDFViewer/{index.47bb0928.js → index.bb2eca5a.js} +2 -2
  37. package/components/{mui_extended/Pager/index.1ba2d52b.js → Page/index.fdf04592.js} +134 -26
  38. package/components/PaperForm/{index.9f6fd02d.js → index.8121e3da.js} +8 -7
  39. package/components/PaperForm/styles.d.ts +6 -6
  40. package/components/Period/{index.c6d1a95a.js → index.5233694b.js} +157 -22
  41. package/components/Period/styles.d.ts +5 -5
  42. package/components/PrintingSystem/{index.f51a00f8.js → index.fb176a93.js} +14 -14
  43. package/components/PrintingSystem/subcomponents/BodyNode/{index.6792c353.js → index.c1d61038.js} +1 -1
  44. package/components/PrintingSystem/subcomponents/ChartNode/{index.eec6b4cd.js → index.18bd9bad.js} +1 -1
  45. package/components/PrintingSystem/subcomponents/DividerNode/{index.e58467c9.js → index.67d9f1b4.js} +1 -1
  46. package/components/PrintingSystem/subcomponents/FooterNode/{index.920b75c9.js → index.eaee152a.js} +1 -1
  47. package/components/PrintingSystem/subcomponents/GridNode/{index.6c1ad53c.js → index.f5f63a2a.js} +1 -1
  48. package/components/PrintingSystem/subcomponents/HeaderNode/{index.e8b151ad.js → index.7de4e411.js} +1 -1
  49. package/components/PrintingSystem/subcomponents/PaperNode/{index.bf199422.js → index.f9ccf22b.js} +1 -1
  50. package/components/PrintingSystem/subcomponents/PropertyValueNode/{index.44d436b9.js → index.f2f2e903.js} +1 -1
  51. package/components/PrintingSystem/subcomponents/SectionNode/{index.879cf13d.js → index.540a4b19.js} +1 -1
  52. package/components/PrintingSystem/subcomponents/TextBoxNode/{index.eb6af0ca.js → index.41e7fcb0.js} +1 -1
  53. package/components/PropertyValue/{index.5e59580c.js → index.9572c347.js} +4 -7
  54. package/components/Resizeable/{index.5e8e48b1.js → index.1f0c1359.js} +7 -7
  55. package/components/ResizeableWindow/styles.d.ts +1 -1
  56. package/components/ScrollBar/{index.4b965665.js → index.adf0eade.js} +2 -4
  57. package/components/SideBar/classes/index.d.ts +1 -1
  58. package/components/SideBar/{index.5d1f4a23.js → index.629ba840.js} +24 -26
  59. package/components/SideBar/styles.d.ts +2 -2
  60. package/components/SideBar/subcomponents/ContentGroups/styles.d.ts +3 -3
  61. package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/styles.d.ts +1 -1
  62. package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/subcomponents/NavListSub/subcomponents/NavItemSub/subcomponents/NavItemSubContent/styles.d.ts +2 -18
  63. package/components/SplitLayout/{index.15756f0f.js → index.74091a81.js} +1 -3
  64. package/components/ToastContainer/{index.dbd78941.js → index.f9b507b9.js} +3 -3
  65. package/components/animate/LoadingScreen/{index.1a83615a.js → index.779690a7.js} +3 -5
  66. package/components/animate/PropagateLoader/{index.76d7ea70.js → index.a9da8d00.js} +3 -2
  67. package/components/animate/PropagateLoader/syles.d.ts +1 -1
  68. package/components/animate/{index.87296638.js → index.b8497385.js} +3 -2
  69. package/components/areas/components/AreasAdmin/subcomponents/AreaChip/styles.d.ts +3 -3
  70. package/components/areas/constants.5387d83e.js +412 -0
  71. package/components/areas/contexts/AreasContext/{index.19c7b906.js → index.bb316000.js} +5 -6
  72. package/components/areas/contexts/DynamicMFParmsContext/{index.3d9ad0ad.js → index.37d1d444.js} +2 -2
  73. package/components/areas/contexts/WindowToolsMFContext/{index.992ae7a3.js → index.69d95c15.js} +2 -2
  74. package/components/areas/dictionary.7e74022a.js +286 -0
  75. package/components/areas/hooks/useAreas/{index.cedd30ee.js → index.e24bd74d.js} +1 -1
  76. package/components/areas/hooks/useDynamicMFParameters/{index.9e09e1e3.js → index.03ce6078.js} +1 -1
  77. package/components/areas/hooks/useWindowToolsMF/{index.2fbae9dc.js → index.09801b66.js} +1 -1
  78. package/components/areas/icons.504ec098.js +83 -0
  79. package/components/commercial/HamburgerMenu/styles.d.ts +1 -1
  80. package/components/commercial/SectionCommercial/styles.d.ts +4 -9
  81. package/components/hook-form/RHFAutocomplete/classes/index.d.ts +1 -1
  82. package/components/hook-form/RHFAutocomplete/styles.d.ts +1 -1
  83. package/components/hook-form/RHFAutocomplete/subcomponents/RenderOption/styles.d.ts +1 -1
  84. package/components/hook-form/RHFAutocompleteAsync/styles.d.ts +4 -4
  85. package/components/hook-form/RHFCheckbox/styles.d.ts +2 -10
  86. package/components/hook-form/RHFPeriod/styles.d.ts +1 -1
  87. package/components/hook-form/RHFTextField/styles.d.ts +2 -2
  88. package/components/hook-form/RHFTextField/subcomponents/Skeleton/styles.d.ts +2 -2
  89. package/components/hook-form/RHFTextFieldPassword/styles.d.ts +1 -1
  90. package/components/hook-form/RHFUpload/RHFUploadImage/subcomponents/UploadImage/styles.d.ts +1 -1
  91. package/components/maps/components/GpsTools/{index.4ea69dd1.js → index.75880ce0.js} +14 -136
  92. package/components/maps/components/GpsTools/subcomponents/TabsGpsTools/subcomponents/GeofencesList/styles.d.ts +4 -9
  93. package/components/maps/{components/Map/index.62b7d09b.js → index.8ec46ce4.js} +19 -194
  94. package/components/modal/{WindowBase.2414cd02.js → WindowBase.a3ac7adc.js} +3 -4
  95. package/components/modal/{WindowConfirm.48140481.js → WindowConfirm.e35da619.js} +6 -10
  96. package/components/modal/{index.81eb6def.js → index.a0e30c8b.js} +1 -5
  97. package/components/mui_extended/Accordion/styles.d.ts +3 -3
  98. package/components/mui_extended/Badge/styles.d.ts +1 -1
  99. package/components/mui_extended/Button/styles.d.ts +2 -10
  100. package/components/mui_extended/IconButton/styles.d.ts +1 -1
  101. package/components/mui_extended/ImageButton/styles.d.ts +1 -1
  102. package/components/mui_extended/MenuActions/styles.d.ts +2 -27
  103. package/components/mui_extended/Pager/styles.d.ts +1 -1
  104. package/components/mui_extended/Stack/styles.d.ts +2 -9
  105. package/components/mui_extended/Tab/styles.d.ts +2 -2
  106. package/components/mui_extended/Tabs/styles.d.ts +3 -58
  107. package/components/mui_extended/Typography/styles.d.ts +1 -1
  108. package/components/popups/PopupsProvider/{index.8fb6232a.js → index.18669fb4.js} +1 -1
  109. package/components/popups/PopupsViewer/{index.813854e4.js → index.ba354267.js} +5 -10
  110. package/contexts/ModalContext/{index.45c275cd.js → index.cf02e6bd.js} +1 -1
  111. package/contexts/RHFormContext/{index.bf3a2812.js → index.dc955a09.js} +2 -6
  112. package/hooks/useFormAddEdit/{index.9b27ca02.js → index.f156a2cd.js} +4 -8
  113. package/hooks/useModal/index.ef54bcf2.js +66 -0
  114. package/hooks/useTab/{index.f7973779.js → index.bce8b99e.js} +1 -1
  115. package/index.d.ts +0 -1
  116. package/index.js +276 -360
  117. package/package.json +3 -2
  118. package/{react-draggable.79b4c69a.js → react-draggable.5331add7.js} +1 -1
  119. package/{react-resizable.af1f31c1.js → react-resizable.37bfb965.js} +3 -5
  120. package/test/{getNameDataTestId.0faeade8.js → getNameDataTestId.aee44365.js} +2 -2
  121. package/test/index.6d4b98b9.js +4 -0
  122. package/utils/{index.0718eeac.js → index.9ee4c99a.js} +113 -3
  123. package/vendor.a1ce6777.js +6352 -0
  124. package/assets/Logo/index.109a182d.js +0 -38
  125. package/assets/Logo.d.ts +0 -6
  126. package/components/CommonActions/components/ActionCancel/index.46f636e9.js +0 -12
  127. package/components/CommonActions/components/ActionFormCancel/index.2b0bd50d.js +0 -56
  128. package/components/CommonActions/components/ActionFormIntro/index.4f212c39.js +0 -33
  129. package/components/CommonActions/components/ActionIntro/index.7406bd47.js +0 -25
  130. package/components/CommonActions/components/Actions/index.273645af.js +0 -70
  131. package/components/DataGrid/constants.e334cd50.js +0 -10
  132. package/components/DataGrid/formatters/ColumnBooleanFormatter/index.cee6b676.js +0 -26
  133. package/components/DataGrid/formatters/ColumnConcatenatedValueFormatter/index.708f3fb5.js +0 -22
  134. package/components/DataGrid/formatters/ColumnDateFormatter/index.e00d0cf2.js +0 -19
  135. package/components/DataGrid/formatters/ColumnInteractiveCheckFormatter/index.c064bb07.js +0 -23
  136. package/components/DataGrid/formatters/ColumnNestedValueFormatter/index.880e743b.js +0 -14
  137. package/components/DataGrid/formatters/ColumnPointsFormatter/index.226cc583.js +0 -10
  138. package/components/DataGrid/formatters/ColumnPriceFormatter/index.bf9d9e60.js +0 -10
  139. package/components/DataGrid/formatters/ColumnSetCheckFormatter/index.4045b2f2.js +0 -36
  140. package/components/DataGrid/formatters/ColumnUncertaintyFormatter/index.a87302d1.js +0 -10
  141. package/components/DataGrid/formatters/index.2c2f0ae4.js +0 -1
  142. package/components/DataGrid/index.304437ee.js +0 -917
  143. package/components/DataGrid/subcomponents/Actions/index.f14590d2.js +0 -595
  144. package/components/DataGrid/subcomponents/editors/TextEditor/index.3f0d9e28.js +0 -76
  145. package/components/Icon/index.ee7b85c9.js +0 -192
  146. package/components/Image/index.8cc036b1.js +0 -168
  147. package/components/Page/index.c1d4a319.js +0 -114
  148. package/components/animate/variants/index.7a912140.js +0 -1
  149. package/components/areas/components/AreasAdmin/index.f239c717.js +0 -733
  150. package/components/areas/components/AreasViewer/index.61e0538b.js +0 -1071
  151. package/components/areas/components/index.558684b3.js +0 -1
  152. package/components/areas/constants.66529246.js +0 -6
  153. package/components/areas/contexts/index.24025b97.js +0 -1
  154. package/components/areas/dictionary.08cfc4c9.js +0 -36
  155. package/components/areas/hooks/index.d9dc1e21.js +0 -1
  156. package/components/areas/icons.8266ccc8.js +0 -26
  157. package/components/areas/index.4cc6a221.js +0 -22
  158. package/components/commercial/AppBarCommercial/index.9f654f8e.js +0 -28
  159. package/components/commercial/SectionCommercial/index.3df4685b.js +0 -57
  160. package/components/commercial/TopBar/index.7aeb6ec0.js +0 -234
  161. package/components/formatters/BooleanFormatter/index.0c2d8e35.js +0 -44
  162. package/components/formatters/DateFormatter/index.2ef6f261.js +0 -43
  163. package/components/formatters/PointsFormatter/index.d8a4ee54.js +0 -25
  164. package/components/formatters/PriceFormatter/index.97f75b4b.js +0 -35
  165. package/components/formatters/UncertaintyFormatter/index.c3ffdebc.js +0 -29
  166. package/components/formatters/index.b816c6b6.js +0 -117
  167. package/components/hook-form/HelperError/index.c8b046b7.js +0 -19
  168. package/components/hook-form/RHFAutocomplete/index.ea2ac2b1.js +0 -408
  169. package/components/hook-form/RHFAutocompleteAsync/index.98dcf0de.js +0 -158
  170. package/components/hook-form/RHFCheckbox/index.c32278fa.js +0 -142
  171. package/components/hook-form/RHFColorPicker/index.8c939bfd.js +0 -191
  172. package/components/hook-form/RHFDateTime/index.ac27deab.js +0 -190
  173. package/components/hook-form/RHFMultiCheckbox/index.437e6ba3.js +0 -34
  174. package/components/hook-form/RHFPeriod/index.70cfc422.js +0 -104
  175. package/components/hook-form/RHFRadioGroup/index.11c0add8.js +0 -35
  176. package/components/hook-form/RHFSelect/index.c6c60ecc.js +0 -29
  177. package/components/hook-form/RHFTextField/index.fa97889a.js +0 -325
  178. package/components/maps/index.13bb982c.js +0 -7
  179. package/components/mui_extended/Accordion/index.d08a0361.js +0 -142
  180. package/components/mui_extended/Avatar/index.fb9ad158.js +0 -63
  181. package/components/mui_extended/Badge/index.2a3aef2c.js +0 -30
  182. package/components/mui_extended/BoxIcon/index.d61e7ac5.js +0 -22
  183. package/components/mui_extended/Breadcrumbs/index.4a44883c.js +0 -87
  184. package/components/mui_extended/Button/index.5395d101.js +0 -213
  185. package/components/mui_extended/CheckBox.256169f0.js +0 -76
  186. package/components/mui_extended/CircularProgress/index.967e70b7.js +0 -8
  187. package/components/mui_extended/IconButton/index.b0ee4965.js +0 -119
  188. package/components/mui_extended/LinearProgress/index.4092bb69.js +0 -9
  189. package/components/mui_extended/LinkWithRoute/index.288c51f3.js +0 -15
  190. package/components/mui_extended/MenuActions/index.d92ed0d6.js +0 -175
  191. package/components/mui_extended/Popover/index.4e7340b4.js +0 -142
  192. package/components/mui_extended/Stack/index.fe363ca5.js +0 -31
  193. package/components/mui_extended/Tab/index.c5ad86e2.js +0 -134
  194. package/components/mui_extended/ToggleButton/index.7fbc8614.js +0 -18
  195. package/components/mui_extended/ToggleIconButton/index.0cd347b4.js +0 -24
  196. package/components/mui_extended/Tooltip/index.49bb5ee1.js +0 -40
  197. package/components/mui_extended/Typography/index.a1e774a2.js +0 -54
  198. package/components/mui_extended/index.b606cd9d.js +0 -1
  199. package/hooks/useModal/index.30674bb7.js +0 -11
  200. package/style.css +0 -65
  201. package/test/constants_no_mock.86c553a9.js +0 -4
@@ -1,733 +0,0 @@
1
- import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
- import { u as useAreasStore } from "../../hooks/useAreas/index.cedd30ee.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, styled, useTheme } from "@mui/material";
8
- import { unstable_composeClasses } from "@mui/base";
9
- import { g as getComponentUtilityClass } from "../../../../utils/index.0718eeac.js";
10
- import { A as AREAS_ADMIN_CLASS_NAME } from "../../constants.66529246.js";
11
- import { I as ICONS } from "../../icons.8266ccc8.js";
12
- import { g as getAreasDictionary, D as DICCTIONARY } from "../../dictionary.08cfc4c9.js";
13
- import { useResponsiveDesktop, useResponsiveContainerStore } from "@m4l/graphics";
14
- import { shallow } from "zustand/shallow";
15
- import { M as MenuActions } from "../../../mui_extended/MenuActions/index.d92ed0d6.js";
16
- import { R as RHFormProvider } from "../../../../contexts/RHFormContext/index.bf3a2812.js";
17
- import { R as RHFTextField } from "../../../hook-form/RHFTextField/index.fa97889a.js";
18
- import { A as Actions } from "../../../CommonActions/components/Actions/index.273645af.js";
19
- import { A as ActionCancel } from "../../../CommonActions/components/ActionCancel/index.46f636e9.js";
20
- import { A as ActionIntro } from "../../../CommonActions/components/ActionIntro/index.7406bd47.js";
21
- import { I as IconButton } from "../../../mui_extended/IconButton/index.b0ee4965.js";
22
- import { P as Popover } from "../../../mui_extended/Popover/index.4e7340b4.js";
23
- import { T as Typography } from "../../../mui_extended/Typography/index.a1e774a2.js";
24
- import { S as ScrollBar } from "../../../ScrollBar/index.4b965665.js";
25
- import TouchRipple from "@mui/material/ButtonBase/TouchRipple";
26
- import { B as Button } from "../../../mui_extended/Button/index.5395d101.js";
27
- import { I as Icon } from "../../../Icon/index.ee7b85c9.js";
28
- import { u as useOnClickOutside } from "../../index.4cc6a221.js";
29
- const areasAdminClasses = generateUtilityClasses(
30
- AREAS_ADMIN_CLASS_NAME,
31
- [
32
- "root",
33
- "rootContent",
34
- "areaChipRoot",
35
- "areaChipTitle",
36
- "areaChipDeleteButton",
37
- "areasAddButton",
38
- "areaContainerChipEditButton",
39
- "areaContainerChips",
40
- "areaContainerContentChips",
41
- "areaContainerChipsIcon",
42
- "areaEditPopover",
43
- "areaChipMobileRoot",
44
- "areaChipMobileIconContainer",
45
- "areaIconLayer",
46
- "areaIconLayerContent",
47
- "areaChipEditButton",
48
- "areasPopoverMobileOptions",
49
- "areasPopoverListWindows",
50
- "areasPopoverListWindowsIcon",
51
- "areaContentChips",
52
- "selected",
53
- "isMobile",
54
- "disabled",
55
- "isFocus"
56
- ],
57
- AREAS_ADMIN_CLASS_NAME
58
- );
59
- const useAreasAdminUtilityClasses = (ownerState) => {
60
- const slots = {
61
- root: [
62
- "root",
63
- ownerState.status,
64
- ownerState.isMobile && "isMobile",
65
- ownerState.isSkeleton && "isSkeleton",
66
- ownerState.focus && "isFocus"
67
- ],
68
- rootContent: ["rootContent"],
69
- areaChipRoot: ["areaChipRoot"],
70
- areaIconLayer: ["areaIconLayer"],
71
- areaContainerChipsIcon: ["areaContainerChipsIcon"],
72
- areaContainerChips: ["areaContainerChips"],
73
- areaContainerContentChips: ["areaContainerContentChips"],
74
- areaEditPopover: ["areaEditPopover"],
75
- areaChipMobileRoot: ["areaChipMobileRoot"],
76
- areaChipMobileIconContainer: ["areaChipMobileIconContainer"],
77
- areaChipTitle: ["areaChipTitle"],
78
- areaContainerChipEditButton: ["areaContainerChipEditButton"],
79
- areaChipDeleteButton: ["areaChipDeleteButton"],
80
- areaChipEditButton: ["areaChipEditButton"],
81
- areasAddButton: ["areasAddButton"],
82
- areasPopoverMobileOptions: ["areasPopoverMobileOptions"],
83
- areasPopoverListWindows: ["areasPopoverListWindows"],
84
- areasPopoverListWindowsIcon: ["areasPopoverListWindowsIcon"],
85
- areaContentChips: ["areaContentChips"]
86
- };
87
- return unstable_composeClasses(slots, getComponentUtilityClass(AREAS_ADMIN_CLASS_NAME), {});
88
- };
89
- styled("div")(() => ({
90
- display: "flex",
91
- flexDirection: "row",
92
- border: "1px solid gray",
93
- "&.active": {
94
- border: "1px solid red"
95
- }
96
- }));
97
- styled("div")(({ theme }) => ({
98
- height: "100%",
99
- width: theme.spacing(1),
100
- backgroundColor: theme.palette.background.default,
101
- "&.active": {
102
- backgroundColor: theme.palette.primary.main
103
- }
104
- }));
105
- const EditAreaHeader = styled("div")(({ theme }) => ({
106
- display: "flex",
107
- width: "100%",
108
- height: "25px",
109
- borderBottom: "1px solid",
110
- borderColor: theme.palette.state.default,
111
- justifyContent: "space-between",
112
- alignItems: "center"
113
- }));
114
- const ChipActionsMobile = (props) => {
115
- const { handlerOpenPopoverEditArea, areaId } = props;
116
- const { deleteArea } = useAreasStore((state) => state.areasActions);
117
- const { setFocus } = useAreasStore((state) => state.areaAdminActions, shallow);
118
- const listAreas = useAreasStore((state) => state.areasIds, shallow);
119
- const { host_static_assets, environment_assets } = useEnvironment();
120
- const { getLabel } = useModuleDictionary();
121
- const menuActions = [
122
- {
123
- urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.EDIT_AREA}`,
124
- onClick: handlerOpenPopoverEditArea,
125
- label: getLabel(getAreasDictionary(DICCTIONARY.label_edit_area))
126
- }
127
- ];
128
- if (listAreas.length > 1) {
129
- menuActions.push({
130
- urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.DELETE_AREA}`,
131
- onClick: () => {
132
- deleteArea(areaId);
133
- setFocus(false);
134
- },
135
- label: getLabel(getAreasDictionary(DICCTIONARY.label_delete_area))
136
- });
137
- }
138
- return /* @__PURE__ */ jsx(
139
- MenuActions,
140
- {
141
- urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.SHOW_OPTIONS}`,
142
- arrowType: "no-arrow",
143
- marginTop: "12px",
144
- anchorOrigin: { vertical: "bottom", horizontal: "right" },
145
- transformOrigin: { vertical: "top", horizontal: "right" },
146
- menuActions,
147
- externalClose: () => setFocus(false)
148
- }
149
- );
150
- };
151
- const AreaChip = (props) => {
152
- const { areaId, selected, disabled, setAnchorMenuAreas } = props;
153
- const { host_static_assets, environment_assets } = useEnvironment();
154
- const { deleteArea, selectArea, editArea } = useAreasStore((state) => state.areasActions);
155
- const { setFocus } = useAreasStore((state) => state.areaAdminActions);
156
- const areaName = useAreasStore((state) => state.hashAreas[areaId].name, shallow);
157
- const listAreas = useAreasStore((state) => state.areasIds, shallow);
158
- const [open, setOpen] = useState(false);
159
- const { getLabel } = useModuleDictionary();
160
- const isDesktop = useResponsiveDesktop();
161
- const anchorRef = useRef(null);
162
- const theme = useTheme();
163
- const onClickDeleteArea = (e) => {
164
- if (listAreas.length > 1) {
165
- e.stopPropagation();
166
- setFocus(true);
167
- deleteArea(areaId);
168
- }
169
- };
170
- const onSubmit = (data) => {
171
- editArea(areaId, data.inputEditArea);
172
- setOpen(false);
173
- setFocus(false);
174
- };
175
- const handlerOpenPopoverEditArea = (e) => {
176
- e?.stopPropagation();
177
- setFocus(true);
178
- setOpen(true);
179
- };
180
- const initialValues = {
181
- inputEditArea: areaName
182
- };
183
- const validationSchema = useMemo(
184
- () => Yup.object().shape({
185
- inputEditArea: Yup.string().required(
186
- getLabel(getAreasDictionary(DICCTIONARY.validation_edit_area))
187
- )
188
- }),
189
- [getLabel]
190
- );
191
- const handlerOnClick = (e) => {
192
- setAnchorMenuAreas && setAnchorMenuAreas(e.currentTarget);
193
- selectArea(areaId);
194
- };
195
- const rippleRef = useRef(null);
196
- const onRippleStart = (e) => {
197
- if (rippleRef.current) {
198
- rippleRef.current.start(e);
199
- }
200
- };
201
- const onRippleStop = (e) => {
202
- if (rippleRef.current) {
203
- rippleRef.current.stop(e);
204
- }
205
- };
206
- return /* @__PURE__ */ jsxs(Fragment, { children: [
207
- /* @__PURE__ */ jsxs(
208
- "div",
209
- {
210
- role: "presentation",
211
- ref: anchorRef,
212
- onMouseDown: onRippleStart,
213
- onMouseUp: onRippleStop,
214
- className: clsx(
215
- areasAdminClasses.areaChipRoot,
216
- selected ? areasAdminClasses.selected : null,
217
- disabled ? areasAdminClasses.disabled : null
218
- ),
219
- onClick: (e) => {
220
- handlerOnClick(e);
221
- },
222
- children: [
223
- /* @__PURE__ */ jsx("div", { className: areasAdminClasses.areaChipTitle, children: areaName }),
224
- isDesktop ? /* @__PURE__ */ jsxs("div", { className: areasAdminClasses.areaContainerChipEditButton, children: [
225
- /* @__PURE__ */ jsx(
226
- IconButton,
227
- {
228
- className: areasAdminClasses.areaChipEditButton,
229
- src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.EDIT_AREA}`,
230
- size: "small",
231
- onClick: (e) => {
232
- handlerOpenPopoverEditArea(e);
233
- },
234
- tooltip: getLabel(getAreasDictionary(DICCTIONARY.label_edit_area))
235
- }
236
- ),
237
- /* @__PURE__ */ jsx(
238
- IconButton,
239
- {
240
- className: areasAdminClasses.areaChipDeleteButton,
241
- src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.DELETE_AREA}`,
242
- size: "small",
243
- onClick: (e) => {
244
- onClickDeleteArea(e);
245
- },
246
- tooltip: getLabel(getAreasDictionary(DICCTIONARY.label_delete_area))
247
- }
248
- )
249
- ] }) : /* @__PURE__ */ jsx(
250
- ChipActionsMobile,
251
- {
252
- areaId,
253
- handlerOpenPopoverEditArea
254
- }
255
- )
256
- ]
257
- }
258
- ),
259
- /* @__PURE__ */ jsx(
260
- "div",
261
- {
262
- role: "presentation",
263
- onClick: (e) => {
264
- e.stopPropagation();
265
- },
266
- children: /* @__PURE__ */ jsx(
267
- Popover,
268
- {
269
- arrowType: "top-center",
270
- open,
271
- className: areasAdminClasses.areaEditPopover,
272
- anchorEl: anchorRef.current,
273
- anchorOrigin: { vertical: "bottom", horizontal: "center" },
274
- transformOrigin: { vertical: "top", horizontal: "center" },
275
- onClose: () => {
276
- setFocus(false);
277
- setOpen(false);
278
- },
279
- sx: {
280
- mt: "10px",
281
- ...theme.components?.M4LAreasAdminEditPopover?.styleOverrides
282
- },
283
- children: /* @__PURE__ */ jsxs(
284
- RHFormProvider,
285
- {
286
- onSubmit,
287
- values: initialValues,
288
- validationSchema,
289
- children: [
290
- /* @__PURE__ */ jsxs(EditAreaHeader, { children: [
291
- /* @__PURE__ */ jsx(Typography, { children: getLabel(getAreasDictionary(DICCTIONARY.label_edit_area)) }),
292
- /* @__PURE__ */ jsx(
293
- IconButton,
294
- {
295
- src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.CLOSE}`,
296
- size: "small",
297
- onClick: () => {
298
- setFocus(false);
299
- setOpen(false);
300
- }
301
- }
302
- )
303
- ] }),
304
- /* @__PURE__ */ jsx(
305
- RHFTextField,
306
- {
307
- name: "inputEditArea",
308
- skeletonWidth: "70%",
309
- skeletonHeight: "18px",
310
- sx: { mt: "20px" }
311
- }
312
- ),
313
- /* @__PURE__ */ jsxs(Actions, { children: [
314
- /* @__PURE__ */ jsx(
315
- ActionCancel,
316
- {
317
- onClick: () => {
318
- setOpen(false);
319
- setFocus(false);
320
- },
321
- variant: "outlined",
322
- skeletonWidth: "100%"
323
- }
324
- ),
325
- /* @__PURE__ */ jsx(ActionIntro, { skeletonWidth: "100%" })
326
- ] })
327
- ]
328
- }
329
- )
330
- }
331
- )
332
- }
333
- )
334
- ] });
335
- };
336
- AreaChip.displayName = "AreaButtons";
337
- const AreasAdminRoot = styled("div")`
338
- display: flex;
339
- position: relative;
340
- background-color: transparent;
341
-
342
- //areaRoot
343
- & .${areasAdminClasses.areaChipRoot} {
344
- display: flex;
345
- }
346
-
347
- ${(props) => props.theme.components?.M4LAreasAdmin?.styleOverrides}
348
- `;
349
- const ChipMobile = (props) => {
350
- const { areaId, selected, disabled, setAnchorMenuAreas } = props;
351
- const { host_static_assets, environment_assets } = useEnvironment();
352
- const { deleteArea, selectArea, editArea } = useAreasStore((state) => state.areasActions);
353
- const { setFocus } = useAreasStore((state) => state.areaAdminActions);
354
- const areaName = useAreasStore((state) => state.hashAreas[areaId].name, shallow);
355
- const listAreas = useAreasStore((state) => state.areasIds, shallow);
356
- const [open, setOpen] = useState(false);
357
- const { getLabel } = useModuleDictionary();
358
- const isDesktop = useResponsiveDesktop();
359
- const anchorRef = useRef(null);
360
- const theme = useTheme();
361
- const onClickDeleteArea = (e) => {
362
- if (listAreas.length > 1) {
363
- e.stopPropagation();
364
- setFocus(true);
365
- deleteArea(areaId);
366
- }
367
- };
368
- const onSubmit = (data) => {
369
- editArea(areaId, data.inputEditArea);
370
- setOpen(false);
371
- setFocus(false);
372
- };
373
- const handlerOpenPopoverEditArea = (e) => {
374
- e?.stopPropagation();
375
- setFocus(true);
376
- setOpen(true);
377
- };
378
- const initialValues = {
379
- inputEditArea: areaName
380
- };
381
- const validationSchema = useMemo(
382
- () => Yup.object().shape({
383
- inputEditArea: Yup.string().required(
384
- getLabel(getAreasDictionary(DICCTIONARY.validation_edit_area))
385
- )
386
- }),
387
- [getLabel]
388
- );
389
- const handlerOnClick = (e) => {
390
- setAnchorMenuAreas && setAnchorMenuAreas(e.currentTarget);
391
- selectArea(areaId);
392
- };
393
- const rippleRef = useRef(null);
394
- const onRippleStart = (e) => {
395
- if (rippleRef.current) {
396
- rippleRef.current.start(e);
397
- }
398
- };
399
- const onRippleStop = (e) => {
400
- if (rippleRef.current) {
401
- rippleRef.current.stop(e);
402
- }
403
- };
404
- return /* @__PURE__ */ jsxs(Fragment, { children: [
405
- /* @__PURE__ */ jsxs(
406
- "div",
407
- {
408
- role: "presentation",
409
- ref: anchorRef,
410
- onMouseDown: onRippleStart,
411
- onMouseUp: onRippleStop,
412
- className: clsx(
413
- areasAdminClasses.areaChipRoot,
414
- selected ? areasAdminClasses.selected : null,
415
- disabled ? areasAdminClasses.disabled : null
416
- ),
417
- onClick: (e) => {
418
- handlerOnClick(e);
419
- },
420
- children: [
421
- /* @__PURE__ */ jsx(TouchRipple, { ref: rippleRef, center: false, style: { position: "absolute", inset: "0" } }),
422
- /* @__PURE__ */ jsx("div", { className: areasAdminClasses.areaChipTitle, children: areaName })
423
- ]
424
- }
425
- ),
426
- isDesktop ? /* @__PURE__ */ jsxs("div", { className: areasAdminClasses.areaContainerChipEditButton, children: [
427
- /* @__PURE__ */ jsx(
428
- IconButton,
429
- {
430
- className: areasAdminClasses.areaChipEditButton,
431
- src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.EDIT_AREA}`,
432
- size: "small",
433
- onClick: (e) => {
434
- handlerOpenPopoverEditArea(e);
435
- }
436
- }
437
- ),
438
- /* @__PURE__ */ jsx(
439
- IconButton,
440
- {
441
- className: areasAdminClasses.areaChipDeleteButton,
442
- src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.DELETE_AREA}`,
443
- size: "small",
444
- onClick: (e) => {
445
- onClickDeleteArea(e);
446
- }
447
- }
448
- )
449
- ] }) : /* @__PURE__ */ jsx(
450
- ChipActionsMobile,
451
- {
452
- areaId,
453
- handlerOpenPopoverEditArea
454
- }
455
- ),
456
- /* @__PURE__ */ jsx(
457
- "div",
458
- {
459
- role: "presentation",
460
- onClick: (e) => {
461
- e.stopPropagation();
462
- },
463
- children: /* @__PURE__ */ jsx(
464
- Popover,
465
- {
466
- arrowType: "top-center",
467
- open,
468
- className: areasAdminClasses.areaEditPopover,
469
- anchorEl: anchorRef.current,
470
- anchorOrigin: { vertical: "bottom", horizontal: "center" },
471
- transformOrigin: { vertical: "top", horizontal: "center" },
472
- onClose: () => {
473
- setFocus(false);
474
- setOpen(false);
475
- },
476
- sx: {
477
- mt: "10px",
478
- ...theme.components?.M4LAreasAdminEditPopover?.styleOverrides
479
- },
480
- children: /* @__PURE__ */ jsxs(
481
- RHFormProvider,
482
- {
483
- onSubmit,
484
- values: initialValues,
485
- validationSchema,
486
- children: [
487
- /* @__PURE__ */ jsxs(EditAreaHeader, { children: [
488
- /* @__PURE__ */ jsx(Typography, { children: getLabel(getAreasDictionary(DICCTIONARY.label_edit_area)) }),
489
- /* @__PURE__ */ jsx(
490
- IconButton,
491
- {
492
- src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.CLOSE}`,
493
- size: "small",
494
- onClick: () => {
495
- setFocus(false);
496
- setOpen(false);
497
- }
498
- }
499
- )
500
- ] }),
501
- /* @__PURE__ */ jsx(
502
- RHFTextField,
503
- {
504
- name: "inputEditArea",
505
- skeletonWidth: "70%",
506
- skeletonHeight: "18px",
507
- sx: { mt: "20px" }
508
- }
509
- ),
510
- /* @__PURE__ */ jsxs(Actions, { children: [
511
- /* @__PURE__ */ jsx(
512
- ActionCancel,
513
- {
514
- onClick: () => {
515
- setOpen(false);
516
- setFocus(false);
517
- },
518
- variant: "outlined",
519
- skeletonWidth: "100%"
520
- }
521
- ),
522
- /* @__PURE__ */ jsx(ActionIntro, { skeletonWidth: "100%" })
523
- ] })
524
- ]
525
- }
526
- )
527
- }
528
- )
529
- }
530
- )
531
- ] });
532
- };
533
- ChipMobile.displayName = "AreaButtons";
534
- const AreaChipMobile = () => {
535
- const areas = useAreasStore(
536
- (state) => state.areasIds.map((a) => ({ id: a, name: state.hashAreas[a].name })),
537
- shallow
538
- );
539
- const { selectArea } = useAreasStore((state) => state.areasActions);
540
- const currentAreaId = useAreasStore((state) => state.currentAreaId, shallow);
541
- const { addArea } = useAreasStore((state) => state.areasActions, shallow);
542
- const { setFocus } = useAreasStore((state) => state.areaAdminActions, shallow);
543
- const [anchorMenuAreas, setAnchorMenuAreas] = useState(null);
544
- const { getLabel } = useModuleDictionary();
545
- const theme = useTheme();
546
- const currentArea = areas.find((area) => area.id === currentAreaId);
547
- const { host_static_assets, environment_assets } = useEnvironment();
548
- const menuActions = useMemo(
549
- () => areas.filter((area) => area.id !== currentAreaId).map((area) => {
550
- return {
551
- urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.LAYERS}`,
552
- onClick: () => {
553
- selectArea(area.id);
554
- setFocus(false);
555
- },
556
- label: area.name
557
- };
558
- }),
559
- [areas, currentAreaId]
560
- );
561
- const handlerSetAnchorMenuAreas = (element) => {
562
- setFocus(false);
563
- setAnchorMenuAreas(element);
564
- };
565
- return /* @__PURE__ */ jsx("div", { className: areasAdminClasses.areaChipMobileRoot, children: /* @__PURE__ */ jsxs("div", { className: areasAdminClasses.areaContainerContentChips, children: [
566
- currentArea ? /* @__PURE__ */ jsx(
567
- ChipMobile,
568
- {
569
- areaId: currentArea.id,
570
- selected: true,
571
- disabled: true,
572
- setAnchorMenuAreas
573
- },
574
- currentArea.id
575
- ) : null,
576
- menuActions.length >= 0 ? /* @__PURE__ */ jsx("div", { className: areasAdminClasses.areaChipMobileIconContainer, children: /* @__PURE__ */ jsx(
577
- MenuActions,
578
- {
579
- urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.CHEVRON_DOWN}`,
580
- arrowType: "no-arrow",
581
- marginTop: "12px!important",
582
- marginLeft: "14px!important",
583
- anchorOrigin: { vertical: "bottom", horizontal: "right" },
584
- transformOrigin: { vertical: "top", horizontal: "right" },
585
- menuActions,
586
- externalOpen: anchorMenuAreas,
587
- externalClose: handlerSetAnchorMenuAreas,
588
- className: areasAdminClasses.areasPopoverMobileOptions,
589
- menuActionSx: theme.components?.M4LAreasAdminMobilePopoverOptions?.styleOverrides,
590
- endListElement: /* @__PURE__ */ jsx(
591
- Button,
592
- {
593
- onClick: () => {
594
- addArea();
595
- setAnchorMenuAreas(null);
596
- },
597
- variant: "outlined",
598
- startIcon: /* @__PURE__ */ jsx(
599
- Icon,
600
- {
601
- src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.ADD_AREA}`
602
- }
603
- ),
604
- children: getLabel(getAreasDictionary(DICCTIONARY.area_add_new))
605
- }
606
- )
607
- }
608
- ) }) : null
609
- ] }) });
610
- };
611
- const PanelWindowPopUp = (props) => {
612
- const { currentAreaId } = props;
613
- const { host_static_assets, environment_assets } = useEnvironment();
614
- const windowsLayouts = useAreasStore(
615
- (state) => state.hashAreas[currentAreaId].layoutItemsIds.filter((li) => state.hashWindows[li].emergeType === "layout").map((lim) => {
616
- const w = state.hashWindows[lim];
617
- return {
618
- i: w.windowId,
619
- url_icon: w.url_icon,
620
- title: w.title
621
- };
622
- }),
623
- shallow
624
- );
625
- const theme = useTheme();
626
- const { maximizeLayout } = useAreasStore((state) => state.areaActions);
627
- const onTouched = (layoutId) => {
628
- maximizeLayout(currentAreaId, layoutId);
629
- };
630
- const menuActions = windowsLayouts.map((element) => {
631
- return {
632
- onClick: () => onTouched(element.i),
633
- label: element.title,
634
- urlIcon: element.url_icon
635
- };
636
- });
637
- return menuActions.length > 0 ? /* @__PURE__ */ jsx(
638
- MenuActions,
639
- {
640
- urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.LAYERS}`,
641
- arrowType: "no-arrow",
642
- marginTop: "12px!important",
643
- marginLeft: "14px!important",
644
- anchorOrigin: { vertical: "bottom", horizontal: "right" },
645
- transformOrigin: { vertical: "top", horizontal: "right" },
646
- menuActions,
647
- className: areasAdminClasses.areasPopoverListWindows,
648
- iconButtonClassName: areasAdminClasses.areasPopoverListWindowsIcon,
649
- menuActionSx: theme.components?.M4LAreasAdminMobilePopoverOptions?.styleOverrides
650
- }
651
- ) : null;
652
- };
653
- function AreasAdmin() {
654
- const areas = useAreasStore((state) => state.areasIds, shallow);
655
- const currentArea = useAreasStore((state) => state.currentAreaId, shallow);
656
- const status = useAreasStore((state) => state.ownerState.status);
657
- const { setFocus } = useAreasStore((state) => state.areaAdminActions, shallow);
658
- const classesRoot = useAreasStore((state) => state.adminClasses.root);
659
- const areasLength = useAreasStore((state) => state.areasIds.length);
660
- const isDesktop = useResponsiveDesktop();
661
- useResponsiveContainerStore((state) => state.isUpSm, shallow);
662
- const { addArea } = useAreasStore((state) => state.areasActions, shallow);
663
- const maximizedId = useAreasStore(
664
- (state) => state.hashAreas[currentArea] ? state.hashAreas[currentArea].maximizedId : false,
665
- shallow
666
- );
667
- const { host_static_assets, environment_assets } = useEnvironment();
668
- const { getLabel } = useModuleDictionary();
669
- const divRef = useRef(null);
670
- const divRefOut = useRef(null);
671
- const handleClickOutsideFn = () => {
672
- setFocus(false);
673
- };
674
- useOnClickOutside(divRef, handleClickOutsideFn, divRefOut);
675
- const rippleRef = useRef(null);
676
- const onRippleStart = (e) => {
677
- if (rippleRef.current) {
678
- rippleRef.current.start(e);
679
- }
680
- };
681
- const onRippleStop = (e) => {
682
- if (rippleRef.current) {
683
- rippleRef.current.stop(e);
684
- }
685
- };
686
- if (status !== "loaded") {
687
- return null;
688
- }
689
- return /* @__PURE__ */ jsx(
690
- AreasAdminRoot,
691
- {
692
- ref: divRefOut,
693
- onMouseDown: onRippleStart,
694
- onMouseUp: onRippleStop,
695
- className: classesRoot,
696
- children: /* @__PURE__ */ jsxs(
697
- "div",
698
- {
699
- role: "presentation",
700
- ref: divRef,
701
- className: areasAdminClasses.rootContent,
702
- onClick: () => setFocus(true),
703
- children: [
704
- /* @__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(
705
- AreaChip,
706
- {
707
- areaId: area,
708
- selected: area === currentArea,
709
- disabled: areasLength === 1
710
- },
711
- area
712
- )) }) }) : /* @__PURE__ */ jsx(AreaChipMobile, {}) }) }) }),
713
- isDesktop ? /* @__PURE__ */ jsx(
714
- IconButton,
715
- {
716
- className: areasAdminClasses.areasAddButton,
717
- src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.ADD_AREA}`,
718
- size: "small",
719
- onClick: addArea,
720
- tooltip: getLabel(getAreasDictionary(DICCTIONARY.area_add_new))
721
- }
722
- ) : null,
723
- !isDesktop && maximizedId ? /* @__PURE__ */ jsx(PanelWindowPopUp, { currentAreaId: currentArea }) : null
724
- ]
725
- }
726
- )
727
- }
728
- );
729
- }
730
- export {
731
- AreasAdmin as A,
732
- useAreasAdminUtilityClasses as u
733
- };