@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.
Files changed (61) hide show
  1. package/dist/{commonjs.bcc6b707.js → commonjs.565e6834.js} +0 -1
  2. package/dist/components/CommonActions/components/ActionCancel/{index.4b36950f.js → index.9230c57b.js} +1 -1
  3. package/dist/components/CommonActions/components/ActionFormCancel/{index.945e9887.js → index.ab514bd9.js} +9 -7
  4. package/dist/components/CommonActions/components/ActionIntro/{index.35a0d240.js → index.a0a341c7.js} +1 -1
  5. package/dist/components/CommonActions/components/Actions/index.d3e1f36e.js +54 -0
  6. package/dist/components/DataGrid/{index.156cc30c.js → index.67260455.js} +663 -15
  7. package/dist/components/DynamicFilter/{index.32f84995.js → index.071aa795.js} +92 -18
  8. package/dist/components/Icon/{index.1dbd3e58.js → index.8d754623.js} +62 -5
  9. package/dist/components/LanguagePopover/index.cbc4b282.js +144 -0
  10. package/dist/components/Loadable/{index.8c6006be.js → index.117eaced.js} +1 -1
  11. package/dist/components/ModalDialog/{index.91777582.js → index.a684827f.js} +5 -5
  12. package/dist/components/ObjectLogs/{index.9d3fc2ae.js → index.4a859658.js} +12 -10
  13. package/dist/components/PaperForm/{index.218a6c4b.js → index.c5948756.js} +1 -1
  14. package/dist/components/Period/{index.74f35862.js → index.abe445bd.js} +9 -7
  15. package/dist/components/Resizeable/{index.44a0dd46.js → index.c96c0f09.js} +1 -1
  16. package/dist/components/SplitLayout/{index.81fc4750.js → index.5a8355d8.js} +1 -1
  17. package/dist/components/animate/PropagateLoader/index.be5b02c3.js +30 -0
  18. package/dist/components/areas/components/AreasAdmin/index.6794b22f.js +112 -0
  19. package/dist/components/areas/components/AreasContainer/index.a2f8899b.js +43 -0
  20. package/dist/components/areas/components/GridLayout/index.b9c1e846.js +92 -0
  21. package/dist/components/areas/components/Window/index.252fbf4e.js +646 -0
  22. package/dist/components/areas/components/WindowPopUp/index.214cf099.js +120 -0
  23. package/dist/components/areas/components/index.7d6cd649.js +67 -0
  24. package/dist/components/areas/contexts/AreaContext/index.4894cf23.js +286 -0
  25. package/dist/components/areas/contexts/AreasContext/index.cd8e4bee.js +158 -0
  26. package/dist/components/areas/contexts/DynamicMFParmsContext/index.668bc2e2.js +17 -0
  27. package/dist/components/areas/contexts/index.f9196fb2.js +1 -0
  28. package/dist/components/areas/hooks/useArea/index.9b85ce24.js +19 -0
  29. package/dist/components/areas/hooks/useDynamicMFParameters/index.e6a44ae3.js +11 -0
  30. package/dist/components/areas/index.d1bf612c.js +16 -0
  31. package/dist/components/formatters/BooleanFormatter/{index.efc8ffc2.js → index.3a9b16c8.js} +1 -1
  32. package/dist/components/formatters/{index.c3f4b687.js → index.0b5f95d0.js} +1 -1
  33. package/dist/components/hook-form/RHFPeriod/{index.2b8e63a2.js → index.3772295b.js} +1 -1
  34. package/dist/components/hook-form/RHFTextField/{index.7feaec71.js → index.b17d68f4.js} +1 -1
  35. package/dist/components/modal/WindowBase.04439b8e.js +120 -0
  36. package/dist/components/modal/WindowConfirm.0b8a6818.js +115 -0
  37. package/dist/components/modal/index.8387e90e.js +18 -0
  38. package/dist/components/mui_extended/Accordion/{index.8e123c57.js → index.a541c71c.js} +2 -2
  39. package/dist/components/mui_extended/Button/index.86a155a2.js +101 -0
  40. package/dist/components/mui_extended/IconButton/{index.e3adaa33.js → index.82f16572.js} +5 -62
  41. package/dist/components/mui_extended/MenuActions/index.ee17bddd.js +112 -0
  42. package/dist/components/mui_extended/Pager/{index.d245f821.js → index.74d3f5fc.js} +66 -1
  43. package/dist/components/mui_extended/Popover/index.53c77d23.js +137 -0
  44. package/dist/components/mui_extended/index.85dfadf1.js +16 -0
  45. package/dist/contexts/ModalContext/{index.0797eb17.js → index.b90eec94.js} +1 -1
  46. package/dist/hooks/useModal/{index.32da4dcb.js → index.d14edee3.js} +1 -1
  47. package/dist/index.js +128 -1691
  48. package/dist/{components/animate/PropagateLoader/index.eb401503.js → node_modules.416f1da3.js} +59 -28
  49. package/dist/package.json +2 -1
  50. package/dist/{react-draggable.3b5b6680.js → react-draggable.84d6b038.js} +1 -1
  51. package/dist/{react-json-view.03ae95f5.js → react-json-view.57125fcf.js} +1 -1
  52. package/dist/{react-resizable.6eae0397.js → react-resizable.1d00271d.js} +3 -4
  53. package/dist/{react-splitter-layout.873aece3.js → react-splitter-layout.8b1655c8.js} +1 -1
  54. package/dist/style.css +0 -114
  55. package/dist/utils/{index.9dce2e2f.js → index.899eb67b.js} +28 -460
  56. package/package.json +3 -1
  57. package/vite.config.ts +201 -129
  58. package/dist/components/CommonActions/components/Actions/index.ba86f72f.js +0 -868
  59. package/dist/components/mui_extended/Button/index.55fc70dc.js +0 -178
  60. package/dist/components/mui_extended/Popover/index.97cf3a3e.js +0 -275
  61. package/dist/node_modules.e0b84fac.js +0 -2154
