@riil-frontend/component-topology 6.0.0-alpha.2 → 6.0.0-alpha.21

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 (257) 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 +28 -28
  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 +22 -0
  9. package/es/components/ColorPanel/index.js +199 -0
  10. package/es/components/ColorPanel/index.module.scss +37 -0
  11. package/es/components/VerticalIconTab/VerticalIconTab.module.scss +7 -2
  12. package/es/components/collapse/Collapse.module.scss +12 -1
  13. package/es/core/common/hooks/useHtElements.js +21 -0
  14. package/es/core/common/icons/useIcons.js +7 -1
  15. package/es/core/components/AlarmListPanel/components/AlarmListItem.js +15 -13
  16. package/es/core/components/AlarmListPanel/components/index.module.scss +5 -5
  17. package/es/core/components/DisplaySettingDrawer/DisplaySetting.js +2 -1
  18. package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +6 -2
  19. package/es/core/components/DisplaySettingDrawer/EditorDisplaySetting.js +122 -0
  20. package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +74 -20
  21. package/es/core/components/TopoView/TopoGraphViewPanel.js +20 -0
  22. package/es/core/components/TopoView/editor.module.scss +1 -0
  23. package/es/core/components/TopoView/topoView.js +39 -18
  24. package/es/core/editor/components/Sidebar/Sidebar.js +26 -50
  25. package/es/core/editor/components/Sidebar/Sidebar.module.scss +5 -1
  26. package/es/core/editor/components/Sidebar/panes.js +32 -0
  27. package/es/core/editor/components/Sidebar/views/BackgroundPanel/BackgroundPanel.js +1 -2
  28. package/es/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.js +96 -0
  29. package/es/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.module.scss +74 -0
  30. package/es/core/editor/components/Sidebar/views/CanvasPanel/index.js +1 -1
  31. package/es/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +1 -1
  32. package/es/core/editor/components/Sidebar/views/ImagePanel/CustomImagePanel.js +8 -33
  33. package/es/core/editor/components/Sidebar/views/ImagePanel/HtCustomImagePanel.js +42 -0
  34. package/es/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.js +42 -0
  35. package/es/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.module.scss +5 -0
  36. package/es/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +2 -1
  37. package/es/core/editor/components/Toolbar/EditorToolbar.js +23 -13
  38. package/es/core/editor/components/Toolbar/Toolbar.js +1 -1
  39. package/es/core/editor/components/Toolbar/Toolbar.module.scss +14 -3
  40. package/es/core/editor/components/Toolbar/buttons.js +20 -18
  41. package/es/core/editor/components/Toolbar/hooks/useFontStyleSetting.js +35 -0
  42. package/es/core/editor/components/Toolbar/widgets/AddResourceButton.js +56 -7
  43. package/es/core/editor/components/Toolbar/widgets/CanvasMoveWidget.js +13 -2
  44. package/es/core/editor/components/Toolbar/widgets/CanvasSelectWidget.js +11 -2
  45. package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/Content.js +10 -1
  46. package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeWidthRange.js +33 -0
  47. package/es/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeWidthRange.module.scss +26 -0
  48. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +184 -3
  49. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.module.scss +44 -0
  50. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +53 -0
  51. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.module.scss +31 -0
  52. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/constants.js +77 -0
  53. package/es/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +59 -6
  54. package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +36 -4
  55. package/es/core/editor/components/Toolbar/widgets/FontColorButton.module.scss +35 -0
  56. package/es/core/editor/components/Toolbar/widgets/FontFamilyWidget.js +12 -2
  57. package/es/core/editor/components/Toolbar/widgets/FontSizeWidget.js +12 -2
  58. package/es/core/editor/components/Toolbar/widgets/HistoryRedoButton.js +3 -2
  59. package/es/core/editor/components/Toolbar/widgets/HistoryUndoButton.js +5 -4
  60. package/es/core/editor/components/Toolbar/widgets/IconSelect/IconSelect.js +109 -0
  61. package/es/core/editor/components/Toolbar/widgets/IconSelect/constant.js +64 -0
  62. package/es/core/editor/components/Toolbar/widgets/IconSelect/index.js +101 -0
  63. package/es/core/editor/components/Toolbar/widgets/IconSelect/index.module.scss +153 -0
  64. package/es/core/editor/components/Toolbar/widgets/IconSelect/popUpContent.js +49 -0
  65. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutSettings.js +99 -0
  66. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutSettings.module.scss +70 -0
  67. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagImageSelect/index.js +42 -0
  68. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagImageSelect/index.module.scss +7 -0
  69. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagSelect/index.js +75 -0
  70. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagSelect/index.scss +32 -0
  71. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/Icon.js +23 -0
  72. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/index.js +10 -0
  73. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_circular.svg +10 -0
  74. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_hierarchical.svg +10 -0
  75. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_rectangle.svg +12 -0
  76. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_toward.svg +16 -0
  77. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/index.js +31 -0
  78. package/es/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/index.module.scss +53 -0
  79. package/es/core/editor/components/Toolbar/widgets/Layout/index.js +127 -14
  80. package/es/core/editor/components/Toolbar/widgets/NodeAlignWidget.js +28 -22
  81. package/es/core/editor/components/Toolbar/widgets/NodeImageButton/BoxBackgroundSetting.js +14 -4
  82. package/es/core/editor/components/Toolbar/widgets/NodeImageButton/NodeImageButton.js +37 -6
  83. package/es/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.js +90 -12
  84. package/es/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.module.scss +28 -0
  85. package/es/core/editor/components/Toolbar/widgets/WidgetBox.js +9 -21
  86. package/es/core/editor/components/Toolbar/widgets/WidgetBox.module.scss +11 -1
  87. package/es/core/editor/components/Toolbar/widgets/components/ButtonBox.js +4 -2
  88. package/es/core/editor/components/Toolbar/widgets/components/DropdownButton.js +8 -5
  89. package/es/core/editor/components/settings/Settings.js +0 -23
  90. package/es/core/editor/components/settings/Settings.module.scss +1 -2
  91. package/es/core/editor/components/settings/common/AlignSetting/AlignTypeList.js +76 -0
  92. package/es/core/editor/components/settings/common/AlignSetting/index.js +18 -72
  93. package/es/core/editor/components/settings/common/LineType/index.js +12 -119
  94. package/es/core/editor/components/settings/common/NodeSizeInput/NodeSizeInput.js +3 -3
  95. package/es/core/editor/components/settings/common/SizeInput/NodeSizeInput.js +31 -21
  96. package/es/core/editor/components/settings/common/SizeInput/NodeSizeNumberPicker.js +7 -6
  97. package/es/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js +0 -8
  98. package/es/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +48 -0
  99. package/es/core/editor/components/settings/propertyViews/layer/DataTab/LayerAddResourceButton.js +12 -18
  100. package/es/core/editor/components/settings/propertyViews/layer/DataTab/LayerAddResourceDrawer.js +13 -46
  101. package/es/core/editor/components/settings/propertyViews/layer/DataTab/RelateData.js +2 -1
  102. package/es/core/editor/components/settings/propertyViews/multipleElements/BatchSetNodeSize/BatchSetNodeSize.js +8 -9
  103. package/es/core/editor/components/settings/propertyViews/multipleElements/MultipleElementLineType.js +5 -42
  104. package/es/core/editor/components/settings/propertyViews/multipleElements/MultipleElementPropertyView.js +2 -15
  105. package/es/core/editor/components/settings/propertyViews/view/BatchSetNodeSize.js +9 -6
  106. package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +8 -4
  107. package/es/core/editor/hooks/useLayerAddResource.js +28 -0
  108. package/es/core/{store/models → editor/store}/background.js +0 -0
  109. package/es/core/{store/models → editor/store}/historyManager.js +0 -0
  110. package/es/core/{store/models → editor/store}/topoEdit.js +8 -1
  111. package/es/core/editor/utils/edgeTypeStyleUtil.js +96 -0
  112. package/es/core/hooks/useCanvasTheme.js +35 -0
  113. package/es/core/hooks/useTopoEdit.js +36 -58
  114. package/es/core/models/HistoryManager.js +10 -3
  115. package/es/core/models/SelectionManager.js +16 -1
  116. package/es/core/models/TopoApp.js +1 -1
  117. package/es/core/models/TopoGraphView.js +8 -2
  118. package/es/core/models/utils/linkUtils.js +1 -1
  119. package/es/core/store/coreModels.js +6 -7
  120. package/es/core/store/models/selection.js +2 -1
  121. package/es/core/viewer/components/titlebar/widgets/SettingButton.js +3 -1
  122. package/es/core/viewer/components/titlebar/widgets/SettingButtonWidget.js +4 -2
  123. package/es/networkTopo/createTopo.js +2 -0
  124. package/es/networkTopo/services/link.js +2 -2
  125. package/es/networkTopo/store/topoTreeMod.js +6 -7
  126. package/es/style.js +1 -0
  127. package/es/utils/topoData.js +1 -0
  128. package/lib/components/ColorPanel/components/ColorBlock/index.js +47 -0
  129. package/lib/components/ColorPanel/components/ColorBlock/index.module.scss +8 -0
  130. package/lib/components/ColorPanel/components/FontColorRange/index.js +49 -0
  131. package/lib/components/ColorPanel/components/FontColorRange/index.module.scss +22 -0
  132. package/lib/components/ColorPanel/index.js +217 -0
  133. package/lib/components/ColorPanel/index.module.scss +37 -0
  134. package/lib/components/VerticalIconTab/VerticalIconTab.module.scss +7 -2
  135. package/lib/components/collapse/Collapse.module.scss +12 -1
  136. package/lib/core/common/hooks/useHtElements.js +27 -0
  137. package/lib/core/common/icons/useIcons.js +7 -1
  138. package/lib/core/components/AlarmListPanel/components/AlarmListItem.js +15 -13
  139. package/lib/core/components/AlarmListPanel/components/index.module.scss +5 -5
  140. package/lib/core/components/DisplaySettingDrawer/DisplaySetting.js +2 -1
  141. package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +7 -2
  142. package/lib/core/components/DisplaySettingDrawer/EditorDisplaySetting.js +147 -0
  143. package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +74 -20
  144. package/lib/core/components/TopoView/TopoGraphViewPanel.js +30 -0
  145. package/lib/core/components/TopoView/editor.module.scss +1 -0
  146. package/lib/core/components/TopoView/topoView.js +41 -19
  147. package/lib/core/editor/components/Sidebar/Sidebar.js +25 -52
  148. package/lib/core/editor/components/Sidebar/Sidebar.module.scss +5 -1
  149. package/lib/core/editor/components/Sidebar/panes.js +45 -0
  150. package/lib/core/editor/components/Sidebar/views/BackgroundPanel/BackgroundPanel.js +1 -2
  151. package/lib/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.js +109 -0
  152. package/lib/core/editor/components/Sidebar/views/CanvasPanel/CanvasPanel.module.scss +74 -0
  153. package/lib/core/editor/components/Sidebar/views/CanvasPanel/index.js +2 -2
  154. package/lib/core/editor/components/Sidebar/views/ImagePanel/CiTypeImagePanel.js +2 -2
  155. package/lib/core/editor/components/Sidebar/views/ImagePanel/CustomImagePanel.js +8 -32
  156. package/lib/core/editor/components/Sidebar/views/ImagePanel/HtCustomImagePanel.js +55 -0
  157. package/lib/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.js +55 -0
  158. package/lib/core/editor/components/Sidebar/views/ImagePanel/HtImagePalette.module.scss +5 -0
  159. package/lib/core/editor/components/Sidebar/views/ImagePanel/ImagePanel.js +3 -1
  160. package/lib/core/editor/components/Toolbar/EditorToolbar.js +22 -11
  161. package/lib/core/editor/components/Toolbar/Toolbar.js +1 -1
  162. package/lib/core/editor/components/Toolbar/Toolbar.module.scss +14 -3
  163. package/lib/core/editor/components/Toolbar/buttons.js +21 -20
  164. package/lib/core/editor/components/Toolbar/hooks/useFontStyleSetting.js +50 -0
  165. package/lib/core/editor/components/Toolbar/widgets/AddResourceButton.js +63 -7
  166. package/lib/core/editor/components/Toolbar/widgets/CanvasMoveWidget.js +13 -2
  167. package/lib/core/editor/components/Toolbar/widgets/CanvasSelectWidget.js +11 -2
  168. package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/Content.js +11 -1
  169. package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeWidthRange.js +47 -0
  170. package/lib/core/editor/components/Toolbar/widgets/EdgeColorButton/EdgeWidthRange.module.scss +26 -0
  171. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.js +194 -3
  172. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/EdgeType.module.scss +44 -0
  173. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.js +71 -0
  174. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/LineType.module.scss +31 -0
  175. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/constants.js +83 -0
  176. package/lib/core/editor/components/Toolbar/widgets/EdgeTypeButton/index.js +61 -5
  177. package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +39 -4
  178. package/lib/core/editor/components/Toolbar/widgets/FontColorButton.module.scss +35 -0
  179. package/lib/core/editor/components/Toolbar/widgets/FontFamilyWidget.js +13 -2
  180. package/lib/core/editor/components/Toolbar/widgets/FontSizeWidget.js +13 -2
  181. package/lib/core/editor/components/Toolbar/widgets/HistoryRedoButton.js +4 -2
  182. package/lib/core/editor/components/Toolbar/widgets/HistoryUndoButton.js +5 -3
  183. package/lib/core/editor/components/Toolbar/widgets/IconSelect/IconSelect.js +126 -0
  184. package/lib/core/editor/components/Toolbar/widgets/IconSelect/constant.js +69 -0
  185. package/lib/core/editor/components/Toolbar/widgets/IconSelect/index.js +117 -0
  186. package/lib/core/editor/components/Toolbar/widgets/IconSelect/index.module.scss +153 -0
  187. package/lib/core/editor/components/Toolbar/widgets/IconSelect/popUpContent.js +61 -0
  188. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutSettings.js +116 -0
  189. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutSettings.module.scss +70 -0
  190. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagImageSelect/index.js +55 -0
  191. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagImageSelect/index.module.scss +7 -0
  192. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagSelect/index.js +93 -0
  193. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTagSelect/index.scss +32 -0
  194. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/Icon.js +32 -0
  195. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/index.js +22 -0
  196. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_circular.svg +10 -0
  197. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_hierarchical.svg +10 -0
  198. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_rectangle.svg +12 -0
  199. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/assets/topo_layout_toward.svg +16 -0
  200. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/index.js +44 -0
  201. package/lib/core/editor/components/Toolbar/widgets/Layout/components/LayoutTemplateButton/index.module.scss +53 -0
  202. package/lib/core/editor/components/Toolbar/widgets/Layout/index.js +132 -15
  203. package/lib/core/editor/components/Toolbar/widgets/NodeAlignWidget.js +30 -23
  204. package/lib/core/editor/components/Toolbar/widgets/NodeImageButton/BoxBackgroundSetting.js +20 -4
  205. package/lib/core/editor/components/Toolbar/widgets/NodeImageButton/NodeImageButton.js +36 -5
  206. package/lib/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.js +91 -11
  207. package/lib/core/editor/components/Toolbar/widgets/NodeSizeButton/NodeSizeButton.module.scss +28 -0
  208. package/lib/core/editor/components/Toolbar/widgets/WidgetBox.js +11 -24
  209. package/lib/core/editor/components/Toolbar/widgets/WidgetBox.module.scss +11 -1
  210. package/lib/core/editor/components/Toolbar/widgets/components/ButtonBox.js +4 -2
  211. package/lib/core/editor/components/Toolbar/widgets/components/DropdownButton.js +8 -5
  212. package/lib/core/editor/components/settings/Settings.js +0 -23
  213. package/lib/core/editor/components/settings/Settings.module.scss +1 -2
  214. package/lib/core/editor/components/settings/common/AlignSetting/AlignTypeList.js +93 -0
  215. package/lib/core/editor/components/settings/common/AlignSetting/index.js +19 -80
  216. package/lib/core/editor/components/settings/common/LineType/index.js +13 -126
  217. package/lib/core/editor/components/settings/common/NodeSizeInput/NodeSizeInput.js +2 -2
  218. package/lib/core/editor/components/settings/common/SizeInput/NodeSizeInput.js +32 -23
  219. package/lib/core/editor/components/settings/common/SizeInput/NodeSizeNumberPicker.js +6 -6
  220. package/lib/core/editor/components/settings/propertyViews/group/SettingTab/GroupExpandSetting.js +0 -8
  221. package/lib/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +63 -0
  222. package/lib/core/editor/components/settings/propertyViews/layer/DataTab/LayerAddResourceButton.js +13 -22
  223. package/lib/core/editor/components/settings/propertyViews/layer/DataTab/LayerAddResourceDrawer.js +12 -50
  224. package/lib/core/editor/components/settings/propertyViews/layer/DataTab/RelateData.js +2 -1
  225. package/lib/core/editor/components/settings/propertyViews/multipleElements/BatchSetNodeSize/BatchSetNodeSize.js +6 -8
  226. package/lib/core/editor/components/settings/propertyViews/multipleElements/MultipleElementLineType.js +5 -42
  227. package/lib/core/editor/components/settings/propertyViews/multipleElements/MultipleElementPropertyView.js +2 -15
  228. package/lib/core/editor/components/settings/propertyViews/view/BatchSetNodeSize.js +7 -5
  229. package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +9 -1
  230. package/lib/core/editor/hooks/useLayerAddResource.js +34 -0
  231. package/lib/core/{store/models → editor/store}/background.js +0 -0
  232. package/lib/core/{store/models → editor/store}/historyManager.js +0 -0
  233. package/lib/core/{store/models → editor/store}/topoEdit.js +8 -1
  234. package/lib/core/editor/utils/edgeTypeStyleUtil.js +109 -0
  235. package/lib/core/hooks/useCanvasTheme.js +49 -0
  236. package/lib/core/hooks/useTopoEdit.js +36 -60
  237. package/lib/core/models/HistoryManager.js +10 -3
  238. package/lib/core/models/SelectionManager.js +17 -1
  239. package/lib/core/models/TopoApp.js +1 -1
  240. package/lib/core/models/TopoGraphView.js +8 -2
  241. package/lib/core/models/utils/linkUtils.js +1 -1
  242. package/lib/core/store/coreModels.js +5 -7
  243. package/lib/core/store/models/selection.js +2 -1
  244. package/lib/core/viewer/components/titlebar/widgets/SettingButton.js +3 -1
  245. package/lib/core/viewer/components/titlebar/widgets/SettingButtonWidget.js +4 -2
  246. package/lib/networkTopo/createTopo.js +3 -0
  247. package/lib/networkTopo/services/link.js +2 -2
  248. package/lib/networkTopo/store/topoTreeMod.js +6 -8
  249. package/lib/style.js +1 -0
  250. package/lib/utils/topoData.js +1 -0
  251. package/package.json +2 -2
  252. package/es/core/editor/components/Sidebar/views/CanvasPanel/ImagePanel.js +0 -4
  253. package/es/core/editor/components/Toolbar/widgets/AddResourceWidget.js +0 -17
  254. package/es/core/store/models/topoView.js +0 -36
  255. package/lib/core/editor/components/Sidebar/views/CanvasPanel/ImagePanel.js +0 -12
  256. package/lib/core/editor/components/Toolbar/widgets/AddResourceWidget.js +0 -27
  257. package/lib/core/store/models/topoView.js +0 -47
