@oceanbase/ui 1.0.0-alpha.1 → 1.0.0-alpha.11

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 (495) hide show
  1. package/dist/static/Inter-Medium.ea234620.woff2 +0 -0
  2. package/dist/static/Inter-Regular.34ba43c9.woff2 +0 -0
  3. package/dist/static/Inter-SemiBold.95439fb4.woff2 +0 -0
  4. package/dist/ui.min.css +1 -1
  5. package/dist/ui.min.js +1 -1
  6. package/es/Action/Group.js +122 -15
  7. package/es/Action/Item.d.ts +6 -15
  8. package/es/Action/Item.js +86 -128
  9. package/es/Action/index.d.ts +6 -3
  10. package/es/Action/index.js +1 -0
  11. package/es/Action/style/index.d.ts +2 -2
  12. package/es/Action/style/index.js +8 -4
  13. package/es/BackgroundTaskManager/RefreshMan.js +1 -0
  14. package/es/BackgroundTaskManager/index.js +1 -0
  15. package/es/BasicLayout/Header.js +1 -0
  16. package/es/BasicLayout/index.js +1 -0
  17. package/es/BasicLayout/locale/ja-JP.d.ts +13 -0
  18. package/es/BasicLayout/locale/ja-JP.js +12 -0
  19. package/es/BasicLayout/style/index.js +35 -23
  20. package/es/BatchOperationBar/index.d.ts +0 -1
  21. package/es/BatchOperationBar/index.js +18 -13
  22. package/es/BatchOperationBar/locale/ja-JP.d.ts +7 -0
  23. package/es/BatchOperationBar/locale/ja-JP.js +6 -0
  24. package/es/BatchOperationBar/style/index.d.ts +10 -0
  25. package/es/BatchOperationBar/style/index.js +51 -0
  26. package/es/Boundary/Components/Code.js +12 -5
  27. package/es/Boundary/Components/Exception.js +86 -74
  28. package/es/Boundary/Components/Function.js +12 -5
  29. package/es/Boundary/index.d.ts +0 -1
  30. package/es/Boundary/index.js +1 -1
  31. package/es/Boundary/locale/en-US.js +1 -1
  32. package/es/Boundary/locale/ja-JP.d.ts +11 -0
  33. package/es/Boundary/locale/ja-JP.js +10 -0
  34. package/es/Boundary/locale/zh-CN.js +1 -1
  35. package/es/Boundary/locale/zh-TW.js +1 -1
  36. package/es/Boundary/style/index.d.ts +10 -0
  37. package/es/Boundary/style/index.js +46 -0
  38. package/es/ContentWithIcon/index.d.ts +0 -1
  39. package/es/ContentWithIcon/index.js +30 -29
  40. package/es/ContentWithIcon/style/index.d.ts +10 -0
  41. package/es/ContentWithIcon/style/index.js +26 -0
  42. package/es/ContentWithQuestion/index.js +1 -0
  43. package/es/DateRanger/PickerPanel.js +6 -4
  44. package/es/DateRanger/Ranger.d.ts +4 -1
  45. package/es/DateRanger/Ranger.js +169 -19
  46. package/es/DateRanger/constant/index.js +1 -1
  47. package/es/DateRanger/index.js +1 -0
  48. package/es/DateRanger/locale/ja-JP.d.ts +56 -0
  49. package/es/DateRanger/locale/ja-JP.js +20 -0
  50. package/es/DateRanger/style/index.d.ts +10 -0
  51. package/es/DateRanger/style/index.js +126 -0
  52. package/es/Dialog/Anchor.d.ts +2 -10
  53. package/es/Dialog/Anchor.js +68 -96
  54. package/es/Dialog/EventProxy.js +1 -0
  55. package/es/Dialog/index.d.ts +0 -1
  56. package/es/Dialog/index.js +538 -578
  57. package/es/Dialog/locale/ja-JP.d.ts +5 -0
  58. package/es/Dialog/locale/ja-JP.js +4 -0
  59. package/es/Dialog/locale/zh-CN.js +1 -1
  60. package/es/Dialog/locale/zh-TW.js +1 -1
  61. package/es/Dialog/style/index.d.ts +10 -0
  62. package/es/Dialog/style/index.js +97 -0
  63. package/es/DocDialog/index.js +1 -0
  64. package/es/DocDialog/locale/ja-JP.d.ts +2 -0
  65. package/es/DocDialog/locale/ja-JP.js +1 -0
  66. package/es/FooterToolbar/index.js +1 -0
  67. package/es/FooterToolbar/style/index.d.ts +0 -2
  68. package/es/FooterToolbar/style/index.js +7 -13
  69. package/es/FullscreenBox/index.d.ts +0 -1
  70. package/es/FullscreenBox/index.js +47 -37
  71. package/es/FullscreenBox/locale/ja-JP.d.ts +2 -0
  72. package/es/FullscreenBox/locale/ja-JP.js +1 -0
  73. package/es/FullscreenBox/style/index.d.ts +10 -0
  74. package/es/FullscreenBox/style/index.js +53 -0
  75. package/es/Highlight/DiffView/DiffCells.js +1 -0
  76. package/es/Highlight/DiffView/index.d.ts +0 -1
  77. package/es/Highlight/DiffView/index.js +6 -5
  78. package/es/Highlight/HighlightCell.js +1 -0
  79. package/es/Highlight/JsonView.d.ts +0 -1
  80. package/es/Highlight/JsonView.js +6 -5
  81. package/es/Highlight/index.d.ts +0 -1
  82. package/es/Highlight/index.js +24 -23
  83. package/es/Highlight/locale/ja-JP.d.ts +4 -0
  84. package/es/Highlight/locale/ja-JP.js +3 -0
  85. package/es/Highlight/style/index.d.ts +10 -0
  86. package/es/Highlight/style/index.js +213 -0
  87. package/es/Highlight/useKeyDownCopyEvent.js +1 -0
  88. package/es/IconFont/index.js +1 -0
  89. package/es/LightFilter/index.js +1 -0
  90. package/es/LocaleDropdown/index.js +5 -2
  91. package/es/Login/ActivateForm.d.ts +0 -1
  92. package/es/Login/ActivateForm.js +13 -9
  93. package/es/Login/LoginForm.d.ts +0 -1
  94. package/es/Login/LoginForm.js +21 -15
  95. package/es/Login/RegisterForm.d.ts +0 -1
  96. package/es/Login/RegisterForm.js +15 -11
  97. package/es/Login/index.d.ts +0 -1
  98. package/es/Login/index.js +25 -22
  99. package/es/Login/locale/ja-JP.d.ts +28 -0
  100. package/es/Login/locale/ja-JP.js +27 -0
  101. package/es/Login/locale/zh-CN.js +2 -2
  102. package/es/Login/style/index.d.ts +10 -0
  103. package/es/Login/style/index.js +182 -0
  104. package/es/Lottie/index.js +1 -0
  105. package/es/NavMenu/index.d.ts +1 -2
  106. package/es/NavMenu/index.js +12 -8
  107. package/es/NavMenu/style/index.d.ts +10 -0
  108. package/es/NavMenu/style/index.js +47 -0
  109. package/es/PageContainer/ItemRender.js +1 -0
  110. package/es/PageContainer/index.d.ts +2 -0
  111. package/es/PageContainer/index.js +103 -25
  112. package/es/PageContainer/locale/en-US.d.ts +1 -0
  113. package/es/PageContainer/locale/en-US.js +2 -1
  114. package/es/PageContainer/locale/ja-JP.d.ts +5 -0
  115. package/es/PageContainer/locale/ja-JP.js +4 -0
  116. package/es/PageContainer/locale/zh-CN.d.ts +1 -0
  117. package/es/PageContainer/locale/zh-CN.js +2 -1
  118. package/es/PageContainer/locale/zh-TW.d.ts +1 -0
  119. package/es/PageContainer/locale/zh-TW.js +2 -1
  120. package/es/PageContainer/style/index.js +41 -16
  121. package/es/PageLoading/index.js +1 -0
  122. package/es/Password/Content.js +1 -0
  123. package/es/Password/index.js +2 -1
  124. package/es/Password/locale/ja-JP.d.ts +13 -0
  125. package/es/Password/locale/ja-JP.js +12 -0
  126. package/es/ProCard/index.js +12 -3
  127. package/es/ProCard/style/index.d.ts +2 -2
  128. package/es/ProCard/style/index.js +13 -5
  129. package/es/ProTable/index.d.ts +1 -1
  130. package/es/ProTable/index.js +21 -7
  131. package/es/ProTable/style/index.d.ts +2 -2
  132. package/es/ProTable/style/index.js +12 -5
  133. package/es/Ranger/QuickPicker.js +9 -4
  134. package/es/Ranger/Ranger.d.ts +0 -1
  135. package/es/Ranger/Ranger.js +13 -9
  136. package/es/Ranger/index.js +1 -0
  137. package/es/Ranger/locale/ja-JP.d.ts +28 -0
  138. package/es/Ranger/locale/ja-JP.js +29 -0
  139. package/es/Ranger/style/index.d.ts +10 -0
  140. package/es/Ranger/style/index.js +44 -0
  141. package/es/SideTip/Dragger.js +1 -0
  142. package/es/SideTip/IconLoading.js +1 -0
  143. package/es/SideTip/index.d.ts +0 -1
  144. package/es/SideTip/index.js +25 -22
  145. package/es/SideTip/locale/ja-JP.d.ts +2 -0
  146. package/es/SideTip/locale/ja-JP.js +1 -0
  147. package/es/SideTip/style/index.d.ts +10 -0
  148. package/es/SideTip/style/index.js +162 -0
  149. package/es/TagSelect/Group.d.ts +6 -6
  150. package/es/TagSelect/Group.js +6 -3
  151. package/es/TagSelect/Item.js +6 -3
  152. package/es/TagSelect/index.js +1 -0
  153. package/es/TreeSearch/index.js +1 -0
  154. package/es/Welcome/index.d.ts +0 -1
  155. package/es/Welcome/index.js +31 -26
  156. package/es/Welcome/locale/ja-JP.d.ts +5 -0
  157. package/es/Welcome/locale/ja-JP.js +4 -0
  158. package/es/Welcome/step/style/index.d.ts +10 -0
  159. package/es/Welcome/step/style/index.js +44 -0
  160. package/es/Welcome/step.d.ts +0 -1
  161. package/es/Welcome/step.js +18 -14
  162. package/es/Welcome/style/index.d.ts +10 -0
  163. package/es/Welcome/style/index.js +141 -0
  164. package/es/_util/genComponentStyleHook.d.ts +4 -3
  165. package/es/_util/genComponentStyleHook.js +1 -1
  166. package/es/_util/index.js +1 -0
  167. package/es/constant/index.js +1 -0
  168. package/es/index.d.ts +0 -5
  169. package/es/index.js +1 -3
  170. package/es/locale/LocaleWrapper.js +1 -0
  171. package/es/locale/en-US.js +0 -4
  172. package/es/locale/index.js +1 -0
  173. package/es/locale/ja-JP.d.ts +3 -0
  174. package/es/locale/ja-JP.js +38 -0
  175. package/es/locale/zh-CN.js +0 -4
  176. package/es/locale/zh-TW.js +0 -4
  177. package/lib/Action/Group.js +211 -108
  178. package/lib/Action/Item.d.ts +6 -15
  179. package/lib/Action/Item.js +81 -109
  180. package/lib/Action/index.d.ts +6 -3
  181. package/lib/Action/index.js +13 -35
  182. package/lib/Action/style/index.d.ts +2 -2
  183. package/lib/Action/style/index.js +38 -41
  184. package/lib/BackgroundTaskManager/RefreshMan.js +34 -59
  185. package/lib/BackgroundTaskManager/constants.js +10 -32
  186. package/lib/BackgroundTaskManager/index.js +118 -135
  187. package/lib/BasicLayout/Header.js +238 -138
  188. package/lib/BasicLayout/index.js +264 -283
  189. package/lib/BasicLayout/locale/en-US.js +16 -34
  190. package/lib/BasicLayout/locale/ja-JP.d.ts +13 -0
  191. package/lib/BasicLayout/locale/ja-JP.js +18 -0
  192. package/lib/BasicLayout/locale/zh-CN.js +16 -34
  193. package/lib/BasicLayout/locale/zh-TW.js +16 -34
  194. package/lib/BasicLayout/style/Header.js +41 -60
  195. package/lib/BasicLayout/style/index.js +192 -204
  196. package/lib/BatchOperationBar/index.d.ts +0 -1
  197. package/lib/BatchOperationBar/index.js +108 -131
  198. package/lib/BatchOperationBar/locale/en-US.js +10 -28
  199. package/lib/BatchOperationBar/locale/ja-JP.d.ts +7 -0
  200. package/lib/BatchOperationBar/locale/ja-JP.js +12 -0
  201. package/lib/BatchOperationBar/locale/zh-CN.js +10 -28
  202. package/lib/BatchOperationBar/locale/zh-TW.js +10 -28
  203. package/lib/BatchOperationBar/style/index.d.ts +10 -0
  204. package/lib/BatchOperationBar/style/index.js +66 -0
  205. package/lib/Boundary/Components/Code.js +57 -63
  206. package/lib/Boundary/Components/Exception.js +117 -116
  207. package/lib/Boundary/Components/Function.js +47 -50
  208. package/lib/Boundary/Components/index.js +36 -25
  209. package/lib/Boundary/IBoundary.js +4 -16
  210. package/lib/Boundary/constant.js +16 -38
  211. package/lib/Boundary/index.d.ts +0 -1
  212. package/lib/Boundary/index.js +11 -25
  213. package/lib/Boundary/locale/en-US.js +14 -32
  214. package/lib/Boundary/locale/ja-JP.d.ts +11 -0
  215. package/lib/Boundary/locale/ja-JP.js +16 -0
  216. package/lib/Boundary/locale/zh-CN.js +14 -32
  217. package/lib/Boundary/locale/zh-TW.js +14 -32
  218. package/lib/Boundary/style/index.d.ts +10 -0
  219. package/lib/Boundary/style/index.js +55 -0
  220. package/lib/Boundary/utils.js +9 -31
  221. package/lib/ContentWithIcon/index.d.ts +0 -1
  222. package/lib/ContentWithIcon/index.js +99 -101
  223. package/lib/ContentWithIcon/style/index.d.ts +10 -0
  224. package/lib/ContentWithIcon/style/index.js +38 -0
  225. package/lib/ContentWithQuestion/index.js +40 -47
  226. package/lib/ContentWithQuestion/style/index.js +16 -35
  227. package/lib/DateRanger/PickerPanel.js +322 -286
  228. package/lib/DateRanger/Ranger.d.ts +4 -1
  229. package/lib/DateRanger/Ranger.js +381 -292
  230. package/lib/DateRanger/constant/index.js +188 -376
  231. package/lib/DateRanger/index.js +45 -64
  232. package/lib/DateRanger/locale/en-US.js +20 -47
  233. package/lib/DateRanger/locale/ja-JP.d.ts +56 -0
  234. package/lib/DateRanger/locale/ja-JP.js +22 -0
  235. package/lib/DateRanger/locale/zh-CN.js +20 -47
  236. package/lib/DateRanger/locale/zh-TW.js +20 -47
  237. package/lib/DateRanger/style/index.d.ts +10 -0
  238. package/lib/DateRanger/style/index.js +174 -0
  239. package/lib/DateRanger/typing.js +4 -16
  240. package/lib/Dialog/Anchor.d.ts +2 -10
  241. package/lib/Dialog/Anchor.js +80 -104
  242. package/lib/Dialog/Dock.js +14 -36
  243. package/lib/Dialog/EventProxy.js +21 -48
  244. package/lib/Dialog/index.d.ts +0 -1
  245. package/lib/Dialog/index.js +526 -521
  246. package/lib/Dialog/locale/en-US.js +8 -26
  247. package/lib/Dialog/locale/ja-JP.d.ts +5 -0
  248. package/lib/Dialog/locale/ja-JP.js +10 -0
  249. package/lib/Dialog/locale/zh-CN.js +8 -26
  250. package/lib/Dialog/locale/zh-TW.js +8 -26
  251. package/lib/Dialog/style/index.d.ts +10 -0
  252. package/lib/Dialog/style/index.js +117 -0
  253. package/lib/DocDialog/index.js +51 -76
  254. package/lib/DocDialog/locale/en-US.js +5 -23
  255. package/lib/DocDialog/locale/ja-JP.d.ts +2 -0
  256. package/lib/DocDialog/locale/ja-JP.js +7 -0
  257. package/lib/DocDialog/locale/zh-CN.js +5 -23
  258. package/lib/DocDialog/locale/zh-TW.js +5 -23
  259. package/lib/FooterToolbar/index.js +27 -44
  260. package/lib/FooterToolbar/style/index.d.ts +0 -2
  261. package/lib/FooterToolbar/style/index.js +26 -52
  262. package/lib/FullscreenBox/index.d.ts +0 -1
  263. package/lib/FullscreenBox/index.js +151 -120
  264. package/lib/FullscreenBox/locale/en-US.js +5 -23
  265. package/lib/FullscreenBox/locale/ja-JP.d.ts +2 -0
  266. package/lib/FullscreenBox/locale/ja-JP.js +7 -0
  267. package/lib/FullscreenBox/locale/zh-CN.js +5 -23
  268. package/lib/FullscreenBox/locale/zh-TW.js +5 -23
  269. package/lib/FullscreenBox/style/index.d.ts +10 -0
  270. package/lib/FullscreenBox/style/index.js +68 -0
  271. package/lib/Highlight/DiffView/DiffCells.js +35 -48
  272. package/lib/Highlight/DiffView/index.d.ts +0 -1
  273. package/lib/Highlight/DiffView/index.js +154 -148
  274. package/lib/Highlight/HighlightCell.js +29 -45
  275. package/lib/Highlight/JsonView.d.ts +0 -1
  276. package/lib/Highlight/JsonView.js +45 -73
  277. package/lib/Highlight/index.d.ts +0 -1
  278. package/lib/Highlight/index.js +197 -203
  279. package/lib/Highlight/languages/bash.js +7 -34
  280. package/lib/Highlight/languages/cpp.js +7 -34
  281. package/lib/Highlight/languages/css.js +7 -34
  282. package/lib/Highlight/languages/dockerfile.js +7 -34
  283. package/lib/Highlight/languages/go.js +7 -34
  284. package/lib/Highlight/languages/groovy.js +7 -34
  285. package/lib/Highlight/languages/http.js +7 -34
  286. package/lib/Highlight/languages/java.js +7 -34
  287. package/lib/Highlight/languages/javascript.js +7 -34
  288. package/lib/Highlight/languages/json.js +7 -34
  289. package/lib/Highlight/languages/markdown.js +7 -34
  290. package/lib/Highlight/languages/nginx.js +7 -34
  291. package/lib/Highlight/languages/python.js +7 -34
  292. package/lib/Highlight/languages/ruby.js +7 -34
  293. package/lib/Highlight/languages/solidity.js +7 -34
  294. package/lib/Highlight/languages/sql.js +7 -34
  295. package/lib/Highlight/languages/typescript.js +7 -34
  296. package/lib/Highlight/languages/xml.js +7 -34
  297. package/lib/Highlight/languages/yaml.js +7 -34
  298. package/lib/Highlight/locale/en-US.js +7 -25
  299. package/lib/Highlight/locale/ja-JP.d.ts +4 -0
  300. package/lib/Highlight/locale/ja-JP.js +9 -0
  301. package/lib/Highlight/locale/zh-CN.js +7 -25
  302. package/lib/Highlight/locale/zh-TW.js +7 -25
  303. package/lib/Highlight/style/index.d.ts +10 -0
  304. package/lib/Highlight/style/index.js +277 -0
  305. package/lib/Highlight/useKeyDownCopyEvent.js +40 -64
  306. package/lib/IconFont/index.js +23 -38
  307. package/lib/LightFilter/index.js +29 -42
  308. package/lib/LightFilter/style/index.js +15 -33
  309. package/lib/LocaleDropdown/index.js +44 -60
  310. package/lib/Login/ActivateForm.d.ts +0 -1
  311. package/lib/Login/ActivateForm.js +93 -118
  312. package/lib/Login/LoginForm.d.ts +0 -1
  313. package/lib/Login/LoginForm.js +135 -149
  314. package/lib/Login/RegisterForm.d.ts +0 -1
  315. package/lib/Login/RegisterForm.js +122 -162
  316. package/lib/Login/index.d.ts +0 -1
  317. package/lib/Login/index.js +156 -132
  318. package/lib/Login/locale/en-US.js +31 -49
  319. package/lib/Login/locale/ja-JP.d.ts +28 -0
  320. package/lib/Login/locale/ja-JP.js +33 -0
  321. package/lib/Login/locale/zh-CN.js +31 -49
  322. package/lib/Login/locale/zh-TW.js +30 -48
  323. package/lib/Login/style/index.d.ts +10 -0
  324. package/lib/Login/style/index.js +246 -0
  325. package/lib/Lottie/index.js +7 -24
  326. package/lib/NavMenu/index.d.ts +1 -2
  327. package/lib/NavMenu/index.js +102 -101
  328. package/lib/NavMenu/style/index.d.ts +10 -0
  329. package/lib/NavMenu/style/index.js +60 -0
  330. package/lib/PageContainer/ItemRender.js +27 -45
  331. package/lib/PageContainer/index.d.ts +2 -0
  332. package/lib/PageContainer/index.js +154 -93
  333. package/lib/PageContainer/locale/en-US.d.ts +1 -0
  334. package/lib/PageContainer/locale/en-US.js +8 -25
  335. package/lib/PageContainer/locale/ja-JP.d.ts +5 -0
  336. package/lib/PageContainer/locale/ja-JP.js +10 -0
  337. package/lib/PageContainer/locale/zh-CN.d.ts +1 -0
  338. package/lib/PageContainer/locale/zh-CN.js +8 -25
  339. package/lib/PageContainer/locale/zh-TW.d.ts +1 -0
  340. package/lib/PageContainer/locale/zh-TW.js +8 -25
  341. package/lib/PageContainer/style/index.js +59 -49
  342. package/lib/PageLoading/index.js +32 -63
  343. package/lib/Password/Content.js +91 -83
  344. package/lib/Password/index.js +118 -138
  345. package/lib/Password/locale/en-US.js +14 -32
  346. package/lib/Password/locale/ja-JP.d.ts +13 -0
  347. package/lib/Password/locale/ja-JP.js +18 -0
  348. package/lib/Password/locale/zh-CN.js +15 -33
  349. package/lib/Password/locale/zh-TW.js +14 -32
  350. package/lib/ProCard/index.js +78 -96
  351. package/lib/ProCard/style/index.d.ts +2 -2
  352. package/lib/ProCard/style/index.js +35 -38
  353. package/lib/ProTable/index.d.ts +1 -1
  354. package/lib/ProTable/index.js +103 -112
  355. package/lib/ProTable/style/index.d.ts +2 -2
  356. package/lib/ProTable/style/index.js +36 -37
  357. package/lib/Ranger/QuickPicker.js +91 -82
  358. package/lib/Ranger/Ranger.d.ts +0 -1
  359. package/lib/Ranger/Ranger.js +98 -127
  360. package/lib/Ranger/constant/index.js +115 -266
  361. package/lib/Ranger/index.js +61 -69
  362. package/lib/Ranger/locale/en-US.js +31 -49
  363. package/lib/Ranger/locale/ja-JP.d.ts +28 -0
  364. package/lib/Ranger/locale/ja-JP.js +35 -0
  365. package/lib/Ranger/locale/zh-CN.js +7 -25
  366. package/lib/Ranger/locale/zh-TW.js +7 -25
  367. package/lib/Ranger/style/index.d.ts +10 -0
  368. package/lib/Ranger/style/index.js +64 -0
  369. package/lib/Ranger/typing.js +4 -16
  370. package/lib/SideTip/Dragger.js +259 -218
  371. package/lib/SideTip/IconLoading.js +43 -74
  372. package/lib/SideTip/index.d.ts +0 -1
  373. package/lib/SideTip/index.js +129 -114
  374. package/lib/SideTip/locale/en-US.js +5 -23
  375. package/lib/SideTip/locale/ja-JP.d.ts +2 -0
  376. package/lib/SideTip/locale/ja-JP.js +7 -0
  377. package/lib/SideTip/locale/zh-CN.js +5 -23
  378. package/lib/SideTip/locale/zh-TW.js +5 -23
  379. package/lib/SideTip/style/index.d.ts +10 -0
  380. package/lib/SideTip/style/index.js +195 -0
  381. package/lib/SideTip/utils.js +40 -61
  382. package/lib/TagSelect/Group.d.ts +6 -6
  383. package/lib/TagSelect/Group.js +64 -78
  384. package/lib/TagSelect/Item.js +67 -85
  385. package/lib/TagSelect/TagSelectContext.js +7 -25
  386. package/lib/TagSelect/index.js +12 -35
  387. package/lib/TagSelect/style/index.js +41 -64
  388. package/lib/TreeSearch/index.js +133 -132
  389. package/lib/TreeSearch/util.js +52 -70
  390. package/lib/Welcome/index.d.ts +0 -1
  391. package/lib/Welcome/index.js +140 -83
  392. package/lib/Welcome/locale/en-US.js +8 -26
  393. package/lib/Welcome/locale/ja-JP.d.ts +5 -0
  394. package/lib/Welcome/locale/ja-JP.js +10 -0
  395. package/lib/Welcome/locale/zh-CN.js +8 -26
  396. package/lib/Welcome/locale/zh-TW.js +8 -26
  397. package/lib/Welcome/step/style/index.d.ts +10 -0
  398. package/lib/Welcome/step/style/index.js +58 -0
  399. package/lib/Welcome/step.d.ts +0 -1
  400. package/lib/Welcome/step.js +63 -48
  401. package/lib/Welcome/style/index.d.ts +10 -0
  402. package/lib/Welcome/style/index.js +176 -0
  403. package/lib/_util/genComponentStyleHook.d.ts +4 -3
  404. package/lib/_util/genComponentStyleHook.js +15 -43
  405. package/lib/_util/index.js +38 -43
  406. package/lib/_util/useNavigate.js +11 -26
  407. package/lib/constant/index.js +23 -49
  408. package/lib/index.d.ts +0 -5
  409. package/lib/index.js +283 -136
  410. package/lib/interface.js +4 -16
  411. package/lib/locale/LocaleWrapper.js +52 -61
  412. package/lib/locale/en-US.js +37 -68
  413. package/lib/locale/index.js +5 -16
  414. package/lib/locale/ja-JP.d.ts +3 -0
  415. package/lib/locale/ja-JP.js +40 -0
  416. package/lib/locale/zh-CN.js +36 -67
  417. package/lib/locale/zh-TW.js +32 -63
  418. package/package.json +7 -10
  419. package/dist/static/Inter.f6bcdfb6.woff2 +0 -0
  420. package/es/BatchOperationBar/index.less +0 -46
  421. package/es/BatchOperationBar/index.less.d.ts +0 -15
  422. package/es/Boundary/index.less +0 -36
  423. package/es/ContentWithIcon/index.less +0 -21
  424. package/es/DateRanger/index.less +0 -157
  425. package/es/Dialog/index.less +0 -116
  426. package/es/FullscreenBox/index.less +0 -49
  427. package/es/GraphToolbar/index.d.ts +0 -26
  428. package/es/GraphToolbar/index.js +0 -146
  429. package/es/GraphToolbar/index.less +0 -65
  430. package/es/GraphToolbar/locale/en-US.d.ts +0 -9
  431. package/es/GraphToolbar/locale/en-US.js +0 -8
  432. package/es/GraphToolbar/locale/zh-CN.d.ts +0 -9
  433. package/es/GraphToolbar/locale/zh-CN.js +0 -8
  434. package/es/GraphToolbar/locale/zh-TW.d.ts +0 -9
  435. package/es/GraphToolbar/locale/zh-TW.js +0 -8
  436. package/es/Highlight/index.less +0 -381
  437. package/es/Login/index.less +0 -268
  438. package/es/NavMenu/index.less +0 -50
  439. package/es/Ranger/index.less +0 -57
  440. package/es/SideTip/index.less +0 -180
  441. package/es/TaskGraph/Graph.d.ts +0 -24
  442. package/es/TaskGraph/Graph.js +0 -271
  443. package/es/TaskGraph/graph.less +0 -23
  444. package/es/TaskGraph/index.d.ts +0 -16
  445. package/es/TaskGraph/index.js +0 -178
  446. package/es/TaskGraph/index.less +0 -117
  447. package/es/TaskGraph/locale/en-US.d.ts +0 -13
  448. package/es/TaskGraph/locale/en-US.js +0 -12
  449. package/es/TaskGraph/locale/zh-CN.d.ts +0 -13
  450. package/es/TaskGraph/locale/zh-CN.js +0 -12
  451. package/es/TaskGraph/locale/zh-TW.d.ts +0 -13
  452. package/es/TaskGraph/locale/zh-TW.js +0 -12
  453. package/es/TaskGraph/register.d.ts +0 -7
  454. package/es/TaskGraph/register.js +0 -200
  455. package/es/Welcome/index.less +0 -185
  456. package/es/index.less +0 -1
  457. package/es/variable.less +0 -54
  458. package/lib/BatchOperationBar/index.less +0 -46
  459. package/lib/BatchOperationBar/index.less.d.ts +0 -15
  460. package/lib/Boundary/index.less +0 -36
  461. package/lib/ContentWithIcon/index.less +0 -21
  462. package/lib/DateRanger/index.less +0 -157
  463. package/lib/Dialog/index.less +0 -116
  464. package/lib/FullscreenBox/index.less +0 -49
  465. package/lib/GraphToolbar/index.d.ts +0 -26
  466. package/lib/GraphToolbar/index.js +0 -154
  467. package/lib/GraphToolbar/index.less +0 -65
  468. package/lib/GraphToolbar/locale/en-US.d.ts +0 -9
  469. package/lib/GraphToolbar/locale/en-US.js +0 -32
  470. package/lib/GraphToolbar/locale/zh-CN.d.ts +0 -9
  471. package/lib/GraphToolbar/locale/zh-CN.js +0 -32
  472. package/lib/GraphToolbar/locale/zh-TW.d.ts +0 -9
  473. package/lib/GraphToolbar/locale/zh-TW.js +0 -32
  474. package/lib/Highlight/index.less +0 -381
  475. package/lib/Login/index.less +0 -268
  476. package/lib/NavMenu/index.less +0 -50
  477. package/lib/Ranger/index.less +0 -57
  478. package/lib/SideTip/index.less +0 -180
  479. package/lib/TaskGraph/Graph.d.ts +0 -24
  480. package/lib/TaskGraph/Graph.js +0 -261
  481. package/lib/TaskGraph/graph.less +0 -23
  482. package/lib/TaskGraph/index.d.ts +0 -16
  483. package/lib/TaskGraph/index.js +0 -164
  484. package/lib/TaskGraph/index.less +0 -117
  485. package/lib/TaskGraph/locale/en-US.d.ts +0 -13
  486. package/lib/TaskGraph/locale/en-US.js +0 -36
  487. package/lib/TaskGraph/locale/zh-CN.d.ts +0 -13
  488. package/lib/TaskGraph/locale/zh-CN.js +0 -36
  489. package/lib/TaskGraph/locale/zh-TW.d.ts +0 -13
  490. package/lib/TaskGraph/locale/zh-TW.js +0 -36
  491. package/lib/TaskGraph/register.d.ts +0 -7
  492. package/lib/TaskGraph/register.js +0 -205
  493. package/lib/Welcome/index.less +0 -185
  494. package/lib/index.less +0 -1
  495. package/lib/variable.less +0 -54
