@riil-frontend/component-topology 12.1.0-dev.4 → 12.1.0-dev.6
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 +2 -2
- package/es/core/editor/components/Toolbar/widgets/FontFamilyWidget.js +2 -27
- package/es/core/editor/components/Toolbar/widgets/FontSizeWidget.js +3 -28
- package/es/core/editor/components/Toolbar/widgets/FontStyleButton.js +6 -52
- package/es/core/editor/components/Toolbar/widgets/components/FontFamilySelect.js +29 -0
- package/es/core/editor/components/Toolbar/widgets/components/FontSizeSelect.js +29 -0
- package/es/core/editor/components/Toolbar/widgets/components/FontStyleSelect.js +71 -0
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/viewer/components/plugins/ElementDetailDrawer/hooks/useElementDetailManager.js +2 -1
- package/es/networkTopo/models/EdgeGroupTagTipBuilder.js +7 -7
- package/es/networkTopo/utils/edgeGroupTagUtil.js +2 -2
- package/es/utils/htElementUtils.js +14 -2
- package/lib/core/editor/components/Toolbar/widgets/FontFamilyWidget.js +3 -28
- package/lib/core/editor/components/Toolbar/widgets/FontSizeWidget.js +3 -28
- package/lib/core/editor/components/Toolbar/widgets/FontStyleButton.js +6 -56
- package/lib/core/editor/components/Toolbar/widgets/components/FontFamilySelect.js +38 -0
- package/lib/core/editor/components/Toolbar/widgets/components/FontSizeSelect.js +38 -0
- package/lib/core/editor/components/Toolbar/widgets/components/FontStyleSelect.js +83 -0
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/viewer/components/plugins/ElementDetailDrawer/hooks/useElementDetailManager.js +3 -1
- package/lib/networkTopo/models/EdgeGroupTagTipBuilder.js +6 -6
- package/lib/networkTopo/utils/edgeGroupTagUtil.js +2 -2
- package/lib/utils/htElementUtils.js +14 -2
- package/package.json +2 -2
@@ -1,33 +1,8 @@
|
|
1
1
|
import React, { useState, useEffect } from 'react';
|
2
|
-
import
|
3
|
-
import textStyleSettingRouter from "./components/textStyleSetting/textStyleSettingRouter
|
2
|
+
import FontFamilySelect from "./components/FontFamilySelect";
|
3
|
+
import textStyleSettingRouter from "./components/textStyleSetting/textStyleSettingRouter";
|
4
4
|
import WidgetBox from "./WidgetBox";
|
5
5
|
|
6
|
-
function FontFamilySelect(props) {
|
7
|
-
var value = props.value,
|
8
|
-
onChange = props.onChange;
|
9
|
-
var items = ['宋体', '微软雅黑', '黑体', 'Arial'];
|
10
|
-
return /*#__PURE__*/React.createElement(DropdownMenu, {
|
11
|
-
value: (items.includes(value) ? value : null) || '',
|
12
|
-
valueRender: function valueRender(val) {
|
13
|
-
return /*#__PURE__*/React.createElement("div", {
|
14
|
-
style: {
|
15
|
-
width: 48
|
16
|
-
}
|
17
|
-
}, val || '微软雅黑');
|
18
|
-
},
|
19
|
-
onSelect: onChange
|
20
|
-
}, items.map(function (item) {
|
21
|
-
return /*#__PURE__*/React.createElement(DropdownMenu.Item, {
|
22
|
-
key: item
|
23
|
-
}, /*#__PURE__*/React.createElement("div", {
|
24
|
-
style: {
|
25
|
-
fontFamily: item
|
26
|
-
}
|
27
|
-
}, item));
|
28
|
-
}));
|
29
|
-
}
|
30
|
-
|
31
6
|
function FontFamilyWidget(props) {
|
32
7
|
var topo = props.topo,
|
33
8
|
showLabel = props.showLabel,
|
@@ -1,33 +1,8 @@
|
|
1
|
-
import React, { useEffect
|
2
|
-
import
|
3
|
-
import textStyleSettingRouter from "./components/textStyleSetting/textStyleSettingRouter
|
1
|
+
import React, { useEffect } from 'react';
|
2
|
+
import FontSizeSelect from "./components/FontSizeSelect";
|
3
|
+
import textStyleSettingRouter from "./components/textStyleSetting/textStyleSettingRouter";
|
4
4
|
import WidgetBox from "./WidgetBox";
|
5
5
|
|
6
|
-
function FontSizeSelect(props) {
|
7
|
-
var value = props.value,
|
8
|
-
disabled = props.disabled,
|
9
|
-
onChange = props.onChange;
|
10
|
-
var items = [12, 14, 16, 18, 20, 24, 30, 36, 48, 60, 80];
|
11
|
-
return /*#__PURE__*/React.createElement(DropdownMenu, {
|
12
|
-
value: "" + (value || ''),
|
13
|
-
valueRender: function valueRender(val) {
|
14
|
-
return /*#__PURE__*/React.createElement("div", {
|
15
|
-
style: {
|
16
|
-
width: 18
|
17
|
-
}
|
18
|
-
}, val || 20);
|
19
|
-
},
|
20
|
-
disabled: disabled,
|
21
|
-
onSelect: function onSelect(val) {
|
22
|
-
return onChange(parseInt(val, 10));
|
23
|
-
}
|
24
|
-
}, items.map(function (item) {
|
25
|
-
return /*#__PURE__*/React.createElement(DropdownMenu.Item, {
|
26
|
-
key: item
|
27
|
-
}, item);
|
28
|
-
}));
|
29
|
-
}
|
30
|
-
|
31
6
|
function FontSizeWidget(props) {
|
32
7
|
var topo = props.topo,
|
33
8
|
showLabel = props.showLabel,
|
@@ -1,26 +1,7 @@
|
|
1
1
|
import React, { useState, useEffect } from 'react';
|
2
|
-
import
|
3
|
-
import
|
4
|
-
import DropdownMenu from "./components/DropdownMenu";
|
5
|
-
import textStyleSettingRouter from "./components/textStyleSetting/textStyleSettingRouter.js";
|
2
|
+
import FontStyleSelect from "./components/FontStyleSelect";
|
3
|
+
import textStyleSettingRouter from "./components/textStyleSetting/textStyleSettingRouter";
|
6
4
|
import WidgetBox from "./WidgetBox";
|
7
|
-
import Tooltip from "../components/Tooltip";
|
8
|
-
var items = [{
|
9
|
-
key: 'bold',
|
10
|
-
label: '加粗',
|
11
|
-
icon: 'bold',
|
12
|
-
tooltip: '加粗'
|
13
|
-
}, {
|
14
|
-
key: 'italic',
|
15
|
-
label: '斜体',
|
16
|
-
icon: 'Italics',
|
17
|
-
tooltip: '斜体'
|
18
|
-
}, {
|
19
|
-
key: 'underline',
|
20
|
-
label: '下划线',
|
21
|
-
icon: 'Underline',
|
22
|
-
tooltip: '下划线'
|
23
|
-
}];
|
24
5
|
|
25
6
|
function buildValue(obj) {
|
26
7
|
return Object.keys(obj).filter(function (key) {
|
@@ -89,39 +70,12 @@ function FontStyleButton(props) {
|
|
89
70
|
tooltip: "\u6587\u5B57\u6837\u5F0F\uFF08\u52A0\u7C97\u3001\u659C\u4F53\u3001\u4E0B\u5212\u7EBF\uFF09",
|
90
71
|
disabled: disabled,
|
91
72
|
showLabel: showLabel
|
92
|
-
}, /*#__PURE__*/React.createElement(
|
73
|
+
}, /*#__PURE__*/React.createElement(FontStyleSelect, {
|
93
74
|
value: value,
|
94
|
-
valueRender: function valueRender() {
|
95
|
-
return /*#__PURE__*/React.createElement("img", {
|
96
|
-
src: "/img/topo/editor/toolbar/bold/" + (disabled ? 'Disable' : 'Normal') + ".svg",
|
97
|
-
alt: ""
|
98
|
-
});
|
99
|
-
},
|
100
|
-
multiple: true,
|
101
75
|
disabled: disabled,
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
key: item.key,
|
106
|
-
disabled: fieldDisabled[item.key]
|
107
|
-
}, /*#__PURE__*/React.createElement(Tooltip, {
|
108
|
-
trigger: /*#__PURE__*/React.createElement("div", {
|
109
|
-
style: {
|
110
|
-
display: 'flex',
|
111
|
-
alignItems: 'center'
|
112
|
-
}
|
113
|
-
}, /*#__PURE__*/React.createElement("img", {
|
114
|
-
src: "/img/topo/editor/toolbar/" + item.icon + "/" + (fieldDisabled[item.key] ? 'Disable' : 'Normal') + ".svg",
|
115
|
-
alt: ""
|
116
|
-
}), /*#__PURE__*/React.createElement("span", {
|
117
|
-
style: fieldDisabled[item.key] ? {} : {
|
118
|
-
color: variables['$color-text1-4']
|
119
|
-
}
|
120
|
-
}, item.label)),
|
121
|
-
align: "r",
|
122
|
-
popupStyle: {}
|
123
|
-
}, item.tooltip));
|
124
|
-
})));
|
76
|
+
fieldDisabled: fieldDisabled,
|
77
|
+
onChange: handleSelect
|
78
|
+
}));
|
125
79
|
}
|
126
80
|
|
127
81
|
export default textStyleSettingRouter(FontStyleButton, {
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import DropdownMenu from "./DropdownMenu";
|
3
|
+
|
4
|
+
function FontFamilySelect(props) {
|
5
|
+
var value = props.value,
|
6
|
+
onChange = props.onChange;
|
7
|
+
var items = ['宋体', '微软雅黑', '黑体', 'Arial'];
|
8
|
+
return /*#__PURE__*/React.createElement(DropdownMenu, {
|
9
|
+
value: (items.includes(value) ? value : null) || '',
|
10
|
+
valueRender: function valueRender(val) {
|
11
|
+
return /*#__PURE__*/React.createElement("div", {
|
12
|
+
style: {
|
13
|
+
width: 48
|
14
|
+
}
|
15
|
+
}, val || '微软雅黑');
|
16
|
+
},
|
17
|
+
onSelect: onChange
|
18
|
+
}, items.map(function (item) {
|
19
|
+
return /*#__PURE__*/React.createElement(DropdownMenu.Item, {
|
20
|
+
key: item
|
21
|
+
}, /*#__PURE__*/React.createElement("div", {
|
22
|
+
style: {
|
23
|
+
fontFamily: item
|
24
|
+
}
|
25
|
+
}, item));
|
26
|
+
}));
|
27
|
+
}
|
28
|
+
|
29
|
+
export default FontFamilySelect;
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import DropdownMenu from "./DropdownMenu";
|
3
|
+
|
4
|
+
function FontSizeSelect(props) {
|
5
|
+
var value = props.value,
|
6
|
+
disabled = props.disabled,
|
7
|
+
onChange = props.onChange;
|
8
|
+
var items = [12, 14, 16, 18, 20, 24, 30, 36, 48, 60, 80];
|
9
|
+
return /*#__PURE__*/React.createElement(DropdownMenu, {
|
10
|
+
value: "" + (value || ''),
|
11
|
+
valueRender: function valueRender(val) {
|
12
|
+
return /*#__PURE__*/React.createElement("div", {
|
13
|
+
style: {
|
14
|
+
width: 18
|
15
|
+
}
|
16
|
+
}, val || 20);
|
17
|
+
},
|
18
|
+
disabled: disabled,
|
19
|
+
onSelect: function onSelect(val) {
|
20
|
+
return onChange(parseInt(val, 10));
|
21
|
+
}
|
22
|
+
}, items.map(function (item) {
|
23
|
+
return /*#__PURE__*/React.createElement(DropdownMenu.Item, {
|
24
|
+
key: item
|
25
|
+
}, item);
|
26
|
+
}));
|
27
|
+
}
|
28
|
+
|
29
|
+
export default FontSizeSelect;
|
@@ -0,0 +1,71 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import variables from '@alifd/theme-19926/variables.js';
|
3
|
+
import DropdownMenu from "./DropdownMenu";
|
4
|
+
import Tooltip from "../../components/Tooltip";
|
5
|
+
var items = [{
|
6
|
+
key: 'bold',
|
7
|
+
label: '加粗',
|
8
|
+
icon: 'bold',
|
9
|
+
tooltip: '加粗'
|
10
|
+
}, {
|
11
|
+
key: 'italic',
|
12
|
+
label: '斜体',
|
13
|
+
icon: 'Italics',
|
14
|
+
tooltip: '斜体'
|
15
|
+
}, {
|
16
|
+
key: 'underline',
|
17
|
+
label: '下划线',
|
18
|
+
icon: 'Underline',
|
19
|
+
tooltip: '下划线'
|
20
|
+
}];
|
21
|
+
|
22
|
+
function buildValue(obj) {
|
23
|
+
return Object.keys(obj).filter(function (key) {
|
24
|
+
return !!obj[key];
|
25
|
+
});
|
26
|
+
}
|
27
|
+
|
28
|
+
var fields = ['bold', 'italic', 'underline'];
|
29
|
+
|
30
|
+
function FontStyleSelect(props) {
|
31
|
+
var value = props.value,
|
32
|
+
disabled = props.disabled,
|
33
|
+
onChange = props.onChange,
|
34
|
+
_props$fieldDisabled = props.fieldDisabled,
|
35
|
+
fieldDisabled = _props$fieldDisabled === void 0 ? {} : _props$fieldDisabled;
|
36
|
+
return /*#__PURE__*/React.createElement(DropdownMenu, {
|
37
|
+
value: value,
|
38
|
+
valueRender: function valueRender() {
|
39
|
+
return /*#__PURE__*/React.createElement("img", {
|
40
|
+
src: "/img/topo/editor/toolbar/bold/" + (disabled ? 'Disable' : 'Normal') + ".svg",
|
41
|
+
alt: ""
|
42
|
+
});
|
43
|
+
},
|
44
|
+
multiple: true,
|
45
|
+
disabled: disabled,
|
46
|
+
onSelect: onChange
|
47
|
+
}, items.map(function (item) {
|
48
|
+
return /*#__PURE__*/React.createElement(DropdownMenu.Item, {
|
49
|
+
key: item.key,
|
50
|
+
disabled: !!fieldDisabled[item.key]
|
51
|
+
}, /*#__PURE__*/React.createElement(Tooltip, {
|
52
|
+
trigger: /*#__PURE__*/React.createElement("div", {
|
53
|
+
style: {
|
54
|
+
display: 'flex',
|
55
|
+
alignItems: 'center'
|
56
|
+
}
|
57
|
+
}, /*#__PURE__*/React.createElement("img", {
|
58
|
+
src: "/img/topo/editor/toolbar/" + item.icon + "/" + (fieldDisabled[item.key] ? 'Disable' : 'Normal') + ".svg",
|
59
|
+
alt: ""
|
60
|
+
}), /*#__PURE__*/React.createElement("span", {
|
61
|
+
style: fieldDisabled[item.key] ? {} : {
|
62
|
+
color: variables['$color-text1-4']
|
63
|
+
}
|
64
|
+
}, item.label)),
|
65
|
+
align: "r",
|
66
|
+
popupStyle: {}
|
67
|
+
}, item.tooltip));
|
68
|
+
}));
|
69
|
+
}
|
70
|
+
|
71
|
+
export default FontStyleSelect;
|
@@ -24,7 +24,7 @@ import ElementTagTipConfig from "./tagstips/ElementTagTipConfig";
|
|
24
24
|
import SelectionModel from "./SelectionModel";
|
25
25
|
import CiCache from "./cache/CiCache"; // eslint-disable-next-line no-undef
|
26
26
|
|
27
|
-
var version = typeof "12.1.0-dev.
|
27
|
+
var version = typeof "12.1.0-dev.6" === 'string' ? "12.1.0-dev.6" : null;
|
28
28
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
29
29
|
/**
|
30
30
|
* 拓扑显示和编辑
|
package/es/core/viewer/components/plugins/ElementDetailDrawer/hooks/useElementDetailManager.js
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
import React, { useMemo } from 'react';
|
2
2
|
import DefaultDetailContent from "../../ResourceDetail/DefaultDetailContent";
|
3
|
+
import { isEdgeGroupAgent } from "../../../../../../utils/htElementUtils";
|
3
4
|
|
4
5
|
function useElementDetailManager(props) {
|
5
6
|
var topo = props.topo,
|
@@ -62,7 +63,7 @@ function useElementDetailManager(props) {
|
|
62
63
|
}
|
63
64
|
|
64
65
|
function openByHtElement(htElement) {
|
65
|
-
var isEdgeGroupAgent =
|
66
|
+
var isEdgeGroupAgent = isEdgeGroupAgent(htElement);
|
66
67
|
open({
|
67
68
|
id: isEdgeGroupAgent || !htElement.getTag() ? "ht:" + htElement.getId() : htElement.getTag(),
|
68
69
|
htElement: htElement
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { getEdgeGroups } from "../../utils/htElementUtils";
|
1
|
+
import { getEdgeGroupAgents, getEdgeGroups } from "../../utils/htElementUtils";
|
2
2
|
import { getEdgeGroupLinkIdConfig } from "../utils/edgeGroupTagUtil";
|
3
3
|
|
4
4
|
var EdgeGroupTagTipBuilder = /*#__PURE__*/function () {
|
@@ -16,11 +16,11 @@ var EdgeGroupTagTipBuilder = /*#__PURE__*/function () {
|
|
16
16
|
|
17
17
|
var topo = this.topo;
|
18
18
|
var dm = this.topo.getDataModel();
|
19
|
-
var
|
20
|
-
|
21
|
-
|
22
|
-
var linkId = getEdgeGroupLinkIdConfig(
|
23
|
-
var edgeGroupId = [
|
19
|
+
var edgeGroupAgents = getEdgeGroupAgents(dm);
|
20
|
+
var edgeGroupsTagsTips = edgeGroupAgents.map(function (edgeGroupAgent) {
|
21
|
+
// 获取配置的链路
|
22
|
+
var linkId = getEdgeGroupLinkIdConfig(edgeGroupAgent, topo);
|
23
|
+
var edgeGroupId = [edgeGroupAgent.getSource().getId(), edgeGroupAgent.getTarget().getId()];
|
24
24
|
var data = {
|
25
25
|
tags: [],
|
26
26
|
tips: []
|
@@ -31,7 +31,7 @@ var EdgeGroupTagTipBuilder = /*#__PURE__*/function () {
|
|
31
31
|
}
|
32
32
|
|
33
33
|
return {
|
34
|
-
htId:
|
34
|
+
htId: edgeGroupAgent.getId(),
|
35
35
|
edgeGroupId: edgeGroupId,
|
36
36
|
tags: data.tags,
|
37
37
|
tips: data.tips,
|
@@ -55,8 +55,8 @@ export function getEdgeGroupLinkIdConfig(edgeGroup, topo) {
|
|
55
55
|
});
|
56
56
|
}
|
57
57
|
export function getEdgeGroupConfigId(edgeGroup) {
|
58
|
-
var sourceNode = edgeGroup.
|
59
|
-
var targetNode = edgeGroup.
|
58
|
+
var sourceNode = edgeGroup.getSource();
|
59
|
+
var targetNode = edgeGroup.getTarget();
|
60
60
|
var sourceId = sourceNode.a('uuid');
|
61
61
|
var targetId = targetNode.a('uuid');
|
62
62
|
return [sourceId, targetId].sort().join(',');
|
@@ -122,7 +122,7 @@ export function getEdges(dataModel) {
|
|
122
122
|
*/
|
123
123
|
|
124
124
|
export function isEdgeGroup(edge) {
|
125
|
-
return isEdge(edge) && edge.a('edgegroup.isEdgeGroup');
|
125
|
+
return isEdge(edge) && edge.a('x.edgegroup.isEdgeGroup');
|
126
126
|
}
|
127
127
|
/**
|
128
128
|
* 是否连线组代理
|
@@ -131,7 +131,7 @@ export function isEdgeGroup(edge) {
|
|
131
131
|
*/
|
132
132
|
|
133
133
|
export function isEdgeGroupAgent(edge) {
|
134
|
-
return isEdgeGroup(edge)
|
134
|
+
return isEdgeGroup(edge);
|
135
135
|
}
|
136
136
|
/**
|
137
137
|
* TODO
|
@@ -209,6 +209,12 @@ export function getEdgeGroupByNodeTags(dataModel, nodeTag1, nodeTag2) {
|
|
209
209
|
|
210
210
|
return getEdgeGroupByNodes(node1, node2);
|
211
211
|
}
|
212
|
+
/**
|
213
|
+
* 获得连线组连线列表
|
214
|
+
* @param {*} dataModel
|
215
|
+
* @returns
|
216
|
+
*/
|
217
|
+
|
212
218
|
export function getEdgeGroups(dataModel) {
|
213
219
|
var edgeGroups = [];
|
214
220
|
getEdges(dataModel).forEach(function (edge) {
|
@@ -220,6 +226,12 @@ export function getEdgeGroups(dataModel) {
|
|
220
226
|
});
|
221
227
|
return edgeGroups;
|
222
228
|
}
|
229
|
+
/**
|
230
|
+
* 获得连线组连线列表
|
231
|
+
* @param {*} dataModel
|
232
|
+
* @returns
|
233
|
+
*/
|
234
|
+
|
223
235
|
export function getEdgeGroupAgents(dataModel) {
|
224
236
|
return getEdges(dataModel).filter(isEdgeGroupAgent);
|
225
237
|
}
|
@@ -7,9 +7,9 @@ exports["default"] = void 0;
|
|
7
7
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
9
9
|
|
10
|
-
var
|
10
|
+
var _FontFamilySelect = _interopRequireDefault(require("./components/FontFamilySelect"));
|
11
11
|
|
12
|
-
var _textStyleSettingRouter = _interopRequireDefault(require("./components/textStyleSetting/textStyleSettingRouter
|
12
|
+
var _textStyleSettingRouter = _interopRequireDefault(require("./components/textStyleSetting/textStyleSettingRouter"));
|
13
13
|
|
14
14
|
var _WidgetBox = _interopRequireDefault(require("./WidgetBox"));
|
15
15
|
|
@@ -17,31 +17,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
17
17
|
|
18
18
|
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; }
|
19
19
|
|
20
|
-
function FontFamilySelect(props) {
|
21
|
-
var value = props.value,
|
22
|
-
onChange = props.onChange;
|
23
|
-
var items = ['宋体', '微软雅黑', '黑体', 'Arial'];
|
24
|
-
return /*#__PURE__*/_react["default"].createElement(_DropdownMenu["default"], {
|
25
|
-
value: (items.includes(value) ? value : null) || '',
|
26
|
-
valueRender: function valueRender(val) {
|
27
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
28
|
-
style: {
|
29
|
-
width: 48
|
30
|
-
}
|
31
|
-
}, val || '微软雅黑');
|
32
|
-
},
|
33
|
-
onSelect: onChange
|
34
|
-
}, items.map(function (item) {
|
35
|
-
return /*#__PURE__*/_react["default"].createElement(_DropdownMenu["default"].Item, {
|
36
|
-
key: item
|
37
|
-
}, /*#__PURE__*/_react["default"].createElement("div", {
|
38
|
-
style: {
|
39
|
-
fontFamily: item
|
40
|
-
}
|
41
|
-
}, item));
|
42
|
-
}));
|
43
|
-
}
|
44
|
-
|
45
20
|
function FontFamilyWidget(props) {
|
46
21
|
var topo = props.topo,
|
47
22
|
showLabel = props.showLabel,
|
@@ -51,7 +26,7 @@ function FontFamilyWidget(props) {
|
|
51
26
|
label: "\u5B57\u4F53",
|
52
27
|
tooltip: "\u5B57\u4F53",
|
53
28
|
showLabel: showLabel
|
54
|
-
}, /*#__PURE__*/_react["default"].createElement(
|
29
|
+
}, /*#__PURE__*/_react["default"].createElement(_FontFamilySelect["default"], {
|
55
30
|
value: style.fontFamily,
|
56
31
|
onChange: function onChange(val) {
|
57
32
|
topo.historyManager.beginTransaction();
|
@@ -7,9 +7,9 @@ exports["default"] = void 0;
|
|
7
7
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
9
9
|
|
10
|
-
var
|
10
|
+
var _FontSizeSelect = _interopRequireDefault(require("./components/FontSizeSelect"));
|
11
11
|
|
12
|
-
var _textStyleSettingRouter = _interopRequireDefault(require("./components/textStyleSetting/textStyleSettingRouter
|
12
|
+
var _textStyleSettingRouter = _interopRequireDefault(require("./components/textStyleSetting/textStyleSettingRouter"));
|
13
13
|
|
14
14
|
var _WidgetBox = _interopRequireDefault(require("./WidgetBox"));
|
15
15
|
|
@@ -17,31 +17,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
17
17
|
|
18
18
|
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; }
|
19
19
|
|
20
|
-
function FontSizeSelect(props) {
|
21
|
-
var value = props.value,
|
22
|
-
disabled = props.disabled,
|
23
|
-
onChange = props.onChange;
|
24
|
-
var items = [12, 14, 16, 18, 20, 24, 30, 36, 48, 60, 80];
|
25
|
-
return /*#__PURE__*/_react["default"].createElement(_DropdownMenu["default"], {
|
26
|
-
value: "" + (value || ''),
|
27
|
-
valueRender: function valueRender(val) {
|
28
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
29
|
-
style: {
|
30
|
-
width: 18
|
31
|
-
}
|
32
|
-
}, val || 20);
|
33
|
-
},
|
34
|
-
disabled: disabled,
|
35
|
-
onSelect: function onSelect(val) {
|
36
|
-
return onChange(parseInt(val, 10));
|
37
|
-
}
|
38
|
-
}, items.map(function (item) {
|
39
|
-
return /*#__PURE__*/_react["default"].createElement(_DropdownMenu["default"].Item, {
|
40
|
-
key: item
|
41
|
-
}, item);
|
42
|
-
}));
|
43
|
-
}
|
44
|
-
|
45
20
|
function FontSizeWidget(props) {
|
46
21
|
var topo = props.topo,
|
47
22
|
showLabel = props.showLabel,
|
@@ -57,7 +32,7 @@ function FontSizeWidget(props) {
|
|
57
32
|
tooltip: "\u5B57\u53F7",
|
58
33
|
showLabel: showLabel,
|
59
34
|
disabled: disabled
|
60
|
-
}, /*#__PURE__*/_react["default"].createElement(
|
35
|
+
}, /*#__PURE__*/_react["default"].createElement(_FontSizeSelect["default"], {
|
61
36
|
value: style.fontSize,
|
62
37
|
disabled: disabled,
|
63
38
|
onChange: function onChange(val) {
|
@@ -7,39 +7,16 @@ exports["default"] = void 0;
|
|
7
7
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
9
9
|
|
10
|
-
var
|
10
|
+
var _FontStyleSelect = _interopRequireDefault(require("./components/FontStyleSelect"));
|
11
11
|
|
12
|
-
var
|
13
|
-
|
14
|
-
var _DropdownMenu = _interopRequireDefault(require("./components/DropdownMenu"));
|
15
|
-
|
16
|
-
var _textStyleSettingRouter = _interopRequireDefault(require("./components/textStyleSetting/textStyleSettingRouter.js"));
|
12
|
+
var _textStyleSettingRouter = _interopRequireDefault(require("./components/textStyleSetting/textStyleSettingRouter"));
|
17
13
|
|
18
14
|
var _WidgetBox = _interopRequireDefault(require("./WidgetBox"));
|
19
15
|
|
20
|
-
var _Tooltip = _interopRequireDefault(require("../components/Tooltip"));
|
21
|
-
|
22
16
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
23
17
|
|
24
18
|
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; }
|
25
19
|
|
26
|
-
var items = [{
|
27
|
-
key: 'bold',
|
28
|
-
label: '加粗',
|
29
|
-
icon: 'bold',
|
30
|
-
tooltip: '加粗'
|
31
|
-
}, {
|
32
|
-
key: 'italic',
|
33
|
-
label: '斜体',
|
34
|
-
icon: 'Italics',
|
35
|
-
tooltip: '斜体'
|
36
|
-
}, {
|
37
|
-
key: 'underline',
|
38
|
-
label: '下划线',
|
39
|
-
icon: 'Underline',
|
40
|
-
tooltip: '下划线'
|
41
|
-
}];
|
42
|
-
|
43
20
|
function buildValue(obj) {
|
44
21
|
return Object.keys(obj).filter(function (key) {
|
45
22
|
return !!obj[key];
|
@@ -107,39 +84,12 @@ function FontStyleButton(props) {
|
|
107
84
|
tooltip: "\u6587\u5B57\u6837\u5F0F\uFF08\u52A0\u7C97\u3001\u659C\u4F53\u3001\u4E0B\u5212\u7EBF\uFF09",
|
108
85
|
disabled: disabled,
|
109
86
|
showLabel: showLabel
|
110
|
-
}, /*#__PURE__*/_react["default"].createElement(
|
87
|
+
}, /*#__PURE__*/_react["default"].createElement(_FontStyleSelect["default"], {
|
111
88
|
value: value,
|
112
|
-
valueRender: function valueRender() {
|
113
|
-
return /*#__PURE__*/_react["default"].createElement("img", {
|
114
|
-
src: "/img/topo/editor/toolbar/bold/" + (disabled ? 'Disable' : 'Normal') + ".svg",
|
115
|
-
alt: ""
|
116
|
-
});
|
117
|
-
},
|
118
|
-
multiple: true,
|
119
89
|
disabled: disabled,
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
key: item.key,
|
124
|
-
disabled: fieldDisabled[item.key]
|
125
|
-
}, /*#__PURE__*/_react["default"].createElement(_Tooltip["default"], {
|
126
|
-
trigger: /*#__PURE__*/_react["default"].createElement("div", {
|
127
|
-
style: {
|
128
|
-
display: 'flex',
|
129
|
-
alignItems: 'center'
|
130
|
-
}
|
131
|
-
}, /*#__PURE__*/_react["default"].createElement("img", {
|
132
|
-
src: "/img/topo/editor/toolbar/" + item.icon + "/" + (fieldDisabled[item.key] ? 'Disable' : 'Normal') + ".svg",
|
133
|
-
alt: ""
|
134
|
-
}), /*#__PURE__*/_react["default"].createElement("span", {
|
135
|
-
style: fieldDisabled[item.key] ? {} : {
|
136
|
-
color: _variables["default"]['$color-text1-4']
|
137
|
-
}
|
138
|
-
}, item.label)),
|
139
|
-
align: "r",
|
140
|
-
popupStyle: {}
|
141
|
-
}, item.tooltip));
|
142
|
-
})));
|
90
|
+
fieldDisabled: fieldDisabled,
|
91
|
+
onChange: handleSelect
|
92
|
+
}));
|
143
93
|
}
|
144
94
|
|
145
95
|
var _default = (0, _textStyleSettingRouter["default"])(FontStyleButton, {
|
@@ -0,0 +1,38 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
5
|
+
exports.__esModule = true;
|
6
|
+
exports["default"] = void 0;
|
7
|
+
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
9
|
+
|
10
|
+
var _DropdownMenu = _interopRequireDefault(require("./DropdownMenu"));
|
11
|
+
|
12
|
+
function FontFamilySelect(props) {
|
13
|
+
var value = props.value,
|
14
|
+
onChange = props.onChange;
|
15
|
+
var items = ['宋体', '微软雅黑', '黑体', 'Arial'];
|
16
|
+
return /*#__PURE__*/_react["default"].createElement(_DropdownMenu["default"], {
|
17
|
+
value: (items.includes(value) ? value : null) || '',
|
18
|
+
valueRender: function valueRender(val) {
|
19
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
20
|
+
style: {
|
21
|
+
width: 48
|
22
|
+
}
|
23
|
+
}, val || '微软雅黑');
|
24
|
+
},
|
25
|
+
onSelect: onChange
|
26
|
+
}, items.map(function (item) {
|
27
|
+
return /*#__PURE__*/_react["default"].createElement(_DropdownMenu["default"].Item, {
|
28
|
+
key: item
|
29
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
30
|
+
style: {
|
31
|
+
fontFamily: item
|
32
|
+
}
|
33
|
+
}, item));
|
34
|
+
}));
|
35
|
+
}
|
36
|
+
|
37
|
+
var _default = FontFamilySelect;
|
38
|
+
exports["default"] = _default;
|
@@ -0,0 +1,38 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
5
|
+
exports.__esModule = true;
|
6
|
+
exports["default"] = void 0;
|
7
|
+
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
9
|
+
|
10
|
+
var _DropdownMenu = _interopRequireDefault(require("./DropdownMenu"));
|
11
|
+
|
12
|
+
function FontSizeSelect(props) {
|
13
|
+
var value = props.value,
|
14
|
+
disabled = props.disabled,
|
15
|
+
onChange = props.onChange;
|
16
|
+
var items = [12, 14, 16, 18, 20, 24, 30, 36, 48, 60, 80];
|
17
|
+
return /*#__PURE__*/_react["default"].createElement(_DropdownMenu["default"], {
|
18
|
+
value: "" + (value || ''),
|
19
|
+
valueRender: function valueRender(val) {
|
20
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
21
|
+
style: {
|
22
|
+
width: 18
|
23
|
+
}
|
24
|
+
}, val || 20);
|
25
|
+
},
|
26
|
+
disabled: disabled,
|
27
|
+
onSelect: function onSelect(val) {
|
28
|
+
return onChange(parseInt(val, 10));
|
29
|
+
}
|
30
|
+
}, items.map(function (item) {
|
31
|
+
return /*#__PURE__*/_react["default"].createElement(_DropdownMenu["default"].Item, {
|
32
|
+
key: item
|
33
|
+
}, item);
|
34
|
+
}));
|
35
|
+
}
|
36
|
+
|
37
|
+
var _default = FontSizeSelect;
|
38
|
+
exports["default"] = _default;
|