@riil-frontend/component-topology 6.0.0-alpha.3 → 6.0.0-alpha.30

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 (269) 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 +8 -0
  7. package/es/components/ColorPanel/components/FontColorRange/index.js +35 -0
  8. package/es/components/ColorPanel/components/FontColorRange/index.module.scss +23 -0
  9. package/es/components/ColorPanel/index.js +237 -0
  10. package/es/components/ColorPanel/index.module.scss +34 -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 +23 -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 +6 -2
  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 +20 -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/Sidebar/Sidebar.js +40 -50
  30. package/es/core/editor/components/Sidebar/panes.js +32 -0
  31. package/es/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.js +96 -0
  32. package/es/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.module.scss +74 -0
  33. package/es/core/editor/components/Sidebar/views/CanvasPanel/index.js +1 -1
  34. package/es/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +3 -3
  35. package/es/core/editor/components/Sidebar/views/ImagePanel/HtCustomImagePanel.js +2 -5
  36. package/es/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.js +2 -4
  37. package/es/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.module.scss +5 -0
  38. package/es/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +20 -7
  39. package/es/core/editor/components/Toolbar/EditorToolbar.js +23 -13
  40. package/es/core/editor/components/Toolbar/Toolbar.js +1 -1
  41. package/es/core/editor/components/Toolbar/Toolbar.module.scss +14 -3
  42. package/es/core/editor/components/Toolbar/buttons.js +20 -18
  43. package/es/core/editor/components/Toolbar/hooks/useFontStyleSetting.js +35 -0
  44. package/es/core/editor/components/Toolbar/widgets/AddResourceButton.js +8 -7
  45. package/es/core/editor/components/Toolbar/widgets/CanvasMoveWidget.js +13 -2
  46. package/es/core/editor/components/Toolbar/widgets/CanvasSelectWidget.js +11 -2
  47. package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/Content.js +36 -2
  48. package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +76 -5
  49. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +184 -3
  50. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.module.scss +44 -0
  51. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +53 -0
  52. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.module.scss +31 -0
  53. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/constants.js +77 -0
  54. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +59 -6
  55. package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +36 -4
  56. package/es/core/editor/components/Toolbar/widgets/FontColorButton.module.scss +35 -0
  57. package/es/core/editor/components/Toolbar/widgets/FontFamilyWidget.js +12 -2
  58. package/es/core/editor/components/Toolbar/widgets/FontSizeWidget.js +12 -2
  59. package/es/core/editor/components/Toolbar/widgets/HistoryRedoButton.js +3 -2
  60. package/es/core/editor/components/Toolbar/widgets/HistoryUndoButton.js +5 -4
  61. package/es/core/editor/components/Toolbar/widgets/IconSelect/IconSelect.js +109 -0
  62. package/es/core/editor/components/Toolbar/widgets/IconSelect/constant.js +64 -0
  63. package/es/core/editor/components/Toolbar/widgets/IconSelect/index.js +101 -0
  64. package/es/core/editor/components/Toolbar/widgets/IconSelect/index.module.scss +153 -0
  65. package/es/core/editor/components/Toolbar/widgets/IconSelect/popUpContent.js +49 -0
  66. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutSettings.js +99 -0
  67. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutSettings.module.scss +70 -0
  68. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagImageSelect/index.js +42 -0
  69. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagImageSelect/index.module.scss +7 -0
  70. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagSelect/index.js +75 -0
  71. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagSelect/index.scss +32 -0
  72. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/Icon.js +23 -0
  73. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/index.js +10 -0
  74. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_circular.svg +10 -0
  75. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_hierarchical.svg +10 -0
  76. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_rectangle.svg +12 -0
  77. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_toward.svg +16 -0
  78. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/index.js +31 -0
  79. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/index.module.scss +53 -0
  80. package/es/core/editor/components/Toolbar/widgets/Layout/index.js +128 -15
  81. package/es/core/editor/components/Toolbar/widgets/NodeAlignWidget.js +115 -22
  82. package/es/core/editor/components/Toolbar/widgets/NodeAlignWidget.module.scss +12 -0
  83. package/es/core/editor/components/Toolbar/widgets/NodeImageButton/BoxBackgroundSetting.js +15 -5
  84. package/es/core/editor/components/Toolbar/widgets/NodeImageButton/NodeImageButton.js +41 -7
  85. package/es/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.js +94 -13
  86. package/es/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.module.scss +28 -0
  87. package/es/core/editor/components/Toolbar/widgets/WidgetBox.js +15 -22
  88. package/es/core/editor/components/Toolbar/widgets/WidgetBox.module.scss +11 -1
  89. package/es/core/editor/components/Toolbar/widgets/components/ButtonBox.js +4 -2
  90. package/es/core/editor/components/Toolbar/widgets/components/DropdownButton.js +8 -5
  91. package/es/core/editor/components/settings/CloseablePanel.js +28 -0
  92. package/es/core/editor/components/settings/OpenPropertyPanelListener.js +33 -0
  93. package/es/core/editor/components/settings/PropertyView.js +27 -8
  94. package/es/core/editor/components/settings/Settings.js +4 -44
  95. package/es/core/editor/components/settings/Settings.module.scss +8 -4
  96. package/es/core/editor/components/settings/common/AlignSetting/AlignTypeList.js +76 -0
  97. package/es/core/editor/components/settings/common/AlignSetting/index.js +20 -71
  98. package/es/core/editor/components/settings/common/LineType/index.js +12 -119
  99. package/es/core/editor/components/settings/common/NodeSizeInput/NodeSizeInput.js +3 -3
  100. package/es/core/editor/components/settings/common/SizeInput/NodeSizeInput.js +31 -21
  101. package/es/core/editor/components/settings/common/SizeInput/NodeSizeNumberPicker.js +7 -6
  102. package/es/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js +0 -8
  103. package/es/core/editor/components/settings/propertyViews/multipleElements/BatchSetNodeSize/BatchSetNodeSize.js +8 -9
  104. package/es/core/editor/components/settings/propertyViews/multipleElements/MultipleElementLineType.js +5 -42
  105. package/es/core/editor/components/settings/propertyViews/multipleElements/MultipleElementPropertyView.js +2 -15
  106. package/es/core/editor/components/settings/propertyViews/view/BatchSetNodeSize.js +9 -6
  107. package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +8 -4
  108. package/es/core/editor/hooks/useKeyboardShortcut.js +42 -0
  109. package/es/core/{store/models → editor/store}/background.js +0 -0
  110. package/es/core/{store/models → editor/store}/historyManager.js +0 -0
  111. package/es/core/editor/store/topoEdit.js +49 -0
  112. package/es/core/editor/utils/edgeTypeStyleUtil.js +96 -0
  113. package/es/core/hooks/useCanvasTheme.js +35 -0
  114. package/es/core/hooks/useTopoEdit.js +38 -58
  115. package/es/core/models/Alarm.js +2 -2
  116. package/es/core/models/HistoryManager.js +10 -3
  117. package/es/core/models/SelectionManager.js +16 -1
  118. package/es/core/models/TopoApp.js +1 -1
  119. package/es/core/models/TopoGraphView.js +8 -2
  120. package/es/core/models/utils/linkUtils.js +1 -1
  121. package/es/core/store/coreModels.js +6 -7
  122. package/es/core/store/models/selection.js +2 -1
  123. package/es/core/store/models/topoBizMod.js +0 -3
  124. package/es/core/store/models/topoMod.js +26 -28
  125. package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/WebConsoleForm.js +13 -29
  126. package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +6 -5
  127. package/es/core/viewer/components/titlebar/widgets/SettingButton.js +3 -1
  128. package/es/core/viewer/components/titlebar/widgets/SettingButtonWidget.js +4 -2
  129. package/es/networkTopo/createTopo.js +2 -0
  130. package/es/networkTopo/services/link.js +2 -2
  131. package/es/networkTopo/store/topoTreeMod.js +6 -7
  132. package/es/style.js +1 -0
  133. package/es/utils/topoData.js +1 -0
  134. package/lib/components/ColorPanel/components/ColorBlock/index.js +47 -0
  135. package/lib/components/ColorPanel/components/ColorBlock/index.module.scss +8 -0
  136. package/lib/components/ColorPanel/components/FontColorRange/index.js +49 -0
  137. package/lib/components/ColorPanel/components/FontColorRange/index.module.scss +23 -0
  138. package/lib/components/ColorPanel/index.js +255 -0
  139. package/lib/components/ColorPanel/index.module.scss +34 -0
  140. package/lib/components/VerticalIconTab/VerticalIconTab.module.scss +5 -1
  141. package/lib/components/collapse/Collapse.js +28 -3
  142. package/lib/components/collapse/Collapse.module.scss +23 -0
  143. package/lib/components/collapse/index.js +11 -0
  144. package/lib/core/common/hooks/useHtElements.js +27 -0
  145. package/lib/core/common/icons/icon.js +48 -0
  146. package/lib/core/common/icons/useIcons.js +10 -15
  147. package/lib/core/components/AlarmListPanel/components/AlarmListItem.js +14 -13
  148. package/lib/core/components/AlarmListPanel/components/index.module.scss +5 -5
  149. package/lib/core/components/DisplaySettingDrawer/DisplaySetting.js +2 -1
  150. package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +7 -2
  151. package/lib/core/components/DisplaySettingDrawer/EditorDisplaySetting.js +147 -0
  152. package/lib/core/components/DisplaySettingDrawer/LineExpandAllRadioGroup.js +0 -3
  153. package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +76 -19
  154. package/lib/core/components/TopoView/GraphViewPanel.js +30 -0
  155. package/lib/core/components/TopoView/editor.module.scss +1 -0
  156. package/lib/core/components/TopoView/topoView.js +32 -50
  157. package/lib/core/components/titlebar/TitleBar.module.scss +1 -1
  158. package/lib/core/editor/components/Sidebar/Sidebar.js +39 -53
  159. package/lib/core/editor/components/Sidebar/panes.js +45 -0
  160. package/lib/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.js +109 -0
  161. package/lib/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.module.scss +74 -0
  162. package/lib/core/editor/components/Sidebar/views/CanvasPanel/index.js +2 -2
  163. package/lib/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +1 -1
  164. package/lib/core/editor/components/Sidebar/views/ImagePanel/HtCustomImagePanel.js +2 -5
  165. package/lib/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.js +3 -4
  166. package/lib/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.module.scss +5 -0
  167. package/lib/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +29 -11
  168. package/lib/core/editor/components/Toolbar/EditorToolbar.js +22 -11
  169. package/lib/core/editor/components/Toolbar/Toolbar.js +1 -1
  170. package/lib/core/editor/components/Toolbar/Toolbar.module.scss +14 -3
  171. package/lib/core/editor/components/Toolbar/buttons.js +21 -20
  172. package/lib/core/editor/components/Toolbar/hooks/useFontStyleSetting.js +50 -0
  173. package/lib/core/editor/components/Toolbar/widgets/AddResourceButton.js +8 -7
  174. package/lib/core/editor/components/Toolbar/widgets/CanvasMoveWidget.js +13 -2
  175. package/lib/core/editor/components/Toolbar/widgets/CanvasSelectWidget.js +11 -2
  176. package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/Content.js +38 -2
  177. package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeColorButton.js +77 -5
  178. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +194 -3
  179. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.module.scss +44 -0
  180. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +71 -0
  181. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.module.scss +31 -0
  182. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/constants.js +83 -0
  183. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +61 -5
  184. package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +39 -4
  185. package/lib/core/editor/components/Toolbar/widgets/FontColorButton.module.scss +35 -0
  186. package/lib/core/editor/components/Toolbar/widgets/FontFamilyWidget.js +13 -2
  187. package/lib/core/editor/components/Toolbar/widgets/FontSizeWidget.js +13 -2
  188. package/lib/core/editor/components/Toolbar/widgets/HistoryRedoButton.js +4 -2
  189. package/lib/core/editor/components/Toolbar/widgets/HistoryUndoButton.js +5 -3
  190. package/lib/core/editor/components/Toolbar/widgets/IconSelect/IconSelect.js +126 -0
  191. package/lib/core/editor/components/Toolbar/widgets/IconSelect/constant.js +69 -0
  192. package/lib/core/editor/components/Toolbar/widgets/IconSelect/index.js +117 -0
  193. package/lib/core/editor/components/Toolbar/widgets/IconSelect/index.module.scss +153 -0
  194. package/lib/core/editor/components/Toolbar/widgets/IconSelect/popUpContent.js +61 -0
  195. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutSettings.js +116 -0
  196. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutSettings.module.scss +70 -0
  197. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagImageSelect/index.js +55 -0
  198. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagImageSelect/index.module.scss +7 -0
  199. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagSelect/index.js +93 -0
  200. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagSelect/index.scss +32 -0
  201. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/Icon.js +32 -0
  202. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/index.js +22 -0
  203. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_circular.svg +10 -0
  204. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_hierarchical.svg +10 -0
  205. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_rectangle.svg +12 -0
  206. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_toward.svg +16 -0
  207. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/index.js +44 -0
  208. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/index.module.scss +53 -0
  209. package/lib/core/editor/components/Toolbar/widgets/Layout/index.js +133 -16
  210. package/lib/core/editor/components/Toolbar/widgets/NodeAlignWidget.js +118 -22
  211. package/lib/core/editor/components/Toolbar/widgets/NodeAlignWidget.module.scss +12 -0
  212. package/lib/core/editor/components/Toolbar/widgets/NodeImageButton/BoxBackgroundSetting.js +21 -5
  213. package/lib/core/editor/components/Toolbar/widgets/NodeImageButton/NodeImageButton.js +41 -6
  214. package/lib/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.js +96 -12
  215. package/lib/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.module.scss +28 -0
  216. package/lib/core/editor/components/Toolbar/widgets/WidgetBox.js +16 -22
  217. package/lib/core/editor/components/Toolbar/widgets/WidgetBox.module.scss +11 -1
  218. package/lib/core/editor/components/Toolbar/widgets/components/ButtonBox.js +4 -2
  219. package/lib/core/editor/components/Toolbar/widgets/components/DropdownButton.js +8 -5
  220. package/lib/core/editor/components/settings/CloseablePanel.js +40 -0
  221. package/lib/core/editor/components/settings/OpenPropertyPanelListener.js +43 -0
  222. package/lib/core/editor/components/settings/PropertyView.js +30 -8
  223. package/lib/core/editor/components/settings/Settings.js +4 -44
  224. package/lib/core/editor/components/settings/Settings.module.scss +8 -4
  225. package/lib/core/editor/components/settings/common/AlignSetting/AlignTypeList.js +93 -0
  226. package/lib/core/editor/components/settings/common/AlignSetting/index.js +21 -79
  227. package/lib/core/editor/components/settings/common/LineType/index.js +13 -126
  228. package/lib/core/editor/components/settings/common/NodeSizeInput/NodeSizeInput.js +2 -2
  229. package/lib/core/editor/components/settings/common/SizeInput/NodeSizeInput.js +32 -23
  230. package/lib/core/editor/components/settings/common/SizeInput/NodeSizeNumberPicker.js +6 -6
  231. package/lib/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js +0 -8
  232. package/lib/core/editor/components/settings/propertyViews/multipleElements/BatchSetNodeSize/BatchSetNodeSize.js +6 -8
  233. package/lib/core/editor/components/settings/propertyViews/multipleElements/MultipleElementLineType.js +5 -42
  234. package/lib/core/editor/components/settings/propertyViews/multipleElements/MultipleElementPropertyView.js +2 -15
  235. package/lib/core/editor/components/settings/propertyViews/view/BatchSetNodeSize.js +7 -5
  236. package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +9 -1
  237. package/lib/core/editor/hooks/useKeyboardShortcut.js +52 -0
  238. package/lib/core/{store/models → editor/store}/background.js +0 -0
  239. package/lib/core/{store/models → editor/store}/historyManager.js +0 -0
  240. package/lib/core/editor/store/topoEdit.js +59 -0
  241. package/lib/core/editor/utils/edgeTypeStyleUtil.js +109 -0
  242. package/lib/core/hooks/useCanvasTheme.js +49 -0
  243. package/lib/core/hooks/useTopoEdit.js +39 -60
  244. package/lib/core/models/Alarm.js +2 -2
  245. package/lib/core/models/HistoryManager.js +10 -3
  246. package/lib/core/models/SelectionManager.js +17 -1
  247. package/lib/core/models/TopoApp.js +1 -1
  248. package/lib/core/models/TopoGraphView.js +8 -2
  249. package/lib/core/models/utils/linkUtils.js +1 -1
  250. package/lib/core/store/coreModels.js +5 -7
  251. package/lib/core/store/models/selection.js +2 -1
  252. package/lib/core/store/models/topoBizMod.js +0 -3
  253. package/lib/core/store/models/topoMod.js +27 -29
  254. package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/WebConsoleForm.js +13 -29
  255. package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +6 -5
  256. package/lib/core/viewer/components/titlebar/widgets/SettingButton.js +3 -1
  257. package/lib/core/viewer/components/titlebar/widgets/SettingButtonWidget.js +4 -2
  258. package/lib/networkTopo/createTopo.js +3 -0
  259. package/lib/networkTopo/services/link.js +2 -2
  260. package/lib/networkTopo/store/topoTreeMod.js +6 -8
  261. package/lib/style.js +1 -0
  262. package/lib/utils/topoData.js +1 -0
  263. package/package.json +4 -4
  264. package/es/core/editor/components/Sidebar/views/CanvasPanel/ImagePanel.js +0 -4
  265. package/es/core/store/models/topoEdit.js +0 -39
  266. package/es/core/store/models/topoView.js +0 -36
  267. package/lib/core/editor/components/Sidebar/views/CanvasPanel/ImagePanel.js +0 -12
  268. package/lib/core/store/models/topoEdit.js +0 -51
  269. package/lib/core/store/models/topoView.js +0 -47
