@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,6 +1,7 @@
1
1
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
2
2
  var _excluded = ["topo", "showLabel"];
3
3
  import React, { useEffect, useState } from 'react';
4
+ import { getEdgesBySelection, setEdgesAndChildren, loopEdgesAndChildren } from "../../../../utils/edgeTypeStyleUtil";
4
5
  import DropdownButton from "../components/DropdownButton";
5
6
  import WidgetBox from "../WidgetBox";
6
7
  import Content from "./Content";
@@ -17,13 +18,78 @@ function EdgeColorButton(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
+ lineWidth = _useState2[0],
25
+ setLineWidth = _useState2[1]; // 拓扑图是否加载
26
+
27
+
28
+ var _topo$store$useModelS = topo.store.useModelState('topoMod'),
29
+ graphLoaded = _topo$store$useModelS.graphLoaded; // 选中的元素
30
+
31
+
32
+ var selection = topo.selectionManager.useHtSelection();
33
+
34
+ var getLines = function getLines(list) {
35
+ // eslint-disable-next-line prefer-const
36
+ var arr = [];
37
+ loopEdgesAndChildren(topo, list, function (edge) {
38
+ // eslint-disable-next-line eqeqeq
39
+ if (edge.getAttrObject().type == 'line') {
40
+ arr.push(edge);
41
+ }
42
+ });
43
+ return arr;
44
+ };
22
45
 
23
- var selection = topo.selectionManager.useSelection();
24
46
  useEffect(function () {
25
- setDisabled(false);
26
- }, [selection]);
47
+ if (graphLoaded) {
48
+ var edges = getEdgesBySelection(topo);
49
+ var list = getLines(edges);
50
+ setLineWidth(0); // eslint-disable-next-line eqeqeq
51
+
52
+ if (selection.length == 1 && selection[0].getAttrObject().type == 'line') {
53
+ setLineWidth(list[0] && (list[0].a('styles') && list[0].a('styles').width || list[0].getStyleMap()['edge.width']) || 2);
54
+ }
55
+
56
+ setDisabled(!list.length);
57
+ }
58
+ }, [selection, graphLoaded]);
59
+
60
+ var colorOnChange = function colorOnChange(color, type) {
61
+ // eslint-disable-next-line eqeqeq
62
+ if (type == 'select') topo.historyManager.beginTransaction();
63
+ var edges = getEdgesBySelection(topo);
64
+ loopEdgesAndChildren(topo, edges, function (edge) {
65
+ // eslint-disable-next-line eqeqeq
66
+ if (edge.getAttrObject().type == 'line') {
67
+ edge.s('edge.color', color.hex);
68
+ }
69
+ }); // eslint-disable-next-line eqeqeq
70
+
71
+ if (type == 'select') topo.historyManager.endTransaction();
72
+ };
73
+
74
+ var onPickerFocus = function onPickerFocus() {
75
+ // topo.getHtTopo().getGraphView().dm().sm().ld()
76
+ topo.historyManager.beginTransaction();
77
+ };
78
+
79
+ var onPickerBlur = function onPickerBlur() {
80
+ topo.historyManager.endTransaction();
81
+ };
82
+
83
+ var lineSizeChange = function lineSizeChange(value) {
84
+ var edges = getEdgesBySelection(topo);
85
+ setEdgesAndChildren(topo, edges, function (edge) {
86
+ // eslint-disable-next-line eqeqeq
87
+ if (edge.getAttrObject().type == 'line') {
88
+ edge.s('edge.width', value); // 设置
89
+ }
90
+ });
91
+ };
92
+
27
93
  var icon = disabled ? /*#__PURE__*/React.createElement("img", {
28
94
  src: "/img/topo/editor/toolbar/\u7EBF\u6761\u586B\u5145/Disable.svg",
29
95
  alt: ""
@@ -39,7 +105,12 @@ function EdgeColorButton(props) {
39
105
  disabled: disabled,
40
106
  trigger: icon
41
107
  }, /*#__PURE__*/React.createElement(Content, {
42
- topo: topo
108
+ topo: topo,
109
+ onChange: colorOnChange,
110
+ onPickerFocus: onPickerFocus,
111
+ onPickerBlur: onPickerBlur,
112
+ lineSizeChange: lineSizeChange,
113
+ lineWidth: lineWidth
43
114
  })));
