@riil-frontend/component-topology 6.0.0-alpha.4 → 6.0.0-alpha.5
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/1.js +2 -2
- package/build/2.js +1 -1
- package/build/index.css +1 -1
- package/build/index.js +21 -21
- package/es/components/VerticalIconTab/VerticalIconTab.module.scss +1 -1
- package/es/core/editor/components/Sidebar/Sidebar.js +14 -49
- package/es/core/editor/components/Sidebar/panes.js +32 -0
- package/es/core/editor/components/Sidebar/views/CanvasPanel/{ImagePanel.js → CanvasPanel.js} +1 -1
- package/es/core/editor/components/Sidebar/views/CanvasPanel/index.js +1 -1
- package/es/core/editor/components/Sidebar/views/ImagePanel/HtCustomImagePanel.js +2 -5
- package/es/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.js +2 -4
- package/es/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.module.scss +5 -0
- package/es/core/editor/components/Toolbar/EditorToolbar.js +9 -6
- package/es/core/editor/components/Toolbar/Toolbar.js +1 -1
- package/es/core/editor/components/Toolbar/Toolbar.module.scss +14 -3
- package/es/core/editor/components/Toolbar/widgets/AddResourceButton.js +6 -5
- package/es/core/editor/components/Toolbar/widgets/CanvasMoveWidget.js +13 -2
- package/es/core/editor/components/Toolbar/widgets/CanvasSelectWidget.js +11 -2
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +133 -3
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.module.scss +46 -0
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +47 -0
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.module.scss +31 -0
- package/es/core/editor/components/Toolbar/widgets/HistoryRedoButton.js +2 -1
- package/es/core/editor/components/Toolbar/widgets/HistoryUndoButton.js +3 -2
- package/es/core/editor/components/Toolbar/widgets/WidgetBox.js +2 -19
- package/es/core/editor/components/Toolbar/widgets/components/ButtonBox.js +4 -2
- package/es/core/{store/models → editor/store}/background.js +0 -0
- package/es/core/{store/models → editor/store}/historyManager.js +0 -0
- package/es/core/{store/models → editor/store}/topoEdit.js +5 -1
- package/es/core/hooks/useTopoEdit.js +21 -54
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/store/coreModels.js +6 -7
- package/lib/components/VerticalIconTab/VerticalIconTab.module.scss +1 -1
- package/lib/core/editor/components/Sidebar/Sidebar.js +14 -53
- package/lib/core/editor/components/Sidebar/panes.js +45 -0
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/{ImagePanel.js → CanvasPanel.js} +2 -2
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/index.js +2 -2
- package/lib/core/editor/components/Sidebar/views/ImagePanel/HtCustomImagePanel.js +2 -5
- package/lib/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.js +3 -4
- package/lib/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.module.scss +5 -0
- package/lib/core/editor/components/Toolbar/EditorToolbar.js +10 -6
- package/lib/core/editor/components/Toolbar/Toolbar.js +1 -1
- package/lib/core/editor/components/Toolbar/Toolbar.module.scss +14 -3
- package/lib/core/editor/components/Toolbar/widgets/AddResourceButton.js +6 -5
- package/lib/core/editor/components/Toolbar/widgets/CanvasMoveWidget.js +13 -2
- package/lib/core/editor/components/Toolbar/widgets/CanvasSelectWidget.js +11 -2
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +143 -3
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.module.scss +46 -0
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +62 -0
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.module.scss +31 -0
- package/lib/core/editor/components/Toolbar/widgets/HistoryRedoButton.js +3 -1
- package/lib/core/editor/components/Toolbar/widgets/HistoryUndoButton.js +3 -1
- package/lib/core/editor/components/Toolbar/widgets/WidgetBox.js +4 -23
- package/lib/core/editor/components/Toolbar/widgets/components/ButtonBox.js +4 -2
- package/lib/core/{store/models → editor/store}/background.js +0 -0
- package/lib/core/{store/models → editor/store}/historyManager.js +0 -0
- package/lib/core/{store/models → editor/store}/topoEdit.js +5 -1
- package/lib/core/hooks/useTopoEdit.js +21 -56
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/store/coreModels.js +5 -7
- package/package.json +2 -2
@@ -45,9 +45,9 @@
|
|
45
45
|
.content {
|
46
46
|
width: 260px;
|
47
47
|
height: 100%;
|
48
|
-
transition: all .1s linear;
|
49
48
|
border-left: none !important;
|
50
49
|
border-right: 1px solid var(--tab-wrapped-border-line-color);
|
50
|
+
transition: width .1s linear;
|
51
51
|
|
52
52
|
:global {
|
53
53
|
.#{$css-prefix}tabs-tabpane {
|
@@ -1,63 +1,24 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
2
2
|
import React, { useState } from 'react';
|
3
|
-
import VerticalIconTab from "../../../../components/VerticalIconTab";
|
4
|
-
import LinkPanel from "./views/LinkPanel";
|
5
|
-
import ComponentPanel from "./views/ComponentPanel";
|
6
|
-
import ImagePanel from "./views/ImagePanel";
|
7
|
-
import BackgroundPanel from "./views/BackgroundPanel";
|
8
|
-
import CanvasPanel from "./views/CanvasPanel";
|
9
|
-
import styles from "./Sidebar.module.scss";
|
10
3
|
import classNames from 'classnames';
|
4
|
+
import Tab from "../../../../components/VerticalIconTab";
|
5
|
+
import panes from "./panes";
|
6
|
+
import styles from "./Sidebar.module.scss";
|
11
7
|
|
12
8
|
function Sidebar(props) {
|
13
9
|
var _classNames;
|
14
10
|
|
15
11
|
var topo = props.topo;
|
16
12
|
|
17
|
-
var
|
18
|
-
|
19
|
-
|
13
|
+
var _topo$store$useModel = topo.store.useModel('topoEdit'),
|
14
|
+
topoEditState = _topo$store$useModel[0],
|
15
|
+
topoEditDispatchers = _topo$store$useModel[1];
|
20
16
|
|
21
|
-
var
|
22
|
-
title: '链路',
|
23
|
-
key: '1',
|
24
|
-
icon: '/img/topo/editor/sidebar/icon/链路.svg',
|
25
|
-
content: LinkPanel
|
26
|
-
}, {
|
27
|
-
title: '组件',
|
28
|
-
key: '2',
|
29
|
-
icon: '/img/topo/editor/sidebar/icon/组件.svg',
|
30
|
-
content: ComponentPanel
|
31
|
-
}, {
|
32
|
-
title: '图片',
|
33
|
-
key: '3',
|
34
|
-
icon: '/img/topo/editor/sidebar/icon/图片.svg',
|
35
|
-
content: ImagePanel
|
36
|
-
}, {
|
37
|
-
title: '背景',
|
38
|
-
key: '4',
|
39
|
-
icon: '/img/topo/editor/sidebar/icon/背景.svg',
|
40
|
-
content: BackgroundPanel
|
41
|
-
}, {
|
42
|
-
title: '画布',
|
43
|
-
key: '5',
|
44
|
-
icon: '/img/topo/editor/sidebar/icon/画布.svg',
|
45
|
-
content: CanvasPanel
|
46
|
-
}].map(function (item) {
|
47
|
-
var View = item.content;
|
48
|
-
return _extends({}, item, {
|
49
|
-
content: function content() {
|
50
|
-
return /*#__PURE__*/React.createElement(View, _extends({}, props, {
|
51
|
-
topo: topo,
|
52
|
-
active: activeKey === item.key
|
53
|
-
}));
|
54
|
-
}
|
55
|
-
});
|
56
|
-
});
|
17
|
+
var activeKey = topoEditState.resourceTabactiveKey;
|
57
18
|
|
58
19
|
var renderTabItem = function renderTabItem(pane) {
|
59
20
|
var View = pane.content;
|
60
|
-
return /*#__PURE__*/React.createElement(
|
21
|
+
return /*#__PURE__*/React.createElement(Tab.Item, _extends({
|
61
22
|
key: pane.key
|
62
23
|
}, pane), /*#__PURE__*/React.createElement(View, {
|
63
24
|
topo: topo,
|
@@ -69,9 +30,13 @@ function Sidebar(props) {
|
|
69
30
|
className: styles.sidebar
|
70
31
|
}, /*#__PURE__*/React.createElement("div", {
|
71
32
|
className: classNames(styles.tabsContainer, (_classNames = {}, _classNames[styles.expanded] = !!activeKey, _classNames))
|
72
|
-
}, /*#__PURE__*/React.createElement(
|
33
|
+
}, /*#__PURE__*/React.createElement(Tab, {
|
73
34
|
activeKey: activeKey,
|
74
|
-
onChange:
|
35
|
+
onChange: function onChange(key) {
|
36
|
+
return topoEditDispatchers.update({
|
37
|
+
resourceTabactiveKey: key
|
38
|
+
});
|
39
|
+
}
|
75
40
|
}, panes.map(renderTabItem))));
|
76
41
|
}
|
77
42
|
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import BackgroundPanel from "./views/BackgroundPanel";
|
2
|
+
import CanvasPanel from "./views/CanvasPanel";
|
3
|
+
import ComponentPanel from "./views/ComponentPanel";
|
4
|
+
import ImagePanel from "./views/ImagePanel";
|
5
|
+
import LinkPanel from "./views/LinkPanel";
|
6
|
+
var panes = [{
|
7
|
+
title: '链路',
|
8
|
+
key: '1',
|
9
|
+
icon: '/img/topo/editor/sidebar/icon/链路.svg',
|
10
|
+
content: LinkPanel
|
11
|
+
}, {
|
12
|
+
title: '组件',
|
13
|
+
key: '2',
|
14
|
+
icon: '/img/topo/editor/sidebar/icon/组件.svg',
|
15
|
+
content: ComponentPanel
|
16
|
+
}, {
|
17
|
+
title: '图片',
|
18
|
+
key: '3',
|
19
|
+
icon: '/img/topo/editor/sidebar/icon/图片.svg',
|
20
|
+
content: ImagePanel
|
21
|
+
}, {
|
22
|
+
title: '背景',
|
23
|
+
key: '4',
|
24
|
+
icon: '/img/topo/editor/sidebar/icon/背景.svg',
|
25
|
+
content: BackgroundPanel
|
26
|
+
}, {
|
27
|
+
title: '画布',
|
28
|
+
key: '5',
|
29
|
+
icon: '/img/topo/editor/sidebar/icon/画布.svg',
|
30
|
+
content: CanvasPanel
|
31
|
+
}];
|
32
|
+
export default panes;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import Panel from "./
|
1
|
+
import Panel from "./CanvasPanel";
|
2
2
|
export default Panel;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import React, { useEffect, useRef } from 'react';
|
2
2
|
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
3
|
-
import
|
3
|
+
import styles from "./HtImagePalette.module.scss";
|
4
4
|
/**
|
5
5
|
* 组件面板
|
6
6
|
* @param {*} props
|
@@ -37,9 +37,6 @@ export default function HtCustomImagePanel(props) {
|
|
37
37
|
}, []);
|
38
38
|
return /*#__PURE__*/React.createElement("div", {
|
39
39
|
ref: divRef,
|
40
|
-
|
41
|
-
width: '100%' // height: '100%',
|
42
|
-
|
43
|
-
}
|
40
|
+
className: styles.container
|
44
41
|
});
|
45
42
|
}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import React, { useEffect, useRef } from 'react';
|
2
2
|
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
3
|
+
import styles from "./HtImagePalette.module.scss";
|
3
4
|
/**
|
4
5
|
* 组件面板
|
5
6
|
* @param {*} props
|
@@ -36,9 +37,6 @@ export default function HtImagePalette(props) {
|
|
36
37
|
}, []);
|
37
38
|
return /*#__PURE__*/React.createElement("div", {
|
38
39
|
ref: divRef,
|
39
|
-
|
40
|
-
width: '100%' // height: '100%',
|
41
|
-
|
42
|
-
}
|
40
|
+
className: styles.container
|
43
41
|
});
|
44
42
|
}
|
@@ -1,24 +1,27 @@
|
|
1
1
|
import _Button from "@alifd/next/es/button";
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
3
|
+
import classNames from 'classnames';
|
3
4
|
import React, { useState } from 'react';
|
4
5
|
import buttons from "./buttons";
|
5
6
|
import Toolbar from "./Toolbar";
|
6
7
|
import styles from "./Toolbar.module.scss";
|
7
8
|
|
8
9
|
function EditorToolbar(props) {
|
10
|
+
var _classNames;
|
11
|
+
|
9
12
|
var _useState = useState(true),
|
10
|
-
|
11
|
-
|
13
|
+
expanded = _useState[0],
|
14
|
+
setExpanded = _useState[1];
|
12
15
|
|
13
16
|
return /*#__PURE__*/React.createElement("div", {
|
14
|
-
className: styles.
|
17
|
+
className: classNames(styles.toolbarWrap, (_classNames = {}, _classNames[styles.normal] = expanded, _classNames[styles.expanded] = !expanded, _classNames))
|
15
18
|
}, /*#__PURE__*/React.createElement("div", {
|
16
19
|
className: styles.content
|
17
20
|
}, /*#__PURE__*/React.createElement(Toolbar, null, buttons.map(function (ToolbarButton, index) {
|
18
21
|
return /*#__PURE__*/React.createElement(ToolbarButton, _extends({
|
19
22
|
key: index
|
20
23
|
}, props, {
|
21
|
-
showLabel:
|
24
|
+
showLabel: expanded
|
22
25
|
}));
|
23
26
|
}))), /*#__PURE__*/React.createElement("div", {
|
24
27
|
className: styles.right
|
@@ -26,10 +29,10 @@ function EditorToolbar(props) {
|
|
26
29
|
type: "normal",
|
27
30
|
text: true,
|
28
31
|
onClick: function onClick() {
|
29
|
-
|
32
|
+
setExpanded(!expanded);
|
30
33
|
}
|
31
34
|
}, /*#__PURE__*/React.createElement("img", {
|
32
|
-
src:
|
35
|
+
src: expanded ? '/img/topo/editor/toolbar/ToolbarNarrowed/Normal.svg' : '/img/topo/editor/toolbar/ToolbbbarExpand/Normal.svg',
|
33
36
|
alt: "",
|
34
37
|
style: {
|
35
38
|
verticalAlign: 'middle'
|
@@ -1,19 +1,30 @@
|
|
1
|
-
.
|
2
|
-
height: 54px;
|
1
|
+
.toolbarWrap {
|
3
2
|
display: flex;
|
4
3
|
align-items: center;
|
5
4
|
justify-content: center;
|
5
|
+
transition: all .1s linear;
|
6
|
+
|
7
|
+
&.normal {
|
8
|
+
height: 54px;
|
9
|
+
}
|
10
|
+
|
11
|
+
&.expanded {
|
12
|
+
height: 40px;
|
13
|
+
}
|
6
14
|
}
|
7
15
|
|
8
16
|
.content {
|
17
|
+
height: 100%;
|
9
18
|
flex: 1;
|
10
19
|
display: flex;
|
11
20
|
align-items: center;
|
12
21
|
justify-content: center;
|
22
|
+
overflow-x: auto;
|
13
23
|
}
|
14
24
|
|
15
|
-
.
|
25
|
+
.toolbarContainer {
|
16
26
|
display: flex;
|
27
|
+
min-width: 1060px;
|
17
28
|
}
|
18
29
|
|
19
30
|
.right {
|
@@ -27,16 +27,16 @@ function AddResourceButton(props) {
|
|
27
27
|
|
28
28
|
var _useState = useState(getAddType(selection)),
|
29
29
|
addType = _useState[0],
|
30
|
-
setAddType = _useState[1];
|
30
|
+
setAddType = _useState[1];
|
31
31
|
|
32
|
+
useEffect(function () {
|
33
|
+
setAddType(getAddType(selection));
|
34
|
+
}, [selection]); // 选中分层添加
|
32
35
|
|
33
36
|
var layerAddResource = useLayerAddResource({
|
34
37
|
topo: topo,
|
35
38
|
topoEdit: topoEdit
|
36
39
|
});
|
37
|
-
useEffect(function () {
|
38
|
-
setAddType(getAddType(selection));
|
39
|
-
}, [selection]);
|
40
40
|
|
41
41
|
var handleClick = function handleClick() {
|
42
42
|
if (!addType) {
|
@@ -48,7 +48,8 @@ function AddResourceButton(props) {
|
|
48
48
|
} else if (addType === 'group') {
|
49
49
|
// 选中区域添加资源
|
50
50
|
var group = selection[0];
|
51
|
-
|
51
|
+
var htGroup = topo.getHtTopo().getGraphView().getDataModel().getDataById(group.id);
|
52
|
+
topoEdit.groupAddResource.open(htGroup);
|
52
53
|
}
|
53
54
|
};
|
54
55
|
|
@@ -3,12 +3,23 @@ import WidgetBox from "./WidgetBox";
|
|
3
3
|
import ButtonBox from "./components/ButtonBox";
|
4
4
|
|
5
5
|
function CanvasMoveWidget(props) {
|
6
|
-
var
|
6
|
+
var topo = props.topo,
|
7
|
+
showLabel = props.showLabel,
|
8
|
+
topoEdit = props.topoEdit;
|
9
|
+
|
10
|
+
var _topo$store$useModelS = topo.store.useModelState('topoEdit'),
|
11
|
+
viewMouseMode = _topo$store$useModelS.viewMouseMode;
|
12
|
+
|
7
13
|
return /*#__PURE__*/React.createElement(WidgetBox, {
|
8
14
|
label: "\u79FB\u52A8",
|
9
15
|
tooltip: "\u79FB\u52A8",
|
10
16
|
showLabel: showLabel
|
11
|
-
}, /*#__PURE__*/React.createElement(ButtonBox,
|
17
|
+
}, /*#__PURE__*/React.createElement(ButtonBox, {
|
18
|
+
active: viewMouseMode === 'move',
|
19
|
+
onClick: function onClick() {
|
20
|
+
topoEdit.setViewMouseMode('move');
|
21
|
+
}
|
22
|
+
}, /*#__PURE__*/React.createElement("img", {
|
12
23
|
src: "/img/topo/editor/toolbar/drag/Normal.svg",
|
13
24
|
alt: ""
|
14
25
|
})));
|
@@ -3,13 +3,22 @@ import WidgetBox from "./WidgetBox";
|
|
3
3
|
import ButtonBox from "./components/ButtonBox";
|
4
4
|
|
5
5
|
function CanvasSelectWidget(props) {
|
6
|
-
var
|
6
|
+
var topo = props.topo,
|
7
|
+
showLabel = props.showLabel,
|
8
|
+
topoEdit = props.topoEdit;
|
9
|
+
|
10
|
+
var _topo$store$useModelS = topo.store.useModelState('topoEdit'),
|
11
|
+
viewMouseMode = _topo$store$useModelS.viewMouseMode;
|
12
|
+
|
7
13
|
return /*#__PURE__*/React.createElement(WidgetBox, {
|
8
14
|
label: "\u9009\u62E9",
|
9
15
|
tooltip: "\u9009\u62E9",
|
10
16
|
showLabel: showLabel
|
11
17
|
}, /*#__PURE__*/React.createElement(ButtonBox, {
|
12
|
-
active:
|
18
|
+
active: viewMouseMode === 'select',
|
19
|
+
onClick: function onClick() {
|
20
|
+
topoEdit.setViewMouseMode('select');
|
21
|
+
}
|
13
22
|
}, /*#__PURE__*/React.createElement("img", {
|
14
23
|
src: "/img/topo/editor/toolbar/select/Normal.svg",
|
15
24
|
alt: ""
|
@@ -1,8 +1,138 @@
|
|
1
|
-
import
|
1
|
+
import _Field from "@alifd/next/es/field";
|
2
|
+
import _Select from "@alifd/next/es/select";
|
3
|
+
import _Form from "@alifd/next/es/form";
|
4
|
+
import React, { useState } from 'react';
|
5
|
+
import styles from "./EdgeType.module.scss";
|
6
|
+
import LineType from "./LineType";
|
7
|
+
var FormItem = _Form.Item;
|
8
|
+
var Option = _Select.Option;
|
9
|
+
var START_END_TYPE_OPTIONS = [{
|
10
|
+
value: 'nil',
|
11
|
+
label: '无',
|
12
|
+
icon: 'topo_startEndPoint_icon_nothing'
|
13
|
+
}, {
|
14
|
+
value: 'hollowCrcial',
|
15
|
+
label: '空心圆',
|
16
|
+
icon: 'topo_startEndPoint_icon_hollow_cricle'
|
17
|
+
}, {
|
18
|
+
value: 'solidCricle',
|
19
|
+
label: '实心圆',
|
20
|
+
icon: 'topo_startEndPoint_icon_solid_cricle'
|
21
|
+
}, {
|
22
|
+
value: 'arrowPoint',
|
23
|
+
label: '箭头',
|
24
|
+
icon: 'topo_startEndPoint_icon_arrow'
|
25
|
+
}];
|
26
|
+
var LINE_MOLD_OPTIONS = [{
|
27
|
+
value: 'solidLine',
|
28
|
+
label: '实线',
|
29
|
+
icon: 'topo_lineMold_solid'
|
30
|
+
}, {
|
31
|
+
value: 'dottedLine',
|
32
|
+
label: '虚线',
|
33
|
+
icon: 'topo_lineMold_dotted'
|
34
|
+
}, {
|
35
|
+
value: 'dottedLine1',
|
36
|
+
label: '虚线1',
|
37
|
+
icon: 'topo_lineMold_dotted_one'
|
38
|
+
}, {
|
39
|
+
value: 'dottedLine2',
|
40
|
+
label: '虚线2',
|
41
|
+
icon: 'topo_lineMold_dotted_two'
|
42
|
+
}];
|
2
43
|
|
3
44
|
function EdgeType(props) {
|
4
|
-
|
5
|
-
|
45
|
+
var _onChange = props.onChange;
|
46
|
+
|
47
|
+
var field = _Field.useField({
|
48
|
+
autoUnmount: false,
|
49
|
+
values: {
|
50
|
+
startPoint: 'nil',
|
51
|
+
endPoint: 'nil',
|
52
|
+
type: null
|
53
|
+
},
|
54
|
+
onChange: function onChange(name, value) {
|
55
|
+
if (['startPoint', 'endPoint'].includes(name) && value === 'nil') {
|
56
|
+
_onChange(name, null);
|
57
|
+
} else {
|
58
|
+
_onChange(name, value);
|
59
|
+
}
|
60
|
+
}
|
61
|
+
});
|
62
|
+
|
63
|
+
return /*#__PURE__*/React.createElement("div", {
|
64
|
+
className: styles.lineBox
|
65
|
+
}, /*#__PURE__*/React.createElement(_Form, {
|
66
|
+
field: field,
|
67
|
+
inline: true,
|
68
|
+
labelAlign: "top"
|
69
|
+
}, /*#__PURE__*/React.createElement(FormItem, null, /*#__PURE__*/React.createElement(LineType, {
|
70
|
+
name: "lineButton"
|
71
|
+
})), /*#__PURE__*/React.createElement(FormItem, {
|
72
|
+
label: "\u8D77\u70B9"
|
73
|
+
}, /*#__PURE__*/React.createElement(_Select, {
|
74
|
+
name: "startPoint",
|
75
|
+
popupProps: {
|
76
|
+
container: function container(trigger) {
|
77
|
+
return trigger.parentNode;
|
78
|
+
}
|
79
|
+
}
|
80
|
+
}, START_END_TYPE_OPTIONS.map(function (item, index, array) {
|
81
|
+
return /*#__PURE__*/React.createElement(Option, {
|
82
|
+
value: item.value,
|
83
|
+
key: index,
|
84
|
+
title: item.label,
|
85
|
+
onchange: _onChange
|
86
|
+
}, /*#__PURE__*/React.createElement("img", {
|
87
|
+
src: "/img/topo/editor/lineType/" + item.icon + ".svg",
|
88
|
+
alt: "",
|
89
|
+
className: styles.iconImg
|
90
|
+
}));
|
91
|
+
}))), /*#__PURE__*/React.createElement(FormItem, {
|
92
|
+
label: "\u7EC8\u70B9"
|
93
|
+
}, /*#__PURE__*/React.createElement(_Select, {
|
94
|
+
name: "endPoint",
|
95
|
+
popupProps: {
|
96
|
+
container: function container(trigger) {
|
97
|
+
return trigger.parentNode;
|
98
|
+
}
|
99
|
+
}
|
100
|
+
}, START_END_TYPE_OPTIONS.map(function (item, index, array) {
|
101
|
+
return /*#__PURE__*/React.createElement(Option, {
|
102
|
+
value: item.value,
|
103
|
+
key: index,
|
104
|
+
title: item.label,
|
105
|
+
onchange: _onChange
|
106
|
+
}, /*#__PURE__*/React.createElement("img", {
|
107
|
+
src: "/img/topo/editor/lineType/" + item.icon + ".svg",
|
108
|
+
alt: "",
|
109
|
+
className: styles.iconImg
|
110
|
+
}));
|
111
|
+
}))), /*#__PURE__*/React.createElement(FormItem, {
|
112
|
+
label: "\u7C7B\u578B"
|
113
|
+
}, /*#__PURE__*/React.createElement(_Select, {
|
114
|
+
name: "type",
|
115
|
+
popupProps: {
|
116
|
+
container: function container(trigger) {
|
117
|
+
return trigger.parentNode;
|
118
|
+
}
|
119
|
+
},
|
120
|
+
placeholder: ""
|
121
|
+
}, LINE_MOLD_OPTIONS.map(function (item, index, array) {
|
122
|
+
return /*#__PURE__*/React.createElement(Option, {
|
123
|
+
value: item.value,
|
124
|
+
key: index,
|
125
|
+
title: item.label,
|
126
|
+
onchange: _onChange
|
127
|
+
}, /*#__PURE__*/React.createElement("img", {
|
128
|
+
src: "/img/topo/editor/lineType/" + item.icon + ".svg",
|
129
|
+
alt: "",
|
130
|
+
className: styles.iconImg
|
131
|
+
}));
|
132
|
+
})))));
|
6
133
|
}
|
7
134
|
|
135
|
+
EdgeType.defaultProps = {
|
136
|
+
onChange: function onChange(v) {}
|
137
|
+
};
|
8
138
|
export default EdgeType;
|
@@ -0,0 +1,46 @@
|
|
1
|
+
@import '~@alifd/next/variables.scss';
|
2
|
+
|
3
|
+
.lineBox{
|
4
|
+
width: 236px;
|
5
|
+
background: #FFFFFF;
|
6
|
+
border-radius: 4px;
|
7
|
+
margin-bottom: -7px;
|
8
|
+
|
9
|
+
:global {
|
10
|
+
.#{$css-prefix}form-item:first-child{
|
11
|
+
margin-top: 0;
|
12
|
+
margin-bottom: 0;
|
13
|
+
}
|
14
|
+
.#{$css-prefix}form-item {
|
15
|
+
margin-top: 7px;
|
16
|
+
margin-bottom: 7px;
|
17
|
+
}
|
18
|
+
.#{$css-prefix}form.#{$css-prefix}inline .#{$css-prefix}form-item:not(:last-child) {
|
19
|
+
margin-right: 8px;
|
20
|
+
.#{$css-prefix}select-trigger {
|
21
|
+
min-width: 0;
|
22
|
+
width: 64px;
|
23
|
+
height: 28px;
|
24
|
+
.#{$css-prefix}select-inner {
|
25
|
+
min-width:0 !important;
|
26
|
+
}
|
27
|
+
}
|
28
|
+
}
|
29
|
+
.#{$css-prefix}form.#{$css-prefix}inline .#{$css-prefix}form-item:last-child{
|
30
|
+
.#{$css-prefix}select-trigger {
|
31
|
+
min-width: 0;
|
32
|
+
width: 88px;
|
33
|
+
height: 28px;
|
34
|
+
.#{$css-prefix}select-inner {
|
35
|
+
min-width:0 !important;
|
36
|
+
}
|
37
|
+
}
|
38
|
+
}
|
39
|
+
.#{$css-prefix}input.#{$css-prefix}medium .#{$css-prefix}input-text-field {
|
40
|
+
line-height: calc(28px - 10px * 2);
|
41
|
+
}
|
42
|
+
.#{$css-prefix}select-trigger-search {
|
43
|
+
height: 12px;
|
44
|
+
}
|
45
|
+
}
|
46
|
+
}
|
@@ -0,0 +1,47 @@
|
|
1
|
+
import _Button from "@alifd/next/es/button";
|
2
|
+
import React, { useState } from 'react';
|
3
|
+
import styles from "./LineType.module.scss";
|
4
|
+
var LINE_TYPE_OPTIONS = [{
|
5
|
+
value: 'boundary',
|
6
|
+
label: '直线',
|
7
|
+
icon: 'topo_linear_icon_straightline'
|
8
|
+
}, {
|
9
|
+
value: 'oposite',
|
10
|
+
label: '内向双向箭头',
|
11
|
+
icon: 'topo_linear_icon_narrow_straightline'
|
12
|
+
}, {
|
13
|
+
value: 'h.v',
|
14
|
+
label: '纵向折线',
|
15
|
+
icon: 'topo_linear_icon_vertical_foldline'
|
16
|
+
}, {
|
17
|
+
value: 'ortho',
|
18
|
+
label: '双折线',
|
19
|
+
icon: 'topo_linear_icon_bilinear'
|
20
|
+
}, {
|
21
|
+
value: 'flex',
|
22
|
+
label: '双弧线',
|
23
|
+
icon: 'topo_linear_icon_arcline'
|
24
|
+
}];
|
25
|
+
|
26
|
+
function LineType(props) {
|
27
|
+
var handleChange = function handleChange(node) {};
|
28
|
+
|
29
|
+
return /*#__PURE__*/React.createElement("div", {
|
30
|
+
className: styles.lineType
|
31
|
+
}, LINE_TYPE_OPTIONS.map(function (item, index, array) {
|
32
|
+
return /*#__PURE__*/React.createElement(_Button, {
|
33
|
+
key: index,
|
34
|
+
title: item.label,
|
35
|
+
className: "" + styles.redioBtn,
|
36
|
+
onClick: function onClick() {
|
37
|
+
handleChange(item);
|
38
|
+
}
|
39
|
+
}, /*#__PURE__*/React.createElement("img", {
|
40
|
+
src: "/img/topo/editor/lineType/" + item.icon + ".svg",
|
41
|
+
alt: "",
|
42
|
+
className: styles.iconImg
|
43
|
+
}));
|
44
|
+
}));
|
45
|
+
}
|
46
|
+
|
47
|
+
export default LineType;
|
@@ -0,0 +1,31 @@
|
|
1
|
+
.lineType{
|
2
|
+
display:flex;
|
3
|
+
.redioBtn {
|
4
|
+
width: 24px;
|
5
|
+
height: 24px;
|
6
|
+
border-radius: 4px;
|
7
|
+
border: none !important;
|
8
|
+
color: #4D6277;
|
9
|
+
padding: 0;
|
10
|
+
margin-right: 16px;
|
11
|
+
text-align: center;
|
12
|
+
|
13
|
+
.iconImg {
|
14
|
+
vertical-align: middle;
|
15
|
+
}
|
16
|
+
|
17
|
+
&:active {
|
18
|
+
background: #F2F7FD !important;
|
19
|
+
}
|
20
|
+
|
21
|
+
&:hover {
|
22
|
+
background: #F2F7FD !important;
|
23
|
+
}
|
24
|
+
}
|
25
|
+
.redioBtn:last-child{
|
26
|
+
margin-right: 0;
|
27
|
+
}
|
28
|
+
}
|
29
|
+
.iconImg {
|
30
|
+
vertical-align: middle;
|
31
|
+
}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import WidgetBox from "./WidgetBox";
|
3
|
+
import ButtonBox from "./components/ButtonBox";
|
3
4
|
|
4
5
|
function HistoryRedoButton(props) {
|
5
6
|
var topo = props.topo,
|
@@ -13,7 +14,7 @@ function HistoryRedoButton(props) {
|
|
13
14
|
label: "\u6062\u590D",
|
14
15
|
tooltip: "\u6062\u590D",
|
15
16
|
showLabel: showLabel
|
16
|
-
}, /*#__PURE__*/React.createElement(
|
17
|
+
}, /*#__PURE__*/React.createElement(ButtonBox, null, /*#__PURE__*/React.createElement("img", {
|
17
18
|
src: "/img/topo/editor/toolbar/redo/" + (disabled ? 'Disable' : 'Normal') + ".svg",
|
18
19
|
alt: ""
|
19
20
|
})));
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import React from 'react';
|
1
|
+
import React from 'react';
|
2
|
+
import ButtonBox from "./components/ButtonBox"; // import { Icon, Button } from '@alifd/next';
|
2
3
|
|
3
4
|
import WidgetBox from "./WidgetBox";
|
4
5
|
|
@@ -15,7 +16,7 @@ function HistoryUndoButton(props) {
|
|
15
16
|
label: "\u64A4\u9500",
|
16
17
|
tooltip: "\u64A4\u9500",
|
17
18
|
showLabel: showLabel
|
18
|
-
}, /*#__PURE__*/React.createElement(
|
19
|
+
}, /*#__PURE__*/React.createElement(ButtonBox, {
|
19
20
|
disabled: disabled,
|
20
21
|
onClick: function onClick() {
|
21
22
|
topo.historyManager.undo();
|