@m4l/components 0.1.23 → 0.1.24

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 (25) hide show
  1. package/components/CommonActions/components/ActionCancel/{index.7b862bd3.js → index.465be070.js} +1 -1
  2. package/components/CommonActions/components/ActionFormCancel/{index.b59a0011.js → index.0deaba48.js} +2 -2
  3. package/components/CommonActions/components/ActionIntro/{index.35c8757f.js → index.235ecbe2.js} +1 -1
  4. package/components/CommonActions/components/Actions/{index.edceed6b.js → index.798c6aee.js} +7 -7
  5. package/components/DataGrid/{index.cd4fff69.js → index.cb62609c.js} +3 -3
  6. package/components/DynamicFilter/{index.4d3c60b4.js → index.549adc46.js} +9 -9
  7. package/components/ModalDialog/{index.e1f31e50.js → index.0340fb86.js} +2 -2
  8. package/components/ObjectLogs/{index.9c43ba69.js → index.b1dcc4db.js} +3 -3
  9. package/components/Period/{index.ba6c0e11.js → index.05c1c5e0.js} +2 -2
  10. package/components/hook-form/RHFAutocomplete/dictionary.d.ts +3 -0
  11. package/components/hook-form/RHFAutocomplete/index.5eee9d7c.js +174 -0
  12. package/components/hook-form/RHFAutocomplete/types.d.ts +0 -1
  13. package/components/hook-form/RHFAutocompleteAsync/dictionary.d.ts +3 -0
  14. package/components/hook-form/RHFAutocompleteAsync/index.757b5080.js +65 -0
  15. package/components/hook-form/RHFPeriod/{index.fc3af81f.js → index.6c6733eb.js} +1 -1
  16. package/components/hook-form/index.d.ts +2 -0
  17. package/components/mui_extended/Button/{index.6df3e958.js → index.ae47764f.js} +1 -1
  18. package/components/mui_extended/Pager/{index.b072df6b.js → index.298730a1.js} +1 -1
  19. package/components/mui_extended/Popover/{index.d708b699.js → index.b6e4392a.js} +3 -3
  20. package/contexts/ModalContext/{index.33dc1be9.js → index.73ab6934.js} +3 -3
  21. package/hooks/useModal/{index.34cc1e55.js → index.f2492b34.js} +1 -1
  22. package/index.js +140 -138
  23. package/package.json +1 -1
  24. package/components/hook-form/RHFAutocomplete/index.ee3d9b3c.js +0 -171
  25. package/components/hook-form/RHFAutocompleteAsync/index.3b3da5f6.js +0 -73
@@ -1,5 +1,5 @@
1
1
  import { useModuleDictionary as n } from "@m4l/core";
2
- import { B as r } from "../../../mui_extended/Button/index.6df3e958.js";
2
+ import { B as r } from "../../../mui_extended/Button/index.ae47764f.js";
3
3
  import { jsx as i } from "react/jsx-runtime";
