aldehyde 0.2.489 → 0.2.491

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 (691) hide show
  1. package/LICENSE +201 -201
  2. package/README.md +2 -2
  3. package/lib/controls/2dEditor/2dEditor/index.less +5 -5
  4. package/lib/controls/2dEditor/2dView/index.less +8 -8
  5. package/lib/controls/2dEditor/components/component.less +83 -83
  6. package/lib/controls/action/index.css +8 -8
  7. package/lib/controls/action/index.d.ts.map +1 -1
  8. package/lib/controls/chemstruc/graph.d.ts.map +1 -1
  9. package/lib/controls/chemstruc/index.css +28 -28
  10. package/lib/controls/collapse-card/index.css +8 -8
  11. package/lib/controls/collapse-card/index.d.ts.map +1 -1
  12. package/lib/controls/cquery/cquick-button.d.ts.map +1 -1
  13. package/lib/controls/date-picker/index.js +9 -9
  14. package/lib/controls/date-picker/index.js.map +1 -1
  15. package/lib/controls/entity-select/entity-select.d.ts.map +1 -1
  16. package/lib/controls/entity-select/index.css +7 -7
  17. package/lib/controls/entity-select/lab-tree-select.d.ts.map +1 -1
  18. package/lib/controls/entity-select/popover-entity-select.d.ts.map +1 -1
  19. package/lib/controls/file-view/index.less +9 -9
  20. package/lib/controls/html-editor/index.less +67 -67
  21. package/lib/controls/icon-selector/icon/aldehyde-menu-icon/iconfont.css +147 -147
  22. package/lib/controls/icon-selector/icon/phonenode-menu-icon/iconfont.css +63 -63
  23. package/lib/controls/password-setter/index.css +2 -2
  24. package/lib/controls/password-setter/index.d.ts.map +1 -1
  25. package/lib/controls/qr-code/index.less +28 -28
  26. package/lib/controls/relation-existion/index.css +3 -3
  27. package/lib/controls/relation-existion/index.d.ts.map +1 -1
  28. package/lib/controls/rfield/index.css +4 -4
  29. package/lib/controls/rfield/index.d.ts.map +1 -1
  30. package/lib/controls/select/index.d.ts.map +1 -1
  31. package/lib/controls/signature/index.d.ts.map +1 -1
  32. package/lib/controls/text/ellipsis-text.d.ts.map +1 -1
  33. package/lib/controls/text/index.less +7 -7
  34. package/lib/controls/upload/index.d.ts.map +1 -1
  35. package/lib/controls/upload/mult-file-upload.d.ts.map +1 -1
  36. package/lib/custom-page/dtmpl-custom-edit-modal-page.d.ts +4 -0
  37. package/lib/custom-page/dtmpl-custom-edit-modal-page.d.ts.map +1 -1
  38. package/lib/custom-page/dtmpl-custom-edit-modal-page.js +3 -1
  39. package/lib/custom-page/dtmpl-custom-edit-modal-page.js.map +1 -1
  40. package/lib/detail/button/bottom-submit-button-bar.d.ts.map +1 -1
  41. package/lib/detail/button/cquery-button-bar.d.ts.map +1 -1
  42. package/lib/detail/button/fix-right-submit-button-bar.d.ts.map +1 -1
  43. package/lib/detail/button/index.css +42 -42
  44. package/lib/detail/dtmpl.css +72 -72
  45. package/lib/detail/edit/fields-edit-card.d.ts.map +1 -1
  46. package/lib/detail/edit/modal-row-edit.d.ts.map +1 -1
  47. package/lib/detail/edit/popover-edit-card.d.ts.map +1 -1
  48. package/lib/detail/rightbar/index.css +34 -34
  49. package/lib/detail/rightbar/index.d.ts.map +1 -1
  50. package/lib/detail/view/act-dtmpl-view.d.ts.map +1 -1
  51. package/lib/detail/view/field-view-group.d.ts.map +1 -1
  52. package/lib/detail/view/modal-dtmpl-view.d.ts.map +1 -1
  53. package/lib/detail/view/snapshot-timeline.d.ts.map +1 -1
  54. package/lib/detail/view/tab-act-dtmpl-view.d.ts.map +1 -1
  55. package/lib/draw-canvas-edit/components/asset-bar/index.less +35 -35
  56. package/lib/draw-canvas-edit/components/main-header/index.less +23 -23
  57. package/lib/draw-canvas-edit/components/render/components/index.less +60 -60
  58. package/lib/draw-canvas-edit/components/render/components/workstation-component.js +6 -6
  59. package/lib/draw-canvas-edit/index.less +48 -48
  60. package/lib/draw-canvas-view/index.less +66 -66
  61. package/lib/export/export-frame.css +2 -2
  62. package/lib/export/export-frame.d.ts.map +1 -1
  63. package/lib/export/select-code-export-frame.d.ts.map +1 -1
  64. package/lib/form/dtmpl-form.css +3 -3
  65. package/lib/form/dtmpl-form.d.ts.map +1 -1
  66. package/lib/form/field-group-form.d.ts.map +1 -1
  67. package/lib/form/form-Item-group.d.ts.map +1 -1
  68. package/lib/form/index.css +12 -12
  69. package/lib/import/excel-import.d.ts.map +1 -1
  70. package/lib/import/index.css +53 -53
  71. package/lib/import/template.css +50 -50
  72. package/lib/layout/common.css +64 -64
  73. package/lib/layout/coverstyle.css +51 -51
  74. package/lib/layout/footer/index.css +5 -5
  75. package/lib/layout/header/index.css +122 -122
  76. package/lib/layout/menu/block.css +7 -7
  77. package/lib/layout/menu/block.d.ts.map +1 -1
  78. package/lib/layout/menu/l2menu-quick-bar.d.ts.map +1 -1
  79. package/lib/layout/menu/menu-2layers.d.ts.map +1 -1
  80. package/lib/layout/menu/message-bar.less +73 -73
  81. package/lib/layout/menu/reset-password.d.ts.map +1 -1
  82. package/lib/layout/menu/user-bar.d.ts.map +1 -1
  83. package/lib/layout/menu/userinfo-bar.d.ts.map +1 -1
  84. package/lib/layout/sidebar/index.css +57 -57
  85. package/lib/layout2/components/system-messages.js +1 -1
  86. package/lib/layout2/components/system-messages.js.map +1 -1
  87. package/lib/layout2/components/user-notification.js +1 -1
  88. package/lib/layout2/components/user-notification.js.map +1 -1
  89. package/lib/layout2/css/header.css +41 -41
  90. package/lib/layout2/css/sider.less +17 -17
  91. package/lib/layout2/css/tabs-layout.less +18 -18
  92. package/lib/layout3/css/header.less +195 -195
  93. package/lib/layout3/css/main.less +161 -161
  94. package/lib/layout3/css/sider.less +32 -32
  95. package/lib/layout3/css/tabs-layout.less +38 -38
  96. package/lib/layout4/css/header.less +196 -196
  97. package/lib/layout4/css/main.less +154 -154
  98. package/lib/layout4/css/sider.less +37 -37
  99. package/lib/layout4/css/tabs-layout.less +42 -42
  100. package/lib/layout5/css/header.less +35 -35
  101. package/lib/layout5/css/sider.less +18 -18
  102. package/lib/list/calendar/index.less +20 -20
  103. package/lib/list/card-list/index.less +154 -154
  104. package/lib/list/gantt/index.less +8 -8
  105. package/lib/list/vertical-list/index.less +208 -208
  106. package/lib/login/index.css +19 -19
  107. package/lib/login/login.d.ts.map +1 -1
  108. package/lib/login/vertify/index.css +143 -143
  109. package/lib/login3/index.less +136 -136
  110. package/lib/lowcode-components/act-table/index.less +26 -26
  111. package/lib/lowcode-components/base-button/index.less +7 -7
  112. package/lib/lowcode-components/base-map/index.js +6 -6
  113. package/lib/lowcode-components/base-radio/index.less +23 -23
  114. package/lib/lowcode-components/base-table/index.less +61 -61
  115. package/lib/lowcode-components/base-tabs/index.less +14 -14
  116. package/lib/lowcode-components/base-text/index.less +19 -19
  117. package/lib/lowcode-components/border/border10/index.less +26 -26
  118. package/lib/lowcode-components/border/border11/index.js +46 -46
  119. package/lib/lowcode-components/border/border11/index.less +17 -17
  120. package/lib/lowcode-components/border/border12/index.js +13 -13
  121. package/lib/lowcode-components/border/border12/index.less +13 -13
  122. package/lib/lowcode-components/border/border13/index.js +5 -5
  123. package/lib/lowcode-components/border/border13/index.less +13 -13
  124. package/lib/lowcode-components/border/border2/index.less +17 -17
  125. package/lib/lowcode-components/border/border3/index.less +25 -25
  126. package/lib/lowcode-components/border/border4/index.js +2 -2
  127. package/lib/lowcode-components/border/border4/index.less +72 -72
  128. package/lib/lowcode-components/border/border5/index.js +2 -2
  129. package/lib/lowcode-components/border/border5/index.less +35 -35
  130. package/lib/lowcode-components/border/border6/index.less +17 -17
  131. package/lib/lowcode-components/border/border7/index.less +26 -26
  132. package/lib/lowcode-components/border/border8/index.less +13 -13
  133. package/lib/lowcode-components/border/border9/index.js +14 -14
  134. package/lib/lowcode-components/border/border9/index.less +13 -13
  135. package/lib/lowcode-components/column-chart/index.d.ts +1 -0
  136. package/lib/lowcode-components/column-chart/index.d.ts.map +1 -1
  137. package/lib/lowcode-components/column-chart/index.js +49 -7
  138. package/lib/lowcode-components/column-chart/index.js.map +1 -1
  139. package/lib/lowcode-components/data-number/index.less +10 -10
  140. package/lib/lowcode-components/date-time/index.less +4 -4
  141. package/lib/lowcode-components/decoration/decoration1/index.less +7 -7
  142. package/lib/lowcode-components/decoration/decoration10/index.js +3 -3
  143. package/lib/lowcode-components/decoration/decoration10/index.less +5 -5
  144. package/lib/lowcode-components/decoration/decoration11/index.less +5 -5
  145. package/lib/lowcode-components/decoration/decoration2/index.less +6 -6
  146. package/lib/lowcode-components/decoration/decoration3/index.less +7 -7
  147. package/lib/lowcode-components/decoration/decoration4/index.less +29 -29
  148. package/lib/lowcode-components/decoration/decoration5/index.less +3 -3
  149. package/lib/lowcode-components/decoration/decoration6/index.less +7 -7
  150. package/lib/lowcode-components/decoration/decoration7/index.less +4 -4
  151. package/lib/lowcode-components/decoration/decoration8/index.less +14 -14
  152. package/lib/lowcode-components/decoration/decoration9/index.less +4 -4
  153. package/lib/lowcode-components/effectScatter-map/index.js +6 -6
  154. package/lib/lowcode-components/effectScatter-map-3d/index.js +6 -6
  155. package/lib/lowcode-components/four-angle-glow-border/index.less +49 -49
  156. package/lib/lowcode-components/line-bar-chart/index.d.ts +2 -1
  157. package/lib/lowcode-components/line-bar-chart/index.d.ts.map +1 -1
  158. package/lib/lowcode-components/line-bar-chart/index.js +53 -11
  159. package/lib/lowcode-components/line-bar-chart/index.js.map +1 -1
  160. package/lib/lowcode-components/line-chart/index.d.ts +1 -0
  161. package/lib/lowcode-components/line-chart/index.d.ts.map +1 -1
  162. package/lib/lowcode-components/line-chart/index.js +52 -10
  163. package/lib/lowcode-components/line-chart/index.js.map +1 -1
  164. package/lib/lowcode-components/lowcode-view/component/font/FontGlobal.css +26 -26
  165. package/lib/lowcode-components/lowcode-view/component/screen-fit/index.less +13 -13
  166. package/lib/lowcode-components/lowcode-view/index.d.ts.map +1 -1
  167. package/lib/lowcode-components/lowcode-view/index.js +3 -1
  168. package/lib/lowcode-components/lowcode-view/index.js.map +1 -1
  169. package/lib/lowcode-components/lowcode-view/index.less +19 -19
  170. package/lib/lowcode-components/search-form/index.less +25 -25
  171. package/lib/lowcode-components/text-scroller/index.less +28 -28
  172. package/lib/module/dtmpl-edit-card.d.ts +2 -0
  173. package/lib/module/dtmpl-edit-card.d.ts.map +1 -1
  174. package/lib/module/dtmpl-edit-card.js +15 -12
  175. package/lib/module/dtmpl-edit-card.js.map +1 -1
  176. package/lib/module/dtmpl-edit-drawer.d.ts +1 -0
  177. package/lib/module/dtmpl-edit-drawer.d.ts.map +1 -1
  178. package/lib/module/dtmpl-edit-drawer.js.map +1 -1
  179. package/lib/module/dtmpl-edit-modal.d.ts +1 -0
  180. package/lib/module/dtmpl-edit-modal.d.ts.map +1 -1
  181. package/lib/module/dtmpl-edit-modal.js.map +1 -1
  182. package/lib/module/dtmpl-edit-page.d.ts +2 -0
  183. package/lib/module/dtmpl-edit-page.d.ts.map +1 -1
  184. package/lib/module/dtmpl-edit-page.js +16 -12
  185. package/lib/module/dtmpl-edit-page.js.map +1 -1
  186. package/lib/module/index.less +4 -4
  187. package/lib/module/ltmpl-modal.d.ts.map +1 -1
  188. package/lib/module/ltmpl-table.d.ts +4 -0
  189. package/lib/module/ltmpl-table.d.ts.map +1 -1
  190. package/lib/module/ltmpl-table.js +10 -6
  191. package/lib/module/ltmpl-table.js.map +1 -1
  192. package/lib/routable/index.less +25 -25
  193. package/lib/routable/ltmpl-route.d.ts +1 -0
  194. package/lib/routable/ltmpl-route.d.ts.map +1 -1
  195. package/lib/routable/ltmpl-route.js +5 -3
  196. package/lib/routable/ltmpl-route.js.map +1 -1
  197. package/lib/routable/splitview-ltmpl-route.d.ts.map +1 -1
  198. package/lib/routable/splitview-ltmpl-route.js +4 -2
  199. package/lib/routable/splitview-ltmpl-route.js.map +1 -1
  200. package/lib/table/act-table.d.ts +3 -1
  201. package/lib/table/act-table.d.ts.map +1 -1
  202. package/lib/table/act-table.js +8 -7
  203. package/lib/table/act-table.js.map +1 -1
  204. package/lib/table/column/column-builder.d.ts.map +1 -1
  205. package/lib/table/column/column-builder.js +15 -6
  206. package/lib/table/column/column-builder.js.map +1 -1
  207. package/lib/table/column/index.less +85 -85
  208. package/lib/table/index.css +211 -211
  209. package/lib/table/modal-select-table.d.ts.map +1 -1
  210. package/lib/table/page-chart.js +1 -1
  211. package/lib/table/page-chart.js.map +1 -1
  212. package/lib/table/page-chart.less +9 -9
  213. package/lib/table/pagination.css +14 -14
  214. package/lib/table/pagination.d.ts.map +1 -1
  215. package/lib/table/relation-table.d.ts.map +1 -1
  216. package/lib/table/selected-rows-card.d.ts.map +1 -1
  217. package/lib/table/stat/restat.d.ts.map +1 -1
  218. package/lib/tmpl/interface.d.ts +4 -1
  219. package/lib/tmpl/interface.d.ts.map +1 -1
  220. package/lib/tmpl/interface.js.map +1 -1
  221. package/lib/tree/act-tree.d.ts.map +1 -1
  222. package/lib/tree/block-menu-auth-tree.d.ts.map +1 -1
  223. package/lib/tree/index.css +22 -22
  224. package/lib/tree/tmpl-tree.d.ts.map +1 -1
  225. package/lib/welcome/components/menu-card.less +96 -96
  226. package/lib/welcome/components/page-card.less +49 -49
  227. package/lib/welcome/components/quick-entrance.less +120 -120
  228. package/lib/welcome/components/user-menus.less +192 -192
  229. package/lib/welcome/components/workbench.less +118 -118
  230. package/lib/welcome/index.css +13 -13
  231. package/package.json +224 -224
  232. package/src/aldehyde/controls/2dEditor/2dEditor/index.less +5 -5
  233. package/src/aldehyde/controls/2dEditor/2dEditor/index.tsx +270 -270
  234. package/src/aldehyde/controls/2dEditor/2dView/index.less +8 -8
  235. package/src/aldehyde/controls/2dEditor/2dView/index.tsx +110 -110
  236. package/src/aldehyde/controls/2dEditor/components/card.tsx +256 -256
  237. package/src/aldehyde/controls/2dEditor/components/component.less +83 -83
  238. package/src/aldehyde/controls/2dEditor/components/data.d.ts +32 -32
  239. package/src/aldehyde/controls/2dEditor/components/hotspot.tsx +80 -80
  240. package/src/aldehyde/controls/2dEditor/components/html-box.tsx +101 -101
  241. package/src/aldehyde/controls/2dEditor/components/image.tsx +99 -99
  242. package/src/aldehyde/controls/2dEditor/components/line.tsx +73 -73
  243. package/src/aldehyde/controls/action/index.css +8 -8
  244. package/src/aldehyde/controls/action/index.tsx +406 -406
  245. package/src/aldehyde/controls/action/utils.tsx +306 -306
  246. package/src/aldehyde/controls/auto-complete/index.tsx +82 -82
  247. package/src/aldehyde/controls/cascader/index.tsx +112 -112
  248. package/src/aldehyde/controls/chemstruc/graph.tsx +185 -185
  249. package/src/aldehyde/controls/chemstruc/index.css +28 -28
  250. package/src/aldehyde/controls/code-editor/sql-code-editor.tsx +73 -73
  251. package/src/aldehyde/controls/collapse-card/index.css +8 -8
  252. package/src/aldehyde/controls/collapse-card/index.tsx +109 -109
  253. package/src/aldehyde/controls/color-picker/index.tsx +21 -21
  254. package/src/aldehyde/controls/counting-tag/index.tsx +53 -53
  255. package/src/aldehyde/controls/cquery/cquick-button.tsx +145 -145
  256. package/src/aldehyde/controls/date-picker/index.tsx +199 -199
  257. package/src/aldehyde/controls/direct-file-view/drawer-file-view.tsx +54 -54
  258. package/src/aldehyde/controls/direct-file-view/index.tsx +147 -147
  259. package/src/aldehyde/controls/direct-upload/index.tsx +140 -140
  260. package/src/aldehyde/controls/entity-select/entity-select.tsx +791 -791
  261. package/src/aldehyde/controls/entity-select/index.css +7 -7
  262. package/src/aldehyde/controls/entity-select/lab-tree-select.tsx +154 -154
  263. package/src/aldehyde/controls/entity-select/popover-entity-select.tsx +205 -205
  264. package/src/aldehyde/controls/entry-control.tsx +431 -431
  265. package/src/aldehyde/controls/enum-badge/index.tsx +42 -42
  266. package/src/aldehyde/controls/enum-tag/index.tsx +45 -45
  267. package/src/aldehyde/controls/field-history/index.tsx +81 -81
  268. package/src/aldehyde/controls/file-export/select-code-export.tsx +40 -40
  269. package/src/aldehyde/controls/file-view/drawer-file-view.tsx +117 -117
  270. package/src/aldehyde/controls/file-view/index.less +9 -9
  271. package/src/aldehyde/controls/file-view/index.tsx +148 -148
  272. package/src/aldehyde/controls/file-view/multi-file-view.tsx +39 -39
  273. package/src/aldehyde/controls/file-view/newin-file-view.tsx +40 -40
  274. package/src/aldehyde/controls/html-editor/draft.tsx +136 -136
  275. package/src/aldehyde/controls/html-editor/index.less +67 -67
  276. package/src/aldehyde/controls/icon-selector/app-icon-selector.tsx +68 -68
  277. package/src/aldehyde/controls/icon-selector/icon/aldehyde-menu-icon/iconfont.css +147 -147
  278. package/src/aldehyde/controls/icon-selector/icon/aldehyde-menu-icon/iconfont.json +240 -240
  279. package/src/aldehyde/controls/icon-selector/icon/phonenode-menu-icon/iconfont.css +63 -63
  280. package/src/aldehyde/controls/icon-selector/icon/phonenode-menu-icon/iconfont.json +93 -93
  281. package/src/aldehyde/controls/icon-selector/pc-icon-selector.tsx +68 -68
  282. package/src/aldehyde/controls/input-number/index.tsx +148 -148
  283. package/src/aldehyde/controls/input-range/index.tsx +59 -59
  284. package/src/aldehyde/controls/password-setter/index.css +2 -2
  285. package/src/aldehyde/controls/password-setter/index.js +88 -88
  286. package/src/aldehyde/controls/progress/index.tsx +74 -74
  287. package/src/aldehyde/controls/qr-code/index.less +28 -28
  288. package/src/aldehyde/controls/qr-code/index.tsx +40 -40
  289. package/src/aldehyde/controls/relation-existion/index.css +3 -3
  290. package/src/aldehyde/controls/relation-existion/index.tsx +144 -144
  291. package/src/aldehyde/controls/rfield/index.css +4 -4
  292. package/src/aldehyde/controls/rfield/index.tsx +225 -225
  293. package/src/aldehyde/controls/select/index.tsx +226 -226
  294. package/src/aldehyde/controls/signature/index.tsx +226 -226
  295. package/src/aldehyde/controls/single-checkbox/index.tsx +18 -18
  296. package/src/aldehyde/controls/steps/index.tsx +59 -59
  297. package/src/aldehyde/controls/text/ellipsis-text.tsx +98 -98
  298. package/src/aldehyde/controls/text/index.less +7 -7
  299. package/src/aldehyde/controls/tree-select/navigation-tree.tsx +122 -122
  300. package/src/aldehyde/controls/tree-select/tree-entity-select.tsx +121 -121
  301. package/src/aldehyde/controls/upload/index.tsx +128 -128
  302. package/src/aldehyde/controls/upload/mult-file-upload.tsx +240 -240
  303. package/src/aldehyde/controls/upload-read-excel/index.tsx +43 -43
  304. package/src/aldehyde/controls/view-control.tsx +289 -289
  305. package/src/aldehyde/custom-page/custom-detail-modal-page.tsx +69 -69
  306. package/src/aldehyde/custom-page/custom-page-router.tsx +64 -64
  307. package/src/aldehyde/custom-page/def-custom-page.tsx +17 -17
  308. package/src/aldehyde/custom-page/dtmpl-custom-edit-modal-page.tsx +91 -88
  309. package/src/aldehyde/detail/button/bottom-submit-button-bar.tsx +91 -91
  310. package/src/aldehyde/detail/button/cquery-button-bar.tsx +144 -144
  311. package/src/aldehyde/detail/button/edit-button.tsx +61 -61
  312. package/src/aldehyde/detail/button/fix-right-submit-button-bar.tsx +186 -186
  313. package/src/aldehyde/detail/button/index.css +42 -42
  314. package/src/aldehyde/detail/button/inline-edit-button.tsx +40 -40
  315. package/src/aldehyde/detail/button/submit-button-bar.tsx +57 -57
  316. package/src/aldehyde/detail/button/view-button.tsx +64 -64
  317. package/src/aldehyde/detail/dtmpl.css +72 -72
  318. package/src/aldehyde/detail/edit/dtmpl-edit.tsx +279 -279
  319. package/src/aldehyde/detail/edit/fields-edit-card.tsx +145 -145
  320. package/src/aldehyde/detail/edit/modal-row-edit.tsx +95 -95
  321. package/src/aldehyde/detail/edit/popover-edit-card.tsx +167 -167
  322. package/src/aldehyde/detail/edit/popover-editor.tsx +70 -70
  323. package/src/aldehyde/detail/edit/post-result/index.tsx +86 -86
  324. package/src/aldehyde/detail/rightbar/index.css +34 -34
  325. package/src/aldehyde/detail/rightbar/index.tsx +92 -92
  326. package/src/aldehyde/detail/tooltipbar/index.tsx +32 -32
  327. package/src/aldehyde/detail/view/act-dtmpl-view.tsx +288 -288
  328. package/src/aldehyde/detail/view/dtmpl-view.tsx +334 -334
  329. package/src/aldehyde/detail/view/field-view-group.tsx +88 -88
  330. package/src/aldehyde/detail/view/modal-dtmpl-view.tsx +73 -73
  331. package/src/aldehyde/detail/view/snapshot-timeline.tsx +231 -231
  332. package/src/aldehyde/detail/view/tab-act-dtmpl-view.tsx +304 -304
  333. package/src/aldehyde/detail/view/view-compare-panel.tsx +57 -57
  334. package/src/aldehyde/draw-canvas-edit/components/asset-bar/index.less +35 -35
  335. package/src/aldehyde/draw-canvas-edit/components/asset-bar/index.tsx +110 -110
  336. package/src/aldehyde/draw-canvas-edit/components/main-header/index.less +23 -23
  337. package/src/aldehyde/draw-canvas-edit/components/main-header/index.tsx +263 -263
  338. package/src/aldehyde/draw-canvas-edit/components/render/components/index.less +60 -60
  339. package/src/aldehyde/draw-canvas-edit/components/render/components/index.ts +3 -3
  340. package/src/aldehyde/draw-canvas-edit/components/render/components/workstation-component.tsx +220 -220
  341. package/src/aldehyde/draw-canvas-edit/components/render/draws/bg-draw.ts +177 -177
  342. package/src/aldehyde/draw-canvas-edit/components/render/draws/contextmenu-draw.ts +330 -330
  343. package/src/aldehyde/draw-canvas-edit/components/render/draws/graph-draw.ts +249 -249
  344. package/src/aldehyde/draw-canvas-edit/components/render/draws/index.ts +7 -7
  345. package/src/aldehyde/draw-canvas-edit/components/render/draws/link-draw.ts +1415 -1415
  346. package/src/aldehyde/draw-canvas-edit/components/render/draws/preview-draw.ts +274 -274
  347. package/src/aldehyde/draw-canvas-edit/components/render/draws/ref-line-draw.ts +71 -71
  348. package/src/aldehyde/draw-canvas-edit/components/render/draws/ruler-draw.ts +166 -166
  349. package/src/aldehyde/draw-canvas-edit/components/render/graphs/base-graph.ts +241 -241
  350. package/src/aldehyde/draw-canvas-edit/components/render/graphs/bezier.ts +542 -542
  351. package/src/aldehyde/draw-canvas-edit/components/render/graphs/circle.ts +699 -699
  352. package/src/aldehyde/draw-canvas-edit/components/render/graphs/curve.ts +500 -500
  353. package/src/aldehyde/draw-canvas-edit/components/render/graphs/index.ts +5 -5
  354. package/src/aldehyde/draw-canvas-edit/components/render/graphs/line.ts +493 -493
  355. package/src/aldehyde/draw-canvas-edit/components/render/graphs/rect.ts +680 -680
  356. package/src/aldehyde/draw-canvas-edit/components/render/handlers/drag-handlers.ts +68 -68
  357. package/src/aldehyde/draw-canvas-edit/components/render/handlers/drag-outside-handlers.ts +77 -77
  358. package/src/aldehyde/draw-canvas-edit/components/render/handlers/graph-handlers.ts +113 -113
  359. package/src/aldehyde/draw-canvas-edit/components/render/handlers/index.ts +9 -9
  360. package/src/aldehyde/draw-canvas-edit/components/render/handlers/key-move-handlers.ts +49 -49
  361. package/src/aldehyde/draw-canvas-edit/components/render/handlers/link-handlers.ts +45 -45
  362. package/src/aldehyde/draw-canvas-edit/components/render/handlers/selection-handlers.ts +410 -410
  363. package/src/aldehyde/draw-canvas-edit/components/render/handlers/shutcut-handlers.ts +45 -45
  364. package/src/aldehyde/draw-canvas-edit/components/render/handlers/text-handlers.ts +81 -81
  365. package/src/aldehyde/draw-canvas-edit/components/render/handlers/zoom-handlers.ts +59 -59
  366. package/src/aldehyde/draw-canvas-edit/components/render/index.ts +817 -817
  367. package/src/aldehyde/draw-canvas-edit/components/render/tools/align-tool.ts +89 -89
  368. package/src/aldehyde/draw-canvas-edit/components/render/tools/asset-tool.ts +154 -154
  369. package/src/aldehyde/draw-canvas-edit/components/render/tools/attract-tool.ts +457 -457
  370. package/src/aldehyde/draw-canvas-edit/components/render/tools/component-factory.ts +269 -269
  371. package/src/aldehyde/draw-canvas-edit/components/render/tools/copy-tool.ts +244 -244
  372. package/src/aldehyde/draw-canvas-edit/components/render/tools/import-export-tool.ts +588 -588
  373. package/src/aldehyde/draw-canvas-edit/components/render/tools/index.ts +10 -10
  374. package/src/aldehyde/draw-canvas-edit/components/render/tools/link-tool.ts +222 -222
  375. package/src/aldehyde/draw-canvas-edit/components/render/tools/position-tool.ts +191 -191
  376. package/src/aldehyde/draw-canvas-edit/components/render/tools/selection-tool.ts +140 -140
  377. package/src/aldehyde/draw-canvas-edit/components/render/tools/z-index-tool.ts +224 -224
  378. package/src/aldehyde/draw-canvas-edit/components/render/types.ts +298 -298
  379. package/src/aldehyde/draw-canvas-edit/components/render/utils/a-star.ts +116 -116
  380. package/src/aldehyde/draw-canvas-edit/components/render/utils/bezier-scene-func.ts +72 -72
  381. package/src/aldehyde/draw-canvas-edit/components/setting-form/imag-upload.tsx +119 -119
  382. package/src/aldehyde/draw-canvas-edit/components/setting-form/index.tsx +305 -305
  383. package/src/aldehyde/draw-canvas-edit/constant.ts +5 -5
  384. package/src/aldehyde/draw-canvas-edit/index.less +48 -48
  385. package/src/aldehyde/draw-canvas-edit/index.tsx +213 -213
  386. package/src/aldehyde/draw-canvas-view/index.less +66 -66
  387. package/src/aldehyde/draw-canvas-view/index.tsx +49 -49
  388. package/src/aldehyde/draw-canvas-view/view.tsx +237 -237
  389. package/src/aldehyde/export/export-frame.css +2 -2
  390. package/src/aldehyde/export/export-frame.tsx +301 -301
  391. package/src/aldehyde/export/select-code-export-frame.tsx +212 -212
  392. package/src/aldehyde/form/criteria-form.tsx +604 -604
  393. package/src/aldehyde/form/dtmpl-form.css +3 -3
  394. package/src/aldehyde/form/dtmpl-form.tsx +571 -571
  395. package/src/aldehyde/form/field-group-form.tsx +103 -103
  396. package/src/aldehyde/form/fields-form.tsx +45 -45
  397. package/src/aldehyde/form/form-Item-group.tsx +246 -246
  398. package/src/aldehyde/form/index.css +12 -12
  399. package/src/aldehyde/hooks/use-match-route/index.tsx +62 -62
  400. package/src/aldehyde/hooks/use-tabs/index.tsx +139 -139
  401. package/src/aldehyde/hooks/useVarCssColor.ts +6 -6
  402. package/src/aldehyde/icon/aliIcon.tsx +9 -9
  403. package/src/aldehyde/icon/index.tsx +28 -28
  404. package/src/aldehyde/import/excel-import.tsx +450 -450
  405. package/src/aldehyde/import/index.css +53 -53
  406. package/src/aldehyde/import/template.css +50 -50
  407. package/src/aldehyde/index.tsx +220 -220
  408. package/src/aldehyde/layout/MainPage.tsx +334 -334
  409. package/src/aldehyde/layout/common.css +64 -64
  410. package/src/aldehyde/layout/coverstyle.css +51 -51
  411. package/src/aldehyde/layout/footer/index.css +5 -5
  412. package/src/aldehyde/layout/footer/index.js +17 -17
  413. package/src/aldehyde/layout/header/index.css +122 -122
  414. package/src/aldehyde/layout/header/index.tsx +152 -152
  415. package/src/aldehyde/layout/menu/block.css +7 -7
  416. package/src/aldehyde/layout/menu/block.tsx +174 -174
  417. package/src/aldehyde/layout/menu/l2menu-message-bar.tsx +160 -160
  418. package/src/aldehyde/layout/menu/l2menu-quick-bar.tsx +175 -175
  419. package/src/aldehyde/layout/menu/menu-2layers.tsx +117 -117
  420. package/src/aldehyde/layout/menu/menu-render.tsx +168 -168
  421. package/src/aldehyde/layout/menu/message-bar.less +73 -73
  422. package/src/aldehyde/layout/menu/reset-password.tsx +255 -255
  423. package/src/aldehyde/layout/menu/user-bar.tsx +259 -259
  424. package/src/aldehyde/layout/menu/userinfo-bar.tsx +69 -69
  425. package/src/aldehyde/layout/sidebar/index.css +57 -57
  426. package/src/aldehyde/layout/sidebar/index.tsx +84 -84
  427. package/src/aldehyde/layout2/components/icon-font.tsx +7 -7
  428. package/src/aldehyde/layout2/components/screenfull-button.tsx +21 -21
  429. package/src/aldehyde/layout2/components/search-menu.tsx +85 -85
  430. package/src/aldehyde/layout2/components/system-messages.tsx +75 -75
  431. package/src/aldehyde/layout2/components/theme-button.tsx +65 -65
  432. package/src/aldehyde/layout2/components/user-button.tsx +258 -258
  433. package/src/aldehyde/layout2/components/user-notification.tsx +74 -74
  434. package/src/aldehyde/layout2/css/header.css +41 -41
  435. package/src/aldehyde/layout2/css/sider.less +17 -17
  436. package/src/aldehyde/layout2/css/tabs-layout.less +18 -18
  437. package/src/aldehyde/layout2/header.tsx +278 -278
  438. package/src/aldehyde/layout2/layout-context.tsx +95 -95
  439. package/src/aldehyde/layout2/main.tsx +30 -30
  440. package/src/aldehyde/layout2/page.tsx +315 -315
  441. package/src/aldehyde/layout2/sider.tsx +230 -230
  442. package/src/aldehyde/layout2/tabs/tabs-context.tsx +37 -37
  443. package/src/aldehyde/layout2/tabs/tabs-layout.tsx +146 -146
  444. package/src/aldehyde/layout2/type/layout-type.ts +15 -15
  445. package/src/aldehyde/layout2/util/menu-util.tsx +125 -125
  446. package/src/aldehyde/layout3/components/tabs-layout.tsx +110 -110
  447. package/src/aldehyde/layout3/components/time.tsx +25 -25
  448. package/src/aldehyde/layout3/css/header.less +195 -195
  449. package/src/aldehyde/layout3/css/main.less +161 -161
  450. package/src/aldehyde/layout3/css/sider.less +32 -32
  451. package/src/aldehyde/layout3/css/tabs-layout.less +38 -38
  452. package/src/aldehyde/layout3/header.tsx +187 -187
  453. package/src/aldehyde/layout3/main.tsx +29 -29
  454. package/src/aldehyde/layout3/page.tsx +110 -110
  455. package/src/aldehyde/layout3/sider.tsx +198 -198
  456. package/src/aldehyde/layout4/components/tabs-layout.tsx +110 -110
  457. package/src/aldehyde/layout4/css/header.less +196 -196
  458. package/src/aldehyde/layout4/css/main.less +154 -154
  459. package/src/aldehyde/layout4/css/sider.less +37 -37
  460. package/src/aldehyde/layout4/css/tabs-layout.less +42 -42
  461. package/src/aldehyde/layout4/header.tsx +190 -190
  462. package/src/aldehyde/layout4/imgs/user.svg +26 -26
  463. package/src/aldehyde/layout4/main.tsx +29 -29
  464. package/src/aldehyde/layout4/page.tsx +125 -125
  465. package/src/aldehyde/layout4/sider.tsx +201 -201
  466. package/src/aldehyde/layout5/css/header.less +35 -35
  467. package/src/aldehyde/layout5/css/sider.less +18 -18
  468. package/src/aldehyde/layout5/header.tsx +204 -204
  469. package/src/aldehyde/layout5/page.tsx +107 -107
  470. package/src/aldehyde/layout5/sider.tsx +235 -235
  471. package/src/aldehyde/list/calendar/index.less +20 -20
  472. package/src/aldehyde/list/calendar/index.tsx +157 -157
  473. package/src/aldehyde/list/card-list/card-list-item.tsx +112 -112
  474. package/src/aldehyde/list/card-list/index.less +154 -154
  475. package/src/aldehyde/list/card-list/index.tsx +83 -83
  476. package/src/aldehyde/list/gantt/index.less +8 -8
  477. package/src/aldehyde/list/gantt/index.tsx +508 -508
  478. package/src/aldehyde/list/vertical-list/index.less +208 -208
  479. package/src/aldehyde/list/vertical-list/index.tsx +55 -55
  480. package/src/aldehyde/list/vertical-list/item.tsx +136 -136
  481. package/src/aldehyde/locale/LocaleButton.tsx +48 -48
  482. package/src/aldehyde/locale/LocaleProvider.tsx +265 -265
  483. package/src/aldehyde/locale/langMp.ts +45 -45
  484. package/src/aldehyde/locale/translate.ts +80 -80
  485. package/src/aldehyde/locale/useLocale.ts +72 -72
  486. package/src/aldehyde/login/context-setter.tsx +130 -130
  487. package/src/aldehyde/login/index.css +19 -19
  488. package/src/aldehyde/login/login.tsx +255 -255
  489. package/src/aldehyde/login/router-login.tsx +107 -107
  490. package/src/aldehyde/login/vertify/index.css +143 -143
  491. package/src/aldehyde/login/vertify/index.tsx +360 -360
  492. package/src/aldehyde/login/vertify/tool.ts +13 -13
  493. package/src/aldehyde/login2/login-page.tsx +92 -92
  494. package/src/aldehyde/login2/login.tsx +227 -227
  495. package/src/aldehyde/login3/index.less +136 -136
  496. package/src/aldehyde/login3/login-page.tsx +71 -71
  497. package/src/aldehyde/lowcode-components/act-table/index.less +26 -26
  498. package/src/aldehyde/lowcode-components/act-table/index.tsx +139 -139
  499. package/src/aldehyde/lowcode-components/assets/lowcode-constant.tsx +12 -12
  500. package/src/aldehyde/lowcode-components/bar-chart/index.tsx +272 -272
  501. package/src/aldehyde/lowcode-components/base-button/index.less +7 -7
  502. package/src/aldehyde/lowcode-components/base-button/index.tsx +197 -197
  503. package/src/aldehyde/lowcode-components/base-color-block/index.tsx +31 -31
  504. package/src/aldehyde/lowcode-components/base-image/index.tsx +220 -220
  505. package/src/aldehyde/lowcode-components/base-map/index.tsx +292 -292
  506. package/src/aldehyde/lowcode-components/base-radio/index.less +23 -23
  507. package/src/aldehyde/lowcode-components/base-radio/index.tsx +157 -157
  508. package/src/aldehyde/lowcode-components/base-table/index.less +61 -61
  509. package/src/aldehyde/lowcode-components/base-table/index.tsx +268 -268
  510. package/src/aldehyde/lowcode-components/base-tabs/index.less +14 -14
  511. package/src/aldehyde/lowcode-components/base-tabs/index.tsx +183 -183
  512. package/src/aldehyde/lowcode-components/base-text/index.less +19 -19
  513. package/src/aldehyde/lowcode-components/base-text/index.tsx +58 -58
  514. package/src/aldehyde/lowcode-components/border/border1/index.tsx +70 -70
  515. package/src/aldehyde/lowcode-components/border/border10/index.less +26 -26
  516. package/src/aldehyde/lowcode-components/border/border10/index.tsx +45 -45
  517. package/src/aldehyde/lowcode-components/border/border11/index.less +17 -17
  518. package/src/aldehyde/lowcode-components/border/border11/index.tsx +232 -232
  519. package/src/aldehyde/lowcode-components/border/border12/index.less +13 -13
  520. package/src/aldehyde/lowcode-components/border/border12/index.tsx +115 -115
  521. package/src/aldehyde/lowcode-components/border/border13/index.less +13 -13
  522. package/src/aldehyde/lowcode-components/border/border13/index.tsx +69 -69
  523. package/src/aldehyde/lowcode-components/border/border2/index.less +17 -17
  524. package/src/aldehyde/lowcode-components/border/border2/index.tsx +51 -51
  525. package/src/aldehyde/lowcode-components/border/border3/index.less +25 -25
  526. package/src/aldehyde/lowcode-components/border/border3/index.tsx +61 -61
  527. package/src/aldehyde/lowcode-components/border/border4/index.less +72 -72
  528. package/src/aldehyde/lowcode-components/border/border4/index.tsx +79 -79
  529. package/src/aldehyde/lowcode-components/border/border5/index.less +35 -35
  530. package/src/aldehyde/lowcode-components/border/border5/index.tsx +75 -75
  531. package/src/aldehyde/lowcode-components/border/border6/index.less +17 -17
  532. package/src/aldehyde/lowcode-components/border/border6/index.tsx +60 -60
  533. package/src/aldehyde/lowcode-components/border/border7/index.less +26 -26
  534. package/src/aldehyde/lowcode-components/border/border7/index.tsx +75 -75
  535. package/src/aldehyde/lowcode-components/border/border8/index.less +13 -13
  536. package/src/aldehyde/lowcode-components/border/border8/index.tsx +84 -84
  537. package/src/aldehyde/lowcode-components/border/border9/index.less +13 -13
  538. package/src/aldehyde/lowcode-components/border/border9/index.tsx +154 -154
  539. package/src/aldehyde/lowcode-components/capsule-bar-chart/index.tsx +290 -290
  540. package/src/aldehyde/lowcode-components/carousel/index.tsx +218 -218
  541. package/src/aldehyde/lowcode-components/circular-progress-chart/index.tsx +263 -263
  542. package/src/aldehyde/lowcode-components/column-3d-chart/index.tsx +442 -442
  543. package/src/aldehyde/lowcode-components/column-chart/index.tsx +349 -297
  544. package/src/aldehyde/lowcode-components/data-number/index.less +10 -10
  545. package/src/aldehyde/lowcode-components/data-number/index.tsx +219 -219
  546. package/src/aldehyde/lowcode-components/data.d.ts +19 -19
  547. package/src/aldehyde/lowcode-components/date-time/index.less +4 -4
  548. package/src/aldehyde/lowcode-components/date-time/index.tsx +64 -64
  549. package/src/aldehyde/lowcode-components/decoration/decoration1/index.less +7 -7
  550. package/src/aldehyde/lowcode-components/decoration/decoration1/index.tsx +153 -153
  551. package/src/aldehyde/lowcode-components/decoration/decoration10/index.less +5 -5
  552. package/src/aldehyde/lowcode-components/decoration/decoration10/index.tsx +89 -89
  553. package/src/aldehyde/lowcode-components/decoration/decoration11/index.less +5 -5
  554. package/src/aldehyde/lowcode-components/decoration/decoration11/index.tsx +133 -133
  555. package/src/aldehyde/lowcode-components/decoration/decoration2/index.less +6 -6
  556. package/src/aldehyde/lowcode-components/decoration/decoration2/index.tsx +61 -61
  557. package/src/aldehyde/lowcode-components/decoration/decoration3/index.less +7 -7
  558. package/src/aldehyde/lowcode-components/decoration/decoration3/index.tsx +87 -87
  559. package/src/aldehyde/lowcode-components/decoration/decoration4/index.less +29 -29
  560. package/src/aldehyde/lowcode-components/decoration/decoration4/index.tsx +53 -53
  561. package/src/aldehyde/lowcode-components/decoration/decoration5/index.less +3 -3
  562. package/src/aldehyde/lowcode-components/decoration/decoration5/index.tsx +116 -116
  563. package/src/aldehyde/lowcode-components/decoration/decoration6/index.less +7 -7
  564. package/src/aldehyde/lowcode-components/decoration/decoration6/index.tsx +121 -121
  565. package/src/aldehyde/lowcode-components/decoration/decoration7/index.less +4 -4
  566. package/src/aldehyde/lowcode-components/decoration/decoration7/index.tsx +70 -70
  567. package/src/aldehyde/lowcode-components/decoration/decoration8/index.less +14 -14
  568. package/src/aldehyde/lowcode-components/decoration/decoration8/index.tsx +122 -122
  569. package/src/aldehyde/lowcode-components/decoration/decoration9/index.less +4 -4
  570. package/src/aldehyde/lowcode-components/decoration/decoration9/index.tsx +196 -196
  571. package/src/aldehyde/lowcode-components/effectScatter-map/index.tsx +315 -315
  572. package/src/aldehyde/lowcode-components/effectScatter-map-3d/index.tsx +419 -419
  573. package/src/aldehyde/lowcode-components/four-angle-glow-border/index.less +49 -49
  574. package/src/aldehyde/lowcode-components/four-angle-glow-border/index.tsx +53 -53
  575. package/src/aldehyde/lowcode-components/gauge-chart/index.tsx +254 -254
  576. package/src/aldehyde/lowcode-components/index.ts +130 -130
  577. package/src/aldehyde/lowcode-components/line-bar-chart/index.tsx +356 -304
  578. package/src/aldehyde/lowcode-components/line-chart/index.tsx +346 -294
  579. package/src/aldehyde/lowcode-components/liquid-chart/index.tsx +250 -250
  580. package/src/aldehyde/lowcode-components/lowcode-view/component/abstract-controller.ts +64 -64
  581. package/src/aldehyde/lowcode-components/lowcode-view/component/abstract-definition.ts +77 -77
  582. package/src/aldehyde/lowcode-components/lowcode-view/component/abstract-designer-loader.ts +36 -36
  583. package/src/aldehyde/lowcode-components/lowcode-view/component/assets.ts +478 -478
  584. package/src/aldehyde/lowcode-components/lowcode-view/component/component-container.tsx +91 -91
  585. package/src/aldehyde/lowcode-components/lowcode-view/component/component-controller.ts +153 -153
  586. package/src/aldehyde/lowcode-components/lowcode-view/component/component-definition.ts +23 -23
  587. package/src/aldehyde/lowcode-components/lowcode-view/component/font/FontGlobal.css +26 -26
  588. package/src/aldehyde/lowcode-components/lowcode-view/component/group-layer/controller.ts +36 -36
  589. package/src/aldehyde/lowcode-components/lowcode-view/component/group-layer/definition.ts +53 -53
  590. package/src/aldehyde/lowcode-components/lowcode-view/component/group-layer/index.tsx +15 -15
  591. package/src/aldehyde/lowcode-components/lowcode-view/component/layer-builder.tsx +98 -98
  592. package/src/aldehyde/lowcode-components/lowcode-view/component/loading.tsx +20 -20
  593. package/src/aldehyde/lowcode-components/lowcode-view/component/screen-fit/index.less +13 -13
  594. package/src/aldehyde/lowcode-components/lowcode-view/component/screen-fit/index.tsx +121 -121
  595. package/src/aldehyde/lowcode-components/lowcode-view/component/util.ts +27 -27
  596. package/src/aldehyde/lowcode-components/lowcode-view/index.less +19 -19
  597. package/src/aldehyde/lowcode-components/lowcode-view/index.tsx +279 -277
  598. package/src/aldehyde/lowcode-components/lowcode-view/interface.ts +189 -189
  599. package/src/aldehyde/lowcode-components/pie-chart/index.tsx +353 -353
  600. package/src/aldehyde/lowcode-components/placeholder-component/index.tsx +81 -81
  601. package/src/aldehyde/lowcode-components/progress-chart/index.tsx +295 -295
  602. package/src/aldehyde/lowcode-components/radar-chart/index.tsx +322 -322
  603. package/src/aldehyde/lowcode-components/search-form/index.less +25 -25
  604. package/src/aldehyde/lowcode-components/search-form/index.tsx +121 -121
  605. package/src/aldehyde/lowcode-components/stroke-animation/index.tsx +219 -219
  606. package/src/aldehyde/lowcode-components/text-scroller/index.less +28 -28
  607. package/src/aldehyde/lowcode-components/text-scroller/index.tsx +173 -173
  608. package/src/aldehyde/module/block-menu-tree-drawer.tsx +118 -118
  609. package/src/aldehyde/module/criteria-page.tsx1 +175 -175
  610. package/src/aldehyde/module/draggable-modal.tsx +66 -66
  611. package/src/aldehyde/module/dtmpl-edit-card.tsx +479 -477
  612. package/src/aldehyde/module/dtmpl-edit-drawer.tsx +24 -23
  613. package/src/aldehyde/module/dtmpl-edit-modal.tsx +26 -25
  614. package/src/aldehyde/module/dtmpl-edit-page.tsx +600 -597
  615. package/src/aldehyde/module/dtmpl-editor.tsx +165 -165
  616. package/src/aldehyde/module/dtmpl-view-card.tsx +64 -64
  617. package/src/aldehyde/module/dtmpl-view-drawer.tsx +71 -71
  618. package/src/aldehyde/module/dtmpl-view-modal.tsx +56 -56
  619. package/src/aldehyde/module/embed-dtmpl-edit-page.tsx +137 -137
  620. package/src/aldehyde/module/index.less +4 -4
  621. package/src/aldehyde/module/ltmpl-drawer.tsx +60 -60
  622. package/src/aldehyde/module/ltmpl-modal.tsx +63 -63
  623. package/src/aldehyde/module/ltmpl-table.tsx +388 -379
  624. package/src/aldehyde/module/ttmpl-tree.tsx +47 -47
  625. package/src/aldehyde/routable/dtmpl-route.tsx +173 -173
  626. package/src/aldehyde/routable/import-route.tsx +35 -35
  627. package/src/aldehyde/routable/index.less +25 -25
  628. package/src/aldehyde/routable/ltmpl-route.tsx +544 -539
  629. package/src/aldehyde/routable/splitview-ltmpl-route.tsx +382 -377
  630. package/src/aldehyde/routable/ttmpl-route.tsx +93 -93
  631. package/src/aldehyde/routable/withroute.tsx +36 -36
  632. package/src/aldehyde/sso-Login/index.tsx +73 -73
  633. package/src/aldehyde/sso-Login/service/index.js +16 -16
  634. package/src/aldehyde/sso-Login/service/login.js +75 -75
  635. package/src/aldehyde/table/act-table.tsx +1846 -1844
  636. package/src/aldehyde/table/column/column-builder.tsx +882 -876
  637. package/src/aldehyde/table/column/column-selector.tsx +130 -130
  638. package/src/aldehyde/table/column/index.less +85 -85
  639. package/src/aldehyde/table/column/summary-builder.tsx +712 -712
  640. package/src/aldehyde/table/column/theme-color-getter.tsx +25 -25
  641. package/src/aldehyde/table/control-table-x-axis-wrapper.tsx +80 -80
  642. package/src/aldehyde/table/index.css +211 -211
  643. package/src/aldehyde/table/l2-act-table.tsx +91 -91
  644. package/src/aldehyde/table/modal-select-table.tsx +308 -308
  645. package/src/aldehyde/table/page-chart.less +9 -9
  646. package/src/aldehyde/table/page-chart.tsx +196 -196
  647. package/src/aldehyde/table/page-config-button.tsx +203 -203
  648. package/src/aldehyde/table/pagination.css +14 -14
  649. package/src/aldehyde/table/pagination.tsx +81 -81
  650. package/src/aldehyde/table/query-table.tsx +668 -668
  651. package/src/aldehyde/table/relation-table.tsx +1078 -1078
  652. package/src/aldehyde/table/report-table.tsx +125 -125
  653. package/src/aldehyde/table/resizable-table.tsx +97 -97
  654. package/src/aldehyde/table/row-table.tsx +22 -22
  655. package/src/aldehyde/table/select-table.tsx +559 -559
  656. package/src/aldehyde/table/selected-rows-card.tsx +78 -78
  657. package/src/aldehyde/table/stat/restat.tsx +122 -122
  658. package/src/aldehyde/table/table-util.tsx +25 -25
  659. package/src/aldehyde/tmpl/control-type-supportor.tsx +154 -154
  660. package/src/aldehyde/tmpl/hc-data-source.tsx +574 -574
  661. package/src/aldehyde/tmpl/hcservice-v3.tsx +1590 -1590
  662. package/src/aldehyde/tmpl/interface.tsx +939 -936
  663. package/src/aldehyde/tmpl/model-struc-v3.tsx +111 -111
  664. package/src/aldehyde/tmpl/superagent.js +146 -146
  665. package/src/aldehyde/tmpl/tmpl-config-analysis.tsx +585 -585
  666. package/src/aldehyde/tmpl/web-socket.ts +366 -366
  667. package/src/aldehyde/tree/act-tree.tsx +217 -217
  668. package/src/aldehyde/tree/block-menu-auth-tree.tsx +189 -189
  669. package/src/aldehyde/tree/index.css +22 -22
  670. package/src/aldehyde/tree/navigation-tree.tsx +39 -39
  671. package/src/aldehyde/tree/tmpl-tree.tsx +751 -751
  672. package/src/aldehyde/tree/tree-node.tsx +73 -73
  673. package/src/aldehyde/tree/tree-utils.tsx +317 -317
  674. package/src/aldehyde/units/EncryptUtils.js +37 -37
  675. package/src/aldehyde/units/image.d.ts +7 -7
  676. package/src/aldehyde/units/index.tsx +1367 -1367
  677. package/src/aldehyde/units/storage.js +2 -2
  678. package/src/aldehyde/utils/dsu.ts +27 -27
  679. package/src/aldehyde/welcome/HCWelcome.js +404 -404
  680. package/src/aldehyde/welcome/HCWelcome1.js +259 -259
  681. package/src/aldehyde/welcome/components/menu-card.less +96 -96
  682. package/src/aldehyde/welcome/components/menu-card.tsx +70 -70
  683. package/src/aldehyde/welcome/components/page-card.less +49 -49
  684. package/src/aldehyde/welcome/components/page-card.tsx +97 -97
  685. package/src/aldehyde/welcome/components/quick-entrance.less +120 -120
  686. package/src/aldehyde/welcome/components/quick-entrance.tsx +80 -80
  687. package/src/aldehyde/welcome/components/user-menus.less +192 -192
  688. package/src/aldehyde/welcome/components/user-menus.tsx +279 -279
  689. package/src/aldehyde/welcome/components/workbench.less +118 -118
  690. package/src/aldehyde/welcome/components/workbench.tsx +146 -146
  691. package/src/aldehyde/welcome/index.css +13 -13