@@ -1,28 +1,141 @@
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/htElementUtils";
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.selectionManager.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) {
28
+ return data != 'rectangle';
29
+ } else {
30
+ return data == 'rectangle';
31
+ }
32
+ };
33
+
34
+ var globalLayout = function globalLayout(data) {
35
+ var firstElement = selectionElements[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 (isLayer(firstElement)) {
49
+ topo.getHtTopo().layoutLayer(firstElement);
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 selectionElements = topo.selectionManager.useHtSelection();
91
+ var topoShowType = topoState.type; // 获取ID以及拓扑类型 // 拓扑类型:auto自由布局,layers分层,partition分区
92
+
93
+ var disabled = useMemo(function () {
94
+ return !isLayoutEnabled({
95
+ topoShowType: topoShowType,
96
+ selectionElements: selectionElements
97
+ });
98
+ }, [topoShowType, selectionElements]);
99
+ var icon = disabled ? /*#__PURE__*/React.createElement("img", {
100
+ src: "/img/topo/editor/toolbar/layout/Disable.svg",
101
+ alt: ""
102
+ }) : /*#__PURE__*/React.createElement("img", {
103
+ src: "/img/topo/editor/toolbar/layout/Normal.svg",
104
+ alt: ""
105
+ });
22
106
  return /*#__PURE__*/React.createElement(WidgetBox, {
23
- label: "\u5E03\u5C40",
24
- showLabel: showLabel
25
- }, /*#__PURE__*/React.createElement(WidgetBox.ButtonBox, null, /*#__PURE__*/React.createElement(Layout, otherProps)));
107
+ label: "\u5E03\u5C40\u65B9\u5F0F",
108
+ tooltip: "\u5E03\u5C40\u65B9\u5F0F",
109
+ showLabel: showLabel,
110
+ disabled: disabled
111
+ }, /*#__PURE__*/React.createElement(DropdownButton, {
112
+ disabled: disabled,
113
+ trigger: icon
114
+ }, !disabled && /*#__PURE__*/React.createElement(Layout, _extends({
115
+ topo: topo,
116
+ topoShowType: topoShowType
117
+ }, otherProps))));
118
+ }
119
+
120
+ function isLayoutEnabled(props) {
121
+ var topoShowType = props.topoShowType,
122
+ selectionElements = props.selectionElements; // 选中单个区域/集群后,该按钮亮起
123
+
124
+ if (isGroup(selectionElements[0])) {
125
+ return true;
126
+ } // 分层拓扑选中任意分层时,布局按钮亮起
127
+
128
+
129
+ if (topoShowType === 'layers' && selectionElements.length === 1 && isLayer(selectionElements[0])) {
130
+ return true;
131
+ } // 空白拓扑未选中任何资源时,布局按钮亮起
132
+
133
+
134
+ if (topoShowType !== 'layers' && !selectionElements.length) {
135
+ return true;
136
+ }
137
+
138
+ return false;
26
139
  }
