@m4l/components 0.1.23 → 0.1.25

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 (48) hide show
  1. package/components/CommonActions/components/ActionCancel/{index.7b862bd3.js → index.9cfffe65.js} +1 -1
  2. package/components/CommonActions/components/ActionFormCancel/{index.b59a0011.js → index.ef60c2ee.js} +2 -2
  3. package/components/CommonActions/components/ActionIntro/{index.35c8757f.js → index.f8403e8e.js} +1 -1
  4. package/components/CommonActions/components/Actions/{index.edceed6b.js → index.309d3b6f.js} +7 -7
  5. package/components/DataGrid/{index.cd4fff69.js → index.fe073438.js} +3 -3
  6. package/components/DynamicFilter/{index.4d3c60b4.js → index.d0753667.js} +14 -14
  7. package/components/ModalDialog/{index.e1f31e50.js → index.a24ca508.js} +2 -2
  8. package/components/ObjectLogs/{index.9c43ba69.js → index.a7d36267.js} +3 -3
  9. package/components/Period/index.080a987d.js +175 -0
  10. package/components/Period/styles.d.ts +2 -2
  11. package/components/Period/types.d.ts +4 -1
  12. package/components/hook-form/RHFAutocomplete/dictionary.d.ts +3 -0
  13. package/components/hook-form/RHFAutocomplete/index.5eee9d7c.js +174 -0
  14. package/components/hook-form/RHFAutocomplete/types.d.ts +0 -1
  15. package/components/hook-form/RHFAutocompleteAsync/dictionary.d.ts +3 -0
  16. package/components/hook-form/RHFAutocompleteAsync/index.757b5080.js +65 -0
  17. package/components/hook-form/RHFCheckbox/index.6dcec9e2.js +58 -0
  18. package/components/hook-form/RHFDateTime/index.9231a7c7.js +81 -0
  19. package/components/hook-form/RHFDateTime/subcomponents/Skeleton/index.d.ts +3 -0
  20. package/components/hook-form/RHFDateTime/{styles.d.ts → subcomponents/Skeleton/styles.d.ts} +0 -0
  21. package/components/hook-form/RHFDateTime/subcomponents/Skeleton/types.d.ts +2 -0
  22. package/components/hook-form/RHFPeriod/index.067790c9.js +51 -0
  23. package/components/hook-form/RHFPeriod/types.d.ts +3 -3
  24. package/components/hook-form/RHFTextField/index.ba2a8f67.js +129 -0
  25. package/components/hook-form/RHFTextField/index.d.ts +1 -1
  26. package/components/hook-form/RHFTextField/subcomponents/Skeleton/styles.d.ts +1 -1
  27. package/components/hook-form/RHFTextField/subcomponents/Skeleton/types.d.ts +2 -4
  28. package/components/hook-form/RHFTextField/types.d.ts +1 -0
  29. package/components/hook-form/RHFUpload/RHFUploadImage/components/UploadImage/styles.d.ts +1 -1
  30. package/components/hook-form/RHFUpload/RHFUploadImage/components/UploadImage/subcomponents/Skeleton/index.d.ts +2 -0
  31. package/components/hook-form/RHFUpload/RHFUploadImage/components/UploadImage/subcomponents/Skeleton/styles.d.ts +2 -0
  32. package/components/hook-form/RHFUpload/index.6347159a.js +258 -0
  33. package/components/hook-form/index.d.ts +2 -0
  34. package/components/mui_extended/Button/{index.6df3e958.js → index.2afaa420.js} +1 -1
  35. package/components/mui_extended/Pager/{index.b072df6b.js → index.a23cf8de.js} +1 -1
  36. package/components/mui_extended/Popover/{index.d708b699.js → index.12b0ab55.js} +3 -3
  37. package/contexts/ModalContext/{index.33dc1be9.js → index.f17b3653.js} +3 -3
  38. package/hooks/useModal/{index.34cc1e55.js → index.b1f96279.js} +1 -1
  39. package/index.js +140 -138
  40. package/package.json +1 -1
  41. package/components/Period/index.ba6c0e11.js +0 -159
  42. package/components/hook-form/RHFAutocomplete/index.ee3d9b3c.js +0 -171
  43. package/components/hook-form/RHFAutocompleteAsync/index.3b3da5f6.js +0 -73
  44. package/components/hook-form/RHFCheckbox/index.6a40e25f.js +0 -55
  45. package/components/hook-form/RHFDateTime/index.5ed774e3.js +0 -66
  46. package/components/hook-form/RHFPeriod/index.fc3af81f.js +0 -45
  47. package/components/hook-form/RHFTextField/index.bab2a2cf.js +0 -113
  48. package/components/hook-form/RHFUpload/index.56e2e277.js +0 -239
