@m4l/components 0.1.26 → 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 (112) 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 +96 -0
  12. package/components/Icon/types.d.ts +2 -1
  13. package/components/Image/index.93d5f37f.js +190 -0
  14. package/components/Loadable/index.f5518558.js +8 -8
  15. package/components/ModalDialog/index.9ea10764.js +184 -0
  16. package/components/NoItemSelected/{index.9609a7f7.js → index.46d2f632.js} +52 -41
  17. package/components/ObjectLogs/index.f941fb79.js +288 -0
  18. package/components/Page/index.4237c241.js +22 -20
  19. package/components/PaperForm/index.ec9cb8c9.js +112 -0
  20. package/components/Period/index.2941fbda.js +249 -0
  21. package/components/PropertyValue/index.dfcfe1ba.js +147 -0
  22. package/components/PropertyValue/styles.d.ts +2 -1
  23. package/components/PropertyValue/types.d.ts +3 -3
  24. package/components/Resizeable/index.45995d2b.js +19 -19
  25. package/components/ScrollBar/index.39eeb2de.js +26 -21
  26. package/components/ScrollToTop/index.e06f98f6.js +8 -7
  27. package/components/SplitLayout/index.4032673d.js +35 -33
  28. package/components/animate/LoadingScreen/index.1d0c4307.js +33 -33
  29. package/components/animate/MotionContainer/index.8d9f9d80.js +25 -22
  30. package/components/animate/MotionLazyContainer/index.572dd012.js +10 -10
  31. package/components/animate/features.0fbf41e1.js +3 -3
  32. package/components/animate/variants/bounce.784aaaaa.js +16 -13
  33. package/components/animate/variants/container.11f82b76.js +8 -6
  34. package/components/animate/variants/fade.b561c0fc.js +32 -28
  35. package/components/animate/variants/transition.bd46b9ce.js +17 -12
  36. package/components/formatters/BooleanFormatter/index.8da35c9c.js +55 -0
  37. package/components/formatters/DateFormatter/index.1b9baacc.js +69 -0
  38. package/components/formatters/index.689a8086.js +119 -0
  39. package/components/hook-form/RHFAutocomplete/index.59a68f9f.js +224 -0
  40. package/components/hook-form/RHFAutocompleteAsync/index.c3083062.js +87 -0
  41. package/components/hook-form/RHFCheckbox/index.6dcec9e2.js +49 -39
  42. package/components/hook-form/RHFDateTime/index.9231a7c7.js +69 -56
  43. package/components/hook-form/RHFMultiCheckbox/index.2680b3b6.js +23 -23
  44. package/components/hook-form/RHFPeriod/index.64a228d5.js +55 -0
  45. package/components/hook-form/RHFRadioGroup/index.b3335e13.js +29 -29
  46. package/components/hook-form/RHFSelect/index.b6ca8bb2.js +24 -24
  47. package/components/hook-form/RHFTextField/index.f9aaaa90.js +146 -0
  48. package/components/hook-form/RHFUpload/RHFUploadImage/{components → subcomponents}/UploadImage/index.d.ts +0 -0
  49. package/components/hook-form/RHFUpload/RHFUploadImage/{components → subcomponents}/UploadImage/styles.d.ts +4 -3
  50. package/components/hook-form/RHFUpload/RHFUploadImage/{components → subcomponents}/UploadImage/subcomponents/Skeleton/index.d.ts +0 -0
  51. package/components/hook-form/RHFUpload/RHFUploadImage/{components → subcomponents}/UploadImage/subcomponents/Skeleton/styles.d.ts +0 -0
  52. package/components/hook-form/RHFUpload/RHFUploadImage/{components → subcomponents}/UploadImage/types.d.ts +0 -0
  53. package/components/hook-form/RHFUpload/index.d5cc7c13.js +285 -0
  54. package/components/mui_extended/Accordion/index.a02ac6ae.js +107 -0
  55. package/components/mui_extended/Avatar/index.fe06afd7.js +51 -0
  56. package/components/mui_extended/BoxIcon/index.e638ecc8.js +10 -10
  57. package/components/mui_extended/Breadcrumbs/index.5e37d903.js +49 -44
  58. package/components/mui_extended/Button/index.53b56958.js +178 -0
  59. package/components/mui_extended/CircularProgress/index.ad569afd.js +8 -6
  60. package/components/mui_extended/IconButton/index.a321e5cb.js +120 -0
  61. package/components/mui_extended/IconButton/index.d.ts +1 -1
  62. package/components/mui_extended/LinkWithRoute/index.16436ab8.js +25 -21
  63. package/components/mui_extended/Pager/index.c0865b70.js +141 -0
  64. package/components/mui_extended/Popover/index.705275a4.js +278 -0
  65. package/components/mui_extended/Tab/index.e0653a0a.js +25 -21
  66. package/components/mui_extended/Typography/index.e5494696.js +25 -21
  67. package/contexts/ModalContext/index.b92fa565.js +153 -0
  68. package/contexts/ModalContext/{components → subcomponents}/ContentConfirm/index.d.ts +0 -0
  69. package/contexts/ModalContext/{components → subcomponents}/ContentConfirm/styles.d.ts +0 -0
  70. package/contexts/ModalContext/{components → subcomponents}/ContentConfirm/types.d.ts +0 -0
  71. package/contexts/RHFormContext/index.b142190a.js +63 -0
  72. package/hooks/useFormAddEdit/index.d4845f1a.js +40 -22
  73. package/hooks/useModal/index.5fee01a3.js +11 -0
  74. package/index.js +153 -153
  75. package/package.json +2 -1
  76. package/react-data-grid.d46d625e.js +2206 -1663
  77. package/react-draggable.20e95c61.js +800 -553
  78. package/react-json-view.f56a7f8e.js +2344 -2340
  79. package/react-resizable.5277deaf.js +470 -298
  80. package/react-splitter-layout.7810ac1b.js +130 -128
  81. package/utils/index.214d9542.js +500 -354
  82. package/components/CommonActions/components/ActionCancel/index.6736b782.js +0 -17
  83. package/components/CommonActions/components/ActionFormCancel/index.281ee166.js +0 -49
  84. package/components/CommonActions/components/ActionIntro/index.4665a611.js +0 -18
  85. package/components/CommonActions/components/Actions/index.cd7b2671.js +0 -742
  86. package/components/DataGrid/index.2caf6231.js +0 -894
  87. package/components/DynamicFilter/index.f2377369.js +0 -1157
  88. package/components/Icon/index.f569765b.js +0 -82
  89. package/components/Image/index.c9da2d5a.js +0 -152
  90. package/components/ModalDialog/index.bee344a5.js +0 -168
  91. package/components/ObjectLogs/index.6b6f95e6.js +0 -266
  92. package/components/PaperForm/index.3f8c7ef2.js +0 -105
  93. package/components/Period/index.a112ce37.js +0 -175
  94. package/components/PropertyValue/index.ab3dd7e9.js +0 -116
  95. package/components/contexts/RHFormContext/index.33dba822.js +0 -56
  96. package/components/formatters/BooleanFormatter/index.3ec56305.js +0 -42
  97. package/components/formatters/DateFormatter/index.08d8823b.js +0 -57
  98. package/components/formatters/index.6959c2de.js +0 -106
  99. package/components/hook-form/RHFAutocomplete/index.5eee9d7c.js +0 -174
  100. package/components/hook-form/RHFAutocompleteAsync/index.757b5080.js +0 -65
  101. package/components/hook-form/RHFPeriod/index.979d0898.js +0 -51
  102. package/components/hook-form/RHFTextField/index.ba2a8f67.js +0 -129
  103. package/components/hook-form/RHFUpload/index.6347159a.js +0 -258
  104. package/components/mui_extended/Accordion/index.49f5df8e.js +0 -103
  105. package/components/mui_extended/Avatar/index.dadb0528.js +0 -37
  106. package/components/mui_extended/Button/index.52d18aea.js +0 -144
  107. package/components/mui_extended/IconButton/index.4b5ce8b5.js +0 -103
  108. package/components/mui_extended/Pager/index.951b6975.js +0 -126
  109. package/components/mui_extended/Popover/index.4da8587a.js +0 -252
  110. package/contexts/ModalContext/index.5388dfd5.js +0 -136
  111. package/hooks/useModal/index.3b1ff084.js +0 -11
  112. package/node_modules.168cb897.js +0 -55
