@riil-frontend/component-topology 6.0.0-alpha.4 → 6.0.0-alpha.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (335) 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/es/components/ColorPanel/components/ColorBlock/index.js +37 -0
  6. package/es/components/ColorPanel/components/ColorBlock/index.module.scss +9 -0
  7. package/es/components/ColorPanel/components/FontColorRange/index.js +35 -0
  8. package/es/components/ColorPanel/components/FontColorRange/index.module.scss +25 -0
  9. package/es/components/ColorPanel/index.js +237 -0
  10. package/es/components/ColorPanel/index.module.scss +35 -0
  11. package/es/components/VerticalIconTab/VerticalIconTab.module.scss +5 -1
  12. package/es/components/collapse/Collapse.js +22 -3
  13. package/es/components/collapse/Collapse.module.scss +24 -0
  14. package/es/components/collapse/index.js +2 -0
  15. package/es/core/common/hooks/useHtElements.js +21 -0
  16. package/es/core/common/icons/icon.js +41 -0
  17. package/es/core/common/icons/useIcons.js +8 -16
  18. package/es/core/components/AlarmListPanel/components/AlarmListItem.js +14 -13
  19. package/es/core/components/AlarmListPanel/components/index.module.scss +5 -5
  20. package/es/core/components/DisplaySettingDrawer/DisplaySetting.js +2 -1
  21. package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +9 -3
  22. package/es/core/components/DisplaySettingDrawer/EditorDisplaySetting.js +122 -0
  23. package/es/core/components/DisplaySettingDrawer/LineExpandAllRadioGroup.js +0 -3
  24. package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +76 -19
  25. package/es/core/components/TopoView/GraphViewPanel.js +21 -0
  26. package/es/core/components/TopoView/editor.module.scss +1 -0
  27. package/es/core/components/TopoView/topoView.js +29 -49
  28. package/es/core/components/titlebar/TitleBar.module.scss +1 -1
  29. package/es/core/editor/components/EditorPlugin.js +2 -1
  30. package/es/core/editor/components/Sidebar/Sidebar.js +41 -50
  31. package/es/core/editor/components/Sidebar/panes.js +32 -0
  32. package/es/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.js +38 -0
  33. package/es/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.module.scss +74 -0
  34. package/es/core/editor/components/Sidebar/views/CanvasPanel/index.js +1 -1
  35. package/es/core/editor/components/Sidebar/views/CanvasPanel/themes.js +63 -0
  36. package/es/core/editor/components/Sidebar/views/CanvasPanel/useCanvasThemeConfig.js +115 -0
  37. package/es/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +3 -3
  38. package/es/core/editor/components/Sidebar/views/ImagePanel/HtCustomImagePanel.js +14 -6
  39. package/es/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.js +14 -5
  40. package/es/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.module.scss +5 -0
  41. package/es/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +20 -7
  42. package/es/core/editor/components/Toolbar/EditorToolbar.js +23 -13
  43. package/es/core/editor/components/Toolbar/Toolbar.js +1 -1
  44. package/es/core/editor/components/Toolbar/Toolbar.module.scss +14 -3
  45. package/es/core/editor/components/Toolbar/buttons.js +20 -18
  46. package/es/core/editor/components/Toolbar/widgets/AddResourceButton.js +8 -7
  47. package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundButton.js +2 -2
  48. package/es/core/editor/components/Toolbar/widgets/CanvasMoveWidget.js +13 -2
  49. package/es/core/editor/components/Toolbar/widgets/CanvasSelectWidget.js +11 -2
  50. package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/Content.js +46 -2
  51. package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +98 -6
  52. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +184 -3
  53. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.module.scss +44 -0
  54. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +53 -0
  55. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.module.scss +31 -0
  56. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/constants.js +77 -0
  57. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +74 -6
  58. package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +70 -16
  59. package/es/core/editor/components/Toolbar/widgets/FontColorButton.module.scss +43 -0
  60. package/es/core/editor/components/Toolbar/widgets/FontFamilyWidget.js +25 -11
  61. package/es/core/editor/components/Toolbar/widgets/FontSizeWidget.js +29 -13
  62. package/es/core/editor/components/Toolbar/widgets/FontStyleButton.js +100 -39
  63. package/es/core/editor/components/Toolbar/widgets/HistoryRedoButton.js +3 -2
  64. package/es/core/editor/components/Toolbar/widgets/HistoryUndoButton.js +5 -4
  65. package/es/core/editor/components/Toolbar/widgets/IconSelect/IconSelect.js +109 -0
  66. package/es/core/editor/components/Toolbar/widgets/IconSelect/constant.js +64 -0
  67. package/es/core/editor/components/Toolbar/widgets/IconSelect/index.js +101 -0
  68. package/es/core/editor/components/Toolbar/widgets/IconSelect/index.module.scss +153 -0
  69. package/es/core/editor/components/Toolbar/widgets/IconSelect/popUpContent.js +49 -0
  70. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutSettings.js +99 -0
  71. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutSettings.module.scss +70 -0
  72. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagImageSelect/index.js +42 -0
  73. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagImageSelect/index.module.scss +7 -0
  74. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagSelect/index.js +75 -0
  75. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagSelect/index.scss +32 -0
  76. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/Icon.js +23 -0
  77. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/index.js +10 -0
  78. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_circular.svg +10 -0
  79. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_hierarchical.svg +10 -0
  80. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_rectangle.svg +12 -0
  81. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_toward.svg +16 -0
  82. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/index.js +31 -0
  83. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/index.module.scss +53 -0
  84. package/es/core/editor/components/Toolbar/widgets/Layout/index.js +128 -15
  85. package/es/core/editor/components/Toolbar/widgets/NodeAlignWidget.js +95 -23
  86. package/es/core/editor/components/Toolbar/widgets/NodeAlignWidget.module.scss +33 -0
  87. package/es/core/editor/components/Toolbar/widgets/NodeImageButton/BoxBackgroundSetting.js +15 -5
  88. package/es/core/editor/components/Toolbar/widgets/NodeImageButton/NodeImageButton.js +41 -7
  89. package/es/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.js +98 -13
  90. package/es/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.module.scss +28 -0
  91. package/es/core/editor/components/Toolbar/widgets/WidgetBox.js +15 -22
  92. package/es/core/editor/components/Toolbar/widgets/WidgetBox.module.scss +11 -1
  93. package/es/core/editor/components/Toolbar/widgets/components/ButtonBox.js +5 -3
  94. package/es/core/editor/components/Toolbar/widgets/components/ButtonBox.module.scss +3 -0
  95. package/es/core/editor/components/Toolbar/widgets/components/DropdownButton.js +21 -3
  96. package/es/core/editor/components/Toolbar/widgets/components/DropdownMenu.js +16 -6
  97. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/ElementTextStyleSetting.js +49 -0
  98. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/colorUtil.js +59 -0
  99. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/box.js +30 -0
  100. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +25 -0
  101. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/groupTitle.js +41 -0
  102. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/index.js +14 -0
  103. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/layerTitle.js +49 -0
  104. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/nodeTag.js +36 -0
  105. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/text.js +32 -0
  106. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/textStyleUtil.js +71 -0
  107. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/GlobalTagStyleSetting.js +25 -0
  108. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/globalTag.js +52 -0
  109. package/es/core/editor/components/Toolbar/widgets/components/textStyleSetting/textStyleSettingRouter.js +20 -0
  110. package/es/core/editor/components/settings/CloseablePanel.js +33 -0
  111. package/es/core/editor/components/settings/CloseablePanel.module.scss +9 -0
  112. package/es/core/editor/components/settings/OpenPropertyPanelListener.js +33 -0
  113. package/es/core/editor/components/settings/PropertyView.js +29 -8
  114. package/es/core/editor/components/settings/Settings.js +4 -44
  115. package/es/core/editor/components/settings/Settings.module.scss +8 -4
  116. package/es/core/editor/components/settings/common/AlignSetting/AlignSetting.module.scss +2 -2
  117. package/es/core/editor/components/settings/common/AlignSetting/AlignTypeList.js +80 -0
  118. package/es/core/editor/components/settings/common/AlignSetting/index.js +20 -72
  119. package/es/core/editor/components/settings/common/LineType/index.js +12 -119
  120. package/es/core/editor/components/settings/common/NodeSizeInput/NodeSizeInput.js +3 -3
  121. package/es/core/editor/components/settings/common/SizeInput/NodeSizeInput.js +31 -21
  122. package/es/core/editor/components/settings/common/SizeInput/NodeSizeNumberPicker.js +7 -6
  123. package/es/core/editor/components/settings/common/text/fontStyleUtil.js +11 -19
  124. package/es/core/editor/components/settings/propertyViews/edge/CommonEdgePropertyView.js +7 -1
  125. package/es/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js +0 -8
  126. package/es/core/editor/components/settings/propertyViews/multipleElements/BatchSetNodeSize/BatchSetNodeSize.js +8 -9
  127. package/es/core/editor/components/settings/propertyViews/multipleElements/MultipleElementLineType.js +5 -42
  128. package/es/core/editor/components/settings/propertyViews/multipleElements/MultipleElementPropertyView.js +2 -15
  129. package/es/core/editor/components/settings/propertyViews/text/TextPropertyView.js +1 -1
  130. package/es/core/editor/components/settings/propertyViews/view/BatchSetNodeSize.js +9 -6
  131. package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +8 -4
  132. package/es/core/editor/hooks/useKeyboardShortcut.js +42 -0
  133. package/es/core/{store/models → editor/store}/background.js +0 -0
  134. package/es/core/{store/models → editor/store}/historyManager.js +0 -0
  135. package/es/core/editor/store/topoEdit.js +49 -0
  136. package/es/core/editor/utils/edgeTypeStyleUtil.js +96 -0
  137. package/es/core/editor/utils/textStyleUtil.js +0 -0
  138. package/es/core/hooks/useCanvasTheme.js +61 -0
  139. package/es/core/hooks/usePolling.js +2 -5
  140. package/es/core/hooks/useTopoEdit.js +38 -58
  141. package/es/core/models/Alarm.js +2 -2
  142. package/es/core/models/AttributeMetricDisplay.js +4 -0
  143. package/es/core/models/HistoryManager.js +11 -3
  144. package/es/core/models/SelectionManager.js +28 -9
  145. package/es/core/models/TopoApp.js +1 -1
  146. package/es/core/models/TopoGraphView.js +8 -2
  147. package/es/core/models/selection/ignoreList.js +1 -0
  148. package/es/core/models/utils/linkUtils.js +5 -6
  149. package/es/core/store/coreModels.js +6 -7
  150. package/es/core/store/models/selection.js +2 -1
  151. package/es/core/store/models/topoBizMod.js +0 -3
  152. package/es/core/store/models/topoConfig.js +10 -12
  153. package/es/core/store/models/topoMod.js +26 -28
  154. package/es/core/utils/edgeUtil.js +6 -0
  155. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +3 -4
  156. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +19 -5
  157. package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/WebConsoleForm.js +13 -29
  158. package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +6 -5
  159. package/es/core/viewer/components/titlebar/widgets/SettingButton.js +3 -1
  160. package/es/core/viewer/components/titlebar/widgets/SettingButtonWidget.js +4 -2
  161. package/es/networkTopo/createTopo.js +2 -0
  162. package/es/networkTopo/services/link.js +2 -2
  163. package/es/networkTopo/store/topoTreeMod.js +6 -7
  164. package/es/style.js +1 -0
  165. package/es/utils/htElementUtils.js +3 -0
  166. package/es/utils/topoData.js +1 -0
  167. package/lib/components/ColorPanel/components/ColorBlock/index.js +47 -0
  168. package/lib/components/ColorPanel/components/ColorBlock/index.module.scss +9 -0
  169. package/lib/components/ColorPanel/components/FontColorRange/index.js +49 -0
  170. package/lib/components/ColorPanel/components/FontColorRange/index.module.scss +25 -0
  171. package/lib/components/ColorPanel/index.js +255 -0
  172. package/lib/components/ColorPanel/index.module.scss +35 -0
  173. package/lib/components/VerticalIconTab/VerticalIconTab.module.scss +5 -1
  174. package/lib/components/collapse/Collapse.js +28 -3
  175. package/lib/components/collapse/Collapse.module.scss +24 -0
  176. package/lib/components/collapse/index.js +11 -0
  177. package/lib/core/common/hooks/useHtElements.js +27 -0
  178. package/lib/core/common/icons/icon.js +48 -0
  179. package/lib/core/common/icons/useIcons.js +10 -15
  180. package/lib/core/components/AlarmListPanel/components/AlarmListItem.js +14 -13
  181. package/lib/core/components/AlarmListPanel/components/index.module.scss +5 -5
  182. package/lib/core/components/DisplaySettingDrawer/DisplaySetting.js +2 -1
  183. package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +10 -3
  184. package/lib/core/components/DisplaySettingDrawer/EditorDisplaySetting.js +147 -0
  185. package/lib/core/components/DisplaySettingDrawer/LineExpandAllRadioGroup.js +0 -3
  186. package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +76 -19
  187. package/lib/core/components/TopoView/GraphViewPanel.js +31 -0
  188. package/lib/core/components/TopoView/editor.module.scss +1 -0
  189. package/lib/core/components/TopoView/topoView.js +32 -50
  190. package/lib/core/components/titlebar/TitleBar.module.scss +1 -1
  191. package/lib/core/editor/components/EditorPlugin.js +3 -1
  192. package/lib/core/editor/components/Sidebar/Sidebar.js +40 -53
  193. package/lib/core/editor/components/Sidebar/panes.js +45 -0
  194. package/lib/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.js +53 -0
  195. package/lib/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.module.scss +74 -0
  196. package/lib/core/editor/components/Sidebar/views/CanvasPanel/index.js +2 -2
  197. package/lib/core/editor/components/Sidebar/views/CanvasPanel/themes.js +72 -0
  198. package/lib/core/editor/components/Sidebar/views/CanvasPanel/useCanvasThemeConfig.js +128 -0
  199. package/lib/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +1 -1
  200. package/lib/core/editor/components/Sidebar/views/ImagePanel/HtCustomImagePanel.js +15 -6
  201. package/lib/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.js +16 -5
  202. package/lib/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.module.scss +5 -0
  203. package/lib/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +29 -11
  204. package/lib/core/editor/components/Toolbar/EditorToolbar.js +22 -11
  205. package/lib/core/editor/components/Toolbar/Toolbar.js +1 -1
  206. package/lib/core/editor/components/Toolbar/Toolbar.module.scss +14 -3
  207. package/lib/core/editor/components/Toolbar/buttons.js +21 -20
  208. package/lib/core/editor/components/Toolbar/widgets/AddResourceButton.js +8 -7
  209. package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundButton.js +2 -2
  210. package/lib/core/editor/components/Toolbar/widgets/CanvasMoveWidget.js +13 -2
  211. package/lib/core/editor/components/Toolbar/widgets/CanvasSelectWidget.js +11 -2
  212. package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/Content.js +48 -2
  213. package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +100 -6
  214. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +194 -3
  215. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.module.scss +44 -0
  216. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +71 -0
  217. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.module.scss +31 -0
  218. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/constants.js +83 -0
  219. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +76 -5
  220. package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +75 -16
  221. package/lib/core/editor/components/Toolbar/widgets/FontColorButton.module.scss +43 -0
  222. package/lib/core/editor/components/Toolbar/widgets/FontFamilyWidget.js +26 -10
  223. package/lib/core/editor/components/Toolbar/widgets/FontSizeWidget.js +30 -12
  224. package/lib/core/editor/components/Toolbar/widgets/FontStyleButton.js +105 -39
  225. package/lib/core/editor/components/Toolbar/widgets/HistoryRedoButton.js +4 -2
  226. package/lib/core/editor/components/Toolbar/widgets/HistoryUndoButton.js +5 -3
  227. package/lib/core/editor/components/Toolbar/widgets/IconSelect/IconSelect.js +126 -0
  228. package/lib/core/editor/components/Toolbar/widgets/IconSelect/constant.js +69 -0
  229. package/lib/core/editor/components/Toolbar/widgets/IconSelect/index.js +117 -0
  230. package/lib/core/editor/components/Toolbar/widgets/IconSelect/index.module.scss +153 -0
  231. package/lib/core/editor/components/Toolbar/widgets/IconSelect/popUpContent.js +61 -0
  232. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutSettings.js +116 -0
  233. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutSettings.module.scss +70 -0
  234. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagImageSelect/index.js +55 -0
  235. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagImageSelect/index.module.scss +7 -0
  236. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagSelect/index.js +93 -0
  237. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagSelect/index.scss +32 -0
  238. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/Icon.js +32 -0
  239. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/index.js +22 -0
  240. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_circular.svg +10 -0
  241. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_hierarchical.svg +10 -0
  242. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_rectangle.svg +12 -0
  243. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_toward.svg +16 -0
  244. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/index.js +44 -0
  245. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/index.module.scss +53 -0
  246. package/lib/core/editor/components/Toolbar/widgets/Layout/index.js +133 -16
  247. package/lib/core/editor/components/Toolbar/widgets/NodeAlignWidget.js +98 -23
  248. package/lib/core/editor/components/Toolbar/widgets/NodeAlignWidget.module.scss +33 -0
  249. package/lib/core/editor/components/Toolbar/widgets/NodeImageButton/BoxBackgroundSetting.js +21 -5
  250. package/lib/core/editor/components/Toolbar/widgets/NodeImageButton/NodeImageButton.js +41 -6
  251. package/lib/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.js +99 -12
  252. package/lib/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.module.scss +28 -0
  253. package/lib/core/editor/components/Toolbar/widgets/WidgetBox.js +16 -22
  254. package/lib/core/editor/components/Toolbar/widgets/WidgetBox.module.scss +11 -1
  255. package/lib/core/editor/components/Toolbar/widgets/components/ButtonBox.js +5 -3
  256. package/lib/core/editor/components/Toolbar/widgets/components/ButtonBox.module.scss +3 -0
  257. package/lib/core/editor/components/Toolbar/widgets/components/DropdownButton.js +21 -3
  258. package/lib/core/editor/components/Toolbar/widgets/components/DropdownMenu.js +17 -6
  259. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/ElementTextStyleSetting.js +63 -0
  260. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/colorUtil.js +72 -0
  261. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/box.js +45 -0
  262. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/edgeTag.js +40 -0
  263. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/groupTitle.js +57 -0
  264. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/index.js +28 -0
  265. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/layerTitle.js +64 -0
  266. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/nodeTag.js +52 -0
  267. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/elements/text.js +47 -0
  268. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/ElementTextStyleSetting/textStyleUtil.js +83 -0
  269. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/GlobalTagStyleSetting.js +39 -0
  270. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/GlobalTagStyleSetting/globalTag.js +65 -0
  271. package/lib/core/editor/components/Toolbar/widgets/components/textStyleSetting/textStyleSettingRouter.js +31 -0
  272. package/lib/core/editor/components/settings/CloseablePanel.js +46 -0
  273. package/lib/core/editor/components/settings/CloseablePanel.module.scss +9 -0
  274. package/lib/core/editor/components/settings/OpenPropertyPanelListener.js +43 -0
  275. package/lib/core/editor/components/settings/PropertyView.js +32 -8
  276. package/lib/core/editor/components/settings/Settings.js +4 -44
  277. package/lib/core/editor/components/settings/Settings.module.scss +8 -4
  278. package/lib/core/editor/components/settings/common/AlignSetting/AlignSetting.module.scss +2 -2
  279. package/lib/core/editor/components/settings/common/AlignSetting/AlignTypeList.js +97 -0
  280. package/lib/core/editor/components/settings/common/AlignSetting/index.js +21 -80
  281. package/lib/core/editor/components/settings/common/LineType/index.js +13 -126
  282. package/lib/core/editor/components/settings/common/NodeSizeInput/NodeSizeInput.js +2 -2
  283. package/lib/core/editor/components/settings/common/SizeInput/NodeSizeInput.js +32 -23
  284. package/lib/core/editor/components/settings/common/SizeInput/NodeSizeNumberPicker.js +6 -6
  285. package/lib/core/editor/components/settings/common/text/fontStyleUtil.js +12 -20
  286. package/lib/core/editor/components/settings/propertyViews/edge/CommonEdgePropertyView.js +7 -1
  287. package/lib/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js +0 -8
  288. package/lib/core/editor/components/settings/propertyViews/multipleElements/BatchSetNodeSize/BatchSetNodeSize.js +6 -8
  289. package/lib/core/editor/components/settings/propertyViews/multipleElements/MultipleElementLineType.js +5 -42
  290. package/lib/core/editor/components/settings/propertyViews/multipleElements/MultipleElementPropertyView.js +2 -15
  291. package/lib/core/editor/components/settings/propertyViews/text/TextPropertyView.js +1 -1
  292. package/lib/core/editor/components/settings/propertyViews/view/BatchSetNodeSize.js +7 -5
  293. package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +9 -1
  294. package/lib/core/editor/hooks/useKeyboardShortcut.js +52 -0
  295. package/lib/core/{store/models → editor/store}/background.js +0 -0
  296. package/lib/core/{store/models → editor/store}/historyManager.js +0 -0
  297. package/lib/core/editor/store/topoEdit.js +59 -0
  298. package/lib/core/editor/utils/edgeTypeStyleUtil.js +109 -0
  299. package/lib/core/editor/utils/textStyleUtil.js +1 -0
  300. package/lib/core/hooks/useCanvasTheme.js +75 -0
  301. package/lib/core/hooks/usePolling.js +2 -5
  302. package/lib/core/hooks/useTopoEdit.js +39 -60
  303. package/lib/core/models/Alarm.js +2 -2
  304. package/lib/core/models/AttributeMetricDisplay.js +4 -0
  305. package/lib/core/models/HistoryManager.js +11 -3
  306. package/lib/core/models/SelectionManager.js +30 -9
  307. package/lib/core/models/TopoApp.js +1 -1
  308. package/lib/core/models/TopoGraphView.js +8 -2
  309. package/lib/core/models/selection/ignoreList.js +6 -0
  310. package/lib/core/models/utils/linkUtils.js +5 -6
  311. package/lib/core/store/coreModels.js +5 -7
  312. package/lib/core/store/models/selection.js +2 -1
  313. package/lib/core/store/models/topoBizMod.js +0 -3
  314. package/lib/core/store/models/topoConfig.js +9 -18
  315. package/lib/core/store/models/topoMod.js +27 -29
  316. package/lib/core/utils/edgeUtil.js +6 -0
  317. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/hooks/useMetricPolling.js +3 -4
  318. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +19 -5
  319. package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/WebConsoleForm.js +13 -29
  320. package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +6 -5
  321. package/lib/core/viewer/components/titlebar/widgets/SettingButton.js +3 -1
  322. package/lib/core/viewer/components/titlebar/widgets/SettingButtonWidget.js +4 -2
  323. package/lib/networkTopo/createTopo.js +3 -0
  324. package/lib/networkTopo/services/link.js +2 -2
  325. package/lib/networkTopo/store/topoTreeMod.js +6 -8
  326. package/lib/style.js +1 -0
  327. package/lib/utils/htElementUtils.js +5 -0
  328. package/lib/utils/topoData.js +1 -0
  329. package/package.json +5 -4
  330. package/es/core/editor/components/Sidebar/views/CanvasPanel/ImagePanel.js +0 -4
  331. package/es/core/store/models/topoEdit.js +0 -39
  332. package/es/core/store/models/topoView.js +0 -36
  333. package/lib/core/editor/components/Sidebar/views/CanvasPanel/ImagePanel.js +0 -12
  334. package/lib/core/store/models/topoEdit.js +0 -51
  335. package/lib/core/store/models/topoView.js +0 -47
