@m4l/layouts 0.0.29 → 0.0.32
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.
|
@@ -43,6 +43,7 @@ function ButtonDetail(props) {
|
|
|
43
43
|
onClick,
|
|
44
44
|
description
|
|
45
45
|
} = props;
|
|
46
|
+
console.log("ButtonDetail", masterSelection);
|
|
46
47
|
return /* @__PURE__ */ jsx(Button, {
|
|
47
48
|
onClick,
|
|
48
49
|
variant: "outlined",
|
|
@@ -65,7 +66,8 @@ function MasterDetailLayout(props) {
|
|
|
65
66
|
masterComponent,
|
|
66
67
|
componentsDictionary,
|
|
67
68
|
breadcrumbLinks,
|
|
68
|
-
privileges
|
|
69
|
+
privileges,
|
|
70
|
+
skeletonFlags
|
|
69
71
|
} = props;
|
|
70
72
|
const {
|
|
71
73
|
host_static_assets,
|
|
@@ -116,7 +118,7 @@ function MasterDetailLayout(props) {
|
|
|
116
118
|
initialWidth: 500,
|
|
117
119
|
initialHeigth: 680,
|
|
118
120
|
contentComponent: detailComponent,
|
|
119
|
-
|
|
121
|
+
actions: void 0
|
|
120
122
|
});
|
|
121
123
|
}, [detailComponent]);
|
|
122
124
|
const viewDetailAction = useMemo(() => {
|
|
@@ -138,24 +140,22 @@ function MasterDetailLayout(props) {
|
|
|
138
140
|
}, [splitActions, moduleActions, isDesktop, viewDetailAction]);
|
|
139
141
|
const finalComponentsDictionary = useMemo(() => componentsDictionary.concat(getMasterDetailLayoutComponentsDictionary()), [componentsDictionary]);
|
|
140
142
|
console.log("MasterDetailLayout Render");
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
children: /* @__PURE__ */ jsx(MasterDetailProvider, {
|
|
158
|
-
children: memonizedSplit
|
|
143
|
+
return /* @__PURE__ */ jsx(MasterDetailProvider, {
|
|
144
|
+
children: /* @__PURE__ */ jsx(ModuleLayout, {
|
|
145
|
+
ref: moduleLayoutRef,
|
|
146
|
+
moduleId,
|
|
147
|
+
moduleNameField,
|
|
148
|
+
urlIcon,
|
|
149
|
+
moduleActions: finalModuleActions,
|
|
150
|
+
privileges,
|
|
151
|
+
skeletonFlags,
|
|
152
|
+
componentsDictionary: finalComponentsDictionary,
|
|
153
|
+
breadcrumbLinks,
|
|
154
|
+
children: /* @__PURE__ */ jsx(SplitLayout, {
|
|
155
|
+
splitPosition: isDesktop ? splitPosition : "none",
|
|
156
|
+
firstPart: masterComponent,
|
|
157
|
+
secondPart: detailComponent
|
|
158
|
+
})
|
|
159
159
|
})
|
|
160
160
|
});
|
|
161
161
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BoxIcon, Breadcrumbs as Breadcrumbs$1, MenuActions, useModal, ModalProvider, getModalDialogComponentsDictionary } from "@m4l/components";
|
|
2
2
|
import { createContext, useState, useMemo, forwardRef, useRef, useImperativeHandle } from "react";
|
|
3
3
|
import { styled, useTheme } from "@mui/material/styles";
|
|
4
|
-
import { voidFunction, useModuleDictionary, useFlagsPresent, FlagsProvider, ModuleDictionaryProvider, ModulePrivilegesProvider } from "@m4l/core";
|
|
4
|
+
import { voidFunction, useModuleDictionary, useFlagsPresent, FlagsProvider, ModuleDictionaryProvider, ModuleSkeletonProvider, ModulePrivilegesProvider } from "@m4l/core";
|
|
5
5
|
import { Skeleton, Typography, IconButton } from "@mui/material";
|
|
6
6
|
import { u as useResponsiveDesktop } from "../../vendor.js";
|
|
7
7
|
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
@@ -341,7 +341,8 @@ const ModuleLayout = forwardRef((props, ref) => {
|
|
|
341
341
|
children,
|
|
342
342
|
componentsDictionary,
|
|
343
343
|
breadcrumbLinks,
|
|
344
|
-
privileges
|
|
344
|
+
privileges,
|
|
345
|
+
skeletonFlags
|
|
345
346
|
} = props;
|
|
346
347
|
const moduleRef = useRef(null);
|
|
347
348
|
const openModal = (modalOpenProps) => {
|
|
@@ -355,18 +356,21 @@ const ModuleLayout = forwardRef((props, ref) => {
|
|
|
355
356
|
children: /* @__PURE__ */ jsx(ModuleDictionaryProvider, {
|
|
356
357
|
moduleId,
|
|
357
358
|
componentsDictionary,
|
|
358
|
-
children: /* @__PURE__ */ jsx(
|
|
359
|
-
|
|
360
|
-
children: /* @__PURE__ */ jsx(
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
children
|
|
359
|
+
children: /* @__PURE__ */ jsx(ModuleSkeletonProvider, {
|
|
360
|
+
flags: skeletonFlags,
|
|
361
|
+
children: /* @__PURE__ */ jsx(ModulePrivilegesProvider, {
|
|
362
|
+
queryPrivileges: privileges,
|
|
363
|
+
children: /* @__PURE__ */ jsx(ModuleProvider, {
|
|
364
|
+
moduleId,
|
|
365
|
+
urlIcon,
|
|
366
|
+
moduleNameField,
|
|
367
|
+
initialModuleActions,
|
|
368
|
+
breadcrumbLinks,
|
|
369
|
+
children: /* @__PURE__ */ jsx(ModalProvider, {
|
|
370
|
+
children: /* @__PURE__ */ jsx(Module, {
|
|
371
|
+
ref: moduleRef,
|
|
372
|
+
children
|
|
373
|
+
})
|
|
370
374
|
})
|
|
371
375
|
})
|
|
372
376
|
})
|
|
@@ -18,6 +18,7 @@ export interface ModuleAction extends MenuAction {
|
|
|
18
18
|
export interface ModuleLayoutProps extends HeaderProps {
|
|
19
19
|
moduleId: string;
|
|
20
20
|
urlIcon: string;
|
|
21
|
+
skeletonFlags: string[];
|
|
21
22
|
moduleNameField?: string;
|
|
22
23
|
privileges: string[];
|
|
23
24
|
breadcrumbLinks: TLink[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CompanyLogo, LanguagePopover, Typography, Image } from "@m4l/components";
|
|
2
2
|
import { Card, Container, Stack } from "@mui/material";
|
|
3
3
|
import { styled } from "@mui/material/styles";
|
|
4
|
-
import { useModuleDictionary, useFlagsPresent, getLocalStorage, useNetwork, useEnvironment, useFlags, FlagsProvider, ModuleDictionaryProvider } from "@m4l/core";
|
|
4
|
+
import { useModuleDictionary, useFlagsPresent, getLocalStorage, useNetwork, useEnvironment, useFlags, FlagsProvider, ModuleDictionaryProvider, ModuleSkeletonProvider } from "@m4l/core";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { u as useResponsive, P as Page } from "../../node_modules.js";
|
|
7
7
|
import { createContext, useState, useEffect } from "react";
|
|
@@ -215,7 +215,8 @@ const NoAuthModuleLayout = (props) => {
|
|
|
215
215
|
moduleId,
|
|
216
216
|
moduleName,
|
|
217
217
|
children,
|
|
218
|
-
componentsDictionary
|
|
218
|
+
componentsDictionary,
|
|
219
|
+
skeletonFlags
|
|
219
220
|
} = props;
|
|
220
221
|
return /* @__PURE__ */ jsx(FlagsProvider, {
|
|
221
222
|
children: /* @__PURE__ */ jsx(ModuleDictionaryProvider, {
|
|
@@ -223,10 +224,13 @@ const NoAuthModuleLayout = (props) => {
|
|
|
223
224
|
moduleId,
|
|
224
225
|
moduleName,
|
|
225
226
|
componentsDictionary,
|
|
226
|
-
children: /* @__PURE__ */ jsx(
|
|
227
|
-
|
|
228
|
-
children: /* @__PURE__ */ jsx(
|
|
229
|
-
|
|
227
|
+
children: /* @__PURE__ */ jsx(ModuleSkeletonProvider, {
|
|
228
|
+
flags: skeletonFlags,
|
|
229
|
+
children: /* @__PURE__ */ jsx(ModuleProvider, {
|
|
230
|
+
moduleId,
|
|
231
|
+
children: /* @__PURE__ */ jsx(ModuleWrapper, {
|
|
232
|
+
children
|
|
233
|
+
})
|
|
230
234
|
})
|
|
231
235
|
})
|
|
232
236
|
})
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@m4l/layouts",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.32",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"dev": "vite",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"format": "npm run prettier:fix && npm run lint:fix"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@m4l/components": "^0.0.
|
|
17
|
+
"@m4l/components": "^0.0.48",
|
|
18
18
|
"react": "^17.0.0 || 18.x",
|
|
19
19
|
"react-dom": "^18.0.0"
|
|
20
20
|
},
|