@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,31 @@
|
|
1
|
+
.lineType{
|
2
|
+
display:flex;
|
3
|
+
.redioBtn {
|
4
|
+
width: 24px;
|
5
|
+
height: 24px;
|
6
|
+
border-radius: 4px;
|
7
|
+
border: none !important;
|
8
|
+
color: #4D6277;
|
9
|
+
padding: 0;
|
10
|
+
margin-right: 16px;
|
11
|
+
text-align: center;
|
12
|
+
|
13
|
+
.iconImg {
|
14
|
+
vertical-align: middle;
|
15
|
+
}
|
16
|
+
|
17
|
+
&:active {
|
18
|
+
background: #F2F7FD !important;
|
19
|
+
}
|
20
|
+
|
21
|
+
&:hover {
|
22
|
+
background: #F2F7FD !important;
|
23
|
+
}
|
24
|
+
}
|
25
|
+
.redioBtn:last-child{
|
26
|
+
margin-right: 0;
|
27
|
+
}
|
28
|
+
}
|
29
|
+
.iconImg {
|
30
|
+
vertical-align: middle;
|
31
|
+
}
|
@@ -0,0 +1,83 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
exports.__esModule = true;
|
4
|
+
exports.LINE_MOLD_MAP = exports.EDGE_END_POINT_TYPE_MAP = void 0;
|
5
|
+
var EDGE_END_POINT_TYPE_MAP = {
|
6
|
+
// 起点箭头
|
7
|
+
sourceArrow: {
|
8
|
+
names: ['sourceArrow'],
|
9
|
+
position: 15,
|
10
|
+
height: 15,
|
11
|
+
width: 37.5,
|
12
|
+
offsetX: -2,
|
13
|
+
keepOrien: true
|
14
|
+
},
|
15
|
+
// 起点实心圆
|
16
|
+
sourceSolidCircle: {
|
17
|
+
names: ['sourceSolidCircle'],
|
18
|
+
position: 15,
|
19
|
+
height: 12.5,
|
20
|
+
width: 25,
|
21
|
+
offsetX: 3,
|
22
|
+
keepOrien: true
|
23
|
+
},
|
24
|
+
// 起点空心圆
|
25
|
+
sourceNoneCircle: {
|
26
|
+
names: ['sourceNoneCircle'],
|
27
|
+
position: 15,
|
28
|
+
height: 12.5,
|
29
|
+
width: 25,
|
30
|
+
offsetX: 2.5,
|
31
|
+
keepOrien: true
|
32
|
+
},
|
33
|
+
// 终点箭头
|
34
|
+
targetArrow: {
|
35
|
+
names: ['targetArrow'],
|
36
|
+
position: 19,
|
37
|
+
height: 15,
|
38
|
+
width: 37.5,
|
39
|
+
offsetX: 3,
|
40
|
+
keepOrien: true
|
41
|
+
},
|
42
|
+
// 终点实心圆
|
43
|
+
targetSolidCircle: {
|
44
|
+
names: ['targetSolidCircle'],
|
45
|
+
position: 19,
|
46
|
+
height: 12.5,
|
47
|
+
width: 25,
|
48
|
+
offsetX: 0.5,
|
49
|
+
keepOrien: true
|
50
|
+
},
|
51
|
+
// 终点空心圆
|
52
|
+
targetNoneCircle: {
|
53
|
+
names: ['targetNoneCircle'],
|
54
|
+
position: 19,
|
55
|
+
height: 12.5,
|
56
|
+
width: 25,
|
57
|
+
offsetX: -0.5,
|
58
|
+
keepOrien: true
|
59
|
+
}
|
60
|
+
};
|
61
|
+
exports.EDGE_END_POINT_TYPE_MAP = EDGE_END_POINT_TYPE_MAP;
|
62
|
+
var LINE_MOLD_MAP = {
|
63
|
+
solidLine: {
|
64
|
+
lineType: 'solid',
|
65
|
+
dashPattern: null
|
66
|
+
},
|
67
|
+
dottedLine: {
|
68
|
+
lineType: 'dash',
|
69
|
+
dashPattern: 1 // lineType为dash生效。为空默认为1。值:1/2/3
|
70
|
+
|
71
|
+
},
|
72
|
+
dottedLine1: {
|
73
|
+
lineType: 'dash',
|
74
|
+
dashPattern: 3 // lineType为dash生效。为空默认为1。值:1/2/3
|
75
|
+
|
76
|
+
},
|
77
|
+
dottedLine2: {
|
78
|
+
lineType: 'dash',
|
79
|
+
dashPattern: 2 // lineType为dash生效。为空默认为1。值:1/2/3
|
80
|
+
|
81
|
+
}
|
82
|
+
};
|
83
|
+
exports.LINE_MOLD_MAP = LINE_MOLD_MAP;
|
@@ -5,14 +5,20 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
5
5
|
exports.__esModule = true;
|
6
6
|
exports["default"] = void 0;
|
7
7
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
9
|
+
|
8
10
|
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
9
11
|
|
10
12
|
var _react = _interopRequireWildcard(require("react"));
|
11
13
|
|
14
|
+
var _edgeTypeStyleUtil = require("../../../../utils/edgeTypeStyleUtil");
|
15
|
+
|
12
16
|
var _DropdownButton = _interopRequireDefault(require("../components/DropdownButton"));
|
13
17
|
|
14
18
|
var _WidgetBox = _interopRequireDefault(require("../WidgetBox"));
|
15
19
|
|
20
|
+
var _constants = require("./constants");
|
21
|
+
|
16
22
|
var _EdgeType = _interopRequireDefault(require("./EdgeType"));
|
17
23
|
|
18
24
|
var _excluded = ["topo", "showLabel"];
|
@@ -33,13 +39,74 @@ function EdgeTypeButton(props) {
|
|
33
39
|
|
34
40
|
var _useState = (0, _react.useState)(true),
|
35
41
|
disabled = _useState[0],
|
36
|
-
setDisabled = _useState[1]; //
|
42
|
+
setDisabled = _useState[1]; // 拓扑图是否加载
|
43
|
+
|
44
|
+
|
45
|
+
var _topo$store$useModelS = topo.store.useModelState('topoMod'),
|
46
|
+
graphLoaded = _topo$store$useModelS.graphLoaded; // 选中的元素
|
37
47
|
|
38
48
|
|
39
|
-
var selection = topo.selectionManager.
|
49
|
+
var selection = topo.selectionManager.useHtSelection();
|
40
50
|
(0, _react.useEffect)(function () {
|
41
|
-
|
42
|
-
|
51
|
+
if (graphLoaded) {
|
52
|
+
var edges = (0, _edgeTypeStyleUtil.getEdgesBySelection)(topo);
|
53
|
+
setDisabled(!edges.length);
|
54
|
+
}
|
55
|
+
}, [selection, graphLoaded]);
|
56
|
+
|
57
|
+
var handleChange = function handleChange(name, value) {
|
58
|
+
var edges = (0, _edgeTypeStyleUtil.getEdgesBySelection)(topo);
|
59
|
+
var htTopo = topo.getHtTopo();
|
60
|
+
|
61
|
+
if (name === 'lineButton') {
|
62
|
+
(0, _edgeTypeStyleUtil.setEdgesType)(edges, value, topo);
|
63
|
+
return;
|
64
|
+
}
|
65
|
+
|
66
|
+
(0, _edgeTypeStyleUtil.setEdgesAndChildren)(topo, edges, function (edge) {
|
67
|
+
if (name === 'startPoint') {
|
68
|
+
// 删除设置
|
69
|
+
['sourceArrow', 'sourceSolidCircle', 'sourceNoneCircle'].forEach(function (iconName) {
|
70
|
+
return edge.removeStyleIcon(iconName);
|
71
|
+
}); // 设置
|
72
|
+
|
73
|
+
var scolor = edge.a('styles') && edge.a('styles').color || edge.getStyleMap()['edge.color'];
|
74
|
+
edge.a('arrow.color', scolor || '#00B779');
|
75
|
+
edge.s('icons', (0, _extends2["default"])({}, edge.s('icons')));
|
76
|
+
edge.addStyleIcon(value, _constants.EDGE_END_POINT_TYPE_MAP[value]);
|
77
|
+
} else if (name === 'endPoint') {
|
78
|
+
// 删除设置
|
79
|
+
['targetArrow', 'targetSolidCircle', 'targetNoneCircle'].forEach(function (iconName) {
|
80
|
+
return edge.removeStyleIcon(iconName);
|
81
|
+
}); // 设置
|
82
|
+
|
83
|
+
var _scolor = edge.a('styles') && edge.a('styles').color || edge.getStyleMap()['edge.color'];
|
84
|
+
|
85
|
+
edge.a('arrow.color', _scolor || '#00B779');
|
86
|
+
edge.s('icons', (0, _extends2["default"])({}, edge.s('icons')));
|
87
|
+
edge.addStyleIcon(value, _constants.EDGE_END_POINT_TYPE_MAP[value]);
|
88
|
+
} else if (name === 'lineMold') {
|
89
|
+
// 修改实线虚线
|
90
|
+
edge.a('lineMode', value);
|
91
|
+
htTopo.setElementStyle(edge, _constants.LINE_MOLD_MAP[value]);
|
92
|
+
|
93
|
+
if (value !== 'solid') {
|
94
|
+
var edgeWidth = edge.s('edge.width');
|
95
|
+
|
96
|
+
if (edgeWidth) {
|
97
|
+
edge.s('edge.dash.width', edgeWidth);
|
98
|
+
}
|
99
|
+
|
100
|
+
var color = edge.s('edge.color');
|
101
|
+
|
102
|
+
if (edgeWidth) {
|
103
|
+
edge.s('edge.dash.color', color);
|
104
|
+
}
|
105
|
+
}
|
106
|
+
}
|
107
|
+
});
|
108
|
+
};
|
109
|
+
|
43
110
|
var icon = disabled ? /*#__PURE__*/_react["default"].createElement("img", {
|
44
111
|
src: "/img/topo/editor/toolbar/\u7EBF\u5F62/Disable.svg",
|
45
112
|
alt: ""
|
@@ -50,11 +117,15 @@ function EdgeTypeButton(props) {
|
|
50
117
|
return /*#__PURE__*/_react["default"].createElement(_WidgetBox["default"], {
|
51
118
|
label: "\u7EBF\u5F62",
|
52
119
|
tooltip: "\u7EBF\u5F62",
|
120
|
+
disabled: disabled,
|
53
121
|
showLabel: showLabel
|
54
122
|
}, /*#__PURE__*/_react["default"].createElement(_DropdownButton["default"], {
|
55
123
|
disabled: disabled,
|
56
124
|
trigger: icon
|
57
|
-
}, /*#__PURE__*/_react["default"].createElement(_EdgeType["default"],
|
125
|
+
}, !disabled && /*#__PURE__*/_react["default"].createElement(_EdgeType["default"], {
|
126
|
+
selection: selection,
|
127
|
+
onChange: handleChange
|
128
|
+
})));
|
58
129
|
}
|
59
130
|
|
60
131
|
var _default = EdgeTypeButton;
|
@@ -11,18 +11,37 @@ var _DropdownButton = _interopRequireDefault(require("./components/DropdownButto
|
|
11
11
|
|
12
12
|
var _WidgetBox = _interopRequireDefault(require("./WidgetBox"));
|
13
13
|
|
14
|
+
var _ColorPanel = _interopRequireDefault(require("../../../../../components/ColorPanel"));
|
15
|
+
|
16
|
+
var _FontColorRange = _interopRequireDefault(require("../../../../../components/ColorPanel/components/FontColorRange"));
|
17
|
+
|
18
|
+
var _FontColorButtonModule = _interopRequireDefault(require("./FontColorButton.module.scss"));
|
19
|
+
|
20
|
+
var _useFontStyleSetting = _interopRequireDefault(require("../hooks/useFontStyleSetting"));
|
21
|
+
|
14
22
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
15
23
|
|
16
24
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
17
25
|
|
26
|
+
/* eslint-disable jsx-a11y/alt-text */
|
18
27
|
function FontFamilySelect(props) {
|
19
28
|
var value = props.value,
|
20
|
-
onChange = props.onChange
|
29
|
+
onChange = props.onChange,
|
30
|
+
topo = props.topo;
|
21
31
|
|
22
32
|
var _useState = (0, _react.useState)(false),
|
23
33
|
disabled = _useState[0],
|
24
34
|
setDisabled = _useState[1];
|
25
35
|
|
36
|
+
var fontStyleSetting = (0, _useFontStyleSetting["default"])({
|
37
|
+
topo: topo
|
38
|
+
});
|
39
|
+
console.log(topo, 'topo这里需要处理颜色改变的事情');
|
40
|
+
|
41
|
+
var backOpacityChange = function backOpacityChange(value) {
|
42
|
+
console.log(value);
|
43
|
+
};
|
44
|
+
|
26
45
|
var icon = disabled ? /*#__PURE__*/_react["default"].createElement("img", {
|
27
46
|
src: "/img/topo/editor/toolbar/\u6587\u5B57\u989C\u8272\u53CA\u586B\u5145/Disable.svg",
|
28
47
|
alt: ""
|
@@ -34,11 +53,31 @@ function FontFamilySelect(props) {
|
|
34
53
|
disabled: disabled,
|
35
54
|
trigger: icon,
|
36
55
|
onChange: onChange
|
37
|
-
}, "
|
56
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
57
|
+
className: _FontColorButtonModule["default"].content
|
58
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
59
|
+
className: _FontColorButtonModule["default"].fontColor
|
60
|
+
}, /*#__PURE__*/_react["default"].createElement("span", null, "\u5B57\u4F53\u989C\u8272"), /*#__PURE__*/_react["default"].createElement(_ColorPanel["default"], null)), /*#__PURE__*/_react["default"].createElement("div", {
|
61
|
+
className: _FontColorButtonModule["default"].backgroundColor
|
62
|
+
}, /*#__PURE__*/_react["default"].createElement("span", null, "\u80CC\u666F\u586B\u5145"), /*#__PURE__*/_react["default"].createElement("div", {
|
63
|
+
className: _FontColorButtonModule["default"].backOpacity
|
64
|
+
}, /*#__PURE__*/_react["default"].createElement("img", {
|
65
|
+
src: "/img/topo/editor/toolbar/\u6587\u5B57\u989C\u8272\u53CA\u586B\u5145/\u80CC\u666F\u586B\u5145.svg"
|
66
|
+
}), /*#__PURE__*/_react["default"].createElement(_FontColorRange["default"], {
|
67
|
+
max: 100,
|
68
|
+
min: 0,
|
69
|
+
unit: "%",
|
70
|
+
list: [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100],
|
71
|
+
onChange: backOpacityChange,
|
72
|
+
defaultValue: 0
|
73
|
+
})), /*#__PURE__*/_react["default"].createElement(_ColorPanel["default"], {
|
74
|
+
showClear: true
|
75
|
+
}))));
|
38
76
|
}
|
39
77
|
|
40
78
|
function FontColorButton(props) {
|
41
|
-
var showLabel = props.showLabel
|
79
|
+
var showLabel = props.showLabel,
|
80
|
+
topo = props.topo;
|
42
81
|
|
43
82
|
var _useState2 = (0, _react.useState)('微软雅黑'),
|
44
83
|
value = _useState2[0],
|
@@ -50,7 +89,8 @@ function FontColorButton(props) {
|
|
50
89
|
showLabel: showLabel
|
51
90
|
}, /*#__PURE__*/_react["default"].createElement(FontFamilySelect, {
|
52
91
|
value: value,
|
53
|
-
onChange: setValue
|
92
|
+
onChange: setValue,
|
93
|
+
topo: topo
|
54
94
|
}));
|
55
95
|
}
|
56
96
|
|
@@ -0,0 +1,35 @@
|
|
1
|
+
.content {
|
2
|
+
height: 296px;
|
3
|
+
.fontColor{
|
4
|
+
width: 100%;
|
5
|
+
height: 143px;//159px
|
6
|
+
&>span{
|
7
|
+
font-size: 12px;
|
8
|
+
color: black;
|
9
|
+
font-family: PingFangSC-Regular, PingFang SC;
|
10
|
+
font-weight: 400;
|
11
|
+
color: #4D6277;
|
12
|
+
line-height: 17px;
|
13
|
+
}
|
14
|
+
}
|
15
|
+
.backgroundColor{
|
16
|
+
width: 100%;
|
17
|
+
height: 159px;
|
18
|
+
&>span{
|
19
|
+
font-size: 12px;
|
20
|
+
color: black;
|
21
|
+
font-family: PingFangSC-Regular, PingFang SC;
|
22
|
+
font-weight: 400;
|
23
|
+
color: #4D6277;
|
24
|
+
line-height: 17px;
|
25
|
+
}
|
26
|
+
.backOpacity{
|
27
|
+
margin-top: 2px;
|
28
|
+
margin-bottom: 5px;
|
29
|
+
margin-left: 11px;
|
30
|
+
line-height: 8px;
|
31
|
+
display: flex;
|
32
|
+
flex-direction: row;
|
33
|
+
}
|
34
|
+
}
|
35
|
+
}
|
@@ -7,6 +7,8 @@ exports["default"] = void 0;
|
|
7
7
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
9
9
|
|
10
|
+
var _useFontStyleSetting = _interopRequireDefault(require("../hooks/useFontStyleSetting"));
|
11
|
+
|
10
12
|
var _DropdownMenu = _interopRequireDefault(require("./components/DropdownMenu"));
|
11
13
|
|
12
14
|
var _WidgetBox = _interopRequireDefault(require("./WidgetBox"));
|
@@ -34,19 +36,28 @@ function FontFamilySelect(props) {
|
|
34
36
|
}
|
35
37
|
|
36
38
|
function FontFamilyWidget(props) {
|
37
|
-
var
|
39
|
+
var topo = props.topo,
|
40
|
+
showLabel = props.showLabel;
|
38
41
|
|
39
42
|
var _useState = (0, _react.useState)('微软雅黑'),
|
40
43
|
value = _useState[0],
|
41
44
|
setValue = _useState[1];
|
42
45
|
|
46
|
+
var fontStyleSetting = (0, _useFontStyleSetting["default"])({
|
47
|
+
topo: topo
|
48
|
+
});
|
43
49
|
return /*#__PURE__*/_react["default"].createElement(_WidgetBox["default"], {
|
44
50
|
label: "\u5B57\u4F53",
|
45
51
|
tooltip: "\u5B57\u4F53",
|
46
52
|
showLabel: showLabel
|
47
53
|
}, /*#__PURE__*/_react["default"].createElement(FontFamilySelect, {
|
48
54
|
value: value,
|
49
|
-
onChange:
|
55
|
+
onChange: function onChange(val) {
|
56
|
+
setValue(val);
|
57
|
+
fontStyleSetting.setStyle({
|
58
|
+
fontFamily: val
|
59
|
+
});
|
60
|
+
}
|
50
61
|
}));
|
51
62
|
}
|
52
63
|
|
@@ -7,6 +7,8 @@ exports["default"] = void 0;
|
|
7
7
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
9
9
|
|
10
|
+
var _useFontStyleSetting = _interopRequireDefault(require("../hooks/useFontStyleSetting"));
|
11
|
+
|
10
12
|
var _DropdownMenu = _interopRequireDefault(require("./components/DropdownMenu"));
|
11
13
|
|
12
14
|
var _WidgetBox = _interopRequireDefault(require("./WidgetBox"));
|
@@ -30,7 +32,11 @@ function FontSizeSelect(props) {
|
|
30
32
|
}
|
31
33
|
|
32
34
|
function FontSizeWidget(props) {
|
33
|
-
var
|
35
|
+
var topo = props.topo,
|
36
|
+
showLabel = props.showLabel;
|
37
|
+
var fontStyleSetting = (0, _useFontStyleSetting["default"])({
|
38
|
+
topo: topo
|
39
|
+
});
|
34
40
|
|
35
41
|
var _useState = (0, _react.useState)(12),
|
36
42
|
fontSize = _useState[0],
|
@@ -41,7 +47,12 @@ function FontSizeWidget(props) {
|
|
41
47
|
showLabel: showLabel
|
42
48
|
}, /*#__PURE__*/_react["default"].createElement(FontSizeSelect, {
|
43
49
|
value: fontSize,
|
44
|
-
onChange:
|
50
|
+
onChange: function onChange(val) {
|
51
|
+
setFontSize(val);
|
52
|
+
fontStyleSetting.setStyle({
|
53
|
+
fontSize: val
|
54
|
+
});
|
55
|
+
}
|
45
56
|
}));
|
46
57
|
}
|
47
58
|
|
@@ -7,6 +7,12 @@ exports["default"] = void 0;
|
|
7
7
|
|
8
8
|
var _react = _interopRequireWildcard(require("react"));
|
9
9
|
|
10
|
+
var _htElementUtils = require("../../../../../utils/htElementUtils");
|
11
|
+
|
12
|
+
var _fontStyleUtil = _interopRequireDefault(require("../../settings/common/text/fontStyleUtil"));
|
13
|
+
|
14
|
+
var _useFontStyleSetting = _interopRequireDefault(require("../hooks/useFontStyleSetting"));
|
15
|
+
|
10
16
|
var _DropdownMenu = _interopRequireDefault(require("./components/DropdownMenu"));
|
11
17
|
|
12
18
|
var _WidgetBox = _interopRequireDefault(require("./WidgetBox"));
|
@@ -15,40 +21,37 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
15
21
|
|
16
22
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
17
23
|
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
}
|
43
|
-
}, item));
|
44
|
-
}));
|
24
|
+
var items = [{
|
25
|
+
key: 'bold',
|
26
|
+
label: '加粗',
|
27
|
+
icon: 'bold'
|
28
|
+
}, {
|
29
|
+
key: 'italic',
|
30
|
+
label: '斜体',
|
31
|
+
icon: 'Italics'
|
32
|
+
}, {
|
33
|
+
key: 'underline',
|
34
|
+
label: '下划线',
|
35
|
+
icon: 'Underline'
|
36
|
+
}];
|
37
|
+
|
38
|
+
function getTextFontStyle(textElement) {
|
39
|
+
var underline = textElement.s('text.decoration') === 'underline';
|
40
|
+
|
41
|
+
var fontStyle = _fontStyleUtil["default"].toMap(textElement.s('text.font'));
|
42
|
+
|
43
|
+
return {
|
44
|
+
underline: underline,
|
45
|
+
bold: fontStyle.bold,
|
46
|
+
italic: fontStyle.italic
|
47
|
+
};
|
45
48
|
}
|
46
49
|
|
47
50
|
function FontStyleButton(props) {
|
48
51
|
var topo = props.topo,
|
49
52
|
showLabel = props.showLabel;
|
50
53
|
|
51
|
-
var _useState = (0, _react.useState)('
|
54
|
+
var _useState = (0, _react.useState)(['bold']),
|
52
55
|
value = _useState[0],
|
53
56
|
setValue = _useState[1];
|
54
57
|
|
@@ -57,19 +60,71 @@ function FontStyleButton(props) {
|
|
57
60
|
setDisabled = _useState2[1]; // 选中的元素
|
58
61
|
|
59
62
|
|
60
|
-
var selection = topo.selectionManager.
|
63
|
+
var selection = topo.selectionManager.useHtSelection();
|
64
|
+
var fontStyleSetting = (0, _useFontStyleSetting["default"])({
|
65
|
+
topo: topo
|
66
|
+
});
|
61
67
|
(0, _react.useEffect)(function () {
|
62
68
|
setDisabled(false);
|
69
|
+
var fontObj = {};
|
70
|
+
|
71
|
+
if (selection.length === 1) {
|
72
|
+
var element = selection[0];
|
73
|
+
|
74
|
+
if ((0, _htElementUtils.isText)(element)) {
|
75
|
+
fontObj = getTextFontStyle(element);
|
76
|
+
}
|
77
|
+
}
|
78
|
+
|
79
|
+
var newValue = Object.keys(fontObj).reduce(function (result, key) {
|
80
|
+
if (fontObj[key]) {
|
81
|
+
return [].concat(result, [key]);
|
82
|
+
}
|
83
|
+
|
84
|
+
return result;
|
85
|
+
}, []);
|
86
|
+
setValue(newValue);
|
63
87
|
}, [selection]);
|
88
|
+
/**
|
89
|
+
*
|
90
|
+
* @param {Array} selectedKeys
|
91
|
+
*/
|
92
|
+
|
93
|
+
var handleChange = function handleChange(selectedKeys) {
|
94
|
+
setValue(selectedKeys);
|
95
|
+
var style = {
|
96
|
+
fontBold: selectedKeys.includes('bold')
|
97
|
+
};
|
98
|
+
fontStyleSetting.setStyle(style);
|
99
|
+
};
|
100
|
+
|
64
101
|
return /*#__PURE__*/_react["default"].createElement(_WidgetBox["default"], {
|
65
102
|
label: "\u6587\u5B57\u6837\u5F0F",
|
66
103
|
tooltip: "\u6587\u5B57\u6837\u5F0F",
|
67
104
|
showLabel: showLabel
|
68
|
-
}, /*#__PURE__*/_react["default"].createElement(
|
105
|
+
}, /*#__PURE__*/_react["default"].createElement(_DropdownMenu["default"], {
|
69
106
|
value: value,
|
70
|
-
|
71
|
-
|
72
|
-
|
107
|
+
valueRender: function valueRender() {
|
108
|
+
return /*#__PURE__*/_react["default"].createElement("img", {
|
109
|
+
src: "/img/topo/editor/toolbar/bold/" + (disabled ? 'Disable' : 'Normal') + ".svg",
|
110
|
+
alt: ""
|
111
|
+
});
|
112
|
+
},
|
113
|
+
multiple: true,
|
114
|
+
onChange: handleChange
|
115
|
+
}, items.map(function (item) {
|
116
|
+
return /*#__PURE__*/_react["default"].createElement(_DropdownMenu["default"].Item, {
|
117
|
+
key: item.key
|
118
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
119
|
+
style: {
|
120
|
+
display: 'flex',
|
121
|
+
alignItems: 'center'
|
122
|
+
}
|
123
|
+
}, /*#__PURE__*/_react["default"].createElement("img", {
|
124
|
+
src: "/img/topo/editor/toolbar/" + item.icon + "/Normal.svg",
|
125
|
+
alt: ""
|
126
|
+
}), /*#__PURE__*/_react["default"].createElement("span", null, item.label)));
|
127
|
+
})));
|
73
128
|
}
|
74
129
|
|
75
130
|
var _default = FontStyleButton;
|
@@ -9,6 +9,8 @@ var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
10
10
|
var _WidgetBox = _interopRequireDefault(require("./WidgetBox"));
|
11
11
|
|
12
|
+
var _ButtonBox = _interopRequireDefault(require("./components/ButtonBox"));
|
13
|
+
|
12
14
|
function HistoryRedoButton(props) {
|
13
15
|
var topo = props.topo,
|
14
16
|
showLabel = props.showLabel;
|
@@ -21,8 +23,8 @@ function HistoryRedoButton(props) {
|
|
21
23
|
label: "\u6062\u590D",
|
22
24
|
tooltip: "\u6062\u590D",
|
23
25
|
showLabel: showLabel
|
24
|
-
}, /*#__PURE__*/_react["default"].createElement(
|
25
|
-
src: "/img/topo/editor/toolbar/
|
26
|
+
}, /*#__PURE__*/_react["default"].createElement(_ButtonBox["default"], null, /*#__PURE__*/_react["default"].createElement("img", {
|
27
|
+
src: "/img/topo/editor/toolbar/undo/" + (disabled ? 'Disable' : 'Normal') + ".svg",
|
26
28
|
alt: ""
|
27
29
|
})));
|
28
30
|
}
|
@@ -7,6 +7,8 @@ exports["default"] = void 0;
|
|
7
7
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
9
9
|
|
10
|
+
var _ButtonBox = _interopRequireDefault(require("./components/ButtonBox"));
|
11
|
+
|
10
12
|
var _WidgetBox = _interopRequireDefault(require("./WidgetBox"));
|
11
13
|
|
12
14
|
// import { Icon, Button } from '@alifd/next';
|
@@ -21,15 +23,15 @@ function HistoryUndoButton(props) {
|
|
21
23
|
return /*#__PURE__*/_react["default"].createElement(_WidgetBox["default"], {
|
22
24
|
disabled: disabled,
|
23
25
|
label: "\u64A4\u9500",
|
24
|
-
tooltip:
|
26
|
+
tooltip: disabled ? '无法撤销' : '撤销(Ctrl/ ⌘+Z)',
|
25
27
|
showLabel: showLabel
|
26
|
-
}, /*#__PURE__*/_react["default"].createElement(
|
28
|
+
}, /*#__PURE__*/_react["default"].createElement(_ButtonBox["default"], {
|
27
29
|
disabled: disabled,
|
28
30
|
onClick: function onClick() {
|
29
31
|
topo.historyManager.undo();
|
30
32
|
}
|
31
33
|
}, /*#__PURE__*/_react["default"].createElement("img", {
|
32
|
-
src: "/img/topo/editor/toolbar/
|
34
|
+
src: "/img/topo/editor/toolbar/redo/" + (disabled ? 'Disable' : 'Normal') + ".svg",
|
33
35
|
alt: ""
|
34
36
|
})));
|
35
37
|
}
|