@riil-frontend/component-topology 6.0.0-alpha.4 → 6.0.0-alpha.41
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 +9 -0
- package/es/components/ColorPanel/components/FontColorRange/index.js +35 -0
- package/es/components/ColorPanel/components/FontColorRange/index.module.scss +25 -0
- package/es/components/ColorPanel/index.js +237 -0
- package/es/components/ColorPanel/index.module.scss +35 -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 +24 -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 +9 -3
- 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 +21 -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 +38 -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/CanvasPanel/themes.js +63 -0
- package/es/core/editor/components/Sidebar/views/CanvasPanel/useCanvasThemeConfig.js +115 -0
- package/es/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +3 -3
- package/es/core/editor/components/Sidebar/views/ImagePanel/HtCustomImagePanel.js +14 -6
- package/es/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.js +14 -5
- package/es/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.module.scss +5 -0
- package/es/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +20 -7
- package/es/core/editor/components/Toolbar/EditorToolbar.js +23 -13
- package/es/core/editor/components/Toolbar/Toolbar.js +1 -1
- package/es/core/editor/components/Toolbar/Toolbar.module.scss +14 -3
- package/es/core/editor/components/Toolbar/buttons.js +20 -18
- package/es/core/editor/components/Toolbar/widgets/AddResourceButton.js +8 -7
- package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundButton.js +2 -2
- 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 +46 -2
- package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +98 -6
- 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 +70 -16
- package/es/core/editor/components/Toolbar/widgets/FontColorButton.module.scss +43 -0
- package/es/core/editor/components/Toolbar/widgets/FontFamilyWidget.js +25 -11
- package/es/core/editor/components/Toolbar/widgets/FontSizeWidget.js +29 -13
- package/es/core/editor/components/Toolbar/widgets/FontStyleButton.js +100 -39
- 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 +95 -23
- package/es/core/editor/components/Toolbar/widgets/NodeAlignWidget.module.scss +33 -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 +98 -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 +5 -3
- package/es/core/editor/components/Toolbar/widgets/components/ButtonBox.module.scss +3 -0
- package/es/core/editor/components/Toolbar/widgets/components/DropdownButton.js +21 -3
- package/es/core/editor/components/Toolbar/widgets/components/DropdownMenu.js +16 -6
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/ElementTextStyleSetting.js +49 -0
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/colorUtil.js +59 -0
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/box.js +30 -0
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +25 -0
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/groupTitle.js +41 -0
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/index.js +14 -0
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/layerTitle.js +49 -0
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/nodeTag.js +36 -0
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/text.js +32 -0
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/textStyleUtil.js +71 -0
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/GlobalTagStyleSetting.js +25 -0
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/globalTag.js +52 -0
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/textStyleSettingRouter.js +20 -0
- 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 +29 -8
- package/es/core/editor/components/settings/Settings.js +4 -44
- package/es/core/editor/components/settings/Settings.module.scss +8 -4
- package/es/core/editor/components/settings/common/AlignSetting/AlignSetting.module.scss +2 -2
- package/es/core/editor/components/settings/common/AlignSetting/AlignTypeList.js +80 -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/common/text/fontStyleUtil.js +11 -19
- 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/text/TextPropertyView.js +1 -1
- 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 +61 -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 +11 -3
- package/es/core/models/SelectionManager.js +28 -9
- package/es/core/models/TopoApp.js +1 -1
- package/es/core/models/TopoGraphView.js +8 -2
- package/es/core/models/selection/ignoreList.js +1 -0
- package/es/core/models/utils/linkUtils.js +5 -6
- 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/topoConfig.js +10 -12
- package/es/core/store/models/topoMod.js +26 -28
- package/es/core/utils/edgeUtil.js +6 -0
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +3 -4
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +19 -5
- 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 +9 -0
- package/lib/components/ColorPanel/components/FontColorRange/index.js +49 -0
- package/lib/components/ColorPanel/components/FontColorRange/index.module.scss +25 -0
- package/lib/components/ColorPanel/index.js +255 -0
- package/lib/components/ColorPanel/index.module.scss +35 -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 +24 -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 +10 -3
- 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 +31 -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 +53 -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/CanvasPanel/themes.js +72 -0
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/useCanvasThemeConfig.js +128 -0
- package/lib/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +1 -1
- package/lib/core/editor/components/Sidebar/views/ImagePanel/HtCustomImagePanel.js +15 -6
- package/lib/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.js +16 -5
- package/lib/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.module.scss +5 -0
- package/lib/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +29 -11
- package/lib/core/editor/components/Toolbar/EditorToolbar.js +22 -11
- package/lib/core/editor/components/Toolbar/Toolbar.js +1 -1
- package/lib/core/editor/components/Toolbar/Toolbar.module.scss +14 -3
- package/lib/core/editor/components/Toolbar/buttons.js +21 -20
- package/lib/core/editor/components/Toolbar/widgets/AddResourceButton.js +8 -7
- package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundButton.js +2 -2
- 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 +48 -2
- package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +100 -6
- 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 +75 -16
- package/lib/core/editor/components/Toolbar/widgets/FontColorButton.module.scss +43 -0
- package/lib/core/editor/components/Toolbar/widgets/FontFamilyWidget.js +26 -10
- package/lib/core/editor/components/Toolbar/widgets/FontSizeWidget.js +30 -12
- package/lib/core/editor/components/Toolbar/widgets/FontStyleButton.js +105 -39
- 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 +98 -23
- package/lib/core/editor/components/Toolbar/widgets/NodeAlignWidget.module.scss +33 -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 +99 -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 +5 -3
- package/lib/core/editor/components/Toolbar/widgets/components/ButtonBox.module.scss +3 -0
- package/lib/core/editor/components/Toolbar/widgets/components/DropdownButton.js +21 -3
- package/lib/core/editor/components/Toolbar/widgets/components/DropdownMenu.js +17 -6
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/ElementTextStyleSetting.js +63 -0
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/colorUtil.js +72 -0
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/box.js +45 -0
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +40 -0
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/groupTitle.js +57 -0
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/index.js +28 -0
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/layerTitle.js +64 -0
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/nodeTag.js +52 -0
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/text.js +47 -0
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/textStyleUtil.js +83 -0
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/GlobalTagStyleSetting.js +39 -0
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/globalTag.js +65 -0
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/textStyleSettingRouter.js +31 -0
- 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 +32 -8
- package/lib/core/editor/components/settings/Settings.js +4 -44
- package/lib/core/editor/components/settings/Settings.module.scss +8 -4
- package/lib/core/editor/components/settings/common/AlignSetting/AlignSetting.module.scss +2 -2
- package/lib/core/editor/components/settings/common/AlignSetting/AlignTypeList.js +97 -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/common/text/fontStyleUtil.js +12 -20
- 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/text/TextPropertyView.js +1 -1
- 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 +75 -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 +11 -3
- package/lib/core/models/SelectionManager.js +30 -9
- package/lib/core/models/TopoApp.js +1 -1
- package/lib/core/models/TopoGraphView.js +8 -2
- package/lib/core/models/selection/ignoreList.js +6 -0
- package/lib/core/models/utils/linkUtils.js +5 -6
- 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/topoConfig.js +9 -18
- package/lib/core/store/models/topoMod.js +27 -29
- package/lib/core/utils/edgeUtil.js +6 -0
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +3 -4
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +19 -5
- 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 +5 -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,33 @@
|
|
1
|
+
.leftInput{
|
2
|
+
width: 100px !important;
|
3
|
+
margin: 0px 10px 10px 9px;
|
4
|
+
:global{
|
5
|
+
input{
|
6
|
+
background: url('/img/topo/editor/toolbar/对齐/水平间距_normal.svg')no-repeat 5px center !important;
|
7
|
+
background-position: 81px center !important;
|
8
|
+
}
|
9
|
+
.next-disabled input{
|
10
|
+
background: url('/img/topo/editor/toolbar/对齐/水平间距_disable.svg')no-repeat 5px center !important;
|
11
|
+
background-position: 81px center !important;
|
12
|
+
}
|
13
|
+
.next-input.next-small input{
|
14
|
+
height: calc(30px - 1px * 2);
|
15
|
+
}
|
16
|
+
}
|
17
|
+
}
|
18
|
+
.rightInput{
|
19
|
+
width: 100px !important;
|
20
|
+
:global{
|
21
|
+
input{
|
22
|
+
background: url('/img/topo/editor/toolbar/对齐/垂直间距 _normal.svg')no-repeat 5px center !important;
|
23
|
+
background-position: 82px center !important;
|
24
|
+
}
|
25
|
+
.next-disabled input{
|
26
|
+
background: url('/img/topo/editor/toolbar/对齐/垂直间距_disable.svg')no-repeat 5px center !important;
|
27
|
+
background-position: 82px center !important;
|
28
|
+
}
|
29
|
+
.next-input.next-small input{
|
30
|
+
height: calc(30px - 1px * 2);
|
31
|
+
}
|
32
|
+
}
|
33
|
+
}
|
@@ -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
|
|
@@ -1,13 +1,17 @@
|
|
1
1
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
2
2
|
var _excluded = ["topo", "showLabel"];
|
3
|
-
import React, { useEffect, useState } from 'react';
|
4
|
-
|
3
|
+
import React, { useEffect, useState } from 'react'; // import BatchSetNodeSize from "../../../settings/propertyViews/view/BatchSetNodeSize";
|
4
|
+
|
5
|
+
import BatchSetNodeSize from "../../../settings/propertyViews/multipleElements/BatchSetNodeSize/BatchSetNodeSize";
|
6
|
+
import NodeSizeInput from "../../../settings/common/NodeSizeInput/NodeSizeInput";
|
7
|
+
import useSettingRuntimeState from "../../../settings/useSettingRuntimeState";
|
5
8
|
import WidgetBox from "../WidgetBox";
|
6
|
-
import
|
9
|
+
import styles from "./NodeSizeButton.module.scss";
|
10
|
+
import { isGroup, isNode } from "../../../../../../utils/htElementUtils";
|
7
11
|
/**
|
8
12
|
* 图片尺寸设置
|
9
|
-
* @param {*} props
|
10
|
-
* @returns
|
13
|
+
* @param {*} props
|
14
|
+
* @returns
|
11
15
|
*/
|
12
16
|
|
13
17
|
function NodeSizeButton(props) {
|
@@ -17,25 +21,106 @@ function NodeSizeButton(props) {
|
|
17
21
|
|
18
22
|
var _useState = useState(true),
|
19
23
|
disabled = _useState[0],
|
20
|
-
setDisabled = _useState[1];
|
24
|
+
setDisabled = _useState[1];
|
25
|
+
|
26
|
+
var _useState2 = useState(),
|
27
|
+
size = _useState2[0],
|
28
|
+
setSize = _useState2[1]; // 选中的元素
|
21
29
|
|
22
30
|
|
23
31
|
var selection = topo.selectionManager.useSelection();
|
32
|
+
var settingRuntimeState = useSettingRuntimeState();
|
24
33
|
useEffect(function () {
|
25
|
-
|
34
|
+
var elements = selection.map(function (item) {
|
35
|
+
return item.id;
|
36
|
+
}).map(function (id) {
|
37
|
+
return topo.getDataModel().getDataById(id);
|
38
|
+
});
|
39
|
+
var nodes = elements.filter(function (ele) {
|
40
|
+
return isGroup(ele) || isNode(ele);
|
41
|
+
});
|
42
|
+
|
43
|
+
if (nodes.length > 0) {
|
44
|
+
setDisabled(false);
|
45
|
+
|
46
|
+
if (selection.length === 1) {
|
47
|
+
var element = nodes[0];
|
48
|
+
setSize({
|
49
|
+
width: element.getWidth(),
|
50
|
+
height: element.getHeight()
|
51
|
+
});
|
52
|
+
}
|
53
|
+
} else {
|
54
|
+
setDisabled(true);
|
55
|
+
setSize({
|
56
|
+
width: null,
|
57
|
+
height: null
|
58
|
+
});
|
59
|
+
}
|
26
60
|
}, [selection]);
|
61
|
+
|
62
|
+
var _onChange = function onChange(prop) {
|
63
|
+
var name = prop.name,
|
64
|
+
value = prop.value;
|
65
|
+
var element = topo.getSelectionModel().getFirstData();
|
66
|
+
|
67
|
+
if (name === 'width') {
|
68
|
+
element.setWidth(value);
|
69
|
+
} else if (name === 'height') {
|
70
|
+
element.setHeight(value);
|
71
|
+
}
|
72
|
+
};
|
73
|
+
|
27
74
|
return /*#__PURE__*/React.createElement(WidgetBox, {
|
28
75
|
label: "\u56FE\u7247\u5C3A\u5BF8",
|
76
|
+
disabled: disabled,
|
29
77
|
tooltip: "\u56FE\u7247\u5C3A\u5BF8",
|
30
78
|
showLabel: showLabel
|
31
79
|
}, /*#__PURE__*/React.createElement("div", {
|
32
|
-
|
33
|
-
|
80
|
+
className: styles.toolbarNodeSizeSetting
|
81
|
+
}, selection.length > 1 ? /*#__PURE__*/React.createElement(BatchSetNodeSize, {
|
82
|
+
topo: topo // size="small"
|
83
|
+
,
|
84
|
+
value: size,
|
85
|
+
disabled: disabled,
|
86
|
+
showLabel: false,
|
87
|
+
numberPickerProps: {
|
88
|
+
hasTrigger: false,
|
89
|
+
placeholder: '-'
|
90
|
+
} // onChange={(size) => {
|
91
|
+
// topo.historyManager.beginTransaction();
|
92
|
+
// onChange({ name: "width", value: size.width });
|
93
|
+
// onChange({ name: "height", value: size.height });
|
94
|
+
// topo.historyManager.endTransaction();
|
95
|
+
// }}
|
96
|
+
|
97
|
+
}) : /*#__PURE__*/React.createElement(NodeSizeInput, {
|
98
|
+
topo: topo // size="small"
|
99
|
+
,
|
100
|
+
value: size,
|
101
|
+
disabled: disabled,
|
102
|
+
showLabel: false,
|
103
|
+
hasTrigger: false,
|
104
|
+
numberPickerProps: {
|
105
|
+
hasTrigger: false,
|
106
|
+
placeholder: '-'
|
107
|
+
},
|
108
|
+
settingRuntimeState: settingRuntimeState,
|
109
|
+
onChange: function onChange(size) {
|
110
|
+
topo.historyManager.beginTransaction();
|
111
|
+
|
112
|
+
_onChange({
|
113
|
+
name: 'width',
|
114
|
+
value: size.width
|
115
|
+
});
|
116
|
+
|
117
|
+
_onChange({
|
118
|
+
name: 'height',
|
119
|
+
value: size.height
|
120
|
+
});
|
121
|
+
|
122
|
+
topo.historyManager.endTransaction();
|
34
123
|
}
|
35
|
-
}, /*#__PURE__*/React.createElement(BatchSetNodeSize, {
|
36
|
-
topo: topo,
|
37
|
-
size: "small",
|
38
|
-
showLabel: false
|
39
124
|
})));
|
40
125
|
}
|
41
126
|
|
@@ -0,0 +1,28 @@
|
|
1
|
+
@import '~@alifd/next/variables.scss';
|
2
|
+
|
3
|
+
.toolbarNodeSizeSetting {
|
4
|
+
width: 144px;
|
5
|
+
|
6
|
+
// 图片尺寸输入框
|
7
|
+
:global {
|
8
|
+
.#{$css-prefix}input-inner {
|
9
|
+
padding-right: 8px;
|
10
|
+
}
|
11
|
+
|
12
|
+
.#{$css-prefix}input.#{$css-prefix}medium {
|
13
|
+
height: 24px;
|
14
|
+
}
|
15
|
+
|
16
|
+
.#{$css-prefix}input {
|
17
|
+
border: none;
|
18
|
+
|
19
|
+
&:hover:not(.#{$css-prefix}disabled) {
|
20
|
+
background: #F2F7FD;
|
21
|
+
}
|
22
|
+
}
|
23
|
+
|
24
|
+
.#{$css-prefix}input.#{$css-prefix}medium input {
|
25
|
+
height: 24px;
|
26
|
+
}
|
27
|
+
}
|
28
|
+
}
|
@@ -1,9 +1,10 @@
|
|
1
|
+
import _Balloon from "@alifd/next/es/balloon";
|
1
2
|
import _extends from "@babel/runtime/helpers/extends";
|
2
3
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
3
|
-
|
4
|
-
var _excluded = ["active", "disabled", "children"];
|
5
|
-
import classNames from 'classnames';
|
4
|
+
var _excluded = ["label", "showLabel", "tooltip", "disabled", "children"];
|
6
5
|
import React from 'react';
|
6
|
+
import classnames from 'classnames';
|
7
|
+
import ButtonBox from "./components/ButtonBox";
|
7
8
|
import styles from "./WidgetBox.module.scss";
|
8
9
|
|
9
10
|
function WidgetBox(props) {
|
@@ -11,15 +12,16 @@ function WidgetBox(props) {
|
|
11
12
|
showLabel = props.showLabel,
|
12
13
|
tooltip = props.tooltip,
|
13
14
|
disabled = props.disabled,
|
14
|
-
children = props.children
|
15
|
-
|
15
|
+
children = props.children,
|
16
|
+
otherProps = _objectWithoutPropertiesLoose(props, _excluded);
|
17
|
+
|
18
|
+
var button = /*#__PURE__*/React.createElement("div", _extends({
|
16
19
|
disabled: disabled,
|
17
|
-
type: "button",
|
18
20
|
className: styles.container
|
19
|
-
}, /*#__PURE__*/React.createElement("div", {
|
21
|
+
}, otherProps), /*#__PURE__*/React.createElement("div", {
|
20
22
|
className: styles.content
|
21
23
|
}, children), showLabel !== false && /*#__PURE__*/React.createElement("div", {
|
22
|
-
className: styles.label
|
24
|
+
className: classnames(styles.label, disabled ? styles.disabledLabel : styles.normalLabel)
|
23
25
|
}, label));
|
24
26
|
|
25
27
|
if (!tooltip) {
|
@@ -28,22 +30,13 @@ function WidgetBox(props) {
|
|
28
30
|
|
29
31
|
return /*#__PURE__*/React.createElement(_Balloon.Tooltip, {
|
30
32
|
trigger: button,
|
31
|
-
align: "b"
|
33
|
+
align: "b" // 解决遮挡下拉浮层问题
|
34
|
+
,
|
35
|
+
popupStyle: {
|
36
|
+
zIndex: 1000
|
37
|
+
}
|
32
38
|
}, tooltip);
|
33
39
|
}
|
34
40
|
|
35
|
-
function ButtonBox(props) {
|
36
|
-
var _classNames;
|
37
|
-
|
38
|
-
var active = props.active,
|
39
|
-
disabled = props.disabled,
|
40
|
-
children = props.children,
|
41
|
-
otherProps = _objectWithoutPropertiesLoose(props, _excluded);
|
42
|
-
|
43
|
-
return /*#__PURE__*/React.createElement("div", _extends({
|
44
|
-
className: classNames(styles.ButtonBox, (_classNames = {}, _classNames[styles.ButtonBoxActive] = active, _classNames[styles.ButtonBoxDisabled] = disabled, _classNames))
|
45
|
-
}, otherProps), children);
|
46
|
-
}
|
47
|
-
|
48
41
|
WidgetBox.ButtonBox = ButtonBox;
|
49
42
|
export default WidgetBox;
|
@@ -8,6 +8,7 @@
|
|
8
8
|
border-width: 0;
|
9
9
|
background-color: transparent;
|
10
10
|
border-color: transparent;
|
11
|
+
user-select: none;
|
11
12
|
|
12
13
|
&[disabled] {
|
13
14
|
cursor: not-allowed;
|
@@ -43,6 +44,14 @@
|
|
43
44
|
text-align: center;
|
44
45
|
}
|
45
46
|
|
47
|
+
.disabledLabel {
|
48
|
+
color: #C9CED2;
|
49
|
+
}
|
50
|
+
|
51
|
+
.normalLabel {
|
52
|
+
color: #78849C;
|
53
|
+
}
|
54
|
+
|
46
55
|
.ButtonBox {
|
47
56
|
height: 24px;
|
48
57
|
display: flex;
|
@@ -56,9 +65,10 @@
|
|
56
65
|
background: rgba(76, 137, 255, 0.1);
|
57
66
|
border-radius: 4px;
|
58
67
|
}
|
68
|
+
|
59
69
|
&.ButtonBoxDisabled:hover {
|
60
70
|
background: transparent;
|
61
71
|
cursor: not-allowed;
|
62
72
|
}
|
63
|
-
|
73
|
+
|
64
74
|
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
2
2
|
import _Icon from "@alifd/next/es/icon";
|
3
3
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
4
|
-
var _excluded = ["active", "disabled", "showArrow", "children"];
|
4
|
+
var _excluded = ["active", "disabled", "showArrow", "children", "onClick"];
|
5
5
|
import React from 'react';
|
6
6
|
import PropTypes from 'prop-types';
|
7
7
|
import classNames from 'classnames';
|
@@ -14,14 +14,16 @@ function ButtonBox(props) {
|
|
14
14
|
disabled = props.disabled,
|
15
15
|
showArrow = props.showArrow,
|
16
16
|
children = props.children,
|
17
|
+
onClick = props.onClick,
|
17
18
|
otherProps = _objectWithoutPropertiesLoose(props, _excluded);
|
18
19
|
|
19
20
|
return /*#__PURE__*/React.createElement("div", _extends({
|
20
|
-
className: classNames(styles.ButtonBox, (_classNames = {}, _classNames[styles.ButtonBoxActive] = active, _classNames[styles.ButtonBoxDisabled] = disabled, _classNames))
|
21
|
+
className: classNames(styles.ButtonBox, (_classNames = {}, _classNames[styles.ButtonBoxActive] = active, _classNames[styles.ButtonBoxDisabled] = disabled, _classNames)),
|
22
|
+
onClick: disabled ? undefined : onClick
|
21
23
|
}, otherProps), children, showArrow && /*#__PURE__*/React.createElement(React.Fragment, null, "\xA0", /*#__PURE__*/React.createElement(_Icon, {
|
22
24
|
type: "tree_fold_arrow",
|
23
25
|
size: "xxs",
|
24
|
-
className: classNames(styles.icon, (_classNames2 = {}, _classNames2[styles.active] = active, _classNames2))
|
26
|
+
className: classNames(styles.icon, (_classNames2 = {}, _classNames2[styles.active] = active, _classNames2[styles.disabled] = disabled, _classNames2))
|
25
27
|
})));
|
26
28
|
}
|
27
29
|
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import _Dropdown from "@alifd/next/es/dropdown";
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
2
3
|
import React, { useState } from 'react';
|
3
4
|
import PropTypes from 'prop-types';
|
4
5
|
import ButtonBox from "./ButtonBox";
|
@@ -6,26 +7,43 @@ import styles from "./DropdownButton.module.scss";
|
|
6
7
|
|
7
8
|
function DropdownButton(props) {
|
8
9
|
var trigger = props.trigger,
|
10
|
+
disabled = props.disabled,
|
9
11
|
_props$showArrow = props.showArrow,
|
10
12
|
showArrow = _props$showArrow === void 0 ? true : _props$showArrow,
|
11
13
|
_props$showContainer = props.showContainer,
|
12
14
|
showContainer = _props$showContainer === void 0 ? true : _props$showContainer,
|
15
|
+
buttonBoxProps = props.buttonBoxProps,
|
13
16
|
children = props.children;
|
14
17
|
|
15
18
|
var _useState = useState(false),
|
16
19
|
visible = _useState[0],
|
17
20
|
setVisible = _useState[1];
|
18
21
|
|
19
|
-
var button = /*#__PURE__*/React.createElement(ButtonBox, {
|
22
|
+
var button = /*#__PURE__*/React.createElement(ButtonBox, _extends({
|
20
23
|
active: visible,
|
24
|
+
disabled: disabled,
|
21
25
|
showArrow: showArrow
|
22
|
-
}, trigger);
|
26
|
+
}, buttonBoxProps), trigger);
|
27
|
+
|
28
|
+
var renderContent = function renderContent() {
|
29
|
+
if (!visible) {
|
30
|
+
return /*#__PURE__*/React.createElement("div", null);
|
31
|
+
}
|
32
|
+
|
33
|
+
if (showContainer) {
|
34
|
+
return /*#__PURE__*/React.createElement(PopupCard, null, children);
|
35
|
+
}
|
36
|
+
|
37
|
+
return children;
|
38
|
+
};
|
39
|
+
|
23
40
|
return /*#__PURE__*/React.createElement(_Dropdown, {
|
24
41
|
visible: visible,
|
42
|
+
disabled: disabled,
|
25
43
|
trigger: button,
|
26
44
|
triggerType: "click",
|
27
45
|
onVisibleChange: setVisible
|
28
|
-
},
|
46
|
+
}, renderContent());
|
29
47
|
}
|
30
48
|
|
31
49
|
DropdownButton.propTypes = {
|
@@ -6,18 +6,28 @@ import DropdownButton from "./DropdownButton";
|
|
6
6
|
function DropdownMenu(props) {
|
7
7
|
var value = props.value,
|
8
8
|
children = props.children,
|
9
|
+
multiple = props.multiple,
|
9
10
|
onChange = props.onChange,
|
10
|
-
valueRender = props.valueRender
|
11
|
+
valueRender = props.valueRender,
|
12
|
+
disabled = props.disabled;
|
11
13
|
var selectedKeys = Array.isArray(value) ? value : [value];
|
12
14
|
var valueDisplay = valueRender ? valueRender(value) : value;
|
15
|
+
var selectMode = multiple ? 'multiple' : 'single';
|
16
|
+
|
17
|
+
var handleChange = function handleChange(keys) {
|
18
|
+
onChange(multiple ? keys : keys[0]);
|
19
|
+
};
|
20
|
+
|
21
|
+
var menu = /*#__PURE__*/React.createElement(_Menu, {
|
22
|
+
selectMode: selectMode,
|
23
|
+
selectedKeys: selectedKeys,
|
24
|
+
onSelect: handleChange
|
25
|
+
}, children);
|
13
26
|
return /*#__PURE__*/React.createElement(DropdownButton, {
|
14
27
|
trigger: valueDisplay,
|
28
|
+
disabled: disabled,
|
15
29
|
showContainer: false
|
16
|
-
}, /*#__PURE__*/React.createElement(
|
17
|
-
selectMode: "single",
|
18
|
-
selectedKeys: selectedKeys,
|
19
|
-
onSelect: onChange
|
20
|
-
}, children));
|
30
|
+
}, multiple ? /*#__PURE__*/React.createElement("div", null, menu) : menu);
|
21
31
|
}
|
22
32
|
|
23
33
|
DropdownButton.propTypes = {
|
@@ -0,0 +1,49 @@
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
2
|
+
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
|
3
|
+
var _excluded = ["Component", "styleNames"];
|
4
|
+
import React, { useMemo, useState } from 'react';
|
5
|
+
import { getTextStyle, setTextStyle } from "./textStyleUtil";
|
6
|
+
|
7
|
+
function ElementTextStyleSetting(props) {
|
8
|
+
var topo = props.topo;
|
9
|
+
|
10
|
+
var Component = props.Component,
|
11
|
+
styleNames = props.styleNames,
|
12
|
+
widgetProps = _objectWithoutPropertiesLoose(props, _excluded); // 拓扑图是否加载
|
13
|
+
|
14
|
+
|
15
|
+
var _topo$store$useModelS = topo.store.useModelState('topoMod'),
|
16
|
+
graphLoaded = _topo$store$useModelS.graphLoaded; // 选中的元素
|
17
|
+
|
18
|
+
|
19
|
+
var selection = topo.selectionManager.useSelection();
|
20
|
+
var htSelection = useMemo(function () {
|
21
|
+
if (!selection.length) {
|
22
|
+
return [];
|
23
|
+
}
|
24
|
+
|
25
|
+
return topo.getHtTopo().getGraphView().getSelectionModel().getSelection().toArray();
|
26
|
+
}, [selection, topo]);
|
27
|
+
var value = useMemo(function () {
|
28
|
+
if (!graphLoaded) {
|
29
|
+
return {};
|
30
|
+
}
|
31
|
+
|
32
|
+
return getTextStyle(htSelection, styleNames, topo) || {};
|
33
|
+
}, [graphLoaded, htSelection, topo]);
|
34
|
+
var setStyle = useMemo(function () {
|
35
|
+
return function (style) {
|
36
|
+
htSelection.forEach(function (element) {
|
37
|
+
setTextStyle(element, style, topo);
|
38
|
+
});
|
39
|
+
};
|
40
|
+
}, [htSelection]);
|
41
|
+
return /*#__PURE__*/React.createElement(Component, _extends({
|
42
|
+
disabled: false,
|
43
|
+
htSelection: htSelection,
|
44
|
+
style: value,
|
45
|
+
setStyle: setStyle
|
46
|
+
}, widgetProps));
|
47
|
+
}
|
48
|
+
|
49
|
+
export default ElementTextStyleSetting;
|
@@ -0,0 +1,59 @@
|
|
1
|
+
import Color from 'color';
|
2
|
+
/**
|
3
|
+
* 解析颜色字符串为对象
|
4
|
+
*
|
5
|
+
* @param {string} colorStr
|
6
|
+
* @returns {null|{hex, rgb:{r,g,b,a}}}
|
7
|
+
*/
|
8
|
+
|
9
|
+
export function parseColor(colorStr) {
|
10
|
+
if (!colorStr) {
|
11
|
+
return null;
|
12
|
+
}
|
13
|
+
|
14
|
+
var color = Color(colorStr);
|
15
|
+
var rgb = color.rgb();
|
16
|
+
return {
|
17
|
+
hex: color.hex(),
|
18
|
+
rgb: {
|
19
|
+
r: rgb.color[0],
|
20
|
+
g: rgb.color[1],
|
21
|
+
b: rgb.color[2],
|
22
|
+
a: rgb.valpha
|
23
|
+
}
|
24
|
+
};
|
25
|
+
}
|
26
|
+
export function parseBackground(colorStr) {
|
27
|
+
var background = parseColor(colorStr);
|
28
|
+
return {
|
29
|
+
background: background,
|
30
|
+
// 背景颜色,格式: {rgba: {}, hex: ''} | null
|
31
|
+
opacity: background ? background.rgb.a : 1 // 背景透明度。值范围 0-1, null,null表示无
|
32
|
+
|
33
|
+
};
|
34
|
+
}
|
35
|
+
export function formatHexColor(color) {
|
36
|
+
return color ? color.hex : null;
|
37
|
+
}
|
38
|
+
/**
|
39
|
+
* 格式化背景rgba颜色
|
40
|
+
* @param {{background, opacity}} prevColor
|
41
|
+
* @param {{background, opacity}} currentColor
|
42
|
+
*/
|
43
|
+
|
44
|
+
export function formatBackgroundRgbaColor(prevColor, currentColor) {
|
45
|
+
if (!('background' in currentColor) && !('opacity' in currentColor)) {
|
46
|
+
return null;
|
47
|
+
}
|
48
|
+
|
49
|
+
var colorObj = Object.assign(prevColor, currentColor);
|
50
|
+
var background = colorObj.background,
|
51
|
+
opacity = colorObj.opacity;
|
52
|
+
|
53
|
+
if (!background) {
|
54
|
+
return null;
|
55
|
+
}
|
56
|
+
|
57
|
+
var rgb = background.rgb;
|
58
|
+
return "rgba(" + rgb.r + ", " + rgb.g + ", " + rgb.b + ", " + (opacity === null ? 1 : opacity) + ")";
|
59
|
+
}
|
@@ -0,0 +1,30 @@
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
2
|
+
import fontStyleUtil from "../../../../../../settings/common/text/fontStyleUtil";
|
3
|
+
import { formatBackgroundRgbaColor, parseBackground, parseColor } from "../colorUtil";
|
4
|
+
export function getTextStyle(element) {
|
5
|
+
var underline = element.a('text.decoration') === 'underline';
|
6
|
+
return _extends({
|
7
|
+
color: parseColor(element.a('topLeftTextColor')),
|
8
|
+
underline: underline
|
9
|
+
}, fontStyleUtil.toMap(element.a('rectFont')), parseBackground(element.a('topLeftColor')));
|
10
|
+
}
|
11
|
+
export function setTextStyle(element, style) {
|
12
|
+
if ('underline' in style) {}
|
13
|
+
|
14
|
+
if ('color' in style) {
|
15
|
+
element.a('topLeftTextColor', style.color.hex);
|
16
|
+
} // 背景颜色
|
17
|
+
|
18
|
+
|
19
|
+
var prevStyle = getTextStyle(element);
|
20
|
+
element.a('topLeftColor', formatBackgroundRgbaColor(prevStyle, style));
|
21
|
+
|
22
|
+
var fontStyle = _extends({}, getTextStyle(element), style);
|
23
|
+
|
24
|
+
var fontStr = fontStyleUtil.build(fontStyle);
|
25
|
+
element.a('rectFont', fontStr);
|
26
|
+
}
|
27
|
+
export default {
|
28
|
+
getTextStyle: getTextStyle,
|
29
|
+
setTextStyle: setTextStyle
|
30
|
+
};
|