@m4l/components 0.0.1 → 0.0.2
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.
- package/dist/commonjs.js +5 -0
- package/dist/components/FormActions/index.d.ts +3 -0
- package/dist/components/FormActions/index.js +41 -0
- package/dist/components/FormActions/styles.d.ts +2 -0
- package/dist/components/FormActions/types.d.ts +7 -0
- package/dist/components/ModalDialog/components/Header/index.d.ts +3 -0
- package/dist/components/ModalDialog/components/Header/types.d.ts +9 -0
- package/dist/components/ModalDialog/index.d.ts +2 -0
- package/dist/components/ModalDialog/index.js +174 -0
- package/dist/components/ModalDialog/styles.d.ts +9 -0
- package/dist/components/ModalDialog/types.d.ts +5 -0
- package/dist/components/Resizeable/index.d.ts +3 -0
- package/dist/components/Resizeable/index.js +92 -0
- package/dist/components/Resizeable/styles.d.ts +5 -0
- package/dist/components/Resizeable/types.d.ts +8 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/mui_extended/MenuActions/styles.d.ts +2 -2
- package/dist/contexts/ModalContext/components/ContentConfirm/index.d.ts +3 -0
- package/dist/contexts/ModalContext/components/ContentConfirm/styles.d.ts +6 -0
- package/dist/contexts/ModalContext/components/ContentConfirm/types.d.ts +8 -0
- package/dist/contexts/ModalContext/index.d.ts +5 -0
- package/dist/contexts/ModalContext/index.js +68 -0
- package/dist/contexts/ModalContext/types.d.ts +42 -0
- package/dist/hooks/useModal/index.d.ts +1 -0
- package/dist/hooks/useModal/index.js +4 -0
- package/dist/hooks/useResponsive.d.ts +8 -0
- package/dist/index.js +14 -2
- package/dist/prop-types.js +1 -0
- package/dist/react-draggable.js +1435 -0
- package/dist/react-resizable.js +594 -0
- package/dist/react-splitter-layout.js +4 -4
- package/dist/react.js +2 -0
- package/dist/vendor.js +30 -4
- package/package.json +7 -2
package/dist/commonjs.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { useModuleDictionary } from "@m4l/core";
|
|
2
|
+
import { Button } from "@mui/material";
|
|
3
|
+
import { styled } from "@mui/material/styles";
|
|
4
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
5
|
+
const WrapperActions = styled("div")(({
|
|
6
|
+
theme
|
|
7
|
+
}) => ({
|
|
8
|
+
paddingTop: theme.spacing(3),
|
|
9
|
+
display: "flex",
|
|
10
|
+
flexDirection: "row",
|
|
11
|
+
justifyContent: "flex-end",
|
|
12
|
+
"& > button": {
|
|
13
|
+
marginLeft: "10px"
|
|
14
|
+
}
|
|
15
|
+
}));
|
|
16
|
+
const FormActions = (props) => {
|
|
17
|
+
const {
|
|
18
|
+
variant,
|
|
19
|
+
standardActions,
|
|
20
|
+
actionComponents,
|
|
21
|
+
onCloseModal
|
|
22
|
+
} = props;
|
|
23
|
+
const {
|
|
24
|
+
getLabel
|
|
25
|
+
} = useModuleDictionary();
|
|
26
|
+
return /* @__PURE__ */ jsxs(WrapperActions, {
|
|
27
|
+
children: [actionComponents && actionComponents.map((action) => action), standardActions && standardActions.withCancel && /* @__PURE__ */ jsx(Button, {
|
|
28
|
+
variant: "outlined",
|
|
29
|
+
color: variant !== void 0 ? "inherit" : variant,
|
|
30
|
+
onClick: onCloseModal,
|
|
31
|
+
children: getLabel("actions.action_cancel")
|
|
32
|
+
}), standardActions && standardActions.onClickIntro && /* @__PURE__ */ jsx(Button, {
|
|
33
|
+
variant: "contained",
|
|
34
|
+
onClick: standardActions.onClickIntro,
|
|
35
|
+
type: "submit",
|
|
36
|
+
color: variant === "warning" ? "warning" : variant === "error" ? "error" : "info",
|
|
37
|
+
children: getLabel("actions.action_accept")
|
|
38
|
+
})]
|
|
39
|
+
});
|
|
40
|
+
};
|
|
41
|
+
export { FormActions as F };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const WrapperActions: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ModalOpenOptions } from "src/contexts/ModalContext/types";
|
|
2
|
+
declare type ImodalOpt = Pick<ModalOpenOptions, 'actionComponents' | 'standardActions'>;
|
|
3
|
+
export interface ActionsProps extends ImodalOpt {
|
|
4
|
+
variant?: string | undefined;
|
|
5
|
+
onCloseModal?: () => void | undefined;
|
|
6
|
+
}
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import { Dialog, IconButton, Paper } from "@mui/material";
|
|
2
|
+
import { D as Draggable } from "../../react-draggable.js";
|
|
3
|
+
import { u as useModal } from "../../hooks/useModal/index.js";
|
|
4
|
+
import { styled } from "@mui/material/styles";
|
|
5
|
+
import { R as Resizeable } from "../Resizeable/index.js";
|
|
6
|
+
import { u as useResponsiveDesktop } from "../../vendor.js";
|
|
7
|
+
import { useEnvironment } from "@m4l/core";
|
|
8
|
+
import { B as BoxIcon } from "../mui_extended/BoxIcon/index.js";
|
|
9
|
+
import "../mui_extended/MenuPopover/index.js";
|
|
10
|
+
import "react";
|
|
11
|
+
import "react-router-dom";
|
|
12
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
13
|
+
import "../mui_extended/MenuActions/index.js";
|
|
14
|
+
import { F as FormActions } from "../FormActions/index.js";
|
|
15
|
+
const WrapperDialog = styled(Dialog)(() => ({}));
|
|
16
|
+
const Container = styled("div")(({ theme }) => ({
|
|
17
|
+
display: "flex",
|
|
18
|
+
flexDirection: "column",
|
|
19
|
+
height: "100%",
|
|
20
|
+
overflow: "hidden",
|
|
21
|
+
padding: theme.spacing(3)
|
|
22
|
+
}));
|
|
23
|
+
const Header$1 = styled("div")(({ theme }) => ({
|
|
24
|
+
display: "flex",
|
|
25
|
+
flexDirection: "row",
|
|
26
|
+
alignItems: "center",
|
|
27
|
+
height: theme.spacing(5),
|
|
28
|
+
borderBottom: `1px solid ${theme.palette.divider}`,
|
|
29
|
+
overflow: "hidden"
|
|
30
|
+
}));
|
|
31
|
+
const IconTitleContainer = styled("div")(({ theme }) => ({
|
|
32
|
+
display: "flex",
|
|
33
|
+
flexDirection: "row",
|
|
34
|
+
flexGrow: 1,
|
|
35
|
+
alignItems: "center",
|
|
36
|
+
cursor: "move",
|
|
37
|
+
...theme.typography.subtitle1,
|
|
38
|
+
color: theme.palette.text.primary
|
|
39
|
+
}));
|
|
40
|
+
const IconHeader = styled("div")(({ theme, variant }) => ({
|
|
41
|
+
display: "flex",
|
|
42
|
+
alignItems: "center",
|
|
43
|
+
justifyContent: "center",
|
|
44
|
+
marginRight: theme.spacing(1.5),
|
|
45
|
+
"& > span": {
|
|
46
|
+
background: variant === "warning" ? theme.palette.warning.main : variant === "error" ? theme.palette.error.main : variant === "info" ? theme.palette.info.main : theme.palette.text.primary
|
|
47
|
+
}
|
|
48
|
+
}));
|
|
49
|
+
const Content = styled("div")(() => ({
|
|
50
|
+
flexGrow: 1,
|
|
51
|
+
position: "relative"
|
|
52
|
+
}));
|
|
53
|
+
const ModalTitle = styled("div")(({ theme, variant }) => ({
|
|
54
|
+
...theme.typography.subtitle1,
|
|
55
|
+
color: variant === "warning" ? theme.palette.warning.main : variant === "error" ? theme.palette.error.main : variant === "info" ? theme.palette.info.main : theme.palette.text.primary
|
|
56
|
+
}));
|
|
57
|
+
const Header = (props) => {
|
|
58
|
+
const {
|
|
59
|
+
host_static_assets,
|
|
60
|
+
environment
|
|
61
|
+
} = useEnvironment();
|
|
62
|
+
const {
|
|
63
|
+
variant,
|
|
64
|
+
title,
|
|
65
|
+
iconComponent,
|
|
66
|
+
withClose,
|
|
67
|
+
onCloseModal
|
|
68
|
+
} = props;
|
|
69
|
+
const iconSrcWarning = `${host_static_assets}/${environment}/frontend/components/dialog/assets/icons/warning.svg`;
|
|
70
|
+
const iconSrcError = `${host_static_assets}/${environment}/frontend/components/dialog/assets/icons/error.svg`;
|
|
71
|
+
const iconSrcInfo = `${host_static_assets}/${environment}/frontend/components/dialog/assets/icons/info.svg`;
|
|
72
|
+
const iconDefault = `${host_static_assets}/${environment}/frontend/components/dialog/assets/icons/icon_bar_tittle.svg`;
|
|
73
|
+
return /* @__PURE__ */ jsxs(Header$1, {
|
|
74
|
+
id: "Header",
|
|
75
|
+
children: [/* @__PURE__ */ jsxs(IconTitleContainer, {
|
|
76
|
+
className: "draggable-dialog-title",
|
|
77
|
+
children: [/* @__PURE__ */ jsx(IconHeader, {
|
|
78
|
+
variant,
|
|
79
|
+
children: !iconComponent ? /* @__PURE__ */ jsx(BoxIcon, {
|
|
80
|
+
src: variant === "warning" ? iconSrcWarning : variant === "delete" ? iconSrcError : variant === "info" ? iconSrcInfo : iconDefault
|
|
81
|
+
}) : iconComponent
|
|
82
|
+
}), /* @__PURE__ */ jsx(ModalTitle, {
|
|
83
|
+
variant,
|
|
84
|
+
children: title
|
|
85
|
+
})]
|
|
86
|
+
}), withClose && /* @__PURE__ */ jsx(IconButton, {
|
|
87
|
+
onClick: onCloseModal,
|
|
88
|
+
"aria-label": "click",
|
|
89
|
+
children: /* @__PURE__ */ jsx(BoxIcon, {
|
|
90
|
+
src: `${host_static_assets}/${environment}/frontend/components/dialog/assets/icons/close.svg`
|
|
91
|
+
})
|
|
92
|
+
})]
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
const DragabblePaperComponent = (props) => {
|
|
96
|
+
return /* @__PURE__ */ jsx(Draggable, {
|
|
97
|
+
handle: ".draggable-dialog-title",
|
|
98
|
+
cancel: '[class*="MuiDialogContent-root"]',
|
|
99
|
+
children: /* @__PURE__ */ jsx(Paper, {
|
|
100
|
+
sx: {
|
|
101
|
+
maxHeight: "unset",
|
|
102
|
+
maxWidth: "unset"
|
|
103
|
+
},
|
|
104
|
+
...props
|
|
105
|
+
})
|
|
106
|
+
});
|
|
107
|
+
};
|
|
108
|
+
function PaperComponent(props) {
|
|
109
|
+
return /* @__PURE__ */ jsx(Paper, {
|
|
110
|
+
sx: {
|
|
111
|
+
maxHeight: "unset",
|
|
112
|
+
maxWidth: "unset",
|
|
113
|
+
height: "100%"
|
|
114
|
+
},
|
|
115
|
+
...props
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
const ModalDialog = () => {
|
|
119
|
+
const {
|
|
120
|
+
open,
|
|
121
|
+
initialWidth = 600,
|
|
122
|
+
initialHeigth = 400,
|
|
123
|
+
maxWidth,
|
|
124
|
+
maxHeigth,
|
|
125
|
+
withClose = true,
|
|
126
|
+
onQueryClose,
|
|
127
|
+
contentComponent,
|
|
128
|
+
title,
|
|
129
|
+
closeModal,
|
|
130
|
+
iconComponent,
|
|
131
|
+
standardActions,
|
|
132
|
+
actionComponents,
|
|
133
|
+
variant
|
|
134
|
+
} = useModal();
|
|
135
|
+
const isDesktop = useResponsiveDesktop();
|
|
136
|
+
const onCloseModal = () => {
|
|
137
|
+
closeModal();
|
|
138
|
+
};
|
|
139
|
+
const contentComnponent = /* @__PURE__ */ jsxs(Container, {
|
|
140
|
+
id: "Container",
|
|
141
|
+
children: [/* @__PURE__ */ jsx(Header, {
|
|
142
|
+
variant,
|
|
143
|
+
title,
|
|
144
|
+
iconComponent,
|
|
145
|
+
withClose,
|
|
146
|
+
onCloseModal
|
|
147
|
+
}), /* @__PURE__ */ jsx(Content, {
|
|
148
|
+
id: "Content",
|
|
149
|
+
children: typeof contentComponent === "function" ? contentComponent() : contentComponent
|
|
150
|
+
}), (standardActions || actionComponents) && /* @__PURE__ */ jsx(FormActions, {
|
|
151
|
+
variant,
|
|
152
|
+
standardActions,
|
|
153
|
+
actionComponents,
|
|
154
|
+
onCloseModal
|
|
155
|
+
})]
|
|
156
|
+
});
|
|
157
|
+
return /* @__PURE__ */ jsxs(WrapperDialog, {
|
|
158
|
+
open,
|
|
159
|
+
onClose: onQueryClose,
|
|
160
|
+
"aria-labelledby": "child-modal-title",
|
|
161
|
+
"aria-describedby": "child-modal-description",
|
|
162
|
+
PaperComponent: isDesktop ? DragabblePaperComponent : PaperComponent,
|
|
163
|
+
maxWidth: false,
|
|
164
|
+
fullWidth: !isDesktop,
|
|
165
|
+
children: [isDesktop && /* @__PURE__ */ jsx(Resizeable, {
|
|
166
|
+
width: initialWidth,
|
|
167
|
+
height: initialHeigth,
|
|
168
|
+
maxWidth,
|
|
169
|
+
maxHeigth,
|
|
170
|
+
children: contentComnponent
|
|
171
|
+
}), !isDesktop && contentComnponent]
|
|
172
|
+
});
|
|
173
|
+
};
|
|
174
|
+
export { ModalDialog as M };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { VariantProps } from './types';
|
|
3
|
+
export declare const WrapperDialog: import("@emotion/styled").StyledComponent<import("@mui/material").DialogProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
4
|
+
export declare const Container: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
5
|
+
export declare const Header: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
6
|
+
export declare const IconTitleContainer: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
7
|
+
export declare const IconHeader: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & VariantProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
8
|
+
export declare const Content: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
9
|
+
export declare const ModalTitle: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & VariantProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { styled } from "@mui/material/styles";
|
|
2
|
+
import { R as ResizableBox } from "../../react-resizable.js";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
const WrapperResizeable = styled(ResizableBox)(({
|
|
5
|
+
theme
|
|
6
|
+
}) => ({
|
|
7
|
+
"&.react-resizable": {
|
|
8
|
+
position: "relative",
|
|
9
|
+
width: "100%",
|
|
10
|
+
height: "100%"
|
|
11
|
+
},
|
|
12
|
+
"& .react-resizable-handle": {
|
|
13
|
+
position: "absolute",
|
|
14
|
+
width: "20px",
|
|
15
|
+
height: "20px",
|
|
16
|
+
margin: "4px",
|
|
17
|
+
backgroundRepeat: "no-repeat",
|
|
18
|
+
backgroundOrigin: "content-box",
|
|
19
|
+
boxSizing: "border-box",
|
|
20
|
+
backgroundColor: theme.palette.action.active,
|
|
21
|
+
mask: `url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3C!-- Generator: Adobe Illustrator 26.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3Csvg version='1.1' id='Capa_1' focusable='false' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 24 24' style='enable-background:new 0 0 24 24;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0%7Bfill:none;%7D%0A%3C/style%3E%3Cg id='Grupo_5256'%3E%3C/g%3E%3Cpath class='st0' d='z'/%3E%3Cg%3E%3Cpolygon points='21.9,21.9 15.8,21.9 15.8,19.9 19.9,19.9 19.9,15.9 21.9,15.9 '/%3E%3C/g%3E%3C/svg%3E%0A")`,
|
|
22
|
+
backgroundImage: `url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='utf-8'%3F%3E%3C!-- Generator: Adobe Illustrator 26.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) --%3E%3Csvg version='1.1' id='Capa_1' focusable='false' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 24 24' style='enable-background:new 0 0 24 24;' xml:space='preserve'%3E%3Cstyle type='text/css'%3E .st0%7Bfill:none;%7D%0A%3C/style%3E%3Cg id='Grupo_5256'%3E%3C/g%3E%3Cpath class='st0' d='z'/%3E%3Cg%3E%3Cpolygon points='21.9,21.9 15.8,21.9 15.8,19.9 19.9,19.9 19.9,15.9 21.9,15.9 '/%3E%3C/g%3E%3C/svg%3E%0A")`,
|
|
23
|
+
backgroundPosition: "bottom right",
|
|
24
|
+
padding: "0 3px 3px 0"
|
|
25
|
+
},
|
|
26
|
+
"& .react-resizable-handle-sw": {
|
|
27
|
+
bottom: "0",
|
|
28
|
+
left: "0",
|
|
29
|
+
cursor: "sw-resize",
|
|
30
|
+
transform: "rotate(90deg)"
|
|
31
|
+
},
|
|
32
|
+
".react-resizable-handle-se": {
|
|
33
|
+
bottom: "0",
|
|
34
|
+
right: "0",
|
|
35
|
+
cursor: "se-resize"
|
|
36
|
+
},
|
|
37
|
+
"& .react-resizable-handle-nw": {
|
|
38
|
+
top: "0",
|
|
39
|
+
left: "0",
|
|
40
|
+
cursor: "nw-resize",
|
|
41
|
+
transform: "rotate(180deg)"
|
|
42
|
+
},
|
|
43
|
+
"& .react-resizable-handle-ne": {
|
|
44
|
+
top: "0",
|
|
45
|
+
right: "0",
|
|
46
|
+
cursor: "ne-resize",
|
|
47
|
+
transform: "rotate(270deg)"
|
|
48
|
+
},
|
|
49
|
+
"& .react-resizable-handle-w, .react-resizable-handle-e": {
|
|
50
|
+
top: "50%",
|
|
51
|
+
marginTop: "-10px",
|
|
52
|
+
cursor: "ew-resize"
|
|
53
|
+
},
|
|
54
|
+
"& .react-resizable-handle-w": {
|
|
55
|
+
left: "0",
|
|
56
|
+
transform: "rotate(135deg)"
|
|
57
|
+
},
|
|
58
|
+
"& .react-resizable-handle-e": {
|
|
59
|
+
right: "0",
|
|
60
|
+
transform: "rotate(315deg) "
|
|
61
|
+
},
|
|
62
|
+
"& .react-resizable-handle-n,.react-resizable-handle-s": {
|
|
63
|
+
left: "50%",
|
|
64
|
+
marginLeft: "-10px",
|
|
65
|
+
cursor: "ns-resize"
|
|
66
|
+
},
|
|
67
|
+
"& .react-resizable-handle-n": {
|
|
68
|
+
top: "0",
|
|
69
|
+
transform: "rotate(225deg)"
|
|
70
|
+
},
|
|
71
|
+
"& .react-resizable-handle-s": {
|
|
72
|
+
bottom: "0",
|
|
73
|
+
transform: "rotate(45deg)"
|
|
74
|
+
}
|
|
75
|
+
}));
|
|
76
|
+
function Resizeable(props) {
|
|
77
|
+
const {
|
|
78
|
+
children,
|
|
79
|
+
width,
|
|
80
|
+
height,
|
|
81
|
+
maxHeigth,
|
|
82
|
+
maxWidth
|
|
83
|
+
} = props;
|
|
84
|
+
return /* @__PURE__ */ jsx(WrapperResizeable, {
|
|
85
|
+
width,
|
|
86
|
+
height,
|
|
87
|
+
maxConstraints: maxHeigth && maxWidth ? [maxWidth, maxHeigth] : void 0,
|
|
88
|
+
resizeHandles: ["se", "nw"],
|
|
89
|
+
children
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
export { Resizeable as R };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ResizableBox } from 'react-resizable';
|
|
3
|
+
export declare const WrapperResizeable: import("@emotion/styled").StyledComponent<import("react-resizable").ResizableProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {
|
|
4
|
+
ref?: import("react").Ref<ResizableBox> | undefined;
|
|
5
|
+
}>;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
export declare const WrapperMenuActions: import("@emotion/styled").StyledComponent<{
|
|
3
3
|
children?: import("react").ReactNode;
|
|
4
4
|
classes?: Partial<import("@mui/material").IconButtonClasses> | undefined;
|
|
5
|
-
color?: "inherit" | "
|
|
5
|
+
color?: "inherit" | "primary" | "secondary" | "success" | "error" | "info" | "warning" | "default" | undefined;
|
|
6
6
|
disabled?: boolean | undefined;
|
|
7
7
|
disableFocusRipple?: boolean | undefined;
|
|
8
8
|
edge?: false | "end" | "start" | undefined;
|
|
@@ -26,5 +26,5 @@ export declare const WrapperMenuActions: import("@emotion/styled").StyledCompone
|
|
|
26
26
|
touchRippleRef?: import("react").Ref<import("@mui/material/ButtonBase/TouchRipple").TouchRippleActions> | undefined;
|
|
27
27
|
}, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "key" | keyof import("react").ButtonHTMLAttributes<HTMLButtonElement>> & {
|
|
28
28
|
ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
|
|
29
|
-
}, "color" | "sx" | "children" | keyof import("@mui/material/OverridableComponent").CommonProps | "tabIndex" | "
|
|
29
|
+
}, "color" | "sx" | "children" | keyof import("@mui/material/OverridableComponent").CommonProps | "tabIndex" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "size" | "edge"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
30
30
|
export declare const LabelMemuItem: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { VariantProps } from './types';
|
|
3
|
+
export declare const WrapperContentConfirm: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
4
|
+
export declare const ModalContent: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
5
|
+
export declare const IllustrationContainer: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & VariantProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
6
|
+
export declare const MessageContainer: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme> & VariantProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import "@mui/material/Typography";
|
|
2
|
+
import { voidFunction } from "@m4l/core";
|
|
3
|
+
import "@mui/material/Box";
|
|
4
|
+
import "react/jsx-runtime";
|
|
5
|
+
import { createContext } from "react";
|
|
6
|
+
import { styled } from "@mui/material/styles";
|
|
7
|
+
import "@mui/material";
|
|
8
|
+
import "../../react-draggable.js";
|
|
9
|
+
import "../../components/ModalDialog/index.js";
|
|
10
|
+
import "../../components/Resizeable/index.js";
|
|
11
|
+
import "@mui/material/useMediaQuery";
|
|
12
|
+
import "../../components/mui_extended/MenuPopover/index.js";
|
|
13
|
+
import "react-router-dom";
|
|
14
|
+
import "../../components/mui_extended/MenuActions/index.js";
|
|
15
|
+
import "../../components/FormActions/index.js";
|
|
16
|
+
styled("div")(() => ({
|
|
17
|
+
display: "flex",
|
|
18
|
+
flexDirection: "column",
|
|
19
|
+
height: "100%"
|
|
20
|
+
}));
|
|
21
|
+
styled("div")(({
|
|
22
|
+
theme
|
|
23
|
+
}) => ({
|
|
24
|
+
display: "flex",
|
|
25
|
+
flexDirection: "column",
|
|
26
|
+
justifyContent: "center",
|
|
27
|
+
alignItems: "center",
|
|
28
|
+
gridGap: theme.spacing(5),
|
|
29
|
+
flexGrow: 1,
|
|
30
|
+
[theme.breakpoints.up("sm")]: {
|
|
31
|
+
display: "grid",
|
|
32
|
+
flexDirection: "row",
|
|
33
|
+
gridTemplateColumns: "1fr 1fr"
|
|
34
|
+
}
|
|
35
|
+
}));
|
|
36
|
+
styled("div")(({
|
|
37
|
+
theme,
|
|
38
|
+
variant
|
|
39
|
+
}) => ({
|
|
40
|
+
display: "flex",
|
|
41
|
+
justifyContent: "center",
|
|
42
|
+
alignItems: "center",
|
|
43
|
+
"& > span": {
|
|
44
|
+
background: variant === "warning" ? theme.palette.warning.main : variant === "delete" ? theme.palette.error.main : variant === "info" ? theme.palette.info.main : "theme.palette.text.primary"
|
|
45
|
+
}
|
|
46
|
+
}));
|
|
47
|
+
styled("div")(() => ({
|
|
48
|
+
display: "flex",
|
|
49
|
+
alignItems: "center"
|
|
50
|
+
}));
|
|
51
|
+
const initialState = {
|
|
52
|
+
initialWidth: 600,
|
|
53
|
+
initialHeigth: 400,
|
|
54
|
+
open: false,
|
|
55
|
+
withClose: true,
|
|
56
|
+
onQueryClose: voidFunction,
|
|
57
|
+
iconComponent: void 0,
|
|
58
|
+
contentComponent: void 0,
|
|
59
|
+
actionComponents: void 0,
|
|
60
|
+
openModal: voidFunction,
|
|
61
|
+
openModalConfirm: voidFunction,
|
|
62
|
+
closeModal: voidFunction,
|
|
63
|
+
hasChanges: false,
|
|
64
|
+
setChanges: voidFunction,
|
|
65
|
+
title: ""
|
|
66
|
+
};
|
|
67
|
+
const ModalContext = createContext(initialState);
|
|
68
|
+
export { ModalContext as M };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
export declare type TProps = {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
};
|
|
5
|
+
export interface StandarActions {
|
|
6
|
+
withCancel?: boolean;
|
|
7
|
+
onClickIntro?: () => void;
|
|
8
|
+
onClickCancel?: () => void;
|
|
9
|
+
}
|
|
10
|
+
export declare type VariantModal = 'warning' | 'delete' | 'info';
|
|
11
|
+
export interface ModalOpenOptions {
|
|
12
|
+
initialWidth?: number;
|
|
13
|
+
initialHeigth?: number;
|
|
14
|
+
maxWidth?: number;
|
|
15
|
+
maxHeigth?: number;
|
|
16
|
+
withClose?: boolean;
|
|
17
|
+
onQueryClose?: () => void;
|
|
18
|
+
title: string;
|
|
19
|
+
iconComponent?: ReactNode;
|
|
20
|
+
contentComponent?: ((props?: any) => JSX.Element) | ReactNode;
|
|
21
|
+
actionComponents?: ReactNode[];
|
|
22
|
+
standardActions?: StandarActions;
|
|
23
|
+
}
|
|
24
|
+
export interface OpenModalConfirmProps {
|
|
25
|
+
title: string;
|
|
26
|
+
variant?: VariantModal;
|
|
27
|
+
titleAccept?: string;
|
|
28
|
+
msg: string;
|
|
29
|
+
onClickIntro?: () => void;
|
|
30
|
+
onClickCancel?: () => void;
|
|
31
|
+
}
|
|
32
|
+
export interface ModalState extends ModalOpenOptions {
|
|
33
|
+
open: boolean;
|
|
34
|
+
variant?: VariantModal;
|
|
35
|
+
}
|
|
36
|
+
export interface ModalContextProps extends ModalState {
|
|
37
|
+
openModal: (modalProps: ModalOpenOptions) => void;
|
|
38
|
+
openModalConfirm: (modalOpenProps: OpenModalConfirmProps) => void;
|
|
39
|
+
closeModal: () => void;
|
|
40
|
+
setChanges?: () => void;
|
|
41
|
+
hasChanges: boolean;
|
|
42
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useModal: () => import("../../contexts/ModalContext/types").ModalContextProps;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Breakpoint } from '@mui/material';
|
|
2
|
+
declare type Query = 'up' | 'down' | 'between' | 'only';
|
|
3
|
+
declare type Key = Breakpoint | number;
|
|
4
|
+
declare type Start = Breakpoint | number;
|
|
5
|
+
declare type End = Breakpoint | number;
|
|
6
|
+
export declare function useResponsive(query: Query, key?: Key, start?: Start, end?: End): boolean | undefined;
|
|
7
|
+
export declare function useResponsiveDesktop(): boolean | undefined;
|
|
8
|
+
export {};
|
package/dist/index.js
CHANGED
|
@@ -2,6 +2,9 @@ export { B as BoxIcon } from "./components/mui_extended/BoxIcon/index.js";
|
|
|
2
2
|
export { M as MenuPopover } from "./components/mui_extended/MenuPopover/index.js";
|
|
3
3
|
export { B as Breadcrumbs } from "./components/mui_extended/Breadcrumbs/index.js";
|
|
4
4
|
export { M as MenuActions } from "./components/mui_extended/MenuActions/index.js";
|
|
5
|
+
export { F as FormActions } from "./components/FormActions/index.js";
|
|
6
|
+
export { M as ModalDialog } from "./components/ModalDialog/index.js";
|
|
7
|
+
export { R as Resizeable } from "./components/Resizeable/index.js";
|
|
5
8
|
export { S as SplitLayout } from "./components/SplitLayout/index.js";
|
|
6
9
|
import "@mui/material/Box";
|
|
7
10
|
import "react/jsx-runtime";
|
|
@@ -10,6 +13,15 @@ import "@mui/material";
|
|
|
10
13
|
import "react";
|
|
11
14
|
import "@m4l/core";
|
|
12
15
|
import "react-router-dom";
|
|
13
|
-
import "./react-
|
|
14
|
-
import "./vendor.js";
|
|
16
|
+
import "./react-draggable.js";
|
|
15
17
|
import "prop-types";
|
|
18
|
+
import "react-dom";
|
|
19
|
+
import "clsx";
|
|
20
|
+
import "./hooks/useModal/index.js";
|
|
21
|
+
import "./contexts/ModalContext/index.js";
|
|
22
|
+
import "@mui/material/Typography";
|
|
23
|
+
import "@mui/material/useMediaQuery";
|
|
24
|
+
import "./vendor.js";
|
|
25
|
+
import "./react-splitter-layout.js";
|
|
26
|
+
import "./commonjs.js";
|
|
27
|
+
import "./react-resizable.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "prop-types";
|