@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,395 +0,0 @@
1
- import { jsx, Fragment } from "react/jsx-runtime";
2
- import React__default, { useRef, useEffect, useState, useCallback, useMemo } from "react";
3
- import { D as DraggableCore_1 } from "../../../../react-draggable-DsCPdgQP.js";
4
- import { R as Resizable } from "../../../../react-resizable-eBbFl2dX.js";
5
- import { g as getH, c as calcXY, a as calcGridItemWHPx, b as calcGridColWidth, d as calcWH, e as clamp, f as calcGridItemPosition, h as gridLayoutClasses, D as DEFAULT_COLS, i as DEFAULT_ROW_HEIGHT, j as DEFAULT_CONTAINER_WIDTH, k as DEFAULT_CONTAINER_HEIGHT, l as DEFAULT_MARGIN, m as DEFAULT_CONTAINER_PADDING, n as DEFAULT_TRANSFORM_SCALE, o as DEFAULT_COLAPSED_HEIGHT, p as perc, s as setTransform, q as setTopLeft } from "../../index-EPw3AYiQ.js";
6
- import clsx from "clsx";
7
- import { deepEqual } from "fast-equals";
8
- function GridItem(props) {
9
- const {
10
- layoutItemRender: ComponentItemRender,
11
- type,
12
- i,
13
- x,
14
- y,
15
- w,
16
- h,
17
- cols = DEFAULT_COLS,
18
- rowHeight = DEFAULT_ROW_HEIGHT,
19
- containerWidth = DEFAULT_CONTAINER_WIDTH,
20
- containerHeight = DEFAULT_CONTAINER_HEIGHT,
21
- margin = DEFAULT_MARGIN,
22
- containerPadding = DEFAULT_CONTAINER_PADDING,
23
- transformScale = DEFAULT_TRANSFORM_SCALE,
24
- colapsedHeight = DEFAULT_COLAPSED_HEIGHT,
25
- isBounded,
26
- maxRows = Infinity,
27
- className = "",
28
- draggableCancel = "",
29
- draggableHandle = "",
30
- minH = 1,
31
- minW = 1,
32
- maxH = Infinity,
33
- maxW = Infinity,
34
- isResizable = true,
35
- isDraggable = true,
36
- resizeHandles,
37
- resizeHandle,
38
- useCSSTransforms = true,
39
- usePercentages,
40
- style,
41
- freeMove,
42
- maximize = "none",
43
- colapsed,
44
- visible = true,
45
- onDragStart,
46
- onDrag,
47
- onDragStop,
48
- onFreeMoveClick
49
- } = props;
50
- const refProps = useRef({
51
- cols,
52
- x,
53
- y,
54
- w,
55
- h: getH(h, colapsedHeight, rowHeight, colapsed),
56
- minW,
57
- maxW,
58
- minH,
59
- maxH,
60
- containerWidth,
61
- containerHeight,
62
- margin,
63
- containerPadding,
64
- rowHeight,
65
- maxRows,
66
- colapsed
67
- });
68
- useEffect(() => {
69
- refProps.current = {
70
- cols,
71
- x,
72
- y,
73
- w,
74
- h: getH(h, colapsedHeight, rowHeight, colapsed),
75
- minW,
76
- maxW,
77
- minH,
78
- maxH,
79
- containerWidth,
80
- containerHeight,
81
- margin,
82
- containerPadding,
83
- rowHeight,
84
- maxRows,
85
- colapsed
86
- };
87
- }, [
88
- cols,
89
- x,
90
- y,
91
- w,
92
- h,
93
- minW,
94
- maxW,
95
- minH,
96
- maxH,
97
- containerWidth,
98
- containerHeight,
99
- margin,
100
- containerPadding,
101
- rowHeight,
102
- maxRows,
103
- colapsed,
104
- colapsedHeight
105
- ]);
106
- const [currentState, setCurrentState] = useState({
107
- resizing: void 0,
108
- dragging: void 0
109
- });
110
- const refState = useRef({
111
- resizing: void 0,
112
- dragging: void 0
113
- });
114
- const elementRef = useRef(null);
115
- const getPositionParams = useCallback(
116
- (preferContainerWidth, preferContainerHeight) => {
117
- return {
118
- cols: refProps.current.cols,
119
- containerPadding: refProps.current.containerPadding,
120
- containerWidth: preferContainerWidth || refProps.current.containerWidth,
121
- containerHeight: preferContainerHeight || refProps.current.containerHeight,
122
- containerMargin: refProps.current.margin,
123
- maxRows: refProps.current.maxRows,
124
- rowHeight: refProps.current.rowHeight
125
- };
126
- },
127
- []
128
- );
129
- const createStyle = (pos2) => {
130
- let newStyle;
131
- if (useCSSTransforms) {
132
- newStyle = setTransform(pos2);
133
- } else {
134
- newStyle = setTopLeft(pos2);
135
- if (usePercentages) {
136
- newStyle.left = perc(pos2.left / containerWidth);
137
- newStyle.width = perc(pos2.width / containerWidth);
138
- }
139
- }
140
- return newStyle;
141
- };
142
- const gridItemOnDragStart = useCallback((e, { node }) => {
143
- if (!onDragStart) return;
144
- const newPosition = { top: 0, left: 0 };
145
- const { offsetParent } = node;
146
- if (!offsetParent) return;
147
- const parentRect = offsetParent.getBoundingClientRect();
148
- const clientRect = node.getBoundingClientRect();
149
- const cLeft = clientRect.left / transformScale;
150
- const pLeft = parentRect.left / transformScale;
151
- const cTop = clientRect.top / transformScale;
152
- const pTop = parentRect.top / transformScale;
153
- newPosition.left = cLeft - pLeft + offsetParent.scrollLeft;
154
- newPosition.top = cTop - pTop + offsetParent.scrollTop;
155
- refState.current.dragging = newPosition;
156
- setCurrentState((prev) => ({ ...prev, dragging: newPosition }));
157
- const { x: newX, y: newY } = calcXY(
158
- getPositionParams(),
159
- newPosition.top,
160
- newPosition.left,
161
- refProps.current.w,
162
- refProps.current.h
163
- );
164
- onDragStart(i, newX, newY, {
165
- e,
166
- node,
167
- newPosition
168
- });
169
- }, []);
170
- const gridItemOnDrag = useCallback(
171
- (e, { node, deltaX, deltaY }) => {
172
- if (!onDrag) return;
173
- if (!refState.current.dragging) {
174
- return;
175
- }
176
- let top = refState.current.dragging.top + deltaY;
177
- let left = refState.current.dragging.left + deltaX;
178
- const positionParams = getPositionParams();
179
- if (isBounded) {
180
- const { offsetParent } = node;
181
- if (offsetParent) {
182
- const bottomBoundary = offsetParent.clientHeight - calcGridItemWHPx(
183
- refProps.current.h,
184
- refProps.current.rowHeight,
185
- refProps.current.margin[1]
186
- );
187
- top = clamp(top, 0, bottomBoundary);
188
- const colWidth = calcGridColWidth(positionParams);
189
- const rightBoundary = containerWidth - calcGridItemWHPx(refProps.current.w, colWidth, refProps.current.margin[0]);
190
- left = clamp(left, 0, rightBoundary);
191
- }
192
- }
193
- const newPosition = { top, left };
194
- refState.current.dragging = newPosition;
195
- setCurrentState((prev) => ({ ...prev, dragging: newPosition }));
196
- const { x: newX, y: newY } = calcXY(
197
- positionParams,
198
- top,
199
- left,
200
- refProps.current.w,
201
- refProps.current.h
202
- );
203
- onDrag(i, newX, newY, {
204
- e,
205
- node,
206
- newPosition
207
- });
208
- },
209
- []
210
- );
211
- const gridItemOnDragStop = useCallback((e, { node }) => {
212
- if (!onDragStop) return;
213
- if (!refState.current.dragging) {
214
- return;
215
- }
216
- const { left, top } = refState.current.dragging;
217
- const newPosition = { top, left };
218
- refState.current.dragging = void 0;
219
- setCurrentState((prev) => ({ ...prev, dragging: void 0 }));
220
- const { x: newX, y: newY } = calcXY(
221
- getPositionParams(),
222
- top,
223
- left,
224
- refProps.current.w,
225
- refProps.current.h
226
- );
227
- return onDragStop(i, newX, newY, {
228
- e,
229
- node,
230
- newPosition
231
- });
232
- }, []);
233
- const onResizeHandler = useCallback(
234
- (e, { node, size }, handlerName) => {
235
- const handler = props[handlerName];
236
- if (!handler) {
237
- return;
238
- }
239
- if (refProps.current.colapsed) {
240
- return;
241
- }
242
- let { w: newW, h: newH } = calcWH(
243
- getPositionParams(),
244
- size.width,
245
- size.height,
246
- refProps.current.x,
247
- refProps.current.y
248
- );
249
- const newMinW = Math.max(refProps.current.minW, 1);
250
- const newMaxW = Math.min(refProps.current.maxW, refProps.current.cols - refProps.current.x);
251
- newW = clamp(newW, newMinW, newMaxW);
252
- newH = clamp(newH, refProps.current.minH, refProps.current.maxH);
253
- const resizing = handlerName === "onResizeStop" ? void 0 : size;
254
- setCurrentState((prev) => ({
255
- ...prev,
256
- resizing
257
- }));
258
- refState.current.resizing = resizing;
259
- handler(i, newW, newH, { e, node, size });
260
- },
261
- []
262
- );
263
- const localOnResizeStop = useCallback((e, callbackData) => {
264
- onResizeHandler(e, callbackData, "onResizeStop");
265
- }, []);
266
- const localOnResizeStart = useCallback((e, callbackData) => {
267
- onResizeHandler(e, callbackData, "onResizeStart");
268
- }, []);
269
- const localFreeMoveOnClick = useCallback(() => {
270
- if (!onFreeMoveClick) return;
271
- onFreeMoveClick(i);
272
- }, []);
273
- const mixinResizable = useCallback(
274
- (child, position, positionParams) => {
275
- const maxWidth = calcGridItemPosition(positionParams, 0, 0, cols - x, 0, maximize).width;
276
- const mins = calcGridItemPosition(positionParams, 0, 0, minW, minH, maximize);
277
- const maxes = calcGridItemPosition(positionParams, 0, 0, maxW, maxH, maximize);
278
- const minConstraints = [mins.width, mins.height];
279
- const maxConstraints = [
280
- Math.min(maxes.width, maxWidth),
281
- Math.min(maxes.height, Infinity)
282
- ];
283
- return /* @__PURE__ */ jsx(
284
- Resizable,
285
- {
286
- draggableOpts: {
287
- disabled: !isResizable || maximize !== "none" || colapsed
288
- },
289
- className: isResizable ? void 0 : "react-resizable-hide",
290
- width: position.width,
291
- height: position.height,
292
- minConstraints,
293
- maxConstraints,
294
- onResizeStop: localOnResizeStop,
295
- onResizeStart: localOnResizeStart,
296
- onResize: localOnResize,
297
- transformScale,
298
- resizeHandles,
299
- handle: resizeHandle,
300
- children: child
301
- }
302
- );
303
- },
304
- [
305
- cols,
306
- x,
307
- minW,
308
- minH,
309
- maxW,
310
- maxH,
311
- isResizable,
312
- transformScale,
313
- resizeHandles,
314
- resizeHandle,
315
- maximize,
316
- colapsed
317
- ]
318
- );
319
- const mixinDraggable = useCallback(
320
- (child) => {
321
- return /* @__PURE__ */ jsx(
322
- DraggableCore_1,
323
- {
324
- disabled: !isDraggable || maximize !== "none",
325
- onStart: gridItemOnDragStart,
326
- onDrag: gridItemOnDrag,
327
- onStop: gridItemOnDragStop,
328
- handle: draggableHandle,
329
- cancel: ".react-resizable-handle" + (draggableCancel ? "," + draggableCancel : ""),
330
- scale: transformScale,
331
- nodeRef: elementRef,
332
- children: child
333
- }
334
- );
335
- },
336
- [isDraggable, draggableHandle, transformScale, draggableCancel, maximize]
337
- );
338
- const localOnResize = useCallback((e, callbackData) => {
339
- onResizeHandler(e, callbackData, "onResize");
340
- }, []);
341
- const positionParms = getPositionParams(containerWidth, containerHeight);
342
- const pos = calcGridItemPosition(
343
- positionParms,
344
- x,
345
- y,
346
- w,
347
- getH(h, colapsedHeight, rowHeight, colapsed),
348
- maximize,
349
- currentState
350
- );
351
- const classNameFinal = clsx(gridLayoutClasses.gridItemRoot, className, {
352
- [`${gridLayoutClasses.gridItemType}-${type}`]: true,
353
- [gridLayoutClasses.static]: props.static,
354
- [gridLayoutClasses.resizing]: Boolean(currentState.resizing),
355
- [gridLayoutClasses.dragging]: Boolean(currentState.dragging),
356
- [gridLayoutClasses.maximizeMe]: maximize === "maximize_me",
357
- [gridLayoutClasses.maximizeOther]: maximize === "maximize_other",
358
- [gridLayoutClasses.colapsed]: colapsed,
359
- [`${gridLayoutClasses.colapsed}-${colapsedHeight}`]: colapsed,
360
- [gridLayoutClasses.gridItemFreeMove]: freeMove,
361
- [gridLayoutClasses.resizeHide]: colapsed,
362
- [gridLayoutClasses.invisible]: !visible,
363
- [gridLayoutClasses.cssTransforms]: useCSSTransforms,
364
- "react-draggable": isDraggable
365
- //Requerido para el componente Draggable
366
- // dropping: Boolean(droppingPosition),
367
- });
368
- const styleFinal = {
369
- ...style,
370
- ...createStyle(pos)
371
- //TODO: Delegar el estilo en el ItemRender
372
- };
373
- const memoLayouItemRender = useMemo(() => {
374
- return /* @__PURE__ */ jsx(ComponentItemRender, { type, i });
375
- }, [type, i]);
376
- const gridItemRoot = /* @__PURE__ */ jsx(
377
- "div",
378
- {
379
- className: classNameFinal,
380
- ref: elementRef,
381
- style: styleFinal,
382
- role: "none",
383
- onClick: localFreeMoveOnClick,
384
- children: memoLayouItemRender
385
- }
386
- );
387
- const gridItem = mixinDraggable(mixinResizable(gridItemRoot, pos, getPositionParams()));
388
- return /* @__PURE__ */ jsx(Fragment, { children: gridItem });
389
- }
390
- const MemonizedGridItem = React__default.memo(GridItem, (prevProps, nextProps) => {
391
- return deepEqual(prevProps, nextProps);
392
- });
393
- export {
394
- MemonizedGridItem as M
395
- };