@@ -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.2afaa420.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.2afaa420.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.b1f96279.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.2afaa420.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.f17b3653.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.fe073438.js";
13
+ import { P as dt } from "../../../mui_extended/Pager/index.a23cf8de.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.b1f96279.js";
16
+ import { A as ft } from "../ActionCancel/index.9cfffe65.js";
17
+ import { A as ut } from "../ActionIntro/index.f8403e8e.js";
18
+ import { P as mt } from "../../../mui_extended/Popover/index.12b0ab55.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.309d3b6f.js";
10
+ import { g as be, d as ve } from "../ModalDialog/index.a24ca508.js";
11
+ import { g as xe, d as Re } from "../mui_extended/Pager/index.a23cf8de.js";
12
12
  const Se = A("div")(() => ({
13
13
  display: "flex",
14
14
  flexDirection: "column",
@@ -4,34 +4,34 @@ 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
- import "../hook-form/RHFCheckbox/index.6a40e25f.js";
10
+ import "../hook-form/RHFCheckbox/index.6dcec9e2.js";
11
11
  import { alpha as Ke, styled as be, Skeleton as Fe, MenuItem as ze, useTheme as Ye, Popper as Ge } from "@mui/material";
12
- import { R as ee } from "../hook-form/RHFDateTime/index.5ed774e3.js";
13
12
  import "@mui/x-date-pickers";
14
- import { R as Y } from "../hook-form/RHFTextField/index.bab2a2cf.js";
13
+ import { R as ee } from "../hook-form/RHFDateTime/index.9231a7c7.js";
14
+ import { R as Y } from "../hook-form/RHFTextField/index.ba2a8f67.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.067790c9.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.080a987d.js";
19
+ import { L as Ue, b as Je, g as Qe } from "../CommonActions/components/Actions/index.309d3b6f.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.f17b3653.js";
23
23
  import "@mui/lab";
24
24
  import "lodash/isString";
25
25
  import "react-dropzone";
26
26
  import "../Image/index.c9da2d5a.js";
27
- import "../hook-form/RHFUpload/index.56e2e277.js";
27
+ import "../hook-form/RHFUpload/index.6347159a.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.2afaa420.js";
31
+ import { P as Xe } from "../mui_extended/Popover/index.12b0ab55.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.9cfffe65.js";
34
+ import { A as tt } from "../CommonActions/components/ActionIntro/index.f8403e8e.js";
35
35
  import { useResponsiveDesktop as rt } from "@m4l/graphics";
36
36
  const re = h("div")(({
37
37
  theme: e
@@ -60,7 +60,7 @@ const re = h("div")(({
60
60
  ], xe = {
61
61
  name: "all",
62
62
  label: "dynamic_filter.all_fields",
63
- urlIcon: "https://s3.amazonaws.com/static.made4labs/environments/d1/frontend/components/icon/assets/icons/default.svg",
63
+ urlIcon: "",
64
64
  type: "string",
65
65
  multiple: !0,
66
66
  presence: "optional"
@@ -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.b1f96279.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.309d3b6f.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.fe073438.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.b1f96279.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.d0753667.js";
12
12
  const q = g("div")(() => ({
13
13
  height: "100%",
14
14
  width: "100%",
@@ -0,0 +1,175 @@
1
+ import { useModuleDictionary as O, useModuleSkeleton as P, useEnvironment as R } from "@m4l/core";
2
+ import { styled as a, Skeleton as u, Autocomplete as T, TextField as b } from "@mui/material";
3
+ import { useMemo as $ } from "react";
4
+ import { I as A } from "../Icon/index.f569765b.js";
5
+ import { jsxs as c, jsx as n } from "react/jsx-runtime";
6
+ import { g as w } from "../CommonActions/components/Actions/index.309d3b6f.js";
7
+ import "@mui/material/Button";
8
+ import "react-hook-form";
9
+ import "react-router-dom";
10
+ import "../../contexts/ModalContext/index.f17b3653.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
+ })), D = 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
+ })), F = 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
+ })), H = 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 _ = (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
+ } = O(), Y = P(), f = _(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
+ }, k = (e) => {
99
+ e && m(e.id, x);
100
+ }, {
101
+ host_static_assets: y,
102
+ environment_assets: v
103
+ } = R(), S = $(() => [{
104
+ id: 0,
105
+ label: d("period.years")
106
+ }, {
107
+ id: 1,
108
+ label: d("period.months")
109
+ }, {
110
+ id: 2,
111
+ label: d("period.days")
112
+ }], [d]);
113
+ return Y ? /* @__PURE__ */ c(D, {
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(T, {
135
+ options: S,
136
+ value: S[f],
137
+ disableClearable: !0,
138
+ onChange: (e, o) => {
139
+ k(o);
140
+ },
141
+ renderInput: (e) => /* @__PURE__ */ n(b, {
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(b, {
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(w());
171
+ }
172
+ export {
173
+ J as P,
174
+ Q as g
175
+ };
@@ -1,7 +1,7 @@
1
1
  /// <reference types="react" />
2
- import { WrapperProps } from './types';
2
+ import { SKTWrapperProps, WrapperProps } from './types';
3
3
  export declare const ContainerPeriod: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & WrapperProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
4
4
  export declare const Gap: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
5
- export declare const SKTWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
5
+ export declare const SKTWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & SKTWrapperProps, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
6
6
  export declare const FieldPeriod: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
7
7
  export declare const FieldValue: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -8,9 +8,10 @@ export declare type PeriodTime = {
8
8
  id: number;
9
9
  label: string;
10
10
  };
11
- export interface WrapperProps {
11
+ export interface WrapperProps extends Pick<PeriodProps, 'readOnly'> {
12
12
  error: boolean;
13
13
  }
14
+ export declare type SKTWrapperProps = Pick<PeriodProps, 'readOnly'>;
14
15
  export declare type PeriodType = {
15
16
  selPeriodTime: ETimePeriods;
16
17
  singleValue: number | '';
@@ -24,6 +25,8 @@ export interface PeriodProps {
24
25
  error?: boolean;
25
26
  readOnly?: boolean;
26
27
  variant?: PeriodVariant;
28
+ skeletonWidth?: string | number;
29
+ skeletonHeight?: string | number;
27
30
  }
28
31
  export interface WrapperProps {
29
32
  error: boolean;
@@ -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
+ };