@riil-frontend/component-topology 6.0.0-alpha.52 → 6.0.0-alpha.53

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.
@@ -114,7 +114,11 @@ function FontStyleButton(props) {
114
114
  }, /*#__PURE__*/React.createElement("img", {
115
115
  src: "/img/topo/editor/toolbar/" + item.icon + "/Normal.svg",
116
116
  alt: ""
117
- }), /*#__PURE__*/React.createElement("span", null, item.label)));
117
+ }), /*#__PURE__*/React.createElement("span", {
118
+ style: {
119
+ color: '#4d6277 !important'
120
+ }
121
+ }, item.label)));
118
122
  })));
119
123
  }
120
124
 
@@ -45,7 +45,7 @@ function Layout(props) {
45
45
  } // eslint-disable-next-line eqeqeq
46
46
 
47
47
 
48
- if (isLayer(firstElement)) {
48
+ if (firstElement && isLayer(firstElement)) {
49
49
  topo.getHtTopo().layoutLayer(selectionElements[0]);
50
50
  }
51
51
  };
@@ -47,14 +47,18 @@ function NodeAlignWidget(props) {
47
47
  topo.historyManager.endTransaction();
48
48
  };
49
49
 
50
- var leftInputChange = function leftInputChange(v) {
51
- setLeftInputVal(v);
52
- setSpace('h', v);
50
+ var leftInputChange = function leftInputChange(val) {
51
+ setLeftInputVal(val);
52
+ setSpace('h', val);
53
53
  };
54
54
 
55
- var rightInputChange = function rightInputChange(v) {
56
- setRightInputVal(v);
57
- setSpace('v', v);
55
+ var rightInputChange = function rightInputChange(val) {
56
+ setRightInputVal(val);
57
+ setSpace('v', val);
58
+ };
59
+
60
+ var parseValue = function parseValue(v) {
61
+ return v * 1 > 0 ? Math.round(v) : '';
58
62
  };
59
63
 
60
64
  useEffect(function () {
@@ -72,8 +76,8 @@ function NodeAlignWidget(props) {
72
76
  if (nodes.length === 2) {
73
77
  var h = topo.view.topoClient.htTopoClient.getElementsSpace(nodes, 'h')[0];
74
78
  var v = topo.view.topoClient.htTopoClient.getElementsSpace(nodes, 'v')[0];
75
- setLeftInputVal(Math.round(h * 1 > 0 ? h : 0));
76
- setRightInputVal(Math.round(v * 1 > 0 ? v : 0));
79
+ setLeftInputVal(parseValue(h));
80
+ setRightInputVal(parseValue(v));
77
81
  }
78
82
  } // eslint-disable-next-line react-hooks/exhaustive-deps
79
83
 
@@ -104,7 +108,7 @@ function NodeAlignWidget(props) {
104
108
  disabled: disabled,
105
109
  size: "small",
106
110
  hasTrigger: false,
107
- placeholder: "\u591A\u4E2A\u503C",
111
+ placeholder: distributionDisabled ? '' : '多个值',
108
112
  className: styles.leftInput,
109
113
  value: leftInputVal,
110
114
  min: 0,
@@ -113,8 +117,9 @@ function NodeAlignWidget(props) {
113
117
  }), /*#__PURE__*/React.createElement(_NumberPicker, {
114
118
  disabled: disabled,
115
119
  size: "small",
116
- hasTrigger: false,
117
- placeholder: "\u591A\u4E2A\u503C",
120
+ hasTrigger: false // eslint-disable-next-line no-nested-ternary
121
+ ,
122
+ placeholder: distributionDisabled ? '' : '多个值',
118
123
  className: styles.rightInput,
119
124
  value: rightInputVal,
120
125
  min: 0,
@@ -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.52" === 'string' ? "6.0.0-alpha.52" : null;
25
+ var version = typeof "6.0.0-alpha.53" === 'string' ? "6.0.0-alpha.53" : null;
26
26
  console.info("\u62D3\u6251\u7248\u672C: " + version);
27
27
  /**
28
28
  * 拓扑显示和编辑
@@ -131,7 +131,11 @@ function FontStyleButton(props) {
131
131
  }, /*#__PURE__*/_react["default"].createElement("img", {
132
132
  src: "/img/topo/editor/toolbar/" + item.icon + "/Normal.svg",
133
133
  alt: ""
134
- }), /*#__PURE__*/_react["default"].createElement("span", null, item.label)));
134
+ }), /*#__PURE__*/_react["default"].createElement("span", {
135
+ style: {
136
+ color: '#4d6277 !important'
137
+ }
138
+ }, item.label)));
135
139
  })));
