@riil-frontend/component-topology 6.0.0-alpha.50 → 6.0.0-alpha.51
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.js +1 -1
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +16 -5
- package/es/core/models/TopoApp.js +1 -1
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +17 -5
- package/lib/core/models/TopoApp.js +1 -1
- package/package.json +2 -2
@@ -1,4 +1,6 @@
|
|
1
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
1
2
|
import _extends from "@babel/runtime/helpers/extends";
|
3
|
+
var _excluded = ["color", "background", "opacity"];
|
2
4
|
import fontStyleUtil from "../../../../../../settings/common/text/fontStyleUtil";
|
3
5
|
import { formatBackgroundRgbaColor, parseBackground, parseColor } from "../colorUtil";
|
4
6
|
export function getTextStyle(element) {
|
@@ -9,15 +11,24 @@ export function getTextStyle(element) {
|
|
9
11
|
}, fontStyleUtil.toMap(element.a('link_ind_left_font')), parseBackground(element.a('link_ind_background')));
|
10
12
|
}
|
11
13
|
export function setTextStyle(element, style, topo) {
|
14
|
+
var color = style.color,
|
15
|
+
background = style.background,
|
16
|
+
opacity = style.opacity,
|
17
|
+
otherStyle = _objectWithoutPropertiesLoose(style, _excluded);
|
18
|
+
|
19
|
+
var tagStyle = _extends({}, otherStyle);
|
20
|
+
|
21
|
+
if ('color' in style) {
|
22
|
+
tagStyle.color = color.hex;
|
23
|
+
}
|
24
|
+
|
12
25
|
if ('background' in style || 'opacity' in style) {
|
13
26
|
// 背景颜色
|
14
27
|
var prevStyle = getTextStyle(element);
|
15
|
-
|
16
|
-
background: formatBackgroundRgbaColor(prevStyle, style)
|
17
|
-
});
|
18
|
-
} else {
|
19
|
-
topo.getHtTopo().setEdgeLabelStyle(element, style);
|
28
|
+
tagStyle.background = formatBackgroundRgbaColor(prevStyle, style);
|
20
29
|
}
|
30
|
+
|
31
|
+
topo.getHtTopo().setEdgeLabelStyle(element, tagStyle);
|
21
32
|
}
|
22
33
|
export default {
|
23
34
|
getTextStyle: getTextStyle,
|
@@ -22,7 +22,7 @@ import topoFactory from "./topoFactory";
|
|
22
22
|
import ElementTagTipConfig from "./tagstips/ElementTagTipConfig";
|
23
23
|
import SelectionModel from "./SelectionModel"; // eslint-disable-next-line no-undef
|
24
24
|
|
25
|
-
var version = typeof "6.0.0-alpha.
|
25
|
+
var version = typeof "6.0.0-alpha.51" === 'string' ? "6.0.0-alpha.51" : null;
|
26
26
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
27
27
|
/**
|
28
28
|
* 拓扑显示和编辑
|
@@ -7,12 +7,16 @@ exports["default"] = void 0;
|
|
7
7
|
exports.getTextStyle = getTextStyle;
|
8
8
|
exports.setTextStyle = setTextStyle;
|
9
9
|
|
10
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
11
|
+
|
10
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
11
13
|
|
12
14
|
var _fontStyleUtil = _interopRequireDefault(require("../../../../../../settings/common/text/fontStyleUtil"));
|
13
15
|
|
14
16
|
var _colorUtil = require("../colorUtil");
|
15
17
|
|
18
|
+
var _excluded = ["color", "background", "opacity"];
|
19
|
+
|
16
20
|
function getTextStyle(element) {
|
17
21
|
var underline = null;
|
18
22
|
return (0, _extends2["default"])({
|
@@ -22,15 +26,23 @@ function getTextStyle(element) {
|
|
22
26
|
}
|
23
27
|
|
24
28
|
function setTextStyle(element, style, topo) {
|
29
|
+
var color = style.color,
|
30
|
+
background = style.background,
|
31
|
+
opacity = style.opacity,
|
32
|
+
otherStyle = (0, _objectWithoutPropertiesLoose2["default"])(style, _excluded);
|
33
|
+
var tagStyle = (0, _extends2["default"])({}, otherStyle);
|
34
|
+
|
35
|
+
if ('color' in style) {
|
36
|
+
tagStyle.color = color.hex;
|
37
|
+
}
|
38
|
+
|
25
39
|
if ('background' in style || 'opacity' in style) {
|
26
40
|
// 背景颜色
|
27
41
|
var prevStyle = getTextStyle(element);
|
28
|
-
|
29
|
-
background: (0, _colorUtil.formatBackgroundRgbaColor)(prevStyle, style)
|
30
|
-
});
|
31
|
-
} else {
|
32
|
-
topo.getHtTopo().setEdgeLabelStyle(element, style);
|
42
|
+
tagStyle.background = (0, _colorUtil.formatBackgroundRgbaColor)(prevStyle, style);
|
33
43
|
}
|
44
|
+
|
45
|
+
topo.getHtTopo().setEdgeLabelStyle(element, tagStyle);
|
34
46
|
}
|
35
47
|
|
36
48
|
var _default = {
|
@@ -52,7 +52,7 @@ var _ElementTagTipConfig = _interopRequireDefault(require("./tagstips/ElementTag
|
|
52
52
|
var _SelectionModel = _interopRequireDefault(require("./SelectionModel"));
|
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.51" === 'string' ? "6.0.0-alpha.51" : 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.51",
|
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.51/build/index.html",
|
120
120
|
"gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
|
121
121
|
}
|