@riil-frontend/component-topology 6.0.0-alpha.39 → 6.0.0-alpha.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/build/index.css +1 -1
- package/build/index.js +2 -2
- package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +3 -1
- package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/Content.js +2 -1
- package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +52 -20
- package/es/core/editor/components/Toolbar/widgets/FontColorButton.module.scss +8 -0
- package/es/core/editor/components/Toolbar/widgets/FontStyleButton.js +13 -2
- package/es/core/editor/components/Toolbar/widgets/NodeAlignWidget.js +7 -3
- package/es/core/editor/components/Toolbar/widgets/NodeAlignWidget.module.scss +1 -1
- package/es/core/editor/components/Toolbar/widgets/components/DropdownMenu.js +3 -1
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/nodeTag.js +1 -1
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/globalTag.js +3 -1
- package/es/core/editor/components/settings/common/AlignSetting/AlignSetting.module.scss +0 -1
- package/es/core/models/TopoApp.js +1 -1
- package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +3 -1
- package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/Content.js +2 -1
- package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +54 -20
- package/lib/core/editor/components/Toolbar/widgets/FontColorButton.module.scss +8 -0
- package/lib/core/editor/components/Toolbar/widgets/FontStyleButton.js +14 -2
- package/lib/core/editor/components/Toolbar/widgets/NodeAlignWidget.js +7 -3
- package/lib/core/editor/components/Toolbar/widgets/NodeAlignWidget.module.scss +1 -1
- package/lib/core/editor/components/Toolbar/widgets/components/DropdownMenu.js +3 -1
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/nodeTag.js +1 -1
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/globalTag.js +3 -1
- package/lib/core/editor/components/settings/common/AlignSetting/AlignSetting.module.scss +0 -1
- package/lib/core/models/TopoApp.js +1 -1
- package/package.json +2 -2
@@ -15,7 +15,8 @@ function Content(props) {
|
|
15
15
|
return /*#__PURE__*/React.createElement("div", {
|
16
16
|
style: {
|
17
17
|
marginTop: '6px',
|
18
|
-
marginLeft: '12px'
|
18
|
+
marginLeft: '12px',
|
19
|
+
marginBottom: '6px'
|
19
20
|
}
|
20
21
|
}, /*#__PURE__*/React.createElement("div", null, "\u7EBF"), /*#__PURE__*/React.createElement("div", {
|
21
22
|
style: {
|
@@ -5,20 +5,41 @@ import WidgetBox from "./WidgetBox";
|
|
5
5
|
import ColorPanel from "../../../../../components/ColorPanel";
|
6
6
|
import FontColorRange from "../../../../../components/ColorPanel/components/FontColorRange";
|
7
7
|
import styles from "./FontColorButton.module.scss";
|
8
|
+
import textStyleSettingRouter from "./components/textStyleSetting/textStyleSettingRouter.js";
|
8
9
|
|
9
10
|
function FontFamilySelect(props) {
|
10
|
-
var
|
11
|
-
|
12
|
-
|
11
|
+
var onChange = props.onChange,
|
12
|
+
topo = props.topo,
|
13
|
+
color = props.color,
|
14
|
+
background = props.background,
|
15
|
+
opacity = props.opacity;
|
13
16
|
|
14
17
|
var _useState = useState(false),
|
15
18
|
disabled = _useState[0],
|
16
19
|
setDisabled = _useState[1];
|
17
20
|
|
18
|
-
console.log(topo, 'topo这里需要处理颜色改变的事情');
|
19
|
-
|
20
21
|
var backOpacityChange = function backOpacityChange(value) {
|
21
|
-
|
22
|
+
onChange({
|
23
|
+
color: color,
|
24
|
+
background: background,
|
25
|
+
opacity: value / 100
|
26
|
+
});
|
27
|
+
};
|
28
|
+
|
29
|
+
var colorChang = function colorChang(value) {
|
30
|
+
onChange({
|
31
|
+
color: value.hex,
|
32
|
+
background: background,
|
33
|
+
opacity: opacity
|
34
|
+
});
|
35
|
+
};
|
36
|
+
|
37
|
+
var backgroundChang = function backgroundChang(value) {
|
38
|
+
onChange({
|
39
|
+
color: color,
|
40
|
+
background: value.hex,
|
41
|
+
opacity: opacity
|
42
|
+
});
|
22
43
|
};
|
23
44
|
|
24
45
|
var icon = disabled ? /*#__PURE__*/React.createElement("img", {
|
@@ -30,13 +51,14 @@ function FontFamilySelect(props) {
|
|
30
51
|
});
|
31
52
|
return /*#__PURE__*/React.createElement(DropdownButton, {
|
32
53
|
disabled: disabled,
|
33
|
-
trigger: icon
|
34
|
-
onChange: onChange
|
54
|
+
trigger: icon
|
35
55
|
}, /*#__PURE__*/React.createElement("div", {
|
36
56
|
className: styles.content
|
37
57
|
}, /*#__PURE__*/React.createElement("div", {
|
38
58
|
className: styles.fontColor
|
39
|
-
}, /*#__PURE__*/React.createElement("span", null, "\u5B57\u4F53\u989C\u8272"), /*#__PURE__*/React.createElement(ColorPanel,
|
59
|
+
}, /*#__PURE__*/React.createElement("span", null, "\u5B57\u4F53\u989C\u8272"), /*#__PURE__*/React.createElement(ColorPanel, {
|
60
|
+
onChange: colorChang
|
61
|
+
})), /*#__PURE__*/React.createElement("div", {
|
40
62
|
className: styles.backgroundColor
|
41
63
|
}, /*#__PURE__*/React.createElement("span", null, "\u80CC\u666F\u586B\u5145"), /*#__PURE__*/React.createElement("div", {
|
42
64
|
className: styles.backOpacity
|
@@ -48,29 +70,39 @@ function FontFamilySelect(props) {
|
|
48
70
|
unit: "%",
|
49
71
|
list: [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100],
|
50
72
|
onChange: backOpacityChange,
|
51
|
-
defaultValue:
|
73
|
+
defaultValue: opacity
|
52
74
|
})), /*#__PURE__*/React.createElement(ColorPanel, {
|
53
|
-
showClear: true
|
75
|
+
showClear: true,
|
76
|
+
onChange: backgroundChang
|
54
77
|
}))));
|
55
78
|
}
|
56
79
|
|
57
80
|
function FontColorButton(props) {
|
58
81
|
var showLabel = props.showLabel,
|
59
|
-
topo = props.topo
|
60
|
-
|
61
|
-
|
62
|
-
value = _useState2[0],
|
63
|
-
setValue = _useState2[1];
|
64
|
-
|
82
|
+
topo = props.topo,
|
83
|
+
style = props.style,
|
84
|
+
setStyle = props.setStyle;
|
65
85
|
return /*#__PURE__*/React.createElement(WidgetBox, {
|
66
86
|
label: "\u6587\u5B57\u989C\u8272",
|
67
87
|
tooltip: "\u6587\u5B57\u989C\u8272",
|
68
88
|
showLabel: showLabel
|
69
89
|
}, /*#__PURE__*/React.createElement(FontFamilySelect, {
|
70
|
-
|
71
|
-
|
90
|
+
color: style.color,
|
91
|
+
background: style.background,
|
92
|
+
opacity: style.opacity,
|
93
|
+
onChange: function onChange(val) {
|
94
|
+
topo.historyManager.beginTransaction();
|
95
|
+
setStyle({
|
96
|
+
color: val.color,
|
97
|
+
background: val.background,
|
98
|
+
opacity: val.opacity
|
99
|
+
});
|
100
|
+
topo.historyManager.endTransaction();
|
101
|
+
},
|
72
102
|
topo: topo
|
73
103
|
}));
|
74
104
|
}
|
75
105
|
|
76
|
-
export default FontColorButton
|
106
|
+
export default textStyleSettingRouter(FontColorButton, {
|
107
|
+
names: ['color', 'background', 'opacity']
|
108
|
+
});
|
@@ -3,6 +3,10 @@
|
|
3
3
|
.fontColor{
|
4
4
|
width: 100%;
|
5
5
|
height: 143px;//159px
|
6
|
+
.colorPanelBox{
|
7
|
+
padding: 9px;
|
8
|
+
padding-top: 8px;
|
9
|
+
}
|
6
10
|
&>span{
|
7
11
|
font-size: 12px;
|
8
12
|
color: black;
|
@@ -15,6 +19,10 @@
|
|
15
19
|
.backgroundColor{
|
16
20
|
width: 100%;
|
17
21
|
height: 159px;
|
22
|
+
.colorPanelBox{
|
23
|
+
padding: 9px;
|
24
|
+
padding-top: 0px;
|
25
|
+
}
|
18
26
|
&>span{
|
19
27
|
font-size: 12px;
|
20
28
|
color: black;
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
2
2
|
import React, { useState, useEffect } from 'react';
|
3
|
+
import { isText } from "../../../../../utils/htElementUtils";
|
3
4
|
import DropdownMenu from "./components/DropdownMenu";
|
4
5
|
import textStyleSettingRouter from "./components/textStyleSetting/textStyleSettingRouter.js";
|
5
6
|
import WidgetBox from "./WidgetBox";
|
@@ -39,7 +40,7 @@ function FontStyleButton(props) {
|
|
39
40
|
style = props.style,
|
40
41
|
setStyle = props.setStyle;
|
41
42
|
|
42
|
-
var _useState = useState(
|
43
|
+
var _useState = useState(true),
|
43
44
|
disabled = _useState[0],
|
44
45
|
setDisabled = _useState[1];
|
45
46
|
|
@@ -58,7 +59,15 @@ function FontStyleButton(props) {
|
|
58
59
|
|
59
60
|
var selection = topo.selectionManager.useHtSelection();
|
60
61
|
useEffect(function () {
|
61
|
-
|
62
|
+
var isAllText = !selection.filter(function (ele) {
|
63
|
+
return !isText(ele);
|
64
|
+
}).length;
|
65
|
+
|
66
|
+
if (selection.length && isAllText) {
|
67
|
+
setDisabled(false);
|
68
|
+
} else {
|
69
|
+
setDisabled(true);
|
70
|
+
}
|
62
71
|
}, [selection]);
|
63
72
|
useEffect(function () {
|
64
73
|
setValue(buildValue({
|
@@ -81,6 +90,7 @@ function FontStyleButton(props) {
|
|
81
90
|
return /*#__PURE__*/React.createElement(WidgetBox, {
|
82
91
|
label: "\u6587\u5B57\u6837\u5F0F",
|
83
92
|
tooltip: "\u6587\u5B57\u6837\u5F0F",
|
93
|
+
disabled: disabled,
|
84
94
|
showLabel: showLabel
|
85
95
|
}, /*#__PURE__*/React.createElement(DropdownMenu, {
|
86
96
|
value: value,
|
@@ -91,6 +101,7 @@ function FontStyleButton(props) {
|
|
91
101
|
});
|
92
102
|
},
|
93
103
|
multiple: true,
|
104
|
+
disabled: disabled,
|
94
105
|
onChange: handleChange
|
95
106
|
}, items.map(function (item) {
|
96
107
|
return /*#__PURE__*/React.createElement(DropdownMenu.Item, {
|
@@ -34,7 +34,7 @@ function NodeAlignWidget(props) {
|
|
34
34
|
graphLoaded = _topo$store$useModelS.graphLoaded; // 选中的元素
|
35
35
|
|
36
36
|
|
37
|
-
var selection = topo.selectionManager.
|
37
|
+
var selection = topo.selectionManager.useHtSelection();
|
38
38
|
|
39
39
|
var setSpace = function setSpace(type, num) {
|
40
40
|
topo.historyManager.beginTransaction(); // eslint-disable-next-line no-shadow
|
@@ -86,10 +86,14 @@ function NodeAlignWidget(props) {
|
|
86
86
|
}, /*#__PURE__*/React.createElement(DropdownButton, {
|
87
87
|
disabled: disabled,
|
88
88
|
trigger: icon
|
89
|
-
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(
|
89
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
|
90
|
+
style: {
|
91
|
+
margin: '10px 7px 17px 7px'
|
92
|
+
}
|
93
|
+
}, /*#__PURE__*/React.createElement(AlignSetting, {
|
90
94
|
topo: topo,
|
91
95
|
distributionDisabled: distributionDisabled
|
92
|
-
}), /*#__PURE__*/React.createElement(_NumberPicker, {
|
96
|
+
})), /*#__PURE__*/React.createElement(_NumberPicker, {
|
93
97
|
disabled: disabled,
|
94
98
|
size: "small",
|
95
99
|
hasTrigger: false,
|
@@ -8,7 +8,8 @@ function DropdownMenu(props) {
|
|
8
8
|
children = props.children,
|
9
9
|
multiple = props.multiple,
|
10
10
|
onChange = props.onChange,
|
11
|
-
valueRender = props.valueRender
|
11
|
+
valueRender = props.valueRender,
|
12
|
+
disabled = props.disabled;
|
12
13
|
var selectedKeys = Array.isArray(value) ? value : [value];
|
13
14
|
var valueDisplay = valueRender ? valueRender(value) : value;
|
14
15
|
var selectMode = multiple ? 'multiple' : 'single';
|
@@ -24,6 +25,7 @@ function DropdownMenu(props) {
|
|
24
25
|
}, children);
|
25
26
|
return /*#__PURE__*/React.createElement(DropdownButton, {
|
26
27
|
trigger: valueDisplay,
|
28
|
+
disabled: disabled,
|
27
29
|
showContainer: false
|
28
30
|
}, multiple ? /*#__PURE__*/React.createElement("div", null, menu) : menu);
|
29
31
|
}
|
@@ -12,7 +12,7 @@ export function setTextStyle(element, style, topo) {
|
|
12
12
|
if ('background' in style || 'opacity' in style) {
|
13
13
|
// 背景颜色
|
14
14
|
var prevStyle = getTextStyle(element);
|
15
|
-
topo.setNodeLabelStyle(element, {
|
15
|
+
topo.getHtTopo().setNodeLabelStyle(element, {
|
16
16
|
background: formatBackgroundRgbaColor(prevStyle, style)
|
17
17
|
});
|
18
18
|
} else {
|
@@ -10,7 +10,9 @@ export function useValues(topo) {
|
|
10
10
|
return {
|
11
11
|
color: (nodeLabelStyle === null || nodeLabelStyle === void 0 ? void 0 : nodeLabelStyle.color) || defaultStyle.color,
|
12
12
|
fontFamily: (nodeLabelStyle === null || nodeLabelStyle === void 0 ? void 0 : nodeLabelStyle.fontFamily) || defaultStyle.fontFamily,
|
13
|
-
fontSize: nodeLabelStyle === null || nodeLabelStyle === void 0 ? void 0 : nodeLabelStyle.fontSize
|
13
|
+
fontSize: nodeLabelStyle === null || nodeLabelStyle === void 0 ? void 0 : nodeLabelStyle.fontSize,
|
14
|
+
background: nodeLabelStyle === null || nodeLabelStyle === void 0 ? void 0 : nodeLabelStyle.background,
|
15
|
+
opacity: nodeLabelStyle === null || nodeLabelStyle === void 0 ? void 0 : nodeLabelStyle.opacity
|
14
16
|
};
|
15
17
|
}
|
16
18
|
export var setGlobalTagStyle = function setGlobalTagStyle(topo, styleData) {
|
@@ -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.40" === 'string' ? "6.0.0-alpha.40" : null;
|
26
26
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
27
27
|
/**
|
28
28
|
* 拓扑显示和编辑
|
@@ -24,7 +24,8 @@ function Content(props) {
|
|
24
24
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
25
25
|
style: {
|
26
26
|
marginTop: '6px',
|
27
|
-
marginLeft: '12px'
|
27
|
+
marginLeft: '12px',
|
28
|
+
marginBottom: '6px'
|
28
29
|
}
|
29
30
|
}, /*#__PURE__*/_react["default"].createElement("div", null, "\u7EBF"), /*#__PURE__*/_react["default"].createElement("div", {
|
30
31
|
style: {
|
@@ -17,24 +17,46 @@ var _FontColorRange = _interopRequireDefault(require("../../../../../components/
|
|
17
17
|
|
18
18
|
var _FontColorButtonModule = _interopRequireDefault(require("./FontColorButton.module.scss"));
|
19
19
|
|
20
|
+
var _textStyleSettingRouter = _interopRequireDefault(require("./components/textStyleSetting/textStyleSettingRouter.js"));
|
21
|
+
|
20
22
|
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); }
|
21
23
|
|
22
24
|
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
25
|
|
24
26
|
/* eslint-disable jsx-a11y/alt-text */
|
25
27
|
function FontFamilySelect(props) {
|
26
|
-
var
|
27
|
-
|
28
|
-
|
28
|
+
var onChange = props.onChange,
|
29
|
+
topo = props.topo,
|
30
|
+
color = props.color,
|
31
|
+
background = props.background,
|
32
|
+
opacity = props.opacity;
|
29
33
|
|
30
34
|
var _useState = (0, _react.useState)(false),
|
31
35
|
disabled = _useState[0],
|
32
36
|
setDisabled = _useState[1];
|
33
37
|
|
34
|
-
console.log(topo, 'topo这里需要处理颜色改变的事情');
|
35
|
-
|
36
38
|
var backOpacityChange = function backOpacityChange(value) {
|
37
|
-
|
39
|
+
onChange({
|
40
|
+
color: color,
|
41
|
+
background: background,
|
42
|
+
opacity: value / 100
|
43
|
+
});
|
44
|
+
};
|
45
|
+
|
46
|
+
var colorChang = function colorChang(value) {
|
47
|
+
onChange({
|
48
|
+
color: value.hex,
|
49
|
+
background: background,
|
50
|
+
opacity: opacity
|
51
|
+
});
|
52
|
+
};
|
53
|
+
|
54
|
+
var backgroundChang = function backgroundChang(value) {
|
55
|
+
onChange({
|
56
|
+
color: color,
|
57
|
+
background: value.hex,
|
58
|
+
opacity: opacity
|
59
|
+
});
|
38
60
|
};
|
39
61
|
|
40
62
|
var icon = disabled ? /*#__PURE__*/_react["default"].createElement("img", {
|
@@ -46,13 +68,14 @@ function FontFamilySelect(props) {
|
|
46
68
|
});
|
47
69
|
return /*#__PURE__*/_react["default"].createElement(_DropdownButton["default"], {
|
48
70
|
disabled: disabled,
|
49
|
-
trigger: icon
|
50
|
-
onChange: onChange
|
71
|
+
trigger: icon
|
51
72
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
52
73
|
className: _FontColorButtonModule["default"].content
|
53
74
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
54
75
|
className: _FontColorButtonModule["default"].fontColor
|
55
|
-
}, /*#__PURE__*/_react["default"].createElement("span", null, "\u5B57\u4F53\u989C\u8272"), /*#__PURE__*/_react["default"].createElement(_ColorPanel["default"],
|
76
|
+
}, /*#__PURE__*/_react["default"].createElement("span", null, "\u5B57\u4F53\u989C\u8272"), /*#__PURE__*/_react["default"].createElement(_ColorPanel["default"], {
|
77
|
+
onChange: colorChang
|
78
|
+
})), /*#__PURE__*/_react["default"].createElement("div", {
|
56
79
|
className: _FontColorButtonModule["default"].backgroundColor
|
57
80
|
}, /*#__PURE__*/_react["default"].createElement("span", null, "\u80CC\u666F\u586B\u5145"), /*#__PURE__*/_react["default"].createElement("div", {
|
58
81
|
className: _FontColorButtonModule["default"].backOpacity
|
@@ -64,30 +87,41 @@ function FontFamilySelect(props) {
|
|
64
87
|
unit: "%",
|
65
88
|
list: [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100],
|
66
89
|
onChange: backOpacityChange,
|
67
|
-
defaultValue:
|
90
|
+
defaultValue: opacity
|
68
91
|
})), /*#__PURE__*/_react["default"].createElement(_ColorPanel["default"], {
|
69
|
-
showClear: true
|
92
|
+
showClear: true,
|
93
|
+
onChange: backgroundChang
|
70
94
|
}))));
|
71
95
|
}
|
72
96
|
|
73
97
|
function FontColorButton(props) {
|
74
98
|
var showLabel = props.showLabel,
|
75
|
-
topo = props.topo
|
76
|
-
|
77
|
-
|
78
|
-
value = _useState2[0],
|
79
|
-
setValue = _useState2[1];
|
80
|
-
|
99
|
+
topo = props.topo,
|
100
|
+
style = props.style,
|
101
|
+
setStyle = props.setStyle;
|
81
102
|
return /*#__PURE__*/_react["default"].createElement(_WidgetBox["default"], {
|
82
103
|
label: "\u6587\u5B57\u989C\u8272",
|
83
104
|
tooltip: "\u6587\u5B57\u989C\u8272",
|
84
105
|
showLabel: showLabel
|
85
106
|
}, /*#__PURE__*/_react["default"].createElement(FontFamilySelect, {
|
86
|
-
|
87
|
-
|
107
|
+
color: style.color,
|
108
|
+
background: style.background,
|
109
|
+
opacity: style.opacity,
|
110
|
+
onChange: function onChange(val) {
|
111
|
+
topo.historyManager.beginTransaction();
|
112
|
+
setStyle({
|
113
|
+
color: val.color,
|
114
|
+
background: val.background,
|
115
|
+
opacity: val.opacity
|
116
|
+
});
|
117
|
+
topo.historyManager.endTransaction();
|
118
|
+
},
|
88
119
|
topo: topo
|
89
120
|
}));
|
90
121
|
}
|
91
122
|
|
92
|
-
var _default = FontColorButton
|
123
|
+
var _default = (0, _textStyleSettingRouter["default"])(FontColorButton, {
|
124
|
+
names: ['color', 'background', 'opacity']
|
125
|
+
});
|
126
|
+
|
93
127
|
exports["default"] = _default;
|
@@ -3,6 +3,10 @@
|
|
3
3
|
.fontColor{
|
4
4
|
width: 100%;
|
5
5
|
height: 143px;//159px
|
6
|
+
.colorPanelBox{
|
7
|
+
padding: 9px;
|
8
|
+
padding-top: 8px;
|
9
|
+
}
|
6
10
|
&>span{
|
7
11
|
font-size: 12px;
|
8
12
|
color: black;
|
@@ -15,6 +19,10 @@
|
|
15
19
|
.backgroundColor{
|
16
20
|
width: 100%;
|
17
21
|
height: 159px;
|
22
|
+
.colorPanelBox{
|
23
|
+
padding: 9px;
|
24
|
+
padding-top: 0px;
|
25
|
+
}
|
18
26
|
&>span{
|
19
27
|
font-size: 12px;
|
20
28
|
color: black;
|
@@ -9,6 +9,8 @@ var _extends3 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
|
|
9
9
|
|
10
10
|
var _react = _interopRequireWildcard(require("react"));
|
11
11
|
|
12
|
+
var _htElementUtils = require("../../../../../utils/htElementUtils");
|
13
|
+
|
12
14
|
var _DropdownMenu = _interopRequireDefault(require("./components/DropdownMenu"));
|
13
15
|
|
14
16
|
var _textStyleSettingRouter = _interopRequireDefault(require("./components/textStyleSetting/textStyleSettingRouter.js"));
|
@@ -55,7 +57,7 @@ function FontStyleButton(props) {
|
|
55
57
|
style = props.style,
|
56
58
|
setStyle = props.setStyle;
|
57
59
|
|
58
|
-
var _useState = (0, _react.useState)(
|
60
|
+
var _useState = (0, _react.useState)(true),
|
59
61
|
disabled = _useState[0],
|
60
62
|
setDisabled = _useState[1];
|
61
63
|
|
@@ -74,7 +76,15 @@ function FontStyleButton(props) {
|
|
74
76
|
|
75
77
|
var selection = topo.selectionManager.useHtSelection();
|
76
78
|
(0, _react.useEffect)(function () {
|
77
|
-
|
79
|
+
var isAllText = !selection.filter(function (ele) {
|
80
|
+
return !(0, _htElementUtils.isText)(ele);
|
81
|
+
}).length;
|
82
|
+
|
83
|
+
if (selection.length && isAllText) {
|
84
|
+
setDisabled(false);
|
85
|
+
} else {
|
86
|
+
setDisabled(true);
|
87
|
+
}
|
78
88
|
}, [selection]);
|
79
89
|
(0, _react.useEffect)(function () {
|
80
90
|
setValue(buildValue({
|
@@ -97,6 +107,7 @@ function FontStyleButton(props) {
|
|
97
107
|
return /*#__PURE__*/_react["default"].createElement(_WidgetBox["default"], {
|
98
108
|
label: "\u6587\u5B57\u6837\u5F0F",
|
99
109
|
tooltip: "\u6587\u5B57\u6837\u5F0F",
|
110
|
+
disabled: disabled,
|
100
111
|
showLabel: showLabel
|
101
112
|
}, /*#__PURE__*/_react["default"].createElement(_DropdownMenu["default"], {
|
102
113
|
value: value,
|
@@ -107,6 +118,7 @@ function FontStyleButton(props) {
|
|
107
118
|
});
|
108
119
|
},
|
109
120
|
multiple: true,
|
121
|
+
disabled: disabled,
|
110
122
|
onChange: handleChange
|
111
123
|
}, items.map(function (item) {
|
112
124
|
return /*#__PURE__*/_react["default"].createElement(_DropdownMenu["default"].Item, {
|
@@ -53,7 +53,7 @@ function NodeAlignWidget(props) {
|
|
53
53
|
graphLoaded = _topo$store$useModelS.graphLoaded; // 选中的元素
|
54
54
|
|
55
55
|
|
56
|
-
var selection = topo.selectionManager.
|
56
|
+
var selection = topo.selectionManager.useHtSelection();
|
57
57
|
|
58
58
|
var setSpace = function setSpace(type, num) {
|
59
59
|
topo.historyManager.beginTransaction(); // eslint-disable-next-line no-shadow
|
@@ -105,10 +105,14 @@ function NodeAlignWidget(props) {
|
|
105
105
|
}, /*#__PURE__*/_react["default"].createElement(_DropdownButton["default"], {
|
106
106
|
disabled: disabled,
|
107
107
|
trigger: icon
|
108
|
-
}, /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement(
|
108
|
+
}, /*#__PURE__*/_react["default"].createElement("div", null, /*#__PURE__*/_react["default"].createElement("div", {
|
109
|
+
style: {
|
110
|
+
margin: '10px 7px 17px 7px'
|
111
|
+
}
|
112
|
+
}, /*#__PURE__*/_react["default"].createElement(_AlignSetting["default"], {
|
109
113
|
topo: topo,
|
110
114
|
distributionDisabled: distributionDisabled
|
111
|
-
}), /*#__PURE__*/_react["default"].createElement(_numberPicker["default"], {
|
115
|
+
})), /*#__PURE__*/_react["default"].createElement(_numberPicker["default"], {
|
112
116
|
disabled: disabled,
|
113
117
|
size: "small",
|
114
118
|
hasTrigger: false,
|
@@ -18,7 +18,8 @@ function DropdownMenu(props) {
|
|
18
18
|
children = props.children,
|
19
19
|
multiple = props.multiple,
|
20
20
|
onChange = props.onChange,
|
21
|
-
valueRender = props.valueRender
|
21
|
+
valueRender = props.valueRender,
|
22
|
+
disabled = props.disabled;
|
22
23
|
var selectedKeys = Array.isArray(value) ? value : [value];
|
23
24
|
var valueDisplay = valueRender ? valueRender(value) : value;
|
24
25
|
var selectMode = multiple ? 'multiple' : 'single';
|
@@ -35,6 +36,7 @@ function DropdownMenu(props) {
|
|
35
36
|
|
36
37
|
return /*#__PURE__*/_react["default"].createElement(_DropdownButton["default"], {
|
37
38
|
trigger: valueDisplay,
|
39
|
+
disabled: disabled,
|
38
40
|
showContainer: false
|
39
41
|
}, multiple ? /*#__PURE__*/_react["default"].createElement("div", null, menu) : menu);
|
40
42
|
}
|
@@ -25,7 +25,7 @@ function setTextStyle(element, style, topo) {
|
|
25
25
|
if ('background' in style || 'opacity' in style) {
|
26
26
|
// 背景颜色
|
27
27
|
var prevStyle = getTextStyle(element);
|
28
|
-
topo.setNodeLabelStyle(element, {
|
28
|
+
topo.getHtTopo().setNodeLabelStyle(element, {
|
29
29
|
background: (0, _colorUtil.formatBackgroundRgbaColor)(prevStyle, style)
|
30
30
|
});
|
31
31
|
} else {
|
@@ -21,7 +21,9 @@ function useValues(topo) {
|
|
21
21
|
return {
|
22
22
|
color: (nodeLabelStyle === null || nodeLabelStyle === void 0 ? void 0 : nodeLabelStyle.color) || defaultStyle.color,
|
23
23
|
fontFamily: (nodeLabelStyle === null || nodeLabelStyle === void 0 ? void 0 : nodeLabelStyle.fontFamily) || defaultStyle.fontFamily,
|
24
|
-
fontSize: nodeLabelStyle === null || nodeLabelStyle === void 0 ? void 0 : nodeLabelStyle.fontSize
|
24
|
+
fontSize: nodeLabelStyle === null || nodeLabelStyle === void 0 ? void 0 : nodeLabelStyle.fontSize,
|
25
|
+
background: nodeLabelStyle === null || nodeLabelStyle === void 0 ? void 0 : nodeLabelStyle.background,
|
26
|
+
opacity: nodeLabelStyle === null || nodeLabelStyle === void 0 ? void 0 : nodeLabelStyle.opacity
|
25
27
|
};
|
26
28
|
}
|
27
29
|
|
@@ -52,7 +52,7 @@ var _ElementTagTipConfig = _interopRequireDefault(require("./tagstips/ElementTag
|
|
52
52
|
var _SelectionManager = _interopRequireDefault(require("./SelectionManager"));
|
53
53
|
|
54
54
|
// eslint-disable-next-line no-undef
|
55
|
-
var version = typeof "6.0.0-alpha.
|
55
|
+
var version = typeof "6.0.0-alpha.40" === 'string' ? "6.0.0-alpha.40" : null;
|
56
56
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
57
57
|
/**
|
58
58
|
* 拓扑显示和编辑
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@riil-frontend/component-topology",
|
3
|
-
"version": "6.0.0-alpha.
|
3
|
+
"version": "6.0.0-alpha.40",
|
4
4
|
"description": "拓扑",
|
5
5
|
"scripts": {
|
6
6
|
"start": "build-scripts start",
|
@@ -116,6 +116,6 @@
|
|
116
116
|
"access": "public"
|
117
117
|
},
|
118
118
|
"license": "MIT",
|
119
|
-
"homepage": "https://unpkg.com/@riil-frontend/component-topology@6.0.0-alpha.
|
119
|
+
"homepage": "https://unpkg.com/@riil-frontend/component-topology@6.0.0-alpha.40/build/index.html",
|
120
120
|
"gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
|
121
121
|
}
|