44
115
  }
45
116
 
@@ -1,8 +1,189 @@
1
- import React from 'react';
1
+ import _Field from "@alifd/next/es/field";
2
+ import _Select from "@alifd/next/es/select";
3
+ import _Form from "@alifd/next/es/form";
4
+ import React, { useEffect } from 'react';
5
+ import styles from "./EdgeType.module.scss";
6
+ import LineType from "./LineType";
7
+ var FormItem = _Form.Item;
8
+ var Option = _Select.Option;
9
+ var START_TYPE_OPTIONS = [{
10
+ value: 'nil',
11
+ label: '无',
12
+ icon: 'topo_startEndPoint_icon_nothing'
13
+ }, // {
14
+ // value: 'sourceNoneCircle',
15
+ // label: '空心圆',
16
+ // icon: 'topo_startPoint_icon_hollow_cricle',
17
+ // },
18
+ {
19
+ value: 'sourceSolidCircle',
20
+ label: '实心圆',
21
+ icon: 'topo_startPoint_icon_solid_cricle'
22
+ }, {
23
+ value: 'sourceArrow',
24
+ label: '箭头',
25
+ icon: 'topo_startPoint_icon_arrow'
26
+ }];
27
+ var END_TYPE_OPTIONS = [{
28
+ value: 'nil',
29
+ label: '无',
30
+ icon: 'topo_startEndPoint_icon_nothing'
31
+ }, // {
32
+ // value: 'targetNoneCircle',
33
+ // label: '空心圆',
34
+ // icon: 'topo_endPoint_icon_hollow_cricle',
35
+ // },
36
+ {
37
+ value: 'targetSolidCircle',
38
+ label: '实心圆',
39
+ icon: 'topo_endPoint_icon_solid_cricle'
40
+ }, {
41
+ value: 'targetArrow',
42
+ label: '箭头',
43
+ icon: 'topo_endPoint_icon_arrow'
44
+ }];
45
+ var LINE_MOLD_OPTIONS = [{
46
+ value: 'solidLine',
47
+ label: '实线',
48
+ icon: 'topo_lineMold_solid'
49
+ }, {
50
+ value: 'dottedLine',
51
+ label: '虚线',
52
+ icon: 'topo_lineMold_dotted'
53
+ }, {
54
+ value: 'dottedLine1',
55
+ label: '虚线1',
56
+ icon: 'topo_lineMold_dotted_one'
57
+ }, {
58
+ value: 'dottedLine2',
59
+ label: '虚线2',
60
+ icon: 'topo_lineMold_dotted_two'
61
+ }];
62
+
63
+ function getValuesBySelection(selection) {
64
+ var values = {
65
+ startPoint: undefined,
66
+ endPoint: undefined,
67
+ lineMold: undefined
68
+ }; // 仅一条连线选中时回显
69
+
70
+ if (selection.length === 1) {
71
+ var edge = selection[0];
72
+ values = {
73
+ startPoint: 'nil',
74
+ endPoint: 'nil',
75
+ lineMold: edge.a('lineMode') || 'solidLine'
76
+ };
77
+ var icons = edge.s('icons') || {};
78
+ ['sourceArrow', 'sourceSolidCircle', 'sourceNoneCircle'].forEach(function (name) {
79
+ if (icons[name]) {
80
+ values.startPoint = name;
81
+ }
82
+ });
83
+ ['targetArrow', 'targetSolidCircle', 'targetNoneCircle'].forEach(function (name) {
84
+ if (icons[name]) {
85
+ values.endPoint = name;
86
+ }
87
+ });
88
+ }
89
+
90
+ return values;
91
+ }
2
92
 
