@riil-frontend/component-topology 6.0.0-alpha.2 → 6.0.0-alpha.3
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/build/index.css +1 -1
- package/build/index.js +14 -14
- package/es/components/VerticalIconTab/VerticalIconTab.module.scss +2 -1
- package/es/components/collapse/Collapse.module.scss +12 -1
- package/es/core/editor/components/Sidebar/Sidebar.js +4 -1
- package/es/core/editor/components/Sidebar/Sidebar.module.scss +5 -1
- package/es/core/editor/components/Sidebar/views/BackgroundPanel/BackgroundPanel.js +1 -2
- package/es/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +1 -1
- package/es/core/editor/components/Sidebar/views/ImagePanel/CustomImagePanel.js +8 -33
- package/es/core/editor/components/Sidebar/views/ImagePanel/HtCustomImagePanel.js +45 -0
- package/es/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.js +44 -0
- package/es/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +2 -1
- package/es/core/editor/components/Toolbar/widgets/AddResourceButton.js +54 -6
- package/es/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +48 -0
- package/es/core/editor/components/settings/propertyViews/layer/DataTab/LayerAddResourceButton.js +12 -18
- package/es/core/editor/components/settings/propertyViews/layer/DataTab/LayerAddResourceDrawer.js +13 -46
- package/es/core/editor/components/settings/propertyViews/layer/DataTab/RelateData.js +2 -1
- package/es/core/editor/hooks/useLayerAddResource.js +28 -0
- package/es/core/models/TopoApp.js +1 -1
- package/lib/components/VerticalIconTab/VerticalIconTab.module.scss +2 -1
- package/lib/components/collapse/Collapse.module.scss +12 -1
- package/lib/core/editor/components/Sidebar/Sidebar.js +5 -1
- package/lib/core/editor/components/Sidebar/Sidebar.module.scss +5 -1
- package/lib/core/editor/components/Sidebar/views/BackgroundPanel/BackgroundPanel.js +1 -2
- package/lib/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +2 -2
- package/lib/core/editor/components/Sidebar/views/ImagePanel/CustomImagePanel.js +8 -32
- package/lib/core/editor/components/Sidebar/views/ImagePanel/HtCustomImagePanel.js +58 -0
- package/lib/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.js +56 -0
- package/lib/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +3 -1
- package/lib/core/editor/components/Toolbar/widgets/AddResourceButton.js +61 -6
- package/lib/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +63 -0
- package/lib/core/editor/components/settings/propertyViews/layer/DataTab/LayerAddResourceButton.js +13 -22
- package/lib/core/editor/components/settings/propertyViews/layer/DataTab/LayerAddResourceDrawer.js +12 -50
- package/lib/core/editor/components/settings/propertyViews/layer/DataTab/RelateData.js +2 -1
- package/lib/core/editor/hooks/useLayerAddResource.js +34 -0
- package/lib/core/models/TopoApp.js +1 -1
- package/package.json +2 -2
- package/es/core/editor/components/Toolbar/widgets/AddResourceWidget.js +0 -17
- package/lib/core/editor/components/Toolbar/widgets/AddResourceWidget.js +0 -27
@@ -11,7 +11,7 @@
|
|
11
11
|
width: 60px;
|
12
12
|
height: 100%;
|
13
13
|
padding-top: 4px;
|
14
|
-
|
14
|
+
border-right: 1px solid var(--tab-wrapped-border-line-color);
|
15
15
|
background: none !important;
|
16
16
|
|
17
17
|
:global {
|
@@ -46,6 +46,7 @@
|
|
46
46
|
width: 260px;
|
47
47
|
height: 100%;
|
48
48
|
transition: all .1s linear;
|
49
|
+
border-left: none !important;
|
49
50
|
border-right: 1px solid var(--tab-wrapped-border-line-color);
|
50
51
|
|
51
52
|
:global {
|
@@ -26,8 +26,19 @@
|
|
26
26
|
|
27
27
|
.#{$css-prefix}collapse-panel-content,
|
28
28
|
.#{$css-prefix}collapse-panel-expanded>.#{$css-prefix}collapse-panel-content {
|
29
|
-
padding-left: 32px;
|
29
|
+
// padding-left: 32px;
|
30
30
|
padding-top: 8px;
|
31
31
|
}
|
32
32
|
}
|
33
|
+
|
34
|
+
&.contentNoPadding {
|
35
|
+
|
36
|
+
:global {
|
37
|
+
|
38
|
+
.#{$css-prefix}collapse-panel-content,
|
39
|
+
.#{$css-prefix}collapse-panel-expanded>.#{$css-prefix}collapse-panel-content {
|
40
|
+
padding: 8px 0;
|
41
|
+
}
|
42
|
+
}
|
43
|
+
}
|
33
44
|
}
|
@@ -7,8 +7,11 @@ import ImagePanel from "./views/ImagePanel";
|
|
7
7
|
import BackgroundPanel from "./views/BackgroundPanel";
|
8
8
|
import CanvasPanel from "./views/CanvasPanel";
|
9
9
|
import styles from "./Sidebar.module.scss";
|
10
|
+
import classNames from 'classnames';
|
10
11
|
|
11
12
|
function Sidebar(props) {
|
13
|
+
var _classNames;
|
14
|
+
|
12
15
|
var topo = props.topo;
|
13
16
|
|
14
17
|
var _useState = useState(null),
|
@@ -65,7 +68,7 @@ function Sidebar(props) {
|
|
65
68
|
return /*#__PURE__*/React.createElement("div", {
|
66
69
|
className: styles.sidebar
|
67
70
|
}, /*#__PURE__*/React.createElement("div", {
|
68
|
-
className: styles.tabsContainer
|
71
|
+
className: classNames(styles.tabsContainer, (_classNames = {}, _classNames[styles.expanded] = !!activeKey, _classNames))
|
69
72
|
}, /*#__PURE__*/React.createElement(VerticalIconTab, {
|
70
73
|
activeKey: activeKey,
|
71
74
|
onChange: setActivekey
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import React, { useEffect, useMemo, useRef } from 'react';
|
2
2
|
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
3
|
-
import ImagePalette from "./
|
3
|
+
import ImagePalette from "./HtImagePalette";
|
4
4
|
import { getNodeDefaultIcons } from "../../../../../common/icons/icon";
|
5
5
|
/**
|
6
6
|
* 组件面板
|
@@ -1,6 +1,7 @@
|
|
1
|
-
import React, { useEffect, useRef } from 'react';
|
1
|
+
import React, { useEffect, useRef, useMemo } from 'react';
|
2
2
|
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
3
3
|
import { getUserCustomIconsForHt } from "../../../../../common/icons/icon";
|
4
|
+
import HtCustomImagePanel from "./HtCustomImagePanel";
|
4
5
|
/**
|
5
6
|
* 组件面板
|
6
7
|
* @param {*} props
|
@@ -8,38 +9,12 @@ import { getUserCustomIconsForHt } from "../../../../../common/icons/icon";
|
|
8
9
|
*/
|
9
10
|
|
10
11
|
export default function CustomImagePanel(props) {
|
11
|
-
var topo = props.topo;
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
var divRef = useRef();
|
16
|
-
useEffect(function () {
|
17
|
-
// 初始化
|
18
|
-
var icons = getUserCustomIconsForHt(topo);
|
19
|
-
var htTopo = topo.getHtTopo();
|
20
|
-
var container = divRef.current;
|
21
|
-
|
22
|
-
try {
|
23
|
-
viewRef.current = htTopo.createUploadImagePalette(container, {
|
24
|
-
icons: icons
|
25
|
-
});
|
26
|
-
} catch (error) {
|
27
|
-
rlog.error('初始化资源面板失败', error);
|
28
|
-
} // 注销组件
|
29
|
-
|
30
|
-
|
31
|
-
return function () {
|
32
|
-
if (viewRef.current) {
|
33
|
-
viewRef.current.destroy();
|
34
|
-
viewRef.current = null;
|
35
|
-
}
|
36
|
-
};
|
12
|
+
var topo = props.topo;
|
13
|
+
var icons = useMemo(function () {
|
14
|
+
return getUserCustomIconsForHt(topo);
|
37
15
|
}, []);
|
38
|
-
return /*#__PURE__*/React.createElement(
|
39
|
-
|
40
|
-
|
41
|
-
width: '100%',
|
42
|
-
height: '100%'
|
43
|
-
}
|
16
|
+
return /*#__PURE__*/React.createElement(HtCustomImagePanel, {
|
17
|
+
icons: icons,
|
18
|
+
topo: topo
|
44
19
|
});
|
45
20
|
}
|
@@ -0,0 +1,45 @@
|
|
1
|
+
import React, { useEffect, useRef } from 'react';
|
2
|
+
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
3
|
+
import { getUserCustomIconsForHt } from "../../../../../common/icons/icon";
|
4
|
+
/**
|
5
|
+
* 组件面板
|
6
|
+
* @param {*} props
|
7
|
+
* @returns
|
8
|
+
*/
|
9
|
+
|
10
|
+
export default function HtCustomImagePanel(props) {
|
11
|
+
var topo = props.topo,
|
12
|
+
icons = props.icons; // 组件
|
13
|
+
|
14
|
+
var viewRef = useRef(null); // div容器
|
15
|
+
|
16
|
+
var divRef = useRef();
|
17
|
+
useEffect(function () {
|
18
|
+
// 初始化
|
19
|
+
var htTopo = topo.getHtTopo();
|
20
|
+
var container = divRef.current;
|
21
|
+
|
22
|
+
try {
|
23
|
+
viewRef.current = htTopo.createUploadImagePalette(container, {
|
24
|
+
icons: icons
|
25
|
+
});
|
26
|
+
} catch (error) {
|
27
|
+
rlog.error('初始化资源面板失败', error);
|
28
|
+
} // 注销组件
|
29
|
+
|
30
|
+
|
31
|
+
return function () {
|
32
|
+
if (viewRef.current) {
|
33
|
+
viewRef.current.destroy();
|
34
|
+
viewRef.current = null;
|
35
|
+
}
|
36
|
+
};
|
37
|
+
}, []);
|
38
|
+
return /*#__PURE__*/React.createElement("div", {
|
39
|
+
ref: divRef,
|
40
|
+
style: {
|
41
|
+
width: '100%' // height: '100%',
|
42
|
+
|
43
|
+
}
|
44
|
+
});
|
45
|
+
}
|
@@ -0,0 +1,44 @@
|
|
1
|
+
import React, { useEffect, useRef } from 'react';
|
2
|
+
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
3
|
+
/**
|
4
|
+
* 组件面板
|
5
|
+
* @param {*} props
|
6
|
+
* @returns
|
7
|
+
*/
|
8
|
+
|
9
|
+
export default function HtImagePalette(props) {
|
10
|
+
var topo = props.topo,
|
11
|
+
icons = props.icons; // 组件
|
12
|
+
|
13
|
+
var viewRef = useRef(null); // div容器
|
14
|
+
|
15
|
+
var divRef = useRef();
|
16
|
+
useEffect(function () {
|
17
|
+
// 初始化
|
18
|
+
var htTopo = topo.getHtTopo();
|
19
|
+
var container = divRef.current;
|
20
|
+
|
21
|
+
try {
|
22
|
+
viewRef.current = htTopo.createImagePalette(container, {
|
23
|
+
icons: icons
|
24
|
+
});
|
25
|
+
} catch (error) {
|
26
|
+
rlog.error('初始化资源面板失败', error);
|
27
|
+
} // 注销组件
|
28
|
+
|
29
|
+
|
30
|
+
return function () {
|
31
|
+
if (viewRef.current) {
|
32
|
+
viewRef.current.destroy();
|
33
|
+
viewRef.current = null;
|
34
|
+
}
|
35
|
+
};
|
36
|
+
}, []);
|
37
|
+
return /*#__PURE__*/React.createElement("div", {
|
38
|
+
ref: divRef,
|
39
|
+
style: {
|
40
|
+
width: '100%' // height: '100%',
|
41
|
+
|
42
|
+
}
|
43
|
+
});
|
44
|
+
}
|
@@ -2,6 +2,7 @@ import _Collapse from "@alifd/next/es/collapse";
|
|
2
2
|
import _Button from "@alifd/next/es/button";
|
3
3
|
import _Icon from "@alifd/next/es/icon";
|
4
4
|
import React from 'react';
|
5
|
+
import classNames from 'classnames';
|
5
6
|
import CollapsePanel from "../../../../../../components/collapse/Panel";
|
6
7
|
import CollapseStyles from "../../../../../../components/collapse/Collapse.module.scss";
|
7
8
|
import CiTypeImagePanel from "./CiTypeImagePanel";
|
@@ -12,7 +13,7 @@ export default function ImagePanel(props) {
|
|
12
13
|
style: {
|
13
14
|
border: 'none'
|
14
15
|
},
|
15
|
-
className: CollapseStyles.collapse
|
16
|
+
className: classNames(CollapseStyles.collapse, CollapseStyles.contentNoPadding)
|
16
17
|
}, /*#__PURE__*/React.createElement(CollapsePanel, {
|
17
18
|
key: "\u8D44\u6E90\u56FE\u7247",
|
18
19
|
title: "\u8D44\u6E90\u56FE\u7247"
|
@@ -1,23 +1,71 @@
|
|
1
|
-
import React from 'react';
|
1
|
+
import React, { useEffect, useState } from 'react';
|
2
|
+
import { isGroup, isLayer } from "../../../../../utils/htElementDataUtil";
|
3
|
+
import useLayerAddResource from "../../../hooks/useLayerAddResource";
|
4
|
+
import LayerAddResourceDrawer from "../../settings/propertyViews/layer/DataTab/LayerAddResourceDrawer";
|
2
5
|
import ButtonBox from "./components/ButtonBox";
|
3
6
|
import WidgetBox from "./WidgetBox";
|
4
7
|
|
8
|
+
function getAddType(selection) {
|
9
|
+
if (selection.length === 1) {
|
10
|
+
var data = selection[0];
|
11
|
+
|
12
|
+
if (isLayer(data)) {
|
13
|
+
return 'layer';
|
14
|
+
} else if (isGroup(data)) {
|
15
|
+
return 'group';
|
16
|
+
}
|
17
|
+
}
|
18
|
+
}
|
19
|
+
|
5
20
|
function AddResourceButton(props) {
|
6
21
|
var showLabel = props.showLabel,
|
7
22
|
topo = props.topo,
|
8
|
-
topoEdit = props.topoEdit
|
23
|
+
topoEdit = props.topoEdit,
|
24
|
+
editorProps = props.editorProps; // 选中的元素
|
25
|
+
|
26
|
+
var selection = topo.selectionManager.useSelection();
|
27
|
+
|
28
|
+
var _useState = useState(getAddType(selection)),
|
29
|
+
addType = _useState[0],
|
30
|
+
setAddType = _useState[1]; // 选中分层添加
|
31
|
+
|
32
|
+
|
33
|
+
var layerAddResource = useLayerAddResource({
|
34
|
+
topo: topo,
|
35
|
+
topoEdit: topoEdit
|
36
|
+
});
|
37
|
+
useEffect(function () {
|
38
|
+
setAddType(getAddType(selection));
|
39
|
+
}, [selection]);
|
40
|
+
|
41
|
+
var handleClick = function handleClick() {
|
42
|
+
if (!addType) {
|
43
|
+
// 未选中分层、分区添加资源
|
44
|
+
topoEdit.showGlobalAddResourceDrawer();
|
45
|
+
} else if (addType === 'layer') {
|
46
|
+
// 选中分层添加资源
|
47
|
+
layerAddResource.open();
|
48
|
+
} else if (addType === 'group') {
|
49
|
+
// 选中区域添加资源
|
50
|
+
var group = selection[0];
|
51
|
+
topoEdit.groupAddResource.open(group);
|
52
|
+
}
|
53
|
+
};
|
54
|
+
|
9
55
|
return /*#__PURE__*/React.createElement(WidgetBox, {
|
10
56
|
label: "\u6DFB\u52A0\u8D44\u6E90",
|
11
57
|
tooltip: "\u6DFB\u52A0\u8D44\u6E90",
|
12
58
|
showLabel: showLabel
|
13
59
|
}, /*#__PURE__*/React.createElement(ButtonBox, {
|
14
|
-
onClick:
|
15
|
-
topoEdit.showGlobalAddResourceDrawer();
|
16
|
-
}
|
60
|
+
onClick: handleClick
|
17
61
|
}, /*#__PURE__*/React.createElement("img", {
|
18
62
|
src: "/img/topo/editor/toolbar/add/Normal.svg",
|
19
63
|
alt: ""
|
20
|
-
}))
|
64
|
+
})), addType === 'layer' && /*#__PURE__*/React.createElement(LayerAddResourceDrawer, {
|
65
|
+
layer: selection[0],
|
66
|
+
editorProps: editorProps,
|
67
|
+
layerAddResource: layerAddResource
|
68
|
+
}));
|
21
69
|
}
|
22
70
|
|
23
71
|
export default AddResourceButton;
|
@@ -0,0 +1,48 @@
|
|
1
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
2
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
3
|
+
import React, { useState, useEffect } from 'react';
|
4
|
+
import ResourceSelectDrawer from "../../../../../../../components/NetworkTopoResourceSelectDrawer";
|
5
|
+
|
6
|
+
var LayerAddResourceDrawer = function LayerAddResourceDrawer(props) {
|
7
|
+
var visible = props.visible,
|
8
|
+
layer = props.layer,
|
9
|
+
topo = props.topo,
|
10
|
+
topoEdit = props.topoEdit,
|
11
|
+
onClose = props.onClose;
|
12
|
+
|
13
|
+
var onOk = /*#__PURE__*/function () {
|
14
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(selected) {
|
15
|
+
var layerData;
|
16
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
17
|
+
while (1) {
|
18
|
+
switch (_context.prev = _context.next) {
|
19
|
+
case 0:
|
20
|
+
layerData = {
|
21
|
+
id: layer.tag,
|
22
|
+
tag: layer.attrObject.tag
|
23
|
+
};
|
24
|
+
_context.next = 3;
|
25
|
+
return topoEdit.addLayerResources(layerData, selected);
|
26
|
+
|
27
|
+
case 3:
|
28
|
+
case "end":
|
29
|
+
return _context.stop();
|
30
|
+
}
|
31
|
+
}
|
32
|
+
}, _callee);
|
33
|
+
}));
|
34
|
+
|
35
|
+
return function onOk(_x) {
|
36
|
+
return _ref.apply(this, arguments);
|
37
|
+
};
|
38
|
+
}();
|
39
|
+
|
40
|
+
return /*#__PURE__*/React.createElement(ResourceSelectDrawer, {
|
41
|
+
visible: visible,
|
42
|
+
getExcludeIds: topoEdit.getAllNodeResourceIds,
|
43
|
+
onOk: onOk,
|
44
|
+
onClose: onClose
|
45
|
+
});
|
46
|
+
};
|
47
|
+
|
48
|
+
export default LayerAddResourceDrawer;
|
package/es/core/editor/components/settings/propertyViews/layer/DataTab/LayerAddResourceButton.js
CHANGED
@@ -1,35 +1,29 @@
|
|
1
|
-
import React
|
1
|
+
import React from 'react';
|
2
|
+
import useLayerAddResource from "../../../../../hooks/useLayerAddResource";
|
2
3
|
import AddResourceButton from "../../../common/AddResourceButton";
|
3
4
|
import LayerAddResourceDrawer from "./LayerAddResourceDrawer";
|
4
5
|
export default function LayerAddResourceButton(props) {
|
5
6
|
var topo = props.topo,
|
6
|
-
|
7
|
+
editorProps = props.editorProps,
|
7
8
|
layerData = props.layerData,
|
8
|
-
CustomAddResourceDrawer = props.addResourceDrawer,
|
9
9
|
onAdd = props.onAdd,
|
10
10
|
topoEdit = props.topoEdit;
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
var AddResourceDrawer = CustomAddResourceDrawer || LayerAddResourceDrawer;
|
11
|
+
var layerAddResource = useLayerAddResource({
|
12
|
+
topo: topo,
|
13
|
+
topoEdit: topoEdit,
|
14
|
+
layerData: layerData
|
15
|
+
});
|
17
16
|
|
18
17
|
var handleClick = function handleClick() {
|
19
|
-
|
18
|
+
layerAddResource.open();
|
20
19
|
};
|
21
20
|
|
22
21
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(AddResourceButton, {
|
23
22
|
onClick: handleClick
|
24
|
-
}), /*#__PURE__*/React.createElement(
|
25
|
-
visible: drawerVisible,
|
23
|
+
}), /*#__PURE__*/React.createElement(LayerAddResourceDrawer, {
|
26
24
|
layer: layerData,
|
27
|
-
|
28
|
-
|
29
|
-
onClose: function onClose() {
|
30
|
-
setDrawerVisible(false);
|
31
|
-
},
|
32
|
-
setVisible: setDrawerVisible
|
25
|
+
editorProps: editorProps,
|
26
|
+
layerAddResource: layerAddResource
|
33
27
|
}));
|
34
28
|
}
|
35
29
|
;
|
package/es/core/editor/components/settings/propertyViews/layer/DataTab/LayerAddResourceDrawer.js
CHANGED
@@ -1,48 +1,15 @@
|
|
1
|
-
import
|
2
|
-
import
|
3
|
-
import
|
4
|
-
|
5
|
-
|
6
|
-
var
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(selected) {
|
15
|
-
var layerData;
|
16
|
-
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
17
|
-
while (1) {
|
18
|
-
switch (_context.prev = _context.next) {
|
19
|
-
case 0:
|
20
|
-
layerData = {
|
21
|
-
id: layer.tag,
|
22
|
-
tag: layer.attrObject.tag
|
23
|
-
};
|
24
|
-
_context.next = 3;
|
25
|
-
return topoEdit.addLayerResources(layerData, selected);
|
26
|
-
|
27
|
-
case 3:
|
28
|
-
case "end":
|
29
|
-
return _context.stop();
|
30
|
-
}
|
31
|
-
}
|
32
|
-
}, _callee);
|
33
|
-
}));
|
34
|
-
|
35
|
-
return function onOk(_x) {
|
36
|
-
return _ref.apply(this, arguments);
|
37
|
-
};
|
38
|
-
}();
|
39
|
-
|
40
|
-
return /*#__PURE__*/React.createElement(ResourceSelectDrawer, {
|
41
|
-
visible: visible,
|
42
|
-
getExcludeIds: topoEdit.getAllNodeResourceIds,
|
43
|
-
onOk: onOk,
|
44
|
-
onClose: onClose
|
45
|
-
});
|
46
|
-
};
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
2
|
+
import React from 'react';
|
3
|
+
import DefaultLayerAddResourceDrawer from "./DefaultLayerAddResourceDrawer";
|
4
|
+
|
5
|
+
function LayerAddResourceDrawer(props) {
|
6
|
+
var layer = props.layer,
|
7
|
+
editorProps = props.editorProps,
|
8
|
+
layerAddResource = props.layerAddResource;
|
9
|
+
var AddResourceDrawer = (editorProps === null || editorProps === void 0 ? void 0 : editorProps.layerResourceSelectComponent) || DefaultLayerAddResourceDrawer;
|
10
|
+
return /*#__PURE__*/React.createElement(AddResourceDrawer, _extends({
|
11
|
+
layer: layer
|
12
|
+
}, layerAddResource.drawerProps));
|
13
|
+
}
|
47
14
|
|
48
15
|
export default LayerAddResourceDrawer;
|
@@ -18,9 +18,10 @@ export default function LayerRelateData(props) {
|
|
18
18
|
title: "\u5173\u8054\u8D44\u6E90",
|
19
19
|
extra: /*#__PURE__*/React.createElement(LayerAddResourceButton, {
|
20
20
|
topo: topo,
|
21
|
+
topoEdit: topoEditApi,
|
22
|
+
editorProps: editorProps,
|
21
23
|
layer: layer,
|
22
24
|
layerData: values,
|
23
|
-
topoEdit: topoEditApi,
|
24
25
|
onAdd: function onAdd() {
|
25
26
|
/* TODO 刷新列表 refreshList */
|
26
27
|
},
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import { useState } from 'react';
|
2
|
+
export default function useLayerAddResource(props) {
|
3
|
+
var topo = props.topo,
|
4
|
+
layer = props.layer,
|
5
|
+
topoEdit = props.topoEdit;
|
6
|
+
|
7
|
+
var _useState = useState(false),
|
8
|
+
drawerVisible = _useState[0],
|
9
|
+
setDrawerVisible = _useState[1];
|
10
|
+
|
11
|
+
return {
|
12
|
+
open: function open() {
|
13
|
+
return setDrawerVisible(true);
|
14
|
+
},
|
15
|
+
close: function close() {
|
16
|
+
return setDrawerVisible(false);
|
17
|
+
},
|
18
|
+
drawerProps: {
|
19
|
+
visible: drawerVisible,
|
20
|
+
setVisible: setDrawerVisible,
|
21
|
+
onClose: function onClose() {
|
22
|
+
setDrawerVisible(false);
|
23
|
+
},
|
24
|
+
topo: topo,
|
25
|
+
topoEdit: topoEdit
|
26
|
+
}
|
27
|
+
};
|
28
|
+
}
|
@@ -22,7 +22,7 @@ import topoFactory from "./topoFactory";
|
|
22
22
|
import ElementTagTipConfig from "./tagstips/ElementTagTipConfig";
|
23
23
|
import SelectionManager from "./SelectionManager"; // eslint-disable-next-line no-undef
|
24
24
|
|
25
|
-
var version = typeof "6.0.0-alpha.
|
25
|
+
var version = typeof "6.0.0-alpha.3" === 'string' ? "6.0.0-alpha.3" : null;
|
26
26
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
27
27
|
/**
|
28
28
|
* 拓扑显示和编辑
|
@@ -11,7 +11,7 @@
|
|
11
11
|
width: 60px;
|
12
12
|
height: 100%;
|
13
13
|
padding-top: 4px;
|
14
|
-
|
14
|
+
border-right: 1px solid var(--tab-wrapped-border-line-color);
|
15
15
|
background: none !important;
|
16
16
|
|
17
17
|
:global {
|
@@ -46,6 +46,7 @@
|
|
46
46
|
width: 260px;
|
47
47
|
height: 100%;
|
48
48
|
transition: all .1s linear;
|
49
|
+
border-left: none !important;
|
49
50
|
border-right: 1px solid var(--tab-wrapped-border-line-color);
|
50
51
|
|
51
52
|
:global {
|
@@ -26,8 +26,19 @@
|
|
26
26
|
|
27
27
|
.#{$css-prefix}collapse-panel-content,
|
28
28
|
.#{$css-prefix}collapse-panel-expanded>.#{$css-prefix}collapse-panel-content {
|
29
|
-
padding-left: 32px;
|
29
|
+
// padding-left: 32px;
|
30
30
|
padding-top: 8px;
|
31
31
|
}
|
32
32
|
}
|
33
|
+
|
34
|
+
&.contentNoPadding {
|
35
|
+
|
36
|
+
:global {
|
37
|
+
|
38
|
+
.#{$css-prefix}collapse-panel-content,
|
39
|
+
.#{$css-prefix}collapse-panel-expanded>.#{$css-prefix}collapse-panel-content {
|
40
|
+
padding: 8px 0;
|
41
|
+
}
|
42
|
+
}
|
43
|
+
}
|
33
44
|
}
|
@@ -23,11 +23,15 @@ var _CanvasPanel = _interopRequireDefault(require("./views/CanvasPanel"));
|
|
23
23
|
|
24
24
|
var _SidebarModule = _interopRequireDefault(require("./Sidebar.module.scss"));
|
25
25
|
|
26
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
27
|
+
|
26
28
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
27
29
|
|
28
30
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
29
31
|
|
30
32
|
function Sidebar(props) {
|
33
|
+
var _classNames;
|
34
|
+
|
31
35
|
var topo = props.topo;
|
32
36
|
|
33
37
|
var _useState = (0, _react.useState)(null),
|
@@ -84,7 +88,7 @@ function Sidebar(props) {
|
|
84
88
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
85
89
|
className: _SidebarModule["default"].sidebar
|
86
90
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
87
|
-
className: _SidebarModule["default"].tabsContainer
|
91
|
+
className: (0, _classnames["default"])(_SidebarModule["default"].tabsContainer, (_classNames = {}, _classNames[_SidebarModule["default"].expanded] = !!activeKey, _classNames))
|
88
92
|
}, /*#__PURE__*/_react["default"].createElement(_VerticalIconTab["default"], {
|
89
93
|
activeKey: activeKey,
|
90
94
|
onChange: setActivekey
|
@@ -9,7 +9,7 @@ var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
10
10
|
var _rlog = _interopRequireDefault(require("@riil-frontend/component-topology-utils/es/rlog"));
|
11
11
|
|
12
|
-
var
|
12
|
+
var _HtImagePalette = _interopRequireDefault(require("./HtImagePalette"));
|
13
13
|
|
14
14
|
var _icon = require("../../../../../common/icons/icon");
|
15
15
|
|
@@ -27,7 +27,7 @@ function CiTypeImagePanel(props) {
|
|
27
27
|
var icons = (0, _react.useMemo)(function () {
|
28
28
|
return (0, _icon.getNodeDefaultIcons)(topo);
|
29
29
|
}, []);
|
30
|
-
return /*#__PURE__*/_react["default"].createElement(
|
30
|
+
return /*#__PURE__*/_react["default"].createElement(_HtImagePalette["default"], {
|
31
31
|
icons: icons,
|
32
32
|
topo: topo
|
33
33
|
});
|