@riil-frontend/component-topology 10.0.0 → 10.0.2
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 +19 -19
- package/es/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +2 -5
- package/es/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.js +7 -0
- package/es/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +123 -34
- package/es/core/editor/components/Toolbar/components/Tooltip.js +22 -0
- package/es/core/editor/components/Toolbar/components/Tooltip.module.scss +5 -0
- package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundButton.js +1 -1
- package/es/core/editor/components/Toolbar/widgets/CanvasMoveWidget.js +5 -2
- package/es/core/editor/components/Toolbar/widgets/CanvasSelectWidget.js +1 -1
- package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +1 -1
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +1 -1
- package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +1 -1
- package/es/core/editor/components/Toolbar/widgets/FontFamilyWidget.js +1 -1
- package/es/core/editor/components/Toolbar/widgets/FontSizeWidget.js +1 -0
- package/es/core/editor/components/Toolbar/widgets/FontStyleButton.js +25 -17
- package/es/core/editor/components/Toolbar/widgets/WidgetBox.js +6 -8
- package/es/core/editor/components/settings/common/SizeInput/NodeSizeInput.js +53 -44
- package/es/core/models/TopoApp.js +1 -1
- package/lib/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +2 -6
- package/lib/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.js +7 -0
- package/lib/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +123 -32
- package/lib/core/editor/components/Toolbar/components/Tooltip.js +33 -0
- package/lib/core/editor/components/Toolbar/components/Tooltip.module.scss +5 -0
- package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundButton.js +1 -1
- package/lib/core/editor/components/Toolbar/widgets/CanvasMoveWidget.js +7 -2
- package/lib/core/editor/components/Toolbar/widgets/CanvasSelectWidget.js +1 -1
- package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +1 -1
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +1 -1
- package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +1 -1
- package/lib/core/editor/components/Toolbar/widgets/FontFamilyWidget.js +1 -1
- package/lib/core/editor/components/Toolbar/widgets/FontSizeWidget.js +1 -0
- package/lib/core/editor/components/Toolbar/widgets/FontStyleButton.js +26 -17
- package/lib/core/editor/components/Toolbar/widgets/WidgetBox.js +7 -9
- package/lib/core/editor/components/settings/common/SizeInput/NodeSizeInput.js +54 -44
- package/lib/core/models/TopoApp.js +1 -1
- package/package.json +2 -2
@@ -1,7 +1,6 @@
|
|
1
1
|
import React, { useMemo } from 'react';
|
2
2
|
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
3
3
|
import ImagePalette from "./HtImagePalette";
|
4
|
-
import { getResourceIcons } from "../../../../../common/icons/icon";
|
5
4
|
/**
|
6
5
|
* 组件面板
|
7
6
|
* @param {*} props
|
@@ -9,10 +8,8 @@ import { getResourceIcons } from "../../../../../common/icons/icon";
|
|
9
8
|
*/
|
10
9
|
|
11
10
|
export default function CiTypeImagePanel(props) {
|
12
|
-
var topo = props.topo
|
13
|
-
|
14
|
-
return getResourceIcons(topo);
|
15
|
-
}, []);
|
11
|
+
var topo = props.topo,
|
12
|
+
icons = props.icons;
|
16
13
|
return /*#__PURE__*/React.createElement(ImagePalette, {
|
17
14
|
icons: icons,
|
18
15
|
topo: topo
|
@@ -46,6 +46,13 @@ export default function HtImagePalette(props) {
|
|
46
46
|
}
|
47
47
|
};
|
48
48
|
}, []);
|
49
|
+
useEffect(function () {
|
50
|
+
var view = viewRef.current;
|
51
|
+
|
52
|
+
if (view && view.setIcons) {
|
53
|
+
view.setIcons(icons);
|
54
|
+
}
|
55
|
+
}, [icons]);
|
49
56
|
return /*#__PURE__*/React.createElement("div", {
|
50
57
|
ref: divRef,
|
51
58
|
className: styles.container
|
@@ -1,54 +1,143 @@
|
|
1
|
+
import _Box from "@alifd/next/es/box";
|
2
|
+
import _Search from "@alifd/next/es/search";
|
1
3
|
import _extends from "@babel/runtime/helpers/extends";
|
2
4
|
import _Button from "@alifd/next/es/button";
|
3
5
|
import _Icon from "@alifd/next/es/icon";
|
4
|
-
import React, { useMemo } from 'react';
|
6
|
+
import React, { useMemo, useState } from 'react';
|
5
7
|
import Collapse from "../../../../../../components/collapse/Collapse";
|
6
8
|
import CiTypeImagePanel from "./CiTypeImagePanel";
|
7
9
|
import CustomImagePanel from "./CustomImagePanel";
|
8
|
-
import { getBasicIcons } from "../../../../../common/icons/icon";
|
10
|
+
import { getResourceIcons, getBasicIcons } from "../../../../../common/icons/icon";
|
9
11
|
import ImagePalette from "./HtImagePalette";
|
10
12
|
import { useCustomIcons } from "../../../../../common/icons/useIcons";
|
11
13
|
var CollapsePanel = Collapse.Panel;
|
12
14
|
export default function ImagePanel(props) {
|
13
15
|
var topo = props.topo;
|
16
|
+
|
17
|
+
var _useState = useState(''),
|
18
|
+
searchValue = _useState[0],
|
19
|
+
setSearchValue = _useState[1];
|
20
|
+
|
21
|
+
var resourceIcons = useMemo(function () {
|
22
|
+
return getResourceIcons(topo).filter(function (icon) {
|
23
|
+
if (!searchValue) {
|
24
|
+
return true;
|
25
|
+
}
|
26
|
+
|
27
|
+
return icon.name.toLocaleLowerCase().includes(searchValue.toLocaleLowerCase());
|
28
|
+
});
|
29
|
+
}, [searchValue]);
|
14
30
|
var basicIcons = useMemo(function () {
|
15
|
-
return getBasicIcons(topo, false)
|
16
|
-
|
31
|
+
return getBasicIcons(topo, false).filter(function (icon) {
|
32
|
+
if (!searchValue) {
|
33
|
+
return true;
|
34
|
+
}
|
35
|
+
|
36
|
+
return icon.name.toLocaleLowerCase().includes(searchValue.toLocaleLowerCase());
|
37
|
+
});
|
38
|
+
}, [searchValue]);
|
17
39
|
var customIcons = useCustomIcons(topo);
|
40
|
+
var searchCustomIcons = useMemo(function () {
|
41
|
+
return customIcons.filter(function (icon) {
|
42
|
+
if (!searchValue) {
|
43
|
+
return true;
|
44
|
+
}
|
45
|
+
|
46
|
+
return icon.name.toLocaleLowerCase().includes(searchValue.toLocaleLowerCase());
|
47
|
+
});
|
48
|
+
}, [customIcons, searchValue]);
|
18
49
|
|
19
50
|
var handleDownloadCustomImages = function handleDownloadCustomImages() {
|
20
51
|
window.open('/topo/v1/api/shape/download/all');
|
21
52
|
};
|
22
53
|
|
23
|
-
|
24
|
-
|
25
|
-
|
54
|
+
var handleSearch = function handleSearch(v) {
|
55
|
+
setSearchValue(v);
|
56
|
+
};
|
57
|
+
|
58
|
+
var handleSearchChange = function handleSearchChange(value) {
|
59
|
+
setSearchValue(value); // if (!value) {
|
60
|
+
// }
|
61
|
+
};
|
62
|
+
|
63
|
+
var renderImageContent = function renderImageContent() {
|
64
|
+
var panels = [{
|
65
|
+
key: '资源图片',
|
66
|
+
render: function render() {
|
67
|
+
return /*#__PURE__*/React.createElement(CollapsePanel, {
|
68
|
+
key: "\u8D44\u6E90\u56FE\u7247",
|
69
|
+
title: "\u8D44\u6E90\u56FE\u7247"
|
70
|
+
}, /*#__PURE__*/React.createElement(CiTypeImagePanel, {
|
71
|
+
topo: topo,
|
72
|
+
icons: resourceIcons
|
73
|
+
}));
|
74
|
+
}
|
75
|
+
}, {
|
76
|
+
key: '基础图片',
|
77
|
+
render: function render() {
|
78
|
+
return /*#__PURE__*/React.createElement(CollapsePanel, {
|
79
|
+
key: "\u57FA\u7840\u56FE\u7247",
|
80
|
+
title: "\u57FA\u7840\u56FE\u7247"
|
81
|
+
}, /*#__PURE__*/React.createElement(ImagePalette, {
|
82
|
+
icons: basicIcons,
|
83
|
+
topo: topo
|
84
|
+
}));
|
85
|
+
}
|
86
|
+
}, {
|
87
|
+
key: '自定义图片',
|
88
|
+
hidden: searchValue && !searchCustomIcons.length,
|
89
|
+
render: function render() {
|
90
|
+
return /*#__PURE__*/React.createElement(CollapsePanel, {
|
91
|
+
key: "\u81EA\u5B9A\u4E49\u56FE\u7247",
|
92
|
+
title: "\u81EA\u5B9A\u4E49\u56FE\u7247",
|
93
|
+
extra: /*#__PURE__*/React.createElement(_Button, {
|
94
|
+
title: "\u5BFC\u51FA",
|
95
|
+
onClick: handleDownloadCustomImages,
|
96
|
+
disabled: !customIcons.length
|
97
|
+
}, /*#__PURE__*/React.createElement(_Icon, {
|
98
|
+
type: "topo_button_icon_export"
|
99
|
+
}))
|
100
|
+
}, /*#__PURE__*/React.createElement(CustomImagePanel, _extends({}, props, {
|
101
|
+
icons: searchCustomIcons
|
102
|
+
})));
|
103
|
+
}
|
104
|
+
}].filter(function (panel) {
|
105
|
+
return !panel.hidden;
|
106
|
+
});
|
107
|
+
return /*#__PURE__*/React.createElement(Collapse, {
|
108
|
+
accordion: true,
|
109
|
+
defaultExpandedKeys: ['资源图片'],
|
110
|
+
style: {
|
111
|
+
border: 'none',
|
112
|
+
minWidth: '300px'
|
113
|
+
},
|
114
|
+
fullheight: true,
|
115
|
+
noContentPadding: true
|
116
|
+
}, panels.map(function (panel) {
|
117
|
+
return panel.render();
|
118
|
+
}));
|
119
|
+
};
|
120
|
+
|
121
|
+
return /*#__PURE__*/React.createElement(_Box, {
|
122
|
+
direction: "column",
|
123
|
+
style: {
|
124
|
+
height: '100%'
|
125
|
+
}
|
126
|
+
}, /*#__PURE__*/React.createElement("div", {
|
127
|
+
style: {
|
128
|
+
margin: '16px 16px 0px 16px'
|
129
|
+
}
|
130
|
+
}, /*#__PURE__*/React.createElement(_Search, {
|
131
|
+
value: searchValue,
|
132
|
+
onChange: handleSearchChange,
|
133
|
+
onSearch: handleSearch,
|
134
|
+
placeholder: "\u8BF7\u8F93\u5165\u5173\u952E\u8BCD",
|
135
|
+
shape: "simple",
|
136
|
+
hasClear: true,
|
26
137
|
style: {
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
}, /*#__PURE__*/React.createElement(CollapsePanel, {
|
33
|
-
key: "\u8D44\u6E90\u56FE\u7247",
|
34
|
-
title: "\u8D44\u6E90\u56FE\u7247"
|
35
|
-
}, /*#__PURE__*/React.createElement(CiTypeImagePanel, props)), /*#__PURE__*/React.createElement(CollapsePanel, {
|
36
|
-
key: "\u57FA\u7840\u56FE\u7247",
|
37
|
-
title: "\u57FA\u7840\u56FE\u7247"
|
38
|
-
}, /*#__PURE__*/React.createElement(ImagePalette, {
|
39
|
-
icons: basicIcons,
|
40
|
-
topo: topo
|
41
|
-
})), /*#__PURE__*/React.createElement(CollapsePanel, {
|
42
|
-
key: "\u81EA\u5B9A\u4E49\u56FE\u7247",
|
43
|
-
title: "\u81EA\u5B9A\u4E49\u56FE\u7247",
|
44
|
-
extra: /*#__PURE__*/React.createElement(_Button, {
|
45
|
-
title: "\u5BFC\u51FA",
|
46
|
-
onClick: handleDownloadCustomImages,
|
47
|
-
disabled: !customIcons.length
|
48
|
-
}, /*#__PURE__*/React.createElement(_Icon, {
|
49
|
-
type: "topo_button_icon_export"
|
50
|
-
}))
|
51
|
-
}, /*#__PURE__*/React.createElement(CustomImagePanel, _extends({}, props, {
|
52
|
-
icons: customIcons
|
53
|
-
}))));
|
138
|
+
width: '100%'
|
139
|
+
}
|
140
|
+
})), /*#__PURE__*/React.createElement(_Box, {
|
141
|
+
flex: 1
|
142
|
+
}, renderImageContent()));
|
54
143
|
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import _Balloon from "@alifd/next/es/balloon";
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
3
|
+
import React from 'react';
|
4
|
+
import styles from "./Tooltip.module.scss";
|
5
|
+
|
6
|
+
function Tooltip(props) {
|
7
|
+
var title = props.title;
|
8
|
+
return /*#__PURE__*/React.createElement(_Balloon, _extends({
|
9
|
+
triggerType: "hover",
|
10
|
+
title: "\u79FB\u52A8",
|
11
|
+
align: "br",
|
12
|
+
closable: false // 解决遮挡下拉浮层问题
|
13
|
+
,
|
14
|
+
popupStyle: {
|
15
|
+
zIndex: 1000
|
16
|
+
}
|
17
|
+
}, props), title && /*#__PURE__*/React.createElement("div", {
|
18
|
+
className: styles.tootipTitle
|
19
|
+
}, title), props.children);
|
20
|
+
}
|
21
|
+
|
22
|
+
export default Tooltip;
|
package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundButton.js
CHANGED
@@ -32,7 +32,7 @@ function BoxBackgroundButton(props) {
|
|
32
32
|
});
|
33
33
|
return /*#__PURE__*/React.createElement(WidgetBox, {
|
34
34
|
label: "\u6846\u80CC\u666F",
|
35
|
-
tooltip: "\u6846\u80CC\u666F",
|
35
|
+
tooltip: "\u66F4\u6539\u6846\u80CC\u666F\u989C\u8272",
|
36
36
|
disabled: disabled,
|
37
37
|
showLabel: showLabel
|
38
38
|
}, /*#__PURE__*/React.createElement(DropdownButton, {
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import WidgetBox from "./WidgetBox";
|
3
3
|
import ButtonBox from "./components/ButtonBox";
|
4
|
+
import Tooltip from "../components/Tooltip";
|
4
5
|
|
5
6
|
function CanvasMoveWidget(props) {
|
6
7
|
var topo = props.topo,
|
@@ -10,9 +11,8 @@ function CanvasMoveWidget(props) {
|
|
10
11
|
var _topo$store$useModelS = topo.store.useModelState('topoEdit'),
|
11
12
|
viewMouseMode = _topo$store$useModelS.viewMouseMode;
|
12
13
|
|
13
|
-
|
14
|
+
var button = /*#__PURE__*/React.createElement(WidgetBox, {
|
14
15
|
label: "\u79FB\u52A8",
|
15
|
-
tooltip: "\u79FB\u52A8",
|
16
16
|
showLabel: showLabel
|
17
17
|
}, /*#__PURE__*/React.createElement(ButtonBox, {
|
18
18
|
active: viewMouseMode === 'move',
|
@@ -23,6 +23,9 @@ function CanvasMoveWidget(props) {
|
|
23
23
|
src: "/img/topo/editor/toolbar/drag/Normal.svg",
|
24
24
|
alt: ""
|
25
25
|
})));
|
26
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
27
|
+
trigger: button
|
28
|
+
}, "\u5355\u51FB\u201C\u7A7A\u683C\u952E\u201D\u5FEB\u901F\u5207\u6362\u4E3A\u9009\u62E9");
|
26
29
|
}
|
27
30
|
|
28
31
|
export default CanvasMoveWidget;
|
@@ -12,7 +12,7 @@ function CanvasSelectWidget(props) {
|
|
12
12
|
|
13
13
|
return /*#__PURE__*/React.createElement(WidgetBox, {
|
14
14
|
label: "\u9009\u62E9",
|
15
|
-
tooltip: "\
|
15
|
+
tooltip: "\u5355\u51FB\u201C\u7A7A\u683C\u952E\u201D\u5FEB\u901F\u5207\u6362\u4E3A\u79FB\u52A8",
|
16
16
|
showLabel: showLabel
|
17
17
|
}, /*#__PURE__*/React.createElement(ButtonBox, {
|
18
18
|
active: viewMouseMode === 'select',
|
@@ -119,7 +119,7 @@ function EdgeColorButton(props) {
|
|
119
119
|
});
|
120
120
|
return /*#__PURE__*/React.createElement(WidgetBox, {
|
121
121
|
label: "\u7EBF\u6761\u989C\u8272",
|
122
|
-
tooltip: "\u7EBF\u6761\u989C\u8272",
|
122
|
+
tooltip: "\u66F4\u6539\u7EBF\u6761\u989C\u8272",
|
123
123
|
showLabel: showLabel,
|
124
124
|
disabled: disabled
|
125
125
|
}, /*#__PURE__*/React.createElement(DropdownButton, {
|
@@ -108,7 +108,7 @@ function EdgeTypeButton(props) {
|
|
108
108
|
});
|
109
109
|
return /*#__PURE__*/React.createElement(WidgetBox, {
|
110
110
|
label: "\u7EBF\u5F62",
|
111
|
-
tooltip: "\u7EBF\u5F62",
|
111
|
+
tooltip: "\u66F4\u6539\u7EBF\u6761/\u94FE\u8DEF\u7684\u7EBF\u5F62",
|
112
112
|
disabled: disabled,
|
113
113
|
showLabel: showLabel
|
114
114
|
}, /*#__PURE__*/React.createElement(DropdownButton, {
|
@@ -182,7 +182,7 @@ function FontColorButton(props) {
|
|
182
182
|
fieldDisabled = props.fieldDisabled;
|
183
183
|
return /*#__PURE__*/React.createElement(WidgetBox, {
|
184
184
|
label: "\u6587\u5B57\u989C\u8272",
|
185
|
-
tooltip: "\u6587\u5B57\u989C\u8272",
|
185
|
+
tooltip: "\u66F4\u6539\u6587\u5B57\u989C\u8272",
|
186
186
|
showLabel: showLabel
|
187
187
|
}, /*#__PURE__*/React.createElement(FontColorDropdown, {
|
188
188
|
color: style.color,
|
@@ -35,7 +35,7 @@ function FontFamilyWidget(props) {
|
|
35
35
|
setStyle = props.setStyle;
|
36
36
|
return /*#__PURE__*/React.createElement(WidgetBox, {
|
37
37
|
label: "\u5B57\u4F53",
|
38
|
-
tooltip: "\u5B57\u4F53",
|
38
|
+
tooltip: "\u9009\u53D6\u6587\u5B57\u7684\u65B0\u5B57\u4F53",
|
39
39
|
showLabel: showLabel
|
40
40
|
}, /*#__PURE__*/React.createElement(FontFamilySelect, {
|
41
41
|
value: style.fontFamily,
|
@@ -40,6 +40,7 @@ function FontSizeWidget(props) {
|
|
40
40
|
useEffect(function () {}, [selection]);
|
41
41
|
return /*#__PURE__*/React.createElement(WidgetBox, {
|
42
42
|
label: "\u5B57\u53F7",
|
43
|
+
tooltip: "\u9009\u53D6\u6587\u5B57\u7684\u65B0\u5B57\u4F53",
|
43
44
|
showLabel: showLabel,
|
44
45
|
disabled: disabled
|
45
46
|
}, /*#__PURE__*/React.createElement(FontSizeSelect, {
|
@@ -3,18 +3,22 @@ import { isText } from "../../../../../utils/htElementUtils";
|
|
3
3
|
import DropdownMenu from "./components/DropdownMenu";
|
4
4
|
import textStyleSettingRouter from "./components/textStyleSetting/textStyleSettingRouter.js";
|
5
5
|
import WidgetBox from "./WidgetBox";
|
6
|
+
import Tooltip from "../components/Tooltip";
|
6
7
|
var items = [{
|
7
8
|
key: 'bold',
|
8
9
|
label: '加粗',
|
9
|
-
icon: 'bold'
|
10
|
+
icon: 'bold',
|
11
|
+
tooltip: '加粗'
|
10
12
|
}, {
|
11
13
|
key: 'italic',
|
12
14
|
label: '斜体',
|
13
|
-
icon: 'Italics'
|
15
|
+
icon: 'Italics',
|
16
|
+
tooltip: '斜体'
|
14
17
|
}, {
|
15
18
|
key: 'underline',
|
16
19
|
label: '下划线',
|
17
|
-
icon: 'Underline'
|
20
|
+
icon: 'Underline',
|
21
|
+
tooltip: '下划线'
|
18
22
|
}];
|
19
23
|
|
20
24
|
function buildValue(obj) {
|
@@ -81,7 +85,7 @@ function FontStyleButton(props) {
|
|
81
85
|
|
82
86
|
return /*#__PURE__*/React.createElement(WidgetBox, {
|
83
87
|
label: "\u6587\u5B57\u6837\u5F0F",
|
84
|
-
tooltip: "\
|
88
|
+
tooltip: "\u52A0\u7C97\u3001\u659C\u4F53\u3001\u4E0B\u5212\u7EBF",
|
85
89
|
disabled: disabled,
|
86
90
|
showLabel: showLabel
|
87
91
|
}, /*#__PURE__*/React.createElement(DropdownMenu, {
|
@@ -99,19 +103,23 @@ function FontStyleButton(props) {
|
|
99
103
|
return /*#__PURE__*/React.createElement(DropdownMenu.Item, {
|
100
104
|
key: item.key,
|
101
105
|
disabled: fieldDisabled[item.key]
|
102
|
-
}, /*#__PURE__*/React.createElement(
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
106
|
+
}, /*#__PURE__*/React.createElement(Tooltip, {
|
107
|
+
trigger: /*#__PURE__*/React.createElement("div", {
|
108
|
+
style: {
|
109
|
+
display: 'flex',
|
110
|
+
alignItems: 'center'
|
111
|
+
}
|
112
|
+
}, /*#__PURE__*/React.createElement("img", {
|
113
|
+
src: "/img/topo/editor/toolbar/" + item.icon + "/" + (fieldDisabled[item.key] ? 'Disable' : 'Normal') + ".svg",
|
114
|
+
alt: ""
|
115
|
+
}), /*#__PURE__*/React.createElement("span", {
|
116
|
+
style: fieldDisabled[item.key] ? {} : {
|
117
|
+
color: '#4d6277'
|
118
|
+
}
|
119
|
+
}, item.label)),
|
120
|
+
align: "r",
|
121
|
+
popupStyle: {}
|
122
|
+
}, item.tooltip));
|
115
123
|
})));
|
116
124
|
}
|
117
125
|
|
@@ -1,16 +1,17 @@
|
|
1
|
-
import _Balloon from "@alifd/next/es/balloon";
|
2
1
|
import _extends from "@babel/runtime/helpers/extends";
|
3
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
4
|
-
var _excluded = ["label", "showLabel", "tooltip", "disabled", "children"];
|
3
|
+
var _excluded = ["label", "showLabel", "tooltip", "tooltipTitle", "disabled", "children"];
|
5
4
|
import React from 'react';
|
6
5
|
import classnames from 'classnames';
|
7
6
|
import ButtonBox from "./components/ButtonBox";
|
7
|
+
import Tooltip from "../components/Tooltip";
|
8
8
|
import styles from "./WidgetBox.module.scss";
|
9
9
|
|
10
10
|
function WidgetBox(props) {
|
11
11
|
var label = props.label,
|
12
12
|
showLabel = props.showLabel,
|
13
13
|
tooltip = props.tooltip,
|
14
|
+
tooltipTitle = props.tooltipTitle,
|
14
15
|
disabled = props.disabled,
|
15
16
|
children = props.children,
|
16
17
|
otherProps = _objectWithoutPropertiesLoose(props, _excluded);
|
@@ -28,13 +29,10 @@ function WidgetBox(props) {
|
|
28
29
|
return button;
|
29
30
|
}
|
30
31
|
|
31
|
-
return /*#__PURE__*/React.createElement(
|
32
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
32
33
|
trigger: button,
|
33
|
-
|
34
|
-
|
35
|
-
popupStyle: {
|
36
|
-
zIndex: 1000
|
37
|
-
}
|
34
|
+
title: tooltipTitle,
|
35
|
+
align: "b"
|
38
36
|
}, tooltip);
|
39
37
|
}
|
40
38
|
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import _Box from "@alifd/next/es/box";
|
2
|
+
import _Balloon from "@alifd/next/es/balloon";
|
2
3
|
import _extends from "@babel/runtime/helpers/extends";
|
3
4
|
import _Form from "@alifd/next/es/form";
|
4
5
|
import React, { useState } from 'react';
|
@@ -46,14 +47,16 @@ function SizeInput(props) {
|
|
46
47
|
|
47
48
|
var renderLock = function renderLock() {
|
48
49
|
var imgSrc = "/img/topo/editor/toolbar/" + (lock ? 'lock' : 'unlock') + "/" + (disabled ? 'Disable' : 'Normal') + ".svg";
|
49
|
-
return /*#__PURE__*/React.createElement(
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
50
|
+
return /*#__PURE__*/React.createElement(_Balloon.Tooltip, {
|
51
|
+
trigger: /*#__PURE__*/React.createElement("div", {
|
52
|
+
className: styles.lockBtn,
|
53
|
+
onClick: switchLock
|
54
|
+
}, /*#__PURE__*/React.createElement("img", {
|
55
|
+
src: imgSrc,
|
56
|
+
alt: "",
|
57
|
+
width: 12
|
58
|
+
}))
|
59
|
+
}, "\u9501\u5B9A\u7EB5\u6A2A\u6BD4");
|
57
60
|
};
|
58
61
|
|
59
62
|
return /*#__PURE__*/React.createElement(_Form, {
|
@@ -76,24 +79,27 @@ function SizeInput(props) {
|
|
76
79
|
style: {
|
77
80
|
marginBottom: 0
|
78
81
|
}
|
79
|
-
}, /*#__PURE__*/React.createElement(
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
82
|
+
}, /*#__PURE__*/React.createElement(_Balloon.Tooltip, {
|
83
|
+
trigger: /*#__PURE__*/React.createElement(NodeSizeNumberPicker, _extends({
|
84
|
+
value: parseValue(value.width),
|
85
|
+
label: showLabel ? '宽:' : '',
|
86
|
+
innerAfter: showLabel ? undefined : 'W',
|
87
|
+
min: 1,
|
88
|
+
max: max,
|
89
|
+
step: step,
|
90
|
+
disabled: disabled,
|
91
|
+
placeholder: "\u8BF7\u8F93\u5165",
|
92
|
+
size: size
|
93
|
+
}, numberPickerProps, {
|
94
|
+
style: {
|
95
|
+
width: '100%'
|
96
|
+
},
|
97
|
+
onChange: function onChange(val) {
|
98
|
+
return handleChange('width', val);
|
99
|
+
}
|
100
|
+
})),
|
101
|
+
align: "b"
|
102
|
+
}, "\u66F4\u6539\u56FE\u7247\u7684\u5BBD\u5EA6"))), renderLock(), /*#__PURE__*/React.createElement("div", {
|
97
103
|
style: {
|
98
104
|
flex: 1
|
99
105
|
}
|
@@ -103,24 +109,27 @@ function SizeInput(props) {
|
|
103
109
|
style: {
|
104
110
|
marginBottom: 0
|
105
111
|
}
|
106
|
-
}, /*#__PURE__*/React.createElement(
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
112
|
+
}, /*#__PURE__*/React.createElement(_Balloon.Tooltip, {
|
113
|
+
trigger: /*#__PURE__*/React.createElement(NodeSizeNumberPicker, _extends({
|
114
|
+
value: parseValue(value.height),
|
115
|
+
label: showLabel ? '高:' : '',
|
116
|
+
innerAfter: showLabel ? undefined : 'H',
|
117
|
+
min: 1,
|
118
|
+
max: max,
|
119
|
+
step: step,
|
120
|
+
disabled: disabled,
|
121
|
+
placeholder: "\u8BF7\u8F93\u5165",
|
122
|
+
size: size
|
123
|
+
}, numberPickerProps, {
|
124
|
+
style: {
|
125
|
+
width: '100%'
|
126
|
+
},
|
127
|
+
onChange: function onChange(val) {
|
128
|
+
return handleChange('height', val);
|
129
|
+
}
|
130
|
+
})),
|
131
|
+
align: "b"
|
132
|
+
}, "\u66F4\u6539\u56FE\u7247\u7684\u9AD8\u5EA6"))))));
|
124
133
|
}
|
125
134
|
|
126
135
|
SizeInput.propTypes = {
|
@@ -24,7 +24,7 @@ import ElementTagTipConfig from "./tagstips/ElementTagTipConfig";
|
|
24
24
|
import SelectionModel from "./SelectionModel";
|
25
25
|
import CiCache from "./cache/CiCache"; // eslint-disable-next-line no-undef
|
26
26
|
|
27
|
-
var version = typeof "10.0.
|
27
|
+
var version = typeof "10.0.2" === 'string' ? "10.0.2" : null;
|
28
28
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
29
29
|
/**
|
30
30
|
* 拓扑显示和编辑
|
@@ -11,8 +11,6 @@ var _rlog = _interopRequireDefault(require("@riil-frontend/component-topology-ut
|
|
11
11
|
|
12
12
|
var _HtImagePalette = _interopRequireDefault(require("./HtImagePalette"));
|
13
13
|
|
14
|
-
var _icon = require("../../../../../common/icons/icon");
|
15
|
-
|
16
14
|
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); }
|
17
15
|
|
18
16
|
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; }
|
@@ -23,10 +21,8 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
23
21
|
* @returns
|
24
22
|
*/
|
25
23
|
function CiTypeImagePanel(props) {
|
26
|
-
var topo = props.topo
|
27
|
-
|
28
|
-
return (0, _icon.getResourceIcons)(topo);
|
29
|
-
}, []);
|
24
|
+
var topo = props.topo,
|
25
|
+
icons = props.icons;
|
30
26
|
return /*#__PURE__*/_react["default"].createElement(_HtImagePalette["default"], {
|
31
27
|
icons: icons,
|
32
28
|
topo: topo
|
@@ -60,6 +60,13 @@ function HtImagePalette(props) {
|
|
60
60
|
}
|
61
61
|
};
|
62
62
|
}, []);
|
63
|
+
(0, _react.useEffect)(function () {
|
64
|
+
var view = viewRef.current;
|
65
|
+
|
66
|
+
if (view && view.setIcons) {
|
67
|
+
view.setIcons(icons);
|
68
|
+
}
|
69
|
+
}, [icons]);
|
63
70
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
64
71
|
ref: divRef,
|
65
72
|
className: _HtImagePaletteModule["default"].container
|