@m4l/layouts 0.1.9 → 0.1.10
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.
- package/hooks/useMasterDetail/{index.32172709.js → index.ca232c69.js} +1 -1
- package/hooks/useModule/{index.5ec82e11.js → index.066da119.js} +1 -1
- package/index.js +4 -4
- package/layouts/MasterDetailLayout/{index.93d98363.js → index.56544ac9.js} +2 -2
- package/layouts/ModuleLayout/{index.76b867fc.js → index.4cfb7261.js} +96 -99
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { a as p, d as l, g as y } from "./layouts/ModuleLayout/index.
|
|
1
|
+
import { a as p, d as l, g as y } from "./layouts/ModuleLayout/index.4cfb7261.js";
|
|
2
2
|
import "@m4l/components";
|
|
3
3
|
import "react";
|
|
4
4
|
import "@m4l/core";
|
|
5
|
-
import { a as n, d as M, g as D } from "./layouts/MasterDetailLayout/index.
|
|
5
|
+
import { a as n, d as M, g as D } from "./layouts/MasterDetailLayout/index.56544ac9.js";
|
|
6
6
|
import "@m4l/graphics";
|
|
7
7
|
import "@mui/material";
|
|
8
8
|
import "react/jsx-runtime";
|
|
9
9
|
import { N as L, d as c, g } from "./layouts/NoAuthModuleLayout/index.5050b988.js";
|
|
10
|
-
import { u as N } from "./hooks/useMasterDetail/index.
|
|
11
|
-
import { u as A } from "./hooks/useModule/index.
|
|
10
|
+
import { u as N } from "./hooks/useMasterDetail/index.ca232c69.js";
|
|
11
|
+
import { u as A } from "./hooks/useModule/index.066da119.js";
|
|
12
12
|
import "@mui/material/styles";
|
|
13
13
|
export {
|
|
14
14
|
n as MasterDetailLayout,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { createContext as L, useState as v, useRef as P, useCallback as z, useMemo as p } from "react";
|
|
2
2
|
import { voidFunction as N, useEnvironment as x } from "@m4l/core";
|
|
3
3
|
import { SplitLayout as R } from "@m4l/components";
|
|
4
|
-
import { g as B, a as V } from "../ModuleLayout/index.
|
|
4
|
+
import { g as B, a as V } from "../ModuleLayout/index.4cfb7261.js";
|
|
5
5
|
import { jsx as r } from "react/jsx-runtime";
|
|
6
6
|
import { useResponsiveDesktop as j } from "@m4l/graphics";
|
|
7
7
|
import { Button as E } from "@mui/material";
|
|
8
|
-
import { u as H } from "../../hooks/useMasterDetail/index.
|
|
8
|
+
import { u as H } from "../../hooks/useMasterDetail/index.ca232c69.js";
|
|
9
9
|
function T() {
|
|
10
10
|
return ["master_detail_layout"].concat(B());
|
|
11
11
|
}
|
|
@@ -1,167 +1,164 @@
|
|
|
1
|
-
import { BoxIcon as y, Breadcrumbs as T, MenuActions as
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { styled as d, useTheme as
|
|
4
|
-
import { voidFunction as
|
|
5
|
-
import { Skeleton as l, Typography as
|
|
1
|
+
import { BoxIcon as y, Breadcrumbs as T, MenuActions as A, useModal as D, ModalProvider as F, getModalDialogComponentsDictionary as L } from "@m4l/components";
|
|
2
|
+
import { createContext as N, useState as x, useMemo as f, forwardRef as M, useRef as b, useImperativeHandle as w } from "react";
|
|
3
|
+
import { styled as d, useTheme as R } from "@mui/material/styles";
|
|
4
|
+
import { voidFunction as S, useModuleDictionary as $, useModuleSkeleton as P, FlagsProvider as _, ModuleDictionaryProvider as B, ModuleSkeletonProvider as H, ModulePrivilegesProvider as G } from "@m4l/core";
|
|
5
|
+
import { Skeleton as l, Typography as j, IconButton as O } from "@mui/material";
|
|
6
6
|
import { useResponsiveDesktop as k } from "@m4l/graphics";
|
|
7
|
-
import { jsxs as p, jsx as
|
|
8
|
-
import { u as z } from "../../hooks/useModule/index.
|
|
7
|
+
import { jsxs as p, jsx as i, Fragment as W } from "react/jsx-runtime";
|
|
8
|
+
import { u as z } from "../../hooks/useModule/index.066da119.js";
|
|
9
9
|
const q = d("div")(() => ({
|
|
10
10
|
display: "flex",
|
|
11
11
|
flexDirection: "column",
|
|
12
12
|
position: "absolute",
|
|
13
|
-
margin: "12px",
|
|
13
|
+
margin: "0px 12px 12px 12px",
|
|
14
14
|
left: "0px",
|
|
15
15
|
right: "0px",
|
|
16
16
|
top: "0px",
|
|
17
17
|
bottom: "0px",
|
|
18
18
|
overflow: "hidden"
|
|
19
19
|
})), K = d("div")(({
|
|
20
|
-
theme:
|
|
20
|
+
theme: e
|
|
21
21
|
}) => ({
|
|
22
22
|
display: "flex",
|
|
23
23
|
position: "relative",
|
|
24
|
-
marginTop:
|
|
24
|
+
marginTop: e.spacing(1),
|
|
25
|
+
justifyContent: "center",
|
|
25
26
|
flexGrow: "1",
|
|
26
27
|
overflow: "hidden"
|
|
27
28
|
})), E = d("div")(({
|
|
28
|
-
theme:
|
|
29
|
+
theme: e
|
|
29
30
|
}) => ({
|
|
30
31
|
display: "flex",
|
|
31
32
|
position: "relative",
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
height: "72px",
|
|
36
|
-
overflow: "hidden",
|
|
33
|
+
borderBottom: `1px solid ${e.palette.divider}`,
|
|
34
|
+
height: "60px",
|
|
35
|
+
minHeight: "60px",
|
|
37
36
|
alignItems: "center",
|
|
38
37
|
" > span": {
|
|
39
38
|
marginRight: "12px"
|
|
40
39
|
},
|
|
41
40
|
"& > h5": {
|
|
42
|
-
paddingRight:
|
|
43
|
-
borderRight: `1px solid ${
|
|
41
|
+
paddingRight: e.spacing(3),
|
|
42
|
+
borderRight: `1px solid ${e.palette.divider}`
|
|
44
43
|
},
|
|
45
44
|
" > nav": {
|
|
46
45
|
marginRight: "12px",
|
|
47
46
|
flexGrow: 1
|
|
48
47
|
},
|
|
49
48
|
"& .splitactions.Mui-disabled": {
|
|
50
|
-
color:
|
|
49
|
+
color: e.palette.primary.main
|
|
51
50
|
},
|
|
52
51
|
"& svg ": {
|
|
53
52
|
width: "20px",
|
|
54
53
|
height: "20px"
|
|
55
54
|
}
|
|
56
55
|
})), J = d("div")(({
|
|
57
|
-
theme:
|
|
56
|
+
theme: e
|
|
58
57
|
}) => ({
|
|
59
58
|
display: "flex",
|
|
60
59
|
justifyContent: "space-between",
|
|
61
|
-
padding:
|
|
62
|
-
borderBottom: `1px solid ${
|
|
63
|
-
|
|
64
|
-
[i.breakpoints.up("sm")]: {
|
|
65
|
-
height: i.spacing(9)
|
|
66
|
-
}
|
|
60
|
+
padding: "0 0",
|
|
61
|
+
borderBottom: `1px solid ${e.palette.divider}`,
|
|
62
|
+
minHeight: "60px"
|
|
67
63
|
})), Q = d("div")(({
|
|
68
|
-
theme:
|
|
64
|
+
theme: e
|
|
69
65
|
}) => ({
|
|
70
66
|
display: "grid",
|
|
71
67
|
gridTemplateColumns: "auto",
|
|
72
|
-
gridGap:
|
|
68
|
+
gridGap: e.spacing(1.75),
|
|
73
69
|
alignItems: "center",
|
|
74
70
|
width: "auto",
|
|
75
71
|
height: "auto",
|
|
76
|
-
[
|
|
72
|
+
[e.breakpoints.up("sm")]: {
|
|
77
73
|
gridTemplateColumns: "repeat(3, auto)"
|
|
78
74
|
}
|
|
79
75
|
})), U = d("div")(({
|
|
80
|
-
theme:
|
|
76
|
+
theme: e
|
|
81
77
|
}) => ({
|
|
82
78
|
display: "grid",
|
|
83
|
-
gridTemplateColumns: `${
|
|
84
|
-
gridGap:
|
|
79
|
+
gridTemplateColumns: `${e.spacing(3)} auto`,
|
|
80
|
+
gridGap: e.spacing(2),
|
|
85
81
|
alignItems: "center",
|
|
86
82
|
width: "auto",
|
|
87
83
|
height: "auto"
|
|
88
84
|
})), V = d("div")(({
|
|
89
|
-
theme:
|
|
85
|
+
theme: e
|
|
90
86
|
}) => ({
|
|
91
87
|
display: "none",
|
|
92
88
|
alignItems: "center",
|
|
93
89
|
width: "1px",
|
|
94
|
-
background:
|
|
90
|
+
background: e.palette.divider,
|
|
95
91
|
height: "100%",
|
|
96
|
-
margin: `0 ${
|
|
97
|
-
[
|
|
92
|
+
margin: `0 ${e.spacing(2)}`,
|
|
93
|
+
[e.breakpoints.up("sm")]: {
|
|
98
94
|
display: "flex"
|
|
99
95
|
}
|
|
100
96
|
})), X = d("div")(({
|
|
101
|
-
theme:
|
|
97
|
+
theme: e
|
|
102
98
|
}) => ({
|
|
103
99
|
display: "grid",
|
|
104
100
|
alignItems: "center",
|
|
105
101
|
gridTemplateColumns: "repeat(3, auto)",
|
|
106
|
-
gridGap:
|
|
102
|
+
gridGap: e.spacing(2)
|
|
107
103
|
})), Y = d("div")(({
|
|
108
|
-
theme:
|
|
104
|
+
theme: e
|
|
109
105
|
}) => ({
|
|
110
106
|
display: "grid",
|
|
111
107
|
gridTemplateColumns: "auto",
|
|
112
108
|
alignItems: "center",
|
|
113
109
|
width: "auto",
|
|
114
110
|
height: "auto",
|
|
115
|
-
[
|
|
116
|
-
gridTemplateColumns: `repeat(3, ${
|
|
117
|
-
gridGap:
|
|
111
|
+
[e.breakpoints.up("sm")]: {
|
|
112
|
+
gridTemplateColumns: `repeat(3, ${e.spacing(3)})`,
|
|
113
|
+
gridGap: e.spacing(2)
|
|
118
114
|
}
|
|
119
115
|
}));
|
|
120
116
|
function Z() {
|
|
121
|
-
const
|
|
117
|
+
const e = k();
|
|
122
118
|
return /* @__PURE__ */ p(J, {
|
|
119
|
+
id: "HeaderSkeleton",
|
|
123
120
|
children: [/* @__PURE__ */ p(Q, {
|
|
124
121
|
children: [/* @__PURE__ */ p(U, {
|
|
125
|
-
children: [/* @__PURE__ */
|
|
122
|
+
children: [/* @__PURE__ */ i(l, {
|
|
126
123
|
variant: "circular",
|
|
127
124
|
width: 24,
|
|
128
125
|
height: 24
|
|
129
|
-
}), /* @__PURE__ */
|
|
126
|
+
}), /* @__PURE__ */ i(l, {
|
|
130
127
|
variant: "text",
|
|
131
128
|
width: 120,
|
|
132
129
|
height: 14
|
|
133
130
|
})]
|
|
134
|
-
}), /* @__PURE__ */
|
|
135
|
-
children: [/* @__PURE__ */
|
|
131
|
+
}), /* @__PURE__ */ i(V, {}), /* @__PURE__ */ p(X, {
|
|
132
|
+
children: [/* @__PURE__ */ i(l, {
|
|
136
133
|
variant: "text",
|
|
137
134
|
width: 68,
|
|
138
135
|
height: 14
|
|
139
|
-
}), /* @__PURE__ */
|
|
136
|
+
}), /* @__PURE__ */ i(l, {
|
|
140
137
|
variant: "circular",
|
|
141
138
|
width: 4,
|
|
142
139
|
height: 4
|
|
143
|
-
}), /* @__PURE__ */
|
|
140
|
+
}), /* @__PURE__ */ i(l, {
|
|
144
141
|
variant: "text",
|
|
145
142
|
width: 68,
|
|
146
143
|
height: 14
|
|
147
144
|
})]
|
|
148
145
|
})]
|
|
149
|
-
}), /* @__PURE__ */
|
|
150
|
-
children:
|
|
151
|
-
children: [/* @__PURE__ */
|
|
146
|
+
}), /* @__PURE__ */ i(Y, {
|
|
147
|
+
children: e ? /* @__PURE__ */ p(W, {
|
|
148
|
+
children: [/* @__PURE__ */ i(l, {
|
|
152
149
|
variant: "circular",
|
|
153
150
|
width: 24,
|
|
154
151
|
height: 24
|
|
155
|
-
}), /* @__PURE__ */
|
|
152
|
+
}), /* @__PURE__ */ i(l, {
|
|
156
153
|
variant: "circular",
|
|
157
154
|
width: 24,
|
|
158
155
|
height: 24
|
|
159
|
-
}), /* @__PURE__ */
|
|
156
|
+
}), /* @__PURE__ */ i(l, {
|
|
160
157
|
variant: "circular",
|
|
161
158
|
width: 24,
|
|
162
159
|
height: 24
|
|
163
160
|
})]
|
|
164
|
-
}) : /* @__PURE__ */
|
|
161
|
+
}) : /* @__PURE__ */ i(l, {
|
|
165
162
|
variant: "circular",
|
|
166
163
|
width: 24,
|
|
167
164
|
height: 24
|
|
@@ -169,16 +166,16 @@ function Z() {
|
|
|
169
166
|
})]
|
|
170
167
|
});
|
|
171
168
|
}
|
|
172
|
-
const
|
|
169
|
+
const ee = {
|
|
173
170
|
moduleId: "",
|
|
174
171
|
moduleNameField: "module_name",
|
|
175
172
|
urlIcon: "",
|
|
176
173
|
moduleActions: [],
|
|
177
174
|
dynamicActions: [],
|
|
178
|
-
setDynamicActions:
|
|
175
|
+
setDynamicActions: S,
|
|
179
176
|
breadcrumbLinks: []
|
|
180
|
-
},
|
|
181
|
-
function
|
|
177
|
+
}, ie = N(ee);
|
|
178
|
+
function te(e) {
|
|
182
179
|
const {
|
|
183
180
|
children: n,
|
|
184
181
|
initialModuleActions: t,
|
|
@@ -186,14 +183,14 @@ function ti(i) {
|
|
|
186
183
|
moduleNameField: a,
|
|
187
184
|
urlIcon: g,
|
|
188
185
|
breadcrumbLinks: s
|
|
189
|
-
} =
|
|
186
|
+
} = e, [c] = x(() => ({
|
|
190
187
|
moduleId: o,
|
|
191
188
|
urlIcon: g,
|
|
192
189
|
moduleNameField: a,
|
|
193
190
|
dictionary: void 0,
|
|
194
191
|
breadcrumbLinks: s
|
|
195
192
|
})), [u, h] = x([]), r = f(() => t.concat(u), [t, u]);
|
|
196
|
-
return /* @__PURE__ */
|
|
193
|
+
return /* @__PURE__ */ i(ie.Provider, {
|
|
197
194
|
value: {
|
|
198
195
|
moduleActions: r,
|
|
199
196
|
dynamicActions: u,
|
|
@@ -206,34 +203,34 @@ function ti(i) {
|
|
|
206
203
|
children: n
|
|
207
204
|
});
|
|
208
205
|
}
|
|
209
|
-
function
|
|
206
|
+
function oe(e, n) {
|
|
210
207
|
let t = [...n.filter((o) => o.visibility !== "allways")];
|
|
211
|
-
return
|
|
208
|
+
return e !== void 0 && e && (t = t.filter((o) => o.visibility === "normal")), t;
|
|
212
209
|
}
|
|
213
|
-
function
|
|
210
|
+
function ne(e, n) {
|
|
214
211
|
let t = [];
|
|
215
|
-
return
|
|
212
|
+
return e !== void 0 && e && (t = t.concat(n.filter((o) => o.visibility === "main"))), t = t.concat(n.filter((o) => o.visibility === "allways")), t;
|
|
216
213
|
}
|
|
217
|
-
function
|
|
214
|
+
function re() {
|
|
218
215
|
const {
|
|
219
|
-
moduleActions:
|
|
216
|
+
moduleActions: e,
|
|
220
217
|
moduleNameField: n,
|
|
221
218
|
breadcrumbLinks: t,
|
|
222
219
|
urlIcon: o
|
|
223
220
|
} = z(), {
|
|
224
221
|
getLabel: a
|
|
225
|
-
} =
|
|
226
|
-
() =>
|
|
227
|
-
[
|
|
228
|
-
), h = f(() =>
|
|
229
|
-
return c ? /* @__PURE__ */
|
|
222
|
+
} = $(), g = R(), s = k(), c = P(), u = f(
|
|
223
|
+
() => oe(s, e),
|
|
224
|
+
[e, s]
|
|
225
|
+
), h = f(() => ne(s, e), [e, s]);
|
|
226
|
+
return c ? /* @__PURE__ */ i(Z, {}) : /* @__PURE__ */ p(E, {
|
|
230
227
|
id: "Header",
|
|
231
|
-
children: [/* @__PURE__ */
|
|
228
|
+
children: [/* @__PURE__ */ i(y, {
|
|
232
229
|
src: o,
|
|
233
230
|
sx: {
|
|
234
231
|
color: g.palette.primary.main
|
|
235
232
|
}
|
|
236
|
-
}), /* @__PURE__ */
|
|
233
|
+
}), /* @__PURE__ */ i(j, {
|
|
237
234
|
variant: "h5",
|
|
238
235
|
sx: {
|
|
239
236
|
maxWidth: 260,
|
|
@@ -244,19 +241,19 @@ function ri() {
|
|
|
244
241
|
textOverflow: "ellipsis"
|
|
245
242
|
},
|
|
246
243
|
children: a(n)
|
|
247
|
-
}), /* @__PURE__ */
|
|
244
|
+
}), /* @__PURE__ */ i(T, {
|
|
248
245
|
links: t
|
|
249
246
|
}), h.map((r, m) => {
|
|
250
247
|
const v = a(r.dictionaryField);
|
|
251
|
-
return r.component ? /* @__PURE__ */
|
|
248
|
+
return r.component ? /* @__PURE__ */ i(r.component, {
|
|
252
249
|
description: v,
|
|
253
250
|
onClick: r.onClick
|
|
254
|
-
}, `main_action_${m}`) : /* @__PURE__ */
|
|
251
|
+
}, `main_action_${m}`) : /* @__PURE__ */ i(O, {
|
|
255
252
|
className: r.className,
|
|
256
253
|
onClick: r.onClick,
|
|
257
254
|
"aria-label": `${v}`,
|
|
258
255
|
disabled: r.disabled,
|
|
259
|
-
children: /* @__PURE__ */
|
|
256
|
+
children: /* @__PURE__ */ i(y, {
|
|
260
257
|
src: r.urlIcon,
|
|
261
258
|
sx: {
|
|
262
259
|
width: 18,
|
|
@@ -264,7 +261,7 @@ function ri() {
|
|
|
264
261
|
}
|
|
265
262
|
})
|
|
266
263
|
}, `main_action_${m}`);
|
|
267
|
-
}), u.length > 0 && /* @__PURE__ */
|
|
264
|
+
}), u.length > 0 && /* @__PURE__ */ i(A, {
|
|
268
265
|
arrow: "right-top",
|
|
269
266
|
marginTop: "-11px",
|
|
270
267
|
anchorOrigin: {
|
|
@@ -279,26 +276,26 @@ function ri() {
|
|
|
279
276
|
})]
|
|
280
277
|
});
|
|
281
278
|
}
|
|
282
|
-
const I = M((
|
|
279
|
+
const I = M((e, n) => {
|
|
283
280
|
const {
|
|
284
281
|
children: t
|
|
285
|
-
} =
|
|
282
|
+
} = e, {
|
|
286
283
|
openModal: o
|
|
287
|
-
} =
|
|
284
|
+
} = D(), a = b(null);
|
|
288
285
|
return w(n, () => ({
|
|
289
286
|
openModal: o,
|
|
290
287
|
current: a.current
|
|
291
288
|
})), /* @__PURE__ */ p(q, {
|
|
292
289
|
id: "WrapperModule",
|
|
293
290
|
ref: a,
|
|
294
|
-
children: [/* @__PURE__ */
|
|
291
|
+
children: [/* @__PURE__ */ i(re, {}), /* @__PURE__ */ i(K, {
|
|
295
292
|
id: "ModuleContent",
|
|
296
293
|
children: t
|
|
297
294
|
})]
|
|
298
295
|
});
|
|
299
296
|
});
|
|
300
297
|
I.displayName = "Module";
|
|
301
|
-
const
|
|
298
|
+
const ae = M((e, n) => {
|
|
302
299
|
const {
|
|
303
300
|
moduleId: t,
|
|
304
301
|
moduleNameField: o = "module_name",
|
|
@@ -309,28 +306,28 @@ const ai = M((i, n) => {
|
|
|
309
306
|
breadcrumbLinks: u,
|
|
310
307
|
privileges: h,
|
|
311
308
|
skeletonFlags: r
|
|
312
|
-
} =
|
|
309
|
+
} = e, m = b(null), v = (C) => {
|
|
313
310
|
m.current?.openModal(C);
|
|
314
311
|
};
|
|
315
312
|
return w(n, () => ({
|
|
316
313
|
openModal: v,
|
|
317
314
|
current: m.current
|
|
318
|
-
})), /* @__PURE__ */
|
|
319
|
-
children: /* @__PURE__ */
|
|
315
|
+
})), /* @__PURE__ */ i(_, {
|
|
316
|
+
children: /* @__PURE__ */ i(B, {
|
|
320
317
|
moduleId: t,
|
|
321
318
|
componentsDictionary: c,
|
|
322
|
-
children: /* @__PURE__ */
|
|
319
|
+
children: /* @__PURE__ */ i(H, {
|
|
323
320
|
flags: r,
|
|
324
|
-
children: /* @__PURE__ */
|
|
321
|
+
children: /* @__PURE__ */ i(G, {
|
|
325
322
|
queryPrivileges: h,
|
|
326
|
-
children: /* @__PURE__ */
|
|
323
|
+
children: /* @__PURE__ */ i(te, {
|
|
327
324
|
moduleId: t,
|
|
328
325
|
urlIcon: g,
|
|
329
326
|
moduleNameField: o,
|
|
330
327
|
initialModuleActions: a,
|
|
331
328
|
breadcrumbLinks: u,
|
|
332
|
-
children: /* @__PURE__ */
|
|
333
|
-
children: /* @__PURE__ */
|
|
329
|
+
children: /* @__PURE__ */ i(F, {
|
|
330
|
+
children: /* @__PURE__ */ i(I, {
|
|
334
331
|
ref: m,
|
|
335
332
|
children: s
|
|
336
333
|
})
|
|
@@ -341,16 +338,16 @@ const ai = M((i, n) => {
|
|
|
341
338
|
})
|
|
342
339
|
});
|
|
343
340
|
});
|
|
344
|
-
|
|
345
|
-
function
|
|
341
|
+
ae.displayName = "ModuleLayout";
|
|
342
|
+
function he() {
|
|
346
343
|
return ["module_layout"].concat(L());
|
|
347
344
|
}
|
|
348
|
-
const
|
|
345
|
+
const ve = {
|
|
349
346
|
module_layout: {}
|
|
350
347
|
};
|
|
351
348
|
export {
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
349
|
+
ie as M,
|
|
350
|
+
ae as a,
|
|
351
|
+
ve as d,
|
|
352
|
+
he as g
|
|
356
353
|
};
|