@m4l/components 0.1.13 → 0.1.15

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 (139) hide show
  1. package/assets/Logo/index.js +91 -0
  2. package/commonjs.js +9 -0
  3. package/components/CommonActions/components/ActionCancel/index.js +15 -0
  4. package/components/CommonActions/components/ActionFormCancel/index.js +62 -0
  5. package/components/CommonActions/components/ActionFormIntro/index.js +35 -0
  6. package/components/CommonActions/components/ActionIntro/index.js +16 -0
  7. package/components/CommonActions/components/Actions/index.js +859 -0
  8. package/components/CompanyLogo/{index.f81c179c.js → index.js} +48 -42
  9. package/components/DataGrid/index.js +1067 -0
  10. package/components/DynamicFilter/index.js +1573 -0
  11. package/components/ErrorLabel/index.js +18 -0
  12. package/components/Icon/index.js +80 -0
  13. package/components/Image/index.js +128 -0
  14. package/components/LanguagePopover/index.js +93 -0
  15. package/components/Loadable/index.js +13 -0
  16. package/components/ModalDialog/index.js +180 -0
  17. package/components/NoItemSelected/{index.12f0ca67.js → index.js} +50 -43
  18. package/components/ObjectLogs/index.js +284 -0
  19. package/components/Page/index.js +36 -0
  20. package/components/PaperForm/index.js +110 -0
  21. package/components/Period/index.js +230 -0
  22. package/components/PropertyValue/index.js +142 -0
  23. package/components/Resizeable/{index.45995d2b.js → index.js} +19 -21
  24. package/components/ScrollBar/index.js +52 -0
  25. package/components/ScrollToTop/index.js +10 -0
  26. package/components/SplitLayout/{index.4032673d.js → index.js} +35 -35
  27. package/components/animate/LoadingScreen/{index.f1cec7db.js → index.js} +27 -29
  28. package/components/animate/MotionContainer/index.js +31 -0
  29. package/components/animate/MotionLazyContainer/index.js +13 -0
  30. package/components/animate/features.js +2 -0
  31. package/components/animate/variants/{bounce.784aaaaa.js → bounce.js} +16 -15
  32. package/components/animate/variants/container.js +20 -0
  33. package/components/animate/variants/fade.js +61 -0
  34. package/components/animate/variants/{index.7a912140.js → index.js} +0 -0
  35. package/components/animate/variants/transition.js +16 -0
  36. package/components/formatters/BooleanFormatter/index.js +52 -0
  37. package/components/formatters/DateFormatter/index.js +66 -0
  38. package/components/formatters/index.js +112 -0
  39. package/components/hook-form/FormProvider/index.js +61 -0
  40. package/components/hook-form/RHFAutocomplete/index.js +144 -0
  41. package/components/hook-form/RHFAutocompleteAsync/index.js +191 -0
  42. package/components/hook-form/RHFCheckbox/index.js +65 -0
  43. package/components/hook-form/RHFDateTime/index.js +79 -0
  44. package/components/hook-form/RHFMultiCheckbox/index.js +32 -0
  45. package/components/hook-form/RHFPeriod/index.js +47 -0
  46. package/components/hook-form/RHFRadioGroup/index.js +41 -0
  47. package/components/hook-form/RHFSelect/index.js +34 -0
  48. package/components/hook-form/RHFTextField/index.js +87 -0
  49. package/components/hook-form/RHFUpload/index.js +255 -0
  50. package/components/mui_extended/Accordion/index.js +105 -0
  51. package/components/mui_extended/Avatar/index.js +33 -0
  52. package/components/mui_extended/BoxIcon/index.js +20 -0
  53. package/components/mui_extended/Breadcrumbs/index.js +92 -0
  54. package/components/mui_extended/Button/index.js +131 -0
  55. package/components/mui_extended/IconButton/index.js +108 -0
  56. package/components/mui_extended/LinkWithRoute/index.js +30 -0
  57. package/components/mui_extended/MenuPopover/index.js +135 -0
  58. package/components/mui_extended/Pager/index.js +137 -0
  59. package/components/mui_extended/Tab/index.js +30 -0
  60. package/components/mui_extended/Typography/index.js +21 -0
  61. package/contexts/ModalContext/index.js +165 -0
  62. package/hooks/useFormAddEdit/index.js +42 -0
  63. package/hooks/useModal/index.js +4 -0
  64. package/index.js +70 -162
  65. package/lodash.js +62 -0
  66. package/node_modules.js +54 -0
  67. package/package.json +2 -1
  68. package/react-data-grid.js +2652 -0
  69. package/react-draggable.js +960 -0
  70. package/react-json-view.js +2764 -0
  71. package/react-lazy-load-image-component.js +792 -0
  72. package/react-resizable.js +541 -0
  73. package/react-splitter-layout.js +165 -0
  74. package/utils/index.js +572 -0
  75. package/assets/Logo/index.228dcb5a.js +0 -86
  76. package/commonjs.565e6834.js +0 -12
  77. package/components/CommonActions/components/ActionCancel/index.cba1b460.js +0 -17
  78. package/components/CommonActions/components/ActionFormCancel/index.be2fe891.js +0 -49
  79. package/components/CommonActions/components/ActionFormIntro/index.ca4d2674.js +0 -31
  80. package/components/CommonActions/components/ActionIntro/index.cc4b1e0e.js +0 -18
  81. package/components/CommonActions/components/Actions/index.e8148d98.js +0 -743
  82. package/components/DataGrid/index.b688877d.js +0 -894
  83. package/components/DynamicFilter/index.82ce857e.js +0 -1158
  84. package/components/ErrorLabel/index.c8615f16.js +0 -19
  85. package/components/Icon/index.cbca79b0.js +0 -70
  86. package/components/Image/index.e790b50b.js +0 -122
  87. package/components/LanguagePopover/index.3d9611cb.js +0 -87
  88. package/components/Loadable/index.f5518558.js +0 -15
  89. package/components/ModalDialog/index.3850c053.js +0 -168
  90. package/components/ObjectLogs/index.27ef875d.js +0 -266
  91. package/components/Page/index.6d69977e.js +0 -35
  92. package/components/PaperForm/index.d7c74064.js +0 -105
  93. package/components/Period/index.5e68286a.js +0 -160
  94. package/components/PropertyValue/index.ab3dd7e9.js +0 -116
  95. package/components/ScrollBar/index.39eeb2de.js +0 -49
  96. package/components/ScrollToTop/index.e06f98f6.js +0 -11
  97. package/components/animate/MotionContainer/index.8d9f9d80.js +0 -30
  98. package/components/animate/MotionLazyContainer/index.572dd012.js +0 -15
  99. package/components/animate/features.0fbf41e1.js +0 -5
  100. package/components/animate/variants/container.11f82b76.js +0 -20
  101. package/components/animate/variants/fade.b561c0fc.js +0 -59
  102. package/components/animate/variants/transition.bd46b9ce.js +0 -15
  103. package/components/formatters/BooleanFormatter/index.cca53b7f.js +0 -42
  104. package/components/formatters/DateFormatter/index.ad8d9b8e.js +0 -57
  105. package/components/formatters/index.55856d65.js +0 -106
  106. package/components/hook-form/FormProvider/index.257acd9f.js +0 -55
  107. package/components/hook-form/RHFAutocomplete/index.6ed76d4c.js +0 -122
  108. package/components/hook-form/RHFAutocompleteAsync/index.8f2c97ea.js +0 -153
  109. package/components/hook-form/RHFCheckbox/index.f9ce6c39.js +0 -59
  110. package/components/hook-form/RHFDateTime/index.fc5cbafe.js +0 -68
  111. package/components/hook-form/RHFMultiCheckbox/index.2680b3b6.js +0 -34
  112. package/components/hook-form/RHFPeriod/index.23c254e9.js +0 -45
  113. package/components/hook-form/RHFRadioGroup/index.b3335e13.js +0 -43
  114. package/components/hook-form/RHFSelect/index.b6ca8bb2.js +0 -36
  115. package/components/hook-form/RHFTextField/index.4c455f75.js +0 -77
  116. package/components/hook-form/RHFUpload/index.ed3d739f.js +0 -244
  117. package/components/mui_extended/Accordion/index.2116e423.js +0 -103
  118. package/components/mui_extended/Avatar/index.0a2a4523.js +0 -32
  119. package/components/mui_extended/BoxIcon/index.e638ecc8.js +0 -22
  120. package/components/mui_extended/Breadcrumbs/index.5e37d903.js +0 -89
  121. package/components/mui_extended/Button/index.84d8898c.js +0 -110
  122. package/components/mui_extended/IconButton/index.88f3aadb.js +0 -98
  123. package/components/mui_extended/LinkWithRoute/index.d4b263de.js +0 -28
  124. package/components/mui_extended/MenuPopover/index.488fc536.js +0 -131
  125. package/components/mui_extended/Pager/index.0576814f.js +0 -126
  126. package/components/mui_extended/Tab/index.e0653a0a.js +0 -28
  127. package/components/mui_extended/Typography/index.0c4604b3.js +0 -22
  128. package/contexts/ModalContext/index.2188b69e.js +0 -150
  129. package/hooks/useFormAddEdit/index.d4845f1a.js +0 -26
  130. package/hooks/useModal/index.6571d2d9.js +0 -6
  131. package/lodash.e09401f0.js +0 -32
  132. package/node_modules.168cb897.js +0 -55
  133. package/react-data-grid.d46d625e.js +0 -2115
  134. package/react-draggable.20e95c61.js +0 -714
  135. package/react-json-view.f56a7f8e.js +0 -2762
  136. package/react-lazy-load-image-component.45b56650.js +0 -784
  137. package/react-resizable.5277deaf.js +0 -371
  138. package/react-splitter-layout.7810ac1b.js +0 -165
  139. package/utils/index.214d9542.js +0 -435