136
140
  }
137
141
 
@@ -61,7 +61,7 @@ function Layout(props) {
61
61
  } // eslint-disable-next-line eqeqeq
62
62
 
63
63
 
64
- if ((0, _htElementDataUtil.isLayer)(firstElement)) {
64
+ if (firstElement && (0, _htElementDataUtil.isLayer)(firstElement)) {
65
65
  topo.getHtTopo().layoutLayer(selectionElements[0]);
66
66
  }
67
67
  };
@@ -66,14 +66,18 @@ function NodeAlignWidget(props) {
66
66
  topo.historyManager.endTransaction();
67
67
  };
68
68
 
69
- var leftInputChange = function leftInputChange(v) {
70
- setLeftInputVal(v);
71
- setSpace('h', v);
69
+ var leftInputChange = function leftInputChange(val) {
70
+ setLeftInputVal(val);
71
+ setSpace('h', val);
72
72
  };
73
73
 
74
- var rightInputChange = function rightInputChange(v) {
75
- setRightInputVal(v);
76
- setSpace('v', v);
74
+ var rightInputChange = function rightInputChange(val) {
75
+ setRightInputVal(val);
76
+ setSpace('v', val);
77
+ };
78
+
79
+ var parseValue = function parseValue(v) {
80
+ return v * 1 > 0 ? Math.round(v) : '';
77
81
  };
78
82
 
79
83
  (0, _react.useEffect)(function () {
@@ -91,8 +95,8 @@ function NodeAlignWidget(props) {
91
95
  if (nodes.length === 2) {
92
96
  var h = topo.view.topoClient.htTopoClient.getElementsSpace(nodes, 'h')[0];
93
97
  var v = topo.view.topoClient.htTopoClient.getElementsSpace(nodes, 'v')[0];
94
- setLeftInputVal(Math.round(h * 1 > 0 ? h : 0));
95
- setRightInputVal(Math.round(v * 1 > 0 ? v : 0));
98
+ setLeftInputVal(parseValue(h));
99
+ setRightInputVal(parseValue(v));
96
100
  }
97
101
  } // eslint-disable-next-line react-hooks/exhaustive-deps
98
102
 
@@ -123,7 +127,7 @@ function NodeAlignWidget(props) {
123
127
  disabled: disabled,
124
128
  size: "small",
125
129
  hasTrigger: false,
126
- placeholder: "\u591A\u4E2A\u503C",
130
+ placeholder: distributionDisabled ? '' : '多个值',
127
131
  className: _NodeAlignWidgetModule["default"].leftInput,
128
132
  value: leftInputVal,
129
133
  min: 0,
@@ -132,8 +136,9 @@ function NodeAlignWidget(props) {
132
136
  }), /*#__PURE__*/_react["default"].createElement(_numberPicker["default"], {
133
137
  disabled: disabled,
134
138
  size: "small",
135
- hasTrigger: false,
136
- placeholder: "\u591A\u4E2A\u503C",
139
+ hasTrigger: false // eslint-disable-next-line no-nested-ternary
140
+ ,
141
+ placeholder: distributionDisabled ? '' : '多个值',
137
142
  className: _NodeAlignWidgetModule["default"].rightInput,
138
143
  value: rightInputVal,
139
144
  min: 0,
@@ -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.52" === 'string' ? "6.0.0-alpha.52" : null;
55
+ var version = typeof "6.0.0-alpha.53" === 'string' ? "6.0.0-alpha.53" : 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.52",
3
+ "version": "6.0.0-alpha.53",
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.52/build/index.html",
119
+ "homepage": "https://unpkg.com/@riil-frontend/component-topology@6.0.0-alpha.53/build/index.html",
120
120
  "gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
121
121
  }