@riil-frontend/component-topology 7.0.0-dev.25 → 7.0.0-dev.27
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/FontColorButton.js +11 -3
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/groupTitle.js +7 -1
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/nodeTag.js +15 -5
- package/es/core/models/TopoApp.js +1 -1
- package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +11 -3
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/groupTitle.js +8 -1
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/nodeTag.js +15 -6
- package/lib/core/models/TopoApp.js +1 -1
- package/package.json +2 -2
@@ -16,12 +16,18 @@ function FontColorDropdown(props) {
|
|
16
16
|
topo = props.topo,
|
17
17
|
opacity = props.opacity,
|
18
18
|
background = props.background,
|
19
|
-
setStyle = props.setStyle
|
19
|
+
setStyle = props.setStyle,
|
20
|
+
_props$fieldDisabled = props.fieldDisabled,
|
21
|
+
fieldDisabled = _props$fieldDisabled === void 0 ? {} : _props$fieldDisabled;
|
20
22
|
|
21
23
|
var _useState = useState(false),
|
22
24
|
disabled = _useState[0],
|
23
25
|
setDisabled = _useState[1];
|
24
26
|
|
27
|
+
var backgroundEnabled = fieldDisabled.background !== true;
|
28
|
+
var opacityEnabled = fieldDisabled.opacity !== true;
|
29
|
+
console.error(backgroundEnabled, opacityEnabled, fieldDisabled);
|
30
|
+
|
25
31
|
var backOpacityChange = function backOpacityChange(value) {
|
26
32
|
topo.historyManager.beginTransaction();
|
27
33
|
onChange({
|
@@ -140,7 +146,7 @@ function FontColorDropdown(props) {
|
|
140
146
|
onChange: colorChang,
|
141
147
|
onPickerFocus: onFocus,
|
142
148
|
onPickerBlur: onBlur
|
143
|
-
}))), /*#__PURE__*/React.createElement("div", {
|
149
|
+
}))), (backgroundEnabled || opacityEnabled) && /*#__PURE__*/React.createElement("div", {
|
144
150
|
className: styles.backgroundColor
|
145
151
|
}, /*#__PURE__*/React.createElement("span", null, "\u80CC\u666F\u586B\u5145"), /*#__PURE__*/React.createElement("div", {
|
146
152
|
className: styles.backOpacity
|
@@ -173,7 +179,8 @@ function FontColorButton(props) {
|
|
173
179
|
var showLabel = props.showLabel,
|
174
180
|
topo = props.topo,
|
175
181
|
style = props.style,
|
176
|
-
setStyle = props.setStyle
|
182
|
+
setStyle = props.setStyle,
|
183
|
+
fieldDisabled = props.fieldDisabled;
|
177
184
|
return /*#__PURE__*/React.createElement(WidgetBox, {
|
178
185
|
label: "\u6587\u5B57\u989C\u8272",
|
179
186
|
tooltip: "\u6587\u5B57\u989C\u8272",
|
@@ -182,6 +189,7 @@ function FontColorButton(props) {
|
|
182
189
|
color: style.color,
|
183
190
|
background: style.background,
|
184
191
|
opacity: style.opacity,
|
192
|
+
fieldDisabled: fieldDisabled,
|
185
193
|
setStyle: setStyle,
|
186
194
|
onChange: function onChange(val) {
|
187
195
|
setStyle(val);
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
2
|
+
import { isClusterHtElement } from "../../../../../../../../../utils/clusterUtil";
|
2
3
|
import fontStyleUtil from "../../../../../../settings/common/text/fontStyleUtil";
|
3
4
|
import { formatBackgroundRgbaColor, parseBackground, parseColor } from "../colorUtil";
|
4
5
|
import nodeTag from "./nodeTag";
|
@@ -43,7 +44,12 @@ export function setTextStyle(element, style, topo) {
|
|
43
44
|
}
|
44
45
|
export function getEnabledFields(element) {
|
45
46
|
if (!element.isExpanded()) {
|
46
|
-
return ['fontFamily', 'fontSize', 'color', 'background', 'opacity'];
|
47
|
+
return ['fontFamily', 'fontSize', 'bold', 'italic', 'underline', 'color', 'background', 'opacity'];
|
48
|
+
} // 集群禁用背景颜色设置
|
49
|
+
|
50
|
+
|
51
|
+
if (isClusterHtElement(element)) {
|
52
|
+
return ['fontFamily', 'fontSize', 'bold', 'italic', 'color'];
|
47
53
|
}
|
48
54
|
|
49
55
|
return ['fontFamily', 'fontSize', 'bold', 'italic', 'color', 'background', 'opacity'];
|
@@ -1,14 +1,24 @@
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
3
3
|
var _excluded = ["color", "background", "opacity", "bold", "italic", "underline"];
|
4
|
-
import fontStyleUtil from "../../../../../../settings/common/text/fontStyleUtil";
|
5
4
|
import { formatBackgroundRgbaColor, parseBackground, parseColor } from "../colorUtil";
|
6
5
|
export function getTextStyle(element) {
|
7
|
-
var
|
6
|
+
var opacity = element.a('node.tag.opacity');
|
7
|
+
|
8
|
+
if (opacity === null || opacity === undefined) {
|
9
|
+
opacity = 1;
|
10
|
+
}
|
11
|
+
|
8
12
|
return _extends({
|
9
|
-
color: parseColor(element.a('
|
10
|
-
|
11
|
-
|
13
|
+
color: parseColor(element.a('node.tag.color')),
|
14
|
+
fontFamily: element.a('node.tag.fontFamily') || '微软雅黑',
|
15
|
+
fontSize: element.a('node.tag.fontSize'),
|
16
|
+
bold: !!element.a('node.tag.fontBold'),
|
17
|
+
italic: !!element.a('node.tag.fontItalic'),
|
18
|
+
underline: !!element.a('node.tag.fontUnderline')
|
19
|
+
}, parseBackground(element.a('node.tag.background')), {
|
20
|
+
opacity: opacity
|
21
|
+
});
|
12
22
|
}
|
13
23
|
export function setTextStyle(element, style, topo) {
|
14
24
|
var color = style.color,
|
@@ -23,7 +23,7 @@ import topoFactory from "./topoFactory";
|
|
23
23
|
import ElementTagTipConfig from "./tagstips/ElementTagTipConfig";
|
24
24
|
import SelectionModel from "./SelectionModel"; // eslint-disable-next-line no-undef
|
25
25
|
|
26
|
-
var version = typeof "7.0.0-dev.
|
26
|
+
var version = typeof "7.0.0-dev.27" === 'string' ? "7.0.0-dev.27" : null;
|
27
27
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
28
28
|
/**
|
29
29
|
* 拓扑显示和编辑
|
@@ -34,12 +34,18 @@ function FontColorDropdown(props) {
|
|
34
34
|
topo = props.topo,
|
35
35
|
opacity = props.opacity,
|
36
36
|
background = props.background,
|
37
|
-
setStyle = props.setStyle
|
37
|
+
setStyle = props.setStyle,
|
38
|
+
_props$fieldDisabled = props.fieldDisabled,
|
39
|
+
fieldDisabled = _props$fieldDisabled === void 0 ? {} : _props$fieldDisabled;
|
38
40
|
|
39
41
|
var _useState = (0, _react.useState)(false),
|
40
42
|
disabled = _useState[0],
|
41
43
|
setDisabled = _useState[1];
|
42
44
|
|
45
|
+
var backgroundEnabled = fieldDisabled.background !== true;
|
46
|
+
var opacityEnabled = fieldDisabled.opacity !== true;
|
47
|
+
console.error(backgroundEnabled, opacityEnabled, fieldDisabled);
|
48
|
+
|
43
49
|
var backOpacityChange = function backOpacityChange(value) {
|
44
50
|
topo.historyManager.beginTransaction();
|
45
51
|
onChange({
|
@@ -158,7 +164,7 @@ function FontColorDropdown(props) {
|
|
158
164
|
onChange: colorChang,
|
159
165
|
onPickerFocus: onFocus,
|
160
166
|
onPickerBlur: onBlur
|
161
|
-
}))), /*#__PURE__*/_react["default"].createElement("div", {
|
167
|
+
}))), (backgroundEnabled || opacityEnabled) && /*#__PURE__*/_react["default"].createElement("div", {
|
162
168
|
className: _FontColorButtonModule["default"].backgroundColor
|
163
169
|
}, /*#__PURE__*/_react["default"].createElement("span", null, "\u80CC\u666F\u586B\u5145"), /*#__PURE__*/_react["default"].createElement("div", {
|
164
170
|
className: _FontColorButtonModule["default"].backOpacity
|
@@ -191,7 +197,8 @@ function FontColorButton(props) {
|
|
191
197
|
var showLabel = props.showLabel,
|
192
198
|
topo = props.topo,
|
193
199
|
style = props.style,
|
194
|
-
setStyle = props.setStyle
|
200
|
+
setStyle = props.setStyle,
|
201
|
+
fieldDisabled = props.fieldDisabled;
|
195
202
|
return /*#__PURE__*/_react["default"].createElement(_WidgetBox["default"], {
|
196
203
|
label: "\u6587\u5B57\u989C\u8272",
|
197
204
|
tooltip: "\u6587\u5B57\u989C\u8272",
|
@@ -200,6 +207,7 @@ function FontColorButton(props) {
|
|
200
207
|
color: style.color,
|
201
208
|
background: style.background,
|
202
209
|
opacity: style.opacity,
|
210
|
+
fieldDisabled: fieldDisabled,
|
203
211
|
setStyle: setStyle,
|
204
212
|
onChange: function onChange(val) {
|
205
213
|
setStyle(val);
|
@@ -11,6 +11,8 @@ exports.setTextStyle = setTextStyle;
|
|
11
11
|
|
12
12
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
13
13
|
|
14
|
+
var _clusterUtil = require("../../../../../../../../../utils/clusterUtil");
|
15
|
+
|
14
16
|
var _fontStyleUtil = _interopRequireDefault(require("../../../../../../settings/common/text/fontStyleUtil"));
|
15
17
|
|
16
18
|
var _colorUtil = require("../colorUtil");
|
@@ -63,7 +65,12 @@ function setTextStyle(element, style, topo) {
|
|
63
65
|
|
64
66
|
function getEnabledFields(element) {
|
65
67
|
if (!element.isExpanded()) {
|
66
|
-
return ['fontFamily', 'fontSize', 'color', 'background', 'opacity'];
|
68
|
+
return ['fontFamily', 'fontSize', 'bold', 'italic', 'underline', 'color', 'background', 'opacity'];
|
69
|
+
} // 集群禁用背景颜色设置
|
70
|
+
|
71
|
+
|
72
|
+
if ((0, _clusterUtil.isClusterHtElement)(element)) {
|
73
|
+
return ['fontFamily', 'fontSize', 'bold', 'italic', 'color'];
|
67
74
|
}
|
68
75
|
|
69
76
|
return ['fontFamily', 'fontSize', 'bold', 'italic', 'color', 'background', 'opacity'];
|
@@ -13,18 +13,27 @@ var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runt
|
|
13
13
|
|
14
14
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
15
15
|
|
16
|
-
var _fontStyleUtil = _interopRequireDefault(require("../../../../../../settings/common/text/fontStyleUtil"));
|
17
|
-
|
18
16
|
var _colorUtil = require("../colorUtil");
|
19
17
|
|
20
18
|
var _excluded = ["color", "background", "opacity", "bold", "italic", "underline"];
|
21
19
|
|
22
20
|
function getTextStyle(element) {
|
23
|
-
var
|
21
|
+
var opacity = element.a('node.tag.opacity');
|
22
|
+
|
23
|
+
if (opacity === null || opacity === undefined) {
|
24
|
+
opacity = 1;
|
25
|
+
}
|
26
|
+
|
24
27
|
return (0, _extends2["default"])({
|
25
|
-
color: (0, _colorUtil.parseColor)(element.a('
|
26
|
-
|
27
|
-
|
28
|
+
color: (0, _colorUtil.parseColor)(element.a('node.tag.color')),
|
29
|
+
fontFamily: element.a('node.tag.fontFamily') || '微软雅黑',
|
30
|
+
fontSize: element.a('node.tag.fontSize'),
|
31
|
+
bold: !!element.a('node.tag.fontBold'),
|
32
|
+
italic: !!element.a('node.tag.fontItalic'),
|
33
|
+
underline: !!element.a('node.tag.fontUnderline')
|
34
|
+
}, (0, _colorUtil.parseBackground)(element.a('node.tag.background')), {
|
35
|
+
opacity: opacity
|
36
|
+
});
|
28
37
|
}
|
29
38
|
|
30
39
|
function setTextStyle(element, style, topo) {
|
@@ -54,7 +54,7 @@ var _ElementTagTipConfig = _interopRequireDefault(require("./tagstips/ElementTag
|
|
54
54
|
var _SelectionModel = _interopRequireDefault(require("./SelectionModel"));
|
55
55
|
|
56
56
|
// eslint-disable-next-line no-undef
|
57
|
-
var version = typeof "7.0.0-dev.
|
57
|
+
var version = typeof "7.0.0-dev.27" === 'string' ? "7.0.0-dev.27" : null;
|
58
58
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
59
59
|
/**
|
60
60
|
* 拓扑显示和编辑
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@riil-frontend/component-topology",
|
3
|
-
"version": "7.0.0-dev.
|
3
|
+
"version": "7.0.0-dev.27",
|
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@7.0.0-dev.
|
119
|
+
"homepage": "https://unpkg.com/@riil-frontend/component-topology@7.0.0-dev.27/build/index.html",
|
120
120
|
"gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
|
121
121
|
}
|