@m4l/components 0.1.24 → 0.1.26

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 (44) hide show
  1. package/components/CommonActions/components/ActionCancel/{index.465be070.js → index.6736b782.js} +1 -1
  2. package/components/CommonActions/components/ActionFormCancel/{index.0deaba48.js → index.281ee166.js} +2 -2
  3. package/components/CommonActions/components/ActionIntro/{index.235ecbe2.js → index.4665a611.js} +1 -1
  4. package/components/CommonActions/components/Actions/{index.798c6aee.js → index.cd7b2671.js} +7 -7
  5. package/components/DataGrid/{index.cb62609c.js → index.2caf6231.js} +3 -3
  6. package/components/DynamicFilter/{index.549adc46.js → index.f2377369.js} +13 -13
  7. package/components/LanguagePopover/styles.d.ts +2 -0
  8. package/components/ModalDialog/{index.0340fb86.js → index.bee344a5.js} +2 -2
  9. package/components/ObjectLogs/{index.b1dcc4db.js → index.6b6f95e6.js} +3 -3
  10. package/components/Page/index.4237c241.js +25 -0
  11. package/components/Period/index.a112ce37.js +175 -0
  12. package/components/Period/styles.d.ts +2 -2
  13. package/components/Period/types.d.ts +4 -1
  14. package/components/hook-form/RHFCheckbox/index.6dcec9e2.js +58 -0
  15. package/components/hook-form/RHFDateTime/index.9231a7c7.js +81 -0
  16. package/components/hook-form/RHFDateTime/subcomponents/Skeleton/index.d.ts +3 -0
  17. package/components/hook-form/RHFDateTime/{styles.d.ts → subcomponents/Skeleton/styles.d.ts} +0 -0
  18. package/components/hook-form/RHFDateTime/subcomponents/Skeleton/types.d.ts +2 -0
  19. package/components/hook-form/RHFPeriod/index.979d0898.js +51 -0
  20. package/components/hook-form/RHFPeriod/types.d.ts +3 -3
  21. package/components/hook-form/RHFTextField/index.ba2a8f67.js +129 -0
  22. package/components/hook-form/RHFTextField/index.d.ts +1 -1
  23. package/components/hook-form/RHFTextField/subcomponents/Skeleton/styles.d.ts +1 -1
  24. package/components/hook-form/RHFTextField/subcomponents/Skeleton/types.d.ts +2 -4
  25. package/components/hook-form/RHFTextField/types.d.ts +1 -0
  26. package/components/hook-form/RHFUpload/RHFUploadImage/components/UploadImage/styles.d.ts +1 -1
  27. package/components/hook-form/RHFUpload/RHFUploadImage/components/UploadImage/subcomponents/Skeleton/index.d.ts +2 -0
  28. package/components/hook-form/RHFUpload/RHFUploadImage/components/UploadImage/subcomponents/Skeleton/styles.d.ts +2 -0
  29. package/components/hook-form/RHFUpload/index.6347159a.js +258 -0
  30. package/components/mui_extended/Button/{index.ae47764f.js → index.52d18aea.js} +1 -1
  31. package/components/mui_extended/Pager/{index.298730a1.js → index.951b6975.js} +1 -1
  32. package/components/mui_extended/Popover/index.4da8587a.js +252 -0
  33. package/contexts/ModalContext/{index.73ab6934.js → index.5388dfd5.js} +3 -3
  34. package/hooks/useModal/{index.f2492b34.js → index.3b1ff084.js} +1 -1
  35. package/index.js +20 -20
  36. package/package.json +1 -1
  37. package/components/Page/index.fc660ee5.js +0 -27
  38. package/components/Period/index.05c1c5e0.js +0 -159
  39. package/components/hook-form/RHFCheckbox/index.6a40e25f.js +0 -55
  40. package/components/hook-form/RHFDateTime/index.5ed774e3.js +0 -66
  41. package/components/hook-form/RHFPeriod/index.6c6733eb.js +0 -45
  42. package/components/hook-form/RHFTextField/index.bab2a2cf.js +0 -113
  43. package/components/hook-form/RHFUpload/index.56e2e277.js +0 -239
  44. package/components/mui_extended/Popover/index.b6e4392a.js +0 -218
