@riil-frontend/component-topology 6.0.0-alpha.9 → 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.
Files changed (376) hide show
  1. package/build/1.js +2 -2
  2. package/build/2.js +1 -1
  3. package/build/index.css +1 -1
  4. package/build/index.js +35 -35
  5. package/demo/CHANGELOG/CHANGELOG.md +5 -0
  6. package/es/components/ColorPanel/components/ColorBlock/index.js +37 -0
  7. package/es/components/ColorPanel/components/ColorBlock/index.module.scss +9 -0
  8. package/es/components/ColorPanel/components/FontColorRange/index.js +35 -0
  9. package/es/components/ColorPanel/components/FontColorRange/index.module.scss +25 -0
  10. package/es/components/ColorPanel/index.js +259 -0
  11. package/es/components/ColorPanel/index.module.scss +35 -0
  12. package/es/components/VerticalIconTab/VerticalIconTab.js +11 -1
  13. package/es/components/VerticalIconTab/VerticalIconTab.module.scss +2 -0
  14. package/es/components/collapse/Collapse.js +22 -3
  15. package/es/components/collapse/Collapse.module.scss +24 -0
  16. package/es/components/collapse/index.js +2 -0
  17. package/es/core/common/hooks/useHtElements.js +21 -0
  18. package/es/core/common/icons/icon.js +40 -0
  19. package/es/core/common/icons/useIcons.js +5 -19
  20. package/es/core/components/AlarmListPanel/components/AlarmListItem.js +14 -13
  21. package/es/core/components/AlarmListPanel/components/index.module.scss +5 -5
  22. package/es/core/components/DisplaySettingDrawer/DisplaySetting.js +2 -1
  23. package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +9 -3
  24. package/es/core/components/DisplaySettingDrawer/EditorDisplaySetting.js +122 -0
  25. package/es/core/components/DisplaySettingDrawer/LineExpandAllRadioGroup.js +0 -3
  26. package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +84 -22
  27. package/es/core/components/TopoView/GraphViewPanel.js +22 -0
  28. package/es/core/components/TopoView/editor.module.scss +1 -0
  29. package/es/core/components/TopoView/topoView.js +30 -60
  30. package/es/core/components/titlebar/TitleBar.module.scss +1 -1
  31. package/es/core/editor/components/EditorPlugin.js +18 -2
  32. package/es/core/editor/components/Sidebar/Sidebar.js +29 -7
  33. package/es/core/editor/components/Sidebar/panes.js +10 -5
  34. package/es/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.js +11 -30
  35. package/es/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +109 -0
  36. package/es/core/editor/components/Sidebar/views/CanvasPanel/hooks/useUpdateHtTopoDefaultTagStyle.js +27 -0
  37. package/es/core/editor/components/Sidebar/views/CanvasPanel/utils/elementThemeUtil.js +0 -0
  38. package/es/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +3 -3
  39. package/es/core/editor/components/Sidebar/views/ImagePanel/HtCustomImagePanel.js +12 -1
  40. package/es/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.js +12 -1
  41. package/es/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.module.scss +3 -3
  42. package/es/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +27 -8
  43. package/es/core/editor/components/Toolbar/buttons.js +2 -2
  44. package/es/core/editor/components/Toolbar/widgets/AddResourceButton.js +1 -1
  45. package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundButton.js +3 -3
  46. package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/Content.js +46 -2
  47. package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +98 -6
  48. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +59 -25
  49. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +3 -5
  50. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/constants.js +77 -0
  51. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +52 -5
  52. package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +166 -16
  53. package/es/core/editor/components/Toolbar/widgets/FontColorButton.module.scss +42 -0
  54. package/es/core/editor/components/Toolbar/widgets/FontFamilyWidget.js +26 -12
  55. package/es/core/editor/components/Toolbar/widgets/FontSizeWidget.js +37 -12
  56. package/es/core/editor/components/Toolbar/widgets/FontStyleButton.js +92 -39
  57. package/es/core/editor/components/Toolbar/widgets/IconSelect/index.module.scss +4 -2
  58. package/es/core/editor/components/Toolbar/widgets/IconSelect/popUpContent.js +1 -2
  59. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutSettings.js +99 -0
  60. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutSettings.module.scss +70 -0
  61. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagImageSelect/index.js +42 -0
  62. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagImageSelect/index.module.scss +7 -0
  63. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagSelect/index.js +75 -0
  64. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagSelect/index.scss +32 -0
  65. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/Icon.js +23 -0
  66. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/index.js +10 -0
  67. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_circular.svg +10 -0
  68. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_hierarchical.svg +10 -0
  69. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_rectangle.svg +12 -0
  70. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_toward.svg +16 -0
  71. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/index.js +31 -0
  72. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/index.module.scss +53 -0
  73. package/es/core/editor/components/Toolbar/widgets/Layout/index.js +130 -15
  74. package/es/core/editor/components/Toolbar/widgets/NodeAlignWidget.js +107 -23
  75. package/es/core/editor/components/Toolbar/widgets/NodeAlignWidget.module.scss +33 -0
  76. package/es/core/editor/components/Toolbar/widgets/NodeImageButton/BoxBackgroundSetting.js +2 -2
  77. package/es/core/editor/components/Toolbar/widgets/NodeImageButton/NodeImageButton.js +20 -7
  78. package/es/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.js +40 -35
  79. package/es/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.module.scss +28 -0
  80. package/es/core/editor/components/Toolbar/widgets/WidgetBox.js +10 -4
  81. package/es/core/editor/components/Toolbar/widgets/WidgetBox.module.scss +10 -1
  82. package/es/core/editor/components/Toolbar/widgets/components/ButtonBox.js +2 -2
  83. package/es/core/editor/components/Toolbar/widgets/components/ButtonBox.module.scss +4 -0
  84. package/es/core/editor/components/Toolbar/widgets/components/DropdownButton.js +19 -8
  85. package/es/core/editor/components/Toolbar/widgets/components/DropdownMenu.js +21 -7
  86. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/ElementTextStyleSetting.js +52 -0
  87. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/colorUtil.js +67 -0
  88. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/box.js +41 -0
  89. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +65 -0
  90. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/groupTitle.js +65 -0
  91. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/index.js +14 -0
  92. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/layerTitle.js +73 -0
  93. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/nodeTag.js +69 -0
  94. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/text.js +37 -0
  95. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/textStyleUtil.js +124 -0
  96. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/GlobalTagStyleSetting.js +31 -0
  97. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/globalTag.js +98 -0
  98. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/textStyleSettingRouter.js +20 -0
  99. package/es/core/editor/components/plugins/AddElementThemePlugin.js +11 -0
  100. package/es/core/editor/components/settings/CloseablePanel.js +33 -0
  101. package/es/core/editor/components/settings/CloseablePanel.module.scss +21 -0
  102. package/es/core/editor/components/settings/PropertyView.js +50 -11
  103. package/es/core/editor/components/settings/Settings.js +37 -122
  104. package/es/core/editor/components/settings/Settings.module.scss +7 -11
  105. package/es/core/editor/components/settings/common/AlignSetting/AlignSetting.module.scss +3 -3
  106. package/es/core/editor/components/settings/common/AlignSetting/AlignTypeList.js +80 -0
  107. package/es/core/editor/components/settings/common/AlignSetting/index.js +20 -72
  108. package/es/core/editor/components/settings/common/GroupNodeList/ResourceList.module.scss +1 -0
  109. package/es/core/editor/components/settings/common/LineType/index.js +11 -102
  110. package/es/core/editor/components/settings/common/NameInput.js +24 -0
  111. package/es/core/editor/components/settings/common/SizeInput/NodeSizeInput.js +21 -18
  112. package/es/core/editor/components/settings/common/text/fontStyleUtil.js +21 -19
  113. package/es/core/editor/components/settings/core/PropertyViewManager.js +81 -0
  114. package/es/core/editor/components/settings/core/edgePropertyViewAdapter.js +22 -0
  115. package/es/core/editor/components/settings/core/getPropertyViewType.js +34 -0
  116. package/es/core/editor/components/settings/core/updateElementProperty.js +21 -0
  117. package/es/core/editor/components/settings/propertyViews/box/BoxPropertyView.js +6 -13
  118. package/es/core/editor/components/settings/propertyViews/box/BoxPropertyViewV1.js +58 -0
  119. package/es/core/editor/components/settings/propertyViews/box/NameInput.js +5 -4
  120. package/es/core/editor/components/settings/propertyViews/edge/CommonEdgePropertyView.js +12 -3
  121. package/es/core/editor/components/settings/propertyViews/edge/EdgeGroupPropertyView.js +7 -8
  122. package/es/core/editor/components/settings/propertyViews/edge/EdgePropertyView.js +9 -23
  123. package/es/core/editor/components/settings/propertyViews/edge/addEdgeProps.js +10 -0
  124. package/es/core/editor/components/settings/propertyViews/edge/edgeGroup/EdgeGroupSetting.js +1 -6
  125. package/es/core/editor/components/settings/propertyViews/group/GroupPropertyView.js +13 -21
  126. package/es/core/editor/components/settings/propertyViews/group/GroupPropertyView.module.scss +8 -1
  127. package/es/core/editor/components/settings/propertyViews/group/GroupPropertyViewV1.js +28 -0
  128. package/es/core/editor/components/settings/propertyViews/group/SettingTab/GroupBasicSetting.js +75 -0
  129. package/es/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js +9 -15
  130. package/es/core/editor/components/settings/propertyViews/group/cluster/ClusterGroupRelateData.js +8 -6
  131. package/es/core/editor/components/settings/propertyViews/index.js +4 -6
  132. package/es/core/editor/components/settings/propertyViews/layer/BasicSetting.js +57 -0
  133. package/es/core/editor/components/settings/propertyViews/layer/LayerPropertyView.js +11 -17
  134. package/es/core/editor/components/settings/propertyViews/layer/LayerPropertyView.module.scss +10 -0
  135. package/es/core/editor/components/settings/propertyViews/layer/LayerPropertyViewV1.js +27 -0
  136. package/es/core/editor/components/settings/propertyViews/multipleElements/MultipleElementLineType.js +5 -7
  137. package/es/core/editor/components/settings/propertyViews/multipleElements/MultipleElementPropertyView.js +2 -15
  138. package/es/core/editor/components/settings/propertyViews/node/NodePropertyView.js +8 -32
  139. package/es/core/editor/components/settings/propertyViews/node/NodePropertyViewV1.js +53 -0
  140. package/es/core/editor/components/settings/propertyViews/node/Setting/BasicSetting.js +49 -0
  141. package/es/core/editor/components/settings/propertyViews/node/Setting/NameInput.js +5 -4
  142. package/es/core/editor/components/settings/propertyViews/node/data/Data.js +2 -1
  143. package/es/core/editor/components/settings/propertyViews/node/data/NodeRelateResourceButton.js +1 -0
  144. package/es/core/editor/components/settings/propertyViews/text/TextPropertyView.js +5 -20
  145. package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +8 -4
  146. package/es/core/editor/config/themes.js +105 -0
  147. package/es/core/editor/hooks/useKeyboardShortcut.js +39 -0
  148. package/es/core/editor/hooks/useNewElementTheme.js +46 -0
  149. package/es/core/editor/store/topoEdit.js +44 -37
  150. package/es/core/editor/utils/edgeTypeStyleUtil.js +34 -11
  151. package/es/core/editor/utils/textStyleUtil.js +0 -0
  152. package/es/core/editor/utils/themeUtil.js +32 -0
  153. package/es/core/hooks/useCanvasTheme.js +54 -0
  154. package/es/core/hooks/useManageStatus.js +1 -9
  155. package/es/core/hooks/usePolling.js +2 -5
  156. package/es/core/hooks/useTopoEdit.js +15 -8
  157. package/es/core/models/Alarm.js +2 -2
  158. package/es/core/models/AttributeMetricDisplay.js +4 -0
  159. package/es/core/models/HistoryManager.js +13 -8
  160. package/es/core/models/{SelectionManager.js → SelectionModel.js} +55 -22
  161. package/es/core/models/TopoApp.js +6 -5
  162. package/es/core/models/selection/ignoreList.js +1 -0
  163. package/es/core/models/utils/linkUtils.js +5 -6
  164. package/es/core/store/models/customIcon.js +1 -3
  165. package/es/core/store/models/selection.js +2 -1
  166. package/es/core/store/models/topoBizMod.js +0 -3
  167. package/es/core/store/models/topoConfig.js +10 -12
  168. package/es/core/store/models/topoMod.js +26 -28
  169. package/es/core/utils/edgeUtil.js +6 -0
  170. package/es/core/utils/showGraphManageStatusUtil.js +7 -1
  171. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +18 -13
  172. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +38 -19
  173. package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/WebConsoleForm.js +13 -29
  174. package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +6 -5
  175. package/es/core/viewer/components/plugins/ViewerPlugin.js +10 -4
  176. package/es/core/viewer/components/titlebar/widgets/SettingButton.js +3 -1
  177. package/es/core/viewer/components/titlebar/widgets/SettingButtonWidget.js +4 -2
  178. package/es/networkTopo/components/editor/propertyViews/edge/EdgeGroupPropertyView.js +2 -1
  179. package/es/networkTopo/components/editor/propertyViews/edge/EdgePropertyView.js +39 -6
  180. package/es/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyView.js +10 -16
  181. package/es/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyViewV1.js +37 -0
  182. package/es/networkTopo/components/editor/propertyViews/edge/link/LinkInfoPreview.module.scss +1 -1
  183. package/es/networkTopo/components/editor/useEditorProps.js +1 -3
  184. package/es/networkTopo/createTopo.js +2 -0
  185. package/es/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
  186. package/es/networkTopo/services/link.js +2 -2
  187. package/es/networkTopo/store/topoTreeMod.js +6 -7
  188. package/es/style.js +28 -27
  189. package/es/utils/htElementUtils.js +3 -0
  190. package/es/utils/topoData.js +1 -0
  191. package/lib/components/ColorPanel/components/ColorBlock/index.js +47 -0
  192. package/lib/components/ColorPanel/components/ColorBlock/index.module.scss +9 -0
  193. package/lib/components/ColorPanel/components/FontColorRange/index.js +49 -0
  194. package/lib/components/ColorPanel/components/FontColorRange/index.module.scss +25 -0
  195. package/lib/components/ColorPanel/index.js +278 -0
  196. package/lib/components/ColorPanel/index.module.scss +35 -0
  197. package/lib/components/VerticalIconTab/VerticalIconTab.js +14 -1
  198. package/lib/components/VerticalIconTab/VerticalIconTab.module.scss +2 -0
  199. package/lib/components/collapse/Collapse.js +28 -3
  200. package/lib/components/collapse/Collapse.module.scss +24 -0
  201. package/lib/components/collapse/index.js +11 -0
  202. package/lib/core/common/hooks/useHtElements.js +27 -0
  203. package/lib/core/common/icons/icon.js +47 -0
  204. package/lib/core/common/icons/useIcons.js +7 -18
  205. package/lib/core/components/AlarmListPanel/components/AlarmListItem.js +14 -13
  206. package/lib/core/components/AlarmListPanel/components/index.module.scss +5 -5
  207. package/lib/core/components/DisplaySettingDrawer/DisplaySetting.js +2 -1
  208. package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +10 -3
  209. package/lib/core/components/DisplaySettingDrawer/EditorDisplaySetting.js +147 -0
  210. package/lib/core/components/DisplaySettingDrawer/LineExpandAllRadioGroup.js +0 -3
  211. package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +84 -22
  212. package/lib/core/components/TopoView/GraphViewPanel.js +32 -0
  213. package/lib/core/components/TopoView/editor.module.scss +1 -0
  214. package/lib/core/components/TopoView/topoView.js +36 -67
  215. package/lib/core/components/titlebar/TitleBar.module.scss +1 -1
  216. package/lib/core/editor/components/EditorPlugin.js +26 -2
  217. package/lib/core/editor/components/Sidebar/Sidebar.js +28 -6
  218. package/lib/core/editor/components/Sidebar/panes.js +10 -5
  219. package/lib/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.js +12 -31
  220. package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +123 -0
  221. package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useUpdateHtTopoDefaultTagStyle.js +37 -0
  222. package/lib/core/editor/components/Sidebar/views/CanvasPanel/utils/elementThemeUtil.js +1 -0
  223. package/lib/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +1 -1
  224. package/lib/core/editor/components/Sidebar/views/ImagePanel/HtCustomImagePanel.js +13 -1
  225. package/lib/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.js +13 -1
  226. package/lib/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.module.scss +3 -3
  227. package/lib/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +36 -12
  228. package/lib/core/editor/components/Toolbar/buttons.js +2 -2
  229. package/lib/core/editor/components/Toolbar/widgets/AddResourceButton.js +1 -1
  230. package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundButton.js +3 -3
  231. package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/Content.js +48 -2
  232. package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +100 -6
  233. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +58 -24
  234. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +3 -3
  235. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/constants.js +83 -0
  236. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +53 -4
  237. package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +172 -16
  238. package/lib/core/editor/components/Toolbar/widgets/FontColorButton.module.scss +42 -0
  239. package/lib/core/editor/components/Toolbar/widgets/FontFamilyWidget.js +27 -11
  240. package/lib/core/editor/components/Toolbar/widgets/FontSizeWidget.js +38 -11
  241. package/lib/core/editor/components/Toolbar/widgets/FontStyleButton.js +96 -39
  242. package/lib/core/editor/components/Toolbar/widgets/IconSelect/index.module.scss +4 -2
  243. package/lib/core/editor/components/Toolbar/widgets/IconSelect/popUpContent.js +1 -2
  244. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutSettings.js +116 -0
  245. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutSettings.module.scss +70 -0
  246. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagImageSelect/index.js +55 -0
  247. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagImageSelect/index.module.scss +7 -0
  248. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagSelect/index.js +93 -0
  249. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagSelect/index.scss +32 -0
  250. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/Icon.js +32 -0
  251. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/index.js +22 -0
  252. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_circular.svg +10 -0
  253. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_hierarchical.svg +10 -0
  254. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_rectangle.svg +12 -0
  255. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_toward.svg +16 -0
  256. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/index.js +44 -0
  257. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/index.module.scss +53 -0
  258. package/lib/core/editor/components/Toolbar/widgets/Layout/index.js +135 -16
  259. package/lib/core/editor/components/Toolbar/widgets/NodeAlignWidget.js +110 -23
  260. package/lib/core/editor/components/Toolbar/widgets/NodeAlignWidget.module.scss +33 -0
  261. package/lib/core/editor/components/Toolbar/widgets/NodeImageButton/BoxBackgroundSetting.js +2 -2
  262. package/lib/core/editor/components/Toolbar/widgets/NodeImageButton/NodeImageButton.js +21 -7
  263. package/lib/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.js +40 -34
  264. package/lib/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.module.scss +28 -0
  265. package/lib/core/editor/components/Toolbar/widgets/WidgetBox.js +13 -4
  266. package/lib/core/editor/components/Toolbar/widgets/WidgetBox.module.scss +10 -1
  267. package/lib/core/editor/components/Toolbar/widgets/components/ButtonBox.js +2 -2
  268. package/lib/core/editor/components/Toolbar/widgets/components/ButtonBox.module.scss +4 -0
  269. package/lib/core/editor/components/Toolbar/widgets/components/DropdownButton.js +19 -8
  270. package/lib/core/editor/components/Toolbar/widgets/components/DropdownMenu.js +22 -7
  271. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/ElementTextStyleSetting.js +66 -0
  272. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/colorUtil.js +82 -0
  273. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/box.js +58 -0
  274. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +86 -0
  275. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/groupTitle.js +88 -0
  276. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/index.js +28 -0
  277. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/layerTitle.js +90 -0
  278. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/nodeTag.js +90 -0
  279. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/text.js +54 -0
  280. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/textStyleUtil.js +141 -0
  281. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/GlobalTagStyleSetting.js +46 -0
  282. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/globalTag.js +111 -0
  283. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/textStyleSettingRouter.js +31 -0
  284. package/lib/core/editor/components/plugins/AddElementThemePlugin.js +20 -0
  285. package/lib/core/editor/components/settings/CloseablePanel.js +46 -0
  286. package/lib/core/editor/components/settings/CloseablePanel.module.scss +21 -0
  287. package/lib/core/editor/components/settings/PropertyView.js +59 -12
  288. package/lib/core/editor/components/settings/Settings.js +40 -122
  289. package/lib/core/editor/components/settings/Settings.module.scss +7 -11
  290. package/lib/core/editor/components/settings/common/AlignSetting/AlignSetting.module.scss +3 -3
  291. package/lib/core/editor/components/settings/common/AlignSetting/AlignTypeList.js +97 -0
  292. package/lib/core/editor/components/settings/common/AlignSetting/index.js +21 -80
  293. package/lib/core/editor/components/settings/common/GroupNodeList/ResourceList.module.scss +1 -0
  294. package/lib/core/editor/components/settings/common/LineType/index.js +11 -109
  295. package/lib/core/editor/components/settings/common/NameInput.js +38 -0
  296. package/lib/core/editor/components/settings/common/SizeInput/NodeSizeInput.js +21 -19
  297. package/lib/core/editor/components/settings/common/text/fontStyleUtil.js +25 -20
  298. package/lib/core/editor/components/settings/core/PropertyViewManager.js +91 -0
  299. package/lib/core/editor/components/settings/core/edgePropertyViewAdapter.js +33 -0
  300. package/lib/core/editor/components/settings/core/getPropertyViewType.js +40 -0
  301. package/lib/core/editor/components/settings/core/updateElementProperty.js +27 -0
  302. package/lib/core/editor/components/settings/propertyViews/box/BoxPropertyView.js +6 -13
  303. package/lib/core/editor/components/settings/propertyViews/box/BoxPropertyViewV1.js +76 -0
  304. package/lib/core/editor/components/settings/propertyViews/box/NameInput.js +6 -5
  305. package/lib/core/editor/components/settings/propertyViews/edge/CommonEdgePropertyView.js +15 -3
  306. package/lib/core/editor/components/settings/propertyViews/edge/EdgeGroupPropertyView.js +9 -12
  307. package/lib/core/editor/components/settings/propertyViews/edge/EdgePropertyView.js +7 -23
  308. package/lib/core/editor/components/settings/propertyViews/edge/addEdgeProps.js +19 -0
  309. package/lib/core/editor/components/settings/propertyViews/edge/edgeGroup/EdgeGroupSetting.js +1 -6
  310. package/lib/core/editor/components/settings/propertyViews/group/GroupPropertyView.js +14 -25
  311. package/lib/core/editor/components/settings/propertyViews/group/GroupPropertyView.module.scss +8 -1
  312. package/lib/core/editor/components/settings/propertyViews/group/GroupPropertyViewV1.js +43 -0
  313. package/lib/core/editor/components/settings/propertyViews/group/SettingTab/GroupBasicSetting.js +98 -0
  314. package/lib/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js +8 -14
  315. package/lib/core/editor/components/settings/propertyViews/group/cluster/ClusterGroupRelateData.js +9 -7
  316. package/lib/core/editor/components/settings/propertyViews/index.js +4 -9
  317. package/lib/core/editor/components/settings/propertyViews/layer/BasicSetting.js +75 -0
  318. package/lib/core/editor/components/settings/propertyViews/layer/LayerPropertyView.js +12 -20
  319. package/lib/core/editor/components/settings/propertyViews/layer/LayerPropertyView.module.scss +10 -0
  320. package/lib/core/editor/components/settings/propertyViews/layer/LayerPropertyViewV1.js +40 -0
  321. package/lib/core/editor/components/settings/propertyViews/multipleElements/MultipleElementLineType.js +4 -6
  322. package/lib/core/editor/components/settings/propertyViews/multipleElements/MultipleElementPropertyView.js +2 -15
  323. package/lib/core/editor/components/settings/propertyViews/node/NodePropertyView.js +8 -35
  324. package/lib/core/editor/components/settings/propertyViews/node/NodePropertyViewV1.js +68 -0
  325. package/lib/core/editor/components/settings/propertyViews/node/Setting/BasicSetting.js +64 -0
  326. package/lib/core/editor/components/settings/propertyViews/node/Setting/NameInput.js +6 -5
  327. package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +2 -1
  328. package/lib/core/editor/components/settings/propertyViews/node/data/NodeRelateResourceButton.js +1 -0
  329. package/lib/core/editor/components/settings/propertyViews/text/TextPropertyView.js +5 -20
  330. package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +9 -1
  331. package/lib/core/editor/config/themes.js +114 -0
  332. package/lib/core/editor/hooks/useKeyboardShortcut.js +49 -0
  333. package/lib/core/editor/hooks/useNewElementTheme.js +57 -0
  334. package/lib/core/editor/store/topoEdit.js +46 -40
  335. package/lib/core/editor/utils/edgeTypeStyleUtil.js +38 -11
  336. package/lib/core/editor/utils/textStyleUtil.js +1 -0
  337. package/lib/core/editor/utils/themeUtil.js +39 -0
  338. package/lib/core/hooks/useCanvasTheme.js +68 -0
  339. package/lib/core/hooks/useManageStatus.js +1 -9
  340. package/lib/core/hooks/usePolling.js +2 -5
  341. package/lib/core/hooks/useTopoEdit.js +16 -8
  342. package/lib/core/models/Alarm.js +2 -2
  343. package/lib/core/models/AttributeMetricDisplay.js +4 -0
  344. package/lib/core/models/HistoryManager.js +13 -8
  345. package/lib/core/models/{SelectionManager.js → SelectionModel.js} +57 -22
  346. package/lib/core/models/TopoApp.js +7 -5
  347. package/lib/core/models/selection/ignoreList.js +6 -0
  348. package/lib/core/models/utils/linkUtils.js +5 -6
  349. package/lib/core/store/models/customIcon.js +1 -3
  350. package/lib/core/store/models/selection.js +2 -1
  351. package/lib/core/store/models/topoBizMod.js +0 -3
  352. package/lib/core/store/models/topoConfig.js +9 -18
  353. package/lib/core/store/models/topoMod.js +27 -29
  354. package/lib/core/utils/edgeUtil.js +6 -0
  355. package/lib/core/utils/showGraphManageStatusUtil.js +7 -1
  356. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +18 -13
  357. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +38 -19
  358. package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/WebConsoleForm.js +13 -29
  359. package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +6 -5
  360. package/lib/core/viewer/components/plugins/ViewerPlugin.js +11 -3
  361. package/lib/core/viewer/components/titlebar/widgets/SettingButton.js +3 -1
  362. package/lib/core/viewer/components/titlebar/widgets/SettingButtonWidget.js +4 -2
  363. package/lib/networkTopo/components/editor/propertyViews/edge/EdgeGroupPropertyView.js +1 -0
  364. package/lib/networkTopo/components/editor/propertyViews/edge/EdgePropertyView.js +45 -7
  365. package/lib/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyView.js +10 -18
  366. package/lib/networkTopo/components/editor/propertyViews/edge/LinkPropertyView/LinkPropertyViewV1.js +50 -0
  367. package/lib/networkTopo/components/editor/propertyViews/edge/link/LinkInfoPreview.module.scss +1 -1
  368. package/lib/networkTopo/components/editor/useEditorProps.js +1 -4
  369. package/lib/networkTopo/createTopo.js +3 -0
  370. package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
  371. package/lib/networkTopo/services/link.js +2 -2
  372. package/lib/networkTopo/store/topoTreeMod.js +6 -8
  373. package/lib/style.js +28 -27
  374. package/lib/utils/htElementUtils.js +5 -0
  375. package/lib/utils/topoData.js +1 -0
  376. package/package.json +5 -4
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import Icons from "./assets";
3
+
4
+ var Icon = function Icon(props) {
5
+ var _props$alt = props.alt,
6
+ alt = _props$alt === void 0 ? '' : _props$alt,
7
+ img = props.img,
8
+ type = props.type,
9
+ className = props.className,
10
+ rotate = props.rotate;
11
+ var style = rotate ? {
12
+ transform: "rotate(" + rotate + "deg)"
13
+ } : null;
14
+ var src = img || Icons[type];
15
+ return /*#__PURE__*/React.createElement("img", {
16
+ className: className,
17
+ style: style,
18
+ src: src,
19
+ alt: alt
20
+ });
21
+ };
22
+
23
+ export default Icon;
@@ -0,0 +1,10 @@
1
+ import IconLayoutCircular from "./topo_layout_circular.svg";
2
+ import IconLayoutHierarchical from "./topo_layout_hierarchical.svg";
3
+ import IconLayoutToward from "./topo_layout_toward.svg";
4
+ import IconLayoutRectangle from "./topo_layout_rectangle.svg";
5
+ export default {
6
+ 'layout_rectangle': IconLayoutRectangle,
7
+ 'layout_circular': IconLayoutCircular,
8
+ 'layout_hierarchical': IconLayoutHierarchical,
9
+ 'layout_toward': IconLayoutToward
10
+ };
@@ -0,0 +1,10 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="46px" height="46px" viewBox="0 0 46 46" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <!-- Generator: Sketch 63.1 (92452) - https://sketch.com -->
4
+ <title>星形布局</title>
5
+ <desc>Created with Sketch.</desc>
6
+ <g id="星形布局" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
7
+ <path d="M24,35 C26.7614237,35 29,37.2385763 29,40 C29,42.7614237 26.7614237,45 24,45 C21.2385763,45 19,42.7614237 19,40 C19,37.2385763 21.2385763,35 24,35 Z M5.7,20.75 C8.46142375,20.75 10.7,22.9885763 10.7,25.75 C10.7,28.5114237 8.46142375,30.75 5.7,30.75 C2.93857625,30.75 0.7,28.5114237 0.7,25.75 C0.7,22.9885763 2.93857625,20.75 5.7,20.75 Z M39.7,20.75 C42.4614237,20.75 44.7,22.9885763 44.7,25.75 C44.7,28.5114237 42.4614237,30.75 39.7,30.75 C36.9385763,30.75 34.7,28.5114237 34.7,25.75 C34.7,22.9885763 36.9385763,20.75 39.7,20.75 Z M12.7,1.75 C15.4614237,1.75 17.7,3.98857625 17.7,6.75 C17.7,9.51142375 15.4614237,11.75 12.7,11.75 C9.93857625,11.75 7.7,9.51142375 7.7,6.75 C7.7,3.98857625 9.93857625,1.75 12.7,1.75 Z M33.7,1.75 C36.4614237,1.75 38.7,3.98857625 38.7,6.75 C38.7,9.51142375 36.4614237,11.75 33.7,11.75 C30.9385763,11.75 28.7,9.51142375 28.7,6.75 C28.7,3.98857625 30.9385763,1.75 33.7,1.75 Z" id="形状" fill="#DAE4F0"></path>
8
+ <path d="M16.7357263,10.8944619 L21.3748996,16.8328361 C21.7316803,16.7635612 22.1002387,16.7272727 22.4772727,16.7272727 C23.3881144,16.7272727 24.2494913,16.939057 25.0148465,17.3160689 L29.9194782,11.0383855 C28.7414934,9.98544349 28,8.45431428 28,6.75 C28,3.57436269 30.5743627,1 33.75,1 C36.9256373,1 39.5,3.57436269 39.5,6.75 C39.5,9.92563731 36.9256373,12.5 33.75,12.5 C33.0015307,12.5 32.2864624,12.3569935 31.6306281,12.0968134 L26.6283721,18.498458 C27.5114744,19.4195559 28.0909999,20.6339958 28.2061533,21.9809823 L34.5845072,23.2211517 C35.5202467,21.3133843 37.4817447,20 39.75,20 C42.9256373,20 45.5,22.5743627 45.5,25.75 C45.5,28.9256373 42.9256373,31.5 39.75,31.5 C36.5743627,31.5 34,28.9256373 34,25.75 C34,25.5475907 34.0104585,25.3476242 34.0308645,25.1506112 L28.0278628,23.9839192 C27.5340506,25.8075306 26.1655187,27.2715341 24.4003971,27.8978 L24.4002399,34.0363596 C27.2697409,34.3593234 29.5,36.7942092 29.5,39.75 C29.5,42.9256373 26.9256373,45.5 23.75,45.5 C20.5743627,45.5 18,42.9256373 18,39.75 C18,37.0393437 19.8756718,34.766774 22.3999234,34.159383 L22.3996823,28.2252901 L22.256717,28.2231206 C19.7716464,28.129399 17.690226,26.4586024 16.9843891,24.1826643 L11.4788805,25.2537095 C11.4928642,25.4172811 11.5,25.5828072 11.5,25.75 C11.5,28.9256373 8.92563731,31.5 5.75,31.5 C2.57436269,31.5 3.55271368e-15,28.9256373 3.55271368e-15,25.75 C3.55271368e-15,22.5743627 2.57436269,20 5.75,20 C8.05582451,20 10.0446459,21.3572518 10.9611414,23.3164329 L16.734097,22.1946516 C16.828014,20.2542218 17.8837931,18.566218 19.4349009,17.5971737 L15.071367,12.0121621 C14.3614134,12.3258116 13.5760486,12.5 12.75,12.5 C9.57436269,12.5 7,9.92563731 7,6.75 C7,3.57436269 9.57436269,1 12.75,1 C15.9256373,1 18.5,3.57436269 18.5,6.75 C18.5,8.3781911 17.8232649,9.84832225 16.7357263,10.8944619 Z M23.75,35.75 C21.540861,35.75 19.75,37.540861 19.75,39.75 C19.75,41.959139 21.540861,43.75 23.75,43.75 C25.959139,43.75 27.75,41.959139 27.75,39.75 C27.75,37.540861 25.959139,35.75 23.75,35.75 Z M5.75,21.75 C3.540861,21.75 1.75,23.540861 1.75,25.75 C1.75,27.959139 3.540861,29.75 5.75,29.75 C7.959139,29.75 9.75,27.959139 9.75,25.75 C9.75,23.540861 7.959139,21.75 5.75,21.75 Z M39.75,21.75 C37.540861,21.75 35.75,23.540861 35.75,25.75 C35.75,27.959139 37.540861,29.75 39.75,29.75 C41.959139,29.75 43.75,27.959139 43.75,25.75 C43.75,23.540861 41.959139,21.75 39.75,21.75 Z M22.4772727,18.4772727 C20.2681337,18.4772727 18.4772727,20.2681337 18.4772727,22.4772727 C18.4772727,24.6864117 20.2681337,26.4772727 22.4772727,26.4772727 C24.6864117,26.4772727 26.4772727,24.6864117 26.4772727,22.4772727 C26.4772727,20.2681337 24.6864117,18.4772727 22.4772727,18.4772727 Z M12.75,2.75 C10.540861,2.75 8.75,4.540861 8.75,6.75 C8.75,8.959139 10.540861,10.75 12.75,10.75 C14.959139,10.75 16.75,8.959139 16.75,6.75 C16.75,4.540861 14.959139,2.75 12.75,2.75 Z M33.75,2.75 C31.540861,2.75 29.75,4.540861 29.75,6.75 C29.75,8.959139 31.540861,10.75 33.75,10.75 C35.959139,10.75 37.75,8.959139 37.75,6.75 C37.75,4.540861 35.959139,2.75 33.75,2.75 Z" id="形状" fill="#BACCE7"></path>
9
+ </g>
10
+ </svg>
@@ -0,0 +1,10 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="46px" height="46px" viewBox="0 0 46 46" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <!-- Generator: Sketch 63.1 (92452) - https://sketch.com -->
4
+ <title>均衡布局</title>
5
+ <desc>Created with Sketch.</desc>
6
+ <g id="均衡布局" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
7
+ <path d="M22.6470588,34.6470588 C25.4084826,34.6470588 27.6470588,36.8856351 27.6470588,39.6470588 C27.6470588,42.4084826 25.4084826,44.6470588 22.6470588,44.6470588 C19.8856351,44.6470588 17.6470588,42.4084826 17.6470588,39.6470588 C17.6470588,36.8856351 19.8856351,34.6470588 22.6470588,34.6470588 Z M5.70588235,17.6470588 C8.4673061,17.6470588 10.7058824,19.8856351 10.7058824,22.6470588 C10.7058824,25.4084826 8.4673061,27.6470588 5.70588235,27.6470588 C2.9444586,27.6470588 0.705882353,25.4084826 0.705882353,22.6470588 C0.705882353,19.8856351 2.9444586,17.6470588 5.70588235,17.6470588 Z M40.7058824,17.6470588 C43.4673061,17.6470588 45.7058824,19.8856351 45.7058824,22.6470588 C45.7058824,25.4084826 43.4673061,27.6470588 40.7058824,27.6470588 C37.9444586,27.6470588 35.7058824,25.4084826 35.7058824,22.6470588 C35.7058824,19.8856351 37.9444586,17.6470588 40.7058824,17.6470588 Z M22.6470588,0.647058824 C25.4084826,0.647058824 27.6470588,2.88563507 27.6470588,5.64705882 C27.6470588,8.40848257 25.4084826,10.6470588 22.6470588,10.6470588 C19.8856351,10.6470588 17.6470588,8.40848257 17.6470588,5.64705882 C17.6470588,2.88563507 19.8856351,0.647058824 22.6470588,0.647058824 Z" id="形状结合" fill="#DAE4F0"></path>
8
+ <path d="M22.5,-1.95399252e-13 C25.5375661,-1.95399252e-13 28,2.46243388 28,5.5 C28,6.6576632 27.6423341,7.73178905 27.0314769,8.61790293 L36.82321,18.4095545 C37.7974662,17.5332483 39.0864597,17 40.5,17 C43.5375661,17 46,19.4624339 46,22.5 C46,25.5375661 43.5375661,28 40.5,28 C39.1265414,28 37.8706666,27.496564 36.9068415,26.6641581 L27.0950015,36.4763101 C27.6670566,37.3438891 28,38.383063 28,39.5 C28,42.5375661 25.5375661,45 22.5,45 C19.4624339,45 17,42.5375661 17,39.5 C17,38.3423368 17.3576659,37.268211 17.9685231,36.3820971 L8.61790293,27.0314769 C7.73178905,27.6423341 6.6576632,28 5.5,28 C2.46243388,28 -1.95399252e-13,25.5375661 -1.95399252e-13,22.5 C-1.95399252e-13,19.4624339 2.46243388,17 5.5,17 C6.72377407,17 7.85419719,17.3996829 8.7678544,18.0756338 L18.0756338,8.7678544 C17.3996829,7.85419719 17,6.72377407 17,5.5 C17,2.46243388 19.4624339,-1.95399252e-13 22.5,-1.95399252e-13 Z M22.5,35.6041667 C20.3483907,35.6041667 18.6041667,37.3483907 18.6041667,39.5 C18.6041667,41.6516093 20.3483907,43.3958333 22.5,43.3958333 C24.6516093,43.3958333 26.3958333,41.6516093 26.3958333,39.5 C26.3958333,37.3483907 24.6516093,35.6041667 22.5,35.6041667 Z M35.1000174,23.5495069 L35.1,23.6 L23.5991458,23.5991458 L23.6003788,34.1100968 C24.3749969,34.267393 25.0904894,34.587488 25.7095864,35.0331117 L35.6483634,25.0929707 C35.3929942,24.6161549 35.2058615,24.0973163 35.1000174,23.5495069 Z M21.5991458,23.5991458 L10.8899032,23.6003788 C10.7403134,24.3370463 10.4434859,25.0202397 10.0314769,25.6179029 L19.3820971,34.9685231 C20.0336191,34.5193857 20.7867811,34.2071244 21.6000562,34.0732662 L21.5991458,23.5991458 Z M5.5,18.6041667 C3.34839066,18.6041667 1.60416667,20.3483907 1.60416667,22.5 C1.60416667,24.6516093 3.34839066,26.3958333 5.5,26.3958333 C7.65160934,26.3958333 9.39583333,24.6516093 9.39583333,22.5 C9.39583333,20.3483907 7.65160934,18.6041667 5.5,18.6041667 Z M40.5,18.6041667 C38.3483907,18.6041667 36.6041667,20.3483907 36.6041667,22.5 C36.6041667,24.6516093 38.3483907,26.3958333 40.5,26.3958333 C42.6516093,26.3958333 44.3958333,24.6516093 44.3958333,22.5 C44.3958333,20.3483907 42.6516093,18.6041667 40.5,18.6041667 Z M19.5370645,10.1344901 L10.1344901,19.5370645 C10.5284431,20.1519899 10.8033617,20.8504912 10.9267338,21.6000562 L21.5991458,21.5991458 L21.6000562,10.9267338 C20.8504912,10.8033617 20.1519899,10.5284431 19.5370645,10.1344901 Z M23.6003788,10.8899032 L23.5991458,21.5991458 L35.0732662,21.6000562 C35.1660269,21.0364754 35.3444596,20.5017619 35.5947453,20.0097351 L25.6179029,10.0314769 C25.0202397,10.4434859 24.3370463,10.7403134 23.6003788,10.8899032 Z M22.5,1.60416667 C20.3483907,1.60416667 18.6041667,3.34839066 18.6041667,5.5 C18.6041667,7.65160934 20.3483907,9.39583333 22.5,9.39583333 C24.6516093,9.39583333 26.3958333,7.65160934 26.3958333,5.5 C26.3958333,3.34839066 24.6516093,1.60416667 22.5,1.60416667 Z" id="形状结合" fill="#BACCE7"></path>
9
+ </g>
10
+ </svg>
@@ -0,0 +1,12 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="30px" height="30px" viewBox="0 0 30 30" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <title>topo/source/layout/Icon/分层排布</title>
4
+ <g id="topo/source/layout/Icon/分层排布" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
5
+ <g id="矩形布局" transform="translate(0.000000, 11.428571)" fill-rule="nonzero">
6
+ <path d="M3.57142857,0.714285714 C5.149385,0.714285714 6.42857143,1.99347214 6.42857143,3.57142857 C6.42857143,5.149385 5.149385,6.42857143 3.57142857,6.42857143 C1.99347214,6.42857143 0.714285714,5.149385 0.714285714,3.57142857 C0.714285714,1.99347214 1.99347214,0.714285714 3.57142857,0.714285714 Z M26.4285714,0.714285714 C28.0065279,0.714285714 29.2857143,1.99347214 29.2857143,3.57142857 C29.2857143,5.149385 28.0065279,6.42857143 26.4285714,6.42857143 C24.850615,6.42857143 23.5714286,5.149385 23.5714286,3.57142857 C23.5714286,1.99347214 24.850615,0.714285714 26.4285714,0.714285714 Z" id="形状" fill="#DAE4F0"></path>
7
+ <path d="M3.57142857,0 C5.54387411,0 7.14285714,1.59898307 7.14285714,3.57142857 C7.14285714,5.54387407 5.54387411,7.14285714 3.57142857,7.14285714 C1.59898304,7.14285714 0,5.54387407 0,3.57142857 C0,1.59898307 1.59898304,0 3.57142857,0 Z M15,0 C16.9724455,0 18.5714286,1.59898307 18.5714286,3.57142857 C18.5714286,5.54387407 16.9724455,7.14285714 15,7.14285714 C13.0275545,7.14285714 11.4285714,5.54387407 11.4285714,3.57142857 C11.4285714,1.59898307 13.0275545,0 15,0 Z M26.4285714,0 C28.4010169,0 30,1.59898307 30,3.57142857 C30,5.54387407 28.4010169,7.14285714 26.4285714,7.14285714 C24.4561259,7.14285714 22.8571429,5.54387407 22.8571429,3.57142857 C22.8571429,1.59898307 24.4561259,0 26.4285714,0 Z M3.57142857,1.04166664 C2.17427965,1.04166664 1.04166666,2.17427964 1.04166666,3.57142857 C1.04166666,4.9685775 2.17427965,6.1011905 3.57142857,6.1011905 C4.96857749,6.1011905 6.1011905,4.9685775 6.1011905,3.57142857 C6.1011905,2.17427964 4.96857749,1.04166664 3.57142857,1.04166664 Z M15,1.04166664 C13.6028511,1.04166664 12.4702381,2.17427964 12.4702381,3.57142857 C12.4702381,4.9685775 13.6028511,6.1011905 15,6.1011905 C16.3971489,6.1011905 17.5297619,4.9685775 17.5297619,3.57142857 C17.5297619,2.17427964 16.3971489,1.04166664 15,1.04166664 Z M26.4285714,1.04166664 C25.0314225,1.04166664 23.8988095,2.17427964 23.8988095,3.57142857 C23.8988095,4.9685775 25.0314225,6.1011905 26.4285714,6.1011905 C27.8257204,6.1011905 28.9583334,4.9685775 28.9583334,3.57142857 C28.9583334,2.17427964 27.8257204,1.04166664 26.4285714,1.04166664 Z" id="形状" fill="#BACCE7"></path>
8
+ </g>
9
+ <polygon id="直线" fill="#BACCE7" fill-rule="nonzero" points="30 2 30 5 0 5 0 2"></polygon>
10
+ <polygon id="直线备份" fill="#BACCE7" fill-rule="nonzero" points="30 25 30 28 0 28 0 25"></polygon>
11
+ </g>
12
+ </svg>
@@ -0,0 +1,16 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <svg width="46px" height="46px" viewBox="0 0 46 46" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
3
+ <!-- Generator: Sketch 63.1 (92452) - https://sketch.com -->
4
+ <title>树形布局</title>
5
+ <desc>Created with Sketch.</desc>
6
+ <g id="树形布局" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
7
+ <circle id="椭圆形" fill="#DAE4F0" cx="11" cy="23" r="4"></circle>
8
+ <circle id="椭圆形备份" fill="#DAE4F0" cx="35" cy="23" r="4"></circle>
9
+ <circle id="椭圆形备份-2" fill="#DAE4F0" cx="41" cy="40" r="4"></circle>
10
+ <circle id="椭圆形备份-3" fill="#DAE4F0" cx="29" cy="40" r="4"></circle>
11
+ <circle id="椭圆形备份-4" fill="#DAE4F0" cx="17" cy="40" r="4"></circle>
12
+ <circle id="椭圆形备份-5" fill="#DAE4F0" cx="5" cy="40" r="4"></circle>
13
+ <path d="M37.470512,26.076139 L41.5378785,35.2115936 L39.7107875,36.0250669 L35.6434211,26.8896123 L37.470512,26.076139 Z M13.0270909,26.076139 L17.0944573,35.2115936 L15.2673664,36.0250669 L11.2,26.8896123 L13.0270909,26.076139 Z M8.66045376,26.1182616 L10.4580419,26.9950039 L6.07433039,35.9829444 L4.27674229,35.1062021 L8.66045376,26.1182616 Z M33.0837115,26.1182616 L34.8812996,26.9950039 L30.4975881,35.9829444 L28.7,35.1062021 L33.0837115,26.1182616 Z M20.5096741,8.18361912 L22.0190933,9.49573718 L13.0067139,19.8172607 L11.3248477,18.7495532 L20.5096741,8.18361912 Z M25.9958912,8.18361912 L35,18.5136719 L33.0152395,19.3069617 L24.4864721,9.49573718 L25.9958912,8.18361912 Z" id="形状结合" fill="#BACCE7"></path>
14
+ <path d="M41,35 C43.7614237,35 46,37.2385763 46,40 C46,42.7614237 43.7614237,45 41,45 C38.2385763,45 36,42.7614237 36,40 C36,37.2385763 38.2385763,35 41,35 Z M29,35 C31.7614237,35 34,37.2385763 34,40 C34,42.7614237 31.7614237,45 29,45 C26.2385763,45 24,42.7614237 24,40 C24,37.2385763 26.2385763,35 29,35 Z M5,35 C7.76142375,35 10,37.2385763 10,40 C10,42.7614237 7.76142375,45 5,45 C2.23857625,45 -1.5187851e-13,42.7614237 -1.5187851e-13,40 C-1.5187851e-13,37.2385763 2.23857625,35 5,35 Z M17,35 C19.7614237,35 22,37.2385763 22,40 C22,42.7614237 19.7614237,45 17,45 C14.2385763,45 12,42.7614237 12,40 C12,37.2385763 14.2385763,35 17,35 Z M41,36.4583333 C39.0439915,36.4583333 37.4583333,38.0439915 37.4583333,40 C37.4583333,41.9560085 39.0439915,43.5416667 41,43.5416667 C42.9560085,43.5416667 44.5416667,41.9560085 44.5416667,40 C44.5416667,38.0439915 42.9560085,36.4583333 41,36.4583333 Z M29,36.4583333 C27.0439915,36.4583333 25.4583333,38.0439915 25.4583333,40 C25.4583333,41.9560085 27.0439915,43.5416667 29,43.5416667 C30.9560085,43.5416667 32.5416667,41.9560085 32.5416667,40 C32.5416667,38.0439915 30.9560085,36.4583333 29,36.4583333 Z M5,36.4583333 C3.04399151,36.4583333 1.45833333,38.0439915 1.45833333,40 C1.45833333,41.9560085 3.04399151,43.5416667 5,43.5416667 C6.95600849,43.5416667 8.54166667,41.9560085 8.54166667,40 C8.54166667,38.0439915 6.95600849,36.4583333 5,36.4583333 Z M17,36.4583333 C15.0439915,36.4583333 13.4583333,38.0439915 13.4583333,40 C13.4583333,41.9560085 15.0439915,43.5416667 17,43.5416667 C18.9560085,43.5416667 20.5416667,41.9560085 20.5416667,40 C20.5416667,38.0439915 18.9560085,36.4583333 17,36.4583333 Z M11,18 C13.7614237,18 16,20.2385763 16,23 C16,25.7614237 13.7614237,28 11,28 C8.23857625,28 6,25.7614237 6,23 C6,20.2385763 8.23857625,18 11,18 Z M35,18 C37.7614237,18 40,20.2385763 40,23 C40,25.7614237 37.7614237,28 35,28 C32.2385763,28 30,25.7614237 30,23 C30,20.2385763 32.2385763,18 35,18 Z M11,19.4583333 C9.04399151,19.4583333 7.45833333,21.0439915 7.45833333,23 C7.45833333,24.9560085 9.04399151,26.5416667 11,26.5416667 C12.9560085,26.5416667 14.5416667,24.9560085 14.5416667,23 C14.5416667,21.0439915 12.9560085,19.4583333 11,19.4583333 Z M35,19.4583333 C33.0439915,19.4583333 31.4583333,21.0439915 31.4583333,23 C31.4583333,24.9560085 33.0439915,26.5416667 35,26.5416667 C36.9560085,26.5416667 38.5416667,24.9560085 38.5416667,23 C38.5416667,21.0439915 36.9560085,19.4583333 35,19.4583333 Z M23,-1.5187851e-13 C25.7614237,-1.5187851e-13 28,2.23857625 28,5 C28,7.76142375 25.7614237,10 23,10 C20.2385763,10 18,7.76142375 18,5 C18,2.23857625 20.2385763,-1.5187851e-13 23,-1.5187851e-13 Z M23,1.45833333 C21.0439915,1.45833333 19.4583333,3.04399151 19.4583333,5 C19.4583333,6.95600849 21.0439915,8.54166667 23,8.54166667 C24.9560085,8.54166667 26.5416667,6.95600849 26.5416667,5 C26.5416667,3.04399151 24.9560085,1.45833333 23,1.45833333 Z" id="形状结合" fill="#BACCE7"></path>
15
+ </g>
16
+ </svg>
@@ -0,0 +1,31 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
3
+ var _excluded = ["className", "children", "icon", "img", "iconClassName", "textClassName"];
4
+ import React from 'react';
5
+ import classnames from 'classnames';
6
+ import Icon from "./Icon";
7
+ import styles from "./index.module.scss";
8
+
9
+ var TemplateButton = function TemplateButton(props) {
10
+ var className = props.className,
11
+ children = props.children,
12
+ icon = props.icon,
13
+ img = props.img,
14
+ iconClassName = props.iconClassName,
15
+ textClassName = props.textClassName,
16
+ rest = _objectWithoutPropertiesLoose(props, _excluded);
17
+
18
+ return /*#__PURE__*/React.createElement("div", {
19
+ className: classnames(styles.card, className)
20
+ }, /*#__PURE__*/React.createElement("div", {
21
+ className: styles.iconWrapper
22
+ }, /*#__PURE__*/React.createElement(Icon, _extends({
23
+ className: classnames(styles.icon, iconClassName),
24
+ img: img,
25
+ type: icon
26
+ }, rest))), /*#__PURE__*/React.createElement("div", {
27
+ className: classnames(styles.text, textClassName)
28
+ }, /*#__PURE__*/React.createElement("span", null, children)));
29
+ };
30
+
31
+ export default TemplateButton;
@@ -0,0 +1,53 @@
1
+ @import "@alifd/next/variables";
2
+
3
+ .card {
4
+ display: flex;
5
+ flex-direction: column;
6
+ width: 100%;
7
+ height: 100%;
8
+ border: none;
9
+ padding-top: 6px;
10
+ cursor: pointer;
11
+ }
12
+
13
+ .iconWrapper {
14
+ display: flex;
15
+ justify-content: center;
16
+ align-items: center;
17
+ user-select: none;
18
+ }
19
+
20
+ .icon {
21
+ width: 120px;
22
+ }
23
+
24
+ .text {
25
+ height: 20px;
26
+ line-height: 20px;
27
+ font-size: 18px;
28
+ margin-top: 14px;
29
+ color: $color-text1-3;
30
+ outline: none;
31
+ }
32
+
33
+ .group-layout-set-card {
34
+ display: flex;
35
+ flex-direction: column;
36
+ width: 55px;
37
+ height: 60px;
38
+ border: none;
39
+ padding-top: 6px;
40
+ cursor: pointer;
41
+ }
42
+ .group-layout-set-icon {
43
+ width: 30px;
44
+ }
45
+ .group-layout-set-text {
46
+ width: 55px;
47
+ height: 12px;
48
+ line-height: 12px;
49
+ font-size: 12px;
50
+ margin-top: 8px;
51
+ color: $color-text1-3;
52
+ outline: none;
53
+ }
@@ -1,28 +1,143 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
1
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
2
- import _Icon from "@alifd/next/es/icon";
3
- var _excluded = ["showLabel"];
4
- import React from 'react';
5
- import ArrowPopup from "../components/ArrowPopup";
3
+ var _excluded = ["topo", "showLabel"];
4
+
5
+ /* eslint-disable eqeqeq */
6
+ import React, { useState, useMemo } from 'react';
7
+ import LayoutSettings from "./components/LayoutSettings";
6
8
  import WidgetBox from "../WidgetBox";