3
93
  function EdgeType(props) {
4
- // const { } = props
5
- return /*#__PURE__*/React.createElement("div", null, "\u7EBF\u5F62\u8BBE\u7F6E");
94
+ var selection = props.selection,
95
+ _onChange = props.onChange;
96
+
97
+ var field = _Field.useField({
98
+ autoUnmount: false,
99
+ values: getValuesBySelection(selection),
100
+ onChange: function onChange(name, value) {
101
+ if (['startPoint', 'endPoint'].includes(name) && value === 'nil') {
102
+ _onChange(name, null);
103
+ } else {
104
+ _onChange(name, value);
105
+ }
106
+ }
107
+ });
108
+
109
+ useEffect(function () {
110
+ field.setValues(getValuesBySelection(selection));
111
+ }, [selection]);
112
+ return /*#__PURE__*/React.createElement("div", {
113
+ className: styles.lineBox
114
+ }, /*#__PURE__*/React.createElement(_Form, {
115
+ field: field,
116
+ inline: true,
117
+ labelAlign: "top"
118
+ }, /*#__PURE__*/React.createElement(FormItem, null, /*#__PURE__*/React.createElement(LineType, {
119
+ name: "lineButton"
120
+ })), /*#__PURE__*/React.createElement(FormItem, {
121
+ label: "\u8D77\u70B9"
122
+ }, /*#__PURE__*/React.createElement(_Select, {
123
+ name: "startPoint",
124
+ placeholder: " ",
125
+ popupProps: {
126
+ container: function container(trigger) {
127
+ return trigger.parentNode;
128
+ }
129
+ }
130
+ }, START_TYPE_OPTIONS.map(function (item, index) {
131
+ return /*#__PURE__*/React.createElement(Option, {
132
+ value: item.value,
133
+ key: index,
134
+ title: item.label,
135
+ onchange: _onChange
136
+ }, /*#__PURE__*/React.createElement("img", {
137
+ src: "/img/topo/editor/lineType/" + item.icon + ".svg",
138
+ alt: "",
139
+ className: styles.iconImg
140
+ }));
141
+ }))), /*#__PURE__*/React.createElement(FormItem, {
142
+ label: "\u7EC8\u70B9"
143
+ }, /*#__PURE__*/React.createElement(_Select, {
144
+ name: "endPoint",
145
+ placeholder: " ",
146
+ popupProps: {
147
+ container: function container(trigger) {
148
+ return trigger.parentNode;
149
+ }
150
+ }
151
+ }, END_TYPE_OPTIONS.map(function (item, index) {
152
+ return /*#__PURE__*/React.createElement(Option, {
153
+ value: item.value,
154
+ key: index,
155
+ title: item.label,
156
+ onchange: _onChange
157
+ }, /*#__PURE__*/React.createElement("img", {
158
+ src: "/img/topo/editor/lineType/" + item.icon + ".svg",
159
+ alt: "",
160
+ className: styles.iconImg
161
+ }));
162
+ }))), /*#__PURE__*/React.createElement(FormItem, {
163
+ label: "\u7C7B\u578B"
164
+ }, /*#__PURE__*/React.createElement(_Select, {
165
+ name: "lineMold",
166
+ popupProps: {
167
+ container: function container(trigger) {
168
+ return trigger.parentNode;
169
+ }
170
+ },
171
+ placeholder: " "
172
+ }, LINE_MOLD_OPTIONS.map(function (item, index) {
173
+ return /*#__PURE__*/React.createElement(Option, {
174
+ value: item.value,
175
+ key: index // title={item.label}
176
+ ,
177
+ onchange: _onChange
178
+ }, /*#__PURE__*/React.createElement("img", {
179
+ src: "/img/topo/editor/lineType/" + item.icon + ".svg",
180
+ alt: "",
181
+ className: styles.iconImg
182
+ }));
183
+ })))));
6
184
  }
