@m4l/layouts 9.1.5 → 9.1.6
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 { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useState, useRef,
|
|
2
|
+
import { useState, useRef, useCallback, useMemo } from "react";
|
|
3
3
|
import { useEnvironment, useModuleDictionary } from "@m4l/core";
|
|
4
4
|
import { WindowBase, SplitLayout } from "@m4l/components";
|
|
5
5
|
import { M as ModuleLayout } from "../ModuleLayout/ModuleLayout.js";
|
|
@@ -26,10 +26,14 @@ function MasterDetailLayout(props) {
|
|
|
26
26
|
const isDesktop = useResponsiveDesktop();
|
|
27
27
|
const moduleLayoutRef = useRef(null);
|
|
28
28
|
const { getLabel } = useModuleDictionary();
|
|
29
|
+
const onChangePostionInternal = useCallback((newPostion) => {
|
|
30
|
+
setSplitPosition(newPostion);
|
|
31
|
+
}, []);
|
|
29
32
|
const splitActions = useMemo(
|
|
30
33
|
() => [
|
|
31
34
|
{
|
|
32
|
-
|
|
35
|
+
type: "menuItem",
|
|
36
|
+
startIcon: `${host_static_assets}/${environment_assets}/frontend/components/masterdetaillayout/assets/icons/split_vertical.svg`,
|
|
33
37
|
onClick: () => onChangePostionInternal("vertical"),
|
|
34
38
|
visibility: "main",
|
|
35
39
|
label: getLabel("master_detail_layout.split_vertical"),
|
|
@@ -39,7 +43,8 @@ function MasterDetailLayout(props) {
|
|
|
39
43
|
key: "vertical"
|
|
40
44
|
},
|
|
41
45
|
{
|
|
42
|
-
|
|
46
|
+
type: "menuItem",
|
|
47
|
+
startIcon: `${host_static_assets}/${environment_assets}/frontend/components/masterdetaillayout/assets/icons/split_horizontal.svg`,
|
|
43
48
|
onClick: () => onChangePostionInternal("horizontal"),
|
|
44
49
|
visibility: "main",
|
|
45
50
|
label: getLabel("master_detail_layout.split_horizontal"),
|
|
@@ -49,7 +54,8 @@ function MasterDetailLayout(props) {
|
|
|
49
54
|
key: "horizontal"
|
|
50
55
|
},
|
|
51
56
|
{
|
|
52
|
-
|
|
57
|
+
type: "menuItem",
|
|
58
|
+
startIcon: `${host_static_assets}/${environment_assets}/frontend/components/masterdetaillayout/assets/icons/no_split.svg`,
|
|
53
59
|
onClick: () => onChangePostionInternal("none"),
|
|
54
60
|
visibility: "main",
|
|
55
61
|
label: getLabel("master_detail_layout.no_split"),
|
|
@@ -59,12 +65,8 @@ function MasterDetailLayout(props) {
|
|
|
59
65
|
key: "none"
|
|
60
66
|
}
|
|
61
67
|
],
|
|
62
|
-
|
|
63
|
-
[getLabel, splitPosition]
|
|
68
|
+
[getLabel, splitPosition, environment_assets, host_static_assets, onChangePostionInternal]
|
|
64
69
|
);
|
|
65
|
-
const onChangePostionInternal = useCallback((newPostion) => {
|
|
66
|
-
setSplitPosition(newPostion);
|
|
67
|
-
}, []);
|
|
68
70
|
const onClickViewDetail = useCallback(() => {
|
|
69
71
|
moduleLayoutRef.current?.openModal({
|
|
70
72
|
initialWidth: 500,
|