@m4l/components 0.1.12 → 0.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/Logo/index.228dcb5a.js +86 -0
- package/commonjs.565e6834.js +12 -0
- package/components/CommonActions/components/ActionCancel/index.cba1b460.js +17 -0
- package/components/CommonActions/components/ActionFormCancel/index.be2fe891.js +49 -0
- package/components/CommonActions/components/ActionFormIntro/index.ca4d2674.js +31 -0
- package/components/CommonActions/components/ActionIntro/index.cc4b1e0e.js +18 -0
- package/components/CommonActions/components/Actions/index.e8148d98.js +743 -0
- package/components/CompanyLogo/{index.js → index.f81c179c.js} +42 -48
- package/components/DataGrid/index.b688877d.js +894 -0
- package/components/DynamicFilter/index.82ce857e.js +1158 -0
- package/components/ErrorLabel/index.c8615f16.js +19 -0
- package/components/Icon/index.cbca79b0.js +70 -0
- package/components/Image/index.e790b50b.js +122 -0
- package/components/LanguagePopover/index.3d9611cb.js +87 -0
- package/components/Loadable/index.f5518558.js +15 -0
- package/components/ModalDialog/index.3850c053.js +168 -0
- package/components/NoItemSelected/{index.js → index.12f0ca67.js} +43 -50
- package/components/ObjectLogs/index.27ef875d.js +266 -0
- package/components/Page/index.6d69977e.js +35 -0
- package/components/Page/index.d.ts +1 -1
- package/components/PaperForm/index.d7c74064.js +105 -0
- package/components/Period/index.5e68286a.js +160 -0
- package/components/PropertyValue/index.ab3dd7e9.js +116 -0
- package/components/Resizeable/{index.js → index.45995d2b.js} +21 -19
- package/components/ScrollBar/index.39eeb2de.js +49 -0
- package/components/ScrollToTop/index.e06f98f6.js +11 -0
- package/components/SplitLayout/{index.js → index.4032673d.js} +35 -35
- package/components/animate/IconButtonAnimate/index.d.ts +1 -1
- package/components/animate/LoadingScreen/{index.js → index.f1cec7db.js} +29 -27
- package/components/animate/MotionContainer/index.8d9f9d80.js +30 -0
- package/components/animate/MotionLazyContainer/index.572dd012.js +15 -0
- package/components/animate/features.0fbf41e1.js +5 -0
- package/components/animate/variants/{bounce.js → bounce.784aaaaa.js} +15 -16
- package/components/animate/variants/container.11f82b76.js +20 -0
- package/components/animate/variants/fade.b561c0fc.js +59 -0
- package/components/animate/variants/{index.js → index.7a912140.js} +0 -0
- package/components/animate/variants/transition.bd46b9ce.js +15 -0
- package/components/formatters/BooleanFormatter/index.cca53b7f.js +42 -0
- package/components/formatters/DateFormatter/index.ad8d9b8e.js +57 -0
- package/components/formatters/index.55856d65.js +106 -0
- package/components/hook-form/FormProvider/index.257acd9f.js +55 -0
- package/components/hook-form/RHFAutocomplete/index.6ed76d4c.js +122 -0
- package/components/hook-form/RHFAutocompleteAsync/index.8f2c97ea.js +153 -0
- package/components/hook-form/RHFCheckbox/index.f9ce6c39.js +59 -0
- package/components/hook-form/RHFDateTime/index.fc5cbafe.js +68 -0
- package/components/hook-form/RHFMultiCheckbox/index.2680b3b6.js +34 -0
- package/components/hook-form/RHFPeriod/index.23c254e9.js +45 -0
- package/components/hook-form/RHFRadioGroup/index.b3335e13.js +43 -0
- package/components/hook-form/RHFSelect/index.b6ca8bb2.js +36 -0
- package/components/hook-form/RHFTextField/index.4c455f75.js +77 -0
- package/components/hook-form/RHFTextField/index.d.ts +1 -1
- package/components/hook-form/RHFUpload/index.ed3d739f.js +244 -0
- package/components/mui_extended/Accordion/index.2116e423.js +103 -0
- package/components/mui_extended/Avatar/index.0a2a4523.js +32 -0
- package/components/mui_extended/Avatar/index.d.ts +1 -1
- package/components/mui_extended/BoxIcon/index.e638ecc8.js +22 -0
- package/components/mui_extended/Breadcrumbs/index.5e37d903.js +89 -0
- package/components/mui_extended/Button/index.84d8898c.js +110 -0
- package/components/mui_extended/IconButton/index.88f3aadb.js +98 -0
- package/components/mui_extended/LinkWithRoute/index.d4b263de.js +28 -0
- package/components/mui_extended/MenuPopover/index.488fc536.js +131 -0
- package/components/mui_extended/Pager/index.0576814f.js +126 -0
- package/components/mui_extended/Tab/index.e0653a0a.js +28 -0
- package/components/mui_extended/Typography/index.0c4604b3.js +22 -0
- package/contexts/ModalContext/index.2188b69e.js +150 -0
- package/hooks/useFormAddEdit/index.d4845f1a.js +26 -0
- package/hooks/useModal/index.6571d2d9.js +6 -0
- package/index.js +162 -70
- package/lodash.e09401f0.js +32 -0
- package/node_modules.168cb897.js +55 -0
- package/package.json +1 -1
- package/react-data-grid.d46d625e.js +2115 -0
- package/react-draggable.20e95c61.js +714 -0
- package/react-json-view.f56a7f8e.js +2762 -0
- package/react-lazy-load-image-component.45b56650.js +784 -0
- package/react-resizable.5277deaf.js +371 -0
- package/react-splitter-layout.7810ac1b.js +165 -0
- package/utils/index.214d9542.js +435 -0
- package/assets/Logo/index.js +0 -91
- package/commonjs.js +0 -9
- package/components/CommonActions/components/ActionCancel/index.js +0 -15
- package/components/CommonActions/components/ActionFormCancel/index.js +0 -62
- package/components/CommonActions/components/ActionFormIntro/index.js +0 -35
- package/components/CommonActions/components/ActionIntro/index.js +0 -16
- package/components/CommonActions/components/Actions/index.js +0 -859
- package/components/DataGrid/index.js +0 -1067
- package/components/DynamicFilter/index.js +0 -1573
- package/components/ErrorLabel/index.js +0 -18
- package/components/Icon/index.js +0 -80
- package/components/Image/index.js +0 -128
- package/components/LanguagePopover/index.js +0 -93
- package/components/Loadable/index.js +0 -13
- package/components/ModalDialog/index.js +0 -180
- package/components/ObjectLogs/index.js +0 -284
- package/components/Page/index.js +0 -36
- package/components/PaperForm/index.js +0 -110
- package/components/Period/index.js +0 -230
- package/components/PropertyValue/index.js +0 -142
- package/components/ScrollBar/index.js +0 -52
- package/components/ScrollToTop/index.js +0 -10
- package/components/animate/MotionContainer/index.js +0 -31
- package/components/animate/MotionLazyContainer/index.js +0 -13
- package/components/animate/features.js +0 -2
- package/components/animate/variants/container.js +0 -20
- package/components/animate/variants/fade.js +0 -61
- package/components/animate/variants/transition.js +0 -16
- package/components/formatters/BooleanFormatter/index.js +0 -52
- package/components/formatters/DateFormatter/index.js +0 -66
- package/components/formatters/index.js +0 -112
- package/components/hook-form/FormProvider/index.js +0 -61
- package/components/hook-form/RHFAutocomplete/index.js +0 -144
- package/components/hook-form/RHFAutocompleteAsync/index.js +0 -191
- package/components/hook-form/RHFCheckbox/index.js +0 -65
- package/components/hook-form/RHFDateTime/index.js +0 -79
- package/components/hook-form/RHFMultiCheckbox/index.js +0 -32
- package/components/hook-form/RHFPeriod/index.js +0 -47
- package/components/hook-form/RHFRadioGroup/index.js +0 -41
- package/components/hook-form/RHFSelect/index.js +0 -34
- package/components/hook-form/RHFTextField/index.js +0 -87
- package/components/hook-form/RHFUpload/index.js +0 -255
- package/components/mui_extended/Accordion/index.js +0 -105
- package/components/mui_extended/Avatar/index.js +0 -33
- package/components/mui_extended/BoxIcon/index.js +0 -20
- package/components/mui_extended/Breadcrumbs/index.js +0 -92
- package/components/mui_extended/Button/index.js +0 -131
- package/components/mui_extended/IconButton/index.js +0 -108
- package/components/mui_extended/LinkWithRoute/index.js +0 -30
- package/components/mui_extended/MenuPopover/index.js +0 -135
- package/components/mui_extended/Pager/index.js +0 -137
- package/components/mui_extended/Tab/index.js +0 -30
- package/components/mui_extended/Typography/index.js +0 -21
- package/contexts/ModalContext/index.js +0 -165
- package/hooks/useFormAddEdit/index.js +0 -42
- package/hooks/useModal/index.js +0 -4
- package/lodash.js +0 -62
- package/node_modules.js +0 -54
- package/react-data-grid.js +0 -2652
- package/react-draggable.js +0 -960
- package/react-json-view.js +0 -2764
- package/react-lazy-load-image-component.js +0 -792
- package/react-resizable.js +0 -541
- package/react-splitter-layout.js +0 -165
- package/utils/index.js +0 -572
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
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
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,15 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,42 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,106 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,55 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,122 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { useState as p, useEffect as c, Fragment as K } from "react";
|
|
2
|
+
import { useModuleDictionary as M, useModuleSkeleton as W, useNetwork as z, getPropertyByString as B } from "@m4l/core";
|
|
3
|
+
import { useFormContext as N, Controller as J } from "react-hook-form";
|
|
4
|
+
import { Skeleton as b, Autocomplete as Q, TextField as U, CircularProgress as X } from "@mui/material";
|
|
5
|
+
import { styled as f } from "@mui/material/styles";
|
|
6
|
+
import { jsx as i, jsxs as O } from "react/jsx-runtime";
|
|
7
|
+
const Y = f("div")(() => ({
|
|
8
|
+
display: "flex",
|
|
9
|
+
width: "100%",
|
|
10
|
+
flexDirection: "column"
|
|
11
|
+
}));
|
|
12
|
+
f("div")(({
|
|
13
|
+
theme: e
|
|
14
|
+
}) => ({
|
|
15
|
+
display: "flex",
|
|
16
|
+
justifyContent: "flex-end",
|
|
17
|
+
paddingRight: `${e.spacing(2)}`,
|
|
18
|
+
[e.breakpoints.down("md")]: {
|
|
19
|
+
justifyContent: "flex-start"
|
|
20
|
+
}
|
|
21
|
+
}));
|
|
22
|
+
const Z = f("div")(({
|
|
23
|
+
theme: e
|
|
24
|
+
}) => ({
|
|
25
|
+
width: "100%",
|
|
26
|
+
display: "grid",
|
|
27
|
+
gridTemplateColumns: "1fr auto",
|
|
28
|
+
gridGap: e.spacing(2),
|
|
29
|
+
alignItems: "center",
|
|
30
|
+
height: `${e.spacing(4.5)}`,
|
|
31
|
+
border: `1px solid ${e.palette.divider}`,
|
|
32
|
+
borderRadius: `${e.spacing(1)}`,
|
|
33
|
+
padding: `0 ${e.spacing(2)}`,
|
|
34
|
+
[e.breakpoints.down("md")]: {
|
|
35
|
+
width: "100%"
|
|
36
|
+
}
|
|
37
|
+
}));
|
|
38
|
+
function le(e) {
|
|
39
|
+
const {
|
|
40
|
+
name: a,
|
|
41
|
+
getOptionLabel: T,
|
|
42
|
+
isOptionEqualToValue: k,
|
|
43
|
+
label: C,
|
|
44
|
+
endPoint: d,
|
|
45
|
+
timeout: _ = 5e3,
|
|
46
|
+
parms: g,
|
|
47
|
+
resultField: v = "data",
|
|
48
|
+
skeletonProps: w = {},
|
|
49
|
+
isRemote: S = !0,
|
|
50
|
+
disabled: L,
|
|
51
|
+
...P
|
|
52
|
+
} = e, {
|
|
53
|
+
width: $ = 100,
|
|
54
|
+
height: A = "18px"
|
|
55
|
+
} = w, {
|
|
56
|
+
getLabel: V
|
|
57
|
+
} = M(), m = W(), {
|
|
58
|
+
control: F,
|
|
59
|
+
getValues: I,
|
|
60
|
+
setValue: R
|
|
61
|
+
} = N(), {
|
|
62
|
+
networkOperation: E
|
|
63
|
+
} = z(), r = I(a), [j, u] = p(r === null ? [] : [r]), [q, x] = p(!1), [l, h] = p(!1), s = q && !l && !!d && !m;
|
|
64
|
+
c(() => {
|
|
65
|
+
l && (h(!1), u([]), R(a, null));
|
|
66
|
+
}, [g, d]), c(() => {
|
|
67
|
+
!l && r && u([r]);
|
|
68
|
+
}, [r, l]);
|
|
69
|
+
const D = (t) => t == null ? "" : T(t), G = (t, n) => n == null || t === null ? !1 : k(t, n);
|
|
70
|
+
return c(() => {
|
|
71
|
+
let t = !0;
|
|
72
|
+
if (!!s)
|
|
73
|
+
return E({
|
|
74
|
+
method: "GET",
|
|
75
|
+
endPoint: d,
|
|
76
|
+
timeout: _,
|
|
77
|
+
parms: g,
|
|
78
|
+
isRemote: S
|
|
79
|
+
}).then((n) => {
|
|
80
|
+
t && (u(B(n, v)), h(!0));
|
|
81
|
+
}), () => {
|
|
82
|
+
t = !1;
|
|
83
|
+
};
|
|
84
|
+
}, [s]), m ? /* @__PURE__ */ i(Y, {
|
|
85
|
+
children: /* @__PURE__ */ O(Z, {
|
|
86
|
+
children: [/* @__PURE__ */ i(b, {
|
|
87
|
+
variant: "text",
|
|
88
|
+
width: $,
|
|
89
|
+
height: A
|
|
90
|
+
}, "sk1"), /* @__PURE__ */ i(b, {
|
|
91
|
+
variant: "circular",
|
|
92
|
+
width: 16,
|
|
93
|
+
height: 16
|
|
94
|
+
}, "sk2")]
|
|
95
|
+
})
|
|
96
|
+
}) : /* @__PURE__ */ i(J, {
|
|
97
|
+
name: a,
|
|
98
|
+
control: F,
|
|
99
|
+
render: ({
|
|
100
|
+
field: {
|
|
101
|
+
onChange: t,
|
|
102
|
+
value: n
|
|
103
|
+
},
|
|
104
|
+
fieldState: {
|
|
105
|
+
error: y
|
|
106
|
+
}
|
|
107
|
+
}) => /* @__PURE__ */ i(Q, {
|
|
108
|
+
options: j,
|
|
109
|
+
getOptionLabel: D,
|
|
110
|
+
defaultValue: r,
|
|
111
|
+
isOptionEqualToValue: G,
|
|
112
|
+
disableClearable: !0,
|
|
113
|
+
value: n || null,
|
|
114
|
+
onOpen: () => {
|
|
115
|
+
x(!0);
|
|
116
|
+
},
|
|
117
|
+
onClose: () => {
|
|
118
|
+
x(!1);
|
|
119
|
+
},
|
|
120
|
+
onChange: (o, H) => {
|
|
121
|
+
t(H);
|
|
122
|
+
},
|
|
123
|
+
disabled: L,
|
|
124
|
+
loading: s,
|
|
125
|
+
loadingText: "",
|
|
126
|
+
noOptionsText: V("rhf_autocomplete.component_no_options"),
|
|
127
|
+
renderInput: (o) => /* @__PURE__ */ i(U, {
|
|
128
|
+
...o,
|
|
129
|
+
label: C,
|
|
130
|
+
fullWidth: !0,
|
|
131
|
+
SelectProps: {
|
|
132
|
+
native: !0
|
|
133
|
+
},
|
|
134
|
+
InputProps: {
|
|
135
|
+
...o.InputProps,
|
|
136
|
+
endAdornment: /* @__PURE__ */ O(K, {
|
|
137
|
+
children: [s ? /* @__PURE__ */ i(X, {
|
|
138
|
+
color: "primary",
|
|
139
|
+
size: 20
|
|
140
|
+
}, `cp_async${o.id}`) : null, o.InputProps.endAdornment]
|
|
141
|
+
}, `fr_async_${o.id}`)
|
|
142
|
+
},
|
|
143
|
+
autoComplete: "off",
|
|
144
|
+
error: !!y,
|
|
145
|
+
helperText: y?.message,
|
|
146
|
+
...P
|
|
147
|
+
}, `tx_async_${o.id}`)
|
|
148
|
+
}, "at_async")
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
export {
|
|
152
|
+
le as R
|
|
153
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { useFormContext as c, Controller as m } from "react-hook-form";
|
|
2
|
+
import { styled as t } from "@mui/material/styles";
|
|
3
|
+
import { Skeleton as p, FormControlLabel as d, Checkbox as h } from "@mui/material";
|
|
4
|
+
import { useModuleSkeleton as x } from "@m4l/core";
|
|
5
|
+
import { jsx as e, jsxs as g, Fragment as u } from "react/jsx-runtime";
|
|
6
|
+
const f = t("div")(() => ({
|
|
7
|
+
display: "flex",
|
|
8
|
+
justifyContent: "center",
|
|
9
|
+
alignItems: "center",
|
|
10
|
+
padding: "8px"
|
|
11
|
+
})), k = t(p)(() => ({
|
|
12
|
+
width: "20px",
|
|
13
|
+
height: "20px",
|
|
14
|
+
borderRadius: "4px"
|
|
15
|
+
})), C = t("p")(({
|
|
16
|
+
theme: r
|
|
17
|
+
}) => ({
|
|
18
|
+
...r.typography.caption,
|
|
19
|
+
color: r.palette.error.main,
|
|
20
|
+
marginRight: 14,
|
|
21
|
+
marginLeft: 14
|
|
22
|
+
}));
|
|
23
|
+
function j({
|
|
24
|
+
name: r,
|
|
25
|
+
sizeCheck: i = "small",
|
|
26
|
+
...l
|
|
27
|
+
}) {
|
|
28
|
+
const {
|
|
29
|
+
control: a
|
|
30
|
+
} = c(), s = x();
|
|
31
|
+
return /* @__PURE__ */ e(d, {
|
|
32
|
+
control: /* @__PURE__ */ e(m, {
|
|
33
|
+
name: r,
|
|
34
|
+
control: a,
|
|
35
|
+
render: ({
|
|
36
|
+
field: o,
|
|
37
|
+
fieldState: {
|
|
38
|
+
error: n
|
|
39
|
+
}
|
|
40
|
+
}) => s ? /* @__PURE__ */ e(f, {
|
|
41
|
+
children: /* @__PURE__ */ e(k, {
|
|
42
|
+
variant: "rectangular"
|
|
43
|
+
})
|
|
44
|
+
}) : /* @__PURE__ */ g(u, {
|
|
45
|
+
children: [/* @__PURE__ */ e(h, {
|
|
46
|
+
size: i,
|
|
47
|
+
...o,
|
|
48
|
+
checked: o.value
|
|
49
|
+
}), n?.message && /* @__PURE__ */ e(C, {
|
|
50
|
+
children: n?.message + ""
|
|
51
|
+
})]
|
|
52
|
+
})
|
|
53
|
+
}),
|
|
54
|
+
...l
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
export {
|
|
58
|
+
j as R
|
|
59
|
+
};
|