@riil-frontend/component-topology 6.0.0-alpha.3 → 6.0.0-alpha.30
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 +35 -35
- package/es/components/ColorPanel/components/ColorBlock/index.js +37 -0
- package/es/components/ColorPanel/components/ColorBlock/index.module.scss +8 -0
- package/es/components/ColorPanel/components/FontColorRange/index.js +35 -0
- package/es/components/ColorPanel/components/FontColorRange/index.module.scss +23 -0
- package/es/components/ColorPanel/index.js +237 -0
- package/es/components/ColorPanel/index.module.scss +34 -0
- package/es/components/VerticalIconTab/VerticalIconTab.module.scss +5 -1
- package/es/components/collapse/Collapse.js +22 -3
- package/es/components/collapse/Collapse.module.scss +23 -0
- package/es/components/collapse/index.js +2 -0
- package/es/core/common/hooks/useHtElements.js +21 -0
- package/es/core/common/icons/icon.js +41 -0
- package/es/core/common/icons/useIcons.js +8 -16
- package/es/core/components/AlarmListPanel/components/AlarmListItem.js +14 -13
- package/es/core/components/AlarmListPanel/components/index.module.scss +5 -5
- package/es/core/components/DisplaySettingDrawer/DisplaySetting.js +2 -1
- package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +6 -2
- package/es/core/components/DisplaySettingDrawer/EditorDisplaySetting.js +122 -0
- package/es/core/components/DisplaySettingDrawer/LineExpandAllRadioGroup.js +0 -3
- package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +76 -19
- package/es/core/components/TopoView/GraphViewPanel.js +20 -0
- package/es/core/components/TopoView/editor.module.scss +1 -0
- package/es/core/components/TopoView/topoView.js +29 -49
- package/es/core/components/titlebar/TitleBar.module.scss +1 -1
- package/es/core/editor/components/Sidebar/Sidebar.js +40 -50
- package/es/core/editor/components/Sidebar/panes.js +32 -0
- package/es/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.js +96 -0
- package/es/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.module.scss +74 -0
- package/es/core/editor/components/Sidebar/views/CanvasPanel/index.js +1 -1
- package/es/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +3 -3
- package/es/core/editor/components/Sidebar/views/ImagePanel/HtCustomImagePanel.js +2 -5
- package/es/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.js +2 -4
- package/es/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.module.scss +5 -0
- package/es/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +20 -7
- package/es/core/editor/components/Toolbar/EditorToolbar.js +23 -13
- package/es/core/editor/components/Toolbar/Toolbar.js +1 -1
- package/es/core/editor/components/Toolbar/Toolbar.module.scss +14 -3
- package/es/core/editor/components/Toolbar/buttons.js +20 -18
- package/es/core/editor/components/Toolbar/hooks/useFontStyleSetting.js +35 -0
- package/es/core/editor/components/Toolbar/widgets/AddResourceButton.js +8 -7
- package/es/core/editor/components/Toolbar/widgets/CanvasMoveWidget.js +13 -2
- package/es/core/editor/components/Toolbar/widgets/CanvasSelectWidget.js +11 -2
- package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/Content.js +36 -2
- package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +76 -5
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +184 -3
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.module.scss +44 -0
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +53 -0
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.module.scss +31 -0
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/constants.js +77 -0
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +59 -6
- package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +36 -4
- package/es/core/editor/components/Toolbar/widgets/FontColorButton.module.scss +35 -0
- package/es/core/editor/components/Toolbar/widgets/FontFamilyWidget.js +12 -2
- package/es/core/editor/components/Toolbar/widgets/FontSizeWidget.js +12 -2
- package/es/core/editor/components/Toolbar/widgets/HistoryRedoButton.js +3 -2
- package/es/core/editor/components/Toolbar/widgets/HistoryUndoButton.js +5 -4
- package/es/core/editor/components/Toolbar/widgets/IconSelect/IconSelect.js +109 -0
- package/es/core/editor/components/Toolbar/widgets/IconSelect/constant.js +64 -0
- package/es/core/editor/components/Toolbar/widgets/IconSelect/index.js +101 -0
- package/es/core/editor/components/Toolbar/widgets/IconSelect/index.module.scss +153 -0
- package/es/core/editor/components/Toolbar/widgets/IconSelect/popUpContent.js +49 -0
- package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutSettings.js +99 -0
- package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutSettings.module.scss +70 -0
- package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagImageSelect/index.js +42 -0
- package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagImageSelect/index.module.scss +7 -0
- package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagSelect/index.js +75 -0
- package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagSelect/index.scss +32 -0
- package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/Icon.js +23 -0
- package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/index.js +10 -0
- package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_circular.svg +10 -0
- package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_hierarchical.svg +10 -0
- package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_rectangle.svg +12 -0
- package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_toward.svg +16 -0
- package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/index.js +31 -0
- package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/index.module.scss +53 -0
- package/es/core/editor/components/Toolbar/widgets/Layout/index.js +128 -15
- package/es/core/editor/components/Toolbar/widgets/NodeAlignWidget.js +115 -22
- package/es/core/editor/components/Toolbar/widgets/NodeAlignWidget.module.scss +12 -0
- package/es/core/editor/components/Toolbar/widgets/NodeImageButton/BoxBackgroundSetting.js +15 -5
- package/es/core/editor/components/Toolbar/widgets/NodeImageButton/NodeImageButton.js +41 -7
- package/es/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.js +94 -13
- package/es/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.module.scss +28 -0
- package/es/core/editor/components/Toolbar/widgets/WidgetBox.js +15 -22
- package/es/core/editor/components/Toolbar/widgets/WidgetBox.module.scss +11 -1
- package/es/core/editor/components/Toolbar/widgets/components/ButtonBox.js +4 -2
- package/es/core/editor/components/Toolbar/widgets/components/DropdownButton.js +8 -5
- package/es/core/editor/components/settings/CloseablePanel.js +28 -0
- package/es/core/editor/components/settings/OpenPropertyPanelListener.js +33 -0
- package/es/core/editor/components/settings/PropertyView.js +27 -8
- package/es/core/editor/components/settings/Settings.js +4 -44
- package/es/core/editor/components/settings/Settings.module.scss +8 -4
- package/es/core/editor/components/settings/common/AlignSetting/AlignTypeList.js +76 -0
- package/es/core/editor/components/settings/common/AlignSetting/index.js +20 -71
- package/es/core/editor/components/settings/common/LineType/index.js +12 -119
- package/es/core/editor/components/settings/common/NodeSizeInput/NodeSizeInput.js +3 -3
- package/es/core/editor/components/settings/common/SizeInput/NodeSizeInput.js +31 -21
- package/es/core/editor/components/settings/common/SizeInput/NodeSizeNumberPicker.js +7 -6
- package/es/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js +0 -8
- package/es/core/editor/components/settings/propertyViews/multipleElements/BatchSetNodeSize/BatchSetNodeSize.js +8 -9
- package/es/core/editor/components/settings/propertyViews/multipleElements/MultipleElementLineType.js +5 -42
- package/es/core/editor/components/settings/propertyViews/multipleElements/MultipleElementPropertyView.js +2 -15
- package/es/core/editor/components/settings/propertyViews/view/BatchSetNodeSize.js +9 -6
- package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +8 -4
- package/es/core/editor/hooks/useKeyboardShortcut.js +42 -0
- package/es/core/{store/models → editor/store}/background.js +0 -0
- package/es/core/{store/models → editor/store}/historyManager.js +0 -0
- package/es/core/editor/store/topoEdit.js +49 -0
- package/es/core/editor/utils/edgeTypeStyleUtil.js +96 -0
- package/es/core/hooks/useCanvasTheme.js +35 -0
- package/es/core/hooks/useTopoEdit.js +38 -58
- package/es/core/models/Alarm.js +2 -2
- package/es/core/models/HistoryManager.js +10 -3
- package/es/core/models/SelectionManager.js +16 -1
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/models/TopoGraphView.js +8 -2
- package/es/core/models/utils/linkUtils.js +1 -1
- package/es/core/store/coreModels.js +6 -7
- package/es/core/store/models/selection.js +2 -1
- package/es/core/store/models/topoBizMod.js +0 -3
- package/es/core/store/models/topoMod.js +26 -28
- package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/WebConsoleForm.js +13 -29
- package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +6 -5
- package/es/core/viewer/components/titlebar/widgets/SettingButton.js +3 -1
- package/es/core/viewer/components/titlebar/widgets/SettingButtonWidget.js +4 -2
- package/es/networkTopo/createTopo.js +2 -0
- package/es/networkTopo/services/link.js +2 -2
- package/es/networkTopo/store/topoTreeMod.js +6 -7
- package/es/style.js +1 -0
- package/es/utils/topoData.js +1 -0
- package/lib/components/ColorPanel/components/ColorBlock/index.js +47 -0
- package/lib/components/ColorPanel/components/ColorBlock/index.module.scss +8 -0
- package/lib/components/ColorPanel/components/FontColorRange/index.js +49 -0
- package/lib/components/ColorPanel/components/FontColorRange/index.module.scss +23 -0
- package/lib/components/ColorPanel/index.js +255 -0
- package/lib/components/ColorPanel/index.module.scss +34 -0
- package/lib/components/VerticalIconTab/VerticalIconTab.module.scss +5 -1
- package/lib/components/collapse/Collapse.js +28 -3
- package/lib/components/collapse/Collapse.module.scss +23 -0
- package/lib/components/collapse/index.js +11 -0
- package/lib/core/common/hooks/useHtElements.js +27 -0
- package/lib/core/common/icons/icon.js +48 -0
- package/lib/core/common/icons/useIcons.js +10 -15
- package/lib/core/components/AlarmListPanel/components/AlarmListItem.js +14 -13
- package/lib/core/components/AlarmListPanel/components/index.module.scss +5 -5
- package/lib/core/components/DisplaySettingDrawer/DisplaySetting.js +2 -1
- package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +7 -2
- package/lib/core/components/DisplaySettingDrawer/EditorDisplaySetting.js +147 -0
- package/lib/core/components/DisplaySettingDrawer/LineExpandAllRadioGroup.js +0 -3
- package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +76 -19
- package/lib/core/components/TopoView/GraphViewPanel.js +30 -0
- package/lib/core/components/TopoView/editor.module.scss +1 -0
- package/lib/core/components/TopoView/topoView.js +32 -50
- package/lib/core/components/titlebar/TitleBar.module.scss +1 -1
- package/lib/core/editor/components/Sidebar/Sidebar.js +39 -53
- package/lib/core/editor/components/Sidebar/panes.js +45 -0
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.js +109 -0
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.module.scss +74 -0
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/index.js +2 -2
- package/lib/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +1 -1
- package/lib/core/editor/components/Sidebar/views/ImagePanel/HtCustomImagePanel.js +2 -5
- package/lib/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.js +3 -4
- package/lib/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.module.scss +5 -0
- package/lib/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +29 -11
- package/lib/core/editor/components/Toolbar/EditorToolbar.js +22 -11
- package/lib/core/editor/components/Toolbar/Toolbar.js +1 -1
- package/lib/core/editor/components/Toolbar/Toolbar.module.scss +14 -3
- package/lib/core/editor/components/Toolbar/buttons.js +21 -20
- package/lib/core/editor/components/Toolbar/hooks/useFontStyleSetting.js +50 -0
- package/lib/core/editor/components/Toolbar/widgets/AddResourceButton.js +8 -7
- package/lib/core/editor/components/Toolbar/widgets/CanvasMoveWidget.js +13 -2
- package/lib/core/editor/components/Toolbar/widgets/CanvasSelectWidget.js +11 -2
- package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/Content.js +38 -2
- package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +77 -5
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +194 -3
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.module.scss +44 -0
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +71 -0
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.module.scss +31 -0
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/constants.js +83 -0
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +61 -5
- package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +39 -4
- package/lib/core/editor/components/Toolbar/widgets/FontColorButton.module.scss +35 -0
- package/lib/core/editor/components/Toolbar/widgets/FontFamilyWidget.js +13 -2
- package/lib/core/editor/components/Toolbar/widgets/FontSizeWidget.js +13 -2
- package/lib/core/editor/components/Toolbar/widgets/HistoryRedoButton.js +4 -2
- package/lib/core/editor/components/Toolbar/widgets/HistoryUndoButton.js +5 -3
- package/lib/core/editor/components/Toolbar/widgets/IconSelect/IconSelect.js +126 -0
- package/lib/core/editor/components/Toolbar/widgets/IconSelect/constant.js +69 -0
- package/lib/core/editor/components/Toolbar/widgets/IconSelect/index.js +117 -0
- package/lib/core/editor/components/Toolbar/widgets/IconSelect/index.module.scss +153 -0
- package/lib/core/editor/components/Toolbar/widgets/IconSelect/popUpContent.js +61 -0
- package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutSettings.js +116 -0
- package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutSettings.module.scss +70 -0
- package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagImageSelect/index.js +55 -0
- package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagImageSelect/index.module.scss +7 -0
- package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagSelect/index.js +93 -0
- package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagSelect/index.scss +32 -0
- package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/Icon.js +32 -0
- package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/index.js +22 -0
- package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_circular.svg +10 -0
- package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_hierarchical.svg +10 -0
- package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_rectangle.svg +12 -0
- package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_toward.svg +16 -0
- package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/index.js +44 -0
- package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/index.module.scss +53 -0
- package/lib/core/editor/components/Toolbar/widgets/Layout/index.js +133 -16
- package/lib/core/editor/components/Toolbar/widgets/NodeAlignWidget.js +118 -22
- package/lib/core/editor/components/Toolbar/widgets/NodeAlignWidget.module.scss +12 -0
- package/lib/core/editor/components/Toolbar/widgets/NodeImageButton/BoxBackgroundSetting.js +21 -5
- package/lib/core/editor/components/Toolbar/widgets/NodeImageButton/NodeImageButton.js +41 -6
- package/lib/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.js +96 -12
- package/lib/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.module.scss +28 -0
- package/lib/core/editor/components/Toolbar/widgets/WidgetBox.js +16 -22
- package/lib/core/editor/components/Toolbar/widgets/WidgetBox.module.scss +11 -1
- package/lib/core/editor/components/Toolbar/widgets/components/ButtonBox.js +4 -2
- package/lib/core/editor/components/Toolbar/widgets/components/DropdownButton.js +8 -5
- package/lib/core/editor/components/settings/CloseablePanel.js +40 -0
- package/lib/core/editor/components/settings/OpenPropertyPanelListener.js +43 -0
- package/lib/core/editor/components/settings/PropertyView.js +30 -8
- package/lib/core/editor/components/settings/Settings.js +4 -44
- package/lib/core/editor/components/settings/Settings.module.scss +8 -4
- package/lib/core/editor/components/settings/common/AlignSetting/AlignTypeList.js +93 -0
- package/lib/core/editor/components/settings/common/AlignSetting/index.js +21 -79
- package/lib/core/editor/components/settings/common/LineType/index.js +13 -126
- package/lib/core/editor/components/settings/common/NodeSizeInput/NodeSizeInput.js +2 -2
- package/lib/core/editor/components/settings/common/SizeInput/NodeSizeInput.js +32 -23
- package/lib/core/editor/components/settings/common/SizeInput/NodeSizeNumberPicker.js +6 -6
- package/lib/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js +0 -8
- package/lib/core/editor/components/settings/propertyViews/multipleElements/BatchSetNodeSize/BatchSetNodeSize.js +6 -8
- package/lib/core/editor/components/settings/propertyViews/multipleElements/MultipleElementLineType.js +5 -42
- package/lib/core/editor/components/settings/propertyViews/multipleElements/MultipleElementPropertyView.js +2 -15
- package/lib/core/editor/components/settings/propertyViews/view/BatchSetNodeSize.js +7 -5
- package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +9 -1
- package/lib/core/editor/hooks/useKeyboardShortcut.js +52 -0
- package/lib/core/{store/models → editor/store}/background.js +0 -0
- package/lib/core/{store/models → editor/store}/historyManager.js +0 -0
- package/lib/core/editor/store/topoEdit.js +59 -0
- package/lib/core/editor/utils/edgeTypeStyleUtil.js +109 -0
- package/lib/core/hooks/useCanvasTheme.js +49 -0
- package/lib/core/hooks/useTopoEdit.js +39 -60
- package/lib/core/models/Alarm.js +2 -2
- package/lib/core/models/HistoryManager.js +10 -3
- package/lib/core/models/SelectionManager.js +17 -1
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/models/TopoGraphView.js +8 -2
- package/lib/core/models/utils/linkUtils.js +1 -1
- package/lib/core/store/coreModels.js +5 -7
- package/lib/core/store/models/selection.js +2 -1
- package/lib/core/store/models/topoBizMod.js +0 -3
- package/lib/core/store/models/topoMod.js +27 -29
- package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/WebConsoleForm.js +13 -29
- package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +6 -5
- package/lib/core/viewer/components/titlebar/widgets/SettingButton.js +3 -1
- package/lib/core/viewer/components/titlebar/widgets/SettingButtonWidget.js +4 -2
- package/lib/networkTopo/createTopo.js +3 -0
- package/lib/networkTopo/services/link.js +2 -2
- package/lib/networkTopo/store/topoTreeMod.js +6 -8
- package/lib/style.js +1 -0
- package/lib/utils/topoData.js +1 -0
- package/package.json +4 -4
- package/es/core/editor/components/Sidebar/views/CanvasPanel/ImagePanel.js +0 -4
- package/es/core/store/models/topoEdit.js +0 -39
- package/es/core/store/models/topoView.js +0 -36
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/ImagePanel.js +0 -12
- package/lib/core/store/models/topoEdit.js +0 -51
- package/lib/core/store/models/topoView.js +0 -47
@@ -1,15 +1,12 @@
|
|
1
1
|
import _Box from "@alifd/next/es/box";
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
3
|
-
import _Grid from "@alifd/next/es/grid";
|
4
3
|
import _Form from "@alifd/next/es/form";
|
5
4
|
import React, { useState } from 'react';
|
6
5
|
import PropTypes from 'prop-types';
|
6
|
+
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
7
7
|
import NodeSizeNumberPicker from "./NodeSizeNumberPicker";
|
8
8
|
import styles from "./NodeSizeInput.module.scss";
|
9
|
-
import rlog from "@riil-frontend/component-topology-utils/es/rlog";
|
10
9
|
var FormItem = _Form.Item;
|
11
|
-
var Row = _Grid.Row,
|
12
|
-
Col = _Grid.Col;
|
13
10
|
/**
|
14
11
|
* 节点大小组件
|
15
12
|
*
|
@@ -22,11 +19,13 @@ function SizeInput(props) {
|
|
22
19
|
max = props.max,
|
23
20
|
step = props.step,
|
24
21
|
onChange = props.onChange,
|
25
|
-
lock = props.lock,
|
26
|
-
onLockChange = props.onLockChange,
|
27
22
|
_props$showLabel = props.showLabel,
|
28
23
|
showLabel = _props$showLabel === void 0 ? true : _props$showLabel,
|
29
|
-
|
24
|
+
numberPickerProps = props.numberPickerProps,
|
25
|
+
size = props.size,
|
26
|
+
lock = props.lock,
|
27
|
+
disabled = props.disabled,
|
28
|
+
onLockChange = props.onLockChange;
|
30
29
|
|
31
30
|
var handleChange = function handleChange(name, attrValue) {
|
32
31
|
var _extends2;
|
@@ -45,6 +44,18 @@ function SizeInput(props) {
|
|
45
44
|
return val ? Math.round(val) : val;
|
46
45
|
}
|
47
46
|
|
47
|
+
var renderLock = function renderLock() {
|
48
|
+
var imgSrc = "/img/topo/editor/toolbar/" + (lock ? 'lock' : 'unlock') + "/" + (disabled ? 'Disable' : 'Normal') + ".svg";
|
49
|
+
return /*#__PURE__*/React.createElement("div", {
|
50
|
+
className: styles.lockBtn,
|
51
|
+
onClick: switchLock
|
52
|
+
}, /*#__PURE__*/React.createElement("img", {
|
53
|
+
src: imgSrc,
|
54
|
+
alt: "",
|
55
|
+
width: 12
|
56
|
+
}));
|
57
|
+
};
|
58
|
+
|
48
59
|
return /*#__PURE__*/React.createElement(_Form, {
|
49
60
|
labelAlign: "top",
|
50
61
|
component: "div",
|
@@ -65,27 +76,24 @@ function SizeInput(props) {
|
|
65
76
|
style: {
|
66
77
|
marginBottom: 0
|
67
78
|
}
|
68
|
-
}, /*#__PURE__*/React.createElement(NodeSizeNumberPicker, {
|
79
|
+
}, /*#__PURE__*/React.createElement(NodeSizeNumberPicker, _extends({
|
69
80
|
value: parseValue(value.width),
|
70
81
|
label: showLabel ? '宽:' : '',
|
82
|
+
innerAfter: showLabel ? undefined : 'W',
|
71
83
|
min: 1,
|
72
84
|
max: max,
|
73
85
|
step: step,
|
86
|
+
disabled: disabled,
|
74
87
|
placeholder: "\u8BF7\u8F93\u5165",
|
75
|
-
size: size
|
88
|
+
size: size
|
89
|
+
}, numberPickerProps, {
|
76
90
|
style: {
|
77
91
|
width: '100%'
|
78
92
|
},
|
79
93
|
onChange: function onChange(val) {
|
80
94
|
return handleChange('width', val);
|
81
95
|
}
|
82
|
-
}))), /*#__PURE__*/React.createElement("div", {
|
83
|
-
className: styles.lockBtn,
|
84
|
-
onClick: switchLock
|
85
|
-
}, /*#__PURE__*/React.createElement("img", {
|
86
|
-
src: require(lock ? './img/icon_锁.svg' : './img/icon_解锁.svg'),
|
87
|
-
alt: ""
|
88
|
-
})), /*#__PURE__*/React.createElement("div", {
|
96
|
+
})))), renderLock(), /*#__PURE__*/React.createElement("div", {
|
89
97
|
style: {
|
90
98
|
flex: 1
|
91
99
|
}
|
@@ -95,22 +103,24 @@ function SizeInput(props) {
|
|
95
103
|
style: {
|
96
104
|
marginBottom: 0
|
97
105
|
}
|
98
|
-
}, /*#__PURE__*/React.createElement(NodeSizeNumberPicker, {
|
106
|
+
}, /*#__PURE__*/React.createElement(NodeSizeNumberPicker, _extends({
|
99
107
|
value: parseValue(value.height),
|
100
|
-
label: showLabel ? '高:' : ''
|
101
|
-
,
|
108
|
+
label: showLabel ? '高:' : '',
|
109
|
+
innerAfter: showLabel ? undefined : 'H',
|
102
110
|
min: 1,
|
103
111
|
max: max,
|
104
112
|
step: step,
|
113
|
+
disabled: disabled,
|
105
114
|
placeholder: "\u8BF7\u8F93\u5165",
|
106
|
-
size: size
|
115
|
+
size: size
|
116
|
+
}, numberPickerProps, {
|
107
117
|
style: {
|
108
118
|
width: '100%'
|
109
119
|
},
|
110
120
|
onChange: function onChange(val) {
|
111
121
|
return handleChange('height', val);
|
112
122
|
}
|
113
|
-
}))))));
|
123
|
+
})))))));
|
114
124
|
}
|
115
125
|
|
116
126
|
SizeInput.propTypes = {
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import _NumberPicker from "@alifd/next/es/number-picker";
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
3
3
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
4
|
-
var _excluded = ["value", "onChange", "min", "onBlur", "onKeyDown"];
|
5
|
-
import React, { useState, useEffect } from
|
4
|
+
var _excluded = ["value", "onChange", "min", "onBlur", "onKeyDown", "disabled"];
|
5
|
+
import React, { useState, useEffect } from "react";
|
6
6
|
|
7
7
|
/**
|
8
8
|
* 节点大小组件
|
@@ -16,6 +16,7 @@ export default function NodeSizeNumberPicker(props) {
|
|
16
16
|
min = props.min,
|
17
17
|
onBlur = props.onBlur,
|
18
18
|
onKeyDown = props.onKeyDown,
|
19
|
+
disabled = props.disabled,
|
19
20
|
otherProps = _objectWithoutPropertiesLoose(props, _excluded);
|
20
21
|
|
21
22
|
var _useState = useState(value),
|
@@ -48,13 +49,13 @@ export default function NodeSizeNumberPicker(props) {
|
|
48
49
|
|
49
50
|
var handleChange = function handleChange(value, e) {
|
50
51
|
// 失去焦点最大最小值
|
51
|
-
if (e.type ===
|
52
|
+
if (e.type === "blur") {
|
52
53
|
onChange(!value ? min : value);
|
53
54
|
return;
|
54
55
|
} // 加减号立即变更
|
55
56
|
|
56
57
|
|
57
|
-
if (e.triggerType ===
|
58
|
+
if (e.triggerType === "up" || e.triggerType === "down") {
|
58
59
|
onChange(value);
|
59
60
|
return;
|
60
61
|
}
|
@@ -65,9 +66,9 @@ export default function NodeSizeNumberPicker(props) {
|
|
65
66
|
return /*#__PURE__*/React.createElement(_NumberPicker, _extends({}, otherProps, {
|
66
67
|
value: inputValue,
|
67
68
|
min: min,
|
69
|
+
disabled: disabled,
|
68
70
|
onChange: handleChange,
|
69
71
|
onBlur: handleBlur,
|
70
72
|
onKeyDown: handleKeyDown
|
71
73
|
}));
|
72
|
-
}
|
73
|
-
;
|
74
|
+
}
|
package/es/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js
CHANGED
@@ -71,13 +71,5 @@ export default function GroupExpandSetting(props) {
|
|
71
71
|
setExpanded: function setExpanded(val) {
|
72
72
|
return group.setExpanded(val);
|
73
73
|
}
|
74
|
-
}))), /*#__PURE__*/React.createElement(CollapsePanel, {
|
75
|
-
key: "\u5BF9\u9F50\u65B9\u5F0F",
|
76
|
-
title: "\u5BF9\u9F50\u65B9\u5F0F"
|
77
|
-
}, /*#__PURE__*/React.createElement(_Form.Item, {
|
78
|
-
label: ""
|
79
|
-
}, /*#__PURE__*/React.createElement(AlignSetting, {
|
80
|
-
onChange: alignOnChange,
|
81
|
-
selected: "left"
|
82
74
|
}))));
|
83
75
|
}
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
2
|
-
import rlog from
|
3
|
-
import React, { useState, useEffect, useRef, useCallback, useMemo } from
|
2
|
+
import rlog from "@riil-frontend/component-topology-utils/es/rlog";
|
3
|
+
import React, { useState, useEffect, useRef, useCallback, useMemo } from "react";
|
4
4
|
import SizeInput from "../../../common/SizeInput";
|
5
5
|
|
6
6
|
var NodesSizeRatioMap = /*#__PURE__*/function () {
|
@@ -80,7 +80,7 @@ export default function BatchSetNodeSize(props) {
|
|
80
80
|
if (lock) {
|
81
81
|
var _setSize;
|
82
82
|
|
83
|
-
setSize((_setSize = {}, _setSize[name] = value, _setSize[name ===
|
83
|
+
setSize((_setSize = {}, _setSize[name] = value, _setSize[name === "width" ? "height" : "width"] = undefined, _setSize));
|
84
84
|
} else {
|
85
85
|
var _extends2;
|
86
86
|
|
@@ -89,10 +89,10 @@ export default function BatchSetNodeSize(props) {
|
|
89
89
|
|
90
90
|
topo.historyManager.beginTransaction();
|
91
91
|
nodes.forEach(function (node) {
|
92
|
-
if (name ===
|
92
|
+
if (name === "width") {
|
93
93
|
if (lock) {
|
94
94
|
var height = nodesSizeRatioMap.getNodeHeight(node, value);
|
95
|
-
rlog.debug(
|
95
|
+
rlog.debug("多元素锁定设置宽", node, value, height);
|
96
96
|
node.setHeight(height);
|
97
97
|
}
|
98
98
|
|
@@ -117,11 +117,10 @@ export default function BatchSetNodeSize(props) {
|
|
117
117
|
nodesSizeRatioMap.reset();
|
118
118
|
};
|
119
119
|
|
120
|
-
return /*#__PURE__*/React.createElement(SizeInput, {
|
120
|
+
return /*#__PURE__*/React.createElement(SizeInput, _extends({}, props, {
|
121
121
|
value: size,
|
122
122
|
lock: lock,
|
123
123
|
onChange: handleChange,
|
124
124
|
onLockChange: onLockChange
|
125
|
-
});
|
126
|
-
}
|
127
|
-
;
|
125
|
+
}));
|
126
|
+
}
|
package/es/core/editor/components/settings/propertyViews/multipleElements/MultipleElementLineType.js
CHANGED
@@ -1,52 +1,15 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import {
|
3
|
-
import LineType from "
|
2
|
+
import { getEdgesBySelection, setEdgesType } from "../../../../utils/edgeTypeStyleUtil";
|
3
|
+
import LineType from "../../../Toolbar/widgets/EdgeTypeButton/LineType";
|
4
4
|
export default function MultipleElementLineType(props) {
|
5
5
|
var topo = props.topo;
|
6
6
|
|
7
|
-
var setLineType = function setLineType(type) {
|
8
|
-
|
9
|
-
|
10
|
-
var nodeIds = nodes.map(function (node) {
|
11
|
-
return node.getId();
|
12
|
-
});
|
13
|
-
nodes.forEach(function (node) {
|
14
|
-
if (node instanceof ht.Group) {
|
15
|
-
var children = node.getChildren().toArray();
|
16
|
-
nodeIds.push.apply(nodeIds, getChildrenNodeIds(children));
|
17
|
-
}
|
18
|
-
});
|
19
|
-
return nodeIds;
|
20
|
-
};
|
21
|
-
|
22
|
-
var getSelectedEdges = function getSelectedEdges() {
|
23
|
-
var gv = topo.getGraphView();
|
24
|
-
var selection = gv.getSelectionModel().getSelection().toArray();
|
25
|
-
var edges = selection.filter(function (element) {
|
26
|
-
return element instanceof ht.Edge;
|
27
|
-
}); // 查询选中节点间的连线
|
28
|
-
|
29
|
-
var nodes = selection.filter(function (element) {
|
30
|
-
return element instanceof ht.Node;
|
31
|
-
});
|
32
|
-
var nodeIds = getChildrenNodeIds(nodes);
|
33
|
-
var dm = gv.getDataModel();
|
34
|
-
getEdges(dm).forEach(function (edge) {
|
35
|
-
if (nodeIds.find(function (nodeId) {
|
36
|
-
return nodeId === edge.getSource().getId();
|
37
|
-
}) && nodeIds.find(function (nodeId) {
|
38
|
-
return nodeId === edge.getTarget().getId();
|
39
|
-
}) && !edges.find(function (item) {
|
40
|
-
return item === edge;
|
41
|
-
})) {
|
42
|
-
edges.push(edge);
|
43
|
-
}
|
44
|
-
});
|
45
|
-
return edges;
|
7
|
+
var setLineType = function setLineType(type) {
|
8
|
+
var edges = getEdgesBySelection(topo);
|
9
|
+
setEdgesType(edges, type, topo);
|
46
10
|
};
|
47
11
|
|
48
12
|
return /*#__PURE__*/React.createElement(LineType, {
|
49
|
-
getEdges: getSelectedEdges,
|
50
13
|
onChange: setLineType,
|
51
14
|
topo: topo
|
52
15
|
});
|
@@ -34,19 +34,7 @@ export default function MultipleElementPropertyView(props) {
|
|
34
34
|
|
35
35
|
useEffect(function () {
|
36
36
|
field.setValues(values);
|
37
|
-
}, [values]);
|
38
|
-
|
39
|
-
var alignOnChange = function alignOnChange(v) {
|
40
|
-
// console.log('setAlignmentBySelectionNodes', v);
|
41
|
-
topo.historyManager.beginTransaction();
|
42
|
-
topo.getHtTopo().setAlignmentBySelectionNodes(v);
|
43
|
-
|
44
|
-
_onChange('groupAlign', v); // topoEditApi.setAlignmentBySelectionNodes(v);
|
45
|
-
|
46
|
-
|
47
|
-
topo.historyManager.endTransaction();
|
48
|
-
}; // TODO 临时方案,满足应用部署拓扑多选元素属性面板不显示对齐
|
49
|
-
|
37
|
+
}, [values]); // TODO 临时方案,满足应用部署拓扑多选元素属性面板不显示对齐
|
50
38
|
|
51
39
|
if (!(editorProps !== null && editorProps !== void 0 && (_editorProps$multiple = editorProps.multipleElementPropertyViewProps) !== null && _editorProps$multiple !== void 0 && _editorProps$multiple.showElementAlign) && topoShowType === TPL_TREE) {
|
52
40
|
return /*#__PURE__*/React.createElement(ViewPropertyView, props);
|
@@ -78,8 +66,7 @@ export default function MultipleElementPropertyView(props) {
|
|
78
66
|
key: "\u5BF9\u9F50\u65B9\u5F0F",
|
79
67
|
title: "\u5BF9\u9F50\u65B9\u5F0F"
|
80
68
|
}, /*#__PURE__*/React.createElement(AlignSetting, {
|
81
|
-
|
82
|
-
selected: "left"
|
69
|
+
topo: topo
|
83
70
|
})), /*#__PURE__*/React.createElement(CollapsePanel, {
|
84
71
|
key: "\u7EBF\u5F62",
|
85
72
|
title: "\u7EBF\u5F62"
|
@@ -1,10 +1,13 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
2
|
-
import React, { useState, useEffect, useRef, useCallback } from
|
3
|
-
import SizeInput from "../../common/SizeInput";
|
2
|
+
import React, { useState, useEffect, useRef, useCallback } from "react";
|
3
|
+
import SizeInput from "../../common/SizeInput"; // 这个似乎不需要了
|
4
|
+
|
4
5
|
export default function BatchSetNodeSize(props) {
|
5
|
-
var
|
6
|
+
var value = props.value,
|
7
|
+
size = props.size,
|
8
|
+
disabled = props.disabled;
|
6
9
|
return /*#__PURE__*/React.createElement(SizeInput, _extends({}, props, {
|
7
|
-
|
10
|
+
disabled: disabled,
|
11
|
+
value: value
|
8
12
|
}));
|
9
|
-
}
|
10
|
-
;
|
13
|
+
}
|
@@ -1,15 +1,15 @@
|
|
1
1
|
import _Box from "@alifd/next/es/box";
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
2
3
|
import _Dialog from "@alifd/next/es/dialog";
|
3
4
|
import _Button from "@alifd/next/es/button";
|
4
5
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
5
6
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
6
|
-
import React from 'react';
|
7
|
+
import React, { useState, useEffect } from 'react';
|
7
8
|
import classnames from 'classnames';
|
8
9
|
import TitleWidget from "../../../components/titlebar/widgets/TitleWidget";
|
9
10
|
import styles from "../../../components/titlebar/TitleBar.module.scss";
|
10
|
-
import { useState } from 'react';
|
11
|
-
import { useEffect } from 'react';
|
12
11
|
import DebugTools from "./widgets/DebugTools";
|
12
|
+
import SettingButtonWidget from "../../../viewer/components/titlebar/widgets/SettingButtonWidget";
|
13
13
|
export default function TopoEditorTitleBar(props) {
|
14
14
|
var topo = props.topo,
|
15
15
|
topoEditApi = props.topoEditApi;
|
@@ -132,5 +132,9 @@ export default function TopoEditorTitleBar(props) {
|
|
132
132
|
}
|
133
133
|
});
|
134
134
|
}
|
135
|
-
}, "\u9000\u51FA")
|
135
|
+
}, "\u9000\u51FA"), /*#__PURE__*/React.createElement(SettingButtonWidget, _extends({
|
136
|
+
isEditor: true
|
137
|
+
}, props, {
|
138
|
+
viewerProps: topo.viewProps.viewerProps
|
139
|
+
})))));
|
136
140
|
}
|
@@ -0,0 +1,42 @@
|
|
1
|
+
import React, { useEffect } from 'react';
|
2
|
+
var ht = window.ht; // 快捷键
|
3
|
+
|
4
|
+
export default function useKeyboardShortcut(props) {
|
5
|
+
var topo = props.topo,
|
6
|
+
topoEdit = props.topoEdit,
|
7
|
+
isEditMode = props.isEditMode;
|
8
|
+
useEffect(function () {
|
9
|
+
var handleKeyDown = function handleKeyDown(e) {
|
10
|
+
if (e.target.tagName === 'INPUT') {
|
11
|
+
return;
|
12
|
+
}
|
13
|
+
|
14
|
+
var isCtrlDown = ht.Default.isCtrlDown;
|
15
|
+
|
16
|
+
if (isCtrlDown(e)) {
|
17
|
+
if (e.keyCode === 90) {
|
18
|
+
// ctrl+z 撤销
|
19
|
+
topo.historyManager.undo();
|
20
|
+
} // else if (e.keyCode == 89) {//ctrl+y 重做
|
21
|
+
// this.redo();
|
22
|
+
// }
|
23
|
+
|
24
|
+
}
|
25
|
+
|
26
|
+
if (e.keyCode === 32) {
|
27
|
+
var _topo$store$getModelS = topo.store.getModelState('topoEdit'),
|
28
|
+
viewMouseMode = _topo$store$getModelS.viewMouseMode;
|
29
|
+
|
30
|
+
topoEdit.setViewMouseMode(viewMouseMode === 'select' ? 'move' : 'select');
|
31
|
+
}
|
32
|
+
};
|
33
|
+
|
34
|
+
if (isEditMode) {
|
35
|
+
window.addEventListener('keydown', handleKeyDown);
|
36
|
+
}
|
37
|
+
|
38
|
+
return function () {
|
39
|
+
window.removeEventListener('keydown', handleKeyDown);
|
40
|
+
};
|
41
|
+
}, [isEditMode]);
|
42
|
+
}
|
File without changes
|
File without changes
|
@@ -0,0 +1,49 @@
|
|
1
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
3
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
4
|
+
|
5
|
+
/**
|
6
|
+
* 拓扑编辑 Model
|
7
|
+
*/
|
8
|
+
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
9
|
+
export default function (topo) {
|
10
|
+
return {
|
11
|
+
// 定义 model 的初始 state
|
12
|
+
state: {
|
13
|
+
// 是否就绪
|
14
|
+
ready: false,
|
15
|
+
// 保存状态
|
16
|
+
saving: false,
|
17
|
+
// 选择/拖动模式模式。默认选择模式 select|move
|
18
|
+
viewMouseMode: 'select',
|
19
|
+
// 资源面板展开项
|
20
|
+
resourceTabActiveKey: null,
|
21
|
+
// 属性面板是否显示
|
22
|
+
propertyPanelVisible: false
|
23
|
+
},
|
24
|
+
// 定义改变该模型状态的纯函数
|
25
|
+
reducers: {
|
26
|
+
update: function update(prevState, payload) {
|
27
|
+
return _extends({}, prevState, payload);
|
28
|
+
}
|
29
|
+
},
|
30
|
+
// 定义处理该模型副作用的函数
|
31
|
+
effects: function effects(dispatch) {
|
32
|
+
return {
|
33
|
+
init: function init(payload, rootState) {
|
34
|
+
return _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
35
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
36
|
+
while (1) {
|
37
|
+
switch (_context.prev = _context.next) {
|
38
|
+
case 0:
|
39
|
+
case "end":
|
40
|
+
return _context.stop();
|
41
|
+
}
|
42
|
+
}
|
43
|
+
}, _callee);
|
44
|
+
}))();
|
45
|
+
}
|
46
|
+
};
|
47
|
+
}
|
48
|
+
};
|
49
|
+
}
|
@@ -0,0 +1,96 @@
|
|
1
|
+
import { getEdges } from "../../../utils/htElementUtils";
|
2
|
+
var ht = window.ht;
|
3
|
+
export function getEdgesBySelection(topo) {
|
4
|
+
var getChildrenNodeIds = function getChildrenNodeIds(nodes) {
|
5
|
+
var nodeIds = nodes.map(function (node) {
|
6
|
+
return node.getId();
|
7
|
+
});
|
8
|
+
nodes.forEach(function (node) {
|
9
|
+
if (node instanceof ht.Group) {
|
10
|
+
var children = node.getChildren().toArray();
|
11
|
+
nodeIds.push.apply(nodeIds, getChildrenNodeIds(children));
|
12
|
+
}
|
13
|
+
});
|
14
|
+
return nodeIds;
|
15
|
+
};
|
16
|
+
|
17
|
+
var getSelectedEdges = function getSelectedEdges(topo) {
|
18
|
+
var gv = topo.getGraphView();
|
19
|
+
var selection = gv.getSelectionModel().getSelection().toArray(); // 选中的连线
|
20
|
+
|
21
|
+
var edges = selection.filter(function (element) {
|
22
|
+
return element instanceof ht.Edge;
|
23
|
+
}); // 查询选中节点间的连线
|
24
|
+
|
25
|
+
var nodes = selection.filter(function (element) {
|
26
|
+
return element instanceof ht.Node;
|
27
|
+
});
|
28
|
+
var nodeIds = getChildrenNodeIds(nodes);
|
29
|
+
var dm = gv.getDataModel();
|
30
|
+
getEdges(dm).forEach(function (edge) {
|
31
|
+
if (nodeIds.find(function (nodeId) {
|
32
|
+
return nodeId === edge.getSource().getId();
|
33
|
+
}) && nodeIds.find(function (nodeId) {
|
34
|
+
return nodeId === edge.getTarget().getId();
|
35
|
+
}) && !edges.find(function (item) {
|
36
|
+
return item === edge;
|
37
|
+
})) {
|
38
|
+
edges.push(edge);
|
39
|
+
}
|
40
|
+
});
|
41
|
+
return edges;
|
42
|
+
};
|
43
|
+
|
44
|
+
return getSelectedEdges(topo);
|
45
|
+
}
|
46
|
+
/**
|
47
|
+
* 遍历连线及子连线
|
48
|
+
* @param {*} topo
|
49
|
+
* @param {*} edges
|
50
|
+
* @param {*} operateEdgeFn
|
51
|
+
*/
|
52
|
+
|
53
|
+
export function loopEdgesAndChildren(topo, edges, operateEdgeFn) {
|
54
|
+
var htTopo = topo.getHtTopo();
|
55
|
+
edges.forEach(function (edge) {
|
56
|
+
operateEdgeFn(edge);
|
57
|
+
|
58
|
+
if (edge.isEdgeGroupAgent()) {
|
59
|
+
// 连线组折叠时同时设置子连线
|
60
|
+
var edgeChildren = edge.getEdgeGroup().getEdges().toArray();
|
61
|
+
htTopo.toggleEdgeGroup(edge.getSource(), edge.getTarget(), true);
|
62
|
+
edgeChildren.forEach(function (edgeChild) {
|
63
|
+
operateEdgeFn(edgeChild);
|
64
|
+
});
|
65
|
+
htTopo.toggleEdgeGroup(edge.getSource(), edge.getTarget(), false);
|
66
|
+
}
|
67
|
+
});
|
68
|
+
}
|
69
|
+
/**
|
70
|
+
* 设置连线及子连线。带回退事务控制
|
71
|
+
* @param {*} topo
|
72
|
+
* @param {*} edges
|
73
|
+
* @param {*} operateEdgeFn
|
74
|
+
*/
|
75
|
+
|
76
|
+
export function setEdgesAndChildren(topo, edges, operateEdgeFn) {
|
77
|
+
topo.historyManager.beginTransaction();
|
78
|
+
loopEdgesAndChildren(topo, edges, operateEdgeFn);
|
79
|
+
topo.historyManager.endTransaction();
|
80
|
+
}
|
81
|
+
/**
|
82
|
+
* 批量设置连线线形
|
83
|
+
*
|
84
|
+
* @param {*} edges
|
85
|
+
* @param {*} type
|
86
|
+
* @param {*} topo
|
87
|
+
*/
|
88
|
+
|
89
|
+
export function setEdgesType(edges, type, topo) {
|
90
|
+
var htTopo = topo.getHtTopo();
|
91
|
+
setEdgesAndChildren(topo, edges, function (edge) {
|
92
|
+
htTopo.setGraphLinear(edge, {
|
93
|
+
type: type
|
94
|
+
});
|
95
|
+
});
|
96
|
+
}
|
@@ -0,0 +1,35 @@
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
2
|
+
import React, { useEffect } from 'react';
|
3
|
+
var themeMap = [{
|
4
|
+
value: 'white',
|
5
|
+
label: '白色',
|
6
|
+
color: '#FFFFFF'
|
7
|
+
}, {
|
8
|
+
value: 'lightblue',
|
9
|
+
label: '蓝色',
|
10
|
+
color: '#F9FBFF'
|
11
|
+
}, {
|
12
|
+
value: 'yellow',
|
13
|
+
label: '黄色',
|
14
|
+
color: '#FFFDE6'
|
15
|
+
}, {
|
16
|
+
value: 'green',
|
17
|
+
label: '绿色',
|
18
|
+
color: '#EAFFE8'
|
19
|
+
}, {
|
20
|
+
value: 'dark',
|
21
|
+
label: '深色',
|
22
|
+
color: '#031425'
|
23
|
+
}].reduce(function (map, item) {
|
24
|
+
var _extends2;
|
25
|
+
|
26
|
+
return _extends({}, map, (_extends2 = {}, _extends2[item.value] = item, _extends2));
|
27
|
+
}, {});
|
28
|
+
export default function useCanvasTheme(props) {
|
29
|
+
var canvasTheme = props.canvasTheme;
|
30
|
+
useEffect(function () {// 设置
|
31
|
+
}, [canvasTheme]);
|
32
|
+
return {
|
33
|
+
canvasColor: themeMap[canvasTheme].color
|
34
|
+
};
|
35
|
+
}
|