@@ -0,0 +1,33 @@
1
+ .leftInput{
2
+ width: 100px !important;
3
+ margin: 0px 10px 10px 9px;
4
+ :global{
5
+ input{
6
+ background: url('/img/topo/editor/toolbar/对齐/水平间距_normal.svg')no-repeat 5px center !important;
7
+ background-position: 81px center !important;
8
+ }
9
+ .next-disabled input{
10
+ background: url('/img/topo/editor/toolbar/对齐/水平间距_disable.svg')no-repeat 5px center !important;
11
+ background-position: 81px center !important;
12
+ }
13
+ .next-input.next-small input{
14
+ height: calc(30px - 1px * 2);
15
+ }
16
+ }
17
+ }
18
+ .rightInput{
19
+ width: 100px !important;
20
+ :global{
21
+ input{
22
+ background: url('/img/topo/editor/toolbar/对齐/垂直间距 _normal.svg')no-repeat 5px center !important;
23
+ background-position: 82px center !important;
24
+ }
25
+ .next-disabled input{
26
+ background: url('/img/topo/editor/toolbar/对齐/垂直间距_disable.svg')no-repeat 5px center !important;
27
+ background-position: 82px center !important;
28
+ }
29
+ .next-input.next-small input{
30
+ height: calc(30px - 1px * 2);
31
+ }
32
+ }
33
+ }
@@ -1,8 +1,18 @@
1
- import React from 'react';
1
+ import React, { useEffect, useState, forwardRef, useImperativeHandle } from "react";
2
+ import TopoIconSelect from "../IconSelect";
3
+ import { useNodeIcons } from "../../../../../common/icons/useIcons";
2
4
 
