@m4l/components 0.1.27 → 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 (93) 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 +65 -53
  12. package/components/Image/index.93d5f37f.js +190 -0
  13. package/components/Loadable/index.f5518558.js +8 -8
  14. package/components/ModalDialog/index.9ea10764.js +184 -0
  15. package/components/NoItemSelected/{index.9609a7f7.js → index.46d2f632.js} +52 -41
  16. package/components/ObjectLogs/index.f941fb79.js +288 -0
  17. package/components/Page/index.4237c241.js +22 -20
  18. package/components/PaperForm/index.ec9cb8c9.js +66 -59
  19. package/components/Period/index.2941fbda.js +249 -0
  20. package/components/PropertyValue/index.dfcfe1ba.js +95 -65
  21. package/components/Resizeable/index.45995d2b.js +19 -19
  22. package/components/ScrollBar/index.39eeb2de.js +26 -21
  23. package/components/ScrollToTop/index.e06f98f6.js +8 -7
  24. package/components/SplitLayout/index.4032673d.js +35 -33
  25. package/components/animate/LoadingScreen/index.1d0c4307.js +33 -33
  26. package/components/animate/MotionContainer/index.8d9f9d80.js +25 -22
  27. package/components/animate/MotionLazyContainer/index.572dd012.js +10 -10
  28. package/components/animate/features.0fbf41e1.js +3 -3
  29. package/components/animate/variants/bounce.784aaaaa.js +16 -13
  30. package/components/animate/variants/container.11f82b76.js +8 -6
  31. package/components/animate/variants/fade.b561c0fc.js +32 -28
  32. package/components/animate/variants/transition.bd46b9ce.js +17 -12
  33. package/components/formatters/BooleanFormatter/index.8da35c9c.js +46 -33
  34. package/components/formatters/DateFormatter/index.1b9baacc.js +49 -37
  35. package/components/formatters/index.689a8086.js +119 -0
  36. package/components/hook-form/RHFAutocomplete/index.59a68f9f.js +224 -0
  37. package/components/hook-form/RHFAutocompleteAsync/index.c3083062.js +87 -0
  38. package/components/hook-form/RHFCheckbox/index.6dcec9e2.js +49 -39
  39. package/components/hook-form/RHFDateTime/index.9231a7c7.js +69 -56
  40. package/components/hook-form/RHFMultiCheckbox/index.2680b3b6.js +23 -23
  41. package/components/hook-form/RHFPeriod/index.64a228d5.js +55 -0
  42. package/components/hook-form/RHFRadioGroup/index.b3335e13.js +29 -29
  43. package/components/hook-form/RHFSelect/index.b6ca8bb2.js +24 -24
  44. package/components/hook-form/RHFTextField/index.f9aaaa90.js +110 -93
  45. package/components/hook-form/RHFUpload/{index.ec4d5326.js → index.d5cc7c13.js} +151 -130
  46. package/components/mui_extended/Accordion/index.a02ac6ae.js +73 -69
  47. package/components/mui_extended/Avatar/index.fe06afd7.js +44 -34
  48. package/components/mui_extended/BoxIcon/index.e638ecc8.js +10 -10
  49. package/components/mui_extended/Breadcrumbs/index.5e37d903.js +49 -44
  50. package/components/mui_extended/Button/index.53b56958.js +178 -0
  51. package/components/mui_extended/CircularProgress/index.ad569afd.js +8 -6
  52. package/components/mui_extended/IconButton/index.a321e5cb.js +82 -67
  53. package/components/mui_extended/LinkWithRoute/index.16436ab8.js +25 -21
  54. package/components/mui_extended/Pager/index.c0865b70.js +141 -0
  55. package/components/mui_extended/Popover/index.705275a4.js +278 -0
  56. package/components/mui_extended/Tab/index.e0653a0a.js +25 -21
  57. package/components/mui_extended/Typography/index.e5494696.js +25 -21
  58. package/contexts/ModalContext/index.b92fa565.js +153 -0
  59. package/contexts/ModalContext/{components → subcomponents}/ContentConfirm/index.d.ts +0 -0
  60. package/contexts/ModalContext/{components → subcomponents}/ContentConfirm/styles.d.ts +0 -0
  61. package/contexts/ModalContext/{components → subcomponents}/ContentConfirm/types.d.ts +0 -0
  62. package/contexts/RHFormContext/index.b142190a.js +63 -0
  63. package/hooks/useFormAddEdit/index.d4845f1a.js +40 -22
  64. package/hooks/useModal/index.5fee01a3.js +11 -0
  65. package/index.js +153 -153
  66. package/package.json +2 -1
  67. package/react-data-grid.d46d625e.js +2206 -1663
  68. package/react-draggable.20e95c61.js +800 -553
  69. package/react-json-view.f56a7f8e.js +2344 -2340
  70. package/react-resizable.5277deaf.js +470 -298
  71. package/react-splitter-layout.7810ac1b.js +130 -128
  72. package/utils/index.214d9542.js +500 -354
  73. package/components/CommonActions/components/ActionCancel/index.431160ba.js +0 -17
  74. package/components/CommonActions/components/ActionFormCancel/index.6a0f34aa.js +0 -49
  75. package/components/CommonActions/components/ActionIntro/index.85557b90.js +0 -18
  76. package/components/CommonActions/components/Actions/index.edeb05c2.js +0 -742
  77. package/components/DataGrid/index.2ce9da7d.js +0 -894
  78. package/components/DynamicFilter/index.e1d4a948.js +0 -1157
  79. package/components/Image/index.c9da2d5a.js +0 -152
  80. package/components/ModalDialog/index.ad61757f.js +0 -168
  81. package/components/ObjectLogs/index.6ebaec71.js +0 -266
  82. package/components/Period/index.81de7941.js +0 -175
  83. package/components/contexts/RHFormContext/index.33dba822.js +0 -56
  84. package/components/formatters/index.c2a9b55d.js +0 -106
  85. package/components/hook-form/RHFAutocomplete/index.5eee9d7c.js +0 -174
  86. package/components/hook-form/RHFAutocompleteAsync/index.757b5080.js +0 -65
  87. package/components/hook-form/RHFPeriod/index.e08fb1ab.js +0 -51
  88. package/components/mui_extended/Button/index.51dae0bb.js +0 -144
  89. package/components/mui_extended/Pager/index.1dc45f5e.js +0 -126
  90. package/components/mui_extended/Popover/index.cb2ccc66.js +0 -252
  91. package/contexts/ModalContext/index.9ebc793c.js +0 -136
  92. package/hooks/useModal/index.34f5978e.js +0 -11
  93. package/node_modules.168cb897.js +0 -55