4
4
  const m = (o) => {
5
5
  const {
@@ -2,9 +2,9 @@ import { useFormContext as f, useFormState as p } from "react-hook-form";
2
2
  import { useNavigate as C } from "react-router-dom";
3
3
  import { useModuleDictionary as g, useModuleSkeleton as d } from "@m4l/core";
4
4
  import { Skeleton as k } from "@mui/material";
5
- import { B as _ } from "../../../mui_extended/Button/index.6df3e958.js";
5
+ import { B as _ } from "../../../mui_extended/Button/index.ae47764f.js";
6
6
  import { useCallback as v } from "react";
7
- import { u as h } from "../../../../hooks/useModal/index.34cc1e55.js";
7
+ import { u as h } from "../../../../hooks/useModal/index.f2492b34.js";
8
8
  import { jsx as r } from "react/jsx-runtime";
9
9
  function A(n) {
10
10
  const {
@@ -1,5 +1,5 @@
1
1
  import { useModuleDictionary as r } from "@m4l/core";
2
- import { B as n } from "../../../mui_extended/Button/index.6df3e958.js";
2
+ import { B as n } from "../../../mui_extended/Button/index.ae47764f.js";
3
3
  import { jsx as i } from "react/jsx-runtime";
4
4
  const e = (o) => {
5
5
  const {
@@ -6,16 +6,16 @@ import "@mui/material/Button";
6
6
  import "react-hook-form";
7
7
  import "react-router-dom";
8
8
  import { useState as W, useMemo as w, forwardRef as st, useRef as B, useImperativeHandle as rt, useEffect as at, useCallback as j } from "react";
9
- import "../../../../contexts/ModalContext/index.33dc1be9.js";
9
+ import "../../../../contexts/ModalContext/index.73ab6934.js";
10
10
  import "@mui/lab";
11
11
  import { I as y } from "../../../mui_extended/IconButton/index.4b5ce8b5.js";
12
- import { u as I, a as lt, O as ct } from "../../../DataGrid/index.cd4fff69.js";
13
- import { P as dt } from "../../../mui_extended/Pager/index.b072df6b.js";
12
+ import { u as I, a as lt, O as ct } from "../../../DataGrid/index.cb62609c.js";
13
+ import { P as dt } from "../../../mui_extended/Pager/index.298730a1.js";
14
14
  import { D as pt } from "../../../../react-data-grid.d46d625e.js";
15
- import { u as gt } from "../../../../hooks/useModal/index.34cc1e55.js";
16
- import { A as ft } from "../ActionCancel/index.7b862bd3.js";
17
- import { A as ut } from "../ActionIntro/index.35c8757f.js";
18
- import { P as mt } from "../../../mui_extended/Popover/index.d708b699.js";
15
+ import { u as gt } from "../../../../hooks/useModal/index.f2492b34.js";
16
+ import { A as ft } from "../ActionCancel/index.465be070.js";
17
+ import { A as ut } from "../ActionIntro/index.235ecbe2.js";
18
+ import { P as mt } from "../../../mui_extended/Popover/index.b6e4392a.js";
19
19
  import { I as N } from "../../../Icon/index.f569765b.js";
20
20
  import { useResponsiveDesktop as ht } from "@m4l/graphics";
21
21
  const _t = p("div")(({
@@ -6,9 +6,9 @@ import { HTML5Backend as ge } from "react-dnd-html5-backend";
6
6
  import { SvgIcon as B, Checkbox as fe, InputBase as he, Skeleton as pe } from "@mui/material";
7
7
  import { jsx as d, jsxs as Q } from "react/jsx-runtime";
8
8
  import { voidFunction as I, useModuleDictionary as we, useModuleSkeleton as me } from "@m4l/core";
9
- import { A as ye, a as Ce } from "../CommonActions/components/Actions/index.edceed6b.js";
10
- import { g as be, d as ve } from "../ModalDialog/index.e1f31e50.js";
11
- import { g as xe, d as Re } from "../mui_extended/Pager/index.b072df6b.js";
9
+ import { A as ye, a as Ce } from "../CommonActions/components/Actions/index.798c6aee.js";
10
+ import { g as be, d as ve } from "../ModalDialog/index.0340fb86.js";
11
+ import { g as xe, d as Re } from "../mui_extended/Pager/index.298730a1.js";
12
12
  const Se = A("div")(() => ({
13
13
  display: "flex",
14
14
  flexDirection: "column",
@@ -4,7 +4,7 @@ import { useRef as me, useState as S, useMemo as E, useCallback as _, useEffect
4
4
  import { useModuleDictionary as $, useHostTools as z, useEnvironment as j, voidFunction as V, useFlagsPresent as He } from "@m4l/core";
5
5
  import * as C from "yup";
6
6
  import { useFormContext as B, useWatch as ge } from "react-hook-form";
7
- import { R } from "../hook-form/RHFAutocomplete/index.ee3d9b3c.js";
7
+ import { R } from "../hook-form/RHFAutocomplete/index.5eee9d7c.js";
8
8
  import "lodash/debounce";
9
9
  import { jsx as r, jsxs as w, Fragment as A } from "react/jsx-runtime";
10
10
  import "../hook-form/RHFCheckbox/index.6a40e25f.js";
@@ -13,13 +13,13 @@ import { R as ee } from "../hook-form/RHFDateTime/index.5ed774e3.js";
13
13
  import "@mui/x-date-pickers";
14
14
  import { R as Y } from "../hook-form/RHFTextField/index.bab2a2cf.js";
15
15
  import { I as he } from "../Icon/index.f569765b.js";
16
- import "../hook-form/RHFPeriod/index.fc3af81f.js";
16
+ import "../hook-form/RHFPeriod/index.6c6733eb.js";
17
17
  import "../ErrorLabel/index.c8615f16.js";
18
- import "../Period/index.ba6c0e11.js";
19
- import { L as Ue, b as Je, g as Qe } from "../CommonActions/components/Actions/index.edceed6b.js";
18
+ import "../Period/index.05c1c5e0.js";
19
+ import { L as Ue, b as Je, g as Qe } from "../CommonActions/components/Actions/index.798c6aee.js";
20
20
  import "@mui/material/Button";
21
21
  import "react-router-dom";
22
- import "../../contexts/ModalContext/index.33dc1be9.js";
22
+ import "../../contexts/ModalContext/index.73ab6934.js";
23
23
  import "@mui/lab";
24
24
  import "lodash/isString";
25
25
  import "react-dropzone";
@@ -27,11 +27,11 @@ import "../Image/index.c9da2d5a.js";
27
27
  import "../hook-form/RHFUpload/index.56e2e277.js";
28
28
  import { I as G } from "../mui_extended/IconButton/index.4b5ce8b5.js";
29
29
  import "simplebar/dist/simplebar.min.css";
30
- import { F as te } from "../mui_extended/Button/index.6df3e958.js";
31
- import { P as Xe } from "../mui_extended/Popover/index.d708b699.js";
30
+ import { F as te } from "../mui_extended/Button/index.ae47764f.js";
31
+ import { P as Xe } from "../mui_extended/Popover/index.b6e4392a.js";
32
32
  import { R as Ze } from "../contexts/RHFormContext/index.33dba822.js";
33
- import { A as et } from "../CommonActions/components/ActionCancel/index.7b862bd3.js";
34
- import { A as tt } from "../CommonActions/components/ActionIntro/index.35c8757f.js";
33
+ import { A as et } from "../CommonActions/components/ActionCancel/index.465be070.js";
34
+ import { A as tt } from "../CommonActions/components/ActionIntro/index.235ecbe2.js";
35
35
  import { useResponsiveDesktop as rt } from "@m4l/graphics";
36
36
  const re = h("div")(({
37
37
  theme: e
@@ -1,6 +1,6 @@
1
1
  import { Dialog as b, IconButton as w, Paper as v } from "@mui/material";
2
2
  import { c as D } from "../../react-draggable.20e95c61.js";
3
- import { u as $ } from "../../hooks/useModal/index.34cc1e55.js";
3
+ import { u as $ } from "../../hooks/useModal/index.f2492b34.js";
4
4
  import { styled as s } from "@mui/material/styles";
5
5
  import { a as x } from "../../utils/index.214d9542.js";
6
6
  import { R as M } from "../Resizeable/index.45995d2b.js";
@@ -8,7 +8,7 @@ import { useResponsiveDesktop as H } from "@m4l/graphics";
8
8
  import { useEnvironment as I } from "@m4l/core";
9
9
  import { I as C } from "../Icon/index.f569765b.js";
10
10
  import { jsxs as h, jsx as n } from "react/jsx-runtime";
11
- import { b as W, g as _ } from "../CommonActions/components/Actions/index.edceed6b.js";
11
+ import { b as W, g as _ } from "../CommonActions/components/Actions/index.798c6aee.js";
12
12
  const j = s(b)(() => ({})), k = s("div")(({ theme: o }) => ({
13
13
  display: "flex",
14
14
  flexDirection: "column",
@@ -1,14 +1,14 @@
1
1
  import { useState as _, useEffect as f, useCallback as d, useMemo as $ } from "react";
2
2
  import { useNetwork as k, useModuleDictionary as y, useEnvironment as h, usePaginate as O } from "@m4l/core";
3
3
  import { styled as g } from "@mui/material/styles";
4
- import { D as R, g as I } from "../DataGrid/index.cd4fff69.js";
4
+ import { D as R, g as I } from "../DataGrid/index.cb62609c.js";
5
5
  import { D as L } from "../formatters/DateFormatter/index.08d8823b.js";
6
6
  import { Tooltip as G, IconButton as M } from "@mui/material";
7
7
  import { R as S } from "../../react-json-view.f56a7f8e.js";
8
8
  import { jsx as t, jsxs as A } from "react/jsx-runtime";
9
- import { u as T } from "../../hooks/useModal/index.34cc1e55.js";
9
+ import { u as T } from "../../hooks/useModal/index.f2492b34.js";
10
10
  import { I as u } from "../Icon/index.f569765b.js";
11
- import { D as E, g as K } from "../DynamicFilter/index.4d3c60b4.js";
11
+ import { D as E, g as K } from "../DynamicFilter/index.549adc46.js";
12
12
  const q = g("div")(() => ({
13
13
  height: "100%",
14
14
  width: "100%",
@@ -3,11 +3,11 @@ import { styled as a, Skeleton as d, Autocomplete as $, TextField as x } from "@
3
3
  import { useMemo as D } from "react";
4
4
  import { I as v } from "../Icon/index.f569765b.js";
5
5
  import { jsxs as u, jsx as n } from "react/jsx-runtime";
6
- import { g as O } from "../CommonActions/components/Actions/index.edceed6b.js";
6
+ import { g as O } from "../CommonActions/components/Actions/index.798c6aee.js";
7
7
  import "@mui/material/Button";
8
8
  import "react-hook-form";
9
9
  import "react-router-dom";
10
- import "../../contexts/ModalContext/index.33dc1be9.js";
10
+ import "../../contexts/ModalContext/index.73ab6934.js";
11
11
  import "@mui/lab";
12
12
  const S = a("div")(({
13
13
  theme: t,
@@ -0,0 +1,3 @@
1
+ import { Dictionary } from '@m4l/core';
2
+ export declare function getRHFAutocompleteComponentsDictionary(): string[];
3
+ export declare const defaultRHFAutocompleteDictionary: Dictionary;
@@ -0,0 +1,174 @@
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
+ };
@@ -16,5 +16,4 @@ export declare type RHFAutocompleteProps<T> = {
16
16
  onOpen?: (event: React.SyntheticEvent) => void;
17
17
  onClose?: (event: React.SyntheticEvent, reason: AutocompleteCloseReason) => void;
18
18
  onChangeFilterParmsLocal?: (newValue: string, reason: AutocompleteInputChangeReason) => void;
19
- onChangeOption?: (newValue: T) => void;
20
19
  } & TextFieldProps;
@@ -0,0 +1,3 @@
1
+ import { Dictionary } from '@m4l/core';
2
+ export declare function getRHFAutocompleteAsyncComponentsDictionary(): string[];
3
+ export declare const defaultRHFAutocompleteAsyncDictionary: Dictionary;
@@ -0,0 +1,65 @@
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,7 +1,7 @@
1
1
  import { styled as m } from "@mui/material";
2
2
  import { useFormContext as a, Controller as l } from "react-hook-form";
3
3
  import { E as f } from "../../ErrorLabel/index.c8615f16.js";
4
- import { P as p } from "../../Period/index.ba6c0e11.js";
4
+ import { P as p } from "../../Period/index.05c1c5e0.js";
5
5
  import { jsx as t, jsxs as c } from "react/jsx-runtime";
6
6
  const d = m("div")(({
7
7
  theme: e
@@ -1,5 +1,7 @@
1
1
  export { RHFAutocomplete } from './RHFAutocomplete';
2
+ export { getRHFAutocompleteComponentsDictionary } from './RHFAutocomplete/dictionary';
2
3
  export { RHFAutocompleteAsync } from './RHFAutocompleteAsync';
4
+ export { getRHFAutocompleteAsyncComponentsDictionary } from './RHFAutocompleteAsync/dictionary';
3
5
  export { RHFCheckbox } from './RHFCheckbox';
4
6
  export { RHFDateTime } from './RHFDateTime';
5
7
  export { RHFMultiCheckbox } from './RHFMultiCheckbox';
@@ -5,7 +5,7 @@ import { jsx as i } from "react/jsx-runtime";
5
5
  import { LoadingButton as b } from "@mui/lab";
6
6
  import { I as x } from "../IconButton/index.4b5ce8b5.js";
7
7
  import { styled as h, alpha as F } from "@mui/material/styles";
8
- import { u as L } from "../../DynamicFilter/index.4d3c60b4.js";
8
+ import { u as L } from "../../DynamicFilter/index.549adc46.js";
9
9
  import { useMemo as u } from "react";
10
10
  import { I as $ } from "../../Image/index.c9da2d5a.js";
11
11
  const G = (t) => g() ? /* @__PURE__ */ i(m, {
@@ -1,6 +1,6 @@
1
1
  import { useMemo as y } from "react";
2
2
  import { Skeleton as i, TablePagination as R } from "@mui/material";
3
- import { P as S } from "../../CommonActions/components/Actions/index.edceed6b.js";
3
+ import { P as S } from "../../CommonActions/components/Actions/index.798c6aee.js";
4
4
  import { styled as a } from "@mui/material/styles";
5
5
  import { jsxs as l, jsx as e } from "react/jsx-runtime";
6
6
  a("div")(() => ({
@@ -11,9 +11,9 @@ import "../Avatar/index.dadb0528.js";
11
11
  import "react-router-dom";
12
12
  import "@mui/material/Button";
13
13
  import "@mui/lab";
14
- import { I as S } from "../Button/index.6df3e958.js";
15
- import "../../CommonActions/components/Actions/index.edceed6b.js";
16
- import "../Pager/index.b072df6b.js";
14
+ import { I as S } from "../Button/index.ae47764f.js";
15
+ import "../../CommonActions/components/Actions/index.798c6aee.js";
16
+ import "../Pager/index.298730a1.js";
17
17
  import "../Tab/index.e0653a0a.js";
18
18
  const O = I("span")(({
19
19
  arrowType: t,
@@ -4,9 +4,9 @@ import { Typography as M } from "@mui/material";
4
4
  import { styled as l } from "@mui/material/styles";
5
5
  import { B as I } from "../../components/mui_extended/BoxIcon/index.e638ecc8.js";
6
6
  import { jsx as t, jsxs as p, Fragment as _ } from "react/jsx-runtime";
7
- import { M as k } from "../../components/ModalDialog/index.e1f31e50.js";
8
- import { A as $ } from "../../components/CommonActions/components/ActionIntro/index.35c8757f.js";
9
- import { A as b } from "../../components/CommonActions/components/ActionCancel/index.7b862bd3.js";
7
+ import { M as k } from "../../components/ModalDialog/index.0340fb86.js";
8
+ import { A as $ } from "../../components/CommonActions/components/ActionIntro/index.235ecbe2.js";
9
+ import { A as b } from "../../components/CommonActions/components/ActionCancel/index.465be070.js";
10
10
  import { b as A } from "../../utils/index.214d9542.js";
11
11
  const j = l("div")(() => ({
12
12
  display: "flex",
@@ -1,5 +1,5 @@
1
1
  import { useContext as t } from "react";
2
- import { M as e } from "../../contexts/ModalContext/index.33dc1be9.js";
2
+ import { M as e } from "../../contexts/ModalContext/index.73ab6934.js";
3
3
  function s() {
4
4
  const o = t(e);
5
5
  if (!o)
package/index.js CHANGED
@@ -7,78 +7,78 @@ import "react-router-dom";
7
7
  import { L as U } from "./components/animate/LoadingScreen/index.1d0c4307.js";
8
8
  import "@m4l/core";
9
9
  import "react-hook-form";
10
- import { R as k } from "./components/hook-form/RHFAutocomplete/index.ee3d9b3c.js";
10
+ import { R as k, g as G } from "./components/hook-form/RHFAutocomplete/index.5eee9d7c.js";
11
11
  import "react";
12
- import { I as z } from "./components/Image/index.c9da2d5a.js";
12
+ import { I as V } from "./components/Image/index.c9da2d5a.js";
13
13
  import "lodash/debounce";
14
- import { R as w } from "./components/hook-form/RHFCheckbox/index.6a40e25f.js";
15
- import { R as q } from "./components/hook-form/RHFDateTime/index.5ed774e3.js";
14
+ import { R as W } from "./components/hook-form/RHFCheckbox/index.6a40e25f.js";
15
+ import { R as J } from "./components/hook-form/RHFDateTime/index.5ed774e3.js";
16
16
  import "@mui/x-date-pickers";
17
- import { R as K, a as Q } from "./components/hook-form/RHFTextField/index.bab2a2cf.js";
18
- import { I as Y } from "./components/Icon/index.f569765b.js";
19
- import { R as _ } from "./components/hook-form/RHFPeriod/index.fc3af81f.js";
20
- import { E as oo } from "./components/ErrorLabel/index.c8615f16.js";
21
- import { P as to, g as ao } from "./components/Period/index.ba6c0e11.js";
22
- import { b as mo, M as so, d as io, g as po } from "./components/CommonActions/components/Actions/index.edceed6b.js";
17
+ import { R as Q, a as X } from "./components/hook-form/RHFTextField/index.bab2a2cf.js";
18
+ import { I as Z } from "./components/Icon/index.f569765b.js";
19
+ import { R as $ } from "./components/hook-form/RHFPeriod/index.6c6733eb.js";
20
+ import { E as ro } from "./components/ErrorLabel/index.c8615f16.js";
21
+ import { P as ao, g as eo } from "./components/Period/index.05c1c5e0.js";
22
+ import { b as so, M as io, d as po, g as no } from "./components/CommonActions/components/Actions/index.798c6aee.js";
23
23
  import "@mui/material/Button";
24
- import { M as xo, a as fo } from "./contexts/ModalContext/index.33dc1be9.js";
24
+ import { M as xo, a as fo } from "./contexts/ModalContext/index.73ab6934.js";
25
25
  import "@mui/lab";
26
26
  import "lodash/isString";
27
27
  import "react-dropzone";
28
- import { R as lo } from "./components/hook-form/RHFUpload/index.56e2e277.js";
29
- import { A as Fo } from "./components/mui_extended/Accordion/index.49f5df8e.js";
30
- import { A as Do } from "./components/mui_extended/Avatar/index.dadb0528.js";
31
- import { B as yo, L as Po } from "./components/mui_extended/Button/index.6df3e958.js";
32
- import { L as Co, P as Lo } from "./components/mui_extended/Popover/index.d708b699.js";
33
- import { P as Ho, g as Mo } from "./components/mui_extended/Pager/index.b072df6b.js";
34
- import { T as Bo } from "./components/mui_extended/Tab/index.e0653a0a.js";
35
- import { D as To, N as So, T as Eo, g as No } from "./components/DataGrid/index.cd4fff69.js";
28
+ import { R as go } from "./components/hook-form/RHFUpload/index.56e2e277.js";
29
+ import { A as uo } from "./components/mui_extended/Accordion/index.49f5df8e.js";
30
+ import { A as yo } from "./components/mui_extended/Avatar/index.dadb0528.js";
31
+ import { B as Ao, L as Po } from "./components/mui_extended/Button/index.ae47764f.js";
32
+ import { L as Lo, P as Ho } from "./components/mui_extended/Popover/index.b6e4392a.js";
33
+ import { P as Mo, g as bo } from "./components/mui_extended/Pager/index.298730a1.js";
34
+ import { T as Io } from "./components/mui_extended/Tab/index.e0653a0a.js";
35
+ import { D as So, N as Eo, T as No, g as ho } from "./components/DataGrid/index.cb62609c.js";
36
36
  import "react-dnd";
37
37
  import "react-dnd-html5-backend";
38
38
  import "@m4l/graphics";
39
- import { S as Oo } from "./components/ScrollBar/index.39eeb2de.js";
40
- import { D as jo, d as ko, g as Go } from "./components/DynamicFilter/index.4d3c60b4.js";
39
+ import { S as Uo } from "./components/ScrollBar/index.39eeb2de.js";
40
+ import { D as ko, d as Go, g as zo } from "./components/DynamicFilter/index.549adc46.js";
41
41
  import "simplebar/dist/simplebar.min.css";
42
- import { R as Vo } from "./components/contexts/RHFormContext/index.33dba822.js";
42
+ import { R as wo } from "./components/contexts/RHFormContext/index.33dba822.js";
43
43
  import "yup";
44
44
  import "./react-draggable.20e95c61.js";
45
- import { M as Wo, d as qo, g as Jo } from "./components/ModalDialog/index.e1f31e50.js";
46
- import { R as Qo } from "./components/Resizeable/index.45995d2b.js";
47
- import { N as Yo, d as Zo, g as _o } from "./components/NoItemSelected/index.9609a7f7.js";
48
- import { O as or, d as rr, g as tr } from "./components/ObjectLogs/index.9c43ba69.js";
45
+ import { M as qo, d as Jo, g as Ko } from "./components/ModalDialog/index.0340fb86.js";
46
+ import { R as Xo } from "./components/Resizeable/index.45995d2b.js";
47
+ import { N as Zo, d as _o, g as $o } from "./components/NoItemSelected/index.9609a7f7.js";
48
+ import { O as rr, d as tr, g as ar } from "./components/ObjectLogs/index.b1dcc4db.js";
49
49
  import "./react-json-view.f56a7f8e.js";
50
- import { P as er } from "./components/PaperForm/index.3f8c7ef2.js";
51
- import { H as sr } from "./components/Page/index.fc660ee5.js";
52
- import { P as pr } from "./components/PropertyValue/index.ab3dd7e9.js";
50
+ import { P as mr } from "./components/PaperForm/index.3f8c7ef2.js";
51
+ import { H as ir } from "./components/Page/index.fc660ee5.js";
52
+ import { P as nr } from "./components/PropertyValue/index.ab3dd7e9.js";
53
53
  import "./react-splitter-layout.7810ac1b.js";
54
54
  import { S as xr } from "./components/SplitLayout/index.4032673d.js";
55
- import { v as cr } from "./components/animate/variants/fade.b561c0fc.js";
56
- import { v as dr } from "./components/animate/variants/bounce.784aaaaa.js";
57
- import { v as Fr } from "./components/animate/variants/container.11f82b76.js";
58
- import { v as Dr, a as Rr, b as yr } from "./components/animate/variants/transition.bd46b9ce.js";
59
- import { M as Ar } from "./components/animate/MotionContainer/index.8d9f9d80.js";
60
- import { M as Lr } from "./components/animate/MotionLazyContainer/index.572dd012.js";
61
- import { R as Hr } from "./components/hook-form/RHFAutocompleteAsync/index.3b3da5f6.js";
62
- import { R as br } from "./components/hook-form/RHFMultiCheckbox/index.2680b3b6.js";
63
- import { R as Ir } from "./components/hook-form/RHFSelect/index.b6ca8bb2.js";
64
- import { R as Sr } from "./components/hook-form/RHFRadioGroup/index.b3335e13.js";
65
- import { B as Nr } from "./components/mui_extended/BoxIcon/index.e638ecc8.js";
66
- import { B as Or } from "./components/mui_extended/Breadcrumbs/index.5e37d903.js";
67
- import { C as jr } from "./components/mui_extended/CircularProgress/index.ad569afd.js";
68
- import { L as Gr } from "./components/mui_extended/LinkWithRoute/index.16436ab8.js";
69
- import { T as Vr } from "./components/mui_extended/Typography/index.e5494696.js";
70
- import { B as Wr, c as qr } from "./components/formatters/BooleanFormatter/index.3ec56305.js";
71
- import { D as Kr, c as Qr } from "./components/formatters/DateFormatter/index.08d8823b.js";
72
- import { P as Yr, a as Zr, U as _r, e as $r, b as ot, c as rt, d as tt, g as at } from "./components/formatters/index.6959c2de.js";
73
- import { A as mt } from "./components/CommonActions/components/ActionCancel/index.7b862bd3.js";
74
- import { A as it } from "./components/CommonActions/components/ActionIntro/index.35c8757f.js";
75
- import { A as nt } from "./components/CommonActions/components/ActionFormCancel/index.b59a0011.js";
76
- import { A as ft } from "./components/CommonActions/components/ActionFormIntro/index.ca4d2674.js";
77
- import { L as lt } from "./components/Loadable/index.f5518558.js";
78
- import { S as gt } from "./components/ScrollToTop/index.e06f98f6.js";
79
- import { u as ut } from "./hooks/useFormAddEdit/index.d4845f1a.js";
80
- import { u as Rt } from "./hooks/useModal/index.34cc1e55.js";
81
- import { L as Pt } from "./assets/Logo/index.228dcb5a.js";
55
+ import { v as lr } from "./components/animate/variants/fade.b561c0fc.js";
56
+ import { v as gr } from "./components/animate/variants/bounce.784aaaaa.js";
57
+ import { v as ur } from "./components/animate/variants/container.11f82b76.js";
58
+ import { v as yr, a as Rr, b as Ar } from "./components/animate/variants/transition.bd46b9ce.js";
59
+ import { M as Cr } from "./components/animate/MotionContainer/index.8d9f9d80.js";
60
+ import { M as Hr } from "./components/animate/MotionLazyContainer/index.572dd012.js";
61
+ import { R as Mr, g as br } from "./components/hook-form/RHFAutocompleteAsync/index.757b5080.js";
62
+ import { R as Ir } from "./components/hook-form/RHFMultiCheckbox/index.2680b3b6.js";
63
+ import { R as Sr } from "./components/hook-form/RHFSelect/index.b6ca8bb2.js";
64
+ import { R as Nr } from "./components/hook-form/RHFRadioGroup/index.b3335e13.js";
65
+ import { B as Or } from "./components/mui_extended/BoxIcon/index.e638ecc8.js";
66
+ import { B as jr } from "./components/mui_extended/Breadcrumbs/index.5e37d903.js";
67
+ import { C as Gr } from "./components/mui_extended/CircularProgress/index.ad569afd.js";
68
+ import { L as Vr } from "./components/mui_extended/LinkWithRoute/index.16436ab8.js";
69
+ import { T as Wr } from "./components/mui_extended/Typography/index.e5494696.js";
70
+ import { B as Jr, c as Kr } from "./components/formatters/BooleanFormatter/index.3ec56305.js";
71
+ import { D as Xr, c as Yr } from "./components/formatters/DateFormatter/index.08d8823b.js";
72
+ import { P as _r, a as $r, U as ot, e as rt, b as tt, c as at, d as et, g as mt } from "./components/formatters/index.6959c2de.js";
73
+ import { A as it } from "./components/CommonActions/components/ActionCancel/index.465be070.js";
74
+ import { A as nt } from "./components/CommonActions/components/ActionIntro/index.235ecbe2.js";
75
+ import { A as xt } from "./components/CommonActions/components/ActionFormCancel/index.0deaba48.js";
76
+ import { A as lt } from "./components/CommonActions/components/ActionFormIntro/index.ca4d2674.js";
77
+ import { L as gt } from "./components/Loadable/index.f5518558.js";
78
+ import { S as ut } from "./components/ScrollToTop/index.e06f98f6.js";
79
+ import { u as yt } from "./hooks/useFormAddEdit/index.d4845f1a.js";
80
+ import { u as At } from "./hooks/useModal/index.f2492b34.js";
81
+ import { L as Ct } from "./assets/Logo/index.228dcb5a.js";
82
82
  import "./utils/index.214d9542.js";
83
83
  import "./react-data-grid.d46d625e.js";
84
84
  import "clsx";
@@ -90,95 +90,97 @@ import "./react-resizable.5277deaf.js";
90
90
  import "./commonjs.565e6834.js";
91
91
  import "react-helmet-async";
92
92
  export {
93
- Fo as Accordion,
94
- mt as ActionCancel,
95
- nt as ActionFormCancel,
96
- ft as ActionFormIntro,
97
- it as ActionIntro,
98
- mo as Actions,
99
- Do as Avatar,
100
- Wr as BooleanFormatter,
101
- Nr as BoxIcon,
102
- Or as Breadcrumbs,
103
- yo as Button,
104
- jr as CircularProgress,
105
- To as DataGrid,
106
- Kr as DateFormatter,
107
- jo as DynamicFilter,
108
- oo as ErrorLabel,
109
- sr as HelmetPage,
110
- Y as Icon,
93
+ uo as Accordion,
94
+ it as ActionCancel,
95
+ xt as ActionFormCancel,
96
+ lt as ActionFormIntro,
97
+ nt as ActionIntro,
98
+ so as Actions,
99
+ yo as Avatar,
100
+ Jr as BooleanFormatter,
101
+ Or as BoxIcon,
102
+ jr as Breadcrumbs,
103
+ Ao as Button,
104
+ Gr as CircularProgress,
105
+ So as DataGrid,
106
+ Xr as DateFormatter,
107
+ ko as DynamicFilter,
108
+ ro as ErrorLabel,
109
+ ir as HelmetPage,
110
+ Z as Icon,
111
111
  N as IconButton,
112
112
  h as IconButtonAnimate,
113
- z as Image,
114
- Co as LanguagePopover,
115
- Gr as LinkWithRoute,
116
- lt as Loadable,
113
+ V as Image,
114
+ Lo as LanguagePopover,
115
+ Vr as LinkWithRoute,
116
+ gt as Loadable,
117
117
  Po as LoadingButton,
118
118
  U as LoadingScreen,
119
- Pt as Logo,
120
- so as MenuActions,
119
+ Ct as Logo,
120
+ io as MenuActions,
121
121
  xo as ModalContext,
122
- Wo as ModalDialog,
122
+ qo as ModalDialog,
123
123
  fo as ModalProvider,
124
- Ar as MotionContainer,
125
- Lr as MotionLazyContainer,
126
- Yo as NoItemSelected,
127
- So as NumberEditor,
128
- or as ObjectLogs,
129
- Ho as Pager,
130
- er as PaperForm,
131
- to as Period,
132
- Yr as PointsFormatter,
133
- Lo as Popover,
134
- Zr as PriceFormatter,
135
- pr as PropertyValue,
124
+ Cr as MotionContainer,
125
+ Hr as MotionLazyContainer,
126
+ Zo as NoItemSelected,
127
+ Eo as NumberEditor,
128
+ rr as ObjectLogs,
129
+ Mo as Pager,
130
+ mr as PaperForm,
131
+ ao as Period,
132
+ _r as PointsFormatter,
133
+ Ho as Popover,
134
+ $r as PriceFormatter,
135
+ nr as PropertyValue,
136
136
  k as RHFAutocomplete,
137
- Hr as RHFAutocompleteAsync,
138
- w as RHFCheckbox,
139
- q as RHFDateTime,
140
- br as RHFMultiCheckbox,
141
- _ as RHFPeriod,
142
- Sr as RHFRadioGroup,
143
- Ir as RHFSelect,
144
- K as RHFTextField,
145
- Q as RHFTextFieldPassword,
146
- lo as RHFUploadImage,
147
- Vo as RHFormProvider,
148
- Qo as Resizeable,
149
- Oo as ScrollBar,
150
- gt as ScrollToTop,
137
+ Mr as RHFAutocompleteAsync,
138
+ W as RHFCheckbox,
139
+ J as RHFDateTime,
140
+ Ir as RHFMultiCheckbox,
141
+ $ as RHFPeriod,
142
+ Nr as RHFRadioGroup,
143
+ Sr as RHFSelect,
144
+ Q as RHFTextField,
145
+ X as RHFTextFieldPassword,
146
+ go as RHFUploadImage,
147
+ wo as RHFormProvider,
148
+ Xo as Resizeable,
149
+ Uo as ScrollBar,
150
+ ut as ScrollToTop,
151
151
  xr as SplitLayout,
152
- Bo as Tab,
153
- Eo as TextEditor,
154
- Vr as Typography,
155
- _r as UncertaintyFormatter,
156
- qr as columnBooleanFormatter,
157
- Qr as columnDateFormatter,
158
- $r as columnNestedValueFormatter,
159
- ot as columnPointsFormatter,
160
- rt as columnUncertaintyFormatter,
161
- io as defaultCommonActionsDictionary,
162
- ko as defaultDynamicFilterDictionary,
163
- tt as defaultFormattersDictionary,
164
- qo as defaultModalDialogDictionary,
165
- Zo as defaultNoItemSelectedDictionary,
166
- rr as defaultObjectLogDictionary,
167
- po as getCommonActionsDictionary,
168
- Go as getDynamicFilterComponentsDictionary,
169
- at as getFormattersComponentsDictionary,
170
- No as getGridComponentsDictionary,
171
- Jo as getModalDialogComponentsDictionary,
172
- _o as getNoItemSelectedComponentsDictionary,
173
- tr as getObjectLogsComponentsDictionary,
174
- Mo as getPagerComponentsDictionary,
175
- ao as getPeriodComponetsDictionary,
176
- ut as useFormAddEdit,
177
- Rt as useModal,
178
- dr as varBounce,
179
- Fr as varContainer,
180
- cr as varFade,
181
- Dr as varTranEnter,
152
+ Io as Tab,
153
+ No as TextEditor,
154
+ Wr as Typography,
155
+ ot as UncertaintyFormatter,
156
+ Kr as columnBooleanFormatter,
157
+ Yr as columnDateFormatter,
158
+ rt as columnNestedValueFormatter,
159
+ tt as columnPointsFormatter,
160
+ at as columnUncertaintyFormatter,
161
+ po as defaultCommonActionsDictionary,
162
+ Go as defaultDynamicFilterDictionary,
163
+ et as defaultFormattersDictionary,
164
+ Jo as defaultModalDialogDictionary,
165
+ _o as defaultNoItemSelectedDictionary,
166
+ tr as defaultObjectLogDictionary,
167
+ no as getCommonActionsDictionary,
168
+ zo as getDynamicFilterComponentsDictionary,
169
+ mt as getFormattersComponentsDictionary,
170
+ ho as getGridComponentsDictionary,
171
+ Ko as getModalDialogComponentsDictionary,
172
+ $o as getNoItemSelectedComponentsDictionary,
173
+ ar as getObjectLogsComponentsDictionary,
174
+ bo as getPagerComponentsDictionary,
175
+ eo as getPeriodComponetsDictionary,
176
+ br as getRHFAutocompleteAsyncComponentsDictionary,
177
+ G as getRHFAutocompleteComponentsDictionary,
178
+ yt as useFormAddEdit,
179
+ At as useModal,
180
+ gr as varBounce,
181
+ ur as varContainer,
182
+ lr as varFade,
183
+ yr as varTranEnter,
182
184
  Rr as varTranExit,
183
- yr as varTranHover
185
+ Ar as varTranHover
184
186
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m4l/components",
3
- "version": "0.1.23",
3
+ "version": "0.1.24",
4
4
  "license": "UNLICENSED",
5
5
  "dependencies": {
6
6
  "@m4l/core": "*",
@@ -1,171 +0,0 @@
1
- import { useModuleDictionary as K, useModuleSkeleton as U } from "@m4l/core";
2
- import { useFormContext as z, Controller as B } from "react-hook-form";
3
- import { Skeleton as y, Autocomplete as G, TextField as N, CircularProgress as J } from "@mui/material";
4
- import { styled as d } from "@mui/material/styles";
5
- import { I as v } from "../../Image/index.c9da2d5a.js";
6
- import { useMemo as Q, useState as F, useEffect as X } from "react";
7
- import { jsxs as O, jsx as n, Fragment as Y } from "react/jsx-runtime";
8
- const Z = d("div")(() => ({
9
- display: "flex",
10
- width: "100%",
11
- flexDirection: "column"
12
- })), ee = 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
- })), te = 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
- })), oe = d("li")(({
39
- theme: t
40
- }) => ({
41
- "& .m4l_image": {
42
- marginRight: t.spacing(1.5)
43
- }
44
- }));
45
- function ne(t, l, c) {
46
- return function(s, g) {
47
- return /* @__PURE__ */ O(oe, {
48
- ...s,
49
- children: [/* @__PURE__ */ n(v, {
50
- src: t(g),
51
- width: l,
52
- height: c
53
- }), s.key]
54
- });
55
- };
56
- }
57
- function de(t) {
58
- const {
59
- name: l,
60
- getOptionLabel: c,
61
- isOptionEqualToValue: x,
62
- label: s,
63
- skeletonWidth: g = 100,
64
- skeletonHeight: P = "18px",
65
- options: W,
66
- disabled: E,
67
- getOptionUrlImage: p,
68
- imageWidth: C = "24px",
69
- imageHeight: I = "24px",
70
- onOpen: b,
71
- onClose: T,
72
- loading: L,
73
- onChangeOption: w,
74
- onChangeFilterParmsLocal: a,
75
- ...H
76
- } = t, {
77
- getLabel: k
78
- } = K(), M = U(), {
79
- control: $
80
- } = z(), A = Q(() => p !== void 0, [p]), [q, S] = F(!1), V = (e, o) => {
81
- S(!1), T && T(e, o);
82
- }, j = (e) => {
83
- S(!0), b && b(e);
84
- }, m = (e) => e == null ? "" : c(e), _ = (e) => e == null || p === void 0 ? "" : p(e), D = (e, o) => o == null || e === null ? !1 : x(e, o);
85
- return M ? /* @__PURE__ */ n(Z, {
86
- children: /* @__PURE__ */ O(ee, {
87
- children: [/* @__PURE__ */ n(y, {
88
- variant: "text",
89
- width: g,
90
- height: P
91
- }, "sk1"), /* @__PURE__ */ n(y, {
92
- variant: "circular",
93
- width: 16,
94
- height: 16
95
- }, "sk2")]
96
- })
97
- }) : /* @__PURE__ */ n(B, {
98
- name: l,
99
- control: $,
100
- render: ({
101
- field: {
102
- onChange: e,
103
- value: o
104
- },
105
- fieldState: {
106
- error: R
107
- }
108
- }) => {
109
- const [u, f] = F(m(o));
110
- return X(() => {
111
- !q && o === null && u !== "" && f("");
112
- }, [o]), console.log("Render AC", l, u, typeof u, o), /* @__PURE__ */ n(te, {
113
- className: "m4l_rhf_autocomplete",
114
- children: /* @__PURE__ */ n(G, {
115
- autoComplete: !0,
116
- autoSelect: !a,
117
- options: W,
118
- getOptionLabel: m,
119
- inputValue: u,
120
- clearOnBlur: !1,
121
- onInputChange: (i, r, h) => {
122
- console.debug("******onInputChange*", r, h), h === "input" ? (f(r), a && a(r, h)) : e(null);
123
- },
124
- isOptionEqualToValue: D,
125
- disableClearable: !0,
126
- value: o || null,
127
- onOpen: j,
128
- onClose: V,
129
- onChange: (i, r) => {
130
- console.log("onChange optiion*", r), w && w(r), f(m(r)), e(r);
131
- },
132
- filterOptions: a ? (i) => i : void 0,
133
- loading: L,
134
- loadingText: k("rhf_autocomplete.loading_options"),
135
- disabled: E,
136
- noOptionsText: k("rhf_autocomplete.no_options"),
137
- renderOption: A ? ne(_, C, I) : void 0,
138
- renderInput: (i) => (console.log("renderInput parms", l, i.inputProps.value), /* @__PURE__ */ n(N, {
139
- ...i,
140
- label: s,
141
- fullWidth: !0,
142
- SelectProps: {
143
- native: !0
144
- },
145
- InputProps: {
146
- ...i.InputProps,
147
- startAdornment: A && o ? /* @__PURE__ */ n(v, {
148
- src: _(o),
149
- width: C,
150
- height: I
151
- }, "ImageTextField") : null,
152
- endAdornment: /* @__PURE__ */ O(Y, {
153
- children: [L ? /* @__PURE__ */ n(J, {
154
- color: "inherit",
155
- size: 20
156
- }) : null, i.InputProps.endAdornment]
157
- })
158
- },
159
- autoComplete: "off",
160
- error: !!R,
161
- helperText: R?.message,
162
- ...H
163
- }))
164
- })
165
- });
166
- }
167
- });
168
- }
169
- export {
170
- de as R
171
- };
@@ -1,73 +0,0 @@
1
- import { useState as o, useCallback as H, useEffect as p } from "react";
2
- import { useNetwork as N, getPropertyByString as k } from "@m4l/core";
3
- import { useFormContext as w } from "react-hook-form";
4
- import x from "lodash/debounce";
5
- import { R as S } from "../RHFAutocomplete/index.ee3d9b3c.js";
6
- import { jsx as I } from "react/jsx-runtime";
7
- function J(O) {
8
- const {
9
- name: d,
10
- endPoint: t,
11
- timeout: g = 5e3,
12
- parms: s,
13
- resultField: F = "data",
14
- isRemote: A = !0,
15
- onChangeFilterParms: n,
16
- ...C
17
- } = O;
18
- w();
19
- const {
20
- networkOperation: P
21
- } = N(), [h, r] = o([]), [a, m] = o(!1), [l, c] = o(!1), [u, i] = o(!0), [f, R] = o({}), y = H(x((e) => {
22
- console.debug("setCanLoadOptions", !0), i(!0), console.log("New parms:", e), R(e);
23
- }, 300), []), L = (e) => {
24
- n && y(n(e));
25
- };
26
- return p(() => {
27
- console.log("useEffect RHFAutocompleteAsync Parms", s, t), r([]), i(!0);
28
- }, [s, t]), p(() => {
29
- let e = !0;
30
- if (console.log("useEffect RHFAutocompleteAsync", a, l, u), !(!a || l)) {
31
- if (!u) {
32
- console.log("****NO LOAD OPTIONS***");
33
- return;
34
- }
35
- return c(!0), r([]), i(!1), P({
36
- method: "GET",
37
- endPoint: t,
38
- timeout: g,
39
- parms: {
40
- ...s,
41
- ...f
42
- },
43
- isRemote: A
44
- }).then((b) => {
45
- if (e) {
46
- const E = k(b, F);
47
- r(E);
48
- }
49
- }).catch(() => {
50
- console.error("OJOOOO ");
51
- }).finally(() => {
52
- e && c(!1);
53
- }), () => {
54
- e = !1, c(!1);
55
- };
56
- }
57
- }, [a, s, f, t]), /* @__PURE__ */ I(S, {
58
- name: d,
59
- loading: l,
60
- options: h,
61
- onChangeFilterParmsLocal: n ? L : void 0,
62
- onOpen: () => {
63
- m(!0);
64
- },
65
- onClose: () => {
66
- m(!1);
67
- },
68
- ...C
69
- });
70
- }
71
- export {
72
- J as R
73
- };