7
185
 
186
+ EdgeType.defaultProps = {
187
+ onChange: function onChange(v) {}
188
+ };
8
189
  export default EdgeType;
@@ -0,0 +1,44 @@
1
+ @import '~@alifd/next/variables.scss';
2
+
3
+ .lineBox{
4
+ width: 236px;
5
+ background: #FFFFFF;
6
+ border-radius: 4px;
7
+ margin-bottom: -7px;
8
+
9
+ :global {
10
+ .#{$css-prefix}form-item:first-child{
11
+ margin-top: 0;
12
+ margin-bottom: 0;
13
+ }
14
+ .#{$css-prefix}form-item {
15
+ margin-top: 7px;
16
+ margin-bottom: 7px;
17
+ }
18
+ .#{$css-prefix}form.#{$css-prefix}inline .#{$css-prefix}form-item:not(:last-child) {
19
+ margin-right: 8px;
20
+ .#{$css-prefix}select-trigger {
21
+ min-width: 0;
22
+ width: 64px;
23
+ height: 28px;
24
+ .#{$css-prefix}select-inner {
25
+ min-width:0 !important;
26
+ }
27
+ }
28
+ }
29
+ .#{$css-prefix}form.#{$css-prefix}inline .#{$css-prefix}form-item:last-child{
30
+ .#{$css-prefix}select-trigger {
31
+ min-width: 0;
32
+ width: 88px;
33
+ height: 28px;
34
+ .#{$css-prefix}select-inner {
35
+ min-width:0 !important;
36
+ }
37
+ }
38
+ }
39
+ .#{$css-prefix}input.#{$css-prefix}medium .#{$css-prefix}input-text-field {
40
+ line-height: calc(28px - 10px * 2);
41
+ padding: 0 7px;
42
+ }
43
+ }
44
+ }
@@ -0,0 +1,53 @@
1
+ import _Button from "@alifd/next/es/button";
2
+ import _Balloon from "@alifd/next/es/balloon";
3
+ import React, { useState } from 'react';
4
+ import styles from "./LineType.module.scss";
5
+ var Tooltip = _Balloon.Tooltip;
6
+ var LINE_TYPE_OPTIONS = [{
7
+ value: 'boundary',
8
+ label: '直线',
9
+ icon: 'topo_linear_icon_straightline'
10
+ }, {
11
+ value: 'oposite',
12
+ label: '内向双向箭头',
13
+ icon: 'topo_linear_icon_narrow_straightline'
14
+ }, {
15
+ value: 'h.v',
16
+ label: '折线',
17
+ icon: 'topo_linear_icon_vertical_foldline'
18
+ }, {
19
+ value: 'ortho',
20
+ label: '双折线',
21
+ icon: 'topo_linear_icon_bilinear'
22
+ }, {
23
+ value: 'flex',
24
+ label: '双弧线',
25
+ icon: 'topo_linear_icon_arcline'
26
+ }];
27
+ var LineType = /*#__PURE__*/React.forwardRef(function (props, ref) {
28
+ var onChange = props.onChange;
29
+
30
+ function lineButton(item) {
31
+ return /*#__PURE__*/React.createElement(_Button, {
32
+ className: "" + styles.redioBtn,
33
+ onClick: function onClick() {
34
+ onChange(item.value);
35
+ }
36
+ }, /*#__PURE__*/React.createElement("img", {
37
+ src: "/img/topo/editor/lineType/" + item.icon + ".svg",
38
+ alt: "",
39
+ className: styles.iconImg
40
+ }));
41
+ }
42
+
43
+ return /*#__PURE__*/React.createElement("div", {
44
+ className: styles.lineType
45
+ }, LINE_TYPE_OPTIONS.map(function (item, index) {
46
+ return /*#__PURE__*/React.createElement(Tooltip, {
47
+ trigger: lineButton(item),
48
+ align: "br",
49
+ key: index
50
+ }, item.label);
51
+ }));
52
+ });
53
+ export default LineType;
@@ -0,0 +1,31 @@
1
+ .lineType{
2
+ display:flex;
3
+ .redioBtn {
4
+ width: 24px;
5
+ height: 24px;
6
+ border-radius: 4px;
7
+ border: none !important;
8
+ color: #4D6277;
9
+ padding: 0;
10
+ margin-right: 16px;
11
+ text-align: center;
12
+
13
+ .iconImg {
14
+ vertical-align: middle;
15
+ }
16
+
17
+ &:active {
18
+ background: #F2F7FD !important;
19
+ }
20
+
21
+ &:hover {
22
+ background: #F2F7FD !important;
23
+ }
24
+ }
25
+ .redioBtn:last-child{
26
+ margin-right: 0;
27
+ }
28
+ }
29
+ .iconImg {
30
+ vertical-align: middle;
31
+ }
@@ -0,0 +1,77 @@
1
+ export var EDGE_END_POINT_TYPE_MAP = {
2
+ // 起点箭头
3
+ sourceArrow: {
4
+ names: ['sourceArrow'],
5
+ position: 15,
6
+ height: 15,
7
+ width: 37.5,
8
+ offsetX: -2,
9
+ keepOrien: true
10
+ },
11
+ // 起点实心圆
12
+ sourceSolidCircle: {
13
+ names: ['sourceSolidCircle'],
14
+ position: 15,
15
+ height: 12.5,
16
+ width: 25,
17
+ offsetX: 3,
18
+ keepOrien: true
19
+ },
20
+ // 起点空心圆
21
+ sourceNoneCircle: {
22
+ names: ['sourceNoneCircle'],
23
+ position: 15,
24
+ height: 12.5,
25
+ width: 25,
26
+ offsetX: 2.5,
27
+ keepOrien: true
28
+ },
29
+ // 终点箭头
30
+ targetArrow: {
31
+ names: ['targetArrow'],
32
+ position: 19,
33
+ height: 15,
34
+ width: 37.5,
35
+ offsetX: 3,
36
+ keepOrien: true
37
+ },
38
+ // 终点实心圆
39
+ targetSolidCircle: {
40
+ names: ['targetSolidCircle'],
41
+ position: 19,
42
+ height: 12.5,
43
+ width: 25,
44
+ offsetX: 0.5,
45
+ keepOrien: true
46
+ },
47
+ // 终点空心圆
48
+ targetNoneCircle: {
49
+ names: ['targetNoneCircle'],
50
+ position: 19,
51
+ height: 12.5,
52
+ width: 25,
53
+ offsetX: -0.5,
54
+ keepOrien: true
55
+ }
56
+ };
57
+ export var LINE_MOLD_MAP = {
58
+ solidLine: {
59
+ lineType: 'solid',
60
+ dashPattern: null
61
+ },
62
+ dottedLine: {
63
+ lineType: 'dash',
64
+ dashPattern: 1 // lineType为dash生效。为空默认为1。值:1/2/3
65
+
66
+ },
67
+ dottedLine1: {
68
+ lineType: 'dash',
69
+ dashPattern: 3 // lineType为dash生效。为空默认为1。值:1/2/3
70
+
71
+ },
72
+ dottedLine2: {
73
+ lineType: 'dash',
74
+ dashPattern: 2 // lineType为dash生效。为空默认为1。值:1/2/3
75
+
76
+ }
77
+ };
@@ -1,8 +1,11 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
1
2
  import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