@@ -1,82 +0,0 @@
1
- import { styled as c } from "@mui/material";
2
- import { useState as C, useMemo as l, useEffect as g } from "react";
3
- import { useTheme as m } 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 = c("div", {
7
- shouldForwardProp: (t) => t !== "src" && t !== "sizeIcon" && t !== "bgColor" && t !== "rotate"
8
- })(({
9
- size: t,
10
- src: L,
11
- bgColor: e,
12
- rotate: i,
13
- theme: s
14
- }) => ({
15
- maskPosition: "center!important",
16
- maskRepeat: "no-repeat!important",
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
- transition: s.transitions.create("transform", {
24
- duration: s.transitions.duration.shorter
25
- }),
26
- ...i && {
27
- transform: "rotate(180deg)"
28
- }
29
- })), D = c("div")(() => ({
30
- display: "flex",
31
- justifyContent: "center",
32
- alignItems: "center"
33
- }));
34
- function b(t) {
35
- const {
36
- src: L,
37
- size: e = "small",
38
- bgColor: i = "action.active",
39
- rotate: s = !1
40
- } = t, [r, n] = C(void 0), w = m(), u = l(() => {
41
- switch (e) {
42
- case "extra-small":
43
- return "12px";
44
- case "small":
45
- return "16px";
46
- case "medium":
47
- return "18px";
48
- case "large":
49
- return "22px";
50
- }
51
- return e;
52
- }, [e]);
53
- return g(() => {
54
- let a = !0;
55
- return async function() {
56
- await fetch(L).then((M) => M.text() || "").then((M) => {
57
- M = M.match(
58
- /(<svg\b[^>]*\s*(viewBox="(\b[^"]*)").*?>([\s\S]*?)<\/svg>|<svg>([\s\S]*?)<\/svg>)/g
59
- )?.toString() || "", a && n(window.btoa(M));
60
- }).catch((M) => {
61
- });
62
- }(), function() {
63
- a = !1;
64
- };
65
- }, [L]), /* @__PURE__ */ o(D, {
66
- className: "m4l_icon",
67
- children: r ? /* @__PURE__ */ o(d, {
68
- src: r,
69
- size: u,
70
- bgColor: I(w.palette, i),
71
- rotate: s
72
- }) : /* @__PURE__ */ o("img", {
73
- src: "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI2LjMuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkNhcGFfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiCgkgdmlld0JveD0iMCAwIDcwIDcwIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA3MCA3MDsiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPgoJLnN0MHtmaWxsOiM2MzczODE7fQo8L3N0eWxlPgo8Zz4KCTxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik00NSw4LjdjMS40LTEuNSwzLjQtMi4zLDUuNC0yLjNzMy45LDAuOCw1LjQsMi4zczIuNCwzLjUsMi41LDUuN2MwLDIuMi0wLjksNC4yLTIuNCw1LjdzLTMuNSwyLjMtNS41LDIuMgoJCWMtMi4xLDAuMS00LTAuNy01LjUtMi4yYy0xLjQtMS41LTIuMy0zLjUtMi40LTUuN0M0Mi42LDEyLjIsNDMuNSwxMC4yLDQ1LDguN3oiLz4KCTxwYXRoIGNsYXNzPSJzdDAiIGQ9Ik02OC40LDYyLjFjLTAuMywwLjUtMC43LDAuOC0xLjIsMS4xcy0xLDAuNC0xLjYsMC40SDQuM2MtMC42LDAtMS4xLTAuMS0xLjYtMC40cy0wLjktMC42LTEuMi0xLjEKCQljLTAuMi0wLjUtMC40LTEtMC40LTEuNXMwLjEtMS4xLDAuNC0xLjVsMjMtMzYuNGMwLjMtMC41LDAuNy0wLjgsMS4yLTEuMXMxLTAuNCwxLjYtMC40czEuMSwwLjEsMS42LDAuNHMwLjksMC42LDEuMiwxLjEKCQlsMTEuNSwxOC4yYzAuMiwwLjMsMC41LDAuNSwwLjgsMC43czAuNiwwLjMsMSwwLjNjMC4zLDAsMC43LTAuMSwxLTAuM3MwLjYtMC40LDAuOC0wLjdsMy4xLTQuOWMwLjMtMC41LDAuNy0wLjgsMS4yLTEuMQoJCXMxLTAuNCwxLjYtMC40czEuMSwwLjEsMS42LDAuNGMwLjUsMC4zLDAuOSwwLjYsMS4yLDEuMWwxNC42LDIzLjFjMC4zLDAuNSwwLjMsMSwwLjMsMS41UzY4LjcsNjEuNyw2OC40LDYyLjF6Ii8+CjwvZz4KPC9zdmc+Cg==",
74
- alt: "icon_svg",
75
- width: u,
76
- height: u
77
- })
78
- });
79
- }
80
- export {
81
- b as I
82
- };
@@ -1,152 +0,0 @@
1
- import { useModuleSkeleton as y } from "@m4l/core";
2
- import { forwardRef as C, useState as g, useRef as b, useImperativeHandle as k, useEffect as w, useMemo as I } from "react";
3
- import { jsx as i, Fragment as E, jsxs as S } from "react/jsx-runtime";
4
- import { styled as v, Skeleton as h } from "@mui/material";
5
- function L() {
6
- return typeof window < "u" && "IntersectionObserver" in window && "isIntersecting" in window.IntersectionObserverEntry.prototype;
7
- }
8
- const O = (e) => {
9
- e.forEach((t) => {
10
- t.isIntersecting && t.target?.setIsVisible(!0);
11
- });
12
- }, m = {}, V = (e) => (m[e] = m[e] || new IntersectionObserver(O, {
13
- rootMargin: e + "px"
14
- }), m[e]);
15
- console.log("LAZY_LOAD_OBSERVERS", JSON.stringify(m));
16
- const f = C((e, t) => {
17
- const {
18
- height: o,
19
- width: c,
20
- setIsVisible: l,
21
- threshold: a
22
- } = e, [r] = g(V(a)), n = b(null);
23
- k(t, () => n.current), w(() => (r && n.current && (n.current.setIsVisible = l, r.observe(n.current)), () => {
24
- r && n.current && r.unobserve(n.current);
25
- }), []);
26
- const s = {
27
- display: "inline-block"
28
- };
29
- return typeof c < "u" && (s.width = c), typeof o < "u" && (s.height = o, s.minHeight = o), /* @__PURE__ */ i("span", {
30
- id: "IntersectComponent",
31
- ref: n,
32
- style: s
33
- });
34
- });
35
- f.displayName = "IntersectComponent";
36
- function M(e) {
37
- const {
38
- children: t,
39
- useIntersectionObserver: o,
40
- ...c
41
- } = e, [l, a] = g(!(o && L()));
42
- return l ? /* @__PURE__ */ i(E, {
43
- children: t
44
- }) : /* @__PURE__ */ i(f, {
45
- useIntersectionObserver: o,
46
- setIsVisible: a,
47
- ...c
48
- });
49
- }
50
- const z = v("div", {
51
- shouldForwardProp: (e) => e !== "width" && e !== "height"
52
- })(({
53
- height: e,
54
- width: t
55
- }) => ({
56
- position: "relative",
57
- width: t,
58
- height: e,
59
- minHeight: e,
60
- minWidth: t,
61
- "& > img ": {
62
- opacity: 0,
63
- position: "absolute",
64
- inset: "0",
65
- width: "100%",
66
- height: "100%"
67
- },
68
- "&.loaded > img": {
69
- opacity: 1,
70
- transition: "opacity .5s"
71
- },
72
- "& .skeleton": {
73
- opacity: 1,
74
- width: t,
75
- height: e
76
- },
77
- "&.loaded .skeleton": {
78
- opacity: 0,
79
- transition: "opacity .3s"
80
- }
81
- })), B = v("div")(() => ({
82
- 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`,
83
- 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`,
84
- height: "100%",
85
- width: "100%",
86
- display: "flex",
87
- alignItems: "center",
88
- justifyContent: "center"
89
- })), R = (e) => {
90
- const {
91
- skeletonVariant: t
92
- } = e;
93
- return t === "image" ? /* @__PURE__ */ i(B, {
94
- className: "skeleton",
95
- children: /* @__PURE__ */ i(h, {
96
- variant: "rectangular",
97
- width: "100%",
98
- height: "100%"
99
- })
100
- }) : /* @__PURE__ */ i(h, {
101
- variant: "circular",
102
- width: "100%",
103
- height: "100%",
104
- className: "skeleton"
105
- });
106
- };
107
- function j(e) {
108
- const {
109
- src: t,
110
- alt: o,
111
- useIntersectionObserver: c = !0,
112
- threshold: l = 100,
113
- width: a,
114
- height: r,
115
- skeletonVariant: n = "image"
116
- } = e, s = y(), [d, u] = g("initial");
117
- w(() => {
118
- let p;
119
- return d === "loaded" && !s && (p = setTimeout(() => {
120
- u("removed");
121
- }, 3e3)), () => {
122
- p && clearTimeout(p);
123
- };
124
- }, [d, s]);
125
- const x = () => {
126
- u("loaded");
127
- };
128
- return I(() => {
129
- const p = !s && d !== "initial";
130
- return console.log("image skeleton", s, n), /* @__PURE__ */ i(z, {
131
- width: a,
132
- height: r,
133
- className: "m4l_image " + (p ? "loaded" : ""),
134
- children: /* @__PURE__ */ S(M, {
135
- width: a,
136
- height: r,
137
- useIntersectionObserver: c,
138
- threshold: l,
139
- children: [d !== "removed" ? /* @__PURE__ */ i(R, {
140
- skeletonVariant: n
141
- }) : null, /* @__PURE__ */ i("img", {
142
- alt: o,
143
- src: t,
144
- onLoad: x
145
- })]
146
- })
147
- });
148
- }, [d, s, t]);
149
- }
150
- export {
151
- j as I
152
- };
@@ -1,168 +0,0 @@
1
- import { Dialog as b, IconButton as w, Paper as v } from "@mui/material";
2
- import { c as D } from "../../react-draggable.20e95c61.js";
3
- import { u as $ } from "../../hooks/useModal/index.3b1ff084.js";
4
- import { styled as s } from "@mui/material/styles";
5
- import { a as x } from "../../utils/index.214d9542.js";
6
- import { R as M } from "../Resizeable/index.45995d2b.js";
7
- import { useResponsiveDesktop as H } from "@m4l/graphics";
8
- import { useEnvironment as I } from "@m4l/core";
9
- import { I as C } from "../Icon/index.f569765b.js";
10
- import { jsxs as h, jsx as n } from "react/jsx-runtime";
11
- import { b as W, g as _ } from "../CommonActions/components/Actions/index.cd7b2671.js";
12
- const j = s(b)(() => ({})), k = s("div")(({ theme: o }) => ({
13
- display: "flex",
14
- flexDirection: "column",
15
- height: "100%",
16
- overflow: "hidden",
17
- padding: o.spacing(3)
18
- })), P = s("div")(({ theme: o }) => ({
19
- display: "flex",
20
- alignItems: "center",
21
- justifyContent: "space-between",
22
- minHeight: o.spacing(5),
23
- borderBottom: `1px solid ${o.palette.divider}`,
24
- overflow: "hidden"
25
- }));
26
- s("div")(({ theme: o }) => ({
27
- display: "flex",
28
- flexDirection: "row",
29
- flexGrow: 1,
30
- alignItems: "center",
31
- cursor: "move",
32
- ...o.typography.subtitle1,
33
- color: o.palette.text.primary
34
- }));
35
- const R = s("div")(({ theme: o, variant: t }) => ({
36
- display: "flex",
37
- alignItems: "center",
38
- justifyContent: "center",
39
- marginRight: o.spacing(1.5),
40
- "& > span": {
41
- background: x(o, t)
42
- }
43
- })), S = s("div")(() => ({
44
- flexGrow: 1,
45
- position: "relative",
46
- overflow: "auto"
47
- })), A = s("div")(({ theme: o, variant: t }) => ({
48
- ...o.typography.subtitle1,
49
- color: x(o, t),
50
- width: "100%",
51
- whiteSpace: "nowrap",
52
- textOverflow: "ellipsis",
53
- overflow: "hidden"
54
- })), B = (o) => {
55
- const {
56
- host_static_assets: t,
57
- environment_assets: e
58
- } = I(), {
59
- variant: i,
60
- title: d,
61
- iconComponent: r,
62
- withClose: p,
63
- onCloseModal: a
64
- } = o, m = `${t}/${e}/frontend/components/dialog/assets/icons/warning.svg`, g = `${t}/${e}/frontend/components/dialog/assets/icons/error.svg`, f = `${t}/${e}/frontend/components/dialog/assets/icons/info.svg`, l = `${t}/${e}/frontend/components/dialog/assets/icons/icon_bar_title.svg`;
65
- return /* @__PURE__ */ h(P, {
66
- id: "Header",
67
- className: "draggable-dialog-title",
68
- children: [/* @__PURE__ */ n(R, {
69
- variant: i,
70
- children: r || /* @__PURE__ */ n(C, {
71
- src: i === "warning" ? m : i === "delete" ? g : i === "info" ? f : l
72
- })
73
- }), /* @__PURE__ */ n(A, {
74
- variant: i,
75
- children: d
76
- }), p && /* @__PURE__ */ n(w, {
77
- onClick: a,
78
- "aria-label": "click",
79
- children: /* @__PURE__ */ n(C, {
80
- src: `${t}/${e}/frontend/components/dialog/assets/icons/close.svg`
81
- })
82
- })]
83
- });
84
- }, E = (o) => /* @__PURE__ */ n(D.exports, {
85
- handle: ".draggable-dialog-title",
86
- cancel: '[class*="MuiDialogContent-root"]',
87
- children: /* @__PURE__ */ n(v, {
88
- sx: {
89
- maxHeight: "unset",
90
- maxWidth: "unset"
91
- },
92
- ...o
93
- })
94
- });
95
- function G(o) {
96
- return /* @__PURE__ */ n(v, {
97
- sx: {
98
- maxHeight: "unset",
99
- maxWidth: "unset",
100
- height: "100%"
101
- },
102
- ...o
103
- });
104
- }
105
- const X = () => {
106
- const {
107
- open: o,
108
- initialWidth: t = 600,
109
- initialHeigth: e = 400,
110
- maxWidth: i,
111
- maxHeigth: d,
112
- withClose: r = !0,
113
- onQueryClose: p,
114
- contentComponent: a,
115
- title: m,
116
- closeModal: g,
117
- iconComponent: f,
118
- actions: l,
119
- variant: y
120
- } = $(), c = H(), u = /* @__PURE__ */ h(k, {
121
- id: "Container",
122
- children: [
123
- /* @__PURE__ */ n(B, {
124
- variant: y,
125
- title: m,
126
- iconComponent: f,
127
- withClose: r,
128
- onCloseModal: () => {
129
- g();
130
- }
131
- }),
132
- /* @__PURE__ */ n(S, {
133
- id: "Content",
134
- children: typeof a == "function" ? a() : a
135
- }),
136
- l && /* @__PURE__ */ n(W, {
137
- children: l
138
- })
139
- ]
140
- });
141
- return /* @__PURE__ */ h(j, {
142
- open: o,
143
- onClose: p,
144
- "aria-labelledby": "child-modal-title",
145
- "aria-describedby": "child-modal-description",
146
- PaperComponent: c ? E : G,
147
- maxWidth: !1,
148
- fullWidth: !c,
149
- children: [c && /* @__PURE__ */ n(M, {
150
- width: t,
151
- height: e,
152
- maxWidth: i,
153
- maxHeigth: d,
154
- children: u
155
- }), !c && u]
156
- });
157
- };
158
- function Y() {
159
- return ["modal_dialog"].concat(_());
160
- }
161
- const Z = {
162
- modal_dialog: {}
163
- };
164
- export {
165
- X as M,
166
- Z as d,
167
- Y as g
168
- };
@@ -1,266 +0,0 @@
1
- import { useState as _, useEffect as f, useCallback as d, useMemo as $ } from "react";
2
- import { useNetwork as k, useModuleDictionary as y, useEnvironment as h, usePaginate as O } from "@m4l/core";
3
- import { styled as g } from "@mui/material/styles";
4
- import { D as R, g as I } from "../DataGrid/index.2caf6231.js";
5
- import { D as L } from "../formatters/DateFormatter/index.08d8823b.js";
6
- import { Tooltip as G, IconButton as M } from "@mui/material";
7
- import { R as S } from "../../react-json-view.f56a7f8e.js";
8
- import { jsx as t, jsxs as A } from "react/jsx-runtime";
9
- import { u as T } from "../../hooks/useModal/index.3b1ff084.js";
10
- import { I as u } from "../Icon/index.f569765b.js";
11
- import { D as E, g as K } from "../DynamicFilter/index.f2377369.js";
12
- const q = g("div")(() => ({
13
- height: "100%",
14
- width: "100%",
15
- display: "flex",
16
- flexDirection: "column",
17
- justifyContent: "flex-start"
18
- })), J = g("div")(({
19
- theme: o
20
- }) => ({
21
- position: "relative",
22
- height: "auto",
23
- display: "flex",
24
- flexDirection: "row",
25
- justifyContent: "flex-start",
26
- alignItems: "center",
27
- "& .MuiFormControl-root": {
28
- flexGrow: 1
29
- },
30
- [o.breakpoints.up("sm")]: {
31
- "& .MuiFormControl-root:nth-of-type(1)": {
32
- marginRight: o.spacing(3)
33
- }
34
- }
35
- })), N = g("div")(() => ({
36
- position: "relative",
37
- flexGrow: "1",
38
- width: "100%"
39
- })), Q = g("div")(({ theme: o }) => ({
40
- color: o.palette.text.primary,
41
- display: "flex",
42
- flexDirection: "column",
43
- height: "100%",
44
- width: "100%"
45
- }));
46
- g("span")(({ theme: o }) => ({
47
- color: o.palette.text.primary,
48
- display: "flex",
49
- flexDirection: "column",
50
- height: "100%",
51
- width: "100%"
52
- }));
53
- function U(o) {
54
- const {
55
- log_id: c
56
- } = o, {
57
- networkOperation: n
58
- } = k(), [e, r] = _({});
59
- return f(() => {
60
- let s = !0;
61
- return n({
62
- method: "GET",
63
- endPoint: `logs/${c}`
64
- }).then((a) => {
65
- if (s) {
66
- const l = JSON.parse(String(a.data.log_detail));
67
- r(l);
68
- }
69
- }), function() {
70
- s = !1;
71
- };
72
- }, []), /* @__PURE__ */ t(Q, {
73
- id: "objectLogsDetail",
74
- children: /* @__PURE__ */ t(S, {
75
- name: null,
76
- sortKeys: !0,
77
- displayDataTypes: !1,
78
- quotesOnKeys: !1,
79
- src: e
80
- })
81
- });
82
- }
83
- function W(o) {
84
- const {
85
- log_id: c
86
- } = o, {
87
- openModal: n,
88
- closeModal: e
89
- } = T(), {
90
- getLabel: r
91
- } = y(), {
92
- host_static_assets: s,
93
- environment_assets: a
94
- } = h(), l = () => {
95
- n({
96
- onQueryClose: () => e(),
97
- title: r("object_logs.modal_detail_title"),
98
- iconComponent: /* @__PURE__ */ t(u, {
99
- src: `${s}/${a}/frontend/components/object_logs/assets/icons/search.svg`
100
- }),
101
- contentComponent: /* @__PURE__ */ t(U, {
102
- log_id: c
103
- })
104
- });
105
- };
106
- return /* @__PURE__ */ t(G, {
107
- title: r("object_logs.view_log_detail"),
108
- children: /* @__PURE__ */ t(M, {
109
- onClick: l,
110
- "aria-label": "filter",
111
- children: /* @__PURE__ */ t(u, {
112
- src: `${s}/${a}/frontend/components/object_logs/assets/icons/search.svg`
113
- })
114
- })
115
- });
116
- }
117
- function ie(o) {
118
- const {
119
- resource_id: c,
120
- object_id: n
121
- } = o, {
122
- getLabel: e
123
- } = y(), {
124
- host_static_assets: r,
125
- environment_assets: s
126
- } = h(), [a, l] = _({
127
- resource_id: c,
128
- object_id: n
129
- }), b = d((i) => /* @__PURE__ */ t(L, {
130
- presentationType: "datetime",
131
- value: i.row.created_at
132
- }), []), w = d((i) => /* @__PURE__ */ t(W, {
133
- log_id: i.row.id
134
- }), []), j = $(() => [{
135
- key: "created_at",
136
- name: e("object_logs.created_at"),
137
- type: "date",
138
- width: 300,
139
- formatter: b
140
- }, {
141
- key: "email",
142
- name: e("object_logs.email"),
143
- type: "string",
144
- width: 300
145
- }, {
146
- key: "resource_name",
147
- name: e("object_logs.resource_name"),
148
- type: "string"
149
- }, {
150
- key: "log_preview",
151
- name: e("object_logs.log_preview"),
152
- type: "string"
153
- }, {
154
- key: "Detail",
155
- name: e("object_logs.log_detail"),
156
- type: "custom",
157
- formatter: w
158
- }, {
159
- key: "ip",
160
- name: e("object_logs.ip"),
161
- type: "string"
162
- }], [e]), {
163
- pagerState: p,
164
- rows: m,
165
- onPageChange: D,
166
- onRowsPerPageChange: v,
167
- clearRows: C,
168
- Refresh: x
169
- } = O({
170
- endPoint: "logs",
171
- fireOnChangeParms: !1,
172
- queryParams: a
173
- });
174
- return f(() => {
175
- C(), l((i) => ({
176
- ...i,
177
- object_id: n
178
- }));
179
- }, [n]), /* @__PURE__ */ A(q, {
180
- children: [/* @__PURE__ */ t(J, {
181
- id: "objectLogsActions",
182
- children: /* @__PURE__ */ t(E, {
183
- withAllField: !0,
184
- onChangeFilter: (i, P) => {
185
- l((F) => ({
186
- ...F,
187
- f: P
188
- })), x();
189
- },
190
- automatic: !1,
191
- fields: [{
192
- name: "user_logs.created_at",
193
- label: e("object_logs.created_at"),
194
- type: "datetime",
195
- multiple: !1,
196
- presence: "fixed",
197
- urlIcon: `${r}/${s}/frontend/components/object_logs/assets/icons/email.svg`
198
- }, {
199
- name: "users.email",
200
- label: e("object_logs.email"),
201
- type: "string",
202
- multiple: !0,
203
- presence: "optional",
204
- urlIcon: `${r}/${s}/frontend/components/object_logs/assets/icons/email.svg`
205
- }, {
206
- name: "user_logs.log_preview",
207
- label: e("object_logs.log_preview"),
208
- type: "string",
209
- multiple: !0,
210
- presence: "optional",
211
- urlIcon: `${r}/${s}/frontend/components/object_logs/assets/icons/log_preview.svg`
212
- }, {
213
- name: "user_logs.log_detail",
214
- label: e("object_logs.log_detail"),
215
- type: "string",
216
- multiple: !0,
217
- presence: "optional",
218
- urlIcon: `${r}/${s}/frontend/components/object_logs/assets/icons/log_detail.svg`
219
- }],
220
- initialFilters: []
221
- })
222
- }), /* @__PURE__ */ t(N, {
223
- id: "GridWrapper",
224
- children: /* @__PURE__ */ t(R, {
225
- id: "users_logs_list",
226
- columns: j,
227
- rows: m,
228
- rowKeyGetter: (i) => i.id,
229
- isMultipleSelect: !1,
230
- withActions: !0,
231
- actionsProps: {
232
- withPager: !0,
233
- withLocalFilters: !0,
234
- pagerOptions: {
235
- records: m.length,
236
- totalRecords: p.totalRecords,
237
- rowsPerPageOptions: [1, 2, 3, 4, 5, 10, 25],
238
- page: p.page,
239
- rowsPerPage: p.rowsPerPage,
240
- onPageChange: D,
241
- onRowsPerPageChange: v
242
- }
243
- }
244
- }, "users_list_logs")
245
- })]
246
- });
247
- }
248
- function ne() {
249
- return ["object_logs"].concat(I()).concat(K());
250
- }
251
- const ae = {
252
- object_logs: {
253
- created_at: "Start date",
254
- user: "User/email",
255
- resource_name: "Resource",
256
- privilege_name: "Privilege",
257
- log_preview: "Log",
258
- log_detail: "Detail",
259
- ip: "Ip"
260
- }
261
- };
262
- export {
263
- ie as O,
264
- ae as d,
265
- ne as g
266
- };