27
140
 
28
141
  export default LayoutWidget;
@@ -1,24 +1,12 @@
1
- import _extends from "@babel/runtime/helpers/extends";
1
+ import _Input from "@alifd/next/es/input";
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,126 @@ 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
+ leftDisable = _useState4[0],
30
+ setLeftDisable = _useState4[1];
31
+
32
+ var _useState5 = useState(true),
33
+ rightDisable = _useState5[0],
34
+ setRightDisable = _useState5[1]; // 拓扑图是否加载
35
+
36
+
37
+ var _topo$store$useModelS = topo.store.useModelState('topoMod'),
38
+ graphLoaded = _topo$store$useModelS.graphLoaded; // 选中的元素
31
39
 
32
40
 
33
41
  var selection = topo.selectionManager.useSelection();
42
+
43
+ var setSpace = function setSpace(type, num) {
44
+ topo.historyManager.beginTransaction();
45
+ var selection = topo.getHtTopo().getGraphView().getSelectionModel().getSelection().toArray();
46
+ var nodes = selection.filter(function (ele) {
47
+ return !isLayer(ele) && !isEdge(ele);
48
+ });
49
+ topo.view.topoClient.htTopoClient.setElementsSpace(nodes, type, num);
50
+ topo.historyManager.endTransaction();
51
+ };
52
+
53
+ var leftInputChange = function leftInputChange(v) {
54
+ if (v * 1 < 0) {
55
+ setLeftInputVal(0);
56
+ } else if (v * 1 > 10000) {
57
+ setLeftInputVal(10000);
58
+ } else {
59
+ setLeftInputVal(v);
60
+ }
61
+
62
+ setSpace('v', leftInputVal);
63
+ };
64
+
65
+ var rightInputChange = function rightInputChange(v) {
66
+ if (v * 1 < 0) {
67
+ setRightInputVal(0);
68
+ } else if (v * 1 > 10000) {
69
+ setRightInputVal(10000);
70
+ } else {
71
+ setRightInputVal(v);
72
+ }
73
+
74
+ setSpace('h', rightInputVal);
75
+ };
76
+
34
77
  useEffect(function () {
35
- setDisabled(false);
36
- }, [selection]);
78
+ if (graphLoaded) {
79
+ var selectionEle = topo.getHtTopo().getGraphView().getSelectionModel().getSelection().toArray();
80
+ var nodes = selectionEle.filter(function (ele) {
81
+ return !isLayer(ele) && !isEdge(ele);
82
+ });
83
+ setDisabled(nodes.length <= 1);
84
+ getClickType('none');
85
+ }
86
+ }, [graphLoaded, selection]);
87
+
88
+ var getClickType = function getClickType(type) {
89
+ setLeftDisable(true);
90
+ setRightDisable(true);
91
+
92
+ if (type === 'top' || type === 'middle' || type === 'bottom') {
93
+ setLeftDisable(false);
94
+ }
95
+
96
+ if (type === 'left' || type === 'center' || type === 'right') {
97
+ setRightDisable(false);
98
+ }
99
+ };
100
+
101
+ var icon = disabled ? /*#__PURE__*/React.createElement("img", {
102
+ src: "/img/topo/editor/toolbar/\u5BF9\u9F50/Disable.svg",
103
+ alt: ""
104
+ }) : /*#__PURE__*/React.createElement("img", {
105
+ src: "/img/topo/editor/toolbar/\u5BF9\u9F50/Normal.svg",
106
+ alt: ""
107
+ });
37
108
  return /*#__PURE__*/React.createElement(WidgetBox, {
38
109
  showLabel: showLabel,
110
+ disabled: disabled,
39
111
  label: "\u5BF9\u9F50\u65B9\u5F0F",
40
112
  tooltip: "\u5BF9\u9F50\u65B9\u5F0F"
41
- }, /*#__PURE__*/React.createElement(NodeAlignPopup, _extends({
113
+ }, /*#__PURE__*/React.createElement(DropdownButton, {
42
114
  disabled: disabled,
43
- selection: selection
44
- }, otherProps)));
115
+ trigger: icon
116
+ }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(AlignSetting, {
117
+ topo: topo,
118
+ getClickType: getClickType
119
+ }), /*#__PURE__*/React.createElement(_Input, {
120
+ disabled: leftDisable,
121
+ size: "small",
122
+ placeholder: "\u591A\u4E2A\u503C",
123
+ className: styles.leftInput,
124
+ value: leftInputVal,
125
+ htmlType: "number",
126
+ maxLength: 5,
127
+ onChange: leftInputChange
128
+ }), /*#__PURE__*/React.createElement(_Input, {
129
+ disabled: rightDisable,
130
+ size: "small",
131
+ placeholder: "\u591A\u4E2A\u503C",
132
+ className: styles.rightInput,
133
+ value: rightInputVal,
134
+ htmlType: "number",
135
+ maxLength: 5,
136
+ onChange: rightInputChange
137
+ }))));
45
138
  }
