@m4l/components 0.1.36 → 0.1.37
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.bcc6b707.js → commonjs.565e6834.js} +0 -1
- package/dist/components/CommonActions/components/ActionCancel/{index.4b36950f.js → index.9230c57b.js} +1 -1
- package/dist/components/CommonActions/components/ActionFormCancel/{index.945e9887.js → index.ab514bd9.js} +9 -7
- package/dist/components/CommonActions/components/ActionIntro/{index.35a0d240.js → index.a0a341c7.js} +1 -1
- package/dist/components/CommonActions/components/Actions/index.d3e1f36e.js +54 -0
- package/dist/components/DataGrid/{index.156cc30c.js → index.67260455.js} +663 -15
- package/dist/components/DynamicFilter/{index.32f84995.js → index.071aa795.js} +92 -18
- package/dist/components/Icon/{index.1dbd3e58.js → index.8d754623.js} +62 -5
- package/dist/components/LanguagePopover/index.cbc4b282.js +144 -0
- package/dist/components/Loadable/{index.8c6006be.js → index.117eaced.js} +1 -1
- package/dist/components/ModalDialog/{index.91777582.js → index.a684827f.js} +5 -5
- package/dist/components/ObjectLogs/{index.9d3fc2ae.js → index.4a859658.js} +12 -10
- package/dist/components/PaperForm/{index.218a6c4b.js → index.c5948756.js} +1 -1
- package/dist/components/Period/{index.74f35862.js → index.abe445bd.js} +9 -7
- package/dist/components/Resizeable/{index.44a0dd46.js → index.c96c0f09.js} +1 -1
- package/dist/components/SplitLayout/{index.81fc4750.js → index.5a8355d8.js} +1 -1
- package/dist/components/animate/PropagateLoader/index.be5b02c3.js +30 -0
- package/dist/components/areas/components/AreasAdmin/index.6794b22f.js +112 -0
- package/dist/components/areas/components/AreasContainer/index.a2f8899b.js +43 -0
- package/dist/components/areas/components/GridLayout/index.b9c1e846.js +92 -0
- package/dist/components/areas/components/Window/index.252fbf4e.js +646 -0
- package/dist/components/areas/components/WindowPopUp/index.214cf099.js +120 -0
- package/dist/components/areas/components/index.7d6cd649.js +67 -0
- package/dist/components/areas/contexts/AreaContext/index.4894cf23.js +286 -0
- package/dist/components/areas/contexts/AreasContext/index.cd8e4bee.js +158 -0
- package/dist/components/areas/contexts/DynamicMFParmsContext/index.668bc2e2.js +17 -0
- package/dist/components/areas/contexts/index.f9196fb2.js +1 -0
- package/dist/components/areas/hooks/useArea/index.9b85ce24.js +19 -0
- package/dist/components/areas/hooks/useDynamicMFParameters/index.e6a44ae3.js +11 -0
- package/dist/components/areas/index.d1bf612c.js +16 -0
- package/dist/components/formatters/BooleanFormatter/{index.efc8ffc2.js → index.3a9b16c8.js} +1 -1
- package/dist/components/formatters/{index.c3f4b687.js → index.0b5f95d0.js} +1 -1
- package/dist/components/hook-form/RHFPeriod/{index.2b8e63a2.js → index.3772295b.js} +1 -1
- package/dist/components/hook-form/RHFTextField/{index.7feaec71.js → index.b17d68f4.js} +1 -1
- package/dist/components/modal/WindowBase.04439b8e.js +120 -0
- package/dist/components/modal/WindowConfirm.0b8a6818.js +115 -0
- package/dist/components/modal/index.8387e90e.js +18 -0
- package/dist/components/mui_extended/Accordion/{index.8e123c57.js → index.a541c71c.js} +2 -2
- package/dist/components/mui_extended/Button/index.86a155a2.js +101 -0
- package/dist/components/mui_extended/IconButton/{index.e3adaa33.js → index.82f16572.js} +5 -62
- package/dist/components/mui_extended/MenuActions/index.ee17bddd.js +112 -0
- package/dist/components/mui_extended/Pager/{index.d245f821.js → index.74d3f5fc.js} +66 -1
- package/dist/components/mui_extended/Popover/index.53c77d23.js +137 -0
- package/dist/components/mui_extended/index.85dfadf1.js +16 -0
- package/dist/contexts/ModalContext/{index.0797eb17.js → index.b90eec94.js} +1 -1
- package/dist/hooks/useModal/{index.32da4dcb.js → index.d14edee3.js} +1 -1
- package/dist/index.js +128 -1691
- package/dist/{components/animate/PropagateLoader/index.eb401503.js → node_modules.416f1da3.js} +59 -28
- package/dist/package.json +2 -1
- package/dist/{react-draggable.3b5b6680.js → react-draggable.84d6b038.js} +1 -1
- package/dist/{react-json-view.03ae95f5.js → react-json-view.57125fcf.js} +1 -1
- package/dist/{react-resizable.6eae0397.js → react-resizable.1d00271d.js} +3 -4
- package/dist/{react-splitter-layout.873aece3.js → react-splitter-layout.8b1655c8.js} +1 -1
- package/dist/style.css +0 -114
- package/dist/utils/{index.9dce2e2f.js → index.899eb67b.js} +28 -460
- package/package.json +3 -1
- package/vite.config.ts +201 -129
- package/dist/components/CommonActions/components/Actions/index.ba86f72f.js +0 -868
- package/dist/components/mui_extended/Button/index.55fc70dc.js +0 -178
- package/dist/components/mui_extended/Popover/index.97cf3a3e.js +0 -275
- package/dist/node_modules.e0b84fac.js +0 -2154
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import "./components/index.7d6cd649.js";
|
|
2
|
+
import "./components/AreasAdmin/index.6794b22f.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import "@m4l/core";
|
|
5
|
+
import "@mui/material";
|
|
6
|
+
import "../Icon/index.8d754623.js";
|
|
7
|
+
import "@mui/material/styles";
|
|
8
|
+
import "react/jsx-runtime";
|
|
9
|
+
import "./contexts/AreasContext/index.cd8e4bee.js";
|
|
10
|
+
import "./components/AreasContainer/index.a2f8899b.js";
|
|
11
|
+
import "react-grid-layout/css/styles.css";
|
|
12
|
+
import "../../react-resizable.1d00271d.js";
|
|
13
|
+
const LABEL_NEW_AREA = "label_new_area";
|
|
14
|
+
export {
|
|
15
|
+
LABEL_NEW_AREA as L
|
|
16
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useMemo } from "react";
|
|
2
2
|
import { useModuleDictionary, useEnvironment } from "@m4l/core";
|
|
3
|
-
import { I as Icon } from "../../Icon/index.
|
|
3
|
+
import { I as Icon } from "../../Icon/index.8d754623.js";
|
|
4
4
|
import { W as WrapperComponent } from "../../WrapperComponent/index.5e872594.js";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
function BooleanFormatter(props) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { styled } from "@mui/material";
|
|
2
2
|
import { useFormContext, Controller } from "react-hook-form";
|
|
3
3
|
import { E as ErrorLabel } from "../../ErrorLabel/index.c8615f16.js";
|
|
4
|
-
import { P as Period } from "../../Period/index.
|
|
4
|
+
import { P as Period } from "../../Period/index.abe445bd.js";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
const Wrapper = styled("div")(({
|
|
7
7
|
theme
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useModuleSkeleton, useEnvironment } from "@m4l/core";
|
|
2
2
|
import { styled, Skeleton, TextField, InputAdornment } from "@mui/material";
|
|
3
3
|
import { forwardRef, useState } from "react";
|
|
4
|
-
import { I as IconButton } from "../../mui_extended/IconButton/index.
|
|
4
|
+
import { I as IconButton } from "../../mui_extended/IconButton/index.82f16572.js";
|
|
5
5
|
import { useFormContext, Controller } from "react-hook-form";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
const WrapperSkeletonRHFTextField = styled("div")(({
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { useEnvironment } from "@m4l/core";
|
|
2
|
+
import "react";
|
|
3
|
+
import { u as useModal } from "../../hooks/useModal/index.d14edee3.js";
|
|
4
|
+
import "../areas/contexts/DynamicMFParmsContext/index.668bc2e2.js";
|
|
5
|
+
import { styled } from "@mui/material/styles";
|
|
6
|
+
import { a as getThemeVariantColor } from "../../utils/index.899eb67b.js";
|
|
7
|
+
import { IconButton } from "@mui/material";
|
|
8
|
+
import { I as Icon } from "../Icon/index.8d754623.js";
|
|
9
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
10
|
+
const WrapperWindowBase = styled("div")(({ theme }) => ({
|
|
11
|
+
display: "flex",
|
|
12
|
+
flexDirection: "column",
|
|
13
|
+
height: "100%",
|
|
14
|
+
overflow: "hidden",
|
|
15
|
+
padding: theme.spacing(3)
|
|
16
|
+
}));
|
|
17
|
+
const WrapperHeader = styled("div")(({
|
|
18
|
+
theme
|
|
19
|
+
}) => ({
|
|
20
|
+
display: "flex",
|
|
21
|
+
alignItems: "center",
|
|
22
|
+
justifyContent: "space-between",
|
|
23
|
+
minHeight: theme.spacing(5),
|
|
24
|
+
borderBottom: `1px solid ${theme.palette.divider}`,
|
|
25
|
+
overflow: "hidden"
|
|
26
|
+
}));
|
|
27
|
+
styled("div")(({
|
|
28
|
+
theme
|
|
29
|
+
}) => ({
|
|
30
|
+
display: "flex",
|
|
31
|
+
flexDirection: "row",
|
|
32
|
+
flexGrow: 1,
|
|
33
|
+
alignItems: "center",
|
|
34
|
+
cursor: "move",
|
|
35
|
+
...theme.typography.subtitle1,
|
|
36
|
+
color: theme.palette.text.primary
|
|
37
|
+
}));
|
|
38
|
+
const IconHeader = styled("div")(({
|
|
39
|
+
theme,
|
|
40
|
+
variant
|
|
41
|
+
}) => ({
|
|
42
|
+
display: "flex",
|
|
43
|
+
alignItems: "center",
|
|
44
|
+
justifyContent: "center",
|
|
45
|
+
marginRight: theme.spacing(1.5),
|
|
46
|
+
"& > span": {
|
|
47
|
+
background: getThemeVariantColor(theme, variant)
|
|
48
|
+
}
|
|
49
|
+
}));
|
|
50
|
+
const ModalTitle = styled("div")(({
|
|
51
|
+
theme,
|
|
52
|
+
variant
|
|
53
|
+
}) => ({
|
|
54
|
+
...theme.typography.subtitle1,
|
|
55
|
+
color: getThemeVariantColor(theme, variant),
|
|
56
|
+
width: "100%",
|
|
57
|
+
whiteSpace: "nowrap",
|
|
58
|
+
textOverflow: "ellipsis",
|
|
59
|
+
overflow: "hidden"
|
|
60
|
+
}));
|
|
61
|
+
const Header = (props) => {
|
|
62
|
+
const {
|
|
63
|
+
host_static_assets,
|
|
64
|
+
environment_assets
|
|
65
|
+
} = useEnvironment();
|
|
66
|
+
const {
|
|
67
|
+
variant,
|
|
68
|
+
title,
|
|
69
|
+
onClickCancel
|
|
70
|
+
} = props;
|
|
71
|
+
const iconSrcWarning = `${host_static_assets}/${environment_assets}/frontend/components/dialog/assets/icons/warning.svg`;
|
|
72
|
+
const iconSrcError = `${host_static_assets}/${environment_assets}/frontend/components/dialog/assets/icons/error.svg`;
|
|
73
|
+
const iconSrcInfo = `${host_static_assets}/${environment_assets}/frontend/components/dialog/assets/icons/info.svg`;
|
|
74
|
+
const iconDefault = `${host_static_assets}/${environment_assets}/frontend/components/dialog/assets/icons/icon_bar_title.svg`;
|
|
75
|
+
return /* @__PURE__ */ jsxs(WrapperHeader, {
|
|
76
|
+
id: "Header",
|
|
77
|
+
className: "m4l_draggable_handle",
|
|
78
|
+
children: [/* @__PURE__ */ jsx(IconHeader, {
|
|
79
|
+
variant,
|
|
80
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
81
|
+
src: variant === "warning" ? iconSrcWarning : variant === "delete" ? iconSrcError : variant === "info" ? iconSrcInfo : iconDefault
|
|
82
|
+
})
|
|
83
|
+
}), /* @__PURE__ */ jsx(ModalTitle, {
|
|
84
|
+
variant,
|
|
85
|
+
children: title
|
|
86
|
+
}), /* @__PURE__ */ jsx(IconButton, {
|
|
87
|
+
onClick: onClickCancel,
|
|
88
|
+
"aria-label": "click",
|
|
89
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
90
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/dialog/assets/icons/close.svg`
|
|
91
|
+
})
|
|
92
|
+
})]
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
const WindowBase = (props) => {
|
|
96
|
+
const {
|
|
97
|
+
variant,
|
|
98
|
+
title,
|
|
99
|
+
children,
|
|
100
|
+
onClickCancel
|
|
101
|
+
} = props;
|
|
102
|
+
const {
|
|
103
|
+
closeModal
|
|
104
|
+
} = useModal();
|
|
105
|
+
const onCloseCancel = () => {
|
|
106
|
+
onClickCancel && onClickCancel();
|
|
107
|
+
closeModal();
|
|
108
|
+
};
|
|
109
|
+
return /* @__PURE__ */ jsxs(WrapperWindowBase, {
|
|
110
|
+
id: "WrapperWindowBase",
|
|
111
|
+
children: [/* @__PURE__ */ jsx(Header, {
|
|
112
|
+
variant,
|
|
113
|
+
title,
|
|
114
|
+
onClickCancel: onCloseCancel
|
|
115
|
+
}), children]
|
|
116
|
+
});
|
|
117
|
+
};
|
|
118
|
+
export {
|
|
119
|
+
WindowBase as W
|
|
120
|
+
};
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import { useEnvironment } from "@m4l/core";
|
|
2
|
+
import "react";
|
|
3
|
+
import { u as useModal } from "../../hooks/useModal/index.d14edee3.js";
|
|
4
|
+
import "../areas/contexts/DynamicMFParmsContext/index.668bc2e2.js";
|
|
5
|
+
import { A as Actions } from "../CommonActions/components/Actions/index.d3e1f36e.js";
|
|
6
|
+
import { A as ActionCancel } from "../CommonActions/components/ActionCancel/index.9230c57b.js";
|
|
7
|
+
import { A as ActionIntro } from "../CommonActions/components/ActionIntro/index.a0a341c7.js";
|
|
8
|
+
import "react-hook-form";
|
|
9
|
+
import { Typography } from "@mui/material";
|
|
10
|
+
import "@mui/material/Button";
|
|
11
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
import "../../react-draggable.84d6b038.js";
|
|
13
|
+
import "../ModalDialog/index.a684827f.js";
|
|
14
|
+
import "../Resizeable/index.c96c0f09.js";
|
|
15
|
+
import "@m4l/graphics";
|
|
16
|
+
import { styled } from "@mui/material/styles";
|
|
17
|
+
import { I as Icon } from "../Icon/index.8d754623.js";
|
|
18
|
+
import { b as getVariantColor } from "../../utils/index.899eb67b.js";
|
|
19
|
+
import { W as WindowBase } from "./WindowBase.04439b8e.js";
|
|
20
|
+
import "@mui/lab";
|
|
21
|
+
const WrapperMessageIlustration = styled("div")(() => ({
|
|
22
|
+
display: "flex",
|
|
23
|
+
flexDirection: "column",
|
|
24
|
+
height: "100%"
|
|
25
|
+
}));
|
|
26
|
+
const ModalContent = styled("div")(({
|
|
27
|
+
theme
|
|
28
|
+
}) => ({
|
|
29
|
+
display: "flex",
|
|
30
|
+
flexDirection: "column",
|
|
31
|
+
justifyContent: "center",
|
|
32
|
+
alignItems: "center",
|
|
33
|
+
gridGap: theme.spacing(5),
|
|
34
|
+
flexGrow: 1,
|
|
35
|
+
[theme.breakpoints.up("sm")]: {
|
|
36
|
+
display: "grid",
|
|
37
|
+
flexDirection: "row",
|
|
38
|
+
gridTemplateColumns: "1fr 1fr"
|
|
39
|
+
}
|
|
40
|
+
}));
|
|
41
|
+
const IllustrationContainer = styled("div")(({
|
|
42
|
+
theme,
|
|
43
|
+
variant
|
|
44
|
+
}) => ({
|
|
45
|
+
display: "flex",
|
|
46
|
+
justifyContent: "center",
|
|
47
|
+
alignItems: "center",
|
|
48
|
+
"& > span": {
|
|
49
|
+
background: variant === "warning" ? theme.palette.warning.main : variant === "delete" ? theme.palette.error.main : variant === "info" ? theme.palette.info.main : "theme.palette.text.primary"
|
|
50
|
+
}
|
|
51
|
+
}));
|
|
52
|
+
const MessageContainer = styled("div")(() => ({
|
|
53
|
+
display: "flex",
|
|
54
|
+
alignItems: "center"
|
|
55
|
+
}));
|
|
56
|
+
const MessageIlustration = (props) => {
|
|
57
|
+
const {
|
|
58
|
+
variant = "info",
|
|
59
|
+
msg = "Are you sure you want to perform this action? Once complete, the information will be deleted."
|
|
60
|
+
} = props;
|
|
61
|
+
const {
|
|
62
|
+
host_static_assets,
|
|
63
|
+
environment_assets
|
|
64
|
+
} = useEnvironment();
|
|
65
|
+
const illustrationWarning = `${host_static_assets}/${environment_assets}/frontend/components/dialog/assets/icons/illustration_confirm_warning.svg`;
|
|
66
|
+
const illustrationError = `${host_static_assets}/${environment_assets}/frontend/components/dialog/assets/icons/illustration_confirm_danger.svg`;
|
|
67
|
+
const illustrationInfo = `${host_static_assets}/${environment_assets}/frontend/components/dialog/assets/icons/illustration_confirm_info.svg`;
|
|
68
|
+
return /* @__PURE__ */ jsx(WrapperMessageIlustration, {
|
|
69
|
+
children: /* @__PURE__ */ jsxs(ModalContent, {
|
|
70
|
+
children: [/* @__PURE__ */ jsx(IllustrationContainer, {
|
|
71
|
+
variant,
|
|
72
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
73
|
+
src: variant === "warning" ? illustrationWarning : variant === "delete" ? illustrationError : illustrationInfo,
|
|
74
|
+
size: "230px"
|
|
75
|
+
})
|
|
76
|
+
}), /* @__PURE__ */ jsx(MessageContainer, {
|
|
77
|
+
children: /* @__PURE__ */ jsx(Typography, {
|
|
78
|
+
variant: "body1",
|
|
79
|
+
children: msg
|
|
80
|
+
})
|
|
81
|
+
})]
|
|
82
|
+
})
|
|
83
|
+
});
|
|
84
|
+
};
|
|
85
|
+
const WindowConfirm = (props) => {
|
|
86
|
+
const {
|
|
87
|
+
variant,
|
|
88
|
+
title,
|
|
89
|
+
onClickCancel,
|
|
90
|
+
onClickIntro
|
|
91
|
+
} = props;
|
|
92
|
+
const {
|
|
93
|
+
closeModal
|
|
94
|
+
} = useModal();
|
|
95
|
+
const onCloseCancel = () => {
|
|
96
|
+
onClickCancel && onClickCancel();
|
|
97
|
+
closeModal();
|
|
98
|
+
};
|
|
99
|
+
return /* @__PURE__ */ jsxs(WindowBase, {
|
|
100
|
+
title,
|
|
101
|
+
variant,
|
|
102
|
+
onClickCancel,
|
|
103
|
+
children: [/* @__PURE__ */ jsx(MessageIlustration, {}), /* @__PURE__ */ jsxs(Actions, {
|
|
104
|
+
children: [/* @__PURE__ */ jsx(ActionCancel, {
|
|
105
|
+
onClick: onCloseCancel
|
|
106
|
+
}), " ", /* @__PURE__ */ jsx(ActionIntro, {
|
|
107
|
+
onClick: onClickIntro,
|
|
108
|
+
color: getVariantColor(variant)
|
|
109
|
+
})]
|
|
110
|
+
})]
|
|
111
|
+
});
|
|
112
|
+
};
|
|
113
|
+
export {
|
|
114
|
+
WindowConfirm as W
|
|
115
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import "@mui/material";
|
|
2
|
+
import "../../react-draggable.84d6b038.js";
|
|
3
|
+
import "react";
|
|
4
|
+
import "../../contexts/ModalContext/index.b90eec94.js";
|
|
5
|
+
import "../ModalDialog/index.a684827f.js";
|
|
6
|
+
import "../Resizeable/index.c96c0f09.js";
|
|
7
|
+
import "react/jsx-runtime";
|
|
8
|
+
import "@m4l/graphics";
|
|
9
|
+
import "@m4l/core";
|
|
10
|
+
import "../areas/contexts/DynamicMFParmsContext/index.668bc2e2.js";
|
|
11
|
+
import "../CommonActions/components/Actions/index.d3e1f36e.js";
|
|
12
|
+
import "@mui/material/Button";
|
|
13
|
+
import "react-hook-form";
|
|
14
|
+
import "./WindowBase.04439b8e.js";
|
|
15
|
+
import "../Icon/index.8d754623.js";
|
|
16
|
+
import "@mui/material/styles";
|
|
17
|
+
import "@mui/lab";
|
|
18
|
+
import "./WindowConfirm.0b8a6818.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Skeleton, Accordion as Accordion$1, AccordionSummary, AccordionDetails } from "@mui/material";
|
|
2
|
-
import { I as IconButton } from "../IconButton/index.
|
|
2
|
+
import { I as IconButton } from "../IconButton/index.82f16572.js";
|
|
3
3
|
import { useEnvironment, useModuleSkeleton } from "@m4l/core";
|
|
4
|
-
import { I as Icon } from "../../Icon/index.
|
|
4
|
+
import { I as Icon } from "../../Icon/index.8d754623.js";
|
|
5
5
|
import { styled } from "@mui/material/styles";
|
|
6
6
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
7
7
|
styled("div")(({
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { useModuleSkeleton, useModuleDictionary } from "@m4l/core";
|
|
2
|
+
import { Skeleton, styled, IconButton, Tooltip } from "@mui/material";
|
|
3
|
+
import MuiButton from "@mui/material/Button";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { LoadingButton as LoadingButton$1 } from "@mui/lab";
|
|
6
|
+
import { useMemo } from "react";
|
|
7
|
+
import { I as Image } from "../../Image/index.93d5f37f.js";
|
|
8
|
+
const Button = (props) => {
|
|
9
|
+
const isSkeleton = useModuleSkeleton();
|
|
10
|
+
if (isSkeleton) {
|
|
11
|
+
return /* @__PURE__ */ jsx(Skeleton, {
|
|
12
|
+
sx: {
|
|
13
|
+
borderRadius: 2
|
|
14
|
+
},
|
|
15
|
+
variant: "rectangular",
|
|
16
|
+
width: "100px",
|
|
17
|
+
height: "36px"
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
return /* @__PURE__ */ jsx(MuiButton, {
|
|
21
|
+
...props
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
const WrapperSkeleton = styled("div")(({
|
|
25
|
+
theme
|
|
26
|
+
}) => ({
|
|
27
|
+
display: "flex",
|
|
28
|
+
width: "100%",
|
|
29
|
+
borderRadius: theme.spacing(1),
|
|
30
|
+
overflow: "hidden"
|
|
31
|
+
}));
|
|
32
|
+
const SkeletonLoadingButton = () => /* @__PURE__ */ jsx(WrapperSkeleton, {
|
|
33
|
+
id: "WrapperSKTLoadingButton",
|
|
34
|
+
children: /* @__PURE__ */ jsx(Skeleton, {
|
|
35
|
+
variant: "rectangular",
|
|
36
|
+
width: "100%",
|
|
37
|
+
height: "48px"
|
|
38
|
+
})
|
|
39
|
+
});
|
|
40
|
+
const LoadingButton = (props) => {
|
|
41
|
+
const {
|
|
42
|
+
children,
|
|
43
|
+
...other
|
|
44
|
+
} = props;
|
|
45
|
+
const isSkeleton = useModuleSkeleton();
|
|
46
|
+
if (isSkeleton) {
|
|
47
|
+
return /* @__PURE__ */ jsx(SkeletonLoadingButton, {});
|
|
48
|
+
}
|
|
49
|
+
return /* @__PURE__ */ jsx(LoadingButton$1, {
|
|
50
|
+
...other,
|
|
51
|
+
children
|
|
52
|
+
});
|
|
53
|
+
};
|
|
54
|
+
function ImageButton({
|
|
55
|
+
src,
|
|
56
|
+
width,
|
|
57
|
+
height,
|
|
58
|
+
className,
|
|
59
|
+
useIntersectionObserver,
|
|
60
|
+
skeletonVariant = "circle",
|
|
61
|
+
tooltip,
|
|
62
|
+
dictionaryTooltip,
|
|
63
|
+
sx = {
|
|
64
|
+
width: 40,
|
|
65
|
+
height: 40
|
|
66
|
+
},
|
|
67
|
+
...other
|
|
68
|
+
}) {
|
|
69
|
+
const {
|
|
70
|
+
getLabel
|
|
71
|
+
} = useModuleDictionary();
|
|
72
|
+
const finalTooltip = useMemo(() => {
|
|
73
|
+
if (dictionaryTooltip && getLabel) {
|
|
74
|
+
return getLabel(dictionaryTooltip);
|
|
75
|
+
}
|
|
76
|
+
return tooltip;
|
|
77
|
+
}, [tooltip, dictionaryTooltip, getLabel]);
|
|
78
|
+
const imageButton = useMemo(() => {
|
|
79
|
+
return /* @__PURE__ */ jsx(IconButton, {
|
|
80
|
+
sx,
|
|
81
|
+
className: `m4l_image_button ${className ? className : ""}`,
|
|
82
|
+
...other,
|
|
83
|
+
children: /* @__PURE__ */ jsx(Image, {
|
|
84
|
+
src,
|
|
85
|
+
width,
|
|
86
|
+
height,
|
|
87
|
+
useIntersectionObserver,
|
|
88
|
+
skeletonVariant
|
|
89
|
+
})
|
|
90
|
+
});
|
|
91
|
+
}, [src, width, height, useIntersectionObserver, skeletonVariant, sx]);
|
|
92
|
+
return finalTooltip ? /* @__PURE__ */ jsx(Tooltip, {
|
|
93
|
+
title: finalTooltip || "",
|
|
94
|
+
children: imageButton
|
|
95
|
+
}) : imageButton;
|
|
96
|
+
}
|
|
97
|
+
export {
|
|
98
|
+
Button as B,
|
|
99
|
+
ImageButton as I,
|
|
100
|
+
LoadingButton as L
|
|
101
|
+
};
|
|
@@ -1,64 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { forwardRef, useMemo } from "react";
|
|
3
|
-
import { IconButton as IconButton$1, Box, Skeleton, Tooltip } from "@mui/material";
|
|
4
|
-
import { jsx } from "react/jsx-runtime";
|
|
1
|
+
import { useMemo } from "react";
|
|
5
2
|
import { useModuleDictionary, useModuleSkeleton } from "@m4l/core";
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
scale: 1.1
|
|
10
|
-
},
|
|
11
|
-
tap: {
|
|
12
|
-
scale: 0.95
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
const varMedium = {
|
|
16
|
-
hover: {
|
|
17
|
-
scale: 1.09
|
|
18
|
-
},
|
|
19
|
-
tap: {
|
|
20
|
-
scale: 0.97
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
const varLarge = {
|
|
24
|
-
hover: {
|
|
25
|
-
scale: 1.08
|
|
26
|
-
},
|
|
27
|
-
tap: {
|
|
28
|
-
scale: 0.99
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
function AnimateWrap({
|
|
32
|
-
size,
|
|
33
|
-
children
|
|
34
|
-
}) {
|
|
35
|
-
const isSmall = size === "small";
|
|
36
|
-
const isLarge = size === "large";
|
|
37
|
-
return /* @__PURE__ */ jsx(Box, {
|
|
38
|
-
component: m.div,
|
|
39
|
-
whileTap: "tap",
|
|
40
|
-
whileHover: "hover",
|
|
41
|
-
variants: isSmall && varSmall || isLarge && varLarge || varMedium,
|
|
42
|
-
sx: {
|
|
43
|
-
display: "inline-flex"
|
|
44
|
-
},
|
|
45
|
-
children
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
const IconButtonAnimate = forwardRef(({
|
|
49
|
-
children,
|
|
50
|
-
size = "medium",
|
|
51
|
-
...other
|
|
52
|
-
}, ref) => /* @__PURE__ */ jsx(AnimateWrap, {
|
|
53
|
-
size,
|
|
54
|
-
children: /* @__PURE__ */ jsx(IconButton$1, {
|
|
55
|
-
size,
|
|
56
|
-
ref,
|
|
57
|
-
...other,
|
|
58
|
-
children
|
|
59
|
-
})
|
|
60
|
-
}));
|
|
61
|
-
IconButtonAnimate.displayName = "IconButtonAnimate";
|
|
3
|
+
import { Skeleton, Tooltip, IconButton as IconButton$1 } from "@mui/material";
|
|
4
|
+
import { I as Icon } from "../../Icon/index.8d754623.js";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
62
6
|
const SkeletonIconButton = () => {
|
|
63
7
|
return /* @__PURE__ */ jsx(Skeleton, {
|
|
64
8
|
variant: "circular",
|
|
@@ -115,6 +59,5 @@ function IconButton({
|
|
|
115
59
|
});
|
|
116
60
|
}
|
|
117
61
|
export {
|
|
118
|
-
IconButton as I
|
|
119
|
-
IconButtonAnimate as a
|
|
62
|
+
IconButton as I
|
|
120
63
|
};
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { useState, useMemo } from "react";
|
|
2
|
+
import { useEnvironment, useModuleDictionary } from "@m4l/core";
|
|
3
|
+
import { IconButton, Tooltip, MenuItem } from "@mui/material";
|
|
4
|
+
import { P as Popover } from "../Popover/index.53c77d23.js";
|
|
5
|
+
import { styled } from "@mui/material/styles";
|
|
6
|
+
import { I as Icon } from "../../Icon/index.8d754623.js";
|
|
7
|
+
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
8
|
+
const WrapperMenuActions = styled(IconButton)(() => ({}));
|
|
9
|
+
const LabelMemuItem = styled("div")(({
|
|
10
|
+
theme
|
|
11
|
+
}) => ({
|
|
12
|
+
height: "22px",
|
|
13
|
+
marginLeft: theme.spacing(1.5),
|
|
14
|
+
display: "flex",
|
|
15
|
+
alignItems: "center"
|
|
16
|
+
}));
|
|
17
|
+
function MenuActions(props) {
|
|
18
|
+
const {
|
|
19
|
+
menuActions,
|
|
20
|
+
objItem = {},
|
|
21
|
+
url_icon: urlIcon,
|
|
22
|
+
toolTip = "",
|
|
23
|
+
marginTop = -1,
|
|
24
|
+
marginBottom,
|
|
25
|
+
marginLeft,
|
|
26
|
+
marginRight,
|
|
27
|
+
width = 200,
|
|
28
|
+
arrowType: arrow = "right-top",
|
|
29
|
+
...other
|
|
30
|
+
} = props;
|
|
31
|
+
const {
|
|
32
|
+
host_static_assets,
|
|
33
|
+
environment_assets
|
|
34
|
+
} = useEnvironment();
|
|
35
|
+
const {
|
|
36
|
+
getLabel
|
|
37
|
+
} = useModuleDictionary();
|
|
38
|
+
const [open, setOpen] = useState(null);
|
|
39
|
+
const handleOpen = (event) => {
|
|
40
|
+
setOpen(event.currentTarget);
|
|
41
|
+
};
|
|
42
|
+
const urlFinalIcon = useMemo(() => {
|
|
43
|
+
if (urlIcon)
|
|
44
|
+
return urlIcon;
|
|
45
|
+
return `${host_static_assets}/${environment_assets}/frontend/commons/assets/icons/more_vertical.svg`;
|
|
46
|
+
}, [urlIcon, host_static_assets, environment_assets]);
|
|
47
|
+
const handleClose = () => {
|
|
48
|
+
setOpen(null);
|
|
49
|
+
};
|
|
50
|
+
const handleClick = (menuAction) => {
|
|
51
|
+
setOpen(null);
|
|
52
|
+
menuAction.onClick();
|
|
53
|
+
};
|
|
54
|
+
const finalActions = useMemo(() => {
|
|
55
|
+
let ret;
|
|
56
|
+
if (typeof menuActions !== "function") {
|
|
57
|
+
ret = menuActions;
|
|
58
|
+
} else {
|
|
59
|
+
ret = menuActions(objItem);
|
|
60
|
+
}
|
|
61
|
+
return ret;
|
|
62
|
+
}, [menuActions, objItem]);
|
|
63
|
+
return /* @__PURE__ */ jsxs(Fragment, {
|
|
64
|
+
children: [/* @__PURE__ */ jsx(Tooltip, {
|
|
65
|
+
title: toolTip,
|
|
66
|
+
children: /* @__PURE__ */ jsx(WrapperMenuActions, {
|
|
67
|
+
id: "WrapperMenuActions",
|
|
68
|
+
size: "small",
|
|
69
|
+
onClick: handleOpen,
|
|
70
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
71
|
+
src: urlFinalIcon
|
|
72
|
+
})
|
|
73
|
+
})
|
|
74
|
+
}), /* @__PURE__ */ jsx(Popover, {
|
|
75
|
+
id: "Popover",
|
|
76
|
+
open: Boolean(open),
|
|
77
|
+
anchorEl: open,
|
|
78
|
+
onClose: handleClose,
|
|
79
|
+
arrowType: arrow,
|
|
80
|
+
sx: {
|
|
81
|
+
marginTop,
|
|
82
|
+
marginBottom,
|
|
83
|
+
marginLeft,
|
|
84
|
+
marginRight,
|
|
85
|
+
width,
|
|
86
|
+
"& .MuiMenuItem-root": {
|
|
87
|
+
px: 1,
|
|
88
|
+
typography: "body2",
|
|
89
|
+
borderRadius: 0.75
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
...other,
|
|
93
|
+
children: open && finalActions.map((menuAction, index) => /* @__PURE__ */ jsxs(MenuItem, {
|
|
94
|
+
dense: true,
|
|
95
|
+
onClick: () => handleClick(menuAction),
|
|
96
|
+
sx: {
|
|
97
|
+
color: menuAction.color ?? "text.main"
|
|
98
|
+
},
|
|
99
|
+
disabled: menuAction.disabled,
|
|
100
|
+
children: [/* @__PURE__ */ jsx(Icon, {
|
|
101
|
+
src: menuAction.urlIcon
|
|
102
|
+
}), /* @__PURE__ */ jsx(LabelMemuItem, {
|
|
103
|
+
children: menuAction.label || getLabel(menuAction.dictionaryField)
|
|
104
|
+
})]
|
|
105
|
+
}, `menu_action_${index}`))
|
|
106
|
+
})]
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
export {
|
|
110
|
+
LabelMemuItem as L,
|
|
111
|
+
MenuActions as M
|
|
112
|
+
};
|
|
@@ -1,8 +1,73 @@
|
|
|
1
1
|
import { useMemo } from "react";
|
|
2
2
|
import { Skeleton, TablePagination } from "@mui/material";
|
|
3
|
-
import { P as PagerActions } from "../../CommonActions/components/Actions/index.ba86f72f.js";
|
|
4
3
|
import { styled } from "@mui/material/styles";
|
|
4
|
+
import { I as IconButton } from "../IconButton/index.82f16572.js";
|
|
5
|
+
import { useEnvironment } from "@m4l/core";
|
|
5
6
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
7
|
+
const WrapperPagerActions = styled("div")(({ theme }) => ({
|
|
8
|
+
width: "100%",
|
|
9
|
+
justifyContent: "center",
|
|
10
|
+
display: "flex",
|
|
11
|
+
marginLeft: 0,
|
|
12
|
+
[theme.breakpoints.up("sm")]: {
|
|
13
|
+
display: "flex",
|
|
14
|
+
alignItems: "center",
|
|
15
|
+
marginLeft: theme.spacing(3)
|
|
16
|
+
}
|
|
17
|
+
}));
|
|
18
|
+
function PagerActions(props) {
|
|
19
|
+
const {
|
|
20
|
+
count,
|
|
21
|
+
page,
|
|
22
|
+
rowsPerPage,
|
|
23
|
+
onPageChange
|
|
24
|
+
} = props;
|
|
25
|
+
const {
|
|
26
|
+
host_static_assets,
|
|
27
|
+
environment_assets
|
|
28
|
+
} = useEnvironment();
|
|
29
|
+
const handleFirstPageButtonClick = (event) => {
|
|
30
|
+
onPageChange(event, 0);
|
|
31
|
+
};
|
|
32
|
+
const handleBackButtonClick = (event) => {
|
|
33
|
+
onPageChange(event, page - 1);
|
|
34
|
+
};
|
|
35
|
+
const handleNextButtonClick = (event) => {
|
|
36
|
+
onPageChange(event, page + 1);
|
|
37
|
+
};
|
|
38
|
+
const handleLastPageButtonClick = (event) => {
|
|
39
|
+
onPageChange(event, Math.max(0, Math.ceil(count / rowsPerPage) - 1));
|
|
40
|
+
};
|
|
41
|
+
return /* @__PURE__ */ jsxs(WrapperPagerActions, {
|
|
42
|
+
id: "WrapperPagerActions",
|
|
43
|
+
children: [/* @__PURE__ */ jsx(IconButton, {
|
|
44
|
+
id: "test_bruce",
|
|
45
|
+
dictionaryTooltip: "pager.first",
|
|
46
|
+
onClick: handleFirstPageButtonClick,
|
|
47
|
+
disabled: page === 0,
|
|
48
|
+
"aria-label": "first page",
|
|
49
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/pager/assets/icons/first.svg`
|
|
50
|
+
}), /* @__PURE__ */ jsx(IconButton, {
|
|
51
|
+
dictionaryTooltip: "pager.previous",
|
|
52
|
+
onClick: handleBackButtonClick,
|
|
53
|
+
disabled: page === 0,
|
|
54
|
+
"aria-label": "first page",
|
|
55
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/pager/assets/icons/previous.svg`
|
|
56
|
+
}), /* @__PURE__ */ jsx(IconButton, {
|
|
57
|
+
dictionaryTooltip: "pager.next",
|
|
58
|
+
onClick: handleNextButtonClick,
|
|
59
|
+
disabled: page >= Math.ceil(count / rowsPerPage) - 1,
|
|
60
|
+
"aria-label": "next page",
|
|
61
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/pager/assets/icons/next.svg`
|
|
62
|
+
}), /* @__PURE__ */ jsx(IconButton, {
|
|
63
|
+
dictionaryTooltip: "pager.last",
|
|
64
|
+
onClick: handleLastPageButtonClick,
|
|
65
|
+
disabled: page >= Math.ceil(count / rowsPerPage) - 1,
|
|
66
|
+
"aria-label": "last page",
|
|
67
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/pager/assets/icons/last.svg`
|
|
68
|
+
})]
|
|
69
|
+
});
|
|
70
|
+
}
|
|
6
71
|
styled("div")(() => ({
|
|
7
72
|
display: "flex",
|
|
8
73
|
flexDirection: "column",
|