@m4l/components 0.1.27 → 0.1.28

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 (93) hide show
  1. package/assets/Logo/index.228dcb5a.js +42 -35
  2. package/commonjs.565e6834.js +5 -5
  3. package/components/CommonActions/components/ActionCancel/index.e498eeb2.js +17 -0
  4. package/components/CommonActions/components/ActionFormCancel/index.4ff0ad73.js +64 -0
  5. package/components/CommonActions/components/ActionFormIntro/index.ca4d2674.js +28 -22
  6. package/components/CommonActions/components/ActionIntro/index.60ef7bd7.js +18 -0
  7. package/components/CommonActions/components/Actions/index.0645e30f.js +867 -0
  8. package/components/DataGrid/index.76d8fd25.js +1075 -0
  9. package/components/DynamicFilter/index.342ba5fe.js +1577 -0
  10. package/components/ErrorLabel/index.c8615f16.js +13 -12
  11. package/components/Icon/index.619c31c4.js +65 -53
  12. package/components/Image/index.93d5f37f.js +190 -0
  13. package/components/Loadable/index.f5518558.js +8 -8
  14. package/components/ModalDialog/index.9ea10764.js +184 -0
  15. package/components/NoItemSelected/{index.9609a7f7.js → index.46d2f632.js} +52 -41
  16. package/components/ObjectLogs/index.f941fb79.js +288 -0
  17. package/components/Page/index.4237c241.js +22 -20
  18. package/components/PaperForm/index.ec9cb8c9.js +66 -59
  19. package/components/Period/index.2941fbda.js +249 -0
  20. package/components/PropertyValue/index.dfcfe1ba.js +95 -65
  21. package/components/Resizeable/index.45995d2b.js +19 -19
  22. package/components/ScrollBar/index.39eeb2de.js +26 -21
  23. package/components/ScrollToTop/index.e06f98f6.js +8 -7
  24. package/components/SplitLayout/index.4032673d.js +35 -33
  25. package/components/animate/LoadingScreen/index.1d0c4307.js +33 -33
  26. package/components/animate/MotionContainer/index.8d9f9d80.js +25 -22
  27. package/components/animate/MotionLazyContainer/index.572dd012.js +10 -10
  28. package/components/animate/features.0fbf41e1.js +3 -3
  29. package/components/animate/variants/bounce.784aaaaa.js +16 -13
  30. package/components/animate/variants/container.11f82b76.js +8 -6
  31. package/components/animate/variants/fade.b561c0fc.js +32 -28
  32. package/components/animate/variants/transition.bd46b9ce.js +17 -12
  33. package/components/formatters/BooleanFormatter/index.8da35c9c.js +46 -33
  34. package/components/formatters/DateFormatter/index.1b9baacc.js +49 -37
  35. package/components/formatters/index.689a8086.js +119 -0
  36. package/components/hook-form/RHFAutocomplete/index.59a68f9f.js +224 -0
  37. package/components/hook-form/RHFAutocompleteAsync/index.c3083062.js +87 -0
  38. package/components/hook-form/RHFCheckbox/index.6dcec9e2.js +49 -39
  39. package/components/hook-form/RHFDateTime/index.9231a7c7.js +69 -56
  40. package/components/hook-form/RHFMultiCheckbox/index.2680b3b6.js +23 -23
  41. package/components/hook-form/RHFPeriod/index.64a228d5.js +55 -0
  42. package/components/hook-form/RHFRadioGroup/index.b3335e13.js +29 -29
  43. package/components/hook-form/RHFSelect/index.b6ca8bb2.js +24 -24
  44. package/components/hook-form/RHFTextField/index.f9aaaa90.js +110 -93
  45. package/components/hook-form/RHFUpload/{index.ec4d5326.js → index.d5cc7c13.js} +151 -130
  46. package/components/mui_extended/Accordion/index.a02ac6ae.js +73 -69
  47. package/components/mui_extended/Avatar/index.fe06afd7.js +44 -34
  48. package/components/mui_extended/BoxIcon/index.e638ecc8.js +10 -10
  49. package/components/mui_extended/Breadcrumbs/index.5e37d903.js +49 -44
  50. package/components/mui_extended/Button/index.53b56958.js +178 -0
  51. package/components/mui_extended/CircularProgress/index.ad569afd.js +8 -6
  52. package/components/mui_extended/IconButton/index.a321e5cb.js +82 -67
  53. package/components/mui_extended/LinkWithRoute/index.16436ab8.js +25 -21
  54. package/components/mui_extended/Pager/index.c0865b70.js +141 -0
  55. package/components/mui_extended/Popover/index.705275a4.js +278 -0
  56. package/components/mui_extended/Tab/index.e0653a0a.js +25 -21
  57. package/components/mui_extended/Typography/index.e5494696.js +25 -21
  58. package/contexts/ModalContext/index.b92fa565.js +153 -0
  59. package/contexts/ModalContext/{components → subcomponents}/ContentConfirm/index.d.ts +0 -0
  60. package/contexts/ModalContext/{components → subcomponents}/ContentConfirm/styles.d.ts +0 -0
  61. package/contexts/ModalContext/{components → subcomponents}/ContentConfirm/types.d.ts +0 -0
  62. package/contexts/RHFormContext/index.b142190a.js +63 -0
  63. package/hooks/useFormAddEdit/index.d4845f1a.js +40 -22
  64. package/hooks/useModal/index.5fee01a3.js +11 -0
  65. package/index.js +153 -153
  66. package/package.json +2 -1
  67. package/react-data-grid.d46d625e.js +2206 -1663
  68. package/react-draggable.20e95c61.js +800 -553
  69. package/react-json-view.f56a7f8e.js +2344 -2340
  70. package/react-resizable.5277deaf.js +470 -298
  71. package/react-splitter-layout.7810ac1b.js +130 -128
  72. package/utils/index.214d9542.js +500 -354
  73. package/components/CommonActions/components/ActionCancel/index.431160ba.js +0 -17
  74. package/components/CommonActions/components/ActionFormCancel/index.6a0f34aa.js +0 -49
  75. package/components/CommonActions/components/ActionIntro/index.85557b90.js +0 -18
  76. package/components/CommonActions/components/Actions/index.edeb05c2.js +0 -742
  77. package/components/DataGrid/index.2ce9da7d.js +0 -894
  78. package/components/DynamicFilter/index.e1d4a948.js +0 -1157
  79. package/components/Image/index.c9da2d5a.js +0 -152
  80. package/components/ModalDialog/index.ad61757f.js +0 -168
  81. package/components/ObjectLogs/index.6ebaec71.js +0 -266
  82. package/components/Period/index.81de7941.js +0 -175
  83. package/components/contexts/RHFormContext/index.33dba822.js +0 -56
  84. package/components/formatters/index.c2a9b55d.js +0 -106
  85. package/components/hook-form/RHFAutocomplete/index.5eee9d7c.js +0 -174
  86. package/components/hook-form/RHFAutocompleteAsync/index.757b5080.js +0 -65
  87. package/components/hook-form/RHFPeriod/index.e08fb1ab.js +0 -51
  88. package/components/mui_extended/Button/index.51dae0bb.js +0 -144
  89. package/components/mui_extended/Pager/index.1dc45f5e.js +0 -126
  90. package/components/mui_extended/Popover/index.cb2ccc66.js +0 -252
  91. package/contexts/ModalContext/index.9ebc793c.js +0 -136
  92. package/hooks/useModal/index.34f5978e.js +0 -11
  93. package/node_modules.168cb897.js +0 -55