9
+ import DropdownButton from "../components/DropdownButton";
10
+ import { isGroup, isLayer } from "../../../../../../utils/htElementDataUtil";
7
11
 
8
12
  function Layout(props) {
9
- var topo = props.topo;
10
- return /*#__PURE__*/React.createElement(ArrowPopup, {
11
- label: /*#__PURE__*/React.createElement(_Icon, {
12
- type: "Topology_icon_zoomout",
13
- size: "small"
13
+ var topo = props.topo,
14
+ topoShowType = props.topoShowType;
15
+
16
+ var _useState = useState(),
17
+ layout = _useState[0],
18
+ setLayout = _useState[1]; // 选中的元素
19
+
20
+
21
+ var selectionElements = topo.selectionModel.useHtSelection();
22
+
23
+ var _topo$store$useModelS = topo.store.useModelState('selection'),
24
+ selection = _topo$store$useModelS.selection;
25
+
26
+ var setDisabled = function setDisabled(data) {
27
+ if (topoShowType == 'layers' && selection.length == 1 && !isGroup(selection[0])) {
28
+ return data != 'rectangle';
29
+ } else {
30
+ return data == 'rectangle';
31
+ }
32
+ };
33
+
34
+ var globalLayout = function globalLayout(data) {
35
+ var firstElement = selection[0];
36
+ var layouType = data.id === 'toward' ? "" + data.id + data.options.subId : data.id; // eslint-disable-next-line eqeqeq
37
+
38
+ if (topoShowType != 'layers' && selection.length == 0) {
39
+ topo.getHtTopo().layoutInTopo(layouType);
40
+ } // eslint-disable-next-line eqeqeq
41
+
42
+
43
+ if (topoShowType != 'layers' && selection.length == 1) {
44
+ topo.getHtTopo().layoutInContainer(layouType);
45
+ } // eslint-disable-next-line eqeqeq
46
+
47
+
48
+ if (firstElement && isLayer(firstElement)) {
49
+ topo.getHtTopo().layoutLayer(selectionElements[0]);
50
+ }
51
+ };
52
+
53
+ var layoutOnChange = function layoutOnChange(v) {
54
+ var _selection$;
55
+
56
+ topo.historyManager.beginTransaction();
57
+ setLayout(v); // eslint-disable-next-line eqeqeq
58
+
59
+ if (topoShowType != 'layers' && ((_selection$ = selection[0]) === null || _selection$ === void 0 ? void 0 : _selection$.className) != 'ht.Node' || topoShowType == 'partition' && selection.length == 1 || topoShowType == 'layers' && selection.length == 1) {
60
+ globalLayout(v);
61
+ }
62
+
63
+ topo.historyManager.endTransaction();
64
+ };
65
+
66
+ return (
67
+ /*#__PURE__*/
68
+ // <LayoutSettings size="xs" selection = {selection} topoShowType={topoShowType} layout={layout} onChange={layoutOnChange} />
69
+ React.createElement(LayoutSettings, {
70
+ size: "xs",
71
+ layout: layout,
72
+ onChange: layoutOnChange,
73
+ disabled: setDisabled
14
74
  })
15
- }, /*#__PURE__*/React.createElement("div", null, "\u5E03\u5C40 ", /*#__PURE__*/React.createElement("br", null), "\u5E03\u5C40 ", /*#__PURE__*/React.createElement("br", null), "\u5E03\u5C40 ", /*#__PURE__*/React.createElement("br", null), "\u5E03\u5C40 ", /*#__PURE__*/React.createElement("br", null), "\u5E03\u5C40 ", /*#__PURE__*/React.createElement("br", null), "\u5E03\u5C40 ", /*#__PURE__*/React.createElement("br", null), "\u5E03\u5C40 ", /*#__PURE__*/React.createElement("br", null), "\u5E03\u5C40 ", /*#__PURE__*/React.createElement("br", null)));
75
+ );
16
76
  }
17
77
 
18
78
  function LayoutWidget(props) {
19
- var showLabel = props.showLabel,
20
- otherProps = _objectWithoutPropertiesLoose(props, _excluded);
79
+ var topo = props.topo,
80
+ showLabel = props.showLabel,
81
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded); // eslint-disable-next-line no-undef
82
+
83
+
84
+ var store = topo.store; // 拓扑图是否加载
21
85
 
86
+ var topoState = store.useModelState('topoMod'); // 分层或分区时候选中的值,未选中length为0 配合下面的type属性一起使用,
87
+ // type为partition且selection.length>=0时可以点击布局, selection[0].className != 'ht.Node'
88
+ // type为auto且selection.length==0时可以点击布局
89
+
90
+ var _topo$store$useModelS2 = topo.store.useModelState('selection'),
91
+ selection = _topo$store$useModelS2.selection;
92
+
93
+ var topoShowType = topoState.type; // 获取ID以及拓扑类型 // 拓扑类型:auto自由布局,layers分层,partition分区
94
+
95
+ var disabled = useMemo(function () {
96
+ return !isLayoutEnabled({
97
+ topoShowType: topoShowType,
98
+ selection: selection
99
+ });
100
+ }, [topoShowType, selection]);
101
+ var icon = disabled ? /*#__PURE__*/React.createElement("img", {
102
+ src: "/img/topo/editor/toolbar/layout/Disable.svg",
103
+ alt: ""
104
+ }) : /*#__PURE__*/React.createElement("img", {
105
+ src: "/img/topo/editor/toolbar/layout/Normal.svg",
106
+ alt: ""
107
+ });
22
108
  return /*#__PURE__*/React.createElement(WidgetBox, {
23
- label: "\u5E03\u5C40",
24
- showLabel: showLabel
25
- }, /*#__PURE__*/React.createElement(WidgetBox.ButtonBox, null, /*#__PURE__*/React.createElement(Layout, otherProps)));
109
+ label: "\u5E03\u5C40\u65B9\u5F0F",
110
+ tooltip: "\u5E03\u5C40\u65B9\u5F0F",
111
+ showLabel: showLabel,
112
+ disabled: disabled
113
+ }, /*#__PURE__*/React.createElement(DropdownButton, {
114
+ disabled: disabled,
115
+ trigger: icon
116
+ }, !disabled && /*#__PURE__*/React.createElement(Layout, _extends({
117
+ topo: topo,
118
+ topoShowType: topoShowType
119
+ }, otherProps))));
120
+ }
121
+
122
+ function isLayoutEnabled(props) {
123
+ var topoShowType = props.topoShowType,
124
+ selection = props.selection; // 选中单个区域/集群后,该按钮亮起
125
+
126
+ if (selection.length === 1 && isGroup(selection[0]) && selection[0].expanded) {
127
+ return true;
128
+ } // 分层拓扑选中任意分层时,布局按钮亮起
129
+
130
+
131
+ if (topoShowType === 'layers' && selection.length === 1 && isLayer(selection[0])) {
132
+ return true;
133
+ } // 空白拓扑未选中任何资源时,布局按钮亮起
134
+
135
+
136
+ if (topoShowType !== 'layers' && !selection.length) {
137
+ return true;
138
+ }
139
+
140
+ return false;
26
141
  }