2
3
  var _excluded = ["topo", "showLabel"];
3
- import React, { useEffect, useState } from 'react';
4
+ import React, { useEffect, useMemo, useState } from 'react';
5
+ import { getEdgesBySelection, setEdgesAndChildren, setEdgesType } from "../../../../utils/edgeTypeStyleUtil";
4
6
  import DropdownButton from "../components/DropdownButton";
5
7
  import WidgetBox from "../WidgetBox";
8
+ import { EDGE_END_POINT_TYPE_MAP, LINE_MOLD_MAP } from "./constants";
6
9
  import EdgeType from "./EdgeType";
7
10
  /**
8
11
  * 线形设置
@@ -17,13 +20,59 @@ function EdgeTypeButton(props) {
17
20
 
18
21
  var _useState = useState(true),
19
22
  disabled = _useState[0],
20
- setDisabled = _useState[1]; // 选中的元素
23
+ setDisabled = _useState[1]; // 拓扑图是否加载
21
24
 
22
25
 
23
- var selection = topo.selectionManager.useSelection();
26
+ var _topo$store$useModelS = topo.store.useModelState('topoMod'),
27
+ graphLoaded = _topo$store$useModelS.graphLoaded; // 选中的元素
28
+
29
+
30
+ var selection = topo.selectionManager.useHtSelection();
24
31
  useEffect(function () {
25
- setDisabled(false);
26
- }, [selection]);
32
+ if (graphLoaded) {
33
+ var edges = getEdgesBySelection(topo);
34
+ setDisabled(!edges.length);
35
+ }
36
+ }, [selection, graphLoaded]);
37
+
38
+ var handleChange = function handleChange(name, value) {
39
+ var edges = getEdgesBySelection(topo);
40
+ var htTopo = topo.getHtTopo();
41
+
42
+ if (name === 'lineButton') {
43
+ setEdgesType(edges, value, topo);
44
+ return;
45
+ }
46
+
47
+ setEdgesAndChildren(topo, edges, function (edge) {
48
+ if (name === 'startPoint') {
49
+ // 删除设置
50
+ ['sourceArrow', 'sourceSolidCircle', 'sourceNoneCircle'].forEach(function (iconName) {
51
+ return edge.removeStyleIcon(iconName);
52
+ }); // 设置
53
+
54
+ var scolor = edge.a('styles') && edge.a('styles').color || edge.getStyleMap()['edge.color'];
55
+ edge.a('arrow.color', scolor || '#00B779');
56
+ edge.s('icons', _extends({}, edge.s('icons')));
57
+ edge.addStyleIcon(value, EDGE_END_POINT_TYPE_MAP[value]);
58
+ } else if (name === 'endPoint') {
59
+ // 删除设置
60
+ ['targetArrow', 'targetSolidCircle', 'targetNoneCircle'].forEach(function (iconName) {
61
+ return edge.removeStyleIcon(iconName);
62
+ }); // 设置
63
+
64
+ var _scolor = edge.a('styles') && edge.a('styles').color || edge.getStyleMap()['edge.color'];
65
+
66
+ edge.a('arrow.color', _scolor || '#00B779');
67
+ edge.s('icons', _extends({}, edge.s('icons')));
68
+ edge.addStyleIcon(value, EDGE_END_POINT_TYPE_MAP[value]);
69
+ } else if (name === 'lineMold') {
70
+ edge.a('lineMode', value);
71
+ htTopo.setElementStyle(edge, LINE_MOLD_MAP[value]);
72
+ }
73
+ });
74
+ };
75
+
27
76
  var icon = disabled ? /*#__PURE__*/React.createElement("img", {
28
77
  src: "/img/topo/editor/toolbar/\u7EBF\u5F62/Disable.svg",
29
78
  alt: ""
@@ -34,11 +83,15 @@ function EdgeTypeButton(props) {
34
83
  return /*#__PURE__*/React.createElement(WidgetBox, {
35
84
  label: "\u7EBF\u5F62",
36
85
  tooltip: "\u7EBF\u5F62",
86
+ disabled: disabled,
37
87
  showLabel: showLabel
38
88
  }, /*#__PURE__*/React.createElement(DropdownButton, {
39
89
  disabled: disabled,
40
90
  trigger: icon
41
- }, /*#__PURE__*/React.createElement(EdgeType, null)));
91
+ }, !disabled && /*#__PURE__*/React.createElement(EdgeType, {
92
+ selection: selection,
93
+ onChange: handleChange
94
+ })));
42
95
  }