46
139
 
47
140
  export default NodeAlignWidget;
@@ -0,0 +1,12 @@
1
+ .leftInput{
2
+ background: url('/img/topo/editor/toolbar/对齐/Disable.svg')no-repeat 5px center;
3
+ background-position: right center;
4
+ width: 100px;
5
+ margin-right: 10px;
6
+ margin-left: 5px;
7
+ }
8
+ .rightInput{
9
+ width: 100px;
10
+ background: url('/img/topo/editor/toolbar/对齐/Disable.svg')no-repeat 5px center;
11
+ background-position: right center;
12
+ }
@@ -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,18 @@
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
9
  import BoxBackgroundSetting from "./BoxBackgroundSetting";
10
+ import styles from "./NodeSizeButton.module.scss";
11
+ import { isGroup, isNode } from "../../../../../../utils/htElementUtils";
7
12
  /**
8
13
  * 图片尺寸设置
9
- * @param {*} props
10
- * @returns
14
+ * @param {*} props
15
+ * @returns
11
16
  */
12
17
 
13
18
  function NodeSizeButton(props) {
@@ -17,25 +22,101 @@ function NodeSizeButton(props) {
17
22
 
18
23
  var _useState = useState(true),
19
24
  disabled = _useState[0],
20
- setDisabled = _useState[1]; // 选中的元素
25
+ setDisabled = _useState[1];
26
+
27
+ var _useState2 = useState(),
28
+ size = _useState2[0],
29
+ setSize = _useState2[1]; // 选中的元素
21
30
 
22
31
 
23
- var selection = topo.selectionManager.useSelection();
32
+ var selection = topo.selectionManager.useHtSelection();
33
+ var settingRuntimeState = useSettingRuntimeState();
24
34
  useEffect(function () {
25
- setDisabled(false);
35
+ var nodes = selection.filter(function (ele) {
36
+ return isGroup(ele) || isNode(ele);
37
+ });
38
+
39
+ if (nodes.length > 0) {
40
+ setDisabled(false);
41
+
42
+ if (selection.length === 1) {
43
+ setSize({
44
+ width: selection[0].width,
45
+ height: selection[0].height
46
+ });
47
+ }
48
+ } else {
49
+ setDisabled(true);
50
+ setSize({
51
+ width: null,
52
+ height: null
53
+ });
54
+ }
26
55
  }, [selection]);
56
+
57
+ var _onChange = function onChange(prop) {
58
+ var name = prop.name,
59
+ value = prop.value;
60
+ var gv = topo.view.topoClient.getGraphView();
61
+ var element = topo.getSelectionModel().getFirstData();
62
+
63
+ if (name === "width") {
64
+ element.setWidth(value);
65
+ } else if (name === "height") {
66
+ element.setHeight(value);
67
+ }
68
+ };
69
+
27
70
  return /*#__PURE__*/React.createElement(WidgetBox, {
28
71
  label: "\u56FE\u7247\u5C3A\u5BF8",
72
+ disabled: disabled,
29
73
  tooltip: "\u56FE\u7247\u5C3A\u5BF8",
30
74
  showLabel: showLabel
31
75
  }, /*#__PURE__*/React.createElement("div", {
32
- style: {
33
- width: 136
76
+ className: styles.toolbarNodeSizeSetting
77
+ }, selection.length > 1 ? /*#__PURE__*/React.createElement(BatchSetNodeSize, {
78
+ topo: topo // size="small"
79
+ ,
80
+ value: size,
81
+ disabled: disabled,
82
+ showLabel: false,
83
+ numberPickerProps: {
84
+ hasTrigger: false,
85
+ placeholder: '-'
86
+ } // onChange={(size) => {
87
+ // topo.historyManager.beginTransaction();
88
+ // onChange({ name: "width", value: size.width });
89
+ // onChange({ name: "height", value: size.height });
90
+ // topo.historyManager.endTransaction();
91
+ // }}
92
+
93
+ }) : /*#__PURE__*/React.createElement(NodeSizeInput, {
94
+ topo: topo // size="small"
95
+ ,
96
+ value: size,
97
+ disabled: disabled,
98
+ showLabel: false,
99
+ hasTrigger: false,
100
+ numberPickerProps: {
101
+ hasTrigger: false,
102
+ placeholder: '-'
103
+ },
104
+ settingRuntimeState: settingRuntimeState,
105
+ onChange: function onChange(size) {
106
+ topo.historyManager.beginTransaction();
107
+
108
+ _onChange({
109
+ name: "width",
110
+ value: size.width
111
+ });
112
+
113
+ _onChange({
114
+ name: "height",
115
+ value: size.height
116
+ });
117
+
118
+ topo.historyManager.endTransaction();
34
119
  }
35
- }, /*#__PURE__*/React.createElement(BatchSetNodeSize, {
36
- topo: topo,
37
- size: "small",
38
- showLabel: false
39
120
  })));
40
121
  }
41
122
 
@@ -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;