3
- function BoxBackgroundSetting(props) {
4
- // const { } = props
5
- return /*#__PURE__*/React.createElement("div", null, "xxx");
5
+ function NodeImageList(props, ref) {
6
+ var value = props.value,
7
+ onChange = props.onChange,
8
+ topo = props.topo;
9
+ useEffect(function () {}, []);
10
+ var icons = useNodeIcons(topo);
11
+ return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(TopoIconSelect, {
12
+ value: value,
13
+ iconList: icons,
14
+ onChange: onChange
15
+ }));
6
16
  }
7
17
 
8
- export default BoxBackgroundSetting;
18
+ export default NodeImageList;
@@ -1,13 +1,14 @@
1
1
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
2
2
  var _excluded = ["topo", "showLabel"];
3
- import React, { useEffect, useState } from 'react';
3
+ import React, { useEffect, useState } from "react";
4
+ import { isGroup, isNode } from "../../../../../../utils/htElementUtils";
4
5
  import DropdownButton from "../components/DropdownButton";
5
6
  import WidgetBox from "../WidgetBox";
6
7
  import BoxBackgroundSetting from "./BoxBackgroundSetting";
7
8
  /**
8
9
  * 替换图片设置
9
- * @param {*} props
10
- * @returns
10
+ * @param {*} props
11
+ * @returns
11
12
  */