@@ -1,45 +0,0 @@
1
- import { styled as m } from "@mui/material";
2
- import { useFormContext as a, Controller as l } from "react-hook-form";
3
- import { E as f } from "../../ErrorLabel/index.c8615f16.js";
4
- import { P as p } from "../../Period/index.05c1c5e0.js";
5
- import { jsx as t, jsxs as c } from "react/jsx-runtime";
6
- const d = m("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
- })), C = (e) => {
16
- const {
17
- name: o
18
- } = e, {
19
- control: s
20
- } = a();
21
- return /* @__PURE__ */ t(l, {
22
- name: o,
23
- control: s,
24
- render: ({
25
- field: {
26
- onChange: n,
27
- value: i
28
- },
29
- fieldState: {
30
- error: r
31
- }
32
- }) => /* @__PURE__ */ c(d, {
33
- children: [/* @__PURE__ */ t(p, {
34
- value: i,
35
- onChange: n,
36
- error: !!r
37
- }), r && /* @__PURE__ */ t(f, {
38
- message: r.message || ""
39
- })]
40
- })
41
- });
42
- };
43
- export {
44
- C as R
45
- };
@@ -1,113 +0,0 @@
1
- import { useModuleSkeleton as w, useEnvironment as F } from "@m4l/core";
2
- import { styled as v, Skeleton as S, TextField as y, InputAdornment as C } from "@mui/material";
3
- import { forwardRef as I, useState as R } from "react";
4
- import { I as H } from "../../mui_extended/IconButton/index.4b5ce8b5.js";
5
- import { useFormContext as T, Controller as b } from "react-hook-form";
6
- import { jsx as t } from "react/jsx-runtime";
7
- const $ = v("div")(({
8
- theme: e
9
- }) => ({
10
- display: "flex",
11
- width: "100%",
12
- alignItems: "center",
13
- border: `1px solid ${e.palette.divider}`,
14
- padding: "12px 14px",
15
- borderRadius: e.spacing(1)
16
- })), P = (e) => {
17
- const {
18
- width: o,
19
- height: n
20
- } = e;
21
- return /* @__PURE__ */ t($, {
22
- children: /* @__PURE__ */ t(S, {
23
- variant: "text",
24
- width: o,
25
- height: n
26
- })
27
- });
28
- }, c = I((e, o) => {
29
- const {
30
- name: n,
31
- autoComplete: l = "off",
32
- skeletonWidth: d = "100%",
33
- skeletonHeight: s = "18px",
34
- type: r,
35
- ...i
36
- } = e, a = w(), {
37
- control: f
38
- } = T();
39
- return a ? /* @__PURE__ */ t(P, {
40
- width: d,
41
- height: s
42
- }) : /* @__PURE__ */ t(b, {
43
- name: n,
44
- control: f,
45
- render: ({
46
- field: {
47
- onChange: p,
48
- onBlur: h,
49
- value: g,
50
- name: x,
51
- ref: k
52
- },
53
- fieldState: {
54
- error: u
55
- }
56
- }) => /* @__PURE__ */ t(
57
- y,
58
- {
59
- inputRef: o,
60
- autoComplete: l,
61
- onChange: (m) => {
62
- if (r === "number" && m.target.value) {
63
- p(Number(m.target.value));
64
- return;
65
- }
66
- p(m);
67
- },
68
- onBlur: h,
69
- value: g || "",
70
- name: x,
71
- ref: k,
72
- fullWidth: !0,
73
- error: !!u,
74
- helperText: u?.message,
75
- type: r,
76
- ...i
77
- }
78
- )
79
- });
80
- });
81
- c.displayName = "RHFTextField";
82
- const M = (e) => {
83
- const {
84
- name: o,
85
- label: n,
86
- skeletonWidth: l,
87
- skeletonHeight: d
88
- } = e, [s, r] = R(!1), {
89
- host_static_assets: i,
90
- environment_assets: a
91
- } = F();
92
- return /* @__PURE__ */ t(c, {
93
- name: o,
94
- label: n,
95
- type: s ? "text" : "password",
96
- autoComplete: "on",
97
- skeletonWidth: l,
98
- skeletonHeight: d,
99
- InputProps: {
100
- endAdornment: /* @__PURE__ */ t(C, {
101
- position: "start",
102
- children: /* @__PURE__ */ t(H, {
103
- onClick: () => r(!s),
104
- src: s ? `${i}/${a}/frontend/domain/host/login/assets/icons/eye.svg` : `${i}/${a}/frontend/domain/host/login/assets/icons/eye_off.svg`
105
- })
106
- })
107
- }
108
- });
109
- };
110
- export {
111
- c as R,
112
- M as a
113
- };
@@ -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
- };
@@ -1,218 +0,0 @@
1
- import { useState as c } from "react";
2
- import { Popover as g, styled as d, Stack as h, MenuItem as b } from "@mui/material";
3
- import { I as u } from "../../Image/index.c9da2d5a.js";
4
- import { useLocales as f } from "@m4l/graphics";
5
- import "@m4l/core";
6
- import "../../Icon/index.f569765b.js";
7
- import { styled as I } from "@mui/material/styles";
8
- import { jsxs as m, jsx as l, Fragment as x } from "react/jsx-runtime";
9
- import "../Accordion/index.49f5df8e.js";
10
- import "../Avatar/index.dadb0528.js";
11
- import "react-router-dom";
12
- import "@mui/material/Button";
13
- import "@mui/lab";
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
- import "../Tab/index.e0653a0a.js";
18
- const O = I("span")(({
19
- arrowType: t,
20
- theme: e
21
- }) => {
22
- const o = `solid 1px ${e.palette.grey[50012]}`, a = {
23
- borderRadius: "0 0 3px 0",
24
- top: -6,
25
- borderBottom: o,
26
- borderRight: o
27
- }, n = {
28
- borderRadius: "3px 0 0 0",
29
- bottom: -6,
30
- borderTop: o,
31
- borderLeft: o
32
- }, r = {
33
- borderRadius: "0 3px 0 0",
34
- left: -6,
35
- borderTop: o,
36
- borderRight: o
37
- }, s = {
38
- borderRadius: "0 0 0 3px",
39
- right: -6,
40
- borderBottom: o,
41
- borderLeft: o
42
- };
43
- return {
44
- display: "none",
45
- [e.breakpoints.up("sm")]: {
46
- zIndex: 1,
47
- width: 12,
48
- height: 12,
49
- content: "''",
50
- position: "absolute",
51
- display: "block",
52
- transform: "rotate(-135deg)",
53
- background: e.palette.background.paper
54
- },
55
- ...t === "top-left" && {
56
- ...a,
57
- left: 20
58
- },
59
- ...t === "top-center" && {
60
- ...a,
61
- left: 0,
62
- right: 0,
63
- margin: "auto"
64
- },
65
- ...t === "top-right" && {
66
- ...a,
67
- right: 20
68
- },
69
- ...t === "bottom-left" && {
70
- ...n,
71
- left: 20
72
- },
73
- ...t === "bottom-center" && {
74
- ...n,
75
- left: 0,
76
- right: 0,
77
- margin: "auto"
78
- },
79
- ...t === "bottom-right" && {
80
- ...n,
81
- right: 20
82
- },
83
- ...t === "left-top" && {
84
- ...r,
85
- top: 20
86
- },
87
- ...t === "left-center" && {
88
- ...r,
89
- top: 0,
90
- bottom: 0,
91
- margin: "auto"
92
- },
93
- ...t === "left-bottom" && {
94
- ...r,
95
- bottom: 20
96
- },
97
- ...t === "right-top" && {
98
- ...s,
99
- top: 20
100
- },
101
- ...t === "right-center" && {
102
- ...s,
103
- top: 0,
104
- bottom: 0,
105
- margin: "auto"
106
- },
107
- ...t === "right-bottom" && {
108
- ...s,
109
- bottom: 20
110
- }
111
- };
112
- });
113
- function v({
114
- children: t,
115
- arrowType: e = "top-right",
116
- sx: p,
117
- className: i,
118
- ...o
119
- }) {
120
- return /* @__PURE__ */ m(g, {
121
- className: `m4l_popover ${i || ""}`,
122
- anchorOrigin: {
123
- vertical: "bottom",
124
- horizontal: "right"
125
- },
126
- transformOrigin: {
127
- vertical: "top",
128
- horizontal: "right"
129
- },
130
- PaperProps: {
131
- sx: {
132
- p: 1,
133
- overflow: "inherit",
134
- ...p
135
- }
136
- },
137
- ...o,
138
- children: [e !== "no-arrow" && /* @__PURE__ */ l(O, {
139
- arrowType: e
140
- }), t]
141
- });
142
- }
143
- const P = d("span")(({
144
- theme: t
145
- }) => ({
146
- marginLeft: t.spacing(1)
147
- }));
148
- function V() {
149
- const {
150
- allLang: t,
151
- currentLang: e,
152
- onChangeLang: p
153
- } = f(), [i, o] = c(null), a = (r) => {
154
- o(r.currentTarget);
155
- }, n = () => {
156
- o(null);
157
- };
158
- return /* @__PURE__ */ m(x, {
159
- children: [/* @__PURE__ */ l(S, {
160
- className: "m4l_language_popover",
161
- onClick: a,
162
- sx: {
163
- width: 40,
164
- height: 40,
165
- ...i && {
166
- bgcolor: "action.selected"
167
- }
168
- },
169
- src: e.icon,
170
- alt: e.label,
171
- width: "24px",
172
- height: "24px",
173
- skeletonVariant: "circle",
174
- tooltip: "dddd"
175
- }), /* @__PURE__ */ l(v, {
176
- arrowType: "top-right",
177
- open: Boolean(i),
178
- anchorEl: i,
179
- anchorOrigin: {
180
- vertical: "bottom",
181
- horizontal: "right"
182
- },
183
- onClose: n,
184
- sx: {
185
- mt: 1.5,
186
- ml: 0.75,
187
- width: 180,
188
- rowGap: "100px",
189
- "& .MuiMenuItem-root": {
190
- px: 1,
191
- typography: "body2",
192
- borderRadius: 0.75
193
- }
194
- },
195
- children: /* @__PURE__ */ l(h, {
196
- spacing: 0.75,
197
- children: t.map((r) => /* @__PURE__ */ m(b, {
198
- selected: r.value === e.value,
199
- onClick: () => {
200
- p(r.value), n();
201
- },
202
- children: [/* @__PURE__ */ l(u, {
203
- alt: r.label,
204
- src: r.icon,
205
- width: "24px",
206
- height: "24px"
207
- }), /* @__PURE__ */ l(P, {
208
- children: r.label
209
- })]
210
- }, r.value))
211
- })
212
- })]
213
- });
214
- }
215
- export {
216
- V as L,
217
- v as P
218
- };