@riil-frontend/component-topology 6.0.0-alpha.3 → 6.0.0-alpha.31
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/EditorPlugin.js +2 -1
- package/es/core/editor/components/Sidebar/Sidebar.js +41 -50
- package/es/core/editor/components/Sidebar/panes.js +32 -0
- package/es/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.js +95 -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 +3 -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 +21 -18
- package/es/core/editor/components/Toolbar/hooks/useFontStyleSetting.js +52 -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 +96 -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 +74 -6
- package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +40 -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/FontStyleButton.js +82 -33
- 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 +110 -22
- package/es/core/editor/components/Toolbar/widgets/NodeAlignWidget.module.scss +28 -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 +97 -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 +17 -1
- package/es/core/editor/components/Toolbar/widgets/components/DropdownMenu.js +8 -5
- package/es/core/editor/components/settings/CloseablePanel.js +33 -0
- package/es/core/editor/components/settings/CloseablePanel.module.scss +9 -0
- package/es/core/editor/components/settings/OpenPropertyPanelListener.js +33 -0
- package/es/core/editor/components/settings/PropertyView.js +26 -11
- 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 -72
- 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/edge/CommonEdgePropertyView.js +7 -1
- 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/editor/utils/textStyleUtil.js +0 -0
- package/es/core/hooks/useCanvasTheme.js +35 -0
- package/es/core/hooks/usePolling.js +2 -5
- package/es/core/hooks/useTopoEdit.js +38 -58
- package/es/core/models/Alarm.js +2 -2
- package/es/core/models/AttributeMetricDisplay.js +4 -0
- 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/htElementUtils.js +3 -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/EditorPlugin.js +3 -1
- package/lib/core/editor/components/Sidebar/Sidebar.js +40 -53
- package/lib/core/editor/components/Sidebar/panes.js +45 -0
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.js +108 -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 +4 -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 +22 -20
- package/lib/core/editor/components/Toolbar/hooks/useFontStyleSetting.js +64 -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 +98 -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 +76 -5
- package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +44 -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/FontStyleButton.js +88 -33
- 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 +113 -22
- package/lib/core/editor/components/Toolbar/widgets/NodeAlignWidget.module.scss +28 -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 +98 -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 +16 -1
- package/lib/core/editor/components/Toolbar/widgets/components/DropdownMenu.js +10 -5
- package/lib/core/editor/components/settings/CloseablePanel.js +46 -0
- package/lib/core/editor/components/settings/CloseablePanel.module.scss +9 -0
- package/lib/core/editor/components/settings/OpenPropertyPanelListener.js +43 -0
- package/lib/core/editor/components/settings/PropertyView.js +29 -11
- 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 -80
- 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/edge/CommonEdgePropertyView.js +7 -1
- 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/editor/utils/textStyleUtil.js +1 -0
- package/lib/core/hooks/useCanvasTheme.js +49 -0
- package/lib/core/hooks/usePolling.js +2 -5
- package/lib/core/hooks/useTopoEdit.js +39 -60
- package/lib/core/models/Alarm.js +2 -2
- package/lib/core/models/AttributeMetricDisplay.js +4 -0
- 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/htElementUtils.js +5 -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
@@ -0,0 +1,10 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<svg width="46px" height="46px" viewBox="0 0 46 46" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
3
|
+
<!-- Generator: Sketch 63.1 (92452) - https://sketch.com -->
|
4
|
+
<title>均衡布局</title>
|
5
|
+
<desc>Created with Sketch.</desc>
|
6
|
+
<g id="均衡布局" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
7
|
+
<path d="M22.6470588,34.6470588 C25.4084826,34.6470588 27.6470588,36.8856351 27.6470588,39.6470588 C27.6470588,42.4084826 25.4084826,44.6470588 22.6470588,44.6470588 C19.8856351,44.6470588 17.6470588,42.4084826 17.6470588,39.6470588 C17.6470588,36.8856351 19.8856351,34.6470588 22.6470588,34.6470588 Z M5.70588235,17.6470588 C8.4673061,17.6470588 10.7058824,19.8856351 10.7058824,22.6470588 C10.7058824,25.4084826 8.4673061,27.6470588 5.70588235,27.6470588 C2.9444586,27.6470588 0.705882353,25.4084826 0.705882353,22.6470588 C0.705882353,19.8856351 2.9444586,17.6470588 5.70588235,17.6470588 Z M40.7058824,17.6470588 C43.4673061,17.6470588 45.7058824,19.8856351 45.7058824,22.6470588 C45.7058824,25.4084826 43.4673061,27.6470588 40.7058824,27.6470588 C37.9444586,27.6470588 35.7058824,25.4084826 35.7058824,22.6470588 C35.7058824,19.8856351 37.9444586,17.6470588 40.7058824,17.6470588 Z M22.6470588,0.647058824 C25.4084826,0.647058824 27.6470588,2.88563507 27.6470588,5.64705882 C27.6470588,8.40848257 25.4084826,10.6470588 22.6470588,10.6470588 C19.8856351,10.6470588 17.6470588,8.40848257 17.6470588,5.64705882 C17.6470588,2.88563507 19.8856351,0.647058824 22.6470588,0.647058824 Z" id="形状结合" fill="#DAE4F0"></path>
|
8
|
+
<path d="M22.5,-1.95399252e-13 C25.5375661,-1.95399252e-13 28,2.46243388 28,5.5 C28,6.6576632 27.6423341,7.73178905 27.0314769,8.61790293 L36.82321,18.4095545 C37.7974662,17.5332483 39.0864597,17 40.5,17 C43.5375661,17 46,19.4624339 46,22.5 C46,25.5375661 43.5375661,28 40.5,28 C39.1265414,28 37.8706666,27.496564 36.9068415,26.6641581 L27.0950015,36.4763101 C27.6670566,37.3438891 28,38.383063 28,39.5 C28,42.5375661 25.5375661,45 22.5,45 C19.4624339,45 17,42.5375661 17,39.5 C17,38.3423368 17.3576659,37.268211 17.9685231,36.3820971 L8.61790293,27.0314769 C7.73178905,27.6423341 6.6576632,28 5.5,28 C2.46243388,28 -1.95399252e-13,25.5375661 -1.95399252e-13,22.5 C-1.95399252e-13,19.4624339 2.46243388,17 5.5,17 C6.72377407,17 7.85419719,17.3996829 8.7678544,18.0756338 L18.0756338,8.7678544 C17.3996829,7.85419719 17,6.72377407 17,5.5 C17,2.46243388 19.4624339,-1.95399252e-13 22.5,-1.95399252e-13 Z M22.5,35.6041667 C20.3483907,35.6041667 18.6041667,37.3483907 18.6041667,39.5 C18.6041667,41.6516093 20.3483907,43.3958333 22.5,43.3958333 C24.6516093,43.3958333 26.3958333,41.6516093 26.3958333,39.5 C26.3958333,37.3483907 24.6516093,35.6041667 22.5,35.6041667 Z M35.1000174,23.5495069 L35.1,23.6 L23.5991458,23.5991458 L23.6003788,34.1100968 C24.3749969,34.267393 25.0904894,34.587488 25.7095864,35.0331117 L35.6483634,25.0929707 C35.3929942,24.6161549 35.2058615,24.0973163 35.1000174,23.5495069 Z M21.5991458,23.5991458 L10.8899032,23.6003788 C10.7403134,24.3370463 10.4434859,25.0202397 10.0314769,25.6179029 L19.3820971,34.9685231 C20.0336191,34.5193857 20.7867811,34.2071244 21.6000562,34.0732662 L21.5991458,23.5991458 Z M5.5,18.6041667 C3.34839066,18.6041667 1.60416667,20.3483907 1.60416667,22.5 C1.60416667,24.6516093 3.34839066,26.3958333 5.5,26.3958333 C7.65160934,26.3958333 9.39583333,24.6516093 9.39583333,22.5 C9.39583333,20.3483907 7.65160934,18.6041667 5.5,18.6041667 Z M40.5,18.6041667 C38.3483907,18.6041667 36.6041667,20.3483907 36.6041667,22.5 C36.6041667,24.6516093 38.3483907,26.3958333 40.5,26.3958333 C42.6516093,26.3958333 44.3958333,24.6516093 44.3958333,22.5 C44.3958333,20.3483907 42.6516093,18.6041667 40.5,18.6041667 Z M19.5370645,10.1344901 L10.1344901,19.5370645 C10.5284431,20.1519899 10.8033617,20.8504912 10.9267338,21.6000562 L21.5991458,21.5991458 L21.6000562,10.9267338 C20.8504912,10.8033617 20.1519899,10.5284431 19.5370645,10.1344901 Z M23.6003788,10.8899032 L23.5991458,21.5991458 L35.0732662,21.6000562 C35.1660269,21.0364754 35.3444596,20.5017619 35.5947453,20.0097351 L25.6179029,10.0314769 C25.0202397,10.4434859 24.3370463,10.7403134 23.6003788,10.8899032 Z M22.5,1.60416667 C20.3483907,1.60416667 18.6041667,3.34839066 18.6041667,5.5 C18.6041667,7.65160934 20.3483907,9.39583333 22.5,9.39583333 C24.6516093,9.39583333 26.3958333,7.65160934 26.3958333,5.5 C26.3958333,3.34839066 24.6516093,1.60416667 22.5,1.60416667 Z" id="形状结合" fill="#BACCE7"></path>
|
9
|
+
</g>
|
10
|
+
</svg>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<svg width="30px" height="30px" viewBox="0 0 30 30" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
3
|
+
<title>topo/source/layout/Icon/分层排布</title>
|
4
|
+
<g id="topo/source/layout/Icon/分层排布" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
5
|
+
<g id="矩形布局" transform="translate(0.000000, 11.428571)" fill-rule="nonzero">
|
6
|
+
<path d="M3.57142857,0.714285714 C5.149385,0.714285714 6.42857143,1.99347214 6.42857143,3.57142857 C6.42857143,5.149385 5.149385,6.42857143 3.57142857,6.42857143 C1.99347214,6.42857143 0.714285714,5.149385 0.714285714,3.57142857 C0.714285714,1.99347214 1.99347214,0.714285714 3.57142857,0.714285714 Z M26.4285714,0.714285714 C28.0065279,0.714285714 29.2857143,1.99347214 29.2857143,3.57142857 C29.2857143,5.149385 28.0065279,6.42857143 26.4285714,6.42857143 C24.850615,6.42857143 23.5714286,5.149385 23.5714286,3.57142857 C23.5714286,1.99347214 24.850615,0.714285714 26.4285714,0.714285714 Z" id="形状" fill="#DAE4F0"></path>
|
7
|
+
<path d="M3.57142857,0 C5.54387411,0 7.14285714,1.59898307 7.14285714,3.57142857 C7.14285714,5.54387407 5.54387411,7.14285714 3.57142857,7.14285714 C1.59898304,7.14285714 0,5.54387407 0,3.57142857 C0,1.59898307 1.59898304,0 3.57142857,0 Z M15,0 C16.9724455,0 18.5714286,1.59898307 18.5714286,3.57142857 C18.5714286,5.54387407 16.9724455,7.14285714 15,7.14285714 C13.0275545,7.14285714 11.4285714,5.54387407 11.4285714,3.57142857 C11.4285714,1.59898307 13.0275545,0 15,0 Z M26.4285714,0 C28.4010169,0 30,1.59898307 30,3.57142857 C30,5.54387407 28.4010169,7.14285714 26.4285714,7.14285714 C24.4561259,7.14285714 22.8571429,5.54387407 22.8571429,3.57142857 C22.8571429,1.59898307 24.4561259,0 26.4285714,0 Z M3.57142857,1.04166664 C2.17427965,1.04166664 1.04166666,2.17427964 1.04166666,3.57142857 C1.04166666,4.9685775 2.17427965,6.1011905 3.57142857,6.1011905 C4.96857749,6.1011905 6.1011905,4.9685775 6.1011905,3.57142857 C6.1011905,2.17427964 4.96857749,1.04166664 3.57142857,1.04166664 Z M15,1.04166664 C13.6028511,1.04166664 12.4702381,2.17427964 12.4702381,3.57142857 C12.4702381,4.9685775 13.6028511,6.1011905 15,6.1011905 C16.3971489,6.1011905 17.5297619,4.9685775 17.5297619,3.57142857 C17.5297619,2.17427964 16.3971489,1.04166664 15,1.04166664 Z M26.4285714,1.04166664 C25.0314225,1.04166664 23.8988095,2.17427964 23.8988095,3.57142857 C23.8988095,4.9685775 25.0314225,6.1011905 26.4285714,6.1011905 C27.8257204,6.1011905 28.9583334,4.9685775 28.9583334,3.57142857 C28.9583334,2.17427964 27.8257204,1.04166664 26.4285714,1.04166664 Z" id="形状" fill="#BACCE7"></path>
|
8
|
+
</g>
|
9
|
+
<polygon id="直线" fill="#BACCE7" fill-rule="nonzero" points="30 2 30 5 0 5 0 2"></polygon>
|
10
|
+
<polygon id="直线备份" fill="#BACCE7" fill-rule="nonzero" points="30 25 30 28 0 28 0 25"></polygon>
|
11
|
+
</g>
|
12
|
+
</svg>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<svg width="46px" height="46px" viewBox="0 0 46 46" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
3
|
+
<!-- Generator: Sketch 63.1 (92452) - https://sketch.com -->
|
4
|
+
<title>树形布局</title>
|
5
|
+
<desc>Created with Sketch.</desc>
|
6
|
+
<g id="树形布局" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
7
|
+
<circle id="椭圆形" fill="#DAE4F0" cx="11" cy="23" r="4"></circle>
|
8
|
+
<circle id="椭圆形备份" fill="#DAE4F0" cx="35" cy="23" r="4"></circle>
|
9
|
+
<circle id="椭圆形备份-2" fill="#DAE4F0" cx="41" cy="40" r="4"></circle>
|
10
|
+
<circle id="椭圆形备份-3" fill="#DAE4F0" cx="29" cy="40" r="4"></circle>
|
11
|
+
<circle id="椭圆形备份-4" fill="#DAE4F0" cx="17" cy="40" r="4"></circle>
|
12
|
+
<circle id="椭圆形备份-5" fill="#DAE4F0" cx="5" cy="40" r="4"></circle>
|
13
|
+
<path d="M37.470512,26.076139 L41.5378785,35.2115936 L39.7107875,36.0250669 L35.6434211,26.8896123 L37.470512,26.076139 Z M13.0270909,26.076139 L17.0944573,35.2115936 L15.2673664,36.0250669 L11.2,26.8896123 L13.0270909,26.076139 Z M8.66045376,26.1182616 L10.4580419,26.9950039 L6.07433039,35.9829444 L4.27674229,35.1062021 L8.66045376,26.1182616 Z M33.0837115,26.1182616 L34.8812996,26.9950039 L30.4975881,35.9829444 L28.7,35.1062021 L33.0837115,26.1182616 Z M20.5096741,8.18361912 L22.0190933,9.49573718 L13.0067139,19.8172607 L11.3248477,18.7495532 L20.5096741,8.18361912 Z M25.9958912,8.18361912 L35,18.5136719 L33.0152395,19.3069617 L24.4864721,9.49573718 L25.9958912,8.18361912 Z" id="形状结合" fill="#BACCE7"></path>
|
14
|
+
<path d="M41,35 C43.7614237,35 46,37.2385763 46,40 C46,42.7614237 43.7614237,45 41,45 C38.2385763,45 36,42.7614237 36,40 C36,37.2385763 38.2385763,35 41,35 Z M29,35 C31.7614237,35 34,37.2385763 34,40 C34,42.7614237 31.7614237,45 29,45 C26.2385763,45 24,42.7614237 24,40 C24,37.2385763 26.2385763,35 29,35 Z M5,35 C7.76142375,35 10,37.2385763 10,40 C10,42.7614237 7.76142375,45 5,45 C2.23857625,45 -1.5187851e-13,42.7614237 -1.5187851e-13,40 C-1.5187851e-13,37.2385763 2.23857625,35 5,35 Z M17,35 C19.7614237,35 22,37.2385763 22,40 C22,42.7614237 19.7614237,45 17,45 C14.2385763,45 12,42.7614237 12,40 C12,37.2385763 14.2385763,35 17,35 Z M41,36.4583333 C39.0439915,36.4583333 37.4583333,38.0439915 37.4583333,40 C37.4583333,41.9560085 39.0439915,43.5416667 41,43.5416667 C42.9560085,43.5416667 44.5416667,41.9560085 44.5416667,40 C44.5416667,38.0439915 42.9560085,36.4583333 41,36.4583333 Z M29,36.4583333 C27.0439915,36.4583333 25.4583333,38.0439915 25.4583333,40 C25.4583333,41.9560085 27.0439915,43.5416667 29,43.5416667 C30.9560085,43.5416667 32.5416667,41.9560085 32.5416667,40 C32.5416667,38.0439915 30.9560085,36.4583333 29,36.4583333 Z M5,36.4583333 C3.04399151,36.4583333 1.45833333,38.0439915 1.45833333,40 C1.45833333,41.9560085 3.04399151,43.5416667 5,43.5416667 C6.95600849,43.5416667 8.54166667,41.9560085 8.54166667,40 C8.54166667,38.0439915 6.95600849,36.4583333 5,36.4583333 Z M17,36.4583333 C15.0439915,36.4583333 13.4583333,38.0439915 13.4583333,40 C13.4583333,41.9560085 15.0439915,43.5416667 17,43.5416667 C18.9560085,43.5416667 20.5416667,41.9560085 20.5416667,40 C20.5416667,38.0439915 18.9560085,36.4583333 17,36.4583333 Z M11,18 C13.7614237,18 16,20.2385763 16,23 C16,25.7614237 13.7614237,28 11,28 C8.23857625,28 6,25.7614237 6,23 C6,20.2385763 8.23857625,18 11,18 Z M35,18 C37.7614237,18 40,20.2385763 40,23 C40,25.7614237 37.7614237,28 35,28 C32.2385763,28 30,25.7614237 30,23 C30,20.2385763 32.2385763,18 35,18 Z M11,19.4583333 C9.04399151,19.4583333 7.45833333,21.0439915 7.45833333,23 C7.45833333,24.9560085 9.04399151,26.5416667 11,26.5416667 C12.9560085,26.5416667 14.5416667,24.9560085 14.5416667,23 C14.5416667,21.0439915 12.9560085,19.4583333 11,19.4583333 Z M35,19.4583333 C33.0439915,19.4583333 31.4583333,21.0439915 31.4583333,23 C31.4583333,24.9560085 33.0439915,26.5416667 35,26.5416667 C36.9560085,26.5416667 38.5416667,24.9560085 38.5416667,23 C38.5416667,21.0439915 36.9560085,19.4583333 35,19.4583333 Z M23,-1.5187851e-13 C25.7614237,-1.5187851e-13 28,2.23857625 28,5 C28,7.76142375 25.7614237,10 23,10 C20.2385763,10 18,7.76142375 18,5 C18,2.23857625 20.2385763,-1.5187851e-13 23,-1.5187851e-13 Z M23,1.45833333 C21.0439915,1.45833333 19.4583333,3.04399151 19.4583333,5 C19.4583333,6.95600849 21.0439915,8.54166667 23,8.54166667 C24.9560085,8.54166667 26.5416667,6.95600849 26.5416667,5 C26.5416667,3.04399151 24.9560085,1.45833333 23,1.45833333 Z" id="形状结合" fill="#BACCE7"></path>
|
15
|
+
</g>
|
16
|
+
</svg>
|
package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/index.js
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
3
|
+
var _excluded = ["className", "children", "icon", "img", "iconClassName", "textClassName"];
|
4
|
+
import React from 'react';
|
5
|
+
import classnames from 'classnames';
|
6
|
+
import Icon from "./Icon";
|
7
|
+
import styles from "./index.module.scss";
|
8
|
+
|
9
|
+
var TemplateButton = function TemplateButton(props) {
|
10
|
+
var className = props.className,
|
11
|
+
children = props.children,
|
12
|
+
icon = props.icon,
|
13
|
+
img = props.img,
|
14
|
+
iconClassName = props.iconClassName,
|
15
|
+
textClassName = props.textClassName,
|
16
|
+
rest = _objectWithoutPropertiesLoose(props, _excluded);
|
17
|
+
|
18
|
+
return /*#__PURE__*/React.createElement("div", {
|
19
|
+
className: classnames(styles.card, className)
|
20
|
+
}, /*#__PURE__*/React.createElement("div", {
|
21
|
+
className: styles.iconWrapper
|
22
|
+
}, /*#__PURE__*/React.createElement(Icon, _extends({
|
23
|
+
className: classnames(styles.icon, iconClassName),
|
24
|
+
img: img,
|
25
|
+
type: icon
|
26
|
+
}, rest))), /*#__PURE__*/React.createElement("div", {
|
27
|
+
className: classnames(styles.text, textClassName)
|
28
|
+
}, /*#__PURE__*/React.createElement("span", null, children)));
|
29
|
+
};
|
30
|
+
|
31
|
+
export default TemplateButton;
|
@@ -0,0 +1,53 @@
|
|
1
|
+
@import "@alifd/next/variables";
|
2
|
+
|
3
|
+
.card {
|
4
|
+
display: flex;
|
5
|
+
flex-direction: column;
|
6
|
+
width: 100%;
|
7
|
+
height: 100%;
|
8
|
+
border: none;
|
9
|
+
padding-top: 6px;
|
10
|
+
cursor: pointer;
|
11
|
+
}
|
12
|
+
|
13
|
+
.iconWrapper {
|
14
|
+
display: flex;
|
15
|
+
justify-content: center;
|
16
|
+
align-items: center;
|
17
|
+
user-select: none;
|
18
|
+
}
|
19
|
+
|
20
|
+
.icon {
|
21
|
+
width: 120px;
|
22
|
+
}
|
23
|
+
|
24
|
+
.text {
|
25
|
+
height: 20px;
|
26
|
+
line-height: 20px;
|
27
|
+
font-size: 18px;
|
28
|
+
margin-top: 14px;
|
29
|
+
color: $color-text1-3;
|
30
|
+
outline: none;
|
31
|
+
}
|
32
|
+
|
33
|
+
.group-layout-set-card {
|
34
|
+
display: flex;
|
35
|
+
flex-direction: column;
|
36
|
+
width: 55px;
|
37
|
+
height: 60px;
|
38
|
+
border: none;
|
39
|
+
padding-top: 6px;
|
40
|
+
cursor: pointer;
|
41
|
+
}
|
42
|
+
.group-layout-set-icon {
|
43
|
+
width: 30px;
|
44
|
+
}
|
45
|
+
.group-layout-set-text {
|
46
|
+
width: 55px;
|
47
|
+
height: 12px;
|
48
|
+
line-height: 12px;
|
49
|
+
font-size: 12px;
|
50
|
+
margin-top: 8px;
|
51
|
+
color: $color-text1-3;
|
52
|
+
outline: none;
|
53
|
+
}
|
@@ -1,28 +1,141 @@
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
1
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
import
|
3
|
+
var _excluded = ["topo", "showLabel"];
|
4
|
+
|
5
|
+
/* eslint-disable eqeqeq */
|
6
|
+
import React, { useState, useMemo } from 'react';
|
7
|
+
import LayoutSettings from "./components/LayoutSettings";
|
6
8
|
import WidgetBox from "../WidgetBox";
|
9
|
+
import DropdownButton from "../components/DropdownButton";
|
10
|
+
import { isGroup, isLayer } from "../../../../../../utils/htElementUtils";
|
7
11
|
|
8
12
|
function Layout(props) {
|
9
|
-
var topo = props.topo
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
13
|
+
var topo = props.topo,
|
14
|
+
topoShowType = props.topoShowType;
|
15
|
+
|
16
|
+
var _useState = useState(),
|
17
|
+
layout = _useState[0],
|
18
|
+
setLayout = _useState[1]; // 选中的元素
|
19
|
+
|
20
|
+
|
21
|
+
var selectionElements = topo.selectionManager.useHtSelection();
|
22
|
+
|
23
|
+
var _topo$store$useModelS = topo.store.useModelState('selection'),
|
24
|
+
selection = _topo$store$useModelS.selection;
|
25
|
+
|
26
|
+
var setDisabled = function setDisabled(data) {
|
27
|
+
if (topoShowType == 'layers' && selection.length == 1) {
|
28
|
+
return data != 'rectangle';
|
29
|
+
} else {
|
30
|
+
return data == 'rectangle';
|
31
|
+
}
|
32
|
+
};
|
33
|
+
|
34
|
+
var globalLayout = function globalLayout(data) {
|
35
|
+
var firstElement = selectionElements[0];
|
36
|
+
var layouType = data.id === 'toward' ? "" + data.id + data.options.subId : data.id; // eslint-disable-next-line eqeqeq
|
37
|
+
|
38
|
+
if (topoShowType != 'layers' && selection.length == 0) {
|
39
|
+
topo.getHtTopo().layoutInTopo(layouType);
|
40
|
+
} // eslint-disable-next-line eqeqeq
|
41
|
+
|
42
|
+
|
43
|
+
if (topoShowType != 'layers' && selection.length == 1) {
|
44
|
+
topo.getHtTopo().layoutInContainer(layouType);
|
45
|
+
} // eslint-disable-next-line eqeqeq
|
46
|
+
|
47
|
+
|
48
|
+
if (isLayer(firstElement)) {
|
49
|
+
topo.getHtTopo().layoutLayer(firstElement);
|
50
|
+
}
|
51
|
+
};
|
52
|
+
|
53
|
+
var layoutOnChange = function layoutOnChange(v) {
|
54
|
+
var _selection$;
|
55
|
+
|
56
|
+
topo.historyManager.beginTransaction();
|
57
|
+
setLayout(v); // eslint-disable-next-line eqeqeq
|
58
|
+
|
59
|
+
if (topoShowType != 'layers' && ((_selection$ = selection[0]) === null || _selection$ === void 0 ? void 0 : _selection$.className) != 'ht.Node' || topoShowType == 'partition' && selection.length == 1 || topoShowType == 'layers' && selection.length == 1) {
|
60
|
+
globalLayout(v);
|
61
|
+
}
|
62
|
+
|
63
|
+
topo.historyManager.endTransaction();
|
64
|
+
};
|
65
|
+
|
66
|
+
return (
|
67
|
+
/*#__PURE__*/
|
68
|
+
// <LayoutSettings size="xs" selection = {selection} topoShowType={topoShowType} layout={layout} onChange={layoutOnChange} />
|
69
|
+
React.createElement(LayoutSettings, {
|
70
|
+
size: "xs",
|
71
|
+
layout: layout,
|
72
|
+
onChange: layoutOnChange,
|
73
|
+
disabled: setDisabled
|
14
74
|
})
|
15
|
-
|
75
|
+
);
|
16
76
|
}
|
17
77
|
|
18
78
|
function LayoutWidget(props) {
|
19
|
-
var
|
20
|
-
|
79
|
+
var topo = props.topo,
|
80
|
+
showLabel = props.showLabel,
|
81
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded); // eslint-disable-next-line no-undef
|
82
|
+
|
83
|
+
|
84
|
+
var store = topo.store; // 拓扑图是否加载
|
21
85
|
|
86
|
+
var topoState = store.useModelState('topoMod'); // 分层或分区时候选中的值,未选中length为0 配合下面的type属性一起使用,
|
87
|
+
// type为partition且selection.length>=0时可以点击布局, selection[0].className != 'ht.Node'
|
88
|
+
// type为auto且selection.length==0时可以点击布局
|
89
|
+
|
90
|
+
var selectionElements = topo.selectionManager.useHtSelection();
|
91
|
+
var topoShowType = topoState.type; // 获取ID以及拓扑类型 // 拓扑类型:auto自由布局,layers分层,partition分区
|
92
|
+
|
93
|
+
var disabled = useMemo(function () {
|
94
|
+
return !isLayoutEnabled({
|
95
|
+
topoShowType: topoShowType,
|
96
|
+
selectionElements: selectionElements
|
97
|
+
});
|
98
|
+
}, [topoShowType, selectionElements]);
|
99
|
+
var icon = disabled ? /*#__PURE__*/React.createElement("img", {
|
100
|
+
src: "/img/topo/editor/toolbar/layout/Disable.svg",
|
101
|
+
alt: ""
|
102
|
+
}) : /*#__PURE__*/React.createElement("img", {
|
103
|
+
src: "/img/topo/editor/toolbar/layout/Normal.svg",
|
104
|
+
alt: ""
|
105
|
+
});
|
22
106
|
return /*#__PURE__*/React.createElement(WidgetBox, {
|
23
|
-
label: "\u5E03\u5C40",
|
24
|
-
|
25
|
-
|
107
|
+
label: "\u5E03\u5C40\u65B9\u5F0F",
|
108
|
+
tooltip: "\u5E03\u5C40\u65B9\u5F0F",
|
109
|
+
showLabel: showLabel,
|
110
|
+
disabled: disabled
|
111
|
+
}, /*#__PURE__*/React.createElement(DropdownButton, {
|
112
|
+
disabled: disabled,
|
113
|
+
trigger: icon
|
114
|
+
}, !disabled && /*#__PURE__*/React.createElement(Layout, _extends({
|
115
|
+
topo: topo,
|
116
|
+
topoShowType: topoShowType
|
117
|
+
}, otherProps))));
|
118
|
+
}
|
119
|
+
|
120
|
+
function isLayoutEnabled(props) {
|
121
|
+
var topoShowType = props.topoShowType,
|
122
|
+
selectionElements = props.selectionElements; // 选中单个区域/集群后,该按钮亮起
|
123
|
+
|
124
|
+
if (isGroup(selectionElements[0])) {
|
125
|
+
return true;
|
126
|
+
} // 分层拓扑选中任意分层时,布局按钮亮起
|
127
|
+
|
128
|
+
|
129
|
+
if (topoShowType === 'layers' && selectionElements.length === 1 && isLayer(selectionElements[0])) {
|
130
|
+
return true;
|
131
|
+
} // 空白拓扑未选中任何资源时,布局按钮亮起
|
132
|
+
|
133
|
+
|
134
|
+
if (topoShowType !== 'layers' && !selectionElements.length) {
|
135
|
+
return true;
|
136
|
+
}
|
137
|
+
|
138
|
+
return false;
|
26
139
|
}
|
27
140
|
|
28
141
|
export default LayoutWidget;
|
@@ -1,24 +1,12 @@
|
|
1
|
-
import
|
1
|
+
import _NumberPicker from "@alifd/next/es/number-picker";
|
2
2
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
3
3
|
var _excluded = ["topo", "showLabel"];
|
4
4
|
import React, { useState, useEffect } from 'react';
|
5
5
|
import WidgetBox from "./WidgetBox";
|
6
6
|
import DropdownButton from "./components/DropdownButton";
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
disabled = props.disabled;
|
11
|
-
var icon = disabled ? /*#__PURE__*/React.createElement("img", {
|
12
|
-
src: "/img/topo/editor/toolbar/\u5BF9\u9F50/Disable.svg",
|
13
|
-
alt: ""
|
14
|
-
}) : /*#__PURE__*/React.createElement("img", {
|
15
|
-
src: "/img/topo/editor/toolbar/\u5BF9\u9F50/Normal.svg",
|
16
|
-
alt: ""
|
17
|
-
});
|
18
|
-
return /*#__PURE__*/React.createElement(DropdownButton, {
|
19
|
-
trigger: icon
|
20
|
-
}, "\u5BF9\u9F50\u65B9\u5F0F");
|
21
|
-
}
|
7
|
+
import AlignSetting from "../../settings/common/AlignSetting";
|
8
|
+
import { isEdge, isLayer } from "../../../../../utils/htElementUtils";
|
9
|
+
import styles from "./NodeAlignWidget.module.scss";
|
22
10
|
|
23
11
|
function NodeAlignWidget(props) {
|
24
12
|
var topo = props.topo,
|
@@ -27,21 +15,121 @@ function NodeAlignWidget(props) {
|
|
27
15
|
|
28
16
|
var _useState = useState(true),
|
29
17
|
disabled = _useState[0],
|
30
|
-
setDisabled = _useState[1];
|
18
|
+
setDisabled = _useState[1];
|
19
|
+
|
20
|
+
var _useState2 = useState(),
|
21
|
+
leftInputVal = _useState2[0],
|
22
|
+
setLeftInputVal = _useState2[1];
|
23
|
+
|
24
|
+
var _useState3 = useState(),
|
25
|
+
rightInputVal = _useState3[0],
|
26
|
+
setRightInputVal = _useState3[1];
|
27
|
+
|
28
|
+
var _useState4 = useState(true),
|
29
|
+
leftDisable = _useState4[0],
|
30
|
+
setLeftDisable = _useState4[1];
|
31
|
+
|
32
|
+
var _useState5 = useState(true),
|
33
|
+
rightDisable = _useState5[0],
|
34
|
+
setRightDisable = _useState5[1]; // 拓扑图是否加载
|
35
|
+
|
36
|
+
|
37
|
+
var _topo$store$useModelS = topo.store.useModelState('topoMod'),
|
38
|
+
graphLoaded = _topo$store$useModelS.graphLoaded; // 选中的元素
|
31
39
|
|
32
40
|
|
33
41
|
var selection = topo.selectionManager.useSelection();
|
42
|
+
|
43
|
+
var setSpace = function setSpace(type, num) {
|
44
|
+
topo.historyManager.beginTransaction();
|
45
|
+
var selection = topo.getHtTopo().getGraphView().getSelectionModel().getSelection().toArray();
|
46
|
+
var nodes = selection.filter(function (ele) {
|
47
|
+
return !isLayer(ele) && !isEdge(ele);
|
48
|
+
});
|
49
|
+
topo.view.topoClient.htTopoClient.setElementsSpace(nodes, type, num);
|
50
|
+
topo.historyManager.endTransaction();
|
51
|
+
};
|
52
|
+
|
53
|
+
var leftInputChange = function leftInputChange(v) {
|
54
|
+
setLeftInputVal(v);
|
55
|
+
setSpace('h', v);
|
56
|
+
};
|
57
|
+
|
58
|
+
var rightInputChange = function rightInputChange(v) {
|
59
|
+
setRightInputVal(v);
|
60
|
+
setSpace('v', v);
|
61
|
+
};
|
62
|
+
|
34
63
|
useEffect(function () {
|
35
|
-
|
36
|
-
|
64
|
+
if (graphLoaded) {
|
65
|
+
var selectionEle = topo.getHtTopo().getGraphView().getSelectionModel().getSelection().toArray();
|
66
|
+
var nodes = selectionEle.filter(function (ele) {
|
67
|
+
return !isLayer(ele) && !isEdge(ele);
|
68
|
+
});
|
69
|
+
setDisabled(nodes.length <= 1);
|
70
|
+
getClickType('none');
|
71
|
+
setLeftInputVal();
|
72
|
+
setRightInputVal();
|
73
|
+
}
|
74
|
+
}, [graphLoaded, selection]);
|
75
|
+
|
76
|
+
var getClickType = function getClickType(type) {
|
77
|
+
if (leftInputVal || rightInputVal) {
|
78
|
+
setLeftInputVal();
|
79
|
+
setRightInputVal();
|
80
|
+
}
|
81
|
+
|
82
|
+
setLeftDisable(true);
|
83
|
+
setRightDisable(true);
|
84
|
+
|
85
|
+
if (type === 'top' || type === 'middle' || type === 'bottom') {
|
86
|
+
setLeftDisable(false);
|
87
|
+
}
|
88
|
+
|
89
|
+
if (type === 'left' || type === 'center' || type === 'right') {
|
90
|
+
setRightDisable(false);
|
91
|
+
}
|
92
|
+
};
|
93
|
+
|
94
|
+
var icon = disabled ? /*#__PURE__*/React.createElement("img", {
|
95
|
+
src: "/img/topo/editor/toolbar/\u5BF9\u9F50/Disable.svg",
|
96
|
+
alt: ""
|
97
|
+
}) : /*#__PURE__*/React.createElement("img", {
|
98
|
+
src: "/img/topo/editor/toolbar/\u5BF9\u9F50/Normal.svg",
|
99
|
+
alt: ""
|
100
|
+
});
|
37
101
|
return /*#__PURE__*/React.createElement(WidgetBox, {
|
38
102
|
showLabel: showLabel,
|
103
|
+
disabled: disabled,
|
39
104
|
label: "\u5BF9\u9F50\u65B9\u5F0F",
|
40
105
|
tooltip: "\u5BF9\u9F50\u65B9\u5F0F"
|
41
|
-
}, /*#__PURE__*/React.createElement(
|
106
|
+
}, /*#__PURE__*/React.createElement(DropdownButton, {
|
42
107
|
disabled: disabled,
|
43
|
-
|
44
|
-
},
|
108
|
+
trigger: icon
|
109
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(AlignSetting, {
|
110
|
+
topo: topo,
|
111
|
+
getClickType: getClickType
|
112
|
+
}), /*#__PURE__*/React.createElement(_NumberPicker, {
|
113
|
+
disabled: leftDisable,
|
114
|
+
size: "small",
|
115
|
+
hasTrigger: false,
|
116
|
+
placeholder: "\u591A\u4E2A\u503C",
|
117
|
+
className: styles.leftInput,
|
118
|
+
value: leftInputVal,
|
119
|
+
min: 0,
|
120
|
+
max: 10000,
|
121
|
+
onChange: leftInputChange
|
122
|
+
}), /*#__PURE__*/React.createElement(_NumberPicker, {
|
123
|
+
disabled: rightDisable,
|
124
|
+
size: "small",
|
125
|
+
hasTrigger: false,
|
126
|
+
placeholder: "\u591A\u4E2A\u503C",
|
127
|
+
className: styles.rightInput,
|
128
|
+
value: rightInputVal,
|
129
|
+
min: 0,
|
130
|
+
max: 10000,
|
131
|
+
onChange: rightInputChange
|
132
|
+
}))));
|
45
133
|
}
|
46
134
|
|
47
135
|
export default NodeAlignWidget;
|
@@ -0,0 +1,28 @@
|
|
1
|
+
.leftInput{
|
2
|
+
width: 100px !important;
|
3
|
+
margin-right: 10px;
|
4
|
+
margin-left: 5px;
|
5
|
+
:global{
|
6
|
+
input{
|
7
|
+
background: url('/img/topo/editor/toolbar/对齐/水平间距_normal.svg')no-repeat 5px center !important;
|
8
|
+
background-position: right center !important;
|
9
|
+
}
|
10
|
+
.next-disabled input{
|
11
|
+
background: url('/img/topo/editor/toolbar/对齐/水平间距_disable.svg')no-repeat 5px center !important;
|
12
|
+
background-position: right center !important;
|
13
|
+
}
|
14
|
+
}
|
15
|
+
}
|
16
|
+
.rightInput{
|
17
|
+
width: 100px !important;
|
18
|
+
:global{
|
19
|
+
input{
|
20
|
+
background: url('/img/topo/editor/toolbar/对齐/垂直间距 _normal.svg')no-repeat 5px center !important;
|
21
|
+
background-position: right center !important;
|
22
|
+
}
|
23
|
+
.next-disabled input{
|
24
|
+
background: url('/img/topo/editor/toolbar/对齐/垂直间距_disable.svg')no-repeat 5px center !important;
|
25
|
+
background-position: right center !important;
|
26
|
+
}
|
27
|
+
}
|
28
|
+
}
|
@@ -1,8 +1,18 @@
|
|
1
|
-
import React from
|
1
|
+
import React, { useEffect, useState, forwardRef, useImperativeHandle } from "react";
|
2
|
+
import TopoIconSelect from "../IconSelect";
|
3
|
+
import { useNodeIcons } from "../../../../../common/icons/useIcons";
|
2
4
|
|
3
|
-
function
|
4
|
-
|
5
|
-
|
5
|
+
function NodeImageList(props, ref) {
|
6
|
+
var value = props.value,
|
7
|
+
onChange = props.onChange,
|
8
|
+
topo = props.topo;
|
9
|
+
useEffect(function () {}, []);
|
10
|
+
var icons = useNodeIcons(topo);
|
11
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(TopoIconSelect, {
|
12
|
+
value: value,
|
13
|
+
iconList: icons,
|
14
|
+
onChange: onChange
|
15
|
+
}));
|
6
16
|
}
|
7
17
|
|
8
|
-
export default
|
18
|
+
export default NodeImageList;
|
@@ -1,13 +1,14 @@
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
2
2
|
var _excluded = ["topo", "showLabel"];
|
3
|
-
import React, { useEffect, useState } from
|
3
|
+
import React, { useEffect, useState } from "react";
|
4
|
+
import { isGroup, isNode } from "../../../../../../utils/htElementUtils";
|
4
5
|
import DropdownButton from "../components/DropdownButton";
|
5
6
|
import WidgetBox from "../WidgetBox";
|
6
7
|
import BoxBackgroundSetting from "./BoxBackgroundSetting";
|
7
8
|
/**
|
8
9
|
* 替换图片设置
|
9
|
-
* @param {*} props
|
10
|
-
* @returns
|
10
|
+
* @param {*} props
|
11
|
+
* @returns
|
11
12
|
*/
|
12
13
|
|
13
14
|
function NodeImageButton(props) {
|
@@ -17,13 +18,43 @@ function NodeImageButton(props) {
|
|
17
18
|
|
18
19
|
var _useState = useState(true),
|
19
20
|
disabled = _useState[0],
|
20
|
-
setDisabled = _useState[1];
|
21
|
+
setDisabled = _useState[1];
|
21
22
|
|
23
|
+
var _useState2 = useState(),
|
24
|
+
imgVal = _useState2[0],
|
25
|
+
setImgVal = _useState2[1]; // 选中的元素
|
22
26
|
|
23
|
-
|
27
|
+
|
28
|
+
var selection = topo.selectionManager.useHtSelection();
|
24
29
|
useEffect(function () {
|
25
|
-
|
30
|
+
var nodes = selection.filter(function (ele) {
|
31
|
+
return isGroup(ele) || isNode(ele);
|
32
|
+
});
|
33
|
+
|
34
|
+
if (nodes.length > 0) {
|
35
|
+
setDisabled(false);
|
36
|
+
setImgVal(nodes[0].getImage());
|
37
|
+
} else {
|
38
|
+
setDisabled(true);
|
39
|
+
}
|
26
40
|
}, [selection]);
|
41
|
+
|
42
|
+
var onChange = function onChange(prop) {
|
43
|
+
console.log("onChange-prop", prop, selection); //const { name, value } = prop;
|
44
|
+
// const gv = topo.view.topoClient.getGraphView();
|
45
|
+
//const element = topo.getSelectionModel().getFirstData();
|
46
|
+
|
47
|
+
var elements = topo.getSelectionModel();
|
48
|
+
console.log("onChange-elements", elements);
|
49
|
+
elements.each(function (element) {
|
50
|
+
element.setImage(prop);
|
51
|
+
}); // selection.map((element) => {
|
52
|
+
// element.setImage(prop);
|
53
|
+
// });
|
54
|
+
// if (name === "image") {
|
55
|
+
// }
|
56
|
+
};
|
57
|
+
|
27
58
|
var icon = disabled ? /*#__PURE__*/React.createElement("img", {
|
28
59
|
src: "/img/topo/editor/toolbar/\u66FF\u6362\u56FE\u7247/Disable.svg",
|
29
60
|
alt: ""
|
@@ -34,12 +65,15 @@ function NodeImageButton(props) {
|
|
34
65
|
return /*#__PURE__*/React.createElement(WidgetBox, {
|
35
66
|
label: "\u66FF\u6362\u56FE\u7247",
|
36
67
|
tooltip: "\u66FF\u6362\u56FE\u7247",
|
68
|
+
disabled: disabled,
|
37
69
|
showLabel: showLabel
|
38
70
|
}, /*#__PURE__*/React.createElement(DropdownButton, {
|
39
71
|
disabled: disabled,
|
40
72
|
trigger: icon
|
41
73
|
}, /*#__PURE__*/React.createElement(BoxBackgroundSetting, {
|
42
|
-
topo: topo
|
74
|
+
topo: topo,
|
75
|
+
onChange: onChange,
|
76
|
+
value: imgVal
|
43
77
|
})));
|
44
78
|
}
|
45
79
|
|