12
13
 
13
14
  function NodeImageButton(props) {
@@ -17,13 +18,43 @@ function NodeImageButton(props) {
17
18
 
18
19
  var _useState = useState(true),
19
20
  disabled = _useState[0],
20
- setDisabled = _useState[1]; // 选中的元素
21
+ setDisabled = _useState[1];
21
22
 
23
+ var _useState2 = useState(),
24
+ imgVal = _useState2[0],
25
+ setImgVal = _useState2[1]; // 选中的元素
22
26
 
23
- var selection = topo.selectionManager.useSelection();
27
+
28
+ var selection = topo.selectionManager.useHtSelection();
24
29
  useEffect(function () {
25
- setDisabled(false);
30
+ var nodes = selection.filter(function (ele) {
31
+ return isGroup(ele) || isNode(ele);
32
+ });
33
+
34
+ if (nodes.length > 0) {
35
+ setDisabled(false);
36
+ setImgVal(nodes[0].getImage());
37
+ } else {
38
+ setDisabled(true);
39
+ }
26
40
  }, [selection]);
41
+
42
+ var onChange = function onChange(prop) {
43
+ console.log("onChange-prop", prop, selection); //const { name, value } = prop;
44
+ // const gv = topo.view.topoClient.getGraphView();
45
+ //const element = topo.getSelectionModel().getFirstData();
46
+
47
+ var elements = topo.getSelectionModel();
48
+ console.log("onChange-elements", elements);
49
+ elements.each(function (element) {
50
+ element.setImage(prop);
51
+ }); // selection.map((element) => {
52
+ // element.setImage(prop);
53
+ // });
54
+ // if (name === "image") {
55
+ // }
56
+ };
57
+
27
58
  var icon = disabled ? /*#__PURE__*/React.createElement("img", {
28
59
  src: "/img/topo/editor/toolbar/\u66FF\u6362\u56FE\u7247/Disable.svg",
29
60
  alt: ""
@@ -34,12 +65,15 @@ function NodeImageButton(props) {
34
65
  return /*#__PURE__*/React.createElement(WidgetBox, {
35
66
  label: "\u66FF\u6362\u56FE\u7247",
36
67
  tooltip: "\u66FF\u6362\u56FE\u7247",
68
+ disabled: disabled,
37
69
  showLabel: showLabel
38
70
  }, /*#__PURE__*/React.createElement(DropdownButton, {
39
71
  disabled: disabled,
40
72
  trigger: icon
41
73
  }, /*#__PURE__*/React.createElement(BoxBackgroundSetting, {
42
- topo: topo
74
+ topo: topo,
75
+ onChange: onChange,
76
+ value: imgVal
43
77
  })));
44
78
  }
45
79
 
@@ -1,13 +1,17 @@
1
1
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
2
2
  var _excluded = ["topo", "showLabel"];
3
- import React, { useEffect, useState } from 'react';
4
- import BatchSetNodeSize from "../../../settings/propertyViews/view/BatchSetNodeSize";
3
+ import React, { useEffect, useState } from 'react'; // import BatchSetNodeSize from "../../../settings/propertyViews/view/BatchSetNodeSize";
4
+
5
+ import BatchSetNodeSize from "../../../settings/propertyViews/multipleElements/BatchSetNodeSize/BatchSetNodeSize";
6
+ import NodeSizeInput from "../../../settings/common/NodeSizeInput/NodeSizeInput";
7
+ import useSettingRuntimeState from "../../../settings/useSettingRuntimeState";
5
8
  import WidgetBox from "../WidgetBox";
6
- import BoxBackgroundSetting from "./BoxBackgroundSetting";
9
+ import styles from "./NodeSizeButton.module.scss";
10
+ import { isGroup, isNode } from "../../../../../../utils/htElementUtils";
7
11
  /**
8
12
  * 图片尺寸设置
9
- * @param {*} props
10
- * @returns
13
+ * @param {*} props
14
+ * @returns
11
15
  */
12
16
 
13
17
  function NodeSizeButton(props) {
@@ -17,25 +21,106 @@ function NodeSizeButton(props) {
17
21
 
18
22
  var _useState = useState(true),
19
23
  disabled = _useState[0],
20
- setDisabled = _useState[1]; // 选中的元素
24
+ setDisabled = _useState[1];
25
+
26
+ var _useState2 = useState(),
27
+ size = _useState2[0],
28
+ setSize = _useState2[1]; // 选中的元素
21
29
 
22
30
 
23
31
  var selection = topo.selectionManager.useSelection();
32
+ var settingRuntimeState = useSettingRuntimeState();
24
33
  useEffect(function () {
25
- setDisabled(false);
34
+ var elements = selection.map(function (item) {
35
+ return item.id;
36
+ }).map(function (id) {
37
+ return topo.getDataModel().getDataById(id);
38
+ });
39
+ var nodes = elements.filter(function (ele) {
40
+ return isGroup(ele) || isNode(ele);
41
+ });
42
+
43
+ if (nodes.length > 0) {
44
+ setDisabled(false);
45
+
46
+ if (selection.length === 1) {
47
+ var element = nodes[0];
48
+ setSize({
49
+ width: element.getWidth(),
50
+ height: element.getHeight()
51
+ });
52
+ }
53
+ } else {
54
+ setDisabled(true);
55
+ setSize({
56
+ width: null,
57
+ height: null
58
+ });
59
+ }
26
60
  }, [selection]);
61
+
62
+ var _onChange = function onChange(prop) {
63
+ var name = prop.name,
64
+ value = prop.value;
65
+ var element = topo.getSelectionModel().getFirstData();
66
+
67
+ if (name === 'width') {
68
+ element.setWidth(value);
69
+ } else if (name === 'height') {
70
+ element.setHeight(value);
71
+ }
72
+ };
73
+
27
74
  return /*#__PURE__*/React.createElement(WidgetBox, {
28
75
  label: "\u56FE\u7247\u5C3A\u5BF8",
76
+ disabled: disabled,
29
77
  tooltip: "\u56FE\u7247\u5C3A\u5BF8",
30
78
  showLabel: showLabel
31
79
  }, /*#__PURE__*/React.createElement("div", {
32
- style: {
33
- width: 136
80
+ className: styles.toolbarNodeSizeSetting
81
+ }, selection.length > 1 ? /*#__PURE__*/React.createElement(BatchSetNodeSize, {
82
+ topo: topo // size="small"
83
+ ,
84
+ value: size,
85
+ disabled: disabled,
86
+ showLabel: false,
87
+ numberPickerProps: {
88
+ hasTrigger: false,
89
+ placeholder: '-'
90
+ } // onChange={(size) => {
91
+ // topo.historyManager.beginTransaction();
92
+ // onChange({ name: "width", value: size.width });
93
+ // onChange({ name: "height", value: size.height });
94
+ // topo.historyManager.endTransaction();
95
+ // }}
96
+
97
+ }) : /*#__PURE__*/React.createElement(NodeSizeInput, {
98
+ topo: topo // size="small"
99
+ ,
100
+ value: size,
101
+ disabled: disabled,
102
+ showLabel: false,
103
+ hasTrigger: false,
104
+ numberPickerProps: {
105
+ hasTrigger: false,
106
+ placeholder: '-'
107
+ },
108
+ settingRuntimeState: settingRuntimeState,
109
+ onChange: function onChange(size) {
110
+ topo.historyManager.beginTransaction();
111
+
112
+ _onChange({
113
+ name: 'width',
114
+ value: size.width
115
+ });
116
+
117
+ _onChange({
118
+ name: 'height',
119
+ value: size.height
120
+ });
121
+
122
+ topo.historyManager.endTransaction();
34
123
  }
35
- }, /*#__PURE__*/React.createElement(BatchSetNodeSize, {
36
- topo: topo,
37
- size: "small",
38
- showLabel: false
39
124
  })));
40
125
  }
41
126
 
@@ -0,0 +1,28 @@
1
+ @import '~@alifd/next/variables.scss';
2
+
3
+ .toolbarNodeSizeSetting {
4
+ width: 144px;
5
+
6
+ // 图片尺寸输入框
7
+ :global {
8
+ .#{$css-prefix}input-inner {
9
+ padding-right: 8px;
10
+ }
11
+
12
+ .#{$css-prefix}input.#{$css-prefix}medium {
13
+ height: 24px;
14
+ }
15
+
16
+ .#{$css-prefix}input {
17
+ border: none;
18
+
19
+ &:hover:not(.#{$css-prefix}disabled) {
20
+ background: #F2F7FD;
21
+ }
22
+ }
23
+
24
+ .#{$css-prefix}input.#{$css-prefix}medium input {
25
+ height: 24px;
26
+ }
27
+ }
28
+ }
@@ -1,9 +1,10 @@
1
+ import _Balloon from "@alifd/next/es/balloon";
1
2
  import _extends from "@babel/runtime/helpers/extends";
2
3
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
3
- import _Balloon from "@alifd/next/es/balloon";
4
- var _excluded = ["active", "disabled", "children"];
5
- import classNames from 'classnames';
4
+ var _excluded = ["label", "showLabel", "tooltip", "disabled", "children"];
6
5
  import React from 'react';
6
+ import classnames from 'classnames';
7
+ import ButtonBox from "./components/ButtonBox";
7
8
  import styles from "./WidgetBox.module.scss";
8
9
 
9
10
  function WidgetBox(props) {
@@ -11,15 +12,16 @@ function WidgetBox(props) {
11
12
  showLabel = props.showLabel,
12
13
  tooltip = props.tooltip,
13
14
  disabled = props.disabled,
14
- children = props.children;
15
- var button = /*#__PURE__*/React.createElement("button", {
15
+ children = props.children,
16
+ otherProps = _objectWithoutPropertiesLoose(props, _excluded);
17
+
18
+ var button = /*#__PURE__*/React.createElement("div", _extends({
16
19
  disabled: disabled,
17
- type: "button",
18
20
  className: styles.container
19
- }, /*#__PURE__*/React.createElement("div", {
21
+ }, otherProps), /*#__PURE__*/React.createElement("div", {
20
22
  className: styles.content
21
23
  }, children), showLabel !== false && /*#__PURE__*/React.createElement("div", {
22
- className: styles.label
24
+ className: classnames(styles.label, disabled ? styles.disabledLabel : styles.normalLabel)
23
25
  }, label));
24
26
 
25
27
  if (!tooltip) {
@@ -28,22 +30,13 @@ function WidgetBox(props) {
28
30
 
29
31
  return /*#__PURE__*/React.createElement(_Balloon.Tooltip, {
30
32
  trigger: button,
31
- align: "b"
33
+ align: "b" // 解决遮挡下拉浮层问题
34
+ ,
35
+ popupStyle: {
36
+ zIndex: 1000
37
+ }
32
38
  }, tooltip);
33
39
  }
34
40
 
35
- function ButtonBox(props) {
36
- var _classNames;
37
-
38
- var active = props.active,
39
- disabled = props.disabled,
40
- children = props.children,
41
- otherProps = _objectWithoutPropertiesLoose(props, _excluded);
42
-
43
- return /*#__PURE__*/React.createElement("div", _extends({
44
- className: classNames(styles.ButtonBox, (_classNames = {}, _classNames[styles.ButtonBoxActive] = active, _classNames[styles.ButtonBoxDisabled] = disabled, _classNames))
45
- }, otherProps), children);
46
- }
47
-
48
41
  WidgetBox.ButtonBox = ButtonBox;
49
42
  export default WidgetBox;
@@ -8,6 +8,7 @@
8
8
  border-width: 0;
9
9
  background-color: transparent;
10
10
  border-color: transparent;
11
+ user-select: none;
11
12
 
12
13
  &[disabled] {
13
14
  cursor: not-allowed;
@@ -43,6 +44,14 @@
43
44
  text-align: center;
44
45
  }
45
46
 
47
+ .disabledLabel {
48
+ color: #C9CED2;
49
+ }
50
+
51
+ .normalLabel {
52
+ color: #78849C;
53
+ }
54
+
46
55
  .ButtonBox {
47
56
  height: 24px;
48
57
  display: flex;
@@ -56,9 +65,10 @@
56
65
  background: rgba(76, 137, 255, 0.1);
57
66
  border-radius: 4px;
58
67
  }
68
+
59
69
  &.ButtonBoxDisabled:hover {
60
70
  background: transparent;
61
71
  cursor: not-allowed;
62
72
  }
63
-
73
+
64
74
  }
@@ -1,7 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _Icon from "@alifd/next/es/icon";
3
3
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
4
- var _excluded = ["active", "disabled", "showArrow", "children"];
4
+ var _excluded = ["active", "disabled", "showArrow", "children", "onClick"];
5
5
  import React from 'react';
6
6
  import PropTypes from 'prop-types';
7
7
  import classNames from 'classnames';
@@ -14,14 +14,16 @@ function ButtonBox(props) {
14
14
  disabled = props.disabled,
15
15
  showArrow = props.showArrow,
16
16
  children = props.children,
17
+ onClick = props.onClick,
17
18
  otherProps = _objectWithoutPropertiesLoose(props, _excluded);
18
19
 
19
20
  return /*#__PURE__*/React.createElement("div", _extends({
20
- className: classNames(styles.ButtonBox, (_classNames = {}, _classNames[styles.ButtonBoxActive] = active, _classNames[styles.ButtonBoxDisabled] = disabled, _classNames))
21
+ className: classNames(styles.ButtonBox, (_classNames = {}, _classNames[styles.ButtonBoxActive] = active, _classNames[styles.ButtonBoxDisabled] = disabled, _classNames)),
22
+ onClick: disabled ? undefined : onClick
21
23
  }, otherProps), children, showArrow && /*#__PURE__*/React.createElement(React.Fragment, null, "\xA0", /*#__PURE__*/React.createElement(_Icon, {
22
24
  type: "tree_fold_arrow",
23
25
  size: "xxs",
24
- className: classNames(styles.icon, (_classNames2 = {}, _classNames2[styles.active] = active, _classNames2))
26
+ className: classNames(styles.icon, (_classNames2 = {}, _classNames2[styles.active] = active, _classNames2[styles.disabled] = disabled, _classNames2))
25
27
  })));
26
28
  }
27
29
 
@@ -27,4 +27,7 @@
27
27
  &.active {
28
28
  transform: rotate(180deg) scale(0.5) !important;
29
29
  }
30
+ &.disabled {
31
+ color: #C9CED2;
32
+ }
30
33
  }
@@ -1,4 +1,5 @@
1
1
  import _Dropdown from "@alifd/next/es/dropdown";
2
+ import _extends from "@babel/runtime/helpers/extends";
2
3
  import React, { useState } from 'react';
3
4
  import PropTypes from 'prop-types';
4
5
  import ButtonBox from "./ButtonBox";
@@ -6,26 +7,43 @@ import styles from "./DropdownButton.module.scss";
6
7
 
7
8
  function DropdownButton(props) {
8
9
  var trigger = props.trigger,
10
+ disabled = props.disabled,
9
11
  _props$showArrow = props.showArrow,
10
12
  showArrow = _props$showArrow === void 0 ? true : _props$showArrow,
11
13
  _props$showContainer = props.showContainer,
12
14
  showContainer = _props$showContainer === void 0 ? true : _props$showContainer,
15
+ buttonBoxProps = props.buttonBoxProps,
13
16
  children = props.children;
14
17
 
15
18
  var _useState = useState(false),
16
19
  visible = _useState[0],
17
20
  setVisible = _useState[1];
18
21
 
19
- var button = /*#__PURE__*/React.createElement(ButtonBox, {
22
+ var button = /*#__PURE__*/React.createElement(ButtonBox, _extends({
20
23
  active: visible,
24
+ disabled: disabled,
21
25
  showArrow: showArrow
22
- }, trigger);
26
+ }, buttonBoxProps), trigger);
27
+
28
+ var renderContent = function renderContent() {
29
+ if (!visible) {
30
+ return /*#__PURE__*/React.createElement("div", null);
31
+ }
32
+
33
+ if (showContainer) {
34
+ return /*#__PURE__*/React.createElement(PopupCard, null, children);
35
+ }
36
+
37
+ return children;
38
+ };
39
+
23
40
  return /*#__PURE__*/React.createElement(_Dropdown, {
24
41
  visible: visible,
42
+ disabled: disabled,
25
43
  trigger: button,
26
44
  triggerType: "click",
27
45
  onVisibleChange: setVisible
28
- }, !showContainer ? children : /*#__PURE__*/React.createElement(PopupCard, null, children));
46
+ }, renderContent());
29
47
  }
30
48
 
31
49
  DropdownButton.propTypes = {
@@ -6,18 +6,28 @@ import DropdownButton from "./DropdownButton";
6
6
  function DropdownMenu(props) {
7
7
  var value = props.value,
8
8
  children = props.children,
9
+ multiple = props.multiple,
9
10
  onChange = props.onChange,
10
- valueRender = props.valueRender;
11
+ valueRender = props.valueRender,
12
+ disabled = props.disabled;
11
13
  var selectedKeys = Array.isArray(value) ? value : [value];
12
14
  var valueDisplay = valueRender ? valueRender(value) : value;
15
+ var selectMode = multiple ? 'multiple' : 'single';
16
+
17
+ var handleChange = function handleChange(keys) {
18
+ onChange(multiple ? keys : keys[0]);
19
+ };
20
+
21
+ var menu = /*#__PURE__*/React.createElement(_Menu, {
22
+ selectMode: selectMode,
23
+ selectedKeys: selectedKeys,
24
+ onSelect: handleChange
25
+ }, children);
13
26
  return /*#__PURE__*/React.createElement(DropdownButton, {
14
27
  trigger: valueDisplay,
28
+ disabled: disabled,
15
29
  showContainer: false
16
- }, /*#__PURE__*/React.createElement(_Menu, {
17
- selectMode: "single",
18
- selectedKeys: selectedKeys,
19
- onSelect: onChange
20
- }, children));
30
+ }, multiple ? /*#__PURE__*/React.createElement("div", null, menu) : menu);
21
31
  }
22
32
 
23
33
  DropdownButton.propTypes = {
@@ -0,0 +1,49 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
3
+ var _excluded = ["Component", "styleNames"];
4
+ import React, { useMemo, useState } from 'react';
5
+ import { getTextStyle, setTextStyle } from "./textStyleUtil";
6
+
7
+ function ElementTextStyleSetting(props) {
8
+ var topo = props.topo;
9
+
10
+ var Component = props.Component,
11
+ styleNames = props.styleNames,
12
+ widgetProps = _objectWithoutPropertiesLoose(props, _excluded); // 拓扑图是否加载
13
+
14
+
15
+ var _topo$store$useModelS = topo.store.useModelState('topoMod'),
16
+ graphLoaded = _topo$store$useModelS.graphLoaded; // 选中的元素
17
+
18
+
19
+ var selection = topo.selectionManager.useSelection();
20
+ var htSelection = useMemo(function () {
21
+ if (!selection.length) {
22
+ return [];
23
+ }
24
+
25
+ return topo.getHtTopo().getGraphView().getSelectionModel().getSelection().toArray();
26
+ }, [selection, topo]);
27
+ var value = useMemo(function () {
28
+ if (!graphLoaded) {
29
+ return {};
30
+ }
31
+
32
+ return getTextStyle(htSelection, styleNames, topo) || {};
33
+ }, [graphLoaded, htSelection, topo]);
34
+ var setStyle = useMemo(function () {
35
+ return function (style) {
36
+ htSelection.forEach(function (element) {
37
+ setTextStyle(element, style, topo);
38
+ });
39
+ };
40
+ }, [htSelection]);
41
+ return /*#__PURE__*/React.createElement(Component, _extends({
42
+ disabled: false,
43
+ htSelection: htSelection,
44
+ style: value,
45
+ setStyle: setStyle
46
+ }, widgetProps));
47
+ }
48
+
49
+ export default ElementTextStyleSetting;
@@ -0,0 +1,59 @@
1
+ import Color from 'color';
2
+ /**
3
+ * 解析颜色字符串为对象
4
+ *
5
+ * @param {string} colorStr
6
+ * @returns {null|{hex, rgb:{r,g,b,a}}}
7
+ */
8
+
9
+ export function parseColor(colorStr) {
10
+ if (!colorStr) {
11
+ return null;
12
+ }
13
+
14
+ var color = Color(colorStr);
15
+ var rgb = color.rgb();
16
+ return {
17
+ hex: color.hex(),
18
+ rgb: {
19
+ r: rgb.color[0],
20
+ g: rgb.color[1],
21
+ b: rgb.color[2],
22
+ a: rgb.valpha
23
+ }
24
+ };
25
+ }
26
+ export function parseBackground(colorStr) {
27
+ var background = parseColor(colorStr);
28
+ return {
29
+ background: background,
30
+ // 背景颜色,格式: {rgba: {}, hex: ''} | null
31
+ opacity: background ? background.rgb.a : 1 // 背景透明度。值范围 0-1, null,null表示无
32
+
33
+ };
34
+ }
35
+ export function formatHexColor(color) {
36
+ return color ? color.hex : null;
37
+ }
38
+ /**
39
+ * 格式化背景rgba颜色
40
+ * @param {{background, opacity}} prevColor
41
+ * @param {{background, opacity}} currentColor
42
+ */
43
+
44
+ export function formatBackgroundRgbaColor(prevColor, currentColor) {
45
+ if (!('background' in currentColor) && !('opacity' in currentColor)) {
46
+ return null;
47
+ }
48
+
49
+ var colorObj = Object.assign(prevColor, currentColor);
50
+ var background = colorObj.background,
51
+ opacity = colorObj.opacity;
52
+
53
+ if (!background) {
54
+ return null;
55
+ }
56
+
57
+ var rgb = background.rgb;
58
+ return "rgba(" + rgb.r + ", " + rgb.g + ", " + rgb.b + ", " + (opacity === null ? 1 : opacity) + ")";
59
+ }
@@ -0,0 +1,30 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import fontStyleUtil from "../../../../../../settings/common/text/fontStyleUtil";
3
+ import { formatBackgroundRgbaColor, parseBackground, parseColor } from "../colorUtil";
4
+ export function getTextStyle(element) {
5
+ var underline = element.a('text.decoration') === 'underline';
6
+ return _extends({
7
+ color: parseColor(element.a('topLeftTextColor')),
8
+ underline: underline
9
+ }, fontStyleUtil.toMap(element.a('rectFont')), parseBackground(element.a('topLeftColor')));
10
+ }
11
+ export function setTextStyle(element, style) {
12
+ if ('underline' in style) {}
13
+
14
+ if ('color' in style) {
15
+ element.a('topLeftTextColor', style.color.hex);
16
+ } // 背景颜色
17
+
18
+
19
+ var prevStyle = getTextStyle(element);
20
+ element.a('topLeftColor', formatBackgroundRgbaColor(prevStyle, style));
21
+
22
+ var fontStyle = _extends({}, getTextStyle(element), style);
23
+
24
+ var fontStr = fontStyleUtil.build(fontStyle);
25
+ element.a('rectFont', fontStr);
26
+ }
27
+ export default {
28
+ getTextStyle: getTextStyle,
29
+ setTextStyle: setTextStyle
30
+ };