27
142
 
28
143
  export default LayoutWidget;
@@ -1,24 +1,12 @@
1
- import _extends from "@babel/runtime/helpers/extends";
1
+ import _NumberPicker from "@alifd/next/es/number-picker";
2
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
3
3
  var _excluded = ["topo", "showLabel"];
4
4
  import React, { useState, useEffect } from 'react';
5
5
  import WidgetBox from "./WidgetBox";
6
6
  import DropdownButton from "./components/DropdownButton";
7
-
8
- function NodeAlignPopup(props) {
9
- var topo = props.topo,
10
- disabled = props.disabled;
11
- var icon = disabled ? /*#__PURE__*/React.createElement("img", {
12
- src: "/img/topo/editor/toolbar/\u5BF9\u9F50/Disable.svg",
13
- alt: ""
14
- }) : /*#__PURE__*/React.createElement("img", {
15
- src: "/img/topo/editor/toolbar/\u5BF9\u9F50/Normal.svg",
16
- alt: ""
17
- });
18
- return /*#__PURE__*/React.createElement(DropdownButton, {
19
- trigger: icon
20
- }, "\u5BF9\u9F50\u65B9\u5F0F");
21
- }
7
+ import AlignSetting from "../../settings/common/AlignSetting";
8
+ import { isEdge, isLayer } from "../../../../../utils/htElementUtils";
9
+ import styles from "./NodeAlignWidget.module.scss";
22
10
 
