@riil-frontend/component-topology 6.0.3 → 6.0.4
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/FontStyleButton.js +19 -6
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/GlobalTagStyleSetting.js +4 -1
- package/es/core/models/TopoApp.js +1 -1
- package/lib/core/editor/components/Toolbar/widgets/FontStyleButton.js +19 -6
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/GlobalTagStyleSetting.js +4 -1
- package/lib/core/models/TopoApp.js +1 -1
- package/package.json +2 -2
@@ -23,13 +23,22 @@ function buildValue(obj) {
|
|
23
23
|
});
|
24
24
|
}
|
25
25
|
|
26
|
+
var fields = ['bold', 'italic', 'underline'];
|
27
|
+
|
28
|
+
function getDisabled(fieldDisabled) {
|
29
|
+
return !fields.filter(function (field) {
|
30
|
+
return !fieldDisabled[field];
|
31
|
+
}).length;
|
32
|
+
}
|
33
|
+
|
26
34
|
function FontStyleButton(props) {
|
27
35
|
var topo = props.topo,
|
28
36
|
showLabel = props.showLabel,
|
29
37
|
style = props.style,
|
30
|
-
setStyle = props.setStyle
|
38
|
+
setStyle = props.setStyle,
|
39
|
+
fieldDisabled = props.fieldDisabled;
|
31
40
|
|
32
|
-
var _useState = useState(
|
41
|
+
var _useState = useState(getDisabled(fieldDisabled)),
|
33
42
|
disabled = _useState[0],
|
34
43
|
setDisabled = _useState[1];
|
35
44
|
|
@@ -60,6 +69,9 @@ function FontStyleButton(props) {
|
|
60
69
|
underline: underline
|
61
70
|
}));
|
62
71
|
}, [bold, italic, underline]);
|
72
|
+
useEffect(function () {
|
73
|
+
setDisabled(getDisabled(fieldDisabled));
|
74
|
+
}, [fieldDisabled]);
|
63
75
|
/**
|
64
76
|
*
|
65
77
|
* @param {Array} selectedKeys
|
@@ -93,17 +105,18 @@ function FontStyleButton(props) {
|
|
93
105
|
onSelect: handleSelect
|
94
106
|
}, items.map(function (item) {
|
95
107
|
return /*#__PURE__*/React.createElement(DropdownMenu.Item, {
|
96
|
-
key: item.key
|
108
|
+
key: item.key,
|
109
|
+
disabled: fieldDisabled[item.key]
|
97
110
|
}, /*#__PURE__*/React.createElement("div", {
|
98
111
|
style: {
|
99
112
|
display: 'flex',
|
100
113
|
alignItems: 'center'
|
101
114
|
}
|
102
115
|
}, /*#__PURE__*/React.createElement("img", {
|
103
|
-
src: "/img/topo/editor/toolbar/" + item.icon + "/Normal.svg",
|
116
|
+
src: "/img/topo/editor/toolbar/" + item.icon + "/" + (fieldDisabled[item.key] ? 'Disable' : 'Normal') + ".svg",
|
104
117
|
alt: ""
|
105
118
|
}), /*#__PURE__*/React.createElement("span", {
|
106
|
-
style: {
|
119
|
+
style: fieldDisabled[item.key] ? {} : {
|
107
120
|
color: '#4d6277'
|
108
121
|
}
|
109
122
|
}, item.label)));
|
@@ -111,5 +124,5 @@ function FontStyleButton(props) {
|
|
111
124
|
}
|
112
125
|
|
113
126
|
export default textStyleSettingRouter(FontStyleButton, {
|
114
|
-
names:
|
127
|
+
names: fields
|
115
128
|
});
|
@@ -4,7 +4,10 @@ var _excluded = ["Component"];
|
|
4
4
|
import React, { useMemo } from 'react';
|
5
5
|
import { setGlobalTagStyle, useValues } from "./globalTag";
|
6
6
|
var fieldDisabled = {
|
7
|
-
fontSize: true
|
7
|
+
fontSize: true,
|
8
|
+
bold: true,
|
9
|
+
italic: true,
|
10
|
+
underline: true
|
8
11
|
};
|
9
12
|
|
10
13
|
function GlobalTagStyleSetting(props) {
|
@@ -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 "6.0.
|
26
|
+
var version = typeof "6.0.4" === 'string' ? "6.0.4" : null;
|
27
27
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
28
28
|
/**
|
29
29
|
* 拓扑显示和编辑
|
@@ -39,13 +39,22 @@ function buildValue(obj) {
|
|
39
39
|
});
|
40
40
|
}
|
41
41
|
|
42
|
+
var fields = ['bold', 'italic', 'underline'];
|
43
|
+
|
44
|
+
function getDisabled(fieldDisabled) {
|
45
|
+
return !fields.filter(function (field) {
|
46
|
+
return !fieldDisabled[field];
|
47
|
+
}).length;
|
48
|
+
}
|
49
|
+
|
42
50
|
function FontStyleButton(props) {
|
43
51
|
var topo = props.topo,
|
44
52
|
showLabel = props.showLabel,
|
45
53
|
style = props.style,
|
46
|
-
setStyle = props.setStyle
|
54
|
+
setStyle = props.setStyle,
|
55
|
+
fieldDisabled = props.fieldDisabled;
|
47
56
|
|
48
|
-
var _useState = (0, _react.useState)(
|
57
|
+
var _useState = (0, _react.useState)(getDisabled(fieldDisabled)),
|
49
58
|
disabled = _useState[0],
|
50
59
|
setDisabled = _useState[1];
|
51
60
|
|
@@ -76,6 +85,9 @@ function FontStyleButton(props) {
|
|
76
85
|
underline: underline
|
77
86
|
}));
|
78
87
|
}, [bold, italic, underline]);
|
88
|
+
(0, _react.useEffect)(function () {
|
89
|
+
setDisabled(getDisabled(fieldDisabled));
|
90
|
+
}, [fieldDisabled]);
|
79
91
|
/**
|
80
92
|
*
|
81
93
|
* @param {Array} selectedKeys
|
@@ -109,17 +121,18 @@ function FontStyleButton(props) {
|
|
109
121
|
onSelect: handleSelect
|
110
122
|
}, items.map(function (item) {
|
111
123
|
return /*#__PURE__*/_react["default"].createElement(_DropdownMenu["default"].Item, {
|
112
|
-
key: item.key
|
124
|
+
key: item.key,
|
125
|
+
disabled: fieldDisabled[item.key]
|
113
126
|
}, /*#__PURE__*/_react["default"].createElement("div", {
|
114
127
|
style: {
|
115
128
|
display: 'flex',
|
116
129
|
alignItems: 'center'
|
117
130
|
}
|
118
131
|
}, /*#__PURE__*/_react["default"].createElement("img", {
|
119
|
-
src: "/img/topo/editor/toolbar/" + item.icon + "/Normal.svg",
|
132
|
+
src: "/img/topo/editor/toolbar/" + item.icon + "/" + (fieldDisabled[item.key] ? 'Disable' : 'Normal') + ".svg",
|
120
133
|
alt: ""
|
121
134
|
}), /*#__PURE__*/_react["default"].createElement("span", {
|
122
|
-
style: {
|
135
|
+
style: fieldDisabled[item.key] ? {} : {
|
123
136
|
color: '#4d6277'
|
124
137
|
}
|
125
138
|
}, item.label)));
|
@@ -127,7 +140,7 @@ function FontStyleButton(props) {
|
|
127
140
|
}
|
128
141
|
|
129
142
|
var _default = (0, _textStyleSettingRouter["default"])(FontStyleButton, {
|
130
|
-
names:
|
143
|
+
names: fields
|
131
144
|
});
|
132
145
|
|
133
146
|
exports["default"] = _default;
|
@@ -20,7 +20,10 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
20
20
|
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; }
|
21
21
|
|
22
22
|
var fieldDisabled = {
|
23
|
-
fontSize: true
|
23
|
+
fontSize: true,
|
24
|
+
bold: true,
|
25
|
+
italic: true,
|
26
|
+
underline: true
|
24
27
|
};
|
25
28
|
|
26
29
|
function GlobalTagStyleSetting(props) {
|
@@ -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 "6.0.
|
57
|
+
var version = typeof "6.0.4" === 'string' ? "6.0.4" : 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": "6.0.
|
3
|
+
"version": "6.0.4",
|
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.
|
119
|
+
"homepage": "https://unpkg.com/@riil-frontend/component-topology@6.0.4/build/index.html",
|
120
120
|
"gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
|
121
121
|
}
|