@m4l/layouts 0.1.39 → 0.1.40
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/components/BaseModule/index.6309486a.js +24 -24
- package/components/MFHostApp/index.420c2626.js +58 -58
- package/components/MFIsolationApp/index.e36cf308.js +137 -117
- package/contexts/AuthContext/index.6f966215.js +118 -88
- package/hooks/useAuth/index.cb6a3420.js +7 -7
- package/hooks/useMasterDetail/index.927c0c26.js +4 -4
- package/hooks/useModule/index.edcd7b28.js +7 -7
- package/index.js +27 -27
- package/layouts/MasterDetailLayout/index.bca0fce5.js +96 -78
- package/layouts/ModuleLayout/index.850f7dcf.js +79 -64
- package/layouts/NoAuthModuleLayout/index.eabf38c1.js +179 -146
- package/package.json +2 -1
|
@@ -1,130 +1,160 @@
|
|
|
1
|
-
import { createContext
|
|
2
|
-
import { useHostTools
|
|
3
|
-
import { jsx
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { createContext, useReducer, useEffect } from "react";
|
|
2
|
+
import { useHostTools, useNetwork, useEnvironment, useLocalStorageWithListener, EmitEvents, getLocalStorage, setLocalStorage } from "@m4l/core";
|
|
3
|
+
import { jsx } from "react/jsx-runtime";
|
|
4
|
+
var EnumTypes = /* @__PURE__ */ ((EnumTypes2) => {
|
|
5
|
+
EnumTypes2["Initial"] = "INITIALIZE";
|
|
6
|
+
EnumTypes2["Login"] = "LOGIN";
|
|
7
|
+
EnumTypes2["Logout"] = "LOGOUT";
|
|
8
|
+
return EnumTypes2;
|
|
9
|
+
})(EnumTypes || {});
|
|
10
|
+
const initialState = {
|
|
11
|
+
isAuthenticated: false,
|
|
12
|
+
isInitialized: false,
|
|
8
13
|
user: null
|
|
9
|
-
}
|
|
10
|
-
|
|
14
|
+
};
|
|
15
|
+
const JWTReducer = (state, action) => {
|
|
16
|
+
switch (action.type) {
|
|
11
17
|
case "INITIALIZE":
|
|
12
18
|
return {
|
|
13
|
-
isAuthenticated:
|
|
14
|
-
isInitialized:
|
|
15
|
-
user:
|
|
19
|
+
isAuthenticated: action.payload.isAuthenticated,
|
|
20
|
+
isInitialized: true,
|
|
21
|
+
user: action.payload.user
|
|
16
22
|
};
|
|
17
23
|
case "LOGIN":
|
|
18
24
|
return {
|
|
19
|
-
...
|
|
20
|
-
isAuthenticated:
|
|
21
|
-
user:
|
|
25
|
+
...state,
|
|
26
|
+
isAuthenticated: true,
|
|
27
|
+
user: action.payload.user
|
|
22
28
|
};
|
|
23
29
|
case "LOGOUT":
|
|
24
30
|
return {
|
|
25
|
-
...
|
|
26
|
-
isAuthenticated:
|
|
31
|
+
...state,
|
|
32
|
+
isAuthenticated: false,
|
|
27
33
|
user: null
|
|
28
34
|
};
|
|
29
35
|
default:
|
|
30
|
-
return
|
|
36
|
+
return state;
|
|
31
37
|
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
38
|
+
};
|
|
39
|
+
const AuthContext = createContext(null);
|
|
40
|
+
function dispatchInitial(dispatch) {
|
|
41
|
+
dispatch({
|
|
42
|
+
type: EnumTypes.Initial,
|
|
36
43
|
payload: {
|
|
37
|
-
isAuthenticated:
|
|
44
|
+
isAuthenticated: false,
|
|
38
45
|
user: null
|
|
39
46
|
}
|
|
40
47
|
});
|
|
41
48
|
}
|
|
42
|
-
function
|
|
49
|
+
function AuthProvider(props) {
|
|
50
|
+
const {
|
|
51
|
+
children
|
|
52
|
+
} = props;
|
|
53
|
+
const [state, dispatch] = useReducer(JWTReducer, initialState);
|
|
54
|
+
const {
|
|
55
|
+
events_add_listener
|
|
56
|
+
} = useHostTools();
|
|
43
57
|
const {
|
|
44
|
-
|
|
45
|
-
} =
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
domain_token: m
|
|
51
|
-
} = v(), [f, l] = N(
|
|
58
|
+
networkOperation
|
|
59
|
+
} = useNetwork();
|
|
60
|
+
const {
|
|
61
|
+
domain_token
|
|
62
|
+
} = useEnvironment();
|
|
63
|
+
const [nextValSession, setNextValSession] = useLocalStorageWithListener(
|
|
52
64
|
"vSession",
|
|
53
65
|
new Date().getTime() + ""
|
|
54
66
|
);
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
67
|
+
useEffect(() => {
|
|
68
|
+
const initialize = async () => {
|
|
69
|
+
networkOperation({
|
|
58
70
|
method: "GET",
|
|
59
|
-
endPoint:
|
|
71
|
+
endPoint: `auth/login`,
|
|
60
72
|
parms: {
|
|
61
|
-
user_data:
|
|
73
|
+
user_data: true
|
|
62
74
|
},
|
|
63
|
-
checkUnAuthorized:
|
|
64
|
-
}).then((
|
|
65
|
-
|
|
66
|
-
type:
|
|
75
|
+
checkUnAuthorized: false
|
|
76
|
+
}).then((response) => {
|
|
77
|
+
dispatch({
|
|
78
|
+
type: EnumTypes.Initial,
|
|
67
79
|
payload: {
|
|
68
|
-
isAuthenticated:
|
|
69
|
-
user:
|
|
80
|
+
isAuthenticated: true,
|
|
81
|
+
user: response.user
|
|
70
82
|
}
|
|
71
|
-
})
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
83
|
+
});
|
|
84
|
+
const useSaved = getLocalStorage("userData", {
|
|
85
|
+
email: response.user.email,
|
|
86
|
+
remember: true
|
|
87
|
+
});
|
|
88
|
+
if (useSaved?.email !== response.user.email) {
|
|
89
|
+
setLocalStorage("userData", {
|
|
90
|
+
email: response.user.email
|
|
91
|
+
}, true);
|
|
92
|
+
}
|
|
77
93
|
}).catch(() => {
|
|
78
|
-
|
|
94
|
+
dispatchInitial(dispatch);
|
|
79
95
|
});
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
96
|
+
};
|
|
97
|
+
initialize();
|
|
98
|
+
}, [nextValSession]);
|
|
99
|
+
const login = async (email, password, remember) => {
|
|
100
|
+
await networkOperation({
|
|
101
|
+
endPoint: `auth/login`,
|
|
85
102
|
method: "POST",
|
|
86
103
|
data: {
|
|
87
|
-
email
|
|
88
|
-
password
|
|
89
|
-
domain_token
|
|
104
|
+
email,
|
|
105
|
+
password,
|
|
106
|
+
domain_token
|
|
107
|
+
}
|
|
108
|
+
}).then((response) => {
|
|
109
|
+
const user = response.data;
|
|
110
|
+
if (remember) {
|
|
111
|
+
setLocalStorage("userData", {
|
|
112
|
+
email,
|
|
113
|
+
remember
|
|
114
|
+
});
|
|
115
|
+
} else {
|
|
116
|
+
setLocalStorage("userData", {
|
|
117
|
+
email: "",
|
|
118
|
+
remember
|
|
119
|
+
});
|
|
90
120
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
o ? r("userData", {
|
|
94
|
-
email: i,
|
|
95
|
-
remember: o
|
|
96
|
-
}) : r("userData", {
|
|
97
|
-
email: "",
|
|
98
|
-
remember: o
|
|
99
|
-
}), s({
|
|
100
|
-
type: n.Login,
|
|
121
|
+
dispatch({
|
|
122
|
+
type: EnumTypes.Login,
|
|
101
123
|
payload: {
|
|
102
|
-
user
|
|
124
|
+
user
|
|
103
125
|
}
|
|
104
|
-
})
|
|
126
|
+
});
|
|
127
|
+
setNextValSession(new Date().getTime() + "");
|
|
128
|
+
});
|
|
129
|
+
};
|
|
130
|
+
const logout = async (isAuthenticated) => {
|
|
131
|
+
if (isAuthenticated) {
|
|
132
|
+
await networkOperation({
|
|
133
|
+
endPoint: `auth/logout`,
|
|
134
|
+
method: "POST"
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
dispatch({
|
|
138
|
+
type: EnumTypes.Logout
|
|
105
139
|
});
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}), s({
|
|
111
|
-
type: n.Logout
|
|
112
|
-
}), l(new Date().getTime() + "");
|
|
113
|
-
}, p = () => {
|
|
114
|
-
c(!1);
|
|
140
|
+
setNextValSession(new Date().getTime() + "");
|
|
141
|
+
};
|
|
142
|
+
const onNetserviceUnautorized = () => {
|
|
143
|
+
logout(false);
|
|
115
144
|
};
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
}, [])
|
|
145
|
+
useEffect(() => {
|
|
146
|
+
events_add_listener(EmitEvents.EMMIT_EVENT_NET_SERVICE_UNAUTHORIZED, onNetserviceUnautorized);
|
|
147
|
+
}, []);
|
|
148
|
+
return /* @__PURE__ */ jsx(AuthContext.Provider, {
|
|
119
149
|
value: {
|
|
120
|
-
...
|
|
121
|
-
login
|
|
122
|
-
logout
|
|
150
|
+
...state,
|
|
151
|
+
login,
|
|
152
|
+
logout
|
|
123
153
|
},
|
|
124
|
-
children
|
|
154
|
+
children
|
|
125
155
|
});
|
|
126
156
|
}
|
|
127
157
|
export {
|
|
128
|
-
|
|
129
|
-
|
|
158
|
+
AuthProvider as A,
|
|
159
|
+
AuthContext as a
|
|
130
160
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { useContext
|
|
2
|
-
import { a as
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
if (!
|
|
1
|
+
import { useContext } from "react";
|
|
2
|
+
import { a as AuthContext } from "../../contexts/AuthContext/index.6f966215.js";
|
|
3
|
+
const useAuth = () => {
|
|
4
|
+
const context = useContext(AuthContext);
|
|
5
|
+
if (!context)
|
|
6
6
|
throw new Error("Auth context must be use inside AuthProvider");
|
|
7
|
-
return
|
|
7
|
+
return context;
|
|
8
8
|
};
|
|
9
9
|
export {
|
|
10
|
-
|
|
10
|
+
useAuth as u
|
|
11
11
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { useContext
|
|
2
|
-
import { M as
|
|
3
|
-
const
|
|
1
|
+
import { useContext } from "react";
|
|
2
|
+
import { M as MasterDetailContext } from "../../layouts/MasterDetailLayout/index.bca0fce5.js";
|
|
3
|
+
const useMasterDetail = () => useContext(MasterDetailContext);
|
|
4
4
|
export {
|
|
5
|
-
|
|
5
|
+
useMasterDetail as u
|
|
6
6
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { useContext
|
|
2
|
-
import { M as
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
if (!
|
|
1
|
+
import { useContext } from "react";
|
|
2
|
+
import { M as ModuleContext } from "../../layouts/ModuleLayout/index.850f7dcf.js";
|
|
3
|
+
const useModule = () => {
|
|
4
|
+
const context = useContext(ModuleContext);
|
|
5
|
+
if (!context)
|
|
6
6
|
throw new Error("useModule context must be use inside ModuleContext");
|
|
7
|
-
return
|
|
7
|
+
return context;
|
|
8
8
|
};
|
|
9
9
|
export {
|
|
10
|
-
|
|
10
|
+
useModule as u
|
|
11
11
|
};
|
package/index.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { M
|
|
2
|
-
import { M as
|
|
3
|
-
import { B
|
|
4
|
-
import { a
|
|
5
|
-
import { a as
|
|
6
|
-
import { a as
|
|
7
|
-
import { N
|
|
8
|
-
import { u
|
|
9
|
-
import { u as
|
|
10
|
-
import { u as
|
|
1
|
+
import { M } from "./components/MFIsolationApp/index.e36cf308.js";
|
|
2
|
+
import { M as M2 } from "./components/MFHostApp/index.420c2626.js";
|
|
3
|
+
import { B } from "./components/BaseModule/index.6309486a.js";
|
|
4
|
+
import { a, A } from "./contexts/AuthContext/index.6f966215.js";
|
|
5
|
+
import { a as a2, d, g } from "./layouts/ModuleLayout/index.850f7dcf.js";
|
|
6
|
+
import { a as a3, d as d2, g as g2 } from "./layouts/MasterDetailLayout/index.bca0fce5.js";
|
|
7
|
+
import { N, d as d3, g as g3 } from "./layouts/NoAuthModuleLayout/index.eabf38c1.js";
|
|
8
|
+
import { u } from "./hooks/useMasterDetail/index.927c0c26.js";
|
|
9
|
+
import { u as u2 } from "./hooks/useAuth/index.cb6a3420.js";
|
|
10
|
+
import { u as u3 } from "./hooks/useModule/index.edcd7b28.js";
|
|
11
11
|
import "react";
|
|
12
12
|
import "react-router-dom";
|
|
13
13
|
import "react-toastify";
|
|
@@ -22,21 +22,21 @@ import "nprogress";
|
|
|
22
22
|
import "@m4l/components";
|
|
23
23
|
import "@mui/material/styles";
|
|
24
24
|
export {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
25
|
+
a as AuthContext,
|
|
26
|
+
A as AuthProvider,
|
|
27
|
+
B as BaseModule,
|
|
28
|
+
M2 as MFHostApp,
|
|
29
|
+
M as MFIsolationApp,
|
|
30
|
+
a3 as MasterDetailLayout,
|
|
31
|
+
a2 as ModuleLayout,
|
|
32
|
+
N as NoAuthModuleLayout,
|
|
33
|
+
d2 as defaultMasterDetailDictionary,
|
|
34
|
+
d as defaultModuleLayoutDictionary,
|
|
35
|
+
d3 as defaultNoAuthModuleLayoutDictionary,
|
|
36
|
+
g2 as getMasterDetailLayoutComponentsDictionary,
|
|
37
|
+
g as getModuleLayoutComponentsDictionary,
|
|
38
|
+
g3 as getNoAuthModuleLayoutComponentsDictionary,
|
|
39
|
+
u2 as useAuth,
|
|
40
|
+
u as useMasterDetail,
|
|
41
|
+
u3 as useModule
|
|
42
42
|
};
|
|
@@ -1,108 +1,126 @@
|
|
|
1
|
-
import { createContext
|
|
2
|
-
import { voidFunction
|
|
3
|
-
import { WindowBase
|
|
4
|
-
import { a as
|
|
5
|
-
import { jsx
|
|
6
|
-
import { useResponsiveDesktop
|
|
7
|
-
const
|
|
1
|
+
import { createContext, useState, useRef, useMemo, useCallback } from "react";
|
|
2
|
+
import { voidFunction, useEnvironment, useModuleDictionary } from "@m4l/core";
|
|
3
|
+
import { WindowBase, SplitLayout } from "@m4l/components";
|
|
4
|
+
import { a as ModuleLayout, g as getModuleLayoutComponentsDictionary } from "../ModuleLayout/index.850f7dcf.js";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import { useResponsiveDesktop } from "@m4l/graphics";
|
|
7
|
+
const initialState = {
|
|
8
8
|
masterSelection: void 0,
|
|
9
|
-
onChangeMasterSelection:
|
|
10
|
-
}
|
|
11
|
-
|
|
9
|
+
onChangeMasterSelection: voidFunction
|
|
10
|
+
};
|
|
11
|
+
const MasterDetailContext = createContext(initialState);
|
|
12
|
+
function MasterDetailProvider(props) {
|
|
12
13
|
const {
|
|
13
|
-
children
|
|
14
|
-
} =
|
|
15
|
-
|
|
14
|
+
children
|
|
15
|
+
} = props;
|
|
16
|
+
const [masterSelection, setMasterSelection] = useState(void 0);
|
|
17
|
+
return /* @__PURE__ */ jsx(MasterDetailContext.Provider, {
|
|
16
18
|
value: {
|
|
17
|
-
masterSelection
|
|
18
|
-
onChangeMasterSelection:
|
|
19
|
+
masterSelection,
|
|
20
|
+
onChangeMasterSelection: setMasterSelection
|
|
19
21
|
},
|
|
20
|
-
children
|
|
22
|
+
children
|
|
21
23
|
});
|
|
22
24
|
}
|
|
23
|
-
function
|
|
24
|
-
let
|
|
25
|
-
|
|
25
|
+
function getTotalModuleActions(splitActions, moduleActions = [], viewDetailAction, isDesktop) {
|
|
26
|
+
let totalActions = isDesktop !== void 0 && isDesktop ? [...splitActions] : [viewDetailAction];
|
|
27
|
+
totalActions = moduleActions.concat(totalActions);
|
|
28
|
+
return totalActions;
|
|
26
29
|
}
|
|
27
|
-
function
|
|
30
|
+
function MasterDetailLayout(props) {
|
|
31
|
+
const {
|
|
32
|
+
moduleId,
|
|
33
|
+
masterComponent,
|
|
34
|
+
detailComponent,
|
|
35
|
+
moduleActions,
|
|
36
|
+
version
|
|
37
|
+
} = props;
|
|
28
38
|
const {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
} =
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
onClick: () => u("vertical"),
|
|
39
|
+
host_static_assets,
|
|
40
|
+
environment_assets
|
|
41
|
+
} = useEnvironment();
|
|
42
|
+
const [splitPosition, setSplitPosition] = useState("vertical");
|
|
43
|
+
const isDesktop = useResponsiveDesktop();
|
|
44
|
+
const moduleLayoutRef = useRef(null);
|
|
45
|
+
const {
|
|
46
|
+
getLabel
|
|
47
|
+
} = useModuleDictionary();
|
|
48
|
+
const splitActions = useMemo(() => [{
|
|
49
|
+
urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/masterdetaillayout/assets/icons/split_vertical.svg`,
|
|
50
|
+
onClick: () => onChangePostionInternal("vertical"),
|
|
42
51
|
visibility: "main",
|
|
43
|
-
label:
|
|
52
|
+
label: getLabel("master_detail_layout.split_vertical"),
|
|
44
53
|
tag: "vertical",
|
|
45
54
|
className: "splitactions",
|
|
46
|
-
disabled:
|
|
55
|
+
disabled: splitPosition === "vertical",
|
|
47
56
|
key: "vertical"
|
|
48
57
|
}, {
|
|
49
|
-
urlIcon: `${
|
|
50
|
-
onClick: () =>
|
|
58
|
+
urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/masterdetaillayout/assets/icons/split_horizontal.svg`,
|
|
59
|
+
onClick: () => onChangePostionInternal("horizontal"),
|
|
51
60
|
visibility: "main",
|
|
52
|
-
label:
|
|
61
|
+
label: getLabel("master_detail_layout.split_horizontal"),
|
|
53
62
|
tag: "horizontal",
|
|
54
63
|
className: "splitactions",
|
|
55
|
-
disabled:
|
|
64
|
+
disabled: splitPosition === "horizontal",
|
|
56
65
|
key: "horizontal"
|
|
57
66
|
}, {
|
|
58
|
-
urlIcon: `${
|
|
59
|
-
onClick: () =>
|
|
67
|
+
urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/masterdetaillayout/assets/icons/no_split.svg`,
|
|
68
|
+
onClick: () => onChangePostionInternal("none"),
|
|
60
69
|
visibility: "main",
|
|
61
|
-
label:
|
|
70
|
+
label: getLabel("master_detail_layout.no_split"),
|
|
62
71
|
tag: "none",
|
|
63
72
|
className: "splitactions",
|
|
64
|
-
disabled:
|
|
73
|
+
disabled: splitPosition === "none",
|
|
65
74
|
key: "none"
|
|
66
|
-
}], [
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
75
|
+
}], [getLabel, splitPosition]);
|
|
76
|
+
const onChangePostionInternal = useCallback((newPostion) => {
|
|
77
|
+
setSplitPosition(newPostion);
|
|
78
|
+
}, []);
|
|
79
|
+
const onClickViewDetail = useCallback(() => {
|
|
80
|
+
moduleLayoutRef.current?.openModal({
|
|
70
81
|
initialWidth: 500,
|
|
71
82
|
initialHeigth: 680,
|
|
72
|
-
window: /* @__PURE__ */
|
|
73
|
-
urlIcon: `${
|
|
74
|
-
title:
|
|
75
|
-
children: typeof
|
|
83
|
+
window: /* @__PURE__ */ jsx(WindowBase, {
|
|
84
|
+
urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/masterdetaillayout/assets/icons/view_detail.svg`,
|
|
85
|
+
title: getLabel("master_detail_layout.view_detail"),
|
|
86
|
+
children: typeof detailComponent === "function" ? detailComponent({}) : detailComponent
|
|
76
87
|
})
|
|
77
88
|
});
|
|
78
|
-
}, [
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
89
|
+
}, [detailComponent, getLabel]);
|
|
90
|
+
const viewDetailAction = useMemo(() => {
|
|
91
|
+
return {
|
|
92
|
+
urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/masterdetaillayout/assets/icons/view_detail.svg`,
|
|
93
|
+
onClick: onClickViewDetail,
|
|
94
|
+
disabled: false,
|
|
95
|
+
visibility: "allways",
|
|
96
|
+
label: getLabel("master_detail_layout.view_detail"),
|
|
97
|
+
tag: "none",
|
|
98
|
+
className: "",
|
|
99
|
+
key: "detail"
|
|
100
|
+
};
|
|
101
|
+
}, [environment_assets, onClickViewDetail]);
|
|
102
|
+
const finalModuleActions = useMemo(() => {
|
|
103
|
+
const actions = getTotalModuleActions(splitActions, moduleActions, viewDetailAction, isDesktop);
|
|
104
|
+
return actions;
|
|
105
|
+
}, [splitActions, moduleActions, isDesktop, viewDetailAction]);
|
|
106
|
+
return /* @__PURE__ */ jsx(MasterDetailProvider, {
|
|
107
|
+
children: /* @__PURE__ */ jsx(ModuleLayout, {
|
|
108
|
+
ref: moduleLayoutRef,
|
|
109
|
+
moduleId,
|
|
110
|
+
moduleActions: finalModuleActions,
|
|
111
|
+
version,
|
|
112
|
+
children: /* @__PURE__ */ jsx(SplitLayout, {
|
|
113
|
+
splitPosition: isDesktop ? splitPosition : "none",
|
|
114
|
+
firstPart: masterComponent,
|
|
115
|
+
secondPart: detailComponent
|
|
98
116
|
})
|
|
99
117
|
})
|
|
100
118
|
});
|
|
101
119
|
}
|
|
102
|
-
function
|
|
103
|
-
return ["master_detail_layout"].concat(
|
|
120
|
+
function getMasterDetailLayoutComponentsDictionary() {
|
|
121
|
+
return ["master_detail_layout"].concat(getModuleLayoutComponentsDictionary());
|
|
104
122
|
}
|
|
105
|
-
const
|
|
123
|
+
const defaultMasterDetailDictionary = {
|
|
106
124
|
master_detail_layout: {
|
|
107
125
|
split_vertical: "Split vertically",
|
|
108
126
|
split_horizontal: "Split horizontally",
|
|
@@ -111,8 +129,8 @@ const G = {
|
|
|
111
129
|
}
|
|
112
130
|
};
|
|
113
131
|
export {
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
132
|
+
MasterDetailContext as M,
|
|
133
|
+
MasterDetailLayout as a,
|
|
134
|
+
defaultMasterDetailDictionary as d,
|
|
135
|
+
getMasterDetailLayoutComponentsDictionary as g
|
|
118
136
|
};
|