@@ -1,32 +1,28 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
2
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
3
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
5
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
6
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
7
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
8
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
9
- function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
10
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
11
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
12
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
13
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
14
4
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
15
5
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
16
6
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
8
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
10
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
11
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
12
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
13
+ "use client";
17
14
  import { CloseOutlined, ExpandAltOutlined, FullscreenExitOutlined, FullscreenOutlined, MinusOutlined } from '@oceanbase/icons';
18
- import React from 'react';
15
+ import React, { useCallback, useContext, useEffect, useMemo, useRef, useState } from 'react';
16
+ import { ConfigProvider } from '@oceanbase/design';
19
17
  import { createPortal } from 'react-dom';
20
18
  import LocaleWrapper from "../locale/LocaleWrapper";
21
- import { getPrefix } from "../_util";
22
19
  import { Anchor } from "./Anchor";
23
20
  import { Dock } from "./Dock";
24
21
  import { EventProxy } from "./EventProxy";
25
22
  import zhCN from "./locale/zh-CN";
26
- import "./index.less";
23
+ import useStyle from "./style";
27
24
  import { jsx as _jsx } from "react/jsx-runtime";
28
25
  import { jsxs as _jsxs } from "react/jsx-runtime";
29
- var prefix = getPrefix('dialog');
30
26
  var DEFAULT_LEFT = 0.1;
