@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,175 +0,0 @@
1
- import { useModuleDictionary as k, useModuleSkeleton as O, useEnvironment as P } from "@m4l/core";
2
- import { styled as a, Skeleton as u, Autocomplete as R, TextField as S } from "@mui/material";
3
- import { useMemo as T } from "react";
4
- import { I as A } from "../Icon/index.619c31c4.js";
5
- import { jsxs as c, jsx as n } from "react/jsx-runtime";
6
- import { g as $ } from "../CommonActions/components/Actions/index.edeb05c2.js";
7
- import "@mui/material/Button";
8
- import "react-hook-form";
9
- import "react-router-dom";
10
- import "../../contexts/ModalContext/index.9ebc793c.js";
11
- import "@mui/lab";
12
- const M = a("div")(({
13
- theme: t,
14
- error: i,
15
- readOnly: p
16
- }) => ({
17
- display: "flex",
18
- width: "100%",
19
- height: "auto",
20
- alignItems: "center",
21
- gap: t.spacing(1),
22
- border: i ? `1px solid ${t.palette.error.main}` : `1px solid ${t.palette.divider}`,
23
- padding: t.spacing(0.5, 1),
24
- borderRadius: "4px",
25
- ...p && {
26
- border: "0px"
27
- },
28
- "& .MuiAutocomplete-root, & .MuiTextField-root": {
29
- width: "100%"
30
- },
31
- "& .MuiAutocomplete-root .MuiTextField-root": {
32
- width: "100%"
33
- },
34
- "& .MuiTextField-root .MuiInput-input": {
35
- padding: "5px!important"
36
- }
37
- })), g = a("div")(({
38
- theme: t
39
- }) => ({
40
- width: "1px",
41
- height: "20px",
42
- backgroundColor: t.palette.divider
43
- })), w = a("div", {
44
- shouldForwardProp: (t) => t !== "readOnly"
45
- })(({
46
- theme: t,
47
- readOnly: i
48
- }) => ({
49
- display: "flex",
50
- width: "100%",
51
- height: "37.5px",
52
- alignItems: "center",
53
- gap: t.spacing(1),
54
- border: `1px solid ${t.palette.divider}`,
55
- ...i && {
56
- border: "0px"
57
- },
58
- padding: t.spacing(0.5, 1),
59
- borderRadius: "4px"
60
- })), D = a("div")(({
61
- theme: t
62
- }) => ({
63
- ...t.typography.body2,
64
- width: "100%",
65
- display: "flex",
66
- textOverflow: "elipsis",
67
- overflow: "hidden",
68
- padding: "5px",
69
- textAlign: "left"
70
- })), F = a("div")(({
71
- theme: t
72
- }) => ({
73
- ...t.typography.body2,
74
- width: "70px",
75
- display: "flex",
76
- textOverflow: "elipsis",
77
- overflow: "hidden",
78
- padding: "5px",
79
- textAlign: "left"
80
- }));
81
- var r = /* @__PURE__ */ ((t) => (t[t.YEARS = 0] = "YEARS", t[t.MONTHS = 1] = "MONTHS", t[t.DAYS = 2] = "DAYS", t))(r || {});
82
- const H = (t) => t ? t.selPeriodTime ? t.selPeriodTime : t.years && t.years > 0 ? r.YEARS : t.months && t.months > 0 ? r.MONTHS : t.days && t.days > 0 ? r.DAYS : r.YEARS : r.YEARS, N = (t) => t ? t.singleValue !== void 0 ? t.singleValue : t.years && t.years > 0 ? t.years : t.months && t.months > 0 ? t.months : t.days && t.days > 0 ? t.days : "" : "", J = (t) => {
83
- const {
84
- value: i,
85
- onChange: p,
86
- error: C = !1,
87
- readOnly: l = !1,
88
- skeletonWidth: I = "100%",
89
- skeletonHeight: h = "18px"
90
- } = t, {
91
- getLabel: d
92
- } = k(), Y = O(), f = H(i), x = N(i), m = (e, o) => {
93
- const s = {
94
- selPeriodTime: e,
95
- singleValue: o
96
- };
97
- o !== "" && o > 0 && (s.years = 0, s.months = 0, s.days = 0, e === r.YEARS && (s.years = o), e === r.MONTHS && (s.months = o), e === r.DAYS && (s.days = o)), p(s);
98
- }, _ = (e) => {
99
- e && m(e.id, x);
100
- }, {
101
- host_static_assets: y,
102
- environment_assets: v
103
- } = P(), b = T(() => [{
104
- id: 0,
105
- label: d("period.label_days")
106
- }, {
107
- id: 1,
108
- label: d("period.label_months")
109
- }, {
110
- id: 2,
111
- label: d("period.label_years")
112
- }], [d]);
113
- return Y ? /* @__PURE__ */ c(w, {
114
- readOnly: l,
115
- children: [/* @__PURE__ */ n(u, {
116
- variant: "text",
117
- width: "50%",
118
- height: h
119
- }), /* @__PURE__ */ n(g, {}), /* @__PURE__ */ n(u, {
120
- variant: "text",
121
- width: I,
122
- height: h
123
- }), /* @__PURE__ */ n(u, {
124
- variant: "circular",
125
- width: 20,
126
- sx: {
127
- minWidth: "20px",
128
- minHeight: "20px"
129
- }
130
- })]
131
- }) : (l && (i.selPeriodTime, i.singleValue, A, `${y}${v}`), /* @__PURE__ */ c(M, {
132
- error: C,
133
- readOnly: l,
134
- children: [/* @__PURE__ */ n(R, {
135
- options: b,
136
- value: b[f],
137
- disableClearable: !0,
138
- onChange: (e, o) => {
139
- _(o);
140
- },
141
- renderInput: (e) => /* @__PURE__ */ n(S, {
142
- ...e,
143
- fullWidth: !0,
144
- variant: "standard",
145
- SelectProps: {
146
- native: !0
147
- },
148
- InputProps: {
149
- disableUnderline: !0,
150
- ...e.InputProps
151
- },
152
- autoComplete: "off"
153
- }, `tx_async_${e.id}`)
154
- }), /* @__PURE__ */ n(g, {}), /* @__PURE__ */ n(S, {
155
- type: "number",
156
- variant: "standard",
157
- value: x,
158
- InputProps: {
159
- disableUnderline: !0
160
- },
161
- onChange: (e) => {
162
- m(f, e.target.value === "" ? "" : parseInt(e.target.value));
163
- }
164
- }), /* @__PURE__ */ n(A, {
165
- src: `${y}/${v}/frontend/components/period/assets/icons/clock.svg`
166
- })]
167
- }));
168
- };
169
- function Q() {
170
- return ["period"].concat($());
171
- }
172
- export {
173
- J as P,
174
- Q as g
175
- };
@@ -1,56 +0,0 @@
1
- import { useEffect as t } from "react";
2
- import { useForm as f, FormProvider as m } from "react-hook-form";
3
- import { o as n } from "../../../node_modules.168cb897.js";
4
- import { styled as c } from "@mui/material/styles";
5
- import { jsx as l } from "react/jsx-runtime";
6
- const h = c("form")(({
7
- theme: r
8
- }) => ({
9
- display: "flex",
10
- marginBottom: r.spacing(1),
11
- flexDirection: "column",
12
- width: "100%",
13
- overflow: "auto",
14
- maxWidth: r.stretch ? "unset" : "900px",
15
- padding: r.spacing(3)
16
- }));
17
- function P(r) {
18
- const {
19
- children: d,
20
- onSubmit: i,
21
- values: s,
22
- validationSchema: u,
23
- statusLoad: o = "ready"
24
- } = r, e = f({
25
- resolver: n(u),
26
- defaultValues: s
27
- });
28
- return t(() => {
29
- if (console.log("useEffect FormProvider reload_values_provider===", o, s, e), o === "reload_values_provider") {
30
- Object.keys(s).forEach((a) => {
31
- e.setValue(a, s[a], {
32
- shouldValidate: !1,
33
- shouldDirty: !1,
34
- shouldTouch: !1
35
- });
36
- });
37
- return;
38
- }
39
- }, [e, o, s]), t(() => {
40
- o === "ready" && (console.log("useEffect FormProvider Ready", o), e.setValue("statusLoad", "ready", {
41
- shouldValidate: !1,
42
- shouldDirty: !1,
43
- shouldTouch: !1
44
- }));
45
- }, [o]), /* @__PURE__ */ l(m, {
46
- ...e,
47
- children: /* @__PURE__ */ l(h, {
48
- id: "formProvider",
49
- onSubmit: e.handleSubmit(i),
50
- children: d
51
- })
52
- });
53
- }
54
- export {
55
- P as R
56
- };
@@ -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.619c31c4.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,174 +0,0 @@
1
- import { useModuleDictionary as j, useModuleSkeleton as K } from "@m4l/core";
2
- import { useFormContext as U, Controller as z } from "react-hook-form";
3
- import { Skeleton as y, Autocomplete as B, TextField as G, CircularProgress as N } from "@mui/material";
4
- import { styled as d } from "@mui/material/styles";
5
- import { I as W } from "../../Image/index.c9da2d5a.js";
6
- import { useMemo as J, useState as v, useEffect as Q } from "react";
7
- import { jsxs as h, jsx as n, Fragment as X } from "react/jsx-runtime";
8
- const Y = d("div")(() => ({
9
- display: "flex",
10
- width: "100%",
11
- flexDirection: "column"
12
- })), Z = d("div")(({
13
- theme: t
14
- }) => ({
15
- width: "100%",
16
- display: "grid",
17
- gridTemplateColumns: "1fr auto",
18
- gridGap: t.spacing(2),
19
- alignItems: "center",
20
- height: `${t.spacing(4.5)}`,
21
- border: `1px solid ${t.palette.divider}`,
22
- borderRadius: `${t.spacing(1)}`,
23
- padding: `0 ${t.spacing(2)}`,
24
- [t.breakpoints.down("md")]: {
25
- width: "100%"
26
- }
27
- })), ee = d("div")(({
28
- theme: t
29
- }) => ({
30
- display: "flex",
31
- width: "100%",
32
- "& .MuiAutocomplete-root": {
33
- width: "100%"
34
- },
35
- "& .m4l_image": {
36
- marginLeft: t.spacing(1.5)
37
- }
38
- })), te = d("li")(({
39
- theme: t
40
- }) => ({
41
- "& .m4l_image": {
42
- marginRight: t.spacing(1.5)
43
- }
44
- }));
45
- function oe(t, s, c) {
46
- return function(a, g) {
47
- return /* @__PURE__ */ h(te, {
48
- ...a,
49
- children: [/* @__PURE__ */ n(W, {
50
- src: t(g),
51
- width: s,
52
- height: c
53
- }), a.key]
54
- });
55
- };
56
- }
57
- function ue(t) {
58
- const {
59
- name: s,
60
- getOptionLabel: c,
61
- isOptionEqualToValue: O,
62
- label: a,
63
- skeletonWidth: g = 100,
64
- skeletonHeight: H = "18px",
65
- options: x,
66
- disabled: P,
67
- getOptionUrlImage: p,
68
- imageWidth: I = "24px",
69
- imageHeight: C = "24px",
70
- onOpen: T,
71
- onClose: b,
72
- loading: L,
73
- onChangeFilterParmsLocal: l,
74
- ...E
75
- } = t, {
76
- getLabel: _
77
- } = j(), M = K(), {
78
- control: $
79
- } = U(), w = J(() => p !== void 0, [p]), [k, A] = v(!1), q = (e, o) => {
80
- A(!1), b && b(e, o);
81
- }, D = (e) => {
82
- A(!0), T && T(e);
83
- }, u = (e) => e == null ? "" : c(e), S = (e) => e == null || p === void 0 ? "" : p(e), V = (e, o) => o == null || e === null ? !1 : O(e, o);
84
- return M ? /* @__PURE__ */ n(Y, {
85
- children: /* @__PURE__ */ h(Z, {
86
- children: [/* @__PURE__ */ n(y, {
87
- variant: "text",
88
- width: g,
89
- height: H
90
- }, "sk1"), /* @__PURE__ */ n(y, {
91
- variant: "circular",
92
- width: 16,
93
- height: 16
94
- }, "sk2")]
95
- })
96
- }) : /* @__PURE__ */ n(z, {
97
- name: s,
98
- control: $,
99
- render: ({
100
- field: {
101
- onChange: e,
102
- value: o
103
- },
104
- fieldState: {
105
- error: F
106
- }
107
- }) => {
108
- const [R, m] = v(u(o));
109
- return Q(() => {
110
- !k && o === null && R !== "" && m(""), !k && o !== null && x.length === 0 && l && l(u(o), "reset");
111
- }, [o]), /* @__PURE__ */ n(ee, {
112
- className: "m4l_rhf_autocomplete",
113
- children: /* @__PURE__ */ n(B, {
114
- autoComplete: !0,
115
- autoSelect: !1,
116
- options: x,
117
- getOptionLabel: u,
118
- inputValue: R,
119
- clearOnBlur: !1,
120
- onInputChange: (i, r, f) => {
121
- console.log("onInputChange ", s, r, f), f === "input" && (m(r), l && l(r, f)), e(null);
122
- },
123
- isOptionEqualToValue: V,
124
- disableClearable: !0,
125
- value: o || null,
126
- onOpen: D,
127
- onClose: q,
128
- onChange: (i, r) => {
129
- m(u(r)), e(r);
130
- },
131
- filterOptions: l ? (i) => i : void 0,
132
- loading: L,
133
- loadingText: _("rhf_autocomplete.loading_options"),
134
- disabled: P,
135
- noOptionsText: _("rhf_autocomplete.no_options"),
136
- renderOption: w ? oe(S, I, C) : void 0,
137
- renderInput: (i) => /* @__PURE__ */ n(G, {
138
- ...i,
139
- label: a,
140
- fullWidth: !0,
141
- SelectProps: {
142
- native: !0
143
- },
144
- InputProps: {
145
- ...i.InputProps,
146
- startAdornment: w && o ? /* @__PURE__ */ n(W, {
147
- src: S(o),
148
- width: I,
149
- height: C
150
- }, "ImageTextField") : null,
151
- endAdornment: /* @__PURE__ */ h(X, {
152
- children: [L ? /* @__PURE__ */ n(N, {
153
- color: "inherit",
154
- size: 20
155
- }) : null, i.InputProps.endAdornment]
156
- })
157
- },
158
- autoComplete: "off",
159
- error: !!F,
160
- helperText: F?.message,
161
- ...E
162
- })
163
- })
164
- });
165
- }
166
- });
167
- }
168
- function de() {
169
- return ["rhf_autocomplete"];
170
- }
171
- export {
172
- ue as R,
173
- de as g
174
- };
@@ -1,65 +0,0 @@
1
- import { useState as e, useCallback as b, useEffect as p } from "react";
2
- import { useNetwork as k, getPropertyByString as w } from "@m4l/core";
3
- import x from "lodash/debounce";
4
- import { R as D, g as E } from "../RHFAutocomplete/index.5eee9d7c.js";
5
- import { jsx as S } from "react/jsx-runtime";
6
- function N(f) {
7
- const {
8
- name: d,
9
- endPoint: n,
10
- timeout: g = 5e3,
11
- parms: r,
12
- resultField: F = "data",
13
- isRemote: C = !0,
14
- onChangeFilterParms: s,
15
- ...h
16
- } = f, {
17
- networkOperation: y
18
- } = k(), [O, a] = e([]), [i, c] = e(!1), [m, l] = e(!1), [P, o] = e(!0), [u, R] = e({}), A = b(x((t) => {
19
- o(!0), R(t);
20
- }, 300), []), H = (t) => {
21
- s && A(s(t));
22
- };
23
- return p(() => {
24
- o(!0);
25
- }, [r, n]), p(() => {
26
- if (!(!i || m) && !!P)
27
- return l(!0), a([]), o(!1), y({
28
- method: "GET",
29
- endPoint: n,
30
- timeout: g,
31
- parms: {
32
- ...r,
33
- ...u
34
- },
35
- isRemote: C
36
- }).then((t) => {
37
- const L = w(t, F);
38
- a(L);
39
- }).catch(() => {
40
- o(!0);
41
- }).finally(() => {
42
- l(!1);
43
- }), () => {
44
- };
45
- }, [i, r, u, n]), /* @__PURE__ */ S(D, {
46
- name: d,
47
- loading: m,
48
- options: O,
49
- onChangeFilterParmsLocal: s ? H : void 0,
50
- onOpen: () => {
51
- c(!0);
52
- },
53
- onClose: () => {
54
- c(!1);
55
- },
56
- ...h
57
- });
58
- }
59
- function T() {
60
- return E();
61
- }
62
- export {
63
- N as R,
64
- T as g
65
- };
@@ -1,51 +0,0 @@
1
- import { styled as d } from "@mui/material";
2
- import { useFormContext as f, Controller as p } from "react-hook-form";
3
- import { E as c } from "../../ErrorLabel/index.c8615f16.js";
4
- import { P as x } from "../../Period/index.81de7941.js";
5
- import { jsx as r, jsxs as g } from "react/jsx-runtime";
6
- const u = d("div")(({
7
- theme: e
8
- }) => ({
9
- width: "100%",
10
- display: "flex",
11
- flexDirection: "column",
12
- justifyContent: "center",
13
- alignItems: "flex-start",
14
- gap: e.spacing(1)
15
- })), k = (e) => {
16
- const {
17
- name: o,
18
- readOnly: s,
19
- skeletonWidth: n,
20
- skeletonHeight: i
21
- } = e, {
22
- control: l
23
- } = f();
24
- return /* @__PURE__ */ r(p, {
25
- name: o,
26
- control: l,
27
- render: ({
28
- field: {
29
- onChange: m,
30
- value: a
31
- },
32
- fieldState: {
33
- error: t
34
- }
35
- }) => /* @__PURE__ */ g(u, {
36
- children: [/* @__PURE__ */ r(x, {
37
- value: a,
38
- onChange: m,
39
- error: !!t,
40
- readOnly: s,
41
- skeletonWidth: n,
42
- skeletonHeight: i
43
- }), t && /* @__PURE__ */ r(c, {
44
- message: t.message || ""
45
- })]
46
- })
47
- });
48
- };
49
- export {
50
- k as R
51
- };