@m4l/layouts 0.1.40 → 0.1.41
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/index.33191825.js +4 -0
- package/hooks/useMasterDetail/{index.927c0c26.js → index.be4908d9.js} +1 -1
- package/hooks/useModule/{index.edcd7b28.js → index.b5f598b1.js} +1 -1
- package/index.js +7 -5
- package/layouts/MasterDetailLayout/classes/constants.d.ts +1 -0
- package/layouts/MasterDetailLayout/classes/index.d.ts +6 -0
- package/layouts/MasterDetailLayout/classes/types.d.ts +6 -0
- package/layouts/MasterDetailLayout/{index.bca0fce5.js → index.fe6ac47b.js} +42 -15
- package/layouts/MasterDetailLayout/styles.d.ts +2 -0
- package/layouts/ModuleLayout/classes/constants.d.ts +1 -0
- package/layouts/ModuleLayout/classes/index.d.ts +7 -0
- package/layouts/ModuleLayout/classes/types.d.ts +7 -0
- package/layouts/ModuleLayout/{index.850f7dcf.js → index.e7218171.js} +27 -23
- package/layouts/ModuleLayout/subcomponents/InnerModule/styles.d.ts +1 -2
- package/layouts/NoAuthModuleLayout/{index.eabf38c1.js → index.2808fa44.js} +3 -2
- package/layouts/index.96a3745e.js +8 -0
- package/layouts/index.d.ts +2 -2
- package/package.json +1 -1
- package/hooks/index.a0c767ed.js +0 -4
- package/layouts/index.07aacf57.js +0 -8
- /package/layouts/MasterDetailLayout/{index.d.ts → MasterDetailLayout.d.ts} +0 -0
- /package/layouts/ModuleLayout/{index.d.ts → ModuleLayout.d.ts} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useContext } from "react";
|
|
2
|
-
import { M as MasterDetailContext } from "../../layouts/MasterDetailLayout/index.
|
|
2
|
+
import { M as MasterDetailContext } from "../../layouts/MasterDetailLayout/index.fe6ac47b.js";
|
|
3
3
|
const useMasterDetail = () => useContext(MasterDetailContext);
|
|
4
4
|
export {
|
|
5
5
|
useMasterDetail as u
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useContext } from "react";
|
|
2
|
-
import { M as ModuleContext } from "../../layouts/ModuleLayout/index.
|
|
2
|
+
import { M as ModuleContext } from "../../layouts/ModuleLayout/index.e7218171.js";
|
|
3
3
|
const useModule = () => {
|
|
4
4
|
const context = useContext(ModuleContext);
|
|
5
5
|
if (!context)
|
package/index.js
CHANGED
|
@@ -2,12 +2,12 @@ import { M } from "./components/MFIsolationApp/index.e36cf308.js";
|
|
|
2
2
|
import { M as M2 } from "./components/MFHostApp/index.420c2626.js";
|
|
3
3
|
import { B } from "./components/BaseModule/index.6309486a.js";
|
|
4
4
|
import { a, A } from "./contexts/AuthContext/index.6f966215.js";
|
|
5
|
-
import { a as a2, d, g } from "./layouts/ModuleLayout/index.
|
|
6
|
-
import { a as a3, d as d2, g as g2 } from "./layouts/MasterDetailLayout/index.
|
|
7
|
-
import { N, d as d3, g as g3 } from "./layouts/NoAuthModuleLayout/index.
|
|
8
|
-
import { u } from "./hooks/useMasterDetail/index.
|
|
5
|
+
import { a as a2, d, g } from "./layouts/ModuleLayout/index.e7218171.js";
|
|
6
|
+
import { a as a3, d as d2, g as g2 } from "./layouts/MasterDetailLayout/index.fe6ac47b.js";
|
|
7
|
+
import { N, d as d3, g as g3 } from "./layouts/NoAuthModuleLayout/index.2808fa44.js";
|
|
8
|
+
import { u } from "./hooks/useMasterDetail/index.be4908d9.js";
|
|
9
9
|
import { u as u2 } from "./hooks/useAuth/index.cb6a3420.js";
|
|
10
|
-
import { u as u3 } from "./hooks/useModule/index.
|
|
10
|
+
import { u as u3 } from "./hooks/useModule/index.b5f598b1.js";
|
|
11
11
|
import "react";
|
|
12
12
|
import "react-router-dom";
|
|
13
13
|
import "react-toastify";
|
|
@@ -21,6 +21,8 @@ import "react/jsx-runtime";
|
|
|
21
21
|
import "nprogress";
|
|
22
22
|
import "@m4l/components";
|
|
23
23
|
import "@mui/material/styles";
|
|
24
|
+
import "@mui/material";
|
|
25
|
+
import "@mui/base";
|
|
24
26
|
export {
|
|
25
27
|
a as AuthContext,
|
|
26
28
|
A as AuthProvider,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const componentName = "M4LMasterDetailLayout";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { MasterDetailLayoutClassesType } from './types';
|
|
2
|
+
export declare const masterDetailLayoutClasses: MasterDetailLayoutClassesType;
|
|
3
|
+
export declare function getMasterDetailLayoutUtilityClass(slot: string): string;
|
|
4
|
+
export declare const useMasterDetailLayoutUtilityClasses: () => {
|
|
5
|
+
root: string;
|
|
6
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { useMasterDetailLayoutUtilityClasses } from ".";
|
|
2
|
+
export interface MasterDetailLayoutClassesType {
|
|
3
|
+
root: string;
|
|
4
|
+
}
|
|
5
|
+
export declare type MasterDetailLayoutClassesKey = keyof MasterDetailLayoutClassesType;
|
|
6
|
+
export declare type Classes = ReturnType<typeof useMasterDetailLayoutUtilityClasses>;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { createContext, useState, useRef, useMemo, useCallback } from "react";
|
|
2
2
|
import { voidFunction, useEnvironment, useModuleDictionary } from "@m4l/core";
|
|
3
3
|
import { WindowBase, SplitLayout } from "@m4l/components";
|
|
4
|
-
import { a as ModuleLayout, g as getModuleLayoutComponentsDictionary } from "../ModuleLayout/index.
|
|
4
|
+
import { a as ModuleLayout, g as getModuleLayoutComponentsDictionary } from "../ModuleLayout/index.e7218171.js";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
import { useResponsiveDesktop } from "@m4l/graphics";
|
|
7
|
+
import { generateUtilityClasses, generateUtilityClass, styled } from "@mui/material";
|
|
8
|
+
import { unstable_composeClasses } from "@mui/base";
|
|
7
9
|
const initialState = {
|
|
8
10
|
masterSelection: void 0,
|
|
9
11
|
onChangeMasterSelection: voidFunction
|
|
@@ -22,6 +24,25 @@ function MasterDetailProvider(props) {
|
|
|
22
24
|
children
|
|
23
25
|
});
|
|
24
26
|
}
|
|
27
|
+
const componentName = "M4LMasterDetailLayout";
|
|
28
|
+
generateUtilityClasses(componentName, [
|
|
29
|
+
"root"
|
|
30
|
+
]);
|
|
31
|
+
function getMasterDetailLayoutUtilityClass(slot) {
|
|
32
|
+
return generateUtilityClass(componentName, slot);
|
|
33
|
+
}
|
|
34
|
+
const useMasterDetailLayoutUtilityClasses = () => {
|
|
35
|
+
const slots = {
|
|
36
|
+
root: ["root"]
|
|
37
|
+
};
|
|
38
|
+
const composedClasses = unstable_composeClasses(slots, getMasterDetailLayoutUtilityClass, {});
|
|
39
|
+
return {
|
|
40
|
+
...composedClasses
|
|
41
|
+
};
|
|
42
|
+
};
|
|
43
|
+
const MasterDetailLayoutRoot = styled("div")(({ theme }) => ({
|
|
44
|
+
...theme.components?.M4LMasterDetailLayout?.styleOverrides
|
|
45
|
+
}));
|
|
25
46
|
function getTotalModuleActions(splitActions, moduleActions = [], viewDetailAction, isDesktop) {
|
|
26
47
|
let totalActions = isDesktop !== void 0 && isDesktop ? [...splitActions] : [viewDetailAction];
|
|
27
48
|
totalActions = moduleActions.concat(totalActions);
|
|
@@ -80,11 +101,13 @@ function MasterDetailLayout(props) {
|
|
|
80
101
|
moduleLayoutRef.current?.openModal({
|
|
81
102
|
initialWidth: 500,
|
|
82
103
|
initialHeigth: 680,
|
|
83
|
-
window: /* @__PURE__ */ jsx(
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
104
|
+
window: /* @__PURE__ */ jsx(
|
|
105
|
+
WindowBase,
|
|
106
|
+
{
|
|
107
|
+
title: getLabel("master_detail_layout.view_detail"),
|
|
108
|
+
children: typeof detailComponent === "function" ? detailComponent({}) : detailComponent
|
|
109
|
+
}
|
|
110
|
+
)
|
|
88
111
|
});
|
|
89
112
|
}, [detailComponent, getLabel]);
|
|
90
113
|
const viewDetailAction = useMemo(() => {
|
|
@@ -103,16 +126,20 @@ function MasterDetailLayout(props) {
|
|
|
103
126
|
const actions = getTotalModuleActions(splitActions, moduleActions, viewDetailAction, isDesktop);
|
|
104
127
|
return actions;
|
|
105
128
|
}, [splitActions, moduleActions, isDesktop, viewDetailAction]);
|
|
129
|
+
const classes = useMasterDetailLayoutUtilityClasses();
|
|
106
130
|
return /* @__PURE__ */ jsx(MasterDetailProvider, {
|
|
107
|
-
children: /* @__PURE__ */ jsx(
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
131
|
+
children: /* @__PURE__ */ jsx(MasterDetailLayoutRoot, {
|
|
132
|
+
className: classes.root,
|
|
133
|
+
children: /* @__PURE__ */ jsx(ModuleLayout, {
|
|
134
|
+
ref: moduleLayoutRef,
|
|
135
|
+
moduleId,
|
|
136
|
+
moduleActions: finalModuleActions,
|
|
137
|
+
version,
|
|
138
|
+
children: /* @__PURE__ */ jsx(SplitLayout, {
|
|
139
|
+
splitPosition: isDesktop ? splitPosition : "none",
|
|
140
|
+
firstPart: masterComponent,
|
|
141
|
+
secondPart: detailComponent
|
|
142
|
+
})
|
|
116
143
|
})
|
|
117
144
|
})
|
|
118
145
|
});
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const MasterDetailLayoutRoot: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const componentName = "M4LModuleLayout";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ModuleLayoutClassesType } from './types';
|
|
2
|
+
export declare const moduleLayoutClasses: ModuleLayoutClassesType;
|
|
3
|
+
export declare function getModuleLayoutUtilityClass(slot: string): string;
|
|
4
|
+
export declare const useModuleLayoutUtilityClasses: () => {
|
|
5
|
+
root: string;
|
|
6
|
+
moduleContent: string;
|
|
7
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { useModuleLayoutUtilityClasses } from ".";
|
|
2
|
+
export interface ModuleLayoutClassesType {
|
|
3
|
+
root: string;
|
|
4
|
+
moduleContent: string;
|
|
5
|
+
}
|
|
6
|
+
export declare type ModuleLayoutClassesKey = keyof ModuleLayoutClassesType;
|
|
7
|
+
export declare type Classes = ReturnType<typeof useModuleLayoutUtilityClasses>;
|
|
@@ -1,28 +1,32 @@
|
|
|
1
1
|
import { useModal, useWindowToolsMF, ModalProvider, getModalDialogComponentsDictionary } from "@m4l/components";
|
|
2
2
|
import { forwardRef, useRef, useImperativeHandle, createContext, useState, useMemo, useEffect } from "react";
|
|
3
3
|
import { styled } from "@mui/material/styles";
|
|
4
|
+
import { generateUtilityClasses, generateUtilityClass } from "@mui/material";
|
|
5
|
+
import { unstable_composeClasses } from "@mui/base";
|
|
4
6
|
import { jsx } from "react/jsx-runtime";
|
|
5
|
-
const
|
|
6
|
-
display: "flex",
|
|
7
|
-
flexDirection: "column",
|
|
8
|
-
position: "absolute",
|
|
9
|
-
margin: "0px 12px 12px 12px",
|
|
10
|
-
left: "0px",
|
|
11
|
-
right: "0px",
|
|
12
|
-
top: "0px",
|
|
13
|
-
bottom: "0px",
|
|
14
|
-
overflow: "hidden"
|
|
15
|
-
}));
|
|
16
|
-
const ModuleContent = styled("div")(({
|
|
7
|
+
const InnerModuleRoot = styled("div")(({
|
|
17
8
|
theme
|
|
18
9
|
}) => ({
|
|
19
|
-
|
|
20
|
-
position: "relative",
|
|
21
|
-
marginTop: theme.spacing(1),
|
|
22
|
-
justifyContent: "center",
|
|
23
|
-
flexGrow: "1",
|
|
24
|
-
overflow: "hidden"
|
|
10
|
+
...theme.components?.M4LModuleLayout?.styleOverrides
|
|
25
11
|
}));
|
|
12
|
+
const componentName = "M4LModuleLayout";
|
|
13
|
+
generateUtilityClasses(componentName, [
|
|
14
|
+
"root",
|
|
15
|
+
"moduleContent"
|
|
16
|
+
]);
|
|
17
|
+
function getModuleLayoutUtilityClass(slot) {
|
|
18
|
+
return generateUtilityClass(componentName, slot);
|
|
19
|
+
}
|
|
20
|
+
const useModuleLayoutUtilityClasses = () => {
|
|
21
|
+
const slots = {
|
|
22
|
+
root: ["root"],
|
|
23
|
+
moduleContent: ["moduleContent"]
|
|
24
|
+
};
|
|
25
|
+
const composedClasses = unstable_composeClasses(slots, getModuleLayoutUtilityClass, {});
|
|
26
|
+
return {
|
|
27
|
+
...composedClasses
|
|
28
|
+
};
|
|
29
|
+
};
|
|
26
30
|
const InnerModule = forwardRef((props, ref) => {
|
|
27
31
|
const {
|
|
28
32
|
children
|
|
@@ -35,12 +39,12 @@ const InnerModule = forwardRef((props, ref) => {
|
|
|
35
39
|
openModal,
|
|
36
40
|
current: divRef.current
|
|
37
41
|
}));
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
className:
|
|
42
|
+
const classes = useModuleLayoutUtilityClasses();
|
|
43
|
+
return /* @__PURE__ */ jsx(InnerModuleRoot, {
|
|
44
|
+
className: classes.root,
|
|
41
45
|
ref: divRef,
|
|
42
|
-
children: /* @__PURE__ */ jsx(
|
|
43
|
-
|
|
46
|
+
children: /* @__PURE__ */ jsx("div", {
|
|
47
|
+
className: classes.moduleContent,
|
|
44
48
|
children
|
|
45
49
|
})
|
|
46
50
|
});
|
|
@@ -1,3 +1,2 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const
|
|
3
|
-
export declare const ModuleContent: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
2
|
+
export declare const InnerModuleRoot: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -115,7 +115,8 @@ const DesktopContent = () => {
|
|
|
115
115
|
getLabel
|
|
116
116
|
} = useModuleDictionary();
|
|
117
117
|
const {
|
|
118
|
-
name
|
|
118
|
+
name,
|
|
119
|
+
slogan
|
|
119
120
|
} = useDomain();
|
|
120
121
|
return /* @__PURE__ */ jsxs(DesktopContentRoot, {
|
|
121
122
|
children: [/* @__PURE__ */ jsx(LanguagePopover, {}), /* @__PURE__ */ jsxs(DesktopBanner, {
|
|
@@ -148,7 +149,7 @@ const DesktopContent = () => {
|
|
|
148
149
|
variant: "subtitle",
|
|
149
150
|
skeletonWidth: "80%",
|
|
150
151
|
skeletongHeight: "24px",
|
|
151
|
-
children:
|
|
152
|
+
children: slogan
|
|
152
153
|
})]
|
|
153
154
|
})]
|
|
154
155
|
}), /* @__PURE__ */ jsx(WrapperFormContent$1, {
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import "./ModuleLayout/index.e7218171.js";
|
|
2
|
+
import "@m4l/components";
|
|
3
|
+
import "react";
|
|
4
|
+
import "@m4l/core";
|
|
5
|
+
import "./MasterDetailLayout/index.fe6ac47b.js";
|
|
6
|
+
import "@m4l/graphics";
|
|
7
|
+
import "react/jsx-runtime";
|
|
8
|
+
import "./NoAuthModuleLayout/index.2808fa44.js";
|
package/layouts/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { ModuleLayout } from './ModuleLayout';
|
|
1
|
+
export { ModuleLayout } from './ModuleLayout/ModuleLayout';
|
|
2
2
|
export * from './ModuleLayout/dicctionary';
|
|
3
|
-
export { MasterDetailLayout } from './MasterDetailLayout';
|
|
3
|
+
export { MasterDetailLayout } from './MasterDetailLayout/MasterDetailLayout';
|
|
4
4
|
export * from './MasterDetailLayout/dicctionary';
|
|
5
5
|
export { NoAuthModuleLayout } from './NoAuthModuleLayout';
|
|
6
6
|
export * from './NoAuthModuleLayout/dicctionary';
|
package/package.json
CHANGED
package/hooks/index.a0c767ed.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import "./ModuleLayout/index.850f7dcf.js";
|
|
2
|
-
import "@m4l/components";
|
|
3
|
-
import "react";
|
|
4
|
-
import "@m4l/core";
|
|
5
|
-
import "./MasterDetailLayout/index.bca0fce5.js";
|
|
6
|
-
import "@m4l/graphics";
|
|
7
|
-
import "react/jsx-runtime";
|
|
8
|
-
import "./NoAuthModuleLayout/index.eabf38c1.js";
|
|
File without changes
|
|
File without changes
|