31
27
  var DEFAULT_TOP = 0.1;
32
28
  var MINIMIZE_HEIGHT = 36;
@@ -37,598 +33,562 @@ var DEFAULT_HEIGHT_MEMBER = 600;
37
33
  var DEFAULT_BORDER_WIDTH = 24;
38
34
  // 预留滚动条宽度
39
35
  var SCROLL_BAR_WIDTH = 1;
40
- var DialogComp = /*#__PURE__*/function (_React$PureComponent) {
41
- _inherits(DialogComp, _React$PureComponent);
42
- var _super = _createSuper(DialogComp);
43
- function DialogComp() {
44
- var _this$props$width, _this$props$height, _this$props$left, _this$props$width2, _this$props$top, _this$props$height2;
45
- var _this;
46
- _classCallCheck(this, DialogComp);
47
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
48
- args[_key] = arguments[_key];
49
- }
50
- _this = _super.call.apply(_super, [this].concat(args));
51
- _defineProperty(_assertThisInitialized(_this), "state", {
52
- mask: true,
53
- width: (_this$props$width = _this.props.width) !== null && _this$props$width !== void 0 ? _this$props$width : DEFAULT_WIDTH_MEMBER,
54
- height: (_this$props$height = _this.props.height) !== null && _this$props$height !== void 0 ? _this$props$height : DEFAULT_HEIGHT_MEMBER,
55
- left: (_this$props$left = _this.props.left) !== null && _this$props$left !== void 0 ? _this$props$left : _this.props.clientWidth - ((_this$props$width2 = _this.props.width) !== null && _this$props$width2 !== void 0 ? _this$props$width2 : DEFAULT_WIDTH_MEMBER) - DEFAULT_BORDER_WIDTH,
56
- top: (_this$props$top = _this.props.top) !== null && _this$props$top !== void 0 ? _this$props$top : _this.props.clientHeight - ((_this$props$height2 = _this.props.height) !== null && _this$props$height2 !== void 0 ? _this$props$height2 : DEFAULT_HEIGHT_MEMBER) - DEFAULT_BORDER_WIDTH,
57
- moveX: 0,
58
- moveY: 0,
59
- maximization: _this.props.isEmbed,
36
+ // Static container for portal
37
+ var _container = null;
38
+ var getContainer = function getContainer() {
39
+ if (!_container) {
40
+ _container = document.createElement('div');
41
+ document.body.appendChild(_container);
42
+ }
43
+ return _container;
44
+ };
45
+ var DialogComp = function DialogComp(props) {
46
+ var className = props.className,
47
+ visible = props.visible,
48
+ children = props.children,
49
+ _props$min = props.min,
50
+ min = _props$min === void 0 ? DEFAULT_MIN : _props$min,
51
+ max = props.max,
52
+ width = props.width,
53
+ height = props.height,
54
+ left = props.left,
55
+ top = props.top,
56
+ title = props.title,
57
+ onClose = props.onClose,
58
+ clientWidth = props.clientWidth,
59
+ clientHeight = props.clientHeight,
60
+ _props$resizable = props.resizable,
61
+ resizable = _props$resizable === void 0 ? true : _props$resizable,
62
+ _props$draggable = props.draggable,
63
+ draggable = _props$draggable === void 0 ? true : _props$draggable,
64
+ _props$enableMaximiza = props.enableMaximization,
65
+ enableMaximization = _props$enableMaximiza === void 0 ? true : _props$enableMaximiza,
66
+ locale = props.locale,
67
+ extLink = props.extLink,
68
+ setRootWidth = props.setRootWidth,
69
+ _props$isEmbed = props.isEmbed,
70
+ isEmbed = _props$isEmbed === void 0 ? false : _props$isEmbed;
71
+ var _useContext = useContext(ConfigProvider.ConfigContext),
72
+ getPrefixCls = _useContext.getPrefixCls;
73
+ var prefixCls = getPrefixCls('dialog');
74
+ var _useStyle = useStyle(prefixCls),
75
+ wrapSSR = _useStyle.wrapSSR;
76
+
77
+ // Refs for instance properties
78
+ var hostRef = useRef(null);
79
+ var clientXRef = useRef(0);
80
+ var clientYRef = useRef(0);
81
+ var isPointDownRef = useRef(false);
82
+ var originInfoRef = useRef({});
83
+
84
+ // State
85
+ var _useState = useState(true),
86
+ _useState2 = _slicedToArray(_useState, 2),
87
+ mask = _useState2[0],
88
+ setMask = _useState2[1];
89
+ var _useState3 = useState(width !== null && width !== void 0 ? width : DEFAULT_WIDTH_MEMBER),
90
+ _useState4 = _slicedToArray(_useState3, 2),
91
+ dialogWidth = _useState4[0],
92
+ setDialogWidth = _useState4[1];
93
+ var _useState5 = useState(height !== null && height !== void 0 ? height : DEFAULT_HEIGHT_MEMBER),
94
+ _useState6 = _slicedToArray(_useState5, 2),
95
+ dialogHeight = _useState6[0],
96
+ setDialogHeight = _useState6[1];
97
+ var _useState7 = useState(left !== null && left !== void 0 ? left : clientWidth - (width !== null && width !== void 0 ? width : DEFAULT_WIDTH_MEMBER) - DEFAULT_BORDER_WIDTH),
98
+ _useState8 = _slicedToArray(_useState7, 2),
99
+ dialogLeft = _useState8[0],
100
+ setDialogLeft = _useState8[1];
101
+ var _useState9 = useState(top !== null && top !== void 0 ? top : clientHeight - (height !== null && height !== void 0 ? height : DEFAULT_HEIGHT_MEMBER) - DEFAULT_BORDER_WIDTH),
102
+ _useState10 = _slicedToArray(_useState9, 2),
103
+ dialogTop = _useState10[0],
104
+ setDialogTop = _useState10[1];
105
+ var _useState11 = useState(0),
106
+ _useState12 = _slicedToArray(_useState11, 2),
107
+ moveX = _useState12[0],
108
+ setMoveX = _useState12[1];
109
+ var _useState13 = useState(0),
110
+ _useState14 = _slicedToArray(_useState13, 2),
111
+ moveY = _useState14[0],
112
+ setMoveY = _useState14[1];
113
+ var _useState15 = useState(isEmbed),
114
+ _useState16 = _slicedToArray(_useState15, 2),
115
+ maximization = _useState16[0],
116
+ setMaximization = _useState16[1];
117
+ var _useState17 = useState(false),
118
+ _useState18 = _slicedToArray(_useState17, 2),
119
+ minimize = _useState18[0],
120
+ setMinimize = _useState18[1];
121
+ var _useState19 = useState({}),
122
+ _useState20 = _slicedToArray(_useState19, 2),
123
+ headerStyle = _useState20[0],
124
+ setHeaderStyle = _useState20[1];
125
+
126
+ // Computed values
127
+ var maxSize = useMemo(function () {
128
+ if (max) return max;
129
+ return [clientWidth, clientHeight];
130
+ }, [max, clientWidth, clientHeight]);
131
+ var minSize = useMemo(function () {
132
+ return min;
133
+ }, [min]);
134
+ var getDefaultEmbedState = useCallback(function () {
135
+ return {
136
+ width: width !== null && width !== void 0 ? width : DEFAULT_WIDTH_MEMBER,
137
+ height: height !== null && height !== void 0 ? height : DEFAULT_HEIGHT_MEMBER,
138
+ left: left !== null && left !== void 0 ? left : clientWidth - (width !== null && width !== void 0 ? width : DEFAULT_WIDTH_MEMBER) - DEFAULT_BORDER_WIDTH,
139
+ top: top !== null && top !== void 0 ? top : clientHeight - (height !== null && height !== void 0 ? height : DEFAULT_HEIGHT_MEMBER) - DEFAULT_BORDER_WIDTH
140
+ };
141
+ }, [width, height, left, top, clientWidth, clientHeight]);
142
+ var setRootWidthInEmbedMode = useCallback(function (newWidth) {
143
+ var restWidth = !!newWidth ? newWidth + SCROLL_BAR_WIDTH : 0;
144
+ var rootWidth = (clientWidth - restWidth) / clientWidth;
145
+ setRootWidth === null || setRootWidth === void 0 || setRootWidth("".concat(rootWidth * 100, "%"));
146
+ }, [clientWidth, setRootWidth]);
147
+ var compatClonedModel = useCallback(function (model) {
148
+ return _objectSpread({
149
+ left: DEFAULT_LEFT,
150
+ top: DEFAULT_TOP,
151
+ width: DEFAULT_WIDTH_MEMBER / clientWidth,
152
+ height: DEFAULT_HEIGHT_MEMBER / clientHeight,
60
153
  minimize: false,
61
- headerStyle: {}
62
- });
63
- _defineProperty(_assertThisInitialized(_this), "clientX", 0);
64
- _defineProperty(_assertThisInitialized(_this), "clientY", 0);
65
- _defineProperty(_assertThisInitialized(_this), "getDefaultEmbedState", function () {
66
- var _this$props = _this.props,
67
- clientHeight = _this$props.clientHeight,
68
- clientWidth = _this$props.clientWidth,
69
- width = _this$props.width,
70
- height = _this$props.height,
71
- left = _this$props.left,
72
- top = _this$props.top;
73
- return {
74
- width: width !== null && width !== void 0 ? width : DEFAULT_WIDTH_MEMBER,
75
- height: height !== null && height !== void 0 ? height : DEFAULT_HEIGHT_MEMBER,
76
- left: left !== null && left !== void 0 ? left : clientWidth - (width !== null && width !== void 0 ? width : DEFAULT_WIDTH_MEMBER) - DEFAULT_BORDER_WIDTH,
77
- top: top !== null && top !== void 0 ? top : clientHeight - (height !== null && height !== void 0 ? height : DEFAULT_HEIGHT_MEMBER) - DEFAULT_BORDER_WIDTH
78
- };
79
- });
80
- _defineProperty(_assertThisInitialized(_this), "host", document.createElement('div'));
81
- _defineProperty(_assertThisInitialized(_this), "isPointDown", false);
82
- _defineProperty(_assertThisInitialized(_this), "onDragStart", function (event) {
83
- if (!_this.props.draggable) return;
84
- var maximization = _this.state.maximization;
85
- if (maximization) return;
86
- _this.setState(_objectSpread(_objectSpread({
87
- mask: true
88
- }, _this.state.left === undefined ? {
89
- left: DEFAULT_LEFT
90
- } : {}), _this.state.top === undefined ? {
91
- top: DEFAULT_TOP
92
- } : {}));
93
- _this.clientX = event.clientX;
94
- _this.clientY = event.clientY;
95
- _this.isPointDown = true;
96
- });
97
- _defineProperty(_assertThisInitialized(_this), "onDragMove", function (event) {
98
- if (!_this.props.draggable || !_this.isPointDown) return;
99
- event.preventDefault();
100
- _this.setState({
101
- moveX: event.clientX - _this.clientX,
102
- moveY: event.clientY - _this.clientY
103
- });
104
- });
105
- _defineProperty(_assertThisInitialized(_this), "onDragEnd", function () {
106
- var draggable = _this.props.draggable;
107
- if (!draggable) return;
108
- _this.isPointDown = false;
109
- if (_this.state.moveX === 0 && _this.state.moveY === 0) return;
110
- _this.setState({
111
- mask: false,
112
- left: _this.state.left + _this.state.moveX,
113
- top: _this.state.top + _this.state.moveY,
114
- moveX: 0,
115
- moveY: 0
116
- });
117
- });
118
- _defineProperty(_assertThisInitialized(_this), "toggleMinimize", function () {
119
- _this.setState({
120
- maximization: false,
121
- minimize: !_this.state.minimize
122
- });
123
- });
124
- _defineProperty(_assertThisInitialized(_this), "toggleMaximization", function () {
125
- // 嵌入模式不支持toggleMaximization
126
- var enable = _this.props.resizable && _this.props.enableMaximization && !_this.props.isEmbed;
127
- if (!enable) return;
128
- _this.setState({
129
- maximization: !_this.state.maximization,
130
- minimize: false
131
- });
132
- });
133
- _defineProperty(_assertThisInitialized(_this), "onClose", function (event) {
134
- var _this$props$onClose, _this$props2;
135
- event.stopPropagation();
136
- (_this$props$onClose = (_this$props2 = _this.props).onClose) === null || _this$props$onClose === void 0 || _this$props$onClose.call(_this$props2);
137
- });
138
- _defineProperty(_assertThisInitialized(_this), "getBaseStyle", function () {
139
- var visible = _this.props.visible;
140
- // 通过样式控制显隐
141
- var baseStyle = {
142
- visibility: visible ? 'visible' : 'hidden',
143
- opacity: visible ? 1 : 0
144
- };
145
- return baseStyle;
146
- });
147
- _defineProperty(_assertThisInitialized(_this), "getStyle", function () {
148
- var _this$state = _this.state,
149
- maximization = _this$state.maximization,
150
- minimize = _this$state.minimize,
151
- headerStyle = _this$state.headerStyle;
152
- var transform = "translate(".concat(_this.state.moveX, "px, ").concat(_this.state.moveY, "px)");
153
- var baseStyle = _this.getBaseStyle();
154
- if (maximization && !_this.props.isEmbed) {
155
- return _objectSpread(_objectSpread({}, baseStyle), {}, {
156
- top: 0,
157
- bottom: 0,
158
- right: 0,
159
- width: _this.props.width || DEFAULT_WIDTH_MEMBER,
160
- height: 'auto',
161
- borderRadius: 0
162
- });
163
- } else if (minimize) {
164
- var _ref = headerStyle,
165
- height = _ref.height;
166
- return _objectSpread(_objectSpread(_objectSpread({}, baseStyle), _this.getCompatAbsPostion(_this.state)), {}, {
167
- width: MINIMIZE_WIDTH,
168
- height: height || MINIMIZE_HEIGHT,
169
- transform: transform
170
- });
171
- } else {
172
- return _objectSpread(_objectSpread(_objectSpread({}, baseStyle), _this.getCompatAbsPostion(_this.state)), {}, {
173
- transform: transform
174
- });
154
+ maximization: false
155
+ }, model);
156
+ }, [clientWidth, clientHeight]);
157
+ var checkSize = function checkSize(w, h) {
158
+ var newModel = {};
159
+ var result = {
160
+ widthShouldChange: true,
161
+ heightShouldChange: true
162
+ };
163
+ if (minSize && w < minSize[0]) {
164
+ newModel.width = minSize[0];
165
+ result.widthShouldChange = false;
166
+ }
167
+ if (minSize && h < minSize[1]) {
168
+ newModel.height = minSize[1];
169
+ result.heightShouldChange = false;
170
+ }
171
+ if (maxSize && w > maxSize[0]) {
172
+ newModel.width = maxSize[0];
173
+ result.widthShouldChange = false;
174
+ }
175
+ if (maxSize && h > maxSize[1]) {
176
+ newModel.height = maxSize[1];
177
+ result.heightShouldChange = false;
178
+ }
179
+ return result;
180
+ };
181
+
182
+ // componentDidMount
183
+ useEffect(function () {
184
+ var host = document.createElement('div');
185
+ hostRef.current = host;
186
+ getContainer().appendChild(host);
187
+ return function () {
188
+ if (hostRef.current && getContainer().contains(hostRef.current)) {
189
+ getContainer().removeChild(hostRef.current);
175
190
  }
191
+ };
192
+ }, []);
193
+
194
+ // componentDidUpdate
195
+ useEffect(function () {
196
+ if (!visible) {
197
+ setRootWidthInEmbedMode(0);
198
+ return;
199
+ }
200
+ var tempState = getDefaultEmbedState();
201
+ setDialogWidth(tempState.width);
202
+ setDialogHeight(tempState.height);
203
+ setDialogLeft(tempState.left);
204
+ setDialogTop(tempState.top);
205
+ setRootWidthInEmbedMode(tempState.width);
206
+ }, [visible, clientWidth, clientHeight, getDefaultEmbedState, setRootWidthInEmbedMode]);
207
+ useEffect(function () {
208
+ if (isEmbed) {
209
+ setMinimize(false);
210
+ setMaximization(true);
211
+ } else {
212
+ setMinimize(false);
213
+ setMaximization(false);
214
+ if (height) setDialogHeight(height);
215
+ if (width) setDialogWidth(width);
216
+ if (top !== undefined) setDialogTop(top);
217
+ if (left !== undefined) setDialogLeft(left);
218
+ }
219
+ }, [isEmbed, height, width, top, left]);
220
+
221
+ // Drag handlers
222
+ var onDragStart = function onDragStart(event) {
223
+ if (!draggable) return;
224
+ if (maximization) return;
225
+ setMask(true);
226
+ if (dialogLeft === undefined) {
227
+ setDialogLeft(DEFAULT_LEFT);
228
+ }
229
+ if (dialogTop === undefined) {
230
+ setDialogTop(DEFAULT_TOP);
231
+ }
232
+ clientXRef.current = event.clientX;
233
+ clientYRef.current = event.clientY;
234
+ isPointDownRef.current = true;
235
+ };
236
+ var onDragMove = function onDragMove(event) {
237
+ if (!draggable || !isPointDownRef.current) return;
238
+ event.preventDefault();
239
+ setMoveX(event.clientX - clientXRef.current);
240
+ setMoveY(event.clientY - clientYRef.current);
241
+ };
242
+ var onDragEnd = function onDragEnd() {
243
+ if (!draggable) return;
244
+ isPointDownRef.current = false;
245
+ if (moveX === 0 && moveY === 0) return;
246
+ setMask(false);
247
+ setDialogLeft(function (prev) {
248
+ return (prev !== null && prev !== void 0 ? prev : 0) + moveX;
176
249
  });
177
- _defineProperty(_assertThisInitialized(_this), "compatClonedModel", function (model) {
178
- return _objectSpread({
179
- left: DEFAULT_LEFT,
180
- top: DEFAULT_TOP,
181
- width: DEFAULT_WIDTH_MEMBER / _this.props.clientWidth,
182
- height: DEFAULT_HEIGHT_MEMBER / _this.props.clientHeight,
183
- minimize: false,
184
- maximization: false
185
- }, model);
186
- });
187
- _defineProperty(_assertThisInitialized(_this), "detectPointUp", function () {
188
- _this.setState({
189
- mask: false
190
- });
191
- });
192
- _defineProperty(_assertThisInitialized(_this), "originInfo", void 0);
193
- _defineProperty(_assertThisInitialized(_this), "setRootWidthInEmbedMode", function (newWidth) {
194
- var setRootWidth = _this.props.setRootWidth;
195
- var restWidth = !!newWidth ? newWidth + SCROLL_BAR_WIDTH : 0;
196
- var rootWidth = (_this.props.clientWidth - restWidth) / _this.props.clientWidth;
197
- setRootWidth === null || setRootWidth === void 0 || setRootWidth("".concat(rootWidth * 100, "%"));
250
+ setDialogTop(function (prev) {
251
+ return (prev !== null && prev !== void 0 ? prev : 0) + moveY;
198
252
  });
199
- _defineProperty(_assertThisInitialized(_this), "onResizeStart", function () {
200
- if (_this.state.minimize || !_this.props.resizable) return;
201
- _this.originInfo = _this.compatClonedModel(_this.state);
202
- _this.setState({
203
- mask: true
204
- });
253
+ setMoveX(0);
254
+ setMoveY(0);
255
+ };
256
+ var detectPointUp = function detectPointUp() {
257
+ setMask(false);
258
+ };
259
+
260
+ // Resize handlers
261
+ var onResizeStart = function onResizeStart() {
262
+ if (minimize || !resizable) return;
263
+ originInfoRef.current = compatClonedModel({
264
+ width: dialogWidth,
265
+ height: dialogHeight,
266
+ left: dialogLeft,
267
+ top: dialogTop,
268
+ minimize: minimize,
269
+ maximization: maximization
205
270
  });
206
- _defineProperty(_assertThisInitialized(_this), "onResizeMove", function (event) {
207
- var resizable = _this.props.resizable;
208
- event.preventDefault();
209
- if (_this.state.minimize || !resizable) return;
210
- // 以下PointerEvent没有moveRight属性,通过event传递,所以加上了ts-ignore
271
+ setMask(true);
272
+ };
273
+ var onResizeMove = function onResizeMove(event) {
274
+ event.preventDefault();
275
+ if (minimize || !resizable) return;
276
+ // @ts-ignore
277
+ var newWidth = originInfoRef.current.width + event.moveRight;
278
+ // @ts-ignore
279
+ var newHeight = originInfoRef.current.height + event.moveBottom;
280
+ var checkResult = checkSize(newWidth, newHeight);
281
+ if (checkResult.widthShouldChange) {
282
+ setRootWidthInEmbedMode(newWidth);
283
+ }
284
+ if (checkResult.widthShouldChange) {
211
285
  // @ts-ignore
212
- var newWidth = _this.originInfo.width + event.moveRight;
286
+ setDialogLeft(originInfoRef.current.left + event.moveLeft);
287
+ setDialogWidth(newWidth);
288
+ }
289
+ if (checkResult.heightShouldChange) {
213
290
  // @ts-ignore
214
- var newHeight = _this.originInfo.height + event.moveBottom;
215
- var checkResult = _this.checkSize(newWidth, newHeight);
291
+ setDialogTop(originInfoRef.current.top + event.moveTop);
292
+ setDialogHeight(newHeight);
293
+ }
294
+ };
295
+ var onResizeEnd = function onResizeEnd() {
296
+ if (!mask || !resizable) return;
297
+ setMask(false);
298
+ };
216
299
 
217
- // 只在宽度允许发生改变时设置外部width
218
- if (checkResult.widthShouldChange) {
219
- _this.setRootWidthInEmbedMode(newWidth);
220
- }
221
- _this.setState(_objectSpread(_objectSpread({}, checkResult.widthShouldChange ? {
222
- // @ts-ignore
223
- left: _this.originInfo.left + event.moveLeft,
224
- width: newWidth
225
- } : {}), checkResult.heightShouldChange ? {
226
- // @ts-ignore
227
- top: _this.originInfo.top + event.moveTop,
228
- height: newHeight
229
- } : {}));
300
+ // Toggle handlers
301
+ var toggleMinimize = function toggleMinimize() {
302
+ setMaximization(false);
303
+ setMinimize(function (prev) {
304
+ return !prev;
230
305
  });
231
- _defineProperty(_assertThisInitialized(_this), "onResizeEnd", function () {
232
- var mask = _this.state.mask;
233
- if (!mask || !_this.props.resizable) return;
234
- _this.setState({
235
- mask: false
236
- });
306
+ };
307
+ var toggleMaximization = function toggleMaximization() {
308
+ var enable = resizable && enableMaximization && !isEmbed;
309
+ if (!enable) return;
310
+ setMaximization(function (prev) {
311
+ return !prev;
237
312
  });
238
- return _this;
239
- }
240
- _createClass(DialogComp, [{
241
- key: "componentDidMount",
242
- value: function componentDidMount() {
243
- DialogComp.container.appendChild(this.host);
313
+ setMinimize(false);
314
+ };
315
+ var handleClose = function handleClose(event) {
316
+ event.stopPropagation();
317
+ onClose === null || onClose === void 0 || onClose();
318
+ };
319
+
320
+ // Style calculations
321
+ var getBaseStyle = useCallback(function () {
322
+ return {
323
+ visibility: visible ? 'visible' : 'hidden',
324
+ opacity: visible ? 1 : 0
325
+ };
326
+ }, [visible]);
327
+ var getCompatAbsPostion = useCallback(function (info) {
328
+ var compatInfo = compatClonedModel(info);
329
+ var isMinimize = compatInfo.minimize;
330
+ var ret = {};
331
+ ['left', 'width', 'top', 'height'].forEach(function (key) {
332
+ ret[key] = compatInfo[key];
333
+ });
334
+
335
+ // Apply min/max constraints
336
+ if (maxSize && ret.width > maxSize[0]) {
337
+ ret.width = maxSize[0];
244
338
  }
245
- }, {
246
- key: "componentDidUpdate",
247
- value: function componentDidUpdate(prevProps, _) {
248
- var preVisible = prevProps.visible,
249
- preClientWidth = prevProps.clientWidth,
250
- preClientHeight = prevProps.clientHeight,
251
- preIsEmbed = prevProps.isEmbed;
252
- var _this$props3 = this.props,
253
- visible = _this$props3.visible,
254
- isEmbed = _this$props3.isEmbed,
255
- clientWidth = _this$props3.clientWidth,
256
- clientHeight = _this$props3.clientHeight,
257
- height = _this$props3.height,
258
- width = _this$props3.width,
259
- top = _this$props3.top,
260
- left = _this$props3.left;
261
- // 嵌入式切换非嵌入式,属性重置
262
- if (preIsEmbed && !isEmbed) {
263
- this.setRootWidthInEmbedMode(0);
264
- this.setState(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
265
- minimize: false,
266
- maximization: false
267
- }, height ? {
268
- height: height
269
- } : {}), width ? {
270
- width: width
271
- } : {}), top ? {
272
- top: top
273
- } : {}), left ? {
274
- left: left
275
- } : {}));
276
- return;
277
- }
278
- // 非嵌入式切换嵌入式,属性重置
279
- if (!preIsEmbed && isEmbed) {
280
- this.setState({
281
- minimize: false,
282
- maximization: true
283
- });
284
- }
285
- if (visible) {
286
- if (!preVisible || clientWidth !== preClientWidth || clientHeight !== preClientHeight) {
287
- var tempState = this.getDefaultEmbedState();
288
- this.setState(tempState);
289
- this.setRootWidthInEmbedMode(tempState === null || tempState === void 0 ? void 0 : tempState.width);
290
- }
291
- } else if (preVisible && !visible) {
292
- this.setRootWidthInEmbedMode(0);
293
- }
339
+ if (maxSize && ret.height > maxSize[1]) {
340
+ ret.height = maxSize[1];
294
341
  }
295
- }, {
296
- key: "componentWillUnmount",
297
- value: function componentWillUnmount() {
298
- DialogComp.container.removeChild(this.host);
342
+ if (minSize && ret.width < minSize[0]) {
343
+ ret.width = minSize[0];
299
344
  }
300
- }, {
301
- key: "max",
302
- get: function get() {
303
- var max = this.props.max;
304
- if (!max) {
305
- var _this$props4 = this.props,
306
- clientWidth = _this$props4.clientWidth,
307
- clientHeight = _this$props4.clientHeight;
308
- max = [clientWidth, clientHeight];
309
- }
310
- return max;
345
+ if (minSize && ret.height < minSize[1]) {
346
+ ret.height = minSize[1];
311
347
  }
312
- }, {
313
- key: "min",
314
- get: function get() {
315
- return this.props.min;
348
+ ret.width = isMinimize ? MINIMIZE_WIDTH : ret.width;
349
+ ret.height = isMinimize ? MINIMIZE_HEIGHT : ret.height;
350
+
351
+ // Adjust position if out of bounds (calculate but don't setState here)
352
+ if (ret.left + ret.width > clientWidth) {
353
+ ret.left = clientWidth - ret.width;
316
354
  }
317
- }, {
318
- key: "hasMask",
319
- get: function get() {
320
- return this.state.mask;
355
+ if (ret.left < 0) {
356
+ ret.left = 0;
321
357
  }
322
- }, {
323
- key: "renderHeader",
324
- value: function renderHeader() {
325
- var _this$props5 = this.props,
326
- locale = _this$props5.locale,
327
- title = _this$props5.title,
328
- isEmbed = _this$props5.isEmbed;
329
- var _this$state2 = this.state,
330
- headerStyle = _this$state2.headerStyle,
331
- minimize = _this$state2.minimize;
332
- var style = _objectSpread(_objectSpread(_objectSpread({}, headerStyle), minimize ? {
333
- boxShadow: '0 2px 20px 0 rgba(4, 1, 30, 0.07)'
334
- } : {}), isEmbed ? {
335
- cursor: 'initial'
336
- } : {});
337
- return /*#__PURE__*/_jsxs("header", {
338
- className: "".concat(prefix, "-header"),
339
- style: style,
340
- onPointerDown: this.onDragStart,
341
- onDoubleClick: this.toggleMaximization,
342
- children: [/*#__PURE__*/_jsx("span", {
343
- className: "".concat(prefix, "-title"),
344
- children: title || locale.helpDocument
345
- }), this.renderControls()]
346
- });
358
+ if (ret.top < 0) {
359
+ ret.top = 0;
347
360
  }
348
- }, {
349
- key: "renderControlLink",
350
- value: function renderControlLink() {
351
- var extLink = this.props.extLink;
352
- return /*#__PURE__*/_jsx("span", {
353
- className: "".concat(prefix, "-item"),
354
- children: /*#__PURE__*/_jsx("a", {
355
- className: "".concat(prefix, "-item-link"),
356
- href: extLink === null || extLink === void 0 ? void 0 : extLink.link,
357
- target: "_blank",
358
- rel: "noopener noreferrer",
359
- children: /*#__PURE__*/_jsx("svg", {
360
- // t="1679557306532"
361
- className: "icon",
362
- viewBox: "0 0 1024 1024",
363
- version: "1.1",
364
- xmlns: "http://www.w3.org/2000/svg"
365
- // p-id="2545"
366
- ,
367
- width: "16",
368
- height: "16",
369
- children: /*#__PURE__*/_jsx("path", {
370
- d: "M880.0256 912.0256H144.0256a31.9488 31.9488 0 0 1-32.0512-32V144.0256c0-17.7152 14.336-32.0512 32.0512-32.0512h359.936c4.4544 0 8.0384 3.584 8.0384 8.0384v56.0128c0 4.352-3.584 7.9872-7.9872 7.9872h-320v655.9744h655.9744v-320c0-4.4032 3.584-7.9872 8.0384-7.9872h55.9616c4.4032 0 8.0384 3.584 8.0384 7.9872v359.9872c0 17.7152-14.336 32-32 32zM770.8672 199.1168l-52.224-52.224a8.0384 8.0384 0 0 1 4.7104-13.568l179.4048-20.992c5.12-0.6144 9.5232 3.6864 8.9088 8.9088l-20.992 179.4048a8.0384 8.0384 0 0 1-13.6192 4.6592L824.6784 252.928l-256.2048 256.2048c-3.072 3.072-8.192 3.072-11.264 0l-42.4448-42.3936a8.0384 8.0384 0 0 1 0-11.264l256.1024-256.3584z"
371
- // p-id="2546"
372
- })
373
- })
374
- })
375
- });
361
+ if (ret.top + ret.height > clientHeight) {
362
+ ret.top = clientHeight - ret.height;
376
363
  }
377
- }, {
378
- key: "renderControls",
379
- value: function renderControls() {
380
- var _this$state3 = this.state,
381
- maximization = _this$state3.maximization,
382
- minimize = _this$state3.minimize;
383
- var _this$props6 = this.props,
384
- enableMaximization = _this$props6.enableMaximization,
385
- isEmbed = _this$props6.isEmbed;
386
- if (isEmbed) {
387
- return /*#__PURE__*/_jsxs("span", {
388
- className: "".concat(prefix, "-controls"),
389
- children: [this.renderControlLink(), /*#__PURE__*/_jsx("span", {
390
- className: "".concat(prefix, "-item"),
391
- onClick: this.onClose,
392
- children: /*#__PURE__*/_jsx(CloseOutlined, {})
393
- })]
394
- });
395
- }
396
- return /*#__PURE__*/_jsxs("span", {
397
- className: "".concat(prefix, "-controls"),
398
- children: [this.renderControlLink(), /*#__PURE__*/_jsx("span", {
399
- className: "".concat(prefix, "-item"),
400
- onClick: this.toggleMinimize,
401
- children: minimize ? /*#__PURE__*/_jsx(ExpandAltOutlined, {}) : /*#__PURE__*/_jsx(MinusOutlined, {})
402
- }), enableMaximization && /*#__PURE__*/_jsx("span", {
403
- className: "".concat(prefix, "-item"),
404
- onClick: this.toggleMaximization,
405
- children: maximization ? /*#__PURE__*/_jsx(FullscreenExitOutlined, {}) : /*#__PURE__*/_jsx(FullscreenOutlined, {})
406
- }), /*#__PURE__*/_jsx("span", {
407
- className: "".concat(prefix, "-item"),
408
- onClick: this.onClose,
409
- children: /*#__PURE__*/_jsx(CloseOutlined, {})
410
- })]
411
- });
364
+ return ret;
365
+ }, [maxSize, minSize, clientWidth, clientHeight, compatClonedModel]);
366
+
367
+ // Adjust position if out of bounds
368
+ useEffect(function () {
369
+ if (!visible) return;
370
+ var adjusted = getCompatAbsPostion({
371
+ width: dialogWidth,
372
+ height: dialogHeight,
373
+ left: dialogLeft,
374
+ top: dialogTop,
375
+ minimize: minimize
376
+ });
377
+ if (adjusted.left !== dialogLeft) {
378
+ setDialogLeft(adjusted.left);
412
379
  }
413
- }, {
414
- key: "renderContent",
415
- value: function renderContent() {
416
- var children = this.props.children;
417
- return /*#__PURE__*/_jsxs("main", {
418
- className: "".concat(prefix, "-main"),
419
- style: this.state.minimize ? {
420
- visibility: 'hidden'
421
- } : {},
422
- children: [this.renderMask(), children]
423
- });
380
+ if (adjusted.top !== dialogTop) {
381
+ setDialogTop(adjusted.top);
424
382
  }
425
- }, {
426
- key: "renderMask",
427
- value: function renderMask() {
428
- if (!this.hasMask) return;
429
- return /*#__PURE__*/_jsx("div", {
430
- className: "".concat(prefix, "-mask")
383
+ }, [dialogWidth, dialogHeight, dialogLeft, dialogTop, minimize, visible, getCompatAbsPostion]);
384
+ var getStyle = useMemo(function () {
385
+ var transform = "translate(".concat(moveX, "px, ").concat(moveY, "px)");
386
+ var baseStyle = getBaseStyle();
387
+ if (maximization && !isEmbed) {
388
+ return _objectSpread(_objectSpread({}, baseStyle), {}, {
389
+ top: 0,
390
+ bottom: 0,
391
+ right: 0,
392
+ width: width || DEFAULT_WIDTH_MEMBER,
393
+ height: 'auto',
394
+ borderRadius: 0
431
395
  });
432
- }
433
- }, {
434
- key: "getCompatAbsPostion",
435
- value:
436
- // 将比例转换为绝对数值,各个端的渲染依据视口大小会有不同
437
- function getCompatAbsPostion(info) {
438
- var compatInfo = this.compatClonedModel(info);
439
- var minimize = compatInfo.minimize;
440
- var _this$props7 = this.props,
441
- clientWidth = _this$props7.clientWidth,
442
- clientHeight = _this$props7.clientHeight;
443
- var ret = {};
444
- ['left', 'width', 'top', 'height'].forEach(function (key) {
445
- ret[key] = compatInfo[key];
396
+ } else if (minimize) {
397
+ var _ref = headerStyle,
398
+ headerHeight = _ref.height;
399
+ var position = getCompatAbsPostion({
400
+ width: dialogWidth,
401
+ height: dialogHeight,
402
+ left: dialogLeft,
403
+ top: dialogTop,
404
+ minimize: minimize
446
405
  });
447
- var max = this.max;
448
- var min = this.min;
449
- // 最小宽度
450
- if (max && ret.width > max[0]) {
451
- ret.width = max[0];
452
- }
453
- if (max && ret.height > max[1]) {
454
- ret.height = max[1];
455
- }
456
- if (min && ret.width < min[0]) {
457
- ret.width = min[0];
458
- }
459
- if (min && ret.height < min[1]) {
460
- ret.height = min[1];
461
- }
462
- ret.width = minimize ? MINIMIZE_WIDTH : ret.width;
463
- ret.height = minimize ? MINIMIZE_HEIGHT : ret.height;
464
- if (ret.left + ret.width > clientWidth) {
465
- ret.left = clientWidth - ret.width;
466
- this.setState({
467
- left: ret.left
468
- });
469
- }
470
- if (ret.left < 0) {
471
- this.setState({
472
- left: 0
473
- });
474
- }
475
- if (ret.top < 0) {
476
- this.setState({
477
- top: 0
478
- });
479
- }
480
- if (ret.top + ret.height > clientHeight) {
481
- ret.top = clientHeight - ret.height;
482
- this.setState({
483
- top: ret.top
484
- });
485
- }
486
- return ret;
487
- }
488
- }, {
489
- key: "renderDialog",
490
- value: function renderDialog() {
491
- var style = this.getStyle();
492
- var _this$props8 = this.props,
493
- className = _this$props8.className,
494
- isEmbed = _this$props8.isEmbed;
495
- return /*#__PURE__*/_jsx(React.Fragment, {
496
- children: /*#__PURE__*/_jsxs("div", _objectSpread(_objectSpread({
497
- className: "".concat(prefix, "-container ").concat(className, " ").concat(isEmbed ? "".concat(prefix, "-container-embed") : ''),
498
- style: style
499
- }, this.state.minimize ? {} : {
500
- tabIndex: 0
501
- }), {}, {
502
- children: [this.renderHeader(), this.renderContent(), isEmbed ? this.renderEmbedBorders() : this.renderBorders(), /*#__PURE__*/_jsx(EventProxy, {
503
- onPointerMove: this.onDragMove,
504
- onPointerUp: this.onDragEnd
505
- }), /*#__PURE__*/_jsx(EventProxy, {
506
- onPointerUp: this.detectPointUp
507
- })]
508
- }))
406
+ return _objectSpread(_objectSpread(_objectSpread({}, baseStyle), position), {}, {
407
+ width: MINIMIZE_WIDTH,
408
+ height: headerHeight || MINIMIZE_HEIGHT,
409
+ transform: transform
509
410
  });
510
- }
511
- }, {
512
- key: "checkSize",
513
- value:
514
- /**
515
- * width,height 是否在最大最小值的范围内
516
- */
517
- function checkSize(width, height) {
518
- var max = this.max;
519
- var min = this.min;
520
- var newModel = {};
521
- var result = {
522
- widthShouldChange: true,
523
- heightShouldChange: true
524
- };
525
- if (min && width < min[0]) {
526
- newModel.width = min[0];
527
- result.widthShouldChange = false;
528
- }
529
- if (min && height < min[1]) {
530
- newModel.height = min[1];
531
- result.heightShouldChange = false;
532
- }
533
- if (max && width > max[0]) {
534
- newModel.width = max[0];
535
- result.widthShouldChange = false;
536
- }
537
- if (max && height > max[1]) {
538
- newModel.height = max[1];
539
- result.heightShouldChange = false;
540
- }
541
- return result;
542
- }
543
- }, {
544
- key: "renderEmbedBorders",
545
- value: function renderEmbedBorders() {
546
- return /*#__PURE__*/_jsx(React.Fragment, {
547
- children: /*#__PURE__*/_jsx(Anchor, {
548
- dock: Dock.left,
549
- onStart: this.onResizeStart,
550
- onMove: this.onResizeMove,
551
- onEnd: this.onResizeEnd
552
- })
411
+ } else {
412
+ var _position = getCompatAbsPostion({
413
+ width: dialogWidth,
414
+ height: dialogHeight,
415
+ left: dialogLeft,
416
+ top: dialogTop
417
+ });
418
+ return _objectSpread(_objectSpread(_objectSpread({}, baseStyle), _position), {}, {
419
+ transform: transform
553
420
  });
554
421
  }
555
- }, {
556
- key: "renderBorders",
557
- value: function renderBorders() {
558
- return /*#__PURE__*/_jsxs(React.Fragment, {
559
- children: [/*#__PURE__*/_jsx(Anchor, {
560
- dock: Dock.top,
561
- onStart: this.onResizeStart,
562
- onMove: this.onResizeMove,
563
- onEnd: this.onResizeEnd
564
- }), /*#__PURE__*/_jsx(Anchor, {
565
- dock: Dock.right,
566
- onStart: this.onResizeStart,
567
- onMove: this.onResizeMove,
568
- onEnd: this.onResizeEnd
569
- }), /*#__PURE__*/_jsx(Anchor, {
570
- dock: Dock.bottom,
571
- onStart: this.onResizeStart,
572
- onMove: this.onResizeMove,
573
- onEnd: this.onResizeEnd
574
- }), /*#__PURE__*/_jsx(Anchor, {
575
- dock: Dock.left,
576
- onStart: this.onResizeStart,
577
- onMove: this.onResizeMove,
578
- onEnd: this.onResizeEnd
579
- }), /*#__PURE__*/_jsx(Anchor, {
580
- dock: Dock.topLeft,
581
- onStart: this.onResizeStart,
582
- onMove: this.onResizeMove,
583
- onEnd: this.onResizeEnd
584
- }), /*#__PURE__*/_jsx(Anchor, {
585
- dock: Dock.topRight,
586
- onStart: this.onResizeStart,
587
- onMove: this.onResizeMove,
588
- onEnd: this.onResizeEnd
589
- }), /*#__PURE__*/_jsx(Anchor, {
590
- dock: Dock.bottomLeft,
591
- onStart: this.onResizeStart,
592
- onMove: this.onResizeMove,
593
- onEnd: this.onResizeEnd
594
- }), /*#__PURE__*/_jsx(Anchor, {
595
- dock: Dock.bottomRight,
596
- onStart: this.onResizeStart,
597
- onMove: this.onResizeMove,
598
- onEnd: this.onResizeEnd
422
+ }, [maximization, isEmbed, minimize, moveX, moveY, width, headerStyle, dialogWidth, dialogHeight, dialogLeft, dialogTop, getCompatAbsPostion, getBaseStyle]);
423
+
424
+ // Render methods
425
+ var renderControlLink = function renderControlLink() {
426
+ return /*#__PURE__*/_jsx("span", {
427
+ className: "".concat(prefixCls, "-item"),
428
+ children: /*#__PURE__*/_jsx("a", {
429
+ className: "".concat(prefixCls, "-item-link"),
430
+ href: extLink === null || extLink === void 0 ? void 0 : extLink.link,
431
+ target: "_blank",
432
+ rel: "noopener noreferrer",
433
+ children: /*#__PURE__*/_jsx("svg", {
434
+ className: "icon",
435
+ viewBox: "0 0 1024 1024",
436
+ version: "1.1",
437
+ xmlns: "http://www.w3.org/2000/svg",
438
+ width: "16",
439
+ height: "16",
440
+ children: /*#__PURE__*/_jsx("path", {
441
+ d: "M880.0256 912.0256H144.0256a31.9488 31.9488 0 0 1-32.0512-32V144.0256c0-17.7152 14.336-32.0512 32.0512-32.0512h359.936c4.4544 0 8.0384 3.584 8.0384 8.0384v56.0128c0 4.352-3.584 7.9872-7.9872 7.9872h-320v655.9744h655.9744v-320c0-4.4032 3.584-7.9872 8.0384-7.9872h55.9616c4.4032 0 8.0384 3.584 8.0384 7.9872v359.9872c0 17.7152-14.336 32-32 32zM770.8672 199.1168l-52.224-52.224a8.0384 8.0384 0 0 1 4.7104-13.568l179.4048-20.992c5.12-0.6144 9.5232 3.6864 8.9088 8.9088l-20.992 179.4048a8.0384 8.0384 0 0 1-13.6192 4.6592L824.6784 252.928l-256.2048 256.2048c-3.072 3.072-8.192 3.072-11.264 0l-42.4448-42.3936a8.0384 8.0384 0 0 1 0-11.264l256.1024-256.3584z"
442
+ })
443
+ })
444
+ })
445
+ });
446
+ };
447
+ var renderControls = function renderControls() {
448
+ if (isEmbed) {
449
+ return /*#__PURE__*/_jsxs("span", {
450
+ className: "".concat(prefixCls, "-controls"),
451
+ children: [renderControlLink(), /*#__PURE__*/_jsx("span", {
452
+ className: "".concat(prefixCls, "-item"),
453
+ onClick: handleClose,
454
+ children: /*#__PURE__*/_jsx(CloseOutlined, {})
599
455
  })]
600
456
  });
601
457
  }
602
- }, {
603
- key: "render",
604
- value: function render() {
605
- var _this$props9 = this.props,
606
- visible = _this$props9.visible,
607
- isEmbed = _this$props9.isEmbed;
608
- // 嵌入模式通过style控制显隐
609
- if (!visible && !isEmbed) return /*#__PURE__*/_jsx(React.Fragment, {});
610
- return /*#__PURE__*/createPortal(this.renderDialog(), DialogComp.container);
611
- }
612
- }], [{
613
- key: "container",
614
- get: function get() {
615
- if (!this._container) {
616
- this._container = document.createElement('div');
617
- document.body.appendChild(this._container);
618
- }
619
- return this._container;
620
- }
621
- }]);
622
- return DialogComp;
623
- }(React.PureComponent);
624
- _defineProperty(DialogComp, "defaultProps", {
625
- min: DEFAULT_MIN,
626
- resizable: true,
627
- draggable: true,
628
- enableMaximization: true,
629
- isEmbed: false
630
- });
631
- _defineProperty(DialogComp, "_container", void 0);
458
+ return /*#__PURE__*/_jsxs("span", {
459
+ className: "".concat(prefixCls, "-controls"),
460
+ children: [renderControlLink(), /*#__PURE__*/_jsx("span", {
461
+ className: "".concat(prefixCls, "-item"),
462
+ onClick: toggleMinimize,
463
+ children: minimize ? /*#__PURE__*/_jsx(ExpandAltOutlined, {}) : /*#__PURE__*/_jsx(MinusOutlined, {})
464
+ }), enableMaximization && /*#__PURE__*/_jsx("span", {
465
+ className: "".concat(prefixCls, "-item"),
466
+ onClick: toggleMaximization,
467
+ children: maximization ? /*#__PURE__*/_jsx(FullscreenExitOutlined, {}) : /*#__PURE__*/_jsx(FullscreenOutlined, {})
468
+ }), /*#__PURE__*/_jsx("span", {
469
+ className: "".concat(prefixCls, "-item"),
470
+ onClick: handleClose,
471
+ children: /*#__PURE__*/_jsx(CloseOutlined, {})
472
+ })]
473
+ });
474
+ };
475
+ var renderHeader = function renderHeader() {
476
+ var headerStyleObj = _objectSpread(_objectSpread(_objectSpread({}, headerStyle), minimize ? {
477
+ boxShadow: '0 2px 20px 0 rgba(4, 1, 30, 0.07)'
478
+ } : {}), isEmbed ? {
479
+ cursor: 'initial'
480
+ } : {});
481
+ return /*#__PURE__*/_jsxs("header", {
482
+ className: "".concat(prefixCls, "-header"),
483
+ style: headerStyleObj,
484
+ onPointerDown: onDragStart,
485
+ onDoubleClick: toggleMaximization,
486
+ children: [/*#__PURE__*/_jsx("span", {
487
+ className: "".concat(prefixCls, "-title"),
488
+ children: title || (locale === null || locale === void 0 ? void 0 : locale.helpDocument)
489
+ }), renderControls()]
490
+ });
491
+ };
492
+ var renderMask = function renderMask() {
493
+ if (!mask) return null;
494
+ return /*#__PURE__*/_jsx("div", {
495
+ className: "".concat(prefixCls, "-mask")
496
+ });
497
+ };
498
+ var renderContent = function renderContent() {
499
+ return /*#__PURE__*/_jsxs("main", {
500
+ className: "".concat(prefixCls, "-main"),
501
+ style: minimize ? {
502
+ visibility: 'hidden'
503
+ } : {},
504
+ children: [renderMask(), children]
505
+ });
506
+ };
507
+ var renderEmbedBorders = function renderEmbedBorders() {
508
+ return /*#__PURE__*/_jsx(React.Fragment, {
509
+ children: /*#__PURE__*/_jsx(Anchor, {
510
+ prefixCls: prefixCls,
511
+ dock: Dock.left,
512
+ onStart: onResizeStart,
513
+ onMove: onResizeMove,
514
+ onEnd: onResizeEnd
515
+ })
516
+ });
517
+ };
518
+ var renderBorders = function renderBorders() {
519
+ return /*#__PURE__*/_jsxs(React.Fragment, {
520
+ children: [/*#__PURE__*/_jsx(Anchor, {
521
+ prefixCls: prefixCls,
522
+ dock: Dock.top,
523
+ onStart: onResizeStart,
524
+ onMove: onResizeMove,
525
+ onEnd: onResizeEnd
526
+ }), /*#__PURE__*/_jsx(Anchor, {
527
+ prefixCls: prefixCls,
528
+ dock: Dock.right,
529
+ onStart: onResizeStart,
530
+ onMove: onResizeMove,
531
+ onEnd: onResizeEnd
532
+ }), /*#__PURE__*/_jsx(Anchor, {
533
+ prefixCls: prefixCls,
534
+ dock: Dock.bottom,
535
+ onStart: onResizeStart,
536
+ onMove: onResizeMove,
537
+ onEnd: onResizeEnd
538
+ }), /*#__PURE__*/_jsx(Anchor, {
539
+ prefixCls: prefixCls,
540
+ dock: Dock.left,
541
+ onStart: onResizeStart,
542
+ onMove: onResizeMove,
543
+ onEnd: onResizeEnd
544
+ }), /*#__PURE__*/_jsx(Anchor, {
545
+ prefixCls: prefixCls,
546
+ dock: Dock.topLeft,
547
+ onStart: onResizeStart,
548
+ onMove: onResizeMove,
549
+ onEnd: onResizeEnd
550
+ }), /*#__PURE__*/_jsx(Anchor, {
551
+ prefixCls: prefixCls,
552
+ dock: Dock.topRight,
553
+ onStart: onResizeStart,
554
+ onMove: onResizeMove,
555
+ onEnd: onResizeEnd
556
+ }), /*#__PURE__*/_jsx(Anchor, {
557
+ prefixCls: prefixCls,
558
+ dock: Dock.bottomLeft,
559
+ onStart: onResizeStart,
560
+ onMove: onResizeMove,
561
+ onEnd: onResizeEnd
562
+ }), /*#__PURE__*/_jsx(Anchor, {
563
+ prefixCls: prefixCls,
564
+ dock: Dock.bottomRight,
565
+ onStart: onResizeStart,
566
+ onMove: onResizeMove,
567
+ onEnd: onResizeEnd
568
+ })]
569
+ });
570
+ };
571
+ var renderDialog = function renderDialog() {
572
+ var style = getStyle;
573
+ return wrapSSR( /*#__PURE__*/_jsxs("div", _objectSpread(_objectSpread({
574
+ className: "".concat(prefixCls, "-container ").concat(className || '', " ").concat(isEmbed ? "".concat(prefixCls, "-container-embed") : ''),
575
+ style: style
576
+ }, minimize ? {} : {
577
+ tabIndex: 0
578
+ }), {}, {
579
+ children: [renderHeader(), renderContent(), isEmbed ? renderEmbedBorders() : renderBorders(), /*#__PURE__*/_jsx(EventProxy, {
580
+ onPointerMove: onDragMove,
581
+ onPointerUp: onDragEnd
582
+ }), /*#__PURE__*/_jsx(EventProxy, {
583
+ onPointerUp: detectPointUp
584
+ })]
585
+ })));
586
+ };
587
+
588
+ // 嵌入模式通过style控制显隐
589
+ if (!visible && !isEmbed) return /*#__PURE__*/_jsx(React.Fragment, {});
590
+ return /*#__PURE__*/createPortal(renderDialog(), getContainer());
591
+ };
632
592
  export default LocaleWrapper({
633
593
  componentName: 'Dialog',
634
594
  defaultLocale: zhCN