@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
@@ -1,63 +1,50 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
2
|
-
import React, { useState } from 'react';
|
3
|
-
import VerticalIconTab from "../../../../components/VerticalIconTab";
|
4
|
-
import LinkPanel from "./views/LinkPanel";
|
5
|
-
import ComponentPanel from "./views/ComponentPanel";
|
6
|
-
import ImagePanel from "./views/ImagePanel";
|
7
|
-
import BackgroundPanel from "./views/BackgroundPanel";
|
8
|
-
import CanvasPanel from "./views/CanvasPanel";
|
9
|
-
import styles from "./Sidebar.module.scss";
|
2
|
+
import React, { useEffect, useState } from 'react';
|
10
3
|
import classNames from 'classnames';
|
4
|
+
import Tab from "../../../../components/VerticalIconTab";
|
5
|
+
import panes from "./panes";
|
6
|
+
import styles from "./Sidebar.module.scss";
|
11
7
|
|
12
8
|
function Sidebar(props) {
|
13
9
|
var _classNames;
|
14
10
|
|
15
11
|
var topo = props.topo;
|
16
12
|
|
17
|
-
var
|
18
|
-
|
19
|
-
|
13
|
+
var _topo$store$useModel = topo.store.useModel('topoEdit'),
|
14
|
+
topoEditState = _topo$store$useModel[0],
|
15
|
+
topoEditDispatchers = _topo$store$useModel[1];
|
16
|
+
|
17
|
+
var activeKey = topoEditState.resourceTabActiveKey; // 拓扑图是否加载
|
18
|
+
|
19
|
+
var _topo$store$useModelS = topo.store.useModelState('topoMod'),
|
20
|
+
graphLoaded = _topo$store$useModelS.graphLoaded;
|
21
|
+
|
22
|
+
useEffect(function () {
|
23
|
+
return function () {
|
24
|
+
// 退出编辑模式,关闭资源面板状态
|
25
|
+
topoEditDispatchers.update({
|
26
|
+
resourceTabActiveKey: null
|
27
|
+
});
|
28
|
+
};
|
29
|
+
}, []); // 通过url参数打开对应面板
|
30
|
+
|
31
|
+
useEffect(function () {
|
32
|
+
var _topo$viewProps$urlPa;
|
33
|
+
|
34
|
+
if (graphLoaded && (_topo$viewProps$urlPa = topo.viewProps.urlParams) !== null && _topo$viewProps$urlPa !== void 0 && _topo$viewProps$urlPa.resourceTabActiveKey) {
|
35
|
+
setTimeout(function () {
|
36
|
+
var _topo$viewProps$urlPa2;
|
20
37
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
},
|
27
|
-
title: '组件',
|
28
|
-
key: '2',
|
29
|
-
icon: '/img/topo/editor/sidebar/icon/组件.svg',
|
30
|
-
content: ComponentPanel
|
31
|
-
}, {
|
32
|
-
title: '图片',
|
33
|
-
key: '3',
|
34
|
-
icon: '/img/topo/editor/sidebar/icon/图片.svg',
|
35
|
-
content: ImagePanel
|
36
|
-
}, {
|
37
|
-
title: '背景',
|
38
|
-
key: '4',
|
39
|
-
icon: '/img/topo/editor/sidebar/icon/背景.svg',
|
40
|
-
content: BackgroundPanel
|
41
|
-
}, {
|
42
|
-
title: '画布',
|
43
|
-
key: '5',
|
44
|
-
icon: '/img/topo/editor/sidebar/icon/画布.svg',
|
45
|
-
content: CanvasPanel
|
46
|
-
}].map(function (item) {
|
47
|
-
var View = item.content;
|
48
|
-
return _extends({}, item, {
|
49
|
-
content: function content() {
|
50
|
-
return /*#__PURE__*/React.createElement(View, _extends({}, props, {
|
51
|
-
topo: topo,
|
52
|
-
active: activeKey === item.key
|
53
|
-
}));
|
54
|
-
}
|
55
|
-
});
|
56
|
-
});
|
38
|
+
topoEditDispatchers.update({
|
39
|
+
resourceTabActiveKey: ((_topo$viewProps$urlPa2 = topo.viewProps.urlParams) === null || _topo$viewProps$urlPa2 === void 0 ? void 0 : _topo$viewProps$urlPa2.resourceTabActiveKey) || null
|
40
|
+
});
|
41
|
+
}, 2000);
|
42
|
+
}
|
43
|
+
}, [graphLoaded]);
|
57
44
|
|
58
45
|
var renderTabItem = function renderTabItem(pane) {
|
59
46
|
var View = pane.content;
|
60
|
-
return /*#__PURE__*/React.createElement(
|
47
|
+
return /*#__PURE__*/React.createElement(Tab.Item, _extends({
|
61
48
|
key: pane.key
|
62
49
|
}, pane), /*#__PURE__*/React.createElement(View, {
|
63
50
|
topo: topo,
|
@@ -69,9 +56,13 @@ function Sidebar(props) {
|
|
69
56
|
className: styles.sidebar
|
70
57
|
}, /*#__PURE__*/React.createElement("div", {
|
71
58
|
className: classNames(styles.tabsContainer, (_classNames = {}, _classNames[styles.expanded] = !!activeKey, _classNames))
|
72
|
-
}, /*#__PURE__*/React.createElement(
|
59
|
+
}, /*#__PURE__*/React.createElement(Tab, {
|
73
60
|
activeKey: activeKey,
|
74
|
-
onChange:
|
61
|
+
onChange: function onChange(key) {
|
62
|
+
return topoEditDispatchers.update({
|
63
|
+
resourceTabActiveKey: key
|
64
|
+
});
|
65
|
+
}
|
75
66
|
}, panes.map(renderTabItem))));
|
76
67
|
}
|
77
68
|
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import BackgroundPanel from "./views/BackgroundPanel";
|
2
|
+
import CanvasPanel from "./views/CanvasPanel";
|
3
|
+
import ComponentPanel from "./views/ComponentPanel";
|
4
|
+
import ImagePanel from "./views/ImagePanel";
|
5
|
+
import LinkPanel from "./views/LinkPanel";
|
6
|
+
var panes = [{
|
7
|
+
title: '链路',
|
8
|
+
key: '1',
|
9
|
+
icon: '/img/topo/editor/sidebar/icon/链路.svg',
|
10
|
+
content: LinkPanel
|
11
|
+
}, {
|
12
|
+
title: '组件',
|
13
|
+
key: '2',
|
14
|
+
icon: '/img/topo/editor/sidebar/icon/组件.svg',
|
15
|
+
content: ComponentPanel
|
16
|
+
}, {
|
17
|
+
title: '图片',
|
18
|
+
key: '3',
|
19
|
+
icon: '/img/topo/editor/sidebar/icon/图片.svg',
|
20
|
+
content: ImagePanel
|
21
|
+
}, {
|
22
|
+
title: '背景',
|
23
|
+
key: '4',
|
24
|
+
icon: '/img/topo/editor/sidebar/icon/背景.svg',
|
25
|
+
content: BackgroundPanel
|
26
|
+
}, {
|
27
|
+
title: '画布',
|
28
|
+
key: '5',
|
29
|
+
icon: '/img/topo/editor/sidebar/icon/画布.svg',
|
30
|
+
content: CanvasPanel
|
31
|
+
}];
|
32
|
+
export default panes;
|
@@ -0,0 +1,95 @@
|
|
1
|
+
import _Tag from "@alifd/next/es/tag";
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
3
|
+
import React, { useState } from 'react';
|
4
|
+
import styles from "./CanvasPanel.module.scss";
|
5
|
+
var CANVAS_TOGGLE = [{
|
6
|
+
value: 'white',
|
7
|
+
label: '白色',
|
8
|
+
color: '#FFFFFF',
|
9
|
+
globalNodeLabelColor: '#4d6277',
|
10
|
+
globalEdgeTagColor: '#4d6277'
|
11
|
+
}, {
|
12
|
+
value: 'lightblue',
|
13
|
+
label: '蓝色',
|
14
|
+
color: '#F9FBFF',
|
15
|
+
globalNodeLabelColor: '#4d6277',
|
16
|
+
globalEdgeTagColor: '#4d6277'
|
17
|
+
}, // {
|
18
|
+
// value: 'yellow',
|
19
|
+
// label: '黄色',
|
20
|
+
// color: '#FFFDE6',
|
21
|
+
// },
|
22
|
+
// {
|
23
|
+
// value: 'green',
|
24
|
+
// label: '绿色',
|
25
|
+
// color: '#EAFFE8',
|
26
|
+
// },
|
27
|
+
{
|
28
|
+
value: 'dark',
|
29
|
+
label: '深色',
|
30
|
+
color: '#031425',
|
31
|
+
globalNodeLabelColor: '#ffffff',
|
32
|
+
globalEdgeTagColor: '#ffffff'
|
33
|
+
}];
|
34
|
+
export default function CanvasPanel(props) {
|
35
|
+
var topo = props.topo;
|
36
|
+
|
37
|
+
var _topo$store$useModel = topo.store.useModel('displayConfig'),
|
38
|
+
canvasTheme = _topo$store$useModel[0].canvasTheme,
|
39
|
+
displayConfigDispatchers = _topo$store$useModel[1];
|
40
|
+
|
41
|
+
var value = canvasTheme || 'white';
|
42
|
+
|
43
|
+
var setCanvasTheme = function setCanvasTheme(themeItem) {
|
44
|
+
var theme = themeItem.value;
|
45
|
+
topo.historyManager.beginTransaction();
|
46
|
+
displayConfigDispatchers.update({
|
47
|
+
canvasTheme: theme
|
48
|
+
}); // 设置资源/链路标注样式
|
49
|
+
|
50
|
+
var _topo$store$getModelS = topo.store.getModelState('displayConfig'),
|
51
|
+
nodeLabelStyle = _topo$store$getModelS.nodeLabelStyle,
|
52
|
+
defaultEdgeLabelStyle = _topo$store$getModelS.defaultEdgeLabelStyle;
|
53
|
+
|
54
|
+
var globalNodeLabelStyle = _extends({}, nodeLabelStyle, {
|
55
|
+
color: themeItem.globalNodeLabelColor
|
56
|
+
});
|
57
|
+
|
58
|
+
topo.getHtTopo().setGlobalNodeLabelStyle(globalNodeLabelStyle);
|
59
|
+
|
60
|
+
var globalEdgeTagStyle = _extends({}, defaultEdgeLabelStyle, {
|
61
|
+
color: themeItem.globalEdgeTagColor
|
62
|
+
});
|
63
|
+
|
64
|
+
topo.getHtTopo().setGlobalEdgeTagStyle(globalEdgeTagStyle);
|
65
|
+
displayConfigDispatchers.update({
|
66
|
+
nodeLabelStyle: globalNodeLabelStyle,
|
67
|
+
defaultEdgeLabelStyle: globalEdgeTagStyle
|
68
|
+
});
|
69
|
+
topo.historyManager.endTransaction();
|
70
|
+
};
|
71
|
+
|
72
|
+
return /*#__PURE__*/React.createElement("div", {
|
73
|
+
className: styles.canvasToggle
|
74
|
+
}, CANVAS_TOGGLE.map(function (item, index) {
|
75
|
+
return /*#__PURE__*/React.createElement("div", {
|
76
|
+
className: styles.canvas,
|
77
|
+
key: index
|
78
|
+
}, /*#__PURE__*/React.createElement(_Tag.Selectable, {
|
79
|
+
className: styles.tag,
|
80
|
+
style: {
|
81
|
+
background: item.color
|
82
|
+
},
|
83
|
+
checked: value === item.value,
|
84
|
+
onChange: function onChange(checked) {
|
85
|
+
setCanvasTheme(item);
|
86
|
+
}
|
87
|
+
}, /*#__PURE__*/React.createElement("div", {
|
88
|
+
className: styles.box
|
89
|
+
}, /*#__PURE__*/React.createElement("div", {
|
90
|
+
className: styles.bgColor
|
91
|
+
}))), /*#__PURE__*/React.createElement("div", {
|
92
|
+
className: styles.canvasText
|
93
|
+
}, item.label));
|
94
|
+
}));
|
95
|
+
}
|
@@ -0,0 +1,74 @@
|
|
1
|
+
@import "~@alifd/next/variables.scss";
|
2
|
+
|
3
|
+
.canvasToggle {
|
4
|
+
display: flex;
|
5
|
+
flex-wrap: wrap;
|
6
|
+
.canvas {
|
7
|
+
.tag {
|
8
|
+
border: 1px solid #E4E9EE;
|
9
|
+
width: 110px;
|
10
|
+
height: 62px;
|
11
|
+
border-radius: 2px;
|
12
|
+
margin: 16px 0 0 16px;
|
13
|
+
:global {
|
14
|
+
.#{$css-prefix}tag-body {
|
15
|
+
width: 100%;
|
16
|
+
padding: 0;
|
17
|
+
cursor: pointer;
|
18
|
+
}
|
19
|
+
}
|
20
|
+
.box {
|
21
|
+
position: relative;
|
22
|
+
height: 100%;
|
23
|
+
user-select: none;
|
24
|
+
.bgColor {
|
25
|
+
max-width: 100%;
|
26
|
+
max-height: 100%;
|
27
|
+
display: block;
|
28
|
+
margin: auto;
|
29
|
+
position: absolute;
|
30
|
+
left: 0;
|
31
|
+
top: 0;
|
32
|
+
bottom: 0;
|
33
|
+
right: 0;
|
34
|
+
}
|
35
|
+
}
|
36
|
+
&::before,
|
37
|
+
&::after {
|
38
|
+
z-index: 1;
|
39
|
+
}
|
40
|
+
&:hover {
|
41
|
+
.operation {
|
42
|
+
display: block;
|
43
|
+
}
|
44
|
+
}
|
45
|
+
.operation {
|
46
|
+
display: none;
|
47
|
+
// z-index: -1;
|
48
|
+
position: absolute;
|
49
|
+
right: 0;
|
50
|
+
bottom: 0;
|
51
|
+
left: 0;
|
52
|
+
height: 22px;
|
53
|
+
text-align: center;
|
54
|
+
background: rgba(0, 0, 0, 0.4);
|
55
|
+
button {
|
56
|
+
height: 100%;
|
57
|
+
color: #fff;
|
58
|
+
vertical-align: text-bottom;
|
59
|
+
}
|
60
|
+
}
|
61
|
+
}
|
62
|
+
.canvasText{
|
63
|
+
width: 49px;
|
64
|
+
height: 12px;
|
65
|
+
margin: 8px 0 0 46px;
|
66
|
+
text-align: center;
|
67
|
+
}
|
68
|
+
}
|
69
|
+
.canvas:nth-child(2n){
|
70
|
+
margin-left: -7px;
|
71
|
+
}
|
72
|
+
}
|
73
|
+
|
74
|
+
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import Panel from "./
|
1
|
+
import Panel from "./CanvasPanel";
|
2
2
|
export default Panel;
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import React, {
|
1
|
+
import React, { useMemo } from 'react';
|
2
2
|
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
3
3
|
import ImagePalette from "./HtImagePalette";
|
4
|
-
import {
|
4
|
+
import { getResourceIcons } from "../../../../../common/icons/icon";
|
5
5
|
/**
|
6
6
|
* 组件面板
|
7
7
|
* @param {*} props
|
@@ -11,7 +11,7 @@ import { getNodeDefaultIcons } from "../../../../../common/icons/icon";
|
|
11
11
|
export default function CiTypeImagePanel(props) {
|
12
12
|
var topo = props.topo;
|
13
13
|
var icons = useMemo(function () {
|
14
|
-
return
|
14
|
+
return getResourceIcons(topo);
|
15
15
|
}, []);
|
16
16
|
return /*#__PURE__*/React.createElement(ImagePalette, {
|
17
17
|
icons: icons,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import React, { useEffect, useRef } from 'react';
|
2
2
|
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
3
|
-
import
|
3
|
+
import styles from "./HtImagePalette.module.scss";
|
4
4
|
/**
|
5
5
|
* 组件面板
|
6
6
|
* @param {*} props
|
@@ -37,9 +37,6 @@ export default function HtCustomImagePanel(props) {
|
|
37
37
|
}, []);
|
38
38
|
return /*#__PURE__*/React.createElement("div", {
|
39
39
|
ref: divRef,
|
40
|
-
|
41
|
-
width: '100%' // height: '100%',
|
42
|
-
|
43
|
-
}
|
40
|
+
className: styles.container
|
44
41
|
});
|
45
42
|
}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import React, { useEffect, useRef } from 'react';
|
2
2
|
import rlog from '@riil-frontend/component-topology-utils/es/rlog';
|
3
|
+
import styles from "./HtImagePalette.module.scss";
|
3
4
|
/**
|
4
5
|
* 组件面板
|
5
6
|
* @param {*} props
|
@@ -22,6 +23,7 @@ export default function HtImagePalette(props) {
|
|
22
23
|
viewRef.current = htTopo.createImagePalette(container, {
|
23
24
|
icons: icons
|
24
25
|
});
|
26
|
+
console.error(viewRef.current);
|
25
27
|
} catch (error) {
|
26
28
|
rlog.error('初始化资源面板失败', error);
|
27
29
|
} // 注销组件
|
@@ -36,9 +38,6 @@ export default function HtImagePalette(props) {
|
|
36
38
|
}, []);
|
37
39
|
return /*#__PURE__*/React.createElement("div", {
|
38
40
|
ref: divRef,
|
39
|
-
|
40
|
-
width: '100%' // height: '100%',
|
41
|
-
|
42
|
-
}
|
41
|
+
className: styles.container
|
43
42
|
});
|
44
43
|
}
|
@@ -1,23 +1,36 @@
|
|
1
|
-
import _Collapse from "@alifd/next/es/collapse";
|
2
1
|
import _Button from "@alifd/next/es/button";
|
3
2
|
import _Icon from "@alifd/next/es/icon";
|
4
|
-
import React from 'react';
|
3
|
+
import React, { useMemo } from 'react';
|
5
4
|
import classNames from 'classnames';
|
6
|
-
import
|
7
|
-
import CollapseStyles from "../../../../../../components/collapse/Collapse.module.scss";
|
5
|
+
import Collapse from "../../../../../../components/collapse/Collapse";
|
8
6
|
import CiTypeImagePanel from "./CiTypeImagePanel";
|
9
7
|
import CustomImagePanel from "./CustomImagePanel";
|
8
|
+
import { getBasicIcons } from "../../../../../common/icons/icon";
|
9
|
+
import ImagePalette from "./HtImagePalette";
|
10
|
+
var CollapsePanel = Collapse.Panel;
|
10
11
|
export default function ImagePanel(props) {
|
11
|
-
|
12
|
-
|
12
|
+
var topo = props.topo;
|
13
|
+
var basicIcons = useMemo(function () {
|
14
|
+
return getBasicIcons(topo, false);
|
15
|
+
}, []);
|
16
|
+
return /*#__PURE__*/React.createElement(Collapse, {
|
17
|
+
accordion: true,
|
18
|
+
defaultExpandedKeys: ['资源图片'],
|
13
19
|
style: {
|
14
20
|
border: 'none'
|
15
21
|
},
|
16
|
-
|
22
|
+
fullheight: true,
|
23
|
+
noContentPadding: true
|
17
24
|
}, /*#__PURE__*/React.createElement(CollapsePanel, {
|
18
25
|
key: "\u8D44\u6E90\u56FE\u7247",
|
19
26
|
title: "\u8D44\u6E90\u56FE\u7247"
|
20
27
|
}, /*#__PURE__*/React.createElement(CiTypeImagePanel, props)), /*#__PURE__*/React.createElement(CollapsePanel, {
|
28
|
+
key: "\u57FA\u7840\u56FE\u7247",
|
29
|
+
title: "\u57FA\u7840\u56FE\u7247"
|
30
|
+
}, /*#__PURE__*/React.createElement(ImagePalette, {
|
31
|
+
icons: basicIcons,
|
32
|
+
topo: topo
|
33
|
+
})), /*#__PURE__*/React.createElement(CollapsePanel, {
|
21
34
|
key: "\u81EA\u5B9A\u4E49\u56FE\u7247",
|
22
35
|
title: "\u81EA\u5B9A\u4E49\u56FE\u7247",
|
23
36
|
extra: /*#__PURE__*/React.createElement(_Button, {
|
@@ -1,35 +1,45 @@
|
|
1
1
|
import _Button from "@alifd/next/es/button";
|
2
2
|
import _extends from "@babel/runtime/helpers/extends";
|
3
|
-
import
|
4
|
-
import
|
3
|
+
import classNames from 'classnames';
|
4
|
+
import React, { useMemo, useState } from 'react';
|
5
|
+
import getButtons from "./buttons";
|
5
6
|
import Toolbar from "./Toolbar";
|
6
7
|
import styles from "./Toolbar.module.scss";
|
7
8
|
|
8
9
|
function EditorToolbar(props) {
|
10
|
+
var _topo$viewProps, _topo$viewProps$topoC, _classNames;
|
11
|
+
|
12
|
+
var topo = props.topo;
|
13
|
+
|
9
14
|
var _useState = useState(true),
|
10
|
-
|
11
|
-
|
15
|
+
expanded = _useState[0],
|
16
|
+
setExpanded = _useState[1];
|
12
17
|
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
+
var isNetworkTopo = (_topo$viewProps = topo.viewProps) === null || _topo$viewProps === void 0 ? void 0 : (_topo$viewProps$topoC = _topo$viewProps.topoContext) === null || _topo$viewProps$topoC === void 0 ? void 0 : _topo$viewProps$topoC.isNetworkTopo;
|
19
|
+
var buttons = useMemo(function () {
|
20
|
+
return getButtons(isNetworkTopo);
|
21
|
+
}, [isNetworkTopo]);
|
22
|
+
var buttonInstances = buttons.map(function (ToolbarButton, index) {
|
18
23
|
return /*#__PURE__*/React.createElement(ToolbarButton, _extends({
|
19
24
|
key: index
|
20
25
|
}, props, {
|
21
|
-
showLabel:
|
26
|
+
showLabel: expanded
|
22
27
|
}));
|
23
|
-
})
|
28
|
+
});
|
29
|
+
return /*#__PURE__*/React.createElement("div", {
|
30
|
+
className: classNames(styles.toolbarWrap, (_classNames = {}, _classNames[styles.normal] = expanded, _classNames[styles.expanded] = !expanded, _classNames))
|
31
|
+
}, /*#__PURE__*/React.createElement("div", {
|
32
|
+
className: styles.content
|
33
|
+
}, /*#__PURE__*/React.createElement(Toolbar, null, buttonInstances)), /*#__PURE__*/React.createElement("div", {
|
24
34
|
className: styles.right
|
25
35
|
}, /*#__PURE__*/React.createElement(_Button, {
|
26
36
|
type: "normal",
|
27
37
|
text: true,
|
28
38
|
onClick: function onClick() {
|
29
|
-
|
39
|
+
setExpanded(!expanded);
|
30
40
|
}
|
31
41
|
}, /*#__PURE__*/React.createElement("img", {
|
32
|
-
src:
|
42
|
+
src: expanded ? '/img/topo/editor/toolbar/ToolbarNarrowed/Normal.svg' : '/img/topo/editor/toolbar/ToolbbbarExpand/Normal.svg',
|
33
43
|
alt: "",
|
34
44
|
style: {
|
35
45
|
verticalAlign: 'middle'
|
@@ -1,19 +1,30 @@
|
|
1
|
-
.
|
2
|
-
height: 54px;
|
1
|
+
.toolbarWrap {
|
3
2
|
display: flex;
|
4
3
|
align-items: center;
|
5
4
|
justify-content: center;
|
5
|
+
transition: all .1s linear;
|
6
|
+
|
7
|
+
&.normal {
|
8
|
+
height: 54px;
|
9
|
+
}
|
10
|
+
|
11
|
+
&.expanded {
|
12
|
+
height: 40px;
|
13
|
+
}
|
6
14
|
}
|
7
15
|
|
8
16
|
.content {
|
17
|
+
height: 100%;
|
9
18
|
flex: 1;
|
10
19
|
display: flex;
|
11
20
|
align-items: center;
|
12
21
|
justify-content: center;
|
22
|
+
overflow-x: auto;
|
13
23
|
}
|
14
24
|
|
15
|
-
.
|
25
|
+
.toolbarContainer {
|
16
26
|
display: flex;
|
27
|
+
min-width: 1060px;
|
17
28
|
}
|
18
29
|
|
19
30
|
.right {
|
@@ -16,21 +16,24 @@ import BoxBackgroundButton from "./widgets/BoxBackgroundButton";
|
|
16
16
|
import EdgeColorButton from "./widgets/EdgeColorButton";
|
17
17
|
import NodeImageButton from "./widgets/NodeImageButton";
|
18
18
|
import NodeSizeButton from "./widgets/NodeSizeButton";
|
19
|
-
export default
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
Divider,
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
Divider,
|
34
|
-
|
35
|
-
|
36
|
-
|
19
|
+
export default function getButtons(isNetworkTopo) {
|
20
|
+
return [].concat(isNetworkTopo ? [AddResourceButton, // 添加资源
|
21
|
+
Divider] : [], [CanvasSelectWidget, // 选择
|
22
|
+
CanvasMoveWidget, // 移动
|
23
|
+
Divider], isNetworkTopo ? [HistoryUndoButton, // 撤销
|
24
|
+
// HistoryRedoButton, // 恢复
|
25
|
+
Divider] : [], [FontFamilyWidget, // 字体
|
26
|
+
FontSizeWidget, // 字号
|
27
|
+
FontStyleButton, // 文字样式
|
28
|
+
FontColorButton, // 文字颜色
|
29
|
+
Divider, // BoxBackgroundButton, // 框背景
|
30
|
+
// Divider,
|
31
|
+
EdgeColorButton, // 线条颜色
|
32
|
+
EdgeTypeButton, // 线形
|
33
|
+
Divider, NodeImageButton, // 替换图片
|
34
|
+
NodeSizeButton, // 图片尺寸
|
35
|
+
Divider, Layout, // 布局方式
|
36
|
+
NodeAlignWidget // 对齐方式
|
37
|
+
// SearchWidget, // 搜索
|
38
|
+
]);
|
39
|
+
}
|
@@ -0,0 +1,52 @@
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
2
|
+
import React, { useMemo } from 'react';
|
3
|
+
import { isText } from "../../../../../utils/htElementDataUtil";
|
4
|
+
import { isGroup, isLayer, isNode } from "../../../../../utils/htElementUtils";
|
5
|
+
|
6
|
+
function useFontStyleSetting(props) {
|
7
|
+
var topo = props.topo;
|
8
|
+
var selectionElements = topo.selectionManager.useHtSelection();
|
9
|
+
var buttonEnabled = true; // 全局配置
|
10
|
+
|
11
|
+
var _topo$store$useModel = topo.store.useModel('displayConfig'),
|
12
|
+
displayConfigState = _topo$store$useModel[0],
|
13
|
+
displayConfigDispatchers = _topo$store$useModel[1];
|
14
|
+
|
15
|
+
var nodeLabelStyle = displayConfigState.nodeLabelStyle,
|
16
|
+
defaultEdgeLabelStyle = displayConfigState.defaultEdgeLabelStyle;
|
17
|
+
|
18
|
+
var setGlobalTagStyle = function setGlobalTagStyle(styleData) {
|
19
|
+
var globalNodeLabelStyle = _extends({}, nodeLabelStyle, styleData);
|
20
|
+
|
21
|
+
topo.getHtTopo().setGlobalNodeLabelStyle(globalNodeLabelStyle);
|
22
|
+
|
23
|
+
var globalEdgeTagStyle = _extends({}, defaultEdgeLabelStyle, styleData);
|
24
|
+
|
25
|
+
topo.getHtTopo().setGlobalEdgeTagStyle(globalEdgeTagStyle);
|
26
|
+
displayConfigDispatchers.update({
|
27
|
+
nodeLabelStyle: globalNodeLabelStyle,
|
28
|
+
defaultEdgeLabelStyle: globalEdgeTagStyle
|
29
|
+
});
|
30
|
+
};
|
31
|
+
|
32
|
+
var setStyle = function setStyle(styleData) {
|
33
|
+
topo.historyManager.beginTransaction(); // 全局调整(资源和链路):无选择时,按钮亮起,即可修改全局资源和链路的标注,不影响“文本”、框名称、区域名称、分层名称的格式。
|
34
|
+
|
35
|
+
if (!selectionElements.length) {
|
36
|
+
setGlobalTagStyle(styleData);
|
37
|
+
} else {
|
38
|
+
selectionElements.forEach(function (element) {
|
39
|
+
if (isNode(element)) {} else if (isGroup(element)) {} else if (isText(element)) {} else if (isLayer(element)) {}
|
40
|
+
});
|
41
|
+
}
|
42
|
+
|
43
|
+
topo.historyManager.endTransaction();
|
44
|
+
};
|
45
|
+
|
46
|
+
return {
|
47
|
+
buttonEnabled: buttonEnabled,
|
48
|
+
setStyle: setStyle
|
49
|
+
};
|
50
|
+
}
|
51
|
+
|
52
|
+
export default useFontStyleSetting;
|