@@ -1,681 +1,681 @@
1
- import Konva from 'konva';
2
- import { GraphAnchor, Render, AssetInfoPoint } from '../types';
3
- import { GraphDraw, LinkDraw, PreviewDraw } from '../draws';
4
- import { BaseGraph } from './base-graph';
5
-
6
- /**
7
- * 图形 矩形
8
- */
9
- export class Rect extends BaseGraph {
10
- // 实现:更新 图形 的 调整点 的 锚点位置
11
- static override updateAnchorShadows(graph: Konva.Group, anchorShadows: Konva.Circle[]): void {
12
- const { width, height } = graph.size();
13
- for (const shadow of anchorShadows) {
14
- switch (shadow.attrs.adjustType) {
15
- case 'top':
16
- shadow.position({ x: width / 2, y: 0 });
17
- break;
18
- case 'bottom':
19
- shadow.position({ x: width / 2, y: height });
20
- break;
21
- case 'left':
22
- shadow.position({ x: 0, y: height / 2 });
23
- break;
24
- case 'right':
25
- shadow.position({ x: width, y: height / 2 });
26
- break;
27
- case 'top-left':
28
- shadow.position({ x: 0, y: 0 });
29
- break;
30
- case 'top-right':
31
- shadow.position({ x: width, y: 0 });
32
- break;
33
- case 'bottom-left':
34
- shadow.position({ x: 0, y: height });
35
- break;
36
- case 'bottom-right':
37
- shadow.position({ x: width, y: height });
38
- break;
39
- }
40
- }
41
- }
42
-
43
- // 实现:更新 图形 的 连接点 的 锚点位置
44
- static override updateLinkAnchorShadows(graph: Konva.Group, linkAnchorShadows: Konva.Circle[]): void {
45
- const { width, height } = graph.size();
46
- for (const shadow of linkAnchorShadows) {
47
- switch (shadow.attrs.alias) {
48
- case 'top':
49
- shadow.position({ x: width / 2, y: 0 });
50
- break;
51
- case 'bottom':
52
- shadow.position({ x: width / 2, y: height });
53
- break;
54
- case 'left':
55
- shadow.position({ x: 0, y: height / 2 });
56
- break;
57
- case 'right':
58
- shadow.position({ x: width, y: height / 2 });
59
- break;
60
- case 'center':
61
- shadow.position({ x: width / 2, y: height / 2 });
62
- break;
63
- }
64
- }
65
- }
66
-
67
- // 实现:生成 调整点
68
- static override createAnchorShapes(
69
- render: Render,
70
- graph: Konva.Group,
71
- anchorAndShadows: {
72
- anchor: GraphAnchor;
73
- anchorShadow: Konva.Circle;
74
- shape?: Konva.Shape;
75
- }[],
76
- // eslint-disable-next-line
77
- adjustAnchor?: GraphAnchor
78
- ): {
79
- anchorAndShadows: {
80
- anchor: GraphAnchor;
81
- anchorShadow: Konva.Circle;
82
- shape?: Konva.Shape | undefined;
83
- }[];
84
- } {
85
- const stageState = render.getStageState();
86
- for (const anchorAndShadow of anchorAndShadows) {
87
- const { anchor, anchorShadow } = anchorAndShadow;
88
- const x = render.toStageValue(anchorShadow.getAbsolutePosition().x - stageState.x),
89
- y = render.toStageValue(anchorShadow.getAbsolutePosition().y - stageState.y);
90
- const offset = render.toStageValue(render.pointSize + 5);
91
- const anchorShape = new Konva.Line({
92
- name: 'anchor',
93
- anchor: anchor,
94
- stroke: `rgba(0,0,255,0.4)`,
95
- strokeWidth: render.toStageValue(2),
96
- hitStrokeWidth: render.toStageValue(3),
97
- x,
98
- y,
99
- points: {
100
- 'top-left': [[-offset, offset / 2], [-offset, -offset], [offset / 2, -offset]].flat(),
101
- top: [[-offset, -offset], [offset, -offset]].flat(),
102
- 'top-right': [[-offset / 2, -offset], [offset, -offset], [offset, offset / 2]].flat(),
103
- right: [[offset, -offset], [offset, offset]].flat(),
104
- 'bottom-right': [[-offset / 2, offset], [offset, offset], [offset, -offset / 2]].flat(),
105
- bottom: [[-offset, offset], [offset, offset]].flat(),
106
- 'bottom-left': [[-offset, -offset / 2], [-offset, offset], [offset / 2, offset]].flat(),
107
- left: [[-offset, -offset], [-offset, offset]].flat()
108
- }[anchor.adjustType] ?? [],
109
- rotation: graph.getAbsoluteRotation(), // 旋转角度
110
- visible: graph.attrs.adjusting || graph.attrs.hover === true
111
- });
112
- anchorShape.on('mouseenter', () => {
113
- document.body.style.cursor = 'move';
114
- graph.setAttr('hover', true);
115
- graph.setAttr('hoverAnchor', true);
116
- });
117
- anchorShape.on('mouseleave', () => {
118
- document.body.style.cursor = anchorShape.attrs.adjusting ? 'move' : 'default';
119
- graph.setAttr('hover', false);
120
- graph.setAttr('hoverAnchor', false);
121
- render.redraw([GraphDraw.NAME]);
122
- });
123
- anchorAndShadow.shape = anchorShape;
124
- }
125
- return { anchorAndShadows };
126
- }
127
-
128
- // 实现:调整 图形
129
- static override adjust(
130
- render: Render,
131
- graph: Konva.Group,
132
- graphSnap: Konva.Group,
133
- adjustShape: Konva.Shape,
134
- anchorAndShadows: {
135
- anchor: GraphAnchor;
136
- anchorShadow: Konva.Circle;
137
- shape?: Konva.Shape | undefined;
138
- }[],
139
- startPoint: Konva.Vector2d,
140
- endPoint: Konva.Vector2d,
141
- hoverRect?: Konva.Rect
142
- ) {
143
- // 目标 矩形
144
- const rect = graph.findOne('.graph') as Konva.Rect;
145
- const rectSnap = graphSnap.findOne('.graph') as Konva.Rect;
146
- const anchors = (graph.find('.anchor') ?? []) as Konva.Circle[];
147
- const anchorsSnap = (graphSnap.find('.anchor') ?? []) as Konva.Circle[];
148
- const linkAnchors = (graph.find('.link-anchor') ?? []) as Konva.Circle[];
149
- if (rect && rectSnap) {
150
- const [graphRotation, adjustType, ex, ey] = [
151
- Math.round(graph.rotation()),
152
- adjustShape.attrs.anchor?.adjustType,
153
- endPoint.x,
154
- endPoint.y
155
- ];
156
- let anchorShadow: Konva.Circle | undefined, anchorShadowAcross: Konva.Circle | undefined;
157
- switch (adjustType) {
158
- case 'top':
159
- anchorShadow = anchorsSnap.find((o) => o.attrs.adjustType === 'top');
160
- anchorShadowAcross = anchorsSnap.find((o) => o.attrs.adjustType === 'bottom');
161
- break;
162
- case 'bottom':
163
- anchorShadow = anchorsSnap.find((o) => o.attrs.adjustType === 'bottom');
164
- anchorShadowAcross = anchorsSnap.find((o) => o.attrs.adjustType === 'top');
165
- break;
166
- case 'left':
167
- anchorShadow = anchorsSnap.find((o) => o.attrs.adjustType === 'left');
168
- anchorShadowAcross = anchorsSnap.find((o) => o.attrs.adjustType === 'right');
169
- break;
170
- case 'right':
171
- anchorShadow = anchorsSnap.find((o) => o.attrs.adjustType === 'right');
172
- anchorShadowAcross = anchorsSnap.find((o) => o.attrs.adjustType === 'left');
173
- break;
174
- case 'top-left':
175
- anchorShadow = anchorsSnap.find((o) => o.attrs.adjustType === 'top-left');
176
- anchorShadowAcross = anchorsSnap.find((o) => o.attrs.adjustType === 'bottom-right');
177
- break;
178
- case 'top-right':
179
- anchorShadow = anchorsSnap.find((o) => o.attrs.adjustType === 'top-right');
180
- anchorShadowAcross = anchorsSnap.find((o) => o.attrs.adjustType === 'bottom-left');
181
- break;
182
- case 'bottom-left':
183
- anchorShadow = anchorsSnap.find((o) => o.attrs.adjustType === 'bottom-left');
184
- anchorShadowAcross = anchorsSnap.find((o) => o.attrs.adjustType === 'top-right');
185
- break;
186
- case 'bottom-right':
187
- anchorShadow = anchorsSnap.find((o) => o.attrs.adjustType === 'bottom-right');
188
- anchorShadowAcross = anchorsSnap.find((o) => o.attrs.adjustType === 'top-left');
189
- break;
190
- }
191
- if (anchorShadow && anchorShadowAcross) {
192
- const { x: sx, y: sy } = anchorShadow.getAbsolutePosition();
193
- const { x: ax, y: ay } = anchorShadowAcross.getAbsolutePosition();
194
- {
195
- const d1 = Math.sqrt(Math.pow(sx - ax, 2) + Math.pow(sy - ay, 2));
196
- const d2 = Math.sqrt(Math.pow(ex - ax, 2) + Math.pow(ey - ay, 2));
197
- const r1 = d2 / d1;
198
- let zeroWidth = 1, zeroHeight = 1;
199
- switch (adjustType) {
200
- case 'top':
201
- if (graphRotation >= 45 && graphRotation < 135) {
202
- zeroHeight = ex <= ax ? 0 : 1;
203
- } else if (graphRotation >= -135 && graphRotation < -45) {
204
- zeroHeight = ex >= ax ? 0 : 1;
205
- } else if (graphRotation >= -45 && graphRotation < 45) {
206
- zeroHeight = ey >= ay ? 0 : 1;
207
- } else {
208
- zeroHeight = ey <= ay ? 0 : 1;
209
- }
210
- break;
211
- case 'bottom':
212
- if (graphRotation >= 45 && graphRotation < 135) {
213
- zeroHeight = ex <= ax ? 1 : 0;
214
- } else if (graphRotation >= -135 && graphRotation < -45) {
215
- zeroHeight = ex >= ax ? 1 : 0;
216
- } else if (graphRotation >= -45 && graphRotation < 45) {
217
- zeroHeight = ey >= ay ? 1 : 0;
218
- } else {
219
- zeroHeight = ey <= ay ? 1 : 0;
220
- }
221
- break;
222
- case 'left':
223
- if (graphRotation >= 45 && graphRotation < 135) {
224
- zeroWidth = ey >= ay ? 0 : 1;
225
- } else if (graphRotation >= -135 && graphRotation < -45) {
226
- zeroWidth = ex <= ax ? 0 : 1;
227
- } else if (graphRotation >= -45 && graphRotation < 45) {
228
- zeroWidth = ex >= ax ? 0 : 1;
229
- } else {
230
- zeroWidth = ey <= ay ? 0 : 1;
231
- }
232
- break;
233
- case 'right':
234
- if (graphRotation >= 45 && graphRotation < 135) {
235
- zeroWidth = ey >= ay ? 1 : 0;
236
- } else if (graphRotation >= -135 && graphRotation < -45) {
237
- zeroWidth = ex <= ax ? 1 : 0;
238
- } else if (graphRotation >= -45 && graphRotation < 45) {
239
- zeroWidth = ex >= ax ? 1 : 0;
240
- } else {
241
- zeroWidth = ey <= ay ? 1 : 0;
242
- }
243
- break;
244
- case 'top-left':
245
- if (graphRotation > -45 && graphRotation < 45) {
246
- if (ex >= ax && ey >= ay) {
247
- zeroWidth = 0;
248
- zeroHeight = 0;
249
- } else {
250
- zeroWidth = 1;
251
- zeroHeight = 1;
252
- }
253
- } else if (graphRotation === 45) {
254
- if (ey >= ay) {
255
- zeroWidth = 0;
256
- zeroHeight = 0;
257
- } else {
258
- zeroWidth = 1;
259
- zeroHeight = 1;
260
- }
261
- } else if (graphRotation > 45 && graphRotation < 135) {
262
- if (ex <= ax && ey >= ay) {
263
- zeroWidth = 0;
264
- zeroHeight = 0;
265
- } else {
266
- zeroWidth = 1;
267
- zeroHeight = 1;
268
- }
269
- } else if (graphRotation === 135) {
270
- if (ex <= ax) {
271
- zeroWidth = 0;
272
- zeroHeight = 0;
273
- } else {
274
- zeroWidth = 1;
275
- zeroHeight = 1;
276
- }
277
- } else if ((graphRotation > 135 && graphRotation <= 180) || (graphRotation >= -180 && graphRotation < -135)) {
278
- if (ex <= ax && ey <= ay) {
279
- zeroWidth = 0;
280
- zeroHeight = 0;
281
- } else {
282
- zeroWidth = 1;
283
- zeroHeight = 1;
284
- }
285
- } else if (graphRotation === -135) {
286
- if (ey <= ay) {
287
- zeroWidth = 0;
288
- zeroHeight = 0;
289
- } else {
290
- zeroWidth = 1;
291
- zeroHeight = 1;
292
- }
293
- } else if (graphRotation > -135 && graphRotation < -45) {
294
- if (ex >= ax && ey <= ay) {
295
- zeroWidth = 0;
296
- zeroHeight = 0;
297
- } else {
298
- zeroWidth = 1;
299
- zeroHeight = 1;
300
- }
301
- } else if (graphRotation === -45) {
302
- if (ex >= ax) {
303
- zeroWidth = 0;
304
- zeroHeight = 0;
305
- } else {
306
- zeroWidth = 1;
307
- zeroHeight = 1;
308
- }
309
- }
310
- break;
311
- case 'top-right':
312
- if (graphRotation > -45 && graphRotation < 45) {
313
- if (ex <= ax && ey >= ay) {
314
- zeroWidth = 0;
315
- zeroHeight = 0;
316
- } else {
317
- zeroWidth = 1;
318
- zeroHeight = 1;
319
- }
320
- } else if (graphRotation === 45) {
321
- if (ex <= ax) {
322
- zeroWidth = 0;
323
- zeroHeight = 0;
324
- } else {
325
- zeroWidth = 1;
326
- zeroHeight = 1;
327
- }
328
- } else if (graphRotation > 45 && graphRotation < 135) {
329
- if (ex <= ax && ey <= ay) {
330
- zeroWidth = 0;
331
- zeroHeight = 0;
332
- } else {
333
- zeroWidth = 1;
334
- zeroHeight = 1;
335
- }
336
- } else if (graphRotation === 135) {
337
- if (ey <= ay) {
338
- zeroWidth = 0;
339
- zeroHeight = 0;
340
- } else {
341
- zeroWidth = 1;
342
- zeroHeight = 1;
343
- }
344
- } else if ((graphRotation > 135 && graphRotation <= 180) || (graphRotation >= -180 && graphRotation < -135)) {
345
- if (ex >= ax && ey <= ay) {
346
- zeroWidth = 0;
347
- zeroHeight = 0;
348
- } else {
349
- zeroWidth = 1;
350
- zeroHeight = 1;
351
- }
352
- } else if (graphRotation === -135) {
353
- if (ex >= ax) {
354
- zeroWidth = 0;
355
- zeroHeight = 0;
356
- } else {
357
- zeroWidth = 1;
358
- zeroHeight = 1;
359
- }
360
- } else if (graphRotation > -135 && graphRotation < -45) {
361
- if (ex >= ax && ey >= ay) {
362
- zeroWidth = 0;
363
- zeroHeight = 0;
364
- } else {
365
- zeroWidth = 1;
366
- zeroHeight = 1;
367
- }
368
- } else if (graphRotation === -45) {
369
- if (ey >= ay) {
370
- zeroWidth = 0;
371
- zeroHeight = 0;
372
- } else {
373
- zeroWidth = 1;
374
- zeroHeight = 1;
375
- }
376
- }
377
- break;
378
- case 'bottom-left':
379
- if (graphRotation > -45 && graphRotation < 45) {
380
- if (ex >= ax && ey <= ay) {
381
- zeroWidth = 0;
382
- zeroHeight = 0;
383
- } else {
384
- zeroWidth = 1;
385
- zeroHeight = 1;
386
- }
387
- } else if (graphRotation === 45) {
388
- if (ex >= ax) {
389
- zeroWidth = 0;
390
- zeroHeight = 0;
391
- } else {
392
- zeroWidth = 1;
393
- zeroHeight = 1;
394
- }
395
- } else if (graphRotation > 45 && graphRotation < 135) {
396
- if (ex >= ax && ey >= ay) {
397
- zeroWidth = 0;
398
- zeroHeight = 0;
399
- } else {
400
- zeroWidth = 1;
401
- zeroHeight = 1;
402
- }
403
- } else if (graphRotation === 135) {
404
- if (ey >= ay) {
405
- zeroWidth = 0;
406
- zeroHeight = 0;
407
- } else {
408
- zeroWidth = 1;
409
- zeroHeight = 1;
410
- }
411
- } else if ((graphRotation > 135 && graphRotation <= 180) || (graphRotation >= -180 && graphRotation < -135)) {
412
- if (ex <= ax && ey >= ay) {
413
- zeroWidth = 0;
414
- zeroHeight = 0;
415
- } else {
416
- zeroWidth = 1;
417
- zeroHeight = 1;
418
- }
419
- } else if (graphRotation === -135) {
420
- if (ex <= ax) {
421
- zeroWidth = 0;
422
- zeroHeight = 0;
423
- } else {
424
- zeroWidth = 1;
425
- zeroHeight = 1;
426
- }
427
- } else if (graphRotation > -135 && graphRotation < -45) {
428
- if (ex <= ax && ey <= ay) {
429
- zeroWidth = 0;
430
- zeroHeight = 0;
431
- } else {
432
- zeroWidth = 1;
433
- zeroHeight = 1;
434
- }
435
- } else if (graphRotation === -45) {
436
- if (ey <= ay) {
437
- zeroWidth = 0;
438
- zeroHeight = 0;
439
- } else {
440
- zeroWidth = 1;
441
- zeroHeight = 1;
442
- }
443
- }
444
- break;
445
- case 'bottom-right':
446
- if (graphRotation > -45 && graphRotation < 45) {
447
- if (ex <= ax && ey <= ay) {
448
- zeroWidth = 0;
449
- zeroHeight = 0;
450
- } else {
451
- zeroWidth = 1;
452
- zeroHeight = 1;
453
- }
454
- } else if (graphRotation === 45) {
455
- if (ey <= ay) {
456
- zeroWidth = 0;
457
- zeroHeight = 0;
458
- } else {
459
- zeroWidth = 1;
460
- zeroHeight = 1;
461
- }
462
- } else if (graphRotation > 45 && graphRotation < 135) {
463
- if (ex >= ax && ey <= ay) {
464
- zeroWidth = 0;
465
- zeroHeight = 0;
466
- } else {
467
- zeroWidth = 1;
468
- zeroHeight = 1;
469
- }
470
- } else if (graphRotation === 135) {
471
- if (ex >= ax) {
472
- zeroWidth = 0;
473
- zeroHeight = 0;
474
- } else {
475
- zeroWidth = 1;
476
- zeroHeight = 1;
477
- }
478
- } else if ((graphRotation > 135 && graphRotation <= 180) || (graphRotation >= -180 && graphRotation < -135)) {
479
- if (ex >= ax && ey >= ay) {
480
- zeroWidth = 0;
481
- zeroHeight = 0;
482
- } else {
483
- zeroWidth = 1;
484
- zeroHeight = 1;
485
- }
486
- } else if (graphRotation === -135) {
487
- if (ey >= ay) {
488
- zeroWidth = 0;
489
- zeroHeight = 0;
490
- } else {
491
- zeroWidth = 1;
492
- zeroHeight = 1;
493
- }
494
- } else if (graphRotation > -135 && graphRotation < -45) {
495
- if (ex <= ax && ey >= ay) {
496
- zeroWidth = 0;
497
- zeroHeight = 0;
498
- } else {
499
- zeroWidth = 1;
500
- zeroHeight = 1;
501
- }
502
- } else if (graphRotation === -45) {
503
- if (ex <= ax) {
504
- zeroWidth = 0;
505
- zeroHeight = 0;
506
- } else {
507
- zeroWidth = 1;
508
- zeroHeight = 1;
509
- }
510
- }
511
- break;
512
- }
513
- if (/-?(left|right)$/.test(adjustType)) {
514
- graph.width(Math.max(2, graphSnap.width() * r1 * zeroWidth));
515
- }
516
- if (/^(top|bottom)-?/.test(adjustType)) {
517
- graph.height(Math.max(2, graphSnap.height() * r1 * zeroHeight));
518
- }
519
- }
520
- {
521
- const [graphWidth, graphHeight] = [graph.width() * graph.scaleX(), graph.height() * graph.scaleY()];
522
- const cos = Math.cos((graphRotation * Math.PI) / 180);
523
- const sin = Math.sin((graphRotation * Math.PI) / 180);
524
- const tan = Math.tan((graphRotation * Math.PI) / 180);
525
- switch (adjustType) {
526
- case 'top':
527
- graph.x(ax - (graphWidth / 2 - graphHeight * tan) * cos);
528
- if (graphRotation !== 90 && graphRotation !== -90) {
529
- graph.y(ay - (graphHeight / cos + (graphWidth / 2 - graphHeight * tan) * sin));
530
- }
531
- break;
532
- case 'bottom': // 无需处理
533
- break;
534
- case 'left':
535
- if ([90, -90].includes(graphRotation)) {
536
- graph.y(ay - graphWidth);
537
- } else if (Math.abs(graphRotation) === 180) {
538
- graph.x(ax + graphWidth);
539
- } else {
540
- const v1 = graphHeight / 2 / cos;
541
- const v2 = v1 * sin;
542
- const v3 = graphWidth - v2;
543
- const v4 = v3 * sin;
544
- graph.x(ax - v3 * cos);
545
- graph.y(ay - (v1 + v4));
546
- }
547
- break;
548
- case 'right': // 无需处理
549
- break;
550
- case 'top-left':
551
- graph.x(ax - (graphWidth - graphHeight * tan) * cos);
552
- graph.y(ay - (graphWidth * sin + graphHeight * cos));
553
- break;
554
- case 'top-right':
555
- graph.x(ax + graphHeight * sin);
556
- graph.y(ay - graphHeight * cos);
557
- break;
558
- case 'bottom-left':
559
- graph.x(ax - graphWidth * cos);
560
- graph.y(ay - graphWidth * sin);
561
- break;
562
- case 'bottom-right': // 无需处理
563
- break;
564
- }
565
- }
566
- }
567
- const [graphWidth, graphHeight] = [graph.width(), graph.height()];
568
- // 更新 矩形 大小
569
- rect.width(graphWidth);
570
- rect.height(graphHeight);
571
- // 更新 调整点 的 锚点 位置
572
- Rect.updateAnchorShadows(graph, anchors);
573
- // 更新 图形 的 连接点 的 锚点位置
574
- Rect.updateLinkAnchorShadows(graph, linkAnchors);
575
- const stageState = render.getStageState();
576
- // 更新 调整点 位置
577
- for (const anchor of anchors) {
578
- for (const { shape } of anchorAndShadows) {
579
- if (shape) {
580
- if (shape.attrs.anchor?.adjustType === anchor.attrs.adjustType) {
581
- const anchorShadow = graph.find(`.anchor`).find((o) => o.attrs.adjustType === anchor.attrs.adjustType);
582
- if (anchorShadow) {
583
- shape.position({
584
- x: render.toStageValue(anchorShadow.getAbsolutePosition().x - stageState.x),
585
- y: render.toStageValue(anchorShadow.getAbsolutePosition().y - stageState.y)
586
- });
587
- shape.rotation(graph.getAbsoluteRotation());
588
- }
589
- }
590
- }
591
- }
592
- }
593
- render.redraw([GraphDraw.NAME, LinkDraw.NAME, PreviewDraw.NAME]);
594
- }
595
- BaseGraph.adjust(render, graph, graphSnap, adjustShape, anchorAndShadows, startPoint, endPoint, hoverRect);
596
- }
597
-
598
- /**
599
- * 提供给 GraphDraw draw 使用
600
- */
601
- static override draw(graph: Konva.Group, render: Render, adjustAnchor?: GraphAnchor) {
602
- // 调整点 及其 锚点
603
- const { anchorAndShadows } = super.draw(graph, render, adjustAnchor);
604
- return Rect.createAnchorShapes(render, graph, anchorAndShadows, adjustAnchor);
605
- }
606
-
607
- /**
608
- * 默认图形大小
609
- */
610
- static size = 100;
611
-
612
- /**
613
- * 矩形 对应的 Konva 实例
614
- */
615
- private rect: Konva.Rect;
616
-
617
- constructor(render: Render, dropPoint: Konva.Vector2d) {
618
- super(render, dropPoint, {
619
- type: "Rect",
620
- anchors: [
621
- { adjustType: 'top' },
622
- { adjustType: 'bottom' },
623
- { adjustType: 'left' },
624
- { adjustType: 'right' },
625
- { adjustType: 'top-left' },
626
- { adjustType: 'top-right' },
627
- { adjustType: 'bottom-left' },
628
- { adjustType: 'bottom-right' }
629
- ].map((o) => ({ adjustType: o.adjustType })),
630
- linkAnchors: [
631
- { x: 0, y: 0, alias: 'top', direction: 'top' },
632
- { x: 0, y: 0, alias: 'bottom', direction: 'bottom' },
633
- { x: 0, y: 0, alias: 'left', direction: 'left' },
634
- { x: 0, y: 0, alias: 'right', direction: 'right' },
635
- { x: 0, y: 0, alias: 'center' }
636
- ] as AssetInfoPoint[]
637
- });
638
- this.rect = new Konva.Rect({
639
- name: 'graph',
640
- x: 0,
641
- y: 0,
642
- width: 0,
643
- height: 0,
644
- stroke: "#000000",
645
- strokeWidth: 1,
646
- });
647
- this.group.add(this.rect);
648
- this.group.position(this.dropPoint);
649
- }
650
-
651
- // 实现:拖动进行时
652
- override drawMove(point: Konva.Vector2d): void {
653
- let offsetX = point.x - this.dropPoint.x,
654
- offsetY = point.y - this.dropPoint.y;
655
- if (offsetX < 1) offsetX = 1;
656
- if (offsetY < 1) offsetY = 1;
657
- // 矩形 位置大小
658
- this.rect.width(offsetX);
659
- this.rect.height(offsetY);
660
- this.group.size({ width: offsetX, height: offsetY });
661
- Rect.updateAnchorShadows(this.group, this.anchorShadows);
662
- Rect.updateLinkAnchorShadows(this.group, this.linkAnchorShadows);
663
- this.render.redraw([GraphDraw.NAME, LinkDraw.NAME, PreviewDraw.NAME]);
664
- }
665
-
666
- // 实现:拖动结束
667
- override drawEnd(): void {
668
- if (this.rect.width() <= 1 && this.rect.height() <= 1) {
669
- const width = Rect.size, height = width;
670
- this.rect.width(width - this.rect.strokeWidth());
671
- this.rect.height(height - this.rect.strokeWidth());
672
- this.group.size({ width, height });
673
- Rect.updateAnchorShadows(this.group, this.anchorShadows);
674
- Rect.updateLinkAnchorShadows(this.group, this.linkAnchorShadows);
675
- this.render.attractTool.alignLinesClear();
676
- this.render.updateHistory();
677
- this.render.redraw([GraphDraw.NAME, LinkDraw.NAME, PreviewDraw.NAME]);
678
- }
679
- super.drawEnd();
680
- }
1
+ import Konva from 'konva';
2
+ import { GraphAnchor, Render, AssetInfoPoint } from '../types';
3
+ import { GraphDraw, LinkDraw, PreviewDraw } from '../draws';
4
+ import { BaseGraph } from './base-graph';
5
+
6
+ /**
7
+ * 图形 矩形
8
+ */
9
+ export class Rect extends BaseGraph {
10
+ // 实现:更新 图形 的 调整点 的 锚点位置
11
+ static override updateAnchorShadows(graph: Konva.Group, anchorShadows: Konva.Circle[]): void {
12
+ const { width, height } = graph.size();
13
+ for (const shadow of anchorShadows) {
14
+ switch (shadow.attrs.adjustType) {
15
+ case 'top':
16
+ shadow.position({ x: width / 2, y: 0 });
17
+ break;
18
+ case 'bottom':
19
+ shadow.position({ x: width / 2, y: height });
20
+ break;
21
+ case 'left':
22
+ shadow.position({ x: 0, y: height / 2 });
23
+ break;
24
+ case 'right':
25
+ shadow.position({ x: width, y: height / 2 });
26
+ break;
27
+ case 'top-left':
28
+ shadow.position({ x: 0, y: 0 });
29
+ break;
30
+ case 'top-right':
31
+ shadow.position({ x: width, y: 0 });
32
+ break;
33
+ case 'bottom-left':
34
+ shadow.position({ x: 0, y: height });
35
+ break;
36
+ case 'bottom-right':
37
+ shadow.position({ x: width, y: height });
38
+ break;
39
+ }
40
+ }
41
+ }
42
+
43
+ // 实现:更新 图形 的 连接点 的 锚点位置
44
+ static override updateLinkAnchorShadows(graph: Konva.Group, linkAnchorShadows: Konva.Circle[]): void {
45
+ const { width, height } = graph.size();
46
+ for (const shadow of linkAnchorShadows) {
47
+ switch (shadow.attrs.alias) {
48
+ case 'top':
49
+ shadow.position({ x: width / 2, y: 0 });
50
+ break;
51
+ case 'bottom':
52
+ shadow.position({ x: width / 2, y: height });
53
+ break;
54
+ case 'left':
55
+ shadow.position({ x: 0, y: height / 2 });
56
+ break;
57
+ case 'right':
58
+ shadow.position({ x: width, y: height / 2 });
59
+ break;
60
+ case 'center':
61
+ shadow.position({ x: width / 2, y: height / 2 });
62
+ break;
63
+ }
64
+ }
65
+ }
66
+
67
+ // 实现:生成 调整点
68
+ static override createAnchorShapes(
69
+ render: Render,
70
+ graph: Konva.Group,
71
+ anchorAndShadows: {
72
+ anchor: GraphAnchor;
73
+ anchorShadow: Konva.Circle;
74
+ shape?: Konva.Shape;
75
+ }[],
76
+ // eslint-disable-next-line
77
+ adjustAnchor?: GraphAnchor
78
+ ): {
79
+ anchorAndShadows: {
80
+ anchor: GraphAnchor;
81
+ anchorShadow: Konva.Circle;
82
+ shape?: Konva.Shape | undefined;
83
+ }[];
84
+ } {
85
+ const stageState = render.getStageState();
86
+ for (const anchorAndShadow of anchorAndShadows) {
87
+ const { anchor, anchorShadow } = anchorAndShadow;
88
+ const x = render.toStageValue(anchorShadow.getAbsolutePosition().x - stageState.x),
89
+ y = render.toStageValue(anchorShadow.getAbsolutePosition().y - stageState.y);
90
+ const offset = render.toStageValue(render.pointSize + 5);
91
+ const anchorShape = new Konva.Line({
92
+ name: 'anchor',
93
+ anchor: anchor,
94
+ stroke: `rgba(0,0,255,0.4)`,
95
+ strokeWidth: render.toStageValue(2),
96
+ hitStrokeWidth: render.toStageValue(3),
97
+ x,
98
+ y,
99
+ points: {
100
+ 'top-left': [[-offset, offset / 2], [-offset, -offset], [offset / 2, -offset]].flat(),
101
+ top: [[-offset, -offset], [offset, -offset]].flat(),
102
+ 'top-right': [[-offset / 2, -offset], [offset, -offset], [offset, offset / 2]].flat(),
103
+ right: [[offset, -offset], [offset, offset]].flat(),
104
+ 'bottom-right': [[-offset / 2, offset], [offset, offset], [offset, -offset / 2]].flat(),
105
+ bottom: [[-offset, offset], [offset, offset]].flat(),
106
+ 'bottom-left': [[-offset, -offset / 2], [-offset, offset], [offset / 2, offset]].flat(),
107
+ left: [[-offset, -offset], [-offset, offset]].flat()
108
+ }[anchor.adjustType] ?? [],
109
+ rotation: graph.getAbsoluteRotation(), // 旋转角度
110
+ visible: graph.attrs.adjusting || graph.attrs.hover === true
111
+ });
112
+ anchorShape.on('mouseenter', () => {
113
+ document.body.style.cursor = 'move';
114
+ graph.setAttr('hover', true);
115
+ graph.setAttr('hoverAnchor', true);
116
+ });
117
+ anchorShape.on('mouseleave', () => {
118
+ document.body.style.cursor = anchorShape.attrs.adjusting ? 'move' : 'default';
119
+ graph.setAttr('hover', false);
120
+ graph.setAttr('hoverAnchor', false);
121
+ render.redraw([GraphDraw.NAME]);
122
+ });
123
+ anchorAndShadow.shape = anchorShape;
124
+ }
125
+ return { anchorAndShadows };
126
+ }
127
+
128
+ // 实现:调整 图形
129
+ static override adjust(
130
+ render: Render,
131
+ graph: Konva.Group,
132
+ graphSnap: Konva.Group,
133
+ adjustShape: Konva.Shape,
134
+ anchorAndShadows: {
135
+ anchor: GraphAnchor;
136
+ anchorShadow: Konva.Circle;
137
+ shape?: Konva.Shape | undefined;
138
+ }[],
139
+ startPoint: Konva.Vector2d,
140
+ endPoint: Konva.Vector2d,
141
+ hoverRect?: Konva.Rect
142
+ ) {
143
+ // 目标 矩形
144
+ const rect = graph.findOne('.graph') as Konva.Rect;
145
+ const rectSnap = graphSnap.findOne('.graph') as Konva.Rect;
146
+ const anchors = (graph.find('.anchor') ?? []) as Konva.Circle[];
147
+ const anchorsSnap = (graphSnap.find('.anchor') ?? []) as Konva.Circle[];
148
+ const linkAnchors = (graph.find('.link-anchor') ?? []) as Konva.Circle[];
149
+ if (rect && rectSnap) {
150
+ const [graphRotation, adjustType, ex, ey] = [
151
+ Math.round(graph.rotation()),
152
+ adjustShape.attrs.anchor?.adjustType,
153
+ endPoint.x,
154
+ endPoint.y
155
+ ];
156
+ let anchorShadow: Konva.Circle | undefined, anchorShadowAcross: Konva.Circle | undefined;
157
+ switch (adjustType) {
158
+ case 'top':
159
+ anchorShadow = anchorsSnap.find((o) => o.attrs.adjustType === 'top');
160
+ anchorShadowAcross = anchorsSnap.find((o) => o.attrs.adjustType === 'bottom');
161
+ break;
162
+ case 'bottom':
163
+ anchorShadow = anchorsSnap.find((o) => o.attrs.adjustType === 'bottom');
164
+ anchorShadowAcross = anchorsSnap.find((o) => o.attrs.adjustType === 'top');
165
+ break;
166
+ case 'left':
167
+ anchorShadow = anchorsSnap.find((o) => o.attrs.adjustType === 'left');
168
+ anchorShadowAcross = anchorsSnap.find((o) => o.attrs.adjustType === 'right');
169
+ break;
170
+ case 'right':
171
+ anchorShadow = anchorsSnap.find((o) => o.attrs.adjustType === 'right');
172
+ anchorShadowAcross = anchorsSnap.find((o) => o.attrs.adjustType === 'left');
173
+ break;
174
+ case 'top-left':
175
+ anchorShadow = anchorsSnap.find((o) => o.attrs.adjustType === 'top-left');
176
+ anchorShadowAcross = anchorsSnap.find((o) => o.attrs.adjustType === 'bottom-right');
177
+ break;
178
+ case 'top-right':
179
+ anchorShadow = anchorsSnap.find((o) => o.attrs.adjustType === 'top-right');
180
+ anchorShadowAcross = anchorsSnap.find((o) => o.attrs.adjustType === 'bottom-left');
181
+ break;
182
+ case 'bottom-left':
183
+ anchorShadow = anchorsSnap.find((o) => o.attrs.adjustType === 'bottom-left');
184
+ anchorShadowAcross = anchorsSnap.find((o) => o.attrs.adjustType === 'top-right');
185
+ break;
186
+ case 'bottom-right':
187
+ anchorShadow = anchorsSnap.find((o) => o.attrs.adjustType === 'bottom-right');
188
+ anchorShadowAcross = anchorsSnap.find((o) => o.attrs.adjustType === 'top-left');
189
+ break;
190
+ }
191
+ if (anchorShadow && anchorShadowAcross) {
192
+ const { x: sx, y: sy } = anchorShadow.getAbsolutePosition();
193
+ const { x: ax, y: ay } = anchorShadowAcross.getAbsolutePosition();
194
+ {
195
+ const d1 = Math.sqrt(Math.pow(sx - ax, 2) + Math.pow(sy - ay, 2));
196
+ const d2 = Math.sqrt(Math.pow(ex - ax, 2) + Math.pow(ey - ay, 2));
197
+ const r1 = d2 / d1;
198
+ let zeroWidth = 1, zeroHeight = 1;
199
+ switch (adjustType) {
200
+ case 'top':
201
+ if (graphRotation >= 45 && graphRotation < 135) {
202
+ zeroHeight = ex <= ax ? 0 : 1;
203
+ } else if (graphRotation >= -135 && graphRotation < -45) {
204
+ zeroHeight = ex >= ax ? 0 : 1;
205
+ } else if (graphRotation >= -45 && graphRotation < 45) {
206
+ zeroHeight = ey >= ay ? 0 : 1;
207
+ } else {
208
+ zeroHeight = ey <= ay ? 0 : 1;
209
+ }
210
+ break;
211
+ case 'bottom':
212
+ if (graphRotation >= 45 && graphRotation < 135) {
213
+ zeroHeight = ex <= ax ? 1 : 0;
214
+ } else if (graphRotation >= -135 && graphRotation < -45) {
215
+ zeroHeight = ex >= ax ? 1 : 0;
216
+ } else if (graphRotation >= -45 && graphRotation < 45) {
217
+ zeroHeight = ey >= ay ? 1 : 0;
218
+ } else {
219
+ zeroHeight = ey <= ay ? 1 : 0;
220
+ }
221
+ break;
222
+ case 'left':
223
+ if (graphRotation >= 45 && graphRotation < 135) {
224
+ zeroWidth = ey >= ay ? 0 : 1;
225
+ } else if (graphRotation >= -135 && graphRotation < -45) {
226
+ zeroWidth = ex <= ax ? 0 : 1;
227
+ } else if (graphRotation >= -45 && graphRotation < 45) {
228
+ zeroWidth = ex >= ax ? 0 : 1;
229
+ } else {
230
+ zeroWidth = ey <= ay ? 0 : 1;
231
+ }
232
+ break;
233
+ case 'right':
234
+ if (graphRotation >= 45 && graphRotation < 135) {
235
+ zeroWidth = ey >= ay ? 1 : 0;
236
+ } else if (graphRotation >= -135 && graphRotation < -45) {
237
+ zeroWidth = ex <= ax ? 1 : 0;
238
+ } else if (graphRotation >= -45 && graphRotation < 45) {
239
+ zeroWidth = ex >= ax ? 1 : 0;
240
+ } else {
241
+ zeroWidth = ey <= ay ? 1 : 0;
242
+ }
243
+ break;
244
+ case 'top-left':
245
+ if (graphRotation > -45 && graphRotation < 45) {
246
+ if (ex >= ax && ey >= ay) {
247
+ zeroWidth = 0;
248
+ zeroHeight = 0;
249
+ } else {
250
+ zeroWidth = 1;
251
+ zeroHeight = 1;
252
+ }
253
+ } else if (graphRotation === 45) {
254
+ if (ey >= ay) {
255
+ zeroWidth = 0;
256
+ zeroHeight = 0;
257
+ } else {
258
+ zeroWidth = 1;
259
+ zeroHeight = 1;
260
+ }
261
+ } else if (graphRotation > 45 && graphRotation < 135) {
262
+ if (ex <= ax && ey >= ay) {
263
+ zeroWidth = 0;
264
+ zeroHeight = 0;
265
+ } else {
266
+ zeroWidth = 1;
267
+ zeroHeight = 1;
268
+ }
269
+ } else if (graphRotation === 135) {
270
+ if (ex <= ax) {
271
+ zeroWidth = 0;
272
+ zeroHeight = 0;
273
+ } else {
274
+ zeroWidth = 1;
275
+ zeroHeight = 1;
276
+ }
277
+ } else if ((graphRotation > 135 && graphRotation <= 180) || (graphRotation >= -180 && graphRotation < -135)) {
278
+ if (ex <= ax && ey <= ay) {
279
+ zeroWidth = 0;
280
+ zeroHeight = 0;
281
+ } else {
282
+ zeroWidth = 1;
283
+ zeroHeight = 1;
284
+ }
285
+ } else if (graphRotation === -135) {
286
+ if (ey <= ay) {
287
+ zeroWidth = 0;
288
+ zeroHeight = 0;
289
+ } else {
290
+ zeroWidth = 1;
291
+ zeroHeight = 1;
292
+ }
293
+ } else if (graphRotation > -135 && graphRotation < -45) {
294
+ if (ex >= ax && ey <= ay) {
295
+ zeroWidth = 0;
296
+ zeroHeight = 0;
297
+ } else {
298
+ zeroWidth = 1;
299
+ zeroHeight = 1;
300
+ }
301
+ } else if (graphRotation === -45) {
302
+ if (ex >= ax) {
303
+ zeroWidth = 0;
304
+ zeroHeight = 0;
305
+ } else {
306
+ zeroWidth = 1;
307
+ zeroHeight = 1;
308
+ }
309
+ }
310
+ break;
311
+ case 'top-right':
312
+ if (graphRotation > -45 && graphRotation < 45) {
313
+ if (ex <= ax && ey >= ay) {
314
+ zeroWidth = 0;
315
+ zeroHeight = 0;
316
+ } else {
317
+ zeroWidth = 1;
318
+ zeroHeight = 1;
319
+ }
320
+ } else if (graphRotation === 45) {
321
+ if (ex <= ax) {
322
+ zeroWidth = 0;
323
+ zeroHeight = 0;
324
+ } else {
325
+ zeroWidth = 1;
326
+ zeroHeight = 1;
327
+ }
328
+ } else if (graphRotation > 45 && graphRotation < 135) {
329
+ if (ex <= ax && ey <= ay) {
330
+ zeroWidth = 0;
331
+ zeroHeight = 0;
332
+ } else {
333
+ zeroWidth = 1;
334
+ zeroHeight = 1;
335
+ }
336
+ } else if (graphRotation === 135) {
337
+ if (ey <= ay) {
338
+ zeroWidth = 0;
339
+ zeroHeight = 0;
340
+ } else {
341
+ zeroWidth = 1;
342
+ zeroHeight = 1;
343
+ }
344
+ } else if ((graphRotation > 135 && graphRotation <= 180) || (graphRotation >= -180 && graphRotation < -135)) {
345
+ if (ex >= ax && ey <= ay) {
346
+ zeroWidth = 0;
347
+ zeroHeight = 0;
348
+ } else {
349
+ zeroWidth = 1;
350
+ zeroHeight = 1;
351
+ }
352
+ } else if (graphRotation === -135) {
353
+ if (ex >= ax) {
354
+ zeroWidth = 0;
355
+ zeroHeight = 0;
356
+ } else {
357
+ zeroWidth = 1;
358
+ zeroHeight = 1;
359
+ }
360
+ } else if (graphRotation > -135 && graphRotation < -45) {
361
+ if (ex >= ax && ey >= ay) {
362
+ zeroWidth = 0;
363
+ zeroHeight = 0;
364
+ } else {
365
+ zeroWidth = 1;
366
+ zeroHeight = 1;
367
+ }
368
+ } else if (graphRotation === -45) {
369
+ if (ey >= ay) {
370
+ zeroWidth = 0;
371
+ zeroHeight = 0;
372
+ } else {
373
+ zeroWidth = 1;
374
+ zeroHeight = 1;
375
+ }
376
+ }
377
+ break;
378
+ case 'bottom-left':
379
+ if (graphRotation > -45 && graphRotation < 45) {
380
+ if (ex >= ax && ey <= ay) {
381
+ zeroWidth = 0;
382
+ zeroHeight = 0;
383
+ } else {
384
+ zeroWidth = 1;
385
+ zeroHeight = 1;
386
+ }
387
+ } else if (graphRotation === 45) {
388
+ if (ex >= ax) {
389
+ zeroWidth = 0;
390
+ zeroHeight = 0;
391
+ } else {
392
+ zeroWidth = 1;
393
+ zeroHeight = 1;
394
+ }
395
+ } else if (graphRotation > 45 && graphRotation < 135) {
396
+ if (ex >= ax && ey >= ay) {
397
+ zeroWidth = 0;
398
+ zeroHeight = 0;
399
+ } else {
400
+ zeroWidth = 1;
401
+ zeroHeight = 1;
402
+ }
403
+ } else if (graphRotation === 135) {
404
+ if (ey >= ay) {
405
+ zeroWidth = 0;
406
+ zeroHeight = 0;
407
+ } else {
408
+ zeroWidth = 1;
409
+ zeroHeight = 1;
410
+ }
411
+ } else if ((graphRotation > 135 && graphRotation <= 180) || (graphRotation >= -180 && graphRotation < -135)) {
412
+ if (ex <= ax && ey >= ay) {
413
+ zeroWidth = 0;
414
+ zeroHeight = 0;
415
+ } else {
416
+ zeroWidth = 1;
417
+ zeroHeight = 1;
418
+ }
419
+ } else if (graphRotation === -135) {
420
+ if (ex <= ax) {
421
+ zeroWidth = 0;
422
+ zeroHeight = 0;
423
+ } else {
424
+ zeroWidth = 1;
425
+ zeroHeight = 1;
426
+ }
427
+ } else if (graphRotation > -135 && graphRotation < -45) {
428
+ if (ex <= ax && ey <= ay) {
429
+ zeroWidth = 0;
430
+ zeroHeight = 0;
431
+ } else {
432
+ zeroWidth = 1;
433
+ zeroHeight = 1;
434
+ }
435
+ } else if (graphRotation === -45) {
436
+ if (ey <= ay) {
437
+ zeroWidth = 0;
438
+ zeroHeight = 0;
439
+ } else {
440
+ zeroWidth = 1;
441
+ zeroHeight = 1;
442
+ }
443
+ }
444
+ break;
445
+ case 'bottom-right':
446
+ if (graphRotation > -45 && graphRotation < 45) {
447
+ if (ex <= ax && ey <= ay) {
448
+ zeroWidth = 0;
449
+ zeroHeight = 0;
450
+ } else {
451
+ zeroWidth = 1;
452
+ zeroHeight = 1;
453
+ }
454
+ } else if (graphRotation === 45) {
455
+ if (ey <= ay) {
456
+ zeroWidth = 0;
457
+ zeroHeight = 0;
458
+ } else {
459
+ zeroWidth = 1;
460
+ zeroHeight = 1;
461
+ }
462
+ } else if (graphRotation > 45 && graphRotation < 135) {
463
+ if (ex >= ax && ey <= ay) {
464
+ zeroWidth = 0;
465
+ zeroHeight = 0;
466
+ } else {
467
+ zeroWidth = 1;
468
+ zeroHeight = 1;
469
+ }
470
+ } else if (graphRotation === 135) {
471
+ if (ex >= ax) {
472
+ zeroWidth = 0;
473
+ zeroHeight = 0;
474
+ } else {
475
+ zeroWidth = 1;
476
+ zeroHeight = 1;
477
+ }
478
+ } else if ((graphRotation > 135 && graphRotation <= 180) || (graphRotation >= -180 && graphRotation < -135)) {
479
+ if (ex >= ax && ey >= ay) {
480
+ zeroWidth = 0;
481
+ zeroHeight = 0;
482
+ } else {
483
+ zeroWidth = 1;
484
+ zeroHeight = 1;
485
+ }
486
+ } else if (graphRotation === -135) {
487
+ if (ey >= ay) {
488
+ zeroWidth = 0;
489
+ zeroHeight = 0;
490
+ } else {
491
+ zeroWidth = 1;
492
+ zeroHeight = 1;
493
+ }
494
+ } else if (graphRotation > -135 && graphRotation < -45) {
495
+ if (ex <= ax && ey >= ay) {
496
+ zeroWidth = 0;
497
+ zeroHeight = 0;
498
+ } else {
499
+ zeroWidth = 1;
500
+ zeroHeight = 1;
501
+ }
502
+ } else if (graphRotation === -45) {
503
+ if (ex <= ax) {
504
+ zeroWidth = 0;
505
+ zeroHeight = 0;
506
+ } else {
507
+ zeroWidth = 1;
508
+ zeroHeight = 1;
509
+ }
510
+ }
511
+ break;
512
+ }
513
+ if (/-?(left|right)$/.test(adjustType)) {
514
+ graph.width(Math.max(2, graphSnap.width() * r1 * zeroWidth));
515
+ }
516
+ if (/^(top|bottom)-?/.test(adjustType)) {
517
+ graph.height(Math.max(2, graphSnap.height() * r1 * zeroHeight));
518
+ }
519
+ }
520
+ {
521
+ const [graphWidth, graphHeight] = [graph.width() * graph.scaleX(), graph.height() * graph.scaleY()];
522
+ const cos = Math.cos((graphRotation * Math.PI) / 180);
523
+ const sin = Math.sin((graphRotation * Math.PI) / 180);
524
+ const tan = Math.tan((graphRotation * Math.PI) / 180);
525
+ switch (adjustType) {
526
+ case 'top':
527
+ graph.x(ax - (graphWidth / 2 - graphHeight * tan) * cos);
528
+ if (graphRotation !== 90 && graphRotation !== -90) {
529
+ graph.y(ay - (graphHeight / cos + (graphWidth / 2 - graphHeight * tan) * sin));
530
+ }
531
+ break;
532
+ case 'bottom': // 无需处理
533
+ break;
534
+ case 'left':
535
+ if ([90, -90].includes(graphRotation)) {
536
+ graph.y(ay - graphWidth);
537
+ } else if (Math.abs(graphRotation) === 180) {
538
+ graph.x(ax + graphWidth);
539
+ } else {
540
+ const v1 = graphHeight / 2 / cos;
541
+ const v2 = v1 * sin;
542
+ const v3 = graphWidth - v2;
543
+ const v4 = v3 * sin;
544
+ graph.x(ax - v3 * cos);
545
+ graph.y(ay - (v1 + v4));
546
+ }
547
+ break;
548
+ case 'right': // 无需处理
549
+ break;
550
+ case 'top-left':
551
+ graph.x(ax - (graphWidth - graphHeight * tan) * cos);
552
+ graph.y(ay - (graphWidth * sin + graphHeight * cos));
553
+ break;
554
+ case 'top-right':
555
+ graph.x(ax + graphHeight * sin);
556
+ graph.y(ay - graphHeight * cos);
557
+ break;
558
+ case 'bottom-left':
559
+ graph.x(ax - graphWidth * cos);
560
+ graph.y(ay - graphWidth * sin);
561
+ break;
562
+ case 'bottom-right': // 无需处理
563
+ break;
564
+ }
565
+ }
566
+ }
567
+ const [graphWidth, graphHeight] = [graph.width(), graph.height()];
568
+ // 更新 矩形 大小
569
+ rect.width(graphWidth);
570
+ rect.height(graphHeight);
571
+ // 更新 调整点 的 锚点 位置
572
+ Rect.updateAnchorShadows(graph, anchors);
573
+ // 更新 图形 的 连接点 的 锚点位置
574
+ Rect.updateLinkAnchorShadows(graph, linkAnchors);
575
+ const stageState = render.getStageState();
576
+ // 更新 调整点 位置
577
+ for (const anchor of anchors) {
578
+ for (const { shape } of anchorAndShadows) {
579
+ if (shape) {
580
+ if (shape.attrs.anchor?.adjustType === anchor.attrs.adjustType) {
581
+ const anchorShadow = graph.find(`.anchor`).find((o) => o.attrs.adjustType === anchor.attrs.adjustType);
582
+ if (anchorShadow) {
583
+ shape.position({
584
+ x: render.toStageValue(anchorShadow.getAbsolutePosition().x - stageState.x),
585
+ y: render.toStageValue(anchorShadow.getAbsolutePosition().y - stageState.y)
586
+ });
587
+ shape.rotation(graph.getAbsoluteRotation());
588
+ }
589
+ }
590
+ }
591
+ }
592
+ }
593
+ render.redraw([GraphDraw.NAME, LinkDraw.NAME, PreviewDraw.NAME]);
594
+ }
595
+ BaseGraph.adjust(render, graph, graphSnap, adjustShape, anchorAndShadows, startPoint, endPoint, hoverRect);
596
+ }
597
+
598
+ /**
599
+ * 提供给 GraphDraw draw 使用
600
+ */
601
+ static override draw(graph: Konva.Group, render: Render, adjustAnchor?: GraphAnchor) {
602
+ // 调整点 及其 锚点
603
+ const { anchorAndShadows } = super.draw(graph, render, adjustAnchor);
604
+ return Rect.createAnchorShapes(render, graph, anchorAndShadows, adjustAnchor);
605
+ }
606
+
607
+ /**
608
+ * 默认图形大小
609
+ */
610
+ static size = 100;
611
+
612
+ /**
613
+ * 矩形 对应的 Konva 实例
614
+ */
615
+ private rect: Konva.Rect;
616
+
617
+ constructor(render: Render, dropPoint: Konva.Vector2d) {
618
+ super(render, dropPoint, {
619
+ type: "Rect",
620
+ anchors: [
621
+ { adjustType: 'top' },
622
+ { adjustType: 'bottom' },
623
+ { adjustType: 'left' },
624
+ { adjustType: 'right' },
625
+ { adjustType: 'top-left' },
626
+ { adjustType: 'top-right' },
627
+ { adjustType: 'bottom-left' },
628
+ { adjustType: 'bottom-right' }
629
+ ].map((o) => ({ adjustType: o.adjustType })),
630
+ linkAnchors: [
631
+ { x: 0, y: 0, alias: 'top', direction: 'top' },
632
+ { x: 0, y: 0, alias: 'bottom', direction: 'bottom' },
633
+ { x: 0, y: 0, alias: 'left', direction: 'left' },
634
+ { x: 0, y: 0, alias: 'right', direction: 'right' },
635
+ { x: 0, y: 0, alias: 'center' }
636
+ ] as AssetInfoPoint[]
637
+ });
638
+ this.rect = new Konva.Rect({
639
+ name: 'graph',
640
+ x: 0,
641
+ y: 0,
642
+ width: 0,
643
+ height: 0,
644
+ stroke: "#000000",
645
+ strokeWidth: 1,
646
+ });
647
+ this.group.add(this.rect);
648
+ this.group.position(this.dropPoint);
649
+ }
650
+
651
+ // 实现:拖动进行时
652
+ override drawMove(point: Konva.Vector2d): void {
653
+ let offsetX = point.x - this.dropPoint.x,
654
+ offsetY = point.y - this.dropPoint.y;
655
+ if (offsetX < 1) offsetX = 1;
656
+ if (offsetY < 1) offsetY = 1;
657
+ // 矩形 位置大小
658
+ this.rect.width(offsetX);
659
+ this.rect.height(offsetY);
660
+ this.group.size({ width: offsetX, height: offsetY });
661
+ Rect.updateAnchorShadows(this.group, this.anchorShadows);
662
+ Rect.updateLinkAnchorShadows(this.group, this.linkAnchorShadows);
663
+ this.render.redraw([GraphDraw.NAME, LinkDraw.NAME, PreviewDraw.NAME]);
664
+ }
665
+
666
+ // 实现:拖动结束
667
+ override drawEnd(): void {
668
+ if (this.rect.width() <= 1 && this.rect.height() <= 1) {
669
+ const width = Rect.size, height = width;
670
+ this.rect.width(width - this.rect.strokeWidth());
671
+ this.rect.height(height - this.rect.strokeWidth());
672
+ this.group.size({ width, height });
673
+ Rect.updateAnchorShadows(this.group, this.anchorShadows);
674
+ Rect.updateLinkAnchorShadows(this.group, this.linkAnchorShadows);
675
+ this.render.attractTool.alignLinesClear();
676
+ this.render.updateHistory();
677
+ this.render.redraw([GraphDraw.NAME, LinkDraw.NAME, PreviewDraw.NAME]);
678
+ }
679
+ super.drawEnd();
680
+ }
681
681
  }