@@ -1,13 +1,13 @@
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
4
  import DropdownButton from "../components/DropdownButton";
5
5
  import WidgetBox from "../WidgetBox";
6
6
  import BoxBackgroundSetting from "./BoxBackgroundSetting";
7
7
  /**
8
8
  * 替换图片设置
9
- * @param {*} props
10
- * @returns
9
+ * @param {*} props
10
+ * @returns
11
11
  */
12
12
 
13
13
  function NodeImageButton(props) {
@@ -17,13 +17,41 @@ function NodeImageButton(props) {
17
17
 
18
18
  var _useState = useState(true),
19
19
  disabled = _useState[0],
20
- setDisabled = _useState[1]; // 选中的元素
20
+ setDisabled = _useState[1];
21
+
22
+ var _useState2 = useState(),
23
+ imgVal = _useState2[0],
24
+ setImgVal = _useState2[1]; // 选中的元素
21
25
 
22
26
 
23
27
  var selection = topo.selectionManager.useSelection();
24
28
  useEffect(function () {
25
- setDisabled(false);
29
+ console.log("NodeImageButton-selection", selection);
30
+
31
+ if (selection && selection.length > 0) {
32
+ setDisabled(false);
33
+ setImgVal(selection[0].image);
34
+ } else {
35
+ setDisabled(true);
36
+ }
26
37
  }, [selection]);
38
+
39
+ var onChange = function onChange(prop) {
40
+ console.log("onChange-prop", prop, selection); //const { name, value } = prop;
41
+ // const gv = topo.view.topoClient.getGraphView();
42
+ //const element = topo.getSelectionModel().getFirstData();
43
+
44
+ var elements = topo.getSelectionModel();
45
+ console.log("onChange-elements", elements);
46
+ elements.each(function (element) {
47
+ element.setImage(prop);
48
+ }); // selection.map((element) => {
49
+ // element.setImage(prop);
50
+ // });
51
+ // if (name === "image") {
52
+ // }
53
+ };
54
+
27
55
  var icon = disabled ? /*#__PURE__*/React.createElement("img", {
28
56
  src: "/img/topo/editor/toolbar/\u66FF\u6362\u56FE\u7247/Disable.svg",
29
57
  alt: ""
@@ -34,12 +62,15 @@ function NodeImageButton(props) {
34
62
  return /*#__PURE__*/React.createElement(WidgetBox, {
35
63
  label: "\u66FF\u6362\u56FE\u7247",
36
64
  tooltip: "\u66FF\u6362\u56FE\u7247",
65
+ disabled: disabled,
37
66
  showLabel: showLabel
38
67
  }, /*#__PURE__*/React.createElement(DropdownButton, {
39
68
  disabled: disabled,
40
69
  trigger: icon
41
70
  }, /*#__PURE__*/React.createElement(BoxBackgroundSetting, {
42
- topo: topo
71
+ topo: topo,
72
+ onChange: onChange,
73
+ value: imgVal
43
74
  })));
44
75
  }
45
76
 
@@ -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
9
  import BoxBackgroundSetting from "./BoxBackgroundSetting";
10
+ import styles from "./NodeSizeButton.module.scss";
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,99 @@ 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
+ if (selection && selection.length > 0) {
35
+ console.log("NodeSizeButton-selection", selection);
36
+ setDisabled(false);
37
+
38
+ if (selection.length === 1) {
39
+ setSize({
40
+ width: selection[0].width,
41
+ height: selection[0].height
42
+ });
43
+ }
44
+ } else {
45
+ setDisabled(true);
46
+ setSize({
47
+ width: null,
48
+ height: null
49
+ });
50
+ }
26
51
  }, [selection]);
52
+
53
+ var _onChange = function onChange(prop) {
54
+ console.log("onChange-prop", prop);
55
+ var name = prop.name,
56
+ value = prop.value;
57
+ var gv = topo.view.topoClient.getGraphView();
58
+ var element = topo.getSelectionModel().getFirstData();
59
+
60
+ if (name === "width") {
61
+ element.setWidth(value);
62
+ } else if (name === "height") {
63
+ element.setHeight(value);
64
+ }
65
+ };
66
+
27
67
  return /*#__PURE__*/React.createElement(WidgetBox, {
28
68
  label: "\u56FE\u7247\u5C3A\u5BF8",
69
+ disabled: disabled,
29
70
  tooltip: "\u56FE\u7247\u5C3A\u5BF8",
30
71
  showLabel: showLabel
31
72
  }, /*#__PURE__*/React.createElement("div", {
32
- style: {
33
- width: 136
73
+ className: styles.toolbarNodeSizeSetting
74
+ }, selection.length > 1 ? /*#__PURE__*/React.createElement(BatchSetNodeSize, {
75
+ topo: topo // size="small"
76
+ ,
77
+ value: size,
78
+ disabled: disabled,
79
+ showLabel: false,
80
+ numberPickerProps: {
81
+ hasTrigger: false,
82
+ placeholder: '-'
83
+ } // onChange={(size) => {
84
+ // topo.historyManager.beginTransaction();
85
+ // onChange({ name: "width", value: size.width });
86
+ // onChange({ name: "height", value: size.height });
87
+ // topo.historyManager.endTransaction();
88
+ // }}
89
+
90
+ }) : /*#__PURE__*/React.createElement(NodeSizeInput, {
91
+ topo: topo // size="small"
92
+ ,
93
+ value: size,
94
+ disabled: disabled,
95
+ showLabel: false,
96
+ hasTrigger: false,
97
+ numberPickerProps: {
98
+ hasTrigger: false,
99
+ placeholder: '-'
100
+ },
101
+ settingRuntimeState: settingRuntimeState,
102
+ onChange: function onChange(size) {
103
+ topo.historyManager.beginTransaction();
104
+
105
+ _onChange({
106
+ name: "width",
107
+ value: size.width
108
+ });
109
+
110
+ _onChange({
111
+ name: "height",
112
+ value: size.height
113
+ });
114
+
115
+ topo.historyManager.endTransaction();
34
116
  }
35
- }, /*#__PURE__*/React.createElement(BatchSetNodeSize, {
36
- topo: topo,
37
- size: "small",
38
- showLabel: false
39
117
  })));
40
118
  }
41
119
 
@@ -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,7 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
3
1
  import _Balloon from "@alifd/next/es/balloon";
4
- var _excluded = ["active", "disabled", "children"];
5
- import classNames from 'classnames';
6
2
  import React from 'react';
3
+ import classnames from 'classnames';
4
+ import ButtonBox from "./components/ButtonBox";
7
5
  import styles from "./WidgetBox.module.scss";
8
6
 
9
7
  function WidgetBox(props) {
@@ -12,14 +10,13 @@ function WidgetBox(props) {
12
10
  tooltip = props.tooltip,
13
11
  disabled = props.disabled,
14
12
  children = props.children;
15
- var button = /*#__PURE__*/React.createElement("button", {
13
+ var button = /*#__PURE__*/React.createElement("div", {
16
14
  disabled: disabled,
17
- type: "button",
18
15
  className: styles.container
19
16
  }, /*#__PURE__*/React.createElement("div", {
20
17
  className: styles.content
21
18
  }, children), showLabel !== false && /*#__PURE__*/React.createElement("div", {
22
- className: styles.label
19
+ className: classnames(styles.label, disabled ? styles.disabledLabel : styles.normalLabel)
23
20
  }, label));
24
21
 
25
22
  if (!tooltip) {
@@ -28,22 +25,13 @@ function WidgetBox(props) {
28
25
 
29
26
  return /*#__PURE__*/React.createElement(_Balloon.Tooltip, {
30
27
  trigger: button,
31
- align: "b"
28
+ align: "b" // 解决遮挡下拉浮层问题
29
+ ,
30
+ popupStyle: {
31
+ zIndex: 1000
32
+ }
32
33
  }, tooltip);
33
34
  }
34
35
 
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
36
  WidgetBox.ButtonBox = ButtonBox;
49
37
  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,10 +14,12 @@ 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",
@@ -6,6 +6,7 @@ import styles from "./DropdownButton.module.scss";
6
6
 
7
7
  function DropdownButton(props) {
8
8
  var trigger = props.trigger,
9
+ disabled = props.disabled,
9
10
  _props$showArrow = props.showArrow,
10
11
  showArrow = _props$showArrow === void 0 ? true : _props$showArrow,
11
12
  _props$showContainer = props.showContainer,
@@ -13,18 +14,20 @@ function DropdownButton(props) {
13
14
  children = props.children;
14
15
 
15
16
  var _useState = useState(false),
16
- visible = _useState[0],
17
- setVisible = _useState[1];
17
+ active = _useState[0],
18
+ setActive = _useState[1];
18
19
 
19
20
  var button = /*#__PURE__*/React.createElement(ButtonBox, {
20
- active: visible,
21
+ active: active,
22
+ disabled: disabled,
21
23
  showArrow: showArrow
22
24
  }, trigger);
23
25
  return /*#__PURE__*/React.createElement(_Dropdown, {
24
- visible: visible,
26
+ visible: active,
27
+ disabled: disabled,
25
28
  trigger: button,
26
29
  triggerType: "click",
27
- onVisibleChange: setVisible
30
+ onVisibleChange: setActive
28
31
  }, !showContainer ? children : /*#__PURE__*/React.createElement(PopupCard, null, children));
29
32
  }
30
33
 
@@ -82,29 +82,6 @@ export default function Settings(props) {
82
82
  // autoLayout.layout(layouType, function () {
83
83
  // gv.dm().sm().ss(element);
84
84
  // });
85
- } else if (name === "groupAlign") {
86
- var selectList = [];
87
-
88
- if (selection.length === 1) {
89
- // 选择分层
90
- if (element instanceof ht.Grid) {
91
- // selectList = gv
92
- // .dm()
93
- // .toDatas((d) => d.getHost() === gv.dm().sm().ld())
94
- // .toArray();
95
- selectList = element.getChildren().toArray();
96
- } // 选择分区
97
-
98
-
99
- if (element instanceof ht.Group) {
100
- selectList = element.getChildren().toArray();
101
- }
102
- } else {
103
- selectList = topo.getSelectionModel().getSelection().toArray();
104
- } // console.info("element--selectList", element, selectList);
105
-
106
-
107
- topo.view.topoClient.htTopoClient.setAlignmentBySelectionNodes(value, selectList);
108
85
  }
109
86
  };
110
87
 
@@ -7,8 +7,7 @@
7
7
  top: 0;
8
8
  right: 0;
9
9
  border-radius: 2px;
10
- //border: 1px solid #E6E7EB;
11
- //border-left: none;
10
+ border-left: 1px solid #E6E7EB;
12
11
 
13
12
  display: flex;
14
13
  flex-direction: column;
@@ -0,0 +1,76 @@
1
+ import _Button from "@alifd/next/es/button";
2
+ import _Icon from "@alifd/next/es/icon";
3
+ import _Divider from "@alifd/next/es/divider";
4
+ import React, { useState } from "react";
5
+ import styles from "./AlignSetting.module.scss";
6
+ var TREE_LAYOUT_OPTIONS = [{
7
+ value: "left",
8
+ label: "左对齐",
9
+ icon: "tuopu_zuoceduiqi"
10
+ }, {
11
+ value: "center",
12
+ label: "水平居中",
13
+ icon: "tuopu_shuipingjuzhongduiqi"
14
+ }, {
15
+ value: "right",
16
+ label: "右对齐",
17
+ icon: "tuopu_youceduiqi"
18
+ }, {
19
+ value: "top",
20
+ label: "靠上对齐",
21
+ icon: "tuopu_dingbuduiqi"
22
+ }, {
23
+ value: "middle",
24
+ label: "垂直居中",
25
+ icon: "tuopu_chuizhijuzhongduiqi"
26
+ }, {
27
+ value: "bottom",
28
+ label: "靠下对齐",
29
+ icon: "tuopu_dibuduiqi"
30
+ }, {
31
+ value: "divide"
32
+ }, {
33
+ value: "distributeHorizontal",
34
+ label: "横向分布",
35
+ icon: "tuopu_shuipingdengjianjuduiqi"
36
+ }, {
37
+ value: "distributeVertical",
38
+ label: "纵向分布",
39
+ icon: "tuopu_chuizhidengjianjuduiqi"
40
+ }];
41
+
42
+ var AlignTypeList = function AlignTypeList(props) {
43
+ var _props$selected = props.selected,
44
+ selected = _props$selected === void 0 ? "left" : _props$selected,
45
+ onChange = props.onChange;
46
+
47
+ var _useState = useState(selected),
48
+ value = _useState[0],
49
+ setValue = _useState[1];
50
+
51
+ var handleChange = function handleChange(data) {
52
+ // console.log("handleChange", data);
53
+ onChange && onChange(data.value);
54
+ setValue(data.value); // setValue(data)
55
+ };
56
+
57
+ return /*#__PURE__*/React.createElement("div", {
58
+ className: styles.AlignSetting
59
+ }, TREE_LAYOUT_OPTIONS.map(function (item, index, array) {
60
+ return item.value === "divide" ? /*#__PURE__*/React.createElement(_Divider, {
61
+ key: index,
62
+ direction: "ver"
63
+ }) : /*#__PURE__*/React.createElement(_Button, {
64
+ key: index,
65
+ className: "" + styles.redioBtn,
66
+ onClick: function onClick() {
67
+ handleChange(item);
68
+ },
69
+ title: item.label
70
+ }, /*#__PURE__*/React.createElement(_Icon, {
71
+ type: item.icon
72
+ }));
73
+ }));
74
+ };
75
+
76
+ export default AlignTypeList;
@@ -1,76 +1,22 @@
1
- import _Button from "@alifd/next/es/button";
2
- import _Icon from "@alifd/next/es/icon";
3
- import _Divider from "@alifd/next/es/divider";
4
- import React, { useState } from "react";
5
- import styles from "./AlignSetting.module.scss";
6
- var TREE_LAYOUT_OPTIONS = [{
7
- value: "left",
8
- label: "左对齐",
9
- icon: "tuopu_zuoceduiqi"
10
- }, {
11
- value: "center",
12
- label: "水平居中",
13
- icon: "tuopu_shuipingjuzhongduiqi"
14
- }, {
15
- value: "right",
16
- label: "右对齐",
17
- icon: "tuopu_youceduiqi"
18
- }, {
19
- value: "top",
20
- label: "靠上对齐",
21
- icon: "tuopu_dingbuduiqi"
22
- }, {
23
- value: "middle",
24
- label: "垂直居中",
25
- icon: "tuopu_chuizhijuzhongduiqi"
26
- }, {
27
- value: "bottom",
28
- label: "靠下对齐",
29
- icon: "tuopu_dibuduiqi"
30
- }, {
31
- value: "divide"
32
- }, {
33
- value: "distributeHorizontal",
34
- label: "横向分布",
35
- icon: "tuopu_shuipingdengjianjuduiqi"
36
- }, {
37
- value: "distributeVertical",
38
- label: "纵向分布",
39
- icon: "tuopu_chuizhidengjianjuduiqi"
40
- }];
1
+ import React from 'react';
2
+ import { isEdge, isLayer } from "../../../../../../utils/htElementUtils";
3
+ import AlignTypeList from "./AlignTypeList";
4
+ export default function AlignSetting(props) {
5
+ var topo = props.topo;
41
6
 
42
- var AlignSetting = function AlignSetting(props) {
43
- var _props$selected = props.selected,
44
- selected = _props$selected === void 0 ? "left" : _props$selected,
45
- onChange = props.onChange;
7
+ var alignOnChange = function alignOnChange(type) {
8
+ topo.historyManager.beginTransaction();
9
+ var selection = topo.getHtTopo().getGraphView().getSelectionModel().getSelection().toArray();
10
+ var nodes = selection.filter(function (ele) {
11
+ return !isLayer(ele) && !isEdge(ele);
12
+ }); // console.info("element--selectList", element, selectList);
46
13
 
47
- var _useState = useState(selected),
48
- value = _useState[0],
49
- setValue = _useState[1];
50
-
51
- var handleChange = function handleChange(data) {
52
- // console.log("handleChange", data);
53
- onChange && onChange(data.value);
54
- setValue(data.value); // setValue(data)
14
+ topo.view.topoClient.htTopoClient.setAlignmentBySelectionNodes(type, nodes);
15
+ topo.historyManager.endTransaction();
55
16
  };
56
17
 
57
- return /*#__PURE__*/React.createElement("div", {
58
- className: styles.AlignSetting
59
- }, TREE_LAYOUT_OPTIONS.map(function (item, index, array) {
60
- return item.value === "divide" ? /*#__PURE__*/React.createElement(_Divider, {
61
- key: index,
62
- direction: "ver"
63
- }) : /*#__PURE__*/React.createElement(_Button, {
64
- key: index,
65
- className: "" + styles.redioBtn,
66
- onClick: function onClick() {
67
- handleChange(item);
68
- },
69
- title: item.label
70
- }, /*#__PURE__*/React.createElement(_Icon, {
71
- type: item.icon
72
- }));
73
- }));
74
- };
75
-
76
- export default AlignSetting;
18
+ return /*#__PURE__*/React.createElement(AlignTypeList, {
19
+ onChange: alignOnChange,
20
+ selected: "left"
21
+ });
22
+ }