@@ -1,19 +1,20 @@
1
- import { styled as p } from "@mui/material";
2
- import { jsx as t } from "react/jsx-runtime";
3
- const a = p("p")(({
4
- theme: r
1
+ import { styled } from "@mui/material";
2
+ import { jsx } from "react/jsx-runtime";
3
+ const Wrapper = styled("p")(({
4
+ theme
5
5
  }) => ({
6
- ...r.typography.caption,
7
- color: r.palette.error.main,
6
+ ...theme.typography.caption,
7
+ color: theme.palette.error.main,
8
8
  margin: "8px 14px 0 14px"
9
- })), s = (r) => {
9
+ }));
10
+ const ErrorLabel = (props) => {
10
11
  const {
11
- message: o
12
- } = r;
13
- return /* @__PURE__ */ t(a, {
14
- children: o
12
+ message
13
+ } = props;
14
+ return /* @__PURE__ */ jsx(Wrapper, {
15
+ children: message
15
16
  });
16
17
  };
17
18
  export {
18
- s as E
19
+ ErrorLabel as E
19
20
  };
@@ -1,45 +1,49 @@
1
- import { styled as r } from "@mui/material";
2
- import { useState as l, useMemo as g, useEffect as m } from "react";
3
- import { useTheme as D } from "@mui/material/styles";
4
- import { g as I } from "../../utils/index.214d9542.js";
5
- import { jsx as o } from "react/jsx-runtime";
6
- const d = r("div", {
7
- shouldForwardProp: (t) => t !== "src" && t !== "size" && t !== "bgColor" && t !== "rotationAngle" && t !== "angleTransition"
1
+ import { styled } from "@mui/material";
2
+ import { useState, useMemo, useEffect } from "react";
3
+ import { useTheme } from "@mui/material/styles";
4
+ import { g as getPaletteColor } from "../../utils/index.214d9542.js";
5
+ import { jsx } from "react/jsx-runtime";
6
+ const DivIcon = styled("div", {
7
+ shouldForwardProp: (props) => props !== "src" && props !== "size" && props !== "bgColor" && props !== "rotationAngle" && props !== "angleTransition"
8
8
  })(({
9
- size: t,
10
- src: L,
11
- bgColor: e,
12
- rotationAngle: s,
13
- angleTransition: i
9
+ size,
10
+ src,
11
+ bgColor,
12
+ rotationAngle,
13
+ angleTransition
14
14
  }) => ({
15
15
  maskPosition: "center!important",
16
16
  maskRepeat: "no-repeat!important",
17
17
  WebkitMaskRepeat: "no-repeat!important",
18
- width: t,
19
- height: t,
20
- backgroundColor: e,
21
- mask: `url('data:image/svg+xml;base64,${L}')`,
22
- WebkitMask: `url('data:image/svg+xml;base64,${L}')`,
23
- ...s && {
24
- transform: `rotate(${s}deg)`
18
+ width: size,
19
+ height: size,
20
+ backgroundColor: bgColor,
21
+ mask: `url('data:image/svg+xml;base64,${src}')`,
22
+ WebkitMask: `url('data:image/svg+xml;base64,${src}')`,
23
+ ...rotationAngle && {
24
+ transform: `rotate(${rotationAngle}deg)`
25
25
  },
26
- ...i && s && {
27
- transition: `transform ${i}s ease-in-out`
26
+ ...angleTransition && rotationAngle && {
27
+ transition: `transform ${angleTransition}s ease-in-out`
28
28
  }
29
- })), N = r("div")(() => ({
29
+ }));
30
+ const WrapperPlaceHolder = styled("div")(() => ({
30
31
  display: "flex",
31
32
  justifyContent: "center",
32
33
  alignItems: "center"
33
34
  }));
34
- function T(t) {
35
+ function Icon(props) {
35
36
  const {
36
- src: L,
37
- size: e = "small",
38
- bgColor: s = "action.active",
39
- rotationAngle: i,
40
- angleTransition: n
41
- } = t, [c, w] = l(void 0), j = D(), u = g(() => {
42
- switch (e) {
37
+ src,
38
+ size = "small",
39
+ bgColor = "action.active",
40
+ rotationAngle,
41
+ angleTransition
42
+ } = props;
43
+ const [resource, setResource] = useState(void 0);
44
+ const theme = useTheme();
45
+ const finalSize = useMemo(() => {
46
+ switch (size) {
43
47
  case "extra-small":
44
48
  return "12px";
45
49
  case "small":
@@ -49,36 +53,44 @@ function T(t) {
49
53
  case "large":
50
54
  return "22px";
51
55
  }
52
- return e;
53
- }, [e]);
54
- return m(() => {
55
- let a = !0;
56
- return async function() {
57
- await fetch(L).then((M) => M.text() || "").then((M) => {
58
- M = M.match(
56
+ return size;
57
+ }, [size]);
58
+ useEffect(() => {
59
+ let mounted = true;
60
+ (async function networkOperation() {
61
+ await fetch(src).then((response) => {
62
+ return response.text() || "";
63
+ }).then((xml) => {
64
+ xml = xml.match(
59
65
  /(<svg\b[^>]*\s*(viewBox="(\b[^"]*)").*?>([\s\S]*?)<\/svg>|<svg>([\s\S]*?)<\/svg>)/g
60
- )?.toString() || "", a && w(window.btoa(M));
61
- }).catch((M) => {
66
+ )?.toString() || "";
67
+ if (mounted) {
68
+ setResource(window.btoa(xml));
69
+ }
70
+ }).catch((_err) => {
62
71
  });
63
- }(), function() {
64
- a = !1;
72
+ })();
73
+ return function clenUp() {
74
+ mounted = false;
65
75
  };
66
- }, [L]), /* @__PURE__ */ o(N, {
76
+ }, [src]);
77
+ const placeHolder = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI2LjMuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkNhcGFfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiCgkgdmlld0JveD0iMCAwIDcwIDcwIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA3MCA3MDsiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLnN0MHtmaWxsOiM2MzczODE7fQo8L3N0eWxlPgo8Zz4KCTxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik00NSw4LjdjMS40LTEuNSwzLjQtMi4zLDUuNC0yLjNzMy45LDAuOCw1LjQsMi4zczIuNCwzLjUsMi41LDUuN2MwLDIuMi0wLjksNC4yLTIuNCw1LjdzLTMuNSwyLjMtNS41LDIuMgoJCWMtMi4xLDAuMS00LTAuNy01LjUtMi4yYy0xLjQtMS41LTIuMy0zLjUtMi40LTUuN0M0Mi42LDEyLjIsNDMuNSwxMC4yLDQ1LDguN3oiLz4KCTxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik02OC40LDYyLjFjLTAuMywwLjUtMC43LDAuOC0xLjIsMS4xcy0xLDAuNC0xLjYsMC40SDQuM2MtMC42LDAtMS4xLTAuMS0xLjYtMC40cy0wLjktMC42LTEuMi0xLjEKCQljLTAuMi0wLjUtMC40LTEtMC40LTEuNXMwLjEtMS4xLDAuNC0xLjVsMjMtMzYuNGMwLjMtMC41LDAuNy0wLjgsMS4yLTEuMXMxLTAuNCwxLjYtMC40czEuMSwwLjEsMS42LDAuNHMwLjksMC42LDEuMiwxLjEKCQlsMTEuNSwxOC4yYzAuMiwwLjMsMC41LDAuNSwwLjgsMC43czAuNiwwLjMsMSwwLjNjMC4zLDAsMC43LTAuMSwxLTAuM3MwLjYtMC40LDAuOC0wLjdsMy4xLTQuOWMwLjMtMC41LDAuNy0wLjgsMS4yLTEuMQoJCXMxLTAuNCwxLjYtMC40czEuMSwwLjEsMS42LDAuNGMwLjUsMC4zLDAuOSwwLjYsMS4yLDEuMWwxNC42LDIzLjFjMC4zLDAuNSwwLjMsMSwwLjMsMS41UzY4LjcsNjEuNyw2OC40LDYyLjF6Ii8+CjwvZz4KPC9zdmc+Cg==";
78
+ return /* @__PURE__ */ jsx(WrapperPlaceHolder, {
67
79
  className: "m4l_icon",
68
- children: c ? /* @__PURE__ */ o(d, {
69
- src: c,
70
- size: u,
71
- bgColor: I(j.palette, s),
72
- rotationAngle: i,
73
- angleTransition: n
74
- }) : /* @__PURE__ */ o("img", {
75
- src: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI2LjMuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkNhcGFfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiCgkgdmlld0JveD0iMCAwIDcwIDcwIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA3MCA3MDsiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLnN0MHtmaWxsOiM2MzczODE7fQo8L3N0eWxlPgo8Zz4KCTxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik00NSw4LjdjMS40LTEuNSwzLjQtMi4zLDUuNC0yLjNzMy45LDAuOCw1LjQsMi4zczIuNCwzLjUsMi41LDUuN2MwLDIuMi0wLjksNC4yLTIuNCw1LjdzLTMuNSwyLjMtNS41LDIuMgoJCWMtMi4xLDAuMS00LTAuNy01LjUtMi4yYy0xLjQtMS41LTIuMy0zLjUtMi40LTUuN0M0Mi42LDEyLjIsNDMuNSwxMC4yLDQ1LDguN3oiLz4KCTxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik02OC40LDYyLjFjLTAuMywwLjUtMC43LDAuOC0xLjIsMS4xcy0xLDAuNC0xLjYsMC40SDQuM2MtMC42LDAtMS4xLTAuMS0xLjYtMC40cy0wLjktMC42LTEuMi0xLjEKCQljLTAuMi0wLjUtMC40LTEtMC40LTEuNXMwLjEtMS4xLDAuNC0xLjVsMjMtMzYuNGMwLjMtMC41LDAuNy0wLjgsMS4yLTEuMXMxLTAuNCwxLjYtMC40czEuMSwwLjEsMS42LDAuNHMwLjksMC42LDEuMiwxLjEKCQlsMTEuNSwxOC4yYzAuMiwwLjMsMC41LDAuNSwwLjgsMC43czAuNiwwLjMsMSwwLjNjMC4zLDAsMC43LTAuMSwxLTAuM3MwLjYtMC40LDAuOC0wLjdsMy4xLTQuOWMwLjMtMC41LDAuNy0wLjgsMS4yLTEuMQoJCXMxLTAuNCwxLjYtMC40czEuMSwwLjEsMS42LDAuNGMwLjUsMC4zLDAuOSwwLjYsMS4yLDEuMWwxNC42LDIzLjFjMC4zLDAuNSwwLjMsMSwwLjMsMS41UzY4LjcsNjEuNyw2OC40LDYyLjF6Ii8+CjwvZz4KPC9zdmc+Cg==",
80
+ children: resource ? /* @__PURE__ */ jsx(DivIcon, {
81
+ src: resource,
82
+ size: finalSize,
83
+ bgColor: getPaletteColor(theme.palette, bgColor),
84
+ rotationAngle,
85
+ angleTransition
86
+ }) : /* @__PURE__ */ jsx("img", {
87
+ src: placeHolder,
76
88
  alt: "icon_svg",
77
- width: u,
78
- height: u
89
+ width: finalSize,
90
+ height: finalSize
79
91
  })
80
92
  });
81
93
  }
82
94
  export {
83
- T as I
95
+ Icon as I
84
96
  };
@@ -0,0 +1,190 @@
1
+ import { useModuleSkeleton } from "@m4l/core";
2
+ import { forwardRef, useState, useRef, useImperativeHandle, useEffect, useMemo } from "react";
3
+ import { jsx, Fragment, jsxs } from "react/jsx-runtime";
4
+ import { styled, Skeleton as Skeleton$1 } from "@mui/material";
5
+ function isIntersectionObserverAvailable() {
6
+ return typeof window !== "undefined" && "IntersectionObserver" in window && "isIntersecting" in window.IntersectionObserverEntry.prototype;
7
+ }
8
+ const checkIntersections = (entries) => {
9
+ entries.forEach((entry) => {
10
+ if (entry.isIntersecting) {
11
+ entry.target?.setIsVisible(true);
12
+ }
13
+ });
14
+ };
15
+ const LAZY_LOAD_OBSERVERS = {};
16
+ const getObserver = (threshold) => {
17
+ LAZY_LOAD_OBSERVERS[threshold] = LAZY_LOAD_OBSERVERS[threshold] || new IntersectionObserver(checkIntersections, {
18
+ rootMargin: threshold + "px"
19
+ });
20
+ return LAZY_LOAD_OBSERVERS[threshold];
21
+ };
22
+ const BasicIntersectComponent = forwardRef((props, ref) => {
23
+ const {
24
+ height,
25
+ width,
26
+ setIsVisible,
27
+ threshold
28
+ } = props;
29
+ const [observer] = useState(getObserver(threshold));
30
+ const intersectComponentRef = useRef(null);
31
+ useImperativeHandle(ref, () => intersectComponentRef.current);
32
+ useEffect(() => {
33
+ if (observer && intersectComponentRef.current) {
34
+ intersectComponentRef.current.setIsVisible = setIsVisible;
35
+ observer.observe(intersectComponentRef.current);
36
+ }
37
+ return () => {
38
+ if (observer && intersectComponentRef.current) {
39
+ observer.unobserve(intersectComponentRef.current);
40
+ }
41
+ };
42
+ }, []);
43
+ const styleProp = {
44
+ display: "inline-block"
45
+ };
46
+ if (typeof width !== "undefined") {
47
+ styleProp.width = width;
48
+ }
49
+ if (typeof height !== "undefined") {
50
+ styleProp.height = height;
51
+ styleProp.minHeight = height;
52
+ }
53
+ return /* @__PURE__ */ jsx("span", {
54
+ id: "IntersectComponent",
55
+ ref: intersectComponentRef,
56
+ style: styleProp
57
+ });
58
+ });
59
+ BasicIntersectComponent.displayName = "IntersectComponent";
60
+ function LazyLoadComponent(props) {
61
+ const {
62
+ children,
63
+ useIntersectionObserver,
64
+ ...other
65
+ } = props;
66
+ const [isVisible, setIsVisible] = useState(!(useIntersectionObserver && isIntersectionObserverAvailable()));
67
+ if (isVisible) {
68
+ return /* @__PURE__ */ jsx(Fragment, {
69
+ children
70
+ });
71
+ }
72
+ return /* @__PURE__ */ jsx(BasicIntersectComponent, {
73
+ useIntersectionObserver,
74
+ setIsVisible,
75
+ ...other
76
+ });
77
+ }
78
+ const WrapperImage = styled("div", {
79
+ shouldForwardProp: (props) => props !== "width" && props !== "height"
80
+ })(({
81
+ height,
82
+ width
83
+ }) => ({
84
+ position: "relative",
85
+ width,
86
+ height,
87
+ minHeight: height,
88
+ minWidth: width,
89
+ "& > img ": {
90
+ opacity: 0,
91
+ position: "absolute",
92
+ inset: "0",
93
+ width: "100%",
94
+ height: "100%"
95
+ },
96
+ "&.loaded > img": {
97
+ opacity: 1,
98
+ transition: "opacity .5s"
99
+ },
100
+ "& .skeleton": {
101
+ opacity: 1,
102
+ width,
103
+ height
104
+ },
105
+ "&.loaded .skeleton": {
106
+ opacity: 0,
107
+ transition: "opacity .3s"
108
+ }
109
+ }));
110
+ const WrapperSkeletonImage = styled("div")(() => ({
111
+ mask: `url("data:image/svg+xml,%3Csvg version='1.1' id='Capa_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 70 70' style='enable-background:new 0 0 70 70%3B' xml:space='preserve'%3E%3Cg%3E%3Cpath d='M45 8.7c1.4-1.5 3.4-2.3 5.4-2.3s3.9 0.8 5.4 2.3s2.4 3.5 2.5 5.7c0 2.2-0.9 4.2-2.4 5.7s-3.5 2.3-5.5 2.2c-2.1 0.1-4-0.7-5.5-2.2c-1.4-1.5-2.3-3.5-2.4-5.7C42.6 12.2 43.5 10.2 45 8.7z'/%3E%3Cpath d='M68.4 62.1c-0.3 0.5-0.7 0.8-1.2 1.1s-1 0.4-1.6 0.4H4.3c-0.6 0-1.1-0.1-1.6-0.4s-0.9-0.6-1.2-1.1c-0.2-0.5-0.4-1-0.4-1.5s0.1-1.1 0.4-1.5l23-36.4c0.3-0.5 0.7-0.8 1.2-1.1c0.5-0.3 1-0.4 1.6-0.4c0.6 0 1.1 0.1 1.6 0.4c0.5 0.3 0.9 0.6 1.2 1.1l11.5 18.2c0.2 0.3 0.5 0.5 0.8 0.7c0.3 0.2 0.6 0.3 1 0.3c0.3 0 0.7-0.1 1-0.3c0.3-0.2 0.6-0.4 0.8-0.7l3.1-4.9c0.3-0.5 0.7-0.8 1.2-1.1c0.5-0.3 1-0.4 1.6-0.4c0.6 0 1.1 0.1 1.6 0.4c0.5 0.3 0.9 0.6 1.2 1.1l14.6 23.1c0.3 0.5 0.3 1 0.3 1.5S68.7 61.7 68.4 62.1z'/%3E%3C/g%3E%3C/svg%3E") no-repeat center / contain`,
112
+ WebkitMask: `url("data:image/svg+xml,%3Csvg version='1.1' id='Capa_1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' x='0px' y='0px' viewBox='0 0 70 70' style='enable-background:new 0 0 70 70%3B' xml:space='preserve'%3E%3Cg%3E%3Cpath d='M45 8.7c1.4-1.5 3.4-2.3 5.4-2.3s3.9 0.8 5.4 2.3s2.4 3.5 2.5 5.7c0 2.2-0.9 4.2-2.4 5.7s-3.5 2.3-5.5 2.2c-2.1 0.1-4-0.7-5.5-2.2c-1.4-1.5-2.3-3.5-2.4-5.7C42.6 12.2 43.5 10.2 45 8.7z'/%3E%3Cpath d='M68.4 62.1c-0.3 0.5-0.7 0.8-1.2 1.1s-1 0.4-1.6 0.4H4.3c-0.6 0-1.1-0.1-1.6-0.4s-0.9-0.6-1.2-1.1c-0.2-0.5-0.4-1-0.4-1.5s0.1-1.1 0.4-1.5l23-36.4c0.3-0.5 0.7-0.8 1.2-1.1c0.5-0.3 1-0.4 1.6-0.4c0.6 0 1.1 0.1 1.6 0.4c0.5 0.3 0.9 0.6 1.2 1.1l11.5 18.2c0.2 0.3 0.5 0.5 0.8 0.7c0.3 0.2 0.6 0.3 1 0.3c0.3 0 0.7-0.1 1-0.3c0.3-0.2 0.6-0.4 0.8-0.7l3.1-4.9c0.3-0.5 0.7-0.8 1.2-1.1c0.5-0.3 1-0.4 1.6-0.4c0.6 0 1.1 0.1 1.6 0.4c0.5 0.3 0.9 0.6 1.2 1.1l14.6 23.1c0.3 0.5 0.3 1 0.3 1.5S68.7 61.7 68.4 62.1z'/%3E%3C/g%3E%3C/svg%3E") no-repeat center / contain`,
113
+ height: "100%",
114
+ width: "100%",
115
+ display: "flex",
116
+ alignItems: "center",
117
+ justifyContent: "center"
118
+ }));
119
+ const Skeleton = (props) => {
120
+ const {
121
+ skeletonVariant
122
+ } = props;
123
+ return skeletonVariant === "image" ? /* @__PURE__ */ jsx(WrapperSkeletonImage, {
124
+ className: "skeleton",
125
+ children: /* @__PURE__ */ jsx(Skeleton$1, {
126
+ variant: "rectangular",
127
+ width: "100%",
128
+ height: "100%"
129
+ })
130
+ }) : /* @__PURE__ */ jsx(Skeleton$1, {
131
+ variant: "circular",
132
+ width: "100%",
133
+ height: "100%",
134
+ className: "skeleton"
135
+ });
136
+ };
137
+ function Image(props) {
138
+ const {
139
+ src,
140
+ alt,
141
+ useIntersectionObserver = true,
142
+ threshold = 100,
143
+ width,
144
+ height,
145
+ skeletonVariant = "image"
146
+ } = props;
147
+ const isSKeleton = useModuleSkeleton();
148
+ const [statusLoad, setStatusLoad] = useState("initial");
149
+ useEffect(() => {
150
+ let timer;
151
+ if (statusLoad === "loaded" && !isSKeleton) {
152
+ timer = setTimeout(() => {
153
+ setStatusLoad("removed");
154
+ }, 3e3);
155
+ }
156
+ return () => {
157
+ if (timer) {
158
+ clearTimeout(timer);
159
+ }
160
+ };
161
+ }, [statusLoad, isSKeleton]);
162
+ const onLoad = () => {
163
+ setStatusLoad("loaded");
164
+ };
165
+ const lazyLoadComponent = useMemo(() => {
166
+ const isImageLoaded = !isSKeleton && statusLoad !== "initial";
167
+ return /* @__PURE__ */ jsx(WrapperImage, {
168
+ width,
169
+ height,
170
+ className: "m4l_image " + (isImageLoaded ? "loaded" : ""),
171
+ children: /* @__PURE__ */ jsxs(LazyLoadComponent, {
172
+ width,
173
+ height,
174
+ useIntersectionObserver,
175
+ threshold,
176
+ children: [statusLoad !== "removed" ? /* @__PURE__ */ jsx(Skeleton, {
177
+ skeletonVariant
178
+ }) : null, /* @__PURE__ */ jsx("img", {
179
+ alt,
180
+ src,
181
+ onLoad
182
+ })]
183
+ })
184
+ });
185
+ }, [statusLoad, isSKeleton, src]);
186
+ return lazyLoadComponent;
187
+ }
188
+ export {
189
+ Image as I
190
+ };
@@ -1,15 +1,15 @@
1
- import { Suspense as a } from "react";
2
- import { jsx as e } from "react/jsx-runtime";
3
- const l = (o) => function(r) {
4
- return /* @__PURE__ */ e(a, {
5
- fallback: /* @__PURE__ */ e("div", {
1
+ import { Suspense } from "react";
2
+ import { jsx } from "react/jsx-runtime";
3
+ const Loadable = (Component) => function EmbededLoadable(props) {
4
+ return /* @__PURE__ */ jsx(Suspense, {
5
+ fallback: /* @__PURE__ */ jsx("div", {
6
6
  children: "Cargando"
7
7
  }),
8
- children: /* @__PURE__ */ e(o, {
9
- ...r
8
+ children: /* @__PURE__ */ jsx(Component, {
9
+ ...props
10
10
  })
11
11
  });
12
12
  };
13
13
  export {
14
- l as L
14
+ Loadable as L
15
15
  };
@@ -0,0 +1,184 @@
1
+ import { Dialog, IconButton, Paper } from "@mui/material";
2
+ import { c as cjs } from "../../react-draggable.20e95c61.js";
3
+ import { u as useModal } from "../../hooks/useModal/index.5fee01a3.js";
4
+ import { styled } from "@mui/material/styles";
5
+ import { a as getThemeVariantColor } from "../../utils/index.214d9542.js";
6
+ import { R as Resizeable } from "../Resizeable/index.45995d2b.js";
7
+ import { useResponsiveDesktop } from "@m4l/graphics";
8
+ import { useEnvironment } from "@m4l/core";
9
+ import { I as Icon } from "../Icon/index.619c31c4.js";
10
+ import { jsxs, jsx } from "react/jsx-runtime";
11
+ import { b as Actions, g as getCommonActionsDictionary } from "../CommonActions/components/Actions/index.0645e30f.js";
12
+ const WrapperDialog = styled(Dialog)(() => ({}));
13
+ const Container = styled("div")(({ theme }) => ({
14
+ display: "flex",
15
+ flexDirection: "column",
16
+ height: "100%",
17
+ overflow: "hidden",
18
+ padding: theme.spacing(3)
19
+ }));
20
+ const Header$1 = styled("div")(({ theme }) => ({
21
+ display: "flex",
22
+ alignItems: "center",
23
+ justifyContent: "space-between",
24
+ minHeight: theme.spacing(5),
25
+ borderBottom: `1px solid ${theme.palette.divider}`,
26
+ overflow: "hidden"
27
+ }));
28
+ styled("div")(({ theme }) => ({
29
+ display: "flex",
30
+ flexDirection: "row",
31
+ flexGrow: 1,
32
+ alignItems: "center",
33
+ cursor: "move",
34
+ ...theme.typography.subtitle1,
35
+ color: theme.palette.text.primary
36
+ }));
37
+ const IconHeader = styled("div")(({ theme, variant }) => ({
38
+ display: "flex",
39
+ alignItems: "center",
40
+ justifyContent: "center",
41
+ marginRight: theme.spacing(1.5),
42
+ "& > span": {
43
+ background: getThemeVariantColor(theme, variant)
44
+ }
45
+ }));
46
+ const Content = styled("div")(() => ({
47
+ flexGrow: 1,
48
+ position: "relative",
49
+ overflow: "auto"
50
+ }));
51
+ const ModalTitle = styled("div")(({ theme, variant }) => ({
52
+ ...theme.typography.subtitle1,
53
+ color: getThemeVariantColor(theme, variant),
54
+ width: "100%",
55
+ whiteSpace: "nowrap",
56
+ textOverflow: "ellipsis",
57
+ overflow: "hidden"
58
+ }));
59
+ const Header = (props) => {
60
+ const {
61
+ host_static_assets,
62
+ environment_assets
63
+ } = useEnvironment();
64
+ const {
65
+ variant,
66
+ title,
67
+ iconComponent,
68
+ withClose,
69
+ onCloseModal
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(Header$1, {
76
+ id: "Header",
77
+ className: "draggable-dialog-title",
78
+ children: [/* @__PURE__ */ jsx(IconHeader, {
79
+ variant,
80
+ children: !iconComponent ? /* @__PURE__ */ jsx(Icon, {
81
+ src: variant === "warning" ? iconSrcWarning : variant === "delete" ? iconSrcError : variant === "info" ? iconSrcInfo : iconDefault
82
+ }) : iconComponent
83
+ }), /* @__PURE__ */ jsx(ModalTitle, {
84
+ variant,
85
+ children: title
86
+ }), withClose && /* @__PURE__ */ jsx(IconButton, {
87
+ onClick: onCloseModal,
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 DragabblePaperComponent = (props) => {
96
+ return /* @__PURE__ */ jsx(cjs.exports, {
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
+ actions,
132
+ variant
133
+ } = useModal();
134
+ const isDesktop = useResponsiveDesktop();
135
+ const onCloseModal = () => {
136
+ closeModal();
137
+ };
138
+ const contentComnponent = /* @__PURE__ */ jsxs(Container, {
139
+ id: "Container",
140
+ children: [
141
+ /* @__PURE__ */ jsx(Header, {
142
+ variant,
143
+ title,
144
+ iconComponent,
145
+ withClose,
146
+ onCloseModal
147
+ }),
148
+ /* @__PURE__ */ jsx(Content, {
149
+ id: "Content",
150
+ children: typeof contentComponent === "function" ? contentComponent() : contentComponent
151
+ }),
152
+ actions && /* @__PURE__ */ jsx(Actions, {
153
+ children: actions
154
+ })
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
+ function getModalDialogComponentsDictionary() {
175
+ return ["modal_dialog"].concat(getCommonActionsDictionary());
176
+ }
177
+ const defaultModalDialogDictionary = {
178
+ modal_dialog: {}
179
+ };
180
+ export {
181
+ ModalDialog as M,
182
+ defaultModalDialogDictionary as d,
183
+ getModalDialogComponentsDictionary as g
184
+ };