43
96
 
44
97
  export default EdgeTypeButton;
@@ -1,15 +1,26 @@
1
+ /* eslint-disable jsx-a11y/alt-text */
1
2
  import React, { useState } from 'react';
2
3
  import DropdownButton from "./components/DropdownButton";
3
4
  import WidgetBox from "./WidgetBox";
5
+ import ColorPanel from "../../../../../components/ColorPanel";
6
+ import FontColorRange from "../../../../../components/ColorPanel/components/FontColorRange";
7
+ import styles from "./FontColorButton.module.scss";
4
8
 
5
9
  function FontFamilySelect(props) {
6
10
  var value = props.value,
7
- onChange = props.onChange;
11
+ onChange = props.onChange,
12
+ topo = props.topo;
8
13
 
9
14
  var _useState = useState(false),
10
15
  disabled = _useState[0],
11
16
  setDisabled = _useState[1];
12
17
 
18
+ console.log(topo, 'topo这里需要处理颜色改变的事情');
19
+
20
+ var backOpacityChange = function backOpacityChange(value) {
21
+ console.log(value);
22
+ };
23
+
13
24
  var icon = disabled ? /*#__PURE__*/React.createElement("img", {
14
25
  src: "/img/topo/editor/toolbar/\u6587\u5B57\u989C\u8272\u53CA\u586B\u5145/Disable.svg",
15
26
  alt: ""
@@ -21,11 +32,31 @@ function FontFamilySelect(props) {
21
32
  disabled: disabled,
22
33
  trigger: icon,
23
34
  onChange: onChange
24
- }, "xxxx");
35
+ }, /*#__PURE__*/React.createElement("div", {
36
+ className: styles.content
37
+ }, /*#__PURE__*/React.createElement("div", {
38
+ className: styles.fontColor
39
+ }, /*#__PURE__*/React.createElement("span", null, "\u5B57\u4F53\u989C\u8272"), /*#__PURE__*/React.createElement(ColorPanel, null)), /*#__PURE__*/React.createElement("div", {
40
+ className: styles.backgroundColor
41
+ }, /*#__PURE__*/React.createElement("span", null, "\u80CC\u666F\u586B\u5145"), /*#__PURE__*/React.createElement("div", {
42
+ className: styles.backOpacity
43
+ }, /*#__PURE__*/React.createElement("img", {
44
+ src: "/img/topo/editor/toolbar/\u6587\u5B57\u989C\u8272\u53CA\u586B\u5145/\u80CC\u666F\u586B\u5145.svg"
45
+ }), /*#__PURE__*/React.createElement(FontColorRange, {
46
+ max: 100,
47
+ min: 0,
48
+ unit: "%",
49
+ list: [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100],
50
+ onChange: backOpacityChange,
51
+ defaultValue: 0
52
+ })), /*#__PURE__*/React.createElement(ColorPanel, {
53
+ showClear: true
54
+ }))));
25
55
  }
26
56
 
27
57
  function FontColorButton(props) {
28
- var showLabel = props.showLabel;
58
+ var showLabel = props.showLabel,
59
+ topo = props.topo;
29
60
 
30
61
  var _useState2 = useState('微软雅黑'),
31
62
  value = _useState2[0],
@@ -37,7 +68,8 @@ function FontColorButton(props) {
37
68
  showLabel: showLabel
38
69
  }, /*#__PURE__*/React.createElement(FontFamilySelect, {
39
70
  value: value,
40
- onChange: setValue
71
+ onChange: setValue,
72
+ topo: topo
41
73
  }));
42
74
  }
43
75