23
11
  function NodeAlignWidget(props) {
24
12
  var topo = props.topo,
@@ -27,21 +15,117 @@ function NodeAlignWidget(props) {
27
15
 
28
16
  var _useState = useState(true),
29
17
  disabled = _useState[0],
30
- setDisabled = _useState[1]; // 选中的元素
18
+ setDisabled = _useState[1];
19
+
20
+ var _useState2 = useState(),
21
+ leftInputVal = _useState2[0],
22
+ setLeftInputVal = _useState2[1];
23
+
24
+ var _useState3 = useState(),
25
+ rightInputVal = _useState3[0],
26
+ setRightInputVal = _useState3[1];
27
+
28
+ var _useState4 = useState(true),
29
+ distributionDisabled = _useState4[0],
30
+ setDistributionDisabled = _useState4[1]; // 拓扑图是否加载
31
+
32
+
33
+ var _topo$store$useModelS = topo.store.useModelState('topoMod'),
34
+ graphLoaded = _topo$store$useModelS.graphLoaded; // 选中的元素
35
+
36
+
37
+ var selection = topo.selectionModel.useHtSelection();
31
38
 
39
+ var setSpace = function setSpace(type, num) {
40
+ topo.historyManager.beginTransaction(); // eslint-disable-next-line no-shadow
41
+
42
+ var selection = topo.getHtTopo().getGraphView().getSelectionModel().getSelection().toArray();
43
+ var nodes = selection.filter(function (ele) {
44
+ return !isLayer(ele) && !isEdge(ele);
45
+ });
46
+ topo.view.topoClient.htTopoClient.setElementsSpace(nodes, type, num);
47
+ topo.historyManager.endTransaction();
48
+ };
49
+
50
+ var leftInputChange = function leftInputChange(val) {
51
+ setLeftInputVal(val);
52
+ setSpace('h', val);
53
+ };
54
+
55
+ var rightInputChange = function rightInputChange(val) {
56
+ setRightInputVal(val);
57
+ setSpace('v', val);
58
+ };
59
+
60
+ var parseValue = function parseValue(v) {
61
+ return v * 1 > 0 ? Math.round(v) : '';
62
+ };
32
63
 
33
- var selection = topo.selectionManager.useSelection();
34
64
  useEffect(function () {
35
- setDisabled(false);
36
- }, [selection]);
65
+ if (graphLoaded) {
66
+ var selectionEle = topo.getHtTopo().getGraphView().getSelectionModel().getSelection().toArray();
67
+ var nodes = selectionEle.filter(function (ele) {
68
+ return !isLayer(ele) && !isEdge(ele);
69
+ });
70
+ setDisabled(nodes.length <= 1); // eslint-disable-next-line no-use-before-define
71
+
72
+ setLeftInputVal();
73
+ setRightInputVal();
74
+ setDistributionDisabled(nodes.length <= 2);
75
+
76
+ if (nodes.length === 2) {
77
+ var h = topo.view.topoClient.htTopoClient.getElementsSpace(nodes, 'h')[0];
78
+ var v = topo.view.topoClient.htTopoClient.getElementsSpace(nodes, 'v')[0];
79
+ setLeftInputVal(parseValue(h));
80
+ setRightInputVal(parseValue(v));
81
+ }
82
+ } // eslint-disable-next-line react-hooks/exhaustive-deps
83
+
84
+ }, [graphLoaded, selection]);
85
+ var icon = disabled ? /*#__PURE__*/React.createElement("img", {
86
+ src: "/img/topo/editor/toolbar/\u5BF9\u9F50/Disable.svg",
87
+ alt: ""
88
+ }) : /*#__PURE__*/React.createElement("img", {
89
+ src: "/img/topo/editor/toolbar/\u5BF9\u9F50/Normal.svg",
90
+ alt: ""
91
+ });
37
92
  return /*#__PURE__*/React.createElement(WidgetBox, {
38
93
  showLabel: showLabel,
94
+ disabled: disabled,
39
95
  label: "\u5BF9\u9F50\u65B9\u5F0F",
40
96
  tooltip: "\u5BF9\u9F50\u65B9\u5F0F"
41
- }, /*#__PURE__*/React.createElement(NodeAlignPopup, _extends({
97
+ }, /*#__PURE__*/React.createElement(DropdownButton, {
98
+ disabled: disabled,
99
+ trigger: icon
100
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
101
+ style: {
102
+ margin: '10px 7px 17px 7px'
103
+ }
104
+ }, /*#__PURE__*/React.createElement(AlignSetting, {
105
+ topo: topo,
106
+ distributionDisabled: distributionDisabled
107
+ })), /*#__PURE__*/React.createElement(_NumberPicker, {
108
+ disabled: disabled,
109
+ size: "small",
110
+ hasTrigger: false,
111
+ placeholder: distributionDisabled ? '' : '多个值',
112
+ className: styles.leftInput,
113
+ value: leftInputVal,
114
+ min: 0,
115
+ max: 10000,
116
+ onChange: leftInputChange
117
+ }), /*#__PURE__*/React.createElement(_NumberPicker, {
42
118
  disabled: disabled,
43
- selection: selection
44
- }, otherProps)));
119
+ size: "small",
120
+ hasTrigger: false // eslint-disable-next-line no-nested-ternary
121
+ ,
122
+ placeholder: distributionDisabled ? '' : '多个值',
123
+ className: styles.rightInput,
124
+ value: rightInputVal,
125
+ min: 0,
126
+ max: 10000,
127
+ onChange: rightInputChange
128
+ }))));
45
129
  }
