@m4l/components 7.1.2 → 7.1.3

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 (24) hide show
  1. package/components/DragResizeWindow/DragResizeWindow.js +1 -1
  2. package/components/GridLayout/subcomponents/GridItem/index.js +1 -1
  3. package/components/areas/components/AreasViewer/styles.js +1 -1
  4. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/WindowModal/index.js +1 -1
  5. package/components/extended/react-resizable/Resizable/Resizable.js +8 -0
  6. package/components/extended/react-resizable/Resizable/constants.js +4 -0
  7. package/components/extended/react-resizable/Resizable/index.d.ts +0 -1
  8. package/components/extended/react-resizable/Resizable/index.js +1 -0
  9. package/components/extended/react-resizable/Resizable/slots/ResizableSlots.js +11 -0
  10. package/components/extended/react-resizable/Resizable/slots/slots.js +7 -0
  11. package/components/extended/react-resizable/ResizableBox/ResizableBox.js +29 -0
  12. package/components/extended/react-resizable/ResizableBox/ResizeableBox.styles.js +13 -0
  13. package/components/extended/react-resizable/ResizableBox/constants.js +4 -0
  14. package/components/extended/react-resizable/ResizableBox/index.d.ts +0 -1
  15. package/components/extended/react-resizable/ResizableBox/index.js +1 -0
  16. package/components/extended/react-resizable/ResizableBox/slots/ResizableBoxSlots.js +11 -0
  17. package/components/extended/react-resizable/ResizableBox/slots/slots.js +7 -0
  18. package/components/extended/react-resizable/helpers.js +91 -0
  19. package/components/extended/react-resizable/index.js +1 -0
  20. package/components/index.js +1 -1
  21. package/components/modal/ModalDialog/index.js +1 -1
  22. package/index.js +8 -5
  23. package/package.json +7 -1
  24. package/style.css +65 -0
@@ -5,13 +5,13 @@ import clsx from "clsx";
5
5
  import { d as dragResizeWindowClasses } from "./classes/index.js";
6
6
  import { D as DEFAULT_TRANSFORM_SCALE } from "./constants.js";
7
7
  import { s as setTransform } from "./utils.js";
8
- import { Resizable } from "../extended/react-resizable/Resizable";
9
8
  import { useForkRef } from "@mui/material";
10
9
  import { g as getInitialSize } from "./helpers/index.js";
11
10
  import { u as useDragOptions } from "./hooks/useDragOptions.js";
12
11
  import { u as useResizeOptions } from "./hooks/useResizeOptions.js";
13
12
  import { u as useDimensionEffects } from "./hooks/useDimensionEffects.js";
14
13
  import { R as RootStyled } from "./slots/DragResizeWindowSlots.js";
