@riil-frontend/component-topology 6.0.0-alpha.8 → 6.0.1
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 +259 -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 +22 -0
- package/es/core/components/TopoView/editor.module.scss +1 -0
- package/es/core/components/TopoView/topoView.js +30 -60
- package/es/core/components/titlebar/TitleBar.module.scss +1 -1
- package/es/core/editor/components/EditorPlugin.js +18 -2
- package/es/core/editor/components/Sidebar/Sidebar.js +29 -7
- package/es/core/editor/components/Sidebar/panes.js +10 -5
- package/es/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.js +13 -37
- package/es/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +109 -0
- package/es/core/editor/components/Sidebar/views/CanvasPanel/hooks/useUpdateHtTopoDefaultTagStyle.js +27 -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 +166 -16
- package/es/core/editor/components/Toolbar/widgets/FontColorButton.module.scss +42 -0
- package/es/core/editor/components/Toolbar/widgets/FontFamilyWidget.js +26 -12
- package/es/core/editor/components/Toolbar/widgets/FontSizeWidget.js +37 -12
- package/es/core/editor/components/Toolbar/widgets/FontStyleButton.js +92 -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 +19 -8
- package/es/core/editor/components/Toolbar/widgets/components/DropdownMenu.js +21 -7
- 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 +41 -0
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +65 -0
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/groupTitle.js +65 -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 +73 -0
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/nodeTag.js +69 -0
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/text.js +37 -0
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/textStyleUtil.js +124 -0
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/GlobalTagStyleSetting.js +31 -0
- package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/globalTag.js +98 -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 +105 -0
- package/es/core/editor/hooks/useKeyboardShortcut.js +39 -0
- package/es/core/editor/hooks/useNewElementTheme.js +46 -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 +54 -0
- package/es/core/hooks/useManageStatus.js +1 -9
- package/es/core/hooks/usePolling.js +2 -5
- package/es/core/hooks/useTopoEdit.js +15 -8
- 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/customIcon.js +1 -3
- 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 +18 -13
- package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +38 -19
- 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 +278 -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 +32 -0
- package/lib/core/components/TopoView/editor.module.scss +1 -0
- package/lib/core/components/TopoView/topoView.js +36 -67
- package/lib/core/components/titlebar/TitleBar.module.scss +1 -1
- package/lib/core/editor/components/EditorPlugin.js +26 -2
- package/lib/core/editor/components/Sidebar/Sidebar.js +28 -6
- package/lib/core/editor/components/Sidebar/panes.js +10 -5
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.js +14 -38
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +123 -0
- package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useUpdateHtTopoDefaultTagStyle.js +37 -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 +172 -16
- package/lib/core/editor/components/Toolbar/widgets/FontColorButton.module.scss +42 -0
- package/lib/core/editor/components/Toolbar/widgets/FontFamilyWidget.js +27 -11
- package/lib/core/editor/components/Toolbar/widgets/FontSizeWidget.js +38 -11
- package/lib/core/editor/components/Toolbar/widgets/FontStyleButton.js +96 -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 +19 -8
- package/lib/core/editor/components/Toolbar/widgets/components/DropdownMenu.js +22 -7
- 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 +58 -0
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +86 -0
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/groupTitle.js +88 -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 +90 -0
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/nodeTag.js +90 -0
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/text.js +54 -0
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/textStyleUtil.js +141 -0
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/GlobalTagStyleSetting.js +46 -0
- package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/globalTag.js +111 -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 +114 -0
- package/lib/core/editor/hooks/useKeyboardShortcut.js +49 -0
- package/lib/core/editor/hooks/useNewElementTheme.js +57 -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 +68 -0
- package/lib/core/hooks/useManageStatus.js +1 -9
- package/lib/core/hooks/usePolling.js +2 -5
- package/lib/core/hooks/useTopoEdit.js +16 -8
- 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/customIcon.js +1 -3
- 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 +18 -13
- package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +38 -19
- 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,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
|
}
|
@@ -1,20 +1,23 @@
|
|
1
1
|
@import '~@alifd/next/variables.scss';
|
2
2
|
|
3
|
-
.
|
3
|
+
.propertyPanel {
|
4
4
|
width: 280px;
|
5
5
|
height: 100%;
|
6
6
|
position: absolute;
|
7
7
|
top: 0;
|
8
8
|
right: 0;
|
9
9
|
border-radius: 2px;
|
10
|
-
|
11
|
-
//border-left: none;
|
10
|
+
border-left: 1px solid #E6E7EB;
|
12
11
|
|
13
12
|
display: flex;
|
14
13
|
flex-direction: column;
|
15
14
|
overflow: hidden;
|
15
|
+
transition: width .1s linear;
|
16
16
|
|
17
|
-
|
17
|
+
&.hide {
|
18
|
+
width: 0;
|
19
|
+
border-left: none;
|
20
|
+
}
|
18
21
|
|
19
22
|
:global {
|
20
23
|
// 滚动条
|
@@ -71,10 +74,3 @@
|
|
71
74
|
align-items: center;
|
72
75
|
}
|
73
76
|
}
|
74
|
-
|
75
|
-
.settings {
|
76
|
-
flex: 1;
|
77
|
-
background: #FFFFFF;
|
78
|
-
overflow: auto;
|
79
|
-
// padding-bottom: 12px;
|
80
|
-
}
|
@@ -6,7 +6,7 @@
|
|
6
6
|
background: #EBECF0;
|
7
7
|
margin-right: 3px;
|
8
8
|
height: 16px;
|
9
|
-
|
9
|
+
width:1px;
|
10
10
|
}
|
11
11
|
}
|
12
12
|
|
@@ -16,8 +16,8 @@
|
|
16
16
|
border-radius: 4px;
|
17
17
|
border: none !important;
|
18
18
|
color: #4D6277;
|
19
|
-
padding-left:
|
20
|
-
margin-right:
|
19
|
+
padding-left: 2px;
|
20
|
+
margin-right: 4px;
|
21
21
|
|
22
22
|
&:active {
|
23
23
|
background: #F2F7FD !important;
|
@@ -0,0 +1,97 @@
|
|
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 _button = _interopRequireDefault(require("@alifd/next/lib/button"));
|
9
|
+
|
10
|
+
var _icon = _interopRequireDefault(require("@alifd/next/lib/icon"));
|
11
|
+
|
12
|
+
var _divider = _interopRequireDefault(require("@alifd/next/lib/divider"));
|
13
|
+
|
14
|
+
var _react = _interopRequireWildcard(require("react"));
|
15
|
+
|
16
|
+
var _AlignSettingModule = _interopRequireDefault(require("./AlignSetting.module.scss"));
|
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 TREE_LAYOUT_OPTIONS = [{
|
23
|
+
value: 'left',
|
24
|
+
label: '左对齐',
|
25
|
+
icon: 'tuopu_zuoceduiqi'
|
26
|
+
}, {
|
27
|
+
value: 'center',
|
28
|
+
label: '水平居中',
|
29
|
+
icon: 'tuopu_shuipingjuzhongduiqi'
|
30
|
+
}, {
|
31
|
+
value: 'right',
|
32
|
+
label: '右对齐',
|
33
|
+
icon: 'tuopu_youceduiqi'
|
34
|
+
}, {
|
35
|
+
value: 'top',
|
36
|
+
label: '靠上对齐',
|
37
|
+
icon: 'tuopu_dingbuduiqi'
|
38
|
+
}, {
|
39
|
+
value: 'middle',
|
40
|
+
label: '垂直居中',
|
41
|
+
icon: 'tuopu_chuizhijuzhongduiqi'
|
42
|
+
}, {
|
43
|
+
value: 'bottom',
|
44
|
+
label: '靠下对齐',
|
45
|
+
icon: 'tuopu_dibuduiqi'
|
46
|
+
}, {
|
47
|
+
value: 'divide'
|
48
|
+
}, {
|
49
|
+
value: 'distributeHorizontal',
|
50
|
+
label: '横向分布',
|
51
|
+
icon: 'tuopu_shuipingdengjianjuduiqi'
|
52
|
+
}, {
|
53
|
+
value: 'distributeVertical',
|
54
|
+
label: '纵向分布',
|
55
|
+
icon: 'tuopu_chuizhidengjianjuduiqi'
|
56
|
+
}];
|
57
|
+
|
58
|
+
var AlignTypeList = function AlignTypeList(props) {
|
59
|
+
var _props$selected = props.selected,
|
60
|
+
selected = _props$selected === void 0 ? 'left' : _props$selected,
|
61
|
+
onChange = props.onChange,
|
62
|
+
distributionDisabled = props.distributionDisabled;
|
63
|
+
|
64
|
+
var _useState = (0, _react.useState)(selected),
|
65
|
+
value = _useState[0],
|
66
|
+
setValue = _useState[1];
|
67
|
+
|
68
|
+
var handleChange = function handleChange(data) {
|
69
|
+
// console.log("handleChange", data);
|
70
|
+
onChange && onChange(data.value);
|
71
|
+
setValue(data.value); // setValue(data)
|
72
|
+
};
|
73
|
+
|
74
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
75
|
+
className: _AlignSettingModule["default"].AlignSetting
|
76
|
+
}, TREE_LAYOUT_OPTIONS.map(function (item, index, array) {
|
77
|
+
return item.value === 'divide' ? /*#__PURE__*/_react["default"].createElement(_divider["default"], {
|
78
|
+
key: index,
|
79
|
+
direction: "ver"
|
80
|
+
}) : /*#__PURE__*/_react["default"].createElement(_button["default"], {
|
81
|
+
key: index,
|
82
|
+
className: "" + _AlignSettingModule["default"].redioBtn,
|
83
|
+
text: true,
|
84
|
+
onClick: function onClick() {
|
85
|
+
handleChange(item);
|
86
|
+
},
|
87
|
+
title: item.label // eslint-disable-next-line no-unneeded-ternary
|
88
|
+
,
|
89
|
+
disabled: (item.value === 'distributeHorizontal' || item.value === 'distributeVertical') && distributionDisabled
|
90
|
+
}, /*#__PURE__*/_react["default"].createElement(_icon["default"], {
|
91
|
+
type: item.icon
|
92
|
+
}));
|
93
|
+
}));
|
94
|
+
};
|
95
|
+
|
96
|
+
var _default = AlignTypeList;
|
97
|
+
exports["default"] = _default;
|
@@ -3,91 +3,32 @@
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
4
4
|
|
5
5
|
exports.__esModule = true;
|
6
|
-
exports["default"] =
|
6
|
+
exports["default"] = AlignSetting;
|
7
7
|
|
8
|
-
var
|
8
|
+
var _react = _interopRequireDefault(require("react"));
|
9
9
|
|
10
|
-
var
|
10
|
+
var _htElementUtils = require("../../../../../../utils/htElementUtils");
|
11
11
|
|
12
|
-
var
|
12
|
+
var _AlignTypeList = _interopRequireDefault(require("./AlignTypeList"));
|
13
13
|
|
14
|
-
|
14
|
+
function AlignSetting(props) {
|
15
|
+
var topo = props.topo,
|
16
|
+
distributionDisabled = props.distributionDisabled;
|
15
17
|
|
16
|
-
var
|
18
|
+
var alignOnChange = function alignOnChange(type) {
|
19
|
+
topo.historyManager.beginTransaction();
|
20
|
+
var selection = topo.getHtTopo().getGraphView().getSelectionModel().getSelection().toArray();
|
21
|
+
var nodes = selection.filter(function (ele) {
|
22
|
+
return !(0, _htElementUtils.isLayer)(ele) && !(0, _htElementUtils.isEdge)(ele);
|
23
|
+
}); // console.info("element--selectList", element, selectList);
|
17
24
|
|
18
|
-
|
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 TREE_LAYOUT_OPTIONS = [{
|
23
|
-
value: "left",
|
24
|
-
label: "左对齐",
|
25
|
-
icon: "tuopu_zuoceduiqi"
|
26
|
-
}, {
|
27
|
-
value: "center",
|
28
|
-
label: "水平居中",
|
29
|
-
icon: "tuopu_shuipingjuzhongduiqi"
|
30
|
-
}, {
|
31
|
-
value: "right",
|
32
|
-
label: "右对齐",
|
33
|
-
icon: "tuopu_youceduiqi"
|
34
|
-
}, {
|
35
|
-
value: "top",
|
36
|
-
label: "靠上对齐",
|
37
|
-
icon: "tuopu_dingbuduiqi"
|
38
|
-
}, {
|
39
|
-
value: "middle",
|
40
|
-
label: "垂直居中",
|
41
|
-
icon: "tuopu_chuizhijuzhongduiqi"
|
42
|
-
}, {
|
43
|
-
value: "bottom",
|
44
|
-
label: "靠下对齐",
|
45
|
-
icon: "tuopu_dibuduiqi"
|
46
|
-
}, {
|
47
|
-
value: "divide"
|
48
|
-
}, {
|
49
|
-
value: "distributeHorizontal",
|
50
|
-
label: "横向分布",
|
51
|
-
icon: "tuopu_shuipingdengjianjuduiqi"
|
52
|
-
}, {
|
53
|
-
value: "distributeVertical",
|
54
|
-
label: "纵向分布",
|
55
|
-
icon: "tuopu_chuizhidengjianjuduiqi"
|
56
|
-
}];
|
57
|
-
|
58
|
-
var AlignSetting = function AlignSetting(props) {
|
59
|
-
var _props$selected = props.selected,
|
60
|
-
selected = _props$selected === void 0 ? "left" : _props$selected,
|
61
|
-
onChange = props.onChange;
|
62
|
-
|
63
|
-
var _useState = (0, _react.useState)(selected),
|
64
|
-
value = _useState[0],
|
65
|
-
setValue = _useState[1];
|
66
|
-
|
67
|
-
var handleChange = function handleChange(data) {
|
68
|
-
// console.log("handleChange", data);
|
69
|
-
onChange && onChange(data.value);
|
70
|
-
setValue(data.value); // setValue(data)
|
25
|
+
topo.view.topoClient.htTopoClient.setAlignmentBySelectionNodes(type, nodes);
|
26
|
+
topo.historyManager.endTransaction();
|
71
27
|
};
|
72
28
|
|
73
|
-
return /*#__PURE__*/_react["default"].createElement("
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
}) : /*#__PURE__*/_react["default"].createElement(_button["default"], {
|
80
|
-
key: index,
|
81
|
-
className: "" + _AlignSettingModule["default"].redioBtn,
|
82
|
-
onClick: function onClick() {
|
83
|
-
handleChange(item);
|
84
|
-
},
|
85
|
-
title: item.label
|
86
|
-
}, /*#__PURE__*/_react["default"].createElement(_icon["default"], {
|
87
|
-
type: item.icon
|
88
|
-
}));
|
89
|
-
}));
|
90
|
-
};
|
91
|
-
|
92
|
-
var _default = AlignSetting;
|
93
|
-
exports["default"] = _default;
|
29
|
+
return /*#__PURE__*/_react["default"].createElement(_AlignTypeList["default"], {
|
30
|
+
onChange: alignOnChange,
|
31
|
+
selected: "left",
|
32
|
+
distributionDisabled: distributionDisabled
|
33
|
+
});
|
34
|
+
}
|