46
130
 
47
131
  export default NodeAlignWidget;
@@ -0,0 +1,33 @@
1
+ .leftInput{
2
+ width: 106px !important;
3
+ margin: 0px 9px 10px 9px;
4
+ :global{
5
+ input{
6
+ background: url('/img/topo/editor/toolbar/对齐/水平间距_normal.svg')no-repeat 5px center !important;
7
+ background-position: 81px center !important;
8
+ }
9
+ .next-disabled input{
10
+ background: url('/img/topo/editor/toolbar/对齐/水平间距_disable.svg')no-repeat 5px center !important;
11
+ background-position: 81px center !important;
12
+ }
13
+ .next-input.next-small input{
14
+ height: calc(30px - 1px * 2);
15
+ }
16
+ }
17
+ }
18
+ .rightInput{
19
+ width: 106px !important;
20
+ :global{
21
+ input{
22
+ background: url('/img/topo/editor/toolbar/对齐/垂直间距 _normal.svg')no-repeat 5px center !important;
23
+ background-position: 82px center !important;
24
+ }
25
+ .next-disabled input{
26
+ background: url('/img/topo/editor/toolbar/对齐/垂直间距_disable.svg')no-repeat 5px center !important;
27
+ background-position: 82px center !important;
28
+ }
29
+ .next-input.next-small input{
30
+ height: calc(30px - 1px * 2);
31
+ }
32
+ }
33
+ }
@@ -2,7 +2,7 @@ import React, { useEffect, useState, forwardRef, useImperativeHandle } from "rea
2
2
  import TopoIconSelect from "../IconSelect";
