@riil-frontend/component-topology 6.0.0-alpha.55 → 6.0.0-alpha.56

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.
@@ -1,18 +1,32 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import fontStyleUtil from "../../../../../../settings/common/text/fontStyleUtil";
3
3
  import { formatBackgroundRgbaColor, parseBackground, parseColor } from "../colorUtil";
4
- var defaultStyle = {};
4
+ var defaultStyle = {
5
+ color: '#4D6277',
6
+ font: '10px 微软雅黑',
7
+ background: '#E4E9EE'
8
+ };
5
9
 
6
10
  function getLabelStyle(element) {
7
- return _extends({}, defaultStyle, element.a('labelStyle') || {});
8
- }
11
+ var background = element.s('layer.label.background');
9
12
 
10
- function setLabelStyle(element, style) {
11
- element.a('labelStyle', _extends({}, element.a('labelStyle'), style)); // eslint-disable-next-line no-underscore-dangle
13
+ if (background === undefined) {
14
+ background = defaultStyle.background;
15
+ }
12
16
 
13
- element.__labelNode.a(style);
17
+ return {
18
+ color: element.s('layer.label.color') || defaultStyle.color,
19
+ font: element.s('layer.label.font') || defaultStyle.font,
20
+ background: background
21
+ };
22
+ }
14
23
 
15
- console.error(element.__labelNode.getAttrObject());
24
+ function setLabelStyle(element, style) {
25
+ var map = {};
26
+ Object.keys(style).forEach(function (name) {
27
+ map["layer.label." + name] = style[name];
28
+ });
29
+ element.s(map);
16
30
  } // 分层标题文字样式
17
31
 
18
32
 
@@ -20,7 +34,7 @@ export function getTextStyle(element) {
20
34
  var style = getLabelStyle(element);
21
35
  var underline = null;
22
36
  return _extends({
23
- color: parseColor(style.fontColor),
37
+ color: parseColor(style.color),
24
38
  underline: underline
25
39
  }, fontStyleUtil.toMap(style.font), parseBackground(style.background));
26
40
  }
@@ -30,7 +44,7 @@ export function setTextStyle(element, style) {
30
44
  var labelStyle = {};
31
45
 
32
46
  if ('color' in style) {
33
- labelStyle.fontColor = style.color.hex;
47
+ labelStyle.color = style.color.hex;
34
48
  } // 背景颜色
35
49
 
36
50
 
@@ -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.55" === 'string' ? "6.0.0-alpha.55" : null;
25
+ var version = typeof "6.0.0-alpha.56" === 'string' ? "6.0.0-alpha.56" : null;
26
26
  console.info("\u62D3\u6251\u7248\u672C: " + version);
27
27
  /**
28
28
  * 拓扑显示和编辑
@@ -13,18 +13,32 @@ var _fontStyleUtil = _interopRequireDefault(require("../../../../../../settings/
13
13
 
14
14
  var _colorUtil = require("../colorUtil");
15
15
 
16
- var defaultStyle = {};
16
+ var defaultStyle = {
17
+ color: '#4D6277',
18
+ font: '10px 微软雅黑',
19
+ background: '#E4E9EE'
20
+ };
17
21
 
18
22
  function getLabelStyle(element) {
19
- return (0, _extends2["default"])({}, defaultStyle, element.a('labelStyle') || {});
20
- }
23
+ var background = element.s('layer.label.background');
21
24
 
22
- function setLabelStyle(element, style) {
23
- element.a('labelStyle', (0, _extends2["default"])({}, element.a('labelStyle'), style)); // eslint-disable-next-line no-underscore-dangle
25
+ if (background === undefined) {
26
+ background = defaultStyle.background;
27
+ }
24
28
 
25
- element.__labelNode.a(style);
29
+ return {
30
+ color: element.s('layer.label.color') || defaultStyle.color,
31
+ font: element.s('layer.label.font') || defaultStyle.font,
32
+ background: background
33
+ };
34
+ }
26
35
 
27
- console.error(element.__labelNode.getAttrObject());
36
+ function setLabelStyle(element, style) {
37
+ var map = {};
38
+ Object.keys(style).forEach(function (name) {
39
+ map["layer.label." + name] = style[name];
40
+ });
41
+ element.s(map);
28
42
  } // 分层标题文字样式
29
43
 
30
44
 
@@ -32,7 +46,7 @@ function getTextStyle(element) {
32
46
  var style = getLabelStyle(element);
33
47
  var underline = null;
34
48
  return (0, _extends2["default"])({
35
- color: (0, _colorUtil.parseColor)(style.fontColor),
49
+ color: (0, _colorUtil.parseColor)(style.color),
36
50
  underline: underline
37
51
  }, _fontStyleUtil["default"].toMap(style.font), (0, _colorUtil.parseBackground)(style.background));
38
52
  }
@@ -43,7 +57,7 @@ function setTextStyle(element, style) {
43
57
  var labelStyle = {};
44
58
 
45
59
  if ('color' in style) {
46
- labelStyle.fontColor = style.color.hex;
60
+ labelStyle.color = style.color.hex;
47
61
  } // 背景颜色
48
62
 
49
63
 
@@ -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" === 'string' ? "6.0.0-alpha.55" : null;
55
+ var version = typeof "6.0.0-alpha.56" === 'string' ? "6.0.0-alpha.56" : 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.55",
3
+ "version": "6.0.0-alpha.56",
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.55/build/index.html",
119
+ "homepage": "https://unpkg.com/@riil-frontend/component-topology@6.0.0-alpha.56/build/index.html",
120
120
  "gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
121
121
  }