@riil-frontend/component-topology 6.0.8 → 6.0.9
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/common/icons/useIcons.js +1 -3
- package/es/core/editor/components/Sidebar/views/ImagePanel/CustomImagePanel.js +2 -4
- package/es/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +8 -3
- package/es/core/models/TopoApp.js +1 -1
- package/lib/core/common/icons/useIcons.js +1 -0
- package/lib/core/editor/components/Sidebar/views/ImagePanel/CustomImagePanel.js +2 -4
- package/lib/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +10 -4
- package/lib/core/models/TopoApp.js +1 -1
- package/package.json +2 -2
@@ -1,14 +1,12 @@
|
|
1
1
|
import topoManager from '@riil-frontend/component-topology-graph/es/manager';
|
2
2
|
import { getBasicIcons, getGroupDefaultIcons, getResourceIcons, transformCustomIcon2HtIcon } from "./icon";
|
3
|
-
|
4
|
-
function useCustomIcons(topo) {
|
3
|
+
export function useCustomIcons(topo) {
|
5
4
|
var _topo$store$useModelS = topo.store.useModelState('customIcon'),
|
6
5
|
icons = _topo$store$useModelS.icons;
|
7
6
|
|
8
7
|
var customIcons = icons.node.map(transformCustomIcon2HtIcon);
|
9
8
|
return customIcons;
|
10
9
|
}
|
11
|
-
|
12
10
|
export function useNodeIcons(topo) {
|
13
11
|
var customIcons = useCustomIcons(topo);
|
14
12
|
var groups = [{
|
@@ -9,10 +9,8 @@ import HtCustomImagePanel from "./HtCustomImagePanel";
|
|
9
9
|
*/
|
10
10
|
|
11
11
|
export default function CustomImagePanel(props) {
|
12
|
-
var topo = props.topo
|
13
|
-
|
14
|
-
return getUserCustomIconsForHt(topo);
|
15
|
-
}, []);
|
12
|
+
var topo = props.topo,
|
13
|
+
icons = props.icons;
|
16
14
|
return /*#__PURE__*/React.createElement(HtCustomImagePanel, {
|
17
15
|
icons: icons,
|
18
16
|
topo: topo
|
@@ -1,18 +1,20 @@
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
1
2
|
import _Button from "@alifd/next/es/button";
|
2
3
|
import _Icon from "@alifd/next/es/icon";
|
3
4
|
import React, { useMemo } from 'react';
|
4
|
-
import classNames from 'classnames';
|
5
5
|
import Collapse from "../../../../../../components/collapse/Collapse";
|
6
6
|
import CiTypeImagePanel from "./CiTypeImagePanel";
|
7
7
|
import CustomImagePanel from "./CustomImagePanel";
|
8
8
|
import { getBasicIcons } from "../../../../../common/icons/icon";
|
9
9
|
import ImagePalette from "./HtImagePalette";
|
10
|
+
import { useCustomIcons } from "../../../../../common/icons/useIcons";
|
10
11
|
var CollapsePanel = Collapse.Panel;
|
11
12
|
export default function ImagePanel(props) {
|
12
13
|
var topo = props.topo;
|
13
14
|
var basicIcons = useMemo(function () {
|
14
15
|
return getBasicIcons(topo, false);
|
15
16
|
}, []);
|
17
|
+
var customIcons = useCustomIcons(topo);
|
16
18
|
|
17
19
|
var handleDownloadCustomImages = function handleDownloadCustomImages() {
|
18
20
|
window.open('/topo/v1/api/shape/download/all');
|
@@ -40,9 +42,12 @@ export default function ImagePanel(props) {
|
|
40
42
|
title: "\u81EA\u5B9A\u4E49\u56FE\u7247",
|
41
43
|
extra: /*#__PURE__*/React.createElement(_Button, {
|
42
44
|
title: "\u5BFC\u51FA",
|
43
|
-
onClick: handleDownloadCustomImages
|
45
|
+
onClick: handleDownloadCustomImages,
|
46
|
+
disabled: !customIcons.length
|
44
47
|
}, /*#__PURE__*/React.createElement(_Icon, {
|
45
48
|
type: "topo_button_icon_export"
|
46
49
|
}))
|
47
|
-
}, /*#__PURE__*/React.createElement(CustomImagePanel, props
|
50
|
+
}, /*#__PURE__*/React.createElement(CustomImagePanel, _extends({}, props, {
|
51
|
+
icons: customIcons
|
52
|
+
}))));
|
48
53
|
}
|
@@ -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.9" === 'string' ? "6.0.9" : null;
|
27
27
|
console.info("\u62D3\u6251\u7248\u672C: " + version);
|
28
28
|
/**
|
29
29
|
* 拓扑显示和编辑
|
@@ -23,10 +23,8 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
23
23
|
* @returns
|
24
24
|
*/
|
25
25
|
function CustomImagePanel(props) {
|
26
|
-
var topo = props.topo
|
27
|
-
|
28
|
-
return (0, _icon.getUserCustomIconsForHt)(topo);
|
29
|
-
}, []);
|
26
|
+
var topo = props.topo,
|
27
|
+
icons = props.icons;
|
30
28
|
return /*#__PURE__*/_react["default"].createElement(_HtCustomImagePanel["default"], {
|
31
29
|
icons: icons,
|
32
30
|
topo: topo
|
@@ -5,14 +5,14 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
5
5
|
exports.__esModule = true;
|
6
6
|
exports["default"] = ImagePanel;
|
7
7
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
9
|
+
|
8
10
|
var _button = _interopRequireDefault(require("@alifd/next/lib/button"));
|
9
11
|
|
10
12
|
var _icon = _interopRequireDefault(require("@alifd/next/lib/icon"));
|
11
13
|
|
12
14
|
var _react = _interopRequireWildcard(require("react"));
|
13
15
|
|
14
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
15
|
-
|
16
16
|
var _Collapse = _interopRequireDefault(require("../../../../../../components/collapse/Collapse"));
|
17
17
|
|
18
18
|
var _CiTypeImagePanel = _interopRequireDefault(require("./CiTypeImagePanel"));
|
@@ -23,6 +23,8 @@ var _icon2 = require("../../../../../common/icons/icon");
|
|
23
23
|
|
24
24
|
var _HtImagePalette = _interopRequireDefault(require("./HtImagePalette"));
|
25
25
|
|
26
|
+
var _useIcons = require("../../../../../common/icons/useIcons");
|
27
|
+
|
26
28
|
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); }
|
27
29
|
|
28
30
|
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; }
|
@@ -34,6 +36,7 @@ function ImagePanel(props) {
|
|
34
36
|
var basicIcons = (0, _react.useMemo)(function () {
|
35
37
|
return (0, _icon2.getBasicIcons)(topo, false);
|
36
38
|
}, []);
|
39
|
+
var customIcons = (0, _useIcons.useCustomIcons)(topo);
|
37
40
|
|
38
41
|
var handleDownloadCustomImages = function handleDownloadCustomImages() {
|
39
42
|
window.open('/topo/v1/api/shape/download/all');
|
@@ -61,9 +64,12 @@ function ImagePanel(props) {
|
|
61
64
|
title: "\u81EA\u5B9A\u4E49\u56FE\u7247",
|
62
65
|
extra: /*#__PURE__*/_react["default"].createElement(_button["default"], {
|
63
66
|
title: "\u5BFC\u51FA",
|
64
|
-
onClick: handleDownloadCustomImages
|
67
|
+
onClick: handleDownloadCustomImages,
|
68
|
+
disabled: !customIcons.length
|
65
69
|
}, /*#__PURE__*/_react["default"].createElement(_icon["default"], {
|
66
70
|
type: "topo_button_icon_export"
|
67
71
|
}))
|
68
|
-
}, /*#__PURE__*/_react["default"].createElement(_CustomImagePanel["default"], props
|
72
|
+
}, /*#__PURE__*/_react["default"].createElement(_CustomImagePanel["default"], (0, _extends2["default"])({}, props, {
|
73
|
+
icons: customIcons
|
74
|
+
}))));
|
69
75
|
}
|
@@ -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.9" === 'string' ? "6.0.9" : 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.9",
|
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.9/build/index.html",
|
120
120
|
"gitHead": "2da19ffccbb7ca60a8acf396e39f542c68bb33f5"
|
121
121
|
}
|