14
+ import { R as Resizable } from "../extended/react-resizable/Resizable/Resizable.js";
15
15
  const DragResizeWindow = forwardRef((props, ref) => {
16
16
  const {
17
17
  //Comunes
@@ -1,13 +1,13 @@
1
1
  import { jsx, Fragment } from "react/jsx-runtime";
2
2
  import React, { useRef, useEffect, useState, useCallback, useMemo } from "react";
3
3
  import { DraggableCore } from "react-draggable";
4
- import { Resizable } from "../../../extended/react-resizable";
5
4
  import { h as getH, p as perc, s as setTransform, j as setTopLeft } from "../../utils.js";
6
5
  import { c as calcXY, a as calcGridItemWHPx, b as calcGridColWidth, d as calcWH, e as clamp, f as calcGridItemPosition } from "../../calculateUtils.js";
7
6
  import clsx from "clsx";
8
7
  import { deepEqual } from "fast-equals";
9
8
  import { D as DEFAULT_COLS, c as DEFAULT_ROW_HEIGHT, e as DEFAULT_CONTAINER_WIDTH, f as DEFAULT_CONTAINER_HEIGHT, b as DEFAULT_MARGIN, a as DEFAULT_CONTAINER_PADDING, g as DEFAULT_TRANSFORM_SCALE, d as DEFAULT_COLAPSED_HEIGHT } from "../../constants.js";
10
9
  import { g as gridLayoutClasses } from "../../classes/index.js";
10
+ import { R as Resizable } from "../../../extended/react-resizable/Resizable/Resizable.js";
11
11
  function GridItem(props) {
12
12
  const {
13
13
  layoutItemRender: ComponentItemRender,
@@ -1,4 +1,4 @@
1
- import "react-resizable/css/styles.css";
1
+ /* empty css */
2
2
  import { styled } from "@mui/material/styles";
3
3
  import { a as areasViewerClasses } from "./classes/index.js";
4
4
  const AreasViewerRoot = styled("div")`
@@ -6,7 +6,7 @@ import { W as WrapperWindowModal } from "./styles.js";
6
6
  import Draggable from "react-draggable";
7
7
  import { useResponsiveDesktop } from "@m4l/graphics";
8
8
  import { a as areasViewerClasses } from "../../../../classes/index.js";
9
- import { ResizableBox } from "../../../../../../../extended/react-resizable";
9
+ import { R as ResizableBox } from "../../../../../../../extended/react-resizable/ResizableBox/ResizableBox.js";
10
10
  const WindowModal = (props) => {
11
11
  const { windowId } = props;
12
12
  const { onClose } = useAreasStore((state) => state.hashWindowsModals[windowId]);
@@ -0,0 +1,8 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { R as RootStyled } from "./slots/ResizableSlots.js";
3
+ const Resizable = (props) => {
4
+ return /* @__PURE__ */ jsx(RootStyled, { ...props });
5
+ };
6
+ export {
7
+ Resizable as R
8
+ };
@@ -0,0 +1,4 @@
1
+ const COMPONET_KEY_COMPONENT = "M4LResizable";
2
+ export {
3
+ COMPONET_KEY_COMPONENT as C
4
+ };
@@ -1,2 +1 @@
1
1
  export { Resizable } from './Resizable';
2
- export {};
@@ -0,0 +1,11 @@
1
+ import { styled } from "@mui/material/styles";
2
+ import { C as COMPONET_KEY_COMPONENT } from "../constants.js";
3
+ import { r as resizableBoxStyles } from "../../ResizableBox/ResizeableBox.styles.js";
4
+ import { R as ResizableSlots } from "./slots.js";
5
+ import { Resizable } from "react-resizable";
6
+ const RootStyled = styled(Resizable, { name: COMPONET_KEY_COMPONENT, slot: ResizableSlots.root })(
7
+ resizableBoxStyles?.root
8
+ );
9
+ export {
10
+ RootStyled as R
11
+ };
@@ -0,0 +1,7 @@
1
+ var ResizableSlots = /* @__PURE__ */ ((ResizableSlots2) => {
2
+ ResizableSlots2["root"] = "root";
3
+ return ResizableSlots2;
4
+ })(ResizableSlots || {});
5
+ export {
6
+ ResizableSlots as R
7
+ };
@@ -0,0 +1,29 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { R as RootStyled } from "./slots/ResizableBoxSlots.js";
3
+ function ResizableBox(props) {
4
+ const {
5
+ children,
6
+ width = 600,
7
+ height = 400,
8
+ maxHeigth,
9
+ onResize,
10
+ maxWidth,
11
+ resizeHandles = ["se", "nw"],
12
+ ...other
13
+ } = props;
14
+ return /* @__PURE__ */ jsx(
15
+ RootStyled,
16
+ {
17
+ width,
18
+ height,
19
+ onResize,
20
+ maxConstraints: maxHeigth && maxWidth ? [maxWidth, maxHeigth] : void 0,
21
+ resizeHandles,
22
+ ...other,
23
+ children
24
+ }
25
+ );
26
+ }
27
+ export {
28
+ ResizableBox as R
29
+ };
@@ -0,0 +1,13 @@
1
+ import { g as getReactResizableStyles } from "../helpers.js";
2
+ const resizableBoxStyles = {
3
+ /**
4
+ * TODO: Documentar
5
+ */
6
+ root: ({ theme }) => ({
7
+ ...getReactResizableStyles(theme),
8
+ position: "absolute"
9
+ })
10
+ };
11
+ export {
12
+ resizableBoxStyles as r
13
+ };
@@ -0,0 +1,4 @@
1
+ const COMPONET_KEY_COMPONENT = "M4LResizableBox";
2
+ export {
3
+ COMPONET_KEY_COMPONENT as C
4
+ };
@@ -1,2 +1 @@
1
1
  export { ResizableBox } from './ResizableBox';
2
- export {};
@@ -0,0 +1,11 @@
1
+ import { styled } from "@mui/material/styles";
2
+ import { C as COMPONET_KEY_COMPONENT } from "../constants.js";
3
+ import { r as resizableBoxStyles } from "../ResizeableBox.styles.js";
4
+ import { R as ResizableBoxSlots } from "./slots.js";
5
+ import { ResizableBox } from "react-resizable";
6
+ const RootStyled = styled(ResizableBox, { name: COMPONET_KEY_COMPONENT, slot: ResizableBoxSlots.root })(
7
+ resizableBoxStyles?.root
8
+ );
9
+ export {
10
+ RootStyled as R
11
+ };
@@ -0,0 +1,7 @@
1
+ var ResizableBoxSlots = /* @__PURE__ */ ((ResizableBoxSlots2) => {
2
+ ResizableBoxSlots2["root"] = "root";
3
+ return ResizableBoxSlots2;
4
+ })(ResizableBoxSlots || {});
5
+ export {
6
+ ResizableBoxSlots as R
7
+ };
@@ -0,0 +1,91 @@
1
+ const borderWith = 2;
2
+ const getReactResizableStyles = (theme) => ({
3
+ position: "absolute",
4
+ // left: '0px',
5
+ // top: '0px',
6
+ // width: '0px',
7
+ // height: '0px',
8
+ backgroundColor: "red",
9
+ cursor: "default",
10
+ prop2: 12222,
11
+ "&.react-resizable": {
12
+ position: "relative"
13
+ },
14
+ "& .react-resizable-handle": {
15
+ position: "absolute",
16
+ width: "8px",
17
+ height: "8px",
18
+ boxSizing: "border-box",
19
+ border: "red",
20
+ padding: "0 3px 3px 0",
21
+ margin: "0px",
22
+ //Nueva con respecto al css
23
+ borderBottomRightRadius: "15%"
24
+ },
25
+ // Si no tiene habilitado el resize, se ocultan los handlers
26
+ "& .react-resizable-handle.react-resizable-hide": {
27
+ display: "none"
28
+ },
29
+ "& .react-resizable-handle-sw, .react-resizable-handle-se, .react-resizable-handle-nw, .react-resizable-handle-ne": {
30
+ borderRight: `${borderWith}px solid ${theme.vars.palette.text.disabled}`,
31
+ borderBottom: `2px solid ${theme.vars.palette.text.disabled}`
32
+ },
33
+ "& .react-resizable-handle-sw": {
34
+ bottom: "0",
35
+ left: "0",
36
+ cursor: "sw-resize",
37
+ transform: "rotate(90deg)",
38
+ position: "absolute"
39
+ //Nueva con respecto al css
40
+ },
41
+ "& .react-resizable-handle-se": {
42
+ bottom: "0",
43
+ right: "0",
44
+ cursor: "se-resize"
45
+ },
46
+ "& .react-resizable-handle-nw": {
47
+ top: "0",
48
+ left: "0",
49
+ cursor: "nw-resize",
50
+ transform: "rotate(180deg)"
51
+ },
52
+ "& .react-resizable-handle-ne": {
53
+ top: "0",
54
+ right: "0",
55
+ cursor: "ne-resize",
56
+ transform: "rotate(270deg)"
57
+ },
58
+ "& .react-resizable-handle-w, .react-resizable-handle-e": {
59
+ top: "50%",
60
+ marginTop: "-10px",
61
+ cursor: "ew-resize"
62
+ },
63
+ "& .react-resizable-handle-w": {
64
+ left: "0",
65
+ borderLeft: `${borderWith}px solid ${theme.vars.palette.text.disabled}`
66
+ // transform: 'rotate(135deg)',
67
+ },
68
+ "& .react-resizable-handle-e": {
69
+ right: "0",
70
+ borderRight: `${borderWith}px solid ${theme.vars.palette.text.disabled}`
71
+ // transform: 'rotate(315deg) ',
72
+ },
73
+ "& .react-resizable-handle-n,.react-resizable-handle-s": {
74
+ left: "50%",
75
+ marginLeft: "-10px",
76
+ cursor: "ns-resize"
77
+ },
78
+ "& .react-resizable-handle-n": {
79
+ top: "0",
80
+ // transform: 'rotate(225deg)',
81
+ borderTop: `${borderWith}px solid ${theme.vars.palette.text.disabled}`
82
+ },
83
+ "& .react-resizable-handle-s": {
84
+ bottom: "0",
85
+ // transform: 'rotate(45deg)',
86
+ borderBottom: `${borderWith}px solid ${theme.vars.palette.text.disabled}`
87
+ }
88
+ });
89
+ export {
90
+ getReactResizableStyles as g
91
+ };
@@ -1 +1 @@
1
- import "./extended/react-resizable";
1
+
@@ -2,7 +2,7 @@ import { jsx } from "react/jsx-runtime";
2
2
  import { useTheme, Dialog, Paper } from "@mui/material";
3
3
  import Draggable from "react-draggable";
4
4
  import { u as useModal } from "../../../hooks/useModal/index.js";
5
- import { ResizableBox } from "../../extended/react-resizable/ResizableBox/ResizableBox";
5
+ import { R as ResizableBox } from "../../extended/react-resizable/ResizableBox/ResizableBox.js";
6
6
  import { useIsMobile } from "@m4l/graphics";
7
7
  import { m as modalUtilityClasses } from "../classes/index.js";
8
8
  import { useState, useEffect } from "react";
package/index.js CHANGED
@@ -120,6 +120,8 @@ import { P as P8 } from "./components/PDFViewer/PDFViewer.js";
120
120
  import { P as P9 } from "./components/Period/Period.js";
121
121
  import { H as H2 } from "./components/HelmetPage/index.js";
122
122
  import { P as P10 } from "./components/PropertyValue/PropertyValue.js";
123
+ import { R as R15 } from "./components/extended/react-resizable/Resizable/Resizable.js";
124
+ import { R as R16 } from "./components/extended/react-resizable/ResizableBox/ResizableBox.js";
123
125
  import { S as S2 } from "./components/ScrollBar/index.js";
124
126
  import { S as S3 } from "./components/SplitLayout/SplitLayout.js";
125
127
  import { T as T2 } from "./components/ToastContainer/ToastContainer.js";
@@ -165,14 +167,13 @@ import { a as a11, T as T9 } from "./components/mui_extended/TabContext/index.js
165
167
  import { T as T10 } from "./components/mui_extended/Typography/Typography.js";
166
168
  import { T as T11 } from "./components/mui_extended/ToggleButton/ToggleButton.js";
167
169
  import { T as T12 } from "./components/mui_extended/ToggleIconButton/ToggleIconButton.js";
168
- export * from "./components/extended/react-resizable";
169
170
  import { a as a12, D as D6, M as M12 } from "./components/areas/contexts/DynamicMFParmsContext/index.js";
170
- import { F, R as R15, u as u9 } from "./components/hook-form/RHFormContext/index.js";
171
+ import { F, R as R17, u as u9 } from "./components/hook-form/RHFormContext/index.js";
171
172
  import { g as g27 } from "./components/hook-form/RHFormContext/dictionary.js";
172
173
  import { u as u10 } from "./contexts/AppearanceComponentContext/useAppearanceComponentStore.js";
173
174
  import { A as A16 } from "./contexts/AppearanceComponentContext/AppearanceComponentContext.js";
174
175
  import { a as a13, M as M13 } from "./contexts/ModalContext/index.js";
175
- import { a as a14, R as R16 } from "./contexts/RealTimeContext/RealTimeContext.js";
176
+ import { a as a14, R as R18 } from "./contexts/RealTimeContext/RealTimeContext.js";
176
177
  import { u as u11 } from "./hooks/useFormAddEdit/index.js";
177
178
  import { u as u12 } from "./hooks/useModal/index.js";
178
179
  import { u as u13 } from "./hooks/useTab/index.js";
@@ -295,9 +296,11 @@ export {
295
296
  R11 as RHFTextField,
296
297
  R12 as RHFTextFieldPassword,
297
298
  R13 as RHFUploadImage,
298
- R15 as RHFormProvider,
299
+ R17 as RHFormProvider,
299
300
  a14 as RealTimeContext,
300
- R16 as RealTimeProvider,
301
+ R18 as RealTimeProvider,
302
+ R15 as Resizable,
303
+ R16 as ResizableBox,
301
304
  R14 as Responsive,
302
305
  S2 as ScrollBar,
303
306
  S as ScrollToTop,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m4l/components",
3
- "version": "7.1.2",
3
+ "version": "7.1.3",
4
4
  "license": "UNLICENSED",
5
5
  "lint-staged": {
6
6
  "*.{js,ts,tsx}": "eslint --fix --max-warnings 0"
@@ -26,18 +26,24 @@
26
26
  "leaflet.markercluster": "^1.5.3",
27
27
  "nprogress": "^0.2.0",
28
28
  "qrcode.react": "^3.1.0",
29
+ "qs": "^6.0.0",
30
+ "react": "^18.0.0",
29
31
  "react-chartjs-2": "^5.2.0",
30
32
  "react-color": "^2.19.3",
31
33
  "react-data-grid": "7.0.0-beta.13",
32
34
  "react-dnd": "^16.0.1",
33
35
  "react-dnd-html5-backend": "^16.0.1",
34
36
  "react-dom": "^18.0.0",
37
+ "react-draggable": "^4.4.5",
35
38
  "react-dropzone": "^14.2.2",
36
39
  "react-helmet-async": "^1.3.0",
37
40
  "react-hook-form": "^7.33.1",
41
+ "react-intersection-observer": "^9.4.0",
38
42
  "react-leaflet": "^4.2.1",
43
+ "react-resizable": "^3.0.4",
39
44
  "react-router-dom": "6.3.0",
40
45
  "react-spinners": "^0.13.8",
46
+ "react-splitter-layout": "^4.0.0",
41
47
  "react-toastify": "10.0.5",
42
48
  "react-transition-group": "^4.4.5",
43
49
  "simplebar-react": "3.2.6",
package/style.css ADDED
@@ -0,0 +1,65 @@
1
+ .react-resizable {
2
+ position: relative;
3
+ }
4
+ .react-resizable-handle {
5
+ position: absolute;
6
+ width: 20px;
7
+ height: 20px;
8
+ background-repeat: no-repeat;
9
+ background-origin: content-box;
10
+ box-sizing: border-box;
11
+ background-image: url('data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2IDYiIHN0eWxlPSJiYWNrZ3JvdW5kLWNvbG9yOiNmZmZmZmYwMCIgeD0iMHB4IiB5PSIwcHgiIHdpZHRoPSI2cHgiIGhlaWdodD0iNnB4Ij48ZyBvcGFjaXR5PSIwLjMwMiI+PHBhdGggZD0iTSA2IDYgTCAwIDYgTCAwIDQuMiBMIDQgNC4yIEwgNC4yIDQuMiBMIDQuMiAwIEwgNiAwIEwgNiA2IEwgNiA2IFoiIGZpbGw9IiMwMDAwMDAiLz48L2c+PC9zdmc+');
12
+ background-position: bottom right;
13
+ padding: 0 3px 3px 0;
14
+ }
15
+ .react-resizable-handle-sw {
16
+ bottom: 0;
17
+ left: 0;
18
+ cursor: sw-resize;
19
+ transform: rotate(90deg);
20
+ }
21
+ .react-resizable-handle-se {
22
+ bottom: 0;
23
+ right: 0;
24
+ cursor: se-resize;
25
+ }
26
+ .react-resizable-handle-nw {
27
+ top: 0;
28
+ left: 0;
29
+ cursor: nw-resize;
30
+ transform: rotate(180deg);
31
+ }
32
+ .react-resizable-handle-ne {
33
+ top: 0;
34
+ right: 0;
35
+ cursor: ne-resize;
36
+ transform: rotate(270deg);
37
+ }
38
+ .react-resizable-handle-w,
39
+ .react-resizable-handle-e {
40
+ top: 50%;
41
+ margin-top: -10px;
42
+ cursor: ew-resize;
43
+ }
44
+ .react-resizable-handle-w {
45
+ left: 0;
46
+ transform: rotate(135deg);
47
+ }
48
+ .react-resizable-handle-e {
49
+ right: 0;
50
+ transform: rotate(315deg);
51
+ }
52
+ .react-resizable-handle-n,
53
+ .react-resizable-handle-s {
54
+ left: 50%;
55
+ margin-left: -10px;
56
+ cursor: ns-resize;
57
+ }
58
+ .react-resizable-handle-n {
59
+ top: 0;
60
+ transform: rotate(225deg);
61
+ }
62
+ .react-resizable-handle-s {
63
+ bottom: 0;
64
+ transform: rotate(45deg);
65
+ }