@@ -1,178 +0,0 @@
1
- import { useModuleSkeleton, useEnvironment, useModuleDictionary } from "@m4l/core";
2
- import { Skeleton, styled, IconButton as IconButton$1, 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 { I as IconButton } from "../IconButton/index.e3adaa33.js";
7
- import { styled as styled$1, alpha } from "@mui/material/styles";
8
- import { u as useBase } from "../../DynamicFilter/index.32f84995.js";
9
- import { useMemo } from "react";
10
- import { I as Image } from "../../Image/index.93d5f37f.js";
11
- const Button = (props) => {
12
- const isSkeleton = useModuleSkeleton();
13
- if (isSkeleton) {
14
- return /* @__PURE__ */ jsx(Skeleton, {
15
- sx: {
16
- borderRadius: 2
17
- },
18
- variant: "rectangular",
19
- width: "100px",
20
- height: "36px"
21
- });
22
- }
23
- return /* @__PURE__ */ jsx(MuiButton, {
24
- ...props
25
- });
26
- };
27
- const WrapperSkeleton = styled("div")(({
28
- theme
29
- }) => ({
30
- display: "flex",
31
- width: "100%",
32
- borderRadius: theme.spacing(1),
33
- overflow: "hidden"
34
- }));
35
- const SkeletonLoadingButton = () => /* @__PURE__ */ jsx(WrapperSkeleton, {
36
- id: "WrapperSKTLoadingButton",
37
- children: /* @__PURE__ */ jsx(Skeleton, {
38
- variant: "rectangular",
39
- width: "100%",
40
- height: "48px"
41
- })
42
- });
43
- const LoadingButton = (props) => {
44
- const {
45
- children,
46
- ...other
47
- } = props;
48
- const isSkeleton = useModuleSkeleton();
49
- if (isSkeleton) {
50
- return /* @__PURE__ */ jsx(SkeletonLoadingButton, {});
51
- }
52
- return /* @__PURE__ */ jsx(LoadingButton$1, {
53
- ...other,
54
- children
55
- });
56
- };
57
- const SKTWrapperFilterButton = styled$1("div")(({
58
- theme
59
- }) => ({
60
- display: "flex",
61
- justifyContent: "center",
62
- alignItems: "center",
63
- minWidth: theme.spacing(3.75),
64
- height: theme.spacing(3.75),
65
- background: alpha(theme.palette.primary.main, 0.3)
66
- }));
67
- const WrapperFilterButton = styled$1("div")(() => ({
68
- "&.isDirty": {
69
- animationName: "dirtyEffect",
70
- animationDuration: "1s",
71
- animationFillMode: "both",
72
- animationIterationCount: "infinite",
73
- transition: "all .3s",
74
- "@keyframes dirtyEffect": {
75
- "20%": {
76
- opacity: 1
77
- },
78
- "50%": {
79
- opacity: 0.5
80
- },
81
- "100%": {
82
- opacity: 1
83
- }
84
- }
85
- },
86
- "&.isDirtyError": {}
87
- }));
88
- function FilterButton() {
89
- const {
90
- isSkeleton,
91
- fireOnChangeFilters,
92
- automatic,
93
- isDirty,
94
- isValid
95
- } = useBase();
96
- const {
97
- host_static_assets,
98
- environment_assets
99
- } = useEnvironment();
100
- if (isSkeleton) {
101
- return /* @__PURE__ */ jsx(SKTWrapperFilterButton, {
102
- children: /* @__PURE__ */ jsx(Skeleton, {
103
- variant: "circular",
104
- width: 20,
105
- height: 20
106
- })
107
- });
108
- }
109
- const color = useMemo(() => {
110
- if (automatic || !isDirty) {
111
- return "action.active";
112
- }
113
- if (!isValid) {
114
- return "error.main";
115
- }
116
- return "primary.main";
117
- }, [automatic, isValid, isDirty]);
118
- return /* @__PURE__ */ jsx(WrapperFilterButton, {
119
- id: "WrapperFilterButton",
120
- className: isDirty && isValid ? "isDirty" : "",
121
- children: /* @__PURE__ */ jsx(IconButton, {
122
- bgColor: color,
123
- dictionaryTooltip: "dynamic_filter.filter_tooltip",
124
- onClick: () => fireOnChangeFilters(),
125
- "aria-label": "settings",
126
- src: `${host_static_assets}/${environment_assets}/frontend/components/dynamic_filter/assets/icons/${automatic ? "refresh" : "search"}.svg`
127
- })
128
- });
129
- }
130
- function ImageButton({
131
- src,
132
- width,
133
- height,
134
- className,
135
- useIntersectionObserver,
136
- skeletonVariant = "circle",
137
- tooltip,
138
- dictionaryTooltip,
139
- sx = {
140
- width: 40,
141
- height: 40
142
- },
143
- ...other
144
- }) {
145
- const {
146
- getLabel
147
- } = useModuleDictionary();
148
- const finalTooltip = useMemo(() => {
149
- if (dictionaryTooltip && getLabel) {
150
- return getLabel(dictionaryTooltip);
151
- }
152
- return tooltip;
153
- }, [tooltip, dictionaryTooltip, getLabel]);
154
- const imageButton = useMemo(() => {
155
- return /* @__PURE__ */ jsx(IconButton$1, {
156
- sx,
157
- className: `m4l_image_button ${className ? className : ""}`,
158
- ...other,
159
- children: /* @__PURE__ */ jsx(Image, {
160
- src,
161
- width,
162
- height,
163
- useIntersectionObserver,
164
- skeletonVariant
165
- })
166
- });
167
- }, [src, width, height, useIntersectionObserver, skeletonVariant, sx]);
168
- return finalTooltip ? /* @__PURE__ */ jsx(Tooltip, {
169
- title: finalTooltip || "",
170
- children: imageButton
171
- }) : imageButton;
172
- }
173
- export {
174
- Button as B,
175
- FilterButton as F,
176
- ImageButton as I,
177
- LoadingButton as L
178
- };
@@ -1,275 +0,0 @@
1
- import { useState, useEffect } from "react";
2
- import { Popover as Popover$1, styled as styled$1, Stack, MenuItem } from "@mui/material";
3
- import { I as Image } from "../../Image/index.93d5f37f.js";
4
- import { useLocales } from "@m4l/graphics";
5
- import { useEnvironment, useNetwork } from "@m4l/core";
6
- import "../../Icon/index.1dbd3e58.js";
7
- import { styled } from "@mui/material/styles";
8
- import { jsxs, jsx, Fragment } from "react/jsx-runtime";
9
- import "../Accordion/index.8e123c57.js";
10
- import "../Avatar/index.fe06afd7.js";
11
- import "react-router-dom";
12
- import "@mui/material/Button";
13
- import { C as CircularProgress } from "../CircularProgress/index.ad569afd.js";
14
- import "@mui/lab";
15
- import { I as ImageButton } from "../Button/index.55fc70dc.js";
16
- import "../../CommonActions/components/Actions/index.ba86f72f.js";
17
- import "../Pager/index.d245f821.js";
18
- import "../Tab/index.e0653a0a.js";
19
- const ArrowStyle = styled("span")(({
20
- arrowType,
21
- theme
22
- }) => {
23
- const SIZE = 12;
24
- const POSITION = -(SIZE / 2);
25
- const borderStyle = `solid 1px ${theme.palette.grey[50012]}`;
26
- const topStyle = {
27
- borderRadius: "0 0 3px 0",
28
- top: POSITION,
29
- borderBottom: borderStyle,
30
- borderRight: borderStyle
31
- };
32
- const bottomStyle = {
33
- borderRadius: "3px 0 0 0",
34
- bottom: POSITION,
35
- borderTop: borderStyle,
36
- borderLeft: borderStyle
37
- };
38
- const leftStyle = {
39
- borderRadius: "0 3px 0 0",
40
- left: POSITION,
41
- borderTop: borderStyle,
42
- borderRight: borderStyle
43
- };
44
- const rightStyle = {
45
- borderRadius: "0 0 0 3px",
46
- right: POSITION,
47
- borderBottom: borderStyle,
48
- borderLeft: borderStyle
49
- };
50
- return {
51
- display: "none",
52
- [theme.breakpoints.up("sm")]: {
53
- zIndex: 1,
54
- width: SIZE,
55
- height: SIZE,
56
- content: "''",
57
- position: "absolute",
58
- display: "block",
59
- transform: "rotate(-135deg)",
60
- background: theme.palette.background.paper
61
- },
62
- ...arrowType === "top-left" && {
63
- ...topStyle,
64
- left: 20
65
- },
66
- ...arrowType === "top-center" && {
67
- ...topStyle,
68
- left: 0,
69
- right: 0,
70
- margin: "auto"
71
- },
72
- ...arrowType === "top-right" && {
73
- ...topStyle,
74
- right: 20
75
- },
76
- ...arrowType === "bottom-left" && {
77
- ...bottomStyle,
78
- left: 20
79
- },
80
- ...arrowType === "bottom-center" && {
81
- ...bottomStyle,
82
- left: 0,
83
- right: 0,
84
- margin: "auto"
85
- },
86
- ...arrowType === "bottom-right" && {
87
- ...bottomStyle,
88
- right: 20
89
- },
90
- ...arrowType === "left-top" && {
91
- ...leftStyle,
92
- top: 20
93
- },
94
- ...arrowType === "left-center" && {
95
- ...leftStyle,
96
- top: 0,
97
- bottom: 0,
98
- margin: "auto"
99
- },
100
- ...arrowType === "left-bottom" && {
101
- ...leftStyle,
102
- bottom: 20
103
- },
104
- ...arrowType === "right-top" && {
105
- ...rightStyle,
106
- top: 20
107
- },
108
- ...arrowType === "right-center" && {
109
- ...rightStyle,
110
- top: 0,
111
- bottom: 0,
112
- margin: "auto"
113
- },
114
- ...arrowType === "right-bottom" && {
115
- ...rightStyle,
116
- bottom: 20
117
- }
118
- };
119
- });
120
- function Popover({
121
- children,
122
- arrowType = "top-right",
123
- sx,
124
- className,
125
- ...other
126
- }) {
127
- return /* @__PURE__ */ jsxs(Popover$1, {
128
- className: `m4l_popover ${className ? className : ""}`,
129
- anchorOrigin: {
130
- vertical: "bottom",
131
- horizontal: "right"
132
- },
133
- transformOrigin: {
134
- vertical: "top",
135
- horizontal: "right"
136
- },
137
- PaperProps: {
138
- sx: {
139
- p: 1,
140
- overflow: "inherit",
141
- ...sx
142
- }
143
- },
144
- ...other,
145
- children: [arrowType !== "no-arrow" && /* @__PURE__ */ jsx(ArrowStyle, {
146
- arrowType
147
- }), children]
148
- });
149
- }
150
- const LabelItem = styled$1("span")(({
151
- theme
152
- }) => ({
153
- marginLeft: theme.spacing(1)
154
- }));
155
- const ContainerProgress = styled$1("div")(({
156
- theme
157
- }) => ({
158
- padding: theme.spacing(0.75, 0),
159
- margin: theme.spacing(0, 1.25)
160
- }));
161
- const ContainerMenuItems = styled$1("div")(() => ({
162
- display: "flex",
163
- flexDirection: "column"
164
- }));
165
- function LanguagePopover() {
166
- const {
167
- currentLocale,
168
- onChangeLocale
169
- } = useLocales();
170
- const {
171
- domain_token
172
- } = useEnvironment();
173
- const {
174
- networkOperation
175
- } = useNetwork();
176
- const [open, setOpen] = useState(null);
177
- const [loading, setLoading] = useState(false);
178
- const [allLocales, setAllLocales] = useState([]);
179
- const handleOpen = (event) => {
180
- setOpen(event.currentTarget);
181
- };
182
- const handleClose = () => {
183
- setOpen(null);
184
- };
185
- useEffect(() => {
186
- let mounted = true;
187
- if (open === null || loading || allLocales.length > 0) {
188
- return;
189
- }
190
- setLoading(true);
191
- networkOperation({
192
- method: "GET",
193
- endPoint: `na/locales`,
194
- parms: {
195
- domain_token
196
- }
197
- }).then((response) => {
198
- if (mounted) {
199
- setAllLocales(response.data);
200
- }
201
- }).finally(() => {
202
- setLoading(false);
203
- });
204
- return function cleanUp() {
205
- mounted = false;
206
- };
207
- }, [open]);
208
- return /* @__PURE__ */ jsxs(Fragment, {
209
- children: [/* @__PURE__ */ jsx(ImageButton, {
210
- className: "m4l_language_popover",
211
- onClick: handleOpen,
212
- sx: {
213
- width: 40,
214
- height: 40,
215
- ...open && {
216
- bgcolor: "action.selected"
217
- }
218
- },
219
- src: currentLocale?.url_icon || "",
220
- alt: currentLocale?.name,
221
- width: "24px",
222
- height: "24px",
223
- skeletonVariant: "circle",
224
- tooltip: "dddd"
225
- }), /* @__PURE__ */ jsx(Popover, {
226
- arrowType: "top-right",
227
- open: Boolean(open),
228
- anchorEl: open,
229
- anchorOrigin: {
230
- vertical: "bottom",
231
- horizontal: "right"
232
- },
233
- onClose: handleClose,
234
- sx: {
235
- mt: 1.5,
236
- ml: 0.75,
237
- width: 180,
238
- rowGap: "100px",
239
- "& .MuiMenuItem-root": {
240
- px: 1,
241
- typography: "body2",
242
- borderRadius: 0.75
243
- }
244
- },
245
- children: /* @__PURE__ */ jsxs(ContainerMenuItems, {
246
- children: [allLocales.length === 0 && /* @__PURE__ */ jsx(ContainerProgress, {
247
- children: /* @__PURE__ */ jsx(CircularProgress, {
248
- size: "20px"
249
- })
250
- }), allLocales.length > 0 && /* @__PURE__ */ jsx(Stack, {
251
- spacing: 0.75,
252
- children: allLocales.map((option) => /* @__PURE__ */ jsxs(MenuItem, {
253
- selected: option.lang === currentLocale?.lang && option?.script === currentLocale?.script && option?.region === currentLocale?.region,
254
- onClick: () => {
255
- onChangeLocale(option);
256
- handleClose();
257
- },
258
- children: [/* @__PURE__ */ jsx(Image, {
259
- alt: option.name,
260
- src: option.url_icon,
261
- width: "24px",
262
- height: "24px"
263
- }), /* @__PURE__ */ jsx(LabelItem, {
264
- children: option.name
265
- })]
266
- }, option.lang || option.script || option.region))
267
- })]
268
- })
269
- })]
270
- });
271
- }
272
- export {
273
- LanguagePopover as L,
274
- Popover as P
275
- };