@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,239 +0,0 @@
1
- import { styled as y, FormHelperText as f } from "@mui/material";
2
- import { useCallback as x } from "react";
3
- import { useFormContext as v, Controller as C } from "react-hook-form";
4
- import w from "lodash/isString";
5
- import { useDropzone as b } from "react-dropzone";
6
- import { styled as o, alpha as I } from "@mui/material/styles";
7
- import { I as h } from "../../Image/index.c9da2d5a.js";
8
- import { useEnvironment as _, useModuleDictionary as R } from "@m4l/core";
9
- import { jsxs as a, Fragment as j, jsx as e } from "react/jsx-runtime";
10
- const D = o("div")(({
11
- theme: t
12
- }) => ({
13
- width: "inherit",
14
- height: "100%",
15
- minWidth: t.spacing(20),
16
- margin: "auto",
17
- borderRadius: t.spacing(1),
18
- padding: t.spacing(1),
19
- border: `1px dashed ${t.palette.grey[50032]}`
20
- })), S = o("div")(({
21
- theme: t
22
- }) => ({
23
- zIndex: 0,
24
- width: "100%",
25
- height: "100%",
26
- outline: "none",
27
- display: "flex",
28
- overflow: "hidden",
29
- borderRadius: t.spacing(1),
30
- position: "relative",
31
- alignItems: "center",
32
- justifyContent: "center",
33
- "& > *": {
34
- width: "100%",
35
- height: "100%"
36
- },
37
- "&:hover": {
38
- cursor: "pointer",
39
- "& .placeholder": {
40
- zIndex: 9
41
- }
42
- }
43
- })), U = o("div")(({
44
- theme: t
45
- }) => ({
46
- "&:hover": {
47
- opacity: 1
48
- },
49
- display: "flex",
50
- justifyContent: "center",
51
- position: "absolute",
52
- zIndex: "2",
53
- inset: "0",
54
- transition: t.transitions.create("opacity", {
55
- easing: t.transitions.easing.easeInOut,
56
- duration: t.transitions.duration.shorter
57
- }),
58
- overflow: "auto"
59
- })), W = o("div")(({
60
- theme: t
61
- }) => ({
62
- padding: t.spacing(3, 5),
63
- display: "flex",
64
- flexWrap: "wrap",
65
- justifyContent: "center",
66
- width: "100%",
67
- height: "100%",
68
- gap: t.spacing(3)
69
- })), F = o("div")(({
70
- theme: t
71
- }) => ({
72
- display: "flex",
73
- justifyContent: "center",
74
- flexDirection: "column",
75
- gap: t.spacing(3)
76
- })), z = o("span")(({
77
- theme: t
78
- }) => ({
79
- ...t.typography.subtitle2,
80
- width: "fit-content"
81
- })), P = o("span")(({
82
- theme: t
83
- }) => ({
84
- ...t.typography.body2,
85
- minWidth: t.spacing(20)
86
- })), $ = o("span")(({
87
- theme: t
88
- }) => ({
89
- ...t.typography.caption,
90
- width: "fit-content"
91
- })), H = o("div")(({
92
- theme: t
93
- }) => ({
94
- display: "flex",
95
- alignItems: "center",
96
- maxWidth: t.spacing(20)
97
- }));
98
- o("div")(() => ({
99
- width: "100%",
100
- height: "100%",
101
- position: "absolute",
102
- inset: "0",
103
- display: "flex",
104
- justifyContent: "center",
105
- alignItems: "center"
106
- }));
107
- function L({
108
- error: t,
109
- file: i,
110
- helperText: s,
111
- sx: l,
112
- ...c
113
- }) {
114
- const {
115
- getRootProps: r,
116
- getInputProps: n,
117
- isDragActive: d,
118
- isDragReject: g
119
- } = b({
120
- multiple: !1,
121
- ...c
122
- }), {
123
- host_static_assets: u,
124
- environment_assets: m
125
- } = _(), {
126
- getLabel: p
127
- } = R();
128
- return /* @__PURE__ */ a(j, {
129
- children: [/* @__PURE__ */ e(D, {
130
- id: "RootStyle",
131
- sx: {
132
- ...(g || t) && {
133
- borderColor: "error.light"
134
- },
135
- ...l
136
- },
137
- children: /* @__PURE__ */ a(S, {
138
- id: "DropZoneStyle",
139
- ...r(),
140
- sx: {
141
- ...d && {
142
- opacity: 0.72
143
- }
144
- },
145
- children: [/* @__PURE__ */ e("input", {
146
- ...n()
147
- }), i && /* @__PURE__ */ e(h, {
148
- alt: "avatar",
149
- src: w(i) ? i : i.preview || "",
150
- width: "100%"
151
- }), /* @__PURE__ */ e(U, {
152
- id: "PlaceholderStyle",
153
- className: "placeholder",
154
- sx: {
155
- ...i ? {
156
- bgcolor: I("#161C24", 0.72),
157
- color: "common.white",
158
- opacity: 0
159
- } : {
160
- opacity: 1
161
- },
162
- ...(g || t) && {
163
- bgcolor: "error.lighter",
164
- borderColor: "error.light",
165
- color: "error.main"
166
- }
167
- },
168
- children: /* @__PURE__ */ a(W, {
169
- className: "ContainerUploadBody",
170
- children: [/* @__PURE__ */ e(H, {
171
- children: /* @__PURE__ */ e(h, {
172
- src: `${u}/${m}/frontend/components/upload_image/assets/img/upload_image_illustration.svg`,
173
- width: "100%",
174
- height: "auto"
175
- })
176
- }), /* @__PURE__ */ a(F, {
177
- children: [/* @__PURE__ */ e(z, {
178
- children: p(i ? "upload_image.title_update" : "upload_image.title_upload")
179
- }), /* @__PURE__ */ e(P, {
180
- children: p("upload_image.description")
181
- }), /* @__PURE__ */ e($, {
182
- children: p("upload_image.conditions")
183
- })]
184
- })]
185
- })
186
- })]
187
- })
188
- }), s && s]
189
- });
190
- }
191
- const O = y("div")(() => ({
192
- width: "inherit",
193
- height: "inherit",
194
- padding: "1px"
195
- }));
196
- function q({
197
- name: t,
198
- ...i
199
- }) {
200
- const {
201
- control: s,
202
- setValue: l
203
- } = v(), c = x((r) => {
204
- const n = r[0];
205
- n && l(t, Object.assign(n, {
206
- preview: URL.createObjectURL(n)
207
- }));
208
- }, [l]);
209
- return /* @__PURE__ */ e(C, {
210
- name: t,
211
- control: s,
212
- render: ({
213
- field: r,
214
- fieldState: {
215
- error: n
216
- }
217
- }) => {
218
- const d = !!n && !r.value;
219
- return /* @__PURE__ */ a(O, {
220
- children: [/* @__PURE__ */ e(L, {
221
- onDrop: c,
222
- error: d,
223
- ...i,
224
- file: r.value
225
- }), d && /* @__PURE__ */ e(f, {
226
- error: !0,
227
- sx: {
228
- px: 2,
229
- textAlign: "center"
230
- },
231
- children: n.message
232
- })]
233
- });
234
- }
235
- });
236
- }
237
- export {
238
- q as R
239
- };