@riil-frontend/component-topology 5.0.18 → 6.0.0-alpha.2
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/1.js +2 -2
- package/build/2.js +1 -1
- package/build/index.css +1 -1
- package/build/index.js +29 -29
- package/es/components/VerticalIconTab/VerticalIconTab.js +58 -0
- package/es/components/VerticalIconTab/VerticalIconTab.module.scss +63 -0
- package/es/components/VerticalIconTab/index.js +2 -0
- package/es/components/collapse/Collapse.js +7 -0
- package/es/components/collapse/Collapse.module.scss +33 -0
- package/es/components/collapse/CollapseFullheight.module.scss +20 -0
- package/es/components/collapse/Panel.js +3 -0
- package/es/core/common/icons/icon.js +18 -5
- package/es/core/components/AlarmListPanel/components/AlarmListItem.js +41 -10
- package/es/core/components/AlarmListPanel/components/index.module.scss +26 -0
- package/es/core/components/AlarmListPanel/index.js +9 -5
- package/es/core/components/ResourceViewAttributeSetting/Setting.js +5 -19
- package/es/core/components/TopoView/TopoView.module.scss +0 -4
- package/es/core/components/TopoView/editor.module.scss +3 -0
- package/es/core/components/TopoView/topoView.js +67 -33
- package/es/core/editor/components/Sidebar/Sidebar.js +75 -0
- package/es/core/editor/components/Sidebar/Sidebar.module.scss +15 -0
- package/es/core/editor/components/Sidebar/views/BackgroundPanel/BackgroundPanel.js +10 -0
- package/es/core/editor/components/Sidebar/views/BackgroundPanel/index.js +2 -0
- package/es/core/editor/components/Sidebar/views/CanvasPanel/ImagePanel.js +4 -0
- package/es/core/editor/components/Sidebar/views/CanvasPanel/index.js +2 -0
- package/es/core/editor/components/Sidebar/views/ComponentPanel.js +41 -0
- package/es/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +20 -0
- package/es/core/editor/components/Sidebar/views/ImagePanel/CustomImagePanel.js +45 -0
- package/es/core/editor/components/Sidebar/views/ImagePanel/ImagePalette.js +44 -0
- package/es/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +28 -0
- package/es/core/editor/components/Sidebar/views/ImagePanel/index.js +2 -0
- package/es/core/editor/components/Sidebar/views/LinkPanel.js +43 -0
- package/es/core/editor/components/Toolbar/EditorToolbar.js +40 -0
- package/es/core/editor/components/Toolbar/Toolbar.js +10 -0
- package/es/core/editor/components/Toolbar/Toolbar.module.scss +21 -0
- package/es/core/editor/components/Toolbar/buttons.js +36 -0
- package/es/core/editor/components/Toolbar/widgets/AddResourceButton.js +23 -0
- package/es/core/editor/components/Toolbar/widgets/AddResourceWidget.js +17 -0
- package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundButton.js +46 -0
- package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +8 -0
- package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/index.js +2 -0
- package/es/core/editor/components/Toolbar/widgets/CanvasMoveWidget.js +17 -0
- package/es/core/editor/components/Toolbar/widgets/CanvasSelectWidget.js +19 -0
- package/es/core/editor/components/Toolbar/widgets/Divider.js +10 -0
- package/es/core/editor/components/Toolbar/widgets/Divider.module.scss +6 -0
- package/es/core/editor/components/Toolbar/widgets/Dropdown.js +14 -0
- package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/Content.js +8 -0
- package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +46 -0
- package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/index.js +2 -0
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +8 -0
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +44 -0
- package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +44 -0
- package/es/core/editor/components/Toolbar/widgets/FontFamilyWidget.js +40 -0
- package/es/core/editor/components/Toolbar/widgets/FontSizeWidget.js +35 -0
- package/es/core/editor/components/Toolbar/widgets/FontStyleButton.js +62 -0
- package/es/core/editor/components/Toolbar/widgets/HistoryRedoButton.js +22 -0
- package/es/core/editor/components/Toolbar/widgets/HistoryUndoButton.js +29 -0
- package/es/core/editor/components/Toolbar/widgets/Layout/index.js +28 -0
- package/es/core/editor/components/Toolbar/widgets/NodeAlignWidget.js +47 -0
- package/es/core/editor/components/Toolbar/widgets/NodeImageButton/BoxBackgroundSetting.js +8 -0
- package/es/core/editor/components/Toolbar/widgets/NodeImageButton/NodeImageButton.js +46 -0
- package/es/core/editor/components/Toolbar/widgets/NodeImageButton/index.js +2 -0
- package/es/core/editor/components/Toolbar/widgets/NodeSizeButton/BoxBackgroundSetting.js +8 -0
- package/es/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.js +42 -0
- package/es/core/editor/components/Toolbar/widgets/NodeSizeButton/index.js +2 -0
- package/es/core/editor/components/Toolbar/widgets/SearchWidget.js +40 -0
- package/es/core/editor/components/Toolbar/widgets/WidgetBox.js +49 -0
- package/es/core/editor/components/Toolbar/widgets/WidgetBox.module.scss +64 -0
- package/es/core/editor/components/Toolbar/widgets/components/ArrowButton.js +19 -0
- package/es/core/editor/components/Toolbar/widgets/components/ArrowButton.module.scss +8 -0
- package/es/core/editor/components/Toolbar/widgets/components/ArrowPopup.js +27 -0
- package/es/core/editor/components/Toolbar/widgets/components/ArrowPopup.module.scss +10 -0
- package/es/core/editor/components/Toolbar/widgets/components/ButtonBox.js +34 -0
- package/es/core/editor/components/Toolbar/widgets/components/ButtonBox.module.scss +30 -0
- package/es/core/editor/components/Toolbar/widgets/components/DropdownButton.js +47 -0
- package/es/core/editor/components/Toolbar/widgets/components/DropdownButton.module.scss +10 -0
- package/es/core/editor/components/Toolbar/widgets/components/DropdownMenu.js +30 -0
- package/es/core/editor/components/Toolbar/widgets/components/MenuSelect.js +20 -0
- package/es/core/editor/components/Toolbar/widgets.js +0 -0
- package/es/core/editor/components/settings/common/SizeInput/NodeSizeInput.js +24 -8
- package/es/core/editor/components/settings/common/SizeInput/NodeSizeInput.module.scss +4 -3
- package/es/core/editor/components/settings/propertyViews/view/BatchSetNodeSize.js +4 -2
- package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +9 -15
- package/es/core/models/HistoryManager.js +32 -6
- package/es/core/models/SelectionManager.js +7 -0
- package/es/core/models/TopoApp.js +4 -2
- package/es/core/store/coreModels.js +5 -5
- package/es/core/store/models/displayConfig.js +2 -2
- package/es/core/store/models/historyManager.js +31 -0
- package/es/core/viewer/components/titlebar/widgets/SearchWidget.js +3 -1
- package/es/networkTopo/components/TopoView.js +2 -98
- package/es/networkTopo/components/Topology.js +3 -33
- package/es/networkTopo/components/editor/useEditorProps.js +34 -0
- package/es/networkTopo/hooks/useLinkDynamicStyle.js +1 -1
- package/es/style.js +1 -1
- package/lib/components/VerticalIconTab/VerticalIconTab.js +74 -0
- package/lib/components/VerticalIconTab/VerticalIconTab.module.scss +63 -0
- package/lib/components/VerticalIconTab/index.js +11 -0
- package/lib/components/collapse/Collapse.js +15 -0
- package/lib/components/collapse/Collapse.module.scss +33 -0
- package/lib/components/collapse/CollapseFullheight.module.scss +20 -0
- package/lib/components/collapse/Panel.js +3 -0
- package/lib/core/common/icons/icon.js +20 -5
- package/lib/core/components/AlarmListPanel/components/AlarmListItem.js +40 -9
- package/lib/core/components/AlarmListPanel/components/index.module.scss +26 -0
- package/lib/core/components/AlarmListPanel/index.js +10 -6
- package/lib/core/components/ResourceViewAttributeSetting/Setting.js +5 -19
- package/lib/core/components/TopoView/TopoView.module.scss +0 -4
- package/lib/core/components/TopoView/editor.module.scss +3 -0
- package/lib/core/components/TopoView/topoView.js +69 -32
- package/lib/core/editor/components/Sidebar/Sidebar.js +95 -0
- package/lib/core/editor/components/Sidebar/Sidebar.module.scss +15 -0
- package/lib/core/editor/components/Sidebar/views/BackgroundPanel/BackgroundPanel.js +19 -0
- package/lib/core/editor/components/Sidebar/views/BackgroundPanel/index.js +11 -0
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/ImagePanel.js +12 -0
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/index.js +11 -0
- package/lib/core/editor/components/Sidebar/views/ComponentPanel.js +53 -0
- package/lib/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +34 -0
- package/lib/core/editor/components/Sidebar/views/ImagePanel/CustomImagePanel.js +58 -0
- package/lib/core/editor/components/Sidebar/views/ImagePanel/ImagePalette.js +56 -0
- package/lib/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +43 -0
- package/lib/core/editor/components/Sidebar/views/ImagePanel/index.js +11 -0
- package/lib/core/editor/components/Sidebar/views/LinkPanel.js +56 -0
- package/lib/{networkTopo/components/viewer/titlebar/MoreButtonMenu.js → core/editor/components/Toolbar/EditorToolbar.js} +36 -29
- package/lib/core/editor/components/Toolbar/Toolbar.js +19 -0
- package/lib/core/editor/components/Toolbar/Toolbar.module.scss +21 -0
- package/lib/core/editor/components/Toolbar/buttons.js +62 -0
- package/lib/core/editor/components/Toolbar/widgets/AddResourceButton.js +33 -0
- package/lib/core/editor/components/Toolbar/widgets/AddResourceWidget.js +27 -0
- package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundButton.js +63 -0
- package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +16 -0
- package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/index.js +11 -0
- package/lib/core/editor/components/Toolbar/widgets/CanvasMoveWidget.js +27 -0
- package/lib/core/editor/components/Toolbar/widgets/CanvasSelectWidget.js +29 -0
- package/lib/core/editor/components/Toolbar/widgets/Divider.js +19 -0
- package/lib/core/editor/components/Toolbar/widgets/Divider.module.scss +6 -0
- package/lib/core/editor/components/Toolbar/widgets/Dropdown.js +26 -0
- package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/Content.js +16 -0
- package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +63 -0
- package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/index.js +11 -0
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +16 -0
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +61 -0
- package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +58 -0
- package/lib/core/editor/components/Toolbar/widgets/FontFamilyWidget.js +54 -0
- package/lib/core/editor/components/Toolbar/widgets/FontSizeWidget.js +49 -0
- package/lib/core/editor/components/Toolbar/widgets/FontStyleButton.js +76 -0
- package/lib/core/editor/components/Toolbar/widgets/HistoryRedoButton.js +31 -0
- package/lib/core/editor/components/Toolbar/widgets/HistoryUndoButton.js +38 -0
- package/lib/core/editor/components/Toolbar/widgets/Layout/index.js +40 -0
- package/lib/core/editor/components/Toolbar/widgets/NodeAlignWidget.js +64 -0
- package/lib/core/editor/components/Toolbar/widgets/NodeImageButton/BoxBackgroundSetting.js +16 -0
- package/lib/core/editor/components/Toolbar/widgets/NodeImageButton/NodeImageButton.js +63 -0
- package/lib/core/editor/components/Toolbar/widgets/NodeImageButton/index.js +11 -0
- package/lib/core/editor/components/Toolbar/widgets/NodeSizeButton/BoxBackgroundSetting.js +16 -0
- package/lib/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.js +59 -0
- package/lib/core/editor/components/Toolbar/widgets/NodeSizeButton/index.js +11 -0
- package/lib/core/editor/components/Toolbar/widgets/SearchWidget.js +53 -0
- package/lib/core/editor/components/Toolbar/widgets/WidgetBox.js +63 -0
- package/lib/core/editor/components/Toolbar/widgets/WidgetBox.module.scss +64 -0
- package/lib/core/editor/components/Toolbar/widgets/components/ArrowButton.js +31 -0
- package/lib/core/editor/components/Toolbar/widgets/components/ArrowButton.module.scss +8 -0
- package/lib/core/editor/components/Toolbar/widgets/components/ArrowPopup.js +40 -0
- package/lib/core/editor/components/Toolbar/widgets/components/ArrowPopup.module.scss +10 -0
- package/lib/core/editor/components/Toolbar/widgets/components/ButtonBox.js +48 -0
- package/lib/core/editor/components/Toolbar/widgets/components/ButtonBox.module.scss +30 -0
- package/lib/core/editor/components/Toolbar/widgets/components/DropdownButton.js +64 -0
- package/lib/core/editor/components/Toolbar/widgets/components/DropdownButton.module.scss +10 -0
- package/lib/core/editor/components/Toolbar/widgets/components/DropdownMenu.js +41 -0
- package/lib/core/editor/components/Toolbar/widgets/components/MenuSelect.js +30 -0
- package/lib/core/editor/components/Toolbar/widgets.js +1 -0
- package/lib/core/editor/components/settings/common/SizeInput/NodeSizeInput.js +25 -8
- package/lib/core/editor/components/settings/common/SizeInput/NodeSizeInput.module.scss +4 -3
- package/lib/core/editor/components/settings/propertyViews/view/BatchSetNodeSize.js +5 -2
- package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +5 -11
- package/lib/core/models/HistoryManager.js +32 -5
- package/lib/core/models/SelectionManager.js +7 -0
- package/lib/core/models/TopoApp.js +4 -1
- package/lib/core/store/coreModels.js +6 -6
- package/lib/core/store/models/displayConfig.js +2 -3
- package/lib/core/store/models/historyManager.js +41 -0
- package/lib/core/viewer/components/titlebar/widgets/SearchWidget.js +3 -1
- package/lib/networkTopo/components/TopoView.js +2 -104
- package/lib/networkTopo/components/Topology.js +3 -41
- package/lib/networkTopo/components/editor/useEditorProps.js +49 -0
- package/lib/networkTopo/hooks/useLinkDynamicStyle.js +2 -2
- package/lib/style.js +1 -1
- package/package.json +3 -3
- package/es/core/components/DisplaySettingDrawer/LinkTip.js +0 -41
- package/es/networkTopo/components/viewer/displaySetting/LinkAttrCustomSettingDrawer.js +0 -59
- package/es/networkTopo/components/viewer/displaySetting/LinkTagCommonRidioGroup.js +0 -24
- package/es/networkTopo/components/viewer/displaySetting/LinkTagCommonRidioGroup.module.scss +0 -23
- package/es/networkTopo/components/viewer/displaySetting/LinkTagV2.js +0 -93
- package/es/networkTopo/components/viewer/titlebar/MoreButtonMenu.js +0 -32
- package/es/networkTopo/components/viewer/titlebar/ViewerTools.js +0 -9
- package/es/networkTopo/components/viewer/titlebar/useSetDefaultTopo.js +0 -30
- package/lib/core/components/DisplaySettingDrawer/LinkTip.js +0 -55
- package/lib/networkTopo/components/viewer/displaySetting/LinkAttrCustomSettingDrawer.js +0 -76
- package/lib/networkTopo/components/viewer/displaySetting/LinkTagCommonRidioGroup.js +0 -35
- package/lib/networkTopo/components/viewer/displaySetting/LinkTagCommonRidioGroup.module.scss +0 -23
- package/lib/networkTopo/components/viewer/displaySetting/LinkTagV2.js +0 -108
- package/lib/networkTopo/components/viewer/titlebar/ViewerTools.js +0 -19
- package/lib/networkTopo/components/viewer/titlebar/useSetDefaultTopo.js +0 -40
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import BackgroundView from "../../../BackgroundView";
|
|
3
|
+
export default function BackgroundPanel(props) {
|
|
4
|
+
var topo = props.topo,
|
|
5
|
+
editorProps = props.editorProps;
|
|
6
|
+
return /*#__PURE__*/React.createElement(BackgroundView, {
|
|
7
|
+
topo: topo,
|
|
8
|
+
editorProps: editorProps
|
|
9
|
+
});
|
|
10
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React, { useEffect, useRef } from 'react';
|
|
2
|
+
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
|
3
|
+
/**
|
|
4
|
+
* 组件面板
|
|
5
|
+
* @param {*} props
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export default function ComponentPanel(props) {
|
|
10
|
+
var topo = props.topo; // 组件
|
|
11
|
+
|
|
12
|
+
var viewRef = useRef(null); // div容器
|
|
13
|
+
|
|
14
|
+
var divRef = useRef();
|
|
15
|
+
useEffect(function () {
|
|
16
|
+
// 初始化
|
|
17
|
+
var htTopo = topo.getHtTopo();
|
|
18
|
+
var container = divRef.current;
|
|
19
|
+
|
|
20
|
+
try {
|
|
21
|
+
viewRef.current = htTopo.createBasicPalette(container);
|
|
22
|
+
} catch (error) {
|
|
23
|
+
rlog.error('初始化资源面板失败', error);
|
|
24
|
+
} // 注销组件
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
return function () {
|
|
28
|
+
if (viewRef.current) {
|
|
29
|
+
viewRef.current.destroy();
|
|
30
|
+
viewRef.current = null;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
}, []);
|
|
34
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
35
|
+
ref: divRef,
|
|
36
|
+
style: {
|
|
37
|
+
width: '100%',
|
|
38
|
+
height: '100%'
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React, { useEffect, useMemo, useRef } from 'react';
|
|
2
|
+
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
|
3
|
+
import ImagePalette from "./ImagePalette";
|
|
4
|
+
import { getNodeDefaultIcons } from "../../../../../common/icons/icon";
|
|
5
|
+
/**
|
|
6
|
+
* 组件面板
|
|
7
|
+
* @param {*} props
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
export default function CiTypeImagePanel(props) {
|
|
12
|
+
var topo = props.topo;
|
|
13
|
+
var icons = useMemo(function () {
|
|
14
|
+
return getNodeDefaultIcons(topo);
|
|
15
|
+
}, []);
|
|
16
|
+
return /*#__PURE__*/React.createElement(ImagePalette, {
|
|
17
|
+
icons: icons,
|
|
18
|
+
topo: topo
|
|
19
|
+
});
|
|
20
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React, { useEffect, useRef } from 'react';
|
|
2
|
+
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
|
3
|
+
import { getUserCustomIconsForHt } from "../../../../../common/icons/icon";
|
|
4
|
+
/**
|
|
5
|
+
* 组件面板
|
|
6
|
+
* @param {*} props
|
|
7
|
+
* @returns
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
export default function CustomImagePanel(props) {
|
|
11
|
+
var topo = props.topo; // 组件
|
|
12
|
+
|
|
13
|
+
var viewRef = useRef(null); // div容器
|
|
14
|
+
|
|
15
|
+
var divRef = useRef();
|
|
16
|
+
useEffect(function () {
|
|
17
|
+
// 初始化
|
|
18
|
+
var icons = getUserCustomIconsForHt(topo);
|
|
19
|
+
var htTopo = topo.getHtTopo();
|
|
20
|
+
var container = divRef.current;
|
|
21
|
+
|
|
22
|
+
try {
|
|
23
|
+
viewRef.current = htTopo.createUploadImagePalette(container, {
|
|
24
|
+
icons: icons
|
|
25
|
+
});
|
|
26
|
+
} catch (error) {
|
|
27
|
+
rlog.error('初始化资源面板失败', error);
|
|
28
|
+
} // 注销组件
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
return function () {
|
|
32
|
+
if (viewRef.current) {
|
|
33
|
+
viewRef.current.destroy();
|
|
34
|
+
viewRef.current = null;
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
}, []);
|
|
38
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
39
|
+
ref: divRef,
|
|
40
|
+
style: {
|
|
41
|
+
width: '100%',
|
|
42
|
+
height: '100%'
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import React, { useEffect, useRef } from 'react';
|
|
2
|
+
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
|
3
|
+
/**
|
|
4
|
+
* 组件面板
|
|
5
|
+
* @param {*} props
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export default function ImagePalette(props) {
|
|
10
|
+
var topo = props.topo,
|
|
11
|
+
icons = props.icons; // 组件
|
|
12
|
+
|
|
13
|
+
var viewRef = useRef(null); // div容器
|
|
14
|
+
|
|
15
|
+
var divRef = useRef();
|
|
16
|
+
useEffect(function () {
|
|
17
|
+
// 初始化
|
|
18
|
+
var htTopo = topo.getHtTopo();
|
|
19
|
+
var container = divRef.current;
|
|
20
|
+
|
|
21
|
+
try {
|
|
22
|
+
viewRef.current = htTopo.createImagePalette(container, {
|
|
23
|
+
icons: icons
|
|
24
|
+
});
|
|
25
|
+
} catch (error) {
|
|
26
|
+
rlog.error('初始化资源面板失败', error);
|
|
27
|
+
} // 注销组件
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
return function () {
|
|
31
|
+
if (viewRef.current) {
|
|
32
|
+
viewRef.current.destroy();
|
|
33
|
+
viewRef.current = null;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
}, []);
|
|
37
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
38
|
+
ref: divRef,
|
|
39
|
+
style: {
|
|
40
|
+
width: '100%',
|
|
41
|
+
height: '100%'
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import _Collapse from "@alifd/next/es/collapse";
|
|
2
|
+
import _Button from "@alifd/next/es/button";
|
|
3
|
+
import _Icon from "@alifd/next/es/icon";
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import CollapsePanel from "../../../../../../components/collapse/Panel";
|
|
6
|
+
import CollapseStyles from "../../../../../../components/collapse/Collapse.module.scss";
|
|
7
|
+
import CiTypeImagePanel from "./CiTypeImagePanel";
|
|
8
|
+
import CustomImagePanel from "./CustomImagePanel";
|
|
9
|
+
export default function ImagePanel(props) {
|
|
10
|
+
return /*#__PURE__*/React.createElement(_Collapse, {
|
|
11
|
+
defaultExpandedKeys: ['资源图片', '自定义图片'],
|
|
12
|
+
style: {
|
|
13
|
+
border: 'none'
|
|
14
|
+
},
|
|
15
|
+
className: CollapseStyles.collapse
|
|
16
|
+
}, /*#__PURE__*/React.createElement(CollapsePanel, {
|
|
17
|
+
key: "\u8D44\u6E90\u56FE\u7247",
|
|
18
|
+
title: "\u8D44\u6E90\u56FE\u7247"
|
|
19
|
+
}, /*#__PURE__*/React.createElement(CiTypeImagePanel, props)), /*#__PURE__*/React.createElement(CollapsePanel, {
|
|
20
|
+
key: "\u81EA\u5B9A\u4E49\u56FE\u7247",
|
|
21
|
+
title: "\u81EA\u5B9A\u4E49\u56FE\u7247",
|
|
22
|
+
extra: /*#__PURE__*/React.createElement(_Button, {
|
|
23
|
+
title: "\u5BFC\u51FA"
|
|
24
|
+
}, /*#__PURE__*/React.createElement(_Icon, {
|
|
25
|
+
type: "topo_button_icon_export"
|
|
26
|
+
}))
|
|
27
|
+
}, /*#__PURE__*/React.createElement(CustomImagePanel, props)));
|
|
28
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React, { useEffect, useRef } from 'react';
|
|
2
|
+
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
|
3
|
+
/**
|
|
4
|
+
* 链路面板
|
|
5
|
+
* @param {*} props
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
function LinkPanel(props) {
|
|
10
|
+
var topo = props.topo; // 组件
|
|
11
|
+
|
|
12
|
+
var viewRef = useRef(null); // div容器
|
|
13
|
+
|
|
14
|
+
var divRef = useRef();
|
|
15
|
+
useEffect(function () {
|
|
16
|
+
// 初始化
|
|
17
|
+
var htTopo = topo.getHtTopo();
|
|
18
|
+
var container = divRef.current;
|
|
19
|
+
|
|
20
|
+
try {
|
|
21
|
+
viewRef.current = htTopo.createLinkPalette(container);
|
|
22
|
+
} catch (error) {
|
|
23
|
+
rlog.error('初始化资源面板失败', error);
|
|
24
|
+
} // 注销组件
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
return function () {
|
|
28
|
+
if (viewRef.current) {
|
|
29
|
+
viewRef.current.destroy();
|
|
30
|
+
viewRef.current = null;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
}, []);
|
|
34
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
35
|
+
ref: divRef,
|
|
36
|
+
style: {
|
|
37
|
+
width: '100%',
|
|
38
|
+
height: '100%'
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export default LinkPanel;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import _Button from "@alifd/next/es/button";
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
import React, { useState } from 'react';
|
|
4
|
+
import buttons from "./buttons";
|
|
5
|
+
import Toolbar from "./Toolbar";
|
|
6
|
+
import styles from "./Toolbar.module.scss";
|
|
7
|
+
|
|
8
|
+
function EditorToolbar(props) {
|
|
9
|
+
var _useState = useState(true),
|
|
10
|
+
showLabel = _useState[0],
|
|
11
|
+
setShowLabel = _useState[1];
|
|
12
|
+
|
|
13
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
14
|
+
className: styles.toolbarContainer
|
|
15
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
16
|
+
className: styles.content
|
|
17
|
+
}, /*#__PURE__*/React.createElement(Toolbar, null, buttons.map(function (ToolbarButton, index) {
|
|
18
|
+
return /*#__PURE__*/React.createElement(ToolbarButton, _extends({
|
|
19
|
+
key: index
|
|
20
|
+
}, props, {
|
|
21
|
+
showLabel: showLabel
|
|
22
|
+
}));
|
|
23
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
|
24
|
+
className: styles.right
|
|
25
|
+
}, /*#__PURE__*/React.createElement(_Button, {
|
|
26
|
+
type: "normal",
|
|
27
|
+
text: true,
|
|
28
|
+
onClick: function onClick() {
|
|
29
|
+
setShowLabel(!showLabel);
|
|
30
|
+
}
|
|
31
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
32
|
+
src: showLabel ? '/img/topo/editor/toolbar/ToolbarNarrowed/Normal.svg' : '/img/topo/editor/toolbar/ToolbbbarExpand/Normal.svg',
|
|
33
|
+
alt: "",
|
|
34
|
+
style: {
|
|
35
|
+
verticalAlign: 'middle'
|
|
36
|
+
}
|
|
37
|
+
}))));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export default EditorToolbar;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
.toolbarContainer {
|
|
2
|
+
height: 54px;
|
|
3
|
+
display: flex;
|
|
4
|
+
align-items: center;
|
|
5
|
+
justify-content: center;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.content {
|
|
9
|
+
flex: 1;
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.widgets {
|
|
16
|
+
display: flex;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.right {
|
|
20
|
+
padding-right: 12px;
|
|
21
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import AddResourceButton from "./widgets/AddResourceButton";
|
|
2
|
+
import CanvasMoveWidget from "./widgets/CanvasMoveWidget";
|
|
3
|
+
import CanvasSelectWidget from "./widgets/CanvasSelectWidget";
|
|
4
|
+
import Divider from "./widgets/Divider";
|
|
5
|
+
import FontFamilyWidget from "./widgets/FontFamilyWidget";
|
|
6
|
+
import FontSizeWidget from "./widgets/FontSizeWidget";
|
|
7
|
+
import FontStyleButton from "./widgets/FontStyleButton";
|
|
8
|
+
import FontColorButton from "./widgets/FontColorButton";
|
|
9
|
+
import Layout from "./widgets/Layout";
|
|
10
|
+
import NodeAlignWidget from "./widgets/NodeAlignWidget";
|
|
11
|
+
import SearchWidget from "./widgets/SearchWidget";
|
|
12
|
+
import HistoryUndoButton from "./widgets/HistoryUndoButton";
|
|
13
|
+
import HistoryRedoButton from "./widgets/HistoryRedoButton";
|
|
14
|
+
import EdgeTypeButton from "./widgets/EdgeTypeButton";
|
|
15
|
+
import BoxBackgroundButton from "./widgets/BoxBackgroundButton";
|
|
16
|
+
import EdgeColorButton from "./widgets/EdgeColorButton";
|
|
17
|
+
import NodeImageButton from "./widgets/NodeImageButton";
|
|
18
|
+
import NodeSizeButton from "./widgets/NodeSizeButton";
|
|
19
|
+
export default [AddResourceButton, // 添加资源
|
|
20
|
+
Divider, CanvasSelectWidget, // 选择
|
|
21
|
+
CanvasMoveWidget, // 移动
|
|
22
|
+
Divider, HistoryUndoButton, // 撤销
|
|
23
|
+
HistoryRedoButton, // 恢复
|
|
24
|
+
Divider, FontFamilyWidget, // 字体
|
|
25
|
+
FontSizeWidget, // 字号
|
|
26
|
+
FontStyleButton, // 文字样式
|
|
27
|
+
FontColorButton, // 文字颜色
|
|
28
|
+
Divider, BoxBackgroundButton, // 框背景
|
|
29
|
+
Divider, EdgeColorButton, // 线条颜色
|
|
30
|
+
EdgeTypeButton, // 线形
|
|
31
|
+
Divider, NodeImageButton, // 替换图片
|
|
32
|
+
NodeSizeButton, // 图片尺寸
|
|
33
|
+
Divider, Layout, // 布局方式
|
|
34
|
+
NodeAlignWidget, // 对齐方式
|
|
35
|
+
SearchWidget // 搜索
|
|
36
|
+
];
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ButtonBox from "./components/ButtonBox";
|
|
3
|
+
import WidgetBox from "./WidgetBox";
|
|
4
|
+
|
|
5
|
+
function AddResourceButton(props) {
|
|
6
|
+
var showLabel = props.showLabel,
|
|
7
|
+
topo = props.topo,
|
|
8
|
+
topoEdit = props.topoEdit;
|
|
9
|
+
return /*#__PURE__*/React.createElement(WidgetBox, {
|
|
10
|
+
label: "\u6DFB\u52A0\u8D44\u6E90",
|
|
11
|
+
tooltip: "\u6DFB\u52A0\u8D44\u6E90",
|
|
12
|
+
showLabel: showLabel
|
|
13
|
+
}, /*#__PURE__*/React.createElement(ButtonBox, {
|
|
14
|
+
onClick: function onClick() {
|
|
15
|
+
topoEdit.showGlobalAddResourceDrawer();
|
|
16
|
+
}
|
|
17
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
18
|
+
src: "/img/topo/editor/toolbar/add/Normal.svg",
|
|
19
|
+
alt: ""
|
|
20
|
+
})));
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export default AddResourceButton;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import ButtonBox from "./components/ButtonBox";
|
|
3
|
+
import WidgetBox from "./WidgetBox";
|
|
4
|
+
|
|
5
|
+
function AddResourceWidget(props) {
|
|
6
|
+
var showLabel = props.showLabel;
|
|
7
|
+
return /*#__PURE__*/React.createElement(WidgetBox, {
|
|
8
|
+
label: "\u6DFB\u52A0\u8D44\u6E90",
|
|
9
|
+
tooltip: "\u6DFB\u52A0\u8D44\u6E90",
|
|
10
|
+
showLabel: showLabel
|
|
11
|
+
}, /*#__PURE__*/React.createElement(ButtonBox, null, /*#__PURE__*/React.createElement("img", {
|
|
12
|
+
src: "/img/topo/editor/toolbar/add/Normal.svg",
|
|
13
|
+
alt: ""
|
|
14
|
+
})));
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default AddResourceWidget;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
2
|
+
var _excluded = ["topo", "showLabel"];
|
|
3
|
+
import React, { useEffect, useState } from 'react';
|
|
4
|
+
import DropdownButton from "../components/DropdownButton";
|
|
5
|
+
import WidgetBox from "../WidgetBox";
|
|
6
|
+
import BoxBackgroundSetting from "./BoxBackgroundSetting";
|
|
7
|
+
/**
|
|
8
|
+
* 框背景设置
|
|
9
|
+
* @param {*} props
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
function BoxBackgroundButton(props) {
|
|
14
|
+
var topo = props.topo,
|
|
15
|
+
showLabel = props.showLabel,
|
|
16
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded);
|
|
17
|
+
|
|
18
|
+
var _useState = useState(true),
|
|
19
|
+
disabled = _useState[0],
|
|
20
|
+
setDisabled = _useState[1]; // 选中的元素
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
var selection = topo.selectionManager.useSelection();
|
|
24
|
+
useEffect(function () {
|
|
25
|
+
setDisabled(false);
|
|
26
|
+
}, [selection]);
|
|
27
|
+
var icon = disabled ? /*#__PURE__*/React.createElement("img", {
|
|
28
|
+
src: "/img/topo/editor/toolbar/\u80CC\u666F\u586B\u5145\u53CA\u8FB9\u6846/Disable.svg",
|
|
29
|
+
alt: ""
|
|
30
|
+
}) : /*#__PURE__*/React.createElement("img", {
|
|
31
|
+
src: "/img/topo/editor/toolbar/\u80CC\u666F\u586B\u5145\u53CA\u8FB9\u6846/Normal.svg",
|
|
32
|
+
alt: ""
|
|
33
|
+
});
|
|
34
|
+
return /*#__PURE__*/React.createElement(WidgetBox, {
|
|
35
|
+
label: "\u6846\u80CC\u666F",
|
|
36
|
+
tooltip: "\u6846\u80CC\u666F",
|
|
37
|
+
showLabel: showLabel
|
|
38
|
+
}, /*#__PURE__*/React.createElement(DropdownButton, {
|
|
39
|
+
disabled: disabled,
|
|
40
|
+
trigger: icon
|
|
41
|
+
}, /*#__PURE__*/React.createElement(BoxBackgroundSetting, {
|
|
42
|
+
topo: topo
|
|
43
|
+
})));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export default BoxBackgroundButton;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import WidgetBox from "./WidgetBox";
|
|
3
|
+
import ButtonBox from "./components/ButtonBox";
|
|
4
|
+
|
|
5
|
+
function CanvasMoveWidget(props) {
|
|
6
|
+
var showLabel = props.showLabel;
|
|
7
|
+
return /*#__PURE__*/React.createElement(WidgetBox, {
|
|
8
|
+
label: "\u79FB\u52A8",
|
|
9
|
+
tooltip: "\u79FB\u52A8",
|
|
10
|
+
showLabel: showLabel
|
|
11
|
+
}, /*#__PURE__*/React.createElement(ButtonBox, null, /*#__PURE__*/React.createElement("img", {
|
|
12
|
+
src: "/img/topo/editor/toolbar/drag/Normal.svg",
|
|
13
|
+
alt: ""
|
|
14
|
+
})));
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export default CanvasMoveWidget;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import WidgetBox from "./WidgetBox";
|
|
3
|
+
import ButtonBox from "./components/ButtonBox";
|
|
4
|
+
|
|
5
|
+
function CanvasSelectWidget(props) {
|
|
6
|
+
var showLabel = props.showLabel;
|
|
7
|
+
return /*#__PURE__*/React.createElement(WidgetBox, {
|
|
8
|
+
label: "\u9009\u62E9",
|
|
9
|
+
tooltip: "\u9009\u62E9",
|
|
10
|
+
showLabel: showLabel
|
|
11
|
+
}, /*#__PURE__*/React.createElement(ButtonBox, {
|
|
12
|
+
active: true
|
|
13
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
14
|
+
src: "/img/topo/editor/toolbar/select/Normal.svg",
|
|
15
|
+
alt: ""
|
|
16
|
+
})));
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export default CanvasSelectWidget;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import _Dropdown from "@alifd/next/es/dropdown";
|
|
2
|
+
import _Menu from "@alifd/next/es/menu";
|
|
3
|
+
import React from 'react';
|
|
4
|
+
|
|
5
|
+
function Dropdown(props) {
|
|
6
|
+
var trigger = props.trigger;
|
|
7
|
+
var menu = /*#__PURE__*/React.createElement(_Menu, null, /*#__PURE__*/React.createElement(_Menu.Item, null, "Option 1"), /*#__PURE__*/React.createElement(_Menu.Item, null, "Option 2"), /*#__PURE__*/React.createElement(_Menu.Item, null, "Option 3"), /*#__PURE__*/React.createElement(_Menu.Item, null, "Option 4"));
|
|
8
|
+
return /*#__PURE__*/React.createElement(_Dropdown, {
|
|
9
|
+
trigger: /*#__PURE__*/React.createElement("a", null, "Click me"),
|
|
10
|
+
triggerType: "click"
|
|
11
|
+
}, /*#__PURE__*/React.createElement("div", null, "111"));
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default Dropdown;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
|
2
|
+
var _excluded = ["topo", "showLabel"];
|
|
3
|
+
import React, { useEffect, useState } from 'react';
|
|
4
|
+
import DropdownButton from "../components/DropdownButton";
|
|
5
|
+
import WidgetBox from "../WidgetBox";
|
|
6
|
+
import Content from "./Content";
|
|
7
|
+
/**
|
|
8
|
+
* 线条颜色
|
|
9
|
+
* @param {*} props
|
|
10
|
+
* @returns
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
function EdgeColorButton(props) {
|
|
14
|
+
var topo = props.topo,
|
|
15
|
+
showLabel = props.showLabel,
|
|
16
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded);
|
|
17
|
+
|
|
18
|
+
var _useState = useState(true),
|
|
19
|
+
disabled = _useState[0],
|
|
20
|
+
setDisabled = _useState[1]; // 选中的元素
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
var selection = topo.selectionManager.useSelection();
|
|
24
|
+
useEffect(function () {
|
|
25
|
+
setDisabled(false);
|
|
26
|
+
}, [selection]);
|
|
27
|
+
var icon = disabled ? /*#__PURE__*/React.createElement("img", {
|
|
28
|
+
src: "/img/topo/editor/toolbar/\u7EBF\u6761\u586B\u5145/Disable.svg",
|
|
29
|
+
alt: ""
|
|
30
|
+
}) : /*#__PURE__*/React.createElement("img", {
|
|
31
|
+
src: "/img/topo/editor/toolbar/\u7EBF\u6761\u586B\u5145/Normal.svg",
|
|
32
|
+
alt: ""
|
|
33
|
+
});
|
|
34
|
+
return /*#__PURE__*/React.createElement(WidgetBox, {
|
|
35
|
+
label: "\u7EBF\u6761\u989C\u8272",
|
|
36
|
+
tooltip: "\u7EBF\u6761\u989C\u8272",
|
|
37
|
+
showLabel: showLabel
|
|
38
|
+
}, /*#__PURE__*/React.createElement(DropdownButton, {
|
|
39
|
+
disabled: disabled,
|
|
40
|
+
trigger: icon
|
|
41
|
+
}, /*#__PURE__*/React.createElement(Content, {
|
|
42
|
+
topo: topo
|
|
43
|
+
})));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export default EdgeColorButton;
|