@riil-frontend/component-topology 6.0.0-alpha.6 → 6.0.0-alpha.60
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/demo/CHANGELOG/CHANGELOG.md +5 -0
- 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 +241 -0
- package/es/components/ColorPanel/index.module.scss +35 -0
- package/es/components/VerticalIconTab/VerticalIconTab.js +11 -1
- package/es/components/VerticalIconTab/VerticalIconTab.module.scss +2 -0
- 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 +40 -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 +84 -22
- 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 +28 -58
- package/es/core/components/titlebar/TitleBar.module.scss +1 -1
- package/es/core/editor/components/EditorPlugin.js +14 -2
- package/es/core/editor/components/Sidebar/Sidebar.js +22 -4
- package/es/core/editor/components/Sidebar/panes.js +6 -1
- package/es/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.js +36 -2
- package/es/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.module.scss +74 -0
- package/es/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +112 -0
- package/es/core/editor/components/Sidebar/views/CanvasPanel/utils/elementThemeUtil.js +0 -0
- package/es/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +3 -3
- package/es/core/editor/components/Sidebar/views/ImagePanel/HtCustomImagePanel.js +12 -1
- package/es/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.js +12 -1
- package/es/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.module.scss +3 -3
- package/es/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +27 -8
- package/es/core/editor/components/Toolbar/EditorToolbar.js +16 -9
- package/es/core/editor/components/Toolbar/buttons.js +20 -18
- package/es/core/editor/components/Toolbar/widgets/AddResourceButton.js +3 -3
- package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundButton.js +3 -3
- 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 +74 -23
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.module.scss +1 -3
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +17 -10
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/constants.js +77 -0
- package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +52 -5
- package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +104 -16
- package/es/core/editor/components/Toolbar/widgets/FontColorButton.module.scss +42 -0
- package/es/core/editor/components/Toolbar/widgets/FontFamilyWidget.js +25 -11
- package/es/core/editor/components/Toolbar/widgets/FontSizeWidget.js +38 -13
- package/es/core/editor/components/Toolbar/widgets/FontStyleButton.js +99 -39
- package/es/core/editor/components/Toolbar/widgets/HistoryRedoButton.js +1 -1
- package/es/core/editor/components/Toolbar/widgets/HistoryUndoButton.js +2 -2
- 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 +130 -15
- package/es/core/editor/components/Toolbar/widgets/NodeAlignWidget.js +107 -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 +50 -7
- package/es/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.js +99 -15
- package/es/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.module.scss +28 -0
- package/es/core/editor/components/Toolbar/widgets/WidgetBox.js +10 -4
- package/es/core/editor/components/Toolbar/widgets/WidgetBox.module.scss +10 -1
- package/es/core/editor/components/Toolbar/widgets/components/ButtonBox.js +2 -2
- package/es/core/editor/components/Toolbar/widgets/components/ButtonBox.module.scss +4 -0
- package/es/core/editor/components/Toolbar/widgets/components/DropdownButton.js +23 -8
- package/es/core/editor/components/Toolbar/widgets/components/DropdownMenu.js +16 -6
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/ElementTextStyleSetting.js +52 -0
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/colorUtil.js +67 -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 +55 -0
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/groupTitle.js +55 -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 +63 -0
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/nodeTag.js +55 -0
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/text.js +33 -0
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/textStyleUtil.js +99 -0
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/GlobalTagStyleSetting.js +29 -0
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/globalTag.js +60 -0
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/textStyleSettingRouter.js +20 -0
- package/es/core/editor/components/plugins/AddElementThemePlugin.js +11 -0
- package/es/core/editor/components/settings/CloseablePanel.js +33 -0
- package/es/core/editor/components/settings/CloseablePanel.module.scss +21 -0
- package/es/core/editor/components/settings/PropertyView.js +50 -11
- package/es/core/editor/components/settings/Settings.js +37 -122
- package/es/core/editor/components/settings/Settings.module.scss +7 -11
- package/es/core/editor/components/settings/common/AlignSetting/AlignSetting.module.scss +3 -3
- 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/GroupNodeList/ResourceList.module.scss +1 -0
- package/es/core/editor/components/settings/common/LineType/index.js +11 -102
- package/es/core/editor/components/settings/common/NameInput.js +24 -0
- package/es/core/editor/components/settings/common/NodeSizeInput/NodeSizeInput.js +3 -3
- package/es/core/editor/components/settings/common/SizeInput/NodeSizeInput.js +31 -24
- package/es/core/editor/components/settings/common/SizeInput/NodeSizeNumberPicker.js +7 -6
- package/es/core/editor/components/settings/common/text/fontStyleUtil.js +21 -19
- package/es/core/editor/components/settings/core/PropertyViewManager.js +81 -0
- package/es/core/editor/components/settings/core/edgePropertyViewAdapter.js +22 -0
- package/es/core/editor/components/settings/core/getPropertyViewType.js +34 -0
- package/es/core/editor/components/settings/core/updateElementProperty.js +21 -0
- package/es/core/editor/components/settings/propertyViews/box/BoxPropertyView.js +6 -13
- package/es/core/editor/components/settings/propertyViews/box/BoxPropertyViewV1.js +58 -0
- package/es/core/editor/components/settings/propertyViews/box/NameInput.js +5 -4
- package/es/core/editor/components/settings/propertyViews/edge/CommonEdgePropertyView.js +12 -3
- package/es/core/editor/components/settings/propertyViews/edge/EdgeGroupPropertyView.js +7 -8
- package/es/core/editor/components/settings/propertyViews/edge/EdgePropertyView.js +9 -23
- package/es/core/editor/components/settings/propertyViews/edge/addEdgeProps.js +10 -0
- package/es/core/editor/components/settings/propertyViews/edge/edgeGroup/EdgeGroupSetting.js +1 -6
- package/es/core/editor/components/settings/propertyViews/group/GroupPropertyView.js +13 -21
- package/es/core/editor/components/settings/propertyViews/group/GroupPropertyView.module.scss +8 -1
- package/es/core/editor/components/settings/propertyViews/group/GroupPropertyViewV1.js +28 -0
- package/es/core/editor/components/settings/propertyViews/group/SettingTab/GroupBasicSetting.js +75 -0
- package/es/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js +9 -15
- package/es/core/editor/components/settings/propertyViews/group/cluster/ClusterGroupRelateData.js +8 -6
- package/es/core/editor/components/settings/propertyViews/index.js +4 -6
- package/es/core/editor/components/settings/propertyViews/layer/BasicSetting.js +57 -0
- package/es/core/editor/components/settings/propertyViews/layer/LayerPropertyView.js +11 -17
- package/es/core/editor/components/settings/propertyViews/layer/LayerPropertyView.module.scss +10 -0
- package/es/core/editor/components/settings/propertyViews/layer/LayerPropertyViewV1.js +27 -0
- package/es/core/editor/components/settings/propertyViews/multipleElements/BatchSetNodeSize/BatchSetNodeSize.js +8 -9
- package/es/core/editor/components/settings/propertyViews/multipleElements/MultipleElementLineType.js +5 -7
- package/es/core/editor/components/settings/propertyViews/multipleElements/MultipleElementPropertyView.js +2 -15
- package/es/core/editor/components/settings/propertyViews/node/NodePropertyView.js +8 -32
- package/es/core/editor/components/settings/propertyViews/node/NodePropertyViewV1.js +53 -0
- package/es/core/editor/components/settings/propertyViews/node/Setting/BasicSetting.js +49 -0
- package/es/core/editor/components/settings/propertyViews/node/Setting/NameInput.js +5 -4
- package/es/core/editor/components/settings/propertyViews/node/data/Data.js +2 -1
- package/es/core/editor/components/settings/propertyViews/node/data/NodeRelateResourceButton.js +1 -0
- package/es/core/editor/components/settings/propertyViews/text/TextPropertyView.js +5 -20
- 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/config/themes.js +99 -0
- package/es/core/editor/hooks/useKeyboardShortcut.js +39 -0
- package/es/core/editor/hooks/useNewElementTheme.js +44 -0
- package/es/core/editor/store/topoEdit.js +44 -37
- package/es/core/editor/utils/edgeTypeStyleUtil.js +34 -11
- package/es/core/editor/utils/textStyleUtil.js +0 -0
- package/es/core/editor/utils/themeUtil.js +32 -0
- package/es/core/hooks/useCanvasTheme.js +61 -0
- package/es/core/hooks/useManageStatus.js +1 -9
- package/es/core/hooks/usePolling.js +2 -5
- package/es/core/hooks/useTopoEdit.js +30 -12
- package/es/core/models/Alarm.js +2 -2
- package/es/core/models/AttributeMetricDisplay.js +4 -0
- package/es/core/models/HistoryManager.js +13 -8
- package/es/core/models/{SelectionManager.js → SelectionModel.js} +55 -22
- package/es/core/models/TopoApp.js +6 -5
- package/es/core/models/selection/ignoreList.js +1 -0
- package/es/core/models/utils/linkUtils.js +5 -6
- 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/utils/showGraphManageStatusUtil.js +7 -1
- 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/plugins/ViewerPlugin.js +10 -4
- 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/components/editor/propertyViews/edge/EdgeGroupPropertyView.js +2 -1
- package/es/networkTopo/components/editor/propertyViews/edge/EdgePropertyView.js +39 -6
- package/es/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyView.js +10 -16
- package/es/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyViewV1.js +37 -0
- package/es/networkTopo/components/editor/propertyViews/edge/link/LinkInfoPreview.module.scss +1 -1
- package/es/networkTopo/components/editor/useEditorProps.js +1 -3
- package/es/networkTopo/createTopo.js +2 -0
- package/es/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
- package/es/networkTopo/services/link.js +2 -2
- package/es/networkTopo/store/topoTreeMod.js +6 -7
- package/es/style.js +28 -27
- 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 +259 -0
- package/lib/components/ColorPanel/index.module.scss +35 -0
- package/lib/components/VerticalIconTab/VerticalIconTab.js +14 -1
- package/lib/components/VerticalIconTab/VerticalIconTab.module.scss +2 -0
- 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 +47 -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 +84 -22
- 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 +34 -65
- package/lib/core/components/titlebar/TitleBar.module.scss +1 -1
- package/lib/core/editor/components/EditorPlugin.js +21 -2
- package/lib/core/editor/components/Sidebar/Sidebar.js +22 -4
- package/lib/core/editor/components/Sidebar/panes.js +6 -1
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.js +43 -2
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.module.scss +74 -0
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +126 -0
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/utils/elementThemeUtil.js +1 -0
- package/lib/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +1 -1
- package/lib/core/editor/components/Sidebar/views/ImagePanel/HtCustomImagePanel.js +13 -1
- package/lib/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.js +13 -1
- package/lib/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.module.scss +3 -3
- package/lib/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +36 -12
- package/lib/core/editor/components/Toolbar/EditorToolbar.js +14 -7
- package/lib/core/editor/components/Toolbar/buttons.js +21 -20
- package/lib/core/editor/components/Toolbar/widgets/AddResourceButton.js +3 -3
- package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundButton.js +3 -3
- 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 +73 -22
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.module.scss +1 -3
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +18 -8
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/constants.js +83 -0
- package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +53 -4
- package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +109 -16
- package/lib/core/editor/components/Toolbar/widgets/FontColorButton.module.scss +42 -0
- package/lib/core/editor/components/Toolbar/widgets/FontFamilyWidget.js +26 -10
- package/lib/core/editor/components/Toolbar/widgets/FontSizeWidget.js +39 -12
- package/lib/core/editor/components/Toolbar/widgets/FontStyleButton.js +104 -39
- package/lib/core/editor/components/Toolbar/widgets/HistoryRedoButton.js +1 -1
- package/lib/core/editor/components/Toolbar/widgets/HistoryUndoButton.js +2 -2
- 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 +135 -16
- package/lib/core/editor/components/Toolbar/widgets/NodeAlignWidget.js +110 -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 +50 -6
- package/lib/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.js +100 -14
- package/lib/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.module.scss +28 -0
- package/lib/core/editor/components/Toolbar/widgets/WidgetBox.js +13 -4
- package/lib/core/editor/components/Toolbar/widgets/WidgetBox.module.scss +10 -1
- package/lib/core/editor/components/Toolbar/widgets/components/ButtonBox.js +2 -2
- package/lib/core/editor/components/Toolbar/widgets/components/ButtonBox.module.scss +4 -0
- package/lib/core/editor/components/Toolbar/widgets/components/DropdownButton.js +23 -8
- package/lib/core/editor/components/Toolbar/widgets/components/DropdownMenu.js +17 -6
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/ElementTextStyleSetting.js +66 -0
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/colorUtil.js +82 -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 +74 -0
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/groupTitle.js +75 -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 +78 -0
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/nodeTag.js +74 -0
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/text.js +48 -0
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/textStyleUtil.js +114 -0
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/GlobalTagStyleSetting.js +44 -0
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/globalTag.js +72 -0
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/textStyleSettingRouter.js +31 -0
- package/lib/core/editor/components/plugins/AddElementThemePlugin.js +20 -0
- package/lib/core/editor/components/settings/CloseablePanel.js +46 -0
- package/lib/core/editor/components/settings/CloseablePanel.module.scss +21 -0
- package/lib/core/editor/components/settings/PropertyView.js +59 -12
- package/lib/core/editor/components/settings/Settings.js +40 -122
- package/lib/core/editor/components/settings/Settings.module.scss +7 -11
- package/lib/core/editor/components/settings/common/AlignSetting/AlignSetting.module.scss +3 -3
- 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/GroupNodeList/ResourceList.module.scss +1 -0
- package/lib/core/editor/components/settings/common/LineType/index.js +11 -109
- package/lib/core/editor/components/settings/common/NameInput.js +38 -0
- package/lib/core/editor/components/settings/common/NodeSizeInput/NodeSizeInput.js +2 -2
- package/lib/core/editor/components/settings/common/SizeInput/NodeSizeInput.js +32 -26
- package/lib/core/editor/components/settings/common/SizeInput/NodeSizeNumberPicker.js +6 -6
- package/lib/core/editor/components/settings/common/text/fontStyleUtil.js +25 -20
- package/lib/core/editor/components/settings/core/PropertyViewManager.js +91 -0
- package/lib/core/editor/components/settings/core/edgePropertyViewAdapter.js +33 -0
- package/lib/core/editor/components/settings/core/getPropertyViewType.js +40 -0
- package/lib/core/editor/components/settings/core/updateElementProperty.js +27 -0
- package/lib/core/editor/components/settings/propertyViews/box/BoxPropertyView.js +6 -13
- package/lib/core/editor/components/settings/propertyViews/box/BoxPropertyViewV1.js +76 -0
- package/lib/core/editor/components/settings/propertyViews/box/NameInput.js +6 -5
- package/lib/core/editor/components/settings/propertyViews/edge/CommonEdgePropertyView.js +15 -3
- package/lib/core/editor/components/settings/propertyViews/edge/EdgeGroupPropertyView.js +9 -12
- package/lib/core/editor/components/settings/propertyViews/edge/EdgePropertyView.js +7 -23
- package/lib/core/editor/components/settings/propertyViews/edge/addEdgeProps.js +19 -0
- package/lib/core/editor/components/settings/propertyViews/edge/edgeGroup/EdgeGroupSetting.js +1 -6
- package/lib/core/editor/components/settings/propertyViews/group/GroupPropertyView.js +14 -25
- package/lib/core/editor/components/settings/propertyViews/group/GroupPropertyView.module.scss +8 -1
- package/lib/core/editor/components/settings/propertyViews/group/GroupPropertyViewV1.js +43 -0
- package/lib/core/editor/components/settings/propertyViews/group/SettingTab/GroupBasicSetting.js +98 -0
- package/lib/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js +8 -14
- package/lib/core/editor/components/settings/propertyViews/group/cluster/ClusterGroupRelateData.js +9 -7
- package/lib/core/editor/components/settings/propertyViews/index.js +4 -9
- package/lib/core/editor/components/settings/propertyViews/layer/BasicSetting.js +75 -0
- package/lib/core/editor/components/settings/propertyViews/layer/LayerPropertyView.js +12 -20
- package/lib/core/editor/components/settings/propertyViews/layer/LayerPropertyView.module.scss +10 -0
- package/lib/core/editor/components/settings/propertyViews/layer/LayerPropertyViewV1.js +40 -0
- package/lib/core/editor/components/settings/propertyViews/multipleElements/BatchSetNodeSize/BatchSetNodeSize.js +6 -8
- package/lib/core/editor/components/settings/propertyViews/multipleElements/MultipleElementLineType.js +4 -6
- package/lib/core/editor/components/settings/propertyViews/multipleElements/MultipleElementPropertyView.js +2 -15
- package/lib/core/editor/components/settings/propertyViews/node/NodePropertyView.js +8 -35
- package/lib/core/editor/components/settings/propertyViews/node/NodePropertyViewV1.js +68 -0
- package/lib/core/editor/components/settings/propertyViews/node/Setting/BasicSetting.js +64 -0
- package/lib/core/editor/components/settings/propertyViews/node/Setting/NameInput.js +6 -5
- package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +2 -1
- package/lib/core/editor/components/settings/propertyViews/node/data/NodeRelateResourceButton.js +1 -0
- package/lib/core/editor/components/settings/propertyViews/text/TextPropertyView.js +5 -20
- 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/config/themes.js +108 -0
- package/lib/core/editor/hooks/useKeyboardShortcut.js +49 -0
- package/lib/core/editor/hooks/useNewElementTheme.js +55 -0
- package/lib/core/editor/store/topoEdit.js +46 -40
- package/lib/core/editor/utils/edgeTypeStyleUtil.js +38 -11
- package/lib/core/editor/utils/textStyleUtil.js +1 -0
- package/lib/core/editor/utils/themeUtil.js +39 -0
- package/lib/core/hooks/useCanvasTheme.js +75 -0
- package/lib/core/hooks/useManageStatus.js +1 -9
- package/lib/core/hooks/usePolling.js +2 -5
- package/lib/core/hooks/useTopoEdit.js +31 -12
- package/lib/core/models/Alarm.js +2 -2
- package/lib/core/models/AttributeMetricDisplay.js +4 -0
- package/lib/core/models/HistoryManager.js +13 -8
- package/lib/core/models/{SelectionManager.js → SelectionModel.js} +57 -22
- package/lib/core/models/TopoApp.js +7 -5
- package/lib/core/models/selection/ignoreList.js +6 -0
- package/lib/core/models/utils/linkUtils.js +5 -6
- 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/utils/showGraphManageStatusUtil.js +7 -1
- 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/plugins/ViewerPlugin.js +11 -3
- 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/components/editor/propertyViews/edge/EdgeGroupPropertyView.js +1 -0
- package/lib/networkTopo/components/editor/propertyViews/edge/EdgePropertyView.js +45 -7
- package/lib/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyView.js +10 -18
- package/lib/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyViewV1.js +50 -0
- package/lib/networkTopo/components/editor/propertyViews/edge/link/LinkInfoPreview.module.scss +1 -1
- package/lib/networkTopo/components/editor/useEditorProps.js +1 -4
- package/lib/networkTopo/createTopo.js +3 -0
- package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
- package/lib/networkTopo/services/link.js +2 -2
- package/lib/networkTopo/store/topoTreeMod.js +6 -8
- package/lib/style.js +28 -27
- package/lib/utils/htElementUtils.js +5 -0
- package/lib/utils/topoData.js +1 -0
- package/package.json +5 -4
@@ -0,0 +1,114 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
5
|
+
exports.__esModule = true;
|
6
|
+
exports.getElementTextStyle = getElementTextStyle;
|
7
|
+
exports.getElementTextStyleFieldDisabled = getElementTextStyleFieldDisabled;
|
8
|
+
exports.getTextStyle = getTextStyle;
|
9
|
+
exports.setTextStyle = setTextStyle;
|
10
|
+
|
11
|
+
var _extends3 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
12
|
+
|
13
|
+
var _htElementUtils = require("../../../../../../../../utils/htElementUtils");
|
14
|
+
|
15
|
+
var _elements = _interopRequireDefault(require("./elements"));
|
16
|
+
|
17
|
+
function getElementType(element) {
|
18
|
+
if ((0, _htElementUtils.isText)(element)) {
|
19
|
+
return 'text';
|
20
|
+
} else if (element.a('type') === 'box') {
|
21
|
+
return 'box';
|
22
|
+
} else if ((0, _htElementUtils.isGroup)(element)) {
|
23
|
+
return 'groupTitle';
|
24
|
+
} else if ((0, _htElementUtils.isNode)(element)) {
|
25
|
+
return 'nodeTag';
|
26
|
+
} else if ((0, _htElementUtils.isEdge)(element)) {
|
27
|
+
return 'edgeTag';
|
28
|
+
} else if ((0, _htElementUtils.isLayer)(element)) {
|
29
|
+
return 'layerTitle';
|
30
|
+
}
|
31
|
+
|
32
|
+
return null;
|
33
|
+
}
|
34
|
+
|
35
|
+
function getElementTextStyle(element) {
|
36
|
+
var type = getElementType(element);
|
37
|
+
var handler = _elements["default"][type];
|
38
|
+
|
39
|
+
if (handler) {
|
40
|
+
return handler.getTextStyle(element);
|
41
|
+
}
|
42
|
+
|
43
|
+
return null;
|
44
|
+
}
|
45
|
+
|
46
|
+
function getElementTextStyleFieldDisabled(element) {
|
47
|
+
var type = getElementType(element);
|
48
|
+
var handler = _elements["default"][type];
|
49
|
+
|
50
|
+
if (handler) {
|
51
|
+
if (handler.getFieldDisabled) {
|
52
|
+
return handler.getFieldDisabled(element) || {};
|
53
|
+
}
|
54
|
+
|
55
|
+
return {};
|
56
|
+
}
|
57
|
+
|
58
|
+
return null;
|
59
|
+
}
|
60
|
+
|
61
|
+
function getTextStyle(htSelection, styleNames) {
|
62
|
+
// 多选时值相同返回?
|
63
|
+
var values = htSelection.map(function (element) {
|
64
|
+
return getElementTextStyle(element);
|
65
|
+
}).filter(function (item) {
|
66
|
+
return !!item;
|
67
|
+
});
|
68
|
+
var value = {};
|
69
|
+
|
70
|
+
if (values.length) {
|
71
|
+
styleNames.forEach(function (styleName) {
|
72
|
+
var val = values[0][styleName];
|
73
|
+
var different = values.filter(function (obj) {
|
74
|
+
return obj[styleName] !== val;
|
75
|
+
});
|
76
|
+
|
77
|
+
if (!different.length) {
|
78
|
+
value[styleName] = val;
|
79
|
+
}
|
80
|
+
});
|
81
|
+
} // 多选时元素都不支持字段时禁用
|
82
|
+
|
83
|
+
|
84
|
+
var fieldDisableds = htSelection.map(function (element) {
|
85
|
+
return getElementTextStyleFieldDisabled(element);
|
86
|
+
}).filter(function (item) {
|
87
|
+
return !!item;
|
88
|
+
});
|
89
|
+
var fieldDisabled = styleNames.reduce(function (result, fieldName) {
|
90
|
+
var _extends2;
|
91
|
+
|
92
|
+
var disabled = fieldDisableds.length && fieldDisableds.filter(function (item) {
|
93
|
+
return !!item[fieldName];
|
94
|
+
}).length === fieldDisableds.length;
|
95
|
+
return (0, _extends3["default"])({}, result, (_extends2 = {}, _extends2[fieldName] = disabled, _extends2));
|
96
|
+
}, {});
|
97
|
+
return {
|
98
|
+
style: value,
|
99
|
+
fieldDisabled: fieldDisabled,
|
100
|
+
debugData: {
|
101
|
+
values: values,
|
102
|
+
fieldDisableds: fieldDisableds
|
103
|
+
}
|
104
|
+
};
|
105
|
+
}
|
106
|
+
|
107
|
+
function setTextStyle(element, style, topo) {
|
108
|
+
var type = getElementType(element);
|
109
|
+
var handler = _elements["default"][type];
|
110
|
+
|
111
|
+
if (handler) {
|
112
|
+
handler.setTextStyle(element, style, topo);
|
113
|
+
}
|
114
|
+
}
|
@@ -0,0 +1,44 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
5
|
+
exports.__esModule = true;
|
6
|
+
exports["default"] = void 0;
|
7
|
+
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
9
|
+
|
10
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
11
|
+
|
12
|
+
var _react = _interopRequireWildcard(require("react"));
|
13
|
+
|
14
|
+
var _globalTag = require("./globalTag");
|
15
|
+
|
16
|
+
var _excluded = ["Component"];
|
17
|
+
|
18
|
+
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); }
|
19
|
+
|
20
|
+
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; }
|
21
|
+
|
22
|
+
var fieldDisabled = {
|
23
|
+
fontSize: true
|
24
|
+
};
|
25
|
+
|
26
|
+
function GlobalTagStyleSetting(props) {
|
27
|
+
var topo = props.topo;
|
28
|
+
var Component = props.Component,
|
29
|
+
widgetProps = (0, _objectWithoutPropertiesLoose2["default"])(props, _excluded);
|
30
|
+
var values = (0, _globalTag.useValues)(topo);
|
31
|
+
var setStyle = (0, _react.useMemo)(function () {
|
32
|
+
return function (style) {
|
33
|
+
return (0, _globalTag.setGlobalTagStyle)(topo, style);
|
34
|
+
};
|
35
|
+
}, []);
|
36
|
+
return /*#__PURE__*/_react["default"].createElement(Component, (0, _extends2["default"])({
|
37
|
+
style: values,
|
38
|
+
setStyle: setStyle,
|
39
|
+
fieldDisabled: fieldDisabled
|
40
|
+
}, widgetProps));
|
41
|
+
}
|
42
|
+
|
43
|
+
var _default = GlobalTagStyleSetting;
|
44
|
+
exports["default"] = _default;
|
@@ -0,0 +1,72 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
5
|
+
exports.__esModule = true;
|
6
|
+
exports.setGlobalTagStyle = void 0;
|
7
|
+
exports.setStyle = setStyle;
|
8
|
+
exports.useValues = useValues;
|
9
|
+
|
10
|
+
var _objectWithoutPropertiesLoose2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutPropertiesLoose"));
|
11
|
+
|
12
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
13
|
+
|
14
|
+
var _colorUtil = require("../ElementTextStyleSetting/colorUtil");
|
15
|
+
|
16
|
+
var _excluded = ["color", "background", "opacity"];
|
17
|
+
var defaultStyle = {
|
18
|
+
color: '#AFB9C2',
|
19
|
+
fontFamily: '微软雅黑'
|
20
|
+
};
|
21
|
+
|
22
|
+
function useValues(topo) {
|
23
|
+
var displayConfigState = topo.store.useModelState('displayConfig');
|
24
|
+
var nodeLabelStyle = displayConfigState.nodeLabelStyle,
|
25
|
+
defaultEdgeLabelStyle = displayConfigState.defaultEdgeLabelStyle;
|
26
|
+
return (0, _extends2["default"])({
|
27
|
+
color: (nodeLabelStyle === null || nodeLabelStyle === void 0 ? void 0 : nodeLabelStyle.color) || defaultStyle.color,
|
28
|
+
fontFamily: (nodeLabelStyle === null || nodeLabelStyle === void 0 ? void 0 : nodeLabelStyle.fontFamily) || defaultStyle.fontFamily,
|
29
|
+
fontSize: nodeLabelStyle === null || nodeLabelStyle === void 0 ? void 0 : nodeLabelStyle.fontSize
|
30
|
+
}, (0, _colorUtil.parseBackground)(nodeLabelStyle === null || nodeLabelStyle === void 0 ? void 0 : nodeLabelStyle.background));
|
31
|
+
}
|
32
|
+
|
33
|
+
var setGlobalTagStyle = function setGlobalTagStyle(topo, styleData) {
|
34
|
+
var _topo$store$getModel = topo.store.getModel('displayConfig'),
|
35
|
+
displayConfigState = _topo$store$getModel[0],
|
36
|
+
displayConfigDispatchers = _topo$store$getModel[1];
|
37
|
+
|
38
|
+
var nodeLabelStyle = displayConfigState.nodeLabelStyle,
|
39
|
+
defaultEdgeLabelStyle = displayConfigState.defaultEdgeLabelStyle;
|
40
|
+
var style = buildStyle(styleData, nodeLabelStyle);
|
41
|
+
var globalNodeLabelStyle = (0, _extends2["default"])({}, nodeLabelStyle, style);
|
42
|
+
var globalEdgeTagStyle = (0, _extends2["default"])({}, nodeLabelStyle, defaultEdgeLabelStyle, style);
|
43
|
+
topo.getHtTopo().setGlobalNodeLabelStyle(globalNodeLabelStyle);
|
44
|
+
topo.getHtTopo().setGlobalEdgeTagStyle(globalEdgeTagStyle);
|
45
|
+
displayConfigDispatchers.update({
|
46
|
+
nodeLabelStyle: globalNodeLabelStyle,
|
47
|
+
defaultEdgeLabelStyle: globalEdgeTagStyle
|
48
|
+
});
|
49
|
+
};
|
50
|
+
|
51
|
+
exports.setGlobalTagStyle = setGlobalTagStyle;
|
52
|
+
|
53
|
+
function buildStyle(styleData, prevTagStyle) {
|
54
|
+
var color = styleData.color,
|
55
|
+
background = styleData.background,
|
56
|
+
opacity = styleData.opacity,
|
57
|
+
otherStyle = (0, _objectWithoutPropertiesLoose2["default"])(styleData, _excluded);
|
58
|
+
var style = (0, _extends2["default"])({}, prevTagStyle, otherStyle);
|
59
|
+
|
60
|
+
if ('color' in styleData) {
|
61
|
+
style.color = color.hex;
|
62
|
+
}
|
63
|
+
|
64
|
+
if ('background' in styleData || 'opacity' in styleData) {
|
65
|
+
var prevBackgroundStyle = (0, _colorUtil.parseBackground)(prevTagStyle === null || prevTagStyle === void 0 ? void 0 : prevTagStyle.background);
|
66
|
+
style.background = (0, _colorUtil.formatBackgroundRgbaColor)(prevBackgroundStyle, styleData);
|
67
|
+
}
|
68
|
+
|
69
|
+
return style;
|
70
|
+
}
|
71
|
+
|
72
|
+
function setStyle() {}
|
@@ -0,0 +1,31 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
5
|
+
exports.__esModule = true;
|
6
|
+
exports["default"] = void 0;
|
7
|
+
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
9
|
+
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
11
|
+
|
12
|
+
var _ElementTextStyleSetting = _interopRequireDefault(require("./ElementTextStyleSetting/ElementTextStyleSetting"));
|
13
|
+
|
14
|
+
var _GlobalTagStyleSetting = _interopRequireDefault(require("./GlobalTagStyleSetting/GlobalTagStyleSetting"));
|
15
|
+
|
16
|
+
function textStyleSettingRouter(Component, options) {
|
17
|
+
var names = (options === null || options === void 0 ? void 0 : options.names) || [];
|
18
|
+
return function TextStyleSettingButton(props) {
|
19
|
+
var topo = props.topo;
|
20
|
+
var selection = topo.selectionModel.useHtSelection();
|
21
|
+
var Widget = !selection.length ? _GlobalTagStyleSetting["default"] : _ElementTextStyleSetting["default"];
|
22
|
+
return /*#__PURE__*/_react["default"].createElement(Widget, (0, _extends2["default"])({
|
23
|
+
Component: Component
|
24
|
+
}, props, {
|
25
|
+
styleNames: names
|
26
|
+
}));
|
27
|
+
};
|
28
|
+
}
|
29
|
+
|
30
|
+
var _default = textStyleSettingRouter;
|
31
|
+
exports["default"] = _default;
|
@@ -0,0 +1,20 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
5
|
+
exports.__esModule = true;
|
6
|
+
exports["default"] = void 0;
|
7
|
+
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
9
|
+
|
10
|
+
var _useNewElementTheme = _interopRequireDefault(require("../../hooks/useNewElementTheme"));
|
11
|
+
|
12
|
+
function AddElementThemePlugin(props) {
|
13
|
+
(0, _useNewElementTheme["default"])({
|
14
|
+
topo: props.topo
|
15
|
+
});
|
16
|
+
return null;
|
17
|
+
}
|
18
|
+
|
19
|
+
var _default = AddElementThemePlugin;
|
20
|
+
exports["default"] = _default;
|
@@ -0,0 +1,46 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
|
+
|
5
|
+
exports.__esModule = true;
|
6
|
+
exports["default"] = void 0;
|
7
|
+
|
8
|
+
var _configProvider = _interopRequireDefault(require("@alifd/next/lib/config-provider"));
|
9
|
+
|
10
|
+
var _icon = _interopRequireDefault(require("@alifd/next/lib/icon"));
|
11
|
+
|
12
|
+
var _react = _interopRequireDefault(require("react"));
|
13
|
+
|
14
|
+
var _CloseablePanelModule = _interopRequireDefault(require("./CloseablePanel.module.scss"));
|
15
|
+
|
16
|
+
function CloseablePanel(props) {
|
17
|
+
var prefix = props.prefix,
|
18
|
+
title = props.title,
|
19
|
+
onClose = props.onClose,
|
20
|
+
children = props.children;
|
21
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
22
|
+
className: _CloseablePanelModule["default"].panel
|
23
|
+
}, /*#__PURE__*/_react["default"].createElement("div", {
|
24
|
+
className: prefix + "drawer-header",
|
25
|
+
role: "heading",
|
26
|
+
"aria-level": "1"
|
27
|
+
}, title, /*#__PURE__*/_react["default"].createElement("a", {
|
28
|
+
role: "button",
|
29
|
+
"aria-label": "\u5173\u95ED",
|
30
|
+
className: prefix + "drawer-close",
|
31
|
+
onClick: onClose
|
32
|
+
}, /*#__PURE__*/_react["default"].createElement(_icon["default"], {
|
33
|
+
type: "close",
|
34
|
+
className: "next-drawer-close-icon"
|
35
|
+
}))), /*#__PURE__*/_react["default"].createElement("div", {
|
36
|
+
className: _CloseablePanelModule["default"].body
|
37
|
+
}, children));
|
38
|
+
}
|
39
|
+
|
40
|
+
CloseablePanel.defaultProps = {
|
41
|
+
prefix: 'next-'
|
42
|
+
};
|
43
|
+
|
44
|
+
var _default = _configProvider["default"].config(CloseablePanel);
|
45
|
+
|
46
|
+
exports["default"] = _default;
|
@@ -0,0 +1,21 @@
|
|
1
|
+
@import '~@alifd/next/variables.scss';
|
2
|
+
|
3
|
+
|
4
|
+
.panel {
|
5
|
+
height: 100%;
|
6
|
+
display: flex;
|
7
|
+
flex-direction: column;
|
8
|
+
background: #FFFFFF;
|
9
|
+
|
10
|
+
|
11
|
+
:global {
|
12
|
+
.#{$css-prefix}drawer-header {
|
13
|
+
padding-left: 16px;
|
14
|
+
padding-right: 16px;
|
15
|
+
}
|
16
|
+
}
|
17
|
+
}
|
18
|
+
.body {
|
19
|
+
flex: 1;
|
20
|
+
overflow: auto;
|
21
|
+
}
|
@@ -3,45 +3,92 @@
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
4
|
|
5
5
|
exports.__esModule = true;
|
6
|
-
exports["default"] =
|
6
|
+
exports["default"] = PropertyPanel;
|
7
7
|
|
8
|
-
var
|
8
|
+
var _classnames = _interopRequireDefault(require("classnames"));
|
9
|
+
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
11
|
+
|
12
|
+
var _CloseablePanel = _interopRequireDefault(require("./CloseablePanel"));
|
13
|
+
|
14
|
+
var _edgePropertyViewAdapter = require("./core/edgePropertyViewAdapter");
|
15
|
+
|
16
|
+
var _PropertyViewManager = _interopRequireDefault(require("./core/PropertyViewManager"));
|
9
17
|
|
10
18
|
var _Settings = _interopRequireDefault(require("./Settings"));
|
11
19
|
|
12
20
|
var _SettingsModule = _interopRequireDefault(require("./Settings.module.scss"));
|
13
21
|
|
14
|
-
function
|
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); }
|
23
|
+
|
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; }
|
25
|
+
|
26
|
+
function PropertyPanel(props) {
|
27
|
+
var _classNames;
|
28
|
+
|
15
29
|
var topo = props.topo,
|
16
30
|
editorProps = props.editorProps;
|
17
31
|
var store = topo.store;
|
18
32
|
var topoState = store.useModelState('topoMod');
|
33
|
+
var topoShowType = topoState.type,
|
34
|
+
graphLoaded = topoState.graphLoaded;
|
19
35
|
|
20
36
|
var _store$useModelState = store.useModelState('selection'),
|
21
37
|
selection = _store$useModelState.selection;
|
22
38
|
|
23
|
-
var
|
24
|
-
|
39
|
+
var _topo$store$useModel = topo.store.useModel('topoEdit'),
|
40
|
+
topoEditState = _topo$store$useModel[0],
|
41
|
+
topoEditDispatchers = _topo$store$useModel[1];
|
42
|
+
|
43
|
+
var propertyPanelVisible = topoEditState.propertyPanelVisible;
|
44
|
+
var propertyViewManager = (0, _react.useMemo)(function () {
|
45
|
+
return new _PropertyViewManager["default"](topo);
|
46
|
+
}, []); // 临时适配连线属性面板类型,后期组件支持自定义适配
|
47
|
+
|
48
|
+
(0, _edgePropertyViewAdapter.addEdgePropertyViews)(propertyViewManager, editorProps);
|
25
49
|
|
26
|
-
|
27
|
-
return
|
28
|
-
}
|
50
|
+
propertyViewManager.customGetViewType = editorProps.getPropertyViewType || function (elements) {
|
51
|
+
return (0, _edgePropertyViewAdapter.adapterGetEdgePropertyViewType)(elements, editorProps);
|
52
|
+
};
|
53
|
+
|
54
|
+
var PropertyView = propertyViewManager.getPropertyView();
|
55
|
+
(0, _react.useEffect)(function () {
|
56
|
+
if (graphLoaded) {
|
57
|
+
propertyViewManager.init();
|
58
|
+
}
|
59
|
+
|
60
|
+
return function () {
|
61
|
+
propertyViewManager.destroy();
|
62
|
+
};
|
63
|
+
}, [graphLoaded, propertyViewManager]); // 没有视图关闭属性面板
|
64
|
+
|
65
|
+
(0, _react.useEffect)(function () {
|
66
|
+
if (propertyPanelVisible && !PropertyView) {
|
67
|
+
propertyViewManager.close();
|
68
|
+
}
|
69
|
+
}, [propertyPanelVisible, PropertyView, propertyViewManager]);
|
29
70
|
|
30
71
|
var renderContent = function renderContent() {
|
31
|
-
if (!
|
72
|
+
if (!propertyPanelVisible || !PropertyView) {
|
32
73
|
return null;
|
33
74
|
}
|
34
75
|
|
35
76
|
return /*#__PURE__*/_react["default"].createElement(_Settings["default"], {
|
36
77
|
topo: topo,
|
78
|
+
selection: selection,
|
79
|
+
PropertyView: PropertyView,
|
37
80
|
topoShowType: topoShowType,
|
38
81
|
topoEditApi: topo.topoEdit,
|
39
|
-
selection: selection,
|
40
82
|
editorProps: editorProps
|
41
83
|
});
|
42
84
|
};
|
43
85
|
|
44
86
|
return /*#__PURE__*/_react["default"].createElement("div", {
|
45
|
-
className: _SettingsModule["default"].
|
46
|
-
},
|
87
|
+
className: (0, _classnames["default"])(_SettingsModule["default"].propertyPanel, (_classNames = {}, _classNames[_SettingsModule["default"].hide] = !propertyPanelVisible, _classNames))
|
88
|
+
}, /*#__PURE__*/_react["default"].createElement(_CloseablePanel["default"], {
|
89
|
+
title: "\u6570\u636E\u5C5E\u6027",
|
90
|
+
onClose: function onClose() {
|
91
|
+
propertyViewManager.close();
|
92
|
+
}
|
93
|
+
}, renderContent()));
|
47
94
|
}
|
@@ -3,149 +3,67 @@
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
4
|
|
5
5
|
exports.__esModule = true;
|
6
|
-
exports["default"] =
|
6
|
+
exports["default"] = PropertyViewContainer;
|
7
7
|
|
8
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
9
9
|
|
10
|
-
var _react =
|
11
|
-
|
12
|
-
var _htElementDataUtil = require("../../../../utils/htElementDataUtil");
|
13
|
-
|
14
|
-
var _propertyViews = _interopRequireDefault(require("./propertyViews"));
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
15
11
|
|
16
12
|
var _useSettingRuntimeState = _interopRequireDefault(require("./useSettingRuntimeState"));
|
17
13
|
|
18
|
-
var
|
14
|
+
var _updateElementProperty = _interopRequireDefault(require("./core/updateElementProperty"));
|
19
15
|
|
20
|
-
function
|
21
|
-
var selectionElement = selection[0];
|
22
|
-
var selectionSize = selection.length;
|
23
|
-
var elementType;
|
16
|
+
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); }
|
24
17
|
|
25
|
-
|
26
|
-
// 未选
|
27
|
-
elementType = "view";
|
28
|
-
} else if (selectionSize >= 2) {
|
29
|
-
// 多选
|
30
|
-
elementType = "multiple";
|
31
|
-
} else if ((0, _htElementDataUtil.isGroup)(selectionElement)) {
|
32
|
-
elementType = "group";
|
33
|
-
} else if (selectionElement.attrObject.topLeftText) {
|
34
|
-
// TODO 临时方式
|
35
|
-
elementType = "box";
|
36
|
-
} else if ((0, _htElementDataUtil.isNode)(selectionElement)) {
|
37
|
-
elementType = "node";
|
38
|
-
} else if ((0, _htElementDataUtil.isEdge)(selectionElement)) {
|
39
|
-
elementType = "edge";
|
40
|
-
} else if ((0, _htElementDataUtil.isLayer)(selectionElement)) {
|
41
|
-
// 分层
|
42
|
-
elementType = "layer";
|
43
|
-
} else if ((0, _htElementDataUtil.isText)(selectionElement)) {
|
44
|
-
elementType = "text";
|
45
|
-
}
|
18
|
+
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; }
|
46
19
|
|
47
|
-
|
20
|
+
function buildElementValues(selection) {
|
21
|
+
var values = (0, _extends2["default"])({}, selection[0]);
|
22
|
+
var attrTypes = ['attrObject', 'position', 'styleMap'];
|
23
|
+
attrTypes.forEach(function (type) {
|
24
|
+
Object.keys(values[type] || {}).forEach(function (key) {
|
25
|
+
values[type + "." + key] = values[type][key];
|
26
|
+
});
|
27
|
+
});
|
28
|
+
return values;
|
48
29
|
}
|
49
30
|
|
50
|
-
function
|
31
|
+
function PropertyViewContainer(props) {
|
51
32
|
var topo = props.topo,
|
52
33
|
topoShowType = props.topoShowType,
|
53
34
|
topoEditApi = props.topoEditApi,
|
54
35
|
selection = props.selection,
|
55
|
-
editorProps = props.editorProps
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
}
|
72
|
-
element.setPosition(name.replace("position.", ""), value);
|
73
|
-
} else if (name.startsWith("styleMap.")) {
|
74
|
-
element.setStyle(name.replace("styleMap.", ""), value);
|
75
|
-
} else if (name === "name") {
|
76
|
-
element.setName(value);
|
77
|
-
} else if (name === "width") {
|
78
|
-
element.setWidth(value);
|
79
|
-
} else if (name === "height") {
|
80
|
-
element.setHeight(value);
|
81
|
-
} else if (name === "image") {
|
82
|
-
element.setImage(value);
|
83
|
-
} else if (name === "layout") {
|
84
|
-
// console.info("element----layout", element, value);
|
85
|
-
var layouType = value.id === "toward" ? "" + value.id + value.options.subId : value.id; // console.info(
|
86
|
-
// "element----layout",
|
87
|
-
// topo.view.topoClient.htTopoClient,
|
88
|
-
// layouType
|
89
|
-
// );
|
90
|
-
|
91
|
-
topo.getHtTopo().layoutInContainer(layouType); // let autoLayout = new ht.layout.AutoLayout(gv);
|
92
|
-
// const layouType=value.id==='toward'?`${value.id}${value.options.subId}`:value.id;
|
93
|
-
// gv.dm().sm().ss(element.getChildren());
|
94
|
-
// autoLayout.layout(layouType, function () {
|
95
|
-
// gv.dm().sm().ss(element);
|
96
|
-
// });
|
97
|
-
} else if (name === "groupAlign") {
|
98
|
-
var selectList = [];
|
99
|
-
|
100
|
-
if (selection.length === 1) {
|
101
|
-
// 选择分层
|
102
|
-
if (element instanceof ht.Grid) {
|
103
|
-
// selectList = gv
|
104
|
-
// .dm()
|
105
|
-
// .toDatas((d) => d.getHost() === gv.dm().sm().ld())
|
106
|
-
// .toArray();
|
107
|
-
selectList = element.getChildren().toArray();
|
108
|
-
} // 选择分区
|
109
|
-
|
110
|
-
|
111
|
-
if (element instanceof ht.Group) {
|
112
|
-
selectList = element.getChildren().toArray();
|
113
|
-
}
|
114
|
-
} else {
|
115
|
-
selectList = topo.getSelectionModel().getSelection().toArray();
|
116
|
-
} // console.info("element--selectList", element, selectList);
|
117
|
-
|
118
|
-
|
119
|
-
topo.view.topoClient.htTopoClient.setAlignmentBySelectionNodes(value, selectList);
|
120
|
-
}
|
121
|
-
};
|
122
|
-
|
123
|
-
var elementType = getElementType(selection);
|
124
|
-
var PropertyView = _propertyViews["default"][elementType];
|
125
|
-
|
126
|
-
if (!PropertyView) {
|
127
|
-
return null;
|
36
|
+
editorProps = props.editorProps,
|
37
|
+
PropertyView = props.PropertyView;
|
38
|
+
var settingRuntimeState = (0, _useSettingRuntimeState["default"])();
|
39
|
+
var selectionElements = (0, _react.useMemo)(function () {
|
40
|
+
return topo.selectionModel.getSelection();
|
41
|
+
}, [selection]); // 不建议使用,直接使用ht元素对象。待优化
|
42
|
+
|
43
|
+
var singleElementValues = (0, _react.useMemo)(function () {
|
44
|
+
return selection.length === 1 ? buildElementValues(selection) : undefined;
|
45
|
+
}, [selection]);
|
46
|
+
var elementProps = {};
|
47
|
+
|
48
|
+
if (selection.length === 1) {
|
49
|
+
elementProps = {
|
50
|
+
selectionElement: selectionElements[0],
|
51
|
+
values: singleElementValues
|
52
|
+
};
|
128
53
|
}
|
129
54
|
|
130
|
-
|
131
|
-
var values = (0, _extends2["default"])({}, selection[0]);
|
132
|
-
attrTypes.forEach(function (type) {
|
133
|
-
Object.keys(values[type] || {}).forEach(function (key) {
|
134
|
-
values[type + "." + key] = values[type][key];
|
135
|
-
});
|
136
|
-
});
|
137
|
-
return /*#__PURE__*/_react["default"].createElement("div", {
|
138
|
-
className: _SettingsModule["default"].settings
|
139
|
-
}, /*#__PURE__*/_react["default"].createElement(PropertyView, {
|
140
|
-
type: elementType,
|
55
|
+
return /*#__PURE__*/_react["default"].createElement(PropertyView, (0, _extends2["default"])({
|
141
56
|
topo: topo,
|
57
|
+
selection: selection,
|
58
|
+
selectionElements: selectionElements,
|
142
59
|
topoShowType: topoShowType,
|
143
60
|
topoEdit: topoEditApi,
|
144
61
|
topoEditApi: topoEditApi,
|
145
|
-
|
146
|
-
|
147
|
-
onChange:
|
148
|
-
|
62
|
+
editorProps: editorProps
|
63
|
+
}, elementProps, {
|
64
|
+
onChange: function onChange(name, value) {
|
65
|
+
(0, _updateElementProperty["default"])(topo, name, value);
|
66
|
+
},
|
149
67
|
settingRuntimeState: settingRuntimeState
|
150
68
|
}));
|
151
69
|
}
|