3
3
  import { useNodeIcons } from "../../../../../common/icons/useIcons";
4
4
 
5
- function BoxBackgroundSetting(props, ref) {
5
+ function NodeImageList(props, ref) {
6
6
  var value = props.value,
7
7
  onChange = props.onChange,
8
8
  topo = props.topo;
@@ -15,4 +15,4 @@ function BoxBackgroundSetting(props, ref) {
15
15
  }));
16
16
  }
17
17
 
18
- export default BoxBackgroundSetting;
18
+ export default NodeImageList;
@@ -1,15 +1,25 @@
1
1
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
2
2
  var _excluded = ["topo", "showLabel"];
3
3
  import React, { useEffect, useState } from "react";
4
+ import { isGroup, isNode, isText } from "../../../../../../utils/htElementUtils";
4
5
  import DropdownButton from "../components/DropdownButton";
5
6
  import WidgetBox from "../WidgetBox";
6
7
  import BoxBackgroundSetting from "./BoxBackgroundSetting";
8
+
9
+ function isElementSetImageEnabled(element) {
10
+ if (isGroup(element)) {
11
+ return !element.isExpanded();
12
+ }
13
+
14
+ return isNode(element) && !isText(element) && element.a('type') !== 'box';
15
+ }
7
16
  /**
8
17
  * 替换图片设置
9
18
  * @param {*} props
10
19
  * @returns
11
20
  */
