@m4l/components 0.1.26 → 0.1.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. package/assets/Logo/index.228dcb5a.js +42 -35
  2. package/commonjs.565e6834.js +5 -5
  3. package/components/CommonActions/components/ActionCancel/index.e498eeb2.js +17 -0
  4. package/components/CommonActions/components/ActionFormCancel/index.4ff0ad73.js +64 -0
  5. package/components/CommonActions/components/ActionFormIntro/index.ca4d2674.js +28 -22
  6. package/components/CommonActions/components/ActionIntro/index.60ef7bd7.js +18 -0
  7. package/components/CommonActions/components/Actions/index.0645e30f.js +867 -0
  8. package/components/DataGrid/index.76d8fd25.js +1075 -0
  9. package/components/DynamicFilter/index.342ba5fe.js +1577 -0
  10. package/components/ErrorLabel/index.c8615f16.js +13 -12
  11. package/components/Icon/index.619c31c4.js +96 -0
  12. package/components/Icon/types.d.ts +2 -1
  13. package/components/Image/index.93d5f37f.js +190 -0
  14. package/components/Loadable/index.f5518558.js +8 -8
  15. package/components/ModalDialog/index.9ea10764.js +184 -0
  16. package/components/NoItemSelected/{index.9609a7f7.js → index.46d2f632.js} +52 -41
  17. package/components/ObjectLogs/index.f941fb79.js +288 -0
  18. package/components/Page/index.4237c241.js +22 -20
  19. package/components/PaperForm/index.ec9cb8c9.js +112 -0
  20. package/components/Period/index.2941fbda.js +249 -0
  21. package/components/PropertyValue/index.dfcfe1ba.js +147 -0
  22. package/components/PropertyValue/styles.d.ts +2 -1
  23. package/components/PropertyValue/types.d.ts +3 -3
  24. package/components/Resizeable/index.45995d2b.js +19 -19
  25. package/components/ScrollBar/index.39eeb2de.js +26 -21
  26. package/components/ScrollToTop/index.e06f98f6.js +8 -7
  27. package/components/SplitLayout/index.4032673d.js +35 -33
  28. package/components/animate/LoadingScreen/index.1d0c4307.js +33 -33
  29. package/components/animate/MotionContainer/index.8d9f9d80.js +25 -22
  30. package/components/animate/MotionLazyContainer/index.572dd012.js +10 -10
  31. package/components/animate/features.0fbf41e1.js +3 -3
  32. package/components/animate/variants/bounce.784aaaaa.js +16 -13
  33. package/components/animate/variants/container.11f82b76.js +8 -6
  34. package/components/animate/variants/fade.b561c0fc.js +32 -28
  35. package/components/animate/variants/transition.bd46b9ce.js +17 -12
  36. package/components/formatters/BooleanFormatter/index.8da35c9c.js +55 -0
  37. package/components/formatters/DateFormatter/index.1b9baacc.js +69 -0
  38. package/components/formatters/index.689a8086.js +119 -0
  39. package/components/hook-form/RHFAutocomplete/index.59a68f9f.js +224 -0
  40. package/components/hook-form/RHFAutocompleteAsync/index.c3083062.js +87 -0
  41. package/components/hook-form/RHFCheckbox/index.6dcec9e2.js +49 -39
  42. package/components/hook-form/RHFDateTime/index.9231a7c7.js +69 -56
  43. package/components/hook-form/RHFMultiCheckbox/index.2680b3b6.js +23 -23
  44. package/components/hook-form/RHFPeriod/index.64a228d5.js +55 -0
  45. package/components/hook-form/RHFRadioGroup/index.b3335e13.js +29 -29
  46. package/components/hook-form/RHFSelect/index.b6ca8bb2.js +24 -24
  47. package/components/hook-form/RHFTextField/index.f9aaaa90.js +146 -0
  48. package/components/hook-form/RHFUpload/RHFUploadImage/{components → subcomponents}/UploadImage/index.d.ts +0 -0
  49. package/components/hook-form/RHFUpload/RHFUploadImage/{components → subcomponents}/UploadImage/styles.d.ts +4 -3
  50. package/components/hook-form/RHFUpload/RHFUploadImage/{components → subcomponents}/UploadImage/subcomponents/Skeleton/index.d.ts +0 -0
  51. package/components/hook-form/RHFUpload/RHFUploadImage/{components → subcomponents}/UploadImage/subcomponents/Skeleton/styles.d.ts +0 -0
  52. package/components/hook-form/RHFUpload/RHFUploadImage/{components → subcomponents}/UploadImage/types.d.ts +0 -0
  53. package/components/hook-form/RHFUpload/index.d5cc7c13.js +285 -0
  54. package/components/mui_extended/Accordion/index.a02ac6ae.js +107 -0
  55. package/components/mui_extended/Avatar/index.fe06afd7.js +51 -0
  56. package/components/mui_extended/BoxIcon/index.e638ecc8.js +10 -10
  57. package/components/mui_extended/Breadcrumbs/index.5e37d903.js +49 -44
  58. package/components/mui_extended/Button/index.53b56958.js +178 -0
  59. package/components/mui_extended/CircularProgress/index.ad569afd.js +8 -6
  60. package/components/mui_extended/IconButton/index.a321e5cb.js +120 -0
  61. package/components/mui_extended/IconButton/index.d.ts +1 -1
  62. package/components/mui_extended/LinkWithRoute/index.16436ab8.js +25 -21
  63. package/components/mui_extended/Pager/index.c0865b70.js +141 -0
  64. package/components/mui_extended/Popover/index.705275a4.js +278 -0
  65. package/components/mui_extended/Tab/index.e0653a0a.js +25 -21
  66. package/components/mui_extended/Typography/index.e5494696.js +25 -21
  67. package/contexts/ModalContext/index.b92fa565.js +153 -0
  68. package/contexts/ModalContext/{components → subcomponents}/ContentConfirm/index.d.ts +0 -0
  69. package/contexts/ModalContext/{components → subcomponents}/ContentConfirm/styles.d.ts +0 -0
  70. package/contexts/ModalContext/{components → subcomponents}/ContentConfirm/types.d.ts +0 -0
  71. package/contexts/RHFormContext/index.b142190a.js +63 -0
  72. package/hooks/useFormAddEdit/index.d4845f1a.js +40 -22
  73. package/hooks/useModal/index.5fee01a3.js +11 -0
  74. package/index.js +153 -153
  75. package/package.json +2 -1
  76. package/react-data-grid.d46d625e.js +2206 -1663
  77. package/react-draggable.20e95c61.js +800 -553
  78. package/react-json-view.f56a7f8e.js +2344 -2340
  79. package/react-resizable.5277deaf.js +470 -298
  80. package/react-splitter-layout.7810ac1b.js +130 -128
  81. package/utils/index.214d9542.js +500 -354
  82. package/components/CommonActions/components/ActionCancel/index.6736b782.js +0 -17
  83. package/components/CommonActions/components/ActionFormCancel/index.281ee166.js +0 -49
  84. package/components/CommonActions/components/ActionIntro/index.4665a611.js +0 -18
  85. package/components/CommonActions/components/Actions/index.cd7b2671.js +0 -742
  86. package/components/DataGrid/index.2caf6231.js +0 -894
  87. package/components/DynamicFilter/index.f2377369.js +0 -1157
  88. package/components/Icon/index.f569765b.js +0 -82
  89. package/components/Image/index.c9da2d5a.js +0 -152
  90. package/components/ModalDialog/index.bee344a5.js +0 -168
  91. package/components/ObjectLogs/index.6b6f95e6.js +0 -266
  92. package/components/PaperForm/index.3f8c7ef2.js +0 -105
  93. package/components/Period/index.a112ce37.js +0 -175
  94. package/components/PropertyValue/index.ab3dd7e9.js +0 -116
  95. package/components/contexts/RHFormContext/index.33dba822.js +0 -56
  96. package/components/formatters/BooleanFormatter/index.3ec56305.js +0 -42
  97. package/components/formatters/DateFormatter/index.08d8823b.js +0 -57
  98. package/components/formatters/index.6959c2de.js +0 -106
  99. package/components/hook-form/RHFAutocomplete/index.5eee9d7c.js +0 -174
  100. package/components/hook-form/RHFAutocompleteAsync/index.757b5080.js +0 -65
  101. package/components/hook-form/RHFPeriod/index.979d0898.js +0 -51
  102. package/components/hook-form/RHFTextField/index.ba2a8f67.js +0 -129
  103. package/components/hook-form/RHFUpload/index.6347159a.js +0 -258
  104. package/components/mui_extended/Accordion/index.49f5df8e.js +0 -103
  105. package/components/mui_extended/Avatar/index.dadb0528.js +0 -37
  106. package/components/mui_extended/Button/index.52d18aea.js +0 -144
  107. package/components/mui_extended/IconButton/index.4b5ce8b5.js +0 -103
  108. package/components/mui_extended/Pager/index.951b6975.js +0 -126
  109. package/components/mui_extended/Popover/index.4da8587a.js +0 -252
  110. package/contexts/ModalContext/index.5388dfd5.js +0 -136
  111. package/hooks/useModal/index.3b1ff084.js +0 -11
  112. package/node_modules.168cb897.js +0 -55