@@ -1,49 +0,0 @@
1
- import t from "simplebar-react";
2
- import { styled as i, alpha as a } from "@mui/material/styles";
3
- import { Box as l } from "@mui/material";
4
- import { jsx as r } from "react/jsx-runtime";
5
- const s = i("div")(() => ({
6
- flexGrow: 1,
7
- height: "100%",
8
- overflow: "hidden"
9
- })), n = i(t)(({
10
- theme: e
11
- }) => ({
12
- maxHeight: "100%",
13
- "& .simplebar-scrollbar": {
14
- "&:before": {
15
- backgroundColor: a(e.palette.grey[600], 0.48)
16
- },
17
- "&.simplebar-visible:before": {
18
- opacity: 1
19
- }
20
- },
21
- "& .simplebar-track.simplebar-vertical": {
22
- width: 10
23
- },
24
- "& .simplebar-track.simplebar-horizontal .simplebar-scrollbar": {
25
- height: 6
26
- },
27
- "& .simplebar-mask": {
28
- zIndex: "inherit"
29
- }
30
- }));
31
- function f({
32
- children: e
33
- }) {
34
- const o = typeof navigator > "u" ? "SSR" : navigator.userAgent;
35
- return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(o) ? /* @__PURE__ */ r(l, {
36
- sx: {
37
- overflowX: "auto"
38
- },
39
- children: e
40
- }) : /* @__PURE__ */ r(s, {
41
- children: /* @__PURE__ */ r(n, {
42
- autoHide: !1,
43
- children: e
44
- })
45
- });
46
- }
47
- export {
48
- f as S
49
- };
@@ -1,11 +0,0 @@
1
- import { useEffect as r } from "react";
2
- import { useLocation as t } from "react-router-dom";
3
- function e() {
4
- const { pathname: o } = t();
5
- return r(() => {
6
- window.scrollTo(0, 0);
7
- }, [o]), null;
8
- }
9
- export {
10
- e as S
11
- };
@@ -1,30 +0,0 @@
1
- import { m as a } from "framer-motion";
2
- import { Box as n } from "@mui/material";
3
- import { v as o } from "../variants/container.11f82b76.js";
4
- import { jsx as r } from "react/jsx-runtime";
5
- function x({
6
- animate: m,
7
- action: e = !1,
8
- children: i,
9
- ...t
10
- }) {
11
- return e ? /* @__PURE__ */ r(n, {
12
- component: a.div,
13
- initial: !1,
14
- animate: m ? "animate" : "exit",
15
- variants: o(),
16
- ...t,
17
- children: i
18
- }) : /* @__PURE__ */ r(n, {
19
- component: a.div,
20
- initial: "initial",
21
- animate: "animate",
22
- exit: "exit",
23
- variants: o(),
24
- ...t,
25
- children: i
26
- });
27
- }
28
- export {
29
- x as M
30
- };
@@ -1,15 +0,0 @@
1
- import { LazyMotion as o } from "framer-motion";
2
- import { jsx as r } from "react/jsx-runtime";
3
- const e = () => import("../features.0fbf41e1.js").then((t) => t.default);
4
- function i({
5
- children: t
6
- }) {
7
- return /* @__PURE__ */ r(o, {
8
- strict: !0,
9
- features: e,
10
- children: t
11
- });
12
- }
13
- export {
14
- i as M
15
- };
@@ -1,5 +0,0 @@
1
- import "framer-motion";
2
- import { domMax as d } from "framer-motion";
3
- export {
4
- d as default
5
- };
@@ -1,20 +0,0 @@
1
- const r = (t) => {
2
- const n = t?.staggerIn || 0.05, e = t?.staggerIn || 0.05, a = t?.staggerIn || 0.05;
3
- return {
4
- animate: {
5
- transition: {
6
- staggerChildren: n,
7
- delayChildren: e
8
- }
9
- },
10
- exit: {
11
- transition: {
12
- staggerChildren: a,
13
- staggerDirection: -1
14
- }
15
- }
16
- };
17
- };
18
- export {
19
- r as v
20
- };
@@ -1,59 +0,0 @@
1
- import { v as t, a } from "./transition.bd46b9ce.js";
2
- const s = (e) => {
3
- const i = e?.distance || 120, n = e?.durationIn, o = e?.durationOut, y = e?.easeIn, c = e?.easeOut;
4
- return {
5
- in: {
6
- initial: { opacity: 0 },
7
- animate: { opacity: 1, transition: t },
8
- exit: { opacity: 0, transition: a }
9
- },
10
- inUp: {
11
- initial: { y: i, opacity: 0 },
12
- animate: { y: 0, opacity: 1, transition: t({ durationIn: n, easeIn: y }) },
13
- exit: { y: i, opacity: 0, transition: a({ durationOut: o, easeOut: c }) }
14
- },
15
- inDown: {
16
- initial: { y: -i, opacity: 0 },
17
- animate: { y: 0, opacity: 1, transition: t({ durationIn: n, easeIn: y }) },
18
- exit: { y: -i, opacity: 0, transition: a({ durationOut: o, easeOut: c }) }
19
- },
20
- inLeft: {
21
- initial: { x: -i, opacity: 0 },
22
- animate: { x: 0, opacity: 1, transition: t({ durationIn: n, easeIn: y }) },
23
- exit: { x: -i, opacity: 0, transition: a({ durationOut: o, easeOut: c }) }
24
- },
25
- inRight: {
26
- initial: { x: i, opacity: 0 },
27
- animate: { x: 0, opacity: 1, transition: t({ durationIn: n, easeIn: y }) },
28
- exit: { x: i, opacity: 0, transition: a({ durationOut: o, easeOut: c }) }
29
- },
30
- out: {
31
- initial: { opacity: 1 },
32
- animate: { opacity: 0, transition: t({ durationIn: n, easeIn: y }) },
33
- exit: { opacity: 1, transition: a({ durationOut: o, easeOut: c }) }
34
- },
35
- outUp: {
36
- initial: { y: 0, opacity: 1 },
37
- animate: { y: -i, opacity: 0, transition: t({ durationIn: n, easeIn: y }) },
38
- exit: { y: 0, opacity: 1, transition: a({ durationOut: o, easeOut: c }) }
39
- },
40
- outDown: {
41
- initial: { y: 0, opacity: 1 },
42
- animate: { y: i, opacity: 0, transition: t({ durationIn: n, easeIn: y }) },
43
- exit: { y: 0, opacity: 1, transition: a({ durationOut: o, easeOut: c }) }
44
- },
45
- outLeft: {
46
- initial: { x: 0, opacity: 1 },
47
- animate: { x: -i, opacity: 0, transition: t({ durationIn: n, easeIn: y }) },
48
- exit: { x: 0, opacity: 1, transition: a({ durationOut: o, easeOut: c }) }
49
- },
50
- outRight: {
51
- initial: { x: 0, opacity: 1 },
52
- animate: { x: i, opacity: 0, transition: t({ durationIn: n, easeIn: y }) },
53
- exit: { x: 0, opacity: 1, transition: a({ durationOut: o, easeOut: c }) }
54
- }
55
- };
56
- };
57
- export {
58
- s as v
59
- };
@@ -1,15 +0,0 @@
1
- const e = (n) => {
2
- const t = n?.duration || 0.32, a = n?.ease || [0.43, 0.13, 0.23, 0.96];
3
- return { duration: t, ease: a };
4
- }, r = (n) => {
5
- const t = n?.durationIn || 0.64, a = n?.easeIn || [0.43, 0.13, 0.23, 0.96];
6
- return { duration: t, ease: a };
7
- }, s = (n) => {
8
- const t = n?.durationOut || 0.48, a = n?.easeOut || [0.43, 0.13, 0.23, 0.96];
9
- return { duration: t, ease: a };
10
- };
11
- export {
12
- s as a,
13
- e as b,
14
- r as v
15
- };
@@ -1,42 +0,0 @@
1
- import { useModuleDictionary as u, useEnvironment as _, getPropertyByString as p } from "@m4l/core";
2
- import l from "react";
3
- import { I as d } from "../../Icon/index.cbca79b0.js";
4
- import { jsx as t } from "react/jsx-runtime";
5
- function g(r) {
6
- const {
7
- presentationType: n,
8
- value: s,
9
- Component: o = l.Fragment
10
- } = r, {
11
- getLabel: e
12
- } = u(), {
13
- host_static_assets: c,
14
- environment_assets: i
15
- } = _(), a = s ?? !1, m = `${c}/${i}/frontend/components/data_grid/components/boolean_formatter/assets/icons/check_true.svg`, f = `${c}/${i}/frontend/components/data_grid/components/boolean_formatter/assets/icons/check_false.svg`;
16
- return n === "string_yes_no" ? /* @__PURE__ */ t(o, {
17
- children: e(a ? "formatters.boolean_yes" : "formatters.boolean_no")
18
- }) : n === "string_true_false" ? /* @__PURE__ */ t(o, {
19
- children: e(a ? "formatters.boolean_true" : "formatters.boolean_false")
20
- }) : /* @__PURE__ */ t(o, {
21
- children: /* @__PURE__ */ t(d, {
22
- src: a ? m : f,
23
- bgColor: "action.disabled"
24
- })
25
- });
26
- }
27
- function C(r) {
28
- const {
29
- fieldValue: n,
30
- presentationType: s,
31
- Component: o = l.Fragment
32
- } = r;
33
- return (e) => /* @__PURE__ */ t(g, {
34
- presentationType: s,
35
- value: p(e, n),
36
- Component: o
37
- });
38
- }
39
- export {
40
- g as B,
41
- C as c
42
- };
@@ -1,57 +0,0 @@
1
- import c from "react";
2
- import { useEnvironment as p, useHostTools as u, getPropertyByString as d } from "@m4l/core";
3
- import "../../Icon/index.cbca79b0.js";
4
- import "@mui/material/styles";
5
- import { jsx as f, Fragment as y } from "react/jsx-runtime";
6
- function g(a) {
7
- const {
8
- presentationType: n,
9
- value: t,
10
- format: e,
11
- Component: m = c.Fragment
12
- } = a, {
13
- dfnsFormat: r
14
- } = p(), {
15
- formatDate: l
16
- } = u();
17
- let o = e || r.datetime_format, i, s;
18
- if (t == null)
19
- return /* @__PURE__ */ f(y, {
20
- children: "-"
21
- });
22
- switch (n) {
23
- case "datetime":
24
- o = e || r.datetime_format;
25
- break;
26
- case "date":
27
- o = e || r.date_format;
28
- break;
29
- case "time":
30
- o = e || r.time_format;
31
- break;
32
- }
33
- try {
34
- typeof t == "number" || typeof t == "string" ? s = new Date(t) : s = t, i = l(s, o);
35
- } catch {
36
- i = "err_typing";
37
- }
38
- return /* @__PURE__ */ f(m, {
39
- children: i
40
- });
41
- }
42
- function k(a) {
43
- const {
44
- fieldValue: n,
45
- presentationType: t,
46
- Component: e = c.Fragment
47
- } = a;
48
- return (m) => /* @__PURE__ */ f(g, {
49
- presentationType: t,
50
- value: d(m, n),
51
- Component: e
52
- });
53
- }
54
- export {
55
- g as D,
56
- k as c
57
- };
@@ -1,106 +0,0 @@
1
- import l from "react";
2
- import { jsx as m, Fragment as u } from "react/jsx-runtime";
3
- import { getPropertyByString as i } from "@m4l/core";
4
- import "../Icon/index.cbca79b0.js";
5
- import "@mui/material/styles";
6
- function _(e) {
7
- const {
8
- value: n,
9
- unit: t,
10
- symbol: c,
11
- Component: o = l.Fragment
12
- } = e;
13
- if (n == null || !Array.isArray(n))
14
- return /* @__PURE__ */ m(u, {
15
- children: ""
16
- });
17
- let r = "";
18
- return n.map((a, s) => {
19
- const f = a.cmc_min_closed != !0 ? "<" : "\u2264", d = a.cmc_max_closed != !0 ? "<" : "\u2264";
20
- r = r.concat(`${s > 0 ? " " : ""}`, a.cmc_min !== a.cmc_max ? `[${a.cmc_min}${t} ${f} ${c} ${d} ${a.cmc_max}${t} \xB1 ${a.cmc_uncertainty}]` : `[${a.cmc_min}${t} \xB1 ${a.cmc_uncertainty}]`);
21
- }), /* @__PURE__ */ m(o, {
22
- children: r
23
- });
24
- }
25
- function y(e) {
26
- const {
27
- value: n,
28
- unit: t,
29
- Component: c = l.Fragment
30
- } = e;
31
- if (console.log("points", n), n == null || !Array.isArray(n))
32
- return /* @__PURE__ */ m(u, {
33
- children: "[]"
34
- });
35
- let o = "";
36
- return n.map((r) => {
37
- r && (console.log("point", r), o = o.concat(`[${r}${t}]`));
38
- }), /* @__PURE__ */ m(c, {
39
- children: o
40
- });
41
- }
42
- function C(e) {
43
- const {
44
- value: n,
45
- Component: t = l.Fragment
46
- } = e;
47
- return /* @__PURE__ */ m(t, {
48
- children: `${n}$Cop`
49
- });
50
- }
51
- function v() {
52
- return ["formatters"];
53
- }
54
- const h = {
55
- pager: {
56
- boolean_yes: "Yes",
57
- boolean_no: "No",
58
- boolean_true: "True",
59
- boolean_false: "False"
60
- }
61
- };
62
- function U(e) {
63
- const {
64
- fieldUnit: n,
65
- fieldValue: t,
66
- fieldSymbol: c,
67
- Component: o
68
- } = e;
69
- return (r) => /* @__PURE__ */ m(_, {
70
- Component: o,
71
- value: i(r, t),
72
- unit: i(r, n),
73
- symbol: i(r, c)
74
- });
75
- }
76
- function A(e) {
77
- const {
78
- fieldUnit: n,
79
- fieldValue: t,
80
- Component: c
81
- } = e;
82
- return (o) => /* @__PURE__ */ m(y, {
83
- Component: c,
84
- value: i(o, t),
85
- unit: i(o, n)
86
- });
87
- }
88
- function V(e) {
89
- const {
90
- fieldValue: n,
91
- Component: t = l.Fragment
92
- } = e;
93
- return (c) => /* @__PURE__ */ m(t, {
94
- children: i(c, n) + ""
95
- });
96
- }
97
- export {
98
- y as P,
99
- _ as U,
100
- C as a,
101
- A as b,
102
- U as c,
103
- h as d,
104
- V as e,
105
- v as g
106
- };
@@ -1,55 +0,0 @@
1
- import { useEffect as l } from "react";
2
- import { useForm as f, FormProvider as m } from "react-hook-form";
3
- import { o as c } from "../../../node_modules.168cb897.js";
4
- import { styled as n } from "@mui/material/styles";
5
- import { jsx as d } from "react/jsx-runtime";
6
- const p = n("form")(({
7
- theme: e
8
- }) => ({
9
- display: "flex",
10
- paddingTop: e.spacing(1),
11
- marginBottom: e.spacing(1),
12
- flexDirection: "column",
13
- width: "100%",
14
- overflow: "scroll"
15
- }));
16
- function V(e) {
17
- const {
18
- children: i,
19
- onSubmit: t,
20
- values: s,
21
- validationSchema: u,
22
- statusLoad: o = "ready"
23
- } = e, r = f({
24
- resolver: c(u),
25
- defaultValues: s
26
- });
27
- return l(() => {
28
- if (console.log("useEffect FormProvider reload_values_provider===", o), o === "reload_values_provider") {
29
- Object.keys(s).forEach((a) => {
30
- r.setValue(a, s[a], {
31
- shouldValidate: !1,
32
- shouldDirty: !1,
33
- shouldTouch: !1
34
- });
35
- });
36
- return;
37
- }
38
- }, [r, o, s]), l(() => {
39
- o === "ready" && (console.log("useEffect FormProvider Ready", o), r.setValue("statusLoad", "ready", {
40
- shouldValidate: !1,
41
- shouldDirty: !1,
42
- shouldTouch: !1
43
- }));
44
- }, [o]), /* @__PURE__ */ d(m, {
45
- ...r,
46
- children: /* @__PURE__ */ d(p, {
47
- id: "formProvider",
48
- onSubmit: r.handleSubmit(t),
49
- children: i
50
- })
51
- });
52
- }
53
- export {
54
- V as F
55
- };
@@ -1,122 +0,0 @@
1
- import { useModuleDictionary as S, useModuleSkeleton as L } from "@m4l/core";
2
- import { useFormContext as V, Controller as _ } from "react-hook-form";
3
- import { Skeleton as s, Autocomplete as $, TextField as I } from "@mui/material";
4
- import { styled as l } from "@mui/material/styles";
5
- import { jsx as o, jsxs as R } from "react/jsx-runtime";
6
- const j = l("div")(() => ({
7
- display: "flex",
8
- width: "100%",
9
- flexDirection: "column"
10
- }));
11
- l("div")(({
12
- theme: t
13
- }) => ({
14
- display: "flex",
15
- justifyContent: "flex-end",
16
- paddingRight: `${t.spacing(2)}`,
17
- [t.breakpoints.down("md")]: {
18
- justifyContent: "flex-start"
19
- }
20
- }));
21
- const A = l("div")(({
22
- theme: t
23
- }) => ({
24
- width: "100%",
25
- display: "grid",
26
- gridTemplateColumns: "1fr auto",
27
- gridGap: t.spacing(2),
28
- alignItems: "center",
29
- height: `${t.spacing(4.5)}`,
30
- border: `1px solid ${t.palette.divider}`,
31
- borderRadius: `${t.spacing(1)}`,
32
- padding: `0 ${t.spacing(2)}`,
33
- [t.breakpoints.down("md")]: {
34
- width: "100%"
35
- }
36
- }));
37
- l("div")(() => ({
38
- display: "flex",
39
- width: "100%",
40
- "& .MuiAutocomplete-root": {
41
- width: "100%"
42
- }
43
- }));
44
- function D(t) {
45
- const {
46
- name: r,
47
- getOptionLabel: d,
48
- isOptionEqualToValue: u,
49
- label: p,
50
- skeletonProps: c = {},
51
- options: f,
52
- disabled: g,
53
- ...x
54
- } = t, {
55
- width: m = 100,
56
- height: h = "18px"
57
- } = c, {
58
- getLabel: b
59
- } = S(), T = L(), {
60
- control: v,
61
- getValues: w
62
- } = V(), y = w(r), k = (e) => e == null ? "" : d(e), C = (e, i) => i == null || e === null ? !1 : u(e, i);
63
- return T ? /* @__PURE__ */ o(j, {
64
- children: /* @__PURE__ */ R(A, {
65
- children: [/* @__PURE__ */ o(s, {
66
- variant: "text",
67
- width: m,
68
- height: h
69
- }, "sk1"), /* @__PURE__ */ o(s, {
70
- variant: "circular",
71
- width: 16,
72
- height: 16
73
- }, "sk2")]
74
- })
75
- }) : /* @__PURE__ */ o(_, {
76
- name: r,
77
- control: v,
78
- render: ({
79
- field: {
80
- onChange: e,
81
- value: i
82
- },
83
- fieldState: {
84
- error: a
85
- }
86
- }) => /* @__PURE__ */ o(
87
- $,
88
- {
89
- options: f,
90
- getOptionLabel: k,
91
- defaultValue: y,
92
- isOptionEqualToValue: C,
93
- disableClearable: !0,
94
- value: i || null,
95
- onChange: (n, O) => {
96
- e(O);
97
- },
98
- loadingText: "",
99
- disabled: g,
100
- noOptionsText: b("rhf_autocomplete.component_no_options"),
101
- renderInput: (n) => /* @__PURE__ */ o(I, {
102
- ...n,
103
- label: p,
104
- fullWidth: !0,
105
- SelectProps: {
106
- native: !0
107
- },
108
- InputProps: {
109
- ...n.InputProps
110
- },
111
- autoComplete: "off",
112
- error: !!a,
113
- helperText: a?.message,
114
- ...x
115
- }, `tx_async_${n.id}`)
116
- }
117
- )
118
- });
119
- }
120
- export {
121
- D as R
122
- };