@@ -1,144 +0,0 @@
1
- import { useModuleSkeleton as g, useEnvironment as B, useModuleDictionary as k } from "@m4l/core";
2
- import { Skeleton as m, styled as S, IconButton as v, Tooltip as I } from "@mui/material";
3
- import _ from "@mui/material/Button";
4
- import { jsx as i } from "react/jsx-runtime";
5
- import { LoadingButton as b } from "@mui/lab";
6
- import { I as x } from "../IconButton/index.a321e5cb.js";
7
- import { styled as h, alpha as F } from "@mui/material/styles";
8
- import { u as L } from "../../DynamicFilter/index.e1d4a948.js";
9
- import { useMemo as u } from "react";
10
- import { I as $ } from "../../Image/index.c9da2d5a.js";
11
- const G = (t) => g() ? /* @__PURE__ */ i(m, {
12
- sx: {
13
- borderRadius: 2
14
- },
15
- variant: "rectangular",
16
- width: "100px",
17
- height: "36px"
18
- }) : /* @__PURE__ */ i(_, {
19
- ...t
20
- }), D = S("div")(({
21
- theme: t
22
- }) => ({
23
- display: "flex",
24
- width: "100%",
25
- borderRadius: t.spacing(1),
26
- overflow: "hidden"
27
- })), W = () => /* @__PURE__ */ i(D, {
28
- id: "WrapperSKTLoadingButton",
29
- children: /* @__PURE__ */ i(m, {
30
- variant: "rectangular",
31
- width: "100%",
32
- height: "48px"
33
- })
34
- }), H = (t) => {
35
- const {
36
- children: r,
37
- ...n
38
- } = t;
39
- return g() ? /* @__PURE__ */ i(W, {}) : /* @__PURE__ */ i(b, {
40
- ...n,
41
- children: r
42
- });
43
- }, w = h("div")(({
44
- theme: t
45
- }) => ({
46
- display: "flex",
47
- justifyContent: "center",
48
- alignItems: "center",
49
- minWidth: t.spacing(3.75),
50
- height: t.spacing(3.75),
51
- background: F(t.palette.primary.main, 0.3)
52
- })), C = h("div")(() => ({
53
- "&.isDirty": {
54
- animationName: "dirtyEffect",
55
- animationDuration: "1s",
56
- animationFillMode: "both",
57
- animationIterationCount: "infinite",
58
- transition: "all .3s",
59
- "@keyframes dirtyEffect": {
60
- "20%": {
61
- opacity: 1
62
- },
63
- "50%": {
64
- opacity: 0.5
65
- },
66
- "100%": {
67
- opacity: 1
68
- }
69
- }
70
- },
71
- "&.isDirtyError": {}
72
- }));
73
- function J() {
74
- const {
75
- isSkeleton: t,
76
- fireOnChangeFilters: r,
77
- automatic: n,
78
- isDirty: o,
79
- isValid: e
80
- } = L(), {
81
- host_static_assets: s,
82
- environment_assets: l
83
- } = B();
84
- if (t)
85
- return /* @__PURE__ */ i(w, {
86
- children: /* @__PURE__ */ i(m, {
87
- variant: "circular",
88
- width: 20,
89
- height: 20
90
- })
91
- });
92
- const a = u(() => n || !o ? "action.active" : e ? "primary.main" : "error.main", [n, e, o]);
93
- return /* @__PURE__ */ i(C, {
94
- id: "WrapperFilterButton",
95
- className: o && e ? "isDirty" : "",
96
- children: /* @__PURE__ */ i(x, {
97
- bgColor: a,
98
- dictionaryTooltip: "dynamic_filter.filter_tooltip",
99
- onClick: () => r(),
100
- "aria-label": "settings",
101
- src: `${s}/${l}/frontend/components/dynamic_filter/assets/icons/${n ? "refresh" : "search"}.svg`
102
- })
103
- });
104
- }
105
- function O({
106
- src: t,
107
- width: r,
108
- height: n,
109
- className: o,
110
- useIntersectionObserver: e,
111
- skeletonVariant: s = "circle",
112
- tooltip: l,
113
- dictionaryTooltip: a,
114
- sx: d = {
115
- width: 40,
116
- height: 40
117
- },
118
- ...y
119
- }) {
120
- const {
121
- getLabel: c
122
- } = k(), p = u(() => a && c ? c(a) : l, [l, a, c]), f = u(() => /* @__PURE__ */ i(v, {
123
- sx: d,
124
- className: `m4l_image_button ${o || ""}`,
125
- ...y,
126
- children: /* @__PURE__ */ i($, {
127
- src: t,
128
- width: r,
129
- height: n,
130
- useIntersectionObserver: e,
131
- skeletonVariant: s
132
- })
133
- }), [t, r, n, e, s, d]);
134
- return p ? /* @__PURE__ */ i(I, {
135
- title: p || "",
136
- children: f
137
- }) : f;
138
- }
139
- export {
140
- G as B,
141
- J as F,
142
- O as I,
143
- H as L
144
- };
@@ -1,126 +0,0 @@
1
- import { useMemo as y } from "react";
2
- import { Skeleton as i, TablePagination as R } from "@mui/material";
3
- import { P as S } from "../../CommonActions/components/Actions/index.edeb05c2.js";
4
- import { styled as a } from "@mui/material/styles";
5
- import { jsxs as l, jsx as e } from "react/jsx-runtime";
6
- a("div")(() => ({
7
- display: "flex",
8
- flexDirection: "column",
9
- height: "100%",
10
- overflow: "hidden"
11
- }));
12
- const b = a("div")(({ theme: t }) => ({
13
- width: "100%",
14
- display: "flex",
15
- justifyContent: "center",
16
- alignItems: "center",
17
- marginLeft: t.spacing(3)
18
- })), T = a("div")(({ theme: t }) => ({
19
- display: "flex",
20
- marginLeft: t.spacing(3)
21
- })), s = a("div")(({ theme: t }) => ({
22
- display: "flex",
23
- justifyContent: "center",
24
- alignItems: "center",
25
- width: t.spacing(3.75),
26
- height: t.spacing(3.75)
27
- })), D = a("div")(({ theme: t }) => ({
28
- display: "grid",
29
- gridTemplateColumns: "auto auto",
30
- gridGap: t.spacing(1),
31
- marginRight: t.spacing(3)
32
- }));
33
- function A(t) {
34
- const {
35
- totalRecords: n,
36
- rowsPerPageOptions: d = [5, 10, 2],
37
- rowsPerPage: r = 25,
38
- page: g,
39
- onPageChange: h,
40
- onRowsPerPageChange: f,
41
- labelRows: P = "Rows per page",
42
- labelOf: u = "Of",
43
- isSkeleton: m = "false",
44
- isDesktop: p
45
- } = t, v = y(() => r * g > n ? Math.floor(n / r) : g, [g, r, n]), w = (o) => {
46
- f(parseInt(o.target.value, 10)), h(0);
47
- }, x = (o, c) => {
48
- h(c);
49
- };
50
- return m ? /* @__PURE__ */ l(b, {
51
- children: [/* @__PURE__ */ l(D, {
52
- children: [/* @__PURE__ */ e(i, {
53
- variant: "text",
54
- width: "40px",
55
- height: "16px"
56
- }), /* @__PURE__ */ e(i, {
57
- variant: "text",
58
- width: "20px",
59
- height: "16px"
60
- })]
61
- }), /* @__PURE__ */ e(i, {
62
- variant: "text",
63
- width: "50px",
64
- height: "16px"
65
- }), /* @__PURE__ */ l(T, {
66
- children: [/* @__PURE__ */ e(s, {
67
- children: /* @__PURE__ */ e(i, {
68
- variant: "circular",
69
- width: 20,
70
- height: 20
71
- })
72
- }), /* @__PURE__ */ e(s, {
73
- children: /* @__PURE__ */ e(i, {
74
- variant: "circular",
75
- width: 20,
76
- height: 20
77
- })
78
- }), /* @__PURE__ */ e(s, {
79
- children: /* @__PURE__ */ e(i, {
80
- variant: "circular",
81
- width: 20,
82
- height: 20
83
- })
84
- }), /* @__PURE__ */ e(s, {
85
- children: /* @__PURE__ */ e(i, {
86
- variant: "circular",
87
- width: 20,
88
- height: 20
89
- })
90
- })]
91
- })]
92
- }) : /* @__PURE__ */ e(R, {
93
- id: "TablePagination",
94
- rowsPerPageOptions: d,
95
- component: "div",
96
- count: n,
97
- rowsPerPage: r,
98
- page: v,
99
- onPageChange: x,
100
- onRowsPerPageChange: w,
101
- labelDisplayedRows: p ? ({
102
- from: o,
103
- to: c,
104
- count: C
105
- }) => `${o}-${c} ${u} ${C}` : () => "",
106
- labelRowsPerPage: p ? P : "",
107
- ActionsComponent: S
108
- });
109
- }
110
- function B() {
111
- return ["pager"];
112
- }
113
- const L = {
114
- pager: {
115
- first: "First",
116
- previous: "Previous",
117
- before: "Before",
118
- last: "Last",
119
- of: "of"
120
- }
121
- };
122
- export {
123
- A as P,
124
- L as d,
125
- B as g
126
- };
@@ -1,252 +0,0 @@
1
- import { useState as d, useEffect as I } from "react";
2
- import { Popover as x, styled as h, Stack as O, MenuItem as S } from "@mui/material";
3
- import { I as P } from "../../Image/index.c9da2d5a.js";
4
- import { useLocales as v } from "@m4l/graphics";
5
- import { useEnvironment as L, useNetwork as k } from "@m4l/core";
6
- import "../../Icon/index.619c31c4.js";
7
- import { styled as C } from "@mui/material/styles";
8
- import { jsxs as m, jsx as i, Fragment as R } from "react/jsx-runtime";
9
- import "../Accordion/index.a02ac6ae.js";
10
- import "../Avatar/index.fe06afd7.js";
11
- import "react-router-dom";
12
- import "@mui/material/Button";
13
- import { C as E } from "../CircularProgress/index.ad569afd.js";
14
- import "@mui/lab";
15
- import { I as N } from "../Button/index.51dae0bb.js";
16
- import "../../CommonActions/components/Actions/index.edeb05c2.js";
17
- import "../Pager/index.1dc45f5e.js";
18
- import "../Tab/index.e0653a0a.js";
19
- const y = C("span")(({
20
- arrowType: t,
21
- theme: n
22
- }) => {
23
- const o = `solid 1px ${n.palette.grey[50012]}`, a = {
24
- borderRadius: "0 0 3px 0",
25
- top: -6,
26
- borderBottom: o,
27
- borderRight: o
28
- }, l = {
29
- borderRadius: "3px 0 0 0",
30
- bottom: -6,
31
- borderTop: o,
32
- borderLeft: o
33
- }, s = {
34
- borderRadius: "0 3px 0 0",
35
- left: -6,
36
- borderTop: o,
37
- borderRight: o
38
- }, r = {
39
- borderRadius: "0 0 0 3px",
40
- right: -6,
41
- borderBottom: o,
42
- borderLeft: o
43
- };
44
- return {
45
- display: "none",
46
- [n.breakpoints.up("sm")]: {
47
- zIndex: 1,
48
- width: 12,
49
- height: 12,
50
- content: "''",
51
- position: "absolute",
52
- display: "block",
53
- transform: "rotate(-135deg)",
54
- background: n.palette.background.paper
55
- },
56
- ...t === "top-left" && {
57
- ...a,
58
- left: 20
59
- },
60
- ...t === "top-center" && {
61
- ...a,
62
- left: 0,
63
- right: 0,
64
- margin: "auto"
65
- },
66
- ...t === "top-right" && {
67
- ...a,
68
- right: 20
69
- },
70
- ...t === "bottom-left" && {
71
- ...l,
72
- left: 20
73
- },
74
- ...t === "bottom-center" && {
75
- ...l,
76
- left: 0,
77
- right: 0,
78
- margin: "auto"
79
- },
80
- ...t === "bottom-right" && {
81
- ...l,
82
- right: 20
83
- },
84
- ...t === "left-top" && {
85
- ...s,
86
- top: 20
87
- },
88
- ...t === "left-center" && {
89
- ...s,
90
- top: 0,
91
- bottom: 0,
92
- margin: "auto"
93
- },
94
- ...t === "left-bottom" && {
95
- ...s,
96
- bottom: 20
97
- },
98
- ...t === "right-top" && {
99
- ...r,
100
- top: 20
101
- },
102
- ...t === "right-center" && {
103
- ...r,
104
- top: 0,
105
- bottom: 0,
106
- margin: "auto"
107
- },
108
- ...t === "right-bottom" && {
109
- ...r,
110
- bottom: 20
111
- }
112
- };
113
- });
114
- function _({
115
- children: t,
116
- arrowType: n = "top-right",
117
- sx: p,
118
- className: c,
119
- ...o
120
- }) {
121
- return /* @__PURE__ */ m(x, {
122
- className: `m4l_popover ${c || ""}`,
123
- anchorOrigin: {
124
- vertical: "bottom",
125
- horizontal: "right"
126
- },
127
- transformOrigin: {
128
- vertical: "top",
129
- horizontal: "right"
130
- },
131
- PaperProps: {
132
- sx: {
133
- p: 1,
134
- overflow: "inherit",
135
- ...p
136
- }
137
- },
138
- ...o,
139
- children: [n !== "no-arrow" && /* @__PURE__ */ i(y, {
140
- arrowType: n
141
- }), t]
142
- });
143
- }
144
- const z = h("span")(({
145
- theme: t
146
- }) => ({
147
- marginLeft: t.spacing(1)
148
- })), B = h("div")(({
149
- theme: t
150
- }) => ({
151
- padding: t.spacing(0.75, 0),
152
- margin: t.spacing(0, 1.25)
153
- })), M = h("div")(() => ({
154
- display: "flex",
155
- flexDirection: "column"
156
- }));
157
- function T() {
158
- const {
159
- currentLocale: t,
160
- onChangeLocale: n
161
- } = v(), {
162
- domain_token: p
163
- } = L(), {
164
- networkOperation: c
165
- } = k(), [o, a] = d(null), [l, s] = d(!1), [r, f] = d([]), b = (e) => {
166
- console.log("handleOpen", r, l), a(e.currentTarget);
167
- }, u = () => {
168
- a(null);
169
- };
170
- return I(() => {
171
- let e = !0;
172
- if (!(o === null || l || r.length > 0))
173
- return s(!0), c({
174
- method: "GET",
175
- endPoint: "na/locales",
176
- parms: {
177
- domain_token: p
178
- }
179
- }).then((g) => {
180
- console.log("Response", g.data), e && f(g.data);
181
- }).finally(() => {
182
- s(!1);
183
- }), function() {
184
- e = !1;
185
- };
186
- }, [o]), console.log("Render lang", r, l), /* @__PURE__ */ m(R, {
187
- children: [/* @__PURE__ */ i(N, {
188
- className: "m4l_language_popover",
189
- onClick: b,
190
- sx: {
191
- width: 40,
192
- height: 40,
193
- ...o && {
194
- bgcolor: "action.selected"
195
- }
196
- },
197
- src: t?.url_icon || "",
198
- alt: t?.name,
199
- width: "24px",
200
- height: "24px",
201
- skeletonVariant: "circle",
202
- tooltip: "dddd"
203
- }), /* @__PURE__ */ i(_, {
204
- arrowType: "top-right",
205
- open: Boolean(o),
206
- anchorEl: o,
207
- anchorOrigin: {
208
- vertical: "bottom",
209
- horizontal: "right"
210
- },
211
- onClose: u,
212
- sx: {
213
- mt: 1.5,
214
- ml: 0.75,
215
- width: 180,
216
- rowGap: "100px",
217
- "& .MuiMenuItem-root": {
218
- px: 1,
219
- typography: "body2",
220
- borderRadius: 0.75
221
- }
222
- },
223
- children: /* @__PURE__ */ m(M, {
224
- children: [r.length === 0 && /* @__PURE__ */ i(B, {
225
- children: /* @__PURE__ */ i(E, {
226
- size: "20px"
227
- })
228
- }), r.length > 0 && /* @__PURE__ */ i(O, {
229
- spacing: 0.75,
230
- children: r.map((e) => /* @__PURE__ */ m(S, {
231
- selected: e.lang === t?.lang && e?.script === t?.script && e?.region === t?.region,
232
- onClick: () => {
233
- n(e), u();
234
- },
235
- children: [/* @__PURE__ */ i(P, {
236
- alt: e.name,
237
- src: e.url_icon,
238
- width: "24px",
239
- height: "24px"
240
- }), /* @__PURE__ */ i(z, {
241
- children: e.name
242
- })]
243
- }, e.lang || e.script || e.region))
244
- })]
245
- })
246
- })]
247
- });
248
- }
249
- export {
250
- T as L,
251
- _ as P
252
- };
@@ -1,136 +0,0 @@
1
- import { createContext as x, useState as g } from "react";
2
- import { useEnvironment as y, voidFunction as w } from "@m4l/core";
3
- import { Typography as M } from "@mui/material";
4
- import { styled as l } from "@mui/material/styles";
5
- import { B as I } from "../../components/mui_extended/BoxIcon/index.e638ecc8.js";
6
- import { jsx as t, jsxs as p, Fragment as _ } from "react/jsx-runtime";
7
- import { M as k } from "../../components/ModalDialog/index.ad61757f.js";
8
- import { A as $ } from "../../components/CommonActions/components/ActionIntro/index.85557b90.js";
9
- import { A as b } from "../../components/CommonActions/components/ActionCancel/index.431160ba.js";
10
- import { b as A } from "../../utils/index.214d9542.js";
11
- const j = l("div")(() => ({
12
- display: "flex",
13
- flexDirection: "column",
14
- height: "100%"
15
- })), D = l("div")(({
16
- theme: n
17
- }) => ({
18
- display: "flex",
19
- flexDirection: "column",
20
- justifyContent: "center",
21
- alignItems: "center",
22
- gridGap: n.spacing(5),
23
- flexGrow: 1,
24
- [n.breakpoints.up("sm")]: {
25
- display: "grid",
26
- flexDirection: "row",
27
- gridTemplateColumns: "1fr 1fr"
28
- }
29
- })), O = l("div")(({
30
- theme: n,
31
- variant: o
32
- }) => ({
33
- display: "flex",
34
- justifyContent: "center",
35
- alignItems: "center",
36
- "& > span": {
37
- background: o === "warning" ? n.palette.warning.main : o === "delete" ? n.palette.error.main : o === "info" ? n.palette.info.main : "theme.palette.text.primary"
38
- }
39
- })), B = l("div")(() => ({
40
- display: "flex",
41
- alignItems: "center"
42
- })), E = (n) => {
43
- const {
44
- variant: o = "info",
45
- msg: i = "Are you sure you want to perform this action? Once complete, the information will be deleted."
46
- } = n, {
47
- host_static_assets: r,
48
- environment_assets: e
49
- } = y(), c = `${r}/${e}/frontend/components/dialog/assets/icons/illustration_confirm_warning.svg`, m = `${r}/${e}/frontend/components/dialog/assets/icons/illustration_confirm_danger.svg`, s = `${r}/${e}/frontend/components/dialog/assets/icons/illustration_confirm_info.svg`;
50
- return /* @__PURE__ */ t(j, {
51
- children: /* @__PURE__ */ p(D, {
52
- children: [/* @__PURE__ */ t(O, {
53
- variant: o,
54
- children: /* @__PURE__ */ t(I, {
55
- src: o === "warning" ? c : o === "delete" ? m : s,
56
- sx: {
57
- width: "230px",
58
- height: "194px"
59
- }
60
- })
61
- }), /* @__PURE__ */ t(B, {
62
- children: /* @__PURE__ */ t(M, {
63
- variant: "body1",
64
- children: i
65
- })
66
- })]
67
- })
68
- });
69
- }, F = x(null);
70
- function K({
71
- children: n
72
- }) {
73
- const [o, i] = g({
74
- open: !1,
75
- withClose: !0,
76
- onQueryClose: w,
77
- title: "",
78
- iconComponent: void 0,
79
- contentComponent: void 0,
80
- variant: void 0
81
- }), [r, e] = g(!1), c = (a) => {
82
- i({
83
- open: !0,
84
- ...a
85
- });
86
- }, m = (a) => {
87
- const {
88
- variant: d = "warning",
89
- title: u,
90
- msg: h,
91
- onClickIntro: f,
92
- onClickCancel: v = s
93
- } = a;
94
- i({
95
- open: !0,
96
- title: u,
97
- variant: d,
98
- contentComponent: /* @__PURE__ */ t(E, {
99
- variant: d,
100
- msg: h
101
- }),
102
- actions: /* @__PURE__ */ p(_, {
103
- children: [/* @__PURE__ */ t(b, {
104
- onClick: v
105
- }), " ", /* @__PURE__ */ t($, {
106
- onClick: () => {
107
- f && f(), s();
108
- },
109
- color: A(d)
110
- })]
111
- })
112
- });
113
- }, s = () => {
114
- i((a) => ({
115
- ...a,
116
- open: !1
117
- })), e(!1);
118
- }, C = () => {
119
- e(!0);
120
- };
121
- return /* @__PURE__ */ p(F.Provider, {
122
- value: {
123
- ...o,
124
- openModal: c,
125
- openModalConfirm: m,
126
- closeModal: s,
127
- hasChanges: r,
128
- setChanges: C
129
- },
130
- children: [n, /* @__PURE__ */ t(k, {})]
131
- });
132
- }
133
- export {
134
- F as M,
135
- K as a
136
- };
@@ -1,11 +0,0 @@
1
- import { useContext as t } from "react";
2
- import { M as e } from "../../contexts/ModalContext/index.9ebc793c.js";
3
- function s() {
4
- const o = t(e);
5
- if (!o)
6
- throw new Error("useModal context must be use inside ModalContext");
7
- return o;
8
- }
9
- export {
10
- s as u
11
- };