@@ -1,174 +0,0 @@
1
- import { useModuleDictionary as j, useModuleSkeleton as K } from "@m4l/core";
2
- import { useFormContext as U, Controller as z } from "react-hook-form";
3
- import { Skeleton as y, Autocomplete as B, TextField as G, CircularProgress as N } from "@mui/material";
4
- import { styled as d } from "@mui/material/styles";
5
- import { I as W } from "../../Image/index.c9da2d5a.js";
6
- import { useMemo as J, useState as v, useEffect as Q } from "react";
7
- import { jsxs as h, jsx as n, Fragment as X } from "react/jsx-runtime";
8
- const Y = d("div")(() => ({
9
- display: "flex",
10
- width: "100%",
11
- flexDirection: "column"
12
- })), Z = d("div")(({
13
- theme: t
14
- }) => ({
15
- width: "100%",
16
- display: "grid",
17
- gridTemplateColumns: "1fr auto",
18
- gridGap: t.spacing(2),
19
- alignItems: "center",
20
- height: `${t.spacing(4.5)}`,
21
- border: `1px solid ${t.palette.divider}`,
22
- borderRadius: `${t.spacing(1)}`,
23
- padding: `0 ${t.spacing(2)}`,
24
- [t.breakpoints.down("md")]: {
25
- width: "100%"
26
- }
27
- })), ee = d("div")(({
28
- theme: t
29
- }) => ({
30
- display: "flex",
31
- width: "100%",
32
- "& .MuiAutocomplete-root": {
33
- width: "100%"
34
- },
35
- "& .m4l_image": {
36
- marginLeft: t.spacing(1.5)
37
- }
38
- })), te = d("li")(({
39
- theme: t
40
- }) => ({
41
- "& .m4l_image": {
42
- marginRight: t.spacing(1.5)
43
- }
44
- }));
45
- function oe(t, s, c) {
46
- return function(a, g) {
47
- return /* @__PURE__ */ h(te, {
48
- ...a,
49
- children: [/* @__PURE__ */ n(W, {
50
- src: t(g),
51
- width: s,
52
- height: c
53
- }), a.key]
54
- });
55
- };
56
- }
57
- function ue(t) {
58
- const {
59
- name: s,
60
- getOptionLabel: c,
61
- isOptionEqualToValue: O,
62
- label: a,
63
- skeletonWidth: g = 100,
64
- skeletonHeight: H = "18px",
65
- options: x,
66
- disabled: P,
67
- getOptionUrlImage: p,
68
- imageWidth: I = "24px",
69
- imageHeight: C = "24px",
70
- onOpen: T,
71
- onClose: b,
72
- loading: L,
73
- onChangeFilterParmsLocal: l,
74
- ...E
75
- } = t, {
76
- getLabel: _
77
- } = j(), M = K(), {
78
- control: $
79
- } = U(), w = J(() => p !== void 0, [p]), [k, A] = v(!1), q = (e, o) => {
80
- A(!1), b && b(e, o);
81
- }, D = (e) => {
82
- A(!0), T && T(e);
83
- }, u = (e) => e == null ? "" : c(e), S = (e) => e == null || p === void 0 ? "" : p(e), V = (e, o) => o == null || e === null ? !1 : O(e, o);
84
- return M ? /* @__PURE__ */ n(Y, {
85
- children: /* @__PURE__ */ h(Z, {
86
- children: [/* @__PURE__ */ n(y, {
87
- variant: "text",
88
- width: g,
89
- height: H
90
- }, "sk1"), /* @__PURE__ */ n(y, {
91
- variant: "circular",
92
- width: 16,
93
- height: 16
94
- }, "sk2")]
95
- })
96
- }) : /* @__PURE__ */ n(z, {
97
- name: s,
98
- control: $,
99
- render: ({
100
- field: {
101
- onChange: e,
102
- value: o
103
- },
104
- fieldState: {
105
- error: F
106
- }
107
- }) => {
108
- const [R, m] = v(u(o));
109
- return Q(() => {
110
- !k && o === null && R !== "" && m(""), !k && o !== null && x.length === 0 && l && l(u(o), "reset");
111
- }, [o]), /* @__PURE__ */ n(ee, {
112
- className: "m4l_rhf_autocomplete",
113
- children: /* @__PURE__ */ n(B, {
114
- autoComplete: !0,
115
- autoSelect: !1,
116
- options: x,
117
- getOptionLabel: u,
118
- inputValue: R,
119
- clearOnBlur: !1,
120
- onInputChange: (i, r, f) => {
121
- console.log("onInputChange ", s, r, f), f === "input" && (m(r), l && l(r, f)), e(null);
122
- },
123
- isOptionEqualToValue: V,
124
- disableClearable: !0,
125
- value: o || null,
126
- onOpen: D,
127
- onClose: q,
128
- onChange: (i, r) => {
129
- m(u(r)), e(r);
130
- },
131
- filterOptions: l ? (i) => i : void 0,
132
- loading: L,
133
- loadingText: _("rhf_autocomplete.loading_options"),
134
- disabled: P,
135
- noOptionsText: _("rhf_autocomplete.no_options"),
136
- renderOption: w ? oe(S, I, C) : void 0,
137
- renderInput: (i) => /* @__PURE__ */ n(G, {
138
- ...i,
139
- label: a,
140
- fullWidth: !0,
141
- SelectProps: {
142
- native: !0
143
- },
144
- InputProps: {
145
- ...i.InputProps,
146
- startAdornment: w && o ? /* @__PURE__ */ n(W, {
147
- src: S(o),
148
- width: I,
149
- height: C
150
- }, "ImageTextField") : null,
151
- endAdornment: /* @__PURE__ */ h(X, {
152
- children: [L ? /* @__PURE__ */ n(N, {
153
- color: "inherit",
154
- size: 20
155
- }) : null, i.InputProps.endAdornment]
156
- })
157
- },
158
- autoComplete: "off",
159
- error: !!F,
160
- helperText: F?.message,
161
- ...E
162
- })
163
- })
164
- });
165
- }
166
- });
167
- }
168
- function de() {
169
- return ["rhf_autocomplete"];
170
- }
171
- export {
172
- ue as R,
173
- de as g
174
- };
@@ -1,65 +0,0 @@
1
- import { useState as e, useCallback as b, useEffect as p } from "react";
2
- import { useNetwork as k, getPropertyByString as w } from "@m4l/core";
3
- import x from "lodash/debounce";
4
- import { R as D, g as E } from "../RHFAutocomplete/index.5eee9d7c.js";
5
- import { jsx as S } from "react/jsx-runtime";
6
- function N(f) {
7
- const {
8
- name: d,
9
- endPoint: n,
10
- timeout: g = 5e3,
11
- parms: r,
12
- resultField: F = "data",
13
- isRemote: C = !0,
14
- onChangeFilterParms: s,
15
- ...h
16
- } = f, {
17
- networkOperation: y
18
- } = k(), [O, a] = e([]), [i, c] = e(!1), [m, l] = e(!1), [P, o] = e(!0), [u, R] = e({}), A = b(x((t) => {
19
- o(!0), R(t);
20
- }, 300), []), H = (t) => {
21
- s && A(s(t));
22
- };
23
- return p(() => {
24
- o(!0);
25
- }, [r, n]), p(() => {
26
- if (!(!i || m) && !!P)
27
- return l(!0), a([]), o(!1), y({
28
- method: "GET",
29
- endPoint: n,
30
- timeout: g,
31
- parms: {
32
- ...r,
33
- ...u
34
- },
35
- isRemote: C
36
- }).then((t) => {
37
- const L = w(t, F);
38
- a(L);
39
- }).catch(() => {
40
- o(!0);
41
- }).finally(() => {
42
- l(!1);
43
- }), () => {
44
- };
45
- }, [i, r, u, n]), /* @__PURE__ */ S(D, {
46
- name: d,
47
- loading: m,
48
- options: O,
49
- onChangeFilterParmsLocal: s ? H : void 0,
50
- onOpen: () => {
51
- c(!0);
52
- },
53
- onClose: () => {
54
- c(!1);
55
- },
56
- ...h
57
- });
58
- }
59
- function T() {
60
- return E();
61
- }
62
- export {
63
- N as R,
64
- T as g
65
- };
@@ -1,51 +0,0 @@
1
- import { styled as d } from "@mui/material";
2
- import { useFormContext as f, Controller as p } from "react-hook-form";
3
- import { E as c } from "../../ErrorLabel/index.c8615f16.js";
4
- import { P as x } from "../../Period/index.a112ce37.js";
5
- import { jsx as r, jsxs as g } from "react/jsx-runtime";
6
- const u = d("div")(({
7
- theme: e
8
- }) => ({
9
- width: "100%",
10
- display: "flex",
11
- flexDirection: "column",
12
- justifyContent: "center",
13
- alignItems: "flex-start",
14
- gap: e.spacing(1)
15
- })), k = (e) => {
16
- const {
17
- name: o,
18
- readOnly: s,
19
- skeletonWidth: n,
20
- skeletonHeight: i
21
- } = e, {
22
- control: l
23
- } = f();
24
- return /* @__PURE__ */ r(p, {
25
- name: o,
26
- control: l,
27
- render: ({
28
- field: {
29
- onChange: m,
30
- value: a
31
- },
32
- fieldState: {
33
- error: t
34
- }
35
- }) => /* @__PURE__ */ g(u, {
36
- children: [/* @__PURE__ */ r(x, {
37
- value: a,
38
- onChange: m,
39
- error: !!t,
40
- readOnly: s,
41
- skeletonWidth: n,
42
- skeletonHeight: i
43
- }), t && /* @__PURE__ */ r(c, {
44
- message: t.message || ""
45
- })]
46
- })
47
- });
48
- };
49
- export {
50
- k as R
51
- };
@@ -1,129 +0,0 @@
1
- import { useModuleSkeleton as y, useEnvironment as C } from "@m4l/core";
2
- import { styled as H, Skeleton as h, TextField as R, InputAdornment as S } from "@mui/material";
3
- import { forwardRef as I, useState as T } from "react";
4
- import { I as b } from "../../mui_extended/IconButton/index.4b5ce8b5.js";
5
- import { useFormContext as W, Controller as $ } from "react-hook-form";
6
- import { jsx as e, jsxs as P } from "react/jsx-runtime";
7
- const u = H("div")(({
8
- theme: t
9
- }) => ({
10
- display: "flex",
11
- width: "100%",
12
- height: "42.25px",
13
- alignItems: "center",
14
- justifyContent: "space-between",
15
- border: `1px solid ${t.palette.divider}`,
16
- padding: "12px 14px",
17
- borderRadius: t.spacing(1)
18
- })), _ = (t) => {
19
- const {
20
- skeletonWidth: n,
21
- skeletonHeight: o,
22
- skeletonVariant: s
23
- } = t;
24
- return s === "text" ? /* @__PURE__ */ e(u, {
25
- children: /* @__PURE__ */ e(h, {
26
- variant: "text",
27
- width: n,
28
- height: o
29
- })
30
- }) : /* @__PURE__ */ P(u, {
31
- children: [/* @__PURE__ */ e(h, {
32
- variant: "text",
33
- width: n,
34
- height: o
35
- }), /* @__PURE__ */ e(h, {
36
- variant: "circular",
37
- width: "20px",
38
- height: "20px"
39
- })]
40
- });
41
- }, f = I((t, n) => {
42
- const {
43
- name: o,
44
- autoComplete: s = "off",
45
- skeletonWidth: d = "100%",
46
- skeletonHeight: r = "18px",
47
- type: i,
48
- skeletonVariant: a = "text",
49
- ...l
50
- } = t, x = y(), {
51
- control: g
52
- } = W();
53
- return x ? /* @__PURE__ */ e(_, {
54
- skeletonWidth: d,
55
- skeletonHeight: r,
56
- skeletonVariant: a
57
- }) : /* @__PURE__ */ e($, {
58
- name: o,
59
- control: g,
60
- render: ({
61
- field: {
62
- onChange: m,
63
- onBlur: k,
64
- value: w,
65
- name: F,
66
- ref: v
67
- },
68
- fieldState: {
69
- error: c
70
- }
71
- }) => /* @__PURE__ */ e(
72
- R,
73
- {
74
- inputRef: n,
75
- autoComplete: s,
76
- onChange: (p) => {
77
- if (i === "number" && p.target.value) {
78
- m(Number(p.target.value));
79
- return;
80
- }
81
- m(p);
82
- },
83
- onBlur: k,
84
- value: w || "",
85
- name: F,
86
- ref: v,
87
- fullWidth: !0,
88
- error: !!c,
89
- helperText: c?.message,
90
- type: i,
91
- ...l
92
- }
93
- )
94
- });
95
- });
96
- f.displayName = "RHFTextField";
97
- const q = (t) => {
98
- const {
99
- name: n,
100
- label: o,
101
- skeletonWidth: s,
102
- skeletonHeight: d
103
- } = t, [r, i] = T(!1), {
104
- host_static_assets: a,
105
- environment_assets: l
106
- } = C();
107
- return /* @__PURE__ */ e(f, {
108
- name: n,
109
- label: o,
110
- type: r ? "text" : "password",
111
- skeletonVariant: "password",
112
- autoComplete: "on",
113
- skeletonWidth: s,
114
- skeletonHeight: d,
115
- InputProps: {
116
- endAdornment: /* @__PURE__ */ e(S, {
117
- position: "end",
118
- children: /* @__PURE__ */ e(b, {
119
- onClick: () => i(!r),
120
- src: r ? `${a}/${l}/frontend/domain/host/login/assets/icons/eye.svg` : `${a}/${l}/frontend/domain/host/login/assets/icons/eye_off.svg`
121
- })
122
- })
123
- }
124
- });
125
- };
126
- export {
127
- f as R,
128
- q as a
129
- };
@@ -1,258 +0,0 @@
1
- import { styled as w, Skeleton as p, FormHelperText as I } from "@mui/material";
2
- import { useCallback as D } from "react";
3
- import { useFormContext as y, Controller as N } from "react-hook-form";
4
- import S from "lodash/isString";
5
- import { useDropzone as m } from "react-dropzone";
6
- import { styled as e, alpha as x } from "@mui/material/styles";
7
- import { I as l } from "../../Image/index.c9da2d5a.js";
8
- import { useEnvironment as z, useModuleDictionary as h, useModuleSkeleton as A } from "@m4l/core";
9
- import { jsx as i, jsxs as n, Fragment as b } from "react/jsx-runtime";
10
- const j = e("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.divider}`
20
- })), T = e("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
- })), E = e("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
- })), v = e("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
- })), U = e("div")(({
70
- theme: t
71
- }) => ({
72
- display: "flex",
73
- justifyContent: "center",
74
- flexDirection: "column",
75
- gap: t.spacing(3)
76
- })), Y = e("span")(({
77
- theme: t
78
- }) => ({
79
- ...t.typography.subtitle2,
80
- width: "fit-content"
81
- })), H = e("span")(({
82
- theme: t
83
- }) => ({
84
- ...t.typography.body2,
85
- minWidth: t.spacing(20)
86
- })), k = e("span")(({
87
- theme: t
88
- }) => ({
89
- ...t.typography.caption,
90
- width: "fit-content"
91
- })), G = e("div")(({
92
- theme: t
93
- }) => ({
94
- display: "flex",
95
- alignItems: "center",
96
- maxWidth: t.spacing(20)
97
- }));
98
- e("div")(() => ({
99
- width: "100%",
100
- height: "100%",
101
- position: "absolute",
102
- inset: "0",
103
- display: "flex",
104
- justifyContent: "center",
105
- alignItems: "center"
106
- }));
107
- const Q = w("div")(({
108
- theme: t
109
- }) => ({
110
- maskPosition: "center!important",
111
- maskRepeat: "no-repeat!important",
112
- WebkitMaskRepeat: "no-repeat!important",
113
- border: `1px dashed ${t.palette.divider}`,
114
- width: "100%",
115
- height: "100%",
116
- mask: "url('data:image/svg+xml;base64, PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDI2LjMuMSwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkNhcGFfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3d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40cy0wLjktMC42LTEuMi0xLjEKCQljLTAuMi0wLjUtMC40LTEtMC40LTEuNXMwLjEtMS4xLDAuNC0xLjVsMjMtMzYuNGMwLjMtMC41LDAuNy0wLjgsMS4yLTEuMXMxLTAuNCwxLjYtMC40czEuMSwwLjEsMS42LDAuNHMwLjksMC42LDEuMiwxLjEKCQlsMTEuNSwxOC4yYzAuMiwwLjMsMC41LDAuNSwwLjgsMC43czAuNiwwLjMsMSwwLjNjMC4zLDAsMC43LTAuMSwxLTAuM3MwLjYtMC40LDAuOC0wLjdsMy4xLTQuOWMwLjMtMC41LDAuNy0wLjgsMS4yLTEuMQoJCXMxLTAuNCwxLjYtMC40czEuMSwwLjEsMS42LDAuNGMwLjUsMC4zLDAuOSwwLjYsMS4yLDEuMWwxNC42LDIzLjFjMC4zLDAuNSwwLjMsMSwwLjMsMS41UzY4LjcsNjEuNyw2OC40LDYyLjF6Ii8+CjwvZz4KPC9zdmc+Cg==')"
118
- })), f = () => /* @__PURE__ */ i(j, {
119
- children: /* @__PURE__ */ i(Q, {
120
- children: /* @__PURE__ */ i(p, {
121
- variant: "rectangular",
122
- width: "100%",
123
- height: "100%"
124
- })
125
- })
126
- });
127
- function Z({
128
- error: t,
129
- file: M,
130
- helperText: s,
131
- sx: a,
132
- ...c
133
- }) {
134
- const {
135
- getRootProps: L,
136
- getInputProps: o,
137
- isDragActive: r,
138
- isDragReject: d
139
- } = m({
140
- multiple: !1,
141
- ...c
142
- }), {
143
- host_static_assets: C,
144
- environment_assets: g
145
- } = z(), {
146
- getLabel: u
147
- } = h();
148
- return A() ? /* @__PURE__ */ i(f, {}) : /* @__PURE__ */ n(b, {
149
- children: [/* @__PURE__ */ i(j, {
150
- sx: {
151
- ...(d || t) && {
152
- borderColor: "error.light"
153
- },
154
- ...a
155
- },
156
- children: /* @__PURE__ */ n(T, {
157
- id: "DropZoneStyle",
158
- ...L(),
159
- sx: {
160
- ...r && {
161
- opacity: 0.72
162
- }
163
- },
164
- children: [/* @__PURE__ */ i("input", {
165
- ...o()
166
- }), M && /* @__PURE__ */ i(l, {
167
- alt: "avatar",
168
- src: S(M) ? M : M.preview || "",
169
- width: "100%"
170
- }), /* @__PURE__ */ i(E, {
171
- id: "PlaceholderStyle",
172
- className: "placeholder",
173
- sx: {
174
- ...M ? {
175
- bgcolor: x("#161C24", 0.72),
176
- color: "common.white",
177
- opacity: 0
178
- } : {
179
- opacity: 1
180
- },
181
- ...(d || t) && {
182
- bgcolor: "error.lighter",
183
- borderColor: "error.light",
184
- color: "error.main"
185
- }
186
- },
187
- children: /* @__PURE__ */ n(v, {
188
- className: "ContainerUploadBody",
189
- children: [/* @__PURE__ */ i(G, {
190
- children: /* @__PURE__ */ i(l, {
191
- src: `${C}/${g}/frontend/components/upload_image/assets/img/upload_image_illustration.svg`,
192
- width: "100%",
193
- height: "auto"
194
- })
195
- }), /* @__PURE__ */ n(U, {
196
- children: [/* @__PURE__ */ i(Y, {
197
- children: u(M ? "upload_image.title_update" : "upload_image.title_upload")
198
- }), /* @__PURE__ */ i(H, {
199
- children: u("upload_image.description")
200
- }), /* @__PURE__ */ i(k, {
201
- children: u("upload_image.conditions")
202
- })]
203
- })]
204
- })
205
- })]
206
- })
207
- }), s && s]
208
- });
209
- }
210
- const W = w("div")(() => ({
211
- width: "inherit",
212
- height: "inherit",
213
- padding: "1px"
214
- }));
215
- function $({
216
- name: t,
217
- ...M
218
- }) {
219
- const {
220
- control: s,
221
- setValue: a
222
- } = y(), c = D((L) => {
223
- const o = L[0];
224
- o && a(t, Object.assign(o, {
225
- preview: URL.createObjectURL(o)
226
- }));
227
- }, [a]);
228
- return /* @__PURE__ */ i(N, {
229
- name: t,
230
- control: s,
231
- render: ({
232
- field: L,
233
- fieldState: {
234
- error: o
235
- }
236
- }) => {
237
- const r = !!o && !L.value;
238
- return /* @__PURE__ */ n(W, {
239
- children: [/* @__PURE__ */ i(Z, {
240
- onDrop: c,
241
- error: r,
242
- ...M,
243
- file: L.value
244
- }), r && /* @__PURE__ */ i(I, {
245
- error: !0,
246
- sx: {
247
- px: 2,
248
- textAlign: "center"
249
- },
250
- children: o.message
251
- })]
252
- });
253
- }
254
- });
255
- }
256
- export {
257
- $ as R
258
- };