12
21
 
22
+
13
23
  function NodeImageButton(props) {
14
24
  var topo = props.topo,
15
25
  showLabel = props.showLabel,
@@ -24,13 +34,13 @@ function NodeImageButton(props) {
24
34
  setImgVal = _useState2[1]; // 选中的元素
25
35
 
26
36
 
27
- var selection = topo.selectionManager.useSelection();
37
+ var selection = topo.selectionModel.useHtSelection();
28
38
  useEffect(function () {
29
- console.log("NodeImageButton-selection", selection);
39
+ var nodes = selection.filter(isElementSetImageEnabled);
30
40
 
31
- if (selection && selection.length > 0) {
41
+ if (nodes.length > 0) {
32
42
  setDisabled(false);
33
- setImgVal(selection[0].image);
43
+ setImgVal(nodes[0].getImage());
34
44
  } else {
35
45
  setDisabled(true);
36
46
  }
@@ -41,10 +51,12 @@ function NodeImageButton(props) {
41
51
  // const gv = topo.view.topoClient.getGraphView();
42
52
  //const element = topo.getSelectionModel().getFirstData();
43
53
 
44
- var elements = topo.getSelectionModel();
54
+ var elements = selection;
45
55
  console.log("onChange-elements", elements);
46
- elements.each(function (element) {
47
- element.setImage(prop);
56
+ elements.forEach(function (element) {
57
+ if (isElementSetImageEnabled(element)) {
58
+ element.setImage(prop);
59
+ }
48
60
  }); // selection.map((element) => {
49
61
  // element.setImage(prop);
50
62
  // });
@@ -62,6 +74,7 @@ function NodeImageButton(props) {
62
74
  return /*#__PURE__*/React.createElement(WidgetBox, {
63
75
  label: "\u66FF\u6362\u56FE\u7247",
64
76
  tooltip: "\u66FF\u6362\u56FE\u7247",
77
+ disabled: disabled,
65
78
  showLabel: showLabel
66
79
  }, /*#__PURE__*/React.createElement(DropdownButton, {
67
80
  disabled: disabled,