@m4l/layouts 0.1.12 → 0.1.13

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.
@@ -1,5 +1,5 @@
1
1
  import { useContext as t } from "react";
2
- import { M as e } from "../../layouts/MasterDetailLayout/index.a35e475f.js";
2
+ import { M as e } from "../../layouts/MasterDetailLayout/index.932fdce8.js";
3
3
  const s = () => t(e);
4
4
  export {
5
5
  s as u
@@ -1,5 +1,5 @@
1
1
  import { useContext as o } from "react";
2
- import { M as t } from "../../layouts/ModuleLayout/index.fe7cec18.js";
2
+ import { M as t } from "../../layouts/ModuleLayout/index.842072c5.js";
3
3
  const n = () => {
4
4
  const e = o(t);
5
5
  if (!e)
package/index.js CHANGED
@@ -1,14 +1,14 @@
1
- import { a as p, d as l, g as y } from "./layouts/ModuleLayout/index.fe7cec18.js";
1
+ import { a as p, d as l, g as y } from "./layouts/ModuleLayout/index.842072c5.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.a35e475f.js";
5
+ import { a as n, d as M, g as D } from "./layouts/MasterDetailLayout/index.932fdce8.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.798fbe31.js";
10
- import { u as N } from "./hooks/useMasterDetail/index.d5830f95.js";
11
- import { u as A } from "./hooks/useModule/index.f9e8dfff.js";
10
+ import { u as N } from "./hooks/useMasterDetail/index.7d7b413d.js";
11
+ import { u as A } from "./hooks/useModule/index.096d7d13.js";
12
12
  import "@mui/material/styles";
13
13
  export {
14
14
  n as MasterDetailLayout,
@@ -1,30 +1,30 @@
1
- import { createContext as L, useState as v, useRef as P, useCallback as z, useMemo as p } from "react";
2
- import { voidFunction as N, useEnvironment as x } from "@m4l/core";
3
- import { SplitLayout as R } from "@m4l/components";
4
- import { g as B, a as V } from "../ModuleLayout/index.fe7cec18.js";
1
+ import { createContext as P, useState as v, useRef as z, useCallback as N, useMemo as p } from "react";
2
+ import { voidFunction as x, useEnvironment as R } from "@m4l/core";
3
+ import { SplitLayout as B } from "@m4l/components";
4
+ import { g as V, a as j } from "../ModuleLayout/index.842072c5.js";
5
5
  import { jsx as r } from "react/jsx-runtime";
6
- import { useResponsiveDesktop as j } from "@m4l/graphics";
7
- import { Button as E } from "@mui/material";
8
- import { u as H } from "../../hooks/useMasterDetail/index.d5830f95.js";
9
- function T() {
10
- return ["master_detail_layout"].concat(B());
6
+ import { useResponsiveDesktop as E } from "@m4l/graphics";
7
+ import { Button as H } from "@mui/material";
8
+ import { u as T } from "../../hooks/useMasterDetail/index.7d7b413d.js";
9
+ function W() {
10
+ return ["master_detail_layout"].concat(V());
11
11
  }
12
- const ot = {
12
+ const et = {
13
13
  master_detail_layout: {
14
14
  split_vertical: "Split vertically",
15
15
  split_horizontal: "Split horizontally",
16
16
  no_split: "No split",
17
17
  view_detail: "View detail"
18
18
  }
19
- }, W = {
19
+ }, q = {
20
20
  masterSelection: void 0,
21
- onChangeMasterSelection: N
22
- }, q = L(W);
23
- function G(i) {
21
+ onChangeMasterSelection: x
22
+ }, G = P(q);
23
+ function J(i) {
24
24
  const {
25
25
  children: o
26
26
  } = i, [e, t] = v(void 0);
27
- return /* @__PURE__ */ r(q.Provider, {
27
+ return /* @__PURE__ */ r(G.Provider, {
28
28
  value: {
29
29
  masterSelection: e,
30
30
  onChangeMasterSelection: t
@@ -32,25 +32,25 @@ function G(i) {
32
32
  children: o
33
33
  });
34
34
  }
35
- function J(i) {
35
+ function K(i) {
36
36
  const {
37
37
  masterSelection: o
38
- } = H(), {
38
+ } = T(), {
39
39
  onClick: e,
40
40
  description: t
41
41
  } = i;
42
- return /* @__PURE__ */ r(E, {
42
+ return /* @__PURE__ */ r(H, {
43
43
  onClick: e,
44
44
  variant: "outlined",
45
45
  disabled: o === void 0,
46
46
  children: t
47
47
  }, "miDetail");
48
48
  }
49
- function K(i, o, e, t) {
49
+ function O(i, o, e, t) {
50
50
  let n = t !== void 0 && t ? [...i] : [e];
51
51
  return n = o.concat(n), n;
52
52
  }
53
- function et(i) {
53
+ function nt(i) {
54
54
  const {
55
55
  moduleId: o,
56
56
  moduleNameField: e,
@@ -58,18 +58,19 @@ function et(i) {
58
58
  moduleActions: n,
59
59
  urlIcon: D,
60
60
  masterComponent: M,
61
+ currentLang: S,
61
62
  componentsDictionary: y,
62
- breadcrumbLinks: S,
63
- privileges: b,
64
- skeletonFlags: k
63
+ breadcrumbLinks: b,
64
+ privileges: k,
65
+ skeletonFlags: A
65
66
  } = i, {
66
67
  host_static_assets: c,
67
68
  environment_assets: a
68
- } = x(), [A, w] = v("vertical"), d = j(), f = P(null), u = (m) => {
69
+ } = R(), [w, L] = v("vertical"), d = E(), f = z(null), u = (m) => {
69
70
  const s = [..._];
70
71
  for (let l = 0; l < s.length; l++)
71
72
  s[l].disabled = !1, s[l].tag === m && (s[l].disabled = !0);
72
- $(s), w(m);
73
+ $(s), L(m);
73
74
  }, _ = [{
74
75
  urlIcon: `${c}/${a}/frontend/components/masterdetaillayout/assets/icons/split_vertical.svg`,
75
76
  onClick: () => u("vertical"),
@@ -94,7 +95,7 @@ function et(i) {
94
95
  dictionaryField: "master_detail_layout.no_split",
95
96
  tag: "none",
96
97
  className: "splitactions"
97
- }], g = z(() => {
98
+ }], g = N(() => {
98
99
  f.current?.openModal({
99
100
  title: "master_detail_layout.view_detail",
100
101
  initialWidth: 500,
@@ -110,21 +111,22 @@ function et(i) {
110
111
  dictionaryField: "master_detail_layout.view_detail",
111
112
  tag: "none",
112
113
  className: "",
113
- component: J
114
- }), [a, g]), [h, $] = v(_), F = p(() => K(h, n, C, d), [h, n, d, C]), I = p(() => y.concat(T()), [y]);
115
- return /* @__PURE__ */ r(G, {
116
- children: /* @__PURE__ */ r(V, {
114
+ component: K
115
+ }), [a, g]), [h, $] = v(_), F = p(() => O(h, n, C, d), [h, n, d, C]), I = p(() => y.concat(W()), [y]);
116
+ return /* @__PURE__ */ r(J, {
117
+ children: /* @__PURE__ */ r(j, {
117
118
  ref: f,
118
119
  moduleId: o,
119
120
  moduleNameField: e,
120
121
  urlIcon: D,
121
122
  moduleActions: F,
122
- privileges: b,
123
- skeletonFlags: k,
123
+ privileges: k,
124
+ skeletonFlags: A,
125
+ currentLang: S,
124
126
  componentsDictionary: I,
125
- breadcrumbLinks: S,
126
- children: /* @__PURE__ */ r(R, {
127
- splitPosition: d ? A : "none",
127
+ breadcrumbLinks: b,
128
+ children: /* @__PURE__ */ r(B, {
129
+ splitPosition: d ? w : "none",
128
130
  firstPart: M,
129
131
  secondPart: t
130
132
  })
@@ -132,8 +134,8 @@ function et(i) {
132
134
  });
133
135
  }
134
136
  export {
135
- q as M,
136
- et as a,
137
- ot as d,
138
- T as g
137
+ G as M,
138
+ nt as a,
139
+ et as d,
140
+ W as g
139
141
  };
@@ -1,12 +1,12 @@
1
- import { Icon as C, Breadcrumbs as T, BoxIcon as L, MenuActions as D, useModal as N, ModalProvider as R, getModalDialogComponentsDictionary as $ } from "@m4l/components";
2
- import { createContext as F, useState as f, useMemo as v, forwardRef as y, useRef as x, useImperativeHandle as M } from "react";
1
+ import { Icon as T, Breadcrumbs as L, BoxIcon as D, MenuActions as N, useModal as R, ModalProvider as $, getModalDialogComponentsDictionary as F } from "@m4l/components";
2
+ import { createContext as P, useState as y, useMemo as f, forwardRef as x, useRef as M, useImperativeHandle as b } from "react";
3
3
  import { styled as s } from "@mui/material/styles";
4
- import { useModuleDictionary as P, useModuleSkeleton as S, FlagsProvider as _, ModuleDictionaryProvider as A, ModuleSkeletonProvider as B, ModulePrivilegesProvider as H } from "@m4l/core";
5
- import { Skeleton as d, Typography as G, IconButton as j } from "@mui/material";
6
- import { useResponsiveDesktop as b } from "@m4l/graphics";
7
- import { jsxs as p, jsx as i, Fragment as O } from "react/jsx-runtime";
8
- import { u as W } from "../../hooks/useModule/index.f9e8dfff.js";
9
- const z = s("div")(() => ({
4
+ import { useModuleDictionary as S, useModuleSkeleton as _, FlagsProvider as A, ModuleDictionaryProvider as B, ModuleSkeletonProvider as H, ModulePrivilegesProvider as G } from "@m4l/core";
5
+ import { Skeleton as d, Typography as j, IconButton as O } from "@mui/material";
6
+ import { useResponsiveDesktop as w } from "@m4l/graphics";
7
+ import { jsxs as p, jsx as i, Fragment as W } from "react/jsx-runtime";
8
+ import { u as z } from "../../hooks/useModule/index.096d7d13.js";
9
+ const q = s("div")(() => ({
10
10
  display: "flex",
11
11
  flexDirection: "column",
12
12
  position: "absolute",
@@ -16,7 +16,7 @@ const z = s("div")(() => ({
16
16
  top: "0px",
17
17
  bottom: "0px",
18
18
  overflow: "hidden"
19
- })), q = s("div")(({
19
+ })), K = s("div")(({
20
20
  theme: e
21
21
  }) => ({
22
22
  display: "flex",
@@ -25,7 +25,7 @@ const z = s("div")(() => ({
25
25
  justifyContent: "center",
26
26
  flexGrow: "1",
27
27
  overflow: "hidden"
28
- })), K = s("div")(({
28
+ })), E = s("div")(({
29
29
  theme: e
30
30
  }) => ({
31
31
  display: "flex",
@@ -52,7 +52,7 @@ const z = s("div")(() => ({
52
52
  width: "20px",
53
53
  height: "20px"
54
54
  }
55
- })), E = s("div")(({
55
+ })), J = s("div")(({
56
56
  theme: e
57
57
  }) => ({
58
58
  display: "flex",
@@ -60,7 +60,7 @@ const z = s("div")(() => ({
60
60
  padding: "0 0",
61
61
  borderBottom: `1px solid ${e.palette.divider}`,
62
62
  minHeight: "60px"
63
- })), J = s("div")(({
63
+ })), Q = s("div")(({
64
64
  theme: e
65
65
  }) => ({
66
66
  display: "grid",
@@ -72,7 +72,7 @@ const z = s("div")(() => ({
72
72
  [e.breakpoints.up("sm")]: {
73
73
  gridTemplateColumns: "repeat(3, auto)"
74
74
  }
75
- })), Q = s("div")(({
75
+ })), U = s("div")(({
76
76
  theme: e
77
77
  }) => ({
78
78
  display: "grid",
@@ -81,7 +81,7 @@ const z = s("div")(() => ({
81
81
  alignItems: "center",
82
82
  width: "auto",
83
83
  height: "auto"
84
- })), U = s("div")(({
84
+ })), V = s("div")(({
85
85
  theme: e
86
86
  }) => ({
87
87
  display: "none",
@@ -93,14 +93,14 @@ const z = s("div")(() => ({
93
93
  [e.breakpoints.up("sm")]: {
94
94
  display: "flex"
95
95
  }
96
- })), V = s("div")(({
96
+ })), X = s("div")(({
97
97
  theme: e
98
98
  }) => ({
99
99
  display: "grid",
100
100
  alignItems: "center",
101
101
  gridTemplateColumns: "repeat(3, auto)",
102
102
  gridGap: e.spacing(2)
103
- })), X = s("div")(({
103
+ })), Y = s("div")(({
104
104
  theme: e
105
105
  }) => ({
106
106
  display: "grid",
@@ -113,12 +113,12 @@ const z = s("div")(() => ({
113
113
  gridGap: e.spacing(2)
114
114
  }
115
115
  }));
116
- function Y() {
117
- const e = b();
118
- return /* @__PURE__ */ p(E, {
116
+ function Z() {
117
+ const e = w();
118
+ return /* @__PURE__ */ p(J, {
119
119
  id: "HeaderSkeleton",
120
- children: [/* @__PURE__ */ p(J, {
121
- children: [/* @__PURE__ */ p(Q, {
120
+ children: [/* @__PURE__ */ p(Q, {
121
+ children: [/* @__PURE__ */ p(U, {
122
122
  children: [/* @__PURE__ */ i(d, {
123
123
  variant: "circular",
124
124
  width: 24,
@@ -128,7 +128,7 @@ function Y() {
128
128
  width: 120,
129
129
  height: 14
130
130
  })]
131
- }), /* @__PURE__ */ i(U, {}), /* @__PURE__ */ p(V, {
131
+ }), /* @__PURE__ */ i(V, {}), /* @__PURE__ */ p(X, {
132
132
  children: [/* @__PURE__ */ i(d, {
133
133
  variant: "text",
134
134
  width: 68,
@@ -143,8 +143,8 @@ function Y() {
143
143
  height: 14
144
144
  })]
145
145
  })]
146
- }), /* @__PURE__ */ i(X, {
147
- children: e ? /* @__PURE__ */ p(O, {
146
+ }), /* @__PURE__ */ i(Y, {
147
+ children: e ? /* @__PURE__ */ p(W, {
148
148
  children: [/* @__PURE__ */ i(d, {
149
149
  variant: "circular",
150
150
  width: 24,
@@ -166,23 +166,23 @@ function Y() {
166
166
  })]
167
167
  });
168
168
  }
169
- const Z = F(null);
170
- function ee(e) {
169
+ const ee = P(null);
170
+ function ie(e) {
171
171
  const {
172
172
  children: n,
173
173
  initialModuleActions: t,
174
174
  moduleId: o,
175
175
  moduleNameField: a,
176
176
  urlIcon: c,
177
- breadcrumbLinks: h
178
- } = e, [l] = f(() => ({
177
+ breadcrumbLinks: g
178
+ } = e, [l] = y(() => ({
179
179
  moduleId: o,
180
180
  urlIcon: c,
181
181
  moduleNameField: a,
182
182
  dictionary: void 0,
183
- breadcrumbLinks: h
184
- })), [u, r] = f([]), m = v(() => t.concat(u), [t, u]);
185
- return /* @__PURE__ */ i(Z.Provider, {
183
+ breadcrumbLinks: g
184
+ })), [u, r] = y([]), m = f(() => t.concat(u), [t, u]);
185
+ return /* @__PURE__ */ i(ee.Provider, {
186
186
  value: {
187
187
  moduleActions: m,
188
188
  dynamicActions: u,
@@ -195,33 +195,33 @@ function ee(e) {
195
195
  children: n
196
196
  });
197
197
  }
198
- function ie(e, n) {
198
+ function te(e, n) {
199
199
  let t = [...n.filter((o) => o.visibility !== "allways")];
200
200
  return e !== void 0 && e && (t = t.filter((o) => o.visibility === "normal")), t;
201
201
  }
202
- function te(e, n) {
202
+ function oe(e, n) {
203
203
  let t = [];
204
204
  return e !== void 0 && e && (t = t.concat(n.filter((o) => o.visibility === "main"))), t = t.concat(n.filter((o) => o.visibility === "allways")), t;
205
205
  }
206
- function oe() {
206
+ function ne() {
207
207
  const {
208
208
  moduleActions: e,
209
209
  moduleNameField: n,
210
210
  breadcrumbLinks: t,
211
211
  urlIcon: o
212
- } = W(), {
212
+ } = z(), {
213
213
  getLabel: a
214
- } = P(), c = b(), h = S(), l = v(
215
- () => ie(c, e),
214
+ } = S(), c = w(), g = _(), l = f(
215
+ () => te(c, e),
216
216
  [e, c]
217
- ), u = v(() => te(c, e), [e, c]);
218
- return h ? /* @__PURE__ */ i(Y, {}) : /* @__PURE__ */ p(K, {
217
+ ), u = f(() => oe(c, e), [e, c]);
218
+ return g ? /* @__PURE__ */ i(Z, {}) : /* @__PURE__ */ p(E, {
219
219
  id: "Header",
220
- children: [/* @__PURE__ */ i(C, {
220
+ children: [/* @__PURE__ */ i(T, {
221
221
  src: o,
222
222
  bgColor: "primary.main",
223
223
  size: "24px"
224
- }), /* @__PURE__ */ i(G, {
224
+ }), /* @__PURE__ */ i(j, {
225
225
  variant: "h5",
226
226
  sx: {
227
227
  maxWidth: 260,
@@ -233,19 +233,19 @@ function oe() {
233
233
  textOverflow: "ellipsis"
234
234
  },
235
235
  children: a(n)
236
- }), /* @__PURE__ */ i(T, {
236
+ }), /* @__PURE__ */ i(L, {
237
237
  links: t
238
238
  }), u.map((r, m) => {
239
- const g = a(r.dictionaryField);
239
+ const h = a(r.dictionaryField);
240
240
  return r.component ? /* @__PURE__ */ i(r.component, {
241
- description: g,
241
+ description: h,
242
242
  onClick: r.onClick
243
- }, `main_action_${m}`) : /* @__PURE__ */ i(j, {
243
+ }, `main_action_${m}`) : /* @__PURE__ */ i(O, {
244
244
  className: r.className,
245
245
  onClick: r.onClick,
246
- "aria-label": `${g}`,
246
+ "aria-label": `${h}`,
247
247
  disabled: r.disabled,
248
- children: /* @__PURE__ */ i(L, {
248
+ children: /* @__PURE__ */ i(D, {
249
249
  src: r.urlIcon,
250
250
  sx: {
251
251
  width: 18,
@@ -253,7 +253,7 @@ function oe() {
253
253
  }
254
254
  })
255
255
  }, `main_action_${m}`);
256
- }), l.length > 0 && /* @__PURE__ */ i(D, {
256
+ }), l.length > 0 && /* @__PURE__ */ i(N, {
257
257
  arrowType: "right-top",
258
258
  marginTop: "11px",
259
259
  anchorOrigin: {
@@ -268,61 +268,63 @@ function oe() {
268
268
  })]
269
269
  });
270
270
  }
271
- const w = y((e, n) => {
271
+ const I = x((e, n) => {
272
272
  const {
273
273
  children: t
274
274
  } = e, {
275
275
  openModal: o
276
- } = N(), a = x(null);
277
- return M(n, () => ({
276
+ } = R(), a = M(null);
277
+ return b(n, () => ({
278
278
  openModal: o,
279
279
  current: a.current
280
- })), /* @__PURE__ */ p(z, {
280
+ })), /* @__PURE__ */ p(q, {
281
281
  id: "WrapperInnerModule",
282
282
  className: "m4l_module_layout",
283
283
  ref: a,
284
- children: [/* @__PURE__ */ i(oe, {}), /* @__PURE__ */ i(q, {
284
+ children: [/* @__PURE__ */ i(ne, {}), /* @__PURE__ */ i(K, {
285
285
  id: "ModuleContent",
286
286
  children: t
287
287
  })]
288
288
  });
289
289
  });
290
- w.displayName = "InnerModule";
291
- const ne = y((e, n) => {
290
+ I.displayName = "InnerModule";
291
+ const re = x((e, n) => {
292
292
  const {
293
293
  moduleId: t,
294
294
  moduleNameField: o = "module_name",
295
295
  moduleActions: a,
296
296
  urlIcon: c,
297
- children: h,
297
+ children: g,
298
298
  componentsDictionary: l,
299
299
  breadcrumbLinks: u,
300
300
  privileges: r,
301
- skeletonFlags: m
302
- } = e, g = x(null), I = (k) => {
303
- g.current?.openModal(k);
301
+ currentLang: m,
302
+ skeletonFlags: h
303
+ } = e, v = M(null), k = (C) => {
304
+ v.current?.openModal(C);
304
305
  };
305
- return M(n, () => ({
306
- openModal: I,
307
- current: g.current
308
- })), /* @__PURE__ */ i(_, {
309
- children: /* @__PURE__ */ i(A, {
306
+ return b(n, () => ({
307
+ openModal: k,
308
+ current: v.current
309
+ })), /* @__PURE__ */ i(A, {
310
+ children: /* @__PURE__ */ i(B, {
310
311
  moduleId: t,
311
312
  componentsDictionary: l,
312
- children: /* @__PURE__ */ i(B, {
313
- flags: m,
314
- children: /* @__PURE__ */ i(H, {
313
+ currentLang: m,
314
+ children: /* @__PURE__ */ i(H, {
315
+ flags: h,
316
+ children: /* @__PURE__ */ i(G, {
315
317
  queryPrivileges: r,
316
- children: /* @__PURE__ */ i(ee, {
318
+ children: /* @__PURE__ */ i(ie, {
317
319
  moduleId: t,
318
320
  urlIcon: c,
319
321
  moduleNameField: o,
320
322
  initialModuleActions: a,
321
323
  breadcrumbLinks: u,
322
- children: /* @__PURE__ */ i(R, {
323
- children: /* @__PURE__ */ i(w, {
324
- ref: g,
325
- children: h
324
+ children: /* @__PURE__ */ i($, {
325
+ children: /* @__PURE__ */ i(I, {
326
+ ref: v,
327
+ children: g
326
328
  })
327
329
  })
328
330
  })
@@ -331,16 +333,16 @@ const ne = y((e, n) => {
331
333
  })
332
334
  });
333
335
  });
334
- ne.displayName = "ModuleLayout";
335
- function me() {
336
- return ["module_layout"].concat($());
336
+ re.displayName = "ModuleLayout";
337
+ function ge() {
338
+ return ["module_layout"].concat(F());
337
339
  }
338
- const ge = {
340
+ const he = {
339
341
  module_layout: {}
340
342
  };
341
343
  export {
342
- Z as M,
343
- ne as a,
344
- ge as d,
345
- me as g
344
+ ee as M,
345
+ re as a,
346
+ he as d,
347
+ ge as g
346
348
  };
@@ -18,6 +18,7 @@ export declare type ModuleLayoutRef = {
18
18
  export interface ModuleLayoutProps extends HeaderProps {
19
19
  moduleId: string;
20
20
  urlIcon: string;
21
+ currentLang: string;
21
22
  skeletonFlags: string[];
22
23
  moduleNameField?: string;
23
24
  privileges: string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m4l/layouts",
3
- "version": "0.1.12",
3
+ "version": "0.1.13",
4
4
  "license": "UNLICENSED",
5
5
  "dependencies": {
6
6
  "@m4l/components": "*",